Expand description
Session persistence and storage.
This module provides session management with the following design principles:
- Abstraction:
SessionStoretrait for pluggable storage backends - Local First: Works fully offline with
LocalFileStore - Cloud Ready: Sync can be added via trait implementation
§Architecture
┌─────────────────────────────────────────────────────────────┐
│ Application Layer │
│ SessionAsset, ConversationHistory, ProjectContext │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Storage Abstraction │
│ SessionStore trait │
└─────────────────────────────────────────────────────────────┘
│
┌────────────────┴────────────────┐
▼ ▼
┌──────────┐ ┌──────────┐
│ Local │ │ Remote │
│ Store │ │ Store │
└──────────┘ └──────────┘§Example
use orcs_runtime::session::{SessionStore, LocalFileStore, SessionAsset};
use std::path::PathBuf;
// Create a local store
let store = LocalFileStore::new(PathBuf::from("~/.orcs/sessions"))?;
// Create and save a session
let mut asset = SessionAsset::new();
store.save(&asset).await?;
// List all sessions
let sessions = store.list().await?;
// Load a specific session
let loaded = store.load(&asset.id).await?;Structs§
- Auto
Trigger Config - Auto-trigger configuration for skills.
- Coding
Style Prefs - Coding style preferences.
- Communication
Prefs - Communication preferences.
- Compacted
Turn - Compacted (summarized) turns.
- Conversation
History - Conversation history.
- Conversation
Turn - A single conversation turn.
- Learned
Fact - A fact learned about the project.
- Local
File Store - Local file-based session store.
- Project
Context - Project-specific context.
- Session
Asset - SessionAsset - The accumulating value.
- Session
Meta - Session metadata for listing.
- Skill
Config - Skill configuration.
- Sync
Status - Overall sync status for the store.
- Tool
Call Record - Record of a tool call.
- User
Preferences - User preferences learned over time.
Enums§
- Storage
Error - Errors that can occur during session storage operations.
- Sync
Mode - Sync mode.
- Sync
State - Sync state for a session.
- Trigger
Condition - Trigger condition for auto-firing skills.
Traits§
- Session
Store - Session storage abstraction.
Functions§
- default_
session_ path - Returns the default session storage path.