Hugs › Reference
hug.json
Written by the build from the definition:
definition.mjs
The definition compiled for Node (it has only Zod in it). cliqd and the agents’ SDK import it to check params and
answers when a Hug is asked by name, and LLM agents read its title, description and params schema.
The rules
cliq hug build checks them, and CliqHub checks them again when the bundle is uploaded:
- Text only. Every file is UTF-8 text — HTML, JS, CSS, JSON, SVG,
.mjs. Images and fonts are inlined as data URIs (the scaffolded build does it). No audio, video or WebAssembly. - Self-contained. Every file it loads is in the bundle — no outside URLs (the sandbox blocks them anyway), no CDN, no import maps.
- At most 5 MB and 200 files.
hug.jsonanddefinition.mjspresent;entryexists.- Data never goes in a bundle: it arrives as params and attachments.
The hash
A bundle is named bysha256 over a canonical listing of dist/: for each file, sorted by path,
<path>\t<size>\t<sha256 of its bytes>\n. Same files, same hash, on any machine. cliqd computes it when a Hug is
asked (cached until dist/ changes); CliqHub recomputes it on upload and refuses a mismatch. No hash is written
anywhere by hand.
Versions
The SDK follows semver;hug.json records the version a bundle was built with. The bridge protocol is versioned
separately, and CliqHub keeps every protocol a kept bundle needs, so an old Hug’s page always runs.