Skip to main content

Module session

Module session 

Source

Structs§

ResumeConfig
Configuration for session resume.
ResumeResult
Result of resuming a session.
SessionData
Session data on disk.
SessionEntry
One line in the NDJSON transcript file.
SessionMetadata
Session metadata.
SessionWriter

Functions§

append_session_entry
Append one NDJSON session entry to the transcript file.
append_session_message
Append a single message to the session as an NDJSON entry.
append_to_session
Append a message to a session transcript.
create_preserved_segment
Create a preserved segment from the last N messages.
delete_session
Delete a session.
drain_all_sessions
Drain all pending session writes. Call on shutdown.
enqueue_session_message
Enqueue a message for NDJSON streaming write.
enqueue_session_metadata
Enqueue metadata for NDJSON streaming write.
fork_session
Fork a session (create a copy with a new ID).
get_jsonl_path
Get the .jsonl path for a session’s NDJSON transcript.
get_session_info
Get info about a specific session.
get_session_messages
Get session messages.
get_session_path
Get the path for a specific session.
get_sessions_dir
Get the sessions directory path.
get_sidechain_jsonl_path
Get the sidechain .jsonl path for a subagent’s transcript within a session. Sidechain transcripts are stored as {session_id}/sidechains/{agent_id}.jsonl
insert_message_chain
Insert a chain of messages into a session transcript.
list_sessions
List all sessions.
load_session
Load session from disk.
load_session_jsonl
Load a session from its NDJSON transcript file.
record_sidechain_transcript
Record a sidechain (subagent) transcript message.
rename_session
Rename a session.
reset_session_globals_for_testing
Reset session globals for test isolation.
resume_session
Resume a session by loading its messages from disk.
save_session
Save session to disk.
tag_session
Tag a session.