pub struct ToolProgram { /* private fields */ }Expand description
Captured from the effective executing loop, never from a root registry.
Implementations§
Source§impl ToolProgram
impl ToolProgram
Sourcepub fn resolve_result_reference(
&self,
id: &str,
) -> Result<(AgentToolResult, bool), String>
pub fn resolve_result_reference( &self, id: &str, ) -> Result<(AgentToolResult, bool), String>
Resolve native authority only within this owning program’s active lifetime. Usage/names remain in the receipt for inspection but are merged by host accounting, never by the attachment. No transcript calls are synthesized.
Source§impl ToolProgram
impl ToolProgram
Sourcepub fn resolve_content_parts(
&self,
parts: Vec<ToolProgramContentPart>,
) -> Result<Vec<TextContentOrImage>, String>
pub fn resolve_content_parts( &self, parts: Vec<ToolProgramContentPart>, ) -> Result<Vec<TextContentOrImage>, String>
Resolve from this invocation’s authentic native store. Count each block before cloning it, including repeated selections, to bound expansion. The serialized array limit is not an RSS ceiling or a retained-tree charge.
Source§impl ToolProgram
impl ToolProgram
Sourcepub fn active_tool_names(&self) -> Vec<String>
pub fn active_tool_names(&self) -> Vec<String>
Effective names, including this tool, for the existing names-only action.
Sourcepub fn cancel_all(&self)
pub fn cancel_all(&self)
Cancellation stops admission. Cleanup/poll remain available to the binding.
Sourcepub fn bind_signal(self: &Arc<Self>, signal: CancellationToken)
pub fn bind_signal(self: &Arc<Self>, signal: CancellationToken)
Observe driver-local cancellation, without retaining a finished invocation.
pub fn handle( self: &Arc<Self>, args: Value, ) -> BoxFuture<'static, Result<Value, String>>
Auto Trait Implementations§
impl !Freeze for ToolProgram
impl !RefUnwindSafe for ToolProgram
impl !UnwindSafe for ToolProgram
impl Forget for ToolProgram
impl Move for ToolProgram
impl Send for ToolProgramwhere
Arc<AgentContext>: Send,
Arc<AssistantMessage>: Send,
RawVecInner: Send,
NodeRef<Owned, ThinkingLevel, Option<String>, LeafOrInternal>: Send,
BoxRaw<(ThinkingLevel, Option<String>)>: Send,
RawTable<usize>: Send,
NodeRef<Owned, String, String, LeafOrInternal>: Send,
BoxRaw<(String, String)>: Send,
Arc<dyn Fn(Vec<AgentMessage>) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(&[AgentMessage]) -> Vec<Message> + Sync + Send>: Send,
Arc<dyn Fn(Vec<AgentMessage>, CancellationToken) -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(&str) -> Pin<Box<dyn Future<Output = Option<String>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = bool> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = Option<AgentLoopTurnUpdate>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn() -> usize + Sync + Send>: Send,
Arc<dyn Fn(BeforeToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<BeforeToolCallResult>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(AfterToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<AfterToolCallResult>> + Send>> + Sync + Send>: Send,
Arc<dyn ProviderHooks>: Send,
Arc<TreeNode>: Send,
Arc<ToolExecutionScope>: Send,
Arc<dyn ToolProgramObserver>: Send,
Arc<Atomic<usize>>: Send,
Mutex<State>: Send,
RwLock<()>: Send,
Arc<Semaphore>: Send,
Atomic<bool>: Send,
Arc<Progress>: Send,
impl Sync for ToolProgramwhere
Arc<AgentContext>: Sync,
Arc<AssistantMessage>: Sync,
RawVecInner: Sync,
NodeRef<Owned, ThinkingLevel, Option<String>, LeafOrInternal>: Sync,
BoxRaw<(ThinkingLevel, Option<String>)>: Sync,
RawTable<usize>: Sync,
NodeRef<Owned, String, String, LeafOrInternal>: Sync,
BoxRaw<(String, String)>: Sync,
Arc<dyn Fn(Vec<AgentMessage>) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(&[AgentMessage]) -> Vec<Message> + Sync + Send>: Sync,
Arc<dyn Fn(Vec<AgentMessage>, CancellationToken) -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(&str) -> Pin<Box<dyn Future<Output = Option<String>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = bool> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = Option<AgentLoopTurnUpdate>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn() -> usize + Sync + Send>: Sync,
Arc<dyn Fn(BeforeToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<BeforeToolCallResult>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(AfterToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<AfterToolCallResult>> + Send>> + Sync + Send>: Sync,
Arc<dyn ProviderHooks>: Sync,
Arc<TreeNode>: Sync,
Arc<ToolExecutionScope>: Sync,
Arc<dyn ToolProgramObserver>: Sync,
Arc<Atomic<usize>>: Sync,
Mutex<State>: Sync,
RwLock<()>: Sync,
Arc<Semaphore>: Sync,
Atomic<bool>: Sync,
Arc<Progress>: Sync,
impl Unpin for ToolProgramwhere
Arc<AgentContext>: Unpin,
Arc<AssistantMessage>: Unpin,
*const u8 is !null: Unpin,
*const LeafNode<ThinkingLevel, Option<String>> is !null: Unpin,
Box<(ThinkingLevel, Option<String>)>: Unpin,
*const LeafNode<String, String> is !null: Unpin,
Box<(String, String)>: Unpin,
Arc<dyn Fn(Vec<AgentMessage>) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(&[AgentMessage]) -> Vec<Message> + Sync + Send>: Unpin,
Arc<dyn Fn(Vec<AgentMessage>, CancellationToken) -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(&str) -> Pin<Box<dyn Future<Output = Option<String>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = bool> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = Option<AgentLoopTurnUpdate>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn() -> usize + Sync + Send>: Unpin,
Arc<dyn Fn(BeforeToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<BeforeToolCallResult>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(AfterToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<AfterToolCallResult>> + Send>> + Sync + Send>: Unpin,
Arc<dyn ProviderHooks>: Unpin,
Arc<TreeNode>: Unpin,
Arc<ToolExecutionScope>: Unpin,
Arc<dyn ToolProgramObserver>: Unpin,
Arc<Atomic<usize>>: Unpin,
Align4<u32>: Unpin,
Align1<u8>: Unpin,
*const LeafNode<String, SetValZST> is !null: Unpin,
Box<(String, SetValZST)>: Unpin,
Arc<str>: Unpin,
Box<str>: Unpin,
Arc<Semaphore>: Unpin,
*const Waiter is !null: Unpin,
Align8<usize>: Unpin,
Arc<Progress>: Unpin,
impl UnsafeUnpin for ToolProgramwhere
*const ArcInner<AgentContext> is !null: UnsafeUnpin,
PhantomData<ArcInner<AgentContext>>: UnsafeUnpin,
*const ArcInner<AssistantMessage> is !null: UnsafeUnpin,
PhantomData<ArcInner<AssistantMessage>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<ThinkingLevel, Option<String>> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(ThinkingLevel, Option<String>)>>: UnsafeUnpin,
PhantomData<InputModality>: UnsafeUnpin,
PhantomData<ModelCostTier>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const ArcInner<dyn Fn(Vec<AgentMessage>) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Vec<AgentMessage>) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&[AgentMessage]) -> Vec<Message> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&[AgentMessage]) -> Vec<Message> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Vec<AgentMessage>, CancellationToken) -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Vec<AgentMessage>, CancellationToken) -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&str) -> Pin<Box<dyn Future<Output = Option<String>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&str) -> Pin<Box<dyn Future<Output = Option<String>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = bool> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = bool> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = Option<AgentLoopTurnUpdate>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(ShouldStopAfterTurnContext<'_>) -> Pin<Box<dyn Future<Output = Option<AgentLoopTurnUpdate>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Vec<AgentMessage>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn() -> usize + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn() -> usize + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(BeforeToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<BeforeToolCallResult>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(BeforeToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<BeforeToolCallResult>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(AfterToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<AfterToolCallResult>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(AfterToolCallContext<'_>, CancellationToken) -> Pin<Box<dyn Future<Output = Option<AfterToolCallResult>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn ProviderHooks> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ProviderHooks>>: UnsafeUnpin,
*const ArcInner<TreeNode> is !null: UnsafeUnpin,
PhantomData<ArcInner<TreeNode>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const ArcInner<ToolExecutionScope> is !null: UnsafeUnpin,
PhantomData<ArcInner<ToolExecutionScope>>: UnsafeUnpin,
*const ArcInner<dyn ToolProgramObserver> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ToolProgramObserver>>: UnsafeUnpin,
*const ArcInner<Atomic<usize>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<usize>>>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
PhantomData<(String, Request)>: UnsafeUnpin,
*const LeafNode<String, SetValZST> is !null: UnsafeUnpin,
PhantomData<Box<(String, SetValZST)>>: UnsafeUnpin,
PhantomData<(String, Retained)>: UnsafeUnpin,
*const Waiter is !null: UnsafeUnpin,
Align8<usize>: UnsafeUnpin,
*const ArcInner<Semaphore> is !null: UnsafeUnpin,
PhantomData<ArcInner<Semaphore>>: UnsafeUnpin,
*const ArcInner<Progress> is !null: UnsafeUnpin,
PhantomData<ArcInner<Progress>>: UnsafeUnpin,
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