@treeseed/sdk 0.10.28 → 0.11.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 (148) hide show
  1. package/README.md +207 -6
  2. package/dist/capacity-provider.d.ts +3 -1
  3. package/dist/capacity-provider.js +25 -5
  4. package/dist/control-plane.d.ts +1 -0
  5. package/dist/control-plane.js +38 -13
  6. package/dist/db/market-schema.d.ts +8860 -6172
  7. package/dist/db/market-schema.js +108 -0
  8. package/dist/db/node-sqlite.js +7 -2
  9. package/dist/hosting/apps.d.ts +12 -0
  10. package/dist/hosting/apps.js +107 -0
  11. package/dist/hosting/builtins.d.ts +25 -0
  12. package/dist/hosting/builtins.js +791 -0
  13. package/dist/hosting/contracts.d.ts +207 -0
  14. package/dist/hosting/contracts.js +0 -0
  15. package/dist/hosting/graph.d.ts +192 -0
  16. package/dist/hosting/graph.js +1106 -0
  17. package/dist/hosting/index.d.ts +4 -0
  18. package/dist/hosting/index.js +4 -0
  19. package/dist/index.d.ts +10 -3
  20. package/dist/index.js +63 -6
  21. package/dist/managed-dependencies.js +1 -2
  22. package/dist/market-client.d.ts +63 -3
  23. package/dist/market-client.js +83 -11
  24. package/dist/operations/services/bootstrap-runner.d.ts +3 -1
  25. package/dist/operations/services/bootstrap-runner.js +22 -2
  26. package/dist/operations/services/config-runtime.d.ts +10 -5
  27. package/dist/operations/services/config-runtime.js +209 -66
  28. package/dist/operations/services/deploy.d.ts +70 -7
  29. package/dist/operations/services/deploy.js +579 -64
  30. package/dist/operations/services/deployment-readiness.d.ts +30 -0
  31. package/dist/operations/services/deployment-readiness.js +175 -0
  32. package/dist/operations/services/git-workflow.d.ts +2 -1
  33. package/dist/operations/services/git-workflow.js +9 -3
  34. package/dist/operations/services/github-actions-verification.d.ts +1 -0
  35. package/dist/operations/services/github-actions-verification.js +1 -0
  36. package/dist/operations/services/github-api.js +1 -1
  37. package/dist/operations/services/github-automation.d.ts +1 -1
  38. package/dist/operations/services/github-automation.js +4 -3
  39. package/dist/operations/services/github-credentials.d.ts +13 -0
  40. package/dist/operations/services/github-credentials.js +58 -0
  41. package/dist/operations/services/hosted-service-checks.d.ts +63 -0
  42. package/dist/operations/services/hosted-service-checks.js +327 -0
  43. package/dist/operations/services/hub-provider-launch.js +3 -3
  44. package/dist/operations/services/live-hosted-service-checks.d.ts +25 -0
  45. package/dist/operations/services/live-hosted-service-checks.js +350 -0
  46. package/dist/operations/services/managed-host-security.js +1 -1
  47. package/dist/operations/services/operations-runner-smoke.d.ts +30 -0
  48. package/dist/operations/services/operations-runner-smoke.js +180 -0
  49. package/dist/operations/services/package-adapters.d.ts +95 -0
  50. package/dist/operations/services/package-adapters.js +288 -0
  51. package/dist/operations/services/package-reference-policy.d.ts +1 -0
  52. package/dist/operations/services/package-reference-policy.js +15 -2
  53. package/dist/operations/services/project-platform.d.ts +80 -22
  54. package/dist/operations/services/project-platform.js +49 -8
  55. package/dist/operations/services/project-web-monitor.js +26 -4
  56. package/dist/operations/services/railway-api.d.ts +88 -5
  57. package/dist/operations/services/railway-api.js +626 -35
  58. package/dist/operations/services/railway-deploy.d.ts +46 -40
  59. package/dist/operations/services/railway-deploy.js +261 -293
  60. package/dist/operations/services/release-candidate.d.ts +19 -0
  61. package/dist/operations/services/release-candidate.js +375 -38
  62. package/dist/operations/services/repository-save-orchestrator.d.ts +3 -1
  63. package/dist/operations/services/repository-save-orchestrator.js +279 -66
  64. package/dist/operations/services/runtime-tools.d.ts +1 -0
  65. package/dist/operations/services/runtime-tools.js +10 -9
  66. package/dist/operations/services/verification-cache.d.ts +25 -0
  67. package/dist/operations/services/verification-cache.js +71 -0
  68. package/dist/operations/services/workspace-dependency-mode.js +9 -1
  69. package/dist/operations/services/workspace-save.js +1 -1
  70. package/dist/operations/services/workspace-tools.js +2 -1
  71. package/dist/platform/contracts.d.ts +32 -1
  72. package/dist/platform/deploy-config.js +73 -8
  73. package/dist/platform/env.yaml +163 -35
  74. package/dist/platform/environment.d.ts +1 -0
  75. package/dist/platform/environment.js +74 -5
  76. package/dist/platform/plugin.d.ts +9 -0
  77. package/dist/platform-operation-store.js +2 -2
  78. package/dist/platform-operations.js +1 -1
  79. package/dist/reconcile/bootstrap-systems.js +2 -2
  80. package/dist/reconcile/builtin-adapters.js +372 -189
  81. package/dist/reconcile/contracts.d.ts +9 -5
  82. package/dist/reconcile/desired-state.d.ts +1 -0
  83. package/dist/reconcile/desired-state.js +5 -5
  84. package/dist/reconcile/engine.d.ts +5 -2
  85. package/dist/reconcile/engine.js +53 -32
  86. package/dist/reconcile/index.d.ts +2 -0
  87. package/dist/reconcile/index.js +2 -0
  88. package/dist/reconcile/live-acceptance.d.ts +79 -0
  89. package/dist/reconcile/live-acceptance.js +1615 -0
  90. package/dist/reconcile/platform.d.ts +104 -0
  91. package/dist/reconcile/platform.js +100 -0
  92. package/dist/reconcile/state.js +4 -4
  93. package/dist/reconcile/units.js +2 -2
  94. package/dist/scripts/deployment-readiness.js +20 -0
  95. package/dist/scripts/generate-treedx-openapi-types.js +186 -0
  96. package/dist/scripts/operations-runner-smoke.js +16 -0
  97. package/dist/scripts/release-verify.js +4 -1
  98. package/dist/scripts/tenant-workflow-action.js +10 -1
  99. package/dist/sdk-types.d.ts +169 -4
  100. package/dist/sdk-types.js +20 -2
  101. package/dist/sdk.d.ts +35 -24
  102. package/dist/sdk.js +186 -17
  103. package/dist/template-launch-requirements.js +9 -0
  104. package/dist/treedx/adapters.d.ts +6 -0
  105. package/dist/treedx/adapters.js +36 -0
  106. package/dist/treedx/client.d.ts +222 -0
  107. package/dist/treedx/client.js +871 -0
  108. package/dist/treedx/errors.d.ts +13 -0
  109. package/dist/treedx/errors.js +17 -0
  110. package/dist/treedx/federated-client.d.ts +27 -0
  111. package/dist/treedx/federated-client.js +158 -0
  112. package/dist/treedx/generated/openapi-types.d.ts +3558 -0
  113. package/dist/treedx/generated/openapi-types.js +0 -0
  114. package/dist/treedx/graph-adapter.d.ts +33 -0
  115. package/dist/treedx/graph-adapter.js +156 -0
  116. package/dist/treedx/index.d.ts +14 -0
  117. package/dist/treedx/index.js +48 -0
  118. package/dist/treedx/market-integration.d.ts +27 -0
  119. package/dist/treedx/market-integration.js +131 -0
  120. package/dist/treedx/ports.d.ts +166 -0
  121. package/dist/treedx/ports.js +231 -0
  122. package/dist/treedx/query-adapter.d.ts +19 -0
  123. package/dist/treedx/query-adapter.js +62 -0
  124. package/dist/treedx/registry-client.d.ts +11 -0
  125. package/dist/treedx/registry-client.js +19 -0
  126. package/dist/treedx/repository-adapter.d.ts +45 -0
  127. package/dist/treedx/repository-adapter.js +308 -0
  128. package/dist/treedx/sdk-integration.d.ts +27 -0
  129. package/dist/treedx/sdk-integration.js +63 -0
  130. package/dist/treedx/types.d.ts +1084 -0
  131. package/dist/treedx/types.js +8 -0
  132. package/dist/treedx/workspace-adapter.d.ts +27 -0
  133. package/dist/treedx/workspace-adapter.js +65 -0
  134. package/dist/treedx-backends.d.ts +218 -0
  135. package/dist/treedx-backends.js +632 -0
  136. package/dist/treedx-client.d.ts +86 -0
  137. package/dist/treedx-client.js +175 -0
  138. package/dist/treeseed/template-catalog/catalog.fixture.json +23 -23
  139. package/dist/workflow/operations.d.ts +119 -13
  140. package/dist/workflow/operations.js +309 -53
  141. package/dist/workflow-state.d.ts +13 -0
  142. package/dist/workflow-state.js +43 -26
  143. package/dist/workflow-support.d.ts +11 -3
  144. package/dist/workflow-support.js +67 -3
  145. package/dist/workflow.d.ts +5 -0
  146. package/drizzle/market/0004_treedx_market_integration.sql +99 -0
  147. package/package.json +34 -3
  148. package/templates/github/deploy-web.workflow.yml +39 -6
@@ -57,6 +57,15 @@ function statusFromChecks(checks) {
57
57
  return "unknown";
58
58
  }
59
59
  function workflowRunCheck(input) {
60
+ if (input.treeDxPublish) {
61
+ return check({
62
+ key: "latest_workflow",
63
+ label: "Latest workflow",
64
+ status: "skipped",
65
+ source: "treedx",
66
+ summary: "TreeDX content publish does not dispatch a GitHub Actions workflow."
67
+ });
68
+ }
60
69
  const run = input.workflowResult?.runId ? input.workflowResult : input.latestWorkflowRun;
61
70
  if (!run) {
62
71
  return check({
@@ -83,6 +92,15 @@ function workflowRunCheck(input) {
83
92
  });
84
93
  }
85
94
  async function workflowFileCheck(input) {
95
+ if (input.treeDxPublish) {
96
+ return check({
97
+ key: "workflow_file",
98
+ label: "Workflow file",
99
+ status: "skipped",
100
+ source: "treedx",
101
+ summary: "TreeDX content publish uses the Treeseed operations runner and Cloudflare R2 directly."
102
+ });
103
+ }
86
104
  if (!input.repository) {
87
105
  return check({
88
106
  key: "workflow_file",
@@ -179,6 +197,8 @@ async function buildProjectWebMonitorResult(input) {
179
197
  const repository = repositorySlug(input.repository);
180
198
  const workflowFile = text(input.workflowFile ?? input.repository?.workflowFile, "deploy-web.yml");
181
199
  const target = objectValue(input.target);
200
+ const contentPublish = objectValue(target.contentPublish);
201
+ const treeDxPublish = input.action === "publish_content" && contentPublish.provider === "treedx";
182
202
  const targetUrl = externalUrl(target.url, target.baseUrl, target.previewUrl, target.lastDeploymentUrl);
183
203
  const latestWorkflowRun = !input.workflowResult && repository && input.githubClient ? await getLatestGitHubWorkflowRun(repository, {
184
204
  client: input.githubClient,
@@ -190,14 +210,16 @@ async function buildProjectWebMonitorResult(input) {
190
210
  workflowResult: input.workflowResult ?? input.externalWorkflow ?? null,
191
211
  latestWorkflowRun,
192
212
  repository,
193
- workflowFile
213
+ workflowFile,
214
+ treeDxPublish
194
215
  }),
195
216
  await workflowFileCheck({
196
217
  repository,
197
218
  workflowFile,
198
219
  githubClient: input.githubClient,
199
220
  mockExternal: input.mockExternal,
200
- dryRun: input.dryRun
221
+ dryRun: input.dryRun,
222
+ treeDxPublish
201
223
  }),
202
224
  check({
203
225
  key: "web_host",
@@ -224,8 +246,8 @@ async function buildProjectWebMonitorResult(input) {
224
246
  key: "content_publish",
225
247
  label: "Content publish",
226
248
  status: input.action === "publish_content" ? "passed" : "skipped",
227
- source: "sdk",
228
- summary: input.action === "publish_content" ? "Content publish workflow completed." : "Content publish was not part of this action."
249
+ source: treeDxPublish ? "treedx" : "sdk",
250
+ summary: treeDxPublish ? "TreeDX content snapshot was published without GitHub Actions." : input.action === "publish_content" ? "Content publish workflow completed." : "Content publish was not part of this action."
229
251
  }),
230
252
  check({
231
253
  key: "d1_migration",
@@ -55,6 +55,14 @@ export type RailwayCustomDomainSummary = {
55
55
  verificationToken: string | null;
56
56
  dnsRecords: RailwayCustomDomainDnsRecord[];
57
57
  };
58
+ export type RailwayServiceDomainSummary = {
59
+ id: string;
60
+ domain: string;
61
+ kind: 'service' | 'custom';
62
+ environmentId: string;
63
+ serviceId: string;
64
+ targetPort: number | null;
65
+ };
58
66
  export type RailwayVolumeInstanceSummary = {
59
67
  id: string;
60
68
  serviceId: string | null;
@@ -136,15 +144,54 @@ export declare function listRailwayEnvironments({ projectId, env, fetchImpl, }:
136
144
  env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
137
145
  fetchImpl?: typeof fetch;
138
146
  }): Promise<RailwayEnvironmentSummary[]>;
139
- export declare function ensureRailwayService({ projectId, serviceName, serviceId, env, fetchImpl, }: {
147
+ export declare function ensureRailwayService({ projectId, serviceName, serviceId, environmentId, imageRef, env, fetchImpl, }: {
140
148
  projectId: string;
141
149
  serviceName?: string | null;
142
150
  serviceId?: string | null;
151
+ environmentId?: string | null;
152
+ imageRef?: string | null;
143
153
  env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
144
154
  fetchImpl?: typeof fetch;
145
155
  }): Promise<{
146
156
  service: RailwayServiceSummary;
147
157
  created: boolean;
158
+ replaced: boolean;
159
+ } | {
160
+ service: RailwayServiceSummary;
161
+ created: boolean;
162
+ replaced?: undefined;
163
+ }>;
164
+ export declare function updateRailwayServiceImageSource({ serviceId, imageRef, env, fetchImpl, }: {
165
+ serviceId: string;
166
+ imageRef: string;
167
+ env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
168
+ fetchImpl?: typeof fetch;
169
+ }): Promise<RailwayServiceSummary>;
170
+ export declare function ensureRailwayGeneratedServiceDomain({ projectId, environmentId, serviceId, targetPort, env, fetchImpl, }: {
171
+ projectId: string;
172
+ environmentId: string;
173
+ serviceId: string;
174
+ targetPort?: number | null;
175
+ env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
176
+ fetchImpl?: typeof fetch;
177
+ }): Promise<{
178
+ domain: RailwayServiceDomainSummary;
179
+ created: boolean;
180
+ }>;
181
+ export declare function listRailwayServiceDomains({ projectId, environmentId, serviceId, env, fetchImpl, }: {
182
+ projectId: string;
183
+ environmentId: string;
184
+ serviceId: string;
185
+ env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
186
+ fetchImpl?: typeof fetch;
187
+ }): Promise<RailwayServiceDomainSummary[]>;
188
+ export declare function deployRailwayServiceInstance({ serviceId, environmentId, env, fetchImpl, }: {
189
+ serviceId: string;
190
+ environmentId: string;
191
+ env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
192
+ fetchImpl?: typeof fetch;
193
+ }): Promise<{
194
+ deploymentId: string | null;
148
195
  }>;
149
196
  export declare function updateRailwayServiceName({ serviceId, name, env, fetchImpl, }: {
150
197
  serviceId: string;
@@ -152,15 +199,33 @@ export declare function updateRailwayServiceName({ serviceId, name, env, fetchIm
152
199
  env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
153
200
  fetchImpl?: typeof fetch;
154
201
  }): Promise<RailwayServiceSummary>;
155
- export declare function ensureRailwayPostgresService({ projectId, environmentId, serviceName, env, fetchImpl, }: {
202
+ export declare function ensureRailwayPostgresService({ projectId, environmentId, serviceName, env, fetchImpl, maxAttempts, }: {
156
203
  projectId: string;
157
204
  environmentId: string;
158
205
  serviceName: string;
159
206
  env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
160
207
  fetchImpl?: typeof fetch;
208
+ maxAttempts?: number;
161
209
  }): Promise<{
162
210
  service: RailwayServiceSummary;
163
211
  created: boolean;
212
+ proof: {
213
+ ok: boolean;
214
+ variableKeys: string[];
215
+ volumeId: string | null;
216
+ deploymentStatus: string | null;
217
+ message: string;
218
+ };
219
+ }>;
220
+ export declare function inspectRailwayServiceDeploymentHealth({ serviceId, environmentId, env, fetchImpl, }: {
221
+ serviceId: string;
222
+ environmentId: string;
223
+ env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
224
+ fetchImpl?: typeof fetch;
225
+ }): Promise<{
226
+ ok: boolean;
227
+ status: string;
228
+ message: string;
164
229
  }>;
165
230
  export declare function listRailwayServices({ projectId, env, fetchImpl, }: {
166
231
  projectId: string;
@@ -199,7 +264,7 @@ export declare function getRailwayServiceInstance({ serviceId, environmentId, en
199
264
  sleepApplication: null;
200
265
  runtimeConfigSupported: false;
201
266
  }>;
202
- export declare function ensureRailwayServiceInstanceConfiguration({ serviceId, environmentId, buildCommand, startCommand, cronSchedule, rootDirectory, healthcheckPath, healthcheckTimeoutSeconds, healthcheckIntervalSeconds, restartPolicy, runtimeMode, env, fetchImpl, settleAttempts, settleDelayMs, }: {
267
+ export declare function ensureRailwayServiceInstanceConfiguration({ serviceId, environmentId, buildCommand, startCommand, cronSchedule, rootDirectory, healthcheckPath, healthcheckTimeoutSeconds, healthcheckIntervalSeconds, restartPolicy, runtimeMode, deploymentRegion, env, fetchImpl, settleAttempts, settleDelayMs, }: {
203
268
  serviceId: string;
204
269
  environmentId: string;
205
270
  buildCommand?: string | null;
@@ -211,6 +276,7 @@ export declare function ensureRailwayServiceInstanceConfiguration({ serviceId, e
211
276
  healthcheckIntervalSeconds?: number | null;
212
277
  restartPolicy?: string | null;
213
278
  runtimeMode?: string | null;
279
+ deploymentRegion?: string | null;
214
280
  env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
215
281
  fetchImpl?: typeof fetch;
216
282
  settleAttempts?: number;
@@ -281,7 +347,7 @@ export declare function listRailwayVolumes({ projectId, env, fetchImpl, }: {
281
347
  env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
282
348
  fetchImpl?: typeof fetch;
283
349
  }): Promise<RailwayVolumeSummary[]>;
284
- export declare function ensureRailwayServiceVolume({ projectId, environmentId, serviceId, name, mountPath, env, fetchImpl, }: {
350
+ export declare function ensureRailwayServiceVolume({ projectId, environmentId, serviceId, name, mountPath, env, fetchImpl, settleAttempts, settleDelayMs, }: {
285
351
  projectId: string;
286
352
  environmentId: string;
287
353
  serviceId: string;
@@ -289,11 +355,23 @@ export declare function ensureRailwayServiceVolume({ projectId, environmentId, s
289
355
  mountPath: string;
290
356
  env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
291
357
  fetchImpl?: typeof fetch;
358
+ settleAttempts?: number;
359
+ settleDelayMs?: number;
292
360
  }): Promise<{
293
- volume: RailwayVolumeSummary | null;
361
+ volume: {
362
+ instances: RailwayVolumeInstanceSummary[];
363
+ id: string;
364
+ name: string;
365
+ projectId: string | null;
366
+ };
294
367
  instance: RailwayVolumeInstanceSummary | null;
295
368
  created: boolean;
296
369
  updated: boolean;
370
+ } | {
371
+ volume: RailwayVolumeSummary | null;
372
+ instance: RailwayVolumeInstanceSummary;
373
+ created: boolean;
374
+ updated: boolean;
297
375
  }>;
298
376
  export declare function listRailwayCustomDomains({ projectId, environmentId, serviceId, env, fetchImpl, }: {
299
377
  projectId: string;
@@ -318,6 +396,11 @@ export declare function deleteRailwayCustomDomain({ domainId, env, fetchImpl, }:
318
396
  env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
319
397
  fetchImpl?: typeof fetch;
320
398
  }): Promise<Record<string, unknown>>;
399
+ export declare function deleteRailwayService({ serviceId, env, fetchImpl, }: {
400
+ serviceId: string;
401
+ env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
402
+ fetchImpl?: typeof fetch;
403
+ }): Promise<Record<string, unknown>>;
321
404
  export declare function deleteRailwayVolume({ volumeId, env, fetchImpl, }: {
322
405
  volumeId: string;
323
406
  env?: NodeJS.ProcessEnv | Record<string, string | undefined>;