MingaAgent.ToolApproval (Minga v0.1.0)

Copy Markdown View Source

Pending tool approval data.

When a tool requires user confirmation before execution, this struct captures the tool call identity and the reply-to PID for the blocked Task process. Flows from Agent.Session through editor state, input handling, chat decorations, and GUI protocol encoding.

Summary

Types

A public, editor-safe approval preview.

Structured preview kind for an approval card.

t()

A pending tool approval.

Functions

Builds the structured preview shown in inline approval cards.

Creates a pending approval with a structured preview card.

Returns an editor-safe map without the private reply PID.

Types

preview()

@type preview() :: MingaAgent.ToolApproval.Preview.t()

A public, editor-safe approval preview.

preview_kind()

@type preview_kind() :: MingaAgent.ToolApproval.Preview.kind()

Structured preview kind for an approval card.

t()

@type t() :: %MingaAgent.ToolApproval{
  args: map(),
  name: String.t(),
  preview: preview(),
  reply_to: pid() | nil,
  tool_call_id: String.t()
}

A pending tool approval.

Functions

build_preview(name, args)

@spec build_preview(String.t(), map()) :: preview()

Builds the structured preview shown in inline approval cards.

new(opts)

@spec new(keyword()) :: t()

Creates a pending approval with a structured preview card.

public(approval)

@spec public(t()) :: map()

Returns an editor-safe map without the private reply PID.