feat: integrate pi as a first-class agent / pi 作为内置 Agent 接入 - #95
Merged
Merged
Conversation
- Add PiHookInstaller: drops a TS extension into ~/.pi/agent/extensions/ that forwards pi lifecycle events (session_start, agent_start, tool_call, tool_result, agent_end, agent_settled, session_before_compact) to Glint's Unix socket, mapping ask_user_question / exit_plan_mode to needsReply. Auto-discovered by pi on every session — no settings merge needed, and only fires when Glint's pane env vars are present. - Add PaneAgentKind.pi case across the enum, iconKind, restore-command, and agentKind(named:) matchers (exact 'pi' string match to avoid false-positives on pipe/pip/copy). - Wire WorkspaceStore: piHooksInstalled state, install/uninstall methods, auto-install spec entry, restorePiSession toggle (pi --session-id <id>). - Add Pi SettingsCard in SettingsView with install/uninstall controls. - Localize new UI strings (en + zh-Hans).
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.
What
Integrate the
piCLI coding agent (@earendil-works/pi-coding-agent) as a first-class agent in Glint, alongside Claude / Codex / OMP / Grok.Why
pi is a node-based CLI agent with its own TypeScript extension API. Like OMP/Grok, it exposes lifecycle events through extensions rather than shell hooks, so it needs the same "drop a TS extension + auto-discover" treatment as the other TS-based agents.
How
glint-agent-bridge.ts) into~/.pi/agent/extensions/(pi's global auto-discovery dir). The extension forwards pi lifecycle events → Glint's Unix socket:session_start/agent_start/agent_end/agent_settled→ idle/thinkingtool_call/tool_result→ running/thinkingsession_before_compact→ compactingask_user_question/exit_plan_modetool calls → needsReplypi --session-id <id>, falls back topi --continue), andagentKind(named:)matcher using exact"pi"string match (avoids false-positives onpipe/pip/copy).piHooksInstalledpublished state, install/uninstall methods, auto-install spec,restorePiSessiontoggle.en+zh-Hans.Checklist
PaneAgentKind.picase added to all exhaustive switchesPiHookInstallerfollows the same pattern asOmpHookInstaller/GrokHookInstallercontains)en+zh-Hans