HTTP API: Store
Part of the HTTP API reference. For the user’s view, see the Plugins overview; for publishing, see Publishing.
Sources
Section titled “Sources”The Store lists the plugins of every source and installs them through write-back (apt/Homebrew-style sources, ADR-0011). There are two kinds of sources:
cicord: the official plugins bundled in the binary (the catalog), merged with the signed official registry (below). Trustofficial. Installing a bundled plugin copies its sources toplugins/<name>/(a local plugin).- Registries declared in
cicord.yamlspec.registries({name, url}): git repositories with anindex.yaml. Trust is computed, never declared:officialonly for the official registry URL, otherwiseunofficial. The namecicordis reserved. Installing writes acicord.lockentry and abot.yamlinstance withsource: <registry>/<plugin>, in one write-back.
The official registry, https://github.com/cicord/cicord-plugins, is implicit: source
cicord lists the union of the bundled plugins and its plugins (a plugin in both comes from
the registry only when its index version is a semver greater than the bundled one), with
url and signature set. Its index.yaml must carry a valid, current signature by an
official key (index.yaml.sig, bound to the registry URL, a serial and an expiry). An
official URL whose signature is missing, invalid, expired, for another registry or older than
one already seen has signature: "invalid", an error, and no plugins from it (cicord keeps
its bundled plugins). verified is only true from a verified official index. A cicord
plugin from the registry has a repo, and its StoreDetail a commit and integrity;
installing it locks cicord/<name> in cicord.lock.
Who: browsing and installing need the admin role on a server (bearer: everywhere).
Adding or removing a source changes cicord.yaml (the whole project): bearer, or admin on
every server the runtime manages.
Refresh: the runtime caches registry indexes and refreshes them in the background (10
seconds after start, then every 30 minutes) and on demand. A registry that cannot be fetched
is listed with an error and no plugins; the others still work.
Private registries: a registry may have a secretRef (cicord.yaml), always
CICORD_REGISTRY_<NAME>_TOKEN for its own name, naming the secret that holds an access token
(an environment variable or the runtime’s secret store). The token is sent, as HTTP basic auth
over https, to the registry’s host only (its index and the plugin repositories on the same
host), never to other hosts. It is never returned by the API.
Shapes
Section titled “Shapes”// Source{ "name": "cicord", "kind": "bundled|git", "url"?: "https://…", "trust": "official|unofficial", "fetchedAt"?: "…", "error"?: Error, "private": false, "credentials"?: "ok|missing", "signature"?: "verified|invalid", // official URLs only (see above) "pluginCount": 6, "plugins": [StorePlugin] } // plugins omitted with ?summary=1// StorePlugin (browse; from the catalog or the registry index){ "source": "cicord", "name": "welcome", "displayName": "Welcome", "description": "…", "keywords": [], "version"?: "0.1.0", "publisher"?: "…", "verified": false, "repo"?: "https://…", "trust": "official|unofficial", "installed": [{ "server", "bot", "instance" }], // instances using this source/plugin "update"?: PluginUpdate } // installed plugins with a newer version// PluginUpdate{ "kind": "registry|bundled", "current": "1.0.0", "latest": "1.1.0", "level": "major|minor|patch", "modified"?: true }// StoreDetail = StorePlugin + what the plugin requests, read from its plugin.yaml at the// resolved version (not from the index):{ …StorePlugin, "version": "1.2.0", "commit"?: "<sha>", "integrity"?: "sha256-…", "capabilities": [], "intents": [], "privilegedIntents": [], "network": [], "schema": {…}, "commands": [{"name", "description"}] | null }commands is null when unknown: listing commands evaluates the plugin’s code, which is only
done for official sources before installation.
Updates. A plugin version is shared by every instance using it, so an update changes all of them at once:
kind: "registry": thecicord.lockversion of<registry>/<plugin>(includingcicord/<plugin>locked from the official registry) is not the highest release tag of the plugin repository, any major version (prereleases ignored, like resolving*). The lookup lists the repository’s tags only (no clone), with the registry’s token and the public-only rule like every Store fetch, and is cached with the index TTL: the background refresh andPOST /store/refreshrefetch it, browsing the Store fetches what is missing or stale, instance items never fetch.kind: "bundled": a copy of an official plugin inplugins/<name>/whoseplugin.yamlversion is older than the version bundled in the binary.modified: truewhen the copy is neither the content of a released version of that plugin (the binary records the integrity of every bundled version) nor the current version with only anothermetadata.version: updating would overwrite local changes and must be forced.
Endpoints
Section titled “Endpoints”| Method | Path | Role | Result |
|---|---|---|---|
| GET | /api/v1/store[?summary=1] |
admin of a server | {"sources": [Source]}, cicord first, then the registries in cicord.yaml order. |
| GET | /api/v1/store/plugins |
admin of a server | Paged {"items": [StorePlugin], …} across sources; sort name (default), source, trust, version, publisher, installed; filters source, trust, installed=true|false, updates=true|false; default limit 50. |
| POST | /api/v1/store/refresh |
admin of a server | Refetches every registry index; answers as GET /store. |
| GET | /api/v1/store/{source}/{plugin} |
admin of a server | StoreDetail for the latest version (404 unknown source or plugin, 502 registry_unavailable). |
| GET | /api/v1/store/{source}/{plugin}/update |
admin of a server | UpdateReview (404 not_installed, 502 registry_unavailable). |
| POST | /api/v1/store/{source}/{plugin}/update |
admin of every server running it | UpdateResult. |
| POST | /api/v1/servers/{server}/store/install |
admin of {server} |
InstallResult. |
| POST | /api/v1/registries |
project (see above) | WriteResult. |
| DELETE | /api/v1/registries/{name} |
project | WriteResult. |
| PUT | /api/v1/registries/{name}/token |
project | WriteResult (body {"token"}). |
| DELETE | /api/v1/registries/{name}/token |
project | WriteResult. |
Installing
Section titled “Installing”POST /api/v1/servers/{server}/store/install request:
{ "source": "acme", "plugin": "xp", "bot"?: "gardien", "instance"?: "xp", "config"?: {…}, "version"?: "1.2.0", "commit"?: "<sha>", "integrity"?: "sha256-…", "confirmUnofficial"?: false }botdefaults to the only bot managing the server (400when several do).instancedefaults to the plugin name (409 conflictwhen it is taken on that bot).- Registry plugins:
version,commitandintegrityare the values of the reviewedStoreDetailand are required. If the latest version now resolves differently:409 changed(review again). The installed code is always the reviewed code. cicordplugins: sendversion,commitandintegritywhen the reviewedStoreDetailhas acommit(it comes from the official registry), none for a bundled plugin. When the origin changed since the review (bundled ↔ registry):409 changed. NoconfirmUnofficialis needed.- An
unofficialsource withoutconfirmUnofficial: true:409 confirmation_required. - Every capability the plugin requests is granted (
grants), as reviewed. Privileged intents are checked against the application, as in the setup wizard (409 intents). The configuration is validated on a copy of the active revision before anything is written (422 invalidwith diagnostics). - Mode, activation wait and response are those of the wizard’s
POST /plugins/install(InstallResult = {"instance", "health", "message"?, "command"?, "revision"?, "mode", "pullRequestUrl"?}). Auditstore.install(target<bot>/<instance>, details{source, plugin, version, commit, trust, mode}).
Updating a plugin
Section titled “Updating a plugin”GET /store/{source}/{plugin}/update reviews the latest version against what is installed. It
never evaluates the new version’s code (its config schema and plugin.yaml only):
// UpdateReview{ "available": true, "update": PluginUpdate | null, "detail": StoreDetail, // the new version: send its version/commit/integrity back "current": { "version": "1.0.0", "commit"?: "…", "integrity"?: "…", "repo"?: "…", "capabilities": [], "intents": [], "privilegedIntents": [], "network": [] }, "diff": { "capabilities": {"added": [], "removed": []}, "intents": {…}, "privilegedIntents": {…}, "network": {…} }, "instances": [{ "server", "bot", "instance", "range"?: "^1.0.0", "newRange"?: "^2.0.0", "grantsAdded": [], "grantsRemoved": [], "diagnostics": [Diagnostic] }], "files"?: { "changed": [], "added": [], "removed": [] }, // bundled copies (plugin-relative) "modified": false, "repoChanged": false, "servers": ["ma-commu"], "configValid": true, "missingAdmin": [], "restricted": [{ "server", "instances": 2 }] }instanceshas one entry per instance and server.diagnostics: the instance’s current config (base ⊕ server override, with the defaults of the new schema) validated against the new config schema andx-cicord-ref. An incompatible settings change shows up here before anything is written (configValid: false).newRangeis written when the new version is outside the instance’sversionrange (^<new>);grantsAddedandgrantsRemovedmake the grants what the new version requests.repoChanged: the registry index now points to another repository thancicord.lock.missingAdmin: servers running the plugin where the caller is not admin. Their instances are not detailed (no config diagnostics, grants or names, and they are left out ofdetail.installed):restrictedonly gives how many instances run there.
POST /store/{source}/{plugin}/update request:
{ "version": "1.1.0", "commit"?: "<sha>", "integrity"?: "sha256-…", "confirmUnofficial"?: false, "force"?: false }- Needs the
adminrole on every server where an instance of the plugin runs (bearer: everywhere), otherwise403 forbiddennaming the missing servers. Write-back disabled:403. - Registry plugins (
cicord/<plugin>locked from the official registry included):version,commitandintegrityof the revieweddetailare required (400); when the latest version now resolves differently:409 changed. Bundled copies:version(and optionallyintegrity) of the revieweddetail. unofficialsources needconfirmUnofficial: true(409 confirmation_required). Already the latest:409 up_to_date. A modified bundled copy withoutforce: true:409 modified(detailslists the changed and deleted files).- One write-back: the
cicord.lockentry (refused when it changed meanwhile), every instance’sversionrange when needed andgrants; for bundled copies, the files ofplugins/<name>/(files the new version no longer ships are deleted). Privileged intents are checked for every bot running it (409 intents); the change is validated on a copy of the active revision, plugins built (422 invalidwithdiagnostics). - Mode and activation wait as an install. Audit
plugin.updateon each server (target<source>/<plugin>, details{from, to, commit, trust, capabilitiesAdded, capabilitiesRemoved, forced, mode, revision, pullRequestUrl}).
// UpdateResult{ "version": "1.1.0", "mode": "commit|pullRequest", "revision"?: "…", "pullRequestUrl"?: "…", "message"?: "…", "instances": [{ "server", "bot", "instance", "health", "message"? }] }The CLI equivalent is cicord plugin update [<registry>/<plugin>] [--to <range>] [--force]:
without an argument it lists the available updates; with a plugin it updates cicord.lock,
the ranges and grants of bot.yaml (or plugins/<name>/) locally and prints the capability
diff.
Registries
Section titled “Registries”POST /registries request:
{"name": "acme", "url": "https://github.com/acme/cicord-plugins.git", "token"?: "…"}
tokenmakes it a private registry: stored in the secret store asCICORD_REGISTRY_<NAME>_TOKEN, withsecretRefwritten tocicord.yaml(503when the runtime has no secret store). URLs with credentials (https://user:pass@…):400.namematches^[a-z0-9][a-z0-9-]{0,31}$, is notcicord, and is unique;urlishttps://only and unique (the CLI also acceptsfile://and local paths). Otherwise400 invalid.- The index is fetched first; unreachable or invalid:
422 invalid(nothing written). - Writes
cicord.yaml(spec.registries); auditregistry.add.
DELETE /registries/{name}: unknown: 404; used by cicord.lock or a bot plugin:
409 in_use (details lists them). Its stored token is deleted. Audit registry.remove.
PUT /registries/{name}/token {"token"} checks the index with the new token first
(422 invalid when it cannot be read), stores it, and writes secretRef to cicord.yaml when
it was not there (otherwise nothing is committed: {"mode": "commit"}).
DELETE /registries/{name}/token removes secretRef from cicord.yaml and deletes the token.
Both only ever touch CICORD_REGISTRY_<NAME>_TOKEN of that registry. Audit registry.token.
// WriteResult{ "mode": "commit|pullRequest", "revision"?: "…", "pullRequestUrl"?: "…" }Registry index
Section titled “Registry index”index.yaml at the root of the registry repository:
plugins: xp: repo: https://github.com/acme/cicord-xp.git # plugin repository, semver tags v1.2.0 # path: plugins/xp # monorepo: plugin directory, tags xp/v1.2.0 displayName: XP & levels # optional description: Levels and a portal leaderboard keywords: [xp, levels] publisher: acme verified: false # only honoured from the signed official index version: 1.2.0 # optional: latest release (cicord plugin publish) commit: 3f1c… # optional: its tag's commit (a moved tag is refused)The official registry also has index.yaml.sig, the signature envelope (format,
registry, serial, expires, index-sha256, then ed25519 <key-id> <base64> lines),
written by cicord registry sign. See
Publishing → the official registry and
Registries for the rules on path, tags and signatures.