MingaAgent.Tool.Executor (Minga v0.1.0)

Copy Markdown View Source

Executes agent tools through the registry with approval checking, context validation, and Config.Advice integration.

Summary

Types

Execution mode: :exec allows all tools, :plan refuses destructive tools before approval.

Result of tool execution.

Functions

Executes a tool by name with the given arguments.

Executes a tool that has already been approved by the user.

Executes an approved tool with opts such as :tool_context.

Types

execution_mode()

@type execution_mode() :: :exec | :plan

Execution mode: :exec allows all tools, :plan refuses destructive tools before approval.

hook_runner()

result()

@type result() ::
  {:ok, term()}
  | {:error, term()}
  | {:needs_approval, MingaAgent.Tool.Spec.t(), map()}

Result of tool execution.

Functions

execute(name, args)

@spec execute(String.t(), map()) :: result()

Executes a tool by name with the given arguments.

execute(name, args, registry_table)

@spec execute(String.t(), map(), atom()) :: result()

execute(name, args, registry_table, mode)

@spec execute(String.t(), map(), atom(), execution_mode()) :: result()

execute_approved(spec, args)

@spec execute_approved(MingaAgent.Tool.Spec.t(), map()) ::
  {:ok, term()} | {:error, term()}

Executes a tool that has already been approved by the user.

execute_approved(spec, args, opts)

@spec execute_approved(MingaAgent.Tool.Spec.t(), map(), keyword()) ::
  {:ok, term()} | {:error, term()}
@spec execute_approved(MingaAgent.Tool.Spec.t(), map(), execution_mode()) ::
  {:ok, term()} | {:error, term()}

Executes an approved tool with opts such as :tool_context.