@8wave/ai-elements 0.121.0-beta.46 → 0.121.0-beta.48

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 (130) hide show
  1. package/dist/_chunks/{Agent-BuPgJIt4.js → Agent-jMXkLts9.js} +36 -36
  2. package/dist/_chunks/Agent-jMXkLts9.js.map +1 -0
  3. package/dist/_chunks/{PkStreamingMarkdown-BlTH2AJX.js → PkStreamingMarkdown-C43RVcRW.js} +16 -10
  4. package/dist/_chunks/PkStreamingMarkdown-C43RVcRW.js.map +1 -0
  5. package/dist/_chunks/PkToolEditedFile-BZUXx8ZG.js +51 -0
  6. package/dist/_chunks/PkToolEditedFile-BZUXx8ZG.js.map +1 -0
  7. package/dist/_chunks/{PkToolRequestGeolocation-CxMAoAv6.js → PkToolRequestGeolocation-BJc2Ki0-.js} +2 -2
  8. package/dist/_chunks/{PkToolRequestGeolocation-CxMAoAv6.js.map → PkToolRequestGeolocation-BJc2Ki0-.js.map} +1 -1
  9. package/dist/_chunks/{PkToolRequestOAuthConnection-DU1Y2odZ.js → PkToolRequestOAuthConnection-OU56LTl0.js} +2 -2
  10. package/dist/_chunks/{PkToolRequestOAuthConnection-DU1Y2odZ.js.map → PkToolRequestOAuthConnection-OU56LTl0.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowArtifact-jQeIv65U.js → PkToolShowArtifact-yP7FXi0H.js} +2 -2
  12. package/dist/_chunks/{PkToolShowArtifact-jQeIv65U.js.map → PkToolShowArtifact-yP7FXi0H.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowContactForm-D7wg3Jlu.js → PkToolShowContactForm-w6aLTe1i.js} +2 -2
  14. package/dist/_chunks/{PkToolShowContactForm-D7wg3Jlu.js.map → PkToolShowContactForm-w6aLTe1i.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowForm-BMVgXxzl.js → PkToolShowForm-ChhVlxqc.js} +3 -3
  16. package/dist/_chunks/{PkToolShowForm-BMVgXxzl.js.map → PkToolShowForm-ChhVlxqc.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowImageGallery-Ba0CfKt6.js → PkToolShowImageGallery-D88a9a0P.js} +2 -2
  18. package/dist/_chunks/{PkToolShowImageGallery-Ba0CfKt6.js.map → PkToolShowImageGallery-D88a9a0P.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowProductList-DbZfUUWe.js → PkToolShowProductList-Jff9j3eQ.js} +2 -2
  20. package/dist/_chunks/{PkToolShowProductList-DbZfUUWe.js.map → PkToolShowProductList-Jff9j3eQ.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowSources-Dkt4IId2.js → PkToolShowSources-lWRoFGvC.js} +3 -3
  22. package/dist/_chunks/{PkToolShowSources-Dkt4IId2.js.map → PkToolShowSources-lWRoFGvC.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowSuggestedReply-BF2sT3B1.js → PkToolShowSuggestedReply-Ds0Yf31m.js} +2 -2
  24. package/dist/_chunks/{PkToolShowSuggestedReply-BF2sT3B1.js.map → PkToolShowSuggestedReply-Ds0Yf31m.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowVideo-l8JoSKCj.js → PkToolShowVideo-fNFvCi1_.js} +2 -2
  26. package/dist/_chunks/{PkToolShowVideo-l8JoSKCj.js.map → PkToolShowVideo-fNFvCi1_.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowWebPages-DtcEmrYt.js → PkToolShowWebPages-Bah-YhpM.js} +2 -2
  28. package/dist/_chunks/{PkToolShowWebPages-DtcEmrYt.js.map → PkToolShowWebPages-Bah-YhpM.js.map} +1 -1
  29. package/dist/_chunks/{chatImagePolicy-CQYTWTkP.js → chatImagePolicy-BvKnRHdM.js} +2 -2
  30. package/dist/_chunks/{chatImagePolicy-CQYTWTkP.js.map → chatImagePolicy-BvKnRHdM.js.map} +1 -1
  31. package/dist/_chunks/{markdown-Br9ROCBT.js → markdown-B1y2QQAa.js} +13 -13
  32. package/dist/_chunks/{markdown-Br9ROCBT.js.map → markdown-B1y2QQAa.js.map} +1 -1
  33. package/dist/ai-elements.es.js +1595 -1574
  34. package/dist/ai-elements.es.js.map +1 -1
  35. package/dist-vue/PkChatbot.js +1 -1
  36. package/dist-vue/PkChatbotEmptyState.js +1 -1
  37. package/dist-vue/PkChatbotInput.js +1 -1
  38. package/dist-vue/PkChatbotMessages.js +1 -1
  39. package/dist-vue/PkChatbotStepPayload.js +1 -1
  40. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  41. package/dist-vue/PkChatbotSteps.js +1 -1
  42. package/dist-vue/PkChatbotViewChat.js +1 -1
  43. package/dist-vue/PkChatbotViewConversations.js +1 -1
  44. package/dist-vue/PkChatbotViewFiles.js +1 -1
  45. package/dist-vue/PkChatbotViewProfile.js +1 -1
  46. package/dist-vue/_chunks/{Agent-DZb775Ak.js → Agent-BYwOk7Tt.js} +102 -102
  47. package/dist-vue/_chunks/Agent-BYwOk7Tt.js.map +1 -0
  48. package/dist-vue/_chunks/{Document-E72l_VU6.js → Document-CQdYPyrv.js} +2 -2
  49. package/dist-vue/_chunks/{Document-E72l_VU6.js.map → Document-CQdYPyrv.js.map} +1 -1
  50. package/dist-vue/_chunks/{PkChatbot-CObEhs2T.js → PkChatbot-DonyiJn3.js} +8 -8
  51. package/dist-vue/_chunks/{PkChatbot-CObEhs2T.js.map → PkChatbot-DonyiJn3.js.map} +1 -1
  52. package/dist-vue/_chunks/{PkChatbotEmptyState-Dh7ETVnf.js → PkChatbotEmptyState-CaNM6c77.js} +2 -2
  53. package/dist-vue/_chunks/{PkChatbotEmptyState-Dh7ETVnf.js.map → PkChatbotEmptyState-CaNM6c77.js.map} +1 -1
  54. package/dist-vue/_chunks/{PkChatbotInput-CuEoeb_M.js → PkChatbotInput-Bt02PGbZ.js} +2 -2
  55. package/dist-vue/_chunks/{PkChatbotInput-CuEoeb_M.js.map → PkChatbotInput-Bt02PGbZ.js.map} +1 -1
  56. package/dist-vue/_chunks/{PkChatbotMessages-DMSActW1.js → PkChatbotMessages-DIeAiZ7I.js} +25 -24
  57. package/dist-vue/_chunks/PkChatbotMessages-DIeAiZ7I.js.map +1 -0
  58. package/dist-vue/_chunks/{PkChatbotStepPayload-CXdsUMrw.js → PkChatbotStepPayload-D1_JG-M8.js} +2 -2
  59. package/dist-vue/_chunks/{PkChatbotStepPayload-CXdsUMrw.js.map → PkChatbotStepPayload-D1_JG-M8.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbotStepToolDetail-DbpXR7jh.js → PkChatbotStepToolDetail-DKJ3qg98.js} +3 -3
  61. package/dist-vue/_chunks/{PkChatbotStepToolDetail-DbpXR7jh.js.map → PkChatbotStepToolDetail-DKJ3qg98.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotSteps-QFFZ0DjH.js → PkChatbotSteps-DgaJc9Pv.js} +5 -5
  63. package/dist-vue/_chunks/{PkChatbotSteps-QFFZ0DjH.js.map → PkChatbotSteps-DgaJc9Pv.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkChatbotViewChat-BZb-U7Ju.js → PkChatbotViewChat-10NIwiUP.js} +172 -162
  65. package/dist-vue/_chunks/PkChatbotViewChat-10NIwiUP.js.map +1 -0
  66. package/dist-vue/_chunks/{PkChatbotViewConversations-CCPRWCKs.js → PkChatbotViewConversations-hsboinns.js} +3 -3
  67. package/dist-vue/_chunks/{PkChatbotViewConversations-CCPRWCKs.js.map → PkChatbotViewConversations-hsboinns.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotViewFiles-BgqksCn0.js → PkChatbotViewFiles-DDO_L8UB.js} +9 -9
  69. package/dist-vue/_chunks/PkChatbotViewFiles-DDO_L8UB.js.map +1 -0
  70. package/dist-vue/_chunks/{PkChatbotViewProfile-B6tHWrqn.js → PkChatbotViewProfile-BC7Ok94X.js} +2 -2
  71. package/dist-vue/_chunks/{PkChatbotViewProfile-B6tHWrqn.js.map → PkChatbotViewProfile-BC7Ok94X.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkStreamingMarkdown-DwDs-cGP.js → PkStreamingMarkdown-0jN60Rku.js} +3 -3
  73. package/dist-vue/_chunks/{PkStreamingMarkdown-DwDs-cGP.js.map → PkStreamingMarkdown-0jN60Rku.js.map} +1 -1
  74. package/dist-vue/_chunks/PkToolEditedFile-DsiNIHAR.js +50 -0
  75. package/dist-vue/_chunks/PkToolEditedFile-DsiNIHAR.js.map +1 -0
  76. package/dist-vue/_chunks/{PkToolRequestGeolocation-DC8hSH0j.js → PkToolRequestGeolocation-jkEuN6_1.js} +2 -2
  77. package/dist-vue/_chunks/{PkToolRequestGeolocation-DC8hSH0j.js.map → PkToolRequestGeolocation-jkEuN6_1.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-BH_-drvw.js → PkToolRequestOAuthConnection-BTNd8Urz.js} +2 -2
  79. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-BH_-drvw.js.map → PkToolRequestOAuthConnection-BTNd8Urz.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkToolShowArtifact-CjVN96wJ.js → PkToolShowArtifact-BitKlzvt.js} +2 -2
  81. package/dist-vue/_chunks/{PkToolShowArtifact-CjVN96wJ.js.map → PkToolShowArtifact-BitKlzvt.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkToolShowContactForm-CmBLigw8.js → PkToolShowContactForm-DKkapC2s.js} +2 -2
  83. package/dist-vue/_chunks/{PkToolShowContactForm-CmBLigw8.js.map → PkToolShowContactForm-DKkapC2s.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkToolShowDiagram-dKUU5_6F.js → PkToolShowDiagram-BI-fI2vG.js} +2 -2
  85. package/dist-vue/_chunks/{PkToolShowDiagram-dKUU5_6F.js.map → PkToolShowDiagram-BI-fI2vG.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkToolShowForm-B6ESvq-5.js → PkToolShowForm-LR8mW4SY.js} +4 -4
  87. package/dist-vue/_chunks/{PkToolShowForm-B6ESvq-5.js.map → PkToolShowForm-LR8mW4SY.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkToolShowImageGallery-Daq0IwTH.js → PkToolShowImageGallery-DuJ_cbcf.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolShowImageGallery-Daq0IwTH.js.map → PkToolShowImageGallery-DuJ_cbcf.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolShowProductList-Bc3Gzyxy.js → PkToolShowProductList-D7Tw7_NR.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolShowProductList-Bc3Gzyxy.js.map → PkToolShowProductList-D7Tw7_NR.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowSources-BDvRbenn.js → PkToolShowSources-DeplEks2.js} +3 -3
  93. package/dist-vue/_chunks/{PkToolShowSources-BDvRbenn.js.map → PkToolShowSources-DeplEks2.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Cd6VkzvJ.js → PkToolShowSuggestedReply-Dw-yePEO.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Cd6VkzvJ.js.map → PkToolShowSuggestedReply-Dw-yePEO.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowVideo-Bo1gsD97.js → PkToolShowVideo-CAJhU52k.js} +2 -2
  97. package/dist-vue/_chunks/{PkToolShowVideo-Bo1gsD97.js.map → PkToolShowVideo-CAJhU52k.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowWebPages-DI3sZiqh.js → PkToolShowWebPages-Be6dKCsO.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowWebPages-DI3sZiqh.js.map → PkToolShowWebPages-Be6dKCsO.js.map} +1 -1
  100. package/dist-vue/_chunks/{createChatbotApiClient-hcFAulTq.js → createChatbotApiClient-huxzfST2.js} +16 -16
  101. package/dist-vue/_chunks/{createChatbotApiClient-hcFAulTq.js.map → createChatbotApiClient-huxzfST2.js.map} +1 -1
  102. package/dist-vue/_chunks/{useChatbotStore-Ct7G-voO.js → useChatbotStore-8tG3oA_R.js} +20 -20
  103. package/dist-vue/_chunks/{useChatbotStore-Ct7G-voO.js.map → useChatbotStore-8tG3oA_R.js.map} +1 -1
  104. package/dist-vue/_chunks/{utils-EPX3V3VI.js → utils-_H2BDYuj.js} +16 -10
  105. package/dist-vue/_chunks/utils-_H2BDYuj.js.map +1 -0
  106. package/dist-vue/api.js +1 -1
  107. package/dist-vue/composables.js +28 -18
  108. package/dist-vue/composables.js.map +1 -1
  109. package/dist-vue/index.js +5211 -5194
  110. package/dist-vue/index.js.map +1 -1
  111. package/dist-vue/locales.js +10 -0
  112. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +2 -2
  113. package/dist-vue/packages/components/src/chat/{PkToolEditSpreadsheet.d.ts → PkToolEditedFile.d.ts} +4 -3
  114. package/dist-vue/packages/components/src/chat/useWakeupWatch.d.ts +5 -1
  115. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +5 -5
  116. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +7 -7
  117. package/dist-vue/packages/composable/src/useFileRow.d.ts +7 -6
  118. package/dist-vue/packages/models/src/schema/Agent.d.ts +42 -0
  119. package/package.json +1 -1
  120. package/dist/_chunks/Agent-BuPgJIt4.js.map +0 -1
  121. package/dist/_chunks/PkStreamingMarkdown-BlTH2AJX.js.map +0 -1
  122. package/dist/_chunks/PkToolEditSpreadsheet-CDxglslA.js +0 -41
  123. package/dist/_chunks/PkToolEditSpreadsheet-CDxglslA.js.map +0 -1
  124. package/dist-vue/_chunks/Agent-DZb775Ak.js.map +0 -1
  125. package/dist-vue/_chunks/PkChatbotMessages-DMSActW1.js.map +0 -1
  126. package/dist-vue/_chunks/PkChatbotViewChat-BZb-U7Ju.js.map +0 -1
  127. package/dist-vue/_chunks/PkChatbotViewFiles-BgqksCn0.js.map +0 -1
  128. package/dist-vue/_chunks/PkToolEditSpreadsheet-B61LtERY.js +0 -40
  129. package/dist-vue/_chunks/PkToolEditSpreadsheet-B61LtERY.js.map +0 -1
  130. package/dist-vue/_chunks/utils-EPX3V3VI.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PkToolShowWebPages-DtcEmrYt.js","names":["$t","__unplugin_components_0","_openBlock","_createElementBlock","_Fragment","_renderList","_createElementVNode","_unref","_createBlock","PkHeldImage","PkLazyImg","_createCommentVNode","_toDisplayString","_createVNode","PkUrl","_createTextVNode","_sfc_main","renderList","unref","toDisplayString","openBlock","createVNode","createBlock","init_reactivity_esm_bundler","Fragment","createBaseVNode","computed","ref","init_runtime_core_esm_bundler","createCommentVNode","defineComponent","init_shared_esm_bundler","createTextVNode","createElementBlock","isSameSite","Ce","useChatImageGate","PkHeldImage_default","PkLazyImg_default","PkUrl_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","PkToolShowWebPages_default","props","__props","toolPart","imageGate","normalizeUrl","u","url","uniquePages","seen","result","page","key","showMore","pages","hasMore","_component_VvIcon","index","_ctx","_cache"],"sources":["../../../../packages/components/src/chat/PkToolShowWebPages.vue","../../../../packages/components/src/chat/PkToolShowWebPages.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref } from 'vue'\n import { isSameSite } from 'utils'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n pages: Array<{\n title: string\n url: string\n image?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n\n // The model often passes the same URL several times (e.g. multiple KB\n // chunks from one page), so collapse duplicates, keeping the first (richest)\n // entry. Normalize by dropping the hash and any trailing slash.\n const normalizeUrl = (url: string) => {\n try {\n const u = new URL(url)\n u.hash = ''\n return u.toString().replace(/\\/$/, '')\n } catch {\n return url.trim().replace(/\\/$/, '')\n }\n }\n const uniquePages = computed(() => {\n const seen = new Set<string>()\n const result: NonNullable<typeof toolPart.value.input>['pages'] = []\n for (const page of toolPart.value.input?.pages || []) {\n const key = normalizeUrl(page.url)\n if (seen.has(key)) {\n continue\n }\n seen.add(key)\n result.push(page)\n }\n return result\n })\n\n const showMore = ref(false)\n const pages = computed(() => {\n if (showMore.value) {\n return uniquePages.value\n }\n return uniquePages.value.slice(0, 2)\n })\n const hasMore = computed(() => uniquePages.value.length > 2)\n</script>\n\n<template>\n <ul\n v-if=\"pages?.length\"\n class=\"vv-item-group vv-item-group--framed w-full shrink-0\">\n <li\n v-for=\"(page, index) in pages\"\n :key=\"index\"\n class=\"vv-item vv-item--top vv-item--roomy\">\n <a\n :href=\"page.url\"\n :title=\"$t('action.open')\"\n :target=\"isSameSite(page.url) ? undefined : '_blank'\"\n :rel=\"isSameSite(page.url) ? undefined : 'noopener noreferrer'\"\n class=\"vv-item__entry\">\n <!-- og:images the model scraped are third-party urls: a dead one\n degrades to an icon instead of breaking the card layout -->\n <PkHeldImage\n v-if=\"page.image && !imageGate.canLoad(page.image)\"\n :host=\"imageGate.hostOf(page.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(page.image)\" />\n <PkLazyImg\n v-else-if=\"page.image\"\n :src=\"page.image\"\n :alt=\"page.title\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong\n class=\"vv-item__title font-medium text-12 text-word-1\">\n {{ page.title }}\n </strong>\n <span\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"page.url\" />\n </span>\n <p\n v-if=\"page.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ page.description }}\n </p>\n </div>\n </a>\n </li>\n <li v-if=\"hasMore\" class=\"vv-item\">\n <button\n class=\"vv-item__entry justify-center cursor-pointer\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"\n showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\n \"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: uniquePages.length - 2,\n })\n }}\n </button>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref } from 'vue'\n import { isSameSite } from 'utils'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n pages: Array<{\n title: string\n url: string\n image?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n\n // The model often passes the same URL several times (e.g. multiple KB\n // chunks from one page), so collapse duplicates, keeping the first (richest)\n // entry. Normalize by dropping the hash and any trailing slash.\n const normalizeUrl = (url: string) => {\n try {\n const u = new URL(url)\n u.hash = ''\n return u.toString().replace(/\\/$/, '')\n } catch {\n return url.trim().replace(/\\/$/, '')\n }\n }\n const uniquePages = computed(() => {\n const seen = new Set<string>()\n const result: NonNullable<typeof toolPart.value.input>['pages'] = []\n for (const page of toolPart.value.input?.pages || []) {\n const key = normalizeUrl(page.url)\n if (seen.has(key)) {\n continue\n }\n seen.add(key)\n result.push(page)\n }\n return result\n })\n\n const showMore = ref(false)\n const pages = computed(() => {\n if (showMore.value) {\n return uniquePages.value\n }\n return uniquePages.value.slice(0, 2)\n })\n const hasMore = computed(() => uniquePages.value.length > 2)\n</script>\n\n<template>\n <ul\n v-if=\"pages?.length\"\n class=\"vv-item-group vv-item-group--framed w-full shrink-0\">\n <li\n v-for=\"(page, index) in pages\"\n :key=\"index\"\n class=\"vv-item vv-item--top vv-item--roomy\">\n <a\n :href=\"page.url\"\n :title=\"$t('action.open')\"\n :target=\"isSameSite(page.url) ? undefined : '_blank'\"\n :rel=\"isSameSite(page.url) ? undefined : 'noopener noreferrer'\"\n class=\"vv-item__entry\">\n <!-- og:images the model scraped are third-party urls: a dead one\n degrades to an icon instead of breaking the card layout -->\n <PkHeldImage\n v-if=\"page.image && !imageGate.canLoad(page.image)\"\n :host=\"imageGate.hostOf(page.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(page.image)\" />\n <PkLazyImg\n v-else-if=\"page.image\"\n :src=\"page.image\"\n :alt=\"page.title\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong\n class=\"vv-item__title font-medium text-12 text-word-1\">\n {{ page.title }}\n </strong>\n <span\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"page.url\" />\n </span>\n <p\n v-if=\"page.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ page.description }}\n </p>\n </div>\n </a>\n </li>\n <li v-if=\"hasMore\" class=\"vv-item\">\n <button\n class=\"vv-item__entry justify-center cursor-pointer\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"\n showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\n \"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: uniquePages.length - 2,\n })\n }}\n </button>\n </li>\n </ul>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQI,IAAMgD,IAAQC,GAIRC,IAAWxB,QACAsB,EAAM,IAWtB,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,GAAE,mBAAA,EAA2D,OAAAuD,EAAA,MAAY,SAAM,EAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA1B,EAAA,IAAA,EAAA,CAAA,CAAA,KAAAA,EAAA,IAAA,EAAA"}
1
+ {"version":3,"file":"PkToolShowWebPages-Bah-YhpM.js","names":["$t","__unplugin_components_0","_openBlock","_createElementBlock","_Fragment","_renderList","_createElementVNode","_unref","_createBlock","PkHeldImage","PkLazyImg","_createCommentVNode","_toDisplayString","_createVNode","PkUrl","_createTextVNode","_sfc_main","renderList","unref","toDisplayString","openBlock","createVNode","createBlock","init_reactivity_esm_bundler","Fragment","createBaseVNode","computed","ref","init_runtime_core_esm_bundler","createCommentVNode","defineComponent","init_shared_esm_bundler","createTextVNode","createElementBlock","isSameSite","Ce","useChatImageGate","PkHeldImage_default","PkLazyImg_default","PkUrl_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","PkToolShowWebPages_default","props","__props","toolPart","imageGate","normalizeUrl","u","url","uniquePages","seen","result","page","key","showMore","pages","hasMore","_component_VvIcon","index","_ctx","_cache"],"sources":["../../../../packages/components/src/chat/PkToolShowWebPages.vue","../../../../packages/components/src/chat/PkToolShowWebPages.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref } from 'vue'\n import { isSameSite } from 'utils'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n pages: Array<{\n title: string\n url: string\n image?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n\n // The model often passes the same URL several times (e.g. multiple KB\n // chunks from one page), so collapse duplicates, keeping the first (richest)\n // entry. Normalize by dropping the hash and any trailing slash.\n const normalizeUrl = (url: string) => {\n try {\n const u = new URL(url)\n u.hash = ''\n return u.toString().replace(/\\/$/, '')\n } catch {\n return url.trim().replace(/\\/$/, '')\n }\n }\n const uniquePages = computed(() => {\n const seen = new Set<string>()\n const result: NonNullable<typeof toolPart.value.input>['pages'] = []\n for (const page of toolPart.value.input?.pages || []) {\n const key = normalizeUrl(page.url)\n if (seen.has(key)) {\n continue\n }\n seen.add(key)\n result.push(page)\n }\n return result\n })\n\n const showMore = ref(false)\n const pages = computed(() => {\n if (showMore.value) {\n return uniquePages.value\n }\n return uniquePages.value.slice(0, 2)\n })\n const hasMore = computed(() => uniquePages.value.length > 2)\n</script>\n\n<template>\n <ul\n v-if=\"pages?.length\"\n class=\"vv-item-group vv-item-group--framed w-full shrink-0\">\n <li\n v-for=\"(page, index) in pages\"\n :key=\"index\"\n class=\"vv-item vv-item--top vv-item--roomy\">\n <a\n :href=\"page.url\"\n :title=\"$t('action.open')\"\n :target=\"isSameSite(page.url) ? undefined : '_blank'\"\n :rel=\"isSameSite(page.url) ? undefined : 'noopener noreferrer'\"\n class=\"vv-item__entry\">\n <!-- og:images the model scraped are third-party urls: a dead one\n degrades to an icon instead of breaking the card layout -->\n <PkHeldImage\n v-if=\"page.image && !imageGate.canLoad(page.image)\"\n :host=\"imageGate.hostOf(page.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(page.image)\" />\n <PkLazyImg\n v-else-if=\"page.image\"\n :src=\"page.image\"\n :alt=\"page.title\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong\n class=\"vv-item__title font-medium text-12 text-word-1\">\n {{ page.title }}\n </strong>\n <span\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"page.url\" />\n </span>\n <p\n v-if=\"page.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ page.description }}\n </p>\n </div>\n </a>\n </li>\n <li v-if=\"hasMore\" class=\"vv-item\">\n <button\n class=\"vv-item__entry justify-center cursor-pointer\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"\n showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\n \"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: uniquePages.length - 2,\n })\n }}\n </button>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref } from 'vue'\n import { isSameSite } from 'utils'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n pages: Array<{\n title: string\n url: string\n image?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n\n // The model often passes the same URL several times (e.g. multiple KB\n // chunks from one page), so collapse duplicates, keeping the first (richest)\n // entry. Normalize by dropping the hash and any trailing slash.\n const normalizeUrl = (url: string) => {\n try {\n const u = new URL(url)\n u.hash = ''\n return u.toString().replace(/\\/$/, '')\n } catch {\n return url.trim().replace(/\\/$/, '')\n }\n }\n const uniquePages = computed(() => {\n const seen = new Set<string>()\n const result: NonNullable<typeof toolPart.value.input>['pages'] = []\n for (const page of toolPart.value.input?.pages || []) {\n const key = normalizeUrl(page.url)\n if (seen.has(key)) {\n continue\n }\n seen.add(key)\n result.push(page)\n }\n return result\n })\n\n const showMore = ref(false)\n const pages = computed(() => {\n if (showMore.value) {\n return uniquePages.value\n }\n return uniquePages.value.slice(0, 2)\n })\n const hasMore = computed(() => uniquePages.value.length > 2)\n</script>\n\n<template>\n <ul\n v-if=\"pages?.length\"\n class=\"vv-item-group vv-item-group--framed w-full shrink-0\">\n <li\n v-for=\"(page, index) in pages\"\n :key=\"index\"\n class=\"vv-item vv-item--top vv-item--roomy\">\n <a\n :href=\"page.url\"\n :title=\"$t('action.open')\"\n :target=\"isSameSite(page.url) ? undefined : '_blank'\"\n :rel=\"isSameSite(page.url) ? undefined : 'noopener noreferrer'\"\n class=\"vv-item__entry\">\n <!-- og:images the model scraped are third-party urls: a dead one\n degrades to an icon instead of breaking the card layout -->\n <PkHeldImage\n v-if=\"page.image && !imageGate.canLoad(page.image)\"\n :host=\"imageGate.hostOf(page.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(page.image)\" />\n <PkLazyImg\n v-else-if=\"page.image\"\n :src=\"page.image\"\n :alt=\"page.title\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong\n class=\"vv-item__title font-medium text-12 text-word-1\">\n {{ page.title }}\n </strong>\n <span\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"page.url\" />\n </span>\n <p\n v-if=\"page.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ page.description }}\n </p>\n </div>\n </a>\n </li>\n <li v-if=\"hasMore\" class=\"vv-item\">\n <button\n class=\"vv-item__entry justify-center cursor-pointer\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"\n showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\n \"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: uniquePages.length - 2,\n })\n }}\n </button>\n </li>\n </ul>\n</template>\n"],"mappings":";;;;;;;;;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A,GAAAA,EAAA,MACtBH,EACIgD,EAAA,QAAmC5D,EAAAA,GAAE,iBAAA,IAA8CA,EAAAA,GAAE,mBAAA,EAA2D,OAAAuD,EAAA,MAAY,SAAM,EAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA1B,EAAA,IAAA,EAAA,CAAA,CAAA,KAAAA,EAAA,IAAA,EAAA"}
@@ -1,5 +1,5 @@
1
1
  import { A as e, at as t, h as n, ht as r, k as i, z as a } from "./vue.runtime.esm-bundler-BkvITeKg.js";
2
- import { b as o } from "./Agent-BuPgJIt4.js";
2
+ import { x as o } from "./Agent-jMXkLts9.js";
3
3
  import "./src-Ra4oUpUU.js";
4
4
  import { i as s } from "./url-validation-9DstIfq2.js";
5
5
  import { n as c } from "./useShortUrlResolver-BGoPo6JO.js";
@@ -43,4 +43,4 @@ function m() {
43
43
  //#endregion
44
44
  export { m as n, u as t };
45
45
 
46
- //# sourceMappingURL=chatImagePolicy-CQYTWTkP.js.map
46
+ //# sourceMappingURL=chatImagePolicy-BvKnRHdM.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chatImagePolicy-CQYTWTkP.js","names":["inject","init_reactivity_esm_bundler","computed","ref","init_runtime_core_esm_bundler","provide","normalizeImageHost","urlOrigin","useShortUrlResolver","ChatImagePolicyKey","provideChatImagePolicy","hosts","backendUrl","origin","imageHostOf","src","pageUrl","PLATFORM_MEDIA_PATH","isImageAllowed","url","policy","useChatImageGate","shortUrls","released","target"],"sources":["../../../../packages/components/src/chat/chatImagePolicy.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey } from 'vue'\nimport { computed, inject, provide, ref } from 'vue'\nimport { useShortUrlResolver } from 'composables'\nimport { normalizeImageHost } from 'models'\nimport { urlOrigin } from 'utils'\n\n/**\n * Which images a chat loads by itself: hole 20 of\n * docs/specs/organization-isolation.md.\n *\n * The model writes the url of every image in an answer and in the image tool\n * cards (gallery, products, web pages), and a prompt injected through a\n * document, a page or a tool result can make it put the conversation in that\n * url. The browser fetches it as soon as it renders, and the text is gone.\n * So an image loads by itself only from the media of the platform and from\n * the hosts the agent lists (`interface.imageHosts`); any other shows its host\n * and loads on a click, a choice made by whoever reads it.\n *\n * Provided by `PkChatbot` (the app and the widget) and by the pages that show\n * an agent's answers; where nothing is provided, images load as before.\n */\nexport interface ChatImagePolicy {\n /** Host names the agent lists, normalized (`normalizeImageHost`). */\n hosts: string[]\n /** Origins of the platform, which serve the media of a chat. */\n platformOrigins: string[]\n}\n\nexport const ChatImagePolicyKey: InjectionKey<ComputedRef<ChatImagePolicy>> =\n Symbol('ChatImagePolicy')\n\n/**\n * Applies the policy of an agent to the answers rendered below: its listed\n * hosts, and the backend the page talks to, which serves the chat's media.\n * The hosts are normalized again because a preview passes them as typed,\n * before the schema does.\n */\nexport function provideChatImagePolicy(\n hosts: () => string[] | undefined,\n backendUrl: () => string | undefined,\n) {\n provide(\n ChatImagePolicyKey,\n computed(() => ({\n hosts: (hosts() ?? []).map(normalizeImageHost),\n platformOrigins: [urlOrigin(backendUrl())].filter(\n (origin): origin is string => !!origin,\n ),\n })),\n )\n}\n\n/**\n * The host an image url points to, for the placeholder, or `undefined` when\n * it does not parse.\n */\nexport function imageHostOf(src: string, pageUrl: string): string | undefined {\n try {\n return new URL(src, pageUrl).hostname || undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * The paths the platform serves the media of a chat from (`media.service.ts`\n * and `chatMedia.service.ts` in the backend). Only these: the same origin\n * answers sign-in and OAuth routes that redirect to a url read from the query,\n * which would carry an answer anywhere. A short link (`/api/r/<hash>`) is not\n * among them either: `useChatImageGate` judges it by the url it stands for,\n * since a set of links prepared in advance could spell a secret out.\n */\nconst PLATFORM_MEDIA_PATH =\n /^\\/api\\/v1\\/(?:public\\/medias\\/[^/]+|[^/]+\\/agents\\/[^/]+\\/chats\\/[^/]+\\/media\\/[^/]+\\/(?:view|download))$/\n\n/**\n * Whether an image may load without a click. `data:` and `blob:` images never\n * reach the network; everything else needs the media of the platform or a\n * listed host, over https. The page's own origin gets no exception: a site,\n * the platform's included, often redirects wherever its query says.\n */\nexport function isImageAllowed(\n src: string,\n policy: ChatImagePolicy,\n pageUrl: string,\n): boolean {\n let url: URL\n try {\n url = new URL(src, pageUrl)\n } catch {\n return false\n }\n if (url.protocol === 'data:' || url.protocol === 'blob:') {\n return true\n }\n if (policy.platformOrigins.includes(url.origin)) {\n return PLATFORM_MEDIA_PATH.test(url.pathname)\n }\n return url.protocol === 'https:' && policy.hosts.includes(url.hostname)\n}\n\n/**\n * The policy of the surrounding chat, with the images released by a click.\n * A release is per url and lasts as long as the component that asked. A\n * short link of the platform is judged, and named, by the url it stands for:\n * it waits until the resolver brings that url back.\n */\nexport function useChatImageGate() {\n const policy = inject(ChatImagePolicyKey, undefined)\n const shortUrls = useShortUrlResolver()\n const released = ref(new Set<string>())\n const pageUrl = () =>\n typeof window === 'undefined'\n ? 'https://localhost/'\n : window.location.href\n const target = (src: string) => shortUrls.resolve(src).value.url ?? src\n\n const canLoad = (src: string | undefined): boolean =>\n !src ||\n !policy ||\n released.value.has(src) ||\n isImageAllowed(target(src), policy.value, pageUrl())\n\n const release = (src: string) => {\n released.value = new Set(released.value).add(src)\n }\n\n const hostOf = (src: string) => imageHostOf(target(src), pageUrl())\n\n return {\n /** Whether a policy applies here at all. */\n isGated: computed(() => !!policy),\n canLoad,\n release,\n hostOf,\n }\n}\n"],"mappings":";;;;;;;AA4BA,IAAaS,IACT,OAAO,iBAAiB;AAQ5B,SAAgBC,EACZ,GACA,GACF;CACE,EACID,GACAP,SAAgB;EACZ,QAAQS,EAAM,KAAK,CAAC,EAAA,CAAG,IAAIL,CAAkB;EAC7C,iBAAiB,CAACC,EAAUK,EAAW,CAAC,CAAC,CAAC,CAAC,QACtC,MAA6B,CAAC,CAACC,CACpC;CACJ,EAAE,CACN;AACJ;AAMA,SAAgBC,EAAY,GAAa,GAAqC;CAC1E,IAAI;EACA,OAAO,IAAI,IAAIC,GAAKC,CAAO,CAAC,CAAC,YAAY,KAAA;CAC7C,QAAQ;EACJ;CACJ;AACJ;AAUA,IAAMC,IACF;AAQJ,SAAgBC,EACZ,GACA,GACA,GACO;CACP,IAAIC;CACJ,IAAI;EACA,IAAM,IAAI,IAAIJ,GAAKC,CAAO;CAC9B,QAAQ;EACJ,OAAO;CACX;CAOA,OANIG,EAAI,aAAa,WAAWA,EAAI,aAAa,UACtC,KAEPC,EAAO,gBAAgB,SAASD,EAAI,MAAM,IACnCF,EAAoB,KAAKE,EAAI,QAAQ,IAEzCA,EAAI,aAAa,YAAYC,EAAO,MAAM,SAASD,EAAI,QAAQ;AAC1E;AAQA,SAAgBE,IAAmB;CAC/B,IAAMD,IAASpB,EAAOS,GAAoB,KAAA,CAAS,GAC7Ca,IAAYd,EAAoB,GAChCe,IAAWpB,kBAAI,IAAI,IAAY,CAAC,GAChCa,UACF,OAAO,SAAW,MACZ,uBACA,OAAO,SAAS,MACpBQ,KAAU,MAAgBF,EAAU,QAAQP,CAAG,CAAC,CAAC,MAAM,OAAOA;CAcpE,OAAO;EAEH,SAASb,QAAe,CAAC,CAACkB,CAAM;EAChC,UAfa,MACb,CAACL,KACD,CAACK,KACDG,EAAS,MAAM,IAAIR,CAAG,KACtBG,EAAeM,EAAOT,CAAG,GAAGK,EAAO,OAAOJ,EAAQ,CAAC;EAYnD,UAVa,MAAgB;GAC7B,EAAS,QAAQ,IAAI,IAAIO,EAAS,KAAK,CAAC,CAAC,IAAIR,CAAG;EACpD;EASI,SAPY,MAAgBD,EAAYU,EAAOT,CAAG,GAAGC,EAAQ,CAAC;CAQlE;AACJ"}
1
+ {"version":3,"file":"chatImagePolicy-BvKnRHdM.js","names":["inject","init_reactivity_esm_bundler","computed","ref","init_runtime_core_esm_bundler","provide","normalizeImageHost","urlOrigin","useShortUrlResolver","ChatImagePolicyKey","provideChatImagePolicy","hosts","backendUrl","origin","imageHostOf","src","pageUrl","PLATFORM_MEDIA_PATH","isImageAllowed","url","policy","useChatImageGate","shortUrls","released","target"],"sources":["../../../../packages/components/src/chat/chatImagePolicy.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey } from 'vue'\nimport { computed, inject, provide, ref } from 'vue'\nimport { useShortUrlResolver } from 'composables'\nimport { normalizeImageHost } from 'models'\nimport { urlOrigin } from 'utils'\n\n/**\n * Which images a chat loads by itself: hole 20 of\n * docs/specs/organization-isolation.md.\n *\n * The model writes the url of every image in an answer and in the image tool\n * cards (gallery, products, web pages), and a prompt injected through a\n * document, a page or a tool result can make it put the conversation in that\n * url. The browser fetches it as soon as it renders, and the text is gone.\n * So an image loads by itself only from the media of the platform and from\n * the hosts the agent lists (`interface.imageHosts`); any other shows its host\n * and loads on a click, a choice made by whoever reads it.\n *\n * Provided by `PkChatbot` (the app and the widget) and by the pages that show\n * an agent's answers; where nothing is provided, images load as before.\n */\nexport interface ChatImagePolicy {\n /** Host names the agent lists, normalized (`normalizeImageHost`). */\n hosts: string[]\n /** Origins of the platform, which serve the media of a chat. */\n platformOrigins: string[]\n}\n\nexport const ChatImagePolicyKey: InjectionKey<ComputedRef<ChatImagePolicy>> =\n Symbol('ChatImagePolicy')\n\n/**\n * Applies the policy of an agent to the answers rendered below: its listed\n * hosts, and the backend the page talks to, which serves the chat's media.\n * The hosts are normalized again because a preview passes them as typed,\n * before the schema does.\n */\nexport function provideChatImagePolicy(\n hosts: () => string[] | undefined,\n backendUrl: () => string | undefined,\n) {\n provide(\n ChatImagePolicyKey,\n computed(() => ({\n hosts: (hosts() ?? []).map(normalizeImageHost),\n platformOrigins: [urlOrigin(backendUrl())].filter(\n (origin): origin is string => !!origin,\n ),\n })),\n )\n}\n\n/**\n * The host an image url points to, for the placeholder, or `undefined` when\n * it does not parse.\n */\nexport function imageHostOf(src: string, pageUrl: string): string | undefined {\n try {\n return new URL(src, pageUrl).hostname || undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * The paths the platform serves the media of a chat from (`media.service.ts`\n * and `chatMedia.service.ts` in the backend). Only these: the same origin\n * answers sign-in and OAuth routes that redirect to a url read from the query,\n * which would carry an answer anywhere. A short link (`/api/r/<hash>`) is not\n * among them either: `useChatImageGate` judges it by the url it stands for,\n * since a set of links prepared in advance could spell a secret out.\n */\nconst PLATFORM_MEDIA_PATH =\n /^\\/api\\/v1\\/(?:public\\/medias\\/[^/]+|[^/]+\\/agents\\/[^/]+\\/chats\\/[^/]+\\/media\\/[^/]+\\/(?:view|download))$/\n\n/**\n * Whether an image may load without a click. `data:` and `blob:` images never\n * reach the network; everything else needs the media of the platform or a\n * listed host, over https. The page's own origin gets no exception: a site,\n * the platform's included, often redirects wherever its query says.\n */\nexport function isImageAllowed(\n src: string,\n policy: ChatImagePolicy,\n pageUrl: string,\n): boolean {\n let url: URL\n try {\n url = new URL(src, pageUrl)\n } catch {\n return false\n }\n if (url.protocol === 'data:' || url.protocol === 'blob:') {\n return true\n }\n if (policy.platformOrigins.includes(url.origin)) {\n return PLATFORM_MEDIA_PATH.test(url.pathname)\n }\n return url.protocol === 'https:' && policy.hosts.includes(url.hostname)\n}\n\n/**\n * The policy of the surrounding chat, with the images released by a click.\n * A release is per url and lasts as long as the component that asked. A\n * short link of the platform is judged, and named, by the url it stands for:\n * it waits until the resolver brings that url back.\n */\nexport function useChatImageGate() {\n const policy = inject(ChatImagePolicyKey, undefined)\n const shortUrls = useShortUrlResolver()\n const released = ref(new Set<string>())\n const pageUrl = () =>\n typeof window === 'undefined'\n ? 'https://localhost/'\n : window.location.href\n const target = (src: string) => shortUrls.resolve(src).value.url ?? src\n\n const canLoad = (src: string | undefined): boolean =>\n !src ||\n !policy ||\n released.value.has(src) ||\n isImageAllowed(target(src), policy.value, pageUrl())\n\n const release = (src: string) => {\n released.value = new Set(released.value).add(src)\n }\n\n const hostOf = (src: string) => imageHostOf(target(src), pageUrl())\n\n return {\n /** Whether a policy applies here at all. */\n isGated: computed(() => !!policy),\n canLoad,\n release,\n hostOf,\n }\n}\n"],"mappings":";;;;;;;AA4BA,IAAaS,IACT,OAAO,iBAAi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;EASI,SAPY,MAAgBD,EAAYU,EAAOT,CAAG,GAAGC,EAAQ,CAAC;CAQlE;AACJ"}
@@ -1,5 +1,5 @@
1
1
  import { C as e, S as t, _ as n, b as r, g as i, o as a, p as o, r as s, s as c, t as l, u, v as d, w as f, x as p, y as m } from "./zod-Dd1GFq_6.js";
2
- import { I as h, L as g, S as _ } from "./Agent-BuPgJIt4.js";
2
+ import { C as h, L as g, R as _ } from "./Agent-jMXkLts9.js";
3
3
  //#region ../../packages/models/src/schema/constants.ts
4
4
  var v = /* @__PURE__ */ "openai/gpt-5-nano,openai/gpt-5-mini,openai/gpt-5.1-thinking,openai/gpt-5.2,openai/gpt-5.4-nano,openai/gpt-5.4-mini,openai/gpt-5.4,openai/gpt-5.4-pro,openai/gpt-5.5,openai/gpt-5.5-pro,openai/gpt-5.6-luna,openai/gpt-5.6-terra,openai/gpt-5.6-sol,openai/gpt-5.6-luna-fast,openai/gpt-5.6-terra-fast,openai/gpt-5.6-sol-fast,openai/gpt-6-astra,openai/gpt-6-astra-fast,openai/gpt-6-sol,openai/gpt-6-sol-fast,openai/gpt-6-luna,openai/gpt-6-luna-fast,openai/gpt-6.1-sol,openai/gpt-6.1-sol-fast,google/gemini-2.5-flash-lite,google/gemini-2.5-flash,google/gemini-2.5-pro,google/gemini-3-flash,google/gemini-3.1-pro-preview,google/gemini-3.1-flash-lite,google/gemini-3.5-flash,google/gemini-3.5-flash-lite,google/gemini-3.6-flash,google/gemini-3.7-flash,google/gemini-3.8-flash,google/gemini-4-argon,anthropic/claude-haiku-4.5,anthropic/claude-haiku-5.5,anthropic/claude-sonnet-4.6,anthropic/claude-sonnet-5,anthropic/claude-sonnet-5.5,anthropic/claude-opus-4.6,anthropic/claude-opus-4.7,anthropic/claude-opus-4.8,anthropic/claude-opus-5,anthropic/claude-opus-5-fast,anthropic/claude-opus-5.5,anthropic/claude-opus-5.5-fast,anthropic/claude-fable-5,anthropic/claude-fable-5.1,deepseek/deepseek-v3.2,deepseek/deepseek-v4-flash-0731,deepseek/deepseek-v4.1-flash,deepseek/deepseek-v4-pro-0813,alibaba/qwen3.6-plus,alibaba/qwen3.7-max,alibaba/qwen3.7-plus,alibaba/qwen3.7-flash,alibaba/qwen3.8-flash,alibaba/qwen3.8-max,alibaba/qwen3.8-27b,alibaba/qwen3.8-max-0902,alibaba/qwen3.8-omni-flash,alibaba/qwen3.8-max-prime,spacexai/grok-4.3,spacexai/grok-4.6,spacexai/grok-4.7,zai/glm-5.2,zai/glm-5.2-fast,zai/glm-5.3,zai/glm-5.3-flash,zai/glm-5.3-fast,meta/muse-spark-1.1,meta/muse-spark-1.2,meta/muse-spark-1.3,meta/muse-wonder-1.0,moonshotai/kimi-k3,moonshotai/kimi-k3-fast,mistral/ministral-14b,mistral/mistral-small,mistral/mistral-medium-3.5,mistral/mistral-large-3,mistral/mistral-large-4".split(",");
5
5
  (/* @__PURE__ */ (function(e) {
@@ -20,14 +20,14 @@ new Set(v);
20
20
  var S = n({
21
21
  key: r().optional(),
22
22
  value: r().optional()
23
- }), C = h(a(S), a(n({
23
+ }), C = g(a(S), a(n({
24
24
  key: r(),
25
25
  value: r()
26
26
  })), (e) => e?.filter((e) => e.key?.trim() && e.value?.trim()));
27
27
  n({
28
28
  key: r(),
29
29
  hasValue: c()
30
- }), h(a(n({
30
+ }), g(a(n({
31
31
  key: r().optional(),
32
32
  value: r().max(4096).optional()
33
33
  })), a(n({
@@ -138,7 +138,7 @@ var I = n({
138
138
  lastSyncedAt: r(),
139
139
  lastModified: r().optional(),
140
140
  candidate: n({
141
- media: _,
141
+ media: h,
142
142
  fingerprint: r(),
143
143
  name: r(),
144
144
  webUrl: r(),
@@ -190,7 +190,7 @@ var G = n({
190
190
  at: r().optional()
191
191
  }).loose(), K = n({
192
192
  source: H.optional(),
193
- media: _.optional(),
193
+ media: h.optional(),
194
194
  title: r().optional(),
195
195
  author: r().optional(),
196
196
  description: r().optional(),
@@ -201,7 +201,7 @@ var G = n({
201
201
  producer: r().optional(),
202
202
  creationDate: r().optional(),
203
203
  modificationDate: r().optional(),
204
- pageCount: h(p([i(), a(t())]), i(), (e) => Array.isArray(e) ? e.length : e).optional(),
204
+ pageCount: g(p([i(), a(t())]), i(), (e) => Array.isArray(e) ? e.length : e).optional(),
205
205
  encrypted: c().optional(),
206
206
  characterCount: i().optional(),
207
207
  lineCount: i().optional(),
@@ -277,23 +277,23 @@ q.File, q.Url, q.PlainText, n({
277
277
  purged: i().int(),
278
278
  remaining: i().int()
279
279
  }), n({
280
- ...g.pagination(),
281
- ...g.sort([
280
+ ..._.pagination(),
281
+ ..._.sort([
282
282
  "id",
283
283
  "updatedAt",
284
284
  "createdAt",
285
285
  "name",
286
286
  "deletedAt"
287
287
  ]),
288
- ...g.filters([
288
+ ..._.filters([
289
289
  "type",
290
290
  "language",
291
291
  "agentId",
292
292
  "indexStatus"
293
293
  ]),
294
294
  "filter[deleted]": s(["true", "false"]).optional(),
295
- ...g.fullText(),
296
- ...g.ids(),
295
+ ..._.fullText(),
296
+ ..._.ids(),
297
297
  "filter[similarity]": r().optional(),
298
298
  "filter[folderId]": r().optional(),
299
299
  "filter[hasRedundantChunks]": r().optional(),
@@ -307,7 +307,7 @@ q.File, q.Url, q.PlainText, n({
307
307
  organizationId: r(),
308
308
  agentIds: a(r()).min(1, "At least one agent is required"),
309
309
  folderId: f().nullable().optional(),
310
- media: _.optional(),
310
+ media: h.optional(),
311
311
  url: e().optional(),
312
312
  content: r().optional(),
313
313
  metadata: m(r(), t()).optional(),
@@ -417,4 +417,4 @@ var Y = (e) => {
417
417
  //#endregion
418
418
  export { Z as a, X as i, $ as n, Y as r, ee as t };
419
419
 
420
- //# sourceMappingURL=markdown-Br9ROCBT.js.map
420
+ //# sourceMappingURL=markdown-B1y2QQAa.js.map