@exaudeus/workrail 2.1.0 → 3.0.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 (58) hide show
  1. package/dist/application/services/compiler/template-registry.d.ts +4 -2
  2. package/dist/application/services/compiler/template-registry.js +97 -5
  3. package/dist/application/services/workflow-compiler.d.ts +5 -1
  4. package/dist/application/services/workflow-compiler.js +20 -7
  5. package/dist/di/container.js +10 -1
  6. package/dist/di/tokens.d.ts +1 -0
  7. package/dist/di/tokens.js +1 -0
  8. package/dist/engine/engine-factory.d.ts +3 -0
  9. package/dist/engine/engine-factory.js +295 -0
  10. package/dist/engine/index.d.ts +3 -0
  11. package/dist/engine/index.js +12 -0
  12. package/dist/engine/types.d.ts +130 -0
  13. package/dist/engine/types.js +18 -0
  14. package/dist/infrastructure/storage/file-workflow-storage.d.ts +1 -0
  15. package/dist/infrastructure/storage/file-workflow-storage.js +10 -0
  16. package/dist/manifest.json +140 -76
  17. package/dist/mcp/handlers/v2-checkpoint.d.ts +31 -1
  18. package/dist/mcp/handlers/v2-checkpoint.js +76 -64
  19. package/dist/mcp/handlers/v2-execution/continue-advance.d.ts +2 -0
  20. package/dist/mcp/handlers/v2-execution/continue-advance.js +5 -5
  21. package/dist/mcp/handlers/v2-execution/continue-rehydrate.d.ts +2 -0
  22. package/dist/mcp/handlers/v2-execution/continue-rehydrate.js +17 -22
  23. package/dist/mcp/handlers/v2-execution/index.d.ts +10 -17
  24. package/dist/mcp/handlers/v2-execution/index.js +44 -54
  25. package/dist/mcp/handlers/v2-execution/replay.d.ts +4 -15
  26. package/dist/mcp/handlers/v2-execution/replay.js +52 -128
  27. package/dist/mcp/handlers/v2-execution/start.d.ts +3 -2
  28. package/dist/mcp/handlers/v2-execution/start.js +18 -46
  29. package/dist/mcp/handlers/v2-token-ops.d.ts +45 -24
  30. package/dist/mcp/handlers/v2-token-ops.js +372 -32
  31. package/dist/mcp/output-schemas.d.ts +104 -283
  32. package/dist/mcp/output-schemas.js +24 -22
  33. package/dist/mcp/server.js +8 -0
  34. package/dist/mcp/types.d.ts +4 -0
  35. package/dist/mcp/v2/tools.d.ts +22 -52
  36. package/dist/mcp/v2/tools.js +18 -32
  37. package/dist/mcp/v2-response-formatter.js +12 -16
  38. package/dist/runtime/runtime-mode.d.ts +2 -0
  39. package/dist/v2/durable-core/domain/prompt-renderer.d.ts +1 -0
  40. package/dist/v2/durable-core/domain/prompt-renderer.js +5 -3
  41. package/dist/v2/durable-core/schemas/export-bundle/index.d.ts +14 -14
  42. package/dist/v2/durable-core/schemas/session/events.d.ts +4 -4
  43. package/dist/v2/durable-core/schemas/session/validation-event.d.ts +2 -2
  44. package/dist/v2/durable-core/tokens/payloads.d.ts +32 -32
  45. package/dist/v2/durable-core/tokens/short-token.d.ts +38 -0
  46. package/dist/v2/durable-core/tokens/short-token.js +126 -0
  47. package/dist/v2/durable-core/tokens/token-patterns.d.ts +4 -0
  48. package/dist/v2/durable-core/tokens/token-patterns.js +9 -0
  49. package/dist/v2/infra/in-memory/token-alias-store/index.d.ts +11 -0
  50. package/dist/v2/infra/in-memory/token-alias-store/index.js +38 -0
  51. package/dist/v2/infra/local/data-dir/index.d.ts +1 -0
  52. package/dist/v2/infra/local/data-dir/index.js +3 -0
  53. package/dist/v2/infra/local/token-alias-store/index.d.ts +16 -0
  54. package/dist/v2/infra/local/token-alias-store/index.js +117 -0
  55. package/dist/v2/ports/data-dir.port.d.ts +1 -0
  56. package/dist/v2/ports/token-alias-store.port.d.ts +33 -0
  57. package/dist/v2/ports/token-alias-store.port.js +2 -0
  58. package/package.json +8 -1
@@ -0,0 +1,130 @@
1
+ declare const StateTokenBrand: unique symbol;
2
+ declare const AckTokenBrand: unique symbol;
3
+ declare const CheckpointTokenBrand: unique symbol;
4
+ export type StateToken = string & {
5
+ readonly [StateTokenBrand]: never;
6
+ };
7
+ export type AckToken = string & {
8
+ readonly [AckTokenBrand]: never;
9
+ };
10
+ export type CheckpointToken = string & {
11
+ readonly [CheckpointTokenBrand]: never;
12
+ };
13
+ export declare function asStateToken(s: string): StateToken;
14
+ export declare function asAckToken(s: string): AckToken;
15
+ export declare function asCheckpointToken(s: string): CheckpointToken;
16
+ export declare function unwrapToken(t: StateToken | AckToken | CheckpointToken): string;
17
+ export interface PendingStep {
18
+ readonly stepId: string;
19
+ readonly title: string;
20
+ readonly prompt: string;
21
+ readonly agentRole?: string;
22
+ }
23
+ export type Autonomy = 'guided' | 'full_auto_stop_on_user_deps' | 'full_auto_never_stop';
24
+ export type RiskPolicy = 'conservative' | 'balanced' | 'aggressive';
25
+ export interface StepPreferences {
26
+ readonly autonomy: Autonomy;
27
+ readonly riskPolicy: RiskPolicy;
28
+ }
29
+ export type NextIntent = 'perform_pending_then_continue' | 'await_user_confirmation' | 'rehydrate_only' | 'complete';
30
+ export type BlockerCode = 'USER_ONLY_DEPENDENCY' | 'MISSING_REQUIRED_OUTPUT' | 'INVALID_REQUIRED_OUTPUT' | 'MISSING_REQUIRED_NOTES' | 'MISSING_CONTEXT_KEY' | 'CONTEXT_BUDGET_EXCEEDED' | 'REQUIRED_CAPABILITY_UNKNOWN' | 'REQUIRED_CAPABILITY_UNAVAILABLE' | 'INVARIANT_VIOLATION' | 'STORAGE_CORRUPTION_DETECTED';
31
+ export interface Blocker {
32
+ readonly code: BlockerCode;
33
+ readonly message: string;
34
+ readonly suggestedFix?: string;
35
+ }
36
+ interface StepResponseBase {
37
+ readonly stateToken: StateToken;
38
+ readonly ackToken: AckToken | null;
39
+ readonly checkpointToken: CheckpointToken | null;
40
+ readonly isComplete: boolean;
41
+ readonly preferences: StepPreferences;
42
+ readonly nextIntent: NextIntent;
43
+ }
44
+ export interface StepResponseOk extends StepResponseBase {
45
+ readonly kind: 'ok';
46
+ readonly pending: PendingStep | null;
47
+ }
48
+ export interface StepResponseBlocked extends StepResponseBase {
49
+ readonly kind: 'blocked';
50
+ readonly pending: PendingStep | null;
51
+ readonly blockers: readonly Blocker[];
52
+ readonly retryable: boolean;
53
+ readonly retryAckToken: AckToken | null;
54
+ }
55
+ export type StepResponse = StepResponseOk | StepResponseBlocked;
56
+ export interface CheckpointResponse {
57
+ readonly checkpointNodeId: string;
58
+ readonly stateToken: StateToken;
59
+ }
60
+ export interface WorkflowListItem {
61
+ readonly workflowId: string;
62
+ readonly name: string;
63
+ readonly description: string;
64
+ readonly version: string;
65
+ }
66
+ export interface WorkflowListResponse {
67
+ readonly workflows: readonly WorkflowListItem[];
68
+ }
69
+ export type InfraErrorCode = string;
70
+ export type EngineError = {
71
+ readonly kind: 'workflow_not_found';
72
+ readonly workflowId: string;
73
+ } | {
74
+ readonly kind: 'workflow_has_no_steps';
75
+ readonly workflowId: string;
76
+ } | {
77
+ readonly kind: 'workflow_compile_failed';
78
+ readonly message: string;
79
+ } | {
80
+ readonly kind: 'validation_failed';
81
+ readonly message: string;
82
+ } | {
83
+ readonly kind: 'token_invalid';
84
+ readonly message: string;
85
+ readonly code?: InfraErrorCode;
86
+ } | {
87
+ readonly kind: 'token_signing_failed';
88
+ readonly message: string;
89
+ } | {
90
+ readonly kind: 'session_error';
91
+ readonly message: string;
92
+ readonly code?: InfraErrorCode;
93
+ } | {
94
+ readonly kind: 'storage_error';
95
+ readonly message: string;
96
+ readonly code?: InfraErrorCode;
97
+ } | {
98
+ readonly kind: 'prompt_render_failed';
99
+ readonly message: string;
100
+ } | {
101
+ readonly kind: 'precondition_failed';
102
+ readonly message: string;
103
+ } | {
104
+ readonly kind: 'internal_error';
105
+ readonly message: string;
106
+ readonly code?: InfraErrorCode;
107
+ };
108
+ export type EngineResult<T> = {
109
+ readonly ok: true;
110
+ readonly value: T;
111
+ } | {
112
+ readonly ok: false;
113
+ readonly error: EngineError;
114
+ };
115
+ export declare function engineOk<T>(value: T): EngineResult<T>;
116
+ export declare function engineErr<T>(error: EngineError): EngineResult<T>;
117
+ export interface EngineConfig {
118
+ readonly dataDir?: string;
119
+ }
120
+ export interface WorkRailEngine {
121
+ readonly startWorkflow: (workflowId: string) => Promise<EngineResult<StepResponse>>;
122
+ readonly continueWorkflow: (stateToken: StateToken, ackToken: AckToken | null, output?: {
123
+ readonly notesMarkdown?: string;
124
+ readonly artifacts?: readonly unknown[];
125
+ }, context?: Readonly<Record<string, unknown>>) => Promise<EngineResult<StepResponse>>;
126
+ readonly checkpointWorkflow: (checkpointToken: CheckpointToken) => Promise<EngineResult<CheckpointResponse>>;
127
+ readonly listWorkflows: () => Promise<EngineResult<WorkflowListResponse>>;
128
+ readonly close: () => Promise<void>;
129
+ }
130
+ export {};
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asStateToken = asStateToken;
4
+ exports.asAckToken = asAckToken;
5
+ exports.asCheckpointToken = asCheckpointToken;
6
+ exports.unwrapToken = unwrapToken;
7
+ exports.engineOk = engineOk;
8
+ exports.engineErr = engineErr;
9
+ function asStateToken(s) { return s; }
10
+ function asAckToken(s) { return s; }
11
+ function asCheckpointToken(s) { return s; }
12
+ function unwrapToken(t) { return t; }
13
+ function engineOk(value) {
14
+ return { ok: true, value };
15
+ }
16
+ function engineErr(error) {
17
+ return { ok: false, error };
18
+ }
@@ -26,6 +26,7 @@ export declare class FileWorkflowStorage implements IWorkflowStorage {
26
26
  private loadDefinitionFromFile;
27
27
  loadAllWorkflows(): Promise<readonly Workflow[]>;
28
28
  getWorkflowById(id: string): Promise<Workflow | null>;
29
+ getRoutineDefinitions(): Promise<ReadonlyMap<string, WorkflowDefinition>>;
29
30
  listWorkflowSummaries(): Promise<readonly WorkflowSummary[]>;
30
31
  save(definition: WorkflowDefinition): Promise<void>;
31
32
  }
@@ -164,6 +164,16 @@ class FileWorkflowStorage {
164
164
  }
165
165
  return workflow;
166
166
  }
167
+ async getRoutineDefinitions() {
168
+ const index = await this.getWorkflowIndex();
169
+ const routines = new Map();
170
+ for (const entry of index.values()) {
171
+ if (entry.id.startsWith('routine-')) {
172
+ routines.set(entry.id, entry.definition);
173
+ }
174
+ }
175
+ return routines;
176
+ }
167
177
  async listWorkflowSummaries() {
168
178
  const workflows = await this.loadAllWorkflows();
169
179
  return workflows.map(workflow_1.toWorkflowSummary);
@@ -50,12 +50,12 @@
50
50
  "bytes": 1997
51
51
  },
52
52
  "application/services/compiler/template-registry.d.ts": {
53
- "sha256": "16221e2671a95456abfd875fc7caceb40058f351a5a371e13acf53def2f77b24",
54
- "bytes": 873
53
+ "sha256": "0945a6c997eccd03f96e1893e513519a78bfb923a832f3d66a2a31c8fdb2a945",
54
+ "bytes": 1172
55
55
  },
56
56
  "application/services/compiler/template-registry.js": {
57
- "sha256": "79ea2925e1d4a003a0b07a5f4c99cdc5fb8aa73e0b2be4e239435bf7bf1ffb13",
58
- "bytes": 972
57
+ "sha256": "79dab84c14a2adb99b7b1ab2e02986e6fd7b8bed501dfa781e418164763ce0fb",
58
+ "bytes": 5147
59
59
  },
60
60
  "application/services/enhanced-error-service.d.ts": {
61
61
  "sha256": "b6fe8fad92717f0962f87aa9c0f88277bf28fe2b5e3cfd7875612ee57eb8c684",
@@ -98,12 +98,12 @@
98
98
  "bytes": 32055
99
99
  },
100
100
  "application/services/workflow-compiler.d.ts": {
101
- "sha256": "41d0643ae2f07e5ce77a6e02344b5ca5b3c26bde828fbb307528a2ae097ac9d5",
102
- "bytes": 1211
101
+ "sha256": "94ebc79efd351f6f1c29e98e57731c573c291632e148a78e04a13b3d1160dbc9",
102
+ "bytes": 1455
103
103
  },
104
104
  "application/services/workflow-compiler.js": {
105
- "sha256": "db74bfe006cf703cc0c32165e09e2c684e24fcf7b538ecbc1273daf67012dc2d",
106
- "bytes": 8182
105
+ "sha256": "f0c185af822082f605e1d01612987ac9d75ade104a2606621e0fcd8faa899485",
106
+ "bytes": 8796
107
107
  },
108
108
  "application/services/workflow-interpreter.d.ts": {
109
109
  "sha256": "56b5b5ad06d42096deba9f0abe7642c18a355a1e598749aab1730df4e9847674",
@@ -342,16 +342,16 @@
342
342
  "bytes": 565
343
343
  },
344
344
  "di/container.js": {
345
- "sha256": "d1fbf1f04bb8cb0e4da2161ef2b773e1fdd3d7e8fe09d0672610dc8f28e8901b",
346
- "bytes": 19468
345
+ "sha256": "6ba1b310aee67ac495a873d8102a5f3453592128f41735fd540022eb1032370a",
346
+ "bytes": 20016
347
347
  },
348
348
  "di/tokens.d.ts": {
349
- "sha256": "ce5a748976acc30088847dde3126e2f3f45020e8ef15e897938a76752cbb47b4",
350
- "bytes": 1949
349
+ "sha256": "15cb26fb2370ad60ff6fc39d1ccd7df133d0cd4088f7a2deceb30d4c00ca8aae",
350
+ "bytes": 1991
351
351
  },
352
352
  "di/tokens.js": {
353
- "sha256": "436804cf8904c4984e459d797e3edae02dee6d0b46e989590397bd226b4d759b",
354
- "bytes": 2403
353
+ "sha256": "d41c9cd45ab4a9aea3e39cad8d6969a4e1e1407c862eb5093ebc01580f99b672",
354
+ "bytes": 2458
355
355
  },
356
356
  "domain/execution/error.d.ts": {
357
357
  "sha256": "2eac85c42ec399a23724f868641eeadd0d196b4d324ee4caaff82a6b46155bd9",
@@ -401,6 +401,30 @@
401
401
  "sha256": "b428afbb24a64555c10086f873a85133c2826350f406ee2b51d970adf18d7cad",
402
402
  "bytes": 2332
403
403
  },
404
+ "engine/engine-factory.d.ts": {
405
+ "sha256": "ae4fad519eaeb5e5278a1e1547999152c6e39dd31a0d1458e5ff65d632fbeff6",
406
+ "bytes": 213
407
+ },
408
+ "engine/engine-factory.js": {
409
+ "sha256": "886dde45d9971372c9772412e9e1b280c80a006a0f898c4a8f75d2316364c3c7",
410
+ "bytes": 13488
411
+ },
412
+ "engine/index.d.ts": {
413
+ "sha256": "91e12882c565e96a9809fdf43a0dc0a77fdffdfd562aaf43d2e86e6590ed0b16",
414
+ "bytes": 512
415
+ },
416
+ "engine/index.js": {
417
+ "sha256": "764155f282d26439cb6db570792ecec81a3b8fbace7eb02550f4ddc057159084",
418
+ "bytes": 1230
419
+ },
420
+ "engine/types.d.ts": {
421
+ "sha256": "29a9f6ae4a05674ed454956b560021f5a408dfac9a65b417ec33520b6b0d1e0a",
422
+ "bytes": 4778
423
+ },
424
+ "engine/types.js": {
425
+ "sha256": "94eb9981e7b846a07fc53a29e7a8d8969a1a2d418dccb735d611eaadea1fa3c7",
426
+ "bytes": 571
427
+ },
404
428
  "errors/app-error.d.ts": {
405
429
  "sha256": "9be8c6cdfdc3313242ac6ccc08903dee76ff1cc9914cb10897dc410ffb9edd55",
406
430
  "bytes": 766
@@ -522,12 +546,12 @@
522
546
  "bytes": 17854
523
547
  },
524
548
  "infrastructure/storage/file-workflow-storage.d.ts": {
525
- "sha256": "3ddd5c692ebec52dc36cf96013db510a8b0eb77aaeeb7ba38b646a69083f002a",
526
- "bytes": 1428
549
+ "sha256": "6a10df10ab073c4d3611b42e69e1fe45bdb9d2e437af2c3b6ef90361698d2be5",
550
+ "bytes": 1507
527
551
  },
528
552
  "infrastructure/storage/file-workflow-storage.js": {
529
- "sha256": "e5cfd6f8a7fed72961e041aa9c92765c28f4b9872c16e7cbdbd533f0177ea0f0",
530
- "bytes": 8562
553
+ "sha256": "1db12e1adcac4b119b44fcfbfb1b31e8c15c055fc040c1a82774238e8bfc6e41",
554
+ "bytes": 8897
531
555
  },
532
556
  "infrastructure/storage/git-workflow-storage.d.ts": {
533
557
  "sha256": "67d7f10e12c78c674ced83da378cd159465d4b09176d8dfca240864b0d6f38c2",
@@ -698,12 +722,12 @@
698
722
  "bytes": 5187
699
723
  },
700
724
  "mcp/handlers/v2-checkpoint.d.ts": {
701
- "sha256": "97e1d3ddcb5f92137312c6516b6c4ff2f18dec7a7a83657db30198aedd67e7e1",
702
- "bytes": 259
725
+ "sha256": "6e09be1bf0b7277c997553d24e97bd332a83734062346a0f67211f6836391118",
726
+ "bytes": 1475
703
727
  },
704
728
  "mcp/handlers/v2-checkpoint.js": {
705
- "sha256": "48c20ca225f9595f845c2692083d581a3e1ebdb3f423b210ef8b37c69e727954",
706
- "bytes": 9558
729
+ "sha256": "70542251d386ba3b59aed224f41abea319b54bd975056f2dbf8b0f333358ea75",
730
+ "bytes": 10893
707
731
  },
708
732
  "mcp/handlers/v2-context-budget.d.ts": {
709
733
  "sha256": "cbad1741a183d52c9cbe558be2e09f776843d1f3ec8cd28d6d0d230668e4298c",
@@ -746,44 +770,44 @@
746
770
  "bytes": 2981
747
771
  },
748
772
  "mcp/handlers/v2-execution/continue-advance.d.ts": {
749
- "sha256": "93c700c8760eb0ef8aec6c9d5cf1348d8c4b4d4ff2c876c1c67b551996f0a613",
750
- "bytes": 1830
773
+ "sha256": "27d1f41f608611ba2faa0daf400ef8601c163af5558667c175865e565e95183a",
774
+ "bytes": 2026
751
775
  },
752
776
  "mcp/handlers/v2-execution/continue-advance.js": {
753
- "sha256": "864b892e6e69afbe300dbc748d0b6f3476d299b5cbaea36b5197748f9972611b",
754
- "bytes": 8332
777
+ "sha256": "1591d4c6f31022d1ecafec841239baaa78642052fbca7a28d6b9827b654085a4",
778
+ "bytes": 8263
755
779
  },
756
780
  "mcp/handlers/v2-execution/continue-rehydrate.d.ts": {
757
- "sha256": "af7475b7effe57f18fa8379bfd128d17afb2d27fe1c058c6f2ee8f5b2632e3d0",
758
- "bytes": 1312
781
+ "sha256": "5e5fe5bdc3b8427c6661756d666494298aeb63ba0d69dee64a0294cbdd5fab6a",
782
+ "bytes": 1508
759
783
  },
760
784
  "mcp/handlers/v2-execution/continue-rehydrate.js": {
761
- "sha256": "b77850715f6d4300a5b9b7b86063a02eed0e63410bdf6b1572bdae3d40b8a32f",
762
- "bytes": 8585
785
+ "sha256": "4758cacc11ecf346aadea6070cd38c44380941029fe654890148e3b01c4bb94f",
786
+ "bytes": 8190
763
787
  },
764
788
  "mcp/handlers/v2-execution/index.d.ts": {
765
- "sha256": "481d74c4ab444964ac9c71e0348da91abd642352a6fc1c69cff70e300d76881e",
766
- "bytes": 1185
789
+ "sha256": "e60e1e0c65e51d101fb06248e882494e6df52762e1d68f5de7081c1cf1ec8bc5",
790
+ "bytes": 1226
767
791
  },
768
792
  "mcp/handlers/v2-execution/index.js": {
769
- "sha256": "bc131f6e61d85dd46cf500dab4b6a5865180186f2361205d108e57d05e29ebfe",
770
- "bytes": 4716
793
+ "sha256": "3f35cb1abc2f6b65bef43fc3f59f48e8b558a369cb714c698b9b5b3ad4c1bdae",
794
+ "bytes": 4182
771
795
  },
772
796
  "mcp/handlers/v2-execution/replay.d.ts": {
773
- "sha256": "88368784d730be895f024d370d33d1fbb96293147c3edaf65e2a29297556a586",
774
- "bytes": 2885
797
+ "sha256": "bbf97633d7e47af3574a9690a1976bb474ca49cecc08af1d5c07e90f9868036d",
798
+ "bytes": 2570
775
799
  },
776
800
  "mcp/handlers/v2-execution/replay.js": {
777
- "sha256": "d6093949107dd69571e90264617fb6159b6b8bfca7d065d3533796732e01bdb2",
778
- "bytes": 12661
801
+ "sha256": "d6b5c83d5fffc88de425c64aa6571e7a469af4ee87e0088471c1ef05ff471b5e",
802
+ "bytes": 8654
779
803
  },
780
804
  "mcp/handlers/v2-execution/start.d.ts": {
781
- "sha256": "15d5e5f4a4613df286279075640e43a130179f39b9157b50d4d9e4123bcae6b3",
782
- "bytes": 2868
805
+ "sha256": "6847beabf35eb4c8780a649c99f4f60047c34e7ce7d8295c528d72f0f7d35f2d",
806
+ "bytes": 3036
783
807
  },
784
808
  "mcp/handlers/v2-execution/start.js": {
785
- "sha256": "cb40e5ec1d1461f41ce88722110af9f11396ab1d828d6eccb0b1b29a9ca68b65",
786
- "bytes": 16769
809
+ "sha256": "5a7a811a40f70f82feb7c158dfb1dc613c138c746f37ae3bd257c010a89041e0",
810
+ "bytes": 15842
787
811
  },
788
812
  "mcp/handlers/v2-resume.d.ts": {
789
813
  "sha256": "d88f6c35bcaf946666c837b72fda3702a2ebab5e478eb90f7b4b672a0e5fa24f",
@@ -802,12 +826,12 @@
802
826
  "bytes": 4335
803
827
  },
804
828
  "mcp/handlers/v2-token-ops.d.ts": {
805
- "sha256": "0403343468cd3835fb440b457e61050f13761ea60b23e3440ad0360b4ea07982",
806
- "bytes": 1948
829
+ "sha256": "bfbc6ab9ed413838cab8ee76fcf24cb7200bb1d257c08205b0eb5a8e48657b27",
830
+ "bytes": 3797
807
831
  },
808
832
  "mcp/handlers/v2-token-ops.js": {
809
- "sha256": "c786c2a8de7240989b2368762552373a2c3d397edd47122144c51e31a22d6203",
810
- "bytes": 3817
833
+ "sha256": "eaf40746f0696a0eb79f83e1f198401f9e23ee8fd4cd026d3a90d1010fe2b9ba",
834
+ "bytes": 22297
811
835
  },
812
836
  "mcp/handlers/v2-workflow.d.ts": {
813
837
  "sha256": "5c9590f121dd3708c516be3febe41d0be47531d643462b86b99b778ef0b54498",
@@ -842,20 +866,20 @@
842
866
  "bytes": 7535
843
867
  },
844
868
  "mcp/output-schemas.d.ts": {
845
- "sha256": "2affdeec60f5554506b034dd8d8d951b60a96c9237060c28bae4e877b75c7ba0",
846
- "bytes": 51242
869
+ "sha256": "32a181b901b0779d416f30013d8e29e189a310e5f21ce7709fb056c0f3d3878d",
870
+ "bytes": 46423
847
871
  },
848
872
  "mcp/output-schemas.js": {
849
- "sha256": "fd43722d021afb0c64cfe4356fc7ba9e41e6e3e9f9506866e0be0159d1b6908b",
850
- "bytes": 12115
873
+ "sha256": "ff6c519ea3e5fbeea32e98f1fae30aa390f0ecc68902458d68ee142400b67ded",
874
+ "bytes": 11763
851
875
  },
852
876
  "mcp/server.d.ts": {
853
877
  "sha256": "782a9a50797cac9c5f30e79556f809351d7eb176a16d7c603c09a5133cc25303",
854
878
  "bytes": 882
855
879
  },
856
880
  "mcp/server.js": {
857
- "sha256": "c07f8a6e8f89f7620a063673859dcc458212b068237949acff253f15856afd5f",
858
- "bytes": 14174
881
+ "sha256": "3d736e6173b069162a8034b667717f72770203efac4b1329202fcdfe4f6b78e7",
882
+ "bytes": 14668
859
883
  },
860
884
  "mcp/tool-description-provider.d.ts": {
861
885
  "sha256": "1d46abc3112e11b68e57197e846f5708293ec9b2281fa71a9124ee2aad71e41b",
@@ -922,8 +946,8 @@
922
946
  "bytes": 747
923
947
  },
924
948
  "mcp/types.d.ts": {
925
- "sha256": "d61a7d2b9a5f389d9fbf0092f6d38c3e6bb2925f41dce0270ed0c2e54ca856c9",
926
- "bytes": 4533
949
+ "sha256": "4c53a0e1e9e34e1bc8be2f04730316f4f0623905b3d5c6dc72170b76ca51a0fa",
950
+ "bytes": 4792
927
951
  },
928
952
  "mcp/types.js": {
929
953
  "sha256": "d10c4070e4c3454d80f0fa9cdc0e978c69c53c13fd09baa8710fcd802fed8926",
@@ -958,8 +982,8 @@
958
982
  "bytes": 81
959
983
  },
960
984
  "mcp/v2-response-formatter.js": {
961
- "sha256": "a2e0b576e49bdf66272dcd56ce91f451456afc236e8957af5e574bb458b30727",
962
- "bytes": 6949
985
+ "sha256": "73ecb53715bbf47a701d33b375450a0e0c35e54cf48363caab36f8257d502caa",
986
+ "bytes": 6884
963
987
  },
964
988
  "mcp/v2/tool-registry.d.ts": {
965
989
  "sha256": "d4d4927728c3cab1c014661d499dd0119538371bc6c5e821a4cd31df7abebedf",
@@ -970,12 +994,12 @@
970
994
  "bytes": 3119
971
995
  },
972
996
  "mcp/v2/tools.d.ts": {
973
- "sha256": "9915bd42c9ab096875021a24c0c97ad112331595e5d734abdd2856f9f49f80e4",
974
- "bytes": 6884
997
+ "sha256": "c37af21e8580767b050b0ee3193edbe0372f6062486f0ebc3d013f0ef1c87a86",
998
+ "bytes": 6174
975
999
  },
976
1000
  "mcp/v2/tools.js": {
977
- "sha256": "e3755649cb0fbf6332a7f330dec558bf998489533c95d7684c4668a4c566896e",
978
- "bytes": 8360
1001
+ "sha256": "e17001ab98c09796f57de4983d634b6441e7e6879e8c5a9f546a8c36295b197f",
1002
+ "bytes": 7274
979
1003
  },
980
1004
  "mcp/validation/bounded-json.d.ts": {
981
1005
  "sha256": "82203ac6123d5c6989606c3b5405aaea99ab829c8958835f9ae3ba45b8bc8fd5",
@@ -1162,8 +1186,8 @@
1162
1186
  "bytes": 931
1163
1187
  },
1164
1188
  "runtime/runtime-mode.d.ts": {
1165
- "sha256": "3b5c86c747a0313ff55b3b4688ce1060a9ec98b43b65f196af6bf4eb7e45ac14",
1166
- "bytes": 125
1189
+ "sha256": "1e16c5848884f11889cebc863251a1024cde6afb5bafb15503a091151e0550f2",
1190
+ "bytes": 152
1167
1191
  },
1168
1192
  "runtime/runtime-mode.js": {
1169
1193
  "sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
@@ -1434,12 +1458,12 @@
1434
1458
  "bytes": 942
1435
1459
  },
1436
1460
  "v2/durable-core/domain/prompt-renderer.d.ts": {
1437
- "sha256": "dd9854d489a03ac57975dd1ecee6e73a4bcc8b78e61c5cd5b394307aab708a7b",
1438
- "bytes": 935
1461
+ "sha256": "6bbafe042ad3e6be2043f8d79ffbf4b3e800dbc862427b41e02e7986357a9df5",
1462
+ "bytes": 968
1439
1463
  },
1440
1464
  "v2/durable-core/domain/prompt-renderer.js": {
1441
- "sha256": "5021f3cc9e59db56c5aeddcc8ed6f69df7ea1b1f3011d685695021e039376e49",
1442
- "bytes": 13910
1465
+ "sha256": "43a0bce6e074755b5385723f956ce670736d216e8ab47fcbc02bfa3d162dbc3f",
1466
+ "bytes": 14004
1443
1467
  },
1444
1468
  "v2/durable-core/domain/reason-model.d.ts": {
1445
1469
  "sha256": "650fcb2d9969a4e6123cccbd4913f4d57aeab21a19bb907aa1e11f95e5a95089",
@@ -1674,7 +1698,7 @@
1674
1698
  "bytes": 2983
1675
1699
  },
1676
1700
  "v2/durable-core/schemas/export-bundle/index.d.ts": {
1677
- "sha256": "3f9c52313003c77762c13e144e8084b07d6b235d4f2867c43808e141bf269f0f",
1701
+ "sha256": "3106396993ba9d99bdb557b3b273b74a4c5efaa5c2084b2b56d5ca1824532e3f",
1678
1702
  "bytes": 479882
1679
1703
  },
1680
1704
  "v2/durable-core/schemas/export-bundle/index.js": {
@@ -1730,7 +1754,7 @@
1730
1754
  "bytes": 2138
1731
1755
  },
1732
1756
  "v2/durable-core/schemas/session/events.d.ts": {
1733
- "sha256": "9bb0857364918ef47dd379eef819b20c3d060536cf2c62aa4bf21caebabc2a25",
1757
+ "sha256": "c6cecb6de60953fc0b2c2612d501700dae5103270c8d1d8e806716e4ba1c0ecc",
1734
1758
  "bytes": 73576
1735
1759
  },
1736
1760
  "v2/durable-core/schemas/session/events.js": {
@@ -1786,7 +1810,7 @@
1786
1810
  "bytes": 77
1787
1811
  },
1788
1812
  "v2/durable-core/schemas/session/validation-event.d.ts": {
1789
- "sha256": "1321e99a03480126ce25276b3c9de56e2be3604876bca4644309469ae468a57f",
1813
+ "sha256": "a1fc1ffba0962f93b430aed289744eebac6cf970d94c6f2c55cc7dad3cfef37e",
1790
1814
  "bytes": 2206
1791
1815
  },
1792
1816
  "v2/durable-core/schemas/session/validation-event.js": {
@@ -1810,13 +1834,21 @@
1810
1834
  "bytes": 4205
1811
1835
  },
1812
1836
  "v2/durable-core/tokens/payloads.d.ts": {
1813
- "sha256": "bcde54eeb05560aa6095d890837fdb3453a14712fb6061e71e7110909a09084d",
1837
+ "sha256": "f0428631b6addaa4c842a1abb4d9e4b1f26cb647b6f42a99060114ccb64eab28",
1814
1838
  "bytes": 6921
1815
1839
  },
1816
1840
  "v2/durable-core/tokens/payloads.js": {
1817
1841
  "sha256": "151393f91330c05482344d4c73ee2b50377a5424bc461c2c07d4b59d8cf3f1e4",
1818
1842
  "bytes": 2431
1819
1843
  },
1844
+ "v2/durable-core/tokens/short-token.d.ts": {
1845
+ "sha256": "f1184bd4c85ff8e202a31a75654aa73f0055111bc05cd4147eee6dbbbf298494",
1846
+ "bytes": 1783
1847
+ },
1848
+ "v2/durable-core/tokens/short-token.js": {
1849
+ "sha256": "4534d9626acb94772377907cbcbabfda2af90a82bb218b201c1eb50d072e16de",
1850
+ "bytes": 4909
1851
+ },
1820
1852
  "v2/durable-core/tokens/token-codec-capabilities.d.ts": {
1821
1853
  "sha256": "b86e47b85a2da29565c40870aefb4d207555e3c46f9ce6f195229969bead0ecf",
1822
1854
  "bytes": 272
@@ -1841,6 +1873,14 @@
1841
1873
  "sha256": "76cfd18c7cde51e4f4ae2360c483b8b79cd1bc4af37b7ff58c4cace7a381d12f",
1842
1874
  "bytes": 4302
1843
1875
  },
1876
+ "v2/durable-core/tokens/token-patterns.d.ts": {
1877
+ "sha256": "b9d4e6f852a95e8552a9ae4bdc4303cb1aa1987a0da531cb9c501b5615731573",
1878
+ "bytes": 206
1879
+ },
1880
+ "v2/durable-core/tokens/token-patterns.js": {
1881
+ "sha256": "4d3d152bc7cbf74411323c4e05dc14813897c9c5be56a72867d8909c53b178a5",
1882
+ "bytes": 648
1883
+ },
1844
1884
  "v2/durable-core/tokens/token-signer.d.ts": {
1845
1885
  "sha256": "30b3da7d6463b8ec10ff91155fe33dd77ce8789df1159a287f0e46fdc42e1407",
1846
1886
  "bytes": 1051
@@ -1849,6 +1889,14 @@
1849
1889
  "sha256": "15a8f8b7dac5ab4449f389c75ce7c13a163f639ade481c3890a7f527d23f500d",
1850
1890
  "bytes": 3441
1851
1891
  },
1892
+ "v2/infra/in-memory/token-alias-store/index.d.ts": {
1893
+ "sha256": "8a1fcaa5fe230987df979a6653e88851c23e8376bb62e3dc306ec477cde207a7",
1894
+ "bytes": 786
1895
+ },
1896
+ "v2/infra/in-memory/token-alias-store/index.js": {
1897
+ "sha256": "771f19e9c28819a0d7c8035c4d624c17c607bfa257c72cfeefacf16d12af355a",
1898
+ "bytes": 1479
1899
+ },
1852
1900
  "v2/infra/local/base32/index.d.ts": {
1853
1901
  "sha256": "054ad32b03c22e9c797196024f2c2a43111f682ee4ab15f82ef3b9313c392723",
1854
1902
  "bytes": 300
@@ -1882,12 +1930,12 @@
1882
1930
  "bytes": 457
1883
1931
  },
1884
1932
  "v2/infra/local/data-dir/index.d.ts": {
1885
- "sha256": "71333d489f957d106c1cd81e477793f807cc8a58d6ccc240e2539448a880a856",
1886
- "bytes": 817
1933
+ "sha256": "fa6e659499c6c742be9f4182c0d705770d2086696956b02d5415b2c5a8c7a44f",
1934
+ "bytes": 847
1887
1935
  },
1888
1936
  "v2/infra/local/data-dir/index.js": {
1889
- "sha256": "a01efc77fc442dfb326c970cb31241886d832b3330255ee0360b28e5d632a78c",
1890
- "bytes": 3036
1937
+ "sha256": "29dd90a80d199cf16e79169efbc1c06a37ea63254416917cbac8f5e0a81c7f8c",
1938
+ "bytes": 3128
1891
1939
  },
1892
1940
  "v2/infra/local/directory-listing/index.d.ts": {
1893
1941
  "sha256": "3139014cb738db3b0f10beca01a3a4a35b9ab8e72c8889b3bbff204fdbcb6b6c",
@@ -1993,6 +2041,14 @@
1993
2041
  "sha256": "459fd31e84f6003ff11872000493850d5e2e450f711526c72b344b310b413b38",
1994
2042
  "bytes": 276
1995
2043
  },
2044
+ "v2/infra/local/token-alias-store/index.d.ts": {
2045
+ "sha256": "d2b8bb38ba2238170395932bafd9fb8af9adf136912e83678e9ff0d7c5858c83",
2046
+ "bytes": 1038
2047
+ },
2048
+ "v2/infra/local/token-alias-store/index.js": {
2049
+ "sha256": "2b363ed209265ab328045239a6866b577213460214778b036a6a049158d4802d",
2050
+ "bytes": 4717
2051
+ },
1996
2052
  "v2/infra/local/utf8/index.d.ts": {
1997
2053
  "sha256": "33bfc597ed162a3711e3130d48f9dabf03580861f70fc57b1da4ccb2ec723d46",
1998
2054
  "bytes": 181
@@ -2034,8 +2090,8 @@
2034
2090
  "bytes": 77
2035
2091
  },
2036
2092
  "v2/ports/data-dir.port.d.ts": {
2037
- "sha256": "bfaca40462a3334b9e8fe7e7f7136d36e85e35405cc017a403e9670a28bbe3c8",
2038
- "bytes": 580
2093
+ "sha256": "f3b73eb92fa52a657ef54eb9e3c62bdd2a6c265771fc2e23d6526f2ef558cf9c",
2094
+ "bytes": 610
2039
2095
  },
2040
2096
  "v2/ports/data-dir.port.js": {
2041
2097
  "sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
@@ -2137,6 +2193,14 @@
2137
2193
  "sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
2138
2194
  "bytes": 77
2139
2195
  },
2196
+ "v2/ports/token-alias-store.port.d.ts": {
2197
+ "sha256": "42f10d6fc8641c96679d7448ec073a65418f4ea32ee32cc3981000759ba205fb",
2198
+ "bytes": 1233
2199
+ },
2200
+ "v2/ports/token-alias-store.port.js": {
2201
+ "sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
2202
+ "bytes": 77
2203
+ },
2140
2204
  "v2/ports/utf8.port.d.ts": {
2141
2205
  "sha256": "4c23ce010468e950c83f9111f54d143cce03a0aab36878a42ae4d06b8c58067d",
2142
2206
  "bytes": 71
@@ -1,3 +1,33 @@
1
- import type { ToolContext, ToolResult } from '../types.js';
1
+ import type { z } from 'zod';
2
+ import type { ResultAsync as RA } from 'neverthrow';
3
+ import type { ToolContext, ToolResult, V2ToolContext } from '../types.js';
2
4
  import type { V2CheckpointWorkflowInput } from '../v2/tools.js';
5
+ import { V2CheckpointWorkflowOutputSchema } from '../output-schemas.js';
6
+ import { type ToolFailure } from './v2-execution-helpers.js';
7
+ import type { ExecutionSessionGateErrorV2 } from '../../v2/usecases/execution-session-gate.js';
8
+ import type { SessionEventLogStoreError } from '../../v2/ports/session-event-log-store.port.js';
9
+ type CheckpointOutput = z.infer<typeof V2CheckpointWorkflowOutputSchema>;
10
+ export type CheckpointError = {
11
+ readonly kind: 'precondition_failed';
12
+ readonly message: string;
13
+ } | {
14
+ readonly kind: 'token_signing_failed';
15
+ readonly cause: unknown;
16
+ } | {
17
+ readonly kind: 'validation_failed';
18
+ readonly failure: ToolFailure;
19
+ } | {
20
+ readonly kind: 'missing_node_or_run';
21
+ } | {
22
+ readonly kind: 'event_schema_invalid';
23
+ readonly issues: string;
24
+ } | {
25
+ readonly kind: 'gate_failed';
26
+ readonly cause: ExecutionSessionGateErrorV2;
27
+ } | {
28
+ readonly kind: 'store_failed';
29
+ readonly cause: SessionEventLogStoreError;
30
+ };
3
31
  export declare function handleV2CheckpointWorkflow(input: V2CheckpointWorkflowInput, ctx: ToolContext): Promise<ToolResult<unknown>>;
32
+ export declare function executeCheckpoint(input: V2CheckpointWorkflowInput, ctx: V2ToolContext): RA<CheckpointOutput, CheckpointError>;
33
+ export {};