Expand description
Session management and persistence.
Sessions are stored as JSONL files with a tree structure that enables branching and history navigation.
Structs§
- Autosave
Queue Metrics - Snapshot of autosave queue state and lifecycle counters.
- Branch
Info - Summary of branches in a session.
- Branch
Summary Entry - Branch summary entry.
- Compaction
Entry - Compaction entry.
- Custom
Entry - Custom entry.
- Entry
Base - Base entry fields.
- Export
Snapshot - Lightweight snapshot of session data for non-blocking export.
- Fork
Plan - Result of planning a
/forkoperation from a specific user message. - Label
Entry - Label entry.
- Message
Entry - Message entry.
- Model
Change Entry - Model change entry.
- Session
- A session manages conversation state and persistence.
- Session
Handle - Handle to a thread-safe shared session.
- Session
Header - Session file header.
- Session
Info Entry - Session info entry.
- Session
Open Diagnostics - Diagnostics captured while opening a session file.
- Session
Open Orphaned Parent Link - Session
Open Skipped Entry - Sibling
Branch - A sibling branch at a fork point.
- Thinking
Level Change Entry - Thinking level change entry.
Enums§
- Autosave
Durability Mode - Durability mode for write-behind autosave behavior.
- Autosave
Flush Trigger - Autosave flush trigger used for observability.
- Migration
State - Current migration state of a JSONL session.
- Session
Entry - A session entry.
- Session
Message - Session message payload.
- Session
Store Kind - Session persistence backend.
- V2Open
Mode - Loading strategy for reconstructing a
Sessionfrom a V2 store.
Constants§
- DEFAULT_
SHARE_ VIEWER_ URL - Default base URL for the Pi session share viewer.
- SESSION_
VERSION - Current session file format version.
Functions§
- create_
v2_ sidecar_ from_ jsonl - Create a V2 sidecar store from an existing JSONL session file.
- encode_
cwd - Encode a working directory path for use in session directory names.
- get_
share_ viewer_ url - Get the share viewer URL for a gist ID.
- migrate_
dry_ run - Dry-run a JSONL → V2 migration without persisting the sidecar.
- migrate_
jsonl_ to_ v2 - Migrate a JSONL session to V2 with full verification and event logging.
- migration_
status - Query the migration state of a JSONL session file.
- recover_
partial_ migration - Recover from a partial or corrupted V2 migration.
- rollback_
v2_ sidecar - Remove a V2 sidecar, reverting to JSONL-only storage.
- verify_
v2_ against_ jsonl - Verify a V2 sidecar against its source JSONL for fidelity.