feat: add Pi agent support - #75
Conversation
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
Add parser, frontend rendering, and export support for Pi (Anthropic internal agent) sessions. Includes session discovery, tool call enrichment, intent normalization, indigo accent color, and FTS indexing.
|
I am working on this now, I'll rebase and push fixes and get this merged soon |
…r Pi Emit [Thinking] and tool-use markers inline in Content for Pi assistant messages, matching the pattern used by Claude and Amp parsers. This preserves block order, fixes export/FTS for tool-only messages, and ensures thinking text is indexed. - Add Pi lowercase tool names (read, write, edit, bash, find, str_replace, run_command, read_file) to formatToolUse - Add formatPiToolUse helper that maps Pi's "arguments" field to "input" and delegates to formatToolUse - Emit [Thinking]/[/Thinking] and tool markers in parsePiAssistantMessage preserving block order - Export IsPiSessionFile and add header validation in watcher-driven sync (classifyOnePath) to reject non-Pi .jsonl files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
roborev: Combined Review (
|
Pi payloads may use path or filePath instead of file_path. Add resolveFilePath helper with fallback chain (file_path -> path -> filePath) and apply it to the read, read_file, write, edit, and str_replace cases in formatToolUse. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
formatPiToolUse was receiving the raw arguments before intent normalization, so agent__intent wasn't renamed to description for the Bash description line. Use the post-normalization argsRaw instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add regression test confirming that agent__intent is renamed to description before formatPiToolUse renders the Bash description line. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
thanks! |
## Summary - Add Pi as a supported agent with JSONL session parsing, file discovery, sync, and frontend display - Parse Pi session files: user messages, assistant messages with thinking blocks and tool calls, tool results - Emit thinking and tool-use markers inline in Content (matching Claude/Amp pattern) so export, FTS, and block ordering work correctly - Validate Pi session headers during both bulk discovery and watcher-driven sync ## Backend (Go) - Pi JSONL parser with V1/V2 session support and `branchedFrom` parent linking - File discovery (`DiscoverPiSessions`, `FindPiSourceFile`) registered in the agent registry with `IDPrefix: "pi:"`, following the Amp pattern - Lowercase Pi tool names (`read`, `write`, `edit`, `bash`, `find`, `str_replace`, `run_command`, `read_file`) mapped to standard display format - `formatPiToolUse` bridges Pi's `arguments` field to the shared `formatToolUse` logic - `IsPiSessionFile` header validation in both bulk discovery and watcher sync - `normalizePiIntent` rewrites Pi's `agent__intent`/`_i` fields to `description` - Export support for Pi sessions ## Frontend (Svelte/TS) - Pi agent badge with teal accent - Tool call display for Pi's lowercase tool aliases and edit format (`edits[]` array variants) - Content parser support for Pi tool patterns - `agent__intent` and `_i` filtered from displayed tool parameters Addresses kenn-io#68 --------- Co-authored-by: Wes McKinney <wesmckinn+git@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Backend (Go)
branchedFromparent linkingDiscoverPiSessions,FindPiSourceFile) registered in the agent registry withIDPrefix: "pi:", following the Amp patternread,write,edit,bash,find,str_replace,run_command,read_file) mapped to standard display formatformatPiToolUsebridges Pi'sargumentsfield to the sharedformatToolUselogicIsPiSessionFileheader validation in both bulk discovery and watcher syncnormalizePiIntentrewrites Pi'sagent__intent/_ifields todescriptionFrontend (Svelte/TS)
edits[]array variants)agent__intentand_ifiltered from displayed tool parametersAddresses #68