codiedev 0.9.45 → 0.9.47

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/dist/codie.js +26 -1
  2. package/package.json +1 -1
package/dist/codie.js CHANGED
@@ -170,10 +170,28 @@ function installBrandWordmarkUnsafe(runtime) {
170
170
  }
171
171
  }
172
172
  async function runNonInteractive(runtime, runtimeArgs, env) {
173
+ const detached = process.platform !== "win32";
173
174
  const child = (0, child_process_1.spawn)(runtime, runtimeArgs, {
174
175
  stdio: ["inherit", "pipe", "pipe"],
175
176
  env,
177
+ detached,
176
178
  });
179
+ const signalChild = (signal) => {
180
+ if (detached && child.pid) {
181
+ try {
182
+ process.kill(-child.pid, signal);
183
+ return;
184
+ }
185
+ catch {
186
+ // Fall back to the direct child if its process group already exited.
187
+ }
188
+ }
189
+ child.kill(signal);
190
+ };
191
+ const forwardInterrupt = () => signalChild("SIGINT");
192
+ const forwardTermination = () => signalChild("SIGTERM");
193
+ process.once("SIGINT", forwardInterrupt);
194
+ process.once("SIGTERM", forwardTermination);
177
195
  return await new Promise((resolve, reject) => {
178
196
  let blockReason;
179
197
  const errorPrefixes = [Buffer.from("\x1b[91m\x1b[1mError:"), Buffer.from("Error: {")];
@@ -237,12 +255,19 @@ async function runNonInteractive(runtime, runtimeArgs, env) {
237
255
  const reason = (0, codieLauncher_1.extractCodieSecurityBlock)(text);
238
256
  if (reason) {
239
257
  blockReason = reason;
258
+ signalChild("SIGTERM");
240
259
  return;
241
260
  }
242
261
  stderrGate.push(Buffer.from(chunk), Boolean(blockReason));
243
262
  });
244
- child.once("error", reject);
263
+ child.once("error", (error) => {
264
+ process.removeListener("SIGINT", forwardInterrupt);
265
+ process.removeListener("SIGTERM", forwardTermination);
266
+ reject(error);
267
+ });
245
268
  child.once("close", (status) => {
269
+ process.removeListener("SIGINT", forwardInterrupt);
270
+ process.removeListener("SIGTERM", forwardTermination);
246
271
  stdoutGate.finish(Boolean(blockReason));
247
272
  stderrGate.finish(Boolean(blockReason));
248
273
  if (blockReason) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codiedev",
3
- "version": "0.9.45",
3
+ "version": "0.9.47",
4
4
  "description": "Connect Claude Code, Codex, Cursor, OpenCode, or VS Code Copilot to Codiedev for team session capture and artifact collaboration — and run the governed Codie harness",
5
5
  "bin": {
6
6
  "codiedev": "dist/cli.js",