capsid_admin_manage_namespaces
Manage namespaces, on Capsid Admin. Needs the admin identity and the write grant.
What it does
The namespace-to-repo mapping, which is the authorization boundary every repo call resolves through: register a namespace, change its repos, or delete it. Delete is two steps: delete_preview writes nothing and returns a token; delete_perform spends it. Admin only; register, update and delete_perform need a recent sign-in from a signed-in session.
What a client is told
The MCP hints it carries, so a client can ask before it acts (src/tool-annotations.ts).
- Writes: some action changes state.
- Can overwrite or remove what exists.
- A repeat can change things again.
- Stays inside Capsid.
Its 4 actions
Chosen by the action argument.
registerRegister a namespace.Register a namespace in the namespaces table. Give repo as 'owner/name' (label defaults to 'primary'), or pass a repos JSON array like [{"repo":"owner/name","label":"primary"}] for a multi-repo namespace. Refused if the namespace exists. Admin only: an OAuth session qualifies, a minted agent holding the write grant does not.
updateReplace its repos.Remap an existing namespace's repos. Pass repos as a JSON array like [{"repo":"owner/name","label":"primary"},{"repo":"owner/legacy","label":"legacy"}], with exactly one entry labeled "primary". The namespace must exist. Records the prior mapping in the audit log. Does not rename the namespace or move its documents. Admin only: an OAuth session qualifies, a minted agent holding the write grant does not.
delete_previewWhat a delete would remove, and the token to perform it.Delete a registered namespace. Two calls. action 'delete_preview' writes nothing: it counts every live and archived document, snapshot, edge, job by status, agent naming the namespace, and the ops_sites row, and returns a verdict. It is refused while any job in the namespace is open (queued, claimed or blocked) or any live agent names it in its scopes (cascade never reaches jobs or agents; end them with capsid_work_jobs or capsid_admin_manage_agents), while it is on the roster, while live documents exist and cascade is not true, while it holds signed policy documents (policy/) and allow_improve_paths is not true, and while it holds more live documents than one batch deletes (47; delete some with capsid_delete_doc or move them with capsid_write_doc action move first). An allowed preview returns a token bound to the namespace, cascade, allow_improve_paths, the counts and this caller, valid five minutes. action 'delete_perform' takes the same arguments and that token, re-reads the plan and refuses if anything counted changed, then in one batch snapshots every live document to document_versions and deletes it with the edges touching it, deletes the ops_sites row and the namespaces row, and writes one audit row 'namespace-delete' holding the edges and both rows whole. Archived documents, versions, the audit log, finished jobs and their records are kept. Admin only: an OAuth session qualifies, a minted agent holding the write grant does not.
Takes
namespace,cascade,allow_improve_paths,token.delete_performDelete, with the preview's token.Delete a registered namespace. Two calls. action 'delete_preview' writes nothing: it counts every live and archived document, snapshot, edge, job by status, agent naming the namespace, and the ops_sites row, and returns a verdict. It is refused while any job in the namespace is open (queued, claimed or blocked) or any live agent names it in its scopes (cascade never reaches jobs or agents; end them with capsid_work_jobs or capsid_admin_manage_agents), while it is on the roster, while live documents exist and cascade is not true, while it holds signed policy documents (policy/) and allow_improve_paths is not true, and while it holds more live documents than one batch deletes (47; delete some with capsid_delete_doc or move them with capsid_write_doc action move first). An allowed preview returns a token bound to the namespace, cascade, allow_improve_paths, the counts and this caller, valid five minutes. action 'delete_perform' takes the same arguments and that token, re-reads the plan and refuses if anything counted changed, then in one batch snapshots every live document to document_versions and deletes it with the edges touching it, deletes the ops_sites row and the namespaces row, and writes one audit row 'namespace-delete' holding the edges and both rows whole. Archived documents, versions, the audit log, finished jobs and their records are kept. Admin only: an OAuth session qualifies, a minted agent holding the write grant does not.
Takes
namespace,cascade,allow_improve_paths,token.
Arguments
| Argument | Type | Needed | What it is |
|---|---|---|---|
action | one of: register, update, delete_preview, delete_perform | always | register | update | delete_preview | delete_perform. |
namespace | string | always | |
repo | string | no | |
label | string | no | |
repos | string | no | |
cascade | boolean | no | |
allow_improve_paths | boolean | no | |
token | string | no |