import { type ClientVoiceInputConfig } from "@opengeni/sdk"; import { type ComponentProps, type CSSProperties } from "react"; import type { ClientOverride } from "../session-context.js"; import { type ModelPolicyPickerProps } from "./model-policy-picker.js"; import { type SessionConversationController, type UseSessionConversationOptions } from "../hooks/use-session-conversation.js"; import type { SessionRealtimeControl } from "../realtime/realtime-control.js"; import { type GenieLoadingOptions } from "../timeline/genie-loading.js"; import { ApprovalSurface } from "./approval-surface.js"; import { type ChatComposerProps } from "./chat-composer.js"; import type { ComposerTranscriptionControlProps } from "./composer-transcription-control.js"; import { type SessionChromeProps } from "./session-chrome.js"; import { type HumanInputSurfaceProps } from "./human-input-surface.js"; import { type MessageTimelineProps } from "./message-timeline.js"; import { type OpenGeniLinkResolver, type OpenGeniViewerTarget } from "./open-geni-links.js"; import type { UserMessageDisclosureLabels } from "./user-message-body.js"; import { type SessionProxyBaseUrl } from "./session-proxy-scope.js"; import { type HostSurfacePreference, type HostThemePreference } from "../lib/host-theme.js"; import { type ThisComputerCardProps } from "./this-computer/this-computer-card.js"; export type SessionConversationLabels = { /** Banner action after a refresh failure; the conversation stays mounted. */ retry: string; /** Action when the conversation could not load at all. */ tryAgain: string; /** Shown in place of a Site preview when the session proxy does not serve Sites. */ sitePreviewUnavailable: string; }; export type SessionConversationProps = ClientOverride & SessionProxyBaseUrl & { /** * `null` while your server is still creating the session. Render the * conversation as soon as the person sends, with `pendingPrompt`, then * pass the id when creation returns: it is the same mounted conversation, * so the prompt and its startup row stay put and nothing flashes. */ sessionId: string | null; /** See `useSessionConversation`'s `pendingPrompt`. Read once per conversation. */ pendingPrompt?: UseSessionConversationOptions["pendingPrompt"]; /** Product-owned desktop connection flow for computer offers. No console URLs or shell commands are assumed. */ computerConnection?: Omit; /** Host-owned artifact links, previews and other message presentation. */ renderMessageText?: MessageTimelineProps["renderMessageText"]; /** * Open Opengeni object links in agent replies (`artifact:`, `sandbox:`, * editable artifacts, Sites). Asked first; by default retained files and * sandbox files download only when the proxy explicitly enables them, while * editable artifacts and Sites stay unavailable until the host resolves them. */ resolveLink?: OpenGeniLinkResolver | undefined; /** * Open agent links to editable artifacts and Sites in a host viewer, for * example `SessionArtifactViewer` mounted beside the conversation. Asked * after `resolveLink`. */ onOpenArtifact?: ((target: OpenGeniViewerTarget) => void) | undefined; /** * Open another session the conversation points at: a sub-agent's chat from * its worker card or a child update. `OpenGeniChat` opens it in place; * without it those entries are not links. */ onOpenSession?: ((sessionId: string) => void) | undefined; /** * Current title for a session id, used to name the agents this * conversation spawns, messages, and hears from. Without it, agents keep * the title they were spawned with, or generic labels. */ resolveSessionTitle?: ((sessionId: string) => string | null | undefined) | undefined; /** * Inline previews for assistant `opengeni-site` / `opengeni-html` fences. * Defaults to the Opengeni preview. Behind a session proxy without its * `artifacts` option, Sites show as unavailable without a request; `false` * shows the fence as code. */ renderInteractiveBlock?: MessageTimelineProps["renderInteractiveBlock"] | false; /** Product-specific tool-call renderers; defaults to the built-in registry. */ toolRegistry?: MessageTimelineProps["toolRegistry"]; /** Host presentation without replacing native history, navigation or annotations. */ timelineProps?: Pick | undefined; /** * Replace the "usage limit reached" row for an `allowance_exhausted` * refusal, for example to link your own plan or admin page. */ renderAllowanceExhausted?: MessageTimelineProps["renderAllowanceExhausted"]; /** Replace the words of the default "usage limit reached" row. */ allowanceExhaustedLabels?: MessageTimelineProps["allowanceExhaustedLabels"]; /** * File attachments in the composer. Defaults to true; the attach control * appears only when the deployment's client config enables file uploads. * A session proxy reports them off when `files` is false and for anonymous * visitors (`visitor: true` from `resolve`) unless it sets `visitorUploads`. */ attachments?: boolean | undefined; /** * Composer microphone (dictation into the draft). Defaults to true; it * appears only when the client config reports voice input available * (`createSessionProxyHandler({ voiceInput: false })` turns it off). */ voiceInput?: boolean | undefined; /** * Live speech-to-speech voice in the composer. Opt-in: a call spends the * workspace's credits and asks for the microphone, so it is off unless this * is `true` or the client config reports `realtimeVoice: true` * (`createSessionProxyHandler({ realtimeVoice: true })`). The button then * appears only when the workspace offers an available voice model and the * proxy has not turned voice off (`realtimeVoice: false`). */ realtimeVoice?: boolean | undefined; /** Optional connection/voice handoff; the stock control owns call lifecycle and admission. */ realtimeVoiceProps?: Partial, "codexConnected" | "realtimeAutostartModel" | "onRealtimeAutostartConsumed" | "onVoiceActiveChange" | "modelMenu" | "voiceSettings">> | undefined; /** * Copy and visual for the "working" indicator before the first reply. * Defaults to neutral copy ("Thinking…"); omitted fields keep those * defaults. See `MessageTimeline`'s `genieLoading`. */ genieLoading?: GenieLoadingOptions | undefined; /** * Show the model/reasoning picker. End users of an embedded product rarely * choose models, so it is hidden unless this is `true` or the client config * reports `modelSelection: true` (`createSessionProxyHandler({ modelSelection: true })`). */ modelPicker?: boolean | undefined; /** Model-picker appearance only; visibility, policy and delivery remain owned here. */ modelPickerProps?: Pick | undefined; /** Localized actions for already-sent user-message disclosure. */ userMessageDisclosureLabels?: UserMessageDisclosureLabels | undefined; loadSkillReview?: HumanInputSurfaceProps["loadSkillReview"]; className?: string; /** Defaults to filling the host. The host owns available height. */ height?: CSSProperties["height"]; /** * Mark the conversation read while the person can see it. Defaults to * true: whenever the timeline is on screen, the page is visible and the * window focused, each delivered reply, question or failure is * acknowledged for the signed-in person (once per reply, not per streamed * token). Unread state, and notifications a host derives from it (for * example from `turn.completed` webhooks that check `session.unread`), * then skip replies the person already watched. A hidden or collapsed * timeline, a background tab, or an unfocused window acknowledges nothing. * Set `false` when viewing must not count as reading. */ readAcknowledgement?: boolean | undefined; /** * 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 conversation blends in; `theme` uses the `--og-color-*` surface tokens * as they are. Customized surface tokens are always kept. */ surface?: HostSurfacePreference | undefined; /** Conversation-owned copy (error actions). */ labels?: Partial | undefined; /** Presentation/custom controls only; queue and delivery wiring stay owned here. */ composerProps?: Omit; /** Optional host context and notifications; stock delivery remains authoritative. */ composerOptions?: UseSessionConversationOptions["composerOptions"]; /** Extra status panels without replacing stock queue/goal behavior. */ chromeProps?: Omit; /** Localized questions and presentation; responses remain stock. */ humanInputProps?: Pick; /** Product approval presentation; permission decisions remain stock. */ approvalProps?: Omit, "approvals" | "onApprove" | "onReject" | "responding" | "error">; }; export type SessionConversationViewProps = Omit & { conversation: SessionConversationController; }; /** Complete existing-session conversation. Uses the provider's normal SDK client * (including Site clients), one shared event feed, and authoritative queue state. * `` needs no * provider: it talks to your session proxy and its resolved workspace. */ export declare function SessionConversation({ baseUrl, headers, fetch, ...props }: SessionConversationProps): import("react").JSX.Element; /** Stock view for a controller mounted in a stable host. No second event feed or draft. */ export declare function SessionConversationView(props: SessionConversationViewProps): import("react").JSX.Element; /** * The composer microphone: shown when the deployment can transcribe, enabled * once the workspace's voice-input setting allows it. */ export declare function useComposerTranscription(client: unknown, workspaceId: string, capability: ClientVoiceInputConfig | null): ComposerTranscriptionControlProps | null; export { useClientConfigFlags } from "../hooks/use-client-config-flags.js";