@cascade-flow/runner 0.2.5 → 0.2.7

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.
@@ -2,24 +2,21 @@
2
2
  /**
3
3
  * Step executor - runs a single step in isolation
4
4
  *
5
- * Receives via stdin:
5
+ * Environment variables:
6
+ * - CF_STEP_INPUT_FILE: Path to temp file containing JSON input (required)
7
+ * - STEP_OUTPUT_FILE: Path to write step result as JSON (required)
8
+ * - CF_CHECKPOINT_DIR: Path to directory for checkpoint IPC (optional)
9
+ *
10
+ * Input format (in CF_STEP_INPUT_FILE):
6
11
  * {
7
12
  * "stepPath": "/path/to/step.ts",
8
13
  * "dependencies": { "depName": <serialized-output> },
9
14
  * "ctx": { "runId": "...", ... }
10
15
  * }
11
16
  *
12
- * Environment variables:
13
- * - STEP_OUTPUT_FILE: If set, write step result to this file (enables stdout/stderr capture)
14
- *
15
- * When STEP_OUTPUT_FILE is set:
16
- * - Outputs to file: Step result as JSON
17
- * - Outputs to stdout: console.log/info output
18
- * - Outputs to stderr: console.error/warn output
19
- *
20
- * When STEP_OUTPUT_FILE is NOT set (backward compatibility):
21
- * - Outputs to stdout: Step result as JSON
22
- * - Outputs to stderr: All console output (redirected)
17
+ * Output:
18
+ * - Step result written to STEP_OUTPUT_FILE as JSON
19
+ * - stdout/stderr: console output from step
23
20
  */
24
21
  export {};
25
22
  //# sourceMappingURL=step-executor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"step-executor.d.ts","sourceRoot":"","sources":["../src/step-executor.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
1
+ {"version":3,"file":"step-executor.d.ts","sourceRoot":"","sources":["../src/step-executor.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;GAkBG"}
@@ -1,5 +1,6 @@
1
1
  import type { LogEntry } from "@cascade-flow/backend-interface";
2
2
  import type { StepOutput, RunnerContext } from "@cascade-flow/workflow";
3
+ import { type CheckpointData, type CheckpointFailedData } from "./checkpoint-ipc.ts";
3
4
  type SubprocessOptions = {
4
5
  signal?: AbortSignal;
5
6
  };
@@ -16,9 +17,13 @@ type SubprocessOptions = {
16
17
  * @param attemptNumber - Current attempt number (for retries)
17
18
  * @param outputPath - Path where subprocess should write output JSON
18
19
  * @param onLog - Optional callback for real-time log emission
20
+ * @param onCheckpoint - Optional callback for persisting checkpoints
21
+ * @param onCheckpointFailed - Optional callback for persisting checkpoint failures
22
+ * @param existingCheckpoints - Existing checkpoints to replay (name -> data[] by sequence)
23
+ * @param options - Additional options (signal for abort)
19
24
  * @returns Promise resolving to step result and collected logs
20
25
  */
21
- export declare function executeStepInSubprocess(stepFile: string, stepId: string, dependencies: Record<string, unknown>, ctx: RunnerContext, attemptNumber: number, outputPath: string, onLog?: (log: LogEntry) => void | Promise<void>, options?: SubprocessOptions): Promise<{
26
+ export declare function executeStepInSubprocess(stepFile: string, stepId: string, dependencies: Record<string, unknown>, ctx: RunnerContext, attemptNumber: number, outputPath: string, onLog?: (log: LogEntry) => void | Promise<void>, onCheckpoint?: (checkpoint: CheckpointData) => Promise<void>, onCheckpointFailed?: (checkpoint: CheckpointFailedData) => Promise<void>, existingCheckpoints?: Map<string, string[]>, options?: SubprocessOptions): Promise<{
22
27
  result: StepOutput;
23
28
  logs: LogEntry[];
24
29
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"subprocess-executor.d.ts","sourceRoot":"","sources":["../src/subprocess-executor.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAcxE,KAAK,iBAAiB,GAAG;IACvB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAkDF;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,M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AC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAC3C,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC,CAwOnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cascade-flow/runner",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -22,9 +22,9 @@
22
22
  "test:coverage": "bun test --coverage"
23
23
  },
24
24
  "dependencies": {
25
- "@cascade-flow/backend-filesystem": "0.2.5",
26
- "@cascade-flow/backend-interface": "0.2.3",
27
- "@cascade-flow/workflow": "0.2.3",
25
+ "@cascade-flow/backend-filesystem": "0.2.7",
26
+ "@cascade-flow/backend-interface": "0.2.5",
27
+ "@cascade-flow/workflow": "0.3.0",
28
28
  "zod": "^4.1.12"
29
29
  },
30
30
  "devDependencies": {