Repository navigation
feat: support pi as a third host (package manifest + MCP extension) - #36
Merged
Merged
Conversation
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.
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.
pi has neither dsh's bundle mechanism nor Claude Code's plugin marketplace, so
pi install npm:dsh-deeptutorused 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: apimanifest naming.agents/skillsand the newpi/deeptutor.ts;piadded tofiles[];pi-packagekeyword 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 insrc/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.deeptutorskill now lists the tool name each host uses.Two deliberate parameters
exposure: "deferred"instead of pi's defaultcodemode. The four schemas total ~5.7 KB;deferredkeeps them out of every request until the model reaches for them withtool_search, then it calls them directly.timeout: 1800. pi's default is 60 s and this MCP server sends no progress notifications, while onedeep_solveturn routinely runs for minutes.The extension declares pi's
ExtensionAPIby 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_kbreturns all 11 knowledge bases. Also verified from a checkout with nolib/(launcher's src branch), thenpm packtarball, and a simulated npmnode_moduleslayout.npm run typecheck/npm test(93 tests) greennode scripts/check-dsh-compat.mjsstill passes on dsh 0.2.2-rc.5 — the dsh path is untouchedclaude plugin validate . --strictwas not run: noclaudeCLI on this machine..claude-plugin/is unchanged by this PR.