You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Added `WatcherEvent::as_turn()` — returns the `Turn` payload for both `Turn` and `TurnUpdated` variants
10
+
- Added `WatcherEvent::as_progress()` — returns `(kind, data)` for `Progress` events
11
+
- Added `WatcherEvent::is_update()` — returns `true` only for `TurnUpdated`
12
+
- Added `WatcherEvent::turn_id()` — returns the turn ID for turn-carrying variants
13
+
- Added dispatch loop example to `WatcherEvent` rustdoc
14
+
15
+
### toolpath-claude 0.6.2
16
+
17
+
-`to_turn()` now populates `Turn.extra["claude"]` with provider-specific metadata from `ConversationEntry.extra` (e.g. `subtype`, `data`), enabling trait-only consumers to access state-inference signals without importing provider types
18
+
-`WatcherEvent::Progress` events now include the full entry payload under `data["claude"]`, carrying fields like `data.type`, `data.hookName`, `data.agentId`, and `data.message` that were previously discarded
19
+
- Both changes are additive — previously-empty fields are now populated; no existing behavior changes
20
+
- Thanks to the crabcity maintainers for the detailed gap analysis
Copy file name to clipboardExpand all lines: CLAUDE.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,3 +123,4 @@ Build the site after changes: `cd site && pnpm run build` (should produce 7 page
123
123
- The git derivation (`toolpath-git`) uses `git2` (libgit2 bindings), not shelling out to git
124
124
- Claude conversation data lives in `~/.claude/projects/` as JSONL files; `toolpath-claude` reads these directly
125
125
-`toolpath-claude` follows session chains by default — Claude Code rotates JSONL files on context overflow; `read_conversation` merges segments, `list_conversations` returns chain heads. `read_segment`/`list_segments` for single-file access. `ChainIndex` makes this incremental.
126
+
- Provider-specific extras convention: `Turn.extra` and `WatcherEvent::Progress.data` use provider-namespaced keys (e.g. `extra["claude"]`). `toolpath-claude` populates `Turn.extra["claude"]` from `ConversationEntry.extra` and `Progress.data["claude"]` from the full entry payload. This lets trait-only consumers access provider metadata (like `subtype` for state inference) without importing provider types.
Copy file name to clipboardExpand all lines: crates/toolpath-convo/README.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Write your conversation analysis once, swap providers without changing a line.
24
24
|`TokenUsage`| Input/output/cache token counts |
25
25
|`EnvironmentSnapshot`| Working directory and VCS branch/revision at time of a turn |
26
26
|`DelegatedWork`| A sub-agent delegation: prompt, nested turns, result |
27
-
|`WatcherEvent`| A `Turn` (new), `TurnUpdated` (enriched with tool results), or `Progress` event |
27
+
|`WatcherEvent`| A `Turn` (new), `TurnUpdated` (enriched with tool results), or `Progress` event — with `as_turn()`, `as_progress()`, `is_update()`, `turn_id()` helpers for ergonomic dispatch |
28
28
29
29
**Traits** define how providers expose their data:
30
30
@@ -101,6 +101,40 @@ let writes: Vec<_> = turn.tool_uses.iter()
101
101
.collect();
102
102
```
103
103
104
+
## Watching
105
+
106
+
Dispatch on `WatcherEvent` with `match` — three variants, exhaustive:
107
+
108
+
```rust,ignore
109
+
use toolpath_convo::{ConversationWatcher, WatcherEvent};
are available for cases where the distinction between `Turn` and `TurnUpdated`
122
+
collapses — e.g. a formatting pipeline that takes a turn + flag:
123
+
124
+
```rust,ignore
125
+
// When Turn/TurnUpdated go through the same path:
126
+
if let Some(turn) = event.as_turn() {
127
+
format_turn(turn, event.is_update());
128
+
}
129
+
130
+
// Keying/dedup without matching two variants:
131
+
if let Some(id) = event.turn_id() {
132
+
seen.insert(id);
133
+
}
134
+
```
135
+
136
+
Provider-specific metadata lives in `Turn.extra`, namespaced by provider (e.g. `turn.extra["claude"]`). This keeps the common schema clean while giving consumers opt-in access to provider internals.
0 commit comments