Hugs
A Hug is a request a run makes of people (Asking people). A hug is the page they answer it on: a small
web frontend, plus a definition of what it is asked (its params) and what a valid answer is (its values).
Every Hug is asked with one.
Two hugs ship with cliq: form (fields to fill in) and approval (approve or reject, the review gate’s).
When a page made for the job would be clearer than a form — triage a list, review a batch of documents with a verdict
each, compare two versions, sign off a checklist with evidence — you write your own.
What a hug is
A folder named for the hug. You write the definition and the page;cliq hug build writes the bundle to dist/:
- One definition, two checks. The page runs the definition on every change, so the person sees what’s wrong and Submit stays disabled until the answer is valid. The agent runs it again on every answer before acting on it — the check that counts, because a browser can’t be trusted.
- The bundle is self-contained text: every library compiled in, binary assets inlined, at most 5 MB and 200 files. It has no network: the data it shows arrives as params and attached files.
- An installed hug needs only
dist/. The source is for development.
Who does what
The page’s states
The Hub (or cliqd’s local page) decides what the person sees; a hug draws only two things — an answer to edit and an answer to view:
Each response also carries a one-line summary from the definition (“2 of 3 OK”, “Approved”), shown in the
inbox, notifications and “Alice responded: Approved”.
Security
A hug is code from a team, so CliqHub runs it where it can’t reach anything:- It is served from a separate content host (
content.cliqhub.io), in a frame withsandbox="allow-scripts"and a strict Content Security Policy: no network, no storage, no cookies, no navigation, no popups. - Everything it does — upload a file, read an attachment, open a link — goes through the Hub page, with the viewer’s permissions. A link that isn’t in the Hug’s params is shown to the person before it opens.
- The Submit button is the Hub’s, outside the frame: a hug can’t send an answer by itself.
- CliqHub accepts a bundle only from a daemon of the Hug’s realm, and checks its hash and rules.
Examples
In the cliq repo,examples/hugs — each with its definition, page, tests and sample params for cliq hug dev:
Next
Tutorial — your first hug
Build
review-batch end to end.Defining a hug
define_hug, mount_hug and the UI kit.Using hugs
From
team.yml, agent code and LLM phases.Installing
Team hugs,
CLIQ_HUGS_PATH, how bundles reach CliqHub.UI kit
Fields, choices, files and attachments that match the Hub.
Security
The sandbox and the trust model in full.