@dudko.dev/agent-web-ui 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/README.md +94 -3
  2. package/dist/canvas.cjs +0 -1
  3. package/dist/canvas.js +1 -2
  4. package/dist/{chunk-EL2YCROY.js → chunk-D64VLIRY.js} +0 -1
  5. package/dist/chunk-G7LQTOA2.js +1439 -0
  6. package/dist/{chunk-4EHUITGU.js → chunk-S5AHUAFG.js} +6 -1
  7. package/dist/{chunk-7O64ZI6Z.js → chunk-TJBGZM6D.js} +0 -1
  8. package/dist/{chunk-P2F2P3JC.js → chunk-UNIXGP4N.js} +6 -1
  9. package/dist/{chunk-A55Q377T.js → chunk-V33T6VX3.js} +6 -1
  10. package/dist/{chunk-TPK25QGK.js → chunk-VZCQXE3P.js} +6 -1
  11. package/dist/{chunk-GB7RZJMG.js → chunk-WEYQMUKY.js} +0 -1
  12. package/dist/{chunk-KZQB35LS.js → chunk-Y6QYUFSC.js} +0 -1
  13. package/dist/controller.cjs +1890 -0
  14. package/dist/controller.d.cts +253 -0
  15. package/dist/controller.d.ts +253 -0
  16. package/dist/controller.js +481 -0
  17. package/dist/{en-CcNUz2tN.d.ts → en-Dg2MtzcJ.d.cts} +6 -0
  18. package/dist/{en-CcNUz2tN.d.cts → en-Dg2MtzcJ.d.ts} +6 -0
  19. package/dist/index.cjs +133 -1
  20. package/dist/index.d.cts +82 -4
  21. package/dist/index.d.ts +82 -4
  22. package/dist/index.js +144 -1422
  23. package/dist/{labels-UuWI7wPo.d.ts → labels-CmiTBLWD.d.cts} +68 -100
  24. package/dist/{labels-D5BrHct4.d.cts → labels-DH1ESUtm.d.ts} +68 -100
  25. package/dist/locales/be.cjs +12 -1
  26. package/dist/locales/be.d.cts +4 -2
  27. package/dist/locales/be.d.ts +4 -2
  28. package/dist/locales/be.js +7 -2
  29. package/dist/locales/bg.cjs +12 -1
  30. package/dist/locales/bg.d.cts +4 -2
  31. package/dist/locales/bg.d.ts +4 -2
  32. package/dist/locales/bg.js +7 -2
  33. package/dist/locales/ca.cjs +12 -1
  34. package/dist/locales/ca.d.cts +4 -2
  35. package/dist/locales/ca.d.ts +4 -2
  36. package/dist/locales/ca.js +7 -2
  37. package/dist/locales/cs.cjs +12 -1
  38. package/dist/locales/cs.d.cts +4 -2
  39. package/dist/locales/cs.d.ts +4 -2
  40. package/dist/locales/cs.js +7 -2
  41. package/dist/locales/da.cjs +12 -1
  42. package/dist/locales/da.d.cts +4 -2
  43. package/dist/locales/da.d.ts +4 -2
  44. package/dist/locales/da.js +7 -2
  45. package/dist/locales/de.cjs +12 -1
  46. package/dist/locales/de.d.cts +4 -2
  47. package/dist/locales/de.d.ts +4 -2
  48. package/dist/locales/de.js +7 -2
  49. package/dist/locales/el.cjs +12 -1
  50. package/dist/locales/el.d.cts +4 -2
  51. package/dist/locales/el.d.ts +4 -2
  52. package/dist/locales/el.js +7 -2
  53. package/dist/locales/en.cjs +12 -1
  54. package/dist/locales/en.d.cts +4 -2
  55. package/dist/locales/en.d.ts +4 -2
  56. package/dist/locales/en.js +7 -2
  57. package/dist/locales/es-419.cjs +16 -2
  58. package/dist/locales/es-419.d.cts +4 -2
  59. package/dist/locales/es-419.d.ts +4 -2
  60. package/dist/locales/es-419.js +6 -4
  61. package/dist/locales/es.cjs +12 -1
  62. package/dist/locales/es.d.cts +4 -2
  63. package/dist/locales/es.d.ts +4 -2
  64. package/dist/locales/es.js +2 -3
  65. package/dist/locales/fi.cjs +12 -1
  66. package/dist/locales/fi.d.cts +4 -2
  67. package/dist/locales/fi.d.ts +4 -2
  68. package/dist/locales/fi.js +7 -2
  69. package/dist/locales/fr-CA.cjs +12 -1
  70. package/dist/locales/fr-CA.d.cts +4 -2
  71. package/dist/locales/fr-CA.d.ts +4 -2
  72. package/dist/locales/fr-CA.js +2 -3
  73. package/dist/locales/fr.cjs +12 -1
  74. package/dist/locales/fr.d.cts +4 -2
  75. package/dist/locales/fr.d.ts +4 -2
  76. package/dist/locales/fr.js +2 -3
  77. package/dist/locales/gn.cjs +12 -1
  78. package/dist/locales/gn.d.cts +4 -2
  79. package/dist/locales/gn.d.ts +4 -2
  80. package/dist/locales/gn.js +7 -2
  81. package/dist/locales/hr.cjs +12 -1
  82. package/dist/locales/hr.d.cts +4 -2
  83. package/dist/locales/hr.d.ts +4 -2
  84. package/dist/locales/hr.js +7 -2
  85. package/dist/locales/ht.cjs +12 -1
  86. package/dist/locales/ht.d.cts +4 -2
  87. package/dist/locales/ht.d.ts +4 -2
  88. package/dist/locales/ht.js +7 -2
  89. package/dist/locales/hu.cjs +12 -1
  90. package/dist/locales/hu.d.cts +4 -2
  91. package/dist/locales/hu.d.ts +4 -2
  92. package/dist/locales/hu.js +7 -2
  93. package/dist/locales/index.cjs +6 -1
  94. package/dist/locales/index.d.cts +6 -4
  95. package/dist/locales/index.d.ts +6 -4
  96. package/dist/locales/index.js +1 -2
  97. package/dist/locales/it.cjs +12 -1
  98. package/dist/locales/it.d.cts +4 -2
  99. package/dist/locales/it.d.ts +4 -2
  100. package/dist/locales/it.js +7 -2
  101. package/dist/locales/nb.cjs +12 -1
  102. package/dist/locales/nb.d.cts +4 -2
  103. package/dist/locales/nb.d.ts +4 -2
  104. package/dist/locales/nb.js +7 -2
  105. package/dist/locales/nl.cjs +12 -1
  106. package/dist/locales/nl.d.cts +4 -2
  107. package/dist/locales/nl.d.ts +4 -2
  108. package/dist/locales/nl.js +7 -2
  109. package/dist/locales/pl.cjs +12 -1
  110. package/dist/locales/pl.d.cts +4 -2
  111. package/dist/locales/pl.d.ts +4 -2
  112. package/dist/locales/pl.js +7 -2
  113. package/dist/locales/pt-BR.cjs +12 -1
  114. package/dist/locales/pt-BR.d.cts +4 -2
  115. package/dist/locales/pt-BR.d.ts +4 -2
  116. package/dist/locales/pt-BR.js +7 -2
  117. package/dist/locales/pt.cjs +12 -1
  118. package/dist/locales/pt.d.cts +4 -2
  119. package/dist/locales/pt.d.ts +4 -2
  120. package/dist/locales/pt.js +7 -2
  121. package/dist/locales/qu.cjs +12 -1
  122. package/dist/locales/qu.d.cts +4 -2
  123. package/dist/locales/qu.d.ts +4 -2
  124. package/dist/locales/qu.js +7 -2
  125. package/dist/locales/ro.cjs +12 -1
  126. package/dist/locales/ro.d.cts +4 -2
  127. package/dist/locales/ro.d.ts +4 -2
  128. package/dist/locales/ro.js +7 -2
  129. package/dist/locales/ru.cjs +12 -1
  130. package/dist/locales/ru.d.cts +4 -2
  131. package/dist/locales/ru.d.ts +4 -2
  132. package/dist/locales/ru.js +7 -2
  133. package/dist/locales/sk.cjs +12 -1
  134. package/dist/locales/sk.d.cts +4 -2
  135. package/dist/locales/sk.d.ts +4 -2
  136. package/dist/locales/sk.js +7 -2
  137. package/dist/locales/sq.cjs +12 -1
  138. package/dist/locales/sq.d.cts +4 -2
  139. package/dist/locales/sq.d.ts +4 -2
  140. package/dist/locales/sq.js +7 -2
  141. package/dist/locales/sr-Latn.cjs +12 -1
  142. package/dist/locales/sr-Latn.d.cts +4 -2
  143. package/dist/locales/sr-Latn.d.ts +4 -2
  144. package/dist/locales/sr-Latn.js +2 -3
  145. package/dist/locales/sr.cjs +12 -1
  146. package/dist/locales/sr.d.cts +4 -2
  147. package/dist/locales/sr.d.ts +4 -2
  148. package/dist/locales/sr.js +2 -3
  149. package/dist/locales/sv.cjs +12 -1
  150. package/dist/locales/sv.d.cts +4 -2
  151. package/dist/locales/sv.d.ts +4 -2
  152. package/dist/locales/sv.js +7 -2
  153. package/dist/locales/tr.cjs +12 -1
  154. package/dist/locales/tr.d.cts +4 -2
  155. package/dist/locales/tr.d.ts +4 -2
  156. package/dist/locales/tr.js +7 -2
  157. package/dist/locales/uk.cjs +12 -1
  158. package/dist/locales/uk.d.cts +4 -2
  159. package/dist/locales/uk.d.ts +4 -2
  160. package/dist/locales/uk.js +7 -2
  161. package/dist/markdown.cjs +0 -1
  162. package/dist/markdown.js +1 -2
  163. package/dist/mcp-app-sandbox.cjs +0 -1
  164. package/dist/mcp-app-sandbox.js +1 -2
  165. package/dist/mcp-app.cjs +0 -1
  166. package/dist/mcp-app.d.cts +491 -3
  167. package/dist/mcp-app.d.ts +491 -3
  168. package/dist/mcp-app.js +2 -3
  169. package/dist/pipeline.cjs +0 -1
  170. package/dist/pipeline.js +1 -2
  171. package/dist/questions-Dw--IEjT.d.cts +100 -0
  172. package/dist/questions-Dw--IEjT.d.ts +100 -0
  173. package/dist/{types-BmvgYUzF.d.cts → types-CQquuZpl.d.cts} +1 -1
  174. package/dist/{types-Cr5gmUts.d.ts → types-CXZfZVP5.d.ts} +1 -1
  175. package/dist/{mcp-app-entry-BA-Ca39z.d.ts → types-DnBCok3z.d.cts} +2 -488
  176. package/dist/{mcp-app-entry-tybABaHg.d.cts → types-DnBCok3z.d.ts} +2 -488
  177. package/package.json +13 -3
  178. package/dist/canvas.cjs.map +0 -1
  179. package/dist/canvas.js.map +0 -1
  180. package/dist/chunk-4EHUITGU.js.map +0 -1
  181. package/dist/chunk-7O64ZI6Z.js.map +0 -1
  182. package/dist/chunk-A55Q377T.js.map +0 -1
  183. package/dist/chunk-EL2YCROY.js.map +0 -1
  184. package/dist/chunk-GB7RZJMG.js.map +0 -1
  185. package/dist/chunk-KZQB35LS.js.map +0 -1
  186. package/dist/chunk-P2F2P3JC.js.map +0 -1
  187. package/dist/chunk-TPK25QGK.js.map +0 -1
  188. package/dist/index.cjs.map +0 -1
  189. package/dist/index.js.map +0 -1
  190. package/dist/locales/be.cjs.map +0 -1
  191. package/dist/locales/be.js.map +0 -1
  192. package/dist/locales/bg.cjs.map +0 -1
  193. package/dist/locales/bg.js.map +0 -1
  194. package/dist/locales/ca.cjs.map +0 -1
  195. package/dist/locales/ca.js.map +0 -1
  196. package/dist/locales/cs.cjs.map +0 -1
  197. package/dist/locales/cs.js.map +0 -1
  198. package/dist/locales/da.cjs.map +0 -1
  199. package/dist/locales/da.js.map +0 -1
  200. package/dist/locales/de.cjs.map +0 -1
  201. package/dist/locales/de.js.map +0 -1
  202. package/dist/locales/el.cjs.map +0 -1
  203. package/dist/locales/el.js.map +0 -1
  204. package/dist/locales/en.cjs.map +0 -1
  205. package/dist/locales/en.js.map +0 -1
  206. package/dist/locales/es-419.cjs.map +0 -1
  207. package/dist/locales/es-419.js.map +0 -1
  208. package/dist/locales/es.cjs.map +0 -1
  209. package/dist/locales/es.js.map +0 -1
  210. package/dist/locales/fi.cjs.map +0 -1
  211. package/dist/locales/fi.js.map +0 -1
  212. package/dist/locales/fr-CA.cjs.map +0 -1
  213. package/dist/locales/fr-CA.js.map +0 -1
  214. package/dist/locales/fr.cjs.map +0 -1
  215. package/dist/locales/fr.js.map +0 -1
  216. package/dist/locales/gn.cjs.map +0 -1
  217. package/dist/locales/gn.js.map +0 -1
  218. package/dist/locales/hr.cjs.map +0 -1
  219. package/dist/locales/hr.js.map +0 -1
  220. package/dist/locales/ht.cjs.map +0 -1
  221. package/dist/locales/ht.js.map +0 -1
  222. package/dist/locales/hu.cjs.map +0 -1
  223. package/dist/locales/hu.js.map +0 -1
  224. package/dist/locales/index.cjs.map +0 -1
  225. package/dist/locales/index.js.map +0 -1
  226. package/dist/locales/it.cjs.map +0 -1
  227. package/dist/locales/it.js.map +0 -1
  228. package/dist/locales/nb.cjs.map +0 -1
  229. package/dist/locales/nb.js.map +0 -1
  230. package/dist/locales/nl.cjs.map +0 -1
  231. package/dist/locales/nl.js.map +0 -1
  232. package/dist/locales/pl.cjs.map +0 -1
  233. package/dist/locales/pl.js.map +0 -1
  234. package/dist/locales/pt-BR.cjs.map +0 -1
  235. package/dist/locales/pt-BR.js.map +0 -1
  236. package/dist/locales/pt.cjs.map +0 -1
  237. package/dist/locales/pt.js.map +0 -1
  238. package/dist/locales/qu.cjs.map +0 -1
  239. package/dist/locales/qu.js.map +0 -1
  240. package/dist/locales/ro.cjs.map +0 -1
  241. package/dist/locales/ro.js.map +0 -1
  242. package/dist/locales/ru.cjs.map +0 -1
  243. package/dist/locales/ru.js.map +0 -1
  244. package/dist/locales/sk.cjs.map +0 -1
  245. package/dist/locales/sk.js.map +0 -1
  246. package/dist/locales/sq.cjs.map +0 -1
  247. package/dist/locales/sq.js.map +0 -1
  248. package/dist/locales/sr-Latn.cjs.map +0 -1
  249. package/dist/locales/sr-Latn.js.map +0 -1
  250. package/dist/locales/sr.cjs.map +0 -1
  251. package/dist/locales/sr.js.map +0 -1
  252. package/dist/locales/sv.cjs.map +0 -1
  253. package/dist/locales/sv.js.map +0 -1
  254. package/dist/locales/tr.cjs.map +0 -1
  255. package/dist/locales/tr.js.map +0 -1
  256. package/dist/locales/uk.cjs.map +0 -1
  257. package/dist/locales/uk.js.map +0 -1
  258. package/dist/markdown.cjs.map +0 -1
  259. package/dist/markdown.js.map +0 -1
  260. package/dist/mcp-app-sandbox.cjs.map +0 -1
  261. package/dist/mcp-app-sandbox.js.map +0 -1
  262. package/dist/mcp-app.cjs.map +0 -1
  263. package/dist/mcp-app.js.map +0 -1
  264. package/dist/pipeline.cjs.map +0 -1
  265. package/dist/pipeline.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -51,6 +51,7 @@ __export(src_exports, {
51
51
  RECORDING_DEFAULT_MAX_MS: () => RECORDING_DEFAULT_MAX_MS,
52
52
  RECORDING_TYPES: () => RECORDING_TYPES,
53
53
  SpeechOutputError: () => SpeechOutputError,
54
+ activeElementOf: () => activeElementOf,
54
55
  agentStateReducer: () => agentStateReducer,
55
56
  agentStatusOf: () => agentStatusOf,
56
57
  askUserOutputKept: () => askUserOutputKept,
@@ -69,6 +70,7 @@ __export(src_exports, {
69
70
  chatTitle: () => chatTitle,
70
71
  clampFrameHeight: () => clampFrameHeight,
71
72
  coalesce: () => coalesce,
73
+ composedContains: () => composedContains,
72
74
  createApprovalQueue: () => createApprovalQueue,
73
75
  createAudioSpeaker: () => createAudioSpeaker,
74
76
  createBrowserSpeaker: () => createBrowserSpeaker,
@@ -79,6 +81,8 @@ __export(src_exports, {
79
81
  createRecordingRecognizer: () => createRecordingRecognizer,
80
82
  cspMetaTag: () => cspMetaTag,
81
83
  dataUrlParts: () => dataUrlParts,
84
+ deepActiveElement: () => deepActiveElement,
85
+ deepElementFromPoint: () => deepElementFromPoint,
82
86
  defaultLabels: () => defaultLabels,
83
87
  defaultNoticeTexts: () => defaultNoticeTexts,
84
88
  downscaleImage: () => downscaleImage,
@@ -92,6 +96,7 @@ __export(src_exports, {
92
96
  endGap: () => endGap,
93
97
  errMessage: () => errMessage,
94
98
  escapeAttribute: () => escapeAttribute,
99
+ eventTargetOf: () => eventTargetOf,
95
100
  excerptNote: () => excerptNote,
96
101
  fileKindOf: () => fileKindOf,
97
102
  fileNameOf: () => fileNameOf,
@@ -110,11 +115,14 @@ __export(src_exports, {
110
115
  imagesInOutput: () => imagesInOutput,
111
116
  inputCounterShown: () => inputCounterShown,
112
117
  insertionFits: () => insertionFits,
118
+ isEventInside: () => isEventInside,
113
119
  isOneCharacter: () => isOneCharacter,
120
+ isShadowRoot: () => isShadowRoot,
114
121
  languageOfText: () => languageOfText,
115
122
  lessonsOf: () => lessonsOf,
116
123
  lineCountOf: () => lineCountOf,
117
124
  linkedFilesOf: () => linkedFilesOf,
125
+ listenScrollAround: () => listenScrollAround,
118
126
  listenToOtherTabs: () => listenToOtherTabs,
119
127
  longTextName: () => longTextName,
120
128
  longTextRoute: () => longTextRoute,
@@ -127,6 +135,9 @@ __export(src_exports, {
127
135
  micProblemText: () => micProblemText,
128
136
  namedFilesOf: () => namedFilesOf,
129
137
  newChatId: () => newChatId,
138
+ notReadyIntent: () => notReadyIntent,
139
+ notReadyReason: () => notReadyReason,
140
+ nothingFocused: () => nothingFocused,
130
141
  noticesOf: () => noticesOf,
131
142
  overflowOf: () => overflowOf,
132
143
  ownUnsaved: () => ownUnsaved,
@@ -134,18 +145,21 @@ __export(src_exports, {
134
145
  pathsNamedIn: () => pathsNamedIn,
135
146
  pendingApprovalsOf: () => pendingApprovalsOf,
136
147
  pickRecordingType: () => pickRecordingType,
148
+ portalHostOf: () => portalHostOf,
137
149
  previewValue: () => previewValue,
138
150
  questionChoiceOf: () => questionChoiceOf,
139
151
  questionOtherOf: () => questionOtherOf,
140
152
  questionTimeoutOf: () => questionTimeoutOf,
141
153
  recordingSupported: () => recordingSupported,
142
154
  remoteAnswerOf: () => remoteAnswerOf,
155
+ rootOf: () => rootOf,
143
156
  sandboxTokens: () => sandboxTokens,
144
157
  sandboxedCsp: () => sandboxedCsp,
145
158
  saveAttachments: () => saveAttachments,
146
159
  saveChat: () => saveChat,
147
160
  scriptOfLanguage: () => scriptOfLanguage,
148
161
  scriptOfText: () => scriptOfText,
162
+ shadowRootsAround: () => shadowRootsAround,
149
163
  speakableText: () => speakableText,
150
164
  speechSynthesisSupported: () => speechSynthesisSupported,
151
165
  splitForSpeech: () => splitForSpeech,
@@ -159,6 +173,7 @@ __export(src_exports, {
159
173
  voiceFor: () => voiceFor,
160
174
  voiceMessageName: () => voiceMessageName,
161
175
  voicesOf: () => voicesOf,
176
+ waitingSendStep: () => waitingSendStep,
162
177
  webSearchOf: () => webSearchOf,
163
178
  withAttachments: () => withAttachments,
164
179
  withCspFirst: () => withCspFirst,
@@ -1527,6 +1542,21 @@ var steerIntent = (input) => {
1527
1542
  if (parseSlash(input.raw)) return "ignore";
1528
1543
  return input.hasAttachments ? "attachments" : "steer";
1529
1544
  };
1545
+ var notReadyIntent = (input) => {
1546
+ if (!input.hasContent) return "ignore";
1547
+ if (input.disabled) return "refuse";
1548
+ if (input.ready) return "send";
1549
+ if (input.status === "initializing") return "wait";
1550
+ return "refuse";
1551
+ };
1552
+ var notReadyReason = (input) => input.disabled ? "disabled" : input.status === "error" ? "failed" : "unavailable";
1553
+ var waitingSendStep = (input) => {
1554
+ if (input.disabled) return "stop";
1555
+ if (input.ready) return "send";
1556
+ if (input.status === "initializing" || input.status === "running") return "wait";
1557
+ if (input.status === "error") return "failed";
1558
+ return "stop";
1559
+ };
1530
1560
  var filterCommands = (commands, query) => {
1531
1561
  const q = query.toLowerCase();
1532
1562
  if (!q) return commands;
@@ -1989,6 +2019,12 @@ var defaultLabels = {
1989
2019
  placeholderBusy: "Tell the agent something while it works…",
1990
2020
  steer: "Send to the agent",
1991
2021
  noAttachmentsWhileBusy: "Files can’t be added while the agent is working — send them with your next message.",
2022
+ sendWhenReady: "Sends when the agent is ready",
2023
+ sendWhenReadyButton: "Send when the agent is ready",
2024
+ cancelSendWhenReady: "Don’t send",
2025
+ notSentFailed: "Not sent: the agent could not start. Your message is still here.",
2026
+ notSentUnavailable: "Not sent: the agent isn’t ready. Your message is still here.",
2027
+ notSentDisabled: "Not sent: sending is turned off. Your message is still here.",
1992
2028
  queuedWaiting: "waiting for the agent’s next step",
1993
2029
  queuedForSession: (heldBy) => heldBy === "this-tab" ? "waiting for the other run to finish" : "waiting for the other tab to finish",
1994
2030
  queuedForOtherTab: "waiting for the other tab to pick it up",
@@ -2421,6 +2457,88 @@ var followsAfterScroll = (following, before, now) => {
2421
2457
  };
2422
2458
  var followsAfterResize = (following, before, now) => following && !(now.clientHeight === before.clientHeight && now.scrollHeight >= before.scrollHeight && now.scrollTop < reach(before) - FOLLOW_LEAVE_PX);
2423
2459
 
2460
+ // src/dom-root.ts
2461
+ var DOCUMENT_NODE = 9;
2462
+ var DOCUMENT_FRAGMENT_NODE = 11;
2463
+ var MAX_DEPTH = 64;
2464
+ var isShadowRoot = (node) => typeof node === "object" && node !== null && node.nodeType === DOCUMENT_FRAGMENT_NODE && "host" in node && Boolean(node.host);
2465
+ var isDocument = (node) => typeof node === "object" && node !== null && node.nodeType === DOCUMENT_NODE;
2466
+ var rootOf = (node) => {
2467
+ if (isDocument(node)) return node;
2468
+ const root = typeof node.getRootNode === "function" ? node.getRootNode() : void 0;
2469
+ if (isDocument(root) || isShadowRoot(root)) return root;
2470
+ return node.ownerDocument;
2471
+ };
2472
+ var activeElementOf = (at) => {
2473
+ const root = isDocument(at) || isShadowRoot(at) ? at : rootOf(at);
2474
+ return root.activeElement ?? null;
2475
+ };
2476
+ var deepActiveElement = (root) => {
2477
+ let active = root.activeElement ?? null;
2478
+ for (let i = 0; active && i < MAX_DEPTH; i++) {
2479
+ const inner = active.shadowRoot?.activeElement;
2480
+ if (!inner || inner === active) break;
2481
+ active = inner;
2482
+ }
2483
+ return active;
2484
+ };
2485
+ var nothingFocused = (doc) => {
2486
+ const active = doc.activeElement;
2487
+ return !active || active === doc.body;
2488
+ };
2489
+ var composedContains = (ancestor, node) => {
2490
+ let at = node;
2491
+ for (let i = 0; at && i < 1e5; i++) {
2492
+ if (at === ancestor) return true;
2493
+ at = at.parentNode ?? (isShadowRoot(at) ? at.host : null);
2494
+ }
2495
+ return false;
2496
+ };
2497
+ var pathOf = (event) => typeof event.composedPath === "function" ? event.composedPath() : [];
2498
+ var eventTargetOf = (event) => pathOf(event)[0] ?? event.target;
2499
+ var isEventInside = (event, node) => {
2500
+ if (!node) return false;
2501
+ const target = event.target;
2502
+ const path = pathOf(event);
2503
+ if (path.length > 0 && path[0] !== target) return path.includes(node);
2504
+ return typeof target?.nodeType === "number" && node.contains(target);
2505
+ };
2506
+ var deepElementFromPoint = (doc, x, y) => {
2507
+ if (typeof doc.elementFromPoint !== "function") return null;
2508
+ let hit = doc.elementFromPoint(x, y);
2509
+ for (let i = 0; hit && i < MAX_DEPTH; i++) {
2510
+ const shadow = hit.shadowRoot;
2511
+ if (!shadow || typeof shadow.elementFromPoint !== "function") break;
2512
+ const inner = shadow.elementFromPoint(x, y);
2513
+ if (!inner || inner === hit || !composedContains(shadow, inner)) break;
2514
+ hit = inner;
2515
+ }
2516
+ return hit;
2517
+ };
2518
+ var shadowRootsAround = (node) => {
2519
+ const roots = [];
2520
+ let root = rootOf(node);
2521
+ for (let i = 0; isShadowRoot(root) && i < MAX_DEPTH; i++) {
2522
+ roots.push(root);
2523
+ root = rootOf(root.host);
2524
+ }
2525
+ return roots;
2526
+ };
2527
+ var listenScrollAround = (node, listener) => {
2528
+ const view = node.ownerDocument?.defaultView ?? globalThis;
2529
+ const targets = [view, ...shadowRootsAround(node)];
2530
+ for (const t of targets) t.addEventListener("scroll", listener, true);
2531
+ return () => {
2532
+ for (const t of targets) t.removeEventListener("scroll", listener, true);
2533
+ };
2534
+ };
2535
+ var portalHostOf = (from, selector) => {
2536
+ const near = from.closest(selector);
2537
+ if (near) return near;
2538
+ const root = rootOf(from);
2539
+ return isShadowRoot(root) ? root : from.ownerDocument.body;
2540
+ };
2541
+
2424
2542
  // src/file-kinds.ts
2425
2543
  var import_agent_web2 = require("@dudko.dev/agent-web");
2426
2544
  var CODE = /\.(?:js|mjs|cjs|jsx|ts|tsx|css|scss|py|rb|go|rs|java|kt|c|h|cpp|cs|php|sh|sql|xml|svg|yaml|yml|toml)$/i;
@@ -4025,6 +4143,7 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
4025
4143
  RECORDING_DEFAULT_MAX_MS,
4026
4144
  RECORDING_TYPES,
4027
4145
  SpeechOutputError,
4146
+ activeElementOf,
4028
4147
  agentStateReducer,
4029
4148
  agentStatusOf,
4030
4149
  askUserOutputKept,
@@ -4043,6 +4162,7 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
4043
4162
  chatTitle,
4044
4163
  clampFrameHeight,
4045
4164
  coalesce,
4165
+ composedContains,
4046
4166
  createApprovalQueue,
4047
4167
  createAudioSpeaker,
4048
4168
  createBrowserSpeaker,
@@ -4053,6 +4173,8 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
4053
4173
  createRecordingRecognizer,
4054
4174
  cspMetaTag,
4055
4175
  dataUrlParts,
4176
+ deepActiveElement,
4177
+ deepElementFromPoint,
4056
4178
  defaultLabels,
4057
4179
  defaultNoticeTexts,
4058
4180
  downscaleImage,
@@ -4066,6 +4188,7 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
4066
4188
  endGap,
4067
4189
  errMessage,
4068
4190
  escapeAttribute,
4191
+ eventTargetOf,
4069
4192
  excerptNote,
4070
4193
  fileKindOf,
4071
4194
  fileNameOf,
@@ -4084,11 +4207,14 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
4084
4207
  imagesInOutput,
4085
4208
  inputCounterShown,
4086
4209
  insertionFits,
4210
+ isEventInside,
4087
4211
  isOneCharacter,
4212
+ isShadowRoot,
4088
4213
  languageOfText,
4089
4214
  lessonsOf,
4090
4215
  lineCountOf,
4091
4216
  linkedFilesOf,
4217
+ listenScrollAround,
4092
4218
  listenToOtherTabs,
4093
4219
  longTextName,
4094
4220
  longTextRoute,
@@ -4101,6 +4227,9 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
4101
4227
  micProblemText,
4102
4228
  namedFilesOf,
4103
4229
  newChatId,
4230
+ notReadyIntent,
4231
+ notReadyReason,
4232
+ nothingFocused,
4104
4233
  noticesOf,
4105
4234
  overflowOf,
4106
4235
  ownUnsaved,
@@ -4108,18 +4237,21 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
4108
4237
  pathsNamedIn,
4109
4238
  pendingApprovalsOf,
4110
4239
  pickRecordingType,
4240
+ portalHostOf,
4111
4241
  previewValue,
4112
4242
  questionChoiceOf,
4113
4243
  questionOtherOf,
4114
4244
  questionTimeoutOf,
4115
4245
  recordingSupported,
4116
4246
  remoteAnswerOf,
4247
+ rootOf,
4117
4248
  sandboxTokens,
4118
4249
  sandboxedCsp,
4119
4250
  saveAttachments,
4120
4251
  saveChat,
4121
4252
  scriptOfLanguage,
4122
4253
  scriptOfText,
4254
+ shadowRootsAround,
4123
4255
  speakableText,
4124
4256
  speechSynthesisSupported,
4125
4257
  splitForSpeech,
@@ -4133,6 +4265,7 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
4133
4265
  voiceFor,
4134
4266
  voiceMessageName,
4135
4267
  voicesOf,
4268
+ waitingSendStep,
4136
4269
  webSearchOf,
4137
4270
  withAttachments,
4138
4271
  withCspFirst,
@@ -4140,4 +4273,3 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
4140
4273
  withoutOwnWords,
4141
4274
  workspacePathOf
4142
4275
  });
4143
- //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { AgentEvent, IUsage, Skill, ToolApprovalRequest, ToolApprovalContext, ToolApprovalDecision } from '@dudko.dev/agent-web';
2
- import { A as AgentUiState, C as ChatAttachment, R as RemoteRunView, L as LessonView, h as ChatMessage, i as ApprovalView, S as SubagentView, j as SubagentNode } from './mcp-app-entry-tybABaHg.cjs';
3
- export { f as AgentStatus, k as AppView, B as BrowserOAuthProvider, l as BrowserOAuthProviderOptions, m as BudgetView, n as CompactionView, o as ConnectedMcp, D as DecisionView, E as ElicitationView, F as FetchView, p as McpAppsConnectionLike, q as McpCatalogEntry, M as McpElicitationFieldSchema, a as McpElicitationHandler, d as McpElicitationOptions, b as McpElicitationRequest, c as McpElicitationResult, e as McpElicitationSchema, r as McpHttpServerConfig, s as McpModule, t as McpOAuthCallback, u as McpOAuthRegistration, v as McpOAuthRegistrationKind, w as McpProtocolMode, x as McpServerInstructions, y as McpServerProtocol, z as McpServerResult, G as MediaView, H as ModelLoadState, Q as QuestionView, I as QueuedMessageView, J as ReplanState, K as SkillConsentView, N as StepEscalationView, O as StepView, T as ToolCallView, P as TranscriptView, U as UserNoteView, W as WrittenFileView } from './mcp-app-entry-tybABaHg.cjs';
4
- export { a as ASK_USER_TOOL_NAME, b as ATTACHMENT_BOUNDS, c as AgentLabels, A as AgentLabelsOverride, d as AttachmentBounds, e as AttachmentFiles, f as AttachmentOverLimit, g as AttachmentTextOptions, h as AttachmentTransform, C as ComposerAttachment, i as ComposerNotice, E as ELICITATION_MAX_OPTIONS, j as ELICITATION_TIMEOUT_MS, k as ELICITATION_VALUE_MAX_CHARS, l as ElicitationControl, m as ElicitationDraft, n as ElicitationDraftValue, o as ElicitationField, p as ElicitationFormOutcome, q as ElicitationIssue, r as ElicitationIssueKind, s as ElicitationLink, t as ElicitationOption, u as ElicitationOutcomeReason, v as ElicitationQueue, w as ElicitationQueueOptions, F as FileKind, I as INPUT_COUNTER_FROM, M as MenuSection, N as NoticeTexts, P as PendingElicitation, x as PendingQuestion, Q as QUESTION_TIMEOUT_MS, y as QuestionOutcomeReason, z as QuestionQueue, B as QuestionQueueOptions, S as SavedAttachments, D as SlashCommand, G as SteerIntent, T as TextExcerpt, H as askUserOutputKept, J as askUserWith, K as attachmentFileName, L as attachmentKindOf, O as attachmentLabel, R as attachmentOverLimit, U as attachmentRefusal, V as attachmentTransformOf, W as boxLength, X as createElicitationQueue, Y as createQuestionQueue, Z as dataUrlParts, _ as defaultLabels, $ as defaultNoticeTexts, a0 as elicitationConnectOptions, a1 as elicitationFields, a2 as elicitationFormAnswer, a3 as elicitationInitialDraft, a4 as elicitationLink, a5 as elicitationSettings, a6 as elicitationTimeoutOf, a7 as excerptNote, a8 as fileKindOf, a9 as fileNameOf, aa as filterCommands, ab as formatClock, ac as formatCountdown, ad as formatElapsed, ae as freeAttachmentPath, af as inputCounterShown, ag as insertionFits, ah as isOneCharacter, ai as lineCountOf, aj as longTextName, ak as longTextRoute, al as menuKeyTarget, am as menuSections, an as mergeLabels, ao as messageOverLimit, ap as micProblemText, aq as noticesOf, ar as overflowOf, as as parseSlash, at as questionChoiceOf, au as questionOtherOf, av as questionTimeoutOf, aw as saveAttachments, ax as steerIntent, ay as textExcerpt, az as voiceMessageName, aA as withAttachments, aB as withoutOwnWords } from './labels-D5BrHct4.cjs';
2
+ import { A as AgentUiState, C as ChatAttachment, R as RemoteRunView, L as LessonView, a as ChatMessage, b as ApprovalView, S as SubagentView, i as SubagentNode } from './types-DnBCok3z.cjs';
3
+ export { h as AgentStatus, j as AppView, B as BrowserOAuthProvider, k as BrowserOAuthProviderOptions, l as BudgetView, m as CompactionView, n as ConnectedMcp, D as DecisionView, E as ElicitationView, F as FetchView, o as McpAppsConnectionLike, p as McpCatalogEntry, M as McpElicitationFieldSchema, c as McpElicitationHandler, f as McpElicitationOptions, d as McpElicitationRequest, e as McpElicitationResult, g as McpElicitationSchema, q as McpHttpServerConfig, r as McpModule, s as McpOAuthCallback, t as McpOAuthRegistration, u as McpOAuthRegistrationKind, v as McpProtocolMode, w as McpServerInstructions, x as McpServerProtocol, y as McpServerResult, z as MediaView, G as ModelLoadState, Q as QuestionView, H as QueuedMessageView, I as ReplanState, J as SkillConsentView, K as StepEscalationView, N as StepView, T as ToolCallView, O as TranscriptView, U as UserNoteView, W as WrittenFileView } from './types-DnBCok3z.cjs';
4
+ export { a as ATTACHMENT_BOUNDS, b as AgentLabels, A as AgentLabelsOverride, c as AttachmentBounds, d as AttachmentFiles, e as AttachmentOverLimit, f as AttachmentTextOptions, g as AttachmentTransform, C as ComposerAttachment, h as ComposerNotice, E as ELICITATION_MAX_OPTIONS, i as ELICITATION_TIMEOUT_MS, j as ELICITATION_VALUE_MAX_CHARS, k as ElicitationControl, l as ElicitationDraft, m as ElicitationDraftValue, n as ElicitationField, o as ElicitationFormOutcome, p as ElicitationIssue, q as ElicitationIssueKind, r as ElicitationLink, s as ElicitationOption, t as ElicitationOutcomeReason, u as ElicitationQueue, v as ElicitationQueueOptions, F as FileKind, I as INPUT_COUNTER_FROM, M as MenuSection, N as NotReadyInput, w as NotReadyIntent, x as NotReadyReason, y as NoticeTexts, P as PendingElicitation, S as SavedAttachments, z as SlashCommand, B as SteerIntent, T as TextExcerpt, W as WaitingSendStep, D as attachmentFileName, G as attachmentKindOf, H as attachmentLabel, J as attachmentOverLimit, K as attachmentRefusal, L as attachmentTransformOf, O as boxLength, Q as createElicitationQueue, R as dataUrlParts, U as defaultLabels, V as defaultNoticeTexts, X as elicitationConnectOptions, Y as elicitationFields, Z as elicitationFormAnswer, _ as elicitationInitialDraft, $ as elicitationLink, a0 as elicitationSettings, a1 as elicitationTimeoutOf, a2 as excerptNote, a3 as fileKindOf, a4 as fileNameOf, a5 as filterCommands, a6 as formatClock, a7 as formatCountdown, a8 as formatElapsed, a9 as freeAttachmentPath, aa as inputCounterShown, ab as insertionFits, ac as isOneCharacter, ad as lineCountOf, ae as longTextName, af as longTextRoute, ag as menuKeyTarget, ah as menuSections, ai as mergeLabels, aj as messageOverLimit, ak as micProblemText, al as notReadyIntent, am as notReadyReason, an as noticesOf, ao as overflowOf, ap as parseSlash, aq as saveAttachments, ar as steerIntent, as as textExcerpt, at as voiceMessageName, au as waitingSendStep, av as withAttachments } from './labels-CmiTBLWD.cjs';
5
+ export { A as ASK_USER_TOOL_NAME, P as PendingQuestion, a as QUESTION_TIMEOUT_MS, Q as QuestionOutcomeReason, b as QuestionQueue, c as QuestionQueueOptions, d as askUserOutputKept, e as askUserWith, f as createQuestionQueue, q as questionChoiceOf, g as questionOtherOf, h as questionTimeoutOf, w as withoutOwnWords } from './questions-Dw--IEjT.cjs';
6
+ import './mcp-app.cjs';
5
7
  import './mcp-app-policy-DXKQ2jjM.cjs';
6
8
 
7
9
  /**
@@ -224,6 +226,82 @@ declare const followsAfterScroll: (following: boolean, before: ScrollMeasure, no
224
226
  */
225
227
  declare const followsAfterResize: (following: boolean, before: ScrollMeasure, now: ScrollMeasure) => boolean;
226
228
 
229
+ /**
230
+ * Where a component lives: in the document, or in a shadow root (a web component's). The chat
231
+ * reads the focus, the element under a point and the target of an event; seen from the DOCUMENT,
232
+ * everything inside a shadow root is its HOST - `document.activeElement` is the host, a click
233
+ * inside comes from the host, `document.elementFromPoint` over a button finds the host. These
234
+ * helpers ask the component's own root instead, and look through open shadow roots where the
235
+ * question is about the whole page (what is on top at a point).
236
+ *
237
+ * In the light DOM every helper answers exactly what the `document` call it replaces did: the
238
+ * root is the document, nothing is retargeted, no shadow root is crossed.
239
+ *
240
+ * No framework, no DOM UI: they read the DOM and make nothing. Structural types (`nodeType`,
241
+ * `host`), so they run - and are tested - without a DOM.
242
+ */
243
+ /** A shadow root: a document fragment with a host. */
244
+ declare const isShadowRoot: (node: unknown) => node is ShadowRoot;
245
+ /**
246
+ * The root `node` lives in: its shadow root, else its document. A node that is not in a document
247
+ * yet (or any more) answers its owner document - never the detached subtree it hangs in.
248
+ */
249
+ declare const rootOf: (node: Node) => Document | ShadowRoot;
250
+ /**
251
+ * What has the focus, as seen from `at`'s root (or from that root itself): in a shadow root the
252
+ * focused element of that tree (a nested component's host when the focus is deeper), `null`
253
+ * when the focus is outside it; in the document, `document.activeElement`.
254
+ */
255
+ declare const activeElementOf: (at: Node | Document | ShadowRoot) => Element | null;
256
+ /**
257
+ * The element that really has the focus: from `root`'s active element down through every open
258
+ * shadow root it is the host of. In the light DOM, `document.activeElement`.
259
+ */
260
+ declare const deepActiveElement: (root: Document | ShadowRoot) => Element | null;
261
+ /** Nothing on the page has the focus: the document's active element is none or its body. */
262
+ declare const nothingFocused: (doc: Document) => boolean;
263
+ /**
264
+ * `ancestor` contains `node` across shadow boundaries: up from `node` through its parents and,
265
+ * at a shadow root, on to its host. In one tree, `ancestor.contains(node)`.
266
+ */
267
+ declare const composedContains: (ancestor: Node, node: Node | null | undefined) => boolean;
268
+ /**
269
+ * Where an event really began: the innermost target of its path (inside an open shadow root),
270
+ * else `event.target`. A listener on the document sees the host as the target of an event from
271
+ * inside a shadow root; this is the element itself. Only while the event is dispatched.
272
+ */
273
+ declare const eventTargetOf: (event: Event) => EventTarget | null;
274
+ /**
275
+ * The event began inside `node`. In one tree (the target not retargeted), `node.contains(target)`
276
+ * - exactly what a listener on the document asked before. From inside a shadow root (the
277
+ * document sees the host as the target), whether `node` is on the event's composed path.
278
+ * Only while the event is dispatched.
279
+ */
280
+ declare const isEventInside: (event: Event, node: Node | null | undefined) => boolean;
281
+ /**
282
+ * The element on top at a point of the viewport, looked for on the whole page: the document's
283
+ * answer, then down through each open shadow root it is the host of. In the light DOM,
284
+ * `document.elementFromPoint(x, y)`. A closed shadow root stays its host.
285
+ */
286
+ declare const deepElementFromPoint: (doc: Document, x: number, y: number) => Element | null;
287
+ /**
288
+ * The shadow roots `node` is inside, innermost first; none in the light DOM. Events that do not
289
+ * leave a shadow tree (`scroll`) are heard on these as well as on the window.
290
+ */
291
+ declare const shadowRootsAround: (node: Node) => ShadowRoot[];
292
+ /**
293
+ * Listens for `scroll` anywhere around `node` (capture: any scroller), on the window and on every
294
+ * shadow root `node` is inside - a scroll inside a shadow tree never reaches the window. In the
295
+ * light DOM, `window.addEventListener('scroll', listener, true)`. Returns the way to stop.
296
+ */
297
+ declare const listenScrollAround: (node: Node, listener: (event: Event) => void) => (() => void);
298
+ /**
299
+ * Where a dialog opened from `from` is mounted so that the chat's theme applies: the nearest
300
+ * ancestor matching `selector` (`.awr-chat, .awr-theme`), else the shadow root `from` lives in
301
+ * (styles adopted there apply), else the document's body - what it was before.
302
+ */
303
+ declare const portalHostOf: (from: Element, selector: string) => Element | ShadowRoot;
304
+
227
305
  /**
228
306
  * Downscale an image in the browser before it goes to a model. Providers bill
229
307
  * images by their pixel size and resize anything over ~1.15 MP / 1568 px on
@@ -915,5 +993,5 @@ interface AudioSpeakerOptions {
915
993
  */
916
994
  declare const createAudioSpeaker: (options: AudioSpeakerOptions) => SpeakText;
917
995
 
918
- export { AgentUiState, ApprovalView, ChatAttachment, ChatHistoryStore, ChatMessage, FOLLOW_LEAVE_PX, FOLLOW_REJOIN_PX, FRAME_MAX_HEIGHT, FRAME_MIN_HEIGHT, HTML_PREVIEW_MAX_CHARS, LessonView, MicError, NAMED_FILES_MAX, NAMED_FILES_SCAN_MAX, NAMED_FILES_TEXT_MAX, PROMPT_ARM_MS, RECORDING_DEFAULT_MAX_MS, RECORDING_TYPES, RemoteRunView, SpeechOutputError, SubagentNode, SubagentView, agentStateReducer, agentStatusOf, attachmentsText, audioExtensionOf, audioTypeOf, buildSandboxedDocument, chatTitle, clampFrameHeight, coalesce, createApprovalQueue, createAudioSpeaker, createBrowserSpeaker, createInitialAgentState, createPromptArming, createRecordingRecognizer, cspMetaTag, downscaleImage, endGap, errMessage, escapeAttribute, followOtherTabs, followsAfterResize, followsAfterScroll, formatDuration, formatProbability, formatTokens, imageSizeOf, imagesInOutput, languageOfText, lessonsOf, linkedFilesOf, listenToOtherTabs, mergeChatRecord, micProblemOf, namedFilesOf, newChatId, ownUnsaved, pathsNamedIn, pendingApprovalsOf, pickRecordingType, previewValue, recordingSupported, remoteAnswerOf, sandboxTokens, sandboxedCsp, saveChat, scriptOfLanguage, scriptOfText, speakableText, speechSynthesisSupported, splitForSpeech, startRecording, stopTracks, subagentTree, tokenizeHtml, unchangedSince, voiceFor, voicesOf, webSearchOf, withCspFirst, withPolicyFirst, workspacePathOf };
996
+ export { AgentUiState, ApprovalView, ChatAttachment, ChatHistoryStore, ChatMessage, FOLLOW_LEAVE_PX, FOLLOW_REJOIN_PX, FRAME_MAX_HEIGHT, FRAME_MIN_HEIGHT, HTML_PREVIEW_MAX_CHARS, LessonView, MicError, NAMED_FILES_MAX, NAMED_FILES_SCAN_MAX, NAMED_FILES_TEXT_MAX, PROMPT_ARM_MS, RECORDING_DEFAULT_MAX_MS, RECORDING_TYPES, RemoteRunView, SpeechOutputError, SubagentNode, SubagentView, activeElementOf, agentStateReducer, agentStatusOf, attachmentsText, audioExtensionOf, audioTypeOf, buildSandboxedDocument, chatTitle, clampFrameHeight, coalesce, composedContains, createApprovalQueue, createAudioSpeaker, createBrowserSpeaker, createInitialAgentState, createPromptArming, createRecordingRecognizer, cspMetaTag, deepActiveElement, deepElementFromPoint, downscaleImage, endGap, errMessage, escapeAttribute, eventTargetOf, followOtherTabs, followsAfterResize, followsAfterScroll, formatDuration, formatProbability, formatTokens, imageSizeOf, imagesInOutput, isEventInside, isShadowRoot, languageOfText, lessonsOf, linkedFilesOf, listenScrollAround, listenToOtherTabs, mergeChatRecord, micProblemOf, namedFilesOf, newChatId, nothingFocused, ownUnsaved, pathsNamedIn, pendingApprovalsOf, pickRecordingType, portalHostOf, previewValue, recordingSupported, remoteAnswerOf, rootOf, sandboxTokens, sandboxedCsp, saveChat, scriptOfLanguage, scriptOfText, shadowRootsAround, speakableText, speechSynthesisSupported, splitForSpeech, startRecording, stopTracks, subagentTree, tokenizeHtml, unchangedSince, voiceFor, voicesOf, webSearchOf, withCspFirst, withPolicyFirst, workspacePathOf };
919
997
  export type { AgentAction, ApprovalQueue, AttachmentTexts, AudioLike, AudioSpeakerOptions, BrowserSpeakerOptions, ChatBase, ChatHistoryStoreOptions, ChatRecord, ChatSummary, DownscaleOptions, ImageSize, MediaRecorderConstructorLike, MediaRecorderLike, MicProblem, NamedFilesOptions, PromptArming, ReadAloudState, RecordedAudio, Recording, RecordingDeps, RecordingRecognizerOptions, SandboxedDocumentOptions, ScrollMeasure, SourceToken, SpeakText, SpeakableOptions, SpeechPlayback, SpeechRecognizerLike, SpeechScript, SpeechSynthesisLike, SpeechUtteranceLike, SpeechVoiceLike, StartRecordingOptions, SynthesizeSpeech, TranscribeAudio, WebSearchResultView, WebSearchView };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { AgentEvent, IUsage, Skill, ToolApprovalRequest, ToolApprovalContext, ToolApprovalDecision } from '@dudko.dev/agent-web';
2
- import { A as AgentUiState, C as ChatAttachment, R as RemoteRunView, L as LessonView, h as ChatMessage, i as ApprovalView, S as SubagentView, j as SubagentNode } from './mcp-app-entry-BA-Ca39z.js';
3
- export { f as AgentStatus, k as AppView, B as BrowserOAuthProvider, l as BrowserOAuthProviderOptions, m as BudgetView, n as CompactionView, o as ConnectedMcp, D as DecisionView, E as ElicitationView, F as FetchView, p as McpAppsConnectionLike, q as McpCatalogEntry, M as McpElicitationFieldSchema, a as McpElicitationHandler, d as McpElicitationOptions, b as McpElicitationRequest, c as McpElicitationResult, e as McpElicitationSchema, r as McpHttpServerConfig, s as McpModule, t as McpOAuthCallback, u as McpOAuthRegistration, v as McpOAuthRegistrationKind, w as McpProtocolMode, x as McpServerInstructions, y as McpServerProtocol, z as McpServerResult, G as MediaView, H as ModelLoadState, Q as QuestionView, I as QueuedMessageView, J as ReplanState, K as SkillConsentView, N as StepEscalationView, O as StepView, T as ToolCallView, P as TranscriptView, U as UserNoteView, W as WrittenFileView } from './mcp-app-entry-BA-Ca39z.js';
4
- export { a as ASK_USER_TOOL_NAME, b as ATTACHMENT_BOUNDS, c as AgentLabels, A as AgentLabelsOverride, d as AttachmentBounds, e as AttachmentFiles, f as AttachmentOverLimit, g as AttachmentTextOptions, h as AttachmentTransform, C as ComposerAttachment, i as ComposerNotice, E as ELICITATION_MAX_OPTIONS, j as ELICITATION_TIMEOUT_MS, k as ELICITATION_VALUE_MAX_CHARS, l as ElicitationControl, m as ElicitationDraft, n as ElicitationDraftValue, o as ElicitationField, p as ElicitationFormOutcome, q as ElicitationIssue, r as ElicitationIssueKind, s as ElicitationLink, t as ElicitationOption, u as ElicitationOutcomeReason, v as ElicitationQueue, w as ElicitationQueueOptions, F as FileKind, I as INPUT_COUNTER_FROM, M as MenuSection, N as NoticeTexts, P as PendingElicitation, x as PendingQuestion, Q as QUESTION_TIMEOUT_MS, y as QuestionOutcomeReason, z as QuestionQueue, B as QuestionQueueOptions, S as SavedAttachments, D as SlashCommand, G as SteerIntent, T as TextExcerpt, H as askUserOutputKept, J as askUserWith, K as attachmentFileName, L as attachmentKindOf, O as attachmentLabel, R as attachmentOverLimit, U as attachmentRefusal, V as attachmentTransformOf, W as boxLength, X as createElicitationQueue, Y as createQuestionQueue, Z as dataUrlParts, _ as defaultLabels, $ as defaultNoticeTexts, a0 as elicitationConnectOptions, a1 as elicitationFields, a2 as elicitationFormAnswer, a3 as elicitationInitialDraft, a4 as elicitationLink, a5 as elicitationSettings, a6 as elicitationTimeoutOf, a7 as excerptNote, a8 as fileKindOf, a9 as fileNameOf, aa as filterCommands, ab as formatClock, ac as formatCountdown, ad as formatElapsed, ae as freeAttachmentPath, af as inputCounterShown, ag as insertionFits, ah as isOneCharacter, ai as lineCountOf, aj as longTextName, ak as longTextRoute, al as menuKeyTarget, am as menuSections, an as mergeLabels, ao as messageOverLimit, ap as micProblemText, aq as noticesOf, ar as overflowOf, as as parseSlash, at as questionChoiceOf, au as questionOtherOf, av as questionTimeoutOf, aw as saveAttachments, ax as steerIntent, ay as textExcerpt, az as voiceMessageName, aA as withAttachments, aB as withoutOwnWords } from './labels-UuWI7wPo.js';
2
+ import { A as AgentUiState, C as ChatAttachment, R as RemoteRunView, L as LessonView, a as ChatMessage, b as ApprovalView, S as SubagentView, i as SubagentNode } from './types-DnBCok3z.js';
3
+ export { h as AgentStatus, j as AppView, B as BrowserOAuthProvider, k as BrowserOAuthProviderOptions, l as BudgetView, m as CompactionView, n as ConnectedMcp, D as DecisionView, E as ElicitationView, F as FetchView, o as McpAppsConnectionLike, p as McpCatalogEntry, M as McpElicitationFieldSchema, c as McpElicitationHandler, f as McpElicitationOptions, d as McpElicitationRequest, e as McpElicitationResult, g as McpElicitationSchema, q as McpHttpServerConfig, r as McpModule, s as McpOAuthCallback, t as McpOAuthRegistration, u as McpOAuthRegistrationKind, v as McpProtocolMode, w as McpServerInstructions, x as McpServerProtocol, y as McpServerResult, z as MediaView, G as ModelLoadState, Q as QuestionView, H as QueuedMessageView, I as ReplanState, J as SkillConsentView, K as StepEscalationView, N as StepView, T as ToolCallView, O as TranscriptView, U as UserNoteView, W as WrittenFileView } from './types-DnBCok3z.js';
4
+ export { a as ATTACHMENT_BOUNDS, b as AgentLabels, A as AgentLabelsOverride, c as AttachmentBounds, d as AttachmentFiles, e as AttachmentOverLimit, f as AttachmentTextOptions, g as AttachmentTransform, C as ComposerAttachment, h as ComposerNotice, E as ELICITATION_MAX_OPTIONS, i as ELICITATION_TIMEOUT_MS, j as ELICITATION_VALUE_MAX_CHARS, k as ElicitationControl, l as ElicitationDraft, m as ElicitationDraftValue, n as ElicitationField, o as ElicitationFormOutcome, p as ElicitationIssue, q as ElicitationIssueKind, r as ElicitationLink, s as ElicitationOption, t as ElicitationOutcomeReason, u as ElicitationQueue, v as ElicitationQueueOptions, F as FileKind, I as INPUT_COUNTER_FROM, M as MenuSection, N as NotReadyInput, w as NotReadyIntent, x as NotReadyReason, y as NoticeTexts, P as PendingElicitation, S as SavedAttachments, z as SlashCommand, B as SteerIntent, T as TextExcerpt, W as WaitingSendStep, D as attachmentFileName, G as attachmentKindOf, H as attachmentLabel, J as attachmentOverLimit, K as attachmentRefusal, L as attachmentTransformOf, O as boxLength, Q as createElicitationQueue, R as dataUrlParts, U as defaultLabels, V as defaultNoticeTexts, X as elicitationConnectOptions, Y as elicitationFields, Z as elicitationFormAnswer, _ as elicitationInitialDraft, $ as elicitationLink, a0 as elicitationSettings, a1 as elicitationTimeoutOf, a2 as excerptNote, a3 as fileKindOf, a4 as fileNameOf, a5 as filterCommands, a6 as formatClock, a7 as formatCountdown, a8 as formatElapsed, a9 as freeAttachmentPath, aa as inputCounterShown, ab as insertionFits, ac as isOneCharacter, ad as lineCountOf, ae as longTextName, af as longTextRoute, ag as menuKeyTarget, ah as menuSections, ai as mergeLabels, aj as messageOverLimit, ak as micProblemText, al as notReadyIntent, am as notReadyReason, an as noticesOf, ao as overflowOf, ap as parseSlash, aq as saveAttachments, ar as steerIntent, as as textExcerpt, at as voiceMessageName, au as waitingSendStep, av as withAttachments } from './labels-DH1ESUtm.js';
5
+ export { A as ASK_USER_TOOL_NAME, P as PendingQuestion, a as QUESTION_TIMEOUT_MS, Q as QuestionOutcomeReason, b as QuestionQueue, c as QuestionQueueOptions, d as askUserOutputKept, e as askUserWith, f as createQuestionQueue, q as questionChoiceOf, g as questionOtherOf, h as questionTimeoutOf, w as withoutOwnWords } from './questions-Dw--IEjT.js';
6
+ import './mcp-app.js';
5
7
  import './mcp-app-policy-DXKQ2jjM.js';
6
8
 
7
9
  /**
@@ -224,6 +226,82 @@ declare const followsAfterScroll: (following: boolean, before: ScrollMeasure, no
224
226
  */
225
227
  declare const followsAfterResize: (following: boolean, before: ScrollMeasure, now: ScrollMeasure) => boolean;
226
228
 
229
+ /**
230
+ * Where a component lives: in the document, or in a shadow root (a web component's). The chat
231
+ * reads the focus, the element under a point and the target of an event; seen from the DOCUMENT,
232
+ * everything inside a shadow root is its HOST - `document.activeElement` is the host, a click
233
+ * inside comes from the host, `document.elementFromPoint` over a button finds the host. These
234
+ * helpers ask the component's own root instead, and look through open shadow roots where the
235
+ * question is about the whole page (what is on top at a point).
236
+ *
237
+ * In the light DOM every helper answers exactly what the `document` call it replaces did: the
238
+ * root is the document, nothing is retargeted, no shadow root is crossed.
239
+ *
240
+ * No framework, no DOM UI: they read the DOM and make nothing. Structural types (`nodeType`,
241
+ * `host`), so they run - and are tested - without a DOM.
242
+ */
243
+ /** A shadow root: a document fragment with a host. */
244
+ declare const isShadowRoot: (node: unknown) => node is ShadowRoot;
245
+ /**
246
+ * The root `node` lives in: its shadow root, else its document. A node that is not in a document
247
+ * yet (or any more) answers its owner document - never the detached subtree it hangs in.
248
+ */
249
+ declare const rootOf: (node: Node) => Document | ShadowRoot;
250
+ /**
251
+ * What has the focus, as seen from `at`'s root (or from that root itself): in a shadow root the
252
+ * focused element of that tree (a nested component's host when the focus is deeper), `null`
253
+ * when the focus is outside it; in the document, `document.activeElement`.
254
+ */
255
+ declare const activeElementOf: (at: Node | Document | ShadowRoot) => Element | null;
256
+ /**
257
+ * The element that really has the focus: from `root`'s active element down through every open
258
+ * shadow root it is the host of. In the light DOM, `document.activeElement`.
259
+ */
260
+ declare const deepActiveElement: (root: Document | ShadowRoot) => Element | null;
261
+ /** Nothing on the page has the focus: the document's active element is none or its body. */
262
+ declare const nothingFocused: (doc: Document) => boolean;
263
+ /**
264
+ * `ancestor` contains `node` across shadow boundaries: up from `node` through its parents and,
265
+ * at a shadow root, on to its host. In one tree, `ancestor.contains(node)`.
266
+ */
267
+ declare const composedContains: (ancestor: Node, node: Node | null | undefined) => boolean;
268
+ /**
269
+ * Where an event really began: the innermost target of its path (inside an open shadow root),
270
+ * else `event.target`. A listener on the document sees the host as the target of an event from
271
+ * inside a shadow root; this is the element itself. Only while the event is dispatched.
272
+ */
273
+ declare const eventTargetOf: (event: Event) => EventTarget | null;
274
+ /**
275
+ * The event began inside `node`. In one tree (the target not retargeted), `node.contains(target)`
276
+ * - exactly what a listener on the document asked before. From inside a shadow root (the
277
+ * document sees the host as the target), whether `node` is on the event's composed path.
278
+ * Only while the event is dispatched.
279
+ */
280
+ declare const isEventInside: (event: Event, node: Node | null | undefined) => boolean;
281
+ /**
282
+ * The element on top at a point of the viewport, looked for on the whole page: the document's
283
+ * answer, then down through each open shadow root it is the host of. In the light DOM,
284
+ * `document.elementFromPoint(x, y)`. A closed shadow root stays its host.
285
+ */
286
+ declare const deepElementFromPoint: (doc: Document, x: number, y: number) => Element | null;
287
+ /**
288
+ * The shadow roots `node` is inside, innermost first; none in the light DOM. Events that do not
289
+ * leave a shadow tree (`scroll`) are heard on these as well as on the window.
290
+ */
291
+ declare const shadowRootsAround: (node: Node) => ShadowRoot[];
292
+ /**
293
+ * Listens for `scroll` anywhere around `node` (capture: any scroller), on the window and on every
294
+ * shadow root `node` is inside - a scroll inside a shadow tree never reaches the window. In the
295
+ * light DOM, `window.addEventListener('scroll', listener, true)`. Returns the way to stop.
296
+ */
297
+ declare const listenScrollAround: (node: Node, listener: (event: Event) => void) => (() => void);
298
+ /**
299
+ * Where a dialog opened from `from` is mounted so that the chat's theme applies: the nearest
300
+ * ancestor matching `selector` (`.awr-chat, .awr-theme`), else the shadow root `from` lives in
301
+ * (styles adopted there apply), else the document's body - what it was before.
302
+ */
303
+ declare const portalHostOf: (from: Element, selector: string) => Element | ShadowRoot;
304
+
227
305
  /**
228
306
  * Downscale an image in the browser before it goes to a model. Providers bill
229
307
  * images by their pixel size and resize anything over ~1.15 MP / 1568 px on
@@ -915,5 +993,5 @@ interface AudioSpeakerOptions {
915
993
  */
916
994
  declare const createAudioSpeaker: (options: AudioSpeakerOptions) => SpeakText;
917
995
 
918
- export { AgentUiState, ApprovalView, ChatAttachment, ChatHistoryStore, ChatMessage, FOLLOW_LEAVE_PX, FOLLOW_REJOIN_PX, FRAME_MAX_HEIGHT, FRAME_MIN_HEIGHT, HTML_PREVIEW_MAX_CHARS, LessonView, MicError, NAMED_FILES_MAX, NAMED_FILES_SCAN_MAX, NAMED_FILES_TEXT_MAX, PROMPT_ARM_MS, RECORDING_DEFAULT_MAX_MS, RECORDING_TYPES, RemoteRunView, SpeechOutputError, SubagentNode, SubagentView, agentStateReducer, agentStatusOf, attachmentsText, audioExtensionOf, audioTypeOf, buildSandboxedDocument, chatTitle, clampFrameHeight, coalesce, createApprovalQueue, createAudioSpeaker, createBrowserSpeaker, createInitialAgentState, createPromptArming, createRecordingRecognizer, cspMetaTag, downscaleImage, endGap, errMessage, escapeAttribute, followOtherTabs, followsAfterResize, followsAfterScroll, formatDuration, formatProbability, formatTokens, imageSizeOf, imagesInOutput, languageOfText, lessonsOf, linkedFilesOf, listenToOtherTabs, mergeChatRecord, micProblemOf, namedFilesOf, newChatId, ownUnsaved, pathsNamedIn, pendingApprovalsOf, pickRecordingType, previewValue, recordingSupported, remoteAnswerOf, sandboxTokens, sandboxedCsp, saveChat, scriptOfLanguage, scriptOfText, speakableText, speechSynthesisSupported, splitForSpeech, startRecording, stopTracks, subagentTree, tokenizeHtml, unchangedSince, voiceFor, voicesOf, webSearchOf, withCspFirst, withPolicyFirst, workspacePathOf };
996
+ export { AgentUiState, ApprovalView, ChatAttachment, ChatHistoryStore, ChatMessage, FOLLOW_LEAVE_PX, FOLLOW_REJOIN_PX, FRAME_MAX_HEIGHT, FRAME_MIN_HEIGHT, HTML_PREVIEW_MAX_CHARS, LessonView, MicError, NAMED_FILES_MAX, NAMED_FILES_SCAN_MAX, NAMED_FILES_TEXT_MAX, PROMPT_ARM_MS, RECORDING_DEFAULT_MAX_MS, RECORDING_TYPES, RemoteRunView, SpeechOutputError, SubagentNode, SubagentView, activeElementOf, agentStateReducer, agentStatusOf, attachmentsText, audioExtensionOf, audioTypeOf, buildSandboxedDocument, chatTitle, clampFrameHeight, coalesce, composedContains, createApprovalQueue, createAudioSpeaker, createBrowserSpeaker, createInitialAgentState, createPromptArming, createRecordingRecognizer, cspMetaTag, deepActiveElement, deepElementFromPoint, downscaleImage, endGap, errMessage, escapeAttribute, eventTargetOf, followOtherTabs, followsAfterResize, followsAfterScroll, formatDuration, formatProbability, formatTokens, imageSizeOf, imagesInOutput, isEventInside, isShadowRoot, languageOfText, lessonsOf, linkedFilesOf, listenScrollAround, listenToOtherTabs, mergeChatRecord, micProblemOf, namedFilesOf, newChatId, nothingFocused, ownUnsaved, pathsNamedIn, pendingApprovalsOf, pickRecordingType, portalHostOf, previewValue, recordingSupported, remoteAnswerOf, rootOf, sandboxTokens, sandboxedCsp, saveChat, scriptOfLanguage, scriptOfText, shadowRootsAround, speakableText, speechSynthesisSupported, splitForSpeech, startRecording, stopTracks, subagentTree, tokenizeHtml, unchangedSince, voiceFor, voicesOf, webSearchOf, withCspFirst, withPolicyFirst, workspacePathOf };
919
997
  export type { AgentAction, ApprovalQueue, AttachmentTexts, AudioLike, AudioSpeakerOptions, BrowserSpeakerOptions, ChatBase, ChatHistoryStoreOptions, ChatRecord, ChatSummary, DownscaleOptions, ImageSize, MediaRecorderConstructorLike, MediaRecorderLike, MicProblem, NamedFilesOptions, PromptArming, ReadAloudState, RecordedAudio, Recording, RecordingDeps, RecordingRecognizerOptions, SandboxedDocumentOptions, ScrollMeasure, SourceToken, SpeakText, SpeakableOptions, SpeechPlayback, SpeechRecognizerLike, SpeechScript, SpeechSynthesisLike, SpeechUtteranceLike, SpeechVoiceLike, StartRecordingOptions, SynthesizeSpeech, TranscribeAudio, WebSearchResultView, WebSearchView };