@phi-code-admin/phi-code 0.60.9 → 0.61.0
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.
|
@@ -161,7 +161,8 @@ export default function orchestratorExtension(pi: ExtensionAPI) {
|
|
|
161
161
|
}
|
|
162
162
|
} catch { /* not in PATH */ }
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
// Last resort: assume phi is in PATH (works with shell:true on Windows)
|
|
165
|
+
return "phi";
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
// ─── Sub-Agent Execution ─────────────────────────────────────────
|
|
@@ -223,7 +224,6 @@ export default function orchestratorExtension(pi: ExtensionAPI) {
|
|
|
223
224
|
taskPrompt += `- Report exactly what you did, what worked, and what didn't.\n`;
|
|
224
225
|
|
|
225
226
|
const args: string[] = [];
|
|
226
|
-
if (phiBin === "npx") args.push("@phi-code-admin/phi-code");
|
|
227
227
|
|
|
228
228
|
args.push("--print");
|
|
229
229
|
if (model && model !== "default") args.push("--model", model);
|
|
@@ -231,14 +231,26 @@ export default function orchestratorExtension(pi: ExtensionAPI) {
|
|
|
231
231
|
args.push("--no-session");
|
|
232
232
|
args.push(taskPrompt);
|
|
233
233
|
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
// Determine command: use node + cli.js for JS paths, or phi directly on Windows
|
|
235
|
+
let cmd: string;
|
|
236
|
+
let cmdArgs: string[];
|
|
237
|
+
if (phiBin.endsWith(".js")) {
|
|
238
|
+
cmd = "node";
|
|
239
|
+
cmdArgs = [phiBin, ...args];
|
|
240
|
+
} else if (phiBin === "phi") {
|
|
241
|
+
cmd = "phi";
|
|
242
|
+
cmdArgs = args;
|
|
243
|
+
} else {
|
|
244
|
+
cmd = phiBin;
|
|
245
|
+
cmdArgs = args;
|
|
246
|
+
}
|
|
236
247
|
|
|
237
248
|
execFile(cmd, cmdArgs, {
|
|
238
249
|
cwd,
|
|
239
250
|
timeout: timeoutMs,
|
|
240
251
|
maxBuffer: 10 * 1024 * 1024,
|
|
241
252
|
env: { ...process.env },
|
|
253
|
+
shell: process.platform === "win32", // Windows needs shell for .cmd shims
|
|
242
254
|
}, (error, stdout, stderr) => {
|
|
243
255
|
const durationMs = Date.now() - startTime;
|
|
244
256
|
if (error) {
|