Repository navigation
feat: add Cline parser - #68
Aryan1092raj wants to merge 14 commits into
Conversation
EntelligenceAI PR SummaryAdds Cline to agent discovery and session viewing, reading conversations from flowchart TD
classDef newBehavior fill:#dcfce7,stroke:#16a34a,color:#14532d;
A["Cline session files"] --> B["Discover and index sessions"]
A --> C["Read sibling metadata for cwd"]
B --> D["Parse messages and pair tool results"]
C --> D
D --> E["Build session spans and tool events"]
E --> F["List and view Cline sessions"]
class A,B,C,D,E,F newBehavior;
Review Scorecard
Safe to merge with a low blast radius; code quality rated Excellent (5/5): the review found nothing to flag. Key Findings:
Evaluated against
|
WalkthroughAdds end-to-end support for ingesting Cline coding-agent sessions, from configurable home discovery and session indexing through parsing and tool classification. Documents the supported source and adds fixtures and tests for parsing, event generation, metadata propagation, and error handling. ChangesFiles
Documents Cline session locations, parsing and error behavior, and the Files
Adds the Cline agent type and exports a parser that builds session, turn, and tool spans with timestamps, token usage, metadata, and edit evidence. Local source discovery indexes valid Cline sessions, excludes spawned-agent files, propagates metadata-derived working directories, and uses Cline tool aliases to normalize tools for downstream classification. Files
Adds sanitized session fixtures covering image input, file reads and edits, searches, multi-command shell calls, tool failures, timestamps, model metadata, and token metrics. Files
Adds parser, source integration, and taxonomy coverage for span structure, tool normalization, shell command status and timing, token accounting, malformed input, event generation, redaction, discovery, metadata propagation, and failure handling. |
Summary
Adds a Cline parser, so
agentplay agentslists Cline andagentplay viewshows its sessions. Closes #23.The issue points at
globalStorage/saoudrizwan.claude-dev/tasks/<id>/api_conversation_history.json. Current Cline keeps sessions in~/.cline/data/sessions/<id>/instead, for the CLI and the VS Code extension alike (the session metadata recordssource: "cli"or"vscode"). On my machine the oldtasks/folder holds onlysettings.json. I could check only the new layout against real data, so the old one is not supported.parsers/ +├── cline.py # <id>.messages.json -> Session, Turn and tool spans _sources/local/ ├── source.py # + _index_cline_file: <home>/data/sessions/*/<id>.messages.json, │ # cwd from the sibling <id>.json tool_taxonomy.py # + _CLINE: run_commands, shell -> Bash; read_files -> Read; │ # editor, edit -> Edit (Write when it creates a file); │ # search_codebase -> Grep; fetch_web_content -> WebFetch discover.py # + Cline home ~/.cline, AGENTPLAY_CLINE_HOMESThings a reviewer might trip on:
<id>.messages.jsonis one pretty-printed JSON document, not JSONL, sodetect_agentcannot sniff it. The indexer checks the shape itself, as it does for Copilot-in-VS-Code.jsonsessions.detect_agentis unchanged.agent_*.messages.json(spawned subagents) are skipped, not folded into the parent session.inputTokensincludes cache reads. Summed over a session, the messagemetricsequal the session metadata'susage.is_erroris set or any item hassuccess: false.git add,git commitandgit pushin one call would show asgit add.Test plan
Before:
agentplay agentshas no Cline. After, on my own~/.cline(70 sessions),agentplay build --agents clinebuilds 70 maps with 0 failures and skips 4 empty sessions. The maps hold 5,001 tool events (988 reads, 962 edits, 762 searches, 2,121 shell commands, 61 verify, 43 web, 10 subagent, 54 other) with 315 errors.make checkpasses: ruff,tsc, 1,492 pytest, 354 vitest,check_clean.New tests cover the parser (including a wrong-typed-field fuzz), indexing, discovery and map classification. There are two leak tests: one over the three fixtures, and one over a session seeded with secrets in prompts, command arguments, env assignments, paths, outputs and errors.
The fixtures are real sessions with every prompt, reply, thought, path, file content, command argument and output replaced by a placeholder. Ids, timestamps, models, token metrics, tool names, shell program names and success flags stay.
Not tested: the old
tasks/layout, Windows and macOS paths, andagentplay viewin a browser (I checked the built maps andagentplay list).make checkpassesNo prompt text, model output, tool input/output, file contents or command arguments can reach a map, a log line or the viewer (redaction contract)
No new network calls or Python runtime dependencies