@workflow/core 5.0.0 → 5.0.1

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 (51) hide show
  1. package/dist/logger.d.ts.map +1 -1
  2. package/dist/logger.js +4 -2
  3. package/dist/runtime/dynamic-workflow.d.ts +34 -0
  4. package/dist/runtime/dynamic-workflow.d.ts.map +1 -1
  5. package/dist/runtime/dynamic-workflow.js +111 -19
  6. package/dist/runtime/quickjs-assets.generated.d.ts +7 -0
  7. package/dist/runtime/quickjs-assets.generated.d.ts.map +1 -1
  8. package/dist/runtime/quickjs-assets.generated.js +8 -1
  9. package/dist/runtime/quickjs-entrypoint.d.ts +2 -30
  10. package/dist/runtime/quickjs-entrypoint.d.ts.map +1 -1
  11. package/dist/runtime/quickjs-entrypoint.js +532 -60
  12. package/dist/runtime/quickjs-log-view.d.ts +27 -4
  13. package/dist/runtime/quickjs-log-view.d.ts.map +1 -1
  14. package/dist/runtime/quickjs-log-view.js +43 -6
  15. package/dist/runtime/quickjs-runtime.d.ts +55 -3
  16. package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
  17. package/dist/runtime/quickjs-runtime.js +402 -157
  18. package/dist/runtime/quickjs-snapshot-codec.d.ts +74 -0
  19. package/dist/runtime/quickjs-snapshot-codec.d.ts.map +1 -0
  20. package/dist/runtime/quickjs-snapshot-codec.js +159 -0
  21. package/dist/runtime/start.d.ts.map +1 -1
  22. package/dist/runtime/start.js +66 -41
  23. package/dist/runtime/step-executor.d.ts.map +1 -1
  24. package/dist/runtime/step-executor.js +4 -3
  25. package/dist/runtime/vm-mode.d.ts +44 -0
  26. package/dist/runtime/vm-mode.d.ts.map +1 -1
  27. package/dist/runtime/vm-mode.js +79 -1
  28. package/dist/runtime.d.ts.map +1 -1
  29. package/dist/runtime.js +18 -12
  30. package/dist/serialization/compression.d.ts +27 -2
  31. package/dist/serialization/compression.d.ts.map +1 -1
  32. package/dist/serialization/compression.js +69 -14
  33. package/dist/serialization/hardened.d.ts +8 -0
  34. package/dist/serialization/hardened.d.ts.map +1 -1
  35. package/dist/serialization/hardened.js +18 -2
  36. package/dist/set-error-stack.d.ts +12 -0
  37. package/dist/set-error-stack.d.ts.map +1 -0
  38. package/dist/set-error-stack.js +30 -0
  39. package/dist/telemetry/semantic-conventions.d.ts +28 -0
  40. package/dist/telemetry/semantic-conventions.d.ts.map +1 -1
  41. package/dist/telemetry/semantic-conventions.js +15 -1
  42. package/dist/version.d.ts +1 -1
  43. package/dist/version.js +2 -2
  44. package/docs/api-reference/create-hook.mdx +4 -0
  45. package/docs/api-reference/create-webhook.mdx +1 -1
  46. package/docs/api-reference/define-hook.mdx +4 -0
  47. package/docs/foundations/errors-and-retries.mdx +3 -3
  48. package/docs/foundations/hooks.mdx +91 -3
  49. package/docs/foundations/workflows-and-steps.mdx +1 -1
  50. package/docs/how-it-works/code-transform.mdx +1 -1
  51. package/package.json +5 -5
@@ -32,36 +32,8 @@ import { type Event, type RunInput, type WorkflowRun } from '@workflow/world';
32
32
  * Exported for unit testing.
33
33
  */
34
34
  export declare function isFirstInvocation(preloadedEvents: readonly Event[] | undefined): boolean;
35
- /**
36
- * Run a workflow using the QuickJS WASM VM engine.
37
- *
38
- * This replaces the `node:vm` replay path (runWorkflow + EventsConsumer)
39
- * with a QuickJS VM invocation that performs the same full event replay.
40
- *
41
- * Log position on writes. This engine follows the same rule as the node:vm
42
- * replay loop for which writes tell the World where the writer stood (see the
43
- * "Who names a position" table above `slotSnapshotParams` in `helpers.ts`):
44
- *
45
- * - Writes made from this invocation's view of the log (`step_created`,
46
- * `wait_created`, `hook_created`, `hook_disposed`, `attr_set`, the abort
47
- * `hook_received`, `wait_completed`, and the `step_created` + `step_failed`
48
- * pair for an unserializable input) carry `eventCount`, and the page a
49
- * World hands back is queued for the live VM through {@link QuickJSLogView}.
50
- * - A single inline step's terminal write asks for the inline delta
51
- * (`sinceCursor`) through `executeStep`, and so does a lone `hook_created`
52
- * (see `dispatchPendingOps.deltaCursor`); the delta is queued the same
53
- * way. The step executor's other writes carry nothing: it holds no log.
54
- * - Run-terminal writes (`run_completed`, `run_failed`) and the terminal drain
55
- * of pending ops carry nothing: nothing reads the log afterwards.
56
- *
57
- * What differs from the node engine is what "merge into the log" means. The
58
- * node engine merges a returned page into the array it replays from. This
59
- * engine holds a live VM that consumes events exactly once, in position
60
- * order, so a returned page is queued and delivered ahead of the next
61
- * `events.list`, which then only runs when the queue cannot account for the
62
- * next position. Both engines fall back to a list for anything a page did
63
- * not carry.
64
- */
35
+ /** Test-only: forget the process-local snapshot latches. */
36
+ export declare function __resetSnapshotLatchesForTests(): void;
65
37
  export declare function runWorkflowWithQuickJS(params: {
66
38
  workflowCode: string;
67
39
  workflowName: string;
@@ -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,EAGL,KAAK,KAAK,EAGV,KAAK,QAAQ,EAIb,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AAqEzB;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAC/B,eAAe,EAAE,SAAS,KAAK,EAAE,GAAG,SAAS,GAC5C,OAAO,CAOT;AAouBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC;IAC1B;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACh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