@rovecode-labs/sdk
v0.2.0
Published
Embed the rovecode coding-agent harness in your own Bun/TypeScript process: sessions, streamed prompts, background subagent tasks, and the live agent tree — one client, one engine.
Maintainers
Readme
@rovecode-labs/sdk
Embed the rovecode coding-agent harness in your own Bun/TypeScript process — sessions, streamed prompts, background subagent tasks, and the live agent tree. One client = one engine: the SDK boots the same runtime the CLI boots (no second loop), so everything the CLI can do, your process can do.
bun add @rovecode-labs/sdkimport { createClient, mockStream } from "@rovecode-labs/sdk";
const rc = await createClient({ cwd: process.cwd() }); // resolves your configured provider
const session = await rc.session.create();
for await (const ev of session.prompt("fix the failing test in src/auth.ts")) {
if (ev.type === "agent_tree_update") renderTree(ev.tree); // live subagent tree
if (ev.type === "run_end") console.log(ev.status);
}
await rc.close();Surface
createClient({ cwd?, stream?, yolo?, approval? })→Promise<RovecodeClient>rc.session.create({ id? })/rc.session.list()session.prompt(goal, { signal? })→ async generator ofSdkEvent(everyRunEventof the run plusagent_tree_updateframes synthesized from the task registry)rc.task.start(sessionId, { agent?, goal, label?, isolated? })·list·wait·cancelrc.agent.tree(sessionId)— the current parent→children task treerc.events.subscribe(fn)— client-level tap of everythingmockStream({ turns })— scripted provider for tests: no keys, no network
Testing
import { createClient, mockStream, textTurn } from "@rovecode-labs/sdk";
const rc = await createClient({ cwd: tmp, stream: mockStream({ turns: [textTurn("done")] }) });Notes
- Requires Bun ≥ 1.3.14 (the harness is Bun-native).
- Runs fully local: provider keys come from your normal rovecode config (
rovecode connect). - For a hosted/headless setup, run
rovecode serve(the same repo) and drive it over HTTP — a first-partyremotetransport on these exact types is on the roadmap. - 0.x surface: expect evolution, pinned by contract tests upstream.
AGPL-3.0-only · 9Code Labs
