import { type CSSProperties } from "react"; import type { NewConversationCreateOptions } from "../hooks/use-new-conversation.js"; import { type HostSurfacePreference, type HostThemePreference } from "../lib/host-theme.js"; import { type ClientOverride } from "../session-context.js"; import { type SessionConversationProps } from "./session-conversation.js"; import { type SessionListLabels, type SessionListProps } from "./session-list.js"; import { type SessionProxyBaseUrl } from "./session-proxy-scope.js"; export type OpenGeniChatLabels = SessionListLabels & { openChats: string; closeChats: string; newChatPlaceholder: string; /** Heading above the new-chat composer; empty hides it. */ newChatTitle: string; send: string; newChatUnavailable: string; newChatRetry?: string | undefined; newChatPending?: string | undefined; newChatFinishingUploads?: string | undefined; }; /** What the first message carries besides its text. */ export type OpenGeniChatCreateOptions = NewConversationCreateOptions; export type OpenGeniChatProps = ClientOverride & SessionProxyBaseUrl & { /** Controlled selection. `null` shows the new-chat composer. */ sessionId?: string | null | undefined; /** Initial selection when uncontrolled. Defaults to a new chat. */ defaultSessionId?: string | null | undefined; onSessionChange?: ((sessionId: string | null) => void) | undefined; /** * Create a chat from its first message. Defaults to `client.createSession` * with `{ initialMessage, idempotencyKey }` plus the attached files and any * model choice, which `createSessionProxyHandler` accepts when the server * supplies a `createSession` hook. Return the new id. */ createSession?: ((initialMessage: string, idempotencyKey: string, options: OpenGeniChatCreateOptions) => Promise) | undefined; /** * Hide the "New chat" entry point. It is also hidden when the session proxy * reports chat creation unavailable (no `createSession` hook) and no * `createSession` prop is given. */ newChat?: boolean | undefined; /** * Forwarded to the conversation (message rendering, tool renderers, * composer...). `attachments`, `modelPicker`, `modelPickerProps`, and * `composerProps` also apply to the new-chat composer. */ conversationProps?: Omit; /** Forwarded to the list (rename/archive toggles, page size). */ listProps?: Pick | undefined; labels?: Partial | undefined; className?: string | undefined; /** Defaults to filling the host. */ height?: CSSProperties["height"]; /** * Light or dark. Defaults to `auto`: follow the host page (an enclosing * `data-og-theme`, `class="dark"`/`data-theme` on or , the * host's `color-scheme`, then its background), not the OS setting alone. */ theme?: HostThemePreference | undefined; /** * `host` (default) derives backgrounds and cards from the host background so * the chat blends in; `theme` uses the `--og-color-*` surface tokens as they * are. Customized surface tokens are always kept. */ surface?: HostSurfacePreference | undefined; }; /** * A complete chat experience: the user's chat list plus the conversation. * The list is a sidebar when the component is wide and a drawer when narrow * (container-based, so it adapts inside panels as well as full pages). * `` needs no provider: it talks to * your session proxy and uses the workspace the proxy resolves. */ export declare function OpenGeniChat({ baseUrl, headers, fetch, ...props }: OpenGeniChatProps): import("react").JSX.Element;