@tomny-dev/uzi 0.20.0-pr.134.459.1.7c935fa → 0.20.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.
- package/dist/components/ai-chat/AIChat.d.ts +2 -25
- package/dist/components/ai-chat/AIChat.d.ts.map +1 -1
- package/dist/components/ai-chat/AIChatParts.d.ts +32 -0
- package/dist/components/ai-chat/AIChatParts.d.ts.map +1 -0
- package/dist/components/ai-chat/activityLabel.d.ts +20 -0
- package/dist/components/ai-chat/activityLabel.d.ts.map +1 -0
- package/dist/components/ai-chat/activityLabel.test.d.ts +2 -0
- package/dist/components/ai-chat/activityLabel.test.d.ts.map +1 -0
- package/dist/index.cjs +6 -5
- package/dist/index.js +4 -3
- package/dist/index84.js +3 -556
- package/dist/index84.js.map +1 -1
- package/dist/index85.cjs +6 -556
- package/dist/index85.cjs.map +1 -1
- package/dist/index85.js +11 -34
- package/dist/index85.js.map +1 -1
- package/dist/index86.cjs +11 -49
- package/dist/index86.cjs.map +1 -1
- package/dist/index86.js +539 -227
- package/dist/index86.js.map +1 -1
- package/dist/index87.cjs +541 -226
- package/dist/index87.cjs.map +1 -1
- package/dist/index87.js +33 -15
- package/dist/index87.js.map +1 -1
- package/dist/index88.cjs +48 -21
- package/dist/index88.cjs.map +1 -1
- package/dist/index88.js +250 -29
- package/dist/index88.js.map +1 -1
- package/dist/index89.cjs +250 -30
- package/dist/index89.cjs.map +1 -1
- package/dist/index89.js +19 -0
- package/dist/index89.js.map +1 -0
- package/dist/index90.cjs +25 -0
- package/dist/index90.cjs.map +1 -0
- package/dist/index90.js +36 -0
- package/dist/index90.js.map +1 -0
- package/dist/index91.cjs +37 -0
- package/dist/index91.cjs.map +1 -0
- package/package.json +1 -1
package/dist/index86.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index86.js","names":[],"sources":["../src/components/ai-chat/AIChatDock.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useId, useRef, useState, type ReactNode } from 'react';\n\nimport styles from './ai-chat-dock.module.css';\n\nexport interface AIChatDockProps {\n /** Visible assistant name, e.g. \"Betty\" or \"Ask Tultr\". */\n readonly title: string;\n readonly description?: string;\n /** Accessible name for the floating action button. Defaults to \"Open {title}\". */\n readonly launcherLabel?: string;\n /** Turn off the built-in FAB when a parent FloatingActionStack owns the launcher. */\n readonly showLauncher?: boolean;\n /** Optional stable panel ID for an external button's aria-controls. */\n readonly panelId?: string;\n /** ID of the external launch button to restore keyboard focus after close. */\n readonly externalLauncherId?: string;\n readonly children: ReactNode;\n /** Consumer-owned conversation reset; shown in the dock header beside expand/close. */\n readonly onNewChat?: () => void;\n readonly newChatDisabled?: boolean;\n /** Controlled visibility; when omitted, the dock manages its own state. */\n readonly open?: boolean;\n readonly defaultOpen?: boolean;\n readonly onOpenChange?: (open: boolean) => void;\n /** Controlled expansion; apps may synchronize this with a dedicated route. */\n readonly expanded?: boolean;\n readonly defaultExpanded?: boolean;\n readonly onExpandedChange?: (expanded: boolean) => void;\n readonly className?: string;\n}\n\n/**\n * Shared chat navigation chrome. Children remain mounted while closed to retain\n * the consumer's active AI SDK conversation, pending approvals and attachments.\n * The dock never creates a second chat runtime or reads application messages.\n * Desktop is deliberately non-modal: Tab can move back into the page.\n * On mobile the full-screen modal sheet traps sequential keyboard focus.\n */\nexport function AIChatDock({\n title,\n description,\n launcherLabel,\n showLauncher = true,\n panelId: controlledPanelId,\n externalLauncherId,\n children,\n onNewChat,\n newChatDisabled = false,\n open,\n defaultOpen = false,\n onOpenChange,\n expanded,\n defaultExpanded = false,\n onExpandedChange,\n className,\n}: AIChatDockProps) {\n const autoId = useId();\n const panelId = controlledPanelId ?? `uzi-ai-dock-${autoId}`;\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const isOpen = open ?? internalOpen;\n const isExpanded = expanded ?? internalExpanded;\n const [mobile, setMobile] = useState(false);\n const launcherRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLElement>(null);\n const openerRef = useRef<HTMLElement | null>(null);\n const wasOpen = useRef(false);\n\n const changeOpen = (next: boolean) => {\n if (open === undefined) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n const changeExpanded = (next: boolean) => {\n if (expanded === undefined) setInternalExpanded(next);\n onExpandedChange?.(next);\n if (next && !isOpen) changeOpen(true);\n };\n\n useEffect(() => {\n if (typeof window.matchMedia !== 'function') return;\n const media = window.matchMedia('(max-width: 640px)');\n const update = () => setMobile(media.matches);\n update();\n media.addEventListener('change', update);\n return () => media.removeEventListener('change', update);\n }, []);\n\n useEffect(() => {\n if (isOpen && !wasOpen.current) {\n openerRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n panelRef.current?.focus();\n } else if (!isOpen && wasOpen.current) {\n const previous = openerRef.current;\n if (previous?.isConnected && previous !== panelRef.current) previous.focus();\n else if (externalLauncherId) document.getElementById(externalLauncherId)?.focus();\n else launcherRef.current?.focus();\n }\n wasOpen.current = isOpen;\n }, [isOpen, externalLauncherId]);\n\n useEffect(() => {\n if (!isOpen || !mobile) return;\n const previous = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n return () => { document.body.style.overflow = previous; };\n }, [isOpen, mobile]);\n\n useEffect(() => {\n if (!isOpen) return;\n const keydown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n changeOpen(false);\n return;\n }\n // On desktop the panel is non-modal; only the mobile sheet traps focus.\n if (event.key !== 'Tab' || !mobile) return;\n const focusable = Array.from(panelRef.current?.querySelectorAll<HTMLElement>(\n 'a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n ) ?? []).filter((item) => item.tabIndex >= 0 && item.getClientRects().length > 0);\n if (!focusable.length) { event.preventDefault(); panelRef.current?.focus(); return; }\n const first = focusable[0], last = focusable[focusable.length - 1];\n if (event.shiftKey && (document.activeElement === first || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n last?.focus();\n } else if (!event.shiftKey && (document.activeElement === last || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n first?.focus();\n }\n };\n document.addEventListener('keydown', keydown);\n return () => document.removeEventListener('keydown', keydown);\n }, [isOpen, mobile, onOpenChange, open]);\n\n return (\n <div className={[styles.dock, className].filter(Boolean).join(' ')}>\n {showLauncher && !isOpen && (\n <button\n ref={launcherRef}\n type=\"button\"\n className={styles.launcher}\n aria-controls={panelId}\n aria-expanded={false}\n aria-label={launcherLabel ?? `Open ${title}`}\n onClick={() => changeOpen(true)}\n >\n <svg aria-hidden=\"true\" width=\"23\" height=\"23\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M21 11.5a8.5 8.5 0 0 1-8.5 8.5 9.1 9.1 0 0 1-4-.9L3 21l1.9-5.5a9.1 9.1 0 0 1-.9-4 8.5 8.5 0 0 1 8.5-8.5h.5A8.5 8.5 0 0 1 21 11.5Z\" />\n </svg>\n <span className={styles.launcherText}>{title}</span>\n </button>\n )}\n {isOpen && mobile && <div className={styles.backdrop} aria-hidden=\"true\" onClick={() => changeOpen(false)} />}\n <section\n ref={panelRef}\n id={panelId}\n role=\"dialog\"\n aria-modal={mobile && isOpen}\n aria-label={title}\n tabIndex={-1}\n className={styles.panel}\n data-expanded={isExpanded}\n hidden={!isOpen}\n >\n <header className={styles.header}>\n <div className={styles.identity}>\n <div className={styles.avatar} aria-hidden=\"true\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"4\" y=\"6\" width=\"16\" height=\"14\" rx=\"4\" />\n <path d=\"M12 3v3M9 13h.01M15 13h.01M9 17h6\" />\n </svg>\n </div>\n <div className={styles.titles}>\n <strong className={styles.title}>{title}</strong>\n {description && <span className={styles.description}>{description}</span>}\n </div>\n </div>\n <div className={styles.actions}>\n {onNewChat && (\n <button type=\"button\" className={styles.iconButton}\n aria-label=\"New chat\" title=\"New chat\"\n disabled={newChatDisabled}\n onClick={onNewChat}>\n <svg aria-hidden=\"true\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6\" />\n <path d=\"m15 5 4 4M13 11l7-7a2.12 2.12 0 0 1 3 3l-7 7-4 1 1-4Z\" transform=\"translate(-2 -2)\" />\n </svg>\n </button>\n )}\n <button type=\"button\" className={`${styles.iconButton} ${styles.expandButton}`}\n aria-label={isExpanded ? `Collapse ${title}` : `Expand ${title}`}\n title={isExpanded ? 'Collapse' : 'Expand'}\n onClick={() => changeExpanded(!isExpanded)}>\n {isExpanded ? (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M9 3v6H3M15 21v-6h6M3 9l6-6M21 15l-6 6\" /></svg>\n ) : (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M8 3H3v5M16 21h5v-5M3 3l7 7M21 21l-7-7\" /></svg>\n )}\n </button>\n <button type=\"button\" className={styles.iconButton}\n aria-label={`Close ${title}`} title=\"Close\"\n onClick={() => changeOpen(false)}>\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"M18 6 6 18M6 6l12 12\" /></svg>\n </button>\n </div>\n </header>\n <div className={styles.content}>{children}</div>\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAwCA,SAAgB,WAAW,EACzB,OACA,aACA,eACA,eAAe,MACf,SAAS,mBACT,oBACA,UACA,WACA,kBAAkB,OAClB,MACA,cAAc,OACd,cACA,UACA,kBAAkB,OAClB,kBACA,aACkB;CAClB,MAAM,SAAS,MAAM;CACrB,MAAM,UAAU,qBAAqB,eAAe;CACpD,MAAM,CAAC,cAAc,mBAAmB,SAAS,WAAW;CAC5D,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,eAAe;CACxE,MAAM,SAAS,QAAQ;CACvB,MAAM,aAAa,YAAY;CAC/B,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,cAAc,OAA0B,IAAI;CAClD,MAAM,WAAW,OAAoB,IAAI;CACzC,MAAM,YAAY,OAA2B,IAAI;CACjD,MAAM,UAAU,OAAO,KAAK;CAE5B,MAAM,cAAc,SAAkB;EACpC,IAAI,SAAS,KAAA,GAAW,gBAAgB,IAAI;EAC5C,eAAe,IAAI;CACrB;CAEA,MAAM,kBAAkB,SAAkB;EACxC,IAAI,aAAa,KAAA,GAAW,oBAAoB,IAAI;EACpD,mBAAmB,IAAI;EACvB,IAAI,QAAQ,CAAC,QAAQ,WAAW,IAAI;CACtC;CAEA,gBAAgB;EACd,IAAI,OAAO,OAAO,eAAe,YAAY;EAC7C,MAAM,QAAQ,OAAO,WAAW,oBAAoB;EACpD,MAAM,eAAe,UAAU,MAAM,OAAO;EAC5C,OAAO;EACP,MAAM,iBAAiB,UAAU,MAAM;EACvC,aAAa,MAAM,oBAAoB,UAAU,MAAM;CACzD,GAAG,CAAC,CAAC;CAEL,gBAAgB;EACd,IAAI,UAAU,CAAC,QAAQ,SAAS;GAC9B,UAAU,UAAU,SAAS,yBAAyB,cAAc,SAAS,gBAAgB;GAC7F,SAAS,SA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yCAA0C,CAAA;QAAM,CAAA;OAEtH,CAAA;OACR,oBAAC,UAAD;QAAQ,MAAK;QAAS,WAAW,4BAAO;QACtC,cAAY,SAAS;QAAS,OAAM;QACpC,eAAe,WAAW,KAAK;kBAC/B,oBAAC,OAAD;SAAK,OAAM;SAAK,QAAO;SAAK,SAAQ;SAAY,MAAK;SAAO,QAAO;SACjE,aAAY;SAAI,eAAc;SAAQ,eAAY;mBAAO,oBAAC,QAAD,EAAM,GAAE,uBAAwB,CAAA;QAAM,CAAA;OAC3F,CAAA;MACL;OACC;QACR,oBAAC,OAAD;KAAK,WAAW,4BAAO;KAAU;IAAc,CAAA,CACxC;;EACN;;AAET"}
|
|
1
|
+
{"version":3,"file":"index86.js","names":[],"sources":["../src/components/ai-chat/AIChat.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport type { CSSProperties, ComponentType, FormEvent, KeyboardEvent, ReactNode } from 'react';\n\nimport { AuiConfig, AuiProvider, ThreadPrimitive } from '@assistant-ui/react';\nimport { AISDKChat, AssistantChatTransport, useAISDKChat } from '@assistant-ui/ai-sdk';\n\nimport styles from './ai-chat.module.css';\nimport { AIChatAttachmentPreview, asString, isRecord, DefaultErrorRenderer, DefaultMessageRenderer, renderPart } from './AIChatParts';\nimport { resolveChatActivityLabel } from './activityLabel';\n\ntype AIChatTransportOptions = NonNullable<ConstructorParameters<typeof AssistantChatTransport>[0]>;\n\nexport interface AIChatProps {\n /** AI SDK UI-message stream endpoint. */\n readonly api: string;\n /** Opaque scope identifier sent to the API. Server must authorize it. */\n readonly scope?: string;\n /** Human-readable display text; never used as an access-control identifier. */\n readonly scopeLabel?: string;\n /** Fetch adapter for authentication, request instrumentation and local demos. */\n readonly fetch?: typeof globalThis.fetch;\n readonly headers?: Record<string, string>;\n readonly credentials?: RequestCredentials;\n /** Customize serialized requests for APIs with a strict request schema. */\n readonly prepareSendMessagesRequest?: AIChatTransportOptions['prepareSendMessagesRequest'];\n /** Change this when the authenticated identity changes to reset the transcript. */\n readonly sessionKey?: string | number;\n /** Maximum number of user turns (default: 8). */\n readonly messageLimit?: number;\n readonly inputPlaceholder?: string;\n /** Accessible name for the message textarea. */\n readonly inputAriaLabel?: string;\n readonly inputMaxLength?: number;\n readonly components?: AIChatComponents;\n /** Actions displayed beside the native New chat control in one shared toolbar. */\n readonly toolbarActions?: ReactNode;\n /** When false, the enclosing AIChatDock owns the New chat control. */\n readonly showNewChatInToolbar?: boolean;\n /** Increment or replace this stable token to request the native New chat flow externally. */\n readonly newChatRequestKey?: string | number;\n /** Opt-in files, restricted to images/text accepted by the application API. */\n readonly attachments?: AIChatAttachmentOptions;\n /** Visible, accessible activity label while the assistant has not started answering. */\n readonly activityLabel?: string;\n /** Human-friendly labels for running tools, keyed by SDK tool name. */\n readonly toolActivityLabels?: Readonly<Record<string, string>>;\n /** Optional persistence; implementations must scope storage by user AND resource. */\n readonly history?: AIChatHistoryAdapter;\n /** Native SDK continuation predicate for tool approvals. */\n readonly sendAutomaticallyWhen?: NonNullable<Parameters<typeof AISDKChat>[0]>['sendAutomaticallyWhen'];\n readonly onClose?: () => void;\n readonly className?: string;\n readonly style?: CSSProperties;\n}\n\n/**\n * Framework-independent presentation contract. The parent owns the runtime,\n * message identities, approvals, uploads, history and security boundaries.\n * Uzi does not serialize, persist or reinterpret any messages supplied here.\n */\nexport type AIChatMessage = AIChatMessageRendererProps['message'];\n\nexport interface AIChatAttachmentOptions {\n readonly accept: string;\n readonly maxFiles?: number;\n readonly maxBytesPerFile?: number;\n}\n\nexport interface AIChatSelectedAttachment {\n readonly name: string;\n readonly size: number;\n /** Local thumbnail URL for supported image files. */\n readonly previewUrl?: string;\n}\n\nexport interface AIChatHistoryAdapter {\n /** Load only validated UI messages from the authenticated principal's own storage. */\n readonly load: () => Promise<readonly AIChatMessage[]> | readonly AIChatMessage[];\n /** Save after complete turns; the consumer decides what metadata is safe. */\n readonly save: (messages: readonly AIChatMessage[]) => Promise<void> | void;\n readonly clear: () => Promise<void> | void;\n /** Observability for failed history operations; never include message payloads in logs. */\n readonly onError?: (operation: 'load' | 'save' | 'clear', error: unknown) => void;\n}\n\nexport type AIChatToolApprovalHandler = (id: string, approved: boolean) => Promise<void> | void;\n\nexport interface AIChatViewProps {\n readonly messages: readonly AIChatMessage[];\n readonly status?: string;\n readonly activityLabel?: string;\n readonly toolActivityLabels?: Readonly<Record<string, string>>;\n readonly error?: Error | null;\n readonly draft?: string;\n readonly onDraftChange?: (draft: string) => void;\n readonly onSend?: () => void;\n readonly onStop?: () => void;\n readonly onRetry?: () => void;\n readonly onNewChat?: () => void;\n /** False when AIChatDock owns the new-chat action in its header. */\n readonly showNewChatInToolbar?: boolean;\n /** No limit by default: specialized apps decide their own session policy. */\n readonly messageLimit?: number;\n readonly inputPlaceholder?: string;\n readonly inputAriaLabel?: string;\n readonly inputMaxLength?: number;\n readonly components?: AIChatComponents;\n readonly attachments?: readonly AIChatSelectedAttachment[];\n readonly onSelectAttachments?: (files: FileList) => void;\n readonly onRemoveAttachment?: (index: number) => void;\n readonly attachmentAccept?: string;\n readonly attachmentError?: string | null;\n /** Only invoked from explicit user action on an approval-requested tool part. */\n readonly onToolApproval?: AIChatToolApprovalHandler;\n /** Custom message toolbar controls, e.g. a conversation selector. */\n readonly toolbarActions?: ReactNode;\n /** Context labels or other app-owned notices above the transcript. */\n readonly header?: ReactNode;\n /** Upload actions, attachment previews or context chips before the input. */\n readonly composerLeading?: ReactNode;\n /** Additional buttons beside the Send/Stop control. */\n readonly composerTrailing?: ReactNode;\n /** Completely replace the composer while retaining shared transcript chrome. */\n readonly composer?: ReactNode;\n readonly emptyState?: ReactNode;\n readonly className?: string;\n readonly style?: CSSProperties;\n}\n\nexport interface AIChatComponents {\n readonly MessageRenderer?: ComponentType<AIChatMessageRendererProps>;\n readonly ReasoningRenderer?: ComponentType<AIChatReasoningRendererProps>;\n readonly SourceRenderer?: ComponentType<AIChatSourceRendererProps>;\n readonly DataRenderer?: ComponentType<AIChatDataRendererProps>;\n readonly ToolRenderer?: ComponentType<AIChatToolRendererProps>;\n readonly ErrorRenderer?: ComponentType<AIChatErrorRendererProps>;\n}\n\nexport interface AIChatMessageRendererProps {\n readonly message: {\n readonly id: string;\n readonly role: 'user' | 'assistant';\n readonly parts: readonly unknown[];\n readonly metadata?: Record<string, unknown>;\n };\n readonly renderMessagePart: (part: Record<string, unknown>, index: number) => ReactNode;\n readonly onToolApproval?: AIChatToolApprovalHandler;\n}\n\nexport interface AIChatReasoningRendererProps {\n readonly children: string;\n readonly title?: string;\n}\n\nexport interface AIChatSource {\n readonly id: string;\n readonly title?: string;\n readonly url?: string;\n}\n\nexport interface AIChatSourceRendererProps {\n readonly sources: readonly AIChatSource[];\n readonly renderSource: (source: AIChatSource, index: number) => ReactNode;\n}\n\nexport interface AIChatDataRendererProps {\n readonly data: readonly Record<string, unknown>[];\n readonly renderDataItem: (item: Record<string, unknown>, index: number) => ReactNode;\n}\n\nexport interface AIChatToolRendererProps {\n readonly part: Record<string, unknown>;\n readonly name: string;\n readonly approvalId?: string;\n readonly onApprove?: () => void;\n readonly onDeny?: () => void;\n readonly approvalPending: boolean;\n}\n\nexport interface AIChatErrorRendererProps {\n readonly error: Error;\n readonly onRetry: () => void;\n readonly onClear: () => void;\n}\n\nconst DEFAULT_MESSAGE_LIMIT = 8;\n\nexport function AIChat({\n api,\n scope,\n scopeLabel,\n fetch: requestFetch,\n headers,\n credentials,\n prepareSendMessagesRequest,\n sessionKey,\n messageLimit = DEFAULT_MESSAGE_LIMIT,\n inputPlaceholder = 'Ask a question...',\n inputAriaLabel = 'Message',\n inputMaxLength = 2000,\n components,\n toolbarActions,\n showNewChatInToolbar = true,\n newChatRequestKey,\n attachments,\n activityLabel,\n toolActivityLabels,\n history,\n sendAutomaticallyWhen,\n onClose,\n className,\n style,\n}: AIChatProps) {\n // Remounting the provider creates a fresh AI SDK chat id, not merely an empty transcript.\n const [session, setSession] = useState(0);\n const transport = useMemo(\n () => new AssistantChatTransport({\n api,\n // The transport merges this with the AI SDK messages, id, model context and tools.\n // The endpoint, not the presentation component, must enforce the scope.\n ...(scope ? { body: { scope } } : {}),\n ...(requestFetch ? { fetch: requestFetch } : {}),\n ...(headers ? { headers } : {}),\n ...(credentials ? { credentials } : {}),\n ...(prepareSendMessagesRequest ? { prepareSendMessagesRequest } : {}),\n }),\n [api, scope, requestFetch, headers, credentials, prepareSendMessagesRequest],\n );\n const config = useMemo(\n () => AuiConfig({ threads: AISDKChat({ transport, ...(sendAutomaticallyWhen ? { sendAutomaticallyWhen } : {}) }) }),\n [transport, session, sendAutomaticallyWhen],\n );\n\n return (\n <div className={[styles.container, className].filter(Boolean).join(' ')} style={style}>\n {scopeLabel && (\n <div className={styles.scope}>\n <span className={styles.scopeLabel}>Current scope</span>\n <strong>{scopeLabel}</strong>\n </div>\n )}\n {onClose && (\n <button className={styles.closeBtn} type=\"button\" onClick={onClose} aria-label=\"Close chat\">\n ✕\n </button>\n )}\n <AuiProvider key={JSON.stringify([api, scope, sessionKey, session])} config={config}>\n <ThreadPrimitive.Root className={styles.thread}>\n <ChatViewport\n messageLimit={Number.isFinite(messageLimit) ? Math.max(1, Math.floor(messageLimit)) : DEFAULT_MESSAGE_LIMIT}\n inputPlaceholder={inputPlaceholder}\n inputAriaLabel={inputAriaLabel}\n inputMaxLength={inputMaxLength}\n components={components}\n toolbarActions={toolbarActions}\n showNewChatInToolbar={showNewChatInToolbar}\n newChatRequestKey={newChatRequestKey}\n attachmentOptions={attachments}\n activityLabel={activityLabel}\n toolActivityLabels={toolActivityLabels}\n history={history}\n onNewChat={() => setSession((previous) => previous + 1)}\n />\n </ThreadPrimitive.Root>\n </AuiProvider>\n </div>\n );\n}\n\ninterface ChatViewportProps {\n readonly messageLimit: number;\n readonly inputPlaceholder: string;\n readonly inputAriaLabel: string;\n readonly inputMaxLength: number;\n readonly components?: AIChatComponents;\n readonly toolbarActions?: ReactNode;\n readonly showNewChatInToolbar?: boolean;\n readonly newChatRequestKey?: string | number;\n readonly attachmentOptions?: AIChatAttachmentOptions;\n readonly activityLabel?: string;\n readonly toolActivityLabels?: Readonly<Record<string, string>>;\n readonly history?: AIChatHistoryAdapter;\n readonly onNewChat: () => void;\n}\n\nfunction ChatViewport({\n messageLimit,\n inputPlaceholder,\n inputAriaLabel,\n inputMaxLength,\n components,\n toolbarActions,\n showNewChatInToolbar,\n newChatRequestKey,\n attachmentOptions,\n activityLabel,\n toolActivityLabels,\n history,\n onNewChat,\n}: ChatViewportProps) {\n const chat = useAISDKChat();\n const [draft, setDraft] = useState('');\n const [selectedFiles, setSelectedFiles] = useState<File[]>([]);\n const [attachmentError, setAttachmentError] = useState<string | null>(null);\n const [attachmentPreviews, setAttachmentPreviews] = useState<string[]>([]);\n const [hydrated, setHydrated] = useState(!history);\n const expectedRestoredId = useRef<string | null>(null);\n const saveQueue = useRef<Promise<void>>(Promise.resolve());\n const [approvalBusy, setApprovalBusy] = useState(false);\n useEffect(() => {\n const urls = selectedFiles.map((file) => file.type.startsWith('image/') && typeof URL.createObjectURL === 'function' ? URL.createObjectURL(file) : '');\n setAttachmentPreviews(urls);\n return () => urls.forEach((url) => { if (url && typeof URL.revokeObjectURL === 'function') URL.revokeObjectURL(url); });\n }, [selectedFiles]);\n const messages = chat?.messages ?? [];\n const status = chat?.status ?? 'ready';\n const isBusy = status === 'submitted' || status === 'streaming';\n const historyFull = messages.filter((message) => message.role === 'user').length >= messageLimit;\n const reportHistoryError = (operation: 'load' | 'save' | 'clear', error: unknown) => {\n if (history?.onError) history.onError(operation, error);\n else console.warn(`[Uzi AIChat] History ${operation} failed`);\n };\n // Persist only complete turns. Do not save an empty runtime over stored history\n // during hydration or while a response is still streaming.\n useEffect(() => {\n if (!history) return;\n let active = true;\n void Promise.resolve().then(() => history.load()).then((restored) => {\n if (!active) return;\n if (Array.isArray(restored)) {\n const valid = restored.filter((message) =>\n typeof message?.id === 'string' &&\n (message.role === 'user' || message.role === 'assistant') &&\n Array.isArray(message.parts));\n expectedRestoredId.current = valid.length ? valid[0].id : null;\n if (valid.length) chat?.setMessages(valid as Parameters<NonNullable<typeof chat>['setMessages']>[0]);\n }\n setHydrated(true);\n }).catch((error: unknown) => {\n if (active) {\n reportHistoryError('load', error);\n setHydrated(true);\n }\n });\n return () => { active = false; };\n }, [chat?.setMessages, history]);\n\n useEffect(() => {\n if (!history || !hydrated || isBusy) return;\n const snapshot = messages.filter((message) => message.role === 'user' || message.role === 'assistant').map((message) => ({\n id: message.id, role: message.role as 'user' | 'assistant', parts: message.parts,\n ...(isRecord(message.metadata) ? { metadata: message.metadata } : {}),\n }));\n // Guard against the transient empty SDK state between history.load and\n // setMessages propagation; otherwise an old transcript could be erased.\n if (expectedRestoredId.current) {\n if (!snapshot.some((message) => message.id === expectedRestoredId.current)) return;\n expectedRestoredId.current = null;\n }\n // Serialize writes. New Chat waits for in-flight writes before clearing.\n saveQueue.current = saveQueue.current.then(\n () => history.save(snapshot),\n () => history.save(snapshot),\n ).then(\n () => {},\n (error: unknown) => { reportHistoryError('save', error); },\n );\n }, [history, hydrated, isBusy, messages]);\n\n const handleSelectedFiles = (files: FileList) => {\n if (!attachmentOptions) return;\n const selected = Array.from(files);\n if (selected.length + selectedFiles.length > (attachmentOptions.maxFiles ?? 3)) {\n setAttachmentError('Too many attachments.');\n return;\n }\n if (selected.some((file) => file.size > (attachmentOptions.maxBytesPerFile ?? 5 * 1024 * 1024))) {\n setAttachmentError('An attachment exceeds the size limit.');\n return;\n }\n const allowedTypes = attachmentOptions.accept.split(',').map((item) => item.trim());\n if (selected.some((file) => !allowedTypes.some((allow) => (\n allow === file.type || (allow.endsWith('/*') && file.type.startsWith(allow.slice(0, -1)))\n )))) {\n setAttachmentError('Unsupported attachment type.');\n return;\n }\n setAttachmentError(null);\n setSelectedFiles((existing) => [...existing, ...selected]);\n };\n\n const handleSubmit = () => {\n const text = draft.trim();\n if (!chat || (!text && selectedFiles.length === 0) || isBusy || historyFull || chat.error || !hydrated || approvalBusy) return;\n const files = selectedFiles.length ? new DataTransfer() : null;\n selectedFiles.forEach((file) => files?.items.add(file));\n // AI SDK serializes FileList to FileUIParts and sends them through the\n // app-owned transport. The server MUST validate types and sizes again.\n // Clear the composer promptly; restore the draft and files if submission\n // fails, so users do not lose attachments or typed content.\n const previousDraft = draft;\n const previousFiles = selectedFiles;\n setDraft('');\n setSelectedFiles([]);\n setAttachmentError(null);\n void Promise.resolve(chat.sendMessage({ text, ...(files ? { files: files.files } : {}) }))\n .catch(() => {\n setDraft((current) => current || previousDraft);\n setSelectedFiles((current) => current.length ? current : previousFiles);\n });\n };\n\n const handleNewChat = () => {\n void (async () => {\n await chat?.stop();\n if (history) {\n try {\n await saveQueue.current;\n await history.clear();\n } catch (error) {\n reportHistoryError('clear', error);\n return;\n }\n }\n onNewChat();\n })();\n };\n\n // An enclosing dock can reuse the native reset path without duplicating\n // history deletion, aborts, or SDK session management in each consumer.\n const lastNewChatRequestKey = useRef(newChatRequestKey);\n useEffect(() => {\n if (lastNewChatRequestKey.current === newChatRequestKey) return;\n lastNewChatRequestKey.current = newChatRequestKey;\n handleNewChat();\n }, [newChatRequestKey]);\n\n const handleRetry = () => {\n if (!chat || isBusy) return;\n chat.clearError();\n void chat.regenerate();\n };\n\n return (\n <AIChatView\n messages={messages.filter((message) => message.role === 'user' || message.role === 'assistant').map((message) => ({\n id: message.id,\n role: message.role as 'user' | 'assistant',\n parts: message.parts,\n ...(isRecord(message.metadata) ? { metadata: message.metadata } : {}),\n }))}\n status={status}\n activityLabel={activityLabel}\n toolActivityLabels={toolActivityLabels}\n error={chat?.error}\n draft={draft}\n onDraftChange={setDraft}\n onSend={handleSubmit}\n onStop={() => { void chat?.stop(); }}\n onRetry={handleRetry}\n onNewChat={handleNewChat}\n showNewChatInToolbar={showNewChatInToolbar}\n toolbarActions={toolbarActions}\n messageLimit={messageLimit}\n attachments={selectedFiles.map((file, index) => ({ name: file.name, size: file.size, ...(attachmentPreviews[index] ? { previewUrl: attachmentPreviews[index] } : {}) }))}\n onSelectAttachments={attachmentOptions ? handleSelectedFiles : undefined}\n onRemoveAttachment={attachmentOptions ? (index) => setSelectedFiles((files) => files.filter((_, i) => i !== index)) : undefined}\n attachmentAccept={attachmentOptions?.accept}\n attachmentError={attachmentError}\n onToolApproval={chat ? async (id, approved) => {\n if (approvalBusy) return;\n setApprovalBusy(true);\n try { await chat.addToolApprovalResponse({ id, approved, ...(!approved ? { reason: 'User denied approval' } : {}) }); }\n finally { setApprovalBusy(false); }\n } : undefined}\n inputPlaceholder={inputPlaceholder}\n inputAriaLabel={inputAriaLabel}\n inputMaxLength={inputMaxLength}\n components={components}\n />\n );\n}\n\n/**\n * Controlled chat presentation for apps with their own AI SDK/assistant-ui\n * runtime. It does not create providers, transports or chat state. Callbacks\n * are the only way messages/actions leave the view.\n */\nexport function AIChatView({\n messages,\n status = 'ready',\n activityLabel = 'Working on your response…',\n toolActivityLabels,\n error,\n draft = '',\n onDraftChange,\n onSend,\n onStop,\n onRetry,\n onNewChat,\n showNewChatInToolbar = true,\n messageLimit,\n inputPlaceholder = 'Ask a question...',\n inputAriaLabel = 'Message',\n inputMaxLength = 2000,\n components,\n attachments,\n onSelectAttachments,\n onRemoveAttachment,\n attachmentAccept,\n attachmentError,\n onToolApproval,\n toolbarActions,\n header,\n composerLeading,\n composerTrailing,\n composer,\n emptyState,\n className,\n style,\n}: AIChatViewProps) {\n const viewportRef = useRef<HTMLDivElement>(null);\n const pinnedToBottom = useRef(true);\n const fileInputRef = useRef<HTMLInputElement>(null);\n const approvalRef = useRef<string | null>(null);\n const [pendingApprovalId, setPendingApprovalId] = useState<string | null>(null);\n const [approvalError, setApprovalError] = useState<string | null>(null);\n const respondToApproval: AIChatToolApprovalHandler = async (id, approved) => {\n if (!onToolApproval || approvalRef.current) return;\n approvalRef.current = id;\n setPendingApprovalId(id);\n setApprovalError(null);\n try { await onToolApproval(id, approved); }\n catch { setApprovalError('Could not submit approval. Please try again.'); }\n finally { approvalRef.current = null; setPendingApprovalId(null); }\n };\n const isBusy = status === 'submitted' || status === 'streaming';\n const lastMessage = messages[messages.length - 1];\n const assistantParts = lastMessage?.role === 'assistant' ? lastMessage.parts.filter(isRecord) : [];\n const lastPart = [...assistantParts].reverse().find((part) => part.type !== 'step-start');\n const lastPartType = asString(lastPart?.type) ?? '';\n const activeTool = (lastPartType.startsWith('tool-') || lastPartType === 'dynamic-tool')\n && lastPart?.state !== 'output-available' && lastPart?.state !== 'output-error'\n ? lastPart : undefined;\n const hasAnswer = assistantParts.some((part) => part.type === 'text' && Boolean(asString(part.text)?.trim()));\n const showActivity = isBusy && (!hasAnswer || Boolean(activeTool));\n const toolName = asString(activeTool?.toolName) ?? lastPartType.replace(/^tool-/, '');\n const approval = activeTool?.approval;\n const approved = isRecord(approval) && approval.approved === true;\n const currentActivityLabel = resolveChatActivityLabel({\n toolName: activeTool ? toolName : undefined,\n toolState: asString(activeTool?.state),\n approved,\n toolActivityLabels,\n activityLabel,\n });\n const limit = messageLimit != null && Number.isFinite(messageLimit)\n ? Math.max(1, Math.floor(messageLimit)) : null;\n const historyFull = limit !== null && messages.filter((message) => message.role === 'user').length >= limit;\n const MessageRenderer = components?.MessageRenderer ?? DefaultMessageRenderer;\n const ErrorRenderer = components?.ErrorRenderer ?? DefaultErrorRenderer;\n\n // Follow streaming text only if the user is already near the bottom.\n useEffect(() => {\n const viewport = viewportRef.current;\n if (viewport && pinnedToBottom.current) viewport.scrollTop = viewport.scrollHeight;\n });\n\n const handleKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (event.key === 'Enter' && !event.shiftKey && !event.nativeEvent.isComposing) {\n event.preventDefault();\n if (!isBusy && !historyFull && !error && (draft.trim() || (attachments?.length ?? 0) > 0)) onSend?.();\n }\n };\n\n const handleFormSubmit = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!isBusy && !historyFull && !error && (draft.trim() || (attachments?.length ?? 0) > 0)) onSend?.();\n };\n\n return (\n <div className={[styles.thread, className].filter(Boolean).join(' ')} style={style}>\n {header}\n {(toolbarActions || (showNewChatInToolbar && onNewChat && messages.length > 0)) && (\n <div className={styles.chatToolbar} role=\"toolbar\" aria-label=\"Conversation actions\">\n <div className={styles.chatToolbarExtras}>{toolbarActions}</div>\n {showNewChatInToolbar && onNewChat && messages.length > 0 && (\n <button\n type=\"button\"\n className={styles.newChatButton}\n onClick={onNewChat}\n aria-label=\"New chat\"\n title=\"New chat\"\n >\n <svg aria-hidden=\"true\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6\" />\n <path d=\"m15 5 4 4M13 11l7-7a2.12 2.12 0 0 1 3 3l-7 7-4 1 1-4Z\" transform=\"translate(-2 -2)\" />\n </svg>\n </button>\n )}\n </div>\n )}\n <div\n ref={viewportRef}\n className={styles.viewport}\n onScroll={(event) => {\n const viewport = event.currentTarget;\n pinnedToBottom.current = viewport.scrollHeight - viewport.scrollTop - viewport.clientHeight < 80;\n }}\n >\n <div className={styles.messageList} role=\"log\" aria-label=\"Chat history\" aria-live=\"polite\">\n {messages.length === 0 && (\n <div className={styles.emptyState}>\n {emptyState ?? <p>Start a conversation</p>}\n </div>\n )}\n {messages.map((message) => (\n <MessageRenderer\n key={message.id}\n message={message}\n renderMessagePart={(part, index) => renderPart(part, index, components, onToolApproval ? respondToApproval : undefined, pendingApprovalId)}\n onToolApproval={onToolApproval ? respondToApproval : undefined}\n />\n ))}\n {showActivity && (\n <div className={styles.activityBubble} role=\"status\" aria-label={currentActivityLabel}>\n <span className={styles.activityDots} aria-hidden=\"true\"><i /><i /><i /></span>\n <span>{currentActivityLabel}</span>\n </div>\n )}\n {error && (\n onRetry && onNewChat ? (\n <ErrorRenderer error={error} onRetry={onRetry} onClear={onNewChat} />\n ) : (\n <div className={styles.error} role=\"alert\">\n <p>{error.message}</p>\n {(onRetry || onNewChat) && (\n <div className={styles.errorActions}>\n {onRetry && <button type=\"button\" onClick={onRetry}>Retry response</button>}\n {onNewChat && <button type=\"button\" onClick={onNewChat}>Start new chat</button>}\n </div>\n )}\n </div>\n )\n )}\n </div>\n </div>\n <div className={styles.footer}>\n {approvalError && <p role=\"alert\" className={styles.attachmentError}>{approvalError}</p>}\n {attachmentError && <p role=\"alert\" className={styles.attachmentError}>{attachmentError}</p>}\n {historyFull && !error && !isBusy && onNewChat && (\n <div className={styles.historyLimit}>\n <span>This chat has reached its {limit}-question limit.</span>\n <button type=\"button\" onClick={onNewChat}>Start new chat</button>\n </div>\n )}\n {(!historyFull || isBusy) && !error && (\n composer !== undefined ? composer : (\n <form className={styles.composerForm} onSubmit={handleFormSubmit}>\n {composerLeading && <div className={styles.composerExtras}>{composerLeading}</div>}\n {onSelectAttachments && (\n <input\n ref={fileInputRef}\n className={styles.visuallyHidden}\n type=\"file\"\n aria-label=\"Add attachments\"\n accept={attachmentAccept}\n multiple\n disabled={isBusy}\n onChange={(event) => {\n if (event.target.files) onSelectAttachments(event.target.files);\n event.target.value = '';\n }}\n />\n )}\n {attachments && attachments.length > 0 && (\n <div className={styles.composerExtras}>\n <ul className={styles.attachmentList} aria-label=\"Attached files\">\n {attachments.map((attachment, index) => (\n <li key={index}>\n <AIChatAttachmentPreview name={attachment.name} size={attachment.size} staged\n imageUrl={attachment.previewUrl}\n onRemove={onRemoveAttachment ? () => onRemoveAttachment(index) : undefined} />\n </li>\n ))}\n </ul>\n </div>\n )}\n <div className={styles.composerSurface}>\n <div className={styles.composerRow}>\n {onSelectAttachments && (\n <button type=\"button\" className={styles.composerIconButton}\n aria-label=\"Attach file\" title=\"Attach file\"\n disabled={isBusy} onClick={() => fileInputRef.current?.click()}>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"m21 11-8.5 8.5a6 6 0 0 1-8.5-8.5l9-9a4 4 0 0 1 5.7 5.7l-9 9a2 2 0 0 1-2.8-2.8l8.5-8.5\" />\n </svg>\n </button>\n )}\n <textarea\n className={styles.input}\n aria-label={inputAriaLabel}\n rows={1}\n value={draft}\n onChange={(event) => onDraftChange?.(event.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={inputPlaceholder}\n maxLength={inputMaxLength}\n disabled={isBusy || !onSend || !onDraftChange}\n readOnly={!onDraftChange}\n />\n <div className={styles.composerActions}>\n {composerTrailing}\n {isBusy ? (\n onStop && <button type=\"button\" className={styles.composerIconButton} onClick={onStop}\n aria-label=\"Stop response\" title=\"Stop response\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\"><rect x=\"5\" y=\"5\" width=\"14\" height=\"14\" rx=\"2\" /></svg>\n </button>\n ) : (\n <button type=\"submit\" className={styles.sendButton} aria-label=\"Send message\"\n title=\"Send message\" disabled={!onSend || (!draft.trim() && !attachments?.length)}>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M12 19V5m-7 7 7-7 7 7\" /></svg>\n </button>\n )}\n </div>\n </div>\n </div>\n </form>\n )\n )}\n </div>\n </div>\n );\n}\n\nexport { AIChatAttachmentPreview, AIChatMessageBubble } from './AIChatParts';\nexport type { AIChatAttachmentPreviewProps, AIChatMessageBubbleProps } from './AIChatParts';\n"],"mappings":";;;;;;;;;AA2LA,IAAM,wBAAwB;AAE9B,SAAgB,OAAO,EACrB,KACA,OACA,YACA,OAAO,cACP,SACA,aACA,4BACA,YACA,eAAe,uBACf,mBAAmB,qBACnB,iBAAiB,WACjB,iBAAiB,KACjB,YACA,gBACA,uBAAuB,MACvB,mBACA,aACA,eACA,oB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