Skip to content
WIP

This guide is a work in progress. Barry is also a work in progress.

@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. Collections it returns are both awaitable and async-iterable, and failures throw BarryError. Barry.at() and Barry.connect() point it at a running instance over HTTP, and Barry.use() swaps in test doubles.

Start with BarryControls, the type of Barry itself. The members a bag uses most:

  • Tool defines a tool.
  • use installs subjects or test doubles in this process, and reset forgets them.
  • connect points every later call at one Barry over HTTP, and at returns a separate Barry for another installation.
  • as returns a Barry that acts for a named caller, such as a session.
  • The question methods, such as identity, identities, bags, actions, events, recordEvent, schedules, scheduleOnce, and services, return handles, collections, or results.

BarryControls extends Barry, the type that holds the questions alone, so this page lists each question method twice: once under Barry, and again under BarryControls with an “Inherited from” note.

import { … } from "@barry-rocks/sdk";
  • Error

new BarryError(reason, message, hint?): BarryError

Parameter Type
reason BarryErrorReason
message string
hint? string

BarryError

Error.constructor

Property Modifier Type
hint readonly string | undefined
reason readonly BarryErrorReason

get status(): 400 | 403 | 404 | 409 | 503

The HTTP status a route answers with.

400 | 403 | 404 | 409 | 503

toJSON(): object

The body a route answers with: the problem, and its hint when there is one.

object

Name Type
error string
hint? string
reason BarryErrorReason

An action a session or a caller can run.

Property Type Description
bag string -
description string -
executable boolean Whether it can run detached through the actions API.
inputs string[] -
inputSchema? Record<string, unknown> -
name string -
qualifiedName string -

Property Modifier Type
name readonly string

run(inputs?, options?): Promise<ActionRun>

Parameter Type
inputs? Record<string, unknown>
options? { identity?: IdentityReference; }
options.identity? IdentityReference

Promise<ActionRun>

runs(): Promise<ActionRun[]>

Promise<ActionRun[]>


One run of an action.

Property Type
action string
endedAt string | null
error? string
id string
output? unknown
sessionId string | null
startedAt string
status "running" | "succeeded" | "failed" | "cancelled" | "abandoned"
summary string | null

Property Type
action? string
limit? number
schedule? string

Property Modifier Type
name readonly "actions"

forSession(identity, sessionId, caller): Promise<Action[]>

The actions a session can run.

Parameter Type
identity IdentityReference
sessionId string
caller Caller

Promise<Action[]>

list(caller): Promise<Action[]>

Parameter Type
caller Caller

Promise<Action[]>

run(name, inputs, options, caller): Promise<ActionRun>

Parameter Type
name string
inputs Record<string, unknown>
options { identity?: IdentityReference; }
options.identity? IdentityReference
caller Caller

Promise<ActionRun>

runs(query, caller): Promise<ActionRun[]>

Parameter Type
query ActionRunQuery
caller Caller

Promise<ActionRun[]>


Property Modifier Type
name readonly string

extensions(): Promise<string[]>

Promise<string[]>

job(name): JobHandle

Parameter Type
name string

JobHandle

store(name?): StoreBinding

This bag’s store, from code running inside Barry (a tool, a job, a script).

Parameter Type
name? string

StoreBinding

tools(): Promise<Tool[]>

Promise<Tool[]>


Property Modifier Type
name readonly "bags"

extensions(bag, caller): Promise<string[]>

Parameter Type
bag string
caller Caller

Promise<string[]>

list(caller): Promise<object[]>

Parameter Type
caller Caller

Promise<object[]>

runJob(bag, job, inputs, options, caller): Promise<{ attempts: number; callerSessionId: string | null; createdAt: string; id: string; job: string; key: string | null; output: string | null; outputType: "text" | "json" | null; reason: string | null; runId: string | null; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; updatedAt: string; }>

Parameter Type
bag string
job string
inputs Record<string, unknown>
options { identity?: IdentityReference; key?: string; }
options.identity? IdentityReference
options.key? string
caller Caller

Promise<{ attempts: number; callerSessionId: string | null; createdAt: string; id: string; job: string; key: string | null; output: string | null; outputType: "text" | "json" | null; reason: string | null; runId: string | null; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; updatedAt: string; }>

tools(bag, caller): Promise<Tool[]>

Parameter Type
bag string
caller Caller

Promise<Tool[]>


What you can ask Barry: one Barry, as one caller.

action(name): ActionHandle

Parameter Type
name string

ActionHandle

actions(): Promise<Action[]>

Promise<Action[]>

bag(name): BagHandle

Parameter Type
name string

BagHandle

bags(): Promise<object[]>

Promise<object[]>

bounds(): Promise<Bound[]>

Promise<Bound[]>

createIdentity(input): Promise<Updated<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>>

Parameter Type
input IdentityCreate

Promise<Updated<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>>

device(id): DeviceHandle

Parameter Type
id string

DeviceHandle

devices(): Promise<Device[]>

Promise<Device[]>

events(query?): Collection<{ body: string | null; createdAt: string; data: Record<string, unknown>; deliveredVia: string[]; id: string; metadata: Record<string, unknown>; readAt: string | null; sessionId: string | null; severity: "info" | "warn" | "error" | "success"; source: string; title: string; type: "progress" | "notification" | "task_finished" | "system_alert"; }>

Parameter Type
query? EventQuery

Collection<{ body: string | null; createdAt: string; data: Record<string, unknown>; deliveredVia: string[]; id: string; metadata: Record<string, unknown>; readAt: string | null; sessionId: string | null; severity: "info" | "warn" | "error" | "success"; source: string; title: string; type: "progress" | "notification" | "task_finished" | "system_alert"; }>

grants(selection?): Promise<Grants>

What a session of no identity is granted, given what it selects (a schedule that names only traits).

Parameter Type
selection? GrantSelection

Promise<Grants>

identities(): Collection<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>

Collection<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>

identity(ref): IdentityHandle

Parameter Type
ref IdentityReference

IdentityHandle

lastChanges(paths): Promise<Change[]>

The latest recorded change to each file, naming the session that made it when the caller may see that session.

Parameter Type
paths readonly string[]

Promise<Change[]>

oneOff(id): OneOffHandle

Parameter Type
id string

OneOffHandle

oneOffs(query?): Promise<object[]>

Parameter Type
query? OneOffQuery

Promise<object[]>

owner(): Promise<Owner>

Promise<Owner>

recordEvent(input): Promise<{ body: string | null; createdAt: string; data: Record<string, unknown>; deliveredVia: string[]; id: string; metadata: Record<string, unknown>; readAt: string | null; sessionId: string | null; severity: "info" | "warn" | "error" | "success"; source: string; title: string; type: "progress" | "notification" | "task_finished" | "system_alert"; }>

Parameter Type
input EventInput

Promise<{ body: string | null; createdAt: string; data: Record<string, unknown>; deliveredVia: string[]; id: string; metadata: Record<string, unknown>; readAt: string | null; sessionId: string | null; severity: "info" | "warn" | "error" | "success"; source: string; title: string; type: "progress" | "notification" | "task_finished" | "system_alert"; }>

schedule(id): ScheduleHandle

Parameter Type
id string

ScheduleHandle

scheduleOnce(input): Promise<{ action: string | null; attempts?: object[]; bag: string; createdAt: string; dueAt: string; failures: number; id: string; idempotencyKey: string | null; inputs: Record<string, unknown>; job?: string | null; permissions?: { bounds?: string[]; identity?: string; traits?: string[]; }; reason: string | null; recoveries: number; retryAttempts: number; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; timeoutS: number; updatedAt: string; }>

Parameter Type
input OneOffInput

Promise<{ action: string | null; attempts?: object[]; bag: string; createdAt: string; dueAt: string; failures: number; id: string; idempotencyKey: string | null; inputs: Record<string, unknown>; job?: string | null; permissions?: { bounds?: string[]; identity?: string; traits?: string[]; }; reason: string | null; recoveries: number; retryAttempts: number; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; timeoutS: number; updatedAt: string; }>

scheduler(): Promise<Scheduler>

Promise<Scheduler>

schedules(): Promise<Schedule[]>

Promise<Schedule[]>

service(key): ServiceHandle

Parameter Type
key string

ServiceHandle

services(): Promise<Service[]>

Promise<Service[]>

traits(): Promise<object[]>

Promise<object[]>


Barry itself: what you can ask, and how a process says where the answers come from.

Property Type Description
Tool <T, R>(definition) => ToolDefinition<T, R> Define an MCP tool in a bag.

action(name): ActionHandle

Parameter Type
name string

ActionHandle

Barry.action

actions(): Promise<Action[]>

Promise<Action[]>

Barry.actions

as(caller): Barry

The same questions, asked as this caller.

Parameter Type
caller Caller

Barry

at(options): Barry

A second Barry in the same program, over HTTP.

Parameter Type
options ConnectOptions

Barry

bag(name): BagHandle

Parameter Type
name string

BagHandle

Barry.bag

bags(): Promise<object[]>

Promise<object[]>

Barry.bags

bounds(): Promise<Bound[]>

Promise<Bound[]>

Barry.bounds

connect(options): void

Reach another Barry over HTTP; only needed where its bags are not installed.

Parameter Type
options ConnectOptions

void

createIdentity(input): Promise<Updated<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>>

Parameter Type
input IdentityCreate

Promise<Updated<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>>

Barry.createIdentity

device(id): DeviceHandle

Parameter Type
id string

DeviceHandle

Barry.device

devices(): Promise<Device[]>

Promise<Device[]>

Barry.devices

events(query?): Collection<{ body: string | null; createdAt: string; data: Record<string, unknown>; deliveredVia: string[]; id: string; metadata: Record<string, unknown>; readAt: string | null; sessionId: string | null; severity: "info" | "warn" | "error" | "success"; source: string; title: string; type: "progress" | "notification" | "task_finished" | "system_alert"; }>

Parameter Type
query? EventQuery

Collection<{ body: string | null; createdAt: string; data: Record<string, unknown>; deliveredVia: string[]; id: string; metadata: Record<string, unknown>; readAt: string | null; sessionId: string | null; severity: "info" | "warn" | "error" | "success"; source: string; title: string; type: "progress" | "notification" | "task_finished" | "system_alert"; }>

Barry.events

grants(selection?): Promise<Grants>

What a session of no identity is granted, given what it selects (a schedule that names only traits).

Parameter Type
selection? GrantSelection

Promise<Grants>

Barry.grants

identities(): Collection<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>

Collection<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>

Barry.identities

identity(ref): IdentityHandle

Parameter Type
ref IdentityReference

IdentityHandle

Barry.identity

lastChanges(paths): Promise<Change[]>

The latest recorded change to each file, naming the session that made it when the caller may see that session.

Parameter Type
paths readonly string[]

Promise<Change[]>

Barry.lastChanges

oneOff(id): OneOffHandle

Parameter Type
id string

OneOffHandle

Barry.oneOff

oneOffs(query?): Promise<object[]>

Parameter Type
query? OneOffQuery

Promise<object[]>

Barry.oneOffs

owner(): Promise<Owner>

Promise<Owner>

Barry.owner

recordEvent(input): Promise<{ body: string | null; createdAt: string; data: Record<string, unknown>; deliveredVia: string[]; id: string; metadata: Record<string, unknown>; readAt: string | null; sessionId: string | null; severity: "info" | "warn" | "error" | "success"; source: string; title: string; type: "progress" | "notification" | "task_finished" | "system_alert"; }>

Parameter Type
input EventInput

Promise<{ body: string | null; createdAt: string; data: Record<string, unknown>; deliveredVia: string[]; id: string; metadata: Record<string, unknown>; readAt: string | null; sessionId: string | null; severity: "info" | "warn" | "error" | "success"; source: string; title: string; type: "progress" | "notification" | "task_finished" | "system_alert"; }>

Barry.recordEvent

reset(): void

Forget every installed subject, the connection and the caller resolver (tests).

void

schedule(id): ScheduleHandle

Parameter Type
id string

ScheduleHandle

Barry.schedule

scheduleOnce(input): Promise<{ action: string | null; attempts?: object[]; bag: string; createdAt: string; dueAt: string; failures: number; id: string; idempotencyKey: string | null; inputs: Record<string, unknown>; job?: string | null; permissions?: { bounds?: string[]; identity?: string; traits?: string[]; }; reason: string | null; recoveries: number; retryAttempts: number; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; timeoutS: number; updatedAt: string; }>

Parameter Type
input OneOffInput

Promise<{ action: string | null; attempts?: object[]; bag: string; createdAt: string; dueAt: string; failures: number; id: string; idempotencyKey: string | null; inputs: Record<string, unknown>; job?: string | null; permissions?: { bounds?: string[]; identity?: string; traits?: string[]; }; reason: string | null; recoveries: number; retryAttempts: number; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; timeoutS: number; updatedAt: string; }>

Barry.scheduleOnce

scheduler(): Promise<Scheduler>

Promise<Scheduler>

Barry.scheduler

schedules(): Promise<Schedule[]>

Promise<Schedule[]>

Barry.schedules

service(key): ServiceHandle

Parameter Type
key string

ServiceHandle

Barry.service

services(): Promise<Service[]>

Promise<Service[]>

Barry.services

traits(): Promise<object[]>

Promise<object[]>

Barry.traits

use(…subjects): void

Install the subjects this process hosts; their calls then run in-process.

Parameter Type
…subjects Subject[]

void

useCaller(resolver): void

How a hosting process tells Barry who the current call is for.

Parameter Type
resolver (() => Caller | undefined) | null

void


Agent Bound — restrictions on a task’s capabilities. Bounds limit: they can only take away what traits have granted.

Property Type Description
bash? object Bash command restrictions
bash.deny? string[] Legacy substring deny patterns — a command is denied if it contains any pattern as a substring. Fragile (misses git -C, false-positives on legit); kept for backward compat. Prefer denyPrograms. Deprecated Use denyPrograms for program-aware matching.
bash.denyPrograms? string[] Deny by resolved program name. Each entry is a program ("git", "gh") or program:subcommand ("git:push"). Every command in the line — across &&/`
deniedAccess? string[] Deny write access globally (“write”) or for specific namespaces/tools
deniedTools? string[] Tools excluded entirely — by namespace or toolName
description? string -
files? object Filesystem path restrictions. deny removes the paths it matches. allowOnly is the other direction: when present, every path that matches NONE of its patterns is denied, so the session may touch only what it names (e.g. ~/repos/vantage/**). Deny is checked first — a path matching both lists is denied. Merging moves toward more restriction: deny lists union, allowOnly lists intersect (the same rule as network.allowDomains). An allowlist also takes back the harness bag’s native file and shell tools because the provider’s own Read/Bash never pass through the guards.
files.allowOnly? string[] -
files.deny? string[] -
name? string -
nativeTools? Record<string, string[]> Native tools denied by their declaring harness, separate from MCP tools.
network? object Network access restrictions
network.actions? string[] Network actions to deny. Entries are hierarchical action tags: “all” — all network access “write” — all outbound writes (git:push, http:write, ssh:write) “read” — all outbound reads (git:fetch, http:read, dns) “git:push” — git push specifically “git:fetch” — git fetch/pull/clone “http:write” — HTTP POST/PUT/PATCH/DELETE “http:read” — HTTP GET/HEAD “ssh:write” — scp upload, rsync push “ssh:read” — ssh connections “dns” — DNS lookups (dig, nslookup, host) Parent tags expand to include their children: “write” implies “git:push” + “http:write” + “ssh:write”.
network.allowDomains? string[] Destination hosts the session may reach, enforced by the agent runtime’s egress proxy. Requires enforce: "sandbox": the app-level guards cannot enforce an allowlist, so a bound that sets this without it is refused. This is the inverse of domains, and the two are NOT interchangeable: a deny-list says nothing about which of the infinite remaining hosts are acceptable. Both may be set; they are independent layers and a host present in domains is denied regardless of this list. Omitting it under enforce: "sandbox" means an EMPTY allowlist — no egress except localhost. Opening a host is always an explicit act.
network.domains? string[] Destination domains to deny. Supports wildcards: “*.internal.co” matches “api.internal.co”. Best-effort — inspects URL arguments in bash commands (curl, wget, git clone). Cannot cover bag proxy tools or dynamically constructed URLs.
network.enforce? "guard" | "sandbox" Enforcement level: “guard” (default) — application-level tool/command interception only. Cooperative safety rail with clear error messages. “sandbox” — adds the agent runtime’s process-tree sandbox: outbound traffic is forced through an egress proxy that filters by HOSTNAME (see allowDomains), and the agent cannot lift it. Covers write-to-disk bypasses and network binaries the command classifier doesn’t know. It filters by host, not by HTTP method, so partial action denials (e.g. actions: [“write”]) still rely on the guards.
nodes? object Which installations may run this work: this one (“local” or its id) and the workers it invited.
nodes.allow? string[] -
nodes.deny? string[] -

One file change a session made, as the tracker recorded it.

Property Type Description
at string -
path string -
sessionId string | null The session that made it; null when that session belongs to an identity the caller may not see.
tool string | null -

Many of something. Iterate it to go through every item, fetching pages as needed (for await (const s of bux.sessions())), or await it for them all at once (const all = await bux.sessions()).

  • AsyncIterable<T>.PromiseLike<T[]>
Type Parameter
T

Property Type Description Inherited from
baseUrl? string The API base URL, with or without the /api/v1 suffix. -
fetch? {(input, init?): Promise<Response>; (input, init?): Promise<Response>; } For tests and non-Node runtimes. -
identities? ServiceClientOptions Identity administration and device pairing share this separate service. Credentials are explicit. -
resolveCredential? CredentialResolver Called for each request, including reconnects; the client never caches tokens. ClientCredentials.resolveCredential
secret? string - ClientCredentials.secret
services? ServiceClientOptions Service control uses the MCP server and its own credentials. -
timeoutMs? number Per-request deadline, in milliseconds. Defaults to 10 seconds. -

What session.send reports about a message.

Property Type
clientMessageId? string | null
messageId? string
state "queued" | "failed" | "uncertain" | "accepted"

A device paired with this Barry.

Property Type
id string
identityIds number[]
lastSeenAt string | null
name string
pairedAt string
scopes string[]

Property Modifier Type
id readonly string

revoke(): Promise<void>

Promise<void>


An event to record.

Property Type
body? string
data? Record<string, unknown>
session? string
severity? "info" | "warn" | "error" | "success"
title string
type "progress" | "notification" | "task_finished" | "system_alert"

A query over events.

Property Type
session? string
since? string
type? "progress" | "notification" | "task_finished" | "system_alert"
unread? boolean

Property Modifier Type
name readonly "events"

list(query, cursor, caller): Promise<Page<{ body: string | null; createdAt: string; data: Record<string, unknown>; deliveredVia: string[]; id: string; metadata: Record<string, unknown>; readAt: string | null; sessionId: string | null; severity: "info" | "warn" | "error" | "success"; source: string; title: string; type: "progress" | "notification" | "task_finished" | "system_alert"; }>>

Parameter Type
query EventQuery
cursor string | null
caller Caller

Promise<Page<{ body: string | null; createdAt: string; data: Record<string, unknown>; deliveredVia: string[]; id: string; metadata: Record<string, unknown>; readAt: string | null; sessionId: string | null; severity: "info" | "warn" | "error" | "success"; source: string; title: string; type: "progress" | "notification" | "task_finished" | "system_alert"; }>>

record(input, caller): Promise<{ body: string | null; createdAt: string; data: Record<string, unknown>; deliveredVia: string[]; id: string; metadata: Record<string, unknown>; readAt: string | null; sessionId: string | null; severity: "info" | "warn" | "error" | "success"; source: string; title: string; type: "progress" | "notification" | "task_finished" | "system_alert"; }>

Parameter Type
input EventInput
caller Caller

Promise<{ body: string | null; createdAt: string; data: Record<string, unknown>; deliveredVia: string[]; id: string; metadata: Record<string, unknown>; readAt: string | null; sessionId: string | null; severity: "info" | "warn" | "error" | "success"; source: string; title: string; type: "progress" | "notification" | "task_finished" | "system_alert"; }>


Everything a session of an identity gets: one answer for every launch path.

Property Type Description
bound Bound | null The bound every restriction merges into; null for none.
instructions Instruction[] -
namespaces string[] The tool namespaces the traits grant; each reaches the session under its own prefix.
skills Skill[] -
tools Tool[] -
traits string[] The effective traits: the defaults this installation has, the identity’s, and the session’s own.
warnings? readonly string[] Grants a session asked for that could not be honoured, with the reason — a default trait this installation lacks, say. A dropped grant was silently absent before (POL-18): the session’s effective traits simply did not include it, and nothing said why. Surfacing it here lets session show and launch diagnostics report the gap rather than leaving the reader to notice an expected capability is missing. Omitted (not []) when nothing was dropped, so an older consumer that never reads it is unaffected.

What a session or a caller selects on top of an identity.

Property Type Description
bounds? readonly string[] Named bounds, by name.
defaults? boolean The installation’s default traits; on unless a caller grants only what it names.
harness? string -
identityTraits? boolean The identity’s own traits and bags; on unless a caller scopes to the session alone.
inlineBound? Bound | null Restrictions written inline.
mode? ModeId -
namespaces? readonly string[] Namespaces granted directly, beside the traits.
tools? readonly string[] Tools granted directly, by name, beside the traits.
traits? readonly string[] -

Property Modifier Type
name readonly "identities"

allTraits(caller): Promise<object[]>

Every trait and named bound this installation has.

Parameter Type
caller Caller

Promise<object[]>

bounds(caller): Promise<Bound[]>

Parameter Type
caller Caller

Promise<Bound[]>

create(input, caller): Promise<Updated<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>>

Parameter Type
input IdentityCreate
caller Caller

Promise<Updated<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>>

devices(caller): Promise<Device[]>

Parameter Type
caller Caller

Promise<Device[]>

get(ref, caller): Promise<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>

Parameter Type
ref IdentityReference
caller Caller

Promise<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>

grants(ref, selection, caller): Promise<Grants>

What a session of the identity (or of none, for null) is granted.

Parameter Type
ref IdentityReference | null
selection GrantSelection
caller Caller

Promise<Grants>

list(caller): Promise<object[]>

Parameter Type
caller Caller

Promise<object[]>

makeDefault(ref, caller): Promise<void>

Parameter Type
ref IdentityReference
caller Caller

Promise<void>

owner(caller): Promise<Owner>

Parameter Type
caller Caller

Promise<Owner>

remove(ref, caller): Promise<IdentityRemoval>

Parameter Type
ref IdentityReference
caller Caller

Promise<IdentityRemoval>

revokeDevice(id, caller): Promise<void>

Parameter Type
id string
caller Caller

Promise<void>

traits(ref, caller): Promise<object[]>

The traits the identity carries, inherited ones included.

Parameter Type
ref IdentityReference
caller Caller

Promise<object[]>

update(ref, changes, caller): Promise<Updated<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>>

Parameter Type
ref IdentityReference
changes IdentityUpdate
caller Caller

Promise<Updated<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>>


Property Type
stores? Record<string, { app_url?: string; engine?: "sqlite"; filepath?: string; url?: string; }>
tools? Record<string, ToolVisibility>

What creating an identity takes.

Property Type Description Inherited from
adapters? Readonly<Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>> | null - IdentityUpdate.adapters
aliases? readonly string[] | null More commands that run Barry as this identity. IdentityUpdate.aliases
bagConfigs? Readonly<Record<string, IdentityBagConfiguration>> | null - IdentityUpdate.bagConfigs
bags? readonly string[] | null - IdentityUpdate.bags
bounds? readonly string[] | null - IdentityUpdate.bounds
directory? string Where its directory goes; by default Barry’s own identities folder. -
displayName? string | null - IdentityUpdate.displayName
githubInstallationId? number | null - IdentityUpdate.githubInstallationId
inherits? string - -
name string - -
secrets? Readonly<Record<string, { account?: string; in: "keychain"; item: string; } | { field: "username" | "password" | "notes" | "uri"; in: "vault"; item: string; } | { in: ".env"; key?: string; }>> | null - IdentityUpdate.secrets
statusNotify? { target?: string; tool: string; } | null - IdentityUpdate.statusNotify
traits? readonly string[] | null - IdentityUpdate.traits
vault? string | null - IdentityUpdate.vault

Property Modifier Type
ref readonly IdentityReference

get(): Promise<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>

Promise<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>

grants(selection?): Promise<Grants>

What a session of it would be granted, given what the session selects on top.

Parameter Type
selection? GrantSelection

Promise<Grants>

makeDefault(): Promise<void>

Make it the one unqualified commands act as.

Promise<void>

remove(): Promise<IdentityRemoval>

Remove it: its sessions, its row, and its directory’s place in Barry.

Promise<IdentityRemoval>

session(id): SessionHandle

Parameter Type
id string

SessionHandle

sessions(query?): Collection<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>

Parameter Type
query? SessionQuery

Collection<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>

start(input?): Promise<SessionHandle>

Start a session as this identity.

Parameter Type
input? SessionStart

Promise<SessionHandle>

tools(selection?): Promise<Tool[]>

The tools a session of it would start with.

Parameter Type
selection? GrantSelection

Promise<Tool[]>

traits(): Promise<object[]>

The traits it carries, inherited ones included.

Promise<object[]>

update(changes): Promise<Updated<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>>

Parameter Type
changes IdentityUpdate

Promise<Updated<{ adapters: Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>; bags: string[]; bound?: Record<string, unknown> | null; bounds: string[]; createdAt: string | null; directory?: string | null; displayName: string | null; envKeys: string[]; envSources?: Record<string, string>; githubInstallationId?: number | null; id: number; isDefault: boolean; lastUsedAt: string | null; name: string; source?: "file" | "db"; statusNotify?: { target?: string; tool: string; } | null; token: string; traits: string[]; vaultEmail: string | null; }>>


What removing an identity did.

Property Type Description
directory "moved" | "unregistered" | null A directory in Barry’s own folder is moved aside; one recorded elsewhere is unregistered and left on disk.
movedTo? string -
name string -
nextDefault string | null | undefined The identity that became the default, null when none remain, undefined when the default did not change.
sessionsDeleted number -

A change to an identity. A field that is present is changed; null clears it.

Property Type Description
adapters? Readonly<Record<string, { default?: boolean; mode?: "hosted" | "instrumented" | "guest"; model?: string; }>> | null -
aliases? readonly string[] | null More commands that run Barry as this identity.
bagConfigs? Readonly<Record<string, IdentityBagConfiguration>> | null -
bags? readonly string[] | null -
bounds? readonly string[] | null -
displayName? string | null -
githubInstallationId? number | null -
secrets? Readonly<Record<string, { account?: string; in: "keychain"; item: string; } | { field: "username" | "password" | "notes" | "uri"; in: "vault"; item: string; } | { in: ".env"; key?: string; }>> | null -
statusNotify? { target?: string; tool: string; } | null -
traits? readonly string[] | null -
vault? string | null -

An instruction document a session is pointed at.

Property Type
name string

Property Modifier Type
bag readonly string
name readonly string

run(inputs?, options?): Promise<{ attempts: number; callerSessionId: string | null; createdAt: string; id: string; job: string; key: string | null; output: string | null; outputType: "text" | "json" | null; reason: string | null; runId: string | null; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; updatedAt: string; }>

Parameter Type
inputs? Record<string, unknown>
options? { identity?: IdentityReference; key?: string; }
options.identity? IdentityReference
options.key? string

Promise<{ attempts: number; callerSessionId: string | null; createdAt: string; id: string; job: string; key: string | null; output: string | null; outputType: "text" | "json" | null; reason: string | null; runId: string | null; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; updatedAt: string; }>


Which messages to read, and how much detail to carry.

Property Type Description
after? number Read oldest first after this sequence.
before? number Read newest first before this sequence.
brief? boolean Carry an input preview and omit results.
newestFirst? boolean Read from the newest message.

Property Modifier Type
id readonly string

cancel(): Promise<{ action: string | null; attempts?: object[]; bag: string; createdAt: string; dueAt: string; failures: number; id: string; idempotencyKey: string | null; inputs: Record<string, unknown>; job?: string | null; permissions?: { bounds?: string[]; identity?: string; traits?: string[]; }; reason: string | null; recoveries: number; retryAttempts: number; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; timeoutS: number; updatedAt: string; }>

Promise<{ action: string | null; attempts?: object[]; bag: string; createdAt: string; dueAt: string; failures: number; id: string; idempotencyKey: string | null; inputs: Record<string, unknown>; job?: string | null; permissions?: { bounds?: string[]; identity?: string; traits?: string[]; }; reason: string | null; recoveries: number; retryAttempts: number; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; timeoutS: number; updatedAt: string; }>


An action to run once, later.

Property Type Description
action string -
attempts? number Total attempts when a run fails, 1 to 5. Default 1.
bounds? readonly string[] -
dueAt string | Date -
idempotencyKey? string -
identity? IdentityReference -
inputs? Record<string, unknown> -
traits? readonly string[] -

Property Type
bag? string
limit? number
status? "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"

The person this installation belongs to.

Property Type
defaultIdentity string | null
id number
name string

One page of a collection, and where the next one starts.

Type Parameter
T
Property Type
items T[]
next string | null

A recurring schedule with its most recent scheduler state.

Property Type
action string
consecutiveFailures number
description? string
enabled boolean
id string
job? string
lastFiredAt string | null
lastRunId string | null
lastStatus string | null
lastSummary string | null
missedFires number
nextFireAt string | null
paused boolean
skippedFires number
trigger string

Property Modifier Type
id readonly string

runs(): Promise<ActionRun[]>

Promise<ActionRun[]>


Property Type
heartbeatAt string | null
loadErrors string[]
reason string | null
status "ok" | "degraded" | "down"

Property Modifier Type
name readonly "schedules"

cancelOneOff(id, caller): Promise<{ action: string | null; attempts?: object[]; bag: string; createdAt: string; dueAt: string; failures: number; id: string; idempotencyKey: string | null; inputs: Record<string, unknown>; job?: string | null; permissions?: { bounds?: string[]; identity?: string; traits?: string[]; }; reason: string | null; recoveries: number; retryAttempts: number; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; timeoutS: number; updatedAt: string; }>

Parameter Type
id string
caller Caller

Promise<{ action: string | null; attempts?: object[]; bag: string; createdAt: string; dueAt: string; failures: number; id: string; idempotencyKey: string | null; inputs: Record<string, unknown>; job?: string | null; permissions?: { bounds?: string[]; identity?: string; traits?: string[]; }; reason: string | null; recoveries: number; retryAttempts: number; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; timeoutS: number; updatedAt: string; }>

list(caller): Promise<Schedule[]>

Parameter Type
caller Caller

Promise<Schedule[]>

oneOffs(query, caller): Promise<object[]>

Parameter Type
query OneOffQuery
caller Caller

Promise<object[]>

scheduleOnce(input, caller): Promise<{ action: string | null; attempts?: object[]; bag: string; createdAt: string; dueAt: string; failures: number; id: string; idempotencyKey: string | null; inputs: Record<string, unknown>; job?: string | null; permissions?: { bounds?: string[]; identity?: string; traits?: string[]; }; reason: string | null; recoveries: number; retryAttempts: number; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; timeoutS: number; updatedAt: string; }>

Parameter Type
input OneOffInput
caller Caller

Promise<{ action: string | null; attempts?: object[]; bag: string; createdAt: string; dueAt: string; failures: number; id: string; idempotencyKey: string | null; inputs: Record<string, unknown>; job?: string | null; permissions?: { bounds?: string[]; identity?: string; traits?: string[]; }; reason: string | null; recoveries: number; retryAttempts: number; status: "pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain"; timeoutS: number; updatedAt: string; }>

scheduler(caller): Promise<Scheduler>

Parameter Type
caller Caller

Promise<Scheduler>


A launchd-managed service of a bag.

Property Type
address string | null
bag string
conflict string | null
enabled boolean
health "unknown" | "ok" | "failing"
key string
kind "service" | "app" | "container" | "deployment"
lastExitCode number | null
loopbackOnly boolean | null
name string
pid number | null
port number | null
problem string | null
registered boolean
restarts number
startedAt string | null
state "unsupported" | "running" | "starting" | "backoff" | "stopped" | "conflict"
system boolean
workingDirectory string

Property Type Description Inherited from
baseUrl string - -
fetch? {(input, init?): Promise<Response>; (input, init?): Promise<Response>; } - -
resolveCredential? CredentialResolver Called for each request, including reconnects; the client never caches tokens. ClientCredentials.resolveCredential
secret? string - ClientCredentials.secret
timeoutMs? number - -

Property Modifier Type
key readonly string

get(): Promise<Service>

Promise<Service>

restart(): Promise<Service>

Promise<Service>

start(): Promise<Service>

Promise<Service>

stop(): Promise<Service>

Promise<Service>


Property Modifier Type
name readonly "services"

get(key, caller): Promise<Service>

Parameter Type
key string
caller Caller

Promise<Service>

list(caller): Promise<Service[]>

Parameter Type
caller Caller

Promise<Service[]>

restart(key, caller): Promise<Service>

Parameter Type
key string
caller Caller

Promise<Service>

start(key, caller): Promise<Service>

Parameter Type
key string
caller Caller

Promise<Service>

stop(key, caller): Promise<Service>

Parameter Type
key string
caller Caller

Promise<Service>


Property Modifier Type
id readonly string
identity readonly IdentityHandle

actions(): Promise<Action[]>

Promise<Action[]>

archive(): Promise<void>

Promise<void>

bound(): Promise<Bound | null>

Promise<Bound | null>

changes(): Promise<Change[]>

Promise<Change[]>

end(): Promise<void>

Promise<void>

events(): AsyncIterable<SessionEvent>

The session’s live events, as they happen.

AsyncIterable<SessionEvent>

get(): Promise<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>

Promise<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>

grants(): Promise<Grants>

Everything the session is granted, in one call.

Promise<Grants>

instructions(): Promise<Instruction[]>

Promise<Instruction[]>

listening(): Promise<boolean>

Whether a live surface listens or promises delivery.

Promise<boolean>

message(sequence): Promise<{ clientMessageId?: string | null; content?: string | null; createdAt: string; deliveryError?: string | null; deliveryState?: "queued" | "failed" | "uncertain" | "accepted"; error?: string | null; hasDetail?: boolean; input?: unknown; name?: string | null; parentToolUseId?: string | null; result?: unknown; role?: "assistant" | "user" | "system" | null; sequence: number; sessionId: string; status?: string | null; taskStatus?: string | null; toolUseId?: string | null; type: "error" | "init" | "text" | "result" | "summary" | "tool_start"; }>

One message by its sequence.

Parameter Type
sequence number

Promise<{ clientMessageId?: string | null; content?: string | null; createdAt: string; deliveryError?: string | null; deliveryState?: "queued" | "failed" | "uncertain" | "accepted"; error?: string | null; hasDetail?: boolean; input?: unknown; name?: string | null; parentToolUseId?: string | null; result?: unknown; role?: "assistant" | "user" | "system" | null; sequence: number; sessionId: string; status?: string | null; taskStatus?: string | null; toolUseId?: string | null; type: "error" | "init" | "text" | "result" | "summary" | "tool_start"; }>

messages(query?): Collection<{ clientMessageId?: string | null; content?: string | null; createdAt: string; deliveryError?: string | null; deliveryState?: "queued" | "failed" | "uncertain" | "accepted"; error?: string | null; hasDetail?: boolean; input?: unknown; name?: string | null; parentToolUseId?: string | null; result?: unknown; role?: "assistant" | "user" | "system" | null; sequence: number; sessionId: string; status?: string | null; taskStatus?: string | null; toolUseId?: string | null; type: "error" | "init" | "text" | "result" | "summary" | "tool_start"; }>

The session’s messages, oldest first unless the query asks otherwise.

Parameter Type
query? MessageQuery

Collection<{ clientMessageId?: string | null; content?: string | null; createdAt: string; deliveryError?: string | null; deliveryState?: "queued" | "failed" | "uncertain" | "accepted"; error?: string | null; hasDetail?: boolean; input?: unknown; name?: string | null; parentToolUseId?: string | null; result?: unknown; role?: "assistant" | "user" | "system" | null; sequence: number; sessionId: string; status?: string | null; taskStatus?: string | null; toolUseId?: string | null; type: "error" | "init" | "text" | "result" | "summary" | "tool_start"; }>

send(text, options?): Promise<Delivery>

Parameter Type
text string
options? { clientMessageId?: string; }
options.clientMessageId? string

Promise<Delivery>

skills(): Promise<Skill[]>

Promise<Skill[]>

tools(): Promise<Tool[]>

Promise<Tool[]>

update(changes): Promise<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>

Parameter Type
changes SessionUpdate

Promise<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>


A query over sessions.

Property Type
active? boolean
order? "created" | "activity"
pinned? boolean
search? string
since? string
status? "pending" | "running" | "failed" | "cancelled" | "planning" | "completed" | readonly ("pending" | "running" | "failed" | "cancelled" | "planning" | "completed")[]

Property Modifier Type
name readonly "sessions"

archive(identity, id, caller): Promise<void>

Parameter Type
identity IdentityReference
id string
caller Caller

Promise<void>

end(identity, id, caller): Promise<void>

Parameter Type
identity IdentityReference
id string
caller Caller

Promise<void>

events(identity, id, caller): AsyncIterable<SessionEvent>

Parameter Type
identity IdentityReference
id string
caller Caller

AsyncIterable<SessionEvent>

get(identity, id, caller): Promise<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>

Parameter Type
identity IdentityReference
id string
caller Caller

Promise<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>

grants(identity, id, caller): Promise<Grants>

Parameter Type
identity IdentityReference
id string
caller Caller

Promise<Grants>

list(identity, query, cursor, caller): Promise<Page<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>>

Parameter Type
identity IdentityReference
query SessionQuery
cursor string | null
caller Caller

Promise<Page<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>>

listening(identity, id, caller): Promise<boolean>

Parameter Type
identity IdentityReference
id string
caller Caller

Promise<boolean>

message(identity, id, sequence, caller): Promise<{ clientMessageId?: string | null; content?: string | null; createdAt: string; deliveryError?: string | null; deliveryState?: "queued" | "failed" | "uncertain" | "accepted"; error?: string | null; hasDetail?: boolean; input?: unknown; name?: string | null; parentToolUseId?: string | null; result?: unknown; role?: "assistant" | "user" | "system" | null; sequence: number; sessionId: string; status?: string | null; taskStatus?: string | null; toolUseId?: string | null; type: "error" | "init" | "text" | "result" | "summary" | "tool_start"; }>

Parameter Type
identity IdentityReference
id string
sequence number
caller Caller

Promise<{ clientMessageId?: string | null; content?: string | null; createdAt: string; deliveryError?: string | null; deliveryState?: "queued" | "failed" | "uncertain" | "accepted"; error?: string | null; hasDetail?: boolean; input?: unknown; name?: string | null; parentToolUseId?: string | null; result?: unknown; role?: "assistant" | "user" | "system" | null; sequence: number; sessionId: string; status?: string | null; taskStatus?: string | null; toolUseId?: string | null; type: "error" | "init" | "text" | "result" | "summary" | "tool_start"; }>

messages(identity, id, query, cursor, caller): Promise<Page<{ clientMessageId?: string | null; content?: string | null; createdAt: string; deliveryError?: string | null; deliveryState?: "queued" | "failed" | "uncertain" | "accepted"; error?: string | null; hasDetail?: boolean; input?: unknown; name?: string | null; parentToolUseId?: string | null; result?: unknown; role?: "assistant" | "user" | "system" | null; sequence: number; sessionId: string; status?: string | null; taskStatus?: string | null; toolUseId?: string | null; type: "error" | "init" | "text" | "result" | "summary" | "tool_start"; }>>

Parameter Type
identity IdentityReference
id string
query MessageQuery
cursor string | null
caller Caller

Promise<Page<{ clientMessageId?: string | null; content?: string | null; createdAt: string; deliveryError?: string | null; deliveryState?: "queued" | "failed" | "uncertain" | "accepted"; error?: string | null; hasDetail?: boolean; input?: unknown; name?: string | null; parentToolUseId?: string | null; result?: unknown; role?: "assistant" | "user" | "system" | null; sequence: number; sessionId: string; status?: string | null; taskStatus?: string | null; toolUseId?: string | null; type: "error" | "init" | "text" | "result" | "summary" | "tool_start"; }>>

removeAll(identity, caller): Promise<number>

Delete every session of an identity, as removing the identity does; how many there were.

Parameter Type
identity IdentityReference
caller Caller

Promise<number>

send(identity, id, text, options, caller): Promise<Delivery>

Parameter Type
identity IdentityReference
id string
text string
options { clientMessageId?: string; }
options.clientMessageId? string
caller Caller

Promise<Delivery>

start(identity, input, caller): Promise<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>

Parameter Type
identity IdentityReference
input SessionStart
caller Caller

Promise<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>

update(identity, id, changes, caller): Promise<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>

Parameter Type
identity IdentityReference
id string
changes SessionUpdate
caller Caller

Promise<{ baseRepoPath: string | null; bound: Record<string, unknown> | null; bounds?: string[]; branch?: string | null; createdAt: string; endedAt?: string | null; harness?: string | null; hostname?: string | null; id: string; identityId: number | null; identitySource: "file" | "default" | "explicit" | "repo" | null; lastMessageAt?: string | null; messageCount?: number; model: string | null; modelRef?: string | null; name: string; pid?: number | null; pidStartedAt?: number | null; pinned: boolean; provider: string | null; repoPath: string | null; source: string | null; startedAt: string | null; status: "pending" | "running" | "failed" | "cancelled" | "planning" | "completed"; statusUpdate?: { phase: string | null; summary: string | null; updatedAt: string | null; } | null; summary: string | null; systemPrompt: string | null; traits: string[]; transcriptPath?: string | null; useWorktree: boolean; worktreePath: string | null; worktreeStatus: string | null; }>


What starting a session takes.

Property Type
bounds? readonly string[]
harness? string
inlineBound? Bound | null
model? string
modelProvider? string
name? string
prompt? string
repoPath? string
systemPrompt? string
traits? readonly string[]
useWorktree? boolean

A change to a session’s own settings.

Property Type
bounds? readonly string[]
harness? string
inlineBound? Bound | null
model? string
modelProvider? string
name? string
pinned? boolean
traits? readonly string[]

A skill a session has mounted.

Property Type
name string

A tool a session can call.

Property Type Description
access "read" | "write" -
bag string | null The bag that provides it; null for a harness’s own tool.
description? string What it does, when its bag says.
input? Record<string, unknown> JSON Schema of its input, when known.
name string The tool’s own name, as the harness calls it.
namespace string The namespace it is granted under (git, linear, bash).
unavailable? string -
uncontrolled? string -

Property Modifier Type
name readonly "tracker"

changes(identity, sessionId, caller): Promise<Change[]>

Parameter Type
identity IdentityReference
sessionId string
caller Caller

Promise<Change[]>

lastChanges(paths, caller): Promise<Change[]>

Parameter Type
paths readonly string[]
caller Caller

Promise<Change[]>

AdapterSettings = z.infer<typeof AdapterSettingsSchema>


ApiWarning = z.infer<typeof ApiWarningSchema>


Bag = z.infer<typeof BagInfoSchema>

A bag as the registry knows it.


Barry = Barry

What you can ask Barry: one Barry, as one caller (what Barry.at and Barry.as return).


BarryErrorReason = "invalid" | "forbidden" | "not_found" | "conflict" | "unavailable"

The one error Barry throws when it refuses: why (reason), what happened (message) and, when there is one, what to do (hint). The terminal prints it; an HTTP route answers its status; nothing else has to unwrap a result.


Caller = { actorId?: number; kind: "owner"; } | { kind: "device"; principal: DevicePrincipal; } | { bag?: string; identity: IdentityReference; kind: "session"; sessionId: string; }

Who is asking.

{ actorId?: number; kind: "owner"; }

The installation’s owner: the terminal, or a service holding the instance secret.


{ kind: "device"; principal: DevicePrincipal; }

A paired device: its scopes and the identities it was granted, nothing else.


{ bag?: string; identity: IdentityReference; kind: "session"; sessionId: string; }

Code running for a session (a bag’s tool, a hook): what that session’s identity allows.

Name Type Description
bag? string The bag asking on this session’s behalf, absent when the session itself asks.
identity IdentityReference -
kind "session" -
sessionId string -

CredentialResolver = (options) => string | Promise<string>

Parameter Type
options { signal: AbortSignal; }
options.signal AbortSignal

string | Promise<string>


DevicePrincipal = z.infer<typeof DevicePrincipalSchema>


Identity = z.infer<typeof IdentitySchema>

An identity: reusable configuration a session runs as.


IdentityAdapters = Record<string, AdapterSettings>


IdentityReference = string | number

How an identity is named in a call: its name, or its row id.


JobRun = JobRunRecord

One run of a bag’s job.


JobRunRecord = z.infer<typeof JobRunSchema>


Message = z.infer<typeof MessageSchema>

One message in a session’s transcript.


OneOff = OneOffRecord

An action scheduled to run once, later.


OneOffRecord = z.infer<typeof OneOffSchema>


Session = z.infer<typeof SessionSchema>


SessionEvent = { message: Message; type: "message"; } | { status: Session["status"]; type: "status"; } | { isError?: boolean; name: string; phase: "started" | "finished"; type: "tool"; } | { reason?: string; type: "ended"; }

What a live session reports while it runs.


StoreBinding = Readonly<object & { filepath: string; url?: never; } | { filepath?: never; url: string; }>


Subject = Identities | Sessions | Actions | Events | Schedules | Bags | Tracker | Services

A subject Barry answers for, as a bag provides it: what Barry.use installs.


SubjectName = Subject["name"]


SubjectNamed<N> = Extract<Subject, { name: N; }>

Type Parameter
N extends SubjectName

ToolVisibility = "enabled" | "deferred" | "disabled"


Trait = z.infer<typeof TraitSchema>

A trait: the grants an identity or a session can select.


Updated<T> = T & object

A value a change produced, with the warnings it raised.

Name Type
warnings readonly Warning[]
Type Parameter
T

Warning = ApiWarning

A non-fatal condition reported beside a successful change.

const AdapterSettingsSchema: ZodObject<{ default: ZodOptional<ZodBoolean>; mode: ZodOptional<ZodEnum<{ guest: "guest"; hosted: "hosted"; instrumented: "instrumented"; }>>; model: ZodOptional<ZodString>; }, $strict>


const ApiWarningSchema: ZodObject<{ bag: ZodOptional<ZodString>; hint: ZodOptional<ZodString>; kind: ZodString; message: ZodString; }, $strict>

A non-fatal condition reported alongside a successful mutation — e.g. a bag whose host binary is missing, or one declaring launchd services the API deliberately does not register itself.


const BagInfoSchema: ZodObject<{ description: ZodNullable<ZodString>; name: ZodString; type: ZodEnum<{ local: "local"; remote: "remote"; }>; }, $strict>


Barry: BarryControls

Barry: the SDK every caller uses. See api.ts for what it answers and subjects.ts for what bags provide.


const DevicePrincipalSchema: ZodReadonly<ZodObject<{ actorId: ZodNumber; credentialId: ZodString; identityIds: ZodReadonly<ZodArray<ZodNumber>>; kind: ZodLiteral<"device">; scopes: ZodReadonly<ZodArray<ZodEnum<{ actions:dispatch: "actions:dispatch"; actions:read: "actions:read"; artifacts:read: "artifacts:read"; artifacts:share: "artifacts:share"; artifacts:write: "artifacts:write"; events:read: "events:read"; events:subscribe: "events:subscribe"; events:write: "events:write"; identities:read: "identities:read"; sessions:approve: "sessions:approve"; sessions:read: "sessions:read"; sessions:turn: "sessions:turn"; sessions:write: "sessions:write"; tools:invoke: "tools:invoke"; }>>>; }, $strict>>


const IdentitySchema: ZodObject<{ adapters: ZodRecord<ZodString, ZodObject<{ default: ZodOptional<ZodBoolean>; mode: ZodOptional<ZodEnum<{ guest: "guest"; hosted: "hosted"; instrumented: "instrumented"; }>>; model: ZodOptional<ZodString>; }, $strict>>; bags: ZodArray<ZodString>; bound: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>; bounds: ZodArray<ZodString>; createdAt: ZodNullable<ZodISODateTime>; directory: ZodOptional<ZodNullable<ZodString>>; displayName: ZodNullable<ZodString>; envKeys: ZodArray<ZodString>; envSources: ZodOptional<ZodRecord<ZodString, ZodString>>; githubInstallationId: ZodOptional<ZodNullable<ZodInt>>; id: ZodInt; isDefault: ZodBoolean; lastUsedAt: ZodNullable<ZodISODateTime>; name: ZodString; source: ZodOptional<ZodEnum<{ db: "db"; file: "file"; }>>; statusNotify: ZodOptional<ZodNullable<ZodObject<{ target: ZodOptional<ZodString>; tool: ZodString; }, $strip>>>; token: ZodString; traits: ZodArray<ZodString>; vaultEmail: ZodNullable<ZodString>; }, $strict>


const JobRunSchema: ZodObject<{ attempts: ZodInt; callerSessionId: ZodNullable<ZodString>; createdAt: ZodISODateTime; id: ZodString; job: ZodString; key: ZodNullable<ZodString>; output: ZodNullable<ZodString>; outputType: ZodNullable<ZodEnum<{ json: "json"; text: "text"; }>>; reason: ZodNullable<ZodString>; runId: ZodNullable<ZodString>; status: ZodEnum<{ cancelled: "cancelled"; failed: "failed"; pending: "pending"; running: "running"; succeeded: "succeeded"; uncertain: "uncertain"; }>; updatedAt: ZodISODateTime; }, $strict>


const MessageSchema: ZodObject<{ clientMessageId: ZodOptional<ZodNullable<ZodString>>; content: ZodOptional<ZodNullable<ZodString>>; createdAt: ZodISODateTime; deliveryError: ZodOptional<ZodNullable<ZodString>>; deliveryState: ZodOptional<ZodEnum<{ accepted: "accepted"; failed: "failed"; queued: "queued"; uncertain: "uncertain"; }>>; error: ZodOptional<ZodNullable<ZodString>>; hasDetail: ZodOptional<ZodBoolean>; input: ZodOptional<ZodNullable<ZodUnknown>>; name: ZodOptional<ZodNullable<ZodString>>; parentToolUseId: ZodOptional<ZodNullable<ZodString>>; result: ZodOptional<ZodNullable<ZodUnknown>>; role: ZodOptional<ZodNullable<ZodEnum<{ assistant: "assistant"; system: "system"; user: "user"; }>>>; sequence: ZodInt; sessionId: ZodString; status: ZodOptional<ZodNullable<ZodString>>; taskStatus: ZodOptional<ZodNullable<ZodString>>; toolUseId: ZodOptional<ZodNullable<ZodString>>; type: ZodEnum<{ error: "error"; init: "init"; result: "result"; summary: "summary"; text: "text"; tool_start: "tool_start"; }>; }, $strict>


const OneOffSchema: ZodObject<{ action: ZodNullable<ZodString>; attempts: ZodOptional<ZodArray<ZodObject<{ exitCode: ZodNullable<ZodInt>; finishedAt: ZodNullable<ZodISODateTime>; id: ZodString; number: ZodInt; outcome: ZodEnum<{ abandoned: "abandoned"; failed: "failed"; running: "running"; succeeded: "succeeded"; timed_out: "timed_out"; }>; runId: ZodNullable<ZodString>; startedAt: ZodISODateTime; }, $strict>>>; bag: ZodString; createdAt: ZodISODateTime; dueAt: ZodISODateTime; failures: ZodInt; id: ZodString; idempotencyKey: ZodNullable<ZodString>; inputs: ZodRecord<ZodString, ZodUnknown>; job: ZodOptional<ZodNullable<ZodString>>; permissions: ZodOptional<ZodObject<{ bounds: ZodOptional<ZodArray<ZodString>>; identity: ZodOptional<ZodString>; traits: ZodOptional<ZodArray<ZodString>>; }, $strip>>; reason: ZodNullable<ZodString>; recoveries: ZodInt; retryAttempts: ZodInt; status: ZodEnum<{ cancelled: "cancelled"; failed: "failed"; pending: "pending"; running: "running"; succeeded: "succeeded"; uncertain: "uncertain"; }>; timeoutS: ZodInt; updatedAt: ZodISODateTime; }, $strict>


const SessionSchema: ZodObject<{ baseRepoPath: ZodNullable<ZodString>; bound: ZodNullable<ZodRecord<ZodString, ZodUnknown>>; bounds: ZodOptional<ZodArray<ZodString>>; branch: ZodOptional<ZodNullable<ZodString>>; createdAt: ZodISODateTime; endedAt: ZodOptional<ZodNullable<ZodISODateTime>>; harness: ZodOptional<ZodNullable<ZodString>>; hostname: ZodOptional<ZodNullable<ZodString>>; id: ZodString; identityId: ZodNullable<ZodInt>; identitySource: ZodNullable<ZodEnum<{ default: "default"; explicit: "explicit"; file: "file"; repo: "repo"; }>>; lastMessageAt: ZodOptional<ZodNullable<ZodISODateTime>>; messageCount: ZodOptional<ZodInt>; model: ZodNullable<ZodString>; modelRef: ZodOptional<ZodNullable<ZodString>>; name: ZodString; pid: ZodOptional<ZodNullable<ZodInt>>; pidStartedAt: ZodOptional<ZodNullable<ZodInt>>; pinned: ZodBoolean; provider: ZodNullable<ZodString>; repoPath: ZodNullable<ZodString>; source: ZodNullable<ZodString>; startedAt: ZodNullable<ZodISODateTime>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; pending: "pending"; planning: "planning"; running: "running"; }>; statusUpdate: ZodOptional<ZodNullable<ZodObject<{ phase: ZodNullable<ZodString>; summary: ZodNullable<ZodString>; updatedAt: ZodNullable<ZodISODateTime>; }, $strip>>>; summary: ZodNullable<ZodString>; systemPrompt: ZodNullable<ZodString>; traits: ZodArray<ZodString>; transcriptPath: ZodOptional<ZodNullable<ZodString>>; useWorktree: ZodBoolean; worktreePath: ZodNullable<ZodString>; worktreeStatus: ZodNullable<ZodString>; }, $strict>


const TraitSchema: ZodObject<{ access: ZodEnum<{ read: "read"; readwrite: "readwrite"; }>; bag: ZodOptional<ZodNullable<ZodString>>; bound: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; boundNames: ZodOptional<ZodArray<ZodString>>; description: ZodNullable<ZodString>; harnessTraits: ZodOptional<ZodRecord<ZodString, ZodString>>; includes: ZodOptional<ZodArray<ZodString>>; instructions: ZodOptional<ZodArray<ZodString>>; name: ZodString; namespaces: ZodArray<ZodString>; nativeTools: ZodOptional<ZodRecord<ZodString, ZodArray<ZodString>>>; optional: ZodOptional<ZodBoolean>; skills: ZodOptional<ZodArray<ZodString>>; tools: ZodOptional<ZodArray<ZodString>>; }, $strict>

isBarryError(error): error is BarryError

Parameter Type
error unknown

error is BarryError


requestCaller(principal): Caller

The caller a verified request carries: its device, or the owner (no principal means the instance secret).

Parameter Type
principal Readonly<{ actorId: number; credentialId: string; identityIds: readonly number[]; kind: "device"; scopes: readonly ("sessions:read" | "sessions:write" | "sessions:turn" | "sessions:approve" | "events:read" | "events:write" | "events:subscribe" | "actions:read" | "actions:dispatch" | "tools:invoke" | "identities:read" | "artifacts:read" | "artifacts:write" | "artifacts:share")[]; }> | Readonly<{ actorId: number; credentialId: "installation"; kind: "installation"; }> | undefined

Caller

Re-exports AnyToolDefinition


Re-exports BarryEvent


Re-exports ToolContext


Re-exports ToolDefinition


Re-exports ToolShape