@auto-engineer/pipeline 1.68.0 → 1.69.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 (70) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +6 -6
  3. package/.turbo/turbo-type-check.log +1 -1
  4. package/CHANGELOG.md +29 -0
  5. package/dist/src/engine/workflow-processor.d.ts +3 -0
  6. package/dist/src/engine/workflow-processor.d.ts.map +1 -1
  7. package/dist/src/engine/workflow-processor.js +50 -7
  8. package/dist/src/engine/workflow-processor.js.map +1 -1
  9. package/dist/src/index.d.ts +0 -2
  10. package/dist/src/index.d.ts.map +1 -1
  11. package/dist/src/index.js +0 -2
  12. package/dist/src/index.js.map +1 -1
  13. package/dist/src/server/phased-bridge.d.ts +13 -0
  14. package/dist/src/server/phased-bridge.d.ts.map +1 -0
  15. package/dist/src/server/phased-bridge.js +103 -0
  16. package/dist/src/server/phased-bridge.js.map +1 -0
  17. package/dist/src/server/pipeline-server.d.ts +2 -2
  18. package/dist/src/server/pipeline-server.d.ts.map +1 -1
  19. package/dist/src/server/pipeline-server.js +18 -38
  20. package/dist/src/server/pipeline-server.js.map +1 -1
  21. package/dist/src/server/v2-runtime-bridge.d.ts +21 -0
  22. package/dist/src/server/v2-runtime-bridge.d.ts.map +1 -0
  23. package/dist/src/server/v2-runtime-bridge.js +182 -0
  24. package/dist/src/server/v2-runtime-bridge.js.map +1 -0
  25. package/dist/src/store/pipeline-event-store.d.ts.map +1 -1
  26. package/dist/src/store/pipeline-event-store.js +0 -30
  27. package/dist/src/store/pipeline-event-store.js.map +1 -1
  28. package/dist/src/store/pipeline-read-model.d.ts +0 -15
  29. package/dist/src/store/pipeline-read-model.d.ts.map +1 -1
  30. package/dist/src/store/pipeline-read-model.js +0 -49
  31. package/dist/src/store/pipeline-read-model.js.map +1 -1
  32. package/dist/tsconfig.tsbuildinfo +1 -1
  33. package/ketchup-plan.md +10 -12
  34. package/package.json +3 -3
  35. package/src/engine/workflow-processor.specs.ts +101 -0
  36. package/src/engine/workflow-processor.ts +54 -8
  37. package/src/index.ts +0 -2
  38. package/src/server/phased-bridge.specs.ts +272 -0
  39. package/src/server/phased-bridge.ts +130 -0
  40. package/src/server/pipeline-server.ts +20 -41
  41. package/src/server/v2-runtime-bridge.specs.ts +347 -0
  42. package/src/server/v2-runtime-bridge.ts +246 -0
  43. package/src/store/pipeline-event-store.specs.ts +0 -137
  44. package/src/store/pipeline-event-store.ts +0 -35
  45. package/src/store/pipeline-read-model.specs.ts +0 -567
  46. package/src/store/pipeline-read-model.ts +0 -71
  47. package/dist/src/projections/phased-execution-projection.d.ts +0 -77
  48. package/dist/src/projections/phased-execution-projection.d.ts.map +0 -1
  49. package/dist/src/projections/phased-execution-projection.js +0 -54
  50. package/dist/src/projections/phased-execution-projection.js.map +0 -1
  51. package/dist/src/projections/settled-instance-projection.d.ts +0 -67
  52. package/dist/src/projections/settled-instance-projection.d.ts.map +0 -1
  53. package/dist/src/projections/settled-instance-projection.js +0 -66
  54. package/dist/src/projections/settled-instance-projection.js.map +0 -1
  55. package/dist/src/runtime/phased-executor.d.ts +0 -34
  56. package/dist/src/runtime/phased-executor.d.ts.map +0 -1
  57. package/dist/src/runtime/phased-executor.js +0 -172
  58. package/dist/src/runtime/phased-executor.js.map +0 -1
  59. package/dist/src/runtime/settled-tracker.d.ts +0 -44
  60. package/dist/src/runtime/settled-tracker.d.ts.map +0 -1
  61. package/dist/src/runtime/settled-tracker.js +0 -170
  62. package/dist/src/runtime/settled-tracker.js.map +0 -1
  63. package/src/projections/phased-execution-projection.specs.ts +0 -202
  64. package/src/projections/phased-execution-projection.ts +0 -146
  65. package/src/projections/settled-instance-projection.specs.ts +0 -296
  66. package/src/projections/settled-instance-projection.ts +0 -160
  67. package/src/runtime/phased-executor.specs.ts +0 -680
  68. package/src/runtime/phased-executor.ts +0 -230
  69. package/src/runtime/settled-tracker.specs.ts +0 -1044
  70. package/src/runtime/settled-tracker.ts +0 -235
@@ -1,5 +1,5 @@
1
1
 
2
- > @auto-engineer/pipeline@1.68.0 build /home/runner/work/auto-engineer/auto-engineer/packages/pipeline
2
+ > @auto-engineer/pipeline@1.69.0 build /home/runner/work/auto-engineer/auto-engineer/packages/pipeline
3
3
  > tsc && tsx ../../scripts/fix-esm-imports.ts
4
4
 
5
5
  Fixed ESM imports in dist/
@@ -1,14 +1,14 @@
1
1
 
2
- > @auto-engineer/pipeline@1.67.0 test /home/runner/work/auto-engineer/auto-engineer/packages/pipeline
2
+ > @auto-engineer/pipeline@1.68.0 test /home/runner/work/auto-engineer/auto-engineer/packages/pipeline
3
3
  > vitest run --reporter=dot
4
4
 
5
5
 
6
6
   RUN  v3.2.4 /home/runner/work/auto-engineer/auto-engineer/packages/pipeline
7
7
 
8
- ·················································································································································································································································································································································································································································································································································································································
8
+ ·······························································································································································································································································································································································································································································································································
9
9
 
10
-  Test Files  41 passed (41)
11
-  Tests  593 passed (593)
12
-  Start at  14:55:10
13
-  Duration  31.58s (transform 7.09s, setup 0ms, collect 15.35s, tests 25.36s, environment 24ms, prepare 21.71s)
10
+  Test Files  39 passed (39)
11
+  Tests  511 passed (511)
12
+  Start at  16:17:15
13
+  Duration  32.48s (transform 6.42s, setup 0ms, collect 13.33s, tests 25.54s, environment 20ms, prepare 22.95s)
14
14
 
@@ -1,4 +1,4 @@
1
1
 
2
- > @auto-engineer/pipeline@1.67.0 type-check /home/runner/work/auto-engineer/auto-engineer/packages/pipeline
2
+ > @auto-engineer/pipeline@1.68.0 type-check /home/runner/work/auto-engineer/auto-engineer/packages/pipeline
3
3
  > tsc --noEmit
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @auto-engineer/pipeline
2
2
 
3
+ ## 1.69.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`1a2b945`](https://github.com/BeOnAuto/auto-engineer/commit/1a2b9450b359c83e5b2db1ec388eedb5d7186937) Thanks [@SamHatoum](https://github.com/SamHatoum)! - - **pipeline**: remove v1 SettledTracker, PhasedExecutor, and related projections
8
+
9
+ - [`ff965bb`](https://github.com/BeOnAuto/auto-engineer/commit/ff965bb66fe354a71646ae5cf1117ce6ec028e59) Thanks [@SamHatoum](https://github.com/SamHatoum)! - - **pipeline**: wire V2 bridges into PipelineServer
10
+
11
+ - [`44884eb`](https://github.com/BeOnAuto/auto-engineer/commit/44884ebb193c4a67ef2ee3e4db277cf59321f82a) Thanks [@SamHatoum](https://github.com/SamHatoum)! - - **pipeline**: add V2RuntimeBridge for settled descriptor path
12
+
13
+ - [`89a89bb`](https://github.com/BeOnAuto/auto-engineer/commit/89a89bbce79c56dca51558bb53a2fdf6f2449906) Thanks [@SamHatoum](https://github.com/SamHatoum)! - - **pipeline**: add processKeyed/getState/resetInstance to WorkflowProcessor
14
+
15
+ - [`e85c168`](https://github.com/BeOnAuto/auto-engineer/commit/e85c168b05612c4b2b14b4d2b014832e375ce28d) Thanks [@SamHatoum](https://github.com/SamHatoum)! - - **pipeline**: add phased bridge with V2 workflow processor integration
16
+
17
+ - [`6c6d235`](https://github.com/BeOnAuto/auto-engineer/commit/6c6d235b7f30edbf92bbd52a0a843b7f21d041a0) Thanks [@SamHatoum](https://github.com/SamHatoum)! - - Updated landing page header styling with new text color and height
18
+
19
+ ### Patch Changes
20
+
21
+ - [`b1ef570`](https://github.com/BeOnAuto/auto-engineer/commit/b1ef57088eab79473b2527bc574e4c35c7d2630b) Thanks [@github-actions[bot]](https://github.com/github-actions%5Bbot%5D)! - - **global**: version packages
22
+ - **global**: bumps turbo
23
+
24
+ - [`1712efa`](https://github.com/BeOnAuto/auto-engineer/commit/1712efa6ad43c17755aa2cb22256c7fb420e9451) Thanks [@SamHatoum](https://github.com/SamHatoum)! - - **pipeline**: move V2 engine swap to DONE in ketchup plan
25
+
26
+ - [`6004cde`](https://github.com/BeOnAuto/auto-engineer/commit/6004cdec16f7fbaa1ef92bb7effe0e626c7b288c) Thanks [@SamHatoum](https://github.com/SamHatoum)! - - **pipeline**: update ketchup plan with V2 engine swap bursts
27
+
28
+ - Updated dependencies [[`b1ef570`](https://github.com/BeOnAuto/auto-engineer/commit/b1ef57088eab79473b2527bc574e4c35c7d2630b), [`1a2b945`](https://github.com/BeOnAuto/auto-engineer/commit/1a2b9450b359c83e5b2db1ec388eedb5d7186937), [`ff965bb`](https://github.com/BeOnAuto/auto-engineer/commit/ff965bb66fe354a71646ae5cf1117ce6ec028e59), [`44884eb`](https://github.com/BeOnAuto/auto-engineer/commit/44884ebb193c4a67ef2ee3e4db277cf59321f82a), [`89a89bb`](https://github.com/BeOnAuto/auto-engineer/commit/89a89bbce79c56dca51558bb53a2fdf6f2449906), [`e85c168`](https://github.com/BeOnAuto/auto-engineer/commit/e85c168b05612c4b2b14b4d2b014832e375ce28d), [`1712efa`](https://github.com/BeOnAuto/auto-engineer/commit/1712efa6ad43c17755aa2cb22256c7fb420e9451), [`6004cde`](https://github.com/BeOnAuto/auto-engineer/commit/6004cdec16f7fbaa1ef92bb7effe0e626c7b288c), [`6c6d235`](https://github.com/BeOnAuto/auto-engineer/commit/6c6d235b7f30edbf92bbd52a0a843b7f21d041a0)]:
29
+ - @auto-engineer/file-store@1.69.0
30
+ - @auto-engineer/message-bus@1.69.0
31
+
3
32
  ## 1.68.0
4
33
 
5
34
  ### Minor Changes
@@ -15,6 +15,9 @@ export type WorkflowRegistration = {
15
15
  export declare function createWorkflowProcessor(): {
16
16
  register(registration: WorkflowRegistration): void;
17
17
  process(event: Event): Event[];
18
+ processKeyed(event: Event, instanceKey: string): Event[];
19
+ getState(workflowId: string, instanceKey: string): unknown;
20
+ resetInstance(workflowId: string, instanceKey: string): void;
18
21
  };
19
22
  export {};
20
23
  //# sourceMappingURL=workflow-processor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-processor.d.ts","sourceRoot":"","sources":["../../../src/engine/workflow-processor.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,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oB,GAAG,IAAI;mBAKnC,KAAK,GAAG,KAAK,EAAE;wBAcV,KAAK,eAAe,MAAM,GAAG,KAAK,EAAE;yBAcnC,MAAM,eAAe,MAAM,GAAG,OAAO;8BAOhC,MAAM,eAAe,MAAM,GAAG,IAAI;EAO/D"}
@@ -1,6 +1,7 @@
1
1
  export function createWorkflowProcessor() {
2
2
  const registrations = new Map();
3
3
  const eventsByWorkflow = new Map();
4
+ const keyedEvents = new Map();
4
5
  function rebuildState(reg, events) {
5
6
  let state = reg.workflow.initialState();
6
7
  for (const event of events) {
@@ -8,6 +9,31 @@ export function createWorkflowProcessor() {
8
9
  }
9
10
  return state;
10
11
  }
12
+ function getKeyedHistory(workflowId, instanceKey) {
13
+ let instances = keyedEvents.get(workflowId);
14
+ if (!instances) {
15
+ instances = new Map();
16
+ keyedEvents.set(workflowId, instances);
17
+ }
18
+ let history = instances.get(instanceKey);
19
+ if (!history) {
20
+ history = [];
21
+ instances.set(instanceKey, history);
22
+ }
23
+ return history;
24
+ }
25
+ function processWithHistory(reg, event, history) {
26
+ const outputs = [];
27
+ history.push(event);
28
+ const state = rebuildState(reg, history);
29
+ const result = reg.workflow.decide(event, state);
30
+ const resultEvents = Array.isArray(result) ? result : [result];
31
+ for (const outputEvent of resultEvents) {
32
+ history.push(outputEvent);
33
+ outputs.push(outputEvent);
34
+ }
35
+ return outputs;
36
+ }
11
37
  return {
12
38
  register(registration) {
13
39
  registrations.set(registration.id, registration);
@@ -20,17 +46,34 @@ export function createWorkflowProcessor() {
20
46
  continue;
21
47
  }
22
48
  const history = eventsByWorkflow.get(id);
23
- history.push(event);
24
- const state = rebuildState(reg, history);
25
- const result = reg.workflow.decide(event, state);
26
- const resultEvents = Array.isArray(result) ? result : [result];
27
- for (const outputEvent of resultEvents) {
28
- history.push(outputEvent);
29
- outputs.push(outputEvent);
49
+ outputs.push(...processWithHistory(reg, event, history));
50
+ }
51
+ return outputs;
52
+ },
53
+ processKeyed(event, instanceKey) {
54
+ const outputs = [];
55
+ for (const [id, reg] of registrations) {
56
+ if (!reg.inputEvents.includes(event.type)) {
57
+ continue;
30
58
  }
59
+ const history = getKeyedHistory(id, instanceKey);
60
+ outputs.push(...processWithHistory(reg, event, history));
31
61
  }
32
62
  return outputs;
33
63
  },
64
+ getState(workflowId, instanceKey) {
65
+ const reg = registrations.get(workflowId);
66
+ if (!reg)
67
+ return undefined;
68
+ const history = getKeyedHistory(workflowId, instanceKey);
69
+ return rebuildState(reg, history);
70
+ },
71
+ resetInstance(workflowId, instanceKey) {
72
+ const instances = keyedEvents.get(workflowId);
73
+ if (instances) {
74
+ instances.delete(instanceKey);
75
+ }
76
+ },
34
77
  };
35
78
  }
36
79
  //# sourceMappingURL=workflow-processor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-processor.js","sourceRoot":"","sources":["../../../src/engine/workflow-processor.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,uBAAuB;IACrC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAgC,CAAC;IAC9D,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAmB,CAAC;IAEpD,SAAS,YAAY,CAAC,GAAyB,EAAE,MAAe;QAC9D,IAAI,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;QACxC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO;QACL,QAAQ,CAAC,YAAkC;YACzC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;YACjD,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,CAAC,KAAY;YAClB,MAAM,OAAO,GAAY,EAAE,CAAC;YAE5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AM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAC1C,IAAI,CAAC,GAAG;gBAAE,OAAO,SAAS,CAAC;YAC3B,MAAM,OAAO,GAAG,eAAe,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;YACzD,OAAO,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACpC,CAAC;QAED,aAAa,CAAC,UAAkB,EAAE,WAAmB;YACnD,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAC9C,IAAI,SAAS,EAAE,CAAC;gBACd,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -13,9 +13,7 @@ export type { AwaitEvent, AwaitTrackerDocument } from './projections/await-track
13
13
  export { AwaitTracker } from './runtime/await-tracker';
14
14
  export type { PipelineContext, RuntimeConfig } from './runtime/context';
15
15
  export { EventCommandMapper } from './runtime/event-command-map';
16
- export { PhasedExecutor } from './runtime/phased-executor';
17
16
  export { PipelineRuntime } from './runtime/pipeline-runtime';
18
- export { SettledTracker } from './runtime/settled-tracker';
19
17
  export type { CommandHandlerWithMetadata, PipelineServerConfig } from './server/pipeline-server';
20
18
  export { PipelineServer } from './server/pipeline-server';
21
19
  export { SSEManager } from './server/sse-manager';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC9F,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,cAAc,EACd,aAAa,EACb,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,cAAc,EACd,QAAQ,EACR,eAAe,EACf,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EA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W,EAAE,MAAM,wBAAwB,CAAC;AACrD,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,YAAY,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC"}
package/dist/src/index.js CHANGED
@@ -5,9 +5,7 @@ export * from './engine/index.js';
5
5
  export { EventLogger } from './logging/event-logger.js';
6
6
  export { AwaitTracker } from './runtime/await-tracker.js';
7
7
  export { EventCommandMapper } from './runtime/event-command-map.js';
8
- export { PhasedExecutor } from './runtime/phased-executor.js';
9
8
  export { PipelineRuntime } from './runtime/pipeline-runtime.js';
10
- export { SettledTracker } from './runtime/settled-tracker.js';
11
9
  export { PipelineServer } from './server/pipeline-server.js';
12
10
  export { SSEManager } from './server/sse-manager.js';
13
11
  export { compareEventSequence, containsSubsequence, findMissingEvents, findUnexpectedEvents, formatSnapshotDiff, } from './testing/snapshot-compare.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAA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;AAElD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Event } from '@auto-engineer/message-bus';
2
+ import type { ForEachPhasedDescriptor } from '../core/descriptors.js';
3
+ interface PhasedBridgeConfig {
4
+ onDispatch: (commandType: string, data: unknown, correlationId: string) => void;
5
+ onPhasedComplete: (event: Event, correlationId: string) => void;
6
+ }
7
+ export declare function createPhasedBridge(config: PhasedBridgeConfig): {
8
+ registerPhased(descriptor: ForEachPhasedDescriptor): void;
9
+ startPhased(handler: ForEachPhasedDescriptor, event: Event, correlationId: string): void;
10
+ onPhasedItemEvent(event: Event, itemKey: string): void;
11
+ };
12
+ export {};
13
+ //# sourceMappingURL=phased-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phased-bridge.d.ts","sourceRoot":"","sources":["../../../src/server/phased-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAKtE,UAAU,kBAAkB;IAC1B,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAChF,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;CACjE;AA4BD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB;+BAmC9B,uBAAuB,GAAG,IAAI;yBAKpC,uBAAuB,SAAS,KAAK,iBAAiB,MAAM,GAAG,IAAI;6BAmC/D,KAAK,WAAW,MAAM,GAAG,IAAI;EAiBzD"}
@@ -0,0 +1,103 @@
1
+ import { decide, evolve, initialState } from '../engine/workflows/phased-workflow.js';
2
+ function resolveData(dispatch, event) {
3
+ if (typeof dispatch.data === 'function') {
4
+ return dispatch.data(event);
5
+ }
6
+ return dispatch.data;
7
+ }
8
+ function processInput(execution, input) {
9
+ let state = evolve(execution.state, input);
10
+ const result = decide(input, state);
11
+ const outputs = Array.isArray(result) ? result : [result];
12
+ for (const output of outputs) {
13
+ state = evolve(state, output);
14
+ }
15
+ execution.state = state;
16
+ return outputs;
17
+ }
18
+ export function createPhasedBridge(config) {
19
+ const descriptors = new Map();
20
+ const executions = new Map();
21
+ const itemToExecution = new Map();
22
+ function handleOutputs(outputs, execution) {
23
+ for (const output of outputs) {
24
+ if (output.type === 'DispatchItem') {
25
+ const itemKey = output.data.itemKey;
26
+ const phase = output.data.phase;
27
+ const itemRecord = execution.items.find((i) => i.key === itemKey);
28
+ if (itemRecord) {
29
+ const command = execution.handler.emitFactory(itemRecord.original, phase, execution.triggerEvent);
30
+ const data = resolveData(command, execution.triggerEvent);
31
+ config.onDispatch(command.commandType, data, execution.correlationId);
32
+ }
33
+ }
34
+ else if (output.type === 'PhasedCompleted') {
35
+ const completionEvent = {
36
+ type: execution.handler.completion.successEvent.name,
37
+ correlationId: execution.correlationId,
38
+ data: { results: output.data.completedItems, itemCount: execution.items.length },
39
+ };
40
+ config.onPhasedComplete(completionEvent, execution.correlationId);
41
+ }
42
+ else if (output.type === 'PhasedFailed') {
43
+ const failureEvent = {
44
+ type: execution.handler.completion.failureEvent.name,
45
+ correlationId: execution.correlationId,
46
+ data: { failures: output.data.failedItems, completedItems: output.data.completedItems },
47
+ };
48
+ config.onPhasedComplete(failureEvent, execution.correlationId);
49
+ }
50
+ }
51
+ }
52
+ return {
53
+ registerPhased(descriptor) {
54
+ const handlerId = `phased-handler-${descriptor.eventType}`;
55
+ descriptors.set(handlerId, descriptor);
56
+ },
57
+ startPhased(handler, event, correlationId) {
58
+ const items = handler.itemsSelector(event);
59
+ const itemRecords = [];
60
+ for (const item of items) {
61
+ const data = Object(item);
62
+ const key = handler.completion.itemKey({ type: event.type, data });
63
+ const phase = handler.classifier(item);
64
+ itemRecords.push({ key, phase, original: item });
65
+ itemToExecution.set(key, correlationId + '|' + handler.eventType);
66
+ }
67
+ const execution = {
68
+ correlationId,
69
+ handler,
70
+ triggerEvent: event,
71
+ items: itemRecords,
72
+ state: initialState(),
73
+ };
74
+ executions.set(correlationId + '|' + handler.eventType, execution);
75
+ const startInput = {
76
+ type: 'StartPhased',
77
+ data: {
78
+ correlationId,
79
+ items: itemRecords.map((i) => ({ key: i.key, phase: i.phase })),
80
+ phases: [...handler.phases],
81
+ stopOnFailure: handler.stopOnFailure,
82
+ },
83
+ };
84
+ const outputs = processInput(execution, startInput);
85
+ handleOutputs(outputs, execution);
86
+ },
87
+ onPhasedItemEvent(event, itemKey) {
88
+ const executionKey = itemToExecution.get(itemKey);
89
+ if (!executionKey)
90
+ return;
91
+ const execution = executions.get(executionKey);
92
+ if (!execution)
93
+ return;
94
+ const isFailure = event.type === execution.handler.completion.failureEvent.name;
95
+ const input = isFailure
96
+ ? { type: 'ItemFailed', data: { itemKey, error: event.data } }
97
+ : { type: 'ItemCompleted', data: { itemKey, result: event.data } };
98
+ const outputs = processInput(execution, input);
99
+ handleOutputs(outputs, execution);
100
+ },
101
+ };
102
+ }
103
+ //# sourceMappingURL=phased-bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phased-bridge.js","sourceRoot":"","sources":["../../../src/server/phased-bridge.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAetF,SAAS,WAAW,CAAC,QAAyB,EAAE,KAAY;IAC1D,IAAI,OAAO,QAAQ,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACxC,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC;AAED,SAAS,YAAY,CAAC,SAA0B,EAAE,KAAkB;IACl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a;iBACrC;aACF,CAAC;YAEF,MAAM,OAAO,GAAG,YAAY,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YACpD,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACpC,CAAC;QAED,iBAAiB,CAAC,KAAY,EAAE,OAAe;YAC7C,MAAM,YAAY,GAAG,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAClD,IAAI,CAAC,YAAY;gBAAE,OAAO;YAE1B,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC/C,IAAI,CAAC,SAAS;gBAAE,OAAO;YAEvB,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC;YAEhF,MAAM,KAAK,GAAgB,SAAS;gBAClC,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE;gBAC9D,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;YAErE,MAAM,OAAO,GAAG,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YAC/C,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACpC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -27,9 +27,9 @@ export declare class PipelineServer {
27
27
  private readonly runtimes;
28
28
  private actualPort;
29
29
  private readonly requestedPort;
30
- private readonly settledTracker;
30
+ private readonly settledBridge;
31
31
  private readonly eventCommandMapper;
32
- private readonly phasedExecutor;
32
+ private readonly phasedBridge;
33
33
  private readonly sseManager;
34
34
  private readonly eventStoreContext;
35
35
  private readonly itemKeyExtractors;
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline-server.d.ts","sour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sBAAsB;IAe9B,OAAO,CAAC,kBAAkB;IAmB1B,OAAO,CAAC,mBAAmB;IAsB3B,OAAO,CAAC,2BAA2B;IAkCnC,OAAO,CAAC,aAAa;IAwBrB,OAAO,CAAC,2BAA2B;IA6BnC,OAAO,CAAC,qBAAqB;IAuB7B,OAAO,CAAC,sBAAsB;IA0B9B,OAAO,CAAC,sBAAsB;IAkB9B,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,gBAAgB;YAiCV,cAAc;IAgE5B,OAAO,CAAC,mBAAmB;YAUb,mBAAmB;YAanB,oBAAoB;YAWpB,qBAAqB;IAMnC,OAAO,CAAC,aAAa;IAkCrB,OAAO,CAAC,0BAA0B;IAWlC,OAAO,CAAC,gBAAgB;CA8CzB"}
@@ -7,11 +7,11 @@ import getPort from 'get-port';
7
7
  import { nanoid } from 'nanoid';
8
8
  import { filterGraph } from '../graph/filter-graph.js';
9
9
  import { EventCommandMapper } from '../runtime/event-command-map.js';
10
- import { PhasedExecutor } from '../runtime/phased-executor.js';
11
10
  import { PipelineRuntime } from '../runtime/pipeline-runtime.js';
12
- import { SettledTracker } from '../runtime/settled-tracker.js';
13
11
  import { createPipelineEventStore } from '../store/pipeline-event-store.js';
12
+ import { createPhasedBridge } from './phased-bridge.js';
14
13
  import { SSEManager } from './sse-manager.js';
14
+ import { createV2RuntimeBridge } from './v2-runtime-bridge.js';
15
15
  export class PipelineServer {
16
16
  constructor(config) {
17
17
  this.commandHandlers = new Map();
@@ -30,34 +30,18 @@ export class PipelineServer {
30
30
  this.messageBus = createMessageBus();
31
31
  this.eventStoreContext = createPipelineEventStore();
32
32
  this.eventCommandMapper = new EventCommandMapper([]);
33
- this.settledTracker = new SettledTracker({
34
- readModel: this.eventStoreContext.readModel,
35
- /* v8 ignore next 3 - integration callback tested via settled-tracker.specs.ts */
33
+ this.settledBridge = createV2RuntimeBridge({
36
34
  onDispatch: (commandType, data, correlationId) => {
37
35
  void this.dispatchFromSettled(commandType, data, correlationId);
38
36
  },
39
- /* v8 ignore next 4 - integration callback tested via settled-tracker.specs.ts */
40
- onEventEmit: async (event) => {
41
- const correlationId = event.data.correlationId;
42
- await this.eventStoreContext.eventStore.appendToStream(`pipeline-${correlationId}`, [event]);
43
- },
44
37
  });
45
- this.phasedExecutor = new PhasedExecutor({
46
- readModel: this.eventStoreContext.readModel,
47
- /* v8 ignore next 3 - integration callback tested via phased-executor.specs.ts */
38
+ this.phasedBridge = createPhasedBridge({
48
39
  onDispatch: (commandType, data, correlationId) => {
49
40
  void this.dispatchFromSettled(commandType, data, correlationId);
50
41
  },
51
- /* v8 ignore next 3 - integration callback tested via phased-executor.specs.ts */
52
- onComplete: (event, correlationId) => {
42
+ onPhasedComplete: (event, correlationId) => {
53
43
  void this.handlePhasedComplete(event, correlationId);
54
44
  },
55
- /* v8 ignore next 5 - integration callback tested via phased-executor.specs.ts */
56
- onEventEmit: async (event) => {
57
- const data = event.data;
58
- const correlationId = data.correlationId ?? data.executionId?.split('-')[1] ?? 'default';
59
- await this.eventStoreContext.eventStore.appendToStream(`pipeline-${correlationId}`, [event]);
60
- },
61
45
  });
62
46
  this.sseManager = new SSEManager();
63
47
  }
@@ -88,13 +72,10 @@ export class PipelineServer {
88
72
  this.runtimes.set(pipeline.descriptor.name, new PipelineRuntime(pipeline.descriptor));
89
73
  for (const handler of pipeline.descriptor.handlers) {
90
74
  if (handler.type === 'settled') {
91
- this.settledTracker.registerHandler({
92
- commandTypes: handler.commandTypes,
93
- handler: handler.handler,
94
- });
75
+ this.settledBridge.registerSettled(handler);
95
76
  }
96
77
  else if (handler.type === 'foreach-phased') {
97
- this.phasedExecutor.registerHandler(handler);
78
+ this.phasedBridge.registerPhased(handler);
98
79
  }
99
80
  }
100
81
  }
@@ -422,13 +403,13 @@ export class PipelineServer {
422
403
  endedCount: stats.endedCount,
423
404
  };
424
405
  }
425
- async addStatusToSettledNode(node, correlationId) {
406
+ addStatusToSettledNode(node, correlationId) {
426
407
  if (correlationId === undefined) {
427
408
  return { ...node, status: 'idle', pendingCount: 0, endedCount: 0 };
428
409
  }
429
410
  const commandTypes = node.id.replace(/^settled:/, '');
430
411
  const templateId = `template-${commandTypes}`;
431
- const stats = await this.eventStoreContext.readModel.computeSettledStats(correlationId, templateId);
412
+ const stats = this.settledBridge.getSettledStats(correlationId, templateId);
432
413
  return {
433
414
  ...node,
434
415
  status: stats.status,
@@ -783,7 +764,7 @@ export class PipelineServer {
783
764
  const itemKey = this.extractItemKey(command.type, command.data, command.requestId);
784
765
  await this.getOrCreateItemStatus(this.currentSessionId, command.type, itemKey, command.requestId);
785
766
  await this.updateNodeStatus(this.currentSessionId, command.type, 'running');
786
- await this.settledTracker.onCommandStarted(command);
767
+ this.settledBridge.onCommandStarted(command);
787
768
  const ctx = this.createContext(command.correlationId);
788
769
  let events;
789
770
  try {
@@ -819,9 +800,10 @@ export class PipelineServer {
819
800
  await this.messageBus.publishEvent(eventWithIds);
820
801
  const sourceCommand = this.eventCommandMapper.getSourceCommand(eventWithIds.type);
821
802
  if (sourceCommand !== undefined) {
822
- await this.settledTracker.onEventReceived(eventWithIds, sourceCommand);
803
+ const result = eventWithIds.type.includes('Failed') ? 'failure' : 'success';
804
+ this.settledBridge.onEventReceived(eventWithIds, sourceCommand, result);
823
805
  }
824
- await this.routeEventToPhasedExecutor(eventWithIds);
806
+ this.routeEventToPhasedExecutor(eventWithIds);
825
807
  }
826
808
  await Promise.all(eventsWithIds.map((e) => this.routeEventToPipelines(e)));
827
809
  }
@@ -833,7 +815,7 @@ export class PipelineServer {
833
815
  }
834
816
  return 'success';
835
817
  }
836
- /* v8 ignore next 11 - integration path tested via settled-tracker.specs.ts */
818
+ /* v8 ignore next 11 - integration callback tested via v2-runtime-bridge.specs.ts */
837
819
  async dispatchFromSettled(commandType, data, correlationId) {
838
820
  const requestId = `req-${nanoid()}`;
839
821
  const command = {
@@ -845,7 +827,7 @@ export class PipelineServer {
845
827
  await this.emitCommandDispatched(correlationId, requestId, commandType, data);
846
828
  await this.processCommand(command);
847
829
  }
848
- /* v8 ignore next 10 - integration path tested via phased-executor.specs.ts */
830
+ /* v8 ignore next 10 - integration callback tested via phased-bridge.specs.ts */
849
831
  async handlePhasedComplete(event, correlationId) {
850
832
  const requestId = `req-${nanoid()}`;
851
833
  const eventWithIds = {
@@ -887,21 +869,19 @@ export class PipelineServer {
887
869
  await this.emitCommandDispatched(effectiveCorrelationId, requestId, type, data);
888
870
  void this.processCommand(command);
889
871
  },
890
- /* v8 ignore next 3 - integration path tested via pipeline-runtime.specs.ts */
891
872
  startPhased: async (handler, event) => {
892
- await this.phasedExecutor.startPhased(handler, event, correlationId);
873
+ this.phasedBridge.startPhased(handler, event, correlationId);
893
874
  },
894
875
  eventStore: this.eventStoreContext.eventStore,
895
876
  messageBus: this.messageBus,
896
877
  };
897
878
  }
898
- /* v8 ignore next 10 - integration path tested via phased-executor.specs.ts */
899
- async routeEventToPhasedExecutor(event) {
879
+ routeEventToPhasedExecutor(event) {
900
880
  for (const pipeline of this.pipelines.values()) {
901
881
  for (const handler of pipeline.descriptor.handlers) {
902
882
  if (handler.type === 'foreach-phased') {
903
883
  const itemKey = handler.completion.itemKey(event);
904
- await this.phasedExecutor.onEventReceived(event, itemKey);
884
+ this.phasedBridge.onPhasedItemEvent(event, itemKey);
905
885
  }
906
886
  }
907
887
  }