chore: migrate to @earendil-works pi packages (0.74.0)#15
Merged
Conversation
….74.0) Per the 2026-05-07 announcement, pi packages on npm moved from the @mariozechner scope to @earendil-works, and the upstream repo is now github.com/earendil-works/pi-mono. Changes: - Renamed @mariozechner/pi-{ai,coding-agent,tui} -> @earendil-works/pi-* in extensions/btw.ts, tests/btw.runtime.test.ts, and package.json. - Bumped peer-dep ranges from ^0.66.1 to ^0.74.0 (matches the latest pi release and the new namespace's first published version). - Regenerated package-lock.json (drops @mariozechner/jiti in favour of upstream jiti, which pi 0.73.1 switched to). - Adapted to API drift between 0.66.1 and 0.74.0: * SDK no longer exports the codingTools value. createAgentSession({ tools }) now takes a string[] of tool names; the BTW sub-session passes ["read","bash","edit","write"] explicitly so behaviour is unchanged. * SessionEntry is now a strict discriminated union; CustomEntry.data accesses use the (entry as unknown as { data?: T }).data pattern consistently (matching the pre-existing BTW_RESET_TYPE / BTW_ENTRY_TYPE sites). * ExtensionContext.model is now a full pi-ai Model<any>. /btw:model <provider> <id> <api> still parses to a loose ref but is now resolved through ctx.modelRegistry.find(provider, id) before being stored as the override; restoreThread() does the same lookup on session reload and drops the override if the model is no longer in the registry. * Test harness updated: options.tools is now string[]; modelRegistry mock gained a find(provider, id) method backed by a registeredModels map (with the standard fast-provider/fast-model fixture pre-registered and harness.registerModel(...) for ad-hoc cases). Verified: - npx tsc -p tsconfig.json passes (no errors). - npm test -> 50 tests passing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Migrates this extension from the
@mariozechner/*npm scope to@earendil-works/*per Mario Zechner's 2026-05-07 announcement — pi 0.74.0 ships under the new namespace, and the upstream repo moved toearendil-works/pi-mono.Changes
package.json:@mariozechner/pi-ai→@earendil-works/pi-ai@mariozechner/pi-coding-agent→@earendil-works/pi-coding-agent@mariozechner/pi-tui→@earendil-works/pi-tui^0.66.1→^0.74.0.extensions/btw.tsandtests/btw.runtime.test.ts.package-lock.json(drops the legacy@mariozechner/jitifork — pi 0.73.1 switched to upstreamjiti).README.mdtoearendil-works/pi-mono.API drift fix-ups (0.66.1 → 0.74.0)
codingToolsvalue is gone —createAgentSession({ tools })is now astring[]of tool names. The BTW sub-session passes["read","bash","edit","write"]explicitly so behaviour is unchanged.SessionEntryis a strict discriminated union —CustomEntry.datais no longer reachable through bare indexed access. Switched the model/thinking override restore loop to the same(entry as unknown as { data?: T }).datapattern already used forBTW_RESET_TYPE/BTW_ENTRY_TYPE.ExtensionContext.modelis nowModel<any>(full pi-ai shape, not the loose{provider,id,api}triple)./btw:model <provider> <id> <api>still parses to a loose ref but now resolves throughctx.modelRegistry.find(provider, id)before being stored as the override.restoreThread()does the same lookup on session reload and silently drops the override if the model is no longer in the registry.options.toolsis nowstring[]; themodelRegistrymock gained afind(provider, id)method backed by aregisteredModelsmap (with the standardfast-provider/fast-modelfixture pre-registered, and aharness.registerModel(...)helper for ad-hoc cases like therestores BTW override state from session historytest).Test plan
npm install(clean)npx tsc -p tsconfig.json— no errorsnpm test— 50/50 passingCaveats
/btw:model <provider> <id> <api>previously stored the user-supplied<api>verbatim. Now the resolved Model'sapicomes from the registry entry. In practice the registry'sapiis the correct one anyway (it's part of the model's identity), but if anyone was relying on overriding the api at the slash-command level, that no longer works. The CLI grammar itself is unchanged so existing scripts won't break — they'll just resolve to whatever the registry says.