@rizom/ops 0.2.0-alpha.687 → 0.2.0-alpha.689

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.
@@ -15,7 +15,7 @@ export interface ResolvedCohort {
15
15
  bundlesOverride?: CanonicalBundleId[];
16
16
  addOverride?: string[];
17
17
  removeOverride?: string[];
18
- aiApiKeyOverride?: string;
18
+ openaiApiKeyOverride?: string;
19
19
  gitSyncTokenOverride?: string;
20
20
  }
21
21
  export interface ResolvedAnchorProfileSocialLink {
@@ -96,7 +96,7 @@ export interface ResolvedUserIdentity {
96
96
  siteOverride?: ResolvedSiteOverride;
97
97
  discordEnabled: boolean;
98
98
  discordAnchorUserId?: string;
99
- effectiveAiApiKey: string;
99
+ effectiveOpenaiApiKey: string;
100
100
  effectiveGitSyncToken: string;
101
101
  setup?: ResolvedSetupDelivery;
102
102
  atproto?: ResolvedAtprotoConfig;
@@ -0,0 +1,20 @@
1
+ import { type Document } from "yaml";
2
+ /**
3
+ * Rename a desired-state file's legacy AI key fields in place, keeping their
4
+ * position and comments. The shared selector follows the variable rename;
5
+ * an override keeps the operator secret it names.
6
+ */
7
+ export declare function migrateProviderKeyFieldsYaml(input: string): string;
8
+ /** The legacy AI key fields of a desired-state document, renamed in place. */
9
+ export declare function renameProviderKeyFields(document: Document): boolean;
10
+ /** The OpenAI selector for a legacy shared AI key selector. */
11
+ export declare function openaiSelectorFor(legacySelector: string): string;
12
+ /** Pass the OpenAI key to the container where the deploy passed the legacy key. */
13
+ export declare function migratePilotDeploySecrets(input: string): string;
14
+ /** Rename the legacy shared key's variable, keeping where its value comes from. */
15
+ export declare function migratePilotEnvSchema(input: string): string;
16
+ /**
17
+ * Migrate a pilot checkout in place; returns the files it changed. Running
18
+ * it again changes nothing.
19
+ */
20
+ export declare function migratePilotRepoProviderKeys(rootDir: string, env: NodeJS.ProcessEnv): Promise<string[]>;
package/dist/schema.d.ts CHANGED
@@ -54,7 +54,7 @@ export declare const pilotSchema: z.ZodObject<{
54
54
  githubOrg: z.ZodString;
55
55
  contentRepoPrefix: z.ZodString;
56
56
  domainSuffix: z.ZodString;
57
- aiApiKey: z.ZodString;
57
+ openaiApiKey: z.ZodString;
58
58
  gitSyncToken: z.ZodString;
59
59
  contentRepoAdminToken: z.ZodString;
60
60
  agePublicKey: z.ZodString;
@@ -66,7 +66,7 @@ export declare const cohortSchema: z.ZodObject<{
66
66
  bundlesOverride: z.ZodOptional<typeof canonicalBundlesSchema>;
67
67
  addOverride: z.ZodOptional<typeof memberIdsSchema>;
68
68
  removeOverride: z.ZodOptional<typeof memberIdsSchema>;
69
- aiApiKeyOverride: z.ZodOptional<z.ZodString>;
69
+ openaiApiKeyOverride: z.ZodOptional<z.ZodString>;
70
70
  gitSyncTokenOverride: z.ZodOptional<z.ZodString>;
71
71
  }, z.core.$strict>;
72
72
  export type CohortConfig = z.output<typeof cohortSchema>;
@@ -131,7 +131,7 @@ export declare const userSchema: z.ZodObject<{
131
131
  enabled: z.ZodBoolean;
132
132
  anchorUserId: z.ZodOptional<z.ZodString>;
133
133
  }>;
134
- aiApiKeyOverride: z.ZodOptional<z.ZodString>;
134
+ openaiApiKeyOverride: z.ZodOptional<z.ZodString>;
135
135
  gitSyncTokenOverride: z.ZodOptional<z.ZodString>;
136
136
  domainOverride: z.ZodOptional<z.ZodString>;
137
137
  cloudflareZoneId: z.ZodOptional<z.ZodString>;
@@ -4,7 +4,7 @@ declare const encryptedUserSecretsSchema: z.ZodObject<{
4
4
  discordBotToken: z.ZodOptional<z.ZodString>;
5
5
  discordPublicKey: z.ZodOptional<z.ZodString>;
6
6
  discordApplicationId: z.ZodOptional<z.ZodString>;
7
- aiApiKey: z.ZodOptional<z.ZodString>;
7
+ openaiApiKey: z.ZodOptional<z.ZodString>;
8
8
  atprotoAppPassword: z.ZodOptional<z.ZodString>;
9
9
  certificatePem: z.ZodOptional<z.ZodString>;
10
10
  privateKeyPem: z.ZodOptional<z.ZodString>;
@@ -23,4 +23,5 @@ export interface SecretsEncryptResult {
23
23
  dryRun?: boolean | undefined;
24
24
  }
25
25
  export declare function encryptPilotSecrets(rootDir: string, handle: string, options?: SecretsEncryptOptions): Promise<SecretsEncryptResult>;
26
+ export declare function readAgeIdentity(rootDir: string, env: NodeJS.ProcessEnv, localEnvValues: Record<string, string>): string | undefined;
26
27
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rizom/ops",
3
- "version": "0.2.0-alpha.687",
3
+ "version": "0.2.0-alpha.689",
4
4
  "description": "Operator CLI for managing private brain fleet registry repos",
5
5
  "keywords": [
6
6
  "brains",
@@ -3,11 +3,19 @@
3
3
  # @defaultRequired=false @defaultSensitive=false
4
4
  # ----------
5
5
 
6
- # AI provider
7
- # Shared GitHub secret by default; a per-user override may come from the decrypted
6
+ # OpenAI, the provider of the canonical chat and embedding models
7
+ # Shared secret by default; a per-user override may come from the decrypted
8
8
  # users/<handle>.secrets.yaml.age file at deploy time.
9
9
  # @required @sensitive
10
- AI_API_KEY=
10
+ OPENAI_API_KEY=
11
+
12
+ # Anthropic and Google: unused by the canonical models; the shared deploy
13
+ # config passes every provider's key to the brain.
14
+ # @sensitive
15
+ ANTHROPIC_API_KEY=
16
+
17
+ # @sensitive
18
+ GOOGLE_GENERATIVE_AI_API_KEY=
11
19
 
12
20
  # Git sync
13
21
  # Comes from the decrypted users/<handle>.secrets.yaml.age file.
@@ -18,7 +18,7 @@ const plaintext = await decrypter.decrypt(decoded, "text");
18
18
  const secrets = parseStringYamlMapping(plaintext);
19
19
  const pilot = parseStringYamlMapping(readFileSync("pilot.yaml", "utf8"));
20
20
 
21
- writeSecretGitHubEnv("AI_API_KEY", secrets["aiApiKey"]);
21
+ writeSecretGitHubEnv("OPENAI_API_KEY", secrets["openaiApiKey"]);
22
22
  writeSecretGitHubEnv("GIT_SYNC_TOKEN", secrets["gitSyncToken"]);
23
23
  writeSecretGitHubEnv(
24
24
  "STUDIO_CONTENT_REPO_PAT",
@@ -63,8 +63,8 @@ function assertPemShape(name: string, value: string | undefined): void {
63
63
  }
64
64
 
65
65
  writeGitHubOutput(
66
- "shared_ai_api_key_secret_name",
67
- requireFlatValue(pilot, "aiApiKey", "pilot.yaml"),
66
+ "shared_openai_api_key_secret_name",
67
+ requireFlatValue(pilot, "openaiApiKey", "pilot.yaml"),
68
68
  );
69
69
  writeGitHubOutput(
70
70
  "shared_git_sync_token_secret_name",
@@ -4,7 +4,7 @@
4
4
  2. Run `bunx brains-ops age-key:bootstrap <repo> --push-to gh`.
5
5
  3. Fill in `pilot.yaml`.
6
6
  - keep your pinned `brainVersion`
7
- - confirm shared selectors for `aiApiKey`, `gitSyncToken`, and `contentRepoAdminToken`
7
+ - confirm shared selectors for `openaiApiKey`, `gitSyncToken`, and `contentRepoAdminToken`
8
8
  - use different tokens for `contentRepoAdminToken` and `gitSyncToken`: admin creates/checks content repos; sync is used by runtime directory-sync
9
9
  - confirm `agePublicKey`
10
10
  4. Run `bunx brains-ops user:add <repo> <handle> --cohort <cohort>`.
@@ -8,7 +8,7 @@ bundles:
8
8
  - media
9
9
  - web
10
10
  - chat
11
- aiApiKey: AI_API_KEY
11
+ openaiApiKey: OPENAI_API_KEY
12
12
  gitSyncToken: GIT_SYNC_TOKEN
13
13
  contentRepoAdminToken: CONTENT_REPO_ADMIN_TOKEN
14
14
  agePublicKey: age1replace-with-your-public-key