Expand description
Append-only JSONL session persistence.
Records session metadata, transcript events, tool audits, and context control actions for audit and resume without storing full raw provider payloads.
Each SessionRecord is one append-only JSONL line tagged with
schema_version, a monotonic seq, time, and type.
Structs§
- AcpPermission
Option Record - A permission option recorded without protocol payloads.
- AcpSession
Metadata - External-agent session identity persisted once per run.
- Compaction
Audit - Complete durable audit payload for one compaction.
- Compaction
Source Hash - Source hash associated with a compacted input item.
- Compaction
Token Usage - Provider token usage for the compaction request, when reported.
- Context
Diagnostic Meta - Content-free diagnostic emitted while selecting context.
- Context
Item Meta - Content-free audit metadata for one context-ledger item.
- Context
Ledger Meta - Content-free context ledger snapshot persisted for a prompt turn.
- Context
Source Meta - Metadata for a loaded context source, without its model-visible content.
- McpTool
Session Meta - MCP-specific identity attached to an external tool call.
- Prompt
Metadata - Metadata for a single prompt turn, suitable for append-only JSONL storage.
- Session
Config File - A loaded config file recorded in session metadata.
- Session
Config Meta - Effective configuration provenance persisted with a session.
- Session
Reader - Reads a session JSONL file and reconstructs transcript entries.
- Session
Summary - Compact session metadata for sidebar display.
- Session
Writer - Append-only JSONL session writer.
- Skill
Reference Record - Persisted metadata for a loaded skill reference.
Enums§
- Compaction
Review Result - Review state recorded for a compaction summary.
- Compaction
Risk - Risk classification for the compacted range.
- Compaction
Trigger - How compaction was initiated.
- Session
Lookup Error - An error resolving a user-supplied local session identifier.
- Session
Record - A single line in a session JSONL file.
Constants§
- MAX_
LOG_ OUTPUT_ BYTES - Maximum amount of redacted log text returned by a reader.
- SCHEMA_
VERSION - Current JSONL schema version.
Functions§
- generate_
session_ id - Generate a session id from a timestamp (format:
session-YYYYMMDD-HHMMSS). - latest_
session_ file - Find the most recently modified session file in a directory.
- list_
session_ files - List session files in a directory, sorted newest-first by modification time.
- list_
session_ summaries - List session sidebar summaries, newest-first.
- list_
session_ titles - List session titles from a directory, newest-first.
- read_
redacted_ log_ tail - Read the last
max_linesof a text log, redacting values and bounding the returned payload. Missing files produce an empty result. - resolve_
session_ file - Resolve an exact session id or a unique id prefix.
- sessions_
dir - The sessions directory under a workspace root:
{root}/.thndrs/sessions/.