pub struct ProcessPlugin { /* private fields */ }Expand description
Plugin that tracks spawned processes and provides LLM tool access.
§Management-only (no command execution)
ⓘ
let plugin = ProcessPlugin::with_scope(scope);
// Provides: list_processes, kill_process, process_stats,
// wait_for_process, read_process_output§Full command execution
ⓘ
let ctx = Arc::new(SandboxContext::new(config, registry, scope, container));
let plugin = ProcessPlugin::with_context(ctx);
// Provides all management tools PLUS:
// run_command, open_shell, shell_write, shell_readImplementations§
Source§impl ProcessPlugin
impl ProcessPlugin
Sourcepub fn new(registry: Arc<RwLock<ProcessRegistry>>) -> Self
pub fn new(registry: Arc<RwLock<ProcessRegistry>>) -> Self
Create a plugin with management tools only.
Convenience constructor that wraps the registry in a
ProcessVisibilityScope with no child registries.
Sourcepub fn with_scope(scope: ProcessVisibilityScope) -> Self
pub fn with_scope(scope: ProcessVisibilityScope) -> Self
Create a plugin with management tools backed by a visibility scope.
Use this when the agent has sub-agents whose process registries should
be visible to read-only tools (list, stats, wait, read_output).
Sourcepub fn with_context(ctx: Arc<SandboxContext>) -> Self
pub fn with_context(ctx: Arc<SandboxContext>) -> Self
Create a plugin with all tools: management + command execution.
The SandboxContext provides the OCI runtime, sandbox config, and
process registry needed by run_command, open_shell, shell_write,
and shell_read.
Trait Implementations§
Source§impl Plugin for ProcessPlugin
impl Plugin for ProcessPlugin
Source§fn on_user_message<'a>(
&'a self,
_input: &'a PluginInput,
_state: &'a PluginStateMap,
) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
fn on_user_message<'a>( &'a self, _input: &'a PluginInput, _state: &'a PluginStateMap, ) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
Called when a user message arrives.
Source§fn on_event<'a>(
&'a self,
_event: &'a AgentEvent,
_state: &'a PluginStateMap,
) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
fn on_event<'a>( &'a self, _event: &'a AgentEvent, _state: &'a PluginStateMap, ) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
Called when an agent event is emitted.
Source§fn before_run<'a>(
&'a self,
_state: &'a PluginStateMap,
) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
fn before_run<'a>( &'a self, _state: &'a PluginStateMap, ) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
Called before each agent run loop iteration.
Source§fn after_run<'a>(
&'a self,
_state: &'a PluginStateMap,
) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
fn after_run<'a>( &'a self, _state: &'a PluginStateMap, ) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
Called after each agent run loop iteration.
Source§fn signal_routes(&self) -> Vec<SignalRoute>
fn signal_routes(&self) -> Vec<SignalRoute>
Signal routes contributed by this plugin.
Auto Trait Implementations§
impl Freeze for ProcessPlugin
impl !RefUnwindSafe for ProcessPlugin
impl Send for ProcessPlugin
impl Sync for ProcessPlugin
impl Unpin for ProcessPlugin
impl UnsafeUnpin for ProcessPlugin
impl !UnwindSafe for ProcessPlugin
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more