SC-7 HTTP routes for the agent-config surface #629
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#629
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As a frontend integrator, I want every per-kind list / read / write / fork / delete / history route exposed under a consistent
/agent-config/...surface, so that the dashboard can read and mutate any artifact at any scope without bespoke endpoints per kind.Acceptance criteria
Routes
GET /agent-config— debug endpoint: every artifact resolved for the calling agent (or a given?agent=namequery). Returns a flat list with kind + name + scope + body + provenance.GET /agent-config/{kind}— list all rows with optional?effective_for=<agent>filter that returns the resolved layered view.GET /agent-config/{kind}/{name}?scope=...&agent_type=...&instance_id=...PUT /agent-config/{kind}/{name}body{ scope, agent_type?, instance_id?, body, comment? }— upsert; writes aconfig_revisionrow before applying.DELETE /agent-config/{kind}/{name}?scope=...&agent_type=...&instance_id=...— drops the row, writes a "deleted" revision (snapshot is the prior body for restore).POST /agent-config/{kind}/{name}/forkbody{ from_scope, to_scope, agent_type?, instance_id? }— resolves the effective body forfrom_scopeand writes it into the target scope.GET /agent-config/{kind}/{name}/revisions— paginated history.POST /agent-config/{kind}/{name}/revisions/{id}/restore— writes a new revision whose body is the snapshot of the targeted revision.Transactionality + auth
config_revisionrow first, then apply the change. A rollback leaves no orphan revision.guardMutatingrail./agentstoday.apps/server/src/main.tsstyle ({ ok: true, data: ... }/{ ok: false, error: ... }).After-effects
agent-env-sync.renderForInstance(SC-2) for every affected instance.agent_config_changed{ kind, name, scope, agent_type, instance_id }so the dashboard's TanStack Query caches can invalidate without polling.Tests
Out of scope
References
specs/agent-config-customization.md§API surface and §Story SC-7