Skip to main content

Module api_personality

Module api_personality 

Source
Expand description

Read/write endpoints for per-agent personality markdown files (SOUL.md, IDENTITY.md, USER.md, AGENTS.md, TOOLS.md, HEARTBEAT.md, BOOTSTRAP.md, MEMORY.md).

The runtime injects these into the system prompt at request time (see zeroclaw_runtime::agent::personality::load_personality). This module is the dashboard’s authoring surface for them.

Sandbox: filenames are matched against the static EDITABLE_PERSONALITY_FILES allowlist re-exported from the runtime crate. The on-disk path is built from a &'static str taken from that allowlist plus the agent’s workspace dir resolved via Config::agent_workspace_dir, so user-supplied path components cannot escape the workspace.

The agent query parameter is required and selects which agent’s workspace the endpoint operates against. Each agent has its own <install>/agents/<alias>/workspace/ per the v0.8.0 multi-agent layout.

Structs§

AgentQuery
PersonalityConflict
PersonalityFileResponse
PersonalityIndex
PersonalityIndexEntry
PersonalityPutBody
PersonalityPutResponse
TemplateFile
TemplateQuery
TemplateResponse

Functions§

handle_get
GET /api/personality/{filename} — read one file’s full content.
handle_index
GET /api/personality?agent= — index of all allowlist files in the named agent’s workspace.
handle_put
PUT /api/personality/{filename} — overwrite the file.
handle_templates
GET /api/personality/templates — render the default starter set.