@rizom/ops 0.2.0-alpha.3 → 0.2.0-alpha.300
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/README.md +44 -3
- package/dist/age-key-bootstrap.d.ts +17 -0
- package/dist/brains-ops.js +453 -173
- package/dist/cert-bootstrap.d.ts +24 -0
- package/dist/content-repo-ref.d.ts +10 -0
- package/dist/content-repo.d.ts +13 -0
- package/dist/default-user-runner.d.ts +1 -1
- package/dist/deploy.js +99 -166
- package/dist/directory-sync-stress-system.d.ts +75 -0
- package/dist/directory-sync-stress.d.ts +107 -0
- package/dist/entries/deploy.d.ts +3 -2
- package/dist/images.d.ts +79 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +523 -152
- package/dist/legacy-pilot-migration.d.ts +11 -0
- package/dist/load-registry.d.ts +74 -7
- package/dist/observed-status.d.ts +12 -0
- package/dist/onboard-user.d.ts +2 -2
- package/dist/origin-ca.d.ts +1 -0
- package/dist/parse-args.d.ts +2 -9
- package/dist/preview-domain.d.ts +9 -0
- package/dist/push-secrets.d.ts +2 -0
- package/dist/push-target.d.ts +1 -0
- package/dist/reconcile-all.d.ts +2 -2
- package/dist/reconcile-cohort.d.ts +2 -2
- package/dist/reconcile-dry-run.d.ts +9 -0
- package/dist/reconcile-lib.d.ts +4 -2
- package/dist/run-command.d.ts +19 -4
- package/dist/run-subprocess.d.ts +1 -0
- package/dist/schema.d.ts +119 -70
- package/dist/secrets-encrypt.d.ts +26 -0
- package/dist/secrets-push.d.ts +2 -5
- package/dist/ssh-key-bootstrap.d.ts +1 -0
- package/dist/stage-legacy-crossover.d.ts +20 -0
- package/dist/stress-command.d.ts +14 -0
- package/dist/stress-git-checkout.d.ts +21 -0
- package/dist/stress-health-monitor.d.ts +46 -0
- package/dist/upgrade.d.ts +10 -0
- package/dist/user-add.d.ts +15 -0
- package/dist/user-runner.d.ts +5 -0
- package/dist/verify-user.d.ts +22 -0
- package/package.json +47 -40
- package/templates/rover-pilot/.env.schema +28 -2
- package/templates/rover-pilot/.github/actions/varlock-env/action.yml +47 -0
- package/templates/rover-pilot/.github/workflows/build.yml +71 -17
- package/templates/rover-pilot/.github/workflows/deploy.yml +110 -45
- package/templates/rover-pilot/.github/workflows/directory-sync-stress.yml +119 -0
- package/templates/rover-pilot/.github/workflows/reconcile.yml +23 -3
- package/templates/rover-pilot/.github/workflows/upgrade.yml +104 -0
- package/templates/rover-pilot/README.md +20 -7
- package/templates/rover-pilot/deploy/scripts/decrypt-user-secrets.ts +139 -0
- package/templates/rover-pilot/deploy/scripts/helpers.ts +3 -0
- package/templates/rover-pilot/deploy/scripts/install-health-watchdog.ts +144 -0
- package/templates/rover-pilot/deploy/scripts/provision-server.ts +1 -1
- package/templates/rover-pilot/deploy/scripts/resolve-deploy-handles.ts +15 -4
- package/templates/rover-pilot/deploy/scripts/resolve-missing-images.ts +13 -0
- package/templates/rover-pilot/deploy/scripts/resolve-user-config.ts +49 -14
- package/templates/rover-pilot/deploy/scripts/sync-content-repo.ts +183 -0
- package/templates/rover-pilot/deploy/scripts/update-dns.ts +14 -4
- package/templates/rover-pilot/deploy/scripts/validate-secrets.ts +12 -1
- package/templates/rover-pilot/docs/canonical-crossover-record.md +104 -0
- package/templates/rover-pilot/docs/onboarding-checklist.md +39 -8
- package/templates/rover-pilot/docs/operator-playbook.md +298 -9
- package/templates/rover-pilot/docs/user-onboarding.md +90 -0
- package/templates/rover-pilot/package.json +3 -0
- package/templates/rover-pilot/pilot.yaml +5 -3
- package/templates/rover-pilot/users/alice.yaml +5 -1
- package/dist/user-secret-names.d.ts +0 -6
- package/templates/rover-pilot/.kamal/hooks/pre-deploy +0 -9
- package/templates/rover-pilot/deploy/Dockerfile +0 -15
- package/templates/rover-pilot/deploy/kamal/deploy.yml +0 -39
|
@@ -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;
|
package/dist/load-registry.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PilotConfig, type
|
|
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,19 +11,89 @@ export interface ResolvedCohort {
|
|
|
11
11
|
id: string;
|
|
12
12
|
members: string[];
|
|
13
13
|
brainVersionOverride?: string;
|
|
14
|
-
|
|
14
|
+
bundlesOverride?: CanonicalBundleId[];
|
|
15
|
+
addOverride?: string[];
|
|
16
|
+
removeOverride?: string[];
|
|
15
17
|
aiApiKeyOverride?: string;
|
|
18
|
+
gitSyncTokenOverride?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ResolvedAnchorProfileSocialLink {
|
|
21
|
+
platform: "github" | "instagram" | "linkedin" | "email" | "website";
|
|
22
|
+
url: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ResolvedAnchorProfile {
|
|
26
|
+
name: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
website?: string;
|
|
29
|
+
email?: string;
|
|
30
|
+
story?: string;
|
|
31
|
+
socialLinks?: ResolvedAnchorProfileSocialLink[];
|
|
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;
|
|
16
74
|
}
|
|
17
75
|
export interface ResolvedUserIdentity {
|
|
18
76
|
handle: string;
|
|
19
77
|
cohort: string;
|
|
20
78
|
brainVersion: string;
|
|
21
|
-
|
|
22
|
-
|
|
79
|
+
bundles: CanonicalBundleId[];
|
|
80
|
+
add: string[];
|
|
81
|
+
remove: string[];
|
|
23
82
|
domain: string;
|
|
83
|
+
cloudflareZoneId?: string | undefined;
|
|
24
84
|
contentRepo: string;
|
|
85
|
+
profileKind?: string | undefined;
|
|
86
|
+
embeddingEnabled?: boolean | undefined;
|
|
87
|
+
topicExtractionEnabled?: boolean | undefined;
|
|
88
|
+
siteOverride?: ResolvedSiteOverride;
|
|
25
89
|
discordEnabled: boolean;
|
|
90
|
+
discordAnchorUserId?: string;
|
|
26
91
|
effectiveAiApiKey: string;
|
|
92
|
+
effectiveGitSyncToken: string;
|
|
93
|
+
setup?: ResolvedSetupDelivery;
|
|
94
|
+
atproto?: ResolvedAtprotoConfig;
|
|
95
|
+
playbooks?: ResolvedPlaybooksConfig;
|
|
96
|
+
anchorProfile: ResolvedAnchorProfile;
|
|
27
97
|
snapshotStatus: SnapshotStatus;
|
|
28
98
|
}
|
|
29
99
|
export interface ResolvedUser extends ResolvedUserIdentity {
|
|
@@ -40,7 +110,4 @@ export interface PilotRegistry {
|
|
|
40
110
|
cohorts: ResolvedCohort[];
|
|
41
111
|
users: ResolvedUser[];
|
|
42
112
|
}
|
|
43
|
-
declare class PilotRegistryError extends Error {
|
|
44
|
-
}
|
|
45
113
|
export declare function loadPilotRegistry(rootDir: string, options?: LoadPilotRegistryOptions): Promise<PilotRegistry>;
|
|
46
|
-
export { PilotRegistryError };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FetchLike } from "@brains/deploy-support/origin-ca";
|
|
2
|
+
import type { ObservedUserStatus, ResolvedUserIdentity } from "./load-registry";
|
|
3
|
+
export interface LookupResult {
|
|
4
|
+
address: string;
|
|
5
|
+
family: number;
|
|
6
|
+
}
|
|
7
|
+
export type LookupHost = (hostname: string) => Promise<LookupResult>;
|
|
8
|
+
export interface CreateObservedStatusResolverOptions {
|
|
9
|
+
fetchImpl?: FetchLike;
|
|
10
|
+
lookupHost?: LookupHost;
|
|
11
|
+
}
|
|
12
|
+
export declare function createObservedStatusResolver(options?: CreateObservedStatusResolverOptions): (user: ResolvedUserIdentity) => Promise<ObservedUserStatus>;
|
package/dist/onboard-user.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type UserRunner } from "./reconcile-lib";
|
|
2
|
-
export declare function onboardUser(rootDir: string, handle: string, runner?: UserRunner): Promise<void>;
|
|
1
|
+
import { type UserRunner, type ContentRepoSyncOptions } from "./reconcile-lib";
|
|
2
|
+
export declare function onboardUser(rootDir: string, handle: string, runner?: UserRunner, contentRepoOptions?: ContentRepoSyncOptions): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createOriginCertificateRequest, generateOriginKeyPair, issueCloudflareOriginCertificate, setCloudflareZoneSslStrict, type CloudflareOriginCaResult, type FetchLike, type OriginCertificateRequest, type OriginKeyPair, } from "@brains/deploy-support/origin-ca";
|
package/dist/parse-args.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
args: string[];
|
|
4
|
-
flags: {
|
|
5
|
-
help?: boolean | undefined;
|
|
6
|
-
version?: boolean | undefined;
|
|
7
|
-
dryRun?: boolean | undefined;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
1
|
+
import { type ParsedCliArgs } from "@brains/deploy-support/cli-kit";
|
|
2
|
+
export type ParsedArgs = ParsedCliArgs;
|
|
10
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { normalizePushTarget, type PushTarget, } from "@brains/deploy-support/push-target";
|
package/dist/reconcile-all.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type UserRunner } from "./reconcile-lib";
|
|
2
|
-
export declare function reconcileAll(rootDir: string, runner?: UserRunner): Promise<void>;
|
|
1
|
+
import { type UserRunner, type ContentRepoSyncOptions } from "./reconcile-lib";
|
|
2
|
+
export declare function reconcileAll(rootDir: string, runner?: UserRunner, contentRepoOptions?: ContentRepoSyncOptions): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type UserRunner } from "./reconcile-lib";
|
|
2
|
-
export declare function reconcileCohort(rootDir: string, cohortId: string, runner?: UserRunner): Promise<void>;
|
|
1
|
+
import { type UserRunner, type ContentRepoSyncOptions } from "./reconcile-lib";
|
|
2
|
+
export declare function reconcileCohort(rootDir: string, cohortId: string, runner?: UserRunner, contentRepoOptions?: ContentRepoSyncOptions): Promise<void>;
|
|
@@ -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>;
|
package/dist/reconcile-lib.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { type ContentRepoSyncOptions } from "./content-repo";
|
|
1
2
|
import { type PilotRegistry, type ResolvedUser } from "./load-registry";
|
|
2
3
|
import type { UserRunner } from "./user-runner";
|
|
3
|
-
export type {
|
|
4
|
-
export
|
|
4
|
+
export type { ContentRepoSyncOptions } from "./content-repo";
|
|
5
|
+
export type { ContentRepoFile, UserRunResult, UserRunner } from "./user-runner";
|
|
6
|
+
export declare function runUsers(rootDir: string, registry: PilotRegistry, users: ResolvedUser[], runner?: UserRunner, contentRepoOptions?: ContentRepoSyncOptions): Promise<void>;
|
|
5
7
|
export declare function findUser(rootDir: string, handle: string): Promise<{
|
|
6
8
|
registry: PilotRegistry;
|
|
7
9
|
user: ResolvedUser;
|
package/dist/run-command.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import type { FetchLike } from "@brains/deploy-support/origin-ca";
|
|
2
|
+
import { type CommandDefinition, type FlagDefinitions, type ParsedCliArgs } from "@brains/deploy-support/cli-kit";
|
|
1
3
|
import type { LoadPilotRegistryOptions } from "./load-registry";
|
|
2
|
-
import type
|
|
3
|
-
import { type RunCommand as
|
|
4
|
+
import { type LookupHost } from "./observed-status";
|
|
5
|
+
import { type RunCommand as OpsRunCommand } from "./run-subprocess";
|
|
6
|
+
import { type SshKeygen } from "./ssh-key-bootstrap";
|
|
4
7
|
import type { UserRunner } from "./user-runner";
|
|
8
|
+
import type { cleanupDirectorySyncStress, runDeployedDirectorySyncStress, verifyDirectorySyncStressAccess } from "./directory-sync-stress-system";
|
|
5
9
|
export interface CommandResult {
|
|
6
10
|
success: boolean;
|
|
7
11
|
message?: string;
|
|
@@ -10,6 +14,17 @@ export interface CommandDependencies extends LoadPilotRegistryOptions {
|
|
|
10
14
|
runner?: UserRunner;
|
|
11
15
|
env?: NodeJS.ProcessEnv | undefined;
|
|
12
16
|
logger?: ((message: string) => void) | undefined;
|
|
13
|
-
|
|
17
|
+
fetchImpl?: FetchLike | undefined;
|
|
18
|
+
lookupHost?: LookupHost | undefined;
|
|
19
|
+
verificationRetryAttempts?: number | undefined;
|
|
20
|
+
verificationRetryDelayMs?: number | undefined;
|
|
21
|
+
sleep?: ((delayMs: number) => Promise<void>) | undefined;
|
|
22
|
+
bootstrapRunCommand?: OpsRunCommand | undefined;
|
|
23
|
+
sshKeygen?: SshKeygen | undefined;
|
|
24
|
+
directorySyncStressRunner?: typeof runDeployedDirectorySyncStress | undefined;
|
|
25
|
+
directorySyncStressAccessRunner?: typeof verifyDirectorySyncStressAccess | undefined;
|
|
26
|
+
directorySyncStressCleanupRunner?: typeof cleanupDirectorySyncStress | undefined;
|
|
14
27
|
}
|
|
15
|
-
export declare
|
|
28
|
+
export declare const globalFlags: FlagDefinitions;
|
|
29
|
+
export declare const commands: readonly CommandDefinition<CommandDependencies, CommandResult>[];
|
|
30
|
+
export declare function runCommand(parsed: ParsedCliArgs, dependencies?: CommandDependencies): Promise<CommandResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { runSubprocess, type RunCommand, } from "@brains/deploy-support/run-subprocess";
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,86 +1,135 @@
|
|
|
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
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
export declare const agePublicKeySchema: z.ZodString;
|
|
6
|
+
export declare const canonicalBundleIdSchema: z.ZodEnum<{
|
|
7
|
+
core: "core";
|
|
8
|
+
site: "site";
|
|
9
|
+
publishing: "publishing";
|
|
10
|
+
team: "team";
|
|
11
|
+
}>;
|
|
12
|
+
export type CanonicalBundleId = z.output<typeof canonicalBundleIdSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* The profile kinds the runtime's profile plugin registers. A user config
|
|
15
|
+
* selecting anything else composes a brain that fails at boot, so reject it
|
|
16
|
+
* at parse time. Kept in lockstep with @brains/profile BUILT_IN_PROFILE_KINDS
|
|
17
|
+
* by a test. Collective/organization brains use "organization".
|
|
18
|
+
*/
|
|
19
|
+
export declare const PROFILE_KINDS: readonly ["professional", "team", "organization"];
|
|
20
|
+
export declare const profileKindSchema: z.ZodEnum<{
|
|
21
|
+
professional: "professional";
|
|
22
|
+
team: "team";
|
|
23
|
+
organization: "organization";
|
|
24
|
+
}>;
|
|
25
|
+
export interface PilotConfig {
|
|
26
26
|
brainVersion: string;
|
|
27
|
-
|
|
27
|
+
bundles: CanonicalBundleId[];
|
|
28
|
+
add?: string[] | undefined;
|
|
29
|
+
remove?: string[] | undefined;
|
|
28
30
|
githubOrg: string;
|
|
29
31
|
contentRepoPrefix: string;
|
|
30
32
|
domainSuffix: string;
|
|
31
|
-
preset: "core" | "default" | "pro";
|
|
32
33
|
aiApiKey: string;
|
|
34
|
+
gitSyncToken: string;
|
|
35
|
+
contentRepoAdminToken: string;
|
|
36
|
+
agePublicKey: string;
|
|
37
|
+
}
|
|
38
|
+
export interface SiteOverrideConfig {
|
|
39
|
+
package: string;
|
|
40
|
+
version: string;
|
|
41
|
+
theme?: string | undefined;
|
|
42
|
+
themeVersion?: string | undefined;
|
|
43
|
+
}
|
|
44
|
+
export interface CohortConfig {
|
|
45
|
+
members: string[];
|
|
46
|
+
brainVersionOverride?: string | undefined;
|
|
47
|
+
bundlesOverride?: CanonicalBundleId[] | undefined;
|
|
48
|
+
addOverride?: string[] | undefined;
|
|
49
|
+
removeOverride?: string[] | undefined;
|
|
50
|
+
aiApiKeyOverride?: string | undefined;
|
|
51
|
+
gitSyncTokenOverride?: string | undefined;
|
|
52
|
+
}
|
|
53
|
+
/** Sole active desired-state contract for the canonical brain. */
|
|
54
|
+
export declare const pilotSchema: z.ZodType<PilotConfig>;
|
|
55
|
+
export declare const cohortSchema: z.ZodType<CohortConfig>;
|
|
56
|
+
declare const anchorProfileSocialLinkSchema: z.ZodObject<{
|
|
57
|
+
platform: z.ZodEnum<{
|
|
58
|
+
github: "github";
|
|
59
|
+
instagram: "instagram";
|
|
60
|
+
linkedin: "linkedin";
|
|
61
|
+
email: "email";
|
|
62
|
+
website: "website";
|
|
63
|
+
}>;
|
|
64
|
+
url: z.ZodString;
|
|
65
|
+
label: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}>;
|
|
67
|
+
declare const anchorProfileSchema: z.ZodObject<{
|
|
68
|
+
name: z.ZodOptional<z.ZodString>;
|
|
69
|
+
description: z.ZodOptional<z.ZodString>;
|
|
70
|
+
website: z.ZodOptional<z.ZodString>;
|
|
71
|
+
email: z.ZodOptional<z.ZodString>;
|
|
72
|
+
story: z.ZodOptional<z.ZodString>;
|
|
73
|
+
socialLinks: z.ZodOptional<z.ZodArray<typeof anchorProfileSocialLinkSchema>>;
|
|
74
|
+
}>;
|
|
75
|
+
declare const setupDeliverySchema: z.ZodObject<{
|
|
76
|
+
delivery: z.ZodLiteral<"email">;
|
|
77
|
+
email: z.ZodString;
|
|
78
|
+
}>;
|
|
79
|
+
declare const atprotoJetstreamSchema: z.ZodObject<{
|
|
80
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
82
|
+
replayWindowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
denyDids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
|
+
denyDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
85
|
+
skillKeywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
|
+
queueLimit: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
perDidCooldownSeconds: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
fetchBudgetPerMinute: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
newAgentsPerHour: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
pendingCandidateCeiling: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
staleCandidateRetentionDays: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
requestTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
maxResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
maxRedirects: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
retryAttempts: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
heartbeatIntervalHours: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
}>;
|
|
99
|
+
declare const atprotoSchema: z.ZodObject<{
|
|
100
|
+
identifier: z.ZodString;
|
|
101
|
+
accountDid: z.ZodOptional<z.ZodString>;
|
|
102
|
+
lexiconAuthority: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
jetstream: z.ZodOptional<typeof atprotoJetstreamSchema>;
|
|
104
|
+
}>;
|
|
105
|
+
export declare const siteOverrideSchema: z.ZodType<SiteOverrideConfig>;
|
|
106
|
+
declare const playbooksSchema: z.ZodObject<{
|
|
107
|
+
onboarding: z.ZodOptional<z.ZodBoolean>;
|
|
33
108
|
}>;
|
|
34
109
|
export declare const userSchema: z.ZodObject<{
|
|
35
110
|
handle: z.ZodString;
|
|
36
111
|
discord: z.ZodObject<{
|
|
37
112
|
enabled: z.ZodBoolean;
|
|
38
|
-
|
|
39
|
-
enabled: boolean;
|
|
40
|
-
}, {
|
|
41
|
-
enabled: boolean;
|
|
113
|
+
anchorUserId: z.ZodOptional<z.ZodString>;
|
|
42
114
|
}>;
|
|
43
115
|
aiApiKeyOverride: z.ZodOptional<z.ZodString>;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
members: z.ZodArray<z.ZodString, "many">;
|
|
59
|
-
brainVersionOverride: z.ZodOptional<z.ZodString>;
|
|
60
|
-
presetOverride: z.ZodOptional<z.ZodEnum<["core", "default", "pro"]>>;
|
|
61
|
-
aiApiKeyOverride: z.ZodOptional<z.ZodString>;
|
|
62
|
-
}, "strict", z.ZodTypeAny, {
|
|
63
|
-
members: string[];
|
|
64
|
-
aiApiKeyOverride?: string | undefined;
|
|
65
|
-
brainVersionOverride?: string | undefined;
|
|
66
|
-
presetOverride?: "core" | "default" | "pro" | undefined;
|
|
67
|
-
}, {
|
|
68
|
-
members: string[];
|
|
69
|
-
aiApiKeyOverride?: string | undefined;
|
|
70
|
-
brainVersionOverride?: string | undefined;
|
|
71
|
-
presetOverride?: "core" | "default" | "pro" | undefined;
|
|
72
|
-
}>, {
|
|
73
|
-
members: string[];
|
|
74
|
-
aiApiKeyOverride?: string | undefined;
|
|
75
|
-
brainVersionOverride?: string | undefined;
|
|
76
|
-
presetOverride?: "core" | "default" | "pro" | undefined;
|
|
77
|
-
}, {
|
|
78
|
-
members: string[];
|
|
79
|
-
aiApiKeyOverride?: string | undefined;
|
|
80
|
-
brainVersionOverride?: string | undefined;
|
|
81
|
-
presetOverride?: "core" | "default" | "pro" | undefined;
|
|
116
|
+
gitSyncTokenOverride: z.ZodOptional<z.ZodString>;
|
|
117
|
+
domainOverride: z.ZodOptional<z.ZodString>;
|
|
118
|
+
cloudflareZoneId: z.ZodOptional<z.ZodString>;
|
|
119
|
+
contentRepoOverride: z.ZodOptional<z.ZodString>;
|
|
120
|
+
profileKind: z.ZodOptional<typeof profileKindSchema>;
|
|
121
|
+
embeddingEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
topicExtractionEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
addOverride: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
124
|
+
removeOverride: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
125
|
+
siteOverride: z.ZodOptional<typeof siteOverrideSchema>;
|
|
126
|
+
setup: z.ZodOptional<typeof setupDeliverySchema>;
|
|
127
|
+
atproto: z.ZodOptional<typeof atprotoSchema>;
|
|
128
|
+
playbooks: z.ZodOptional<typeof playbooksSchema>;
|
|
129
|
+
anchorProfile: z.ZodOptional<typeof anchorProfileSchema>;
|
|
82
130
|
}>;
|
|
83
|
-
export type
|
|
84
|
-
export type UserConfig = z.
|
|
85
|
-
export type
|
|
86
|
-
export type
|
|
131
|
+
export type PilotConfigInput = z.input<typeof pilotSchema>;
|
|
132
|
+
export type UserConfig = z.output<typeof userSchema>;
|
|
133
|
+
export type UserConfigInput = z.input<typeof userSchema>;
|
|
134
|
+
export type CohortConfigInput = z.input<typeof cohortSchema>;
|
|
135
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "@brains/utils/zod";
|
|
2
|
+
declare const encryptedUserSecretsSchema: z.ZodObject<{
|
|
3
|
+
gitSyncToken: z.ZodOptional<z.ZodString>;
|
|
4
|
+
discordBotToken: z.ZodOptional<z.ZodString>;
|
|
5
|
+
discordPublicKey: z.ZodOptional<z.ZodString>;
|
|
6
|
+
discordApplicationId: z.ZodOptional<z.ZodString>;
|
|
7
|
+
aiApiKey: z.ZodOptional<z.ZodString>;
|
|
8
|
+
atprotoAppPassword: z.ZodOptional<z.ZodString>;
|
|
9
|
+
certificatePem: z.ZodOptional<z.ZodString>;
|
|
10
|
+
privateKeyPem: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}>;
|
|
12
|
+
export type EncryptedUserSecrets = z.output<typeof encryptedUserSecretsSchema>;
|
|
13
|
+
export interface SecretsEncryptOptions {
|
|
14
|
+
env?: NodeJS.ProcessEnv | undefined;
|
|
15
|
+
logger?: ((message: string) => void) | undefined;
|
|
16
|
+
dryRun?: boolean | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface SecretsEncryptResult {
|
|
19
|
+
encryptedPath: string;
|
|
20
|
+
plaintextPath: string;
|
|
21
|
+
deletedPlaintext: boolean;
|
|
22
|
+
encryptedKeys: Array<keyof EncryptedUserSecrets>;
|
|
23
|
+
dryRun?: boolean | undefined;
|
|
24
|
+
}
|
|
25
|
+
export declare function encryptPilotSecrets(rootDir: string, handle: string, options?: SecretsEncryptOptions): Promise<SecretsEncryptResult>;
|
|
26
|
+
export {};
|
package/dist/secrets-push.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RunCommand } from "./run-subprocess";
|
|
1
2
|
export interface SecretsPushOptions {
|
|
2
3
|
env?: NodeJS.ProcessEnv | undefined;
|
|
3
4
|
logger?: ((message: string) => void) | undefined;
|
|
@@ -9,8 +10,4 @@ export interface SecretsPushResult {
|
|
|
9
10
|
skippedKeys: string[];
|
|
10
11
|
dryRun?: boolean | undefined;
|
|
11
12
|
}
|
|
12
|
-
export
|
|
13
|
-
stdin?: string;
|
|
14
|
-
env?: NodeJS.ProcessEnv;
|
|
15
|
-
}) => Promise<void>;
|
|
16
|
-
export declare function pushPilotSecrets(rootDir: string, handle: string, options?: SecretsPushOptions): Promise<SecretsPushResult>;
|
|
13
|
+
export declare function pushPilotSecrets(rootDir: string, options?: SecretsPushOptions): Promise<SecretsPushResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { bootstrapSshKey as bootstrapPilotSshKey, runSshKeyBootstrap as runPilotSshKeyBootstrap, type SshKeyBootstrapOptions, type SshKeyBootstrapResult, type SshKeygen, } from "@brains/deploy-support/ssh-key-bootstrap";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type SiteOverrideConfig } from "./schema";
|
|
2
|
+
export interface StagedCrossover {
|
|
3
|
+
outputDir: string;
|
|
4
|
+
changedFiles: string[];
|
|
5
|
+
}
|
|
6
|
+
interface ReviewedSitePinManifest {
|
|
7
|
+
sites: Record<string, SiteOverrideConfig>;
|
|
8
|
+
}
|
|
9
|
+
export type ReviewedSitePins = ReviewedSitePinManifest["sites"];
|
|
10
|
+
export interface StageLegacyCrossoverOptions {
|
|
11
|
+
sitePins?: ReviewedSitePins | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare function parseReviewedSitePins(input: string): ReviewedSitePins;
|
|
14
|
+
export declare function loadReviewedSitePins(filePath: string): Promise<ReviewedSitePins>;
|
|
15
|
+
/**
|
|
16
|
+
* Build a complete review copy without mutating the source repository.
|
|
17
|
+
* This is offline migration tooling; active desired-state loading is canonical-only.
|
|
18
|
+
*/
|
|
19
|
+
export declare function stageLegacyCrossover(sourceDir: string, outputDir: string, options?: StageLegacyCrossoverOptions): Promise<StagedCrossover>;
|
|
20
|
+
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
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { FetchLike } from "@brains/deploy-support/origin-ca";
|
|
2
|
+
import { type StressHealthSample, type StressRuntimeSample } from "./directory-sync-stress";
|
|
3
|
+
export interface HealthPayload {
|
|
4
|
+
version: string;
|
|
5
|
+
entities: number;
|
|
6
|
+
entityCounts: {
|
|
7
|
+
entityType: string;
|
|
8
|
+
count: number;
|
|
9
|
+
}[];
|
|
10
|
+
}
|
|
11
|
+
export declare function noteCount(payload: HealthPayload): number;
|
|
12
|
+
export interface StressHealthMonitorOptions {
|
|
13
|
+
domain: string;
|
|
14
|
+
fetchImpl: FetchLike;
|
|
15
|
+
now: () => Date;
|
|
16
|
+
sleep: (milliseconds: number) => Promise<void>;
|
|
17
|
+
/** Take one runtime sample (e.g. docker stats over SSH), if available. */
|
|
18
|
+
sampleRuntime: () => Promise<StressRuntimeSample | undefined>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Samples deployment health and runtime resource usage during a stress run,
|
|
22
|
+
* and answers entity-baseline waits against the operational health endpoint.
|
|
23
|
+
*/
|
|
24
|
+
export declare class StressHealthMonitor {
|
|
25
|
+
#private;
|
|
26
|
+
constructor(options: StressHealthMonitorOptions);
|
|
27
|
+
/** ISO timestamp of the most recent start() call. */
|
|
28
|
+
get startedAt(): string;
|
|
29
|
+
/** The first sampling failure since start(), if any. */
|
|
30
|
+
get error(): unknown;
|
|
31
|
+
get healthSamples(): readonly StressHealthSample[];
|
|
32
|
+
get runtimeSamples(): readonly StressRuntimeSample[];
|
|
33
|
+
/** Health samples between start() and markGateEnd() (or now). */
|
|
34
|
+
gateHealthSamples(): StressHealthSample[];
|
|
35
|
+
/** Exclude samples taken after this point from the gate window. */
|
|
36
|
+
markGateEnd(): void;
|
|
37
|
+
/** Probe optional health endpoints and add responsive ones to the loop. */
|
|
38
|
+
discoverEndpoints(): Promise<void>;
|
|
39
|
+
start(): void;
|
|
40
|
+
/** Stop sampling and wait for the loops; a loop error stays on `error`. */
|
|
41
|
+
stop(): Promise<void>;
|
|
42
|
+
waitForHealthSnapshot(timeoutMs: number): Promise<HealthPayload | undefined>;
|
|
43
|
+
waitForEntityBaseline(expectedNotes: number | undefined, expectedEntities: number | undefined, timeoutMs: number): Promise<HealthPayload | undefined>;
|
|
44
|
+
waitForStableEntityBaseline(expectedNotes: number | undefined, expectedEntities: number | undefined, timeoutMs: number): Promise<HealthPayload | undefined>;
|
|
45
|
+
fetchHealthPayload(): Promise<HealthPayload | undefined>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type UpgradeExec = (command: string[], cwd: string) => Promise<void>;
|
|
2
|
+
export interface UpgradeOptions {
|
|
3
|
+
exec?: UpgradeExec | undefined;
|
|
4
|
+
version?: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
export interface UpgradeResult {
|
|
7
|
+
from: string;
|
|
8
|
+
to: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function upgradePilotRepo(rootDir: string, options?: UpgradeOptions): Promise<UpgradeResult>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface AddPilotUserOptions {
|
|
2
|
+
cohort: string;
|
|
3
|
+
anchorId?: string | undefined;
|
|
4
|
+
}
|
|
5
|
+
export interface AddPilotUserResult {
|
|
6
|
+
handle: string;
|
|
7
|
+
cohort: string;
|
|
8
|
+
userPath: string;
|
|
9
|
+
secretsTemplatePath: string;
|
|
10
|
+
cohortPath: string;
|
|
11
|
+
createdUser: boolean;
|
|
12
|
+
createdSecretsTemplate: boolean;
|
|
13
|
+
addedToCohort: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function addPilotUser(rootDir: string, handle: string, options: AddPilotUserOptions): Promise<AddPilotUserResult>;
|
package/dist/user-runner.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { ResolvedUser } from "./load-registry";
|
|
2
|
+
export interface ContentRepoFile {
|
|
3
|
+
path: string;
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
2
6
|
export interface UserRunResult {
|
|
3
7
|
brainYaml?: string;
|
|
4
8
|
envFile?: string;
|
|
9
|
+
contentRepoFiles?: ContentRepoFile[];
|
|
5
10
|
}
|
|
6
11
|
export type UserRunner = (user: ResolvedUser) => Promise<UserRunResult | void>;
|