lightflow-engine 0.2.5 → 0.2.6

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.
@@ -14,6 +14,8 @@ import { Engine, type Store } from "../index.js";
14
14
  export type VercelRunStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
15
15
  export type VercelRun = {
16
16
  runId: string;
17
+ /** Vercel's run handle exposes exists; ours always resolves from the DB. */
18
+ readonly exists: true;
17
19
  /** Live getter: each access returns a FRESH promise snapshotting the
18
20
  * current status ("pending"/"running" until terminal). Vercel's is a
19
21
  * getter too (chat.test.ts mocks `get status()`), and entry-agents'
@@ -67,6 +67,7 @@ function makeRunHandle(runId) {
67
67
  const cache = {};
68
68
  const handle = {
69
69
  runId,
70
+ exists: true,
70
71
  get status() {
71
72
  // Live snapshot: resolve immediately with the current state; the
72
73
  // startStopMonitor poll loop relies on this re-reading each tick.
@@ -9,6 +9,7 @@
9
9
  */
10
10
  export { FatalError, CancelledError, sleep } from "../index.js";
11
11
  export { getWorkflowMetadata } from "../compat/metadata.js";
12
+ export { workflowFetch as fetch } from "../compat/fetch.js";
12
13
  export { workflowFetch } from "../compat/fetch.js";
13
14
  /**
14
15
  * Vercel's getWritable returns a web-standard WritableStream whose writes
@@ -12,6 +12,9 @@ import { step, registerStep, } from "../index.js";
12
12
  import { current } from "../index.js";
13
13
  export { FatalError, CancelledError, sleep } from "../index.js";
14
14
  export { getWorkflowMetadata } from "../compat/metadata.js";
15
+ // Vercel exports the step-aware fetch under both names; entry-agents
16
+ // imports `fetch as workflowFetch` in some files and plain `fetch` in others.
17
+ export { workflowFetch as fetch } from "../compat/fetch.js";
15
18
  export { workflowFetch } from "../compat/fetch.js";
16
19
  /**
17
20
  * Vercel's getWritable returns a web-standard WritableStream whose writes
package/dist/index.d.ts CHANGED
@@ -74,7 +74,7 @@ export interface Store {
74
74
  } | null>;
75
75
  setStatus(runId: string, status: RunStatus, output?: unknown): Promise<void>;
76
76
  }
77
- type WorkflowFn = (...args: unknown[]) => Promise<unknown>;
77
+ type WorkflowFn = (...args: any[]) => Promise<unknown>;
78
78
  export declare function registerWorkflow(id: string, fn: WorkflowFn): void;
79
79
  export declare function registerStep(id: string, fn: (...a: unknown[]) => Promise<unknown>): void;
80
80
  type Ctx = {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "lightflow-engine",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "A tiny durable workflow engine for Node.js and Postgres — with a Vercel Workflow drop-in compat layer.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "main": "dist/index.js", "types": "dist/index.d.ts",
7
+ "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {