@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:
Tooldefines a tool.useinstalls subjects or test doubles in this process, andresetforgets them.connectpoints every later call at one Barry over HTTP, andatreturns a separateBarryfor another installation.asreturns aBarrythat acts for a named caller, such as a session.- The question methods, such as
identity,identities,bags,actions,events,recordEvent,schedules,scheduleOnce, andservices, 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";Classes
Section titled “Classes”BarryError
Section titled “BarryError”Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BarryError(
reason,message,hint?):BarryError
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
reason |
BarryErrorReason |
message |
string |
hint? |
string |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
hint |
readonly |
string | undefined |
reason |
readonly |
BarryErrorReason |
Accessors
Section titled “Accessors”status
Section titled “status”Get Signature
Section titled “Get Signature”get status():
400|403|404|409|503
The HTTP status a route answers with.
Returns
Section titled “Returns”400 | 403 | 404 | 409 | 503
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON():
object
The body a route answers with: the problem, and its hint when there is one.
Returns
Section titled “Returns”object
| Name | Type |
|---|---|
error |
string |
hint? |
string |
reason |
BarryErrorReason |
Interfaces
Section titled “Interfaces”Action
Section titled “Action”An action a session or a caller can run.
Properties
Section titled “Properties”ActionHandle
Section titled “ActionHandle”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
name |
readonly |
string |
Methods
Section titled “Methods”run(
inputs?,options?):Promise<ActionRun>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
inputs? |
Record<string, unknown> |
options? |
{ identity?: IdentityReference; } |
options.identity? |
IdentityReference |
Returns
Section titled “Returns”Promise<ActionRun>
runs()
Section titled “runs()”runs():
Promise<ActionRun[]>
Returns
Section titled “Returns”Promise<ActionRun[]>
ActionRun
Section titled “ActionRun”One run of an action.
Properties
Section titled “Properties”ActionRunQuery
Section titled “ActionRunQuery”Properties
Section titled “Properties”| Property | Type |
|---|---|
action? |
string |
limit? |
number |
schedule? |
string |
Actions
Section titled “Actions”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
name |
readonly |
"actions" |
Methods
Section titled “Methods”forSession()
Section titled “forSession()”forSession(
identity,sessionId,caller):Promise<Action[]>
The actions a session can run.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
sessionId |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<Action[]>
list()
Section titled “list()”list(
caller):Promise<Action[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
caller |
Caller |
Returns
Section titled “Returns”Promise<Action[]>
run(
name,inputs,options,caller):Promise<ActionRun>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
inputs |
Record<string, unknown> |
options |
{ identity?: IdentityReference; } |
options.identity? |
IdentityReference |
caller |
Caller |
Returns
Section titled “Returns”Promise<ActionRun>
runs()
Section titled “runs()”runs(
query,caller):Promise<ActionRun[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
query |
ActionRunQuery |
caller |
Caller |
Returns
Section titled “Returns”Promise<ActionRun[]>
BagHandle
Section titled “BagHandle”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
name |
readonly |
string |
Methods
Section titled “Methods”extensions()
Section titled “extensions()”extensions():
Promise<string[]>
Returns
Section titled “Returns”Promise<string[]>
job(
name):JobHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
Returns
Section titled “Returns”store()
Section titled “store()”store(
name?):StoreBinding
This bag’s store, from code running inside Barry (a tool, a job, a script).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name? |
string |
Returns
Section titled “Returns”tools()
Section titled “tools()”tools():
Promise<Tool[]>
Returns
Section titled “Returns”Promise<Tool[]>
Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
name |
readonly |
"bags" |
Methods
Section titled “Methods”extensions()
Section titled “extensions()”extensions(
bag,caller):Promise<string[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
bag |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<string[]>
list()
Section titled “list()”list(
caller):Promise<object[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
caller |
Caller |
Returns
Section titled “Returns”Promise<object[]>
runJob()
Section titled “runJob()”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; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
bag |
string |
job |
string |
inputs |
Record<string, unknown> |
options |
{ identity?: IdentityReference; key?: string; } |
options.identity? |
IdentityReference |
options.key? |
string |
caller |
Caller |
Returns
Section titled “Returns”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()
Section titled “tools()”tools(
bag,caller):Promise<Tool[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
bag |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<Tool[]>
What you can ask Barry: one Barry, as one caller.
Extended by
Section titled “Extended by”Methods
Section titled “Methods”action()
Section titled “action()”action(
name):ActionHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
Returns
Section titled “Returns”actions()
Section titled “actions()”actions():
Promise<Action[]>
Returns
Section titled “Returns”Promise<Action[]>
bag(
name):BagHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
Returns
Section titled “Returns”bags()
Section titled “bags()”bags():
Promise<object[]>
Returns
Section titled “Returns”Promise<object[]>
bounds()
Section titled “bounds()”bounds():
Promise<Bound[]>
Returns
Section titled “Returns”Promise<Bound[]>
createIdentity()
Section titled “createIdentity()”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; }>>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
IdentityCreate |
Returns
Section titled “Returns”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()
Section titled “device()”device(
id):DeviceHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”devices()
Section titled “devices()”devices():
Promise<Device[]>
Returns
Section titled “Returns”Promise<Device[]>
events()
Section titled “events()”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"; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
query? |
EventQuery |
Returns
Section titled “Returns”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()
Section titled “grants()”grants(
selection?):Promise<Grants>
What a session of no identity is granted, given what it selects (a schedule that names only traits).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
selection? |
GrantSelection |
Returns
Section titled “Returns”Promise<Grants>
identities()
Section titled “identities()”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; }>
Returns
Section titled “Returns”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()
Section titled “identity()”identity(
ref):IdentityHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ref |
IdentityReference |
Returns
Section titled “Returns”lastChanges()
Section titled “lastChanges()”lastChanges(
paths):Promise<Change[]>
The latest recorded change to each file, naming the session that made it when the caller may see that session.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
paths |
readonly string[] |
Returns
Section titled “Returns”Promise<Change[]>
oneOff()
Section titled “oneOff()”oneOff(
id):OneOffHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”oneOffs()
Section titled “oneOffs()”oneOffs(
query?):Promise<object[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
query? |
OneOffQuery |
Returns
Section titled “Returns”Promise<object[]>
owner()
Section titled “owner()”owner():
Promise<Owner>
Returns
Section titled “Returns”Promise<Owner>
recordEvent()
Section titled “recordEvent()”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"; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
EventInput |
Returns
Section titled “Returns”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()
Section titled “schedule()”schedule(
id):ScheduleHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”scheduleOnce()
Section titled “scheduleOnce()”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; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
OneOffInput |
Returns
Section titled “Returns”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()
Section titled “scheduler()”scheduler():
Promise<Scheduler>
Returns
Section titled “Returns”Promise<Scheduler>
schedules()
Section titled “schedules()”schedules():
Promise<Schedule[]>
Returns
Section titled “Returns”Promise<Schedule[]>
service()
Section titled “service()”service(
key):ServiceHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
Returns
Section titled “Returns”services()
Section titled “services()”services():
Promise<Service[]>
Returns
Section titled “Returns”Promise<Service[]>
traits()
Section titled “traits()”traits():
Promise<object[]>
Returns
Section titled “Returns”Promise<object[]>
BarryControls
Section titled “BarryControls”Barry itself: what you can ask, and how a process says where the answers come from.
Extends
Section titled “Extends”Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
Tool |
<T, R>(definition) => ToolDefinition<T, R> |
Define an MCP tool in a bag. |
Methods
Section titled “Methods”action()
Section titled “action()”action(
name):ActionHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”actions()
Section titled “actions()”actions():
Promise<Action[]>
Returns
Section titled “Returns”Promise<Action[]>
Inherited from
Section titled “Inherited from”as(
caller):Barry
The same questions, asked as this caller.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
caller |
Caller |
Returns
Section titled “Returns”at(
options):Barry
A second Barry in the same program, over HTTP.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
ConnectOptions |
Returns
Section titled “Returns”bag(
name):BagHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”bags()
Section titled “bags()”bags():
Promise<object[]>
Returns
Section titled “Returns”Promise<object[]>
Inherited from
Section titled “Inherited from”bounds()
Section titled “bounds()”bounds():
Promise<Bound[]>
Returns
Section titled “Returns”Promise<Bound[]>
Inherited from
Section titled “Inherited from”connect()
Section titled “connect()”connect(
options):void
Reach another Barry over HTTP; only needed where its bags are not installed.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
ConnectOptions |
Returns
Section titled “Returns”void
createIdentity()
Section titled “createIdentity()”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; }>>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
IdentityCreate |
Returns
Section titled “Returns”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; }>>
Inherited from
Section titled “Inherited from”device()
Section titled “device()”device(
id):DeviceHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”devices()
Section titled “devices()”devices():
Promise<Device[]>
Returns
Section titled “Returns”Promise<Device[]>
Inherited from
Section titled “Inherited from”events()
Section titled “events()”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"; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
query? |
EventQuery |
Returns
Section titled “Returns”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"; }>
Inherited from
Section titled “Inherited from”grants()
Section titled “grants()”grants(
selection?):Promise<Grants>
What a session of no identity is granted, given what it selects (a schedule that names only traits).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
selection? |
GrantSelection |
Returns
Section titled “Returns”Promise<Grants>
Inherited from
Section titled “Inherited from”identities()
Section titled “identities()”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; }>
Returns
Section titled “Returns”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; }>
Inherited from
Section titled “Inherited from”identity()
Section titled “identity()”identity(
ref):IdentityHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ref |
IdentityReference |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”lastChanges()
Section titled “lastChanges()”lastChanges(
paths):Promise<Change[]>
The latest recorded change to each file, naming the session that made it when the caller may see that session.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
paths |
readonly string[] |
Returns
Section titled “Returns”Promise<Change[]>
Inherited from
Section titled “Inherited from”oneOff()
Section titled “oneOff()”oneOff(
id):OneOffHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”oneOffs()
Section titled “oneOffs()”oneOffs(
query?):Promise<object[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
query? |
OneOffQuery |
Returns
Section titled “Returns”Promise<object[]>
Inherited from
Section titled “Inherited from”owner()
Section titled “owner()”owner():
Promise<Owner>
Returns
Section titled “Returns”Promise<Owner>
Inherited from
Section titled “Inherited from”recordEvent()
Section titled “recordEvent()”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"; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
EventInput |
Returns
Section titled “Returns”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"; }>
Inherited from
Section titled “Inherited from”reset()
Section titled “reset()”reset():
void
Forget every installed subject, the connection and the caller resolver (tests).
Returns
Section titled “Returns”void
schedule()
Section titled “schedule()”schedule(
id):ScheduleHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”scheduleOnce()
Section titled “scheduleOnce()”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; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
OneOffInput |
Returns
Section titled “Returns”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; }>
Inherited from
Section titled “Inherited from”scheduler()
Section titled “scheduler()”scheduler():
Promise<Scheduler>
Returns
Section titled “Returns”Promise<Scheduler>
Inherited from
Section titled “Inherited from”schedules()
Section titled “schedules()”schedules():
Promise<Schedule[]>
Returns
Section titled “Returns”Promise<Schedule[]>
Inherited from
Section titled “Inherited from”service()
Section titled “service()”service(
key):ServiceHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”services()
Section titled “services()”services():
Promise<Service[]>
Returns
Section titled “Returns”Promise<Service[]>
Inherited from
Section titled “Inherited from”traits()
Section titled “traits()”traits():
Promise<object[]>
Returns
Section titled “Returns”Promise<object[]>
Inherited from
Section titled “Inherited from”use(…
subjects):void
Install the subjects this process hosts; their calls then run in-process.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…subjects |
Subject[] |
Returns
Section titled “Returns”void
useCaller()
Section titled “useCaller()”useCaller(
resolver):void
How a hosting process tells Barry who the current call is for.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
resolver |
(() => Caller | undefined) | null |
Returns
Section titled “Returns”void
Agent Bound — restrictions on a task’s capabilities. Bounds limit: they can only take away what traits have granted.
Properties
Section titled “Properties”Change
Section titled “Change”One file change a session made, as the tracker recorded it.
Properties
Section titled “Properties”| 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 |
- |
Collection
Section titled “Collection”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()).
Extends
Section titled “Extends”AsyncIterable<T>.PromiseLike<T[]>
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
ConnectOptions
Section titled “ConnectOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”| 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. | - |
Delivery
Section titled “Delivery”What session.send reports about a message.
Properties
Section titled “Properties”| Property | Type |
|---|---|
clientMessageId? |
string | null |
messageId? |
string |
state |
"queued" | "failed" | "uncertain" | "accepted" |
Device
Section titled “Device”A device paired with this Barry.
Properties
Section titled “Properties”| Property | Type |
|---|---|
id |
string |
identityIds |
number[] |
lastSeenAt |
string | null |
name |
string |
pairedAt |
string |
scopes |
string[] |
DeviceHandle
Section titled “DeviceHandle”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
id |
readonly |
string |
Methods
Section titled “Methods”revoke()
Section titled “revoke()”revoke():
Promise<void>
Returns
Section titled “Returns”Promise<void>
EventInput
Section titled “EventInput”An event to record.
Properties
Section titled “Properties”EventQuery
Section titled “EventQuery”A query over events.
Properties
Section titled “Properties”| Property | Type |
|---|---|
session? |
string |
since? |
string |
type? |
"progress" | "notification" | "task_finished" | "system_alert" |
unread? |
boolean |
Events
Section titled “Events”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
name |
readonly |
"events" |
Methods
Section titled “Methods”list()
Section titled “list()”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"; }>>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
query |
EventQuery |
cursor |
string | null |
caller |
Caller |
Returns
Section titled “Returns”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()
Section titled “record()”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"; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
EventInput |
caller |
Caller |
Returns
Section titled “Returns”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"; }>
Grants
Section titled “Grants”Everything a session of an identity gets: one answer for every launch path.
Properties
Section titled “Properties”| 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. |
GrantSelection
Section titled “GrantSelection”What a session or a caller selects on top of an identity.
Properties
Section titled “Properties”| 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[] |
- |
Identities
Section titled “Identities”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
name |
readonly |
"identities" |
Methods
Section titled “Methods”allTraits()
Section titled “allTraits()”allTraits(
caller):Promise<object[]>
Every trait and named bound this installation has.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
caller |
Caller |
Returns
Section titled “Returns”Promise<object[]>
bounds()
Section titled “bounds()”bounds(
caller):Promise<Bound[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
caller |
Caller |
Returns
Section titled “Returns”Promise<Bound[]>
create()
Section titled “create()”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; }>>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
IdentityCreate |
caller |
Caller |
Returns
Section titled “Returns”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()
Section titled “devices()”devices(
caller):Promise<Device[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
caller |
Caller |
Returns
Section titled “Returns”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; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ref |
IdentityReference |
caller |
Caller |
Returns
Section titled “Returns”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()
Section titled “grants()”grants(
ref,selection,caller):Promise<Grants>
What a session of the identity (or of none, for null) is granted.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ref |
IdentityReference | null |
selection |
GrantSelection |
caller |
Caller |
Returns
Section titled “Returns”Promise<Grants>
list()
Section titled “list()”list(
caller):Promise<object[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
caller |
Caller |
Returns
Section titled “Returns”Promise<object[]>
makeDefault()
Section titled “makeDefault()”makeDefault(
ref,caller):Promise<void>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ref |
IdentityReference |
caller |
Caller |
Returns
Section titled “Returns”Promise<void>
owner()
Section titled “owner()”owner(
caller):Promise<Owner>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
caller |
Caller |
Returns
Section titled “Returns”Promise<Owner>
remove()
Section titled “remove()”remove(
ref,caller):Promise<IdentityRemoval>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ref |
IdentityReference |
caller |
Caller |
Returns
Section titled “Returns”Promise<IdentityRemoval>
revokeDevice()
Section titled “revokeDevice()”revokeDevice(
id,caller):Promise<void>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<void>
traits()
Section titled “traits()”traits(
ref,caller):Promise<object[]>
The traits the identity carries, inherited ones included.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ref |
IdentityReference |
caller |
Caller |
Returns
Section titled “Returns”Promise<object[]>
update()
Section titled “update()”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; }>>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ref |
IdentityReference |
changes |
IdentityUpdate |
caller |
Caller |
Returns
Section titled “Returns”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; }>>
IdentityBagConfiguration
Section titled “IdentityBagConfiguration”Properties
Section titled “Properties”| Property | Type |
|---|---|
stores? |
Record<string, { app_url?: string; engine?: "sqlite"; filepath?: string; url?: string; }> |
tools? |
Record<string, ToolVisibility> |
IdentityCreate
Section titled “IdentityCreate”What creating an identity takes.
Extends
Section titled “Extends”Properties
Section titled “Properties”| 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 |
IdentityHandle
Section titled “IdentityHandle”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
ref |
readonly |
IdentityReference |
Methods
Section titled “Methods”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; }>
Returns
Section titled “Returns”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()
Section titled “grants()”grants(
selection?):Promise<Grants>
What a session of it would be granted, given what the session selects on top.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
selection? |
GrantSelection |
Returns
Section titled “Returns”Promise<Grants>
makeDefault()
Section titled “makeDefault()”makeDefault():
Promise<void>
Make it the one unqualified commands act as.
Returns
Section titled “Returns”Promise<void>
remove()
Section titled “remove()”remove():
Promise<IdentityRemoval>
Remove it: its sessions, its row, and its directory’s place in Barry.
Returns
Section titled “Returns”Promise<IdentityRemoval>
session()
Section titled “session()”session(
id):SessionHandle
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”sessions()
Section titled “sessions()”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; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
query? |
SessionQuery |
Returns
Section titled “Returns”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()
Section titled “start()”start(
input?):Promise<SessionHandle>
Start a session as this identity.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input? |
SessionStart |
Returns
Section titled “Returns”Promise<SessionHandle>
tools()
Section titled “tools()”tools(
selection?):Promise<Tool[]>
The tools a session of it would start with.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
selection? |
GrantSelection |
Returns
Section titled “Returns”Promise<Tool[]>
traits()
Section titled “traits()”traits():
Promise<object[]>
The traits it carries, inherited ones included.
Returns
Section titled “Returns”Promise<object[]>
update()
Section titled “update()”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; }>>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
changes |
IdentityUpdate |
Returns
Section titled “Returns”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; }>>
IdentityRemoval
Section titled “IdentityRemoval”What removing an identity did.
Properties
Section titled “Properties”IdentityUpdate
Section titled “IdentityUpdate”A change to an identity. A field that is present is changed; null clears it.
Extended by
Section titled “Extended by”Properties
Section titled “Properties”| 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 |
- |
Instruction
Section titled “Instruction”An instruction document a session is pointed at.
Properties
Section titled “Properties”| Property | Type |
|---|---|
name |
string |
JobHandle
Section titled “JobHandle”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
bag |
readonly |
string |
name |
readonly |
string |
Methods
Section titled “Methods”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; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
inputs? |
Record<string, unknown> |
options? |
{ identity?: IdentityReference; key?: string; } |
options.identity? |
IdentityReference |
options.key? |
string |
Returns
Section titled “Returns”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; }>
MessageQuery
Section titled “MessageQuery”Which messages to read, and how much detail to carry.
Properties
Section titled “Properties”OneOffHandle
Section titled “OneOffHandle”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
id |
readonly |
string |
Methods
Section titled “Methods”cancel()
Section titled “cancel()”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; }>
Returns
Section titled “Returns”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; }>
OneOffInput
Section titled “OneOffInput”An action to run once, later.
Properties
Section titled “Properties”| 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[] |
- |
OneOffQuery
Section titled “OneOffQuery”Properties
Section titled “Properties”| Property | Type |
|---|---|
bag? |
string |
limit? |
number |
status? |
"pending" | "running" | "succeeded" | "failed" | "cancelled" | "uncertain" |
The person this installation belongs to.
Properties
Section titled “Properties”| Property | Type |
|---|---|
defaultIdentity |
string | null |
id |
number |
name |
string |
One page of a collection, and where the next one starts.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Properties
Section titled “Properties”| Property | Type |
|---|---|
items |
T[] |
next |
string | null |
Schedule
Section titled “Schedule”A recurring schedule with its most recent scheduler state.
Properties
Section titled “Properties”ScheduleHandle
Section titled “ScheduleHandle”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
id |
readonly |
string |
Methods
Section titled “Methods”runs()
Section titled “runs()”runs():
Promise<ActionRun[]>
Returns
Section titled “Returns”Promise<ActionRun[]>
Scheduler
Section titled “Scheduler”Properties
Section titled “Properties”| Property | Type |
|---|---|
heartbeatAt |
string | null |
loadErrors |
string[] |
reason |
string | null |
status |
"ok" | "degraded" | "down" |
Schedules
Section titled “Schedules”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
name |
readonly |
"schedules" |
Methods
Section titled “Methods”cancelOneOff()
Section titled “cancelOneOff()”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; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
caller |
Caller |
Returns
Section titled “Returns”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()
Section titled “list()”list(
caller):Promise<Schedule[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
caller |
Caller |
Returns
Section titled “Returns”Promise<Schedule[]>
oneOffs()
Section titled “oneOffs()”oneOffs(
query,caller):Promise<object[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
query |
OneOffQuery |
caller |
Caller |
Returns
Section titled “Returns”Promise<object[]>
scheduleOnce()
Section titled “scheduleOnce()”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; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
OneOffInput |
caller |
Caller |
Returns
Section titled “Returns”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()
Section titled “scheduler()”scheduler(
caller):Promise<Scheduler>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
caller |
Caller |
Returns
Section titled “Returns”Promise<Scheduler>
Service
Section titled “Service”A launchd-managed service of a bag.
Properties
Section titled “Properties”ServiceClientOptions
Section titled “ServiceClientOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”| 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 |
- | - |
ServiceHandle
Section titled “ServiceHandle”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
key |
readonly |
string |
Methods
Section titled “Methods”get():
Promise<Service>
Returns
Section titled “Returns”Promise<Service>
restart()
Section titled “restart()”restart():
Promise<Service>
Returns
Section titled “Returns”Promise<Service>
start()
Section titled “start()”start():
Promise<Service>
Returns
Section titled “Returns”Promise<Service>
stop()
Section titled “stop()”stop():
Promise<Service>
Returns
Section titled “Returns”Promise<Service>
Services
Section titled “Services”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
name |
readonly |
"services" |
Methods
Section titled “Methods”get(
key,caller):Promise<Service>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<Service>
list()
Section titled “list()”list(
caller):Promise<Service[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
caller |
Caller |
Returns
Section titled “Returns”Promise<Service[]>
restart()
Section titled “restart()”restart(
key,caller):Promise<Service>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<Service>
start()
Section titled “start()”start(
key,caller):Promise<Service>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<Service>
stop()
Section titled “stop()”stop(
key,caller):Promise<Service>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<Service>
SessionHandle
Section titled “SessionHandle”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
id |
readonly |
string |
identity |
readonly |
IdentityHandle |
Methods
Section titled “Methods”actions()
Section titled “actions()”actions():
Promise<Action[]>
Returns
Section titled “Returns”Promise<Action[]>
archive()
Section titled “archive()”archive():
Promise<void>
Returns
Section titled “Returns”Promise<void>
bound()
Section titled “bound()”bound():
Promise<Bound|null>
Returns
Section titled “Returns”Promise<Bound | null>
changes()
Section titled “changes()”changes():
Promise<Change[]>
Returns
Section titled “Returns”Promise<Change[]>
end():
Promise<void>
Returns
Section titled “Returns”Promise<void>
events()
Section titled “events()”events():
AsyncIterable<SessionEvent>
The session’s live events, as they happen.
Returns
Section titled “Returns”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; }>
Returns
Section titled “Returns”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()
Section titled “grants()”grants():
Promise<Grants>
Everything the session is granted, in one call.
Returns
Section titled “Returns”Promise<Grants>
instructions()
Section titled “instructions()”instructions():
Promise<Instruction[]>
Returns
Section titled “Returns”Promise<Instruction[]>
listening()
Section titled “listening()”listening():
Promise<boolean>
Whether a live surface listens or promises delivery.
Returns
Section titled “Returns”Promise<boolean>
message()
Section titled “message()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sequence |
number |
Returns
Section titled “Returns”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()
Section titled “messages()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
query? |
MessageQuery |
Returns
Section titled “Returns”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()
Section titled “send()”send(
text,options?):Promise<Delivery>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |
options? |
{ clientMessageId?: string; } |
options.clientMessageId? |
string |
Returns
Section titled “Returns”Promise<Delivery>
skills()
Section titled “skills()”skills():
Promise<Skill[]>
Returns
Section titled “Returns”Promise<Skill[]>
tools()
Section titled “tools()”tools():
Promise<Tool[]>
Returns
Section titled “Returns”Promise<Tool[]>
update()
Section titled “update()”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; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
changes |
SessionUpdate |
Returns
Section titled “Returns”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; }>
SessionQuery
Section titled “SessionQuery”A query over sessions.
Properties
Section titled “Properties”Sessions
Section titled “Sessions”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
name |
readonly |
"sessions" |
Methods
Section titled “Methods”archive()
Section titled “archive()”archive(
identity,id,caller):Promise<void>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
id |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<void>
end(
identity,id,caller):Promise<void>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
id |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<void>
events()
Section titled “events()”events(
identity,id,caller):AsyncIterable<SessionEvent>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
id |
string |
caller |
Caller |
Returns
Section titled “Returns”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; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
id |
string |
caller |
Caller |
Returns
Section titled “Returns”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()
Section titled “grants()”grants(
identity,id,caller):Promise<Grants>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
id |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<Grants>
list()
Section titled “list()”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; }>>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
query |
SessionQuery |
cursor |
string | null |
caller |
Caller |
Returns
Section titled “Returns”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()
Section titled “listening()”listening(
identity,id,caller):Promise<boolean>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
id |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<boolean>
message()
Section titled “message()”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"; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
id |
string |
sequence |
number |
caller |
Caller |
Returns
Section titled “Returns”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()
Section titled “messages()”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"; }>>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
id |
string |
query |
MessageQuery |
cursor |
string | null |
caller |
Caller |
Returns
Section titled “Returns”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()
Section titled “removeAll()”removeAll(
identity,caller):Promise<number>
Delete every session of an identity, as removing the identity does; how many there were.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
caller |
Caller |
Returns
Section titled “Returns”Promise<number>
send()
Section titled “send()”send(
identity,id,text,options,caller):Promise<Delivery>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
id |
string |
text |
string |
options |
{ clientMessageId?: string; } |
options.clientMessageId? |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<Delivery>
start()
Section titled “start()”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; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
input |
SessionStart |
caller |
Caller |
Returns
Section titled “Returns”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()
Section titled “update()”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; }>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
id |
string |
changes |
SessionUpdate |
caller |
Caller |
Returns
Section titled “Returns”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; }>
SessionStart
Section titled “SessionStart”What starting a session takes.
Properties
Section titled “Properties”| 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 |
SessionUpdate
Section titled “SessionUpdate”A change to a session’s own settings.
Properties
Section titled “Properties”| 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.
Properties
Section titled “Properties”| Property | Type |
|---|---|
name |
string |
A tool a session can call.
Properties
Section titled “Properties”Tracker
Section titled “Tracker”Properties
Section titled “Properties”| Property | Modifier | Type |
|---|---|---|
name |
readonly |
"tracker" |
Methods
Section titled “Methods”changes()
Section titled “changes()”changes(
identity,sessionId,caller):Promise<Change[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
identity |
IdentityReference |
sessionId |
string |
caller |
Caller |
Returns
Section titled “Returns”Promise<Change[]>
lastChanges()
Section titled “lastChanges()”lastChanges(
paths,caller):Promise<Change[]>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
paths |
readonly string[] |
caller |
Caller |
Returns
Section titled “Returns”Promise<Change[]>
Type Aliases
Section titled “Type Aliases”AdapterSettings
Section titled “AdapterSettings”AdapterSettings =
z.infer<typeofAdapterSettingsSchema>
ApiWarning
Section titled “ApiWarning”ApiWarning =
z.infer<typeofApiWarningSchema>
Bag =
z.infer<typeofBagInfoSchema>
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
Section titled “BarryErrorReason”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
Section titled “Caller”Caller = {
actorId?:number;kind:"owner"; } | {kind:"device";principal:DevicePrincipal; } | {bag?:string;identity:IdentityReference;kind:"session";sessionId:string; }
Who is asking.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ actorId?: number; kind: "owner"; }
The installation’s owner: the terminal, or a service holding the instance secret.
Type Literal
Section titled “Type Literal”{ kind: "device"; principal: DevicePrincipal; }
A paired device: its scopes and the identities it was granted, nothing else.
Type Literal
Section titled “Type Literal”{ 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
Section titled “CredentialResolver”CredentialResolver = (
options) =>string|Promise<string>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
{ signal: AbortSignal; } |
options.signal |
AbortSignal |
Returns
Section titled “Returns”string | Promise<string>
DevicePrincipal
Section titled “DevicePrincipal”DevicePrincipal =
z.infer<typeofDevicePrincipalSchema>
Identity
Section titled “Identity”Identity =
z.infer<typeofIdentitySchema>
An identity: reusable configuration a session runs as.
IdentityAdapters
Section titled “IdentityAdapters”IdentityAdapters =
Record<string,AdapterSettings>
IdentityReference
Section titled “IdentityReference”IdentityReference =
string|number
How an identity is named in a call: its name, or its row id.
JobRun
Section titled “JobRun”JobRun =
JobRunRecord
One run of a bag’s job.
JobRunRecord
Section titled “JobRunRecord”JobRunRecord =
z.infer<typeofJobRunSchema>
Message
Section titled “Message”Message =
z.infer<typeofMessageSchema>
One message in a session’s transcript.
OneOff
Section titled “OneOff”OneOff =
OneOffRecord
An action scheduled to run once, later.
OneOffRecord
Section titled “OneOffRecord”OneOffRecord =
z.infer<typeofOneOffSchema>
Session
Section titled “Session”Session =
z.infer<typeofSessionSchema>
SessionEvent
Section titled “SessionEvent”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
Section titled “StoreBinding”StoreBinding =
Readonly<object& {filepath:string;url?:never; } | {filepath?:never;url:string; }>
Subject
Section titled “Subject”Subject =
Identities|Sessions|Actions|Events|Schedules|Bags|Tracker|Services
A subject Barry answers for, as a bag provides it: what Barry.use installs.
SubjectName
Section titled “SubjectName”SubjectName =
Subject["name"]
SubjectNamed
Section titled “SubjectNamed”SubjectNamed<
N> =Extract<Subject, {name:N; }>
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
N extends SubjectName |
ToolVisibility
Section titled “ToolVisibility”ToolVisibility =
"enabled"|"deferred"|"disabled"
Trait =
z.infer<typeofTraitSchema>
A trait: the grants an identity or a session can select.
Updated
Section titled “Updated”Updated<
T> =T&object
A value a change produced, with the warnings it raised.
Type Declaration
Section titled “Type Declaration”| Name | Type |
|---|---|
warnings |
readonly Warning[] |
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Warning
Section titled “Warning”Warning =
ApiWarning
A non-fatal condition reported beside a successful change.
Variables
Section titled “Variables”AdapterSettingsSchema
Section titled “AdapterSettingsSchema”
constAdapterSettingsSchema:ZodObject<{default:ZodOptional<ZodBoolean>;mode:ZodOptional<ZodEnum<{guest:"guest";hosted:"hosted";instrumented:"instrumented"; }>>;model:ZodOptional<ZodString>; },$strict>
ApiWarningSchema
Section titled “ApiWarningSchema”
constApiWarningSchema: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.
BagInfoSchema
Section titled “BagInfoSchema”
constBagInfoSchema: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.
DevicePrincipalSchema
Section titled “DevicePrincipalSchema”
constDevicePrincipalSchema: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>>
IdentitySchema
Section titled “IdentitySchema”
constIdentitySchema: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>
JobRunSchema
Section titled “JobRunSchema”
constJobRunSchema: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>
MessageSchema
Section titled “MessageSchema”
constMessageSchema: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>
OneOffSchema
Section titled “OneOffSchema”
constOneOffSchema: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>
SessionSchema
Section titled “SessionSchema”
constSessionSchema: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>
TraitSchema
Section titled “TraitSchema”
constTraitSchema: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>
Functions
Section titled “Functions”isBarryError()
Section titled “isBarryError()”isBarryError(
error):error is BarryError
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
error |
unknown |
Returns
Section titled “Returns”error is BarryError
requestCaller()
Section titled “requestCaller()”requestCaller(
principal):Caller
The caller a verified request carries: its device, or the owner (no principal means the instance secret).
Parameters
Section titled “Parameters”| 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 |
Returns
Section titled “Returns”References
Section titled “References”AnyToolDefinition
Section titled “AnyToolDefinition”Re-exports AnyToolDefinition
BarryEvent
Section titled “BarryEvent”Re-exports BarryEvent
ToolContext
Section titled “ToolContext”Re-exports ToolContext
ToolDefinition
Section titled “ToolDefinition”Re-exports ToolDefinition
ToolShape
Section titled “ToolShape”Re-exports ToolShape