What happened?
Related to #5108.
When embedding @earendil-works/pi-coding-agent into a bundled Node app, Pi reads package-adjacent metadata at runtime via getPackageDir() / getPackageJsonPath().
If the app bundles Pi into another entrypoint, Pi can try to read a package.json next to that bundled entrypoint, for example:
If that file is not present, startup fails with:
ENOENT: no such file or directory, open '.../dist/package.json'
Steps to reproduce
- Bundle an app that imports
@earendil-works/pi-coding-agent:
bun build src/file.ts --target node --outdir dist
-
Run the bundled entrypoint from a directory without package.json next to or above it.
-
Observe startup failing when Pi reads getPackageJsonPath().
Expected behavior
SDK embedding should not require package-adjacent files at import/startup time, or Pi should expose/document an explicit embedding configuration for package metadata and asset paths.
Version
No response
What happened?
Related to #5108.
When embedding
@earendil-works/pi-coding-agentinto a bundled Node app, Pi reads package-adjacent metadata at runtime viagetPackageDir()/getPackageJsonPath().If the app bundles Pi into another entrypoint, Pi can try to read a
package.jsonnext to that bundled entrypoint, for example:If that file is not present, startup fails with:
Steps to reproduce
@earendil-works/pi-coding-agent:Run the bundled entrypoint from a directory without
package.jsonnext to or above it.Observe startup failing when Pi reads
getPackageJsonPath().Expected behavior
SDK embedding should not require package-adjacent files at import/startup time, or Pi should expose/document an explicit embedding configuration for package metadata and asset paths.
Version
No response