Repository navigation
Add Pi package - #28
dora-dotcom wants to merge 3 commits into
Conversation
pi/: @simular-ai/box-pi. A small extension registers the box MCP server with Pi's built-in MCP (Pi 0.99+); sign in once with /mcp login box. The box skill copy uses Pi's tool names. Published to npm; pi.dev lists it through the pi-package keyword. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@chenchenSimular this one is ready for review too. Tested that it installs and loads on Pi 1.5.0 and registers box; I didn't run a real sign-in in Pi. After merge it needs an npm publish from pi/ under @simular-ai - your npm access, or I can add a publish workflow like publish-cli.yml if you prefer. thanks! |
chenchenSimular
left a comment
There was a problem hiding this comment.
Thanks Dora. The extension API checks out against Pi's docs (registerMcpServer with url/exposure/toolExposure, the pi key and pi-package keyword, pi install npm:). Requesting changes for:
pi/README.md:11: drop the shellpi mcp login box. Pi's docs say "pi mcpshell commands do not load extensions and only see file-configured servers", so it won't findbox. Keep only/mcp login boxinside a session.- Untested sign-in. Pi signs in with its own client ID document (
https://pi.dev/oauth/client.json) and falls back to client registration. Please complete one real sign-in and one box tool call with Pi before merge, and note the result in the PR. - Publishing. Manual
npm publishdoesn't match how the repo releases. Add arelease-pi.ymlonpi-v*tags (check the tag matchespi/package.json, the commit is on main,environment: npm,id-token: write,npm publish --provenance --access public), and update the README's releasing line. The first version can go out by hand, then set up trusted publishing on npm, same as the CLI.
CI: no checks ran because pi/** isn't in publish-cli.yml's path filter. Add it, plus a plugins step with npm pack ./pi --dry-run (ideally also install a pinned @earendil-works/pi-coding-agent, pi install ./pi, and check box is registered).
Non-blocking: before Pi 0.99, pi.registerMcpServer doesn't exist and the extension throws. Guard it or state the minimum Pi version. A Pi client for connect can be a follow-up (in the Rust CLI).
|
@chenchenSimular thanks for the review! All five points are in (f89f546):
|
chenchenSimular
left a comment
There was a problem hiding this comment.
Thanks, most of my earlier comments are addressed (the shell login line, release-pi.yml, the CI path filter and Pi step, and the version guard). A few things left before merge:
- Root
README.md:28still says "thennpm publishfrompi/". Please point it at the new tag-based release (pi-v*tag → release-pi.yml), same aspi/README.md. - The PR description still says "Not yet tested: the OAuth sign-in and a tool call" and that a manual publish is needed after merge. Your later comment says you tested
/mcp login boxand ascreenshotcall on Pi 1.5.0. Please update the description so it matches what was tested and how it will be released. - It conflicts with main in
README.md. Please rebase.
# Conflicts: # README.md
|
@chenchenSimular thanks, all three are in:
|
Why
Pi's package gallery (pi.dev/packages) lists any npm package with the
pi-packagekeyword, so publishing one puts box there with no review. Our CLI doesn't write Pi configs, so this is also the one-line install for Pi users.What
pi/: npm package@simular-ai/box-pi.extensions/box.tscallspi.registerMcpServer("box", …), so Pi's built-in MCP (Pi 0.99+) connects it with no extra adapter (pi-mcp-adapter picks it up too). On an older Pi withoutregisterMcpServerit logs a warning and adds nothing. Sign-in is/mcp login boxinside a session. Tools aredeferred, withshell,browser_navigate,browser_snapshot,screenshotandbox_statusdeclared directly. Theboxskill copy uses Pi's tool names and its sign-in command..github/workflows/release-pi.yml: api-vX.Y.Ztag on a commit on main, matchingpi/package.json, publishes to npm through trusted publishing with provenance and creates a GitHub release.publish-cli.yml:pi/**in the path filter. The Pi step packs the package, installs it into Pi (pinned incli/e2e/clients.json), and checks that/mcpreportsbox: needs sign-in.Release
npm only lets you set a trusted publisher on a package that already exists, so the first version is published once by hand from
pi/(npm publish --access public, needs npm access to@simular-ai). Then set the trusted publisher (reposimular-ai/box-plugin, workflowrelease-pi.yml, environmentnpm). Every later release is api-v*tag.Tested
On Pi 1.5.0 (
@earendil-works/pi-coding-agent, isolated agent dir, package installed from this branch):pi install ./piworks and the extension loads with no errors./mcp login boxopened box's consent page in the browser. After Allow,/mcpshowed box connected.mcp__box__screenshotand described what was on the box's screen (LibreOffice Calc with sales.ods open).🤖 Generated with Claude Code