feat: parse Pi and Antigravity sessions (fixes #46)#172
Open
felipetruman wants to merge 1 commit into
Open
Conversation
Adds two external-harness collectors: - Pi (badlogic/pi-mono): JSONL sessions under ~/.pi/agent/sessions. Full fidelity — per-turn summed token usage incl. cache, model ids, tool calls, and edited/referenced file paths. - Antigravity (Google): per-conversation SQLite dbs under ~/.gemini/antigravity-cli/conversations, with step payloads stored as undocumented protobuf blobs. A minimal wire-format decoder reads the reverse-engineered fields (prompt/response text, tool calls, token usage, timestamps) defensively, so schema drift degrades to missing data instead of a crash. Workspace roots come from the sibling cache/last_conversations.json map. Requires node:sqlite (Node >= 22.5), skipped gracefully when unavailable.
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.
Description
Adds session parsers for two more agents, registered as external-harness collectors alongside Claude Code, Codex, and OpenCode:
Pi (badlogic/pi-mono)
~/.pi/agent/sessions/<encoded-cwd>/<timestamp>_<uuid>.jsonlcacheRead/cacheWrite, same convention as the Claude Code parser), model ids, tool calls, edited/referenced file paths, elapsed time, and workspace root from the session header'scwdAntigravity (Google)
~/.gemini/antigravity-cli/conversations/*.dbvia thenode:sqlitebuiltin (Node >= 22.5, skipped gracefully when unavailable — same approach as fix: parse OpenCode sessions from SQLite storage (opencode.db) #170)cache/last_conversations.jsonmapBoth harnesses are added to
EXTERNAL_HARNESS_SET,hasExternalHarnessSources(), and the extension's marketplace description.Related Issues
Fixes #46 — together with #170 (OpenCode SQLite storage), all three requested agents (antigravity, pi, opencode) now load.
Checklist
npm run checkpasses (typecheck + lint + spellcheck + knip + tests) — 1218 tests,tsc --noEmitclean, ESLint 0 errors and 0 new warnings in the parser files, cspell 0 issues, knip cleanparser-pi.test.ts: turn assembly, usage summing, no-request/no-usage sessions;parser-antigravity.test.ts: synthetic conversation db with hand-encoded protobuf payloads, plus a no-user-message db)Verification against real data
~/.piinstall; 377 requests carry token data; models, tools (bash,read,edit,write), and file paths resolve~/.gemini/antigravity-cliinstall; 212 requests carry token data, 200 carry response text; workspace roots resolve vialast_conversations.json; locked/empty databases are skipped without error