@exaudeus/workrail 0.11.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.
- package/dist/config/feature-flags.js +1 -1
- package/dist/di/container.js +72 -0
- package/dist/di/tokens.d.ts +13 -0
- package/dist/di/tokens.js +13 -0
- package/dist/manifest.json +109 -93
- package/dist/mcp/error-mapper.d.ts +3 -8
- package/dist/mcp/error-mapper.js +41 -19
- package/dist/mcp/handlers/session.js +25 -11
- package/dist/mcp/handlers/v2-execution-helpers.d.ts +99 -0
- package/dist/mcp/handlers/v2-execution-helpers.js +249 -0
- package/dist/mcp/handlers/v2-execution.d.ts +4 -0
- package/dist/mcp/handlers/v2-execution.js +1061 -0
- package/dist/mcp/handlers/v2-workflow.js +7 -7
- package/dist/mcp/handlers/workflow.js +21 -12
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +4 -1
- package/dist/mcp/output-schemas.d.ts +411 -4
- package/dist/mcp/output-schemas.js +57 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +57 -31
- package/dist/mcp/tool-descriptions.js +17 -0
- package/dist/mcp/tools.js +12 -0
- package/dist/mcp/types/tool-description-types.d.ts +1 -1
- package/dist/mcp/types/tool-description-types.js +2 -0
- package/dist/mcp/types.d.ts +38 -3
- package/dist/mcp/types.js +32 -3
- package/dist/mcp/v2/tool-registry.js +16 -1
- package/dist/mcp/v2/tools.d.ts +45 -0
- package/dist/mcp/v2/tools.js +21 -1
- package/dist/mcp/validation/workflow-next-prevalidate.d.ts +2 -3
- package/dist/mcp/validation/workflow-next-prevalidate.js +38 -27
- package/dist/v2/durable-core/ids/index.d.ts +2 -0
- package/dist/v2/durable-core/ids/index.js +4 -0
- package/dist/v2/durable-core/schemas/compiled-workflow/index.d.ts +100 -6
- package/dist/v2/durable-core/schemas/compiled-workflow/index.js +18 -3
- package/dist/v2/durable-core/schemas/session/events.d.ts +80 -50
- package/dist/v2/durable-core/schemas/session/events.js +27 -9
- package/dist/v2/durable-core/schemas/session/manifest.d.ts +2 -2
- package/dist/v2/durable-core/tokens/index.d.ts +2 -0
- package/dist/v2/durable-core/tokens/index.js +4 -1
- package/dist/v2/durable-core/tokens/payloads.d.ts +4 -4
- package/dist/v2/infra/local/pinned-workflow-store/index.d.ts +3 -3
- package/dist/v2/infra/local/pinned-workflow-store/index.js +1 -1
- package/dist/v2/infra/local/session-lock/index.js +1 -1
- package/dist/v2/infra/local/session-store/index.d.ts +0 -1
- package/dist/v2/infra/local/session-store/index.js +348 -280
- package/dist/v2/ports/pinned-workflow-store.port.d.ts +3 -3
- package/dist/v2/ports/session-event-log-store.port.d.ts +1 -1
- package/dist/v2/ports/session-lock.port.d.ts +1 -1
- package/dist/v2/read-only/v1-to-v2-shim.d.ts +6 -1
- package/dist/v2/read-only/v1-to-v2-shim.js +16 -4
- package/dist/v2/usecases/execution-session-gate.d.ts +3 -2
- package/dist/v2/usecases/execution-session-gate.js +98 -101
- package/package.json +2 -1
- package/workflows/coding-task-workflow-agentic.json +326 -69
- package/workflows/design-thinking-workflow-autonomous.agentic.json +1 -1
- package/workflows/design-thinking-workflow.json +1 -1
|
@@ -57,7 +57,7 @@ exports.FEATURE_FLAG_DEFINITIONS = [
|
|
|
57
57
|
key: 'v2Tools',
|
|
58
58
|
envVar: 'WORKRAIL_ENABLE_V2_TOOLS',
|
|
59
59
|
defaultValue: false,
|
|
60
|
-
description: 'Enable WorkRail v2 MCP tools (
|
|
60
|
+
description: 'Enable WorkRail v2 MCP tools (Slices 1–3: list/inspect/start/continue) behind an explicit opt-in flag',
|
|
61
61
|
since: '0.9.0',
|
|
62
62
|
stable: false,
|
|
63
63
|
},
|
package/dist/di/container.js
CHANGED
|
@@ -172,6 +172,77 @@ async function registerServices() {
|
|
|
172
172
|
tsyringe_1.container.registerSingleton(tokens_js_1.DI.Mcp.DescriptionProvider, ToolDescriptionProvider);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
+
async function registerV2Services() {
|
|
176
|
+
const { LocalDataDirV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/data-dir/index.js')));
|
|
177
|
+
const { NodeFileSystemV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/fs/index.js')));
|
|
178
|
+
const { NodeSha256V2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/sha256/index.js')));
|
|
179
|
+
const { NodeCryptoV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/crypto/index.js')));
|
|
180
|
+
const { NodeHmacSha256V2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/hmac-sha256/index.js')));
|
|
181
|
+
tsyringe_1.container.register(tokens_js_1.DI.V2.DataDir, {
|
|
182
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)(() => new LocalDataDirV2(process.env)),
|
|
183
|
+
});
|
|
184
|
+
tsyringe_1.container.register(tokens_js_1.DI.V2.FileSystem, {
|
|
185
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)(() => new NodeFileSystemV2()),
|
|
186
|
+
});
|
|
187
|
+
tsyringe_1.container.register(tokens_js_1.DI.V2.Sha256, {
|
|
188
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)(() => new NodeSha256V2()),
|
|
189
|
+
});
|
|
190
|
+
tsyringe_1.container.register(tokens_js_1.DI.V2.Crypto, {
|
|
191
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)(() => new NodeCryptoV2()),
|
|
192
|
+
});
|
|
193
|
+
tsyringe_1.container.register(tokens_js_1.DI.V2.HmacSha256, {
|
|
194
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)(() => new NodeHmacSha256V2()),
|
|
195
|
+
});
|
|
196
|
+
const { LocalKeyringV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/keyring/index.js')));
|
|
197
|
+
const { LocalSessionEventLogStoreV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/session-store/index.js')));
|
|
198
|
+
const { LocalSnapshotStoreV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/snapshot-store/index.js')));
|
|
199
|
+
const { LocalPinnedWorkflowStoreV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/pinned-workflow-store/index.js')));
|
|
200
|
+
const { LocalSessionLockV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/session-lock/index.js')));
|
|
201
|
+
tsyringe_1.container.register(tokens_js_1.DI.V2.Keyring, {
|
|
202
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
|
|
203
|
+
const dataDir = c.resolve(tokens_js_1.DI.V2.DataDir);
|
|
204
|
+
const fs = c.resolve(tokens_js_1.DI.V2.FileSystem);
|
|
205
|
+
return new LocalKeyringV2(dataDir, fs);
|
|
206
|
+
}),
|
|
207
|
+
});
|
|
208
|
+
tsyringe_1.container.register(tokens_js_1.DI.V2.SessionStore, {
|
|
209
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
|
|
210
|
+
const dataDir = c.resolve(tokens_js_1.DI.V2.DataDir);
|
|
211
|
+
const fs = c.resolve(tokens_js_1.DI.V2.FileSystem);
|
|
212
|
+
const sha256 = c.resolve(tokens_js_1.DI.V2.Sha256);
|
|
213
|
+
return new LocalSessionEventLogStoreV2(dataDir, fs, sha256);
|
|
214
|
+
}),
|
|
215
|
+
});
|
|
216
|
+
tsyringe_1.container.register(tokens_js_1.DI.V2.SnapshotStore, {
|
|
217
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
|
|
218
|
+
const dataDir = c.resolve(tokens_js_1.DI.V2.DataDir);
|
|
219
|
+
const fs = c.resolve(tokens_js_1.DI.V2.FileSystem);
|
|
220
|
+
const crypto = c.resolve(tokens_js_1.DI.V2.Crypto);
|
|
221
|
+
return new LocalSnapshotStoreV2(dataDir, fs, crypto);
|
|
222
|
+
}),
|
|
223
|
+
});
|
|
224
|
+
tsyringe_1.container.register(tokens_js_1.DI.V2.PinnedWorkflowStore, {
|
|
225
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
|
|
226
|
+
const dataDir = c.resolve(tokens_js_1.DI.V2.DataDir);
|
|
227
|
+
return new LocalPinnedWorkflowStoreV2(dataDir);
|
|
228
|
+
}),
|
|
229
|
+
});
|
|
230
|
+
tsyringe_1.container.register(tokens_js_1.DI.V2.SessionLock, {
|
|
231
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
|
|
232
|
+
const dataDir = c.resolve(tokens_js_1.DI.V2.DataDir);
|
|
233
|
+
const fs = c.resolve(tokens_js_1.DI.V2.FileSystem);
|
|
234
|
+
return new LocalSessionLockV2(dataDir, fs);
|
|
235
|
+
}),
|
|
236
|
+
});
|
|
237
|
+
const { ExecutionSessionGateV2 } = await Promise.resolve().then(() => __importStar(require('../v2/usecases/execution-session-gate.js')));
|
|
238
|
+
tsyringe_1.container.register(tokens_js_1.DI.V2.ExecutionGate, {
|
|
239
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
|
|
240
|
+
const lock = c.resolve(tokens_js_1.DI.V2.SessionLock);
|
|
241
|
+
const store = c.resolve(tokens_js_1.DI.V2.SessionStore);
|
|
242
|
+
return new ExecutionSessionGateV2(lock, store);
|
|
243
|
+
}),
|
|
244
|
+
});
|
|
245
|
+
}
|
|
175
246
|
async function initializeContainer(options = {}) {
|
|
176
247
|
if (initialized)
|
|
177
248
|
return;
|
|
@@ -196,6 +267,7 @@ async function initializeContainer(options = {}) {
|
|
|
196
267
|
registerRuntime(options);
|
|
197
268
|
await registerConfig();
|
|
198
269
|
await registerStorageChain();
|
|
270
|
+
await registerV2Services();
|
|
199
271
|
await registerServices();
|
|
200
272
|
initialized = true;
|
|
201
273
|
console.error('[DI] Container initialized');
|
package/dist/di/tokens.d.ts
CHANGED
|
@@ -21,6 +21,19 @@ export declare const DI: {
|
|
|
21
21
|
readonly Mcp: {
|
|
22
22
|
readonly DescriptionProvider: symbol;
|
|
23
23
|
};
|
|
24
|
+
readonly V2: {
|
|
25
|
+
readonly DataDir: symbol;
|
|
26
|
+
readonly FileSystem: symbol;
|
|
27
|
+
readonly Sha256: symbol;
|
|
28
|
+
readonly Crypto: symbol;
|
|
29
|
+
readonly HmacSha256: symbol;
|
|
30
|
+
readonly Keyring: symbol;
|
|
31
|
+
readonly SessionStore: symbol;
|
|
32
|
+
readonly SnapshotStore: symbol;
|
|
33
|
+
readonly PinnedWorkflowStore: symbol;
|
|
34
|
+
readonly SessionLock: symbol;
|
|
35
|
+
readonly ExecutionGate: symbol;
|
|
36
|
+
};
|
|
24
37
|
readonly Runtime: {
|
|
25
38
|
readonly Mode: symbol;
|
|
26
39
|
readonly ProcessLifecyclePolicy: symbol;
|
package/dist/di/tokens.js
CHANGED
|
@@ -24,6 +24,19 @@ exports.DI = {
|
|
|
24
24
|
Mcp: {
|
|
25
25
|
DescriptionProvider: Symbol('Mcp.DescriptionProvider'),
|
|
26
26
|
},
|
|
27
|
+
V2: {
|
|
28
|
+
DataDir: Symbol('V2.DataDir'),
|
|
29
|
+
FileSystem: Symbol('V2.FileSystem'),
|
|
30
|
+
Sha256: Symbol('V2.Sha256'),
|
|
31
|
+
Crypto: Symbol('V2.Crypto'),
|
|
32
|
+
HmacSha256: Symbol('V2.HmacSha256'),
|
|
33
|
+
Keyring: Symbol('V2.Keyring'),
|
|
34
|
+
SessionStore: Symbol('V2.SessionStore'),
|
|
35
|
+
SnapshotStore: Symbol('V2.SnapshotStore'),
|
|
36
|
+
PinnedWorkflowStore: Symbol('V2.PinnedWorkflowStore'),
|
|
37
|
+
SessionLock: Symbol('V2.SessionLock'),
|
|
38
|
+
ExecutionGate: Symbol('V2.ExecutionGate'),
|
|
39
|
+
},
|
|
27
40
|
Runtime: {
|
|
28
41
|
Mode: Symbol('Runtime.Mode'),
|
|
29
42
|
ProcessLifecyclePolicy: Symbol('Runtime.ProcessLifecyclePolicy'),
|
package/dist/manifest.json
CHANGED
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
"bytes": 1512
|
|
231
231
|
},
|
|
232
232
|
"config/feature-flags.js": {
|
|
233
|
-
"sha256": "
|
|
233
|
+
"sha256": "2881b750bbaeb9af57ae2acfa476ed94f7da2a95781478b9713d978f30700356",
|
|
234
234
|
"bytes": 6920
|
|
235
235
|
},
|
|
236
236
|
"core/error-handler.d.ts": {
|
|
@@ -246,16 +246,16 @@
|
|
|
246
246
|
"bytes": 565
|
|
247
247
|
},
|
|
248
248
|
"di/container.js": {
|
|
249
|
-
"sha256": "
|
|
250
|
-
"bytes":
|
|
249
|
+
"sha256": "e218c6ffb6df78297b0773c62668488ef40597c503feed1dd596a245a34a63a9",
|
|
250
|
+
"bytes": 17292
|
|
251
251
|
},
|
|
252
252
|
"di/tokens.d.ts": {
|
|
253
|
-
"sha256": "
|
|
254
|
-
"bytes":
|
|
253
|
+
"sha256": "cca34f8375516d26213b50c156378ad3d535798a04229dbddf9f2c7da3639eca",
|
|
254
|
+
"bytes": 1734
|
|
255
255
|
},
|
|
256
256
|
"di/tokens.js": {
|
|
257
|
-
"sha256": "
|
|
258
|
-
"bytes":
|
|
257
|
+
"sha256": "973c597f2ef8de75678731a120eccaa4b31f75e14744ee1936f23a6b36b3a3b0",
|
|
258
|
+
"bytes": 2147
|
|
259
259
|
},
|
|
260
260
|
"domain/execution/error.d.ts": {
|
|
261
261
|
"sha256": "2eac85c42ec399a23724f868641eeadd0d196b4d324ee4caaff82a6b46155bd9",
|
|
@@ -490,60 +490,76 @@
|
|
|
490
490
|
"bytes": 476
|
|
491
491
|
},
|
|
492
492
|
"mcp/error-mapper.d.ts": {
|
|
493
|
-
"sha256": "
|
|
494
|
-
"bytes":
|
|
493
|
+
"sha256": "9ed8afa42fd432ab9bdf781c90ec157eb51ef03e2b17afbb74ad54b91e5bae8a",
|
|
494
|
+
"bytes": 267
|
|
495
495
|
},
|
|
496
496
|
"mcp/error-mapper.js": {
|
|
497
|
-
"sha256": "
|
|
498
|
-
"bytes":
|
|
497
|
+
"sha256": "1437bf9380090920512565c0d685a268af29d8b7e747eff62904e1090e69c854",
|
|
498
|
+
"bytes": 3735
|
|
499
499
|
},
|
|
500
500
|
"mcp/handlers/session.d.ts": {
|
|
501
501
|
"sha256": "38926e69a0e4935d1dbcdc53848be9fff0e4d8f96827883da3216f217918fa82",
|
|
502
502
|
"bytes": 1394
|
|
503
503
|
},
|
|
504
504
|
"mcp/handlers/session.js": {
|
|
505
|
-
"sha256": "
|
|
506
|
-
"bytes":
|
|
505
|
+
"sha256": "4955f0b09766426318f5d21ab3bd8967b11666830000504e44ef3b94beb526ee",
|
|
506
|
+
"bytes": 6622
|
|
507
|
+
},
|
|
508
|
+
"mcp/handlers/v2-execution-helpers.d.ts": {
|
|
509
|
+
"sha256": "67f1faa4f650e33dd567c3ae1d8a5077df1141a0496a2f07ac55eaa122c08704",
|
|
510
|
+
"bytes": 4383
|
|
511
|
+
},
|
|
512
|
+
"mcp/handlers/v2-execution-helpers.js": {
|
|
513
|
+
"sha256": "1e512e54f2b90630d47148fed604b8f302fe72cfca19fa91592b9fd2115d517f",
|
|
514
|
+
"bytes": 12773
|
|
515
|
+
},
|
|
516
|
+
"mcp/handlers/v2-execution.d.ts": {
|
|
517
|
+
"sha256": "0d96c77d37702b43645399044ceb3f7a772388be7020c2ed4f99e99b21c5dc73",
|
|
518
|
+
"bytes": 399
|
|
519
|
+
},
|
|
520
|
+
"mcp/handlers/v2-execution.js": {
|
|
521
|
+
"sha256": "38f4a3090340b93f263032a7affe4639c590db862781083ae70576b0b373c0d5",
|
|
522
|
+
"bytes": 53062
|
|
507
523
|
},
|
|
508
524
|
"mcp/handlers/v2-workflow.d.ts": {
|
|
509
525
|
"sha256": "9fbd4d44854e2060c54982b21e72c608970bb2bd107bb15a8388b26c6b492e55",
|
|
510
526
|
"bytes": 397
|
|
511
527
|
},
|
|
512
528
|
"mcp/handlers/v2-workflow.js": {
|
|
513
|
-
"sha256": "
|
|
514
|
-
"bytes":
|
|
529
|
+
"sha256": "2185cf808fa0aeb164f72a3f596b32b4b4e6b87c3b2925efd71251c2c7d1f968",
|
|
530
|
+
"bytes": 5291
|
|
515
531
|
},
|
|
516
532
|
"mcp/handlers/workflow.d.ts": {
|
|
517
533
|
"sha256": "050565039a20af3f7fc8311337ff4547438ecc59433e5744aacce8f203326774",
|
|
518
534
|
"bytes": 1748
|
|
519
535
|
},
|
|
520
536
|
"mcp/handlers/workflow.js": {
|
|
521
|
-
"sha256": "
|
|
522
|
-
"bytes":
|
|
537
|
+
"sha256": "99ff7aac9705ef540cc5681515cf2aa9650d886761f7ae69f829ff87ac772756",
|
|
538
|
+
"bytes": 8246
|
|
523
539
|
},
|
|
524
540
|
"mcp/index.d.ts": {
|
|
525
|
-
"sha256": "
|
|
526
|
-
"bytes":
|
|
541
|
+
"sha256": "525b4247cf90ba3af66769462bcfaab5dbf38ee8c49d2a9ceec1e4b38e33511b",
|
|
542
|
+
"bytes": 1964
|
|
527
543
|
},
|
|
528
544
|
"mcp/index.js": {
|
|
529
|
-
"sha256": "
|
|
530
|
-
"bytes":
|
|
545
|
+
"sha256": "6895e8416b29418900d039a7acb3d486be844d36582d6117f22c0e7d03fa212e",
|
|
546
|
+
"bytes": 7535
|
|
531
547
|
},
|
|
532
548
|
"mcp/output-schemas.d.ts": {
|
|
533
|
-
"sha256": "
|
|
534
|
-
"bytes":
|
|
549
|
+
"sha256": "5a79d1dad82e2a2cf57dde65aafc8aa20fee1513784ee6eb1aba9ae2e71d95a3",
|
|
550
|
+
"bytes": 22948
|
|
535
551
|
},
|
|
536
552
|
"mcp/output-schemas.js": {
|
|
537
|
-
"sha256": "
|
|
538
|
-
"bytes":
|
|
553
|
+
"sha256": "efe70158aa94df76b17d0200c193fb867c254a5d62ec12d960aaa6f8d8b9f5bb",
|
|
554
|
+
"bytes": 6367
|
|
539
555
|
},
|
|
540
556
|
"mcp/server.d.ts": {
|
|
541
|
-
"sha256": "
|
|
542
|
-
"bytes":
|
|
557
|
+
"sha256": "bec49b8d07e189a53db7100d2f0e1e84ffe03150f04e1b06908ee3282982b4a2",
|
|
558
|
+
"bytes": 168
|
|
543
559
|
},
|
|
544
560
|
"mcp/server.js": {
|
|
545
|
-
"sha256": "
|
|
546
|
-
"bytes":
|
|
561
|
+
"sha256": "1354714d71946272737a8844c1c3878c72893b48f67ee22bc91eef699f1d12a2",
|
|
562
|
+
"bytes": 13315
|
|
547
563
|
},
|
|
548
564
|
"mcp/tool-description-provider.d.ts": {
|
|
549
565
|
"sha256": "1d46abc3112e11b68e57197e846f5708293ec9b2281fa71a9124ee2aad71e41b",
|
|
@@ -558,8 +574,8 @@
|
|
|
558
574
|
"bytes": 132
|
|
559
575
|
},
|
|
560
576
|
"mcp/tool-descriptions.js": {
|
|
561
|
-
"sha256": "
|
|
562
|
-
"bytes":
|
|
577
|
+
"sha256": "e0612a2bcef42904c1415b92c4c155f55989f81a0e75145c83e411ea4a7a2c6e",
|
|
578
|
+
"bytes": 7762
|
|
563
579
|
},
|
|
564
580
|
"mcp/tool-factory.d.ts": {
|
|
565
581
|
"sha256": "0fe3c6b863b2d7aef0c3d659ff54f3a9ee8a0a3c2005b6565d2f8ad517bc7211",
|
|
@@ -574,40 +590,40 @@
|
|
|
574
590
|
"bytes": 5952
|
|
575
591
|
},
|
|
576
592
|
"mcp/tools.js": {
|
|
577
|
-
"sha256": "
|
|
578
|
-
"bytes":
|
|
593
|
+
"sha256": "5464baad21a5b5cb25ba46a6b326c0fd4e46ebbd0c125fc41079a1d7530b9ba5",
|
|
594
|
+
"bytes": 7702
|
|
579
595
|
},
|
|
580
596
|
"mcp/types.d.ts": {
|
|
581
|
-
"sha256": "
|
|
582
|
-
"bytes":
|
|
597
|
+
"sha256": "77bb938f717b095d93514c7d5b57c9685ec704adc602e7614c0dc182ab8adb7d",
|
|
598
|
+
"bytes": 3362
|
|
583
599
|
},
|
|
584
600
|
"mcp/types.js": {
|
|
585
|
-
"sha256": "
|
|
586
|
-
"bytes":
|
|
601
|
+
"sha256": "0c12576fd0053115ff096fe26b38f77f1e830b7ec4781aaf94564827c4c9e81a",
|
|
602
|
+
"bytes": 1253
|
|
587
603
|
},
|
|
588
604
|
"mcp/types/tool-description-types.d.ts": {
|
|
589
|
-
"sha256": "
|
|
590
|
-
"bytes":
|
|
605
|
+
"sha256": "772592838382804a09e83235dd2fdee038681cb2af5ab3ec967de60fa0109c36",
|
|
606
|
+
"bytes": 775
|
|
591
607
|
},
|
|
592
608
|
"mcp/types/tool-description-types.js": {
|
|
593
|
-
"sha256": "
|
|
594
|
-
"bytes":
|
|
609
|
+
"sha256": "f3f459da53c1677533fdaedbe4b98e0ea5af0d29fd20d62111c7eea7039ed02a",
|
|
610
|
+
"bytes": 743
|
|
595
611
|
},
|
|
596
612
|
"mcp/v2/tool-registry.d.ts": {
|
|
597
613
|
"sha256": "e97ae56ce8bc994fb33d130e4dfec6fb65d34dc15b6f828fc36010197da6bdbe",
|
|
598
614
|
"bytes": 479
|
|
599
615
|
},
|
|
600
616
|
"mcp/v2/tool-registry.js": {
|
|
601
|
-
"sha256": "
|
|
602
|
-
"bytes":
|
|
617
|
+
"sha256": "33bf91363777bbb14d985978e0b056c67a6f7574dd3e8b572603a1b1db457237",
|
|
618
|
+
"bytes": 2001
|
|
603
619
|
},
|
|
604
620
|
"mcp/v2/tools.d.ts": {
|
|
605
|
-
"sha256": "
|
|
606
|
-
"bytes":
|
|
621
|
+
"sha256": "0ef14d1e8e375a17ff7f1edc26ded4a636207c6f9f998136d5910f7f86537602",
|
|
622
|
+
"bytes": 2579
|
|
607
623
|
},
|
|
608
624
|
"mcp/v2/tools.js": {
|
|
609
|
-
"sha256": "
|
|
610
|
-
"bytes":
|
|
625
|
+
"sha256": "9e934ea8a5f83bffc68d343970292267b207f67d72a5aa824348967e53777820",
|
|
626
|
+
"bytes": 2333
|
|
611
627
|
},
|
|
612
628
|
"mcp/validation/bounded-json.d.ts": {
|
|
613
629
|
"sha256": "82203ac6123d5c6989606c3b5405aaea99ab829c8958835f9ae3ba45b8bc8fd5",
|
|
@@ -618,12 +634,12 @@
|
|
|
618
634
|
"bytes": 834
|
|
619
635
|
},
|
|
620
636
|
"mcp/validation/workflow-next-prevalidate.d.ts": {
|
|
621
|
-
"sha256": "
|
|
622
|
-
"bytes":
|
|
637
|
+
"sha256": "179058225dfb17f4be02d6105bbacdaa99f1441cfc25062b38d8283f0bf35b5a",
|
|
638
|
+
"bytes": 254
|
|
623
639
|
},
|
|
624
640
|
"mcp/validation/workflow-next-prevalidate.js": {
|
|
625
|
-
"sha256": "
|
|
626
|
-
"bytes":
|
|
641
|
+
"sha256": "537c7fd9068f45d5aee4a90e834a27e8bb1ee7fe2c6df860964c125e2979d86e",
|
|
642
|
+
"bytes": 3670
|
|
627
643
|
},
|
|
628
644
|
"mcp/zod-to-json-schema.d.ts": {
|
|
629
645
|
"sha256": "c80cfa6980a88c823ac47d04706b2223a351de3f4c76ee778f81ad3dda2c766b",
|
|
@@ -874,12 +890,12 @@
|
|
|
874
890
|
"bytes": 447
|
|
875
891
|
},
|
|
876
892
|
"v2/durable-core/ids/index.d.ts": {
|
|
877
|
-
"sha256": "
|
|
878
|
-
"bytes":
|
|
893
|
+
"sha256": "5525efc423ad30635996907f7560f53559e49e33a64411a684370ebd1ae56410",
|
|
894
|
+
"bytes": 1792
|
|
879
895
|
},
|
|
880
896
|
"v2/durable-core/ids/index.js": {
|
|
881
|
-
"sha256": "
|
|
882
|
-
"bytes":
|
|
897
|
+
"sha256": "a6499471fb67d7a43923c898ef79193390f18912090f27886b52678d13805f11",
|
|
898
|
+
"bytes": 1306
|
|
883
899
|
},
|
|
884
900
|
"v2/durable-core/ids/with-healthy-session-lock.d.ts": {
|
|
885
901
|
"sha256": "dc1812850b9ce69c0135d575b0994ac4fa7b874bf9db7a1838b6a3390ef31ae2",
|
|
@@ -898,12 +914,12 @@
|
|
|
898
914
|
"bytes": 428
|
|
899
915
|
},
|
|
900
916
|
"v2/durable-core/schemas/compiled-workflow/index.d.ts": {
|
|
901
|
-
"sha256": "
|
|
902
|
-
"bytes":
|
|
917
|
+
"sha256": "5146bd86e5785117e260276775a3783871c141425a03f4643bf421a00e5b9bf2",
|
|
918
|
+
"bytes": 3645
|
|
903
919
|
},
|
|
904
920
|
"v2/durable-core/schemas/compiled-workflow/index.js": {
|
|
905
|
-
"sha256": "
|
|
906
|
-
"bytes":
|
|
921
|
+
"sha256": "a1b6befdee89a853f22c7077e3470b17bcee8ce0dabd6d5f2dafe270b3820977",
|
|
922
|
+
"bytes": 1350
|
|
907
923
|
},
|
|
908
924
|
"v2/durable-core/schemas/execution-snapshot/execution-snapshot.v1.d.ts": {
|
|
909
925
|
"sha256": "96ad2f741274a55ecfeb3cd4c385938db6d4f4f25fee7ea460158b09e4422988",
|
|
@@ -930,12 +946,12 @@
|
|
|
930
946
|
"bytes": 2983
|
|
931
947
|
},
|
|
932
948
|
"v2/durable-core/schemas/session/events.d.ts": {
|
|
933
|
-
"sha256": "
|
|
934
|
-
"bytes":
|
|
949
|
+
"sha256": "9a50360562cf5bb2d544c9b39fb9451bdbacf6f15e85c69a4faa86a1959fa6f9",
|
|
950
|
+
"bytes": 63045
|
|
935
951
|
},
|
|
936
952
|
"v2/durable-core/schemas/session/events.js": {
|
|
937
|
-
"sha256": "
|
|
938
|
-
"bytes":
|
|
953
|
+
"sha256": "a709131e5b89f70e67170b2491ece5887bc8443167857a736f92fde5881ebc41",
|
|
954
|
+
"bytes": 15655
|
|
939
955
|
},
|
|
940
956
|
"v2/durable-core/schemas/session/index.d.ts": {
|
|
941
957
|
"sha256": "f4f500d33d212760f480d91fafd4474f7b12f9239a6c5e9c2d80d0fe96207b65",
|
|
@@ -946,7 +962,7 @@
|
|
|
946
962
|
"bytes": 715
|
|
947
963
|
},
|
|
948
964
|
"v2/durable-core/schemas/session/manifest.d.ts": {
|
|
949
|
-
"sha256": "
|
|
965
|
+
"sha256": "e70c4e1f52ee00057e0ad6d8b7fff0f0a4a6f85cf4228ab72bc3e704245f0a31",
|
|
950
966
|
"bytes": 1534
|
|
951
967
|
},
|
|
952
968
|
"v2/durable-core/schemas/session/manifest.js": {
|
|
@@ -970,15 +986,15 @@
|
|
|
970
986
|
"bytes": 558
|
|
971
987
|
},
|
|
972
988
|
"v2/durable-core/tokens/index.d.ts": {
|
|
973
|
-
"sha256": "
|
|
974
|
-
"bytes":
|
|
989
|
+
"sha256": "29ad2efe0f8c6905693ffd57428ed3186cd103c0b112a8280a97abc5ea83af79",
|
|
990
|
+
"bytes": 805
|
|
975
991
|
},
|
|
976
992
|
"v2/durable-core/tokens/index.js": {
|
|
977
|
-
"sha256": "
|
|
978
|
-
"bytes":
|
|
993
|
+
"sha256": "774e2fe4d30a2731e53a111953a4e5fcc1e668977f054270e5fbbfc351a321c9",
|
|
994
|
+
"bytes": 2924
|
|
979
995
|
},
|
|
980
996
|
"v2/durable-core/tokens/payloads.d.ts": {
|
|
981
|
-
"sha256": "
|
|
997
|
+
"sha256": "568d7ba9f83ea7584b1c815f79b920f8e548e71a244a6dc5709dc981fc5286d4",
|
|
982
998
|
"bytes": 6756
|
|
983
999
|
},
|
|
984
1000
|
"v2/durable-core/tokens/payloads.js": {
|
|
@@ -1042,28 +1058,28 @@
|
|
|
1042
1058
|
"bytes": 3839
|
|
1043
1059
|
},
|
|
1044
1060
|
"v2/infra/local/pinned-workflow-store/index.d.ts": {
|
|
1045
|
-
"sha256": "
|
|
1046
|
-
"bytes":
|
|
1061
|
+
"sha256": "61670e576d288f9f98b6314f71a652ca7a20eaf402ecad263e94563cb9cd5ac7",
|
|
1062
|
+
"bytes": 803
|
|
1047
1063
|
},
|
|
1048
1064
|
"v2/infra/local/pinned-workflow-store/index.js": {
|
|
1049
|
-
"sha256": "
|
|
1050
|
-
"bytes":
|
|
1065
|
+
"sha256": "6a0edfda32ae0e10021702deda75f9cc1c891e1cc02d9e4ad947517f0bde740a",
|
|
1066
|
+
"bytes": 3731
|
|
1051
1067
|
},
|
|
1052
1068
|
"v2/infra/local/session-lock/index.d.ts": {
|
|
1053
1069
|
"sha256": "e6c6d39259037c4aaaf4465f68d27e24512252b5547b726ec1e86857e1eac046",
|
|
1054
1070
|
"bytes": 727
|
|
1055
1071
|
},
|
|
1056
1072
|
"v2/infra/local/session-lock/index.js": {
|
|
1057
|
-
"sha256": "
|
|
1058
|
-
"bytes":
|
|
1073
|
+
"sha256": "06be71237bdf98431e39b97d7ded7737d4bf5efab440f81f541b5ce43768e720",
|
|
1074
|
+
"bytes": 1649
|
|
1059
1075
|
},
|
|
1060
1076
|
"v2/infra/local/session-store/index.d.ts": {
|
|
1061
|
-
"sha256": "
|
|
1062
|
-
"bytes":
|
|
1077
|
+
"sha256": "9f2a4bd619722ff114100a51468aab6a3e4123f9454ce31cfce32aea63e57a2c",
|
|
1078
|
+
"bytes": 1447
|
|
1063
1079
|
},
|
|
1064
1080
|
"v2/infra/local/session-store/index.js": {
|
|
1065
|
-
"sha256": "
|
|
1066
|
-
"bytes":
|
|
1081
|
+
"sha256": "19a652715895943c3fa453406a43c91aaf4260f582c943fde5fc5fdc34dbdb28",
|
|
1082
|
+
"bytes": 26913
|
|
1067
1083
|
},
|
|
1068
1084
|
"v2/infra/local/sha256/index.d.ts": {
|
|
1069
1085
|
"sha256": "8a727b7e54a38275ca6f9f1b8730f97cfc0a212df035df1bdc58e716e6824230",
|
|
@@ -1114,24 +1130,24 @@
|
|
|
1114
1130
|
"bytes": 77
|
|
1115
1131
|
},
|
|
1116
1132
|
"v2/ports/pinned-workflow-store.port.d.ts": {
|
|
1117
|
-
"sha256": "
|
|
1118
|
-
"bytes":
|
|
1133
|
+
"sha256": "5105f42539f6ad813d468fc5c7f3c17648855731bb1b5f088354afae1856dac1",
|
|
1134
|
+
"bytes": 608
|
|
1119
1135
|
},
|
|
1120
1136
|
"v2/ports/pinned-workflow-store.port.js": {
|
|
1121
1137
|
"sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
|
|
1122
1138
|
"bytes": 77
|
|
1123
1139
|
},
|
|
1124
1140
|
"v2/ports/session-event-log-store.port.d.ts": {
|
|
1125
|
-
"sha256": "
|
|
1126
|
-
"bytes":
|
|
1141
|
+
"sha256": "80743c9f579d6aad94c47eaae80617c7ab82d192148e6734dcea70ac902d1b86",
|
|
1142
|
+
"bytes": 2000
|
|
1127
1143
|
},
|
|
1128
1144
|
"v2/ports/session-event-log-store.port.js": {
|
|
1129
1145
|
"sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
|
|
1130
1146
|
"bytes": 77
|
|
1131
1147
|
},
|
|
1132
1148
|
"v2/ports/session-lock.port.d.ts": {
|
|
1133
|
-
"sha256": "
|
|
1134
|
-
"bytes":
|
|
1149
|
+
"sha256": "5554f057bd087a8e00fd9b4a14004b6c5a1bee2d596f99ff8c3dce8e94de9f01",
|
|
1150
|
+
"bytes": 792
|
|
1135
1151
|
},
|
|
1136
1152
|
"v2/ports/session-lock.port.js": {
|
|
1137
1153
|
"sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
|
|
@@ -1218,20 +1234,20 @@
|
|
|
1218
1234
|
"bytes": 550
|
|
1219
1235
|
},
|
|
1220
1236
|
"v2/read-only/v1-to-v2-shim.d.ts": {
|
|
1221
|
-
"sha256": "
|
|
1222
|
-
"bytes":
|
|
1237
|
+
"sha256": "c420c5473b8b804e3e44a9e91a073bce20787abb3fd5c56b47ecab0293dc9171",
|
|
1238
|
+
"bytes": 463
|
|
1223
1239
|
},
|
|
1224
1240
|
"v2/read-only/v1-to-v2-shim.js": {
|
|
1225
|
-
"sha256": "
|
|
1226
|
-
"bytes":
|
|
1241
|
+
"sha256": "6ea788b80605db6d2057b3d5e520be48ace8afe6d8f37bf55cef00ba1471a6b7",
|
|
1242
|
+
"bytes": 1935
|
|
1227
1243
|
},
|
|
1228
1244
|
"v2/usecases/execution-session-gate.d.ts": {
|
|
1229
|
-
"sha256": "
|
|
1230
|
-
"bytes":
|
|
1245
|
+
"sha256": "339c4a8e02a77416e725e063a57d39a20788244498ae2c7a31dc48d111af6280",
|
|
1246
|
+
"bytes": 2084
|
|
1231
1247
|
},
|
|
1232
1248
|
"v2/usecases/execution-session-gate.js": {
|
|
1233
|
-
"sha256": "
|
|
1234
|
-
"bytes":
|
|
1249
|
+
"sha256": "8b9e23c784c018e58bae73a7dd3a0a154fba4da91e76ae346b5d6682c18ec10b",
|
|
1250
|
+
"bytes": 7581
|
|
1235
1251
|
}
|
|
1236
1252
|
}
|
|
1237
1253
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import type { DomainError } from '../domain/execution/error.js';
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
readonly message: string;
|
|
6
|
-
readonly suggestion?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function mapDomainErrorToToolError(err: DomainError): ToolErrorMapping;
|
|
9
|
-
export declare function mapUnknownErrorToToolError(err: unknown): ToolErrorMapping;
|
|
2
|
+
import type { ToolError } from './types.js';
|
|
3
|
+
export declare function mapDomainErrorToToolError(err: DomainError): ToolError;
|
|
4
|
+
export declare function mapUnknownErrorToToolError(err: unknown): ToolError;
|
package/dist/mcp/error-mapper.js
CHANGED
|
@@ -4,55 +4,77 @@ exports.mapDomainErrorToToolError = mapDomainErrorToToolError;
|
|
|
4
4
|
exports.mapUnknownErrorToToolError = mapUnknownErrorToToolError;
|
|
5
5
|
const bounded_json_js_1 = require("./validation/bounded-json.js");
|
|
6
6
|
function assertNever(x) {
|
|
7
|
-
|
|
7
|
+
return {
|
|
8
|
+
type: 'error',
|
|
9
|
+
code: 'INTERNAL_ERROR',
|
|
10
|
+
message: `Unhandled DomainError variant: ${JSON.stringify(x)}`,
|
|
11
|
+
retry: { kind: 'not_retryable' },
|
|
12
|
+
details: { invariantViolation: 'exhaustiveness_check_failed' },
|
|
13
|
+
};
|
|
8
14
|
}
|
|
9
15
|
function mapDomainErrorToToolError(err) {
|
|
10
16
|
switch (err._tag) {
|
|
11
17
|
case 'WorkflowNotFound':
|
|
12
18
|
return {
|
|
19
|
+
type: 'error',
|
|
13
20
|
code: 'NOT_FOUND',
|
|
14
21
|
message: err.message,
|
|
15
|
-
|
|
22
|
+
retry: { kind: 'not_retryable' },
|
|
23
|
+
details: { suggestion: `Check available workflows with workflow_list` },
|
|
16
24
|
};
|
|
17
25
|
case 'InvalidState':
|
|
18
26
|
return {
|
|
27
|
+
type: 'error',
|
|
19
28
|
code: 'VALIDATION_ERROR',
|
|
20
29
|
message: err.message,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
retry: { kind: 'not_retryable' },
|
|
31
|
+
details: {
|
|
32
|
+
suggestion: `Use the "state" returned by the last workflow_next call.\n` +
|
|
33
|
+
`If you are completing a step, send an event like:\n` +
|
|
34
|
+
(0, bounded_json_js_1.toBoundedJsonString)({
|
|
35
|
+
kind: 'step_completed',
|
|
36
|
+
stepInstanceId: {
|
|
37
|
+
stepId: '<previous next.stepInstanceId.stepId>',
|
|
38
|
+
loopPath: [],
|
|
39
|
+
},
|
|
40
|
+
}, 512),
|
|
41
|
+
},
|
|
30
42
|
};
|
|
31
43
|
case 'InvalidLoop':
|
|
32
44
|
return {
|
|
45
|
+
type: 'error',
|
|
33
46
|
code: 'VALIDATION_ERROR',
|
|
34
47
|
message: err.message,
|
|
35
|
-
|
|
48
|
+
retry: { kind: 'not_retryable' },
|
|
49
|
+
details: { suggestion: 'Validate the workflow definition and ensure loop/body step IDs are consistent' },
|
|
36
50
|
};
|
|
37
51
|
case 'MissingContext':
|
|
38
52
|
return {
|
|
53
|
+
type: 'error',
|
|
39
54
|
code: 'PRECONDITION_FAILED',
|
|
40
55
|
message: err.message,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
retry: { kind: 'not_retryable' },
|
|
57
|
+
details: {
|
|
58
|
+
suggestion: 'Provide the required keys in the `context` object for condition evaluation and loop inputs.\n' +
|
|
59
|
+
'Example:\n' +
|
|
60
|
+
(0, bounded_json_js_1.toBoundedJsonString)({ context: { '<requiredKey>': '<value>' } }, 256),
|
|
61
|
+
},
|
|
44
62
|
};
|
|
45
63
|
case 'ConditionEvalFailed':
|
|
46
64
|
return {
|
|
65
|
+
type: 'error',
|
|
47
66
|
code: 'INTERNAL_ERROR',
|
|
48
67
|
message: err.message,
|
|
49
|
-
|
|
68
|
+
retry: { kind: 'not_retryable' },
|
|
69
|
+
details: { suggestion: 'Validate workflow JSON and condition expressions with workflow_validate_json' },
|
|
50
70
|
};
|
|
51
71
|
case 'MaxIterationsExceeded':
|
|
52
72
|
return {
|
|
73
|
+
type: 'error',
|
|
53
74
|
code: 'PRECONDITION_FAILED',
|
|
54
75
|
message: err.message,
|
|
55
|
-
|
|
76
|
+
retry: { kind: 'not_retryable' },
|
|
77
|
+
details: { suggestion: `Increase maxIterations for loop '${err.loopId}' or adjust its condition/body` },
|
|
56
78
|
};
|
|
57
79
|
default:
|
|
58
80
|
return assertNever(err);
|
|
@@ -60,7 +82,7 @@ function mapDomainErrorToToolError(err) {
|
|
|
60
82
|
}
|
|
61
83
|
function mapUnknownErrorToToolError(err) {
|
|
62
84
|
if (err instanceof Error) {
|
|
63
|
-
return { code: 'INTERNAL_ERROR', message: err.message };
|
|
85
|
+
return { type: 'error', code: 'INTERNAL_ERROR', message: err.message, retry: { kind: 'not_retryable' } };
|
|
64
86
|
}
|
|
65
|
-
return { code: 'INTERNAL_ERROR', message: String(err) };
|
|
87
|
+
return { type: 'error', code: 'INTERNAL_ERROR', message: String(err), retry: { kind: 'not_retryable' } };
|
|
66
88
|
}
|