Expand description
Polling-based watcher for Gemini CLI conversation files.
Gemini rewrites the chat JSON on every turn rather than appending,
so there’s no byte-offset tail to follow. Instead, each poll():
- Re-parses the main chat file and every sibling sub-agent file.
- Diffs
messages[]length against the last-seen per-file state, emittingWatcherEvent::Turnfor any new messages. - Checks
toolCalls[].statustransitions on previously-emitted messages and emitsWatcherEvent::TurnUpdatedwhen a status flips (e.g.pending→success). - Detects new sub-agent chat files and emits
WatcherEvent::Progress { kind: "subagent_started" }; when a sub-agent’ssummaryappears, emitsWatcherEvent::Progress { kind: "subagent_complete" }.
The watcher is deliberately polling-based in v1 — consumers drive
the cadence. A push-based notify-powered async variant can layer
on top later.
Structs§
- Conversation
Watcher - Watches a Gemini conversation for new turns and tool-call updates.