Expand description
Making a user-owned agent from a seeded template: the core of the agentdefcreatefromtemplate RPC
(Phase 1 of the two-tier picker, SPEC_AGENT_PICKER_TWO_TIER_2026_05_24.md), shared with the Agents create
API (app_api/agent_spawn/create.rs).
The template stays pristine; the new row carries is_seeded = 0. Validation:
template_idmust resolve to a row withis_seeded = 1. Cloning a user-owned row would be confusing semantics; useforkagentdefinitionfor that.nameis non-empty, at most 200 characters, and not already taken by anyis_seeded = 0row.
Functions§
- checked_
name 🔒 - The name as stored: trimmed, non-empty, at most 200 characters.
- cloned_
definition 🔒 - The new row: what the template keeps, with the caller’s choices applied and the opt-in settings reset.
- create_
from_ 🔒template - Clone the template
cmd.template_idinto a new agent namedcmd.name. - link_
new_ 🔒agent_ account - Link a new agent to the account it is created with, for its own provider:
chosen(the account the caller picked) when it is one of this channel’s accounts for that provider, else the provider’s only account. Two or more accounts with none chosen leave it unbound: that is a choice, made in Accounts. - seeded_
template 🔒 - The row
template_idnames, which must be a seeded template.