@8wave/ai-elements 0.126.0-beta.20 → 0.126.0-beta.22

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 (118) hide show
  1. package/dist/_chunks/{PkChatbotFilePreview-DHcHcy4x.js → PkChatbotFilePreview-jN3SAlut.js} +2 -2
  2. package/dist/_chunks/{PkChatbotFilePreview-DHcHcy4x.js.map → PkChatbotFilePreview-jN3SAlut.js.map} +1 -1
  3. package/dist/_chunks/{PkStreamingMarkdown-0lzE-l9f.js → PkStreamingMarkdown-qoTgaVHP.js} +2 -2
  4. package/dist/_chunks/{PkStreamingMarkdown-0lzE-l9f.js.map → PkStreamingMarkdown-qoTgaVHP.js.map} +1 -1
  5. package/dist/_chunks/{PkToolChatFile-x50rORrq.js → PkToolChatFile-uAyCds1k.js} +2 -2
  6. package/dist/_chunks/{PkToolChatFile-x50rORrq.js.map → PkToolChatFile-uAyCds1k.js.map} +1 -1
  7. package/dist/_chunks/{PkToolShareDocument-Cv7uBr5Z.js → PkToolShareDocument-NUMXFQ2e.js} +2 -2
  8. package/dist/_chunks/{PkToolShareDocument-Cv7uBr5Z.js.map → PkToolShareDocument-NUMXFQ2e.js.map} +1 -1
  9. package/dist/_chunks/{PkToolShowArtifact-DMIADTQ6.js → PkToolShowArtifact-D1p76r2a.js} +2 -2
  10. package/dist/_chunks/{PkToolShowArtifact-DMIADTQ6.js.map → PkToolShowArtifact-D1p76r2a.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowContactForm-B5DCcFqt.js → PkToolShowContactForm-B4S4qtxp.js} +2 -2
  12. package/dist/_chunks/{PkToolShowContactForm-B5DCcFqt.js.map → PkToolShowContactForm-B4S4qtxp.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowDiagram-DEFJr7zY.js → PkToolShowDiagram-CauQT97Z.js} +2 -2
  14. package/dist/_chunks/{PkToolShowDiagram-DEFJr7zY.js.map → PkToolShowDiagram-CauQT97Z.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowForm-BBxcDLyR.js → PkToolShowForm-1sJBr8KY.js} +2 -2
  16. package/dist/_chunks/{PkToolShowForm-BBxcDLyR.js.map → PkToolShowForm-1sJBr8KY.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowImageGallery-BYvCAUFX.js → PkToolShowImageGallery-DFhYCp-v.js} +2 -2
  18. package/dist/_chunks/{PkToolShowImageGallery-BYvCAUFX.js.map → PkToolShowImageGallery-DFhYCp-v.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowSources-DxZoqWZd.js → PkToolShowSources-DFHejVc0.js} +2 -2
  20. package/dist/_chunks/{PkToolShowSources-DxZoqWZd.js.map → PkToolShowSources-DFHejVc0.js.map} +1 -1
  21. package/dist/_chunks/{useLightbox-BlHExsUm.js → useLightbox-CUT_xmuZ.js} +100 -95
  22. package/dist/_chunks/useLightbox-CUT_xmuZ.js.map +1 -0
  23. package/dist/ai-elements.es.js +2316 -2153
  24. package/dist/ai-elements.es.js.map +1 -1
  25. package/dist-vue/PkChatbot.js +1 -1
  26. package/dist-vue/PkChatbotEmptyState.js +1 -1
  27. package/dist-vue/PkChatbotFilePreview.js +1 -1
  28. package/dist-vue/PkChatbotInput.js +1 -1
  29. package/dist-vue/PkChatbotMessages.js +1 -1
  30. package/dist-vue/PkChatbotSteps.js +1 -1
  31. package/dist-vue/PkChatbotViewChat.js +1 -1
  32. package/dist-vue/PkChatbotViewConversations.js +1 -1
  33. package/dist-vue/PkChatbotViewFiles.js +1 -1
  34. package/dist-vue/PkChatbotViewProfile.js +1 -1
  35. package/dist-vue/_chunks/{PkChatbot-CxphD_YU.js → PkChatbot-VJorpNbU.js} +7 -7
  36. package/dist-vue/_chunks/{PkChatbot-CxphD_YU.js.map → PkChatbot-VJorpNbU.js.map} +1 -1
  37. package/dist-vue/_chunks/{PkChatbotEmptyState-Jxc1HNJ5.js → PkChatbotEmptyState-B9dYpXZm.js} +2 -2
  38. package/dist-vue/_chunks/{PkChatbotEmptyState-Jxc1HNJ5.js.map → PkChatbotEmptyState-B9dYpXZm.js.map} +1 -1
  39. package/dist-vue/_chunks/{PkChatbotFilePreview-BDU2vY0F.js → PkChatbotFilePreview-5_bih_vc.js} +2 -2
  40. package/dist-vue/_chunks/{PkChatbotFilePreview-BDU2vY0F.js.map → PkChatbotFilePreview-5_bih_vc.js.map} +1 -1
  41. package/dist-vue/_chunks/{PkChatbotInput-DSdGtBTs.js → PkChatbotInput-BLKhf3WD.js} +3 -3
  42. package/dist-vue/_chunks/{PkChatbotInput-DSdGtBTs.js.map → PkChatbotInput-BLKhf3WD.js.map} +1 -1
  43. package/dist-vue/_chunks/{PkChatbotMessages-C7WSS6sd.js → PkChatbotMessages-Dx_IIX0J.js} +17 -17
  44. package/dist-vue/_chunks/{PkChatbotMessages-C7WSS6sd.js.map → PkChatbotMessages-Dx_IIX0J.js.map} +1 -1
  45. package/dist-vue/_chunks/{PkChatbotSteps-BMWrHfC9.js → PkChatbotSteps-BAQ1LriG.js} +2 -2
  46. package/dist-vue/_chunks/{PkChatbotSteps-BMWrHfC9.js.map → PkChatbotSteps-BAQ1LriG.js.map} +1 -1
  47. package/dist-vue/_chunks/PkChatbotViewChat-1RqLcPl4.js +1336 -0
  48. package/dist-vue/_chunks/PkChatbotViewChat-1RqLcPl4.js.map +1 -0
  49. package/dist-vue/_chunks/{PkChatbotViewConversations-BbCnRdv4.js → PkChatbotViewConversations-D0vDYTyo.js} +2 -2
  50. package/dist-vue/_chunks/{PkChatbotViewConversations-BbCnRdv4.js.map → PkChatbotViewConversations-D0vDYTyo.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkChatbotViewFiles-gwoZqmza.js → PkChatbotViewFiles-Bj5Nkzst.js} +2 -2
  52. package/dist-vue/_chunks/{PkChatbotViewFiles-gwoZqmza.js.map → PkChatbotViewFiles-Bj5Nkzst.js.map} +1 -1
  53. package/dist-vue/_chunks/{PkChatbotViewProfile-B7DroVld.js → PkChatbotViewProfile-GW0WuMOy.js} +2 -2
  54. package/dist-vue/_chunks/{PkChatbotViewProfile-B7DroVld.js.map → PkChatbotViewProfile-GW0WuMOy.js.map} +1 -1
  55. package/dist-vue/_chunks/{PkFilePreview-N0kWPuFh.js → PkFilePreview-Dkm34tMI.js} +2 -2
  56. package/dist-vue/_chunks/{PkFilePreview-N0kWPuFh.js.map → PkFilePreview-Dkm34tMI.js.map} +1 -1
  57. package/dist-vue/_chunks/{PkFilePreviewDialog-DqBESOIS.js → PkFilePreviewDialog-CZg7uqHL.js} +2 -2
  58. package/dist-vue/_chunks/{PkFilePreviewDialog-DqBESOIS.js.map → PkFilePreviewDialog-CZg7uqHL.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkStreamingMarkdown-BFBv_HdF.js → PkStreamingMarkdown-D6Qxwf47.js} +2 -2
  60. package/dist-vue/_chunks/{PkStreamingMarkdown-BFBv_HdF.js.map → PkStreamingMarkdown-D6Qxwf47.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkSvgViewer-CRNwb6Yn.js → PkSvgViewer-jCi13HSd.js} +2 -2
  62. package/dist-vue/_chunks/{PkSvgViewer-CRNwb6Yn.js.map → PkSvgViewer-jCi13HSd.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkToolChatFile-BntAINfN.js → PkToolChatFile-uO6r1l6t.js} +2 -2
  64. package/dist-vue/_chunks/{PkToolChatFile-BntAINfN.js.map → PkToolChatFile-uO6r1l6t.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkToolShareDocument-Bf7OE8XA.js → PkToolShareDocument-B7mMJJfn.js} +2 -2
  66. package/dist-vue/_chunks/{PkToolShareDocument-Bf7OE8XA.js.map → PkToolShareDocument-B7mMJJfn.js.map} +1 -1
  67. package/dist-vue/_chunks/{PkToolShowArtifact-PTyAPKlR.js → PkToolShowArtifact-VOfSN9nc.js} +2 -2
  68. package/dist-vue/_chunks/{PkToolShowArtifact-PTyAPKlR.js.map → PkToolShowArtifact-VOfSN9nc.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkToolShowContactForm-CGIA743D.js → PkToolShowContactForm-D9J0B3C-.js} +2 -2
  70. package/dist-vue/_chunks/{PkToolShowContactForm-CGIA743D.js.map → PkToolShowContactForm-D9J0B3C-.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkToolShowDiagram-CppjE7Vr.js → PkToolShowDiagram-BlV7ktLW.js} +2 -2
  72. package/dist-vue/_chunks/{PkToolShowDiagram-CppjE7Vr.js.map → PkToolShowDiagram-BlV7ktLW.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkToolShowForm-DLlcs1c4.js → PkToolShowForm-BCvqIlt_.js} +2 -2
  74. package/dist-vue/_chunks/{PkToolShowForm-DLlcs1c4.js.map → PkToolShowForm-BCvqIlt_.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkToolShowImageGallery-KP_ptp0w.js → PkToolShowImageGallery-D2DrAB9v.js} +3 -3
  76. package/dist-vue/_chunks/{PkToolShowImageGallery-KP_ptp0w.js.map → PkToolShowImageGallery-D2DrAB9v.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkToolShowLocation-Nhh_LwmN.js → PkToolShowLocation-BhVcLnkV.js} +2 -2
  78. package/dist-vue/_chunks/{PkToolShowLocation-Nhh_LwmN.js.map → PkToolShowLocation-BhVcLnkV.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkToolShowProductList-CbI-ncWs.js → PkToolShowProductList--MBQ_ztM.js} +2 -2
  80. package/dist-vue/_chunks/{PkToolShowProductList-CbI-ncWs.js.map → PkToolShowProductList--MBQ_ztM.js.map} +1 -1
  81. package/dist-vue/_chunks/{PkToolShowSources-E02Gy3vC.js → PkToolShowSources-D_KfNZ_Q.js} +2 -2
  82. package/dist-vue/_chunks/{PkToolShowSources-E02Gy3vC.js.map → PkToolShowSources-D_KfNZ_Q.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkToolShowVideo-DBqMV0U7.js → PkToolShowVideo-CS6iDwjn.js} +2 -2
  84. package/dist-vue/_chunks/{PkToolShowVideo-DBqMV0U7.js.map → PkToolShowVideo-CS6iDwjn.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkToolShowWebPages-2023cqa1.js → PkToolShowWebPages-y3sajjCP.js} +2 -2
  86. package/dist-vue/_chunks/{PkToolShowWebPages-2023cqa1.js.map → PkToolShowWebPages-y3sajjCP.js.map} +1 -1
  87. package/dist-vue/_chunks/{createChatbotApiClient-BACnmIzY.js → createChatbotApiClient-Pb7_cU2s.js} +105 -75
  88. package/dist-vue/_chunks/createChatbotApiClient-Pb7_cU2s.js.map +1 -0
  89. package/dist-vue/_chunks/{useChatbotStore-B-WenuyB.js → useChatbotStore-ChrZVIDt.js} +1172 -1141
  90. package/dist-vue/_chunks/useChatbotStore-ChrZVIDt.js.map +1 -0
  91. package/dist-vue/_chunks/{useLightbox-DmtNa8bJ.js → useLightbox-BZN3tRGu.js} +100 -95
  92. package/dist-vue/_chunks/useLightbox-BZN3tRGu.js.map +1 -0
  93. package/dist-vue/api.js +1 -1
  94. package/dist-vue/composables.js +76 -2
  95. package/dist-vue/composables.js.map +1 -1
  96. package/dist-vue/index.js +4304 -3590
  97. package/dist-vue/index.js.map +1 -1
  98. package/dist-vue/locales.js +78 -2
  99. package/dist-vue/packages/components/src/PkSchemaField.d.ts +2 -2
  100. package/dist-vue/packages/components/src/chat/PkChatProjectDialog.d.ts +50 -0
  101. package/dist-vue/packages/components/src/chat/PkChatProjectMoveDialog.d.ts +23 -0
  102. package/dist-vue/packages/components/src/chat/PkChatSidebar.d.ts +5 -2
  103. package/dist-vue/packages/components/src/chat/PkChatSidebarConversationItem.d.ts +12 -0
  104. package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +9 -3
  105. package/dist-vue/packages/components/src/chat/PkChatbotFeedbackForm.d.ts +2 -2
  106. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +20 -1
  107. package/dist-vue/packages/composable/src/chatbot/index.d.ts +1 -0
  108. package/dist-vue/packages/composable/src/chatbot/useChatProjectsStore.d.ts +4005 -0
  109. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +36 -6
  110. package/dist-vue/packages/models/src/schema/ChatProject.d.ts +10 -0
  111. package/dist-vue/style.css +1 -1
  112. package/package.json +1 -1
  113. package/dist/_chunks/useLightbox-BlHExsUm.js.map +0 -1
  114. package/dist-vue/_chunks/PkChatbotViewChat-2J6g9Etg.js +0 -1307
  115. package/dist-vue/_chunks/PkChatbotViewChat-2J6g9Etg.js.map +0 -1
  116. package/dist-vue/_chunks/createChatbotApiClient-BACnmIzY.js.map +0 -1
  117. package/dist-vue/_chunks/useChatbotStore-B-WenuyB.js.map +0 -1
  118. package/dist-vue/_chunks/useLightbox-DmtNa8bJ.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { t as e } from "./PkStreamingMarkdown-BFBv_HdF.js";
1
+ import { t as e } from "./PkStreamingMarkdown-D6Qxwf47.js";
2
2
  import { t } from "./PkChatbotStepToolDetail-CkIX0aKu.js";
3
3
  import { c as n, u as r } from "./message-DuibQyHy.js";
4
4
  import { t as i } from "./PkChatbotStepPayload-C4ahOq6Z.js";
@@ -212,4 +212,4 @@ var P = { class: "pk-field-changes text-14" }, F = { key: 0 }, I = { scope: "col
212
212
  });
213
213
  export { G as n, U as r, Z as t };
214
214
 
215
- //# sourceMappingURL=PkChatbotSteps-BMWrHfC9.js.map
215
+ //# sourceMappingURL=PkChatbotSteps-BAQ1LriG.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkChatbotSteps-BMWrHfC9.js","names":["$t","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_Fragment","_renderList","_openBlock","_createElementBlock","_createVNode","PkStreamingMarkdown","_normalizeClass","formatDuration","formatDurationWith","_openBlock","_createElementBlock","_createElementVNode","_createBlock","_toDisplayString","_unref","_createTextVNode","_Fragment","_createVNode","_renderList","_normalizeClass","_resolveDynamicComponent","_withCtx","PkFieldChanges","PkStreamingMarkdownAutoscroll","PkStreamingMarkdown","PkChatbotStepToolDetail","PkChatbotStepPayload","PkStreamingMarkdown_default","isReasoningPart","isToolPart","PkChatbotStepPayload_default","getToolPartLabel","hasRichToolDetail","hasPayload","getHostCallPart","getPartState","formatDuration","LIVE_REASONING_TAIL_LENGTH","HOST_STEP_CHANGES","HOST_STEP_TITLES","getToolPartSummary","getPartIcon","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","_hoisted_5$1","_hoisted_6$1","_hoisted_7$1","_hoisted_8$1","_hoisted_9$1","PkFieldChanges_default","defineComponent","props","__props","hasBefore","computed","change","openBlock","createElementBlock","createElementVNode","toDisplayString","_ctx","createCommentVNode","Fragment","renderList","index","NEAR_BOTTOM_PX","PkStreamingMarkdownAutoscroll_default","scrollEl","ref","contentEl","stopAutoScroll","followedTop","handleScroll","el","useResizeObserver","createVNode","normalizeClass","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","PkChatbotSteps_default","$t","$n","useI18n","hostStepTitles","inject","hostStepChanges","getStepError","part","steps","parts","partTimings","result","isReasoning","host","isTool","hostOpen","toolCallId","text","error","hasRichDetail","toolInput","toolOutput","changes","totalDurationMs","createdAt","completedAt","formatDuration$1","ms","manualSteps","reactive","isStepExpanded","step","toggleStep","manualGroup","isGroupExpanded","_component_VvIcon","VvIcon","_cache","createBlock","unref","createTextVNode","resolveDynamicComponent","withCtx","PkChatbotStepToolDetail_default"],"sources":["../../../../packages/components/src/chat/PkFieldChanges.vue","../../../../packages/components/src/chat/PkStreamingMarkdownAutoscroll.vue","../../../../packages/components/src/chat/PkChatbotSteps.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import type { StepFieldChange } from './utils'\n\n /**\n * What a submit or a save changes, as a table of each field, what it was\n * and what it becomes, marked as Word marks a revision: the confirmation\n * card asks with it (spec `page-tools-improvements.md`, M2), and the step\n * the automatic confirmations ran without a card keeps it (spec\n * `auto-confirmations.md`, \"Il resoconto in chat\").\n */\n const props = defineProps<{\n changes: StepFieldChange[]\n }>()\n\n // A form the agent filled from empty has nothing to strike: no column\n // of what was there, and the additions read without a header\n const hasBefore = computed(() =>\n props.changes.some((change) => !!change.before),\n )\n</script>\n\n<template>\n <table class=\"pk-field-changes text-14\">\n <thead v-if=\"hasBefore\">\n <tr>\n <th scope=\"col\">{{ $t('toolApproval.fieldColumn') }}</th>\n <th scope=\"col\">{{ $t('toolApproval.beforeColumn') }}</th>\n <th scope=\"col\">{{ $t('toolApproval.afterColumn') }}</th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(change, index) in changes\" :key=\"index\">\n <th scope=\"row\">{{ change.label }}</th>\n <td v-if=\"hasBefore\">\n <del\n v-if=\"change.before\"\n class=\"pk-field-changes__removed\"\n >{{ change.before }}</del\n >\n </td>\n <td>\n <ins v-if=\"change.value\" class=\"pk-field-changes__added\">{{\n change.value\n }}</ins>\n </td>\n </tr>\n </tbody>\n </table>\n</template>\n\n<style lang=\"scss\">\n // Each field on a row of its own, the name taking two fifths: long names\n // and values wrap instead of pushing the values out of the card\n .pk-field-changes {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n\n th,\n td {\n padding: var(--spacing-4) var(--spacing-8) var(--spacing-4) 0;\n text-align: start;\n vertical-align: top;\n overflow-wrap: anywhere;\n }\n\n th:first-child {\n width: 40%;\n }\n\n thead th {\n font-size: var(--text-12);\n font-weight: var(--font-normal);\n color: var(--color-word-3);\n }\n\n tbody th {\n font-weight: var(--font-normal);\n color: var(--color-word-2);\n }\n\n tr + tr,\n thead + tbody tr:first-child {\n border-top: var(--border) solid var(--color-surface-3);\n }\n }\n\n // Marked as Word marks a revision, as the file cards of the chat do\n // (`PkToolChatFile`): struck where the old value goes, underlined where\n // the new one comes. The base styles take the line off `del`.\n .pk-field-changes__removed {\n color: var(--u-danger-text);\n text-decoration: line-through;\n }\n\n .pk-field-changes__added {\n color: var(--u-success-text);\n font-weight: var(--font-medium);\n text-decoration: underline;\n text-underline-offset: 0.2em;\n }\n</style>\n","<script lang=\"ts\" setup>\n import { ref } from 'vue'\n import { useResizeObserver } from '@vueuse/core'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n defineProps<{\n markdown?: string\n innerClass?: string\n isDark?: boolean\n tailLength?: number\n }>()\n\n // Within this distance of the bottom the reader counts as being there.\n const NEAR_BOTTOM_PX = 8\n\n const scrollEl = ref<HTMLDivElement>()\n const contentEl = ref<InstanceType<typeof PkStreamingMarkdown>>()\n let stopAutoScroll = false\n // Where the last follow left the box: a scroll event reporting it is the\n // box's own, even when the content grew in the meantime.\n let followedTop: number | undefined\n\n // The follow stops when the reader leaves the bottom and resumes when they\n // are back. Measured from the bottom, not from the previous position: a\n // tail slides, so its height shrinks as often as it grows, and a shrink\n // moves the position up without the reader doing anything.\n const handleScroll = () => {\n const el = scrollEl.value\n if (!el || el.scrollTop === followedTop) {\n return\n }\n followedTop = undefined\n stopAutoScroll =\n el.scrollHeight - el.clientHeight - el.scrollTop > NEAR_BOTTOM_PX\n }\n\n // Driven by sizes, not by the prop: the markdown renders at most once per\n // interval, code, formulas and images grow after it, and the box itself\n // can be resized.\n const scrollToBottom = () => {\n const el = scrollEl.value\n if (!el) {\n return\n }\n // Content that fits leaves nothing to have scrolled away from, and no\n // scroll event would ever say the reader is back.\n if (el.scrollHeight <= el.clientHeight) {\n stopAutoScroll = false\n }\n if (stopAutoScroll) {\n return\n }\n el.scrollTop = el.scrollHeight\n followedTop = el.scrollTop\n }\n\n useResizeObserver([scrollEl, contentEl], scrollToBottom)\n</script>\n\n<template>\n <div ref=\"scrollEl\" class=\"overflow-auto\" @scroll=\"handleScroll\">\n <PkStreamingMarkdown\n ref=\"contentEl\"\n :markdown\n :is-dark\n :tail-length\n :class=\"innerClass\" />\n </div>\n</template>\n","<script lang=\"ts\" setup>\n import { computed, inject, reactive, ref } from 'vue'\n import { useI18n } from 'vue-i18n'\n import type { UIChatMessage } from 'models'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkStreamingMarkdownAutoscroll from './PkStreamingMarkdownAutoscroll.vue'\n import PkChatbotStepToolDetail from './PkChatbotStepToolDetail.vue'\n import PkChatbotStepPayload from './PkChatbotStepPayload.vue'\n import PkFieldChanges from './PkFieldChanges.vue'\n import {\n isReasoningPart,\n isToolPart,\n getHostCallPart,\n getPartIcon,\n getPartState,\n getToolPartLabel,\n getToolPartSummary,\n HOST_STEP_CHANGES,\n HOST_STEP_TITLES,\n hasRichToolDetail,\n type StepFieldChange,\n hasPayload,\n formatDuration as formatDurationWith,\n LIVE_REASONING_TAIL_LENGTH,\n } from './utils'\n\n const props = defineProps<{\n message: UIChatMessage\n isStreaming?: boolean\n // Something is drawn below the timeline (a text, a card, a tool).\n hasContent?: boolean\n // The agent hides the text of its reasoning: its step stays, closed\n hideReasoning?: boolean\n isDark?: boolean\n }>()\n\n const { t: $t, n: $n } = useI18n({\n useScope: 'global',\n })\n // What each page step acts on, while the page is open\n const hostStepTitles = inject(HOST_STEP_TITLES, undefined)\n // And what it changed, when the automatic confirmations asked nothing\n const hostStepChanges = inject(HOST_STEP_CHANGES, undefined)\n\n type MessagePart = UIChatMessage['parts'][number]\n\n interface Step {\n key: string\n part: MessagePart\n icon?: string\n label?: string\n summary?: string\n durationMs?: number\n isActive: boolean\n text?: string\n error?: string\n hasRichDetail: boolean\n hasBody: boolean\n toolInput?: unknown\n toolOutput?: unknown\n /** What a step the automatic confirmations ran without a card changed. */\n changes?: StepFieldChange[]\n }\n\n const getStepError = (part: MessagePart) =>\n getPartState(part) === 'output-error' &&\n 'errorText' in part &&\n typeof part.errorText === 'string'\n ? part.errorText\n : undefined\n\n // What the step header needs is decided here, once per recomputation.\n // `hasBody` was a function the template called six times per step, and\n // `steps` recomputes at every delta of the stream: on a tool answering\n // hundreds of kilobytes, where the answer comes from `hasPayload` and\n // `hasPayload` serializes the whole payload to find out, that is the same\n // JSON.stringify six times for one boolean.\n //\n // The two payload blocks keep asking for themselves, because they render\n // only inside an expanded step: deciding here whether to show the output\n // would serialize it for every step the reader never opens, which is all\n // of them by default.\n const steps = computed<Step[]>(() => {\n const parts = props.message.parts\n const partTimings = props.message.metadata?.partTimings\n const result: Step[] = []\n for (const [index, part] of parts.entries()) {\n const isReasoning = isReasoningPart(part)\n const host = getHostCallPart(part)\n const isTool = isToolPart(part) || Boolean(host)\n if (!isReasoning && !isTool) {\n continue\n }\n // A host call stays open while the page runs it, after the stream\n // that announced it has ended: every open one is in progress then,\n // and one still open once nothing runs got no answer.\n const hostOpen = host?.state === 'input-available'\n const toolCallId =\n 'toolCallId' in part ? (part.toolCallId as string) : undefined\n const text =\n isReasoning && !props.hideReasoning && part.text.trim()\n ? part.text\n : undefined\n const error = getStepError(part)\n const hasRichDetail = hasRichToolDetail(part)\n const toolInput = isTool && 'input' in part ? part.input : undefined\n const toolOutput =\n isTool && 'output' in part ? part.output : undefined\n const changes = toolCallId\n ? hostStepChanges?.value[toolCallId]?.details\n : undefined\n result.push({\n key: toolCallId ?? `${part.type}-${index}`,\n part,\n icon: getPartIcon(part),\n label: getToolPartLabel($t, part, hostStepTitles?.value),\n summary:\n hostOpen && !props.isStreaming\n ? $t('messagePart.hostToolNoAnswer')\n : getToolPartSummary(part),\n durationMs: toolCallId ? partTimings?.[toolCallId] : undefined,\n isActive:\n Boolean(props.isStreaming) &&\n (host ? hostOpen : index === parts.length - 1),\n text,\n error,\n hasRichDetail,\n // The `||` short-circuits as the old function did: a tool\n // with an input never serializes its output to answer this.\n hasBody: Boolean(\n changes?.length ||\n text ||\n error ||\n (hasRichDetail\n ? toolInput !== undefined || toolOutput !== undefined\n : hasPayload(toolInput) || hasPayload(toolOutput)),\n ),\n toolInput,\n toolOutput,\n changes,\n })\n }\n return result\n })\n\n const totalDurationMs = computed(() => {\n const { createdAt, completedAt } = props.message.metadata ?? {}\n if (!createdAt || !completedAt) {\n return undefined\n }\n return completedAt - createdAt\n })\n\n const formatDuration = (ms?: number) => formatDurationWith($n, ms)\n\n // --- Expand / collapse ---\n // Every step starts closed, the running one included: the timeline says\n // what the answer is doing, the body is opened only when asked for. The\n // reasoning of the active step still follows the stream once opened.\n const manualSteps = reactive(new Map<string, boolean>())\n const isStepExpanded = (step: Step) => manualSteps.get(step.key) ?? false\n const toggleStep = (step: Step) => {\n manualSteps.set(step.key, !isStepExpanded(step))\n }\n\n // The group is open while streaming and collapses to its header as soon\n // as the answer draws something below it, unless the user toggled it\n // manually: from then on the activity reads at the bottom of the answer,\n // and an open list growing above it would push the answer down.\n //\n // The user's choices last as long as the message: an answer that resumes\n // after a pause (an approval, a form, a tool the client runs) streams\n // into the same message and must not close what the reader opened. A\n // regenerated answer is a new message, with a fresh timeline.\n const manualGroup = ref<boolean | undefined>(undefined)\n const isGroupExpanded = computed(\n () =>\n manualGroup.value ??\n (Boolean(props.isStreaming) && !props.hasContent),\n )\n</script>\n\n<template>\n <div v-if=\"steps.length\" class=\"pk-chatbot-steps\">\n <button\n type=\"button\"\n class=\"pk-chatbot-steps__header\"\n :aria-expanded=\"isGroupExpanded\"\n @click=\"manualGroup = !isGroupExpanded\">\n <VvIcon v-if=\"isStreaming\" name=\"loading-loop\" class=\"shrink-0\" />\n <VvIcon v-else name=\"ri:route-line\" class=\"shrink-0\" />\n <span class=\"pk-chatbot-steps__title\">\n {{ $t('messagePart.steps') }}\n </span>\n <span class=\"pk-chatbot-steps__meta\">\n {{ $t('messagePart.stepCount', steps.length) }}\n <template v-if=\"formatDuration(totalDurationMs)\">\n · {{ formatDuration(totalDurationMs) }}\n </template>\n </span>\n <VvIcon\n :name=\"\n isGroupExpanded\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"pk-chatbot-steps__chevron shrink-0 ml-auto\" />\n </button>\n <ol v-if=\"isGroupExpanded\" class=\"pk-chatbot-steps__list\">\n <li\n v-for=\"step in steps\"\n :key=\"step.key\"\n class=\"pk-chatbot-steps__step\"\n :class=\"{\n 'pk-chatbot-steps__step--active': step.isActive,\n }\">\n <component\n :is=\"step.hasBody ? 'button' : 'div'\"\n :type=\"step.hasBody ? 'button' : undefined\"\n class=\"pk-chatbot-steps__step-header\"\n :aria-expanded=\"\n step.hasBody ? isStepExpanded(step) : undefined\n \"\n @click=\"step.hasBody ? toggleStep(step) : undefined\">\n <span\n class=\"pk-chatbot-steps-marker\"\n :class=\"{\n 'pk-chatbot-steps-marker--active': step.isActive,\n }\">\n <VvIcon v-if=\"step.isActive\" name=\"loading-loop\" />\n <VvIcon v-else-if=\"step.icon\" :name=\"step.icon\" />\n </span>\n <span class=\"pk-chatbot-steps__step-label\">\n {{ step.label }}\n </span>\n <span class=\"pk-chatbot-steps__step-summary\">\n {{ step.summary }}\n </span>\n <span\n v-if=\"formatDuration(step.durationMs)\"\n class=\"pk-chatbot-steps__step-duration\">\n {{ formatDuration(step.durationMs) }}\n </span>\n <VvIcon\n v-if=\"step.hasBody\"\n :name=\"\n isStepExpanded(step)\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"pk-chatbot-steps__chevron shrink-0 ml-auto\" />\n </component>\n <div\n v-if=\"step.hasBody && isStepExpanded(step)\"\n class=\"pk-chatbot-steps__step-body\">\n <!-- What it changed without a card (spec\n auto-confirmations.md) -->\n <PkFieldChanges\n v-if=\"step.changes?.length\"\n :changes=\"step.changes\"\n class=\"mb-xs\" />\n <PkStreamingMarkdownAutoscroll\n v-if=\"step.text && step.isActive\"\n :markdown=\"step.text\"\n :is-dark\n :tail-length=\"LIVE_REASONING_TAIL_LENGTH\"\n inner-class=\"wysiwyg\"\n class=\"pk-chatbot-steps__step-content pk-chatbot-steps__step-content--scroll\" />\n <div\n v-else-if=\"step.text\"\n class=\"pk-chatbot-steps__step-content pk-chatbot-steps__step-content--scroll\">\n <PkStreamingMarkdown\n :markdown=\"step.text\"\n :is-dark\n class=\"wysiwyg\" />\n </div>\n <div\n v-else-if=\"step.error\"\n class=\"pk-chatbot-steps__step-payload pk-chatbot-steps__step-payload--error\">\n <span class=\"pk-chatbot-steps__step-payload-label\">\n {{ $t('messagePart.stepError') }}\n </span>\n <pre>{{ step.error }}</pre>\n </div>\n <PkChatbotStepToolDetail\n v-else-if=\"step.hasRichDetail\"\n :part=\"step.part\" />\n <template v-else>\n <PkChatbotStepPayload\n v-if=\"hasPayload(step.toolInput)\"\n :label=\"$t('messagePart.stepInput')\"\n :value=\"step.toolInput\" />\n <PkChatbotStepPayload\n v-if=\"hasPayload(step.toolOutput)\"\n :label=\"$t('messagePart.stepOutput')\"\n :value=\"step.toolOutput\" />\n </template>\n </div>\n </li>\n </ol>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-steps {\n width: 100%;\n border: var(--spacing-px) solid var(--color-surface-3);\n border-radius: var(--rounded-lg);\n background-color: var(--color-surface-1);\n font-size: var(--text-12);\n color: var(--color-word-3);\n overflow: hidden;\n\n &__header {\n display: flex;\n align-items: center;\n gap: var(--spacing-8);\n width: 100%;\n min-height: var(--spacing-40);\n padding: var(--spacing-8) var(--spacing-sm);\n text-align: left;\n cursor: pointer;\n transition: background-color 0.2s ease;\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n }\n\n &__chevron {\n font-size: var(--text-16);\n }\n\n &__title {\n font-weight: 600;\n color: var(--color-word-2);\n flex-grow: 1;\n }\n\n &__meta {\n color: var(--color-word-4);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n }\n\n &__list {\n background-color: var(--color-surface);\n border-top: var(--spacing-px) solid var(--color-surface-3);\n padding: var(--spacing-8) var(--spacing-sm);\n display: flex;\n flex-direction: column;\n }\n\n &__step {\n position: relative;\n\n // Vertical connector between step markers\n &:not(:last-child)::before {\n content: '';\n position: absolute;\n left: var(--spacing-10);\n top: var(--spacing-28);\n bottom: calc(var(--spacing-8) * -1);\n width: var(--spacing-px);\n background-color: var(--color-surface-4);\n }\n }\n\n &__step-header {\n display: flex;\n align-items: center;\n gap: var(--spacing-8);\n width: calc(100% + var(--spacing-16));\n min-height: var(--spacing-36);\n margin-inline: calc(var(--spacing-8) * -1);\n padding: var(--spacing-4) var(--spacing-8);\n text-align: left;\n\n &:is(button) {\n cursor: pointer;\n border-radius: var(--rounded);\n transition: background-color 0.2s ease;\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n }\n }\n\n &-marker {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--spacing-20);\n height: var(--spacing-20);\n flex-shrink: 0;\n position: relative;\n z-index: 1;\n background-color: var(--color-surface-1);\n border-radius: var(--rounded-full);\n border: var(--spacing-px) solid var(--color-surface-4);\n\n &--active {\n background-color: var(\n --chatbot-main-color,\n var(--color-surface-4)\n );\n border-color: transparent;\n color: var(--chatbot-contrast-color, var(--color-word-1));\n }\n }\n\n &__step-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--color-word-2);\n }\n\n &__step-summary {\n flex: 1 1 0;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--color-word-4);\n }\n\n &__step-duration {\n color: var(--color-word-4);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n }\n\n &__step--active &__step-label {\n color: var(--color-word-1);\n }\n\n &__step-body {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-4);\n margin-left: var(--spacing-28);\n margin-block: var(--spacing-4) var(--spacing-8);\n }\n\n &__step-content {\n border: var(--spacing-px) solid var(--color-surface-3);\n border-radius: var(--rounded);\n padding: var(--spacing-8);\n background-color: var(--color-surface-1);\n\n // The finished reasoning keeps the cap the streaming one had:\n // `.wysiwyg` hides its own overflow, so the scroll belongs to the\n // wrapper, exactly as in the autoscroll variant.\n &--scroll {\n max-height: var(--spacing-256);\n overflow: auto;\n }\n }\n\n &__step-payload {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-2);\n\n pre {\n border: var(--spacing-px) solid var(--color-surface-3);\n border-radius: var(--rounded);\n padding: var(--spacing-8);\n font-size: var(--text-10);\n max-height: var(--spacing-160);\n overflow: auto;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n font-family: var(--font-mono);\n background-color: var(--color-surface-1);\n }\n }\n\n &__step-payload-label {\n font-weight: 600;\n color: var(--color-word-3);\n text-transform: uppercase;\n font-size: var(--text-10);\n letter-spacing: 0.05em;\n }\n\n &__step-payload--error {\n .pk-chatbot-steps__step-payload-label,\n pre {\n color: var(--u-danger-text, var(--color-danger));\n }\n\n pre {\n border-color: var(--color-danger-lighten-5);\n }\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAWI,IAAMmE,IAAQC,GAMRC,IAAYC,QACdH,EAAM,QAAQ,MAAM,MAAW,CAAC,CAACI,EAAO,MAAM,CAClD;E,kBAIA7D,EAAA,GAAAC,EAyBQ,SAzBRV,GAyBQ,CAxBSoE,EAAA,SAAb3D,EAAA,GAAAC,EAMQ,SAAAT,GAAA,CALJU,EAIK,MAAA,MAAA;GAHDA,EAAyD,MAAzDT,GAAyDU,EAAtCb,EAAAA,GAAE,0BAAA,CAAA,GAAA,CAAA;GACrBY,EAA0D,MAA1DR,GAA0DS,EAAvCb,EAAAA,GAAE,2BAAA,CAAA,GAAA,CAAA;GACrBY,EAAyD,MAAzDP,GAAyDQ,EAAtCb,EAAAA,GAAE,0BAAA,CAAA,GAAA,CAAA;E,mBAG7BY,EAgBQ,SAAA,MAAA,EAfJF,EAAA,EAAA,GAAAC,EAcKG,GAAA,MAAAC,EAdyBqD,EAAA,UAAlB,GAAQ,OAApB1D,EAAA,GAAAC,EAcK,MAAA,EAdmC,KAAKqE,EAAK,GAAA;GAC9CpE,EAAuC,MAAvCN,GAAuCO,EAApB0D,EAAO,KAAK,GAAA,CAAA;GACrBF,EAAA,SAAV3D,EAAA,GAAAC,EAMK,MAAAJ,G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QoC,EAAK,SAAS,UADxBlH,EAAA,GAAAG,EAGoBU,GAAA;;IADf,SAASqG,EAAK;IACf,OAAM;G,uCAEAA,EAAK,QAAQA,EAAK,YAD5BlH,EAAA,GAAAG,EAMoFW,GAAA;;IAJ/E,UAAUoG,EAAK;IACf,WAAArE,EAAA;IACA,eAAaxC,EAAAuB,CAAA;IACd,eAAY;IACZ,OAAM;;;;;G,MAEKsF,EAAK,QADpBlH,EAAA,GAAAC,EAOM,OAPN8E,IAOM,CAJFvE,EAGsBO,GAAA;IAFjB,UAAUmG,EAAK;IACf,WAAArE,EAAA;IACD,OAAM;G,0CAGCqE,EAAK,SADpBlH,EAAA,GAAAC,EAOM,OAPN+E,GAOM,CAJF9E,EAEO,QAFP+E,IAEO7E,EADAC,EAAA8E,CAAA,CAAE,CAAA,uBAAA,CAAA,GAAA,CAAA,GAETjF,EAA2B,OAAA,MAAAE,EAAnB8G,EAAK,KAAK,GAAA,CAAA,C,MAGPA,EAAK,iBADpBlH,EAAA,GAAAG,EAEwBa,GAAA;;IAAnB,MAAMkG,EAAK;G,0BAChBlH,EAAA,GAAAC,EASWM,GAAA,EAAA,KAAA,EAAA,GAAA,CAPGF,EAAAmB,CAAA,CAAU,CAAC0F,EAAK,SAAS,KADnClH,EAAA,GAAAG,EAG8Bc,GAAA;;IADzB,OAAOZ,EAAA8E,CAAA,CAAE,CAAA,uBAAA;IACT,OAAO+B,EAAK;G,8CAEP7G,EAAAmB,CAAA,CAAU,CAAC0F,EAAK,UAAU,KADpClH,EAAA,GAAAG,EAG+Bc,GAAA;;IAD1B,OAAOZ,EAAA8E,CAAA,CAAE,CAAA,wBAAA;IACT,OAAO+B,EAAK"}
1
+ {"version":3,"file":"PkChatbotSteps-BAQ1LriG.js","names":["$t","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_Fragment","_renderList","_openBlock","_createElementBlock","_createVNode","PkStreamingMarkdown","_normalizeClass","formatDuration","formatDurationWith","_openBlock","_createElementBlock","_createElementVNode","_createBlock","_toDisplayString","_unref","_createTextVNode","_Fragment","_createVNode","_renderList","_normalizeClass","_resolveDynamicComponent","_withCtx","PkFieldChanges","PkStreamingMarkdownAutoscroll","PkStreamingMarkdown","PkChatbotStepToolDetail","PkChatbotStepPayload","PkStreamingMarkdown_default","isReasoningPart","isToolPart","PkChatbotStepPayload_default","getToolPartLabel","hasRichToolDetail","hasPayload","getHostCallPart","getPartState","formatDuration","LIVE_REASONING_TAIL_LENGTH","HOST_STEP_CHANGES","HOST_STEP_TITLES","getToolPartSummary","getPartIcon","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","_hoisted_5$1","_hoisted_6$1","_hoisted_7$1","_hoisted_8$1","_hoisted_9$1","PkFieldChanges_default","defineComponent","props","__props","hasBefore","computed","change","openBlock","createElementBlock","createElementVNode","toDisplayString","_ctx","createCommentVNode","Fragment","renderList","index","NEAR_BOTTOM_PX","PkStreamingMarkdownAutoscroll_default","scrollEl","ref","contentEl","stopAutoScroll","followedTop","handleScroll","el","useResizeObserver","createVNode","normalizeClass","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","PkChatbotSteps_default","$t","$n","useI18n","hostStepTitles","inject","hostStepChanges","getStepError","part","steps","parts","partTimings","result","isReasoning","host","isTool","hostOpen","toolCallId","text","error","hasRichDetail","toolInput","toolOutput","changes","totalDurationMs","createdAt","completedAt","formatDuration$1","ms","manualSteps","reactive","isStepExpanded","step","toggleStep","manualGroup","isGroupExpanded","_component_VvIcon","VvIcon","_cache","createBlock","unref","createTextVNode","resolveDynamicComponent","withCtx","PkChatbotStepToolDetail_default"],"sources":["../../../../packages/components/src/chat/PkFieldChanges.vue","../../../../packages/components/src/chat/PkStreamingMarkdownAutoscroll.vue","../../../../packages/components/src/chat/PkChatbotSteps.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import type { StepFieldChange } from './utils'\n\n /**\n * What a submit or a save changes, as a table of each field, what it was\n * and what it becomes, marked as Word marks a revision: the confirmation\n * card asks with it (spec `page-tools-improvements.md`, M2), and the step\n * the automatic confirmations ran without a card keeps it (spec\n * `auto-confirmations.md`, \"Il resoconto in chat\").\n */\n const props = defineProps<{\n changes: StepFieldChange[]\n }>()\n\n // A form the agent filled from empty has nothing to strike: no column\n // of what was there, and the additions read without a header\n const hasBefore = computed(() =>\n props.changes.some((change) => !!change.before),\n )\n</script>\n\n<template>\n <table class=\"pk-field-changes text-14\">\n <thead v-if=\"hasBefore\">\n <tr>\n <th scope=\"col\">{{ $t('toolApproval.fieldColumn') }}</th>\n <th scope=\"col\">{{ $t('toolApproval.beforeColumn') }}</th>\n <th scope=\"col\">{{ $t('toolApproval.afterColumn') }}</th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(change, index) in changes\" :key=\"index\">\n <th scope=\"row\">{{ change.label }}</th>\n <td v-if=\"hasBefore\">\n <del\n v-if=\"change.before\"\n class=\"pk-field-changes__removed\"\n >{{ change.before }}</del\n >\n </td>\n <td>\n <ins v-if=\"change.value\" class=\"pk-field-changes__added\">{{\n change.value\n }}</ins>\n </td>\n </tr>\n </tbody>\n </table>\n</template>\n\n<style lang=\"scss\">\n // Each field on a row of its own, the name taking two fifths: long names\n // and values wrap instead of pushing the values out of the card\n .pk-field-changes {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n\n th,\n td {\n padding: var(--spacing-4) var(--spacing-8) var(--spacing-4) 0;\n text-align: start;\n vertical-align: top;\n overflow-wrap: anywhere;\n }\n\n th:first-child {\n width: 40%;\n }\n\n thead th {\n font-size: var(--text-12);\n font-weight: var(--font-normal);\n color: var(--color-word-3);\n }\n\n tbody th {\n font-weight: var(--font-normal);\n color: var(--color-word-2);\n }\n\n tr + tr,\n thead + tbody tr:first-child {\n border-top: var(--border) solid var(--color-surface-3);\n }\n }\n\n // Marked as Word marks a revision, as the file cards of the chat do\n // (`PkToolChatFile`): struck where the old value goes, underlined where\n // the new one comes. The base styles take the line off `del`.\n .pk-field-changes__removed {\n color: var(--u-danger-text);\n text-decoration: line-through;\n }\n\n .pk-field-changes__added {\n color: var(--u-success-text);\n font-weight: var(--font-medium);\n text-decoration: underline;\n text-underline-offset: 0.2em;\n }\n</style>\n","<script lang=\"ts\" setup>\n import { ref } from 'vue'\n import { useResizeObserver } from '@vueuse/core'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n defineProps<{\n markdown?: string\n innerClass?: string\n isDark?: boolean\n tailLength?: number\n }>()\n\n // Within this distance of the bottom the reader counts as being there.\n const NEAR_BOTTOM_PX = 8\n\n const scrollEl = ref<HTMLDivElement>()\n const contentEl = ref<InstanceType<typeof PkStreamingMarkdown>>()\n let stopAutoScroll = false\n // Where the last follow left the box: a scroll event reporting it is the\n // box's own, even when the content grew in the meantime.\n let followedTop: number | undefined\n\n // The follow stops when the reader leaves the bottom and resumes when they\n // are back. Measured from the bottom, not from the previous position: a\n // tail slides, so its height shrinks as often as it grows, and a shrink\n // moves the position up without the reader doing anything.\n const handleScroll = () => {\n const el = scrollEl.value\n if (!el || el.scrollTop === followedTop) {\n return\n }\n followedTop = undefined\n stopAutoScroll =\n el.scrollHeight - el.clientHeight - el.scrollTop > NEAR_BOTTOM_PX\n }\n\n // Driven by sizes, not by the prop: the markdown renders at most once per\n // interval, code, formulas and images grow after it, and the box itself\n // can be resized.\n const scrollToBottom = () => {\n const el = scrollEl.value\n if (!el) {\n return\n }\n // Content that fits leaves nothing to have scrolled away from, and no\n // scroll event would ever say the reader is back.\n if (el.scrollHeight <= el.clientHeight) {\n stopAutoScroll = false\n }\n if (stopAutoScroll) {\n return\n }\n el.scrollTop = el.scrollHeight\n followedTop = el.scrollTop\n }\n\n useResizeObserver([scrollEl, contentEl], scrollToBottom)\n</script>\n\n<template>\n <div ref=\"scrollEl\" class=\"overflow-auto\" @scroll=\"handleScroll\">\n <PkStreamingMarkdown\n ref=\"contentEl\"\n :markdown\n :is-dark\n :tail-length\n :class=\"innerClass\" />\n </div>\n</template>\n","<script lang=\"ts\" setup>\n import { computed, inject, reactive, ref } from 'vue'\n import { useI18n } from 'vue-i18n'\n import type { UIChatMessage } from 'models'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkStreamingMarkdownAutoscroll from './PkStreamingMarkdownAutoscroll.vue'\n import PkChatbotStepToolDetail from './PkChatbotStepToolDetail.vue'\n import PkChatbotStepPayload from './PkChatbotStepPayload.vue'\n import PkFieldChanges from './PkFieldChanges.vue'\n import {\n isReasoningPart,\n isToolPart,\n getHostCallPart,\n getPartIcon,\n getPartState,\n getToolPartLabel,\n getToolPartSummary,\n HOST_STEP_CHANGES,\n HOST_STEP_TITLES,\n hasRichToolDetail,\n type StepFieldChange,\n hasPayload,\n formatDuration as formatDurationWith,\n LIVE_REASONING_TAIL_LENGTH,\n } from './utils'\n\n const props = defineProps<{\n message: UIChatMessage\n isStreaming?: boolean\n // Something is drawn below the timeline (a text, a card, a tool).\n hasContent?: boolean\n // The agent hides the text of its reasoning: its step stays, closed\n hideReasoning?: boolean\n isDark?: boolean\n }>()\n\n const { t: $t, n: $n } = useI18n({\n useScope: 'global',\n })\n // What each page step acts on, while the page is open\n const hostStepTitles = inject(HOST_STEP_TITLES, undefined)\n // And what it changed, when the automatic confirmations asked nothing\n const hostStepChanges = inject(HOST_STEP_CHANGES, undefined)\n\n type MessagePart = UIChatMessage['parts'][number]\n\n interface Step {\n key: string\n part: MessagePart\n icon?: string\n label?: string\n summary?: string\n durationMs?: number\n isActive: boolean\n text?: string\n error?: string\n hasRichDetail: boolean\n hasBody: boolean\n toolInput?: unknown\n toolOutput?: unknown\n /** What a step the automatic confirmations ran without a card changed. */\n changes?: StepFieldChange[]\n }\n\n const getStepError = (part: MessagePart) =>\n getPartState(part) === 'output-error' &&\n 'errorText' in part &&\n typeof part.errorText === 'string'\n ? part.errorText\n : undefined\n\n // What the step header needs is decided here, once per recomputation.\n // `hasBody` was a function the template called six times per step, and\n // `steps` recomputes at every delta of the stream: on a tool answering\n // hundreds of kilobytes, where the answer comes from `hasPayload` and\n // `hasPayload` serializes the whole payload to find out, that is the same\n // JSON.stringify six times for one boolean.\n //\n // The two payload blocks keep asking for themselves, because they render\n // only inside an expanded step: deciding here whether to show the output\n // would serialize it for every step the reader never opens, which is all\n // of them by default.\n const steps = computed<Step[]>(() => {\n const parts = props.message.parts\n const partTimings = props.message.metadata?.partTimings\n const result: Step[] = []\n for (const [index, part] of parts.entries()) {\n const isReasoning = isReasoningPart(part)\n const host = getHostCallPart(part)\n const isTool = isToolPart(part) || Boolean(host)\n if (!isReasoning && !isTool) {\n continue\n }\n // A host call stays open while the page runs it, after the stream\n // that announced it has ended: every open one is in progress then,\n // and one still open once nothing runs got no answer.\n const hostOpen = host?.state === 'input-available'\n const toolCallId =\n 'toolCallId' in part ? (part.toolCallId as string) : undefined\n const text =\n isReasoning && !props.hideReasoning && part.text.trim()\n ? part.text\n : undefined\n const error = getStepError(part)\n const hasRichDetail = hasRichToolDetail(part)\n const toolInput = isTool && 'input' in part ? part.input : undefined\n const toolOutput =\n isTool && 'output' in part ? part.output : undefined\n const changes = toolCallId\n ? hostStepChanges?.value[toolCallId]?.details\n : undefined\n result.push({\n key: toolCallId ?? `${part.type}-${index}`,\n part,\n icon: getPartIcon(part),\n label: getToolPartLabel($t, part, hostStepTitles?.value),\n summary:\n hostOpen && !props.isStreaming\n ? $t('messagePart.hostToolNoAnswer')\n : getToolPartSummary(part),\n durationMs: toolCallId ? partTimings?.[toolCallId] : undefined,\n isActive:\n Boolean(props.isStreaming) &&\n (host ? hostOpen : index === parts.length - 1),\n text,\n error,\n hasRichDetail,\n // The `||` short-circuits as the old function did: a tool\n // with an input never serializes its output to answer this.\n hasBody: Boolean(\n changes?.length ||\n text ||\n error ||\n (hasRichDetail\n ? toolInput !== undefined || toolOutput !== undefined\n : hasPayload(toolInput) || hasPayload(toolOutput)),\n ),\n toolInput,\n toolOutput,\n changes,\n })\n }\n return result\n })\n\n const totalDurationMs = computed(() => {\n const { createdAt, completedAt } = props.message.metadata ?? {}\n if (!createdAt || !completedAt) {\n return undefined\n }\n return completedAt - createdAt\n })\n\n const formatDuration = (ms?: number) => formatDurationWith($n, ms)\n\n // --- Expand / collapse ---\n // Every step starts closed, the running one included: the timeline says\n // what the answer is doing, the body is opened only when asked for. The\n // reasoning of the active step still follows the stream once opened.\n const manualSteps = reactive(new Map<string, boolean>())\n const isStepExpanded = (step: Step) => manualSteps.get(step.key) ?? false\n const toggleStep = (step: Step) => {\n manualSteps.set(step.key, !isStepExpanded(step))\n }\n\n // The group is open while streaming and collapses to its header as soon\n // as the answer draws something below it, unless the user toggled it\n // manually: from then on the activity reads at the bottom of the answer,\n // and an open list growing above it would push the answer down.\n //\n // The user's choices last as long as the message: an answer that resumes\n // after a pause (an approval, a form, a tool the client runs) streams\n // into the same message and must not close what the reader opened. A\n // regenerated answer is a new message, with a fresh timeline.\n const manualGroup = ref<boolean | undefined>(undefined)\n const isGroupExpanded = computed(\n () =>\n manualGroup.value ??\n (Boolean(props.isStreaming) && !props.hasContent),\n )\n</script>\n\n<template>\n <div v-if=\"steps.length\" class=\"pk-chatbot-steps\">\n <button\n type=\"button\"\n class=\"pk-chatbot-steps__header\"\n :aria-expanded=\"isGroupExpanded\"\n @click=\"manualGroup = !isGroupExpanded\">\n <VvIcon v-if=\"isStreaming\" name=\"loading-loop\" class=\"shrink-0\" />\n <VvIcon v-else name=\"ri:route-line\" class=\"shrink-0\" />\n <span class=\"pk-chatbot-steps__title\">\n {{ $t('messagePart.steps') }}\n </span>\n <span class=\"pk-chatbot-steps__meta\">\n {{ $t('messagePart.stepCount', steps.length) }}\n <template v-if=\"formatDuration(totalDurationMs)\">\n · {{ formatDuration(totalDurationMs) }}\n </template>\n </span>\n <VvIcon\n :name=\"\n isGroupExpanded\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"pk-chatbot-steps__chevron shrink-0 ml-auto\" />\n </button>\n <ol v-if=\"isGroupExpanded\" class=\"pk-chatbot-steps__list\">\n <li\n v-for=\"step in steps\"\n :key=\"step.key\"\n class=\"pk-chatbot-steps__step\"\n :class=\"{\n 'pk-chatbot-steps__step--active': step.isActive,\n }\">\n <component\n :is=\"step.hasBody ? 'button' : 'div'\"\n :type=\"step.hasBody ? 'button' : undefined\"\n class=\"pk-chatbot-steps__step-header\"\n :aria-expanded=\"\n step.hasBody ? isStepExpanded(step) : undefined\n \"\n @click=\"step.hasBody ? toggleStep(step) : undefined\">\n <span\n class=\"pk-chatbot-steps-marker\"\n :class=\"{\n 'pk-chatbot-steps-marker--active': step.isActive,\n }\">\n <VvIcon v-if=\"step.isActive\" name=\"loading-loop\" />\n <VvIcon v-else-if=\"step.icon\" :name=\"step.icon\" />\n </span>\n <span class=\"pk-chatbot-steps__step-label\">\n {{ step.label }}\n </span>\n <span class=\"pk-chatbot-steps__step-summary\">\n {{ step.summary }}\n </span>\n <span\n v-if=\"formatDuration(step.durationMs)\"\n class=\"pk-chatbot-steps__step-duration\">\n {{ formatDuration(step.durationMs) }}\n </span>\n <VvIcon\n v-if=\"step.hasBody\"\n :name=\"\n isStepExpanded(step)\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"pk-chatbot-steps__chevron shrink-0 ml-auto\" />\n </component>\n <div\n v-if=\"step.hasBody && isStepExpanded(step)\"\n class=\"pk-chatbot-steps__step-body\">\n <!-- What it changed without a card (spec\n auto-confirmations.md) -->\n <PkFieldChanges\n v-if=\"step.changes?.length\"\n :changes=\"step.changes\"\n class=\"mb-xs\" />\n <PkStreamingMarkdownAutoscroll\n v-if=\"step.text && step.isActive\"\n :markdown=\"step.text\"\n :is-dark\n :tail-length=\"LIVE_REASONING_TAIL_LENGTH\"\n inner-class=\"wysiwyg\"\n class=\"pk-chatbot-steps__step-content pk-chatbot-steps__step-content--scroll\" />\n <div\n v-else-if=\"step.text\"\n class=\"pk-chatbot-steps__step-content pk-chatbot-steps__step-content--scroll\">\n <PkStreamingMarkdown\n :markdown=\"step.text\"\n :is-dark\n class=\"wysiwyg\" />\n </div>\n <div\n v-else-if=\"step.error\"\n class=\"pk-chatbot-steps__step-payload pk-chatbot-steps__step-payload--error\">\n <span class=\"pk-chatbot-steps__step-payload-label\">\n {{ $t('messagePart.stepError') }}\n </span>\n <pre>{{ step.error }}</pre>\n </div>\n <PkChatbotStepToolDetail\n v-else-if=\"step.hasRichDetail\"\n :part=\"step.part\" />\n <template v-else>\n <PkChatbotStepPayload\n v-if=\"hasPayload(step.toolInput)\"\n :label=\"$t('messagePart.stepInput')\"\n :value=\"step.toolInput\" />\n <PkChatbotStepPayload\n v-if=\"hasPayload(step.toolOutput)\"\n :label=\"$t('messagePart.stepOutput')\"\n :value=\"step.toolOutput\" />\n </template>\n </div>\n </li>\n </ol>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-steps {\n width: 100%;\n border: var(--spacing-px) solid var(--color-surface-3);\n border-radius: var(--rounded-lg);\n background-color: var(--color-surface-1);\n font-size: var(--text-12);\n color: var(--color-word-3);\n overflow: hidden;\n\n &__header {\n display: flex;\n align-items: center;\n gap: var(--spacing-8);\n width: 100%;\n min-height: var(--spacing-40);\n padding: var(--spacing-8) var(--spacing-sm);\n text-align: left;\n cursor: pointer;\n transition: background-color 0.2s ease;\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n }\n\n &__chevron {\n font-size: var(--text-16);\n }\n\n &__title {\n font-weight: 600;\n color: var(--color-word-2);\n flex-grow: 1;\n }\n\n &__meta {\n color: var(--color-word-4);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n }\n\n &__list {\n background-color: var(--color-surface);\n border-top: var(--spacing-px) solid var(--color-surface-3);\n padding: var(--spacing-8) var(--spacing-sm);\n display: flex;\n flex-direction: column;\n }\n\n &__step {\n position: relative;\n\n // Vertical connector between step markers\n &:not(:last-child)::before {\n content: '';\n position: absolute;\n left: var(--spacing-10);\n top: var(--spacing-28);\n bottom: calc(var(--spacing-8) * -1);\n width: var(--spacing-px);\n background-color: var(--color-surface-4);\n }\n }\n\n &__step-header {\n display: flex;\n align-items: center;\n gap: var(--spacing-8);\n width: calc(100% + var(--spacing-16));\n min-height: var(--spacing-36);\n margin-inline: calc(var(--spacing-8) * -1);\n padding: var(--spacing-4) var(--spacing-8);\n text-align: left;\n\n &:is(button) {\n cursor: pointer;\n border-radius: var(--rounded);\n transition: background-color 0.2s ease;\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n }\n }\n\n &-marker {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--spacing-20);\n height: var(--spacing-20);\n flex-shrink: 0;\n position: relative;\n z-index: 1;\n background-color: var(--color-surface-1);\n border-radius: var(--rounded-full);\n border: var(--spacing-px) solid var(--color-surface-4);\n\n &--active {\n background-color: var(\n --chatbot-main-color,\n var(--color-surface-4)\n );\n border-color: transparent;\n color: var(--chatbot-contrast-color, var(--color-word-1));\n }\n }\n\n &__step-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--color-word-2);\n }\n\n &__step-summary {\n flex: 1 1 0;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--color-word-4);\n }\n\n &__step-duration {\n color: var(--color-word-4);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n }\n\n &__step--active &__step-label {\n color: var(--color-word-1);\n }\n\n &__step-body {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-4);\n margin-left: var(--spacing-28);\n margin-block: var(--spacing-4) var(--spacing-8);\n }\n\n &__step-content {\n border: var(--spacing-px) solid var(--color-surface-3);\n border-radius: var(--rounded);\n padding: var(--spacing-8);\n background-color: var(--color-surface-1);\n\n // The finished reasoning keeps the cap the streaming one had:\n // `.wysiwyg` hides its own overflow, so the scroll belongs to the\n // wrapper, exactly as in the autoscroll variant.\n &--scroll {\n max-height: var(--spacing-256);\n overflow: auto;\n }\n }\n\n &__step-payload {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-2);\n\n pre {\n border: var(--spacing-px) solid var(--color-surface-3);\n border-radius: var(--rounded);\n padding: var(--spacing-8);\n font-size: var(--text-10);\n max-height: var(--spacing-160);\n overflow: auto;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n font-family: var(--font-mono);\n background-color: var(--color-surface-1);\n }\n }\n\n &__step-payload-label {\n font-weight: 600;\n color: var(--color-word-3);\n text-transform: uppercase;\n font-size: var(--text-10);\n letter-spacing: 0.05em;\n }\n\n &__step-payload--error {\n .pk-chatbot-steps__step-payload-label,\n pre {\n color: var(--u-danger-text, var(--color-danger));\n }\n\n pre {\n border-color: var(--color-danger-lighten-5);\n }\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAWI,IAAMmE,IAAQC,GAMRC,IAAYC,QACdH,EAAM,QAAQ,MAAM,MAAW,CAAC,CAACI,EAAO,MAAM,CAClD;E,kBAIA7D,EAAA,GAAAC,EAyBQ,SAzBRV,GAyBQ,CAxBSoE,EAAA,SAAb3D,EAAA,GAAAC,EAMQ,SAAAT,GAAA,CALJU,EAIK,MAAA,MAAA;GAHDA,EAAyD,MAAzDT,GAAyDU,EAAtCb,EAAAA,GAAE,0BAAA,CAAA,GAAA,CAAA;GACrBY,EAA0D,MAA1DR,GAA0DS,EAAvCb,EAAAA,GAAE,2BAAA,CAAA,GAAA,CAAA;GACrBY,EAAyD,MAAzDP,GAAyDQ,EAAtCb,EAAAA,GAAE,0BAAA,CAAA,GAAA,CAAA;E,mBAG7BY,EAgBQ,SAAA,MAAA,EAfJF,EAAA,EAAA,GAAAC,EAcKG,GAAA,MAAAC,EAdyBqD,EAAA,UAAlB,GAAQ,OAApB1D,EAAA,GAAAC,EAcK,MAAA,EAdmC,KAAKq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