@devicai/ui 0.61.0 → 0.61.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -748,7 +748,7 @@ function ChatDrawerInner({ assistantId, chatUid: initialChatUid, options = {}, e
748
748
  ? t(mergedOptions.title)
749
749
  : mergedOptions.title }), jsxRuntime.jsx(ConversationSelector.ConversationSelector, { assistantId: assistantId, currentChatUid: chat.chatUid, onSelect: handleConversationSelect, onNewChat: handleNewChat, apiKey: apiKey, baseUrl: baseUrl, tenantId: tenantId, subtenantId: subtenantId, conversationPreview: mergedOptions.conversationPreview }), jsxRuntime.jsxs("div", { className: "devic-drawer-header-actions", children: [mergedOptions.showIntegrationsButton !== false && (jsxRuntime.jsx(IntegrationsLauncher.IntegrationsLauncher, { state: integrationsState, mcp: mcpState, onClick: () => setIntegrationsOpen(true), label: t(mergedOptions.integrationsLabel), maxLogos: mergedOptions.maxIntegrationLogos, dark: theme.isDarkTheme(modalTheme), placeholders: pendingIntegrations, loading: integrationsDeciding })), mergedOptions.showCoreMemoryButton && (jsxRuntime.jsx("button", { className: "devic-new-chat-btn", onClick: () => setCoreMemoryOpen(true), type: "button", "aria-label": coreMemoryTitle, title: coreMemoryTitle, children: jsxRuntime.jsx(BrainIcon, {}) })), jsxRuntime.jsx("button", { className: "devic-new-chat-btn", onClick: handleNewChat, type: "button", "aria-label": t('New chat'), title: t('New chat'), children: jsxRuntime.jsx(PlusIcon, {}) }), !isInline && (jsxRuntime.jsx("button", { className: "devic-drawer-close", onClick: handleClose, type: "button", "aria-label": t('Close chat'), children: jsxRuntime.jsx(CloseIcon, {}) }))] })] }), chat.error && (jsxRuntime.jsx("div", { className: "devic-error", children: chat.error.message })), jsxRuntime.jsx(ChatMessages.ChatMessages, { messages: chat.messages, allMessages: chat.messages, isLoading: chat.isLoading, welcomeMessage: mergedOptions.welcomeMessage, suggestedMessages: mergedOptions.suggestedMessages, onSuggestedClick: handleSuggestedClick, showToolTimeline: mergedOptions.showToolTimeline, toolRenderers: mergedOptions.toolRenderers, toolIcons: mergedOptions.toolIcons, loadingIndicator: mergedOptions.loadingIndicator, showFeedback: mergedOptions.showFeedback, feedbackMap: feedbackMap, onFeedback: handleFeedback, handedOffSubThreadId: chat.handedOffSubThreadId || undefined, onHandoffCompleted: chat.onHandoffCompleted, handoffWidgetRenderer: mergedOptions.handoffWidgetRenderer, toolGroups: mergedOptions.toolGroups, userMessageRenderer: mergedOptions.userMessageRenderer, assistantMessageRenderer: mergedOptions.assistantMessageRenderer, apiKey: resolvedApiKey, baseUrl: resolvedBaseUrl, pollingInterval: pollingInterval, pendingInlineWidgets: inlineWidgets, onSubmitWidget: chat.submitWidgetResponse, onCancelWidget: chat.cancelWidgetCall, recalledMemories: mergedOptions.showRecalledMemories
750
750
  ? chat.recalledMemories
751
- : undefined, recalledMemoriesRenderer: mergedOptions.recalledMemoriesRenderer, compactions: mergedOptions.showCompaction ? chat.compactions : undefined, compaction: mergedOptions.showCompaction ? chat.compaction : undefined, compactionRenderer: mergedOptions.compactionRenderer, guardrailRenderer: mergedOptions.guardrailRenderer, expandableCompaction: mergedOptions.expandableCompaction }), mergedOptions.liveVoice?.enabled && jsxRuntime.jsx(React.Suspense, { fallback: null, children: jsxRuntime.jsx(LiveVoicePanel, { voice: chat.voice, client: infoClient, assistantId: assistantId, chatUid: chat.chatUid, canStart: isOpen && assistantInfo$1.assistant?.liveVoice?.enabled === true && !chat.isLoading && !chat.handedOff && !chat.limitExceeded && !inputWidget && inlineWidgets.length === 0, recordSessions: assistantInfo$1.assistant?.liveVoice?.recordSessions, children: chat.voice.active && !inputWidget ? jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [limitBannerNode, usageBarNode, queueNoticeNode] }) : null }) }), chat.voice.active && !inputWidget ? null : Boolean(mergedOptions.customPromptBox) && !(chat.voice.active && inputWidget) ? (jsxRuntime.jsxs("div", { className: "devic-input-area", children: [limitBannerNode, usageBarNode, integrationsHintNode, queueNoticeNode, mergedOptions.customPromptBox({
751
+ : undefined, recalledMemoriesRenderer: mergedOptions.recalledMemoriesRenderer, compactions: mergedOptions.showCompaction ? chat.compactions : undefined, compaction: mergedOptions.showCompaction ? chat.compaction : undefined, compactionRenderer: mergedOptions.compactionRenderer, guardrailRenderer: mergedOptions.guardrailRenderer, expandableCompaction: mergedOptions.expandableCompaction }), mergedOptions.liveVoice?.enabled && (chat.voice.active || !assistantInfo$1.assistant || assistantInfo$1.assistant.liveVoice?.enabled === true) && jsxRuntime.jsx(React.Suspense, { fallback: null, children: jsxRuntime.jsx(LiveVoicePanel, { voice: chat.voice, client: infoClient, assistantId: assistantId, chatUid: chat.chatUid, canStart: isOpen && assistantInfo$1.assistant?.liveVoice?.enabled === true && !chat.isLoading && !chat.handedOff && !chat.limitExceeded && !inputWidget && inlineWidgets.length === 0, recordSessions: assistantInfo$1.assistant?.liveVoice?.recordSessions, children: chat.voice.active && !inputWidget ? jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [limitBannerNode, usageBarNode, queueNoticeNode] }) : null }) }), chat.voice.active && !inputWidget ? null : Boolean(mergedOptions.customPromptBox) && !(chat.voice.active && inputWidget) ? (jsxRuntime.jsxs("div", { className: "devic-input-area", children: [limitBannerNode, usageBarNode, integrationsHintNode, queueNoticeNode, mergedOptions.customPromptBox({
752
752
  voice: chat.voice,
753
753
  sendMessage: handleSend,
754
754
  transcribeAudio,
@@ -1 +1 @@
1
- {"version":3,"file":"ChatDrawer.js","sources":["../../../../../src/components/ChatDrawer/ChatDrawer.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback, useMemo, useRef, forwardRef, useImperativeHandle } from 'react';\nimport { useDevicChat } from '../../hooks/useDevicChat';\nimport { useOptionalDevicContext } from '../../provider';\nimport { DevicApiClient } from '../../api/client';\nimport { useAssistantInfo } from '../../api/assistantInfo';\nimport { ChatMessages } from './ChatMessages';\nimport { ChatInput } from './ChatInput';\nimport { ConversationSelector } from './ConversationSelector';\nimport { ChatDrawerErrorBoundary } from './ErrorBoundary';\nimport { UsageBar } from './UsageBar';\nimport { LimitBanner } from './LimitBanner';\nimport { QueueNotice } from './QueueNotice';\nimport { CoreMemoryModal, DEFAULT_CORE_MEMORY_LABELS } from '../CoreMemoryModal';\nimport {\n IntegrationsHint,\n IntegrationsLauncher,\n IntegrationsModal,\n IntegrationsToggle,\n useIntegrations,\n useTenantMcp,\n integrationChoiceKey,\n readIntegrationChoice,\n writeIntegrationChoice,\n pruneIntegrationChoice,\n} from '../IntegrationsModal';\nimport { isDarkTheme } from '../theme';\nimport { DevicTranslationsProvider, useTranslations } from '../../i18n';\nimport type { DevicTheme } from '../theme';\nimport type { ChatDrawerProps, ChatDrawerOptions, ChatDrawerHandle } from './ChatDrawer.types';\nimport type { QueueDisposition } from '../../api/types';\nimport './styles.css';\nconst LiveVoicePanel = React.lazy(() => import('./LiveVoicePanel'));\nimport { avatarUri } from '../../utils/avatar';\n\nconst DEFAULT_OPTIONS: Required<ChatDrawerOptions> = {\n liveVoice: { enabled: false },\n position: 'right',\n width: '100%',\n defaultOpen: false,\n color: '#1890ff',\n welcomeMessage: '',\n suggestedMessages: [],\n enableFileUploads: false,\n allowedFileTypes: { images: true, documents: true },\n maxFileSize: 10 * 1024 * 1024,\n enableLongTextPaste: false,\n longTextPasteThreshold: 2000,\n enableSpeechToText: false,\n speechLanguage: undefined as any,\n speechAutoStop: true,\n speechAutoStopCountdownMs: 1000,\n speechAutoStopSilenceMs: 1000,\n speechAutoStopSilenceRatio: 0.1,\n speechAutoStopSilenceLevel: 0.02,\n speechAutoStopSpeechLevel: 0.12,\n speechHandoff: false,\n speechHandoffSendDelayMs: 1000,\n speechHandoffHoldMs: 3000,\n inputPlaceholder: 'Type a message...',\n title: 'Chat',\n showAvatar: false,\n avatarUrl: undefined as any,\n showToolTimeline: true,\n zIndex: 1000,\n borderRadius: 0,\n resizable: false,\n minWidth: 300,\n maxWidth: 800,\n style: {},\n fontFamily: undefined as any,\n backgroundColor: undefined as any,\n textColor: undefined as any,\n secondaryBackgroundColor: undefined as any,\n borderColor: undefined as any,\n userBubbleColor: undefined as any,\n userBubbleTextColor: undefined as any,\n assistantBubbleColor: undefined as any,\n assistantBubbleTextColor: undefined as any,\n sendButtonColor: undefined as any,\n loadingIndicator: undefined as any,\n sendButtonContent: undefined as any,\n toolRenderers: undefined as any,\n toolIcons: undefined as any,\n showFeedback: true,\n handoffWidgetRenderer: undefined as any,\n toolGroups: undefined as any,\n stopButtonContent: undefined as any,\n debug: false,\n persistConversation: false,\n customPromptBox: undefined as any,\n userMessageRenderer: undefined as any,\n assistantMessageRenderer: undefined as any,\n conversationPreview: 'date',\n showUsageBar: false,\n usageBarMetric: undefined as any,\n usageBarDisplay: undefined as any,\n customUsageBar: undefined as any,\n hideLimitBanner: false,\n limitBannerRenderer: undefined as any,\n hideQueueNotice: false,\n queueNoticeRenderer: undefined as any,\n // Unset on purpose: the assistant's own setting decides.\n messageQueue: undefined as any,\n showRecalledMemories: true,\n recalledMemoriesRenderer: undefined as any,\n showCompaction: true,\n expandableCompaction: false,\n compactionRenderer: undefined as any,\n guardrailRenderer: undefined as any,\n showCoreMemoryButton: false,\n coreMemoryLabels: undefined as any,\n showIntegrationsButton: true,\n integrationsLabel: 'Connected apps',\n maxIntegrationLogos: 6,\n showIntegrationsHint: true,\n // Left unset so the strip can say \"Connect your apps\" or \"Explore connected\n // apps\" depending on what the end user has actually done.\n integrationsHintLabel: undefined as any,\n showIntegrationsToggle: true,\n integrationsToggleLabel: 'Apps in this chat',\n translations: undefined as any,\n};\n\n/**\n * Chat drawer component for Devic assistants\n *\n * @example\n * ```tsx\n * <ChatDrawer\n * ref={drawerRef}\n * assistantId=\"my-assistant\"\n * options={{\n * position: 'right',\n * width: 400,\n * welcomeMessage: 'Hello! How can I help you?',\n * suggestedMessages: ['Help me with...', 'Tell me about...'],\n * }}\n * modelInterfaceTools={[\n * {\n * toolName: 'get_user_location',\n * schema: { ... },\n * callback: async () => ({ lat: 40.7, lng: -74.0 })\n * }\n * ]}\n * onMessageReceived={(msg) => console.log('Received:', msg)}\n * />\n * ```\n */\nexport const ChatDrawer = forwardRef<ChatDrawerHandle, ChatDrawerProps>(\n function ChatDrawer(props, ref) {\n return (\n <ChatDrawerErrorBoundary>\n <ChatDrawerInner {...props} forwardedRef={ref} />\n </ChatDrawerErrorBoundary>\n );\n }\n);\n\ninterface ChatDrawerInnerProps extends ChatDrawerProps {\n forwardedRef?: React.Ref<ChatDrawerHandle>;\n}\n\nfunction ChatDrawerInner({\n assistantId,\n chatUid: initialChatUid,\n options = {},\n enabledTools,\n modelInterfaceTools,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n apiKey,\n baseUrl,\n pollingInterval,\n streaming,\n onMessageSent,\n onMessageReceived,\n onToolCall,\n onError,\n onChatCreated,\n onFileUpload,\n onOpen,\n onClose,\n isOpen: controlledIsOpen,\n className,\n mode = 'drawer',\n onConversationChange,\n forwardedRef,\n}: ChatDrawerInnerProps): JSX.Element {\n // Merge options with defaults\n const mergedOptions = useMemo(\n () => ({ ...DEFAULT_OPTIONS, ...options }),\n [options]\n );\n\n // Texts the drawer renders itself, translated through the dictionary of the\n // provider plus this drawer's own. Applied to the option defaults too, so a\n // host that leaves `title` or `inputPlaceholder` alone still gets them in\n // its language; a host that sets its own text keeps it, unless it also put\n // that text in the dictionary.\n const t = useTranslations(mergedOptions.translations);\n\n // localStorage key for persisting selected conversation\n const storageKey = mergedOptions.persistConversation\n ? `devic-ui-chatUid-${assistantId}`\n : null;\n\n // Resolve initial chatUid: prop takes priority, then localStorage\n const resolvedInitialChatUid = useMemo(() => {\n if (initialChatUid) return initialChatUid;\n if (storageKey) {\n try { return localStorage.getItem(storageKey) || undefined; } catch { return undefined; }\n }\n return undefined;\n }, [initialChatUid, storageKey]);\n\n // Drawer open state (can be controlled or uncontrolled; inline mode is always open)\n const [internalIsOpen, setInternalIsOpen] = useState(mergedOptions.defaultOpen);\n const isInline = mode === 'inline';\n const isOpen = isInline ? true : (controlledIsOpen ?? internalIsOpen);\n\n // Wrap onChatCreated to persist chatUid in localStorage\n const handleChatCreated = useCallback(\n (chatUid: string) => {\n if (storageKey) {\n try { localStorage.setItem(storageKey, chatUid); } catch {}\n }\n onChatCreated?.(chatUid);\n },\n [storageKey, onChatCreated]\n );\n\n /**\n * What the end user switched off: connected apps by slug, and their own MCP\n * servers by the `toggleId` the API hands out.\n *\n * Remembered in this browser (see `integrationChoice`) rather than only for\n * the life of the drawer — a reload used to forget it, which for someone who\n * keeps an app switched off on purpose reads as the switch not working. The\n * server still keeps nothing beyond the turn it was sent for; what is stored\n * is a preference of whoever is at this keyboard.\n *\n * The badge on the plug is what keeps that honest: a remembered choice is\n * visible at a glance rather than being an unexplained silence from an app.\n */\n const [disabledIntegrations, setDisabledIntegrations] = useState<string[]>([]);\n\n // Use chat hook\n const chat = useDevicChat({\n assistantId,\n chatUid: resolvedInitialChatUid,\n apiKey,\n baseUrl,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n enabledTools,\n disabledIntegrations,\n modelInterfaceTools,\n pollingInterval,\n streaming,\n onMessageSent,\n onMessageReceived,\n onToolCall,\n onError,\n onChatCreated: handleChatCreated,\n onFileUpload,\n messageQueue: mergedOptions.messageQueue,\n liveVoice: mergedOptions.liveVoice,\n debug: mergedOptions.debug,\n });\n\n // Fetch assistant avatar when showAvatar is enabled\n useEffect(() => { if (!isOpen) void chat.voice.stop(); }, [isOpen, chat.voice.stop]);\n const context = useOptionalDevicContext();\n const resolvedApiKey = apiKey || context?.apiKey;\n // The session source, when the page authenticates with one. Every client\n // built below gets it, or a page without an API key would have nothing to\n // authenticate with.\n const resolvedTenantSession = context?.getTenantSession;\n const onSessionExpired = context?.onSessionExpired;\n const resolvedBaseUrl = baseUrl || context?.baseUrl || 'https://api.devic.ai';\n const [coreMemoryOpen, setCoreMemoryOpen] = useState(false);\n const [integrationsOpen, setIntegrationsOpen] = useState(false);\n\n const infoClient = useMemo(\n () =>\n resolvedApiKey || resolvedTenantSession\n ? new DevicApiClient({\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n getTenantSession: resolvedTenantSession,\n onSessionExpired,\n })\n : null,\n [resolvedApiKey, resolvedTenantSession, resolvedBaseUrl]\n );\n\n // Asked for only when something on screen depends on it, and then at most\n // once per assistant however many times this drawer is mounted — a host that\n // remounts it to start a fresh conversation used to pay for the answer again\n // every time.\n const assistantInfo = useAssistantInfo({\n assistantId,\n client: infoClient,\n baseUrl: resolvedBaseUrl,\n credential: resolvedApiKey || 'session',\n enabled:\n (!!mergedOptions.liveVoice?.enabled && isOpen) ||\n (!!mergedOptions.showAvatar && !mergedOptions.avatarUrl) ||\n (mergedOptions.showIntegrationsButton !== false && isOpen),\n });\n // The host's own image wins: an assistant carries one image for everybody, so\n // this is the only place a per-account face can come from. Failing that, an\n // assistant with no uploaded image still gets a face, generated from its\n // identifier — the same one the console shows for it. Drawn from `assistantId`\n // rather than from the fetched assistant so the header is not empty while the\n // lookup is in flight; the two agree, since that is what was asked for.\n const avatarUrl = mergedOptions.showAvatar\n ? (mergedOptions.avatarUrl ??\n assistantInfo.assistant?.imgUrl ??\n avatarUri(\n assistantInfo.assistant?.identifier || assistantId,\n assistantInfo.assistant?.avatarStyle\n ))\n : null;\n\n /**\n * Whether to ask which apps this assistant offers.\n *\n * The listing is worth a request only when there is something to list, and\n * most assistants offer nothing — for those, the call existed purely to be\n * refused, once per page load. The assistant now says so itself, so a plain\n * `false` settles it without asking.\n *\n * Anything else asks, exactly as before: a field that is absent means the API\n * is older than it, not that the answer is no, and a failed lookup means we\n * could not find out. Hiding the button on either would lose the feature for\n * a deployment that has it, which is far worse than one spare request.\n *\n * Where there are apps to show, this puts the two requests in sequence rather\n * than at once, so the listing lands later than it used to. The header holds\n * its place in the meantime — see `pendingIntegrations`.\n */\n const mayOfferIntegrations =\n assistantInfo.settled &&\n assistantInfo.assistant?.tenantIntegrations?.enabled !== false;\n\n // The apps this assistant offers its tenants. Loaded once, here, because the\n // header control cannot decide whether to exist without it — and lent to the\n // modal so opening it does not ask for the same listing again. Nothing is\n // fetched until the drawer is opened for the first time.\n const integrationsState = useIntegrations({\n assistantId,\n tenantId,\n subtenantId,\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n enabled:\n mergedOptions.showIntegrationsButton !== false &&\n isOpen &&\n mayOfferIntegrations,\n });\n\n /**\n * Whether this assistant offers MCP servers of the tenant's own.\n *\n * Read exactly like `mayOfferIntegrations`: absence means \"cannot tell\", so\n * the listing is asked for anyway. A deployment older than the field keeps\n * the behaviour it had — one refusal per drawer open — rather than losing the\n * feature.\n */\n const mayOfferMcp =\n assistantInfo.settled &&\n assistantInfo.assistant?.tenantMcpServers?.enabled !== false;\n\n /**\n * The tenant's own MCP servers, loaded here rather than inside the modal.\n *\n * The composer's switch needs them too, and it is not inside the modal — so\n * the listing has to live above both. The modal takes it as a prop and stops\n * asking for its own.\n */\n const mcpState = useTenantMcp({\n assistantId,\n tenantId,\n subtenantId,\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n enabled:\n mergedOptions.showIntegrationsButton !== false && isOpen && mayOfferMcp,\n });\n\n /**\n * Whether the answer to \"is there anything to show here\" is still on its way.\n *\n * Two requests decide it — what the assistant offers, and then what this\n * tenant has connected — and until both have answered the control cannot\n * know whether to exist. Without this the header simply had a gap and then a\n * button, which reads as the page changing its mind.\n */\n const integrationsDeciding =\n mergedOptions.showIntegrationsButton !== false &&\n isOpen &&\n (!assistantInfo.settled ||\n (mayOfferIntegrations && !integrationsState.settled) ||\n (mayOfferMcp && !mcpState.settled));\n\n /**\n * Placeholder chips to hold while the listing is in flight.\n *\n * Only when the assistant has said outright that it offers apps, and how\n * many: on a maybe there would be nothing to hold the place of half the time,\n * and a control that appears and then vanishes is worse than one that arrives\n * late. So this stays at zero for an API that does not say, which is also the\n * behaviour every version until now had.\n */\n const pendingIntegrations =\n assistantInfo.assistant?.tenantIntegrations?.enabled === true &&\n !integrationsState.settled\n ? (assistantInfo.assistant.tenantIntegrations.count ?? 0)\n : 0;\n\n // Tenant/subtenant resolution mirrors useDevicChat (prop overrides provider).\n const resolvedTenantId = tenantId || context?.tenantId;\n const resolvedSubtenantId = subtenantId || context?.subtenantId;\n\n // ── Remembering which apps and servers are switched off ────────────────\n\n const choiceKey = integrationChoiceKey(\n assistantId,\n resolvedTenantId,\n resolvedSubtenantId\n );\n\n // Loaded per key, so switching tenant loads that tenant's choice rather than\n // carrying the previous one over.\n const loadedChoiceRef = useRef<string | null>(null);\n useEffect(() => {\n if (loadedChoiceRef.current === choiceKey) return;\n loadedChoiceRef.current = choiceKey;\n setDisabledIntegrations(readIntegrationChoice(choiceKey));\n }, [choiceKey]);\n\n useEffect(() => {\n // Only once this key's stored value has been read, or the empty initial\n // state would erase it before it was ever loaded.\n if (loadedChoiceRef.current !== choiceKey) return;\n writeIntegrationChoice(choiceKey, disabledIntegrations);\n }, [choiceKey, disabledIntegrations]);\n\n /**\n * Forgets what is no longer on offer, once the listings can say so.\n *\n * Every clause of this is load-bearing. `mayOffer*` is false BEFORE the\n * assistant has answered as well as when the answer is no, so without the\n * `assistantInfo.settled` guard the prune runs on the first render against\n * two empty listings and erases the very thing that was just loaded — which\n * is exactly the reload-forgets-it bug this was meant to fix. A definite\n * \"this assistant offers none\" is an answer; an unsettled listing is not.\n *\n * With the drawer never opened, neither listing is ever fetched, so nothing\n * is pruned and the stored choice survives untouched.\n */\n const appsKnown =\n assistantInfo.settled && (!mayOfferIntegrations || integrationsState.settled);\n const mcpKnown = assistantInfo.settled && (!mayOfferMcp || mcpState.settled);\n useEffect(() => {\n if (!appsKnown || !mcpKnown) return;\n const live = [\n ...integrationsState.integrations\n .filter((i) => i.connected)\n .map((i) => i.app),\n ...mcpState.servers\n .filter((s) => s.connection?.status === 'active' && s.connection.toggleId)\n .map((s) => s.connection!.toggleId as string),\n ];\n setDisabledIntegrations((prev) => pruneIntegrationChoice(prev, live));\n }, [appsKnown, mcpKnown, integrationsState.integrations, mcpState.servers]);\n\n // Usage bar (above the input) — only when enabled and a tenant is known.\n // Refetches after each turn via the message count as refresh key.\n const usageBarNode =\n (mergedOptions.showUsageBar ||\n typeof mergedOptions.customUsageBar === 'function') &&\n resolvedTenantId ? (\n <UsageBar\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n tenantId={resolvedTenantId}\n subtenantId={resolvedSubtenantId}\n mode={mergedOptions.showUsageBar === 'onDemand' ? 'onDemand' : 'always'}\n metric={mergedOptions.usageBarMetric}\n display={mergedOptions.usageBarDisplay}\n customUsageBar={mergedOptions.customUsageBar}\n color={mergedOptions.color}\n refreshKey={chat.messages.length}\n debug={mergedOptions.debug}\n />\n ) : null;\n\n // Default usage-limit banner (above the input) — opt-out via hideLimitBanner,\n // override via limitBannerRenderer.\n const limitBannerNode =\n chat.limitExceeded && !mergedOptions.hideLimitBanner\n ? mergedOptions.limitBannerRenderer\n ? mergedOptions.limitBannerRenderer(chat.limitExceeded)\n : <LimitBanner limit={chat.limitExceeded} />\n : null;\n\n // Speech-to-text transcription, exposed to custom prompt boxes so a developer\n // can transcribe audio (binary or URL) and attach the resulting transcriptId.\n const transcribeAudio = useCallback(\n (\n audio: Blob | string,\n transcribeOptions?: {\n language?: string;\n messageUid?: string;\n chatUid?: string;\n tenantId?: string;\n },\n ) => {\n if (!resolvedApiKey && !resolvedTenantSession) {\n return Promise.reject(\n new Error(t('No credentials configured. Cannot transcribe audio.')),\n );\n }\n const client = new DevicApiClient({ apiKey: resolvedApiKey, baseUrl: resolvedBaseUrl, getTenantSession: resolvedTenantSession, onSessionExpired });\n return client.transcribeAudio(audio, {\n language: transcribeOptions?.language ?? mergedOptions.speechLanguage,\n messageUid: transcribeOptions?.messageUid,\n chatUid: transcribeOptions?.chatUid,\n tenantId: transcribeOptions?.tenantId ?? tenantId,\n });\n },\n [resolvedApiKey, resolvedTenantSession, resolvedBaseUrl, mergedOptions.speechLanguage, tenantId],\n );\n\n // Handle open/close\n const handleOpen = useCallback(() => {\n setInternalIsOpen(true);\n onOpen?.();\n }, [onOpen]);\n\n const handleClose = useCallback(() => {\n setInternalIsOpen(false);\n onClose?.();\n }, [onClose]);\n\n const handleToggle = useCallback(() => {\n setInternalIsOpen((prev) => !prev);\n }, []);\n\n // Expose handle for programmatic control\n useImperativeHandle(forwardedRef, () => ({\n open: handleOpen,\n close: handleClose,\n toggle: handleToggle,\n setChatUid: (chatUid: string) => {\n chat.loadChat(chatUid);\n },\n sendMessage: (message: string) => {\n chat.sendMessage(message);\n },\n }), [handleOpen, handleClose, handleToggle, chat]);\n\n // Register this drawer in the DevicProvider so AIElementWrapper can open it\n useEffect(() => {\n if (!context?.registerDrawer) return;\n const unregister = context.registerDrawer({\n open: handleOpen,\n close: handleClose,\n toggle: handleToggle,\n sendMessage: (message: string) => chat.sendMessage(message),\n });\n return unregister;\n }, [context, handleOpen, handleClose, handleToggle, chat]);\n\n // Partition pending widget calls by render mode\n const { inlineWidgets, inputWidget } = useMemo(() => {\n const inline: typeof chat.pendingWidgetCalls = [];\n let input: typeof chat.pendingWidgetCalls[number] | null = null;\n for (const wc of chat.pendingWidgetCalls) {\n if (wc.widget.render === 'input' && !input) {\n input = wc;\n } else {\n inline.push(wc);\n }\n }\n return { inlineWidgets: inline, inputWidget: input };\n }, [chat.pendingWidgetCalls]);\n\n // Active references from DevicProvider (created by AIElementWrapper)\n const references = context?.references ?? [];\n const removeReference = useCallback(\n (id: string) => {\n context?.removeReference(id);\n },\n [context]\n );\n const clearReferences = useCallback(() => {\n context?.clearReferences();\n }, [context]);\n\n // Handle send message — prefix references and clear them after sending\n /**\n * What the last accepted message was told about when it gets picked up. Only\n * the wording of the notice depends on it.\n */\n const [queueDisposition, setQueueDisposition] = useState<\n QueueDisposition | undefined\n >();\n /**\n * What became of a message that did not simply join the queue: it was turned\n * down, or a stop threw it away. Said out loud, because in both cases the\n * user's text has just moved back into the box on its own.\n */\n const [queueAlert, setQueueAlert] = useState<string | null>(null);\n\n const handleSend = useCallback(\n async (\n message: string,\n files?: File[],\n meta?: { transcriptId?: string; tags?: string[] }\n ) => {\n let finalMessage = message;\n if (references.length > 0) {\n const labels = references.map((r) => `\"${r.label}\"`).join(', ');\n finalMessage = `Elemento referenciado: ${labels}\\n\\n${message}`;\n }\n setQueueAlert(null);\n const result = await chat.sendMessage(finalMessage, {\n files,\n transcriptId: meta?.transcriptId,\n tags: meta?.tags,\n });\n\n if ('rejected' in result) {\n // The references belong to the message that was not sent, so they stay.\n if (result.reason !== 'error') {\n // An ordinary error already reaches the host through `onError`; these\n // two do not, and the only sign of them would otherwise be the text\n // reappearing in the box with no explanation.\n setQueueAlert(\n result.reason === 'queue_full'\n ? `${result.message} ${t('Your message is back in the box.')}`\n : t(\n 'The assistant is not taking messages while it works. Your message is back in the box.'\n )\n );\n }\n return result;\n }\n\n setQueueDisposition('queued' in result && result.queued ? result.willProcess : undefined);\n if (references.length > 0) clearReferences();\n return result;\n },\n [chat, references, clearReferences]\n );\n\n /**\n * Whether a message may be written while the assistant is working.\n *\n * Being busy is not the only reason the box closes, and the other two are not\n * about waiting: an inline widget is the assistant waiting on *this* user, and\n * a usage limit is a refusal the queue cannot soften.\n */\n const canQueue =\n chat.queueEnabled && inlineWidgets.length === 0 && !chat.limitExceeded;\n\n const handleStopChat = useCallback(async () => {\n const result = await chat.stopChat();\n setQueueDisposition(undefined);\n setQueueAlert(\n result.discarded\n ? result.discarded === 1\n ? t('A queued message was not sent — the text is back in the box.')\n : t(\n '{count} queued messages were not sent — the text is back in the box.',\n { count: result.discarded }\n )\n : null\n );\n return result;\n }, [chat]);\n\n /**\n * Shown while there is something to explain: the user is writing into a run\n * that has not finished, or messages are already waiting. With nothing typed\n * and nothing queued there is nothing to say.\n */\n const queueNoticeNode =\n !mergedOptions.hideQueueNotice &&\n // `queuedCount` on its own matters: an assistant with an input delay queues\n // what is written into an *idle* conversation whether or not it takes\n // messages while busy, so there can be something waiting with the queue\n // switched off.\n (queueAlert || chat.queuedCount > 0 || (canQueue && chat.isLoading))\n ? mergedOptions.queueNoticeRenderer\n ? mergedOptions.queueNoticeRenderer({\n queuedCount: chat.queuedCount,\n willProcess: queueDisposition,\n alert: queueAlert ?? undefined,\n })\n : (\n <QueueNotice\n queuedCount={chat.queuedCount}\n willProcess={queueDisposition}\n alert={queueAlert ?? undefined}\n />\n )\n : null;\n\n // Handle conversation selection\n const handleConversationSelect = useCallback(\n (chatUid: string) => {\n chat.loadChat(chatUid);\n onConversationChange?.(chatUid);\n if (storageKey) {\n try { localStorage.setItem(storageKey, chatUid); } catch {}\n }\n },\n [chat, onConversationChange, storageKey]\n );\n\n const handleNewChat = useCallback(() => {\n chat.clearChat();\n if (storageKey) {\n try { localStorage.removeItem(storageKey); } catch {}\n }\n }, [chat, storageKey]);\n\n // Handle suggested message click\n const handleSuggestedClick = useCallback(\n (message: string) => {\n chat.sendMessage(message);\n },\n [chat]\n );\n\n // Feedback state\n const [feedbackMap, setFeedbackMap] = useState<Map<string, 'positive' | 'negative'>>(new Map());\n const feedbackClientRef = useRef<DevicApiClient | null>(null);\n\n // Initialize feedback client\n useEffect(() => {\n if ((resolvedApiKey || resolvedTenantSession) && !feedbackClientRef.current) {\n feedbackClientRef.current = new DevicApiClient({\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n getTenantSession: resolvedTenantSession,\n onSessionExpired,\n });\n }\n }, [resolvedApiKey, resolvedTenantSession, resolvedBaseUrl]);\n\n // Load existing feedback when chat changes\n useEffect(() => {\n if (!chat.chatUid || !feedbackClientRef.current || !mergedOptions.showFeedback) return;\n\n feedbackClientRef.current.getChatFeedback(assistantId, chat.chatUid)\n .then((entries) => {\n const newMap = new Map<string, 'positive' | 'negative'>();\n for (const entry of entries) {\n if (entry.feedback !== undefined) {\n newMap.set(entry.requestId, entry.feedback ? 'positive' : 'negative');\n }\n }\n setFeedbackMap(newMap);\n })\n .catch(() => {\n // Silently ignore feedback loading errors\n });\n }, [chat.chatUid, assistantId, mergedOptions.showFeedback]);\n\n // Handle feedback submission\n const handleFeedback = useCallback(\n async (messageId: string, positive: boolean, comment?: string) => {\n if (!chat.chatUid || !feedbackClientRef.current) return;\n\n try {\n await feedbackClientRef.current.submitChatFeedback(assistantId, chat.chatUid, {\n messageId,\n feedback: positive,\n feedbackComment: comment,\n });\n\n setFeedbackMap((prev) => {\n const newMap = new Map(prev);\n newMap.set(messageId, positive ? 'positive' : 'negative');\n return newMap;\n });\n } catch (err) {\n console.error('Failed to submit feedback:', err);\n throw err;\n }\n },\n [chat.chatUid, assistantId]\n );\n\n // Apply CSS variables for theming on the drawer element itself\n // (must target the component root so they override the defaults defined on .devic-chat-drawer)\n const drawerRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n const el = drawerRef.current;\n if (!el) return;\n const vars: [string, string | undefined][] = [\n ['--devic-primary', mergedOptions.color !== DEFAULT_OPTIONS.color ? mergedOptions.color : undefined],\n ['--devic-font-family', mergedOptions.fontFamily],\n ['--devic-bg', mergedOptions.backgroundColor],\n ['--devic-text', mergedOptions.textColor],\n ['--devic-bg-secondary', mergedOptions.secondaryBackgroundColor],\n ['--devic-border', mergedOptions.borderColor],\n ['--devic-user-bubble', mergedOptions.userBubbleColor],\n ['--devic-user-bubble-text', mergedOptions.userBubbleTextColor],\n ['--devic-assistant-bubble', mergedOptions.assistantBubbleColor],\n ['--devic-assistant-bubble-text', mergedOptions.assistantBubbleTextColor],\n ['--devic-send-btn', mergedOptions.sendButtonColor],\n ];\n for (const [name, value] of vars) {\n if (value) {\n el.style.setProperty(name, value);\n } else {\n el.style.removeProperty(name);\n }\n }\n }, [mergedOptions.color, mergedOptions.fontFamily, mergedOptions.backgroundColor, mergedOptions.textColor, mergedOptions.secondaryBackgroundColor, mergedOptions.borderColor, mergedOptions.userBubbleColor, mergedOptions.userBubbleTextColor, mergedOptions.assistantBubbleColor, mergedOptions.assistantBubbleTextColor, mergedOptions.sendButtonColor]);\n\n // The same values, handed to the dialogs this drawer opens. They render\n // through a portal into document.body, so the variables set above — which\n // live on the drawer element — never reach them.\n // The brain button says what the modal it opens is called.\n const coreMemoryTitle =\n mergedOptions.coreMemoryLabels?.title ??\n t(DEFAULT_CORE_MEMORY_LABELS.title);\n\n const modalTheme: DevicTheme = useMemo(\n () => ({\n color:\n mergedOptions.color !== DEFAULT_OPTIONS.color\n ? mergedOptions.color\n : undefined,\n fontFamily: mergedOptions.fontFamily,\n backgroundColor: mergedOptions.backgroundColor,\n textColor: mergedOptions.textColor,\n secondaryBackgroundColor: mergedOptions.secondaryBackgroundColor,\n borderColor: mergedOptions.borderColor,\n }),\n [\n mergedOptions.color,\n mergedOptions.fontFamily,\n mergedOptions.backgroundColor,\n mergedOptions.textColor,\n mergedOptions.secondaryBackgroundColor,\n mergedOptions.borderColor,\n ]\n );\n\n // The strip above the composer. Dismissed per end user, because the whole\n // point of remembering a dismissal is that the same person is not told twice.\n const integrationsHintNode =\n mergedOptions.showIntegrationsButton !== false &&\n mergedOptions.showIntegrationsHint !== false ? (\n <IntegrationsHint\n state={integrationsState}\n onOpen={() => setIntegrationsOpen(true)}\n label={mergedOptions.integrationsHintLabel}\n maxLogos={mergedOptions.maxIntegrationLogos}\n storageKey={`${assistantId}:${resolvedTenantId ?? ''}:${resolvedSubtenantId ?? ''}`}\n dark={isDarkTheme(modalTheme)}\n />\n ) : null;\n\n // The per-message switch in the composer row. Shown only where there is\n // something to switch — the control returns null with nothing connected —\n // and hidden outright by `showIntegrationsToggle: false`.\n const integrationsToggleNode =\n mergedOptions.showIntegrationsButton !== false &&\n mergedOptions.showIntegrationsToggle !== false ? (\n <IntegrationsToggle\n state={integrationsState}\n mcp={mcpState}\n disabled={disabledIntegrations}\n onChange={setDisabledIntegrations}\n onManage={() => setIntegrationsOpen(true)}\n label={t(mergedOptions.integrationsToggleLabel)}\n dark={isDarkTheme(modalTheme)}\n busy={chat.isLoading}\n loading={integrationsDeciding}\n />\n ) : null;\n\n // Resizable drawer\n const [resizedWidth, setResizedWidth] = useState<number | null>(null);\n\n const handleResizeStart = useCallback(\n (e: React.MouseEvent) => {\n e.preventDefault();\n const startX = e.clientX;\n const startWidth = drawerRef.current?.offsetWidth ?? 0;\n const isLeft = mergedOptions.position === 'left';\n\n const onMove = (ev: MouseEvent) => {\n const delta = ev.clientX - startX;\n const newWidth = startWidth + (isLeft ? delta : -delta);\n const clamped = Math.min(\n mergedOptions.maxWidth,\n Math.max(mergedOptions.minWidth, newWidth)\n );\n setResizedWidth(clamped);\n };\n\n const onUp = () => {\n document.removeEventListener('mousemove', onMove);\n document.removeEventListener('mouseup', onUp);\n };\n\n document.addEventListener('mousemove', onMove);\n document.addEventListener('mouseup', onUp);\n },\n [mergedOptions.position, mergedOptions.minWidth, mergedOptions.maxWidth]\n );\n\n // Build style object\n const baseWidth = resizedWidth\n ? `${resizedWidth}px`\n : typeof mergedOptions.width === 'number'\n ? `${mergedOptions.width}px`\n : mergedOptions.width;\n\n const drawerStyle = useMemo(\n () => ({\n width: baseWidth,\n zIndex: mergedOptions.zIndex,\n borderRadius: typeof mergedOptions.borderRadius === 'number'\n ? `${mergedOptions.borderRadius}px`\n : mergedOptions.borderRadius,\n ...mergedOptions.style,\n }),\n [baseWidth, mergedOptions.zIndex, mergedOptions.borderRadius, mergedOptions.style]\n );\n\n const overlayStyle = useMemo(\n () => ({\n zIndex: mergedOptions.zIndex - 1,\n }),\n [mergedOptions.zIndex]\n );\n\n const triggerStyle = useMemo(\n () => ({\n zIndex: mergedOptions.zIndex - 1,\n [mergedOptions.position]: 20,\n bottom: 20,\n }),\n [mergedOptions.zIndex, mergedOptions.position]\n );\n\n return (\n <DevicTranslationsProvider translations={mergedOptions.translations}>\n {/* Overlay (drawer mode only) */}\n {!isInline && (\n <div\n className=\"devic-drawer-overlay\"\n data-open={isOpen}\n style={overlayStyle}\n onClick={handleClose}\n />\n )}\n\n {/* Drawer */}\n <div\n ref={drawerRef}\n className={`devic-chat-drawer ${className || ''}`}\n data-position={mergedOptions.position}\n data-open={isOpen}\n data-mode={mode}\n style={drawerStyle}\n >\n {/* Resize handle */}\n {mergedOptions.resizable && (\n <div\n className=\"devic-resize-handle\"\n data-position={mergedOptions.position}\n onMouseDown={handleResizeStart}\n />\n )}\n\n {/* Header */}\n <div className=\"devic-drawer-header\">\n {avatarUrl && (\n <img\n className=\"devic-drawer-avatar\"\n src={avatarUrl}\n alt=\"\"\n aria-hidden=\"true\"\n />\n )}\n {/* Only a plain string can go through the dictionary; a host that\n passes a node has already decided what it renders. */}\n <h2 className=\"devic-drawer-title\">\n {typeof mergedOptions.title === 'string'\n ? t(mergedOptions.title)\n : mergedOptions.title}\n </h2>\n <ConversationSelector\n assistantId={assistantId}\n currentChatUid={chat.chatUid}\n onSelect={handleConversationSelect}\n onNewChat={handleNewChat}\n apiKey={apiKey}\n baseUrl={baseUrl}\n tenantId={tenantId}\n subtenantId={subtenantId}\n conversationPreview={mergedOptions.conversationPreview}\n />\n <div className=\"devic-drawer-header-actions\">\n {mergedOptions.showIntegrationsButton !== false && (\n <IntegrationsLauncher\n state={integrationsState}\n mcp={mcpState}\n onClick={() => setIntegrationsOpen(true)}\n label={t(mergedOptions.integrationsLabel)}\n maxLogos={mergedOptions.maxIntegrationLogos}\n dark={isDarkTheme(modalTheme)}\n placeholders={pendingIntegrations}\n loading={integrationsDeciding}\n />\n )}\n {mergedOptions.showCoreMemoryButton && (\n <button\n className=\"devic-new-chat-btn\"\n onClick={() => setCoreMemoryOpen(true)}\n type=\"button\"\n aria-label={coreMemoryTitle}\n title={coreMemoryTitle}\n >\n <BrainIcon />\n </button>\n )}\n <button\n className=\"devic-new-chat-btn\"\n onClick={handleNewChat}\n type=\"button\"\n aria-label={t('New chat')}\n title={t('New chat')}\n >\n <PlusIcon />\n </button>\n {!isInline && (\n <button\n className=\"devic-drawer-close\"\n onClick={handleClose}\n type=\"button\"\n aria-label={t('Close chat')}\n >\n <CloseIcon />\n </button>\n )}\n </div>\n </div>\n\n {/* Error display */}\n {chat.error && (\n <div className=\"devic-error\">\n {chat.error.message}\n </div>\n )}\n\n {/* Messages */}\n <ChatMessages\n messages={chat.messages}\n allMessages={chat.messages}\n isLoading={chat.isLoading}\n welcomeMessage={mergedOptions.welcomeMessage}\n suggestedMessages={mergedOptions.suggestedMessages}\n onSuggestedClick={handleSuggestedClick}\n showToolTimeline={mergedOptions.showToolTimeline}\n toolRenderers={mergedOptions.toolRenderers}\n toolIcons={mergedOptions.toolIcons}\n loadingIndicator={mergedOptions.loadingIndicator}\n showFeedback={mergedOptions.showFeedback}\n feedbackMap={feedbackMap}\n onFeedback={handleFeedback}\n handedOffSubThreadId={chat.handedOffSubThreadId || undefined}\n onHandoffCompleted={chat.onHandoffCompleted}\n handoffWidgetRenderer={mergedOptions.handoffWidgetRenderer}\n toolGroups={mergedOptions.toolGroups}\n userMessageRenderer={mergedOptions.userMessageRenderer}\n assistantMessageRenderer={mergedOptions.assistantMessageRenderer}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n pollingInterval={pollingInterval}\n pendingInlineWidgets={inlineWidgets}\n onSubmitWidget={chat.submitWidgetResponse}\n onCancelWidget={chat.cancelWidgetCall}\n recalledMemories={\n mergedOptions.showRecalledMemories\n ? chat.recalledMemories\n : undefined\n }\n recalledMemoriesRenderer={mergedOptions.recalledMemoriesRenderer}\n compactions={\n mergedOptions.showCompaction ? chat.compactions : undefined\n }\n compaction={\n mergedOptions.showCompaction ? chat.compaction : undefined\n }\n compactionRenderer={mergedOptions.compactionRenderer}\n guardrailRenderer={mergedOptions.guardrailRenderer}\n expandableCompaction={mergedOptions.expandableCompaction}\n />\n\n {/* Input */}\n {/* Idle, the voice widget is a card above the composer; during a call\n it takes the composer's place, banners included. */}\n {mergedOptions.liveVoice?.enabled && <React.Suspense fallback={null}>\n <LiveVoicePanel voice={chat.voice} client={infoClient} assistantId={assistantId} chatUid={chat.chatUid}\n canStart={isOpen && assistantInfo.assistant?.liveVoice?.enabled === true && !chat.isLoading && !chat.handedOff && !chat.limitExceeded && !inputWidget && inlineWidgets.length === 0}\n recordSessions={assistantInfo.assistant?.liveVoice?.recordSessions}>\n {chat.voice.active && !inputWidget ? <>{limitBannerNode}{usageBarNode}{queueNoticeNode}</> : null}\n </LiveVoicePanel>\n </React.Suspense>}\n {chat.voice.active && !inputWidget ? null : Boolean(mergedOptions.customPromptBox) && !(chat.voice.active && inputWidget) ? (\n <div className=\"devic-input-area\">\n {limitBannerNode}\n {usageBarNode}\n {integrationsHintNode}\n {queueNoticeNode}\n {mergedOptions.customPromptBox({\n voice: chat.voice,\n sendMessage: handleSend,\n transcribeAudio,\n stop: chat.stopChat,\n isLoading: chat.isLoading,\n queueEnabled: canQueue,\n queuedCount: chat.queuedCount,\n newConversation: chat.clearChat,\n references,\n removeReference,\n clearReferences,\n limitExceeded: chat.limitExceeded,\n })}\n </div>\n ) : (\n <ChatInput\n onSend={handleSend}\n disabled={\n // `handedOff` is one of the states the queue covers — the\n // conversation is waiting on a subagent, which in an embedded\n // widget can take minutes — so with queueing on it no longer\n // closes the box. A pending widget and a usage limit still do:\n // one is the assistant waiting on this user, the other a refusal.\n (chat.isLoading && !canQueue) ||\n (chat.handedOff && !canQueue) ||\n inlineWidgets.length > 0 ||\n !!chat.limitExceeded\n }\n placeholder={t(mergedOptions.inputPlaceholder)}\n enableFileUploads={mergedOptions.enableFileUploads}\n allowedFileTypes={mergedOptions.allowedFileTypes}\n maxFileSize={mergedOptions.maxFileSize}\n enableLongTextPaste={mergedOptions.enableLongTextPaste}\n longTextPasteThreshold={mergedOptions.longTextPasteThreshold}\n enableSpeechToText={mergedOptions.enableSpeechToText}\n speechLanguage={mergedOptions.speechLanguage}\n speechTenantId={tenantId}\n speechAutoStop={mergedOptions.speechAutoStop}\n speechAutoStopCountdownMs={mergedOptions.speechAutoStopCountdownMs}\n speechAutoStopSilenceMs={mergedOptions.speechAutoStopSilenceMs}\n speechAutoStopSilenceRatio={mergedOptions.speechAutoStopSilenceRatio}\n speechAutoStopSilenceLevel={mergedOptions.speechAutoStopSilenceLevel}\n speechAutoStopSpeechLevel={mergedOptions.speechAutoStopSpeechLevel}\n speechHandoff={mergedOptions.speechHandoff}\n speechHandoffSendDelayMs={mergedOptions.speechHandoffSendDelayMs}\n speechHandoffHoldMs={mergedOptions.speechHandoffHoldMs}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n sendButtonContent={mergedOptions.sendButtonContent}\n disabledMessage={\n chat.handedOff\n ? t('Waiting for subagent to complete')\n : inlineWidgets.length > 0\n ? t('Waiting for tool response')\n : undefined\n }\n isProcessing={chat.isLoading && !chat.handedOff}\n onStop={handleStopChat}\n allowQueueing={canQueue}\n queueNotice={queueNoticeNode}\n stopButtonContent={mergedOptions.stopButtonContent}\n pendingInputWidget={inputWidget}\n onSubmitWidget={chat.submitWidgetResponse}\n onCancelWidget={chat.cancelWidgetCall}\n references={references}\n onRemoveReference={removeReference}\n usageBar={usageBarNode}\n limitBanner={limitBannerNode}\n integrationsHint={integrationsHintNode}\n integrationsToggle={integrationsToggleNode}\n />\n )}\n </div>\n\n {/* Trigger button (drawer mode only, when closed) */}\n {!isInline && !isOpen && (\n <button\n className=\"devic-trigger\"\n onClick={handleOpen}\n style={triggerStyle}\n type=\"button\"\n aria-label={t('Open chat')}\n >\n <ChatIcon />\n </button>\n )}\n\n {/* Core memory modal (opened from the header brain button) */}\n {mergedOptions.showCoreMemoryButton && (\n <CoreMemoryModal\n isOpen={coreMemoryOpen}\n onClose={() => setCoreMemoryOpen(false)}\n assistantId={assistantId}\n tenantId={tenantId}\n subtenantId={subtenantId}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n labels={mergedOptions.coreMemoryLabels}\n theme={modalTheme}\n />\n )}\n\n {/* Connected apps modal (opened from the header app stack) */}\n {mergedOptions.showIntegrationsButton !== false && (\n <IntegrationsModal\n isOpen={integrationsOpen}\n onClose={() => setIntegrationsOpen(false)}\n assistantId={assistantId}\n tenantId={tenantId}\n subtenantId={subtenantId}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n title={t(mergedOptions.integrationsLabel)}\n theme={modalTheme}\n state={integrationsState}\n mcpState={mcpState}\n />\n )}\n </DevicTranslationsProvider>\n );\n}\n\n/**\n * Brain icon for the core memory button\n */\nfunction BrainIcon(): JSX.Element {\n return (\n <svg\n width=\"17\"\n height=\"17\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M9.5 2a2.5 2.5 0 0 0-2.45 2A3.5 3.5 0 0 0 4.6 8.6 3.5 3.5 0 0 0 3 11.5c0 1.1.5 2.08 1.29 2.73A3.5 3.5 0 0 0 7 20a3 3 0 0 0 5-2.24V4.5A2.5 2.5 0 0 0 9.5 2Z\" />\n <path d=\"M14.5 2a2.5 2.5 0 0 1 2.45 2 3.5 3.5 0 0 1 2.45 4.6A3.5 3.5 0 0 1 21 11.5a3.49 3.49 0 0 1-1.29 2.73A3.5 3.5 0 0 1 17 20a3 3 0 0 1-5-2.24V4.5A2.5 2.5 0 0 1 14.5 2Z\" />\n </svg>\n );\n}\n\nfunction CloseIcon(): JSX.Element {\n return (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n/**\n * Plus icon for new chat button\n */\nfunction PlusIcon(): JSX.Element {\n return (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\" />\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />\n </svg>\n );\n}\n\n/**\n * Chat icon for trigger button\n */\nfunction ChatIcon(): JSX.Element {\n return (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z\" />\n </svg>\n );\n}\n"],"names":["forwardRef","_jsx","ChatDrawerErrorBoundary","useMemo","useTranslations","useState","useCallback","useDevicChat","useEffect","useOptionalDevicContext","DevicApiClient","assistantInfo","useAssistantInfo","avatarUri","useIntegrations","useTenantMcp","integrationChoiceKey","useRef","readIntegrationChoice","writeIntegrationChoice","pruneIntegrationChoice","UsageBar","LimitBanner","client","useImperativeHandle","QueueNotice","DEFAULT_CORE_MEMORY_LABELS","IntegrationsHint","isDarkTheme","IntegrationsToggle","_jsxs","DevicTranslationsProvider","ConversationSelector","IntegrationsLauncher","ChatMessages","_Fragment","ChatInput","CoreMemoryModal","IntegrationsModal"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,oDAAO,qBAAkB,KAAC,CAAC;AAGnE,MAAM,eAAe,GAAgC;AACnD,IAAA,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;AAC7B,IAAA,QAAQ,EAAE,OAAO;AACjB,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,iBAAiB,EAAE,KAAK;IACxB,gBAAgB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;AACnD,IAAA,WAAW,EAAE,EAAE,GAAG,IAAI,GAAG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,QAAA,EAEnBA,cAAA,CAAA,MAAA,EAAA,EAAM,CAAC,EAAC,yFAAyF,EAAA,CAAG,EAAA,CAChG;AAEV;;;;"}
1
+ {"version":3,"file":"ChatDrawer.js","sources":["../../../../../src/components/ChatDrawer/ChatDrawer.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback, useMemo, useRef, forwardRef, useImperativeHandle } from 'react';\nimport { useDevicChat } from '../../hooks/useDevicChat';\nimport { useOptionalDevicContext } from '../../provider';\nimport { DevicApiClient } from '../../api/client';\nimport { useAssistantInfo } from '../../api/assistantInfo';\nimport { ChatMessages } from './ChatMessages';\nimport { ChatInput } from './ChatInput';\nimport { ConversationSelector } from './ConversationSelector';\nimport { ChatDrawerErrorBoundary } from './ErrorBoundary';\nimport { UsageBar } from './UsageBar';\nimport { LimitBanner } from './LimitBanner';\nimport { QueueNotice } from './QueueNotice';\nimport { CoreMemoryModal, DEFAULT_CORE_MEMORY_LABELS } from '../CoreMemoryModal';\nimport {\n IntegrationsHint,\n IntegrationsLauncher,\n IntegrationsModal,\n IntegrationsToggle,\n useIntegrations,\n useTenantMcp,\n integrationChoiceKey,\n readIntegrationChoice,\n writeIntegrationChoice,\n pruneIntegrationChoice,\n} from '../IntegrationsModal';\nimport { isDarkTheme } from '../theme';\nimport { DevicTranslationsProvider, useTranslations } from '../../i18n';\nimport type { DevicTheme } from '../theme';\nimport type { ChatDrawerProps, ChatDrawerOptions, ChatDrawerHandle } from './ChatDrawer.types';\nimport type { QueueDisposition } from '../../api/types';\nimport './styles.css';\nconst LiveVoicePanel = React.lazy(() => import('./LiveVoicePanel'));\nimport { avatarUri } from '../../utils/avatar';\n\nconst DEFAULT_OPTIONS: Required<ChatDrawerOptions> = {\n liveVoice: { enabled: false },\n position: 'right',\n width: '100%',\n defaultOpen: false,\n color: '#1890ff',\n welcomeMessage: '',\n suggestedMessages: [],\n enableFileUploads: false,\n allowedFileTypes: { images: true, documents: true },\n maxFileSize: 10 * 1024 * 1024,\n enableLongTextPaste: false,\n longTextPasteThreshold: 2000,\n enableSpeechToText: false,\n speechLanguage: undefined as any,\n speechAutoStop: true,\n speechAutoStopCountdownMs: 1000,\n speechAutoStopSilenceMs: 1000,\n speechAutoStopSilenceRatio: 0.1,\n speechAutoStopSilenceLevel: 0.02,\n speechAutoStopSpeechLevel: 0.12,\n speechHandoff: false,\n speechHandoffSendDelayMs: 1000,\n speechHandoffHoldMs: 3000,\n inputPlaceholder: 'Type a message...',\n title: 'Chat',\n showAvatar: false,\n avatarUrl: undefined as any,\n showToolTimeline: true,\n zIndex: 1000,\n borderRadius: 0,\n resizable: false,\n minWidth: 300,\n maxWidth: 800,\n style: {},\n fontFamily: undefined as any,\n backgroundColor: undefined as any,\n textColor: undefined as any,\n secondaryBackgroundColor: undefined as any,\n borderColor: undefined as any,\n userBubbleColor: undefined as any,\n userBubbleTextColor: undefined as any,\n assistantBubbleColor: undefined as any,\n assistantBubbleTextColor: undefined as any,\n sendButtonColor: undefined as any,\n loadingIndicator: undefined as any,\n sendButtonContent: undefined as any,\n toolRenderers: undefined as any,\n toolIcons: undefined as any,\n showFeedback: true,\n handoffWidgetRenderer: undefined as any,\n toolGroups: undefined as any,\n stopButtonContent: undefined as any,\n debug: false,\n persistConversation: false,\n customPromptBox: undefined as any,\n userMessageRenderer: undefined as any,\n assistantMessageRenderer: undefined as any,\n conversationPreview: 'date',\n showUsageBar: false,\n usageBarMetric: undefined as any,\n usageBarDisplay: undefined as any,\n customUsageBar: undefined as any,\n hideLimitBanner: false,\n limitBannerRenderer: undefined as any,\n hideQueueNotice: false,\n queueNoticeRenderer: undefined as any,\n // Unset on purpose: the assistant's own setting decides.\n messageQueue: undefined as any,\n showRecalledMemories: true,\n recalledMemoriesRenderer: undefined as any,\n showCompaction: true,\n expandableCompaction: false,\n compactionRenderer: undefined as any,\n guardrailRenderer: undefined as any,\n showCoreMemoryButton: false,\n coreMemoryLabels: undefined as any,\n showIntegrationsButton: true,\n integrationsLabel: 'Connected apps',\n maxIntegrationLogos: 6,\n showIntegrationsHint: true,\n // Left unset so the strip can say \"Connect your apps\" or \"Explore connected\n // apps\" depending on what the end user has actually done.\n integrationsHintLabel: undefined as any,\n showIntegrationsToggle: true,\n integrationsToggleLabel: 'Apps in this chat',\n translations: undefined as any,\n};\n\n/**\n * Chat drawer component for Devic assistants\n *\n * @example\n * ```tsx\n * <ChatDrawer\n * ref={drawerRef}\n * assistantId=\"my-assistant\"\n * options={{\n * position: 'right',\n * width: 400,\n * welcomeMessage: 'Hello! How can I help you?',\n * suggestedMessages: ['Help me with...', 'Tell me about...'],\n * }}\n * modelInterfaceTools={[\n * {\n * toolName: 'get_user_location',\n * schema: { ... },\n * callback: async () => ({ lat: 40.7, lng: -74.0 })\n * }\n * ]}\n * onMessageReceived={(msg) => console.log('Received:', msg)}\n * />\n * ```\n */\nexport const ChatDrawer = forwardRef<ChatDrawerHandle, ChatDrawerProps>(\n function ChatDrawer(props, ref) {\n return (\n <ChatDrawerErrorBoundary>\n <ChatDrawerInner {...props} forwardedRef={ref} />\n </ChatDrawerErrorBoundary>\n );\n }\n);\n\ninterface ChatDrawerInnerProps extends ChatDrawerProps {\n forwardedRef?: React.Ref<ChatDrawerHandle>;\n}\n\nfunction ChatDrawerInner({\n assistantId,\n chatUid: initialChatUid,\n options = {},\n enabledTools,\n modelInterfaceTools,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n apiKey,\n baseUrl,\n pollingInterval,\n streaming,\n onMessageSent,\n onMessageReceived,\n onToolCall,\n onError,\n onChatCreated,\n onFileUpload,\n onOpen,\n onClose,\n isOpen: controlledIsOpen,\n className,\n mode = 'drawer',\n onConversationChange,\n forwardedRef,\n}: ChatDrawerInnerProps): JSX.Element {\n // Merge options with defaults\n const mergedOptions = useMemo(\n () => ({ ...DEFAULT_OPTIONS, ...options }),\n [options]\n );\n\n // Texts the drawer renders itself, translated through the dictionary of the\n // provider plus this drawer's own. Applied to the option defaults too, so a\n // host that leaves `title` or `inputPlaceholder` alone still gets them in\n // its language; a host that sets its own text keeps it, unless it also put\n // that text in the dictionary.\n const t = useTranslations(mergedOptions.translations);\n\n // localStorage key for persisting selected conversation\n const storageKey = mergedOptions.persistConversation\n ? `devic-ui-chatUid-${assistantId}`\n : null;\n\n // Resolve initial chatUid: prop takes priority, then localStorage\n const resolvedInitialChatUid = useMemo(() => {\n if (initialChatUid) return initialChatUid;\n if (storageKey) {\n try { return localStorage.getItem(storageKey) || undefined; } catch { return undefined; }\n }\n return undefined;\n }, [initialChatUid, storageKey]);\n\n // Drawer open state (can be controlled or uncontrolled; inline mode is always open)\n const [internalIsOpen, setInternalIsOpen] = useState(mergedOptions.defaultOpen);\n const isInline = mode === 'inline';\n const isOpen = isInline ? true : (controlledIsOpen ?? internalIsOpen);\n\n // Wrap onChatCreated to persist chatUid in localStorage\n const handleChatCreated = useCallback(\n (chatUid: string) => {\n if (storageKey) {\n try { localStorage.setItem(storageKey, chatUid); } catch {}\n }\n onChatCreated?.(chatUid);\n },\n [storageKey, onChatCreated]\n );\n\n /**\n * What the end user switched off: connected apps by slug, and their own MCP\n * servers by the `toggleId` the API hands out.\n *\n * Remembered in this browser (see `integrationChoice`) rather than only for\n * the life of the drawer — a reload used to forget it, which for someone who\n * keeps an app switched off on purpose reads as the switch not working. The\n * server still keeps nothing beyond the turn it was sent for; what is stored\n * is a preference of whoever is at this keyboard.\n *\n * The badge on the plug is what keeps that honest: a remembered choice is\n * visible at a glance rather than being an unexplained silence from an app.\n */\n const [disabledIntegrations, setDisabledIntegrations] = useState<string[]>([]);\n\n // Use chat hook\n const chat = useDevicChat({\n assistantId,\n chatUid: resolvedInitialChatUid,\n apiKey,\n baseUrl,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n enabledTools,\n disabledIntegrations,\n modelInterfaceTools,\n pollingInterval,\n streaming,\n onMessageSent,\n onMessageReceived,\n onToolCall,\n onError,\n onChatCreated: handleChatCreated,\n onFileUpload,\n messageQueue: mergedOptions.messageQueue,\n liveVoice: mergedOptions.liveVoice,\n debug: mergedOptions.debug,\n });\n\n // Fetch assistant avatar when showAvatar is enabled\n useEffect(() => { if (!isOpen) void chat.voice.stop(); }, [isOpen, chat.voice.stop]);\n const context = useOptionalDevicContext();\n const resolvedApiKey = apiKey || context?.apiKey;\n // The session source, when the page authenticates with one. Every client\n // built below gets it, or a page without an API key would have nothing to\n // authenticate with.\n const resolvedTenantSession = context?.getTenantSession;\n const onSessionExpired = context?.onSessionExpired;\n const resolvedBaseUrl = baseUrl || context?.baseUrl || 'https://api.devic.ai';\n const [coreMemoryOpen, setCoreMemoryOpen] = useState(false);\n const [integrationsOpen, setIntegrationsOpen] = useState(false);\n\n const infoClient = useMemo(\n () =>\n resolvedApiKey || resolvedTenantSession\n ? new DevicApiClient({\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n getTenantSession: resolvedTenantSession,\n onSessionExpired,\n })\n : null,\n [resolvedApiKey, resolvedTenantSession, resolvedBaseUrl]\n );\n\n // Asked for only when something on screen depends on it, and then at most\n // once per assistant however many times this drawer is mounted — a host that\n // remounts it to start a fresh conversation used to pay for the answer again\n // every time.\n const assistantInfo = useAssistantInfo({\n assistantId,\n client: infoClient,\n baseUrl: resolvedBaseUrl,\n credential: resolvedApiKey || 'session',\n enabled:\n (!!mergedOptions.liveVoice?.enabled && isOpen) ||\n (!!mergedOptions.showAvatar && !mergedOptions.avatarUrl) ||\n (mergedOptions.showIntegrationsButton !== false && isOpen),\n });\n // The host's own image wins: an assistant carries one image for everybody, so\n // this is the only place a per-account face can come from. Failing that, an\n // assistant with no uploaded image still gets a face, generated from its\n // identifier — the same one the console shows for it. Drawn from `assistantId`\n // rather than from the fetched assistant so the header is not empty while the\n // lookup is in flight; the two agree, since that is what was asked for.\n const avatarUrl = mergedOptions.showAvatar\n ? (mergedOptions.avatarUrl ??\n assistantInfo.assistant?.imgUrl ??\n avatarUri(\n assistantInfo.assistant?.identifier || assistantId,\n assistantInfo.assistant?.avatarStyle\n ))\n : null;\n\n /**\n * Whether to ask which apps this assistant offers.\n *\n * The listing is worth a request only when there is something to list, and\n * most assistants offer nothing — for those, the call existed purely to be\n * refused, once per page load. The assistant now says so itself, so a plain\n * `false` settles it without asking.\n *\n * Anything else asks, exactly as before: a field that is absent means the API\n * is older than it, not that the answer is no, and a failed lookup means we\n * could not find out. Hiding the button on either would lose the feature for\n * a deployment that has it, which is far worse than one spare request.\n *\n * Where there are apps to show, this puts the two requests in sequence rather\n * than at once, so the listing lands later than it used to. The header holds\n * its place in the meantime — see `pendingIntegrations`.\n */\n const mayOfferIntegrations =\n assistantInfo.settled &&\n assistantInfo.assistant?.tenantIntegrations?.enabled !== false;\n\n // The apps this assistant offers its tenants. Loaded once, here, because the\n // header control cannot decide whether to exist without it — and lent to the\n // modal so opening it does not ask for the same listing again. Nothing is\n // fetched until the drawer is opened for the first time.\n const integrationsState = useIntegrations({\n assistantId,\n tenantId,\n subtenantId,\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n enabled:\n mergedOptions.showIntegrationsButton !== false &&\n isOpen &&\n mayOfferIntegrations,\n });\n\n /**\n * Whether this assistant offers MCP servers of the tenant's own.\n *\n * Read exactly like `mayOfferIntegrations`: absence means \"cannot tell\", so\n * the listing is asked for anyway. A deployment older than the field keeps\n * the behaviour it had — one refusal per drawer open — rather than losing the\n * feature.\n */\n const mayOfferMcp =\n assistantInfo.settled &&\n assistantInfo.assistant?.tenantMcpServers?.enabled !== false;\n\n /**\n * The tenant's own MCP servers, loaded here rather than inside the modal.\n *\n * The composer's switch needs them too, and it is not inside the modal — so\n * the listing has to live above both. The modal takes it as a prop and stops\n * asking for its own.\n */\n const mcpState = useTenantMcp({\n assistantId,\n tenantId,\n subtenantId,\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n enabled:\n mergedOptions.showIntegrationsButton !== false && isOpen && mayOfferMcp,\n });\n\n /**\n * Whether the answer to \"is there anything to show here\" is still on its way.\n *\n * Two requests decide it — what the assistant offers, and then what this\n * tenant has connected — and until both have answered the control cannot\n * know whether to exist. Without this the header simply had a gap and then a\n * button, which reads as the page changing its mind.\n */\n const integrationsDeciding =\n mergedOptions.showIntegrationsButton !== false &&\n isOpen &&\n (!assistantInfo.settled ||\n (mayOfferIntegrations && !integrationsState.settled) ||\n (mayOfferMcp && !mcpState.settled));\n\n /**\n * Placeholder chips to hold while the listing is in flight.\n *\n * Only when the assistant has said outright that it offers apps, and how\n * many: on a maybe there would be nothing to hold the place of half the time,\n * and a control that appears and then vanishes is worse than one that arrives\n * late. So this stays at zero for an API that does not say, which is also the\n * behaviour every version until now had.\n */\n const pendingIntegrations =\n assistantInfo.assistant?.tenantIntegrations?.enabled === true &&\n !integrationsState.settled\n ? (assistantInfo.assistant.tenantIntegrations.count ?? 0)\n : 0;\n\n // Tenant/subtenant resolution mirrors useDevicChat (prop overrides provider).\n const resolvedTenantId = tenantId || context?.tenantId;\n const resolvedSubtenantId = subtenantId || context?.subtenantId;\n\n // ── Remembering which apps and servers are switched off ────────────────\n\n const choiceKey = integrationChoiceKey(\n assistantId,\n resolvedTenantId,\n resolvedSubtenantId\n );\n\n // Loaded per key, so switching tenant loads that tenant's choice rather than\n // carrying the previous one over.\n const loadedChoiceRef = useRef<string | null>(null);\n useEffect(() => {\n if (loadedChoiceRef.current === choiceKey) return;\n loadedChoiceRef.current = choiceKey;\n setDisabledIntegrations(readIntegrationChoice(choiceKey));\n }, [choiceKey]);\n\n useEffect(() => {\n // Only once this key's stored value has been read, or the empty initial\n // state would erase it before it was ever loaded.\n if (loadedChoiceRef.current !== choiceKey) return;\n writeIntegrationChoice(choiceKey, disabledIntegrations);\n }, [choiceKey, disabledIntegrations]);\n\n /**\n * Forgets what is no longer on offer, once the listings can say so.\n *\n * Every clause of this is load-bearing. `mayOffer*` is false BEFORE the\n * assistant has answered as well as when the answer is no, so without the\n * `assistantInfo.settled` guard the prune runs on the first render against\n * two empty listings and erases the very thing that was just loaded — which\n * is exactly the reload-forgets-it bug this was meant to fix. A definite\n * \"this assistant offers none\" is an answer; an unsettled listing is not.\n *\n * With the drawer never opened, neither listing is ever fetched, so nothing\n * is pruned and the stored choice survives untouched.\n */\n const appsKnown =\n assistantInfo.settled && (!mayOfferIntegrations || integrationsState.settled);\n const mcpKnown = assistantInfo.settled && (!mayOfferMcp || mcpState.settled);\n useEffect(() => {\n if (!appsKnown || !mcpKnown) return;\n const live = [\n ...integrationsState.integrations\n .filter((i) => i.connected)\n .map((i) => i.app),\n ...mcpState.servers\n .filter((s) => s.connection?.status === 'active' && s.connection.toggleId)\n .map((s) => s.connection!.toggleId as string),\n ];\n setDisabledIntegrations((prev) => pruneIntegrationChoice(prev, live));\n }, [appsKnown, mcpKnown, integrationsState.integrations, mcpState.servers]);\n\n // Usage bar (above the input) — only when enabled and a tenant is known.\n // Refetches after each turn via the message count as refresh key.\n const usageBarNode =\n (mergedOptions.showUsageBar ||\n typeof mergedOptions.customUsageBar === 'function') &&\n resolvedTenantId ? (\n <UsageBar\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n tenantId={resolvedTenantId}\n subtenantId={resolvedSubtenantId}\n mode={mergedOptions.showUsageBar === 'onDemand' ? 'onDemand' : 'always'}\n metric={mergedOptions.usageBarMetric}\n display={mergedOptions.usageBarDisplay}\n customUsageBar={mergedOptions.customUsageBar}\n color={mergedOptions.color}\n refreshKey={chat.messages.length}\n debug={mergedOptions.debug}\n />\n ) : null;\n\n // Default usage-limit banner (above the input) — opt-out via hideLimitBanner,\n // override via limitBannerRenderer.\n const limitBannerNode =\n chat.limitExceeded && !mergedOptions.hideLimitBanner\n ? mergedOptions.limitBannerRenderer\n ? mergedOptions.limitBannerRenderer(chat.limitExceeded)\n : <LimitBanner limit={chat.limitExceeded} />\n : null;\n\n // Speech-to-text transcription, exposed to custom prompt boxes so a developer\n // can transcribe audio (binary or URL) and attach the resulting transcriptId.\n const transcribeAudio = useCallback(\n (\n audio: Blob | string,\n transcribeOptions?: {\n language?: string;\n messageUid?: string;\n chatUid?: string;\n tenantId?: string;\n },\n ) => {\n if (!resolvedApiKey && !resolvedTenantSession) {\n return Promise.reject(\n new Error(t('No credentials configured. Cannot transcribe audio.')),\n );\n }\n const client = new DevicApiClient({ apiKey: resolvedApiKey, baseUrl: resolvedBaseUrl, getTenantSession: resolvedTenantSession, onSessionExpired });\n return client.transcribeAudio(audio, {\n language: transcribeOptions?.language ?? mergedOptions.speechLanguage,\n messageUid: transcribeOptions?.messageUid,\n chatUid: transcribeOptions?.chatUid,\n tenantId: transcribeOptions?.tenantId ?? tenantId,\n });\n },\n [resolvedApiKey, resolvedTenantSession, resolvedBaseUrl, mergedOptions.speechLanguage, tenantId],\n );\n\n // Handle open/close\n const handleOpen = useCallback(() => {\n setInternalIsOpen(true);\n onOpen?.();\n }, [onOpen]);\n\n const handleClose = useCallback(() => {\n setInternalIsOpen(false);\n onClose?.();\n }, [onClose]);\n\n const handleToggle = useCallback(() => {\n setInternalIsOpen((prev) => !prev);\n }, []);\n\n // Expose handle for programmatic control\n useImperativeHandle(forwardedRef, () => ({\n open: handleOpen,\n close: handleClose,\n toggle: handleToggle,\n setChatUid: (chatUid: string) => {\n chat.loadChat(chatUid);\n },\n sendMessage: (message: string) => {\n chat.sendMessage(message);\n },\n }), [handleOpen, handleClose, handleToggle, chat]);\n\n // Register this drawer in the DevicProvider so AIElementWrapper can open it\n useEffect(() => {\n if (!context?.registerDrawer) return;\n const unregister = context.registerDrawer({\n open: handleOpen,\n close: handleClose,\n toggle: handleToggle,\n sendMessage: (message: string) => chat.sendMessage(message),\n });\n return unregister;\n }, [context, handleOpen, handleClose, handleToggle, chat]);\n\n // Partition pending widget calls by render mode\n const { inlineWidgets, inputWidget } = useMemo(() => {\n const inline: typeof chat.pendingWidgetCalls = [];\n let input: typeof chat.pendingWidgetCalls[number] | null = null;\n for (const wc of chat.pendingWidgetCalls) {\n if (wc.widget.render === 'input' && !input) {\n input = wc;\n } else {\n inline.push(wc);\n }\n }\n return { inlineWidgets: inline, inputWidget: input };\n }, [chat.pendingWidgetCalls]);\n\n // Active references from DevicProvider (created by AIElementWrapper)\n const references = context?.references ?? [];\n const removeReference = useCallback(\n (id: string) => {\n context?.removeReference(id);\n },\n [context]\n );\n const clearReferences = useCallback(() => {\n context?.clearReferences();\n }, [context]);\n\n // Handle send message — prefix references and clear them after sending\n /**\n * What the last accepted message was told about when it gets picked up. Only\n * the wording of the notice depends on it.\n */\n const [queueDisposition, setQueueDisposition] = useState<\n QueueDisposition | undefined\n >();\n /**\n * What became of a message that did not simply join the queue: it was turned\n * down, or a stop threw it away. Said out loud, because in both cases the\n * user's text has just moved back into the box on its own.\n */\n const [queueAlert, setQueueAlert] = useState<string | null>(null);\n\n const handleSend = useCallback(\n async (\n message: string,\n files?: File[],\n meta?: { transcriptId?: string; tags?: string[] }\n ) => {\n let finalMessage = message;\n if (references.length > 0) {\n const labels = references.map((r) => `\"${r.label}\"`).join(', ');\n finalMessage = `Elemento referenciado: ${labels}\\n\\n${message}`;\n }\n setQueueAlert(null);\n const result = await chat.sendMessage(finalMessage, {\n files,\n transcriptId: meta?.transcriptId,\n tags: meta?.tags,\n });\n\n if ('rejected' in result) {\n // The references belong to the message that was not sent, so they stay.\n if (result.reason !== 'error') {\n // An ordinary error already reaches the host through `onError`; these\n // two do not, and the only sign of them would otherwise be the text\n // reappearing in the box with no explanation.\n setQueueAlert(\n result.reason === 'queue_full'\n ? `${result.message} ${t('Your message is back in the box.')}`\n : t(\n 'The assistant is not taking messages while it works. Your message is back in the box.'\n )\n );\n }\n return result;\n }\n\n setQueueDisposition('queued' in result && result.queued ? result.willProcess : undefined);\n if (references.length > 0) clearReferences();\n return result;\n },\n [chat, references, clearReferences]\n );\n\n /**\n * Whether a message may be written while the assistant is working.\n *\n * Being busy is not the only reason the box closes, and the other two are not\n * about waiting: an inline widget is the assistant waiting on *this* user, and\n * a usage limit is a refusal the queue cannot soften.\n */\n const canQueue =\n chat.queueEnabled && inlineWidgets.length === 0 && !chat.limitExceeded;\n\n const handleStopChat = useCallback(async () => {\n const result = await chat.stopChat();\n setQueueDisposition(undefined);\n setQueueAlert(\n result.discarded\n ? result.discarded === 1\n ? t('A queued message was not sent — the text is back in the box.')\n : t(\n '{count} queued messages were not sent — the text is back in the box.',\n { count: result.discarded }\n )\n : null\n );\n return result;\n }, [chat]);\n\n /**\n * Shown while there is something to explain: the user is writing into a run\n * that has not finished, or messages are already waiting. With nothing typed\n * and nothing queued there is nothing to say.\n */\n const queueNoticeNode =\n !mergedOptions.hideQueueNotice &&\n // `queuedCount` on its own matters: an assistant with an input delay queues\n // what is written into an *idle* conversation whether or not it takes\n // messages while busy, so there can be something waiting with the queue\n // switched off.\n (queueAlert || chat.queuedCount > 0 || (canQueue && chat.isLoading))\n ? mergedOptions.queueNoticeRenderer\n ? mergedOptions.queueNoticeRenderer({\n queuedCount: chat.queuedCount,\n willProcess: queueDisposition,\n alert: queueAlert ?? undefined,\n })\n : (\n <QueueNotice\n queuedCount={chat.queuedCount}\n willProcess={queueDisposition}\n alert={queueAlert ?? undefined}\n />\n )\n : null;\n\n // Handle conversation selection\n const handleConversationSelect = useCallback(\n (chatUid: string) => {\n chat.loadChat(chatUid);\n onConversationChange?.(chatUid);\n if (storageKey) {\n try { localStorage.setItem(storageKey, chatUid); } catch {}\n }\n },\n [chat, onConversationChange, storageKey]\n );\n\n const handleNewChat = useCallback(() => {\n chat.clearChat();\n if (storageKey) {\n try { localStorage.removeItem(storageKey); } catch {}\n }\n }, [chat, storageKey]);\n\n // Handle suggested message click\n const handleSuggestedClick = useCallback(\n (message: string) => {\n chat.sendMessage(message);\n },\n [chat]\n );\n\n // Feedback state\n const [feedbackMap, setFeedbackMap] = useState<Map<string, 'positive' | 'negative'>>(new Map());\n const feedbackClientRef = useRef<DevicApiClient | null>(null);\n\n // Initialize feedback client\n useEffect(() => {\n if ((resolvedApiKey || resolvedTenantSession) && !feedbackClientRef.current) {\n feedbackClientRef.current = new DevicApiClient({\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n getTenantSession: resolvedTenantSession,\n onSessionExpired,\n });\n }\n }, [resolvedApiKey, resolvedTenantSession, resolvedBaseUrl]);\n\n // Load existing feedback when chat changes\n useEffect(() => {\n if (!chat.chatUid || !feedbackClientRef.current || !mergedOptions.showFeedback) return;\n\n feedbackClientRef.current.getChatFeedback(assistantId, chat.chatUid)\n .then((entries) => {\n const newMap = new Map<string, 'positive' | 'negative'>();\n for (const entry of entries) {\n if (entry.feedback !== undefined) {\n newMap.set(entry.requestId, entry.feedback ? 'positive' : 'negative');\n }\n }\n setFeedbackMap(newMap);\n })\n .catch(() => {\n // Silently ignore feedback loading errors\n });\n }, [chat.chatUid, assistantId, mergedOptions.showFeedback]);\n\n // Handle feedback submission\n const handleFeedback = useCallback(\n async (messageId: string, positive: boolean, comment?: string) => {\n if (!chat.chatUid || !feedbackClientRef.current) return;\n\n try {\n await feedbackClientRef.current.submitChatFeedback(assistantId, chat.chatUid, {\n messageId,\n feedback: positive,\n feedbackComment: comment,\n });\n\n setFeedbackMap((prev) => {\n const newMap = new Map(prev);\n newMap.set(messageId, positive ? 'positive' : 'negative');\n return newMap;\n });\n } catch (err) {\n console.error('Failed to submit feedback:', err);\n throw err;\n }\n },\n [chat.chatUid, assistantId]\n );\n\n // Apply CSS variables for theming on the drawer element itself\n // (must target the component root so they override the defaults defined on .devic-chat-drawer)\n const drawerRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n const el = drawerRef.current;\n if (!el) return;\n const vars: [string, string | undefined][] = [\n ['--devic-primary', mergedOptions.color !== DEFAULT_OPTIONS.color ? mergedOptions.color : undefined],\n ['--devic-font-family', mergedOptions.fontFamily],\n ['--devic-bg', mergedOptions.backgroundColor],\n ['--devic-text', mergedOptions.textColor],\n ['--devic-bg-secondary', mergedOptions.secondaryBackgroundColor],\n ['--devic-border', mergedOptions.borderColor],\n ['--devic-user-bubble', mergedOptions.userBubbleColor],\n ['--devic-user-bubble-text', mergedOptions.userBubbleTextColor],\n ['--devic-assistant-bubble', mergedOptions.assistantBubbleColor],\n ['--devic-assistant-bubble-text', mergedOptions.assistantBubbleTextColor],\n ['--devic-send-btn', mergedOptions.sendButtonColor],\n ];\n for (const [name, value] of vars) {\n if (value) {\n el.style.setProperty(name, value);\n } else {\n el.style.removeProperty(name);\n }\n }\n }, [mergedOptions.color, mergedOptions.fontFamily, mergedOptions.backgroundColor, mergedOptions.textColor, mergedOptions.secondaryBackgroundColor, mergedOptions.borderColor, mergedOptions.userBubbleColor, mergedOptions.userBubbleTextColor, mergedOptions.assistantBubbleColor, mergedOptions.assistantBubbleTextColor, mergedOptions.sendButtonColor]);\n\n // The same values, handed to the dialogs this drawer opens. They render\n // through a portal into document.body, so the variables set above — which\n // live on the drawer element — never reach them.\n // The brain button says what the modal it opens is called.\n const coreMemoryTitle =\n mergedOptions.coreMemoryLabels?.title ??\n t(DEFAULT_CORE_MEMORY_LABELS.title);\n\n const modalTheme: DevicTheme = useMemo(\n () => ({\n color:\n mergedOptions.color !== DEFAULT_OPTIONS.color\n ? mergedOptions.color\n : undefined,\n fontFamily: mergedOptions.fontFamily,\n backgroundColor: mergedOptions.backgroundColor,\n textColor: mergedOptions.textColor,\n secondaryBackgroundColor: mergedOptions.secondaryBackgroundColor,\n borderColor: mergedOptions.borderColor,\n }),\n [\n mergedOptions.color,\n mergedOptions.fontFamily,\n mergedOptions.backgroundColor,\n mergedOptions.textColor,\n mergedOptions.secondaryBackgroundColor,\n mergedOptions.borderColor,\n ]\n );\n\n // The strip above the composer. Dismissed per end user, because the whole\n // point of remembering a dismissal is that the same person is not told twice.\n const integrationsHintNode =\n mergedOptions.showIntegrationsButton !== false &&\n mergedOptions.showIntegrationsHint !== false ? (\n <IntegrationsHint\n state={integrationsState}\n onOpen={() => setIntegrationsOpen(true)}\n label={mergedOptions.integrationsHintLabel}\n maxLogos={mergedOptions.maxIntegrationLogos}\n storageKey={`${assistantId}:${resolvedTenantId ?? ''}:${resolvedSubtenantId ?? ''}`}\n dark={isDarkTheme(modalTheme)}\n />\n ) : null;\n\n // The per-message switch in the composer row. Shown only where there is\n // something to switch — the control returns null with nothing connected —\n // and hidden outright by `showIntegrationsToggle: false`.\n const integrationsToggleNode =\n mergedOptions.showIntegrationsButton !== false &&\n mergedOptions.showIntegrationsToggle !== false ? (\n <IntegrationsToggle\n state={integrationsState}\n mcp={mcpState}\n disabled={disabledIntegrations}\n onChange={setDisabledIntegrations}\n onManage={() => setIntegrationsOpen(true)}\n label={t(mergedOptions.integrationsToggleLabel)}\n dark={isDarkTheme(modalTheme)}\n busy={chat.isLoading}\n loading={integrationsDeciding}\n />\n ) : null;\n\n // Resizable drawer\n const [resizedWidth, setResizedWidth] = useState<number | null>(null);\n\n const handleResizeStart = useCallback(\n (e: React.MouseEvent) => {\n e.preventDefault();\n const startX = e.clientX;\n const startWidth = drawerRef.current?.offsetWidth ?? 0;\n const isLeft = mergedOptions.position === 'left';\n\n const onMove = (ev: MouseEvent) => {\n const delta = ev.clientX - startX;\n const newWidth = startWidth + (isLeft ? delta : -delta);\n const clamped = Math.min(\n mergedOptions.maxWidth,\n Math.max(mergedOptions.minWidth, newWidth)\n );\n setResizedWidth(clamped);\n };\n\n const onUp = () => {\n document.removeEventListener('mousemove', onMove);\n document.removeEventListener('mouseup', onUp);\n };\n\n document.addEventListener('mousemove', onMove);\n document.addEventListener('mouseup', onUp);\n },\n [mergedOptions.position, mergedOptions.minWidth, mergedOptions.maxWidth]\n );\n\n // Build style object\n const baseWidth = resizedWidth\n ? `${resizedWidth}px`\n : typeof mergedOptions.width === 'number'\n ? `${mergedOptions.width}px`\n : mergedOptions.width;\n\n const drawerStyle = useMemo(\n () => ({\n width: baseWidth,\n zIndex: mergedOptions.zIndex,\n borderRadius: typeof mergedOptions.borderRadius === 'number'\n ? `${mergedOptions.borderRadius}px`\n : mergedOptions.borderRadius,\n ...mergedOptions.style,\n }),\n [baseWidth, mergedOptions.zIndex, mergedOptions.borderRadius, mergedOptions.style]\n );\n\n const overlayStyle = useMemo(\n () => ({\n zIndex: mergedOptions.zIndex - 1,\n }),\n [mergedOptions.zIndex]\n );\n\n const triggerStyle = useMemo(\n () => ({\n zIndex: mergedOptions.zIndex - 1,\n [mergedOptions.position]: 20,\n bottom: 20,\n }),\n [mergedOptions.zIndex, mergedOptions.position]\n );\n\n return (\n <DevicTranslationsProvider translations={mergedOptions.translations}>\n {/* Overlay (drawer mode only) */}\n {!isInline && (\n <div\n className=\"devic-drawer-overlay\"\n data-open={isOpen}\n style={overlayStyle}\n onClick={handleClose}\n />\n )}\n\n {/* Drawer */}\n <div\n ref={drawerRef}\n className={`devic-chat-drawer ${className || ''}`}\n data-position={mergedOptions.position}\n data-open={isOpen}\n data-mode={mode}\n style={drawerStyle}\n >\n {/* Resize handle */}\n {mergedOptions.resizable && (\n <div\n className=\"devic-resize-handle\"\n data-position={mergedOptions.position}\n onMouseDown={handleResizeStart}\n />\n )}\n\n {/* Header */}\n <div className=\"devic-drawer-header\">\n {avatarUrl && (\n <img\n className=\"devic-drawer-avatar\"\n src={avatarUrl}\n alt=\"\"\n aria-hidden=\"true\"\n />\n )}\n {/* Only a plain string can go through the dictionary; a host that\n passes a node has already decided what it renders. */}\n <h2 className=\"devic-drawer-title\">\n {typeof mergedOptions.title === 'string'\n ? t(mergedOptions.title)\n : mergedOptions.title}\n </h2>\n <ConversationSelector\n assistantId={assistantId}\n currentChatUid={chat.chatUid}\n onSelect={handleConversationSelect}\n onNewChat={handleNewChat}\n apiKey={apiKey}\n baseUrl={baseUrl}\n tenantId={tenantId}\n subtenantId={subtenantId}\n conversationPreview={mergedOptions.conversationPreview}\n />\n <div className=\"devic-drawer-header-actions\">\n {mergedOptions.showIntegrationsButton !== false && (\n <IntegrationsLauncher\n state={integrationsState}\n mcp={mcpState}\n onClick={() => setIntegrationsOpen(true)}\n label={t(mergedOptions.integrationsLabel)}\n maxLogos={mergedOptions.maxIntegrationLogos}\n dark={isDarkTheme(modalTheme)}\n placeholders={pendingIntegrations}\n loading={integrationsDeciding}\n />\n )}\n {mergedOptions.showCoreMemoryButton && (\n <button\n className=\"devic-new-chat-btn\"\n onClick={() => setCoreMemoryOpen(true)}\n type=\"button\"\n aria-label={coreMemoryTitle}\n title={coreMemoryTitle}\n >\n <BrainIcon />\n </button>\n )}\n <button\n className=\"devic-new-chat-btn\"\n onClick={handleNewChat}\n type=\"button\"\n aria-label={t('New chat')}\n title={t('New chat')}\n >\n <PlusIcon />\n </button>\n {!isInline && (\n <button\n className=\"devic-drawer-close\"\n onClick={handleClose}\n type=\"button\"\n aria-label={t('Close chat')}\n >\n <CloseIcon />\n </button>\n )}\n </div>\n </div>\n\n {/* Error display */}\n {chat.error && (\n <div className=\"devic-error\">\n {chat.error.message}\n </div>\n )}\n\n {/* Messages */}\n <ChatMessages\n messages={chat.messages}\n allMessages={chat.messages}\n isLoading={chat.isLoading}\n welcomeMessage={mergedOptions.welcomeMessage}\n suggestedMessages={mergedOptions.suggestedMessages}\n onSuggestedClick={handleSuggestedClick}\n showToolTimeline={mergedOptions.showToolTimeline}\n toolRenderers={mergedOptions.toolRenderers}\n toolIcons={mergedOptions.toolIcons}\n loadingIndicator={mergedOptions.loadingIndicator}\n showFeedback={mergedOptions.showFeedback}\n feedbackMap={feedbackMap}\n onFeedback={handleFeedback}\n handedOffSubThreadId={chat.handedOffSubThreadId || undefined}\n onHandoffCompleted={chat.onHandoffCompleted}\n handoffWidgetRenderer={mergedOptions.handoffWidgetRenderer}\n toolGroups={mergedOptions.toolGroups}\n userMessageRenderer={mergedOptions.userMessageRenderer}\n assistantMessageRenderer={mergedOptions.assistantMessageRenderer}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n pollingInterval={pollingInterval}\n pendingInlineWidgets={inlineWidgets}\n onSubmitWidget={chat.submitWidgetResponse}\n onCancelWidget={chat.cancelWidgetCall}\n recalledMemories={\n mergedOptions.showRecalledMemories\n ? chat.recalledMemories\n : undefined\n }\n recalledMemoriesRenderer={mergedOptions.recalledMemoriesRenderer}\n compactions={\n mergedOptions.showCompaction ? chat.compactions : undefined\n }\n compaction={\n mergedOptions.showCompaction ? chat.compaction : undefined\n }\n compactionRenderer={mergedOptions.compactionRenderer}\n guardrailRenderer={mergedOptions.guardrailRenderer}\n expandableCompaction={mergedOptions.expandableCompaction}\n />\n\n {/* Input */}\n {/* Idle, the voice widget is a card above the composer; during a call\n it takes the composer's place, banners included. */}\n {/* A host opts in, but the card only shows for an assistant that can\n take a call: with the assistant known and voice off, an end user\n would just see a Start button that never enables. */}\n {mergedOptions.liveVoice?.enabled && (chat.voice.active || !assistantInfo.assistant || assistantInfo.assistant.liveVoice?.enabled === true) && <React.Suspense fallback={null}>\n <LiveVoicePanel voice={chat.voice} client={infoClient} assistantId={assistantId} chatUid={chat.chatUid}\n canStart={isOpen && assistantInfo.assistant?.liveVoice?.enabled === true && !chat.isLoading && !chat.handedOff && !chat.limitExceeded && !inputWidget && inlineWidgets.length === 0}\n recordSessions={assistantInfo.assistant?.liveVoice?.recordSessions}>\n {chat.voice.active && !inputWidget ? <>{limitBannerNode}{usageBarNode}{queueNoticeNode}</> : null}\n </LiveVoicePanel>\n </React.Suspense>}\n {chat.voice.active && !inputWidget ? null : Boolean(mergedOptions.customPromptBox) && !(chat.voice.active && inputWidget) ? (\n <div className=\"devic-input-area\">\n {limitBannerNode}\n {usageBarNode}\n {integrationsHintNode}\n {queueNoticeNode}\n {mergedOptions.customPromptBox({\n voice: chat.voice,\n sendMessage: handleSend,\n transcribeAudio,\n stop: chat.stopChat,\n isLoading: chat.isLoading,\n queueEnabled: canQueue,\n queuedCount: chat.queuedCount,\n newConversation: chat.clearChat,\n references,\n removeReference,\n clearReferences,\n limitExceeded: chat.limitExceeded,\n })}\n </div>\n ) : (\n <ChatInput\n onSend={handleSend}\n disabled={\n // `handedOff` is one of the states the queue covers — the\n // conversation is waiting on a subagent, which in an embedded\n // widget can take minutes — so with queueing on it no longer\n // closes the box. A pending widget and a usage limit still do:\n // one is the assistant waiting on this user, the other a refusal.\n (chat.isLoading && !canQueue) ||\n (chat.handedOff && !canQueue) ||\n inlineWidgets.length > 0 ||\n !!chat.limitExceeded\n }\n placeholder={t(mergedOptions.inputPlaceholder)}\n enableFileUploads={mergedOptions.enableFileUploads}\n allowedFileTypes={mergedOptions.allowedFileTypes}\n maxFileSize={mergedOptions.maxFileSize}\n enableLongTextPaste={mergedOptions.enableLongTextPaste}\n longTextPasteThreshold={mergedOptions.longTextPasteThreshold}\n enableSpeechToText={mergedOptions.enableSpeechToText}\n speechLanguage={mergedOptions.speechLanguage}\n speechTenantId={tenantId}\n speechAutoStop={mergedOptions.speechAutoStop}\n speechAutoStopCountdownMs={mergedOptions.speechAutoStopCountdownMs}\n speechAutoStopSilenceMs={mergedOptions.speechAutoStopSilenceMs}\n speechAutoStopSilenceRatio={mergedOptions.speechAutoStopSilenceRatio}\n speechAutoStopSilenceLevel={mergedOptions.speechAutoStopSilenceLevel}\n speechAutoStopSpeechLevel={mergedOptions.speechAutoStopSpeechLevel}\n speechHandoff={mergedOptions.speechHandoff}\n speechHandoffSendDelayMs={mergedOptions.speechHandoffSendDelayMs}\n speechHandoffHoldMs={mergedOptions.speechHandoffHoldMs}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n sendButtonContent={mergedOptions.sendButtonContent}\n disabledMessage={\n chat.handedOff\n ? t('Waiting for subagent to complete')\n : inlineWidgets.length > 0\n ? t('Waiting for tool response')\n : undefined\n }\n isProcessing={chat.isLoading && !chat.handedOff}\n onStop={handleStopChat}\n allowQueueing={canQueue}\n queueNotice={queueNoticeNode}\n stopButtonContent={mergedOptions.stopButtonContent}\n pendingInputWidget={inputWidget}\n onSubmitWidget={chat.submitWidgetResponse}\n onCancelWidget={chat.cancelWidgetCall}\n references={references}\n onRemoveReference={removeReference}\n usageBar={usageBarNode}\n limitBanner={limitBannerNode}\n integrationsHint={integrationsHintNode}\n integrationsToggle={integrationsToggleNode}\n />\n )}\n </div>\n\n {/* Trigger button (drawer mode only, when closed) */}\n {!isInline && !isOpen && (\n <button\n className=\"devic-trigger\"\n onClick={handleOpen}\n style={triggerStyle}\n type=\"button\"\n aria-label={t('Open chat')}\n >\n <ChatIcon />\n </button>\n )}\n\n {/* Core memory modal (opened from the header brain button) */}\n {mergedOptions.showCoreMemoryButton && (\n <CoreMemoryModal\n isOpen={coreMemoryOpen}\n onClose={() => setCoreMemoryOpen(false)}\n assistantId={assistantId}\n tenantId={tenantId}\n subtenantId={subtenantId}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n labels={mergedOptions.coreMemoryLabels}\n theme={modalTheme}\n />\n )}\n\n {/* Connected apps modal (opened from the header app stack) */}\n {mergedOptions.showIntegrationsButton !== false && (\n <IntegrationsModal\n isOpen={integrationsOpen}\n onClose={() => setIntegrationsOpen(false)}\n assistantId={assistantId}\n tenantId={tenantId}\n subtenantId={subtenantId}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n title={t(mergedOptions.integrationsLabel)}\n theme={modalTheme}\n state={integrationsState}\n mcpState={mcpState}\n />\n )}\n </DevicTranslationsProvider>\n );\n}\n\n/**\n * Brain icon for the core memory button\n */\nfunction BrainIcon(): JSX.Element {\n return (\n <svg\n width=\"17\"\n height=\"17\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M9.5 2a2.5 2.5 0 0 0-2.45 2A3.5 3.5 0 0 0 4.6 8.6 3.5 3.5 0 0 0 3 11.5c0 1.1.5 2.08 1.29 2.73A3.5 3.5 0 0 0 7 20a3 3 0 0 0 5-2.24V4.5A2.5 2.5 0 0 0 9.5 2Z\" />\n <path d=\"M14.5 2a2.5 2.5 0 0 1 2.45 2 3.5 3.5 0 0 1 2.45 4.6A3.5 3.5 0 0 1 21 11.5a3.49 3.49 0 0 1-1.29 2.73A3.5 3.5 0 0 1 17 20a3 3 0 0 1-5-2.24V4.5A2.5 2.5 0 0 1 14.5 2Z\" />\n </svg>\n );\n}\n\nfunction CloseIcon(): JSX.Element {\n return (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n/**\n * Plus icon for new chat button\n */\nfunction PlusIcon(): JSX.Element {\n return (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\" />\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />\n </svg>\n );\n}\n\n/**\n * Chat icon for trigger button\n */\nfunction ChatIcon(): JSX.Element {\n return (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z\" />\n </svg>\n );\n}\n"],"names":["forwardRef","_jsx","ChatDrawerErrorBoundary","useMemo","useTranslations","useState","useCallback","useDevicChat","useEffect","useOptionalDevicContext","DevicApiClient","assistantInfo","useAssistantInfo","avatarUri","useIntegrations","useTenantMcp","integrationChoiceKey","useRef","readIntegrationChoice","writeIntegrationChoice","pruneIntegrationChoice","UsageBar","LimitBanner","client","useImperativeHandle","QueueNotice","DEFAULT_CORE_MEMORY_LABELS","IntegrationsHint","isDarkTheme","IntegrationsToggle","_jsxs","DevicTranslationsProvider","ConversationSelector","IntegrationsLauncher","ChatMessages","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AAA;AACf,IAAA,QACE6B,eAAA,CAAA,KAAA,EAAA,EACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EAAA,QAAA,EAAA,CAEtB7B,cAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAA,CAAG,EACvCA,cAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAA,CAAG,CAAA,EAAA,CACnC;AAEV;AAEA;;AAEG;AACH,SAAS,QAAQ,GAAA;IACf,QACEA,cAAA,CAAA,KAAA,EAAA,EACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,cAAc,EAAA,QAAA,EAEnBA,cAAA,CAAA,MAAA,EAAA,EAAM,CAAC,EAAC,yFAAyF,EAAA,CAAG,EAAA,CAChG;AAEV;;;;"}
@@ -746,7 +746,7 @@ function ChatDrawerInner({ assistantId, chatUid: initialChatUid, options = {}, e
746
746
  ? t(mergedOptions.title)
747
747
  : mergedOptions.title }), jsx(ConversationSelector, { assistantId: assistantId, currentChatUid: chat.chatUid, onSelect: handleConversationSelect, onNewChat: handleNewChat, apiKey: apiKey, baseUrl: baseUrl, tenantId: tenantId, subtenantId: subtenantId, conversationPreview: mergedOptions.conversationPreview }), jsxs("div", { className: "devic-drawer-header-actions", children: [mergedOptions.showIntegrationsButton !== false && (jsx(IntegrationsLauncher, { state: integrationsState, mcp: mcpState, onClick: () => setIntegrationsOpen(true), label: t(mergedOptions.integrationsLabel), maxLogos: mergedOptions.maxIntegrationLogos, dark: isDarkTheme(modalTheme), placeholders: pendingIntegrations, loading: integrationsDeciding })), mergedOptions.showCoreMemoryButton && (jsx("button", { className: "devic-new-chat-btn", onClick: () => setCoreMemoryOpen(true), type: "button", "aria-label": coreMemoryTitle, title: coreMemoryTitle, children: jsx(BrainIcon, {}) })), jsx("button", { className: "devic-new-chat-btn", onClick: handleNewChat, type: "button", "aria-label": t('New chat'), title: t('New chat'), children: jsx(PlusIcon, {}) }), !isInline && (jsx("button", { className: "devic-drawer-close", onClick: handleClose, type: "button", "aria-label": t('Close chat'), children: jsx(CloseIcon, {}) }))] })] }), chat.error && (jsx("div", { className: "devic-error", children: chat.error.message })), jsx(ChatMessages, { messages: chat.messages, allMessages: chat.messages, isLoading: chat.isLoading, welcomeMessage: mergedOptions.welcomeMessage, suggestedMessages: mergedOptions.suggestedMessages, onSuggestedClick: handleSuggestedClick, showToolTimeline: mergedOptions.showToolTimeline, toolRenderers: mergedOptions.toolRenderers, toolIcons: mergedOptions.toolIcons, loadingIndicator: mergedOptions.loadingIndicator, showFeedback: mergedOptions.showFeedback, feedbackMap: feedbackMap, onFeedback: handleFeedback, handedOffSubThreadId: chat.handedOffSubThreadId || undefined, onHandoffCompleted: chat.onHandoffCompleted, handoffWidgetRenderer: mergedOptions.handoffWidgetRenderer, toolGroups: mergedOptions.toolGroups, userMessageRenderer: mergedOptions.userMessageRenderer, assistantMessageRenderer: mergedOptions.assistantMessageRenderer, apiKey: resolvedApiKey, baseUrl: resolvedBaseUrl, pollingInterval: pollingInterval, pendingInlineWidgets: inlineWidgets, onSubmitWidget: chat.submitWidgetResponse, onCancelWidget: chat.cancelWidgetCall, recalledMemories: mergedOptions.showRecalledMemories
748
748
  ? chat.recalledMemories
749
- : undefined, recalledMemoriesRenderer: mergedOptions.recalledMemoriesRenderer, compactions: mergedOptions.showCompaction ? chat.compactions : undefined, compaction: mergedOptions.showCompaction ? chat.compaction : undefined, compactionRenderer: mergedOptions.compactionRenderer, guardrailRenderer: mergedOptions.guardrailRenderer, expandableCompaction: mergedOptions.expandableCompaction }), mergedOptions.liveVoice?.enabled && jsx(React.Suspense, { fallback: null, children: jsx(LiveVoicePanel, { voice: chat.voice, client: infoClient, assistantId: assistantId, chatUid: chat.chatUid, canStart: isOpen && assistantInfo.assistant?.liveVoice?.enabled === true && !chat.isLoading && !chat.handedOff && !chat.limitExceeded && !inputWidget && inlineWidgets.length === 0, recordSessions: assistantInfo.assistant?.liveVoice?.recordSessions, children: chat.voice.active && !inputWidget ? jsxs(Fragment, { children: [limitBannerNode, usageBarNode, queueNoticeNode] }) : null }) }), chat.voice.active && !inputWidget ? null : Boolean(mergedOptions.customPromptBox) && !(chat.voice.active && inputWidget) ? (jsxs("div", { className: "devic-input-area", children: [limitBannerNode, usageBarNode, integrationsHintNode, queueNoticeNode, mergedOptions.customPromptBox({
749
+ : undefined, recalledMemoriesRenderer: mergedOptions.recalledMemoriesRenderer, compactions: mergedOptions.showCompaction ? chat.compactions : undefined, compaction: mergedOptions.showCompaction ? chat.compaction : undefined, compactionRenderer: mergedOptions.compactionRenderer, guardrailRenderer: mergedOptions.guardrailRenderer, expandableCompaction: mergedOptions.expandableCompaction }), mergedOptions.liveVoice?.enabled && (chat.voice.active || !assistantInfo.assistant || assistantInfo.assistant.liveVoice?.enabled === true) && jsx(React.Suspense, { fallback: null, children: jsx(LiveVoicePanel, { voice: chat.voice, client: infoClient, assistantId: assistantId, chatUid: chat.chatUid, canStart: isOpen && assistantInfo.assistant?.liveVoice?.enabled === true && !chat.isLoading && !chat.handedOff && !chat.limitExceeded && !inputWidget && inlineWidgets.length === 0, recordSessions: assistantInfo.assistant?.liveVoice?.recordSessions, children: chat.voice.active && !inputWidget ? jsxs(Fragment, { children: [limitBannerNode, usageBarNode, queueNoticeNode] }) : null }) }), chat.voice.active && !inputWidget ? null : Boolean(mergedOptions.customPromptBox) && !(chat.voice.active && inputWidget) ? (jsxs("div", { className: "devic-input-area", children: [limitBannerNode, usageBarNode, integrationsHintNode, queueNoticeNode, mergedOptions.customPromptBox({
750
750
  voice: chat.voice,
751
751
  sendMessage: handleSend,
752
752
  transcribeAudio,
@@ -1 +1 @@
1
- {"version":3,"file":"ChatDrawer.js","sources":["../../../../src/components/ChatDrawer/ChatDrawer.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback, useMemo, useRef, forwardRef, useImperativeHandle } from 'react';\nimport { useDevicChat } from '../../hooks/useDevicChat';\nimport { useOptionalDevicContext } from '../../provider';\nimport { DevicApiClient } from '../../api/client';\nimport { useAssistantInfo } from '../../api/assistantInfo';\nimport { ChatMessages } from './ChatMessages';\nimport { ChatInput } from './ChatInput';\nimport { ConversationSelector } from './ConversationSelector';\nimport { ChatDrawerErrorBoundary } from './ErrorBoundary';\nimport { UsageBar } from './UsageBar';\nimport { LimitBanner } from './LimitBanner';\nimport { QueueNotice } from './QueueNotice';\nimport { CoreMemoryModal, DEFAULT_CORE_MEMORY_LABELS } from '../CoreMemoryModal';\nimport {\n IntegrationsHint,\n IntegrationsLauncher,\n IntegrationsModal,\n IntegrationsToggle,\n useIntegrations,\n useTenantMcp,\n integrationChoiceKey,\n readIntegrationChoice,\n writeIntegrationChoice,\n pruneIntegrationChoice,\n} from '../IntegrationsModal';\nimport { isDarkTheme } from '../theme';\nimport { DevicTranslationsProvider, useTranslations } from '../../i18n';\nimport type { DevicTheme } from '../theme';\nimport type { ChatDrawerProps, ChatDrawerOptions, ChatDrawerHandle } from './ChatDrawer.types';\nimport type { QueueDisposition } from '../../api/types';\nimport './styles.css';\nconst LiveVoicePanel = React.lazy(() => import('./LiveVoicePanel'));\nimport { avatarUri } from '../../utils/avatar';\n\nconst DEFAULT_OPTIONS: Required<ChatDrawerOptions> = {\n liveVoice: { enabled: false },\n position: 'right',\n width: '100%',\n defaultOpen: false,\n color: '#1890ff',\n welcomeMessage: '',\n suggestedMessages: [],\n enableFileUploads: false,\n allowedFileTypes: { images: true, documents: true },\n maxFileSize: 10 * 1024 * 1024,\n enableLongTextPaste: false,\n longTextPasteThreshold: 2000,\n enableSpeechToText: false,\n speechLanguage: undefined as any,\n speechAutoStop: true,\n speechAutoStopCountdownMs: 1000,\n speechAutoStopSilenceMs: 1000,\n speechAutoStopSilenceRatio: 0.1,\n speechAutoStopSilenceLevel: 0.02,\n speechAutoStopSpeechLevel: 0.12,\n speechHandoff: false,\n speechHandoffSendDelayMs: 1000,\n speechHandoffHoldMs: 3000,\n inputPlaceholder: 'Type a message...',\n title: 'Chat',\n showAvatar: false,\n avatarUrl: undefined as any,\n showToolTimeline: true,\n zIndex: 1000,\n borderRadius: 0,\n resizable: false,\n minWidth: 300,\n maxWidth: 800,\n style: {},\n fontFamily: undefined as any,\n backgroundColor: undefined as any,\n textColor: undefined as any,\n secondaryBackgroundColor: undefined as any,\n borderColor: undefined as any,\n userBubbleColor: undefined as any,\n userBubbleTextColor: undefined as any,\n assistantBubbleColor: undefined as any,\n assistantBubbleTextColor: undefined as any,\n sendButtonColor: undefined as any,\n loadingIndicator: undefined as any,\n sendButtonContent: undefined as any,\n toolRenderers: undefined as any,\n toolIcons: undefined as any,\n showFeedback: true,\n handoffWidgetRenderer: undefined as any,\n toolGroups: undefined as any,\n stopButtonContent: undefined as any,\n debug: false,\n persistConversation: false,\n customPromptBox: undefined as any,\n userMessageRenderer: undefined as any,\n assistantMessageRenderer: undefined as any,\n conversationPreview: 'date',\n showUsageBar: false,\n usageBarMetric: undefined as any,\n usageBarDisplay: undefined as any,\n customUsageBar: undefined as any,\n hideLimitBanner: false,\n limitBannerRenderer: undefined as any,\n hideQueueNotice: false,\n queueNoticeRenderer: undefined as any,\n // Unset on purpose: the assistant's own setting decides.\n messageQueue: undefined as any,\n showRecalledMemories: true,\n recalledMemoriesRenderer: undefined as any,\n showCompaction: true,\n expandableCompaction: false,\n compactionRenderer: undefined as any,\n guardrailRenderer: undefined as any,\n showCoreMemoryButton: false,\n coreMemoryLabels: undefined as any,\n showIntegrationsButton: true,\n integrationsLabel: 'Connected apps',\n maxIntegrationLogos: 6,\n showIntegrationsHint: true,\n // Left unset so the strip can say \"Connect your apps\" or \"Explore connected\n // apps\" depending on what the end user has actually done.\n integrationsHintLabel: undefined as any,\n showIntegrationsToggle: true,\n integrationsToggleLabel: 'Apps in this chat',\n translations: undefined as any,\n};\n\n/**\n * Chat drawer component for Devic assistants\n *\n * @example\n * ```tsx\n * <ChatDrawer\n * ref={drawerRef}\n * assistantId=\"my-assistant\"\n * options={{\n * position: 'right',\n * width: 400,\n * welcomeMessage: 'Hello! How can I help you?',\n * suggestedMessages: ['Help me with...', 'Tell me about...'],\n * }}\n * modelInterfaceTools={[\n * {\n * toolName: 'get_user_location',\n * schema: { ... },\n * callback: async () => ({ lat: 40.7, lng: -74.0 })\n * }\n * ]}\n * onMessageReceived={(msg) => console.log('Received:', msg)}\n * />\n * ```\n */\nexport const ChatDrawer = forwardRef<ChatDrawerHandle, ChatDrawerProps>(\n function ChatDrawer(props, ref) {\n return (\n <ChatDrawerErrorBoundary>\n <ChatDrawerInner {...props} forwardedRef={ref} />\n </ChatDrawerErrorBoundary>\n );\n }\n);\n\ninterface ChatDrawerInnerProps extends ChatDrawerProps {\n forwardedRef?: React.Ref<ChatDrawerHandle>;\n}\n\nfunction ChatDrawerInner({\n assistantId,\n chatUid: initialChatUid,\n options = {},\n enabledTools,\n modelInterfaceTools,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n apiKey,\n baseUrl,\n pollingInterval,\n streaming,\n onMessageSent,\n onMessageReceived,\n onToolCall,\n onError,\n onChatCreated,\n onFileUpload,\n onOpen,\n onClose,\n isOpen: controlledIsOpen,\n className,\n mode = 'drawer',\n onConversationChange,\n forwardedRef,\n}: ChatDrawerInnerProps): JSX.Element {\n // Merge options with defaults\n const mergedOptions = useMemo(\n () => ({ ...DEFAULT_OPTIONS, ...options }),\n [options]\n );\n\n // Texts the drawer renders itself, translated through the dictionary of the\n // provider plus this drawer's own. Applied to the option defaults too, so a\n // host that leaves `title` or `inputPlaceholder` alone still gets them in\n // its language; a host that sets its own text keeps it, unless it also put\n // that text in the dictionary.\n const t = useTranslations(mergedOptions.translations);\n\n // localStorage key for persisting selected conversation\n const storageKey = mergedOptions.persistConversation\n ? `devic-ui-chatUid-${assistantId}`\n : null;\n\n // Resolve initial chatUid: prop takes priority, then localStorage\n const resolvedInitialChatUid = useMemo(() => {\n if (initialChatUid) return initialChatUid;\n if (storageKey) {\n try { return localStorage.getItem(storageKey) || undefined; } catch { return undefined; }\n }\n return undefined;\n }, [initialChatUid, storageKey]);\n\n // Drawer open state (can be controlled or uncontrolled; inline mode is always open)\n const [internalIsOpen, setInternalIsOpen] = useState(mergedOptions.defaultOpen);\n const isInline = mode === 'inline';\n const isOpen = isInline ? true : (controlledIsOpen ?? internalIsOpen);\n\n // Wrap onChatCreated to persist chatUid in localStorage\n const handleChatCreated = useCallback(\n (chatUid: string) => {\n if (storageKey) {\n try { localStorage.setItem(storageKey, chatUid); } catch {}\n }\n onChatCreated?.(chatUid);\n },\n [storageKey, onChatCreated]\n );\n\n /**\n * What the end user switched off: connected apps by slug, and their own MCP\n * servers by the `toggleId` the API hands out.\n *\n * Remembered in this browser (see `integrationChoice`) rather than only for\n * the life of the drawer — a reload used to forget it, which for someone who\n * keeps an app switched off on purpose reads as the switch not working. The\n * server still keeps nothing beyond the turn it was sent for; what is stored\n * is a preference of whoever is at this keyboard.\n *\n * The badge on the plug is what keeps that honest: a remembered choice is\n * visible at a glance rather than being an unexplained silence from an app.\n */\n const [disabledIntegrations, setDisabledIntegrations] = useState<string[]>([]);\n\n // Use chat hook\n const chat = useDevicChat({\n assistantId,\n chatUid: resolvedInitialChatUid,\n apiKey,\n baseUrl,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n enabledTools,\n disabledIntegrations,\n modelInterfaceTools,\n pollingInterval,\n streaming,\n onMessageSent,\n onMessageReceived,\n onToolCall,\n onError,\n onChatCreated: handleChatCreated,\n onFileUpload,\n messageQueue: mergedOptions.messageQueue,\n liveVoice: mergedOptions.liveVoice,\n debug: mergedOptions.debug,\n });\n\n // Fetch assistant avatar when showAvatar is enabled\n useEffect(() => { if (!isOpen) void chat.voice.stop(); }, [isOpen, chat.voice.stop]);\n const context = useOptionalDevicContext();\n const resolvedApiKey = apiKey || context?.apiKey;\n // The session source, when the page authenticates with one. Every client\n // built below gets it, or a page without an API key would have nothing to\n // authenticate with.\n const resolvedTenantSession = context?.getTenantSession;\n const onSessionExpired = context?.onSessionExpired;\n const resolvedBaseUrl = baseUrl || context?.baseUrl || 'https://api.devic.ai';\n const [coreMemoryOpen, setCoreMemoryOpen] = useState(false);\n const [integrationsOpen, setIntegrationsOpen] = useState(false);\n\n const infoClient = useMemo(\n () =>\n resolvedApiKey || resolvedTenantSession\n ? new DevicApiClient({\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n getTenantSession: resolvedTenantSession,\n onSessionExpired,\n })\n : null,\n [resolvedApiKey, resolvedTenantSession, resolvedBaseUrl]\n );\n\n // Asked for only when something on screen depends on it, and then at most\n // once per assistant however many times this drawer is mounted — a host that\n // remounts it to start a fresh conversation used to pay for the answer again\n // every time.\n const assistantInfo = useAssistantInfo({\n assistantId,\n client: infoClient,\n baseUrl: resolvedBaseUrl,\n credential: resolvedApiKey || 'session',\n enabled:\n (!!mergedOptions.liveVoice?.enabled && isOpen) ||\n (!!mergedOptions.showAvatar && !mergedOptions.avatarUrl) ||\n (mergedOptions.showIntegrationsButton !== false && isOpen),\n });\n // The host's own image wins: an assistant carries one image for everybody, so\n // this is the only place a per-account face can come from. Failing that, an\n // assistant with no uploaded image still gets a face, generated from its\n // identifier — the same one the console shows for it. Drawn from `assistantId`\n // rather than from the fetched assistant so the header is not empty while the\n // lookup is in flight; the two agree, since that is what was asked for.\n const avatarUrl = mergedOptions.showAvatar\n ? (mergedOptions.avatarUrl ??\n assistantInfo.assistant?.imgUrl ??\n avatarUri(\n assistantInfo.assistant?.identifier || assistantId,\n assistantInfo.assistant?.avatarStyle\n ))\n : null;\n\n /**\n * Whether to ask which apps this assistant offers.\n *\n * The listing is worth a request only when there is something to list, and\n * most assistants offer nothing — for those, the call existed purely to be\n * refused, once per page load. The assistant now says so itself, so a plain\n * `false` settles it without asking.\n *\n * Anything else asks, exactly as before: a field that is absent means the API\n * is older than it, not that the answer is no, and a failed lookup means we\n * could not find out. Hiding the button on either would lose the feature for\n * a deployment that has it, which is far worse than one spare request.\n *\n * Where there are apps to show, this puts the two requests in sequence rather\n * than at once, so the listing lands later than it used to. The header holds\n * its place in the meantime — see `pendingIntegrations`.\n */\n const mayOfferIntegrations =\n assistantInfo.settled &&\n assistantInfo.assistant?.tenantIntegrations?.enabled !== false;\n\n // The apps this assistant offers its tenants. Loaded once, here, because the\n // header control cannot decide whether to exist without it — and lent to the\n // modal so opening it does not ask for the same listing again. Nothing is\n // fetched until the drawer is opened for the first time.\n const integrationsState = useIntegrations({\n assistantId,\n tenantId,\n subtenantId,\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n enabled:\n mergedOptions.showIntegrationsButton !== false &&\n isOpen &&\n mayOfferIntegrations,\n });\n\n /**\n * Whether this assistant offers MCP servers of the tenant's own.\n *\n * Read exactly like `mayOfferIntegrations`: absence means \"cannot tell\", so\n * the listing is asked for anyway. A deployment older than the field keeps\n * the behaviour it had — one refusal per drawer open — rather than losing the\n * feature.\n */\n const mayOfferMcp =\n assistantInfo.settled &&\n assistantInfo.assistant?.tenantMcpServers?.enabled !== false;\n\n /**\n * The tenant's own MCP servers, loaded here rather than inside the modal.\n *\n * The composer's switch needs them too, and it is not inside the modal — so\n * the listing has to live above both. The modal takes it as a prop and stops\n * asking for its own.\n */\n const mcpState = useTenantMcp({\n assistantId,\n tenantId,\n subtenantId,\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n enabled:\n mergedOptions.showIntegrationsButton !== false && isOpen && mayOfferMcp,\n });\n\n /**\n * Whether the answer to \"is there anything to show here\" is still on its way.\n *\n * Two requests decide it — what the assistant offers, and then what this\n * tenant has connected — and until both have answered the control cannot\n * know whether to exist. Without this the header simply had a gap and then a\n * button, which reads as the page changing its mind.\n */\n const integrationsDeciding =\n mergedOptions.showIntegrationsButton !== false &&\n isOpen &&\n (!assistantInfo.settled ||\n (mayOfferIntegrations && !integrationsState.settled) ||\n (mayOfferMcp && !mcpState.settled));\n\n /**\n * Placeholder chips to hold while the listing is in flight.\n *\n * Only when the assistant has said outright that it offers apps, and how\n * many: on a maybe there would be nothing to hold the place of half the time,\n * and a control that appears and then vanishes is worse than one that arrives\n * late. So this stays at zero for an API that does not say, which is also the\n * behaviour every version until now had.\n */\n const pendingIntegrations =\n assistantInfo.assistant?.tenantIntegrations?.enabled === true &&\n !integrationsState.settled\n ? (assistantInfo.assistant.tenantIntegrations.count ?? 0)\n : 0;\n\n // Tenant/subtenant resolution mirrors useDevicChat (prop overrides provider).\n const resolvedTenantId = tenantId || context?.tenantId;\n const resolvedSubtenantId = subtenantId || context?.subtenantId;\n\n // ── Remembering which apps and servers are switched off ────────────────\n\n const choiceKey = integrationChoiceKey(\n assistantId,\n resolvedTenantId,\n resolvedSubtenantId\n );\n\n // Loaded per key, so switching tenant loads that tenant's choice rather than\n // carrying the previous one over.\n const loadedChoiceRef = useRef<string | null>(null);\n useEffect(() => {\n if (loadedChoiceRef.current === choiceKey) return;\n loadedChoiceRef.current = choiceKey;\n setDisabledIntegrations(readIntegrationChoice(choiceKey));\n }, [choiceKey]);\n\n useEffect(() => {\n // Only once this key's stored value has been read, or the empty initial\n // state would erase it before it was ever loaded.\n if (loadedChoiceRef.current !== choiceKey) return;\n writeIntegrationChoice(choiceKey, disabledIntegrations);\n }, [choiceKey, disabledIntegrations]);\n\n /**\n * Forgets what is no longer on offer, once the listings can say so.\n *\n * Every clause of this is load-bearing. `mayOffer*` is false BEFORE the\n * assistant has answered as well as when the answer is no, so without the\n * `assistantInfo.settled` guard the prune runs on the first render against\n * two empty listings and erases the very thing that was just loaded — which\n * is exactly the reload-forgets-it bug this was meant to fix. A definite\n * \"this assistant offers none\" is an answer; an unsettled listing is not.\n *\n * With the drawer never opened, neither listing is ever fetched, so nothing\n * is pruned and the stored choice survives untouched.\n */\n const appsKnown =\n assistantInfo.settled && (!mayOfferIntegrations || integrationsState.settled);\n const mcpKnown = assistantInfo.settled && (!mayOfferMcp || mcpState.settled);\n useEffect(() => {\n if (!appsKnown || !mcpKnown) return;\n const live = [\n ...integrationsState.integrations\n .filter((i) => i.connected)\n .map((i) => i.app),\n ...mcpState.servers\n .filter((s) => s.connection?.status === 'active' && s.connection.toggleId)\n .map((s) => s.connection!.toggleId as string),\n ];\n setDisabledIntegrations((prev) => pruneIntegrationChoice(prev, live));\n }, [appsKnown, mcpKnown, integrationsState.integrations, mcpState.servers]);\n\n // Usage bar (above the input) — only when enabled and a tenant is known.\n // Refetches after each turn via the message count as refresh key.\n const usageBarNode =\n (mergedOptions.showUsageBar ||\n typeof mergedOptions.customUsageBar === 'function') &&\n resolvedTenantId ? (\n <UsageBar\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n tenantId={resolvedTenantId}\n subtenantId={resolvedSubtenantId}\n mode={mergedOptions.showUsageBar === 'onDemand' ? 'onDemand' : 'always'}\n metric={mergedOptions.usageBarMetric}\n display={mergedOptions.usageBarDisplay}\n customUsageBar={mergedOptions.customUsageBar}\n color={mergedOptions.color}\n refreshKey={chat.messages.length}\n debug={mergedOptions.debug}\n />\n ) : null;\n\n // Default usage-limit banner (above the input) — opt-out via hideLimitBanner,\n // override via limitBannerRenderer.\n const limitBannerNode =\n chat.limitExceeded && !mergedOptions.hideLimitBanner\n ? mergedOptions.limitBannerRenderer\n ? mergedOptions.limitBannerRenderer(chat.limitExceeded)\n : <LimitBanner limit={chat.limitExceeded} />\n : null;\n\n // Speech-to-text transcription, exposed to custom prompt boxes so a developer\n // can transcribe audio (binary or URL) and attach the resulting transcriptId.\n const transcribeAudio = useCallback(\n (\n audio: Blob | string,\n transcribeOptions?: {\n language?: string;\n messageUid?: string;\n chatUid?: string;\n tenantId?: string;\n },\n ) => {\n if (!resolvedApiKey && !resolvedTenantSession) {\n return Promise.reject(\n new Error(t('No credentials configured. Cannot transcribe audio.')),\n );\n }\n const client = new DevicApiClient({ apiKey: resolvedApiKey, baseUrl: resolvedBaseUrl, getTenantSession: resolvedTenantSession, onSessionExpired });\n return client.transcribeAudio(audio, {\n language: transcribeOptions?.language ?? mergedOptions.speechLanguage,\n messageUid: transcribeOptions?.messageUid,\n chatUid: transcribeOptions?.chatUid,\n tenantId: transcribeOptions?.tenantId ?? tenantId,\n });\n },\n [resolvedApiKey, resolvedTenantSession, resolvedBaseUrl, mergedOptions.speechLanguage, tenantId],\n );\n\n // Handle open/close\n const handleOpen = useCallback(() => {\n setInternalIsOpen(true);\n onOpen?.();\n }, [onOpen]);\n\n const handleClose = useCallback(() => {\n setInternalIsOpen(false);\n onClose?.();\n }, [onClose]);\n\n const handleToggle = useCallback(() => {\n setInternalIsOpen((prev) => !prev);\n }, []);\n\n // Expose handle for programmatic control\n useImperativeHandle(forwardedRef, () => ({\n open: handleOpen,\n close: handleClose,\n toggle: handleToggle,\n setChatUid: (chatUid: string) => {\n chat.loadChat(chatUid);\n },\n sendMessage: (message: string) => {\n chat.sendMessage(message);\n },\n }), [handleOpen, handleClose, handleToggle, chat]);\n\n // Register this drawer in the DevicProvider so AIElementWrapper can open it\n useEffect(() => {\n if (!context?.registerDrawer) return;\n const unregister = context.registerDrawer({\n open: handleOpen,\n close: handleClose,\n toggle: handleToggle,\n sendMessage: (message: string) => chat.sendMessage(message),\n });\n return unregister;\n }, [context, handleOpen, handleClose, handleToggle, chat]);\n\n // Partition pending widget calls by render mode\n const { inlineWidgets, inputWidget } = useMemo(() => {\n const inline: typeof chat.pendingWidgetCalls = [];\n let input: typeof chat.pendingWidgetCalls[number] | null = null;\n for (const wc of chat.pendingWidgetCalls) {\n if (wc.widget.render === 'input' && !input) {\n input = wc;\n } else {\n inline.push(wc);\n }\n }\n return { inlineWidgets: inline, inputWidget: input };\n }, [chat.pendingWidgetCalls]);\n\n // Active references from DevicProvider (created by AIElementWrapper)\n const references = context?.references ?? [];\n const removeReference = useCallback(\n (id: string) => {\n context?.removeReference(id);\n },\n [context]\n );\n const clearReferences = useCallback(() => {\n context?.clearReferences();\n }, [context]);\n\n // Handle send message — prefix references and clear them after sending\n /**\n * What the last accepted message was told about when it gets picked up. Only\n * the wording of the notice depends on it.\n */\n const [queueDisposition, setQueueDisposition] = useState<\n QueueDisposition | undefined\n >();\n /**\n * What became of a message that did not simply join the queue: it was turned\n * down, or a stop threw it away. Said out loud, because in both cases the\n * user's text has just moved back into the box on its own.\n */\n const [queueAlert, setQueueAlert] = useState<string | null>(null);\n\n const handleSend = useCallback(\n async (\n message: string,\n files?: File[],\n meta?: { transcriptId?: string; tags?: string[] }\n ) => {\n let finalMessage = message;\n if (references.length > 0) {\n const labels = references.map((r) => `\"${r.label}\"`).join(', ');\n finalMessage = `Elemento referenciado: ${labels}\\n\\n${message}`;\n }\n setQueueAlert(null);\n const result = await chat.sendMessage(finalMessage, {\n files,\n transcriptId: meta?.transcriptId,\n tags: meta?.tags,\n });\n\n if ('rejected' in result) {\n // The references belong to the message that was not sent, so they stay.\n if (result.reason !== 'error') {\n // An ordinary error already reaches the host through `onError`; these\n // two do not, and the only sign of them would otherwise be the text\n // reappearing in the box with no explanation.\n setQueueAlert(\n result.reason === 'queue_full'\n ? `${result.message} ${t('Your message is back in the box.')}`\n : t(\n 'The assistant is not taking messages while it works. Your message is back in the box.'\n )\n );\n }\n return result;\n }\n\n setQueueDisposition('queued' in result && result.queued ? result.willProcess : undefined);\n if (references.length > 0) clearReferences();\n return result;\n },\n [chat, references, clearReferences]\n );\n\n /**\n * Whether a message may be written while the assistant is working.\n *\n * Being busy is not the only reason the box closes, and the other two are not\n * about waiting: an inline widget is the assistant waiting on *this* user, and\n * a usage limit is a refusal the queue cannot soften.\n */\n const canQueue =\n chat.queueEnabled && inlineWidgets.length === 0 && !chat.limitExceeded;\n\n const handleStopChat = useCallback(async () => {\n const result = await chat.stopChat();\n setQueueDisposition(undefined);\n setQueueAlert(\n result.discarded\n ? result.discarded === 1\n ? t('A queued message was not sent — the text is back in the box.')\n : t(\n '{count} queued messages were not sent — the text is back in the box.',\n { count: result.discarded }\n )\n : null\n );\n return result;\n }, [chat]);\n\n /**\n * Shown while there is something to explain: the user is writing into a run\n * that has not finished, or messages are already waiting. With nothing typed\n * and nothing queued there is nothing to say.\n */\n const queueNoticeNode =\n !mergedOptions.hideQueueNotice &&\n // `queuedCount` on its own matters: an assistant with an input delay queues\n // what is written into an *idle* conversation whether or not it takes\n // messages while busy, so there can be something waiting with the queue\n // switched off.\n (queueAlert || chat.queuedCount > 0 || (canQueue && chat.isLoading))\n ? mergedOptions.queueNoticeRenderer\n ? mergedOptions.queueNoticeRenderer({\n queuedCount: chat.queuedCount,\n willProcess: queueDisposition,\n alert: queueAlert ?? undefined,\n })\n : (\n <QueueNotice\n queuedCount={chat.queuedCount}\n willProcess={queueDisposition}\n alert={queueAlert ?? undefined}\n />\n )\n : null;\n\n // Handle conversation selection\n const handleConversationSelect = useCallback(\n (chatUid: string) => {\n chat.loadChat(chatUid);\n onConversationChange?.(chatUid);\n if (storageKey) {\n try { localStorage.setItem(storageKey, chatUid); } catch {}\n }\n },\n [chat, onConversationChange, storageKey]\n );\n\n const handleNewChat = useCallback(() => {\n chat.clearChat();\n if (storageKey) {\n try { localStorage.removeItem(storageKey); } catch {}\n }\n }, [chat, storageKey]);\n\n // Handle suggested message click\n const handleSuggestedClick = useCallback(\n (message: string) => {\n chat.sendMessage(message);\n },\n [chat]\n );\n\n // Feedback state\n const [feedbackMap, setFeedbackMap] = useState<Map<string, 'positive' | 'negative'>>(new Map());\n const feedbackClientRef = useRef<DevicApiClient | null>(null);\n\n // Initialize feedback client\n useEffect(() => {\n if ((resolvedApiKey || resolvedTenantSession) && !feedbackClientRef.current) {\n feedbackClientRef.current = new DevicApiClient({\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n getTenantSession: resolvedTenantSession,\n onSessionExpired,\n });\n }\n }, [resolvedApiKey, resolvedTenantSession, resolvedBaseUrl]);\n\n // Load existing feedback when chat changes\n useEffect(() => {\n if (!chat.chatUid || !feedbackClientRef.current || !mergedOptions.showFeedback) return;\n\n feedbackClientRef.current.getChatFeedback(assistantId, chat.chatUid)\n .then((entries) => {\n const newMap = new Map<string, 'positive' | 'negative'>();\n for (const entry of entries) {\n if (entry.feedback !== undefined) {\n newMap.set(entry.requestId, entry.feedback ? 'positive' : 'negative');\n }\n }\n setFeedbackMap(newMap);\n })\n .catch(() => {\n // Silently ignore feedback loading errors\n });\n }, [chat.chatUid, assistantId, mergedOptions.showFeedback]);\n\n // Handle feedback submission\n const handleFeedback = useCallback(\n async (messageId: string, positive: boolean, comment?: string) => {\n if (!chat.chatUid || !feedbackClientRef.current) return;\n\n try {\n await feedbackClientRef.current.submitChatFeedback(assistantId, chat.chatUid, {\n messageId,\n feedback: positive,\n feedbackComment: comment,\n });\n\n setFeedbackMap((prev) => {\n const newMap = new Map(prev);\n newMap.set(messageId, positive ? 'positive' : 'negative');\n return newMap;\n });\n } catch (err) {\n console.error('Failed to submit feedback:', err);\n throw err;\n }\n },\n [chat.chatUid, assistantId]\n );\n\n // Apply CSS variables for theming on the drawer element itself\n // (must target the component root so they override the defaults defined on .devic-chat-drawer)\n const drawerRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n const el = drawerRef.current;\n if (!el) return;\n const vars: [string, string | undefined][] = [\n ['--devic-primary', mergedOptions.color !== DEFAULT_OPTIONS.color ? mergedOptions.color : undefined],\n ['--devic-font-family', mergedOptions.fontFamily],\n ['--devic-bg', mergedOptions.backgroundColor],\n ['--devic-text', mergedOptions.textColor],\n ['--devic-bg-secondary', mergedOptions.secondaryBackgroundColor],\n ['--devic-border', mergedOptions.borderColor],\n ['--devic-user-bubble', mergedOptions.userBubbleColor],\n ['--devic-user-bubble-text', mergedOptions.userBubbleTextColor],\n ['--devic-assistant-bubble', mergedOptions.assistantBubbleColor],\n ['--devic-assistant-bubble-text', mergedOptions.assistantBubbleTextColor],\n ['--devic-send-btn', mergedOptions.sendButtonColor],\n ];\n for (const [name, value] of vars) {\n if (value) {\n el.style.setProperty(name, value);\n } else {\n el.style.removeProperty(name);\n }\n }\n }, [mergedOptions.color, mergedOptions.fontFamily, mergedOptions.backgroundColor, mergedOptions.textColor, mergedOptions.secondaryBackgroundColor, mergedOptions.borderColor, mergedOptions.userBubbleColor, mergedOptions.userBubbleTextColor, mergedOptions.assistantBubbleColor, mergedOptions.assistantBubbleTextColor, mergedOptions.sendButtonColor]);\n\n // The same values, handed to the dialogs this drawer opens. They render\n // through a portal into document.body, so the variables set above — which\n // live on the drawer element — never reach them.\n // The brain button says what the modal it opens is called.\n const coreMemoryTitle =\n mergedOptions.coreMemoryLabels?.title ??\n t(DEFAULT_CORE_MEMORY_LABELS.title);\n\n const modalTheme: DevicTheme = useMemo(\n () => ({\n color:\n mergedOptions.color !== DEFAULT_OPTIONS.color\n ? mergedOptions.color\n : undefined,\n fontFamily: mergedOptions.fontFamily,\n backgroundColor: mergedOptions.backgroundColor,\n textColor: mergedOptions.textColor,\n secondaryBackgroundColor: mergedOptions.secondaryBackgroundColor,\n borderColor: mergedOptions.borderColor,\n }),\n [\n mergedOptions.color,\n mergedOptions.fontFamily,\n mergedOptions.backgroundColor,\n mergedOptions.textColor,\n mergedOptions.secondaryBackgroundColor,\n mergedOptions.borderColor,\n ]\n );\n\n // The strip above the composer. Dismissed per end user, because the whole\n // point of remembering a dismissal is that the same person is not told twice.\n const integrationsHintNode =\n mergedOptions.showIntegrationsButton !== false &&\n mergedOptions.showIntegrationsHint !== false ? (\n <IntegrationsHint\n state={integrationsState}\n onOpen={() => setIntegrationsOpen(true)}\n label={mergedOptions.integrationsHintLabel}\n maxLogos={mergedOptions.maxIntegrationLogos}\n storageKey={`${assistantId}:${resolvedTenantId ?? ''}:${resolvedSubtenantId ?? ''}`}\n dark={isDarkTheme(modalTheme)}\n />\n ) : null;\n\n // The per-message switch in the composer row. Shown only where there is\n // something to switch — the control returns null with nothing connected —\n // and hidden outright by `showIntegrationsToggle: false`.\n const integrationsToggleNode =\n mergedOptions.showIntegrationsButton !== false &&\n mergedOptions.showIntegrationsToggle !== false ? (\n <IntegrationsToggle\n state={integrationsState}\n mcp={mcpState}\n disabled={disabledIntegrations}\n onChange={setDisabledIntegrations}\n onManage={() => setIntegrationsOpen(true)}\n label={t(mergedOptions.integrationsToggleLabel)}\n dark={isDarkTheme(modalTheme)}\n busy={chat.isLoading}\n loading={integrationsDeciding}\n />\n ) : null;\n\n // Resizable drawer\n const [resizedWidth, setResizedWidth] = useState<number | null>(null);\n\n const handleResizeStart = useCallback(\n (e: React.MouseEvent) => {\n e.preventDefault();\n const startX = e.clientX;\n const startWidth = drawerRef.current?.offsetWidth ?? 0;\n const isLeft = mergedOptions.position === 'left';\n\n const onMove = (ev: MouseEvent) => {\n const delta = ev.clientX - startX;\n const newWidth = startWidth + (isLeft ? delta : -delta);\n const clamped = Math.min(\n mergedOptions.maxWidth,\n Math.max(mergedOptions.minWidth, newWidth)\n );\n setResizedWidth(clamped);\n };\n\n const onUp = () => {\n document.removeEventListener('mousemove', onMove);\n document.removeEventListener('mouseup', onUp);\n };\n\n document.addEventListener('mousemove', onMove);\n document.addEventListener('mouseup', onUp);\n },\n [mergedOptions.position, mergedOptions.minWidth, mergedOptions.maxWidth]\n );\n\n // Build style object\n const baseWidth = resizedWidth\n ? `${resizedWidth}px`\n : typeof mergedOptions.width === 'number'\n ? `${mergedOptions.width}px`\n : mergedOptions.width;\n\n const drawerStyle = useMemo(\n () => ({\n width: baseWidth,\n zIndex: mergedOptions.zIndex,\n borderRadius: typeof mergedOptions.borderRadius === 'number'\n ? `${mergedOptions.borderRadius}px`\n : mergedOptions.borderRadius,\n ...mergedOptions.style,\n }),\n [baseWidth, mergedOptions.zIndex, mergedOptions.borderRadius, mergedOptions.style]\n );\n\n const overlayStyle = useMemo(\n () => ({\n zIndex: mergedOptions.zIndex - 1,\n }),\n [mergedOptions.zIndex]\n );\n\n const triggerStyle = useMemo(\n () => ({\n zIndex: mergedOptions.zIndex - 1,\n [mergedOptions.position]: 20,\n bottom: 20,\n }),\n [mergedOptions.zIndex, mergedOptions.position]\n );\n\n return (\n <DevicTranslationsProvider translations={mergedOptions.translations}>\n {/* Overlay (drawer mode only) */}\n {!isInline && (\n <div\n className=\"devic-drawer-overlay\"\n data-open={isOpen}\n style={overlayStyle}\n onClick={handleClose}\n />\n )}\n\n {/* Drawer */}\n <div\n ref={drawerRef}\n className={`devic-chat-drawer ${className || ''}`}\n data-position={mergedOptions.position}\n data-open={isOpen}\n data-mode={mode}\n style={drawerStyle}\n >\n {/* Resize handle */}\n {mergedOptions.resizable && (\n <div\n className=\"devic-resize-handle\"\n data-position={mergedOptions.position}\n onMouseDown={handleResizeStart}\n />\n )}\n\n {/* Header */}\n <div className=\"devic-drawer-header\">\n {avatarUrl && (\n <img\n className=\"devic-drawer-avatar\"\n src={avatarUrl}\n alt=\"\"\n aria-hidden=\"true\"\n />\n )}\n {/* Only a plain string can go through the dictionary; a host that\n passes a node has already decided what it renders. */}\n <h2 className=\"devic-drawer-title\">\n {typeof mergedOptions.title === 'string'\n ? t(mergedOptions.title)\n : mergedOptions.title}\n </h2>\n <ConversationSelector\n assistantId={assistantId}\n currentChatUid={chat.chatUid}\n onSelect={handleConversationSelect}\n onNewChat={handleNewChat}\n apiKey={apiKey}\n baseUrl={baseUrl}\n tenantId={tenantId}\n subtenantId={subtenantId}\n conversationPreview={mergedOptions.conversationPreview}\n />\n <div className=\"devic-drawer-header-actions\">\n {mergedOptions.showIntegrationsButton !== false && (\n <IntegrationsLauncher\n state={integrationsState}\n mcp={mcpState}\n onClick={() => setIntegrationsOpen(true)}\n label={t(mergedOptions.integrationsLabel)}\n maxLogos={mergedOptions.maxIntegrationLogos}\n dark={isDarkTheme(modalTheme)}\n placeholders={pendingIntegrations}\n loading={integrationsDeciding}\n />\n )}\n {mergedOptions.showCoreMemoryButton && (\n <button\n className=\"devic-new-chat-btn\"\n onClick={() => setCoreMemoryOpen(true)}\n type=\"button\"\n aria-label={coreMemoryTitle}\n title={coreMemoryTitle}\n >\n <BrainIcon />\n </button>\n )}\n <button\n className=\"devic-new-chat-btn\"\n onClick={handleNewChat}\n type=\"button\"\n aria-label={t('New chat')}\n title={t('New chat')}\n >\n <PlusIcon />\n </button>\n {!isInline && (\n <button\n className=\"devic-drawer-close\"\n onClick={handleClose}\n type=\"button\"\n aria-label={t('Close chat')}\n >\n <CloseIcon />\n </button>\n )}\n </div>\n </div>\n\n {/* Error display */}\n {chat.error && (\n <div className=\"devic-error\">\n {chat.error.message}\n </div>\n )}\n\n {/* Messages */}\n <ChatMessages\n messages={chat.messages}\n allMessages={chat.messages}\n isLoading={chat.isLoading}\n welcomeMessage={mergedOptions.welcomeMessage}\n suggestedMessages={mergedOptions.suggestedMessages}\n onSuggestedClick={handleSuggestedClick}\n showToolTimeline={mergedOptions.showToolTimeline}\n toolRenderers={mergedOptions.toolRenderers}\n toolIcons={mergedOptions.toolIcons}\n loadingIndicator={mergedOptions.loadingIndicator}\n showFeedback={mergedOptions.showFeedback}\n feedbackMap={feedbackMap}\n onFeedback={handleFeedback}\n handedOffSubThreadId={chat.handedOffSubThreadId || undefined}\n onHandoffCompleted={chat.onHandoffCompleted}\n handoffWidgetRenderer={mergedOptions.handoffWidgetRenderer}\n toolGroups={mergedOptions.toolGroups}\n userMessageRenderer={mergedOptions.userMessageRenderer}\n assistantMessageRenderer={mergedOptions.assistantMessageRenderer}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n pollingInterval={pollingInterval}\n pendingInlineWidgets={inlineWidgets}\n onSubmitWidget={chat.submitWidgetResponse}\n onCancelWidget={chat.cancelWidgetCall}\n recalledMemories={\n mergedOptions.showRecalledMemories\n ? chat.recalledMemories\n : undefined\n }\n recalledMemoriesRenderer={mergedOptions.recalledMemoriesRenderer}\n compactions={\n mergedOptions.showCompaction ? chat.compactions : undefined\n }\n compaction={\n mergedOptions.showCompaction ? chat.compaction : undefined\n }\n compactionRenderer={mergedOptions.compactionRenderer}\n guardrailRenderer={mergedOptions.guardrailRenderer}\n expandableCompaction={mergedOptions.expandableCompaction}\n />\n\n {/* Input */}\n {/* Idle, the voice widget is a card above the composer; during a call\n it takes the composer's place, banners included. */}\n {mergedOptions.liveVoice?.enabled && <React.Suspense fallback={null}>\n <LiveVoicePanel voice={chat.voice} client={infoClient} assistantId={assistantId} chatUid={chat.chatUid}\n canStart={isOpen && assistantInfo.assistant?.liveVoice?.enabled === true && !chat.isLoading && !chat.handedOff && !chat.limitExceeded && !inputWidget && inlineWidgets.length === 0}\n recordSessions={assistantInfo.assistant?.liveVoice?.recordSessions}>\n {chat.voice.active && !inputWidget ? <>{limitBannerNode}{usageBarNode}{queueNoticeNode}</> : null}\n </LiveVoicePanel>\n </React.Suspense>}\n {chat.voice.active && !inputWidget ? null : Boolean(mergedOptions.customPromptBox) && !(chat.voice.active && inputWidget) ? (\n <div className=\"devic-input-area\">\n {limitBannerNode}\n {usageBarNode}\n {integrationsHintNode}\n {queueNoticeNode}\n {mergedOptions.customPromptBox({\n voice: chat.voice,\n sendMessage: handleSend,\n transcribeAudio,\n stop: chat.stopChat,\n isLoading: chat.isLoading,\n queueEnabled: canQueue,\n queuedCount: chat.queuedCount,\n newConversation: chat.clearChat,\n references,\n removeReference,\n clearReferences,\n limitExceeded: chat.limitExceeded,\n })}\n </div>\n ) : (\n <ChatInput\n onSend={handleSend}\n disabled={\n // `handedOff` is one of the states the queue covers — the\n // conversation is waiting on a subagent, which in an embedded\n // widget can take minutes — so with queueing on it no longer\n // closes the box. A pending widget and a usage limit still do:\n // one is the assistant waiting on this user, the other a refusal.\n (chat.isLoading && !canQueue) ||\n (chat.handedOff && !canQueue) ||\n inlineWidgets.length > 0 ||\n !!chat.limitExceeded\n }\n placeholder={t(mergedOptions.inputPlaceholder)}\n enableFileUploads={mergedOptions.enableFileUploads}\n allowedFileTypes={mergedOptions.allowedFileTypes}\n maxFileSize={mergedOptions.maxFileSize}\n enableLongTextPaste={mergedOptions.enableLongTextPaste}\n longTextPasteThreshold={mergedOptions.longTextPasteThreshold}\n enableSpeechToText={mergedOptions.enableSpeechToText}\n speechLanguage={mergedOptions.speechLanguage}\n speechTenantId={tenantId}\n speechAutoStop={mergedOptions.speechAutoStop}\n speechAutoStopCountdownMs={mergedOptions.speechAutoStopCountdownMs}\n speechAutoStopSilenceMs={mergedOptions.speechAutoStopSilenceMs}\n speechAutoStopSilenceRatio={mergedOptions.speechAutoStopSilenceRatio}\n speechAutoStopSilenceLevel={mergedOptions.speechAutoStopSilenceLevel}\n speechAutoStopSpeechLevel={mergedOptions.speechAutoStopSpeechLevel}\n speechHandoff={mergedOptions.speechHandoff}\n speechHandoffSendDelayMs={mergedOptions.speechHandoffSendDelayMs}\n speechHandoffHoldMs={mergedOptions.speechHandoffHoldMs}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n sendButtonContent={mergedOptions.sendButtonContent}\n disabledMessage={\n chat.handedOff\n ? t('Waiting for subagent to complete')\n : inlineWidgets.length > 0\n ? t('Waiting for tool response')\n : undefined\n }\n isProcessing={chat.isLoading && !chat.handedOff}\n onStop={handleStopChat}\n allowQueueing={canQueue}\n queueNotice={queueNoticeNode}\n stopButtonContent={mergedOptions.stopButtonContent}\n pendingInputWidget={inputWidget}\n onSubmitWidget={chat.submitWidgetResponse}\n onCancelWidget={chat.cancelWidgetCall}\n references={references}\n onRemoveReference={removeReference}\n usageBar={usageBarNode}\n limitBanner={limitBannerNode}\n integrationsHint={integrationsHintNode}\n integrationsToggle={integrationsToggleNode}\n />\n )}\n </div>\n\n {/* Trigger button (drawer mode only, when closed) */}\n {!isInline && !isOpen && (\n <button\n className=\"devic-trigger\"\n onClick={handleOpen}\n style={triggerStyle}\n type=\"button\"\n aria-label={t('Open chat')}\n >\n <ChatIcon />\n </button>\n )}\n\n {/* Core memory modal (opened from the header brain button) */}\n {mergedOptions.showCoreMemoryButton && (\n <CoreMemoryModal\n isOpen={coreMemoryOpen}\n onClose={() => setCoreMemoryOpen(false)}\n assistantId={assistantId}\n tenantId={tenantId}\n subtenantId={subtenantId}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n labels={mergedOptions.coreMemoryLabels}\n theme={modalTheme}\n />\n )}\n\n {/* Connected apps modal (opened from the header app stack) */}\n {mergedOptions.showIntegrationsButton !== false && (\n <IntegrationsModal\n isOpen={integrationsOpen}\n onClose={() => setIntegrationsOpen(false)}\n assistantId={assistantId}\n tenantId={tenantId}\n subtenantId={subtenantId}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n title={t(mergedOptions.integrationsLabel)}\n theme={modalTheme}\n state={integrationsState}\n mcpState={mcpState}\n />\n )}\n </DevicTranslationsProvider>\n );\n}\n\n/**\n * Brain icon for the core memory button\n */\nfunction BrainIcon(): JSX.Element {\n return (\n <svg\n width=\"17\"\n height=\"17\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M9.5 2a2.5 2.5 0 0 0-2.45 2A3.5 3.5 0 0 0 4.6 8.6 3.5 3.5 0 0 0 3 11.5c0 1.1.5 2.08 1.29 2.73A3.5 3.5 0 0 0 7 20a3 3 0 0 0 5-2.24V4.5A2.5 2.5 0 0 0 9.5 2Z\" />\n <path d=\"M14.5 2a2.5 2.5 0 0 1 2.45 2 3.5 3.5 0 0 1 2.45 4.6A3.5 3.5 0 0 1 21 11.5a3.49 3.49 0 0 1-1.29 2.73A3.5 3.5 0 0 1 17 20a3 3 0 0 1-5-2.24V4.5A2.5 2.5 0 0 1 14.5 2Z\" />\n </svg>\n );\n}\n\nfunction CloseIcon(): JSX.Element {\n return (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n/**\n * Plus icon for new chat button\n */\nfunction PlusIcon(): JSX.Element {\n return (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\" />\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />\n </svg>\n );\n}\n\n/**\n * Chat icon for trigger button\n */\nfunction ChatIcon(): JSX.Element {\n return (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z\" />\n </svg>\n );\n}\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,OAAO,qBAAkB,CAAC,CAAC;AAGnE,MAAM,eAAe,GAAgC;AACnD,IAAA,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;AAC7B,IAAA,QAAQ,EAAE,OAAO;AACjB,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,iBAAiB,EAAE,KAAK;IACxB,gBAAgB,E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A,CAChG;AAEV;;;;"}
1
+ {"version":3,"file":"ChatDrawer.js","sources":["../../../../src/components/ChatDrawer/ChatDrawer.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback, useMemo, useRef, forwardRef, useImperativeHandle } from 'react';\nimport { useDevicChat } from '../../hooks/useDevicChat';\nimport { useOptionalDevicContext } from '../../provider';\nimport { DevicApiClient } from '../../api/client';\nimport { useAssistantInfo } from '../../api/assistantInfo';\nimport { ChatMessages } from './ChatMessages';\nimport { ChatInput } from './ChatInput';\nimport { ConversationSelector } from './ConversationSelector';\nimport { ChatDrawerErrorBoundary } from './ErrorBoundary';\nimport { UsageBar } from './UsageBar';\nimport { LimitBanner } from './LimitBanner';\nimport { QueueNotice } from './QueueNotice';\nimport { CoreMemoryModal, DEFAULT_CORE_MEMORY_LABELS } from '../CoreMemoryModal';\nimport {\n IntegrationsHint,\n IntegrationsLauncher,\n IntegrationsModal,\n IntegrationsToggle,\n useIntegrations,\n useTenantMcp,\n integrationChoiceKey,\n readIntegrationChoice,\n writeIntegrationChoice,\n pruneIntegrationChoice,\n} from '../IntegrationsModal';\nimport { isDarkTheme } from '../theme';\nimport { DevicTranslationsProvider, useTranslations } from '../../i18n';\nimport type { DevicTheme } from '../theme';\nimport type { ChatDrawerProps, ChatDrawerOptions, ChatDrawerHandle } from './ChatDrawer.types';\nimport type { QueueDisposition } from '../../api/types';\nimport './styles.css';\nconst LiveVoicePanel = React.lazy(() => import('./LiveVoicePanel'));\nimport { avatarUri } from '../../utils/avatar';\n\nconst DEFAULT_OPTIONS: Required<ChatDrawerOptions> = {\n liveVoice: { enabled: false },\n position: 'right',\n width: '100%',\n defaultOpen: false,\n color: '#1890ff',\n welcomeMessage: '',\n suggestedMessages: [],\n enableFileUploads: false,\n allowedFileTypes: { images: true, documents: true },\n maxFileSize: 10 * 1024 * 1024,\n enableLongTextPaste: false,\n longTextPasteThreshold: 2000,\n enableSpeechToText: false,\n speechLanguage: undefined as any,\n speechAutoStop: true,\n speechAutoStopCountdownMs: 1000,\n speechAutoStopSilenceMs: 1000,\n speechAutoStopSilenceRatio: 0.1,\n speechAutoStopSilenceLevel: 0.02,\n speechAutoStopSpeechLevel: 0.12,\n speechHandoff: false,\n speechHandoffSendDelayMs: 1000,\n speechHandoffHoldMs: 3000,\n inputPlaceholder: 'Type a message...',\n title: 'Chat',\n showAvatar: false,\n avatarUrl: undefined as any,\n showToolTimeline: true,\n zIndex: 1000,\n borderRadius: 0,\n resizable: false,\n minWidth: 300,\n maxWidth: 800,\n style: {},\n fontFamily: undefined as any,\n backgroundColor: undefined as any,\n textColor: undefined as any,\n secondaryBackgroundColor: undefined as any,\n borderColor: undefined as any,\n userBubbleColor: undefined as any,\n userBubbleTextColor: undefined as any,\n assistantBubbleColor: undefined as any,\n assistantBubbleTextColor: undefined as any,\n sendButtonColor: undefined as any,\n loadingIndicator: undefined as any,\n sendButtonContent: undefined as any,\n toolRenderers: undefined as any,\n toolIcons: undefined as any,\n showFeedback: true,\n handoffWidgetRenderer: undefined as any,\n toolGroups: undefined as any,\n stopButtonContent: undefined as any,\n debug: false,\n persistConversation: false,\n customPromptBox: undefined as any,\n userMessageRenderer: undefined as any,\n assistantMessageRenderer: undefined as any,\n conversationPreview: 'date',\n showUsageBar: false,\n usageBarMetric: undefined as any,\n usageBarDisplay: undefined as any,\n customUsageBar: undefined as any,\n hideLimitBanner: false,\n limitBannerRenderer: undefined as any,\n hideQueueNotice: false,\n queueNoticeRenderer: undefined as any,\n // Unset on purpose: the assistant's own setting decides.\n messageQueue: undefined as any,\n showRecalledMemories: true,\n recalledMemoriesRenderer: undefined as any,\n showCompaction: true,\n expandableCompaction: false,\n compactionRenderer: undefined as any,\n guardrailRenderer: undefined as any,\n showCoreMemoryButton: false,\n coreMemoryLabels: undefined as any,\n showIntegrationsButton: true,\n integrationsLabel: 'Connected apps',\n maxIntegrationLogos: 6,\n showIntegrationsHint: true,\n // Left unset so the strip can say \"Connect your apps\" or \"Explore connected\n // apps\" depending on what the end user has actually done.\n integrationsHintLabel: undefined as any,\n showIntegrationsToggle: true,\n integrationsToggleLabel: 'Apps in this chat',\n translations: undefined as any,\n};\n\n/**\n * Chat drawer component for Devic assistants\n *\n * @example\n * ```tsx\n * <ChatDrawer\n * ref={drawerRef}\n * assistantId=\"my-assistant\"\n * options={{\n * position: 'right',\n * width: 400,\n * welcomeMessage: 'Hello! How can I help you?',\n * suggestedMessages: ['Help me with...', 'Tell me about...'],\n * }}\n * modelInterfaceTools={[\n * {\n * toolName: 'get_user_location',\n * schema: { ... },\n * callback: async () => ({ lat: 40.7, lng: -74.0 })\n * }\n * ]}\n * onMessageReceived={(msg) => console.log('Received:', msg)}\n * />\n * ```\n */\nexport const ChatDrawer = forwardRef<ChatDrawerHandle, ChatDrawerProps>(\n function ChatDrawer(props, ref) {\n return (\n <ChatDrawerErrorBoundary>\n <ChatDrawerInner {...props} forwardedRef={ref} />\n </ChatDrawerErrorBoundary>\n );\n }\n);\n\ninterface ChatDrawerInnerProps extends ChatDrawerProps {\n forwardedRef?: React.Ref<ChatDrawerHandle>;\n}\n\nfunction ChatDrawerInner({\n assistantId,\n chatUid: initialChatUid,\n options = {},\n enabledTools,\n modelInterfaceTools,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n apiKey,\n baseUrl,\n pollingInterval,\n streaming,\n onMessageSent,\n onMessageReceived,\n onToolCall,\n onError,\n onChatCreated,\n onFileUpload,\n onOpen,\n onClose,\n isOpen: controlledIsOpen,\n className,\n mode = 'drawer',\n onConversationChange,\n forwardedRef,\n}: ChatDrawerInnerProps): JSX.Element {\n // Merge options with defaults\n const mergedOptions = useMemo(\n () => ({ ...DEFAULT_OPTIONS, ...options }),\n [options]\n );\n\n // Texts the drawer renders itself, translated through the dictionary of the\n // provider plus this drawer's own. Applied to the option defaults too, so a\n // host that leaves `title` or `inputPlaceholder` alone still gets them in\n // its language; a host that sets its own text keeps it, unless it also put\n // that text in the dictionary.\n const t = useTranslations(mergedOptions.translations);\n\n // localStorage key for persisting selected conversation\n const storageKey = mergedOptions.persistConversation\n ? `devic-ui-chatUid-${assistantId}`\n : null;\n\n // Resolve initial chatUid: prop takes priority, then localStorage\n const resolvedInitialChatUid = useMemo(() => {\n if (initialChatUid) return initialChatUid;\n if (storageKey) {\n try { return localStorage.getItem(storageKey) || undefined; } catch { return undefined; }\n }\n return undefined;\n }, [initialChatUid, storageKey]);\n\n // Drawer open state (can be controlled or uncontrolled; inline mode is always open)\n const [internalIsOpen, setInternalIsOpen] = useState(mergedOptions.defaultOpen);\n const isInline = mode === 'inline';\n const isOpen = isInline ? true : (controlledIsOpen ?? internalIsOpen);\n\n // Wrap onChatCreated to persist chatUid in localStorage\n const handleChatCreated = useCallback(\n (chatUid: string) => {\n if (storageKey) {\n try { localStorage.setItem(storageKey, chatUid); } catch {}\n }\n onChatCreated?.(chatUid);\n },\n [storageKey, onChatCreated]\n );\n\n /**\n * What the end user switched off: connected apps by slug, and their own MCP\n * servers by the `toggleId` the API hands out.\n *\n * Remembered in this browser (see `integrationChoice`) rather than only for\n * the life of the drawer — a reload used to forget it, which for someone who\n * keeps an app switched off on purpose reads as the switch not working. The\n * server still keeps nothing beyond the turn it was sent for; what is stored\n * is a preference of whoever is at this keyboard.\n *\n * The badge on the plug is what keeps that honest: a remembered choice is\n * visible at a glance rather than being an unexplained silence from an app.\n */\n const [disabledIntegrations, setDisabledIntegrations] = useState<string[]>([]);\n\n // Use chat hook\n const chat = useDevicChat({\n assistantId,\n chatUid: resolvedInitialChatUid,\n apiKey,\n baseUrl,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n enabledTools,\n disabledIntegrations,\n modelInterfaceTools,\n pollingInterval,\n streaming,\n onMessageSent,\n onMessageReceived,\n onToolCall,\n onError,\n onChatCreated: handleChatCreated,\n onFileUpload,\n messageQueue: mergedOptions.messageQueue,\n liveVoice: mergedOptions.liveVoice,\n debug: mergedOptions.debug,\n });\n\n // Fetch assistant avatar when showAvatar is enabled\n useEffect(() => { if (!isOpen) void chat.voice.stop(); }, [isOpen, chat.voice.stop]);\n const context = useOptionalDevicContext();\n const resolvedApiKey = apiKey || context?.apiKey;\n // The session source, when the page authenticates with one. Every client\n // built below gets it, or a page without an API key would have nothing to\n // authenticate with.\n const resolvedTenantSession = context?.getTenantSession;\n const onSessionExpired = context?.onSessionExpired;\n const resolvedBaseUrl = baseUrl || context?.baseUrl || 'https://api.devic.ai';\n const [coreMemoryOpen, setCoreMemoryOpen] = useState(false);\n const [integrationsOpen, setIntegrationsOpen] = useState(false);\n\n const infoClient = useMemo(\n () =>\n resolvedApiKey || resolvedTenantSession\n ? new DevicApiClient({\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n getTenantSession: resolvedTenantSession,\n onSessionExpired,\n })\n : null,\n [resolvedApiKey, resolvedTenantSession, resolvedBaseUrl]\n );\n\n // Asked for only when something on screen depends on it, and then at most\n // once per assistant however many times this drawer is mounted — a host that\n // remounts it to start a fresh conversation used to pay for the answer again\n // every time.\n const assistantInfo = useAssistantInfo({\n assistantId,\n client: infoClient,\n baseUrl: resolvedBaseUrl,\n credential: resolvedApiKey || 'session',\n enabled:\n (!!mergedOptions.liveVoice?.enabled && isOpen) ||\n (!!mergedOptions.showAvatar && !mergedOptions.avatarUrl) ||\n (mergedOptions.showIntegrationsButton !== false && isOpen),\n });\n // The host's own image wins: an assistant carries one image for everybody, so\n // this is the only place a per-account face can come from. Failing that, an\n // assistant with no uploaded image still gets a face, generated from its\n // identifier — the same one the console shows for it. Drawn from `assistantId`\n // rather than from the fetched assistant so the header is not empty while the\n // lookup is in flight; the two agree, since that is what was asked for.\n const avatarUrl = mergedOptions.showAvatar\n ? (mergedOptions.avatarUrl ??\n assistantInfo.assistant?.imgUrl ??\n avatarUri(\n assistantInfo.assistant?.identifier || assistantId,\n assistantInfo.assistant?.avatarStyle\n ))\n : null;\n\n /**\n * Whether to ask which apps this assistant offers.\n *\n * The listing is worth a request only when there is something to list, and\n * most assistants offer nothing — for those, the call existed purely to be\n * refused, once per page load. The assistant now says so itself, so a plain\n * `false` settles it without asking.\n *\n * Anything else asks, exactly as before: a field that is absent means the API\n * is older than it, not that the answer is no, and a failed lookup means we\n * could not find out. Hiding the button on either would lose the feature for\n * a deployment that has it, which is far worse than one spare request.\n *\n * Where there are apps to show, this puts the two requests in sequence rather\n * than at once, so the listing lands later than it used to. The header holds\n * its place in the meantime — see `pendingIntegrations`.\n */\n const mayOfferIntegrations =\n assistantInfo.settled &&\n assistantInfo.assistant?.tenantIntegrations?.enabled !== false;\n\n // The apps this assistant offers its tenants. Loaded once, here, because the\n // header control cannot decide whether to exist without it — and lent to the\n // modal so opening it does not ask for the same listing again. Nothing is\n // fetched until the drawer is opened for the first time.\n const integrationsState = useIntegrations({\n assistantId,\n tenantId,\n subtenantId,\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n enabled:\n mergedOptions.showIntegrationsButton !== false &&\n isOpen &&\n mayOfferIntegrations,\n });\n\n /**\n * Whether this assistant offers MCP servers of the tenant's own.\n *\n * Read exactly like `mayOfferIntegrations`: absence means \"cannot tell\", so\n * the listing is asked for anyway. A deployment older than the field keeps\n * the behaviour it had — one refusal per drawer open — rather than losing the\n * feature.\n */\n const mayOfferMcp =\n assistantInfo.settled &&\n assistantInfo.assistant?.tenantMcpServers?.enabled !== false;\n\n /**\n * The tenant's own MCP servers, loaded here rather than inside the modal.\n *\n * The composer's switch needs them too, and it is not inside the modal — so\n * the listing has to live above both. The modal takes it as a prop and stops\n * asking for its own.\n */\n const mcpState = useTenantMcp({\n assistantId,\n tenantId,\n subtenantId,\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n enabled:\n mergedOptions.showIntegrationsButton !== false && isOpen && mayOfferMcp,\n });\n\n /**\n * Whether the answer to \"is there anything to show here\" is still on its way.\n *\n * Two requests decide it — what the assistant offers, and then what this\n * tenant has connected — and until both have answered the control cannot\n * know whether to exist. Without this the header simply had a gap and then a\n * button, which reads as the page changing its mind.\n */\n const integrationsDeciding =\n mergedOptions.showIntegrationsButton !== false &&\n isOpen &&\n (!assistantInfo.settled ||\n (mayOfferIntegrations && !integrationsState.settled) ||\n (mayOfferMcp && !mcpState.settled));\n\n /**\n * Placeholder chips to hold while the listing is in flight.\n *\n * Only when the assistant has said outright that it offers apps, and how\n * many: on a maybe there would be nothing to hold the place of half the time,\n * and a control that appears and then vanishes is worse than one that arrives\n * late. So this stays at zero for an API that does not say, which is also the\n * behaviour every version until now had.\n */\n const pendingIntegrations =\n assistantInfo.assistant?.tenantIntegrations?.enabled === true &&\n !integrationsState.settled\n ? (assistantInfo.assistant.tenantIntegrations.count ?? 0)\n : 0;\n\n // Tenant/subtenant resolution mirrors useDevicChat (prop overrides provider).\n const resolvedTenantId = tenantId || context?.tenantId;\n const resolvedSubtenantId = subtenantId || context?.subtenantId;\n\n // ── Remembering which apps and servers are switched off ────────────────\n\n const choiceKey = integrationChoiceKey(\n assistantId,\n resolvedTenantId,\n resolvedSubtenantId\n );\n\n // Loaded per key, so switching tenant loads that tenant's choice rather than\n // carrying the previous one over.\n const loadedChoiceRef = useRef<string | null>(null);\n useEffect(() => {\n if (loadedChoiceRef.current === choiceKey) return;\n loadedChoiceRef.current = choiceKey;\n setDisabledIntegrations(readIntegrationChoice(choiceKey));\n }, [choiceKey]);\n\n useEffect(() => {\n // Only once this key's stored value has been read, or the empty initial\n // state would erase it before it was ever loaded.\n if (loadedChoiceRef.current !== choiceKey) return;\n writeIntegrationChoice(choiceKey, disabledIntegrations);\n }, [choiceKey, disabledIntegrations]);\n\n /**\n * Forgets what is no longer on offer, once the listings can say so.\n *\n * Every clause of this is load-bearing. `mayOffer*` is false BEFORE the\n * assistant has answered as well as when the answer is no, so without the\n * `assistantInfo.settled` guard the prune runs on the first render against\n * two empty listings and erases the very thing that was just loaded — which\n * is exactly the reload-forgets-it bug this was meant to fix. A definite\n * \"this assistant offers none\" is an answer; an unsettled listing is not.\n *\n * With the drawer never opened, neither listing is ever fetched, so nothing\n * is pruned and the stored choice survives untouched.\n */\n const appsKnown =\n assistantInfo.settled && (!mayOfferIntegrations || integrationsState.settled);\n const mcpKnown = assistantInfo.settled && (!mayOfferMcp || mcpState.settled);\n useEffect(() => {\n if (!appsKnown || !mcpKnown) return;\n const live = [\n ...integrationsState.integrations\n .filter((i) => i.connected)\n .map((i) => i.app),\n ...mcpState.servers\n .filter((s) => s.connection?.status === 'active' && s.connection.toggleId)\n .map((s) => s.connection!.toggleId as string),\n ];\n setDisabledIntegrations((prev) => pruneIntegrationChoice(prev, live));\n }, [appsKnown, mcpKnown, integrationsState.integrations, mcpState.servers]);\n\n // Usage bar (above the input) — only when enabled and a tenant is known.\n // Refetches after each turn via the message count as refresh key.\n const usageBarNode =\n (mergedOptions.showUsageBar ||\n typeof mergedOptions.customUsageBar === 'function') &&\n resolvedTenantId ? (\n <UsageBar\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n tenantId={resolvedTenantId}\n subtenantId={resolvedSubtenantId}\n mode={mergedOptions.showUsageBar === 'onDemand' ? 'onDemand' : 'always'}\n metric={mergedOptions.usageBarMetric}\n display={mergedOptions.usageBarDisplay}\n customUsageBar={mergedOptions.customUsageBar}\n color={mergedOptions.color}\n refreshKey={chat.messages.length}\n debug={mergedOptions.debug}\n />\n ) : null;\n\n // Default usage-limit banner (above the input) — opt-out via hideLimitBanner,\n // override via limitBannerRenderer.\n const limitBannerNode =\n chat.limitExceeded && !mergedOptions.hideLimitBanner\n ? mergedOptions.limitBannerRenderer\n ? mergedOptions.limitBannerRenderer(chat.limitExceeded)\n : <LimitBanner limit={chat.limitExceeded} />\n : null;\n\n // Speech-to-text transcription, exposed to custom prompt boxes so a developer\n // can transcribe audio (binary or URL) and attach the resulting transcriptId.\n const transcribeAudio = useCallback(\n (\n audio: Blob | string,\n transcribeOptions?: {\n language?: string;\n messageUid?: string;\n chatUid?: string;\n tenantId?: string;\n },\n ) => {\n if (!resolvedApiKey && !resolvedTenantSession) {\n return Promise.reject(\n new Error(t('No credentials configured. Cannot transcribe audio.')),\n );\n }\n const client = new DevicApiClient({ apiKey: resolvedApiKey, baseUrl: resolvedBaseUrl, getTenantSession: resolvedTenantSession, onSessionExpired });\n return client.transcribeAudio(audio, {\n language: transcribeOptions?.language ?? mergedOptions.speechLanguage,\n messageUid: transcribeOptions?.messageUid,\n chatUid: transcribeOptions?.chatUid,\n tenantId: transcribeOptions?.tenantId ?? tenantId,\n });\n },\n [resolvedApiKey, resolvedTenantSession, resolvedBaseUrl, mergedOptions.speechLanguage, tenantId],\n );\n\n // Handle open/close\n const handleOpen = useCallback(() => {\n setInternalIsOpen(true);\n onOpen?.();\n }, [onOpen]);\n\n const handleClose = useCallback(() => {\n setInternalIsOpen(false);\n onClose?.();\n }, [onClose]);\n\n const handleToggle = useCallback(() => {\n setInternalIsOpen((prev) => !prev);\n }, []);\n\n // Expose handle for programmatic control\n useImperativeHandle(forwardedRef, () => ({\n open: handleOpen,\n close: handleClose,\n toggle: handleToggle,\n setChatUid: (chatUid: string) => {\n chat.loadChat(chatUid);\n },\n sendMessage: (message: string) => {\n chat.sendMessage(message);\n },\n }), [handleOpen, handleClose, handleToggle, chat]);\n\n // Register this drawer in the DevicProvider so AIElementWrapper can open it\n useEffect(() => {\n if (!context?.registerDrawer) return;\n const unregister = context.registerDrawer({\n open: handleOpen,\n close: handleClose,\n toggle: handleToggle,\n sendMessage: (message: string) => chat.sendMessage(message),\n });\n return unregister;\n }, [context, handleOpen, handleClose, handleToggle, chat]);\n\n // Partition pending widget calls by render mode\n const { inlineWidgets, inputWidget } = useMemo(() => {\n const inline: typeof chat.pendingWidgetCalls = [];\n let input: typeof chat.pendingWidgetCalls[number] | null = null;\n for (const wc of chat.pendingWidgetCalls) {\n if (wc.widget.render === 'input' && !input) {\n input = wc;\n } else {\n inline.push(wc);\n }\n }\n return { inlineWidgets: inline, inputWidget: input };\n }, [chat.pendingWidgetCalls]);\n\n // Active references from DevicProvider (created by AIElementWrapper)\n const references = context?.references ?? [];\n const removeReference = useCallback(\n (id: string) => {\n context?.removeReference(id);\n },\n [context]\n );\n const clearReferences = useCallback(() => {\n context?.clearReferences();\n }, [context]);\n\n // Handle send message — prefix references and clear them after sending\n /**\n * What the last accepted message was told about when it gets picked up. Only\n * the wording of the notice depends on it.\n */\n const [queueDisposition, setQueueDisposition] = useState<\n QueueDisposition | undefined\n >();\n /**\n * What became of a message that did not simply join the queue: it was turned\n * down, or a stop threw it away. Said out loud, because in both cases the\n * user's text has just moved back into the box on its own.\n */\n const [queueAlert, setQueueAlert] = useState<string | null>(null);\n\n const handleSend = useCallback(\n async (\n message: string,\n files?: File[],\n meta?: { transcriptId?: string; tags?: string[] }\n ) => {\n let finalMessage = message;\n if (references.length > 0) {\n const labels = references.map((r) => `\"${r.label}\"`).join(', ');\n finalMessage = `Elemento referenciado: ${labels}\\n\\n${message}`;\n }\n setQueueAlert(null);\n const result = await chat.sendMessage(finalMessage, {\n files,\n transcriptId: meta?.transcriptId,\n tags: meta?.tags,\n });\n\n if ('rejected' in result) {\n // The references belong to the message that was not sent, so they stay.\n if (result.reason !== 'error') {\n // An ordinary error already reaches the host through `onError`; these\n // two do not, and the only sign of them would otherwise be the text\n // reappearing in the box with no explanation.\n setQueueAlert(\n result.reason === 'queue_full'\n ? `${result.message} ${t('Your message is back in the box.')}`\n : t(\n 'The assistant is not taking messages while it works. Your message is back in the box.'\n )\n );\n }\n return result;\n }\n\n setQueueDisposition('queued' in result && result.queued ? result.willProcess : undefined);\n if (references.length > 0) clearReferences();\n return result;\n },\n [chat, references, clearReferences]\n );\n\n /**\n * Whether a message may be written while the assistant is working.\n *\n * Being busy is not the only reason the box closes, and the other two are not\n * about waiting: an inline widget is the assistant waiting on *this* user, and\n * a usage limit is a refusal the queue cannot soften.\n */\n const canQueue =\n chat.queueEnabled && inlineWidgets.length === 0 && !chat.limitExceeded;\n\n const handleStopChat = useCallback(async () => {\n const result = await chat.stopChat();\n setQueueDisposition(undefined);\n setQueueAlert(\n result.discarded\n ? result.discarded === 1\n ? t('A queued message was not sent — the text is back in the box.')\n : t(\n '{count} queued messages were not sent — the text is back in the box.',\n { count: result.discarded }\n )\n : null\n );\n return result;\n }, [chat]);\n\n /**\n * Shown while there is something to explain: the user is writing into a run\n * that has not finished, or messages are already waiting. With nothing typed\n * and nothing queued there is nothing to say.\n */\n const queueNoticeNode =\n !mergedOptions.hideQueueNotice &&\n // `queuedCount` on its own matters: an assistant with an input delay queues\n // what is written into an *idle* conversation whether or not it takes\n // messages while busy, so there can be something waiting with the queue\n // switched off.\n (queueAlert || chat.queuedCount > 0 || (canQueue && chat.isLoading))\n ? mergedOptions.queueNoticeRenderer\n ? mergedOptions.queueNoticeRenderer({\n queuedCount: chat.queuedCount,\n willProcess: queueDisposition,\n alert: queueAlert ?? undefined,\n })\n : (\n <QueueNotice\n queuedCount={chat.queuedCount}\n willProcess={queueDisposition}\n alert={queueAlert ?? undefined}\n />\n )\n : null;\n\n // Handle conversation selection\n const handleConversationSelect = useCallback(\n (chatUid: string) => {\n chat.loadChat(chatUid);\n onConversationChange?.(chatUid);\n if (storageKey) {\n try { localStorage.setItem(storageKey, chatUid); } catch {}\n }\n },\n [chat, onConversationChange, storageKey]\n );\n\n const handleNewChat = useCallback(() => {\n chat.clearChat();\n if (storageKey) {\n try { localStorage.removeItem(storageKey); } catch {}\n }\n }, [chat, storageKey]);\n\n // Handle suggested message click\n const handleSuggestedClick = useCallback(\n (message: string) => {\n chat.sendMessage(message);\n },\n [chat]\n );\n\n // Feedback state\n const [feedbackMap, setFeedbackMap] = useState<Map<string, 'positive' | 'negative'>>(new Map());\n const feedbackClientRef = useRef<DevicApiClient | null>(null);\n\n // Initialize feedback client\n useEffect(() => {\n if ((resolvedApiKey || resolvedTenantSession) && !feedbackClientRef.current) {\n feedbackClientRef.current = new DevicApiClient({\n apiKey: resolvedApiKey,\n baseUrl: resolvedBaseUrl,\n getTenantSession: resolvedTenantSession,\n onSessionExpired,\n });\n }\n }, [resolvedApiKey, resolvedTenantSession, resolvedBaseUrl]);\n\n // Load existing feedback when chat changes\n useEffect(() => {\n if (!chat.chatUid || !feedbackClientRef.current || !mergedOptions.showFeedback) return;\n\n feedbackClientRef.current.getChatFeedback(assistantId, chat.chatUid)\n .then((entries) => {\n const newMap = new Map<string, 'positive' | 'negative'>();\n for (const entry of entries) {\n if (entry.feedback !== undefined) {\n newMap.set(entry.requestId, entry.feedback ? 'positive' : 'negative');\n }\n }\n setFeedbackMap(newMap);\n })\n .catch(() => {\n // Silently ignore feedback loading errors\n });\n }, [chat.chatUid, assistantId, mergedOptions.showFeedback]);\n\n // Handle feedback submission\n const handleFeedback = useCallback(\n async (messageId: string, positive: boolean, comment?: string) => {\n if (!chat.chatUid || !feedbackClientRef.current) return;\n\n try {\n await feedbackClientRef.current.submitChatFeedback(assistantId, chat.chatUid, {\n messageId,\n feedback: positive,\n feedbackComment: comment,\n });\n\n setFeedbackMap((prev) => {\n const newMap = new Map(prev);\n newMap.set(messageId, positive ? 'positive' : 'negative');\n return newMap;\n });\n } catch (err) {\n console.error('Failed to submit feedback:', err);\n throw err;\n }\n },\n [chat.chatUid, assistantId]\n );\n\n // Apply CSS variables for theming on the drawer element itself\n // (must target the component root so they override the defaults defined on .devic-chat-drawer)\n const drawerRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n const el = drawerRef.current;\n if (!el) return;\n const vars: [string, string | undefined][] = [\n ['--devic-primary', mergedOptions.color !== DEFAULT_OPTIONS.color ? mergedOptions.color : undefined],\n ['--devic-font-family', mergedOptions.fontFamily],\n ['--devic-bg', mergedOptions.backgroundColor],\n ['--devic-text', mergedOptions.textColor],\n ['--devic-bg-secondary', mergedOptions.secondaryBackgroundColor],\n ['--devic-border', mergedOptions.borderColor],\n ['--devic-user-bubble', mergedOptions.userBubbleColor],\n ['--devic-user-bubble-text', mergedOptions.userBubbleTextColor],\n ['--devic-assistant-bubble', mergedOptions.assistantBubbleColor],\n ['--devic-assistant-bubble-text', mergedOptions.assistantBubbleTextColor],\n ['--devic-send-btn', mergedOptions.sendButtonColor],\n ];\n for (const [name, value] of vars) {\n if (value) {\n el.style.setProperty(name, value);\n } else {\n el.style.removeProperty(name);\n }\n }\n }, [mergedOptions.color, mergedOptions.fontFamily, mergedOptions.backgroundColor, mergedOptions.textColor, mergedOptions.secondaryBackgroundColor, mergedOptions.borderColor, mergedOptions.userBubbleColor, mergedOptions.userBubbleTextColor, mergedOptions.assistantBubbleColor, mergedOptions.assistantBubbleTextColor, mergedOptions.sendButtonColor]);\n\n // The same values, handed to the dialogs this drawer opens. They render\n // through a portal into document.body, so the variables set above — which\n // live on the drawer element — never reach them.\n // The brain button says what the modal it opens is called.\n const coreMemoryTitle =\n mergedOptions.coreMemoryLabels?.title ??\n t(DEFAULT_CORE_MEMORY_LABELS.title);\n\n const modalTheme: DevicTheme = useMemo(\n () => ({\n color:\n mergedOptions.color !== DEFAULT_OPTIONS.color\n ? mergedOptions.color\n : undefined,\n fontFamily: mergedOptions.fontFamily,\n backgroundColor: mergedOptions.backgroundColor,\n textColor: mergedOptions.textColor,\n secondaryBackgroundColor: mergedOptions.secondaryBackgroundColor,\n borderColor: mergedOptions.borderColor,\n }),\n [\n mergedOptions.color,\n mergedOptions.fontFamily,\n mergedOptions.backgroundColor,\n mergedOptions.textColor,\n mergedOptions.secondaryBackgroundColor,\n mergedOptions.borderColor,\n ]\n );\n\n // The strip above the composer. Dismissed per end user, because the whole\n // point of remembering a dismissal is that the same person is not told twice.\n const integrationsHintNode =\n mergedOptions.showIntegrationsButton !== false &&\n mergedOptions.showIntegrationsHint !== false ? (\n <IntegrationsHint\n state={integrationsState}\n onOpen={() => setIntegrationsOpen(true)}\n label={mergedOptions.integrationsHintLabel}\n maxLogos={mergedOptions.maxIntegrationLogos}\n storageKey={`${assistantId}:${resolvedTenantId ?? ''}:${resolvedSubtenantId ?? ''}`}\n dark={isDarkTheme(modalTheme)}\n />\n ) : null;\n\n // The per-message switch in the composer row. Shown only where there is\n // something to switch — the control returns null with nothing connected —\n // and hidden outright by `showIntegrationsToggle: false`.\n const integrationsToggleNode =\n mergedOptions.showIntegrationsButton !== false &&\n mergedOptions.showIntegrationsToggle !== false ? (\n <IntegrationsToggle\n state={integrationsState}\n mcp={mcpState}\n disabled={disabledIntegrations}\n onChange={setDisabledIntegrations}\n onManage={() => setIntegrationsOpen(true)}\n label={t(mergedOptions.integrationsToggleLabel)}\n dark={isDarkTheme(modalTheme)}\n busy={chat.isLoading}\n loading={integrationsDeciding}\n />\n ) : null;\n\n // Resizable drawer\n const [resizedWidth, setResizedWidth] = useState<number | null>(null);\n\n const handleResizeStart = useCallback(\n (e: React.MouseEvent) => {\n e.preventDefault();\n const startX = e.clientX;\n const startWidth = drawerRef.current?.offsetWidth ?? 0;\n const isLeft = mergedOptions.position === 'left';\n\n const onMove = (ev: MouseEvent) => {\n const delta = ev.clientX - startX;\n const newWidth = startWidth + (isLeft ? delta : -delta);\n const clamped = Math.min(\n mergedOptions.maxWidth,\n Math.max(mergedOptions.minWidth, newWidth)\n );\n setResizedWidth(clamped);\n };\n\n const onUp = () => {\n document.removeEventListener('mousemove', onMove);\n document.removeEventListener('mouseup', onUp);\n };\n\n document.addEventListener('mousemove', onMove);\n document.addEventListener('mouseup', onUp);\n },\n [mergedOptions.position, mergedOptions.minWidth, mergedOptions.maxWidth]\n );\n\n // Build style object\n const baseWidth = resizedWidth\n ? `${resizedWidth}px`\n : typeof mergedOptions.width === 'number'\n ? `${mergedOptions.width}px`\n : mergedOptions.width;\n\n const drawerStyle = useMemo(\n () => ({\n width: baseWidth,\n zIndex: mergedOptions.zIndex,\n borderRadius: typeof mergedOptions.borderRadius === 'number'\n ? `${mergedOptions.borderRadius}px`\n : mergedOptions.borderRadius,\n ...mergedOptions.style,\n }),\n [baseWidth, mergedOptions.zIndex, mergedOptions.borderRadius, mergedOptions.style]\n );\n\n const overlayStyle = useMemo(\n () => ({\n zIndex: mergedOptions.zIndex - 1,\n }),\n [mergedOptions.zIndex]\n );\n\n const triggerStyle = useMemo(\n () => ({\n zIndex: mergedOptions.zIndex - 1,\n [mergedOptions.position]: 20,\n bottom: 20,\n }),\n [mergedOptions.zIndex, mergedOptions.position]\n );\n\n return (\n <DevicTranslationsProvider translations={mergedOptions.translations}>\n {/* Overlay (drawer mode only) */}\n {!isInline && (\n <div\n className=\"devic-drawer-overlay\"\n data-open={isOpen}\n style={overlayStyle}\n onClick={handleClose}\n />\n )}\n\n {/* Drawer */}\n <div\n ref={drawerRef}\n className={`devic-chat-drawer ${className || ''}`}\n data-position={mergedOptions.position}\n data-open={isOpen}\n data-mode={mode}\n style={drawerStyle}\n >\n {/* Resize handle */}\n {mergedOptions.resizable && (\n <div\n className=\"devic-resize-handle\"\n data-position={mergedOptions.position}\n onMouseDown={handleResizeStart}\n />\n )}\n\n {/* Header */}\n <div className=\"devic-drawer-header\">\n {avatarUrl && (\n <img\n className=\"devic-drawer-avatar\"\n src={avatarUrl}\n alt=\"\"\n aria-hidden=\"true\"\n />\n )}\n {/* Only a plain string can go through the dictionary; a host that\n passes a node has already decided what it renders. */}\n <h2 className=\"devic-drawer-title\">\n {typeof mergedOptions.title === 'string'\n ? t(mergedOptions.title)\n : mergedOptions.title}\n </h2>\n <ConversationSelector\n assistantId={assistantId}\n currentChatUid={chat.chatUid}\n onSelect={handleConversationSelect}\n onNewChat={handleNewChat}\n apiKey={apiKey}\n baseUrl={baseUrl}\n tenantId={tenantId}\n subtenantId={subtenantId}\n conversationPreview={mergedOptions.conversationPreview}\n />\n <div className=\"devic-drawer-header-actions\">\n {mergedOptions.showIntegrationsButton !== false && (\n <IntegrationsLauncher\n state={integrationsState}\n mcp={mcpState}\n onClick={() => setIntegrationsOpen(true)}\n label={t(mergedOptions.integrationsLabel)}\n maxLogos={mergedOptions.maxIntegrationLogos}\n dark={isDarkTheme(modalTheme)}\n placeholders={pendingIntegrations}\n loading={integrationsDeciding}\n />\n )}\n {mergedOptions.showCoreMemoryButton && (\n <button\n className=\"devic-new-chat-btn\"\n onClick={() => setCoreMemoryOpen(true)}\n type=\"button\"\n aria-label={coreMemoryTitle}\n title={coreMemoryTitle}\n >\n <BrainIcon />\n </button>\n )}\n <button\n className=\"devic-new-chat-btn\"\n onClick={handleNewChat}\n type=\"button\"\n aria-label={t('New chat')}\n title={t('New chat')}\n >\n <PlusIcon />\n </button>\n {!isInline && (\n <button\n className=\"devic-drawer-close\"\n onClick={handleClose}\n type=\"button\"\n aria-label={t('Close chat')}\n >\n <CloseIcon />\n </button>\n )}\n </div>\n </div>\n\n {/* Error display */}\n {chat.error && (\n <div className=\"devic-error\">\n {chat.error.message}\n </div>\n )}\n\n {/* Messages */}\n <ChatMessages\n messages={chat.messages}\n allMessages={chat.messages}\n isLoading={chat.isLoading}\n welcomeMessage={mergedOptions.welcomeMessage}\n suggestedMessages={mergedOptions.suggestedMessages}\n onSuggestedClick={handleSuggestedClick}\n showToolTimeline={mergedOptions.showToolTimeline}\n toolRenderers={mergedOptions.toolRenderers}\n toolIcons={mergedOptions.toolIcons}\n loadingIndicator={mergedOptions.loadingIndicator}\n showFeedback={mergedOptions.showFeedback}\n feedbackMap={feedbackMap}\n onFeedback={handleFeedback}\n handedOffSubThreadId={chat.handedOffSubThreadId || undefined}\n onHandoffCompleted={chat.onHandoffCompleted}\n handoffWidgetRenderer={mergedOptions.handoffWidgetRenderer}\n toolGroups={mergedOptions.toolGroups}\n userMessageRenderer={mergedOptions.userMessageRenderer}\n assistantMessageRenderer={mergedOptions.assistantMessageRenderer}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n pollingInterval={pollingInterval}\n pendingInlineWidgets={inlineWidgets}\n onSubmitWidget={chat.submitWidgetResponse}\n onCancelWidget={chat.cancelWidgetCall}\n recalledMemories={\n mergedOptions.showRecalledMemories\n ? chat.recalledMemories\n : undefined\n }\n recalledMemoriesRenderer={mergedOptions.recalledMemoriesRenderer}\n compactions={\n mergedOptions.showCompaction ? chat.compactions : undefined\n }\n compaction={\n mergedOptions.showCompaction ? chat.compaction : undefined\n }\n compactionRenderer={mergedOptions.compactionRenderer}\n guardrailRenderer={mergedOptions.guardrailRenderer}\n expandableCompaction={mergedOptions.expandableCompaction}\n />\n\n {/* Input */}\n {/* Idle, the voice widget is a card above the composer; during a call\n it takes the composer's place, banners included. */}\n {/* A host opts in, but the card only shows for an assistant that can\n take a call: with the assistant known and voice off, an end user\n would just see a Start button that never enables. */}\n {mergedOptions.liveVoice?.enabled && (chat.voice.active || !assistantInfo.assistant || assistantInfo.assistant.liveVoice?.enabled === true) && <React.Suspense fallback={null}>\n <LiveVoicePanel voice={chat.voice} client={infoClient} assistantId={assistantId} chatUid={chat.chatUid}\n canStart={isOpen && assistantInfo.assistant?.liveVoice?.enabled === true && !chat.isLoading && !chat.handedOff && !chat.limitExceeded && !inputWidget && inlineWidgets.length === 0}\n recordSessions={assistantInfo.assistant?.liveVoice?.recordSessions}>\n {chat.voice.active && !inputWidget ? <>{limitBannerNode}{usageBarNode}{queueNoticeNode}</> : null}\n </LiveVoicePanel>\n </React.Suspense>}\n {chat.voice.active && !inputWidget ? null : Boolean(mergedOptions.customPromptBox) && !(chat.voice.active && inputWidget) ? (\n <div className=\"devic-input-area\">\n {limitBannerNode}\n {usageBarNode}\n {integrationsHintNode}\n {queueNoticeNode}\n {mergedOptions.customPromptBox({\n voice: chat.voice,\n sendMessage: handleSend,\n transcribeAudio,\n stop: chat.stopChat,\n isLoading: chat.isLoading,\n queueEnabled: canQueue,\n queuedCount: chat.queuedCount,\n newConversation: chat.clearChat,\n references,\n removeReference,\n clearReferences,\n limitExceeded: chat.limitExceeded,\n })}\n </div>\n ) : (\n <ChatInput\n onSend={handleSend}\n disabled={\n // `handedOff` is one of the states the queue covers — the\n // conversation is waiting on a subagent, which in an embedded\n // widget can take minutes — so with queueing on it no longer\n // closes the box. A pending widget and a usage limit still do:\n // one is the assistant waiting on this user, the other a refusal.\n (chat.isLoading && !canQueue) ||\n (chat.handedOff && !canQueue) ||\n inlineWidgets.length > 0 ||\n !!chat.limitExceeded\n }\n placeholder={t(mergedOptions.inputPlaceholder)}\n enableFileUploads={mergedOptions.enableFileUploads}\n allowedFileTypes={mergedOptions.allowedFileTypes}\n maxFileSize={mergedOptions.maxFileSize}\n enableLongTextPaste={mergedOptions.enableLongTextPaste}\n longTextPasteThreshold={mergedOptions.longTextPasteThreshold}\n enableSpeechToText={mergedOptions.enableSpeechToText}\n speechLanguage={mergedOptions.speechLanguage}\n speechTenantId={tenantId}\n speechAutoStop={mergedOptions.speechAutoStop}\n speechAutoStopCountdownMs={mergedOptions.speechAutoStopCountdownMs}\n speechAutoStopSilenceMs={mergedOptions.speechAutoStopSilenceMs}\n speechAutoStopSilenceRatio={mergedOptions.speechAutoStopSilenceRatio}\n speechAutoStopSilenceLevel={mergedOptions.speechAutoStopSilenceLevel}\n speechAutoStopSpeechLevel={mergedOptions.speechAutoStopSpeechLevel}\n speechHandoff={mergedOptions.speechHandoff}\n speechHandoffSendDelayMs={mergedOptions.speechHandoffSendDelayMs}\n speechHandoffHoldMs={mergedOptions.speechHandoffHoldMs}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n sendButtonContent={mergedOptions.sendButtonContent}\n disabledMessage={\n chat.handedOff\n ? t('Waiting for subagent to complete')\n : inlineWidgets.length > 0\n ? t('Waiting for tool response')\n : undefined\n }\n isProcessing={chat.isLoading && !chat.handedOff}\n onStop={handleStopChat}\n allowQueueing={canQueue}\n queueNotice={queueNoticeNode}\n stopButtonContent={mergedOptions.stopButtonContent}\n pendingInputWidget={inputWidget}\n onSubmitWidget={chat.submitWidgetResponse}\n onCancelWidget={chat.cancelWidgetCall}\n references={references}\n onRemoveReference={removeReference}\n usageBar={usageBarNode}\n limitBanner={limitBannerNode}\n integrationsHint={integrationsHintNode}\n integrationsToggle={integrationsToggleNode}\n />\n )}\n </div>\n\n {/* Trigger button (drawer mode only, when closed) */}\n {!isInline && !isOpen && (\n <button\n className=\"devic-trigger\"\n onClick={handleOpen}\n style={triggerStyle}\n type=\"button\"\n aria-label={t('Open chat')}\n >\n <ChatIcon />\n </button>\n )}\n\n {/* Core memory modal (opened from the header brain button) */}\n {mergedOptions.showCoreMemoryButton && (\n <CoreMemoryModal\n isOpen={coreMemoryOpen}\n onClose={() => setCoreMemoryOpen(false)}\n assistantId={assistantId}\n tenantId={tenantId}\n subtenantId={subtenantId}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n labels={mergedOptions.coreMemoryLabels}\n theme={modalTheme}\n />\n )}\n\n {/* Connected apps modal (opened from the header app stack) */}\n {mergedOptions.showIntegrationsButton !== false && (\n <IntegrationsModal\n isOpen={integrationsOpen}\n onClose={() => setIntegrationsOpen(false)}\n assistantId={assistantId}\n tenantId={tenantId}\n subtenantId={subtenantId}\n apiKey={resolvedApiKey}\n baseUrl={resolvedBaseUrl}\n title={t(mergedOptions.integrationsLabel)}\n theme={modalTheme}\n state={integrationsState}\n mcpState={mcpState}\n />\n )}\n </DevicTranslationsProvider>\n );\n}\n\n/**\n * Brain icon for the core memory button\n */\nfunction BrainIcon(): JSX.Element {\n return (\n <svg\n width=\"17\"\n height=\"17\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M9.5 2a2.5 2.5 0 0 0-2.45 2A3.5 3.5 0 0 0 4.6 8.6 3.5 3.5 0 0 0 3 11.5c0 1.1.5 2.08 1.29 2.73A3.5 3.5 0 0 0 7 20a3 3 0 0 0 5-2.24V4.5A2.5 2.5 0 0 0 9.5 2Z\" />\n <path d=\"M14.5 2a2.5 2.5 0 0 1 2.45 2 3.5 3.5 0 0 1 2.45 4.6A3.5 3.5 0 0 1 21 11.5a3.49 3.49 0 0 1-1.29 2.73A3.5 3.5 0 0 1 17 20a3 3 0 0 1-5-2.24V4.5A2.5 2.5 0 0 1 14.5 2Z\" />\n </svg>\n );\n}\n\nfunction CloseIcon(): JSX.Element {\n return (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n/**\n * Plus icon for new chat button\n */\nfunction PlusIcon(): JSX.Element {\n return (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\" />\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />\n </svg>\n );\n}\n\n/**\n * Chat icon for trigger button\n */\nfunction ChatIcon(): JSX.Element {\n return (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z\" />\n </svg>\n );\n}\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,OAAO,qBAAkB,CAAC,CAAC;AAGnE,MAAM,eAAe,GAAgC;AACnD,IAAA,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;AAC7B,IAAA,QAAQ,EAAE,OAAO;AACjB,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,iBAAiB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KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,cAAc,EAAA,QAAA,EAEnBA,GAAA,CAAA,MAAA,EAAA,EAAM,CAAC,EAAC,yFAAyF,EAAA,CAAG,EAAA,CAChG;AAEV;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devicai/ui",
3
- "version": "0.61.0",
3
+ "version": "0.61.1",
4
4
  "type": "module",
5
5
  "description": "React component library for Devic AI assistants",
6
6
  "engines": {