@wtfalch/foundry 0.60.0 → 0.61.0

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 (218) hide show
  1. package/dist/apps/cloudflare.d.ts +173 -0
  2. package/dist/apps/cloudflare.js +17 -0
  3. package/dist/apps/deploy.d.ts +116 -0
  4. package/dist/apps/deploy.js +791 -0
  5. package/dist/apps/github.d.ts +47 -0
  6. package/dist/apps/github.js +201 -0
  7. package/dist/apps/index.d.ts +9 -0
  8. package/dist/apps/index.js +9 -0
  9. package/dist/apps/migrations.d.ts +110 -0
  10. package/dist/apps/migrations.js +458 -0
  11. package/dist/audit/connector.d.ts +43 -0
  12. package/dist/audit/connector.js +22 -0
  13. package/dist/audit/evidence.d.ts +49 -0
  14. package/dist/audit/evidence.js +56 -0
  15. package/dist/audit/index.d.ts +9 -0
  16. package/dist/audit/index.js +9 -0
  17. package/dist/audit/migrations.d.ts +5 -0
  18. package/dist/audit/migrations.js +5 -0
  19. package/dist/audit/registry.d.ts +49 -0
  20. package/dist/audit/registry.js +44 -0
  21. package/dist/audit/seal.d.ts +49 -0
  22. package/dist/audit/seal.js +131 -0
  23. package/dist/audit/sealer-role.d.ts +33 -0
  24. package/dist/audit/sealer-role.js +56 -0
  25. package/dist/audit/signer.d.ts +40 -0
  26. package/dist/audit/signer.js +78 -0
  27. package/dist/audit/tick.d.ts +36 -0
  28. package/dist/audit/tick.js +87 -0
  29. package/dist/catalogue/copy-en.d.ts +1 -0
  30. package/dist/catalogue/copy-en.js +129 -0
  31. package/dist/catalogue/index.d.ts +9 -0
  32. package/dist/catalogue/index.js +21 -0
  33. package/dist/catalogue/integrations.d.ts +4 -0
  34. package/dist/catalogue/integrations.js +104 -0
  35. package/dist/catalogue/systems.d.ts +7 -0
  36. package/dist/catalogue/systems.js +31 -0
  37. package/dist/catalogue/types.d.ts +110 -0
  38. package/dist/catalogue/types.js +1 -0
  39. package/dist/entry-rules.d.ts +53 -0
  40. package/dist/entry-rules.js +71 -0
  41. package/dist/hosted-label.d.ts +13 -0
  42. package/dist/hosted-label.js +81 -0
  43. package/dist/index.d.ts +10 -5
  44. package/dist/index.js +5 -3
  45. package/dist/migrations/0062_hosting_github.sql +6 -0
  46. package/dist/migrations/0063_boule_apps.sql +7 -0
  47. package/dist/migrations/0064_requested_changes_boule_apps.sql +6 -0
  48. package/dist/modules/ai.d.ts +3 -0
  49. package/dist/modules/ai.js +64 -0
  50. package/dist/modules/assistants.d.ts +3 -0
  51. package/dist/modules/assistants.js +72 -0
  52. package/dist/modules/audit-ledger.d.ts +29 -0
  53. package/dist/modules/audit-ledger.js +49 -0
  54. package/dist/modules/audit.d.ts +7 -0
  55. package/dist/modules/audit.js +44 -0
  56. package/dist/modules/database.d.ts +23 -0
  57. package/dist/modules/database.js +189 -0
  58. package/dist/modules/email.d.ts +3 -0
  59. package/dist/modules/email.js +18 -0
  60. package/dist/modules/entry-parts.d.ts +23 -0
  61. package/dist/modules/entry-parts.js +63 -0
  62. package/dist/modules/files.d.ts +3 -0
  63. package/dist/modules/files.js +64 -0
  64. package/dist/modules/index.d.ts +74 -0
  65. package/dist/modules/index.js +774 -0
  66. package/dist/modules/jobs.d.ts +3 -0
  67. package/dist/modules/jobs.js +23 -0
  68. package/dist/modules/organisations.d.ts +3 -0
  69. package/dist/modules/organisations.js +20 -0
  70. package/dist/modules/outputs.d.ts +9 -0
  71. package/dist/modules/outputs.js +38 -0
  72. package/dist/modules/sign-in.d.ts +3 -0
  73. package/dist/modules/sign-in.js +197 -0
  74. package/dist/modules/signed-records.d.ts +3 -0
  75. package/dist/modules/signed-records.js +32 -0
  76. package/dist/modules/types.d.ts +194 -0
  77. package/dist/modules/types.js +1 -0
  78. package/dist/modules/workspaces.d.ts +3 -0
  79. package/dist/modules/workspaces.js +75 -0
  80. package/dist/org.d.ts +163 -22
  81. package/dist/org.js +419 -47
  82. package/dist/plan/apps-db-route.d.ts +90 -0
  83. package/dist/plan/apps-db-route.js +168 -0
  84. package/dist/plan/apps-zones.d.ts +56 -0
  85. package/dist/plan/apps-zones.js +118 -0
  86. package/dist/plan/archon-blue-green.js +11 -1
  87. package/dist/plan/blue-green-apply.d.ts +37 -1
  88. package/dist/plan/blue-green-apply.js +55 -15
  89. package/dist/plan/blue-green.d.ts +41 -1
  90. package/dist/plan/blue-green.js +80 -2
  91. package/dist/plan/boule.d.ts +23 -1
  92. package/dist/plan/boule.js +35 -2
  93. package/dist/plan/broker-entries.d.ts +28 -3
  94. package/dist/plan/broker-entries.js +74 -3
  95. package/dist/plan/broker-registrar.d.ts +168 -0
  96. package/dist/plan/broker-registrar.js +440 -0
  97. package/dist/plan/broker-workspaces-database.d.ts +48 -0
  98. package/dist/plan/broker-workspaces-database.js +87 -0
  99. package/dist/plan/desktop-callback.js +12 -7
  100. package/dist/plan/diff.d.ts +8 -2
  101. package/dist/plan/diff.js +373 -42
  102. package/dist/plan/edge-access.d.ts +6 -0
  103. package/dist/plan/edge-dns.d.ts +6 -0
  104. package/dist/plan/edge-dns.js +9 -7
  105. package/dist/plan/entry-ai-key.d.ts +1 -1
  106. package/dist/plan/entry-ai-key.js +2 -2
  107. package/dist/plan/entry-audit.d.ts +58 -0
  108. package/dist/plan/entry-audit.js +122 -0
  109. package/dist/plan/entry-customer-grants.d.ts +75 -0
  110. package/dist/plan/entry-customer-grants.js +154 -0
  111. package/dist/plan/entry-edge-key.d.ts +26 -1
  112. package/dist/plan/entry-edge-key.js +42 -3
  113. package/dist/plan/entry-jobs.d.ts +64 -0
  114. package/dist/plan/entry-jobs.js +92 -0
  115. package/dist/plan/entry-repo-key-apply.d.ts +55 -0
  116. package/dist/plan/entry-repo-key-apply.js +185 -0
  117. package/dist/plan/entry-repo-key.d.ts +92 -0
  118. package/dist/plan/entry-repo-key.js +235 -0
  119. package/dist/plan/entry-workspaces.d.ts +55 -0
  120. package/dist/plan/entry-workspaces.js +90 -0
  121. package/dist/plan/executor.d.ts +191 -1
  122. package/dist/plan/executor.js +1505 -90
  123. package/dist/plan/gates.d.ts +1 -1
  124. package/dist/plan/gates.js +62 -9
  125. package/dist/plan/github-deploy-keys.d.ts +78 -0
  126. package/dist/plan/github-deploy-keys.js +305 -0
  127. package/dist/plan/github-source.d.ts +53 -0
  128. package/dist/plan/github-source.js +140 -0
  129. package/dist/plan/held-key-refs.d.ts +12 -0
  130. package/dist/plan/held-key-refs.js +12 -0
  131. package/dist/plan/hostnames.d.ts +9 -0
  132. package/dist/plan/hostnames.js +28 -1
  133. package/dist/plan/index.d.ts +9 -0
  134. package/dist/plan/index.js +6 -0
  135. package/dist/plan/jobs-scheduler-http.js +3 -0
  136. package/dist/plan/keys-registrar-http.d.ts +32 -0
  137. package/dist/plan/keys-registrar-http.js +105 -0
  138. package/dist/plan/keys-registrar.d.ts +67 -0
  139. package/dist/plan/keys-registrar.js +103 -0
  140. package/dist/plan/live.d.ts +1 -1
  141. package/dist/plan/locked-hostnames.d.ts +2 -2
  142. package/dist/plan/locked-hostnames.js +2 -2
  143. package/dist/plan/login-host.js +11 -5
  144. package/dist/plan/machine-paths.d.ts +36 -0
  145. package/dist/plan/machine-paths.js +137 -0
  146. package/dist/plan/mcp.d.ts +1 -1
  147. package/dist/plan/mcp.js +49 -17
  148. package/dist/plan/org-apps-admin.d.ts +108 -0
  149. package/dist/plan/org-apps-admin.js +434 -0
  150. package/dist/plan/org-names.js +12 -1
  151. package/dist/plan/own-diff.d.ts +23 -0
  152. package/dist/plan/own-diff.js +53 -0
  153. package/dist/plan/own-hostnames.d.ts +2 -0
  154. package/dist/plan/own-hostnames.js +1 -0
  155. package/dist/plan/own-jobs-route.d.ts +47 -0
  156. package/dist/plan/own-jobs-route.js +91 -0
  157. package/dist/plan/own-services.d.ts +4 -0
  158. package/dist/plan/own-services.js +4 -0
  159. package/dist/plan/plan-apply.d.ts +39 -0
  160. package/dist/plan/plan-apply.js +163 -9
  161. package/dist/plan/platform-diff.d.ts +2 -2
  162. package/dist/plan/platform-diff.js +7 -2
  163. package/dist/plan/platform-org.d.ts +30 -0
  164. package/dist/plan/platform-org.js +12 -1
  165. package/dist/plan/platform-providers.d.ts +2 -0
  166. package/dist/plan/platform-providers.js +7 -2
  167. package/dist/plan/post-logout-uris.js +7 -1
  168. package/dist/plan/private-pages.d.ts +26 -0
  169. package/dist/plan/private-pages.js +39 -0
  170. package/dist/plan/proxy-labels.d.ts +12 -1
  171. package/dist/plan/proxy-labels.js +32 -2
  172. package/dist/plan/release-host.d.ts +6 -2
  173. package/dist/plan/release-host.js +36 -8
  174. package/dist/plan/stage-env.d.ts +19 -1
  175. package/dist/plan/stage-env.js +25 -1
  176. package/dist/plan/stage-guards.d.ts +20 -0
  177. package/dist/plan/stage-guards.js +24 -0
  178. package/dist/plan/stage-isolation.d.ts +24 -0
  179. package/dist/plan/stage-isolation.js +29 -1
  180. package/dist/plan/worker-app-database.d.ts +46 -42
  181. package/dist/plan/worker-app-database.js +150 -153
  182. package/dist/plan/worker-app.d.ts +5 -65
  183. package/dist/plan/worker-app.js +28 -105
  184. package/dist/plan/worker.d.ts +2 -2
  185. package/dist/plan/worker.js +2 -1
  186. package/dist/plan/workspace-client.d.ts +25 -0
  187. package/dist/plan/workspace-client.js +48 -0
  188. package/dist/plan/workspace-sign-in.d.ts +55 -0
  189. package/dist/plan/workspace-sign-in.js +273 -0
  190. package/dist/plan/workspace-worker.d.ts +4 -0
  191. package/dist/plan/workspace-worker.js +13 -0
  192. package/dist/plan/workspace.d.ts +101 -0
  193. package/dist/plan/workspace.js +305 -0
  194. package/dist/release/decide.d.ts +30 -1
  195. package/dist/release/decide.js +73 -11
  196. package/dist/release/health.d.ts +8 -3
  197. package/dist/release/health.js +58 -5
  198. package/dist/release/run.d.ts +2 -5
  199. package/dist/release/run.js +4 -0
  200. package/dist/release/state.d.ts +3 -1
  201. package/dist/release/state.js +6 -0
  202. package/dist/release/types.d.ts +20 -0
  203. package/dist/requested-changes.d.ts +11 -2
  204. package/dist/requested-changes.js +11 -0
  205. package/dist/service-labels.d.ts +4 -0
  206. package/dist/service-labels.js +11 -0
  207. package/dist/slug.d.ts +2 -0
  208. package/dist/slug.js +10 -6
  209. package/dist/store/postgres.js +12 -2
  210. package/dist/store/schema.d.ts +37 -1
  211. package/dist/store/schema.js +4 -0
  212. package/dist/worker-app-config.d.ts +1 -11
  213. package/dist/worker-app-config.js +4 -17
  214. package/dist/worker-app-migrations.d.ts +105 -0
  215. package/dist/worker-app-migrations.js +166 -0
  216. package/dist/worker-app-upload.d.ts +103 -0
  217. package/dist/worker-app-upload.js +128 -0
  218. package/package.json +18 -1
@@ -12,6 +12,8 @@ import { type DnsPort, type EdgePlatformDns } from './edge-dns.js';
12
12
  import { type EdgePlatformRateLimits, type RateLimitPort } from './edge-ratelimits.js';
13
13
  import { type EdgePlatformTunnels, type TunnelPort } from './edge-tunnels.js';
14
14
  import { type EdgePlatformZones, type ZonePort } from './edge-zones.js';
15
+ import type { GithubDeployKeysPort } from './github-deploy-keys.js';
16
+ import { type KeysRegistrarPort } from './keys-registrar.js';
15
17
  import { type LoginHostBindingsPort } from './login-host.js';
16
18
  import { type MailCopyPort } from './mail-copy.js';
17
19
  import { type OwnServicesPort } from './own-services.js';
@@ -1534,7 +1536,8 @@ export interface EdgePort {
1534
1536
  * lowercase hostname and binds the key to it
1535
1537
  * (`wtfalch/edge`'s `packages/service/src/keys.ts`) -- `edgeEntryKey`
1536
1538
  * passes `org.domain`, which `validateEntryEdge` already requires before
1537
- * `uses.edge` is accepted.
1539
+ * `uses.edge` is accepted; Boule's key for a company without a domain
1540
+ * (`org.boule.apps`) passes `<slug>.oikos.host` (`edgeKeyDomain`).
1538
1541
  */
1539
1542
  mintKey(input: {
1540
1543
  organisationId: string;
@@ -1579,6 +1582,12 @@ export interface EdgePort {
1579
1582
  zones: EdgePlatformZones;
1580
1583
  /** Refuses a label any hosting entry of `organisationId` already holds. Rerun whenever the org's own label set changes. */
1581
1584
  setReservedLabels(organisationId: string, labels: string[]): Promise<void>;
1585
+ /**
1586
+ * `PUT /v1/platform/organisations/:orgId/slug` with `{ slug }`: idempotent upsert, so edge accepts the
1587
+ * company's platform hostnames. Rejects with an `EdgeApiError` of code `conflict` (the API's `409`) when
1588
+ * another company holds the slug.
1589
+ */
1590
+ setOrganisationSlug(organisationId: string, slug: string): Promise<void>;
1582
1591
  }
1583
1592
  /**
1584
1593
  * #173: the jobs scheduler's own admin API
@@ -1785,6 +1794,8 @@ export interface FoundryStepExecutorPorts {
1785
1794
  workerApps?: WorkerAppPort;
1786
1795
  /** ADR 0002: the keys custody Worker, for a `keysCustody` secret of a Worker app. */
1787
1796
  workerAppKeys?: KeysCustodyPort;
1797
+ /** F7: the keys service's per-company registrar. Without it the plan reports Boule's registrar key blocked (the host also sets `FoundryPlanApplyOptions.keysRegistrarUrl`). */
1798
+ keysRegistrar?: KeysRegistrarPort;
1788
1799
  /**
1789
1800
  * C3: mints the credential an org's Boule reaches Archon with (org-scoped; `orgs:request` and
1790
1801
  * `orgs:read` for that org). Archon implements it. Every call rotates the credential (the old secret
@@ -1823,6 +1834,11 @@ export interface FoundryStepExecutorPorts {
1823
1834
  resolve(ref: string): Promise<string | null | undefined>;
1824
1835
  put?(ref: string, value: string): Promise<void>;
1825
1836
  };
1837
+ /**
1838
+ * F12: the GitHub deploy-key client (`createGithubDeployKeys`) for an entry's `uses.repo`. Without it the
1839
+ * `github:deploy-key` step is not planned (the plan reports it blocked) and fails if run.
1840
+ */
1841
+ githubDeployKeys?: GithubDeployKeysPort;
1826
1842
  /**
1827
1843
  * Read access to the declared-org store, narrowed to the one query
1828
1844
  * `cloudflareZone` needs for its cross-org refusal check (#131) -- see that
@@ -2046,6 +2062,25 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
2046
2062
  ownFilesOrganisationPort(org: DeclaredOrg, recordedIds: Readonly<Record<string, string>>): Promise<boolean>;
2047
2063
  /** Whether the host's scoped ports for this own org include a broker port: the company's own broker, which its broker entries are written to. */
2048
2064
  ownBrokerPort(org: DeclaredOrg, recordedIds: Readonly<Record<string, string>>): Promise<boolean>;
2065
+ /**
2066
+ * Where the workspaces database of the broker this org's entries are written to already is: in the broker's
2067
+ * `WORKSPACES_DATABASE_URL` (`inEnv`) or as a URL held at the org's ref (`held`). The company's own broker for an
2068
+ * org that owns its services, the shared one otherwise. Throws when the broker is not wired or a read fails,
2069
+ * times out, or finds a held value that is no postgres URL, so a caller never takes "unknown" for "absent".
2070
+ */
2071
+ private workspacesDatabaseSources;
2072
+ /**
2073
+ * Whether the broker this org's entries are written to has `WORKSPACES_DATABASE_URL`, or a URL is held to give it.
2074
+ * A read that fails or times out answers `false`, so the plan does not write an entry the broker cannot start
2075
+ * with.
2076
+ */
2077
+ brokerHasWorkspacesDatabase(org: DeclaredOrg, recordedIds: Readonly<Record<string, string>>): Promise<boolean>;
2078
+ /**
2079
+ * Whether foundry may make the broker's workspaces database: it can hold the URL, and a read just showed that
2080
+ * neither the broker nor the held keys have one. A read that fails answers `false`, never "make one": a database
2081
+ * made over a broker whose own could not be read would replace it.
2082
+ */
2083
+ canProvisionWorkspacesDatabase(org: DeclaredOrg, recordedIds: Readonly<Record<string, string>>): Promise<boolean>;
2049
2084
  /** #555: the edge-routed ports this executor was built with itself (they win over edge). */
2050
2085
  ownEdgePorts(): Partial<Record<EdgePortName, boolean>>;
2051
2086
  execute(action: StepAction, context: StepExecutionContext): Promise<{
@@ -2075,6 +2110,12 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
2075
2110
  * in.
2076
2111
  */
2077
2112
  private cloudflareAccess;
2113
+ /**
2114
+ * F11 (`plan/machine-paths.ts`): one path-scoped Access application (`<host><path>`) with foundry's bypass
2115
+ * policy, so a machine caller is not stopped by the host's gate; or its removal. The stem of the step key
2116
+ * (`mp-<hash>`) names it; the recorded `host/path` is kept only to word the removal.
2117
+ */
2118
+ private cloudflareMachineBypass;
2078
2119
  /**
2079
2120
  * `plan/diff.ts`'s `planGates`: makes, changes or deletes one declared
2080
2121
  * gate through edge. A create needs the platform's recorded Access provider,
@@ -2397,6 +2438,57 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
2397
2438
  * a step for it fails, which the next plan reports instead.
2398
2439
  */
2399
2440
  private coolifyBlueGreen;
2441
+ /**
2442
+ * `coolify:workspace` (`plan/workspace.ts`): a server entry's private workspace on the primary server. It is
2443
+ * the blue/green stage (the stage app, its own empty database, the stage mail sink and the stage guards) at
2444
+ * the workspace host, with the Access gate `planGates` made first. Nothing here makes a color, a balancer or
2445
+ * a public name. The live app, when the entry is live, is only read for the names stage must not share.
2446
+ */
2447
+ private coolifyWorkspace;
2448
+ /**
2449
+ * The stage's own sign-in, for a workspace of an entry with `uses.auth`: the recorded organisation, client and
2450
+ * issuer, its own workspaces key (made and held first, once) and what it must never hold, which is what the
2451
+ * live app holds. A key is registered for redaction before it goes anywhere. Errors name the entry and the ref,
2452
+ * never a value; every held-key read has a timeout.
2453
+ */
2454
+ private workspaceStageSignIn;
2455
+ /**
2456
+ * `coolify:workspace-broker-entry` (`plan/workspace-sign-in.ts`): the broker entry `<slug>-<key>-work` of a
2457
+ * workspace with sign-in, written with the stage app's own `AUTH_APP_KEY` and the hash of its own workspaces
2458
+ * key. It never reads or writes the live entry. Records what it wrote, never a key.
2459
+ */
2460
+ private coolifyWorkspaceBrokerEntry;
2461
+ /**
2462
+ * `coolify:workspaces-database` (`plan/broker-workspaces-database.ts`): the broker's workspaces database, made
2463
+ * beside the broker (the platform's project and network, or the company's own for an org that owns its services)
2464
+ * and held at `workspacesDatabaseRef(org)`. Reads the broker and the held keys again first and makes nothing when
2465
+ * either has a URL, so a database is never made over one. Records nothing: the held URL is the record, and a
2466
+ * database made but not held is found by name on the next apply. The database stays when the org is removed, as
2467
+ * the held keys do.
2468
+ */
2469
+ private coolifyWorkspacesDatabase;
2470
+ /**
2471
+ * `coolify:promote`: moves a live workspace entry's app to `HostingEntry.liveCommit`. Patches `git_commit_sha`,
2472
+ * deploys and waits for the deployment, then records `ws.<key>.livecommit`. A failure after the patch leaves the
2473
+ * app configured for the new commit with the old container still running and no marker, so the next apply
2474
+ * patches and deploys again.
2475
+ */
2476
+ private coolifyPromote;
2477
+ /**
2478
+ * The commit a workspace entry's live app is made from: the newest finished deployment of its workspace's stage
2479
+ * app, else the commit recorded when the workspace was last applied. Recorded as `ws.<key>.commit`. Throws,
2480
+ * before any app is made, when there is none.
2481
+ */
2482
+ private workspaceCommit;
2483
+ /**
2484
+ * The Coolify GitHub source an app of `repo` is created through: the company's own (`coolify:github-source`,
2485
+ * recorded by that step) when `repo` is under the company's GitHub account, else the platform's.
2486
+ */
2487
+ private githubAppUuidFor;
2488
+ /** The company's Coolify GitHub source (`plan/github-source.ts`): made from the platform GitHub App's held keys and the company's installation id. */
2489
+ private coolifyGithubSource;
2490
+ /** True when no Coolify GitHub source has this uuid. A failed read counts as not gone. */
2491
+ private githubSourceGone;
2400
2492
  /**
2401
2493
  * Stage's guards (`plan/stage-guards.ts`): the probe port the host supplied, and the Access gate over the stage
2402
2494
  * host. The gate is offered only when everything it needs is in hand (a domain, the platform's Access provider,
@@ -2449,6 +2541,26 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
2449
2541
  private orgPostgresServer;
2450
2542
  /** `coolify:org-postgres-databases` (#444): a database and its roles for each home that has none. */
2451
2543
  private orgPostgresDatabases;
2544
+ /** F4 (#925): Boule's app and the calls on its env that the apps database steps make. */
2545
+ private appsBoule;
2546
+ /**
2547
+ * F4 (#925) `coolify:org-apps-admin`: with `org.boule.apps` on, the `<slug>_apps_admin` role on the
2548
+ * company's Postgres server (`plan/org-apps-admin.ts`); its URL is held and written to Boule's env as
2549
+ * `APPS_DATABASE_ADMIN_URL`, then Boule restarts. Apps off: the retire form (no login, env row gone,
2550
+ * nothing dropped).
2551
+ */
2552
+ private orgAppsAdmin;
2553
+ /**
2554
+ * F4 (#925) `cloudflare:apps-db-route`: the tunnel route Hyperdrive reaches the company's Postgres server
2555
+ * by, and the `APPS_DATABASE_*` env on Boule (`plan/apps-db-route.ts`). Retire takes both away; the
2556
+ * databases stay.
2557
+ */
2558
+ private appsDbRoute;
2559
+ /**
2560
+ * FZ `cloudflare:apps-zones`: the company slug and the zone ids Boule's managed backend names edge routes
2561
+ * by (`plan/apps-zones.ts`). Retire takes the rows away again.
2562
+ */
2563
+ private appsZones;
2452
2564
  /**
2453
2565
  * `coolify:org-postgres-migrate` (#444): one home's data from its old Coolify database to the
2454
2566
  * company's server. Refuses before any port call unless the staging confirmation is recorded.
@@ -2569,6 +2681,11 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
2569
2681
  * broker would drop.
2570
2682
  */
2571
2683
  private coolifyBrokerEntry;
2684
+ /**
2685
+ * What the broker entry needs beyond its want when it declares workspaces: the hash of the held key (the key
2686
+ * itself is registered for redaction and goes no further) and the operator's held database connection string.
2687
+ */
2688
+ private workspacesInputs;
2572
2689
  /**
2573
2690
  * #161: the org's Boule broker entry, `<slug>-boule`, written the way a
2574
2691
  * hosting entry's is: with the `AUTH_APP_KEY` `coolifyBoule` put in the
@@ -3223,6 +3340,40 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
3223
3340
  * leaves one live token. `null` while the customers organisation is not recorded yet.
3224
3341
  */
3225
3342
  private ensureCustomersDirectoryCredential;
3343
+ /** The held keys with a timeout on every call: a hung store stops the step with a plain line. */
3344
+ private timedHeldKeys;
3345
+ /** T3: the company's registrar key, held at `foundry:registrar:<org id>`; either step may make it. */
3346
+ private registrarKey;
3347
+ /**
3348
+ * T3, customers off: takes away the registrar env foundry gave Boule. The registrar step removes the record
3349
+ * at the broker and forgets the key. Returns true when Boule's env changed.
3350
+ */
3351
+ private dropRegistrarEnv;
3352
+ /**
3353
+ * T3: the company's record in the broker's `AUTH_REGISTRARS` (`plan/broker-registrar.ts`): its key (made
3354
+ * and held first if the Boule step has not), its sign-in organisation, customers organisations and login
3355
+ * host. With customers off it takes the record away, then forgets the key. The applied marker is recorded
3356
+ * last and never holds the key; every error is redacted of it.
3357
+ */
3358
+ private brokerRegistrar;
3359
+ private customerGrantsCredential;
3360
+ /**
3361
+ * F13, app side: an entry with `uses.customerGrants` gets `CUSTOMER_GRANTS_CREDENTIAL` (made and held first,
3362
+ * once). An entry that had one and no longer declares the flag loses the env and the held value; each part is
3363
+ * repeated safely, so a run that died halfway is finished by the next.
3364
+ */
3365
+ private customerGrantsAppEnv;
3366
+ /** Forgets one entry's held credential and clears its marker. Held first, marker last, so a failed forget is repeated. */
3367
+ private forgetCustomerGrantsCredential;
3368
+ /** F13: the held credentials of entries that no longer declare the flag, forgotten after Boule stopped listing them. */
3369
+ private forgetDroppedCustomerGrants;
3370
+ /**
3371
+ * F13, Boule side: the `CUSTOMER_GRANTS` value for the flagged entries (each credential made and held if it
3372
+ * is not yet), or `value: null`. With no flagged entry left and a value foundry wrote, the env row is
3373
+ * removed (`removed`). A flagged entry that cannot be listed yet changes nothing. Never a hand-set value
3374
+ * it did not write.
3375
+ */
3376
+ private customerGrantsForBoule;
3226
3377
  /** `put`, tried up to {@link BOULE_CREDENTIAL_ATTEMPTS} times; true once one attempt succeeds. The cause is dropped. */
3227
3378
  private holdWithRetry;
3228
3379
  /**
@@ -3298,6 +3449,11 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
3298
3449
  * admin token goes to `jobs:org:<slug>:adminToken` and nowhere else.
3299
3450
  */
3300
3451
  private ownJobs;
3452
+ /**
3453
+ * `plan/own-diff.ts`'s `planOwnJobsRoute`: the org's scheduler on `jobs.<domain>`, through the company's own
3454
+ * edge-routed DNS and tunnel ports, dialling the address `coolify:own-jobs` recorded.
3455
+ */
3456
+ private ownJobsRoute;
3301
3457
  /**
3302
3458
  * `plan/own-diff.ts`'s `planOwnFiles`: the org's own files host in the
3303
3459
  * org's own project, trusting the company's issuer `https://auth.<domain>`.
@@ -3350,6 +3506,21 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
3350
3506
  * `livekit:org:<slug>:keys` and the app's env, nowhere else.
3351
3507
  */
3352
3508
  private ownSfu;
3509
+ /**
3510
+ * `plan/entry-jobs.ts`'s `planEntryJobs`: registers one entry as its own project in the platform's jobs
3511
+ * scheduler, holds the credentials the scheduler shows once, then writes `JOBS_SCHEDULER_URL`,
3512
+ * `JOBS_SIGNING_SECRET` and `JOBS_SYNC_KEY` to the entry's env and restarts the app.
3513
+ *
3514
+ * The project's id is recorded as undelivered and persisted before the credentials are held, and cleared
3515
+ * only once both are, so a failure in between never registers a second project: `planEntryJobs` blocks
3516
+ * on it. Credentials already held are never registered again, which is also how a failed env write is
3517
+ * retried. Errors name the project and the refs, never a credential.
3518
+ */
3519
+ private jobsProject;
3520
+ /** `plan/entry-audit.ts`: makes the platform signer if none exists and registers one entry's ledger for sealing. */
3521
+ private auditLedger;
3522
+ /** F12, `plan/entry-repo-key.ts`: makes or removes one entry's deploy key. See `entry-repo-key-apply.ts`. */
3523
+ private githubDeployKey;
3353
3524
  private jobsRegistration;
3354
3525
  /** The blue/green database route (`plan/remote-database.ts`). */
3355
3526
  private remoteDatabaseRoute;
@@ -3367,6 +3538,13 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
3367
3538
  * halfway is planned again.
3368
3539
  */
3369
3540
  private publishOikosEntryRecords;
3541
+ /**
3542
+ * The entry names a company has in the platform's `companyincluded.app` zone: its apps' `hostedName`
3543
+ * addresses. Written the same way as {@link publishOikosEntryRecords}. Which company may hold a name is
3544
+ * the host's check (Archon), so the step owns any single-label name under the zone.
3545
+ */
3546
+ private publishAppsEntryRecords;
3547
+ private publishPlatformZoneEntryRecords;
3370
3548
  /**
3371
3549
  * #236: when this tunnel's DNS was last published under a domain that
3372
3550
  * differs from the one `org` now declares, deletes every CNAME in the
@@ -3743,6 +3921,18 @@ export declare class FoundryStepExecutor implements StepExecutor, StepDestroyer
3743
3921
  * never leads to a second mint -- `planEntryEdgeKeys` blocks instead.
3744
3922
  */
3745
3923
  private edgeEntryKey;
3924
+ /**
3925
+ * F7 (#928): the company's signed-records registrar key (`plan/keys-registrar.ts`). Mint: a leftover
3926
+ * undelivered key is revoked first; the new key's id is recorded and persisted before it is written to
3927
+ * Boule's env (3 tries, then the error names the id only and the next apply revokes and mints again).
3928
+ * `url` rewrites the address only. Retire revokes and takes both env rows away. Never holds the key.
3929
+ */
3930
+ private keysRegistrar;
3931
+ /**
3932
+ * F3: `plan/entry-edge-key.ts`'s `planEdgeSlug` -- records the org's slug in edge. A slug another company
3933
+ * holds (edge's `409`) is a plain line naming the clash, not the raw provider error.
3934
+ */
3935
+ private edgeSlug;
3746
3936
  /**
3747
3937
  * F7 (#317): `plan/entry-edge-key.ts`'s `planEdgeReservedLabels` --
3748
3938
  * tells the edge service every label this org's own entries already