@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
@@ -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 (Slice 1: list_workflows, inspect_workflow) behind an explicit opt-in flag',
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
  },
@@ -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');
@@ -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'),