pub struct PluginSession { /* private fields */ }Implementations§
Source§impl PluginSession
impl PluginSession
pub fn session_id(&self) -> &str
pub fn execution_mode(&self) -> ExecutionMode
pub fn tool_access(&self) -> &SessionToolAccess
pub fn host(&self) -> &PluginHost
pub fn tools(&self) -> Arc<dyn ToolProvider> ⓘ
pub fn tool_registry(&self) -> Arc<ToolRegistry> ⓘ
Sourcepub fn mode_protocol_driver(&self) -> Option<Arc<dyn ModeProtocolDriverPlugin>>
pub fn mode_protocol_driver(&self) -> Option<Arc<dyn ModeProtocolDriverPlugin>>
Plugin-registered protocol driver for this session, if any plugin
claimed the singleton slot. When None, callers fall back to
lash_sansio::build_mode_preamble (hardcoded Standard/RLM).
pub fn tool_surface( &self, session_id: &str, mode: ExecutionMode, ) -> Arc<ToolSurface> ⓘ
pub fn tool_catalog(&self, session_id: &str, mode: ExecutionMode) -> Vec<Value>
pub fn resolve_tool_surface( &self, ctx: ToolSurfaceContext, ) -> Result<ToolSurface, PluginError>
pub fn plugin_actions(&self) -> Vec<PluginActionDef>
pub fn monitor_specs(&self) -> &[PluginOwned<MonitorSpec>]
pub fn has_assistant_stream_hooks(&self) -> bool
Sourcepub async fn prepare_turn_context(
&self,
ctx: &TurnTransformContext,
input: PreparedContext,
) -> Result<PreparedContext, HistoryError>
pub async fn prepare_turn_context( &self, ctx: &TurnTransformContext, input: PreparedContext, ) -> Result<PreparedContext, HistoryError>
Chain registered turn-context transforms, piping each one’s output into the next in priority order.
Sourcepub async fn rewrite_history(
&self,
ctx: &RewriteContext,
input: HistoryState,
) -> Result<HistoryState, HistoryError>
pub async fn rewrite_history( &self, ctx: &RewriteContext, input: HistoryState, ) -> Result<HistoryState, HistoryError>
Chain registered history rewriters, skipping any that opt out of
the current trigger via accepts().
pub async fn collect_prompt_contributions( &self, ctx: PromptHookContext, ) -> Result<Vec<PromptContribution>, PluginError>
pub async fn prepare_turn( &self, request: PrepareTurnRequest, ) -> Result<TurnPreparation, PluginError>
pub async fn apply_checkpoint( &self, ctx: CheckpointHookContext, ) -> Result<CheckpointApplication, 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: PluginRuntimeEvent)
pub fn has_runtime_event_hooks(&self) -> bool
pub async fn mutate_session_config( &self, ctx: SessionConfigChangedContext, policy: SessionPolicy, ) -> SessionPolicy
pub async fn finalize_turn( &self, turn: AssembledTurn, host: Arc<dyn ToolHookHost>, ) -> Result<TurnFinalization, PluginError>
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>, execution_mode: ExecutionMode, standard_context_approach: Option<StandardContextApproach>, ) -> Result<Arc<PluginSession>, PluginError>
pub fn fork_for_child_session( &self, session_id: impl Into<String>, parent_session_id: Option<String>, execution_mode: ExecutionMode, standard_context_approach: Option<StandardContextApproach>, authority: SessionAuthorityContext, ) -> Result<Arc<PluginSession>, PluginError>
pub fn fork_for_session_with_tool_surface( &self, session_id: impl Into<String>, execution_mode: ExecutionMode, standard_context_approach: Option<StandardContextApproach>, 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, host: Arc<dyn PluginActionHost>, ) -> Result<ToolResult, PluginActionInvokeError>
pub async fn call_plugin_action<Op: PluginAction>( &self, args: Op::Args, session_id: Option<String>, default_to_current_session: bool, host: Arc<dyn PluginActionHost>, ) -> Result<Op::Output, PluginError>
Auto Trait Implementations§
impl Freeze for PluginSession
impl !RefUnwindSafe for PluginSession
impl Send for PluginSession
impl Sync for PluginSession
impl Unpin for PluginSession
impl UnsafeUnpin for PluginSession
impl !UnwindSafe 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