@8wave/ai-elements 0.121.0-beta.15 → 0.121.0-beta.17

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 (143) hide show
  1. package/README.md +125 -54
  2. package/dist/_chunks/{Agent-7rbrjWzu.js → Agent-wt8Vi99H.js} +7 -5
  3. package/dist/_chunks/Agent-wt8Vi99H.js.map +1 -0
  4. package/dist/_chunks/{PkStreamingMarkdown-BnClGp-3.js → PkStreamingMarkdown-Br7Z60Vm.js} +787 -777
  5. package/dist/_chunks/PkStreamingMarkdown-Br7Z60Vm.js.map +1 -0
  6. package/dist/_chunks/{PkToolEditSpreadsheet-D4M6BUKx.js → PkToolEditSpreadsheet-Di9czFTy.js} +2 -2
  7. package/dist/_chunks/{PkToolEditSpreadsheet-D4M6BUKx.js.map → PkToolEditSpreadsheet-Di9czFTy.js.map} +1 -1
  8. package/dist/_chunks/{PkToolRequestGeolocation-DmOoFghZ.js → PkToolRequestGeolocation-dUTqHsV-.js} +2 -2
  9. package/dist/_chunks/{PkToolRequestGeolocation-DmOoFghZ.js.map → PkToolRequestGeolocation-dUTqHsV-.js.map} +1 -1
  10. package/dist/_chunks/{PkToolRequestOAuthConnection-DV0sfojC.js → PkToolRequestOAuthConnection-cNDld72U.js} +2 -2
  11. package/dist/_chunks/{PkToolRequestOAuthConnection-DV0sfojC.js.map → PkToolRequestOAuthConnection-cNDld72U.js.map} +1 -1
  12. package/dist/_chunks/{PkToolShowArtifact-V0a8zhdO.js → PkToolShowArtifact-DtstlRsL.js} +2 -2
  13. package/dist/_chunks/{PkToolShowArtifact-V0a8zhdO.js.map → PkToolShowArtifact-DtstlRsL.js.map} +1 -1
  14. package/dist/_chunks/{PkToolShowContactForm-sLhBxf9e.js → PkToolShowContactForm-BKaKlYGJ.js} +2 -2
  15. package/dist/_chunks/{PkToolShowContactForm-sLhBxf9e.js.map → PkToolShowContactForm-BKaKlYGJ.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowForm-Dl2k9jqk.js → PkToolShowForm-OxANKx0g.js} +3 -3
  17. package/dist/_chunks/{PkToolShowForm-Dl2k9jqk.js.map → PkToolShowForm-OxANKx0g.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowImageGallery-CTsq_DPb.js → PkToolShowImageGallery-DRePOmUx.js} +2 -2
  19. package/dist/_chunks/{PkToolShowImageGallery-CTsq_DPb.js.map → PkToolShowImageGallery-DRePOmUx.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowProductList-CpdKWQkP.js → PkToolShowProductList-Y9HR_RJ4.js} +2 -2
  21. package/dist/_chunks/{PkToolShowProductList-CpdKWQkP.js.map → PkToolShowProductList-Y9HR_RJ4.js.map} +1 -1
  22. package/dist/_chunks/{PkToolShowSources-WFm2JF0r.js → PkToolShowSources-BQnaaL2a.js} +3 -3
  23. package/dist/_chunks/{PkToolShowSources-WFm2JF0r.js.map → PkToolShowSources-BQnaaL2a.js.map} +1 -1
  24. package/dist/_chunks/{PkToolShowSuggestedReply-RcL_3RAz.js → PkToolShowSuggestedReply-ghiXQuDz.js} +2 -2
  25. package/dist/_chunks/{PkToolShowSuggestedReply-RcL_3RAz.js.map → PkToolShowSuggestedReply-ghiXQuDz.js.map} +1 -1
  26. package/dist/_chunks/{PkToolShowVideo-Ua5heyl1.js → PkToolShowVideo-BcNWgJD7.js} +2 -2
  27. package/dist/_chunks/{PkToolShowVideo-Ua5heyl1.js.map → PkToolShowVideo-BcNWgJD7.js.map} +1 -1
  28. package/dist/_chunks/{PkToolShowWebPages-STOCnsKm.js → PkToolShowWebPages-Ba6DkV0V.js} +2 -2
  29. package/dist/_chunks/{PkToolShowWebPages-STOCnsKm.js.map → PkToolShowWebPages-Ba6DkV0V.js.map} +1 -1
  30. package/dist/_chunks/{chatImagePolicy-C8X_GMnS.js → chatImagePolicy-P0TZW1on.js} +2 -2
  31. package/dist/_chunks/{chatImagePolicy-C8X_GMnS.js.map → chatImagePolicy-P0TZW1on.js.map} +1 -1
  32. package/dist/_chunks/{markdown-EqEd3eyd.js → markdown-DLplFIBU.js} +2 -2
  33. package/dist/_chunks/{markdown-EqEd3eyd.js.map → markdown-DLplFIBU.js.map} +1 -1
  34. package/dist/ai-elements.es.js +4051 -3492
  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-SH2vEFKs.js → Agent-DcoF75y8.js} +7 -5
  48. package/dist-vue/_chunks/Agent-DcoF75y8.js.map +1 -0
  49. package/dist-vue/_chunks/{Document-fmCxsccF.js → Document-C1bD6VNU.js} +2 -2
  50. package/dist-vue/_chunks/{Document-fmCxsccF.js.map → Document-C1bD6VNU.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkChatbot-DlIEIjKJ.js → PkChatbot-wyaH2IgV.js} +9 -9
  52. package/dist-vue/_chunks/PkChatbot-wyaH2IgV.js.map +1 -0
  53. package/dist-vue/_chunks/{PkChatbotEmptyState-Bcozn56E.js → PkChatbotEmptyState-h2qZ0JOD.js} +2 -2
  54. package/dist-vue/_chunks/{PkChatbotEmptyState-Bcozn56E.js.map → PkChatbotEmptyState-h2qZ0JOD.js.map} +1 -1
  55. package/dist-vue/_chunks/{PkChatbotInput-DQVpDLNp.js → PkChatbotInput-C-bMNHC-.js} +87 -80
  56. package/dist-vue/_chunks/PkChatbotInput-C-bMNHC-.js.map +1 -0
  57. package/dist-vue/_chunks/{PkChatbotMessages-BYFozlwC.js → PkChatbotMessages-DU8qnlVX.js} +17 -17
  58. package/dist-vue/_chunks/{PkChatbotMessages-BYFozlwC.js.map → PkChatbotMessages-DU8qnlVX.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkChatbotStepPayload-DjntsSlX.js → PkChatbotStepPayload-BOxfKD1b.js} +2 -2
  60. package/dist-vue/_chunks/{PkChatbotStepPayload-DjntsSlX.js.map → PkChatbotStepPayload-BOxfKD1b.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkChatbotStepToolDetail-If9goNdY.js → PkChatbotStepToolDetail-Df6EOYxj.js} +3 -3
  62. package/dist-vue/_chunks/{PkChatbotStepToolDetail-If9goNdY.js.map → PkChatbotStepToolDetail-Df6EOYxj.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkChatbotSteps-DUFfniZn.js → PkChatbotSteps-DnDtN4Q7.js} +5 -5
  64. package/dist-vue/_chunks/{PkChatbotSteps-DUFfniZn.js.map → PkChatbotSteps-DnDtN4Q7.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkChatbotViewChat-BGoltDr9.js → PkChatbotViewChat-D4iupq1A.js} +7 -7
  66. package/dist-vue/_chunks/{PkChatbotViewChat-BGoltDr9.js.map → PkChatbotViewChat-D4iupq1A.js.map} +1 -1
  67. package/dist-vue/_chunks/{PkChatbotViewConversations-WUpRm6GG.js → PkChatbotViewConversations-dKZScKD9.js} +3 -3
  68. package/dist-vue/_chunks/{PkChatbotViewConversations-WUpRm6GG.js.map → PkChatbotViewConversations-dKZScKD9.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkChatbotViewFiles-CpG_LRg6.js → PkChatbotViewFiles-CQC3rInD.js} +3 -3
  70. package/dist-vue/_chunks/{PkChatbotViewFiles-CpG_LRg6.js.map → PkChatbotViewFiles-CQC3rInD.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkChatbotViewProfile-DetQJa7E.js → PkChatbotViewProfile-CkZyWh4V.js} +2 -2
  72. package/dist-vue/_chunks/{PkChatbotViewProfile-DetQJa7E.js.map → PkChatbotViewProfile-CkZyWh4V.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkStreamingMarkdown-DLKEIMcZ.js → PkStreamingMarkdown-BYV68skc.js} +3 -3
  74. package/dist-vue/_chunks/{PkStreamingMarkdown-DLKEIMcZ.js.map → PkStreamingMarkdown-BYV68skc.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkToolEditSpreadsheet-D2JtjXef.js → PkToolEditSpreadsheet-DQxJQIY0.js} +2 -2
  76. package/dist-vue/_chunks/{PkToolEditSpreadsheet-D2JtjXef.js.map → PkToolEditSpreadsheet-DQxJQIY0.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkToolRequestGeolocation--MTT__Vu.js → PkToolRequestGeolocation-BpjglRbg.js} +2 -2
  78. package/dist-vue/_chunks/{PkToolRequestGeolocation--MTT__Vu.js.map → PkToolRequestGeolocation-BpjglRbg.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-Gb_qfvlN.js → PkToolRequestOAuthConnection-CD3M5DWj.js} +2 -2
  80. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-Gb_qfvlN.js.map → PkToolRequestOAuthConnection-CD3M5DWj.js.map} +1 -1
  81. package/dist-vue/_chunks/{PkToolShowArtifact-BWVntj9H.js → PkToolShowArtifact-Bm5VBF_n.js} +2 -2
  82. package/dist-vue/_chunks/{PkToolShowArtifact-BWVntj9H.js.map → PkToolShowArtifact-Bm5VBF_n.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkToolShowContactForm-BbBt3ha0.js → PkToolShowContactForm-CMQTQsU-.js} +2 -2
  84. package/dist-vue/_chunks/{PkToolShowContactForm-BbBt3ha0.js.map → PkToolShowContactForm-CMQTQsU-.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkToolShowDiagram-CE6KHz1M.js → PkToolShowDiagram-adGuj4AF.js} +2 -2
  86. package/dist-vue/_chunks/{PkToolShowDiagram-CE6KHz1M.js.map → PkToolShowDiagram-adGuj4AF.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkToolShowForm-CNm8HSUW.js → PkToolShowForm-Cx5KdTlZ.js} +4 -4
  88. package/dist-vue/_chunks/{PkToolShowForm-CNm8HSUW.js.map → PkToolShowForm-Cx5KdTlZ.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkToolShowImageGallery-6k3ituoi.js → PkToolShowImageGallery-BtQ0gnGB.js} +2 -2
  90. package/dist-vue/_chunks/{PkToolShowImageGallery-6k3ituoi.js.map → PkToolShowImageGallery-BtQ0gnGB.js.map} +1 -1
  91. package/dist-vue/_chunks/{PkToolShowProductList-Bu-pUg5d.js → PkToolShowProductList-Dvatk6p-.js} +2 -2
  92. package/dist-vue/_chunks/{PkToolShowProductList-Bu-pUg5d.js.map → PkToolShowProductList-Dvatk6p-.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkToolShowSources-DTWNZqWu.js → PkToolShowSources-DKkIYQ9r.js} +3 -3
  94. package/dist-vue/_chunks/{PkToolShowSources-DTWNZqWu.js.map → PkToolShowSources-DKkIYQ9r.js.map} +1 -1
  95. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DSXhqWhx.js → PkToolShowSuggestedReply-BbAfjJP9.js} +2 -2
  96. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DSXhqWhx.js.map → PkToolShowSuggestedReply-BbAfjJP9.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkToolShowVideo-C0ycBiOI.js → PkToolShowVideo-DTNszfdU.js} +2 -2
  98. package/dist-vue/_chunks/{PkToolShowVideo-C0ycBiOI.js.map → PkToolShowVideo-DTNszfdU.js.map} +1 -1
  99. package/dist-vue/_chunks/{PkToolShowWebPages-CWWv1tr5.js → PkToolShowWebPages-euov57FB.js} +2 -2
  100. package/dist-vue/_chunks/{PkToolShowWebPages-CWWv1tr5.js.map → PkToolShowWebPages-euov57FB.js.map} +1 -1
  101. package/dist-vue/_chunks/{createChatbotApiClient-MbfcTdwY.js → createChatbotApiClient-qHjpFqPL.js} +8 -8
  102. package/dist-vue/_chunks/{createChatbotApiClient-MbfcTdwY.js.map → createChatbotApiClient-qHjpFqPL.js.map} +1 -1
  103. package/dist-vue/_chunks/{useChatbotStore-DDSgrRzg.js → useChatbotStore-CBjfSN69.js} +3 -3
  104. package/dist-vue/_chunks/{useChatbotStore-DDSgrRzg.js.map → useChatbotStore-CBjfSN69.js.map} +1 -1
  105. package/dist-vue/_chunks/{utils-B9-Vt10H.js → utils-BCGK2AFl.js} +2 -2
  106. package/dist-vue/_chunks/utils-BCGK2AFl.js.map +1 -0
  107. package/dist-vue/api.js +1 -1
  108. package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +12 -4
  109. package/dist-vue/apps/web-component/src/components/FloatingChatWidget.ce.d.ts +4 -3
  110. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +11 -5
  111. package/dist-vue/apps/web-component/src/composables/useChatbotProfileProvider.d.ts +3 -2
  112. package/dist-vue/apps/web-component/src/composables/useCopilotPageCss.d.ts +12 -4
  113. package/dist-vue/apps/web-component/src/composables/usePageModal.d.ts +19 -0
  114. package/dist-vue/apps/web-component/src/lib.d.ts +10 -3
  115. package/dist-vue/apps/web-component/src/pageTools/actions.d.ts +33 -0
  116. package/dist-vue/apps/web-component/src/pageTools/navigation.d.ts +27 -0
  117. package/dist-vue/apps/web-component/src/pageTools/snapshot.d.ts +18 -2
  118. package/dist-vue/apps/web-component/src/utils/emitWidgetEvent.d.ts +8 -0
  119. package/dist-vue/apps/web-component/src/utils/layout.d.ts +3 -3
  120. package/dist-vue/composables.js +41 -19
  121. package/dist-vue/composables.js.map +1 -1
  122. package/dist-vue/index.js +342 -323
  123. package/dist-vue/index.js.map +1 -1
  124. package/dist-vue/locales.js +40 -14
  125. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +8 -5
  126. package/dist-vue/packages/components/src/chat/PkHostCallConfirmDialog.d.ts +19 -0
  127. package/dist-vue/packages/components/src/chat/utils.d.ts +5 -0
  128. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +13 -7
  129. package/dist-vue/packages/models/src/schema/Agent.d.ts +31 -18
  130. package/dist-vue/packages/models/src/schema/Member.d.ts +11 -0
  131. package/dist-vue/packages/models/src/schema/OrganizationExternalAuth.d.ts +8 -2
  132. package/dist-vue/packages/models/src/schema/OrganizationIdentityProvider.d.ts +4 -1
  133. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +5 -3
  134. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +5 -3
  135. package/dist-vue/style.css +1 -1
  136. package/package.json +1 -1
  137. package/dist/_chunks/Agent-7rbrjWzu.js.map +0 -1
  138. package/dist/_chunks/PkStreamingMarkdown-BnClGp-3.js.map +0 -1
  139. package/dist-vue/_chunks/Agent-SH2vEFKs.js.map +0 -1
  140. package/dist-vue/_chunks/PkChatbot-DlIEIjKJ.js.map +0 -1
  141. package/dist-vue/_chunks/PkChatbotInput-DQVpDLNp.js.map +0 -1
  142. package/dist-vue/_chunks/utils-B9-Vt10H.js.map +0 -1
  143. package/dist-vue/apps/web-component/src/composables/useCopilotPush.d.ts +0 -25
package/README.md CHANGED
@@ -17,6 +17,7 @@ them in English.
17
17
  - [Elements and attributes](#elements-and-attributes)
18
18
  - [JavaScript API](#javascript-api)
19
19
  - [Events](#events)
20
+ - [Glass and your own open button](#glass-and-your-own-open-button)
20
21
  - [Copilot layout](#copilot-layout)
21
22
  - [Authentication](#authentication)
22
23
  - [External context (`setContext`)](#external-context-setcontext)
@@ -274,7 +275,7 @@ panel, which takes the whole screen on phones. Whether the panel is open is kept
274
275
  | `use-host-session` | `boolean` | `false` | Reuse the Agent Studio session cookie of the backend origin. Same-origin embeds only, see [Host session](#host-session). |
275
276
  | `floating-button-position` | `'left' \| 'right'` | the agent's setting, else `'right'` | Side of the button and of the panel. |
276
277
  | `layout` | `'floating' \| 'copilot'` | the agent's setting, else `'floating'` | `copilot` docks the open chat on one side at full height, with your site framed beside it. See [Copilot layout](#copilot-layout). |
277
- | `copilot-frame` | `'overlay' \| 'push'` | the agent's setting, else `'overlay'` | Copilot layout only: `push` narrows your page beside the docked chat. See [Push mode](#push-mode). |
278
+ | `appearance` | `'solid' \| 'glass'` | the agent's setting, else `'solid'` | Floating layout only: `glass` makes the card frosted glass over your page. See [Glass and your own open button](#glass-and-your-own-open-button). |
278
279
  | `system-theme` | `'light' \| 'dark'` | the OS preference | Forces the color scheme. Reactive: update it when your app's theme changes. |
279
280
  | `custom-css` | `string` | none | CSS added to the shadow root after the agent's own CSS from the backoffice. |
280
281
  | `cookie-name` | `string` | `eight-wave-ai` | Cookie, on your site, that keeps the widget session across page loads. Two widgets with different names keep separate sessions. |
@@ -293,6 +294,7 @@ Same attributes as the floating widget except `floating-button-position`, plus:
293
294
  | --- | --- | --- | --- |
294
295
  | `display-mode` | `'widget' \| 'fullscreen' \| 'panel'` | `'widget'` | `widget`: a contained chat with its header. `fullscreen`: the full-page layout of the app. `panel`: compact chrome for a docked side panel, where your page owns background, border and open/close. |
295
296
  | `forwarded-slots` | `string` | none | Comma-separated slot names forwarded to the inner chat (for example `"tool-showArtifact,subagent"`). |
297
+ | `theme` | `'light' \| 'dark'` | none | The color scheme, over the agent's own setting too, where `system-theme` only applies to an agent set to automatic. For a page that switches theme around a `panel`, which shows the page's background through it. Reactive. |
296
298
 
297
299
  ## JavaScript API
298
300
 
@@ -313,6 +315,7 @@ Methods and properties live on the element once it is defined (see
313
315
  | `signIn(token: string): Promise<void>` | both | Signs in with an external JWT, as the `external-token` attribute does. |
314
316
  | `signOut(): Promise<void>` | both | Signs out and withdraws the active external token, so the widget does not sign in with it again. It then waits when `await-external-token` is set, or signs in anonymously. No effect with `use-host-session`. |
315
317
  | `isWorking` | both | `boolean`, read only: the agent is answering or running a tool. False while the user has a confirmation to answer. See [Working state](#working-state). |
318
+ | `isControllingPage` | both | `boolean`, read only: the agent is acting on your page, and its control bar with the stop shows. See [Working state](#working-state). |
316
319
 
317
320
  ```js
318
321
  const widget = document.querySelector('floating-chat-widget')
@@ -343,6 +346,8 @@ Listen on the element or on any ancestor, `document` included.
343
346
  | `chat-error` | `{ type: string, title: string, status: number }` | An API error in the chat. Not named `error`, so it never reaches `window.onerror` and the error monitoring of your page. |
344
347
  | `working-started` | `null` | The agent started answering or running a tool. See [Working state](#working-state). |
345
348
  | `working-ended` | `null` | The agent stopped, or is waiting for the user to confirm an action. |
349
+ | `page-control-started` | `null` | The agent started acting on your page (a click, a write, a key): the control bar shows. |
350
+ | `page-control-ended` | `null` | The answer that acted on the page ended, or the user stopped it. |
346
351
 
347
352
  Timing of `ready` and `signed-in`:
348
353
 
@@ -370,6 +375,44 @@ body:has(floating-chat-widget[working]) .app-frame { box-shadow: 0 0 0 2px rebec
370
375
  - It is off while a confirmation card waits for the user: the agent waits on them, it is not
371
376
  working.
372
377
 
378
+ The agent acting on your page is a narrower state: from its first click, write or key until
379
+ the answer ends, the element carries the `controlling` attribute, `isControllingPage` is `true`,
380
+ and `page-control-started` and `page-control-ended` mark the edges. It is the state to light
381
+ an effect around the page itself: an answer that only thinks and writes leaves the page alone.
382
+
383
+ ```css
384
+ body:has(floating-chat-widget[controlling]) .app-frame { box-shadow: 0 0 0 2px rebeccapurple; }
385
+ ```
386
+
387
+ ## Glass and your own open button
388
+
389
+ Two settings of the agent (backoffice: Style tab, advanced options) change how the floating widget
390
+ sits on your page.
391
+
392
+ **Appearance: Glass.** With the floating layout, the card is frosted glass: your site shows
393
+ through it, blurred, and the messages, the notices and the field are lighter panes of the same
394
+ glass, your user's tinted with the agent's color. On a phone, where the chat takes the whole
395
+ screen, it stays solid, and so it does with reduced transparency
396
+ (`prefers-reduced-transparency`) or in a browser without `backdrop-filter`. The `appearance`
397
+ attribute (`solid`, `glass`) wins over the setting.
398
+
399
+ **Hide the open button.** The widget shows no button of its own, in both layouts, nor the welcome
400
+ popup that sits on it, and the open card takes the button's corner. **Your site must then add its
401
+ own button**, or the chat cannot be opened:
402
+
403
+ ```html
404
+ <button type="button" id="open-assistant">Ask the assistant</button>
405
+ <script>
406
+ document.querySelector('#open-assistant').addEventListener('click', () => {
407
+ document.querySelector('floating-chat-widget').open()
408
+ })
409
+ </script>
410
+ ```
411
+
412
+ `toggle()` opens and closes with the same button, and `sendMessage(text)` opens the chat on a
413
+ question of your own (see [JavaScript API](#javascript-api)). The chat still closes from its own
414
+ header.
415
+
373
416
  ## Copilot layout
374
417
 
375
418
  The floating widget has a second layout, `copilot`: the open chat docks on one side of the screen
@@ -407,67 +450,58 @@ changes, and clicks on the frame reach your page. The price is that the part of
407
450
  the docked chat stays covered while the chat is open. An element of your page at the highest
408
451
  `z-index` (`2147483647`, some cookie banners) paints over the frame.
409
452
 
410
- The beam follows the [working state](#working-state), and can be switched off in the backoffice
411
- (Glow while working). With reduced motion it stays lit and still.
412
-
413
- ### Push mode
414
-
415
- By default the docked chat lays over your site (`overlay`). In push mode (backoffice: Room for
416
- the panel, The site narrows; or `copilot-frame="push"` on the element) the widget narrows your
417
- page beside it. It is the only time the widget writes outside its shadow root:
418
-
419
- - while push mode is on: on `<html>` the attribute `data-chatbot-copilot-push` and the property
420
- `--chatbot-copilot-width` (the chat's width plus the margins of the frame), and a stylesheet in
421
- the `<head>` (`#chatbot-copilot-push`) that animates the page's margins (0.45 s; no animation
422
- with reduced motion);
423
- - while the chat is also open and docked (from 1280 px): `data-chatbot-copilot="right"` (or
424
- `"left"`) on `<html>`, and on that side an inline `margin-right` (or `margin-left`) of
425
- `var(--chatbot-copilot-width)`, `!important`.
453
+ The chat's header stays neutral in this layout, whatever the agent's "colors in the header"
454
+ setting says: the chat sits beside your site as part of the frame.
426
455
 
427
- Off, or when the widget leaves the page, your page gets all of it back. What follows the flow of
428
- the page narrows, sticky headers included. What does not:
456
+ The beam around your site lights while the agent acts on it (the `controlling` state of
457
+ [Working state](#working-state)); where there is no frame (below 1280 px) it runs along the
458
+ panel and follows the working state. Both can be switched off in the backoffice
459
+ (Glow while working). It takes the agent's color held to a middle lightness, so a near-black or a
460
+ pale brand still reads as a light; an agent color with no hue (black, white, a gray) takes the
461
+ accent instead. With reduced motion it stays lit and still.
429
462
 
430
- - **Fixed elements anchored to that edge** (a fixed header, a cookie banner, a button of your
431
- own) stay under the chat. Move them aside with the attribute and the property, with the same
432
- animation as the page, in your stylesheet or in the agent's [page CSS](#page-css):
463
+ ### Making room for the chat
433
464
 
434
- ```css
435
- .site-header { transition: left 0.45s cubic-bezier(0.32, 0.72, 0, 1), right 0.45s cubic-bezier(0.32, 0.72, 0, 1); }
436
- html[data-chatbot-copilot='right'] .site-header { right: var(--chatbot-copilot-width); }
437
- html[data-chatbot-copilot='left'] .site-header { left: var(--chatbot-copilot-width); }
438
- ```
465
+ The docked chat lays over your site, and the widget changes nothing on your page. A page that
466
+ should make room beside it does so itself, with its own CSS, from the `opened` and `closed`
467
+ [events](#events): only your page knows which of its elements to narrow. The room the chat takes
468
+ from 1280 px is `calc(clamp(320px, 24vw, 406px) + 1.5rem)`, the chat plus the frame's margins.
439
469
 
440
- An element sized with `width: 100%` or `100vw` also needs `width: auto` there.
441
- - **Media queries and `vw` units** still read the whole window: a desktop menu stays a desktop
442
- menu in less room, and may wrap.
443
- - **An app that sizes itself on the window** (`100vw`, a full-screen canvas) does not narrow at
444
- all and scrolls sideways: keep it on overlay.
445
- - **A margin of your own on `<html>`** on that side is replaced while the chat is open, whatever
446
- sets it, and an inline one comes back when the chat closes.
470
+ ```js
471
+ const chat = document.querySelector('floating-chat-widget')
472
+ const roomFor = (open) => document.body.classList.toggle('chat-open', open)
473
+ chat.addEventListener('opened', () => roomFor(true))
474
+ chat.addEventListener('closed', () => roomFor(false))
475
+ // The widget remembers it was open across pages: read it once it is defined
476
+ customElements.whenDefined('floating-chat-widget').then(() => roomFor(chat.isOpen))
477
+ ```
447
478
 
448
- Try push mode on your site before switching it on. The spec
449
- (`docs/specs/released/widget-copilot.md`) records how four public sites of different kinds behave.
479
+ ```css
480
+ @media (min-width: 1280px) {
481
+ body.chat-open .app { margin-right: calc(clamp(320px, 24vw, 406px) + 1.5rem); }
482
+ }
483
+ ```
450
484
 
451
485
  ### Opening
452
486
 
453
- The button opens the chat in step with your page: the chat slides in from its side, the frame
454
- fades in while the window on your site closes in from that side, and in push mode the page
455
- narrows, all in 0.45 s on the same curve as the Agent Studio copilot. Closing runs the same steps
456
- back. With reduced motion everything happens at once.
487
+ The button opens the chat with one movement: the chat slides in from its side while the frame
488
+ fades in and the window on your site closes in from that side, in 0.45 s on the same curve as the
489
+ Agent Studio copilot. Closing runs the same steps back. With reduced motion everything happens at
490
+ once.
457
491
 
458
492
  ### Page CSS
459
493
 
460
494
  The agent's Page CSS (backoffice: Style tab, advanced options, copilot layout only) is added to
461
- your page in a `<style id="chatbot-copilot-page-css">` while the chat is open and docked, with
462
- either frame, and removed when it closes or undocks. It is the place for the rules above when you
463
- would rather not change your site's code:
495
+ your page in a `<style id="chatbot-copilot-page-css">` while the chat is open and docked, and
496
+ removed when it closes or undocks. It moves elements of your site from under the chat when you
497
+ would rather not change your site's code, for instance a fixed header:
464
498
 
465
499
  ```css
466
500
  .site-header { right: var(--chatbot-copilot-width); }
467
501
  ```
468
502
 
469
- `--chatbot-copilot-width` is defined in both frames while the page CSS is on the page. It is CSS
470
- for your page, not for the chat: the chat's own look goes in Custom CSS, which stays in
503
+ `--chatbot-copilot-width`, the room the chat takes, is defined while the page CSS is on the page.
504
+ It is CSS for your page, not for the chat: the chat's own look goes in Custom CSS, which stays in
471
505
  the widget's shadow root.
472
506
 
473
507
  ## Authentication
@@ -881,9 +915,9 @@ Set in **Site and app > Page access**:
881
915
  | Level | The agent can | Its tools |
882
916
  | --- | --- | --- |
883
917
  | **Off** | nothing on the page | none |
884
- | **Read** | read the visible content | `page_snapshot` (the page, or a region of it), `page_read` (the text of one element) |
918
+ | **Read** | read the visible content | `page_snapshot` (the page, or a region of it), `page_read` (the text of one element), `page_find` (a text anywhere on the page, with the lines around it), `page_wait` (until a text appears, or the page stops changing) |
885
919
  | **Annotated forms** | also fill in the forms you annotated, and submit them where you allow it | one `form_<name>` tool per [annotated form](#annotated-forms) |
886
- | **Page control** | also click, type and scroll anywhere not excluded | `page_click`, `page_fill`, `page_scroll` |
920
+ | **Page control** | also click, type, scroll, point, press keys and move around the site anywhere not excluded | `page_click`, `page_fill`, `page_scroll`, `page_hover`, `page_press`, `page_back`, `page_navigate` |
887
921
 
888
922
  **Annotated forms** and **Page control** apply only when the agent lists explicit **Trusted
889
923
  origins** (at least one, without `*`) and an administrator accepted the risk of that level in
@@ -906,7 +940,13 @@ as a line with its role, its accessible name, its state and a reference the acti
906
940
  and the widget itself. Content drawn on a canvas or inside an iframe is invisible to the agent:
907
941
  expose it with [host tools](#host-tools-registertool) instead.
908
942
  - A snapshot stops at 24,000 characters (and at 20,000 nodes or 250 ms of reading). On a longer
909
- page the model reads by region.
943
+ page the model reads by region, or finds a text with `page_find`.
944
+ - Menus, tab lists, toolbars and dialogs are read item by item, each with its reference. States
945
+ come from `disabled`, `checked`, `required`, `aria-expanded`, `aria-checked`, `aria-pressed`,
946
+ `aria-selected` and `aria-current`; a tab or menu item whose active state is only a class
947
+ (`current`, `active`, `is-active`, `selected`, `is-selected`, `router-link-exact-active`) reads
948
+ as `current` too. A checkbox or radio that hides its own input behind a styled label is read
949
+ when the label is visible.
910
950
 
911
951
  Semantic HTML (real buttons and links, labelled fields, headings) is what makes a page readable
912
952
  and usable by the agent.
@@ -927,12 +967,23 @@ Other sensitive fields must be marked by your site, or listed in **Excluded area
927
967
 
928
968
  At **Page control**, a card in the chat asks the user before:
929
969
 
930
- - a click on a submit button;
931
- - a click on a link that loads another document in the same tab: another path, query or origin,
932
- links a client-side router intercepts included;
970
+ - a click on a submit button, or Enter in a field that submits its form;
971
+ - a click on a link to another site;
972
+ - the answer to your site's own confirmation dialog: a button in an `alertdialog`, or in a modal
973
+ dialog with no field. The card shows the dialog's text ("The page asks: “Delete this agent?”
974
+ The agent wants to answer “Proceed”"), so the user answers your question;
933
975
  - a click on, or a write into, an element inside `data-agent-confirm`. Use it on actions that
934
- neither submit a form nor change the page, such as a delete through an API call;
935
- - every click and every write, when **Confirm every action** is on.
976
+ neither submit a form nor ask through a dialog, such as a delete through an API call;
977
+ - every action, links of your own site included, when **Confirm every action** is on.
978
+
979
+ A link to another page of your site does not ask: moving around your app is how the agent gets
980
+ anywhere.
981
+
982
+ When your page has a modal `<dialog>` open (`showModal()`), the rest of the page is inert,
983
+ the chat included. The card then opens in a modal dialog of the widget, above yours, and closes
984
+ once answered. While the agent acts with your dialog open, the **Stop** of the bar is added
985
+ inside your dialog, as an `agent-studio-stop` element with its own shadow root, and removed when
986
+ the dialog closes or the action ends.
936
987
 
937
988
  ### How actions are performed
938
989
 
@@ -957,6 +1008,24 @@ reached the backend. The conversation then goes on on the new page when:
957
1008
  There the widget runs the pending page reads of that answer, never a pending write. Everything
958
1009
  else waits for the user's next message.
959
1010
 
1011
+ The page the click leaves answers nothing more: the answer goes on while it is still on screen,
1012
+ and a read there would show the agent the page it just left, as if the click had done nothing.
1013
+ After such a click every page tool waits. When the page starts to unload it never answers, and
1014
+ the new page runs the call. When the page stays (a client-side router took the link, or the click
1015
+ led nowhere) the call runs once the page has settled: after a route change, once it has gone
1016
+ 400 ms without changes (3 s at most); without one, after 1.5 s. A navigation that starts and never
1017
+ completes (a download) lets the calls run after 10 s.
1018
+
1019
+ `page_navigate` opens an address of the same origin only. A link of the page to that address is
1020
+ clicked, so your router takes it; without one, the widget pushes a history entry and dispatches
1021
+ `popstate`, which Vue Router, React Router and most client-side routers follow without a reload.
1022
+ When the page does not change within a second, the address loads as typed in the address bar.
1023
+
1024
+ A plain click that changes the address or removes the element clicked answers that the page
1025
+ changed, with its new title and path, instead of reading the region the element was in. A click
1026
+ on an element with `aria-controls` reads the part of the page it controls, where a menu or a
1027
+ dialog it opened usually is.
1028
+
960
1029
  ### What the user sees and controls
961
1030
 
962
1031
  - A notice above the input says what the agent can do on the page. **Notice to the user**
@@ -1207,7 +1276,7 @@ interface ChatWidgetElement extends HTMLElement {
1207
1276
  export interface FloatingChatWidgetElement extends ChatWidgetElement {
1208
1277
  floatingButtonPosition?: 'left' | 'right'
1209
1278
  layout?: 'floating' | 'copilot'
1210
- copilotFrame?: 'overlay' | 'push'
1279
+ appearance?: 'solid' | 'glass'
1211
1280
  open(): void
1212
1281
  close(): void
1213
1282
  toggle(): void
@@ -1230,6 +1299,8 @@ declare global {
1230
1299
  'chat-error': CustomEvent<{ type: string; title: string; status: number }>
1231
1300
  'working-started': CustomEvent<null>
1232
1301
  'working-ended': CustomEvent<null>
1302
+ 'page-control-started': CustomEvent<null>
1303
+ 'page-control-ended': CustomEvent<null>
1233
1304
  }
1234
1305
  }
1235
1306
  ```
@@ -781,7 +781,7 @@ var lt = n({
781
781
  }({}), q = /* @__PURE__ */ function(e) {
782
782
  return e.Floating = "floating", e.Copilot = "copilot", e;
783
783
  }({}), J = /* @__PURE__ */ function(e) {
784
- return e.Overlay = "overlay", e.Push = "push", e;
784
+ return e.Solid = "solid", e.Glass = "glass", e;
785
785
  }({}), Y = /* @__PURE__ */ function(e) {
786
786
  return e.Frontoffice = "frontoffice", e.App = "app", e.Widget = "widget", e;
787
787
  }({}), X = Object.values(Y), St = /^(?=.{1,253}$)([a-z0-9-]+\.)*[a-z0-9-]+$/;
@@ -819,7 +819,8 @@ var Z = n({
819
819
  welcomePopup: d().optional().default(!1),
820
820
  floatingButtonPosition: u(["left", "right"]).optional().default("right"),
821
821
  layout: u(q).optional().default(q.Floating),
822
- copilotFrame: u(J).optional().default(J.Overlay),
822
+ appearance: u(J).optional().default(J.Solid),
823
+ hideFloatingButton: d().optional().default(!1),
823
824
  workingGlow: d().optional().default(!0),
824
825
  copilotPageCss: i().optional(),
825
826
  maxMessageLength: s().int().positive().optional(),
@@ -969,7 +970,8 @@ var Ft = n({
969
970
  theme: !0,
970
971
  floatingButtonPosition: !0,
971
972
  layout: !0,
972
- copilotFrame: !0,
973
+ appearance: !0,
974
+ hideFloatingButton: !0,
973
975
  copilotPageCss: !0,
974
976
  customCss: !0
975
977
  }), Lt = Ft.pick({
@@ -1022,6 +1024,6 @@ p("requiresAuth", [zt.extend(Ht.shape), Bt.extend(Ht.shape)]), n({
1022
1024
  ..._.ids()
1023
1025
  });
1024
1026
  //#endregion
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 };
1027
+ 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 _, $e as a, Ct as b, J as c, Tt as d, nt as f, dt as g, jt as h, G as i, ue as j, ye as k, q as l, ot as m, U as n, z as o, it as p, $ as r, W as s, tt as t, et as u, at as v, De as w, j as x, ct as y };
1026
1028
 
1027
- //# sourceMappingURL=Agent-7rbrjWzu.js.map
1029
+ //# sourceMappingURL=Agent-wt8Vi99H.js.map