Skip to content

feat: support pi as a third host (package manifest + MCP extension) - #36

Merged
TecFancy merged 1 commit into
developmentfrom
feat/pi-agent-support
Nov 20, 2026
Merged

TecFancy merged 1 commit into
developmentfrom
feat/pi-agent-support

Conversation

@TecFancy

Copy link
Copy Markdown
Owner

pi has neither dsh's bundle mechanism nor Claude Code's plugin marketplace, so pi install npm:dsh-deeptutor used to install the package and load nothing: pi looks for convention directories (skills/, extensions/), and our skills live in dot-prefixed .agents/skills.

What changed

  • package.json: a pi manifest naming .agents/skills and the new pi/deeptutor.ts; pi added to files[]; pi-package keyword so the package is eligible for the pi gallery; ./pi/* export.
  • pi/deeptutor.ts (new, ~30 lines): a thin host adapter that registers the same MCP server the Claude Code plugin runs (scripts/mcp-launch.mjs), so the tools stay defined once in src/tools.ts — the architecture rule in AGENTS.md.
  • tests/pi-extension.test.ts: pins the manifest, the referenced paths, the tarball contents and the registration.
  • tests/mcp-launch.test.ts: spawns the launcher and speaks MCP over stdio; also catches non-protocol lines on stdout.
  • Docs: README / README.zh / AGENTS.md / skill README name pi as a host; the deeptutor skill now lists the tool name each host uses.

Two deliberate parameters

  • exposure: "deferred" instead of pi's default codemode. The four schemas total ~5.7 KB; deferred keeps them out of every request until the model reaches for them with tool_search, then it calls them directly.
  • timeout: 1800. pi's default is 60 s and this MCP server sends no progress notifications, while one deep_solve turn routinely runs for minutes.

The extension declares pi's ExtensionAPI by hand rather than importing @earendil-works/pi-coding-agent: that package unpacks to ~24 MB, which would slow every CI run as a devDependency, and a peerDependency on it would make npm auto-install pi for every dsh user. The package stays free of runtime dependencies.

Verification

Installed into scratch projects and run against pi 1.3.0: both skills load and deeptutor_kb returns all 11 knowledge bases. Also verified from a checkout with no lib/ (launcher's src branch), the npm pack tarball, and a simulated npm node_modules layout.

  • npm run typecheck / npm test (93 tests) green
  • node scripts/check-dsh-compat.mjs still passes on dsh 0.2.2-rc.5 — the dsh path is untouched
  • claude plugin validate . --strict was not run: no claude CLI on this machine. .claude-plugin/ is unchanged by this PR.

pi has neither dsh's bundle mechanism nor Claude Code's plugin marketplace, so
`pi install npm:dsh-deeptutor` used to install the package and load nothing:
pi looks for the convention directories skills/ and extensions/, and our skills
live in dot-prefixed .agents/skills.

- package.json: add a `pi` manifest naming .agents/skills and the new
  pi/deeptutor.ts, ship `pi` in files[], and add the pi-package keyword so the
  package is eligible for the pi gallery.
- pi/deeptutor.ts: a thin host adapter that registers the same MCP server the
  Claude Code plugin runs (scripts/mcp-launch.mjs), so the tools stay defined
  once in src/tools.ts. Registers with `deferred` exposure — the four schemas
  would otherwise sit in every request — and a 30-minute timeout, because one
  deep_solve turn outlives pi's 60-second default.
- The extension types pi's ExtensionAPI by hand: importing the host package
  would add ~24MB to devDependencies and a peer dependency on it would make
  npm auto-install pi for dsh users. The package stays dependency-free.
- tests: pi-extension.test.ts pins the manifest, the existing file paths, the
  tarball contents and the registration; mcp-launch.test.ts spawns the launcher
  and speaks MCP over stdio, which also catches non-protocol lines on stdout.
- Docs: README/README.zh/AGENTS/skill README now name pi as a host, and the
  deeptutor skill lists the tool names each host uses (dsh bare, pi
  mcp__deeptutor__*, Claude Code mcp__plugin_*).

Verified by installing into a scratch project and running pi 1.3.0 against it:
both skills load and deeptutor_kb returns the 11 knowledge bases. Local
checkout without lib/, npm-pack tarball and a fake npm node_modules layout all
load too; the dsh compat probe still passes.
@TecFancy
TecFancy merged commit 19c33c2 into development Nov 20, 2026
2 checks passed
@TecFancy
TecFancy deleted the feat/pi-agent-support branch November 20, 2026 09:08
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