The Effect-native OpenAgents AI SDK — an Effect toolkit for building agent applications with durable, cursor-exact streams. One neutral event union from the model call to the rendered message, suspend and continue that persists, coding-agent harnesses, redaction as a schema field, and recall instead of compaction.
License: Apache-2.0
Registry: npm scope @openagentsinc/* (pre-stable under dist-tag rc only)
Gates: local only — no GitHub Actions (pnpm run check, .githooks/pre-push)
L6 RECALL @openagentsinc/history-corpus
L5 UI STREAM agent-harness-contract: ui-message-chunk, reducer,
smooth-stream, partial-object-stream, ChatTransport
L4 HARNESS agent-harness-contract: AgentHarness, session verbs,
slice runner, readiness, toolkit bridge, ACP + opencode
L3 SANDBOX sandbox-provider contract + local + interop providers
L2 DURABLE LOG event-log: seq-cursor append, replay, attach, rerun
L1 VOCABULARY @openagentsinc/agent-runtime-schema (KhalaRuntimeEvent)
L0 MODEL CALL effect/unstable/ai (upstream) + @openagentsinc/ai-model
P PROGRAMS @openagentsinc/dse (typed signatures, immutable artifacts,
portable runtime; optimizer is an explicit subpath)
G GRAPH @openagentsinc/graph-corpus (derived RLM/DSE projection;
graph truth does not add a runtime event layer)
X CONFORMANCE @openagentsinc/conformance-kit (cross-cutting test laws)
Every layer speaks KhalaRuntimeEvent upward. One event union. One durable
cursor.
| Package | Layer |
|---|---|
@openagentsinc/ai |
umbrella — curated re-exports |
@openagentsinc/agent-runtime-schema |
L1 vocabulary |
@openagentsinc/agent-harness-contract |
L2–L5 core |
@openagentsinc/ai-model |
L0 model-call bridge |
@openagentsinc/history-corpus |
L6 recall |
@openagentsinc/rlm |
L6 recursive engine |
@openagentsinc/dse |
typed model programs |
@openagentsinc/graph-corpus |
derived graph corpus |
@openagentsinc/conformance-kit |
reusable contract laws |
@openagentsinc/ai-sdk-sandbox-local |
L3 interop |
@openagentsinc/ai-sdk-sandbox-openagents |
L3 interop |
Every harness implements the one L4 AgentHarness
contract and emits KhalaRuntimeEvent upward:
| Harness | Factory | Adapter source |
|---|---|---|
| Claude Code | makeClaudeCodeHarnessAdapter |
claude-code-adapter.ts |
| Codex | makeCodexHarnessAdapter |
codex-adapter.ts |
| OpenCode | makeOpencodeAdapter |
opencode-adapter.ts |
| Pi | makePiHarnessAdapter |
pi-adapter.ts |
| Goose | makeGooseHarnessAdapter |
goose-adapter.ts |
| Cursor (ACP) | makeCursorHarnessAdapter |
cursor-adapter.ts |
| Grok CLI (ACP) | makeAcpHarnessAdapter |
acp-adapter.ts |
The generic ACP adapter
serves any Agent Client Protocol peer; Grok CLI (grok_acp) uses it directly
and the Cursor adapter (cursor_acp) builds on it.
The SDK ships first-class Recursive Language Model support: recall instead of
compaction. @openagentsinc/rlm (public entry point @openagentsinc/ai/rlm)
answers bounded, cited questions over a durable, redaction-aware corpus
without putting the corpus into a model context window — a zero-model-call
deterministic tier plus an Effect-native engine for declarative model/RLM
recursion, under global budgets with exact-usage honesty and citation
validation, exposed as one typed service and an Effect Tool adapter for
harness consumption. An RLM result is evidence, not authority: a completed
answer is a cited candidate, never an authorization. Spec, architecture, and
conformance gates: docs/rlm/.
The SDK uses DSE as its one typed model-program contract. A Program<I, O>
binds an Effect Schema signature to one immutable candidate artifact. Runtime
prediction performs bounded Schema repair and emits receipts. The event adapter
projects prediction lifecycle and honest usage onto KhalaRuntimeEvent. Offline
compile and promotion stay on the explicit @openagentsinc/dse/optimizer
subpath. Contract and API docs: docs/dse/.
The roster ships as one train: every publishable package carries the same
version, and every inter-package dependency inside the workspace points at
that one train through workspace:* (rewritten to the concrete version at pack
time). Converge the whole roster to one train in a single command:
node scripts/set-train-version.ts 0.2.0-rc.2 # bump every package + fix inter-package ranges
node scripts/set-train-version.ts 0.2.0-rc.2 --check # verify convergence, no writes
pnpm run audit:surface:update # record the new train's API-surface baselinePre-stable trains publish under dist-tag rc only — never latest.
Publish leaf packages first and the @openagentsinc/ai umbrella last, all at
the one converged version.
The proposed engine roadmap is docs/ROADMAP.md —
conformance-as-product, Programs (the DSPy of Effect), RLM deepening,
generative UI, transport productization, provider gateway, harness breadth.
Node 24, pnpm, Vite Plus — the same toolchain contract as the openagents monorepo.
pnpm install
pnpm run check
pnpm run hooks:install # enables .githooks/pre-push on this cloneDocs index: docs/README.md.
npm install @openagentsinc/ai@rc