Before submitting
Problem
gentle-pi@3.7.0 declares @earendil-works/pi-tui in dependencies:
"dependencies": {
"@earendil-works/pi-tui": "0.85.1",
"@heyhuynhgiabuu/pi-pretty": "0.6.27"
},
"peerDependencies": {
"@earendil-works/pi-coding-agent": ">=0.85.1",
"typebox": "*"
}
pi-tui is a host-provided module: the Pi installation always supplies it, and this package already peer-declares pi-coding-agent for exactly the same reason. Declaring it as a hard dependency gives npm a legal reason to install a second copy into the extension tree, and Pi's extension loader reports it on every startup:
Warning: Extension package "<npm-root>/node_modules/gentle-pi/package.json":
Host-provided extension packages must be declared in peerDependencies with a "*"
range, not dependencies: @earendil-works/pi-tui. Installed copies can bypass the
extension loader and create duplicate runtime modules.
The duplicate is not inert — it shadows the host's copy at import time, and the two copies are different versions:
| module |
resolved from gentle-pi |
host copy |
@earendil-works/pi-tui |
0.85.1 |
0.99.0 |
The package imports pi-tui directly in roughly 20 modules (extensions/gentle-ai.ts:33, the other extensions under extensions/, and lib/agents-view.ts, lib/shell-bar.ts, lib/native-choice-list.ts, lib/questionnaire/questionnaire-view.ts, lib/review-consent-component.ts). Symbols crossing that boundary — Key constants, matchesKey, KeybindingsManager, truncateToWidth — come from a different module instance than the one rendering the UI, which is precisely the duplicate-runtime-module failure the warning describes.
Steps to reproduce
- Install
gentle-pi@3.7.0 into a Pi npm extension tree (~/.pi/agent/npm).
- Start Pi.
- Observe the
Host-provided extension packages ... @earendil-works/pi-tui warning on stderr.
- Confirm that bare imports resolve the duplicate, not the host copy:
$ cd ~/.pi/agent/npm/node_modules/gentle-pi
$ node -e "console.log(require.resolve('@earendil-works/pi-tui'))"
<npm-root>/node_modules/@earendil-works/pi-tui/dist/index.js
$ node -e "console.log(require(require.resolve('@earendil-works/pi-tui/package.json')).version)"
0.85.1
$ node -e "console.log(require('<pi-install-root>/node_modules/@earendil-works/pi-tui/package.json').version)"
0.99.0
Expected and actual behavior
Expected: @earendil-works/pi-tui is declared in peerDependencies with a "*" range and never in dependencies — exactly how this package already declares typebox. npm installs no second copy, the host's pi-tui is the only one in the module graph, and the loader emits no warning.
Actual: npm installs @earendil-works/pi-tui@0.85.1 into the extension tree, it shadows the host's 0.99.0 copy for every bare import in the package, and the extension loader emits the duplicate-runtime-module warning on every startup.
gentle-pi version
3.7.0 (npm view gentle-pi version -> 3.7.0)
Pi version
0.99.0
Operating system
Windows
Relevant logs or error output (optional)
Warning: Extension package "<npm-root>/node_modules/gentle-pi/package.json": Host-provided extension packages must be declared in peerDependencies with a "*" range, not dependencies:
@earendil-works/pi-tui. Installed copies can bypass the extension loader and create duplicate runtime modules.
Before submitting
Problem
gentle-pi@3.7.0declares@earendil-works/pi-tuiindependencies:pi-tuiis a host-provided module: the Pi installation always supplies it, and this package already peer-declarespi-coding-agentfor exactly the same reason. Declaring it as a hard dependency gives npm a legal reason to install a second copy into the extension tree, and Pi's extension loader reports it on every startup:The duplicate is not inert — it shadows the host's copy at import time, and the two copies are different versions:
gentle-pi@earendil-works/pi-tuiThe package imports pi-tui directly in roughly 20 modules (
extensions/gentle-ai.ts:33, the other extensions underextensions/, andlib/agents-view.ts,lib/shell-bar.ts,lib/native-choice-list.ts,lib/questionnaire/questionnaire-view.ts,lib/review-consent-component.ts). Symbols crossing that boundary —Keyconstants,matchesKey,KeybindingsManager,truncateToWidth— come from a different module instance than the one rendering the UI, which is precisely the duplicate-runtime-module failure the warning describes.Steps to reproduce
gentle-pi@3.7.0into a Pi npm extension tree (~/.pi/agent/npm).Host-provided extension packages ... @earendil-works/pi-tuiwarning on stderr.Expected and actual behavior
Expected:
@earendil-works/pi-tuiis declared inpeerDependencieswith a"*"range and never independencies— exactly how this package already declarestypebox. npm installs no second copy, the host'spi-tuiis the only one in the module graph, and the loader emits no warning.Actual: npm installs
@earendil-works/pi-tui@0.85.1into the extension tree, it shadows the host's 0.99.0 copy for every bare import in the package, and the extension loader emits the duplicate-runtime-module warning on every startup.gentle-pi version
3.7.0 (
npm view gentle-pi version-> 3.7.0)Pi version
0.99.0
Operating system
Windows
Relevant logs or error output (optional)