@phi-code-admin/phi-code 0.60.8 → 0.60.9

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.
@@ -129,12 +129,38 @@ export default function orchestratorExtension(pi: ExtensionAPI) {
129
129
  }
130
130
 
131
131
  function findPhiBinary(): string {
132
+ // Try the bundled CLI relative to extensions dir
132
133
  const bundledCli = join(__dirname, "..", "..", "..", "dist", "cli.js");
133
134
  if (existsSync(bundledCli)) return bundledCli;
135
+
136
+ // Try npm global install paths
137
+ const npmGlobalPaths = [
138
+ join(homedir(), "AppData", "Roaming", "npm", "node_modules", "@phi-code-admin", "phi-code", "dist", "cli.js"), // Windows
139
+ join(homedir(), ".npm-global", "lib", "node_modules", "@phi-code-admin", "phi-code", "dist", "cli.js"), // Linux custom
140
+ "/usr/local/lib/node_modules/@phi-code-admin/phi-code/dist/cli.js", // Linux/Mac default
141
+ "/usr/lib/node_modules/@phi-code-admin/phi-code/dist/cli.js", // Some Linux
142
+ ];
143
+ for (const p of npmGlobalPaths) {
144
+ if (existsSync(p)) return p;
145
+ }
146
+
147
+ // Try `which phi` (Linux/Mac) or `where phi` (Windows)
134
148
  try {
135
- const which = require("child_process").execSync("which phi 2>/dev/null", { encoding: "utf-8" }).trim();
136
- if (which) return which;
149
+ const isWin = process.platform === "win32";
150
+ const cmd = isWin ? "where" : "which";
151
+ const result = require("child_process").execSync(`${cmd} phi 2>${isWin ? "NUL" : "/dev/null"}`, { encoding: "utf-8" }).trim();
152
+ if (result) {
153
+ const firstLine = result.split("\n")[0].trim();
154
+ // On Windows, `where phi` returns the .cmd shim; we need the actual JS
155
+ if (isWin && firstLine.endsWith(".cmd")) {
156
+ const npmPrefix = require("child_process").execSync("npm prefix -g", { encoding: "utf-8" }).trim();
157
+ const jsPath = join(npmPrefix, "node_modules", "@phi-code-admin", "phi-code", "dist", "cli.js");
158
+ if (existsSync(jsPath)) return jsPath;
159
+ }
160
+ return firstLine;
161
+ }
137
162
  } catch { /* not in PATH */ }
163
+
138
164
  return "npx";
139
165
  }
140
166
 
@@ -292,7 +318,9 @@ export default function orchestratorExtension(pi: ExtensionAPI) {
292
318
  const totalTasks = tasks.length;
293
319
  let wave = 1;
294
320
 
321
+ const phiBinPath = findPhiBinary();
295
322
  notify(`🚀 Executing ${totalTasks} tasks with sub-agents (parallel mode)...`, "info");
323
+ notify(`📍 Phi binary: \`${phiBinPath}\``, "info");
296
324
 
297
325
  // Execute in waves — each wave runs independent tasks in parallel
298
326
  while (completed.size + failed.size < totalTasks) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phi-code-admin/phi-code",
3
- "version": "0.60.8",
3
+ "version": "0.60.9",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "piConfig": {