@voyant-travel/workflows-orchestrator 0.107.10 → 0.108.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.
package/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  Reference orchestrator for Voyant Workflows. Drives runs through the
4
4
  tenant step handler over the v1 wire protocol. Transport- and
5
5
  storage-agnostic: compose with a `RunRecordStore` of your choice
6
- (in-memory for tests, Postgres-backed for production, DO-backed via
7
- [`@voyant-travel/workflows-orchestrator-cloudflare`](../workflows-orchestrator-cloudflare)).
6
+ (in-memory for tests, Postgres-backed for production through
7
+ [`@voyant-travel/workflows-orchestrator-node`](../workflows-orchestrator-node)).
8
8
 
9
9
  See [`docs/runtime-protocol.md`](../../docs/runtime-protocol.md) §2 +
10
10
  §5 for the contract this implements.
@@ -20,8 +20,8 @@ import {
20
20
  import { handleStepRequest } from "@voyant-travel/workflows/handler";
21
21
 
22
22
  // A StepHandler calls into the tenant's workflow code. In-process
23
- // here via `handleStepRequest`; over HTTP in production via
24
- // @voyant-travel/workflows-orchestrator-cloudflare's dispatch-namespace adapter.
23
+ // here via `handleStepRequest`; production Node deployments normally
24
+ // use the node runtime package.
25
25
  const handler: StepHandler = async (req) => handleStepRequest(req);
26
26
 
27
27
  const store = createInMemoryRunStore();
@@ -71,6 +71,5 @@ The authoring SDK (`@voyant-travel/workflows`) describes workflows and
71
71
  provides the in-process executor. The orchestrator consumes that
72
72
  SDK's wire protocol — it doesn't care how the tenant runs the body,
73
73
  only about the request/response shape. Separating them keeps the
74
- orchestrator transport-neutral (in-process, HTTP, Durable Objects,
75
- future adapters) and makes it easy to test the full loop without
76
- any network or Cloudflare dependency.
74
+ orchestrator transport-neutral and makes it easy to test the full loop
75
+ without any network dependency.
@@ -291,10 +291,10 @@ export function createInMemoryDriver(opts = {}) {
291
291
  concurrency.releaseRun(out.record);
292
292
  }
293
293
  },
294
- // streamRun is not implemented for InMemory in PR1. Dashboards that
294
+ // streamRun is not implemented for InMemory. Dashboards that
295
295
  // probe `driver.admin.streamRun` get `undefined` and fall back to
296
- // their non-streaming view. Mode 2 + Mode 1 implement this in later
297
- // PRs against their respective journal sources.
296
+ // their non-streaming view. Node/Postgres and legacy Cloudflare
297
+ // drivers can provide their own journal streams.
298
298
  };
299
299
  return {
300
300
  registerManifest,
@@ -2,11 +2,11 @@
2
2
  // filters match and produce the per-match descriptors drivers feed into
3
3
  // `trigger()`.
4
4
  //
5
- // Drivers (InMemory, Mode 2 / Postgres, Mode 1 / CF edge) wrap this in
5
+ // Drivers (InMemory, Node/Postgres, legacy Cloudflare Worker/DO) wrap this in
6
6
  // their own `ingestEvent` impl: they fetch the manifest from their store,
7
7
  // call `routeEvent(...)`, then invoke `trigger()` per match.
8
8
  //
9
- // Architecture: docs/architecture/workflows-runtime-architecture.md §15.
9
+ // Architecture: docs/architecture/workflows-runtime-architecture.md.
10
10
  import { evaluatePredicate, projectInput, } from "@voyant-travel/workflows/events";
11
11
  // ---- Public API ----
12
12
  /**
@@ -22,22 +22,23 @@ export declare function buildTestManifest(versionId?: string): WorkflowManifest;
22
22
  /**
23
23
  * Opt-in capability flags for drivers that don't share a process with
24
24
  * step bodies. Default to `true` because in-process drivers (InMemory,
25
- * Mode 2) satisfy every contract. Out-of-process drivers (Mode 1 / CF
26
- * edge orchestrator and tenant live in separate Worker isolates) opt
27
- * out of in-process-only assertions like `ctx.services` threading.
25
+ * Node/Postgres) satisfy every contract. Out-of-process drivers (legacy
26
+ * Cloudflare Worker/DO deployments, where orchestrator and tenant live in
27
+ * separate Worker isolates) opt out of in-process-only assertions like
28
+ * `ctx.services` threading.
28
29
  */
29
30
  export interface DriverComplianceCapabilities {
30
31
  /**
31
32
  * When true, the framework's `ModuleContainer` is plumbed to step
32
- * bodies via `ctx.services`. False for Mode 1, where the orchestrator
33
- * and tenant are separate Workers and a per-tenant container would
34
- * have to ship across a serialization boundary.
33
+ * bodies via `ctx.services`. False for legacy Cloudflare deployments,
34
+ * where the orchestrator and tenant are separate Workers and a per-tenant
35
+ * container would have to ship across a serialization boundary.
35
36
  */
36
37
  servicesThreading?: boolean;
37
38
  /**
38
39
  * When true, `admin.listRuns(...)` returns runs the driver knows about.
39
- * False for self-host Mode 1, which has no native cross-run query
40
- * layer (per architecture doc §8.3) — `listRuns` exists but returns
40
+ * False for legacy Cloudflare deployments, which have no native cross-run
41
+ * query layer — `listRuns` exists but returns
41
42
  * an empty page; voyant-cloud provides an index in its repo.
42
43
  */
43
44
  crossRunQueries?: boolean;
@@ -49,7 +50,7 @@ export interface DriverComplianceCapabilities {
49
50
  autoDatetimeWakeups?: boolean;
50
51
  /**
51
52
  * When true, workflow-level `WorkflowConfig.concurrency` is enforced
52
- * for in-process workflow definitions. False for Mode 1 / Cloudflare
53
+ * for in-process workflow definitions. False for legacy Cloudflare
53
54
  * until it grows a cross-run coordination DO.
54
55
  */
55
56
  workflowConcurrency?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"driver-compliance.d.ts","sourceRoot":"","sources":["../../src/testing/driver-compliance.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EAChB,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAKzE;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,eAAe,CAa1F;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,GAAE,eAAuC,GAChD,iBAAiB,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;CAAE,CAOhE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,SAAe,GAAG,gBAAgB,CAc5E;AA4BD;;;;;;GAMG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;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AAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,aAAa,EAChC,YAAY,GAAE,4BAAiC,GAC9C,IAAI,CAqnBN"}
@@ -2,7 +2,7 @@
2
2
  //
3
3
  // `runDriverComplianceSuite(name, makeDriver)` is parameterized over a
4
4
  // driver factory. It runs identical assertions against every implementation
5
- // we ship: InMemory, Mode 2 / Postgres, Mode 1 / CF edge.
5
+ // we ship: InMemory, Node/Postgres, and legacy Cloudflare Worker/DO.
6
6
  //
7
7
  // Importable from a regular `.ts` file so downstream packages
8
8
  // (`@voyant-travel/workflows-orchestrator-node`, `-cloudflare`) can run the
@@ -16,7 +16,7 @@
16
16
  // idempotency dedup, ingestEvent's manifest-not-registered + no-filters
17
17
  // paths, ctx.services, basic admin reads, shutdown.
18
18
  //
19
- // Architecture: docs/architecture/workflows-runtime-architecture.md §6.4.
19
+ // Architecture: docs/architecture/workflows-runtime-architecture.md.
20
20
  import { __resetRegistry, workflow } from "@voyant-travel/workflows";
21
21
  import { beforeEach, describe, expect, test, vi } from "vitest";
22
22
  import { WorkflowConcurrencyRejectedError } from "../concurrency.js";
@@ -84,7 +84,7 @@ function testReleaseCapabilities() {
84
84
  };
85
85
  }
86
86
  // Per-test counter so workflow ids stay unique across tests in a suite —
87
- // some persistent stores (Mode 2's Postgres) carry state between tests in
87
+ // some persistent stores (Node/Postgres) carry state between tests in
88
88
  // the same run, and a duplicate id would HMR-warn at minimum and
89
89
  // pollute results at worst.
90
90
  let suiteCounter = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyant-travel/workflows-orchestrator",
3
- "version": "0.107.10",
3
+ "version": "0.108.0",
4
4
  "description": "Reference orchestrator core for Voyant Workflows — drives runs through the tenant step handler over the v1 wire protocol.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -30,7 +30,7 @@
30
30
  "NOTICE"
31
31
  ],
32
32
  "dependencies": {
33
- "@voyant-travel/workflows": "^0.107.10"
33
+ "@voyant-travel/workflows": "^0.108.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^20.12.0",
@@ -387,10 +387,10 @@ export function createInMemoryDriver(opts: InMemoryDriverOptions = {}): DriverFa
387
387
  }
388
388
  },
389
389
 
390
- // streamRun is not implemented for InMemory in PR1. Dashboards that
390
+ // streamRun is not implemented for InMemory. Dashboards that
391
391
  // probe `driver.admin.streamRun` get `undefined` and fall back to
392
- // their non-streaming view. Mode 2 + Mode 1 implement this in later
393
- // PRs against their respective journal sources.
392
+ // their non-streaming view. Node/Postgres and legacy Cloudflare
393
+ // drivers can provide their own journal streams.
394
394
  }
395
395
 
396
396
  return {
@@ -2,11 +2,11 @@
2
2
  // filters match and produce the per-match descriptors drivers feed into
3
3
  // `trigger()`.
4
4
  //
5
- // Drivers (InMemory, Mode 2 / Postgres, Mode 1 / CF edge) wrap this in
5
+ // Drivers (InMemory, Node/Postgres, legacy Cloudflare Worker/DO) wrap this in
6
6
  // their own `ingestEvent` impl: they fetch the manifest from their store,
7
7
  // call `routeEvent(...)`, then invoke `trigger()` per match.
8
8
  //
9
- // Architecture: docs/architecture/workflows-runtime-architecture.md §15.
9
+ // Architecture: docs/architecture/workflows-runtime-architecture.md.
10
10
 
11
11
  import {
12
12
  evaluatePredicate,
@@ -2,7 +2,7 @@
2
2
  //
3
3
  // `runDriverComplianceSuite(name, makeDriver)` is parameterized over a
4
4
  // driver factory. It runs identical assertions against every implementation
5
- // we ship: InMemory, Mode 2 / Postgres, Mode 1 / CF edge.
5
+ // we ship: InMemory, Node/Postgres, and legacy Cloudflare Worker/DO.
6
6
  //
7
7
  // Importable from a regular `.ts` file so downstream packages
8
8
  // (`@voyant-travel/workflows-orchestrator-node`, `-cloudflare`) can run the
@@ -16,7 +16,7 @@
16
16
  // idempotency dedup, ingestEvent's manifest-not-registered + no-filters
17
17
  // paths, ctx.services, basic admin reads, shutdown.
18
18
  //
19
- // Architecture: docs/architecture/workflows-runtime-architecture.md §6.4.
19
+ // Architecture: docs/architecture/workflows-runtime-architecture.md.
20
20
 
21
21
  import { __resetRegistry, workflow } from "@voyant-travel/workflows"
22
22
  import type {
@@ -100,7 +100,7 @@ function testReleaseCapabilities(): WorkflowManifest["capabilities"] {
100
100
  }
101
101
 
102
102
  // Per-test counter so workflow ids stay unique across tests in a suite —
103
- // some persistent stores (Mode 2's Postgres) carry state between tests in
103
+ // some persistent stores (Node/Postgres) carry state between tests in
104
104
  // the same run, and a duplicate id would HMR-warn at minimum and
105
105
  // pollute results at worst.
106
106
  let suiteCounter = 0
@@ -115,22 +115,23 @@ const DATETIME_WAKEUP_TEST_TIMEOUT_MS = 5_000
115
115
  /**
116
116
  * Opt-in capability flags for drivers that don't share a process with
117
117
  * step bodies. Default to `true` because in-process drivers (InMemory,
118
- * Mode 2) satisfy every contract. Out-of-process drivers (Mode 1 / CF
119
- * edge orchestrator and tenant live in separate Worker isolates) opt
120
- * out of in-process-only assertions like `ctx.services` threading.
118
+ * Node/Postgres) satisfy every contract. Out-of-process drivers (legacy
119
+ * Cloudflare Worker/DO deployments, where orchestrator and tenant live in
120
+ * separate Worker isolates) opt out of in-process-only assertions like
121
+ * `ctx.services` threading.
121
122
  */
122
123
  export interface DriverComplianceCapabilities {
123
124
  /**
124
125
  * When true, the framework's `ModuleContainer` is plumbed to step
125
- * bodies via `ctx.services`. False for Mode 1, where the orchestrator
126
- * and tenant are separate Workers and a per-tenant container would
127
- * have to ship across a serialization boundary.
126
+ * bodies via `ctx.services`. False for legacy Cloudflare deployments,
127
+ * where the orchestrator and tenant are separate Workers and a per-tenant
128
+ * container would have to ship across a serialization boundary.
128
129
  */
129
130
  servicesThreading?: boolean
130
131
  /**
131
132
  * When true, `admin.listRuns(...)` returns runs the driver knows about.
132
- * False for self-host Mode 1, which has no native cross-run query
133
- * layer (per architecture doc §8.3) — `listRuns` exists but returns
133
+ * False for legacy Cloudflare deployments, which have no native cross-run
134
+ * query layer — `listRuns` exists but returns
134
135
  * an empty page; voyant-cloud provides an index in its repo.
135
136
  */
136
137
  crossRunQueries?: boolean
@@ -142,7 +143,7 @@ export interface DriverComplianceCapabilities {
142
143
  autoDatetimeWakeups?: boolean
143
144
  /**
144
145
  * When true, workflow-level `WorkflowConfig.concurrency` is enforced
145
- * for in-process workflow definitions. False for Mode 1 / Cloudflare
146
+ * for in-process workflow definitions. False for legacy Cloudflare
146
147
  * until it grows a cross-run coordination DO.
147
148
  */
148
149
  workflowConcurrency?: boolean