@rizom/ops 0.2.0-alpha.25 → 0.2.0-alpha.250

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 (49) hide show
  1. package/README.md +20 -1
  2. package/dist/brains-ops.js +383 -288
  3. package/dist/cert-bootstrap.d.ts +3 -1
  4. package/dist/content-repo-ref.d.ts +10 -0
  5. package/dist/content-repo.d.ts +1 -0
  6. package/dist/deploy.js +99 -166
  7. package/dist/entries/deploy.d.ts +3 -2
  8. package/dist/images.d.ts +76 -0
  9. package/dist/index.d.ts +5 -0
  10. package/dist/index.js +423 -287
  11. package/dist/legacy-pilot-migration.d.ts +11 -0
  12. package/dist/load-registry.d.ts +55 -6
  13. package/dist/observed-status.d.ts +1 -1
  14. package/dist/origin-ca.d.ts +1 -1
  15. package/dist/parse-args.d.ts +2 -10
  16. package/dist/preview-domain.d.ts +9 -0
  17. package/dist/push-secrets.d.ts +2 -9
  18. package/dist/push-target.d.ts +1 -2
  19. package/dist/reconcile-dry-run.d.ts +9 -0
  20. package/dist/run-command.d.ts +5 -3
  21. package/dist/run-subprocess.d.ts +1 -6
  22. package/dist/schema.d.ts +100 -162
  23. package/dist/secrets-encrypt.d.ts +7 -13
  24. package/dist/ssh-key-bootstrap.d.ts +1 -26
  25. package/dist/stage-legacy-crossover.d.ts +20 -0
  26. package/dist/user-add.d.ts +15 -0
  27. package/dist/verify-user.d.ts +19 -0
  28. package/package.json +46 -42
  29. package/templates/rover-pilot/.env.schema +24 -3
  30. package/templates/rover-pilot/.github/workflows/build.yml +64 -17
  31. package/templates/rover-pilot/.github/workflows/deploy.yml +128 -61
  32. package/templates/rover-pilot/.github/workflows/reconcile.yml +22 -2
  33. package/templates/rover-pilot/README.md +12 -5
  34. package/templates/rover-pilot/deploy/scripts/decrypt-user-secrets.ts +80 -24
  35. package/templates/rover-pilot/deploy/scripts/helpers.ts +3 -0
  36. package/templates/rover-pilot/deploy/scripts/resolve-deploy-handles.ts +12 -3
  37. package/templates/rover-pilot/deploy/scripts/resolve-missing-images.ts +13 -0
  38. package/templates/rover-pilot/deploy/scripts/resolve-user-config.ts +44 -9
  39. package/templates/rover-pilot/deploy/scripts/sync-content-repo.ts +51 -47
  40. package/templates/rover-pilot/deploy/scripts/update-dns.ts +14 -4
  41. package/templates/rover-pilot/deploy/scripts/validate-secrets.ts +12 -1
  42. package/templates/rover-pilot/docs/canonical-crossover-record.md +104 -0
  43. package/templates/rover-pilot/docs/onboarding-checklist.md +28 -12
  44. package/templates/rover-pilot/docs/operator-playbook.md +219 -24
  45. package/templates/rover-pilot/docs/user-onboarding.md +49 -343
  46. package/templates/rover-pilot/pilot.yaml +3 -4
  47. package/templates/rover-pilot/.kamal/hooks/pre-deploy +0 -9
  48. package/templates/rover-pilot/deploy/Dockerfile +0 -30
  49. package/templates/rover-pilot/deploy/kamal/deploy.yml +0 -40
@@ -1,2 +1,3 @@
1
- export { readJsonResponse, parseEnvFile, parseEnvSchema, parseEnvSchemaFile, requireEnv, writeGitHubOutput, writeGitHubEnv, } from "@brains/utils";
2
- export type { EnvSchemaEntry } from "@brains/utils";
1
+ export { readJsonResponse, parseEnvFile, parseEnvSchema, parseEnvSchemaFile, requireEnv, writeGitHubOutput, writeGitHubEnv, } from "@brains/deploy-support";
2
+ export type { EnvSchemaEntry } from "@brains/deploy-support";
3
+ export { siteImageTag, sitePackagesFor, requiredImages, resolveImageBuilds, runResolveMissingImages, type ImageRequirementSource, type RequiredImage, type ResolveImageBuildsOptions, type RunResolveMissingImagesOptions, } from "../images";
@@ -0,0 +1,76 @@
1
+ import { type ResolvedSiteOverride } from "./load-registry";
2
+ import { type RunCommand } from "./run-subprocess";
3
+ /**
4
+ * Resolve a fleet image tag as a pure function of a single instance's own
5
+ * config. This is the shared contract between the build (which tags the image
6
+ * it pushes) and the deploy (which waits for and runs that tag), so both must
7
+ * import this — never recompute it independently.
8
+ *
9
+ * The default path is deliberately untouched: an instance with no site packages
10
+ * resolves to the plain `brain-{version}` tag every other fleet instance uses.
11
+ * A site override is a per-instance opt-in that hashes only *that instance's*
12
+ * package set into a distinct `brain-{version}-sites-{hash}` image, so it can
13
+ * never collide with — or leak into — the shared default image.
14
+ */
15
+ export declare function siteImageTag(brainVersion: string, sitePackages: string[]): string;
16
+ /**
17
+ * The npm packages a site override installs into its per-instance image.
18
+ * A @rizom-scoped theme is independently published and installs at its own
19
+ * explicit version; @brains/* themes are bundled inside @rizom/brain and must
20
+ * not be npm-installed.
21
+ */
22
+ export declare function sitePackagesFor(siteOverride: ResolvedSiteOverride | undefined): string[];
23
+ /** The per-user slice of the registry that determines which image it runs. */
24
+ export interface ImageRequirementSource {
25
+ brainVersion: string;
26
+ siteOverride?: ResolvedSiteOverride | undefined;
27
+ }
28
+ export interface RequiredImage {
29
+ tag: string;
30
+ brainVersion: string;
31
+ /** Sorted, deduped — build args for the image, empty for the default. */
32
+ sitePackages: string[];
33
+ }
34
+ /**
35
+ * The image set the declared fleet state requires: one default
36
+ * `brain-{version}` per distinct brain version in use, plus one
37
+ * `brain-{version}-sites-{hash}` per distinct site-override package set.
38
+ * Derived purely from resolved users (pass `registry.users`), so CI can build
39
+ * exactly what a config push declares — nothing reactive, nothing manual.
40
+ */
41
+ export declare function requiredImages(users: ImageRequirementSource[]): RequiredImage[];
42
+ export interface ResolveImageBuildsOptions {
43
+ users: ImageRequirementSource[];
44
+ /**
45
+ * Explicit dispatch override — the manual/backfill path. When set, exactly
46
+ * this one image is built, skipping both the registry and the exists check.
47
+ */
48
+ brainVersionInput?: string | undefined;
49
+ sitePackagesInput?: string | undefined;
50
+ imageExists: (tag: string) => Promise<boolean>;
51
+ }
52
+ /**
53
+ * Decide which images a Build run must produce: the declared required set
54
+ * filtered to tags the registry does not already hold, or the single image an
55
+ * explicit dispatch input forces.
56
+ */
57
+ export declare function resolveImageBuilds(options: ResolveImageBuildsOptions): Promise<RequiredImage[]>;
58
+ export interface RunResolveMissingImagesOptions {
59
+ rootDir: string;
60
+ /** e.g. `ghcr.io/rizom-ai/rover-pilot` */
61
+ imageRepository: string;
62
+ env?: NodeJS.ProcessEnv;
63
+ runCommand?: RunCommand;
64
+ writeOutput: (key: string, value: string) => void;
65
+ log?: (line: string) => void;
66
+ }
67
+ /**
68
+ * The Build workflow's resolve step: derive the image set the declared fleet
69
+ * state (pilot.yaml + cohorts + users) requires, probe the container registry
70
+ * for each tag, and emit the missing ones as a GitHub Actions build matrix
71
+ * (`images_json`, entries `{tag, brain_version, site_packages}`). Dispatch
72
+ * inputs `BRAIN_VERSION_INPUT`/`SITE_PACKAGES_INPUT` force a single explicit
73
+ * build instead. Deriving and probing here means a config push builds exactly
74
+ * what it declares — nothing reactive, nothing manual.
75
+ */
76
+ export declare function runResolveMissingImages(options: RunResolveMissingImagesOptions): Promise<RequiredImage[]>;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  export { initPilotRepo } from "./init";
2
2
  export { loadPilotRegistry, type LoadPilotRegistryOptions, } from "./load-registry";
3
+ export { siteImageTag, sitePackagesFor, requiredImages, resolveImageBuilds, runResolveMissingImages, type ImageRequirementSource, type RequiredImage, type ResolveImageBuildsOptions, type RunResolveMissingImagesOptions, } from "./images";
4
+ export { derivePreviewDomain, type PreviewDomainOptions, } from "./preview-domain";
3
5
  export { writeUsersTable } from "./render-users-table";
4
6
  export { onboardUser } from "./onboard-user";
7
+ export { addPilotUser } from "./user-add";
5
8
  export { reconcileCohort } from "./reconcile-cohort";
6
9
  export { reconcileAll } from "./reconcile-all";
7
10
  export { parseArgs, type ParsedArgs } from "./parse-args";
@@ -10,4 +13,6 @@ export { bootstrapPilotSshKey, runPilotSshKeyBootstrap, } from "./ssh-key-bootst
10
13
  export { bootstrapPilotOriginCertificate, runPilotCertBootstrap, } from "./cert-bootstrap";
11
14
  export { encryptPilotSecrets } from "./secrets-encrypt";
12
15
  export { pushPilotSecrets } from "./secrets-push";
16
+ export { verifyPilotUser } from "./verify-user";
13
17
  export { runCommand, type CommandResult } from "./run-command";
18
+ export { pilotSchema, cohortSchema, canonicalBundleIdSchema, type PilotConfig, type CohortConfig, } from "./schema";