Skip to main content

Module pi

Module pi 

Source
Expand description

pi (@mariozechner/pi-coding-agent): one JSONL file per session under ~/.pi/agent/sessions/<encoded-cwd>/<timestamp>_<uuid>.jsonl.

The first line is a session header; the rest are tree nodes chained via id/parentId, read in file order (linear is correct for the common single-branch session). Conversational entries are message lines whose message.role is user/assistant/toolResult/bashExecution, plus custom_message. model_change/session_info carry metadata; the rest is bookkeeping, preserved in Record::Other so native ↔ disk is lossless.

The codec helpers here are pub(crate) and shared verbatim by Campfire, which is the identical format under a different home.

Structs§

CustomEntry
A custom_message line — extension context that replays as a user turn.
MessageEntry
A message line: the tree envelope plus the raw message payload.
Pi
The pi harness marker.
PiStore
Reads and writes pi-format sessions under a sessions root.
SessionHeader
The leading session header.

Enums§

Record
One JSONL line. The message union is preserved as raw JSON and typed by the codec.