Skip to content
botiversePublic

About

oar (Open Agent Runtime): programming interface for all agent harnesses

Resources

Stars

493 stars

Watchers

1 watching

Forks

Repository files navigation

OAR - programming interface for all agent harnesses

OAR logo

OAR (Open Agent Runtime) is a provider-independent programming interface for coding-agent runtimes: a solid foundation for building agent workspaces and other applications.

Delete harness logic and focus on outcomes and UX.

Supported runtimes


Antigravity

Claude Code

Codex

CodeBuddy Code

Cursor

Grok Build

Kimi Code

OpenCode

Pi

Qwen Code

Qoder

DeepSeek Harness

Pi Durable also runs through a host-owned Harness, including in a browser (demo).

Library

One API drives every runtime: swap "claude" for "codex", "grok" or "pi" (with a model it has) and the code stays the same. An option a runtime cannot honor is refused before anything opens, never silently dropped.

import { defaultRuntimes, promptAndWait } from "@botiverse/oar";

const claude = defaultRuntimes.require("claude");
const installation = await claude.installation?.();
if (installation?.kind !== "available") throw new Error("claude is not installed");

const session = await claude.session(installation, { cwd: process.cwd(), model: "sonnet" });

session.events((event) => {
  // Every event says which agent it came from: [] is the root.
  if (event.kind === "text_delta" && event.agentPath.length === 0) process.stdout.write(event.text);
  if (event.kind === "tool_call_started") console.log(event.tool);
});

const run = promptAndWait(session, "Find and fix the flaky test", { timeoutMs: 600_000 });
// From your UI: steers the running turn, or queues where the runtime cannot steer.
await session.deliver("Leave the snapshots alone.");
console.log(await run);
await session.dispose();

// Later, even from another process: the same conversation.
const resumed = await claude.session(installation, { cwd: process.cwd(), resume: session.id });

A session gives you:

  • Every fact, attributed. One event per fact with seq and agentPath; rawEvents() keeps every native payload verbatim (record stream).
  • Control with honest answers. prompt, steer, queue, withdraw and abort answer accepted or rejected with a typed code (conversation). Runtimes with native compaction also offer compact (contract).
  • Your own tools and subagents. serveMcpTools attaches host tools to any runtime; @botiverse/oar/agents hands work to other runtimes (host tools).
  • Views and tests. @botiverse/oar/observe folds records for a UI, in a browser too; @botiverse/oar/testing is a scripted runtime with no binary or login.

What differs by runtime is declared on the Runtime, not guessed (matrix). Entry points and setup: package README.

Without a session

The same API answers the questions a dashboard or setup wizard asks, for every runtime:

for (const runtime of defaultRuntimes.list()) {
  const installation = await runtime.installation?.();
  if (installation?.kind === "available") {
    console.log(runtime.id, await runtime.listModels?.(installation));
  }
}
  • Orientation: one call for what is installed and usable.
  • Install and update: through the vendor's own installer and updater.
  • Login: through the runtime's own login, without a terminal. OAR never handles the tokens.
  • Account usage: plan and quota windows.
  • Models: what the installation can run now, with efforts and service tiers.
  • Inventories: configured skills, commands, MCP servers and tools.
  • Setup forms: settings as data a UI renders.

CLI

npx @botiverse/oar-cli list
oar run claude "What does this repo do?" --record run.jsonl

Every command: packages/cli (published as @botiverse/oar-cli).

Docs

  • Design: why oar exists, its decisions and what comes next.
  • Spec: the record stream and every contract built on it.
  • Runtimes: what each runtime says natively and how oar maps it.
  • Prior art: related projects compared feature by feature.
  • Development: working in this repo.

ESM-only, Node entry requires Node.js 24+; the browser entry needs a modern browser with Web Crypto. Apache-2.0.

About

oar (Open Agent Runtime): programming interface for all agent harnesses

Resources

Stars

493 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages