@8wave/ai-elements 0.120.0 → 0.121.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/README.md +60 -7
  2. package/dist/_chunks/{Agent-BYC51e6E.js → Agent-7rbrjWzu.js} +64 -58
  3. package/dist/_chunks/Agent-7rbrjWzu.js.map +1 -0
  4. package/dist/_chunks/{PkStreamingMarkdown-CNoHyTuC.js → PkStreamingMarkdown-BnClGp-3.js} +826 -831
  5. package/dist/_chunks/PkStreamingMarkdown-BnClGp-3.js.map +1 -0
  6. package/dist/_chunks/{PkToolEditSpreadsheet-B8bO3vZa.js → PkToolEditSpreadsheet-D4M6BUKx.js} +2 -2
  7. package/dist/_chunks/{PkToolEditSpreadsheet-B8bO3vZa.js.map → PkToolEditSpreadsheet-D4M6BUKx.js.map} +1 -1
  8. package/dist/_chunks/{PkToolRequestGeolocation-DrvL0h9d.js → PkToolRequestGeolocation-DmOoFghZ.js} +2 -2
  9. package/dist/_chunks/{PkToolRequestGeolocation-DrvL0h9d.js.map → PkToolRequestGeolocation-DmOoFghZ.js.map} +1 -1
  10. package/dist/_chunks/{PkToolRequestOAuthConnection-BXti5Vkt.js → PkToolRequestOAuthConnection-DV0sfojC.js} +2 -2
  11. package/dist/_chunks/{PkToolRequestOAuthConnection-BXti5Vkt.js.map → PkToolRequestOAuthConnection-DV0sfojC.js.map} +1 -1
  12. package/dist/_chunks/{PkToolShowArtifact-DR71LNck.js → PkToolShowArtifact-V0a8zhdO.js} +2 -2
  13. package/dist/_chunks/{PkToolShowArtifact-DR71LNck.js.map → PkToolShowArtifact-V0a8zhdO.js.map} +1 -1
  14. package/dist/_chunks/{PkToolShowContactForm-C4BshHSs.js → PkToolShowContactForm-sLhBxf9e.js} +2 -2
  15. package/dist/_chunks/{PkToolShowContactForm-C4BshHSs.js.map → PkToolShowContactForm-sLhBxf9e.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowForm-BLSTn0xE.js → PkToolShowForm-Dl2k9jqk.js} +3 -3
  17. package/dist/_chunks/{PkToolShowForm-BLSTn0xE.js.map → PkToolShowForm-Dl2k9jqk.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowImageGallery-CqOXbo0Y.js → PkToolShowImageGallery-CTsq_DPb.js} +2 -2
  19. package/dist/_chunks/{PkToolShowImageGallery-CqOXbo0Y.js.map → PkToolShowImageGallery-CTsq_DPb.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowProductList-westY5bY.js → PkToolShowProductList-CpdKWQkP.js} +2 -2
  21. package/dist/_chunks/{PkToolShowProductList-westY5bY.js.map → PkToolShowProductList-CpdKWQkP.js.map} +1 -1
  22. package/dist/_chunks/{PkToolShowSources-Dy9VXRgv.js → PkToolShowSources-WFm2JF0r.js} +3 -3
  23. package/dist/_chunks/{PkToolShowSources-Dy9VXRgv.js.map → PkToolShowSources-WFm2JF0r.js.map} +1 -1
  24. package/dist/_chunks/{PkToolShowSuggestedReply-BZ2U3ULB.js → PkToolShowSuggestedReply-RcL_3RAz.js} +2 -2
  25. package/dist/_chunks/{PkToolShowSuggestedReply-BZ2U3ULB.js.map → PkToolShowSuggestedReply-RcL_3RAz.js.map} +1 -1
  26. package/dist/_chunks/{PkToolShowVideo-CrFaQbMp.js → PkToolShowVideo-Ua5heyl1.js} +2 -2
  27. package/dist/_chunks/{PkToolShowVideo-CrFaQbMp.js.map → PkToolShowVideo-Ua5heyl1.js.map} +1 -1
  28. package/dist/_chunks/{PkToolShowWebPages-DXszshY9.js → PkToolShowWebPages-STOCnsKm.js} +2 -2
  29. package/dist/_chunks/{PkToolShowWebPages-DXszshY9.js.map → PkToolShowWebPages-STOCnsKm.js.map} +1 -1
  30. package/dist/_chunks/{chatImagePolicy-B5-QV037.js → chatImagePolicy-C8X_GMnS.js} +2 -2
  31. package/dist/_chunks/{chatImagePolicy-B5-QV037.js.map → chatImagePolicy-C8X_GMnS.js.map} +1 -1
  32. package/dist/_chunks/{markdown-DO_FLvlJ.js → markdown-EqEd3eyd.js} +10 -10
  33. package/dist/_chunks/{markdown-DO_FLvlJ.js.map → markdown-EqEd3eyd.js.map} +1 -1
  34. package/dist/ai-elements.es.js +1439 -1445
  35. package/dist/ai-elements.es.js.map +1 -1
  36. package/dist-vue/PkChatbot.js +1 -1
  37. package/dist-vue/PkChatbotEmptyState.js +1 -1
  38. package/dist-vue/PkChatbotInput.js +1 -1
  39. package/dist-vue/PkChatbotMessages.js +1 -1
  40. package/dist-vue/PkChatbotStepPayload.js +1 -1
  41. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  42. package/dist-vue/PkChatbotSteps.js +1 -1
  43. package/dist-vue/PkChatbotViewChat.js +1 -1
  44. package/dist-vue/PkChatbotViewConversations.js +1 -1
  45. package/dist-vue/PkChatbotViewFiles.js +1 -1
  46. package/dist-vue/PkChatbotViewProfile.js +1 -1
  47. package/dist-vue/_chunks/{Agent-2DVqpLwz.js → Agent-SH2vEFKs.js} +63 -57
  48. package/dist-vue/_chunks/Agent-SH2vEFKs.js.map +1 -0
  49. package/dist-vue/_chunks/{Document-ChfbOVVs.js → Document-fmCxsccF.js} +10 -10
  50. package/dist-vue/_chunks/{Document-ChfbOVVs.js.map → Document-fmCxsccF.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkChatbot-DlHWtWhL.js → PkChatbot-DlIEIjKJ.js} +8 -8
  52. package/dist-vue/_chunks/{PkChatbot-DlHWtWhL.js.map → PkChatbot-DlIEIjKJ.js.map} +1 -1
  53. package/dist-vue/_chunks/{PkChatbotEmptyState-DqzgF4vH.js → PkChatbotEmptyState-Bcozn56E.js} +2 -2
  54. package/dist-vue/_chunks/{PkChatbotEmptyState-DqzgF4vH.js.map → PkChatbotEmptyState-Bcozn56E.js.map} +1 -1
  55. package/dist-vue/_chunks/PkChatbotInput-DQVpDLNp.js +390 -0
  56. package/dist-vue/_chunks/PkChatbotInput-DQVpDLNp.js.map +1 -0
  57. package/dist-vue/_chunks/{PkChatbotMessages-DEasGGn_.js → PkChatbotMessages-BYFozlwC.js} +22 -18
  58. package/dist-vue/_chunks/PkChatbotMessages-BYFozlwC.js.map +1 -0
  59. package/dist-vue/_chunks/{PkChatbotStepPayload-Bga_HEps.js → PkChatbotStepPayload-DjntsSlX.js} +2 -2
  60. package/dist-vue/_chunks/{PkChatbotStepPayload-Bga_HEps.js.map → PkChatbotStepPayload-DjntsSlX.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkChatbotStepToolDetail-YbUYP-Y3.js → PkChatbotStepToolDetail-If9goNdY.js} +3 -3
  62. package/dist-vue/_chunks/{PkChatbotStepToolDetail-YbUYP-Y3.js.map → PkChatbotStepToolDetail-If9goNdY.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkChatbotSteps-CVAkaIzk.js → PkChatbotSteps-DUFfniZn.js} +5 -5
  64. package/dist-vue/_chunks/{PkChatbotSteps-CVAkaIzk.js.map → PkChatbotSteps-DUFfniZn.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkChatbotViewChat-BEKVeEmo.js → PkChatbotViewChat-BGoltDr9.js} +8 -11
  66. package/dist-vue/_chunks/PkChatbotViewChat-BGoltDr9.js.map +1 -0
  67. package/dist-vue/_chunks/{PkChatbotViewConversations-BHvHF0w7.js → PkChatbotViewConversations-WUpRm6GG.js} +3 -3
  68. package/dist-vue/_chunks/{PkChatbotViewConversations-BHvHF0w7.js.map → PkChatbotViewConversations-WUpRm6GG.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkChatbotViewFiles-C-4__qj_.js → PkChatbotViewFiles-CpG_LRg6.js} +3 -3
  70. package/dist-vue/_chunks/{PkChatbotViewFiles-C-4__qj_.js.map → PkChatbotViewFiles-CpG_LRg6.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkChatbotViewProfile-_WMSVDlA.js → PkChatbotViewProfile-DetQJa7E.js} +2 -2
  72. package/dist-vue/_chunks/{PkChatbotViewProfile-_WMSVDlA.js.map → PkChatbotViewProfile-DetQJa7E.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkStreamingMarkdown-6Y7qgbvS.js → PkStreamingMarkdown-DLKEIMcZ.js} +3 -3
  74. package/dist-vue/_chunks/{PkStreamingMarkdown-6Y7qgbvS.js.map → PkStreamingMarkdown-DLKEIMcZ.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkToolEditSpreadsheet-BTauPyXT.js → PkToolEditSpreadsheet-D2JtjXef.js} +2 -2
  76. package/dist-vue/_chunks/{PkToolEditSpreadsheet-BTauPyXT.js.map → PkToolEditSpreadsheet-D2JtjXef.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkToolRequestGeolocation-DBzup6bn.js → PkToolRequestGeolocation--MTT__Vu.js} +2 -2
  78. package/dist-vue/_chunks/{PkToolRequestGeolocation-DBzup6bn.js.map → PkToolRequestGeolocation--MTT__Vu.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-yrRDpNqp.js → PkToolRequestOAuthConnection-Gb_qfvlN.js} +2 -2
  80. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-yrRDpNqp.js.map → PkToolRequestOAuthConnection-Gb_qfvlN.js.map} +1 -1
  81. package/dist-vue/_chunks/{PkToolShowArtifact-fp37O1om.js → PkToolShowArtifact-BWVntj9H.js} +2 -2
  82. package/dist-vue/_chunks/{PkToolShowArtifact-fp37O1om.js.map → PkToolShowArtifact-BWVntj9H.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkToolShowContactForm-iSx2ioyT.js → PkToolShowContactForm-BbBt3ha0.js} +2 -2
  84. package/dist-vue/_chunks/{PkToolShowContactForm-iSx2ioyT.js.map → PkToolShowContactForm-BbBt3ha0.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkToolShowDiagram-BlKrh4gK.js → PkToolShowDiagram-CE6KHz1M.js} +2 -2
  86. package/dist-vue/_chunks/{PkToolShowDiagram-BlKrh4gK.js.map → PkToolShowDiagram-CE6KHz1M.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkToolShowForm-CwlXH13N.js → PkToolShowForm-CNm8HSUW.js} +4 -4
  88. package/dist-vue/_chunks/{PkToolShowForm-CwlXH13N.js.map → PkToolShowForm-CNm8HSUW.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkToolShowImageGallery-C4esYiM_.js → PkToolShowImageGallery-6k3ituoi.js} +2 -2
  90. package/dist-vue/_chunks/{PkToolShowImageGallery-C4esYiM_.js.map → PkToolShowImageGallery-6k3ituoi.js.map} +1 -1
  91. package/dist-vue/_chunks/{PkToolShowProductList-CdeYQ-mF.js → PkToolShowProductList-Bu-pUg5d.js} +2 -2
  92. package/dist-vue/_chunks/{PkToolShowProductList-CdeYQ-mF.js.map → PkToolShowProductList-Bu-pUg5d.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkToolShowSources-D8IF7g0d.js → PkToolShowSources-DTWNZqWu.js} +3 -3
  94. package/dist-vue/_chunks/{PkToolShowSources-D8IF7g0d.js.map → PkToolShowSources-DTWNZqWu.js.map} +1 -1
  95. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DXyO8ki2.js → PkToolShowSuggestedReply-DSXhqWhx.js} +2 -2
  96. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DXyO8ki2.js.map → PkToolShowSuggestedReply-DSXhqWhx.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkToolShowVideo-CA7MNSp_.js → PkToolShowVideo-C0ycBiOI.js} +2 -2
  98. package/dist-vue/_chunks/{PkToolShowVideo-CA7MNSp_.js.map → PkToolShowVideo-C0ycBiOI.js.map} +1 -1
  99. package/dist-vue/_chunks/{PkToolShowWebPages-CKWnAbp8.js → PkToolShowWebPages-CWWv1tr5.js} +2 -2
  100. package/dist-vue/_chunks/{PkToolShowWebPages-CKWnAbp8.js.map → PkToolShowWebPages-CWWv1tr5.js.map} +1 -1
  101. package/dist-vue/_chunks/{createChatbotApiClient-DecVahlB.js → createChatbotApiClient-MbfcTdwY.js} +16 -16
  102. package/dist-vue/_chunks/{createChatbotApiClient-DecVahlB.js.map → createChatbotApiClient-MbfcTdwY.js.map} +1 -1
  103. package/dist-vue/_chunks/{useChatbotStore-BQTq8fq-.js → useChatbotStore-DDSgrRzg.js} +1143 -1143
  104. package/dist-vue/_chunks/{useChatbotStore-BQTq8fq-.js.map → useChatbotStore-DDSgrRzg.js.map} +1 -1
  105. package/dist-vue/_chunks/{utils-BLMOBcka.js → utils-B9-Vt10H.js} +35 -40
  106. package/dist-vue/_chunks/utils-B9-Vt10H.js.map +1 -0
  107. package/dist-vue/api.js +1 -1
  108. package/dist-vue/composables.js +10 -8
  109. package/dist-vue/composables.js.map +1 -1
  110. package/dist-vue/index.js +4801 -4729
  111. package/dist-vue/index.js.map +1 -1
  112. package/dist-vue/locales.js +20 -4
  113. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +5 -2
  114. package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +3 -4
  115. package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +10 -0
  116. package/dist-vue/packages/components/src/chat/PkWebSearchSettings.d.ts +2 -0
  117. package/dist-vue/packages/components/src/table/PkTableSortable.d.ts +1 -1
  118. package/dist-vue/packages/composable/src/chatbot/useGreeting.d.ts +5 -3
  119. package/dist-vue/packages/models/src/schema/Agent.d.ts +14 -0
  120. package/dist-vue/style.css +1 -1
  121. package/package.json +1 -1
  122. package/dist/_chunks/Agent-BYC51e6E.js.map +0 -1
  123. package/dist/_chunks/PkStreamingMarkdown-CNoHyTuC.js.map +0 -1
  124. package/dist-vue/_chunks/Agent-2DVqpLwz.js.map +0 -1
  125. package/dist-vue/_chunks/PkChatbotInput-CQup254H.js +0 -399
  126. package/dist-vue/_chunks/PkChatbotInput-CQup254H.js.map +0 -1
  127. package/dist-vue/_chunks/PkChatbotMessages-DEasGGn_.js.map +0 -1
  128. package/dist-vue/_chunks/PkChatbotViewChat-BEKVeEmo.js.map +0 -1
  129. package/dist-vue/_chunks/utils-BLMOBcka.js.map +0 -1
package/README.md CHANGED
@@ -81,7 +81,11 @@ Copy it from **Embed > Chat widget**: its host is the backend of your installati
81
81
  published yet), or the agent's widget URL in **Embed** when it has one, see
82
82
  [Dedicated installations](#dedicated-installations);
83
83
  3. creates `<floating-chat-widget organization-slug agent-id base-url>` and appends it to
84
- `<body>`.
84
+ `<body>`, with your user's token when its tag carries one, see
85
+ [Your signed-in user with `embed.js`](#your-signed-in-user-with-embedjs).
86
+
87
+ The tag can go in `<head>` or `<body>`, with or without `defer`: when the bundle is ready before
88
+ the page has a `<body>` (the tag in `<head>`, a slow script after it), the widget waits for it.
85
89
 
86
90
  It answers 404 when the agent does not exist or its **Widget** channel is off. Browsers and CDNs
87
91
  may keep it for up to ten minutes, so a new loader strategy or delay is not immediate.
@@ -95,7 +99,9 @@ Loader strategies, for sites where the default fails:
95
99
  | **Dynamic import** | `import()` inside a classic script | Pages whose loaders intercept module scripts |
96
100
 
97
101
  > Never put `embed.js` and your own `<floating-chat-widget>` for the same agent on one page: by
98
- > step 1 the script then loads nothing, and your element never becomes a widget.
102
+ > step 1 the script then loads nothing, and your element never becomes a widget. Put the snippet
103
+ > once per page, too: with two tags for the same agent (one in the HTML, one from a tag manager)
104
+ > the first to run mounts the widget, and the attributes of the other are ignored.
99
105
 
100
106
  ### Talking to the widget `embed.js` created
101
107
 
@@ -138,10 +144,54 @@ document.querySelector('#ask-about-this').addEventListener('click', () => {
138
144
  - Listen to the [events](#events) on `document`: they bubble out of the widget, so the listener
139
145
  needs no element and catches the first `signed-in` and `ready` too.
140
146
  - Tools registered as soon as the widget appears go with the first message the user sends.
141
- - To hand the widget your signed-in user, call `widget.signIn(token)`: an anonymous session it
142
- may have started is upgraded to that user.
143
- - `await-external-token` and `cookie-name` are read when the widget starts, before your code can
144
- reach it. A page that needs them places its own element with `loader.js`.
147
+ - To hand the widget your signed-in user, put the token on the script's tag (next section).
148
+ `widget.signIn(token)` works too: an anonymous session the widget may have started is upgraded
149
+ to that user.
150
+ - `cookie-name` is read when the widget starts, before your code can reach it. A page that needs
151
+ it places its own element with `loader.js`.
152
+
153
+ ### Your signed-in user with `embed.js`
154
+
155
+ Put the user's token on the tag that loads the script, never in its URL: the script is the same
156
+ for every visitor, and browsers and CDNs keep it.
157
+
158
+ ```html
159
+ <script id="eightwave-chat" src="https://ai-api.8wave.it/api/v1/public/organizations/<organization-slug>/agents/<agent-id>/embed.js"
160
+ data-external-token="eyJhbGciOiJSUzI1NiIs..." defer></script>
161
+ ```
162
+
163
+ - `data-external-token` becomes the widget's [`external-token`](#external-token-jwt), with the
164
+ same rules, and stays in step with it for as long as the page lives: set it, change it or clear
165
+ it (empty, or remove the attribute) on the tag, before or after the widget appears, and the
166
+ widget follows.
167
+ - `data-await-external-token` becomes `await-external-token`: no anonymous session is created
168
+ while your page fetches the token. It is read once, when the widget starts.
169
+
170
+ When the token arrives after the page has loaded:
171
+
172
+ ```html
173
+ <script id="eightwave-chat" src="https://ai-api.8wave.it/api/v1/public/organizations/<organization-slug>/agents/<agent-id>/embed.js"
174
+ data-await-external-token defer></script>
175
+ ```
176
+
177
+ ```js
178
+ const chat = document.getElementById('eightwave-chat')
179
+ chat.dataset.externalToken = await fetchTokenFromMyApi() // one session, the user's
180
+
181
+ // The same user's next token, before the current one expires
182
+ document.addEventListener('external-token-expiring', async () => {
183
+ chat.dataset.externalToken = await fetchTokenFromMyApi()
184
+ })
185
+
186
+ // When the user signs out of your site
187
+ delete chat.dataset.externalToken
188
+ ```
189
+
190
+ The script finds its tag through `document.currentScript`, the script element running at that
191
+ moment, so it must run from its own `<script src>` tag, as in the snippet. Run any other way
192
+ (fetched and evaluated, or bundled into your code) it reads no tag, or the tag of the script that
193
+ runs it, and the widget starts without your user: call `signIn(token)` on it, or place
194
+ [your own element](#your-own-element-loaderjs).
145
195
 
146
196
  ### Your own element (`loader.js`)
147
197
 
@@ -396,7 +446,7 @@ the page narrows, sticky headers included. What does not:
396
446
  sets it, and an inline one comes back when the chat closes.
397
447
 
398
448
  Try push mode on your site before switching it on. The spec
399
- (`docs/specs/widget-copilot.md`) records how four public sites of different kinds behave.
449
+ (`docs/specs/released/widget-copilot.md`) records how four public sites of different kinds behave.
400
450
 
401
451
  ### Opening
402
452
 
@@ -452,6 +502,8 @@ lifecycle.
452
502
  restored session with the token: with a token it signs in again, and without one it signs the
453
503
  restored external session out. A user who signed out in another tab is signed out here too.
454
504
  - `signIn(token)` and `signOut()` do the same imperatively.
505
+ - With `embed.js` the attribute is set from the script's tag:
506
+ [`data-external-token`](#your-signed-in-user-with-embedjs).
455
507
 
456
508
  An agent can use MCP servers that receive the user's token (authentication type "External
457
509
  authentication token per user"). They need a valid token on every message, and your token
@@ -1083,6 +1135,7 @@ For whoever runs the backend:
1083
1135
  | The button never appears; `embed.js` answers 404 | The agent is not active, or its **Widget** channel is off | **General**: status and **Channels** |
1084
1136
  | CORS errors in the console, the widget never signs in | The page's origin is not in any agent's **Trusted origins** | List the exact origin (scheme, host, port); wait up to five minutes |
1085
1137
  | Your `<floating-chat-widget>` stays an empty element | `embed.js` found it and loaded nothing, or nothing loads the bundle | Use `loader.js` or the npm package with your own element |
1138
+ | The widget of `embed.js` ignores `data-external-token` | The script did not run from its own `<script src>` tag, or the page still holds a copy from before the release (cached up to ten minutes) | Load it with the snippet's tag; or call `signIn(token)` on the widget |
1086
1139
  | `widget.registerTool is not a function` | Called before the element was defined | `await customElements.whenDefined('floating-chat-widget')` first |
1087
1140
  | The agent never calls a tool you registered | **Accept the app's tools** off, the name not in **Allowed tools**, a reserved prefix, a name the agent already has, an invalid definition | Check the backoffice and the [definition rules](#the-definition); the server log names every dropped tool |
1088
1141
  | A tool call ends with "no answer" | `execute` exceeded **Maximum wait**, ignored its `signal`, or the tool was unregistered | Answer faster or raise the wait; keep the tool registered while the chat is open |
@@ -687,7 +687,13 @@ var lt = n({
687
687
  maxOptionsPerStep: s().int().min(2).max(10).optional().default(5)
688
688
  }), ut = /* @__PURE__ */ function(e) {
689
689
  return e.Perplexity = "perplexity", e.Parallel = "parallel", e.Native = "native", e;
690
- }({}), dt = n({
690
+ }({}), dt = [
691
+ "perplexity_search",
692
+ "parallel_search",
693
+ "web_search",
694
+ "openai_web_search",
695
+ "google_search"
696
+ ], ft = n({
691
697
  maxResults: s().int().min(1).max(20).optional(),
692
698
  maxTokens: s().int().positive().max(1e6).optional(),
693
699
  maxTokensPerPage: s().int().positive().optional(),
@@ -700,7 +706,7 @@ var lt = n({
700
706
  "month",
701
707
  "year"
702
708
  ]).optional()
703
- }), ft = n({
709
+ }), pt = n({
704
710
  mode: u(["one-shot", "agentic"]).optional(),
705
711
  maxResults: s().int().min(1).max(20).optional(),
706
712
  sourcePolicy: n({
@@ -713,7 +719,7 @@ var lt = n({
713
719
  maxCharsTotal: s().int().positive().optional()
714
720
  }).optional(),
715
721
  fetchPolicy: n({ maxAgeSeconds: s().int().positive().optional() }).optional()
716
- }), pt = n({
722
+ }), mt = n({
717
723
  openai: n({}).optional(),
718
724
  anthropic: n({
719
725
  maxUses: s().int().positive().optional(),
@@ -731,10 +737,10 @@ var lt = n({
731
737
  }), W = n({
732
738
  enabled: d().default(!1),
733
739
  provider: u(ut).optional().default(ut.Native),
734
- perplexity: dt.optional(),
735
- parallel: ft.optional(),
736
- native: pt.optional()
737
- }), mt = n({ useAllUserKb: d().default(!1) }), ht = n({ useAllUserFiles: d().default(!1) }), gt = n({ tools: c(i()).default([]) }), _t = n({
740
+ perplexity: ft.optional(),
741
+ parallel: pt.optional(),
742
+ native: mt.optional()
743
+ }), ht = n({ useAllUserKb: d().default(!1) }), gt = n({ useAllUserFiles: d().default(!1) }), _t = n({ tools: c(i()).default([]) }), vt = n({
738
744
  disabled: c(u(U)).default([
739
745
  U.UserMemory,
740
746
  U.SearchInUserFiles,
@@ -744,9 +750,9 @@ var lt = n({
744
750
  ]),
745
751
  showForm: lt.optional().default(() => lt.parse({})),
746
752
  webSearch: W.optional().default(() => W.parse({})),
747
- userMemory: mt.optional().default(() => mt.parse({})),
748
- userFiles: ht.optional().default(() => ht.parse({})),
749
- approval: gt.optional().default(() => gt.parse({}))
753
+ userMemory: ht.optional().default(() => ht.parse({})),
754
+ userFiles: gt.optional().default(() => gt.parse({})),
755
+ approval: _t.optional().default(() => _t.parse({}))
750
756
  }), G = n({
751
757
  freshness: n({
752
758
  enabled: d().default(!1),
@@ -759,7 +765,7 @@ var lt = n({
759
765
  diversity: s().min(0).max(1).default(.3),
760
766
  candidatesLimit: s().int().min(20).max(100).default(50)
761
767
  }).prefault({})
762
- }).prefault({}), vt = n({
768
+ }).prefault({}), yt = n({
763
769
  prompt: i().optional(),
764
770
  temperature: s().min(0).max(2).optional().default(.6),
765
771
  maxOutputTokens: s().positive().optional(),
@@ -770,7 +776,7 @@ var lt = n({
770
776
  maxStepCount: s().int().min(1).max(40).optional().default(10),
771
777
  reasoning: $e,
772
778
  ranking: G.optional().default(() => G.parse({}))
773
- }), K = g(t(), h(i(), i()), (e) => typeof e == "string" ? { it: e } : e), yt = "https://cdn.jsdelivr.net/npm/@8wave/ai-elements/dist/ai-elements.es.js", bt = /* @__PURE__ */ function(e) {
779
+ }), K = g(t(), h(i(), i()), (e) => typeof e == "string" ? { it: e } : e), bt = "https://cdn.jsdelivr.net/npm/@8wave/ai-elements/dist/ai-elements.es.js", xt = /* @__PURE__ */ function(e) {
774
780
  return e.InlineModule = "inline-module", e.ScriptSrc = "script-src", e.DynamicImport = "dynamic-import", e;
775
781
  }({}), q = /* @__PURE__ */ function(e) {
776
782
  return e.Floating = "floating", e.Copilot = "copilot", e;
@@ -778,7 +784,7 @@ var lt = n({
778
784
  return e.Overlay = "overlay", e.Push = "push", e;
779
785
  }({}), Y = /* @__PURE__ */ function(e) {
780
786
  return e.Frontoffice = "frontoffice", e.App = "app", e.Widget = "widget", e;
781
- }({}), xt = Object.values(Y), St = /^(?=.{1,253}$)([a-z0-9-]+\.)*[a-z0-9-]+$/;
787
+ }({}), X = Object.values(Y), St = /^(?=.{1,253}$)([a-z0-9-]+\.)*[a-z0-9-]+$/;
782
788
  function Ct(e) {
783
789
  let t = e.trim().toLowerCase();
784
790
  if (!t) return "";
@@ -788,7 +794,7 @@ function Ct(e) {
788
794
  return t;
789
795
  }
790
796
  }
791
- var X = n({
797
+ var Z = n({
792
798
  media: Ne.optional(),
793
799
  logo: i().optional(),
794
800
  theme: u([
@@ -817,9 +823,9 @@ var X = n({
817
823
  workingGlow: d().optional().default(!0),
818
824
  copilotPageCss: i().optional(),
819
825
  maxMessageLength: s().int().positive().optional(),
820
- widgetUrl: e().default(yt),
826
+ widgetUrl: e().default(bt),
821
827
  loadDelay: s().int().min(0).max(3e4).optional().default(0),
822
- loaderStrategy: u(bt).optional().default(bt.InlineModule),
828
+ loaderStrategy: u(xt).optional().default(xt.InlineModule),
823
829
  customCss: i().optional(),
824
830
  smoothStream: d().optional().default(!1),
825
831
  showExtendedSteps: d().optional().default(!1),
@@ -833,19 +839,19 @@ var X = n({
833
839
  "text/plain",
834
840
  "text/markdown",
835
841
  "text/csv"
836
- ], Tt = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", Z = n({
842
+ ], Tt = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", Q = n({
837
843
  enabled: d().default(!1),
838
844
  maxFileSizeBytes: s().int().positive().max(104857600).optional().default(20971520),
839
845
  allowedMimeTypes: c(i().regex(j)).optional().default([...wt]),
840
846
  maxFilesPerMessage: s().int().positive().max(10).optional().default(5),
841
847
  maxFilesPerChat: s().int().positive().max(50).optional().default(20)
842
- }), Q = n({
848
+ }), $ = n({
843
849
  zeroDataRetention: d().default(!0),
844
850
  disallowPromptTraining: d().default(!0),
845
851
  providerTimeoutMs: s().int().min(1e3).max(789e3).optional()
846
- }), Et = n({ enabled: d().default(!1) }), $ = /* @__PURE__ */ function(e) {
852
+ }), Et = n({ enabled: d().default(!1) }), Dt = /* @__PURE__ */ function(e) {
847
853
  return e.Off = "off", e.Shadow = "shadow", e.Active = "active", e;
848
- }({}), Dt = n({ mode: u($).default($.Off) }), Ot = n({
854
+ }({}), Ot = n({ mode: u(Dt).default(Dt.Off) }), kt = n({
849
855
  enabled: d().default(!1),
850
856
  voiceId: i().optional(),
851
857
  language: i().min(2).max(5).default("it"),
@@ -864,40 +870,40 @@ var X = n({
864
870
  providerAgentId: i().optional(),
865
871
  providerSecretId: i().optional(),
866
872
  providerApiKeyId: i().optional()
867
- }), kt = n({ enabled: d() });
873
+ }), At = n({ enabled: d() });
868
874
  n({
869
875
  chatId: i().min(1).optional(),
870
876
  deviceContext: le.optional(),
871
877
  externalContext: h(i(), t()).optional()
872
878
  });
873
- var At = n({
879
+ var jt = n({
874
880
  sessionId: i(),
875
881
  signedUrl: i(),
876
882
  providerAgentId: i(),
877
883
  chatId: i(),
878
884
  maxSessionSeconds: s().int()
879
- }), jt = n({
885
+ }), Mt = n({
880
886
  voiceId: i(),
881
887
  name: i(),
882
888
  category: i().optional(),
883
889
  previewUrl: i().optional(),
884
890
  labels: h(i(), i()).optional()
885
891
  });
886
- c(jt);
887
- var Mt = n({
888
- model: vt,
889
- interface: X,
890
- tools: _t.optional().default(() => _t.parse({})),
891
- fileUpload: Z.optional().default(() => Z.parse({})),
892
- gatewayOptions: Q.optional().default(() => Q.parse({})),
893
- channels: c(u(Y)).optional().default(() => [...xt]),
892
+ c(Mt);
893
+ var Nt = n({
894
+ model: yt,
895
+ interface: Z,
896
+ tools: vt.optional().default(() => vt.parse({})),
897
+ fileUpload: Q.optional().default(() => Q.parse({})),
898
+ gatewayOptions: $.optional().default(() => $.parse({})),
899
+ channels: c(u(Y)).optional().default(() => [...X]),
894
900
  externalContextSchema: re.optional(),
895
901
  openaiApi: Et.optional().default(() => Et.parse({})),
896
- voice: Ot.optional().default(() => Ot.parse({})),
897
- toolWorkingSet: Dt.optional().default(() => Dt.parse({})),
902
+ voice: kt.optional().default(() => kt.parse({})),
903
+ toolWorkingSet: Ot.optional().default(() => Ot.parse({})),
898
904
  hostTools: pe.optional(),
899
905
  pageAccess: xe.optional()
900
- }), Nt = n({
906
+ }), Pt = n({
901
907
  rateLimits: n({
902
908
  minuteRateLimit: s().int().min(0).optional(),
903
909
  hourRateLimit: s().int().min(0).optional(),
@@ -914,8 +920,8 @@ n({
914
920
  fallbackModels: c(i()).default([]),
915
921
  status: u(I).default(I.Draft),
916
922
  visibility: u(L).default(L.Organization),
917
- settings: Mt,
918
- security: Nt.nullish(),
923
+ settings: Nt,
924
+ security: Pt.nullish(),
919
925
  type: u(R).default(R.Chat),
920
926
  organizationId: i()
921
927
  }), o(() => n({
@@ -926,8 +932,8 @@ n({
926
932
  fallbackModels: c(i()).nullable().default([]),
927
933
  status: u(I).default(I.Draft),
928
934
  visibility: u(L).default(L.Organization),
929
- settings: Mt,
930
- security: Nt.nullable(),
935
+ settings: Nt,
936
+ security: Pt.nullable(),
931
937
  type: u(R).default(R.Chat),
932
938
  organizationId: i(),
933
939
  createdAt: f(),
@@ -940,23 +946,23 @@ n({
940
946
  outOfBudget: d().optional().default(!1),
941
947
  outOfBudgetReason: i().optional().default("")
942
948
  }));
943
- var Pt = n({
949
+ var Ft = n({
944
950
  id: i(),
945
951
  name: i(),
946
952
  status: u(I),
947
953
  visibility: u(L),
948
954
  organizationId: i(),
949
- interface: X,
955
+ interface: Z,
950
956
  createdAt: f(),
951
957
  updatedAt: f(),
952
958
  capabilities: n({
953
- fileUpload: Z,
954
- voice: kt,
959
+ fileUpload: Q,
960
+ voice: At,
955
961
  hostTools: me.optional(),
956
962
  pageAccess: Ce.optional()
957
963
  }),
958
- channels: c(u(Y)).default(() => [...xt])
959
- }), Ft = X.pick({
964
+ channels: c(u(Y)).default(() => [...X])
965
+ }), It = Z.pick({
960
966
  logo: !0,
961
967
  mainColor: !0,
962
968
  textColor: !0,
@@ -966,36 +972,36 @@ var Pt = n({
966
972
  copilotFrame: !0,
967
973
  copilotPageCss: !0,
968
974
  customCss: !0
969
- }), It = Pt.pick({
975
+ }), Lt = Ft.pick({
970
976
  id: !0,
971
977
  name: !0,
972
978
  organizationId: !0
973
- }).extend({ interface: Ft }), Lt = n({
979
+ }).extend({ interface: It }), Rt = n({
974
980
  emailPassword: d(),
975
981
  google: d(),
976
982
  microsoft: d()
977
- }), Rt = n({
983
+ }), zt = n({
978
984
  requiresAuth: l(!1),
979
- agent: Pt,
985
+ agent: Ft,
980
986
  branding: r()
981
- }), zt = n({
987
+ }), Bt = n({
982
988
  requiresAuth: l(!0),
983
989
  agent: r(),
984
- branding: It
990
+ branding: Lt
985
991
  });
986
- p("requiresAuth", [Rt, zt]);
987
- var Bt = n({
992
+ p("requiresAuth", [zt, Bt]);
993
+ var Vt = n({
988
994
  frontendUrl: i().optional(),
989
995
  telemetry: n({
990
996
  environment: i(),
991
997
  samplingRate: s().min(0).max(1)
992
998
  }).nullable()
993
- }), Vt = n({
994
- authMethods: Lt,
999
+ }), Ht = n({
1000
+ authMethods: Rt,
995
1001
  deploymentBranding: se.nullish(),
996
- deployment: Bt.optional()
1002
+ deployment: Vt.optional()
997
1003
  });
998
- p("requiresAuth", [Rt.extend(Vt.shape), zt.extend(Vt.shape)]), n({
1004
+ p("requiresAuth", [zt.extend(Ht.shape), Bt.extend(Ht.shape)]), n({
999
1005
  id: m(),
1000
1006
  agentIds: c(m())
1001
1007
  }), n({
@@ -1016,6 +1022,6 @@ p("requiresAuth", [Rt.extend(Vt.shape), zt.extend(Vt.shape)]), n({
1016
1022
  ..._.ids()
1017
1023
  });
1018
1024
  //#endregion
1019
- export { ue as A, De as C, be as D, Se as E, _ as F, he as M, le as N, ye as O, g as P, Oe as S, A as T, at as _, G as a, j as b, W as c, Tt as d, nt as f, rt as g, At as h, Q as i, ge as j, _e as k, q as l, ot as m, U as n, $e as o, it as p, J as r, z as s, tt as t, et as u, ct as v, Ee as w, Ne as x, Ct as y };
1025
+ export { _e as A, Oe as C, Se as D, A as E, g as F, _ as I, ge as M, he as N, be as O, le as P, Ne as S, Ee as T, rt as _, G as a, Ct as b, W as c, Tt as d, nt as f, dt as g, jt as h, $ as i, ue as j, ye as k, q as l, ot as m, U as n, $e as o, it as p, J as r, z as s, tt as t, et as u, at as v, De as w, j as x, ct as y };
1020
1026
 
1021
- //# sourceMappingURL=Agent-BYC51e6E.js.map
1027
+ //# sourceMappingURL=Agent-7rbrjWzu.js.map