fix(cli): routed legacy pi-coding-agent imports through a sibling shim

Listing the coding-agent's own ./src/index.ts as a bun --compile extra entrypoint silently breaks the CLI binary startup. Added a dedicated legacy-pi-coding-agent-shim.ts that re-exports the canonical barrel, registered the shim instead of the package index, and updated the compat resolver to point pi-coding-agent at the shim path.
This commit is contained in:
roboomp
2026-05-28 13:17:20 +00:00
committed by can1357
parent 92a2fd5b8f
commit 564b6d0f22
3 changed files with 33 additions and 4 deletions
@@ -60,14 +60,18 @@ async function main(): Promise<void> {
// `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`.
// `/$bunfs/root/packages/<pkg>/<entry>.js`. The coding-agent's own
// `./src/index.ts` is intentionally NOT listed: bun --compile silently
// breaks the CLI entry when the same package's barrel appears as an
// extra entrypoint (issue #1474), so legacy `pi-coding-agent` imports
// resolve through `legacy-pi-coding-agent-shim.ts` instead.
"../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",
"./src/extensibility/legacy-pi-coding-agent-shim.ts",
"--outfile",
"dist/omp",
],