Docs menu

Test API

Client and sessions

The client you connect with, and the session each test runs in. Every handle on the platform pages is reached from here.

Each call is shown in every SDK's language, with its required options (the table under it lists them all). Arguments go first; options are TypeScript's trailing object, Python's keyword arguments and Rust's builder setters. The variable names are the ones the calls return elsewhere on these pages, so user is a user handle.

Besides the errors listed with each method, most methods can fail with action_requires, cross_workspace_credential, fake_actor_in_live_world, internal, invalid_argument, live_misconfigured, live_not_allowlisted, not_found, session_not_found, unauthorized, unsupported_in_live: a bad request, a closed session, or live mode refusing or misconfigured.

Channelstack#

status()#

Server health, version and loaded drivers.

const status = await channelstack.status();

Returns Status.

openSession()#

Open a session: a scope in the shared world that owns what it creates.

const session = await channelstack.openSession({ name: "…" });
ParameterTypeRequired
namestringnooption

Returns Session.

reset()#

Drop the whole world. Avoid in parallel suites.

await channelstack.reset();

Returns nothing.

env()#

Env vars for the agent: fake tokens, signing secrets and API URLs (what channelstack env prints). With proxy, the proxy and the CA instead of the API URLs.

const env = await channelstack.env({ proxy });
ParameterTypeRequired
proxybooleannooption
appstringnooption
channelstringnooption

Returns Env.

A new one-time link that opens the UI in a browser (what channelstack ui prints).

const uiLoginLink = await channelstack.uiLoginLink();

Returns UiLoginLink.

Session#

Returned by Channelstack.openSession().

FieldPython / RustType
sessionIdsession_idstring
driversdriversstring[]

close()#

Close a session and remove everything it created.

await session.close();

Returns nothing. Disposing the handle calls it.

events()#

The session's event log: actions, deliveries with every attempt, and the agent's API calls.

const eventPage = await session.events({ since: "…" });
ParameterTypeRequired
sincestringnooption

Returns EventPage.

quiet()#

Is the agent idle in this session, and for how long? Negative and exact-count matchers wait for this.

const quiet = await session.quiet();

Returns Quiet.

echo()#

The echo fixture: the agent's app and where it reaches the fake.

const echoFixture = await session.echo();

Returns EchoFixture.

slack()#

The Slack fixture: the agent's app, the workspace, and where the agent reaches the fake.

const slack = await session.slack();

Returns SlackFixture.

github()#

The GitHub fixture: the agent's App, the org, and where the agent reaches the fake.

const github = await session.github();

Returns GitHubFixture.

linear()#

The Linear fixture: the agent's app, and where the agent reaches the fake.

const linear = await session.linear();

Returns LinearFixture.

notion()#

The Notion fixture: the agent's integration, and where the agent reaches the fake.

const notion = await session.notion();

Returns NotionFixture.

resend()#

The Resend fixture: the agent's team, and where the agent reaches the fake.

const resend = await session.resend();

Returns ResendFixture.

google()#

The Google fixture: the agent's mailbox, and where the agent reaches the fake.

const google = await session.google();

Returns GoogleFixture.

discord()#

The Discord fixture: the agent's app, the guild, and where the agent reaches the fake.

const discord = await session.discord();

Returns DiscordFixture.

openai()#

The OpenAI fixture: where the agent reaches the fake model.

const openai = await session.openai();

Returns OpenAIFixture.

places()#

Every channel's places in the session, as the dev tools name them (a Slack channel, a GitHub issue, a Notion page, an email thread, a Discord channel), the most recently active last.

const places = await session.places();

Returns Places.

Place#

FieldType
channelstring
titlestring
idstring
namestring
activestring | undefined

transcript()#

A place as a person reads it: the transcript its channel's own transcript route has.

const placeTranscript = await place.transcript();

Returns PlaceTranscript.

Types#

Plain values the handles return and take.

Status#

FieldType
readyboolean
versionstring
driversstring[]

EventPage#

FieldType
eventsLogEvent[]
cursorstring

LogEvent#

FieldType
atstring
driverstring
kind"action" | "delivery" | "delivery_attempt" | "api_call" | "bot_loop"
dataRecord<string, unknown>
summary{ text: string; outcome: string; ok: boolean } | undefined

Quiet#

FieldPython / RustType
busybusyboolean
quietForMsquiet_for_msnumber
openopenstring[]
problemsproblemsstring[]
loopsloopsstring[] | undefined

Env#

type Env = Record<string, string>;

Capabilities#

type Capabilities = Record<string, Capability>;

Capability#

FieldPython / RustType
fakefakeboolean
liveliveboolean
liveRequireslive_requiresstring[]

DeliveryAttempt#

FieldPython / RustType
numbernumbernumber
sentAtsent_atstring
transporttransport"http" | "socket"
urlurlstring | undefined
requestHeadersrequest_headersRecord<string, string>
statusstatus"pending" | "acknowledged" | "failed" | "timed_out" | "unreachable"
responseStatusresponse_statusnumber | undefined
responseBodyresponse_bodystring | undefined
durationMsduration_msnumber | undefined
forgedSignatureforged_signatureboolean

Places#

type Places = Place[];

PlaceTranscript#

FieldType
entriesPlaceTranscriptEntry[]
textstring

PlaceTranscriptEntry#

FieldPython / RustType
ididstring
authorauthorPlacePrincipal
atatstring
texttextstring
controlscontrolsstring[]
editededitedboolean
depthdepthnumber
streamingstreaming"open" | "stopped" | "completed" | undefined
visibleTovisible_toPlacePrincipal | undefined

PlacePrincipal#

FieldType
idstring
namestring
kind"user" | "app"
FieldType
urlstring

This page is generated from the control API's routes by codegen/src/emit/docs.ts: suggest changes there.