zidane-ui/ chat/ headless
The React-free chat model, with the ChatHost interface, stores and the transcript pipeline.
import { … } from 'zidane-ui/chat/headless'ui/src/chat/headless/index.ts
Use this entry point to write a host, or to test transcript logic without React. It holds the ChatHost interface, the writable and constant stores, the session-list model and the transcript pipeline. The fixture host, createFixtureHost, is in zidane-ui/chat/testing. What a host offers lists each ChatHost member and the control it drives.
import { createFixtureHost } from 'zidane-ui/chat/testing'
const now = Date.now()
const host = createFixtureHost(
{ sessions: [{ id: 's1', title: 'First session', status: 'idle', createdAt: now, updatedAt: now }] },
{ reply: prompt => [{ kind: 'markdown', text: `You said: ${prompt}` }] },
)
const transcript = host.transcript('s1')
const stop = transcript.subscribe(() => console.log(transcript.get().events.length))
await host.send?.({ sessionId: 's1', prompt: 'hello' })
stop()Functions#
activityLabelFunction#
The row's words for an activity: the newest running tool, else the phase.
authFailureDetailsFunction#
What the card's Copy details writes: the headline, the reason, and the provider's own words when the reason rephrased them.
availableProjectsOfFunction#
Every project the sessions belong to, by folder name, sorted.
batchThinkingRunsFunction#
Fold runs of ≥2 closed thinking rows into one thinking-batch row —
the exact interaction model of batchToolRuns: the group lands
in the FIRST thought's slot, interleaved tool rows keep their
positions after it, and the group id is keyed off the first thought so
it stays stable while the exchange grows.
Grouping rule (consecutive-only): thinking rows chain when separated
by nothing or only tool / tool-batch rows with the SAME owner
(childId); a markdown / user-prompt / separator / spawn row breaks
the chain. A live (still streaming) thinking row never joins — it
must stay expanded and in view; the chain it would have extended is
flushed before it.
Run AFTER batchToolRuns so tool batches are already folded and the
chain check sees tool-batch rows, not raw runs.
batchToolRunsFunction#
Group consecutive tool rows (≥2) into a single tool-batch row so
the renderer can paint one Claude-Code-style collapsible header
instead of a wall of individual tool entries between two assistant
messages. Single tool rows pass through untouched (per the user's
"don't edit single tool calls" requirement).
Constraints:
- Only batches tool rows sharing the same
childId(incl. bothundefined). Mixing subagent + main-stream tools would muddle the SubagentBlock cluster — those stay separate. - Edit-style tools (
edit,multi_edit,write_file) participate in batching like any other tool; the per-row diff stays available on expand.
With groupToolCalls on, parent-owned tool rows are first lifted
exchange-wide by liftExchangeToolGroups; the adjacency pass
below then only batches subagent-owned (childId) tool rows, so
subagent clusters keep their existing behavior.
beginChipWorkFunction#
Mark one lookup as started; call the returned function once when it ends (success or not).
buildHostSidebarRowsFunction#
The sidebar's rows over every host. Per host: This computer's section
first, then each saved server's, each host's sessions grouped per folder
under its header. Any other view lists every host in one list, a server's
folder headers naming the server, and a repository's sessions on every
machine under one header (repoGroups). Sessions of a server no
longer saved are not listed.
buildQuerySidebarRowsFunction#
The sidebar's rows under a query grouping (a space's, an extension's, the agents'): favorites first, then one group per value in the grouping's order, the items of each group leading it. A session whose value is a list is in each of its groups. The sessions come sorted.
buildSessionRowsFunction#
Builds the flat row list for a session list: favorites first, then groups with headers, collapse state, and "show more" caps for project groups. Pure: the same input gives the same rows.
buildSidebarRowsFunction#
The sidebar's rows over the kit's session-list model: favorites, git repositories and the project of each session.
caretEffectivelyAtStartFunction#
Is the caret effectively at the buffer start for the mode-exit check?
The obvious answer (selection.empty && from === atStart) misses a
ProseMirror trap: Cmd/Ctrl+A creates an AllSelection, and deleting
it leaves that SAME AllSelection spanning the now-empty doc — empty
stays false, from stays 0 — until a click or a typed character
replaces it. Without the empty-doc escape hatch, Backspace after a
select-all-clear can never exit shell mode (Esc doesn't exit it
either), so the mode — and its ghost-autocomplete suppression — stick
for the rest of the draft.
A Backspace on an empty doc is a no-op edit whatever the selection
shape — exactly the TUI's "backspace at offset 0" exit trigger
(handleShellExitKey, src/tui/prompt/prompt-key-handlers.ts).
chipForPathFunction#
The chip of a path known to be a file or folder (a mention): never plain code.
chipWorkBusyFunction#
Whether any lookup is in flight.
claimChildSessionsFunction#
Each item with its child sessions (a session goes to the first item that claims it), and the sessions no item claims.
classifyInlineCodeFunction#
What inline code names, read from its text alone: a file or folder chip, or null for plain code.
clearedViewFiltersFunction#
The patch that turns every filter of a view off (viewFiltersOn), keeping its grouping,
sort and the contributed grouping and sort picked.
clusterByOwnerFunction#
Group contiguous rows with the same childId so the renderer can
wrap a subagent's output in a single bordered card — and nest the card
of a worker a worker started inside its spawner's (spawner from the
markers' spawn.parentChildId). A row's block chain is its worker's
ancestry; the open chain is reused as far as it matches, so a
grandchild's rows land inside the spawner's block that is still open,
and the spawner's later rows close the grandchild's block. A row of
another lane (main rows, an unrelated sibling) closes the chain: a later
grandchild row then reopens its spawner's block around itself.
collapseEventsFunction#
Turns transcript events into rows: pairs tool calls with their results, merges streamed text, reconciles edits and spawns. Rows are cached per source event, so appending an event keeps every earlier row identical.
commandNameFunction#
The command a chip names (/fix conflicts → fix).
commandRefFunction#
The command an invocation starts with: its /name, plus the leading
argument when that is one of the command's fixed values (args, which
may be several words): /fix conflicts now reads /fix conflicts. The
longest value wins, and it must end at a space or the end of the text.
commandViewFunction#
A command chip's card: the description and the aliases.
commitModelPickFunction#
Commits a picked chain, the ONE path every model picker takes: the
session's model (when there is one), then the app's default (the next
chat's model and lastModelChain) when this computer can run it. A draft
whose pick only a server can run still launches under it: held for this
window, not remembered. remember: false (a side chat's pick) only sets
the session's model.
commitViewFunction#
A sha chip's card: the short sha, the subject as its title, the author, the change size and the age.
compareSessionsFunction#
The order a sort puts two sessions in (negative: a first), as buildSessionRows sorts them.
composeLiveCostFunction#
The cost pill's figure while a run is in flight (see the header).
composeSubmitTextFunction#
Final submit text for the active mode, or null when the submit is
a no-op. Shell re-attaches the consumed bang (TUI submit in
src/tui/prompt/use-composer-actions.ts);
a blank shell command never submits, even with attachments staged.
Search mode never submits — Enter navigates matches instead.
computeSelectStopsFunction#
Works out the stops of select-turn mode from the painted rows. Result-only turns join the turn that made the call, and work-only turns join the next answer in the same exchange.
constantFunction#
A store that never changes.
conversationBadgesFunction#
The badges to show, in their default order (the kit's
orderComposerBadges applies the user's).
createAuthFixesFunction#
Creates an empty AuthFixes.
createChatBlockRunsFunction#
A ChatBlockRuns over transport: each session's runs read on first ask, again on each change.
createCompactionProgressFunction#
The compaction store over subscribe, the app's feed of every session's
stream signals (an Electron bus, a server connection's ipc.signal).
createComposerListsFunction#
The lists over a host's completions. onCommands: the command list changed (a typed /name may become, or
stop being, a badge).
createDecoratorFunction#
The decorator for a set of decorations: each session's merged decoration, or null when none
matches. The first matching decoration gives the icon, tone, subtitle and component; every one
adds its chips. Templates render with renderTemplate.
The output is cached per session object: the same row object gets the same decoration object
back, so a row whose session didn't change keeps its memo. A row patched with new facets is a
new object and is decorated again. Relative times in where are read when a row is first
decorated: a new decorator (new decorations) reads them again.
createDraftScopeStoreFunction#
Creates the draft's scope store.
createModelKnobsFunction#
Creates the remembered knobs over a host's prefs.
createModelNamesFunction#
Creates the names over a catalog and, optionally, the sign-in report's providers. Both are read for the store's life once a reader subscribes.
createModelPickerPrefsFunction#
Creates the preferences over a Storage, read on first use.
createNotificationStoreFunction#
An empty notification store.
createPathResolverFunction#
Creates the chip answers over a host's paths.
createReferenceStoreFunction#
Creates the reference cache over a host's references.
createRunEstimatesFunction#
The store over subscribe, the app's feed of every session's stream
signals (an Electron bus, a server connection's ipc.signal).
createRunMeterFunction#
Creates an empty RunMeter.
createSessionActivityFunction#
The activity store over subscribe, the app's feed of every session's
stream signals (an Electron bus, a server connection's ipc.signal).
createSessionBadgesFunction#
The badges store over source.
createSessionDirectoryFunction#
The directory over the app's ports; nothing runs until start().
createSessionHistoryFunction#
The history store: in memory, persisted through store once SessionHistory.load has read it.
createSessionStreamActionsFunction#
Binds the writes of streams (and its store) into one stable object.
createSessionStreamsFunction#
The session stream store: every session's live transcript and run state, reduced from zidane's host signals, with per-session subscriptions, smooth-stream pacing, lazy scrollback and run-end compaction. React-free.
createSidebarViewsFunction#
The views store: Storage first, the host's copy merged in once (SidebarViews.sync).
createSiteIconsFunction#
Creates the site icon cache over a fetcher.
dateBucketFunction#
Today, Yesterday, a weekday within the week, Mon D this year, Mon YYYY before.
decodeHistoryEntryFunction#
Decode a recalled history entry: !-prefixed entries recall INTO
shell mode with the bang stripped (applyRecalledPrompt,
src/tui/prompt/use-prompt-history.ts); everything else recalls as a normal prompt.
defaultModelPatchFunction#
The prefs patch that remembers pick as the next new chat's model.
deleteSessionPromptFunction#
The delete confirmation: the question, and a warning when the session's sandbox goes with it.
deriveDotStateFunction#
The dot state. Presence follows the TUI: awaiting input (◉) beats running (▶) beats attached (○). This window's own pending ask sits on top; a finished run's notification (completed / error) outranks attached.
dockRunReceiptsFunction#
Fold run-summary rows into the assistant row that closed the run: the
receipt renders as one line under that reply instead of a row (and a dot)
of its own.
Docked by ORDER (the nearest preceding assistant row), not by turn id. Live,
the receipt lands while that row may still be streaming and before run:end
settles it; matching ids across the live and persisted paths is one more
thing that can disagree, and then the receipt would fall out as a
standalone block with its own dot, a "new step" the reload path never
produces. The transcript's own order is the authoritative fact: whatever
assistant prose came last IS the run's end.
A receipt with no preceding assistant row IN ITS OWN RUN (a tool-only run, or one that errored right after a tool) keeps a standalone row rather than docking onto the row that closed the PREVIOUS run — which would both mis-attribute it and overwrite that run's receipt. Hence the candidate is cleared once consumed and at every user prompt: a receipt may only ever dock onto prose that came after its own run's prompt.
show === false (Settings.showRunReceipt off) drops the receipts
entirely — no standalone row, nothing docked. Receipts are synthesized both
live and on replay and never persisted, so this is the only gate.
dotVariantForFunction#
Picks the status dot a row shows.
draftFolderPathFunction#
The conversation's folder: null while the draft has none picked (the
folder gate shows), '' for none (a server's draft has none on this
computer), else the folder.
draftLocalFolderFunction#
The draft's folder when it is a folder on this computer, the only kind that makes a draft scope (a server's or machine's draft, or a folderless one, has none).
draftScopeOfFunction#
The scope of a draft state, null while it has none.
drainBucketFunction#
Pop the head off bucket.pending using the surrogate-safe slice.
Convenience over a raw safeSurrogateSlice call when the caller
doesn't need the remainder.
effortPickerTargetFunction#
What the effort picker offers for a session, null when its model has
nothing to set (no dead-end dialog).
encodeHistoryDraftFunction#
Encode the in-progress draft for the prompt-history stash so a
shell-mode draft survives the cycle round trip with its bang
(usePromptHistory, src/tui/prompt/use-prompt-history.ts). Search-mode drafts are never stashed (history
cycling is disabled in search mode).
environmentKindLabelFunction#
An environment kind's display name: a built-in kind's name, a machine's kind as Local @ laptop, else the id.
environmentSummaryTextFunction#
Where a session runs, in one line: tooltips and screen readers.
exitsModeOnKeyFunction#
Whether key (a DOM KeyboardEvent.key) exits the active mode.
caretAtStart = collapsed selection at buffer offset 0.
- shell: Backspace-at-0 only (
handleShellExitKey) — Esc stays free for its global meaning (stop run). - search: Backspace/Delete-at-0 (
isTranscriptSearchExitKey, src/tui/prompt/prompt-key-handlers.ts) or Esc (usePromptModes, src/tui/prompt/use-prompt-modes.ts).
extensionSpaceOfFunction#
An extension's space as the sidebar lists it: read-only, its newSession defaults as the space's.
failureTooltipFunction#
The failure row's tooltip: the line, then what it leaves out (when the limit resets, the provider's own words). Never inline: the row stays one quiet line.
filterDirectorySessionsFunction#
The sessions the list shows: the space's (a remote session without a space shows in every space), then the project and activity filters. The same array when nothing filters.
filterQueryOfFunction#
The query one contributed filter applies at the value the user picked, or null (off, or an
option no longer offered). A multi filter keeps a session one of its picked options matches.
filterSessionsFunction#
Sessions whose title contains every word of query (case-insensitive).
filtersForSpaceFunction#
The contributed filters a space offers: those for every space and those naming it.
findCommandFunction#
The command token (a name or an alias, without the slash) names in commands, or undefined.
findLastStreamingRowFunction#
The streaming reply that carries the caret, looking inside message groups.
firstGraphemeFunction#
First grapheme cluster of the input — Intl.Segmenter so ZWJ-joined
emoji (👨💻, 🏳️🌈) survive as one unit instead of splitting at the
first code point.
firstRowIdFunction#
A block's first row in paint order (its own or a nested block's): a stable key.
foldActionItemsFunction#
Every action of an exchange, in order (core planFold, shared with the
TUI): tool calls (batches seen through, the calls a call made nested under
it), consecutive thoughts merged, each worker one item holding its rows
and merged with the spawn call that started it. Rows that say nothing on
their own (plain notes) are skipped.
foldExchangesFunction#
Compact density: fold every exchange's work behind one exchange-fold
row. An exchange is the span between two boundary rows (user-prompt,
separator, compact-summary); rows that foldsInCompact move
into the fold, which sits RIGHT UNDER the exchange's prompt, ahead of the
prose (prose written before the first call still reads after the work
indicator, never between the prompt and it).
The exchange of a running run is live until the run ends (one working
indicator for the whole reply, however much prose streams in between).
It appears as soon as the prompt lands, before any action ("Working"),
so the indicator is always in place instead of jumping in later; a run
that ends without any action leaves no fold behind.
Runs after batching and receipt docking (so batches are already folded and receipts already docked on their prose) and before owner clustering (the fold's rows are clustered again when it is expanded, so worker blocks paint exactly as in full density).
foldWorkerRowsFunction#
A worker's (subagent's) own rows folded like an exchange of the main transcript: its tool calls, thoughts and the workers it started behind one "Working" row, its earlier messages behind one group, its last message in full. Its own rows are re-based to depth 0 (same row objects per input, so folds keep their identity across stream ticks); rows of workers it started keep their lane and fold as worker lines. Its lifecycle markers are left out: the line or header showing the worker already carries them.
formatElapsedShortFunction#
A running session's elapsed time: 42s, 12m, 1h 5m.
formatSessionCostLabelFunction#
Shared with the TUI (formatCostLabel in src/chat/format.ts).
groupsByFolderFunction#
Views whose groups are folders: Per directory, and each host's section in Per host.
hostReachableFunction#
Whether sessions on a host can be driven: This computer always, a server
only while connected. A host no longer saved (undefined) is not.
hostStatusLabelFunction#
One word for a host's status, for dots and labels, as the TUI words it.
inheritRowIdentityFunction#
Hands the row identity of the prompts next dropped to their copies in
it. A store swaps a prompt on show for an updated copy when it learns its
turn (the host's binding, or the persisted copy a page read brings): the
copy's rows keep their keys, so they update in place instead of
remounting and playing their entrance again. A copy is the same prompt by
its words, as reconcileEvents matches prompts; the newest pair first, so
an older prompt with the same words keeps its own rows.
isAuthFixedFunction#
Whether a failure's sign-in was fixed since.
isProjectIconFunction#
Whether a stored entry is a well-formed icon.
isProjectMemberFunction#
Whether session is listed under a project header: a local session in its
folder, or, for a header that names a repoKey, a server session of that
repository.
itemRowsFunction#
An item's row and its child sessions' rows (none while it is collapsed).
itemsForSpaceFunction#
The items listed in a space: those naming it, where the space allows items (the default space and user spaces always; an extension's when it says so).
lastModelChainOfFunction#
The prefs' lastModelChain entries for a chain (core ModelChainEntry shape, account included).
markRunFailuresFunction#
Returns rows itself when no run failed, so memoised consumers stay put.
The rules are core's (createRunStopMarker), shared with the TUI; an
exchange whose rows did not change keeps its previous output rows.
mergeLiveTailFunction#
Hydrate a live-only window: the disk page followed by the live events
that disk does not have yet. Persisted turns and their live events share
a turnId (hooks pre-mint it), so the boundary is the LAST live event
whose turn is on the page — everything after it (the in-flight turn's
streaming markdown, a display-only error row) is kept; everything before
it is superseded by its persisted form. No live turn on the page (the
run's first turn is still streaming) keeps the whole live lane.
Untagged live events in the kept suffix (a user-prompt echo is
broadcast bare and only retagged by prompt-turns, steer:inject echoes
likewise) are dropped when the page's trailing part already holds the
same kind + text — otherwise the disk copy and the echo both render.
mergePromptPreviewsFunction#
Fill dataUrl on image and PDF attachments that lack one, from previews:
same media type and name first, then the next unused preview of that media
type. With no incoming metadata at all (a local append that knew nothing
of the attachments) the previews are the attachments.
mergeSidebarSpacesFunction#
The spaces the sidebar knows: the user's in their order (a saved view's query kept), then the
extensions' by order. A space the host already lists under an extension's id takes the
extension's base and keeps its place; one with an extension space's id (<extension>/<id>) whose
extension contributes it no more is dropped, as core and the terminal app drop it.
missingPreviewDataFunction#
True when some image or PDF attachment has no bytes to show.
modeForTypedCharFunction#
Mode entered by typing char into the composer, or null when the
keystroke should be handled as ordinary input. Requires an empty
buffer and no active mode — matches the TUI's exactly-! /
exactly-? on lastSynced === '' checks (useSyncBuffer,
src/tui/prompt/use-sync-buffer.ts).
modelKnobsOfFunction#
The one ModelKnobsStore over a host's prefs (one shared in-memory store when it has none).
modelNamesOfFunction#
The one ModelNamesStore over a host's models (this computer's catalog, and its providers when listed).
Without models, every model keeps its readable id.
namerForFunction#
A namer reading catalog: the entry of that provider first, then any provider listing the id.
nestedCallVisibleFunction#
Whether a nested call's events show: core's nestedCallShown (a subagent,
a plan or a question always; the rest only with
Settings.codemodeShowCalls), the rule isVisible applies too.
nestSidebarRowsFunction#
The flat rows as nested sections: a host's section holds its groups, a group's holds its rows. Rows before any header (a flat view) stay at the top level, and so do a flat view's rows after its Favorites.
nestToolCallsFunction#
Moves every tool row whose parentId names a call in rows (same owner)
into that call's children. A nested row whose parent is absent stays
where it is. Returns rows itself when nothing nests.
newSessionRequestFunction#
The session a first send creates from the draft: on a server, its folder (or its first root), never one of this computer's; on a machine, the machine's folder; otherwise the draft's folder, if any. The model pick goes only when both halves are set.
nextSavedViewNameFunction#
The first saved-view name no space has yet: nameOf(1), nameOf(2)…
openFenceOfFunction#
The fence a streaming chunk ends inside, when it opened at column 0 (an indented one may belong to a list item, which only the parse can tell). The open fence is the whole tail of the chunk, so parsing it again on every delta re-parses a growing code block for nothing: the code block can draw the text as is, and the chunk parses normally once the fence closes.
pairToolEventsFunction#
Matches each tool event with its tool-result or error event. Pairs by callId when events carry one, and by position within the turn and tool name otherwise.
parseBashExitMetaFunction#
Parse the exit metadata the shell contract embeds in the persisted
result text (see runBashCommand in the TUI / startShellRun in
main): (exit 0, Nms) footer on success, Exit code N (Nms) /
Killed (Nms) header on failure, (cancelled by user after Nms)
footer on abort. Live and reloaded transcripts render identically
because both read the same text. Returns null when nothing matches
(still streaming, or a clipped tail dropped the footer).
parseModelPickerPrefsFunction#
Parses stored preferences; undefined when they are not JSON.
parsePinnedProjectsFunction#
Reads a stored pin map, dropping anything malformed and duplicate paths.
parseProjectIconsFunction#
Reads a stored icon map, keeping only well-formed entries.
parseSessionHistoryFunction#
A stored history, checked: entries are session keys (non-empty strings) or null, the cursor one of them.
Anything malformed reads as no history.
parseSidebarViewFunction#
A stored view, every axis checked; what is missing or unknown takes the default.
parseSwitcherPrefsFunction#
Stored switcher prefs, checked; anything malformed reads as none.
partitionMainSessionFunction#
Orchestration on: the main session is pulled out (pinned above the list). Off: the main is not a chat; it is hidden, not regrouped.
pickRunEstimateFunction#
The estimate a row shows: the session's own run (depth 0), or the
subagent named label (child-3). undefined when there is none.
pinnedSessionsFunction#
The sessions pinned now (each once, however many pins).
pinSessionFunction#
Keep key's transcript cached until the returned unpin runs.
planAuthCardFunction#
Plans the card of a failed sign-in: the provider's label, the stored credential that failed (by its id, else its account name, else the one in use when the failure names none), another OAuth account to switch to, and the Settings target.
positionSuffixFunction#
How a chip writes its position after the name: :12, :12:5, :12-20. Empty without one.
projectKeyOfFunction#
The project filter's key for a session: its folder's name, as a query's
projectName reads it (projectNameOf: / and `` both separate), so a
view saved from the filter matches the same sessions.
projectPathOfFunction#
The project a session is listed under: its repository's root, else its folder ('': none).
promptAttachmentsFunction#
Staged attachments as the wire's: the data:<mime>;base64, prefix
stripped. One that is not a base64 data URL is dropped: the model still
gets the text.
promptDraftOfFunction#
The prompt of a turn: a turn with several text blocks shows several prompts (joined back with a blank line); their attachments ride along.
promptRefsFunction#
The prompt's chips, for its echo: /<skill> tokens naming an activated
skill, @<path> mentions (zidane's inferPromptRefs, so every window
shows the same chips) and #<chat> tokens. Half-open spans, sorted.
readSidebarViewsFunction#
The views the Storage holds: the per-space map, else the legacy per-axis keys as the default space's view.
recentHostFoldersFunction#
A saved server's recent folders (its sessions' folders there), most recent first, each once.
recentLocalFoldersFunction#
This computer's recent folders, most recent first (the rows' order), each once.
reduceActivityFunction#
The next activity after signal; the same object when nothing a row shows changed, null once the run ended.
reduceCompactionFunction#
The progress after signal: null once the compaction ended, prev for any other signal.
refusedSpawnFunction#
A spawn the cap refused, as older recordings carry it: plain result text, not a failed call.
relativeTimeFunction#
How long ago, as short as it can say it: now, 5m, 3h, 2d, Mar 4, Mar 2024.
Only a duration reads with "ago" in a sentence (core ageStep says which).
rememberableChainFunction#
The chain to remember, null for nothing (no primary, or a primary only the server runs).
rememberedDefaultModelFunction#
The model remembered as the next new chat's, null when there is none.
The account comes as remembered: check the catalog still serves it.
rememberedPickFunction#
rememberableChain for a pick made on hostId (a server, or null for this computer).
repoGroupsFunction#
The group each repository's sessions share across machines, by repoKey. A
repository with one local folder groups under that folder: its sessions on
servers join it. A repository only on servers groups under its first
server folder, in key order. A repository with several local folders (two
clones) is left out: each folder keeps its own group, and so does each
server folder.
resetChipWorkForTestsFunction#
Test seam.
resolveBadgePanelFunction#
The panel an extension badge names, among the conversation's panels: the
extension's own (a bare id), a full <extension>/<id>, or a built-in.
null when it names none of them.
resolveChipPathFunction#
Absolute path for opening: relative chips resolve against cwd.
resolveGroupingFunction#
The grouping that applies: a contributed one the user picked, else the space's own (unless the
user picked a built-in one, VIEW_CHOICE), else the view's groupBy ('agent' as a query grouping).
resolveSortFunction#
The sort that applies: a contributed one the user picked, else the space's own (unless the user
picked a built-in one, VIEW_CHOICE). null: the view's sortBy.
rowTurnIdsFunction#
Every turn a painted row stands for (batches and folds see through to their members).
runsInRemoteSandboxFunction#
Whether the session runs in a sandbox on a provider's machines, deleted with the session.
safeSurrogateSliceFunction#
Slice n UTF-16 code units off the head of text, extending by one
if the cut would land between a high surrogate and its low surrogate
(core's takeChars).
Returns [head, tail]: caller decides what to do with each side.
n <= 0 yields ['', text]; n >= text.length yields [text, ''].
secretExpiryWordsFunction#
When a saved secret goes, in words.
secretTimeLeftFunction#
The time left until expiresAt, rounded to the unit a person reads: minutes under an hour, hours under two
days, then days.
secretTimeLeftIsoFunction#
secretTimeLeft for an ISO expiry, as a SecretReference carries it.
selectEditEventsFunction#
The events that carry a file edit, in order.
sendPromptFunction#
Sends one prompt from the composer. Rejects (the composer keeps the text)
when no provider is connected, /side is refused, or the session could not
be created; a refused send or enqueue shows its error in the transcript.
sessionForTokenFunction#
The chat a #token names: the one session whose id starts with it.
sessionRefsOfFunction#
Each session's SessionRef, by id.
sessionViewFunction#
A #chat chip's card: the title, the project, the model and context gauge, prompts and turns, the age.
settledResourceFunction#
The first settled value of a resource (subscribing starts its read).
shellCommandOfFunction#
The command of a ! prompt (the TUI's parseBashInvocation), '' for
any other prompt or a blank command.
shortUrlFunction#
https://www.github.com/a/b/ → github.com/a/b, ellipsized past max characters.
sidebarContributionsOfFunction#
The six sidebar token stores of an extensions host as one store: a new snapshot whenever one of them changes.
siteOriginFunction#
The http(s) origin a link's icon belongs to, or null when it has none.
skillNameFunction#
A skill's name in its chip text (/review, $review, review).
skillViewFunction#
A skill chip's card: the description and the size in tokens.
spaceMembershipFunction#
Which sessions a space lists, or null while spaces are off (every session). A session tagged
with the space is in it (an unknown tag reads as the default space); a space with a query also
lists the sessions it matches. The orchestration Main is in every space.
splitMarkdownFunction#
Splits markdown into chunks that parse on their own, so a long or streaming reply can re-render only its last chunk. Text shorter than the threshold comes back as one chunk.
stableSelectionFunction#
A selection that keeps returning the previous list while the new one holds the same items in the same order, so a reader re-renders only when an item changes.
stopForRowFunction#
The stop a painted row belongs to, or null for rows that are not selectable.
switcherSpacesFunction#
The switcher's spaces: the user's order first (ids it names), the rest in their own order, the hidden ones left out. The default space never hides, so the switcher always has one.
tickBucketFunction#
Compute how many chars to emit from bucket on this tick, at the pace
its backlog sets. Mutates bucket.carry so caller can repeatedly tick
without re-seeding. An empty bucket yields 0.
toolActionFunction#
The overview item for one tool call: the shared words, plus what the details show.
toolFailedFunction#
A tool call that failed: its result says so, or it is a spawn the cap refused in plain text (older recordings do not mark that as failed).
unsentDraftFunction#
A submit that was not sent (its chat could not be created) back as the
draft it came from: the box is cleared on Enter, so a failure must not
lose what was typed. The inverse of composeSubmitText.
urlRefsFunction#
The links in a text, as prompt spans (urls): where each starts and ends.
useReadableFunction#
Subscribes a component to a Readable and returns its current value, re-rendering when it changes.
viewFilterOfFunction#
The view layer's own narrowing: the agent, the origin and the contributed filters the space offers. null
when none applies.
viewFiltersOnFunction#
Whether the view narrows the space's sessions: an archive axis other than active, a project,
an activity window, an agent, an origin, or a contributed filter the space offers turned on. Grouping and
sort don't count.
whenChipsSettleFunction#
Resolves once no lookup is in flight, or after timeoutMs, whichever is first.
wireAttachmentsToChatFunction#
A sent prompt's attachments → staged ChatAttachments, for a draft that
re-stages them (Edit message). Data URLs stage as they are; a zg-media:
address (a PDF or text file served from the saved turn) is fetched and
re-encoded under the attachment's own media type, since the send path only
reads data URLs. Metadata-only chips (no address) and failed fetches drop.
wireOriginalFunction#
A converted attachment's original as the wire carries it, or undefined
when there is none (or its URL is not a base64 data URL).
withoutPartialFenceFunction#
Holds back a fence still arriving at the end of a streaming reply. Text
reveals a few characters a frame, so a closing ``` lands as `,
then ``: until the third, an open code block shows the partial
marker as one more line of code, then drops it, and the reply shrinks by
a line under a view following its bottom. A frame later the whole fence
is there.
withPinnedProjectFunction#
pins with fullPath pinned or unpinned in spaceId; the same object when nothing changes.
writableFunction#
A plain value store: the building block for simple hosts and fixtures.
Classes#
SessionStreamStoreClass#
External store backing all per-session reads. Mutates the underlying
Maps in place and notifies only the per-sessionId listeners that
actually subscribed to the changed session — that's what isolates
sibling sessions from each other's stream churn. Every write path
replaces the session's events array, so identity says whether anything
landed in between (the run-end compaction and scrollback guards rely on
it).
The reducer alone: createSessionStreams adds smooth-stream pacing,
lazy scrollback and run-end compaction around it.
Constants#
AGENT_GROUPINGConstant#
The agent grouping as a query grouping.
CHATS_BUCKETConstant#
The directory-less bucket's label ("pure chat" sessions, no project).
CHUNK_THRESHOLDConstant#
Below this, one parse is cheap enough: no chunking at all.
COMMON_EMOJIConstant#
Emoji grid — two dozen common project-marker choices. Ordered folders first (nearest to the default), then general dev/project glyphs.
DEFAULT_CHAT_LABELSConstant#
The default English strings of the chat layer, merged over the design system's labels. Override any of them through ChatProvider.
DEFAULT_COMPOSER_CHROME_LABELSConstant#
The strings of the chrome around the editor (run chip, pickers, dock, badges). Merged into DEFAULT_COMPOSER_LABELS.
DEFAULT_COMPOSER_LABELSConstant#
The default English composer strings.
DEFAULT_MODEL_PICKER_PREFSConstant#
The preferences before any change.
DEFAULT_SIDEBAR_LABELSConstant#
The default English strings of the session sidebar, merged over the chat layer's.
DEFAULT_SIDEBAR_VIEWConstant#
A view nobody changed yet.
DEFAULT_SWITCHER_PREFSConstant#
No arrangement yet: the spaces' own order, nothing hidden.
defaultFrameSchedulerConstant#
The browser's frames and timers, looked up on every call (so a test that
stubs requestAnimationFrame or fakes timers after the store exists is
still heard). Without requestAnimationFrame (a worker, Node) frame
returns null and the store paces on timers.
EMPTY_RUN_METERConstant#
The counters of a session with no run seen.
LIVE_BLOCK_RUN_LINESConstant#
Lines a live run keeps for its window.
MAIN_SESSION_ICON_KEYConstant#
Storage key for the orchestration Main session's icon. Not a path — the main is directory-less and one per store — but it lives in the same localStorage map so the picker, persistence and reset are shared.
MAX_EXTENSION_COMPOSER_BADGESConstant#
How many badges one extension shows in one composer (zidane's MAX_COMPOSER_BADGES).
MAX_ROW_CHIPSConstant#
The most chips a row shows, whatever the decorations add.
MODEL_PICKER_STORAGE_KEYConstant#
The Storage key the preferences live under.
NO_PROVIDER_ERRORConstant#
The thrown text when no provider can answer: the composer puts the prompt back.
NO_SIDEBAR_CONTRIBUTIONSConstant#
Nothing contributed.
PINNED_PROJECTS_KEYConstant#
Where the pins persist.
PROJECT_GROUP_CAPConstant#
Default number of sessions a project group shows before its "show more" row.
PROJECT_ICONS_KEYConstant#
Where the icon map persists.
REFERENCES_STORAGE_KEYConstant#
Where the caches persist.
RELATIVE_TIME_DATE_AFTER_DAYSConstant#
From this many days relativeTime shows a date (Mar 4), not a duration: pass it to core ageStep to know whether the label takes "ago".
SESSION_HISTORY_LIMITConstant#
The most entries a history keeps by default.
SIDEBAR_SPACE_KEYConstant#
Where the shown space persists.
SIDEBAR_SWITCHER_KEYConstant#
Where the switcher's own order and hidden spaces persist.
SIDEBAR_VIEW_KEYConstant#
Where the views persist: one map of space id → view.
SMOOTH_TICK_MSConstant#
Tick interval (ms). Matches one frame at 60fps.
VIEW_CHOICEConstant#
In SidebarExtensionView: the view's own axis (groupBy, sortBy) in a space that has a
grouping or sort of its own (an extension space, a saved view), where that one applies by default.
Interfaces#
AuthCardPlanInterface#
What the card offers for one failure, given the host's providers.
AuthFixesInterface#
The sign-ins fixed from a card, per session: every card for the same sign-in says so.
AuthSettingsTargetInterface#
Where the card's Settings button lands: the provider (or MCP server, integration) and the stored credential that failed.
BashExitMetaInterface#
Exit details of a shell command, parsed from its result text by parseBashExitMeta.
BuildQuerySidebarRowsOptionsInterface#
Options of buildQuerySidebarRows.
CalendarOptionsInterface#
Which calendar day labels are read in. Default: the runtime's zone and locale. Pin both when the same list renders on a server and in browsers (a prerendered page), or the two disagree about "Yesterday" and hydration fails.
ChatAttachmentInterface#
An attachment on a prompt, as the components can show it.
ChatAttachmentOriginalInterface#
The file a composer converted before sending (ChatAttachment.original).
ChatBadgeActionsInterface#
The badge menu's extension actions (badges:actions). Absent: the built-in actions only.
ChatBlockRunOptionsInterface#
How a run reports and stops.
ChatBlockRunsInterface#
Run here on a reply's shell blocks. Absent: blocks have no Run button.
ChatBlockRunTransportInterface#
What an adapter's transport offers for createChatBlockRuns.
ChatChipDetailsInterface#
What chip hover cards read when they open. Each method left out leaves its card with the chip's own text.
ChatCommandFactsInterface#
A command, as a command chip's hover card shows it.
ChatCommitInterface#
One commit, for a sha chip's hover card.
ChatContextFactsInterface#
A session's context gauge, as a #chat card shows it.
ChatHostInterface#
The seam between the chat components and whatever runs the agent: readable stores plus optional actions. A component hides the control for any capability the host leaves out.
ChatInteractionInterface#
A request from the agent that waits for the user: a question, a plan, or an approval.
ChatModelInterface#
A model a session can run.
ChatModelProviderInterface#
A provider and the models it offers, as the model picker groups them.
ChatPathsInterface#
What prose chips name on the session's disk.
ChatReferencesInterface#
Extension text references (ctx.registerReferences): the providers' patterns per folder and the views of the keys found.
ChatSearchStateInterface#
The transcript search of one session, as its windows share it.
ChatSearchSyncInterface#
The transcript search a session's windows share (the composer's ? mode).
ChatSessionInterface#
A session as the list shows it.
ChatSessionFactsInterface#
A session as a #chat chip's hover card shows it.
ChatSiteIconsInterface#
Site icons for link badges: one ask per origin, shared by every badge of the site.
ChatSkillFactsInterface#
A skill, as a skill chip's hover card shows it.
CommandArgSuggestionSummaryInterface#
Wire-safe projection of canonical CommandArgSuggestion.
CommandSummaryInterface#
Wire-safe summary of an extension-contributed / command — the
projection of canonical Command (src/chat/commands.ts) minus its
function-valued fields (steps, completeArgs).
CompactionProgressInterface#
A compaction's live progress.
CompactionProgressStoreInterface#
Every session's compaction in progress, outside React.
ComposerAgentProfileInterface#
An agent profile a folder offers.
ComposerAgentsInterface#
The agent profiles. Absent: the agent picker hides.
ComposerAttachmentInterface#
An attachment staged in a composer: always read into a data: URL, keyed for removal.
ComposerAutocompleteInterface#
Inline ghost-text autocomplete. Absent: no ghost text.
ComposerCommandArgsInterface#
The commands' fixed argument values, shared by everything that reads a
/command (the composer's badge, the transcript's prompt rows): what the
/ popover learns is noted here. The app keeps one; the rich composer takes
it as a prop.
ComposerCompletionsInterface#
The catalogs behind the composer's completions. Each one left out empties its popover.
ComposerContextInterface#
A session's meters. Each one left out hides what reads it.
ComposerContextStatusInterface#
A session's context gauge and what its model offers.
ComposerControlsInterface#
The pickers' writes on a session. Each one left out hides the control that needs it.
ComposerCostStatusInterface#
A session's total cost as last settled.
ComposerDraftsInterface#
The per-session draft every window of the app shares. Absent: each window keeps its own.
ComposerExtensionItemInterface#
One item an extension's completion offers.
ComposerExtensionProviderInterface#
An extension's completion trigger (a character that opens its popover).
ComposerFolderLocationInterface#
Where a folder sits: its checkout and the project it belongs to.
ComposerFoldersInterface#
The folder a new session opens in, remembered across launches.
ComposerHostInterface#
The rich composer's host. Every member is optional.
ComposerListsInterface#
The composer's lazily read completion lists, for one scope at a time.
ComposerListScopeInterface#
Where the composer reads: its folder ('': folderless, rooted at HOME), the session's file root, its server.
ComposerModelEntryInterface#
A catalog row with the options its model declares: what ComposerModels.catalog lists.
ComposerModelOptionInterface#
A feature toggle a model declares (fast mode, …).
ComposerModelsInterface#
The model catalogs, kept current.
ComposerPrefsInterface#
Where picks are remembered. Absent: they last for the page's life.
ComposerPrefsStateInterface#
The picks remembered across apps (the TUI's state.json).
ComposerPromptSuggestionInterface#
A next prompt the host suggests once a run ends.
ComposerRememberedModelInterface#
A model chain entry as remembered (state.json's lastModelChain).
ComposerRunProgressInterface#
A run joined midway, as its host counts it.
ComposerRunsInterface#
The current run's counters per session. Absent: no run chip.
ComposerScopeInterface#
Where a completion list comes from: the composer's folder and the host it runs on (null: this computer).
ComposerSessionViewInterface#
What the pickers read of a session (the desktop app's session rows fit it as they are).
ComposerSharedGhostInterface#
A ghost text another window resolved for a session's draft.
ComposerSuggestionsInterface#
Next-prompt suggestions. Absent: none are shown.
ConversationBadgeInterface#
A badge and what a click opens: a panel, the Running work dialog, or nothing (panel: null).
ConversationBadgeDataInterface#
One badge of the strip, as data (the kit's ComposerBadge without its click).
ConversationBadgeInputInterface#
What the strip is built from.
DeltaBucketInterface#
One owner's streamed text waiting to reveal.
DirectoryServerInterface#
A remote host as the directory follows it.
DirectorySettingsInterface#
The settings the directory reads.
DotStateInputInterface#
What deriveDotState reads.
DraftFolderSourceInterface#
A session row as recentLocalFolders reads it.
DraftFolderStateInterface#
What draftFolderPath and draftLocalFolder read.
DraftScopeInterface#
A draft's scope: where its terminals and layout attach.
DraftScopeStateInterface#
The draft's state, as DraftScopeStore holds it.
DraftScopeStoreInterface#
The draft's scope, readable (get returns the same state until it changes).
DraftScopeStoreOptionsInterface#
What createDraftScopeStore asks the app.
DrainPlanInterface#
Streamed markdown released from a smooth-stream bucket, applied by SessionStreamStore.applyDrainPlan.
EffortPickerTargetInterface#
What the effort picker sets for a session's model.
ExchangeFoldStatsInterface#
Counts shown on the summary line of a folded exchange.
FileChipInterface#
A path in prose, as a chip shows it: its kind, name, icon or language letters, and tone.
FileEntryInterface#
One row in the project file catalog. path is forward-slashed + relative to cwd.
FoldActionItemInterface#
One overview line of a folded exchange: a tool call, a run of thoughts, a worker, or a note.
FrameSchedulerInterface#
Frames and timers for the session stream store (see defaultFrameScheduler).
HostViewInterface#
One host, as the kit's host parts show it.
ImageModelRowInterface#
One image model, as the host lists it.
InboxSummaryInterface#
What the Inbox badge reads of the conversation's pending requests.
LazyListInterface#
A list read on demand.
ListableSessionInterface#
The minimal session shape the list model needs. ChatSession satisfies it.
LiveBlockRunInterface#
A run this window started: running, or one that could not run.
LiveCostStatusInterface#
The cost pill's figure: settled, accrued and streaming.
LiveStreamProgressInterface#
The streaming turn's live counters (stream:progress).
LoadEarlierOptionsInterface#
What SessionStreams.loadEarlier reports back.
ModelCatalogRowInterface#
One row of the catalog.
ModelKnobsInterface#
An effort and the enabled options.
ModelKnobsMemoryInterface#
What the store holds.
ModelKnobsStoreInterface#
The remembered knobs.
ModelNamesInterface#
How models and providers are named.
ModelNamesProviderInterface#
A provider as the sign-in report lists it.
ModelNamesStoreInterface#
The live names.
ModelPickerPrefsInterface#
The model picker's preferences.
ModelPickerPrefsStoreInterface#
The live preferences.
ModelPickRefInterface#
A model pick: provider, model and, when the provider has several, the stored account it runs on.
NewSessionDefaultsInterface#
What a new session starts with when its draft picks nothing else.
NewSessionRequestInterface#
The session newSessionRequest asks the app to create.
OpenFenceInterface#
A streaming chunk's fence that has not closed yet, apart from the text before it.
OtherStreamSignalInterface#
A signal of a kind the store does not reduce (compaction pings, cache breaks …): ignored.
OwnedInterface#
Every row carries the optional ownership metadata from its source
StreamEvent. childId + depth drive the subagent block grouping;
turnId drives select-turn mode highlighting.
PairingResultInterface#
The outcome of pairToolEvents.
PathResolverInterface#
The chip answers of one host.
PathResolverOptionsInterface#
Options for createPathResolver.
ProjectInSpaceInterface#
A project as one space lists it: its path (projectPathOf), the host it is on, the space.
PromptOriginInterface#
A prompt's origin, as the transcript reads it. Mirrors zidane's TextOrigin (src/text-origin.ts), without its messageId.
ReadableInterface#
The shape every chat host exposes its data in: read the current value and subscribe to changes.
ReferenceStoreInterface#
The reference cache of one host.
ReferenceStoreOptionsInterface#
Options for createReferenceStore.
ReferenceViewEntryInterface#
A view as cached: null names nothing; at is when it was resolved (0: stale).
RunEstimatesRowInterface#
What the store reads of a session row (noteRows).
RunEstimatesStoreInterface#
Every session's run estimates, outside React.
RunMeterInterface#
The run counters of every session.
RunMeterRowInterface#
A session row's word on its run (the session list's runStartedAt).
RunMeterStateInterface#
One session's run counters.
SelectStopsInterface#
The turns select-turn mode can stop on, and how any turn id maps to its stop.
SendAttachmentInterface#
An attachment as the composer staged it: dataUrl is the paste, drop or picker URL.
SendDraftInterface#
Where the new-chat draft runs, as newSessionRequest reads it.
SendFlowDepsInterface#
What the send flow sends through and writes to.
SendInputInterface#
What the composer sends to ChatHost.send.
SendPromptAttachmentInterface#
A prompt attachment on the wire: raw base64, no data: prefix.
SendRequestInterface#
One send from the composer.
SessionActivityInterface#
What a session's run is doing, as its row says it.
SessionActivityStoreInterface#
Every session's activity, outside React.
SessionBadgesEntryInterface#
One session's badges as a row shows them.
SessionBadgesSourceInterface#
Where the badges come from.
SessionBadgesStoreInterface#
Every session's badges, outside React.
SessionDirectoryInterface#
The session directory: its state, notifications and views, and the actions on them.
SessionDirectoryOptionsInterface#
Options of createSessionDirectory: the ports it reads and acts through.
SessionDirectorySourceInterface#
The sessions transport the directory reads and acts through (ChatHost.sessions).
SessionDirectoryStateInterface#
The directory's state as one snapshot: a new object whenever any field changes.
SessionDirectoryStreamsInterface#
The slice of the session stream store the directory keeps in step.
SessionFallbackModelInterface#
The model serving a run after it fell back from the one picked.
SessionHistoryInterface#
The window's page history, outside React.
SessionHistoryOptionsInterface#
Options of createSessionHistory.
SessionHistoryStateInterface#
The history as it is kept: its pages, oldest first, and the cursor.
SessionHistoryStoreInterface#
Where the history persists (the desktop app: main's database).
SessionListOptionsInterface#
Options for buildSessionRows.
SessionNotificationStoreInterface#
The notifications by session, subscribed to per session.
SessionPageStateInterface#
Lazy-scrollback bookkeeping for one session: where the hydrated window
starts (firstSeq — the beforeSeq for the previous page), whether
older turns exist, and an in-flight guard so wheel spam near the top
can't stack duplicate page fetches.
SessionRefInterface#
How a reference names a session: its title, and its folder's name when it has one.
SessionRetryStateInterface#
A provider stream being retried.
SessionSearchHitInterface#
A conversation whose content matched a search.
SessionStreamActionsInterface#
The bound writes of a SessionStreams, from createSessionStreamActions.
SessionStreamPageInterface#
One page of a session's persisted transcript (the tail, or the page before a sequence number).
SessionStreamsInterface#
The session stream store with pacing, scrollback and compaction. Created by createSessionStreams.
SessionStreamsOptionsInterface#
Options for createSessionStreams.
SessionStreamStoreOptionsInterface#
Options for SessionStreamStore.
SessionStreamWriteInterface#
One write to a session's window, see SessionStreamStore.write.
SharedDraftInterface#
A session's shared draft, as another window left it.
SharedDraftAttachmentsChangeInterface#
The staged files of a draft written in another window.
SharedDraftChangeInterface#
A draft written in another window.
SidebarContributionsInterface#
What the extensions contribute to the sidebar, per token.
SidebarEnvironmentHostInterface#
The commands of the environment a session runs in (push the branch, open a pull request).
SidebarExtensionViewInterface#
The user's layer over what extensions contribute to the filter menu, kept per space with the rest
of the view. Ids are the published ones (<extension>/<id>); an id no extension offers now is ignored.
SidebarHostInterface#
The sidebar's platform capabilities. Every member is optional.
SidebarItemEntryInterface#
Extension items grouped with their child sessions, as the rows place them.
SidebarListSessionInterface#
One session as the sidebar lists it: the chat session plus where it runs (folder, host, space). An app's own row type extends it.
SidebarQueryLayerInterface#
The query layer of the space shown, as the sidebar's parts read it: the space, the view, the grouping and sort that apply, and what the extensions contribute to this space.
SidebarRowChipInterface#
A chip a decoration puts on a row, its template rendered.
SidebarRowDecorationInterface#
What the decorations matching one session put on its row.
SidebarSpaceInterface#
A space as the sidebar lists it: a user space, or an extension's (extensionId, read-only), with
the base query, grouping and sort a query space carries.
SidebarViewInterface#
The filter axes, kept per space.
SidebarViewsInterface#
The sidebar's views and shown space, outside React.
SidebarViewsHostInterface#
The views the host keeps for this user, next to the device's Storage.
SidebarViewsOptionsInterface#
Options of createSidebarViews.
SkillConfigInterface#
A parsed skill: its frontmatter fields, instructions and origin.
SpaceSwitcherPrefsInterface#
The user's arrangement of the space switcher, over the spaces' own order: extension spaces included, which Settings › Spaces doesn't list.
ToolPairingInterface#
The result paired with one tool call.
TranscriptInterface#
A readable store of one session's TranscriptState.
TranscriptStateInterface#
The state a Transcript store holds for one session.
TurnPromptDraftInterface#
A sent prompt as a draft: its text and attachments.
WritableInterface#
A Readable you can also write to.
Types#
BuildSidebarRowsOptionsType#
The list options buildSidebarRows passes through.
ChatEventType#
zidane's canonical transcript event, plus what a live client knows and a
replay does not: attachment previews, arrival times, clipped outputs and
thinking durations. Every extra is optional; a replayed StreamEvent
list is a valid ChatEvent list.
ChatLabelsType#
The shape of the chat label dictionary: every key of DEFAULT_CHAT_LABELS. Some values are functions that build a string.
ChatReferencesChangeType#
What made the host's references change.
ChatResolvedPathType#
What a name in prose points at: a file or folder on disk, a git branch of the repo, or nothing. candidates:
everything a bare name matched when it matched several, best first (path is the first's).
ChatSessionStatusType#
Run state of a session: idle, running, completed, or error.
ChipResolutionType#
null: not known yet, or the folder can't be checked (sandboxes).
ChipViewLabelsType#
The labels the views read.
ClusterType#
A transcript row, or a subagent block. A block's rows are the worker's
OWN rows (its header reads its lifecycle off them); body is what the
block paints in order — those rows as singles, plus the blocks of the
workers it started, nested where they ran.
CompactionSignalType#
The stream signals a compaction's progress follows; any other kind is ignored.
ComposerCacheImpactType#
What a switch would cost the session's prompt cache.
ComposerCacheImpactChangeType#
A switch a picker would make: what its cache estimate is asked for.
ComposerChromeLabelsType#
The chrome's strings.
ComposerContextBreakdownType#
What ContextBreakdown renders.
ComposerDraftAttachmentsListenerType#
Hears another window's staged files for a draft.
ComposerEffortType#
A reasoning effort level.
ComposerLabelsType#
Every composer string.
ComposerModeType#
Composer prompt modes — pure state-machine helpers for the ! (shell)
and ? (transcript search) sentinels, mirroring the TUI's grammar
(src/tui/prompt/ useSyncBuffer / usePromptKeyDown):
- Entry: the sentinel must be TYPED as the first character of an
empty composer (exactly-one-char transition — pasted/recalled
!cmdstays literal text). The sentinel is consumed; it never enters the buffer. - Exit: Backspace with the caret at offset 0 leaves the mode (search also exits on Delete-at-0 and on Esc; shell does NOT exit on Esc — TUI parity).
- Submit (shell): the bang is re-attached (
!cmd) so the host routing and prompt history keep the TUI's on-disk grammar; a blank command is a no-op. - History:
!-prefixed entries recall INTO shell mode with the bang stripped; stashing a shell-mode draft re-encodes the bang.
Kept free of TipTap/React so the grammar is unit-testable.
DotVariantType#
The status dot a row shows, chosen by dotVariantFor: a row kind, a tool state, or a session event status.
FileChipKindType#
What a path in prose names: a folder or a file.
FoldActionStateType#
waiting: a spawn call that has not started yet, every slot being taken.
GroupClusterType#
A subagent block: the group member of Cluster.
HostStatusType#
A host's connection. local: This computer, always reachable. The rest
mirror the TUI's statuses (identity: a different server answers at the
saved URL; version-mismatch: it speaks another protocol version).
ModelPickerPrefsStorageType#
Where the preferences are stored.
PinsBySpaceType#
Pinned folder paths per space id, in pin order.
ProjectIconType#
A folder's icon: an emoji, or a small image as a data URL.
ProjectIconMapType#
Icons by folder path.
RowType#
One row of the transcript model. The kind field says what it is: a prompt, assistant markdown, thinking, a tool call, a notice, a worker marker, or a synthetic group such as tool-batch or exchange-fold.
RunEstimatesSignalType#
The stream signals the store follows; any other kind is ignored.
RunFailureType#
How a run ended early and how to pick it back up: cause (error or aborted), resume (continue or retry), and the prompt to resend on retry.
RunMeterSignalType#
The stream signals the meter follows (the host's HostSignal variants, structurally).
SecretTimeLeftType#
How long a saved secret has left.
SessionActivityFilterType#
Only sessions touched within the last day, 3, 7 or 30 days.
SessionActivitySignalType#
The stream signals the activity follows; any other kind is ignored.
SessionArchiveFilterType#
Which sessions the list reads: the archive axis is the one the host filters.
SessionGroupByType#
How the list groups sessions: none (flat), date, state, or project.
SessionHistoryDirectionType#
Which way to move.
SessionHistoryPageType#
A page of the history: a session, or null for the new-chat draft.
SessionListRowType#
One row of the flat list buildSessionRows returns: a group header, a session, or a showMore row that ends a capped group.
SessionNotificationType#
What a finished run left on a session the user wasn't watching.
SessionRemovalType#
What deleting a session did with its environment.
SessionSortByType#
How sessions are ordered inside a group: recency (last activity, newest first), createdTime (newest first), or alphabetical by title.
SessionStreamSignalType#
The live signals the session stream store reduces: zidane's host signals
for one session (the desktop app's chat:stream channel, zidane-server's
signals). Any other signal kind is ignored.
SessionWindowModeType#
What a standalone window shows: the conversation with its panels, the conversation alone, or the panels alone.
SetDefaultModelType#
Sets the app's default model (the next new chat's); persist: false holds it for this window only.
SidebarContributionStoresType#
The token stores sidebarContributionsOf reads.
SidebarDotStateType#
What a session's dot says (StatusDot draws it).
SidebarGroupByType#
How the sidebar groups its rows: the session list's groupings, one section per host, or one group per agent.
SidebarGroupingType#
How the rows group: one of the built-in groupings, or a query grouping (a space's, an extension's, the agents').
SidebarLabelsType#
The sidebar's strings, as DEFAULT_SIDEBAR_LABELS has them.
SidebarLastSessionsType#
The conversation last open per space id.
SidebarListRowType#
One row of the sidebar: a session-list row (a header may name its host) or a host's section header.
SidebarNodeType#
What the sidebar list renders: a session or "show more" row, or a section,
a header and the rows under it, drawn as its own <ul> so the header
sticks while they scroll by and the next section pushes it out.
SidebarOriginType#
The Origin filter: the sessions a reminder started (scheduleId set), or the others.
SidebarSortByType#
How the sidebar orders sessions inside a group.
SidebarViewMapType#
Views per space id.
SidebarViewRecordType#
A space's record as stored: its view, plus the conversation last open in it (session, when one was).
SidebarViewsStorageType#
The Storage the views persist in (localStorage in a browser).
SpawnMetaType#
Structured subagent lifecycle metadata, as carried on StreamEvent.spawn.
ToolRowModelType#
A paired tool call's row: what ToolRow, ToolDetails and the ToolBody slot read.
Re-exports#
These names are documented on the entry point that owns them.