diff --git a/AGENTS.md b/AGENTS.md index efec9cf..4ab8fa6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,6 +33,8 @@ LICENSE # MIT. ## Conventions +- **Extension imports are coupled to the running pi version.** Extensions are loaded by jiti at runtime; their `import { ... } from "@earendil-works/pi-*"` statements resolve against whatever node_modules the running `pi` binary has bundled. **When extension imports change package names** (e.g. the 2026-05-09 rename from `@mariozechner/pi-*` to `@earendil-works/pi-*`), the host pi MUST be upgraded to the matching version *before or at the same time as* the import-rename push, otherwise users on the older pi see `Cannot find module '@earendil-works/...'` at extension load. Container path: bump `PI_VERSION` build-arg in opencode-devbox. Host path: `npm install -g @earendil-works/pi-coding-agent` (and `brew uninstall pi-coding-agent` if previously installed via brew at the old name). `bun build --external '*'` does NOT catch this regression — it only validates the bundle shape, not module resolution against the runtime pi's deps. Real test: run `pi --version` on the target system after the rename. + - **One `.ts` file per extension**, flat under `extensions/`. If an extension grows multiple files, use a subdirectory with an `index.ts` entry point — pi's auto-discovery handles both shapes.