@exaudeus/workrail 3.12.0 → 3.14.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 (54) hide show
  1. package/dist/console/assets/{index-CRgjJiMS.js → index-EsSXrC_a.js} +11 -11
  2. package/dist/console/index.html +1 -1
  3. package/dist/di/container.js +8 -0
  4. package/dist/di/tokens.d.ts +1 -0
  5. package/dist/di/tokens.js +1 -0
  6. package/dist/infrastructure/session/HttpServer.js +2 -14
  7. package/dist/manifest.json +93 -53
  8. package/dist/mcp/boundary-coercion.d.ts +2 -0
  9. package/dist/mcp/boundary-coercion.js +73 -0
  10. package/dist/mcp/handler-factory.d.ts +1 -1
  11. package/dist/mcp/handler-factory.js +13 -6
  12. package/dist/mcp/handlers/v2-manage-workflow-source.d.ts +7 -0
  13. package/dist/mcp/handlers/v2-manage-workflow-source.js +50 -0
  14. package/dist/mcp/handlers/v2-workflow.d.ts +3 -0
  15. package/dist/mcp/handlers/v2-workflow.js +58 -0
  16. package/dist/mcp/output-schemas.d.ts +93 -0
  17. package/dist/mcp/output-schemas.js +8 -1
  18. package/dist/mcp/server.js +2 -0
  19. package/dist/mcp/tool-descriptions.js +20 -0
  20. package/dist/mcp/tools.js +6 -0
  21. package/dist/mcp/types/tool-description-types.d.ts +1 -1
  22. package/dist/mcp/types/tool-description-types.js +1 -0
  23. package/dist/mcp/types/workflow-tool-edition.d.ts +1 -1
  24. package/dist/mcp/types.d.ts +2 -0
  25. package/dist/mcp/v2/tool-registry.js +8 -0
  26. package/dist/mcp/v2/tools.d.ts +12 -0
  27. package/dist/mcp/v2/tools.js +7 -1
  28. package/dist/types/workflow-definition.d.ts +1 -0
  29. package/dist/v2/infra/in-memory/managed-source-store/index.d.ts +8 -0
  30. package/dist/v2/infra/in-memory/managed-source-store/index.js +33 -0
  31. package/dist/v2/infra/local/data-dir/index.d.ts +2 -0
  32. package/dist/v2/infra/local/data-dir/index.js +6 -0
  33. package/dist/v2/infra/local/managed-source-store/index.d.ts +15 -0
  34. package/dist/v2/infra/local/managed-source-store/index.js +164 -0
  35. package/dist/v2/ports/data-dir.port.d.ts +2 -0
  36. package/dist/v2/ports/managed-source-store.port.d.ts +25 -0
  37. package/dist/v2/ports/managed-source-store.port.js +2 -0
  38. package/package.json +2 -1
  39. package/spec/authoring-spec.json +9 -2
  40. package/spec/workflow.schema.json +418 -96
  41. package/workflows/adaptive-ticket-creation.json +276 -282
  42. package/workflows/document-creation-workflow.json +70 -191
  43. package/workflows/documentation-update-workflow.json +59 -309
  44. package/workflows/intelligent-test-case-generation.json +37 -212
  45. package/workflows/personal-learning-materials-creation-branched.json +1 -21
  46. package/workflows/presentation-creation.json +143 -308
  47. package/workflows/relocation-workflow-us.json +161 -535
  48. package/workflows/scoped-documentation-workflow.json +110 -181
  49. package/workflows/workflow-for-workflows.v2.json +72 -16
  50. package/workflows/CHANGELOG-bug-investigation.md +0 -298
  51. package/workflows/bug-investigation.agentic.json +0 -212
  52. package/workflows/bug-investigation.json +0 -112
  53. package/workflows/mr-review-workflow.agentic.json +0 -538
  54. package/workflows/mr-review-workflow.json +0 -277
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>WorkRail Console</title>
7
- <script type="module" crossorigin src="/console/assets/index-CRgjJiMS.js"></script>
7
+ <script type="module" crossorigin src="/console/assets/index-EsSXrC_a.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/console/assets/index-DW78t31j.css">
9
9
  </head>
10
10
  <body>
@@ -224,6 +224,7 @@ async function registerV2Services() {
224
224
  const { LocalKeyringV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/keyring/index.js')));
225
225
  const { LocalTokenAliasStoreV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/token-alias-store/index.js')));
226
226
  const { LocalRememberedRootsStoreV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/remembered-roots-store/index.js')));
227
+ const { LocalManagedSourceStoreV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/managed-source-store/index.js')));
227
228
  const { LocalSessionEventLogStoreV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/session-store/index.js')));
228
229
  const { LocalSnapshotStoreV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/snapshot-store/index.js')));
229
230
  const { LocalPinnedWorkflowStoreV2 } = await Promise.resolve().then(() => __importStar(require('../v2/infra/local/pinned-workflow-store/index.js')));
@@ -251,6 +252,13 @@ async function registerV2Services() {
251
252
  return new LocalRememberedRootsStoreV2(dataDir, fs);
252
253
  }),
253
254
  });
255
+ tsyringe_1.container.register(tokens_js_1.DI.V2.ManagedSourceStore, {
256
+ useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
257
+ const dataDir = c.resolve(tokens_js_1.DI.V2.DataDir);
258
+ const fs = c.resolve(tokens_js_1.DI.V2.FileSystem);
259
+ return new LocalManagedSourceStoreV2(dataDir, fs);
260
+ }),
261
+ });
254
262
  tsyringe_1.container.register(tokens_js_1.DI.V2.SessionStore, {
255
263
  useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
256
264
  const dataDir = c.resolve(tokens_js_1.DI.V2.DataDir);
@@ -40,6 +40,7 @@ export declare const DI: {
40
40
  readonly SessionLock: symbol;
41
41
  readonly TokenAliasStore: symbol;
42
42
  readonly RememberedRootsStore: symbol;
43
+ readonly ManagedSourceStore: symbol;
43
44
  readonly ExecutionGate: symbol;
44
45
  };
45
46
  readonly Runtime: {
package/dist/di/tokens.js CHANGED
@@ -43,6 +43,7 @@ exports.DI = {
43
43
  SessionLock: Symbol('V2.SessionLock'),
44
44
  TokenAliasStore: Symbol('V2.TokenAliasStore'),
45
45
  RememberedRootsStore: Symbol('V2.RememberedRootsStore'),
46
+ ManagedSourceStore: Symbol('V2.ManagedSourceStore'),
46
47
  ExecutionGate: Symbol('V2.ExecutionGate'),
47
48
  },
48
49
  Runtime: {
@@ -77,20 +77,8 @@ let HttpServer = class HttpServer {
77
77
  });
78
78
  }
79
79
  setupRoutes() {
80
- const webDir = path_1.default.join(__dirname, '../../../web');
81
- this.app.use(express_1.default.static(webDir));
82
- this.app.get('/', async (req, res) => {
83
- try {
84
- const indexPath = path_1.default.join(webDir, 'index.html');
85
- res.sendFile(indexPath);
86
- }
87
- catch (error) {
88
- res.status(500).json({
89
- error: 'Dashboard UI not found',
90
- message: 'The dashboard web files are not yet built. This is expected during development.',
91
- details: 'Web files will be available in a future step.'
92
- });
93
- }
80
+ this.app.get('/', (_req, res) => {
81
+ res.redirect('/console');
94
82
  });
95
83
  this.app.get('/api/sessions', async (req, res) => {
96
84
  try {
@@ -361,16 +361,16 @@
361
361
  "sha256": "aabbaca7582a27fb7e2b47df88218e6e96d26b8fb8799cab6d25808685bd9196",
362
362
  "bytes": 7686
363
363
  },
364
- "console/assets/index-CRgjJiMS.js": {
365
- "sha256": "3bfebdb0b5533a1732425549ee1f5d86a82164c4e9b2b93dcb630c5fe962ce08",
366
- "bytes": 553514
367
- },
368
364
  "console/assets/index-DW78t31j.css": {
369
365
  "sha256": "cf0b93064dfb0ad9193a55abc50b7c81317bf50c0af6d510928504983a73cf8f",
370
366
  "bytes": 37845
371
367
  },
368
+ "console/assets/index-EsSXrC_a.js": {
369
+ "sha256": "a40c36894f529d9acee0c29946fe258fd73f7c5c61691be3d37dcc1da5881713",
370
+ "bytes": 553811
371
+ },
372
372
  "console/index.html": {
373
- "sha256": "7f5476f4f2b41a5040d0e50b4d07bc93fef7e7364889d3de19355d3949f60279",
373
+ "sha256": "ffcfb5709926caf13817ad5d1a84d06ef0556e764ae191786f2e432742e5904f",
374
374
  "bytes": 417
375
375
  },
376
376
  "core/error-handler.d.ts": {
@@ -386,16 +386,16 @@
386
386
  "bytes": 565
387
387
  },
388
388
  "di/container.js": {
389
- "sha256": "adc19624cd812eecaad5b105f8521628dd19117493cd61d5c1ac2fb5ef51f18d",
390
- "bytes": 20531
389
+ "sha256": "ab1879b48037c59cf362749e2183913db5f476d820534b525a2c86f7a29cde5f",
390
+ "bytes": 21038
391
391
  },
392
392
  "di/tokens.d.ts": {
393
- "sha256": "258c404372076ed2f6c892daf546cec5da75a371d44acfadd1fa71e2918117a7",
394
- "bytes": 2038
393
+ "sha256": "04db6db34348aa36d897c85ab07eb1a386cb04e3595dbcb33525bd33974111ef",
394
+ "bytes": 2083
395
395
  },
396
396
  "di/tokens.js": {
397
- "sha256": "68f7bb382faa412efc57b8aac618ca92527e3f48d729996a556dd34c0af19f03",
398
- "bytes": 2523
397
+ "sha256": "a1c92d99ea499260dedfcdad612873b92be7a8f02dca5dcb0be3ec5a9daf87cc",
398
+ "bytes": 2584
399
399
  },
400
400
  "domain/execution/error.d.ts": {
401
401
  "sha256": "2eac85c42ec399a23724f868641eeadd0d196b4d324ee4caaff82a6b46155bd9",
@@ -538,8 +538,8 @@
538
538
  "bytes": 1975
539
539
  },
540
540
  "infrastructure/session/HttpServer.js": {
541
- "sha256": "1be0cec5c7bd1204f86f77fe01985ed4906fa2432b22a44b7b01b3aa179a4803",
542
- "bytes": 32534
541
+ "sha256": "9746196db40493db69e8d5dc6fbfa84c08a17783516664178e3527ba05d7c8f7",
542
+ "bytes": 31947
543
543
  },
544
544
  "infrastructure/session/SessionDataNormalizer.d.ts": {
545
545
  "sha256": "c89bb5e00d7d01fb4aa6d0095602541de53c425c6b99b67fa8367eb29cb63e9e",
@@ -669,6 +669,14 @@
669
669
  "sha256": "a825b696428c32b87fdef23722574acb965d8319928b121a287800991a715172",
670
670
  "bytes": 1599
671
671
  },
672
+ "mcp/boundary-coercion.d.ts": {
673
+ "sha256": "04f8a7bc0f65d43e05b54970c58a997f638a919114816d816ba0a4de7db8eaa7",
674
+ "bytes": 189
675
+ },
676
+ "mcp/boundary-coercion.js": {
677
+ "sha256": "4ab9ca177bef34188bd7e49841e8e653e65ae08cea6d44b6408eaf5d06508f17",
678
+ "bytes": 2280
679
+ },
672
680
  "mcp/error-mapper.d.ts": {
673
681
  "sha256": "c6e9db65c565063726442b73a4a0cf1a1c07d54c778a85cf0122c4c04ea6a5a9",
674
682
  "bytes": 268
@@ -678,12 +686,12 @@
678
686
  "bytes": 3982
679
687
  },
680
688
  "mcp/handler-factory.d.ts": {
681
- "sha256": "eaa97ae192a7c4a7e69f75bb7cf2a756af4b49e0efb329d679665c2106f0e054",
682
- "bytes": 883
689
+ "sha256": "61e6baa759f61fef0b01858c0d0ffbc3fb59bbd6b23311971e119aed125cface",
690
+ "bytes": 970
683
691
  },
684
692
  "mcp/handler-factory.js": {
685
- "sha256": "6eb67d1501582d1cfcf777d7d930a6cf3cb32ccbd450c7083133745ef27d2661",
686
- "bytes": 5381
693
+ "sha256": "c92ad6b90896e0ac3fa72074bb68684631fa3bcf9504d2f823681e37e1b62aff",
694
+ "bytes": 5897
687
695
  },
688
696
  "mcp/handlers/session.d.ts": {
689
697
  "sha256": "38926e69a0e4935d1dbcdc53848be9fff0e4d8f96827883da3216f217918fa82",
@@ -885,6 +893,14 @@
885
893
  "sha256": "2ed3b7b6245688aaf6f6011e00e8c42f8300134ba8fad179a04a6785553f6f4f",
886
894
  "bytes": 18983
887
895
  },
896
+ "mcp/handlers/v2-manage-workflow-source.d.ts": {
897
+ "sha256": "778de2201125a1c334522c9bcc760f9314289ef152e1e95c9629060bb086ba4e",
898
+ "bytes": 401
899
+ },
900
+ "mcp/handlers/v2-manage-workflow-source.js": {
901
+ "sha256": "0d854cf7adbfcfe60749875b82f615fc085c950c0aff23969ef24ab9e6654d7d",
902
+ "bytes": 2690
903
+ },
888
904
  "mcp/handlers/v2-reference-resolver.d.ts": {
889
905
  "sha256": "0b1d2640306b6a0c1067ca66bb20e6ec35d291b33dc328a78d5bfa8006394234",
890
906
  "bytes": 756
@@ -926,12 +942,12 @@
926
942
  "bytes": 22303
927
943
  },
928
944
  "mcp/handlers/v2-workflow.d.ts": {
929
- "sha256": "5c9590f121dd3708c516be3febe41d0be47531d643462b86b99b778ef0b54498",
930
- "bytes": 396
945
+ "sha256": "d2a6af1bc62630e62f10c9564c60b7f3e7d1ff0b4e6339416a6d6bfcd935ee53",
946
+ "bytes": 699
931
947
  },
932
948
  "mcp/handlers/v2-workflow.js": {
933
- "sha256": "e496675cf8ae2259e0c5a53692732a231fb4c923440214df4e54f696bb7ab734",
934
- "bytes": 16632
949
+ "sha256": "545ad0cafe58f42010db5e32be2cbb302d3d1fc989022e5803a0bce077cc91a1",
950
+ "bytes": 19047
935
951
  },
936
952
  "mcp/handlers/v2-workspace-resolution.d.ts": {
937
953
  "sha256": "dd4de57b4918ebe749cf8c1df70c02bf1effc50932634bae60db53c9a157e872",
@@ -958,12 +974,12 @@
958
974
  "bytes": 7991
959
975
  },
960
976
  "mcp/output-schemas.d.ts": {
961
- "sha256": "77c29cf4cc1500fccd383b8a725b3a4b30c7d1913ec31419b607b3e9f358f652",
962
- "bytes": 86643
977
+ "sha256": "8da92586db497fe2f37df296c3ac95751a6b326ceb0bd348f126b3a9f44515e5",
978
+ "bytes": 90073
963
979
  },
964
980
  "mcp/output-schemas.js": {
965
- "sha256": "692e8b71740b8b3f89a541b8bc57992ce1b4149b117c5e19d77988777e0b215e",
966
- "bytes": 19084
981
+ "sha256": "d3446f0480e80dd0c7030b42f66489e982b93b968700371cffcbf1fb8d0fed96",
982
+ "bytes": 19456
967
983
  },
968
984
  "mcp/render-envelope.d.ts": {
969
985
  "sha256": "22e83e1aba52968a7136cf289125a217b5f462a5a66a1eebe4669006e3326fdb",
@@ -986,8 +1002,8 @@
986
1002
  "bytes": 960
987
1003
  },
988
1004
  "mcp/server.js": {
989
- "sha256": "f1240cddafaa9b4a83a5e7e6b7176d1c628a63a92868626e420e5b44bc52e94a",
990
- "bytes": 11830
1005
+ "sha256": "15b090e4e5faf6c8b3d6fc56cf527a400b229d66cec8cfdf6e292e225c560509",
1006
+ "bytes": 11977
991
1007
  },
992
1008
  "mcp/step-content-envelope.d.ts": {
993
1009
  "sha256": "19bd63c4d4de1d5d93393d346625d28ffd1bebdc320d4ba4e694cb740ec97d3b",
@@ -1010,8 +1026,8 @@
1010
1026
  "bytes": 132
1011
1027
  },
1012
1028
  "mcp/tool-descriptions.js": {
1013
- "sha256": "5cd28a9bd851e64f2063743506d0a33c787803d1738141b23f557aa1e3240fff",
1014
- "bytes": 9921
1029
+ "sha256": "94aef95e6def1d74e025b3b817c14a625e5683b53ac3f8ceca52c271f864c525",
1030
+ "bytes": 10944
1015
1031
  },
1016
1032
  "mcp/tool-factory.d.ts": {
1017
1033
  "sha256": "0fe3c6b863b2d7aef0c3d659ff54f3a9ee8a0a3c2005b6565d2f8ad517bc7211",
@@ -1026,8 +1042,8 @@
1026
1042
  "bytes": 5976
1027
1043
  },
1028
1044
  "mcp/tools.js": {
1029
- "sha256": "bf9043c94b66e7692f70e9f5f36f408d40441bb69866bda4e7b0fd646eba6022",
1030
- "bytes": 8635
1045
+ "sha256": "bdea37dfe3f2ef98be01899b067f841c645bda69c23dddd9e181f94b4b157c5e",
1046
+ "bytes": 8822
1031
1047
  },
1032
1048
  "mcp/transports/http-entry.d.ts": {
1033
1049
  "sha256": "35d313b120dcf38643de9462559163581b89943fe432706986252e8b698b9507",
@@ -1070,24 +1086,24 @@
1070
1086
  "bytes": 747
1071
1087
  },
1072
1088
  "mcp/types.d.ts": {
1073
- "sha256": "e9677621e0a54c1756e854837b80fe7bd8da58d056aef2db8ab906e817f99b1e",
1074
- "bytes": 4950
1089
+ "sha256": "26de47115c67e38a7e3659bc404c60b3259b9bf5351286281876ebcaeea8a4ab",
1090
+ "bytes": 5100
1075
1091
  },
1076
1092
  "mcp/types.js": {
1077
1093
  "sha256": "d10c4070e4c3454d80f0fa9cdc0e978c69c53c13fd09baa8710fcd802fed8926",
1078
1094
  "bytes": 1608
1079
1095
  },
1080
1096
  "mcp/types/tool-description-types.d.ts": {
1081
- "sha256": "80984afa5283a0d651ff22c0c9b2d3ff14c85087aeaf735d306ae291d8cdfe4d",
1082
- "bytes": 823
1097
+ "sha256": "564cea96c0329903b1351fda5585918b9e1db4ad062ce7e06a4e4de832c1cdcc",
1098
+ "bytes": 849
1083
1099
  },
1084
1100
  "mcp/types/tool-description-types.js": {
1085
- "sha256": "40c1e5f76edcbfbdf18f203dae2f295cce191b6af670436aeff5bc65d74d1a6b",
1086
- "bytes": 799
1101
+ "sha256": "f21fce6922daff41454d8f14c1e2776fbc8a043e50f4e91b0d61b7a4c47a06d3",
1102
+ "bytes": 829
1087
1103
  },
1088
1104
  "mcp/types/workflow-tool-edition.d.ts": {
1089
- "sha256": "ebde63f0ea9de501946d75e050c9676c03d08b77b27ad858d88600249e480f6c",
1090
- "bytes": 1513
1105
+ "sha256": "cb8d9b05cf0d695d9d118296c822dfe50948ca9c84c4e84b1a327c052eafc216",
1106
+ "bytes": 1540
1091
1107
  },
1092
1108
  "mcp/types/workflow-tool-edition.js": {
1093
1109
  "sha256": "2dfd26acd3da2c249b728e7fc48c7eab3dc675f786e7689dbdeec53c25589369",
@@ -1114,16 +1130,16 @@
1114
1130
  "bytes": 408
1115
1131
  },
1116
1132
  "mcp/v2/tool-registry.js": {
1117
- "sha256": "cc80cc23bc9334aa5be889cbd6f67106f0b7e2e51eb722475f89216f960a12de",
1118
- "bytes": 3276
1133
+ "sha256": "f8e4fea08086b04161cd57a179ebc564b22002d8b498558787293d7f0089856e",
1134
+ "bytes": 3832
1119
1135
  },
1120
1136
  "mcp/v2/tools.d.ts": {
1121
- "sha256": "2247d8ef78cf2384fc666eda32dd486d7a1976c0b557189243cdcdfb350de891",
1122
- "bytes": 7339
1137
+ "sha256": "fe2cd956084dcdfe5fd992f7458cd58fa583711e20561b5ff46ea67e2e3ad6e5",
1138
+ "bytes": 7796
1123
1139
  },
1124
1140
  "mcp/v2/tools.js": {
1125
- "sha256": "30d231352ba8feb64273338da62e382c7018fbe2c79b948130b9fbb004284772",
1126
- "bytes": 11093
1141
+ "sha256": "a10837cfbcecf8d4bb7bd430e2895523094518bf066d803850eab1889e14c4f0",
1142
+ "bytes": 11831
1127
1143
  },
1128
1144
  "mcp/validation/bounded-json.d.ts": {
1129
1145
  "sha256": "82203ac6123d5c6989606c3b5405aaea99ab829c8958835f9ae3ba45b8bc8fd5",
@@ -1350,8 +1366,8 @@
1350
1366
  "bytes": 395
1351
1367
  },
1352
1368
  "types/workflow-definition.d.ts": {
1353
- "sha256": "052ef59dd8ee28dc2648eb5f30a60023af18bb92dcde9b0664cc035e42ca4f52",
1354
- "bytes": 5796
1369
+ "sha256": "683e5a939e0265f194a9a542d6c925222b090c5da5f9b94df07b0cf16ec40165",
1370
+ "bytes": 5847
1355
1371
  },
1356
1372
  "types/workflow-definition.js": {
1357
1373
  "sha256": "204e7500d3d0dc91b1716199efb89af4776fb488546661e809f76be9333ea65c",
@@ -2077,6 +2093,14 @@
2077
2093
  "sha256": "15a8f8b7dac5ab4449f389c75ce7c13a163f639ade481c3890a7f527d23f500d",
2078
2094
  "bytes": 3441
2079
2095
  },
2096
+ "v2/infra/in-memory/managed-source-store/index.d.ts": {
2097
+ "sha256": "fe06e50f66f9b542704884e0a4dd491e0380270ee41c52feb1217d327c37604e",
2098
+ "bytes": 544
2099
+ },
2100
+ "v2/infra/in-memory/managed-source-store/index.js": {
2101
+ "sha256": "14285880fd2ded3791039fb2fb9489ae7898ef9e0073cfb1b633097522ddcd09",
2102
+ "bytes": 1265
2103
+ },
2080
2104
  "v2/infra/in-memory/token-alias-store/index.d.ts": {
2081
2105
  "sha256": "8a1fcaa5fe230987df979a6653e88851c23e8376bb62e3dc306ec477cde207a7",
2082
2106
  "bytes": 786
@@ -2118,12 +2142,12 @@
2118
2142
  "bytes": 457
2119
2143
  },
2120
2144
  "v2/infra/local/data-dir/index.d.ts": {
2121
- "sha256": "fd652ef0dcf0db64b915c3592b1bd6b6cb272145dc0eed7c3a08bb635ddbe60a",
2122
- "bytes": 921
2145
+ "sha256": "082fce7c347f0e9fade727365c84010afce4cb1c10a56c31cd5598ba029a6f59",
2146
+ "bytes": 993
2123
2147
  },
2124
2148
  "v2/infra/local/data-dir/index.js": {
2125
- "sha256": "79cd5f9ee8ef7f7ca3d3db4868fc5f97b4bc8b002af514916905c412328f58a2",
2126
- "bytes": 3368
2149
+ "sha256": "79543d5c1797c34e171a848fd6c4bcef3c5f8aa76fbe58aa5ae68cfa9aca6d18",
2150
+ "bytes": 3602
2127
2151
  },
2128
2152
  "v2/infra/local/directory-listing/index.d.ts": {
2129
2153
  "sha256": "3139014cb738db3b0f10beca01a3a4a35b9ab8e72c8889b3bbff204fdbcb6b6c",
@@ -2165,6 +2189,14 @@
2165
2189
  "sha256": "cb8a95f098350689004cda4cd638b1ea640fd283705e505ad99c4a20726da321",
2166
2190
  "bytes": 4548
2167
2191
  },
2192
+ "v2/infra/local/managed-source-store/index.d.ts": {
2193
+ "sha256": "4179aaf5e9286a86e1043887fec715adf45effebd83be4c3347f5cdf968cc7b9",
2194
+ "bytes": 834
2195
+ },
2196
+ "v2/infra/local/managed-source-store/index.js": {
2197
+ "sha256": "3de9c9c58a7661c7b3da4f1735fcc54aadf049c06acdeca8fc1b8061c8e86130",
2198
+ "bytes": 6966
2199
+ },
2168
2200
  "v2/infra/local/pinned-workflow-store/index.d.ts": {
2169
2201
  "sha256": "5f7d831fceb44ded4ae7e153bed882aa63816c01c54732d30e6a89dae8bfd8d0",
2170
2202
  "bytes": 917
@@ -2286,8 +2318,8 @@
2286
2318
  "bytes": 77
2287
2319
  },
2288
2320
  "v2/ports/data-dir.port.d.ts": {
2289
- "sha256": "f23993e2101651b738c43d7d02178e622b39c32033a36bf06699d6803b244c0e",
2290
- "bytes": 684
2321
+ "sha256": "6f028592ad207b522e2b00be1d7252004595d48354a0a4d95a6be575c876ac59",
2322
+ "bytes": 756
2291
2323
  },
2292
2324
  "v2/ports/data-dir.port.js": {
2293
2325
  "sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
@@ -2325,6 +2357,14 @@
2325
2357
  "sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
2326
2358
  "bytes": 77
2327
2359
  },
2360
+ "v2/ports/managed-source-store.port.d.ts": {
2361
+ "sha256": "4f34014c17fddd049d622682fe67ceda1424d0ad7197c767ee03e7bd817b4cb2",
2362
+ "bytes": 839
2363
+ },
2364
+ "v2/ports/managed-source-store.port.js": {
2365
+ "sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
2366
+ "bytes": 77
2367
+ },
2328
2368
  "v2/ports/pinned-workflow-store.port.d.ts": {
2329
2369
  "sha256": "5105f42539f6ad813d468fc5c7f3c17648855731bb1b5f088354afae1856dac1",
2330
2370
  "bytes": 608
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare function coerceJsonStringObjectFields(args: unknown, shapeSchema: z.ZodObject<z.ZodRawShape>, aliasMap?: Readonly<Record<string, string>>): unknown;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.coerceJsonStringObjectFields = coerceJsonStringObjectFields;
4
+ const zod_1 = require("zod");
5
+ function unwrapToBaseType(schema) {
6
+ let current = schema;
7
+ for (;;) {
8
+ if (current instanceof zod_1.z.ZodOptional || current instanceof zod_1.z.ZodDefault) {
9
+ current = current._def.innerType;
10
+ }
11
+ else if (current instanceof zod_1.z.ZodEffects) {
12
+ current = current._def.schema;
13
+ }
14
+ else {
15
+ break;
16
+ }
17
+ }
18
+ return current;
19
+ }
20
+ function expectsObjectValue(fieldSchema) {
21
+ const base = unwrapToBaseType(fieldSchema);
22
+ return base instanceof zod_1.z.ZodObject || base instanceof zod_1.z.ZodRecord;
23
+ }
24
+ function tryParseJsonObject(value) {
25
+ try {
26
+ const parsed = JSON.parse(value);
27
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed))
28
+ return null;
29
+ return parsed;
30
+ }
31
+ catch {
32
+ return null;
33
+ }
34
+ }
35
+ function coerceJsonStringObjectFields(args, shapeSchema, aliasMap) {
36
+ if (typeof args !== 'object' || args === null)
37
+ return args;
38
+ const input = args;
39
+ const shape = shapeSchema._def.shape();
40
+ const objectFields = new Set();
41
+ for (const [key, fieldSchema] of Object.entries(shape)) {
42
+ if (expectsObjectValue(fieldSchema)) {
43
+ objectFields.add(key);
44
+ }
45
+ }
46
+ const aliasesToCoerce = new Set();
47
+ if (aliasMap) {
48
+ for (const [alias, canonical] of Object.entries(aliasMap)) {
49
+ if (objectFields.has(canonical)) {
50
+ aliasesToCoerce.add(alias);
51
+ }
52
+ }
53
+ }
54
+ if (objectFields.size === 0 && aliasesToCoerce.size === 0)
55
+ return args;
56
+ let result = null;
57
+ const coerceField = (key) => {
58
+ const value = input[key];
59
+ if (typeof value !== 'string')
60
+ return;
61
+ const parsed = tryParseJsonObject(value);
62
+ if (parsed === null)
63
+ return;
64
+ if (result === null)
65
+ result = { ...input };
66
+ result[key] = parsed;
67
+ };
68
+ for (const key of objectFields)
69
+ coerceField(key);
70
+ for (const alias of aliasesToCoerce)
71
+ coerceField(alias);
72
+ return result ?? args;
73
+ }
@@ -4,4 +4,4 @@ import type { PreValidateResult } from './validation/workflow-next-prevalidate.j
4
4
  import type { WrappedToolHandler, McpCallToolResult } from './types/workflow-tool-edition.js';
5
5
  export declare function toMcpResult<T>(result: ToolResult<T>): McpCallToolResult;
6
6
  export declare function createHandler<TInput extends z.ZodType, TOutput>(schema: TInput, handler: (input: z.infer<TInput>, ctx: ToolContext) => Promise<ToolResult<TOutput>>, shapeSchema?: z.ZodObject<z.ZodRawShape>, aliasMap?: Readonly<Record<string, string>>): WrappedToolHandler;
7
- export declare function createValidatingHandler<TInput extends z.ZodType, TOutput>(schema: TInput, preValidate: (args: unknown) => PreValidateResult, handler: (input: z.infer<TInput>, ctx: ToolContext) => Promise<ToolResult<TOutput>>): WrappedToolHandler;
7
+ export declare function createValidatingHandler<TInput extends z.ZodType, TOutput>(schema: TInput, preValidate: (args: unknown) => PreValidateResult, handler: (input: z.infer<TInput>, ctx: ToolContext) => Promise<ToolResult<TOutput>>, shapeSchema?: z.ZodObject<z.ZodRawShape>, aliasMap?: Readonly<Record<string, string>>): WrappedToolHandler;
@@ -4,6 +4,7 @@ exports.toMcpResult = toMcpResult;
4
4
  exports.createHandler = createHandler;
5
5
  exports.createValidatingHandler = createValidatingHandler;
6
6
  const types_js_1 = require("./types.js");
7
+ const boundary_coercion_js_1 = require("./boundary-coercion.js");
7
8
  const index_js_1 = require("./validation/index.js");
8
9
  const bounded_json_js_1 = require("./validation/bounded-json.js");
9
10
  const v2_execution_helpers_js_1 = require("./handlers/v2-execution-helpers.js");
@@ -56,12 +57,15 @@ function toMcpResult(result) {
56
57
  }
57
58
  function createHandler(schema, handler, shapeSchema, aliasMap) {
58
59
  return async (args, ctx) => {
59
- const parseResult = schema.safeParse(args);
60
+ const normalizedArgs = shapeSchema !== undefined
61
+ ? (0, boundary_coercion_js_1.coerceJsonStringObjectFields)(args, shapeSchema, aliasMap)
62
+ : args;
63
+ const parseResult = schema.safeParse(normalizedArgs);
60
64
  if (!parseResult.success) {
61
65
  const introspectionSchema = shapeSchema ?? schema;
62
- const suggestionResult = (0, index_js_1.generateSuggestions)(args, introspectionSchema, index_js_1.DEFAULT_SUGGESTION_CONFIG, aliasMap);
66
+ const suggestionResult = (0, index_js_1.generateSuggestions)(normalizedArgs, introspectionSchema, index_js_1.DEFAULT_SUGGESTION_CONFIG, aliasMap);
63
67
  const suggestionDetails = (0, index_js_1.formatSuggestionDetails)(suggestionResult);
64
- const patchedTemplate = (0, index_js_1.patchTemplateForFailedOptionals)(suggestionDetails.correctTemplate ?? null, args, parseResult.error.errors, introspectionSchema, index_js_1.DEFAULT_SUGGESTION_CONFIG.maxTemplateDepth);
68
+ const patchedTemplate = (0, index_js_1.patchTemplateForFailedOptionals)(suggestionDetails.correctTemplate ?? null, normalizedArgs, parseResult.error.errors, introspectionSchema, index_js_1.DEFAULT_SUGGESTION_CONFIG.maxTemplateDepth);
65
69
  const patchedDetails = patchedTemplate !== suggestionDetails.correctTemplate
66
70
  ? { ...suggestionDetails, correctTemplate: patchedTemplate }
67
71
  : suggestionDetails;
@@ -82,9 +86,12 @@ function createHandler(schema, handler, shapeSchema, aliasMap) {
82
86
  }
83
87
  };
84
88
  }
85
- function createValidatingHandler(schema, preValidate, handler) {
89
+ function createValidatingHandler(schema, preValidate, handler, shapeSchema, aliasMap) {
86
90
  return async (args, ctx) => {
87
- const pre = preValidate(args);
91
+ const normalizedArgs = shapeSchema !== undefined
92
+ ? (0, boundary_coercion_js_1.coerceJsonStringObjectFields)(args, shapeSchema, aliasMap)
93
+ : args;
94
+ const pre = preValidate(normalizedArgs);
88
95
  if (!pre.ok) {
89
96
  const error = pre.error;
90
97
  const details = error.details && typeof error.details === 'object' ? error.details : {};
@@ -103,6 +110,6 @@ function createValidatingHandler(schema, preValidate, handler) {
103
110
  }
104
111
  return toMcpResult(error);
105
112
  }
106
- return createHandler(schema, handler)(args, ctx);
113
+ return createHandler(schema, handler, shapeSchema, aliasMap)(normalizedArgs, ctx);
107
114
  };
108
115
  }
@@ -0,0 +1,7 @@
1
+ import type { ToolContext, ToolResult } from '../types.js';
2
+ import type { V2ManageWorkflowSourceInput } from '../v2/tools.js';
3
+ export interface ManageWorkflowSourceOutput {
4
+ readonly action: 'attach' | 'detach';
5
+ readonly path: string;
6
+ }
7
+ export declare function handleV2ManageWorkflowSource(input: V2ManageWorkflowSourceInput, ctx: ToolContext): Promise<ToolResult<ManageWorkflowSourceOutput>>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.handleV2ManageWorkflowSource = handleV2ManageWorkflowSource;
7
+ const path_1 = __importDefault(require("path"));
8
+ const assert_never_js_1 = require("../../runtime/assert-never.js");
9
+ const types_js_1 = require("../types.js");
10
+ function mapManagedSourceErrorToToolError(error) {
11
+ switch (error.code) {
12
+ case 'MANAGED_SOURCE_BUSY':
13
+ return (0, types_js_1.errRetryAfterMs)('INTERNAL_ERROR', 'WorkRail is temporarily busy updating managed workflow sources.', error.retry.afterMs, {
14
+ suggestion: 'Wait a moment and retry. Another WorkRail process may be updating managed workflow sources.',
15
+ });
16
+ case 'MANAGED_SOURCE_IO_ERROR':
17
+ return (0, types_js_1.errNotRetryable)('INTERNAL_ERROR', 'WorkRail could not update the managed workflow sources store.', {
18
+ suggestion: 'Fix WorkRail local storage access and retry. Check that the ~/.workrail data directory exists and is writable.',
19
+ details: { errorMessage: error.message },
20
+ });
21
+ case 'MANAGED_SOURCE_CORRUPTION':
22
+ return (0, types_js_1.errNotRetryable)('INTERNAL_ERROR', 'WorkRail managed workflow sources store is corrupted.', {
23
+ suggestion: 'The managed sources file may need to be deleted and re-created. Check the ~/.workrail/data/managed-sources directory.',
24
+ details: { errorMessage: error.message },
25
+ });
26
+ default: {
27
+ const _exhaustive = error;
28
+ return (0, assert_never_js_1.assertNever)(_exhaustive);
29
+ }
30
+ }
31
+ }
32
+ async function handleV2ManageWorkflowSource(input, ctx) {
33
+ const guard = (0, types_js_1.requireV2Context)(ctx);
34
+ if (!guard.ok)
35
+ return guard.error;
36
+ const { managedSourceStore } = guard.ctx.v2;
37
+ if (!managedSourceStore) {
38
+ return (0, types_js_1.errNotRetryable)('PRECONDITION_FAILED', 'Managed workflow source store is not available.', {
39
+ suggestion: 'Ensure WorkRail v2 is fully initialized. The managedSourceStore dependency may not be wired in this environment.',
40
+ });
41
+ }
42
+ const operation = input.action === 'attach'
43
+ ? managedSourceStore.attach(input.path)
44
+ : managedSourceStore.detach(input.path);
45
+ const result = await operation;
46
+ if (result.isErr()) {
47
+ return mapManagedSourceErrorToToolError(result.error);
48
+ }
49
+ return (0, types_js_1.success)({ action: input.action, path: path_1.default.resolve(input.path) });
50
+ }
@@ -1,4 +1,7 @@
1
1
  import type { ToolContext, ToolResult } from '../types.js';
2
2
  import type { V2InspectWorkflowInput, V2ListWorkflowsInput } from '../v2/tools.js';
3
+ import type { StalenessSummary } from '../output-schemas.js';
4
+ export declare function shouldShowStaleness(category: string | undefined, devMode?: boolean): boolean;
5
+ export declare function computeWorkflowStaleness(stamp: number | undefined, currentVersion: number | null): StalenessSummary | undefined;
3
6
  export declare function handleV2ListWorkflows(input: V2ListWorkflowsInput, ctx: ToolContext): Promise<ToolResult<unknown>>;
4
7
  export declare function handleV2InspectWorkflow(input: V2InspectWorkflowInput, ctx: ToolContext): Promise<ToolResult<unknown>>;