Skip to main content

Module session

Module session 

Source

Structs§

Session
SessionInfo
Lightweight info for listing sessions without loading full message history

Functions§

find_session
Find a session by full or partial ID match
find_session_by_name
Find a session by its assigned name (not partial ID). Iterates session headers one file at a time and returns on first match, avoiding a full directory scan when the named session appears early.
latest_session
Load the most recently updated session
list_recent_sessions
The limit most-recently-modified sessions (by file mtime), most-recent first. Sorts the directory entries by mtime WITHOUT parsing, then reads only the top limit headers — so /sessions is O(limit) reads instead of O(#sessions). mtime is an exact proxy for updated_at (the file is rewritten on every save).
list_sessions
List all sessions, sorted by most recently updated.
resolve_session
Resolve a query string to a Session. Resolution order:
validate_name
Validate a session or chain name: [a-z0-9-]{1,40}.