Publish a component

How a package enters the registry: build a declarative package from source, publish it to a registry, and read it back from the catalog. The package format is the same one every catalog entry uses.

The package contract

A package is a directory with a manifest (component-package.json), a payload and a JSON Schema for its props. kind: block packages are declarative document-IR content; nothing in a package executes on the host.

kindwhat it shipsstatus
blockdeclarative document-IR specs, prop schemas, tokens, READMEs57 entries in the current catalog
themetokens and stylesheetsaccepted by the format; no catalog entry yet
adapterformat projections, such as framework importersaccepted by the format; no catalog entry yet
pluginthird-party executable coderefused until a host sandbox with explicit capability grants exists

Build and publish

docsloth component build --dir ./package [--out ./dist]
docsloth component publish --dir ./package --registry https://registry.docsloth.dev --token "$DOCSLOTH_TOKEN"

A directory registry works the same way without a token: docsloth component publish --dir ./package --registry ./registry writes index.json and packages/<name>/<version>/{manifest.json,files/…}.

HTTP publishing contract

FieldValue
Method and pathPOST /v1/packages
AuthorizationBearer <token> (from --token or DOCSLOTH_TOKEN); the token is never stored in the manifest, the registry or stdout
Body{ "manifest": { … }, "files": { "<path>": "<base64>" } }
Success2xx { "ok": true, "digest": "sha256:…", "unchanged": true|false }
Refusal409 (or any non-2xx) when a name+version is republished with different bytes (DSL1705); an identical republish is a no-op

The machine-readable contract is /api/v1/publish.json. Publishing auth and the hosted write path are cloud-side (owner / registry team); this static site documents the contract and does not accept publishes.

What this registry serves

SurfacePathWhat it carries
Search index/api/v1/search.jsonevery catalog entry with its description, trust class, status, tools, URLs and install ref
Catalog/api/v1/catalog.jsonthe same JSON as /catalog.json (one derivation, two routes)
Component metadata/api/v1/components/<name>.jsonone entry plus its version resolution
Version resolution/api/v1/versions.json57 entries; 57 carry a built package version and digest, 0 keep the catalog placeholder
Publishing contract/api/v1/publish.jsonthe POST /v1/packages contract, immutability rules and package kinds
Agent index/llms.txtthe human/agent table of contents for every page

Honest limits

The registry site is static: the API endpoints are pre-rendered files generated from packages/contracts/component-catalog.json, there is no request-time database and no query-time search service — clients filter the search index themselves. Version resolution reports the versions present in this generated catalog; a hosted registry resolves latest across all published versions.

Index signatures, yank/revoke and publisher identity are registry-operator concerns and are out of scope here; see docs/MARKET_FLOW.md for the full chain and the failure codes.