Skip to content

zidane-ui/extensions/headless

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

Functions#

clampSettingNumberFunction#

Clamps and snaps a number the way zidane does (clampExtensionConfigNumber), so a typed value persists the same from every client.

createDialogQueueFunction#

Creates an empty DialogQueue.

createEffectRouterFunction#

Creates an ExtensionEffectRouter over a host's effects.

createUiEffectChannelFunction#

Creates a UiEffectChannel.

createWebviewRpcBridgeFunction#

Creates the bridge for one webview page.

extensionsErrorOfFunction#

The typed error behind any rejection: an ExtensionsHostError's own, else failed with the message.

filterSelectOptionsFunction#

The options whose label, description or group contains every word of query (case-insensitive).

groupSelectOptionsFunction#

Options grouped in first-seen group order; ungrouped options come first under group: undefined.

isSettingLockedFunction#

Whether a declarative config entry sets this setting (shown, not editable).

isWebviewRpcRequestFunction#

Whether data is a well-formed bridge request.

missingScopeFunction#

The scope an action needs that this client's token lacks, or null when it may run it: the token grants granted (null or absent: not limited, as a local or in-process host), the action needs required (default admin, as zidane's).

openInNewTabFunction#

Opens url in a new browser tab (in the desktop app, main's window-open handler hands it to the system): the app's way for a web link.

qualifyPanelIdFunction#

The full id of a panel an extension names: <extension>/<id> when that extension has one by that id, else the id as given (already full, or a built-in tab such as todos).

rendererMatchesFunction#

Whether a renderer draws target. Languages compare case-insensitively; a renderer for several tools draws each of them, and one for '*' draws every tool. A block id matches as given or, with extension, under the extension that registered the renderer (<extension>/<id>, the form CommandOutputBlock.custom.renderer and PanelCustomItem.renderer carry).

renderersForFunction#

The renderers for target, in the host's order: the first draws, the next ones take over when a fallthrough renderer draws nothing.

Opens url: through the extensions' link handlers first, else fallback (the app's own way). Resolves true when a handler opened it. A handler that fails counts as not opening it.

settingsValuesFunction#

Every row's starting value, by extension then key.

settingValueFunction#

The value a row shows: the stored value when its type fits, else the default.

slotIsActionableFunction#

Whether a slot item does something on click: opens a panel or runs a command.

slotItemsFunction#

The slot items for one place, lowest order first (stable). Items scoped to a session show only beside that session; unscoped items show everywhere. A transcript.turn-end item that names a turn shows only after that turn (turnId); one that names none, only where no turn is given (the end of the transcript).

titlebarItemsFunction#

The app.titlebar items, lowest order first, at most TITLEBAR_ITEMS_PER_EXTENSION per extension (its first ones in that order).

Classes#

ExtensionsHostErrorClass#

What a host action rejects with.

Constants#

DEFAULT_EXTENSIONS_LABELSConstant#

The default English strings of the extensions components.

EXTENSION_TOKENSConstant#

Every token the kit draws, in a fixed order.

SLOT_NAMESConstant#

Every slot name, in a fixed order.

TITLEBAR_ITEMS_PER_EXTENSIONConstant#

How many app.titlebar items one extension shows: as many as its composer badges.

WEBVIEW_RPC_NOT_ALLOWEDConstant#

Error type for a contract the webview does not list.

WEBVIEW_RPC_REQUESTConstant#

The type of a request the page posts.

WEBVIEW_RPC_RESULTConstant#

The type of the reply the bridge posts.

WEBVIEW_RPC_UNAVAILABLEConstant#

Error type when the host offers no RPC.

Interfaces#

DialogQueueInterface#

A dialog queue: the stores the UI reads, and the entry the backend calls.

DialogQueueShowContextInterface#

Where a request comes from.

ExtensionCallbacksInterface#

The extension callbacks a host can invoke, by id: their arguments and what they answer.

ExtensionCommandsInterface#

The unified commands.

ExtensionCommandWireInterface#

A command on the wire: zidane's CommandListing, plus what a palette shows.

ExtensionDialogInterface#

A dialog waiting on the user.

ExtensionDialogsInterface#

ctx.ui dialogs routed to this client. A dialog the extension withdraws (timeout, abort) leaves the stores without an answer.

ExtensionEffectRouteInterface#

One route: what it applies, and which effects it takes.

ExtensionEffectRouterInterface#

An effect router.

ExtensionIntegrationConnectionWireInterface#

One account connected to an integration.

ExtensionIntegrationsInterface#

Integrations: Settings' Connect, Disconnect and default account.

ExtensionIntegrationWireInterface#

An integration on the wire: its spec without callbacks, and its connections.

ExtensionItemInterface#

One contribution: zidane's UiEntry.

ExtensionLinkRequestInterface#

A link the user opened, as ExtensionsHost.openLink offers it to the extensions' link handlers.

ExtensionPanelChangeInterface#

A panel that would load something new: its subscribe emitted, or its handle was updated.

ExtensionProvenanceWireInterface#

Who changed a catalog item (Settings shows it): zidane's CatalogItemProvenance, with the catalog it is in.

ExtensionRpcOptionsInterface#

Options of ExtensionsHost.rpc.

ExtensionSettingsInterface#

The extensions' settings.

ExtensionSettingsWireInterface#

Every extension's settings, as Settings draws them.

ExtensionsHostInterface#

The extensions host.

ExtensionStorageInterface#

The extensions' typed stores, as the UI reads and writes them.

ExtensionStoreRefInterface#

One typed store of an extension (ctx.storage.store).

ExtensionUiEffectRequestInterface#

An effect and the id its result goes back under.

ExtensionUiEffectsInterface#

The ctx.ui / ctx.composer calls routed to this client, for the app to apply.

ExtensionWebviewsInterface#

Where the extensions' webviews load from: the app's origin policy, so every webview the kit draws follows it.

ExtensionWireMapInterface#

The wire form of each token the kit draws, by token name.

LinkRouteOptionsInterface#

Where and how a link was opened.

UiEffectChannelInterface#

An effect channel.

WebviewRpcBridgeInterface#

A bridge for one page.

WebviewRpcBridgeOptionsInterface#

Options of createWebviewRpcBridge.

WebviewRpcRequestInterface#

A request from the page.

Types#

BadgeActionWireType#

Badge actions, and the badges they apply to: zidane's BadgeActionWire (zidane/extensions).

ComponentWireType#

A component an item names, an export of the extension's ui.tsx bundle and its JSON props: zidane's ComponentWire (zidane/extensions).

ContextSectionWireType#

A context breakdown or context panel section: zidane's ContextSectionWire (zidane/extensions).

DialogKindType#

The kinds of DialogRequestWire.

DialogRequestWireType#

A dialog ctx.ui asked for, by kind: zidane's DialogRequest (zidane/extensions). A form's settings holds the initial values, and its answer is a value per key.

ExtensionAccessScopeType#

The least client token scope that may run something (chat ⊂ approve ⊂ admin): zidane's AccessScope, the scope of an action setting.

ExtensionCallbackIdType#

A callback id.

ExtensionComposerFileType#

A file ctx.composer.attach sends: a path, or bytes in base64.

ExtensionEffectApplyType#

Applies one effect. A throw or a rejection reports "did nothing".

ExtensionEffectOutcomeType#

What applying an effect gave: whether it did, the open panel ids for panel-state, nothing for notify.

ExtensionItemStoresType#

The items of every token, each a store.

ExtensionLinkSourceType#

Where a link was clicked: zidane's LinkSource.

ExtensionNavigateTargetType#

Where ctx.ui.navigate goes. Screen ids are full (<extension>/<id>).

ExtensionsErrorType#

Why a host call failed, for the UI to word through its labels.

ExtensionsLabelsType#

The shape of the extensions label dictionary.

ExtensionTokenNameType#

A token the kit draws. (Native menus are the desktop app's own.)

ExtensionUiEffectType#

One ctx.ui / ctx.composer call for the app to apply: zidane's UiClientPort calls.

ExtensionUiEffectResultType#

What applying an effect gave: whether it did, the open panels, or nothing for a notification.

LinkHandlerWireType#

A link handler (its match and open stay with the extension): zidane's LinkHandlerWire (zidane/extensions).

PanelWireType#

A side or home panel (its load, onAction and subscribe stay with the extension): zidane's PanelWire (zidane/extensions).

RendererTargetType#

What a renderer draws: a custom block id, a code-block language, a tool's result, or an artifact kind's detail.

RendererWireType#

A renderer: a component, with a markdown fallback: zidane's RendererWire (zidane/extensions).

ScreenWireType#

A full-screen view, or a modal: zidane's ScreenWire (zidane/extensions).

SelectOptionWireType#

One option of a select dialog.

SettingsPageWireType#

A Settings page under an extension: zidane's SettingsPageWire (zidane/extensions).

SettingValueType#

A setting's value as a form holds it.

SidebarDecorationWireType#

Extra data on the rows of matching sessions: zidane's SidebarDecorationWire (zidane/extensions).

SidebarFilterWireType#

A filter an extension offers in every space's filter menu: zidane's SidebarFilterWire (zidane/extensions).

SidebarGroupWireType#

A grouping an extension offers in the filter menu: zidane's SidebarGroupWire (zidane/extensions).

SidebarRowActionWireType#

One action of a sidebar row's menu: zidane's SidebarRowActionWire (zidane/extensions).

SidebarRowWireType#

A row an extension lists among a space's sessions: zidane's SidebarRowWire (zidane/extensions).

SidebarSortWireType#

A sort an extension offers in the filter menu: zidane's SidebarSortWire (zidane/extensions).

SlotNameType#

The places every app knows. An app without the place ignores the item.

SlotWireType#

A small item in a slot: a status line, a banner, a composer badge: zidane's SlotWire (zidane/extensions).

SpaceWireType#

A space an extension adds to the switcher, with its base query: zidane's SpaceWire (zidane/extensions).

WebviewRpcResultType#

The reply to a request.

WebviewWireType#

A sandboxed web page in a panel or a screen (a file source is relative to the extension's folder): zidane's WebviewWire (zidane/extensions).

WireSettingsType#

Everything a Settings UI needs to draw settings (values without secrets, locked keys as extension:key): zidane's WireSettings (zidane/extensions).

WireSettingsPageType#

One page of an extension's settings in the settings sidebar: zidane's WireSettingsPage (zidane/extensions).