№ 0595Skill
pi-muse-code MSP provider
Pi extension that registers a muse-code provider through @muse-code/sdk over the Muse Session Protocol, resuming the same Muse session when switching models mid-conversation.
pi-muse-code
Pi extension that registers a muse-code model provider backed by the
Muse Code agent, through the TypeScript SDK@muse-code/sdk over
MSP (the Muse Session Protocol) against a long-lived muse serve host.
Switching models mid-session (e.g. grok → muse → grok) resumes the same
muse session instead of re-sending the whole conversation as text on
every turn.
Uses your local muse CLI login, not the Muse OAuth API.
Requirements
- Pi 0.85.1 (verified; other 0.8x versions likely work)
- Node 20 or newer (the MSP SDK's floor)
- The
museCLI onPATH(orPI_MUSE_BINARYpointing at it), logged in.
The SDK drives it asmuse serve. Muse 1.3.x pairs with SDK 1.3.x; a
protocol-fingerprint mismatch is a warning, not a failure. - No
pi-muse-bridgealongside this package; remove it if installed
(pi remove npm:pi-muse-bridge) to avoid two extensions registering the
samemuse-codeprovider id.
Install
# from source (until published)
npm install # pulls @muse-code/sdk for the extension
pi install ~/pi-muse-code
# or after cloning your fork
pi install git:github.com/zereight/pi-muse-code
Then reload the running Pi session:
/reload
Behavior
- Registers the
muse-codeprovider directly (pi.registerProvider("muse-code", ...)),
with models read from Muse's local model catalog. - One
muse servehost per Pi process (src/host.ts), spawned lazily on
the firstmuse-codeturn and shut down onsession_shutdown. Turns areturn/startcommands on an open session, so a turn pays no process spawn
or handshake. - One muse session per Pi conversation, keyed by the Pi session file. Its
muse session id is written to~/.pi/agent/muse-code-sessions/<hash>so a Pi
restart (or/resumeof an old conversation) resumes the same muse session
instead of starting cold. A marker that no longer resolves — pruned log, orsessionInUsefrom another live host — falls back to a fresh session. - The first
muse-codeturn of a fresh session folds the full prior Pi
conversation (other models included) into the prompt, since there's nothing
to resume yet. Every later turn sends the newest user message plus a
catch-up of the turns other models ran since muse last answered
(buildCatchUpPrompt), so grok → muse → grok → mus



ChatForm
Tgmlabs