# zidane-ui/extensions

Import: `import { … } from 'zidane-ui/extensions'`. Source: [ui/src/extensions/index.ts](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/index.ts).

## Components

### `ExtensionComponent`

Component.

Draws an extension component behind an error boundary, with the item's fallback in its place when it can't.

```ts
function ExtensionComponent(props: ExtensionComponentProps): Element
```

**Parameters**

- `props` (`ExtensionComponentProps`): The extension, the component reference, extra props and the fallback.

**Returns** `Element`

**Props**

- `component` (`ComponentWire`): The component the item names.
- `extension` (`string`): The extension whose `ui.tsx` exports the component.
- `fallback` (`ReactNode`): What shows while loading, without a component, and after a throw: the item's data or markdown.
- `props?` (`Readonly<Record<string, unknown>>`): Props passed over the item's own (the data a renderer draws, a slot's session).

Source: [ui/src/extensions/ExtensionComponent.tsx:156](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionComponent.tsx#L156)

### `ExtensionComponentsProvider`

Component.

Supplies the loader [`ExtensionComponent`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionComponent) resolves components through. `ExtensionsProvider`'s `loadModule` mounts one.

```ts
function ExtensionComponentsProvider(props: ExtensionComponentsProviderProps): Element
```

**Parameters**

- `props` (`ExtensionComponentsProviderProps`): The loader and the children.

**Returns** `Element`

**Props**

- `children` (`ReactNode`): The subtree that resolves extension components through the loader.
- `loadModule` (`ExtensionModuleLoader`): Loads an extension's `ui.tsx` module. Each extension's module loads once per loader.

Source: [ui/src/extensions/ExtensionComponent.tsx:75](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionComponent.tsx#L75)

### `ExtensionDialogHost`

Component.

Shows routed dialogs on the modal layer and toasts in place. Renders nothing without `host.dialogs`.

```ts
function ExtensionDialogHost(props: ExtensionDialogHostProps): Element | null
```

**Parameters**

- `props` (`ExtensionDialogHostProps`): `className` and `style` of the toasts' region.

**Returns** `Element | null`

**Props**

- `className?` (`string`): Extra classes on the toasts' region.
- `style?` (`CSSProperties`): Inline styles on the toasts' region.

Source: [ui/src/extensions/ExtensionDialogHost.tsx:55](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionDialogHost.tsx#L55)

### `ExtensionDialogView`

Component.

One dialog's surface, in a `ModalShell` (render it on the modal layer). Toasts aren't drawn here.

```ts
function ExtensionDialogView(props: ExtensionDialogViewProps): Element | null
```

**Parameters**

- `props` (`ExtensionDialogViewProps`): The dialog and the answer callback.

**Returns** `Element | null`

**Props**

- `dialog` (`ExtensionDialog`): The dialog to show.
- `onAnswer` (`(answer: unknown) => void`): Answers it (`undefined` cancels): the shape per kind is `ExtensionDialogs.answer`'s.

Source: [ui/src/extensions/ExtensionDialogHost.tsx:155](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionDialogHost.tsx#L155)

### `ExtensionRenderer`

Component.

Draws `for` with the first extension renderer that draws it, else the default view or the markdown fallback.

```ts
function ExtensionRenderer(props: ExtensionRendererProps): Element
```

**Parameters**

- `props` (`ExtensionRendererProps`): The target, the data, the default view or markdown fallback, `className` and `style`.

**Returns** `Element`

**Props**

- `className?` (`string`): Extra classes on the root.
- `data?` (`Readonly<Record<string, unknown>>`): Props the renderer's component gets over its own: the data to draw (the code, the tool result…).
- `defaultView?` (`ReactNode`): What the place draws without extensions, drawn instead of the markdown `fallback` when no renderer
  draws and in place of one that can't. Use it where the fallback markdown would route back here (a
  fenced block whose language has a renderer).
- `fallback?` (`string`): Markdown drawn when no renderer draws, and in place of one that can't (unless `defaultView` is given).
- `for` (`RendererTarget`): What needs drawing: `{ block }`, `{ language }`, `{ tool }` (one tool name) or `{ artifact }`.
- `style?` (`CSSProperties`): Inline styles on the root.

Source: [ui/src/extensions/ExtensionRenderer.tsx:44](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionRenderer.tsx#L44)

### `ExtensionScope`

Component.

Marks the subtree as an extension's UI, for the author hooks. [`ExtensionComponent`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionComponent) sets it; set it yourself to host an extension's UI some other way.

```ts
function ExtensionScope(props: ExtensionScopeProps): Element
```

**Parameters**

- `props` (`ExtensionScopeProps`): The extension and the children.

**Returns** `Element`

**Props**

- `children` (`ReactNode`): The subtree the extension's UI renders in.
- `extensionId` (`string`): The extension whose UI this is.

Source: [ui/src/extensions/ExtensionComponent.tsx:97](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionComponent.tsx#L97)

### `ExtensionScreen`

Component.

Draws one extension screen's body, or why there is none.

```ts
function ExtensionScreen(props: ExtensionScreenProps): Element
```

**Parameters**

- `props` (`ExtensionScreenProps`): The screen id, `className` and `style`.

**Returns** `Element`

**Props**

- `className?` (`string`): Extra classes on the root.
- `id` (`string`): The screen's full id (`<extension>/<id>`).
- `style?` (`CSSProperties`): Inline styles on the root.

Source: [ui/src/extensions/ExtensionScreen.tsx:36](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionScreen.tsx#L36)

### `ExtensionSettingsPage`

Component.

Draws one extension settings page. Draws nothing when no extension offers `id`.

```ts
function ExtensionSettingsPage(props: ExtensionSettingsPageProps): Element | null
```

**Parameters**

- `props` (`ExtensionSettingsPageProps`): The page id, `className` and `style`.

**Returns** `Element | null`

**Props**

- `className?` (`string`): Extra classes on the root.
- `id` (`string`): The page's full id (`<extension>/<id>`).
- `style?` (`CSSProperties`): Inline styles on the root.

Source: [ui/src/extensions/ExtensionSettingsPage.tsx:37](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsPage.tsx#L37)

### `ExtensionSettingsPages`

Component.

Draws the extension settings pages and the `settings.section` slot.

```ts
function ExtensionSettingsPages(props: ExtensionSettingsPagesProps): Element | null
```

**Parameters**

- `props` (`ExtensionSettingsPagesProps`): `className` and `style`.

**Returns** `Element | null`

**Props**

- `className?` (`string`): Extra classes on the root.
- `style?` (`CSSProperties`): Inline styles on the root.

Source: [ui/src/extensions/ExtensionSettingsPages.tsx:29](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsPages.tsx#L29)

### `ExtensionSettingsSection`

Component.

Renders the extensions' locked settings, catalog changes and integrations for the folder in view, over
the nearest extensions host (`settings`, `integrations`; one left out shows nothing of its part).

```ts
function ExtensionSettingsSection(props: ExtensionSettingsSectionProps): Element | null
```

**Parameters**

- `props` (`ExtensionSettingsSectionProps`): `className` and `style`.

**Returns** `Element | null`

**Props**

- `className?` (`string`): Extra classes on the root.
- `style?` (`CSSProperties`): Inline styles on the root.

Source: [ui/src/extensions/ExtensionSettingsSection.tsx:155](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsSection.tsx#L155)

### `ExtensionSettingsWirePage`

Component.

One page of an extension's settings: a definition page's rows (its sections, in order), or a
`SettingsPage` item (its component, else its own rows). Draws nothing without an extensions host.

```ts
function ExtensionSettingsWirePage(props: ExtensionSettingsWirePageProps): Element
```

**Parameters**

- `props` (`ExtensionSettingsWirePageProps`): The page, `className` and `style`.

**Returns** `Element`

**Props**

- `className?` (`string`): Extra classes on the root.
- `page` (`WireSettingsPage`): The page, as the settings wire lists it.
- `style?` (`CSSProperties`): Inline styles on the root.

Source: [ui/src/extensions/ExtensionSettingsSidebar.tsx:258](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsSidebar.tsx#L258)

### `ExtensionSlot`

Component.

Draws the extension items of one slot. Draws nothing when there are none.

```ts
function ExtensionSlot(props: ExtensionSlotProps): Element | null
```

**Parameters**

- `props` (`ExtensionSlotProps`): The place, the session, the turn, the panel opener, `className` and `style`.

**Returns** `Element | null`

**Props**

- `at` (`SlotName`): The place.
- `className?` (`string`): Extra classes on the root.
- `sessionId?` (`string`): The session the place belongs to: its session-scoped items show too.
- `style?` (`CSSProperties`): Inline styles on the root.
- `turnId?` (`string`): `transcript.turn-end`: the turn this place follows; only the items naming it show. Absent: the items
  naming no turn (the end of the transcript).
- `onOpenPanel?` (`(panelId: string, item: ExtensionItem<'slot'>) => void`): Opens a panel when an item asks for it: the full id (`<extension>/<id>`) or a built-in tab.
  Default: focuses that tab in the `WorkspaceProvider` above; without one, items that only open a
  panel are not buttons.

Source: [ui/src/extensions/ExtensionSlot.tsx:59](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSlot.tsx#L59)

### `ExtensionsProvider`

Component.

Provides an [`ExtensionsHost`](https://zidane.si/docs/reference/ui-extensions-headless.md#ExtensionsHost), the `ui.tsx` loader and optional label overrides to the extension components below it.

```ts
function ExtensionsProvider(props: ExtensionsProviderProps): Element
```

**Parameters**

- `props` (`ExtensionsProviderProps`): Provider props: the `host`, an optional `loadModule` and `labels`, and the `children`.

**Returns** `Element`

**Props**

- `children` (`ReactNode`): The app.
- `host` (`ExtensionsHost`): What the extensions contribute, and the way back to them.
- `labels?` (`Partial<{ extensionCatalogKind: (kind: CatalogKind) => string; extensionDialogCancel: string; extensionDialogConfirm: string; extensionDialogDone: string; extensionDialogOk: string; extensionDialogSubmit: string; extensionError: (error: ExtensionsError) => string; extensionIntegrationAccountCount: (count: number) => string; extensionIntegrationAccounts: (integration: string) => string; extensionIntegrationAddAccount: string; extensionIntegrationAddAccountWith: (method: string) => string; extensionIntegrationConnect: string; extensionIntegrationConnected: string; extensionIntegrationDefault: string; extensionIntegrationDisconnect: string; extensionIntegrationDisconnectLabel: (account: string) => string; extensionIntegrationError: (error: ExtensionsError) => string; extensionIntegrationMakeDefault: string; extensionIntegrationMakeDefaultLabel: (account: string) => string; extensionIntegrationNotConnected: string; extensionProvenance: (p: ExtensionProvenanceWire) => string; extensionRegion: (extension: string) => string; extensionScreenClose: string; extensionScreenMissing: string; extensionSelectNoMatch: string; extensionSelectSearch: string; extensionSettingLocked: string; extensionSettingRun: string; extensionSettingRunning: string; extensionSettingsChangesHeading: string; extensionSettingsIntegrationsHeading: string; extensionSettingsLockedHeading: string; extensionSettingsLockedTag: string; extensionSettingsNone: string; extensionSettingsSection: string; extensionToastDismiss: string; extensionToasts: string; extensionWorking: string }>`): Overrides for the built-in strings. Keys you leave out keep the default English label.
- `loadModule?` (`ExtensionModuleLoader`): Loads an extension's `ui.tsx` module (its exports are the components items name). Absent: items draw their data.

Source: [ui/src/extensions/ExtensionsProvider.tsx:51](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionsProvider.tsx#L51)

### `ExtensionTitlebar`

Component.

The extensions' `app.titlebar` items: small chips, lowest `order` first, at most eight per extension.
The desktop app puts it in its title bar right of the window controls and the sidebar toggle, the web
app in its header. Each item takes clicks inside a window drag region (`zg-no-drag`), so the bar
around it still moves the window. Draws nothing when there are none.

```ts
function ExtensionTitlebar(props: ExtensionTitlebarProps): Element
```

**Parameters**

- `props` (`ExtensionTitlebarProps`): The session on screen, the panel opener, `className` and `style`.

**Returns** `Element`

Source: [ui/src/extensions/ExtensionSlot.tsx:120](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSlot.tsx#L120)

### `ExtensionWebview`

Component.

Draws one extension webview with its RPC bridge. Draws nothing when no extension offers `id` or its URL resolves to `null`.

```ts
function ExtensionWebview(props: ExtensionWebviewProps): Element | null
```

**Parameters**

- `props` (`ExtensionWebviewProps`): The webview id, the app's origin policy, `className` and `style`.

**Returns** `Element | null`

**Props**

- `className?` (`string`): Extra classes on the iframe.
- `id` (`string`): The webview's full id (`<extension>/<id>`).
- `origin?` (`string`): The origin the page's messages must come from, and the target of replies. Default: the host's, else
  `'*'`: an opaque-origin sandbox, checked by the sending window alone.
- `sandbox?` (`string`): The iframe's sandbox flags. Default: the host's, else `'allow-scripts allow-forms'` (no same-origin access).
- `style?` (`CSSProperties`): Inline styles on the iframe.
- `resolveSrc?` (`(webview: WebviewWire, extension: string) => string | null`): The URL the iframe loads, or `null` to show nothing. Default: the host's (`ExtensionsHost.webviews`),
  else a `url` source as given and a `file` source not shown (the app must serve it).

Source: [ui/src/extensions/ExtensionWebview.tsx:52](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionWebview.tsx#L52)

### `LinkSessionScope`

Component.

Names the session the links below were clicked in, for the extensions' link handlers.

```ts
function LinkSessionScope(props: LinkSessionScopeProps): Element
```

**Parameters**

- `props` (`LinkSessionScopeProps`): The session and the children.

**Returns** `Element`

**Props**

- `children` (`ReactNode`): The links' tree.
- `sessionId` (`string | null | undefined`): The session the links below belong to.

Source: [ui/src/extensions/links.tsx:39](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/links.tsx#L39)

### `RoutedLink`

Component.

An anchor that opens `href` in a new tab, offered to the extensions' link handlers first.

```ts
function RoutedLink(props: RoutedLinkProps): Element
```

**Parameters**

- `props` (`RoutedLinkProps`): The anchor's props, `source` and `sessionId`.

**Returns** `Element`

**Props**

- `href` (`string`): The link.
- `sessionId?` (`string`): The session it belongs to. Default: the nearest [`LinkSessionScope`](https://zidane.si/docs/reference/ui-extensions.md#LinkSessionScope)'s.
- `source?` (`LinkRouterSource`): Where it is. Default `'other'`. `'auth'`: a sign-in page, a plain anchor no handler sees.

Source: [ui/src/extensions/links.tsx:100](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/links.tsx#L100)

### `SettingsWireForm`

Component.

Draws settings rows over the settings wire.

```ts
function SettingsWireForm(props: SettingsWireFormProps): Element
```

**Parameters**

- `props` (`SettingsWireFormProps`): The rows, their values, the change and action handlers, `className` and `style`.

**Returns** `Element`

**Props**

- `actionStates?` (`Readonly<Record<string, SettingsWireActionState>>`): Action rows' outcomes, by `extension:key`.
- `className?` (`string`): Extra classes on the root.
- `errors?` (`Readonly<Record<string, string>>`): A message per row (a refused write), by `extension:key`.
- `scope?` (`ExtensionAccessScope | null`): The scope this client's token grants (`ExtensionsHost.scope`): an action needing more shows its
  button disabled, with why. `null` or absent: never limited (a local or in-process host).
- `settings` (`WireSettings`): The rows.
- `style?` (`CSSProperties`): Inline styles on the root.
- `values` (`Readonly<Record<string, Readonly<Record<string, SettingValue>>>>`): The values shown, by extension then key (`settingsValues` gives the starting ones).
- `onChange` (`(extension: string, key: string, value: ExtensionConfigValue) => void`): A row changed (a switch flipped, an input committed). Locked rows never call it.
- `onRunAction?` (`(extension: string, key: string) => void`): Runs an action row. Absent: no action rows.

Source: [ui/src/extensions/SettingsWireForm.tsx:87](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/SettingsWireForm.tsx#L87)

## Functions

### `extensionSettingsEntryId`

Function.

The section id of an extension's entry under the Extensions section.

```ts
function extensionSettingsEntryId(extensionId: string): string
```

**Parameters**

- `extensionId` (`string`): The extension's id.

**Returns** `string`

Source: [ui/src/extensions/ExtensionSettingsSidebar.tsx:93](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsSidebar.tsx#L93)

### `extensionSettingsGroupId`

Function.

The section id of an extension's own group.

```ts
function extensionSettingsGroupId(extensionId: string): string
```

**Parameters**

- `extensionId` (`string`): The extension's id.

**Returns** `string`

Source: [ui/src/extensions/ExtensionSettingsSidebar.tsx:99](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsSidebar.tsx#L99)

### `extensionSettingsPageId`

Function.

The section id of one page of an extension's own group.

```ts
function extensionSettingsPageId(extensionId: string, pageId: string): string
```

**Parameters**

- `extensionId` (`string`): The extension's id.
- `pageId` (`string`): The page's id within that extension.

**Returns** `string`

Source: [ui/src/extensions/ExtensionSettingsSidebar.tsx:106](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsSidebar.tsx#L106)

### `useCarryExtensionsContext`

Function.

Returns `wrap(node)`, which puts this tree's extensions host, `ui.tsx` loader and labels around a
node rendered elsewhere: the app's modal layer sits above the providers, so a dialog or screen
opened on it carries them in.

```ts
function useCarryExtensionsContext(): (node: ReactNode) => ReactNode
```

**Returns** `(node: ReactNode) => ReactNode`

Source: [ui/src/extensions/ExtensionsProvider.tsx:102](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionsProvider.tsx#L102)

### `useExtension`

Function.

The extension whose UI renders here. Throws outside an extension's component.

```ts
function useExtension(): ExtensionInfo
```

**Returns** `ExtensionInfo`

Source: [ui/src/extensions/hooks.ts:33](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L33)

### `useExtensionEffectRouter`

Function.

The effect router of the nearest [`ExtensionsProvider`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionsProvider), or `null` (no provider, or a host without `effects`).

```ts
function useExtensionEffectRouter(): ExtensionEffectRouter | null
```

**Returns** `ExtensionEffectRouter | null`

Source: [ui/src/extensions/ExtensionsProvider.tsx:76](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionsProvider.tsx#L76)

### `useExtensionEffects`

Function.

Applies the `ctx.ui` / `ctx.composer` calls routed to this client with `handler` (open the panel,
navigate, edit the composer, notify) and reports back what it did. Each call reaches one handler
(see [`ExtensionEffectsOptions`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionEffectsOptions)), so it is never applied twice. A handler that throws, or
returns nothing for a call that expects an answer, reports "did nothing".

The kit applies some calls itself, wherever the part they need is mounted: a composer edit in the
composer it is for, `navigate({ screen })` on the modal layer (`ExtensionDialogHost`). An app's
handler gets the rest.

```ts
function useExtensionEffects(
  handler: ExtensionEffectHandler,
  options?: ExtensionEffectsOptions,
): void
```

**Parameters**

- `handler` (`ExtensionEffectHandler`): Applies one effect.
- `options?` (`ExtensionEffectsOptions`): Which effects it takes, and its priority.

Source: [ui/src/extensions/hooks.ts:194](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L194)

### `useExtensionExport`

Function.

The component an extension exports under `name`, once its module loaded: `undefined` while
loading, `null` when there is none (no loader, a failed load, a missing export).

```ts
function useExtensionExport(
  extensionId: string,
  name: string,
): ComponentType<Record<string, unknown>> | null | undefined
```

**Parameters**

- `extensionId` (`string`): The extension.
- `name` (`string`): The export name.

**Returns** `ComponentType<Record<string, unknown>> | null | undefined`

Source: [ui/src/extensions/ExtensionComponent.tsx:117](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionComponent.tsx#L117)

### `useExtensionItems`

Function.

The items of one token, re-rendering when they change. Empty outside an [`ExtensionsProvider`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionsProvider).

```ts
function useExtensionItems<N extends keyof ExtensionWireMap>(
  token: N,
): readonly ExtensionItem<N>[]
```

**Type parameters**

- `N` (`extends keyof ExtensionWireMap`)

**Parameters**

- `token` (`N`): The token.

**Returns** `readonly ExtensionItem<N>[]`

Source: [ui/src/extensions/ExtensionsProvider.tsx:92](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionsProvider.tsx#L92)

### `useExtensionModuleLoader`

Function.

The loader from the nearest [`ExtensionComponentsProvider`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionComponentsProvider), or `null`.

```ts
function useExtensionModuleLoader(): ExtensionModuleLoader | null
```

**Returns** `ExtensionModuleLoader | null`

Source: [ui/src/extensions/ExtensionComponent.tsx:80](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionComponent.tsx#L80)

### `useExtensionScope`

Function.

The extension whose UI renders here, or `null` outside one.

```ts
function useExtensionScope(): string | null
```

**Returns** `string | null`

Source: [ui/src/extensions/ExtensionComponent.tsx:102](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionComponent.tsx#L102)

### `useExtensionScreen`

Function.

Returns `open(id)`, which shows an extension screen (or webview) on the modal layer. `false` when there
is no such screen or webview, or no modal layer.

```ts
function useExtensionScreen(): (id: string) => boolean
```

**Returns** `(id: string) => boolean`

Source: [ui/src/extensions/ExtensionScreen.tsx:81](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionScreen.tsx#L81)

### `useExtensionSettings`

Function.

This extension's settings: values, locked keys and a setter.

```ts
function useExtensionSettings(): ExtensionSettingsView
```

**Returns** `ExtensionSettingsView`

Source: [ui/src/extensions/hooks.ts:135](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L135)

### `useExtensionSettingsSections`

Function.

The extensions' settings entries, groups and search entries for `SettingsShell` (see the module comment).
Empty without an extensions host, or one without `settings`.

```ts
function useExtensionSettingsSections(
  options?: ExtensionSettingsSectionsOptions,
): ExtensionSettingsSections
```

**Parameters**

- `options?` (`ExtensionSettingsSectionsOptions`, default `{}`): The Extensions section's id.

**Returns** `ExtensionSettingsSections`

Source: [ui/src/extensions/ExtensionSettingsSidebar.tsx:130](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsSidebar.tsx#L130)

### `useExtensionsHost`

Function.

The [`ExtensionsHost`](https://zidane.si/docs/reference/ui-extensions-headless.md#ExtensionsHost) from the nearest [`ExtensionsProvider`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionsProvider), or `null` outside one.

```ts
function useExtensionsHost(): ExtensionsHost | null
```

**Returns** `ExtensionsHost | null`

Source: [ui/src/extensions/ExtensionsProvider.tsx:81](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionsProvider.tsx#L81)

### `useExtensionsLabels`

Function.

Returns the extensions components' strings: the defaults merged with any overrides.

```ts
function useExtensionsLabels(): { extensionCatalogKind: (kind: CatalogKind) => string; extensionDialogCancel: string; extensionDialogConfirm: string; extensionDialogDone: string; extensionDialogOk: string; extensionDialogSubmit: string; extensionError: (error: ExtensionsError) => string; extensionIntegrationAccountCount: (count: number) => string; extensionIntegrationAccounts: (integration: string) => string; extensionIntegrationAddAccount: string; extensionIntegrationAddAccountWith: (method: string) => string; extensionIntegrationConnect: string; extensionIntegrationConnected: string; extensionIntegrationDefault: string; extensionIntegrationDisconnect: string; extensionIntegrationDisconnectLabel: (account: string) => string; extensionIntegrationError: (error: ExtensionsError) => string; extensionIntegrationMakeDefault: string; extensionIntegrationMakeDefaultLabel: (account: string) => string; extensionIntegrationNotConnected: string; extensionProvenance: (p: ExtensionProvenanceWire) => string; extensionRegion: (extension: string) => string; extensionScreenClose: string; extensionScreenMissing: string; extensionSelectNoMatch: string; extensionSelectSearch: string; extensionSettingLocked: string; extensionSettingRun: string; extensionSettingRunning: string; extensionSettingsChangesHeading: string; extensionSettingsIntegrationsHeading: string; extensionSettingsLockedHeading: string; extensionSettingsLockedTag: string; extensionSettingsNone: string; extensionSettingsSection: string; extensionToastDismiss: string; extensionToasts: string; extensionWorking: string }
```

**Returns** `{ extensionCatalogKind: (kind: CatalogKind) => string; extensionDialogCancel: string; extensionDialogConfirm: string; extensionDialogDone: string; extensionDialogOk: string; extensionDialogSubmit: string; extensionError: (error: ExtensionsError) => string; extensionIntegrationAccountCount: (count: number) => string; extensionIntegrationAccounts: (integration: string) => string; extensionIntegrationAddAccount: string; extensionIntegrationAddAccountWith: (method: string) => string; extensionIntegrationConnect: string; extensionIntegrationConnected: string; extensionIntegrationDefault: string; extensionIntegrationDisconnect: string; extensionIntegrationDisconnectLabel: (account: string) => string; extensionIntegrationError: (error: ExtensionsError) => string; extensionIntegrationMakeDefault: string; extensionIntegrationMakeDefaultLabel: (account: string) => string; extensionIntegrationNotConnected: string; extensionProvenance: (p: ExtensionProvenanceWire) => string; extensionRegion: (extension: string) => string; extensionScreenClose: string; extensionScreenMissing: string; extensionSelectNoMatch: string; extensionSelectSearch: string; extensionSettingLocked: string; extensionSettingRun: string; extensionSettingRunning: string; extensionSettingsChangesHeading: string; extensionSettingsIntegrationsHeading: string; extensionSettingsLockedHeading: string; extensionSettingsLockedTag: string; extensionSettingsNone: string; extensionSettingsSection: string; extensionToastDismiss: string; extensionToasts: string; extensionWorking: string }`

Source: [ui/src/extensions/useExtensionsLabels.ts:11](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/useExtensionsLabels.ts#L11)

### `useLinkRouter`

Function.

The [`LinkRouter`](https://zidane.si/docs/reference/ui-extensions.md#LinkRouter) of the nearest extensions host.

```ts
function useLinkRouter(): LinkRouter
```

**Returns** `LinkRouter`

**Example**

```ts
const links = useLinkRouter();
  <a href={url} target="_blank" rel="noreferrer" onClick={links.anchorClick(url, { source: 'chip' })}>…</a>
```

Source: [ui/src/extensions/links.tsx:133](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/links.tsx#L133)

### `useRpc`

Function.

A client for one RPC contract: each property is a method (`await rpc.add({ n: 1 })`). Calls run as
this extension's UI, so its own internal methods are allowed. A method's error rejects as an
`ExtensionsHostError` with `{ code: 'rpc', type, message, data }`; without RPC here, `unavailable`.

```ts
function useRpc<C extends object = Readonly<Record<string, RpcMethodCaller>>>(
  contract: string | { readonly id: string },
): C
```

**Type parameters**

- `C` (`extends object`, default `Readonly<Record<string, RpcMethodCaller>>`)

**Parameters**

- `contract` (`string | { readonly id: string }`): The contract, or its id.

**Returns** `C`

Source: [ui/src/extensions/hooks.ts:52](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L52)

### `useStore`

Function.

A typed store of this extension (`ctx.storage.store(name, …)` on the backend): its value, and a
setter the backend validates. Every window and client sees a write.

```ts
function useStore<T>(
  name: string,
  options: UseStoreOptions<T>,
): [T, (value: T) => Promise<void>]
```

**Type parameters**

- `T`

**Parameters**

- `name` (`string`): The store's name.
- `options` (`UseStoreOptions<T>`): Scope, session and the initial value.

**Returns** `[T, (value: T) => Promise<void>]`

Source: [ui/src/extensions/hooks.ts:100](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L100)

## Constants

### `KIT_EFFECT_PRIORITY`

Constant.

The priority of the kit's own effect handlers: above an app's default 0.

```ts
const KIT_EFFECT_PRIORITY = 10
```

Source: [ui/src/extensions/hooks.ts:179](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L179)

## Interfaces

### `ExtensionComponentProps`

Interface.

Props for [`ExtensionComponent`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionComponent).

```ts
interface ExtensionComponentProps
```

**Properties**

- `component` (`ComponentWire`): The component the item names.
- `extension` (`string`): The extension whose `ui.tsx` exports the component.
- `fallback` (`ReactNode`): What shows while loading, without a component, and after a throw: the item's data or markdown.
- `props?` (`Readonly<Record<string, unknown>>`): Props passed over the item's own (the data a renderer draws, a slot's session).

Source: [ui/src/extensions/ExtensionComponent.tsx:140](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionComponent.tsx#L140)

### `ExtensionComponentsProviderProps`

Interface.

Props for [`ExtensionComponentsProvider`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionComponentsProvider).

```ts
interface ExtensionComponentsProviderProps
```

**Properties**

- `children` (`ReactNode`): The subtree that resolves extension components through the loader.
- `loadModule` (`ExtensionModuleLoader`): Loads an extension's `ui.tsx` module. Each extension's module loads once per loader.

Source: [ui/src/extensions/ExtensionComponent.tsx:63](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionComponent.tsx#L63)

### `ExtensionDialogHostProps`

Interface.

Props for [`ExtensionDialogHost`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionDialogHost).

```ts
interface ExtensionDialogHostProps
```

**Properties**

- `className?` (`string`): Extra classes on the toasts' region.
- `style?` (`CSSProperties`): Inline styles on the toasts' region.

Source: [ui/src/extensions/ExtensionDialogHost.tsx:40](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionDialogHost.tsx#L40)

### `ExtensionDialogViewProps`

Interface.

Props for [`ExtensionDialogView`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionDialogView).

```ts
interface ExtensionDialogViewProps
```

**Properties**

- `dialog` (`ExtensionDialog`): The dialog to show.
- `onAnswer` (`(answer: unknown) => void`): Answers it (`undefined` cancels): the shape per kind is `ExtensionDialogs.answer`'s.

Source: [ui/src/extensions/ExtensionDialogHost.tsx:143](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionDialogHost.tsx#L143)

### `ExtensionEffectsOptions`

Interface.

Options of [`useExtensionEffects`](https://zidane.si/docs/reference/ui-extensions.md#useExtensionEffects).

```ts
interface ExtensionEffectsOptions
```

**Properties**

- `priority?` (`number`): Higher first: of the handlers that take an effect, the highest applies it (the earliest mounted
  among equals). Default 0. The kit's own handlers (the composer an edit is for, the screens on the
  modal layer) use [`KIT_EFFECT_PRIORITY`](https://zidane.si/docs/reference/ui-extensions.md#KIT_EFFECT_PRIORITY), so they apply what they take before an app's.
- `accepts?` (`(effect: ExtensionUiEffect) => boolean`): Whether this handler takes the effect. Absent: every effect. An effect no handler takes is
  answered "did nothing" at once.

Source: [ui/src/extensions/hooks.ts:164](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L164)

### `ExtensionInfo`

Interface.

What [`useExtension`](https://zidane.si/docs/reference/ui-extensions.md#useExtension) returns.

```ts
interface ExtensionInfo
```

**Properties**

- `id` (`string`): The extension whose UI renders here.

Source: [ui/src/extensions/hooks.ts:27](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L27)

### `ExtensionRendererProps`

Interface.

Props for [`ExtensionRenderer`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionRenderer).

```ts
interface ExtensionRendererProps
```

**Properties**

- `className?` (`string`): Extra classes on the root.
- `data?` (`Readonly<Record<string, unknown>>`): Props the renderer's component gets over its own: the data to draw (the code, the tool result…).
- `defaultView?` (`ReactNode`): What the place draws without extensions, drawn instead of the markdown `fallback` when no renderer
  draws and in place of one that can't. Use it where the fallback markdown would route back here (a
  fenced block whose language has a renderer).
- `fallback?` (`string`): Markdown drawn when no renderer draws, and in place of one that can't (unless `defaultView` is given).
- `for` (`RendererTarget`): What needs drawing: `{ block }`, `{ language }`, `{ tool }` (one tool name) or `{ artifact }`.
- `style?` (`CSSProperties`): Inline styles on the root.

Source: [ui/src/extensions/ExtensionRenderer.tsx:20](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionRenderer.tsx#L20)

### `ExtensionScopeProps`

Interface.

Props for [`ExtensionScope`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionScope).

```ts
interface ExtensionScopeProps
```

**Properties**

- `children` (`ReactNode`): The subtree the extension's UI renders in.
- `extensionId` (`string`): The extension whose UI this is.

Source: [ui/src/extensions/ExtensionComponent.tsx:85](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionComponent.tsx#L85)

### `ExtensionScreenProps`

Interface.

Props for [`ExtensionScreen`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionScreen).

```ts
interface ExtensionScreenProps
```

**Properties**

- `className?` (`string`): Extra classes on the root.
- `id` (`string`): The screen's full id (`<extension>/<id>`).
- `style?` (`CSSProperties`): Inline styles on the root.

Source: [ui/src/extensions/ExtensionScreen.tsx:22](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionScreen.tsx#L22)

### `ExtensionSettingsPageProps`

Interface.

Props for [`ExtensionSettingsPage`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionSettingsPage).

```ts
interface ExtensionSettingsPageProps
```

**Properties**

- `className?` (`string`): Extra classes on the root.
- `id` (`string`): The page's full id (`<extension>/<id>`).
- `style?` (`CSSProperties`): Inline styles on the root.

Source: [ui/src/extensions/ExtensionSettingsPage.tsx:20](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsPage.tsx#L20)

### `ExtensionSettingsPagesProps`

Interface.

Props for [`ExtensionSettingsPages`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionSettingsPages).

```ts
interface ExtensionSettingsPagesProps
```

**Properties**

- `className?` (`string`): Extra classes on the root.
- `style?` (`CSSProperties`): Inline styles on the root.

Source: [ui/src/extensions/ExtensionSettingsPages.tsx:17](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsPages.tsx#L17)

### `ExtensionSettingsSectionProps`

Interface.

Props for [`ExtensionSettingsSection`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionSettingsSection).

```ts
interface ExtensionSettingsSectionProps
```

**Properties**

- `className?` (`string`): Extra classes on the root.
- `style?` (`CSSProperties`): Inline styles on the root.

Source: [ui/src/extensions/ExtensionSettingsSection.tsx:142](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsSection.tsx#L142)

### `ExtensionSettingsSections`

Interface.

What [`useExtensionSettingsSections`](https://zidane.si/docs/reference/ui-extensions.md#useExtensionSettingsSections) returns.

```ts
interface ExtensionSettingsSections
```

**Properties**

- `categories` (`SettingsSection[]`): Each extension's own group, then its pages under it, in load order. List them after the built-in sections.
- `entries` (`SettingsSection[]`): One entry per extension without a category, by label, each grouped under `group`.
- `search` (`SettingsSearchHit[]`): One search entry per page and per row, landing on the row.

Source: [ui/src/extensions/ExtensionSettingsSidebar.tsx:57](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsSidebar.tsx#L57)

### `ExtensionSettingsSectionsOptions`

Interface.

Options of [`useExtensionSettingsSections`](https://zidane.si/docs/reference/ui-extensions.md#useExtensionSettingsSections).

```ts
interface ExtensionSettingsSectionsOptions
```

**Properties**

- `group?` (`string`): The section the extensions' entries list under. Default: `'extensions'`.

Source: [ui/src/extensions/ExtensionSettingsSidebar.tsx:51](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsSidebar.tsx#L51)

### `ExtensionSettingsView`

Interface.

What [`useExtensionSettings`](https://zidane.si/docs/reference/ui-extensions.md#useExtensionSettings) returns.

```ts
interface ExtensionSettingsView
```

**Properties**

- `values` (`Readonly<Record<string, SettingValue>>`): Every setting's value (the default when unset).
- `locked` (`(key: string) => boolean`): Whether a declarative config entry sets `key` (not editable).
- `set` (`(key: string, value: ExtensionConfigValue) => Promise<void>`): Writes one value. Rejects `refused` (`locked`, `invalid`) or `unavailable` (read-only here).

Source: [ui/src/extensions/hooks.ts:123](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L123)

### `ExtensionSettingsWirePageProps`

Interface.

Props for [`ExtensionSettingsWirePage`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionSettingsWirePage).

```ts
interface ExtensionSettingsWirePageProps
```

**Properties**

- `className?` (`string`): Extra classes on the root.
- `page` (`WireSettingsPage`): The page, as the settings wire lists it.
- `style?` (`CSSProperties`): Inline styles on the root.

Source: [ui/src/extensions/ExtensionSettingsSidebar.tsx:243](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSettingsSidebar.tsx#L243)

### `ExtensionSlotProps`

Interface.

Props for [`ExtensionSlot`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionSlot).

```ts
interface ExtensionSlotProps
```

**Properties**

- `at` (`SlotName`): The place.
- `className?` (`string`): Extra classes on the root.
- `sessionId?` (`string`): The session the place belongs to: its session-scoped items show too.
- `style?` (`CSSProperties`): Inline styles on the root.
- `turnId?` (`string`): `transcript.turn-end`: the turn this place follows; only the items naming it show. Absent: the items
  naming no turn (the end of the transcript).
- `onOpenPanel?` (`(panelId: string, item: ExtensionItem<'slot'>) => void`): Opens a panel when an item asks for it: the full id (`<extension>/<id>`) or a built-in tab.
  Default: focuses that tab in the `WorkspaceProvider` above; without one, items that only open a
  panel are not buttons.

Source: [ui/src/extensions/ExtensionSlot.tsx:32](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSlot.tsx#L32)

### `ExtensionsProviderProps`

Interface.

Props for [`ExtensionsProvider`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionsProvider).

```ts
interface ExtensionsProviderProps
```

**Properties**

- `children` (`ReactNode`): The app.
- `host` (`ExtensionsHost`): What the extensions contribute, and the way back to them.
- `labels?` (`Partial<{ extensionCatalogKind: (kind: CatalogKind) => string; extensionDialogCancel: string; extensionDialogConfirm: string; extensionDialogDone: string; extensionDialogOk: string; extensionDialogSubmit: string; extensionError: (error: ExtensionsError) => string; extensionIntegrationAccountCount: (count: number) => string; extensionIntegrationAccounts: (integration: string) => string; extensionIntegrationAddAccount: string; extensionIntegrationAddAccountWith: (method: string) => string; extensionIntegrationConnect: string; extensionIntegrationConnected: string; extensionIntegrationDefault: string; extensionIntegrationDisconnect: string; extensionIntegrationDisconnectLabel: (account: string) => string; extensionIntegrationError: (error: ExtensionsError) => string; extensionIntegrationMakeDefault: string; extensionIntegrationMakeDefaultLabel: (account: string) => string; extensionIntegrationNotConnected: string; extensionProvenance: (p: ExtensionProvenanceWire) => string; extensionRegion: (extension: string) => string; extensionScreenClose: string; extensionScreenMissing: string; extensionSelectNoMatch: string; extensionSelectSearch: string; extensionSettingLocked: string; extensionSettingRun: string; extensionSettingRunning: string; extensionSettingsChangesHeading: string; extensionSettingsIntegrationsHeading: string; extensionSettingsLockedHeading: string; extensionSettingsLockedTag: string; extensionSettingsNone: string; extensionSettingsSection: string; extensionToastDismiss: string; extensionToasts: string; extensionWorking: string }>`): Overrides for the built-in strings. Keys you leave out keep the default English label.
- `loadModule?` (`ExtensionModuleLoader`): Loads an extension's `ui.tsx` module (its exports are the components items name). Absent: items draw their data.

Source: [ui/src/extensions/ExtensionsProvider.tsx:35](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionsProvider.tsx#L35)

### `ExtensionWebviewProps`

Interface.

Props for [`ExtensionWebview`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionWebview).

```ts
interface ExtensionWebviewProps
```

**Properties**

- `className?` (`string`): Extra classes on the iframe.
- `id` (`string`): The webview's full id (`<extension>/<id>`).
- `origin?` (`string`): The origin the page's messages must come from, and the target of replies. Default: the host's, else
  `'*'`: an opaque-origin sandbox, checked by the sending window alone.
- `sandbox?` (`string`): The iframe's sandbox flags. Default: the host's, else `'allow-scripts allow-forms'` (no same-origin access).
- `style?` (`CSSProperties`): Inline styles on the iframe.
- `resolveSrc?` (`(webview: WebviewWire, extension: string) => string | null`): The URL the iframe loads, or `null` to show nothing. Default: the host's (`ExtensionsHost.webviews`),
  else a `url` source as given and a `file` source not shown (the app must serve it).

Source: [ui/src/extensions/ExtensionWebview.tsx:23](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionWebview.tsx#L23)

### `LinkOpenOptions`

Interface.

Where a link was opened, as [`LinkRouter`](https://zidane.si/docs/reference/ui-extensions.md#LinkRouter) takes it.

```ts
interface LinkOpenOptions
```

**Properties**

- `event?` (`{ altKey?: boolean }`): The click or key press that opened it: Alt held opens it the app's way at once.
- `sessionId?` (`string`): The session it was clicked in. Default: the nearest [`LinkSessionScope`](https://zidane.si/docs/reference/ui-extensions.md#LinkSessionScope)'s.
- `source` (`LinkRouterSource`): Where it was clicked. `'auth'`: a sign-in page, opened the app's way at once.

Source: [ui/src/extensions/links.tsx:50](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/links.tsx#L50)

### `LinkRouter`

Interface.

Opens links through the extensions' link handlers.

```ts
interface LinkRouter
```

**Properties**

- `routed` (`boolean`): Whether a link handler may take links here (the host offers `openLink` and an extension registered one).
- `anchorClick` (`(url: string | undefined, options: Omit<LinkOpenOptions, 'event'>) => ((event: MouseEvent<HTMLElement>) => void) | undefined`): The `onClick` of an anchor that opens `url` in a new tab: it routes the click and opens the tab only
  when no handler took it. `undefined` when nothing routes here: the anchor keeps its native behavior.
- `open` (`(url: string, options: LinkOpenOptions, fallback?: () => void) => Promise<boolean>`): Opens `url`: through the link handlers first (unless Alt is held), else `fallback`. Resolves `true`
  when a handler opened it.

Source: [ui/src/extensions/links.tsx:60](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/links.tsx#L60)

### `LinkSessionScopeProps`

Interface.

Props for [`LinkSessionScope`](https://zidane.si/docs/reference/ui-extensions.md#LinkSessionScope).

```ts
interface LinkSessionScopeProps
```

**Properties**

- `children` (`ReactNode`): The links' tree.
- `sessionId` (`string | null | undefined`): The session the links below belong to.

Source: [ui/src/extensions/links.tsx:27](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/links.tsx#L27)

### `RoutedLinkProps`

Interface.

Props for [`RoutedLink`](https://zidane.si/docs/reference/ui-extensions.md#RoutedLink): an anchor's, plus where it is.

```ts
interface RoutedLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'target'>
```

**Properties**

- `href` (`string`): The link.
- `sessionId?` (`string`): The session it belongs to. Default: the nearest [`LinkSessionScope`](https://zidane.si/docs/reference/ui-extensions.md#LinkSessionScope)'s.
- `source?` (`LinkRouterSource`): Where it is. Default `'other'`. `'auth'`: a sign-in page, a plain anchor no handler sees.

Source: [ui/src/extensions/links.tsx:86](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/links.tsx#L86)

### `SettingsWireActionState`

Interface.

An action row's outcome, as the parent reports it.

```ts
interface SettingsWireActionState
```

**Properties**

- `state` (`'done' | 'error' | 'busy'`): `busy` disables the row's button; `error` draws `text` as a failure.
- `text?` (`string`): Status line under the row. Absent: none.

Source: [ui/src/extensions/SettingsWireForm.tsx:25](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/SettingsWireForm.tsx#L25)

### `SettingsWireFormProps`

Interface.

Props for [`SettingsWireForm`](https://zidane.si/docs/reference/ui-extensions.md#SettingsWireForm).

```ts
interface SettingsWireFormProps
```

**Properties**

- `actionStates?` (`Readonly<Record<string, SettingsWireActionState>>`): Action rows' outcomes, by `extension:key`.
- `className?` (`string`): Extra classes on the root.
- `errors?` (`Readonly<Record<string, string>>`): A message per row (a refused write), by `extension:key`.
- `scope?` (`ExtensionAccessScope | null`): The scope this client's token grants (`ExtensionsHost.scope`): an action needing more shows its
  button disabled, with why. `null` or absent: never limited (a local or in-process host).
- `settings` (`WireSettings`): The rows.
- `style?` (`CSSProperties`): Inline styles on the root.
- `values` (`Readonly<Record<string, Readonly<Record<string, SettingValue>>>>`): The values shown, by extension then key (`settingsValues` gives the starting ones).
- `onChange` (`(extension: string, key: string, value: ExtensionConfigValue) => void`): A row changed (a switch flipped, an input committed). Locked rows never call it.
- `onRunAction?` (`(extension: string, key: string) => void`): Runs an action row. Absent: no action rows.

Source: [ui/src/extensions/SettingsWireForm.tsx:33](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/SettingsWireForm.tsx#L33)

### `UseStoreOptions`

Interface.

Options of [`useStore`](https://zidane.si/docs/reference/ui-extensions.md#useStore).

```ts
interface UseStoreOptions<T>
```

**Type parameters**

- `T`

**Properties**

- `initial` (`T`): The value while nothing is stored (or known yet).
- `scope?` (`'user' | 'project' | 'session'`): Where the store lives. Default `'user'`.
- `sessionId?` (`string`): For `session` scope.

Source: [ui/src/extensions/hooks.ts:84](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L84)

## Types

### `ExtensionEffectHandler`

Type.

Applies one effect: whether it did (or the open panel ids for `panel-state`; nothing for `notify`).

```ts
type ExtensionEffectHandler = (effect: ExtensionUiEffect) => boolean | readonly string[] | void | Promise<boolean | readonly string[] | void>
```

Source: [ui/src/extensions/hooks.ts:159](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L159)

### `ExtensionModuleLoader`

Type.

Loads an extension's `ui.tsx` module: its exports by name.

```ts
type ExtensionModuleLoader = (extensionId: string) => Promise<Readonly<Record<string, unknown>>>
```

Source: [ui/src/extensions/ExtensionComponent.tsx:27](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionComponent.tsx#L27)

### `ExtensionTitlebarProps`

Type.

Props for [`ExtensionTitlebar`](https://zidane.si/docs/reference/ui-extensions.md#ExtensionTitlebar).

```ts
type ExtensionTitlebarProps = Omit<ExtensionSlotProps, 'at' | 'turnId'>
```

Source: [ui/src/extensions/ExtensionSlot.tsx:110](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/ExtensionSlot.tsx#L110)

### `LinkRouterSource`

Type.

Where a link is, for the router: a source the link handlers see, or `'auth'`, a sign-in page the
router never offers to them.

```ts
type LinkRouterSource = ExtensionLinkSource | 'auth'
```

Source: [ui/src/extensions/links.tsx:47](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/links.tsx#L47)

### `RpcClient`

Type.

A contract's methods by name. Type it with your contract's method signatures.

```ts
type RpcClient = Readonly<Record<string, RpcMethodCaller>>
```

Source: [ui/src/extensions/hooks.ts:43](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L43)

### `RpcMethodCaller`

Type.

A method of an RPC contract, as [`useRpc`](https://zidane.si/docs/reference/ui-extensions.md#useRpc) gives it.

```ts
type RpcMethodCaller = (input?: unknown, opts?: { signal?: AbortSignal }) => Promise<unknown>
```

Source: [ui/src/extensions/hooks.ts:40](https://github.com/Tahul/zidane/blob/main/ui/src/extensions/hooks.ts#L40)
