Skip to main content

Module template_create

Module template_create 

Source
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_id must resolve to a row with is_seeded = 1. Cloning a user-owned row would be confusing semantics; use forkagentdefinition for that.
  • name is non-empty, at most 200 characters, and not already taken by any is_seeded = 0 row.

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_id into a new agent named cmd.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_id names, which must be a seeded template.