Skip to content
Bindings · Publishing a binding6 pages

Publishing a binding

Partly built

Add a library, a native program or a set of files to the registry: write a spec, build the manifest, sign it, check it.

Only Clay signs today, so publishing means adding a binding in the repository and signing it with the development key. These are the real commands; run them in the registry package.

1. Write a spec

A spec is a small JSON file in the registry’s specs/ folder. It names the binding, says what it is (kind: js, wasm, process, native or weights), points at the bytes, and says how Clay uses it.

{
  "name": "hyparquet",
  "kind": "js",
  "fromPackage": "node_modules/hyparquet",
  "summary": "Pure-JS Parquet reader used by Phaistos tables.",
  "artifact": { "tree": "node_modules/hyparquet" },
  "determinism": "pure",
  "needs": { "network": "none" },
  "uses": ["built-in"],
  "runsIn": ["browser", "server"]
}

fromPackage fills the version, project and licence from an installed package.json. Anything unknown stays null; the registry never guesses. Add uses, runsIn and, for a native program, platforms (["macos-arm64"]). Without them the page infers the roles from the form.

Then list the spec in specs/index.json and describe it in plain words in specs/about.json (a short line, a longer one, who uses it). That file is not signed, so editing it changes no id.

2. Build and sign

npm run registry -- add specs/hyparquet.json
npm run registry -- sign [email protected]
npm run registry -- verify

add builds the manifest from the spec and the artifact bytes. sign signs it with the development key. verify checks every manifest against the trust set. Do not re-run seed unless you want every seed binding rebuilt from current bytes, which changes ids.

3. Preview

npm run registry -- build-site --out dist

Serve dist/ with any static server. The page shows a tick only for a binding whose signature verified when the page was built.

Weights

For model weights, kind is weights and the spec carries a weights block: the pinned repository and 40-character revision, every file with its size and SHA-256, the tokenizer files, and the licence. The registry stores the manifest, not the bytes.

Not built

There is no way yet for anyone outside the team to publish. A signer policy, a production key and a review step are open decisions; see Trust and signing.