Skip to main content

PluginSession

Struct PluginSession 

Source
pub struct PluginSession { /* private fields */ }

Implementations§

Source§

impl PluginSession

Source

pub async fn prepare_turn( &self, request: PrepareTurnRequest, ) -> Result<TurnPreparation, PluginError>

Source

pub async fn prepare_turn_with_phase_probe( &self, request: PrepareTurnRequest, phase_probe: Option<Arc<dyn RuntimeTurnPhaseProbe>>, ) -> Result<TurnPreparation, PluginError>

Source

pub async fn apply_checkpoint( &self, ctx: CheckpointHookContext, ) -> Result<CheckpointApplication, PluginError>

Source

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>

Source

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

Source§

impl PluginSession

Source

pub fn session_id(&self) -> &str

Source

pub fn tool_access(&self) -> &SessionToolAccess

Source

pub fn subagent_context(&self) -> Option<&SubagentSessionContext>

Source

pub fn lashlang_abilities(&self) -> LashlangAbilities

Source

pub fn lashlang_language_features(&self) -> LashlangLanguageFeatures

Source

pub fn lashlang_resources(&self) -> ResourceCatalog

Source

pub fn host_events(&self) -> &HostEventCatalog

Source

pub fn host(&self) -> &PluginHost

Source

pub fn tools(&self) -> Arc<dyn ToolProvider>

Source

pub fn tool_registry(&self) -> Arc<ToolRegistry>

Source

pub fn protocol_driver(&self) -> Arc<dyn ProtocolDriverPlugin>

Source

pub fn plugin_actions(&self) -> Vec<PluginActionDef>

Source

pub fn has_assistant_stream_hooks(&self) -> bool

Source

pub async fn prepare_turn_context( &self, ctx: &TurnTransformContext<'_>, input: PreparedContext, phase_probe: Option<Arc<dyn RuntimeTurnPhaseProbe>>, ) -> Result<PreparedContext, HistoryError>

Chain registered turn-context transforms, piping each one’s output into the next in priority order.

Source

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().

Source

pub async fn collect_prompt_contributions( &self, ctx: PromptHookContext, ) -> Result<Vec<PromptContribution>, PluginError>

Source

pub async fn before_turn( &self, ctx: TurnHookContext, ) -> Result<Vec<PluginOwned<PluginDirective>>, PluginError>

Source

pub async fn before_tool_call( &self, ctx: ToolCallHookContext, ) -> Result<Vec<PluginOwned<PluginDirective>>, PluginError>

Source

pub async fn after_tool_call( &self, ctx: ToolResultHookContext, ) -> Result<Vec<PluginOwned<PluginDirective>>, PluginError>

Source

pub async fn after_turn( &self, ctx: TurnResultHookContext, ) -> Result<Vec<PluginOwned<PluginDirective>>, PluginError>

Source

pub async fn at_checkpoint( &self, ctx: CheckpointHookContext, ) -> Result<Vec<PluginOwned<PluginDirective>>, PluginError>

Source

pub async fn transform_assistant_stream( &self, session_id: &str, chunk: String, ) -> Result<Vec<PluginOwned<AssistantStreamTransform>>, PluginError>

Source

pub async fn transform_assistant_response( &self, session_id: &str, response: LlmResponse, ) -> Result<Vec<PluginOwned<AssistantResponseTransform>>, PluginError>

Source

pub async fn project_tool_result( &self, ctx: ToolResultProjectionContext, ) -> Result<ModelToolReturn, PluginError>

Source

pub async fn emit_runtime_event(&self, event: PluginLifecycleEvent<'_>)

Source

pub async fn emit_runtime_event_with_phase_probe( &self, event: PluginLifecycleEvent<'_>, phase_probe: Option<Arc<dyn RuntimeTurnPhaseProbe>>, )

Source

pub fn has_runtime_event_hooks(&self) -> bool

Source

pub async fn mutate_session_config( &self, ctx: SessionConfigChangedContext, policy: SessionPolicy, ) -> SessionPolicy

Source

pub fn snapshot(&self) -> Result<PluginSessionSnapshot, PluginError>

Source

pub fn snapshot_is_current( &self, previous: Option<&PluginSessionSnapshot>, ) -> bool

Source

pub fn snapshot_revision_fingerprint(&self) -> u64

Source

pub fn restore( &self, snapshot: &PluginSessionSnapshot, ) -> Result<(), PluginError>

Source

pub fn fork_for_session( &self, session_id: impl Into<String>, ) -> Result<Arc<PluginSession>, PluginError>

Source

pub fn fork_for_child_session( &self, session_id: impl Into<String>, parent_session_id: Option<String>, authority: SessionAuthorityContext, ) -> Result<Arc<PluginSession>, PluginError>

Source

pub fn fork_for_session_with_tool_surface( &self, session_id: impl Into<String>, tool_surface_overlay: ToolSurfaceContribution, ) -> Result<Arc<PluginSession>, PluginError>

Source

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>

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more