import { type ComponentType } from "react"; import { type SessionShellSlots } from "../components/rail/session-shell.js"; import type { EditableArtifactSurfaceProps, PdfPreviewProps } from "../lib/app-surfaces.js"; import { type MessageContextInput } from "../lib/message-context.js"; import { type SessionUiFeatures, type SessionUiPreset } from "../lib/session-ui-features.js"; /** * Heavy viewers the host can supply (they need bundler-specific workers): * PDF pages, and the document, spreadsheet and presentation editor. Without * one, PDFs open as a link and editable artifacts open in the web app. */ export type SessionAppSurfaces = Readonly<{ pdfPreview?: ComponentType | undefined; editableArtifact?: ComponentType | undefined; }>; export type { EditableArtifactSurfaceProps, PdfPreviewProps }; export type SessionAppProps = Readonly<{ /** The Opengeni API origin, such as `https://api.example.com`. */ apiBaseUrl: string; /** Headers that authenticate every API call, typically `Authorization: Bearer …`. */ headers: () => Record; /** * The Opengeni web app's origin, such as `https://app.example.com`, where * pages the embed doesn't show (settings, billing, schedules) open. App paths * resolve against the origin, so a path after it is ignored. */ consoleUrl: string; workspaceId: string; /** * The open chat; null or absent for the new-chat page. Changing it opens * that chat. The person can open others inside the app: `onSessionChange` * reports each, so a host that stores this value stays in step. */ sessionId?: string | null | undefined; /** Called when the person opens another chat (null: the new-chat page). */ onSessionChange?: ((sessionId: string | null) => void) | undefined; /** * Which features show. `embed` (default) is the chat list, chats and * composer; `companion` (first-party side panes) adds the session panel and * Opengeni's brand; `app` is the web app. `features` switches single ones. */ preset?: SessionUiPreset | undefined; features?: Partial | undefined; /** Sections the host adds to the shell: a workspace picker, banners, a footer. */ slots?: SessionShellSlots | undefined; /** Heavy viewers the host turns on. */ surfaces?: SessionAppSurfaces | undefined; /** Light or dark from the host application; the person's own choice otherwise. */ theme?: "light" | "dark" | undefined; /** * Opens a URL outside the embed: app-only pages, provider sign-in, checkout, * files and images opened in full. Defaults to a new tab, or a toast with an * Open button when the browser blocks it. When set, flows that would open a * tab in advance (checkout) wait for the URL and pass it here instead. */ openUrl?: ((url: string) => void) | undefined; /** Classes for the app's root element (it fills its container by default). */ className?: string | undefined; /** Called when the API rejects the credentials (any call answering 401). */ onUnauthorized?: (() => void) | undefined; /** * Model context added to each new chat and message, such as where the person * is writing from and what they have selected. Items with a `label` show as * pills above the composer, and the person can leave one out; pass a new * value whenever it changes. A function is read when each message is sent * and shows nothing. Context for the model, never instructions. */ messageContext?: MessageContextInput; }>; /** * The full Opengeni session app inside a host page: chat list, session page, * new-chat page and composer, exactly as the web app renders them. */ export declare function SessionApp(props: SessionAppProps): import("react").JSX.Element;