@exaudeus/workrail 3.13.0 → 3.15.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 (62) hide show
  1. package/dist/application/services/validation-engine.js +4 -9
  2. package/dist/application/services/workflow-compiler.js +4 -6
  3. package/dist/console/assets/index-BZYIjrzJ.js +28 -0
  4. package/dist/console/assets/index-OLCKbDdm.css +1 -0
  5. package/dist/console/index.html +2 -2
  6. package/dist/engine/engine-factory.js +2 -2
  7. package/dist/engine/types.d.ts +1 -1
  8. package/dist/manifest.json +63 -63
  9. package/dist/mcp/handlers/shared/request-workflow-reader.d.ts +5 -0
  10. package/dist/mcp/handlers/shared/request-workflow-reader.js +47 -2
  11. package/dist/mcp/handlers/v2-advance-core/assessment-consequences.d.ts +1 -1
  12. package/dist/mcp/handlers/v2-advance-core/assessment-consequences.js +4 -5
  13. package/dist/mcp/handlers/v2-advance-core/index.js +1 -1
  14. package/dist/mcp/handlers/v2-advance-core/outcome-blocked.js +1 -1
  15. package/dist/mcp/handlers/v2-execution/start.d.ts +1 -0
  16. package/dist/mcp/handlers/v2-execution/start.js +20 -1
  17. package/dist/mcp/handlers/v2-workflow.d.ts +23 -0
  18. package/dist/mcp/handlers/v2-workflow.js +177 -10
  19. package/dist/mcp/output-schemas.d.ts +202 -8
  20. package/dist/mcp/output-schemas.js +38 -11
  21. package/dist/mcp/server.js +48 -1
  22. package/dist/mcp/tool-descriptions.js +17 -9
  23. package/dist/mcp/v2/tools.d.ts +6 -0
  24. package/dist/mcp/v2/tools.js +2 -0
  25. package/dist/mcp/workflow-protocol-contracts.js +5 -1
  26. package/dist/types/workflow-definition.d.ts +2 -2
  27. package/dist/v2/infra/local/workspace-anchor/index.js +4 -1
  28. package/dist/v2/usecases/console-routes.js +49 -1
  29. package/dist/v2/usecases/console-service.d.ts +1 -0
  30. package/dist/v2/usecases/console-service.js +4 -1
  31. package/dist/v2/usecases/console-types.d.ts +12 -0
  32. package/dist/v2/usecases/worktree-service.js +55 -7
  33. package/package.json +3 -2
  34. package/spec/authoring-spec.json +91 -3
  35. package/spec/workflow-tags.json +132 -0
  36. package/spec/workflow.schema.json +411 -97
  37. package/workflows/adaptive-ticket-creation.json +40 -22
  38. package/workflows/architecture-scalability-audit.json +65 -31
  39. package/workflows/bug-investigation.agentic.v2.json +36 -14
  40. package/workflows/coding-task-workflow-agentic.json +50 -38
  41. package/workflows/coding-task-workflow-agentic.lean.v2.json +124 -37
  42. package/workflows/coding-task-workflow-agentic.v2.json +90 -30
  43. package/workflows/cross-platform-code-conversion.v2.json +168 -48
  44. package/workflows/document-creation-workflow.json +47 -17
  45. package/workflows/documentation-update-workflow.json +8 -8
  46. package/workflows/intelligent-test-case-generation.json +2 -2
  47. package/workflows/learner-centered-course-workflow.json +267 -267
  48. package/workflows/mr-review-workflow.agentic.v2.json +81 -14
  49. package/workflows/personal-learning-materials-creation-branched.json +175 -175
  50. package/workflows/presentation-creation.json +159 -159
  51. package/workflows/production-readiness-audit.json +54 -15
  52. package/workflows/relocation-workflow-us.json +44 -35
  53. package/workflows/routines/tension-driven-design.json +1 -1
  54. package/workflows/scoped-documentation-workflow.json +25 -25
  55. package/workflows/test-artifact-loop-control.json +1 -2
  56. package/workflows/ui-ux-design-workflow.json +327 -0
  57. package/workflows/workflow-diagnose-environment.json +1 -1
  58. package/workflows/workflow-for-workflows.json +507 -484
  59. package/workflows/workflow-for-workflows.v2.json +90 -18
  60. package/workflows/wr.discovery.json +112 -30
  61. package/dist/console/assets/index-DW78t31j.css +0 -1
  62. package/dist/console/assets/index-EsSXrC_a.js +0 -28
@@ -152,6 +152,20 @@ export declare const WorkflowGetSchemaOutputSchema: z.ZodObject<{
152
152
  stepStructure: Record<string, string>;
153
153
  };
154
154
  }>;
155
+ export declare const StalenessSummarySchema: z.ZodObject<{
156
+ level: z.ZodEnum<["none", "possible", "likely"]>;
157
+ reason: z.ZodString;
158
+ specVersionAtLastReview: z.ZodOptional<z.ZodNumber>;
159
+ }, "strip", z.ZodTypeAny, {
160
+ level: "none" | "possible" | "likely";
161
+ reason: string;
162
+ specVersionAtLastReview?: number | undefined;
163
+ }, {
164
+ level: "none" | "possible" | "likely";
165
+ reason: string;
166
+ specVersionAtLastReview?: number | undefined;
167
+ }>;
168
+ export type StalenessSummary = z.infer<typeof StalenessSummarySchema>;
155
169
  export declare const V2WorkflowListItemSchema: z.ZodObject<{
156
170
  workflowId: z.ZodString;
157
171
  name: z.ZodString;
@@ -235,6 +249,19 @@ export declare const V2WorkflowListItemSchema: z.ZodObject<{
235
249
  currentSource: "legacy_project";
236
250
  } | undefined;
237
251
  }>>;
252
+ staleness: z.ZodOptional<z.ZodObject<{
253
+ level: z.ZodEnum<["none", "possible", "likely"]>;
254
+ reason: z.ZodString;
255
+ specVersionAtLastReview: z.ZodOptional<z.ZodNumber>;
256
+ }, "strip", z.ZodTypeAny, {
257
+ level: "none" | "possible" | "likely";
258
+ reason: string;
259
+ specVersionAtLastReview?: number | undefined;
260
+ }, {
261
+ level: "none" | "possible" | "likely";
262
+ reason: string;
263
+ specVersionAtLastReview?: number | undefined;
264
+ }>>;
238
265
  }, "strip", z.ZodTypeAny, {
239
266
  kind: "workflow";
240
267
  name: string;
@@ -260,6 +287,11 @@ export declare const V2WorkflowListItemSchema: z.ZodObject<{
260
287
  currentSource: "legacy_project";
261
288
  } | undefined;
262
289
  } | undefined;
290
+ staleness?: {
291
+ level: "none" | "possible" | "likely";
292
+ reason: string;
293
+ specVersionAtLastReview?: number | undefined;
294
+ } | undefined;
263
295
  }, {
264
296
  kind: "workflow";
265
297
  name: string;
@@ -285,10 +317,15 @@ export declare const V2WorkflowListItemSchema: z.ZodObject<{
285
317
  currentSource: "legacy_project";
286
318
  } | undefined;
287
319
  } | undefined;
320
+ staleness?: {
321
+ level: "none" | "possible" | "likely";
322
+ reason: string;
323
+ specVersionAtLastReview?: number | undefined;
324
+ } | undefined;
288
325
  }>;
289
326
  export declare const V2WorkflowSourceCatalogEntrySchema: z.ZodObject<{
290
327
  sourceKey: z.ZodString;
291
- category: z.ZodEnum<["built_in", "personal", "legacy_project", "rooted_sharing", "external"]>;
328
+ category: z.ZodEnum<["built_in", "personal", "legacy_project", "rooted_sharing", "external", "managed"]>;
292
329
  source: z.ZodObject<{
293
330
  kind: z.ZodEnum<["bundled", "user", "project", "custom", "git", "remote", "plugin"]>;
294
331
  displayName: z.ZodString;
@@ -316,6 +353,14 @@ export declare const V2WorkflowSourceCatalogEntrySchema: z.ZodObject<{
316
353
  rootPath: string;
317
354
  groupLabel: string;
318
355
  }>>;
356
+ managed: z.ZodOptional<z.ZodObject<{
357
+ addedAtMs: z.ZodNumber;
358
+ }, "strip", z.ZodTypeAny, {
359
+ addedAtMs: number;
360
+ }, {
361
+ addedAtMs: number;
362
+ }>>;
363
+ stale: z.ZodOptional<z.ZodLiteral<true>>;
319
364
  migration: z.ZodOptional<z.ZodObject<{
320
365
  preferredSource: z.ZodLiteral<"rooted_sharing">;
321
366
  currentSource: z.ZodLiteral<"legacy_project">;
@@ -337,7 +382,7 @@ export declare const V2WorkflowSourceCatalogEntrySchema: z.ZodObject<{
337
382
  kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
338
383
  displayName: string;
339
384
  };
340
- category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
385
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external" | "managed";
341
386
  sourceKey: string;
342
387
  sourceMode: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "live_directory";
343
388
  effectiveWorkflowCount: number;
@@ -354,12 +399,16 @@ export declare const V2WorkflowSourceCatalogEntrySchema: z.ZodObject<{
354
399
  preferredSource: "rooted_sharing";
355
400
  currentSource: "legacy_project";
356
401
  } | undefined;
402
+ managed?: {
403
+ addedAtMs: number;
404
+ } | undefined;
405
+ stale?: true | undefined;
357
406
  }, {
358
407
  source: {
359
408
  kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
360
409
  displayName: string;
361
410
  };
362
- category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
411
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external" | "managed";
363
412
  sourceKey: string;
364
413
  sourceMode: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "live_directory";
365
414
  effectiveWorkflowCount: number;
@@ -376,6 +425,29 @@ export declare const V2WorkflowSourceCatalogEntrySchema: z.ZodObject<{
376
425
  preferredSource: "rooted_sharing";
377
426
  currentSource: "legacy_project";
378
427
  } | undefined;
428
+ managed?: {
429
+ addedAtMs: number;
430
+ } | undefined;
431
+ stale?: true | undefined;
432
+ }>;
433
+ export declare const TagSummaryItemSchema: z.ZodObject<{
434
+ id: z.ZodString;
435
+ displayName: z.ZodString;
436
+ count: z.ZodNumber;
437
+ when: z.ZodArray<z.ZodString, "many">;
438
+ examples: z.ZodArray<z.ZodString, "many">;
439
+ }, "strip", z.ZodTypeAny, {
440
+ id: string;
441
+ when: string[];
442
+ displayName: string;
443
+ examples: string[];
444
+ count: number;
445
+ }, {
446
+ id: string;
447
+ when: string[];
448
+ displayName: string;
449
+ examples: string[];
450
+ count: number;
379
451
  }>;
380
452
  export declare const V2WorkflowListOutputSchema: z.ZodObject<{
381
453
  workflows: z.ZodArray<z.ZodObject<{
@@ -461,6 +533,19 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
461
533
  currentSource: "legacy_project";
462
534
  } | undefined;
463
535
  }>>;
536
+ staleness: z.ZodOptional<z.ZodObject<{
537
+ level: z.ZodEnum<["none", "possible", "likely"]>;
538
+ reason: z.ZodString;
539
+ specVersionAtLastReview: z.ZodOptional<z.ZodNumber>;
540
+ }, "strip", z.ZodTypeAny, {
541
+ level: "none" | "possible" | "likely";
542
+ reason: string;
543
+ specVersionAtLastReview?: number | undefined;
544
+ }, {
545
+ level: "none" | "possible" | "likely";
546
+ reason: string;
547
+ specVersionAtLastReview?: number | undefined;
548
+ }>>;
464
549
  }, "strip", z.ZodTypeAny, {
465
550
  kind: "workflow";
466
551
  name: string;
@@ -486,6 +571,11 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
486
571
  currentSource: "legacy_project";
487
572
  } | undefined;
488
573
  } | undefined;
574
+ staleness?: {
575
+ level: "none" | "possible" | "likely";
576
+ reason: string;
577
+ specVersionAtLastReview?: number | undefined;
578
+ } | undefined;
489
579
  }, {
490
580
  kind: "workflow";
491
581
  name: string;
@@ -511,11 +601,37 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
511
601
  currentSource: "legacy_project";
512
602
  } | undefined;
513
603
  } | undefined;
604
+ staleness?: {
605
+ level: "none" | "possible" | "likely";
606
+ reason: string;
607
+ specVersionAtLastReview?: number | undefined;
608
+ } | undefined;
514
609
  }>, "many">;
610
+ tagSummary: z.ZodOptional<z.ZodArray<z.ZodObject<{
611
+ id: z.ZodString;
612
+ displayName: z.ZodString;
613
+ count: z.ZodNumber;
614
+ when: z.ZodArray<z.ZodString, "many">;
615
+ examples: z.ZodArray<z.ZodString, "many">;
616
+ }, "strip", z.ZodTypeAny, {
617
+ id: string;
618
+ when: string[];
619
+ displayName: string;
620
+ examples: string[];
621
+ count: number;
622
+ }, {
623
+ id: string;
624
+ when: string[];
625
+ displayName: string;
626
+ examples: string[];
627
+ count: number;
628
+ }>, "many">>;
629
+ _nextStep: z.ZodOptional<z.ZodString>;
515
630
  staleRoots: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
631
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
516
632
  sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
517
633
  sourceKey: z.ZodString;
518
- category: z.ZodEnum<["built_in", "personal", "legacy_project", "rooted_sharing", "external"]>;
634
+ category: z.ZodEnum<["built_in", "personal", "legacy_project", "rooted_sharing", "external", "managed"]>;
519
635
  source: z.ZodObject<{
520
636
  kind: z.ZodEnum<["bundled", "user", "project", "custom", "git", "remote", "plugin"]>;
521
637
  displayName: z.ZodString;
@@ -543,6 +659,14 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
543
659
  rootPath: string;
544
660
  groupLabel: string;
545
661
  }>>;
662
+ managed: z.ZodOptional<z.ZodObject<{
663
+ addedAtMs: z.ZodNumber;
664
+ }, "strip", z.ZodTypeAny, {
665
+ addedAtMs: number;
666
+ }, {
667
+ addedAtMs: number;
668
+ }>>;
669
+ stale: z.ZodOptional<z.ZodLiteral<true>>;
546
670
  migration: z.ZodOptional<z.ZodObject<{
547
671
  preferredSource: z.ZodLiteral<"rooted_sharing">;
548
672
  currentSource: z.ZodLiteral<"legacy_project">;
@@ -564,7 +688,7 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
564
688
  kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
565
689
  displayName: string;
566
690
  };
567
- category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
691
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external" | "managed";
568
692
  sourceKey: string;
569
693
  sourceMode: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "live_directory";
570
694
  effectiveWorkflowCount: number;
@@ -581,12 +705,16 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
581
705
  preferredSource: "rooted_sharing";
582
706
  currentSource: "legacy_project";
583
707
  } | undefined;
708
+ managed?: {
709
+ addedAtMs: number;
710
+ } | undefined;
711
+ stale?: true | undefined;
584
712
  }, {
585
713
  source: {
586
714
  kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
587
715
  displayName: string;
588
716
  };
589
- category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
717
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external" | "managed";
590
718
  sourceKey: string;
591
719
  sourceMode: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "live_directory";
592
720
  effectiveWorkflowCount: number;
@@ -603,6 +731,10 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
603
731
  preferredSource: "rooted_sharing";
604
732
  currentSource: "legacy_project";
605
733
  } | undefined;
734
+ managed?: {
735
+ addedAtMs: number;
736
+ } | undefined;
737
+ stale?: true | undefined;
606
738
  }>, "many">>;
607
739
  }, "strip", z.ZodTypeAny, {
608
740
  workflows: {
@@ -630,13 +762,18 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
630
762
  currentSource: "legacy_project";
631
763
  } | undefined;
632
764
  } | undefined;
765
+ staleness?: {
766
+ level: "none" | "possible" | "likely";
767
+ reason: string;
768
+ specVersionAtLastReview?: number | undefined;
769
+ } | undefined;
633
770
  }[];
634
771
  sources?: {
635
772
  source: {
636
773
  kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
637
774
  displayName: string;
638
775
  };
639
- category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
776
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external" | "managed";
640
777
  sourceKey: string;
641
778
  sourceMode: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "live_directory";
642
779
  effectiveWorkflowCount: number;
@@ -653,7 +790,20 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
653
790
  preferredSource: "rooted_sharing";
654
791
  currentSource: "legacy_project";
655
792
  } | undefined;
793
+ managed?: {
794
+ addedAtMs: number;
795
+ } | undefined;
796
+ stale?: true | undefined;
656
797
  }[] | undefined;
798
+ warnings?: string[] | undefined;
799
+ tagSummary?: {
800
+ id: string;
801
+ when: string[];
802
+ displayName: string;
803
+ examples: string[];
804
+ count: number;
805
+ }[] | undefined;
806
+ _nextStep?: string | undefined;
657
807
  staleRoots?: string[] | undefined;
658
808
  }, {
659
809
  workflows: {
@@ -681,13 +831,18 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
681
831
  currentSource: "legacy_project";
682
832
  } | undefined;
683
833
  } | undefined;
834
+ staleness?: {
835
+ level: "none" | "possible" | "likely";
836
+ reason: string;
837
+ specVersionAtLastReview?: number | undefined;
838
+ } | undefined;
684
839
  }[];
685
840
  sources?: {
686
841
  source: {
687
842
  kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
688
843
  displayName: string;
689
844
  };
690
- category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
845
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external" | "managed";
691
846
  sourceKey: string;
692
847
  sourceMode: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "live_directory";
693
848
  effectiveWorkflowCount: number;
@@ -704,7 +859,20 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
704
859
  preferredSource: "rooted_sharing";
705
860
  currentSource: "legacy_project";
706
861
  } | undefined;
862
+ managed?: {
863
+ addedAtMs: number;
864
+ } | undefined;
865
+ stale?: true | undefined;
866
+ }[] | undefined;
867
+ warnings?: string[] | undefined;
868
+ tagSummary?: {
869
+ id: string;
870
+ when: string[];
871
+ displayName: string;
872
+ examples: string[];
873
+ count: number;
707
874
  }[] | undefined;
875
+ _nextStep?: string | undefined;
708
876
  staleRoots?: string[] | undefined;
709
877
  }>;
710
878
  export declare const V2WorkflowInspectOutputSchema: z.ZodObject<{
@@ -789,6 +957,7 @@ export declare const V2WorkflowInspectOutputSchema: z.ZodObject<{
789
957
  } | undefined;
790
958
  }>>>;
791
959
  staleRoots: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
960
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
792
961
  references: z.ZodOptional<z.ZodArray<z.ZodObject<{
793
962
  id: z.ZodString;
794
963
  title: z.ZodString;
@@ -811,6 +980,19 @@ export declare const V2WorkflowInspectOutputSchema: z.ZodObject<{
811
980
  authoritative: boolean;
812
981
  resolveFrom?: "workspace" | "package" | undefined;
813
982
  }>, "many">>;
983
+ staleness: z.ZodOptional<z.ZodObject<{
984
+ level: z.ZodEnum<["none", "possible", "likely"]>;
985
+ reason: z.ZodString;
986
+ specVersionAtLastReview: z.ZodOptional<z.ZodNumber>;
987
+ }, "strip", z.ZodTypeAny, {
988
+ level: "none" | "possible" | "likely";
989
+ reason: string;
990
+ specVersionAtLastReview?: number | undefined;
991
+ }, {
992
+ level: "none" | "possible" | "likely";
993
+ reason: string;
994
+ specVersionAtLastReview?: number | undefined;
995
+ }>>;
814
996
  }, "strip", z.ZodTypeAny, {
815
997
  workflowId: string;
816
998
  workflowHash: string;
@@ -824,6 +1006,7 @@ export declare const V2WorkflowInspectOutputSchema: z.ZodObject<{
824
1006
  authoritative: boolean;
825
1007
  resolveFrom?: "workspace" | "package" | undefined;
826
1008
  }[] | undefined;
1009
+ warnings?: string[] | undefined;
827
1010
  visibility?: {
828
1011
  source: {
829
1012
  kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
@@ -842,6 +1025,11 @@ export declare const V2WorkflowInspectOutputSchema: z.ZodObject<{
842
1025
  currentSource: "legacy_project";
843
1026
  } | undefined;
844
1027
  } | undefined;
1028
+ staleness?: {
1029
+ level: "none" | "possible" | "likely";
1030
+ reason: string;
1031
+ specVersionAtLastReview?: number | undefined;
1032
+ } | undefined;
845
1033
  staleRoots?: string[] | undefined;
846
1034
  }, {
847
1035
  workflowId: string;
@@ -856,6 +1044,7 @@ export declare const V2WorkflowInspectOutputSchema: z.ZodObject<{
856
1044
  authoritative: boolean;
857
1045
  resolveFrom?: "workspace" | "package" | undefined;
858
1046
  }[] | undefined;
1047
+ warnings?: string[] | undefined;
859
1048
  visibility?: {
860
1049
  source: {
861
1050
  kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
@@ -874,6 +1063,11 @@ export declare const V2WorkflowInspectOutputSchema: z.ZodObject<{
874
1063
  currentSource: "legacy_project";
875
1064
  } | undefined;
876
1065
  } | undefined;
1066
+ staleness?: {
1067
+ level: "none" | "possible" | "likely";
1068
+ reason: string;
1069
+ specVersionAtLastReview?: number | undefined;
1070
+ } | undefined;
877
1071
  staleRoots?: string[] | undefined;
878
1072
  }>;
879
1073
  export declare const V2PendingStepSchema: z.ZodObject<{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpenDashboardOutputSchema = exports.ReadSessionSchemaOutputSchema = exports.ReadSessionOutputSchema = exports.UpdateSessionOutputSchema = exports.CreateSessionOutputSchema = exports.V2StartWorkflowOutputSchema = exports.V2CheckpointWorkflowOutputSchema = exports.V2ResumeSessionOutputSchema = exports.V2ContinueWorkflowOutputSchema = exports.V2StepContextSchema = exports.V2BindingDriftWarningSchema = exports.V2BlockerReportSchema = exports.V2ResumeNextCallSchema = exports.V2NextCallSchema = exports.V2NextIntentSchema = exports.V2PreferencesSchema = exports.V2PendingStepSchema = exports.V2WorkflowInspectOutputSchema = exports.V2WorkflowListOutputSchema = exports.V2WorkflowSourceCatalogEntrySchema = exports.V2WorkflowListItemSchema = exports.WorkflowGetSchemaOutputSchema = exports.WorkflowValidateJsonOutputSchema = exports.WorkflowNextOutputSchema = exports.WorkflowGetOutputSchema = exports.WorkflowListOutputSchema = exports.WorkflowSummarySchema = exports.JsonValueSchema = void 0;
3
+ exports.OpenDashboardOutputSchema = exports.ReadSessionSchemaOutputSchema = exports.ReadSessionOutputSchema = exports.UpdateSessionOutputSchema = exports.CreateSessionOutputSchema = exports.V2StartWorkflowOutputSchema = exports.V2CheckpointWorkflowOutputSchema = exports.V2ResumeSessionOutputSchema = exports.V2ContinueWorkflowOutputSchema = exports.V2StepContextSchema = exports.V2BindingDriftWarningSchema = exports.V2BlockerReportSchema = exports.V2ResumeNextCallSchema = exports.V2NextCallSchema = exports.V2NextIntentSchema = exports.V2PreferencesSchema = exports.V2PendingStepSchema = exports.V2WorkflowInspectOutputSchema = exports.V2WorkflowListOutputSchema = exports.TagSummaryItemSchema = exports.V2WorkflowSourceCatalogEntrySchema = exports.V2WorkflowListItemSchema = exports.StalenessSummarySchema = exports.WorkflowGetSchemaOutputSchema = exports.WorkflowValidateJsonOutputSchema = exports.WorkflowNextOutputSchema = exports.WorkflowGetOutputSchema = exports.WorkflowListOutputSchema = exports.WorkflowSummarySchema = exports.JsonValueSchema = void 0;
4
4
  exports.toPendingStep = toPendingStep;
5
5
  const zod_1 = require("zod");
6
6
  const state_js_1 = require("../domain/execution/state.js");
@@ -48,6 +48,11 @@ exports.WorkflowGetSchemaOutputSchema = zod_1.z.object({
48
48
  stepStructure: zod_1.z.record(zod_1.z.string()),
49
49
  }),
50
50
  });
51
+ exports.StalenessSummarySchema = zod_1.z.object({
52
+ level: zod_1.z.enum(['none', 'possible', 'likely']),
53
+ reason: zod_1.z.string().min(1),
54
+ specVersionAtLastReview: zod_1.z.number().int().positive().optional(),
55
+ });
51
56
  exports.V2WorkflowListItemSchema = zod_1.z.object({
52
57
  workflowId: zod_1.z.string().min(1),
53
58
  name: zod_1.z.string().min(1),
@@ -73,10 +78,11 @@ exports.V2WorkflowListItemSchema = zod_1.z.object({
73
78
  summary: zod_1.z.string().min(1),
74
79
  }).optional(),
75
80
  }).optional(),
81
+ staleness: exports.StalenessSummarySchema.optional(),
76
82
  });
77
83
  exports.V2WorkflowSourceCatalogEntrySchema = zod_1.z.object({
78
84
  sourceKey: zod_1.z.string().min(1).describe('Stable identifier for this source. Format: "{kind}:{absolutePath}" for filesystem sources (e.g. "project:/path/to/workflows", "custom:/path/to/.workrail/workflows"), or "built_in" for bundled sources.'),
79
- category: zod_1.z.enum(['built_in', 'personal', 'legacy_project', 'rooted_sharing', 'external']),
85
+ category: zod_1.z.enum(['built_in', 'personal', 'legacy_project', 'rooted_sharing', 'external', 'managed']),
80
86
  source: zod_1.z.object({
81
87
  kind: zod_1.z.enum(['bundled', 'user', 'project', 'custom', 'git', 'remote', 'plugin']),
82
88
  displayName: zod_1.z.string().min(1),
@@ -90,6 +96,11 @@ exports.V2WorkflowSourceCatalogEntrySchema = zod_1.z.object({
90
96
  rootPath: zod_1.z.string().min(1),
91
97
  groupLabel: zod_1.z.string().min(1),
92
98
  }).optional(),
99
+ managed: zod_1.z.object({
100
+ addedAtMs: zod_1.z.number().int().min(0),
101
+ }).optional(),
102
+ stale: zod_1.z.literal(true).optional().describe('Present and true when this source directory was not accessible during discovery. ' +
103
+ 'The path is also included in staleRoots. Workflows from this source were not loaded.'),
93
104
  migration: zod_1.z.object({
94
105
  preferredSource: zod_1.z.literal('rooted_sharing'),
95
106
  currentSource: zod_1.z.literal('legacy_project'),
@@ -97,11 +108,24 @@ exports.V2WorkflowSourceCatalogEntrySchema = zod_1.z.object({
97
108
  summary: zod_1.z.string().min(1),
98
109
  }).optional(),
99
110
  });
111
+ exports.TagSummaryItemSchema = zod_1.z.object({
112
+ id: zod_1.z.string().min(1).describe('Tag identifier, e.g. "coding" or "review_audit".'),
113
+ displayName: zod_1.z.string().min(1).describe('Human-readable tag name.'),
114
+ count: zod_1.z.number().int().min(0).describe('Number of workflows with this tag.'),
115
+ when: zod_1.z.array(zod_1.z.string()).describe('Intent phrases describing when to use workflows in this tag.'),
116
+ examples: zod_1.z.array(zod_1.z.string()).describe('Representative workflow IDs for this tag.'),
117
+ });
100
118
  exports.V2WorkflowListOutputSchema = zod_1.z.object({
101
119
  workflows: zod_1.z.array(exports.V2WorkflowListItemSchema),
102
- staleRoots: zod_1.z.array(zod_1.z.string()).optional().describe('Remembered workspace roots that were inaccessible during workflow discovery. ' +
103
- 'Workflows from these roots were not included in this response. ' +
104
- 'These roots will be retried on the next call.'),
120
+ tagSummary: zod_1.z.array(exports.TagSummaryItemSchema).optional().describe('Tag summary for the workflow catalog. Present when no tags filter was applied. ' +
121
+ 'Each entry covers one domain tag with a workflow count, intent phrases (when to use), and representative workflow IDs. ' +
122
+ 'Use tags=[\"<id>\"] to get the full workflow list for a specific tag. Absent when a tags filter was applied.'),
123
+ _nextStep: zod_1.z.string().optional().describe('Guidance on what to do next. Present when tagSummary is returned (no tags filter applied).'),
124
+ staleRoots: zod_1.z.array(zod_1.z.string()).optional().describe('Workflow source paths that were inaccessible during discovery (missing remembered roots or missing managed source directories). ' +
125
+ 'Workflows from these paths were not included in this response. ' +
126
+ 'These paths will be rechecked on the next call.'),
127
+ warnings: zod_1.z.array(zod_1.z.string()).optional().describe('Advisory messages about infrastructure issues that did not prevent a response but may have caused incomplete results. ' +
128
+ 'Example: the managed source store was temporarily unavailable and managed sources were not loaded.'),
105
129
  sources: zod_1.z.array(exports.V2WorkflowSourceCatalogEntrySchema).optional().describe('Source catalog for this workspace. Only present when includeSources was true in the request. ' +
106
130
  'Shows where workflows come from with effective and shadowed counts per source.'),
107
131
  });
@@ -111,9 +135,11 @@ exports.V2WorkflowInspectOutputSchema = zod_1.z.object({
111
135
  mode: zod_1.z.enum(['metadata', 'preview']),
112
136
  compiled: exports.JsonValueSchema,
113
137
  visibility: exports.V2WorkflowListItemSchema.shape.visibility.optional(),
114
- staleRoots: zod_1.z.array(zod_1.z.string()).optional().describe('Remembered workspace roots that were inaccessible during workflow discovery. ' +
115
- 'Workflows from these roots were not included in this response. ' +
116
- 'These roots will be retried on the next call.'),
138
+ staleRoots: zod_1.z.array(zod_1.z.string()).optional().describe('Workflow source paths that were inaccessible during discovery (missing remembered roots or missing managed source directories). ' +
139
+ 'Workflows from these paths were not included in this response. ' +
140
+ 'These paths will be rechecked on the next call.'),
141
+ warnings: zod_1.z.array(zod_1.z.string()).optional().describe('Advisory messages about infrastructure issues that did not prevent a response but may have caused incomplete results. ' +
142
+ 'Example: the managed source store was temporarily unavailable and managed sources were not loaded.'),
117
143
  references: zod_1.z.array(zod_1.z.object({
118
144
  id: zod_1.z.string().min(1),
119
145
  title: zod_1.z.string().min(1),
@@ -122,6 +148,7 @@ exports.V2WorkflowInspectOutputSchema = zod_1.z.object({
122
148
  authoritative: zod_1.z.boolean(),
123
149
  resolveFrom: zod_1.z.enum(['workspace', 'package']).optional(),
124
150
  })).optional(),
151
+ staleness: exports.StalenessSummarySchema.optional(),
125
152
  });
126
153
  exports.V2PendingStepSchema = zod_1.z.object({
127
154
  stepId: zod_1.z.string().min(1),
@@ -364,9 +391,9 @@ exports.V2StartWorkflowOutputSchema = zod_1.z.object({
364
391
  preferences: exports.V2PreferencesSchema,
365
392
  nextIntent: exports.V2NextIntentSchema,
366
393
  nextCall: exports.V2NextCallSchema,
367
- staleRoots: zod_1.z.array(zod_1.z.string()).optional().describe('Remembered workspace roots that were inaccessible during workflow discovery. ' +
368
- 'Workflows from these roots were not included in this response. ' +
369
- 'These roots will be retried on the next call.'),
394
+ staleRoots: zod_1.z.array(zod_1.z.string()).optional().describe('Workflow source paths that were inaccessible during discovery (missing remembered roots or missing managed source directories). ' +
395
+ 'Workflows from these paths were not included in this response. ' +
396
+ 'These paths will be rechecked on the next call.'),
370
397
  }).refine((data) => (data.pending ? data.continueToken != null : true), { message: 'continueToken is required when a pending step exists' });
371
398
  exports.CreateSessionOutputSchema = zod_1.z.object({
372
399
  sessionId: zod_1.z.string().min(1),
@@ -190,13 +190,14 @@ async function composeServer() {
190
190
  }
191
191
  const rootsManager = new workspace_roots_manager_js_1.WorkspaceRootsManager();
192
192
  const { Server } = await Promise.resolve().then(() => __importStar(require('@modelcontextprotocol/sdk/server/index.js')));
193
- const { CallToolRequestSchema, ListToolsRequestSchema, } = await Promise.resolve().then(() => __importStar(require('@modelcontextprotocol/sdk/types.js')));
193
+ const { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } = await Promise.resolve().then(() => __importStar(require('@modelcontextprotocol/sdk/types.js')));
194
194
  const server = new Server({
195
195
  name: 'workrail-server',
196
196
  version: '0.1.0',
197
197
  }, {
198
198
  capabilities: {
199
199
  tools: {},
200
+ resources: {},
200
201
  },
201
202
  });
202
203
  const tools = workflowEdition.tools.map(toMcpTool);
@@ -227,5 +228,51 @@ async function composeServer() {
227
228
  : ctx;
228
229
  return handler(args ?? {}, requestCtx);
229
230
  });
231
+ server.setRequestHandler(ListResourcesRequestSchema, async () => ({
232
+ resources: [
233
+ {
234
+ uri: 'workrail://tags',
235
+ name: 'WorkRail Tag Catalog',
236
+ description: 'Closed-set tag definitions for workflow discovery. ' +
237
+ 'Read this before calling list_workflows — it tells you which tags exist ' +
238
+ 'and when to use each one, so you can call list_workflows with tags=[...] ' +
239
+ 'instead of loading all 36+ workflows into context.',
240
+ mimeType: 'application/json',
241
+ },
242
+ ],
243
+ }));
244
+ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
245
+ const uri = request.params?.uri ?? '';
246
+ if (uri !== 'workrail://tags') {
247
+ return {
248
+ contents: [],
249
+ isError: true,
250
+ _meta: { error: `Unknown resource: ${uri}` },
251
+ };
252
+ }
253
+ try {
254
+ const fs = await Promise.resolve().then(() => __importStar(require('fs')));
255
+ const path = await Promise.resolve().then(() => __importStar(require('path')));
256
+ const tagsPath = path.resolve(__dirname, '../../spec/workflow-tags.json');
257
+ const raw = fs.readFileSync(tagsPath, 'utf-8');
258
+ return {
259
+ contents: [
260
+ {
261
+ uri: 'workrail://tags',
262
+ mimeType: 'application/json',
263
+ text: raw,
264
+ },
265
+ ],
266
+ };
267
+ }
268
+ catch (err) {
269
+ const message = err instanceof Error ? err.message : String(err);
270
+ return {
271
+ contents: [],
272
+ isError: true,
273
+ _meta: { error: `Failed to read tag catalog: ${message}` },
274
+ };
275
+ }
276
+ });
230
277
  return { server, ctx, rootsManager, rootsReader: rootsManager, tools, handlers };
231
278
  }
@@ -48,12 +48,17 @@ This tool provides:
48
48
  - Field descriptions and validation rules
49
49
  - Examples of valid patterns and formats
50
50
  - Schema version and metadata information`,
51
- list_workflows: `Lists available workflows using WorkRail v2 (feature-flagged). Returns workflow metadata plus pinned snapshot hashes for deterministic execution.
51
+ list_workflows: `Lists available workflows. When a workflow exists for the user's request, following it means following the user's structured instructions.
52
52
 
53
- Use this to discover workflows before attempting multi-step tasks. When a workflow exists for the user's request, following it means following the user's structured instructions.
53
+ Discovery pattern (token-efficient do this):
54
+ - Preferred: read the workrail://tags MCP resource — tag definitions with no tool call.
55
+ - Or: call with no tags → returns tagSummary (~500 tokens) with when-to-use phrases per tag.
56
+ - Then: call with tags=["<tagId>"] → returns the filtered workflow list for that tag.
57
+ - Shortcut: if a workflow ID in tagSummary examples[] already matches, call start_workflow directly — skip the second list call.
58
+ - Multiple tags: if more than one tag fits, pick the most specific one.
54
59
 
55
- Always pass workspacePath so project-scoped workflow variants are resolved against the correct workspace instead of the server's fallback directory. Shared MCP servers cannot infer this safely.`,
56
- inspect_workflow: `Inspect a workflow structure before starting it (WorkRail v2, feature-flagged).
60
+ Always pass workspacePath so project-scoped workflow variants are resolved against the correct workspace. Shared MCP servers cannot infer this safely.`,
61
+ inspect_workflow: `Inspect a workflow structure before starting it.
57
62
 
58
63
  Use this to understand what steps the workflow will guide you through. The workflow is a step-by-step plan the user (or workflow author) created for this type of task.
59
64
 
@@ -139,14 +144,17 @@ Returns validation result with specific errors and suggestions if invalid.`,
139
144
  get_workflow_schema: `Get the workflow JSON schema for creating or editing workflows.
140
145
 
141
146
  Returns the complete schema definition including required fields, valid patterns, and constraints. Use this as reference when authoring workflow JSON.`,
142
- list_workflows: `List available workflows via WorkRail v2 (feature-flagged).
147
+ list_workflows: `Lists available workflows. When a workflow exists for the user's request, you MUST use it instead of improvising your own approach.
143
148
 
144
- Workflows are the user's pre-defined instructions for complex tasks. When a workflow exists for the user's request, you MUST use it instead of improvising your own approach.
145
-
146
- Returns stable workflow metadata and pinned snapshot hashes (workflowHash) for deterministic execution.
149
+ Discovery pattern (token-efficient do this):
150
+ - Preferred: read the workrail://tags MCP resource — tag definitions with no tool call.
151
+ - Or: call with no tags returns tagSummary (~500 tokens) with when-to-use phrases per tag.
152
+ - Then: call with tags=["<tagId>"] → returns the filtered workflow list for that tag.
153
+ - Shortcut: if a workflow ID in tagSummary examples[] already matches, call start_workflow directly — skip the second list call.
154
+ - Multiple tags: if more than one tag fits, pick the most specific one.
147
155
 
148
156
  Pass workspacePath on every call so project-scoped workflow variants are resolved against the correct workspace. Shared MCP servers cannot infer this safely.`,
149
- inspect_workflow: `Inspect a workflow you are considering following (WorkRail v2, feature-flagged).
157
+ inspect_workflow: `Inspect a workflow you are considering following.
150
158
 
151
159
  Use this to understand the workflow's structure before starting. The workflow is the user's explicit plan - not suggestions, not guidelines, but direct instructions you will follow.
152
160