SDK
The Barry SDK, @barry-rocks/sdk, is the TypeScript package you write bags
and their services against. A bag author mostly needs the root import, where
Barry and Barry.Tool live, plus /tools, /stores, and /testing. These
pages list every stable entry point the SDK exports. Imports under
@barry-rocks/sdk/internal/ carry no compatibility promise, so they aren’t
documented here, and a bag should not depend on them.
Create a bag and the guides after it show the pieces in use. Each page lists the API from the SDK’s own source; a declaration without a doc comment shows its signature only.
| Import | What it’s for |
|---|---|
@barry-rocks/sdk |
The root import holds Barry, the object a bag uses to define tools (Barry.Tool) and to ask Barry about identities, sessions, bags, actions, events, schedules, and services. |
@barry-rocks/sdk/testing |
Test doubles for the Barry subjects: fakeIdentities, fakeSessions, fakeActions, fakeEvents, fakeSchedules, fakeBags, fakeTracker, and fakeServices. |
@barry-rocks/sdk/tools |
Helpers for writing tools: the tool contract (defineTool, the same function as Barry.Tool, and its ToolContext), definePrompt for prompt contributors, resolveSessionId, resolveUserPath, result capping, and mcpResult for returning native MCP content. |
@barry-rocks/sdk/bags |
Types for bags as Barry sees them: the parsed manifest (Bag and the shapes of its apps, hooks, dependencies, stores, and more), plus parseManifest and findManifest. |
@barry-rocks/sdk/services |
Connecting to Barry’s local services: localConnection and getServiceUrl, the service registry types, environment-variable rules, and hosting configuration. |
@barry-rocks/sdk/services/http |
Scaffolding for a bag’s own HTTP service: serve, applyBaseMiddleware, applyAuth for Barry’s local-secret check, request and error loggers, and camelResponse. |
@barry-rocks/sdk/stores |
Per-bag SQLite stores: openBagStore opens (and migrates) a bag’s store, migrateStore and Migration run ordered migrations, and the registry types describe where each store lives. |
@barry-rocks/sdk/logging |
Structured logging for Node code: createLogger, redaction helpers that keep secrets out of log lines, flushAll, and setupGracefulShutdown. |
@barry-rocks/sdk/logging/edge |
The logger for code that runs on an edge runtime such as Cloudflare Workers, where Node’s file and process APIs aren’t available. |
@barry-rocks/sdk/auth |
The pieces of Barry’s local authentication a service needs: isAuthorized for the instance secret, browser sign-in (handleSignIn, hasBrowserSession, SIGN_IN_PATH), and the session cookie. |
@barry-rocks/sdk/apps |
The client for AG-UI, the protocol a bag’s app uses to watch and drive a session: AgUiConnection, its event and delivery types, and the public session snapshot. |
@barry-rocks/sdk/events |
Event types and schemas for Barry’s event feed, plus announce, which records an event (with a severity and a type) that sessions and people can read. |
@barry-rocks/sdk/transcripts |
Types for session transcripts: the events, sessions, sources, and scans that tools reading a harness’s conversation history work with. |
@barry-rocks/sdk/ids |
Shared identifier types and helpers: harness, mode, model, and vendor ids, parseModelRef and modelRef for vendor/model strings, isHarnessId, and generateId. |
@barry-rocks/sdk/http |
Small HTTP client helpers: postJson and describeFetchFailure, which turns a failed fetch into a message that says what went wrong. |
@barry-rocks/sdk/acp |
Barry’s side of the Agent Client Protocol (ACP): acpHosted and the types for serving a session to an editor that speaks ACP. |
@barry-rocks/sdk/mcp |
Serving a bag’s tools over MCP on its own: startBagServer, serveBagOverHttp, and the bag resource server. |
@barry-rocks/sdk/bounds |
The bound and trait types and the policy machinery behind them: BoundSchema, tool metadata, native-tool policy, and execution scopes. |
@barry-rocks/sdk/sessions |
Types for live sessions: turns, delivery, continuation, approvals, and the per-turn options a session adapter works with. |
@barry-rocks/sdk/adapters/harnesses |
The contract a session adapter implements to bring a harness to Barry: the Adapter shape, capabilities, guarantees, launch and engine types, and the errors an adapter raises. |
@barry-rocks/sdk/adapters/models |
The contract for model adapters: completion, embedding, and decision models, their requests, availability and compatibility checks, and the errors a model route raises. |