drydock-sdk
v0.1.0
Published
TypeScript SDK for drydock — build and test AI agents and agentic workflows locally.
Downloads
15
Maintainers
Readme
drydock-sdk
TypeScript SDK for drydock — build and test AI agents and agentic workflows locally, one binary, with or without Docker.
Write an agent, tool, or MCP server as a plain function, and the drydock runtime launches it as an isolated node: hot-reloaded during development, wired to other agents (A2A) and MCP servers, and fully traced.
import { defineNode } from "drydock-sdk";
export const greet = defineNode(
{ name: "greeter", role: "agent" },
async (ctx, { name = "world" }: { name?: string }) => {
await ctx.emit({ status: "thinking" }); // stream a partial update
return { message: `hello, ${name}` };
},
);Experimental. The TypeScript SDK is at feature parity with the Python SDK and fully tested, but Python is the primary supported path; this SDK is maintained best-effort and its API may change.
Requires the drydock runtime
This package is the author-side SDK only. Nodes are launched and orchestrated
by the separate drydock binary (the runtime, HTTP API, web UI, and tracing all
live there). Install the runtime first:
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/scionoftech/drydock/main/scripts/install.sh | shSee the project README for tarball and build-from-source options.
Install
npm install drydock-sdkZero runtime dependencies, ships type declarations. Install it into each Node node you author.
Write a node
A node is a directory with your handler and a node.yaml manifest. Handlers are
compiled to JavaScript (Node has no built-in TypeScript execution), so the
manifest's entry points at the built .js:
// handler.ts → compiled to dist/handler.js
import { defineNode, type AgentContext } from "drydock-sdk";
export const hello = defineNode(
{ name: "hello", role: "agent" }, // role: "agent" | "tool" | "mcp"
async (ctx: AgentContext, { name = "world" }: { name?: string } = {}) => {
return { message: `hello, ${name}` };
},
);# node.yaml
name: hello
version: 0.1.0
role: agent
runtime: node
entry: dist/handler.js:hellodrydock dev # hot-reload daemon + web UI
drydock invoke hello --input '{"name":"Sai"}'The ctx object
Every handler receives a context as its first argument:
| Call | Does |
|---|---|
| await ctx.a2a.call(target, input) | Invoke another node by name (agent-to-agent) |
| await ctx.mcp.call(alias, tool, args) | Call a tool on a declared MCP server |
| await ctx.mcp.list(alias) | List an MCP server's tools |
| await ctx.session.append(role, content) | Append to the persistent transcript |
| await ctx.session.history(limit) | Read recent transcript entries |
| await ctx.emit(data) | Stream a partial chunk (no-op on plain invoke) |
| ctx.sessionId, ctx.streaming, ctx.trace | Invocation metadata |
The handler receives the raw invocation input as its second argument. Return any JSON-serializable value.
Full reference — input mapping, session semantics, the error model, streaming, and environment scrubbing — is in docs/SDK.md.
Links
- Project & docs: https://github.com/scionoftech/drydock
- SDK reference: https://github.com/scionoftech/drydock/blob/main/docs/SDK.md
- Issues: https://github.com/scionoftech/drydock/issues
License
MIT
