pub struct PluginSession { /* private fields */ }Implementations§
Source§impl PluginSession
impl PluginSession
pub async fn prepare_turn( &self, request: PrepareTurnRequest, ) -> Result<TurnPreparation, PluginError>
pub async fn prepare_turn_with_phase_probe( &self, request: PrepareTurnRequest, phase_probe: Option<Arc<dyn RuntimeTurnPhaseProbe>>, ) -> Result<TurnPreparation, PluginError>
pub async fn apply_checkpoint( &self, ctx: CheckpointHookContext, ) -> Result<CheckpointApplication, PluginError>
pub async fn finalize_turn( &self, turn: AssembledTurn, sessions: Arc<dyn SessionStateService>, session_lifecycle: Arc<dyn SessionLifecycleService>, session_graph: Arc<dyn SessionGraphService>, ) -> Result<TurnFinalization, PluginError>
pub async fn finalize_turn_with_phase_probe( &self, turn: AssembledTurn, sessions: Arc<dyn SessionStateService>, session_lifecycle: Arc<dyn SessionLifecycleService>, session_graph: Arc<dyn SessionGraphService>, phase_probe: Option<Arc<dyn RuntimeTurnPhaseProbe>>, ) -> Result<TurnFinalization, PluginError>
Source§impl PluginSession
impl PluginSession
pub fn tool_surface( &self, session_id: &str, ) -> Result<Arc<ToolSurface>, PluginError>
pub fn tool_catalog(&self, session_id: &str) -> Result<Vec<Value>, PluginError>
pub fn resolve_tool_surface( &self, ctx: ToolSurfaceContext, ) -> Result<ToolSurface, PluginError>
Source§impl PluginSession
impl PluginSession
pub fn session_id(&self) -> &str
pub fn tool_access(&self) -> &SessionToolAccess
pub fn subagent_context(&self) -> Option<&SubagentSessionContext>
pub fn lashlang_abilities(&self) -> LashlangAbilities
pub fn lashlang_language_features(&self) -> LashlangLanguageFeatures
pub fn lashlang_resources(&self) -> ResourceCatalog
pub fn host_events(&self) -> &HostEventCatalog
pub fn host(&self) -> &PluginHost
pub fn tools(&self) -> Arc<dyn ToolProvider> ⓘ
pub fn tool_registry(&self) -> Arc<ToolRegistry> ⓘ
pub fn protocol_driver(&self) -> Arc<dyn ProtocolDriverPlugin> ⓘ
pub fn plugin_actions(&self) -> Vec<PluginActionDef>
pub fn has_assistant_stream_hooks(&self) -> bool
Sourcepub async fn prepare_turn_context(
&self,
ctx: &TurnTransformContext<'_>,
input: PreparedContext,
phase_probe: Option<Arc<dyn RuntimeTurnPhaseProbe>>,
) -> Result<PreparedContext, ContextError>
pub async fn prepare_turn_context( &self, ctx: &TurnTransformContext<'_>, input: PreparedContext, phase_probe: Option<Arc<dyn RuntimeTurnPhaseProbe>>, ) -> Result<PreparedContext, ContextError>
Chain registered turn-context transforms, piping each one’s output into the next in priority order.
Sourcepub async fn compact_context(
&self,
ctx: &CompactionContext<'_>,
) -> Result<Option<ContextCompaction>, ContextError>
pub async fn compact_context( &self, ctx: &CompactionContext<'_>, ) -> Result<Option<ContextCompaction>, ContextError>
Ask registered compactors for seed nodes for a new compaction frame.
pub async fn collect_prompt_contributions( &self, ctx: PromptHookContext, ) -> Result<Vec<PromptContribution>, PluginError>
pub async fn before_turn( &self, ctx: TurnHookContext, ) -> Result<Vec<PluginOwned<PluginDirective>>, PluginError>
pub async fn before_tool_call( &self, ctx: ToolCallHookContext, ) -> Result<Vec<PluginOwned<PluginDirective>>, PluginError>
pub async fn after_tool_call( &self, ctx: ToolResultHookContext, ) -> Result<Vec<PluginOwned<PluginDirective>>, PluginError>
pub async fn after_turn( &self, ctx: TurnResultHookContext, ) -> Result<Vec<PluginOwned<PluginDirective>>, PluginError>
pub async fn at_checkpoint( &self, ctx: CheckpointHookContext, ) -> Result<Vec<PluginOwned<PluginDirective>>, PluginError>
pub async fn transform_assistant_stream( &self, session_id: &str, chunk: String, ) -> Result<Vec<PluginOwned<AssistantStreamTransform>>, PluginError>
pub async fn transform_assistant_response( &self, session_id: &str, response: LlmResponse, ) -> Result<Vec<PluginOwned<AssistantResponseTransform>>, PluginError>
pub async fn project_tool_result( &self, ctx: ToolResultProjectionContext, ) -> Result<ModelToolReturn, PluginError>
pub async fn emit_runtime_event(&self, event: PluginLifecycleEvent<'_>)
pub async fn emit_runtime_event_with_phase_probe( &self, event: PluginLifecycleEvent<'_>, phase_probe: Option<Arc<dyn RuntimeTurnPhaseProbe>>, )
pub fn has_runtime_event_hooks(&self) -> bool
pub async fn mutate_session_config( &self, ctx: SessionConfigChangedContext, policy: SessionPolicy, ) -> SessionPolicy
pub fn snapshot(&self) -> Result<PluginSessionSnapshot, PluginError>
pub fn snapshot_is_current( &self, previous: Option<&PluginSessionSnapshot>, ) -> bool
pub fn snapshot_revision_fingerprint(&self) -> u64
pub fn restore( &self, snapshot: &PluginSessionSnapshot, ) -> Result<(), PluginError>
pub fn fork_for_session( &self, session_id: impl Into<String>, ) -> Result<Arc<PluginSession>, PluginError>
pub fn fork_for_child_session( &self, session_id: impl Into<String>, parent_session_id: Option<String>, authority: SessionAuthorityContext, ) -> Result<Arc<PluginSession>, PluginError>
pub fn fork_for_session_with_tool_surface( &self, session_id: impl Into<String>, tool_surface_overlay: ToolSurfaceContribution, ) -> Result<Arc<PluginSession>, PluginError>
pub async fn invoke_plugin_action( &self, name: &str, args: Value, session_id: Option<String>, default_to_current_session: bool, sessions: Arc<dyn SessionStateService>, session_lifecycle: Arc<dyn SessionLifecycleService>, session_graph: Arc<dyn SessionGraphService>, processes: Arc<dyn ProcessService>, ) -> Result<ToolResult, PluginActionInvokeError>
pub async fn call_plugin_action<Op: PluginAction>( &self, args: Op::Args, session_id: Option<String>, default_to_current_session: bool, sessions: Arc<dyn SessionStateService>, session_lifecycle: Arc<dyn SessionLifecycleService>, session_graph: Arc<dyn SessionGraphService>, processes: Arc<dyn ProcessService>, ) -> Result<Op::Output, PluginError>
Auto Trait Implementations§
impl !RefUnwindSafe for PluginSession
impl !UnwindSafe for PluginSession
impl Freeze for PluginSession
impl Send for PluginSession
impl Sync for PluginSession
impl Unpin for PluginSession
impl UnsafeUnpin for PluginSession
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