@8wave/ai-elements 0.111.0-beta.7 → 0.111.0-beta.8

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 (125) hide show
  1. package/dist/_chunks/{PkLazyImg-ClL4nr95.js → PkLazyImg-Dbj2dDXA.js} +2 -2
  2. package/dist/_chunks/{PkLazyImg-ClL4nr95.js.map → PkLazyImg-Dbj2dDXA.js.map} +1 -1
  3. package/dist/_chunks/{PkStreamingMarkdown-DgBS4Ebc.js → PkStreamingMarkdown-CNI8aV8t.js} +617 -418
  4. package/dist/_chunks/PkStreamingMarkdown-CNI8aV8t.js.map +1 -0
  5. package/dist/_chunks/{PkToolRequestGeolocation-pVys3x9M.js → PkToolRequestGeolocation-Bzy4IYSp.js} +2 -2
  6. package/dist/_chunks/{PkToolRequestGeolocation-pVys3x9M.js.map → PkToolRequestGeolocation-Bzy4IYSp.js.map} +1 -1
  7. package/dist/_chunks/{PkToolRequestOAuthConnection-BGChb_eC.js → PkToolRequestOAuthConnection-CWEKoD71.js} +2 -2
  8. package/dist/_chunks/{PkToolRequestOAuthConnection-BGChb_eC.js.map → PkToolRequestOAuthConnection-CWEKoD71.js.map} +1 -1
  9. package/dist/_chunks/{PkToolShowArtifact-CkTBIdQd.js → PkToolShowArtifact-CGbHDEie.js} +4 -4
  10. package/dist/_chunks/{PkToolShowArtifact-CkTBIdQd.js.map → PkToolShowArtifact-CGbHDEie.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowCalendarEvent-C41JgOUA.js → PkToolShowCalendarEvent-DIFX_rUz.js} +3 -3
  12. package/dist/_chunks/{PkToolShowCalendarEvent-C41JgOUA.js.map → PkToolShowCalendarEvent-DIFX_rUz.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowComparison-DbbUD9pg.js → PkToolShowComparison-B38hHWq2.js} +3 -3
  14. package/dist/_chunks/{PkToolShowComparison-DbbUD9pg.js.map → PkToolShowComparison-B38hHWq2.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowContactForm-Du7jX7K5.js → PkToolShowContactForm-DUw_bZiJ.js} +4 -4
  16. package/dist/_chunks/{PkToolShowContactForm-Du7jX7K5.js.map → PkToolShowContactForm-DUw_bZiJ.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowDiagram-BdmG9gm8.js → PkToolShowDiagram-Dx1Ba0PG.js} +3 -3
  18. package/dist/_chunks/{PkToolShowDiagram-BdmG9gm8.js.map → PkToolShowDiagram-Dx1Ba0PG.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowEmail-Dn3JHYIR.js → PkToolShowEmail-DnFFgzom.js} +3 -3
  20. package/dist/_chunks/{PkToolShowEmail-Dn3JHYIR.js.map → PkToolShowEmail-DnFFgzom.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowForm-Du2nk7pq.js → PkToolShowForm-CKQQltJ6.js} +5 -6
  22. package/dist/_chunks/{PkToolShowForm-Du2nk7pq.js.map → PkToolShowForm-CKQQltJ6.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowImageGallery-C1lzlO0y.js → PkToolShowImageGallery-D99N_Plf.js} +2 -2
  24. package/dist/_chunks/{PkToolShowImageGallery-C1lzlO0y.js.map → PkToolShowImageGallery-D99N_Plf.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowLocation-CKhPxKFA.js → PkToolShowLocation-AfnrtFVJ.js} +3 -3
  26. package/dist/_chunks/{PkToolShowLocation-CKhPxKFA.js.map → PkToolShowLocation-AfnrtFVJ.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowMessage-U9CCU7eG.js → PkToolShowMessage-DUo2c-im.js} +3 -3
  28. package/dist/_chunks/{PkToolShowMessage-U9CCU7eG.js.map → PkToolShowMessage-DUo2c-im.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowProductList-UeiRMLHu.js → PkToolShowProductList-BN6Qk1_y.js} +3 -3
  30. package/dist/_chunks/{PkToolShowProductList-UeiRMLHu.js.map → PkToolShowProductList-BN6Qk1_y.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowQrCode-CypLrfh5.js → PkToolShowQrCode-BLqeBecX.js} +3 -3
  32. package/dist/_chunks/{PkToolShowQrCode-CypLrfh5.js.map → PkToolShowQrCode-BLqeBecX.js.map} +1 -1
  33. package/dist/_chunks/{PkToolShowSources-CsHLUF4L.js → PkToolShowSources-DpZb5FUP.js} +3 -3
  34. package/dist/_chunks/{PkToolShowSources-CsHLUF4L.js.map → PkToolShowSources-DpZb5FUP.js.map} +1 -1
  35. package/dist/_chunks/{PkToolShowSuggestedReply-D7g_qymH.js → PkToolShowSuggestedReply-C10nNgBs.js} +2 -2
  36. package/dist/_chunks/{PkToolShowSuggestedReply-D7g_qymH.js.map → PkToolShowSuggestedReply-C10nNgBs.js.map} +1 -1
  37. package/dist/_chunks/{PkToolShowVideo-BgKxdBcC.js → PkToolShowVideo-S9b4QHUj.js} +2 -2
  38. package/dist/_chunks/{PkToolShowVideo-BgKxdBcC.js.map → PkToolShowVideo-S9b4QHUj.js.map} +1 -1
  39. package/dist/_chunks/{PkToolShowWeather-LPd3tC77.js → PkToolShowWeather-CqhG430w.js} +2 -2
  40. package/dist/_chunks/{PkToolShowWeather-LPd3tC77.js.map → PkToolShowWeather-CqhG430w.js.map} +1 -1
  41. package/dist/_chunks/{PkToolShowWebPages-ep_erFF0.js → PkToolShowWebPages-txAZi_iG.js} +3 -3
  42. package/dist/_chunks/{PkToolShowWebPages-ep_erFF0.js.map → PkToolShowWebPages-txAZi_iG.js.map} +1 -1
  43. package/dist/_chunks/{VvCheckboxGroup.es-Bdu2gFLN.js → VvCheckboxGroup.es-CTrF3pue.js} +2 -2
  44. package/dist/_chunks/{VvCheckboxGroup.es-Bdu2gFLN.js.map → VvCheckboxGroup.es-CTrF3pue.js.map} +1 -1
  45. package/dist/_chunks/{VvCombobox.es-C0wpJIr_.js → VvCombobox.es-BWiXmQ_S.js} +10 -10
  46. package/dist/_chunks/{VvCombobox.es-C0wpJIr_.js.map → VvCombobox.es-BWiXmQ_S.js.map} +1 -1
  47. package/dist/_chunks/{VvInputText.es-Zgtw2YNw.js → VvInputText.es-Bo9I6g8H.js} +6 -6
  48. package/dist/_chunks/{VvInputText.es-Zgtw2YNw.js.map → VvInputText.es-Bo9I6g8H.js.map} +1 -1
  49. package/dist/_chunks/{VvRadioGroup.es-DZLL19SC.js → VvRadioGroup.es-9ooHCuik.js} +2 -2
  50. package/dist/_chunks/{VvRadioGroup.es-DZLL19SC.js.map → VvRadioGroup.es-9ooHCuik.js.map} +1 -1
  51. package/dist/_chunks/{VvSelect.es-ovnZRHG5.js → VvSelect.es-DG0VuWtP.js} +2 -2
  52. package/dist/_chunks/{VvSelect.es-ovnZRHG5.js.map → VvSelect.es-DG0VuWtP.js.map} +1 -1
  53. package/dist/_chunks/{VvTextarea.es-DbP5Lt2T.js → VvTextarea.es-Dg3pxdZy.js} +6 -6
  54. package/dist/_chunks/{VvTextarea.es-DbP5Lt2T.js.map → VvTextarea.es-Dg3pxdZy.js.map} +1 -1
  55. package/dist/_chunks/{dist-n5iFNYf-.js → dist-QdjZA6MJ.js} +143 -133
  56. package/dist/_chunks/{dist-n5iFNYf-.js.map → dist-QdjZA6MJ.js.map} +1 -1
  57. package/dist/_chunks/{index.es-dtdl3VFG.js → index.es-0YpCa4c5.js} +6 -6
  58. package/dist/_chunks/{index.es-dtdl3VFG.js.map → index.es-0YpCa4c5.js.map} +1 -1
  59. package/dist/_chunks/{index.es-BJnUA_36.js → index.es-CHkJ2TMJ.js} +10 -10
  60. package/dist/_chunks/{index.es-BJnUA_36.js.map → index.es-CHkJ2TMJ.js.map} +1 -1
  61. package/dist/ai-elements.es.js +1956 -1944
  62. package/dist/ai-elements.es.js.map +1 -1
  63. package/dist-vue/PkChatbot.js +1 -1
  64. package/dist-vue/PkChatbotEmptyState.js +1 -1
  65. package/dist-vue/PkChatbotInput.js +1 -1
  66. package/dist-vue/PkChatbotMessages.js +1 -1
  67. package/dist-vue/PkChatbotStepPayload.js +1 -1
  68. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  69. package/dist-vue/PkChatbotSteps.js +1 -1
  70. package/dist-vue/PkChatbotViewChat.js +1 -1
  71. package/dist-vue/_chunks/{PkChatbot-Di7R2CWN.js → PkChatbot-DE1bKmDi.js} +57 -57
  72. package/dist-vue/_chunks/{PkChatbot-Di7R2CWN.js.map → PkChatbot-DE1bKmDi.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkChatbotEmptyState-C_ITdvH7.js → PkChatbotEmptyState-BtzBYOHJ.js} +2 -2
  74. package/dist-vue/_chunks/{PkChatbotEmptyState-C_ITdvH7.js.map → PkChatbotEmptyState-BtzBYOHJ.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkChatbotInput-pEl3D2O-.js → PkChatbotInput-MSpF6SB6.js} +2 -2
  76. package/dist-vue/_chunks/{PkChatbotInput-pEl3D2O-.js.map → PkChatbotInput-MSpF6SB6.js.map} +1 -1
  77. package/dist-vue/_chunks/PkChatbotMessages-B6ONEJnZ.js +776 -0
  78. package/dist-vue/_chunks/PkChatbotMessages-B6ONEJnZ.js.map +1 -0
  79. package/dist-vue/_chunks/{PkChatbotStepPayload-BH6piqOi.js → PkChatbotStepPayload-XW4gT9AZ.js} +2 -2
  80. package/dist-vue/_chunks/{PkChatbotStepPayload-BH6piqOi.js.map → PkChatbotStepPayload-XW4gT9AZ.js.map} +1 -1
  81. package/dist-vue/_chunks/{PkChatbotStepToolDetail-BJ7xUvgi.js → PkChatbotStepToolDetail-C4-K6Glw.js} +3 -3
  82. package/dist-vue/_chunks/{PkChatbotStepToolDetail-BJ7xUvgi.js.map → PkChatbotStepToolDetail-C4-K6Glw.js.map} +1 -1
  83. package/dist-vue/_chunks/PkChatbotSteps-CrqjWpv0.js +190 -0
  84. package/dist-vue/_chunks/PkChatbotSteps-CrqjWpv0.js.map +1 -0
  85. package/dist-vue/_chunks/{PkChatbotViewChat-DT-rAU_r.js → PkChatbotViewChat-BMQtx1Gi.js} +9 -9
  86. package/dist-vue/_chunks/{PkChatbotViewChat-DT-rAU_r.js.map → PkChatbotViewChat-BMQtx1Gi.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkStreamingMarkdown-DIaZEedG.js → PkStreamingMarkdown-D0IOaETI.js} +362 -359
  88. package/dist-vue/_chunks/PkStreamingMarkdown-D0IOaETI.js.map +1 -0
  89. package/dist-vue/_chunks/{PkToolShowArtifact-BCCUucVQ.js → PkToolShowArtifact-DHdJuzDi.js} +2 -2
  90. package/dist-vue/_chunks/{PkToolShowArtifact-BCCUucVQ.js.map → PkToolShowArtifact-DHdJuzDi.js.map} +1 -1
  91. package/dist-vue/_chunks/{PkToolShowContactForm-BXGxWSc2.js → PkToolShowContactForm-BB2X4UdQ.js} +2 -2
  92. package/dist-vue/_chunks/{PkToolShowContactForm-BXGxWSc2.js.map → PkToolShowContactForm-BB2X4UdQ.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkToolShowDiagram-CZgrWvBr.js → PkToolShowDiagram-BH6ihikd.js} +2 -2
  94. package/dist-vue/_chunks/{PkToolShowDiagram-CZgrWvBr.js.map → PkToolShowDiagram-BH6ihikd.js.map} +1 -1
  95. package/dist-vue/_chunks/{PkToolShowEmail-DpC517Vn.js → PkToolShowEmail-DF__nKpR.js} +2 -2
  96. package/dist-vue/_chunks/{PkToolShowEmail-DpC517Vn.js.map → PkToolShowEmail-DF__nKpR.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkToolShowForm-CIZpfAGK.js → PkToolShowForm-DUKIyj9V.js} +5 -5
  98. package/dist-vue/_chunks/{PkToolShowForm-CIZpfAGK.js.map → PkToolShowForm-DUKIyj9V.js.map} +1 -1
  99. package/dist-vue/_chunks/{PkToolShowMessage-B7flxVCU.js → PkToolShowMessage-Ck6VP-gw.js} +2 -2
  100. package/dist-vue/_chunks/{PkToolShowMessage-B7flxVCU.js.map → PkToolShowMessage-Ck6VP-gw.js.map} +1 -1
  101. package/dist-vue/_chunks/{PkToolShowProductList-B6fRtIpx.js → PkToolShowProductList-zfM8cx-l.js} +2 -2
  102. package/dist-vue/_chunks/{PkToolShowProductList-B6fRtIpx.js.map → PkToolShowProductList-zfM8cx-l.js.map} +1 -1
  103. package/dist-vue/_chunks/{PkToolShowSources-DDZokZow.js → PkToolShowSources-Dlaz2Y77.js} +3 -3
  104. package/dist-vue/_chunks/{PkToolShowSources-DDZokZow.js.map → PkToolShowSources-Dlaz2Y77.js.map} +1 -1
  105. package/dist-vue/_chunks/{PkToolShowWebPages-DY48ee6V.js → PkToolShowWebPages-CosBYLrE.js} +2 -2
  106. package/dist-vue/_chunks/{PkToolShowWebPages-DY48ee6V.js.map → PkToolShowWebPages-CosBYLrE.js.map} +1 -1
  107. package/dist-vue/_chunks/{PkUrl-DSGxrEM7.js → PkUrl-B5CNTQj9.js} +2 -2
  108. package/dist-vue/_chunks/{PkUrl-DSGxrEM7.js.map → PkUrl-B5CNTQj9.js.map} +1 -1
  109. package/dist-vue/_chunks/{utils-Coqik0XI.js → utils-C1666_6C.js} +58 -43
  110. package/dist-vue/_chunks/utils-C1666_6C.js.map +1 -0
  111. package/dist-vue/composables.js +1 -1
  112. package/dist-vue/index.js +38 -38
  113. package/dist-vue/packages/components/src/chat/PkStreamingMarkdown.d.ts +6 -0
  114. package/dist-vue/packages/components/src/chat/PkStreamingMarkdownAutoscroll.d.ts +1 -0
  115. package/dist-vue/packages/components/src/chat/utils.d.ts +16 -0
  116. package/package.json +1 -1
  117. package/dist/_chunks/PkStreamingMarkdown-DgBS4Ebc.js.map +0 -1
  118. package/dist/_chunks/utils-YJ0ZOLDG.js +0 -185
  119. package/dist/_chunks/utils-YJ0ZOLDG.js.map +0 -1
  120. package/dist-vue/_chunks/PkChatbotMessages-CGALOKwe.js +0 -771
  121. package/dist-vue/_chunks/PkChatbotMessages-CGALOKwe.js.map +0 -1
  122. package/dist-vue/_chunks/PkChatbotSteps-BhFupvbz.js +0 -180
  123. package/dist-vue/_chunks/PkChatbotSteps-BhFupvbz.js.map +0 -1
  124. package/dist-vue/_chunks/PkStreamingMarkdown-DIaZEedG.js.map +0 -1
  125. package/dist-vue/_chunks/utils-Coqik0XI.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-C1666_6C.js","names":[],"sources":["../../../../packages/components/src/chat/utils.ts"],"sourcesContent":["import type { UIMessage } from 'ai'\nimport {\n isTextPart,\n isFilePart,\n isToolPart,\n isReasoningPart,\n hasPartText,\n hasTextPart,\n getTextPart,\n getMessageText,\n} from 'utils'\n\nexport {\n isTextPart,\n isFilePart,\n isToolPart,\n isReasoningPart,\n hasPartText,\n hasTextPart,\n getTextPart,\n getMessageText,\n}\n\n/**\n * Merges consecutive text parts into a single text part.\n * Claude (and other models) often produce multiple text parts during streaming\n * that should logically be a single block of text.\n */\nexport function mergeConsecutiveTextParts(\n parts: UIMessage['parts'],\n): UIMessage['parts'] {\n const merged: UIMessage['parts'] = []\n for (const part of parts) {\n if (!isTextPart(part)) {\n merged.push(part)\n continue\n }\n const prev = merged[merged.length - 1]\n if (prev && isTextPart(prev)) {\n merged[merged.length - 1] = { ...prev, text: prev.text + part.text }\n } else {\n merged.push(part)\n }\n }\n return merged\n}\n\nexport function isStreamingPart(\n part: UIMessage['parts'][number] | null | undefined,\n): part is Extract<UIMessage['parts'][number], { streaming?: boolean }> {\n if (!part) {\n return false\n }\n if ('state' in part) {\n return part.state === 'streaming' || part.state === 'input-streaming'\n }\n return false\n}\n\n/**\n * How much of a reasoning still being written its live box renders. The box is\n * a few lines tall and follows the bottom, while the reasoning of one turn runs\n * to tens of kilobytes: chat `st0Eg8iG0zUX0HQN` wrote 92KB, and parsing all of\n * it at every delta froze the tab. Four thousand characters leave a few screens\n * to scroll back through, and a finished step renders all of it.\n */\nexport const LIVE_REASONING_TAIL_LENGTH = 4000\n\n// A fence opener or closer, also inside a list item or a quote, whose markers\n// and indentation are skipped. The rest of the line tells them apart: a\n// closing fence carries no info string.\nconst FENCE_LINE =\n /^[ \\t]*(?:(?:[-*+]|\\d{1,9}[.)])[ \\t]+|>[ \\t]?)*(`{3,}|~{3,})(.*)$/gm\n\n/**\n * The end of a markdown text, at most `maxLength` characters long, cut on a\n * blank line (a line break when there is none) so it does not open on half a\n * paragraph. A table or a formula can still be cut in two. An ellipsis marks\n * the cut. A cut inside a fenced code block reopens the fence, or the rest of\n * the text would render as code and the code as prose.\n */\nexport function getMarkdownTail(markdown: string, maxLength: number): string {\n if (markdown.length <= maxLength) {\n return markdown\n }\n const from = markdown.length - maxLength\n // The boundary is looked for in the first half of the window only: the one\n // blank line of the window can be the last thing written, and cutting there\n // would leave nothing to render.\n const limit = from + maxLength / 2\n const boundary = (index: number, length: number) =>\n index !== -1 && index < limit ? index + length : undefined\n const cut =\n boundary(markdown.indexOf('\\n\\n', from), 2) ??\n boundary(markdown.indexOf('\\n', from), 1) ??\n from\n let openFence: string | undefined\n for (const match of markdown.matchAll(FENCE_LINE)) {\n if (match.index >= cut) {\n break\n }\n const [, marker, rest] = match\n if (!openFence) {\n // A backtick in a backtick fence's info string makes it inline\n // code, not a fence.\n if (marker[0] === '`' && rest.includes('`')) {\n continue\n }\n openFence = marker\n } else if (\n marker[0] === openFence[0] &&\n marker.length >= openFence.length &&\n !rest.trim()\n ) {\n openFence = undefined\n }\n }\n const reopen = openFence ? `${openFence}\\n` : ''\n return `…\\n\\n${reopen}${markdown.slice(cut)}`\n}\n\n/**\n * States a tool part goes through when it needs the user's approval. They are\n * rendered by `PkToolApprovalCard` whatever the tool is, so the decision (and\n * its outcome) stays visible in the transcript.\n */\nconst TOOL_APPROVAL_STATES = new Set([\n 'approval-requested',\n 'approval-responded',\n 'output-denied',\n])\n\nexport function isToolApprovalPart(\n part: UIMessage['parts'][number] | null | undefined,\n): boolean {\n if (!isToolPart(part)) {\n return false\n }\n if (TOOL_APPROVAL_STATES.has(part.state)) {\n return true\n }\n // An executed (or errored) call that went through the gate keeps its\n // verdict in `approval`: the card stays in the transcript, so the user's\n // decision remains visible in the chat and in the log viewers (parity\n // with requestConfirm, whose 'confirmed' output is persisted).\n return (part as { approval?: unknown }).approval != null\n}\n\n/**\n * The client-side tool the model uses to have an action it described approved.\n * It predates the SDK's approval gate and keeps its own round-trip (it resolves\n * through `addToolOutput`), but it asks the user the very same question, so it\n * shares `PkToolApprovalCard` instead of having a card of its own.\n */\nexport const CONFIRM_TOOL_NAME = 'requestConfirm'\n\nexport function isToolConfirmPart(\n part: UIMessage['parts'][number] | null | undefined,\n): boolean {\n return isToolPart(part) && part.type === `tool-${CONFIRM_TOOL_NAME}`\n}\n\n/** True for any part the confirmation card is responsible for. */\nexport function isConfirmationCardPart(\n part: UIMessage['parts'][number] | null | undefined,\n): boolean {\n return isToolApprovalPart(part) || isToolConfirmPart(part)\n}\n\n/** The id of the pending approval request on a tool part, if any. */\nexport function getToolApprovalId(\n part: UIMessage['parts'][number] | null | undefined,\n): string | undefined {\n if (!isToolPart(part)) {\n return undefined\n }\n return (part as { approval?: { id?: string } }).approval?.id\n}\n\nexport function getPartState(\n part: UIMessage['parts'][number] | null | undefined,\n): string | undefined {\n if (!part) {\n return undefined\n }\n if ('state' in part) {\n return part.state\n }\n return undefined\n}\n\nexport function isLoadingState(state?: string): boolean {\n if (!state) {\n return false\n }\n return ['streaming'].includes(state)\n}\n\nexport function getContrast(hexcolor: string = '000000'): 'black' | 'white' {\n let hex = hexcolor.replace('#', '')\n\n // Expand 3-character hex to 6-character (e.g., #ccc -> #cccccc)\n if (hex.length === 3) {\n hex = hex\n .split('')\n .map((char) => char + char)\n .join('')\n }\n\n // WCAG relative luminance\n const r = parseInt(hex.substring(0, 2), 16) / 255\n const g = parseInt(hex.substring(2, 4), 16) / 255\n const b = parseInt(hex.substring(4, 6), 16) / 255\n\n const linearize = (c: number) =>\n c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4\n\n const luminance =\n 0.2126 * linearize(r) + 0.7152 * linearize(g) + 0.0722 * linearize(b)\n\n return luminance > 0.179 ? 'black' : 'white'\n}\n\n/**\n * Resolves the contrast color based on the user's `textColor` preference.\n * Falls back to WCAG auto-detection via `getContrast` when set to `'auto'` or `undefined`.\n */\nexport function resolveContrastColor(\n textColor: 'auto' | 'white' | 'black' | undefined,\n mainColor: string | undefined,\n): 'black' | 'white' {\n if (textColor === 'white' || textColor === 'black') {\n return textColor\n }\n return getContrast(mainColor)\n}\n\n/**\n * Formats a duration in milliseconds using the i18n `seconds` number format\n * (e.g. \"12,4 secondi\" / \"12.4 seconds\"). Returns undefined for durations\n * that would render as \"0 seconds\" (less than 0.05s).\n */\nexport function formatDuration(\n $n: (value: number, format: string) => string,\n ms?: number,\n): string | undefined {\n if (ms === undefined || ms < 50) {\n return undefined\n }\n return $n(ms / 1000, 'seconds')\n}\n\n/**\n * Stringifies a tool payload for the raw fallback view. Returns undefined for\n * empty values so the caller can skip rendering the block entirely.\n */\nexport function stringifyPayload(value: unknown): string | undefined {\n if (value === undefined) {\n return undefined\n }\n if (typeof value === 'string') {\n return value.trim() || undefined\n }\n try {\n const json = JSON.stringify(value, null, 2)\n return json === '{}' || json === '[]' ? undefined : json\n } catch {\n return undefined\n }\n}\n\n/**\n * True when a tool payload carries something worth rendering, so a caller can\n * skip the block without stringifying the value twice.\n */\nexport function hasPayload(value: unknown): boolean {\n return stringifyPayload(value) !== undefined\n}\n\n/**\n * Turns the answers of a form into the sentence the caller would have said.\n *\n * On a call the tool loop is over by the time the form is on screen, so the\n * answers go back to the agent as a user message (see `sendUserMessage` in\n * `useVoiceSession`). Each answer is paired with its question, because that is\n * how a person would say it and because the agent hears it with no widget\n * attached.\n */\nexport function formAnswerAsSpoken(\n part: unknown,\n answer: string | { answers: { id: string; value: unknown }[] },\n): string {\n const input = (\n part as {\n input?: {\n steps?: { id: string; question?: string }[]\n question?: string\n }\n }\n )?.input\n\n if (typeof answer === 'string') {\n const question = input?.question ?? input?.steps?.[0]?.question\n return question ? `${question} ${answer}` : answer\n }\n\n const questionById = new Map(\n (input?.steps ?? []).map((step) => [step.id, step.question]),\n )\n const lines = answer.answers\n .filter(\n ({ value }) =>\n value !== null &&\n value !== '' &&\n !(Array.isArray(value) && !value.length),\n )\n .map(({ id, value }) => {\n const said = Array.isArray(value) ? value.join(', ') : String(value)\n const question = questionById.get(id)\n return question ? `${question} ${said}` : said\n })\n\n return lines.join('. ')\n}\n\n/**\n * The choices of a form step, as the radio and checkbox editors take them.\n *\n * The `value` is the LABEL and not the position, because it is what travels\n * back to the model as the answer: it reads the words it wrote, not an index.\n * Nothing here caps the list, and nothing should: the number of options an\n * agent configures is advice to the model, so a step can legitimately carry\n * more (see `showForm.tool.ts`).\n */\nexport function formStepOptions(\n step: { options?: { label: string; description?: string }[] } | undefined,\n): { label: string; value: string; description?: string }[] {\n if (!step?.options) {\n return []\n }\n return step.options.map((option) => ({\n label: option.label,\n value: option.label,\n description: option.description,\n }))\n}\n\n/**\n * Spreads the answers a form comes back with onto one slot PER STEP.\n *\n * A form's answers travel paired with step ids, and the tool schema does not\n * enforce that those ids are unique: a `.refine()` there would refuse the whole\n * form over a duplicate, which is the failure the schema was just cured of (see\n * the gotchas entry \"A configurable cap does not belong in an inputSchema\").\n * So the duplicate has to be survivable here. Keyed by id, two steps sharing\n * one collapsed onto a single answer: the second question showed the first\n * one's reply, and submitting sent that reply twice. Keyed by position, each\n * step keeps its own.\n *\n * A duplicated id restores the same incoming value to every step claiming it,\n * which is as much as the payload allows: the ids are all it says.\n */\nexport function formAnswerSlots(\n steps: { id: string }[],\n output: unknown,\n): Record<number, unknown> {\n const slots: Record<number, unknown> = {}\n if (output === undefined || output === null) {\n return slots\n }\n // A legacy single-choice answer is the plain string, and it can only\n // belong to a single-step form.\n if (typeof output === 'string') {\n if (steps.length === 1) {\n slots[0] = output\n }\n return slots\n }\n const assign = (id: string, value: unknown) => {\n steps.forEach((step, index) => {\n if (step.id === id) {\n slots[index] = value\n }\n })\n }\n const list = (output as { answers?: unknown }).answers\n if (Array.isArray(list)) {\n for (const answer of list as { id?: unknown; value?: unknown }[]) {\n if (typeof answer?.id === 'string') {\n assign(answer.id, answer.value)\n }\n }\n return slots\n }\n // Forms answered on a platform channel (the Teams modal) come back as a\n // flat record keyed by step id.\n for (const [id, value] of Object.entries(\n output as Record<string, unknown>,\n )) {\n if (value !== undefined) {\n assign(id, value)\n }\n }\n return slots\n}\n\n// Provider-native web search tool part types\nexport const WEB_SEARCH_TOOL_TYPES = [\n 'tool-perplexity_search',\n 'tool-parallel_search',\n 'tool-web_search',\n 'tool-google_search',\n]\n\n// Tool part types with a dedicated rich rendering in PkChatbotStepToolDetail\nconst RICH_DETAIL_TOOL_TYPES = new Set([\n 'tool-searchInKnowledgeBase',\n 'tool-retrieveRevisedAnswers',\n 'tool-expandChunkContext',\n 'tool-readDocumentFile',\n 'tool-getWeather',\n 'tool-geocode',\n 'tool-recallUserMemory',\n 'tool-saveUserMemory',\n ...WEB_SEARCH_TOOL_TYPES,\n])\n\nexport function hasRichToolDetail(\n part?: UIMessage['parts'][number] | null,\n): boolean {\n return isToolPart(part) && RICH_DETAIL_TOOL_TYPES.has(part.type)\n}\n\nconst asRecord = (value: unknown): Record<string, unknown> | undefined =>\n value && typeof value === 'object' && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined\n\nconst pickString = (\n record: Record<string, unknown> | undefined,\n ...keys: string[]\n): string | undefined => {\n for (const key of keys) {\n const value = record?.[key]\n if (typeof value === 'string' && value.trim()) {\n return value\n }\n }\n return undefined\n}\n\n/**\n * Returns a short inline summary for a tool part (search queries, location,\n * document name, ...) to be shown next to the step label without expanding\n * the step body.\n */\nexport function getToolPartSummary(\n part?: UIMessage['parts'][number] | null,\n): string | undefined {\n if (!isToolPart(part)) {\n return undefined\n }\n const input = asRecord('input' in part ? part.input : undefined)\n const output = asRecord('output' in part ? part.output : undefined)\n if (\n part.type === 'tool-searchInKnowledgeBase' ||\n WEB_SEARCH_TOOL_TYPES.includes(part.type)\n ) {\n const queries = input?.queries\n if (Array.isArray(queries)) {\n const valid = queries.filter(\n (query): query is string =>\n typeof query === 'string' && Boolean(query.trim()),\n )\n return valid.length ? valid.join(' · ') : undefined\n }\n return pickString(input, 'query', 'objective')\n }\n if (part.type === 'tool-retrieveRevisedAnswers') {\n return pickString(input, 'query')\n }\n if (part.type === 'tool-getWeather') {\n return (\n pickString(output, 'location') ?? pickString(input, 'locationName')\n )\n }\n if (part.type === 'tool-geocode') {\n return pickString(input, 'locationName')\n }\n if (part.type === 'tool-expandChunkContext') {\n return pickString(output, 'documentName')\n }\n if (part.type === 'tool-readDocumentFile') {\n return pickString(output, 'name')\n }\n if (part.type === 'tool-recallUserMemory') {\n return pickString(input, 'query')\n }\n if (part.type === 'tool-saveUserMemory') {\n return pickString(input, 'content', 'query')\n }\n return undefined\n}\n\n// Get part icon\nexport function getPartIcon(\n part?: UIMessage['parts'][number] | null,\n): string | undefined {\n if (isToolPart(part)) {\n if (part.type.includes('tool-subagent')) {\n return 'ri:robot-2-line'\n }\n if (part.type === 'tool-runWorker') {\n return 'ri:flow-chart'\n }\n if (part.type === 'tool-fetchTeamsChannelHistory') {\n return 'ri:chat-history-line'\n }\n if (part.type.includes('tool-mcp')) {\n return 'mcp'\n }\n if (part.type === 'tool-retrieveRevisedAnswers') {\n return 'ri:file-edit-line'\n }\n if (part.type === 'tool-searchInKnowledgeBase') {\n return 'ri:search-line'\n }\n if (part.type === 'tool-expandChunkContext') {\n return 'ri:file-search-line'\n }\n if (part.type === 'tool-readDocumentFile') {\n return 'ri:file-text-line'\n }\n if (part.type === 'tool-geocode') {\n return 'ri:map-2-line'\n }\n if (part.type === 'tool-getWeather') {\n return 'ri:sun-cloudy-line'\n }\n if (part.type === 'tool-recallUserMemory') {\n return 'ri:brain-line'\n }\n if (part.type === 'tool-saveUserMemory') {\n return 'ri:save-3-line'\n }\n if (part.type === 'tool-showWeather') {\n return 'ri:sun-line'\n }\n if (part.type === 'tool-showDiagram') {\n return 'ri:flow-chart'\n }\n if (part.type === 'tool-showSources') {\n return 'ri:book-2-line'\n }\n if (part.type === 'tool-showForm') {\n return 'ri:survey-line'\n }\n if (part.type === 'tool-showMultipleChoice') {\n return 'ri:checkbox-multiple-line'\n }\n if (part.type === 'tool-showArtifact') {\n return 'ri:file-code-line'\n }\n if (part.type === 'tool-showEmail') {\n return 'ri:mail-line'\n }\n if (part.type === 'tool-showMessage') {\n return 'ri:chat-1-line'\n }\n if (part.type === 'tool-showWebPages') {\n return 'ri:pages-line'\n }\n if (part.type === 'tool-showProductList') {\n return 'ri:shopping-bag-line'\n }\n if (part.type === 'tool-showContactForm') {\n return 'ri:send-plane-2-line'\n }\n if (part.type === 'tool-showCalendarEvent') {\n return 'ri:calendar-event-line'\n }\n if (part.type === 'tool-showComparison') {\n return 'ri:scales-line'\n }\n if (part.type === 'tool-showLocation') {\n return 'ri:map-pin-line'\n }\n if (part.type === 'tool-showQrCode') {\n return 'ri:qr-code-line'\n }\n if (part.type === 'tool-showImageGallery') {\n return 'ri:image-line'\n }\n if (part.type === 'tool-showVideo') {\n return 'ri:film-line'\n }\n if (part.type === 'tool-showSuggestedReply') {\n return 'ri:corner-down-right-line'\n }\n if (part.type === 'tool-requestGeolocation') {\n return 'ri:map-pin-user-line'\n }\n if (\n part.type === 'tool-perplexity_search' ||\n part.type === 'tool-parallel_search' ||\n part.type === 'tool-web_search' ||\n part.type === 'tool-google_search'\n ) {\n return 'ri:global-line'\n }\n return 'ri:tools-line'\n }\n if (isReasoningPart(part)) {\n return 'ri:lightbulb-line'\n }\n if (isTextPart(part)) {\n return 'ri:double-quotes-r'\n }\n return undefined\n}\n\n// Get part label\nexport function getToolPartLabel(\n $t: (key: string) => string,\n part?: UIMessage['parts'][number] | null,\n): string | undefined {\n if (isToolPart(part)) {\n if (part.type.includes('tool-subagent')) {\n return $t(`messagePart.runSubagent`)\n }\n if (part.type === 'tool-runWorker') {\n return $t(`messagePart.runWorker`)\n }\n if (part.type === 'tool-fetchTeamsChannelHistory') {\n return $t(`messagePart.fetchTeamsChannelHistory`)\n }\n if (part.type === 'tool-retrieveRevisedAnswers') {\n return $t(`messagePart.revisedAnswers`)\n }\n if (part.type === 'tool-searchInKnowledgeBase') {\n return $t(`messagePart.searchingDocuments`)\n }\n if (part.type === 'tool-expandChunkContext') {\n return $t(`messagePart.expandChunkContext`)\n }\n if (part.type === 'tool-readDocumentFile') {\n return $t(`messagePart.readDocumentFile`)\n }\n if (part.type === 'tool-geocode') {\n return $t(`messagePart.geocode`)\n }\n if (part.type === 'tool-getWeather') {\n return $t(`messagePart.getWeather`)\n }\n if (part.type === 'tool-recallUserMemory') {\n return $t(`messagePart.recallUserMemory`)\n }\n if (part.type === 'tool-saveUserMemory') {\n return $t(`messagePart.saveUserMemory`)\n }\n if (part.type === 'tool-showWeather') {\n return $t(`messagePart.showWeather`)\n }\n if (part.type === 'tool-showForm') {\n return $t(`messagePart.showForm`)\n }\n if (part.type === 'tool-showDiagram') {\n return $t(`messagePart.showDiagram`)\n }\n if (part.type === 'tool-showSources') {\n return $t(`messagePart.showSources`)\n }\n if (part.type === 'tool-showMultipleChoice') {\n return $t(`messagePart.showMultipleChoice`)\n }\n if (part.type === 'tool-showArtifact') {\n return $t(`messagePart.showArtifact`)\n }\n if (part.type === 'tool-showEmail') {\n return $t(`messagePart.showEmail`)\n }\n if (part.type === 'tool-showMessage') {\n return $t(`messagePart.showMessage`)\n }\n if (part.type === 'tool-showWebPages') {\n return $t(`messagePart.showWebPages`)\n }\n if (part.type === 'tool-showProducts') {\n return $t(`messagePart.showProducts`)\n }\n if (part.type === 'tool-showContactForm') {\n return $t(`messagePart.showContactForm`)\n }\n if (part.type === 'tool-showCalendarEvent') {\n return $t(`messagePart.showCalendarEvent`)\n }\n if (part.type === 'tool-showComparison') {\n return $t(`messagePart.showComparison`)\n }\n if (part.type === 'tool-showLocation') {\n return $t(`messagePart.showLocation`)\n }\n if (part.type === 'tool-showQrCode') {\n return $t(`messagePart.showQrCode`)\n }\n if (part.type === 'tool-showImageGallery') {\n return $t(`messagePart.showImageGallery`)\n }\n if (part.type === 'tool-showVideo') {\n return $t(`messagePart.showVideo`)\n }\n if (part.type === 'tool-showSuggestedReply') {\n return $t(`messagePart.showSuggestedReply`)\n }\n if (part.type === 'tool-requestGeolocation') {\n return $t(`messagePart.requestGeolocation`)\n }\n if (WEB_SEARCH_TOOL_TYPES.includes(part.type)) {\n return $t(`messagePart.webSearch`)\n }\n return $t(`messagePart.tool`)\n }\n if (isReasoningPart(part)) {\n return $t(`messagePart.reasoning`)\n }\n return $t(`messagePart.streaming`)\n}\n"],"mappings":";;;AA4BA,SAAgB,EACZ,GACkB;CAClB,IAAM,IAA6B,CAAC;CACpC,KAAK,IAAM,KAAQ,GAAO;EACtB,IAAI,CAAC,EAAW,CAAI,GAAG;GACnB,EAAO,KAAK,CAAI;GAChB;EACJ;EACA,IAAM,IAAO,EAAO,EAAO,SAAS;EACpC,AAAI,KAAQ,EAAW,CAAI,IACvB,EAAO,EAAO,SAAS,KAAK;GAAE,GAAG;GAAM,MAAM,EAAK,OAAO,EAAK;EAAK,IAEnE,EAAO,KAAK,CAAI;CAExB;CACA,OAAO;AACX;AAEA,SAAgB,EACZ,GACoE;CAOpE,OANK,KAGD,WAAW,IACJ,EAAK,UAAU,eAAe,EAAK,UAAU,oBAEjD;AACX;AASA,IAAa,IAA6B,KAKpC,IACF;AASJ,SAAgB,EAAgB,GAAkB,GAA2B;CACzE,IAAI,EAAS,UAAU,GACnB,OAAO;CAEX,IAAM,IAAO,EAAS,SAAS,GAIzB,IAAQ,IAAO,IAAY,GAC3B,KAAY,GAAe,MAC7B,MAAU,MAAM,IAAQ,IAAQ,IAAQ,IAAS,KAAA,GAC/C,IACF,EAAS,EAAS,QAAQ,QAAQ,CAAI,GAAG,CAAC,KAC1C,EAAS,EAAS,QAAQ,MAAM,CAAI,GAAG,CAAC,KACxC,GACA;CACJ,KAAK,IAAM,KAAS,EAAS,SAAS,CAAU,GAAG;EAC/C,IAAI,EAAM,SAAS,GACf;EAEJ,IAAM,GAAG,GAAQ,KAAQ;E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SAAS,wBACP,EAAG,4BAA4B,IAEtC,EAAK,SAAS,qBACP,EAAG,yBAAyB,IAEnC,EAAK,SAAS,kBACP,EAAG,sBAAsB,IAEhC,EAAK,SAAS,qBACP,EAAG,yBAAyB,IAEnC,EAAK,SAAS,qBACP,EAAG,yBAAyB,IAEnC,EAAK,SAAS,4BACP,EAAG,gCAAgC,IAE1C,EAAK,SAAS,sBACP,EAAG,0BAA0B,IAEpC,EAAK,SAAS,mBACP,EAAG,uBAAuB,IAEjC,EAAK,SAAS,qBACP,EAAG,yBAAyB,IAEnC,EAAK,SAAS,sBACP,EAAG,0BAA0B,IAEpC,EAAK,SAAS,sBACP,EAAG,0BAA0B,IAEpC,EAAK,SAAS,yBACP,EAAG,6BAA6B,IAEvC,EAAK,SAAS,2BACP,EAAG,+BAA+B,IAEzC,EAAK,SAAS,wBACP,EAAG,4BAA4B,IAEtC,EAAK,SAAS,sBACP,EAAG,0BAA0B,IAEpC,EAAK,SAAS,oBACP,EAAG,wBAAwB,IAElC,EAAK,SAAS,0BACP,EAAG,8BAA8B,IAExC,EAAK,SAAS,mBACP,EAAG,uBAAuB,IAEjC,EAAK,SAAS,4BACP,EAAG,gCAAgC,IAE1C,EAAK,SAAS,4BACP,EAAG,gCAAgC,IAE1C,EAAsB,SAAS,EAAK,IAAI,IACjC,EAAG,uBAAuB,IAE9B,EAAG,kBAAkB,IAE5B,EAAgB,CAAI,IACb,EAAG,uBAAuB,IAE9B,EAAG,uBAAuB;AACrC"}
@@ -2,7 +2,7 @@ import { t as e } from "./_chunks/createChatbotApiClient-MkaPbGWB.js";
2
2
  import { n as t } from "./_chunks/useChatbotStore-BzfqjiYz.js";
3
3
  import { t as n } from "./_chunks/src-DT8FLE4_.js";
4
4
  import { t as r } from "./_chunks/useLocalizedString-PfaKjIQY.js";
5
- import { y as i } from "./_chunks/utils-Coqik0XI.js";
5
+ import { x as i } from "./_chunks/utils-C1666_6C.js";
6
6
  import { computed as a, getCurrentInstance as o, onBeforeUnmount as s, onMounted as c, ref as l, toValue as u, watch as d } from "vue";
7
7
  import { createAuthClient as f } from "better-auth/vue";
8
8
  import { anonymousClient as p, inferAdditionalFields as m } from "better-auth/client/plugins";
package/dist-vue/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./_chunks/rolldown-runtime-Dy4uBu1J.js";
2
- import { i as t, r as n, t as r } from "./_chunks/PkToolShowForm-CIZpfAGK.js";
2
+ import { i as t, r as n, t as r } from "./_chunks/PkToolShowForm-DUKIyj9V.js";
3
3
  import { C as i, S as a, _ as o, a as s, b as c, d as l, g as u, l as d, n as f, o as p, p as m, w as h, y as g } from "./_chunks/schemas-DxbHVg3r.js";
4
4
  import { i as _, r as v } from "./_chunks/Media-_HfFLHGD.js";
5
5
  import { A as y, C as ee, S as b, T as x, _ as S, b as C, d as w, g as te, h as ne, i as re, m as ie, n as T, o as ae, p as oe, r as se, t as ce, v as le, w as ue, x as de } from "./_chunks/Agent-De2gFNjR.js";
@@ -7,42 +7,42 @@ import { c as fe, l as pe, r as me, s as he, t as ge } from "./_chunks/Document-
7
7
  import { n as _e } from "./_chunks/createChatbotApiClient-MkaPbGWB.js";
8
8
  import { t as ve } from "./_chunks/PkChatbotAuth-C2adgBav.js";
9
9
  import { t as ye } from "./_chunks/PkChatbotError-gvDpRcEz.js";
10
- import { t as be } from "./_chunks/PkStreamingMarkdown-DIaZEedG.js";
10
+ import { t as be } from "./_chunks/PkStreamingMarkdown-D0IOaETI.js";
11
11
  import { a as xe, i as Se, n as Ce, r as we } from "./_chunks/useChatbotStore-BzfqjiYz.js";
12
12
  import "./_chunks/src-DT8FLE4_.js";
13
13
  import { c as Te, i as Ee, s as De } from "./_chunks/message-RohfrdWS.js";
14
- import { i as Oe, n as ke, r as Ae, t as je } from "./_chunks/PkChatbotMessages-CGALOKwe.js";
14
+ import { i as Oe, n as ke, r as Ae, t as je } from "./_chunks/PkChatbotMessages-B6ONEJnZ.js";
15
15
  import { t as Me } from "./_chunks/useSafeLocalStorage-Ce3S1Ayn.js";
16
16
  import { t as Ne } from "./_chunks/useDialogConfirm-KWz0ohCQ.js";
17
17
  import { n as Pe, r as Fe, t as Ie } from "./_chunks/PkChatbotViewConversations-3LaZPFyw.js";
18
- import { i as Le, n as Re, r as ze, t as Be } from "./_chunks/PkChatbotViewChat-DT-rAU_r.js";
18
+ import { i as Le, n as Re, r as ze, t as Be } from "./_chunks/PkChatbotViewChat-BMQtx1Gi.js";
19
19
  import { t as Ve } from "./_chunks/useImageFallback-5vQIO0pC.js";
20
20
  import { t as He } from "./_chunks/useLocalizedString-PfaKjIQY.js";
21
21
  import { n as Ue, t as We } from "./_chunks/PkRelativeTime--1cIphlA.js";
22
- import { r as Ge, t as Ke } from "./_chunks/PkToolShowArtifact-BCCUucVQ.js";
22
+ import { r as Ge, t as Ke } from "./_chunks/PkToolShowArtifact-DHdJuzDi.js";
23
23
  import { $ as qe, A as Je, B as Ye, C as Xe, Ct as Ze, D as Qe, E as $e, F as et, G as tt, H as nt, I as rt, J as it, K as at, L as ot, M as st, N as E, Q as ct, S as lt, St as ut, T as dt, Tt as ft, U as pt, V as mt, W as ht, X as gt, _t, a as vt, at as yt, b as bt, bt as xt, c as St, ct as Ct, d as wt, dt as Tt, et as Et, f as Dt, gt as Ot, h as kt, it as At, j as jt, k as Mt, l as D, lt as O, mt as Nt, nt as Pt, o as Ft, ot as It, pt as Lt, q as Rt, rt as zt, st as Bt, tt as Vt, u as Ht, ut as Ut, vt as Wt, w as Gt, wt as Kt, x as qt, xt as Jt, y as Yt, yt as Xt, z as Zt } from "./_chunks/dist-Bju7SKiu.js";
24
24
  import { n as Qt, t as $t } from "./_chunks/dist-D6ZVcs1F.js";
25
25
  import { n as en, r as tn } from "./_chunks/dist-Csm5xBQw.js";
26
- import { t as nn } from "./_chunks/PkLazyImg-CDxX9xnq.js";
27
- import { n as rn, r as an, t as on } from "./_chunks/PkChatbotFilePreview-CwiVQDF2.js";
28
- import { t as sn } from "./_chunks/PkSvgViewer-D-0M5bqg.js";
29
- import { t as cn } from "./_chunks/PkUrl-DSGxrEM7.js";
30
- import { t as ln } from "./_chunks/PkAvatar-paEJByEA.js";
31
- import { t as un } from "./_chunks/PkChatbotFeedbackForm-DO1QIgmo.js";
32
- import { h as dn, s as fn } from "./_chunks/utils-Coqik0XI.js";
33
- import { n as pn, t as mn } from "./_chunks/PkChatbotSteps-BhFupvbz.js";
34
- import { t as hn } from "./_chunks/PkChatbotStepPayload-BH6piqOi.js";
35
- import { t as gn } from "./_chunks/PkChatbotStepToolDetail-BJ7xUvgi.js";
36
- import { n as _n, t as vn } from "./_chunks/PkChatbotInput-pEl3D2O-.js";
37
- import { t as yn } from "./_chunks/PkChatbotEmptyState-C_ITdvH7.js";
26
+ import { _ as nn, l as rn } from "./_chunks/utils-C1666_6C.js";
27
+ import { t as an } from "./_chunks/PkLazyImg-CDxX9xnq.js";
28
+ import { n as on, r as sn, t as cn } from "./_chunks/PkChatbotFilePreview-CwiVQDF2.js";
29
+ import { t as ln } from "./_chunks/PkSvgViewer-D-0M5bqg.js";
30
+ import { t as un } from "./_chunks/PkUrl-B5CNTQj9.js";
31
+ import { t as dn } from "./_chunks/PkAvatar-paEJByEA.js";
32
+ import { t as fn } from "./_chunks/PkChatbotFeedbackForm-DO1QIgmo.js";
33
+ import { n as pn, t as mn } from "./_chunks/PkChatbotSteps-CrqjWpv0.js";
34
+ import { t as hn } from "./_chunks/PkChatbotStepPayload-XW4gT9AZ.js";
35
+ import { t as gn } from "./_chunks/PkChatbotStepToolDetail-C4-K6Glw.js";
36
+ import { n as _n, t as vn } from "./_chunks/PkChatbotInput-MSpF6SB6.js";
37
+ import { t as yn } from "./_chunks/PkChatbotEmptyState-BtzBYOHJ.js";
38
38
  import { t as bn } from "./_chunks/PkChatbotViewProfile-B-Mp1jGQ.js";
39
- import { t as xn } from "./_chunks/PkChatbot-Di7R2CWN.js";
40
- import { i as Sn, r as Cn, t as wn } from "./_chunks/PkToolShowSources-DDZokZow.js";
41
- import { t as Tn } from "./_chunks/PkToolShowEmail-DpC517Vn.js";
42
- import { t as En } from "./_chunks/PkToolShowMessage-B7flxVCU.js";
43
- import { t as Dn } from "./_chunks/PkToolShowWebPages-DY48ee6V.js";
44
- import { t as On } from "./_chunks/PkToolShowProductList-B6fRtIpx.js";
45
- import { t as kn } from "./_chunks/PkToolShowContactForm-BXGxWSc2.js";
39
+ import { t as xn } from "./_chunks/PkChatbot-DE1bKmDi.js";
40
+ import { i as Sn, r as Cn, t as wn } from "./_chunks/PkToolShowSources-Dlaz2Y77.js";
41
+ import { t as Tn } from "./_chunks/PkToolShowEmail-DF__nKpR.js";
42
+ import { t as En } from "./_chunks/PkToolShowMessage-Ck6VP-gw.js";
43
+ import { t as Dn } from "./_chunks/PkToolShowWebPages-CosBYLrE.js";
44
+ import { t as On } from "./_chunks/PkToolShowProductList-zfM8cx-l.js";
45
+ import { t as kn } from "./_chunks/PkToolShowContactForm-BB2X4UdQ.js";
46
46
  import { t as An } from "./_chunks/PkToolShowCalendarEvent-BsBdsbV0.js";
47
47
  import { t as jn } from "./_chunks/PkToolShowComparison-DMSjIpCR.js";
48
48
  import { t as Mn } from "./_chunks/PkToolShowLocation-Bv6sLN5P.js";
@@ -440,7 +440,7 @@ var Ii = { class: "flex items-center gap-4 mb-4" }, Li = { class: "font-semibold
440
440
  }
441
441
  });
442
442
  //#endregion
443
- //#region virtual:intlify-i18n-2
443
+ //#region virtual:intlify-i18n-0
444
444
  function Ui(e) {
445
445
  let t = e;
446
446
  t.__i18n = t.__i18n || [], t.__i18n.push({
@@ -549,7 +549,7 @@ var Wi = Hi, Gi = { class: "flex items-center gap-4 mb-4" }, Ki = { class: "font
549
549
  }
550
550
  });
551
551
  //#endregion
552
- //#region virtual:intlify-i18n-3
552
+ //#region virtual:intlify-i18n-1
553
553
  function ta(e) {
554
554
  let t = e;
555
555
  t.__i18n = t.__i18n || [], t.__i18n.push({
@@ -656,7 +656,7 @@ var na = ea, ra = { class: "flex items-center gap-4 mb-4" }, ia = { class: "font
656
656
  }
657
657
  });
658
658
  //#endregion
659
- //#region virtual:intlify-i18n-4
659
+ //#region virtual:intlify-i18n-2
660
660
  function ua(e) {
661
661
  let t = e;
662
662
  t.__i18n = t.__i18n || [], t.__i18n.push({
@@ -16122,7 +16122,7 @@ var YS = { class: "flex gap-sm items-center min-w-0" }, XS = { class: "w-40 h-40
16122
16122
  }
16123
16123
  },
16124
16124
  setup(e, { expose: t }) {
16125
- let n = e, r = B(), { preload: i, getSize: a } = rn(), { lightbox: o, init: s } = an({
16125
+ let n = e, r = B(), { preload: i, getSize: a } = on(), { lightbox: o, init: s } = sn({
16126
16126
  gallery: r,
16127
16127
  loop: n.loop,
16128
16128
  downloadable: n.downloadable,
@@ -16194,7 +16194,7 @@ var iC = /*#__PURE__*/ tC(nC, [["render", rC]]), aC = {
16194
16194
  }), { canShowImage: o, onImageError: s } = Ve(), c = A(() => o(r.value) ? r.value : void 0);
16195
16195
  return (t, n) => {
16196
16196
  let r = Jn;
16197
- return z(), N("picture", { class: mr(["relative", { "vv-skeleton": i.value }]) }, [c.value ? (z(), j(nn, {
16197
+ return z(), N("picture", { class: mr(["relative", { "vv-skeleton": i.value }]) }, [c.value ? (z(), j(an, {
16198
16198
  key: 1,
16199
16199
  src: c.value,
16200
16200
  alt: e.alt,
@@ -16283,7 +16283,7 @@ var iC = /*#__PURE__*/ tC(nC, [["render", rC]]), aC = {
16283
16283
  }
16284
16284
  });
16285
16285
  //#endregion
16286
- //#region virtual:intlify-i18n-0
16286
+ //#region virtual:intlify-i18n-3
16287
16287
  function mC(e) {
16288
16288
  let t = e;
16289
16289
  t.__i18n = t.__i18n || [], t.__i18n.push({
@@ -16470,7 +16470,7 @@ var hC = pC, gC = { class: "block text-smaller mt-4" }, _C = { class: "block tex
16470
16470
  }
16471
16471
  });
16472
16472
  //#endregion
16473
- //#region virtual:intlify-i18n-1
16473
+ //#region virtual:intlify-i18n-4
16474
16474
  function xC(e) {
16475
16475
  let t = e;
16476
16476
  t.__i18n = t.__i18n || [], t.__i18n.push({
@@ -16654,12 +16654,12 @@ var kC = { class: "flex items-center gap-xs min-w-0" }, AC = { class: "truncate"
16654
16654
  "dropdown-modifiers": "menu mobile",
16655
16655
  offset: "2"
16656
16656
  }, {
16657
- option: K(({ option: e }) => [P("span", kC, [I(ln, {
16657
+ option: K(({ option: e }) => [P("span", kC, [I(dn, {
16658
16658
  modifiers: "surface ring",
16659
16659
  "img-src": e.interface?.logo,
16660
16660
  name: e.name
16661
16661
  }, null, 8, ["img-src", "name"]), P("span", AC, H(e.name), 1)])]),
16662
- value: K(({ selectedOptions: e }) => [e.length ? (z(), N("span", jC, [I(ln, {
16662
+ value: K(({ selectedOptions: e }) => [e.length ? (z(), N("span", jC, [I(dn, {
16663
16663
  modifiers: "surface ring",
16664
16664
  "img-src": e[0].interface?.logo,
16665
16665
  name: e[0].name
@@ -20038,7 +20038,7 @@ var kC = { class: "flex items-center gap-xs min-w-0" }, AC = { class: "truncate"
20038
20038
  onKeydown: se
20039
20039
  }, [
20040
20040
  P("header", FT, [
20041
- e.organizationLogo || e.organizationName ? (z(), j(ln, {
20041
+ e.organizationLogo || e.organizationName ? (z(), j(dn, {
20042
20042
  key: 0,
20043
20043
  modifiers: "surface ring",
20044
20044
  class: "pk-chat-sidebar__org-logo",
@@ -20289,13 +20289,13 @@ var kC = { class: "flex items-center gap-xs min-w-0" }, AC = { class: "truncate"
20289
20289
  })) : M("", !0),
20290
20290
  P("ol", yE, [(z(!0), N(k, null, Cr(n.value, (e, a) => (z(), N("li", { key: a }, [
20291
20291
  P("span", { class: mr(["text-12 text-word-2 leading-none flex items-center gap-12 bg-surface-1 rounded-t border-t border-x border-surface-3 p-8", { "border-b rounded-b": !U(Te)(e) && !U(Ee)(e) }]) }, [
20292
- P("div", bE, [P("span", xE, [P("strong", SE, H(a + 1), 1), P("span", CE, "/" + H(n.value.length), 1)]), (U(Te)(e) || U(De)(e)) && U(dn)(e.state) ? (z(), j(u, {
20292
+ P("div", bE, [P("span", xE, [P("strong", SE, H(a + 1), 1), P("span", CE, "/" + H(n.value.length), 1)]), (U(Te)(e) || U(De)(e)) && U(nn)(e.state) ? (z(), j(u, {
20293
20293
  key: 0,
20294
20294
  name: "loading-loop",
20295
20295
  class: "w-12 h-12 ml-4"
20296
20296
  })) : (z(), j(u, {
20297
20297
  key: 1,
20298
- name: U(fn)(e) || "ri:question-line",
20298
+ name: U(rn)(e) || "ri:question-line",
20299
20299
  class: "w-12 h-12 ml-4"
20300
20300
  }, null, 8, ["name"]))]),
20301
20301
  P("code", wE, H(U(Oe)(e.type)), 1),
@@ -20518,7 +20518,7 @@ var kC = { class: "flex items-center gap-xs min-w-0" }, AC = { class: "truncate"
20518
20518
  }), p = A(() => f.value?.parts.find((e) => e.type === "text")?.text || "");
20519
20519
  return (t, r) => {
20520
20520
  let m = Vn, h = Rn, g = Jn;
20521
- return z(), N("div", WE, [P("div", GE, [P("div", KE, [I(ln, {
20521
+ return z(), N("div", WE, [P("div", GE, [P("div", KE, [I(dn, {
20522
20522
  modifiers: "surface ring shrink-0",
20523
20523
  class: "w-24 h-24",
20524
20524
  name: e.name
@@ -21043,6 +21043,6 @@ var KD = { class: "pk-table-sortable" }, qD = { key: 0 }, JD = {
21043
21043
  }
21044
21044
  });
21045
21045
  //#endregion
21046
- export { TC as AGENT_STATUS_GLYPHS, EC as AGENT_VISIBILITY_GLYPHS, RC as MODEL_CATALOG_KEY, NC as PkAgentSelectorInline, jT as PkAgentSettingsPanel, Le as PkAuroraCanvas, ln as PkAvatar, ni as PkBadge, _n as PkChatButton, WT as PkChatSidebar, NT as PkChatSidebarConversationItem, xn as PkChatbot, ve as PkChatbotAuth, yn as PkChatbotEmptyState, ye as PkChatbotError, un as PkChatbotFeedbackForm, on as PkChatbotFilePreview, vn as PkChatbotInput, je as PkChatbotMessages, hn as PkChatbotStepPayload, gn as PkChatbotStepToolDetail, mn as PkChatbotSteps, Be as PkChatbotViewChat, Ie as PkChatbotViewConversations, bn as PkChatbotViewProfile, WS as PkCheckboxField, Sn as PkChunkPreview, Ge as PkCode, gw as PkCopyBlock, Cn as PkDocumentHeader, Wi as PkEditorAgentType, n as PkEditorCheckboxButtons, Xa as PkEditorCode, na as PkEditorDocumentType, vo as PkEditorJsonSchema, yS as PkEditorMarkdown, bS as PkEditorMedia, da as PkEditorNotificationType, DS as PkEditorPrompt, t as PkEditorRadioButtons, FS as PkEditorRepeater, BS as PkEditorWyswyg, $a as PkFieldset, GS as PkInfobox, _w as PkInputColor, QS as PkIntegrationProvider, JC as PkLanguageModel, lw as PkLanguageModelCombobox, nn as PkLazyImg, eC as PkLightbox, iC as PkLoader, oC as PkMedia, UE as PkMessageDetail, AE as PkMessageParts, cw as PkModelOption, hC as PkOfflineScreen, CD as PkPagination, SC as PkPwaNotices, cD as PkReasoningChat, dw as PkReasoningSettings, We as PkRelativeTime, KT as PkRetryCountdown, fo as PkSchemaField, wC as PkSkeleton, be as PkStreamingMarkdown, pn as PkStreamingMarkdownAutoscroll, sn as PkSvgViewer, AD as PkTableEmpty, FD as PkTableError, iO as PkTableSortable, LC as PkToolApprovalBadge, Ke as PkToolShowArtifact, An as PkToolShowCalendarEvent, jn as PkToolShowComparison, kn as PkToolShowContactForm, Tn as PkToolShowEmail, r as PkToolShowForm, Pn as PkToolShowImageGallery, Mn as PkToolShowLocation, En as PkToolShowMessage, On as PkToolShowProductList, Nn as PkToolShowQrCode, wn as PkToolShowSources, Fn as PkToolShowSuggestedReply, Dn as PkToolShowWebPages, cn as PkUrl, ze as PkVoiceOrb, Re as PkVoiceSession, fw as PkWebSearchSettings, fD as PkWelcomePopup, DC as agentStatusGlyph, OC as agentVisibilityGlyph, JS as integrationProviderIcon, zC as provideModelCatalog, BC as useModelCatalogEntry };
21046
+ export { TC as AGENT_STATUS_GLYPHS, EC as AGENT_VISIBILITY_GLYPHS, RC as MODEL_CATALOG_KEY, NC as PkAgentSelectorInline, jT as PkAgentSettingsPanel, Le as PkAuroraCanvas, dn as PkAvatar, ni as PkBadge, _n as PkChatButton, WT as PkChatSidebar, NT as PkChatSidebarConversationItem, xn as PkChatbot, ve as PkChatbotAuth, yn as PkChatbotEmptyState, ye as PkChatbotError, fn as PkChatbotFeedbackForm, cn as PkChatbotFilePreview, vn as PkChatbotInput, je as PkChatbotMessages, hn as PkChatbotStepPayload, gn as PkChatbotStepToolDetail, mn as PkChatbotSteps, Be as PkChatbotViewChat, Ie as PkChatbotViewConversations, bn as PkChatbotViewProfile, WS as PkCheckboxField, Sn as PkChunkPreview, Ge as PkCode, gw as PkCopyBlock, Cn as PkDocumentHeader, Wi as PkEditorAgentType, n as PkEditorCheckboxButtons, Xa as PkEditorCode, na as PkEditorDocumentType, vo as PkEditorJsonSchema, yS as PkEditorMarkdown, bS as PkEditorMedia, da as PkEditorNotificationType, DS as PkEditorPrompt, t as PkEditorRadioButtons, FS as PkEditorRepeater, BS as PkEditorWyswyg, $a as PkFieldset, GS as PkInfobox, _w as PkInputColor, QS as PkIntegrationProvider, JC as PkLanguageModel, lw as PkLanguageModelCombobox, an as PkLazyImg, eC as PkLightbox, iC as PkLoader, oC as PkMedia, UE as PkMessageDetail, AE as PkMessageParts, cw as PkModelOption, hC as PkOfflineScreen, CD as PkPagination, SC as PkPwaNotices, cD as PkReasoningChat, dw as PkReasoningSettings, We as PkRelativeTime, KT as PkRetryCountdown, fo as PkSchemaField, wC as PkSkeleton, be as PkStreamingMarkdown, pn as PkStreamingMarkdownAutoscroll, ln as PkSvgViewer, AD as PkTableEmpty, FD as PkTableError, iO as PkTableSortable, LC as PkToolApprovalBadge, Ke as PkToolShowArtifact, An as PkToolShowCalendarEvent, jn as PkToolShowComparison, kn as PkToolShowContactForm, Tn as PkToolShowEmail, r as PkToolShowForm, Pn as PkToolShowImageGallery, Mn as PkToolShowLocation, En as PkToolShowMessage, On as PkToolShowProductList, Nn as PkToolShowQrCode, wn as PkToolShowSources, Fn as PkToolShowSuggestedReply, Dn as PkToolShowWebPages, un as PkUrl, ze as PkVoiceOrb, Re as PkVoiceSession, fw as PkWebSearchSettings, fD as PkWelcomePopup, DC as agentStatusGlyph, OC as agentVisibilityGlyph, JS as integrationProviderIcon, zC as provideModelCatalog, BC as useModelCatalogEntry };
21047
21047
 
21048
21048
  //# sourceMappingURL=index.js.map
@@ -6,6 +6,11 @@ type __VLS_Props = {
6
6
  animation?: StreamingAnimation;
7
7
  animationDuration?: string;
8
8
  isDark?: boolean;
9
+ /**
10
+ * Renders only the last `tailLength` characters, for a live box
11
+ * that follows the bottom of a text too long to parse whole.
12
+ */
13
+ tailLength?: number;
9
14
  };
10
15
  declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
11
16
  isDark: boolean;
@@ -13,6 +18,7 @@ declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, Compone
13
18
  markdown: string;
14
19
  animation: StreamingAnimation;
15
20
  animationDuration: string;
21
+ tailLength: number;
16
22
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
17
23
  declare const _default: typeof __VLS_export;
18
24
  export default _default;
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  markdown?: string;
4
4
  innerClass?: string;
5
5
  isDark?: boolean;
6
+ tailLength?: number;
6
7
  };
7
8
  declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
8
9
  declare const _default: typeof __VLS_export;
@@ -10,6 +10,22 @@ export declare function mergeConsecutiveTextParts(parts: UIMessage['parts']): UI
10
10
  export declare function isStreamingPart(part: UIMessage['parts'][number] | null | undefined): part is Extract<UIMessage['parts'][number], {
11
11
  streaming?: boolean;
12
12
  }>;
13
+ /**
14
+ * How much of a reasoning still being written its live box renders. The box is
15
+ * a few lines tall and follows the bottom, while the reasoning of one turn runs
16
+ * to tens of kilobytes: chat `st0Eg8iG0zUX0HQN` wrote 92KB, and parsing all of
17
+ * it at every delta froze the tab. Four thousand characters leave a few screens
18
+ * to scroll back through, and a finished step renders all of it.
19
+ */
20
+ export declare const LIVE_REASONING_TAIL_LENGTH = 4000;
21
+ /**
22
+ * The end of a markdown text, at most `maxLength` characters long, cut on a
23
+ * blank line (a line break when there is none) so it does not open on half a
24
+ * paragraph. A table or a formula can still be cut in two. An ellipsis marks
25
+ * the cut. A cut inside a fenced code block reopens the fence, or the rest of
26
+ * the text would render as code and the code as prose.
27
+ */
28
+ export declare function getMarkdownTail(markdown: string, maxLength: number): string;
13
29
  export declare function isToolApprovalPart(part: UIMessage['parts'][number] | null | undefined): boolean;
14
30
  /**
15
31
  * The client-side tool the model uses to have an action it described approved.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8wave/ai-elements",
3
3
  "private": false,
4
- "version": "0.111.0-beta.7",
4
+ "version": "0.111.0-beta.8",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite --port 8082 --open --host",