1.2 KiB
1.2 KiB
06-01 PLAN — Schema + API Agent Defs
Tasks
-
Add
arcadia_agent_defstable toshared/schema.ts- Fields: id, tenantId, userId, name, description, spec (jsonb), status, version, lastTaskId, createdAt, updatedAt
- Run migration if needed
-
Create
server/agent-defs/service.tscreateAgentDef(),getAgentDef(),listAgentDefs(),updateAgentDef(),deleteAgentDef()updateStatus()helper for draft → assembling → ready → deployedincrementVersion()on deploy
-
Create
server/agent-defs/routes.ts- GET
/api/agent-defs(list by tenantId) - POST
/api/agent-defs(create) - PATCH
/api/agent-defs/:id(update spec/status) - DELETE
/api/agent-defs/:id - POST
/api/agent-defs/:id/deploy(status → deployed, version++) - POST
/api/agent-defs/:id/run(POST to blackboard task)
- GET
-
Register routes in
server/routes.ts- Import and registerAgentDefRoutes()
Reuse
- DB functions from existing patterns
- Blackboard service for task creation (no modification)
Done Criteria
- API responds 200 on all endpoints
- Status transitions work: draft → assembling → ready → deployed
lastTaskIdlinks to blackboard_tasks