The open-source toolkit for building Claude Code-like products. Stateless primitives, composable middleware, hierarchical subagents. Any model provider.
Composable primitives that give you full control. No magic, no lock-in — just clean TypeScript APIs built on top of Vercel AI SDK.
Full control over message history. Inspect, modify, or share state between agents as plain arrays.
Mix and match turn tracking, retry, compaction, and persistence. Use only what you need.
Delegate tasks to specialized child agents with background execution and Promise-like combinators.
Automatic two-phase context management: pruning old tool results, then LLM-powered summarization.
Async approval callbacks for gating tool execution. Works in CLI prompts, web modals, or external services.
Connect to any Model Context Protocol server via stdio, HTTP, or SSE transport.
On-demand SKILL.md instruction loading and automatic AGENTS.md/CLAUDE.md project context injection.
Built on Vercel AI SDK. Works with OpenAI, Anthropic, Google, or any compatible model provider.
React hooks, Vue composables, and streaming support. Build agents for any runtime.
From a simple agent to composable middleware stacks and hierarchical subagent delegation.
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
}
}Three steps to your first agent.
Add the core package to your project. Works with any Node.js or edge runtime.
npm install @openharness/coreDefine your agent with a model, tools, and optional middleware.
const agent = new Agent({
model: openai("gpt-5.4"),
tools: { readFile, bash },
})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
}Built by MaxGfeller
Open source. MIT licensed.
Start building agents with composable, type-safe primitives today.