Skip to content

chore: migrate to @earendil-works pi packages (0.74.0)#15

Merged
dbachelder merged 1 commit into
mainfrom
chore/earendil-works-namespace
May 7, 2026
Merged

chore: migrate to @earendil-works pi packages (0.74.0)#15
dbachelder merged 1 commit into
mainfrom
chore/earendil-works-namespace

Conversation

@dbachelder

Copy link
Copy Markdown
Owner

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 to earendil-works/pi-mono.

Changes

  • Renamed peer deps in 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
  • Bumped peer-dep ranges from ^0.66.1^0.74.0.
  • Updated imports in extensions/btw.ts and tests/btw.runtime.test.ts.
  • Regenerated package-lock.json (drops the legacy @mariozechner/jiti fork — pi 0.73.1 switched to upstream jiti).
  • Updated the pi link in README.md to earendil-works/pi-mono.

API drift fix-ups (0.66.1 → 0.74.0)

  • codingTools value is gonecreateAgentSession({ tools }) is now a string[] of tool names. The BTW sub-session passes ["read","bash","edit","write"] explicitly so behaviour is unchanged.
  • SessionEntry is a strict discriminated unionCustomEntry.data is no longer reachable through bare indexed access. Switched the model/thinking override restore loop to the same (entry as unknown as { data?: T }).data pattern already used for BTW_RESET_TYPE / BTW_ENTRY_TYPE.
  • ExtensionContext.model is now Model<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 through ctx.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.
  • Test harness updated accordingly: options.tools is now string[]; the modelRegistry mock gained a find(provider, id) method backed by a registeredModels map (with the standard fast-provider/fast-model fixture pre-registered, and a harness.registerModel(...) helper for ad-hoc cases like the restores BTW override state from session history test).

Test plan

  • npm install (clean)
  • npx tsc -p tsconfig.json — no errors
  • npm test50/50 passing

Caveats

  • One semantic change worth flagging: /btw:model <provider> <id> <api> previously stored the user-supplied <api> verbatim. Now the resolved Model's api comes from the registry entry. In practice the registry's api is 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.

….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.
@dbachelder dbachelder merged commit 311f3fd into main May 7, 2026
1 check passed
@dbachelder dbachelder deleted the chore/earendil-works-namespace branch May 7, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant