@treeseed/sdk 0.4.12 → 0.5.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 (98) hide show
  1. package/dist/control-plane-client.d.ts +60 -1
  2. package/dist/control-plane-client.js +59 -0
  3. package/dist/control-plane.d.ts +1 -1
  4. package/dist/control-plane.js +11 -4
  5. package/dist/d1-store.d.ts +58 -0
  6. package/dist/d1-store.js +64 -0
  7. package/dist/dispatch.js +6 -0
  8. package/dist/graph/schema.js +4 -0
  9. package/dist/index.d.ts +5 -1
  10. package/dist/index.js +32 -0
  11. package/dist/knowledge-coop.d.ts +223 -0
  12. package/dist/knowledge-coop.js +82 -0
  13. package/dist/model-registry.js +79 -0
  14. package/dist/operations/providers/default.js +128 -7
  15. package/dist/operations/services/config-runtime.d.ts +102 -24
  16. package/dist/operations/services/config-runtime.js +896 -160
  17. package/dist/operations/services/deploy.d.ts +223 -15
  18. package/dist/operations/services/deploy.js +626 -55
  19. package/dist/operations/services/git-workflow.d.ts +47 -3
  20. package/dist/operations/services/git-workflow.js +125 -19
  21. package/dist/operations/services/github-automation.d.ts +85 -0
  22. package/dist/operations/services/github-automation.js +220 -1
  23. package/dist/operations/services/key-agent.d.ts +118 -0
  24. package/dist/operations/services/key-agent.js +476 -0
  25. package/dist/operations/services/knowledge-coop-launch.d.ts +90 -0
  26. package/dist/operations/services/knowledge-coop-launch.js +753 -0
  27. package/dist/operations/services/knowledge-coop-packaging.d.ts +59 -0
  28. package/dist/operations/services/knowledge-coop-packaging.js +234 -0
  29. package/dist/operations/services/local-dev.d.ts +0 -1
  30. package/dist/operations/services/local-dev.js +1 -14
  31. package/dist/operations/services/project-platform.d.ts +42 -182
  32. package/dist/operations/services/project-platform.js +162 -59
  33. package/dist/operations/services/railway-deploy.d.ts +1 -0
  34. package/dist/operations/services/railway-deploy.js +31 -13
  35. package/dist/operations/services/runtime-tools.d.ts +52 -5
  36. package/dist/operations/services/runtime-tools.js +186 -26
  37. package/dist/operations/services/watch-dev.js +2 -4
  38. package/dist/operations/services/workspace-preflight.d.ts +4 -4
  39. package/dist/operations/services/workspace-preflight.js +22 -20
  40. package/dist/operations/services/workspace-save.d.ts +10 -1
  41. package/dist/operations/services/workspace-save.js +54 -3
  42. package/dist/operations/services/workspace-tools.d.ts +1 -0
  43. package/dist/operations/services/workspace-tools.js +20 -5
  44. package/dist/operations-registry.js +15 -8
  45. package/dist/operations-types.d.ts +2 -2
  46. package/dist/platform/contracts.d.ts +39 -3
  47. package/dist/platform/deploy-config.d.ts +12 -1
  48. package/dist/platform/deploy-config.js +214 -15
  49. package/dist/platform/deploy-runtime.d.ts +1 -0
  50. package/dist/platform/deploy-runtime.js +10 -2
  51. package/dist/platform/env.yaml +93 -61
  52. package/dist/platform/environment.d.ts +13 -2
  53. package/dist/platform/environment.js +90 -20
  54. package/dist/platform/plugins/constants.d.ts +1 -0
  55. package/dist/platform/plugins/constants.js +7 -6
  56. package/dist/platform/tenant/runtime-config.js +8 -1
  57. package/dist/platform/tenant-config.js +4 -0
  58. package/dist/platform/utils/site-config-schema.js +18 -0
  59. package/dist/plugin-default.js +2 -2
  60. package/dist/scripts/key-agent.js +165 -0
  61. package/dist/scripts/tenant-build.js +4 -1
  62. package/dist/scripts/tenant-check.js +4 -1
  63. package/dist/scripts/tenant-deploy.js +43 -4
  64. package/dist/scripts/tenant-dev.js +0 -1
  65. package/dist/scripts/workspace-start-warning.js +2 -2
  66. package/dist/sdk-types.d.ts +2 -2
  67. package/dist/sdk-types.js +2 -0
  68. package/dist/sdk.d.ts +13 -0
  69. package/dist/sdk.js +40 -0
  70. package/dist/stores/knowledge-coop-store.d.ts +56 -0
  71. package/dist/stores/knowledge-coop-store.js +482 -0
  72. package/dist/treeseed/template-catalog/templates/starter-basic/template/package.json +6 -2
  73. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/api/server.js +4 -0
  74. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/config.yaml +25 -0
  75. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/decisions/adopt-initial-proposal-loop.mdx +22 -0
  76. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/people/starter-steward.mdx +11 -0
  77. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/proposals/establish-initial-proposal-loop.mdx +17 -0
  78. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/manifest.yaml +17 -10
  79. package/dist/treeseed/template-catalog/templates/starter-basic/template/treeseed.site.yaml +69 -7
  80. package/dist/treeseed/template-catalog/templates/starter-basic/template.config.json +1 -0
  81. package/dist/workflow/operations.d.ts +592 -243
  82. package/dist/workflow/operations.js +1908 -219
  83. package/dist/workflow/runs.d.ts +90 -0
  84. package/dist/workflow/runs.js +242 -0
  85. package/dist/workflow/session.d.ts +31 -0
  86. package/dist/workflow/session.js +97 -0
  87. package/dist/workflow-state.d.ts +88 -2
  88. package/dist/workflow-state.js +288 -26
  89. package/dist/workflow-support.d.ts +1 -1
  90. package/dist/workflow-support.js +32 -2
  91. package/dist/workflow.d.ts +93 -3
  92. package/dist/workflow.js +12 -0
  93. package/package.json +1 -1
  94. package/templates/github/deploy.workflow.yml +11 -1
  95. package/dist/scripts/sync-dev-vars.js +0 -6
  96. package/dist/scripts/workspace-close.js +0 -24
  97. package/dist/scripts/workspace-release.js +0 -42
  98. package/dist/scripts/workspace-start.js +0 -71
@@ -1,9 +1,10 @@
1
- import { checkTreeseedProviderConnections } from '../operations/services/config-runtime.ts';
2
1
  import { resolveTreeseedWorkflowState } from '../workflow-state.ts';
3
- import type { TreeseedCloseInput, TreeseedConfigInput, TreeseedDestroyInput, TreeseedExportInput, TreeseedReleaseInput, TreeseedSaveInput, TreeseedStageInput, TreeseedSwitchInput, TreeseedTaskBranchMetadata, TreeseedWorkflowContext, TreeseedWorkflowDevInput, TreeseedWorkflowNextStep, TreeseedWorkflowOperationId, TreeseedWorkflowResult } from '../workflow.ts';
2
+ import { type TreeseedWorkflowRunCommand, type TreeseedWorkflowRunJournal } from './runs.ts';
3
+ import { type TreeseedWorkflowMode } from './session.ts';
4
+ import type { TreeseedCloseInput, TreeseedConfigInput, TreeseedDestroyInput, TreeseedExportInput, TreeseedReleaseInput, TreeseedRecoverInput, TreeseedResumeInput, TreeseedSaveInput, TreeseedStageInput, TreeseedSwitchInput, TreeseedTaskBranchMetadata, TreeseedWorkflowContext, TreeseedWorkflowDevInput, TreeseedWorkflowOperationId, TreeseedWorkflowResult } from '../workflow.ts';
4
5
  type WorkflowWrite = NonNullable<TreeseedWorkflowContext['write']>;
5
6
  type WorkflowStatePayload = ReturnType<typeof resolveTreeseedWorkflowState>;
6
- export type TreeseedWorkflowErrorCode = 'validation_failed' | 'merge_conflict' | 'missing_runtime_auth' | 'deployment_timeout' | 'confirmation_required' | 'unsupported_transport' | 'unsupported_state';
7
+ export type TreeseedWorkflowErrorCode = 'validation_failed' | 'merge_conflict' | 'missing_runtime_auth' | 'deployment_timeout' | 'confirmation_required' | 'unsupported_transport' | 'unsupported_state' | 'workflow_locked' | 'resume_unavailable' | 'workflow_contract_missing';
7
8
  export declare class TreeseedWorkflowError extends Error {
8
9
  code: TreeseedWorkflowErrorCode;
9
10
  operation: TreeseedWorkflowOperationId;
@@ -23,17 +24,52 @@ export type WorkflowOperationHelpers = {
23
24
  tasks: TreeseedTaskBranchMetadata[];
24
25
  }>>;
25
26
  };
27
+ type WorkflowRepoReport = {
28
+ name: string;
29
+ path: string;
30
+ branch: string | null;
31
+ dirty: boolean;
32
+ created: boolean;
33
+ resumed: boolean;
34
+ merged: boolean;
35
+ verified: boolean;
36
+ committed: boolean;
37
+ pushed: boolean;
38
+ deletedLocal: boolean;
39
+ deletedRemote: boolean;
40
+ tagName: string | null;
41
+ commitSha: string | null;
42
+ skippedReason: string | null;
43
+ publishWait: Record<string, unknown> | null;
44
+ };
26
45
  export declare function workflowStatus(helpers: WorkflowOperationHelpers): Promise<TreeseedWorkflowResult<import("../workflow-state.ts").TreeseedWorkflowState>>;
27
46
  export declare function workflowTasks(helpers: WorkflowOperationHelpers): Promise<TreeseedWorkflowResult<{
28
47
  tasks: TreeseedTaskBranchMetadata[];
48
+ workstreams: Array<{
49
+ id: string;
50
+ title: string;
51
+ linkedDirectRefs: Array<{
52
+ model: "objective" | "question" | "note";
53
+ id: string;
54
+ }>;
55
+ branch: string;
56
+ local: boolean;
57
+ remote: boolean;
58
+ current: boolean;
59
+ previewUrl: string | null;
60
+ lastSaveAt: string | null;
61
+ verificationResult: "ready" | "needs_attention" | "unknown";
62
+ stagingCandidate: boolean;
63
+ archived: boolean;
64
+ }>;
29
65
  }>>;
30
66
  export declare function workflowConfig(helpers: WorkflowOperationHelpers, input?: TreeseedConfigInput): Promise<TreeseedWorkflowResult<{
31
67
  mode: string;
32
68
  scopes: ("local" | "staging" | "prod")[];
33
- sync: "none" | "cloudflare" | "railway" | "github" | "all";
69
+ sync: "none" | "cloudflare" | "railway" | "github" | "all" | undefined;
34
70
  configPath: string;
35
71
  keyPath: string;
36
- repairs: import("../operations/services/config-runtime.ts").TreeseedRepairAction[];
72
+ repairs: unknown[];
37
73
  preflight: {
38
74
  ok: boolean;
39
75
  requireAuth: boolean;
@@ -65,37 +101,29 @@ export declare function workflowConfig(helpers: WorkflowOperationHelpers, input?
65
101
  available: any;
66
102
  detail: any;
67
103
  };
104
+ wranglerCli: {
105
+ name: any;
106
+ available: any;
107
+ detail: any;
108
+ };
109
+ railwayCli: {
110
+ name: any;
111
+ available: any;
112
+ detail: any;
113
+ };
68
114
  actVerificationReady: any;
69
115
  remediation: string[];
70
116
  };
71
- context: import("../operations/services/config-runtime.ts").TreeseedCollectedConfigContext;
72
- result: {
73
- scopes: ("local" | "staging" | "prod")[];
74
- synced: Record<string, unknown>;
75
- initialized: Array<{
76
- scope: import("../operations/services/config-runtime.ts").TreeseedConfigScope;
77
- secrets: number;
78
- target: string;
79
- }>;
80
- connectionChecks: ReturnType<typeof checkTreeseedProviderConnections>[];
81
- validationByScope: Record<import("../operations/services/config-runtime.ts").TreeseedConfigScope, ReturnType<typeof import("../platform/environment.ts").validateTreeseedEnvironmentValues>>;
82
- readinessByScope: Record<import("../operations/services/config-runtime.ts").TreeseedConfigScope, {
83
- configured: boolean;
84
- provisioned: boolean;
85
- deployable: boolean;
86
- checks: Record<string, unknown>;
87
- }>;
88
- updated: {
89
- scope: import("../operations/services/config-runtime.ts").TreeseedConfigScope | "shared";
90
- id: string;
91
- reused: boolean;
92
- cleared: boolean;
93
- }[];
94
- envFiles: {
95
- envLocalPath: string;
96
- devVarsPath: string;
97
- } | null;
98
- };
117
+ market: any;
118
+ connection: import("../sdk-types.ts").ProjectConnection | null;
119
+ runnerTokenIssued: boolean;
120
+ } & {
121
+ finalState?: WorkflowStatePayload;
122
+ }> | TreeseedWorkflowResult<{
123
+ mode: string;
124
+ scopes: ("local" | "staging" | "prod")[];
125
+ sync: "none" | "cloudflare" | "railway" | "github" | "all";
126
+ secretsRevealed: boolean;
99
127
  reports: {
100
128
  scope: "local" | "staging" | "prod";
101
129
  environment: {
@@ -111,146 +139,136 @@ export declare function workflowConfig(helpers: WorkflowOperationHelpers, input?
111
139
  ready: any;
112
140
  detail: any;
113
141
  }[];
142
+ issues: any[];
114
143
  };
115
144
  }[];
116
- state: import("../workflow-state.ts").TreeseedWorkflowState;
117
- readiness: {
118
- local: {
119
- ready: boolean;
120
- blockers: string[];
121
- warnings: string[];
145
+ repairs: import("../operations/services/config-runtime.ts").TreeseedRepairAction[];
146
+ preflight: {
147
+ ok: boolean;
148
+ requireAuth: boolean;
149
+ missingCommands: string[];
150
+ failingAuth: string[];
151
+ checks: {
152
+ commands: {
153
+ [k: string]: {
154
+ installed: boolean;
155
+ path: string | null;
156
+ };
157
+ };
158
+ auth: {};
122
159
  };
123
- staging: {
124
- ready: boolean;
125
- blockers: string[];
126
- warnings: string[];
160
+ };
161
+ toolHealth: {
162
+ githubCli: {
163
+ name: any;
164
+ available: any;
165
+ detail: any;
166
+ };
167
+ ghActExtension: {
168
+ name: any;
169
+ available: any;
170
+ detail: any;
127
171
  };
128
- prod: {
129
- ready: boolean;
130
- blockers: string[];
131
- warnings: string[];
172
+ dockerDaemon: {
173
+ name: any;
174
+ available: any;
175
+ detail: any;
132
176
  };
177
+ wranglerCli: {
178
+ name: any;
179
+ available: any;
180
+ detail: any;
181
+ };
182
+ railwayCli: {
183
+ name: any;
184
+ available: any;
185
+ detail: any;
186
+ };
187
+ actVerificationReady: any;
188
+ remediation: string[];
133
189
  };
190
+ context: import("../operations/services/config-runtime.ts").TreeseedCollectedConfigContext;
191
+ secretSession: import("../operations/services/config-runtime.ts").TreeseedConfigSecretSessionBootstrap;
134
192
  } & {
135
- finalState: WorkflowStatePayload;
136
- }> | {
137
- ok: true;
138
- operation: "config";
139
- payload: {
140
- mode: string;
141
- scopes: ("local" | "staging" | "prod")[];
142
- sync: "none" | "cloudflare" | "railway" | "github" | "all";
143
- secretsRevealed: boolean;
144
- reports: {
145
- scope: "local" | "staging" | "prod";
146
- environment: {
147
- scope: "local" | "staging" | "prod";
148
- revealSecrets: boolean;
149
- entries: any;
150
- };
151
- provider: {
152
- scope: string;
153
- ok: boolean;
154
- checks: {
155
- provider: any;
156
- ready: any;
157
- detail: any;
158
- }[];
159
- };
160
- }[];
161
- repairs: import("../operations/services/config-runtime.ts").TreeseedRepairAction[];
162
- preflight: {
163
- ok: boolean;
164
- requireAuth: boolean;
165
- missingCommands: string[];
166
- failingAuth: string[];
167
- checks: {
168
- commands: {
169
- [k: string]: {
170
- installed: boolean;
171
- path: string | null;
172
- };
193
+ finalState?: WorkflowStatePayload;
194
+ }> | TreeseedWorkflowResult<{
195
+ mode: string;
196
+ scopes: ("local" | "staging" | "prod")[];
197
+ sync: "none" | "cloudflare" | "railway" | "github" | "all";
198
+ keyPath: string;
199
+ repairs: import("../operations/services/config-runtime.ts").TreeseedRepairAction[];
200
+ preflight: {
201
+ ok: boolean;
202
+ requireAuth: boolean;
203
+ missingCommands: string[];
204
+ failingAuth: string[];
205
+ checks: {
206
+ commands: {
207
+ [k: string]: {
208
+ installed: boolean;
209
+ path: string | null;
173
210
  };
174
- auth: {};
175
- };
176
- };
177
- toolHealth: {
178
- githubCli: {
179
- name: any;
180
- available: any;
181
- detail: any;
182
- };
183
- ghActExtension: {
184
- name: any;
185
- available: any;
186
- detail: any;
187
211
  };
188
- dockerDaemon: {
189
- name: any;
190
- available: any;
191
- detail: any;
192
- };
193
- actVerificationReady: any;
194
- remediation: string[];
212
+ auth: {};
195
213
  };
196
- keyPath?: undefined;
197
214
  };
198
- nextSteps: TreeseedWorkflowNextStep[];
199
- } | {
200
- ok: true;
201
- operation: "config";
202
- payload: {
203
- mode: string;
204
- scopes: ("local" | "staging" | "prod")[];
205
- sync: "none" | "cloudflare" | "railway" | "github" | "all";
206
- keyPath: string;
207
- repairs: import("../operations/services/config-runtime.ts").TreeseedRepairAction[];
208
- preflight: {
209
- ok: boolean;
210
- requireAuth: boolean;
211
- missingCommands: string[];
212
- failingAuth: string[];
213
- checks: {
214
- commands: {
215
- [k: string]: {
216
- installed: boolean;
217
- path: string | null;
218
- };
219
- };
220
- auth: {};
221
- };
215
+ toolHealth: {
216
+ githubCli: {
217
+ name: any;
218
+ available: any;
219
+ detail: any;
222
220
  };
223
- toolHealth: {
224
- githubCli: {
225
- name: any;
226
- available: any;
227
- detail: any;
228
- };
229
- ghActExtension: {
230
- name: any;
231
- available: any;
232
- detail: any;
233
- };
234
- dockerDaemon: {
235
- name: any;
236
- available: any;
237
- detail: any;
238
- };
239
- actVerificationReady: any;
240
- remediation: string[];
221
+ ghActExtension: {
222
+ name: any;
223
+ available: any;
224
+ detail: any;
225
+ };
226
+ dockerDaemon: {
227
+ name: any;
228
+ available: any;
229
+ detail: any;
230
+ };
231
+ wranglerCli: {
232
+ name: any;
233
+ available: any;
234
+ detail: any;
241
235
  };
242
- secretsRevealed?: undefined;
243
- reports?: undefined;
236
+ railwayCli: {
237
+ name: any;
238
+ available: any;
239
+ detail: any;
240
+ };
241
+ actVerificationReady: any;
242
+ remediation: string[];
244
243
  };
245
- nextSteps: TreeseedWorkflowNextStep[];
246
- }>;
244
+ context: import("../operations/services/config-runtime.ts").TreeseedCollectedConfigContext;
245
+ secretSession: import("../operations/services/config-runtime.ts").TreeseedConfigSecretSessionBootstrap;
246
+ } & {
247
+ finalState?: WorkflowStatePayload;
248
+ }>>;
247
249
  export declare function workflowExport(helpers: WorkflowOperationHelpers, input?: TreeseedExportInput): Promise<TreeseedWorkflowResult<import("../operations/services/export-runtime.ts").TreeseedExportResult & {
248
- finalState: WorkflowStatePayload;
250
+ finalState?: WorkflowStatePayload;
249
251
  }>>;
250
252
  export declare function workflowSwitch(helpers: WorkflowOperationHelpers, input: TreeseedSwitchInput): Promise<TreeseedWorkflowResult<{
253
+ mode: TreeseedWorkflowMode;
254
+ branchName: string;
255
+ rootRepo: WorkflowRepoReport;
256
+ repos: WorkflowRepoReport[];
257
+ previewRequested: boolean;
258
+ blockers: string[];
259
+ plannedSteps: {
260
+ id: string;
261
+ description: string;
262
+ }[];
263
+ } & {
264
+ finalState?: WorkflowStatePayload;
265
+ }> | TreeseedWorkflowResult<{
266
+ mode: TreeseedWorkflowMode;
251
267
  branchName: string;
252
268
  created: boolean;
253
269
  resumed: boolean;
270
+ repos: WorkflowRepoReport[];
271
+ rootRepo: WorkflowRepoReport;
254
272
  previewRequested: boolean;
255
273
  preview: {
256
274
  enabled: boolean;
@@ -263,7 +281,7 @@ export declare function workflowSwitch(helpers: WorkflowOperationHelpers, input:
263
281
  baseBranch: string;
264
282
  };
265
283
  } & {
266
- finalState: WorkflowStatePayload;
284
+ finalState?: WorkflowStatePayload;
267
285
  }>>;
268
286
  export declare function workflowDev(helpers: WorkflowOperationHelpers, input?: TreeseedWorkflowDevInput): Promise<TreeseedWorkflowResult<{
269
287
  watch: boolean;
@@ -284,7 +302,7 @@ export declare function workflowDev(helpers: WorkflowOperationHelpers, input?: T
284
302
  warnings: string[];
285
303
  };
286
304
  } & {
287
- finalState: WorkflowStatePayload;
305
+ finalState?: WorkflowStatePayload;
288
306
  }> | TreeseedWorkflowResult<{
289
307
  watch: boolean;
290
308
  background: boolean;
@@ -304,9 +322,25 @@ export declare function workflowDev(helpers: WorkflowOperationHelpers, input?: T
304
322
  warnings: string[];
305
323
  };
306
324
  } & {
307
- finalState: WorkflowStatePayload;
325
+ finalState?: WorkflowStatePayload;
308
326
  }>>;
309
327
  export declare function workflowSave(helpers: WorkflowOperationHelpers, input: TreeseedSaveInput): Promise<TreeseedWorkflowResult<{
328
+ mode: TreeseedWorkflowMode;
329
+ branch: string;
330
+ scope: string;
331
+ hotfix: boolean;
332
+ message: string;
333
+ repos: WorkflowRepoReport[];
334
+ rootRepo: WorkflowRepoReport;
335
+ blockers: string[];
336
+ plannedSteps: {
337
+ id: string;
338
+ description: string;
339
+ }[];
340
+ } & {
341
+ finalState?: WorkflowStatePayload;
342
+ }> | TreeseedWorkflowResult<{
343
+ mode: TreeseedWorkflowMode;
310
344
  branch: string;
311
345
  scope: string;
312
346
  hotfix: boolean;
@@ -321,16 +355,50 @@ export declare function workflowSave(helpers: WorkflowOperationHelpers, input: T
321
355
  createdRemoteBranch: boolean;
322
356
  conflicts: boolean;
323
357
  };
358
+ repos: WorkflowRepoReport[];
359
+ rootRepo: WorkflowRepoReport;
360
+ partialFailure: null;
324
361
  previewAction: Record<string, unknown>;
325
362
  mergeConflict: null;
326
363
  } & {
327
- finalState: WorkflowStatePayload;
364
+ finalState?: WorkflowStatePayload;
328
365
  }>>;
329
366
  export declare function workflowClose(helpers: WorkflowOperationHelpers, input: TreeseedCloseInput): Promise<TreeseedWorkflowResult<{
367
+ mode: TreeseedWorkflowMode;
368
+ branchName: string | null;
369
+ message: string;
370
+ autoSaveRequired: boolean;
371
+ repos: WorkflowRepoReport[];
372
+ rootRepo: WorkflowRepoReport;
373
+ blockers: string[];
374
+ plannedSteps: {
375
+ id: string;
376
+ description: string;
377
+ }[];
378
+ } & {
379
+ finalState?: WorkflowStatePayload;
380
+ }> | TreeseedWorkflowResult<{
381
+ mode: TreeseedWorkflowMode;
330
382
  branchName: string;
331
383
  message: string;
332
384
  autoSaved: boolean;
333
385
  autoSaveResult: ({
386
+ mode: TreeseedWorkflowMode;
387
+ branch: string;
388
+ scope: string;
389
+ hotfix: boolean;
390
+ message: string;
391
+ repos: WorkflowRepoReport[];
392
+ rootRepo: WorkflowRepoReport;
393
+ blockers: string[];
394
+ plannedSteps: {
395
+ id: string;
396
+ description: string;
397
+ }[];
398
+ } & {
399
+ finalState?: WorkflowStatePayload;
400
+ }) | ({
401
+ mode: TreeseedWorkflowMode;
334
402
  branch: string;
335
403
  scope: string;
336
404
  hotfix: boolean;
@@ -345,15 +413,20 @@ export declare function workflowClose(helpers: WorkflowOperationHelpers, input:
345
413
  createdRemoteBranch: boolean;
346
414
  conflicts: boolean;
347
415
  };
416
+ repos: WorkflowRepoReport[];
417
+ rootRepo: WorkflowRepoReport;
418
+ partialFailure: null;
348
419
  previewAction: Record<string, unknown>;
349
420
  mergeConflict: null;
350
421
  } & {
351
- finalState: WorkflowStatePayload;
422
+ finalState?: WorkflowStatePayload;
352
423
  }) | null;
353
424
  deprecatedTag: {
354
425
  tagName: string;
355
426
  head: string;
356
427
  };
428
+ repos: WorkflowRepoReport[];
429
+ rootRepo: WorkflowRepoReport;
357
430
  previewCleanup: {
358
431
  performed: boolean;
359
432
  state: any;
@@ -364,14 +437,48 @@ export declare function workflowClose(helpers: WorkflowOperationHelpers, input:
364
437
  localDeleted: boolean;
365
438
  finalBranch: string;
366
439
  } & {
367
- finalState: WorkflowStatePayload;
440
+ finalState?: WorkflowStatePayload;
368
441
  }>>;
369
442
  export declare function workflowStage(helpers: WorkflowOperationHelpers, input: TreeseedStageInput): Promise<TreeseedWorkflowResult<{
443
+ mode: TreeseedWorkflowMode;
444
+ branchName: string | null;
445
+ mergeTarget: string;
446
+ mergeStrategy: string;
447
+ message: string;
448
+ autoSaveRequired: boolean;
449
+ blockers: string[];
450
+ rootRepo: WorkflowRepoReport;
451
+ repos: WorkflowRepoReport[];
452
+ plannedSteps: {
453
+ id: string;
454
+ description: string;
455
+ }[];
456
+ } & {
457
+ finalState?: WorkflowStatePayload;
458
+ }> | TreeseedWorkflowResult<{
459
+ mode: TreeseedWorkflowMode;
370
460
  branchName: string;
371
461
  mergeTarget: string;
462
+ mergeStrategy: string;
372
463
  message: string;
373
464
  autoSaved: boolean;
374
465
  autoSaveResult: ({
466
+ mode: TreeseedWorkflowMode;
467
+ branch: string;
468
+ scope: string;
469
+ hotfix: boolean;
470
+ message: string;
471
+ repos: WorkflowRepoReport[];
472
+ rootRepo: WorkflowRepoReport;
473
+ blockers: string[];
474
+ plannedSteps: {
475
+ id: string;
476
+ description: string;
477
+ }[];
478
+ } & {
479
+ finalState?: WorkflowStatePayload;
480
+ }) | ({
481
+ mode: TreeseedWorkflowMode;
375
482
  branch: string;
376
483
  scope: string;
377
484
  hotfix: boolean;
@@ -386,15 +493,20 @@ export declare function workflowStage(helpers: WorkflowOperationHelpers, input:
386
493
  createdRemoteBranch: boolean;
387
494
  conflicts: boolean;
388
495
  };
496
+ repos: WorkflowRepoReport[];
497
+ rootRepo: WorkflowRepoReport;
498
+ partialFailure: null;
389
499
  previewAction: Record<string, unknown>;
390
500
  mergeConflict: null;
391
501
  } & {
392
- finalState: WorkflowStatePayload;
502
+ finalState?: WorkflowStatePayload;
393
503
  }) | null;
394
504
  deprecatedTag: {
395
505
  tagName: string;
396
506
  head: string;
397
507
  };
508
+ repos: WorkflowRepoReport[];
509
+ rootRepo: WorkflowRepoReport;
398
510
  stagingWait: {
399
511
  status: string;
400
512
  reason: string;
@@ -414,9 +526,28 @@ export declare function workflowStage(helpers: WorkflowOperationHelpers, input:
414
526
  localDeleted: boolean;
415
527
  finalBranch: string;
416
528
  } & {
417
- finalState: WorkflowStatePayload;
529
+ finalState?: WorkflowStatePayload;
418
530
  }>>;
419
531
  export declare function workflowRelease(helpers: WorkflowOperationHelpers, input: TreeseedReleaseInput): Promise<TreeseedWorkflowResult<{
532
+ mode: TreeseedWorkflowMode;
533
+ mergeStrategy: string;
534
+ level: "patch" | "major" | "minor";
535
+ stagingBranch: string;
536
+ productionBranch: string;
537
+ packageSelection: import("./session.ts").TreeseedWorkflowPackageSelection;
538
+ plannedVersions: any;
539
+ repos: WorkflowRepoReport[];
540
+ rootRepo: WorkflowRepoReport;
541
+ plannedSteps: {
542
+ id: string;
543
+ description: string;
544
+ }[];
545
+ blockers: string[];
546
+ } & {
547
+ finalState?: WorkflowStatePayload;
548
+ }> | TreeseedWorkflowResult<{
549
+ mode: "root-only";
550
+ mergeStrategy: string;
420
551
  level: "patch" | "major" | "minor";
421
552
  rootVersion: string;
422
553
  releaseTag: string;
@@ -424,6 +555,14 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
424
555
  stagingBranch: string;
425
556
  productionBranch: string;
426
557
  touchedPackages: unknown[];
558
+ packageSelection: {
559
+ changed: never[];
560
+ dependents: never[];
561
+ selected: never[];
562
+ };
563
+ publishWait: never[];
564
+ repos: never[];
565
+ rootRepo: WorkflowRepoReport;
427
566
  finalBranch: string;
428
567
  pushStatus: {
429
568
  stagingPushed: boolean;
@@ -431,91 +570,301 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
431
570
  tagPushed: boolean;
432
571
  };
433
572
  } & {
434
- finalState: WorkflowStatePayload;
573
+ finalState?: WorkflowStatePayload;
574
+ }> | TreeseedWorkflowResult<{
575
+ mode: "recursive-workspace";
576
+ mergeStrategy: string;
577
+ level: "patch" | "major" | "minor";
578
+ rootVersion: string;
579
+ releaseTag: string;
580
+ releasedCommit: string;
581
+ stagingBranch: string;
582
+ productionBranch: string;
583
+ touchedPackages: string[];
584
+ packageSelection: import("./session.ts").TreeseedWorkflowPackageSelection;
585
+ publishWait: Record<string, unknown>[];
586
+ repos: WorkflowRepoReport[];
587
+ rootRepo: WorkflowRepoReport;
588
+ finalBranch: string;
589
+ pushStatus: {
590
+ stagingPushed: boolean;
591
+ productionPushed: boolean;
592
+ tagPushed: boolean;
593
+ };
594
+ } & {
595
+ finalState?: WorkflowStatePayload;
435
596
  }>>;
436
- export declare function workflowDestroy(helpers: WorkflowOperationHelpers, input: TreeseedDestroyInput): Promise<{
437
- ok: boolean;
438
- operation: string;
439
- payload: {
597
+ export declare function workflowResume(helpers: WorkflowOperationHelpers, input: TreeseedResumeInput): Promise<TreeseedWorkflowResult<{
598
+ mode: TreeseedWorkflowMode;
599
+ branch: string;
600
+ scope: string;
601
+ hotfix: boolean;
602
+ message: string;
603
+ repos: WorkflowRepoReport[];
604
+ rootRepo: WorkflowRepoReport;
605
+ blockers: string[];
606
+ plannedSteps: {
607
+ id: string;
608
+ description: string;
609
+ }[];
610
+ } & {
611
+ finalState?: WorkflowStatePayload;
612
+ }> | TreeseedWorkflowResult<{
613
+ mode: TreeseedWorkflowMode;
614
+ branch: string;
615
+ scope: string;
616
+ hotfix: boolean;
617
+ message: string;
618
+ commitSha: string;
619
+ commitCreated: boolean;
620
+ noChanges: boolean;
621
+ branchSync: {
622
+ remoteBranchExisted: boolean;
623
+ pulledRebase: boolean;
624
+ pushed: boolean;
625
+ createdRemoteBranch: boolean;
626
+ conflicts: boolean;
627
+ };
628
+ repos: WorkflowRepoReport[];
629
+ rootRepo: WorkflowRepoReport;
630
+ partialFailure: null;
631
+ previewAction: Record<string, unknown>;
632
+ mergeConflict: null;
633
+ } & {
634
+ finalState?: WorkflowStatePayload;
635
+ }> | TreeseedWorkflowResult<{
636
+ mode: TreeseedWorkflowMode;
637
+ branchName: string;
638
+ rootRepo: WorkflowRepoReport;
639
+ repos: WorkflowRepoReport[];
640
+ previewRequested: boolean;
641
+ blockers: string[];
642
+ plannedSteps: {
643
+ id: string;
644
+ description: string;
645
+ }[];
646
+ } & {
647
+ finalState?: WorkflowStatePayload;
648
+ }> | TreeseedWorkflowResult<{
649
+ mode: TreeseedWorkflowMode;
650
+ branchName: string;
651
+ created: boolean;
652
+ resumed: boolean;
653
+ repos: WorkflowRepoReport[];
654
+ rootRepo: WorkflowRepoReport;
655
+ previewRequested: boolean;
656
+ preview: {
657
+ enabled: boolean;
658
+ url: string | null;
659
+ lastDeploymentTimestamp: string | null;
660
+ };
661
+ previewResult: Record<string, unknown> | null;
662
+ preconditions: {
663
+ cleanWorktreeRequired: boolean;
664
+ baseBranch: string;
665
+ };
666
+ } & {
667
+ finalState?: WorkflowStatePayload;
668
+ }> | TreeseedWorkflowResult<{
669
+ mode: TreeseedWorkflowMode;
670
+ branchName: string | null;
671
+ message: string;
672
+ autoSaveRequired: boolean;
673
+ repos: WorkflowRepoReport[];
674
+ rootRepo: WorkflowRepoReport;
675
+ blockers: string[];
676
+ plannedSteps: {
677
+ id: string;
678
+ description: string;
679
+ }[];
680
+ } & {
681
+ finalState?: WorkflowStatePayload;
682
+ }> | TreeseedWorkflowResult<{
683
+ mode: TreeseedWorkflowMode;
684
+ branchName: string;
685
+ message: string;
686
+ autoSaved: boolean;
687
+ autoSaveResult: ({
688
+ mode: TreeseedWorkflowMode;
689
+ branch: string;
690
+ scope: string;
691
+ hotfix: boolean;
692
+ message: string;
693
+ repos: WorkflowRepoReport[];
694
+ rootRepo: WorkflowRepoReport;
695
+ blockers: string[];
696
+ plannedSteps: {
697
+ id: string;
698
+ description: string;
699
+ }[];
700
+ } & {
701
+ finalState?: WorkflowStatePayload;
702
+ }) | ({
703
+ mode: TreeseedWorkflowMode;
704
+ branch: string;
440
705
  scope: string;
441
- dryRun: boolean;
442
- force: boolean;
443
- destroyRemote: boolean;
444
- destroyLocal: boolean;
445
- removeBuildArtifacts: boolean;
446
- expectedConfirmation: string;
447
- stateSummary: {
448
- workerName: any;
449
- lastDeploymentTimestamp: any;
706
+ hotfix: boolean;
707
+ message: string;
708
+ commitSha: string;
709
+ commitCreated: boolean;
710
+ noChanges: boolean;
711
+ branchSync: {
712
+ remoteBranchExisted: boolean;
713
+ pulledRebase: boolean;
714
+ pushed: boolean;
715
+ createdRemoteBranch: boolean;
716
+ conflicts: boolean;
450
717
  };
451
- remoteResult: {
452
- target: {
453
- kind: string;
454
- scope: string;
455
- } | {
456
- kind: string;
457
- branchName: string;
458
- };
459
- summary: {
460
- target: any;
461
- workerName: any;
462
- siteUrl: any;
463
- accountId: any;
464
- pages: any;
465
- formGuardKv: any;
466
- sessionKv: any;
467
- siteDataDb: any;
468
- queue: any;
469
- content: any;
470
- };
471
- operations: {
472
- worker: {
473
- status: string;
474
- name: any;
475
- };
476
- formGuard: {
477
- status: string;
478
- id: any;
479
- preview?: undefined;
480
- } | {
481
- status: string;
482
- id: any;
483
- preview: boolean;
484
- };
485
- formGuardPreview: {
486
- status: string;
487
- id: any;
488
- preview?: undefined;
489
- } | {
490
- status: string;
491
- id: any;
492
- preview: boolean;
493
- } | null;
494
- session: {
495
- status: string;
496
- id: any;
497
- preview?: undefined;
498
- } | {
499
- status: string;
500
- id: any;
501
- preview: boolean;
502
- };
503
- sessionPreview: {
504
- status: string;
505
- id: any;
506
- preview?: undefined;
507
- } | {
508
- status: string;
509
- id: any;
510
- preview: boolean;
511
- } | null;
512
- database: {
513
- status: string;
514
- name: any;
515
- };
516
- };
718
+ repos: WorkflowRepoReport[];
719
+ rootRepo: WorkflowRepoReport;
720
+ partialFailure: null;
721
+ previewAction: Record<string, unknown>;
722
+ mergeConflict: null;
723
+ } & {
724
+ finalState?: WorkflowStatePayload;
725
+ }) | null;
726
+ deprecatedTag: {
727
+ tagName: string;
728
+ head: string;
729
+ };
730
+ repos: WorkflowRepoReport[];
731
+ rootRepo: WorkflowRepoReport;
732
+ previewCleanup: {
733
+ performed: boolean;
734
+ state: any;
735
+ } | {
736
+ performed: boolean;
737
+ };
738
+ remoteDeleted: boolean;
739
+ localDeleted: boolean;
740
+ finalBranch: string;
741
+ } & {
742
+ finalState?: WorkflowStatePayload;
743
+ }> | TreeseedWorkflowResult<{
744
+ mode: TreeseedWorkflowMode;
745
+ mergeStrategy: string;
746
+ level: "patch" | "major" | "minor";
747
+ stagingBranch: string;
748
+ productionBranch: string;
749
+ packageSelection: import("./session.ts").TreeseedWorkflowPackageSelection;
750
+ plannedVersions: any;
751
+ repos: WorkflowRepoReport[];
752
+ rootRepo: WorkflowRepoReport;
753
+ plannedSteps: {
754
+ id: string;
755
+ description: string;
756
+ }[];
757
+ blockers: string[];
758
+ } & {
759
+ finalState?: WorkflowStatePayload;
760
+ }> | TreeseedWorkflowResult<{
761
+ mode: "root-only";
762
+ mergeStrategy: string;
763
+ level: "patch" | "major" | "minor";
764
+ rootVersion: string;
765
+ releaseTag: string;
766
+ releasedCommit: string;
767
+ stagingBranch: string;
768
+ productionBranch: string;
769
+ touchedPackages: unknown[];
770
+ packageSelection: {
771
+ changed: never[];
772
+ dependents: never[];
773
+ selected: never[];
774
+ };
775
+ publishWait: never[];
776
+ repos: never[];
777
+ rootRepo: WorkflowRepoReport;
778
+ finalBranch: string;
779
+ pushStatus: {
780
+ stagingPushed: boolean;
781
+ productionPushed: boolean;
782
+ tagPushed: boolean;
783
+ };
784
+ } & {
785
+ finalState?: WorkflowStatePayload;
786
+ }> | TreeseedWorkflowResult<{
787
+ mode: "recursive-workspace";
788
+ mergeStrategy: string;
789
+ level: "patch" | "major" | "minor";
790
+ rootVersion: string;
791
+ releaseTag: string;
792
+ releasedCommit: string;
793
+ stagingBranch: string;
794
+ productionBranch: string;
795
+ touchedPackages: string[];
796
+ packageSelection: import("./session.ts").TreeseedWorkflowPackageSelection;
797
+ publishWait: Record<string, unknown>[];
798
+ repos: WorkflowRepoReport[];
799
+ rootRepo: WorkflowRepoReport;
800
+ finalBranch: string;
801
+ pushStatus: {
802
+ stagingPushed: boolean;
803
+ productionPushed: boolean;
804
+ tagPushed: boolean;
805
+ };
806
+ } & {
807
+ finalState?: WorkflowStatePayload;
808
+ }> | TreeseedWorkflowResult<{
809
+ dryRun: boolean;
810
+ remoteResult: Record<string, unknown> | null;
811
+ scope: string;
812
+ force: boolean;
813
+ destroyRemote: boolean;
814
+ destroyLocal: boolean;
815
+ removeBuildArtifacts: boolean;
816
+ expectedConfirmation: string;
817
+ stateSummary: {
818
+ workerName: any;
819
+ lastDeploymentTimestamp: any;
820
+ };
821
+ plannedSteps: {
822
+ id: string;
823
+ description: string;
824
+ }[];
825
+ } & {
826
+ finalState?: WorkflowStatePayload;
827
+ }>>;
828
+ export declare function workflowRecover(helpers: WorkflowOperationHelpers, input?: TreeseedRecoverInput): Promise<TreeseedWorkflowResult<{
829
+ lock: import("./runs.ts").TreeseedWorkflowLockInspection;
830
+ interruptedRuns: {
831
+ runId: string;
832
+ command: TreeseedWorkflowRunCommand;
833
+ status: import("./runs.ts").TreeseedWorkflowRunStatus;
834
+ createdAt: string;
835
+ updatedAt: string;
836
+ nextStep: string | null;
837
+ failure: {
838
+ code: string;
839
+ message: string;
840
+ details: Record<string, unknown> | null;
841
+ at: string;
517
842
  } | null;
843
+ resumeCommand: string;
844
+ }[];
845
+ selectedRun: TreeseedWorkflowRunJournal | null;
846
+ runCount: number;
847
+ } & {
848
+ finalState?: WorkflowStatePayload;
849
+ }>>;
850
+ export declare function workflowDestroy(helpers: WorkflowOperationHelpers, input: TreeseedDestroyInput): Promise<TreeseedWorkflowResult<{
851
+ dryRun: boolean;
852
+ remoteResult: Record<string, unknown> | null;
853
+ scope: string;
854
+ force: boolean;
855
+ destroyRemote: boolean;
856
+ destroyLocal: boolean;
857
+ removeBuildArtifacts: boolean;
858
+ expectedConfirmation: string;
859
+ stateSummary: {
860
+ workerName: any;
861
+ lastDeploymentTimestamp: any;
518
862
  };
519
- nextSteps: TreeseedWorkflowNextStep[];
520
- }>;
863
+ plannedSteps: {
864
+ id: string;
865
+ description: string;
866
+ }[];
867
+ } & {
868
+ finalState?: WorkflowStatePayload;
869
+ }>>;
521
870
  export {};