zidane-ui/ views/ headless
import { … } from 'zidane-ui/views/headless'ui/src/views/headless/index.ts
Functions#
canCopyImagesFunction#
Whether this browser can put an image on the clipboard.
copyViewImageInBrowserFunction#
Puts a view on the clipboard as a PNG: its own content at its full size, never the screen. The item is made at once with the image still drawing, so the click that asked for it still counts (Safari).
createCustomSlotsFunction#
Creates a slot pool.
createViewRecordsFunction#
Creates the records cache of host.
createViewsHostFunction#
Creates a ViewsHost over backend.
createViewStateControllerFunction#
The state of one view.
downloadInBrowserFunction#
Hands file to the window's download.
fenceViewOfFunction#
The fence view at this anchor, or undefined.
fillThemeVarsFunction#
SVG markup with every var(--name) replaced by the theme's value, and
currentColor by the text color, so it draws the same as an image (an
image cannot read the page's CSS variables). Scripts and event handlers
are left in: an <img> never runs them.
heightForFunction#
The stored height for this container width: the range it falls in, else
the range nearest to it. undefined when none is stored.
savedStoredViewFunction#
The view a saved version holds, as a stored view: its anchor is the turn that made it.
streamFenceFunction#
The fence at key parsed up to source. The parser for key is held
(at most VIEW_PARSERS_MAX), so the next call reads only the new
text, and a fence that closes is finished by the parser that streamed it.
The result keeps its identity while its parts do.
textlessExchangesFunction#
The exchanges whose agent wrote no top-level reply text (a codemode run
that ends on its tool calls). viewPlacements gives such an
exchange no reply row, so its unplaced codemode views need another place
(docs/VIEWS.md, Life of a view: a view the reply does not place shows
with the exchange).
unplacedCodemodeViewsFunction#
The codemode views of these turns that no reply placed, and their MCP apps (docs/VIEWS.md, MCP Apps: drawn above the reply too), oldest first.
viewAnswerKeyFunction#
zidane-ui/views/headless: the views host (ViewsHost), the builder
hosts use over their transport (createViewsHost), and the React-free
models the view components read: where views sit in a transcript, the
records cache, the streamed parse, the client's safety checks and the
labels.
viewByIdFunction#
The view with this id, or undefined.
viewPlacementsFunction#
The reply rows of a transcript, keyed by row id (m-<turnId>-<n>, as the
transcript pipeline names them), with where their views go. A place that
did not change keeps its identity from previous, so a row reading it
does not draw again.
viewReadsRefsFunction#
The view reads refs or data from codemode: Refresh can run it again with fresh values.
viewRecordsOfFunction#
The one records cache of host.
viewsErrorFunction#
A typed error out of anything a call threw: a host that cannot refresh
views or a saved view (data.reason), refused params (JSON-RPC invalid params), else
failed with its message.
viewStateOfFunction#
The state of view ref at version: one per view and
version, kept while the transcript scrolls (an LRU of
VIEW_STATES_MAX views per host). A new version (an update, a
refresh) starts with the reader's values of the version before, when
they still fit it.
viewVersionFunction#
A view's version: it changes when the stored tree changes (a refresh, or a script's view.update).
widthRangeFunction#
The width range a container width falls in.
withHeightFunction#
The stored heights with this width's range set to height, or null
when that range already holds it (within a pixel).
Classes#
ViewAnswersClass#
The answers of one transcript, per input.
Constants#
customSlotsConstant#
The app's one pool: every Custom frame of every view shares it.
DEFAULT_VIEWS_LABELSConstant#
The default English strings of the view components. Override any of them through LabelsProvider.
VIEW_PARSERS_MAXConstant#
Most fences whose parser stays held between renders.
VIEW_PROBLEM_REPORTS_MAXConstant#
Most problems one view sends to the host.
VIEW_RECORDS_MAXConstant#
Most records one host's cache keeps.
VIEW_STATE_DEBOUNCE_MSConstant#
Quiet time after the last change before a tree is asked of the host.
VIEW_STATE_TREES_MAXConstant#
Trees one view keeps that the host ran on demand.
VIEW_STATES_MAXConstant#
Views whose state one host keeps.
VIEW_WIDTH_STEPSConstant#
Container widths where a view's stored height changes, in CSS pixels.
Interfaces#
CustomFrameInterface#
One live Custom page, in its own sandboxed process (desktop: a
<webview>; web: an iframe with sandbox="allow-scripts" from a ticket
route). The caller puts element in the view and calls dispose once.
CustomFrameRequestInterface#
What a Custom frame is asked for: one <Custom> node of a stored view.
CustomSlotHolderInterface#
What holds or waits for a slot.
CustomSlotsInterface#
The slot pool.
McpAppFileInterface#
A file an MCP app asks to save (ViewsHost.downloadFile).
ReplyViewPlaceInterface#
What one reply row needs to find its views.
SavedViewMetaInterface#
A saved view's meta: what lists and pins read without a record.
SavedViewRecordInterface#
One version of a saved view: a full record (docs/VIEWS-SAVED.md, Identity and storage).
SavedViewVersionInterface#
One kept version, without its record (views.savedVersions).
StoredViewInterface#
A stored view plus its anchor.
StreamedFenceInterface#
A fence parsed so far.
TextlessExchangeInterface#
An exchange with no reply text: its codemode views draw after its last row.
ViewAnswerInterface#
An answer the user sent from a view's input.
ViewImageOptionsInterface#
How a view becomes an image (copyViewImageInBrowser).
ViewImageRequestInterface#
One view to copy as an image (ViewsHost.copyImage), exactly as it shows now.
ViewRecordsInterface#
The records cache of one host.
ViewsBackendInterface#
What a transport offers. Each member left out leaves the host member that needs it out. A
member about one view gets a session ref only: the host refuses a saved one before it. A
backend with getSaved also gets saved refs in setHeights, setState and customFrame.
ViewSessionActionOptionsInterface#
How a session action runs (ViewsHost.sessionAction, docs/VIEWS-ORCHESTRATION.md).
ViewsHostInterface#
The views host.
ViewsMetaStateInterface#
The view meta of one session, as a store holds it.
ViewStateControllerInterface#
The state of one view.
ViewStateOptionsInterface#
What a controller needs.
ViewStateSnapshotInterface#
What a view with state draws now.
Types#
CustomFrameEventType#
What a Custom page tells its frame, each message checked: its content height, a problem, and on real input a link to open, an image for the lightbox, or a chord for the app's shortcuts.
FrameImageType#
The image of a running page the DOM cannot draw (a desktop <webview>, an
iframe), as a data URL, or null to show its stored image instead.
McpAppRequestMethodType#
What an MCP app may ask its own server through its host (ViewsHost.appRequest).
RasterizeSvgType#
Turns the SVG markup of a capture into a PNG. Replaced in tests.
SessionCustomFrameRequestType#
A Custom frame request of a session view: what a backend gets.
StreamedPartType#
One top-level part of a streamed fence.
ViewActionOutcomeType#
What a view's Action with a tool came to (ViewsHost.runAction).
ViewNodeAddressType#
One extension node of a view that ViewsHost.resolve asks live data for.
ViewRecordStateType#
What the cache knows about one record.
ViewRefType#
One view: a view of a session, or a saved view (no version: the latest).
ViewsHostErrorType#
Why a views call failed, for the UI to word through its labels.
ViewsLabelsType#
The strings of the view components.
ViewsResultType#
What a views call answered.