Represents an agent manifest that defines the agent's configuration and capabilities.
The manifest is a declarative description of an agent, including its name, version, provider, and the capabilities it supports.
Fields
name- The agent nameversion- The manifest version (semver)description- Optional descriptionprovider- The AI provider (e.g., "anthropic", "openai")capabilities- List of Capability structsconfig- Agent-specific configurationmetadata- Arbitrary metadata
Usage
# Create a manifest
{:ok, manifest} = Manifest.new(%{
name: "my-agent",
version: "1.0.0",
provider: "anthropic",
capabilities: [
%{name: "web_search", type: :tool}
]
})
# Add a capability
{:ok, updated} = Manifest.add_capability(manifest, %{
name: "file_read",
type: :file_access
})
# Get enabled capabilities
enabled = Manifest.enabled_capabilities(manifest)
Summary
Functions
Adds a capability to the manifest.
Returns only enabled capabilities.
Reconstructs a manifest from a map.
Gets a capability by name.
Creates a new manifest with the given attributes.
Removes a capability by name.
Converts a manifest to a map suitable for JSON serialization.
Types
Functions
@spec add_capability(t(), AgentSessionManager.Core.Capability.t() | map()) :: {:ok, t()} | {:error, AgentSessionManager.Core.Error.t()}
Adds a capability to the manifest.
Returns an error if a capability with the same name already exists.
@spec enabled_capabilities(t()) :: [AgentSessionManager.Core.Capability.t()]
Returns only enabled capabilities.
@spec from_map(map()) :: {:ok, t()} | {:error, AgentSessionManager.Core.Error.t()}
Reconstructs a manifest from a map.
@spec get_capability(t(), String.t()) :: {:ok, AgentSessionManager.Core.Capability.t()} | {:error, AgentSessionManager.Core.Error.t()}
Gets a capability by name.
Returns an error if the capability is not found.
@spec new(map()) :: {:ok, t()} | {:error, AgentSessionManager.Core.Error.t()}
Creates a new manifest with the given attributes.
Required
:name- The agent name:version- The manifest version
Optional
:description- Description of the agent:provider- The AI provider:capabilities- List of capabilities (as Capability structs or maps):config- Agent configuration:metadata- Arbitrary metadata
Examples
iex> Manifest.new(%{name: "my-agent", version: "1.0.0"})
{:ok, %Manifest{name: "my-agent", version: "1.0.0"}}
iex> Manifest.new(%{name: ""})
{:error, %Error{code: :validation_error}}
@spec remove_capability(t(), String.t()) :: {:ok, t()} | {:error, AgentSessionManager.Core.Error.t()}
Removes a capability by name.
Returns an error if the capability is not found.
Converts a manifest to a map suitable for JSON serialization.