@arbidocs/blocks 0.4.51 → 0.4.52

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.
Files changed (37) hide show
  1. package/dist/agents/index.cjs +223 -223
  2. package/dist/agents/index.js +4 -4
  3. package/dist/chat/index.cjs +122 -122
  4. package/dist/chat/index.js +2 -2
  5. package/dist/{chunk-6H7KMKKG.cjs → chunk-553WJJIZ.cjs} +4 -4
  6. package/dist/{chunk-6H7KMKKG.cjs.map → chunk-553WJJIZ.cjs.map} +1 -1
  7. package/dist/{chunk-SRFMVYX3.js → chunk-CGNTPOWQ.js} +14 -15
  8. package/dist/chunk-CGNTPOWQ.js.map +1 -0
  9. package/dist/{chunk-PUWWLMYU.js → chunk-E3NM576Y.js} +3 -3
  10. package/dist/{chunk-PUWWLMYU.js.map → chunk-E3NM576Y.js.map} +1 -1
  11. package/dist/{chunk-4S23QXYU.cjs → chunk-FVN2EWAV.cjs} +13 -14
  12. package/dist/chunk-FVN2EWAV.cjs.map +1 -0
  13. package/dist/{chunk-6EBM46XG.js → chunk-KGLGXGHW.js} +5 -5
  14. package/dist/{chunk-6EBM46XG.js.map → chunk-KGLGXGHW.js.map} +1 -1
  15. package/dist/{chunk-IUBN7EGJ.js → chunk-QSVRKNPK.js} +3 -3
  16. package/dist/{chunk-IUBN7EGJ.js.map → chunk-QSVRKNPK.js.map} +1 -1
  17. package/dist/{chunk-IKBAPNYK.cjs → chunk-RECFQQ43.cjs} +5 -5
  18. package/dist/{chunk-IKBAPNYK.cjs.map → chunk-RECFQQ43.cjs.map} +1 -1
  19. package/dist/{chunk-U736MI2I.cjs → chunk-SA2BVHQ5.cjs} +5 -5
  20. package/dist/{chunk-U736MI2I.cjs.map → chunk-SA2BVHQ5.cjs.map} +1 -1
  21. package/dist/connect/index.cjs +11 -11
  22. package/dist/connect/index.js +2 -2
  23. package/dist/facts/index.cjs +2 -2
  24. package/dist/facts/index.js +2 -2
  25. package/dist/files/index.cjs +2 -2
  26. package/dist/files/index.js +2 -2
  27. package/dist/index.cjs +678 -678
  28. package/dist/index.js +12 -12
  29. package/dist/settings/index.cjs +1 -1
  30. package/dist/settings/index.js +1 -1
  31. package/dist/shell/index.cjs +9 -9
  32. package/dist/shell/index.js +1 -1
  33. package/dist/studio/index.cjs +3 -3
  34. package/dist/studio/index.js +2 -2
  35. package/package.json +4 -4
  36. package/dist/chunk-4S23QXYU.cjs.map +0 -1
  37. package/dist/chunk-SRFMVYX3.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- export { AssistantToaster, BranchControls, ComposerAccessories, ComposerTools, ContextActionButton, ContextCheckRow, ContextPanelContent, ContextPanelFooter, ContextPanelTabs, ContextPickerList, ContextPickerRow, ContextSearchInput, ContextSelectList, ContextSelectRow, Conversation, ConversationBody, ConversationHeader, ConversationHeaderActions, ConversationHistoryPane, ConversationLoading, ConversationMain, ConversationRoot, ConversationSearchView, ConversationSettingsButton, DEFAULT_BRANCH_CONTROLS_LABELS, DEFAULT_CONVERSATION_LAYOUT_LABELS, DEFAULT_CONVERSATION_PARTS_LABELS, DEFAULT_CONVERSATION_SEARCH_LABELS, DEFAULT_LABEL_PIN_ROW_LABELS, DEFAULT_MODEL_PRICING_TIP_LABELS, DEFAULT_PENDING_ANSWER_BAR_LABELS, DEFAULT_PINNED_DOC_CHIP_LABELS, DEFAULT_SLASH_MENU_LABELS, DEFAULT_THREAD_MAP_LABELS, LabelPinRow, ModelAutoIcon, ModelConfigureButton, ModelDot, ModelMenuDivider, ModelMenuMessage, ModelOption, ModelOptionLabel, ModelPickerPopover, ModelPickerTrigger, ModelPricingTip, ModelTierIcon, ModelTierOption, ModelTriggerContent, NewChatButton, NewPaChatButton, PaModeBadge, PendingAnswerBar, PinnedDocChip, SlashMenu, ThreadMap, ThreadMapDiagram, ThreadMapError, ThreadMapLoading, getParticipantTints, hasMessageBody, isLongPastedText, useDismissibleCard, useLongPaste, useRecipientDraft } from '../chunk-PUWWLMYU.js';
3
- export { AssistantDock, AssistantDockToggle, AssistantModeToggle, ChatDocuments, ChatMessageContent, ChatPage, ChatThreadList, ChatThreadSelect, CitationMark, Composer, ComposerBranchingNotice, ComposerContainer, ComposerDock, ComposerFrame, ComposerInput, ComposerRoot, ComposerSend, ComposerToolbar, ComposerVoiceButton, ContextChip, ConversationEmpty, DEFAULT_ASSISTANT_MODE_TOGGLE_LABELS, DEFAULT_CHAT_PAGE_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_CONVERSATION_EMPTY_LABELS, DEFAULT_MESSAGE_ALERT_LABELS, DEFAULT_MESSAGE_LABELS, DEFAULT_MESSAGE_LIST_LABELS, Message, MessageActionButton, MessageActionMenu, MessageAlert, MessageBody, MessageBubble, MessageByline, MessageContent, MessageFooter, MessageList, MessageListBanner, MessageListEmpty, MessageListRoot, MessageListRow, MessageListRows, MessageListStatus, MessageListTail, MessageNarration, MessageRoot, MessageSources, MessageSubagentBadge, ScrollToBottom, SourceChip, toSpeakableText, useAssistantDock, useChatSurface, useRegisterEmbeddedChat, useStreamAnnouncement } from '../chunk-SRFMVYX3.js';
2
+ export { AssistantToaster, BranchControls, ComposerAccessories, ComposerTools, ContextActionButton, ContextCheckRow, ContextPanelContent, ContextPanelFooter, ContextPanelTabs, ContextPickerList, ContextPickerRow, ContextSearchInput, ContextSelectList, ContextSelectRow, Conversation, ConversationBody, ConversationHeader, ConversationHeaderActions, ConversationHistoryPane, ConversationLoading, ConversationMain, ConversationRoot, ConversationSearchView, ConversationSettingsButton, DEFAULT_BRANCH_CONTROLS_LABELS, DEFAULT_CONVERSATION_LAYOUT_LABELS, DEFAULT_CONVERSATION_PARTS_LABELS, DEFAULT_CONVERSATION_SEARCH_LABELS, DEFAULT_LABEL_PIN_ROW_LABELS, DEFAULT_MODEL_PRICING_TIP_LABELS, DEFAULT_PENDING_ANSWER_BAR_LABELS, DEFAULT_PINNED_DOC_CHIP_LABELS, DEFAULT_SLASH_MENU_LABELS, DEFAULT_THREAD_MAP_LABELS, LabelPinRow, ModelAutoIcon, ModelConfigureButton, ModelDot, ModelMenuDivider, ModelMenuMessage, ModelOption, ModelOptionLabel, ModelPickerPopover, ModelPickerTrigger, ModelPricingTip, ModelTierIcon, ModelTierOption, ModelTriggerContent, NewChatButton, NewPaChatButton, PaModeBadge, PendingAnswerBar, PinnedDocChip, SlashMenu, ThreadMap, ThreadMapDiagram, ThreadMapError, ThreadMapLoading, getParticipantTints, hasMessageBody, isLongPastedText, useDismissibleCard, useLongPaste, useRecipientDraft } from '../chunk-E3NM576Y.js';
3
+ export { AssistantDock, AssistantDockToggle, AssistantModeToggle, ChatDocuments, ChatMessageContent, ChatPage, ChatThreadList, ChatThreadSelect, CitationMark, Composer, ComposerBranchingNotice, ComposerContainer, ComposerDock, ComposerFrame, ComposerInput, ComposerRoot, ComposerSend, ComposerToolbar, ComposerVoiceButton, ContextChip, ConversationEmpty, DEFAULT_ASSISTANT_MODE_TOGGLE_LABELS, DEFAULT_CHAT_PAGE_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_CONVERSATION_EMPTY_LABELS, DEFAULT_MESSAGE_ALERT_LABELS, DEFAULT_MESSAGE_LABELS, DEFAULT_MESSAGE_LIST_LABELS, Message, MessageActionButton, MessageActionMenu, MessageAlert, MessageBody, MessageBubble, MessageByline, MessageContent, MessageFooter, MessageList, MessageListBanner, MessageListEmpty, MessageListRoot, MessageListRow, MessageListRows, MessageListStatus, MessageListTail, MessageNarration, MessageRoot, MessageSources, MessageSubagentBadge, ScrollToBottom, SourceChip, toSpeakableText, useAssistantDock, useChatSurface, useRegisterEmbeddedChat, useStreamAnnouncement } from '../chunk-CGNTPOWQ.js';
4
4
  import '../chunk-BV7FEMSI.js';
5
5
  import '../chunk-KZJAG7T3.js';
6
6
  export { useMentionAutocomplete } from '../chunk-3VQYJBOI.js';
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunk4S23QXYU_cjs = require('./chunk-4S23QXYU.cjs');
4
+ var chunkFVN2EWAV_cjs = require('./chunk-FVN2EWAV.cjs');
5
5
  var chunkTLQQV7WW_cjs = require('./chunk-TLQQV7WW.cjs');
6
6
  var react$1 = require('react');
7
7
  var react = require('@arbidocs/react');
@@ -61,7 +61,7 @@ function useConnectedChat(options) {
61
61
  }
62
62
  function ConnectedAssistantDock(props) {
63
63
  const chat = useConnectedChat();
64
- return /* @__PURE__ */ jsxRuntime.jsx(chunk4S23QXYU_cjs.AssistantDock, { ...props, chat });
64
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkFVN2EWAV_cjs.AssistantDock, { ...props, chat });
65
65
  }
66
66
 
67
67
  Object.defineProperty(exports, "redlineStats", {
@@ -81,5 +81,5 @@ exports.useConnectedAiTask = useConnectedAiTask;
81
81
  exports.useConnectedChat = useConnectedChat;
82
82
  exports.useSemanticSearch = useSemanticSearch;
83
83
  exports.useWorkspaceDocs = useWorkspaceDocs;
84
- //# sourceMappingURL=chunk-6H7KMKKG.cjs.map
85
- //# sourceMappingURL=chunk-6H7KMKKG.cjs.map
84
+ //# sourceMappingURL=chunk-553WJJIZ.cjs.map
85
+ //# sourceMappingURL=chunk-553WJJIZ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/ai.tsx"],"names":["useConnection","useKitAiTask","useCallback","useKitWorkspaceDocs","useKitSemanticSearch","useWorkspaceUsers","useArbiChat","jsx","AssistantDock"],"mappings":";;;;;;;;AAgCO,SAAS,kBAAA,GAAqB;AACnC,EAAA,MAAM,EAAE,eAAA,EAAgB,GAAIA,+BAAA,EAAc;AAC1C,EAAA,MAAM,OAAOC,eAAA,EAAa;AAC1B,EAAA,MAAM,SAAS,IAAA,CAAK,GAAA;AACpB,EAAA,MAAM,GAAA,GAAMC,mBAAA;AAAA,IACV,CAAC,QAAA,EAAkB,MAAA,EAAkB,IAAA,KACnC,OAAO,QAAA,EAAU,MAAA,EAAQ,EAAE,GAAG,IAAA,EAAM,KAAA,EAAO,IAAA,EAAM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in adapters over the reusable AI kit in\n * `@arbidocs/react`. The streaming/accumulation/search plumbing lives once in\n * the SDK; these hooks only bind the *workspace source* (from the connection\n * context, falling back to the configured workspace) and inject the host's\n * default assistant *configuration* so call sites needn't know the config\n * ext_id. An explicit `opts.model` still wins.\n */\nimport { useCallback } from 'react'\nimport {\n useAiTask as useKitAiTask,\n useWorkspaceDocs as useKitWorkspaceDocs,\n useSemanticSearch as useKitSemanticSearch,\n useArbiChat,\n useWorkspaceUsers,\n type ArbiChat,\n type UseArbiChatOptions,\n type AiRunOptions,\n} from '@arbidocs/react'\nimport { useConnection } from './ConnectionProvider'\nimport { AssistantDock, type AssistantDockProps } from '../chat/AssistantDock'\nimport type { MentionCandidate } from '../chat/mentions'\n\nexport type { AiTaskStatus, AiRunOptions, SearchChunk, ArtifactEvent } from '@arbidocs/react'\n\n/** Client-side redlining, re-exported so a host app has one import surface. */\nexport { toRedlineMarkdown, redlineStats, textToArtifact } from '@arbidocs/react'\n\n/**\n * The kit's `useAiTask` with the host's default assistant configuration\n * injected, so call sites needn't know the config ext_id.\n */\nexport function useConnectedAiTask() {\n const { assistantConfig } = useConnection()\n const task = useKitAiTask()\n const kitRun = task.run\n const run = useCallback(\n (question: string, docIds: string[], opts?: AiRunOptions) =>\n kitRun(question, docIds, { ...opts, model: opts?.model ?? assistantConfig }),\n [kitRun, assistantConfig]\n )\n return { ...task, run }\n}\n\n/** Resolve the active workspace + its document ids (what we ground the agent on). */\nexport function useWorkspaceDocs() {\n const { workspaceId, fallbackWorkspaceId } = useConnection()\n return useKitWorkspaceDocs(workspaceId ?? fallbackWorkspaceId)\n}\n\n/** Search the active workspace's documents and return the top matching passages. */\nexport function useSemanticSearch() {\n const { docIds } = useWorkspaceDocs()\n return useKitSemanticSearch(docIds)\n}\n\n/**\n * The chat controller for `ChatPage` bound to the connection: the active workspace and the host's\n * default assistant configuration are injected, so a host writes\n * `<ChatPage chat={useConnectedChat()} />`.\n */\nexport function useConnectedChat(\n options?: Omit<UseArbiChatOptions, 'workspaceId'>\n): ArbiChat & { mentionCandidates: MentionCandidate[] } {\n const { workspaceId, fallbackWorkspaceId, assistantConfig, user, status, ensureWorkspaceOpen } =\n useConnection()\n const wsId = workspaceId ?? fallbackWorkspaceId\n const { data: members = [] } = useWorkspaceUsers(wsId, {\n enabled: status === 'authenticated' && !!wsId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const mentionCandidates: MentionCandidate[] = [\n { id: 'assistant', kind: 'assistant', label: 'Assistant' },\n ...(status === 'authenticated' ? members : [])\n .filter(\n (member) =>\n !member.agent_ext_id &&\n member.user.external_id !== user?.externalId &&\n !member.user.external_id.startsWith('agt-')\n )\n .map((member) => ({\n id: member.user.external_id,\n kind: 'user' as const,\n label:\n [member.user.given_name, member.user.family_name].filter(Boolean).join(' ') ||\n member.user.email,\n description: member.user.email,\n }))\n .sort((a, b) => a.label.localeCompare(b.label)),\n ]\n const chat = useArbiChat({\n ...options,\n workspaceId: workspaceId ?? fallbackWorkspaceId,\n model: options?.model ?? assistantConfig,\n })\n return {\n ...chat,\n mentionCandidates,\n messages: chat.messages.map((message) => ({\n ...message,\n ...(message.authorId\n ? {\n senderName:\n message.authorId === user?.externalId\n ? user?.name || user?.email\n : mentionCandidates.find((candidate) => candidate.id === message.authorId)?.label,\n }\n : {}),\n })),\n }\n}\n\n/**\n * The assistant dock bound to the connection: mount it once in the layout (`Shell.Root`'s `aside`)\n * and put `AssistantDockToggle` in the topbar. Chat state lives here, so it survives closing the dock.\n */\nexport function ConnectedAssistantDock(props: Omit<AssistantDockProps, 'chat'>) {\n const chat = useConnectedChat()\n return <AssistantDock {...props} chat={chat} />\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/ai.tsx"],"names":["useConnection","useKitAiTask","useCallback","useKitWorkspaceDocs","useKitSemanticSearch","useWorkspaceUsers","useArbiChat","jsx","AssistantDock"],"mappings":";;;;;;;;AAgCO,SAAS,kBAAA,GAAqB;AACnC,EAAA,MAAM,EAAE,eAAA,EAAg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AA,EAAG;AAAA,UAElF;AAAC,KACP,CAAE;AAAA,GACJ;AACF;AAMO,SAAS,uBAAuB,KAAA,EAAyC;AAC9E,EAAA,MAAM,OAAO,gBAAA,EAAiB;AAC9B,EAAA,uBAAOC,cAAA,CAACC,+BAAA,EAAA,EAAe,GAAG,KAAA,EAAO,IAAA,EAAY,CAAA;AAC/C","file":"chunk-553WJJIZ.cjs","sourcesContent":["/**\n * The connected agent hooks — thin adapters over the reusable AI kit in\n * `@arbidocs/react`. The streaming/accumulation/search plumbing lives once in\n * the SDK; these hooks only bind the *workspace source* (from the connection\n * context, falling back to the configured workspace) and inject the host's\n * default assistant *configuration* so call sites needn't know the config\n * ext_id. An explicit `opts.model` still wins.\n */\nimport { useCallback } from 'react'\nimport {\n useAiTask as useKitAiTask,\n useWorkspaceDocs as useKitWorkspaceDocs,\n useSemanticSearch as useKitSemanticSearch,\n useArbiChat,\n useWorkspaceUsers,\n type ArbiChat,\n type UseArbiChatOptions,\n type AiRunOptions,\n} from '@arbidocs/react'\nimport { useConnection } from './ConnectionProvider'\nimport { AssistantDock, type AssistantDockProps } from '../chat/AssistantDock'\nimport type { MentionCandidate } from '../chat/mentions'\n\nexport type { AiTaskStatus, AiRunOptions, SearchChunk, ArtifactEvent } from '@arbidocs/react'\n\n/** Client-side redlining, re-exported so a host app has one import surface. */\nexport { toRedlineMarkdown, redlineStats, textToArtifact } from '@arbidocs/react'\n\n/**\n * The kit's `useAiTask` with the host's default assistant configuration\n * injected, so call sites needn't know the config ext_id.\n */\nexport function useConnectedAiTask() {\n const { assistantConfig } = useConnection()\n const task = useKitAiTask()\n const kitRun = task.run\n const run = useCallback(\n (question: string, docIds: string[], opts?: AiRunOptions) =>\n kitRun(question, docIds, { ...opts, model: opts?.model ?? assistantConfig }),\n [kitRun, assistantConfig]\n )\n return { ...task, run }\n}\n\n/** Resolve the active workspace + its document ids (what we ground the agent on). */\nexport function useWorkspaceDocs() {\n const { workspaceId, fallbackWorkspaceId } = useConnection()\n return useKitWorkspaceDocs(workspaceId ?? fallbackWorkspaceId)\n}\n\n/** Search the active workspace's documents and return the top matching passages. */\nexport function useSemanticSearch() {\n const { docIds } = useWorkspaceDocs()\n return useKitSemanticSearch(docIds)\n}\n\n/**\n * The chat controller for `ChatPage` bound to the connection: the active workspace and the host's\n * default assistant configuration are injected, so a host writes\n * `<ChatPage chat={useConnectedChat()} />`.\n */\nexport function useConnectedChat(\n options?: Omit<UseArbiChatOptions, 'workspaceId'>\n): ArbiChat & { mentionCandidates: MentionCandidate[] } {\n const { workspaceId, fallbackWorkspaceId, assistantConfig, user, status, ensureWorkspaceOpen } =\n useConnection()\n const wsId = workspaceId ?? fallbackWorkspaceId\n const { data: members = [] } = useWorkspaceUsers(wsId, {\n enabled: status === 'authenticated' && !!wsId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const mentionCandidates: MentionCandidate[] = [\n { id: 'assistant', kind: 'assistant', label: 'Assistant' },\n ...(status === 'authenticated' ? members : [])\n .filter(\n (member) =>\n !member.agent_ext_id &&\n member.user.external_id !== user?.externalId &&\n !member.user.external_id.startsWith('agt-')\n )\n .map((member) => ({\n id: member.user.external_id,\n kind: 'user' as const,\n label:\n [member.user.given_name, member.user.family_name].filter(Boolean).join(' ') ||\n member.user.email,\n description: member.user.email,\n }))\n .sort((a, b) => a.label.localeCompare(b.label)),\n ]\n const chat = useArbiChat({\n ...options,\n workspaceId: workspaceId ?? fallbackWorkspaceId,\n model: options?.model ?? assistantConfig,\n })\n return {\n ...chat,\n mentionCandidates,\n messages: chat.messages.map((message) => ({\n ...message,\n ...(message.authorId\n ? {\n senderName:\n message.authorId === user?.externalId\n ? user?.name || user?.email\n : mentionCandidates.find((candidate) => candidate.id === message.authorId)?.label,\n }\n : {}),\n })),\n }\n}\n\n/**\n * The assistant dock bound to the connection: mount it once in the layout (`Shell.Root`'s `aside`)\n * and put `AssistantDockToggle` in the topbar. Chat state lives here, so it survives closing the dock.\n */\nexport function ConnectedAssistantDock(props: Omit<AssistantDockProps, 'chat'>) {\n const chat = useConnectedChat()\n return <AssistantDock {...props} chat={chat} />\n}\n"]}
@@ -5,7 +5,7 @@ import { observeResize } from './chunk-NPLYHR2E.js';
5
5
  import { formatCount } from './chunk-OXF2IFXG.js';
6
6
  import { MentionMenu, toMessageMentions, extractMentions } from './chunk-AA3PT6KR.js';
7
7
  import { testIdOr } from './chunk-7F6CBP3Z.js';
8
- import { forwardRef, useState, useRef, useEffect, useMemo, useCallback, useSyncExternalStore, useLayoutEffect } from 'react';
8
+ import { forwardRef, useState, useRef, useCallback, useEffect, useMemo, useSyncExternalStore, useLayoutEffect } from 'react';
9
9
  import { FileText, ChevronDown, Pencil, Sparkles, ChevronUp, MoreHorizontal, RotateCw, AlertCircle, ArrowLeft, Edit3, Send, Loader2, Square, Mic, ArrowDown, MessagesSquare, Bot, GanttChartSquare, ArrowUpRight, Upload, MessageSquarePlus, Trash2, PanelRight, MessageSquare, X, FileUp } from 'lucide-react';
10
10
  import { cn, Textarea, Button, PopoverTrigger, Popover, PopoverAnchor, PopoverContent, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem, Tooltip, TooltipTrigger, TooltipContent, MarkdownRenderer, closeOpenEmphasis, trimOpenCitation } from '@arbidocs/react/ui';
11
11
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -103,16 +103,7 @@ var MessageBubble = forwardRef(function MessageBubble2({
103
103
  ...style
104
104
  },
105
105
  ...rest,
106
- children: /* @__PURE__ */ jsx(
107
- "div",
108
- {
109
- className: cn(
110
- isUser ? "px-4 py-2.5" : "px-4 py-3 sm:pl-9 sm:pr-0",
111
- isQueued && "opacity-70"
112
- ),
113
- children
114
- }
115
- )
106
+ children: /* @__PURE__ */ jsx("div", { className: cn(isUser ? "px-4 py-2.5" : "px-4 py-3 sm:pl-9", isQueued && "opacity-70"), children })
116
107
  }
117
108
  );
118
109
  });
@@ -288,6 +279,7 @@ function MessageSources({
288
279
  }
289
280
  );
290
281
  }
282
+ var CONVERSATION_HEADER_SELECTOR = '[data-slot="conversation-header"]';
291
283
  function MessageFooter({
292
284
  role,
293
285
  leading,
@@ -301,9 +293,15 @@ function MessageFooter({
301
293
  const l = { ...DEFAULT_MESSAGE_LABELS, ...labels };
302
294
  const isUser = role === "user";
303
295
  const showSteps = !isUser && !!steps && steps.count > 0;
296
+ const [headerBottom, setHeaderBottom] = useState(0);
297
+ const measureHeader = useCallback((el) => {
298
+ const header = el?.closest("[data-scroll-container]")?.querySelector(CONVERSATION_HEADER_SELECTOR);
299
+ setHeaderBottom(header?.getBoundingClientRect().bottom ?? 0);
300
+ }, []);
304
301
  const row = /* @__PURE__ */ jsxs(
305
302
  "div",
306
303
  {
304
+ ref: measureHeader,
307
305
  className: cn(
308
306
  "flex items-center text-sm",
309
307
  isUser ? "justify-end gap-2 text-xs" : "justify-between"
@@ -330,7 +328,7 @@ function MessageFooter({
330
328
  "div",
331
329
  {
332
330
  className: cn(
333
- // Room for the focus ring: the bubble clips overflow and its right padding is 0.
331
+ // Room for the focus ring: the bubble clips overflow at its edge.
334
332
  "flex items-center gap-1 pr-1",
335
333
  revealActionsOnHover && "opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 has-[[data-state=open]]:opacity-100 pointer-coarse:opacity-100"
336
334
  ),
@@ -357,7 +355,8 @@ function MessageFooter({
357
355
  side: "top",
358
356
  align: "start",
359
357
  sideOffset: 8,
360
- className: "max-h-[min(60vh,32rem)] w-[var(--radix-popover-trigger-width)] overflow-y-auto rounded-lg border border-border bg-popover p-0 shadow-lg",
358
+ collisionPadding: { top: headerBottom + 8, right: 8, bottom: 8, left: 8 },
359
+ className: "max-h-[min(60vh,32rem,var(--radix-popover-content-available-height))] w-[var(--radix-popover-trigger-width)] overflow-y-auto rounded-lg border border-border bg-popover p-0 shadow-lg",
361
360
  children: steps.panel
362
361
  }
363
362
  )
@@ -2359,5 +2358,5 @@ function AssistantDock({
2359
2358
  }
2360
2359
 
2361
2360
  export { AssistantDock, AssistantDockToggle, AssistantModeToggle, ChatDocuments, ChatMessageContent, ChatPage, ChatThreadList, ChatThreadSelect, CitationMark, Composer, ComposerBranchingNotice, ComposerContainer, ComposerDock, ComposerFrame, ComposerInput, ComposerRoot, ComposerSend, ComposerToolbar, ComposerVoiceButton, ContextChip, ConversationEmpty, DEFAULT_ASSISTANT_MODE_TOGGLE_LABELS, DEFAULT_CHAT_PAGE_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_CONVERSATION_EMPTY_LABELS, DEFAULT_MESSAGE_ALERT_LABELS, DEFAULT_MESSAGE_LABELS, DEFAULT_MESSAGE_LIST_LABELS, Message, MessageActionButton, MessageActionMenu, MessageAlert, MessageBody, MessageBubble, MessageByline, MessageContent, MessageFooter, MessageList, MessageListBanner, MessageListEmpty, MessageListRoot, MessageListRow, MessageListRows, MessageListStatus, MessageListTail, MessageNarration, MessageRoot, MessageSources, MessageSubagentBadge, ScrollToBottom, SourceChip, toSpeakableText, useAssistantDock, useChatSurface, useRegisterEmbeddedChat, useStreamAnnouncement };
2362
- //# sourceMappingURL=chunk-SRFMVYX3.js.map
2363
- //# sourceMappingURL=chunk-SRFMVYX3.js.map
2361
+ //# sourceMappingURL=chunk-CGNTPOWQ.js.map
2362
+ //# sourceMappingURL=chunk-CGNTPOWQ.js.map