How do I extend Daemion?
Extensions are how you configure Daemion. Every agent, job, app, command, theme, and integration is an extension — a JSON record in SQLite that the engine loads at runtime. There is no separate table per type, no code deployment required. Add an extension and it’s live immediately.
What is an extension?
An extension is a single database record with a type, a name, a definition object, and a handful of metadata fields. The shape of definition varies by type — a command’s definition holds a prompt and a prefix, while a theme’s definition holds a color palette. Everything else (storage, lifecycle, enabling/disabling) is handled uniformly by the extension system regardless of type.
This means you learn one API and one data model to control every moving part of Daemion.
What are the 12 extension types?
| Type | What it is | Example |
|---|---|---|
command | Slash (or @, !, #) commands in the chat UI | /summarize — summarize the current thread |
agent | Claude agent identities with system prompts and model routing | opus — thorough reasoning agent |
job | Autonomous work units that run on a schedule or trigger | daily-digest — 8am briefing every weekday |
app | Vite projects served by the gateway | budget-tracker — interactive finance tool |
theme | Visual themes for the Daemion app | midnight — dark blue color scheme |
renderer | Custom content renderers for chat turns | mermaid — render diagrams inline |
integration | Connections to external services | github — GitHub webhook receiver |
action | Discrete callable actions exposed to agents | send-email — agent-callable email action |
widget | Embeddable UI components | weather — weather card widget |
artifact | Structured outputs produced by agents | report — formatted report artifact |
capability | Agent capability declarations | web-search — agent can search the web |
control | System configuration records — budget limits, rate caps, feature flags | deploy-button — one-tap deploy trigger |
What does the extension schema look like?
Every extension shares this universal shape, defined in src/schema/extension.ts:
interface Extension { id: string; // assigned by gateway on creation, e.g. “ext_01abc123” type: ExtensionType; // one of the 12 types above name: string; // unique per type, kebab-case, 1-100 chars description: string; // human-readable, max 500 chars definition: Record<string, unknown>; // type-specific config trigger_def?: Record<string, unknown> | null; // optional cron/event/webhook trigger source: “built-in” | “user” | “agent” | “community”; enabled: boolean; created_at: string; // ISO 8601 updated_at: string; // ISO 8601 }
The definition field is validated against a type-specific Zod schema when you create or update an extension. For example, a command extension’s definition must include a prefix (/, @, !, or #) and a handler string.
How do I create an extension?
The primary way to create extensions is through chat. Tell Daemion what you want — “create a command called /hello that greets me by name” — and the agent writes the extension record for you. The API below is the programmatic alternative for scripts, CI pipelines, and agent-initiated creation at runtime.
Create via API
curl -X POST http://localhost:3001/extensions
-H “Authorization: Bearer $DAEMION_TOKEN”
-H “Content-Type: application/json”
-d ’{
“type”: “command”,
“name”: “hello”,
“description”: “Greet the user by name.”,
“definition”: {
“prefix”: ”/”,
“handler”: “Reply with a warm greeting using the user'''s name from context.”
},
“source”: “user”,
“enabled”: true
}’
The gateway validates definition against the schema for the given type and returns the created extension with its assigned id.
Frequently asked questions
/extensions during a conversation to create a new job, command, or integration on the fly. Set source: "agent" and owner_agent_id to the agent's ID so you can filter and audit agent-created extensions later.~/.daemion/daemion.db. File-backed extension types (jobs, agents) also have a directory on disk under jobs/ or agents/. The database record is the authoritative source — disk files are referenced by the definition.built-in — shipped with Daemion, read-only. user — created by you through chat or the API. agent — created autonomously by an agent during a conversation (paired with owner_agent_id). community — installed from the extension registry. Source affects display grouping in the app and determines whether an extension can be deleted.What can go wrong
400 {"error": "validation failed", "details": [...]} — The request body failed Zod schema validation. The details array lists each failing field. Check that type is one of the 12 valid values and that definition matches the required shape for that type.
403 {"error": "cannot disable essential extensions"} — Essential built-in extensions cannot be disabled. They can be inspected but not toggled off.
403 {"error": "cannot delete essential extensions"} — Essential extensions cannot be deleted. To customize behavior, create a new extension of the same type with source: "user".
What’s next?
- Create your first extension — chat-driven walkthrough, step by step
- Extensions API — full CRUD reference with every endpoint