@accio-ai/cli 0.1.32 → 0.1.34

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.
Binary file
package/bin/workctl.js CHANGED
@@ -56,9 +56,56 @@ delete env.WORKCTL_MCP_URL;
56
56
  delete env.WORKCTL_CATALOG_FIXTURE;
57
57
  delete env.WORKCTL_RUNTIME_CONFIG;
58
58
 
59
- const result = childProcess.spawnSync(binaryPath, process.argv.slice(2), {
59
+ const child = childProcess.spawn(binaryPath, process.argv.slice(2), {
60
60
  env,
61
61
  stdio: "inherit",
62
62
  });
63
63
 
64
- process.exit(result.status === null ? 1 : result.status);
64
+ let spawnFailed = false;
65
+ let forwardedSignal = null;
66
+ const signals =
67
+ process.platform === "win32"
68
+ ? ["SIGINT", "SIGTERM", "SIGBREAK"]
69
+ : ["SIGHUP", "SIGINT", "SIGTERM"];
70
+ const signalExitCodes = {
71
+ SIGHUP: 129,
72
+ SIGINT: 130,
73
+ SIGTERM: 143,
74
+ SIGBREAK: 149,
75
+ };
76
+
77
+ function forwardSignal(signal) {
78
+ forwardedSignal = signal;
79
+ if (child.exitCode !== null || child.signalCode !== null) {
80
+ return;
81
+ }
82
+ try {
83
+ child.kill(process.platform === "win32" ? "SIGTERM" : signal);
84
+ } catch (error) {
85
+ console.error(`workctl: failed to forward ${signal}: ${error.message}`);
86
+ }
87
+ }
88
+
89
+ for (const signal of signals) {
90
+ process.on(signal, () => forwardSignal(signal));
91
+ }
92
+
93
+ child.on("error", (error) => {
94
+ spawnFailed = true;
95
+ console.error(`workctl: failed to start binary: ${error.message}`);
96
+ });
97
+
98
+ child.on("close", (code, signal) => {
99
+ for (const registeredSignal of signals) {
100
+ process.removeAllListeners(registeredSignal);
101
+ }
102
+ if (spawnFailed) {
103
+ process.exitCode = 1;
104
+ return;
105
+ }
106
+ if (Number.isInteger(code)) {
107
+ process.exitCode = code;
108
+ return;
109
+ }
110
+ process.exitCode = signalExitCodes[signal || forwardedSignal] || 1;
111
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@accio-ai/cli",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "description": "Work Agent CLI - AI-native command line interface",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -18,12 +18,12 @@
18
18
  "postinstall": "node install.js"
19
19
  },
20
20
  "optionalDependencies": {
21
- "@accio-ai/cli-darwin-arm64": "0.1.32",
22
- "@accio-ai/cli-darwin-x64": "0.1.32",
23
- "@accio-ai/cli-linux-arm64": "0.1.32",
24
- "@accio-ai/cli-linux-x64": "0.1.32",
25
- "@accio-ai/cli-win32-arm64": "0.1.32",
26
- "@accio-ai/cli-win32-x64": "0.1.32"
21
+ "@accio-ai/cli-darwin-arm64": "0.1.34",
22
+ "@accio-ai/cli-darwin-x64": "0.1.34",
23
+ "@accio-ai/cli-linux-arm64": "0.1.34",
24
+ "@accio-ai/cli-linux-x64": "0.1.34",
25
+ "@accio-ai/cli-win32-arm64": "0.1.34",
26
+ "@accio-ai/cli-win32-x64": "0.1.34"
27
27
  },
28
28
  "publishConfig": {
29
29
  "registry": "https://registry.npmjs.org"