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,504 @@
1
+ export type Capability = "read" | "navigation" | "action" | "human" | "eval" | "byob-attach" | "file-io" | "network-body" | "clipboard" | "secrets" | "extensions" | "stealth" | "captcha" | "credentials" | "device-emulation" | "diagnostics" | "canvas";
2
+ export declare const ALL_CAPABILITIES: readonly Capability[];
3
+ export declare const DEFAULT_CAPABILITIES: readonly Capability[];
4
+ /**
5
+ * Capabilities that USED to be valid and have since been retired. A retired
6
+ * capability is still ACCEPTED in `BROWX_CAPABILITIES` (and the `capabilities`
7
+ * config key) — it is ignored with a deprecation warning, never an error — so
8
+ * evolving the capability set can't crash an existing adopter's config.
9
+ * Genuine typos (a name that was never a capability) are still rejected loudly.
10
+ * A retired entry may be dropped entirely only in a major version bump.
11
+ * See the "API evolution" rule in CLAUDE.md.
12
+ *
13
+ * The value is the agent/operator-facing reason + what to do instead.
14
+ */
15
+ export declare const RETIRED_CAPABILITIES: Readonly<Record<string, string>>;
16
+ /** Record one tool's capability assignment from its colocated
17
+ * `host.register({ capability })` metadata (RFC 0004 P2). Idempotent for an
18
+ * identical re-declaration; a *conflicting* one throws (two registrations cannot
19
+ * disagree on one tool's gate). The only writer of the derived map. */
20
+ export declare function declareToolCapability(tool: string, capability: Capability): void;
21
+ export declare function installToolMetadataCollector(collect: () => void): void;
22
+ /** The derived tool→capability map. Reading drives the lazy collection so the
23
+ * rows declared at registration are present for a standalone caller, then
24
+ * asserts the gate is bootstrapped (fail-safe — never returns an empty
25
+ * un-gated map to a consumer). */
26
+ export declare function toolCapabilityMap(): ReadonlyMap<string, Capability>;
27
+ /** Back-compat `Record` view of the derived map for the consumers that index it
28
+ * by name (`TOOL_CAPABILITY[tool]`). A `Proxy` so a read both triggers the lazy
29
+ * collection and reflects any registration that ran after a prior read. Every
30
+ * access path that resolves a capability (the by-name `get`, the membership
31
+ * `has`, key enumeration, and the D2 `Symbol.iterator` Map-parity iterator)
32
+ * runs the D1 fail-safe — the gate never answers from an empty unbootstrapped
33
+ * map. */
34
+ export declare const TOOL_CAPABILITY: Record<string, Capability>;
35
+ /**
36
+ * The pre-P2 hand-maintained assignment block, retained verbatim BELOW as a
37
+ * documentation appendix — the threat-model rationale for each tool's capability
38
+ * is preserved next to the vocabulary, even though the live assignment now lives
39
+ * at each `host.register({ capability })` call. This block is comment-only; it
40
+ * declares nothing. (Reference — not the source of truth.)
41
+ *
42
+ * /**
43
+ * * Map each MCP tool name to the capability that governs it. A tool not in this map
44
+ * * is treated as `human` (coordination primitive, always safe). The categories match
45
+ * * `docs/threat-model.md` "The capability set".
46
+ * * /
47
+ * export const TOOL_CAPABILITY: Record<string, Capability> = {
48
+ * // read
49
+ * snapshot: "read",
50
+ * find: "read",
51
+ * // frame discovery (lists frame tree with stable IDs). Pure-read;
52
+ * // extends `read` so no new capability gate.
53
+ * frames_list: "read",
54
+ * screenshot: "read",
55
+ * console_read: "read",
56
+ * network_read: "read",
57
+ * ws_read: "read",
58
+ * inspect: "read",
59
+ * // Page-wide overflow scan — generalises `inspect`'s per-element overflow
60
+ * // check into a typed multi-detector pass. Pure-read; no new capability.
61
+ * overflow_detect: "read",
62
+ * point_probe: "read",
63
+ * watch: "read",
64
+ * sample: "read",
65
+ * // act_and_sample: the sampler half is `read`; the inner action's own
66
+ * // capability is enforced separately via gateCheck(action.tool) at runtime.
67
+ * act_and_sample: "read",
68
+ * list_named_refs: "read",
69
+ * // Bridge from a session-internal `eN` ref to a Playwright-string locator
70
+ * // expression an adopter can paste into a `.spec.ts`. Pure-read: looks the
71
+ * // ref up in the existing registry, emits a string + structured breakdown.
72
+ * generate_locator: "read",
73
+ * text_search: "read",
74
+ * // read-only introspection of Shadow DOM trees under a given
75
+ * // host ref (or the document root). Open-shadow walk runs as a
76
+ * // Runtime.evaluate; closed-shadow walk uses CDP DOM.getDocument({pierce:
77
+ * // true}). Best-effort — when CDP refuses the pierce call, returns the
78
+ * // open-only view plus a warning. Read-only, same posture as `snapshot`
79
+ * // / `find` — under `read`. No new capability.
80
+ * shadow_trees: "read",
81
+ * // Structured schema-driven data extraction. Read-only; no new
82
+ * // capability (the deterministic mode is selector-only).
83
+ * extract: "read",
84
+ * // verify-family — assertive read primitives (fail-emitting siblings of
85
+ * // wait_for). Read-only — no `eval` capability gate. `verify_predicate` is
86
+ * // intentionally NOT an arbitrary-JS path; its vocabulary is fixed enum +
87
+ * // allow-listed accessor keys, server-evaluated. See src/util/predicates.ts.
88
+ * verify_visible: "read",
89
+ * verify_text: "read",
90
+ * verify_value: "read",
91
+ * verify_count: "read",
92
+ * verify_attribute: "read",
93
+ * verify_predicate: "read",
94
+ * // navigation
95
+ * navigate: "navigation",
96
+ * go_back: "navigation",
97
+ * go_forward: "navigation",
98
+ * scroll: "navigation",
99
+ * set_viewport: "navigation",
100
+ * tab_visibility: "navigation",
101
+ * // action
102
+ * click: "action",
103
+ * fill: "action",
104
+ * press: "action",
105
+ * shortcut: "action",
106
+ * hover: "action",
107
+ * select: "action",
108
+ * choose_option: "action",
109
+ * fill_form: "action",
110
+ * wait_for: "action",
111
+ * // `plan` resolves an NL query to a bound ActionDescriptor without
112
+ * // dispatching — semantically a read-then-bind primitive over `find()`.
113
+ * // `execute` dispatches a previously-planned descriptor; its handler
114
+ * // additionally enforces the underlying verb's capability (so e.g. a
115
+ * // descriptor with verb:"click" still requires `action`).
116
+ * plan: "read",
117
+ * execute: "action",
118
+ * // human
119
+ * await_human: "human",
120
+ * name_ref: "human",
121
+ * start_recording: "human",
122
+ * end_recording: "human",
123
+ * record_annotate: "human",
124
+ * find_feedback: "human",
125
+ * // eval
126
+ * eval_js: "eval",
127
+ * poll_eval: "eval", // repeatedly evaluates page JS — same posture as eval_js
128
+ * // The tools below were promoted from the experimental lane (formerly the
129
+ * // off-by-default `unstable` capability) into the stable surface: each now
130
+ * // sits under its natural capability — gestures/route mocking are `action`,
131
+ * // the compound act-and-observe tools are `read` (the inner action's own
132
+ * // capability is still gate-checked separately), region bind/resolve +
133
+ * // profile snapshot/restore are `human` coordination.
134
+ * drag: "action",
135
+ * double_click: "action",
136
+ * // per-session dialog policy mutator. Registers under `action` (it changes
137
+ * // how subsequent actions respond to alert/confirm/prompt fires — a
138
+ * // session-state knob, not a capability of its own).
139
+ * set_dialog_policy: "action",
140
+ * // per-session permission policy mutator. Sibling of `set_dialog_policy`:
141
+ * // governs camera/microphone/geolocation/clipboard/notification/sensor
142
+ * // permission requests fired from the page. Registers under `action` — no
143
+ * // new capability gate. The posture matches `grant_permissions` (same kind
144
+ * // of mutation) but the policy shape (allow/deny/raise/ask-human, per-
145
+ * // permission overrides) is richer; `grant_permissions` remains the
146
+ * // bulk-grant shortcut for `permission_policy({mode:"allow"})`.
147
+ * set_permission_policy: "action",
148
+ * // read-side companion to set_permission_policy: surfaces the current
149
+ * // CDP-reported state per permission (granted/denied/prompt). Same
150
+ * // posture as `console_read` / `network_read`.
151
+ * permission_state: "read",
152
+ * // per-session notification-construction policy mutator. Sibling of
153
+ * // `set_permission_policy`: governs `new Notification(...)` constructor
154
+ * // calls (distinct from the permission check, which lives in
155
+ * // permission_policy). Registers under `action` — no new capability.
156
+ * set_notification_policy: "action",
157
+ * // per-session File System Access picker policy mutator. Sibling of
158
+ * // `set_dialog_policy` / `set_permission_policy`: governs
159
+ * // `showOpenFilePicker` / `showSaveFilePicker` / `showDirectoryPicker`
160
+ * // calls from the page. Registers under `action` — same posture as
161
+ * // the other policy mutators (mid-session state knob, not a capability
162
+ * // of its own).
163
+ * set_fs_picker_policy: "action",
164
+ * // companion to `set_fs_picker_policy` — stages agent-supplied files
165
+ * // for the page-side stubs to return in `allow` mode. The save-picker
166
+ * // path writes through to a workspace-rooted destination via the page
167
+ * // stream; the open-picker path reads source bytes from a workspace-
168
+ * // rooted path at respond-time. Under `file-io` — same posture as
169
+ * // `upload_file` (workspace-rooted egress on writes; workspace-rooted
170
+ * // ingress on reads).
171
+ * fs_picker_respond: "file-io",
172
+ * mouse_down: "action",
173
+ * mouse_move: "action",
174
+ * mouse_up: "action",
175
+ * mouse_wheel: "action",
176
+ * // Touch + multi-touch gesture pipeline. Separate CDP dispatch path from
177
+ * // the mouse_* family — extends `action`, no new capability.
178
+ * touch_start: "action",
179
+ * touch_move: "action",
180
+ * touch_end: "action",
181
+ * gesture_pinch: "action",
182
+ * gesture_swipe: "action",
183
+ * route: "action",
184
+ * route_queue: "action",
185
+ * unroute: "action",
186
+ * // Interactive WebSocket primitives — mutate live realtime traffic
187
+ * // (`ws_send` injects a frame on a page-side socket; `ws_intercept` rewrites
188
+ * // inbound frames before they hit app handlers). Sibling of the HTTP `route`
189
+ * // family on the WS channel — same `action` posture; no new capability gate.
190
+ * ws_send: "action",
191
+ * ws_intercept: "action",
192
+ * ws_unintercept: "action",
193
+ * network_emulate: "action",
194
+ * cpu_emulate: "action",
195
+ * clock: "action",
196
+ * seed_random: "action",
197
+ * // Performance tracing (CDP `Tracing.start` / `Tracing.end` + structured
198
+ * // insights extraction). `perf_start` arms collection on the target;
199
+ * // `perf_stop` flushes to a workspace-rooted trace file; `perf_insights`
200
+ * // reads a written trace and returns the structured summary. All three are
201
+ * // `action` — they mutate target state (tracing on/off) and `perf_stop`
202
+ * // writes a file. No new capability is introduced.
203
+ * perf_start: "action",
204
+ * perf_stop: "action",
205
+ * perf_insights: "action",
206
+ * // perf module additions. `perf_audit` and `coverage_stop` are
207
+ * // `read` — non-mutating observation/composition over the trace + coverage
208
+ * // they collected. `coverage_start` is `action` (arms CDP state on the
209
+ * // target). `layout_thrash_trace` and `memory_diff` are `read` — focused
210
+ * // trace observation + pure file-diff, no further mutation.
211
+ * perf_audit: "read",
212
+ * coverage_start: "action",
213
+ * coverage_stop: "read",
214
+ * layout_thrash_trace: "read",
215
+ * memory_diff: "read",
216
+ * // V8 heap snapshots (CDP `HeapProfiler.takeHeapSnapshot` + in-process
217
+ * // retainer query over the `.heapsnapshot` JSON). `heap_snapshot` writes
218
+ * // a workspace-rooted file; `heap_retainers` reads one and reports who
219
+ * // holds objects matching a name/type query. Both are `action` —
220
+ * // `heap_snapshot` writes a file, and `heap_retainers` is a sibling
221
+ * // tool kept under the same capability so a memory-diagnosis batch
222
+ * // doesn't need to juggle two grants.
223
+ * heap_snapshot: "action",
224
+ * heap_retainers: "action",
225
+ * // Per-primitive device emulation (locale, timezone, geolocation, colour
226
+ * // scheme, reduced motion, user-agent, permissions). Each mutates one
227
+ * // Playwright/CDP emulation knob on the live session; under `action`
228
+ * // (mid-session state mutation, sibling to `set_viewport` which is under
229
+ * // `navigation`). Splitting them as 7 siblings — not a bundled
230
+ * // `emulate({…})` — lets agents set just what they need.
231
+ * set_locale: "action",
232
+ * set_timezone: "action",
233
+ * set_geolocation: "action",
234
+ * set_color_scheme: "action",
235
+ * set_reduced_motion: "action",
236
+ * set_user_agent: "action",
237
+ * grant_permissions: "action",
238
+ * act_and_diff: "read",
239
+ * act_and_wait_for_network: "read",
240
+ * // flake-check: dispatches the same batch payload N times to surface
241
+ * // intermittent failures + emit a cached-selector artifact. Posture is
242
+ * // `action` — unlike the act_and_* siblings (single inner action, sampled),
243
+ * // flake-check is purpose-built to repeatedly DISPATCH a sequence (each
244
+ * // inner call going through its own per-call gateCheck via the batch
245
+ * // handler map). Treating the outer primitive as `action` makes the intent
246
+ * // explicit at config-time: a `read`-only server should not be silently
247
+ * // re-running fills + clicks N times because someone wrapped them in
248
+ * // flake_check.
249
+ * flake_check: "action",
250
+ * cross_session_sample: "read",
251
+ * screenshot_region: "read",
252
+ * // Composed screenshot: paint numbered bounding boxes over caller-supplied
253
+ * // candidates and return the PNG + an index↔ref mapping. Pure compose on top
254
+ * // of existing primitives (no new browser interaction beyond a transient
255
+ * // in-page overlay) — `read`.
256
+ * screenshot_marks: "read",
257
+ * export_session_report: "read",
258
+ * // Sibling to `export_session_report`: rolls up the session's cumulative
259
+ * // tool-call metrics (counts, latency, tokensEstimate sum, capability denials,
260
+ * // per-tool errors). Read-only — accumulates dispatch envelope data the server
261
+ * // already has, no new side-effect.
262
+ * session_metrics: "read",
263
+ * // Trace-export sibling to `export_session_report`: lowers the session's
264
+ * // recorded action trace to a runnable `@playwright/test` spec file. Under
265
+ * // `read` — exports recorded state, dispatches no new action.
266
+ * export_playwright_script: "read",
267
+ * name_region: "human",
268
+ * region: "human",
269
+ * profile_snapshot: "human",
270
+ * profile_restore: "human",
271
+ * // network-body (off by default — full response bodies can carry PII / tokens)
272
+ * network_body: "network-body",
273
+ * // file-io
274
+ * upload_file: "file-io",
275
+ * // drop_files — sibling to `upload_file` for drop-zone uploaders (modern
276
+ * // SaaS file pickers that don't expose an `<input type=file>`). Same
277
+ * // posture: an in-page File construction reading bytes from disk
278
+ * // (`path` mode) or inline base64 (`contents` mode). Workspace-rooted
279
+ * // paths only. Under `file-io` (workspace-rooted egress + file-io IN).
280
+ * drop_files: "file-io",
281
+ * // Page archive — save current page as a self-contained artefact (directory
282
+ * // mode: index.html + assets/ sidecar; single-file mode: data:URI-inlined
283
+ * // HTML). Workspace-rooted output by construction. Under `file-io` (same
284
+ * // posture as `upload_file` / `downloads_capture`): an archive write is a
285
+ * // deliberate filesystem egress, not a routine action. See src/page/archive.ts.
286
+ * page_archive: "file-io",
287
+ * // Element export — save one element subtree (ref-targeted) as a
288
+ * // self-contained HTML snippet + CSS + linked resources. Same UNMASKED
289
+ * // posture as `page_archive`. Under `file-io` (workspace-rooted egress).
290
+ * element_export: "file-io",
291
+ * // Full DOM dump — `documentElement.outerHTML` or one-JSON-line-per-node
292
+ * // jsonl. Walks open shadow roots in jsonl mode; closed shadows are
293
+ * // platform-inaccessible. Under `file-io` (workspace-rooted egress).
294
+ * dom_export: "file-io",
295
+ * // Download capture — reverse of `upload_file`. `downloads_capture` toggles
296
+ * // per-session interception of Playwright `download` events; `download_get`
297
+ * // returns the captured bytes (or workspace-rooted path) for an id surfaced
298
+ * // on `ActionResult.downloads[]`. Same posture as `upload_file`: no new
299
+ * // capability, workspace-rooted paths only.
300
+ * downloads_capture: "file-io",
301
+ * download_get: "file-io",
302
+ * // Filter the session's network ring and persist matching responses to a
303
+ * // workspace-rooted dir. Same posture as `download_get` (read recent
304
+ * // session-state, write the resulting bytes under $BROWX_WORKSPACE) — no new
305
+ * // capability gate to enable.
306
+ * asset_export: "file-io",
307
+ * // Screenshot automation — periodic (`screenshot_schedule`) and event-driven
308
+ * // (`screenshot_on`) capture into a workspace-rooted directory. Same posture
309
+ * // as `screenshot({path})` / `page_archive`: the bytes hit disk, so both ride
310
+ * // the existing off-by-default `file-io` capability; no new gate.
311
+ * screenshot_schedule: "file-io",
312
+ * screenshot_on: "file-io",
313
+ * // PDF save — print the current page to a workspace-rooted PDF. Mirror of
314
+ * // `upload_file` (file-io OUT instead of IN), but under `action` not
315
+ * // `file-io`: the consequential write is to the *workspace* only (no
316
+ * // user-filesystem read like `upload_file`'s `path` mode), so it sits with
317
+ * // the other DOM-mutating / state-mutating writers. Refused on `attached`
318
+ * // sessions at the tool layer — see src/page/pdf.ts.
319
+ * pdf_save: "action",
320
+ * // Three-layer storage-state.
321
+ * // reads (`*_get`, `*_list`, `dump_storage_state`, `auth_list`) → `read`
322
+ * // writes (`*_set`, `*_delete`, `*_clear`,
323
+ * // `inject_storage_state`, `auth_save`, `auth_load`,
324
+ * // `auth_delete`) → `action`
325
+ * // No new capability gate — these reuse the existing read/action posture so
326
+ * // an existing capability config doesn't need editing to use them.
327
+ * dump_storage_state: "read",
328
+ * inject_storage_state: "action",
329
+ * cookies_get: "read",
330
+ * cookies_list: "read",
331
+ * cookies_set: "action",
332
+ * cookies_delete: "action",
333
+ * cookies_clear: "action",
334
+ * localstorage_get: "read",
335
+ * localstorage_list: "read",
336
+ * localstorage_set: "action",
337
+ * localstorage_delete: "action",
338
+ * localstorage_clear: "action",
339
+ * sessionstorage_get: "read",
340
+ * sessionstorage_list: "read",
341
+ * sessionstorage_set: "action",
342
+ * sessionstorage_delete: "action",
343
+ * sessionstorage_clear: "action",
344
+ * auth_save: "action",
345
+ * auth_load: "action",
346
+ * auth_list: "read",
347
+ * auth_delete: "action",
348
+ * // Cache API + IndexedDB CRUD.
349
+ * // reads (`*_list*`, `*_get`) → `read`
350
+ * // writes (`*_put`, `*_delete`, `*_clear`,
351
+ * // `caches_delete_storage`) → `action`
352
+ * // No new capability gate — same posture as web-storage CRUD.
353
+ * caches_list_storages: "read",
354
+ * caches_list: "read",
355
+ * caches_get: "read",
356
+ * caches_put: "action",
357
+ * caches_delete: "action",
358
+ * caches_clear: "action",
359
+ * caches_delete_storage: "action",
360
+ * idb_list_databases: "read",
361
+ * idb_list_stores: "read",
362
+ * idb_get: "read",
363
+ * idb_put: "action",
364
+ * idb_delete: "action",
365
+ * idb_clear: "action",
366
+ * // Per-session artifact KV — save/get/list of session-scoped string/binary
367
+ * // payloads (the "build your own library over time" loop). `artifact_save`
368
+ * // writes a file → `action`; `artifact_get` / `artifact_list` are read-only.
369
+ * // No new capability gate to enable.
370
+ * artifact_save: "action",
371
+ * artifact_get: "read",
372
+ * artifact_list: "read",
373
+ * // HAR record/replay — `start_har` / `stop_har` both write/mutate session
374
+ * // state and (in the case of start) reserve a workspace-rooted file path
375
+ * // the context will write on close. Under `action` (sibling to the storage
376
+ * // bulk writers); reuses an existing capability, no new gate to enable.
377
+ * start_har: "action",
378
+ * stop_har: "action",
379
+ * // Session video recording — `stop_video` signals intent to finalize the
380
+ * // recording (Playwright finalizes on context.close — same constraint as
381
+ * // native HAR); `get_video` reads the finalized .webm. Both write/read a
382
+ * // workspace-rooted file path, so they sit under `file-io` (sibling to
383
+ * // `upload_file` / `download_get`). The start path is `open_session(
384
+ * // {recordVideo})` — Playwright doesn't expose a runtime start, so the
385
+ * // tool surface here is stop + get only.
386
+ * stop_video: "file-io",
387
+ * get_video: "file-io",
388
+ * // secrets — per-session sensitive-data registry + egress masking. Off by
389
+ * // default; loud-warn one-time when a secret is registered. Mirrors
390
+ * // `eval` / `network-body` / `disableWebSecurity` posture. `register_secret`
391
+ * // is the only tool the capability gates; the masking layer it installs is
392
+ * // behaviour-gated across every egress sink. See docs/tool-reference.md +
393
+ * // docs/threat-model.md.
394
+ * register_secret: "secrets",
395
+ * // extensions — per-session Chrome extension management. Off-by-default
396
+ * // capability; loud-warned at boot. Extensions can read every page the
397
+ * // session visits and make arbitrary network requests, so same posture
398
+ * // class as `eval` / `network-body` / `secrets`. The 5 mutator/read tools
399
+ * // all gate behind the same capability; the tool layer additionally
400
+ * // refuses on `incognito` / `attached` sessions and on `headless:true`
401
+ * // launches (Chromium constraints — see src/session/extensions.ts).
402
+ * extensions_install: "extensions",
403
+ * extensions_list: "extensions",
404
+ * extensions_reload: "extensions",
405
+ * extensions_trigger: "extensions",
406
+ * extensions_uninstall: "extensions",
407
+ * // captcha — per-session delegated captcha solving via a configured external
408
+ * // provider (2Captcha / CapMonster / etc; provider config via env). Off-by-
409
+ * // default capability; loud-warned at boot. Same posture class as
410
+ * // `eval` / `network-body` / `secrets` / `extensions` / `stealth`. Provider
411
+ * // config is per-deployment (env vars) — browxai NEVER bundles a solver and
412
+ * // NEVER auto-purchases credits. When the capability is on but no provider
413
+ * // is configured the tool returns a structured "no provider configured"
414
+ * // failure.
415
+ * solve_captcha: "captcha",
416
+ * // stealth is behaviour-gated (no tool of its own). The capability flips
417
+ * // per-context init-script patches at session creation (navigator.webdriver
418
+ * // / plugins / languages / window.chrome) — see src/helper/stealth.ts.
419
+ * // credentials — off-by-default pluggable hook into an external vault for
420
+ * // TOTP / username+password lookup. Same posture class as `eval` /
421
+ * // `network-body` / `secrets` — provider is configured per-deployment,
422
+ * // never bundled, loud-warned at boot. `get_credential` additionally
423
+ * // requires `secrets` to be enabled at the same time (it auto-registers
424
+ * // the looked-up password into the secrets-mask registry).
425
+ * get_totp: "credentials",
426
+ * get_credential: "credentials",
427
+ * // device-emulation — per-session Web Bluetooth / WebUSB / WebHID device
428
+ * // catalog synthesis. Off-by-default capability; loud-warned at boot.
429
+ * // The wrappers tell the page it found physical devices that don't exist
430
+ * // (an init-script-wrapped `navigator.bluetooth.requestDevice()` /
431
+ * // `navigator.usb.requestDevice()` / `navigator.hid.requestDevice()`
432
+ * // resolves with synthetic objects matching the agent-supplied catalog).
433
+ * // Same posture class as `eval` / `network-body` / `secrets` /
434
+ * // `extensions` / `captcha` — see docs/threat-model.md. `device_requests`
435
+ * // is the read-side companion (sliced view of which APIs the page has
436
+ * // called); it sits under the same capability so a server without
437
+ * // `device-emulation` can't even see whether a page tried to ask.
438
+ * emulate_bluetooth: "device-emulation",
439
+ * emulate_usb: "device-emulation",
440
+ * emulate_hid: "device-emulation",
441
+ * device_requests: "device-emulation",
442
+ * // diagnostics — off-by-default per-call recording layer + agent self-feedback.
443
+ * // Loud-warned at boot. `diagnostics_note` is the write-side primitive (under
444
+ * // the `diagnostics` capability — registering a note implies the recorder is
445
+ * // engaged); `diagnostics_search` + `diagnostics_report` are read-side
446
+ * // queries over the JSONL store, sitting under `read` so a report can be
447
+ * // pulled even when no further notes are being filed. The implicit fourth
448
+ * // surface is the dispatch-boundary recorder hook in server.ts: when the
449
+ * // capability is OFF the hook short-circuits to a no-op (zero allocations
450
+ * // beyond a gate check); when ON, every tool call lands as a JSONL line
451
+ * // DOWNSTREAM of the URL sanitiser + secrets-masking chokepoint so
452
+ * // registered secret values never reach the store raw. Same posture class
453
+ * // as `eval` / `network-body` / `secrets` / `extensions` / `stealth` /
454
+ * // `captcha` / `device-emulation`. See docs/threat-model.md.
455
+ * diagnostics_note: "diagnostics",
456
+ * diagnostics_search: "read",
457
+ * diagnostics_report: "read",
458
+ * // canvas — off-by-default per-session canvas-app automation primitives.
459
+ * // The five tools (`canvas_capture` / `canvas_diff` / `gesture_chain` /
460
+ * // `canvas_world_to_screen` / `canvas_screen_to_world` / `canvas_query`)
461
+ * // provide app-agnostic substrate for driving canvas-based editors
462
+ * // (Figma, Tldraw, Excalidraw, etc) without bundling vision or knowing
463
+ * // any specific app's internals. Loud-warned at boot. Same posture class
464
+ * // as `eval` / `network-body` / `secrets` / `extensions` /
465
+ * // `device-emulation` / `diagnostics`. `canvas_capture` reads framebuffer
466
+ * // bytes — pixel-level page surface; `gesture_chain` dispatches raw
467
+ * // pointer programs (custom paint strokes, lasso paths); the world↔screen
468
+ * // helpers do affine math + heuristic discovery on common app globals.
469
+ * // `canvas_query` is the dispatcher into canvas-app adapter plugins
470
+ * // (landed separately); it returns a structured no-adapter
471
+ * // error when no plugin registers under the namespace. `canvas_diff` is
472
+ * // pure-RGBA-bytes math — under `read` (no canvas-pixel touch of its own).
473
+ * canvas_capture: "canvas",
474
+ * canvas_diff: "read",
475
+ * gesture_chain: "canvas",
476
+ * canvas_world_to_screen: "canvas",
477
+ * canvas_screen_to_world: "canvas",
478
+ * canvas_query: "canvas",
479
+ * // byob-attach is not bound to a specific tool — it gates the
480
+ * // BROWX_ATTACH_CDP code path at session creation. `clipboard` is likewise behaviour-gated,
481
+ * // not tool-gated: the `shortcut` tool itself needs `action`, but its OS-clipboard
482
+ * // side-effect (copy/cut/paste) only engages when `clipboard` is also enabled —
483
+ * // off by default; same posture class as `eval` / `network-body`.
484
+ * };
485
+ */
486
+ export interface CapabilityConfig {
487
+ enabled: ReadonlySet<Capability>;
488
+ /** Names of tools rejected at start because their capability isn't enabled. */
489
+ disabledTools: ReadonlyArray<{
490
+ tool: string;
491
+ capability: Capability;
492
+ }>;
493
+ /** Non-fatal startup warnings — e.g. a retired capability was supplied.
494
+ * The caller (server.ts) logs these; they never abort startup. */
495
+ warnings: readonly string[];
496
+ }
497
+ export declare function resolveCapabilities(env?: NodeJS.ProcessEnv): CapabilityConfig;
498
+ /** Returns true iff the tool is enabled given the active capability set. */
499
+ export declare function isToolEnabled(tool: string, caps: CapabilityConfig): boolean;
500
+ /** confirm-required policy. Each name corresponds to a runtime hook (see
501
+ * src/policy/confirm.ts). Default: `navigate_off_allowlist,byob_action` when
502
+ * `BROWX_ALLOWED_ORIGINS` is set / `BROWX_ATTACH_CDP` is set respectively. */
503
+ export type ConfirmHook = "navigate_off_allowlist" | "file_download" | "file_upload" | "byob_action";
504
+ export declare function resolveConfirmHooks(env?: NodeJS.ProcessEnv): ReadonlySet<ConfirmHook>;