@treeseed/sdk 0.5.3 → 0.6.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 (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 +449 -136
  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 +2116 -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
@@ -8,6 +8,7 @@ export interface ProjectPlatformActionOptions {
8
8
  previewId?: string | null;
9
9
  dryRun?: boolean;
10
10
  reporter?: ControlPlaneReporter;
11
+ skipProvision?: boolean;
11
12
  }
12
13
  export declare function inferEnvironmentFromBranch(tenantRoot: string): "staging" | "prod";
13
14
  export declare function resolveScope(environment: string | null): ProjectPlatformScope;
@@ -16,86 +17,36 @@ export declare function provisionProjectPlatform(options: ProjectPlatformActionO
16
17
  scope: ProjectPlatformScope;
17
18
  target: any;
18
19
  summary: {
19
- target: any;
20
- workerName: any;
21
- siteUrl: any;
22
- accountId: any;
23
- pages: any;
24
- formGuardKv: any;
25
- sessionKv: any;
26
- siteDataDb: any;
27
- queue: any;
28
- content: any;
29
- webCache: {
30
- webHost: any;
31
- contentHost: any;
32
- rulesManaged: boolean;
33
- lastSyncedAt: any;
34
- lastError: any;
35
- policy: {
36
- sourcePages: {
37
- paths: string[];
38
- browserTtlSeconds: number;
39
- edgeTtlSeconds: number;
40
- staleWhileRevalidateSeconds: number;
41
- staleIfErrorSeconds: number;
42
- };
43
- contentPages: Required<import("../../platform/contracts.ts").TreeseedWebCachePolicyConfig>;
44
- r2PublishedObjects: Required<import("../../platform/contracts.ts").TreeseedWebCachePolicyConfig>;
45
- };
46
- deployPurge: any;
47
- contentPurge: any;
48
- };
20
+ target: import("../../reconcile/contracts.ts").TreeseedReconcileTarget;
21
+ units: import("../../reconcile/contracts.ts").TreeseedDesiredUnit[];
22
+ plans: import("../../reconcile/contracts.ts").TreeseedReconcilePlan[];
23
+ results: import("../../reconcile/contracts.ts").TreeseedReconcileResult[];
24
+ state: import("../../reconcile/contracts.ts").TreeseedReconcileStateRecord;
49
25
  };
50
26
  verification: {
51
- ok: boolean;
52
- target: any;
53
- checks: {
54
- pages: boolean;
55
- formGuardKv: boolean;
56
- sessionKv: boolean;
57
- d1: boolean;
58
- queue: boolean;
59
- dlq: boolean;
60
- r2: boolean;
61
- webCache: boolean;
62
- };
63
- state: any;
27
+ target: import("../../reconcile/contracts.ts").TreeseedReconcileTarget;
28
+ ready: boolean;
29
+ blockers: string[];
30
+ warnings: string[];
31
+ units: {
32
+ unitId: string;
33
+ unitType: import("../../reconcile/contracts.ts").TreeseedReconcileUnitType;
34
+ provider: string;
35
+ status: import("../../reconcile/contracts.ts").TreeseedReconcileStatusKind;
36
+ exists: boolean;
37
+ locators: Record<string, string | null>;
38
+ warnings: string[];
39
+ verification: import("../../reconcile/contracts.ts").TreeseedUnitVerificationResult | null;
40
+ }[];
64
41
  };
65
42
  railway: {
66
43
  services: string[];
67
- schedules: {
68
- id: any;
69
- status: string;
70
- enabled: any;
71
- command: any;
72
- service: string;
73
- projectId: string | null;
74
- projectName: string | null;
75
- serviceId: string | null;
76
- serviceName: string | null;
77
- environment: string;
78
- environmentId: string | null;
79
- expression: string;
80
- logicalName: string;
81
- }[];
44
+ schedules: any[];
82
45
  verification: {
83
46
  ok: boolean;
84
- checks: {
85
- id: any;
86
- status: string;
87
- enabled: any;
88
- command: any;
89
- service: string;
90
- projectId: string | null;
91
- projectName: string | null;
92
- serviceId: string | null;
93
- serviceName: string | null;
94
- environment: string;
95
- environmentId: string | null;
96
- expression: string;
97
- logicalName: string;
98
- }[];
47
+ checks: never[];
48
+ skipped: boolean;
49
+ reason: string;
99
50
  };
100
51
  };
101
52
  }>;
@@ -122,12 +73,21 @@ export declare function deployProjectPlatform(options: ProjectPlatformActionOpti
122
73
  skipped: boolean;
123
74
  reason: string;
124
75
  messageId?: undefined;
76
+ detail?: undefined;
77
+ attempts?: undefined;
78
+ } | {
79
+ ok: boolean;
80
+ skipped: boolean;
81
+ reason: string;
82
+ messageId: string;
83
+ detail: string;
125
84
  attempts?: undefined;
126
85
  } | {
127
86
  ok: boolean;
128
87
  reason: string;
129
88
  skipped?: undefined;
130
89
  messageId?: undefined;
90
+ detail?: undefined;
131
91
  attempts?: undefined;
132
92
  } | {
133
93
  ok: boolean;
@@ -135,6 +95,7 @@ export declare function deployProjectPlatform(options: ProjectPlatformActionOpti
135
95
  attempts: number;
136
96
  skipped?: undefined;
137
97
  reason?: undefined;
98
+ detail?: undefined;
138
99
  } | {
139
100
  ok: boolean;
140
101
  skipped: boolean;
@@ -212,20 +173,43 @@ export declare function deployProjectPlatform(options: ProjectPlatformActionOpti
212
173
  reason: string;
213
174
  };
214
175
  scaleProbe: {
176
+ ok: boolean;
177
+ skipped: boolean;
178
+ reason: string;
179
+ mocked: boolean;
180
+ serviceId: any;
181
+ serviceName?: undefined;
182
+ } | {
215
183
  ok: boolean;
216
184
  mocked: boolean;
217
185
  serviceId: any;
186
+ serviceName: any;
187
+ skipped?: undefined;
188
+ reason?: undefined;
218
189
  };
219
190
  readiness: any;
220
191
  };
221
192
  };
222
- serviceResults: {
193
+ serviceResults: ({
223
194
  service: any;
224
195
  status: string;
225
196
  command: string;
226
197
  cwd: any;
227
198
  publicBaseUrl: any;
228
- }[];
199
+ runtimeConfiguration?: undefined;
200
+ } | {
201
+ service: any;
202
+ status: string;
203
+ command: string;
204
+ cwd: any;
205
+ publicBaseUrl: any;
206
+ runtimeConfiguration: {
207
+ updated: boolean;
208
+ healthcheckPath: string | null;
209
+ healthcheckTimeoutSeconds: number | null;
210
+ runtimeMode: string | null;
211
+ } | null;
212
+ })[];
229
213
  }>;
230
214
  export declare function publishProjectContent(options: ProjectPlatformActionOptions): Promise<{
231
215
  ok: boolean;
@@ -256,12 +240,21 @@ export declare function monitorProjectPlatform(options: ProjectPlatformActionOpt
256
240
  skipped: boolean;
257
241
  reason: string;
258
242
  messageId?: undefined;
243
+ detail?: undefined;
244
+ attempts?: undefined;
245
+ } | {
246
+ ok: boolean;
247
+ skipped: boolean;
248
+ reason: string;
249
+ messageId: string;
250
+ detail: string;
259
251
  attempts?: undefined;
260
252
  } | {
261
253
  ok: boolean;
262
254
  reason: string;
263
255
  skipped?: undefined;
264
256
  messageId?: undefined;
257
+ detail?: undefined;
265
258
  attempts?: undefined;
266
259
  } | {
267
260
  ok: boolean;
@@ -269,6 +262,7 @@ export declare function monitorProjectPlatform(options: ProjectPlatformActionOpt
269
262
  attempts: number;
270
263
  skipped?: undefined;
271
264
  reason?: undefined;
265
+ detail?: undefined;
272
266
  } | {
273
267
  ok: boolean;
274
268
  skipped: boolean;
@@ -346,9 +340,19 @@ export declare function monitorProjectPlatform(options: ProjectPlatformActionOpt
346
340
  reason: string;
347
341
  };
348
342
  scaleProbe: {
343
+ ok: boolean;
344
+ skipped: boolean;
345
+ reason: string;
346
+ mocked: boolean;
347
+ serviceId: any;
348
+ serviceName?: undefined;
349
+ } | {
349
350
  ok: boolean;
350
351
  mocked: boolean;
351
352
  serviceId: any;
353
+ serviceName: any;
354
+ skipped?: undefined;
355
+ reason?: undefined;
352
356
  };
353
357
  readiness: any;
354
358
  };
@@ -367,86 +371,36 @@ export declare function runProjectPlatformAction(action: ProjectPlatformAction,
367
371
  scope: ProjectPlatformScope;
368
372
  target: any;
369
373
  summary: {
370
- target: any;
371
- workerName: any;
372
- siteUrl: any;
373
- accountId: any;
374
- pages: any;
375
- formGuardKv: any;
376
- sessionKv: any;
377
- siteDataDb: any;
378
- queue: any;
379
- content: any;
380
- webCache: {
381
- webHost: any;
382
- contentHost: any;
383
- rulesManaged: boolean;
384
- lastSyncedAt: any;
385
- lastError: any;
386
- policy: {
387
- sourcePages: {
388
- paths: string[];
389
- browserTtlSeconds: number;
390
- edgeTtlSeconds: number;
391
- staleWhileRevalidateSeconds: number;
392
- staleIfErrorSeconds: number;
393
- };
394
- contentPages: Required<import("../../platform/contracts.ts").TreeseedWebCachePolicyConfig>;
395
- r2PublishedObjects: Required<import("../../platform/contracts.ts").TreeseedWebCachePolicyConfig>;
396
- };
397
- deployPurge: any;
398
- contentPurge: any;
399
- };
374
+ target: import("../../reconcile/contracts.ts").TreeseedReconcileTarget;
375
+ units: import("../../reconcile/contracts.ts").TreeseedDesiredUnit[];
376
+ plans: import("../../reconcile/contracts.ts").TreeseedReconcilePlan[];
377
+ results: import("../../reconcile/contracts.ts").TreeseedReconcileResult[];
378
+ state: import("../../reconcile/contracts.ts").TreeseedReconcileStateRecord;
400
379
  };
401
380
  verification: {
402
- ok: boolean;
403
- target: any;
404
- checks: {
405
- pages: boolean;
406
- formGuardKv: boolean;
407
- sessionKv: boolean;
408
- d1: boolean;
409
- queue: boolean;
410
- dlq: boolean;
411
- r2: boolean;
412
- webCache: boolean;
413
- };
414
- state: any;
381
+ target: import("../../reconcile/contracts.ts").TreeseedReconcileTarget;
382
+ ready: boolean;
383
+ blockers: string[];
384
+ warnings: string[];
385
+ units: {
386
+ unitId: string;
387
+ unitType: import("../../reconcile/contracts.ts").TreeseedReconcileUnitType;
388
+ provider: string;
389
+ status: import("../../reconcile/contracts.ts").TreeseedReconcileStatusKind;
390
+ exists: boolean;
391
+ locators: Record<string, string | null>;
392
+ warnings: string[];
393
+ verification: import("../../reconcile/contracts.ts").TreeseedUnitVerificationResult | null;
394
+ }[];
415
395
  };
416
396
  railway: {
417
397
  services: string[];
418
- schedules: {
419
- id: any;
420
- status: string;
421
- enabled: any;
422
- command: any;
423
- service: string;
424
- projectId: string | null;
425
- projectName: string | null;
426
- serviceId: string | null;
427
- serviceName: string | null;
428
- environment: string;
429
- environmentId: string | null;
430
- expression: string;
431
- logicalName: string;
432
- }[];
398
+ schedules: any[];
433
399
  verification: {
434
400
  ok: boolean;
435
- checks: {
436
- id: any;
437
- status: string;
438
- enabled: any;
439
- command: any;
440
- service: string;
441
- projectId: string | null;
442
- projectName: string | null;
443
- serviceId: string | null;
444
- serviceName: string | null;
445
- environment: string;
446
- environmentId: string | null;
447
- expression: string;
448
- logicalName: string;
449
- }[];
401
+ checks: never[];
402
+ skipped: boolean;
403
+ reason: string;
450
404
  };
451
405
  };
452
406
  } | {
@@ -469,12 +423,21 @@ export declare function runProjectPlatformAction(action: ProjectPlatformAction,
469
423
  skipped: boolean;
470
424
  reason: string;
471
425
  messageId?: undefined;
426
+ detail?: undefined;
427
+ attempts?: undefined;
428
+ } | {
429
+ ok: boolean;
430
+ skipped: boolean;
431
+ reason: string;
432
+ messageId: string;
433
+ detail: string;
472
434
  attempts?: undefined;
473
435
  } | {
474
436
  ok: boolean;
475
437
  reason: string;
476
438
  skipped?: undefined;
477
439
  messageId?: undefined;
440
+ detail?: undefined;
478
441
  attempts?: undefined;
479
442
  } | {
480
443
  ok: boolean;
@@ -482,6 +445,7 @@ export declare function runProjectPlatformAction(action: ProjectPlatformAction,
482
445
  attempts: number;
483
446
  skipped?: undefined;
484
447
  reason?: undefined;
448
+ detail?: undefined;
485
449
  } | {
486
450
  ok: boolean;
487
451
  skipped: boolean;
@@ -559,9 +523,19 @@ export declare function runProjectPlatformAction(action: ProjectPlatformAction,
559
523
  reason: string;
560
524
  };
561
525
  scaleProbe: {
526
+ ok: boolean;
527
+ skipped: boolean;
528
+ reason: string;
529
+ mocked: boolean;
530
+ serviceId: any;
531
+ serviceName?: undefined;
532
+ } | {
562
533
  ok: boolean;
563
534
  mocked: boolean;
564
535
  serviceId: any;
536
+ serviceName: any;
537
+ skipped?: undefined;
538
+ reason?: undefined;
565
539
  };
566
540
  readiness: any;
567
541
  };
@@ -588,12 +562,21 @@ export declare function runProjectPlatformAction(action: ProjectPlatformAction,
588
562
  skipped: boolean;
589
563
  reason: string;
590
564
  messageId?: undefined;
565
+ detail?: undefined;
566
+ attempts?: undefined;
567
+ } | {
568
+ ok: boolean;
569
+ skipped: boolean;
570
+ reason: string;
571
+ messageId: string;
572
+ detail: string;
591
573
  attempts?: undefined;
592
574
  } | {
593
575
  ok: boolean;
594
576
  reason: string;
595
577
  skipped?: undefined;
596
578
  messageId?: undefined;
579
+ detail?: undefined;
597
580
  attempts?: undefined;
598
581
  } | {
599
582
  ok: boolean;
@@ -601,6 +584,7 @@ export declare function runProjectPlatformAction(action: ProjectPlatformAction,
601
584
  attempts: number;
602
585
  skipped?: undefined;
603
586
  reason?: undefined;
587
+ detail?: undefined;
604
588
  } | {
605
589
  ok: boolean;
606
590
  skipped: boolean;
@@ -679,17 +663,40 @@ export declare function runProjectPlatformAction(action: ProjectPlatformAction,
679
663
  };
680
664
  scaleProbe: {
681
665
  ok: boolean;
666
+ skipped: boolean;
667
+ reason: string;
682
668
  mocked: boolean;
683
669
  serviceId: any;
670
+ serviceName?: undefined;
671
+ } | {
672
+ ok: boolean;
673
+ mocked: boolean;
674
+ serviceId: any;
675
+ serviceName: any;
676
+ skipped?: undefined;
677
+ reason?: undefined;
684
678
  };
685
679
  readiness: any;
686
680
  };
687
681
  };
688
- serviceResults: {
682
+ serviceResults: ({
683
+ service: any;
684
+ status: string;
685
+ command: string;
686
+ cwd: any;
687
+ publicBaseUrl: any;
688
+ runtimeConfiguration?: undefined;
689
+ } | {
689
690
  service: any;
690
691
  status: string;
691
692
  command: string;
692
693
  cwd: any;
693
694
  publicBaseUrl: any;
694
- }[];
695
+ runtimeConfiguration: {
696
+ updated: boolean;
697
+ healthcheckPath: string | null;
698
+ healthcheckTimeoutSeconds: number | null;
699
+ runtimeMode: string | null;
700
+ } | null;
701
+ })[];
695
702
  }>;