@wtfalch/foundry 0.16.16 → 0.17.1

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 (67) hide show
  1. package/dist/apply.d.ts +22 -1
  2. package/dist/bootstrap/bootstrap.d.ts +6 -1
  3. package/dist/bootstrap/bootstrap.js +26 -3
  4. package/dist/bootstrap/declare.d.ts +11 -1
  5. package/dist/bootstrap/declare.js +18 -6
  6. package/dist/index.d.ts +11 -6
  7. package/dist/index.js +8 -1
  8. package/dist/migrations/0038_calls_version_pin.sql +8 -0
  9. package/dist/migrations/0039_destroy_record.sql +7 -0
  10. package/dist/migrations/0040_company_included_uuid.sql +72 -0
  11. package/dist/migrations/0041_company_included_uuid_keys.sql +132 -0
  12. package/dist/migrations/0042_mutation_leases.sql +12 -0
  13. package/dist/migrations/0043_platform_names.sql +25 -0
  14. package/dist/migrations/0044_platform_mail_lettermint_project.sql +11 -0
  15. package/dist/org.d.ts +128 -3
  16. package/dist/org.js +186 -1
  17. package/dist/plan/adopt.d.ts +76 -0
  18. package/dist/plan/adopt.js +184 -0
  19. package/dist/plan/agora.d.ts +21 -0
  20. package/dist/plan/agora.js +37 -0
  21. package/dist/plan/broker-entries.d.ts +9 -1
  22. package/dist/plan/broker-entries.js +13 -5
  23. package/dist/plan/chat-matrix.d.ts +1 -2
  24. package/dist/plan/chat-matrix.js +15 -4
  25. package/dist/plan/core-files.d.ts +25 -0
  26. package/dist/plan/core-files.js +25 -0
  27. package/dist/plan/diff.d.ts +27 -3
  28. package/dist/plan/diff.js +264 -86
  29. package/dist/plan/edge-worker.d.ts +114 -0
  30. package/dist/plan/edge-worker.js +201 -0
  31. package/dist/plan/entry-ai-key.d.ts +3 -3
  32. package/dist/plan/entry-files-key.d.ts +3 -3
  33. package/dist/plan/entry-names-key.d.ts +73 -0
  34. package/dist/plan/entry-names-key.js +236 -0
  35. package/dist/plan/executor.d.ts +292 -24
  36. package/dist/plan/executor.js +745 -77
  37. package/dist/plan/index.d.ts +6 -2
  38. package/dist/plan/index.js +3 -1
  39. package/dist/plan/live.d.ts +9 -2
  40. package/dist/plan/login-host.d.ts +13 -2
  41. package/dist/plan/login-host.js +26 -7
  42. package/dist/plan/plan-apply.d.ts +153 -6
  43. package/dist/plan/plan-apply.js +639 -78
  44. package/dist/plan/platform-diff.d.ts +106 -1
  45. package/dist/plan/platform-diff.js +182 -2
  46. package/dist/plan/platform-org.d.ts +45 -1
  47. package/dist/plan/platform-org.js +34 -3
  48. package/dist/plan/platform-providers.d.ts +45 -1
  49. package/dist/plan/platform-providers.js +585 -16
  50. package/dist/plan/providers-readers.d.ts +2 -0
  51. package/dist/plan/providers-readers.js +4 -0
  52. package/dist/plan/rollout.d.ts +52 -0
  53. package/dist/plan/rollout.js +37 -0
  54. package/dist/plan/step-system.d.ts +22 -0
  55. package/dist/plan/step-system.js +38 -0
  56. package/dist/plan.d.ts +3 -0
  57. package/dist/platform.d.ts +22 -3
  58. package/dist/platform.js +6 -0
  59. package/dist/state.d.ts +13 -0
  60. package/dist/store/audit.js +15 -1
  61. package/dist/store/postgres.d.ts +1 -1
  62. package/dist/store/postgres.js +142 -15
  63. package/dist/store/schema.d.ts +202 -5
  64. package/dist/store/schema.js +18 -1
  65. package/dist/store.d.ts +47 -4
  66. package/dist/store.js +9 -1
  67. package/package.json +1 -1
@@ -131,6 +131,12 @@ export interface FoundryPlatformStepExecutorOptions {
131
131
  * `platform.ai.enabled` without it gets the step reported as blocked.
132
132
  */
133
133
  ai?: PlatformAiDeps;
134
+ /**
135
+ * #478: dependencies for `coolify:app` keyed {@link PLATFORM_NAMES_KEY} --
136
+ * optional for the same reason as `auth`; a host that declares
137
+ * `platform.names.enabled` without it gets the step reported as blocked.
138
+ */
139
+ names?: PlatformNamesDeps;
134
140
  /**
135
141
  * #175: dependencies for `coolify:app` keyed {@link PLATFORM_ARCHON_KEY}
136
142
  * -- optional for the same reason as {@link auth}.
@@ -197,6 +203,9 @@ export interface FoundryPlatformStepExecutorOptions {
197
203
  * #172 adds `coolify:app` keyed {@link PLATFORM_AI_KEY}, the platform's AI
198
204
  * host ({@link provisionPlatformAi}), once a host passes {@link PlatformAiDeps}.
199
205
  *
206
+ * #478 adds `coolify:app` keyed {@link PLATFORM_NAMES_KEY}, the names host
207
+ * ({@link provisionPlatformNames}), once a host passes {@link PlatformNamesDeps}.
208
+ *
200
209
  * #175 adds `coolify:app` keyed {@link PLATFORM_ARCHON_KEY}, Archon itself
201
210
  * ({@link provisionPlatformArchon}), once a host passes
202
211
  * {@link PlatformArchonDeps}.
@@ -216,6 +225,7 @@ export declare class FoundryPlatformStepExecutor implements PlatformStepExecutor
216
225
  private readonly integrations?;
217
226
  private readonly files?;
218
227
  private readonly ai?;
228
+ private readonly names?;
219
229
  private readonly archon?;
220
230
  private readonly backup?;
221
231
  constructor(cloudflare: Pick<CloudflarePort, 'findZoneByApex' | 'createZone'>, declaredOrgStore: Pick<DeclaredOrgStore, 'findOrgIdForZone' | 'list' | 'get'>, options?: FoundryPlatformStepExecutorOptions);
@@ -226,6 +236,7 @@ export declare class FoundryPlatformStepExecutor implements PlatformStepExecutor
226
236
  files?: string;
227
237
  integrations?: string;
228
238
  ai?: string;
239
+ names?: string;
229
240
  archon?: string;
230
241
  mail?: string;
231
242
  backupExecutorMissing?: boolean;
@@ -409,7 +420,7 @@ export interface PlatformMailRuntime {
409
420
  * {@link PlatformStepExecutionContext}, bundled like {@link PlatformAuthDeps}.
410
421
  */
411
422
  export interface PlatformArchonDeps {
412
- coolify: Pick<CoolifyPort, 'findProjectByName' | 'createProject' | 'findOrCreateEnvironment' | 'listServers' | 'findApplicationByName' | 'getApplication' | 'requireGithubApp' | 'createGithubAppApplication' | 'createDockerfileApplication' | 'listDatabases' | 'createPostgresDatabase' | 'getDatabase' | 'raw' | 'bulkUpsertEnvs' | 'listEnvs' | 'updateApplication' | 'deploy' | 'deployAndWait'>;
423
+ coolify: Pick<CoolifyPort, 'findProjectByName' | 'createProject' | 'findOrCreateEnvironment' | 'listServers' | 'findApplicationByName' | 'getApplication' | 'requireGithubApp' | 'createGithubAppApplication' | 'createDockerfileApplication' | 'listDatabases' | 'createPostgresDatabase' | 'getDatabase' | 'raw' | 'bulkUpsertEnvs' | 'listEnvs' | 'deleteEnv' | 'updateApplication' | 'deploy' | 'deployAndWait'>;
413
424
  cloudflare: Pick<CloudflarePort, 'findZoneByApex' | 'findTunnelByName' | 'createTunnel' | 'putTunnelConfig' | 'getTunnelToken' | 'findDnsRecord' | 'createDnsRecord' | 'updateDnsRecord' | 'listAccessApps' | 'createAccessApp' | 'listAccessPolicies' | 'createAccessPolicy' | 'deleteAccessApp'>;
414
425
  /** Must target the platform's own ZITADEL instance, or `zitadelForInstance` must be set. */
415
426
  zitadel: Pick<ZitadelPort, 'findOrCreateOrg' | 'findOrCreateProject' | 'createOidcApp' | 'listApps' | 'deleteApp'>;
@@ -811,6 +822,39 @@ export declare const FILES_MANAGEMENT_KEY_ID = "foundry-1";
811
822
  export declare const FILES_MANAGEMENT_KEY_REF = "files:platform:managementKey";
812
823
  /** The ref the files host's introspection client secret is delivered under. */
813
824
  export declare const FILES_INTROSPECTION_SECRET_REF = "zitadel:platform:files:introspection";
825
+ export interface PlatformNamesRuntime {
826
+ fetch?: typeof fetch;
827
+ sleep?: (ms: number) => Promise<void>;
828
+ now?: () => number;
829
+ /** Tries at handing the platform key to the host (default 3). */
830
+ deliverAttempts?: number;
831
+ readyTimeoutMs?: number;
832
+ readyIntervalMs?: number;
833
+ }
834
+ export interface PlatformNamesDeps {
835
+ coolify: Pick<CoolifyPort, 'findProjectByName' | 'createProject' | 'findOrCreateEnvironment' | 'listServers' | 'findApplicationByName' | 'getApplication' | 'requireGithubApp' | 'createGithubAppApplication' | 'createDockerfileApplication' | 'listDatabases' | 'createPostgresDatabase' | 'getDatabase' | 'bulkUpsertEnvs' | 'listEnvs' | 'updateApplication' | 'deploy' | 'deployAndWait' | 'raw'>;
836
+ cloudflare: Pick<CloudflarePort, 'findZoneByApex' | 'findTunnelByName' | 'createTunnel' | 'putTunnelConfig' | 'getTunnelToken' | 'findDnsRecord' | 'createDnsRecord' | 'updateDnsRecord'>;
837
+ deliverSecret: FoundryStepExecutorPorts['deliverSecret'];
838
+ /**
839
+ * Reads the names service's own Cloudflare API token back, held under
840
+ * {@link PLATFORM_NAMES_CLOUDFLARE_TOKEN_REF} -- a human step (the issue's
841
+ * own "Human steps"), never minted here: foundry has no Cloudflare
842
+ * account of its own to carve that token out of. Absent, or with nothing
843
+ * held under that ref yet, is reported blocked by `blockedSteps`
844
+ * ({@link namesBlockedReason}), never planned to throw.
845
+ */
846
+ heldKeys?: {
847
+ resolve(ref: string): Promise<string | null>;
848
+ };
849
+ /**
850
+ * The Cloudflare account id the token above is scoped to. Not a secret --
851
+ * a plain config value beside the credential it travels with, the same
852
+ * way {@link PlatformFilesDeps.r2}'s bucket name is.
853
+ */
854
+ cloudflareAccountId?: string;
855
+ /** Clock, sleep and fetch for the readiness wait and delivery retries; real ones by default. */
856
+ runtime?: PlatformNamesRuntime;
857
+ }
814
858
  /**
815
859
  * #174: everything {@link provisionPlatformIntegrations} needs beyond
816
860
  * {@link PlatformStepExecutionContext} -- a bundle, like