Skip to main content

Module composition

Module composition 

Source
Expand description

Composition layer — adapters bridging kernel ports into each other.

ToolBridge adapts a (DynamicToolSource, ToolDefinition) pair into a plain Tool. It is the executor’s dynamic-dispatch adapter (an invocation binding wraps a dynamic definition in a bridge so it runs the same path as a local tool) and the canonical home of the ToolExecutionError → status mapping. Hosts that prefer snapshot semantics (list once, register as static tools) reuse the same bridge directly; for live catalogs prefer ToolExecutor::register_dynamic.

Structs§

ToolBridge
A single dynamic-source tool exposed through the plain Tool interface. The bridge routes execute to DynamicToolSource::invoke_with_store (the source de-namespaces the call; the host’s artifact store is forwarded for media ingest) and maps invoke errors onto structured results: a timeout or cancellation is UnknownOutcome (the call may have run server-side), an out-of-catalog name is Rejected, unavailability and protocol failures are Failed with a model-readable message. The bridge returns the recorded result only — what an UnknownOutcome result does next is caller’s responsibility (the runner commits the complete batch and stops; a standalone bridge consumer chooses how to use its result).