import type { BotMessageTheme, FooterTheme, TextInputTheme, UserMessageTheme, FeedbackTheme, DisclaimerPopUpTheme, DateTimeToggleTheme } from '@/widget/features/bubble'; import type { observersConfigType } from './observer'; import type { WidgetFeatureOverrides } from '@/types/features'; import type { WidgetAccessToken } from '@/widget/auth/accessToken'; import type { WidgetScope } from '@/chat'; import type { WidgetSessionConfig } from './session'; export type BotProps = { deploymentId: string; /** * Preview/trial mount (e.g. the deployment wizard Review step). Suppresses * all server session reads/writes and isolates localStorage persistence * under a `preview:`-prefixed scope. */ previewMode?: boolean; apiHost?: string; onRequest?: (request: RequestInit) => Promise; chatflowConfig?: Record; backgroundColor?: string; themeBaseColor?: string; welcomeMessage?: string; errorMessage?: string; botMessage?: BotMessageTheme; userMessage?: UserMessageTheme; textInput?: TextInputTheme; feedback?: FeedbackTheme; poweredByTextColor?: string; badgeBackgroundColor?: string; bubbleBackgroundColor?: string; bubbleTextColor?: string; showTitle?: boolean; showAgentMessages?: boolean; title?: string; titleAvatarSrc?: string; titleTextColor?: string; titleBackgroundColor?: string; formBackgroundColor?: string; formTextColor?: string; fontSize?: number; /** The face Latin content is set in. */ fontFamily?: string; arabicFontFamily?: string; isFullPage?: boolean; isBubbleWindow?: boolean; /** Full-page landing: render Core's arrow-field artwork behind the logo. Defaults to on. */ showLandingArtwork?: boolean; footer?: FooterTheme; sourceDocsTitle?: string; observersConfig?: observersConfigType; starterPrompts?: string[] | Record; starterPromptFontSize?: number; heroGreeting?: string; heroHeadline?: string; clearChatOnReload?: boolean; disclaimer?: DisclaimerPopUpTheme; dateTimeToggle?: DateTimeToggleTheme; renderHTML?: boolean; /** * Dynamic UI: render the inline components (tables, charts, forms, approvals…) TORUK Core's * assistant can emit, and request the AG-UI wire that streams them live. Defaults to on; * Core downgrades to the legacy wire by itself when Dynamic UI is disabled server-side, and * replayed history still renders components either way. Set false to pin the legacy wire. */ dynamicUi?: boolean; /** * Feature switches for this embed — sessions, newChat, artifacts, dynamicUi, fileUploads, * speechToText, textToSpeech, feedback, followUpPrompts. Only `false` has an effect: an * override hides a control CORE would serve, but never enables one CORE has not advertised. * The deployment owner's saved switches arrive through `/config` and apply on their own. */ features?: WidgetFeatureOverrides; /** * Pin the widget to one conversation. `session.id` names it; `session.mode: 'locked'` also takes * session navigation and New Chat away from the visitor, so the host decides what is on screen. * This is a UI boundary, not an authorization one — CORE still governs what the caller may read. * Omitted, the widget resumes the most recent session exactly as before. */ session?: WidgetSessionConfig; /** * Which part of the conversation to render. `scope.messages` selects responses — `'*'` for all, * `-1` for the latest (which keeps following a live stream), a 1-based position, or `{ id }` for * one exact response. `scope.render` chooses `'request-response'` or `'response-only'`. * Rendering only: it never changes authorization, conversation context or write permissions. * Omitted, the whole conversation renders exactly as before. */ scope?: WidgetScope; /** * Widget language: `'en'` (default) or `'ar'`, which also flips the widget to right-to-left. * Region tags such as `'ar-SA'` are accepted; anything unsupported falls back to English. When * omitted, the language the deployment owner saved in CORE applies. */ language?: string; /** * The signed-in user's TORUK access token, or a function returning it. Sent as * `Authorization: Bearer` on every request so CORE runs the conversation as that user. * Required by deployments published with "User Access". See `WidgetAccessToken`. */ accessToken?: WidgetAccessToken; /** * Template-variant overrides for the `--toruk-*` design tokens, merged over the light/dark * palette. This is how a variant keeps its own identity (Erebus' purple, Neptune's cyan) * while inheriting Core's geometry, typography and component styling. */ designTokens?: Record; closeBot?: () => void; onConversationStarted?: () => void; onNewChat?: () => void; }; export type LeadsConfig = { status: boolean; title?: string; name?: boolean; email?: boolean; phone?: boolean; successMessage?: string; };