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

An address for immutable captured bytes, with no filesystem path or source replay instruction.

# `t`

```elixir
@type t() :: %MingaAgent.Tool.Output.Reference{
  bytes: non_neg_integer(),
  items: non_neg_integer() | nil,
  media_type: String.t(),
  sha256: String.t(),
  token: String.t()
}
```

# `digest`

```elixir
@spec digest(binary()) :: String.t()
```

Hashes the exact captured bytes.

# `namespace`

```elixir
@spec namespace(String.t()) :: String.t()
```

Computes the namespace identity without exposing the durable session ID.

# `new`

```elixir
@spec new(keyword()) :: {:ok, t()} | {:error, :invalid_reference}
```

Builds a reference from validated persisted facts.

# `parse`

```elixir
@spec parse(String.t()) ::
  {:ok, String.t(), String.t()} | {:error, :invalid_reference}
```

Decodes a token without granting authorization to its namespace.

# `token`

```elixir
@spec token(String.t(), String.t()) ::
  {:ok, String.t()} | {:error, :invalid_reference}
```

Builds a token from a durable namespace and a random artifact ID.

---

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