Skip to main content

Crate talos_session

Crate talos_session 

Source
Expand description

Talos session management — JSONL-based session logging with tree-branching support.

Sessions are stored as append-only JSONL files, organized by working directory. Each line in a JSONL file is a JSON object representing a SessionEntry with fields for id, parent_id, timestamp, role, content, and optional metadata.

§Directory Layout

~/.talos/sessions/
  <project>/
    <uuid>.jsonl

§Branching Model

Each session supports multiple branches. A branch is a linear sequence of entries rooted at a specific entry. The fork method creates a new branch from any existing entry, enabling tree-structured conversation histories.

§Crash Safety

JSONL is append-only. If a crash occurs, only the last line may be corrupted, which can be detected and skipped during reads.

§Backward Compatibility

Entries without id or parent_id fields (from older JSONL files) are treated as part of a single linear branch. They are assigned synthetic IDs on load.

Re-exports§

pub use sqlite::ForkInfo;
pub use sqlite::IndexError;
pub use sqlite::SearchResult;
pub use sqlite::SessionIndex;

Modules§

sqlite
SQLite-based full-text search index for session messages.

Structs§

Session
A single session, backed by a JSONL file, with support for tree-branching.
SessionBranch
A linear branch within a session.
SessionCleanupCandidate
A session selected by a cleanup policy.
SessionCleanupPolicy
Policy for selecting session cleanup candidates.
SessionCleanupReport
Result of applying a session cleanup policy.
SessionEntry
A single entry in a session branch.
SessionInfo
Information about a session, returned when listing sessions.
SessionManager
Manages sessions on disk.
SessionMetadata
Metadata associated with a session entry.

Enums§

SessionError
Errors that can occur during session operations.