toolpath-pi
Read Pi coding-agent session logs and derive Toolpath provenance documents.
Pi stores sessions as JSONL files at
~/.pi/agent/sessions/--<encoded-cwd>--/<timestamp>_<uuid>.jsonl. Each
entry forms a tree via id/parentId fields, enabling in-place branching.
Sessions can link to parent sessions via a parentSession file path in
the session header.
This crate implements the [toolpath_convo::ConversationProvider] trait
and a derive_path wrapper that produces a [toolpath::v1::Path] via
the shared derivation in [toolpath_convo::derive_path].
Quick example
use PiConvo;
let manager = new;
let session = manager
.most_recent_session
.unwrap
.expect;
let view = manager.to_view;
Listing sessions
list_sessions returns lightweight SessionMeta summaries — id, timestamp,
file path, entry count, and first_user_message (the first non-empty
user-prompt text). The last field is what makes the listing useful for
"pick a session by topic" surfaces like an fzf picker.
use PiConvo;
let manager = new;
for meta in manager.list_sessions.unwrap