fix(cli): restored legacy pi package root remaps

Added bundled root overrides for legacy pi package imports in compiled binaries and corrected fallback resolution to use canonical @oh-my-pi specifiers.

Fixes #1474
This commit is contained in:
roboomp
2026-05-28 13:00:25 +00:00
committed by can1357
parent 11da79a6bf
commit 82008e4f38
4 changed files with 77 additions and 30 deletions
+10 -9
View File
@@ -56,15 +56,16 @@ async function main(): Promise<void> {
"../stats/src/sync-worker.ts",
"./src/tools/browser/tab-worker-entry.ts",
"./src/eval/js/worker-entry.ts",
// Legacy pi-* extension compat shims served by `legacy-pi-compat.ts`.
// Both are reached only via the computed `TYPEBOX_SHIM_PATH` /
// `LEGACY_PI_AI_SHIM_PATH` constants (which `--compile`'s static
// analyzer cannot trace), so each shim must be listed here to land
// in bunfs alongside the workers above. The bunfs entry path is
// `--root`-relative with a `.js` extension, e.g.
// `/$bunfs/root/packages/coding-agent/src/extensibility/typebox.js`,
// which is what the `isCompiledBinary()` branch in
// `legacy-pi-compat.ts` resolves to at runtime.
// Legacy pi-* extension compat entrypoints served by
// `legacy-pi-compat.ts`. These are reached via computed bunfs paths
// (which `--compile`'s static analyzer cannot trace), so each must be
// listed here to land in bunfs at
// `/$bunfs/root/packages/<pkg>/<entry>.js`.
"../agent/src/index.ts",
"../natives/native/index.js",
"../tui/src/index.ts",
"../utils/src/index.ts",
"./src/index.ts",
"./src/extensibility/typebox.ts",
"./src/extensibility/legacy-pi-ai-shim.ts",
"--outfile",