# `ReqManagedAgents.Agent.Spec`
[🔗](https://github.com/cash-mckeeman/req_managed_agents/blob/v0.12.0/req_managed_agents/lib/req_managed_agents/agent/spec.ex#L1)

A content-addressed agent definition — the managed-entity analogue of an
environment spec. `name` is the repository base; the digest hashes only the
identity content (`system_prompt`, `tools`, `terminal_tool`, `model_config`),
so two identically-defined agents share a digest regardless of their name.

# `t`

```elixir
@type t() :: %ReqManagedAgents.Agent.Spec{
  model_config: String.t() | map() | nil,
  name: String.t(),
  system_prompt: String.t(),
  terminal_tool: String.t() | nil,
  tools: [map()]
}
```

# `digest`

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

The 8-hex (lowercased) content-address of the agent's identity fields —
`name` is deliberately excluded (it is the base, not the identity).

# `new`

```elixir
@spec new(t() | map()) :: {:ok, t()} | {:error, :invalid_agent_spec}
```

Coerce a map or an existing `%Spec{}` into a validated `%Spec{}`.

---

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