JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 53
  • Score
    100M100P100Q82511F
  • License MIT

The graph execution engine for agent swarms — production-grade orchestration with zero dependencies

Package Exports

  • @oni.bot/core
  • @oni.bot/core/agents
  • @oni.bot/core/checkpointers
  • @oni.bot/core/config
  • @oni.bot/core/coordination
  • @oni.bot/core/events
  • @oni.bot/core/functional
  • @oni.bot/core/guardrails
  • @oni.bot/core/harness
  • @oni.bot/core/hitl
  • @oni.bot/core/inspect
  • @oni.bot/core/lsp
  • @oni.bot/core/mcp
  • @oni.bot/core/messages
  • @oni.bot/core/models
  • @oni.bot/core/prebuilt
  • @oni.bot/core/store
  • @oni.bot/core/streaming
  • @oni.bot/core/swarm
  • @oni.bot/core/testing
  • @oni.bot/core/tools

Readme

@oni.bot/core

The graph execution engine for production agent swarms.

npm version MIT License zero dependencies


Install

npm install @oni.bot/core
  • Zero runtime dependencies. Self-contained TypeScript. No transitive supply-chain risk. Runs in Node.js 18+, serverless functions, and edge runtimes without adaptation.
  • 5 model adapters via raw HTTP. Anthropic, OpenAI, OpenRouter, Google, and Ollama — no vendor SDKs required.
  • 21 exports. Root package plus 20 named subpaths for precise tree shaking.

Quick Start

import { StateGraph, START, END, lastValue, anthropic } from "@oni.bot/core";

type State = {
  question: string;
  answer: string;
};

const model = anthropic("claude-sonnet-4-6");

const graph = new StateGraph<State>({
  channels: {
    question: lastValue<string>(() => ""),
    answer:   lastValue<string>(() => ""),
  },
});

graph.addNode("answer", async (state) => {
  const response = await model.chat({
    messages: [{ role: "user", content: state.question }],
  });
  return { answer: response.content as string };
});

graph.addEdge(START, "answer");
graph.addEdge("answer", END);

const app = graph.compile();

for await (const chunk of app.stream(
  { question: "What is a Pregel execution model?" },
  { streamMode: "values" },
)) {
  console.log(chunk.answer);
}

Sub-modules

21 entry points — import only what you use.

Subpath Description
@oni.bot/core Core engine: StateGraph, START, END, channels, Command, Send
@oni.bot/core/prebuilt Prebuilt agents: createReactAgent, defineAgent
@oni.bot/core/swarm Swarm templates: SwarmGraph (hierarchical, fan-out, pipeline, peer-network, map-reduce, debate, mesh)
@oni.bot/core/hitl Human-in-the-loop: interrupt, getUserInput, getUserApproval
@oni.bot/core/store Cross-thread KV store: InMemoryStore, BaseStore, NamespacedStore
@oni.bot/core/messages Message channel primitives: messagesChannel, MessageAnnotation
@oni.bot/core/checkpointers Persistence backends: MemoryCheckpointer, SqliteCheckpointer
@oni.bot/core/functional Functional API: task, entrypoint, pipe, branch
@oni.bot/core/inspect Graph inspection: buildGraphDescriptor, toMermaid, cycle detection
@oni.bot/core/streaming Token streaming: emitToken, getStreamWriter, StreamWriter
@oni.bot/core/models LLM adapters: anthropic, openai, openrouter, google, ollama
@oni.bot/core/tools Tool definition: defineTool, ToolSchema, ToolResult
@oni.bot/core/agents Agent builder: defineAgent, AgentDefinition
@oni.bot/core/coordination Inter-agent messaging: RequestReplyBroker, PubSub
@oni.bot/core/events Event bus: EventBus, 10 lifecycle event types
@oni.bot/core/guardrails Budget and safety: BudgetTracker, ContentFilter, PermissionGuard
@oni.bot/core/testing Test utilities: mockModel, assertGraph, createTestHarness
@oni.bot/core/harness Agentic loop: ONIHarness, AgentLoop, HooksEngine, ContextCompactor
@oni.bot/core/mcp MCP client: JSON-RPC/stdio tool bridge
@oni.bot/core/lsp LSP client: language server protocol primitives
@oni.bot/core/config Config loader: JSONC parsing, environment variable resolution

Ecosystem

Built on @oni.bot/core:


License

MIT — AP3X Dev