npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

harness-one

v0.2.0

Published

Universal primitives for AI agent harness engineering

Readme

harness-one

Framework-agnostic primitives for AI agent harness engineering. Zero-runtime-dep core with subpath exports (core, advanced, prompt, context, tools, guardrails, observe, session, memory, evolve-check, rag, orchestration, redact, infra, testing). eval and evolve ship from @harness-one/devkit.

Install

pnpm add harness-one

No runtime dependencies. Node 18+.

Peer Dependencies

None required by core. Integration packages (@harness-one/anthropic, @harness-one/openai, @harness-one/ajv, ...) bring their own peers.

Quick Start

import { createAgentLoop, defineTool, createRegistry, toolSuccess } from 'harness-one';
import type { AgentAdapter } from 'harness-one/core';

const add = defineTool<{ a: number; b: number }>({
  name: 'add',
  description: 'Add two numbers',
  parameters: {
    type: 'object',
    properties: { a: { type: 'number' }, b: { type: 'number' } },
    required: ['a', 'b'],
  },
  execute: async ({ a, b }) => toolSuccess(a + b),
});

const registry = createRegistry();
registry.register(add);

declare const adapter: AgentAdapter; // Implement or use @harness-one/anthropic / @harness-one/openai
const loop = createAgentLoop({ adapter, onToolCall: registry.handler() });

for await (const ev of loop.run([
  { role: 'system', content: 'You are a calculator.' },
  { role: 'user', content: 'What is 2 + 3?' },
])) {
  if (ev.type === 'message') console.log(ev.message.content);
  if (ev.type === 'done') break;
}

Submodule Imports

Every public API is also exported from a submodule path for better tree-shaking:

import { AgentLoop } from 'harness-one/core';
import { defineTool, createRegistry } from 'harness-one/tools';
import { createPipeline, createInjectionDetector } from 'harness-one/guardrails';
import { createTraceManager, createCostTracker } from 'harness-one/observe';

Available submodules: core, advanced, prompt, context, tools, guardrails, observe, session, memory, evolve-check, rag, orchestration, redact, infra, testing.

harness-one/testing subpath — mock AgentAdapter factories (createMockAdapter, createFailingAdapter, createStreamingMockAdapter, createErrorStreamingMockAdapter) ship from this path so the /advanced surface carries only production extension primitives. See docs/architecture/17-testing.md.

eval + evolve live in @harness-one/devkit — the @harness-one/devkit package owns eval + evolve dev-tooling; the runtime architecture-rule engine stays in core under harness-one/evolve-check. The CLI ships as @harness-one/cli.

The root barrel is curated to 18 value symbols (core user-journey set). createSecurePreset is not in the root barrel — import it from @harness-one/preset to avoid a harness-one@harness-one/preset dependency cycle. Other factories like toSSEStream, categorizeAdapterError etc. live on subpaths only.

Subpath-only extensions:

  • harness-one/observeMetricsPort + createNoopMetricsPort (vendor-neutral metric instruments), HarnessLifecycle + createHarnessLifecycle (init→ready→draining→shutdown state machine + aggregated health())
  • harness-one/infracreateAdmissionController (per-tenant in-process token bucket with abort/timeout fail-closed)
  • harness-one/corecreateTrustedSystemMessage, isTrustedSystemMessage, sanitizeRestoredMessage for the system-message brand pattern
  • harness-one/guardrailsrunRagContext for per-chunk input scanning of retrieved context

HarnessErrorCode is closed and module-prefixed. Switch on HarnessError.code exhaustively. Always value-import (import { HarnessErrorCode }) — type-only import drops the runtime Object.values() record (lint rule harness-one/no-type-only-harness-error-code enforces). See root MIGRATION.md and the git log for change history (CHANGELOG.md is intentionally empty pre-release).

See the main repository README and architecture docs for the full API surface.