Skip to content

feat: add pi-mono support#111

Merged
wxtsky merged 1 commit intowxtsky:mainfrom
jjmartres:feat/pi-mono-support
Apr 23, 2026
Merged

feat: add pi-mono support#111
wxtsky merged 1 commit intowxtsky:mainfrom
jjmartres:feat/pi-mono-support

Conversation

@jjmartres
Copy link
Copy Markdown
Contributor

Summary

Add pi as a supported source.

Pi is a terminal-based AI coding agent built with Node.js. Integration uses the existing CodeIsland Unix socket hook-event protocol — no new protocol or app architecture changes are required.

How it works

A TypeScript extension (codeisland-pi.ts) runs inside pi and forwards lifecycle events to the CodeIsland socket, following the same hook_event_name convention as all other supported tools.

Pi event CodeIsland hook_event_name
session_start SessionStart
session_shutdown SessionEnd
before_agent_start UserPromptSubmit
tool_call (safe) PreToolUse
tool_call (dangerous bash) PermissionRequest (blocking via bridge)
tool_result PostToolUse
agent_end Stop
session_before_compact PreCompact
session_compact PostCompact

Changes

  • Sources/CodeIslandCore/SessionSnapshot.swift — add "pi" to supportedSources and displayName
  • Sources/CodeIsland/AppState.swift — add findPiPids() and route "pi" in findPids(forSource:)
  • Sources/CodeIsland/Resources/codeisland-pi.ts — the pi extension users install
  • Sources/CodeIsland/Resources/cli-icons/pi.png — placeholder icon (proper pixel mascot welcome as follow-up)

Installation (user side)

# Copy the extension to pi's auto-discovered extensions directory
cp codeisland-pi.ts ~/.pi/agent/extensions/codeisland.ts

# Reload inside pi
/reload

CodeIsland picks up pi sessions automatically — no further configuration needed.

Notes

  • pi.png is a placeholder; a proper pixel-art mascot can be contributed separately
  • ConfigInstaller auto-install support (like OpenCode) can be added as a follow-up once the core integration is validated

Add pi (https://github.com/badlogic/pi-mono) as a supported source.

Pi is a terminal-based AI coding agent. Integration is via a TypeScript
extension (codeisland-pi.ts) that forwards pi lifecycle events to the
CodeIsland Unix socket, following the same hook-event protocol as other
supported tools.

Changes:
- SessionSnapshot: add "pi" to supportedSources and displayName
- AppState: add findPiPids() and route "pi" in findPids(forSource:)
- Resources: add codeisland-pi.ts extension and pi.png icon placeholder

The extension maps pi events to CodeIsland hook_event_names:
  session_start          → SessionStart
  session_shutdown       → SessionEnd
  before_agent_start     → UserPromptSubmit
  tool_call (safe)       → PreToolUse
  tool_call (dangerous)  → PermissionRequest (blocking via bridge)
  tool_result            → PostToolUse
  agent_end              → Stop
  session_before_compact → PreCompact
  session_compact        → PostCompact

Installation: drop codeisland-pi.ts into ~/.pi/agent/extensions/ and
reload pi with /reload. No settings.json changes required.

Note: pi.png is a placeholder — a proper pixel mascot and icon can be
contributed as a follow-up.
@wxtsky wxtsky merged commit ed2dce4 into wxtsky:main Apr 23, 2026
@jjmartres jjmartres deleted the feat/pi-mono-support branch April 23, 2026 05:46
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.

2 participants