@exaudeus/workrail 3.44.0 → 3.46.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 (40) hide show
  1. package/dist/cli/commands/index.d.ts +1 -0
  2. package/dist/cli/commands/index.js +3 -1
  3. package/dist/cli/commands/worktrain-pipeline.d.ts +17 -0
  4. package/dist/cli/commands/worktrain-pipeline.js +121 -0
  5. package/dist/console-ui/assets/{index-Bi38ITiQ.js → index-BQFhoMcY.js} +1 -1
  6. package/dist/console-ui/index.html +1 -1
  7. package/dist/coordinators/adaptive-pipeline.d.ts +57 -0
  8. package/dist/coordinators/adaptive-pipeline.js +104 -0
  9. package/dist/coordinators/modes/full-pipeline.d.ts +4 -0
  10. package/dist/coordinators/modes/full-pipeline.js +256 -0
  11. package/dist/coordinators/modes/implement-shared.d.ts +4 -0
  12. package/dist/coordinators/modes/implement-shared.js +201 -0
  13. package/dist/coordinators/modes/implement.d.ts +3 -0
  14. package/dist/coordinators/modes/implement.js +108 -0
  15. package/dist/coordinators/modes/quick-review.d.ts +3 -0
  16. package/dist/coordinators/modes/quick-review.js +37 -0
  17. package/dist/coordinators/modes/review-only.d.ts +2 -0
  18. package/dist/coordinators/modes/review-only.js +28 -0
  19. package/dist/coordinators/routing/route-task.d.ts +21 -0
  20. package/dist/coordinators/routing/route-task.js +55 -0
  21. package/dist/daemon/workflow-runner.d.ts +12 -2
  22. package/dist/daemon/workflow-runner.js +96 -13
  23. package/dist/manifest.json +101 -29
  24. package/dist/mcp/output-schemas.d.ts +16 -16
  25. package/dist/trigger/notification-service.d.ts +1 -1
  26. package/dist/trigger/notification-service.js +4 -0
  27. package/dist/trigger/trigger-router.d.ts +3 -0
  28. package/dist/trigger/trigger-router.js +17 -0
  29. package/dist/trigger/types.d.ts +2 -0
  30. package/dist/v2/durable-core/schemas/artifacts/discovery-handoff.d.ts +29 -0
  31. package/dist/v2/durable-core/schemas/artifacts/discovery-handoff.js +26 -0
  32. package/dist/v2/durable-core/schemas/artifacts/index.d.ts +2 -1
  33. package/dist/v2/durable-core/schemas/artifacts/index.js +7 -1
  34. package/dist/v2/durable-core/schemas/compiled-workflow/index.d.ts +8 -8
  35. package/dist/v2/usecases/console-routes.js +3 -0
  36. package/docs/design/design-candidates-stuck-escalation.md +183 -0
  37. package/docs/design/design-review-findings-stuck-escalation.md +93 -0
  38. package/docs/design/implementation-plan-stuck-escalation.md +172 -0
  39. package/docs/ideas/backlog.md +86 -0
  40. package/package.json +1 -1
@@ -258,12 +258,12 @@
258
258
  "bytes": 745
259
259
  },
260
260
  "cli/commands/index.d.ts": {
261
- "sha256": "a8fec8627b5f590dcf264bf7cacb2a9ea65b93774bb22862a9611fec28d1d7cf",
262
- "bytes": 2105
261
+ "sha256": "7284fb3ca25bdbe6079fee4ed7f5eee9a82fff5fbc4e056010b52f4261145880",
262
+ "bytes": 2251
263
263
  },
264
264
  "cli/commands/index.js": {
265
- "sha256": "eded14c113e62a82576b6416b2c89cbddb62d7d0c1ca7e96c45e3df2d031890e",
266
- "bytes": 4903
265
+ "sha256": "8eef74385e22afc6313b4f7022c2e0a6be267ab55d7aa11c9a83b01a5e7c0e61",
266
+ "bytes": 5186
267
267
  },
268
268
  "cli/commands/init.d.ts": {
269
269
  "sha256": "b5f8b88a072c68509dab3938ba1d6b4a949ad32f8fc55e91c5039b8c77301c1b",
@@ -369,6 +369,14 @@
369
369
  "sha256": "0987dcb2518dfd44d103dd0958abae4c7e8323f314971ffdc3ead320c4c8eef9",
370
370
  "bytes": 6764
371
371
  },
372
+ "cli/commands/worktrain-pipeline.d.ts": {
373
+ "sha256": "ea0b36c853002352c7fad167c90dcf0234d2ec1a1fb042d4fd749531c7733fc0",
374
+ "bytes": 762
375
+ },
376
+ "cli/commands/worktrain-pipeline.js": {
377
+ "sha256": "d76c61ac291d1936769cc707406eb49dd6e4055855e64fb689ec1e626e71bc91",
378
+ "bytes": 5583
379
+ },
372
380
  "cli/commands/worktrain-spawn.d.ts": {
373
381
  "sha256": "c95c68c8f29957a19b2dab8ed6fac5f8fc85c711d34aceea740fee79aca3e2a7",
374
382
  "bytes": 1060
@@ -449,8 +457,8 @@
449
457
  "sha256": "5fe866e54f796975dec5d8ba9983aefd86074db212d3fccd64eed04bc9f0b3da",
450
458
  "bytes": 8011
451
459
  },
452
- "console-ui/assets/index-Bi38ITiQ.js": {
453
- "sha256": "e3229116ac20f315184c69ef9eaa33267457e5e7aac1e22015ed830cb098e39a",
460
+ "console-ui/assets/index-BQFhoMcY.js": {
461
+ "sha256": "722cfaf2b1b513c79b9f4d62cc79bd0f59c953c959480a8745efbdccf80df3d8",
454
462
  "bytes": 760528
455
463
  },
456
464
  "console-ui/assets/index-DGj8EsFR.css": {
@@ -458,7 +466,7 @@
458
466
  "bytes": 60631
459
467
  },
460
468
  "console-ui/index.html": {
461
- "sha256": "fb9efa806376b8f8f18d3c5d7853d04b9dfc9abc305b0ed22782379bc13a2c86",
469
+ "sha256": "b4d9928edd90bb6778c3685eb511c9e7600937720b6212e018a017fbbbe7b8c5",
462
470
  "bytes": 417
463
471
  },
464
472
  "console/standalone-console.d.ts": {
@@ -501,6 +509,54 @@
501
509
  "sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
502
510
  "bytes": 77
503
511
  },
512
+ "coordinators/adaptive-pipeline.d.ts": {
513
+ "sha256": "8f1e9ee8e14fe847d57ab65d75dab48b08afd376af1fb70c65f760f4a26ff855",
514
+ "bytes": 2811
515
+ },
516
+ "coordinators/adaptive-pipeline.js": {
517
+ "sha256": "ddaa2dd10c41be64c6449d29f36bda9e00daa941157078793fea31b7a41462b5",
518
+ "bytes": 4659
519
+ },
520
+ "coordinators/modes/full-pipeline.d.ts": {
521
+ "sha256": "94735f14cbacab0c37f4474b636646b7bd6b9e3b2304181f14b3939157ebe3dd",
522
+ "bytes": 462
523
+ },
524
+ "coordinators/modes/full-pipeline.js": {
525
+ "sha256": "762f4d637389e77cc71a31fc54034061edbb8a30a0332c0b60ecf560b7d6743a",
526
+ "bytes": 11782
527
+ },
528
+ "coordinators/modes/implement-shared.d.ts": {
529
+ "sha256": "64e3ba7e31bf9965b74645d7157a85fb67d9df183696a4d792cec870b22047e0",
530
+ "bytes": 554
531
+ },
532
+ "coordinators/modes/implement-shared.js": {
533
+ "sha256": "c39e7b1c088663a75f86b2dd81326940537c53408c7182a55f2b1288796cd002",
534
+ "bytes": 11023
535
+ },
536
+ "coordinators/modes/implement.d.ts": {
537
+ "sha256": "23919c24d62a0bf15296a52fbc594cca8b1b34e6f8d98dcf7dede8d97ad4cabb",
538
+ "bytes": 347
539
+ },
540
+ "coordinators/modes/implement.js": {
541
+ "sha256": "fa668b93b643ad3448844754e7e27ba33ca7324f6948e7414f04b69a8e3c5fba",
542
+ "bytes": 4955
543
+ },
544
+ "coordinators/modes/quick-review.d.ts": {
545
+ "sha256": "03a4f29a07047b0bf788d84f8e0ebab63d64c8eb98aa57087943a8fb84563998",
546
+ "bytes": 405
547
+ },
548
+ "coordinators/modes/quick-review.js": {
549
+ "sha256": "720e0dbccc79e4e2acfdbb448dba8be4440f658ac6058383202332cef63d51e0",
550
+ "bytes": 1678
551
+ },
552
+ "coordinators/modes/review-only.d.ts": {
553
+ "sha256": "bc97de23de612ec03444bd3ac9d632aca7967c2153bc381e9e42519d721fb134",
554
+ "bytes": 302
555
+ },
556
+ "coordinators/modes/review-only.js": {
557
+ "sha256": "a7da0b06ea4b16ae71b3d08a559dade91b01ffe1270633eb8ac1c355d57126eb",
558
+ "bytes": 1198
559
+ },
504
560
  "coordinators/pr-review.d.ts": {
505
561
  "sha256": "8f6794d60ecabaf6898199120620fcd5aac932b64654636bc8d308103c987e57",
506
562
  "bytes": 3832
@@ -509,6 +565,14 @@
509
565
  "sha256": "84b51f931eb55d908de8c60f90b4d4b66540054791a28ce2f07426a841fed386",
510
566
  "bytes": 32297
511
567
  },
568
+ "coordinators/routing/route-task.d.ts": {
569
+ "sha256": "6661d21e5cfbc9dffbfd8c2f9aaaf0e30a3251997a2c69c6a1b09929343e30e3",
570
+ "bytes": 667
571
+ },
572
+ "coordinators/routing/route-task.js": {
573
+ "sha256": "195953d6c0e28d749407e5e3fb29b963cf14629c03508792a44bf0866f7c9d33",
574
+ "bytes": 1815
575
+ },
512
576
  "core/error-handler.d.ts": {
513
577
  "sha256": "80451f12ac8e185133ec3dc4c57285491a785f27525ed21e729db1da3f61010d",
514
578
  "bytes": 1368
@@ -550,12 +614,12 @@
550
614
  "bytes": 1512
551
615
  },
552
616
  "daemon/workflow-runner.d.ts": {
553
- "sha256": "0406654be8c6eb147706e81e0ba666ce372db140f4720246258e0f001653181e",
554
- "bytes": 6628
617
+ "sha256": "4c67cc7a44c934469c190f11a71bd18bf0dfc31f59ab0c315b98315b96d59cce",
618
+ "bytes": 7048
555
619
  },
556
620
  "daemon/workflow-runner.js": {
557
- "sha256": "f40f265284aa1e32168d8a0cf28c08007186eafac6d55182b7ec6ddb53bed5a8",
558
- "bytes": 89592
621
+ "sha256": "a5d74ec723ff0dce45d2335b811959ff0c6e6f8851edf399a70853f6bf127893",
622
+ "bytes": 93222
559
623
  },
560
624
  "di/container.d.ts": {
561
625
  "sha256": "003bb7fb7478d627524b9b1e76bd0a963a243794a687ff233b96dc0e33a06d9f",
@@ -1158,7 +1222,7 @@
1158
1222
  "bytes": 7991
1159
1223
  },
1160
1224
  "mcp/output-schemas.d.ts": {
1161
- "sha256": "aedab6be485391586f64655be2ad590a590684b548c1d55b7e216d06656a4e7f",
1225
+ "sha256": "bdc67c2adadeeca632aae3a3f0df8aa521c952194300b0bd823bdd7abed805d2",
1162
1226
  "bytes": 93176
1163
1227
  },
1164
1228
  "mcp/output-schemas.js": {
@@ -1606,12 +1670,12 @@
1606
1670
  "bytes": 1222
1607
1671
  },
1608
1672
  "trigger/notification-service.d.ts": {
1609
- "sha256": "c78406d3748953548f7879df8ac60cecd5e42f2f3b283f777343168ce2470b8d",
1610
- "bytes": 1572
1673
+ "sha256": "25509f290a11ac9a8aa03e5d7e44011950c841436e9458eb855b94d15d036d68",
1674
+ "bytes": 1582
1611
1675
  },
1612
1676
  "trigger/notification-service.js": {
1613
- "sha256": "693f617adc30b3a4fcebeca6a78b0da1c58819001660c017a4d0901652d675b8",
1614
- "bytes": 6373
1677
+ "sha256": "9d9a5951229f2c6ffaa413a7421efa6611d9ca0ed456edf5c297a4506e84a80e",
1678
+ "bytes": 6521
1615
1679
  },
1616
1680
  "trigger/polled-event-store.d.ts": {
1617
1681
  "sha256": "2952a25804177b2389d4273bfc41192477d100bc26100683861dedf28520dec1",
@@ -1638,12 +1702,12 @@
1638
1702
  "bytes": 10668
1639
1703
  },
1640
1704
  "trigger/trigger-router.d.ts": {
1641
- "sha256": "b02e4c24865fc2ede2193d5b83d12a2b25b3c368a5acfdde0f7bd91865091329",
1642
- "bytes": 2123
1705
+ "sha256": "b3154af4d32d6d71ae38fb6befc54850d137a12b2f602a34247b0c5f9b57a29d",
1706
+ "bytes": 2519
1643
1707
  },
1644
1708
  "trigger/trigger-router.js": {
1645
- "sha256": "605cdce397bd19e5b991fe7378faf17b4f25b4421749e1b5349413a208a4f3dd",
1646
- "bytes": 17250
1709
+ "sha256": "682bf6e3a9d0fa5e25378c361813fdc52e5b828dff7267fd084d83f242585492",
1710
+ "bytes": 18144
1647
1711
  },
1648
1712
  "trigger/trigger-store.d.ts": {
1649
1713
  "sha256": "7afb05127d55bc3757a550dd15d4b797766b3fff29d1bfe76b303764b93322e7",
@@ -1654,8 +1718,8 @@
1654
1718
  "bytes": 38148
1655
1719
  },
1656
1720
  "trigger/types.d.ts": {
1657
- "sha256": "4ccedde5b927f17edbb96203083e8ffd2d578e2cc007ff2427511112ae262e30",
1658
- "bytes": 3475
1721
+ "sha256": "a1336ad769dbe4760e7acd3b2a92961251492aa29245b5d906ad89011ea934fa",
1722
+ "bytes": 3587
1659
1723
  },
1660
1724
  "trigger/types.js": {
1661
1725
  "sha256": "45b4e4f23a6d1a2b07350196871b0c53840e5d8142b47f7acedd2f40ae7a6b73",
@@ -2173,13 +2237,21 @@
2173
2237
  "sha256": "b6453c5d57e4c3f05e11d4bc477821dba07e502ccd5ce98e850fb01fe3505a75",
2174
2238
  "bytes": 1242
2175
2239
  },
2240
+ "v2/durable-core/schemas/artifacts/discovery-handoff.d.ts": {
2241
+ "sha256": "ccf5b234bc4e1d98a688ecdf555cb8a0cc4e171209f31845d13ac89ef747bbe9",
2242
+ "bytes": 1174
2243
+ },
2244
+ "v2/durable-core/schemas/artifacts/discovery-handoff.js": {
2245
+ "sha256": "78b5ce8abef29a1f15d8e10f33a9174f8d027550ffdfc419ddad03db8d0fc7d6",
2246
+ "bytes": 1138
2247
+ },
2176
2248
  "v2/durable-core/schemas/artifacts/index.d.ts": {
2177
- "sha256": "424f87839cbb39dc0edb970c2ab2866bf69e746df713b51e84656c13c81772c5",
2178
- "bytes": 1323
2249
+ "sha256": "7821aa8564f8900b81396497e26ad3718805c64daf02147f1427d35dfe6c957d",
2250
+ "bytes": 1557
2179
2251
  },
2180
2252
  "v2/durable-core/schemas/artifacts/index.js": {
2181
- "sha256": "0cbd4659adcaf8ba1e5a4c176d3868fc9794764eb6f6d5061b9e4134c50f1e31",
2182
- "bytes": 4827
2253
+ "sha256": "6755939280959c6a8ad70a5141a0a8803ad136eb1064f6238bb08e294c2330d0",
2254
+ "bytes": 5772
2183
2255
  },
2184
2256
  "v2/durable-core/schemas/artifacts/loop-control.d.ts": {
2185
2257
  "sha256": "95dabfdcedb1a71c58c38a805dcf24c76254783bc0b2c7d429a3b8ffb94202ed",
@@ -2198,7 +2270,7 @@
2198
2270
  "bytes": 1206
2199
2271
  },
2200
2272
  "v2/durable-core/schemas/compiled-workflow/index.d.ts": {
2201
- "sha256": "49f355aaf9b5c42e59f467935425625149456cabe047017ce7a11501ed0cf6a3",
2273
+ "sha256": "66e5a5e8d87e1c4743acfad71fa81c22775d377b566701d71c17227a4f4c969c",
2202
2274
  "bytes": 11821
2203
2275
  },
2204
2276
  "v2/durable-core/schemas/compiled-workflow/index.js": {
@@ -2970,8 +3042,8 @@
2970
3042
  "bytes": 798
2971
3043
  },
2972
3044
  "v2/usecases/console-routes.js": {
2973
- "sha256": "89749c3462728cd2a821af7e4cad61d2d42b8f580765f644c9f4e9d1e9187bd1",
2974
- "bytes": 29558
3045
+ "sha256": "3e8bd3adfdc66926d91044506d2c77253b784b9e4356a8610c585e6a27153d4b",
3046
+ "bytes": 29776
2975
3047
  },
2976
3048
  "v2/usecases/console-service.d.ts": {
2977
3049
  "sha256": "fc8fe65427fa9f4f3535344b385b36f66ca06b7e3bfaea708931817a3edcad2b",
@@ -10,14 +10,14 @@ export declare const WorkflowSummarySchema: z.ZodObject<{
10
10
  version: z.ZodString;
11
11
  }, "strip", z.ZodTypeAny, {
12
12
  name: string;
13
+ version: string;
13
14
  id: string;
14
15
  description: string;
15
- version: string;
16
16
  }, {
17
17
  name: string;
18
+ version: string;
18
19
  id: string;
19
20
  description: string;
20
- version: string;
21
21
  }>;
22
22
  export declare const WorkflowListOutputSchema: z.ZodObject<{
23
23
  workflows: z.ZodArray<z.ZodObject<{
@@ -27,28 +27,28 @@ export declare const WorkflowListOutputSchema: z.ZodObject<{
27
27
  version: z.ZodString;
28
28
  }, "strip", z.ZodTypeAny, {
29
29
  name: string;
30
+ version: string;
30
31
  id: string;
31
32
  description: string;
32
- version: string;
33
33
  }, {
34
34
  name: string;
35
+ version: string;
35
36
  id: string;
36
37
  description: string;
37
- version: string;
38
38
  }>, "many">;
39
39
  }, "strip", z.ZodTypeAny, {
40
40
  workflows: {
41
41
  name: string;
42
+ version: string;
42
43
  id: string;
43
44
  description: string;
44
- version: string;
45
45
  }[];
46
46
  }, {
47
47
  workflows: {
48
48
  name: string;
49
+ version: string;
49
50
  id: string;
50
51
  description: string;
51
- version: string;
52
52
  }[];
53
53
  }>;
54
54
  export declare const WorkflowGetOutputSchema: z.ZodObject<{
@@ -92,13 +92,13 @@ export declare const WorkflowGetSchemaOutputSchema: z.ZodObject<{
92
92
  usage: z.ZodString;
93
93
  schemaPath: z.ZodString;
94
94
  }, "strip", z.ZodTypeAny, {
95
- description: string;
96
95
  version: string;
96
+ description: string;
97
97
  usage: string;
98
98
  schemaPath: string;
99
99
  }, {
100
- description: string;
101
100
  version: string;
101
+ description: string;
102
102
  usage: string;
103
103
  schemaPath: string;
104
104
  }>;
@@ -115,8 +115,8 @@ export declare const WorkflowGetSchemaOutputSchema: z.ZodObject<{
115
115
  }, "strip", z.ZodTypeAny, {
116
116
  schema: JsonValue;
117
117
  metadata: {
118
- description: string;
119
118
  version: string;
119
+ description: string;
120
120
  usage: string;
121
121
  schemaPath: string;
122
122
  };
@@ -127,8 +127,8 @@ export declare const WorkflowGetSchemaOutputSchema: z.ZodObject<{
127
127
  }, {
128
128
  schema: JsonValue;
129
129
  metadata: {
130
- description: string;
131
130
  version: string;
131
+ description: string;
132
132
  usage: string;
133
133
  schemaPath: string;
134
134
  };
@@ -253,8 +253,8 @@ export declare const V2WorkflowListItemSchema: z.ZodObject<{
253
253
  workflowHash: string | null;
254
254
  workflowId: string;
255
255
  name: string;
256
- description: string;
257
256
  version: string;
257
+ description: string;
258
258
  examples?: string[] | undefined;
259
259
  visibility?: {
260
260
  category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
@@ -284,8 +284,8 @@ export declare const V2WorkflowListItemSchema: z.ZodObject<{
284
284
  workflowHash: string | null;
285
285
  workflowId: string;
286
286
  name: string;
287
- description: string;
288
287
  version: string;
288
+ description: string;
289
289
  examples?: string[] | undefined;
290
290
  visibility?: {
291
291
  category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
@@ -540,8 +540,8 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
540
540
  workflowHash: string | null;
541
541
  workflowId: string;
542
542
  name: string;
543
- description: string;
544
543
  version: string;
544
+ description: string;
545
545
  examples?: string[] | undefined;
546
546
  visibility?: {
547
547
  category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
@@ -571,8 +571,8 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
571
571
  workflowHash: string | null;
572
572
  workflowId: string;
573
573
  name: string;
574
- description: string;
575
574
  version: string;
575
+ description: string;
576
576
  examples?: string[] | undefined;
577
577
  visibility?: {
578
578
  category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
@@ -733,8 +733,8 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
733
733
  workflowHash: string | null;
734
734
  workflowId: string;
735
735
  name: string;
736
- description: string;
737
736
  version: string;
737
+ description: string;
738
738
  examples?: string[] | undefined;
739
739
  visibility?: {
740
740
  category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
@@ -803,8 +803,8 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
803
803
  workflowHash: string | null;
804
804
  workflowId: string;
805
805
  name: string;
806
- description: string;
807
806
  version: string;
807
+ description: string;
808
808
  examples?: string[] | undefined;
809
809
  visibility?: {
810
810
  category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
@@ -21,7 +21,7 @@ export interface NotificationConfig {
21
21
  export interface NotificationPayload {
22
22
  readonly event: 'session_completed';
23
23
  readonly workflowId: string;
24
- readonly outcome: 'success' | 'error' | 'timeout' | 'delivery_failed';
24
+ readonly outcome: 'success' | 'error' | 'timeout' | 'stuck' | 'delivery_failed';
25
25
  readonly detail: string;
26
26
  readonly goal: string;
27
27
  readonly timestamp: string;
@@ -48,6 +48,8 @@ function buildNotificationBody(result, goal) {
48
48
  return `Session failed: ${truncated}`;
49
49
  case 'timeout':
50
50
  return `Session timed out: ${truncated}`;
51
+ case 'stuck':
52
+ return `Session stuck (${result.reason}): ${truncated}`;
51
53
  case 'delivery_failed':
52
54
  return `Session completed but result delivery failed: ${truncated}`;
53
55
  }
@@ -63,6 +65,8 @@ function buildDetail(result) {
63
65
  return result.message;
64
66
  case 'timeout':
65
67
  return result.message;
68
+ case 'stuck':
69
+ return result.message;
66
70
  case 'delivery_failed':
67
71
  return `stopReason: ${result.stopReason}; deliveryError: ${result.deliveryError}`;
68
72
  }
@@ -4,6 +4,8 @@ import type { TriggerDefinition, WebhookEvent } from './types.js';
4
4
  import type { ExecFn } from './delivery-action.js';
5
5
  import type { DaemonEventEmitter } from '../daemon/daemon-events.js';
6
6
  import type { NotificationService } from './notification-service.js';
7
+ import type { AdaptiveCoordinatorDeps, ModeExecutors } from '../coordinators/adaptive-pipeline.js';
8
+ import { runAdaptivePipeline } from '../coordinators/adaptive-pipeline.js';
7
9
  export type RouteError = {
8
10
  readonly kind: 'not_found';
9
11
  readonly triggerId: string;
@@ -40,4 +42,5 @@ export declare class TriggerRouter {
40
42
  route(event: WebhookEvent): RouteResult;
41
43
  dispatch(workflowTrigger: WorkflowTrigger): string;
42
44
  listTriggers(): readonly TriggerDefinition[];
45
+ dispatchAdaptivePipeline(goal: string, workspace: string, coordinatorDeps: AdaptiveCoordinatorDeps, modeExecutors: ModeExecutors, context?: Readonly<Record<string, unknown>>): ReturnType<typeof runAdaptivePipeline>;
43
46
  }
@@ -42,6 +42,7 @@ const assert_never_js_1 = require("../runtime/assert-never.js");
42
42
  const index_js_1 = require("../v2/infra/in-memory/keyed-async-queue/index.js");
43
43
  const delivery_client_js_1 = require("./delivery-client.js");
44
44
  const delivery_action_js_1 = require("./delivery-action.js");
45
+ const adaptive_pipeline_js_1 = require("../coordinators/adaptive-pipeline.js");
45
46
  const execFileAsync = (0, node_util_1.promisify)(node_child_process_1.execFile);
46
47
  function interpolateGoalTemplate(template, staticGoal, payload, triggerId) {
47
48
  const TOKEN_RE = /\{\{([^}]+)\}\}/g;
@@ -327,6 +328,10 @@ class TriggerRouter {
327
328
  console.log(`[TriggerRouter] Workflow failed: triggerId=${trigger.id} ` +
328
329
  `workflowId=${trigger.workflowId} error=${result.message} stopReason=${result.stopReason}`);
329
330
  }
331
+ else if (result._tag === 'stuck') {
332
+ console.log(`[TriggerRouter] Workflow stuck: triggerId=${trigger.id} ` +
333
+ `workflowId=${trigger.workflowId} reason=${result.reason} message=${result.message}`);
334
+ }
330
335
  else {
331
336
  (0, assert_never_js_1.assertNever)(result);
332
337
  }
@@ -366,6 +371,10 @@ class TriggerRouter {
366
371
  console.log(`[TriggerRouter] Dispatch failed: workflowId=${workflowTrigger.workflowId} ` +
367
372
  `error=${result.message} stopReason=${result.stopReason}`);
368
373
  }
374
+ else if (result._tag === 'stuck') {
375
+ console.log(`[TriggerRouter] Dispatch stuck: workflowId=${workflowTrigger.workflowId} ` +
376
+ `reason=${result.reason} message=${result.message}`);
377
+ }
369
378
  else {
370
379
  (0, assert_never_js_1.assertNever)(result);
371
380
  }
@@ -376,5 +385,13 @@ class TriggerRouter {
376
385
  listTriggers() {
377
386
  return [...this.index.values()];
378
387
  }
388
+ async dispatchAdaptivePipeline(goal, workspace, coordinatorDeps, modeExecutors, context) {
389
+ const opts = {
390
+ goal,
391
+ workspace,
392
+ taskCandidate: context,
393
+ };
394
+ return (0, adaptive_pipeline_js_1.runAdaptivePipeline)(coordinatorDeps, opts, modeExecutors);
395
+ }
379
396
  }
380
397
  exports.TriggerRouter = TriggerRouter;
@@ -71,6 +71,8 @@ export interface TriggerDefinition {
71
71
  readonly model?: string;
72
72
  readonly maxSessionMinutes?: number;
73
73
  readonly maxTurns?: number;
74
+ readonly stuckAbortPolicy?: 'abort' | 'notify_only';
75
+ readonly noProgressAbortEnabled?: boolean;
74
76
  };
75
77
  readonly concurrencyMode: 'serial' | 'parallel';
76
78
  readonly callbackUrl?: string;
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ export declare const DISCOVERY_HANDOFF_CONTRACT_REF: "wr.contracts.discovery_handoff";
3
+ export declare const DiscoveryHandoffArtifactV1Schema: z.ZodObject<{
4
+ kind: z.ZodLiteral<"wr.discovery_handoff">;
5
+ version: z.ZodLiteral<1>;
6
+ selectedDirection: z.ZodString;
7
+ designDocPath: z.ZodString;
8
+ confidenceBand: z.ZodEnum<["high", "medium", "low"]>;
9
+ keyInvariants: z.ZodArray<z.ZodString, "many">;
10
+ }, "strict", z.ZodTypeAny, {
11
+ kind: "wr.discovery_handoff";
12
+ version: 1;
13
+ selectedDirection: string;
14
+ designDocPath: string;
15
+ confidenceBand: "low" | "high" | "medium";
16
+ keyInvariants: string[];
17
+ }, {
18
+ kind: "wr.discovery_handoff";
19
+ version: 1;
20
+ selectedDirection: string;
21
+ designDocPath: string;
22
+ confidenceBand: "low" | "high" | "medium";
23
+ keyInvariants: string[];
24
+ }>;
25
+ export type DiscoveryHandoffArtifactV1 = z.infer<typeof DiscoveryHandoffArtifactV1Schema>;
26
+ export declare function isDiscoveryHandoffArtifact(artifact: unknown): artifact is {
27
+ readonly kind: 'wr.discovery_handoff';
28
+ };
29
+ export declare function parseDiscoveryHandoffArtifact(artifact: unknown): DiscoveryHandoffArtifactV1 | null;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiscoveryHandoffArtifactV1Schema = exports.DISCOVERY_HANDOFF_CONTRACT_REF = void 0;
4
+ exports.isDiscoveryHandoffArtifact = isDiscoveryHandoffArtifact;
5
+ exports.parseDiscoveryHandoffArtifact = parseDiscoveryHandoffArtifact;
6
+ const zod_1 = require("zod");
7
+ exports.DISCOVERY_HANDOFF_CONTRACT_REF = 'wr.contracts.discovery_handoff';
8
+ exports.DiscoveryHandoffArtifactV1Schema = zod_1.z
9
+ .object({
10
+ kind: zod_1.z.literal('wr.discovery_handoff'),
11
+ version: zod_1.z.literal(1),
12
+ selectedDirection: zod_1.z.string().min(1),
13
+ designDocPath: zod_1.z.string(),
14
+ confidenceBand: zod_1.z.enum(['high', 'medium', 'low']),
15
+ keyInvariants: zod_1.z.array(zod_1.z.string().min(1)),
16
+ })
17
+ .strict();
18
+ function isDiscoveryHandoffArtifact(artifact) {
19
+ return (typeof artifact === 'object' &&
20
+ artifact !== null &&
21
+ artifact.kind === 'wr.discovery_handoff');
22
+ }
23
+ function parseDiscoveryHandoffArtifact(artifact) {
24
+ const result = exports.DiscoveryHandoffArtifactV1Schema.safeParse(artifact);
25
+ return result.success ? result.data : null;
26
+ }
@@ -2,6 +2,7 @@ export { ASSESSMENT_CONTRACT_REF, AssessmentArtifactV1Schema, AssessmentDimensio
2
2
  export { LOOP_CONTROL_CONTRACT_REF, LoopControlDecisionSchema, LoopControlMetadataV1Schema, LoopControlArtifactV1Schema, isLoopControlArtifact, parseLoopControlArtifact, findLoopControlArtifact, type LoopControlDecision, type LoopControlMetadataV1, type LoopControlArtifactV1, } from './loop-control.js';
3
3
  export { COORDINATOR_SIGNAL_CONTRACT_REF, CoordinatorSignalKindSchema, CoordinatorSignalArtifactV1Schema, isCoordinatorSignalArtifact, parseCoordinatorSignalArtifact, type CoordinatorSignalKind, type CoordinatorSignalArtifactV1, } from './coordinator-signal.js';
4
4
  export { REVIEW_VERDICT_CONTRACT_REF, ReviewVerdictArtifactV1Schema, isReviewVerdictArtifact, parseReviewVerdictArtifact, type ReviewVerdictArtifactV1, } from './review-verdict.js';
5
- export declare const ARTIFACT_CONTRACT_REFS: readonly ["wr.contracts.assessment", "wr.contracts.loop_control", "wr.contracts.coordinator_signal", "wr.contracts.review_verdict"];
5
+ export { DISCOVERY_HANDOFF_CONTRACT_REF, DiscoveryHandoffArtifactV1Schema, isDiscoveryHandoffArtifact, parseDiscoveryHandoffArtifact, type DiscoveryHandoffArtifactV1, } from './discovery-handoff.js';
6
+ export declare const ARTIFACT_CONTRACT_REFS: readonly ["wr.contracts.assessment", "wr.contracts.loop_control", "wr.contracts.coordinator_signal", "wr.contracts.review_verdict", "wr.contracts.discovery_handoff"];
6
7
  export type ArtifactContractRef = (typeof ARTIFACT_CONTRACT_REFS)[number];
7
8
  export declare function isValidContractRef(ref: string): ref is ArtifactContractRef;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ARTIFACT_CONTRACT_REFS = exports.parseReviewVerdictArtifact = exports.isReviewVerdictArtifact = exports.ReviewVerdictArtifactV1Schema = exports.REVIEW_VERDICT_CONTRACT_REF = exports.parseCoordinatorSignalArtifact = exports.isCoordinatorSignalArtifact = exports.CoordinatorSignalArtifactV1Schema = exports.CoordinatorSignalKindSchema = exports.COORDINATOR_SIGNAL_CONTRACT_REF = exports.findLoopControlArtifact = exports.parseLoopControlArtifact = exports.isLoopControlArtifact = exports.LoopControlArtifactV1Schema = exports.LoopControlMetadataV1Schema = exports.LoopControlDecisionSchema = exports.LOOP_CONTROL_CONTRACT_REF = exports.parseAssessmentArtifact = exports.isAssessmentArtifact = exports.AssessmentDimensionSubmissionSchema = exports.AssessmentArtifactV1Schema = exports.ASSESSMENT_CONTRACT_REF = void 0;
3
+ exports.ARTIFACT_CONTRACT_REFS = exports.parseDiscoveryHandoffArtifact = exports.isDiscoveryHandoffArtifact = exports.DiscoveryHandoffArtifactV1Schema = exports.DISCOVERY_HANDOFF_CONTRACT_REF = exports.parseReviewVerdictArtifact = exports.isReviewVerdictArtifact = exports.ReviewVerdictArtifactV1Schema = exports.REVIEW_VERDICT_CONTRACT_REF = exports.parseCoordinatorSignalArtifact = exports.isCoordinatorSignalArtifact = exports.CoordinatorSignalArtifactV1Schema = exports.CoordinatorSignalKindSchema = exports.COORDINATOR_SIGNAL_CONTRACT_REF = exports.findLoopControlArtifact = exports.parseLoopControlArtifact = exports.isLoopControlArtifact = exports.LoopControlArtifactV1Schema = exports.LoopControlMetadataV1Schema = exports.LoopControlDecisionSchema = exports.LOOP_CONTROL_CONTRACT_REF = exports.parseAssessmentArtifact = exports.isAssessmentArtifact = exports.AssessmentDimensionSubmissionSchema = exports.AssessmentArtifactV1Schema = exports.ASSESSMENT_CONTRACT_REF = void 0;
4
4
  exports.isValidContractRef = isValidContractRef;
5
5
  var assessment_js_1 = require("./assessment.js");
6
6
  Object.defineProperty(exports, "ASSESSMENT_CONTRACT_REF", { enumerable: true, get: function () { return assessment_js_1.ASSESSMENT_CONTRACT_REF; } });
@@ -27,11 +27,17 @@ Object.defineProperty(exports, "REVIEW_VERDICT_CONTRACT_REF", { enumerable: true
27
27
  Object.defineProperty(exports, "ReviewVerdictArtifactV1Schema", { enumerable: true, get: function () { return review_verdict_js_1.ReviewVerdictArtifactV1Schema; } });
28
28
  Object.defineProperty(exports, "isReviewVerdictArtifact", { enumerable: true, get: function () { return review_verdict_js_1.isReviewVerdictArtifact; } });
29
29
  Object.defineProperty(exports, "parseReviewVerdictArtifact", { enumerable: true, get: function () { return review_verdict_js_1.parseReviewVerdictArtifact; } });
30
+ var discovery_handoff_js_1 = require("./discovery-handoff.js");
31
+ Object.defineProperty(exports, "DISCOVERY_HANDOFF_CONTRACT_REF", { enumerable: true, get: function () { return discovery_handoff_js_1.DISCOVERY_HANDOFF_CONTRACT_REF; } });
32
+ Object.defineProperty(exports, "DiscoveryHandoffArtifactV1Schema", { enumerable: true, get: function () { return discovery_handoff_js_1.DiscoveryHandoffArtifactV1Schema; } });
33
+ Object.defineProperty(exports, "isDiscoveryHandoffArtifact", { enumerable: true, get: function () { return discovery_handoff_js_1.isDiscoveryHandoffArtifact; } });
34
+ Object.defineProperty(exports, "parseDiscoveryHandoffArtifact", { enumerable: true, get: function () { return discovery_handoff_js_1.parseDiscoveryHandoffArtifact; } });
30
35
  exports.ARTIFACT_CONTRACT_REFS = [
31
36
  'wr.contracts.assessment',
32
37
  'wr.contracts.loop_control',
33
38
  'wr.contracts.coordinator_signal',
34
39
  'wr.contracts.review_verdict',
40
+ 'wr.contracts.discovery_handoff',
35
41
  ];
36
42
  function isValidContractRef(ref) {
37
43
  return exports.ARTIFACT_CONTRACT_REFS.includes(ref);
@@ -22,8 +22,8 @@ export declare const CompiledWorkflowSnapshotV1Schema: z.ZodDiscriminatedUnion<"
22
22
  }, "strip", z.ZodTypeAny, {
23
23
  workflowId: string;
24
24
  name: string;
25
- description: string;
26
25
  version: string;
26
+ description: string;
27
27
  schemaVersion: 1;
28
28
  sourceKind: "v1_preview";
29
29
  preview: {
@@ -34,8 +34,8 @@ export declare const CompiledWorkflowSnapshotV1Schema: z.ZodDiscriminatedUnion<"
34
34
  }, {
35
35
  workflowId: string;
36
36
  name: string;
37
- description: string;
38
37
  version: string;
38
+ description: string;
39
39
  schemaVersion: 1;
40
40
  sourceKind: "v1_preview";
41
41
  preview: {
@@ -132,8 +132,8 @@ export declare const CompiledWorkflowSnapshotV1Schema: z.ZodDiscriminatedUnion<"
132
132
  }, "strip", z.ZodTypeAny, {
133
133
  workflowId: string;
134
134
  name: string;
135
- description: string;
136
135
  version: string;
136
+ description: string;
137
137
  schemaVersion: 1;
138
138
  sourceKind: "v1_pinned";
139
139
  definition?: unknown;
@@ -168,8 +168,8 @@ export declare const CompiledWorkflowSnapshotV1Schema: z.ZodDiscriminatedUnion<"
168
168
  }, {
169
169
  workflowId: string;
170
170
  name: string;
171
- description: string;
172
171
  version: string;
172
+ description: string;
173
173
  schemaVersion: 1;
174
174
  sourceKind: "v1_pinned";
175
175
  definition?: unknown;
@@ -226,8 +226,8 @@ export declare const CompiledWorkflowSnapshotSchema: z.ZodDiscriminatedUnion<"so
226
226
  }, "strip", z.ZodTypeAny, {
227
227
  workflowId: string;
228
228
  name: string;
229
- description: string;
230
229
  version: string;
230
+ description: string;
231
231
  schemaVersion: 1;
232
232
  sourceKind: "v1_preview";
233
233
  preview: {
@@ -238,8 +238,8 @@ export declare const CompiledWorkflowSnapshotSchema: z.ZodDiscriminatedUnion<"so
238
238
  }, {
239
239
  workflowId: string;
240
240
  name: string;
241
- description: string;
242
241
  version: string;
242
+ description: string;
243
243
  schemaVersion: 1;
244
244
  sourceKind: "v1_preview";
245
245
  preview: {
@@ -336,8 +336,8 @@ export declare const CompiledWorkflowSnapshotSchema: z.ZodDiscriminatedUnion<"so
336
336
  }, "strip", z.ZodTypeAny, {
337
337
  workflowId: string;
338
338
  name: string;
339
- description: string;
340
339
  version: string;
340
+ description: string;
341
341
  schemaVersion: 1;
342
342
  sourceKind: "v1_pinned";
343
343
  definition?: unknown;
@@ -372,8 +372,8 @@ export declare const CompiledWorkflowSnapshotSchema: z.ZodDiscriminatedUnion<"so
372
372
  }, {
373
373
  workflowId: string;
374
374
  name: string;
375
- description: string;
376
375
  version: string;
376
+ description: string;
377
377
  schemaVersion: 1;
378
378
  sourceKind: "v1_pinned";
379
379
  definition?: unknown;
@@ -604,6 +604,9 @@ function mountConsoleRoutes(app, consoleService, workflowService, timingRingBuff
604
604
  else if (result._tag === 'error') {
605
605
  console.log(`[ConsoleRoutes] Auto dispatch failed: workflowId=${workflowId} error=${result.message}`);
606
606
  }
607
+ else if (result._tag === 'stuck') {
608
+ console.log(`[ConsoleRoutes] Auto dispatch stuck: workflowId=${workflowId} reason=${result.reason} message=${result.message}`);
609
+ }
607
610
  else {
608
611
  (0, assert_never_js_1.assertNever)(result);
609
612
  }