orchestrating 0.3.1 → 0.3.2
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 +20 -5
- package/package.json +1 -1
package/bin/orch
CHANGED
|
@@ -1067,8 +1067,8 @@ if (adapter) {
|
|
|
1067
1067
|
if (yoloMode && event.kind === "permission_denied") {
|
|
1068
1068
|
process.stderr.write(`${GREEN}[yolo] Auto-approving: ${event.toolName}${RESET}\n`);
|
|
1069
1069
|
approvePermission(event.toolName, "session");
|
|
1070
|
-
//
|
|
1071
|
-
|
|
1070
|
+
// Permissions are file-based — need respawn for Claude to pick them up
|
|
1071
|
+
respawnWithContinue(`Permission for ${event.toolName} was granted. Please retry your last action.`);
|
|
1072
1072
|
}
|
|
1073
1073
|
}
|
|
1074
1074
|
});
|
|
@@ -1093,6 +1093,20 @@ if (adapter) {
|
|
|
1093
1093
|
return proc;
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
1096
|
+
// Respawn claude with -c (only needed for permission grants — file-based permission system)
|
|
1097
|
+
function respawnWithContinue(prompt) {
|
|
1098
|
+
if (child && child.exitCode === null) {
|
|
1099
|
+
child.kill("SIGTERM");
|
|
1100
|
+
}
|
|
1101
|
+
const args = ["--output-format", "stream-json", "--input-format", "stream-json", "--verbose", "-c"];
|
|
1102
|
+
if (yoloMode) args.push("--dangerously-skip-permissions");
|
|
1103
|
+
spawnClaude(args);
|
|
1104
|
+
// Send the prompt via stdin after spawning
|
|
1105
|
+
if (prompt) {
|
|
1106
|
+
setTimeout(() => sendFollowUp(prompt), 500);
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1096
1110
|
// Send a follow-up message via stdin (no respawn!)
|
|
1097
1111
|
function sendFollowUp(text) {
|
|
1098
1112
|
if (!child || child.exitCode !== null) return;
|
|
@@ -1257,11 +1271,12 @@ if (adapter) {
|
|
|
1257
1271
|
const scope = msg.scope || "session";
|
|
1258
1272
|
approvePermission(msg.tool, scope);
|
|
1259
1273
|
process.stderr.write(`${GREEN}Permission granted (${scope}): ${msg.tool}${RESET}\n`);
|
|
1260
|
-
//
|
|
1261
|
-
|
|
1274
|
+
// Permissions are file-based in Claude Code — need to restart the process
|
|
1275
|
+
// so it picks up the updated settings.local.json
|
|
1276
|
+
respawnWithContinue(`Permission for ${msg.tool} was granted. Please retry your last action.`);
|
|
1262
1277
|
} else if (msg.type === "agent_permission" && msg.tool && msg.action === "deny") {
|
|
1263
1278
|
process.stderr.write(`${RED}Permission denied: ${msg.tool}${RESET}\n`);
|
|
1264
|
-
|
|
1279
|
+
respawnWithContinue(`Permission for ${msg.tool} was denied by the user. Do not retry this tool — find an alternative approach or skip this step.`);
|
|
1265
1280
|
} else if (msg.type === "agent_permission" && msg.tool && msg.action === "revoke") {
|
|
1266
1281
|
removePermission(msg.tool);
|
|
1267
1282
|
broadcastPermissions();
|