codiedev 0.9.46 → 0.9.48

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 +33 -3
  2. package/package.json +1 -1
package/dist/codie.js CHANGED
@@ -170,10 +170,30 @@ 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
- stdio: ["inherit", "pipe", "pipe"],
175
+ stdio: ["pipe", "pipe", "pipe"],
175
176
  env,
177
+ detached,
176
178
  });
179
+ if (child.stdin)
180
+ process.stdin.pipe(child.stdin);
181
+ const signalChild = (signal) => {
182
+ if (detached && child.pid) {
183
+ try {
184
+ process.kill(-child.pid, signal);
185
+ return;
186
+ }
187
+ catch {
188
+ // Fall back to the direct child if its process group already exited.
189
+ }
190
+ }
191
+ child.kill(signal);
192
+ };
193
+ const forwardInterrupt = () => signalChild("SIGINT");
194
+ const forwardTermination = () => signalChild("SIGTERM");
195
+ process.once("SIGINT", forwardInterrupt);
196
+ process.once("SIGTERM", forwardTermination);
177
197
  return await new Promise((resolve, reject) => {
178
198
  let blockReason;
179
199
  const errorPrefixes = [Buffer.from("\x1b[91m\x1b[1mError:"), Buffer.from("Error: {")];
@@ -237,13 +257,23 @@ async function runNonInteractive(runtime, runtimeArgs, env) {
237
257
  const reason = (0, codieLauncher_1.extractCodieSecurityBlock)(text);
238
258
  if (reason) {
239
259
  blockReason = reason;
240
- child.kill("SIGTERM");
260
+ signalChild("SIGTERM");
241
261
  return;
242
262
  }
243
263
  stderrGate.push(Buffer.from(chunk), Boolean(blockReason));
244
264
  });
245
- child.once("error", reject);
265
+ child.once("error", (error) => {
266
+ if (child.stdin)
267
+ process.stdin.unpipe(child.stdin);
268
+ process.removeListener("SIGINT", forwardInterrupt);
269
+ process.removeListener("SIGTERM", forwardTermination);
270
+ reject(error);
271
+ });
246
272
  child.once("close", (status) => {
273
+ if (child.stdin)
274
+ process.stdin.unpipe(child.stdin);
275
+ process.removeListener("SIGINT", forwardInterrupt);
276
+ process.removeListener("SIGTERM", forwardTermination);
247
277
  stdoutGate.finish(Boolean(blockReason));
248
278
  stderrGate.finish(Boolean(blockReason));
249
279
  if (blockReason) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codiedev",
3
- "version": "0.9.46",
3
+ "version": "0.9.48",
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",