browxai 0.7.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 (520) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +139 -0
  3. package/THIRD_PARTY_NOTICES.md +45 -0
  4. package/dist/cli/chrome.d.ts +1 -0
  5. package/dist/cli/chrome.js +130 -0
  6. package/dist/cli/command-registry.d.ts +15 -0
  7. package/dist/cli/command-registry.js +35 -0
  8. package/dist/cli/doctor-plugins.d.ts +18 -0
  9. package/dist/cli/doctor-plugins.js +338 -0
  10. package/dist/cli/doctor.d.ts +9 -0
  11. package/dist/cli/doctor.js +407 -0
  12. package/dist/cli/init.d.ts +1 -0
  13. package/dist/cli/init.js +200 -0
  14. package/dist/cli/register-commands.d.ts +1 -0
  15. package/dist/cli/register-commands.js +22 -0
  16. package/dist/cli/serve.d.ts +14 -0
  17. package/dist/cli/serve.js +151 -0
  18. package/dist/cli.d.ts +3 -0
  19. package/dist/cli.js +129 -0
  20. package/dist/engine/adapters/adb.d.ts +72 -0
  21. package/dist/engine/adapters/adb.js +200 -0
  22. package/dist/engine/adapters/android-cdp.d.ts +54 -0
  23. package/dist/engine/adapters/android-cdp.js +110 -0
  24. package/dist/engine/adapters/android.engine.d.ts +1 -0
  25. package/dist/engine/adapters/android.engine.js +31 -0
  26. package/dist/engine/adapters/chromium.engine.d.ts +1 -0
  27. package/dist/engine/adapters/chromium.engine.js +44 -0
  28. package/dist/engine/adapters/firefox.engine.d.ts +1 -0
  29. package/dist/engine/adapters/firefox.engine.js +43 -0
  30. package/dist/engine/adapters/playwright-chromium.d.ts +43 -0
  31. package/dist/engine/adapters/playwright-chromium.js +56 -0
  32. package/dist/engine/adapters/playwright-firefox.d.ts +52 -0
  33. package/dist/engine/adapters/playwright-firefox.js +97 -0
  34. package/dist/engine/adapters/playwright-webkit.d.ts +40 -0
  35. package/dist/engine/adapters/playwright-webkit.js +79 -0
  36. package/dist/engine/adapters/safari/bidi-client.d.ts +46 -0
  37. package/dist/engine/adapters/safari/bidi-client.js +130 -0
  38. package/dist/engine/adapters/safari/launch.d.ts +56 -0
  39. package/dist/engine/adapters/safari/launch.js +104 -0
  40. package/dist/engine/adapters/safari/webdriver-client.d.ts +102 -0
  41. package/dist/engine/adapters/safari/webdriver-client.js +175 -0
  42. package/dist/engine/adapters/safari.engine.d.ts +1 -0
  43. package/dist/engine/adapters/safari.engine.js +52 -0
  44. package/dist/engine/adapters/safaridriver-hybrid.d.ts +56 -0
  45. package/dist/engine/adapters/safaridriver-hybrid.js +127 -0
  46. package/dist/engine/adapters/webkit.engine.d.ts +1 -0
  47. package/dist/engine/adapters/webkit.engine.js +47 -0
  48. package/dist/engine/capabilities.d.ts +53 -0
  49. package/dist/engine/capabilities.js +122 -0
  50. package/dist/engine/capability-registry.d.ts +9 -0
  51. package/dist/engine/capability-registry.js +20 -0
  52. package/dist/engine/index.d.ts +18 -0
  53. package/dist/engine/index.js +14 -0
  54. package/dist/engine/register-engines.d.ts +5 -0
  55. package/dist/engine/register-engines.js +16 -0
  56. package/dist/engine/registry.d.ts +145 -0
  57. package/dist/engine/registry.js +67 -0
  58. package/dist/engine/select.d.ts +48 -0
  59. package/dist/engine/select.js +128 -0
  60. package/dist/engine/session-cdp.d.ts +13 -0
  61. package/dist/engine/session-cdp.js +22 -0
  62. package/dist/engine/tool-gate.d.ts +19 -0
  63. package/dist/engine/tool-gate.js +226 -0
  64. package/dist/engine/types.d.ts +71 -0
  65. package/dist/engine/types.js +16 -0
  66. package/dist/helper/bridge.d.ts +48 -0
  67. package/dist/helper/bridge.js +200 -0
  68. package/dist/helper/browx-page.d.ts +1 -0
  69. package/dist/helper/browx-page.js +47 -0
  70. package/dist/helper/overlay-hide.d.ts +9 -0
  71. package/dist/helper/overlay-hide.js +49 -0
  72. package/dist/helper/stealth.d.ts +10 -0
  73. package/dist/helper/stealth.js +88 -0
  74. package/dist/index.d.ts +7 -0
  75. package/dist/index.js +15 -0
  76. package/dist/page/a11y.d.ts +81 -0
  77. package/dist/page/a11y.js +219 -0
  78. package/dist/page/action-substrate.d.ts +64 -0
  79. package/dist/page/action-substrate.js +118 -0
  80. package/dist/page/actionresult-blocks.d.ts +99 -0
  81. package/dist/page/actionresult-blocks.js +144 -0
  82. package/dist/page/actionresult-shape.d.ts +48 -0
  83. package/dist/page/actionresult-shape.js +155 -0
  84. package/dist/page/actionresult-types.d.ts +368 -0
  85. package/dist/page/actionresult-types.js +4 -0
  86. package/dist/page/actionresult.d.ts +4 -0
  87. package/dist/page/actionresult.js +299 -0
  88. package/dist/page/actions-probe.d.ts +32 -0
  89. package/dist/page/actions-probe.js +294 -0
  90. package/dist/page/actions-scroll.d.ts +40 -0
  91. package/dist/page/actions-scroll.js +53 -0
  92. package/dist/page/actions.d.ts +132 -0
  93. package/dist/page/actions.js +453 -0
  94. package/dist/page/archive-assets.d.ts +39 -0
  95. package/dist/page/archive-assets.js +187 -0
  96. package/dist/page/archive.d.ts +47 -0
  97. package/dist/page/archive.js +349 -0
  98. package/dist/page/asset-export.d.ts +122 -0
  99. package/dist/page/asset-export.js +376 -0
  100. package/dist/page/await_network.d.ts +16 -0
  101. package/dist/page/await_network.js +23 -0
  102. package/dist/page/bbox.d.ts +37 -0
  103. package/dist/page/bbox.js +115 -0
  104. package/dist/page/canvas-capture.d.ts +82 -0
  105. package/dist/page/canvas-capture.js +257 -0
  106. package/dist/page/canvas-diff.d.ts +51 -0
  107. package/dist/page/canvas-diff.js +131 -0
  108. package/dist/page/canvas-gesture.d.ts +53 -0
  109. package/dist/page/canvas-gesture.js +167 -0
  110. package/dist/page/canvas-transform.d.ts +96 -0
  111. package/dist/page/canvas-transform.js +150 -0
  112. package/dist/page/canvas.d.ts +8 -0
  113. package/dist/page/canvas.js +50 -0
  114. package/dist/page/capture-substrate.d.ts +111 -0
  115. package/dist/page/capture-substrate.js +139 -0
  116. package/dist/page/clipboard.d.ts +25 -0
  117. package/dist/page/clipboard.js +50 -0
  118. package/dist/page/clock.d.ts +36 -0
  119. package/dist/page/clock.js +167 -0
  120. package/dist/page/compose.d.ts +55 -0
  121. package/dist/page/compose.js +169 -0
  122. package/dist/page/console.d.ts +39 -0
  123. package/dist/page/console.js +73 -0
  124. package/dist/page/coverage.d.ts +97 -0
  125. package/dist/page/coverage.js +280 -0
  126. package/dist/page/dom-export.d.ts +41 -0
  127. package/dist/page/dom-export.js +193 -0
  128. package/dist/page/dom-walk.d.ts +91 -0
  129. package/dist/page/dom-walk.js +267 -0
  130. package/dist/page/dom_diff.d.ts +48 -0
  131. package/dist/page/dom_diff.js +121 -0
  132. package/dist/page/downloads.d.ts +80 -0
  133. package/dist/page/downloads.js +244 -0
  134. package/dist/page/drop-files.d.ts +78 -0
  135. package/dist/page/drop-files.js +310 -0
  136. package/dist/page/element-export-discovery.d.ts +64 -0
  137. package/dist/page/element-export-discovery.js +346 -0
  138. package/dist/page/element-export.d.ts +46 -0
  139. package/dist/page/element-export.js +251 -0
  140. package/dist/page/emulation-substrate.d.ts +53 -0
  141. package/dist/page/emulation-substrate.js +87 -0
  142. package/dist/page/emulation.d.ts +60 -0
  143. package/dist/page/emulation.js +162 -0
  144. package/dist/page/export-playwright-script.d.ts +47 -0
  145. package/dist/page/export-playwright-script.js +304 -0
  146. package/dist/page/extract-resolve.d.ts +22 -0
  147. package/dist/page/extract-resolve.js +341 -0
  148. package/dist/page/extract-schema.d.ts +20 -0
  149. package/dist/page/extract-schema.js +200 -0
  150. package/dist/page/extract-types.d.ts +127 -0
  151. package/dist/page/extract-types.js +8 -0
  152. package/dist/page/extract-warnings.d.ts +8 -0
  153. package/dist/page/extract-warnings.js +56 -0
  154. package/dist/page/extract.d.ts +9 -0
  155. package/dist/page/extract.js +174 -0
  156. package/dist/page/fill-form.d.ts +58 -0
  157. package/dist/page/fill-form.js +261 -0
  158. package/dist/page/find.d.ts +158 -0
  159. package/dist/page/find.js +470 -0
  160. package/dist/page/frames.d.ts +45 -0
  161. package/dist/page/frames.js +133 -0
  162. package/dist/page/generate-locator.d.ts +57 -0
  163. package/dist/page/generate-locator.js +136 -0
  164. package/dist/page/gestures.d.ts +128 -0
  165. package/dist/page/gestures.js +198 -0
  166. package/dist/page/har.d.ts +91 -0
  167. package/dist/page/har.js +174 -0
  168. package/dist/page/heap.d.ts +97 -0
  169. package/dist/page/heap.js +285 -0
  170. package/dist/page/inspect.d.ts +34 -0
  171. package/dist/page/inspect.js +75 -0
  172. package/dist/page/layout-thrash.d.ts +34 -0
  173. package/dist/page/layout-thrash.js +232 -0
  174. package/dist/page/learning.d.ts +21 -0
  175. package/dist/page/learning.js +84 -0
  176. package/dist/page/locator.d.ts +54 -0
  177. package/dist/page/locator.js +142 -0
  178. package/dist/page/memory-diff.d.ts +48 -0
  179. package/dist/page/memory-diff.js +105 -0
  180. package/dist/page/network-mask.d.ts +8 -0
  181. package/dist/page/network-mask.js +18 -0
  182. package/dist/page/network-playwright.d.ts +96 -0
  183. package/dist/page/network-playwright.js +353 -0
  184. package/dist/page/network-substrate-select.d.ts +18 -0
  185. package/dist/page/network-substrate-select.js +32 -0
  186. package/dist/page/network-substrate.d.ts +109 -0
  187. package/dist/page/network-substrate.js +161 -0
  188. package/dist/page/network-ws.d.ts +46 -0
  189. package/dist/page/network-ws.js +113 -0
  190. package/dist/page/network.d.ts +194 -0
  191. package/dist/page/network.js +415 -0
  192. package/dist/page/overflow-detect.d.ts +102 -0
  193. package/dist/page/overflow-detect.js +449 -0
  194. package/dist/page/pdf.d.ts +69 -0
  195. package/dist/page/pdf.js +109 -0
  196. package/dist/page/perf-audit-analysers.d.ts +40 -0
  197. package/dist/page/perf-audit-analysers.js +369 -0
  198. package/dist/page/perf-audit-runner.d.ts +20 -0
  199. package/dist/page/perf-audit-runner.js +195 -0
  200. package/dist/page/perf-audit-types.d.ts +41 -0
  201. package/dist/page/perf-audit-types.js +5 -0
  202. package/dist/page/perf-audit.d.ts +37 -0
  203. package/dist/page/perf-audit.js +377 -0
  204. package/dist/page/perf.d.ts +127 -0
  205. package/dist/page/perf.js +373 -0
  206. package/dist/page/plan.d.ts +192 -0
  207. package/dist/page/plan.js +308 -0
  208. package/dist/page/point_probe.d.ts +46 -0
  209. package/dist/page/point_probe.js +99 -0
  210. package/dist/page/recording.d.ts +67 -0
  211. package/dist/page/recording.js +172 -0
  212. package/dist/page/refs.d.ts +92 -0
  213. package/dist/page/refs.js +134 -0
  214. package/dist/page/regions.d.ts +23 -0
  215. package/dist/page/regions.js +32 -0
  216. package/dist/page/routes.d.ts +40 -0
  217. package/dist/page/routes.js +87 -0
  218. package/dist/page/safari-actions.d.ts +12 -0
  219. package/dist/page/safari-actions.js +144 -0
  220. package/dist/page/sample.d.ts +64 -0
  221. package/dist/page/sample.js +216 -0
  222. package/dist/page/screenshot-on.d.ts +51 -0
  223. package/dist/page/screenshot-on.js +150 -0
  224. package/dist/page/screenshot-save.d.ts +36 -0
  225. package/dist/page/screenshot-save.js +53 -0
  226. package/dist/page/screenshot-schedule.d.ts +50 -0
  227. package/dist/page/screenshot-schedule.js +155 -0
  228. package/dist/page/script-substrate.d.ts +32 -0
  229. package/dist/page/script-substrate.js +47 -0
  230. package/dist/page/seed-random.d.ts +45 -0
  231. package/dist/page/seed-random.js +144 -0
  232. package/dist/page/set-of-marks.d.ts +96 -0
  233. package/dist/page/set-of-marks.js +245 -0
  234. package/dist/page/shadow.d.ts +136 -0
  235. package/dist/page/shadow.js +400 -0
  236. package/dist/page/shortcut.d.ts +50 -0
  237. package/dist/page/shortcut.js +147 -0
  238. package/dist/page/snapshot-substrate-safari.d.ts +30 -0
  239. package/dist/page/snapshot-substrate-safari.js +84 -0
  240. package/dist/page/snapshot-substrate-select.d.ts +24 -0
  241. package/dist/page/snapshot-substrate-select.js +34 -0
  242. package/dist/page/snapshot-substrate.d.ts +58 -0
  243. package/dist/page/snapshot-substrate.js +135 -0
  244. package/dist/page/snapshot.d.ts +24 -0
  245. package/dist/page/snapshot.js +162 -0
  246. package/dist/page/solve-captcha.d.ts +76 -0
  247. package/dist/page/solve-captcha.js +286 -0
  248. package/dist/page/storage-substrate-types.d.ts +221 -0
  249. package/dist/page/storage-substrate-types.js +6 -0
  250. package/dist/page/storage-substrate.d.ts +215 -0
  251. package/dist/page/storage-substrate.js +280 -0
  252. package/dist/page/structural.d.ts +9 -0
  253. package/dist/page/structural.js +152 -0
  254. package/dist/page/substrate-bundle-safari.d.ts +8 -0
  255. package/dist/page/substrate-bundle-safari.js +42 -0
  256. package/dist/page/substrate-bundle.d.ts +6 -0
  257. package/dist/page/substrate-bundle.js +53 -0
  258. package/dist/page/text_search.d.ts +44 -0
  259. package/dist/page/text_search.js +90 -0
  260. package/dist/page/upload.d.ts +28 -0
  261. package/dist/page/upload.js +62 -0
  262. package/dist/page/verify.d.ts +63 -0
  263. package/dist/page/verify.js +451 -0
  264. package/dist/page/video.d.ts +115 -0
  265. package/dist/page/video.js +169 -0
  266. package/dist/page/visibility.d.ts +22 -0
  267. package/dist/page/visibility.js +94 -0
  268. package/dist/page/watch.d.ts +29 -0
  269. package/dist/page/watch.js +99 -0
  270. package/dist/page/workers.d.ts +126 -0
  271. package/dist/page/workers.js +490 -0
  272. package/dist/page/ws-interactive.d.ts +82 -0
  273. package/dist/page/ws-interactive.js +318 -0
  274. package/dist/plugin/cli.d.ts +45 -0
  275. package/dist/plugin/cli.js +496 -0
  276. package/dist/plugin/command-registry.d.ts +9 -0
  277. package/dist/plugin/command-registry.js +23 -0
  278. package/dist/plugin/depgraph.d.ts +37 -0
  279. package/dist/plugin/depgraph.js +186 -0
  280. package/dist/plugin/manifest.d.ts +182 -0
  281. package/dist/plugin/manifest.js +219 -0
  282. package/dist/plugin/package-manager.d.ts +22 -0
  283. package/dist/plugin/package-manager.js +40 -0
  284. package/dist/plugin/resolver.d.ts +85 -0
  285. package/dist/plugin/resolver.js +166 -0
  286. package/dist/plugin/runtime.d.ts +77 -0
  287. package/dist/plugin/runtime.js +402 -0
  288. package/dist/plugin/types.d.ts +113 -0
  289. package/dist/plugin/types.js +4 -0
  290. package/dist/policy/confirm.d.ts +76 -0
  291. package/dist/policy/confirm.js +162 -0
  292. package/dist/policy/origin.d.ts +17 -0
  293. package/dist/policy/origin.js +79 -0
  294. package/dist/sdk/client.d.ts +21 -0
  295. package/dist/sdk/client.js +174 -0
  296. package/dist/sdk/index.d.ts +32 -0
  297. package/dist/sdk/index.js +61 -0
  298. package/dist/sdk/plugin-types.d.ts +33 -0
  299. package/dist/sdk/plugin-types.js +22 -0
  300. package/dist/sdk/registry.d.ts +17 -0
  301. package/dist/sdk/registry.js +94 -0
  302. package/dist/sdk/socket-transport.d.ts +20 -0
  303. package/dist/sdk/socket-transport.js +90 -0
  304. package/dist/sdk/tool-types.d.ts +634 -0
  305. package/dist/sdk/tool-types.js +28 -0
  306. package/dist/sdk/transport-in-process.d.ts +21 -0
  307. package/dist/sdk/transport-in-process.js +44 -0
  308. package/dist/sdk/transport-registry.d.ts +19 -0
  309. package/dist/sdk/transport-registry.js +31 -0
  310. package/dist/sdk/transport-socket.d.ts +12 -0
  311. package/dist/sdk/transport-socket.js +77 -0
  312. package/dist/sdk/transport-stdio-child.d.ts +10 -0
  313. package/dist/sdk/transport-stdio-child.js +47 -0
  314. package/dist/sdk/transport.d.ts +10 -0
  315. package/dist/sdk/transport.js +35 -0
  316. package/dist/sdk/types.d.ts +176 -0
  317. package/dist/sdk/types.js +10 -0
  318. package/dist/server.d.ts +33 -0
  319. package/dist/server.js +327 -0
  320. package/dist/session/artifacts.d.ts +52 -0
  321. package/dist/session/artifacts.js +177 -0
  322. package/dist/session/byob-attach.d.ts +26 -0
  323. package/dist/session/byob-attach.js +187 -0
  324. package/dist/session/byob.d.ts +8 -0
  325. package/dist/session/byob.js +20 -0
  326. package/dist/session/cache-storage.d.ts +100 -0
  327. package/dist/session/cache-storage.js +166 -0
  328. package/dist/session/device-emu.d.ts +149 -0
  329. package/dist/session/device-emu.js +545 -0
  330. package/dist/session/device.d.ts +14 -0
  331. package/dist/session/device.js +44 -0
  332. package/dist/session/dialog.d.ts +62 -0
  333. package/dist/session/dialog.js +164 -0
  334. package/dist/session/emulation.d.ts +69 -0
  335. package/dist/session/emulation.js +168 -0
  336. package/dist/session/extensions.d.ts +113 -0
  337. package/dist/session/extensions.js +237 -0
  338. package/dist/session/fs-picker.d.ts +144 -0
  339. package/dist/session/fs-picker.js +666 -0
  340. package/dist/session/idb-storage.d.ts +86 -0
  341. package/dist/session/idb-storage.js +229 -0
  342. package/dist/session/incognito.d.ts +3 -0
  343. package/dist/session/incognito.js +20 -0
  344. package/dist/session/launch-options.d.ts +41 -0
  345. package/dist/session/launch-options.js +200 -0
  346. package/dist/session/managed.d.ts +3 -0
  347. package/dist/session/managed.js +16 -0
  348. package/dist/session/metrics.d.ts +45 -0
  349. package/dist/session/metrics.js +75 -0
  350. package/dist/session/notification.d.ts +122 -0
  351. package/dist/session/notification.js +426 -0
  352. package/dist/session/permission.d.ts +144 -0
  353. package/dist/session/permission.js +600 -0
  354. package/dist/session/playwright-post-wire.d.ts +8 -0
  355. package/dist/session/playwright-post-wire.js +148 -0
  356. package/dist/session/policy-buffer.d.ts +21 -0
  357. package/dist/session/policy-buffer.js +47 -0
  358. package/dist/session/profile-snapshot.d.ts +11 -0
  359. package/dist/session/profile-snapshot.js +53 -0
  360. package/dist/session/registry.d.ts +365 -0
  361. package/dist/session/registry.js +98 -0
  362. package/dist/session/safari-post-wire.d.ts +8 -0
  363. package/dist/session/safari-post-wire.js +28 -0
  364. package/dist/session/safari-session.d.ts +10 -0
  365. package/dist/session/safari-session.js +39 -0
  366. package/dist/session/storage.d.ts +148 -0
  367. package/dist/session/storage.js +350 -0
  368. package/dist/session/types.d.ts +113 -0
  369. package/dist/session/types.js +5 -0
  370. package/dist/session/wedge.d.ts +15 -0
  371. package/dist/session/wedge.js +41 -0
  372. package/dist/tools/action-core-tools.d.ts +13 -0
  373. package/dist/tools/action-core-tools.js +156 -0
  374. package/dist/tools/action-form-tools.d.ts +12 -0
  375. package/dist/tools/action-form-tools.js +179 -0
  376. package/dist/tools/action-gesture-tools.d.ts +9 -0
  377. package/dist/tools/action-gesture-tools.js +115 -0
  378. package/dist/tools/action-history-tools.d.ts +8 -0
  379. package/dist/tools/action-history-tools.js +67 -0
  380. package/dist/tools/action-tool.d.ts +42 -0
  381. package/dist/tools/action-tool.js +58 -0
  382. package/dist/tools/action-tools.d.ts +20 -0
  383. package/dist/tools/action-tools.js +28 -0
  384. package/dist/tools/batch-act-tools.d.ts +10 -0
  385. package/dist/tools/batch-act-tools.js +276 -0
  386. package/dist/tools/batch-human-tools.d.ts +8 -0
  387. package/dist/tools/batch-human-tools.js +148 -0
  388. package/dist/tools/canvas-tools.d.ts +40 -0
  389. package/dist/tools/canvas-tools.js +368 -0
  390. package/dist/tools/capture-report-diagnostics-tools.d.ts +7 -0
  391. package/dist/tools/capture-report-diagnostics-tools.js +318 -0
  392. package/dist/tools/capture-report-element-export-tools.d.ts +8 -0
  393. package/dist/tools/capture-report-element-export-tools.js +197 -0
  394. package/dist/tools/capture-report-export-tools.d.ts +8 -0
  395. package/dist/tools/capture-report-export-tools.js +246 -0
  396. package/dist/tools/capture-report-marks-tools.d.ts +9 -0
  397. package/dist/tools/capture-report-marks-tools.js +221 -0
  398. package/dist/tools/capture-report-upload-tools.d.ts +8 -0
  399. package/dist/tools/capture-report-upload-tools.js +277 -0
  400. package/dist/tools/config-approval-tools.d.ts +8 -0
  401. package/dist/tools/config-approval-tools.js +166 -0
  402. package/dist/tools/deep-coverage-tools.d.ts +8 -0
  403. package/dist/tools/deep-coverage-tools.js +325 -0
  404. package/dist/tools/deep-determinism-tools.d.ts +8 -0
  405. package/dist/tools/deep-determinism-tools.js +276 -0
  406. package/dist/tools/deep-perf-tools.d.ts +19 -0
  407. package/dist/tools/deep-perf-tools.js +324 -0
  408. package/dist/tools/device-emulation-tools.d.ts +9 -0
  409. package/dist/tools/device-emulation-tools.js +137 -0
  410. package/dist/tools/extensions-batch-tools.d.ts +18 -0
  411. package/dist/tools/extensions-batch-tools.js +24 -0
  412. package/dist/tools/extensions-rebuild.d.ts +22 -0
  413. package/dist/tools/extensions-rebuild.js +208 -0
  414. package/dist/tools/extensions-tools.d.ts +2 -0
  415. package/dist/tools/extensions-tools.js +331 -0
  416. package/dist/tools/forms-fill-tools.d.ts +8 -0
  417. package/dist/tools/forms-fill-tools.js +109 -0
  418. package/dist/tools/forms-plan-tools.d.ts +7 -0
  419. package/dist/tools/forms-plan-tools.js +159 -0
  420. package/dist/tools/forms-recording-mode-tools.d.ts +8 -0
  421. package/dist/tools/forms-recording-mode-tools.js +71 -0
  422. package/dist/tools/forms-recording-tools.d.ts +14 -0
  423. package/dist/tools/forms-recording-tools.js +22 -0
  424. package/dist/tools/forms-refs-tools.d.ts +8 -0
  425. package/dist/tools/forms-refs-tools.js +90 -0
  426. package/dist/tools/gesture-coord-tools.d.ts +8 -0
  427. package/dist/tools/gesture-coord-tools.js +168 -0
  428. package/dist/tools/gesture-emulation-tools.d.ts +8 -0
  429. package/dist/tools/gesture-emulation-tools.js +135 -0
  430. package/dist/tools/gesture-network-tools.d.ts +17 -0
  431. package/dist/tools/gesture-network-tools.js +27 -0
  432. package/dist/tools/gesture-route-tools.d.ts +8 -0
  433. package/dist/tools/gesture-route-tools.js +142 -0
  434. package/dist/tools/gesture-websocket-tools.d.ts +8 -0
  435. package/dist/tools/gesture-websocket-tools.js +122 -0
  436. package/dist/tools/gesture-worker-tools.d.ts +9 -0
  437. package/dist/tools/gesture-worker-tools.js +200 -0
  438. package/dist/tools/host-build.d.ts +76 -0
  439. package/dist/tools/host-build.js +516 -0
  440. package/dist/tools/host.d.ts +287 -0
  441. package/dist/tools/host.js +1 -0
  442. package/dist/tools/input-tools.d.ts +10 -0
  443. package/dist/tools/input-tools.js +176 -0
  444. package/dist/tools/live-emulation-tools.d.ts +9 -0
  445. package/dist/tools/live-emulation-tools.js +353 -0
  446. package/dist/tools/plugin-runtime.d.ts +36 -0
  447. package/dist/tools/plugin-runtime.js +274 -0
  448. package/dist/tools/read-observe-buffer-tools.d.ts +9 -0
  449. package/dist/tools/read-observe-buffer-tools.js +385 -0
  450. package/dist/tools/read-observe-capture-tools.d.ts +12 -0
  451. package/dist/tools/read-observe-capture-tools.js +376 -0
  452. package/dist/tools/read-observe-dom-tools.d.ts +8 -0
  453. package/dist/tools/read-observe-dom-tools.js +308 -0
  454. package/dist/tools/read-observe-extract-tools.d.ts +8 -0
  455. package/dist/tools/read-observe-extract-tools.js +232 -0
  456. package/dist/tools/read-observe-verify-tools.d.ts +8 -0
  457. package/dist/tools/read-observe-verify-tools.js +316 -0
  458. package/dist/tools/schemas.d.ts +29 -0
  459. package/dist/tools/schemas.js +58 -0
  460. package/dist/tools/secrets-captcha-tools.d.ts +9 -0
  461. package/dist/tools/secrets-captcha-tools.js +231 -0
  462. package/dist/tools/session-dialog-permission-tools.d.ts +9 -0
  463. package/dist/tools/session-dialog-permission-tools.js +287 -0
  464. package/dist/tools/session-lifecycle-tools.d.ts +8 -0
  465. package/dist/tools/session-lifecycle-tools.js +314 -0
  466. package/dist/tools/session-notification-device-tools.d.ts +9 -0
  467. package/dist/tools/session-notification-device-tools.js +156 -0
  468. package/dist/tools/session-policy-tools.d.ts +16 -0
  469. package/dist/tools/session-policy-tools.js +22 -0
  470. package/dist/tools/session-registry.d.ts +28 -0
  471. package/dist/tools/session-registry.js +427 -0
  472. package/dist/tools/storage-artifact-har-video-tools.d.ts +8 -0
  473. package/dist/tools/storage-artifact-har-video-tools.js +311 -0
  474. package/dist/tools/storage-cache-idb-tools.d.ts +8 -0
  475. package/dist/tools/storage-cache-idb-tools.js +347 -0
  476. package/dist/tools/storage-state-cookies-tools.d.ts +8 -0
  477. package/dist/tools/storage-state-cookies-tools.js +223 -0
  478. package/dist/tools/storage-tools.d.ts +17 -0
  479. package/dist/tools/storage-tools.js +25 -0
  480. package/dist/tools/storage-web-auth-tools.d.ts +10 -0
  481. package/dist/tools/storage-web-auth-tools.js +230 -0
  482. package/dist/tools/tool-metadata.d.ts +8 -0
  483. package/dist/tools/tool-metadata.js +185 -0
  484. package/dist/util/batch.d.ts +83 -0
  485. package/dist/util/batch.js +191 -0
  486. package/dist/util/capabilities.d.ts +504 -0
  487. package/dist/util/capabilities.js +254 -0
  488. package/dist/util/config-store.d.ts +103 -0
  489. package/dist/util/config-store.js +206 -0
  490. package/dist/util/config.d.ts +11 -0
  491. package/dist/util/config.js +28 -0
  492. package/dist/util/credentials.d.ts +136 -0
  493. package/dist/util/credentials.js +622 -0
  494. package/dist/util/deadline.d.ts +22 -0
  495. package/dist/util/deadline.js +62 -0
  496. package/dist/util/diagnostics.d.ts +161 -0
  497. package/dist/util/diagnostics.js +579 -0
  498. package/dist/util/egress-sanitiser.d.ts +29 -0
  499. package/dist/util/egress-sanitiser.js +52 -0
  500. package/dist/util/failure.d.ts +8 -0
  501. package/dist/util/failure.js +50 -0
  502. package/dist/util/flake-check.d.ts +109 -0
  503. package/dist/util/flake-check.js +342 -0
  504. package/dist/util/invariant.d.ts +25 -0
  505. package/dist/util/invariant.js +66 -0
  506. package/dist/util/logging.d.ts +6 -0
  507. package/dist/util/logging.js +12 -0
  508. package/dist/util/predicates.d.ts +62 -0
  509. package/dist/util/predicates.js +340 -0
  510. package/dist/util/secrets.d.ts +104 -0
  511. package/dist/util/secrets.js +219 -0
  512. package/dist/util/tokens.d.ts +6 -0
  513. package/dist/util/tokens.js +24 -0
  514. package/dist/util/url-sanitizer.d.ts +19 -0
  515. package/dist/util/url-sanitizer.js +70 -0
  516. package/dist/util/version.d.ts +2 -0
  517. package/dist/util/version.js +21 -0
  518. package/dist/util/workspace.d.ts +7 -0
  519. package/dist/util/workspace.js +22 -0
  520. package/package.json +120 -0
@@ -0,0 +1,7 @@
1
+ import type { RegisterHost, GateHost, SessionHost, ActionHost, EgressHost, ConfigHost, ServerServicesHost } from "./host.js";
2
+ /**
3
+ * Plan / execute tools: separate intent capture (`plan`) from dispatch
4
+ * (`execute`). Split out of `forms-recording-tools` (RFC 0004 P3 / D3 SRP);
5
+ * registered through the shared `ToolHost` seam in the same source order.
6
+ */
7
+ export declare function registerFormsPlanTools(host: RegisterHost & GateHost & SessionHost & ActionHost & EgressHost & ConfigHost & ServerServicesHost): void;
@@ -0,0 +1,159 @@
1
+ import { withDeadline } from "../util/deadline.js";
2
+ import { plan as planAction, execute as executeAction, PLAN_VERBS } from "../page/plan.js";
3
+ import { ACTION_OPTS, SESSION_ARG } from "./schemas.js";
4
+ import { confirmByobAction } from "../policy/confirm.js";
5
+ /**
6
+ * Plan / execute tools: separate intent capture (`plan`) from dispatch
7
+ * (`execute`). Split out of `forms-recording-tools` (RFC 0004 P3 / D3 SRP);
8
+ * registered through the shared `ToolHost` seam in the same source order.
9
+ */
10
+ export function registerFormsPlanTools(host) {
11
+ const { z, register, gateCheck, entryFor, confirmCtxFor, denyContent, actionTimeout, ctxFor, hintFromTarget, egressFor, config, caps, cfgActionTimeout, } = host;
12
+ // ---------- plan / execute (separate intent capture from dispatch) ----------
13
+ register("plan", {
14
+ capability: "read",
15
+ batchable: true,
16
+ description: "Resolve a natural-language `query` for a single element + a target action `verb` into a serialisable `ActionDescriptor` — no dispatch happens. The descriptor binds the picked ref (same `eN` namespace as snapshot/find/name_ref — NOT a parallel id system), the verb's args, evidence (selectorHint, stability, score, top alternatives + any low-confidence warnings), and an `expiresAt` deadline. Hand it back verbatim to `execute` to dispatch; cache it for replay / self-healing; or inspect `evidence` and refuse to dispatch when the stability is too low. NOT a mock dispatch — the value is captured intent, not suppressed effects.",
17
+ inputSchema: {
18
+ query: z
19
+ .string()
20
+ .describe("Natural-language description of the element to act on, e.g. 'the Save button'."),
21
+ verb: z.enum(PLAN_VERBS).describe(`Action verb to bind: ${PLAN_VERBS.join(" / ")}.`),
22
+ verbArgs: z
23
+ .object({
24
+ value: z.string().optional().describe("`fill` value."),
25
+ values: z.array(z.string()).optional().describe("`select` option labels/values."),
26
+ key: z.string().optional().describe("`press` key (Playwright key syntax)."),
27
+ button: z
28
+ .enum(["left", "right", "middle"])
29
+ .optional()
30
+ .describe("`click` mouse button (default left)."),
31
+ })
32
+ .optional()
33
+ .describe("Verb-specific args. Required: `value` for fill, `key` for press, `values` for select. click/hover take none."),
34
+ contextRef: z
35
+ .string()
36
+ .optional()
37
+ .describe("Limit ranking to descendants of this ref (same semantics as find())."),
38
+ confidenceFloor: z
39
+ .number()
40
+ .nonnegative()
41
+ .optional()
42
+ .describe("Returns ok:false when no candidate scored above this floor."),
43
+ ttlMs: z
44
+ .number()
45
+ .int()
46
+ .positive()
47
+ .optional()
48
+ .describe("Descriptor lifetime in ms (default 60000; clamped to [1000, 1800000])."),
49
+ ...SESSION_ARG,
50
+ },
51
+ }, async (args) => {
52
+ const g = gateCheck("plan");
53
+ if (g)
54
+ return g;
55
+ const e = await entryFor(args.session);
56
+ let outcome;
57
+ try {
58
+ outcome = await withDeadline(planAction(e.session.page(), e.snapshotSubstrate, e.refs, {
59
+ query: args.query,
60
+ verb: args.verb,
61
+ verbArgs: args.verbArgs,
62
+ contextRef: args.contextRef,
63
+ confidenceFloor: args.confidenceFloor,
64
+ ttlMs: args.ttlMs,
65
+ testAttributes: config.testAttributes,
66
+ fallbackHints: {
67
+ coords: caps.enabled.has("action"),
68
+ evalJs: caps.enabled.has("eval"),
69
+ },
70
+ }, e.session.cdp ? e.session.cdp() : undefined), cfgActionTimeout(), "plan");
71
+ }
72
+ catch (err) {
73
+ return {
74
+ content: [
75
+ {
76
+ type: "text",
77
+ text: JSON.stringify({ ok: false, error: err instanceof Error ? err.message : String(err) }, null, 2),
78
+ },
79
+ ],
80
+ };
81
+ }
82
+ // Egress sink — `plan().evidence` mirrors `find().evidence` (selectorHint
83
+ // / role / name) which IS masked. Match the find-handler's pattern so
84
+ // a planned descriptor's evidence doesn't leak a registered real-value
85
+ // that find() would have masked. Routes through the injected chokepoint
86
+ // (RFC 0004 P3 / D4): `egressFor(e).maskDeep(outcome)` is byte-identical
87
+ // to `caps.enabled.has("secrets") ? e.secrets.applyMaskDeep(outcome) : outcome`.
88
+ const maskedPlan = egressFor(e).maskDeep(outcome);
89
+ return { content: [{ type: "text", text: JSON.stringify(maskedPlan, null, 2) }] };
90
+ });
91
+ register("execute", {
92
+ capability: "action",
93
+ batchable: true,
94
+ description: 'Dispatch a previously-planned `ActionDescriptor` (from `plan`). Re-resolves the bound ref via the same stable-key scheme snapshot/find use; refuses with structured `reason:"expired"` past `expiresAt`, or `reason:"ref-gone"` when the ref is no longer in the session\'s registry — in both cases NO action runs, re-plan against the current snapshot. The underlying action verb\'s capability is enforced (a descriptor with verb:"click" still requires the `action` capability); a successful dispatch returns the same `ActionResult` shape as calling the verb\'s tool directly.',
95
+ inputSchema: {
96
+ descriptor: z
97
+ .object({
98
+ id: z.string(),
99
+ ref: z.string(),
100
+ verb: z.enum(PLAN_VERBS),
101
+ args: z.record(z.unknown()).optional(),
102
+ evidence: z.record(z.unknown()).optional(),
103
+ expiresAt: z.number(),
104
+ })
105
+ .passthrough()
106
+ .describe("The `ActionDescriptor` returned by `plan` — pass it back verbatim."),
107
+ ...ACTION_OPTS,
108
+ },
109
+ }, async (args) => {
110
+ const g = gateCheck("execute");
111
+ if (g)
112
+ return g;
113
+ // Surface the *underlying* verb's capability — a descriptor with
114
+ // verb:"click" denied for `action` should report `click` denied, not
115
+ // a generic "execute denied". The verb is parsed off the descriptor
116
+ // before the gate to keep the error attribution clean.
117
+ const verb = args.descriptor.verb;
118
+ if (verb) {
119
+ const vg = gateCheck(verb);
120
+ if (vg)
121
+ return vg;
122
+ }
123
+ const e = await entryFor(args.session);
124
+ // The descriptor's verb is also subject to the same confirm-hook
125
+ // policy as a direct call to that verb — a `byob_action` policy that
126
+ // blocks `click` also blocks an `execute` of a click descriptor.
127
+ if (verb) {
128
+ const c = await confirmByobAction(verb, confirmCtxFor(e));
129
+ if (!c.ok)
130
+ return denyContent(`execute(${verb})`, c);
131
+ }
132
+ const td = actionTimeout(args);
133
+ // Compute the recordingHint off the descriptor's bound ref (same
134
+ // shape `click` / `fill` build it).
135
+ const ref = args.descriptor.ref;
136
+ const recordingHint = ref ? hintFromTarget(e, { ref }) : undefined;
137
+ let outcome;
138
+ try {
139
+ outcome = await executeAction(ctxFor(e), args.descriptor, {
140
+ mode: args.mode,
141
+ maxResultTokens: args.maxResultTokens,
142
+ deadlineMs: td.ms,
143
+ deadlineWarning: td.warning,
144
+ recordingHint,
145
+ });
146
+ }
147
+ catch (err) {
148
+ return {
149
+ content: [
150
+ {
151
+ type: "text",
152
+ text: JSON.stringify({ ok: false, error: err instanceof Error ? err.message : String(err) }, null, 2),
153
+ },
154
+ ],
155
+ };
156
+ }
157
+ return { content: [{ type: "text", text: JSON.stringify(outcome, null, 2) }] };
158
+ });
159
+ }
@@ -0,0 +1,8 @@
1
+ import type { RegisterHost, GateHost, SessionHost, ServerServicesHost } from "./host.js";
2
+ /**
3
+ * Recording-mode tools: `start_recording` / `end_recording` / `record_annotate`.
4
+ * Capture subsequent action tool calls as a draft flow-file. Split out of
5
+ * `forms-recording-tools` (RFC 0004 P3 / D3 SRP); registered through the shared
6
+ * `ToolHost` seam in the same source order.
7
+ */
8
+ export declare function registerFormsRecordingModeTools(host: RegisterHost & GateHost & SessionHost & ServerServicesHost): void;
@@ -0,0 +1,71 @@
1
+ import { SESSION_ARG } from "./schemas.js";
2
+ /**
3
+ * Recording-mode tools: `start_recording` / `end_recording` / `record_annotate`.
4
+ * Capture subsequent action tool calls as a draft flow-file. Split out of
5
+ * `forms-recording-tools` (RFC 0004 P3 / D3 SRP); registered through the shared
6
+ * `ToolHost` seam in the same source order.
7
+ */
8
+ export function registerFormsRecordingModeTools(host) {
9
+ const { z, register, gateCheck, entryFor } = host;
10
+ // ---------- recording mode () ----------
11
+ register("start_recording", {
12
+ capability: "human",
13
+ description: "Begin recording subsequent action tool calls as a draft flow-file. Every successful navigate/click/fill/press/hover/select/wait_for adds a step (with the resolved selectorHint when a target was given). Call `end_recording` to emit a YAML draft. `record_annotate` attaches annotations to the most-recent step. Calibration-walk → flow-file scaffolding.",
14
+ inputSchema: {
15
+ flowName: z.string().describe('Name of the flow being recorded, e.g. "login-and-search"'),
16
+ ...SESSION_ARG,
17
+ },
18
+ }, async ({ flowName, session }) => {
19
+ const g = gateCheck("start_recording");
20
+ if (g)
21
+ return g;
22
+ const r = (await entryFor(session)).recorder.start(flowName);
23
+ return { content: [{ type: "text", text: JSON.stringify(r, null, 2) }] };
24
+ });
25
+ register("end_recording", {
26
+ capability: "human",
27
+ description: "Stop the current recording and emit the draft flow-file YAML. Returns `{ name, yaml, stepCount }`. Review the locators block (entries flagged `stability: medium|low` deserve a second look) and add prerequisites/assertions before committing the flow into a site-docs workspace.",
28
+ inputSchema: { ...SESSION_ARG },
29
+ }, async ({ session }) => {
30
+ const g = gateCheck("end_recording");
31
+ if (g)
32
+ return g;
33
+ try {
34
+ const r = (await entryFor(session)).recorder.end();
35
+ return { content: [{ type: "text", text: JSON.stringify(r, null, 2) }] };
36
+ }
37
+ catch (e) {
38
+ return {
39
+ content: [
40
+ {
41
+ type: "text",
42
+ text: JSON.stringify({ ok: false, error: e instanceof Error ? e.message : String(e) }, null, 2),
43
+ },
44
+ ],
45
+ };
46
+ }
47
+ });
48
+ register("record_annotate", {
49
+ capability: "human",
50
+ description: "Attach a doc annotation (copy + optional arrow position + optional target ref) to the most-recent recorded step, or to a specific `stepId`. No-op if no recording is active.",
51
+ inputSchema: {
52
+ copy: z.string().describe("Annotation copy"),
53
+ arrow: z
54
+ .string()
55
+ .optional()
56
+ .describe("Arrow position hint (top|top-left|left|bottom-right|...)"),
57
+ target: z
58
+ .string()
59
+ .optional()
60
+ .describe("Ref to anchor the annotation to (overrides the step's default)"),
61
+ stepId: z.string().optional().describe("Annotate a specific step; default = most-recent"),
62
+ ...SESSION_ARG,
63
+ },
64
+ }, async ({ copy, arrow, target, stepId, session }) => {
65
+ const g = gateCheck("record_annotate");
66
+ if (g)
67
+ return g;
68
+ const r = (await entryFor(session)).recorder.annotate({ stepId, copy, arrow, target });
69
+ return { content: [{ type: "text", text: JSON.stringify(r, null, 2) }] };
70
+ });
71
+ }
@@ -0,0 +1,14 @@
1
+ import type { ToolHost } from "./host.js";
2
+ /**
3
+ * Form-fill, plan/execute, recording, named-ref, and find-feedback tools:
4
+ * fill_form / plan / execute / start_recording / end_recording /
5
+ * record_annotate / name_ref / list_named_refs / find_feedback.
6
+ *
7
+ * RFC 0004 P3 / D3 (SRP): the registrations were split by cohesive family into
8
+ * four sibling modules (fill / plan-execute / recording-mode / refs). This module
9
+ * stays the single entry point `server.ts` + `tool-metadata.ts` call, and invokes
10
+ * each family in the EXACT prior source order so the registered-name set + the
11
+ * derived maps stay byte-identical. The host owns the closures (gate, confirm,
12
+ * ports); the family modules own the registrations.
13
+ */
14
+ export declare function registerFormsRecordingTools(host: ToolHost): void;
@@ -0,0 +1,22 @@
1
+ import { registerFormsFillTools } from "./forms-fill-tools.js";
2
+ import { registerFormsPlanTools } from "./forms-plan-tools.js";
3
+ import { registerFormsRecordingModeTools } from "./forms-recording-mode-tools.js";
4
+ import { registerFormsRefsTools } from "./forms-refs-tools.js";
5
+ /**
6
+ * Form-fill, plan/execute, recording, named-ref, and find-feedback tools:
7
+ * fill_form / plan / execute / start_recording / end_recording /
8
+ * record_annotate / name_ref / list_named_refs / find_feedback.
9
+ *
10
+ * RFC 0004 P3 / D3 (SRP): the registrations were split by cohesive family into
11
+ * four sibling modules (fill / plan-execute / recording-mode / refs). This module
12
+ * stays the single entry point `server.ts` + `tool-metadata.ts` call, and invokes
13
+ * each family in the EXACT prior source order so the registered-name set + the
14
+ * derived maps stay byte-identical. The host owns the closures (gate, confirm,
15
+ * ports); the family modules own the registrations.
16
+ */
17
+ export function registerFormsRecordingTools(host) {
18
+ registerFormsFillTools(host);
19
+ registerFormsPlanTools(host);
20
+ registerFormsRecordingModeTools(host);
21
+ registerFormsRefsTools(host);
22
+ }
@@ -0,0 +1,8 @@
1
+ import type { RegisterHost, GateHost, SessionHost, ServerServicesHost } from "./host.js";
2
+ /**
3
+ * Named-ref + learned-find-ranking tools: `name_ref` / `list_named_refs` /
4
+ * `find_feedback`. Bind mnemonics to refs and feed the per-session find() ranker.
5
+ * Split out of `forms-recording-tools` (RFC 0004 P3 / D3 SRP); registered through
6
+ * the shared `ToolHost` seam in the same source order.
7
+ */
8
+ export declare function registerFormsRefsTools(host: RegisterHost & GateHost & SessionHost & ServerServicesHost): void;
@@ -0,0 +1,90 @@
1
+ import { SESSION_ARG } from "./schemas.js";
2
+ /**
3
+ * Named-ref + learned-find-ranking tools: `name_ref` / `list_named_refs` /
4
+ * `find_feedback`. Bind mnemonics to refs and feed the per-session find() ranker.
5
+ * Split out of `forms-recording-tools` (RFC 0004 P3 / D3 SRP); registered through
6
+ * the shared `ToolHost` seam in the same source order.
7
+ */
8
+ export function registerFormsRefsTools(host) {
9
+ const { z, register, gateCheck, entryFor } = host;
10
+ // ---------- named refs () ----------
11
+ register("name_ref", {
12
+ capability: "human",
13
+ batchable: true,
14
+ description: 'Bind a mnemonic name to a ref. Subsequent action tools accept `named: "<name>"` in place of `ref` / `selector`. Refs are stable across snapshots (by element-key), so the binding survives navigation as long as the element persists. Carry session-wide anchor sets without remembering the bare `eN`s.',
15
+ inputSchema: {
16
+ name: z.string().describe('Mnemonic (e.g. "main_tab", "library_tab")'),
17
+ ref: z.string().describe("The ref to bind to this name"),
18
+ ...SESSION_ARG,
19
+ },
20
+ }, async ({ name, ref, session }) => {
21
+ const g = gateCheck("name_ref");
22
+ if (g)
23
+ return g;
24
+ (await entryFor(session)).refs.nameRef(name, ref);
25
+ return {
26
+ content: [{ type: "text", text: JSON.stringify({ ok: true, name, ref }, null, 2) }],
27
+ };
28
+ });
29
+ register("list_named_refs", {
30
+ capability: "read",
31
+ batchable: true,
32
+ description: "List all current name → ref bindings created via name_ref.",
33
+ inputSchema: { ...SESSION_ARG },
34
+ }, async ({ session }) => {
35
+ const g = gateCheck("list_named_refs");
36
+ if (g)
37
+ return g;
38
+ return {
39
+ content: [
40
+ {
41
+ type: "text",
42
+ text: JSON.stringify((await entryFor(session)).refs.listNames(), null, 2),
43
+ },
44
+ ],
45
+ };
46
+ });
47
+ // ---------- learned find() ranking ----------
48
+ register("find_feedback", {
49
+ capability: "human",
50
+ batchable: true,
51
+ description: "Tell browxai which candidate was the right answer to a prior `find(query)`. Subsequent finds whose query overlaps the token set will boost candidates matching this winner's identity (testId, or role+name). Session-scoped, in-memory, capped at 100 entries with LRU eviction. The learning is intentionally simple — a 'don't re-do that mistake' signal, not an ML model.",
52
+ inputSchema: {
53
+ query: z
54
+ .string()
55
+ .describe("The query you previously passed to find() (or a paraphrase — token overlap is what matters)"),
56
+ ref: z.string().describe("The ref the agent ended up acting on (the right candidate)"),
57
+ ...SESSION_ARG,
58
+ },
59
+ }, async ({ query, ref, session }) => {
60
+ const g = gateCheck("find_feedback");
61
+ if (g)
62
+ return g;
63
+ const e = await entryFor(session);
64
+ const inputs = e.refs.locatorOf(ref);
65
+ if (!inputs) {
66
+ return {
67
+ content: [
68
+ {
69
+ type: "text",
70
+ text: JSON.stringify({ ok: false, error: `ref "${ref}" not in the registry` }, null, 2),
71
+ },
72
+ ],
73
+ };
74
+ }
75
+ e.feedback.record(query, {
76
+ testId: inputs.testId,
77
+ testIdAttr: inputs.testIdAttr,
78
+ role: inputs.role,
79
+ name: inputs.name,
80
+ });
81
+ return {
82
+ content: [
83
+ {
84
+ type: "text",
85
+ text: JSON.stringify({ ok: true, recorded: { query, identity: inputs }, memorySize: e.feedback.size() }, null, 2),
86
+ },
87
+ ],
88
+ };
89
+ });
90
+ }
@@ -0,0 +1,8 @@
1
+ import type { RegisterHost, GateHost, SessionHost, ActionHost, ServerServicesHost } from "./host.js";
2
+ /**
3
+ * Coordinate-space gesture tools: mouse_wheel / gesture_pinch / gesture_swipe.
4
+ * CDP-deep touch/wheel primitives dispatched at viewport coords. Split out of
5
+ * `gesture-network-tools` by cohesive family (RFC 0004 P3 / D3 SRP); registered
6
+ * through the shared `ToolHost` seam in the same source order.
7
+ */
8
+ export declare function registerGestureCoordTools(host: RegisterHost & GateHost & SessionHost & ActionHost & ServerServicesHost): void;
@@ -0,0 +1,168 @@
1
+ import { withDeadline } from "../util/deadline.js";
2
+ import { estimateTokens } from "../util/tokens.js";
3
+ import { mouseWheel, gesturePinch, gestureSwipe } from "../page/gestures.js";
4
+ import { requireCdp } from "../engine/session-cdp.js";
5
+ import { SESSION_ARG } from "./schemas.js";
6
+ /**
7
+ * Coordinate-space gesture tools: mouse_wheel / gesture_pinch / gesture_swipe.
8
+ * CDP-deep touch/wheel primitives dispatched at viewport coords. Split out of
9
+ * `gesture-network-tools` by cohesive family (RFC 0004 P3 / D3 SRP); registered
10
+ * through the shared `ToolHost` seam in the same source order.
11
+ */
12
+ export function registerGestureCoordTools(host) {
13
+ const { z, register, gateCheck, engineGate, entryFor, cfgActionTimeout } = host;
14
+ register("mouse_wheel", {
15
+ capability: "action",
16
+ deep: true,
17
+ description: "Coordinate-space wheel event — dispatched via CDP at `coords` (viewport CSS px) regardless of the current pointer position. For canvas, virtualised lists, and map tiles that listen for `wheel` and ignore element-level scroll. `deltaX`/`deltaY` are CSS px (DOM `WheelEvent` convention: positive `deltaY` scrolls content up); at least one must be non-zero.",
18
+ inputSchema: {
19
+ coords: z
20
+ .object({ x: z.number(), y: z.number() })
21
+ .describe("Viewport CSS px — where the wheel event fires."),
22
+ deltaX: z.number().optional().describe("Horizontal wheel delta in CSS px (default 0)."),
23
+ deltaY: z.number().optional().describe("Vertical wheel delta in CSS px (default 0)."),
24
+ ...SESSION_ARG,
25
+ },
26
+ }, async ({ coords, deltaX, deltaY, session }) => {
27
+ const g = gateCheck("mouse_wheel");
28
+ if (g)
29
+ return g;
30
+ const e = await entryFor(session);
31
+ const eg = engineGate("mouse_wheel", e);
32
+ if (eg)
33
+ return eg;
34
+ try {
35
+ const r = await withDeadline(mouseWheel(requireCdp(e.session), { coords, deltaX, deltaY }), cfgActionTimeout(), "mouse_wheel");
36
+ return { content: [{ type: "text", text: JSON.stringify(r, null, 2) }] };
37
+ }
38
+ catch (err) {
39
+ return {
40
+ content: [
41
+ {
42
+ type: "text",
43
+ text: JSON.stringify({ ok: false, error: err instanceof Error ? err.message : String(err) }, null, 2),
44
+ },
45
+ ],
46
+ };
47
+ }
48
+ });
49
+ register("gesture_pinch", {
50
+ capability: "action",
51
+ deep: true,
52
+ description: "Two-finger pinch in/out centred on `coords`. Two touch points start at `coords ± startOffset` (default 40 CSS px) and converge or diverge linearly so the final separation = `startOffset × scale`. `scale < 1` is pinch-in (zoom out); `scale > 1` is pinch-out (zoom in). Linear interpolation across `steps` (default 12, clamped 1–100) — pinch handlers read inter-frame deltas; a velocity-detecting curve can misfire fling heuristics, linear is the safe default. Dispatches via CDP touch pipeline; touch does not fire mouse events automatically.",
53
+ inputSchema: {
54
+ coords: z
55
+ .object({ x: z.number(), y: z.number() })
56
+ .describe("Pinch centre, viewport CSS px."),
57
+ scale: z
58
+ .number()
59
+ .positive()
60
+ .describe("Final separation / initial separation. <1 = pinch-in (zoom out); >1 = pinch-out (zoom in)."),
61
+ steps: z
62
+ .number()
63
+ .int()
64
+ .positive()
65
+ .max(100)
66
+ .optional()
67
+ .describe("Intermediate touchMove dispatches (default 12)."),
68
+ startOffset: z
69
+ .number()
70
+ .positive()
71
+ .optional()
72
+ .describe("Initial half-separation in CSS px (default 40)."),
73
+ ...SESSION_ARG,
74
+ },
75
+ }, async ({ coords, scale, steps, startOffset, session }) => {
76
+ const g = gateCheck("gesture_pinch");
77
+ if (g)
78
+ return g;
79
+ const e = await entryFor(session);
80
+ const eg = engineGate("gesture_pinch", e);
81
+ if (eg)
82
+ return eg;
83
+ try {
84
+ const r = await withDeadline(gesturePinch(requireCdp(e.session), { coords, scale, steps, startOffset }), cfgActionTimeout(), "gesture_pinch");
85
+ const json = JSON.stringify(r);
86
+ return {
87
+ content: [
88
+ {
89
+ type: "text",
90
+ text: JSON.stringify({ ...r, tokensEstimate: estimateTokens(json) }, null, 2),
91
+ },
92
+ ],
93
+ };
94
+ }
95
+ catch (err) {
96
+ const body = { ok: false, error: err instanceof Error ? err.message : String(err) };
97
+ return {
98
+ content: [
99
+ {
100
+ type: "text",
101
+ text: JSON.stringify({ ...body, tokensEstimate: estimateTokens(JSON.stringify(body)) }, null, 2),
102
+ },
103
+ ],
104
+ };
105
+ }
106
+ });
107
+ register("gesture_swipe", {
108
+ capability: "action",
109
+ deep: true,
110
+ description: "Single-finger swipe from `from` to `to` via the touch pipeline. Distinct from `drag` (mouse pipeline) — mobile carousels, pull-to-refresh, swipeable list items wire touch handlers that ignore mouse events. `durationMs` (default 200 — fast flick; 500+ reads as deliberate scroll) is split across `steps` (default 16, clamped 1–200) touchMove dispatches. Smoothed via an ease-out curve (`1 - (1 - t)²`) — matches the natural deceleration most fling-detect heuristics are tuned for (Hammer.js, native scroll inertia, react-spring physics).",
111
+ inputSchema: {
112
+ from: z.object({ x: z.number(), y: z.number() }).describe("Swipe start, viewport CSS px."),
113
+ to: z.object({ x: z.number(), y: z.number() }).describe("Swipe end, viewport CSS px."),
114
+ durationMs: z
115
+ .number()
116
+ .int()
117
+ .nonnegative()
118
+ .max(60_000)
119
+ .optional()
120
+ .describe("Total swipe duration in ms (default 200)."),
121
+ steps: z
122
+ .number()
123
+ .int()
124
+ .positive()
125
+ .max(200)
126
+ .optional()
127
+ .describe("Intermediate touchMove dispatches (default 16)."),
128
+ identifier: z
129
+ .number()
130
+ .int()
131
+ .nonnegative()
132
+ .optional()
133
+ .describe("Touch identifier (default 1)."),
134
+ ...SESSION_ARG,
135
+ },
136
+ }, async ({ from, to, durationMs, steps, identifier, session }) => {
137
+ const g = gateCheck("gesture_swipe");
138
+ if (g)
139
+ return g;
140
+ const e = await entryFor(session);
141
+ const eg = engineGate("gesture_swipe", e);
142
+ if (eg)
143
+ return eg;
144
+ try {
145
+ const r = await withDeadline(gestureSwipe(requireCdp(e.session), { from, to, durationMs, steps, identifier }), cfgActionTimeout(), "gesture_swipe");
146
+ const json = JSON.stringify(r);
147
+ return {
148
+ content: [
149
+ {
150
+ type: "text",
151
+ text: JSON.stringify({ ...r, tokensEstimate: estimateTokens(json) }, null, 2),
152
+ },
153
+ ],
154
+ };
155
+ }
156
+ catch (err) {
157
+ const body = { ok: false, error: err instanceof Error ? err.message : String(err) };
158
+ return {
159
+ content: [
160
+ {
161
+ type: "text",
162
+ text: JSON.stringify({ ...body, tokensEstimate: estimateTokens(JSON.stringify(body)) }, null, 2),
163
+ },
164
+ ],
165
+ };
166
+ }
167
+ });
168
+ }
@@ -0,0 +1,8 @@
1
+ import type { RegisterHost, GateHost, SessionHost, ActionHost, ServerServicesHost } from "./host.js";
2
+ /**
3
+ * Live network/CPU emulation tools: network_emulate / cpu_emulate — CDP-deep
4
+ * throttle/offline + CPU slowdown for low-end-device repros. Split out of
5
+ * `gesture-network-tools` by cohesive family (RFC 0004 P3 / D3 SRP); registered
6
+ * through the shared `ToolHost` seam in the same source order.
7
+ */
8
+ export declare function registerGestureEmulationTools(host: RegisterHost & GateHost & SessionHost & ActionHost & ServerServicesHost): void;