@8wave/ai-elements 0.121.0-beta.39 → 0.121.0-beta.40

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 (142) hide show
  1. package/README.md +67 -15
  2. package/dist/_chunks/{Agent-C3m0UmlL.js → Agent-BuPgJIt4.js} +203 -202
  3. package/dist/_chunks/Agent-BuPgJIt4.js.map +1 -0
  4. package/dist/_chunks/{PkStreamingMarkdown--PCkA4Fg.js → PkStreamingMarkdown-D2aqCD0I.js} +953 -927
  5. package/dist/_chunks/PkStreamingMarkdown-D2aqCD0I.js.map +1 -0
  6. package/dist/_chunks/{PkToolEditSpreadsheet-DAMWWIVt.js → PkToolEditSpreadsheet-83ZdmGeA.js} +2 -2
  7. package/dist/_chunks/{PkToolEditSpreadsheet-DAMWWIVt.js.map → PkToolEditSpreadsheet-83ZdmGeA.js.map} +1 -1
  8. package/dist/_chunks/{PkToolRequestGeolocation-BgsvQb7Q.js → PkToolRequestGeolocation-1cOmCG8P.js} +2 -2
  9. package/dist/_chunks/{PkToolRequestGeolocation-BgsvQb7Q.js.map → PkToolRequestGeolocation-1cOmCG8P.js.map} +1 -1
  10. package/dist/_chunks/{PkToolRequestOAuthConnection-DtuZw7yk.js → PkToolRequestOAuthConnection-CCu3FCyo.js} +2 -2
  11. package/dist/_chunks/{PkToolRequestOAuthConnection-DtuZw7yk.js.map → PkToolRequestOAuthConnection-CCu3FCyo.js.map} +1 -1
  12. package/dist/_chunks/{PkToolShowArtifact-B163OvqY.js → PkToolShowArtifact-CiYkZkpe.js} +2 -2
  13. package/dist/_chunks/{PkToolShowArtifact-B163OvqY.js.map → PkToolShowArtifact-CiYkZkpe.js.map} +1 -1
  14. package/dist/_chunks/{PkToolShowContactForm-C_ptr7Xs.js → PkToolShowContactForm-D7TEzrYe.js} +2 -2
  15. package/dist/_chunks/{PkToolShowContactForm-C_ptr7Xs.js.map → PkToolShowContactForm-D7TEzrYe.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowForm-fburTpQm.js → PkToolShowForm-CSh4Q6sl.js} +5 -5
  17. package/dist/_chunks/{PkToolShowForm-fburTpQm.js.map → PkToolShowForm-CSh4Q6sl.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowImageGallery-ChauJukk.js → PkToolShowImageGallery-CQEaEfYE.js} +2 -2
  19. package/dist/_chunks/{PkToolShowImageGallery-ChauJukk.js.map → PkToolShowImageGallery-CQEaEfYE.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowProductList-B_XZezYw.js → PkToolShowProductList-BCmULLct.js} +2 -2
  21. package/dist/_chunks/{PkToolShowProductList-B_XZezYw.js.map → PkToolShowProductList-BCmULLct.js.map} +1 -1
  22. package/dist/_chunks/{PkToolShowSources-CS4nEuL0.js → PkToolShowSources-R9KWsfTQ.js} +3 -3
  23. package/dist/_chunks/{PkToolShowSources-CS4nEuL0.js.map → PkToolShowSources-R9KWsfTQ.js.map} +1 -1
  24. package/dist/_chunks/{PkToolShowSuggestedReply-BIe56XdA.js → PkToolShowSuggestedReply-DYZz9aV2.js} +2 -2
  25. package/dist/_chunks/{PkToolShowSuggestedReply-BIe56XdA.js.map → PkToolShowSuggestedReply-DYZz9aV2.js.map} +1 -1
  26. package/dist/_chunks/{PkToolShowVideo-DzU1XJqv.js → PkToolShowVideo-C_9SZtZM.js} +2 -2
  27. package/dist/_chunks/{PkToolShowVideo-DzU1XJqv.js.map → PkToolShowVideo-C_9SZtZM.js.map} +1 -1
  28. package/dist/_chunks/{PkToolShowWebPages-BlKe8Arf.js → PkToolShowWebPages-DwRYfle9.js} +2 -2
  29. package/dist/_chunks/{PkToolShowWebPages-BlKe8Arf.js.map → PkToolShowWebPages-DwRYfle9.js.map} +1 -1
  30. package/dist/_chunks/{chatImagePolicy-ChSkpiw6.js → chatImagePolicy-CQYTWTkP.js} +2 -2
  31. package/dist/_chunks/{chatImagePolicy-ChSkpiw6.js.map → chatImagePolicy-CQYTWTkP.js.map} +1 -1
  32. package/dist/_chunks/{markdown-D3iMlF6T.js → markdown-Br9ROCBT.js} +2 -2
  33. package/dist/_chunks/{markdown-D3iMlF6T.js.map → markdown-Br9ROCBT.js.map} +1 -1
  34. package/dist/ai-elements.es.js +4378 -3756
  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-3IHYHv05.js → Agent-DZb775Ak.js} +193 -192
  48. package/dist-vue/_chunks/Agent-DZb775Ak.js.map +1 -0
  49. package/dist-vue/_chunks/{Document-B0A_y6N5.js → Document-E72l_VU6.js} +2 -2
  50. package/dist-vue/_chunks/{Document-B0A_y6N5.js.map → Document-E72l_VU6.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkChatbot-Bu76hH4F.js → PkChatbot-DIqduIwr.js} +9 -9
  52. package/dist-vue/_chunks/{PkChatbot-Bu76hH4F.js.map → PkChatbot-DIqduIwr.js.map} +1 -1
  53. package/dist-vue/_chunks/{PkChatbotEmptyState-ilPJoYjk.js → PkChatbotEmptyState-Dh7ETVnf.js} +2 -2
  54. package/dist-vue/_chunks/{PkChatbotEmptyState-ilPJoYjk.js.map → PkChatbotEmptyState-Dh7ETVnf.js.map} +1 -1
  55. package/dist-vue/_chunks/{PkChatbotInput-CY0YRGkG.js → PkChatbotInput-BJHtmPR-.js} +2 -2
  56. package/dist-vue/_chunks/{PkChatbotInput-CY0YRGkG.js.map → PkChatbotInput-BJHtmPR-.js.map} +1 -1
  57. package/dist-vue/_chunks/PkChatbotMessages-DMSActW1.js +968 -0
  58. package/dist-vue/_chunks/PkChatbotMessages-DMSActW1.js.map +1 -0
  59. package/dist-vue/_chunks/{PkChatbotStepPayload-CiEcIlzW.js → PkChatbotStepPayload-CXdsUMrw.js} +2 -2
  60. package/dist-vue/_chunks/{PkChatbotStepPayload-CiEcIlzW.js.map → PkChatbotStepPayload-CXdsUMrw.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkChatbotStepToolDetail-VqLkuWi7.js → PkChatbotStepToolDetail-DbpXR7jh.js} +16 -16
  62. package/dist-vue/_chunks/{PkChatbotStepToolDetail-VqLkuWi7.js.map → PkChatbotStepToolDetail-DbpXR7jh.js.map} +1 -1
  63. package/dist-vue/_chunks/PkChatbotSteps-QFFZ0DjH.js +189 -0
  64. package/dist-vue/_chunks/PkChatbotSteps-QFFZ0DjH.js.map +1 -0
  65. package/dist-vue/_chunks/{PkChatbotViewChat-t-XkwFbe.js → PkChatbotViewChat-BI_PtT72.js} +300 -298
  66. package/dist-vue/_chunks/PkChatbotViewChat-BI_PtT72.js.map +1 -0
  67. package/dist-vue/_chunks/{PkChatbotViewConversations-CgRMohUQ.js → PkChatbotViewConversations-Bg4jSO9a.js} +3 -3
  68. package/dist-vue/_chunks/{PkChatbotViewConversations-CgRMohUQ.js.map → PkChatbotViewConversations-Bg4jSO9a.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkChatbotViewFiles-DkeysDGW.js → PkChatbotViewFiles-Cwm-JQMF.js} +3 -3
  70. package/dist-vue/_chunks/{PkChatbotViewFiles-DkeysDGW.js.map → PkChatbotViewFiles-Cwm-JQMF.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkChatbotViewProfile-kgqu10ED.js → PkChatbotViewProfile-C_GElIM3.js} +2 -2
  72. package/dist-vue/_chunks/{PkChatbotViewProfile-kgqu10ED.js.map → PkChatbotViewProfile-C_GElIM3.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkStreamingMarkdown-CDlpb5w0.js → PkStreamingMarkdown-DwDs-cGP.js} +3 -3
  74. package/dist-vue/_chunks/{PkStreamingMarkdown-CDlpb5w0.js.map → PkStreamingMarkdown-DwDs-cGP.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkToolEditSpreadsheet-D0EPgCmp.js → PkToolEditSpreadsheet-B61LtERY.js} +2 -2
  76. package/dist-vue/_chunks/{PkToolEditSpreadsheet-D0EPgCmp.js.map → PkToolEditSpreadsheet-B61LtERY.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkToolRequestGeolocation-DZnJd1od.js → PkToolRequestGeolocation-DC8hSH0j.js} +2 -2
  78. package/dist-vue/_chunks/{PkToolRequestGeolocation-DZnJd1od.js.map → PkToolRequestGeolocation-DC8hSH0j.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C8MGtBlh.js → PkToolRequestOAuthConnection-BH_-drvw.js} +2 -2
  80. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C8MGtBlh.js.map → PkToolRequestOAuthConnection-BH_-drvw.js.map} +1 -1
  81. package/dist-vue/_chunks/{PkToolShowArtifact-CtXB1-vJ.js → PkToolShowArtifact-CjVN96wJ.js} +2 -2
  82. package/dist-vue/_chunks/{PkToolShowArtifact-CtXB1-vJ.js.map → PkToolShowArtifact-CjVN96wJ.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkToolShowContactForm-DlZdfcNw.js → PkToolShowContactForm-CmBLigw8.js} +2 -2
  84. package/dist-vue/_chunks/{PkToolShowContactForm-DlZdfcNw.js.map → PkToolShowContactForm-CmBLigw8.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkToolShowDiagram-BUUjmUpE.js → PkToolShowDiagram-dKUU5_6F.js} +2 -2
  86. package/dist-vue/_chunks/{PkToolShowDiagram-BUUjmUpE.js.map → PkToolShowDiagram-dKUU5_6F.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkToolShowForm-DxiiMSCC.js → PkToolShowForm-B6ESvq-5.js} +4 -4
  88. package/dist-vue/_chunks/{PkToolShowForm-DxiiMSCC.js.map → PkToolShowForm-B6ESvq-5.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkToolShowImageGallery-D01aM-9U.js → PkToolShowImageGallery-Daq0IwTH.js} +2 -2
  90. package/dist-vue/_chunks/{PkToolShowImageGallery-D01aM-9U.js.map → PkToolShowImageGallery-Daq0IwTH.js.map} +1 -1
  91. package/dist-vue/_chunks/{PkToolShowProductList-BRMF3WJf.js → PkToolShowProductList-Bc3Gzyxy.js} +2 -2
  92. package/dist-vue/_chunks/{PkToolShowProductList-BRMF3WJf.js.map → PkToolShowProductList-Bc3Gzyxy.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkToolShowSources-C0_MwX7m.js → PkToolShowSources-BDvRbenn.js} +3 -3
  94. package/dist-vue/_chunks/{PkToolShowSources-C0_MwX7m.js.map → PkToolShowSources-BDvRbenn.js.map} +1 -1
  95. package/dist-vue/_chunks/{PkToolShowSuggestedReply-BcjKYwbk.js → PkToolShowSuggestedReply-Cd6VkzvJ.js} +2 -2
  96. package/dist-vue/_chunks/{PkToolShowSuggestedReply-BcjKYwbk.js.map → PkToolShowSuggestedReply-Cd6VkzvJ.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkToolShowVideo-CjjoQH7j.js → PkToolShowVideo-Bo1gsD97.js} +2 -2
  98. package/dist-vue/_chunks/{PkToolShowVideo-CjjoQH7j.js.map → PkToolShowVideo-Bo1gsD97.js.map} +1 -1
  99. package/dist-vue/_chunks/{PkToolShowWebPages-B5reGh4g.js → PkToolShowWebPages-DI3sZiqh.js} +2 -2
  100. package/dist-vue/_chunks/{PkToolShowWebPages-B5reGh4g.js.map → PkToolShowWebPages-DI3sZiqh.js.map} +1 -1
  101. package/dist-vue/_chunks/{createChatbotApiClient-DcLpptlt.js → createChatbotApiClient-DUz4dwzY.js} +12 -12
  102. package/dist-vue/_chunks/{createChatbotApiClient-DcLpptlt.js.map → createChatbotApiClient-DUz4dwzY.js.map} +1 -1
  103. package/dist-vue/_chunks/{useChatbotStore-BliRphuB.js → useChatbotStore-D7LcpA-6.js} +481 -455
  104. package/dist-vue/_chunks/useChatbotStore-D7LcpA-6.js.map +1 -0
  105. package/dist-vue/_chunks/{utils-C7-KrzRE.js → utils-EPX3V3VI.js} +112 -86
  106. package/dist-vue/_chunks/utils-EPX3V3VI.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 +2 -0
  109. package/dist-vue/apps/web-component/src/components/FloatingChatWidget.ce.d.ts +2 -0
  110. package/dist-vue/apps/web-component/src/composables/usePageTools.d.ts +1 -0
  111. package/dist-vue/apps/web-component/src/lib.d.ts +10 -0
  112. package/dist-vue/apps/web-component/src/pageTools/actions.d.ts +2 -0
  113. package/dist-vue/apps/web-component/src/pageTools/announcements.d.ts +9 -0
  114. package/dist-vue/apps/web-component/src/pageTools/index.d.ts +12 -1
  115. package/dist-vue/apps/web-component/src/pageTools/navigation.d.ts +40 -8
  116. package/dist-vue/apps/web-component/src/pageTools/snapshot.d.ts +60 -0
  117. package/dist-vue/composables.js +34 -8
  118. package/dist-vue/composables.js.map +1 -1
  119. package/dist-vue/index.js +145 -125
  120. package/dist-vue/index.js.map +1 -1
  121. package/dist-vue/locales.js +28 -2
  122. package/dist-vue/packages/components/src/PkEditorPrompt.d.ts +6 -0
  123. package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +4 -0
  124. package/dist-vue/packages/components/src/chat/PkHostCallConfirmCard.d.ts +7 -1
  125. package/dist-vue/packages/components/src/chat/PkHostCallConfirmDialog.d.ts +4 -0
  126. package/dist-vue/packages/components/src/chat/PkPageControlBar.d.ts +5 -1
  127. package/dist-vue/packages/components/src/chat/utils.d.ts +11 -1
  128. package/dist-vue/packages/composable/src/chatbot/hostTools.d.ts +37 -8
  129. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +8 -2
  130. package/dist-vue/packages/models/src/schema/PageAccess.d.ts +9 -0
  131. package/dist-vue/style.css +1 -1
  132. package/package.json +1 -1
  133. package/dist/_chunks/Agent-C3m0UmlL.js.map +0 -1
  134. package/dist/_chunks/PkStreamingMarkdown--PCkA4Fg.js.map +0 -1
  135. package/dist-vue/_chunks/Agent-3IHYHv05.js.map +0 -1
  136. package/dist-vue/_chunks/PkChatbotMessages-BfKqJ8n_.js +0 -954
  137. package/dist-vue/_chunks/PkChatbotMessages-BfKqJ8n_.js.map +0 -1
  138. package/dist-vue/_chunks/PkChatbotSteps-CoDtEaL7.js +0 -189
  139. package/dist-vue/_chunks/PkChatbotSteps-CoDtEaL7.js.map +0 -1
  140. package/dist-vue/_chunks/PkChatbotViewChat-t-XkwFbe.js.map +0 -1
  141. package/dist-vue/_chunks/useChatbotStore-BliRphuB.js.map +0 -1
  142. package/dist-vue/_chunks/utils-C7-KrzRE.js.map +0 -1
@@ -1,5 +1,14 @@
1
1
  import { PageAccessCapability } from '../../../../packages/models/src';
2
2
  import { RegisteredHostTool } from '../../../../packages/composable/src';
3
+ /**
4
+ * A page of the site the app declares to the widget (`registerPages`, spec
5
+ * `page-tools-improvements.md`, M6): `<id>` or `:id` in its path stands for
6
+ * any one segment.
7
+ */
8
+ export type DeclaredPage = {
9
+ path: string;
10
+ title?: string;
11
+ };
3
12
  /** What the tools say to the user: their titles and the questions they ask. */
4
13
  export type PageToolsTranslate = (key: string, params?: Record<string, unknown>) => string;
5
14
  /**
@@ -7,6 +16,8 @@ export type PageToolsTranslate = (key: string, params?: Record<string, unknown>)
7
16
  * of the agent. Empty when an excluded selector does not parse: an exclusion
8
17
  * that does not apply must turn access off, not exclude less.
9
18
  */
10
- export declare function createPageTools(capability: PageAccessCapability, { t }: {
19
+ export declare function createPageTools(capability: PageAccessCapability, { t, pages, }: {
11
20
  t: PageToolsTranslate;
21
+ /** The pages the app declared, read at each call. */
22
+ pages?: () => readonly DeclaredPage[];
12
23
  }): RegisteredHostTool[];
@@ -14,14 +14,46 @@ export declare function pageQuiet(): Promise<void>;
14
14
  /** Called right before the action that may load another document. */
15
15
  export declare function startPageChange(): void;
16
16
  /**
17
- * Opens `url`, an address of this site, the way the site's own links do in a
18
- * single-page app: a history entry and a `popstate`, which Vue Router, React
19
- * Router and most routers follow without loading the page again. Loaded
20
- * again, the page would drop the call the answer makes next. When within a
21
- * moment neither a view changes (`ROUTE_MIN_ELEMENTS`) nor the title, no
22
- * router took the address: it then loads as typed in the address bar. The
23
- * page tools wait meanwhile, as after a click that may load another page.
17
+ * Asks the site's router for `url`, an address of this site, the way the
18
+ * site's own links do in a single-page app: a history entry and a
19
+ * `popstate`, which Vue Router, React Router and most routers follow without
20
+ * loading the page again. Loaded again, the page would drop the call the
21
+ * answer makes next. Tells whether a router took it: within a moment a view
22
+ * changed (`ROUTE_MIN_ELEMENTS`) or the title did. Nothing loads either way:
23
+ * an address no router takes is the caller's to load.
24
24
  */
25
- export declare function openAddress(url: string): void;
25
+ export declare function routeTo(url: string): Promise<boolean>;
26
26
  /** What every page tool awaits before it reads or acts. */
27
27
  export declare function pageChangeSettled(): Promise<void>;
28
+ /** True where navigations can be held: the browser has the Navigation API. */
29
+ export declare const canHoldLeaving: () => boolean;
30
+ /** What an action does with the navigations it holds. */
31
+ export type LeavingHold = {
32
+ /** Where the navigation held goes, once one was. */
33
+ readonly destination: string | undefined;
34
+ /** Lets navigations go again, and makes the one held, as the page asked for it. */
35
+ release(): void;
36
+ /** Lets navigations go again and drops the one held: the call was stopped. */
37
+ drop(): void;
38
+ };
39
+ /**
40
+ * Holds every navigation that would load another document in this tab, from
41
+ * an action of the agent until the answer carrying its result has reached
42
+ * the backend (spec `page-tools-improvements.md`, M3): the action runs at
43
+ * once, so its result can say what it did when the site handles it in the
44
+ * page (a single-page app), and the page leaves only once that result is
45
+ * safe. The Navigation API's `navigate` event comes after the site's own
46
+ * handlers, for a form, a link or a script alike, whatever they do to the
47
+ * event's propagation and in shadow roots too: the DOM events missed those.
48
+ *
49
+ * Measured in Chrome (spike of 2026-10-26): a submit made with `click()` is
50
+ * `userInitiated`, so that flag cannot tell the user's own clicks apart; a
51
+ * submitter's `formmethod="post"` leaves the event without `formData`, so
52
+ * the entries of the `submission` the caller names are taken instead.
53
+ * Downloads, same-document routes and navigations that cannot be cancelled
54
+ * go through. Undefined where the browser has no Navigation API.
55
+ */
56
+ export declare function holdLeaving(submission?: {
57
+ form: HTMLFormElement;
58
+ submitter: Element | null;
59
+ }): LeavingHold | undefined;
@@ -21,12 +21,39 @@ export declare const selectorsAreValid: (rules: PageRules) => boolean;
21
21
  * subtrees only needs `excludesItself` on the way down.
22
22
  */
23
23
  export declare function isExcluded(element: Element, rules: PageRules): boolean;
24
+ /**
25
+ * Hidden for the user; `display: contents` has no box but shows its
26
+ * children. An inert subtree counts as hidden for the snapshot (it takes no
27
+ * click nor focus: not a page the agent can use), not with `inert: false`:
28
+ * a modal dialog makes the rest of the page inert without hiding it, the
29
+ * widget's own card included (`formSummary`, the outcome of an action).
30
+ */
31
+ export declare const isHidden: (element: Element, { inert }?: {
32
+ inert?: boolean;
33
+ }) => boolean;
24
34
  /** The text of an element through the same filter as the snapshot. */
25
35
  export declare function filteredText(root: Element, rules: PageRules, max: number): string;
26
36
  /** The role a screen reader would announce, or undefined for a plain container. */
27
37
  export declare function roleOf(element: Element): string | undefined;
28
38
  /** The accessible name, in the order the accessibility tree computes it, never from an excluded element. */
29
39
  export declare function nameOf(element: Element, rules: PageRules): string;
40
+ /** The open shadow roots of the page, nested ones included; never the widget's. */
41
+ export declare function openShadowRoots(doc: Document): ShadowRoot[];
42
+ /**
43
+ * The modal dialog the user is in, when the page has one open: with more
44
+ * than one, the dialog that takes the point at its own centre (the backdrop
45
+ * of the top one covers those below), else the innermost, since a modal
46
+ * opened from inside another is the one on top.
47
+ */
48
+ export declare function openModal(doc?: Document): HTMLDialogElement | undefined;
49
+ /**
50
+ * The open modal dialog of the page that keeps `element` out of the user's
51
+ * reach: only the one on top takes clicks, a dialog under it is inert as
52
+ * well. A click from a script gets past the inert page where the user
53
+ * cannot: seen on the bench, a tab behind an editor dialog switched its
54
+ * panel and left the dialog open and hidden over the whole page.
55
+ */
56
+ export declare function blockingDialog(element: Element): HTMLDialogElement | undefined;
30
57
  /**
31
58
  * The question of the site's own confirmation dialog when `element` answers
32
59
  * it: one of its buttons, or with `anyElement` any element in it (a key goes
@@ -41,8 +68,41 @@ export declare function confirmationQuestion(element: Element, rules: PageRules,
41
68
  }): string | undefined;
42
69
  /** The options of a select the agent may see and pick: not the excluded ones. */
43
70
  export declare const allowedOptions: (select: HTMLSelectElement, rules: PageRules) => HTMLOptionElement[];
71
+ /**
72
+ * The language a name stands for: a code (`it`, `en-US`) or the language's
73
+ * name in the page's language, in English or in itself ("Italiano",
74
+ * "English", "Deutsch"). `Intl.DisplayNames` only goes from code to name, so
75
+ * the names of a fixed set of candidates are listed once; a name two
76
+ * languages share stands for none.
77
+ */
78
+ export declare function languageNamed(name: string): string | undefined;
44
79
  /** One line for an element with a role: `[12] button "Invia" disabled`. */
45
80
  export declare function describe(element: Element, ref: number, rules: PageRules): string;
81
+ /** A field of a form as the user sees it filled in. */
82
+ export type FieldSummary = {
83
+ label: string;
84
+ value: string;
85
+ };
86
+ /**
87
+ * The fields of a form as its user sees them filled in, for the card that
88
+ * asks before submitting it (spec `page-tools-improvements.md`, M2): what
89
+ * the user judges, not the exact body of the request, which the site's own
90
+ * handlers may change. Leaves out the excluded and sensitive fields (with
91
+ * their labels, as the snapshot does), the hidden, disabled and empty ones,
92
+ * and the buttons. `checked` is the value of a ticked checkbox.
93
+ */
94
+ export declare function formSummary(form: HTMLFormElement, rules: PageRules, { checked, whole, }: {
95
+ checked: string;
96
+ /**
97
+ * Every field with its whole value, a list box by the text it shows:
98
+ * what tells whether the form changed while its card waited, the
99
+ * fields past the card's eight and the ends of long values included.
100
+ */
101
+ whole?: boolean;
102
+ }): {
103
+ fields: FieldSummary[];
104
+ more: number;
105
+ };
46
106
  export type SnapshotResult = {
47
107
  text: string;
48
108
  truncated: boolean;
@@ -1,8 +1,8 @@
1
- import { g as e, h as t } from "./_chunks/Agent-3IHYHv05.js";
2
- import { t as n } from "./_chunks/createChatbotApiClient-DcLpptlt.js";
3
- import { n as r } from "./_chunks/useChatbotStore-BliRphuB.js";
1
+ import { g as e, h as t } from "./_chunks/Agent-DZb775Ak.js";
2
+ import { t as n } from "./_chunks/createChatbotApiClient-DUz4dwzY.js";
3
+ import { n as r } from "./_chunks/useChatbotStore-D7LcpA-6.js";
4
4
  import { n as i } from "./_chunks/src-BZRiAJsH.js";
5
- import { A as a, i as o } from "./_chunks/utils-C7-KrzRE.js";
5
+ import { a, j as o } from "./_chunks/utils-EPX3V3VI.js";
6
6
  import { t as s } from "./_chunks/useLocalizedString-PfaKjIQY.js";
7
7
  import { computed as c, getCurrentInstance as l, getCurrentScope as u, onBeforeUnmount as d, onMounted as f, onScopeDispose as p, ref as m, toValue as h, watch as g } from "vue";
8
8
  import { createI18n as _ } from "vue-i18n";
@@ -82,7 +82,7 @@ function L(e) {
82
82
  }, { immediate: !0 }), g(() => h(e.headers), () => {
83
83
  u.value && p();
84
84
  });
85
- let _ = c(() => t.value?.interface ?? r.value?.interface), v = c(() => a(_.value?.textColor, _.value?.mainColor)), y = c(() => _.value?.mainColor);
85
+ let _ = c(() => t.value?.interface ?? r.value?.interface), v = c(() => o(_.value?.textColor, _.value?.mainColor)), y = c(() => _.value?.mainColor);
86
86
  return {
87
87
  agent: t,
88
88
  branding: r,
@@ -101,7 +101,7 @@ function L(e) {
101
101
  let n = h(e.systemTheme);
102
102
  return n ? ["theme", `theme--${n}`] : ["theme"];
103
103
  }),
104
- themeStyle: c(() => o(y.value, v.value))
104
+ themeStyle: c(() => a(y.value, v.value))
105
105
  };
106
106
  }
107
107
  var R = {
@@ -1336,7 +1336,15 @@ var R = {
1336
1336
  stepStart: "Inizio di un passaggio",
1337
1337
  text: "Testo"
1338
1338
  },
1339
- webSearch: "Ricerca sul web…"
1339
+ webSearch: "Ricerca sul web…",
1340
+ pageStep: {
1341
+ click: "Clic su «{name}»…",
1342
+ fill: "Compilazione di «{name}»…",
1343
+ find: "Ricerca di «{text}» nella pagina…",
1344
+ hover: "Puntamento di «{name}»…",
1345
+ navigate: "Apertura di {url}…",
1346
+ press: "Pressione di {key} su «{name}»…"
1347
+ }
1340
1348
  },
1341
1349
  openaiApi: {
1342
1350
  access: "Accesso via API",
@@ -1760,16 +1768,21 @@ var R = {
1760
1768
  confirmed: "Confermato: l'agente ha proseguito con l'azione.",
1761
1769
  denied: "Rifiutato: l'azione non è stata eseguita.",
1762
1770
  expired: "Questa richiesta non è più confermabile: l'azione non è stata eseguita.",
1771
+ fieldChecked: "sì",
1763
1772
  formFill: "L'agente vuole compilare il modulo «{name}». Consenti?",
1764
1773
  formSubmit: "L'agente vuole compilare e inviare il modulo «{name}». Consenti?",
1765
1774
  hostCall: "L'agente vuole usare «{name}». Consenti?",
1775
+ moreFields: "e altri {count} campi",
1766
1776
  pageAnswer: "La pagina chiede: «{question}» L'agente vuole rispondere «{name}». Consenti?",
1767
1777
  pageBack: "L'agente vuole tornare alla pagina precedente. Consenti?",
1768
1778
  pageClick: "L'agente vuole cliccare «{name}». Consenti?",
1769
1779
  pageElement: "un elemento",
1770
1780
  pageFill: "L'agente vuole scrivere «{value}» in «{name}». Consenti?",
1781
+ pageFillFields: "L'agente vuole compilare questi campi. Consenti?",
1782
+ pageFocused: "l'elemento attivo",
1771
1783
  pageHover: "L'agente vuole puntare «{name}». Consenti?",
1772
1784
  pageNavigate: "L'agente vuole aprire «{url}». Consenti?",
1785
+ pageNavigateUnknown: "L'agente vuole aprire «{url}», che la pagina non mostra. Consenti?",
1773
1786
  pageOpen: "L'agente vuole aprire «{name}»: la pagina cambierà. Consenti?",
1774
1787
  pagePress: "L'agente vuole premere {key} su «{name}». Consenti?",
1775
1788
  pageSubmit: "L'agente vuole inviare il modulo con «{name}». Consenti?",
@@ -3305,7 +3318,15 @@ var R = {
3305
3318
  stepStart: "Step start",
3306
3319
  text: "Text"
3307
3320
  },
3308
- webSearch: "Searching the web…"
3321
+ webSearch: "Searching the web…",
3322
+ pageStep: {
3323
+ click: "Clicking “{name}”…",
3324
+ fill: "Filling in “{name}”…",
3325
+ find: "Finding “{text}” on the page…",
3326
+ hover: "Pointing at “{name}”…",
3327
+ navigate: "Opening {url}…",
3328
+ press: "Pressing {key} on “{name}”…"
3329
+ }
3309
3330
  },
3310
3331
  openaiApi: {
3311
3332
  access: "API access",
@@ -3729,16 +3750,21 @@ var R = {
3729
3750
  confirmed: "Confirmed: the agent proceeded with the action.",
3730
3751
  denied: "Denied: the action was not performed.",
3731
3752
  expired: "This request is no longer answerable: the action was not performed.",
3753
+ fieldChecked: "yes",
3732
3754
  formFill: "The agent wants to fill in the form “{name}”. Allow it?",
3733
3755
  formSubmit: "The agent wants to fill in and submit the form “{name}”. Allow it?",
3734
3756
  hostCall: "The agent wants to use “{name}”. Allow it?",
3757
+ moreFields: "and {count} more fields",
3735
3758
  pageAnswer: "The page asks: “{question}” The agent wants to answer “{name}”. Allow it?",
3736
3759
  pageBack: "The agent wants to go back to the previous page. Allow it?",
3737
3760
  pageClick: "The agent wants to click “{name}”. Allow it?",
3738
3761
  pageElement: "an element",
3739
3762
  pageFill: "The agent wants to write “{value}” in “{name}”. Allow it?",
3763
+ pageFillFields: "The agent wants to fill in these fields. Allow it?",
3764
+ pageFocused: "the focused element",
3740
3765
  pageHover: "The agent wants to point at “{name}”. Allow it?",
3741
3766
  pageNavigate: "The agent wants to open “{url}”. Allow it?",
3767
+ pageNavigateUnknown: "The agent wants to open “{url}”, which the page does not show. Allow it?",
3742
3768
  pageOpen: "The agent wants to open “{name}”: the page will change. Allow it?",
3743
3769
  pagePress: "The agent wants to press {key} on “{name}”. Allow it?",
3744
3770
  pageSubmit: "The agent wants to submit the form with “{name}”. Allow it?",