onepipeline-cli 0.95.4 → 0.95.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.
Files changed (2) hide show
  1. package/bin/onepipeline.js +17 -6
  2. package/package.json +5 -5
@@ -110,22 +110,33 @@ const CONSOLE_EVENTS = ["SIGINT", "SIGBREAK"];
110
110
  // at which the engine runs and nothing that would end it knows it, however
111
111
  // early in its start this process is ended. A message the keeper cannot
112
112
  // deliver is the same break, seen first: this process ended before the keeper
113
- // ran, and the failed send ends the engine rather than the keeper alone.
113
+ // ran, and the failed send ends the engine rather than the keeper alone. Node
114
+ // reports only some failures to start a program as an "error" event and throws
115
+ // the rest — on Windows, a binary that is not a program — so both are reported
116
+ // as the one envelope.
114
117
  const KEEPER = `
115
118
  const { spawn } = require("node:child_process");
116
119
  const [binary, ...args] = JSON.parse(process.argv[1]);
117
120
  for (const signal of ${JSON.stringify(CONSOLE_EVENTS)}) process.on(signal, () => {});
118
- const engine = spawn(binary, args, { stdio: "inherit" });
121
+ let engine = null;
119
122
  const end = () => {
120
- engine.kill("SIGKILL");
123
+ engine?.kill("SIGKILL");
121
124
  process.exit(0);
122
125
  };
123
126
  process.on("disconnect", end);
124
127
  const send = (message, then = () => {}) =>
125
128
  process.send(message, (error) => (error ? end() : then()));
126
- if (engine.pid !== undefined) send({ engine: engine.pid });
127
- engine.on("error", (error) => send({ error: error.message }, () => process.exit(0)));
128
- engine.on("exit", (code) => send({ status: code ?? 1 }, () => process.exit(0)));
129
+ const failed = (error) => send({ error: error.message }, () => process.exit(0));
130
+ try {
131
+ engine = spawn(binary, args, { stdio: "inherit" });
132
+ } catch (error) {
133
+ failed(error);
134
+ }
135
+ if (engine !== null) {
136
+ if (engine.pid !== undefined) send({ engine: engine.pid });
137
+ engine.on("error", failed);
138
+ engine.on("exit", (code) => send({ status: code ?? 1 }, () => process.exit(0)));
139
+ }
129
140
  `;
130
141
 
131
142
  function supervise(binary, args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onepipeline-cli",
3
- "version": "0.95.4",
3
+ "version": "0.95.6",
4
4
  "description": "Execute a task DAG over oneagentgraph and onevcs, merging their event streams into one.",
5
5
  "keywords": [
6
6
  "orchestration",
@@ -27,9 +27,9 @@
27
27
  "node": "^22.15.0 || >=23.11.0"
28
28
  },
29
29
  "optionalDependencies": {
30
- "onepipeline-cli-linux-x64": "0.95.4",
31
- "onepipeline-cli-linux-arm64": "0.95.4",
32
- "onepipeline-cli-darwin-arm64": "0.95.4",
33
- "onepipeline-cli-win32-x64": "0.95.4"
30
+ "onepipeline-cli-linux-x64": "0.95.6",
31
+ "onepipeline-cli-linux-arm64": "0.95.6",
32
+ "onepipeline-cli-darwin-arm64": "0.95.6",
33
+ "onepipeline-cli-win32-x64": "0.95.6"
34
34
  }
35
35
  }