Skip to main content

Module api_config

Module api_config 

Expand description

Per-property CRUD endpoints for /api/config/*.

Structs§

AliasSourceQuery
ChannelBindBody
POST /api/channels/bind request body. The GUI/HTTP equivalent of zeroclaw channel bind-<type> <identity> --alias <alias>: authorize an operator-named identity on one channel alias without the in-chat /bind <code> round trip.
DeletePlanResponse
Dry-run impact of deleting an aliased entry — the cascade preview a surface renders before confirming. Pure/read-only: computed from plan_delete (the same reference walk the real delete uses) plus the live-ACP gate for agents.
DriftEntry
One drift entry surfaced when in-memory Config diverges from the on-disk file.
DriftResponse
InitQuery
InitResponse
ListEntry
Single entry in the list response for configuration properties.
ListQuery
?prefix=... query parameter for list.
ListResponse
MapKeyQuery
MapKeyResponse
MapPathQuery
MigrateResponse
PatchOp
One JSON Patch operation. Supports add, remove, replace, test, and ZeroClaw’s comment extension. Every operation requires path; add, replace, and test require value, while comment requires comment.
PatchOpResult
Single result entry in a successful PATCH response, one per applied op.
PatchResponse
PropPutBody
PUT body. Value is serde_json::Value so typed values (booleans, arrays, numbers) round-trip correctly without going through the CLI’s comma-delimited string parser.
PropQuery
?path=... query parameter shared by GET / DELETE / OPTIONS-with-path.
PropResponse
Response for a non-secret GET / PUT / DELETE.
RefSiteDto
A single config reference site to an aliased entry, for the delete preview.
ReloadStatusResponse
RenameMapKeyBody
RenameMapKeyResponse
SecretResponse
Response for a secret GET / PUT / DELETE — never carries the value or its length. populated: true means the secret has a non-empty value on disk; populated: false means the field is unset or empty.
TemplateEntry
TemplatesResponse

Functions§

compute_drift
handle_api_channel_bind
POST /api/channels/bind — add an inbound identity to a pairing channel’s allowlist. Shares the exact bind core the CLI uses (bind_channel_identity_into), writes ONLY to peer_groups.<type>_<alias>.external_peers, and is gated by the same bearer auth as every other config write. Because the gateway and the running channels share one Arc<RwLock<Config>>, the swap makes the new peer live immediately — no daemon restart, and no /bind message.
handle_config_get
GET /api/config — compatibility whole-config read for older bundled dashboard pages. New clients should prefer the per-property API, but returning a masked snapshot here avoids a hard 405 when an older page is served by a newer gateway.
handle_delete_map_key
DELETE /api/config/map-key?path=<section>&key=<alias> — remove an alias from a map-keyed section. Aliased config sections with executable delete support route through the same cascade engine as the delete preview; non-aliased sections keep the generic raw key removal. Persists on success.
handle_delete_plan
GET /api/config/delete-plan?path=<section>&key=<alias> — dry-run the delete cascade for an aliased entry. Read-only; never mutates.
handle_drift
GET /api/config/drift — explicit drift summary for clients that want just the diff. Same DriftEntry shape used in ListResponse.drifted.
handle_get_map_keys
GET /api/config/map-keys?path=<section> — list the current alias keys at a map-keyed section path, e.g. channels.discord["default","work"].
handle_init
POST /api/config/init?section=model_providers — instantiate None nested sections with defaults, and only those: dynamic-map aliases are created through POST /api/config/map-key. When every requested section is already configured, returns {initialized: []}.
handle_list
handle_map_key
handle_migrate
handle_options_config
handle_options_prop
handle_patch
handle_prop_delete
handle_prop_get
handle_prop_put
handle_refresh_context_window
handle_reload_status
GET /api/config/reload-status — pending-reload flag for the dashboard’s reload banner. Goes true on any config write, false on /admin/reload.
handle_rename_map_key
handle_resolve_alias_source
GET /api/config/resolve-alias-source?source=<source> — list the configured alias values valid for an alias-reference field, resolved from the live config via the shared Config::resolve_alias_source.
handle_templates