@rizom/ops 0.2.0-alpha.34 → 0.2.0-alpha.340

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.
Files changed (61) hide show
  1. package/README.md +61 -2
  2. package/dist/brains-ops.js +700 -318
  3. package/dist/capability-bundle-migration.d.ts +22 -0
  4. package/dist/cert-bootstrap.d.ts +3 -1
  5. package/dist/content-repo-ref.d.ts +10 -0
  6. package/dist/content-repo.d.ts +1 -0
  7. package/dist/deploy.js +99 -166
  8. package/dist/directory-sync-stress-system.d.ts +75 -0
  9. package/dist/directory-sync-stress.d.ts +107 -0
  10. package/dist/entries/deploy.d.ts +3 -2
  11. package/dist/health-watchdog-smoke.d.ts +54 -0
  12. package/dist/images.d.ts +79 -0
  13. package/dist/index.d.ts +8 -0
  14. package/dist/index.js +776 -308
  15. package/dist/legacy-pilot-migration.d.ts +11 -0
  16. package/dist/load-registry.d.ts +60 -6
  17. package/dist/observed-status.d.ts +1 -1
  18. package/dist/origin-ca.d.ts +1 -1
  19. package/dist/parse-args.d.ts +2 -10
  20. package/dist/preview-domain.d.ts +9 -0
  21. package/dist/push-secrets.d.ts +2 -9
  22. package/dist/push-target.d.ts +1 -2
  23. package/dist/reconcile-dry-run.d.ts +9 -0
  24. package/dist/run-command.d.ts +15 -3
  25. package/dist/run-subprocess.d.ts +1 -6
  26. package/dist/schema.d.ts +123 -162
  27. package/dist/secrets-encrypt.d.ts +7 -13
  28. package/dist/ssh-key-bootstrap.d.ts +1 -26
  29. package/dist/stage-legacy-crossover.d.ts +23 -0
  30. package/dist/stress-command.d.ts +14 -0
  31. package/dist/stress-git-checkout.d.ts +21 -0
  32. package/dist/stress-health-monitor.d.ts +46 -0
  33. package/dist/upgrade.d.ts +10 -0
  34. package/dist/user-add.d.ts +15 -0
  35. package/dist/verify-user.d.ts +22 -0
  36. package/package.json +48 -42
  37. package/templates/rover-pilot/.env.schema +24 -3
  38. package/templates/rover-pilot/.github/actions/varlock-env/action.yml +47 -0
  39. package/templates/rover-pilot/.github/workflows/build.yml +70 -17
  40. package/templates/rover-pilot/.github/workflows/deploy.yml +63 -57
  41. package/templates/rover-pilot/.github/workflows/directory-sync-stress.yml +119 -0
  42. package/templates/rover-pilot/.github/workflows/health-watchdog-smoke.yml +95 -0
  43. package/templates/rover-pilot/.github/workflows/reconcile.yml +10 -4
  44. package/templates/rover-pilot/.github/workflows/upgrade.yml +104 -0
  45. package/templates/rover-pilot/README.md +16 -6
  46. package/templates/rover-pilot/deploy/scripts/decrypt-user-secrets.ts +80 -24
  47. package/templates/rover-pilot/deploy/scripts/helpers.ts +3 -0
  48. package/templates/rover-pilot/deploy/scripts/install-health-watchdog.ts +144 -0
  49. package/templates/rover-pilot/deploy/scripts/resolve-missing-images.ts +13 -0
  50. package/templates/rover-pilot/deploy/scripts/resolve-user-config.ts +44 -9
  51. package/templates/rover-pilot/deploy/scripts/sync-content-repo.ts +51 -47
  52. package/templates/rover-pilot/deploy/scripts/update-dns.ts +14 -4
  53. package/templates/rover-pilot/deploy/scripts/validate-secrets.ts +12 -1
  54. package/templates/rover-pilot/docs/canonical-crossover-record.md +107 -0
  55. package/templates/rover-pilot/docs/onboarding-checklist.md +28 -17
  56. package/templates/rover-pilot/docs/operator-playbook.md +270 -29
  57. package/templates/rover-pilot/docs/user-onboarding.md +48 -463
  58. package/templates/rover-pilot/pilot.yaml +7 -4
  59. package/templates/rover-pilot/.kamal/hooks/pre-deploy +0 -9
  60. package/templates/rover-pilot/deploy/Dockerfile +0 -30
  61. package/templates/rover-pilot/deploy/kamal/deploy.yml +0 -40
@@ -0,0 +1,11 @@
1
+ import { type CohortConfig, type PilotConfig } from "./schema";
2
+ /** Offline-only conversion. Active desired-state loading never calls this. */
3
+ export declare function migrateLegacyPilotConfig(input: unknown): PilotConfig;
4
+ /** Offline-only cohort conversion. */
5
+ export declare function migrateLegacyCohortConfig(input: unknown): CohortConfig;
6
+ /** Offline-only YAML rewrite that retains comments while changing the schema. */
7
+ export declare function migrateLegacyPilotYaml(input: string): string;
8
+ /** Offline-only cohort rewrite that retains comments while changing selection. */
9
+ export declare function migrateLegacyCohortYaml(input: string): string;
10
+ export declare function renderPilotConfig(config: PilotConfig): string;
11
+ export declare function renderCohortConfig(config: CohortConfig): string;
@@ -1,4 +1,4 @@
1
- import { type PilotConfig, type PilotPreset } from "./schema";
1
+ import { type PilotConfig, type CanonicalBundleId } from "./schema";
2
2
  export type ExternalStatus = "unknown" | "ready" | "failed";
3
3
  export type SnapshotStatus = "present" | "missing";
4
4
  export interface ObservedUserStatus {
@@ -11,10 +11,11 @@ export interface ResolvedCohort {
11
11
  id: string;
12
12
  members: string[];
13
13
  brainVersionOverride?: string;
14
- presetOverride?: PilotPreset;
14
+ bundlesOverride?: CanonicalBundleId[];
15
+ addOverride?: string[];
16
+ removeOverride?: string[];
15
17
  aiApiKeyOverride?: string;
16
18
  gitSyncTokenOverride?: string;
17
- mcpAuthTokenOverride?: string;
18
19
  }
19
20
  export interface ResolvedAnchorProfileSocialLink {
20
21
  platform: "github" | "instagram" | "linkedin" | "email" | "website";
@@ -29,19 +30,72 @@ export interface ResolvedAnchorProfile {
29
30
  story?: string;
30
31
  socialLinks?: ResolvedAnchorProfileSocialLink[];
31
32
  }
33
+ export interface ResolvedSetupDelivery {
34
+ delivery: "email";
35
+ email: string;
36
+ }
37
+ export interface ResolvedAtprotoJetstreamConfig {
38
+ enabled?: boolean | undefined;
39
+ endpoint?: string | undefined;
40
+ replayWindowSeconds?: number | undefined;
41
+ denyDids?: string[] | undefined;
42
+ denyDomains?: string[] | undefined;
43
+ skillKeywords?: string[] | undefined;
44
+ queueLimit?: number | undefined;
45
+ concurrency?: number | undefined;
46
+ perDidCooldownSeconds?: number | undefined;
47
+ fetchBudgetPerMinute?: number | undefined;
48
+ newAgentsPerHour?: number | undefined;
49
+ pendingCandidateCeiling?: number | undefined;
50
+ staleCandidateRetentionDays?: number | undefined;
51
+ requestTimeoutMs?: number | undefined;
52
+ maxResponseBytes?: number | undefined;
53
+ maxRedirects?: number | undefined;
54
+ retryAttempts?: number | undefined;
55
+ heartbeatIntervalHours?: number | undefined;
56
+ }
57
+ export interface ResolvedAtprotoConfig {
58
+ identifier: string;
59
+ /** Owner account DID served at /.well-known/atproto-did for handle verification. */
60
+ accountDid?: string | undefined;
61
+ /** Whether this account publishes the canonical ai.rizom.brain.* schemas. */
62
+ lexiconAuthority?: boolean | undefined;
63
+ /** Per-brain bounded Jetstream canary configuration. */
64
+ jetstream?: ResolvedAtprotoJetstreamConfig | undefined;
65
+ }
66
+ export interface ResolvedPlaybooksConfig {
67
+ onboarding?: boolean | undefined;
68
+ }
69
+ export interface ResolvedSiteOverride {
70
+ package: string;
71
+ version: string;
72
+ theme?: string | undefined;
73
+ themeVersion?: string | undefined;
74
+ }
32
75
  export interface ResolvedUserIdentity {
33
76
  handle: string;
34
77
  cohort: string;
35
78
  brainVersion: string;
36
- model: "rover";
37
- preset: PilotPreset;
79
+ bundleContract: PilotConfig["bundleContract"];
80
+ bundles: CanonicalBundleId[];
81
+ add: string[];
82
+ remove: string[];
38
83
  domain: string;
84
+ cloudflareZoneId?: string | undefined;
39
85
  contentRepo: string;
86
+ profileKind?: string | undefined;
87
+ embeddingEnabled?: boolean | undefined;
88
+ topicExtractionEnabled?: boolean | undefined;
89
+ skillDerivationEnabled?: boolean | undefined;
90
+ swotDerivationEnabled?: boolean | undefined;
91
+ siteOverride?: ResolvedSiteOverride;
40
92
  discordEnabled: boolean;
41
93
  discordAnchorUserId?: string;
42
94
  effectiveAiApiKey: string;
43
95
  effectiveGitSyncToken: string;
44
- effectiveMcpAuthToken: string;
96
+ setup?: ResolvedSetupDelivery;
97
+ atproto?: ResolvedAtprotoConfig;
98
+ playbooks?: ResolvedPlaybooksConfig;
45
99
  anchorProfile: ResolvedAnchorProfile;
46
100
  snapshotStatus: SnapshotStatus;
47
101
  }
@@ -1,4 +1,4 @@
1
- import type { FetchLike } from "@brains/utils/origin-ca";
1
+ import type { FetchLike } from "@brains/deploy-support/origin-ca";
2
2
  import type { ObservedUserStatus, ResolvedUserIdentity } from "./load-registry";
3
3
  export interface LookupResult {
4
4
  address: string;
@@ -1 +1 @@
1
- export { createOriginCertificateRequest, generateOriginKeyPair, issueCloudflareOriginCertificate, setCloudflareZoneSslStrict, type CloudflareOriginCaResult, type FetchLike, type OriginCertificateRequest, type OriginKeyPair, } from "@brains/utils/origin-ca";
1
+ export { createOriginCertificateRequest, generateOriginKeyPair, issueCloudflareOriginCertificate, setCloudflareZoneSslStrict, type CloudflareOriginCaResult, type FetchLike, type OriginCertificateRequest, type OriginKeyPair, } from "@brains/deploy-support/origin-ca";
@@ -1,11 +1,3 @@
1
- export interface ParsedArgs {
2
- command: string;
3
- args: string[];
4
- flags: {
5
- help?: boolean | undefined;
6
- version?: boolean | undefined;
7
- dryRun?: boolean | undefined;
8
- pushTo?: string | undefined;
9
- };
10
- }
1
+ import { type ParsedCliArgs } from "@brains/deploy-support/cli-kit";
2
+ export type ParsedArgs = ParsedCliArgs;
11
3
  export declare function parseArgs(argv: string[]): ParsedArgs;
@@ -0,0 +1,9 @@
1
+ export interface PreviewDomainOptions {
2
+ sharedDomain?: string | undefined;
3
+ }
4
+ /**
5
+ * Public operator-facing wrapper around the runtime's preview-domain rule.
6
+ * Keeping deploy resolution on this function prevents DNS, proxy, and runtime
7
+ * metadata from drifting onto different host shapes.
8
+ */
9
+ export declare function derivePreviewDomain(domain: string, options?: PreviewDomainOptions): string;
@@ -1,9 +1,2 @@
1
- import { normalizePushTarget, type PushTarget } from "./push-target";
2
- import { type RunCommand } from "./run-subprocess";
3
- export type SecretPair = readonly [name: string, value: string];
4
- export interface PushSecretsOptions {
5
- runCommand?: RunCommand | undefined;
6
- logger?: ((message: string) => void) | undefined;
7
- }
8
- export declare function pushSecretsToBackend(_target: PushTarget, secrets: readonly SecretPair[], options?: PushSecretsOptions): Promise<void>;
9
- export { normalizePushTarget };
1
+ export { logKeyGroup, logMissingSecrets, pushSecretsToBackend, type PushSecretsOptions, type SecretPair, } from "@brains/deploy-support/push-secrets";
2
+ export { normalizePushTarget } from "@brains/deploy-support/push-target";
@@ -1,2 +1 @@
1
- export type PushTarget = "gh";
2
- export declare function normalizePushTarget(value?: string): PushTarget | undefined;
1
+ export { normalizePushTarget, type PushTarget, } from "@brains/deploy-support/push-target";
@@ -0,0 +1,9 @@
1
+ export interface ReconcileDryRunResult {
2
+ firstPassChangedFiles: string[];
3
+ secondPassChangedFiles: string[];
4
+ }
5
+ /**
6
+ * Reconcile an isolated copy twice with external content-repo access disabled.
7
+ * The source repository is never written.
8
+ */
9
+ export declare function dryRunReconcileAll(rootDir: string): Promise<ReconcileDryRunResult>;
@@ -1,10 +1,12 @@
1
- import type { FetchLike } from "@brains/utils/origin-ca";
1
+ import type { FetchLike } from "@brains/deploy-support/origin-ca";
2
+ import { type CommandDefinition, type FlagDefinitions, type ParsedCliArgs } from "@brains/deploy-support/cli-kit";
2
3
  import type { LoadPilotRegistryOptions } from "./load-registry";
3
4
  import { type LookupHost } from "./observed-status";
4
- import type { ParsedArgs } from "./parse-args";
5
5
  import { type RunCommand as OpsRunCommand } from "./run-subprocess";
6
6
  import { type SshKeygen } from "./ssh-key-bootstrap";
7
7
  import type { UserRunner } from "./user-runner";
8
+ import type { cleanupDirectorySyncStress, runDeployedDirectorySyncStress, verifyDirectorySyncStressAccess } from "./directory-sync-stress-system";
9
+ import type { cleanupHealthWatchdogSmoke, runHealthWatchdogSmoke } from "./health-watchdog-smoke";
8
10
  export interface CommandResult {
9
11
  success: boolean;
10
12
  message?: string;
@@ -15,7 +17,17 @@ export interface CommandDependencies extends LoadPilotRegistryOptions {
15
17
  logger?: ((message: string) => void) | undefined;
16
18
  fetchImpl?: FetchLike | undefined;
17
19
  lookupHost?: LookupHost | undefined;
20
+ verificationRetryAttempts?: number | undefined;
21
+ verificationRetryDelayMs?: number | undefined;
22
+ sleep?: ((delayMs: number) => Promise<void>) | undefined;
18
23
  bootstrapRunCommand?: OpsRunCommand | undefined;
19
24
  sshKeygen?: SshKeygen | undefined;
25
+ directorySyncStressRunner?: typeof runDeployedDirectorySyncStress | undefined;
26
+ directorySyncStressAccessRunner?: typeof verifyDirectorySyncStressAccess | undefined;
27
+ directorySyncStressCleanupRunner?: typeof cleanupDirectorySyncStress | undefined;
28
+ healthWatchdogSmokeRunner?: typeof runHealthWatchdogSmoke | undefined;
29
+ healthWatchdogSmokeCleanupRunner?: typeof cleanupHealthWatchdogSmoke | undefined;
20
30
  }
21
- export declare function runCommand(parsed: ParsedArgs, dependencies?: CommandDependencies): Promise<CommandResult>;
31
+ export declare const globalFlags: FlagDefinitions;
32
+ export declare const commands: readonly CommandDefinition<CommandDependencies, CommandResult>[];
33
+ export declare function runCommand(parsed: ParsedCliArgs, dependencies?: CommandDependencies): Promise<CommandResult>;
@@ -1,6 +1 @@
1
- export type RunCommand = (command: string, args: string[], options?: {
2
- stdin?: string;
3
- env?: NodeJS.ProcessEnv;
4
- cwd?: string;
5
- }) => Promise<void>;
6
- export declare const runSubprocess: RunCommand;
1
+ export { runSubprocess, type RunCommand, } from "@brains/deploy-support/run-subprocess";
package/dist/schema.d.ts CHANGED
@@ -1,183 +1,144 @@
1
- import { z } from "@brains/utils";
2
- export declare const presetSchema: z.ZodEnum<["core", "default", "pro"]>;
1
+ import { z } from "@brains/utils/zod";
3
2
  export declare const exactVersionSchema: z.ZodString;
4
3
  export declare const handleSchema: z.ZodString;
5
4
  export declare const secretNameSchema: z.ZodString;
6
5
  export declare const agePublicKeySchema: z.ZodString;
7
- export declare const pilotSchema: z.ZodObject<{
8
- schemaVersion: z.ZodLiteral<1>;
9
- brainVersion: z.ZodString;
10
- model: z.ZodLiteral<"rover">;
11
- githubOrg: z.ZodString;
12
- contentRepoPrefix: z.ZodString;
13
- domainSuffix: z.ZodString;
14
- preset: z.ZodEnum<["core", "default", "pro"]>;
15
- aiApiKey: z.ZodString;
16
- gitSyncToken: z.ZodString;
17
- mcpAuthToken: z.ZodString;
18
- agePublicKey: z.ZodString;
19
- }, "strict", z.ZodTypeAny, {
20
- agePublicKey: string;
21
- schemaVersion: 1;
6
+ export declare const CAPABILITY_BUNDLE_CONTRACT: "capability-bundles-v1";
7
+ export declare const canonicalBundleIdSchema: z.ZodEnum<{
8
+ core: "core";
9
+ media: "media";
10
+ automation: "automation";
11
+ web: "web";
12
+ chat: "chat";
13
+ site: "site";
14
+ publishing: "publishing";
15
+ federation: "federation";
16
+ team: "team";
17
+ }>;
18
+ export type CanonicalBundleId = z.output<typeof canonicalBundleIdSchema>;
19
+ /**
20
+ * The profile kinds the runtime's profile plugin registers. A user config
21
+ * selecting anything else composes a brain that fails at boot, so reject it
22
+ * at parse time. Kept in lockstep with @brains/profile BUILT_IN_PROFILE_KINDS
23
+ * by a test. Collective/organization brains use "organization".
24
+ */
25
+ export declare const PROFILE_KINDS: readonly ["professional", "team", "organization"];
26
+ export declare const profileKindSchema: z.ZodEnum<{
27
+ professional: "professional";
28
+ team: "team";
29
+ organization: "organization";
30
+ }>;
31
+ export interface PilotConfig {
22
32
  brainVersion: string;
23
- model: "rover";
33
+ bundleContract: typeof CAPABILITY_BUNDLE_CONTRACT;
34
+ bundles: CanonicalBundleId[];
35
+ add?: string[] | undefined;
36
+ remove?: string[] | undefined;
24
37
  githubOrg: string;
25
38
  contentRepoPrefix: string;
26
39
  domainSuffix: string;
27
- preset: "default" | "core" | "pro";
28
40
  aiApiKey: string;
29
41
  gitSyncToken: string;
30
- mcpAuthToken: string;
31
- }, {
42
+ contentRepoAdminToken: string;
32
43
  agePublicKey: string;
33
- schemaVersion: 1;
34
- brainVersion: string;
35
- model: "rover";
36
- githubOrg: string;
37
- contentRepoPrefix: string;
38
- domainSuffix: string;
39
- preset: "default" | "core" | "pro";
40
- aiApiKey: string;
41
- gitSyncToken: string;
42
- mcpAuthToken: string;
44
+ }
45
+ export interface SiteOverrideConfig {
46
+ package: string;
47
+ version: string;
48
+ theme?: string | undefined;
49
+ themeVersion?: string | undefined;
50
+ }
51
+ export interface CohortConfig {
52
+ members: string[];
53
+ brainVersionOverride?: string | undefined;
54
+ bundlesOverride?: CanonicalBundleId[] | undefined;
55
+ addOverride?: string[] | undefined;
56
+ removeOverride?: string[] | undefined;
57
+ aiApiKeyOverride?: string | undefined;
58
+ gitSyncTokenOverride?: string | undefined;
59
+ }
60
+ /** Sole active desired-state contract for the canonical brain. */
61
+ export declare const pilotSchema: z.ZodType<PilotConfig>;
62
+ export declare const cohortSchema: z.ZodType<CohortConfig>;
63
+ declare const anchorProfileSocialLinkSchema: z.ZodObject<{
64
+ platform: z.ZodEnum<{
65
+ github: "github";
66
+ instagram: "instagram";
67
+ linkedin: "linkedin";
68
+ email: "email";
69
+ website: "website";
70
+ }>;
71
+ url: z.ZodString;
72
+ label: z.ZodOptional<z.ZodString>;
73
+ }>;
74
+ declare const anchorProfileSchema: z.ZodObject<{
75
+ name: z.ZodOptional<z.ZodString>;
76
+ description: z.ZodOptional<z.ZodString>;
77
+ website: z.ZodOptional<z.ZodString>;
78
+ email: z.ZodOptional<z.ZodString>;
79
+ story: z.ZodOptional<z.ZodString>;
80
+ socialLinks: z.ZodOptional<z.ZodArray<typeof anchorProfileSocialLinkSchema>>;
81
+ }>;
82
+ declare const setupDeliverySchema: z.ZodObject<{
83
+ delivery: z.ZodLiteral<"email">;
84
+ email: z.ZodString;
85
+ }>;
86
+ declare const atprotoJetstreamSchema: z.ZodObject<{
87
+ enabled: z.ZodOptional<z.ZodBoolean>;
88
+ endpoint: z.ZodOptional<z.ZodString>;
89
+ replayWindowSeconds: z.ZodOptional<z.ZodNumber>;
90
+ denyDids: z.ZodOptional<z.ZodArray<z.ZodString>>;
91
+ denyDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
92
+ skillKeywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
93
+ queueLimit: z.ZodOptional<z.ZodNumber>;
94
+ concurrency: z.ZodOptional<z.ZodNumber>;
95
+ perDidCooldownSeconds: z.ZodOptional<z.ZodNumber>;
96
+ fetchBudgetPerMinute: z.ZodOptional<z.ZodNumber>;
97
+ newAgentsPerHour: z.ZodOptional<z.ZodNumber>;
98
+ pendingCandidateCeiling: z.ZodOptional<z.ZodNumber>;
99
+ staleCandidateRetentionDays: z.ZodOptional<z.ZodNumber>;
100
+ requestTimeoutMs: z.ZodOptional<z.ZodNumber>;
101
+ maxResponseBytes: z.ZodOptional<z.ZodNumber>;
102
+ maxRedirects: z.ZodOptional<z.ZodNumber>;
103
+ retryAttempts: z.ZodOptional<z.ZodNumber>;
104
+ heartbeatIntervalHours: z.ZodOptional<z.ZodNumber>;
105
+ }>;
106
+ declare const atprotoSchema: z.ZodObject<{
107
+ identifier: z.ZodString;
108
+ accountDid: z.ZodOptional<z.ZodString>;
109
+ lexiconAuthority: z.ZodOptional<z.ZodBoolean>;
110
+ jetstream: z.ZodOptional<typeof atprotoJetstreamSchema>;
111
+ }>;
112
+ export declare const siteOverrideSchema: z.ZodType<SiteOverrideConfig>;
113
+ declare const playbooksSchema: z.ZodObject<{
114
+ onboarding: z.ZodOptional<z.ZodBoolean>;
43
115
  }>;
44
116
  export declare const userSchema: z.ZodObject<{
45
117
  handle: z.ZodString;
46
118
  discord: z.ZodObject<{
47
119
  enabled: z.ZodBoolean;
48
120
  anchorUserId: z.ZodOptional<z.ZodString>;
49
- }, "strict", z.ZodTypeAny, {
50
- enabled: boolean;
51
- anchorUserId?: string | undefined;
52
- }, {
53
- enabled: boolean;
54
- anchorUserId?: string | undefined;
55
121
  }>;
56
122
  aiApiKeyOverride: z.ZodOptional<z.ZodString>;
57
123
  gitSyncTokenOverride: z.ZodOptional<z.ZodString>;
58
- mcpAuthTokenOverride: z.ZodOptional<z.ZodString>;
59
- anchorProfile: z.ZodOptional<z.ZodObject<{
60
- name: z.ZodOptional<z.ZodString>;
61
- description: z.ZodOptional<z.ZodString>;
62
- website: z.ZodOptional<z.ZodString>;
63
- email: z.ZodOptional<z.ZodString>;
64
- story: z.ZodOptional<z.ZodString>;
65
- socialLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
66
- platform: z.ZodEnum<["github", "instagram", "linkedin", "email", "website"]>;
67
- url: z.ZodString;
68
- label: z.ZodOptional<z.ZodString>;
69
- }, "strict", z.ZodTypeAny, {
70
- url: string;
71
- platform: "github" | "instagram" | "linkedin" | "email" | "website";
72
- label?: string | undefined;
73
- }, {
74
- url: string;
75
- platform: "github" | "instagram" | "linkedin" | "email" | "website";
76
- label?: string | undefined;
77
- }>, "many">>;
78
- }, "strict", z.ZodTypeAny, {
79
- name?: string | undefined;
80
- email?: string | undefined;
81
- website?: string | undefined;
82
- description?: string | undefined;
83
- story?: string | undefined;
84
- socialLinks?: {
85
- url: string;
86
- platform: "github" | "instagram" | "linkedin" | "email" | "website";
87
- label?: string | undefined;
88
- }[] | undefined;
89
- }, {
90
- name?: string | undefined;
91
- email?: string | undefined;
92
- website?: string | undefined;
93
- description?: string | undefined;
94
- story?: string | undefined;
95
- socialLinks?: {
96
- url: string;
97
- platform: "github" | "instagram" | "linkedin" | "email" | "website";
98
- label?: string | undefined;
99
- }[] | undefined;
100
- }>>;
101
- }, "strict", z.ZodTypeAny, {
102
- handle: string;
103
- discord: {
104
- enabled: boolean;
105
- anchorUserId?: string | undefined;
106
- };
107
- aiApiKeyOverride?: string | undefined;
108
- gitSyncTokenOverride?: string | undefined;
109
- mcpAuthTokenOverride?: string | undefined;
110
- anchorProfile?: {
111
- name?: string | undefined;
112
- email?: string | undefined;
113
- website?: string | undefined;
114
- description?: string | undefined;
115
- story?: string | undefined;
116
- socialLinks?: {
117
- url: string;
118
- platform: "github" | "instagram" | "linkedin" | "email" | "website";
119
- label?: string | undefined;
120
- }[] | undefined;
121
- } | undefined;
122
- }, {
123
- handle: string;
124
- discord: {
125
- enabled: boolean;
126
- anchorUserId?: string | undefined;
127
- };
128
- aiApiKeyOverride?: string | undefined;
129
- gitSyncTokenOverride?: string | undefined;
130
- mcpAuthTokenOverride?: string | undefined;
131
- anchorProfile?: {
132
- name?: string | undefined;
133
- email?: string | undefined;
134
- website?: string | undefined;
135
- description?: string | undefined;
136
- story?: string | undefined;
137
- socialLinks?: {
138
- url: string;
139
- platform: "github" | "instagram" | "linkedin" | "email" | "website";
140
- label?: string | undefined;
141
- }[] | undefined;
142
- } | undefined;
143
- }>;
144
- export declare const cohortSchema: z.ZodEffects<z.ZodObject<{
145
- members: z.ZodArray<z.ZodString, "many">;
146
- brainVersionOverride: z.ZodOptional<z.ZodString>;
147
- presetOverride: z.ZodOptional<z.ZodEnum<["core", "default", "pro"]>>;
148
- aiApiKeyOverride: z.ZodOptional<z.ZodString>;
149
- gitSyncTokenOverride: z.ZodOptional<z.ZodString>;
150
- mcpAuthTokenOverride: z.ZodOptional<z.ZodString>;
151
- }, "strict", z.ZodTypeAny, {
152
- members: string[];
153
- aiApiKeyOverride?: string | undefined;
154
- gitSyncTokenOverride?: string | undefined;
155
- mcpAuthTokenOverride?: string | undefined;
156
- brainVersionOverride?: string | undefined;
157
- presetOverride?: "default" | "core" | "pro" | undefined;
158
- }, {
159
- members: string[];
160
- aiApiKeyOverride?: string | undefined;
161
- gitSyncTokenOverride?: string | undefined;
162
- mcpAuthTokenOverride?: string | undefined;
163
- brainVersionOverride?: string | undefined;
164
- presetOverride?: "default" | "core" | "pro" | undefined;
165
- }>, {
166
- members: string[];
167
- aiApiKeyOverride?: string | undefined;
168
- gitSyncTokenOverride?: string | undefined;
169
- mcpAuthTokenOverride?: string | undefined;
170
- brainVersionOverride?: string | undefined;
171
- presetOverride?: "default" | "core" | "pro" | undefined;
172
- }, {
173
- members: string[];
174
- aiApiKeyOverride?: string | undefined;
175
- gitSyncTokenOverride?: string | undefined;
176
- mcpAuthTokenOverride?: string | undefined;
177
- brainVersionOverride?: string | undefined;
178
- presetOverride?: "default" | "core" | "pro" | undefined;
124
+ domainOverride: z.ZodOptional<z.ZodString>;
125
+ cloudflareZoneId: z.ZodOptional<z.ZodString>;
126
+ contentRepoOverride: z.ZodOptional<z.ZodString>;
127
+ profileKind: z.ZodOptional<typeof profileKindSchema>;
128
+ embeddingEnabled: z.ZodOptional<z.ZodBoolean>;
129
+ topicExtractionEnabled: z.ZodOptional<z.ZodBoolean>;
130
+ skillDerivationEnabled: z.ZodOptional<z.ZodBoolean>;
131
+ swotDerivationEnabled: z.ZodOptional<z.ZodBoolean>;
132
+ addOverride: z.ZodOptional<z.ZodArray<z.ZodString>>;
133
+ removeOverride: z.ZodOptional<z.ZodArray<z.ZodString>>;
134
+ siteOverride: z.ZodOptional<typeof siteOverrideSchema>;
135
+ setup: z.ZodOptional<typeof setupDeliverySchema>;
136
+ atproto: z.ZodOptional<typeof atprotoSchema>;
137
+ playbooks: z.ZodOptional<typeof playbooksSchema>;
138
+ anchorProfile: z.ZodOptional<typeof anchorProfileSchema>;
179
139
  }>;
180
- export type PilotConfig = z.infer<typeof pilotSchema>;
181
- export type UserConfig = z.infer<typeof userSchema>;
182
- export type CohortConfig = z.infer<typeof cohortSchema>;
183
- export type PilotPreset = z.infer<typeof presetSchema>;
140
+ export type PilotConfigInput = z.input<typeof pilotSchema>;
141
+ export type UserConfig = z.output<typeof userSchema>;
142
+ export type UserConfigInput = z.input<typeof userSchema>;
143
+ export type CohortConfigInput = z.input<typeof cohortSchema>;
144
+ export {};
@@ -1,21 +1,15 @@
1
- import { z } from "@brains/utils";
1
+ import { z } from "@brains/utils/zod";
2
2
  declare const encryptedUserSecretsSchema: z.ZodObject<{
3
3
  gitSyncToken: z.ZodOptional<z.ZodString>;
4
- mcpAuthToken: z.ZodOptional<z.ZodString>;
5
4
  discordBotToken: z.ZodOptional<z.ZodString>;
5
+ discordPublicKey: z.ZodOptional<z.ZodString>;
6
+ discordApplicationId: z.ZodOptional<z.ZodString>;
6
7
  aiApiKey: z.ZodOptional<z.ZodString>;
7
- }, "strict", z.ZodTypeAny, {
8
- aiApiKey?: string | undefined;
9
- gitSyncToken?: string | undefined;
10
- mcpAuthToken?: string | undefined;
11
- discordBotToken?: string | undefined;
12
- }, {
13
- aiApiKey?: string | undefined;
14
- gitSyncToken?: string | undefined;
15
- mcpAuthToken?: string | undefined;
16
- discordBotToken?: string | undefined;
8
+ atprotoAppPassword: z.ZodOptional<z.ZodString>;
9
+ certificatePem: z.ZodOptional<z.ZodString>;
10
+ privateKeyPem: z.ZodOptional<z.ZodString>;
17
11
  }>;
18
- export type EncryptedUserSecrets = z.infer<typeof encryptedUserSecretsSchema>;
12
+ export type EncryptedUserSecrets = z.output<typeof encryptedUserSecretsSchema>;
19
13
  export interface SecretsEncryptOptions {
20
14
  env?: NodeJS.ProcessEnv | undefined;
21
15
  logger?: ((message: string) => void) | undefined;
@@ -1,26 +1 @@
1
- import { type FetchLike } from "@brains/utils/origin-ca";
2
- import { type RunCommand } from "./run-subprocess";
3
- export interface SshKeyBootstrapOptions {
4
- env?: NodeJS.ProcessEnv | undefined;
5
- fetchImpl?: FetchLike | undefined;
6
- logger?: (message: string) => void;
7
- pushTo?: string | undefined;
8
- runCommand?: RunCommand | undefined;
9
- sshKeygen?: SshKeygen | undefined;
10
- }
11
- export interface SshKeyBootstrapResult {
12
- createdHetznerKey: boolean;
13
- createdLocalKey: boolean;
14
- privateKeyPath: string;
15
- publicKeyPath: string;
16
- sshKeyName: string;
17
- }
18
- export interface SshKeygen {
19
- createEd25519KeyPair: (privateKeyPath: string, comment: string) => void;
20
- derivePublicKey: (privateKeyPath: string) => string;
21
- }
22
- export declare function runPilotSshKeyBootstrap(rootDir: string, options?: SshKeyBootstrapOptions): Promise<{
23
- success: boolean;
24
- message?: string;
25
- }>;
26
- export declare function bootstrapPilotSshKey(rootDir: string, options?: SshKeyBootstrapOptions): Promise<SshKeyBootstrapResult>;
1
+ export { bootstrapSshKey as bootstrapPilotSshKey, runSshKeyBootstrap as runPilotSshKeyBootstrap, type SshKeyBootstrapOptions, type SshKeyBootstrapResult, type SshKeygen, } from "@brains/deploy-support/ssh-key-bootstrap";
@@ -0,0 +1,23 @@
1
+ import { type CapabilityBundleReview } from "./capability-bundle-migration";
2
+ import { type SiteOverrideConfig } from "./schema";
3
+ export interface StagedCrossover {
4
+ outputDir: string;
5
+ changedFiles: string[];
6
+ }
7
+ interface ReviewedSitePinManifest {
8
+ sites: Record<string, SiteOverrideConfig>;
9
+ }
10
+ export type ReviewedSitePins = ReviewedSitePinManifest["sites"];
11
+ export interface StageLegacyCrossoverOptions {
12
+ sitePins?: ReviewedSitePins | undefined;
13
+ bundleReview?: CapabilityBundleReview | undefined;
14
+ }
15
+ export declare function parseReviewedSitePins(input: string): ReviewedSitePins;
16
+ export declare function loadReviewedSitePins(filePath: string): Promise<ReviewedSitePins>;
17
+ export declare function loadCapabilityBundleReview(filePath: string): Promise<CapabilityBundleReview>;
18
+ /**
19
+ * Build a complete review copy without mutating the source repository.
20
+ * This is offline migration tooling; active desired-state loading is canonical-only.
21
+ */
22
+ export declare function stageLegacyCrossover(sourceDir: string, outputDir: string, options?: StageLegacyCrossoverOptions): Promise<StagedCrossover>;
23
+ export {};
@@ -0,0 +1,14 @@
1
+ export interface StressCommandOptions {
2
+ cwd?: string;
3
+ env?: NodeJS.ProcessEnv;
4
+ stdin?: string;
5
+ }
6
+ export interface StressCommandResult {
7
+ exitCode: number;
8
+ stdout: string;
9
+ stderr: string;
10
+ }
11
+ export type StressCommandRunner = (command: string, args: readonly string[], options?: StressCommandOptions) => Promise<StressCommandResult>;
12
+ export declare const runStressCommand: StressCommandRunner;
13
+ export declare function requireCommand(runner: StressCommandRunner, command: string, args: readonly string[], options?: StressCommandOptions): Promise<StressCommandResult>;
14
+ export declare function commandError(command: string, args: readonly string[], result: StressCommandResult): Error;
@@ -0,0 +1,21 @@
1
+ import { type StressCommandResult, type StressCommandRunner } from "./stress-command";
2
+ /**
3
+ * Git operations against one content-repo checkout, executed through a
4
+ * stress command runner with token-bearing credentials.
5
+ */
6
+ export declare class GitCheckout {
7
+ #private;
8
+ readonly dir: string;
9
+ constructor(runner: StressCommandRunner, dir: string, token: string);
10
+ /** Clone `repository`'s main branch into `dir` and pin it to origin/main. */
11
+ static clone(runner: StressCommandRunner, repository: string, dir: string, token: string): Promise<GitCheckout>;
12
+ run(args: readonly string[], required?: boolean): Promise<StressCommandResult>;
13
+ output(args: readonly string[]): Promise<string>;
14
+ sync(hardReset?: boolean): Promise<void>;
15
+ /** Stage everything and commit as the ops identity. */
16
+ commitAll(message: string): Promise<void>;
17
+ pushMainWithRebase(): Promise<void>;
18
+ /** Delete every remote stress backup branch; returns the deleted names. */
19
+ pruneStressBackupBranches(): Promise<string[]>;
20
+ private environment;
21
+ }