pub struct ToolBridgeCtx<Runtime> { /* private fields */ }Expand description
Bridge context: combines a runtime context with shared tool ownership.
This keeps the Arc<dyn Tool> inside the bridge while
PassthroughExecutor only borrows &dyn Tool. The rest of the CGP
pipeline (approval, sandbox, middleware) is provided by the runtime
context’s component wiring.
Trait Implementations§
Source§impl<Name, Runtime> HasComponent<Name> for ToolBridgeCtx<Runtime>where
Runtime: HasComponent<Name>,
impl<Name, Runtime> HasComponent<Name> for ToolBridgeCtx<Runtime>where
Runtime: HasComponent<Name>,
Source§type Provider = <Runtime as HasComponent<Name>>::Provider
type Provider = <Runtime as HasComponent<Name>>::Provider
The concrete provider type wired to
Name for this context.Source§impl<Runtime: Send + Sync> HasInnerTool for ToolBridgeCtx<Runtime>
impl<Runtime: Send + Sync> HasInnerTool for ToolBridgeCtx<Runtime>
fn inner_tool(&self) -> &dyn Tool
Source§impl<Runtime: HasWorkspaceRoot> HasWorkspaceRoot for ToolBridgeCtx<Runtime>
impl<Runtime: HasWorkspaceRoot> HasWorkspaceRoot for ToolBridgeCtx<Runtime>
fn workspace_root(&self) -> &PathBuf
Auto Trait Implementations§
impl<Runtime> !RefUnwindSafe for ToolBridgeCtx<Runtime>
impl<Runtime> !UnwindSafe for ToolBridgeCtx<Runtime>
impl<Runtime> Forget for ToolBridgeCtx<Runtime>
impl<Runtime> Freeze for ToolBridgeCtx<Runtime>where
Runtime: Freeze,
impl<Runtime> Move for ToolBridgeCtx<Runtime>
impl<Runtime> Send for ToolBridgeCtx<Runtime>where
Runtime: Send,
impl<Runtime> Sync for ToolBridgeCtx<Runtime>where
Runtime: Sync,
impl<Runtime> Unpin for ToolBridgeCtx<Runtime>where
Runtime: Unpin,
impl<Runtime> UnsafeUnpin for ToolBridgeCtx<Runtime>where
Runtime: 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
Source§impl<Ctx> CanApproveTool for Ctxwhere
Ctx: HasComponent<ApprovalComponent> + Send + Sync,
<Ctx as HasComponent<ApprovalComponent>>::Provider: ApprovalProvider<Ctx>,
impl<Ctx> CanApproveTool for Ctxwhere
Ctx: HasComponent<ApprovalComponent> + Send + Sync,
<Ctx as HasComponent<ApprovalComponent>>::Provider: ApprovalProvider<Ctx>,
Source§impl<Ctx> CanBuildProvider for Ctxwhere
Ctx: HasComponent<ProviderBuildComponent>,
<Ctx as HasComponent<ProviderBuildComponent>>::Provider: ProviderBuildProvider<Ctx>,
impl<Ctx> CanBuildProvider for Ctxwhere
Ctx: HasComponent<ProviderBuildComponent>,
<Ctx as HasComponent<ProviderBuildComponent>>::Provider: ProviderBuildProvider<Ctx>,
Source§fn build_provider(config: ProviderConfig) -> Box<dyn LLMProvider>
fn build_provider(config: ProviderConfig) -> Box<dyn LLMProvider>
Construct a boxed
LLMProvider from the given factory configuration.Source§impl<Ctx> CanDescribeProvider for Ctxwhere
Ctx: HasComponent<ProviderMetadataComponent>,
<Ctx as HasComponent<ProviderMetadataComponent>>::Provider: ProviderMetadataProvider<Ctx>,
impl<Ctx> CanDescribeProvider for Ctxwhere
Ctx: HasComponent<ProviderMetadataComponent>,
<Ctx as HasComponent<ProviderMetadataComponent>>::Provider: ProviderMetadataProvider<Ctx>,
Source§const PROVIDER_KEY: &'static str = const PROVIDER_KEY: &'static str =
<ComponentProvider<Ctx, ProviderMetadataComponent> as
ProviderMetadataProvider::<Ctx>>::PROVIDER_KEY;
const PROVIDER_KEY: &'static str = const PROVIDER_KEY: &'static str = <ComponentProvider<Ctx, ProviderMetadataComponent> as ProviderMetadataProvider::<Ctx>>::PROVIDER_KEY;
Registry key used to identify this provider in the factory.
Source§const DISPLAY_NAME: &'static str = const DISPLAY_NAME: &'static str =
<ComponentProvider<Ctx, ProviderMetadataComponent> as
ProviderMetadataProvider::<Ctx>>::DISPLAY_NAME;
const DISPLAY_NAME: &'static str = const DISPLAY_NAME: &'static str = <ComponentProvider<Ctx, ProviderMetadataComponent> as ProviderMetadataProvider::<Ctx>>::DISPLAY_NAME;
Human-readable display name.
Source§const DEFAULT_MODEL: &'static str = const DEFAULT_MODEL: &'static str =
<ComponentProvider<Ctx, ProviderMetadataComponent> as
ProviderMetadataProvider::<Ctx>>::DEFAULT_MODEL;
const DEFAULT_MODEL: &'static str = const DEFAULT_MODEL: &'static str = <ComponentProvider<Ctx, ProviderMetadataComponent> as ProviderMetadataProvider::<Ctx>>::DEFAULT_MODEL;
Default model identifier when none is specified.
Source§const API_BASE_URL: &'static str = const API_BASE_URL: &'static str =
<ComponentProvider<Ctx, ProviderMetadataComponent> as
ProviderMetadataProvider::<Ctx>>::API_BASE_URL;
const API_BASE_URL: &'static str = const API_BASE_URL: &'static str = <ComponentProvider<Ctx, ProviderMetadataComponent> as ProviderMetadataProvider::<Ctx>>::API_BASE_URL;
Base URL for the provider’s API endpoint.
Source§const BASE_URL_ENV_VAR: Option<&'static str> = const BASE_URL_ENV_VAR: Option<&'static str> =
<ComponentProvider<Ctx, ProviderMetadataComponent> as
ProviderMetadataProvider::<Ctx>>::BASE_URL_ENV_VAR;
const BASE_URL_ENV_VAR: Option<&'static str> = const BASE_URL_ENV_VAR: Option<&'static str> = <ComponentProvider<Ctx, ProviderMetadataComponent> as ProviderMetadataProvider::<Ctx>>::BASE_URL_ENV_VAR;
Optional environment variable that overrides the base URL.
Source§impl<Ctx> CanExecuteTool for Ctxwhere
Ctx: HasComponent<ExecuteComponent> + HasComponent<LoggingComponent> + HasComponent<CacheComponent> + HasComponent<RetryComponent> + Send + Sync,
<Ctx as HasComponent<ExecuteComponent>>::Provider: ExecuteProvider<Ctx>,
<Ctx as HasComponent<LoggingComponent>>::Provider: LoggingProvider<Ctx>,
<Ctx as HasComponent<CacheComponent>>::Provider: CacheProvider<Ctx>,
<Ctx as HasComponent<RetryComponent>>::Provider: RetryProvider<Ctx>,
impl<Ctx> CanExecuteTool for Ctxwhere
Ctx: HasComponent<ExecuteComponent> + HasComponent<LoggingComponent> + HasComponent<CacheComponent> + HasComponent<RetryComponent> + Send + Sync,
<Ctx as HasComponent<ExecuteComponent>>::Provider: ExecuteProvider<Ctx>,
<Ctx as HasComponent<LoggingComponent>>::Provider: LoggingProvider<Ctx>,
<Ctx as HasComponent<CacheComponent>>::Provider: CacheProvider<Ctx>,
<Ctx as HasComponent<RetryComponent>>::Provider: RetryProvider<Ctx>,
fn execute_tool_json<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Ctx: 'async_trait,
fn execute_tool_dual<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Ctx: 'async_trait,
Source§impl<Ctx> CanProvideToolMetadata for Ctxwhere
Ctx: HasComponent<MetadataComponent> + Send + Sync,
<Ctx as HasComponent<MetadataComponent>>::Provider: MetadataProvider<Ctx>,
impl<Ctx> CanProvideToolMetadata for Ctxwhere
Ctx: HasComponent<MetadataComponent> + Send + Sync,
<Ctx as HasComponent<MetadataComponent>>::Provider: MetadataProvider<Ctx>,
fn tool_name(&self) -> &str
fn tool_description(&self) -> &str
fn parameter_schema(&self) -> Option<Value>
fn config_schema(&self) -> Option<Value>
fn state_schema(&self) -> Option<Value>
fn prompt_path(&self) -> Option<Cow<'static, str>>
fn default_permission(&self) -> ToolPolicy
fn allow_patterns(&self) -> Option<&'static [&'static str]>
fn deny_patterns(&self) -> Option<&'static [&'static str]>
fn is_mutating(&self) -> bool
fn is_parallel_safe(&self) -> bool
fn tool_kind(&self) -> &'static str
fn resource_hints(&self, args: &Value) -> Vec<String>
fn execution_cost(&self) -> u8
Source§impl<Ctx> CanResolveSandbox for Ctxwhere
Ctx: HasComponent<SandboxComponent> + Send + Sync,
<Ctx as HasComponent<SandboxComponent>>::Provider: SandboxProvider<Ctx>,
impl<Ctx> CanResolveSandbox for Ctxwhere
Ctx: HasComponent<SandboxComponent> + Send + Sync,
<Ctx as HasComponent<SandboxComponent>>::Provider: SandboxProvider<Ctx>,
fn sandbox_enabled(&self) -> bool
fn workspace_root(&self) -> Option<&PathBuf>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Ctx> HasToolRef for Ctx
impl<Ctx> HasToolRef for Ctx
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> 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