@workflow/core 5.0.0-beta.41 → 5.0.0-beta.43

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 (65) hide show
  1. package/dist/create-hook.d.ts +9 -5
  2. package/dist/create-hook.d.ts.map +1 -1
  3. package/dist/create-hook.js +1 -1
  4. package/dist/events-consumer.d.ts +97 -0
  5. package/dist/events-consumer.d.ts.map +1 -1
  6. package/dist/events-consumer.js +147 -14
  7. package/dist/private.d.ts +31 -12
  8. package/dist/private.d.ts.map +1 -1
  9. package/dist/private.js +149 -26
  10. package/dist/runtime/constants.d.ts +62 -0
  11. package/dist/runtime/constants.d.ts.map +1 -1
  12. package/dist/runtime/constants.js +70 -1
  13. package/dist/runtime/helpers.d.ts +127 -93
  14. package/dist/runtime/helpers.d.ts.map +1 -1
  15. package/dist/runtime/helpers.js +149 -132
  16. package/dist/runtime/quickjs-entrypoint.d.ts +10 -9
  17. package/dist/runtime/quickjs-entrypoint.d.ts.map +1 -1
  18. package/dist/runtime/quickjs-entrypoint.js +162 -38
  19. package/dist/runtime/replay-budget.d.ts +8 -0
  20. package/dist/runtime/replay-budget.d.ts.map +1 -1
  21. package/dist/runtime/replay-budget.js +3 -3
  22. package/dist/runtime/resume-hook.d.ts.map +1 -1
  23. package/dist/runtime/resume-hook.js +53 -13
  24. package/dist/runtime/resume-latency.d.ts +143 -0
  25. package/dist/runtime/resume-latency.d.ts.map +1 -0
  26. package/dist/runtime/resume-latency.js +153 -0
  27. package/dist/runtime/run.d.ts.map +1 -1
  28. package/dist/runtime/run.js +54 -29
  29. package/dist/runtime/step-executor.d.ts +76 -13
  30. package/dist/runtime/step-executor.d.ts.map +1 -1
  31. package/dist/runtime/step-executor.js +171 -19
  32. package/dist/runtime/step-latency.d.ts +6 -0
  33. package/dist/runtime/step-latency.d.ts.map +1 -1
  34. package/dist/runtime/step-latency.js +3 -1
  35. package/dist/runtime/suspension-handler.d.ts +119 -8
  36. package/dist/runtime/suspension-handler.d.ts.map +1 -1
  37. package/dist/runtime/suspension-handler.js +643 -46
  38. package/dist/runtime/world-compatibility.d.ts +6 -5
  39. package/dist/runtime/world-compatibility.d.ts.map +1 -1
  40. package/dist/runtime/world-compatibility.js +7 -6
  41. package/dist/runtime.d.ts.map +1 -1
  42. package/dist/runtime.js +583 -142
  43. package/dist/serialization/codec-devalue.d.ts.map +1 -1
  44. package/dist/serialization/codec-devalue.js +15 -4
  45. package/dist/serialization.d.ts +10 -2
  46. package/dist/serialization.d.ts.map +1 -1
  47. package/dist/serialization.js +55 -8
  48. package/dist/telemetry/semantic-conventions.d.ts +81 -0
  49. package/dist/telemetry/semantic-conventions.d.ts.map +1 -1
  50. package/dist/telemetry/semantic-conventions.js +67 -1
  51. package/dist/telemetry.d.ts +6 -0
  52. package/dist/telemetry.d.ts.map +1 -1
  53. package/dist/telemetry.js +22 -1
  54. package/dist/test-support/orchestrator-context.d.ts +25 -0
  55. package/dist/test-support/orchestrator-context.d.ts.map +1 -0
  56. package/dist/test-support/orchestrator-context.js +91 -0
  57. package/dist/version.d.ts +1 -1
  58. package/dist/version.js +2 -2
  59. package/dist/workflow/create-hook.js +2 -2
  60. package/dist/workflow/hook.js +3 -3
  61. package/dist/workflow.js +43 -2
  62. package/docs/foundations/hooks.mdx +2 -2
  63. package/docs/foundations/streaming.mdx +24 -0
  64. package/docs/how-it-works/event-sourcing.mdx +39 -1
  65. package/package.json +5 -5
@@ -38,15 +38,14 @@ export declare function isFirstInvocation(preloadedEvents: readonly Event[] | un
38
38
  * This replaces the `node:vm` replay path (runWorkflow + EventsConsumer)
39
39
  * with a QuickJS VM invocation that performs the same full event replay.
40
40
  *
41
- * KNOWN GAP — precondition guard: unlike the node:vm path, no event write
42
- * in this file participates in the optimistic-concurrency precondition
43
- * guard (`withPreconditionRetry` + `stateUpdatedAtForCreate`), which
44
- * protects a writer holding a stale event-log snapshot from clobbering a
45
- * concurrent one. The engine currently relies on per-(runId,
46
- * correlationId) event uniqueness (EntityConflictError dedup) alone. This
47
- * is a deliberate simplification while the engine is experimental wiring
48
- * the guard is tracked follow-up work; anyone adding new write paths here
49
- * should not assume parity with the node engine on this axis.
41
+ * KNOWN GAP — slot snapshot: unlike the node:vm path, no event write in
42
+ * this file carries {@link CreateEventParams.eventCount}, so a World never
43
+ * learns which events the writer had not seen and never reports them back.
44
+ * The engine currently relies on per-(runId, correlationId) event
45
+ * uniqueness (EntityConflictError dedup) alone. This is a deliberate
46
+ * simplification while the engine is experimental — wiring the snapshot is
47
+ * tracked follow-up work; anyone adding new write paths here should not
48
+ * assume parity with the node engine on this axis.
50
49
  */
51
50
  export declare function runWorkflowWithQuickJS(params: {
52
51
  workflowCode: string;
@@ -102,6 +101,8 @@ export declare function runWorkflowWithQuickJS(params: {
102
101
  * the in-flight body instead of requeueing the step.
103
102
  */
104
103
  ownerMessageId?: string;
104
+ /** Request ID of the queue invocation, when the queue provides one. */
105
+ requestId?: string;
105
106
  /**
106
107
  * Queue namespace resolved at route registration (runtime.ts). Must be
107
108
  * threaded into every message publish: the builders bake the namespace
@@ -1 +1 @@
1
- {"version":3,"file":"quickjs-entrypoint.d.ts","sourceRoot":"","sources":["../../src/runtime/quickjs-entrypoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAS/C,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,QAAQ,EAEb,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AA2CzB;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAC/B,eAAe,EAAE,SAAS,KAAK,EAAE,GAAG,SAAS,GAC5C,OAAO,CAOT;AAsaD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC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