orchestrating 0.1.9 → 0.1.11
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.
- package/bin/orch +9 -4
- package/package.json +1 -1
package/bin/orch
CHANGED
|
@@ -305,6 +305,7 @@ if (!adapter) {
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
let child;
|
|
308
|
+
let childRunning = false;
|
|
308
309
|
let handleServerMessage; // set per-mode
|
|
309
310
|
let exitRequested = false;
|
|
310
311
|
|
|
@@ -321,16 +322,14 @@ if (adapter) {
|
|
|
321
322
|
}
|
|
322
323
|
}
|
|
323
324
|
const prompt = promptParts.join(" ");
|
|
324
|
-
if (!prompt
|
|
325
|
+
if (!prompt) {
|
|
325
326
|
console.error(`Usage: orch ${command} "your prompt here"`);
|
|
326
|
-
console.error(` orch ${command} -c # continue last conversation`);
|
|
327
327
|
console.error(` orch ${command} -c "follow up" # continue with message`);
|
|
328
328
|
process.exit(1);
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
// Confirmation-type tools — these need "yes" response, not permission grants
|
|
332
332
|
const CONFIRMATION_TOOLS = new Set(["ExitPlanMode", "EnterPlanMode"]);
|
|
333
|
-
let childRunning = false;
|
|
334
333
|
|
|
335
334
|
// Build clean env for child processes (no nesting detection, no leaked keys)
|
|
336
335
|
const childEnv = (() => {
|
|
@@ -888,7 +887,13 @@ function cleanup() {
|
|
|
888
887
|
process.on("SIGINT", () => {
|
|
889
888
|
if (adapter) {
|
|
890
889
|
exitRequested = true;
|
|
891
|
-
|
|
890
|
+
if (childRunning) {
|
|
891
|
+
child.kill("SIGINT");
|
|
892
|
+
} else {
|
|
893
|
+
// Child already exited (idle/waiting for follow-up) — exit now
|
|
894
|
+
cleanup();
|
|
895
|
+
process.exit(0);
|
|
896
|
+
}
|
|
892
897
|
} else {
|
|
893
898
|
child.stdin.write("\x03");
|
|
894
899
|
}
|