Import agents
Agents
Import agents
Import one or more code-defined agents into Maitai from a canonical manifest. The manifest describes the agents, their capabilities (actions), and handoffs (sub-agents) in a framework-agnostic shape. The endpoint:
- Resolves or creates the target application. 2. Pre-flights every manifest agent against existing rows, so
on_conflict='error'fails fast without any writes when a conflict is detected. 3. Applies the writes through theagent_servicefunctions, which autocommit per call. These services perform read-backs and cache warming on separate asyncio tasks (asyncio.gather/create_eager_task); those child tasks open their own pooled connections, so the import must NOT run inside one outerconnection.async_cursor()transaction or those read-backs cannot see the uncommitted rows (they raiseResourceNotFound). The pre-flight in step 2 is what guards against partial writes foron_conflict='error'. 4.on_conflict='update'is non-destructive: only fields the adapter actually owns are overwritten (Portal-edited fields likeis_default,invocation_mode, actionmetasurvive), andagent_configis merged rather than replaced so Portal-set keys likerouting_configsurvive. 5. By default the import is additive — actions or sub-agent links removed from the source code are NOT deleted from Maitai. Passprune=True(CLI:--prune) for a destructive reconcile that makes the imported code the source of truth.
POST
Import agents