Chat · Components
AssistantDock
No summary has been written for AssistantDock. Everything below is generated from the declaration shipped in 0.57.40 and describes the real contract.Public export
typescript
import { AssistantDock } from '@happyvertical/smrt-chat/svelte';- Import path
@happyvertical/smrt-chat/svelte- Props
- 35
- Props described
- 35 of 35
- Bindable state
- 0
- Callback events
- 6
- Verified release
- 0.57.40
Props
NameTypeRequiredDescription
suggestionsreadonly { label: string; prompt: string; }[]NoExplicit send choices for a fresh conversation. Nothing runs until clicked.transportAssistantTransportYesThread/message I/O backend; see `./assistant-transport.js`.registryDataSurfaceRegistryYesThe host shell's `DataSurfaceRegistry` instance — the dock discovers currently-mounted surfaces from this and fails closed when none are registered.contextMode'data-surfaces' | 'server'NoWhere the assistant obtains its working context. `data-surfaces` keeps the route-surface guidance; `server` is for transports whose authenticated backend supplies context and tools without browser data surfaces.actionClientAssistantActionClientNoClient-side seam to a server-hosted `DataSurfaceActionAdapter`; required to preview/apply proposed actions, optional for plain chat.surfacesDataSurfaceIdentity[]NoExplicit surface narrowing filter (#2904 review finding 1; narrowed against the live registry per Copilot PR #2919 jAwr0): when set, the dock scopes discovery AND the preview/apply mount gate to the INTERSECTION of this list and `registry.list()` — an identity present here but not genuinely registered is never mounted. `registry` is still required (both for that intersection and for `syncRegistry`'s swap handling). Documented in `docs/assistant-dock.md` "Tenant scoping"; previously only reachable by constructing `createAssistantDockController` directly, which this component itself does not expose.visiblebooleanNoWhether the dock is currently visible; polling pauses while false.presentation'full' | 'controls'No`controls` keeps live status and required decisions while omitting the transcript, thread list and composer for a host-owned conversation view.conversations'multiple' | 'single'NoHow the dock presents conversations. `multiple` (default) shows the conversation list and lets the person start new ones. `single` is for hosts where the person never needs to know about separate conversations: no list, no toggle, no choose/empty screens. On mount the dock reuses the transport's most recent thread, or creates one silently when there is none, and opens straight into the composer (focused while `visible`). A failure shows inline with a retry; a small icon-only "Clear conversation" action starts fresh when the transport can create threads.threadListbooleanNoWhether the dock shows its "Conversations" toggle and thread list (#3405). Default `true`. With `false` the dock is a single running conversation: the message thread and the composer fill the full width, in wide and narrow containers alike. Nothing else changes — the dock does not open or create a conversation for you, so a host that hides the list opens one itself through `oncontroller`: load threads, then call `openThread(id)`. For a new conversation, await `createThread(title)` and then `openThread(thread.id)` with its result; creation alone does not activate the conversation. Until a conversation is active the composer stays disabled and the empty state offers "Create conversation" (when the transport supports `createThread`); it never points at the omitted list.toolCallSnippet<[AssistantMessage]>NoRenders a message's own `toolCallData` (#2988), inside that message's bubble below its text. Called only for messages whose `toolCallData` is set. Without it the dock renders no tool-call region at all: the payload is host-defined, so the dock never stringifies it or injects it as HTML. Render it with ordinary Svelte markup in the host's own snippet.toolResultComponent(message: AssistantMessage) => Component<{ message: AssistantMessage; }> | undefinedNoTrusted host selection of a component for a tool result. Unknown results retain their ordinary message text and optional toolCall snippet. This seam only renders: it grants no tool execution or confirmation authority.oncontroller(controller: AssistantDockController) => voidNoHands the host this dock's own controller once, on mount (#2989), so it can propose an action with `controller.previewAction(request)`. The proposal renders with Confirm/Reject like any other; everything else (apply, the idempotency key, mount checks) stays with the dock.onactionapplied(request: DataSurfaceActionRequest, result: DataSurfaceActionResult) => voidNoCalled after the server accepts an apply (#2989). See `AssistantDockControllerOptions.onActionApplied`.onactionsettled(request: DataSurfaceActionRequest, outcome: AssistantActionOutcome) => voidNoCalled each time a proposed action reaches an outcome (#2991): applied, rejected (by the server or the user), or unknown. See `AssistantDockControllerOptions.onActionSettled`.initialDraftstringNoInitial composer draft (#2991), for example a prompt computed for the item being edited. Read once, on mount; the user edits and sends it. It is never sent on their behalf. To replace it later, call `controller.setDraft(text)` from `oncontroller`.composerPlaceholderstringNoPlaceholder for the composer's empty textarea (#2991). Defaults to the composer's own placeholder.composerDisabledbooleanNoDisables text submission while a host-owned input has a pending turn.pageToolsAssistantClientToolSourceNoThe page's browser tools (#2908) — typically `installWebMcpPageToolRegistry()` from `@happyvertical/smrt-web/webmcp-page-tools`. Offered to the model each turn; see `./client-tools.ts` for when a call waits for the user.clientToolPolicy(tool: AssistantClientTool) => AssistantClientToolPolicyNoNarrows when a browser tool call waits for the user (#2908). Destructive calls always wait.onstatus(status: AssistantStatus) => voidNoCalled whenever the assistant's generic status changes (#2908), for a host's own "working" line. Also readable as `controller.status`.settle() => Promise<void> | voidNoWaits for the page to settle after a step's browser tools ran, before the turn resumes. See `AssistantDockControllerOptions.settle`.clientToolFilter(tool: AssistantClientTool) => booleanNoNarrows the page tools the dock declares and runs (e.g. a person's setting). See `AssistantDockControllerOptions.clientToolFilter`.maxPauseMsnumberNoHow long a paused run may wait before it stops. Default 15 min.onrun(run: AssistantRun | null) => voidNoCalled whenever the supervised run changes (#assistant-watch). Also readable as `controller.run`.onattentionchange(required: boolean) => voidNoReports whether a person must make an explicit decision.choiceSourcesAssistantChoiceSourceRegistryNoPage features that can offer a few options for the person to pick (see `./assistant-choices.svelte.ts`). The options show as cards here; the person's click applies one.dictationDictationSourceProvider | nullNoSpeak instead of typing in the composer (a speech source, e.g. smrt-svelte's `createSttDictationSource()`); see `AssistantComposer`.transcribeDictationTranscribe | nullNoWrites a recorded message down when the browser cannot recognise speech (Firefox, Brave), e.g. smrt-ui's `createHttpTranscriber()`; see `AssistantComposer`.dictationMode'push' | 'hands-free'No`'hands-free'` keeps the microphone on and writes each sentence down when the speaker pauses; see `AssistantComposer`.handsFreeCaptureHandsFreeCaptureFactory | nullNoThe hands-free microphone (`createHandsFreeCapture` from `@happyvertical/smrt-ui/forms/hands-free`); see `AssistantComposer`.handsFreeVadHandsFreeVadOptionsNoPause length and sensitivity for hands-free; see `AssistantComposer`.sendOnPausebooleanNoHands-free: send once the speaker stops talking; see `AssistantComposer`.sendOnPauseMsnumberNoQuiet time before `sendOnPause` sends, in ms (default 1200).speakingbooleanNoThe reply is being read aloud: hands-free listening pauses meanwhile; see `AssistantComposer`.Bindable state
This component has no bindable public state.
Callback events
oncontroller(controller: AssistantDockController) => voidonactionapplied(request: DataSurfaceActionRequest, result: DataSurfaceActionResult) => voidonactionsettled(request: DataSurfaceActionRequest, outcome: AssistantActionOutcome) => voidonstatus(status: AssistantStatus) => voidonrun(run: AssistantRun | null) => voidonattentionchange(required: boolean) => void