MingaAgent.Tool.Output (Minga v0.1.0)

Copy Markdown View Source

Separates capture completeness, requested bounds, model-visible presentation, and durable captured bytes.

Summary

Functions

Constructs an output with explicit capture and presentation facts. Truncated presentation requires recoverable captured bytes.

Returns each durable reference reachable from this output, including retained image bytes.

An incomplete capture is a tool error even if its retained prefix can be fetched.

Types

capture_status()

@type capture_status() :: :complete | {:incomplete, incomplete_reason()}

incomplete_reason()

@type incomplete_reason() ::
  :capture_byte_limit
  | :session_disk_quota
  | :root_disk_quota
  | :session_item_quota
  | :root_item_quota
  | :disk_full
  | :interrupted
  | :source_changed
  | :legacy_unclassified
  | :timeout
  | :capture_failed

presentation_status()

@type presentation_status() :: :complete | {:truncated, pos_integer() | :unknown}

t()

@type t() :: %MingaAgent.Tool.Output{
  attachments: [MingaAgent.Tool.Output.Attachment.t()],
  capture: capture_status(),
  presentation: presentation_status(),
  reference: MingaAgent.Tool.Output.Reference.t() | nil,
  revision: MingaAgent.Tool.Output.Revision.t() | nil,
  selection: MingaAgent.Tool.Output.Range.t(),
  view: String.t()
}

Functions

new(view, capture, selection, opts \\ [])

@spec new(String.t(), capture_status(), MingaAgent.Tool.Output.Range.t(), keyword()) ::
  {:ok, t()} | {:error, :invalid_output}

Constructs an output with explicit capture and presentation facts. Truncated presentation requires recoverable captured bytes.

references(output)

@spec references(t()) :: [MingaAgent.Tool.Output.Reference.t()]

Returns each durable reference reachable from this output, including retained image bytes.

result(output)

@spec result(t()) :: {:ok, t()} | {:error, t()}

An incomplete capture is a tool error even if its retained prefix can be fetched.