Skip to content

zidane-ui/channels/headless

import { … } from 'zidane-ui/channels/headless'ui/src/channels/headless/index.ts

Functions#

createChannelsHostFunction#

Creates a ChannelsHostState over a backend. A member whose method the backend does not offer is left out.

TypeScript
function createChannelsHost(backend: ChannelsBackend): ChannelsHostState
Parameters
NameTypeDescription
backendChannelsBackend

The host's channels methods.

ui/src/channels/headless/state.ts:321

Classes#

ChannelsActionErrorClass#

An error a ChannelsHost action rejects with: its ChannelsError in error.

TypeScript
class ChannelsActionError extends Error
TypeScript
new ChannelsActionError(error: ChannelsError)
Parameters
NameTypeDescription
errorChannelsError

What failed.

ChannelsActionError properties
NameTypeDescription
errorreadonlyChannelsError

What failed, for the labels.

ui/src/channels/headless/host.ts:140

Constants#

CHANNELS_METHODSConstant#

Every ChannelsMethod, for a transport that lists what it forwards.

TypeScript
const CHANNELS_METHODS: readonly ('projects.readiness' | 'channels.bindings.testAs' | 'channels.connections.list' | 'channels.connections.get' | 'channels.connections.create' | 'channels.connections.update' | 'channels.connections.remove' | 'channels.connections.status' | 'channels.connections.slackManifest' | 'channels.connections.slackCredentials' | 'channels.connections.slackInstall' | 'channels.connections.githubManifest' | 'channels.bindings.list' | 'channels.runsOn' | 'channels.bindings.put' | 'channels.bindings.remove' | 'channels.bindings.enable' | 'channels.conversations' | 'channels.defaultProject' | 'channels.held.list' | 'channels.held.release' | 'channels.alerts.list' | 'channels.agent.get' | 'channels.agent.set')[]

ui/src/channels/headless/host.ts:77

Interfaces#

AccessPolicyInterface#

A level with some of its rules changed.

TypeScript
interface AccessPolicy
AccessPolicy properties
NameTypeDescription
agent?string

Agent profile id the session runs (overrides the binding's).

approvals?'off' | 'ask' | 'decide'

How tool calls are approved: 'ask' (the channel's owners answer), 'decide' (a model decides), 'off' (never asked). Absent: the host's approval mode.

approvalTimeout?number | 'never'

Minutes a pending approval waits before it is denied; 'never' waits until answered.

budget?{ minutes?: number; usd?: number }

Per-run ceilings: cost in US dollars, wall time in minutes.

extends?AccessLevel

The level this policy starts from. Absent: the level the outer layers gave (an owner with none starts from 'full'; a member must have one).

readDeny?false | 'host-secrets'

'host-secrets': read tools refuse the host's secret paths. false lifts it.

toolset?'host' | 'profile-only'

'profile-only': the agent gets only its profile's tools and MCP servers, none the host or the folder adds (session policy toolset). 'host' lifts it. Absent: what the outer layers gave; no level sets it.

dist/pure-ET4-8JZg.d.ts:17845

ChannelAlertInterface#

One open incident a person is told about once (docs/CHANNELS.md § Alerts): an app notification and a Slack DM.

TypeScript
interface ChannelAlert
ChannelAlert properties
NameTypeDescription
atnumber

When it opened, Unix ms.

connectionId?string

The connection, for a connection's incident.

detail?string

More, when the title isn't enough.

fix?ReadinessFix

The readiness fix.

idstring

The incident's key: the same incident is told once, and clears on recovery.

kindChannelAlertKind

What it is about.

projectId?string

The project, for a project's incident.

titlestring

One short line.

dist/pure-ET4-8JZg.d.ts:9098

ChannelBindingInterface#

A maintainer's binding: one project's conversations through one connection.

TypeScript
interface ChannelBinding
ChannelBinding properties
NameTypeDescription
accessBindingAccessRules

What members and guests get.

accessToSet?boolean

true: imported from a config file whose access was a function, so it came in off. It stays off until a maintainer sets its access (a put with access clears it).

connectionIdstring | null

The connection it runs through. null: a draft that still needs one (a published project's).

createdAtnumber

Creation time, Unix ms.

createdBystring

The user id that made it.

draftboolean

A published project's binding that waits for a maintainer to map it to a connection. Never runs.

enabledboolean

false: kept, but off.

environment?ChannelBindingEnvironment

Where its sessions run (see ChannelBindingEnvironment). Absent: worktree.

handoff?boolean

false: the org's Agent may not start threads here (docs/CHANNELS.md § The Agent). Absent: it may (a channel binding).

idstring

bind_ + 12 hex.

identity?BindingIdentity

Name and icon overrides.

inherit?boolean

true: its sessions take the project's own inherit rules. Absent: they run project-only for every kind (lockedForChannel), the default.

limits?Limits

Throttles over the defaults (concurrentRuns, runsPerMemberPerHour).

matchChannelBindingMatch

The conversations it takes. One binding per Slack channel or repository per connection.

profileId?string

A profile of the project (projects.content, kind profile) its sessions run. Absent: the project's own agent.

projectIdstring

The project its sessions belong to (and are owned by).

publishedFrom?{ bindingId: string; hostId: string }

A draft's origin: the publishing host and its binding there, which turns off once this one runs (docs/CHANNELS.md § Published projects).

updatedAtnumber

Last change, Unix ms.

versionnumber

Grows by one with each change: a write that names an older one is refused.

dist/pure-ET4-8JZg.d.ts:18022

ChannelConnectionInterface#

An admin's connection, as a list answers it. Never carries a secret's value: secrets names those it holds.

TypeScript
interface ChannelConnection
ChannelConnection properties
NameTypeDescription
createdAtnumber

Creation time, Unix ms.

createdBystring

The user id that made it.

enabledboolean

false: kept, but off.

github?GithubConnectionInfo

GitHub facts.

idstring

conn_ + 12 hex: stable, never reused.

localUsers?string[]

A laptop's own provider accounts (Slack user ids, GitHub logins): the laptop has one person, and these are theirs. A server ignores it: there a person links their account (docs/IDENTITY.md, Linked accounts).

namestring

Its name: letters, digits, - and _, unique on the host. It names the webhook routes (/channels/<name>/…).

providerChannelConnectionProvider

Which provider it talks to.

replaces?string

The connection it replaces once it is ready (ChannelConnectionInput.replaces). Cleared when the replacement is done.

secrets('botToken' | 'appToken' | 'signingSecret' | 'clientSecret' | 'privateKey' | 'webhookSecret')[]

The secrets it holds, by key. Their values never leave the host.

sharedChannelConnectionShare

The projects it serves. Default all.

slack?SlackConnectionInfo

Slack facts.

statusChannelConnectionStatus

Its setup (computed from what it holds, and enabled).

transportChannelConnectionTransport

How it hears its provider. GitHub is always http.

updatedAtnumber

Last change, Unix ms.

versionnumber

Grows by one with each change: a write that names an older one is refused.

dist/pure-ET4-8JZg.d.ts:17916

ChannelIpcMethodsInterface#

The channels.* methods of import('./protocol').IpcMethods (docs/CHANNELS.md § Methods), with the host's projects.readiness (ProjectIpcMethods), which the channels compute: a channels client reaches all it needs here.

TypeScript
interface ChannelIpcMethods extends Pick<ProjectIpcMethods, 'projects.readiness'>
ChannelIpcMethods properties
NameTypeDescription
channels.agent.get{ params: Record<string, never>; result: ChannelAgent | null }

The org's Agent, or null when there is none yet. Anyone. Additive.

channels.agent.set{ params: { enabled: boolean }; result: ChannelAgent }

Turns the org's Agent on or off. Admins. Additive.

channels.alerts.list{ params: Record<string, never>; result: ChannelAlert[] }

The caller's open channel alerts (docs/CHANNELS.md § Alerts). Additive.

channels.bindings.enable{ params: { bindingId: string; enabled: boolean; id: string }; result: ChannelBinding }

Turns a binding on or off. Maintainers. Additive.

channels.bindings.list{ params: { id: string }; result: ChannelBindingsView }

A project's bindings and the connections shared with it. A project's members. Additive.

channels.bindings.put{ params: { binding: ChannelBindingInput; id: string }; result: ChannelBinding }

Makes or changes a binding of the project id. Maintainers. Additive.

channels.bindings.remove{ params: { bindingId: string; id: string }; result: void }

Removes a binding. Maintainers. Additive.

channels.bindings.testAs{ params: { as: TestAsKind; bindingId: string }; result: { sessionId: string } }

Opens a private session for the caller that runs with the binding's exact rules for a member or a guest (docs/CHANNELS.md § Test as). Marked metadata.test = { bindingId, as }; no budget source. Maintainers. Additive.

channels.connections.create{ params: ChannelConnectionInput; result: ChannelConnection }

Makes a connection (pending until it holds its credentials). Admins. Additive.

channels.connections.get{ params: { id: string }; result: ChannelConnection | null }

One connection, or null. Admins. Additive.

channels.connections.githubManifest{ params: { id: string; organization?: string }; result: GithubManifestResult }

Starts GitHub's App Manifest flow for a GitHub connection: GitHub comes back to this server, which stores the App's id, key and webhook secret. Admins. Additive.

channels.connections.list{ params: Record<string, never>; result: ChannelConnection[] }

Every connection, without secrets. Admins (on a laptop, its user). Additive.

channels.connections.remove{ params: { force?: boolean; id: string }; result: void }

Removes a connection and its secrets. Refused while bindings run through it, unless force (they become drafts). Admins. Additive.

channels.connections.slackCredentials{ params: { appId: string; appToken?: string; botToken?: string; clientId: string; clientSecret: string; id: string; signingSecret?: string }; result: ChannelConnection }

Saves a Slack app's credentials once (they go to the secret store, never back). With botToken (the app installed from Slack's own page) the connection is ready at once; otherwise slackInstall follows. Admins. Additive.

channels.connections.slackInstall{ params: { id: string }; result: { url: string } }

The "Add to Slack" URL of a connection with credentials: Slack comes back to this server, which stores the bot token. Admins. Additive.

channels.connections.slackManifest{ params: { connectionId?: string; iconUrl?: string; name: string; transport: ChannelConnectionTransport }; result: SlackManifestResult }

A Slack app manifest for Socket Mode or HTTP (with this server's URLs for connectionId), and Slack's create link. Admins. Additive.

channels.connections.status{ params: Record<string, never>; result: ChannelConnectionState[] }

Each connection's live state, with why a pending one does not start. Admins. Additive.

channels.connections.update{ params: { id: string; patch: ChannelConnectionPatch }; result: ChannelConnection }

Changes a connection: name, transport, sharing, on or off. A changed transport or token restarts it. Admins. Additive.

channels.conversations{ params: { connectionId: string; id: string }; result: ChannelConversation[] }

The Slack channels a connection's app is in, for the binding picker. A project's maintainers. Additive.

channels.defaultProject{ params: { connectionId: string; projectId: string | null }; result: void }

Sets (null: clears) the caller's default project for a connection's DMs and unbound mentions. Additive.

channels.held.list{ params: { id: string }; result: HeldPost[] }

The project's posts held for review (docs/CHANNELS.md § Outbound filter), oldest first. Maintainers. Additive.

channels.held.release{ params: { as: HeldRelease; heldId: string; id: string }; result: void }

Sends a held post as it was, sends it with its credential-like parts redacted, or drops it. Audited. Maintainers. Additive.

channels.linkPrompts{ params: { bindingId: string; id: string }; result: { sent: number } }

The bot DMs each person in the binding's Slack channel with no linked zidane account a link to link it. Maintainers. Additive.

channels.retention{ params: { keepLeavers?: boolean }; result: { keepLeavers: boolean } }

Reads, and with keepLeavers sets, the organization's retention flag: keep the DM sessions of people who left. Admins. Additive.

channels.runsOn{ params: { id: string }; result: ChannelRunsOn }

Where the project's channel sessions can run, and what Automatic picks now. A project's members. Additive.

projects.readinessfrom Pick{ params: { id: string }; result: ReadinessItem[] }

The project's readiness checklist (docs/CHANNELS.md § Readiness checks): what its channels compute; none without channels. A member reads it. Additive.

dist/pure-ET4-8JZg.d.ts:18191

ChannelRunsOnInterface#

Where a project's channel sessions can run on this host (channels.runsOn), for the binding's picker.

TypeScript
interface ChannelRunsOn
ChannelRunsOn properties
NameTypeDescription
automatic{ environment: string } | { reason: string }

What Automatic picks now (an environment kind), or why nothing can run.

machines{ name: string; status: 'online' | 'offline'; worktrees: boolean }[]

The host's machines.

serverstring

The host's name.

serverRunsboolean

The host runs sessions in its own folders (a laptop; a server with selfMachine on).

serverWorktreesboolean

The host makes worktrees in its own folders.

dist/pure-ET4-8JZg.d.ts:17960

ChannelsAgentInterface#

The org's Agent (docs/CHANNELS.md § The Agent): read with channels.agent.get, read again on channels:changed without a project. Anyone reads it; admins turn it on or off.

TypeScript
interface ChannelsAgent
ChannelsAgent properties
NameTypeDescription
ensure() => void

Reads it once, the first time something shows it. Never rejects.

errorReadable<ChannelsError | null>

Why the last read failed, or null.

refresh() => Promise<void>

Reads it again. Rejects with a ChannelsActionError.

set?(enabled: boolean) => Promise<ChannelAgent>

Turns it on or off. Absent: no switch.

viewReadable<ChannelAgent | null | undefined>

The Agent, null when there is none yet (no Slack app is ready), undefined until read.

ui/src/channels/headless/host.ts:272

ChannelsAlertsInterface#

The caller's open channel alerts (docs/CHANNELS.md § Alerts): read with channels.alerts.list, then kept live by channels:alert (an opened alert is added, a cleared one removed). The host sends a person only their own.

TypeScript
interface ChannelsAlerts
ChannelsAlerts properties
NameTypeDescription
ensure() => void

Reads them once, the first time something shows them. Never rejects.

errorReadable<ChannelsError | null>

Why the last read failed, or null.

listReadable<readonly ChannelAlert[] | null>

The open alerts, oldest first: null until read.

refresh() => Promise<void>

Reads them again. Rejects with a ChannelsActionError.

runFix?(fix: { kind: 'method'; label: string; method: string; params: Record<string, unknown> }) => Promise<void>

Runs an alert's method fix, then reads the alerts again. Absent: method fixes show without a button.

ui/src/channels/headless/host.ts:255

ChannelsBackendInterface#

The transport under a channels host: one call per protocol method, and which ones the host offers. Each app implements it once (zidane-server's client, the desktop app's IPC, a fixture).

TypeScript
interface ChannelsBackend
ChannelsBackend properties
NameTypeDescription
call<M extends 'projects.readiness' | 'channels.bindings.testAs' | 'channels.connections.list' | 'channels.connections.get' | 'channels.connections.create' | 'channels.connections.update' | 'channels.connections.remove' | 'channels.connections.status' | 'channels.connections.slackManifest' | 'channels.connections.slackCredentials' | 'channels.connections.slackInstall' | 'channels.connections.githubManifest' | 'channels.bindings.list' | 'channels.runsOn' | 'channels.bindings.put' | 'channels.bindings.remove' | 'channels.bindings.enable' | 'channels.conversations' | 'channels.defaultProject' | 'channels.held.list' | 'channels.held.release' | 'channels.alerts.list' | 'channels.agent.get' | 'channels.agent.set'>(method: M, params: ChannelsParams<M>) => Promise<ChannelsResult<M>>

Calls a method. Rejects with the host's error (the adapter's own type; classify words it).

can(method: 'projects.readiness' | 'channels.bindings.testAs' | 'channels.connections.list' | 'channels.connections.get' | 'channels.connections.create' | 'channels.connections.update' | 'channels.connections.remove' | 'channels.connections.status' | 'channels.connections.slackManifest' | 'channels.connections.slackCredentials' | 'channels.connections.slackInstall' | 'channels.connections.githubManifest' | 'channels.bindings.list' | 'channels.runsOn' | 'channels.bindings.put' | 'channels.bindings.remove' | 'channels.bindings.enable' | 'channels.conversations' | 'channels.defaultProject' | 'channels.held.list' | 'channels.held.release' | 'channels.alerts.list' | 'channels.agent.get' | 'channels.agent.set') => boolean

Whether the host offers a method. A method it does not offer hides what needs it.

classify?(err: unknown) => ChannelsError

Words a rejection. Default: failed with its message.

publicUrl?boolean

The host serves https webhooks at a public URL, so a Slack app can use HTTP instead of Socket Mode. Default false.

runFix?(method: string, params: Record<string, unknown>) => Promise<unknown>

Calls the method a readiness fix names (fix.kind === 'method'): any method of the host, checked there like any other call. Absent: method fixes are not offered.

ui/src/channels/headless/host.ts:157

ChannelsBindingsInterface#

Project settings › Channels: a project's bindings. Members read; maintainers change.

TypeScript
interface ChannelsBindings
ChannelsBindings properties
NameTypeDescription
conversations?(projectId: string, connectionId: string) => Promise<ChannelConversation[]>

The Slack channels a connection's app is in. Absent: the channel is typed by hand.

enable?(projectId: string, bindingId: string, enabled: boolean) => Promise<ChannelBinding>

Turns a binding on or off. Absent: no switch.

ensure(projectId: string) => void

Reads a project's bindings once, the first time something shows them. Never rejects.

error(projectId: string) => Readable<ChannelsError | null>

Why the last read of a project failed, or null.

put?(projectId: string, binding: ChannelBindingInput) => Promise<ChannelBinding>

Makes or changes a binding. Absent: read-only.

refresh(projectId: string) => Promise<void>

Reads them again. Rejects with a ChannelsActionError.

remove?(projectId: string, bindingId: string) => Promise<void>

Removes a binding. Absent: no Remove.

runsOn?(projectId: string) => Promise<ChannelRunsOn>

Where the project's channel sessions can run on the host, and what Automatic picks now: the binding's picker.

view(projectId: string) => Readable<ChannelBindingsView | null>

A project's bindings and the connections shared with it: null until read. One store per project.

ui/src/channels/headless/host.ts:216

ChannelsConnectionsInterface#

Settings › Channels: the host's connections, admins only (on a laptop, its user).

TypeScript
interface ChannelsConnections
ChannelsConnections properties
NameTypeDescription
create?(input: ChannelConnectionInput) => Promise<ChannelConnection>

Makes a connection (pending until it holds its credentials). Absent: no Add.

ensure() => void

Reads the list and the states once, the first time something shows them. Never rejects.

errorReadable<ChannelsError | null>

Why the last read failed, or null.

githubManifest?(id: string, organization?: string) => Promise<GithubManifestResult>

The page that starts GitHub's App Manifest flow. Absent: no Create GitHub App.

listReadable<readonly ChannelConnection[] | null>

Every connection, without secrets: null until read.

refresh() => Promise<void>

Reads the list and the states again. Rejects with a ChannelsActionError.

remove?(id: string, force?: boolean) => Promise<void>

Removes a connection; force turns its bindings into drafts. Absent: no Remove.

slackCredentials?(params: { appId: string; appToken?: string; botToken?: string; clientId: string; clientSecret: string; id: string; signingSecret?: string }) => Promise<ChannelConnection>

Saves a Slack app's credentials once. Absent: no credentials form.

slackInstall?(id: string) => Promise<string>

The "Add to Slack" URL. Absent: no Install.

slackManifest?(params: { connectionId?: string; iconUrl?: string; name: string; transport: ChannelConnectionTransport }) => Promise<SlackManifestResult>

A Slack app manifest and Slack's create link. Absent: no Create Slack app.

statusReadable<Readonly<Record<string, ConnectionLiveState>>>

Each connection's live state, by connection id (channels.connections.status, then channels:status).

transportsreadonly ('http' | 'socket')[]

The transports a new Slack app may use: socket always, http when the host has a public URL.

update?(id: string, patch: ChannelConnectionPatch) => Promise<ChannelConnection>

Changes a connection's name, transport, sharing, on or off. Absent: read-only.

ui/src/channels/headless/host.ts:174

ChannelsErrorInterface#

Why an action or a read failed, as the UI words it: refused (the caller's place does not allow it), unavailable (this host runs no channels: on the desktop, the background service is off), failed (anything else). detail is what the host said.

TypeScript
interface ChannelsError
ChannelsError properties
NameTypeDescription
detailstring

The host's own words.

kind'failed' | 'unavailable' | 'refused'

What kind of failure.

ui/src/channels/headless/host.ts:132

ChannelsHeldInterface#

A project's held replies (docs/CHANNELS.md § Outbound filter): posts not sent because they look like they carry a credential, each with a masked preview. Its owners and maintainers send one as it was, redacted, or drop it.

TypeScript
interface ChannelsHeld
ChannelsHeld properties
NameTypeDescription
list(projectId: string) => Promise<HeldPost[]>

The project's held replies, oldest first.

release(projectId: string, heldId: string, as: HeldRelease) => Promise<void>

Sends a held reply as it was or redacted, or drops it.

ui/src/channels/headless/host.ts:110

ChannelsHostInterface#

Everything the channels components read.

TypeScript
interface ChannelsHost
ChannelsHost properties
NameTypeDescription
agent?ChannelsAgent

The org's Agent. Absent: no Agent card and no Agent row.

alerts?ChannelsAlerts

The caller's open channel alerts. Absent: no alerts list.

bindings?ChannelsBindings

A project's bindings (Project settings › Channels). Absent: no Channels section.

connections?ChannelsConnections

The host's connections (Settings › Channels). Absent: no Channels page.

defaultProjectsReadable<Readonly<Record<string, string | null>>>

The defaults set from this window, by connection id (null: cleared). The host has no read of them.

held?ChannelsHeld

A project's replies the outbound filter held, and their release. Absent: no Held replies list.

openProject?(projectId: string) => void

Opens a project of the host (its home): the Agent card's Open project. Absent: no Open project.

openSession?(sessionId: string) => void

Opens a session of the host (a test session). Absent: Test as opens it in the background.

openTarget?(target: ReadinessOpenTarget, projectId?: string) => void

Opens a screen of the app a readiness fix names (Settings › Channels, Linked accounts). The project's own screens open its settings in the kit. Absent: those fixes show without a button. projectId: the project the fix is about (absent for an alert about no project).

readiness?ChannelsReadiness

A project's readiness checklist. Absent: no checklist.

setDefaultProject?(connectionId: string, projectId: string | null) => Promise<void>

Sets (null: clears) the caller's default project for a connection's DMs and unbound mentions. Absent: no default project rows.

testAs?(projectId: string, bindingId: string, as: TestAsKind, identity: { iconUrl?: string; name: string }) => Promise<TestSession>

Opens a private session with a binding's exact rules for a member or a guest. Absent: no Test as. identity: how its replies post, kept for the session's Test badge.

testSessionsReadable<Readonly<Record<string, TestSession>>>

The test sessions opened in this window, by session id.

ui/src/channels/headless/host.ts:300

ChannelsHostStateInterface#

A ChannelsHost with what its adapter feeds it.

TypeScript
interface ChannelsHostState extends ChannelsHost
ChannelsHostState properties
NameTypeDescription
agent?from ChannelsHostChannelsAgent

The org's Agent. Absent: no Agent card and no Agent row.

alerts?from ChannelsHostChannelsAlerts

The caller's open channel alerts. Absent: no alerts list.

apply(signal: { kind: string }) => void

A signal of the host: reads again what it touches. Other kinds are ignored.

bindings?from ChannelsHostChannelsBindings

A project's bindings (Project settings › Channels). Absent: no Channels section.

connections?from ChannelsHostChannelsConnections

The host's connections (Settings › Channels). Absent: no Channels page.

defaultProjectsfrom ChannelsHostReadable<Readonly<Record<string, string | null>>>

The defaults set from this window, by connection id (null: cleared). The host has no read of them.

held?from ChannelsHostChannelsHeld

A project's replies the outbound filter held, and their release. Absent: no Held replies list.

openProject?from ChannelsHost(projectId: string) => void

Opens a project of the host (its home): the Agent card's Open project. Absent: no Open project.

openSession?from ChannelsHost(sessionId: string) => void

Opens a session of the host (a test session). Absent: Test as opens it in the background.

openTarget?from ChannelsHost(target: ReadinessOpenTarget, projectId?: string) => void

Opens a screen of the app a readiness fix names (Settings › Channels, Linked accounts). The project's own screens open its settings in the kit. Absent: those fixes show without a button. projectId: the project the fix is about (absent for an alert about no project).

readiness?from ChannelsHostChannelsReadiness

A project's readiness checklist. Absent: no checklist.

setDefaultProject?from ChannelsHost(connectionId: string, projectId: string | null) => Promise<void>

Sets (null: clears) the caller's default project for a connection's DMs and unbound mentions. Absent: no default project rows.

testAs?from ChannelsHost(projectId: string, bindingId: string, as: TestAsKind, identity: { iconUrl?: string; name: string }) => Promise<TestSession>

Opens a private session with a binding's exact rules for a member or a guest. Absent: no Test as. identity: how its replies post, kept for the session's Test badge.

testSessionsfrom ChannelsHostReadable<Readonly<Record<string, TestSession>>>

The test sessions opened in this window, by session id.

wake() => void

Reads again everything read so far (a new connection).

ui/src/channels/headless/state.ts:33

ChannelsReadinessInterface#

A project's readiness checklist. Members read; each fix is checked by the host like any call.

TypeScript
interface ChannelsReadiness
ChannelsReadiness properties
NameTypeDescription
ensure(projectId: string) => void

Reads a project's items once, the first time something shows them. Never rejects.

error(projectId: string) => Readable<ChannelsError | null>

Why the last read failed, or null.

items(projectId: string) => Readable<readonly ReadinessItem[] | null>

A project's items: null until read. One store per project, read again on projects:readiness.

refresh(projectId: string) => Promise<void>

Reads them again. Rejects with a ChannelsActionError.

runFix?(projectId: string, fix: { kind: 'method'; label: string; method: string; params: Record<string, unknown> }) => Promise<void>

Runs a method fix, then reads the project's items again. Absent: method fixes show without a button.

ui/src/channels/headless/host.ts:238

ConnectionLiveStateInterface#

A connection's live state: state with why, since when.

TypeScript
interface ConnectionLiveState
ConnectionLiveState properties
NameTypeDescription
connectionIdstring

The connection.

detail?string

Why (a pending setup's missing piece, the provider's error).

sincenumber

Since when, Unix ms.

state'starting' | 'failed' | 'stopped' | 'connected' | 'degraded'

How it is now.

ui/src/channels/headless/host.ts:204

LimitsInterface#

Throttles per channel. Owners are never throttled.

TypeScript
interface Limits
Limits properties
NameTypeDescription
concurrentRuns?number

Runs of this channel's sessions at once. Default 2.

runsPerMemberPerHour?number

Runs one member may start per hour. Default 10.

dist/pure-ET4-8JZg.d.ts:17865

TestSessionInterface#

A session "Test as" opened: the binding's rules for a member or a guest, as its replies would post.

TypeScript
interface TestSession
TestSession properties
NameTypeDescription
asTestAsKind

Who it runs as.

bindingIdstring

The binding it tests.

identity{ iconUrl?: string; name: string }

The name and icon its replies post with (the binding's, else the project's name).

projectIdstring

The project of the binding.

sessionIdstring

The session.

ui/src/channels/headless/host.ts:286

Types#

ChannelAgentType#

The org's Agent (docs/CHANNELS.md § The Agent): its project, its name, on or off.

TypeScript
type ChannelAgent = NonNullable<ChannelsResult<'channels.agent.get'>>

ui/src/channels/headless/host.ts:86

ChannelBindingEnvironmentType#

Where a binding's sessions run: a worktree each, the project's folder, or the host's default environment kind.

TypeScript
type ChannelBindingEnvironment = NonNullable<ChannelsParams<'channels.bindings.put'>['binding']['environment']>

ui/src/channels/headless/host.ts:89

ChannelsMethodType#

A method the channels area calls: the channels.* methods of connections, bindings, test sessions, held replies, alerts and the org's Agent, and projects.readiness.

TypeScript
type ChannelsMethod = keyof typeof CHANNELS_METHOD_TABLE

ui/src/channels/headless/host.ts:74

ChannelsParamsType#

A method's params.

TypeScript
type ChannelsParams<M extends ChannelsMethod> = ChannelIpcMethods[M]['params']
ChannelsParams type parameters
NameTypeDescription
Mextends ChannelsMethod

ui/src/channels/headless/host.ts:80

ChannelsResultType#

A method's result.

TypeScript
type ChannelsResult<M extends ChannelsMethod> = ChannelIpcMethods[M]['result']
ChannelsResult type parameters
NameTypeDescription
Mextends ChannelsMethod

ui/src/channels/headless/host.ts:83

ChannelsSignalType#

The signals that move the channels stores.

TypeScript
type ChannelsSignal =
  | { kind: 'channels:changed'; projectId?: string }
  | { connectionId: string; detail?: string; kind: 'channels:status'; since: number; state: 'starting' | 'connected' | 'degraded' | 'failed' | 'stopped' }
  | { kind: 'projects:readiness'; projectId: string }
  | { alert: ChannelAlert; cleared?: boolean; forUser: string; kind: 'channels:alert' }

ui/src/channels/headless/host.ts:121

ReadinessFixType#

A readiness item's one-click fix.

TypeScript
type ReadinessFix = NonNullable<ReadinessItem['fix']>

ui/src/channels/headless/host.ts:95

ReadinessItemType#

One line of a project's readiness checklist (projects.readiness).

TypeScript
type ReadinessItem = ChannelsResult<'projects.readiness'>[number]

ui/src/channels/headless/host.ts:92

ReadinessMethodFixType#

A readiness fix that calls a method of the host.

TypeScript
type ReadinessMethodFix = Extract<ReadinessFix, { kind: 'method' }>

ui/src/channels/headless/host.ts:98

ReadinessOpenTargetType#

A screen a readiness fix opens.

TypeScript
type ReadinessOpenTarget = Extract<ReadinessFix, { kind: 'open' }>['target']

ui/src/channels/headless/host.ts:101

TestAsKindType#

Who a test session runs as.

TypeScript
type TestAsKind = ChannelsParams<'channels.bindings.testAs'>['as']

ui/src/channels/headless/host.ts:118