agent-web-interface 4.3.0 → 4.4.0

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 (251) hide show
  1. package/dist/src/browser/connection-utils.d.ts +48 -0
  2. package/dist/src/browser/connection-utils.d.ts.map +1 -0
  3. package/dist/src/browser/connection-utils.js +129 -0
  4. package/dist/src/browser/connection-utils.js.map +1 -0
  5. package/dist/src/browser/index.d.ts +3 -1
  6. package/dist/src/browser/index.d.ts.map +1 -1
  7. package/dist/src/browser/index.js +2 -1
  8. package/dist/src/browser/index.js.map +1 -1
  9. package/dist/src/browser/session-manager.d.ts +1 -89
  10. package/dist/src/browser/session-manager.d.ts.map +1 -1
  11. package/dist/src/browser/session-manager.js +1 -116
  12. package/dist/src/browser/session-manager.js.map +1 -1
  13. package/dist/src/browser/session-manager.types.d.ts +90 -0
  14. package/dist/src/browser/session-manager.types.d.ts.map +1 -0
  15. package/dist/src/browser/session-manager.types.js +7 -0
  16. package/dist/src/browser/session-manager.types.js.map +1 -0
  17. package/dist/src/form/constraint-extraction.d.ts +31 -0
  18. package/dist/src/form/constraint-extraction.d.ts.map +1 -0
  19. package/dist/src/form/constraint-extraction.js +110 -0
  20. package/dist/src/form/constraint-extraction.js.map +1 -0
  21. package/dist/src/form/field-extractor.d.ts.map +1 -1
  22. package/dist/src/form/field-extractor.js +3 -444
  23. package/dist/src/form/field-extractor.js.map +1 -1
  24. package/dist/src/form/field-state-extractor.d.ts +22 -0
  25. package/dist/src/form/field-state-extractor.d.ts.map +1 -0
  26. package/dist/src/form/field-state-extractor.js +55 -0
  27. package/dist/src/form/field-state-extractor.js.map +1 -0
  28. package/dist/src/form/form-actions.d.ts +45 -0
  29. package/dist/src/form/form-actions.d.ts.map +1 -0
  30. package/dist/src/form/form-actions.js +108 -0
  31. package/dist/src/form/form-actions.js.map +1 -0
  32. package/dist/src/form/form-detector.d.ts +0 -36
  33. package/dist/src/form/form-detector.d.ts.map +1 -1
  34. package/dist/src/form/form-detector.js +11 -376
  35. package/dist/src/form/form-detector.js.map +1 -1
  36. package/dist/src/form/input-clustering.d.ts +15 -0
  37. package/dist/src/form/input-clustering.d.ts.map +1 -0
  38. package/dist/src/form/input-clustering.js +61 -0
  39. package/dist/src/form/input-clustering.js.map +1 -0
  40. package/dist/src/form/intent-inference.d.ts +28 -0
  41. package/dist/src/form/intent-inference.d.ts.map +1 -0
  42. package/dist/src/form/intent-inference.js +137 -0
  43. package/dist/src/form/intent-inference.js.map +1 -0
  44. package/dist/src/form/purpose-inference.d.ts +50 -0
  45. package/dist/src/form/purpose-inference.d.ts.map +1 -0
  46. package/dist/src/form/purpose-inference.js +313 -0
  47. package/dist/src/form/purpose-inference.js.map +1 -0
  48. package/dist/src/form/submit-detection.d.ts +36 -0
  49. package/dist/src/form/submit-detection.d.ts.map +1 -0
  50. package/dist/src/form/submit-detection.js +101 -0
  51. package/dist/src/form/submit-detection.js.map +1 -0
  52. package/dist/src/form/types.d.ts +2 -2
  53. package/dist/src/index.js +52 -47
  54. package/dist/src/index.js.map +1 -1
  55. package/dist/src/observation/observation-accumulator.d.ts +1 -1
  56. package/dist/src/observation/observation-accumulator.js +1 -1
  57. package/dist/src/observation/observer-script.d.ts +1 -1
  58. package/dist/src/observation/observer-script.d.ts.map +1 -1
  59. package/dist/src/observation/observer-script.js +129 -7
  60. package/dist/src/observation/observer-script.js.map +1 -1
  61. package/dist/src/query/disambiguation.d.ts +18 -0
  62. package/dist/src/query/disambiguation.d.ts.map +1 -0
  63. package/dist/src/query/disambiguation.js +123 -0
  64. package/dist/src/query/disambiguation.js.map +1 -0
  65. package/dist/src/query/fuzzy-match.d.ts +17 -0
  66. package/dist/src/query/fuzzy-match.d.ts.map +1 -0
  67. package/dist/src/query/fuzzy-match.js +34 -0
  68. package/dist/src/query/fuzzy-match.js.map +1 -0
  69. package/dist/src/query/index.d.ts +3 -0
  70. package/dist/src/query/index.d.ts.map +1 -1
  71. package/dist/src/query/index.js +6 -0
  72. package/dist/src/query/index.js.map +1 -1
  73. package/dist/src/query/query-engine.d.ts +0 -35
  74. package/dist/src/query/query-engine.d.ts.map +1 -1
  75. package/dist/src/query/query-engine.js +9 -309
  76. package/dist/src/query/query-engine.js.map +1 -1
  77. package/dist/src/query/scoring.d.ts +52 -0
  78. package/dist/src/query/scoring.d.ts.map +1 -0
  79. package/dist/src/query/scoring.js +162 -0
  80. package/dist/src/query/scoring.js.map +1 -0
  81. package/dist/src/snapshot/element-resolver.d.ts +24 -13
  82. package/dist/src/snapshot/element-resolver.d.ts.map +1 -1
  83. package/dist/src/snapshot/element-resolver.js +117 -87
  84. package/dist/src/snapshot/element-resolver.js.map +1 -1
  85. package/dist/src/snapshot/extractors/ax-extractor.d.ts +1 -1
  86. package/dist/src/snapshot/extractors/ax-extractor.d.ts.map +1 -1
  87. package/dist/src/snapshot/extractors/ax-extractor.js +4 -1
  88. package/dist/src/snapshot/extractors/ax-extractor.js.map +1 -1
  89. package/dist/src/snapshot/extractors/index.d.ts +1 -1
  90. package/dist/src/snapshot/extractors/index.d.ts.map +1 -1
  91. package/dist/src/snapshot/extractors/index.js +1 -1
  92. package/dist/src/snapshot/extractors/index.js.map +1 -1
  93. package/dist/src/snapshot/extractors/region-resolver.d.ts.map +1 -1
  94. package/dist/src/snapshot/extractors/region-resolver.js +8 -0
  95. package/dist/src/snapshot/extractors/region-resolver.js.map +1 -1
  96. package/dist/src/snapshot/extractors/types.d.ts +8 -0
  97. package/dist/src/snapshot/extractors/types.d.ts.map +1 -1
  98. package/dist/src/snapshot/extractors/types.js +16 -0
  99. package/dist/src/snapshot/extractors/types.js.map +1 -1
  100. package/dist/src/snapshot/frame-context.d.ts +68 -0
  101. package/dist/src/snapshot/frame-context.d.ts.map +1 -0
  102. package/dist/src/snapshot/frame-context.js +131 -0
  103. package/dist/src/snapshot/frame-context.js.map +1 -0
  104. package/dist/src/snapshot/heading-index.d.ts +28 -0
  105. package/dist/src/snapshot/heading-index.d.ts.map +1 -0
  106. package/dist/src/snapshot/heading-index.js +108 -0
  107. package/dist/src/snapshot/heading-index.js.map +1 -0
  108. package/dist/src/snapshot/index.d.ts +5 -3
  109. package/dist/src/snapshot/index.d.ts.map +1 -1
  110. package/dist/src/snapshot/index.js +3 -2
  111. package/dist/src/snapshot/index.js.map +1 -1
  112. package/dist/src/snapshot/kind-mapping.d.ts +30 -0
  113. package/dist/src/snapshot/kind-mapping.d.ts.map +1 -0
  114. package/dist/src/snapshot/kind-mapping.js +114 -0
  115. package/dist/src/snapshot/kind-mapping.js.map +1 -0
  116. package/dist/src/snapshot/node-filter.d.ts +31 -0
  117. package/dist/src/snapshot/node-filter.d.ts.map +1 -0
  118. package/dist/src/snapshot/node-filter.js +137 -0
  119. package/dist/src/snapshot/node-filter.js.map +1 -0
  120. package/dist/src/snapshot/node-synthesizer.d.ts +62 -0
  121. package/dist/src/snapshot/node-synthesizer.d.ts.map +1 -0
  122. package/dist/src/snapshot/node-synthesizer.js +185 -0
  123. package/dist/src/snapshot/node-synthesizer.js.map +1 -0
  124. package/dist/src/snapshot/snapshot-compiler.d.ts +2 -36
  125. package/dist/src/snapshot/snapshot-compiler.d.ts.map +1 -1
  126. package/dist/src/snapshot/snapshot-compiler.js +25 -547
  127. package/dist/src/snapshot/snapshot-compiler.js.map +1 -1
  128. package/dist/src/snapshot/snapshot.types.d.ts +7 -2
  129. package/dist/src/snapshot/snapshot.types.d.ts.map +1 -1
  130. package/dist/src/snapshot/snapshot.types.js +8 -0
  131. package/dist/src/snapshot/snapshot.types.js.map +1 -1
  132. package/dist/src/state/actionables-filter.d.ts +5 -0
  133. package/dist/src/state/actionables-filter.d.ts.map +1 -1
  134. package/dist/src/state/actionables-filter.js +21 -3
  135. package/dist/src/state/actionables-filter.js.map +1 -1
  136. package/dist/src/state/diff-engine.js +3 -3
  137. package/dist/src/state/diff-engine.js.map +1 -1
  138. package/dist/src/state/element-registry.d.ts.map +1 -1
  139. package/dist/src/state/element-registry.js +6 -4
  140. package/dist/src/state/element-registry.js.map +1 -1
  141. package/dist/src/state/hash-utils.d.ts +24 -0
  142. package/dist/src/state/hash-utils.d.ts.map +1 -0
  143. package/dist/src/state/hash-utils.js +41 -0
  144. package/dist/src/state/hash-utils.js.map +1 -0
  145. package/dist/src/state/layer-detector.d.ts.map +1 -1
  146. package/dist/src/state/layer-detector.js +15 -286
  147. package/dist/src/state/layer-detector.js.map +1 -1
  148. package/dist/src/state/layer-detectors/drawer-detector.d.ts +32 -0
  149. package/dist/src/state/layer-detectors/drawer-detector.d.ts.map +1 -0
  150. package/dist/src/state/layer-detectors/drawer-detector.js +96 -0
  151. package/dist/src/state/layer-detectors/drawer-detector.js.map +1 -0
  152. package/dist/src/state/layer-detectors/index.d.ts +10 -0
  153. package/dist/src/state/layer-detectors/index.d.ts.map +1 -0
  154. package/dist/src/state/layer-detectors/index.js +10 -0
  155. package/dist/src/state/layer-detectors/index.js.map +1 -0
  156. package/dist/src/state/layer-detectors/modal-detector.d.ts +30 -0
  157. package/dist/src/state/layer-detectors/modal-detector.d.ts.map +1 -0
  158. package/dist/src/state/layer-detectors/modal-detector.js +127 -0
  159. package/dist/src/state/layer-detectors/modal-detector.js.map +1 -0
  160. package/dist/src/state/layer-detectors/popover-detector.d.ts +20 -0
  161. package/dist/src/state/layer-detectors/popover-detector.d.ts.map +1 -0
  162. package/dist/src/state/layer-detectors/popover-detector.js +76 -0
  163. package/dist/src/state/layer-detectors/popover-detector.js.map +1 -0
  164. package/dist/src/state/layer-detectors/toast-detector.d.ts +24 -0
  165. package/dist/src/state/layer-detectors/toast-detector.d.ts.map +1 -0
  166. package/dist/src/state/layer-detectors/toast-detector.js +48 -0
  167. package/dist/src/state/layer-detectors/toast-detector.js.map +1 -0
  168. package/dist/src/state/region-mapping.d.ts +13 -0
  169. package/dist/src/state/region-mapping.d.ts.map +1 -0
  170. package/dist/src/state/region-mapping.js +25 -0
  171. package/dist/src/state/region-mapping.js.map +1 -0
  172. package/dist/src/state/state-manager.d.ts.map +1 -1
  173. package/dist/src/state/state-manager.js +8 -192
  174. package/dist/src/state/state-manager.js.map +1 -1
  175. package/dist/src/state/state-renderer.d.ts.map +1 -1
  176. package/dist/src/state/state-renderer.js +14 -2
  177. package/dist/src/state/state-renderer.js.map +1 -1
  178. package/dist/src/state/types.d.ts +8 -4
  179. package/dist/src/state/types.d.ts.map +1 -1
  180. package/dist/src/state/url-sanitization.d.ts +22 -0
  181. package/dist/src/state/url-sanitization.d.ts.map +1 -0
  182. package/dist/src/state/url-sanitization.js +60 -0
  183. package/dist/src/state/url-sanitization.js.map +1 -0
  184. package/dist/src/state/value-masking.d.ts +36 -0
  185. package/dist/src/state/value-masking.d.ts.map +1 -0
  186. package/dist/src/state/value-masking.js +86 -0
  187. package/dist/src/state/value-masking.js.map +1 -0
  188. package/dist/src/tools/action-context.d.ts +60 -0
  189. package/dist/src/tools/action-context.d.ts.map +1 -0
  190. package/dist/src/tools/action-context.js +78 -0
  191. package/dist/src/tools/action-context.js.map +1 -0
  192. package/dist/src/tools/action-stabilization.d.ts +48 -0
  193. package/dist/src/tools/action-stabilization.d.ts.map +1 -0
  194. package/dist/src/tools/action-stabilization.js +87 -0
  195. package/dist/src/tools/action-stabilization.js.map +1 -0
  196. package/dist/src/tools/browser-tools.d.ts +8 -167
  197. package/dist/src/tools/browser-tools.d.ts.map +1 -1
  198. package/dist/src/tools/browser-tools.js +13 -651
  199. package/dist/src/tools/browser-tools.js.map +1 -1
  200. package/dist/src/tools/effect-tracker.d.ts +25 -0
  201. package/dist/src/tools/effect-tracker.d.ts.map +1 -0
  202. package/dist/src/tools/effect-tracker.js +69 -0
  203. package/dist/src/tools/effect-tracker.js.map +1 -0
  204. package/dist/src/tools/execute-action.d.ts +1 -31
  205. package/dist/src/tools/execute-action.d.ts.map +1 -1
  206. package/dist/src/tools/execute-action.js +7 -276
  207. package/dist/src/tools/execute-action.js.map +1 -1
  208. package/dist/src/tools/form-tools.d.ts +2 -2
  209. package/dist/src/tools/form-tools.js +4 -4
  210. package/dist/src/tools/form-tools.js.map +1 -1
  211. package/dist/src/tools/index.d.ts +2 -2
  212. package/dist/src/tools/index.d.ts.map +1 -1
  213. package/dist/src/tools/index.js +10 -8
  214. package/dist/src/tools/index.js.map +1 -1
  215. package/dist/src/tools/interaction-tools.d.ts +46 -0
  216. package/dist/src/tools/interaction-tools.d.ts.map +1 -0
  217. package/dist/src/tools/interaction-tools.js +138 -0
  218. package/dist/src/tools/interaction-tools.js.map +1 -0
  219. package/dist/src/tools/navigation-detection.d.ts +31 -0
  220. package/dist/src/tools/navigation-detection.d.ts.map +1 -0
  221. package/dist/src/tools/navigation-detection.js +46 -0
  222. package/dist/src/tools/navigation-detection.js.map +1 -0
  223. package/dist/src/tools/navigation-tools.d.ts +57 -0
  224. package/dist/src/tools/navigation-tools.d.ts.map +1 -0
  225. package/dist/src/tools/navigation-tools.js +178 -0
  226. package/dist/src/tools/navigation-tools.js.map +1 -0
  227. package/dist/src/tools/observation-tools.d.ts +53 -0
  228. package/dist/src/tools/observation-tools.d.ts.map +1 -0
  229. package/dist/src/tools/observation-tools.js +247 -0
  230. package/dist/src/tools/observation-tools.js.map +1 -0
  231. package/dist/src/tools/response-builder.js +2 -2
  232. package/dist/src/tools/response-builder.js.map +1 -1
  233. package/dist/src/tools/stale-element-retry.d.ts +37 -0
  234. package/dist/src/tools/stale-element-retry.d.ts.map +1 -0
  235. package/dist/src/tools/stale-element-retry.js +68 -0
  236. package/dist/src/tools/stale-element-retry.js.map +1 -0
  237. package/dist/src/tools/state-manager-registry.d.ts +26 -0
  238. package/dist/src/tools/state-manager-registry.d.ts.map +1 -0
  239. package/dist/src/tools/state-manager-registry.js +39 -0
  240. package/dist/src/tools/state-manager-registry.js.map +1 -0
  241. package/dist/src/tools/tool-context.js +1 -1
  242. package/dist/src/tools/tool-context.js.map +1 -1
  243. package/dist/src/tools/tool-schemas.d.ts +106 -21
  244. package/dist/src/tools/tool-schemas.d.ts.map +1 -1
  245. package/dist/src/tools/tool-schemas.js +59 -18
  246. package/dist/src/tools/tool-schemas.js.map +1 -1
  247. package/dist/src/tools/viewport-tools.d.ts +36 -0
  248. package/dist/src/tools/viewport-tools.d.ts.map +1 -0
  249. package/dist/src/tools/viewport-tools.js +105 -0
  250. package/dist/src/tools/viewport-tools.js.map +1 -0
  251. package/package.json +1 -1
@@ -6,9 +6,11 @@
6
6
  * @module snapshot
7
7
  */
8
8
  export type { BaseSnapshot, Viewport, SnapshotMeta, ReadableNode, NodeKind, SemanticRegion, NodeLocation, NodeLayout, BBox, BoundingBox, ScreenZone, NodeState, NodeLocators, NodeAttributes, SnapshotOptions, SnapshotResult, } from './snapshot.types.js';
9
- export { isInteractiveNode, isReadableNode, isStructuralNode } from './snapshot.types.js';
9
+ export { isInteractiveNode, isReadableNode, isStructuralNode, isLiveRegionNode, } from './snapshot.types.js';
10
10
  export { SnapshotStore, type SnapshotEntry, type SnapshotStoreOptions, type SnapshotStoreStats, } from './snapshot-store.js';
11
- export { clickByBackendNodeId, clickAtCoordinates, clickAtElementOffset, getElementTopLeft, dragBetweenCoordinates, typeByBackendNodeId, pressKey, selectOption, hoverByBackendNodeId, scrollIntoView, scrollPage, clearFocusedText, MODIFIER_ALT, MODIFIER_CTRL, MODIFIER_META, MODIFIER_SHIFT, } from './element-resolver.js';
12
- export { SnapshotCompiler, compileSnapshot, type CompileOptions } from './snapshot-compiler.js';
11
+ export { clickByBackendNodeId, clickAtCoordinates, clickAtElementOffset, getElementTopLeft, dragBetweenCoordinates, dispatchWheelEvent, typeByBackendNodeId, pressKey, selectOption, hoverByBackendNodeId, scrollIntoView, scrollPage, clearFocusedText, MODIFIER_ALT, MODIFIER_CTRL, MODIFIER_META, MODIFIER_SHIFT, } from './element-resolver.js';
12
+ export { SnapshotCompiler, compileSnapshot } from './snapshot-compiler.js';
13
+ export type { CompileOptions } from './kind-mapping.js';
14
+ export { sliceWithOverlayPriority } from './node-filter.js';
13
15
  export * from './extractors/index.js';
14
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/snapshot/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,WAAW,EACX,UAAU,EACV,SAAS,EACT,YAAY,EACZ,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG1F,OAAO,EACL,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,GACf,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGhG,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/snapshot/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,WAAW,EACX,UAAU,EACV,SAAS,EACT,YAAY,EACZ,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,GACf,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3E,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAG5D,cAAc,uBAAuB,CAAC"}
@@ -6,13 +6,14 @@
6
6
  * @module snapshot
7
7
  */
8
8
  // Type guards
9
- export { isInteractiveNode, isReadableNode, isStructuralNode } from './snapshot.types.js';
9
+ export { isInteractiveNode, isReadableNode, isStructuralNode, isLiveRegionNode, } from './snapshot.types.js';
10
10
  // Store
11
11
  export { SnapshotStore, } from './snapshot-store.js';
12
12
  // Element resolver - CDP input functions
13
- export { clickByBackendNodeId, clickAtCoordinates, clickAtElementOffset, getElementTopLeft, dragBetweenCoordinates, typeByBackendNodeId, pressKey, selectOption, hoverByBackendNodeId, scrollIntoView, scrollPage, clearFocusedText, MODIFIER_ALT, MODIFIER_CTRL, MODIFIER_META, MODIFIER_SHIFT, } from './element-resolver.js';
13
+ export { clickByBackendNodeId, clickAtCoordinates, clickAtElementOffset, getElementTopLeft, dragBetweenCoordinates, dispatchWheelEvent, typeByBackendNodeId, pressKey, selectOption, hoverByBackendNodeId, scrollIntoView, scrollPage, clearFocusedText, MODIFIER_ALT, MODIFIER_CTRL, MODIFIER_META, MODIFIER_SHIFT, } from './element-resolver.js';
14
14
  // Snapshot compiler
15
15
  export { SnapshotCompiler, compileSnapshot } from './snapshot-compiler.js';
16
+ export { sliceWithOverlayPriority } from './node-filter.js';
16
17
  // Extractors (advanced usage)
17
18
  export * from './extractors/index.js';
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/snapshot/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAsBH,cAAc;AACd,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE1F,QAAQ;AACR,OAAO,EACL,aAAa,GAId,MAAM,qBAAqB,CAAC;AAE7B,yCAAyC;AACzC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,GACf,MAAM,uBAAuB,CAAC;AAE/B,oBAAoB;AACpB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAuB,MAAM,wBAAwB,CAAC;AAEhG,8BAA8B;AAC9B,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/snapshot/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAsBH,cAAc;AACd,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,QAAQ;AACR,OAAO,EACL,aAAa,GAId,MAAM,qBAAqB,CAAC;AAE7B,yCAAyC;AACzC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,GACf,MAAM,uBAAuB,CAAC;AAE/B,oBAAoB;AACpB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,8BAA8B;AAC9B,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Kind Mapping
3
+ *
4
+ * Maps AX roles and HTML tags to NodeKind values.
5
+ *
6
+ * @module snapshot/kind-mapping
7
+ */
8
+ import type { NodeKind, SnapshotOptions } from './snapshot.types.js';
9
+ /**
10
+ * Snapshot compiler options
11
+ */
12
+ export interface CompileOptions extends Partial<SnapshotOptions> {
13
+ /** Include readable content nodes (headings, paragraphs). Default: true */
14
+ includeReadable?: boolean;
15
+ /** Extract bounding boxes and layout info. Default: true */
16
+ includeLayout?: boolean;
17
+ }
18
+ /**
19
+ * Default compile options
20
+ */
21
+ export declare const DEFAULT_OPTIONS: Required<CompileOptions>;
22
+ /**
23
+ * Map AX role to NodeKind.
24
+ */
25
+ export declare function mapRoleToKind(role: string | undefined): NodeKind | undefined;
26
+ /**
27
+ * Get NodeKind from HTML tag name.
28
+ */
29
+ export declare function getKindFromTag(tagName: string): NodeKind | undefined;
30
+ //# sourceMappingURL=kind-mapping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kind-mapping.d.ts","sourceRoot":"","sources":["../../../src/snapshot/kind-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,OAAO,CAAC,eAAe,CAAC;IAC9D,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,cAAc,CAQpD,CAAC;AAoFF;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAG5E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAEpE"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Kind Mapping
3
+ *
4
+ * Maps AX roles and HTML tags to NodeKind values.
5
+ *
6
+ * @module snapshot/kind-mapping
7
+ */
8
+ /**
9
+ * Default compile options
10
+ */
11
+ export const DEFAULT_OPTIONS = {
12
+ include_hidden: false,
13
+ max_nodes: 2000,
14
+ timeout: 30000,
15
+ redact_sensitive: true,
16
+ include_values: true, // Enable value extraction with password redaction
17
+ includeReadable: true,
18
+ includeLayout: true,
19
+ };
20
+ /** AX role → NodeKind lookup (hoisted to avoid per-call allocation) */
21
+ const ROLE_TO_KIND = {
22
+ // Interactive
23
+ button: 'button',
24
+ link: 'link',
25
+ textbox: 'input',
26
+ searchbox: 'input',
27
+ combobox: 'combobox',
28
+ listbox: 'select',
29
+ checkbox: 'checkbox',
30
+ radio: 'radio',
31
+ switch: 'switch',
32
+ slider: 'slider',
33
+ spinbutton: 'slider',
34
+ tab: 'tab',
35
+ menuitem: 'menuitem',
36
+ menuitemcheckbox: 'menuitem',
37
+ menuitemradio: 'menuitem',
38
+ option: 'menuitem',
39
+ // Readable
40
+ heading: 'heading',
41
+ paragraph: 'paragraph',
42
+ text: 'text',
43
+ statictext: 'text',
44
+ list: 'list',
45
+ listitem: 'listitem',
46
+ tree: 'list',
47
+ treeitem: 'listitem',
48
+ image: 'image',
49
+ img: 'image',
50
+ figure: 'image',
51
+ canvas: 'canvas',
52
+ table: 'table',
53
+ grid: 'table',
54
+ treegrid: 'table',
55
+ // Structural
56
+ form: 'form',
57
+ dialog: 'dialog',
58
+ alertdialog: 'dialog',
59
+ navigation: 'navigation',
60
+ region: 'section',
61
+ article: 'section',
62
+ main: 'section',
63
+ banner: 'section',
64
+ complementary: 'section',
65
+ contentinfo: 'section',
66
+ // Live region / ephemeral feedback
67
+ alert: 'alert',
68
+ status: 'status',
69
+ log: 'log',
70
+ marquee: 'log',
71
+ timer: 'timer',
72
+ tooltip: 'tooltip',
73
+ progressbar: 'progressbar',
74
+ };
75
+ /** HTML tag → NodeKind lookup (hoisted to avoid per-call allocation) */
76
+ const TAG_TO_KIND = {
77
+ BUTTON: 'button',
78
+ A: 'link',
79
+ INPUT: 'input',
80
+ TEXTAREA: 'textarea',
81
+ SELECT: 'select',
82
+ H1: 'heading',
83
+ H2: 'heading',
84
+ H3: 'heading',
85
+ H4: 'heading',
86
+ H5: 'heading',
87
+ H6: 'heading',
88
+ P: 'paragraph',
89
+ IMG: 'image',
90
+ TABLE: 'table',
91
+ UL: 'list',
92
+ OL: 'list',
93
+ LI: 'listitem',
94
+ FORM: 'form',
95
+ DIALOG: 'dialog',
96
+ NAV: 'navigation',
97
+ OPTION: 'menuitem',
98
+ CANVAS: 'canvas',
99
+ };
100
+ /**
101
+ * Map AX role to NodeKind.
102
+ */
103
+ export function mapRoleToKind(role) {
104
+ if (!role)
105
+ return undefined;
106
+ return ROLE_TO_KIND[role.toLowerCase()];
107
+ }
108
+ /**
109
+ * Get NodeKind from HTML tag name.
110
+ */
111
+ export function getKindFromTag(tagName) {
112
+ return TAG_TO_KIND[tagName.toUpperCase()];
113
+ }
114
+ //# sourceMappingURL=kind-mapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kind-mapping.js","sourceRoot":"","sources":["../../../src/snapshot/kind-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAcH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD,cAAc,EAAE,KAAK;IACrB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SAAS;IACtB,mCAAmC;IACnC,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;CAC3B,CAAC;AAEF,wEAAwE;AACxE,MAAM,WAAW,GAA6B;IAC5C,MAAM,EAAE,QAAQ;IAChB,CAAC,EAAE,MAAM;IACT,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,CAAC,EAAE,WAAW;IACd,GAAG,EAAE,OAAO;IACZ,KAAK,EAAE,OAAO;IACd,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,YAAY;IACjB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAwB;IACpD,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,OAAO,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,OAAO,WAAW,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Node Filtering
3
+ *
4
+ * Filters noise nodes and slices to budget while preserving overlay content.
5
+ *
6
+ * @module snapshot/node-filter
7
+ */
8
+ import type { ReadableNode } from './snapshot.types.js';
9
+ import type { RawNodeData, RawDomNode, RawAxNode } from './extractors/index.js';
10
+ /**
11
+ * Filter out noise nodes to reduce snapshot size.
12
+ *
13
+ * Filters:
14
+ * 1. Empty list/listitem containers with no semantic name AND no interactive descendants
15
+ * 2. StaticText/text nodes that mirror their parent's label exactly
16
+ */
17
+ export declare function filterNoiseNodes(nodes: ReadableNode[], domTree: Map<number, RawDomNode>, axTree: Map<number, RawAxNode>): ReadableNode[];
18
+ /**
19
+ * Slice nodes to max_nodes budget while preserving high z-index overlay content.
20
+ *
21
+ * Portal-rendered content (dropdowns, popovers, modals) appears at the end of
22
+ * DOM order. On heavy pages, a naive slice truncates it.
23
+ *
24
+ * Strategy:
25
+ * 1. Partition nodes into overlay (z-index > threshold) and main
26
+ * 2. Take all overlay nodes (up to 30% of budget)
27
+ * 3. Fill remaining budget with main nodes (DOM order)
28
+ * 4. Re-sort by original DOM order
29
+ */
30
+ export declare function sliceWithOverlayPriority(nodes: RawNodeData[], maxNodes: number): RawNodeData[];
31
+ //# sourceMappingURL=node-filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-filter.d.ts","sourceRoot":"","sources":["../../../src/snapshot/node-filter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGhF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EAAE,EACrB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EAChC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,GAC7B,YAAY,EAAE,CAkFhB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE,CA2C9F"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Node Filtering
3
+ *
4
+ * Filters noise nodes and slices to budget while preserving overlay content.
5
+ *
6
+ * @module snapshot/node-filter
7
+ */
8
+ import { isInteractiveKind } from '../state/actionables-filter.js';
9
+ /**
10
+ * Filter out noise nodes to reduce snapshot size.
11
+ *
12
+ * Filters:
13
+ * 1. Empty list/listitem containers with no semantic name AND no interactive descendants
14
+ * 2. StaticText/text nodes that mirror their parent's label exactly
15
+ */
16
+ export function filterNoiseNodes(nodes, domTree, axTree) {
17
+ // Build set of interactive node backend IDs for descendant checking
18
+ const interactiveBackendIds = new Set(nodes.filter((n) => isInteractiveKind(n.kind)).map((n) => n.backend_node_id));
19
+ // Build parent-child relationship from DOM tree
20
+ const childToParent = new Map();
21
+ for (const [nodeId, domNode] of domTree) {
22
+ if (domNode.parentId !== undefined) {
23
+ childToParent.set(nodeId, domNode.parentId);
24
+ }
25
+ }
26
+ // Check if a node has any interactive descendants in the DOM tree
27
+ const hasInteractiveDescendant = (nodeId) => {
28
+ const domNode = domTree.get(nodeId);
29
+ if (!domNode)
30
+ return false;
31
+ // Check direct children
32
+ if (domNode.childNodeIds) {
33
+ for (const childId of domNode.childNodeIds) {
34
+ if (interactiveBackendIds.has(childId)) {
35
+ return true;
36
+ }
37
+ if (hasInteractiveDescendant(childId)) {
38
+ return true;
39
+ }
40
+ }
41
+ }
42
+ return false;
43
+ };
44
+ // Get label of parent node in the node list
45
+ const getParentLabel = (nodeId) => {
46
+ const parentId = childToParent.get(nodeId);
47
+ if (parentId === undefined)
48
+ return undefined;
49
+ // Look up parent in our node list
50
+ const parentNode = nodes.find((n) => n.backend_node_id === parentId);
51
+ if (parentNode) {
52
+ return parentNode.label;
53
+ }
54
+ // Parent might be further up - check AX tree for parent's name
55
+ const parentAx = axTree.get(parentId);
56
+ return parentAx?.name;
57
+ };
58
+ // Container kinds that can be noisy when empty
59
+ const containerKinds = new Set(['list', 'listitem']);
60
+ // Text kinds that can duplicate parent labels
61
+ const textKinds = new Set(['text']);
62
+ return nodes.filter((node) => {
63
+ // Rule 1: Filter empty container nodes without interactive descendants
64
+ if (containerKinds.has(node.kind)) {
65
+ const hasSemanticName = node.label && node.label.trim().length > 0;
66
+ if (!hasSemanticName) {
67
+ const hasInteractive = hasInteractiveDescendant(node.backend_node_id);
68
+ if (!hasInteractive) {
69
+ return false; // Filter out empty container without interactive content
70
+ }
71
+ }
72
+ }
73
+ // Rule 2: Filter text nodes that mirror parent's label
74
+ if (textKinds.has(node.kind)) {
75
+ const parentLabel = getParentLabel(node.backend_node_id);
76
+ if (parentLabel && node.label) {
77
+ // Normalize and compare
78
+ const normalizedParent = parentLabel.trim().toLowerCase();
79
+ const normalizedNode = node.label.trim().toLowerCase();
80
+ if (normalizedNode === normalizedParent) {
81
+ return false; // Filter out duplicate text
82
+ }
83
+ }
84
+ }
85
+ return true; // Keep the node
86
+ });
87
+ }
88
+ /**
89
+ * Slice nodes to max_nodes budget while preserving high z-index overlay content.
90
+ *
91
+ * Portal-rendered content (dropdowns, popovers, modals) appears at the end of
92
+ * DOM order. On heavy pages, a naive slice truncates it.
93
+ *
94
+ * Strategy:
95
+ * 1. Partition nodes into overlay (z-index > threshold) and main
96
+ * 2. Take all overlay nodes (up to 30% of budget)
97
+ * 3. Fill remaining budget with main nodes (DOM order)
98
+ * 4. Re-sort by original DOM order
99
+ */
100
+ export function sliceWithOverlayPriority(nodes, maxNodes) {
101
+ if (nodes.length <= maxNodes) {
102
+ return nodes;
103
+ }
104
+ const OVERLAY_Z_THRESHOLD = 100;
105
+ const MAX_OVERLAY_RATIO = 0.3;
106
+ const overlayNodes = [];
107
+ const mainNodes = [];
108
+ for (const node of nodes) {
109
+ const zIndex = node.layout?.zIndex;
110
+ if (zIndex !== undefined && zIndex > OVERLAY_Z_THRESHOLD) {
111
+ overlayNodes.push(node);
112
+ }
113
+ else {
114
+ mainNodes.push(node);
115
+ }
116
+ }
117
+ // No overlay content → simple slice
118
+ if (overlayNodes.length === 0) {
119
+ return nodes.slice(0, maxNodes);
120
+ }
121
+ // Reserve budget for overlay (capped at 30% of total)
122
+ const maxOverlay = Math.min(overlayNodes.length, Math.floor(maxNodes * MAX_OVERLAY_RATIO));
123
+ const overlaySlice = overlayNodes.slice(0, maxOverlay);
124
+ // Fill remaining budget with main content
125
+ const mainBudget = maxNodes - overlaySlice.length;
126
+ const mainSlice = mainNodes.slice(0, mainBudget);
127
+ // Merge and re-sort by original DOM order
128
+ const merged = [...mainSlice, ...overlaySlice];
129
+ const indexMap = new Map(nodes.map((n, i) => [n.backendNodeId, i]));
130
+ merged.sort((a, b) => {
131
+ const ia = indexMap.get(a.backendNodeId) ?? Infinity;
132
+ const ib = indexMap.get(b.backendNodeId) ?? Infinity;
133
+ return ia - ib;
134
+ });
135
+ return merged;
136
+ }
137
+ //# sourceMappingURL=node-filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-filter.js","sourceRoot":"","sources":["../../../src/snapshot/node-filter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAqB,EACrB,OAAgC,EAChC,MAA8B;IAE9B,oEAAoE;IACpE,MAAM,qBAAqB,GAAG,IAAI,GAAG,CACnC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAC7E,CAAC;IAEF,gDAAgD;IAChD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAChD,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,OAAO,EAAE,CAAC;QACxC,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACnC,aAAa,CAAC,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,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACnB,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC;QACrD,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC;QACrD,OAAO,EAAE,GAAG,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Node Synthesizer
3
+ *
4
+ * Synthesizes nodes from DOM data that the AX tree misses or misclassifies:
5
+ * - Option nodes from <select> children (often marked as ignored by Chrome)
6
+ * - Canvas nodes (classified as generic/ignored by AX tree)
7
+ * - Toast library nodes (promoted to alert role for unsemantic toast libraries)
8
+ *
9
+ * @module snapshot/node-synthesizer
10
+ */
11
+ import type { RawNodeData, RawDomNode, DomExtractionResult } from './extractors/index.js';
12
+ /**
13
+ * Data attributes used by unsemantic toast libraries.
14
+ * Keep in sync with TOAST_LIBRARY_SELECTOR in observer-script.ts.
15
+ */
16
+ export declare const TOAST_DATA_ATTRS: string[];
17
+ /**
18
+ * CSS class substrings used by unsemantic toast libraries.
19
+ * Keep in sync with TOAST_LIBRARY_SELECTOR in observer-script.ts.
20
+ */
21
+ export declare const TOAST_CLASS_PATTERNS: string[];
22
+ /**
23
+ * Check if a DOM node belongs to a known unsemantic toast library.
24
+ */
25
+ export declare function isToastLibraryNode(domNode: RawDomNode): boolean;
26
+ /**
27
+ * Synthesize option nodes from <select> children.
28
+ *
29
+ * Chrome's AX tree often marks <option> nodes as ignored when the select
30
+ * is collapsed, and their bounding boxes are zero (OS-rendered).
31
+ * We inject them from the DOM so AI agents can discover available options.
32
+ *
33
+ * @param nodesToProcess - Current node list (mutated in place)
34
+ * @param domResult - DOM extraction result
35
+ */
36
+ export declare function synthesizeOptionNodes(nodesToProcess: RawNodeData[], domResult: DomExtractionResult): void;
37
+ /**
38
+ * Synthesize canvas nodes from DOM.
39
+ *
40
+ * Canvas elements are classified as generic/ignored by the AX tree,
41
+ * so we inject them from the DOM so AI agents can discover and interact with them.
42
+ *
43
+ * @param nodesToProcess - Current node list (mutated in place)
44
+ * @param domResult - DOM extraction result
45
+ */
46
+ export declare function synthesizeCanvasNodes(nodesToProcess: RawNodeData[], domResult: DomExtractionResult): void;
47
+ /**
48
+ * Promote unsemantic toast library nodes to alert role.
49
+ *
50
+ * Popular toast libraries (Sonner, react-hot-toast, Toastify, Ant Design, Chakra UI)
51
+ * don't use ARIA roles. Detect them by data attributes and CSS classes.
52
+ * Selectors mirror TOAST_LIBRARY_SELECTOR in observer-script.ts — keep in sync.
53
+ *
54
+ * Some toast elements (e.g., Sonner's <li data-sonner-toast>) are already in
55
+ * nodesToProcess via the AX tree (as listitem/generic), so we must also override
56
+ * their axNode role — not just add new nodes.
57
+ *
58
+ * @param nodesToProcess - Current node list (mutated in place)
59
+ * @param domResult - DOM extraction result
60
+ */
61
+ export declare function promoteToastNodes(nodesToProcess: RawNodeData[], domResult: DomExtractionResult): void;
62
+ //# sourceMappingURL=node-synthesizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-synthesizer.d.ts","sourceRoot":"","sources":["../../../src/snapshot/node-synthesizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EAEV,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAG/B;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAA0C,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,UAKhC,CAAC;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAgB/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,WAAW,EAAE,EAC7B,SAAS,EAAE,mBAAmB,GAC7B,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,WAAW,EAAE,EAC7B,SAAS,EAAE,mBAAmB,GAC7B,IAAI,CAsBN;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,WAAW,EAAE,EAC7B,SAAS,EAAE,mBAAmB,GAC7B,IAAI,CA2BN"}
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Node Synthesizer
3
+ *
4
+ * Synthesizes nodes from DOM data that the AX tree misses or misclassifies:
5
+ * - Option nodes from <select> children (often marked as ignored by Chrome)
6
+ * - Canvas nodes (classified as generic/ignored by AX tree)
7
+ * - Toast library nodes (promoted to alert role for unsemantic toast libraries)
8
+ *
9
+ * @module snapshot/node-synthesizer
10
+ */
11
+ import { getTextContent } from '../lib/text-utils.js';
12
+ /**
13
+ * Data attributes used by unsemantic toast libraries.
14
+ * Keep in sync with TOAST_LIBRARY_SELECTOR in observer-script.ts.
15
+ */
16
+ export const TOAST_DATA_ATTRS = ['data-sonner-toast', 'data-hot-toast'];
17
+ /**
18
+ * CSS class substrings used by unsemantic toast libraries.
19
+ * Keep in sync with TOAST_LIBRARY_SELECTOR in observer-script.ts.
20
+ */
21
+ export const TOAST_CLASS_PATTERNS = [
22
+ 'Toastify__toast',
23
+ 'ant-message-notice',
24
+ 'ant-message',
25
+ 'chakra-toast',
26
+ ];
27
+ /**
28
+ * Check if a DOM node belongs to a known unsemantic toast library.
29
+ */
30
+ export function isToastLibraryNode(domNode) {
31
+ const attrs = domNode.attributes;
32
+ if (!attrs)
33
+ return false;
34
+ for (const attrName of TOAST_DATA_ATTRS) {
35
+ if (attrs[attrName] !== undefined)
36
+ return true;
37
+ }
38
+ const className = attrs.class ?? attrs.className;
39
+ if (typeof className === 'string') {
40
+ for (const pattern of TOAST_CLASS_PATTERNS) {
41
+ if (className.includes(pattern))
42
+ return true;
43
+ }
44
+ }
45
+ return false;
46
+ }
47
+ /**
48
+ * Synthesize option nodes from <select> children.
49
+ *
50
+ * Chrome's AX tree often marks <option> nodes as ignored when the select
51
+ * is collapsed, and their bounding boxes are zero (OS-rendered).
52
+ * We inject them from the DOM so AI agents can discover available options.
53
+ *
54
+ * @param nodesToProcess - Current node list (mutated in place)
55
+ * @param domResult - DOM extraction result
56
+ */
57
+ export function synthesizeOptionNodes(nodesToProcess, domResult) {
58
+ const alreadyInSet = new Set(nodesToProcess.map((n) => n.backendNodeId));
59
+ for (const nodeData of [...nodesToProcess]) {
60
+ const domNode = nodeData.domNode;
61
+ if (domNode?.nodeName.toUpperCase() !== 'SELECT')
62
+ continue;
63
+ const collectOptions = (parentId) => {
64
+ const parent = domResult.nodes.get(parentId);
65
+ if (!parent?.childNodeIds)
66
+ return;
67
+ for (const childId of parent.childNodeIds) {
68
+ const child = domResult.nodes.get(childId);
69
+ if (!child)
70
+ continue;
71
+ const childTag = child.nodeName.toUpperCase();
72
+ if (childTag === 'OPTGROUP') {
73
+ // Recurse into optgroup to find nested options
74
+ collectOptions(childId);
75
+ }
76
+ else if (childTag === 'OPTION' && !alreadyInSet.has(childId)) {
77
+ // Extract text content from option's child text nodes
78
+ const optionText = getTextContent(childId, domResult.nodes);
79
+ // Build synthetic AX node so label resolution and state extraction work
80
+ const syntheticAx = {
81
+ nodeId: `synthetic-opt-${childId}`,
82
+ backendDOMNodeId: childId,
83
+ role: 'option',
84
+ name: optionText ?? '',
85
+ properties: [],
86
+ };
87
+ // Transfer selected attribute to AX property
88
+ if (child.attributes?.selected !== undefined) {
89
+ syntheticAx.properties.push({
90
+ name: 'selected',
91
+ value: { type: 'boolean', value: true },
92
+ });
93
+ }
94
+ // Transfer disabled attribute to AX property
95
+ if (child.attributes?.disabled !== undefined) {
96
+ syntheticAx.properties.push({
97
+ name: 'disabled',
98
+ value: { type: 'boolean', value: true },
99
+ });
100
+ }
101
+ nodesToProcess.push({
102
+ backendNodeId: childId,
103
+ domNode: child,
104
+ axNode: syntheticAx,
105
+ });
106
+ alreadyInSet.add(childId);
107
+ }
108
+ }
109
+ };
110
+ collectOptions(domNode.backendNodeId);
111
+ }
112
+ }
113
+ /**
114
+ * Synthesize canvas nodes from DOM.
115
+ *
116
+ * Canvas elements are classified as generic/ignored by the AX tree,
117
+ * so we inject them from the DOM so AI agents can discover and interact with them.
118
+ *
119
+ * @param nodesToProcess - Current node list (mutated in place)
120
+ * @param domResult - DOM extraction result
121
+ */
122
+ export function synthesizeCanvasNodes(nodesToProcess, domResult) {
123
+ const alreadyInCanvas = new Set(nodesToProcess.map((n) => n.backendNodeId));
124
+ for (const [backendNodeId, domNode] of domResult.nodes) {
125
+ if (domNode.nodeName.toUpperCase() !== 'CANVAS')
126
+ continue;
127
+ if (alreadyInCanvas.has(backendNodeId))
128
+ continue;
129
+ const syntheticAx = {
130
+ nodeId: `synthetic-canvas-${backendNodeId}`,
131
+ backendDOMNodeId: backendNodeId,
132
+ role: 'canvas',
133
+ name: domNode.attributes?.['aria-label'] ?? '',
134
+ properties: [],
135
+ };
136
+ nodesToProcess.push({
137
+ backendNodeId,
138
+ domNode,
139
+ axNode: syntheticAx,
140
+ });
141
+ alreadyInCanvas.add(backendNodeId);
142
+ }
143
+ }
144
+ /**
145
+ * Promote unsemantic toast library nodes to alert role.
146
+ *
147
+ * Popular toast libraries (Sonner, react-hot-toast, Toastify, Ant Design, Chakra UI)
148
+ * don't use ARIA roles. Detect them by data attributes and CSS classes.
149
+ * Selectors mirror TOAST_LIBRARY_SELECTOR in observer-script.ts — keep in sync.
150
+ *
151
+ * Some toast elements (e.g., Sonner's <li data-sonner-toast>) are already in
152
+ * nodesToProcess via the AX tree (as listitem/generic), so we must also override
153
+ * their axNode role — not just add new nodes.
154
+ *
155
+ * @param nodesToProcess - Current node list (mutated in place)
156
+ * @param domResult - DOM extraction result
157
+ */
158
+ export function promoteToastNodes(nodesToProcess, domResult) {
159
+ const scheduledIndex = new Map(nodesToProcess.map((n, i) => [n.backendNodeId, i]));
160
+ for (const [backendNodeId, domNode] of domResult.nodes) {
161
+ if (!isToastLibraryNode(domNode))
162
+ continue;
163
+ const syntheticAx = {
164
+ nodeId: `synthetic-toast-${backendNodeId}`,
165
+ backendDOMNodeId: backendNodeId,
166
+ role: 'alert',
167
+ name: '', // Will be resolved via label fallback (textContent)
168
+ properties: [],
169
+ };
170
+ const existingIdx = scheduledIndex.get(backendNodeId);
171
+ if (existingIdx !== undefined) {
172
+ // Already scheduled (e.g., Sonner <li> classified as listitem) — override role
173
+ nodesToProcess[existingIdx].axNode = syntheticAx;
174
+ }
175
+ else {
176
+ nodesToProcess.push({
177
+ backendNodeId,
178
+ domNode,
179
+ axNode: syntheticAx,
180
+ });
181
+ scheduledIndex.set(backendNodeId, nodesToProcess.length - 1);
182
+ }
183
+ }
184
+ }
185
+ //# sourceMappingURL=node-synthesizer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-synthesizer.js","sourceRoot":"","sources":["../../../src/snapshot/node-synthesizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;AAExE;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,iBAAiB;IACjB,oBAAoB;IACpB,aAAa;IACb,cAAc;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAmB;IACpD,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC;IACjC,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC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