Skip to main content

Module agent_store

Module agent_store 

Source
Expand description

Transport-free agent-definition CRUD over a persistence layer.

These free functions hold the agent-store behavior shared by the HTTP service handlers (api/discovery.rs) and the embedded SDK admin surface, so both edit agent definitions through one code path. They own only the storage-shaping rules (id assignment, the agent kind marker, RFC 7396 merge on patch, and the built-in-agent delete guard); transport concerns (status codes, JSON framing) stay in the callers.

Enums§

AgentStoreError
Typed failures from the mutating agent-store operations so callers can map them to the right transport response (e.g. 404 vs 403 vs 500).

Functions§

create_agent
Create a new agent, assigning an id when absent and marking its kind.
delete_agent
Delete an agent by id, refusing to remove built-in agents.
get_agent
Load a single agent definition by id.
is_protected_agent_id
Built-in agents that must never be deleted through the store.
json_merge
RFC 7396 JSON Merge Patch: recursively merge patch into target.
list_agents
List persisted agent definitions.
patch_agent
Apply an RFC 7396 JSON Merge Patch to an existing agent and persist it.
replace_agent
Full-replacement upsert of an agent under a fixed id.
upsert_agent
Upsert an agent artifact as-is (used by the embedded admin surface).