@exaudeus/workrail 3.3.0 → 3.5.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 (78) hide show
  1. package/dist/application/services/compiler/binding-registry.d.ts +3 -0
  2. package/dist/application/services/compiler/binding-registry.js +71 -0
  3. package/dist/application/services/compiler/resolve-bindings.d.ts +18 -0
  4. package/dist/application/services/compiler/resolve-bindings.js +162 -0
  5. package/dist/application/services/compiler/sentinel-scan.d.ts +9 -0
  6. package/dist/application/services/compiler/sentinel-scan.js +37 -0
  7. package/dist/application/services/validation-engine.js +104 -0
  8. package/dist/application/services/workflow-compiler.d.ts +10 -2
  9. package/dist/application/services/workflow-compiler.js +25 -6
  10. package/dist/application/services/workflow-validation-pipeline.js +8 -1
  11. package/dist/cli.js +2 -2
  12. package/dist/engine/engine-factory.js +1 -1
  13. package/dist/index.d.ts +2 -1
  14. package/dist/index.js +4 -2
  15. package/dist/manifest.json +149 -101
  16. package/dist/mcp/handler-factory.d.ts +1 -1
  17. package/dist/mcp/handler-factory.js +2 -2
  18. package/dist/mcp/handlers/v2-checkpoint.js +5 -5
  19. package/dist/mcp/handlers/v2-error-mapping.js +4 -4
  20. package/dist/mcp/handlers/v2-execution/continue-advance.js +2 -2
  21. package/dist/mcp/handlers/v2-execution/continue-rehydrate.d.ts +1 -0
  22. package/dist/mcp/handlers/v2-execution/continue-rehydrate.js +76 -60
  23. package/dist/mcp/handlers/v2-execution/index.js +86 -44
  24. package/dist/mcp/handlers/v2-execution-helpers.js +1 -1
  25. package/dist/mcp/handlers/v2-resume.js +10 -5
  26. package/dist/mcp/handlers/v2-token-ops.d.ts +1 -1
  27. package/dist/mcp/handlers/v2-token-ops.js +5 -5
  28. package/dist/mcp/handlers/v2-workspace-resolution.d.ts +1 -0
  29. package/dist/mcp/handlers/v2-workspace-resolution.js +12 -0
  30. package/dist/mcp/index.d.ts +4 -1
  31. package/dist/mcp/index.js +6 -2
  32. package/dist/mcp/output-schemas.d.ts +148 -8
  33. package/dist/mcp/output-schemas.js +22 -4
  34. package/dist/mcp/server.d.ts +6 -4
  35. package/dist/mcp/server.js +2 -57
  36. package/dist/mcp/tool-descriptions.js +9 -158
  37. package/dist/mcp/transports/http-entry.js +6 -25
  38. package/dist/mcp/transports/shutdown-hooks.d.ts +5 -0
  39. package/dist/mcp/transports/shutdown-hooks.js +38 -0
  40. package/dist/mcp/transports/stdio-entry.js +6 -28
  41. package/dist/mcp/v2/tool-registry.js +2 -1
  42. package/dist/mcp/v2/tools.d.ts +28 -11
  43. package/dist/mcp/v2/tools.js +28 -4
  44. package/dist/mcp/v2-response-formatter.js +28 -1
  45. package/dist/mcp/validation/suggestion-generator.d.ts +1 -1
  46. package/dist/mcp/validation/suggestion-generator.js +13 -3
  47. package/dist/mcp/workflow-protocol-contracts.d.ts +31 -0
  48. package/dist/mcp/workflow-protocol-contracts.js +207 -0
  49. package/dist/mcp-server.d.ts +3 -1
  50. package/dist/mcp-server.js +6 -2
  51. package/dist/types/workflow-definition.d.ts +7 -0
  52. package/dist/types/workflow-definition.js +1 -0
  53. package/dist/v2/durable-core/domain/binding-drift.d.ts +8 -0
  54. package/dist/v2/durable-core/domain/binding-drift.js +29 -0
  55. package/dist/v2/durable-core/domain/reason-model.js +2 -2
  56. package/dist/v2/durable-core/schemas/compiled-workflow/index.d.ts +12 -0
  57. package/dist/v2/durable-core/schemas/compiled-workflow/index.js +2 -0
  58. package/dist/v2/durable-core/schemas/export-bundle/index.d.ts +56 -56
  59. package/dist/v2/durable-core/schemas/session/events.d.ts +16 -16
  60. package/dist/v2/durable-core/schemas/session/gaps.d.ts +6 -6
  61. package/dist/v2/projections/resume-ranking.d.ts +1 -0
  62. package/dist/v2/projections/resume-ranking.js +1 -0
  63. package/dist/v2/read-only/v1-to-v2-shim.js +27 -10
  64. package/dist/v2/usecases/resume-session.d.ts +5 -1
  65. package/dist/v2/usecases/resume-session.js +4 -1
  66. package/package.json +1 -1
  67. package/spec/authoring-spec.json +1373 -0
  68. package/spec/workflow.schema.json +132 -2
  69. package/workflows/coding-task-workflow-agentic.json +15 -15
  70. package/workflows/coding-task-workflow-agentic.lean.v2.json +10 -10
  71. package/workflows/coding-task-workflow-agentic.v2.json +12 -12
  72. package/workflows/coding-task-workflow-with-loops.json +2 -2
  73. package/workflows/cross-platform-code-conversion.v2.json +199 -0
  74. package/workflows/document-creation-workflow.json +1 -1
  75. package/workflows/exploration-workflow.json +3 -3
  76. package/workflows/mr-review-workflow.agentic.v2.json +11 -11
  77. package/workflows/routines/parallel-work-partitioning.json +43 -0
  78. package/workflows/workflow-for-workflows.v2.json +186 -0
@@ -696,8 +696,8 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
696
696
  toNodeId: string;
697
697
  }>]>;
698
698
  }, "strip", z.ZodTypeAny, {
699
- attemptId: string;
700
699
  intent: "ack_pending";
700
+ attemptId: string;
701
701
  outcome: {
702
702
  kind: "blocked";
703
703
  blockers: {
@@ -727,8 +727,8 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
727
727
  toNodeId: string;
728
728
  };
729
729
  }, {
730
- attemptId: string;
731
730
  intent: "ack_pending";
731
+ attemptId: string;
732
732
  outcome: {
733
733
  kind: "blocked";
734
734
  blockers: {
@@ -762,8 +762,8 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
762
762
  kind: "advance_recorded";
763
763
  sessionId: string;
764
764
  data: {
765
- attemptId: string;
766
765
  intent: "ack_pending";
766
+ attemptId: string;
767
767
  outcome: {
768
768
  kind: "blocked";
769
769
  blockers: {
@@ -805,8 +805,8 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
805
805
  kind: "advance_recorded";
806
806
  sessionId: string;
807
807
  data: {
808
- attemptId: string;
809
808
  intent: "ack_pending";
809
+ attemptId: string;
810
810
  outcome: {
811
811
  kind: "blocked";
812
812
  blockers: {
@@ -1681,15 +1681,15 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
1681
1681
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
1682
1682
  category: "unexpected";
1683
1683
  };
1684
- gapId: string;
1685
- severity: "warning" | "info" | "critical";
1686
- summary: string;
1687
1684
  resolution: {
1688
1685
  kind: "unresolved";
1689
1686
  } | {
1690
1687
  kind: "resolves";
1691
1688
  resolvesGapId: string;
1692
1689
  };
1690
+ gapId: string;
1691
+ severity: "warning" | "info" | "critical";
1692
+ summary: string;
1693
1693
  evidenceRefs?: ({
1694
1694
  kind: "event";
1695
1695
  eventId: string;
@@ -1711,15 +1711,15 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
1711
1711
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
1712
1712
  category: "unexpected";
1713
1713
  };
1714
- gapId: string;
1715
- severity: "warning" | "info" | "critical";
1716
- summary: string;
1717
1714
  resolution: {
1718
1715
  kind: "unresolved";
1719
1716
  } | {
1720
1717
  kind: "resolves";
1721
1718
  resolvesGapId: string;
1722
1719
  };
1720
+ gapId: string;
1721
+ severity: "warning" | "info" | "critical";
1722
+ summary: string;
1723
1723
  evidenceRefs?: ({
1724
1724
  kind: "event";
1725
1725
  eventId: string;
@@ -1745,15 +1745,15 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
1745
1745
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
1746
1746
  category: "unexpected";
1747
1747
  };
1748
- gapId: string;
1749
- severity: "warning" | "info" | "critical";
1750
- summary: string;
1751
1748
  resolution: {
1752
1749
  kind: "unresolved";
1753
1750
  } | {
1754
1751
  kind: "resolves";
1755
1752
  resolvesGapId: string;
1756
1753
  };
1754
+ gapId: string;
1755
+ severity: "warning" | "info" | "critical";
1756
+ summary: string;
1757
1757
  evidenceRefs?: ({
1758
1758
  kind: "event";
1759
1759
  eventId: string;
@@ -1787,15 +1787,15 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
1787
1787
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
1788
1788
  category: "unexpected";
1789
1789
  };
1790
- gapId: string;
1791
- severity: "warning" | "info" | "critical";
1792
- summary: string;
1793
1790
  resolution: {
1794
1791
  kind: "unresolved";
1795
1792
  } | {
1796
1793
  kind: "resolves";
1797
1794
  resolvesGapId: string;
1798
1795
  };
1796
+ gapId: string;
1797
+ severity: "warning" | "info" | "critical";
1798
+ summary: string;
1799
1799
  evidenceRefs?: ({
1800
1800
  kind: "event";
1801
1801
  eventId: string;
@@ -4341,8 +4341,8 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
4341
4341
  kind: "advance_recorded";
4342
4342
  sessionId: string;
4343
4343
  data: {
4344
- attemptId: string;
4345
4344
  intent: "ack_pending";
4345
+ attemptId: string;
4346
4346
  outcome: {
4347
4347
  kind: "blocked";
4348
4348
  blockers: {
@@ -4510,15 +4510,15 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
4510
4510
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
4511
4511
  category: "unexpected";
4512
4512
  };
4513
- gapId: string;
4514
- severity: "warning" | "info" | "critical";
4515
- summary: string;
4516
4513
  resolution: {
4517
4514
  kind: "unresolved";
4518
4515
  } | {
4519
4516
  kind: "resolves";
4520
4517
  resolvesGapId: string;
4521
4518
  };
4519
+ gapId: string;
4520
+ severity: "warning" | "info" | "critical";
4521
+ summary: string;
4522
4522
  evidenceRefs?: ({
4523
4523
  kind: "event";
4524
4524
  eventId: string;
@@ -4853,8 +4853,8 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
4853
4853
  kind: "advance_recorded";
4854
4854
  sessionId: string;
4855
4855
  data: {
4856
- attemptId: string;
4857
4856
  intent: "ack_pending";
4857
+ attemptId: string;
4858
4858
  outcome: {
4859
4859
  kind: "blocked";
4860
4860
  blockers: {
@@ -5022,15 +5022,15 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
5022
5022
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
5023
5023
  category: "unexpected";
5024
5024
  };
5025
- gapId: string;
5026
- severity: "warning" | "info" | "critical";
5027
- summary: string;
5028
5025
  resolution: {
5029
5026
  kind: "unresolved";
5030
5027
  } | {
5031
5028
  kind: "resolves";
5032
5029
  resolvesGapId: string;
5033
5030
  };
5031
+ gapId: string;
5032
+ severity: "warning" | "info" | "critical";
5033
+ summary: string;
5034
5034
  evidenceRefs?: ({
5035
5035
  kind: "event";
5036
5036
  eventId: string;
@@ -5818,8 +5818,8 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
5818
5818
  toNodeId: string;
5819
5819
  }>]>;
5820
5820
  }, "strip", z.ZodTypeAny, {
5821
- attemptId: string;
5822
5821
  intent: "ack_pending";
5822
+ attemptId: string;
5823
5823
  outcome: {
5824
5824
  kind: "blocked";
5825
5825
  blockers: {
@@ -5849,8 +5849,8 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
5849
5849
  toNodeId: string;
5850
5850
  };
5851
5851
  }, {
5852
- attemptId: string;
5853
5852
  intent: "ack_pending";
5853
+ attemptId: string;
5854
5854
  outcome: {
5855
5855
  kind: "blocked";
5856
5856
  blockers: {
@@ -5884,8 +5884,8 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
5884
5884
  kind: "advance_recorded";
5885
5885
  sessionId: string;
5886
5886
  data: {
5887
- attemptId: string;
5888
5887
  intent: "ack_pending";
5888
+ attemptId: string;
5889
5889
  outcome: {
5890
5890
  kind: "blocked";
5891
5891
  blockers: {
@@ -5927,8 +5927,8 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
5927
5927
  kind: "advance_recorded";
5928
5928
  sessionId: string;
5929
5929
  data: {
5930
- attemptId: string;
5931
5930
  intent: "ack_pending";
5931
+ attemptId: string;
5932
5932
  outcome: {
5933
5933
  kind: "blocked";
5934
5934
  blockers: {
@@ -6803,15 +6803,15 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
6803
6803
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
6804
6804
  category: "unexpected";
6805
6805
  };
6806
- gapId: string;
6807
- severity: "warning" | "info" | "critical";
6808
- summary: string;
6809
6806
  resolution: {
6810
6807
  kind: "unresolved";
6811
6808
  } | {
6812
6809
  kind: "resolves";
6813
6810
  resolvesGapId: string;
6814
6811
  };
6812
+ gapId: string;
6813
+ severity: "warning" | "info" | "critical";
6814
+ summary: string;
6815
6815
  evidenceRefs?: ({
6816
6816
  kind: "event";
6817
6817
  eventId: string;
@@ -6833,15 +6833,15 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
6833
6833
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
6834
6834
  category: "unexpected";
6835
6835
  };
6836
- gapId: string;
6837
- severity: "warning" | "info" | "critical";
6838
- summary: string;
6839
6836
  resolution: {
6840
6837
  kind: "unresolved";
6841
6838
  } | {
6842
6839
  kind: "resolves";
6843
6840
  resolvesGapId: string;
6844
6841
  };
6842
+ gapId: string;
6843
+ severity: "warning" | "info" | "critical";
6844
+ summary: string;
6845
6845
  evidenceRefs?: ({
6846
6846
  kind: "event";
6847
6847
  eventId: string;
@@ -6867,15 +6867,15 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
6867
6867
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
6868
6868
  category: "unexpected";
6869
6869
  };
6870
- gapId: string;
6871
- severity: "warning" | "info" | "critical";
6872
- summary: string;
6873
6870
  resolution: {
6874
6871
  kind: "unresolved";
6875
6872
  } | {
6876
6873
  kind: "resolves";
6877
6874
  resolvesGapId: string;
6878
6875
  };
6876
+ gapId: string;
6877
+ severity: "warning" | "info" | "critical";
6878
+ summary: string;
6879
6879
  evidenceRefs?: ({
6880
6880
  kind: "event";
6881
6881
  eventId: string;
@@ -6909,15 +6909,15 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
6909
6909
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
6910
6910
  category: "unexpected";
6911
6911
  };
6912
- gapId: string;
6913
- severity: "warning" | "info" | "critical";
6914
- summary: string;
6915
6912
  resolution: {
6916
6913
  kind: "unresolved";
6917
6914
  } | {
6918
6915
  kind: "resolves";
6919
6916
  resolvesGapId: string;
6920
6917
  };
6918
+ gapId: string;
6919
+ severity: "warning" | "info" | "critical";
6920
+ summary: string;
6921
6921
  evidenceRefs?: ({
6922
6922
  kind: "event";
6923
6923
  eventId: string;
@@ -9463,8 +9463,8 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
9463
9463
  kind: "advance_recorded";
9464
9464
  sessionId: string;
9465
9465
  data: {
9466
- attemptId: string;
9467
9466
  intent: "ack_pending";
9467
+ attemptId: string;
9468
9468
  outcome: {
9469
9469
  kind: "blocked";
9470
9470
  blockers: {
@@ -9632,15 +9632,15 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
9632
9632
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
9633
9633
  category: "unexpected";
9634
9634
  };
9635
- gapId: string;
9636
- severity: "warning" | "info" | "critical";
9637
- summary: string;
9638
9635
  resolution: {
9639
9636
  kind: "unresolved";
9640
9637
  } | {
9641
9638
  kind: "resolves";
9642
9639
  resolvesGapId: string;
9643
9640
  };
9641
+ gapId: string;
9642
+ severity: "warning" | "info" | "critical";
9643
+ summary: string;
9644
9644
  evidenceRefs?: ({
9645
9645
  kind: "event";
9646
9646
  eventId: string;
@@ -9975,8 +9975,8 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
9975
9975
  kind: "advance_recorded";
9976
9976
  sessionId: string;
9977
9977
  data: {
9978
- attemptId: string;
9979
9978
  intent: "ack_pending";
9979
+ attemptId: string;
9980
9980
  outcome: {
9981
9981
  kind: "blocked";
9982
9982
  blockers: {
@@ -10144,15 +10144,15 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
10144
10144
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
10145
10145
  category: "unexpected";
10146
10146
  };
10147
- gapId: string;
10148
- severity: "warning" | "info" | "critical";
10149
- summary: string;
10150
10147
  resolution: {
10151
10148
  kind: "unresolved";
10152
10149
  } | {
10153
10150
  kind: "resolves";
10154
10151
  resolvesGapId: string;
10155
10152
  };
10153
+ gapId: string;
10154
+ severity: "warning" | "info" | "critical";
10155
+ summary: string;
10156
10156
  evidenceRefs?: ({
10157
10157
  kind: "event";
10158
10158
  eventId: string;
@@ -10516,8 +10516,8 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
10516
10516
  kind: "advance_recorded";
10517
10517
  sessionId: string;
10518
10518
  data: {
10519
- attemptId: string;
10520
10519
  intent: "ack_pending";
10520
+ attemptId: string;
10521
10521
  outcome: {
10522
10522
  kind: "blocked";
10523
10523
  blockers: {
@@ -10685,15 +10685,15 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
10685
10685
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
10686
10686
  category: "unexpected";
10687
10687
  };
10688
- gapId: string;
10689
- severity: "warning" | "info" | "critical";
10690
- summary: string;
10691
10688
  resolution: {
10692
10689
  kind: "unresolved";
10693
10690
  } | {
10694
10691
  kind: "resolves";
10695
10692
  resolvesGapId: string;
10696
10693
  };
10694
+ gapId: string;
10695
+ severity: "warning" | "info" | "critical";
10696
+ summary: string;
10697
10697
  evidenceRefs?: ({
10698
10698
  kind: "event";
10699
10699
  eventId: string;
@@ -11045,8 +11045,8 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
11045
11045
  kind: "advance_recorded";
11046
11046
  sessionId: string;
11047
11047
  data: {
11048
- attemptId: string;
11049
11048
  intent: "ack_pending";
11049
+ attemptId: string;
11050
11050
  outcome: {
11051
11051
  kind: "blocked";
11052
11052
  blockers: {
@@ -11214,15 +11214,15 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
11214
11214
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
11215
11215
  category: "unexpected";
11216
11216
  };
11217
- gapId: string;
11218
- severity: "warning" | "info" | "critical";
11219
- summary: string;
11220
11217
  resolution: {
11221
11218
  kind: "unresolved";
11222
11219
  } | {
11223
11220
  kind: "resolves";
11224
11221
  resolvesGapId: string;
11225
11222
  };
11223
+ gapId: string;
11224
+ severity: "warning" | "info" | "critical";
11225
+ summary: string;
11226
11226
  evidenceRefs?: ({
11227
11227
  kind: "event";
11228
11228
  eventId: string;
@@ -681,8 +681,8 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
681
681
  toNodeId: string;
682
682
  }>]>;
683
683
  }, "strip", z.ZodTypeAny, {
684
- attemptId: string;
685
684
  intent: "ack_pending";
685
+ attemptId: string;
686
686
  outcome: {
687
687
  kind: "blocked";
688
688
  blockers: {
@@ -712,8 +712,8 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
712
712
  toNodeId: string;
713
713
  };
714
714
  }, {
715
- attemptId: string;
716
715
  intent: "ack_pending";
716
+ attemptId: string;
717
717
  outcome: {
718
718
  kind: "blocked";
719
719
  blockers: {
@@ -747,8 +747,8 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
747
747
  kind: "advance_recorded";
748
748
  sessionId: string;
749
749
  data: {
750
- attemptId: string;
751
750
  intent: "ack_pending";
751
+ attemptId: string;
752
752
  outcome: {
753
753
  kind: "blocked";
754
754
  blockers: {
@@ -790,8 +790,8 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
790
790
  kind: "advance_recorded";
791
791
  sessionId: string;
792
792
  data: {
793
- attemptId: string;
794
793
  intent: "ack_pending";
794
+ attemptId: string;
795
795
  outcome: {
796
796
  kind: "blocked";
797
797
  blockers: {
@@ -1666,15 +1666,15 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
1666
1666
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
1667
1667
  category: "unexpected";
1668
1668
  };
1669
- gapId: string;
1670
- severity: "warning" | "info" | "critical";
1671
- summary: string;
1672
1669
  resolution: {
1673
1670
  kind: "unresolved";
1674
1671
  } | {
1675
1672
  kind: "resolves";
1676
1673
  resolvesGapId: string;
1677
1674
  };
1675
+ gapId: string;
1676
+ severity: "warning" | "info" | "critical";
1677
+ summary: string;
1678
1678
  evidenceRefs?: ({
1679
1679
  kind: "event";
1680
1680
  eventId: string;
@@ -1696,15 +1696,15 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
1696
1696
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
1697
1697
  category: "unexpected";
1698
1698
  };
1699
- gapId: string;
1700
- severity: "warning" | "info" | "critical";
1701
- summary: string;
1702
1699
  resolution: {
1703
1700
  kind: "unresolved";
1704
1701
  } | {
1705
1702
  kind: "resolves";
1706
1703
  resolvesGapId: string;
1707
1704
  };
1705
+ gapId: string;
1706
+ severity: "warning" | "info" | "critical";
1707
+ summary: string;
1708
1708
  evidenceRefs?: ({
1709
1709
  kind: "event";
1710
1710
  eventId: string;
@@ -1730,15 +1730,15 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
1730
1730
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
1731
1731
  category: "unexpected";
1732
1732
  };
1733
- gapId: string;
1734
- severity: "warning" | "info" | "critical";
1735
- summary: string;
1736
1733
  resolution: {
1737
1734
  kind: "unresolved";
1738
1735
  } | {
1739
1736
  kind: "resolves";
1740
1737
  resolvesGapId: string;
1741
1738
  };
1739
+ gapId: string;
1740
+ severity: "warning" | "info" | "critical";
1741
+ summary: string;
1742
1742
  evidenceRefs?: ({
1743
1743
  kind: "event";
1744
1744
  eventId: string;
@@ -1772,15 +1772,15 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
1772
1772
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
1773
1773
  category: "unexpected";
1774
1774
  };
1775
- gapId: string;
1776
- severity: "warning" | "info" | "critical";
1777
- summary: string;
1778
1775
  resolution: {
1779
1776
  kind: "unresolved";
1780
1777
  } | {
1781
1778
  kind: "resolves";
1782
1779
  resolvesGapId: string;
1783
1780
  };
1781
+ gapId: string;
1782
+ severity: "warning" | "info" | "critical";
1783
+ summary: string;
1784
1784
  evidenceRefs?: ({
1785
1785
  kind: "event";
1786
1786
  eventId: string;
@@ -162,15 +162,15 @@ export declare const GapRecordedDataV1Schema: z.ZodObject<{
162
162
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
163
163
  category: "unexpected";
164
164
  };
165
- gapId: string;
166
- severity: "warning" | "info" | "critical";
167
- summary: string;
168
165
  resolution: {
169
166
  kind: "unresolved";
170
167
  } | {
171
168
  kind: "resolves";
172
169
  resolvesGapId: string;
173
170
  };
171
+ gapId: string;
172
+ severity: "warning" | "info" | "critical";
173
+ summary: string;
174
174
  evidenceRefs?: ({
175
175
  kind: "event";
176
176
  eventId: string;
@@ -192,15 +192,15 @@ export declare const GapRecordedDataV1Schema: z.ZodObject<{
192
192
  detail: "invariant_violation" | "storage_corruption_detected" | "evaluation_error";
193
193
  category: "unexpected";
194
194
  };
195
- gapId: string;
196
- severity: "warning" | "info" | "critical";
197
- summary: string;
198
195
  resolution: {
199
196
  kind: "unresolved";
200
197
  } | {
201
198
  kind: "resolves";
202
199
  resolvesGapId: string;
203
200
  };
201
+ gapId: string;
202
+ severity: "warning" | "info" | "critical";
203
+ summary: string;
204
204
  evidenceRefs?: ({
205
205
  kind: "event";
206
206
  eventId: string;
@@ -64,6 +64,7 @@ export interface RankedResumeCandidate {
64
64
  readonly tierAssignment: TierAssignment;
65
65
  readonly lastActivityEventIndex: number;
66
66
  readonly workflowHash: WorkflowHash;
67
+ readonly workflowId: WorkflowId;
67
68
  }
68
69
  export declare const MAX_RESUME_CANDIDATES = 5;
69
70
  export declare function rankResumeCandidates(summaries: readonly HealthySessionSummary[], query: ResumeQuery): readonly RankedResumeCandidate[];
@@ -98,5 +98,6 @@ function rankResumeCandidates(summaries, query) {
98
98
  tierAssignment: tier,
99
99
  lastActivityEventIndex: summary.preferredTip.lastActivityEventIndex,
100
100
  workflowHash: summary.workflow.workflowHash,
101
+ workflowId: summary.workflow.workflowId,
101
102
  }));
102
103
  }
@@ -4,6 +4,7 @@ exports.compileV1WorkflowToV2PreviewSnapshot = compileV1WorkflowToV2PreviewSnaps
4
4
  exports.compileV1WorkflowToPinnedSnapshot = compileV1WorkflowToPinnedSnapshot;
5
5
  exports.normalizeV1WorkflowToPinnedSnapshot = normalizeV1WorkflowToPinnedSnapshot;
6
6
  const workflow_compiler_js_1 = require("../../application/services/workflow-compiler.js");
7
+ const workflow_definition_js_1 = require("../../types/workflow-definition.js");
7
8
  const neverthrow_1 = require("neverthrow");
8
9
  function compileV1WorkflowToV2PreviewSnapshot(workflow) {
9
10
  const firstStep = workflow.definition.steps[0];
@@ -22,18 +23,18 @@ function compileV1WorkflowToV2PreviewSnapshot(workflow) {
22
23
  },
23
24
  };
24
25
  }
25
- const isLoop = firstStep.type === 'loop';
26
26
  let prompt;
27
- if (isLoop) {
27
+ if ((0, workflow_definition_js_1.isLoopStepDefinition)(firstStep)) {
28
28
  prompt = `Loop step '${firstStep.id}' cannot be previewed in v2 Slice 1 (loop execution/compilation not implemented yet).`;
29
29
  }
30
30
  else if (typeof firstStep.prompt === 'string') {
31
31
  prompt = firstStep.prompt;
32
32
  }
33
33
  else {
34
- const resolved = (0, workflow_compiler_js_1.resolveDefinitionSteps)([firstStep], workflow.definition.features ?? []);
35
- prompt = resolved.isOk() && resolved.value[0]?.prompt
36
- ? resolved.value[0].prompt
34
+ const resolved = (0, workflow_compiler_js_1.resolveDefinitionSteps)([firstStep], workflow.definition.features ?? [], workflow.definition.extensionPoints ?? [], workflow.definition.id);
35
+ const resolvedPrompt = resolved.isOk() ? resolved.value.steps[0]?.prompt : undefined;
36
+ prompt = typeof resolvedPrompt === 'string'
37
+ ? resolvedPrompt
37
38
  : `Step '${firstStep.id}' has no prompt (promptBlocks resolution failed).`;
38
39
  }
39
40
  return {
@@ -45,16 +46,22 @@ function compileV1WorkflowToV2PreviewSnapshot(workflow) {
45
46
  version: workflow.definition.version,
46
47
  preview: {
47
48
  stepId: firstStep.id,
48
- title: firstStep.title ?? firstStep.id,
49
+ title: firstStep.title,
49
50
  prompt,
50
51
  },
51
52
  };
52
53
  }
53
54
  function compileV1WorkflowToPinnedSnapshot(workflow) {
54
- const resolved = (0, workflow_compiler_js_1.resolveDefinitionSteps)(workflow.definition.steps, workflow.definition.features ?? []);
55
+ const resolved = (0, workflow_compiler_js_1.resolveDefinitionSteps)(workflow.definition.steps, workflow.definition.features ?? [], workflow.definition.extensionPoints ?? [], workflow.definition.id);
55
56
  const resolvedDefinition = resolved.isOk()
56
- ? { ...workflow.definition, steps: resolved.value }
57
+ ? { ...workflow.definition, steps: resolved.value.steps }
57
58
  : workflow.definition;
59
+ const resolvedBindings = resolved.isOk() && resolved.value.resolvedBindings.size > 0
60
+ ? Object.fromEntries(resolved.value.resolvedBindings)
61
+ : undefined;
62
+ const pinnedOverrides = resolved.isOk() && resolved.value.resolvedOverrides.size > 0
63
+ ? Object.fromEntries(resolved.value.resolvedOverrides)
64
+ : undefined;
58
65
  return {
59
66
  schemaVersion: 1,
60
67
  sourceKind: 'v1_pinned',
@@ -63,14 +70,22 @@ function compileV1WorkflowToPinnedSnapshot(workflow) {
63
70
  description: workflow.definition.description,
64
71
  version: workflow.definition.version,
65
72
  definition: resolvedDefinition,
73
+ ...(resolvedBindings !== undefined ? { resolvedBindings } : {}),
74
+ ...(pinnedOverrides !== undefined ? { pinnedOverrides } : {}),
66
75
  };
67
76
  }
68
77
  function normalizeV1WorkflowToPinnedSnapshot(workflow) {
69
- const resolved = (0, workflow_compiler_js_1.resolveDefinitionSteps)(workflow.definition.steps, workflow.definition.features ?? []);
78
+ const resolved = (0, workflow_compiler_js_1.resolveDefinitionSteps)(workflow.definition.steps, workflow.definition.features ?? [], workflow.definition.extensionPoints ?? [], workflow.definition.id);
70
79
  if (resolved.isErr()) {
71
80
  return (0, neverthrow_1.err)(resolved.error);
72
81
  }
73
- const resolvedDefinition = { ...workflow.definition, steps: resolved.value };
82
+ const resolvedDefinition = { ...workflow.definition, steps: resolved.value.steps };
83
+ const resolvedBindings = resolved.value.resolvedBindings.size > 0
84
+ ? Object.fromEntries(resolved.value.resolvedBindings)
85
+ : undefined;
86
+ const pinnedOverrides = resolved.value.resolvedOverrides.size > 0
87
+ ? Object.fromEntries(resolved.value.resolvedOverrides)
88
+ : undefined;
74
89
  return (0, neverthrow_1.ok)({
75
90
  schemaVersion: 1,
76
91
  sourceKind: 'v1_pinned',
@@ -79,5 +94,7 @@ function normalizeV1WorkflowToPinnedSnapshot(workflow) {
79
94
  description: workflow.definition.description,
80
95
  version: workflow.definition.version,
81
96
  definition: resolvedDefinition,
97
+ ...(resolvedBindings !== undefined ? { resolvedBindings } : {}),
98
+ ...(pinnedOverrides !== undefined ? { pinnedOverrides } : {}),
82
99
  });
83
100
  }
@@ -1,4 +1,8 @@
1
1
  import type { ResultAsync } from 'neverthrow';
2
2
  import type { SessionSummaryProviderPortV2, SessionSummaryError } from '../ports/session-summary-provider.port.js';
3
3
  import { type ResumeQuery, type RankedResumeCandidate } from '../projections/resume-ranking.js';
4
- export declare function resumeSession(query: ResumeQuery, summaryProvider: SessionSummaryProviderPortV2): ResultAsync<readonly RankedResumeCandidate[], SessionSummaryError>;
4
+ export interface ResumeSessionResult {
5
+ readonly candidates: readonly RankedResumeCandidate[];
6
+ readonly totalFound: number;
7
+ }
8
+ export declare function resumeSession(query: ResumeQuery, summaryProvider: SessionSummaryProviderPortV2): ResultAsync<ResumeSessionResult, SessionSummaryError>;
@@ -5,5 +5,8 @@ const resume_ranking_js_1 = require("../projections/resume-ranking.js");
5
5
  function resumeSession(query, summaryProvider) {
6
6
  return summaryProvider
7
7
  .loadHealthySummaries()
8
- .map((summaries) => (0, resume_ranking_js_1.rankResumeCandidates)(summaries, query));
8
+ .map((summaries) => ({
9
+ candidates: (0, resume_ranking_js_1.rankResumeCandidates)(summaries, query),
10
+ totalFound: summaries.length,
11
+ }));
9
12
  }