@treeseed/sdk 0.5.2 → 0.6.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 (66) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +46 -0
  3. package/dist/operations/providers/default.js +1 -1
  4. package/dist/operations/services/config-runtime.d.ts +49 -42
  5. package/dist/operations/services/config-runtime.js +465 -142
  6. package/dist/operations/services/deploy.d.ts +298 -0
  7. package/dist/operations/services/deploy.js +381 -137
  8. package/dist/operations/services/git-workflow.d.ts +9 -0
  9. package/dist/operations/services/git-workflow.js +32 -0
  10. package/dist/operations/services/github-api.d.ts +115 -0
  11. package/dist/operations/services/github-api.js +455 -0
  12. package/dist/operations/services/github-automation.d.ts +19 -33
  13. package/dist/operations/services/github-automation.js +44 -131
  14. package/dist/operations/services/key-agent.d.ts +20 -1
  15. package/dist/operations/services/key-agent.js +267 -102
  16. package/dist/operations/services/knowledge-coop-launch.d.ts +2 -3
  17. package/dist/operations/services/knowledge-coop-launch.js +26 -12
  18. package/dist/operations/services/project-platform.d.ts +157 -150
  19. package/dist/operations/services/project-platform.js +129 -26
  20. package/dist/operations/services/railway-api.d.ts +244 -0
  21. package/dist/operations/services/railway-api.js +882 -0
  22. package/dist/operations/services/railway-deploy.d.ts +171 -27
  23. package/dist/operations/services/railway-deploy.js +672 -172
  24. package/dist/operations/services/runtime-tools.d.ts +18 -0
  25. package/dist/operations/services/runtime-tools.js +19 -6
  26. package/dist/operations/services/workspace-preflight.js +2 -2
  27. package/dist/platform/contracts.d.ts +7 -0
  28. package/dist/platform/deploy-config.js +23 -0
  29. package/dist/platform/deploy-runtime.d.ts +1 -0
  30. package/dist/platform/deploy-runtime.js +7 -9
  31. package/dist/platform/env.yaml +10 -9
  32. package/dist/platform/environment.js +4 -0
  33. package/dist/platform/plugin.d.ts +6 -0
  34. package/dist/platform/plugins/constants.d.ts +1 -0
  35. package/dist/platform/plugins/constants.js +1 -0
  36. package/dist/platform/plugins/runtime.d.ts +4 -0
  37. package/dist/platform/plugins/runtime.js +8 -1
  38. package/dist/platform/published-content.js +27 -4
  39. package/dist/platform/tenant/runtime-config.js +33 -24
  40. package/dist/plugin-default.d.ts +1 -0
  41. package/dist/plugin-default.js +1 -0
  42. package/dist/reconcile/builtin-adapters.d.ts +3 -0
  43. package/dist/reconcile/builtin-adapters.js +2093 -0
  44. package/dist/reconcile/contracts.d.ts +155 -0
  45. package/dist/reconcile/contracts.js +0 -0
  46. package/dist/reconcile/desired-state.d.ts +179 -0
  47. package/dist/reconcile/desired-state.js +319 -0
  48. package/dist/reconcile/engine.d.ts +405 -0
  49. package/dist/reconcile/engine.js +356 -0
  50. package/dist/reconcile/errors.d.ts +5 -0
  51. package/dist/reconcile/errors.js +13 -0
  52. package/dist/reconcile/index.d.ts +7 -0
  53. package/dist/reconcile/index.js +7 -0
  54. package/dist/reconcile/registry.d.ts +7 -0
  55. package/dist/reconcile/registry.js +64 -0
  56. package/dist/reconcile/state.d.ts +7 -0
  57. package/dist/reconcile/state.js +303 -0
  58. package/dist/reconcile/units.d.ts +6 -0
  59. package/dist/reconcile/units.js +68 -0
  60. package/dist/scripts/config-treeseed.js +27 -19
  61. package/dist/scripts/tenant-deploy.js +35 -14
  62. package/dist/workflow/operations.js +127 -22
  63. package/dist/workflow-support.d.ts +3 -1
  64. package/dist/workflow-support.js +50 -0
  65. package/dist/workflow.d.ts +2 -0
  66. package/package.json +7 -1
@@ -0,0 +1,405 @@
1
+ import type { TreeseedObservedUnitState, TreeseedReconcilePlan, TreeseedReconcileResult, TreeseedReconcileStateRecord, TreeseedReconcileTarget, TreeseedUnitVerificationResult } from './contracts.ts';
2
+ export declare function observeTreeseedUnits({ tenantRoot, target, env, write, }: {
3
+ tenantRoot: string;
4
+ target: TreeseedReconcileTarget;
5
+ env?: NodeJS.ProcessEnv;
6
+ write?: (line: string) => void;
7
+ }): Promise<{
8
+ units: import("./contracts.ts").TreeseedDesiredUnit[];
9
+ observations: Map<string, TreeseedObservedUnitState>;
10
+ state: TreeseedReconcileStateRecord;
11
+ deployConfig: {
12
+ name: string;
13
+ slug: string;
14
+ siteUrl: string;
15
+ contactEmail: string;
16
+ hosting: {
17
+ kind: string;
18
+ registration: any;
19
+ marketBaseUrl: any;
20
+ teamId: any;
21
+ projectId: any;
22
+ };
23
+ hub: {
24
+ mode: string;
25
+ };
26
+ runtime: {
27
+ mode: string;
28
+ registration: any;
29
+ marketBaseUrl: any;
30
+ teamId: any;
31
+ projectId: any;
32
+ };
33
+ cloudflare: {
34
+ accountId: string;
35
+ zoneId: string | undefined;
36
+ workerName: string | undefined;
37
+ queueName: string | undefined;
38
+ dlqName: string | undefined;
39
+ d1Binding: string | undefined;
40
+ queueBinding: string | undefined;
41
+ pages: {
42
+ projectName: string | undefined;
43
+ previewProjectName: string | undefined;
44
+ productionBranch: string;
45
+ stagingBranch: string;
46
+ buildOutputDir: string | undefined;
47
+ } | undefined;
48
+ r2: {
49
+ binding: string | undefined;
50
+ bucketName: string | undefined;
51
+ publicBaseUrl: string | undefined;
52
+ manifestKeyTemplate: string;
53
+ previewRootTemplate: string;
54
+ previewTtlHours: number;
55
+ } | undefined;
56
+ };
57
+ plugins: {
58
+ package: string;
59
+ enabled: boolean;
60
+ }[] | {
61
+ package: string;
62
+ enabled: boolean | undefined;
63
+ config: any;
64
+ }[];
65
+ providers: {
66
+ forms: string;
67
+ agents: {
68
+ execution: string;
69
+ mutation: string;
70
+ repository: string;
71
+ verification: string;
72
+ notification: string;
73
+ research: string;
74
+ };
75
+ deploy: string;
76
+ dns: string;
77
+ content: {
78
+ runtime: string;
79
+ publish: string;
80
+ docs: string;
81
+ serving: any;
82
+ };
83
+ site: string;
84
+ };
85
+ surfaces: {
86
+ [k: string]: {
87
+ enabled: boolean | undefined;
88
+ provider: string | undefined;
89
+ rootDir: string | undefined;
90
+ publicBaseUrl: string | undefined;
91
+ localBaseUrl: string | undefined;
92
+ environments: {
93
+ local: {
94
+ baseUrl: string | undefined;
95
+ domain: string | undefined;
96
+ railwayEnvironment: string | undefined;
97
+ };
98
+ staging: {
99
+ baseUrl: string | undefined;
100
+ domain: string | undefined;
101
+ railwayEnvironment: string | undefined;
102
+ };
103
+ prod: {
104
+ baseUrl: string | undefined;
105
+ domain: string | undefined;
106
+ railwayEnvironment: string | undefined;
107
+ };
108
+ } | undefined;
109
+ cache: {
110
+ sourcePages: {
111
+ browserTtlSeconds: number | undefined;
112
+ edgeTtlSeconds: number | undefined;
113
+ staleWhileRevalidateSeconds: number | undefined;
114
+ staleIfErrorSeconds: number | undefined;
115
+ } | {
116
+ paths: any[];
117
+ } | undefined;
118
+ contentPages: {
119
+ browserTtlSeconds: number | undefined;
120
+ edgeTtlSeconds: number | undefined;
121
+ staleWhileRevalidateSeconds: number | undefined;
122
+ staleIfErrorSeconds: number | undefined;
123
+ } | {
124
+ paths: any[];
125
+ } | undefined;
126
+ r2PublishedObjects: {
127
+ browserTtlSeconds: number | undefined;
128
+ edgeTtlSeconds: number | undefined;
129
+ staleWhileRevalidateSeconds: number | undefined;
130
+ staleIfErrorSeconds: number | undefined;
131
+ } | {
132
+ paths: any[];
133
+ } | undefined;
134
+ } | undefined;
135
+ } | undefined;
136
+ } | undefined;
137
+ services: {
138
+ [k: string]: {
139
+ enabled: boolean | undefined;
140
+ provider: string | undefined;
141
+ rootDir: string | undefined;
142
+ publicBaseUrl: string | undefined;
143
+ cloudflare: {
144
+ workerName: string | undefined;
145
+ };
146
+ railway: {
147
+ projectId: string | undefined;
148
+ projectName: string | undefined;
149
+ serviceId: string | undefined;
150
+ serviceName: string | undefined;
151
+ rootDir: string | undefined;
152
+ buildCommand: string | undefined;
153
+ startCommand: string | undefined;
154
+ schedule: any;
155
+ };
156
+ environments: {
157
+ local: {
158
+ baseUrl: string | undefined;
159
+ domain: string | undefined;
160
+ railwayEnvironment: string | undefined;
161
+ };
162
+ staging: {
163
+ baseUrl: string | undefined;
164
+ domain: string | undefined;
165
+ railwayEnvironment: string | undefined;
166
+ };
167
+ prod: {
168
+ baseUrl: string | undefined;
169
+ domain: string | undefined;
170
+ railwayEnvironment: string | undefined;
171
+ };
172
+ };
173
+ } | undefined;
174
+ } | undefined;
175
+ smtp: {
176
+ enabled: boolean | undefined;
177
+ };
178
+ turnstile: {
179
+ enabled: boolean;
180
+ };
181
+ };
182
+ }>;
183
+ export declare function planTreeseedReconciliation({ tenantRoot, target, env, write, }: {
184
+ tenantRoot: string;
185
+ target: TreeseedReconcileTarget;
186
+ env?: NodeJS.ProcessEnv;
187
+ write?: (line: string) => void;
188
+ }): Promise<{
189
+ plans: TreeseedReconcilePlan[];
190
+ units: import("./contracts.ts").TreeseedDesiredUnit[];
191
+ observations: Map<string, TreeseedObservedUnitState>;
192
+ state: TreeseedReconcileStateRecord;
193
+ deployConfig: {
194
+ name: string;
195
+ slug: string;
196
+ siteUrl: string;
197
+ contactEmail: string;
198
+ hosting: {
199
+ kind: string;
200
+ registration: any;
201
+ marketBaseUrl: any;
202
+ teamId: any;
203
+ projectId: any;
204
+ };
205
+ hub: {
206
+ mode: string;
207
+ };
208
+ runtime: {
209
+ mode: string;
210
+ registration: any;
211
+ marketBaseUrl: any;
212
+ teamId: any;
213
+ projectId: any;
214
+ };
215
+ cloudflare: {
216
+ accountId: string;
217
+ zoneId: string | undefined;
218
+ workerName: string | undefined;
219
+ queueName: string | undefined;
220
+ dlqName: string | undefined;
221
+ d1Binding: string | undefined;
222
+ queueBinding: string | undefined;
223
+ pages: {
224
+ projectName: string | undefined;
225
+ previewProjectName: string | undefined;
226
+ productionBranch: string;
227
+ stagingBranch: string;
228
+ buildOutputDir: string | undefined;
229
+ } | undefined;
230
+ r2: {
231
+ binding: string | undefined;
232
+ bucketName: string | undefined;
233
+ publicBaseUrl: string | undefined;
234
+ manifestKeyTemplate: string;
235
+ previewRootTemplate: string;
236
+ previewTtlHours: number;
237
+ } | undefined;
238
+ };
239
+ plugins: {
240
+ package: string;
241
+ enabled: boolean;
242
+ }[] | {
243
+ package: string;
244
+ enabled: boolean | undefined;
245
+ config: any;
246
+ }[];
247
+ providers: {
248
+ forms: string;
249
+ agents: {
250
+ execution: string;
251
+ mutation: string;
252
+ repository: string;
253
+ verification: string;
254
+ notification: string;
255
+ research: string;
256
+ };
257
+ deploy: string;
258
+ dns: string;
259
+ content: {
260
+ runtime: string;
261
+ publish: string;
262
+ docs: string;
263
+ serving: any;
264
+ };
265
+ site: string;
266
+ };
267
+ surfaces: {
268
+ [k: string]: {
269
+ enabled: boolean | undefined;
270
+ provider: string | undefined;
271
+ rootDir: string | undefined;
272
+ publicBaseUrl: string | undefined;
273
+ localBaseUrl: string | undefined;
274
+ environments: {
275
+ local: {
276
+ baseUrl: string | undefined;
277
+ domain: string | undefined;
278
+ railwayEnvironment: string | undefined;
279
+ };
280
+ staging: {
281
+ baseUrl: string | undefined;
282
+ domain: string | undefined;
283
+ railwayEnvironment: string | undefined;
284
+ };
285
+ prod: {
286
+ baseUrl: string | undefined;
287
+ domain: string | undefined;
288
+ railwayEnvironment: string | undefined;
289
+ };
290
+ } | undefined;
291
+ cache: {
292
+ sourcePages: {
293
+ browserTtlSeconds: number | undefined;
294
+ edgeTtlSeconds: number | undefined;
295
+ staleWhileRevalidateSeconds: number | undefined;
296
+ staleIfErrorSeconds: number | undefined;
297
+ } | {
298
+ paths: any[];
299
+ } | undefined;
300
+ contentPages: {
301
+ browserTtlSeconds: number | undefined;
302
+ edgeTtlSeconds: number | undefined;
303
+ staleWhileRevalidateSeconds: number | undefined;
304
+ staleIfErrorSeconds: number | undefined;
305
+ } | {
306
+ paths: any[];
307
+ } | undefined;
308
+ r2PublishedObjects: {
309
+ browserTtlSeconds: number | undefined;
310
+ edgeTtlSeconds: number | undefined;
311
+ staleWhileRevalidateSeconds: number | undefined;
312
+ staleIfErrorSeconds: number | undefined;
313
+ } | {
314
+ paths: any[];
315
+ } | undefined;
316
+ } | undefined;
317
+ } | undefined;
318
+ } | undefined;
319
+ services: {
320
+ [k: string]: {
321
+ enabled: boolean | undefined;
322
+ provider: string | undefined;
323
+ rootDir: string | undefined;
324
+ publicBaseUrl: string | undefined;
325
+ cloudflare: {
326
+ workerName: string | undefined;
327
+ };
328
+ railway: {
329
+ projectId: string | undefined;
330
+ projectName: string | undefined;
331
+ serviceId: string | undefined;
332
+ serviceName: string | undefined;
333
+ rootDir: string | undefined;
334
+ buildCommand: string | undefined;
335
+ startCommand: string | undefined;
336
+ schedule: any;
337
+ };
338
+ environments: {
339
+ local: {
340
+ baseUrl: string | undefined;
341
+ domain: string | undefined;
342
+ railwayEnvironment: string | undefined;
343
+ };
344
+ staging: {
345
+ baseUrl: string | undefined;
346
+ domain: string | undefined;
347
+ railwayEnvironment: string | undefined;
348
+ };
349
+ prod: {
350
+ baseUrl: string | undefined;
351
+ domain: string | undefined;
352
+ railwayEnvironment: string | undefined;
353
+ };
354
+ };
355
+ } | undefined;
356
+ } | undefined;
357
+ smtp: {
358
+ enabled: boolean | undefined;
359
+ };
360
+ turnstile: {
361
+ enabled: boolean;
362
+ };
363
+ };
364
+ }>;
365
+ export declare function reconcileTreeseedTarget({ tenantRoot, target, env, write, }: {
366
+ tenantRoot: string;
367
+ target: TreeseedReconcileTarget;
368
+ env?: NodeJS.ProcessEnv;
369
+ write?: (line: string) => void;
370
+ }): Promise<{
371
+ target: TreeseedReconcileTarget;
372
+ units: import("./contracts.ts").TreeseedDesiredUnit[];
373
+ plans: TreeseedReconcilePlan[];
374
+ results: TreeseedReconcileResult[];
375
+ state: TreeseedReconcileStateRecord;
376
+ }>;
377
+ export declare function destroyTreeseedTargetUnits({ tenantRoot, target, env, write, }: {
378
+ tenantRoot: string;
379
+ target: TreeseedReconcileTarget;
380
+ env?: NodeJS.ProcessEnv;
381
+ write?: (line: string) => void;
382
+ }): Promise<{
383
+ target: TreeseedReconcileTarget;
384
+ results: TreeseedReconcileResult[];
385
+ }>;
386
+ export declare function collectTreeseedReconcileStatus({ tenantRoot, target, env, }: {
387
+ tenantRoot: string;
388
+ target: TreeseedReconcileTarget;
389
+ env?: NodeJS.ProcessEnv;
390
+ }): Promise<{
391
+ target: TreeseedReconcileTarget;
392
+ ready: boolean;
393
+ blockers: string[];
394
+ warnings: string[];
395
+ units: {
396
+ unitId: string;
397
+ unitType: import("./contracts.ts").TreeseedReconcileUnitType;
398
+ provider: string;
399
+ status: import("./contracts.ts").TreeseedReconcileStatusKind;
400
+ exists: boolean;
401
+ locators: Record<string, string | null>;
402
+ warnings: string[];
403
+ verification: TreeseedUnitVerificationResult | null;
404
+ }[];
405
+ }>;