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();status = await channelstack.status()let status = channelstack.status().await?;Returns Status.
openSession()#
Open a session: a scope in the shared world that owns what it creates.
const session = await channelstack.openSession({ name: "…" });session = await channelstack.open_session(name="…")let session = channelstack.open_session().name("…").await?;| Parameter | Type | Required | |
|---|---|---|---|
name | string | no | option |
Returns Session.
reset()#
Drop the whole world. Avoid in parallel suites.
await channelstack.reset();await channelstack.reset()channelstack.reset().await?;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 });env = await channelstack.env(proxy=proxy)let env = channelstack.env().proxy(proxy).await?;| Parameter | Type | Required | |
|---|---|---|---|
proxy | boolean | no | option |
app | string | no | option |
channel | string | no | option |
Returns Env.
uiLoginLink()#
A new one-time link that opens the UI in a browser (what channelstack ui prints).
const uiLoginLink = await channelstack.uiLoginLink();ui_login_link = await channelstack.ui_login_link()let ui_login_link = channelstack.ui_login_link().await?;Returns UiLoginLink.
Session#
Returned by Channelstack.openSession().
| Field | Python / Rust | Type |
|---|---|---|
sessionId | session_id | string |
drivers | drivers | string[] |
close()#
Close a session and remove everything it created.
await session.close();await session.close()session.close().await?;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: "…" });event_page = await session.events(since="…")let event_page = session.events().since("…").await?;| Parameter | Type | Required | |
|---|---|---|---|
since | string | no | option |
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();quiet = await session.quiet()let quiet = session.quiet().await?;Returns Quiet.
echo()#
The echo fixture: the agent's app and where it reaches the fake.
const echoFixture = await session.echo();echo_fixture = await session.echo()let echo_fixture = session.echo().await?;Returns EchoFixture.
slack()#
The Slack fixture: the agent's app, the workspace, and where the agent reaches the fake.
const slack = await session.slack();slack = await session.slack()let slack = session.slack().await?;Returns SlackFixture.
github()#
The GitHub fixture: the agent's App, the org, and where the agent reaches the fake.
const github = await session.github();github = await session.github()let github = session.github().await?;Returns GitHubFixture.
linear()#
The Linear fixture: the agent's app, and where the agent reaches the fake.
const linear = await session.linear();linear = await session.linear()let linear = session.linear().await?;Returns LinearFixture.
notion()#
The Notion fixture: the agent's integration, and where the agent reaches the fake.
const notion = await session.notion();notion = await session.notion()let notion = session.notion().await?;Returns NotionFixture.
resend()#
The Resend fixture: the agent's team, and where the agent reaches the fake.
const resend = await session.resend();resend = await session.resend()let resend = session.resend().await?;Returns ResendFixture.
google()#
The Google fixture: the agent's mailbox, and where the agent reaches the fake.
const google = await session.google();google = await session.google()let google = session.google().await?;Returns GoogleFixture.
discord()#
The Discord fixture: the agent's app, the guild, and where the agent reaches the fake.
const discord = await session.discord();discord = await session.discord()let discord = session.discord().await?;Returns DiscordFixture.
openai()#
The OpenAI fixture: where the agent reaches the fake model.
const openai = await session.openai();openai = await session.openai()let openai = session.openai().await?;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();places = await session.places()let places = session.places().await?;Returns Places.
Place#
| Field | Type |
|---|---|
channel | string |
title | string |
id | string |
name | string |
active | string | undefined |
transcript()#
A place as a person reads it: the transcript its channel's own transcript route has.
const placeTranscript = await place.transcript();place_transcript = await place.transcript()let place_transcript = place.transcript().await?;Returns PlaceTranscript.
Types#
Plain values the handles return and take.
Status#
| Field | Type |
|---|---|
ready | boolean |
version | string |
drivers | string[] |
EventPage#
| Field | Type |
|---|---|
events | LogEvent[] |
cursor | string |
LogEvent#
| Field | Type |
|---|---|
at | string |
driver | string |
kind | "action" | "delivery" | "delivery_attempt" | "api_call" | "bot_loop" |
data | Record<string, unknown> |
summary | { text: string; outcome: string; ok: boolean } | undefined |
Quiet#
| Field | Python / Rust | Type |
|---|---|---|
busy | busy | boolean |
quietForMs | quiet_for_ms | number |
open | open | string[] |
problems | problems | string[] |
loops | loops | string[] | undefined |
Env#
type Env = Record<string, string>;
Capabilities#
type Capabilities = Record<string, Capability>;
Capability#
| Field | Python / Rust | Type |
|---|---|---|
fake | fake | boolean |
live | live | boolean |
liveRequires | live_requires | string[] |
DeliveryAttempt#
| Field | Python / Rust | Type |
|---|---|---|
number | number | number |
sentAt | sent_at | string |
transport | transport | "http" | "socket" |
url | url | string | undefined |
requestHeaders | request_headers | Record<string, string> |
status | status | "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable" |
responseStatus | response_status | number | undefined |
responseBody | response_body | string | undefined |
durationMs | duration_ms | number | undefined |
forgedSignature | forged_signature | boolean |
Places#
type Places = Place[];
PlaceTranscript#
| Field | Type |
|---|---|
entries | PlaceTranscriptEntry[] |
text | string |
PlaceTranscriptEntry#
| Field | Python / Rust | Type |
|---|---|---|
id | id | string |
author | author | PlacePrincipal |
at | at | string |
text | text | string |
controls | controls | string[] |
edited | edited | boolean |
depth | depth | number |
streaming | streaming | "open" | "stopped" | "completed" | undefined |
visibleTo | visible_to | PlacePrincipal | undefined |
PlacePrincipal#
| Field | Type |
|---|---|
id | string |
name | string |
kind | "user" | "app" |
UiLoginLink#
| Field | Type |
|---|---|
url | string |