specrails-core 6.0.0 → 6.1.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 (173) hide show
  1. package/README.md +1 -1
  2. package/dist/agent-runtime/capabilities.js +3 -1
  3. package/dist/agent-runtime/change-scope.d.ts +63 -0
  4. package/dist/agent-runtime/change-scope.js +297 -0
  5. package/dist/agent-runtime/cli-executor.d.ts +3 -0
  6. package/dist/agent-runtime/cli-executor.js +50 -13
  7. package/dist/agent-runtime/cli-process.js +6 -2
  8. package/dist/agent-runtime/cli.d.ts +15 -0
  9. package/dist/agent-runtime/cli.js +43 -9
  10. package/dist/agent-runtime/compact/chat-client.js +2 -1
  11. package/dist/agent-runtime/compact/environment.d.ts +12 -0
  12. package/dist/agent-runtime/compact/environment.js +31 -1
  13. package/dist/agent-runtime/compact/test-reachability.js +6 -2
  14. package/dist/agent-runtime/config.d.ts +4 -1
  15. package/dist/agent-runtime/config.js +41 -3
  16. package/dist/agent-runtime/core-host.d.ts +10 -4
  17. package/dist/agent-runtime/core-host.js +22 -19
  18. package/dist/agent-runtime/efficiency-summary.d.ts +4 -1
  19. package/dist/agent-runtime/efficiency-summary.js +30 -27
  20. package/dist/agent-runtime/efficiency-types.d.ts +4 -4
  21. package/dist/agent-runtime/efficiency.d.ts +1 -1
  22. package/dist/agent-runtime/efficiency.js +7 -6
  23. package/dist/agent-runtime/engine/__fixtures__/implementation-component.json +90 -0
  24. package/dist/agent-runtime/engine/__fixtures__/implementation-fixture.d.ts +11 -0
  25. package/dist/agent-runtime/engine/__fixtures__/implementation-fixture.js +60 -0
  26. package/dist/agent-runtime/engine/__fixtures__/implementation.json +43 -0
  27. package/dist/agent-runtime/engine/budget.d.ts +9 -0
  28. package/dist/agent-runtime/engine/budget.js +33 -0
  29. package/dist/agent-runtime/engine/canonical-json.d.ts +9 -0
  30. package/dist/agent-runtime/engine/canonical-json.js +162 -0
  31. package/dist/agent-runtime/engine/checkpoint/database.d.ts +67 -0
  32. package/dist/agent-runtime/engine/checkpoint/database.js +304 -0
  33. package/dist/agent-runtime/engine/checkpoint/lease.d.ts +17 -0
  34. package/dist/agent-runtime/engine/checkpoint/lease.js +82 -0
  35. package/dist/agent-runtime/engine/checkpoint/ledger.d.ts +133 -0
  36. package/dist/agent-runtime/engine/checkpoint/ledger.js +510 -0
  37. package/dist/agent-runtime/engine/checkpoint/saver.d.ts +25 -0
  38. package/dist/agent-runtime/engine/checkpoint/saver.js +146 -0
  39. package/dist/agent-runtime/engine/cli.d.ts +10 -0
  40. package/dist/agent-runtime/engine/cli.js +172 -0
  41. package/dist/agent-runtime/engine/compiler.d.ts +23 -0
  42. package/dist/agent-runtime/engine/compiler.js +261 -0
  43. package/dist/agent-runtime/engine/composition.d.ts +16 -0
  44. package/dist/agent-runtime/engine/composition.js +28 -0
  45. package/dist/agent-runtime/engine/concurrency.d.ts +14 -0
  46. package/dist/agent-runtime/engine/concurrency.js +55 -0
  47. package/dist/agent-runtime/engine/contracts.d.ts +273 -0
  48. package/dist/agent-runtime/engine/contracts.js +11 -0
  49. package/dist/agent-runtime/engine/definition-schema.d.ts +250 -0
  50. package/dist/agent-runtime/engine/definition-schema.js +313 -0
  51. package/dist/agent-runtime/engine/definition-types.d.ts +84 -0
  52. package/dist/agent-runtime/engine/definition-types.js +3 -0
  53. package/dist/agent-runtime/engine/definition-validator.d.ts +7 -0
  54. package/dist/agent-runtime/engine/definition-validator.js +187 -0
  55. package/dist/agent-runtime/engine/efficiency-summary.d.ts +62 -0
  56. package/dist/agent-runtime/engine/efficiency-summary.js +31 -0
  57. package/dist/agent-runtime/engine/events.d.ts +19 -0
  58. package/dist/agent-runtime/engine/events.js +88 -0
  59. package/dist/agent-runtime/engine/execution.d.ts +29 -0
  60. package/dist/agent-runtime/engine/execution.js +121 -0
  61. package/dist/agent-runtime/engine/expressions.d.ts +11 -0
  62. package/dist/agent-runtime/engine/expressions.js +172 -0
  63. package/dist/agent-runtime/engine/fork.d.ts +28 -0
  64. package/dist/agent-runtime/engine/fork.js +211 -0
  65. package/dist/agent-runtime/engine/graph-description.d.ts +48 -0
  66. package/dist/agent-runtime/engine/graph-description.js +16 -0
  67. package/dist/agent-runtime/engine/implementation-compiler.d.ts +214 -0
  68. package/dist/agent-runtime/engine/implementation-compiler.js +91 -0
  69. package/dist/agent-runtime/engine/index.d.ts +14 -0
  70. package/dist/agent-runtime/engine/index.js +14 -0
  71. package/dist/agent-runtime/engine/invocation-context.d.ts +11 -0
  72. package/dist/agent-runtime/engine/invocation-context.js +128 -0
  73. package/dist/agent-runtime/engine/otel.d.ts +15 -0
  74. package/dist/agent-runtime/engine/otel.js +132 -0
  75. package/dist/agent-runtime/engine/output.d.ts +4 -0
  76. package/dist/agent-runtime/engine/output.js +73 -0
  77. package/dist/agent-runtime/engine/piece-dependencies.d.ts +50 -0
  78. package/dist/agent-runtime/engine/piece-dependencies.js +193 -0
  79. package/dist/agent-runtime/engine/piece-registry.d.ts +19 -0
  80. package/dist/agent-runtime/engine/piece-registry.js +62 -0
  81. package/dist/agent-runtime/engine/pieces/assign.d.ts +4 -0
  82. package/dist/agent-runtime/engine/pieces/assign.js +35 -0
  83. package/dist/agent-runtime/engine/pieces/control.d.ts +5 -0
  84. package/dist/agent-runtime/engine/pieces/control.js +49 -0
  85. package/dist/agent-runtime/engine/pieces/decider.d.ts +5 -0
  86. package/dist/agent-runtime/engine/pieces/decider.js +70 -0
  87. package/dist/agent-runtime/engine/pieces/implementation-binding.d.ts +12 -0
  88. package/dist/agent-runtime/engine/pieces/implementation-binding.js +40 -0
  89. package/dist/agent-runtime/engine/pieces/implementation-journal.d.ts +25 -0
  90. package/dist/agent-runtime/engine/pieces/implementation-journal.js +192 -0
  91. package/dist/agent-runtime/engine/pieces/implementation.d.ts +23 -0
  92. package/dist/agent-runtime/engine/pieces/implementation.js +176 -0
  93. package/dist/agent-runtime/engine/pieces/index.d.ts +7 -0
  94. package/dist/agent-runtime/engine/pieces/index.js +22 -0
  95. package/dist/agent-runtime/engine/pieces/openspec.d.ts +3 -0
  96. package/dist/agent-runtime/engine/pieces/openspec.js +69 -0
  97. package/dist/agent-runtime/engine/pieces/ports.d.ts +48 -0
  98. package/dist/agent-runtime/engine/pieces/ports.js +1 -0
  99. package/dist/agent-runtime/engine/pieces/project-memory.d.ts +3 -0
  100. package/dist/agent-runtime/engine/pieces/project-memory.js +13 -0
  101. package/dist/agent-runtime/engine/pieces/prompt.d.ts +5 -0
  102. package/dist/agent-runtime/engine/pieces/prompt.js +130 -0
  103. package/dist/agent-runtime/engine/pieces/role-turn.d.ts +7 -0
  104. package/dist/agent-runtime/engine/pieces/role-turn.js +73 -0
  105. package/dist/agent-runtime/engine/pieces/shared.d.ts +67 -0
  106. package/dist/agent-runtime/engine/pieces/shared.js +40 -0
  107. package/dist/agent-runtime/engine/pieces/shell.d.ts +6 -0
  108. package/dist/agent-runtime/engine/pieces/shell.js +47 -0
  109. package/dist/agent-runtime/engine/pieces/verify.d.ts +7 -0
  110. package/dist/agent-runtime/engine/pieces/verify.js +52 -0
  111. package/dist/agent-runtime/engine/preflight.d.ts +27 -0
  112. package/dist/agent-runtime/engine/preflight.js +54 -0
  113. package/dist/agent-runtime/engine/regex.d.ts +3 -0
  114. package/dist/agent-runtime/engine/regex.js +19 -0
  115. package/dist/agent-runtime/engine/run-status.d.ts +563 -0
  116. package/dist/agent-runtime/engine/run-status.js +61 -0
  117. package/dist/agent-runtime/engine/runs.d.ts +605 -0
  118. package/dist/agent-runtime/engine/runs.js +247 -0
  119. package/dist/agent-runtime/engine/state.d.ts +64 -0
  120. package/dist/agent-runtime/engine/state.js +98 -0
  121. package/dist/agent-runtime/engine/steering/inbox.d.ts +54 -0
  122. package/dist/agent-runtime/engine/steering/inbox.js +113 -0
  123. package/dist/agent-runtime/engine/storage/fork-allocation.d.ts +21 -0
  124. package/dist/agent-runtime/engine/storage/fork-allocation.js +143 -0
  125. package/dist/agent-runtime/engine/storage/private-path.d.ts +11 -0
  126. package/dist/agent-runtime/engine/storage/private-path.js +74 -0
  127. package/dist/agent-runtime/engine/store/sqlite-store.d.ts +26 -0
  128. package/dist/agent-runtime/engine/store/sqlite-store.js +227 -0
  129. package/dist/agent-runtime/evaluation-corpus.d.ts +125 -0
  130. package/dist/agent-runtime/evaluation-corpus.js +4 -0
  131. package/dist/agent-runtime/evaluation.d.ts +9 -3
  132. package/dist/agent-runtime/evaluation.js +50 -8
  133. package/dist/agent-runtime/executor-types.d.ts +53 -3
  134. package/dist/agent-runtime/executor-types.js +35 -2
  135. package/dist/agent-runtime/executors.js +2 -2
  136. package/dist/agent-runtime/graph/artifacts.d.ts +7 -0
  137. package/dist/agent-runtime/graph/artifacts.js +86 -10
  138. package/dist/agent-runtime/graph/convergence.d.ts +26 -0
  139. package/dist/agent-runtime/graph/convergence.js +62 -0
  140. package/dist/agent-runtime/graph/nodes.d.ts +2 -0
  141. package/dist/agent-runtime/graph/nodes.js +171 -24
  142. package/dist/agent-runtime/graph/roles.d.ts +6 -0
  143. package/dist/agent-runtime/graph/roles.js +23 -17
  144. package/dist/agent-runtime/graph/state.d.ts +5 -0
  145. package/dist/agent-runtime/graph/state.js +2 -0
  146. package/dist/agent-runtime/kimi-acp.js +6 -6
  147. package/dist/agent-runtime/openai-executor.js +17 -12
  148. package/dist/agent-runtime/openspec.d.ts +17 -2
  149. package/dist/agent-runtime/openspec.js +54 -20
  150. package/dist/agent-runtime/prompts.d.ts +11 -5
  151. package/dist/agent-runtime/prompts.js +71 -20
  152. package/dist/agent-runtime/recovery.d.ts +1 -1
  153. package/dist/agent-runtime/repository-context.js +20 -1
  154. package/dist/agent-runtime/role-routing.js +4 -2
  155. package/dist/agent-runtime/role-state.d.ts +5 -0
  156. package/dist/agent-runtime/verification-plan.d.ts +2 -0
  157. package/dist/agent-runtime/verification-plan.js +18 -3
  158. package/dist/agent-runtime/workflow-types.d.ts +2 -0
  159. package/dist/agent-runtime/workflow.d.ts +3 -1
  160. package/dist/agent-runtime/workflow.js +7 -3
  161. package/dist/agent-runtime/workspace-tools.d.ts +2 -2
  162. package/dist/agent-runtime/workspace-tools.js +6 -6
  163. package/dist/installer/cli.js +5 -0
  164. package/dist/installer/phases/scaffold.d.ts +2 -2
  165. package/dist/installer/phases/scaffold.js +3 -7
  166. package/dist/pipeline/pipeline-state.d.ts +49 -4
  167. package/dist/pipeline/pipeline-state.js +150 -23
  168. package/integration-contract.json +84 -12
  169. package/package.json +12 -5
  170. package/schemas/agent-runtime.schema.json +93 -1
  171. package/schemas/workflow-definition.schema.json +312 -0
  172. package/templates/kimi/specrails/run-skill.mjs +15 -1
  173. package/templates/commands/specrails/batch-implement.md +0 -32
@@ -0,0 +1,605 @@
1
+ import { type PipelineContext } from '../../pipeline/pipeline-state.js';
2
+ import type { RuntimeConfig } from '../executor-types.js';
3
+ import { type RuntimeIdentity } from '../runtime-identity.js';
4
+ import type { ExecutorRegistry } from '../executors.js';
5
+ import { type JsonObject, type JsonValue } from './contracts.js';
6
+ import { type DefinitionRunInput } from './preflight.js';
7
+ export declare const definitionRunDirectory: (context: PipelineContext) => string;
8
+ /** Frozen request shared with the legacy runtime (contracts.md section 9); `workflow.engine` selects the resume engine. */
9
+ export declare const frozenRequestFile: (context: PipelineContext) => string;
10
+ export interface FrozenWorkflowIdentity {
11
+ id: string;
12
+ version: string;
13
+ source: 'builtin' | 'definition';
14
+ definitionHash: string | null;
15
+ engine: 1 | 2;
16
+ }
17
+ export interface FrozenRunRequest {
18
+ change?: string;
19
+ config: RuntimeConfig;
20
+ runtimeIdentity: RuntimeIdentity;
21
+ workflow: FrozenWorkflowIdentity;
22
+ }
23
+ /** A request without the workflow block predates the contract and belongs to the legacy engine. */
24
+ export declare function frozenRequestEngine(request: unknown): 1 | 2 | undefined;
25
+ /** Materializes the frozen request of an existing definition run (fork destinations) so hosts recognize a programmatic run. */
26
+ export declare function freezeRunRequest(directory: string): Promise<string>;
27
+ export interface RunObservers {
28
+ signal?: AbortSignal;
29
+ onEvent?: (value: JsonObject) => void;
30
+ afterEvent?: number;
31
+ }
32
+ export interface ResumeDefinitionOptions extends RunObservers {
33
+ registry?: ExecutorRegistry;
34
+ answers?: Record<string, JsonValue>;
35
+ recover?: string[];
36
+ /** Optional frozen host context assertion prevents attaching another project's run. */
37
+ context?: PipelineContext;
38
+ }
39
+ export declare function createRun(input: DefinitionRunInput & RunObservers): Promise<{
40
+ error?: {
41
+ code: string;
42
+ message: string;
43
+ } | undefined;
44
+ metrics: import("../efficiency-types.js").RuntimeEfficiency;
45
+ efficiencySummary: {
46
+ reservations: {
47
+ pendingInvocations: number;
48
+ knownTokens: number;
49
+ knownCostUsd: number;
50
+ tokensUnknown: boolean;
51
+ costUnknown: boolean;
52
+ };
53
+ schemaVersion: 1;
54
+ currentEvidenceIds: string[];
55
+ planHash: string | null;
56
+ candidateHash: string | null;
57
+ runId: string;
58
+ workflowVersion: string;
59
+ technicalAcceptance: string;
60
+ archive: import("../../pipeline/pipeline-state.js").PhaseStatus;
61
+ delivery: "pending" | "complete" | "pending-host";
62
+ roles: {
63
+ role: string;
64
+ provider: string | null;
65
+ model: string | null;
66
+ effort: string | null;
67
+ observedModel: null;
68
+ observedEffort: null;
69
+ origin: string;
70
+ tier: "base" | "escalation";
71
+ }[];
72
+ invocations: {
73
+ byKind: {
74
+ [k: string]: number;
75
+ };
76
+ total: number;
77
+ complete: boolean;
78
+ promptBytes: number | null;
79
+ contextBytes: number | null;
80
+ handoffBytes: number | null;
81
+ fullContexts: number;
82
+ incrementalContexts: number;
83
+ };
84
+ escalations: {
85
+ role: string;
86
+ attemptId: string;
87
+ provider: string;
88
+ model: string | null;
89
+ effort: string | null;
90
+ reason: string | null;
91
+ }[];
92
+ escalationsTruncated: boolean;
93
+ checks: {
94
+ invalidated: number | null;
95
+ available: boolean;
96
+ complete: boolean;
97
+ executed: number | null;
98
+ reused: number | null;
99
+ notRun: number | null;
100
+ durationMs: number | null;
101
+ };
102
+ metrics: import("../efficiency-types.js").RuntimeEfficiency;
103
+ };
104
+ revision: number;
105
+ eventCursor: number;
106
+ forkOf?: string | undefined;
107
+ type: "runtime-status";
108
+ engineVersion: number;
109
+ state: {
110
+ nextNodePath: string;
111
+ nextStep: string;
112
+ steps: {
113
+ [k: string]: {
114
+ kind: string;
115
+ status: string;
116
+ visits: number;
117
+ };
118
+ };
119
+ scopes: {
120
+ output?: unknown;
121
+ nodePath: string;
122
+ scopeId: string;
123
+ branch: import("node:sqlite").SQLOutputValue;
124
+ kind: string;
125
+ status: string;
126
+ visits: number;
127
+ attemptId: string | null;
128
+ }[];
129
+ lease: {
130
+ owner: string;
131
+ epoch: number;
132
+ expiresAt: number;
133
+ active: boolean;
134
+ } | null;
135
+ recoverableSteps: {
136
+ nodePath: string;
137
+ scopeId: string;
138
+ attemptId: string;
139
+ status: string;
140
+ effect: "write";
141
+ }[];
142
+ steering: {
143
+ receipts: import("./steering/inbox.js").SteeringReceipt[];
144
+ pending: number;
145
+ consumed: number;
146
+ truncated: boolean;
147
+ consumptionReported: true;
148
+ };
149
+ reservations: {
150
+ pendingInvocations: number;
151
+ knownTokens: number;
152
+ knownCostUsd: number;
153
+ tokensUnknown: boolean;
154
+ costUnknown: boolean;
155
+ };
156
+ pendingInterrupts: {
157
+ id: string;
158
+ nodePath: string;
159
+ scopeId: string;
160
+ branchId?: string;
161
+ attemptId: string;
162
+ kind: string;
163
+ requestedAt: string;
164
+ value: JsonValue;
165
+ answer?: JsonValue;
166
+ }[];
167
+ recentFailures: {
168
+ nodePath: import("node:sqlite").SQLOutputValue;
169
+ scopeId: import("node:sqlite").SQLOutputValue;
170
+ branch: import("node:sqlite").SQLOutputValue;
171
+ status: import("node:sqlite").SQLOutputValue;
172
+ attempt: import("node:sqlite").SQLOutputValue;
173
+ visit: import("node:sqlite").SQLOutputValue;
174
+ at: import("node:sqlite").SQLOutputValue;
175
+ error: {
176
+ code: import("node:sqlite").SQLOutputValue;
177
+ message: string;
178
+ };
179
+ }[];
180
+ schemaVersion: 2;
181
+ runId: string;
182
+ traceId: string;
183
+ workflowId: string;
184
+ workflowVersion: string;
185
+ workflowFingerprint: string;
186
+ inputFingerprint: string;
187
+ status: import("../workflow-types.js").WorkflowStatus;
188
+ createdAt: string;
189
+ updatedAt: string;
190
+ nextAttempt: number;
191
+ transitions: number;
192
+ executionCount: number;
193
+ history: import("../workflow-types.js").StepAttemptRecord[];
194
+ events: import("../workflow-types.js").WorkflowEvent[];
195
+ budget: import("./contracts.js").WorkflowBudget;
196
+ usage: {
197
+ costUsd: number | null;
198
+ inputTokens: number | null;
199
+ outputTokens: number | null;
200
+ knownCostUsd: number;
201
+ knownTokens: number;
202
+ durationMs: number;
203
+ };
204
+ pendingApproval?: {
205
+ stepId: string;
206
+ requestedAt: string;
207
+ grantedAt?: string;
208
+ reason?: string;
209
+ };
210
+ pendingQuestion?: {
211
+ stepId: string;
212
+ requestedAt: string;
213
+ question: string;
214
+ answeredAt?: string;
215
+ answer?: string;
216
+ };
217
+ error?: string;
218
+ } | {
219
+ nextNodePath: string;
220
+ nextStep: string;
221
+ steps: {
222
+ [k: string]: {
223
+ kind: string;
224
+ status: string;
225
+ visits: number;
226
+ };
227
+ };
228
+ scopes: {
229
+ output?: unknown;
230
+ nodePath: string;
231
+ scopeId: string;
232
+ branch: import("node:sqlite").SQLOutputValue;
233
+ kind: string;
234
+ status: string;
235
+ visits: number;
236
+ attemptId: string | null;
237
+ }[];
238
+ lease: {
239
+ owner: string;
240
+ epoch: number;
241
+ expiresAt: number;
242
+ active: boolean;
243
+ } | null;
244
+ recoverableSteps: {
245
+ nodePath: string;
246
+ scopeId: string;
247
+ attemptId: string;
248
+ status: string;
249
+ effect: "write";
250
+ }[];
251
+ steering: {
252
+ receipts: import("./steering/inbox.js").SteeringReceipt[];
253
+ pending: number;
254
+ consumed: number;
255
+ truncated: boolean;
256
+ consumptionReported: true;
257
+ };
258
+ reservations: {
259
+ pendingInvocations: number;
260
+ knownTokens: number;
261
+ knownCostUsd: number;
262
+ tokensUnknown: boolean;
263
+ costUnknown: boolean;
264
+ };
265
+ pendingInterrupts: {
266
+ id: string;
267
+ nodePath: string;
268
+ scopeId: string;
269
+ branchId?: string;
270
+ attemptId: string;
271
+ kind: string;
272
+ requestedAt: string;
273
+ value: JsonValue;
274
+ answer?: JsonValue;
275
+ }[];
276
+ recentFailures: {
277
+ nodePath: import("node:sqlite").SQLOutputValue;
278
+ scopeId: import("node:sqlite").SQLOutputValue;
279
+ branch: import("node:sqlite").SQLOutputValue;
280
+ status: import("node:sqlite").SQLOutputValue;
281
+ attempt: import("node:sqlite").SQLOutputValue;
282
+ visit: import("node:sqlite").SQLOutputValue;
283
+ at: import("node:sqlite").SQLOutputValue;
284
+ error: {
285
+ code: import("node:sqlite").SQLOutputValue;
286
+ message: string;
287
+ };
288
+ }[];
289
+ pendingQuestion?: {
290
+ stepId: string;
291
+ requestedAt: string;
292
+ question: string;
293
+ answeredAt?: string;
294
+ answer?: string;
295
+ } | undefined;
296
+ pendingApproval?: {
297
+ stepId: string;
298
+ requestedAt: string;
299
+ grantedAt?: string;
300
+ reason?: string;
301
+ } | undefined;
302
+ runId: string;
303
+ traceId: string;
304
+ status: import("../workflow-types.js").WorkflowStatus;
305
+ updatedAt: string;
306
+ usage: {
307
+ costUsd: number | null;
308
+ inputTokens: number | null;
309
+ outputTokens: number | null;
310
+ knownCostUsd: number;
311
+ knownTokens: number;
312
+ durationMs: number;
313
+ };
314
+ };
315
+ workflow: {
316
+ id: string;
317
+ version: string;
318
+ source: string;
319
+ };
320
+ completion: any;
321
+ }>;
322
+ export declare function resumeRun(directory: string, options?: ResumeDefinitionOptions): Promise<{
323
+ metrics: import("../efficiency-types.js").RuntimeEfficiency;
324
+ efficiencySummary: {
325
+ reservations: {
326
+ pendingInvocations: number;
327
+ knownTokens: number;
328
+ knownCostUsd: number;
329
+ tokensUnknown: boolean;
330
+ costUnknown: boolean;
331
+ };
332
+ schemaVersion: 1;
333
+ currentEvidenceIds: string[];
334
+ planHash: string | null;
335
+ candidateHash: string | null;
336
+ runId: string;
337
+ workflowVersion: string;
338
+ technicalAcceptance: string;
339
+ archive: import("../../pipeline/pipeline-state.js").PhaseStatus;
340
+ delivery: "pending" | "complete" | "pending-host";
341
+ roles: {
342
+ role: string;
343
+ provider: string | null;
344
+ model: string | null;
345
+ effort: string | null;
346
+ observedModel: null;
347
+ observedEffort: null;
348
+ origin: string;
349
+ tier: "base" | "escalation";
350
+ }[];
351
+ invocations: {
352
+ byKind: {
353
+ [k: string]: number;
354
+ };
355
+ total: number;
356
+ complete: boolean;
357
+ promptBytes: number | null;
358
+ contextBytes: number | null;
359
+ handoffBytes: number | null;
360
+ fullContexts: number;
361
+ incrementalContexts: number;
362
+ };
363
+ escalations: {
364
+ role: string;
365
+ attemptId: string;
366
+ provider: string;
367
+ model: string | null;
368
+ effort: string | null;
369
+ reason: string | null;
370
+ }[];
371
+ escalationsTruncated: boolean;
372
+ checks: {
373
+ invalidated: number | null;
374
+ available: boolean;
375
+ complete: boolean;
376
+ executed: number | null;
377
+ reused: number | null;
378
+ notRun: number | null;
379
+ durationMs: number | null;
380
+ };
381
+ metrics: import("../efficiency-types.js").RuntimeEfficiency;
382
+ };
383
+ revision: number;
384
+ eventCursor: number;
385
+ forkOf?: string | undefined;
386
+ type: "runtime-status";
387
+ engineVersion: number;
388
+ state: {
389
+ nextNodePath: string;
390
+ nextStep: string;
391
+ steps: {
392
+ [k: string]: {
393
+ kind: string;
394
+ status: string;
395
+ visits: number;
396
+ };
397
+ };
398
+ scopes: {
399
+ output?: unknown;
400
+ nodePath: string;
401
+ scopeId: string;
402
+ branch: import("node:sqlite").SQLOutputValue;
403
+ kind: string;
404
+ status: string;
405
+ visits: number;
406
+ attemptId: string | null;
407
+ }[];
408
+ lease: {
409
+ owner: string;
410
+ epoch: number;
411
+ expiresAt: number;
412
+ active: boolean;
413
+ } | null;
414
+ recoverableSteps: {
415
+ nodePath: string;
416
+ scopeId: string;
417
+ attemptId: string;
418
+ status: string;
419
+ effect: "write";
420
+ }[];
421
+ steering: {
422
+ receipts: import("./steering/inbox.js").SteeringReceipt[];
423
+ pending: number;
424
+ consumed: number;
425
+ truncated: boolean;
426
+ consumptionReported: true;
427
+ };
428
+ reservations: {
429
+ pendingInvocations: number;
430
+ knownTokens: number;
431
+ knownCostUsd: number;
432
+ tokensUnknown: boolean;
433
+ costUnknown: boolean;
434
+ };
435
+ pendingInterrupts: {
436
+ id: string;
437
+ nodePath: string;
438
+ scopeId: string;
439
+ branchId?: string;
440
+ attemptId: string;
441
+ kind: string;
442
+ requestedAt: string;
443
+ value: JsonValue;
444
+ answer?: JsonValue;
445
+ }[];
446
+ recentFailures: {
447
+ nodePath: import("node:sqlite").SQLOutputValue;
448
+ scopeId: import("node:sqlite").SQLOutputValue;
449
+ branch: import("node:sqlite").SQLOutputValue;
450
+ status: import("node:sqlite").SQLOutputValue;
451
+ attempt: import("node:sqlite").SQLOutputValue;
452
+ visit: import("node:sqlite").SQLOutputValue;
453
+ at: import("node:sqlite").SQLOutputValue;
454
+ error: {
455
+ code: import("node:sqlite").SQLOutputValue;
456
+ message: string;
457
+ };
458
+ }[];
459
+ schemaVersion: 2;
460
+ runId: string;
461
+ traceId: string;
462
+ workflowId: string;
463
+ workflowVersion: string;
464
+ workflowFingerprint: string;
465
+ inputFingerprint: string;
466
+ status: import("../workflow-types.js").WorkflowStatus;
467
+ createdAt: string;
468
+ updatedAt: string;
469
+ nextAttempt: number;
470
+ transitions: number;
471
+ executionCount: number;
472
+ history: import("../workflow-types.js").StepAttemptRecord[];
473
+ events: import("../workflow-types.js").WorkflowEvent[];
474
+ budget: import("./contracts.js").WorkflowBudget;
475
+ usage: {
476
+ costUsd: number | null;
477
+ inputTokens: number | null;
478
+ outputTokens: number | null;
479
+ knownCostUsd: number;
480
+ knownTokens: number;
481
+ durationMs: number;
482
+ };
483
+ pendingApproval?: {
484
+ stepId: string;
485
+ requestedAt: string;
486
+ grantedAt?: string;
487
+ reason?: string;
488
+ };
489
+ pendingQuestion?: {
490
+ stepId: string;
491
+ requestedAt: string;
492
+ question: string;
493
+ answeredAt?: string;
494
+ answer?: string;
495
+ };
496
+ error?: string;
497
+ } | {
498
+ nextNodePath: string;
499
+ nextStep: string;
500
+ steps: {
501
+ [k: string]: {
502
+ kind: string;
503
+ status: string;
504
+ visits: number;
505
+ };
506
+ };
507
+ scopes: {
508
+ output?: unknown;
509
+ nodePath: string;
510
+ scopeId: string;
511
+ branch: import("node:sqlite").SQLOutputValue;
512
+ kind: string;
513
+ status: string;
514
+ visits: number;
515
+ attemptId: string | null;
516
+ }[];
517
+ lease: {
518
+ owner: string;
519
+ epoch: number;
520
+ expiresAt: number;
521
+ active: boolean;
522
+ } | null;
523
+ recoverableSteps: {
524
+ nodePath: string;
525
+ scopeId: string;
526
+ attemptId: string;
527
+ status: string;
528
+ effect: "write";
529
+ }[];
530
+ steering: {
531
+ receipts: import("./steering/inbox.js").SteeringReceipt[];
532
+ pending: number;
533
+ consumed: number;
534
+ truncated: boolean;
535
+ consumptionReported: true;
536
+ };
537
+ reservations: {
538
+ pendingInvocations: number;
539
+ knownTokens: number;
540
+ knownCostUsd: number;
541
+ tokensUnknown: boolean;
542
+ costUnknown: boolean;
543
+ };
544
+ pendingInterrupts: {
545
+ id: string;
546
+ nodePath: string;
547
+ scopeId: string;
548
+ branchId?: string;
549
+ attemptId: string;
550
+ kind: string;
551
+ requestedAt: string;
552
+ value: JsonValue;
553
+ answer?: JsonValue;
554
+ }[];
555
+ recentFailures: {
556
+ nodePath: import("node:sqlite").SQLOutputValue;
557
+ scopeId: import("node:sqlite").SQLOutputValue;
558
+ branch: import("node:sqlite").SQLOutputValue;
559
+ status: import("node:sqlite").SQLOutputValue;
560
+ attempt: import("node:sqlite").SQLOutputValue;
561
+ visit: import("node:sqlite").SQLOutputValue;
562
+ at: import("node:sqlite").SQLOutputValue;
563
+ error: {
564
+ code: import("node:sqlite").SQLOutputValue;
565
+ message: string;
566
+ };
567
+ }[];
568
+ pendingQuestion?: {
569
+ stepId: string;
570
+ requestedAt: string;
571
+ question: string;
572
+ answeredAt?: string;
573
+ answer?: string;
574
+ } | undefined;
575
+ pendingApproval?: {
576
+ stepId: string;
577
+ requestedAt: string;
578
+ grantedAt?: string;
579
+ reason?: string;
580
+ } | undefined;
581
+ runId: string;
582
+ traceId: string;
583
+ status: import("../workflow-types.js").WorkflowStatus;
584
+ updatedAt: string;
585
+ usage: {
586
+ costUsd: number | null;
587
+ inputTokens: number | null;
588
+ outputTokens: number | null;
589
+ knownCostUsd: number;
590
+ knownTokens: number;
591
+ durationMs: number;
592
+ };
593
+ };
594
+ workflow: {
595
+ id: string;
596
+ version: string;
597
+ source: string;
598
+ };
599
+ completion: any;
600
+ }>;
601
+ export declare function signalRun(directory: string, text: string, requestId?: string): Promise<import("./steering/inbox.js").SteeringMessage>;
602
+ export declare function cancelRun(directory: string, requestId?: string): Promise<{
603
+ requestId: string;
604
+ createdAt: string;
605
+ }>;