self-evolving-workflow 0.0.0-stage → 0.1.3

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 (173) hide show
  1. package/LICENSE +27 -0
  2. package/README.md +90 -2
  3. package/dist/agent-memory-prompts.d.ts +13 -0
  4. package/dist/agent-memory-prompts.js +55 -0
  5. package/dist/cli.d.ts +2 -0
  6. package/dist/cli.js +6 -0
  7. package/dist/closeout.d.ts +105 -0
  8. package/dist/closeout.js +479 -0
  9. package/dist/code.d.ts +39 -0
  10. package/dist/code.js +124 -0
  11. package/dist/common.d.ts +9 -0
  12. package/dist/common.js +42 -0
  13. package/dist/context-envelope.d.ts +59 -0
  14. package/dist/context-envelope.js +23 -0
  15. package/dist/host-adapters.d.ts +34 -0
  16. package/dist/host-adapters.js +151 -0
  17. package/dist/http.d.ts +3 -0
  18. package/dist/http.js +90 -0
  19. package/dist/index.d.ts +16 -0
  20. package/dist/index.js +13 -0
  21. package/dist/knowledge-cli.d.ts +183 -0
  22. package/dist/knowledge-cli.js +654 -0
  23. package/dist/knowledge-reads.d.ts +71 -0
  24. package/dist/knowledge-reads.js +193 -0
  25. package/dist/memory.d.ts +97 -0
  26. package/dist/memory.js +250 -0
  27. package/dist/retrospective.d.ts +57 -0
  28. package/dist/retrospective.js +248 -0
  29. package/dist/search.d.ts +36 -0
  30. package/dist/search.js +112 -0
  31. package/dist/skill-addition.d.ts +25 -0
  32. package/dist/skill-addition.js +89 -0
  33. package/dist/skill-design.d.ts +96 -0
  34. package/dist/skill-design.js +226 -0
  35. package/dist/skill-replay.d.ts +55 -0
  36. package/dist/skill-replay.js +451 -0
  37. package/dist/skill-route.d.ts +30 -0
  38. package/dist/skill-route.js +75 -0
  39. package/dist/transcript-evidence.d.ts +3 -0
  40. package/dist/transcript-evidence.js +58 -0
  41. package/dist/upstream/chunker.d.ts +24 -0
  42. package/dist/upstream/chunker.js +96 -0
  43. package/dist/upstream/file-protocol.d.ts +45 -0
  44. package/dist/upstream/file-protocol.js +117 -0
  45. package/dist/upstream/frontmatter.d.ts +47 -0
  46. package/dist/upstream/frontmatter.js +86 -0
  47. package/dist/upstream/graph-search.d.ts +33 -0
  48. package/dist/upstream/graph-search.js +67 -0
  49. package/dist/upstream/l1-extraction.d.ts +26 -0
  50. package/dist/upstream/l1-extraction.js +405 -0
  51. package/dist/upstream/llm.d.ts +8 -0
  52. package/dist/upstream/llm.js +1 -0
  53. package/dist/upstream/merge.d.ts +50 -0
  54. package/dist/upstream/merge.js +153 -0
  55. package/dist/upstream/prompts.d.ts +53 -0
  56. package/dist/upstream/prompts.js +185 -0
  57. package/dist/upstream/search-utils.d.ts +34 -0
  58. package/dist/upstream/search-utils.js +55 -0
  59. package/dist/upstream/slug.d.ts +26 -0
  60. package/dist/upstream/slug.js +103 -0
  61. package/dist/upstream/template.d.ts +29 -0
  62. package/dist/upstream/template.js +80 -0
  63. package/dist/upstream/tokenize.d.ts +4 -0
  64. package/dist/upstream/tokenize.js +29 -0
  65. package/dist/wiki-change.d.ts +76 -0
  66. package/dist/wiki-change.js +299 -0
  67. package/dist/wiki-entry.d.ts +26 -0
  68. package/dist/wiki-entry.js +93 -0
  69. package/dist/wiki-ingest.d.ts +12 -0
  70. package/dist/wiki-ingest.js +126 -0
  71. package/dist/wiki-migration.d.ts +16 -0
  72. package/dist/wiki-migration.js +268 -0
  73. package/dist/wiki-tokens.d.ts +1 -0
  74. package/dist/wiki-tokens.js +46 -0
  75. package/dist/wiki.d.ts +103 -0
  76. package/dist/wiki.js +330 -0
  77. package/dist/workflow-cli.d.ts +2 -0
  78. package/dist/workflow-cli.js +258 -0
  79. package/dist/workflow-install.d.ts +36 -0
  80. package/dist/workflow-install.js +148 -0
  81. package/dist/workflow-knowledge.d.ts +16 -0
  82. package/dist/workflow-knowledge.js +24 -0
  83. package/dist/workflow-mcp.d.ts +2 -0
  84. package/dist/workflow-mcp.js +144 -0
  85. package/dist/workflow-names.d.ts +4 -0
  86. package/dist/workflow-names.js +18 -0
  87. package/dist/workflow-runtime.d.ts +622 -0
  88. package/dist/workflow-runtime.js +627 -0
  89. package/dist/workflow-skills.d.ts +48 -0
  90. package/dist/workflow-skills.js +141 -0
  91. package/package.json +76 -4
  92. package/skills/ew-odyssey/SKILL.md +237 -0
  93. package/skills/ew-odyssey/references/audit-artifacts.md +7 -0
  94. package/skills/ew-odyssey/references/odyssey-base-codex.md +3 -0
  95. package/skills/ew-odyssey/references/odyssey-base.md +278 -0
  96. package/skills/ew-odyssey/references/odyssey-debug.codex.md +305 -0
  97. package/skills/ew-odyssey/references/odyssey-debug.md +283 -0
  98. package/skills/ew-odyssey/references/odyssey-defensive.codex.md +395 -0
  99. package/skills/ew-odyssey/references/odyssey-defensive.md +369 -0
  100. package/skills/ew-odyssey/references/odyssey-improve.codex.md +270 -0
  101. package/skills/ew-odyssey/references/odyssey-improve.md +248 -0
  102. package/skills/ew-odyssey/references/odyssey-planex.codex.md +352 -0
  103. package/skills/ew-odyssey/references/odyssey-planex.md +312 -0
  104. package/skills/ew-odyssey/references/odyssey-review.codex.md +283 -0
  105. package/skills/ew-odyssey/references/odyssey-review.md +251 -0
  106. package/skills/ew-odyssey/references/odyssey-security.md +249 -0
  107. package/skills/ew-odyssey/references/odyssey-ui.codex.md +294 -0
  108. package/skills/ew-odyssey/references/odyssey-ui.md +250 -0
  109. package/skills/ew-odyssey/references/prepare/odyssey-debug.md +105 -0
  110. package/skills/ew-odyssey/references/prepare/odyssey-defensive.md +121 -0
  111. package/skills/ew-odyssey/references/prepare/odyssey-improve.md +93 -0
  112. package/skills/ew-odyssey/references/prepare/odyssey-planex.md +104 -0
  113. package/skills/ew-odyssey/references/prepare/odyssey-review.md +98 -0
  114. package/skills/ew-odyssey/references/prepare/odyssey-security.md +94 -0
  115. package/skills/ew-odyssey/references/prepare/odyssey-ui.md +87 -0
  116. package/skills/ew-orchestrate/SKILL.md +236 -0
  117. package/skills/ew-orchestrate/references/auto-policy.md +165 -0
  118. package/skills/ew-orchestrate/references/companion-route.md +52 -0
  119. package/skills/ew-orchestrate/references/ew-orchestrate.md +27 -0
  120. package/skills/ew-orchestrate/references/goal.md +53 -0
  121. package/skills/ew-orchestrate/references/knowledge-route.md +163 -0
  122. package/skills/ew-orchestrate/references/orchestrator-run-loop.md +36 -0
  123. package/skills/ew-orchestrate/references/planning.md +137 -0
  124. package/skills/ew-orchestrate/steps/ew-analyze/SKILL.md +62 -0
  125. package/skills/ew-orchestrate/steps/ew-analyze/references/boundary-grill.md +50 -0
  126. package/skills/ew-orchestrate/steps/ew-analyze/references/issue-gaps-analyze.md +59 -0
  127. package/skills/ew-orchestrate/steps/ew-analyze/references/prepare.md +42 -0
  128. package/skills/ew-orchestrate/steps/ew-analyze/references/workflow.md +401 -0
  129. package/skills/ew-orchestrate/steps/ew-brainstorm/SKILL.md +32 -0
  130. package/skills/ew-orchestrate/steps/ew-companion/SKILL.md +9 -0
  131. package/skills/ew-orchestrate/steps/ew-execute/SKILL.md +71 -0
  132. package/skills/ew-orchestrate/steps/ew-execute/references/prepare.md +69 -0
  133. package/skills/ew-orchestrate/steps/ew-execute/references/workflow.md +373 -0
  134. package/skills/ew-orchestrate/steps/ew-plan/SKILL.md +102 -0
  135. package/skills/ew-orchestrate/steps/ew-plan/references/boundary-grill.md +50 -0
  136. package/skills/ew-orchestrate/steps/ew-plan/references/prepare.md +51 -0
  137. package/skills/ew-orchestrate/steps/ew-plan/references/tdd.md +53 -0
  138. package/skills/ew-orchestrate/steps/ew-plan/references/workflow.md +278 -0
  139. package/skills/ew-orchestrate/steps/ew-review/SKILL.md +44 -0
  140. package/skills/ew-orchestrate/steps/ew-review/references/odyssey-base-codex.md +3 -0
  141. package/skills/ew-orchestrate/steps/ew-review/references/prepare.md +76 -0
  142. package/skills/ew-orchestrate/steps/ew-review/references/workflow.md +283 -0
  143. package/skills/ew-skill-design/SKILL.md +28 -0
  144. package/skills/ew-skill-design/references/package-contract.md +28 -0
  145. package/skills/ew-skill-design/references/validation.md +7 -0
  146. package/skills/team-swarm/SKILL.md +231 -0
  147. package/skills/team-swarm/references/mcp-coordination.md +10 -0
  148. package/skills/team-swarm/roles/analyst/role.md +181 -0
  149. package/skills/team-swarm/roles/ant/role.md +149 -0
  150. package/skills/team-swarm/roles/coordinator/commands/converge.md +154 -0
  151. package/skills/team-swarm/roles/coordinator/commands/init-swarm.md +134 -0
  152. package/skills/team-swarm/roles/coordinator/commands/iterate.md +202 -0
  153. package/skills/team-swarm/roles/coordinator/role.md +228 -0
  154. package/skills/team-swarm/roles/scorer/role.md +150 -0
  155. package/skills/team-swarm/scripts/aco.py +646 -0
  156. package/skills/team-swarm/scripts/pheromone.py +144 -0
  157. package/skills/team-swarm/scripts/scoring.py +111 -0
  158. package/skills/team-swarm/scripts/test_aco.py +606 -0
  159. package/skills/team-swarm/specs/ant-output-schema.md +127 -0
  160. package/skills/team-swarm/specs/convergence-criteria.md +108 -0
  161. package/skills/team-swarm/specs/pheromone-schema.md +125 -0
  162. package/skills/team-swarm/specs/swarm-config-template.json +71 -0
  163. package/skills/team-swarm/specs/swarm-protocol.md +123 -0
  164. package/skills/workflow-closeout/SKILL.md +10 -0
  165. package/skills/workflow-evolve/SKILL.md +79 -0
  166. package/skills/workflow-evolve/references/agy-gate.md +27 -0
  167. package/skills/workflow-evolve/references/auto-loop.md +20 -0
  168. package/skills/workflow-evolve/references/history-review.md +14 -0
  169. package/skills/workflow-evolve/scripts/codex-memory-replay.mjs +76 -0
  170. package/skills/workflow-evolve/scripts/codex-replay.mjs +1 -0
  171. package/skills/workflow-evolve/scripts/evolve-loop.mjs +259 -0
  172. package/skills/workflow-evolve/scripts/memory-codex-mcp.mjs +124 -0
  173. package/workflows/index.json +23 -0
@@ -0,0 +1,622 @@
1
+ import { KnowledgeReads, type KnowledgePriorReuse, type KnowledgeReadsReceipt } from './knowledge-reads.js';
2
+ import { type WikiLookupScope, type WikiPrior } from './workflow-knowledge.js';
3
+ import { type ArtifactType, type WorkflowSkill } from './workflow-skills.js';
4
+ type StepStatus = 'pending' | 'running' | 'completed' | 'skipped';
5
+ type RunStatus = 'running' | 'blocked' | 'failed' | 'cancelled' | 'sealed';
6
+ export interface WorkflowStep {
7
+ id: string;
8
+ command: string;
9
+ args: string[];
10
+ decision_ref?: string;
11
+ stage?: string;
12
+ goal_ref?: string;
13
+ }
14
+ interface Step extends WorkflowStep {
15
+ status: StepStatus;
16
+ run_id?: string;
17
+ decision?: 'proceed' | 'fix' | 'escalate';
18
+ }
19
+ interface Run {
20
+ id: string;
21
+ owner: string;
22
+ step_id: string;
23
+ status: RunStatus;
24
+ revision: number;
25
+ skill: WorkflowSkill;
26
+ task: {
27
+ command: string;
28
+ args: string[];
29
+ goal: string;
30
+ };
31
+ inputs: string[];
32
+ input_aliases: Record<string, string>;
33
+ reads: Record<string, string>;
34
+ retry_of_run_id?: string;
35
+ summary?: string;
36
+ finished_at?: string;
37
+ verdict?: 'done' | 'done_with_concerns';
38
+ knowledge_reads?: KnowledgeReadsReceipt;
39
+ wiki_priors?: WikiPrior[];
40
+ priors_reuse?: KnowledgePriorReuse[];
41
+ assignments?: Record<string, Assignment>;
42
+ }
43
+ interface Assignment {
44
+ id: string;
45
+ role: string;
46
+ path: string;
47
+ result?: {
48
+ summary: string;
49
+ sha256: string;
50
+ };
51
+ cancellation?: string;
52
+ }
53
+ interface Artifact extends ArtifactType {
54
+ id: string;
55
+ path: string;
56
+ run_id: string;
57
+ sha256: string;
58
+ derived_from: string[];
59
+ status: 'sealed';
60
+ wiki_priors?: true;
61
+ }
62
+ interface Session {
63
+ schema_version: 'evolve-session/1.0';
64
+ id: string;
65
+ objective: string;
66
+ definition_of_done: string;
67
+ status: 'open' | 'completed';
68
+ revision: number;
69
+ created_at: string;
70
+ completed_at?: string;
71
+ steps: Step[];
72
+ runs: Run[];
73
+ aliases: Record<string, string>;
74
+ artifacts: Record<string, Artifact>;
75
+ }
76
+ export interface Mutation {
77
+ actor: string;
78
+ requestId?: string;
79
+ revision?: number;
80
+ runRevision?: number;
81
+ evidence?: string[];
82
+ reason?: string;
83
+ }
84
+ export declare function workflowId(value: unknown, label: string): string;
85
+ export declare function workflowDbPath(root: string): string;
86
+ export declare function readEvolveSessions(root: string, id?: string): Session[];
87
+ export declare function evolveSessionReceipt(session: Session): {
88
+ schema_version: string;
89
+ id: string;
90
+ session_id: string;
91
+ recorded_at: string;
92
+ messages: {
93
+ id: string;
94
+ role: "tool";
95
+ timestamp: string;
96
+ content: string;
97
+ }[];
98
+ };
99
+ export declare class WorkflowStore {
100
+ readonly root: string;
101
+ private readonly db;
102
+ constructor(root: string);
103
+ close(): void;
104
+ find(id: string): Session | undefined;
105
+ status(id: string): {
106
+ orchestration_revision: number;
107
+ continuation: {
108
+ action: string;
109
+ run_id?: undefined;
110
+ decision_ref?: undefined;
111
+ } | {
112
+ action: string;
113
+ run_id: string;
114
+ decision_ref?: undefined;
115
+ } | {
116
+ action: string;
117
+ decision_ref: string | undefined;
118
+ run_id?: undefined;
119
+ };
120
+ schema_version: "evolve-session/1.0";
121
+ id: string;
122
+ objective: string;
123
+ definition_of_done: string;
124
+ status: "open" | "completed";
125
+ revision: number;
126
+ created_at: string;
127
+ completed_at?: string;
128
+ steps: Step[];
129
+ runs: Run[];
130
+ aliases: Record<string, string>;
131
+ artifacts: Record<string, Artifact>;
132
+ };
133
+ list(): {
134
+ id: string;
135
+ objective: string;
136
+ status: "completed" | "open";
137
+ orchestration_revision: number;
138
+ steps: Step[];
139
+ continuation: {
140
+ action: string;
141
+ run_id?: undefined;
142
+ decision_ref?: undefined;
143
+ } | {
144
+ action: string;
145
+ run_id: string;
146
+ decision_ref?: undefined;
147
+ } | {
148
+ action: string;
149
+ decision_ref: string | undefined;
150
+ run_id?: undefined;
151
+ };
152
+ }[];
153
+ private save;
154
+ private change;
155
+ private mutate;
156
+ open(id: string, objective: string, definition: string, steps: WorkflowStep[], change: Mutation): {
157
+ session_id: string;
158
+ status: string;
159
+ orchestration_revision: number;
160
+ continuation: {
161
+ action: string;
162
+ run_id?: undefined;
163
+ decision_ref?: undefined;
164
+ } | {
165
+ action: string;
166
+ run_id: string;
167
+ decision_ref?: undefined;
168
+ } | {
169
+ action: string;
170
+ decision_ref: string | undefined;
171
+ run_id?: undefined;
172
+ };
173
+ } & {
174
+ receipt: {
175
+ request_id: string;
176
+ action: string;
177
+ actor: string;
178
+ recorded_at: string;
179
+ evidence: string[];
180
+ reason?: string;
181
+ };
182
+ };
183
+ private validateStep;
184
+ amend(id: string, objective: string, definition: string | undefined, change: Mutation): {
185
+ previous_objective: string;
186
+ objective: string;
187
+ definition_of_done: string;
188
+ } & {
189
+ session_id: string;
190
+ orchestration_revision: number;
191
+ continuation: {
192
+ action: string;
193
+ run_id?: undefined;
194
+ decision_ref?: undefined;
195
+ } | {
196
+ action: string;
197
+ run_id: string;
198
+ decision_ref?: undefined;
199
+ } | {
200
+ action: string;
201
+ decision_ref: string | undefined;
202
+ run_id?: undefined;
203
+ };
204
+ } & {
205
+ receipt: {
206
+ request_id: string;
207
+ action: string;
208
+ actor: string;
209
+ recorded_at: string;
210
+ evidence: string[];
211
+ reason?: string;
212
+ };
213
+ };
214
+ chain(id: string, action: 'insert' | 'replace' | 'skip', step: WorkflowStep, after: string | undefined, change: Mutation): {
215
+ step_id: string;
216
+ status: string;
217
+ } & {
218
+ session_id: string;
219
+ orchestration_revision: number;
220
+ continuation: {
221
+ action: string;
222
+ run_id?: undefined;
223
+ decision_ref?: undefined;
224
+ } | {
225
+ action: string;
226
+ run_id: string;
227
+ decision_ref?: undefined;
228
+ } | {
229
+ action: string;
230
+ decision_ref: string | undefined;
231
+ run_id?: undefined;
232
+ };
233
+ } & {
234
+ receipt: {
235
+ request_id: string;
236
+ action: string;
237
+ actor: string;
238
+ recorded_at: string;
239
+ evidence: string[];
240
+ reason?: string;
241
+ };
242
+ };
243
+ private runDir;
244
+ private packet;
245
+ next(id: string, change: Mutation, gates?: string[], stepId?: string): {
246
+ session_id: string;
247
+ run_id: string;
248
+ run_dir: string;
249
+ status: RunStatus;
250
+ revision: number;
251
+ orchestration_revision: number;
252
+ task: {
253
+ input_refs: string[];
254
+ command: string;
255
+ args: string[];
256
+ goal: string;
257
+ };
258
+ skill_ref: WorkflowSkill;
259
+ gates: {
260
+ entry: string[];
261
+ exit: string[];
262
+ };
263
+ upstream_aliases: Record<string, string>;
264
+ upstream: {
265
+ [k: string]: Artifact;
266
+ };
267
+ skill_reads: {
268
+ reference: WorkflowSkill;
269
+ reads: {
270
+ path: string;
271
+ sha256: string;
272
+ }[];
273
+ missing: string[];
274
+ };
275
+ retry_of_run_id: string | undefined;
276
+ } & {
277
+ session_id: string;
278
+ orchestration_revision: number;
279
+ continuation: {
280
+ action: string;
281
+ run_id?: undefined;
282
+ decision_ref?: undefined;
283
+ } | {
284
+ action: string;
285
+ run_id: string;
286
+ decision_ref?: undefined;
287
+ } | {
288
+ action: string;
289
+ decision_ref: string | undefined;
290
+ run_id?: undefined;
291
+ };
292
+ } & {
293
+ receipt: {
294
+ request_id: string;
295
+ action: string;
296
+ actor: string;
297
+ recorded_at: string;
298
+ evidence: string[];
299
+ reason?: string;
300
+ };
301
+ };
302
+ brief(id: string, runId: string): {
303
+ continuation: {
304
+ action: string;
305
+ run_id?: undefined;
306
+ decision_ref?: undefined;
307
+ } | {
308
+ action: string;
309
+ run_id: string;
310
+ decision_ref?: undefined;
311
+ } | {
312
+ action: string;
313
+ decision_ref: string | undefined;
314
+ run_id?: undefined;
315
+ };
316
+ session_id: string;
317
+ run_id: string;
318
+ run_dir: string;
319
+ status: RunStatus;
320
+ revision: number;
321
+ orchestration_revision: number;
322
+ task: {
323
+ input_refs: string[];
324
+ command: string;
325
+ args: string[];
326
+ goal: string;
327
+ };
328
+ skill_ref: WorkflowSkill;
329
+ gates: {
330
+ entry: string[];
331
+ exit: string[];
332
+ };
333
+ upstream_aliases: Record<string, string>;
334
+ upstream: {
335
+ [k: string]: Artifact;
336
+ };
337
+ skill_reads: {
338
+ reference: WorkflowSkill;
339
+ reads: {
340
+ path: string;
341
+ sha256: string;
342
+ }[];
343
+ missing: string[];
344
+ };
345
+ retry_of_run_id: string | undefined;
346
+ };
347
+ readSkill(id: string, runId: string, from?: string, destination?: string): {
348
+ recorded: boolean;
349
+ path: string;
350
+ markdown: string;
351
+ sha256: string;
352
+ };
353
+ readArtifact(id: string, runId: string, artifactId: string, scope?: WikiLookupScope): {
354
+ content: string;
355
+ id: string;
356
+ path: string;
357
+ run_id: string;
358
+ sha256: string;
359
+ derived_from: string[];
360
+ status: "sealed";
361
+ wiki_priors?: true;
362
+ kind: string;
363
+ schema: string;
364
+ role: string;
365
+ alias?: string;
366
+ };
367
+ private readProof;
368
+ private outputs;
369
+ check(id: string, runId: string, gates: string[]): {
370
+ completion_preflight: {
371
+ ready: boolean;
372
+ errors: string[];
373
+ };
374
+ knowledge_reads: KnowledgeReadsReceipt | undefined;
375
+ session_id: string;
376
+ run_id: string;
377
+ run_dir: string;
378
+ status: RunStatus;
379
+ revision: number;
380
+ orchestration_revision: number;
381
+ task: {
382
+ input_refs: string[];
383
+ command: string;
384
+ args: string[];
385
+ goal: string;
386
+ };
387
+ skill_ref: WorkflowSkill;
388
+ gates: {
389
+ entry: string[];
390
+ exit: string[];
391
+ };
392
+ upstream_aliases: Record<string, string>;
393
+ upstream: {
394
+ [k: string]: Artifact;
395
+ };
396
+ skill_reads: {
397
+ reference: WorkflowSkill;
398
+ reads: {
399
+ path: string;
400
+ sha256: string;
401
+ }[];
402
+ missing: string[];
403
+ };
404
+ retry_of_run_id: string | undefined;
405
+ };
406
+ completeRun(id: string, runId: string, summary: string, verdict: 'done' | 'done_with_concerns', gates: string[], change: Mutation): {
407
+ artifact_publication: {
408
+ artifacts: Record<string, Artifact>;
409
+ aliases: Record<string, string>;
410
+ };
411
+ knowledge_reads: KnowledgeReadsReceipt | undefined;
412
+ session_id: string;
413
+ run_id: string;
414
+ run_dir: string;
415
+ status: RunStatus;
416
+ revision: number;
417
+ orchestration_revision: number;
418
+ task: {
419
+ input_refs: string[];
420
+ command: string;
421
+ args: string[];
422
+ goal: string;
423
+ };
424
+ skill_ref: WorkflowSkill;
425
+ gates: {
426
+ entry: string[];
427
+ exit: string[];
428
+ };
429
+ upstream_aliases: Record<string, string>;
430
+ upstream: {
431
+ [k: string]: Artifact;
432
+ };
433
+ skill_reads: {
434
+ reference: WorkflowSkill;
435
+ reads: {
436
+ path: string;
437
+ sha256: string;
438
+ }[];
439
+ missing: string[];
440
+ };
441
+ retry_of_run_id: string | undefined;
442
+ } & {
443
+ session_id: string;
444
+ orchestration_revision: number;
445
+ continuation: {
446
+ action: string;
447
+ run_id?: undefined;
448
+ decision_ref?: undefined;
449
+ } | {
450
+ action: string;
451
+ run_id: string;
452
+ decision_ref?: undefined;
453
+ } | {
454
+ action: string;
455
+ decision_ref: string | undefined;
456
+ run_id?: undefined;
457
+ };
458
+ } & {
459
+ receipt: {
460
+ request_id: string;
461
+ action: string;
462
+ actor: string;
463
+ recorded_at: string;
464
+ evidence: string[];
465
+ reason?: string;
466
+ };
467
+ };
468
+ transition(id: string, runId: string, status: 'running' | 'blocked' | 'failed' | 'cancelled', reason: string, change: Mutation): {
469
+ session_id: string;
470
+ run_id: string;
471
+ run_dir: string;
472
+ status: RunStatus;
473
+ revision: number;
474
+ orchestration_revision: number;
475
+ task: {
476
+ input_refs: string[];
477
+ command: string;
478
+ args: string[];
479
+ goal: string;
480
+ };
481
+ skill_ref: WorkflowSkill;
482
+ gates: {
483
+ entry: string[];
484
+ exit: string[];
485
+ };
486
+ upstream_aliases: Record<string, string>;
487
+ upstream: {
488
+ [k: string]: Artifact;
489
+ };
490
+ skill_reads: {
491
+ reference: WorkflowSkill;
492
+ reads: {
493
+ path: string;
494
+ sha256: string;
495
+ }[];
496
+ missing: string[];
497
+ };
498
+ retry_of_run_id: string | undefined;
499
+ } & {
500
+ session_id: string;
501
+ orchestration_revision: number;
502
+ continuation: {
503
+ action: string;
504
+ run_id?: undefined;
505
+ decision_ref?: undefined;
506
+ } | {
507
+ action: string;
508
+ run_id: string;
509
+ decision_ref?: undefined;
510
+ } | {
511
+ action: string;
512
+ decision_ref: string | undefined;
513
+ run_id?: undefined;
514
+ };
515
+ } & {
516
+ receipt: {
517
+ request_id: string;
518
+ action: string;
519
+ actor: string;
520
+ recorded_at: string;
521
+ evidence: string[];
522
+ reason?: string;
523
+ };
524
+ };
525
+ decide(id: string, decisionId: string, verdict: 'proceed' | 'fix' | 'escalate', summary: string, change: Mutation): {
526
+ decision_ref: string;
527
+ verdict: "proceed" | "fix" | "escalate";
528
+ summary: string;
529
+ } & {
530
+ session_id: string;
531
+ orchestration_revision: number;
532
+ continuation: {
533
+ action: string;
534
+ run_id?: undefined;
535
+ decision_ref?: undefined;
536
+ } | {
537
+ action: string;
538
+ run_id: string;
539
+ decision_ref?: undefined;
540
+ } | {
541
+ action: string;
542
+ decision_ref: string | undefined;
543
+ run_id?: undefined;
544
+ };
545
+ } & {
546
+ receipt: {
547
+ request_id: string;
548
+ action: string;
549
+ actor: string;
550
+ recorded_at: string;
551
+ evidence: string[];
552
+ reason?: string;
553
+ };
554
+ };
555
+ completeSession(id: string, change: Mutation): {
556
+ status: "completed";
557
+ completed_at: string;
558
+ completion_id: string;
559
+ } & {
560
+ session_id: string;
561
+ orchestration_revision: number;
562
+ continuation: {
563
+ action: string;
564
+ run_id?: undefined;
565
+ decision_ref?: undefined;
566
+ } | {
567
+ action: string;
568
+ run_id: string;
569
+ decision_ref?: undefined;
570
+ } | {
571
+ action: string;
572
+ decision_ref: string | undefined;
573
+ run_id?: undefined;
574
+ };
575
+ } & {
576
+ receipt: {
577
+ request_id: string;
578
+ action: string;
579
+ actor: string;
580
+ recorded_at: string;
581
+ evidence: string[];
582
+ reason?: string;
583
+ };
584
+ };
585
+ team(id: string, runId: string, action: 'assign' | 'report' | 'cancel', assignment: Assignment, change: Mutation): {
586
+ run_id: string;
587
+ assignment: Assignment;
588
+ } & {
589
+ session_id: string;
590
+ orchestration_revision: number;
591
+ continuation: {
592
+ action: string;
593
+ run_id?: undefined;
594
+ decision_ref?: undefined;
595
+ } | {
596
+ action: string;
597
+ run_id: string;
598
+ decision_ref?: undefined;
599
+ } | {
600
+ action: string;
601
+ decision_ref: string | undefined;
602
+ run_id?: undefined;
603
+ };
604
+ } & {
605
+ receipt: {
606
+ request_id: string;
607
+ action: string;
608
+ actor: string;
609
+ recorded_at: string;
610
+ evidence: string[];
611
+ reason?: string;
612
+ };
613
+ };
614
+ teamList(id: string, runId: string): Assignment[];
615
+ swarmController(id: string, runId: string): {
616
+ controller_dir: string;
617
+ script: string;
618
+ config_template: string;
619
+ };
620
+ recordKnowledge(id: string, runId: string, update: (trace: KnowledgeReads, pin: (prior: Omit<WikiPrior, 'content_sha256'>) => void) => void): KnowledgeReadsReceipt;
621
+ }
622
+ export {};