pi-open-agents 0.1.19 → 0.1.20
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/package.json +1 -1
- package/src/subagent/executor.ts +18 -4
package/package.json
CHANGED
package/src/subagent/executor.ts
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
withFileMutationQueue,
|
|
16
16
|
} from "@earendil-works/pi-coding-agent";
|
|
17
17
|
import { spawn } from "node:child_process";
|
|
18
|
+
import { realpathSync } from "node:fs";
|
|
18
19
|
import * as fs from "node:fs/promises";
|
|
19
20
|
import * as os from "node:os";
|
|
20
21
|
import * as path from "node:path";
|
|
@@ -195,10 +196,23 @@ export function subagentSessionDir(
|
|
|
195
196
|
return path.join(agentDir, "sessions", safeProject, "subagents");
|
|
196
197
|
}
|
|
197
198
|
|
|
198
|
-
export function resolvePiEntryPoint(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
export function resolvePiEntryPoint(
|
|
200
|
+
resolveSelf: (specifier: string) => string = (specifier) => import.meta.resolve(specifier),
|
|
201
|
+
): PiResolution {
|
|
202
|
+
let packageEntryPoint: string;
|
|
203
|
+
try {
|
|
204
|
+
packageEntryPoint = fileURLToPath(resolveSelf("@earendil-works/pi-coding-agent"));
|
|
205
|
+
} catch {
|
|
206
|
+
// npm-distributed plugin + bundled pi: the loader resolves host imports
|
|
207
|
+
// through virtualModules, but import.meta.resolve falls back to native
|
|
208
|
+
// resolution which cannot see the host package from the plugin's install
|
|
209
|
+
// tree (peer dependencies are never installed next to it). Fall back to
|
|
210
|
+
// the running pi entry itself — the child must run the same pi anyway.
|
|
211
|
+
return {
|
|
212
|
+
command: process.execPath,
|
|
213
|
+
entryPoint: realpathSync(process.argv[1]),
|
|
214
|
+
};
|
|
215
|
+
}
|
|
202
216
|
const packageRoot = path.dirname(path.dirname(packageEntryPoint));
|
|
203
217
|
return {
|
|
204
218
|
command: process.execPath,
|