@8wave/ai-elements 0.127.0-beta.1 → 0.127.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{Agent-DytagI8S.js → Agent-nB9V45mr.js} +354 -276
- package/dist/_chunks/Agent-nB9V45mr.js.map +1 -0
- package/dist/_chunks/{Document-BdWEd1tb.js → Document-Dm5GM40t.js} +7 -7
- package/dist/_chunks/{Document-BdWEd1tb.js.map → Document-Dm5GM40t.js.map} +1 -1
- package/dist/_chunks/{PkFilePreview-C3BxAdui.js → PkFilePreview-qTCDbut0.js} +3 -3
- package/dist/_chunks/{PkFilePreview-C3BxAdui.js.map → PkFilePreview-qTCDbut0.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-WAm7QSvT.js → PkFilePreviewDialog-m5d4zZDi.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-WAm7QSvT.js.map → PkFilePreviewDialog-m5d4zZDi.js.map} +1 -1
- package/dist/_chunks/{PkImageEditorDialog-DM-d0hCD.js → PkImageEditorDialog-aekpEqWD.js} +2 -2
- package/dist/_chunks/{PkImageEditorDialog-DM-d0hCD.js.map → PkImageEditorDialog-aekpEqWD.js.map} +1 -1
- package/dist/_chunks/{PkSelectionActions-Bl1KbGOj.js → PkSelectionActions-DDhRX6cs.js} +2 -2
- package/dist/_chunks/{PkSelectionActions-Bl1KbGOj.js.map → PkSelectionActions-DDhRX6cs.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-CU1ZUUCf.js → PkStreamingMarkdown-5WfFCjFv.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-CU1ZUUCf.js.map → PkStreamingMarkdown-5WfFCjFv.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-B-Y47Q_K.js → PkToolChatFile-C3B9q2OL.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-B-Y47Q_K.js.map → PkToolChatFile-C3B9q2OL.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-B41xrF8k.js → PkToolRequestGeolocation-D4pYnCW5.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-B41xrF8k.js.map → PkToolRequestGeolocation-D4pYnCW5.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-BuCGuHwd.js → PkToolRequestOAuthConnection-DnnRY2rt.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-BuCGuHwd.js.map → PkToolRequestOAuthConnection-DnnRY2rt.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-Bjm6uhOK.js → PkToolShowArtifact-DQln7TsF.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-Bjm6uhOK.js.map → PkToolShowArtifact-DQln7TsF.js.map} +1 -1
- package/dist/_chunks/{PkToolShowChart-B6TKQ3aT.js → PkToolShowChart-DfDB9BeZ.js} +2 -2
- package/dist/_chunks/{PkToolShowChart-B6TKQ3aT.js.map → PkToolShowChart-DfDB9BeZ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-5tg4xbrh.js → PkToolShowContactForm-Dkb8AiqL.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-5tg4xbrh.js.map → PkToolShowContactForm-Dkb8AiqL.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-CiNtS-vX.js → PkToolShowDiagram-B2dBogUW.js} +2 -2
- package/dist/_chunks/{PkToolShowDiagram-CiNtS-vX.js.map → PkToolShowDiagram-B2dBogUW.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-eh8mXr6u.js → PkToolShowForm-CtDcwJs4.js} +4 -4
- package/dist/_chunks/{PkToolShowForm-eh8mXr6u.js.map → PkToolShowForm-CtDcwJs4.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-DedpXD-b.js → PkToolShowImageGallery-dLMI3SM7.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-DedpXD-b.js.map → PkToolShowImageGallery-dLMI3SM7.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-D24EIc4v.js → PkToolShowProductList-DE6BEdr_.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-D24EIc4v.js.map → PkToolShowProductList-DE6BEdr_.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-Dnw1x7dT.js → PkToolShowSources-vSr080EU.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-Dnw1x7dT.js.map → PkToolShowSources-vSr080EU.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-CxNx1Uf6.js → PkToolShowSuggestedReply-HuKn3loC.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-CxNx1Uf6.js.map → PkToolShowSuggestedReply-HuKn3loC.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-CDcJiprr.js → PkToolShowVideo-BL-9CiYe.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-CDcJiprr.js.map → PkToolShowVideo-BL-9CiYe.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-UXqb0XEJ.js → PkToolShowWebPages-DQfODZdD.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-UXqb0XEJ.js.map → PkToolShowWebPages-DQfODZdD.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-DJAB0Bgw.js → chatImagePolicy-Cj5lkTVq.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-DJAB0Bgw.js.map → chatImagePolicy-Cj5lkTVq.js.map} +1 -1
- package/dist/_chunks/text-CCurUhdH.js +13 -0
- package/dist/_chunks/text-CCurUhdH.js.map +1 -0
- package/dist/_chunks/{utils-78zQeKDO.js → utils-CRy3kzE3.js} +458 -160
- package/dist/_chunks/utils-CRy3kzE3.js.map +1 -0
- package/dist/ai-elements.es.js +5973 -5638
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAuth.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotLocalFolders.d.ts +2 -0
- package/dist-vue/PkChatbotLocalFolders.js +1 -0
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/PkChatbotWakeupBar.js +1 -1
- package/dist-vue/_chunks/{Agent-Da4XChe8.js → Agent-DKefaJeG.js} +445 -377
- package/dist-vue/_chunks/Agent-DKefaJeG.js.map +1 -0
- package/dist-vue/_chunks/{Document-CsQsUQYa.js → Document-B49E_gxT.js} +18 -18
- package/dist-vue/_chunks/{Document-CsQsUQYa.js.map → Document-B49E_gxT.js.map} +1 -1
- package/dist-vue/_chunks/{Media-CMiWEpdQ.js → Media-DtudATme.js} +12 -2
- package/dist-vue/_chunks/Media-DtudATme.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-CITKd3qD.js → PkChatbot-B2SwBImk.js} +10 -9
- package/dist-vue/_chunks/PkChatbot-B2SwBImk.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotAuth-SfTyFbq1.js → PkChatbotAuth-CIK2CFy-.js} +8 -8
- package/dist-vue/_chunks/{PkChatbotAuth-SfTyFbq1.js.map → PkChatbotAuth-CIK2CFy-.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-DI_8T5a4.js → PkChatbotEmptyState-C_htXOSW.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-DI_8T5a4.js.map → PkChatbotEmptyState-C_htXOSW.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotInput-CJ5lPtpH.js +658 -0
- package/dist-vue/_chunks/PkChatbotInput-CJ5lPtpH.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotLocalFolders-CSvqh_Cx.js +126 -0
- package/dist-vue/_chunks/PkChatbotLocalFolders-CSvqh_Cx.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-BWdINCAX.js → PkChatbotMessages-DY8r4UKe.js} +49 -49
- package/dist-vue/_chunks/{PkChatbotMessages-BWdINCAX.js.map → PkChatbotMessages-DY8r4UKe.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-CTwsRpkv.js → PkChatbotStepPayload-BLjH1pkP.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-CTwsRpkv.js.map → PkChatbotStepPayload-BLjH1pkP.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-C9xeMg-k.js → PkChatbotStepToolDetail-wIZmkvr-.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-C9xeMg-k.js.map → PkChatbotStepToolDetail-wIZmkvr-.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-DsubpIKa.js → PkChatbotSteps-DG09GyCb.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotSteps-DsubpIKa.js.map → PkChatbotSteps-DG09GyCb.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-DW1a9ZNl.js → PkChatbotViewChat-DPk9LjX-.js} +685 -667
- package/dist-vue/_chunks/PkChatbotViewChat-DPk9LjX-.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-DdniYy1b.js → PkChatbotViewConversations-NA_PCvZR.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotViewConversations-DdniYy1b.js.map → PkChatbotViewConversations-NA_PCvZR.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-CMoromsf.js → PkChatbotViewFiles-D8_Khdu2.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-CMoromsf.js.map → PkChatbotViewFiles-D8_Khdu2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-BT7I3GhB.js → PkChatbotViewProfile-iTBiQVsZ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-BT7I3GhB.js.map → PkChatbotViewProfile-iTBiQVsZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotWakeupBar-Bx1zqFAX.js → PkChatbotWakeupBar-IoQJdUjI.js} +11 -11
- package/dist-vue/_chunks/PkChatbotWakeupBar-IoQJdUjI.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreview-Dxp-U8QU.js → PkFilePreview-DLJ2wTHk.js} +4 -4
- package/dist-vue/_chunks/{PkFilePreview-Dxp-U8QU.js.map → PkFilePreview-DLJ2wTHk.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-BE-NpN18.js → PkFilePreviewDialog-CDPZ3QIk.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-BE-NpN18.js.map → PkFilePreviewDialog-CDPZ3QIk.js.map} +1 -1
- package/dist-vue/_chunks/{PkImageEditorDialog-BiuOD6Hr.js → PkImageEditorDialog-CrjpCier.js} +2 -2
- package/dist-vue/_chunks/{PkImageEditorDialog-BiuOD6Hr.js.map → PkImageEditorDialog-CrjpCier.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-DMmt35Mq.js → PkStreamingMarkdown-CgKFdzCI.js} +23 -23
- package/dist-vue/_chunks/{PkStreamingMarkdown-DMmt35Mq.js.map → PkStreamingMarkdown-CgKFdzCI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-BdNron14.js → PkToolChatFile-IEQxfzjM.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-BdNron14.js.map → PkToolChatFile-IEQxfzjM.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DeI7kLlR.js → PkToolRequestGeolocation-BmrbMPke.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DeI7kLlR.js.map → PkToolRequestGeolocation-BmrbMPke.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C0lE3Qbk.js → PkToolRequestOAuthConnection-yKgXyOUN.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C0lE3Qbk.js.map → PkToolRequestOAuthConnection-yKgXyOUN.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-C0Gb-LW2.js → PkToolShowArtifact-CF90yFCe.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-C0Gb-LW2.js.map → PkToolShowArtifact-CF90yFCe.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowChart-oJmzU10F.js → PkToolShowChart-CDR8ag4q.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowChart-oJmzU10F.js.map → PkToolShowChart-CDR8ag4q.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-D4IAna-K.js → PkToolShowContactForm-DAdKUU4X.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-D4IAna-K.js.map → PkToolShowContactForm-DAdKUU4X.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-ClGpv5Cr.js → PkToolShowDiagram-Do20AvFb.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-ClGpv5Cr.js.map → PkToolShowDiagram-Do20AvFb.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-ByfNodNh.js → PkToolShowForm-DfFmPOt6.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-ByfNodNh.js.map → PkToolShowForm-DfFmPOt6.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-DJ9JNDWK.js → PkToolShowImageGallery-DA6KW2g_.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-DJ9JNDWK.js.map → PkToolShowImageGallery-DA6KW2g_.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-CcFseg28.js → PkToolShowProductList-FcDDabPI.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-CcFseg28.js.map → PkToolShowProductList-FcDDabPI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-DznWqWK3.js → PkToolShowSources-afCYBONq.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-DznWqWK3.js.map → PkToolShowSources-afCYBONq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-BZqnfpwO.js → PkToolShowSuggestedReply-C863wgtU.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-BZqnfpwO.js.map → PkToolShowSuggestedReply-C863wgtU.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-niwkzqTN.js → PkToolShowVideo-kUiwxRlz.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-niwkzqTN.js.map → PkToolShowVideo-kUiwxRlz.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-BsMVJ6c7.js → PkToolShowWebPages-Dw9D1__u.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-BsMVJ6c7.js.map → PkToolShowWebPages-Dw9D1__u.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-Cd_2UI_O.js → createChatbotApiClient-DzrHp52e.js} +66 -65
- package/dist-vue/_chunks/createChatbotApiClient-DzrHp52e.js.map +1 -0
- package/dist-vue/_chunks/localFolders-ChZp8dLu.js +353 -0
- package/dist-vue/_chunks/localFolders-ChZp8dLu.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-Dir9Rc7K.js → useChatbotStore-DZlc7dzK.js} +1289 -1152
- package/dist-vue/_chunks/useChatbotStore-DZlc7dzK.js.map +1 -0
- package/dist-vue/_chunks/useSettledSelection-1bfM1fzx.js +55 -0
- package/dist-vue/_chunks/useSettledSelection-1bfM1fzx.js.map +1 -0
- package/dist-vue/_chunks/{utils-CibsowVe.js → utils-CY0jFRnG.js} +126 -107
- package/dist-vue/_chunks/utils-CY0jFRnG.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +6 -0
- package/dist-vue/composables.js +62 -10
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +4100 -4086
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +32 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -2
- package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +7 -1
- package/dist-vue/packages/components/src/chat/PkChatbotLocalFolders.d.ts +31 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +3 -2
- package/dist-vue/packages/composable/src/chatbot/hostTools.d.ts +1 -1
- package/dist-vue/packages/composable/src/chatbot/index.d.ts +1 -0
- package/dist-vue/packages/composable/src/chatbot/localFolders.d.ts +137 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +46 -3
- package/dist-vue/packages/models/src/schema/Agent.d.ts +24 -0
- package/dist-vue/packages/models/src/schema/Chat.d.ts +1 -0
- package/dist-vue/packages/models/src/schema/HostTool.d.ts +5 -2
- package/dist-vue/packages/models/src/schema/LocalFolder.d.ts +78 -0
- package/dist-vue/packages/models/src/schema/Organization.d.ts +10 -0
- package/dist-vue/packages/models/src/schema/PageAccess.d.ts +4 -1
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +8 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +8 -0
- package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-DytagI8S.js.map +0 -1
- package/dist/_chunks/text-5F7L8EHi.js +0 -5
- package/dist/_chunks/text-5F7L8EHi.js.map +0 -1
- package/dist/_chunks/utils-78zQeKDO.js.map +0 -1
- package/dist-vue/_chunks/Agent-Da4XChe8.js.map +0 -1
- package/dist-vue/_chunks/Media-CMiWEpdQ.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-CITKd3qD.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-UqcSEi8l.js +0 -708
- package/dist-vue/_chunks/PkChatbotInput-UqcSEi8l.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-DW1a9ZNl.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotWakeupBar-Bx1zqFAX.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-Cd_2UI_O.js.map +0 -1
- package/dist-vue/_chunks/message-DuibQyHy.js +0 -61
- package/dist-vue/_chunks/message-DuibQyHy.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-Dir9Rc7K.js.map +0 -1
- package/dist-vue/_chunks/utils-CibsowVe.js.map +0 -1
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { $ as e, A as t, B as n, C as r, Ct as i, D as a, E as o, F as s, G as c, H as l, I as u, J as d, K as f, L as p, O as m, P as h, Q as g, R as _, S as v, St as y, V as b, W as ee, X as te, Y as ne, Z as re, _ as ie, _t as ae, a as oe, at as se, b as ce, bt as le, c as ue, ct as de, d as fe, dt as pe, et as me, ft as he, g as ge, gt as x, h as _e, it as ve, j as ye, lt as be, m as S, nt as xe, o as Se, ot as C, pt as Ce, q as we, rt as Te, s as Ee, st as De, tt as
|
|
2
|
-
import { n as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { $ as e, A as t, B as n, C as r, Ct as i, D as a, E as o, F as s, G as c, H as l, I as u, J as d, K as f, L as p, O as m, P as h, Q as g, R as _, S as v, St as y, V as b, W as ee, X as te, Y as ne, Z as re, _ as ie, _t as ae, a as oe, at as se, b as ce, bt as le, c as ue, ct as de, d as fe, dt as pe, et as me, ft as he, g as ge, gt as x, h as _e, it as ve, j as ye, lt as be, m as S, nt as xe, o as Se, ot as C, pt as Ce, q as we, rt as Te, s as Ee, st as De, tt as w, u as Oe, ut as ke, vt as Ae, x as je, xt as Me, yt as Ne, z as Pe } from "./schemas-CfXaKVGu.js";
|
|
2
|
+
import { n as Fe, t as Ie } from "./useSafeLocalStorage-Bn4SsL8C.js";
|
|
3
|
+
import { t as Le } from "./useSettledSelection-1bfM1fzx.js";
|
|
4
|
+
import { a as Re, i as ze, n as Be } from "./createChatbotApiClient-DzrHp52e.js";
|
|
5
|
+
import { s as Ve } from "./Media-DtudATme.js";
|
|
6
|
+
import { Q as He, V as Ue, Z as We, ct as Ge, et as Ke, gt as qe, ht as Je, mt as Ye, nt as Xe } from "./Agent-DKefaJeG.js";
|
|
7
|
+
import { a as Ze, c as Qe, g as $e, i as et, l as tt, n as nt, o as rt, r as it, s as at, t as ot, w as st } from "./localFolders-ChZp8dLu.js";
|
|
8
|
+
import { n as ct } from "./src-nb8MU1sh.js";
|
|
9
|
+
import { computed as T, getCurrentScope as lt, isReadonly as ut, nextTick as dt, onScopeDispose as ft, reactive as pt, ref as E, shallowRef as D, toRefs as mt, toValue as ht, watch as O, watchEffect as gt } from "vue";
|
|
10
|
+
import { useI18n as _t } from "vue-i18n";
|
|
11
|
+
import { useDocumentVisibility as vt, usePreferredDark as yt } from "@vueuse/core";
|
|
12
|
+
import { defineStore as bt } from "pinia";
|
|
11
13
|
// ../../packages/utils/src/device-context.ts
|
|
12
|
-
function
|
|
14
|
+
function xt() {
|
|
13
15
|
let e = navigator.connection, t = navigator.userAgentData;
|
|
14
16
|
return {
|
|
15
17
|
dateTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -39,7 +41,7 @@ function ct() {
|
|
|
39
41
|
historyLength: window.history.length
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
|
-
async function
|
|
44
|
+
async function St(e) {
|
|
43
45
|
if (!navigator.geolocation || !navigator.permissions) return null;
|
|
44
46
|
try {
|
|
45
47
|
if ((await navigator.permissions.query({ name: "geolocation" })).state !== "granted") return null;
|
|
@@ -57,16 +59,16 @@ async function lt(e) {
|
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
// ../../packages/composable/src/chatbot/hostTools.ts
|
|
60
|
-
var
|
|
62
|
+
var Ct = "agentstudio:page-navigation", wt = (e) => typeof e?.afterOutput == "function", Tt = (e) => e.toolMetadata?.source === Ye, Et = (e, t) => {
|
|
61
63
|
if (!t || !e?.length) return;
|
|
62
|
-
let n = new Set(t.allowed), r = e.filter((e) => n.has(e.name) && !
|
|
64
|
+
let n = new Set(t.allowed), r = e.filter((e) => n.has(e.name) && !Ke(e.name)).map(({ execute: e, confirmation: t, policy: n, ...r }) => r);
|
|
63
65
|
return r.length > 0 ? r : void 0;
|
|
64
66
|
};
|
|
65
|
-
function
|
|
67
|
+
function Dt(e) {
|
|
66
68
|
let t = 0, n = 0, r = (t) => {
|
|
67
69
|
n = t, e.onPendingChange?.(n);
|
|
68
70
|
}, i = Promise.resolve(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
69
|
-
|
|
71
|
+
wt(e) && e.abandon?.();
|
|
70
72
|
}, c = (e, t) => t.requireConfirmation.includes(e.name) || t.confirmDestructive && e.annotations?.destructiveHint === !0, l = (t, n) => e.addToolOutput({
|
|
71
73
|
tool: t.toolName,
|
|
72
74
|
toolCallId: t.toolCallId,
|
|
@@ -80,7 +82,7 @@ function mt(e) {
|
|
|
80
82
|
async function d(n, r) {
|
|
81
83
|
let i = () => r === t, d = e.capability(), f = e.registry()?.find((e) => e.name === n.toolName), p = f?.policy?.timeoutMs ?? d?.timeoutMs;
|
|
82
84
|
if (!f || p === void 0) {
|
|
83
|
-
u(n,
|
|
85
|
+
u(n, Je(n.readOnly));
|
|
84
86
|
return;
|
|
85
87
|
}
|
|
86
88
|
let m;
|
|
@@ -118,7 +120,7 @@ function mt(e) {
|
|
|
118
120
|
s(r);
|
|
119
121
|
return;
|
|
120
122
|
}
|
|
121
|
-
if (
|
|
123
|
+
if (wt(r)) {
|
|
122
124
|
l(n, r.result ?? null);
|
|
123
125
|
let t = !1, a = () => {
|
|
124
126
|
t || (t = !0, o.delete(a), r.abandon?.());
|
|
@@ -130,7 +132,7 @@ function mt(e) {
|
|
|
130
132
|
} catch (e) {
|
|
131
133
|
if (b?.then(s, () => void 0), !i()) return;
|
|
132
134
|
let t = v.signal.aborted;
|
|
133
|
-
u(n, t ?
|
|
135
|
+
u(n, t ? Je(n.readOnly) : e instanceof Error && e.message ? e.message : "The host app failed to run this call.");
|
|
134
136
|
} finally {
|
|
135
137
|
clearTimeout(y), a.delete(n.toolCallId), e.onActivity?.(void 0);
|
|
136
138
|
}
|
|
@@ -151,65 +153,65 @@ function mt(e) {
|
|
|
151
153
|
};
|
|
152
154
|
}
|
|
153
155
|
// ../../node_modules/.pnpm/@ai-sdk+provider@4.0.39/node_modules/@ai-sdk/provider/dist/index.js
|
|
154
|
-
var
|
|
156
|
+
var Ot = "vercel.ai.error", kt = Symbol.for(Ot), k = class e extends Error {
|
|
155
157
|
constructor({ name: e, message: t, cause: n }) {
|
|
156
|
-
super(t), this[
|
|
158
|
+
super(t), this[kt] = !0, this.name = e, this.cause = n;
|
|
157
159
|
}
|
|
158
160
|
static isInstance(t) {
|
|
159
|
-
return e.hasMarker(t,
|
|
161
|
+
return e.hasMarker(t, Ot);
|
|
160
162
|
}
|
|
161
163
|
static hasMarker(e, t) {
|
|
162
164
|
let n = Symbol.for(t);
|
|
163
165
|
return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
|
|
164
166
|
}
|
|
165
|
-
},
|
|
167
|
+
}, At = "AI_APICallError", jt = `vercel.ai.error.${At}`, Mt = Symbol.for(jt), Nt = class extends k {
|
|
166
168
|
constructor({ message: e, url: t, requestBodyValues: n, statusCode: r, responseHeaders: i, responseBody: a, cause: o, isRetryable: s = r != null && (r === 408 || r === 409 || r === 429 || r >= 500), data: c }) {
|
|
167
169
|
super({
|
|
168
|
-
name:
|
|
170
|
+
name: At,
|
|
169
171
|
message: e,
|
|
170
172
|
cause: o
|
|
171
|
-
}), this[
|
|
173
|
+
}), this[Mt] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
|
|
172
174
|
}
|
|
173
175
|
static isInstance(e) {
|
|
174
|
-
return
|
|
176
|
+
return k.hasMarker(e, jt);
|
|
175
177
|
}
|
|
176
|
-
},
|
|
178
|
+
}, Pt = "AI_EmptyResponseBodyError", A = `vercel.ai.error.${Pt}`, Ft = Symbol.for(A), It = class extends k {
|
|
177
179
|
constructor({ message: e = "Empty response body" } = {}) {
|
|
178
180
|
super({
|
|
179
|
-
name:
|
|
181
|
+
name: Pt,
|
|
180
182
|
message: e
|
|
181
|
-
}), this[
|
|
183
|
+
}), this[Ft] = !0;
|
|
182
184
|
}
|
|
183
185
|
static isInstance(e) {
|
|
184
|
-
return
|
|
186
|
+
return k.hasMarker(e, A);
|
|
185
187
|
}
|
|
186
188
|
};
|
|
187
|
-
function
|
|
189
|
+
function Lt(e) {
|
|
188
190
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
|
|
189
191
|
}
|
|
190
|
-
var
|
|
192
|
+
var j = "AI_InvalidArgumentError", Rt = `vercel.ai.error.${j}`, zt = Symbol.for(Rt), Bt = class extends k {
|
|
191
193
|
constructor({ message: e, cause: t, argument: n }) {
|
|
192
194
|
super({
|
|
193
|
-
name:
|
|
195
|
+
name: j,
|
|
194
196
|
message: e,
|
|
195
197
|
cause: t
|
|
196
|
-
}), this[
|
|
198
|
+
}), this[zt] = !0, this.argument = n;
|
|
197
199
|
}
|
|
198
200
|
static isInstance(e) {
|
|
199
|
-
return
|
|
201
|
+
return k.hasMarker(e, Rt);
|
|
200
202
|
}
|
|
201
|
-
},
|
|
203
|
+
}, Vt = "AI_JSONParseError", Ht = `vercel.ai.error.${Vt}`, Ut = Symbol.for(Ht), M = class extends k {
|
|
202
204
|
constructor({ text: e, cause: t }) {
|
|
203
205
|
super({
|
|
204
|
-
name:
|
|
205
|
-
message: `JSON parsing failed: Text: ${e}.\nError message: ${
|
|
206
|
+
name: Vt,
|
|
207
|
+
message: `JSON parsing failed: Text: ${e}.\nError message: ${Lt(t)}`,
|
|
206
208
|
cause: t
|
|
207
|
-
}), this[
|
|
209
|
+
}), this[Ut] = !0, this.text = e;
|
|
208
210
|
}
|
|
209
211
|
static isInstance(e) {
|
|
210
|
-
return
|
|
212
|
+
return k.hasMarker(e, Ht);
|
|
211
213
|
}
|
|
212
|
-
},
|
|
214
|
+
}, Wt = "AI_TypeValidationError", Gt = `vercel.ai.error.${Wt}`, Kt = Symbol.for(Gt), qt = class e extends k {
|
|
213
215
|
constructor({ value: e, cause: t, context: n }) {
|
|
214
216
|
let r = "Type validation failed";
|
|
215
217
|
if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
|
|
@@ -218,13 +220,13 @@ var Et = "AI_InvalidArgumentError", Dt = `vercel.ai.error.${Et}`, Ot = Symbol.fo
|
|
|
218
220
|
n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
|
|
219
221
|
}
|
|
220
222
|
super({
|
|
221
|
-
name:
|
|
222
|
-
message: `${r}: Value: ${JSON.stringify(e)}.\nError message: ${
|
|
223
|
+
name: Wt,
|
|
224
|
+
message: `${r}: Value: ${JSON.stringify(e)}.\nError message: ${Lt(t)}`,
|
|
223
225
|
cause: t
|
|
224
|
-
}), this[
|
|
226
|
+
}), this[Kt] = !0, this.value = e, this.context = n;
|
|
225
227
|
}
|
|
226
228
|
static isInstance(e) {
|
|
227
|
-
return
|
|
229
|
+
return k.hasMarker(e, Gt);
|
|
228
230
|
}
|
|
229
231
|
static wrap({ value: t, cause: n, context: r }) {
|
|
230
232
|
return e.isInstance(n) && n.value === t && n.context?.field === r?.field && n.context?.entityName === r?.entityName && n.context?.entityId === r?.entityId ? n : new e({
|
|
@@ -233,25 +235,25 @@ var Et = "AI_InvalidArgumentError", Dt = `vercel.ai.error.${Et}`, Ot = Symbol.fo
|
|
|
233
235
|
context: r
|
|
234
236
|
});
|
|
235
237
|
}
|
|
236
|
-
},
|
|
238
|
+
}, Jt = "AI_UnsupportedFunctionalityError", Yt = `vercel.ai.error.${Jt}`, Xt = Symbol.for(Yt), Zt = class extends k {
|
|
237
239
|
constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
|
|
238
240
|
super({
|
|
239
|
-
name:
|
|
241
|
+
name: Jt,
|
|
240
242
|
message: t
|
|
241
|
-
}), this[
|
|
243
|
+
}), this[Xt] = !0, this.functionality = e;
|
|
242
244
|
}
|
|
243
245
|
static isInstance(e) {
|
|
244
|
-
return
|
|
246
|
+
return k.hasMarker(e, Yt);
|
|
245
247
|
}
|
|
246
|
-
},
|
|
248
|
+
}, Qt = class extends Error {
|
|
247
249
|
constructor(e, t) {
|
|
248
250
|
super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
|
|
249
251
|
}
|
|
250
|
-
},
|
|
251
|
-
function
|
|
252
|
-
function
|
|
252
|
+
}, $t = 10, N = 13, P = 32;
|
|
253
|
+
function en(e) {}
|
|
254
|
+
function tn(e) {
|
|
253
255
|
if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
|
|
254
|
-
let { onEvent: t =
|
|
256
|
+
let { onEvent: t = en, onError: n = en, onRetry: r = en, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
|
|
255
257
|
function m(e) {
|
|
256
258
|
if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
|
|
257
259
|
if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
|
|
@@ -270,7 +272,7 @@ function Ut(e) {
|
|
|
270
272
|
n !== "" && (o.push(n), s = n.length), h();
|
|
271
273
|
}
|
|
272
274
|
function h() {
|
|
273
|
-
a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new
|
|
275
|
+
a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new Qt(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
|
|
274
276
|
}
|
|
275
277
|
function g(e) {
|
|
276
278
|
let n = 0;
|
|
@@ -286,9 +288,9 @@ function Ut(e) {
|
|
|
286
288
|
continue;
|
|
287
289
|
}
|
|
288
290
|
let i = e.charCodeAt(n);
|
|
289
|
-
if (
|
|
290
|
-
let i = e.charCodeAt(n + 5) ===
|
|
291
|
-
if (d === 0 && e.charCodeAt(r + 1) ===
|
|
291
|
+
if (F(e, n, i)) {
|
|
292
|
+
let i = e.charCodeAt(n + 5) === P ? n + 6 : n + 5, a = e.slice(i, r);
|
|
293
|
+
if (d === 0 && e.charCodeAt(r + 1) === $t) {
|
|
292
294
|
t({
|
|
293
295
|
id: l,
|
|
294
296
|
event: f,
|
|
@@ -298,7 +300,7 @@ function Ut(e) {
|
|
|
298
300
|
}
|
|
299
301
|
u = d === 0 ? a : `${u}
|
|
300
302
|
${a}`, d++;
|
|
301
|
-
} else
|
|
303
|
+
} else I(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === P ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
|
|
302
304
|
n = r + 1, r = e.indexOf("\n", n);
|
|
303
305
|
}
|
|
304
306
|
return e.slice(n);
|
|
@@ -306,7 +308,7 @@ ${a}`, d++;
|
|
|
306
308
|
for (; n < e.length;) {
|
|
307
309
|
let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
|
|
308
310
|
if (t !== -1 && r !== -1 ? i = t < r ? t : r : t === -1 ? r !== -1 && (i = r) : i = t === e.length - 1 ? -1 : t, i === -1) break;
|
|
309
|
-
_(e, n, i), n = i + 1, e.charCodeAt(n - 1) ===
|
|
311
|
+
_(e, n, i), n = i + 1, e.charCodeAt(n - 1) === N && e.charCodeAt(n) === $t && n++;
|
|
310
312
|
}
|
|
311
313
|
return e.slice(n);
|
|
312
314
|
}
|
|
@@ -316,25 +318,25 @@ ${a}`, d++;
|
|
|
316
318
|
return;
|
|
317
319
|
}
|
|
318
320
|
let r = e.charCodeAt(t);
|
|
319
|
-
if (
|
|
320
|
-
let r = e.charCodeAt(t + 5) ===
|
|
321
|
+
if (F(e, t, r)) {
|
|
322
|
+
let r = e.charCodeAt(t + 5) === P ? t + 6 : t + 5, i = e.slice(r, n);
|
|
321
323
|
u = d === 0 ? i : `${u}
|
|
322
324
|
${i}`, d++;
|
|
323
325
|
return;
|
|
324
326
|
}
|
|
325
|
-
if (
|
|
326
|
-
f = e.slice(e.charCodeAt(t + 6) ===
|
|
327
|
+
if (I(e, t, r)) {
|
|
328
|
+
f = e.slice(e.charCodeAt(t + 6) === P ? t + 7 : t + 6, n) || void 0;
|
|
327
329
|
return;
|
|
328
330
|
}
|
|
329
331
|
if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
|
|
330
|
-
let r = e.slice(e.charCodeAt(t + 3) ===
|
|
332
|
+
let r = e.slice(e.charCodeAt(t + 3) === P ? t + 4 : t + 3, n);
|
|
331
333
|
l = r.includes("\0") ? void 0 : r;
|
|
332
334
|
return;
|
|
333
335
|
}
|
|
334
336
|
if (r === 58) {
|
|
335
337
|
if (i) {
|
|
336
338
|
let r = e.slice(t, n);
|
|
337
|
-
i(r.slice(e.charCodeAt(t + 1) ===
|
|
339
|
+
i(r.slice(e.charCodeAt(t + 1) === P ? 2 : 1));
|
|
338
340
|
}
|
|
339
341
|
return;
|
|
340
342
|
}
|
|
@@ -343,7 +345,7 @@ ${i}`, d++;
|
|
|
343
345
|
v(a, "", a);
|
|
344
346
|
return;
|
|
345
347
|
}
|
|
346
|
-
let s = a.slice(0, o), c = a.charCodeAt(o + 1) ===
|
|
348
|
+
let s = a.slice(0, o), c = a.charCodeAt(o + 1) === P ? 2 : 1;
|
|
347
349
|
v(s, a.slice(o + c), a);
|
|
348
350
|
}
|
|
349
351
|
function v(e, t, i) {
|
|
@@ -359,13 +361,13 @@ ${t}`, d++;
|
|
|
359
361
|
l = t.includes("\0") ? void 0 : t;
|
|
360
362
|
break;
|
|
361
363
|
case "retry":
|
|
362
|
-
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new
|
|
364
|
+
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Qt(`Invalid \`retry\` value: "${t}"`, {
|
|
363
365
|
type: "invalid-retry",
|
|
364
366
|
value: t,
|
|
365
367
|
line: i
|
|
366
368
|
}));
|
|
367
369
|
break;
|
|
368
|
-
default: n(new
|
|
370
|
+
default: n(new Qt(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
|
|
369
371
|
type: "unknown-field",
|
|
370
372
|
field: e,
|
|
371
373
|
value: t,
|
|
@@ -392,19 +394,19 @@ ${t}`, d++;
|
|
|
392
394
|
reset: b
|
|
393
395
|
};
|
|
394
396
|
}
|
|
395
|
-
function
|
|
397
|
+
function F(e, t, n) {
|
|
396
398
|
return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
|
|
397
399
|
}
|
|
398
|
-
function
|
|
400
|
+
function I(e, t, n) {
|
|
399
401
|
return n === 101 && e.charCodeAt(t + 1) === 118 && e.charCodeAt(t + 2) === 101 && e.charCodeAt(t + 3) === 110 && e.charCodeAt(t + 4) === 116 && e.charCodeAt(t + 5) === 58;
|
|
400
402
|
}
|
|
401
403
|
// ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
|
|
402
|
-
var
|
|
404
|
+
var nn = class extends TransformStream {
|
|
403
405
|
constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
|
|
404
406
|
let i;
|
|
405
407
|
super({
|
|
406
408
|
start(a) {
|
|
407
|
-
i =
|
|
409
|
+
i = tn({
|
|
408
410
|
onEvent: (e) => {
|
|
409
411
|
a.enqueue(e);
|
|
410
412
|
},
|
|
@@ -423,19 +425,19 @@ var Kt = class extends TransformStream {
|
|
|
423
425
|
}
|
|
424
426
|
};
|
|
425
427
|
new TextDecoder();
|
|
426
|
-
var { btoa:
|
|
427
|
-
function
|
|
428
|
-
return ArrayBuffer.isView(e) &&
|
|
428
|
+
var { btoa: rn, atob: an } = globalThis, on = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get, sn = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
|
|
429
|
+
function cn(e) {
|
|
430
|
+
return ArrayBuffer.isView(e) && on.call(e) === "Uint8Array";
|
|
429
431
|
}
|
|
430
|
-
function
|
|
432
|
+
function ln(e) {
|
|
431
433
|
if (typeof e != "object" || !e || !("byteLength" in e)) return !1;
|
|
432
434
|
try {
|
|
433
|
-
return
|
|
435
|
+
return sn.call(e), !0;
|
|
434
436
|
} catch {
|
|
435
437
|
return !1;
|
|
436
438
|
}
|
|
437
439
|
}
|
|
438
|
-
function
|
|
440
|
+
function L(e) {
|
|
439
441
|
if (e == null) return {};
|
|
440
442
|
let t = {};
|
|
441
443
|
if (e instanceof Headers) e.forEach((e, n) => {
|
|
@@ -447,28 +449,28 @@ function Qt(e) {
|
|
|
447
449
|
}
|
|
448
450
|
return t;
|
|
449
451
|
}
|
|
450
|
-
var
|
|
452
|
+
var R = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
|
|
451
453
|
let i = () => {
|
|
452
454
|
let e = n.length, r = Array(t);
|
|
453
455
|
for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
|
|
454
456
|
return r.join("");
|
|
455
457
|
};
|
|
456
458
|
if (e == null) return i;
|
|
457
|
-
if (n.includes(r)) throw new
|
|
459
|
+
if (n.includes(r)) throw new Bt({
|
|
458
460
|
argument: "separator",
|
|
459
461
|
message: `The separator "${r}" must not be part of the alphabet "${n}".`
|
|
460
462
|
});
|
|
461
463
|
return () => `${e}${r}${i()}`;
|
|
462
|
-
},
|
|
463
|
-
function
|
|
464
|
+
}, un = R();
|
|
465
|
+
function dn(e) {
|
|
464
466
|
return globalThis.Buffer?.isBuffer(e) ?? !1;
|
|
465
467
|
}
|
|
466
|
-
var
|
|
467
|
-
function
|
|
468
|
+
var fn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, pn = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
469
|
+
function mn(e) {
|
|
468
470
|
let t = JSON.parse(e);
|
|
469
|
-
return typeof t != "object" || !t ||
|
|
471
|
+
return typeof t != "object" || !t || fn.test(e) === !1 && pn.test(e) === !1 ? t : hn(t);
|
|
470
472
|
}
|
|
471
|
-
function
|
|
473
|
+
function hn(e) {
|
|
472
474
|
let t = [e];
|
|
473
475
|
for (; t.length;) {
|
|
474
476
|
let e = t;
|
|
@@ -483,20 +485,20 @@ function rn(e) {
|
|
|
483
485
|
}
|
|
484
486
|
return e;
|
|
485
487
|
}
|
|
486
|
-
function
|
|
488
|
+
function gn(e) {
|
|
487
489
|
let { stackTraceLimit: t } = Error;
|
|
488
490
|
try {
|
|
489
491
|
Error.stackTraceLimit = 0;
|
|
490
492
|
} catch {
|
|
491
|
-
return
|
|
493
|
+
return mn(e);
|
|
492
494
|
}
|
|
493
495
|
try {
|
|
494
|
-
return
|
|
496
|
+
return mn(e);
|
|
495
497
|
} finally {
|
|
496
498
|
Error.stackTraceLimit = t;
|
|
497
499
|
}
|
|
498
500
|
}
|
|
499
|
-
function
|
|
501
|
+
function _n(e) {
|
|
500
502
|
if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
|
|
501
503
|
let { additionalProperties: t } = e;
|
|
502
504
|
e.additionalProperties = t != null && typeof t != "boolean" && z(t);
|
|
@@ -509,9 +511,9 @@ function R(e) {
|
|
|
509
511
|
return e;
|
|
510
512
|
}
|
|
511
513
|
function z(e) {
|
|
512
|
-
return typeof e == "boolean" ? e :
|
|
514
|
+
return typeof e == "boolean" ? e : _n(e);
|
|
513
515
|
}
|
|
514
|
-
var
|
|
516
|
+
var vn = Symbol("Let zodToJsonSchema decide on which parser to use"), yn = {
|
|
515
517
|
name: void 0,
|
|
516
518
|
$refStrategy: "root",
|
|
517
519
|
basePath: ["#"],
|
|
@@ -531,24 +533,24 @@ var on = Symbol("Let zodToJsonSchema decide on which parser to use"), sn = {
|
|
|
531
533
|
emailStrategy: "format:email",
|
|
532
534
|
base64Strategy: "contentEncoding:base64",
|
|
533
535
|
nameStrategy: "ref"
|
|
534
|
-
},
|
|
535
|
-
...
|
|
536
|
+
}, bn = (e) => typeof e == "string" ? {
|
|
537
|
+
...yn,
|
|
536
538
|
name: e
|
|
537
539
|
} : {
|
|
538
|
-
...
|
|
540
|
+
...yn,
|
|
539
541
|
...e
|
|
540
542
|
};
|
|
541
543
|
function B() {
|
|
542
544
|
return {};
|
|
543
545
|
}
|
|
544
|
-
function
|
|
546
|
+
function xn(e, t) {
|
|
545
547
|
let n = { type: "array" };
|
|
546
|
-
return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items =
|
|
548
|
+
return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = q(e.type._def, {
|
|
547
549
|
...t,
|
|
548
550
|
currentPath: [...t.currentPath, "items"]
|
|
549
551
|
})), e.minLength && (n.minItems = e.minLength.value), e.maxLength && (n.maxItems = e.maxLength.value), e.exactLength && (n.minItems = e.exactLength.value, n.maxItems = e.exactLength.value), n;
|
|
550
552
|
}
|
|
551
|
-
function
|
|
553
|
+
function Sn(e) {
|
|
552
554
|
let t = {
|
|
553
555
|
type: "integer",
|
|
554
556
|
format: "int64"
|
|
@@ -565,16 +567,16 @@ function un(e) {
|
|
|
565
567
|
}
|
|
566
568
|
return t;
|
|
567
569
|
}
|
|
568
|
-
function
|
|
570
|
+
function V() {
|
|
569
571
|
return { type: "boolean" };
|
|
570
572
|
}
|
|
571
|
-
function
|
|
572
|
-
return
|
|
573
|
+
function Cn(e, t) {
|
|
574
|
+
return q(e.type._def, t);
|
|
573
575
|
}
|
|
574
|
-
var
|
|
575
|
-
function
|
|
576
|
+
var wn = (e, t) => q(e.innerType._def, t);
|
|
577
|
+
function Tn(e, t, n) {
|
|
576
578
|
let r = n ?? t.dateStrategy;
|
|
577
|
-
if (Array.isArray(r)) return { anyOf: r.map((n) =>
|
|
579
|
+
if (Array.isArray(r)) return { anyOf: r.map((n) => Tn(e, t, n)) };
|
|
578
580
|
switch (r) {
|
|
579
581
|
case "string":
|
|
580
582
|
case "format:date-time": return {
|
|
@@ -585,10 +587,10 @@ function mn(e, t, n) {
|
|
|
585
587
|
type: "string",
|
|
586
588
|
format: "date"
|
|
587
589
|
};
|
|
588
|
-
case "integer": return
|
|
590
|
+
case "integer": return En(e);
|
|
589
591
|
}
|
|
590
592
|
}
|
|
591
|
-
var
|
|
593
|
+
var En = (e) => {
|
|
592
594
|
let t = {
|
|
593
595
|
type: "integer",
|
|
594
596
|
format: "unix-time"
|
|
@@ -601,31 +603,31 @@ var V = (e) => {
|
|
|
601
603
|
}
|
|
602
604
|
return t;
|
|
603
605
|
};
|
|
604
|
-
function
|
|
606
|
+
function Dn(e, t) {
|
|
605
607
|
return {
|
|
606
|
-
...
|
|
608
|
+
...q(e.innerType._def, t),
|
|
607
609
|
default: e.defaultValue()
|
|
608
610
|
};
|
|
609
611
|
}
|
|
610
|
-
function
|
|
611
|
-
return t.effectStrategy === "input" ?
|
|
612
|
+
function On(e, t) {
|
|
613
|
+
return t.effectStrategy === "input" ? q(e.schema._def, t) : B();
|
|
612
614
|
}
|
|
613
|
-
function
|
|
615
|
+
function kn(e) {
|
|
614
616
|
return {
|
|
615
617
|
type: "string",
|
|
616
618
|
enum: Array.from(e.values)
|
|
617
619
|
};
|
|
618
620
|
}
|
|
619
|
-
var
|
|
620
|
-
function
|
|
621
|
-
let n = [
|
|
621
|
+
var An = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
622
|
+
function jn(e, t) {
|
|
623
|
+
let n = [q(e.left._def, {
|
|
622
624
|
...t,
|
|
623
625
|
currentPath: [
|
|
624
626
|
...t.currentPath,
|
|
625
627
|
"allOf",
|
|
626
628
|
"0"
|
|
627
629
|
]
|
|
628
|
-
}),
|
|
630
|
+
}), q(e.right._def, {
|
|
629
631
|
...t,
|
|
630
632
|
currentPath: [
|
|
631
633
|
...t.currentPath,
|
|
@@ -634,7 +636,7 @@ function _n(e, t) {
|
|
|
634
636
|
]
|
|
635
637
|
})].filter((e) => !!e), r = [];
|
|
636
638
|
return n.forEach((e) => {
|
|
637
|
-
if (
|
|
639
|
+
if (An(e)) r.push(...e.allOf);
|
|
638
640
|
else {
|
|
639
641
|
let t = e;
|
|
640
642
|
if ("additionalProperties" in e && e.additionalProperties === !1) {
|
|
@@ -645,19 +647,19 @@ function _n(e, t) {
|
|
|
645
647
|
}
|
|
646
648
|
}), r.length ? { allOf: r } : void 0;
|
|
647
649
|
}
|
|
648
|
-
function
|
|
650
|
+
function Mn(e) {
|
|
649
651
|
let t = typeof e.value;
|
|
650
652
|
return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : {
|
|
651
653
|
type: t === "bigint" ? "integer" : t,
|
|
652
654
|
const: e.value
|
|
653
655
|
};
|
|
654
656
|
}
|
|
655
|
-
var
|
|
657
|
+
var Nn = void 0, H = {
|
|
656
658
|
cuid: /^[cC][^\s-]{8,}$/,
|
|
657
659
|
cuid2: /^[0-9a-z]+$/,
|
|
658
660
|
ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
|
|
659
661
|
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}$/,
|
|
660
|
-
emoji: () => (
|
|
662
|
+
emoji: () => (Nn === void 0 && (Nn = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), Nn),
|
|
661
663
|
uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
|
|
662
664
|
ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
|
|
663
665
|
ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
|
|
@@ -668,7 +670,7 @@ var yn = void 0, W = {
|
|
|
668
670
|
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
669
671
|
jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
|
|
670
672
|
};
|
|
671
|
-
function
|
|
673
|
+
function Pn(e, t) {
|
|
672
674
|
let n = { type: "string" };
|
|
673
675
|
if (e.checks) for (let r of e.checks) switch (r.kind) {
|
|
674
676
|
case "min":
|
|
@@ -680,108 +682,108 @@ function bn(e, t) {
|
|
|
680
682
|
case "email":
|
|
681
683
|
switch (t.emailStrategy) {
|
|
682
684
|
case "format:email":
|
|
683
|
-
|
|
685
|
+
U(n, "email", r.message, t);
|
|
684
686
|
break;
|
|
685
687
|
case "format:idn-email":
|
|
686
|
-
|
|
688
|
+
U(n, "idn-email", r.message, t);
|
|
687
689
|
break;
|
|
688
|
-
case "pattern:zod":
|
|
690
|
+
case "pattern:zod": W(n, H.email, r.message, t);
|
|
689
691
|
}
|
|
690
692
|
break;
|
|
691
693
|
case "url":
|
|
692
|
-
|
|
694
|
+
U(n, "uri", r.message, t);
|
|
693
695
|
break;
|
|
694
696
|
case "uuid":
|
|
695
|
-
|
|
697
|
+
U(n, "uuid", r.message, t);
|
|
696
698
|
break;
|
|
697
699
|
case "regex":
|
|
698
|
-
|
|
700
|
+
W(n, r.regex, r.message, t);
|
|
699
701
|
break;
|
|
700
702
|
case "cuid":
|
|
701
|
-
|
|
703
|
+
W(n, H.cuid, r.message, t);
|
|
702
704
|
break;
|
|
703
705
|
case "cuid2":
|
|
704
|
-
|
|
706
|
+
W(n, H.cuid2, r.message, t);
|
|
705
707
|
break;
|
|
706
708
|
case "startsWith":
|
|
707
|
-
|
|
709
|
+
W(n, RegExp(`^${Fn(r.value, t)}`), r.message, t);
|
|
708
710
|
break;
|
|
709
711
|
case "endsWith":
|
|
710
|
-
|
|
712
|
+
W(n, RegExp(`${Fn(r.value, t)}$`), r.message, t);
|
|
711
713
|
break;
|
|
712
714
|
case "datetime":
|
|
713
|
-
|
|
715
|
+
U(n, "date-time", r.message, t);
|
|
714
716
|
break;
|
|
715
717
|
case "date":
|
|
716
|
-
|
|
718
|
+
U(n, "date", r.message, t);
|
|
717
719
|
break;
|
|
718
720
|
case "time":
|
|
719
|
-
|
|
721
|
+
U(n, "time", r.message, t);
|
|
720
722
|
break;
|
|
721
723
|
case "duration":
|
|
722
|
-
|
|
724
|
+
U(n, "duration", r.message, t);
|
|
723
725
|
break;
|
|
724
726
|
case "length":
|
|
725
727
|
n.minLength = typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, n.maxLength = typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value;
|
|
726
728
|
break;
|
|
727
729
|
case "includes":
|
|
728
|
-
|
|
730
|
+
W(n, RegExp(Fn(r.value, t)), r.message, t);
|
|
729
731
|
break;
|
|
730
732
|
case "ip":
|
|
731
|
-
r.version !== "v6" &&
|
|
733
|
+
r.version !== "v6" && U(n, "ipv4", r.message, t), r.version !== "v4" && U(n, "ipv6", r.message, t);
|
|
732
734
|
break;
|
|
733
735
|
case "base64url":
|
|
734
|
-
|
|
736
|
+
W(n, H.base64url, r.message, t);
|
|
735
737
|
break;
|
|
736
738
|
case "jwt":
|
|
737
|
-
|
|
739
|
+
W(n, H.jwt, r.message, t);
|
|
738
740
|
break;
|
|
739
741
|
case "cidr":
|
|
740
|
-
r.version !== "v6" &&
|
|
742
|
+
r.version !== "v6" && W(n, H.ipv4Cidr, r.message, t), r.version !== "v4" && W(n, H.ipv6Cidr, r.message, t);
|
|
741
743
|
break;
|
|
742
744
|
case "emoji":
|
|
743
|
-
|
|
745
|
+
W(n, H.emoji(), r.message, t);
|
|
744
746
|
break;
|
|
745
747
|
case "ulid":
|
|
746
|
-
|
|
748
|
+
W(n, H.ulid, r.message, t);
|
|
747
749
|
break;
|
|
748
750
|
case "base64":
|
|
749
751
|
switch (t.base64Strategy) {
|
|
750
752
|
case "format:binary":
|
|
751
|
-
|
|
753
|
+
U(n, "binary", r.message, t);
|
|
752
754
|
break;
|
|
753
755
|
case "contentEncoding:base64":
|
|
754
756
|
n.contentEncoding = "base64";
|
|
755
757
|
break;
|
|
756
|
-
case "pattern:zod":
|
|
758
|
+
case "pattern:zod": W(n, H.base64, r.message, t);
|
|
757
759
|
}
|
|
758
760
|
break;
|
|
759
|
-
case "nanoid":
|
|
761
|
+
case "nanoid": W(n, H.nanoid, r.message, t);
|
|
760
762
|
}
|
|
761
763
|
return n;
|
|
762
764
|
}
|
|
763
|
-
function
|
|
764
|
-
return t.patternStrategy === "escape" ?
|
|
765
|
+
function Fn(e, t) {
|
|
766
|
+
return t.patternStrategy === "escape" ? Ln(e) : e;
|
|
765
767
|
}
|
|
766
|
-
var
|
|
767
|
-
function
|
|
768
|
+
var In = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
769
|
+
function Ln(e) {
|
|
768
770
|
let t = "";
|
|
769
|
-
for (let n = 0; n < e.length; n++)
|
|
771
|
+
for (let n = 0; n < e.length; n++) In.has(e[n]) || (t += "\\"), t += e[n];
|
|
770
772
|
return t;
|
|
771
773
|
}
|
|
772
|
-
function
|
|
774
|
+
function U(e, t, n, r) {
|
|
773
775
|
e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({
|
|
774
776
|
format: t,
|
|
775
777
|
...n && r.errorMessages && { errorMessage: { format: n } }
|
|
776
778
|
})) : e.format = t;
|
|
777
779
|
}
|
|
778
|
-
function
|
|
780
|
+
function W(e, t, n, r) {
|
|
779
781
|
e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({
|
|
780
|
-
pattern:
|
|
782
|
+
pattern: G(t, r),
|
|
781
783
|
...n && r.errorMessages && { errorMessage: { pattern: n } }
|
|
782
|
-
})) : e.pattern =
|
|
784
|
+
})) : e.pattern = G(t, r);
|
|
783
785
|
}
|
|
784
|
-
function
|
|
786
|
+
function G(e, t) {
|
|
785
787
|
if (!t.applyRegexFlags || !e.flags) return e.source;
|
|
786
788
|
let n = {
|
|
787
789
|
i: e.flags.includes("i"),
|
|
@@ -820,16 +822,16 @@ function wn(e, t) {
|
|
|
820
822
|
}
|
|
821
823
|
return i;
|
|
822
824
|
}
|
|
823
|
-
function
|
|
825
|
+
function K(e, t) {
|
|
824
826
|
let n = {
|
|
825
827
|
type: "object",
|
|
826
|
-
additionalProperties:
|
|
828
|
+
additionalProperties: q(e.valueType._def, {
|
|
827
829
|
...t,
|
|
828
830
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
829
831
|
}) ?? t.allowedAdditionalProperties
|
|
830
832
|
};
|
|
831
833
|
if (e.keyType?._def.typeName === "ZodString" && e.keyType._def.checks?.length) {
|
|
832
|
-
let { type: r, ...i } =
|
|
834
|
+
let { type: r, ...i } = Pn(e.keyType._def, t);
|
|
833
835
|
return {
|
|
834
836
|
...n,
|
|
835
837
|
propertyNames: i
|
|
@@ -840,7 +842,7 @@ function Tn(e, t) {
|
|
|
840
842
|
propertyNames: { enum: e.keyType._def.values }
|
|
841
843
|
};
|
|
842
844
|
if (e.keyType?._def.typeName === "ZodBranded" && e.keyType._def.type._def.typeName === "ZodString" && e.keyType._def.type._def.checks?.length) {
|
|
843
|
-
let { type: r, ...i } =
|
|
845
|
+
let { type: r, ...i } = Cn(e.keyType._def, t);
|
|
844
846
|
return {
|
|
845
847
|
...n,
|
|
846
848
|
propertyNames: i
|
|
@@ -848,13 +850,13 @@ function Tn(e, t) {
|
|
|
848
850
|
}
|
|
849
851
|
return n;
|
|
850
852
|
}
|
|
851
|
-
function
|
|
852
|
-
return t.mapStrategy === "record" ?
|
|
853
|
+
function Rn(e, t) {
|
|
854
|
+
return t.mapStrategy === "record" ? K(e, t) : {
|
|
853
855
|
type: "array",
|
|
854
856
|
maxItems: 125,
|
|
855
857
|
items: {
|
|
856
858
|
type: "array",
|
|
857
|
-
items: [
|
|
859
|
+
items: [q(e.keyType._def, {
|
|
858
860
|
...t,
|
|
859
861
|
currentPath: [
|
|
860
862
|
...t.currentPath,
|
|
@@ -862,7 +864,7 @@ function En(e, t) {
|
|
|
862
864
|
"items",
|
|
863
865
|
"0"
|
|
864
866
|
]
|
|
865
|
-
}) || B(),
|
|
867
|
+
}) || B(), q(e.valueType._def, {
|
|
866
868
|
...t,
|
|
867
869
|
currentPath: [
|
|
868
870
|
...t.currentPath,
|
|
@@ -876,31 +878,31 @@ function En(e, t) {
|
|
|
876
878
|
}
|
|
877
879
|
};
|
|
878
880
|
}
|
|
879
|
-
function
|
|
881
|
+
function zn(e) {
|
|
880
882
|
let t = e.values, n = Object.keys(e.values).filter((e) => typeof t[t[e]] != "number").map((e) => t[e]), r = Array.from(new Set(n.map((e) => typeof e)));
|
|
881
883
|
return {
|
|
882
884
|
type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
883
885
|
enum: n
|
|
884
886
|
};
|
|
885
887
|
}
|
|
886
|
-
function
|
|
888
|
+
function Bn() {
|
|
887
889
|
return { not: B() };
|
|
888
890
|
}
|
|
889
|
-
function
|
|
891
|
+
function Vn() {
|
|
890
892
|
return { type: "null" };
|
|
891
893
|
}
|
|
892
|
-
var
|
|
894
|
+
var Hn = {
|
|
893
895
|
ZodString: "string",
|
|
894
896
|
ZodNumber: "number",
|
|
895
897
|
ZodBigInt: "integer",
|
|
896
898
|
ZodBoolean: "boolean",
|
|
897
899
|
ZodNull: "null"
|
|
898
900
|
};
|
|
899
|
-
function
|
|
901
|
+
function Un(e, t) {
|
|
900
902
|
let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
901
|
-
if (n.every((e) => e._def.typeName in
|
|
903
|
+
if (n.every((e) => e._def.typeName in Hn && (!e._def.checks || !e._def.checks.length))) {
|
|
902
904
|
let e = n.reduce((e, t) => {
|
|
903
|
-
let n =
|
|
905
|
+
let n = Hn[t._def.typeName];
|
|
904
906
|
return n && !e.includes(n) ? [...e, n] : e;
|
|
905
907
|
}, []);
|
|
906
908
|
return { type: e.length > 1 ? e : e[0] };
|
|
@@ -928,10 +930,10 @@ function jn(e, t) {
|
|
|
928
930
|
type: "string",
|
|
929
931
|
enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
|
|
930
932
|
};
|
|
931
|
-
return
|
|
933
|
+
return Wn(e, t);
|
|
932
934
|
}
|
|
933
|
-
var
|
|
934
|
-
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) =>
|
|
935
|
+
var Wn = (e, t) => {
|
|
936
|
+
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => q(e._def, {
|
|
935
937
|
...t,
|
|
936
938
|
currentPath: [
|
|
937
939
|
...t.currentPath,
|
|
@@ -941,15 +943,15 @@ var Mn = (e, t) => {
|
|
|
941
943
|
})).filter((e) => !!e && (!t.strictUnions || typeof e == "object" && Object.keys(e).length > 0));
|
|
942
944
|
return n.length ? { anyOf: n } : void 0;
|
|
943
945
|
};
|
|
944
|
-
function
|
|
946
|
+
function Gn(e, t) {
|
|
945
947
|
if ([
|
|
946
948
|
"ZodString",
|
|
947
949
|
"ZodNumber",
|
|
948
950
|
"ZodBigInt",
|
|
949
951
|
"ZodBoolean",
|
|
950
952
|
"ZodNull"
|
|
951
|
-
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [
|
|
952
|
-
let n =
|
|
953
|
+
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [Hn[e.innerType._def.typeName], "null"] };
|
|
954
|
+
let n = q(e.innerType._def, {
|
|
953
955
|
...t,
|
|
954
956
|
currentPath: [
|
|
955
957
|
...t.currentPath,
|
|
@@ -959,7 +961,7 @@ function Nn(e, t) {
|
|
|
959
961
|
});
|
|
960
962
|
return n && { anyOf: [n, { type: "null" }] };
|
|
961
963
|
}
|
|
962
|
-
function
|
|
964
|
+
function Kn(e) {
|
|
963
965
|
let t = { type: "number" };
|
|
964
966
|
if (!e.checks) return t;
|
|
965
967
|
for (let n of e.checks) switch (n.kind) {
|
|
@@ -976,7 +978,7 @@ function q(e) {
|
|
|
976
978
|
}
|
|
977
979
|
return t;
|
|
978
980
|
}
|
|
979
|
-
function
|
|
981
|
+
function qn(e, t) {
|
|
980
982
|
let n = {
|
|
981
983
|
type: "object",
|
|
982
984
|
properties: {}
|
|
@@ -984,7 +986,7 @@ function Pn(e, t) {
|
|
|
984
986
|
for (let e in i) {
|
|
985
987
|
let a = i[e];
|
|
986
988
|
if (a === void 0 || a._def === void 0) continue;
|
|
987
|
-
let o =
|
|
989
|
+
let o = Yn(a), s = q(a._def, {
|
|
988
990
|
...t,
|
|
989
991
|
currentPath: [
|
|
990
992
|
...t.currentPath,
|
|
@@ -1000,11 +1002,11 @@ function Pn(e, t) {
|
|
|
1000
1002
|
s !== void 0 && (n.properties[e] = s, o || r.push(e));
|
|
1001
1003
|
}
|
|
1002
1004
|
r.length && (n.required = r);
|
|
1003
|
-
let a =
|
|
1005
|
+
let a = Jn(e, t);
|
|
1004
1006
|
return a !== void 0 && (n.additionalProperties = a), n;
|
|
1005
1007
|
}
|
|
1006
|
-
function
|
|
1007
|
-
if (e.catchall._def.typeName !== "ZodNever") return
|
|
1008
|
+
function Jn(e, t) {
|
|
1009
|
+
if (e.catchall._def.typeName !== "ZodNever") return q(e.catchall._def, {
|
|
1008
1010
|
...t,
|
|
1009
1011
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
1010
1012
|
});
|
|
@@ -1014,16 +1016,16 @@ function Fn(e, t) {
|
|
|
1014
1016
|
case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
|
|
1015
1017
|
}
|
|
1016
1018
|
}
|
|
1017
|
-
function
|
|
1019
|
+
function Yn(e) {
|
|
1018
1020
|
try {
|
|
1019
1021
|
return e.isOptional();
|
|
1020
1022
|
} catch {
|
|
1021
1023
|
return !0;
|
|
1022
1024
|
}
|
|
1023
1025
|
}
|
|
1024
|
-
var
|
|
1025
|
-
if (t.currentPath.toString() === t.propertyPath?.toString()) return
|
|
1026
|
-
let n =
|
|
1026
|
+
var Xn = (e, t) => {
|
|
1027
|
+
if (t.currentPath.toString() === t.propertyPath?.toString()) return q(e.innerType._def, t);
|
|
1028
|
+
let n = q(e.innerType._def, {
|
|
1027
1029
|
...t,
|
|
1028
1030
|
currentPath: [
|
|
1029
1031
|
...t.currentPath,
|
|
@@ -1032,10 +1034,10 @@ var Ln = (e, t) => {
|
|
|
1032
1034
|
]
|
|
1033
1035
|
});
|
|
1034
1036
|
return n ? { anyOf: [{ not: B() }, n] } : B();
|
|
1035
|
-
},
|
|
1036
|
-
if (t.pipeStrategy === "input") return
|
|
1037
|
-
if (t.pipeStrategy === "output") return
|
|
1038
|
-
let n =
|
|
1037
|
+
}, Zn = (e, t) => {
|
|
1038
|
+
if (t.pipeStrategy === "input") return q(e.in._def, t);
|
|
1039
|
+
if (t.pipeStrategy === "output") return q(e.out._def, t);
|
|
1040
|
+
let n = q(e.in._def, {
|
|
1039
1041
|
...t,
|
|
1040
1042
|
currentPath: [
|
|
1041
1043
|
...t.currentPath,
|
|
@@ -1043,7 +1045,7 @@ var Ln = (e, t) => {
|
|
|
1043
1045
|
"0"
|
|
1044
1046
|
]
|
|
1045
1047
|
});
|
|
1046
|
-
return { allOf: [n,
|
|
1048
|
+
return { allOf: [n, q(e.out._def, {
|
|
1047
1049
|
...t,
|
|
1048
1050
|
currentPath: [
|
|
1049
1051
|
...t.currentPath,
|
|
@@ -1052,25 +1054,25 @@ var Ln = (e, t) => {
|
|
|
1052
1054
|
]
|
|
1053
1055
|
})].filter((e) => e !== void 0) };
|
|
1054
1056
|
};
|
|
1055
|
-
function
|
|
1056
|
-
return
|
|
1057
|
+
function Qn(e, t) {
|
|
1058
|
+
return q(e.type._def, t);
|
|
1057
1059
|
}
|
|
1058
|
-
function
|
|
1060
|
+
function $n(e, t) {
|
|
1059
1061
|
let n = {
|
|
1060
1062
|
type: "array",
|
|
1061
1063
|
uniqueItems: !0,
|
|
1062
|
-
items:
|
|
1064
|
+
items: q(e.valueType._def, {
|
|
1063
1065
|
...t,
|
|
1064
1066
|
currentPath: [...t.currentPath, "items"]
|
|
1065
1067
|
})
|
|
1066
1068
|
};
|
|
1067
1069
|
return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
|
|
1068
1070
|
}
|
|
1069
|
-
function
|
|
1071
|
+
function er(e, t) {
|
|
1070
1072
|
return e.rest ? {
|
|
1071
1073
|
type: "array",
|
|
1072
1074
|
minItems: e.items.length,
|
|
1073
|
-
items: e.items.map((e, n) =>
|
|
1075
|
+
items: e.items.map((e, n) => q(e._def, {
|
|
1074
1076
|
...t,
|
|
1075
1077
|
currentPath: [
|
|
1076
1078
|
...t.currentPath,
|
|
@@ -1078,7 +1080,7 @@ function Vn(e, t) {
|
|
|
1078
1080
|
`${n}`
|
|
1079
1081
|
]
|
|
1080
1082
|
})).reduce((e, t) => t === void 0 ? e : [...e, t], []),
|
|
1081
|
-
additionalItems:
|
|
1083
|
+
additionalItems: q(e.rest._def, {
|
|
1082
1084
|
...t,
|
|
1083
1085
|
currentPath: [...t.currentPath, "additionalItems"]
|
|
1084
1086
|
})
|
|
@@ -1086,7 +1088,7 @@ function Vn(e, t) {
|
|
|
1086
1088
|
type: "array",
|
|
1087
1089
|
minItems: e.items.length,
|
|
1088
1090
|
maxItems: e.items.length,
|
|
1089
|
-
items: e.items.map((e, n) =>
|
|
1091
|
+
items: e.items.map((e, n) => q(e._def, {
|
|
1090
1092
|
...t,
|
|
1091
1093
|
currentPath: [
|
|
1092
1094
|
...t.currentPath,
|
|
@@ -1096,47 +1098,47 @@ function Vn(e, t) {
|
|
|
1096
1098
|
})).reduce((e, t) => t === void 0 ? e : [...e, t], [])
|
|
1097
1099
|
};
|
|
1098
1100
|
}
|
|
1099
|
-
function
|
|
1101
|
+
function tr() {
|
|
1100
1102
|
return { not: B() };
|
|
1101
1103
|
}
|
|
1102
|
-
function
|
|
1104
|
+
function nr() {
|
|
1103
1105
|
return B();
|
|
1104
1106
|
}
|
|
1105
|
-
var
|
|
1107
|
+
var rr = (e, t) => q(e.innerType._def, t), ir = (e, t, n) => {
|
|
1106
1108
|
switch (t) {
|
|
1107
|
-
case "ZodString": return
|
|
1108
|
-
case "ZodNumber": return
|
|
1109
|
-
case "ZodObject": return
|
|
1110
|
-
case "ZodBigInt": return
|
|
1111
|
-
case "ZodBoolean": return
|
|
1112
|
-
case "ZodDate": return
|
|
1113
|
-
case "ZodUndefined": return
|
|
1114
|
-
case "ZodNull": return
|
|
1115
|
-
case "ZodArray": return
|
|
1109
|
+
case "ZodString": return Pn(e, n);
|
|
1110
|
+
case "ZodNumber": return Kn(e);
|
|
1111
|
+
case "ZodObject": return qn(e, n);
|
|
1112
|
+
case "ZodBigInt": return Sn(e);
|
|
1113
|
+
case "ZodBoolean": return V();
|
|
1114
|
+
case "ZodDate": return Tn(e, n);
|
|
1115
|
+
case "ZodUndefined": return tr();
|
|
1116
|
+
case "ZodNull": return Vn();
|
|
1117
|
+
case "ZodArray": return xn(e, n);
|
|
1116
1118
|
case "ZodUnion":
|
|
1117
|
-
case "ZodDiscriminatedUnion": return
|
|
1118
|
-
case "ZodIntersection": return
|
|
1119
|
-
case "ZodTuple": return
|
|
1120
|
-
case "ZodRecord": return
|
|
1121
|
-
case "ZodLiteral": return
|
|
1122
|
-
case "ZodEnum": return
|
|
1123
|
-
case "ZodNativeEnum": return
|
|
1124
|
-
case "ZodNullable": return
|
|
1125
|
-
case "ZodOptional": return
|
|
1126
|
-
case "ZodMap": return
|
|
1127
|
-
case "ZodSet": return
|
|
1119
|
+
case "ZodDiscriminatedUnion": return Un(e, n);
|
|
1120
|
+
case "ZodIntersection": return jn(e, n);
|
|
1121
|
+
case "ZodTuple": return er(e, n);
|
|
1122
|
+
case "ZodRecord": return K(e, n);
|
|
1123
|
+
case "ZodLiteral": return Mn(e);
|
|
1124
|
+
case "ZodEnum": return kn(e);
|
|
1125
|
+
case "ZodNativeEnum": return zn(e);
|
|
1126
|
+
case "ZodNullable": return Gn(e, n);
|
|
1127
|
+
case "ZodOptional": return Xn(e, n);
|
|
1128
|
+
case "ZodMap": return Rn(e, n);
|
|
1129
|
+
case "ZodSet": return $n(e, n);
|
|
1128
1130
|
case "ZodLazy": return () => e.getter()._def;
|
|
1129
|
-
case "ZodPromise": return
|
|
1131
|
+
case "ZodPromise": return Qn(e, n);
|
|
1130
1132
|
case "ZodNaN":
|
|
1131
|
-
case "ZodNever": return
|
|
1132
|
-
case "ZodEffects": return
|
|
1133
|
+
case "ZodNever": return Bn();
|
|
1134
|
+
case "ZodEffects": return On(e, n);
|
|
1133
1135
|
case "ZodAny": return B();
|
|
1134
|
-
case "ZodUnknown": return
|
|
1135
|
-
case "ZodDefault": return
|
|
1136
|
-
case "ZodBranded": return
|
|
1137
|
-
case "ZodReadonly": return
|
|
1138
|
-
case "ZodCatch": return
|
|
1139
|
-
case "ZodPipeline": return
|
|
1136
|
+
case "ZodUnknown": return nr();
|
|
1137
|
+
case "ZodDefault": return Dn(e, n);
|
|
1138
|
+
case "ZodBranded": return Cn(e, n);
|
|
1139
|
+
case "ZodReadonly": return rr(e, n);
|
|
1140
|
+
case "ZodCatch": return wn(e, n);
|
|
1141
|
+
case "ZodPipeline": return Zn(e, n);
|
|
1140
1142
|
case "ZodFunction":
|
|
1141
1143
|
case "ZodVoid":
|
|
1142
1144
|
case "ZodSymbol": return;
|
|
@@ -1144,19 +1146,19 @@ var Wn = (e, t) => J(e.innerType._def, t), Gn = (e, t, n) => {
|
|
|
1144
1146
|
/* c8 ignore next */
|
|
1145
1147
|
return ((e) => void 0)(t);
|
|
1146
1148
|
}
|
|
1147
|
-
},
|
|
1149
|
+
}, ar = (e, t) => {
|
|
1148
1150
|
let n = 0;
|
|
1149
1151
|
for (; n < e.length && n < t.length && e[n] === t[n]; n++);
|
|
1150
1152
|
return [(e.length - n).toString(), ...t.slice(n)].join("/");
|
|
1151
1153
|
};
|
|
1152
|
-
function
|
|
1154
|
+
function q(e, t, n = !1) {
|
|
1153
1155
|
let r = t.seen.get(e);
|
|
1154
1156
|
if (t.override) {
|
|
1155
1157
|
let i = t.override?.(e, t, r, n);
|
|
1156
|
-
if (i !==
|
|
1158
|
+
if (i !== vn) return i;
|
|
1157
1159
|
}
|
|
1158
1160
|
if (r && !n) {
|
|
1159
|
-
let e =
|
|
1161
|
+
let e = or(r, t);
|
|
1160
1162
|
if (e !== void 0) return e;
|
|
1161
1163
|
}
|
|
1162
1164
|
let i = {
|
|
@@ -1165,22 +1167,22 @@ function J(e, t, n = !1) {
|
|
|
1165
1167
|
jsonSchema: void 0
|
|
1166
1168
|
};
|
|
1167
1169
|
t.seen.set(e, i);
|
|
1168
|
-
let a =
|
|
1169
|
-
if (o &&
|
|
1170
|
+
let a = ir(e, e.typeName, t), o = typeof a == "function" ? q(a(), t) : a;
|
|
1171
|
+
if (o && sr(e, t, o), t.postProcess) {
|
|
1170
1172
|
let n = t.postProcess(o, e, t);
|
|
1171
1173
|
return i.jsonSchema = o, n;
|
|
1172
1174
|
}
|
|
1173
1175
|
return i.jsonSchema = o, o;
|
|
1174
1176
|
}
|
|
1175
|
-
var
|
|
1177
|
+
var or = (e, t) => {
|
|
1176
1178
|
switch (t.$refStrategy) {
|
|
1177
1179
|
case "root": return { $ref: e.path.join("/") };
|
|
1178
|
-
case "relative": return { $ref:
|
|
1180
|
+
case "relative": return { $ref: ar(t.currentPath, e.path) };
|
|
1179
1181
|
case "none":
|
|
1180
1182
|
case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), B()) : t.$refStrategy === "seen" ? B() : void 0;
|
|
1181
1183
|
}
|
|
1182
|
-
},
|
|
1183
|
-
let t =
|
|
1184
|
+
}, sr = (e, t, n) => (e.description && (n.description = e.description), n), cr = (e) => {
|
|
1185
|
+
let t = bn(e), n = t.name === void 0 ? t.basePath : [
|
|
1184
1186
|
...t.basePath,
|
|
1185
1187
|
t.definitionPath,
|
|
1186
1188
|
t.name
|
|
@@ -1199,10 +1201,10 @@ var qn = (e, t) => {
|
|
|
1199
1201
|
jsonSchema: void 0
|
|
1200
1202
|
}]))
|
|
1201
1203
|
};
|
|
1202
|
-
},
|
|
1203
|
-
let n =
|
|
1204
|
+
}, lr = (e, t) => {
|
|
1205
|
+
let n = cr(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
|
|
1204
1206
|
...e,
|
|
1205
|
-
[t]:
|
|
1207
|
+
[t]: q(r._def, {
|
|
1206
1208
|
...n,
|
|
1207
1209
|
currentPath: [
|
|
1208
1210
|
...n.basePath,
|
|
@@ -1210,7 +1212,7 @@ var qn = (e, t) => {
|
|
|
1210
1212
|
t
|
|
1211
1213
|
]
|
|
1212
1214
|
}, !0) ?? B()
|
|
1213
|
-
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a =
|
|
1215
|
+
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = q(e._def, i === void 0 ? n : {
|
|
1214
1216
|
...n,
|
|
1215
1217
|
currentPath: [
|
|
1216
1218
|
...n.basePath,
|
|
@@ -1234,14 +1236,14 @@ var qn = (e, t) => {
|
|
|
1234
1236
|
}
|
|
1235
1237
|
};
|
|
1236
1238
|
return s.$schema = "http://json-schema.org/draft-07/schema#", s;
|
|
1237
|
-
},
|
|
1238
|
-
function
|
|
1239
|
+
}, ur = Symbol.for("vercel.ai.schema");
|
|
1240
|
+
function dr(e) {
|
|
1239
1241
|
let t;
|
|
1240
1242
|
return () => (t ??= e(), t);
|
|
1241
1243
|
}
|
|
1242
|
-
function
|
|
1244
|
+
function fr(e, { validate: t } = {}) {
|
|
1243
1245
|
return {
|
|
1244
|
-
[
|
|
1246
|
+
[ur]: !0,
|
|
1245
1247
|
_type: void 0,
|
|
1246
1248
|
get jsonSchema() {
|
|
1247
1249
|
return typeof e == "function" && (e = e()), e;
|
|
@@ -1249,20 +1251,20 @@ function $n(e, { validate: t } = {}) {
|
|
|
1249
1251
|
validate: t
|
|
1250
1252
|
};
|
|
1251
1253
|
}
|
|
1252
|
-
function
|
|
1253
|
-
return typeof e == "object" && !!e &&
|
|
1254
|
+
function pr(e) {
|
|
1255
|
+
return typeof e == "object" && !!e && ur in e && e[ur] === !0 && "jsonSchema" in e && "validate" in e;
|
|
1254
1256
|
}
|
|
1255
|
-
function
|
|
1256
|
-
return e == null ?
|
|
1257
|
+
function mr(e) {
|
|
1258
|
+
return e == null ? fr({
|
|
1257
1259
|
type: "object",
|
|
1258
1260
|
properties: {},
|
|
1259
1261
|
additionalProperties: !1
|
|
1260
|
-
}) :
|
|
1262
|
+
}) : pr(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? br(e) : hr(e) : e();
|
|
1261
1263
|
}
|
|
1262
|
-
function
|
|
1263
|
-
return
|
|
1264
|
-
if (!
|
|
1265
|
-
return
|
|
1264
|
+
function hr(e) {
|
|
1265
|
+
return fr(() => {
|
|
1266
|
+
if (!gr(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
|
|
1267
|
+
return _n(e["~standard"].jsonSchema.input({ target: "draft-07" }));
|
|
1266
1268
|
}, { validate: async (t) => {
|
|
1267
1269
|
let n = await e["~standard"].validate(t);
|
|
1268
1270
|
return n.issues === void 0 && "value" in n ? {
|
|
@@ -1270,19 +1272,19 @@ function nr(e) {
|
|
|
1270
1272
|
value: n.value
|
|
1271
1273
|
} : {
|
|
1272
1274
|
success: !1,
|
|
1273
|
-
error: new
|
|
1275
|
+
error: new qt({
|
|
1274
1276
|
value: t,
|
|
1275
1277
|
cause: n.issues
|
|
1276
1278
|
})
|
|
1277
1279
|
};
|
|
1278
1280
|
} });
|
|
1279
1281
|
}
|
|
1280
|
-
function
|
|
1282
|
+
function gr(e) {
|
|
1281
1283
|
return e["~standard"].jsonSchema != null;
|
|
1282
1284
|
}
|
|
1283
|
-
function
|
|
1285
|
+
function _r(e, t) {
|
|
1284
1286
|
let n = t?.useReferences ?? !1;
|
|
1285
|
-
return
|
|
1287
|
+
return fr(() => lr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
|
|
1286
1288
|
let n = await e.safeParseAsync(t);
|
|
1287
1289
|
return n.success ? {
|
|
1288
1290
|
success: !0,
|
|
@@ -1293,10 +1295,10 @@ function ir(e, t) {
|
|
|
1293
1295
|
};
|
|
1294
1296
|
} });
|
|
1295
1297
|
}
|
|
1296
|
-
function
|
|
1297
|
-
|
|
1298
|
+
function vr(e, t) {
|
|
1299
|
+
Ae().localeError || Ae(c());
|
|
1298
1300
|
let n = t?.useReferences ?? !1;
|
|
1299
|
-
return
|
|
1301
|
+
return fr(() => _n(a(e, {
|
|
1300
1302
|
target: "draft-7",
|
|
1301
1303
|
io: "input",
|
|
1302
1304
|
reused: n ? "ref" : "inline"
|
|
@@ -1311,27 +1313,27 @@ function ar(e, t) {
|
|
|
1311
1313
|
};
|
|
1312
1314
|
} });
|
|
1313
1315
|
}
|
|
1314
|
-
function
|
|
1316
|
+
function yr(e) {
|
|
1315
1317
|
return "_zod" in e;
|
|
1316
1318
|
}
|
|
1317
|
-
function
|
|
1318
|
-
return
|
|
1319
|
+
function br(e, t) {
|
|
1320
|
+
return yr(e) ? vr(e, t) : _r(e, t);
|
|
1319
1321
|
}
|
|
1320
|
-
async function
|
|
1321
|
-
let r = await
|
|
1322
|
+
async function xr({ value: e, schema: t, context: n }) {
|
|
1323
|
+
let r = await Sr({
|
|
1322
1324
|
value: e,
|
|
1323
1325
|
schema: t,
|
|
1324
1326
|
context: n
|
|
1325
1327
|
});
|
|
1326
|
-
if (!r.success) throw
|
|
1328
|
+
if (!r.success) throw qt.wrap({
|
|
1327
1329
|
value: e,
|
|
1328
1330
|
cause: r.error,
|
|
1329
1331
|
context: n
|
|
1330
1332
|
});
|
|
1331
1333
|
return r.value;
|
|
1332
1334
|
}
|
|
1333
|
-
async function
|
|
1334
|
-
let r =
|
|
1335
|
+
async function Sr({ value: e, schema: t, context: n }) {
|
|
1336
|
+
let r = mr(t);
|
|
1335
1337
|
try {
|
|
1336
1338
|
if (r.validate == null) return {
|
|
1337
1339
|
success: !0,
|
|
@@ -1345,7 +1347,7 @@ async function lr({ value: e, schema: t, context: n }) {
|
|
|
1345
1347
|
rawValue: e
|
|
1346
1348
|
} : {
|
|
1347
1349
|
success: !1,
|
|
1348
|
-
error:
|
|
1350
|
+
error: qt.wrap({
|
|
1349
1351
|
value: e,
|
|
1350
1352
|
cause: t.error,
|
|
1351
1353
|
context: n
|
|
@@ -1355,7 +1357,7 @@ async function lr({ value: e, schema: t, context: n }) {
|
|
|
1355
1357
|
} catch (t) {
|
|
1356
1358
|
return {
|
|
1357
1359
|
success: !1,
|
|
1358
|
-
error:
|
|
1360
|
+
error: qt.wrap({
|
|
1359
1361
|
value: e,
|
|
1360
1362
|
cause: t,
|
|
1361
1363
|
context: n
|
|
@@ -1364,21 +1366,21 @@ async function lr({ value: e, schema: t, context: n }) {
|
|
|
1364
1366
|
};
|
|
1365
1367
|
}
|
|
1366
1368
|
}
|
|
1367
|
-
async function
|
|
1369
|
+
async function Cr({ text: e, schema: t }) {
|
|
1368
1370
|
try {
|
|
1369
|
-
let n =
|
|
1371
|
+
let n = gn(e);
|
|
1370
1372
|
return t == null ? {
|
|
1371
1373
|
success: !0,
|
|
1372
1374
|
value: n,
|
|
1373
1375
|
rawValue: n
|
|
1374
|
-
} : await
|
|
1376
|
+
} : await Sr({
|
|
1375
1377
|
value: n,
|
|
1376
1378
|
schema: t
|
|
1377
1379
|
});
|
|
1378
1380
|
} catch (t) {
|
|
1379
1381
|
return {
|
|
1380
1382
|
success: !1,
|
|
1381
|
-
error:
|
|
1383
|
+
error: M.isInstance(t) ? t : new M({
|
|
1382
1384
|
text: e,
|
|
1383
1385
|
cause: t
|
|
1384
1386
|
}),
|
|
@@ -1386,20 +1388,20 @@ async function ur({ text: e, schema: t }) {
|
|
|
1386
1388
|
};
|
|
1387
1389
|
}
|
|
1388
1390
|
}
|
|
1389
|
-
function
|
|
1390
|
-
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new
|
|
1391
|
-
e !== "[DONE]" && n.enqueue(await
|
|
1391
|
+
function wr({ stream: e, schema: t }) {
|
|
1392
|
+
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new nn()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
|
|
1393
|
+
e !== "[DONE]" && n.enqueue(await Cr({
|
|
1392
1394
|
text: e,
|
|
1393
1395
|
schema: t
|
|
1394
1396
|
}));
|
|
1395
1397
|
} }));
|
|
1396
1398
|
}
|
|
1397
|
-
async function
|
|
1399
|
+
async function Tr(e) {
|
|
1398
1400
|
return typeof e == "function" && (e = e()), e;
|
|
1399
1401
|
}
|
|
1400
1402
|
new TextDecoder();
|
|
1401
1403
|
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/mini/schemas.js
|
|
1402
|
-
var
|
|
1404
|
+
var J = /*@__PURE__*/ x("ZodMiniType", (e, t) => {
|
|
1403
1405
|
if (!e._zod) throw Error("Uninitialized schema in ZodMiniType.");
|
|
1404
1406
|
De.init(e, t), e.def = t, e.type = t.type;
|
|
1405
1407
|
}, {
|
|
@@ -1410,7 +1412,7 @@ var Y = /*@__PURE__*/ x("ZodMiniType", (e, t) => {
|
|
|
1410
1412
|
i(this, "with", e);
|
|
1411
1413
|
},
|
|
1412
1414
|
parse(e, t) {
|
|
1413
|
-
return
|
|
1415
|
+
return ke(this, e, t, { callee: this.parse });
|
|
1414
1416
|
},
|
|
1415
1417
|
parseAsync(e, t) {
|
|
1416
1418
|
return pe(this, e, t, { callee: this.parseAsync });
|
|
@@ -1433,7 +1435,7 @@ var Y = /*@__PURE__*/ x("ZodMiniType", (e, t) => {
|
|
|
1433
1435
|
}, { parent: !0 });
|
|
1434
1436
|
},
|
|
1435
1437
|
clone(e, t) {
|
|
1436
|
-
return
|
|
1438
|
+
return Ne(this, e, t);
|
|
1437
1439
|
},
|
|
1438
1440
|
brand() {
|
|
1439
1441
|
return this;
|
|
@@ -1444,209 +1446,209 @@ var Y = /*@__PURE__*/ x("ZodMiniType", (e, t) => {
|
|
|
1444
1446
|
apply(e, ...t) {
|
|
1445
1447
|
return t.length === 0 ? e(this) : e(this, ...t);
|
|
1446
1448
|
}
|
|
1447
|
-
}),
|
|
1448
|
-
se.init(e, t),
|
|
1449
|
+
}), Er = /*@__PURE__*/ x("ZodMiniString", (e, t) => {
|
|
1450
|
+
se.init(e, t), J.init(e, t);
|
|
1449
1451
|
});
|
|
1450
1452
|
// @__NO_SIDE_EFFECTS__
|
|
1451
|
-
function
|
|
1452
|
-
return l(
|
|
1453
|
+
function Dr(e) {
|
|
1454
|
+
return l(Er, e);
|
|
1453
1455
|
}
|
|
1454
|
-
var
|
|
1455
|
-
e.init(t, n),
|
|
1456
|
+
var Y = /*@__PURE__*/ x("ZodMiniNumber", (t, n) => {
|
|
1457
|
+
e.init(t, n), J.init(t, n);
|
|
1456
1458
|
});
|
|
1457
1459
|
// @__NO_SIDE_EFFECTS__
|
|
1458
|
-
function
|
|
1459
|
-
return _(
|
|
1460
|
+
function Or(e) {
|
|
1461
|
+
return _(Y, e);
|
|
1460
1462
|
}
|
|
1461
|
-
var
|
|
1462
|
-
me.init(e, t),
|
|
1463
|
+
var kr = /*@__PURE__*/ x("ZodMiniNumberFormat", (e, t) => {
|
|
1464
|
+
me.init(e, t), Y.init(e, t);
|
|
1463
1465
|
});
|
|
1464
|
-
function
|
|
1465
|
-
return ye(
|
|
1466
|
+
function Ar(e) {
|
|
1467
|
+
return ye(kr, e);
|
|
1466
1468
|
}
|
|
1467
|
-
var
|
|
1468
|
-
we.init(e, t),
|
|
1469
|
+
var jr = /*@__PURE__*/ x("ZodMiniBoolean", (e, t) => {
|
|
1470
|
+
we.init(e, t), J.init(e, t);
|
|
1469
1471
|
});
|
|
1470
1472
|
// @__NO_SIDE_EFFECTS__
|
|
1471
|
-
function
|
|
1472
|
-
return m(
|
|
1473
|
+
function Mr(e) {
|
|
1474
|
+
return m(jr, e);
|
|
1473
1475
|
}
|
|
1474
|
-
var
|
|
1475
|
-
be.init(e, t),
|
|
1476
|
+
var Nr = /*@__PURE__*/ x("ZodMiniUnknown", (e, t) => {
|
|
1477
|
+
be.init(e, t), J.init(e, t);
|
|
1476
1478
|
});
|
|
1477
1479
|
// @__NO_SIDE_EFFECTS__
|
|
1478
|
-
function
|
|
1479
|
-
return ee(
|
|
1480
|
+
function Pr() {
|
|
1481
|
+
return ee(Nr);
|
|
1480
1482
|
}
|
|
1481
|
-
var
|
|
1482
|
-
g.init(e, t),
|
|
1483
|
+
var Fr = /*@__PURE__*/ x("ZodMiniNever", (e, t) => {
|
|
1484
|
+
g.init(e, t), J.init(e, t);
|
|
1483
1485
|
});
|
|
1484
1486
|
// @__NO_SIDE_EFFECTS__
|
|
1485
|
-
function
|
|
1486
|
-
return u(
|
|
1487
|
+
function Ir(e) {
|
|
1488
|
+
return u(Fr, e);
|
|
1487
1489
|
}
|
|
1488
|
-
var
|
|
1489
|
-
f.init(e, t),
|
|
1490
|
+
var Lr = /*@__PURE__*/ x("ZodMiniArray", (e, t) => {
|
|
1491
|
+
f.init(e, t), J.init(e, t);
|
|
1490
1492
|
});
|
|
1491
1493
|
// @__NO_SIDE_EFFECTS__
|
|
1492
|
-
function
|
|
1493
|
-
return new
|
|
1494
|
+
function Rr(e, t) {
|
|
1495
|
+
return new Lr({
|
|
1494
1496
|
type: "array",
|
|
1495
1497
|
element: e,
|
|
1496
1498
|
...y(t)
|
|
1497
1499
|
});
|
|
1498
1500
|
}
|
|
1499
|
-
var
|
|
1500
|
-
|
|
1501
|
+
var zr = /*@__PURE__*/ x("ZodMiniObject", (e, t) => {
|
|
1502
|
+
w.init(e, t), J.init(e, t), Me(e, "shape", (e) => e._zod.def.shape, !1);
|
|
1501
1503
|
});
|
|
1502
1504
|
// @__NO_SIDE_EFFECTS__
|
|
1503
|
-
function
|
|
1504
|
-
return new
|
|
1505
|
+
function Br(e, t) {
|
|
1506
|
+
return new zr({
|
|
1505
1507
|
type: "object",
|
|
1506
1508
|
shape: e ?? {},
|
|
1507
1509
|
...y(t)
|
|
1508
1510
|
});
|
|
1509
1511
|
}
|
|
1510
1512
|
// @__NO_SIDE_EFFECTS__
|
|
1511
|
-
function
|
|
1512
|
-
return new
|
|
1513
|
+
function Vr(e, t) {
|
|
1514
|
+
return new zr({
|
|
1513
1515
|
type: "object",
|
|
1514
1516
|
shape: e,
|
|
1515
|
-
catchall: /* @__PURE__ */
|
|
1517
|
+
catchall: /* @__PURE__ */ Pr(),
|
|
1516
1518
|
...y(t)
|
|
1517
1519
|
});
|
|
1518
1520
|
}
|
|
1519
1521
|
// @__NO_SIDE_EFFECTS__
|
|
1520
|
-
function
|
|
1522
|
+
function Hr(e, t) {
|
|
1521
1523
|
return le(e, t);
|
|
1522
1524
|
}
|
|
1523
|
-
var
|
|
1524
|
-
de.init(e, t),
|
|
1525
|
+
var Ur = /*@__PURE__*/ x("ZodMiniUnion", (e, t) => {
|
|
1526
|
+
de.init(e, t), J.init(e, t);
|
|
1525
1527
|
});
|
|
1526
1528
|
// @__NO_SIDE_EFFECTS__
|
|
1527
|
-
function
|
|
1528
|
-
return new
|
|
1529
|
+
function Wr(e, t) {
|
|
1530
|
+
return new Ur({
|
|
1529
1531
|
type: "union",
|
|
1530
1532
|
options: e,
|
|
1531
1533
|
...y(t)
|
|
1532
1534
|
});
|
|
1533
1535
|
}
|
|
1534
|
-
var
|
|
1535
|
-
ne.init(e, t),
|
|
1536
|
+
var Gr = /*@__PURE__*/ x("ZodMiniDiscriminatedUnion", (e, t) => {
|
|
1537
|
+
ne.init(e, t), J.init(e, t);
|
|
1536
1538
|
});
|
|
1537
1539
|
// @__NO_SIDE_EFFECTS__
|
|
1538
|
-
function
|
|
1539
|
-
return new
|
|
1540
|
+
function Kr(e, t, n) {
|
|
1541
|
+
return new Gr({
|
|
1540
1542
|
type: "union",
|
|
1541
1543
|
options: t,
|
|
1542
1544
|
discriminator: e,
|
|
1543
1545
|
...y(n)
|
|
1544
1546
|
});
|
|
1545
1547
|
}
|
|
1546
|
-
var
|
|
1547
|
-
ve.init(e, t),
|
|
1548
|
+
var qr = /*@__PURE__*/ x("ZodMiniRecord", (e, t) => {
|
|
1549
|
+
ve.init(e, t), J.init(e, t);
|
|
1548
1550
|
});
|
|
1549
1551
|
// @__NO_SIDE_EFFECTS__
|
|
1550
|
-
function
|
|
1551
|
-
return !t || !t._zod ? new
|
|
1552
|
+
function Jr(e, t, n) {
|
|
1553
|
+
return !t || !t._zod ? new qr({
|
|
1552
1554
|
type: "record",
|
|
1553
|
-
keyType: /* @__PURE__ */
|
|
1555
|
+
keyType: /* @__PURE__ */ Dr(),
|
|
1554
1556
|
valueType: e,
|
|
1555
1557
|
...y(t)
|
|
1556
|
-
}) : new
|
|
1558
|
+
}) : new qr({
|
|
1557
1559
|
type: "record",
|
|
1558
1560
|
keyType: e,
|
|
1559
1561
|
valueType: t,
|
|
1560
1562
|
...y(n)
|
|
1561
1563
|
});
|
|
1562
1564
|
}
|
|
1563
|
-
var
|
|
1564
|
-
te.init(e, t),
|
|
1565
|
+
var Yr = /*@__PURE__*/ x("ZodMiniEnum", (e, t) => {
|
|
1566
|
+
te.init(e, t), J.init(e, t), e.options = [...e._zod.values];
|
|
1565
1567
|
});
|
|
1566
1568
|
// @__NO_SIDE_EFFECTS__
|
|
1567
|
-
function
|
|
1568
|
-
return new
|
|
1569
|
+
function Xr(e, t) {
|
|
1570
|
+
return new Yr({
|
|
1569
1571
|
type: "enum",
|
|
1570
1572
|
entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
|
|
1571
1573
|
...y(t)
|
|
1572
1574
|
});
|
|
1573
1575
|
}
|
|
1574
|
-
var
|
|
1575
|
-
re.init(e, t),
|
|
1576
|
+
var Zr = /*@__PURE__*/ x("ZodMiniLiteral", (e, t) => {
|
|
1577
|
+
re.init(e, t), J.init(e, t);
|
|
1576
1578
|
});
|
|
1577
1579
|
// @__NO_SIDE_EFFECTS__
|
|
1578
|
-
function
|
|
1579
|
-
return new
|
|
1580
|
+
function Qr(e, t) {
|
|
1581
|
+
return new Zr({
|
|
1580
1582
|
type: "literal",
|
|
1581
1583
|
values: Array.isArray(e) ? e : [e],
|
|
1582
1584
|
...y(t)
|
|
1583
1585
|
});
|
|
1584
1586
|
}
|
|
1585
|
-
var
|
|
1586
|
-
C.init(e, t),
|
|
1587
|
+
var $r = /*@__PURE__*/ x("ZodMiniTransform", (e, t) => {
|
|
1588
|
+
C.init(e, t), J.init(e, t);
|
|
1587
1589
|
});
|
|
1588
1590
|
// @__NO_SIDE_EFFECTS__
|
|
1589
|
-
function
|
|
1590
|
-
return new
|
|
1591
|
+
function ei(e) {
|
|
1592
|
+
return new $r({
|
|
1591
1593
|
type: "transform",
|
|
1592
1594
|
transform: e
|
|
1593
1595
|
});
|
|
1594
1596
|
}
|
|
1595
|
-
var
|
|
1596
|
-
xe.init(e, t),
|
|
1597
|
+
var ti = /*@__PURE__*/ x("ZodMiniOptional", (e, t) => {
|
|
1598
|
+
xe.init(e, t), J.init(e, t);
|
|
1597
1599
|
});
|
|
1598
1600
|
// @__NO_SIDE_EFFECTS__
|
|
1599
|
-
function
|
|
1600
|
-
return new
|
|
1601
|
+
function ni(e) {
|
|
1602
|
+
return new ti({
|
|
1601
1603
|
type: "optional",
|
|
1602
1604
|
innerType: e
|
|
1603
1605
|
});
|
|
1604
1606
|
}
|
|
1605
|
-
var
|
|
1606
|
-
Te.init(e, t),
|
|
1607
|
+
var ri = /*@__PURE__*/ x("ZodMiniPipe", (e, t) => {
|
|
1608
|
+
Te.init(e, t), J.init(e, t);
|
|
1607
1609
|
});
|
|
1608
1610
|
// @__NO_SIDE_EFFECTS__
|
|
1609
|
-
function
|
|
1610
|
-
return new
|
|
1611
|
+
function ii(e, t) {
|
|
1612
|
+
return new ri({
|
|
1611
1613
|
type: "pipe",
|
|
1612
1614
|
in: e,
|
|
1613
1615
|
out: t
|
|
1614
1616
|
});
|
|
1615
1617
|
}
|
|
1616
|
-
var
|
|
1617
|
-
d.init(e, t),
|
|
1618
|
+
var ai = /*@__PURE__*/ x("ZodMiniCustom", (e, t) => {
|
|
1619
|
+
d.init(e, t), J.init(e, t);
|
|
1618
1620
|
});
|
|
1619
1621
|
// @__NO_SIDE_EFFECTS__
|
|
1620
|
-
function
|
|
1621
|
-
return t(
|
|
1622
|
+
function oi(e, n) {
|
|
1623
|
+
return t(ai, e ?? (() => !0), n);
|
|
1622
1624
|
}
|
|
1623
1625
|
// @__NO_SIDE_EFFECTS__
|
|
1624
|
-
function
|
|
1625
|
-
return n(
|
|
1626
|
+
function si(e, t = {}) {
|
|
1627
|
+
return n(ai, e, t);
|
|
1626
1628
|
}
|
|
1627
1629
|
// ../../node_modules/.pnpm/ai@7.0.176_zod@4.6.7/node_modules/ai/dist/index.js
|
|
1628
|
-
var
|
|
1630
|
+
var ci = "AI_InvalidArgumentError", li = `vercel.ai.error.${ci}`, ui = Symbol.for(li), di = class extends k {
|
|
1629
1631
|
constructor({ parameter: e, value: t, message: n }) {
|
|
1630
1632
|
super({
|
|
1631
|
-
name:
|
|
1633
|
+
name: ci,
|
|
1632
1634
|
message: `Invalid argument for parameter ${e}: ${n}`
|
|
1633
|
-
}), this[
|
|
1635
|
+
}), this[ui] = !0, this.parameter = e, this.value = t;
|
|
1634
1636
|
}
|
|
1635
1637
|
static isInstance(e) {
|
|
1636
|
-
return
|
|
1638
|
+
return k.hasMarker(e, li);
|
|
1637
1639
|
}
|
|
1638
|
-
},
|
|
1640
|
+
}, fi = "AI_UIMessageStreamError", pi = `vercel.ai.error.${fi}`, mi = Symbol.for(pi), hi = class extends k {
|
|
1639
1641
|
constructor({ chunkType: e, chunkId: t, message: n }) {
|
|
1640
1642
|
super({
|
|
1641
|
-
name:
|
|
1643
|
+
name: fi,
|
|
1642
1644
|
message: n
|
|
1643
|
-
}), this[
|
|
1645
|
+
}), this[mi] = !0, this.chunkType = e, this.chunkId = t;
|
|
1644
1646
|
}
|
|
1645
1647
|
static isInstance(e) {
|
|
1646
|
-
return
|
|
1648
|
+
return k.hasMarker(e, pi);
|
|
1647
1649
|
}
|
|
1648
1650
|
};
|
|
1649
|
-
function
|
|
1651
|
+
function gi(e, t) {
|
|
1650
1652
|
if (e === void 0 && t === void 0) return;
|
|
1651
1653
|
if (e === void 0) return t;
|
|
1652
1654
|
if (t === void 0) return e;
|
|
@@ -1655,11 +1657,11 @@ function ii(e, t) {
|
|
|
1655
1657
|
let i = t[r];
|
|
1656
1658
|
if (i === void 0) continue;
|
|
1657
1659
|
let a = r in e ? e[r] : void 0, o = typeof i == "object" && !!i && !Array.isArray(i) && !(i instanceof Date) && !(i instanceof RegExp), s = typeof a == "object" && !!a && !Array.isArray(a) && !(a instanceof Date) && !(a instanceof RegExp);
|
|
1658
|
-
n[r] = o && s ?
|
|
1660
|
+
n[r] = o && s ? gi(a, i) : i;
|
|
1659
1661
|
}
|
|
1660
1662
|
return n;
|
|
1661
1663
|
}
|
|
1662
|
-
function
|
|
1664
|
+
function _i(e) {
|
|
1663
1665
|
let t = ["ROOT"], n = -1, r = null, i = 0;
|
|
1664
1666
|
function a(e) {
|
|
1665
1667
|
return e >= "0" && e <= "9" || e >= "A" && e <= "F" || e >= "a" && e <= "f";
|
|
@@ -1841,16 +1843,16 @@ function ai(e) {
|
|
|
1841
1843
|
}
|
|
1842
1844
|
return l;
|
|
1843
1845
|
}
|
|
1844
|
-
async function
|
|
1846
|
+
async function vi(e) {
|
|
1845
1847
|
if (e === void 0) return {
|
|
1846
1848
|
value: void 0,
|
|
1847
1849
|
state: "undefined-input"
|
|
1848
1850
|
};
|
|
1849
|
-
let t = await
|
|
1851
|
+
let t = await Cr({ text: e });
|
|
1850
1852
|
return t.success ? {
|
|
1851
1853
|
value: t.value,
|
|
1852
1854
|
state: "successful-parse"
|
|
1853
|
-
} : (t = await
|
|
1855
|
+
} : (t = await Cr({ text: _i(e) }), t.success ? {
|
|
1854
1856
|
value: t.value,
|
|
1855
1857
|
state: "repaired-parse"
|
|
1856
1858
|
} : {
|
|
@@ -1858,48 +1860,48 @@ async function oi(e) {
|
|
|
1858
1860
|
state: "failed-parse"
|
|
1859
1861
|
});
|
|
1860
1862
|
}
|
|
1861
|
-
|
|
1863
|
+
R({
|
|
1862
1864
|
prefix: "steer",
|
|
1863
1865
|
size: 24
|
|
1864
|
-
}), new TextEncoder(), new TextEncoder(),
|
|
1866
|
+
}), new TextEncoder(), new TextEncoder(), R({
|
|
1865
1867
|
prefix: "aitxt",
|
|
1866
1868
|
size: 24
|
|
1867
|
-
}),
|
|
1869
|
+
}), R({
|
|
1868
1870
|
prefix: "call",
|
|
1869
1871
|
size: 24
|
|
1870
1872
|
}), TransformStream;
|
|
1871
1873
|
var X = {
|
|
1872
1874
|
NEVER: ae,
|
|
1873
|
-
array:
|
|
1874
|
-
boolean:
|
|
1875
|
-
custom:
|
|
1876
|
-
discriminatedUnion:
|
|
1877
|
-
enum:
|
|
1878
|
-
extend:
|
|
1879
|
-
int:
|
|
1880
|
-
literal:
|
|
1881
|
-
looseObject:
|
|
1875
|
+
array: Rr,
|
|
1876
|
+
boolean: Mr,
|
|
1877
|
+
custom: oi,
|
|
1878
|
+
discriminatedUnion: Kr,
|
|
1879
|
+
enum: Xr,
|
|
1880
|
+
extend: Hr,
|
|
1881
|
+
int: Ar,
|
|
1882
|
+
literal: Qr,
|
|
1883
|
+
looseObject: Vr,
|
|
1882
1884
|
maximum: h,
|
|
1883
1885
|
minLength: s,
|
|
1884
|
-
never:
|
|
1886
|
+
never: Ir,
|
|
1885
1887
|
nonnegative: p,
|
|
1886
|
-
number:
|
|
1887
|
-
object:
|
|
1888
|
-
optional:
|
|
1889
|
-
pipe:
|
|
1890
|
-
positive:
|
|
1891
|
-
record:
|
|
1892
|
-
refine:
|
|
1888
|
+
number: Or,
|
|
1889
|
+
object: Br,
|
|
1890
|
+
optional: ni,
|
|
1891
|
+
pipe: ii,
|
|
1892
|
+
positive: Pe,
|
|
1893
|
+
record: Jr,
|
|
1894
|
+
refine: si,
|
|
1893
1895
|
safeParse: he,
|
|
1894
1896
|
startsWith: b,
|
|
1895
|
-
string:
|
|
1896
|
-
transform:
|
|
1897
|
-
union:
|
|
1898
|
-
unknown:
|
|
1897
|
+
string: Dr,
|
|
1898
|
+
transform: ei,
|
|
1899
|
+
union: Wr,
|
|
1900
|
+
unknown: Pr
|
|
1899
1901
|
}, Z = {
|
|
1900
1902
|
array: Ee,
|
|
1901
1903
|
boolean: ue,
|
|
1902
|
-
custom:
|
|
1904
|
+
custom: Oe,
|
|
1903
1905
|
discriminatedUnion: fe,
|
|
1904
1906
|
instanceof: oe,
|
|
1905
1907
|
lazy: S,
|
|
@@ -1908,18 +1910,18 @@ var X = {
|
|
|
1908
1910
|
number: ge,
|
|
1909
1911
|
object: ie,
|
|
1910
1912
|
record: ce,
|
|
1911
|
-
string:
|
|
1913
|
+
string: je,
|
|
1912
1914
|
union: v,
|
|
1913
1915
|
unknown: r
|
|
1914
|
-
},
|
|
1916
|
+
}, yi = Z.lazy(() => Z.union([
|
|
1915
1917
|
Z.null(),
|
|
1916
1918
|
Z.string(),
|
|
1917
1919
|
Z.number(),
|
|
1918
1920
|
Z.boolean(),
|
|
1919
|
-
Z.record(Z.string(),
|
|
1920
|
-
Z.array(
|
|
1921
|
-
])), Q = Z.record(Z.string(), Z.record(Z.string(),
|
|
1922
|
-
function
|
|
1921
|
+
Z.record(Z.string(), yi.optional()),
|
|
1922
|
+
Z.array(yi)
|
|
1923
|
+
])), Q = Z.record(Z.string(), Z.record(Z.string(), yi.optional()));
|
|
1924
|
+
function bi(e) {
|
|
1923
1925
|
return X.object({
|
|
1924
1926
|
source: X.discriminatedUnion("sourceType", [X.object({
|
|
1925
1927
|
type: X.literal("source"),
|
|
@@ -1942,7 +1944,7 @@ function ci(e) {
|
|
|
1942
1944
|
citedText: X.optional(X.string())
|
|
1943
1945
|
});
|
|
1944
1946
|
}
|
|
1945
|
-
var
|
|
1947
|
+
var xi = bi(Q), Si = X.record(X.string(), X.optional(yi)), Ci = dr(() => br(X.union([
|
|
1946
1948
|
X.looseObject({
|
|
1947
1949
|
type: X.literal("text-start"),
|
|
1948
1950
|
id: X.string(),
|
|
@@ -1957,7 +1959,7 @@ var li = ci(Q), ui = X.record(X.string(), X.optional(si)), di = Qn(() => sr(X.un
|
|
|
1957
1959
|
X.looseObject({
|
|
1958
1960
|
type: X.literal("text-end"),
|
|
1959
1961
|
id: X.string(),
|
|
1960
|
-
citations: X.optional(X.array(
|
|
1962
|
+
citations: X.optional(X.array(xi)),
|
|
1961
1963
|
providerMetadata: X.optional(Q)
|
|
1962
1964
|
}),
|
|
1963
1965
|
X.looseObject({
|
|
@@ -1971,7 +1973,7 @@ var li = ci(Q), ui = X.record(X.string(), X.optional(si)), di = Qn(() => sr(X.un
|
|
|
1971
1973
|
inputEncoding: X.optional(X.enum(["json", "text"])),
|
|
1972
1974
|
providerExecuted: X.optional(X.boolean()),
|
|
1973
1975
|
providerMetadata: X.optional(Q),
|
|
1974
|
-
toolMetadata: X.optional(
|
|
1976
|
+
toolMetadata: X.optional(Si),
|
|
1975
1977
|
dynamic: X.optional(X.boolean()),
|
|
1976
1978
|
title: X.optional(X.string())
|
|
1977
1979
|
}),
|
|
@@ -1987,7 +1989,7 @@ var li = ci(Q), ui = X.record(X.string(), X.optional(si)), di = Qn(() => sr(X.un
|
|
|
1987
1989
|
input: X.unknown(),
|
|
1988
1990
|
providerExecuted: X.optional(X.boolean()),
|
|
1989
1991
|
providerMetadata: X.optional(Q),
|
|
1990
|
-
toolMetadata: X.optional(
|
|
1992
|
+
toolMetadata: X.optional(Si),
|
|
1991
1993
|
dynamic: X.optional(X.boolean()),
|
|
1992
1994
|
title: X.optional(X.string())
|
|
1993
1995
|
}),
|
|
@@ -1998,7 +2000,7 @@ var li = ci(Q), ui = X.record(X.string(), X.optional(si)), di = Qn(() => sr(X.un
|
|
|
1998
2000
|
input: X.unknown(),
|
|
1999
2001
|
providerExecuted: X.optional(X.boolean()),
|
|
2000
2002
|
providerMetadata: X.optional(Q),
|
|
2001
|
-
toolMetadata: X.optional(
|
|
2003
|
+
toolMetadata: X.optional(Si),
|
|
2002
2004
|
dynamic: X.optional(X.boolean()),
|
|
2003
2005
|
errorText: X.string(),
|
|
2004
2006
|
title: X.optional(X.string())
|
|
@@ -2027,7 +2029,7 @@ var li = ci(Q), ui = X.record(X.string(), X.optional(si)), di = Qn(() => sr(X.un
|
|
|
2027
2029
|
output: X.unknown(),
|
|
2028
2030
|
providerExecuted: X.optional(X.boolean()),
|
|
2029
2031
|
providerMetadata: X.optional(Q),
|
|
2030
|
-
toolMetadata: X.optional(
|
|
2032
|
+
toolMetadata: X.optional(Si),
|
|
2031
2033
|
dynamic: X.optional(X.boolean()),
|
|
2032
2034
|
preliminary: X.optional(X.boolean())
|
|
2033
2035
|
}),
|
|
@@ -2037,7 +2039,7 @@ var li = ci(Q), ui = X.record(X.string(), X.optional(si)), di = Qn(() => sr(X.un
|
|
|
2037
2039
|
errorText: X.string(),
|
|
2038
2040
|
providerExecuted: X.optional(X.boolean()),
|
|
2039
2041
|
providerMetadata: X.optional(Q),
|
|
2040
|
-
toolMetadata: X.optional(
|
|
2042
|
+
toolMetadata: X.optional(Si),
|
|
2041
2043
|
dynamic: X.optional(X.boolean())
|
|
2042
2044
|
}),
|
|
2043
2045
|
X.looseObject({
|
|
@@ -2144,39 +2146,39 @@ var li = ci(Q), ui = X.record(X.string(), X.optional(si)), di = Qn(() => sr(X.un
|
|
|
2144
2146
|
messageMetadata: X.unknown()
|
|
2145
2147
|
})
|
|
2146
2148
|
])));
|
|
2147
|
-
function
|
|
2149
|
+
function wi(e) {
|
|
2148
2150
|
return e.type.startsWith("data-");
|
|
2149
2151
|
}
|
|
2150
|
-
function
|
|
2152
|
+
function Ti() {
|
|
2151
2153
|
return Object.create(null);
|
|
2152
2154
|
}
|
|
2153
|
-
function
|
|
2155
|
+
function Ei(e) {
|
|
2154
2156
|
return e.type.startsWith("tool-");
|
|
2155
2157
|
}
|
|
2156
|
-
function
|
|
2158
|
+
function Di(e) {
|
|
2157
2159
|
return e.type === "dynamic-tool";
|
|
2158
2160
|
}
|
|
2159
2161
|
function $(e) {
|
|
2160
|
-
return
|
|
2162
|
+
return Ei(e) || Di(e);
|
|
2161
2163
|
}
|
|
2162
|
-
function
|
|
2164
|
+
function Oi(e) {
|
|
2163
2165
|
return e.type.split("-").slice(1).join("-");
|
|
2164
2166
|
}
|
|
2165
|
-
function
|
|
2167
|
+
function ki({ lastMessage: e, messageId: t }) {
|
|
2166
2168
|
let n = e?.role === "assistant" ? e : {
|
|
2167
2169
|
id: t,
|
|
2168
2170
|
metadata: void 0,
|
|
2169
2171
|
role: "assistant",
|
|
2170
2172
|
parts: []
|
|
2171
|
-
}, r =
|
|
2173
|
+
}, r = Ti(), i = n.parts.findLastIndex((e) => e.type === "step-start"), a = 0;
|
|
2172
2174
|
for (let e of n.parts.slice(i + 1)) {
|
|
2173
2175
|
if (!$(e)) continue;
|
|
2174
2176
|
let t = a;
|
|
2175
|
-
|
|
2177
|
+
Ei(e) && a++, e.state === "input-streaming" && (r[e.toolCallId] = {
|
|
2176
2178
|
text: e.rawInput ?? "",
|
|
2177
2179
|
inputEncoding: e.inputEncoding,
|
|
2178
2180
|
index: t,
|
|
2179
|
-
toolName: e.type === "dynamic-tool" ? e.toolName :
|
|
2181
|
+
toolName: e.type === "dynamic-tool" ? e.toolName : Oi(e),
|
|
2180
2182
|
dynamic: e.type === "dynamic-tool",
|
|
2181
2183
|
title: e.title,
|
|
2182
2184
|
toolMetadata: e.toolMetadata
|
|
@@ -2184,12 +2186,12 @@ function _i({ lastMessage: e, messageId: t }) {
|
|
|
2184
2186
|
}
|
|
2185
2187
|
return {
|
|
2186
2188
|
message: n,
|
|
2187
|
-
activeTextParts:
|
|
2188
|
-
activeReasoningParts:
|
|
2189
|
+
activeTextParts: Ti(),
|
|
2190
|
+
activeReasoningParts: Ti(),
|
|
2189
2191
|
partialToolCalls: r
|
|
2190
2192
|
};
|
|
2191
2193
|
}
|
|
2192
|
-
function
|
|
2194
|
+
function Ai({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdateMessageJob: r, onError: i, onToolCall: a, onData: o, resetStateOnMessageIdChange: s = !1, resetStateOnFirstMessageStart: c = !1 }) {
|
|
2193
2195
|
let l = !0;
|
|
2194
2196
|
return e.pipeThrough(new TransformStream({ async transform(e, u) {
|
|
2195
2197
|
await r(async ({ state: r, write: d }) => {
|
|
@@ -2213,7 +2215,7 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2213
2215
|
}
|
|
2214
2216
|
}
|
|
2215
2217
|
}
|
|
2216
|
-
if (t == null) throw new
|
|
2218
|
+
if (t == null) throw new hi({
|
|
2217
2219
|
chunkType: "tool-invocation",
|
|
2218
2220
|
chunkId: e,
|
|
2219
2221
|
message: `No tool invocation found for tool call ID "${e}".`
|
|
@@ -2222,7 +2224,7 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2222
2224
|
}
|
|
2223
2225
|
function h(e) {
|
|
2224
2226
|
let t = r.message.parts.filter($).find((t) => t.approval?.id === e);
|
|
2225
|
-
if (t == null) throw new
|
|
2227
|
+
if (t == null) throw new hi({
|
|
2226
2228
|
chunkType: "tool-approval-response",
|
|
2227
2229
|
chunkId: e,
|
|
2228
2230
|
message: `No tool invocation found for approval ID "${e}".`
|
|
@@ -2230,7 +2232,7 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2230
2232
|
return t;
|
|
2231
2233
|
}
|
|
2232
2234
|
function g(e, t) {
|
|
2233
|
-
let n = t ?? f().find((t) =>
|
|
2235
|
+
let n = t ?? f().find((t) => Ei(t) && t.toolCallId === e.toolCallId), i = e, a = n;
|
|
2234
2236
|
if (n != null) {
|
|
2235
2237
|
n.state = e.state, a.type = `tool-${e.toolName}`, a.input = i.input, a.output = i.output, a.errorText = i.errorText, a.rawInput = i.rawInput, i.inputEncoding == null ? delete a.inputEncoding : a.inputEncoding = i.inputEncoding, a.preliminary = i.preliminary, e.title !== void 0 && (a.title = e.title), e.toolMetadata !== void 0 && (a.toolMetadata = e.toolMetadata), a.providerExecuted = i.providerExecuted ?? n.providerExecuted;
|
|
2236
2238
|
let t = i.providerMetadata;
|
|
@@ -2287,8 +2289,8 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2287
2289
|
}
|
|
2288
2290
|
async function v(e) {
|
|
2289
2291
|
if (e != null) {
|
|
2290
|
-
let n = r.message.metadata == null ? e :
|
|
2291
|
-
t != null && await
|
|
2292
|
+
let n = r.message.metadata == null ? e : gi(r.message.metadata, e);
|
|
2293
|
+
t != null && await xr({
|
|
2292
2294
|
value: n,
|
|
2293
2295
|
schema: t,
|
|
2294
2296
|
context: {
|
|
@@ -2311,7 +2313,7 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2311
2313
|
}
|
|
2312
2314
|
case "text-delta": {
|
|
2313
2315
|
let t = r.activeTextParts[e.id];
|
|
2314
|
-
if (t == null) throw new
|
|
2316
|
+
if (t == null) throw new hi({
|
|
2315
2317
|
chunkType: "text-delta",
|
|
2316
2318
|
chunkId: e.id,
|
|
2317
2319
|
message: `Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`
|
|
@@ -2321,7 +2323,7 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2321
2323
|
}
|
|
2322
2324
|
case "text-end": {
|
|
2323
2325
|
let t = r.activeTextParts[e.id];
|
|
2324
|
-
if (t == null) throw new
|
|
2326
|
+
if (t == null) throw new hi({
|
|
2325
2327
|
chunkType: "text-end",
|
|
2326
2328
|
chunkId: e.id,
|
|
2327
2329
|
message: `Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
|
|
@@ -2351,7 +2353,7 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2351
2353
|
}
|
|
2352
2354
|
case "reasoning-delta": {
|
|
2353
2355
|
let t = r.activeReasoningParts[e.id];
|
|
2354
|
-
if (t == null) throw new
|
|
2356
|
+
if (t == null) throw new hi({
|
|
2355
2357
|
chunkType: "reasoning-delta",
|
|
2356
2358
|
chunkId: e.id,
|
|
2357
2359
|
message: `Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`
|
|
@@ -2361,7 +2363,7 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2361
2363
|
}
|
|
2362
2364
|
case "reasoning-end": {
|
|
2363
2365
|
let t = r.activeReasoningParts[e.id];
|
|
2364
|
-
if (t == null) throw new
|
|
2366
|
+
if (t == null) throw new hi({
|
|
2365
2367
|
chunkType: "reasoning-end",
|
|
2366
2368
|
chunkId: e.id,
|
|
2367
2369
|
message: `Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
|
|
@@ -2398,7 +2400,7 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2398
2400
|
}), d();
|
|
2399
2401
|
break;
|
|
2400
2402
|
case "tool-input-start": {
|
|
2401
|
-
let t = f().filter(
|
|
2403
|
+
let t = f().filter(Ei);
|
|
2402
2404
|
r.partialToolCalls[e.toolCallId] = {
|
|
2403
2405
|
text: "",
|
|
2404
2406
|
inputEncoding: e.inputEncoding,
|
|
@@ -2432,13 +2434,13 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2432
2434
|
}
|
|
2433
2435
|
case "tool-input-delta": {
|
|
2434
2436
|
let t = r.partialToolCalls[e.toolCallId];
|
|
2435
|
-
if (t == null) throw new
|
|
2437
|
+
if (t == null) throw new hi({
|
|
2436
2438
|
chunkType: "tool-input-delta",
|
|
2437
2439
|
chunkId: e.toolCallId,
|
|
2438
2440
|
message: `Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`
|
|
2439
2441
|
});
|
|
2440
2442
|
t.text += e.inputTextDelta;
|
|
2441
|
-
let n = t.inputEncoding === "text" ? t.text : (await
|
|
2443
|
+
let n = t.inputEncoding === "text" ? t.text : (await vi(t.text)).value;
|
|
2442
2444
|
t.dynamic ? _({
|
|
2443
2445
|
toolCallId: e.toolCallId,
|
|
2444
2446
|
toolName: t.toolName,
|
|
@@ -2546,7 +2548,7 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2546
2548
|
toolMetadata: e.toolMetadata ?? t.toolMetadata
|
|
2547
2549
|
}, t) : g({
|
|
2548
2550
|
toolCallId: e.toolCallId,
|
|
2549
|
-
toolName:
|
|
2551
|
+
toolName: Oi(t),
|
|
2550
2552
|
state: "output-available",
|
|
2551
2553
|
input: t.input,
|
|
2552
2554
|
output: e.output,
|
|
@@ -2572,7 +2574,7 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2572
2574
|
toolMetadata: e.toolMetadata ?? t.toolMetadata
|
|
2573
2575
|
}, t) : g({
|
|
2574
2576
|
toolCallId: e.toolCallId,
|
|
2575
|
-
toolName:
|
|
2577
|
+
toolName: Oi(t),
|
|
2576
2578
|
state: "output-error",
|
|
2577
2579
|
input: t.input,
|
|
2578
2580
|
rawInput: t.rawInput,
|
|
@@ -2597,12 +2599,12 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2597
2599
|
case "finish-step": break;
|
|
2598
2600
|
case "reset-step": {
|
|
2599
2601
|
let e = f();
|
|
2600
|
-
r.activeTextParts =
|
|
2602
|
+
r.activeTextParts = Ti(), r.activeReasoningParts = Ti(), r.partialToolCalls = Ti(), e.length > 0 && (r.message.parts.splice(r.message.parts.length - e.length, e.length), d());
|
|
2601
2603
|
break;
|
|
2602
2604
|
}
|
|
2603
2605
|
case "start": {
|
|
2604
2606
|
let t = c && l || s && e.messageId != null && e.messageId !== r.message.id;
|
|
2605
|
-
l = !1, t && Object.assign(r,
|
|
2607
|
+
l = !1, t && Object.assign(r, ki({
|
|
2606
2608
|
lastMessage: void 0,
|
|
2607
2609
|
messageId: e.messageId ?? r.message.id
|
|
2608
2610
|
}), { finishReason: void 0 }), e.messageId != null && (r.message.id = e.messageId), await v(e.messageMetadata), (t || e.messageId != null || e.messageMetadata != null) && d({ updateStatus: !1 });
|
|
@@ -2617,11 +2619,11 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2617
2619
|
case "error":
|
|
2618
2620
|
i?.(Error(e.errorText));
|
|
2619
2621
|
break;
|
|
2620
|
-
default: if (
|
|
2622
|
+
default: if (wi(e)) {
|
|
2621
2623
|
let t = n?.[e.type.slice(5)];
|
|
2622
2624
|
if (t != null) {
|
|
2623
2625
|
let n = r.message.parts.findIndex((t) => "id" in t && "data" in t && t.id === e.id && t.type === e.type), i = n >= 0 ? n : r.message.parts.length;
|
|
2624
|
-
await
|
|
2626
|
+
await xr({
|
|
2625
2627
|
value: e.data,
|
|
2626
2628
|
schema: t,
|
|
2627
2629
|
context: {
|
|
@@ -2644,7 +2646,7 @@ function vi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2644
2646
|
});
|
|
2645
2647
|
} }));
|
|
2646
2648
|
}
|
|
2647
|
-
async function
|
|
2649
|
+
async function ji({ stream: e, onError: t, abortSignal: n }) {
|
|
2648
2650
|
let r = e.getReader(), i = () => {
|
|
2649
2651
|
r.cancel().catch(() => {});
|
|
2650
2652
|
};
|
|
@@ -2660,7 +2662,7 @@ async function yi({ stream: e, onError: t, abortSignal: n }) {
|
|
|
2660
2662
|
n?.removeEventListener("abort", i), r.releaseLock();
|
|
2661
2663
|
}
|
|
2662
2664
|
}
|
|
2663
|
-
function
|
|
2665
|
+
function Mi() {
|
|
2664
2666
|
let e, t;
|
|
2665
2667
|
return {
|
|
2666
2668
|
promise: new Promise((n, r) => {
|
|
@@ -2670,23 +2672,23 @@ function bi() {
|
|
|
2670
2672
|
reject: t
|
|
2671
2673
|
};
|
|
2672
2674
|
}
|
|
2673
|
-
|
|
2675
|
+
R({
|
|
2674
2676
|
prefix: "aitxt",
|
|
2675
2677
|
size: 24
|
|
2676
|
-
}),
|
|
2678
|
+
}), R({
|
|
2677
2679
|
prefix: "call",
|
|
2678
2680
|
size: 24
|
|
2679
|
-
}),
|
|
2681
|
+
}), R({
|
|
2680
2682
|
prefix: "aitxt",
|
|
2681
2683
|
size: 24
|
|
2682
|
-
}),
|
|
2684
|
+
}), R({
|
|
2683
2685
|
prefix: "call",
|
|
2684
2686
|
size: 24
|
|
2685
2687
|
});
|
|
2686
|
-
var
|
|
2687
|
-
function
|
|
2688
|
-
let t = [], n =
|
|
2689
|
-
return n ===
|
|
2688
|
+
var Ni = Symbol("invalid");
|
|
2689
|
+
function Pi(e) {
|
|
2690
|
+
let t = [], n = Fi(e, t, /* @__PURE__ */ new Set());
|
|
2691
|
+
return n === Ni ? {
|
|
2690
2692
|
success: !1,
|
|
2691
2693
|
path: t
|
|
2692
2694
|
} : {
|
|
@@ -2694,91 +2696,91 @@ function Si(e) {
|
|
|
2694
2696
|
value: n
|
|
2695
2697
|
};
|
|
2696
2698
|
}
|
|
2697
|
-
function
|
|
2699
|
+
function Fi(e, t, n) {
|
|
2698
2700
|
switch (typeof e) {
|
|
2699
2701
|
case "string":
|
|
2700
2702
|
case "boolean": return e;
|
|
2701
|
-
case "number": return Number.isFinite(e) ? e :
|
|
2703
|
+
case "number": return Number.isFinite(e) ? e : Ni;
|
|
2702
2704
|
case "object": {
|
|
2703
2705
|
if (e === null) return e;
|
|
2704
|
-
if (n.has(e)) return
|
|
2706
|
+
if (n.has(e)) return Ni;
|
|
2705
2707
|
n.add(e);
|
|
2706
|
-
let r = Array.isArray(e) ?
|
|
2708
|
+
let r = Array.isArray(e) ? Ii(e, t, n) : Li(e, t, n);
|
|
2707
2709
|
return n.delete(e), r;
|
|
2708
2710
|
}
|
|
2709
|
-
default: return
|
|
2711
|
+
default: return Ni;
|
|
2710
2712
|
}
|
|
2711
2713
|
}
|
|
2712
|
-
function
|
|
2714
|
+
function Ii(e, t, n) {
|
|
2713
2715
|
let r;
|
|
2714
2716
|
for (let i = 0; i < e.length; i++) {
|
|
2715
2717
|
let a = e[i];
|
|
2716
2718
|
t.push(i);
|
|
2717
|
-
let o =
|
|
2718
|
-
if (o ===
|
|
2719
|
+
let o = Fi(a, t, n);
|
|
2720
|
+
if (o === Ni) return Ni;
|
|
2719
2721
|
t.pop(), r == null ? o !== a && (r = e.slice(0, i), r.push(o)) : r.push(o);
|
|
2720
2722
|
}
|
|
2721
2723
|
return r ?? e;
|
|
2722
2724
|
}
|
|
2723
|
-
function
|
|
2724
|
-
if (!
|
|
2725
|
+
function Li(e, t, n) {
|
|
2726
|
+
if (!zi(e) || Bi(e)) return Ni;
|
|
2725
2727
|
let r = Object.keys(e), i;
|
|
2726
2728
|
for (let a = 0; a < r.length; a++) {
|
|
2727
2729
|
let o = r[a];
|
|
2728
2730
|
if (o === "__proto__") {
|
|
2729
|
-
i ??=
|
|
2731
|
+
i ??= Ri(e, r, a);
|
|
2730
2732
|
continue;
|
|
2731
2733
|
}
|
|
2732
2734
|
let s = e[o], c = s;
|
|
2733
2735
|
if (s !== void 0) {
|
|
2734
|
-
if (t.push(o), c =
|
|
2736
|
+
if (t.push(o), c = Fi(s, t, n), c === Ni) return Ni;
|
|
2735
2737
|
t.pop();
|
|
2736
2738
|
}
|
|
2737
|
-
i == null ? c !== s && (i =
|
|
2739
|
+
i == null ? c !== s && (i = Ri(e, r, a), i[o] = c) : i[o] = c;
|
|
2738
2740
|
}
|
|
2739
2741
|
return i ?? e;
|
|
2740
2742
|
}
|
|
2741
|
-
function
|
|
2743
|
+
function Ri(e, t, n) {
|
|
2742
2744
|
let r = {};
|
|
2743
2745
|
for (let i = 0; i < n; i++) r[t[i]] = e[t[i]];
|
|
2744
2746
|
return r;
|
|
2745
2747
|
}
|
|
2746
|
-
function
|
|
2748
|
+
function zi(e) {
|
|
2747
2749
|
let t = e.constructor;
|
|
2748
2750
|
if (typeof t != "function") return !0;
|
|
2749
2751
|
let n = t.prototype;
|
|
2750
2752
|
return typeof n == "object" && !!n && Object.prototype.hasOwnProperty.call(n, "isPrototypeOf");
|
|
2751
2753
|
}
|
|
2752
|
-
function
|
|
2754
|
+
function Bi(e) {
|
|
2753
2755
|
let t = Object.getOwnPropertySymbols(e);
|
|
2754
2756
|
for (let n = 0; n < t.length; n++) if (Object.prototype.propertyIsEnumerable.call(e, t[n])) return !0;
|
|
2755
2757
|
return !1;
|
|
2756
2758
|
}
|
|
2757
|
-
var
|
|
2758
|
-
let n =
|
|
2759
|
+
var Vi = X.pipe(X.unknown(), X.transform((e, t) => {
|
|
2760
|
+
let n = Pi(e);
|
|
2759
2761
|
return n.success ? n.value : (t.issues.push({
|
|
2760
2762
|
code: "custom",
|
|
2761
2763
|
message: "Invalid JSON value. Expected null, a string, a finite number, a boolean, an array, or an object.",
|
|
2762
2764
|
input: e,
|
|
2763
2765
|
path: n.path
|
|
2764
2766
|
}), X.NEVER);
|
|
2765
|
-
})),
|
|
2766
|
-
X.pipe(
|
|
2767
|
-
var
|
|
2768
|
-
X.record(X.string(), X.string()),
|
|
2767
|
+
})), Hi = X.custom();
|
|
2768
|
+
X.pipe(Vi, X.record(X.string(), Hi));
|
|
2769
|
+
var Ui = X.pipe(Vi, X.record(X.string(), X.record(X.string(), Hi)));
|
|
2770
|
+
X.record(X.string(), X.string()), bi(Ui), R({
|
|
2769
2771
|
prefix: "call",
|
|
2770
2772
|
size: 24
|
|
2771
|
-
}),
|
|
2773
|
+
}), R({
|
|
2772
2774
|
prefix: "call",
|
|
2773
2775
|
size: 24
|
|
2774
|
-
}), new TextEncoder(),
|
|
2776
|
+
}), new TextEncoder(), R({
|
|
2775
2777
|
prefix: "call",
|
|
2776
2778
|
size: 24
|
|
2777
|
-
}),
|
|
2779
|
+
}), R({
|
|
2778
2780
|
prefix: "aiobj",
|
|
2779
2781
|
size: 24
|
|
2780
2782
|
});
|
|
2781
|
-
var { atob:
|
|
2783
|
+
var { atob: Wi } = globalThis, Gi = class {
|
|
2782
2784
|
constructor() {
|
|
2783
2785
|
this.queue = [], this.isProcessing = !1, this.idleWaiters = [];
|
|
2784
2786
|
}
|
|
@@ -2810,35 +2812,35 @@ var { atob: Mi } = globalThis, Ni = class {
|
|
|
2810
2812
|
});
|
|
2811
2813
|
}
|
|
2812
2814
|
};
|
|
2813
|
-
|
|
2815
|
+
R({
|
|
2814
2816
|
prefix: "aiobj",
|
|
2815
2817
|
size: 24
|
|
2816
|
-
}),
|
|
2818
|
+
}), R({
|
|
2817
2819
|
prefix: "call",
|
|
2818
2820
|
size: 24
|
|
2819
2821
|
});
|
|
2820
|
-
var
|
|
2822
|
+
var Ki = Z.union([
|
|
2821
2823
|
Z.string(),
|
|
2822
|
-
Z.custom(
|
|
2823
|
-
Z.custom(
|
|
2824
|
-
Z.custom(
|
|
2825
|
-
]),
|
|
2824
|
+
Z.custom(cn, { message: "Must be a Uint8Array" }),
|
|
2825
|
+
Z.custom(ln, { message: "Must be an ArrayBuffer" }),
|
|
2826
|
+
Z.custom(dn, { message: "Must be a Buffer" })
|
|
2827
|
+
]), qi = Z.record(Z.string(), Z.string()), Ji = Z.object({
|
|
2826
2828
|
type: Z.literal("text"),
|
|
2827
2829
|
text: Z.string(),
|
|
2828
2830
|
providerOptions: Q.optional()
|
|
2829
|
-
}),
|
|
2831
|
+
}), Yi = Z.object({
|
|
2830
2832
|
type: Z.literal("image"),
|
|
2831
2833
|
image: Z.union([
|
|
2832
|
-
|
|
2834
|
+
Ki,
|
|
2833
2835
|
Z.instanceof(URL),
|
|
2834
|
-
|
|
2836
|
+
qi
|
|
2835
2837
|
]),
|
|
2836
2838
|
mediaType: Z.string().optional(),
|
|
2837
2839
|
providerOptions: Q.optional()
|
|
2838
|
-
}),
|
|
2840
|
+
}), Xi = Z.discriminatedUnion("type", [
|
|
2839
2841
|
Z.object({
|
|
2840
2842
|
type: Z.literal("data"),
|
|
2841
|
-
data:
|
|
2843
|
+
data: Ki
|
|
2842
2844
|
}),
|
|
2843
2845
|
Z.object({
|
|
2844
2846
|
type: Z.literal("url"),
|
|
@@ -2846,54 +2848,54 @@ var Pi = Z.union([
|
|
|
2846
2848
|
}),
|
|
2847
2849
|
Z.object({
|
|
2848
2850
|
type: Z.literal("reference"),
|
|
2849
|
-
reference:
|
|
2851
|
+
reference: qi
|
|
2850
2852
|
}),
|
|
2851
2853
|
Z.object({
|
|
2852
2854
|
type: Z.literal("text"),
|
|
2853
2855
|
text: Z.string()
|
|
2854
2856
|
})
|
|
2855
|
-
]),
|
|
2857
|
+
]), Zi = Z.discriminatedUnion("type", [Z.object({
|
|
2856
2858
|
type: Z.literal("data"),
|
|
2857
|
-
data:
|
|
2859
|
+
data: Ki
|
|
2858
2860
|
}), Z.object({
|
|
2859
2861
|
type: Z.literal("url"),
|
|
2860
2862
|
url: Z.instanceof(URL)
|
|
2861
|
-
})]),
|
|
2863
|
+
})]), Qi = Z.object({
|
|
2862
2864
|
type: Z.literal("file"),
|
|
2863
2865
|
data: Z.union([
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
+
Xi,
|
|
2867
|
+
Ki,
|
|
2866
2868
|
Z.instanceof(URL),
|
|
2867
|
-
|
|
2869
|
+
qi
|
|
2868
2870
|
]),
|
|
2869
2871
|
filename: Z.string().optional(),
|
|
2870
2872
|
mediaType: Z.string(),
|
|
2871
2873
|
providerOptions: Q.optional()
|
|
2872
|
-
}),
|
|
2874
|
+
}), $i = Z.object({
|
|
2873
2875
|
type: Z.literal("reasoning"),
|
|
2874
2876
|
text: Z.string(),
|
|
2875
2877
|
providerOptions: Q.optional()
|
|
2876
|
-
}),
|
|
2878
|
+
}), ea = Z.object({
|
|
2877
2879
|
type: Z.literal("custom"),
|
|
2878
2880
|
kind: Z.string().transform((e) => e),
|
|
2879
2881
|
providerOptions: Q.optional()
|
|
2880
|
-
}),
|
|
2882
|
+
}), ta = Z.object({
|
|
2881
2883
|
type: Z.literal("reasoning-file"),
|
|
2882
2884
|
data: Z.union([
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
+
Zi,
|
|
2886
|
+
Ki,
|
|
2885
2887
|
Z.instanceof(URL)
|
|
2886
2888
|
]),
|
|
2887
2889
|
mediaType: Z.string(),
|
|
2888
2890
|
providerOptions: Q.optional()
|
|
2889
|
-
}),
|
|
2891
|
+
}), na = Z.object({
|
|
2890
2892
|
type: Z.literal("tool-call"),
|
|
2891
2893
|
toolCallId: Z.string(),
|
|
2892
2894
|
toolName: Z.string(),
|
|
2893
2895
|
input: Z.unknown(),
|
|
2894
2896
|
providerOptions: Q.optional(),
|
|
2895
2897
|
providerExecuted: Z.boolean().optional()
|
|
2896
|
-
}),
|
|
2898
|
+
}), ra = Z.discriminatedUnion("type", [
|
|
2897
2899
|
Z.object({
|
|
2898
2900
|
type: Z.literal("text"),
|
|
2899
2901
|
value: Z.string(),
|
|
@@ -2901,7 +2903,7 @@ var Pi = Z.union([
|
|
|
2901
2903
|
}),
|
|
2902
2904
|
Z.object({
|
|
2903
2905
|
type: Z.literal("json"),
|
|
2904
|
-
value:
|
|
2906
|
+
value: yi,
|
|
2905
2907
|
providerOptions: Q.optional()
|
|
2906
2908
|
}),
|
|
2907
2909
|
Z.object({
|
|
@@ -2916,7 +2918,7 @@ var Pi = Z.union([
|
|
|
2916
2918
|
}),
|
|
2917
2919
|
Z.object({
|
|
2918
2920
|
type: Z.literal("error-json"),
|
|
2919
|
-
value:
|
|
2921
|
+
value: yi,
|
|
2920
2922
|
providerOptions: Q.optional()
|
|
2921
2923
|
}),
|
|
2922
2924
|
Z.object({
|
|
@@ -2929,7 +2931,7 @@ var Pi = Z.union([
|
|
|
2929
2931
|
}),
|
|
2930
2932
|
Z.object({
|
|
2931
2933
|
type: Z.literal("file"),
|
|
2932
|
-
data:
|
|
2934
|
+
data: Xi,
|
|
2933
2935
|
mediaType: Z.string(),
|
|
2934
2936
|
filename: Z.string().optional(),
|
|
2935
2937
|
providerOptions: Q.optional()
|
|
@@ -2984,13 +2986,13 @@ var Pi = Z.union([
|
|
|
2984
2986
|
})
|
|
2985
2987
|
]))
|
|
2986
2988
|
})
|
|
2987
|
-
]),
|
|
2989
|
+
]), ia = Z.object({
|
|
2988
2990
|
type: Z.literal("tool-result"),
|
|
2989
2991
|
toolCallId: Z.string(),
|
|
2990
2992
|
toolName: Z.string(),
|
|
2991
|
-
output:
|
|
2993
|
+
output: ra,
|
|
2992
2994
|
providerOptions: Q.optional()
|
|
2993
|
-
}),
|
|
2995
|
+
}), aa = Z.object({
|
|
2994
2996
|
type: Z.literal("tool-approval-request"),
|
|
2995
2997
|
approvalId: Z.string(),
|
|
2996
2998
|
toolCallId: Z.string(),
|
|
@@ -2998,46 +3000,46 @@ var Pi = Z.union([
|
|
|
2998
3000
|
isAutomatic: Z.boolean().optional(),
|
|
2999
3001
|
signature: Z.string().optional(),
|
|
3000
3002
|
inputSchemaInput: Z.unknown().optional()
|
|
3001
|
-
}),
|
|
3003
|
+
}), oa = Z.object({
|
|
3002
3004
|
type: Z.literal("tool-approval-response"),
|
|
3003
3005
|
approvalId: Z.string(),
|
|
3004
3006
|
approved: Z.boolean(),
|
|
3005
3007
|
reason: Z.string().optional()
|
|
3006
|
-
}),
|
|
3008
|
+
}), sa = Z.object({
|
|
3007
3009
|
role: Z.literal("system"),
|
|
3008
3010
|
content: Z.string(),
|
|
3009
3011
|
providerOptions: Q.optional()
|
|
3010
|
-
}),
|
|
3012
|
+
}), ca = Z.object({
|
|
3011
3013
|
role: Z.literal("user"),
|
|
3012
3014
|
content: Z.union([Z.string(), Z.array(Z.union([
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3015
|
+
Ji,
|
|
3016
|
+
Yi,
|
|
3017
|
+
Qi
|
|
3016
3018
|
]))]),
|
|
3017
3019
|
providerOptions: Q.optional()
|
|
3018
|
-
}),
|
|
3020
|
+
}), la = Z.object({
|
|
3019
3021
|
role: Z.literal("assistant"),
|
|
3020
3022
|
content: Z.union([Z.string(), Z.array(Z.union([
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3023
|
+
Ji,
|
|
3024
|
+
ea,
|
|
3025
|
+
Qi,
|
|
3026
|
+
$i,
|
|
3027
|
+
ta,
|
|
3028
|
+
na,
|
|
3029
|
+
ia,
|
|
3030
|
+
aa
|
|
3029
3031
|
]))]),
|
|
3030
3032
|
providerOptions: Q.optional()
|
|
3031
|
-
}),
|
|
3033
|
+
}), ua = Z.object({
|
|
3032
3034
|
role: Z.literal("tool"),
|
|
3033
|
-
content: Z.array(Z.union([
|
|
3035
|
+
content: Z.array(Z.union([ia, oa])),
|
|
3034
3036
|
providerOptions: Q.optional()
|
|
3035
3037
|
});
|
|
3036
3038
|
Z.union([
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3039
|
+
sa,
|
|
3040
|
+
ca,
|
|
3041
|
+
la,
|
|
3042
|
+
ua
|
|
3041
3043
|
]), X.object({
|
|
3042
3044
|
token: X.string().check(X.refine((e) => e.trim().length > 0)),
|
|
3043
3045
|
url: X.string().check(X.refine((e) => {
|
|
@@ -3055,19 +3057,19 @@ Z.union([
|
|
|
3055
3057
|
description: X.optional(X.string()),
|
|
3056
3058
|
parameters: X.record(X.string(), X.unknown())
|
|
3057
3059
|
})))
|
|
3058
|
-
}),
|
|
3060
|
+
}), R({
|
|
3059
3061
|
prefix: "call",
|
|
3060
3062
|
size: 24
|
|
3061
|
-
}),
|
|
3063
|
+
}), R({
|
|
3062
3064
|
prefix: "call",
|
|
3063
3065
|
size: 24
|
|
3064
|
-
}),
|
|
3066
|
+
}), R({
|
|
3065
3067
|
prefix: "call",
|
|
3066
3068
|
size: 24
|
|
3067
3069
|
});
|
|
3068
|
-
async function
|
|
3070
|
+
async function da({ response: e, url: t, fallbackMessage: n }) {
|
|
3069
3071
|
let r = await e.text();
|
|
3070
|
-
return new
|
|
3072
|
+
return new Nt({
|
|
3071
3073
|
message: r || n,
|
|
3072
3074
|
url: t,
|
|
3073
3075
|
requestBodyValues: void 0,
|
|
@@ -3075,9 +3077,9 @@ async function $i({ response: e, url: t, fallbackMessage: n }) {
|
|
|
3075
3077
|
responseBody: r
|
|
3076
3078
|
});
|
|
3077
3079
|
}
|
|
3078
|
-
async function
|
|
3080
|
+
async function fa(e) {
|
|
3079
3081
|
if (e == null) return [];
|
|
3080
|
-
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new
|
|
3082
|
+
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Zt({
|
|
3081
3083
|
functionality: "FileList",
|
|
3082
3084
|
message: "FileList is not supported in the current environment"
|
|
3083
3085
|
});
|
|
@@ -3096,18 +3098,18 @@ async function ea(e) {
|
|
|
3096
3098
|
};
|
|
3097
3099
|
}));
|
|
3098
3100
|
}
|
|
3099
|
-
function
|
|
3101
|
+
function pa(e, t) {
|
|
3100
3102
|
let n = e.search(/[?#]/), r = n === -1 ? e : e.slice(0, n), i = n === -1 ? "" : e.slice(n);
|
|
3101
3103
|
return `${r.endsWith("/") && t.startsWith("/") ? r.slice(0, -1) : r}${t}${i}`;
|
|
3102
3104
|
}
|
|
3103
|
-
var
|
|
3105
|
+
var ma = class {
|
|
3104
3106
|
constructor({ api: e = "/api/chat", credentials: t, headers: n, body: r, fetch: i, prepareSendMessagesRequest: a, prepareReconnectToStreamRequest: o }) {
|
|
3105
3107
|
this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
|
|
3106
3108
|
}
|
|
3107
3109
|
async sendMessages({ abortSignal: e, ...t }) {
|
|
3108
|
-
let n = await
|
|
3109
|
-
...
|
|
3110
|
-
...
|
|
3110
|
+
let n = await Tr(this.body), r = await Tr(this.headers), i = await Tr(this.credentials), a = {
|
|
3111
|
+
...L(r),
|
|
3112
|
+
...L(t.headers)
|
|
3111
3113
|
}, o = await this.prepareSendMessagesRequest?.({
|
|
3112
3114
|
api: this.api,
|
|
3113
3115
|
id: t.chatId,
|
|
@@ -3121,7 +3123,7 @@ var na = class {
|
|
|
3121
3123
|
requestMetadata: t.metadata,
|
|
3122
3124
|
trigger: t.trigger,
|
|
3123
3125
|
messageId: t.messageId
|
|
3124
|
-
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a :
|
|
3126
|
+
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : L(o.headers), l = o?.body === void 0 ? {
|
|
3125
3127
|
...n,
|
|
3126
3128
|
...t.body,
|
|
3127
3129
|
id: t.chatId,
|
|
@@ -3138,18 +3140,18 @@ var na = class {
|
|
|
3138
3140
|
credentials: u,
|
|
3139
3141
|
signal: e
|
|
3140
3142
|
});
|
|
3141
|
-
if (!d.ok) throw await
|
|
3143
|
+
if (!d.ok) throw await da({
|
|
3142
3144
|
response: d,
|
|
3143
3145
|
url: s,
|
|
3144
3146
|
fallbackMessage: "Failed to fetch the chat response."
|
|
3145
3147
|
});
|
|
3146
|
-
if (!d.body) throw new
|
|
3148
|
+
if (!d.body) throw new It({ message: "The response body is empty." });
|
|
3147
3149
|
return this.processResponseStream(d.body);
|
|
3148
3150
|
}
|
|
3149
3151
|
async reconnectToStream(e) {
|
|
3150
|
-
let t = await
|
|
3151
|
-
...
|
|
3152
|
-
...
|
|
3152
|
+
let t = await Tr(this.body), n = await Tr(this.headers), r = await Tr(this.credentials), i = {
|
|
3153
|
+
...L(n),
|
|
3154
|
+
...L(e.headers)
|
|
3153
3155
|
}, a = await this.prepareReconnectToStreamRequest?.({
|
|
3154
3156
|
api: this.api,
|
|
3155
3157
|
id: e.chatId,
|
|
@@ -3162,47 +3164,47 @@ var na = class {
|
|
|
3162
3164
|
requestMetadata: e.metadata
|
|
3163
3165
|
}), o = a?.api;
|
|
3164
3166
|
if (o == null) {
|
|
3165
|
-
if (e.chatId === "." || e.chatId === "..") throw new
|
|
3167
|
+
if (e.chatId === "." || e.chatId === "..") throw new di({
|
|
3166
3168
|
parameter: "chatId",
|
|
3167
3169
|
value: e.chatId,
|
|
3168
3170
|
message: "Chat IDs must not be \".\" or \"..\" when using the default reconnect URL."
|
|
3169
3171
|
});
|
|
3170
|
-
o =
|
|
3172
|
+
o = pa(this.api, `/${encodeURIComponent(e.chatId)}/stream`);
|
|
3171
3173
|
}
|
|
3172
|
-
let s = a?.headers === void 0 ? i :
|
|
3174
|
+
let s = a?.headers === void 0 ? i : L(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
|
|
3173
3175
|
method: "GET",
|
|
3174
3176
|
headers: s,
|
|
3175
3177
|
credentials: c,
|
|
3176
3178
|
signal: e.abortSignal
|
|
3177
3179
|
});
|
|
3178
3180
|
if (l.status === 204) return null;
|
|
3179
|
-
if (!l.ok) throw await
|
|
3181
|
+
if (!l.ok) throw await da({
|
|
3180
3182
|
response: l,
|
|
3181
3183
|
url: o,
|
|
3182
3184
|
fallbackMessage: "Failed to fetch the chat response."
|
|
3183
3185
|
});
|
|
3184
|
-
if (!l.body) throw new
|
|
3186
|
+
if (!l.body) throw new It({ message: "The response body is empty." });
|
|
3185
3187
|
return this.processResponseStream(l.body);
|
|
3186
3188
|
}
|
|
3187
|
-
},
|
|
3189
|
+
}, ha = class extends ma {
|
|
3188
3190
|
constructor({ resumeStreamIsReplay: e = !0, ...t } = {}) {
|
|
3189
3191
|
super(t), this.resumeStreamIsReplay = e;
|
|
3190
3192
|
}
|
|
3191
3193
|
processResponseStream(e) {
|
|
3192
|
-
return
|
|
3194
|
+
return wr({
|
|
3193
3195
|
stream: e,
|
|
3194
|
-
schema:
|
|
3196
|
+
schema: Ci
|
|
3195
3197
|
}).pipeThrough(new TransformStream({ async transform(e, t) {
|
|
3196
3198
|
if (!e.success) throw e.error;
|
|
3197
3199
|
t.enqueue(e.value);
|
|
3198
3200
|
} }));
|
|
3199
3201
|
}
|
|
3200
|
-
},
|
|
3202
|
+
}, ga = class {
|
|
3201
3203
|
get id() {
|
|
3202
3204
|
return this._id ??= this.generateId();
|
|
3203
3205
|
}
|
|
3204
|
-
constructor({ generateId: e =
|
|
3205
|
-
this.queuedMessagesFallback = [], this.queuedMessageOptions = /* @__PURE__ */ new Map(), this.isQueuePaused = !1, this.pendingAutomaticDecisions = [], this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.interruptedMessageIds = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.resumableStreamState = void 0, this.jobExecutor = new
|
|
3206
|
+
constructor({ generateId: e = un, id: t, transport: n = new ha(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u, experimental_queue: d = !1 }) {
|
|
3207
|
+
this.queuedMessagesFallback = [], this.queuedMessageOptions = /* @__PURE__ */ new Map(), this.isQueuePaused = !1, this.pendingAutomaticDecisions = [], this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.interruptedMessageIds = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.resumableStreamState = void 0, this.jobExecutor = new Gi(), this.activeStopCount = 0, this.stopGeneration = 0, this.experimental_removeQueuedMessage = (e) => {
|
|
3206
3208
|
this.queuedMessageOptions.delete(e), this.setQueuedMessages(this.experimental_queuedMessages.filter((t) => t.id !== e));
|
|
3207
3209
|
}, this.experimental_sendQueuedMessageNow = async (e) => {
|
|
3208
3210
|
let t = this.experimental_queuedMessages.find((t) => t.id === e);
|
|
@@ -3240,7 +3242,7 @@ var na = class {
|
|
|
3240
3242
|
this.pendingMessagePreparations.add(t);
|
|
3241
3243
|
let r;
|
|
3242
3244
|
try {
|
|
3243
|
-
r = Array.isArray(e.files) ? e.files : await
|
|
3245
|
+
r = Array.isArray(e.files) ? e.files : await fa(e.files);
|
|
3244
3246
|
} finally {
|
|
3245
3247
|
this.pendingMessagePreparations.delete(t);
|
|
3246
3248
|
}
|
|
@@ -3265,12 +3267,12 @@ var na = class {
|
|
|
3265
3267
|
if (e.messageId != null) {
|
|
3266
3268
|
await this.clearQueueForHistoryChange();
|
|
3267
3269
|
let t = this.state.messages.findIndex((t) => t.id === e.messageId);
|
|
3268
|
-
if (t === -1) throw new
|
|
3270
|
+
if (t === -1) throw new di({
|
|
3269
3271
|
parameter: "message.messageId",
|
|
3270
3272
|
value: e.messageId,
|
|
3271
3273
|
message: `message with id ${e.messageId} not found`
|
|
3272
3274
|
});
|
|
3273
|
-
if (this.state.messages[t].role !== "user") throw new
|
|
3275
|
+
if (this.state.messages[t].role !== "user") throw new di({
|
|
3274
3276
|
parameter: "message.messageId",
|
|
3275
3277
|
value: e.messageId,
|
|
3276
3278
|
message: `message with id ${e.messageId} is not a user message`
|
|
@@ -3296,7 +3298,7 @@ var na = class {
|
|
|
3296
3298
|
}, this.regenerate = async ({ messageId: e, ...t } = {}) => {
|
|
3297
3299
|
await this.clearQueueForHistoryChange();
|
|
3298
3300
|
let n = e == null ? this.state.messages.length - 1 : this.state.messages.findIndex((t) => t.id === e);
|
|
3299
|
-
if (n === -1) throw new
|
|
3301
|
+
if (n === -1) throw new di({
|
|
3300
3302
|
parameter: "messageId",
|
|
3301
3303
|
value: e,
|
|
3302
3304
|
message: `message ${e} not found`
|
|
@@ -3494,7 +3496,7 @@ var na = class {
|
|
|
3494
3496
|
}), r && this.status === "error" && this.pendingApprovalMessageId == null && (this.pendingApprovalMessageId = this.state.messages[t]?.id ?? e);
|
|
3495
3497
|
}
|
|
3496
3498
|
async makeRequest(e) {
|
|
3497
|
-
let t =
|
|
3499
|
+
let t = Mi();
|
|
3498
3500
|
try {
|
|
3499
3501
|
await this.makeRequestImpl({
|
|
3500
3502
|
...e,
|
|
@@ -3550,7 +3552,7 @@ var na = class {
|
|
|
3550
3552
|
let d = this.lastMessage, f = e === "submit-message" && i != null ? this.state.messages.findIndex((e) => e.id === i) : this.state.messages.length - 1, p = f === -1 ? d : this.state.messages[f], m = p?.id, h = e === "resume-stream" && p?.role === "assistant" && p.parts.some((e) => $(e) && (e.state === "input-streaming" || e.state === "input-available" && e.providerExecuted || e.state === "approval-responded")) ? this.state.snapshot(p) : void 0, g = f !== -1 && f < this.state.messages.length - 1 && p?.role === "assistant", _ = !1, v = !1, y = !1, b;
|
|
3551
3553
|
try {
|
|
3552
3554
|
let s = {
|
|
3553
|
-
state: e === "resume-stream" && this.resumableStreamState != null ? this.resumableStreamState :
|
|
3555
|
+
state: e === "resume-stream" && this.resumableStreamState != null ? this.resumableStreamState : ki({
|
|
3554
3556
|
lastMessage: e === "resume-stream" ? h : e === "regenerate-message" ? void 0 : this.state.snapshot(p),
|
|
3555
3557
|
messageId: this.generateId()
|
|
3556
3558
|
}),
|
|
@@ -3570,8 +3572,8 @@ var na = class {
|
|
|
3570
3572
|
body: r,
|
|
3571
3573
|
trigger: e,
|
|
3572
3574
|
messageId: i
|
|
3573
|
-
}), await
|
|
3574
|
-
stream:
|
|
3575
|
+
}), await ji({
|
|
3576
|
+
stream: Ai({
|
|
3575
3577
|
stream: l,
|
|
3576
3578
|
resetStateOnMessageIdChange: e === "resume-stream",
|
|
3577
3579
|
resetStateOnFirstMessageStart: e === "resume-stream" && this.transport.resumeStreamIsReplay,
|
|
@@ -3642,37 +3644,37 @@ var na = class {
|
|
|
3642
3644
|
}
|
|
3643
3645
|
}
|
|
3644
3646
|
};
|
|
3645
|
-
function
|
|
3647
|
+
function _a({ messages: e }) {
|
|
3646
3648
|
let t = e[e.length - 1];
|
|
3647
3649
|
if (!t || t.role !== "assistant") return !1;
|
|
3648
3650
|
let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter($);
|
|
3649
3651
|
return r.filter((e) => e.state === "approval-responded").length > 0 && r.every((e) => e.state === "output-available" && e.preliminary !== !0 || e.state === "output-error" || e.state === "output-denied" || e.state === "approval-responded");
|
|
3650
3652
|
}
|
|
3651
3653
|
// ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.45_typescript@6.0.3_/node_modules/swrv/esm/lib/hash.js
|
|
3652
|
-
var
|
|
3653
|
-
function
|
|
3654
|
+
var va = /* @__PURE__ */ new WeakMap(), ya = 0;
|
|
3655
|
+
function ba(e) {
|
|
3654
3656
|
if (!e.length) return "";
|
|
3655
3657
|
for (var t = "arg", n = 0; n < e.length; ++n) {
|
|
3656
3658
|
var r = void 0;
|
|
3657
|
-
e[n] === null || typeof e[n] != "object" && typeof e[n] != "function" ? r = typeof e[n] == "string" ? "\"" + e[n] + "\"" : String(e[n]) :
|
|
3659
|
+
e[n] === null || typeof e[n] != "object" && typeof e[n] != "function" ? r = typeof e[n] == "string" ? "\"" + e[n] + "\"" : String(e[n]) : va.has(e[n]) ? r = va.get(e[n]) : (r = ya, va.set(e[n], ya++)), t += "@" + r;
|
|
3658
3660
|
}
|
|
3659
3661
|
return t;
|
|
3660
3662
|
}
|
|
3661
3663
|
// ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.45_typescript@6.0.3_/node_modules/swrv/esm/cache/index.js
|
|
3662
|
-
function
|
|
3664
|
+
function xa(e) {
|
|
3663
3665
|
if (typeof e == "function") try {
|
|
3664
3666
|
e = e();
|
|
3665
3667
|
} catch {
|
|
3666
3668
|
e = "";
|
|
3667
3669
|
}
|
|
3668
|
-
return e = Array.isArray(e) ?
|
|
3670
|
+
return e = Array.isArray(e) ? ba(e) : String(e || ""), e;
|
|
3669
3671
|
}
|
|
3670
|
-
var
|
|
3672
|
+
var Sa = function() {
|
|
3671
3673
|
function e(e) {
|
|
3672
3674
|
e === void 0 && (e = 0), this.items = /* @__PURE__ */ new Map(), this.ttl = e;
|
|
3673
3675
|
}
|
|
3674
3676
|
return e.prototype.serializeKey = function(e) {
|
|
3675
|
-
return
|
|
3677
|
+
return xa(e);
|
|
3676
3678
|
}, e.prototype.get = function(e) {
|
|
3677
3679
|
var t = this.serializeKey(e);
|
|
3678
3680
|
return this.items.get(t);
|
|
@@ -3693,26 +3695,26 @@ var ua = function() {
|
|
|
3693
3695
|
}, e;
|
|
3694
3696
|
}();
|
|
3695
3697
|
// ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.45_typescript@6.0.3_/node_modules/swrv/esm/lib/web-preset.js
|
|
3696
|
-
function
|
|
3698
|
+
function Ca() {
|
|
3697
3699
|
return navigator.onLine === void 0 || navigator.onLine;
|
|
3698
3700
|
}
|
|
3699
|
-
function
|
|
3701
|
+
function wa() {
|
|
3700
3702
|
return typeof document < "u" && document.visibilityState !== void 0 ? document.visibilityState !== "hidden" : !0;
|
|
3701
3703
|
}
|
|
3702
|
-
var
|
|
3703
|
-
isOnline:
|
|
3704
|
-
isDocumentVisible:
|
|
3704
|
+
var Ta = {
|
|
3705
|
+
isOnline: Ca,
|
|
3706
|
+
isDocumentVisible: wa,
|
|
3705
3707
|
fetcher: function(e) {
|
|
3706
3708
|
return fetch(e).then(function(e) {
|
|
3707
3709
|
return e.json();
|
|
3708
3710
|
});
|
|
3709
3711
|
}
|
|
3710
|
-
},
|
|
3711
|
-
return
|
|
3712
|
+
}, Ea = function() {
|
|
3713
|
+
return Ea = Object.assign || function(e) {
|
|
3712
3714
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
3713
3715
|
return e;
|
|
3714
|
-
},
|
|
3715
|
-
},
|
|
3716
|
+
}, Ea.apply(this, arguments);
|
|
3717
|
+
}, Da = function(e, t, n, r) {
|
|
3716
3718
|
function i(e) {
|
|
3717
3719
|
return e instanceof n ? e : new n(function(t) {
|
|
3718
3720
|
t(e);
|
|
@@ -3738,7 +3740,7 @@ var pa = {
|
|
|
3738
3740
|
}
|
|
3739
3741
|
c((r = r.apply(e, t || [])).next());
|
|
3740
3742
|
});
|
|
3741
|
-
},
|
|
3743
|
+
}, Oa = function(e, t) {
|
|
3742
3744
|
var n = {
|
|
3743
3745
|
label: 0,
|
|
3744
3746
|
sent: function() {
|
|
@@ -3811,7 +3813,7 @@ var pa = {
|
|
|
3811
3813
|
done: !0
|
|
3812
3814
|
};
|
|
3813
3815
|
}
|
|
3814
|
-
},
|
|
3816
|
+
}, ka = function(e, t) {
|
|
3815
3817
|
var n = typeof Symbol == "function" && e[Symbol.iterator];
|
|
3816
3818
|
if (!n) return e;
|
|
3817
3819
|
var r = n.call(e), i, a = [], o;
|
|
@@ -3827,11 +3829,11 @@ var pa = {
|
|
|
3827
3829
|
}
|
|
3828
3830
|
}
|
|
3829
3831
|
return a;
|
|
3830
|
-
},
|
|
3832
|
+
}, Aa = function(e, t, n) {
|
|
3831
3833
|
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
3832
3834
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
3833
|
-
},
|
|
3834
|
-
cache:
|
|
3835
|
+
}, ja = new Sa(), Ma = new Sa(), Na = new Sa(), Pa = {
|
|
3836
|
+
cache: ja,
|
|
3835
3837
|
refreshInterval: 0,
|
|
3836
3838
|
ttl: 0,
|
|
3837
3839
|
serverTTL: 1e3,
|
|
@@ -3841,15 +3843,15 @@ var pa = {
|
|
|
3841
3843
|
shouldRetryOnError: !0,
|
|
3842
3844
|
errorRetryInterval: 5e3,
|
|
3843
3845
|
errorRetryCount: 5,
|
|
3844
|
-
fetcher:
|
|
3845
|
-
isOnline:
|
|
3846
|
-
isDocumentVisible:
|
|
3846
|
+
fetcher: Ta.fetcher,
|
|
3847
|
+
isOnline: Ta.isOnline,
|
|
3848
|
+
isDocumentVisible: Ta.isDocumentVisible
|
|
3847
3849
|
};
|
|
3848
|
-
function
|
|
3849
|
-
var r =
|
|
3850
|
-
r ? r.data.push(t) :
|
|
3850
|
+
function Fa(e, t, n) {
|
|
3851
|
+
var r = Ma.get(e);
|
|
3852
|
+
r ? r.data.push(t) : Ma.set(e, [t], n > 0 ? n + 5e3 : n);
|
|
3851
3853
|
}
|
|
3852
|
-
function
|
|
3854
|
+
function Ia(e, t, n) {
|
|
3853
3855
|
if (n.isDocumentVisible() && !(n.errorRetryCount !== void 0 && t > n.errorRetryCount)) {
|
|
3854
3856
|
var r = Math.min(t || 0, n.errorRetryCount), i = r * n.errorRetryInterval;
|
|
3855
3857
|
setTimeout(function() {
|
|
@@ -3860,17 +3862,17 @@ function wa(e, t, n) {
|
|
|
3860
3862
|
}, i);
|
|
3861
3863
|
}
|
|
3862
3864
|
}
|
|
3863
|
-
function
|
|
3865
|
+
function La(e) {
|
|
3864
3866
|
var t = e.shouldRetry, n = t === void 0 ? void 0 : t, r = e.error;
|
|
3865
|
-
return typeof n == "function" ? n(r) : typeof n == "boolean" ? n :
|
|
3867
|
+
return typeof n == "function" ? n(r) : typeof n == "boolean" ? n : Pa.shouldRetryOnError;
|
|
3866
3868
|
}
|
|
3867
|
-
var
|
|
3868
|
-
return n === void 0 && (n =
|
|
3869
|
+
var Ra = function(e, t, n, r) {
|
|
3870
|
+
return n === void 0 && (n = ja), r === void 0 && (r = Pa.ttl), Da(void 0, void 0, void 0, function() {
|
|
3869
3871
|
var i, a, o, s, c, l, u;
|
|
3870
|
-
return
|
|
3872
|
+
return Oa(this, function(d) {
|
|
3871
3873
|
switch (d.label) {
|
|
3872
3874
|
case 0:
|
|
3873
|
-
if (!
|
|
3875
|
+
if (!Ba(t)) return [3, 5];
|
|
3874
3876
|
d.label = 1;
|
|
3875
3877
|
case 1: return d.trys.push([
|
|
3876
3878
|
1,
|
|
@@ -3892,7 +3894,7 @@ var Ea = function(e, t, n, r) {
|
|
|
3892
3894
|
} catch (e) {
|
|
3893
3895
|
console.error("swrv(mutate): failed to set cache", e);
|
|
3894
3896
|
}
|
|
3895
|
-
return l =
|
|
3897
|
+
return l = Ma.get(e), l && l.data.length && (u = l.data.filter(function(t) {
|
|
3896
3898
|
return t.key === e;
|
|
3897
3899
|
}), u.forEach(function(e, t) {
|
|
3898
3900
|
c.data !== void 0 && (e.data = c.data), e.error = c.error, e.isValidating = c.isValidating, e.isLoading = c.isValidating, t !== u.length - 1 && delete u[t];
|
|
@@ -3901,16 +3903,16 @@ var Ea = function(e, t, n, r) {
|
|
|
3901
3903
|
});
|
|
3902
3904
|
});
|
|
3903
3905
|
};
|
|
3904
|
-
function
|
|
3906
|
+
function za() {
|
|
3905
3907
|
for (var e = this, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
|
|
3906
|
-
var r, i, a =
|
|
3907
|
-
if (!
|
|
3908
|
+
var r, i, a = Ea({}, Pa), o = !1, s = !1;
|
|
3909
|
+
if (!lt()) return console.error("useSWRV must be called inside setup() or an active effectScope()."), null;
|
|
3908
3910
|
var c = typeof window > "u" || typeof document > "u";
|
|
3909
|
-
t.length >= 1 && (r = t[0]), t.length >= 2 && (i = t[1]), t.length > 2 && (a =
|
|
3911
|
+
t.length >= 1 && (r = t[0]), t.length >= 2 && (i = t[1]), t.length > 2 && (a = Ea(Ea({}, a), t[2]));
|
|
3910
3912
|
var l = c ? a.serverTTL : a.ttl, u = typeof r == "function" ? r : E(r);
|
|
3911
3913
|
i === void 0 && (i = a.fetcher);
|
|
3912
3914
|
var d = null;
|
|
3913
|
-
d ||=
|
|
3915
|
+
d ||= pt({
|
|
3914
3916
|
data: void 0,
|
|
3915
3917
|
error: void 0,
|
|
3916
3918
|
isValidating: !0,
|
|
@@ -3918,32 +3920,32 @@ function Da() {
|
|
|
3918
3920
|
key: null
|
|
3919
3921
|
});
|
|
3920
3922
|
var f = function(t, n) {
|
|
3921
|
-
return
|
|
3923
|
+
return Da(e, void 0, void 0, function() {
|
|
3922
3924
|
var e, r, s, c, p, m, h, g = this;
|
|
3923
|
-
return
|
|
3925
|
+
return Oa(this, function(_) {
|
|
3924
3926
|
switch (_.label) {
|
|
3925
3927
|
case 0: return e = d.data === void 0, r = u.value, r ? (s = a.cache.get(r), c = s && s.data, d.isValidating = !0, d.isLoading = !c, c && (d.data = c.data, d.error = c.error), p = t || i, !p || !a.isDocumentVisible() && !e || n?.forceRevalidate !== void 0 && !n?.forceRevalidate || s && (m = !!(Date.now() - s.createdAt >= a.dedupingInterval || n?.forceRevalidate), !m) ? (d.isValidating = !1, d.isLoading = !1, [2]) : (h = function() {
|
|
3926
|
-
return
|
|
3928
|
+
return Da(g, void 0, void 0, function() {
|
|
3927
3929
|
var e, t, i, s, c, u;
|
|
3928
|
-
return
|
|
3930
|
+
return Oa(this, function(m) {
|
|
3929
3931
|
switch (m.label) {
|
|
3930
|
-
case 0: return e =
|
|
3932
|
+
case 0: return e = Na.get(r), e ? [3, 2] : (t = Array.isArray(r) ? r : [r], i = p.apply(void 0, Aa([], ka(t), !1)), Na.set(r, i, a.dedupingInterval), [4, Ra(r, i, a.cache, l)]);
|
|
3931
3933
|
case 1: return m.sent(), [3, 4];
|
|
3932
|
-
case 2: return [4,
|
|
3934
|
+
case 2: return [4, Ra(r, e.data, a.cache, l)];
|
|
3933
3935
|
case 3: m.sent(), m.label = 4;
|
|
3934
|
-
case 4: return d.isValidating = !1, d.isLoading = !1,
|
|
3936
|
+
case 4: return d.isValidating = !1, d.isLoading = !1, Na.delete(r), d.error !== void 0 && (s = La({
|
|
3935
3937
|
shouldRetry: a.shouldRetryOnError,
|
|
3936
3938
|
error: d.error
|
|
3937
|
-
}), c =
|
|
3939
|
+
}), c = La({
|
|
3938
3940
|
shouldRetry: !n || n.shouldRetryOnError,
|
|
3939
3941
|
error: d.error
|
|
3940
|
-
}), u = !o && s && c, u &&
|
|
3942
|
+
}), u = !o && s && c, u && Ia(f, n ? n.errorRetryCount : 1, a)), [2];
|
|
3941
3943
|
}
|
|
3942
3944
|
});
|
|
3943
3945
|
});
|
|
3944
3946
|
}, c && a.revalidateDebounce ? (setTimeout(function() {
|
|
3945
|
-
return
|
|
3946
|
-
return
|
|
3947
|
+
return Da(g, void 0, void 0, function() {
|
|
3948
|
+
return Oa(this, function(e) {
|
|
3947
3949
|
switch (e.label) {
|
|
3948
3950
|
case 0: return o ? [3, 2] : [4, h()];
|
|
3949
3951
|
case 1: e.sent(), e.label = 2;
|
|
@@ -3959,16 +3961,16 @@ function Da() {
|
|
|
3959
3961
|
});
|
|
3960
3962
|
});
|
|
3961
3963
|
}, p = function() {
|
|
3962
|
-
return
|
|
3963
|
-
return
|
|
3964
|
+
return Da(e, void 0, void 0, function() {
|
|
3965
|
+
return Oa(this, function(e) {
|
|
3964
3966
|
return [2, f(null, { shouldRetryOnError: !1 })];
|
|
3965
3967
|
});
|
|
3966
3968
|
});
|
|
3967
3969
|
}, m = null;
|
|
3968
3970
|
if (!c) {
|
|
3969
3971
|
var h = function() {
|
|
3970
|
-
return
|
|
3971
|
-
return
|
|
3972
|
+
return Da(e, void 0, void 0, function() {
|
|
3973
|
+
return Oa(this, function(e) {
|
|
3972
3974
|
switch (e.label) {
|
|
3973
3975
|
case 0: return d.error || !a.isOnline() ? [3, 2] : [4, f()];
|
|
3974
3976
|
case 1: return e.sent(), [3, 3];
|
|
@@ -3980,40 +3982,40 @@ function Da() {
|
|
|
3980
3982
|
};
|
|
3981
3983
|
a.refreshInterval && (m = setTimeout(h, a.refreshInterval)), a.revalidateOnFocus && (document.addEventListener("visibilitychange", p, !1), window.addEventListener("focus", p, !1));
|
|
3982
3984
|
}
|
|
3983
|
-
|
|
3985
|
+
ft(function() {
|
|
3984
3986
|
o = !0, m &&= (clearTimeout(m), null), !c && a.revalidateOnFocus && (document.removeEventListener("visibilitychange", p, !1), window.removeEventListener("focus", p, !1));
|
|
3985
|
-
var e =
|
|
3987
|
+
var e = Ma.get(u.value);
|
|
3986
3988
|
e && (e.data = e.data.filter(function(e) {
|
|
3987
3989
|
return e !== d;
|
|
3988
3990
|
}));
|
|
3989
3991
|
});
|
|
3990
3992
|
try {
|
|
3991
3993
|
O(u, function(e) {
|
|
3992
|
-
|
|
3994
|
+
ut(u) || (u.value = e), d.key = e, d.isValidating = !!e, Fa(u.value, d, l), !c && !s && u.value && f(), s = !1;
|
|
3993
3995
|
}, { immediate: !0 });
|
|
3994
3996
|
} catch {}
|
|
3995
|
-
return
|
|
3996
|
-
return f(e,
|
|
3997
|
+
return Ea(Ea({}, mt(d)), { mutate: function(e, t) {
|
|
3998
|
+
return f(e, Ea(Ea({}, t), { forceRevalidate: !0 }));
|
|
3997
3999
|
} });
|
|
3998
4000
|
}
|
|
3999
|
-
function
|
|
4001
|
+
function Ba(e) {
|
|
4000
4002
|
return typeof e == "object" && !!e && typeof e.then == "function";
|
|
4001
4003
|
}
|
|
4002
4004
|
// ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.45_typescript@6.0.3_/node_modules/swrv/esm/index.js
|
|
4003
|
-
var
|
|
4004
|
-
|
|
4005
|
-
function
|
|
4005
|
+
var Va = za;
|
|
4006
|
+
Va.default, Va.default;
|
|
4007
|
+
function Ha(e) {
|
|
4006
4008
|
return Array.isArray(e) ? [...e] : typeof e == "object" && e && (Object.getPrototypeOf(e) === Object.prototype || Object.getPrototypeOf(e) === null) ? { ...e } : e;
|
|
4007
4009
|
}
|
|
4008
|
-
function
|
|
4010
|
+
function Ua(e) {
|
|
4009
4011
|
if (typeof e != "object" || !e || !("parts" in e) || !Array.isArray(e.parts)) return e;
|
|
4010
4012
|
let t = e, n = {
|
|
4011
4013
|
...t,
|
|
4012
4014
|
parts: t.parts.map((e) => ({ ...e }))
|
|
4013
4015
|
};
|
|
4014
|
-
return "metadata" in t && (n.metadata =
|
|
4016
|
+
return "metadata" in t && (n.metadata = Ha(t.metadata)), n;
|
|
4015
4017
|
}
|
|
4016
|
-
var
|
|
4018
|
+
var Wa = class {
|
|
4017
4019
|
constructor({ initialMessages: e, messagesRef: t, statusRef: n, errorRef: r, queuedMessagesRef: i, throttleWaitMs: a }) {
|
|
4018
4020
|
this.publishedMessages = [], this.publishedMessageSources = [], this.dirtyMessageIndices = /* @__PURE__ */ new Set(), this.statusValue = "ready", this.queuedMessagesValue = [], this.hasPendingPublication = !1, this.isActive = !0, this.isPublishing = !1, this.pushMessage = (e) => {
|
|
4019
4021
|
this.messagesValue.push(e), this.dirtyMessageIndices.add(this.messagesValue.length - 1), this.schedulePublication();
|
|
@@ -4021,7 +4023,7 @@ var Ma = class {
|
|
|
4021
4023
|
this.messagesValue.pop(), this.schedulePublication();
|
|
4022
4024
|
}, this.replaceMessage = (e, t) => {
|
|
4023
4025
|
this.messagesValue[e] = t, this.dirtyMessageIndices.add(e), this.schedulePublication();
|
|
4024
|
-
}, this.snapshot =
|
|
4026
|
+
}, this.snapshot = Ua, this.handleIntervalEnd = () => {
|
|
4025
4027
|
this.timeout = void 0, this.isActive && this.hasPendingPublication && (this.hasPendingPublication = !1, this.publishMessages(), this.timeout = setTimeout(this.handleIntervalEnd, this.throttleWaitMs));
|
|
4026
4028
|
}, this.messagesValue = e, this.messagesRef = t, this.statusRef = n, this.errorRef = r, this.queuedMessagesRef = i, this.throttleWaitMs = a != null && Number.isFinite(a) && a > 0 ? a : void 0;
|
|
4027
4029
|
}
|
|
@@ -4069,7 +4071,7 @@ var Ma = class {
|
|
|
4069
4071
|
}
|
|
4070
4072
|
publishMessages() {
|
|
4071
4073
|
if (!this.isActive) return;
|
|
4072
|
-
let e = this.messagesValue.map((e, t) => this.dirtyMessageIndices.has(t) || this.publishedMessageSources[t] !== e ?
|
|
4074
|
+
let e = this.messagesValue.map((e, t) => this.dirtyMessageIndices.has(t) || this.publishedMessageSources[t] !== e ? Ua(e) : this.publishedMessages[t]);
|
|
4073
4075
|
this.publishedMessages = e, this.publishedMessageSources = [...this.messagesValue], this.dirtyMessageIndices.clear(), this.isPublishing = !0;
|
|
4074
4076
|
try {
|
|
4075
4077
|
this.messagesRef.value = e;
|
|
@@ -4077,7 +4079,7 @@ var Ma = class {
|
|
|
4077
4079
|
this.isPublishing = !1;
|
|
4078
4080
|
}
|
|
4079
4081
|
}
|
|
4080
|
-
},
|
|
4082
|
+
}, Ga = class extends ga {
|
|
4081
4083
|
constructor({ state: e, ...t }) {
|
|
4082
4084
|
super({
|
|
4083
4085
|
...t,
|
|
@@ -4085,13 +4087,13 @@ var Ma = class {
|
|
|
4085
4087
|
});
|
|
4086
4088
|
}
|
|
4087
4089
|
};
|
|
4088
|
-
function
|
|
4090
|
+
function Ka(e) {
|
|
4089
4091
|
let t = D([]), n = D("ready"), r = D(), i = D([]), a = D(), o;
|
|
4090
4092
|
return O(t, (e) => {
|
|
4091
4093
|
o != null && !o.isPublishing && o.setMessagesFromConsumer(e);
|
|
4092
|
-
}, { flush: "sync" }), O(() =>
|
|
4094
|
+
}, { flush: "sync" }), O(() => ht(e), (e) => {
|
|
4093
4095
|
o?.dispose();
|
|
4094
|
-
let { throttle: s, ...c } = e ?? {}, l = new
|
|
4096
|
+
let { throttle: s, ...c } = e ?? {}, l = new Wa({
|
|
4095
4097
|
initialMessages: c.messages ?? [],
|
|
4096
4098
|
messagesRef: t,
|
|
4097
4099
|
statusRef: n,
|
|
@@ -4099,14 +4101,14 @@ function Pa(e) {
|
|
|
4099
4101
|
queuedMessagesRef: i,
|
|
4100
4102
|
throttleWaitMs: s
|
|
4101
4103
|
});
|
|
4102
|
-
o = l, l.publishInitialState(), a.value = new
|
|
4104
|
+
o = l, l.publishInitialState(), a.value = new Ga({
|
|
4103
4105
|
...c,
|
|
4104
4106
|
state: l
|
|
4105
4107
|
});
|
|
4106
|
-
}, { immediate: !0 }),
|
|
4108
|
+
}, { immediate: !0 }), lt() != null && ft(() => {
|
|
4107
4109
|
o?.dispose();
|
|
4108
4110
|
}), {
|
|
4109
|
-
id:
|
|
4111
|
+
id: T(() => a.value.id),
|
|
4110
4112
|
status: n,
|
|
4111
4113
|
messages: t,
|
|
4112
4114
|
error: r,
|
|
@@ -4123,60 +4125,175 @@ function Pa(e) {
|
|
|
4123
4125
|
};
|
|
4124
4126
|
}
|
|
4125
4127
|
// ../../packages/composable/src/chatbot/useChatbotStore.ts
|
|
4126
|
-
var
|
|
4128
|
+
var qa = "voice-", Ja = 300, Ya = (e) => e?.role === "assistant" && e.parts.some((e) => e.state === "approval-requested"), Xa = (e) => e.replace(/\s+/g, " ").trim().toLowerCase(), Za = (e) => Xa(e.parts.filter((e) => e.type === "text").map((e) => "text" in e ? e.text : "").join(" ")), Qa = 8, $a = (e, t) => {
|
|
4127
4129
|
let n = new Set(t.map((e) => e.id)), r = e.filter((e) => e.role === "user" && !n.has(e.id)).map((e) => ({
|
|
4128
|
-
text:
|
|
4130
|
+
text: Za(e),
|
|
4129
4131
|
taken: !1
|
|
4130
4132
|
}));
|
|
4131
4133
|
return t.filter((e) => {
|
|
4132
4134
|
if (!e.id.startsWith("voice-") || e.role !== "user") return !1;
|
|
4133
|
-
let t =
|
|
4135
|
+
let t = Za(e), n = r.find((e) => !e.taken && e.text.length > 0 && (e.text === t || e.text.length >= Qa && t.endsWith(e.text)));
|
|
4134
4136
|
return !n || (n.taken = !0, !1);
|
|
4135
4137
|
});
|
|
4136
|
-
},
|
|
4138
|
+
}, eo = 12e4, to = 1e3, no = 5e3, ro = 100, io = 3e4, ao = 5e3, oo = 250, so = 1e3, co = "\n\n", lo = (e) => {
|
|
4137
4139
|
let t = e.type ?? "";
|
|
4138
4140
|
return t === "dynamic-tool" ? e.toolName ?? "" : t.startsWith("tool-") ? t.slice(5) : "";
|
|
4139
|
-
},
|
|
4141
|
+
}, uo = (e) => e?.role === "assistant" && e.parts.some((e) => Ue(lo(e)) && !e.providerExecuted && !Re.has(e.state ?? "")), fo = ({ messages: e }) => {
|
|
4140
4142
|
let t = e[e.length - 1];
|
|
4141
4143
|
if (!t || t.role !== "assistant") return !1;
|
|
4142
|
-
let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter((e) => !e.providerExecuted && (
|
|
4144
|
+
let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter((e) => !e.providerExecuted && (Ue(lo(e)) || qe(e)));
|
|
4143
4145
|
return r.length > 0 && r.every((e) => Re.has(e.state ?? ""));
|
|
4144
4146
|
};
|
|
4145
|
-
function
|
|
4146
|
-
return
|
|
4147
|
-
let { t, te: n, locale: r } =
|
|
4147
|
+
function po(e) {
|
|
4148
|
+
return bt(`chatbot-${e}`, () => {
|
|
4149
|
+
let { t, te: n, locale: r } = _t({ useScope: "global" }), i = E(""), a = E(), o = E(e), s = E(), c = E(), l = E(), u = E(), d = E(), f = E(), p = E(), m = E(), h = E(), g = E(), _ = E(), v = E(), y = E(), b = E(), ee = E(), te = E(), ne = D(), re = E(0), ie = E(0), ae = E(), oe = E(), se = E(), ce = D(), le = D(), ue = E(), de = E(), fe = D(), pe = E(!1), me = E({}), he = E({}), ge = E(!1), x = E(0), _e = E(), ve = E(!1), ye = yt(), be = T(() => {
|
|
4148
4150
|
let e = u.value?.theme;
|
|
4149
4151
|
return e && e !== "auto" || (e = _e.value), e ? e === "dark" : ye.value;
|
|
4150
|
-
}), S =
|
|
4152
|
+
}), S = T(() => c.value === "reasoning"), xe = T(() => S.value ? g.value?.filter((e) => ![
|
|
4151
4153
|
"upvote",
|
|
4152
4154
|
"downvote",
|
|
4153
4155
|
"feedback"
|
|
4154
|
-
].includes(e)) : g.value), Se =
|
|
4155
|
-
|
|
4156
|
-
Se.value ||=
|
|
4156
|
+
].includes(e)) : g.value), Se = Ie(T(() => `${o.value}-chatId`), null);
|
|
4157
|
+
gt(() => {
|
|
4158
|
+
Se.value ||= un();
|
|
4157
4159
|
});
|
|
4158
|
-
let C =
|
|
4160
|
+
let C = T({
|
|
4159
4161
|
get: () => Se.value,
|
|
4160
4162
|
set: (e) => {
|
|
4161
4163
|
Se.value = e;
|
|
4162
4164
|
}
|
|
4163
|
-
}), Ce =
|
|
4164
|
-
|
|
4165
|
-
|
|
4165
|
+
}), Ce = Fe(T(() => `${o.value}-pageAccessOff`), !1), we = T(() => Ce.value ? [] : ce.value ?? []), Te = () => Ce.value ? [] : le.value?.() ?? [], Ee = T(() => !!(ae.value && ce.value?.length)), De = E(), w = D([]), Oe = T(() => !!De.value && ot() && !Le()), ke = T(() => et() !== void 0), Ae = T(() => Oe.value && w.value.length > 0 ? nt({
|
|
4166
|
+
folders: () => w.value,
|
|
4167
|
+
attach: je,
|
|
4168
|
+
timeoutMs: De.value?.timeoutMs ?? 3e4,
|
|
4169
|
+
describe: (e, n) => {
|
|
4170
|
+
let r = at(n);
|
|
4171
|
+
return r ? t(`localFolders.step.${e}`, { name: r }) : void 0;
|
|
4172
|
+
}
|
|
4173
|
+
}) : []);
|
|
4174
|
+
async function je(e) {
|
|
4175
|
+
if (!_.value?.enabled) return "This agent does not take attachments.";
|
|
4176
|
+
let t = _.value.allowedMimeTypes ?? [];
|
|
4177
|
+
if (t.length > 0 && !t.includes(Ve(e.name, e.type, t))) return `This agent does not take "${e.name}" as an attachment: its type is not allowed.`;
|
|
4178
|
+
await Jr(e);
|
|
4179
|
+
let n = G.value.find((t) => t.file === e);
|
|
4180
|
+
return n ? n.state === "error" ? n.error ?? "The upload failed." : void 0 : "The message box already holds as many files as this chat allows.";
|
|
4181
|
+
}
|
|
4182
|
+
let Me = T(() => l.value ? `${l.value}:${o.value}` : void 0);
|
|
4183
|
+
async function Ne() {
|
|
4184
|
+
let e = Me.value;
|
|
4185
|
+
if (!Oe.value || !e) w.value = [];
|
|
4186
|
+
else try {
|
|
4187
|
+
let t = await Qe.load(e), n = await Promise.all(t.filter(({ handle: e }) => !Ge(e.name)).slice(0, 5).map(async ({ id: e, name: t, handle: n }) => {
|
|
4188
|
+
let r = await n.queryPermission?.({ mode: "read" }) ?? "prompt";
|
|
4189
|
+
return {
|
|
4190
|
+
id: e,
|
|
4191
|
+
name: t,
|
|
4192
|
+
source: "handle",
|
|
4193
|
+
permission: r,
|
|
4194
|
+
handle: n,
|
|
4195
|
+
root: r === "granted" ? Ze(n) : void 0
|
|
4196
|
+
};
|
|
4197
|
+
}));
|
|
4198
|
+
Me.value === e && (w.value = n);
|
|
4199
|
+
} catch (t) {
|
|
4200
|
+
ct.warn(t), Me.value === e && (w.value = []);
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
O([Oe, Me], Ne, { immediate: !0 });
|
|
4204
|
+
let Pe = T(() => w.value.length < 5), Re = E();
|
|
4205
|
+
async function Ue() {
|
|
4206
|
+
let e = et();
|
|
4207
|
+
if (!e || !Oe.value || !Pe.value) return;
|
|
4208
|
+
let t;
|
|
4209
|
+
try {
|
|
4210
|
+
t = await e({
|
|
4211
|
+
id: "agentstudio-folders",
|
|
4212
|
+
mode: "read"
|
|
4213
|
+
});
|
|
4214
|
+
} catch {
|
|
4215
|
+
return;
|
|
4216
|
+
}
|
|
4217
|
+
if (Re.value = Ge(t.name) ? t.name : void 0, Re.value) return;
|
|
4218
|
+
for (let e of w.value) if (await e.handle?.isSameEntry?.(t)) {
|
|
4219
|
+
w.value = w.value.map((n) => n.id === e.id ? {
|
|
4220
|
+
...n,
|
|
4221
|
+
permission: "granted",
|
|
4222
|
+
root: Ze(t)
|
|
4223
|
+
} : n);
|
|
4224
|
+
return;
|
|
4225
|
+
}
|
|
4226
|
+
let n = {
|
|
4227
|
+
id: un(),
|
|
4228
|
+
name: tt(t.name, w.value.map(({ name: e }) => e)),
|
|
4229
|
+
source: "handle",
|
|
4230
|
+
permission: "granted",
|
|
4231
|
+
handle: t,
|
|
4232
|
+
root: Ze(t)
|
|
4233
|
+
};
|
|
4234
|
+
if (w.value = [...w.value, n], Me.value) try {
|
|
4235
|
+
await Qe.save(Me.value, {
|
|
4236
|
+
id: n.id,
|
|
4237
|
+
name: n.name,
|
|
4238
|
+
handle: t
|
|
4239
|
+
});
|
|
4240
|
+
} catch (e) {
|
|
4241
|
+
ct.warn(e);
|
|
4242
|
+
}
|
|
4243
|
+
}
|
|
4244
|
+
function Je(e) {
|
|
4245
|
+
if (!Oe.value || !Pe.value) return;
|
|
4246
|
+
let t = Array.from(e)[0]?.webkitRelativePath.split("/")[0];
|
|
4247
|
+
Re.value = t && Ge(t) ? t : void 0;
|
|
4248
|
+
let n = [], r = 5 - w.value.length;
|
|
4249
|
+
for (let t of rt(e).slice(0, r)) n.push({
|
|
4250
|
+
id: un(),
|
|
4251
|
+
name: tt(t.name, [...w.value.map(({ name: e }) => e), ...n.map(({ name: e }) => e)]),
|
|
4252
|
+
source: "snapshot",
|
|
4253
|
+
permission: "granted",
|
|
4254
|
+
root: t
|
|
4255
|
+
});
|
|
4256
|
+
w.value = [...w.value, ...n];
|
|
4257
|
+
}
|
|
4258
|
+
async function Ye(e) {
|
|
4259
|
+
let t = w.value.find((t) => t.id === e);
|
|
4260
|
+
if (!t?.handle?.requestPermission) return;
|
|
4261
|
+
let n;
|
|
4262
|
+
try {
|
|
4263
|
+
n = await t.handle.requestPermission({ mode: "read" });
|
|
4264
|
+
} catch {
|
|
4265
|
+
return;
|
|
4266
|
+
}
|
|
4267
|
+
w.value = w.value.map((t) => t.id === e ? {
|
|
4268
|
+
...t,
|
|
4269
|
+
permission: n,
|
|
4270
|
+
root: n === "granted" && t.handle ? Ze(t.handle) : void 0
|
|
4271
|
+
} : t);
|
|
4272
|
+
}
|
|
4273
|
+
async function lt(e) {
|
|
4274
|
+
if (w.value = w.value.filter((t) => t.id !== e), Me.value) try {
|
|
4275
|
+
await Qe.remove(Me.value, e);
|
|
4276
|
+
} catch (e) {
|
|
4277
|
+
ct.warn(e);
|
|
4278
|
+
}
|
|
4166
4279
|
}
|
|
4167
|
-
let
|
|
4168
|
-
|
|
4280
|
+
let ut = Ie(T(() => `${o.value}-${l.value ?? "anonymous"}-confirmations`), "manual"), mt = T(() => oe.value?.allowAutomatic === !0), ht = T(() => mt.value && ut.value === "automatic" ? "automatic" : "manual");
|
|
4281
|
+
function bt(e) {
|
|
4282
|
+
ut.value = e;
|
|
4283
|
+
}
|
|
4284
|
+
let wt = T(() => !!fe.value && ae.value?.pointer === !0 && we.value.length > 0);
|
|
4285
|
+
O(wt, (e) => {
|
|
4169
4286
|
e || (de.value = void 0);
|
|
4170
4287
|
});
|
|
4171
|
-
let
|
|
4288
|
+
let Ot = Ie(T(() => `${o.value}-pageNotice`), null), kt = T(() => {
|
|
4172
4289
|
let e = ae.value?.level;
|
|
4173
|
-
return e && e !==
|
|
4290
|
+
return e && e !== He.Off && we.value.length && !Xe(Ot.value ?? void 0, e) ? e : void 0;
|
|
4174
4291
|
});
|
|
4175
|
-
function
|
|
4176
|
-
|
|
4292
|
+
function k() {
|
|
4293
|
+
Ot.value = ae.value?.level ?? null;
|
|
4177
4294
|
}
|
|
4178
|
-
let
|
|
4179
|
-
function
|
|
4295
|
+
let At = E(), jt = E(!1), Mt = T(() => At.value?.message?.toLowerCase().includes("conversation-blocked") ?? !1);
|
|
4296
|
+
function Nt(e) {
|
|
4180
4297
|
try {
|
|
4181
4298
|
let t = JSON.parse(e.message);
|
|
4182
4299
|
return t.status === 404 || t.type?.includes("entity-not-found");
|
|
@@ -4184,45 +4301,45 @@ function eo(e) {
|
|
|
4184
4301
|
return !1;
|
|
4185
4302
|
}
|
|
4186
4303
|
}
|
|
4187
|
-
function
|
|
4188
|
-
if (
|
|
4189
|
-
let e =
|
|
4190
|
-
C.value =
|
|
4191
|
-
|
|
4304
|
+
function Pt(e) {
|
|
4305
|
+
if (Nt(e) && !B.value) {
|
|
4306
|
+
let e = L.value.messages.filter((e) => e.role === "user"), t = e[e.length - 1], n = t ? $e(t) : void 0;
|
|
4307
|
+
C.value = un(), At.value = void 0, dt(() => {
|
|
4308
|
+
L.value.clearError(), n && L.value.sendMessage({ text: n });
|
|
4192
4309
|
});
|
|
4193
|
-
} else
|
|
4310
|
+
} else ct.error(e), At.value = e, Mt.value && (jt.value = !0);
|
|
4194
4311
|
}
|
|
4195
|
-
let
|
|
4312
|
+
let A = T(() => Be({
|
|
4196
4313
|
baseUrl: i.value,
|
|
4197
4314
|
basePath: a.value,
|
|
4198
4315
|
headers: () => p.value
|
|
4199
|
-
})),
|
|
4200
|
-
...
|
|
4201
|
-
...
|
|
4202
|
-
}),
|
|
4316
|
+
})), Ft = E(null), It = () => ({
|
|
4317
|
+
...xt(),
|
|
4318
|
+
...Ft.value ?? {}
|
|
4319
|
+
}), Lt = () => {
|
|
4203
4320
|
let e = x.value;
|
|
4204
4321
|
return new Promise((t) => {
|
|
4205
4322
|
let n = setTimeout(() => {
|
|
4206
4323
|
r(), t(!1);
|
|
4207
|
-
}, 3e4), r = O(() => [x.value,
|
|
4324
|
+
}, 3e4), r = O(() => [x.value, L.value.status], ([i, a]) => {
|
|
4208
4325
|
i > e && a === "streaming" && (clearTimeout(n), r(), t(!0));
|
|
4209
4326
|
});
|
|
4210
4327
|
});
|
|
4211
|
-
},
|
|
4212
|
-
|
|
4328
|
+
}, j = D(), Rt = (e, t) => new Promise((n) => {
|
|
4329
|
+
j.value?.answer(!1), j.value = {
|
|
4213
4330
|
toolCallId: e.toolCallId,
|
|
4214
4331
|
question: t?.question,
|
|
4215
4332
|
details: t?.details,
|
|
4216
4333
|
unchanged: t?.unchanged,
|
|
4217
4334
|
answer: (e) => {
|
|
4218
|
-
|
|
4335
|
+
j.value = void 0, n(e);
|
|
4219
4336
|
}
|
|
4220
4337
|
};
|
|
4221
4338
|
});
|
|
4222
|
-
function
|
|
4223
|
-
|
|
4339
|
+
function zt(e) {
|
|
4340
|
+
j.value?.answer(e);
|
|
4224
4341
|
}
|
|
4225
|
-
let
|
|
4342
|
+
let Bt = (e, t) => {
|
|
4226
4343
|
t.details?.some((e) => e.before !== void 0) && (he.value = {
|
|
4227
4344
|
...he.value,
|
|
4228
4345
|
[e.toolCallId]: {
|
|
@@ -4230,16 +4347,24 @@ function eo(e) {
|
|
|
4230
4347
|
unchanged: t.unchanged
|
|
4231
4348
|
}
|
|
4232
4349
|
});
|
|
4233
|
-
},
|
|
4350
|
+
}, Vt = ({ forms: e }) => ae.value && we.value.length ? {
|
|
4234
4351
|
version: 1,
|
|
4235
|
-
features: [...
|
|
4352
|
+
features: [...We],
|
|
4236
4353
|
forms: e ? Te().map(({ name: e, description: t, inputSchema: n, annotations: r }) => ({
|
|
4237
4354
|
name: e,
|
|
4238
4355
|
description: t,
|
|
4239
4356
|
inputSchema: n,
|
|
4240
4357
|
annotations: r
|
|
4241
4358
|
})) : []
|
|
4242
|
-
} : void 0,
|
|
4359
|
+
} : void 0, Ht = (e) => {
|
|
4360
|
+
if (e?.provider === "folder") {
|
|
4361
|
+
let t = Ae.value.find((t) => t.name === e.toolName)?.describe?.(e.input);
|
|
4362
|
+
t && (me.value = {
|
|
4363
|
+
...me.value,
|
|
4364
|
+
[e.toolCallId]: t
|
|
4365
|
+
}), ue.value = void 0;
|
|
4366
|
+
return;
|
|
4367
|
+
}
|
|
4243
4368
|
if (e?.provider !== "page") {
|
|
4244
4369
|
ue.value = void 0;
|
|
4245
4370
|
return;
|
|
@@ -4254,29 +4379,30 @@ function eo(e) {
|
|
|
4254
4379
|
...me.value,
|
|
4255
4380
|
[e.toolCallId]: n
|
|
4256
4381
|
}), e.readOnly ? ue.value = void 0 : (ue.value = { title: n ?? t?.annotations?.title ?? e.toolName }, ge.value = !0);
|
|
4257
|
-
},
|
|
4382
|
+
}, Ut = Dt({
|
|
4258
4383
|
registry: () => [
|
|
4259
|
-
...(ne.value ?? []).filter((e) => !
|
|
4384
|
+
...(ne.value ?? []).filter((e) => !Ke(e.name)),
|
|
4260
4385
|
...we.value,
|
|
4261
|
-
...Te()
|
|
4386
|
+
...Te(),
|
|
4387
|
+
...Ae.value
|
|
4262
4388
|
],
|
|
4263
4389
|
capability: () => te.value,
|
|
4264
|
-
addToolOutput: (e) => void
|
|
4265
|
-
confirm:
|
|
4266
|
-
waitForResume:
|
|
4390
|
+
addToolOutput: (e) => void L.value.addToolOutput(e),
|
|
4391
|
+
confirm: Rt,
|
|
4392
|
+
waitForResume: Lt,
|
|
4267
4393
|
onPendingChange: (e) => {
|
|
4268
4394
|
re.value = e;
|
|
4269
4395
|
},
|
|
4270
|
-
onActivity:
|
|
4271
|
-
mode: () =>
|
|
4272
|
-
onSkip:
|
|
4273
|
-
}),
|
|
4274
|
-
let n =
|
|
4275
|
-
|
|
4276
|
-
},
|
|
4396
|
+
onActivity: Ht,
|
|
4397
|
+
mode: () => ht.value,
|
|
4398
|
+
onSkip: Bt
|
|
4399
|
+
}), M = /* @__PURE__ */ new Map(), Wt = 0, Gt = (e, t) => {
|
|
4400
|
+
let n = M.get(e);
|
|
4401
|
+
M.delete(e), n?.(JSON.stringify(t));
|
|
4402
|
+
}, Kt = Dt({
|
|
4277
4403
|
registry: () => we.value,
|
|
4278
4404
|
capability: () => te.value,
|
|
4279
|
-
addToolOutput: (e) =>
|
|
4405
|
+
addToolOutput: (e) => Gt(e.toolCallId, "output" in e ? e.output : {
|
|
4280
4406
|
content: [{
|
|
4281
4407
|
type: "text",
|
|
4282
4408
|
text: e.errorText
|
|
@@ -4284,42 +4410,42 @@ function eo(e) {
|
|
|
4284
4410
|
isError: !0
|
|
4285
4411
|
}),
|
|
4286
4412
|
confirm: async (e, t) => {
|
|
4287
|
-
for (;
|
|
4288
|
-
let t = O(
|
|
4413
|
+
for (; j.value;) await new Promise((e) => {
|
|
4414
|
+
let t = O(j, (n) => {
|
|
4289
4415
|
n || (t(), e());
|
|
4290
4416
|
});
|
|
4291
4417
|
});
|
|
4292
|
-
return
|
|
4418
|
+
return M.has(e.toolCallId) ? Rt(e, t) : !1;
|
|
4293
4419
|
},
|
|
4294
|
-
waitForResume: () => new Promise((e) => setTimeout(() => e(!0),
|
|
4420
|
+
waitForResume: () => new Promise((e) => setTimeout(() => e(!0), Ja)),
|
|
4295
4421
|
onPendingChange: (e) => {
|
|
4296
4422
|
ie.value = e;
|
|
4297
4423
|
},
|
|
4298
|
-
onActivity:
|
|
4299
|
-
mode: () =>
|
|
4300
|
-
}),
|
|
4301
|
-
function
|
|
4302
|
-
|
|
4303
|
-
let e =
|
|
4424
|
+
onActivity: Ht,
|
|
4425
|
+
mode: () => qt
|
|
4426
|
+
}), qt = "manual";
|
|
4427
|
+
function Jt() {
|
|
4428
|
+
qt = ht.value;
|
|
4429
|
+
let e = Vt({ forms: !1 });
|
|
4304
4430
|
if (e) return {
|
|
4305
4431
|
declaration: e,
|
|
4306
4432
|
clientTools: Object.fromEntries(we.value.map((e) => [e.name, (t) => new Promise((n) => {
|
|
4307
|
-
|
|
4308
|
-
let r = `page-call-${
|
|
4309
|
-
|
|
4433
|
+
Wt += 1;
|
|
4434
|
+
let r = `page-call-${Wt}`;
|
|
4435
|
+
M.set(r, n), Kt.enqueue({
|
|
4310
4436
|
toolCallId: r,
|
|
4311
4437
|
toolName: e.name,
|
|
4312
4438
|
input: t ?? {},
|
|
4313
|
-
messageId:
|
|
4439
|
+
messageId: R()?.id ?? "",
|
|
4314
4440
|
readOnly: e.annotations?.readOnlyHint === !0,
|
|
4315
4441
|
provider: "page"
|
|
4316
4442
|
});
|
|
4317
4443
|
})]))
|
|
4318
4444
|
};
|
|
4319
4445
|
}
|
|
4320
|
-
function
|
|
4321
|
-
|
|
4322
|
-
for (let e of [...
|
|
4446
|
+
function Yt() {
|
|
4447
|
+
Kt.cancelAll(), j.value && M.has(j.value.toolCallId) && j.value.answer(!1);
|
|
4448
|
+
for (let e of [...M.keys()]) Gt(e, {
|
|
4323
4449
|
content: [{
|
|
4324
4450
|
type: "text",
|
|
4325
4451
|
text: "Stopped by the user."
|
|
@@ -4327,34 +4453,34 @@ function eo(e) {
|
|
|
4327
4453
|
isError: !0
|
|
4328
4454
|
});
|
|
4329
4455
|
}
|
|
4330
|
-
async function
|
|
4331
|
-
|
|
4456
|
+
async function Xt() {
|
|
4457
|
+
Zt(), Yt(), ue.value = void 0, ge.value = !1, K.value = "", await L.value.stop();
|
|
4332
4458
|
}
|
|
4333
|
-
function
|
|
4334
|
-
|
|
4459
|
+
function Zt() {
|
|
4460
|
+
Ut.cancelAll(), j.value && !M.has(j.value.toolCallId) && j.value.answer(!1);
|
|
4335
4461
|
}
|
|
4336
|
-
async function
|
|
4337
|
-
Ce.value = e, e && await
|
|
4462
|
+
async function Qt(e) {
|
|
4463
|
+
Ce.value = e, e && await Xt();
|
|
4338
4464
|
}
|
|
4339
|
-
O(C, () =>
|
|
4340
|
-
let
|
|
4341
|
-
function
|
|
4342
|
-
|
|
4343
|
-
...
|
|
4465
|
+
O(C, () => Zt(), { flush: "sync" });
|
|
4466
|
+
let $t = !1, N, P = E(), en, tn = E([]), F = E([]), I = E([]), nn = E({}), rn = /* @__PURE__ */ new Map(), an = /* @__PURE__ */ new Set();
|
|
4467
|
+
function on(e, t, n) {
|
|
4468
|
+
F.value.includes(e) || (F.value = [...F.value, e]), rn.set(e, Date.now()), n ? an.add(e) : an.delete(e), t && (nn.value = {
|
|
4469
|
+
...nn.value,
|
|
4344
4470
|
[e]: t
|
|
4345
|
-
}),
|
|
4471
|
+
}), Y || Ar();
|
|
4346
4472
|
}
|
|
4347
|
-
function
|
|
4348
|
-
|
|
4473
|
+
function sn(e) {
|
|
4474
|
+
nn.value = Object.fromEntries(Object.entries(nn.value).filter(([t]) => t !== e));
|
|
4349
4475
|
}
|
|
4350
|
-
function
|
|
4351
|
-
|
|
4476
|
+
function cn(e) {
|
|
4477
|
+
rn.delete(e), F.value = F.value.filter((t) => t !== e), I.value = I.value.filter((t) => t !== e), sn(e);
|
|
4352
4478
|
}
|
|
4353
|
-
let
|
|
4479
|
+
let ln = Ka(() => ({
|
|
4354
4480
|
id: C.value,
|
|
4355
|
-
transport: new
|
|
4356
|
-
api:
|
|
4357
|
-
prepareReconnectToStreamRequest: ({ id: e }) => ({ api:
|
|
4481
|
+
transport: new ha({
|
|
4482
|
+
api: A.value.getChatEndpoint(o.value, S.value ? "reasoning" : "chat"),
|
|
4483
|
+
prepareReconnectToStreamRequest: ({ id: e }) => ({ api: A.value.getChatStreamEndpoint(o.value, e) }),
|
|
4358
4484
|
prepareSendMessagesRequest: ({ messages: e, id: t }) => ({ body: {
|
|
4359
4485
|
id: t,
|
|
4360
4486
|
messages: [e[e.length - 1]],
|
|
@@ -4369,61 +4495,62 @@ function eo(e) {
|
|
|
4369
4495
|
reasoning: d.value?.reasoning,
|
|
4370
4496
|
webSearch: f.value?.webSearch,
|
|
4371
4497
|
smoothStream: u.value?.smoothStream,
|
|
4372
|
-
deviceContext:
|
|
4498
|
+
deviceContext: It(),
|
|
4373
4499
|
externalContext: ee.value,
|
|
4374
4500
|
disabledTools: f.value?.disabled,
|
|
4375
4501
|
fallbackModels: y.value,
|
|
4376
4502
|
gatewayOptions: b.value,
|
|
4377
|
-
hostTools:
|
|
4378
|
-
pageTools:
|
|
4379
|
-
|
|
4380
|
-
...
|
|
4503
|
+
hostTools: Et(ne.value, te.value),
|
|
4504
|
+
pageTools: Vt({ forms: !0 }),
|
|
4505
|
+
localFolders: Oe.value ? it(w.value) : void 0,
|
|
4506
|
+
...xn(t) && { projectId: xn(t) },
|
|
4507
|
+
...ht.value === "automatic" && { confirmations: "automatic" }
|
|
4381
4508
|
} }),
|
|
4382
4509
|
credentials: "include",
|
|
4383
4510
|
headers: () => p.value ?? {}
|
|
4384
4511
|
}),
|
|
4385
|
-
sendAutomaticallyWhen: (e) => !
|
|
4512
|
+
sendAutomaticallyWhen: (e) => !B.value && (fo(e) || _a(e)),
|
|
4386
4513
|
onError: (e) => {
|
|
4387
|
-
|
|
4514
|
+
$t ? ct.warn(e) : Pt(e);
|
|
4388
4515
|
},
|
|
4389
4516
|
onToolCall: ({ toolCall: e }) => {
|
|
4390
|
-
if (!
|
|
4517
|
+
if (!Tt(e) || $t || B.value) return;
|
|
4391
4518
|
let t = e;
|
|
4392
|
-
|
|
4519
|
+
Ut.enqueue({
|
|
4393
4520
|
toolCallId: t.toolCallId,
|
|
4394
4521
|
toolName: t.toolName,
|
|
4395
4522
|
input: t.input,
|
|
4396
|
-
messageId:
|
|
4523
|
+
messageId: R()?.id ?? "",
|
|
4397
4524
|
readOnly: t.toolMetadata?.readOnly === !0,
|
|
4398
|
-
provider: t.toolMetadata?.provider === "page"
|
|
4525
|
+
provider: t.toolMetadata?.provider === "page" || t.toolMetadata?.provider === "folder" ? t.toolMetadata.provider : "app"
|
|
4399
4526
|
});
|
|
4400
4527
|
},
|
|
4401
4528
|
onData: (e) => {
|
|
4402
|
-
e.type === "data-turnStream" ?
|
|
4529
|
+
e.type === "data-turnStream" ? en = e.data.streamId : e.type === "data-audioTranscripts" && (L.value.messages = st(L.value.messages, e.data));
|
|
4403
4530
|
},
|
|
4404
4531
|
onFinish: () => {
|
|
4405
4532
|
let e = C.value;
|
|
4406
|
-
!S.value && !
|
|
4533
|
+
!S.value && !V.value.some((t) => t.id === e) && Yn(o.value);
|
|
4407
4534
|
}
|
|
4408
|
-
})),
|
|
4535
|
+
})), L = T(() => pt(ln)), R = () => L.value.messages[L.value.messages.length - 1];
|
|
4409
4536
|
O(C, (e, t) => {
|
|
4410
|
-
if (t && !S.value && (q() ||
|
|
4411
|
-
let e =
|
|
4412
|
-
|
|
4537
|
+
if (t && !S.value && (q() || N?.chatId === t)) {
|
|
4538
|
+
let e = L.value.messages.filter((e) => e.role === "user"), n = e[e.length - 1];
|
|
4539
|
+
on(t, n ? $e(n) ?? "" : "", L.value.status === "streaming" || N?.chatId === t);
|
|
4413
4540
|
}
|
|
4414
|
-
|
|
4541
|
+
cn(e), en = void 0, clearTimeout(Tr), wr.value = !1, L.value.stop();
|
|
4415
4542
|
}, { flush: "sync" });
|
|
4416
|
-
let
|
|
4543
|
+
let dn = T(() => {
|
|
4417
4544
|
let e = u.value?.initialMessage;
|
|
4418
4545
|
return e?.[r.value] ? e[r.value] : n("message.defaultAgentWelcome") ? t("message.defaultAgentWelcome") : "";
|
|
4419
|
-
}),
|
|
4420
|
-
id:
|
|
4546
|
+
}), fn = un(), pn = T(() => ({
|
|
4547
|
+
id: fn,
|
|
4421
4548
|
role: "assistant",
|
|
4422
4549
|
parts: [{
|
|
4423
4550
|
type: "text",
|
|
4424
|
-
text:
|
|
4551
|
+
text: dn.value
|
|
4425
4552
|
}]
|
|
4426
|
-
})),
|
|
4553
|
+
})), mn = T(() => {
|
|
4427
4554
|
let e = (e) => e.map((e) => e.role !== "user" || !e.parts.some((e) => e.type === "file") ? e : {
|
|
4428
4555
|
...e,
|
|
4429
4556
|
parts: e.parts.map((e) => {
|
|
@@ -4433,177 +4560,177 @@ function eo(e) {
|
|
|
4433
4560
|
let e = t.url.slice(13);
|
|
4434
4561
|
return {
|
|
4435
4562
|
...t,
|
|
4436
|
-
url:
|
|
4563
|
+
url: A.value.getMediaUrl(o.value, C.value, e)
|
|
4437
4564
|
};
|
|
4438
4565
|
}
|
|
4439
4566
|
return t.url.startsWith("blob:") ? t : {
|
|
4440
4567
|
...t,
|
|
4441
|
-
url:
|
|
4568
|
+
url: A.value.appendAuthToken(t.url)
|
|
4442
4569
|
};
|
|
4443
4570
|
})
|
|
4444
|
-
}), t =
|
|
4445
|
-
return S.value ? e(t) : !ve.value && t[0]?.role !== "assistant" ? [
|
|
4446
|
-
}),
|
|
4571
|
+
}), t = L.value.id === C.value ? L.value.messages : [];
|
|
4572
|
+
return S.value ? e(t) : !ve.value && t[0]?.role !== "assistant" ? [pn.value, ...e(t)] : e(t);
|
|
4573
|
+
}), hn = T(() => {
|
|
4447
4574
|
let e = u.value?.messagePlaceholder;
|
|
4448
4575
|
return e?.[r.value] ? e[r.value] : n("placeholder.askAnything") ? t("placeholder.askAnything") : "";
|
|
4449
|
-
}),
|
|
4450
|
-
function
|
|
4451
|
-
|
|
4576
|
+
}), gn = E(!1), _n = E();
|
|
4577
|
+
function z(e, t) {
|
|
4578
|
+
_n.value = {
|
|
4452
4579
|
chatId: e,
|
|
4453
4580
|
authorId: t.authorId,
|
|
4454
4581
|
projectId: t.projectId ?? void 0
|
|
4455
4582
|
};
|
|
4456
4583
|
}
|
|
4457
|
-
let
|
|
4458
|
-
let t =
|
|
4584
|
+
let vn = (e) => _n.value?.chatId === e ? _n.value : void 0, yn = T(() => vn(C.value)?.authorId), bn = T(() => vn(C.value)?.projectId), B = T(() => yn.value !== void 0 && l.value !== void 0 && yn.value !== l.value), xn = (e) => {
|
|
4585
|
+
let t = vn(e);
|
|
4459
4586
|
return t && t.authorId === void 0 ? t.projectId : void 0;
|
|
4460
|
-
},
|
|
4461
|
-
function
|
|
4462
|
-
let n = Object.fromEntries(Object.entries(
|
|
4463
|
-
|
|
4587
|
+
}, Sn = () => gn.value ? { projectId: ze } : void 0, V = E([]), Cn = E(!1), wn = E(1), Tn = E(!1), En = E(!1), Dn, On = E([]), kn = E(!1), An = E("chat"), jn = E(0), Mn = E([]), Nn = E(), H = E(!1), Pn = E(!1), Fn = E(), In = E(!1), Ln = E(!1), U = E(), W = E(""), G = E([]), K = E(""), Rn = E(!0), zn = D(), Bn = E(0), Vn = Fe(T(() => `${o.value}-queue`), {}), Hn = T(() => Vn.value[C.value] ?? []), Un = T(() => !S.value);
|
|
4588
|
+
function Wn(e, t) {
|
|
4589
|
+
let n = Object.fromEntries(Object.entries(Vn.value).filter(([t]) => t !== e));
|
|
4590
|
+
Vn.value = t.length > 0 ? {
|
|
4464
4591
|
...n,
|
|
4465
4592
|
[e]: t
|
|
4466
4593
|
} : n;
|
|
4467
4594
|
}
|
|
4468
|
-
function
|
|
4469
|
-
let t = (
|
|
4470
|
-
return
|
|
4595
|
+
function Gn(e) {
|
|
4596
|
+
let t = (Vn.value[e] ?? []).join(co);
|
|
4597
|
+
return Wn(e, []), t;
|
|
4471
4598
|
}
|
|
4472
|
-
function
|
|
4473
|
-
e && (
|
|
4599
|
+
function Kn(e) {
|
|
4600
|
+
e && (W.value = W.value ? `${W.value}${co}${e}` : e);
|
|
4474
4601
|
}
|
|
4475
|
-
function
|
|
4476
|
-
|
|
4602
|
+
function qn(e) {
|
|
4603
|
+
Wn(C.value, Hn.value.filter((t, n) => n !== e));
|
|
4477
4604
|
}
|
|
4478
|
-
function
|
|
4479
|
-
let t =
|
|
4480
|
-
|
|
4605
|
+
function Jn(e) {
|
|
4606
|
+
let t = Hn.value[e];
|
|
4607
|
+
qn(e), Kn(t ?? "");
|
|
4481
4608
|
}
|
|
4482
|
-
async function
|
|
4483
|
-
if (S.value)
|
|
4609
|
+
async function Yn(e) {
|
|
4610
|
+
if (S.value) V.value = [];
|
|
4484
4611
|
else {
|
|
4485
|
-
|
|
4612
|
+
Cn.value = !0;
|
|
4486
4613
|
try {
|
|
4487
|
-
let t = await
|
|
4614
|
+
let t = await A.value.getConversations(e, l.value, Sn()), n = new Set(t.map((e) => e.id)), r = F.value.filter((e) => !n.has(e) && nn.value[e]).map((t) => ({
|
|
4488
4615
|
id: t,
|
|
4489
4616
|
agentId: e,
|
|
4490
|
-
title:
|
|
4617
|
+
title: nn.value[t],
|
|
4491
4618
|
summary: null,
|
|
4492
4619
|
messages: [],
|
|
4493
4620
|
lastMessageAt: /* @__PURE__ */ new Date()
|
|
4494
4621
|
})), i = `${e}:${l.value ?? ""}`;
|
|
4495
|
-
i !==
|
|
4496
|
-
let a = new Set(r.map((e) => e.id)), o =
|
|
4497
|
-
|
|
4622
|
+
i !== Dn && (wn.value = 1);
|
|
4623
|
+
let a = new Set(r.map((e) => e.id)), o = wn.value > 1 ? V.value.filter((e) => !n.has(e.id) && !a.has(e.id)) : [];
|
|
4624
|
+
V.value = [
|
|
4498
4625
|
...r,
|
|
4499
4626
|
...t,
|
|
4500
4627
|
...o
|
|
4501
|
-
],
|
|
4628
|
+
], Dn = i, wn.value === 1 && (Tn.value = t.length >= 100);
|
|
4502
4629
|
} catch {
|
|
4503
|
-
|
|
4630
|
+
V.value = [], wn.value = 1, Dn = void 0, Tn.value = !1;
|
|
4504
4631
|
return;
|
|
4505
4632
|
} finally {
|
|
4506
|
-
|
|
4633
|
+
Cn.value = !1;
|
|
4507
4634
|
}
|
|
4508
|
-
|
|
4635
|
+
Mr([.../* @__PURE__ */ new Set([...Er(), ...V.value.map((e) => e.id)])]);
|
|
4509
4636
|
}
|
|
4510
4637
|
}
|
|
4511
|
-
async function
|
|
4512
|
-
if (!
|
|
4513
|
-
|
|
4514
|
-
let e =
|
|
4638
|
+
async function Xn() {
|
|
4639
|
+
if (!Tn.value || En.value || S.value) return;
|
|
4640
|
+
En.value = !0;
|
|
4641
|
+
let e = Dn;
|
|
4515
4642
|
try {
|
|
4516
|
-
let t =
|
|
4517
|
-
...
|
|
4643
|
+
let t = wn.value + 1, n = await A.value.getConversations(o.value, l.value, {
|
|
4644
|
+
...Sn(),
|
|
4518
4645
|
page: t
|
|
4519
4646
|
});
|
|
4520
|
-
if (e !==
|
|
4521
|
-
let r = new Set(
|
|
4522
|
-
|
|
4647
|
+
if (e !== Dn) return;
|
|
4648
|
+
let r = new Set(V.value.map((e) => e.id));
|
|
4649
|
+
V.value = [...V.value, ...n.filter((e) => !r.has(e.id))], wn.value = t, Tn.value = n.length >= 100;
|
|
4523
4650
|
} catch {} finally {
|
|
4524
|
-
|
|
4651
|
+
En.value = !1;
|
|
4525
4652
|
}
|
|
4526
4653
|
}
|
|
4527
|
-
async function
|
|
4528
|
-
return S.value ? [] :
|
|
4654
|
+
async function Zn(e) {
|
|
4655
|
+
return S.value ? [] : A.value.getConversations(o.value, l.value, { search: e });
|
|
4529
4656
|
}
|
|
4530
|
-
async function
|
|
4657
|
+
async function Qn() {
|
|
4531
4658
|
let e = C.value;
|
|
4532
|
-
if (!e)
|
|
4659
|
+
if (!e) On.value = [];
|
|
4533
4660
|
else {
|
|
4534
|
-
|
|
4661
|
+
kn.value = !0;
|
|
4535
4662
|
try {
|
|
4536
|
-
|
|
4663
|
+
On.value = await A.value.getChatFiles(e);
|
|
4537
4664
|
} catch {
|
|
4538
|
-
|
|
4665
|
+
On.value = [];
|
|
4539
4666
|
} finally {
|
|
4540
|
-
|
|
4667
|
+
kn.value = !1;
|
|
4541
4668
|
}
|
|
4542
4669
|
}
|
|
4543
4670
|
}
|
|
4544
|
-
function
|
|
4545
|
-
return
|
|
4671
|
+
function $n(e, t = !1) {
|
|
4672
|
+
return A.value.getChatFileDownloadUrl(e, t);
|
|
4546
4673
|
}
|
|
4547
|
-
function
|
|
4548
|
-
return
|
|
4674
|
+
function er(e) {
|
|
4675
|
+
return A.value.getChatFilePreviewUrl(e);
|
|
4549
4676
|
}
|
|
4550
|
-
async function
|
|
4551
|
-
await
|
|
4552
|
-
let t =
|
|
4553
|
-
|
|
4677
|
+
async function tr(e) {
|
|
4678
|
+
await A.value.deleteChatFile(e);
|
|
4679
|
+
let t = On.value.find((t) => t.documentId === e), n = t?.kind === "spreadsheet" ? t.sourceAttachmentId ?? t.documentId : void 0;
|
|
4680
|
+
On.value = On.value.filter((t) => t.documentId !== e && (!n || t.documentId !== n && t.sourceAttachmentId !== n));
|
|
4554
4681
|
}
|
|
4555
|
-
async function
|
|
4682
|
+
async function nr(e, t) {
|
|
4556
4683
|
if (!S.value) try {
|
|
4557
|
-
let n = await
|
|
4558
|
-
if (t !== C.value || (n &&
|
|
4684
|
+
let n = await A.value.getChat(e, t);
|
|
4685
|
+
if (t !== C.value || (n && z(t, {
|
|
4559
4686
|
authorId: n.userId,
|
|
4560
4687
|
projectId: n.projectId
|
|
4561
|
-
}),
|
|
4562
|
-
n && (
|
|
4688
|
+
}), L.value.status !== "ready" || L.value.messages.length > 0)) return;
|
|
4689
|
+
n && (L.value.messages = n.messages, jt.value = n.blocked ?? !1, rr(e, t, n.turnInProgress === !0));
|
|
4563
4690
|
} catch {}
|
|
4564
4691
|
}
|
|
4565
|
-
async function
|
|
4566
|
-
n && (await
|
|
4692
|
+
async function rr(e, t, n) {
|
|
4693
|
+
n && (await ir(t), t !== C.value || q()) || (await ar(e, t), t === C.value && await lr());
|
|
4567
4694
|
}
|
|
4568
|
-
async function
|
|
4695
|
+
async function ir(e) {
|
|
4569
4696
|
let t = { chatId: e };
|
|
4570
|
-
|
|
4571
|
-
let n = () =>
|
|
4697
|
+
N = t, P.value = e;
|
|
4698
|
+
let n = () => N === t && e === C.value, r = Date.now() + eo;
|
|
4572
4699
|
try {
|
|
4573
4700
|
for (; n() && !q() && Date.now() < r;) {
|
|
4574
|
-
|
|
4701
|
+
$t = !0;
|
|
4575
4702
|
try {
|
|
4576
|
-
await
|
|
4703
|
+
await L.value.resumeStream();
|
|
4577
4704
|
} finally {
|
|
4578
|
-
|
|
4705
|
+
$t = !1;
|
|
4579
4706
|
}
|
|
4580
4707
|
if (!n()) return;
|
|
4581
|
-
|
|
4582
|
-
let t = await
|
|
4708
|
+
L.value.clearError();
|
|
4709
|
+
let t = await A.value.getChat(o.value, e).catch(() => null);
|
|
4583
4710
|
if (!t || !n() || q()) return;
|
|
4584
4711
|
if (!t.turnInProgress) {
|
|
4585
|
-
|
|
4712
|
+
L.value.messages = t.messages;
|
|
4586
4713
|
return;
|
|
4587
4714
|
}
|
|
4588
|
-
await new Promise((e) => setTimeout(e,
|
|
4715
|
+
await new Promise((e) => setTimeout(e, to));
|
|
4589
4716
|
}
|
|
4590
4717
|
} finally {
|
|
4591
|
-
|
|
4718
|
+
N === t && (N = void 0, P.value = void 0);
|
|
4592
4719
|
}
|
|
4593
4720
|
}
|
|
4594
|
-
async function
|
|
4721
|
+
async function ar(e, t) {
|
|
4595
4722
|
let n;
|
|
4596
4723
|
try {
|
|
4597
|
-
n = Number(sessionStorage.getItem(
|
|
4724
|
+
n = Number(sessionStorage.getItem(Ct)), sessionStorage.removeItem(Ct);
|
|
4598
4725
|
} catch {
|
|
4599
4726
|
return;
|
|
4600
4727
|
}
|
|
4601
4728
|
if (!(!n || Date.now() - n > 6e4 || Ce.value)) for (let n = 0; n < 12; n++) {
|
|
4602
|
-
let n =
|
|
4729
|
+
let n = L.value.messages[L.value.messages.length - 1];
|
|
4603
4730
|
if (n?.role === "assistant") {
|
|
4604
|
-
let e = n.parts.filter((e) =>
|
|
4731
|
+
let e = n.parts.filter((e) => qe(e) && e.state === "input-available"), t = e.filter((e) => e.toolMetadata?.provider === "page" && e.toolMetadata.readOnly === !0);
|
|
4605
4732
|
if (e.length > 0) {
|
|
4606
|
-
if (t.length === e.length && !Ce.value) for (let e of t)
|
|
4733
|
+
if (t.length === e.length && !Ce.value) for (let e of t) Ut.enqueue({
|
|
4607
4734
|
toolCallId: e.toolCallId,
|
|
4608
4735
|
toolName: e.toolName,
|
|
4609
4736
|
input: e.input,
|
|
@@ -4615,332 +4742,332 @@ function eo(e) {
|
|
|
4615
4742
|
}
|
|
4616
4743
|
if (n.parts[n.parts.length - 1]?.type === "text") return;
|
|
4617
4744
|
}
|
|
4618
|
-
if (await new Promise((e) => setTimeout(e, 1500)), t !== C.value ||
|
|
4745
|
+
if (await new Promise((e) => setTimeout(e, 1500)), t !== C.value || L.value.status !== "ready") return;
|
|
4619
4746
|
try {
|
|
4620
|
-
let n = await
|
|
4621
|
-
n && t === C.value && (
|
|
4747
|
+
let n = await A.value.getChat(e, t);
|
|
4748
|
+
n && t === C.value && (L.value.messages = n.messages);
|
|
4622
4749
|
} catch {
|
|
4623
4750
|
return;
|
|
4624
4751
|
}
|
|
4625
4752
|
}
|
|
4626
4753
|
}
|
|
4627
4754
|
let q = () => {
|
|
4628
|
-
let e =
|
|
4755
|
+
let e = L.value.status;
|
|
4629
4756
|
return e === "submitted" || e === "streaming";
|
|
4630
|
-
},
|
|
4631
|
-
let e =
|
|
4632
|
-
return
|
|
4633
|
-
},
|
|
4634
|
-
async function
|
|
4757
|
+
}, or = () => q() || N?.chatId === C.value || re.value > 0, sr = () => {
|
|
4758
|
+
let e = R();
|
|
4759
|
+
return j.value !== void 0 || Ya(e) || uo(e);
|
|
4760
|
+
}, cr = /* @__PURE__ */ new Set();
|
|
4761
|
+
async function lr() {
|
|
4635
4762
|
let e = C.value;
|
|
4636
|
-
if (!(
|
|
4637
|
-
if (
|
|
4763
|
+
if (!(cr.has(e) || Hn.value.length === 0 || or() || At.value)) {
|
|
4764
|
+
if (sr()) Kn(Gn(e));
|
|
4638
4765
|
else {
|
|
4639
|
-
|
|
4766
|
+
cr.add(e);
|
|
4640
4767
|
try {
|
|
4641
|
-
let t = Date.now() +
|
|
4642
|
-
for (; Date.now() < t && (await Promise.race([
|
|
4643
|
-
if (e !== C.value ||
|
|
4644
|
-
let n =
|
|
4645
|
-
n &&
|
|
4768
|
+
let t = Date.now() + ao;
|
|
4769
|
+
for (; Date.now() < t && (await Promise.race([A.value.getRunningTurns(o.value, [e]).catch(() => []), new Promise((t) => setTimeout(() => t([e]), so))])).includes(e);) await new Promise((e) => setTimeout(e, oo));
|
|
4770
|
+
if (e !== C.value || or()) return;
|
|
4771
|
+
let n = Gn(e);
|
|
4772
|
+
n && br(n);
|
|
4646
4773
|
} finally {
|
|
4647
|
-
|
|
4774
|
+
cr.delete(e);
|
|
4648
4775
|
}
|
|
4649
4776
|
}
|
|
4650
4777
|
}
|
|
4651
4778
|
}
|
|
4652
|
-
let
|
|
4653
|
-
async function
|
|
4779
|
+
let ur = 0, dr = 0;
|
|
4780
|
+
async function fr() {
|
|
4654
4781
|
if (S.value || q()) return "indeterminate";
|
|
4655
|
-
let e = C.value, t =
|
|
4782
|
+
let e = C.value, t = ur += 1;
|
|
4656
4783
|
try {
|
|
4657
|
-
let n = await
|
|
4658
|
-
if (!n || e !== C.value || q() || t <=
|
|
4659
|
-
|
|
4660
|
-
let r = n.messages, i =
|
|
4661
|
-
return
|
|
4784
|
+
let n = await A.value.getChat(o.value, e);
|
|
4785
|
+
if (!n || e !== C.value || q() || t <= dr) return "indeterminate";
|
|
4786
|
+
dr = t;
|
|
4787
|
+
let r = n.messages, i = $a(r, L.value.messages);
|
|
4788
|
+
return L.value.messages = [...r, ...i], jt.value = n.blocked ?? !1, i.length > 0 ? "pending" : "caught-up";
|
|
4662
4789
|
} catch {}
|
|
4663
4790
|
return "indeterminate";
|
|
4664
4791
|
}
|
|
4665
|
-
function
|
|
4666
|
-
|
|
4792
|
+
function pr(e) {
|
|
4793
|
+
L.value.messages = [...L.value.messages, e];
|
|
4667
4794
|
}
|
|
4668
|
-
async function
|
|
4795
|
+
async function mr(e) {
|
|
4669
4796
|
try {
|
|
4670
|
-
|
|
4797
|
+
Mn.value = await A.value.getMessageFeedbacks(e);
|
|
4671
4798
|
} catch {
|
|
4672
|
-
|
|
4799
|
+
Mn.value = [];
|
|
4673
4800
|
}
|
|
4674
4801
|
}
|
|
4675
|
-
function
|
|
4676
|
-
let t =
|
|
4677
|
-
t >= 0 ?
|
|
4802
|
+
function hr(e) {
|
|
4803
|
+
let t = Mn.value.findIndex((t) => t.messageId === e.messageId);
|
|
4804
|
+
t >= 0 ? Mn.value[t] = e : Mn.value.push(e);
|
|
4678
4805
|
}
|
|
4679
|
-
function
|
|
4680
|
-
let t =
|
|
4806
|
+
function gr(e) {
|
|
4807
|
+
let t = mn.value, n = t.findIndex((t) => t.id === e.id), r = $e(e) ?? "", i = t.slice(0, n).reverse().find((e) => e.role === "user");
|
|
4681
4808
|
return {
|
|
4682
|
-
userQuestion:
|
|
4809
|
+
userQuestion: $e(i ?? e) ?? "",
|
|
4683
4810
|
assistantMessage: r
|
|
4684
4811
|
};
|
|
4685
4812
|
}
|
|
4686
|
-
async function
|
|
4813
|
+
async function _r(e, t) {
|
|
4687
4814
|
await Promise.all([
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
]),
|
|
4692
|
-
e && (
|
|
4815
|
+
nr(e, t),
|
|
4816
|
+
Yn(e),
|
|
4817
|
+
mr(t)
|
|
4818
|
+
]), Ft.value || St((e, t) => A.value.reverseGeocode(e, t, r.value)).then((e) => {
|
|
4819
|
+
e && (Ft.value = e);
|
|
4693
4820
|
});
|
|
4694
4821
|
}
|
|
4695
|
-
async function
|
|
4696
|
-
if (
|
|
4697
|
-
let e =
|
|
4822
|
+
async function vr() {
|
|
4823
|
+
if (B.value || G.value.some((e) => e.state !== "done")) return;
|
|
4824
|
+
let e = W.value.trim(), t = G.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
|
|
4698
4825
|
type: "file",
|
|
4699
4826
|
mediaType: e.mediaSource.mimeType,
|
|
4700
4827
|
url: e.localUrl,
|
|
4701
4828
|
filename: e.mediaSource.name,
|
|
4702
4829
|
providerMetadata: { "8bot": { media: e.mediaSource } }
|
|
4703
|
-
})), n =
|
|
4704
|
-
!S.value &&
|
|
4830
|
+
})), n = wt.value ? de.value : void 0;
|
|
4831
|
+
!S.value && or() ? e && t.length === 0 && !n && (Wn(C.value, [...Hn.value, e]), W.value = "") : (S.value && mn.value.length > 0 && await Lr(), br(e, t, n && { pagePointer: n }), W.value = "", de.value = void 0, Ir());
|
|
4705
4832
|
}
|
|
4706
|
-
function
|
|
4833
|
+
function yr(e, t) {
|
|
4707
4834
|
let n = e.trim();
|
|
4708
|
-
return !n ||
|
|
4835
|
+
return !n || jt.value || B.value || or() || L.value.status !== "ready" ? !1 : (br(n, [], t, { toInput: !1 }), !0);
|
|
4709
4836
|
}
|
|
4710
|
-
function
|
|
4711
|
-
if (
|
|
4712
|
-
|
|
4713
|
-
let i =
|
|
4837
|
+
function br(e, t = [], n, { toInput: r = !0 } = {}) {
|
|
4838
|
+
if (B.value) return;
|
|
4839
|
+
Zt(), K.value = e, Rn.value = r, zn.value = r && n && "pagePointer" in n ? n.pagePointer : void 0, Bn.value = L.value.messages.length;
|
|
4840
|
+
let i = L.value.sendMessage;
|
|
4714
4841
|
i({
|
|
4715
4842
|
text: e,
|
|
4716
4843
|
files: t.length > 0 ? t : void 0,
|
|
4717
4844
|
...n && { metadata: n }
|
|
4718
4845
|
});
|
|
4719
4846
|
}
|
|
4720
|
-
function
|
|
4847
|
+
function xr(e) {
|
|
4721
4848
|
let t = e.trim();
|
|
4722
|
-
if (!t ||
|
|
4723
|
-
if (
|
|
4724
|
-
|
|
4849
|
+
if (!t || B.value) return;
|
|
4850
|
+
if (L.value.status !== "ready") {
|
|
4851
|
+
ct.warn("[useChatbotStore] sendMessage called before chat is ready. Listen for the \"ready\" event on the widget element.");
|
|
4725
4852
|
return;
|
|
4726
4853
|
}
|
|
4727
|
-
let n =
|
|
4728
|
-
|
|
4854
|
+
let n = L.value.sendMessage;
|
|
4855
|
+
Zt(), n({ text: t });
|
|
4729
4856
|
}
|
|
4730
|
-
async function
|
|
4731
|
-
let e =
|
|
4732
|
-
|
|
4857
|
+
async function Sr() {
|
|
4858
|
+
let e = L.value.messages.slice(Bn.value).some((e) => e.parts.some(qe)), t = K.value, n = Rn.value, r = zn.value, i = t.length > 0 && !e, a = C.value, s = Bn.value, c = N?.chatId === a, l = en, u = Gn(a), d = (e = "") => {
|
|
4859
|
+
W.value = [
|
|
4733
4860
|
e,
|
|
4734
4861
|
u,
|
|
4735
|
-
|
|
4736
|
-
].filter(Boolean).join(
|
|
4737
|
-
}, f = () => a === C.value && !q() &&
|
|
4738
|
-
|
|
4739
|
-
let p = S.value || e && !c || await
|
|
4862
|
+
W.value
|
|
4863
|
+
].filter(Boolean).join(co);
|
|
4864
|
+
}, f = () => a === C.value && !q() && Bn.value === s ? !1 : (u && Wn(a, [u, ...Vn.value[a] ?? []]), !0);
|
|
4865
|
+
N = void 0, P.value = void 0, Zt(), await L.value.stop();
|
|
4866
|
+
let p = S.value || e && !c || await A.value.stopChatTurn(o.value, a, l).catch(() => !0);
|
|
4740
4867
|
if (!f()) {
|
|
4741
4868
|
if (c || !p) {
|
|
4742
|
-
if (await
|
|
4743
|
-
if (c ||
|
|
4744
|
-
|
|
4869
|
+
if (await fr(), f()) return;
|
|
4870
|
+
if (c || L.value.messages.length > Bn.value) {
|
|
4871
|
+
K.value = "", d();
|
|
4745
4872
|
return;
|
|
4746
4873
|
}
|
|
4747
4874
|
}
|
|
4748
|
-
i ? (d(n ? t : ""), de.value ??= r,
|
|
4875
|
+
i ? (d(n ? t : ""), de.value ??= r, L.value.messages = L.value.messages.slice(0, Bn.value), K.value = "") : d();
|
|
4749
4876
|
}
|
|
4750
4877
|
}
|
|
4751
|
-
O(() =>
|
|
4752
|
-
let t =
|
|
4753
|
-
t && !
|
|
4754
|
-
}), O(() =>
|
|
4755
|
-
e === "submitted" && (x.value++,
|
|
4878
|
+
O(() => L.value.messages, (e) => {
|
|
4879
|
+
let t = j.value?.toolCallId;
|
|
4880
|
+
t && !M.has(t) && !e.some((e) => e.parts.some((e) => e.toolCallId === t)) && Zt();
|
|
4881
|
+
}), O(() => L.value.status, (e) => {
|
|
4882
|
+
e === "submitted" && (x.value++, en = void 0);
|
|
4756
4883
|
});
|
|
4757
|
-
let
|
|
4884
|
+
let Cr;
|
|
4758
4885
|
O(() => [
|
|
4759
|
-
|
|
4886
|
+
L.value.status,
|
|
4760
4887
|
re.value,
|
|
4761
4888
|
ie.value
|
|
4762
4889
|
], ([e, t, n]) => {
|
|
4763
|
-
clearTimeout(
|
|
4890
|
+
clearTimeout(Cr), e === "ready" && t === 0 && n === 0 && (Cr = setTimeout(() => {
|
|
4764
4891
|
ge.value = !1;
|
|
4765
4892
|
}, 1500));
|
|
4766
4893
|
});
|
|
4767
|
-
let
|
|
4768
|
-
O(() => !
|
|
4769
|
-
clearTimeout(
|
|
4770
|
-
|
|
4894
|
+
let wr = E(!1), Tr;
|
|
4895
|
+
O(() => !j.value && !Ya(R()) && (q() || re.value > 0), (e) => {
|
|
4896
|
+
clearTimeout(Tr), e ? wr.value = !0 : Tr = setTimeout(() => {
|
|
4897
|
+
wr.value = !1;
|
|
4771
4898
|
}, 400);
|
|
4772
4899
|
}, { immediate: !0 });
|
|
4773
|
-
let
|
|
4774
|
-
let e =
|
|
4775
|
-
return
|
|
4776
|
-
}),
|
|
4777
|
-
function
|
|
4778
|
-
clearTimeout(
|
|
4779
|
-
|
|
4780
|
-
},
|
|
4900
|
+
let J = T(() => {
|
|
4901
|
+
let e = tn.value.filter((e) => e !== C.value);
|
|
4902
|
+
return wr.value || P.value === C.value ? [...e, C.value] : e;
|
|
4903
|
+
}), Er = () => [.../* @__PURE__ */ new Set([...tn.value, ...F.value])], Dr = vt(), Y, Or = 0, kr = 0;
|
|
4904
|
+
function Ar() {
|
|
4905
|
+
clearTimeout(Y), Y = void 0, Er().length !== 0 && Dr.value === "visible" && (Y = setTimeout(() => {
|
|
4906
|
+
Y = void 0, Mr(Er());
|
|
4907
|
+
}, no));
|
|
4781
4908
|
}
|
|
4782
|
-
async function
|
|
4909
|
+
async function jr(e) {
|
|
4783
4910
|
let t = C.value;
|
|
4784
4911
|
if (u.value?.nextMessageSuggestion && !S.value && t) try {
|
|
4785
|
-
return await
|
|
4912
|
+
return await A.value.suggestNextMessage(o.value, t, e) ?? void 0;
|
|
4786
4913
|
} catch {
|
|
4787
4914
|
return;
|
|
4788
4915
|
}
|
|
4789
4916
|
}
|
|
4790
|
-
async function
|
|
4791
|
-
let t = e.slice(0,
|
|
4917
|
+
async function Mr(e) {
|
|
4918
|
+
let t = e.slice(0, ro);
|
|
4792
4919
|
if (S.value || t.length === 0) {
|
|
4793
|
-
|
|
4920
|
+
Ar();
|
|
4794
4921
|
return;
|
|
4795
4922
|
}
|
|
4796
|
-
let n =
|
|
4923
|
+
let n = Or += 1, r;
|
|
4797
4924
|
try {
|
|
4798
|
-
r = await
|
|
4925
|
+
r = await A.value.getRunningTurns(o.value, t);
|
|
4799
4926
|
} catch {
|
|
4800
|
-
|
|
4927
|
+
Ar();
|
|
4801
4928
|
return;
|
|
4802
4929
|
}
|
|
4803
|
-
if (n <=
|
|
4804
|
-
|
|
4805
|
-
for (let e of r)
|
|
4806
|
-
let i = new Set(t), a =
|
|
4807
|
-
|
|
4808
|
-
let u = l.filter((e) =>
|
|
4809
|
-
(u.length > 0 || c.length > 0) && (
|
|
4930
|
+
if (n <= kr) return;
|
|
4931
|
+
kr = n;
|
|
4932
|
+
for (let e of r) an.add(e);
|
|
4933
|
+
let i = new Set(t), a = Er().filter((e) => i.has(e) && !r.includes(e)), s = (e) => F.value.includes(e) && !an.has(e), c = a.filter((e) => s(e) && Date.now() - (rn.get(e) ?? 0) > io), l = a.filter((e) => !s(e));
|
|
4934
|
+
tn.value = [...tn.value.filter((e) => !i.has(e)), ...r];
|
|
4935
|
+
let u = l.filter((e) => F.value.includes(e));
|
|
4936
|
+
(u.length > 0 || c.length > 0) && (F.value = F.value.filter((e) => !u.includes(e) && !c.includes(e)), I.value = [...I.value, ...u.filter((e) => e !== C.value && !I.value.includes(e))]), l.length > 0 && Yn(o.value), Ar();
|
|
4810
4937
|
}
|
|
4811
|
-
O(
|
|
4812
|
-
e === "visible" ?
|
|
4813
|
-
}),
|
|
4814
|
-
let
|
|
4938
|
+
O(Dr, (e) => {
|
|
4939
|
+
e === "visible" ? Mr(Er()) : (clearTimeout(Y), Y = void 0);
|
|
4940
|
+
}), ft(() => clearTimeout(Y));
|
|
4941
|
+
let Nr = T(() => I.value.map((e) => ({
|
|
4815
4942
|
chatId: e,
|
|
4816
|
-
title:
|
|
4943
|
+
title: V.value.find((t) => t.id === e)?.title || nn.value[e] || void 0
|
|
4817
4944
|
})));
|
|
4818
|
-
function
|
|
4819
|
-
|
|
4945
|
+
function Pr(e) {
|
|
4946
|
+
cn(e), C.value = e, li("chat");
|
|
4820
4947
|
}
|
|
4821
|
-
function
|
|
4822
|
-
|
|
4948
|
+
function Fr(e) {
|
|
4949
|
+
I.value = I.value.filter((t) => t !== e), sn(e);
|
|
4823
4950
|
}
|
|
4824
|
-
O(() => [
|
|
4951
|
+
O(() => [L.value.status, L.value.id], ([e, t], [n, r]) => {
|
|
4825
4952
|
if (t === r) {
|
|
4826
|
-
if (e === "error")
|
|
4953
|
+
if (e === "error") N?.chatId !== C.value && Kn(Gn(C.value));
|
|
4827
4954
|
else if (e === "ready" && (n === "streaming" || n === "submitted")) {
|
|
4828
|
-
if (
|
|
4829
|
-
|
|
4955
|
+
if (sr()) {
|
|
4956
|
+
Kn(Gn(C.value));
|
|
4830
4957
|
return;
|
|
4831
4958
|
}
|
|
4832
|
-
|
|
4959
|
+
lr();
|
|
4833
4960
|
}
|
|
4834
4961
|
}
|
|
4835
4962
|
}), O(re, (e) => {
|
|
4836
|
-
e === 0 &&
|
|
4837
|
-
}), O(() =>
|
|
4838
|
-
e === "ready" &&
|
|
4963
|
+
e === 0 && L.value.status === "ready" && lr();
|
|
4964
|
+
}), O(() => L.value.status, (e) => {
|
|
4965
|
+
e === "ready" && K.value.length > 0 && (K.value = "");
|
|
4839
4966
|
});
|
|
4840
|
-
function
|
|
4841
|
-
for (let t of
|
|
4842
|
-
|
|
4967
|
+
function Ir(e = !1) {
|
|
4968
|
+
for (let t of G.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
|
|
4969
|
+
G.value = [], Kr.value = null;
|
|
4843
4970
|
}
|
|
4844
|
-
async function
|
|
4971
|
+
async function Lr(e) {
|
|
4845
4972
|
let t = typeof e?.projectId == "string" ? e.projectId : void 0;
|
|
4846
|
-
return
|
|
4973
|
+
return K.value = "", me.value = {}, he.value = {}, C.value = un(), z(C.value, { projectId: t }), await dt(), L.value.clearError(), At.value = void 0, jt.value = !1, Ir(!0), li("chat"), C.value;
|
|
4847
4974
|
}
|
|
4848
|
-
async function
|
|
4849
|
-
|
|
4975
|
+
async function Rr(e) {
|
|
4976
|
+
B.value || (L.value.status !== "ready" && (K.value = "", await Sr()), Zt(), await L.value.regenerate(e));
|
|
4850
4977
|
}
|
|
4851
|
-
function
|
|
4852
|
-
if (!
|
|
4978
|
+
function zr(e) {
|
|
4979
|
+
if (!B.value) {
|
|
4853
4980
|
if (e.tool === "requestGeolocation") {
|
|
4854
4981
|
let t = e.output;
|
|
4855
|
-
"latitude" in t && (
|
|
4982
|
+
"latitude" in t && (Ft.value = {
|
|
4856
4983
|
geolocationLatitude: t.latitude,
|
|
4857
4984
|
geolocationLongitude: t.longitude,
|
|
4858
4985
|
geolocationAccuracy: t.accuracy,
|
|
4859
4986
|
geolocationCity: t.city
|
|
4860
4987
|
});
|
|
4861
4988
|
}
|
|
4862
|
-
|
|
4989
|
+
L.value.addToolOutput(e);
|
|
4863
4990
|
}
|
|
4864
4991
|
}
|
|
4865
|
-
function
|
|
4866
|
-
|
|
4992
|
+
function Br(e) {
|
|
4993
|
+
B.value || L.value.addToolApprovalResponse(e);
|
|
4867
4994
|
}
|
|
4868
|
-
let
|
|
4869
|
-
|
|
4995
|
+
let Vr = T(() => L.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), Hr = T(() => _.value?.maxFilesPerMessage ?? 5), Ur = T(() => _.value?.maxFilesPerChat ?? 20), Wr = T(() => Math.max(0, Math.min(Hr.value - G.value.length, Ur.value - Vr.value - G.value.length))), Gr = T(() => Wr.value <= 0), Kr = E(null), qr = () => {
|
|
4996
|
+
Kr.value = null;
|
|
4870
4997
|
};
|
|
4871
|
-
O(
|
|
4872
|
-
e || (
|
|
4998
|
+
O(Gr, (e) => {
|
|
4999
|
+
e || (Kr.value = null);
|
|
4873
5000
|
});
|
|
4874
|
-
async function
|
|
4875
|
-
if (
|
|
4876
|
-
if (
|
|
4877
|
-
|
|
5001
|
+
async function Jr(e) {
|
|
5002
|
+
if (B.value) return;
|
|
5003
|
+
if (Gr.value) {
|
|
5004
|
+
Kr.value = Ur.value - Vr.value - G.value.length <= Hr.value - G.value.length ? {
|
|
4878
5005
|
reason: "per-chat",
|
|
4879
|
-
max:
|
|
5006
|
+
max: Ur.value
|
|
4880
5007
|
} : {
|
|
4881
5008
|
reason: "per-message",
|
|
4882
|
-
max:
|
|
5009
|
+
max: Hr.value
|
|
4883
5010
|
};
|
|
4884
5011
|
return;
|
|
4885
5012
|
}
|
|
4886
|
-
let t =
|
|
4887
|
-
|
|
5013
|
+
let t = Zr(e);
|
|
5014
|
+
G.value = [...G.value, t], await Qr(t);
|
|
4888
5015
|
}
|
|
4889
|
-
async function
|
|
4890
|
-
let n =
|
|
5016
|
+
async function Yr(e, t) {
|
|
5017
|
+
let n = G.value.find((t) => t.id === e.id);
|
|
4891
5018
|
if (!n) return;
|
|
4892
5019
|
URL.revokeObjectURL(n.localUrl);
|
|
4893
|
-
let r =
|
|
4894
|
-
|
|
5020
|
+
let r = Zr(t);
|
|
5021
|
+
G.value = G.value.map((e) => e.id === n.id ? r : e), await Promise.all([$r(n), Qr(r)]);
|
|
4895
5022
|
}
|
|
4896
|
-
async function
|
|
4897
|
-
let t =
|
|
4898
|
-
t && (
|
|
5023
|
+
async function Xr(e) {
|
|
5024
|
+
let t = G.value.find((t) => t.id === e.id && t.state === "error");
|
|
5025
|
+
t && (G.value = G.value.map((e) => e.id === t.id ? {
|
|
4899
5026
|
...e,
|
|
4900
5027
|
state: "uploading",
|
|
4901
5028
|
error: void 0
|
|
4902
|
-
} : e), await
|
|
5029
|
+
} : e), await Qr(t));
|
|
4903
5030
|
}
|
|
4904
|
-
function
|
|
5031
|
+
function Zr(e) {
|
|
4905
5032
|
return {
|
|
4906
|
-
id:
|
|
5033
|
+
id: un(),
|
|
4907
5034
|
file: e,
|
|
4908
5035
|
localUrl: URL.createObjectURL(e),
|
|
4909
5036
|
state: "uploading"
|
|
4910
5037
|
};
|
|
4911
5038
|
}
|
|
4912
|
-
async function
|
|
5039
|
+
async function Qr({ id: e, file: t }) {
|
|
4913
5040
|
try {
|
|
4914
|
-
let n = await
|
|
4915
|
-
if (!
|
|
4916
|
-
await
|
|
5041
|
+
let n = await A.value.uploadMedia(o.value, C.value, t);
|
|
5042
|
+
if (!G.value.some((t) => t.id === e)) {
|
|
5043
|
+
await ei(n);
|
|
4917
5044
|
return;
|
|
4918
5045
|
}
|
|
4919
|
-
|
|
5046
|
+
G.value = G.value.map((t) => t.id === e ? {
|
|
4920
5047
|
...t,
|
|
4921
5048
|
state: "done",
|
|
4922
5049
|
mediaSource: n
|
|
4923
5050
|
} : t);
|
|
4924
5051
|
} catch (t) {
|
|
4925
5052
|
let n = t instanceof Error ? t.message : "Upload failed";
|
|
4926
|
-
|
|
5053
|
+
G.value = G.value.map((t) => t.id === e ? {
|
|
4927
5054
|
...t,
|
|
4928
5055
|
state: "error",
|
|
4929
5056
|
error: n
|
|
4930
5057
|
} : t);
|
|
4931
5058
|
}
|
|
4932
5059
|
}
|
|
4933
|
-
async function
|
|
4934
|
-
e.mediaSource && await
|
|
5060
|
+
async function $r(e) {
|
|
5061
|
+
e.mediaSource && await ei(e.mediaSource);
|
|
4935
5062
|
}
|
|
4936
|
-
async function
|
|
5063
|
+
async function ei(e) {
|
|
4937
5064
|
try {
|
|
4938
|
-
await
|
|
5065
|
+
await A.value.discardMedia(e);
|
|
4939
5066
|
} catch {}
|
|
4940
5067
|
}
|
|
4941
|
-
async function
|
|
4942
|
-
let { userQuestion: n, assistantMessage: r } =
|
|
4943
|
-
|
|
5068
|
+
async function ti(e, t) {
|
|
5069
|
+
let { userQuestion: n, assistantMessage: r } = gr(e);
|
|
5070
|
+
hr(await A.value.submitMessageFeedback({
|
|
4944
5071
|
messageId: e.id,
|
|
4945
5072
|
chatId: C.value,
|
|
4946
5073
|
agentId: o.value,
|
|
@@ -4949,78 +5076,78 @@ function eo(e) {
|
|
|
4949
5076
|
assistantMessage: r
|
|
4950
5077
|
}));
|
|
4951
5078
|
}
|
|
4952
|
-
async function
|
|
4953
|
-
await
|
|
5079
|
+
async function ni(e) {
|
|
5080
|
+
await ti(e, "upvote");
|
|
4954
5081
|
}
|
|
4955
|
-
async function
|
|
4956
|
-
await
|
|
5082
|
+
async function ri(e) {
|
|
5083
|
+
await ti(e, "downvote");
|
|
4957
5084
|
}
|
|
4958
|
-
function
|
|
4959
|
-
|
|
5085
|
+
function ii(e) {
|
|
5086
|
+
Pn.value = !1, Fn.value = void 0, Nn.value = e;
|
|
4960
5087
|
}
|
|
4961
|
-
async function
|
|
4962
|
-
if (
|
|
4963
|
-
|
|
4964
|
-
let { userQuestion: t, assistantMessage: n } =
|
|
4965
|
-
|
|
4966
|
-
messageId:
|
|
5088
|
+
async function ai(e) {
|
|
5089
|
+
if (Nn.value) try {
|
|
5090
|
+
H.value = !0, Pn.value = !1, Fn.value = void 0;
|
|
5091
|
+
let { userQuestion: t, assistantMessage: n } = gr(Nn.value);
|
|
5092
|
+
hr(await A.value.submitMessageFeedback({
|
|
5093
|
+
messageId: Nn.value.id,
|
|
4967
5094
|
chatId: C.value,
|
|
4968
5095
|
agentId: o.value,
|
|
4969
5096
|
userQuestion: t,
|
|
4970
5097
|
assistantMessage: n,
|
|
4971
5098
|
comment: e
|
|
4972
|
-
})),
|
|
5099
|
+
})), Pn.value = !0, await mr(C.value);
|
|
4973
5100
|
} catch {
|
|
4974
|
-
|
|
5101
|
+
Fn.value = n("message.feedbackSubmitError") ? t("message.feedbackSubmitError") : "Failed to submit feedback";
|
|
4975
5102
|
} finally {
|
|
4976
|
-
|
|
5103
|
+
H.value = !1;
|
|
4977
5104
|
}
|
|
4978
5105
|
}
|
|
4979
|
-
async function
|
|
5106
|
+
async function oi(e) {
|
|
4980
5107
|
try {
|
|
4981
|
-
|
|
5108
|
+
Ln.value = !0, In.value = !1, U.value = void 0, await A.value.submitLead({
|
|
4982
5109
|
agentId: o.value,
|
|
4983
5110
|
chatId: C.value,
|
|
4984
5111
|
...e
|
|
4985
|
-
}),
|
|
5112
|
+
}), In.value = !0;
|
|
4986
5113
|
} catch {
|
|
4987
|
-
|
|
5114
|
+
U.value = n("message.leadSubmitError") ? t("message.leadSubmitError") : "Failed to submit lead";
|
|
4988
5115
|
} finally {
|
|
4989
|
-
|
|
5116
|
+
Ln.value = !1;
|
|
4990
5117
|
}
|
|
4991
5118
|
}
|
|
4992
|
-
async function
|
|
4993
|
-
let n = await
|
|
4994
|
-
|
|
5119
|
+
async function si(e, t) {
|
|
5120
|
+
let n = await A.value.updateChatTitle(o.value, e, t);
|
|
5121
|
+
V.value = V.value.map((t) => t.id === e ? {
|
|
4995
5122
|
...t,
|
|
4996
5123
|
title: n.title
|
|
4997
5124
|
} : t);
|
|
4998
5125
|
}
|
|
4999
|
-
async function
|
|
5000
|
-
await
|
|
5126
|
+
async function ci(e) {
|
|
5127
|
+
await A.value.deleteChat(o.value, e), V.value = V.value.filter((t) => t.id !== e), C.value === e && await Lr();
|
|
5001
5128
|
}
|
|
5002
|
-
function
|
|
5003
|
-
|
|
5129
|
+
function li(e) {
|
|
5130
|
+
An.value = e;
|
|
5004
5131
|
}
|
|
5005
|
-
function
|
|
5006
|
-
|
|
5132
|
+
function ui() {
|
|
5133
|
+
li("chat"), jn.value++;
|
|
5007
5134
|
}
|
|
5008
|
-
let
|
|
5009
|
-
function
|
|
5010
|
-
let t = () =>
|
|
5135
|
+
let di;
|
|
5136
|
+
function fi(e) {
|
|
5137
|
+
let t = () => A.value.getChat(o.value, e);
|
|
5011
5138
|
return t().catch(() => t().catch(() => null));
|
|
5012
5139
|
}
|
|
5013
5140
|
return O(l, async (e) => {
|
|
5014
|
-
if (!e || e ===
|
|
5015
|
-
let t =
|
|
5016
|
-
if (
|
|
5017
|
-
let n = C.value, r = S.value ? null : await
|
|
5018
|
-
l.value === e && C.value === n && (r ? (
|
|
5141
|
+
if (!e || e === di) return;
|
|
5142
|
+
let t = di;
|
|
5143
|
+
if (di = e, t === void 0) return;
|
|
5144
|
+
let n = C.value, r = S.value ? null : await fi(n);
|
|
5145
|
+
l.value === e && C.value === n && (r ? (z(n, {
|
|
5019
5146
|
authorId: r.userId,
|
|
5020
5147
|
projectId: r.projectId
|
|
5021
|
-
}),
|
|
5148
|
+
}), Yn(o.value)) : (V.value = [], Mn.value = [], On.value = [], tn.value = [], F.value = [], I.value = [], nn.value = {}, await Lr(), W.value = ""));
|
|
5022
5149
|
}), {
|
|
5023
|
-
apiClient:
|
|
5150
|
+
apiClient: A,
|
|
5024
5151
|
baseUrl: i,
|
|
5025
5152
|
basePath: a,
|
|
5026
5153
|
agentId: o,
|
|
@@ -5028,7 +5155,7 @@ function eo(e) {
|
|
|
5028
5155
|
agentType: c,
|
|
5029
5156
|
userId: l,
|
|
5030
5157
|
agentInterface: u,
|
|
5031
|
-
suggestNextMessage:
|
|
5158
|
+
suggestNextMessage: jr,
|
|
5032
5159
|
agentModel: d,
|
|
5033
5160
|
agentTools: f,
|
|
5034
5161
|
headers: p,
|
|
@@ -5047,109 +5174,119 @@ function eo(e) {
|
|
|
5047
5174
|
agentPageAccess: ae,
|
|
5048
5175
|
pageToolRegistry: ce,
|
|
5049
5176
|
pageFormsProvider: le,
|
|
5177
|
+
agentLocalFolders: De,
|
|
5178
|
+
localFolders: w,
|
|
5179
|
+
localFoldersAvailable: Oe,
|
|
5180
|
+
localFolderPickerAvailable: ke,
|
|
5181
|
+
canConnectLocalFolder: Pe,
|
|
5182
|
+
refusedLocalFolder: Re,
|
|
5183
|
+
connectLocalFolder: Ue,
|
|
5184
|
+
connectLocalFolderFiles: Je,
|
|
5185
|
+
allowLocalFolder: Ye,
|
|
5186
|
+
removeLocalFolder: lt,
|
|
5050
5187
|
pageAction: ue,
|
|
5051
5188
|
hostStepTitles: me,
|
|
5052
5189
|
hostStepChanges: he,
|
|
5053
5190
|
pageControlActive: ge,
|
|
5054
|
-
isWorking:
|
|
5055
|
-
stopHostActions:
|
|
5056
|
-
voicePageTools:
|
|
5057
|
-
cancelVoicePageCalls:
|
|
5058
|
-
pageNoticeLevel:
|
|
5059
|
-
closePageNotice:
|
|
5060
|
-
hostConfirmation:
|
|
5061
|
-
respondHostConfirmation:
|
|
5191
|
+
isWorking: wr,
|
|
5192
|
+
stopHostActions: Xt,
|
|
5193
|
+
voicePageTools: Jt,
|
|
5194
|
+
cancelVoicePageCalls: Yt,
|
|
5195
|
+
pageNoticeLevel: kt,
|
|
5196
|
+
closePageNotice: k,
|
|
5197
|
+
hostConfirmation: j,
|
|
5198
|
+
respondHostConfirmation: zt,
|
|
5062
5199
|
pageAccessAvailable: Ee,
|
|
5063
5200
|
pageAccessOff: Ce,
|
|
5064
|
-
setPageAccessOff:
|
|
5201
|
+
setPageAccessOff: Qt,
|
|
5065
5202
|
agentConfirmations: oe,
|
|
5066
5203
|
agentSelectionActions: se,
|
|
5067
|
-
sendSelection:
|
|
5068
|
-
confirmationsAvailable:
|
|
5069
|
-
confirmationMode:
|
|
5070
|
-
setConfirmationMode:
|
|
5204
|
+
sendSelection: yr,
|
|
5205
|
+
confirmationsAvailable: mt,
|
|
5206
|
+
confirmationMode: ht,
|
|
5207
|
+
setConfirmationMode: bt,
|
|
5071
5208
|
pagePointer: de,
|
|
5072
5209
|
pagePointerStart: fe,
|
|
5073
5210
|
pagePointing: pe,
|
|
5074
|
-
pagePointerAvailable:
|
|
5211
|
+
pagePointerAvailable: wt,
|
|
5075
5212
|
systemTheme: _e,
|
|
5076
5213
|
hideWelcomeMessage: ve,
|
|
5077
5214
|
isDark: be,
|
|
5078
|
-
chat:
|
|
5079
|
-
messages:
|
|
5080
|
-
conversations:
|
|
5081
|
-
isLoadingConversations:
|
|
5082
|
-
hasMoreConversations:
|
|
5083
|
-
isLoadingMoreConversations:
|
|
5084
|
-
chatFiles:
|
|
5085
|
-
isLoadingChatFiles:
|
|
5086
|
-
input:
|
|
5087
|
-
pendingAttachments:
|
|
5088
|
-
isAttachmentLimitReached:
|
|
5089
|
-
fileLimitError:
|
|
5215
|
+
chat: L,
|
|
5216
|
+
messages: mn,
|
|
5217
|
+
conversations: V,
|
|
5218
|
+
isLoadingConversations: Cn,
|
|
5219
|
+
hasMoreConversations: Tn,
|
|
5220
|
+
isLoadingMoreConversations: En,
|
|
5221
|
+
chatFiles: On,
|
|
5222
|
+
isLoadingChatFiles: kn,
|
|
5223
|
+
input: W,
|
|
5224
|
+
pendingAttachments: G,
|
|
5225
|
+
isAttachmentLimitReached: Gr,
|
|
5226
|
+
fileLimitError: Kr,
|
|
5090
5227
|
localChatId: C,
|
|
5091
|
-
isConversationBlocked:
|
|
5092
|
-
inputMessagePlaceholder:
|
|
5093
|
-
chatError:
|
|
5094
|
-
runningChatIds:
|
|
5095
|
-
backgroundAnswers:
|
|
5096
|
-
openBackgroundAnswer:
|
|
5097
|
-
dismissBackgroundAnswer:
|
|
5098
|
-
canQueue:
|
|
5099
|
-
queuedMessages:
|
|
5100
|
-
removeQueuedMessage:
|
|
5101
|
-
editQueuedMessage:
|
|
5102
|
-
activeView:
|
|
5103
|
-
inputFocusRequest:
|
|
5104
|
-
messageFeedbacks:
|
|
5105
|
-
feedbackDialogMessage:
|
|
5106
|
-
isFeedbackSubmitting:
|
|
5107
|
-
isFeedbackSubmitted:
|
|
5108
|
-
feedbackSubmitError:
|
|
5109
|
-
isLeadSubmitted:
|
|
5110
|
-
isLoadingSubmitLead:
|
|
5111
|
-
submitLeadError:
|
|
5112
|
-
buildDeviceContext:
|
|
5113
|
-
initialize:
|
|
5114
|
-
loadConversations:
|
|
5115
|
-
loadMoreConversations:
|
|
5116
|
-
projectsEnabled:
|
|
5117
|
-
chatAuthorId:
|
|
5118
|
-
chatProjectId:
|
|
5119
|
-
isReadOnlyChat:
|
|
5120
|
-
describeChat:
|
|
5121
|
-
searchConversations:
|
|
5122
|
-
loadChatFiles:
|
|
5123
|
-
refreshMessages:
|
|
5124
|
-
appendMessage:
|
|
5125
|
-
getChatFileUrl:
|
|
5126
|
-
getChatFilePreviewUrl:
|
|
5127
|
-
deleteChatFile:
|
|
5128
|
-
handleSubmit:
|
|
5129
|
-
sendMessage:
|
|
5130
|
-
stopGeneration:
|
|
5131
|
-
startNewChat:
|
|
5132
|
-
regenerate:
|
|
5133
|
-
addToolOutput:
|
|
5134
|
-
addToolApprovalResponse:
|
|
5135
|
-
handleFileSelect:
|
|
5136
|
-
discardPendingAttachment:
|
|
5137
|
-
replacePendingAttachment:
|
|
5138
|
-
retryPendingAttachment:
|
|
5139
|
-
clearFileLimitError:
|
|
5140
|
-
clearPendingAttachments:
|
|
5141
|
-
onUpvote:
|
|
5142
|
-
onDownvote:
|
|
5143
|
-
onFeedback:
|
|
5144
|
-
onFeedbackSubmit:
|
|
5145
|
-
onLeadSubmit:
|
|
5146
|
-
navigate:
|
|
5147
|
-
focusInput:
|
|
5148
|
-
renameChatTitle:
|
|
5149
|
-
deleteChat:
|
|
5228
|
+
isConversationBlocked: jt,
|
|
5229
|
+
inputMessagePlaceholder: hn,
|
|
5230
|
+
chatError: At,
|
|
5231
|
+
runningChatIds: J,
|
|
5232
|
+
backgroundAnswers: Nr,
|
|
5233
|
+
openBackgroundAnswer: Pr,
|
|
5234
|
+
dismissBackgroundAnswer: Fr,
|
|
5235
|
+
canQueue: Un,
|
|
5236
|
+
queuedMessages: Hn,
|
|
5237
|
+
removeQueuedMessage: qn,
|
|
5238
|
+
editQueuedMessage: Jn,
|
|
5239
|
+
activeView: An,
|
|
5240
|
+
inputFocusRequest: jn,
|
|
5241
|
+
messageFeedbacks: Mn,
|
|
5242
|
+
feedbackDialogMessage: Nn,
|
|
5243
|
+
isFeedbackSubmitting: H,
|
|
5244
|
+
isFeedbackSubmitted: Pn,
|
|
5245
|
+
feedbackSubmitError: Fn,
|
|
5246
|
+
isLeadSubmitted: In,
|
|
5247
|
+
isLoadingSubmitLead: Ln,
|
|
5248
|
+
submitLeadError: U,
|
|
5249
|
+
buildDeviceContext: It,
|
|
5250
|
+
initialize: _r,
|
|
5251
|
+
loadConversations: Yn,
|
|
5252
|
+
loadMoreConversations: Xn,
|
|
5253
|
+
projectsEnabled: gn,
|
|
5254
|
+
chatAuthorId: yn,
|
|
5255
|
+
chatProjectId: bn,
|
|
5256
|
+
isReadOnlyChat: B,
|
|
5257
|
+
describeChat: z,
|
|
5258
|
+
searchConversations: Zn,
|
|
5259
|
+
loadChatFiles: Qn,
|
|
5260
|
+
refreshMessages: fr,
|
|
5261
|
+
appendMessage: pr,
|
|
5262
|
+
getChatFileUrl: $n,
|
|
5263
|
+
getChatFilePreviewUrl: er,
|
|
5264
|
+
deleteChatFile: tr,
|
|
5265
|
+
handleSubmit: vr,
|
|
5266
|
+
sendMessage: xr,
|
|
5267
|
+
stopGeneration: Sr,
|
|
5268
|
+
startNewChat: Lr,
|
|
5269
|
+
regenerate: Rr,
|
|
5270
|
+
addToolOutput: zr,
|
|
5271
|
+
addToolApprovalResponse: Br,
|
|
5272
|
+
handleFileSelect: Jr,
|
|
5273
|
+
discardPendingAttachment: $r,
|
|
5274
|
+
replacePendingAttachment: Yr,
|
|
5275
|
+
retryPendingAttachment: Xr,
|
|
5276
|
+
clearFileLimitError: qr,
|
|
5277
|
+
clearPendingAttachments: Ir,
|
|
5278
|
+
onUpvote: ni,
|
|
5279
|
+
onDownvote: ri,
|
|
5280
|
+
onFeedback: ii,
|
|
5281
|
+
onFeedbackSubmit: ai,
|
|
5282
|
+
onLeadSubmit: oi,
|
|
5283
|
+
navigate: li,
|
|
5284
|
+
focusInput: ui,
|
|
5285
|
+
renameChatTitle: si,
|
|
5286
|
+
deleteChat: ci
|
|
5150
5287
|
};
|
|
5151
5288
|
})();
|
|
5152
5289
|
}
|
|
5153
|
-
export {
|
|
5290
|
+
export { un as a, ha as i, po as n, Ka as r, qa as t };
|
|
5154
5291
|
|
|
5155
|
-
//# sourceMappingURL=useChatbotStore-
|
|
5292
|
+
//# sourceMappingURL=useChatbotStore-DZlc7dzK.js.map
|