Rna Agent
Rna SDK

SDK overview

@rna-agent/sdk is Rna’s own execution kernel: model requests, durable sessions, tools, skills, MCP and the initiative loop.

Current version 0.59.0. @rna-agent/sdk is built on the Node.js standard library with no third-party runtime dependencies. Pi, DeepSeek Harness and Headlong were studied as design sources, but the SDK does not import the Pi SDK.

The SDK is not on npm yet; import it from inside the repository. Requires Node.js 22.19.0 or later.

cd packages/sdk
node --test test/*.test.mjs

Modules

InterfaceCapability
createSessionStreaming sessions, tool loop, steer and queue, stop and resume, automatic and manual compaction, recoverable JSONL log
streamCompletion / buildRequestSSE for OpenAI Chat Completions compatible and Anthropic Messages; images for vision models
CapabilityRegistry / loadSkillTrusted capability catalog, static SKILL.md, tool schema validation, per-project grants
CapabilityInstallerLocal or Git skill bundles, pinned npm packages, MCP config import; stage, validate, commit, rollback
createWebToolsweb_search and web_fetch over one of FastCRW, Firecrawl, Tavily, Brave, Zhipu or Bocha; a service that only searches has pages read from this machine by fetchPageDirect
createWorkspaceToolsRead-only by default; opt into hash-checked writes, exact edits, cancellable execution
McpClientstdio and Streamable HTTP; tool discovery, calls, cancellation
bootstrapProjectInitial state, milestones and capability assignments from a title and description
InitiativeCoordinatorPicks wait, work, share or learn from project evidence, no goal required; a workCheck hook can stop repeat work before it is queued
createDelegationTools / agentMergeToolSubagent delegation (scout, planner, reviewer, worker) and merging a worker’s changes (merge, show, take, resolved, drop)
LearningCoordinatorDurable learning backlog, real reflection, frozen experiments, reconciliation of unknown results
EvolutionCoordinatorCandidate generation, frozen-baseline comparison, gates, trial, promotion and rollback

Host and SDK

The SDK owns requests, the session log’s single-writer lock and integrity chain, tool calls and side-effect recovery. The host chooses state folders, protects the tool environment, stores project material, and handles budget admission and permissions.

Conventions that hold everywhere:

  • Writes with uncertain results are never retried automatically; the host must supply toolResolutions first.
  • Without a real model the result is blocked; no template pretends to be generated output.
  • A candidate model’s own score is not an evaluation; the SDK never widens permissions or adopts a version by itself.

Next

On this page