feat: add Pi as first-class Mosaic runtime #339

Merged
jason.woltje merged 1 commits from feat/pi-runtime-integration into main 2026-04-01 17:02:23 +00:00
Owner

Summary

Adds Pi (@mariozechner/pi-coding-agent) as a native runtime alongside Claude, Codex, and OpenCode. This enables mosaic pi and mosaic yolo pi as first-class launch commands, with full framework contract injection, skill loading, and lifecycle hooks.

Motivation

Pi is already embedded in the gateway (@mariozechner/pi-coding-agent ~0.57.1) and MACP plugin (@mariozechner/pi-agent-core). Making it a first-class launcher runtime enables standalone Mosaic usage without the full gateway/database stack — just Pi + ~/.config/mosaic/.

Pi is also the cleanest integration target:

  • --append-system-prompt for native contract injection (no config-file-write workarounds)
  • --skill for native Mosaic skill discovery (SKILL.md format compatible)
  • --extension for TypeScript lifecycle hooks (replaces bash shims)
  • No permission restrictions (yolo = normal mode)
  • Model-agnostic (Anthropic, OpenAI, Google, Ollama, custom)

Changes

Monorepo (@mosaic/mosaic)

  • types.ts — Add 'pi' to RuntimeName union
  • runtime/detector.ts — Add Pi to RUNTIME_DEFS (command: pi, version: --version)
  • runtime/installer.ts — Add pi: 'Pi' label
  • runtime/mcp-config.ts — Add configurePiMcp() targeting ~/.pi/agent/settings.json
  • stages/runtime-setup.ts — Add 'pi' to wizard runtime scan list

Local Install (~/.config/mosaic/) — applied separately

  • runtime/pi/RUNTIME.md — Pi runtime contract
  • runtime/pi/mosaic-extension.ts — Pi extension (session lifecycle, mission detection, /mosaic-status command)
  • bin/mosaiclaunch_pi(), yolo pi, coord --pi, prdy --pi
  • adapters/pi.md — Pi adapter documentation
  • AGENTS.md — Pi added to runtime load order

Usage

mosaic pi                          # Interactive session with full framework
mosaic pi "Fix the auth bug"       # With initial prompt
mosaic yolo pi                     # Identical to mosaic pi
mosaic coord --pi run              # Coordinator-driven session
mosaic prdy --pi init              # PRD creation via Pi

Testing

  • pnpm --filter @mosaic/mosaic typecheck — clean
  • pnpm --filter @mosaic/mosaic build — clean
  • Full monorepo typecheck (22 packages) — all passed
  • Full monorepo lint (22 packages) — all passed
  • Shell syntax validation (bash -n) — clean
  • Launcher dry-run: runtime contract, extension, 5 skills all resolved
  • Manual test: mosaic pi launches successfully with framework injected
## Summary Adds Pi (`@mariozechner/pi-coding-agent`) as a native runtime alongside Claude, Codex, and OpenCode. This enables `mosaic pi` and `mosaic yolo pi` as first-class launch commands, with full framework contract injection, skill loading, and lifecycle hooks. ## Motivation Pi is already embedded in the gateway (`@mariozechner/pi-coding-agent` ~0.57.1) and MACP plugin (`@mariozechner/pi-agent-core`). Making it a first-class launcher runtime enables standalone Mosaic usage without the full gateway/database stack — just Pi + `~/.config/mosaic/`. Pi is also the cleanest integration target: - `--append-system-prompt` for native contract injection (no config-file-write workarounds) - `--skill` for native Mosaic skill discovery (SKILL.md format compatible) - `--extension` for TypeScript lifecycle hooks (replaces bash shims) - No permission restrictions (yolo = normal mode) - Model-agnostic (Anthropic, OpenAI, Google, Ollama, custom) ## Changes ### Monorepo (`@mosaic/mosaic`) - `types.ts` — Add `'pi'` to `RuntimeName` union - `runtime/detector.ts` — Add Pi to `RUNTIME_DEFS` (command: `pi`, version: `--version`) - `runtime/installer.ts` — Add `pi: 'Pi'` label - `runtime/mcp-config.ts` — Add `configurePiMcp()` targeting `~/.pi/agent/settings.json` - `stages/runtime-setup.ts` — Add `'pi'` to wizard runtime scan list ### Local Install (`~/.config/mosaic/`) — applied separately - `runtime/pi/RUNTIME.md` — Pi runtime contract - `runtime/pi/mosaic-extension.ts` — Pi extension (session lifecycle, mission detection, `/mosaic-status` command) - `bin/mosaic` — `launch_pi()`, yolo pi, coord --pi, prdy --pi - `adapters/pi.md` — Pi adapter documentation - `AGENTS.md` — Pi added to runtime load order ## Usage ```bash mosaic pi # Interactive session with full framework mosaic pi "Fix the auth bug" # With initial prompt mosaic yolo pi # Identical to mosaic pi mosaic coord --pi run # Coordinator-driven session mosaic prdy --pi init # PRD creation via Pi ``` ## Testing - [x] `pnpm --filter @mosaic/mosaic typecheck` — clean - [x] `pnpm --filter @mosaic/mosaic build` — clean - [x] Full monorepo typecheck (22 packages) — all passed - [x] Full monorepo lint (22 packages) — all passed - [x] Shell syntax validation (`bash -n`) — clean - [x] Launcher dry-run: runtime contract, extension, 5 skills all resolved - [x] Manual test: `mosaic pi` launches successfully with framework injected
jason.woltje added 1 commit 2026-04-01 17:01:18 +00:00
feat: add Pi as first-class Mosaic runtime
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
343f32033d
Add Pi (pi-coding-agent) as a native runtime alongside Claude, Codex,
and OpenCode in the Mosaic installation wizard and launcher.

Monorepo changes (@mosaic/mosaic):
- Add 'pi' to RuntimeName union type
- Add Pi to runtime detector (command: pi, --version flag)
- Add Pi label to runtime installer
- Add configurePiMcp() for ~/.pi/agent/settings.json MCP config
- Add 'pi' to wizard runtime scan list

Local install (~/.config/mosaic/) changes applied separately:
- runtime/pi/RUNTIME.md — Pi runtime contract
- runtime/pi/mosaic-extension.ts — Pi extension (lifecycle hooks,
  mission detection, session lock, /mosaic-status command)
- bin/mosaic — launch_pi(), yolo pi, coord --pi, prdy --pi
- adapters/pi.md — Pi adapter documentation
- AGENTS.md — Pi added to runtime load order
- skills/ — symlinked monorepo skills for launcher discovery

Pi integration notes:
- mosaic pi and mosaic yolo pi are identical (Pi has no permission
  restrictions)
- Runtime contract injected via --append-system-prompt (native flag)
- Mosaic skills loaded via --skill flags (native Pi skill discovery)
- Extension loaded via --extension for session lifecycle hooks
- Pi native thinking levels replace sequential-thinking MCP gate
- Model-agnostic: works with any provider configured in Pi settings
jason.woltje merged commit be74ca3cf9 into main 2026-04-01 17:02:23 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#339