ReqManagedAgents.Agent.Spec (ReqManagedAgents v0.8.0)

Copy Markdown View Source

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.

Summary

Functions

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

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

Types

t()

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

Functions

digest(spec)

@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(spec)

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

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