Composable SDK to build
powerful agent harnesses

The open-source toolkit for building Claude Code-like products. Stateless primitives, composable middleware, hierarchical subagents. Any model provider.

Agent Session

Everything you need to build agents

Composable primitives that give you full control. No magic, no lock-in — just clean TypeScript APIs built on top of Vercel AI SDK.

Stateless Agents

Full control over message history. Inspect, modify, or share state between agents as plain arrays.

Composable Middleware

Mix and match turn tracking, retry, compaction, and persistence. Use only what you need.

Subagent Hierarchies

Delegate tasks to specialized child agents with background execution and Promise-like combinators.

Context Compaction

Automatic two-phase context management: pruning old tool results, then LLM-powered summarization.

Tool Permissions

Async approval callbacks for gating tool execution. Works in CLI prompts, web modals, or external services.

MCP Integration

Connect to any Model Context Protocol server via stdio, HTTP, or SSE transport.

Skills & AGENTS.md

On-demand SKILL.md instruction loading and automatic AGENTS.md/CLAUDE.md project context injection.

Any Provider

Built on Vercel AI SDK. Works with OpenAI, Anthropic, Google, or any compatible model provider.

Web & CLI

React hooks, Vue composables, and streaming support. Build agents for any runtime.

See it in action

From a simple agent to composable middleware stacks and hierarchical subagent delegation.

agent.ts
import { Agent, createFsTools, createBashTool,
  NodeFsProvider, NodeShellProvider } from "@openharness/core"
import { openai } from "@ai-sdk/openai"

const fsTools = createFsTools(new NodeFsProvider())
const { bash } = createBashTool(new NodeShellProvider())

const agent = new Agent({
  name: "assistant",
  model: openai("gpt-5.4"),
  systemPrompt: "You are a helpful coding assistant.",
  tools: { ...fsTools, bash },
  maxSteps: 20,
  approve: async ({ toolName }) => {
    return await askUser(`Allow ${toolName}?`) === "yes"
  },
})

let messages = []
for await (const event of agent.run(messages, "Fix the login bug")) {
  switch (event.type) {
    case "text.delta":
      process.stdout.write(event.text); break
    case "tool.done":
      console.log(`Done: ${event.toolName}`); break
    case "done":
      messages = event.messages; break
  }
}

Up and running in minutes

Three steps to your first agent.

1

Install

Add the core package to your project. Works with any Node.js or edge runtime.

npm install @openharness/core
2

Configure

Define your agent with a model, tools, and optional middleware.

const agent = new Agent({
  model: openai("gpt-5.4"),
  tools: { readFile, bash },
})
3

Run

Stream typed events to your CLI, web app, or any other interface.

for await (const ev of agent.run([], input)) {
  // stream events to your UI
}
MaxGfeller

Built by MaxGfeller

Open source. MIT licensed.

Ready to build?

Start building agents with composable, type-safe primitives today.