@nativeharness/agent
v0.1.0
Published
The nativeharness turn loop: decide, run, persist, stream — for any model.
Readme
@nativeharness/agent
The turn loop: decide, run, persist, stream — plus compaction, plan mode, subagents,
ask_user, approvals and durable cancellation.
npm install @nativeharness/agentimport { Agent, ScriptedAdapter } from "@nativeharness/agent";
const agent = new Agent({ store, bash, events, model });
for await (const event of agent.send({ workspaceId, sessionId, text: "run the tests" })) { … }Every hop is persisted before it is streamed, so a client that disconnects reconnects and
replays. A turn ends completed, needs_continuation, blocked, cancelled or failed —
and needs_continuation is the one worth understanding: when a command needs approval or the
model asks a question, the turn ends rather than blocking a server thread. The answer
resumes it, even a day later.
ScriptedAdapter ships with it: a deterministic "model" for tests, demos and bug reports, so
the loop can be exercised with no key and no network.
Part of nativeharness — the agent harness native to your app. Apache-2.0 · docs · source
