@exaudeus/workrail 0.10.0 → 0.12.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 (90) hide show
  1. package/dist/config/feature-flags.js +1 -1
  2. package/dist/di/container.js +72 -0
  3. package/dist/di/tokens.d.ts +13 -0
  4. package/dist/di/tokens.js +13 -0
  5. package/dist/manifest.json +236 -100
  6. package/dist/mcp/error-mapper.d.ts +3 -8
  7. package/dist/mcp/error-mapper.js +41 -19
  8. package/dist/mcp/handlers/session.js +25 -11
  9. package/dist/mcp/handlers/v2-execution-helpers.d.ts +99 -0
  10. package/dist/mcp/handlers/v2-execution-helpers.js +249 -0
  11. package/dist/mcp/handlers/v2-execution.d.ts +4 -0
  12. package/dist/mcp/handlers/v2-execution.js +1061 -0
  13. package/dist/mcp/handlers/v2-workflow.js +7 -7
  14. package/dist/mcp/handlers/workflow.js +21 -12
  15. package/dist/mcp/index.d.ts +1 -1
  16. package/dist/mcp/index.js +4 -1
  17. package/dist/mcp/output-schemas.d.ts +411 -4
  18. package/dist/mcp/output-schemas.js +57 -1
  19. package/dist/mcp/server.d.ts +1 -1
  20. package/dist/mcp/server.js +57 -31
  21. package/dist/mcp/tool-descriptions.js +17 -0
  22. package/dist/mcp/tools.js +12 -0
  23. package/dist/mcp/types/tool-description-types.d.ts +1 -1
  24. package/dist/mcp/types/tool-description-types.js +2 -0
  25. package/dist/mcp/types.d.ts +38 -3
  26. package/dist/mcp/types.js +32 -3
  27. package/dist/mcp/v2/tool-registry.js +16 -1
  28. package/dist/mcp/v2/tools.d.ts +45 -0
  29. package/dist/mcp/v2/tools.js +21 -1
  30. package/dist/mcp/validation/workflow-next-prevalidate.d.ts +2 -3
  31. package/dist/mcp/validation/workflow-next-prevalidate.js +38 -27
  32. package/dist/runtime/brand.d.ts +1 -3
  33. package/dist/v2/durable-core/canonical/hashing.d.ts +3 -1
  34. package/dist/v2/durable-core/canonical/hashing.js +9 -0
  35. package/dist/v2/durable-core/ids/index.d.ts +6 -0
  36. package/dist/v2/durable-core/ids/index.js +12 -0
  37. package/dist/v2/durable-core/projections/snapshot-state.d.ts +3 -0
  38. package/dist/v2/durable-core/projections/snapshot-state.js +14 -0
  39. package/dist/v2/durable-core/schemas/compiled-workflow/index.d.ts +100 -6
  40. package/dist/v2/durable-core/schemas/compiled-workflow/index.js +18 -3
  41. package/dist/v2/durable-core/schemas/execution-snapshot/execution-snapshot.v1.d.ts +1042 -0
  42. package/dist/v2/durable-core/schemas/execution-snapshot/execution-snapshot.v1.js +119 -0
  43. package/dist/v2/durable-core/schemas/execution-snapshot/index.d.ts +4 -0
  44. package/dist/v2/durable-core/schemas/execution-snapshot/index.js +17 -0
  45. package/dist/v2/durable-core/schemas/execution-snapshot/step-instance-key.d.ts +21 -0
  46. package/dist/v2/durable-core/schemas/execution-snapshot/step-instance-key.js +67 -0
  47. package/dist/v2/durable-core/schemas/session/events.d.ts +80 -50
  48. package/dist/v2/durable-core/schemas/session/events.js +27 -9
  49. package/dist/v2/durable-core/schemas/session/manifest.d.ts +2 -2
  50. package/dist/v2/durable-core/tokens/base64url.d.ts +7 -0
  51. package/dist/v2/durable-core/tokens/base64url.js +16 -0
  52. package/dist/v2/durable-core/tokens/index.d.ts +9 -0
  53. package/dist/v2/durable-core/tokens/index.js +23 -0
  54. package/dist/v2/durable-core/tokens/payloads.d.ts +210 -0
  55. package/dist/v2/durable-core/tokens/payloads.js +53 -0
  56. package/dist/v2/durable-core/tokens/token-codec.d.ts +31 -0
  57. package/dist/v2/durable-core/tokens/token-codec.js +64 -0
  58. package/dist/v2/durable-core/tokens/token-signer.d.ts +15 -0
  59. package/dist/v2/durable-core/tokens/token-signer.js +55 -0
  60. package/dist/v2/infra/local/data-dir/index.d.ts +4 -0
  61. package/dist/v2/infra/local/data-dir/index.js +12 -0
  62. package/dist/v2/infra/local/hmac-sha256/index.d.ts +5 -0
  63. package/dist/v2/infra/local/hmac-sha256/index.js +16 -0
  64. package/dist/v2/infra/local/keyring/index.d.ts +14 -0
  65. package/dist/v2/infra/local/keyring/index.js +103 -0
  66. package/dist/v2/infra/local/pinned-workflow-store/index.d.ts +3 -3
  67. package/dist/v2/infra/local/pinned-workflow-store/index.js +1 -1
  68. package/dist/v2/infra/local/session-lock/index.js +1 -1
  69. package/dist/v2/infra/local/session-store/index.d.ts +0 -1
  70. package/dist/v2/infra/local/session-store/index.js +348 -280
  71. package/dist/v2/infra/local/snapshot-store/index.d.ts +15 -0
  72. package/dist/v2/infra/local/snapshot-store/index.js +76 -0
  73. package/dist/v2/ports/data-dir.port.d.ts +4 -0
  74. package/dist/v2/ports/hmac-sha256.port.d.ts +4 -0
  75. package/dist/v2/ports/hmac-sha256.port.js +2 -0
  76. package/dist/v2/ports/keyring.port.d.ts +26 -0
  77. package/dist/v2/ports/keyring.port.js +2 -0
  78. package/dist/v2/ports/pinned-workflow-store.port.d.ts +3 -3
  79. package/dist/v2/ports/session-event-log-store.port.d.ts +1 -1
  80. package/dist/v2/ports/session-lock.port.d.ts +1 -1
  81. package/dist/v2/ports/snapshot-store.port.d.ts +17 -0
  82. package/dist/v2/ports/snapshot-store.port.js +2 -0
  83. package/dist/v2/read-only/v1-to-v2-shim.d.ts +6 -1
  84. package/dist/v2/read-only/v1-to-v2-shim.js +16 -4
  85. package/dist/v2/usecases/execution-session-gate.d.ts +3 -2
  86. package/dist/v2/usecases/execution-session-gate.js +98 -101
  87. package/package.json +2 -1
  88. package/workflows/coding-task-workflow-agentic.json +326 -69
  89. package/workflows/design-thinking-workflow-autonomous.agentic.json +1 -1
  90. package/workflows/design-thinking-workflow.json +1 -1
@@ -0,0 +1,1042 @@
1
+ import { z } from 'zod';
2
+ import type { Result } from 'neverthrow';
3
+ import type { Brand } from '../../../../runtime/brand.js';
4
+ import { type DelimiterSafeIdV1, type StepInstanceKeyV1 } from './step-instance-key.js';
5
+ export type ExecutionSnapshotFileV1 = z.infer<typeof ExecutionSnapshotFileV1Schema>;
6
+ declare const CompletedStepInstancesV1Schema: z.ZodEffects<z.ZodObject<{
7
+ kind: z.ZodLiteral<"set">;
8
+ values: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, StepInstanceKeyV1, string>, "many">;
9
+ }, "strip", z.ZodTypeAny, {
10
+ values: StepInstanceKeyV1[];
11
+ kind: "set";
12
+ }, {
13
+ values: string[];
14
+ kind: "set";
15
+ }>, {
16
+ values: StepInstanceKeyV1[];
17
+ kind: "set";
18
+ }, {
19
+ values: string[];
20
+ kind: "set";
21
+ }>;
22
+ export type CompletedStepInstancesV1 = z.infer<typeof CompletedStepInstancesV1Schema>;
23
+ export interface LoopFrameV1 {
24
+ readonly loopId: DelimiterSafeIdV1;
25
+ readonly iteration: number;
26
+ readonly bodyIndex: number;
27
+ }
28
+ export declare const LoopFrameV1Schema: z.ZodObject<{
29
+ loopId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
30
+ iteration: z.ZodNumber;
31
+ bodyIndex: z.ZodNumber;
32
+ }, "strip", z.ZodTypeAny, {
33
+ iteration: number;
34
+ loopId: string & {
35
+ readonly __brand: "v2.DelimiterSafeIdV1";
36
+ };
37
+ bodyIndex: number;
38
+ }, {
39
+ iteration: number;
40
+ loopId: string;
41
+ bodyIndex: number;
42
+ }>;
43
+ export declare const LoopPathFrameV1Schema: z.ZodObject<{
44
+ loopId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
45
+ iteration: z.ZodNumber;
46
+ }, "strip", z.ZodTypeAny, {
47
+ iteration: number;
48
+ loopId: string & {
49
+ readonly __brand: "v2.DelimiterSafeIdV1";
50
+ };
51
+ }, {
52
+ iteration: number;
53
+ loopId: string;
54
+ }>;
55
+ export type PendingStepV1 = z.infer<typeof PendingStepV1Schema>;
56
+ export declare const PendingStepV1Schema: z.ZodObject<{
57
+ stepId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
58
+ loopPath: z.ZodArray<z.ZodObject<{
59
+ loopId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
60
+ iteration: z.ZodNumber;
61
+ }, "strip", z.ZodTypeAny, {
62
+ iteration: number;
63
+ loopId: string & {
64
+ readonly __brand: "v2.DelimiterSafeIdV1";
65
+ };
66
+ }, {
67
+ iteration: number;
68
+ loopId: string;
69
+ }>, "many">;
70
+ }, "strip", z.ZodTypeAny, {
71
+ stepId: string & {
72
+ readonly __brand: "v2.DelimiterSafeIdV1";
73
+ };
74
+ loopPath: {
75
+ iteration: number;
76
+ loopId: string & {
77
+ readonly __brand: "v2.DelimiterSafeIdV1";
78
+ };
79
+ }[];
80
+ }, {
81
+ stepId: string;
82
+ loopPath: {
83
+ iteration: number;
84
+ loopId: string;
85
+ }[];
86
+ }>;
87
+ export declare const PendingV1Schema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
88
+ kind: z.ZodLiteral<"none">;
89
+ }, "strip", z.ZodTypeAny, {
90
+ kind: "none";
91
+ }, {
92
+ kind: "none";
93
+ }>, z.ZodObject<{
94
+ kind: z.ZodLiteral<"some">;
95
+ step: z.ZodObject<{
96
+ stepId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
97
+ loopPath: z.ZodArray<z.ZodObject<{
98
+ loopId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
99
+ iteration: z.ZodNumber;
100
+ }, "strip", z.ZodTypeAny, {
101
+ iteration: number;
102
+ loopId: string & {
103
+ readonly __brand: "v2.DelimiterSafeIdV1";
104
+ };
105
+ }, {
106
+ iteration: number;
107
+ loopId: string;
108
+ }>, "many">;
109
+ }, "strip", z.ZodTypeAny, {
110
+ stepId: string & {
111
+ readonly __brand: "v2.DelimiterSafeIdV1";
112
+ };
113
+ loopPath: {
114
+ iteration: number;
115
+ loopId: string & {
116
+ readonly __brand: "v2.DelimiterSafeIdV1";
117
+ };
118
+ }[];
119
+ }, {
120
+ stepId: string;
121
+ loopPath: {
122
+ iteration: number;
123
+ loopId: string;
124
+ }[];
125
+ }>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ step: {
128
+ stepId: string & {
129
+ readonly __brand: "v2.DelimiterSafeIdV1";
130
+ };
131
+ loopPath: {
132
+ iteration: number;
133
+ loopId: string & {
134
+ readonly __brand: "v2.DelimiterSafeIdV1";
135
+ };
136
+ }[];
137
+ };
138
+ kind: "some";
139
+ }, {
140
+ step: {
141
+ stepId: string;
142
+ loopPath: {
143
+ iteration: number;
144
+ loopId: string;
145
+ }[];
146
+ };
147
+ kind: "some";
148
+ }>]>;
149
+ export type PendingV1 = z.infer<typeof PendingV1Schema>;
150
+ export type EngineStateV1 = z.infer<typeof EngineStateV1Schema>;
151
+ export declare const EngineStateV1Schema: z.ZodEffects<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
152
+ kind: z.ZodLiteral<"init">;
153
+ }, "strip", z.ZodTypeAny, {
154
+ kind: "init";
155
+ }, {
156
+ kind: "init";
157
+ }>, z.ZodObject<{
158
+ kind: z.ZodLiteral<"running">;
159
+ completed: z.ZodEffects<z.ZodObject<{
160
+ kind: z.ZodLiteral<"set">;
161
+ values: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, StepInstanceKeyV1, string>, "many">;
162
+ }, "strip", z.ZodTypeAny, {
163
+ values: StepInstanceKeyV1[];
164
+ kind: "set";
165
+ }, {
166
+ values: string[];
167
+ kind: "set";
168
+ }>, {
169
+ values: StepInstanceKeyV1[];
170
+ kind: "set";
171
+ }, {
172
+ values: string[];
173
+ kind: "set";
174
+ }>;
175
+ loopStack: z.ZodArray<z.ZodObject<{
176
+ loopId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
177
+ iteration: z.ZodNumber;
178
+ bodyIndex: z.ZodNumber;
179
+ }, "strip", z.ZodTypeAny, {
180
+ iteration: number;
181
+ loopId: string & {
182
+ readonly __brand: "v2.DelimiterSafeIdV1";
183
+ };
184
+ bodyIndex: number;
185
+ }, {
186
+ iteration: number;
187
+ loopId: string;
188
+ bodyIndex: number;
189
+ }>, "many">;
190
+ pending: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
191
+ kind: z.ZodLiteral<"none">;
192
+ }, "strip", z.ZodTypeAny, {
193
+ kind: "none";
194
+ }, {
195
+ kind: "none";
196
+ }>, z.ZodObject<{
197
+ kind: z.ZodLiteral<"some">;
198
+ step: z.ZodObject<{
199
+ stepId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
200
+ loopPath: z.ZodArray<z.ZodObject<{
201
+ loopId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
202
+ iteration: z.ZodNumber;
203
+ }, "strip", z.ZodTypeAny, {
204
+ iteration: number;
205
+ loopId: string & {
206
+ readonly __brand: "v2.DelimiterSafeIdV1";
207
+ };
208
+ }, {
209
+ iteration: number;
210
+ loopId: string;
211
+ }>, "many">;
212
+ }, "strip", z.ZodTypeAny, {
213
+ stepId: string & {
214
+ readonly __brand: "v2.DelimiterSafeIdV1";
215
+ };
216
+ loopPath: {
217
+ iteration: number;
218
+ loopId: string & {
219
+ readonly __brand: "v2.DelimiterSafeIdV1";
220
+ };
221
+ }[];
222
+ }, {
223
+ stepId: string;
224
+ loopPath: {
225
+ iteration: number;
226
+ loopId: string;
227
+ }[];
228
+ }>;
229
+ }, "strip", z.ZodTypeAny, {
230
+ step: {
231
+ stepId: string & {
232
+ readonly __brand: "v2.DelimiterSafeIdV1";
233
+ };
234
+ loopPath: {
235
+ iteration: number;
236
+ loopId: string & {
237
+ readonly __brand: "v2.DelimiterSafeIdV1";
238
+ };
239
+ }[];
240
+ };
241
+ kind: "some";
242
+ }, {
243
+ step: {
244
+ stepId: string;
245
+ loopPath: {
246
+ iteration: number;
247
+ loopId: string;
248
+ }[];
249
+ };
250
+ kind: "some";
251
+ }>]>;
252
+ }, "strip", z.ZodTypeAny, {
253
+ kind: "running";
254
+ completed: {
255
+ values: StepInstanceKeyV1[];
256
+ kind: "set";
257
+ };
258
+ loopStack: {
259
+ iteration: number;
260
+ loopId: string & {
261
+ readonly __brand: "v2.DelimiterSafeIdV1";
262
+ };
263
+ bodyIndex: number;
264
+ }[];
265
+ pending: {
266
+ kind: "none";
267
+ } | {
268
+ step: {
269
+ stepId: string & {
270
+ readonly __brand: "v2.DelimiterSafeIdV1";
271
+ };
272
+ loopPath: {
273
+ iteration: number;
274
+ loopId: string & {
275
+ readonly __brand: "v2.DelimiterSafeIdV1";
276
+ };
277
+ }[];
278
+ };
279
+ kind: "some";
280
+ };
281
+ }, {
282
+ kind: "running";
283
+ completed: {
284
+ values: string[];
285
+ kind: "set";
286
+ };
287
+ loopStack: {
288
+ iteration: number;
289
+ loopId: string;
290
+ bodyIndex: number;
291
+ }[];
292
+ pending: {
293
+ kind: "none";
294
+ } | {
295
+ step: {
296
+ stepId: string;
297
+ loopPath: {
298
+ iteration: number;
299
+ loopId: string;
300
+ }[];
301
+ };
302
+ kind: "some";
303
+ };
304
+ }>, z.ZodObject<{
305
+ kind: z.ZodLiteral<"complete">;
306
+ }, "strip", z.ZodTypeAny, {
307
+ kind: "complete";
308
+ }, {
309
+ kind: "complete";
310
+ }>]>, {
311
+ kind: "init";
312
+ } | {
313
+ kind: "running";
314
+ completed: {
315
+ values: StepInstanceKeyV1[];
316
+ kind: "set";
317
+ };
318
+ loopStack: {
319
+ iteration: number;
320
+ loopId: string & {
321
+ readonly __brand: "v2.DelimiterSafeIdV1";
322
+ };
323
+ bodyIndex: number;
324
+ }[];
325
+ pending: {
326
+ kind: "none";
327
+ } | {
328
+ step: {
329
+ stepId: string & {
330
+ readonly __brand: "v2.DelimiterSafeIdV1";
331
+ };
332
+ loopPath: {
333
+ iteration: number;
334
+ loopId: string & {
335
+ readonly __brand: "v2.DelimiterSafeIdV1";
336
+ };
337
+ }[];
338
+ };
339
+ kind: "some";
340
+ };
341
+ } | {
342
+ kind: "complete";
343
+ }, {
344
+ kind: "init";
345
+ } | {
346
+ kind: "running";
347
+ completed: {
348
+ values: string[];
349
+ kind: "set";
350
+ };
351
+ loopStack: {
352
+ iteration: number;
353
+ loopId: string;
354
+ bodyIndex: number;
355
+ }[];
356
+ pending: {
357
+ kind: "none";
358
+ } | {
359
+ step: {
360
+ stepId: string;
361
+ loopPath: {
362
+ iteration: number;
363
+ loopId: string;
364
+ }[];
365
+ };
366
+ kind: "some";
367
+ };
368
+ } | {
369
+ kind: "complete";
370
+ }>;
371
+ export type EnginePayloadV1 = z.infer<typeof EnginePayloadV1Schema>;
372
+ export declare const EnginePayloadV1Schema: z.ZodObject<{
373
+ v: z.ZodLiteral<1>;
374
+ engineState: z.ZodEffects<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
375
+ kind: z.ZodLiteral<"init">;
376
+ }, "strip", z.ZodTypeAny, {
377
+ kind: "init";
378
+ }, {
379
+ kind: "init";
380
+ }>, z.ZodObject<{
381
+ kind: z.ZodLiteral<"running">;
382
+ completed: z.ZodEffects<z.ZodObject<{
383
+ kind: z.ZodLiteral<"set">;
384
+ values: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, StepInstanceKeyV1, string>, "many">;
385
+ }, "strip", z.ZodTypeAny, {
386
+ values: StepInstanceKeyV1[];
387
+ kind: "set";
388
+ }, {
389
+ values: string[];
390
+ kind: "set";
391
+ }>, {
392
+ values: StepInstanceKeyV1[];
393
+ kind: "set";
394
+ }, {
395
+ values: string[];
396
+ kind: "set";
397
+ }>;
398
+ loopStack: z.ZodArray<z.ZodObject<{
399
+ loopId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
400
+ iteration: z.ZodNumber;
401
+ bodyIndex: z.ZodNumber;
402
+ }, "strip", z.ZodTypeAny, {
403
+ iteration: number;
404
+ loopId: string & {
405
+ readonly __brand: "v2.DelimiterSafeIdV1";
406
+ };
407
+ bodyIndex: number;
408
+ }, {
409
+ iteration: number;
410
+ loopId: string;
411
+ bodyIndex: number;
412
+ }>, "many">;
413
+ pending: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
414
+ kind: z.ZodLiteral<"none">;
415
+ }, "strip", z.ZodTypeAny, {
416
+ kind: "none";
417
+ }, {
418
+ kind: "none";
419
+ }>, z.ZodObject<{
420
+ kind: z.ZodLiteral<"some">;
421
+ step: z.ZodObject<{
422
+ stepId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
423
+ loopPath: z.ZodArray<z.ZodObject<{
424
+ loopId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
425
+ iteration: z.ZodNumber;
426
+ }, "strip", z.ZodTypeAny, {
427
+ iteration: number;
428
+ loopId: string & {
429
+ readonly __brand: "v2.DelimiterSafeIdV1";
430
+ };
431
+ }, {
432
+ iteration: number;
433
+ loopId: string;
434
+ }>, "many">;
435
+ }, "strip", z.ZodTypeAny, {
436
+ stepId: string & {
437
+ readonly __brand: "v2.DelimiterSafeIdV1";
438
+ };
439
+ loopPath: {
440
+ iteration: number;
441
+ loopId: string & {
442
+ readonly __brand: "v2.DelimiterSafeIdV1";
443
+ };
444
+ }[];
445
+ }, {
446
+ stepId: string;
447
+ loopPath: {
448
+ iteration: number;
449
+ loopId: string;
450
+ }[];
451
+ }>;
452
+ }, "strip", z.ZodTypeAny, {
453
+ step: {
454
+ stepId: string & {
455
+ readonly __brand: "v2.DelimiterSafeIdV1";
456
+ };
457
+ loopPath: {
458
+ iteration: number;
459
+ loopId: string & {
460
+ readonly __brand: "v2.DelimiterSafeIdV1";
461
+ };
462
+ }[];
463
+ };
464
+ kind: "some";
465
+ }, {
466
+ step: {
467
+ stepId: string;
468
+ loopPath: {
469
+ iteration: number;
470
+ loopId: string;
471
+ }[];
472
+ };
473
+ kind: "some";
474
+ }>]>;
475
+ }, "strip", z.ZodTypeAny, {
476
+ kind: "running";
477
+ completed: {
478
+ values: StepInstanceKeyV1[];
479
+ kind: "set";
480
+ };
481
+ loopStack: {
482
+ iteration: number;
483
+ loopId: string & {
484
+ readonly __brand: "v2.DelimiterSafeIdV1";
485
+ };
486
+ bodyIndex: number;
487
+ }[];
488
+ pending: {
489
+ kind: "none";
490
+ } | {
491
+ step: {
492
+ stepId: string & {
493
+ readonly __brand: "v2.DelimiterSafeIdV1";
494
+ };
495
+ loopPath: {
496
+ iteration: number;
497
+ loopId: string & {
498
+ readonly __brand: "v2.DelimiterSafeIdV1";
499
+ };
500
+ }[];
501
+ };
502
+ kind: "some";
503
+ };
504
+ }, {
505
+ kind: "running";
506
+ completed: {
507
+ values: string[];
508
+ kind: "set";
509
+ };
510
+ loopStack: {
511
+ iteration: number;
512
+ loopId: string;
513
+ bodyIndex: number;
514
+ }[];
515
+ pending: {
516
+ kind: "none";
517
+ } | {
518
+ step: {
519
+ stepId: string;
520
+ loopPath: {
521
+ iteration: number;
522
+ loopId: string;
523
+ }[];
524
+ };
525
+ kind: "some";
526
+ };
527
+ }>, z.ZodObject<{
528
+ kind: z.ZodLiteral<"complete">;
529
+ }, "strip", z.ZodTypeAny, {
530
+ kind: "complete";
531
+ }, {
532
+ kind: "complete";
533
+ }>]>, {
534
+ kind: "init";
535
+ } | {
536
+ kind: "running";
537
+ completed: {
538
+ values: StepInstanceKeyV1[];
539
+ kind: "set";
540
+ };
541
+ loopStack: {
542
+ iteration: number;
543
+ loopId: string & {
544
+ readonly __brand: "v2.DelimiterSafeIdV1";
545
+ };
546
+ bodyIndex: number;
547
+ }[];
548
+ pending: {
549
+ kind: "none";
550
+ } | {
551
+ step: {
552
+ stepId: string & {
553
+ readonly __brand: "v2.DelimiterSafeIdV1";
554
+ };
555
+ loopPath: {
556
+ iteration: number;
557
+ loopId: string & {
558
+ readonly __brand: "v2.DelimiterSafeIdV1";
559
+ };
560
+ }[];
561
+ };
562
+ kind: "some";
563
+ };
564
+ } | {
565
+ kind: "complete";
566
+ }, {
567
+ kind: "init";
568
+ } | {
569
+ kind: "running";
570
+ completed: {
571
+ values: string[];
572
+ kind: "set";
573
+ };
574
+ loopStack: {
575
+ iteration: number;
576
+ loopId: string;
577
+ bodyIndex: number;
578
+ }[];
579
+ pending: {
580
+ kind: "none";
581
+ } | {
582
+ step: {
583
+ stepId: string;
584
+ loopPath: {
585
+ iteration: number;
586
+ loopId: string;
587
+ }[];
588
+ };
589
+ kind: "some";
590
+ };
591
+ } | {
592
+ kind: "complete";
593
+ }>;
594
+ }, "strip", z.ZodTypeAny, {
595
+ v: 1;
596
+ engineState: {
597
+ kind: "init";
598
+ } | {
599
+ kind: "running";
600
+ completed: {
601
+ values: StepInstanceKeyV1[];
602
+ kind: "set";
603
+ };
604
+ loopStack: {
605
+ iteration: number;
606
+ loopId: string & {
607
+ readonly __brand: "v2.DelimiterSafeIdV1";
608
+ };
609
+ bodyIndex: number;
610
+ }[];
611
+ pending: {
612
+ kind: "none";
613
+ } | {
614
+ step: {
615
+ stepId: string & {
616
+ readonly __brand: "v2.DelimiterSafeIdV1";
617
+ };
618
+ loopPath: {
619
+ iteration: number;
620
+ loopId: string & {
621
+ readonly __brand: "v2.DelimiterSafeIdV1";
622
+ };
623
+ }[];
624
+ };
625
+ kind: "some";
626
+ };
627
+ } | {
628
+ kind: "complete";
629
+ };
630
+ }, {
631
+ v: 1;
632
+ engineState: {
633
+ kind: "init";
634
+ } | {
635
+ kind: "running";
636
+ completed: {
637
+ values: string[];
638
+ kind: "set";
639
+ };
640
+ loopStack: {
641
+ iteration: number;
642
+ loopId: string;
643
+ bodyIndex: number;
644
+ }[];
645
+ pending: {
646
+ kind: "none";
647
+ } | {
648
+ step: {
649
+ stepId: string;
650
+ loopPath: {
651
+ iteration: number;
652
+ loopId: string;
653
+ }[];
654
+ };
655
+ kind: "some";
656
+ };
657
+ } | {
658
+ kind: "complete";
659
+ };
660
+ }>;
661
+ export declare const ExecutionSnapshotFileV1Schema: z.ZodObject<{
662
+ v: z.ZodLiteral<1>;
663
+ kind: z.ZodLiteral<"execution_snapshot">;
664
+ enginePayload: z.ZodObject<{
665
+ v: z.ZodLiteral<1>;
666
+ engineState: z.ZodEffects<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
667
+ kind: z.ZodLiteral<"init">;
668
+ }, "strip", z.ZodTypeAny, {
669
+ kind: "init";
670
+ }, {
671
+ kind: "init";
672
+ }>, z.ZodObject<{
673
+ kind: z.ZodLiteral<"running">;
674
+ completed: z.ZodEffects<z.ZodObject<{
675
+ kind: z.ZodLiteral<"set">;
676
+ values: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, StepInstanceKeyV1, string>, "many">;
677
+ }, "strip", z.ZodTypeAny, {
678
+ values: StepInstanceKeyV1[];
679
+ kind: "set";
680
+ }, {
681
+ values: string[];
682
+ kind: "set";
683
+ }>, {
684
+ values: StepInstanceKeyV1[];
685
+ kind: "set";
686
+ }, {
687
+ values: string[];
688
+ kind: "set";
689
+ }>;
690
+ loopStack: z.ZodArray<z.ZodObject<{
691
+ loopId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
692
+ iteration: z.ZodNumber;
693
+ bodyIndex: z.ZodNumber;
694
+ }, "strip", z.ZodTypeAny, {
695
+ iteration: number;
696
+ loopId: string & {
697
+ readonly __brand: "v2.DelimiterSafeIdV1";
698
+ };
699
+ bodyIndex: number;
700
+ }, {
701
+ iteration: number;
702
+ loopId: string;
703
+ bodyIndex: number;
704
+ }>, "many">;
705
+ pending: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
706
+ kind: z.ZodLiteral<"none">;
707
+ }, "strip", z.ZodTypeAny, {
708
+ kind: "none";
709
+ }, {
710
+ kind: "none";
711
+ }>, z.ZodObject<{
712
+ kind: z.ZodLiteral<"some">;
713
+ step: z.ZodObject<{
714
+ stepId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
715
+ loopPath: z.ZodArray<z.ZodObject<{
716
+ loopId: z.ZodEffects<z.ZodString, DelimiterSafeIdV1, string>;
717
+ iteration: z.ZodNumber;
718
+ }, "strip", z.ZodTypeAny, {
719
+ iteration: number;
720
+ loopId: string & {
721
+ readonly __brand: "v2.DelimiterSafeIdV1";
722
+ };
723
+ }, {
724
+ iteration: number;
725
+ loopId: string;
726
+ }>, "many">;
727
+ }, "strip", z.ZodTypeAny, {
728
+ stepId: string & {
729
+ readonly __brand: "v2.DelimiterSafeIdV1";
730
+ };
731
+ loopPath: {
732
+ iteration: number;
733
+ loopId: string & {
734
+ readonly __brand: "v2.DelimiterSafeIdV1";
735
+ };
736
+ }[];
737
+ }, {
738
+ stepId: string;
739
+ loopPath: {
740
+ iteration: number;
741
+ loopId: string;
742
+ }[];
743
+ }>;
744
+ }, "strip", z.ZodTypeAny, {
745
+ step: {
746
+ stepId: string & {
747
+ readonly __brand: "v2.DelimiterSafeIdV1";
748
+ };
749
+ loopPath: {
750
+ iteration: number;
751
+ loopId: string & {
752
+ readonly __brand: "v2.DelimiterSafeIdV1";
753
+ };
754
+ }[];
755
+ };
756
+ kind: "some";
757
+ }, {
758
+ step: {
759
+ stepId: string;
760
+ loopPath: {
761
+ iteration: number;
762
+ loopId: string;
763
+ }[];
764
+ };
765
+ kind: "some";
766
+ }>]>;
767
+ }, "strip", z.ZodTypeAny, {
768
+ kind: "running";
769
+ completed: {
770
+ values: StepInstanceKeyV1[];
771
+ kind: "set";
772
+ };
773
+ loopStack: {
774
+ iteration: number;
775
+ loopId: string & {
776
+ readonly __brand: "v2.DelimiterSafeIdV1";
777
+ };
778
+ bodyIndex: number;
779
+ }[];
780
+ pending: {
781
+ kind: "none";
782
+ } | {
783
+ step: {
784
+ stepId: string & {
785
+ readonly __brand: "v2.DelimiterSafeIdV1";
786
+ };
787
+ loopPath: {
788
+ iteration: number;
789
+ loopId: string & {
790
+ readonly __brand: "v2.DelimiterSafeIdV1";
791
+ };
792
+ }[];
793
+ };
794
+ kind: "some";
795
+ };
796
+ }, {
797
+ kind: "running";
798
+ completed: {
799
+ values: string[];
800
+ kind: "set";
801
+ };
802
+ loopStack: {
803
+ iteration: number;
804
+ loopId: string;
805
+ bodyIndex: number;
806
+ }[];
807
+ pending: {
808
+ kind: "none";
809
+ } | {
810
+ step: {
811
+ stepId: string;
812
+ loopPath: {
813
+ iteration: number;
814
+ loopId: string;
815
+ }[];
816
+ };
817
+ kind: "some";
818
+ };
819
+ }>, z.ZodObject<{
820
+ kind: z.ZodLiteral<"complete">;
821
+ }, "strip", z.ZodTypeAny, {
822
+ kind: "complete";
823
+ }, {
824
+ kind: "complete";
825
+ }>]>, {
826
+ kind: "init";
827
+ } | {
828
+ kind: "running";
829
+ completed: {
830
+ values: StepInstanceKeyV1[];
831
+ kind: "set";
832
+ };
833
+ loopStack: {
834
+ iteration: number;
835
+ loopId: string & {
836
+ readonly __brand: "v2.DelimiterSafeIdV1";
837
+ };
838
+ bodyIndex: number;
839
+ }[];
840
+ pending: {
841
+ kind: "none";
842
+ } | {
843
+ step: {
844
+ stepId: string & {
845
+ readonly __brand: "v2.DelimiterSafeIdV1";
846
+ };
847
+ loopPath: {
848
+ iteration: number;
849
+ loopId: string & {
850
+ readonly __brand: "v2.DelimiterSafeIdV1";
851
+ };
852
+ }[];
853
+ };
854
+ kind: "some";
855
+ };
856
+ } | {
857
+ kind: "complete";
858
+ }, {
859
+ kind: "init";
860
+ } | {
861
+ kind: "running";
862
+ completed: {
863
+ values: string[];
864
+ kind: "set";
865
+ };
866
+ loopStack: {
867
+ iteration: number;
868
+ loopId: string;
869
+ bodyIndex: number;
870
+ }[];
871
+ pending: {
872
+ kind: "none";
873
+ } | {
874
+ step: {
875
+ stepId: string;
876
+ loopPath: {
877
+ iteration: number;
878
+ loopId: string;
879
+ }[];
880
+ };
881
+ kind: "some";
882
+ };
883
+ } | {
884
+ kind: "complete";
885
+ }>;
886
+ }, "strip", z.ZodTypeAny, {
887
+ v: 1;
888
+ engineState: {
889
+ kind: "init";
890
+ } | {
891
+ kind: "running";
892
+ completed: {
893
+ values: StepInstanceKeyV1[];
894
+ kind: "set";
895
+ };
896
+ loopStack: {
897
+ iteration: number;
898
+ loopId: string & {
899
+ readonly __brand: "v2.DelimiterSafeIdV1";
900
+ };
901
+ bodyIndex: number;
902
+ }[];
903
+ pending: {
904
+ kind: "none";
905
+ } | {
906
+ step: {
907
+ stepId: string & {
908
+ readonly __brand: "v2.DelimiterSafeIdV1";
909
+ };
910
+ loopPath: {
911
+ iteration: number;
912
+ loopId: string & {
913
+ readonly __brand: "v2.DelimiterSafeIdV1";
914
+ };
915
+ }[];
916
+ };
917
+ kind: "some";
918
+ };
919
+ } | {
920
+ kind: "complete";
921
+ };
922
+ }, {
923
+ v: 1;
924
+ engineState: {
925
+ kind: "init";
926
+ } | {
927
+ kind: "running";
928
+ completed: {
929
+ values: string[];
930
+ kind: "set";
931
+ };
932
+ loopStack: {
933
+ iteration: number;
934
+ loopId: string;
935
+ bodyIndex: number;
936
+ }[];
937
+ pending: {
938
+ kind: "none";
939
+ } | {
940
+ step: {
941
+ stepId: string;
942
+ loopPath: {
943
+ iteration: number;
944
+ loopId: string;
945
+ }[];
946
+ };
947
+ kind: "some";
948
+ };
949
+ } | {
950
+ kind: "complete";
951
+ };
952
+ }>;
953
+ }, "strip", z.ZodTypeAny, {
954
+ kind: "execution_snapshot";
955
+ v: 1;
956
+ enginePayload: {
957
+ v: 1;
958
+ engineState: {
959
+ kind: "init";
960
+ } | {
961
+ kind: "running";
962
+ completed: {
963
+ values: StepInstanceKeyV1[];
964
+ kind: "set";
965
+ };
966
+ loopStack: {
967
+ iteration: number;
968
+ loopId: string & {
969
+ readonly __brand: "v2.DelimiterSafeIdV1";
970
+ };
971
+ bodyIndex: number;
972
+ }[];
973
+ pending: {
974
+ kind: "none";
975
+ } | {
976
+ step: {
977
+ stepId: string & {
978
+ readonly __brand: "v2.DelimiterSafeIdV1";
979
+ };
980
+ loopPath: {
981
+ iteration: number;
982
+ loopId: string & {
983
+ readonly __brand: "v2.DelimiterSafeIdV1";
984
+ };
985
+ }[];
986
+ };
987
+ kind: "some";
988
+ };
989
+ } | {
990
+ kind: "complete";
991
+ };
992
+ };
993
+ }, {
994
+ kind: "execution_snapshot";
995
+ v: 1;
996
+ enginePayload: {
997
+ v: 1;
998
+ engineState: {
999
+ kind: "init";
1000
+ } | {
1001
+ kind: "running";
1002
+ completed: {
1003
+ values: string[];
1004
+ kind: "set";
1005
+ };
1006
+ loopStack: {
1007
+ iteration: number;
1008
+ loopId: string;
1009
+ bodyIndex: number;
1010
+ }[];
1011
+ pending: {
1012
+ kind: "none";
1013
+ } | {
1014
+ step: {
1015
+ stepId: string;
1016
+ loopPath: {
1017
+ iteration: number;
1018
+ loopId: string;
1019
+ }[];
1020
+ };
1021
+ kind: "some";
1022
+ };
1023
+ } | {
1024
+ kind: "complete";
1025
+ };
1026
+ };
1027
+ }>;
1028
+ export type SnapshotRefV1 = Brand<string, 'v2.SnapshotRefV1'>;
1029
+ export type SnapshotHashErrorV1 = {
1030
+ readonly code: 'SNAPSHOT_HASH_CANONICALIZE_FAILED';
1031
+ readonly message: string;
1032
+ } | {
1033
+ readonly code: 'SNAPSHOT_HASH_UNSUPPORTED';
1034
+ readonly message: string;
1035
+ };
1036
+ export declare function isSortedLex(values: readonly StepInstanceKeyV1[]): boolean;
1037
+ export type CompletedSetBuildErrorV1 = {
1038
+ readonly code: 'COMPLETED_SET_UNSORTED';
1039
+ readonly message: string;
1040
+ };
1041
+ export declare function completedSetFromSorted(values: readonly StepInstanceKeyV1[]): Result<CompletedStepInstancesV1, CompletedSetBuildErrorV1>;
1042
+ export {};