ETS-backed source-owned registry for agent tool specifications.
The registry stores declarative MingaAgent.Tool.Spec structs. Executable callbacks are built later from a per-session MingaAgent.Tool.Context, so registry startup does not close over a process cwd or session state.
Summary
Functions
Returns all registered tool specs.
Converts a ReqLLM.Tool struct to a config-owned MingaAgent.Tool.Spec.
Looks up a tool spec by name.
Registers a tool spec in the registry. Same-source registrations replace existing entries.
Returns true if a tool with the given name is registered.
Starts the registry GenServer that owns the ETS table.
Removes every tool contributed by a source.
Types
@type register_error() :: {:reserved_tool_name, String.t(), owner_source :: source(), attempted_source :: source()} | {:duplicate_tool_name, String.t(), existing_source :: source(), attempted_source :: source()} | {:invalid_spec, term()}
Registration failure reason.
@type source() :: MingaAgent.Tool.Spec.source()
Tool contribution source.
Functions
@spec all() :: [MingaAgent.Tool.Spec.t()]
Returns all registered tool specs.
@spec from_req_tool(ReqLLM.Tool.t()) :: MingaAgent.Tool.Spec.t()
Converts a ReqLLM.Tool struct to a config-owned MingaAgent.Tool.Spec.
@spec lookup(String.t()) :: {:ok, MingaAgent.Tool.Spec.t()} | :error
Looks up a tool spec by name.
@spec register(MingaAgent.Tool.Spec.t() | keyword() | map()) :: :ok | {:error, register_error()}
Registers a tool spec in the registry. Same-source registrations replace existing entries.
Returns true if a tool with the given name is registered.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the registry GenServer that owns the ETS table.
@spec unregister_source(source()) :: :ok
Removes every tool contributed by a source.