@nbt-dev/harness
v0.1.0
Published
Harness language, capability model, and standard harness library for NBT consoles.
Downloads
67
Readme
@nbt-dev/harness
Everything a chat session IS: the harness language, the capability model, the standard harness library, the tools an agent holds, the agent loop itself — and what the agent's output LOOKS like.
The console compiles manifests natively in Jai. The TypeScript compiler here is still
intentional: the browser editor validates authoring in-process, the published npm CLI
builds projects under Node, and scripts/test-manifest-port.sh holds both implementations
to byte-identical output and diagnostics.
The package is split by whether React is involved, not by package boundary. Everything
above /blocks/view is React-free and runs unchanged inside the console's QuickJS eval
executor; scripts/build.mjs builds that half platform: neutral so a stray renderer
import is a build error rather than a silent 260 KB in the eval bundle.
| subpath | what |
|---|---|
| @nbt-dev/harness | the harness spec + HARNESS.md contract |
| /markdown /library /catalog | the compiler, the shipped harnesses, abilities & policies |
| /tools | every tool, one directory each — see src/tools/README.md |
| /blocks | every transcript block — one directory each, meta.ts + block.tsx + BLOCK.md. React-free barrel: metadata, registry, prompt |
| /blocks/view | the same blocks WITH their renderers, the fence dispatcher, AgentMarkdown |
| /ui | the shadcn primitives everything here composes on (/ui/utils is cn) |
| /design | the DESIGN.md token model + theme generator |
| /saved-view /crm /calendar /dashboard | the renderers for what an agent emits |
| /styles.css | the standalone .nbt-ui stylesheet |
| /tools/registry | which tools exist, with none of the implementations |
| /session | the agent loop, the bridges a host plugs into, the stores |
| /protocol/* | the console's wire and spec contracts (auth, dashboards, views, workflows) |
| /manifest | the nbt.dev/v1 kinds |
HARNESS.md is the canonical serialization of one harness. Import the compiler from
@nbt-dev/harness/markdown and capability resolution from @nbt-dev/harness/catalog.
This package ships the harness compiler and runtime, and no harness content. It
carried four of them once (default, builder, analyst, compute) under
harnesses/*/HARNESS.md, inlined by a generator into a /library subpath and re-baked
into the core cart by a second script. Both pipelines are gone: a harness now lives with
whatever owns it. Builder ships from cartridges/core/harnesses, Compute ships with
nbt-dev/cartridges/compute, and Analyst was deleted as a duplicate of the default.
The one exception is @nbt-dev/harness/default-harness: the Assistant fallback, as
markdown source. It is here because it has to resolve with no rows, no carts, no
filesystem and no network, since it is what a session falls back to before the first
fetch returns and after one fails.
Every harness declares abilities explicitly. toolset remains the runtime mode
(full, readonly, or compute), but it does not grant tools by itself. Empty
abilities: [] is valid only for compute, whose fleet tool is supplied by that mode.
Component workbench
Run npm run build once, then npm run dev. The block workbench opens at
http://127.0.0.1:6120 and watches the package source, declarations, styles, and every
registered block. Its Live tab can stream a model turn without booting a console.
Abilities may scope entity-facing tools to exact qualified entity names. The scope is an attenuation, not a replacement for the caller's authorization:
subAbilities:
- id: appointments
label: Read GHL appointments and contacts
description: Query only the CRM records needed by this harness.
tools: [query]
entities:
- ghl:GhlAppointment
- ghl:GhlContactThe selected ability's query tool rejects other targets locally and sends the same
scope to the console data plane, where it is intersected with normal user/entity
authorization. Exact cart:Entity handles are required; an unscoped ability that
also grants the same tool makes that tool unrestricted, because abilities compose
additively.
The bundled templates are inert: installing or upgrading this package does not modify a live instance.
