Skip to content

ChatLayer

Operation-aware floating chat windows for a clicky RPC application.

Source

import { ChatLayer } from "@flanksource/clicky-ui/rpc";

No dedicated Storybook demo is available for this component yet.

The props table documents the component-specific surface. Standard DOM attributes inherited from React, such as className, event handlers, and accessibility attributes, may also be accepted when the component’s prop type extends a native element.

Prop Type Default Description
chat Partial<ChatProps> — Props forwarded to the inner <Chat>. The window manages `threadId` and merges attached context / tool preferences into `body` on top of these.
client* OperationsApiClient — —
contextTypeConfig ContextTypeConfig — Maps context item `type` to an icon/colour for the badge row.
defaultToolPolicy enum — Initial mode assigned to tools when they first load. Defaults to "ask".
headerExtras ReactNode — Extra controls rendered in the header, e.g. a <ContextMeter mode="gauge"/> gauge.
operationFilter (…) => boolean — Narrows which operations become tools. Defaults to all operations.
renderContextPicker (…) => ReactNode — Optional app-owned entity/document picker rendered beside context badges.
runtimesApi string | null — Backend runtime catalog endpoint. Null uses the built-in runtime families without probing host availability.
sessionsApi string | null — Canonical Captain session endpoint used for list/create/get/delete and approval resolution, or null to disable persistence. Defaults to "/api/chat/sessions".
threadsSource ThreadSource — Inject the thread list/delete directly instead of fetching `sessionsApi` (e.g. an app that loads conversations via its own client). Shows the picker regardless of `sessionsApi`.
title ReactNode — Header title shown when the thread picker is disabled.
toolRenderers ToolRenderAdapter[] | ToolRenderRegistry — Domain tool input/output renderers forwarded to the inner <Chat>. Host adapters match before the built-in heuristics.
toolsApi string | null — Backend tool catalog endpoint. Defaults to "/api/chat/tools"; null disables fetching.