Expand description
Session management for the coding agent.
Manages conversation sessions as append-only trees stored in JSONL files. Each session entry has an id and parent_id forming a tree structure.
Structs§
- Branch
Info - Information about where a session branched from
- Branch
Summary Entry - Branch summary entry for abandoned branches
- Compaction
Entry - Compaction entry for context window management
- Custom
Entry - Custom entry for extensions to store extension-specific data
- Custom
Message Entry - Custom message entry for extensions to inject messages into LLM context
- Label
Entry - Label entry for user-defined bookmarks/markers on entries
- Model
Change Entry - Model change entry
- Model
Info - Model information
- NewSession
Options - New Session Options.
- Session
Context - Context built from session entries for the LLM
- Session
Entry - Session entry - a simple struct for backward compatibility This wraps the internal enum representation
- Session
Entry Base - Base fields for all session entries (internal use)
- Session
Header - Session header stored as the first line in JSONL files
- Session
Info - Session metadata for listing
- Session
Info Entry - Session metadata entry (e.g., user-defined display name)
- Session
Manager - Manages conversation sessions as append-only trees stored in JSONL files.
- Session
Message Entry - Message entry with AgentMessage content
- Session
Meta - Session metadata stored separately from entries (backward compatibility)
- Session
Stats - Session Stats.
- Session
Tree Node - Tree node for get_tree()
- Thinking
Level Change Entry - Thinking level change entry
- Usage
- Usage statistics from an assistant message
Enums§
- Agent
Message - Agent message roles
- Assistant
Content Block - Content block for assistant messages
- Content
Block - Content block for text or image content
- Content
Value - Content can be string or array of content blocks
- File
Entry - Raw file entry (includes header and internal enum)
- Session
Entry Enum - All possible session entries (internal enum)
Constants§
- CURRENT_
SESSION_ VERSION - Current session version for migrations
Functions§
- find_
recent_ session_ path - Find the path of the most recent session for the given working directory.
- get_
default_ session_ dir - Get default session dir.
- resolve_
session_ path - Resolve a session file path from user input, handling relative paths and ~.
Type Aliases§
- EntryId
- Type alias for entry IDs (for backward compatibility)