@rizom/ops 0.2.0-alpha.849 → 0.2.0-alpha.850
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brains-ops.js +77 -71
- package/dist/index.js +106 -100
- package/dist/secrets-encrypt.d.ts +1 -0
- package/package.json +1 -1
- package/templates/rover-pilot/.env.schema +5 -0
- package/templates/rover-pilot/deploy/scripts/decrypt-user-secrets.ts +3 -0
- package/templates/rover-pilot/docs/onboarding-checklist.md +1 -0
- package/templates/rover-pilot/docs/operator-playbook.md +32 -0
|
@@ -6,6 +6,7 @@ declare const encryptedUserSecretsSchema: z.ZodObject<{
|
|
|
6
6
|
discordApplicationId: z.ZodOptional<z.ZodString>;
|
|
7
7
|
openaiApiKey: z.ZodOptional<z.ZodString>;
|
|
8
8
|
atprotoAppPassword: z.ZodOptional<z.ZodString>;
|
|
9
|
+
resendApiKey: z.ZodOptional<z.ZodString>;
|
|
9
10
|
certificatePem: z.ZodOptional<z.ZodString>;
|
|
10
11
|
privateKeyPem: z.ZodOptional<z.ZodString>;
|
|
11
12
|
}>;
|
package/package.json
CHANGED
|
@@ -45,6 +45,11 @@ DISCORD_APPLICATION_ID=
|
|
|
45
45
|
# @sensitive
|
|
46
46
|
ATPROTO_APP_PASSWORD=
|
|
47
47
|
|
|
48
|
+
# Resend newsletter delivery (optional, per-user)
|
|
49
|
+
# Comes from the decrypted users/<handle>.secrets.yaml.age file when configured.
|
|
50
|
+
# @sensitive
|
|
51
|
+
RESEND_API_KEY=
|
|
52
|
+
|
|
48
53
|
# Setup email delivery (optional, shared)
|
|
49
54
|
# Used when a user file declares setup.delivery: email.
|
|
50
55
|
# @sensitive
|
|
@@ -32,6 +32,9 @@ writeSecretGitHubEnv("DISCORD_APPLICATION_ID", secrets["discordApplicationId"]);
|
|
|
32
32
|
// brain's agent card to its PDS; a deployment that doesn't publish simply
|
|
33
33
|
// leaves it unset.
|
|
34
34
|
writeSecretGitHubEnv("ATPROTO_APP_PASSWORD", secrets["atprotoAppPassword"]);
|
|
35
|
+
// Per-user Resend key for the newsletter (optional; from the user's encrypted
|
|
36
|
+
// secrets file). It grants its whole Resend account, so it is never shared.
|
|
37
|
+
writeSecretGitHubEnv("RESEND_API_KEY", secrets["resendApiKey"]);
|
|
35
38
|
// Per-user custom-domain TLS overrides the shared fleet certificate when a
|
|
36
39
|
// complete certificate/key pair is present in the encrypted user secrets.
|
|
37
40
|
const certificatePem = decodeEscapedSecret(secrets["certificatePem"]);
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
5. Edit the generated user file if the anchor profile needs richer metadata.
|
|
16
16
|
- Set `setup.delivery: email` and `setup.email` so the user gets the passkey setup email — this is the default onboarding path.
|
|
17
17
|
- For ATProto publishing, add `atproto.identifier` to the user file; put only `atprotoAppPassword` in the per-user secrets file.
|
|
18
|
+
- For a Resend newsletter, put `resendApiKey` in the per-user secrets file and the provider config in the user file (see the operator playbook's Resend newsletter checklist).
|
|
18
19
|
- Ensure `MAIL_API_KEY` and `MAIL_FROM` exist as GitHub Secrets before deploying any email-setup user.
|
|
19
20
|
6. Run `bunx brains-ops render <repo>`.
|
|
20
21
|
7. Run `bunx brains-ops ssh-key:bootstrap <repo> --push-to gh`.
|
|
@@ -440,6 +440,38 @@ Notes:
|
|
|
440
440
|
- The ATProto app password is secret and belongs only in the encrypted per-user secret payload.
|
|
441
441
|
- For smoke deployments, pin only the smoke cohort/user to the released brain version that contains ATProto support.
|
|
442
442
|
|
|
443
|
+
## Resend newsletter checklist
|
|
444
|
+
|
|
445
|
+
Use this when a pilot user's brain sends its newsletter through Resend.
|
|
446
|
+
|
|
447
|
+
1. Create a full-access API key in the user's Resend account (the newsletter manages contacts and broadcasts, which a sending-only key cannot).
|
|
448
|
+
2. Put it in `users/<handle>.secrets.yaml`:
|
|
449
|
+
|
|
450
|
+
```yaml
|
|
451
|
+
resendApiKey: <resend-api-key>
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
3. Encrypt the per-user secret payload:
|
|
455
|
+
- `bunx brains-ops secrets:encrypt . <handle>`
|
|
456
|
+
4. Add `newsletter` to the user's capabilities and configure the provider in `users/<handle>.yaml`:
|
|
457
|
+
|
|
458
|
+
```yaml
|
|
459
|
+
plugins:
|
|
460
|
+
newsletter:
|
|
461
|
+
provider:
|
|
462
|
+
type: resend
|
|
463
|
+
apiKey: ${RESEND_API_KEY}
|
|
464
|
+
segmentId: <segment-id>
|
|
465
|
+
from: "Name <sender@verified-domain>"
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
5. Reconcile/deploy the user or cohort, then check the brain lists the segment's contacts with `newsletter_subscribers`.
|
|
469
|
+
|
|
470
|
+
Notes:
|
|
471
|
+
|
|
472
|
+
- `secrets:encrypt` takes `resendApiKey` only from the user's secrets file or the existing encrypted payload, never from `RESEND_API_KEY` in the operator environment: that key belongs to the operator's own Resend account.
|
|
473
|
+
- The segment ID and sender are public config and belong in `users/<handle>.yaml`; the sender's domain must be verified in the same Resend account.
|
|
474
|
+
|
|
443
475
|
## Discord application credential checklist
|
|
444
476
|
|
|
445
477
|
Discord is optional. Browser chat with passkey setup is the default pilot interface. Use this checklist only when enabling Discord for a user.
|