pub struct AgentSession {
pub id: AgentSessionId,
pub name: Option<String>,
pub cursor: TraversalCursor,
pub capabilities: AgentCapabilities,
pub limits: SessionLimits,
pub budget: BudgetTracker,
pub metrics: SessionMetrics,
pub state: SessionState,
pub created_at: DateTime<Utc>,
pub last_active: DateTime<Utc>,
pub last_results: Vec<BlockId>,
pub focus_block: Option<BlockId>,
}Expand description
Agent session state - tracks individual agent’s position and history.
Fields§
§id: AgentSessionIdUnique session identifier.
name: Option<String>Human-readable session name.
cursor: TraversalCursorCurrent cursor position in the graph.
capabilities: AgentCapabilitiesAgent capabilities.
limits: SessionLimitsSafety limits for this session.
budget: BudgetTrackerBudget tracker.
metrics: SessionMetricsMetrics and telemetry.
state: SessionStateSession state.
created_at: DateTime<Utc>Creation timestamp.
last_active: DateTime<Utc>Last activity timestamp.
last_results: Vec<BlockId>Last search/find results for CTX ADD RESULTS.
focus_block: Option<BlockId>Focus block for context (protected from pruning).
Implementations§
Source§impl AgentSession
impl AgentSession
pub fn new(start_block: BlockId, config: SessionConfig) -> Self
Sourcepub fn is_timed_out(&self) -> bool
pub fn is_timed_out(&self) -> bool
Check if session has timed out.
Sourcepub fn check_active(&self) -> Result<()>
pub fn check_active(&self) -> Result<()>
Check if session can perform an operation.
Sourcepub fn check_can_traverse(&self) -> Result<()>
pub fn check_can_traverse(&self) -> Result<()>
Check if session can traverse.
Sourcepub fn check_can_search(&self) -> Result<()>
pub fn check_can_search(&self) -> Result<()>
Check if session can search.
Sourcepub fn check_can_modify_context(&self) -> Result<()>
pub fn check_can_modify_context(&self) -> Result<()>
Check if session can modify context.
Sourcepub fn store_results(&mut self, results: Vec<BlockId>)
pub fn store_results(&mut self, results: Vec<BlockId>)
Store last search/find results.
Sourcepub fn get_last_results(&self) -> Result<&[BlockId]>
pub fn get_last_results(&self) -> Result<&[BlockId]>
Get last results (for CTX ADD RESULTS).
Sourcepub fn info(&self) -> SessionInfo
pub fn info(&self) -> SessionInfo
Get session info as serializable struct.
Auto Trait Implementations§
impl !Freeze for AgentSession
impl RefUnwindSafe for AgentSession
impl Send for AgentSession
impl Sync for AgentSession
impl Unpin for AgentSession
impl UnwindSafe for AgentSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more