# `MingaAgent.Tool.Output`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_agent/tool/output.ex#L1)

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

# `capture_status`

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

# `incomplete_reason`

```elixir
@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`

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

# `t`

```elixir
@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()
}
```

# `new`

```elixir
@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`

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

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

# `result`

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

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
