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.
function createChannelsHost(backend: ChannelsBackend): ChannelsHostStateParameters
| Name | Type | Description |
|---|---|---|
| backend | ChannelsBackend | The host's channels methods. |
Returns
Classes#
ChannelsActionErrorClass#
An error a ChannelsHost action rejects with: its ChannelsError in error.
class ChannelsActionError extends ErrorConstructor
new ChannelsActionError(error: ChannelsError)Parameters
| Name | Type | Description |
|---|---|---|
| error | ChannelsError | What failed. |
Returns
Properties
| Name | Type | Description |
|---|---|---|
| errorreadonly | ChannelsError | What failed, for the labels. |
Constants#
CHANNELS_METHODSConstant#
Every ChannelsMethod, for a transport that lists what it forwards.
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')[]Interfaces#
AccessPolicyInterface#
A level with some of its rules changed.
interface AccessPolicyProperties
| Name | Type | Description |
|---|---|---|
| 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. |
| 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 |
ChannelAlertInterface#
One open incident a person is told about once (docs/CHANNELS.md § Alerts): an app notification and a Slack DM.
interface ChannelAlertProperties
| Name | Type | Description |
|---|---|---|
| at | number | 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. |
| id | string | The incident's key: the same incident is told once, and clears on recovery. |
| kind | ChannelAlertKind | What it is about. |
| projectId? | string | The project, for a project's incident. |
| title | string | One short line. |
ChannelBindingInterface#
A maintainer's binding: one project's conversations through one connection.
interface ChannelBindingProperties
| Name | Type | Description |
|---|---|---|
| access | BindingAccessRules | What members and guests get. |
| accessToSet? | boolean |
|
| connectionId | string | null | The connection it runs through. |
| createdAt | number | Creation time, Unix ms. |
| createdBy | string | The user id that made it. |
| draft | boolean | A published project's binding that waits for a maintainer to map it to a connection. Never runs. |
| enabled | boolean |
|
| environment? | ChannelBindingEnvironment | Where its sessions run (see |
| handoff? | boolean |
|
| id | string |
|
| identity? | BindingIdentity | Name and icon overrides. |
| inherit? | boolean |
|
| limits? | Limits | Throttles over the defaults ( |
| match | ChannelBindingMatch | The conversations it takes. One binding per Slack channel or repository per connection. |
| profileId? | string | A profile of the project ( |
| projectId | string | 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). |
| updatedAt | number | Last change, Unix ms. |
| version | number | Grows by one with each change: a write that names an older one is refused. |
ChannelConnectionInterface#
An admin's connection, as a list answers it. Never carries a secret's value: secrets names those it holds.
interface ChannelConnectionProperties
| Name | Type | Description |
|---|---|---|
| createdAt | number | Creation time, Unix ms. |
| createdBy | string | The user id that made it. |
| enabled | boolean |
|
| github? | GithubConnectionInfo | GitHub facts. |
| id | string |
|
| 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). |
| name | string | Its name: letters, digits, |
| provider | ChannelConnectionProvider | Which provider it talks to. |
| replaces? | string | The connection it replaces once it is ready ( |
| secrets | ('botToken' | 'appToken' | 'signingSecret' | 'clientSecret' | 'privateKey' | 'webhookSecret')[] | The secrets it holds, by key. Their values never leave the host. |
| shared | ChannelConnectionShare | The projects it serves. Default |
| slack? | SlackConnectionInfo | Slack facts. |
| status | ChannelConnectionStatus | Its setup (computed from what it holds, and |
| transport | ChannelConnectionTransport | How it hears its provider. GitHub is always |
| updatedAt | number | Last change, Unix ms. |
| version | number | Grows by one with each change: a write that names an older one is refused. |
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.
interface ChannelIpcMethods extends Pick<ProjectIpcMethods, 'projects.readiness'>Properties
| Name | Type | Description |
|---|---|---|
| channels.agent.get | { params: Record<string, never>; result: ChannelAgent | null } | The org's Agent, or |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 ( |
| 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 |
| 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. |
ChannelRunsOnInterface#
Where a project's channel sessions can run on this host (channels.runsOn), for the binding's picker.
interface ChannelRunsOnProperties
| Name | Type | Description |
|---|---|---|
| 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. |
| server | string | The host's name. |
| serverRuns | boolean | The host runs sessions in its own folders (a laptop; a server with |
| serverWorktrees | boolean | The host makes worktrees in its own folders. |
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.
interface ChannelsAgentProperties
| Name | Type | Description |
|---|---|---|
| ensure | () => void | Reads it once, the first time something shows it. Never rejects. |
| error | Readable<ChannelsError | null> | Why the last read failed, or |
| refresh | () => Promise<void> | Reads it again. Rejects with a |
| set? | (enabled: boolean) => Promise<ChannelAgent> | Turns it on or off. Absent: no switch. |
| view | Readable<ChannelAgent | null | undefined> | The Agent, |
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.
interface ChannelsAlertsProperties
| Name | Type | Description |
|---|---|---|
| ensure | () => void | Reads them once, the first time something shows them. Never rejects. |
| error | Readable<ChannelsError | null> | Why the last read failed, or |
| list | Readable<readonly ChannelAlert[] | null> | The open alerts, oldest first: |
| refresh | () => Promise<void> | Reads them again. Rejects with a |
| 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. |
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).
interface ChannelsBackendProperties
| Name | Type | Description |
|---|---|---|
| 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; |
| 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: |
| 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 ( |
ChannelsBindingsInterface#
Project settings › Channels: a project's bindings. Members read; maintainers change.
interface ChannelsBindingsProperties
| Name | Type | Description |
|---|---|---|
| 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 |
| 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 |
| 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: |
ChannelsConnectionsInterface#
Settings › Channels: the host's connections, admins only (on a laptop, its user).
interface ChannelsConnectionsProperties
| Name | Type | Description |
|---|---|---|
| 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. |
| error | Readable<ChannelsError | null> | Why the last read failed, or |
| githubManifest? | (id: string, organization?: string) => Promise<GithubManifestResult> | The page that starts GitHub's App Manifest flow. Absent: no Create GitHub App. |
| list | Readable<readonly ChannelConnection[] | null> | Every connection, without secrets: |
| refresh | () => Promise<void> | Reads the list and the states again. Rejects with a |
| remove? | (id: string, force?: boolean) => Promise<void> | Removes a connection; |
| 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. |
| status | Readable<Readonly<Record<string, ConnectionLiveState>>> | Each connection's live state, by connection id ( |
| transports | readonly ('http' | 'socket')[] | The transports a new Slack app may use: |
| update? | (id: string, patch: ChannelConnectionPatch) => Promise<ChannelConnection> | Changes a connection's name, transport, sharing, on or off. Absent: read-only. |
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.
interface ChannelsErrorProperties
| Name | Type | Description |
|---|---|---|
| detail | string | The host's own words. |
| kind | 'failed' | 'unavailable' | 'refused' | What kind of failure. |
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.
interface ChannelsHeldProperties
| Name | Type | Description |
|---|---|---|
| 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. |
ChannelsHostInterface#
Everything the channels components read.
interface ChannelsHostProperties
| Name | Type | Description |
|---|---|---|
| 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. |
| defaultProjects | Readable<Readonly<Record<string, string | null>>> | The defaults set from this window, by connection id ( |
| 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. |
| readiness? | ChannelsReadiness | A project's readiness checklist. Absent: no checklist. |
| setDefaultProject? | (connectionId: string, projectId: string | null) => Promise<void> | Sets ( |
| 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.
|
| testSessions | Readable<Readonly<Record<string, TestSession>>> | The test sessions opened in this window, by session id. |
ChannelsHostStateInterface#
A ChannelsHost with what its adapter feeds it.
interface ChannelsHostState extends ChannelsHostProperties
| Name | Type | Description |
|---|---|---|
agent?from ChannelsHost | ChannelsAgent | The org's Agent. Absent: no Agent card and no Agent row. |
alerts?from ChannelsHost | ChannelsAlerts | 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 ChannelsHost | ChannelsBindings | A project's bindings (Project settings › Channels). Absent: no Channels section. |
connections?from ChannelsHost | ChannelsConnections | The host's connections (Settings › Channels). Absent: no Channels page. |
defaultProjectsfrom ChannelsHost | Readable<Readonly<Record<string, string | null>>> | The defaults set from this window, by connection id ( |
held?from ChannelsHost | ChannelsHeld | 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. |
readiness?from ChannelsHost | ChannelsReadiness | A project's readiness checklist. Absent: no checklist. |
setDefaultProject?from ChannelsHost | (connectionId: string, projectId: string | null) => Promise<void> | Sets ( |
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.
|
testSessionsfrom ChannelsHost | Readable<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). |
ChannelsReadinessInterface#
A project's readiness checklist. Members read; each fix is checked by the host like any call.
interface ChannelsReadinessProperties
| Name | Type | Description |
|---|---|---|
| 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 |
| items | (projectId: string) => Readable<readonly ReadinessItem[] | null> | A project's items: |
| refresh | (projectId: string) => Promise<void> | Reads them again. Rejects with a |
| 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. |
ConnectionLiveStateInterface#
A connection's live state: state with why, since when.
interface ConnectionLiveStateProperties
| Name | Type | Description |
|---|---|---|
| connectionId | string | The connection. |
| detail? | string | Why (a pending setup's missing piece, the provider's error). |
| since | number | Since when, Unix ms. |
| state | 'starting' | 'failed' | 'stopped' | 'connected' | 'degraded' | How it is now. |
LimitsInterface#
Throttles per channel. Owners are never throttled.
interface LimitsProperties
| Name | Type | Description |
|---|---|---|
| concurrentRuns? | number | Runs of this channel's sessions at once. Default 2. |
| runsPerMemberPerHour? | number | Runs one member may start per hour. Default 10. |
TestSessionInterface#
A session "Test as" opened: the binding's rules for a member or a guest, as its replies would post.
interface TestSessionProperties
| Name | Type | Description |
|---|---|---|
| as | TestAsKind | Who it runs as. |
| bindingId | string | 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). |
| projectId | string | The project of the binding. |
| sessionId | string | The session. |
Types#
ChannelAgentType#
The org's Agent (docs/CHANNELS.md § The Agent): its project, its name, on or off.
type ChannelAgent = NonNullable<ChannelsResult<'channels.agent.get'>>ChannelBindingEnvironmentType#
Where a binding's sessions run: a worktree each, the project's folder, or the host's default environment kind.
type ChannelBindingEnvironment = NonNullable<ChannelsParams<'channels.bindings.put'>['binding']['environment']>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.
type ChannelsMethod = keyof typeof CHANNELS_METHOD_TABLEChannelsParamsType#
A method's params.
type ChannelsParams<M extends ChannelsMethod> = ChannelIpcMethods[M]['params']Type parameters
| Name | Type | Description |
|---|---|---|
| M | extends ChannelsMethod |
ChannelsResultType#
A method's result.
type ChannelsResult<M extends ChannelsMethod> = ChannelIpcMethods[M]['result']Type parameters
| Name | Type | Description |
|---|---|---|
| M | extends ChannelsMethod |
ChannelsSignalType#
The signals that move the channels stores.
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' }ReadinessFixType#
A readiness item's one-click fix.
type ReadinessFix = NonNullable<ReadinessItem['fix']>ReadinessItemType#
One line of a project's readiness checklist (projects.readiness).
type ReadinessItem = ChannelsResult<'projects.readiness'>[number]ReadinessMethodFixType#
A readiness fix that calls a method of the host.
type ReadinessMethodFix = Extract<ReadinessFix, { kind: 'method' }>ReadinessOpenTargetType#
A screen a readiness fix opens.
type ReadinessOpenTarget = Extract<ReadinessFix, { kind: 'open' }>['target']TestAsKindType#
Who a test session runs as.
type TestAsKind = ChannelsParams<'channels.bindings.testAs'>['as']