{"openapi":"3.1.0","info":{"title":"Commons API","version":"v1","description":"The public HTTP surface of a commons instance: the routes of docs/mvp1-spec.md 12.2. It is public (any HTTP client may call it), stable within `v1` (4.1: a change may add a route, an optional request field or a response field, and may remove or rename nothing), described by this document, and bounded (a body limit on every route that reads a body, quotas on an account's calls). Response bodies are open to the reader (4.2): ignore a field you do not know. Request bodies are closed: an unknown field is a 400."},"servers":[{"url":"https://trial.opencodecommons.org"}],"paths":{"/healthz":{"get":{"operationId":"health","summary":"Whether the service is up.","description":"Answers `{ \"status\": \"ok\" }` while the process can answer.","responses":{"200":{"description":"The service is up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"service"}},"/":{"get":{"operationId":"homePage","summary":"The homepage (a browser).","description":"What the commons is, the trial's notice and the getting-started steps. An HTML page for a person, the same for everyone (CORE-120). It carries the enrolment pages' `Content-Security-Policy` and other headers (9.2) except the cache: `Cache-Control: public, max-age=300`. No cookie, no script.","responses":{"200":{"description":"The page.","headers":{"Cache-Control":{"description":"`public, max-age=300`","schema":{"type":"string"}}},"content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"service"}},"/privacy":{"get":{"operationId":"privacyPage","summary":"The privacy policy (a browser).","description":"What the service keeps, what it publishes, who else handles it and for how long. An HTML page for a person, the same for everyone (CORE-120). It carries the enrolment pages' `Content-Security-Policy` and other headers (9.2) except the cache: `Cache-Control: public, max-age=300`. No cookie, no script.","responses":{"200":{"description":"The page.","headers":{"Cache-Control":{"description":"`public, max-age=300`","schema":{"type":"string"}}},"content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"service"}},"/terms":{"get":{"operationId":"termsPage","summary":"The terms of service (a browser).","description":"The terms of using the service. An HTML page for a person, the same for everyone (CORE-120). It carries the enrolment pages' `Content-Security-Policy` and other headers (9.2) except the cache: `Cache-Control: public, max-age=300`. No cookie, no script.","responses":{"200":{"description":"The page.","headers":{"Cache-Control":{"description":"`public, max-age=300`","schema":{"type":"string"}}},"content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"service"}},"/@{namespace}/{name}":{"get":{"operationId":"packument","summary":"The npm packument of a package.","description":"What `npm install` reads (PoC 11.6). With `Accept: application/vnd.npm.install-v1+json` the abbreviated packument is answered with that content type, otherwise the full one as `application/json`. Both carry `Cache-Control: no-cache`. `dist.tarball` is built from the service URL. A package that does not exist, and a name that breaks the rule of 4.6, answer npm's 404 body. The encoded form is `GET /@{scopedName}`.","responses":{"200":{"description":"The packument.","headers":{"Cache-Control":{"description":"`no-cache`","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackumentFull"}},"application/vnd.npm.install-v1+json":{"schema":{"$ref":"#/components/schemas/PackumentAbbreviated"}}}},"404":{"description":"Not found: npm's body, as every path outside `/-/commons/` answers (PoC 11.4).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NpmNotFound"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","PoC 11.6"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"npm","parameters":[{"name":"namespace","in":"path","required":true,"description":"A namespace without `@` (4.6): a plain name or a domain. It may contain dots. A name that breaks the rule answers 404. Written with its `@`: `/@acme.com/parser`.","schema":{"type":"string","pattern":"^(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$","maxLength":100}},{"name":"name","in":"path","required":true,"description":"The package's name without its namespace (4.6): `a-z`, `0-9` and `-`, 1 to 64 characters, not starting with `-`.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}}]}},"/@{scopedName}":{"get":{"operationId":"packumentEncoded","summary":"The npm packument of a package, with the slash encoded.","description":"The form `npm` sends: `/@acme.com%2fparser`, with `%2f` or `%2F`. Answers exactly what `GET /@{namespace}/{name}` does.","responses":{"200":{"description":"The packument.","headers":{"Cache-Control":{"description":"`no-cache`","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackumentFull"}},"application/vnd.npm.install-v1+json":{"schema":{"$ref":"#/components/schemas/PackumentAbbreviated"}}}},"404":{"description":"Not found: npm's body, as every path outside `/-/commons/` answers (PoC 11.4).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NpmNotFound"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","PoC 11.6"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"npm","parameters":[{"name":"scopedName","in":"path","required":true,"description":"`<namespace>%2f<name>`, the whole package name after the `@`, with its slash encoded.","schema":{"type":"string"}}]}},"/-/tarballs/sha256/{file}":{"get":{"operationId":"tarball","summary":"A package's tarball.","description":"The bytes the digest names (PoC 11.6, 5.3). Immutable: `Cache-Control: public, max-age=31536000, immutable` and `ETag: \"<hex>\"`; a matching `If-None-Match` answers 304 with no body.","responses":{"200":{"description":"The tarball.","headers":{"Cache-Control":{"description":"`public, max-age=31536000, immutable`","schema":{"type":"string"}},"ETag":{"description":"the hex digest, quoted","schema":{"type":"string"}}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"304":{"description":"`If-None-Match` named the `ETag`."},"404":{"description":"Not found: npm's body, as every path outside `/-/commons/` answers (PoC 11.4).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NpmNotFound"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","5.3","PoC 11.6"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"npm","parameters":[{"name":"file","in":"path","required":true,"description":"The tarball's SHA-256: 64 lowercase hexadecimal characters and `.tgz`. Any other name, and a hash no stored object refers to, answers npm's 404.","schema":{"type":"string","pattern":"^[0-9a-f]{64}\\.tgz$"}}]}},"/-/bundles/sha256/{file}":{"get":{"operationId":"bundle","summary":"A version's source bundle.","description":"The source bundle the digest names (5.3, 6). Immutable, like the tarball: `Cache-Control: public, max-age=31536000, immutable`, `ETag: \"<hex>\"`, 304 for a matching `If-None-Match`.","responses":{"200":{"description":"The source bundle.","headers":{"Cache-Control":{"description":"`public, max-age=31536000, immutable`","schema":{"type":"string"}},"ETag":{"description":"the hex digest, quoted","schema":{"type":"string"}}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"304":{"description":"`If-None-Match` named the `ETag`."},"404":{"description":"Not found: npm's body, as every path outside `/-/commons/` answers (PoC 11.4).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NpmNotFound"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","5.3"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"npm","parameters":[{"name":"file","in":"path","required":true,"description":"The bundle's SHA-256: 64 lowercase hexadecimal characters and `.tgz`. Any other name, and a hash no stored object refers to, answers npm's 404.","schema":{"type":"string","pattern":"^[0-9a-f]{64}\\.tgz$"}}]}},"/-/attestations/sha256/{file}":{"get":{"operationId":"attestation","summary":"One attestation envelope.","description":"The envelope that was accepted, named by its PAE digest (4.4, 5.3). `payload` and the signature are in canonical base64. Immutable, as the tarball is.","responses":{"200":{"description":"The envelope.","headers":{"Cache-Control":{"description":"`public, max-age=31536000, immutable`","schema":{"type":"string"}},"ETag":{"description":"the hex digest, quoted","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DsseEnvelope"}}}},"304":{"description":"`If-None-Match` named the `ETag`."},"404":{"description":"Not found: npm's body, as every path outside `/-/commons/` answers (PoC 11.4).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NpmNotFound"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","5.3"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"npm","parameters":[{"name":"file","in":"path","required":true,"description":"The envelope's PAE digest: 64 lowercase hexadecimal characters and `.json`. Any other name, and a hash no stored object refers to, answers npm's 404.","schema":{"type":"string","pattern":"^[0-9a-f]{64}\\.json$"}}]}},"/-/commons/v1/trust-root":{"get":{"operationId":"trustRoot","summary":"The instance's trust root.","description":"The issuer keys, the log's origin and verifier key, and the witnesses required (10.3). Fixed when the service starts. It carries no `Cache-Control`.","responses":{"200":{"description":"The trust root.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustRoot"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","10.3"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"service"}},"/-/commons/v1/log/checkpoint":{"get":{"operationId":"logCheckpoint","summary":"The log's latest checkpoint.","description":"A signed note in the tile-log format (10.3, 10.5). Cacheable for a few seconds: `Cache-Control: public, max-age=2`.","responses":{"200":{"description":"The checkpoint.","headers":{"Cache-Control":{"description":"`public, max-age=2`","schema":{"type":"string"}}},"content":{"text/plain; charset=utf-8":{"schema":{"type":"string"}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","10.5"],"x-commons-body-limit":null,"x-commons-errors":["not_found","internal"],"x-commons-failures":"service"}},"/-/commons/v1/log/tile/{tilePath}":{"get":{"operationId":"logTile","summary":"A tile of the log, or an entry bundle.","description":"`<L>/<N>` or `<L>/<N>.p/<W>` is a tile of up to 256 hashes at level `L`; `entries/<N>` or `entries/<N>.p/<W>` is an entry bundle. `<N>` is written in three-digit groups, every group but the last beginning with `x` (`x001/x234/067`). A path not in this spelling answers 404, never a redirect. Entry bundles are sent with `Content-Encoding: gzip` when `Accept-Encoding` allows it, and always with `Vary: Accept-Encoding`. Immutable.","responses":{"200":{"description":"The tile or the entry bundle.","headers":{"Cache-Control":{"description":"`public, max-age=31536000, immutable`","schema":{"type":"string"}}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","10.5"],"x-commons-body-limit":null,"x-commons-errors":["not_found","internal"],"x-commons-failures":"service","parameters":[{"name":"tilePath","in":"path","required":true,"description":"The rest of the path after `/tile/`: it holds slashes, written as they are.","schema":{"type":"string"}}]}},"/-/commons/v1/log/entries/{index}":{"get":{"operationId":"logEntry","summary":"One log entry, with its proof.","description":"`{ \"log\": <log proof> }` for the entry at `index`, against the latest checkpoint (10.4, 10.5). `Cache-Control: public, max-age=2`.","responses":{"200":{"description":"The proof.","headers":{"Cache-Control":{"description":"`public, max-age=2`","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogEntryResponse"}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","10.5"],"x-commons-body-limit":null,"x-commons-errors":["not_found","internal"],"x-commons-failures":"service","parameters":[{"name":"index","in":"path","required":true,"description":"The entry's index: a decimal integer with no leading zero.","schema":{"type":"string","pattern":"^(?:0|[1-9][0-9]{0,15})$"}}]}},"/-/commons/v1/enrollments":{"post":{"operationId":"createEnrollment","summary":"Start enrolling an account.","description":"Creates a pending enrolment for an account name and a new account key, authenticated by the key's signature over the request in the body (9.2 step 1). The person then opens `verification.url` in a browser and signs in; the CLI polls `GET /-/commons/v1/enrollments/{id}`. Counted against `enrollments_per_address` (9.11). The answer carries `Cache-Control: no-store`.","responses":{"201":{"description":"The pending enrolment.","headers":{"Cache-Control":{"description":"`no-store`","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentResponse"}}}},"400":{"description":"Error: `bad_request`, `provider_unavailable` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request","provider_unavailable"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"401":{"description":"Error: `unauthorized`, `request_expired` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","request_expired"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"409":{"description":"Error: `account_name_reserved`, `account_name_taken` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["account_name_reserved","account_name_taken"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"413":{"description":"Error: `payload_too_large` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["payload_too_large"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"429":{"description":"Error: `quota_exceeded` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["quota_exceeded"]},"message":{"type":"string","minLength":1},"details":{"$ref":"#/components/schemas/QuotaExceededDetails"}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}},"headers":{"Retry-After":{"description":"Seconds until the quota's window ends. Absent for a standing quota (9.11).","schema":{"type":"string"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"account-key","x-commons-sections":["12.2","9.2","9.11"],"x-commons-body-limit":65536,"x-commons-errors":["bad_request","unauthorized","request_expired","account_name_reserved","account_name_taken","provider_unavailable","quota_exceeded","payload_too_large","internal"],"x-commons-failures":"service","requestBody":{"required":true,"description":"`{ request: <envelope> }`: a DSSE envelope of payload type `application/vnd.commons.enrollment-request+json`, whose payload is an `EnrollmentRequestBody` signed by the new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEnrollmentRequest"}}}}}},"/-/commons/v1/enrollments/{id}":{"get":{"operationId":"pollEnrollment","summary":"Poll an enrolment.","description":"Authenticated by the enrolment's poll token, sent as `Authorization: Bearer <token>`. `failure` is set when the state is `failed`, and `account` when it is `verified`. An expired enrolment answers 200 with the state `expired`. Carries `Cache-Control: no-store`.","responses":{"200":{"description":"The enrolment's state.","headers":{"Cache-Control":{"description":"`no-store`","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentState"}}}},"401":{"description":"Error: `unauthorized` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[{"pollToken":[]}],"x-commons-auth":"poll-token","x-commons-sections":["12.2","9.2"],"x-commons-body-limit":null,"x-commons-errors":["not_found","unauthorized","internal"],"x-commons-failures":"service","parameters":[{"name":"id","in":"path","required":true,"description":"The enrolment's ID: `enr_` and 16 lowercase hex characters.","schema":{"type":"string","pattern":"^enr_[0-9a-f]{16}$"}}]}},"/-/commons/v1/enroll/{id}":{"get":{"operationId":"enrollPage","summary":"The enrolment page (a browser).","description":"The page of 9.2 step 4: the account name, the key ID and the code, with a button. For the person's browser, not for a client. It sets a cookie for the enrolment. Every page carries `Cache-Control: no-store` and a restrictive `Content-Security-Policy`. A failure is a page (HTML), not a 12.5 body.","responses":{"200":{"description":"The enrolment page, or the page of a verified enrolment.","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"400":{"description":"A page: the provider is not enabled, or a callback cannot be accepted (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"403":{"description":"A page: the button was pressed without the page's cookie, or the sign-in's identity does not match (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"404":{"description":"A page: no such enrolment, or no such provider (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"409":{"description":"A page: the sign-in identity or the account name is taken (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"410":{"description":"A page: the enrolment has expired (`enrollment_expired`, 9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"502":{"description":"A page: the provider could not be reached or failed (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}}},"security":[],"x-commons-auth":"browser","x-commons-sections":["12.2","9.2"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"html","parameters":[{"name":"id","in":"path","required":true,"description":"The enrolment's ID.","schema":{"type":"string","pattern":"^enr_[0-9a-f]{16}$"}}]},"post":{"operationId":"enrollPress","summary":"The enrolment page's button (a browser).","description":"Posted by the page's form, `application/x-www-form-urlencoded` with the field `token` that the page holds, which must equal the page's cookie. Answers 303 to the provider. A refusal is a page.","responses":{"303":{"description":"To the provider's sign-in. `Location` is the provider's URL.","headers":{"Location":{"description":"the provider's authorisation URL","schema":{"type":"string"}}}},"400":{"description":"A page: the provider is not enabled, or a callback cannot be accepted (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"403":{"description":"A page: the button was pressed without the page's cookie, or the sign-in's identity does not match (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"404":{"description":"A page: no such enrolment, or no such provider (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"409":{"description":"A page: the sign-in identity or the account name is taken (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"410":{"description":"A page: the enrolment has expired (`enrollment_expired`, 9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"413":{"description":"Error: `payload_too_large` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["payload_too_large"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"502":{"description":"A page: the provider could not be reached or failed (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}}},"security":[],"x-commons-auth":"browser","x-commons-sections":["12.2","9.2"],"x-commons-body-limit":65536,"x-commons-errors":["payload_too_large","internal"],"x-commons-failures":"html","parameters":[{"name":"id","in":"path","required":true,"description":"The enrolment's ID.","schema":{"type":"string","pattern":"^enr_[0-9a-f]{16}$"}}],"requestBody":{"required":true,"description":"The form of the enrolment page: one field, `token`.","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}}}}}},"/-/commons/v1/enroll/callback/{provider}":{"get":{"operationId":"enrollCallback","summary":"Where the provider sends the browser back (a browser).","description":"The provider's redirect target (9.2 step 5). The query is the provider's (`state`, and the provider's own parameters). It completes the enrolment and answers a page.","responses":{"200":{"description":"The page of a verified enrolment.","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"400":{"description":"A page: the provider is not enabled, or a callback cannot be accepted (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"403":{"description":"A page: the button was pressed without the page's cookie, or the sign-in's identity does not match (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"404":{"description":"A page: no such enrolment, or no such provider (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"409":{"description":"A page: the sign-in identity or the account name is taken (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"410":{"description":"A page: the enrolment has expired (`enrollment_expired`, 9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"502":{"description":"A page: the provider could not be reached or failed (9.2).","content":{"text/html; charset=utf-8":{"schema":{"type":"string"}}}}},"security":[],"x-commons-auth":"browser","x-commons-sections":["12.2","9.2"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"html","parameters":[{"name":"provider","in":"path","required":true,"description":"The sign-in provider.","schema":{"type":"string","enum":["google","github"]}}]}},"/-/commons/v1/accounts":{"get":{"operationId":"listAccounts","summary":"The accounts that are not revoked.","description":"Sorted by name.","responses":{"200":{"description":"The accounts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountsResponse"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","9.4"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"service"}},"/-/commons/v1/accounts/{account}":{"get":{"operationId":"getAccount","summary":"One account.","description":"The account's current record, the record's envelope and its log proof. An account that does not exist or is revoked answers 404.","responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountPublic"}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","9.4"],"x-commons-body-limit":null,"x-commons-errors":["not_found","internal"],"x-commons-failures":"service","parameters":[{"name":"account","in":"path","required":true,"description":"An account name (4.6). A name that breaks the rule answers 404, not 400.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"}}]}},"/-/commons/v1/accounts/{account}/agents":{"get":{"operationId":"listAgents","summary":"An account's agents.","description":"Each agent with its current grant's envelope, sorted by name. Suspended agents, and agents whose grant has ended, are listed. An account that does not exist or is revoked answers 404.","responses":{"200":{"description":"The agents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentsResponse"}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","9.6"],"x-commons-body-limit":null,"x-commons-errors":["not_found","internal"],"x-commons-failures":"service","parameters":[{"name":"account","in":"path","required":true,"description":"An account name (4.6). A name that breaks the rule answers 404, not 400.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"}}]}},"/-/commons/v1/accounts/{account}/namespaces":{"get":{"operationId":"listNamespaces","summary":"The namespaces an account owns.","description":"Each with its records and their log proofs, sorted by name; an empty list for an account that owns none. An account that does not exist or is revoked answers 404.","responses":{"200":{"description":"The namespaces.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NamespacesResponse"}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","9.5"],"x-commons-body-limit":null,"x-commons-errors":["not_found","internal"],"x-commons-failures":"service","parameters":[{"name":"account","in":"path","required":true,"description":"An account name (4.6). A name that breaks the rule answers 404, not 400.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"}}]}},"/-/commons/v1/accounts/{account}/status":{"post":{"operationId":"setAccountStatus","summary":"Suspend or resume an account and all its agents.","description":"The kill switch (9.10), authenticated by the account key's signature on the statement. The statement's `agent` is `null`. An account the operator suspended cannot be resumed this way (`account_suspended`). A statement that changes nothing is accepted like any other. Logged.","responses":{"200":{"description":"The status now, and the log proof of the entry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountStatusResponse"}}}},"400":{"description":"Error: `bad_request` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"401":{"description":"Error: `unauthorized`, `request_expired` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","request_expired"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"403":{"description":"Error: `unknown_account`, `account_suspended` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unknown_account","account_suspended"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"409":{"description":"Error: `request_replayed` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["request_replayed"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"413":{"description":"Error: `payload_too_large` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["payload_too_large"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"account-key","x-commons-sections":["12.2","9.10"],"x-commons-body-limit":65536,"x-commons-errors":["bad_request","unauthorized","unknown_account","account_suspended","request_expired","request_replayed","not_found","payload_too_large","internal"],"x-commons-failures":"service","parameters":[{"name":"account","in":"path","required":true,"description":"An account name (4.6). A name that breaks the rule answers 404, not 400.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"}}],"requestBody":{"required":true,"description":"`{ statement: <envelope> }`: payload type `application/vnd.commons.status-statement+json`, the payload a `StatusStatementBody`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusChangeRequest"}}}}}},"/-/commons/v1/agents/{account}/{agent}/status":{"post":{"operationId":"setAgentStatus","summary":"Suspend or resume one agent.","description":"The kill switch (9.10), authenticated by the account key's signature on the statement, whose `agent` is the one in the path. Suspending deletes the agent's sessions. Logged.","responses":{"200":{"description":"The status now, and the log proof of the entry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentStatusResponse"}}}},"400":{"description":"Error: `bad_request` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"401":{"description":"Error: `unauthorized`, `request_expired` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","request_expired"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"403":{"description":"Error: `unknown_account` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unknown_account"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"409":{"description":"Error: `request_replayed` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["request_replayed"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"413":{"description":"Error: `payload_too_large` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["payload_too_large"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"account-key","x-commons-sections":["12.2","9.10"],"x-commons-body-limit":65536,"x-commons-errors":["bad_request","unauthorized","unknown_account","request_expired","request_replayed","not_found","payload_too_large","internal"],"x-commons-failures":"service","parameters":[{"name":"account","in":"path","required":true,"description":"An account name (4.6). A name that breaks the rule answers 404, not 400.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"}},{"name":"agent","in":"path","required":true,"description":"An agent name: the account name's rule (4.6).","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"}}],"requestBody":{"required":true,"description":"`{ statement: <envelope> }`: payload type `application/vnd.commons.status-statement+json`, the payload a `StatusStatementBody`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusChangeRequest"}}}}}},"/-/commons/v1/namespaces":{"post":{"operationId":"claimNamespace","summary":"Claim a namespace.","description":"Authenticated by the account key's signature on the namespace request (9.5). A plain namespace is claimed at once (201). A domain answers 202 with the DNS record to publish, and is claimed when a poll finds it. A namespace the account already owns answers 200. Counted against `namespace_claims` and `namespaces_owned` (9.11). The answer carries `Cache-Control: no-store`.","responses":{"200":{"description":"The account already owns the namespace.","headers":{"Cache-Control":{"description":"`no-store`","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NamespaceClaimed"}}}},"201":{"description":"A plain namespace, claimed.","headers":{"Cache-Control":{"description":"`no-store`","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NamespaceClaimed"}}}},"202":{"description":"A domain: the record to publish, and a poll token.","headers":{"Cache-Control":{"description":"`no-store`","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NamespaceClaimPending"}}}},"400":{"description":"Error: `bad_request`, `namespace_invalid`, `namespace_not_registrable` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request","namespace_invalid","namespace_not_registrable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","properties":{"registrable":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["registrable"],"description":"The registrable domain of what was asked, or `null` when what was asked is itself a public suffix (9.5)."}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"401":{"description":"Error: `unauthorized`, `request_expired` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","request_expired"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"403":{"description":"Error: `unknown_account`, `account_suspended` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unknown_account","account_suspended"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"409":{"description":"Error: `request_replayed`, `namespace_reserved`, `namespace_taken` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["request_replayed","namespace_reserved","namespace_taken"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"413":{"description":"Error: `payload_too_large` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["payload_too_large"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"429":{"description":"Error: `quota_exceeded` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["quota_exceeded"]},"message":{"type":"string","minLength":1},"details":{"$ref":"#/components/schemas/QuotaExceededDetails"}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}},"headers":{"Retry-After":{"description":"Seconds until the quota's window ends. Absent for a standing quota (9.11).","schema":{"type":"string"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"account-key","x-commons-sections":["12.2","9.5","9.11"],"x-commons-body-limit":65536,"x-commons-errors":["bad_request","unknown_account","account_suspended","unauthorized","request_expired","request_replayed","namespace_invalid","namespace_not_registrable","namespace_reserved","namespace_taken","quota_exceeded","payload_too_large","internal"],"x-commons-failures":"service","requestBody":{"required":true,"description":"`{ request: <envelope> }`: payload type `application/vnd.commons.namespace-request+json`, the payload a `NamespaceRequestBody`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimNamespaceRequest"}}}}}},"/-/commons/v1/namespace-claims/{id}":{"get":{"operationId":"pollNamespaceClaim","summary":"Poll a domain claim.","description":"Authenticated by the claim's poll token, sent as `Authorization: Bearer <token>`. Looks up the DNS record at most once per `interval`. An expired claim answers 200 with the state `expired`. Carries `Cache-Control: no-store`.","responses":{"200":{"description":"The claim's state.","headers":{"Cache-Control":{"description":"`no-store`","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NamespaceClaimState"}}}},"401":{"description":"Error: `unauthorized` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[{"pollToken":[]}],"x-commons-auth":"poll-token","x-commons-sections":["12.2","9.5"],"x-commons-body-limit":null,"x-commons-errors":["not_found","unauthorized","internal"],"x-commons-failures":"service","parameters":[{"name":"id","in":"path","required":true,"description":"The claim's ID: `nsc_` and 16 lowercase hex characters.","schema":{"type":"string","pattern":"^nsc_[0-9a-f]{16}$"}}]}},"/-/commons/v1/namespaces/{namespace}":{"get":{"operationId":"getNamespace","summary":"One namespace.","description":"With its ownership history and the log proof of each record. A namespace nobody has claimed, and a reserved one, answer 404.","responses":{"200":{"description":"The namespace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NamespacePublic"}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","9.5"],"x-commons-body-limit":null,"x-commons-errors":["not_found","internal"],"x-commons-failures":"service","parameters":[{"name":"namespace","in":"path","required":true,"description":"A namespace without `@` (4.6): a plain name or a domain. It may contain dots. A name that breaks the rule answers 404.","schema":{"type":"string","pattern":"^(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$","maxLength":100}}]}},"/-/commons/v1/agents":{"post":{"operationId":"registerAgent","summary":"Register an agent's grant.","description":"Authenticated by the account key's signature on the grant (9.6). A grant for a new agent name creates the agent (201); a later grant for the same agent and key becomes its current grant (201); an identical grant sent again answers 200 with the original response. Counted against `agents_active` for a new agent name (9.11).","responses":{"200":{"description":"An identical grant, registered before.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegistrationResponse"}}}},"201":{"description":"The grant is registered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegistrationResponse"}}}},"400":{"description":"Error: `bad_request` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"401":{"description":"Error: `grant_expired` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["grant_expired"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"403":{"description":"Error: `unknown_account`, `account_suspended`, `grant_invalid` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unknown_account","account_suspended","grant_invalid"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"409":{"description":"Error: `agent_exists` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["agent_exists"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"413":{"description":"Error: `payload_too_large` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["payload_too_large"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"429":{"description":"Error: `quota_exceeded` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["quota_exceeded"]},"message":{"type":"string","minLength":1},"details":{"$ref":"#/components/schemas/QuotaExceededDetails"}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}},"headers":{"Retry-After":{"description":"Seconds until the quota's window ends. Absent for a standing quota (9.11).","schema":{"type":"string"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"account-key","x-commons-sections":["12.2","9.6","9.11"],"x-commons-body-limit":65536,"x-commons-errors":["bad_request","unknown_account","account_suspended","grant_invalid","grant_expired","quota_exceeded","agent_exists","payload_too_large","internal"],"x-commons-failures":"service","requestBody":{"required":true,"description":"`{ grant: <envelope> }`: payload type `application/vnd.commons.agent-grant+json`, the payload an `AgentGrantBody`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegistrationRequest"}}}}}},"/-/commons/v1/certificates":{"post":{"operationId":"createCertificate","summary":"Certify an ephemeral key for ten minutes.","description":"Authenticated by the agent key's signature on the certificate request (9.7). The certificate names an account and an agent, and is logged. The ephemeral key signs attestations and nothing else. Counted against `certificates` (9.11).","responses":{"201":{"description":"The certificate and its log proof.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificateResponse"}}}},"400":{"description":"Error: `bad_request` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"401":{"description":"Error: `unauthorized`, `request_expired`, `grant_superseded`, `grant_expired` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","request_expired","grant_superseded","grant_expired"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"403":{"description":"Error: `account_suspended`, `agent_suspended` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["account_suspended","agent_suspended"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"409":{"description":"Error: `request_replayed`, `key_already_certified` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["request_replayed","key_already_certified"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"413":{"description":"Error: `payload_too_large` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["payload_too_large"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"429":{"description":"Error: `quota_exceeded` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["quota_exceeded"]},"message":{"type":"string","minLength":1},"details":{"$ref":"#/components/schemas/QuotaExceededDetails"}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}},"headers":{"Retry-After":{"description":"Seconds until the quota's window ends. Absent for a standing quota (9.11).","schema":{"type":"string"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"agent-key","x-commons-sections":["12.2","9.7","9.11"],"x-commons-body-limit":65536,"x-commons-errors":["bad_request","unauthorized","request_expired","request_replayed","account_suspended","agent_suspended","grant_superseded","grant_expired","key_already_certified","quota_exceeded","payload_too_large","internal"],"x-commons-failures":"service","requestBody":{"required":true,"description":"`{ request: <envelope> }`: payload type `application/vnd.commons.certificate-request+json`, the payload a `CertificateRequestBody`, signed by the agent key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCertificateRequest"}}}}}},"/-/commons/v1/sessions":{"post":{"operationId":"createSession","summary":"Open a session of ten minutes.","description":"Authenticated by the agent key's signature on the session request (9.8). The token authenticates `publish` and `whoami`. Counted against `sessions` (9.11). The answer carries `Cache-Control: no-store`.","responses":{"201":{"description":"The session token.","headers":{"Cache-Control":{"description":"`no-store`","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}},"400":{"description":"Error: `bad_request` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"401":{"description":"Error: `unauthorized`, `request_expired`, `grant_superseded`, `grant_expired` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","request_expired","grant_superseded","grant_expired"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"403":{"description":"Error: `account_suspended`, `agent_suspended` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["account_suspended","agent_suspended"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"409":{"description":"Error: `request_replayed` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["request_replayed"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"413":{"description":"Error: `payload_too_large` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["payload_too_large"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"429":{"description":"Error: `quota_exceeded` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["quota_exceeded"]},"message":{"type":"string","minLength":1},"details":{"$ref":"#/components/schemas/QuotaExceededDetails"}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}},"headers":{"Retry-After":{"description":"Seconds until the quota's window ends. Absent for a standing quota (9.11).","schema":{"type":"string"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"agent-key","x-commons-sections":["12.2","9.8","9.11"],"x-commons-body-limit":65536,"x-commons-errors":["bad_request","unauthorized","request_expired","request_replayed","account_suspended","agent_suspended","grant_superseded","grant_expired","quota_exceeded","payload_too_large","internal"],"x-commons-failures":"service","requestBody":{"required":true,"description":"`{ request: <envelope> }`: payload type `application/vnd.commons.session-request+json`, the payload a `SessionRequestBody`, signed by the agent key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionRequest"}}}}}},"/-/commons/v1/whoami":{"get":{"operationId":"whoami","summary":"Who a session is.","description":"Authenticated by a session token, sent as `Authorization: Bearer <token>`. Carries `Cache-Control: no-store`.","responses":{"200":{"description":"The agent, its account and the namespaces the account owns.","headers":{"Cache-Control":{"description":"`no-store`","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhoamiResponse"}}}},"401":{"description":"Error: `unauthorized`, `session_expired` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","session_expired"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"403":{"description":"Error: `account_suspended`, `agent_suspended` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["account_suspended","agent_suspended"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[{"sessionToken":[]}],"x-commons-auth":"session","x-commons-sections":["12.2","9.8"],"x-commons-body-limit":null,"x-commons-errors":["unauthorized","session_expired","account_suspended","agent_suspended","internal"],"x-commons-failures":"service"}},"/-/commons/v1/publish":{"post":{"operationId":"publish","summary":"Publish a version.","description":"Authenticated by a session token, sent as `Authorization: Bearer <token>`; the session is judged before the body is read. The body limit is 25165824 bytes (24 MiB). The nine gates of 7.2 run in order; a version that passes every gate is stored and logged. A rejection answers 422 with the same `PublishResult` body, `status: \"rejected\"` and the rejections; it is not a 12.5 error. Counted against `publish_attempts`, `versions_published` and `bytes_published` (9.11).","responses":{"200":{"description":"Published, or unchanged: the same artifacts were published before.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishResult"}}}},"400":{"description":"Error: `bad_request` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"401":{"description":"Error: `unauthorized`, `session_expired` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","session_expired"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"403":{"description":"Error: `account_suspended`, `agent_suspended` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["account_suspended","agent_suspended"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"413":{"description":"Error: `payload_too_large` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["payload_too_large"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"422":{"description":"Rejected by a gate. Nothing was stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishResult"}}}},"429":{"description":"Error: `quota_exceeded` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["quota_exceeded"]},"message":{"type":"string","minLength":1},"details":{"$ref":"#/components/schemas/QuotaExceededDetails"}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}},"headers":{"Retry-After":{"description":"Seconds until the quota's window ends. Absent for a standing quota (9.11).","schema":{"type":"string"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[{"sessionToken":[]}],"x-commons-auth":"session","x-commons-sections":["12.2","7","9.11"],"x-commons-body-limit":25165824,"x-commons-errors":["unauthorized","session_expired","account_suspended","agent_suspended","bad_request","quota_exceeded","payload_too_large","internal"],"x-commons-failures":"service","requestBody":{"required":true,"description":"`tarball`: base64 of the `npm pack` tarball; `sourceBundle`: base64 of the source bundle (6.3); `attestations`: 0 to 8 DSSE envelopes (8).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRequest"}}}}}},"/-/commons/v1/search":{"get":{"operationId":"search","summary":"Search the packages.","description":"Full-text search over MVP 1's packages (PoC 12.2, 5.5). Each result gains `package`, its package URL. Query parameters other than `q` and `limit` are ignored.","responses":{"200":{"description":"The results, best first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"400":{"description":"Error: `bad_request` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","5.5","PoC 12.2"],"x-commons-body-limit":null,"x-commons-errors":["bad_request","internal"],"x-commons-failures":"service","parameters":[{"name":"q","in":"query","required":true,"description":"The query: 1 to 512 characters.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"How many results: an integer from 1 to 50. Default 10.","schema":{"type":"integer","minimum":1,"maximum":50}}]}},"/-/commons/v1/packages/{ecosystem}/{namespace}/{name}":{"get":{"operationId":"getPackageLatest","summary":"The package record of a package's latest version.","description":"Everything a consumer needs to check a version (12.4, 11): the artifacts, the attestations with their envelopes and log proofs, the signers, the accounts and the namespace. A path that cannot name anything answers 404, not 400.","responses":{"200":{"description":"The package record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageRecord"}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","12.4","4.6"],"x-commons-body-limit":null,"x-commons-errors":["not_found","internal"],"x-commons-failures":"service","parameters":[{"name":"ecosystem","in":"path","required":true,"description":"`npm` in MVP 1; any other answers 404.","schema":{"type":"string","enum":["npm"]}},{"name":"namespace","in":"path","required":true,"description":"The namespace without `@` (4.6).","schema":{"type":"string","pattern":"^(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$","maxLength":100}},{"name":"name","in":"path","required":true,"description":"The package's name without its namespace (4.6): `a-z`, `0-9` and `-`, 1 to 64 characters, not starting with `-`.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}}]}},"/-/commons/v1/packages/{ecosystem}/{namespace}/{name}/{version}":{"get":{"operationId":"getPackageVersion","summary":"The package record of one version.","description":"As the latest version's, for the version named: `MAJOR.MINOR.PATCH`.","responses":{"200":{"description":"The package record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageRecord"}}}},"404":{"description":"Error: `not_found` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","12.4","4.6"],"x-commons-body-limit":null,"x-commons-errors":["not_found","internal"],"x-commons-failures":"service","parameters":[{"name":"ecosystem","in":"path","required":true,"description":"`npm` in MVP 1; any other answers 404.","schema":{"type":"string","enum":["npm"]}},{"name":"namespace","in":"path","required":true,"description":"The namespace without `@` (4.6).","schema":{"type":"string","pattern":"^(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$","maxLength":100}},{"name":"name","in":"path","required":true,"description":"The package's name without its namespace (4.6): `a-z`, `0-9` and `-`, 1 to 64 characters, not starting with `-`.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},{"name":"version","in":"path","required":true,"description":"`MAJOR.MINOR.PATCH`, with no prerelease or build part.","schema":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,8})\\.(?:0|[1-9]\\d{0,8})\\.(?:0|[1-9]\\d{0,8})$"}}]}},"/-/commons/v1/policy":{"get":{"operationId":"policy","summary":"The policy layers beneath a package's own.","description":"`floor` is always the platform floor; `platform` is the operator's layer, or `null`.","responses":{"200":{"description":"The layers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPolicyResponse"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.2","8.7"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"service"}},"/-/commons/v1/openapi.json":{"get":{"operationId":"openapi","summary":"This document.","description":"The OpenAPI document, built once when the service starts. Its `servers` entry is the instance's service URL.","responses":{"200":{"description":"The OpenAPI document.","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Error: `internal` (12.5).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal"]},"message":{"type":"string","minLength":1}},"required":["code","message"],"description":"`details` is there for the codes that define it: `quota_exceeded` and `namespace_not_registrable`."}},"required":["error"]}}}}},"security":[],"x-commons-auth":"none","x-commons-sections":["12.1","12.2"],"x-commons-body-limit":null,"x-commons-errors":["internal"],"x-commons-failures":"service"}}},"components":{"schemas":{"DsseEnvelope":{"type":"object","properties":{"payloadType":{"type":"string","minLength":1,"maxLength":200},"payload":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"signatures":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"object","properties":{"keyid":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sig":{"type":"string","pattern":"^[A-Za-z0-9+/]{86}==$"}},"required":["keyid","sig"],"additionalProperties":false}}},"required":["payloadType","payload","signatures"],"additionalProperties":false},"LogProof":{"type":"object","properties":{"entry":{"type":"string","minLength":4,"maxLength":87380,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"proof":{"type":"string","pattern":"^c2sp\\.org\\/tlog-proof@v1\\n(?:extra (?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?\\n)?index (?:0|[1-9][0-9]*)\\n(?:[A-Za-z0-9+/]{43}=\\n)*\\n[^\\n][\\s\\S]*\\n$"}},"required":["entry","proof"]},"QuotaExceededDetails":{"type":"object","properties":{"quota":{"type":"string","minLength":1},"limit":{"type":"integer","minimum":0,"maximum":9007199254740991},"used":{"type":"integer","minimum":0,"maximum":9007199254740991},"resetsAt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},{"type":"null"}]}},"required":["quota","limit","used","resetsAt"]},"TrustRoot":{"type":"object","properties":{"version":{"type":"number","const":1},"instance":{"type":"string","pattern":"^https?:\\/\\/[^\\s/?#]+$"},"issuers":{"minItems":1,"type":"array","items":{"type":"object","properties":{"keyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"publicKey":{"type":"string","pattern":"^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$"}},"required":["keyId","publicKey"]}},"log":{"type":"object","properties":{"origin":{"type":"string","minLength":1},"key":{"type":"string","maxLength":4096,"pattern":"^[^\\s+]+\\+[0-9a-f]{8}\\+(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"witnesses":{"type":"array","items":{"type":"string","maxLength":4096,"pattern":"^[^\\s+]+\\+[0-9a-f]{8}\\+(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"}},"witnessThreshold":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["origin","key","witnesses","witnessThreshold"]}},"required":["version","instance","issuers","log"],"description":"`log.origin` is the one the instance's service URL gives; `log.key` is named for the origin; `log.witnessThreshold` is at most the number of witnesses; no issuer is listed twice (10.3)."},"EnrollmentRequestBody":{"type":"object","properties":{"version":{"type":"number","const":1},"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"provider":{"type":"string","enum":["google","github"]},"publicKey":{"type":"string","pattern":"^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$"},"audience":{"type":"string","pattern":"^https?:\\/\\/[^\\s/?#]+$"},"requestedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"rotate":{"type":"boolean"}},"required":["version","account","provider","publicKey","audience","requestedAt","rotate"],"additionalProperties":false},"EnrollmentRequestEnvelope":{"type":"object","properties":{"payloadType":{"type":"string","const":"application/vnd.commons.enrollment-request+json"},"payload":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"signatures":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"object","properties":{"keyid":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sig":{"type":"string","pattern":"^[A-Za-z0-9+/]{86}==$"}},"required":["keyid","sig"],"additionalProperties":false}}},"required":["payloadType","payload","signatures"],"additionalProperties":false},"CreateEnrollmentRequest":{"type":"object","properties":{"request":{"$ref":"#/components/schemas/EnrollmentRequestEnvelope"}},"required":["request"],"additionalProperties":false},"EnrollmentResponse":{"type":"object","properties":{"id":{"type":"string","pattern":"^enr_[0-9a-f]{16}$"},"pollToken":{"type":"string","pattern":"^cmp_[0-9a-f]{64}$"},"expiresAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"interval":{"type":"integer","minimum":1,"maximum":9007199254740991},"verification":{"type":"object","properties":{"type":{"type":"string","const":"browser"},"url":{"type":"string","format":"uri"},"userCode":{"type":"string","pattern":"^[BCDFGHJKLMNPQRSTVWXZ]{4}-[BCDFGHJKLMNPQRSTVWXZ]{4}$"}},"required":["type","url","userCode"]}},"required":["id","pollToken","expiresAt","interval","verification"]},"EnrollmentState":{"type":"object","properties":{"state":{"type":"string","enum":["pending","verified","failed","expired"]},"failure":{"anyOf":[{"type":"string","enum":["identity_taken","identity_mismatch","email_unverified","provider_error","cancelled","account_name_taken"]},{"type":"null"}]},"account":{"anyOf":[{"$ref":"#/components/schemas/AccountPublic"},{"type":"null"}]}},"required":["state","failure","account"],"description":"`failure` is set exactly when `state` is `failed`; `account` exactly when it is `verified`."},"AccountRecordBody":{"type":"object","properties":{"version":{"type":"number","const":1},"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"identity":{"type":"object","properties":{"provider":{"type":"string","enum":["google","github","operator"]}},"required":["provider"],"additionalProperties":false},"publicKey":{"type":"string","pattern":"^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$"},"keyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"verifiedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"supersedes":{"anyOf":[{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},{"type":"null"}]}},"required":["version","account","sequence","identity","publicKey","keyId","verifiedAt","supersedes"],"additionalProperties":false,"description":"`supersedes` is `null` exactly when `sequence` is 1."},"AccountRecordEnvelope":{"type":"object","properties":{"payloadType":{"type":"string","const":"application/vnd.commons.account-record+json"},"payload":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"signatures":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"object","properties":{"keyid":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sig":{"type":"string","pattern":"^[A-Za-z0-9+/]{86}==$"}},"required":["keyid","sig"],"additionalProperties":false}}},"required":["payloadType","payload","signatures"],"additionalProperties":false},"AccountPublic":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"status":{"type":"string","enum":["active","suspended"]},"identity":{"type":"object","properties":{"provider":{"type":"string","enum":["google","github","operator"]}},"required":["provider"]},"keyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"publicKey":{"type":"string","pattern":"^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$"},"verifiedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"record":{"$ref":"#/components/schemas/AccountRecordEnvelope"},"log":{"$ref":"#/components/schemas/LogProof"}},"required":["name","status","identity","keyId","publicKey","verifiedAt","record","log"]},"AccountsResponse":{"type":"object","properties":{"accounts":{"type":"array","items":{"$ref":"#/components/schemas/AccountPublic"}}},"required":["accounts"]},"StatusStatementBody":{"type":"object","properties":{"version":{"type":"number","const":1},"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"agent":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},{"type":"null"}]},"status":{"type":"string","enum":["suspended","active"]},"audience":{"type":"string","pattern":"^https?:\\/\\/[^\\s/?#]+$"},"requestedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"nonce":{"type":"string","pattern":"^[0-9a-f]{32}$"}},"required":["version","account","agent","status","audience","requestedAt","nonce"],"additionalProperties":false},"StatusStatementEnvelope":{"type":"object","properties":{"payloadType":{"type":"string","const":"application/vnd.commons.status-statement+json"},"payload":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"signatures":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"object","properties":{"keyid":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sig":{"type":"string","pattern":"^[A-Za-z0-9+/]{86}==$"}},"required":["keyid","sig"],"additionalProperties":false}}},"required":["payloadType","payload","signatures"],"additionalProperties":false},"StatusChangeRequest":{"type":"object","properties":{"statement":{"$ref":"#/components/schemas/StatusStatementEnvelope"}},"required":["statement"],"additionalProperties":false},"AccountStatusResponse":{"type":"object","properties":{"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"status":{"type":"string","enum":["active","suspended","revoked"]},"log":{"$ref":"#/components/schemas/LogProof"}},"required":["account","status","log"]},"AgentStatusResponse":{"type":"object","properties":{"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"agent":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"status":{"type":"string","enum":["active","suspended"]},"log":{"$ref":"#/components/schemas/LogProof"}},"required":["account","agent","status","log"]},"NamespaceRequestBody":{"type":"object","properties":{"version":{"type":"number","const":1},"action":{"type":"string","enum":["claim"]},"namespace":{"type":"string","pattern":"^(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$","maxLength":100},"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"accountKeyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"audience":{"type":"string","pattern":"^https?:\\/\\/[^\\s/?#]+$"},"requestedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"nonce":{"type":"string","pattern":"^[0-9a-f]{32}$"}},"required":["version","action","namespace","account","accountKeyId","audience","requestedAt","nonce"],"additionalProperties":false},"NamespaceRequestEnvelope":{"type":"object","properties":{"payloadType":{"type":"string","const":"application/vnd.commons.namespace-request+json"},"payload":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"signatures":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"object","properties":{"keyid":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sig":{"type":"string","pattern":"^[A-Za-z0-9+/]{86}==$"}},"required":["keyid","sig"],"additionalProperties":false}}},"required":["payloadType","payload","signatures"],"additionalProperties":false},"ClaimNamespaceRequest":{"type":"object","properties":{"request":{"$ref":"#/components/schemas/NamespaceRequestEnvelope"}},"required":["request"],"additionalProperties":false},"NamespaceRecordBody":{"type":"object","properties":{"version":{"type":"number","const":1},"namespace":{"type":"string","pattern":"^(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$","maxLength":100},"kind":{"type":"string","enum":["plain","domain"]},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"event":{"type":"string","enum":["claim","takeover","transfer"]},"owner":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"previousOwner":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},{"type":"null"}]},"request":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"proof":{"anyOf":[{"type":"object","properties":{"method":{"type":"string","const":"dns-txt"},"name":{"type":"string","minLength":1,"maxLength":200},"publicSuffix":{"type":"string","maxLength":100},"checkedAt":{"minItems":1,"maxItems":2,"type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"}}},"required":["method","name","publicSuffix","checkedAt"],"additionalProperties":false},{"type":"null"}]},"at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"supersedes":{"anyOf":[{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},{"type":"null"}]}},"required":["version","namespace","kind","sequence","event","owner","previousOwner","request","proof","at","supersedes"],"additionalProperties":false,"description":"`kind` is `domain` exactly when the namespace has a dot; `proof` is `null` exactly for a plain namespace; `supersedes` is `null` exactly when `sequence` is 1; `previousOwner` is set only for a takeover or a transfer (9.5)."},"NamespaceRecordEnvelope":{"type":"object","properties":{"payloadType":{"type":"string","const":"application/vnd.commons.namespace-record+json"},"payload":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"signatures":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"object","properties":{"keyid":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sig":{"type":"string","pattern":"^[A-Za-z0-9+/]{86}==$"}},"required":["keyid","sig"],"additionalProperties":false}}},"required":["payloadType","payload","signatures"],"additionalProperties":false},"NamespacePublic":{"type":"object","properties":{"name":{"type":"string","pattern":"^(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$","maxLength":100},"kind":{"type":"string","enum":["plain","domain"]},"owner":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"records":{"minItems":1,"type":"array","items":{"type":"object","properties":{"record":{"$ref":"#/components/schemas/NamespaceRecordEnvelope"},"request":{"$ref":"#/components/schemas/NamespaceRequestEnvelope"},"log":{"$ref":"#/components/schemas/LogProof"}},"required":["record","request","log"]}}},"required":["name","kind","owner","sequence","records"]},"NamespacesResponse":{"type":"object","properties":{"namespaces":{"type":"array","items":{"$ref":"#/components/schemas/NamespacePublic"}}},"required":["namespaces"]},"NamespaceClaimed":{"type":"object","properties":{"state":{"type":"string","const":"claimed"},"namespace":{"$ref":"#/components/schemas/NamespacePublic"}},"required":["state","namespace"]},"NamespaceClaimPending":{"type":"object","properties":{"state":{"type":"string","const":"pending"},"id":{"type":"string","pattern":"^nsc_[0-9a-f]{16}$"},"pollToken":{"type":"string","pattern":"^cmp_[0-9a-f]{64}$"},"expiresAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"interval":{"type":"integer","minimum":1,"maximum":9007199254740991},"challenge":{"type":"object","properties":{"type":{"type":"string","const":"dns-txt"},"name":{"type":"string","minLength":1,"maxLength":200},"value":{"type":"string","pattern":"^commons-namespace=[0-9a-f]{64}$"}},"required":["type","name","value"]}},"required":["state","id","pollToken","expiresAt","interval","challenge"]},"NamespaceClaimState":{"type":"object","properties":{"state":{"type":"string","enum":["pending","claimed","failed","expired"]},"failure":{"anyOf":[{"type":"string","enum":["namespace_taken","namespace_reserved","account_suspended","quota_exceeded"]},{"type":"null"}]},"namespace":{"anyOf":[{"$ref":"#/components/schemas/NamespacePublic"},{"type":"null"}]}},"required":["state","failure","namespace"],"description":"`failure` is set exactly when `state` is `failed`; `namespace` exactly when it is `claimed`."},"AgentGrantBody":{"type":"object","properties":{"version":{"type":"number","const":1},"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"agent":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"publicKey":{"type":"string","pattern":"^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$"},"accountKeyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"notBefore":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"notAfter":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"}},"required":["version","account","agent","publicKey","accountKeyId","notBefore","notAfter"],"additionalProperties":false,"description":"`notAfter` is at least one hour and at most 90 days after `notBefore`."},"AgentGrantEnvelope":{"type":"object","properties":{"payloadType":{"type":"string","const":"application/vnd.commons.agent-grant+json"},"payload":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"signatures":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"object","properties":{"keyid":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sig":{"type":"string","pattern":"^[A-Za-z0-9+/]{86}==$"}},"required":["keyid","sig"],"additionalProperties":false}}},"required":["payloadType","payload","signatures"],"additionalProperties":false},"AgentRegistrationRequest":{"type":"object","properties":{"grant":{"$ref":"#/components/schemas/AgentGrantEnvelope"}},"required":["grant"],"additionalProperties":false},"AgentRegistrationResponse":{"type":"object","properties":{"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"agent":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"keyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"grant":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"notBefore":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"notAfter":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"status":{"type":"string","enum":["active","suspended"]},"registeredAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"}},"required":["account","agent","keyId","grant","notBefore","notAfter","status","registeredAt"]},"AgentsResponse":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"object","properties":{"agent":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"keyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"status":{"type":"string","enum":["active","suspended"]},"notBefore":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"notAfter":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"grant":{"$ref":"#/components/schemas/AgentGrantEnvelope"}},"required":["agent","keyId","status","notBefore","notAfter","grant"]}}},"required":["agents"]},"CertificateRequestBody":{"type":"object","properties":{"version":{"type":"number","const":1},"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"agent":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"audience":{"type":"string","pattern":"^https?:\\/\\/[^\\s/?#]+$"},"requestedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"nonce":{"type":"string","pattern":"^[0-9a-f]{32}$"},"publicKey":{"type":"string","pattern":"^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$"},"possession":{"type":"string","pattern":"^[A-Za-z0-9+/]{86}==$"}},"required":["version","account","agent","audience","requestedAt","nonce","publicKey","possession"],"additionalProperties":false},"CertificateRequestEnvelope":{"type":"object","properties":{"payloadType":{"type":"string","const":"application/vnd.commons.certificate-request+json"},"payload":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"signatures":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"object","properties":{"keyid":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sig":{"type":"string","pattern":"^[A-Za-z0-9+/]{86}==$"}},"required":["keyid","sig"],"additionalProperties":false}}},"required":["payloadType","payload","signatures"],"additionalProperties":false},"CreateCertificateRequest":{"type":"object","properties":{"request":{"$ref":"#/components/schemas/CertificateRequestEnvelope"}},"required":["request"],"additionalProperties":false},"AgentCertificateBody":{"type":"object","properties":{"version":{"type":"number","const":1},"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"agent":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"authority":{"type":"string","enum":["grant"]},"grant":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"accountKeyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"publicKey":{"type":"string","pattern":"^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$"},"keyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"notBefore":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"notAfter":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"}},"required":["version","account","agent","authority","grant","accountKeyId","publicKey","keyId","notBefore","notAfter"],"additionalProperties":false,"description":"`notAfter` is after `notBefore`, by at most the certificate lifetime (ten minutes)."},"AgentCertificateEnvelope":{"type":"object","properties":{"payloadType":{"type":"string","const":"application/vnd.commons.agent-certificate+json"},"payload":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"signatures":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"object","properties":{"keyid":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sig":{"type":"string","pattern":"^[A-Za-z0-9+/]{86}==$"}},"required":["keyid","sig"],"additionalProperties":false}}},"required":["payloadType","payload","signatures"],"additionalProperties":false},"CertificateResponse":{"type":"object","properties":{"certificate":{"$ref":"#/components/schemas/AgentCertificateEnvelope"},"log":{"$ref":"#/components/schemas/LogProof"}},"required":["certificate","log"]},"SessionRequestBody":{"type":"object","properties":{"version":{"type":"number","const":1},"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"agent":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"audience":{"type":"string","pattern":"^https?:\\/\\/[^\\s/?#]+$"},"requestedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"nonce":{"type":"string","pattern":"^[0-9a-f]{32}$"}},"required":["version","account","agent","audience","requestedAt","nonce"],"additionalProperties":false},"SessionRequestEnvelope":{"type":"object","properties":{"payloadType":{"type":"string","const":"application/vnd.commons.session-request+json"},"payload":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"signatures":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"object","properties":{"keyid":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sig":{"type":"string","pattern":"^[A-Za-z0-9+/]{86}==$"}},"required":["keyid","sig"],"additionalProperties":false}}},"required":["payloadType","payload","signatures"],"additionalProperties":false},"CreateSessionRequest":{"type":"object","properties":{"request":{"$ref":"#/components/schemas/SessionRequestEnvelope"}},"required":["request"],"additionalProperties":false},"SessionResponse":{"type":"object","properties":{"token":{"type":"string","pattern":"^cms_[0-9a-f]{64}$"},"expiresAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"}},"required":["token","expiresAt"]},"WhoamiResponse":{"type":"object","properties":{"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"agent":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"keyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sessionExpiresAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"grantNotAfter":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"namespaces":{"type":"array","items":{"type":"string","pattern":"^(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$","maxLength":100}}},"required":["account","agent","keyId","sessionExpiresAt","grantNotAfter","namespaces"]},"PublishRequest":{"type":"object","properties":{"tarball":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"sourceBundle":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"attestations":{"maxItems":8,"type":"array","items":{}}},"required":["tarball","attestations"],"additionalProperties":false},"PublishResult":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":"string","enum":["published","unchanged","rejected"]},"name":{"anyOf":[{"type":"string","pattern":"^@(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)/[a-z0-9][a-z0-9-]{0,63}$"},{"type":"null"}]},"version":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d{0,8})\\.(?:0|[1-9]\\d{0,8})\\.(?:0|[1-9]\\d{0,8})$"},{"type":"null"}]},"digest":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sourceDigest":{"anyOf":[{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},{"type":"null"}]},"tarball":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},{"type":"null"}]},"rejections":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"string","enum":["integrity","manifest","source","namespace","version","license","scripts","policy","attestation"]},"code":{"type":"string","enum":["integrity.not_a_tarball","integrity.tarball_too_large","integrity.unpacked_too_large","integrity.too_many_files","integrity.unsafe_path","integrity.unsupported_entry","integrity.duplicate_path","integrity.reserved_path","manifest.missing","manifest.not_json","manifest.invalid","manifest.types_not_found","source.missing","source.not_a_tarball","source.bundle_too_large","source.unpacked_too_large","source.too_many_files","source.unsafe_path","source.unsupported_entry","source.duplicate_path","source.reserved_path","source.manifest_mismatch","source.lockfile_missing","source.standards_missing","source.build_output","source.undeclared_file","namespace.not_claimed","namespace.not_owner","version.already_published","license.not_allowed","license.dependency_not_in_commons","license.dependency_unresolvable","license.bundled_dependency","scripts.install_script","scripts.native_build","policy.invalid","attestation.missing","attestation.malformed","attestation.format_superseded","attestation.unknown_signer","attestation.bad_signature","attestation.certificate_invalid","attestation.certificate_not_yet_valid","attestation.certificate_expired","attestation.signer_suspended","attestation.signer_not_owner","attestation.subject_mismatch","attestation.result_not_pass","attestation.skill_not_allowed","attestation.model_not_sanctioned"]},"message":{"type":"string","minLength":1,"maxLength":2000},"path":{"anyOf":[{"type":"string","minLength":1,"maxLength":1024},{"type":"null"}]},"fix":{"type":"string","minLength":1,"maxLength":2000},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["gate","code","message","path","fix"]}},"gates":{"maxItems":9,"type":"array","items":{"type":"object","properties":{"gate":{"type":"string","enum":["integrity","manifest","source","namespace","version","license","scripts","policy","attestation"]},"status":{"type":"string","enum":["passed","rejected","skipped"]},"durationMs":{"type":"number","minimum":0}},"required":["gate","status","durationMs"]}},"log":{"type":"array","items":{"$ref":"#/components/schemas/LogProof"}}},"required":["ok","status","name","version","digest","sourceDigest","tarball","source","publishedAt","rejections","gates","log"],"description":"`ok` is false exactly when `status` is `rejected`; `rejections` is non-empty exactly then; `name`, `version`, `sourceDigest`, `tarball`, `source` and `publishedAt` are set unless rejected; `log` is empty when rejected and non-empty when published."},"SearchResponse":{"type":"object","properties":{"query":{"type":"string"},"results":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"package":{"type":"string","pattern":"^pkg:npm/%40(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)/[a-z0-9][a-z0-9-]{0,63}$"},"name":{"type":"string","pattern":"^@(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)/[a-z0-9][a-z0-9-]{0,63}$"},"version":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,8})\\.(?:0|[1-9]\\d{0,8})\\.(?:0|[1-9]\\d{0,8})$"},"description":{"type":"string"},"license":{"type":"string"},"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"accountIdentity":{"type":"object","properties":{"provider":{"type":"string","enum":["google","github","operator"]},"verifiedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"}},"required":["provider","verifiedAt"]},"digest":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"publishedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"capabilities":{"type":"array","items":{"type":"string","minLength":10,"maxLength":200,"pattern":"^[^\\r\\n]*$"}},"score":{"type":"number"},"attestations":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["test-run","code-review"]},"result":{"type":"string","enum":["pass","fail"]},"skill":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"digest":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}},"required":["name","digest"]},"declaredModel":{"type":"object","properties":{"provider":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$"},"id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:@-]{0,127}$"}},"required":["provider","id"]},"signer":{"type":"object","properties":{"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"agent":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"keyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}},"required":["account","agent","keyId"]},"loggedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"}},"required":["type","result","skill","declaredModel","signer","loggedAt"]}}},"required":["package","name","version","description","license","account","digest","publishedAt","capabilities","score","attestations"]}}},"required":["query","results"]},"PackageRecord":{"type":"object","properties":{"package":{"type":"string","pattern":"^pkg:npm/%40(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)/[a-z0-9][a-z0-9-]{0,63}$"},"name":{"type":"string","pattern":"^@(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)/[a-z0-9][a-z0-9-]{0,63}$"},"version":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,8})\\.(?:0|[1-9]\\d{0,8})\\.(?:0|[1-9]\\d{0,8})$"},"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"state":{"type":"string","minLength":1},"tier":{"type":"string","minLength":1},"publishedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"publisher":{"type":"object","properties":{"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"agent":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"keyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}},"required":["account","agent","keyId"]},"dist":{"type":"object","properties":{"digest":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"integrity":{"type":"string","pattern":"^sha512-[A-Za-z0-9+/]{86}==$"},"shasum":{"type":"string","pattern":"^[0-9a-f]{40}$"},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"tarball":{"type":"string","format":"uri"},"source":{"type":"object","properties":{"digest":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string","format":"uri"}},"required":["digest","size","url"]}},"required":["digest","integrity","shasum","size","tarball","source"]},"manifest":{"type":"object","properties":{"name":{"type":"string","pattern":"^@(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)/[a-z0-9][a-z0-9-]{0,63}$"},"version":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,8})\\.(?:0|[1-9]\\d{0,8})\\.(?:0|[1-9]\\d{0,8})$"},"description":{"type":"string","minLength":1,"maxLength":500},"license":{"type":"string","minLength":1,"maxLength":100},"types":{"type":"string","maxLength":255,"pattern":"\\.d\\.(?:ts|mts|cts)$"},"files":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},"commons":{"type":"object","properties":{"capabilities":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"string","minLength":10,"maxLength":200,"pattern":"^[^\\r\\n]*$"}},"runtimes":{"minItems":1,"type":"array","items":{"type":"string","enum":["node","browser","deno","bun","workerd"]}},"sideEffects":{"type":"array","items":{"type":"string","enum":["filesystem","network","subprocess","environment"]}},"source":{"type":"object","properties":{"files":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[^\\\\\\u0000-\\u001f]*$"}},"exclude":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[^\\\\\\u0000-\\u001f]*$"}},"standards":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[^\\\\\\u0000-\\u001f]*$"},"build":{"type":"object","properties":{"command":{"type":"string","minLength":1,"maxLength":500},"output":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[^\\\\\\u0000-\\u001f]*$"}}},"required":["command","output"]}},"required":["files"]}},"required":["capabilities","runtimes","sideEffects","source"]},"keywords":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}},"scripts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"dependencies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"optionalDependencies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"peerDependencies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"devDependencies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["name","version","description","license","types","files","commons"],"additionalProperties":{}},"policy":{"type":["string","null"]},"typeDeclarations":{"anyOf":[{"type":"object","properties":{"path":{"type":"string","minLength":1},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"status":{"type":"string","enum":["complete","truncated","not_utf8"]},"text":{"type":["string","null"]}},"required":["path","size","status","text"]},{"type":"null"}]},"attestations":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["test-run","code-review"]},"result":{"type":"string","enum":["pass","fail"]},"skill":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"digest":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}},"required":["name","digest"]},"declaredModel":{"type":"object","properties":{"provider":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$"},"id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:@-]{0,127}$"}},"required":["provider","id"]},"signer":{"type":"object","properties":{"account":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"agent":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"keyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}},"required":["account","agent","keyId"]},"loggedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"},"envelope":{"type":"object","properties":{"payloadType":{"type":"string","const":"application/vnd.in-toto+json"},"payload":{"type":"string","minLength":4,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"signatures":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"object","properties":{"keyid":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"sig":{"type":"string","pattern":"^[A-Za-z0-9+/]{86}==$"}},"required":["keyid","sig"],"additionalProperties":false}}},"required":["payloadType","payload","signatures"],"additionalProperties":false},"log":{"$ref":"#/components/schemas/LogProof"},"receipt":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["type","result","skill","declaredModel","signer","loggedAt","envelope","log","receipt"]}},"signers":{"type":"array","items":{"type":"object","properties":{"keyId":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"certificate":{"$ref":"#/components/schemas/AgentCertificateEnvelope"},"certificateLog":{"$ref":"#/components/schemas/LogProof"},"grant":{"$ref":"#/components/schemas/AgentGrantEnvelope"}},"required":["keyId","certificate","certificateLog","grant"]}},"accounts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"status":{"type":"string","enum":["active","suspended","revoked"]},"superseded":{"type":"boolean"},"record":{"$ref":"#/components/schemas/AccountRecordEnvelope"},"log":{"$ref":"#/components/schemas/LogProof"}},"required":["name","status","superseded","record","log"]}},"namespace":{"type":"object","properties":{"name":{"type":"string","pattern":"^(?:[a-z0-9][a-z0-9-]{0,38}|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$","maxLength":100},"kind":{"type":"string","enum":["plain","domain"]},"owner":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"currentOwner":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,38}$"},"record":{"$ref":"#/components/schemas/NamespaceRecordEnvelope"},"log":{"$ref":"#/components/schemas/LogProof"}},"required":["name","kind","owner","currentOwner","record","log"]},"independentChecks":{"type":"array","items":{}},"install":{"type":"object","properties":{"registry":{"type":"string","pattern":"^https?:\\/\\/[^\\s/?#]+$"},"npmrc":{"type":"string","minLength":1},"command":{"type":"string","minLength":1},"verify":{"type":"string","minLength":1}},"required":["registry","npmrc","command","verify"]},"versions":{"minItems":1,"type":"array","items":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,8})\\.(?:0|[1-9]\\d{0,8})\\.(?:0|[1-9]\\d{0,8})$"}}},"required":["package","name","version","account","state","tier","publishedAt","publisher","dist","manifest","policy","typeDeclarations","attestations","signers","accounts","namespace","independentChecks","install","versions"]},"PlatformPolicyResponse":{"type":"object","properties":{"floor":{"type":"object","properties":{"version":{"type":"number","const":1},"require":{"maxItems":2,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["test-run","code-review"]},"skills":{"minItems":1,"maxItems":32,"type":"array","items":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}}},"required":["type"]}},"sanctioned_models":{"minItems":1,"maxItems":64,"type":"array","items":{"type":"string","maxLength":193,"pattern":"^[a-z0-9*][a-z0-9*._-]*\\/[A-Za-z0-9*][A-Za-z0-9*._:@-]*$"}}},"required":["version"]},"platform":{"anyOf":[{"type":"object","properties":{"version":{"type":"number","const":1},"require":{"maxItems":2,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["test-run","code-review"]},"skills":{"minItems":1,"maxItems":32,"type":"array","items":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}}},"required":["type"]}},"sanctioned_models":{"minItems":1,"maxItems":64,"type":"array","items":{"type":"string","maxLength":193,"pattern":"^[a-z0-9*][a-z0-9*._-]*\\/[A-Za-z0-9*][A-Za-z0-9*._:@-]*$"}}},"required":["version"]},{"type":"null"}]}},"required":["floor","platform"]},"Health":{"type":"object","properties":{"status":{"type":"string","const":"ok"}},"required":["status"]},"LogEntryResponse":{"type":"object","properties":{"log":{"$ref":"#/components/schemas/LogProof"}},"required":["log"]},"PackumentFull":{"type":"object","description":"Each version entry is the stored `package.json` plus `_id` and `dist`; its other fields are npm's and are open.","properties":{"_id":{"type":"string"},"name":{"type":"string"},"dist-tags":{"type":"object","properties":{"latest":{"type":"string"}},"required":["latest"],"additionalProperties":false},"versions":{"type":"object","additionalProperties":{"type":"object","additionalProperties":true,"properties":{"name":{"type":"string"},"version":{"type":"string"},"dist":{"type":"object","properties":{"tarball":{"type":"string"},"integrity":{"type":"string"},"shasum":{"type":"string"}},"required":["tarball","integrity","shasum"]},"_id":{"type":"string"}},"required":["name","version","dist","_id"]}},"time":{"type":"object","properties":{"created":{"type":"string"},"modified":{"type":"string"}},"required":["created","modified"],"additionalProperties":{"type":"string"}}},"required":["_id","name","dist-tags","versions","time"],"additionalProperties":false},"PackumentAbbreviated":{"type":"object","properties":{"name":{"type":"string"},"dist-tags":{"type":"object","properties":{"latest":{"type":"string"}},"required":["latest"],"additionalProperties":false},"modified":{"type":"string"},"versions":{"type":"object","additionalProperties":{"type":"object","additionalProperties":true,"properties":{"name":{"type":"string"},"version":{"type":"string"},"dist":{"type":"object","properties":{"tarball":{"type":"string"},"integrity":{"type":"string"},"shasum":{"type":"string"}},"required":["tarball","integrity","shasum"]}},"required":["name","version","dist"]}}},"required":["name","dist-tags","modified","versions"],"additionalProperties":false},"NpmNotFound":{"type":"object","properties":{"error":{"type":"string","const":"Not found"}},"required":["error"]}},"securitySchemes":{"sessionToken":{"type":"http","scheme":"bearer","bearerFormat":"cms_ and 64 lowercase hex characters (9.8)"},"pollToken":{"type":"http","scheme":"bearer","bearerFormat":"cmp_ and 64 lowercase hex characters (9.2, 9.5)"}}}}