Human-in-the-loop AI, measured properly.
v0.6 · deployed at hitlkit.dev · 16 primitives via shadcn CLI · six packages on npm.
Install
$ npx shadcn@latest add https://www.hitlkit.dev/r/hitl-card.json$ pnpm add @hitl-kit/core @hitl-kit/reactWhy it exists.
HITL Kit is the argument that we should measure AI differently, and the components that make the alternative buildable.
Sixteen React primitives for human-in-the-loop agentic UIs. Each primitive is the physical embodiment of a specific claim from the paper.
Together: the paper is the argument, the components are the proof the argument is implementable, the registry is how you adopt it.
01
The measurement problem
95% of enterprise AI pilots fail — not because the models are bad, but because we measure the wrong thing. Despite $30–40 billion in investment, 95% of organizations achieve zero measurable return from generative AI initiatives (Challapally et al., 2025). The paper argues this failure crisis is at root a measurement crisis.
Current benchmarks ask one question: can the model complete this task autonomously? Deployment asks another: does it respect the user's authority, preserve their agency, and make them better over time? The benchmark-to-deployment gap is the distance between those two questions — and every component in this kit exists because something falls into that gap.
The alternative is Assist-Not-Complete: evaluate AI on whether it assists humans without displacing them, not on whether it can finish the task alone. The paper synthesizes benchmark-saturation research (Ott et al., 2022 — a large fraction of 3,765 mapped benchmarks quickly trending toward near-saturation), cognitive-debt findings from AI-assisted learning (Kosmyna et al., 2025), scaffolding theory (Dhillon et al., 2024), and uncertainty quantification (Liu et al., 2025) into that single reframing.
02
Every primitive embodies a claim
The component library is not a grab-bag of agent UI widgets — each of the fifteen primitives is the physical embodiment of a specific claim from the paper. The MiniTrace instantiates the supporting-facts requirement from HotpotQA (Yang et al., 2018): an answer without its evidence trail is unverifiable, so the trace rides along. The AI Generation Scale operationalises Dhillon et al.'s scaffolding principle — their CHI study found sentence-level suggestions reduced writing quality while paragraph-level scaffolds improved it, so the scale makes the level of AI involvement a first-class, visible control. The Interrupt Card is the agency-preservation boundary: the moment the system pauses and the human decides.
That traceability is the design discipline for the whole kit: if a primitive can't be tied to a claim the paper defends, it doesn't ship. The paper is the spec.
03
How it's built
The architecture is a protocol with adapters. @hitl-kit/core defines Zod event schemas — a framework-agnostic wire format for human-in-the-loop moments (approvals, interrupts, traces, generation-scale changes). @hitl-kit/react ships HitlEventRenderer, a typed dispatcher that maps validated events to UI primitives. @hitl-kit/gates adds composable decision gates — confidence, cost, scope, approval-chain, rate-limit — pure functions that wrap any adapter's emit point and decide allow, deny, or escalate.
Three adapters carry the protocol into real agent stacks: LangGraph (emit events from interrupt() nodes, resume with typed Commands), the Vercel AI SDK (typed tool() wrappers), and MCP (an MCP server exposing the fifteen primitive event kinds as tools, so any MCP-aware client can emit schema-validated HITL events). The paper becomes the protocol; the protocol becomes the platform.
The UI primitives themselves distribute the shadcn way — copy, paste, own. No fork, no vendor lock-in, no wrapper SDK: the registry serves JSON that the shadcn CLI resolves into your own codebase, with the same tokens, the same conventions, and full ownership of the code afterward. The kit was originally extracted from Agatha, a research-agent workspace — the primitives earned their shapes in a real product before they were generalized.
Signature features.
3 featuresSixteen React primitives
Sixteen React primitives for human-in-the-loop agentic UIs. Each primitive is the physical embodiment of a specific claim from the paper.
Copy, paste, own
No fork, no vendor lock-in, no wrapper SDK. Copy, paste, own.
Three artifacts
The paper is the argument, the components are the proof the argument is implementable, the registry is how you adopt it.
The component library.
16 primitives · shadcn registryEvery primitive is the physical embodiment of a claim from the paper, and each installs individually via the shadcn CLI — copy, paste, own. Names below are their registry identifiers.
Interrupt Card
In-thread approval boundary for agent actions. Three variants, four states.
hitl-cardSubagent Status Card
Single-row agent status with icon, label, detail, and state badge.
subagent-status-cardMiniTrace
Collapsible thought, action, result renderer. Supporting-facts pattern.
mini-traceAI Generation Scale
Five-segment ordinal scale for AI vs. human contribution.
ai-generation-scaleContext Chips
Removable pill chips for notes, files, URLs. Overflow truncation.
context-chipsQA Flow
Multi-question approval card. Single, multi, text.
qa-flowWriting Agent
Compound widget for a draft-in-progress document with six status states.
writing-agentResearch Agent
Three-mode research config: create, follow-up, read URL.
research-agentBatch Queue
Sequential approve and reject across mixed agent items with auto-advance.
batch-queueSearch Result Card
Ranked result with metadata, snippet, and relevance bar.
search-result-cardApprove / Reject Row
Binary decision row with pending, approved, rejected, optional undo.
approve-reject-rowShared Primitives
Accent swatches, approval badges, approve and reject rows.
shared-primitivesDiff Result
Before/after diff card for proposed text or code edits. Per-hunk red/green strips, accept and reject states. The HITL-AI primitive for any in-place edit the human should approve before it lands.
diff-resultCitation Result
Single source-backed citation card. Claim on top, source attribution below, optional supporting quote and confidence badge. Verify or reject.
citation-resultEditable Plan
Multi-step plan the human can reorder, rename, add to, or delete from before the agent executes. Locked steps cannot be removed.
editable-planTool Call Preview
Preview a tool call (name, args, optional rationale and signals) so the human can approve or reject before execution. Pairs with the gates layer for confidence/cost/scope checks.
tool-call-previewPackages.
6 on npmExplore further.
The source lives on GitHub. Copy, paste, own — no fork, no vendor lock-in.