@pixelzx/genesis 2026.6.4 → 2026.6.5

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 (1073) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/.buildstamp +1 -1
  3. package/dist/abort-CcNxEsSq.js +201 -0
  4. package/dist/abort.runtime-DZJDSf0d.js +2 -0
  5. package/dist/abort.runtime.js +1 -1
  6. package/dist/accounts-B7M6y8l8.js +107 -0
  7. package/dist/accounts-DddcYo7u.js +2 -0
  8. package/dist/accounts-v0Cqfnse.js +104 -0
  9. package/dist/acp-cli-D_2_Nim8.js +2193 -0
  10. package/dist/acp-spawn-BZPupfsZ.js +2 -0
  11. package/dist/acp-spawn-CWfIrbK7.js +1093 -0
  12. package/dist/acp-stateful-target-driver-DpCTjH5T.js +89 -0
  13. package/dist/action-agents-fjIM4rpc.js +67 -0
  14. package/dist/action-focus-cx1pm1ym.js +132 -0
  15. package/dist/action-help-DtyAnULB.js +7 -0
  16. package/dist/action-info-DF30-xZl.js +101 -0
  17. package/dist/action-kill-rsSdXzvX.js +33 -0
  18. package/dist/action-list-4VN835m2.js +21 -0
  19. package/dist/action-log-L032mq5B.js +30 -0
  20. package/dist/action-send-Dm62UP-n.js +39 -0
  21. package/dist/action-spawn-BuZHKlpL.js +47 -0
  22. package/dist/action-unfocus-CTIWf8WX.js +29 -0
  23. package/dist/actions.runtime-0ezEcm7K.js +18 -0
  24. package/dist/actions.runtime-DKsCTTnH.js +5 -0
  25. package/dist/actions.runtime.js +1 -1
  26. package/dist/agent-BTOBOCIw.js +2 -0
  27. package/dist/agent-command-C-_EFUUu.js +874 -0
  28. package/dist/agent-harness-runtime-Bye6j3EL.js +144 -0
  29. package/dist/agent-runner-utils-CX2vCMkx.js +239 -0
  30. package/dist/agent-runner.runtime-BBqrjZv4.js +3455 -0
  31. package/dist/agent-runner.runtime.js +1 -1
  32. package/dist/agent-runtime-D1LIGcNj.js +18 -0
  33. package/dist/agents-CME2O1l9.js +5 -0
  34. package/dist/agents-DsDQvAPy.js +954 -0
  35. package/dist/aliases-C807OidC.js +2 -0
  36. package/dist/aliases-jq1ap6Dz.js +96 -0
  37. package/dist/api-BbxKoRkD.js +3 -0
  38. package/dist/api-CwJPCW9U.js +139 -0
  39. package/dist/api-N5Kaaq64.js +5 -0
  40. package/dist/approval-gateway-resolver-DIPFgTnx.js +29 -0
  41. package/dist/approval-gateway-runtime-i0yziXk2.js +2 -0
  42. package/dist/approval-handler-runtime-Cdm-10f9.js +439 -0
  43. package/dist/approval-native-runtime-BRjeBoqL.js +729 -0
  44. package/dist/attempt-execution.runtime-NFTF7Cbt.js +509 -0
  45. package/dist/attempt-execution.runtime.js +1 -1
  46. package/dist/attempt.prompt-helpers-DuBXv46v.js +221 -0
  47. package/dist/attempt.tool-run-context-Qf-tbC-C.js +933 -0
  48. package/dist/audit-DsDfRhB8.js +939 -0
  49. package/dist/audit.runtime-ComjcUGJ.js +7 -0
  50. package/dist/audit.runtime.js +1 -1
  51. package/dist/auth-BT_gqC-D.js +2 -0
  52. package/dist/auth-DeUz_8w8.js +383 -0
  53. package/dist/auth-order-DM7UkPDa.js +96 -0
  54. package/dist/auth-order-yS8hXrXh.js +2 -0
  55. package/dist/bash-tools-D0M9gBDu.js +3 -0
  56. package/dist/bash-tools-tnj1gSbO.js +2824 -0
  57. package/dist/binding-routing-C7atXiTD.js +85 -0
  58. package/dist/binding-targets-CCv7agx9.js +121 -0
  59. package/dist/bridge-server-C5O9rTJg.js +113 -0
  60. package/dist/browser-control-auth-GGN_kbqE.js +2 -0
  61. package/dist/browser-node-runtime-B-uTSVqP.js +12 -0
  62. package/dist/browser-profiles-Dex2eaLH.js +2 -0
  63. package/dist/browser-runtime-BPocB6yO.js +387 -0
  64. package/dist/browser-setup-tools-gHfYeDWA.js +13 -0
  65. package/dist/build-BqG7RkBz.js +550 -0
  66. package/dist/build-info.json +3 -3
  67. package/dist/bundled/boot-md/handler.js +2 -2
  68. package/dist/bundled/session-memory/handler.js +1 -1
  69. package/dist/call-BI4JvjcR.js +3 -0
  70. package/dist/call-wY43fzOF.js +331 -0
  71. package/dist/call.runtime-Dh61oVeL.js +2 -0
  72. package/dist/call.runtime.js +1 -1
  73. package/dist/capability-cli-BHz-2Stx.js +1401 -0
  74. package/dist/catchup-Be7tHJwK.js +300 -0
  75. package/dist/channel-B-6VmF4-.js +840 -0
  76. package/dist/channel-BCJccV-O.js +226 -0
  77. package/dist/channel-BDZqLbod.js +1100 -0
  78. package/dist/channel-BQDNgTea.js +1174 -0
  79. package/dist/channel-BwjThGwK.js +453 -0
  80. package/dist/channel-CPoThmda.js +595 -0
  81. package/dist/channel-CUT8NJ-B.js +350 -0
  82. package/dist/channel-C_Y7lv8v.js +491 -0
  83. package/dist/channel-Ck7-C-lB.js +297 -0
  84. package/dist/channel-DOpVjq4i.js +1802 -0
  85. package/dist/channel-core-QV9-eAtb.js +5 -0
  86. package/dist/channel-inbound-D_tebgdx.js +31 -0
  87. package/dist/channel-plugin-runtime-DXcBwNNM.js +771 -0
  88. package/dist/channel-runtime-D4ci0o4V.js +425 -0
  89. package/dist/channel-sAdF_zH-.js +1320 -0
  90. package/dist/channel.runtime-1swLIpNV.js +89 -0
  91. package/dist/channel.runtime-B9hljdNF.js +4 -0
  92. package/dist/channel.runtime-CSbR2pni.js +430 -0
  93. package/dist/channel.runtime-CdpqhnLO.js +2364 -0
  94. package/dist/channel.runtime-DOx6WROg.js +40130 -0
  95. package/dist/channel.runtime-H5Kb2LbC.js +109 -0
  96. package/dist/channel.runtime-V7boBc_e.js +576 -0
  97. package/dist/channel.runtime.js +1 -1
  98. package/dist/channel.setup-BXyeNJ2_.js +10 -0
  99. package/dist/channels-KU7bwUUs.js +733 -0
  100. package/dist/channels-cli-CTX6_5z3.js +268 -0
  101. package/dist/chat-C_i6Wp50.js +2830 -0
  102. package/dist/clawbot-cli-CLGPtbt-.js +9 -0
  103. package/dist/cli/daemon-cli.js +3 -3
  104. package/dist/cli-BhwHu1dK.js +72 -0
  105. package/dist/cli-CFsq8f2H.js +2 -0
  106. package/dist/cli-CNVlwurq.js +219 -0
  107. package/dist/cli-DLP8hKbi.js +2 -0
  108. package/dist/cli-runner-BbNBHV6v.js +286 -0
  109. package/dist/cli-runner.runtime-CfPaauuM.js +4 -0
  110. package/dist/cli-runner.runtime-MxBlCOO2.js +3 -0
  111. package/dist/cli-runner.runtime.js +1 -1
  112. package/dist/cli-startup-metadata.json +2 -2
  113. package/dist/cli.runtime-3cD-pSyn.js +1261 -0
  114. package/dist/cli.runtime.js +1 -1
  115. package/dist/client-Bl0d_7ak.js +138 -0
  116. package/dist/client-ClJyHgmq.js +713 -0
  117. package/dist/command-auth-DO32coey.js +76 -0
  118. package/dist/command-config-resolution-CAsa4fGg.js +2 -0
  119. package/dist/command-config-resolution-D6YcwuRh.js +23 -0
  120. package/dist/command-config-resolution.runtime-CSHDu35A.js +2 -0
  121. package/dist/command-config-resolution.runtime.js +1 -1
  122. package/dist/command-registry-BJEQrMqR.js +4 -0
  123. package/dist/command-registry-DI9i95nj.js +9 -0
  124. package/dist/command-registry-core-BpF1mggD.js +106 -0
  125. package/dist/command-secret-gateway-DDNHxysD.js +528 -0
  126. package/dist/command-status.runtime-DqYUCcEA.js +87 -0
  127. package/dist/command-status.runtime.js +1 -1
  128. package/dist/commands-acp-C_zCJPvL.js +77 -0
  129. package/dist/commands-compact.runtime-B6e3kwMS.js +10 -0
  130. package/dist/commands-compact.runtime.js +1 -1
  131. package/dist/commands-handlers.runtime-B0gTkAC0.js +4599 -0
  132. package/dist/commands-handlers.runtime.js +1 -1
  133. package/dist/commands-status-BgZ64sA8.js +16 -0
  134. package/dist/commands-status.runtime-JI89gIEU.js +3 -0
  135. package/dist/commands-status.runtime.js +1 -1
  136. package/dist/commands-subagents-control.runtime-B0hdcBxr.js +2 -0
  137. package/dist/commands-subagents-control.runtime-DUeSQ5j4.js +3 -0
  138. package/dist/commands-subagents-control.runtime.js +1 -1
  139. package/dist/commands-system-prompt-B7moUaCI.js +158 -0
  140. package/dist/commands-system-prompt-DTUkp9TH.js +2 -0
  141. package/dist/commands.runtime-BjCVVqol.js +167 -0
  142. package/dist/commands.runtime.js +1 -1
  143. package/dist/compact-BNJH56SX.js +1118 -0
  144. package/dist/compact.runtime-CYI8Yi9d.js +12 -0
  145. package/dist/compact.runtime.js +1 -1
  146. package/dist/completion-cli-Bb1Tk-vM.js +328 -0
  147. package/dist/config-DxkleHmo.js +252 -0
  148. package/dist/config-cli-CtaRB_f8.js +1078 -0
  149. package/dist/configure-Bp8WFryM.js +1252 -0
  150. package/dist/configure-DQ_X5zyT.js +2 -0
  151. package/dist/connect-options-BkWD0Wvv.js +699 -0
  152. package/dist/control-auth-Iqyldslx.js +125 -0
  153. package/dist/control-service-xIhkqyZE.js +156 -0
  154. package/dist/control-ui/assets/agents-Dh_TAFxm.js +1052 -0
  155. package/dist/control-ui/assets/canvas-BBkF0c_Z.js +269 -0
  156. package/dist/control-ui/assets/channel-config-extras-CNdHdere.js +2 -0
  157. package/dist/control-ui/assets/channels-DxBxgFLI.js +463 -0
  158. package/dist/control-ui/assets/cron-DI85RTUE.js +933 -0
  159. package/dist/control-ui/assets/de-ona0Q7Bc.js +2 -0
  160. package/dist/control-ui/assets/debug-DnDu2pj9.js +94 -0
  161. package/dist/control-ui/assets/es-Dn-oNRUH.js +2 -0
  162. package/dist/control-ui/assets/format-BvrOTETl.js +9 -0
  163. package/dist/control-ui/assets/fr-DXJ2RnNl.js +2 -0
  164. package/dist/control-ui/assets/i18n-BiXTtoQW.js +3 -0
  165. package/dist/control-ui/assets/id-BWsRmAR3.js +2 -0
  166. package/dist/control-ui/assets/index-YAwpI05T.js +6366 -0
  167. package/dist/control-ui/assets/instances-CRNiJVGJ.js +57 -0
  168. package/dist/control-ui/assets/ja-JP-BUkQN13S.js +2 -0
  169. package/dist/control-ui/assets/ko-Q_K13wyH.js +2 -0
  170. package/dist/control-ui/assets/logs-CzRlG5kP.js +74 -0
  171. package/dist/control-ui/assets/mcp-CAYQSRMs.js +373 -0
  172. package/dist/control-ui/assets/nodes-92SUclba.js +618 -0
  173. package/dist/control-ui/assets/pl-WlhlBCqd.js +2 -0
  174. package/dist/control-ui/assets/plugins-TwSBb6p5.js +273 -0
  175. package/dist/control-ui/assets/pt-BR-CVchspYo.js +2 -0
  176. package/dist/control-ui/assets/sessions-CHmx5D2H.js +306 -0
  177. package/dist/control-ui/assets/skills-C-34EOwN.js +323 -0
  178. package/dist/control-ui/assets/skills-shared-BbxW-wNm.js +11 -0
  179. package/dist/control-ui/assets/th-C4FUN3Mq.js +2 -0
  180. package/dist/control-ui/assets/tr-CoySBXqw.js +2 -0
  181. package/dist/control-ui/assets/uk-C-mkZs9j.js +2 -0
  182. package/dist/control-ui/assets/wallet-DjjoYuDY.js +285 -0
  183. package/dist/control-ui/assets/zh-CN-B7HXiLrY.js +2 -0
  184. package/dist/control-ui/assets/zh-TW-CKLRstBM.js +2 -0
  185. package/dist/control-ui/index.html +3 -3
  186. package/dist/conversation-id-BZtOqHIz.js +38 -0
  187. package/dist/conversation-id-D1Q9qPFH.js +235 -0
  188. package/dist/conversation-runtime-B1QZ-DEM.js +31 -0
  189. package/dist/core-BdVAy0Wv.js +275 -0
  190. package/dist/cron-cli-BWM2kRKU.js +713 -0
  191. package/dist/daemon-cli-MRl5nyuF.js +12 -0
  192. package/dist/dashboard-BkdlJrnf.js +2 -0
  193. package/dist/dashboard-C9m86rHv.js +81 -0
  194. package/dist/delegate-BjUvKQlo.js +64 -0
  195. package/dist/detached-task-runtime-BAEzkNB8.js +73 -0
  196. package/dist/devices-cli-B1n6tl9f.js +498 -0
  197. package/dist/diagnostics-DZxWkW3i.js +154 -0
  198. package/dist/direct-dm-qw-uk31C.js +64 -0
  199. package/dist/dispatch-D0xiJ6Up.js +1131 -0
  200. package/dist/dispatch-acp-DVN58m9G.js +981 -0
  201. package/dist/dispatch-acp-manager.runtime-C8t1i5Wt.js +3 -0
  202. package/dist/dispatch-acp-manager.runtime.js +1 -1
  203. package/dist/dispatch-acp.runtime-FR0DUPpn.js +19 -0
  204. package/dist/dispatch-acp.runtime.js +1 -1
  205. package/dist/doctor-device-pairing-DIbiBPlL.js +307 -0
  206. package/dist/doctor-gateway-daemon-flow-BFjRlXvA.js +250 -0
  207. package/dist/doctor-gateway-health-uZrukX3c.js +63 -0
  208. package/dist/doctor-health-DKpg1bxM.js +59 -0
  209. package/dist/doctor-health-contributions-BoXX8ubw.js +493 -0
  210. package/dist/doctor-prompter-CLf5Uf10.js +56 -0
  211. package/dist/doctor-workspace-status-Cw61BbGy.js +75 -0
  212. package/dist/dreaming-Bk8dVfGi.js +1574 -0
  213. package/dist/dreaming-narrative-DGSQa-0N.js +595 -0
  214. package/dist/embedded-gateway-stub.runtime-sokWrs6B.js +9 -0
  215. package/dist/embedded-gateway-stub.runtime.js +1 -1
  216. package/dist/entry.js +2 -2
  217. package/dist/exec-approvals-cli-CnNETs_u.js +498 -0
  218. package/dist/extensionAPI.js +1 -1
  219. package/dist/extensions/active-memory/index.js +1 -1
  220. package/dist/extensions/bluebubbles/api.js +3 -3
  221. package/dist/extensions/bluebubbles/channel-plugin-api.js +1 -1
  222. package/dist/extensions/browser/browser-bridge.js +1 -1
  223. package/dist/extensions/browser/browser-config.js +4 -4
  224. package/dist/extensions/browser/browser-control-auth.js +2 -2
  225. package/dist/extensions/browser/browser-doctor.js +2 -2
  226. package/dist/extensions/browser/browser-maintenance.js +2 -2
  227. package/dist/extensions/browser/browser-profiles.js +2 -2
  228. package/dist/extensions/browser/browser-runtime-api.js +10 -10
  229. package/dist/extensions/browser/index.js +1 -1
  230. package/dist/extensions/browser/plugin-registration.js +1 -1
  231. package/dist/extensions/browser/register.runtime.js +3 -3
  232. package/dist/extensions/browser/runtime-api.js +11 -11
  233. package/dist/extensions/browser/test-support.js +1 -1
  234. package/dist/extensions/device-pair/api.js +1 -1
  235. package/dist/extensions/device-pair/index.js +3 -3
  236. package/dist/extensions/device-pair/notify.js +1 -1
  237. package/dist/extensions/device-pair/pair-command-approve.js +1 -1
  238. package/dist/extensions/google-meet/index.js +2 -2
  239. package/dist/extensions/imessage/api.js +3 -3
  240. package/dist/extensions/imessage/channel-plugin-api.js +1 -1
  241. package/dist/extensions/imessage/runtime-api.js +3 -3
  242. package/dist/extensions/irc/api.js +2 -2
  243. package/dist/extensions/irc/channel-plugin-api.js +1 -1
  244. package/dist/extensions/line/api.js +2 -2
  245. package/dist/extensions/line/channel-plugin-api.js +1 -1
  246. package/dist/extensions/line/contract-api.js +1 -1
  247. package/dist/extensions/line/runtime-api.js +4 -4
  248. package/dist/extensions/line/setup-api.js +1 -1
  249. package/dist/extensions/llm-task/index.js +2 -2
  250. package/dist/extensions/lobster/index.js +3 -3
  251. package/dist/extensions/lobster/runtime-api.js +1 -1
  252. package/dist/extensions/mattermost/api.js +1 -1
  253. package/dist/extensions/mattermost/channel-plugin-api.js +1 -1
  254. package/dist/extensions/mattermost/channel-plugin-runtime.js +1 -1
  255. package/dist/extensions/mattermost/policy-api.js +1 -1
  256. package/dist/extensions/mattermost/runtime-api.js +4 -4
  257. package/dist/extensions/mattermost/slash-route-api.js +1 -1
  258. package/dist/extensions/memory-core/api.js +1 -1
  259. package/dist/extensions/memory-core/cli-metadata.js +2 -2
  260. package/dist/extensions/memory-core/index.js +3 -3
  261. package/dist/extensions/memory-lancedb/cli-metadata.js +1 -1
  262. package/dist/extensions/msteams/api.js +1 -1
  263. package/dist/extensions/msteams/channel-plugin-api.js +1 -1
  264. package/dist/extensions/msteams/runtime-api.js +3 -3
  265. package/dist/extensions/msteams/test-api.js +1 -1
  266. package/dist/extensions/nextcloud-talk/api.js +1 -1
  267. package/dist/extensions/nextcloud-talk/channel-plugin-api.js +1 -1
  268. package/dist/extensions/nextcloud-talk/runtime-api.js +2 -2
  269. package/dist/extensions/openshell/index.js +2 -2
  270. package/dist/extensions/signal/api.js +6 -6
  271. package/dist/extensions/signal/channel-plugin-api.js +1 -1
  272. package/dist/extensions/signal/reaction-runtime-api.js +1 -1
  273. package/dist/extensions/signal/runtime-api.js +7 -7
  274. package/dist/extensions/skill-workshop/api.js +1 -1
  275. package/dist/extensions/skill-workshop/index.js +1 -1
  276. package/dist/extensions/synology-chat/api.js +1 -1
  277. package/dist/extensions/synology-chat/channel-plugin-api.js +1 -1
  278. package/dist/extensions/tlon/api.js +2 -2
  279. package/dist/extensions/tlon/channel-plugin-api.js +1 -1
  280. package/dist/extensions/tlon/runtime-api.js +1 -1
  281. package/dist/extensions/tlon/test-api.js +1 -1
  282. package/dist/extensions/twitch/api.js +1 -1
  283. package/dist/extensions/twitch/channel-plugin-api.js +1 -1
  284. package/dist/extensions/twitch/setup-plugin-api.js +1 -1
  285. package/dist/extensions/zalo/api.js +3 -3
  286. package/dist/extensions/zalo/channel-plugin-api.js +1 -1
  287. package/dist/extensions/zalo/runtime-api.js +2 -2
  288. package/dist/extensions/zalo/setup-api.js +2 -2
  289. package/dist/extensions/zalouser/api.js +3 -3
  290. package/dist/extensions/zalouser/channel-plugin-api.js +1 -1
  291. package/dist/extensions/zalouser/runtime-api.js +6 -6
  292. package/dist/extensions/zalouser/setup-plugin-api.js +1 -1
  293. package/dist/extensions/zalouser/test-api.js +1 -1
  294. package/dist/fallbacks-BwNexEVP.js +31 -0
  295. package/dist/fallbacks-GwVAaFt5.js +2 -0
  296. package/dist/fallbacks-shared-DmepG9Mq.js +111 -0
  297. package/dist/gateway-BB4hdlYm.js +115 -0
  298. package/dist/gateway-cli-Bzz62NC8.js +1283 -0
  299. package/dist/gateway-rpc-dyJV2osv.js +14 -0
  300. package/dist/gateway-rpc.runtime-DYVOEv4W.js +23 -0
  301. package/dist/gateway-rpc.runtime.js +1 -1
  302. package/dist/gateway-runtime-CqSQCYo0.js +15 -0
  303. package/dist/gateway-status-DdCiwrPt.js +584 -0
  304. package/dist/genesis-tools-Bh6dAUhK.js +9166 -0
  305. package/dist/genesis-tools.runtime-CiIUponP.js +2 -0
  306. package/dist/genesis-tools.runtime.js +1 -1
  307. package/dist/get-reply-from-config.runtime-Cu2DcwOW.js +2 -0
  308. package/dist/get-reply-from-config.runtime.js +1 -1
  309. package/dist/get-reply-qVmTjhwr.js +3897 -0
  310. package/dist/graph-users-kkSJYBNX.js +1337 -0
  311. package/dist/health-CFyVDYng.js +469 -0
  312. package/dist/health-Cl371mu8.js +3 -0
  313. package/dist/health-route-D0IspgUK.js +41 -0
  314. package/dist/health-route-D2tFKCLv.js +2 -0
  315. package/dist/heartbeat-runner-Bmi8YsXz.js +5 -0
  316. package/dist/heartbeat-runner-FSCWra2R.js +1292 -0
  317. package/dist/heartbeat-runner.runtime-QF8dg4j-.js +4 -0
  318. package/dist/heartbeat-runner.runtime.js +1 -1
  319. package/dist/hooks-cli-DYoG7Dz1.js +433 -0
  320. package/dist/image-fallbacks-5ckuJ46I.js +31 -0
  321. package/dist/image-fallbacks-DYnqzK01.js +2 -0
  322. package/dist/inbound-reply-dispatch-D5pqDZRa.js +73 -0
  323. package/dist/index.js +2 -2
  324. package/dist/infra-runtime-D08WIqN2.js +39 -0
  325. package/dist/init-BCgwiSZj.js +59 -0
  326. package/dist/library-CP9n_7AP.js +45 -0
  327. package/dist/lifecycle-BYam90xH.js +229 -0
  328. package/dist/lifecycle-DS58sNmu.js +571 -0
  329. package/dist/lifecycle.runtime-DMwss7xM.js +2 -0
  330. package/dist/lifecycle.runtime.js +1 -1
  331. package/dist/list-CASc4IWz.js +131 -0
  332. package/dist/list-CBPrBS2u.js +1212 -0
  333. package/dist/list-Cf7fcqQd.js +2 -0
  334. package/dist/list-Dqd2QyTH.js +2 -0
  335. package/dist/list.probe-BWcMSWDF.js +419 -0
  336. package/dist/llm-slug-generator-4LADFhXT.js +79 -0
  337. package/dist/llm-slug-generator.js +1 -1
  338. package/dist/load-config-DI-LDL6p.js +35 -0
  339. package/dist/local-dispatch.runtime-WDgraH3j.js +8 -0
  340. package/dist/local-dispatch.runtime.js +1 -1
  341. package/dist/logs-cli-zoBIelUH.js +265 -0
  342. package/dist/logs-cli.runtime-DxKNxXAz.js +2 -0
  343. package/dist/logs-cli.runtime.js +1 -1
  344. package/dist/main-session-restart-recovery-DWZfkOzH.js +206 -0
  345. package/dist/managed-image-attachments-DLDa1aE2.js +2 -0
  346. package/dist/managed-image-attachments-a4v60Bk3.js +635 -0
  347. package/dist/manager-CfUcsSI9.js +2057 -0
  348. package/dist/manager-DmBBLCOg.js +2 -0
  349. package/dist/markdown-to-line-B0mPruD_.js +790 -0
  350. package/dist/mcp/plugin-tools-serve.js +1 -1
  351. package/dist/mcp-cli-CLL9nfvE.js +725 -0
  352. package/dist/mcp-http-p7GbtbMx.js +529 -0
  353. package/dist/memory-core-host-runtime-cli-CZNYkDoE.js +9 -0
  354. package/dist/message-CRyNLXch.js +232 -0
  355. package/dist/message-action-runner-5Y4EFpWh.js +1407 -0
  356. package/dist/message-action-runner-Dxv-GXkn.js +2 -0
  357. package/dist/message-actions-DtoR6Mr2.js +143 -0
  358. package/dist/message.gateway.runtime-RI4cvk_E.js +2 -0
  359. package/dist/message.gateway.runtime.js +1 -1
  360. package/dist/models-auth-status-DsheCXaS.js +201 -0
  361. package/dist/models-cli-CQQG1U-p.js +219 -0
  362. package/dist/monitor-BRRSjPQY.js +1459 -0
  363. package/dist/monitor-Ch-cG7Si.js +1661 -0
  364. package/dist/monitor-ChBhfnC-.js +788 -0
  365. package/dist/monitor-CsvCTpjq.js +671 -0
  366. package/dist/monitor-DjemBuVh.js +1237 -0
  367. package/dist/monitor-LyGEO-KI.js +2 -0
  368. package/dist/monitor-auth-DVCdDwlp.js +207 -0
  369. package/dist/monitor-processing-Cib3ZjUe.js +1974 -0
  370. package/dist/monitor.runtime-DLBFALbV.js +2 -0
  371. package/dist/monitor.runtime.js +1 -1
  372. package/dist/monitor.webhook-Dktr8JA-.js +180 -0
  373. package/dist/msteams-G5I2CO13.js +35 -0
  374. package/dist/native-hook-relay-B1ArNeG5.js +519 -0
  375. package/dist/nextcloud-talk-DimOAfaR.js +17 -0
  376. package/dist/node-cli-RIjV0id4.js +2276 -0
  377. package/dist/nodes-cli-Cke-B80I.js +1046 -0
  378. package/dist/nodes-utils-CsTqKwN9.js +84 -0
  379. package/dist/nodes.helpers-DYpGCFer.js +34 -0
  380. package/dist/notify-zBChwf0-.js +315 -0
  381. package/dist/onboard-D6UawRld.js +2 -0
  382. package/dist/onboard-DfoCtk3_.js +70 -0
  383. package/dist/onboard-helpers-BKQMe3RX.js +6 -0
  384. package/dist/onboard-helpers-BLBJlQ50.js +204 -0
  385. package/dist/onboard-interactive-GAbQD437.js +24 -0
  386. package/dist/onboard-non-interactive-Bqi-JXh3.js +635 -0
  387. package/dist/onboard-remote-CNpTyVws.js +193 -0
  388. package/dist/onboard-remote-GFp2lT6Y.js +2 -0
  389. package/dist/onboard-skills-BQneolfo.js +2 -0
  390. package/dist/onboard-skills-BipqJ48b.js +134 -0
  391. package/dist/openai-http-CLDWjSKC.js +500 -0
  392. package/dist/openresponses-http-DNvXNiw_.js +1128 -0
  393. package/dist/operator-approvals-client-gaflvETF.js +68 -0
  394. package/dist/outbound.runtime-ByVsvEri.js +2 -0
  395. package/dist/outbound.runtime.js +1 -1
  396. package/dist/pair-command-approve-Dzkubc-8.js +44 -0
  397. package/dist/persistent-bindings.lifecycle-BhdRK7Lp.js +2 -0
  398. package/dist/persistent-bindings.lifecycle-DQ0AiHuy.js +85 -0
  399. package/dist/pi-embedded-C789hs31.js +4 -0
  400. package/dist/pi-embedded-CXLkrOwv.js +2905 -0
  401. package/dist/pi-embedded.runtime-BaHYLgKa.js +4 -0
  402. package/dist/pi-embedded.runtime.js +1 -1
  403. package/dist/pi-tool-definition-adapter-DFutc0D4.js +229 -0
  404. package/dist/pi-tools-k60jrAVq.js +1057 -0
  405. package/dist/pi-tools.before-tool-call-CFy20GCz.js +2 -0
  406. package/dist/pi-tools.before-tool-call-DJmPOVfQ.js +433 -0
  407. package/dist/plugin-BfFuIgXQ.js +12195 -0
  408. package/dist/plugin-enabled-dXOUnZwX.js +140 -0
  409. package/dist/plugin-registration-CEAozQhV.js +23 -0
  410. package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
  411. package/dist/plugin-sdk/acp-binding-runtime.js +1 -1
  412. package/dist/plugin-sdk/acp-runtime.js +2 -2
  413. package/dist/plugin-sdk/agent-harness-runtime.js +5 -5
  414. package/dist/plugin-sdk/agent-harness.js +6 -6
  415. package/dist/plugin-sdk/agent-runtime.js +2 -2
  416. package/dist/plugin-sdk/approval-gateway-runtime.js +2 -2
  417. package/dist/plugin-sdk/approval-handler-runtime.js +3 -3
  418. package/dist/plugin-sdk/approval-runtime.js +1 -1
  419. package/dist/plugin-sdk/browser-node-runtime.js +4 -4
  420. package/dist/plugin-sdk/browser-setup-tools.js +3 -3
  421. package/dist/plugin-sdk/browser-support.js +7 -7
  422. package/dist/plugin-sdk/channel-core.js +2 -2
  423. package/dist/plugin-sdk/channel-inbound.js +2 -2
  424. package/dist/plugin-sdk/command-auth.js +1 -1
  425. package/dist/plugin-sdk/command-status-runtime.js +1 -1
  426. package/dist/plugin-sdk/compat.js +1 -1
  427. package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
  428. package/dist/plugin-sdk/conversation-runtime.js +3 -3
  429. package/dist/plugin-sdk/core.js +2 -2
  430. package/dist/plugin-sdk/direct-dm.js +1 -1
  431. package/dist/plugin-sdk/gateway-runtime.js +3 -3
  432. package/dist/plugin-sdk/inbound-reply-dispatch.js +1 -1
  433. package/dist/plugin-sdk/index.js +1 -1
  434. package/dist/plugin-sdk/infra-runtime.js +2 -2
  435. package/dist/plugin-sdk/irc.js +2 -2
  436. package/dist/plugin-sdk/matrix.js +1 -1
  437. package/dist/plugin-sdk/memory-core-host-runtime-cli.js +2 -2
  438. package/dist/plugin-sdk/memory-core.js +2 -2
  439. package/dist/plugin-sdk/msteams.js +2 -2
  440. package/dist/plugin-sdk/nextcloud-talk.js +2 -2
  441. package/dist/plugin-sdk/nostr.js +1 -1
  442. package/dist/plugin-sdk/reply-dispatch-runtime.js +1 -1
  443. package/dist/plugin-sdk/reply-runtime.js +4 -4
  444. package/dist/plugin-sdk/runtime-secret-resolution.js +1 -1
  445. package/dist/plugin-sdk/runtime.js +2 -2
  446. package/dist/plugin-sdk/session-visibility.js +1 -1
  447. package/dist/plugin-sdk/testing.js +4 -4
  448. package/dist/plugin-sdk/tlon.js +1 -1
  449. package/dist/plugin-sdk/zalo.js +1 -1
  450. package/dist/plugin-sdk/zalouser.js +1 -1
  451. package/dist/plugin-service-BOpLQ8BU.js +2892 -0
  452. package/dist/plugins/runtime/index.js +1 -1
  453. package/dist/policy-DiIlt2yW.js +328 -0
  454. package/dist/postinstall-inventory.json +445 -445
  455. package/dist/prepare.runtime-Bd8adOy3.js +815 -0
  456. package/dist/prepare.runtime.js +1 -1
  457. package/dist/probe-BOlTfbzG.js +2 -0
  458. package/dist/probe-BSRvsN95.js +2205 -0
  459. package/dist/probe-CDfjQSnz.js +74 -0
  460. package/dist/probe-D7gHyiZV.js +241 -0
  461. package/dist/probe-DTNKTWSs.js +2 -0
  462. package/dist/probe-DcryDdZh.js +45 -0
  463. package/dist/probe-nyesoHxj.js +1443 -0
  464. package/dist/program-BFGavenz.js +111 -0
  465. package/dist/prompt-select-styled-BhY1zahx.js +20 -0
  466. package/dist/protocol-DxLbSF2J.js +2477 -0
  467. package/dist/provider-dispatcher-C-yy1D7r.js +22 -0
  468. package/dist/provider-dispatcher-ErSjESTP.js +2 -0
  469. package/dist/qr-cli-C1-oy_ho.js +349 -0
  470. package/dist/qr-cli-DmEs63Sb.js +2 -0
  471. package/dist/reaction-runtime-api-gua650a7.js +116 -0
  472. package/dist/reactions-R-rA7cXz.js +998 -0
  473. package/dist/register-service-commands-DkbqNKVB.js +71 -0
  474. package/dist/register.agent-C3nW9wDn.js +248 -0
  475. package/dist/register.configure-BzLHCu95.js +15 -0
  476. package/dist/register.maintenance-BHFQo4gr.js +363 -0
  477. package/dist/register.message-CsYRdfKi.js +329 -0
  478. package/dist/register.onboard-DltySQ6C.js +88 -0
  479. package/dist/register.runtime-6Sk1Njnp.js +81 -0
  480. package/dist/register.runtime.js +1 -1
  481. package/dist/register.setup-CDvVQJuj.js +150 -0
  482. package/dist/register.status-health-sessions-B8lorJ2x.js +1215 -0
  483. package/dist/register.subclis-BD4fuAci.js +3 -0
  484. package/dist/register.subclis-CbRd3F_m.js +29 -0
  485. package/dist/register.subclis-core-Dtq9dAjI.js +249 -0
  486. package/dist/reply-dispatch-runtime-DldslKSK.js +13 -0
  487. package/dist/reply-runtime-2EGTfk-1.js +11 -0
  488. package/dist/reply.runtime-OaHntzIS.js +2 -0
  489. package/dist/reply.runtime.js +1 -1
  490. package/dist/restart-health-BjmfJCUM.js +202 -0
  491. package/dist/restart-health-hw909zlD.js +2 -0
  492. package/dist/root-help-_hHiERsR.js +44 -0
  493. package/dist/routes-BxCk7Pue.js +3341 -0
  494. package/dist/routes-C1_6oFmZ.js +2 -0
  495. package/dist/rpc-zRbkEo6W.js +61 -0
  496. package/dist/rpc.runtime-BZSYNDPa.js +21 -0
  497. package/dist/rpc.runtime.js +1 -1
  498. package/dist/run-delivery.runtime-D6YDo67d.js +530 -0
  499. package/dist/run-delivery.runtime.js +1 -1
  500. package/dist/run-embedded.runtime-BsgPrPDa.js +4 -0
  501. package/dist/run-embedded.runtime.js +1 -1
  502. package/dist/run-execution-cli.runtime-CggaHhrJ.js +4 -0
  503. package/dist/run-execution-cli.runtime.js +1 -1
  504. package/dist/run-executor.runtime-CKkLEr_T.js +277 -0
  505. package/dist/run-executor.runtime.js +1 -1
  506. package/dist/run-main-CJYYkV6H.js +567 -0
  507. package/dist/run-subagent-registry.runtime-B0sgf_oy.js +2 -0
  508. package/dist/run-subagent-registry.runtime.js +1 -1
  509. package/dist/run-wait-DHizeptL.js +135 -0
  510. package/dist/runtime-EtV_ChXX.js +9 -0
  511. package/dist/runtime-api-6H864Pmt.js +9 -0
  512. package/dist/runtime-api-CbZqRBZQ.js +14 -0
  513. package/dist/runtime-api-ZxEgu8cW.js +4 -0
  514. package/dist/runtime-api-j9A6jYUr.js +9 -0
  515. package/dist/runtime-embedded-pi.runtime-BHjCPnxo.js +2 -0
  516. package/dist/runtime-embedded-pi.runtime.js +1 -1
  517. package/dist/runtime-hvRzTSAZ.js +973 -0
  518. package/dist/runtime-internal-C_KZYzFK.js +2 -0
  519. package/dist/runtime-options-BZEOCnMg.js +275 -0
  520. package/dist/runtime-schema-R7LWe58K.js +28576 -0
  521. package/dist/scan-BNDE3dSE.js +523 -0
  522. package/dist/scan-TG6lVEQ2.js +2 -0
  523. package/dist/secrets-cli-twD2FWoZ.js +2101 -0
  524. package/dist/security-cli-Cd1A5yhL.js +486 -0
  525. package/dist/selection-CqqmU0Hi.js +7764 -0
  526. package/dist/selection-CsM62vcz.js +2 -0
  527. package/dist/send-D-EgB64m.js +156 -0
  528. package/dist/send-DPk5hW1W.js +102 -0
  529. package/dist/send.runtime-3QDkKN71.js +2 -0
  530. package/dist/send.runtime.js +1 -1
  531. package/dist/server-C94r_Qff.js +77 -0
  532. package/dist/server-Ceiopn_v.js +13 -0
  533. package/dist/server-context-BFJlu5HY.js +2 -0
  534. package/dist/server-context-PNEqhnTM.js +847 -0
  535. package/dist/server-node-events-QOAWLsDC.js +481 -0
  536. package/dist/server-plugin-bootstrap-CgsjzB17.js +2 -0
  537. package/dist/server-plugin-bootstrap-Dfuf75EN.js +12728 -0
  538. package/dist/server-restart-sentinel-BMPqZ7Jw.js +697 -0
  539. package/dist/server.impl-CCoQpvB7.js +12864 -0
  540. package/dist/session-kill-http-oPi3ajEp.js +110 -0
  541. package/dist/session-reset-service-CzDd6PBK.js +497 -0
  542. package/dist/session-route-DUOQE8-f.js +93 -0
  543. package/dist/session-status.runtime-W5tlGbXw.js +2 -0
  544. package/dist/session-status.runtime.js +1 -1
  545. package/dist/session-subagent-reactivation.runtime-yoYn1awK.js +2 -0
  546. package/dist/session-subagent-reactivation.runtime.js +1 -1
  547. package/dist/session-tab-registry-DkeCaT-2.js +581 -0
  548. package/dist/session-visibility-B4CFjv43.js +147 -0
  549. package/dist/sessions-helpers-CDfOVWe3.js +305 -0
  550. package/dist/sessions-history-http-QXeTdxXM.js +383 -0
  551. package/dist/sessions-patch-xb4bXPwh.js +309 -0
  552. package/dist/sessions-resolve-BPlrW8C3.js +174 -0
  553. package/dist/sessions.runtime-yYJXudA9.js +2 -0
  554. package/dist/sessions.runtime.js +1 -1
  555. package/dist/setup-0Im0LL1d.js +636 -0
  556. package/dist/setup-api-BxwfqXN-.js +29 -0
  557. package/dist/setup-core-BWwXgEuM.js +171 -0
  558. package/dist/setup-core-DzHNbQLG.js +176 -0
  559. package/dist/setup-surface-BVnqDsfU.js +286 -0
  560. package/dist/setup-surface-BajZWmKz2.js +403 -0
  561. package/dist/setup-surface-rDO3YjSb.js +219 -0
  562. package/dist/setup.finalize-BsnPbdwc.js +547 -0
  563. package/dist/setup.gateway-config-BFawSWHL.js +250 -0
  564. package/dist/shared-52tFSlVk.js +121 -0
  565. package/dist/shared-C8ENgtxM.js +198 -0
  566. package/dist/shared-DbXvU7JV.js +76 -0
  567. package/dist/slash-state-CMuPwgKt.js +1911 -0
  568. package/dist/src-IzaHgU6a.js +3974 -0
  569. package/dist/startup-context-xJS8ckSG.js +312 -0
  570. package/dist/status-BO4LMTER.js +2 -0
  571. package/dist/status-BwY1tASe.js +3 -0
  572. package/dist/status-BxG6n-ko.js +397 -0
  573. package/dist/status-Co_cq2vy.js +2 -0
  574. package/dist/status-DKNeRGzW.js +190 -0
  575. package/dist/status-DzlIHiTS.js +209 -0
  576. package/dist/status-all-DF7qaWjo.js +498 -0
  577. package/dist/status-json-CgCilobT.js +14 -0
  578. package/dist/status-json-command-DAa78z3e.js +84 -0
  579. package/dist/status-runtime-shared-CRCuxXn_.js +257 -0
  580. package/dist/status-subagents.runtime-hUsBd4C5.js +18 -0
  581. package/dist/status-subagents.runtime.js +1 -1
  582. package/dist/status-text-BdbRrl1G.js +237 -0
  583. package/dist/status.gateway-connection.runtime-BmSTYFFO.js +2 -0
  584. package/dist/status.gateway-connection.runtime.js +1 -1
  585. package/dist/status.gather-CItmFIHS.js +292 -0
  586. package/dist/status.gather-qB6WOoH7.js +2 -0
  587. package/dist/status.runtime-ClZCgYx1.js +2 -0
  588. package/dist/status.runtime.js +1 -1
  589. package/dist/status.scan-overview-B0b0Mvng.js +379 -0
  590. package/dist/status.scan-xY7nUi9N.js +65 -0
  591. package/dist/status.scan.fast-json-BANGHOys.js +132 -0
  592. package/dist/status.scan.fast-json-M-DmMy2l.js +2 -0
  593. package/dist/status.summary-B3PlFnWw.js +2 -0
  594. package/dist/status.summary-adB75FOM.js +214 -0
  595. package/dist/subagent-announce-B4w7Mcpr.js +351 -0
  596. package/dist/subagent-announce-delivery-Dma0A4gL.js +726 -0
  597. package/dist/subagent-announce-output-sUPLcge-.js +364 -0
  598. package/dist/subagent-control-CxR0WRrx.js +506 -0
  599. package/dist/subagent-followup.runtime-XeFe_LA0.js +68 -0
  600. package/dist/subagent-followup.runtime.js +1 -1
  601. package/dist/subagent-orphan-recovery-CJPHy8JV.js +305 -0
  602. package/dist/subagent-registry-CjMWjRCE.js +1753 -0
  603. package/dist/subagent-registry-H20VxEu0.js +3 -0
  604. package/dist/subagent-registry.runtime.js +1 -1
  605. package/dist/subagent-spawn-CRM5x6cV.js +1005 -0
  606. package/dist/system-cli-BJ5mMirj.js +59 -0
  607. package/dist/targets-CUnlEj96.js +67 -0
  608. package/dist/task-executor-DKnEwQ6v.js +360 -0
  609. package/dist/task-owner-access-CfypP1Yc.js +74 -0
  610. package/dist/task-registry-delivery-runtime-BB6ZzpqH.js +2 -0
  611. package/dist/task-registry-delivery-runtime-CvHa0gv-.js +3 -0
  612. package/dist/task-registry-pQuAfAL9.js +2366 -0
  613. package/dist/task-registry.maintenance-Bfd87wEV.js +416 -0
  614. package/dist/task-registry.maintenance-VgfbW0yt.js +2 -0
  615. package/dist/telegram/token.js +1 -1
  616. package/dist/testing-C_mngO0u.js +575 -0
  617. package/dist/text-report-Ct6t3he6.js +587 -0
  618. package/dist/tool-resolution-C4KGgPH-.js +90 -0
  619. package/dist/tools-effective-inventory-Bo2QC-m8.js +152 -0
  620. package/dist/tools-invoke-http-CBZPFh5L.js +206 -0
  621. package/dist/trash-DhZow3jd.js +24 -0
  622. package/dist/tui-cli-BPdQPozP.js +4575 -0
  623. package/dist/update-cli-BRi3mVAU.js +1759 -0
  624. package/dist/upgrade-D9zejtCk.js +1226 -0
  625. package/dist/video-generation-task-status-BSBQ0_FO.js +163 -0
  626. package/dist/wait-for-idle-before-flush-D1dTT9th.js +5986 -0
  627. package/dist/wizard-models-ysyV_WWR.js +334 -0
  628. package/package.json +1 -1
  629. package/dist/abort-DaihtnYj.js +0 -201
  630. package/dist/abort.runtime-BUT9L_5l.js +0 -2
  631. package/dist/accounts-BY5wsBnV.js +0 -104
  632. package/dist/accounts-DGth1vsM.js +0 -107
  633. package/dist/accounts-Do6Ir-q3.js +0 -2
  634. package/dist/acp-cli-BHgjn8rh.js +0 -2193
  635. package/dist/acp-spawn-BAM_Jrft.js +0 -2
  636. package/dist/acp-spawn-DyBD_Y_t.js +0 -1093
  637. package/dist/acp-stateful-target-driver-DKGnfjWu.js +0 -89
  638. package/dist/action-agents-CzMSNQdc.js +0 -67
  639. package/dist/action-focus-CpjIrZFe.js +0 -132
  640. package/dist/action-help-BhE9UosK.js +0 -7
  641. package/dist/action-info-CH2j6dKT.js +0 -101
  642. package/dist/action-kill-CB4AnLIf.js +0 -33
  643. package/dist/action-list-CQ8LbzvR.js +0 -21
  644. package/dist/action-log-DZblh247.js +0 -30
  645. package/dist/action-send-DMe0B4FG.js +0 -39
  646. package/dist/action-spawn-CkKMESb5.js +0 -47
  647. package/dist/action-unfocus-DjQzPZwU.js +0 -29
  648. package/dist/actions.runtime-CUdRdpLB.js +0 -5
  649. package/dist/actions.runtime-CxRstWdN.js +0 -18
  650. package/dist/agent-command-Nh_kPL3z.js +0 -874
  651. package/dist/agent-harness-runtime-BEb7Wk1m.js +0 -144
  652. package/dist/agent-q6U-cKJn.js +0 -2
  653. package/dist/agent-runner-utils-x_qJ6xYC.js +0 -239
  654. package/dist/agent-runner.runtime-DRvTfUPd.js +0 -3455
  655. package/dist/agent-runtime-jSYYQd6f.js +0 -18
  656. package/dist/agents-BKOpsZXw.js +0 -5
  657. package/dist/agents-BY34ViPX.js +0 -954
  658. package/dist/aliases-CD5YlX7d.js +0 -2
  659. package/dist/aliases-Dq31zANx.js +0 -96
  660. package/dist/api-BhxN9fxJ.js +0 -139
  661. package/dist/api-DjL_3olO.js +0 -5
  662. package/dist/api-jIYND-S5.js +0 -3
  663. package/dist/approval-gateway-resolver-BfvdJW5s.js +0 -29
  664. package/dist/approval-gateway-runtime-BBf976nt.js +0 -2
  665. package/dist/approval-handler-runtime-Bq4p5wvg.js +0 -439
  666. package/dist/approval-native-runtime-IrisOZrU.js +0 -729
  667. package/dist/attempt-execution.runtime-BXGalt-_.js +0 -509
  668. package/dist/attempt.prompt-helpers-A-pc2LfL.js +0 -221
  669. package/dist/attempt.tool-run-context-Ukna4ck-.js +0 -933
  670. package/dist/audit-CVUpfDvE.js +0 -939
  671. package/dist/audit.runtime-CsuGXvud.js +0 -7
  672. package/dist/auth-CjcZyRUW.js +0 -383
  673. package/dist/auth-order-DIkyTpW4.js +0 -2
  674. package/dist/auth-order-Dpt1K1rT.js +0 -96
  675. package/dist/auth-sVuL2xeZ.js +0 -2
  676. package/dist/bash-tools-DDv0zQh9.js +0 -2824
  677. package/dist/bash-tools-s-QSvRmt.js +0 -3
  678. package/dist/binding-routing-Cz5R2kFK.js +0 -85
  679. package/dist/binding-targets-D4j2hdQh.js +0 -121
  680. package/dist/bridge-server-X8SdeAI3.js +0 -113
  681. package/dist/browser-control-auth-BrF3DZxC.js +0 -2
  682. package/dist/browser-node-runtime-BecPmKOx.js +0 -12
  683. package/dist/browser-profiles-BxAKEG3x.js +0 -2
  684. package/dist/browser-runtime-D9fTDscJ.js +0 -387
  685. package/dist/browser-setup-tools--AQGWGvl.js +0 -13
  686. package/dist/build-B0nbyXrw.js +0 -550
  687. package/dist/call-BvqN9kay.js +0 -3
  688. package/dist/call-Dk5rTl-p.js +0 -331
  689. package/dist/call.runtime-Bx1hKDwO.js +0 -2
  690. package/dist/capability-cli-286Z3Bq3.js +0 -1401
  691. package/dist/catchup-DyeQ6GNj.js +0 -300
  692. package/dist/channel-B5m01jSZ.js +0 -1802
  693. package/dist/channel-BE26v3WU.js +0 -840
  694. package/dist/channel-BS7r_Zt1.js +0 -226
  695. package/dist/channel-BUWCqkGh.js +0 -1320
  696. package/dist/channel-BhgKqvZn.js +0 -453
  697. package/dist/channel-Bx703sxQ.js +0 -297
  698. package/dist/channel-CDjlEQAM.js +0 -491
  699. package/dist/channel-ChrqAgRS.js +0 -595
  700. package/dist/channel-Crmp3BHh.js +0 -1100
  701. package/dist/channel-D7GdDfBl.js +0 -1174
  702. package/dist/channel-DqSzRIul.js +0 -350
  703. package/dist/channel-core-DIwclC34.js +0 -5
  704. package/dist/channel-inbound-DPW1gRUU.js +0 -31
  705. package/dist/channel-plugin-runtime-BJhRSlBI.js +0 -771
  706. package/dist/channel-runtime-sV_Sg0EO.js +0 -425
  707. package/dist/channel.runtime-4BaNapRW.js +0 -89
  708. package/dist/channel.runtime-Bk2w0Yzd.js +0 -2364
  709. package/dist/channel.runtime-Bo5_2imz.js +0 -109
  710. package/dist/channel.runtime-CdYWlMyL.js +0 -40130
  711. package/dist/channel.runtime-CrYmCmSw.js +0 -4
  712. package/dist/channel.runtime-D3APPhVs.js +0 -430
  713. package/dist/channel.runtime-DjF1Gg6N.js +0 -576
  714. package/dist/channel.setup-BxXrmAYb.js +0 -10
  715. package/dist/channels-DHcJgMnw.js +0 -733
  716. package/dist/channels-cli-Dnq08u4r.js +0 -268
  717. package/dist/chat-BGU3UVKD.js +0 -2830
  718. package/dist/clawbot-cli-C-rqJUW-.js +0 -9
  719. package/dist/cli-BlnGJbLJ.js +0 -219
  720. package/dist/cli-D0RU1q0-.js +0 -2
  721. package/dist/cli-DBw79G2t.js +0 -72
  722. package/dist/cli-Dul37_xp.js +0 -2
  723. package/dist/cli-runner-DY8BKEmu.js +0 -286
  724. package/dist/cli-runner.runtime-5JMuegF9.js +0 -3
  725. package/dist/cli-runner.runtime-DQROn9Ve.js +0 -4
  726. package/dist/cli.runtime-CGOUREQg.js +0 -1261
  727. package/dist/client-CCBN1ydB.js +0 -138
  728. package/dist/client-PHLyQ8il.js +0 -713
  729. package/dist/command-auth-79QKQZZ3.js +0 -76
  730. package/dist/command-config-resolution-BKAgMItc.js +0 -2
  731. package/dist/command-config-resolution-BUCAmCZ_.js +0 -23
  732. package/dist/command-config-resolution.runtime-BVtfeARM.js +0 -2
  733. package/dist/command-registry-C9axn0de.js +0 -4
  734. package/dist/command-registry-DkcFlIyM.js +0 -9
  735. package/dist/command-registry-core-DEDRtJmS.js +0 -106
  736. package/dist/command-secret-gateway-g0alGmKz.js +0 -528
  737. package/dist/command-status.runtime-Dw6Zj5hL.js +0 -87
  738. package/dist/commands-acp-De-XFc40.js +0 -77
  739. package/dist/commands-compact.runtime-6gixR2a8.js +0 -10
  740. package/dist/commands-handlers.runtime-DCmZAlRN.js +0 -4599
  741. package/dist/commands-status-CION7GYY.js +0 -16
  742. package/dist/commands-status.runtime-FBwoHftv.js +0 -3
  743. package/dist/commands-subagents-control.runtime-C2xgOYKM.js +0 -2
  744. package/dist/commands-subagents-control.runtime-CgIEblx3.js +0 -3
  745. package/dist/commands-system-prompt-B-jC-KV-.js +0 -158
  746. package/dist/commands-system-prompt-DeK5Jhy_.js +0 -2
  747. package/dist/commands.runtime-CHSb1kYa.js +0 -167
  748. package/dist/compact-Dwchggv2.js +0 -1118
  749. package/dist/compact.runtime-jDUYMSjR.js +0 -12
  750. package/dist/completion-cli-DGiZcg4E.js +0 -328
  751. package/dist/config-Bnb9qa1S.js +0 -252
  752. package/dist/config-cli-BuZ5RUhD.js +0 -1078
  753. package/dist/configure-BLNGlWh0.js +0 -1252
  754. package/dist/configure-nPzsEeOb.js +0 -2
  755. package/dist/connect-options-C9cvS-bh.js +0 -699
  756. package/dist/control-auth-D2-P54fW.js +0 -125
  757. package/dist/control-service-CqUPgxlx.js +0 -156
  758. package/dist/control-ui/assets/agents-CA3uz9sP.js +0 -1052
  759. package/dist/control-ui/assets/canvas-D0sLy568.js +0 -269
  760. package/dist/control-ui/assets/channel-config-extras-CWzNTLS-.js +0 -2
  761. package/dist/control-ui/assets/channels-DXgjbWts.js +0 -463
  762. package/dist/control-ui/assets/cron-D-rffMH6.js +0 -933
  763. package/dist/control-ui/assets/de-l9FbKtxt.js +0 -2
  764. package/dist/control-ui/assets/debug-Vf_bLYLB.js +0 -94
  765. package/dist/control-ui/assets/es-CC-t9AUQ.js +0 -2
  766. package/dist/control-ui/assets/format-BL-FisEP.js +0 -9
  767. package/dist/control-ui/assets/fr-DZKceqST.js +0 -2
  768. package/dist/control-ui/assets/i18n-DFH8x0DD.js +0 -3
  769. package/dist/control-ui/assets/id-D93YKkrM.js +0 -2
  770. package/dist/control-ui/assets/index-lWAwAXYo.js +0 -6366
  771. package/dist/control-ui/assets/instances-BmzzTloa.js +0 -57
  772. package/dist/control-ui/assets/ja-JP-DoPdk5L_.js +0 -2
  773. package/dist/control-ui/assets/ko-8TeOGGHm.js +0 -2
  774. package/dist/control-ui/assets/logs-BjPSImvD.js +0 -74
  775. package/dist/control-ui/assets/mcp-CQGmuKdR.js +0 -281
  776. package/dist/control-ui/assets/nodes-CDhqPGsD.js +0 -618
  777. package/dist/control-ui/assets/pl-BSP1Y3tH.js +0 -2
  778. package/dist/control-ui/assets/plugins-D4fXQx07.js +0 -273
  779. package/dist/control-ui/assets/pt-BR-D4-81_zm.js +0 -2
  780. package/dist/control-ui/assets/sessions-DzjXl7P7.js +0 -306
  781. package/dist/control-ui/assets/skills-BTQrLVPj.js +0 -323
  782. package/dist/control-ui/assets/skills-shared-CX4mwYFK.js +0 -11
  783. package/dist/control-ui/assets/th-DrnubOIu.js +0 -2
  784. package/dist/control-ui/assets/tr-BMyrj0eZ.js +0 -2
  785. package/dist/control-ui/assets/uk-CZhU3bHK.js +0 -2
  786. package/dist/control-ui/assets/wallet-DPb6whuj.js +0 -285
  787. package/dist/control-ui/assets/zh-CN-CH12jxSw.js +0 -2
  788. package/dist/control-ui/assets/zh-TW-CaTySceX.js +0 -2
  789. package/dist/conversation-id-BAzJOKBB.js +0 -235
  790. package/dist/conversation-id-WJLKuyy9.js +0 -38
  791. package/dist/conversation-runtime-D8fK5aI0.js +0 -31
  792. package/dist/core-DywmHt1k.js +0 -275
  793. package/dist/cron-cli-CeEJRkfR.js +0 -713
  794. package/dist/daemon-cli-BZZOjJHx.js +0 -12
  795. package/dist/dashboard-C0NRxmP3.js +0 -81
  796. package/dist/dashboard-DqhPgQv-.js +0 -2
  797. package/dist/delegate-DwVbOeR5.js +0 -64
  798. package/dist/detached-task-runtime-DiDRj-v-.js +0 -73
  799. package/dist/devices-cli-BKVbpwVc.js +0 -498
  800. package/dist/diagnostics-gh3UN_iV.js +0 -154
  801. package/dist/direct-dm-CwHHUkHV.js +0 -64
  802. package/dist/dispatch-B5af8_1v.js +0 -1131
  803. package/dist/dispatch-acp-DgOnUWBl.js +0 -981
  804. package/dist/dispatch-acp-manager.runtime-XWNjVh_M.js +0 -3
  805. package/dist/dispatch-acp.runtime-BdYL_ZqM.js +0 -19
  806. package/dist/doctor-device-pairing-CtGzWmXB.js +0 -307
  807. package/dist/doctor-gateway-daemon-flow-CCBI0jL4.js +0 -250
  808. package/dist/doctor-gateway-health-CkjqPFDl.js +0 -63
  809. package/dist/doctor-health-BOhuy1vP.js +0 -59
  810. package/dist/doctor-health-contributions-ChEuyLAY.js +0 -493
  811. package/dist/doctor-prompter-9nOTFD0Q.js +0 -56
  812. package/dist/doctor-workspace-status-CO5Ocwlt.js +0 -75
  813. package/dist/dreaming-GOPEFPio.js +0 -1574
  814. package/dist/dreaming-narrative-DfxHaxOU.js +0 -595
  815. package/dist/embedded-gateway-stub.runtime-B2OWcbsK.js +0 -9
  816. package/dist/exec-approvals-cli-CGeFtFbB.js +0 -498
  817. package/dist/fallbacks-CdfWAgNP.js +0 -2
  818. package/dist/fallbacks-eXbQ8TBp.js +0 -31
  819. package/dist/fallbacks-shared-akcCu5CD.js +0 -111
  820. package/dist/gateway-D-dDKqwi.js +0 -115
  821. package/dist/gateway-cli-DBS06Da8.js +0 -1283
  822. package/dist/gateway-rpc-Cxa8dVW5.js +0 -14
  823. package/dist/gateway-rpc.runtime-D76s-oxs.js +0 -23
  824. package/dist/gateway-runtime-Dhm_gLh1.js +0 -15
  825. package/dist/gateway-status-C_L_CdOg.js +0 -584
  826. package/dist/genesis-tools-rRJB3JXY.js +0 -9166
  827. package/dist/genesis-tools.runtime-6oKokqaA.js +0 -2
  828. package/dist/get-reply-BkiDsDVY.js +0 -3897
  829. package/dist/get-reply-from-config.runtime-CHKCcj9D.js +0 -2
  830. package/dist/graph-users-BnXIYyC5.js +0 -1337
  831. package/dist/health-ZsJNENSY.js +0 -3
  832. package/dist/health-osa9LOJf.js +0 -469
  833. package/dist/health-route-8TdKOYLp.js +0 -2
  834. package/dist/health-route-BdLtX2Bg.js +0 -41
  835. package/dist/heartbeat-runner-BCbkAprr.js +0 -1292
  836. package/dist/heartbeat-runner-Dc1K8S94.js +0 -5
  837. package/dist/heartbeat-runner.runtime-pJaAsgLY.js +0 -4
  838. package/dist/hooks-cli-C3ggAz0i.js +0 -433
  839. package/dist/image-fallbacks-CiSae-lb.js +0 -2
  840. package/dist/image-fallbacks-vI8KUh6N.js +0 -31
  841. package/dist/inbound-reply-dispatch-DLM60UDh.js +0 -73
  842. package/dist/infra-runtime-CrHVeejV.js +0 -39
  843. package/dist/init-BKeEiV2q.js +0 -59
  844. package/dist/library-CHB7yTo5.js +0 -45
  845. package/dist/lifecycle-CUULToPr.js +0 -229
  846. package/dist/lifecycle-DCMpTRD2.js +0 -571
  847. package/dist/lifecycle.runtime-CP4gRxWv.js +0 -2
  848. package/dist/list-0zDFAWTF.js +0 -2
  849. package/dist/list-BaxVHTAN.js +0 -131
  850. package/dist/list-CMRMgrPs.js +0 -1212
  851. package/dist/list-DSrBtnKI.js +0 -2
  852. package/dist/list.probe-BJYSCsJY.js +0 -419
  853. package/dist/llm-slug-generator-Bn_wrWYw.js +0 -79
  854. package/dist/load-config-qC2BWt8E.js +0 -35
  855. package/dist/local-dispatch.runtime-DyU7urGc.js +0 -8
  856. package/dist/logs-cli-zK71r_PE.js +0 -265
  857. package/dist/logs-cli.runtime-k0UtiaRP.js +0 -2
  858. package/dist/main-session-restart-recovery-DMT0Oj9a.js +0 -206
  859. package/dist/managed-image-attachments-B6XXE4--.js +0 -635
  860. package/dist/managed-image-attachments-BTzWoDWE.js +0 -2
  861. package/dist/manager-BCKuWA67.js +0 -2057
  862. package/dist/manager-rGwNUzMp.js +0 -2
  863. package/dist/markdown-to-line-DmPbXQA1.js +0 -790
  864. package/dist/mcp-cli-CYpPNMcE.js +0 -725
  865. package/dist/mcp-http-wiE81iKg.js +0 -529
  866. package/dist/memory-core-host-runtime-cli-BOSQRX1T.js +0 -9
  867. package/dist/message-CUDzVGD8.js +0 -232
  868. package/dist/message-action-runner-Dy0IpKa4.js +0 -1407
  869. package/dist/message-action-runner-KkBFzZdg.js +0 -2
  870. package/dist/message-actions-Dcdb5aSR.js +0 -143
  871. package/dist/message.gateway.runtime-D86fFO99.js +0 -2
  872. package/dist/models-auth-status-DkiX4s0b.js +0 -201
  873. package/dist/models-cli-CSUot1R3.js +0 -219
  874. package/dist/monitor-BA8ByMKR.js +0 -2
  875. package/dist/monitor-Bv1GIHW5.js +0 -1661
  876. package/dist/monitor-DTFY0ruF.js +0 -788
  877. package/dist/monitor-DXH-vNGn.js +0 -1459
  878. package/dist/monitor-Df5k8NGk.js +0 -671
  879. package/dist/monitor-Dk2YRF26.js +0 -1237
  880. package/dist/monitor-auth-CZOW753A.js +0 -207
  881. package/dist/monitor-processing-Clta8N4C.js +0 -1974
  882. package/dist/monitor.runtime-3ORbPT0X.js +0 -2
  883. package/dist/monitor.webhook-CRyTxENk.js +0 -180
  884. package/dist/msteams-BE0VieXF.js +0 -35
  885. package/dist/native-hook-relay-DAwGGuEx.js +0 -519
  886. package/dist/nextcloud-talk-DfYlTFsm.js +0 -17
  887. package/dist/node-cli-Bzyci_X_.js +0 -2276
  888. package/dist/nodes-cli-Er3OZkuk.js +0 -1046
  889. package/dist/nodes-utils-Cp8QZO8-.js +0 -84
  890. package/dist/nodes.helpers-CwKAAnRA.js +0 -34
  891. package/dist/notify-D_5n_vEJ.js +0 -315
  892. package/dist/onboard-BE82RudQ.js +0 -2
  893. package/dist/onboard-Bk4xL8X7.js +0 -70
  894. package/dist/onboard-helpers-D4WYa-6g.js +0 -204
  895. package/dist/onboard-helpers-MuFxPZg5.js +0 -6
  896. package/dist/onboard-interactive-0zmI-9ia.js +0 -24
  897. package/dist/onboard-non-interactive-DIRB95mT.js +0 -635
  898. package/dist/onboard-remote-7qR1knbU.js +0 -2
  899. package/dist/onboard-remote-CLmoySkk.js +0 -193
  900. package/dist/onboard-skills-C_873OK_.js +0 -134
  901. package/dist/onboard-skills-DrlBYc0t.js +0 -2
  902. package/dist/openai-http-DzCBqW6b.js +0 -500
  903. package/dist/openresponses-http-B2zgO5hQ.js +0 -1128
  904. package/dist/operator-approvals-client-mGBl4ptH.js +0 -68
  905. package/dist/outbound.runtime--HS-MxM_.js +0 -2
  906. package/dist/pair-command-approve-CCTSQKJH.js +0 -44
  907. package/dist/persistent-bindings.lifecycle-CnmqGsQf.js +0 -85
  908. package/dist/persistent-bindings.lifecycle-Dav1TX9E.js +0 -2
  909. package/dist/pi-embedded-BSKL8IgF.js +0 -4
  910. package/dist/pi-embedded-DMM8Pfp7.js +0 -2905
  911. package/dist/pi-embedded.runtime-Bv_roBVx.js +0 -4
  912. package/dist/pi-tool-definition-adapter-OrxjlSIM.js +0 -229
  913. package/dist/pi-tools-DD1YegeL.js +0 -1057
  914. package/dist/pi-tools.before-tool-call-J9ujp9Wp.js +0 -433
  915. package/dist/pi-tools.before-tool-call-hGEgKGZQ.js +0 -2
  916. package/dist/plugin-Cg3pHepG.js +0 -12195
  917. package/dist/plugin-enabled-wEQ8BQNw.js +0 -140
  918. package/dist/plugin-registration-DLcLJgqz.js +0 -23
  919. package/dist/plugin-service-BogBl5qk.js +0 -2892
  920. package/dist/policy-Bkh8Xtnb.js +0 -328
  921. package/dist/prepare.runtime-Cd31ie7u.js +0 -815
  922. package/dist/probe-9IM22Rkf.js +0 -2
  923. package/dist/probe-ButCyV3d.js +0 -1443
  924. package/dist/probe-D7QBUio1.js +0 -45
  925. package/dist/probe-DV6CWm0r.js +0 -74
  926. package/dist/probe-DkfetvwA.js +0 -2
  927. package/dist/probe-Dxo-LQjn.js +0 -2205
  928. package/dist/probe-nil3qQAV.js +0 -241
  929. package/dist/program-AcjZFtZQ.js +0 -111
  930. package/dist/prompt-select-styled-BSf77q2T.js +0 -20
  931. package/dist/protocol-C4I0nfuT.js +0 -2477
  932. package/dist/provider-dispatcher-CkiPxKIr.js +0 -22
  933. package/dist/provider-dispatcher-PmsHJlUO.js +0 -2
  934. package/dist/qr-cli-BHY0TO2W.js +0 -2
  935. package/dist/qr-cli-BbjDJSKp.js +0 -349
  936. package/dist/reaction-runtime-api-DOigJrbq.js +0 -116
  937. package/dist/reactions-CogkrjNr.js +0 -998
  938. package/dist/register-service-commands-IA3Nfza5.js +0 -71
  939. package/dist/register.agent-DD0aSYye.js +0 -248
  940. package/dist/register.configure-BOy4i7Ah.js +0 -15
  941. package/dist/register.maintenance-CUp6FEOF.js +0 -363
  942. package/dist/register.message-DezTIpNI.js +0 -329
  943. package/dist/register.onboard-Brpxl9p3.js +0 -88
  944. package/dist/register.runtime-BfH5rSb_.js +0 -81
  945. package/dist/register.setup-CIt4FVv0.js +0 -150
  946. package/dist/register.status-health-sessions-IbGZwSaG.js +0 -1215
  947. package/dist/register.subclis-B1H4fYxP.js +0 -29
  948. package/dist/register.subclis-D-_xtNVs.js +0 -3
  949. package/dist/register.subclis-core-CkJelRU8.js +0 -249
  950. package/dist/reply-dispatch-runtime-Lu4Metex.js +0 -13
  951. package/dist/reply-runtime-CgPzru94.js +0 -11
  952. package/dist/reply.runtime-sw14BA5F.js +0 -2
  953. package/dist/restart-health-1MNBua3p.js +0 -202
  954. package/dist/restart-health-BWGpwgPv.js +0 -2
  955. package/dist/root-help-B3zoC2OP.js +0 -44
  956. package/dist/routes-BM6fbday.js +0 -3341
  957. package/dist/routes-pVc_QLiP.js +0 -2
  958. package/dist/rpc-BGOWS7nj.js +0 -61
  959. package/dist/rpc.runtime-Ca9K3sx8.js +0 -21
  960. package/dist/run-delivery.runtime-CabntI64.js +0 -530
  961. package/dist/run-embedded.runtime-Q7wrP6Qn.js +0 -4
  962. package/dist/run-execution-cli.runtime-CtRUFc-M.js +0 -4
  963. package/dist/run-executor.runtime-Nm38xsKA.js +0 -277
  964. package/dist/run-main-kE0nFgvK.js +0 -567
  965. package/dist/run-subagent-registry.runtime-D9_scMUr.js +0 -2
  966. package/dist/run-wait-B2K_6JNL.js +0 -135
  967. package/dist/runtime-BZ296jTK.js +0 -9
  968. package/dist/runtime-DnZsw7MB.js +0 -973
  969. package/dist/runtime-api-BL9vpbvb.js +0 -14
  970. package/dist/runtime-api-BbsLJB4C.js +0 -9
  971. package/dist/runtime-api-ChwFrQRw.js +0 -9
  972. package/dist/runtime-api-_fH7M3Qh.js +0 -4
  973. package/dist/runtime-embedded-pi.runtime-TOdW-E-2.js +0 -2
  974. package/dist/runtime-internal-DGwOFi_E.js +0 -2
  975. package/dist/runtime-options-CSPfxkb1.js +0 -275
  976. package/dist/runtime-schema-CMRvOPkk.js +0 -28576
  977. package/dist/scan-D6gkNpKl.js +0 -523
  978. package/dist/scan-_9J5-5L6.js +0 -2
  979. package/dist/secrets-cli-DlVSRQPM.js +0 -2101
  980. package/dist/security-cli-DtzNOYL2.js +0 -486
  981. package/dist/selection-CBJZE_FL.js +0 -7764
  982. package/dist/selection-XsoEF2p2.js +0 -2
  983. package/dist/send-BAaDBRfi.js +0 -156
  984. package/dist/send-BB-M1afy.js +0 -102
  985. package/dist/send.runtime-CI_75KUP.js +0 -2
  986. package/dist/server-B_BiVYFv.js +0 -13
  987. package/dist/server-D58E1Cua.js +0 -77
  988. package/dist/server-context-D5AnCc1E.js +0 -2
  989. package/dist/server-context-bt09wrJu.js +0 -847
  990. package/dist/server-node-events-CUx4-7FL.js +0 -481
  991. package/dist/server-plugin-bootstrap-CU5P500z.js +0 -12708
  992. package/dist/server-plugin-bootstrap-CXm9xWXR.js +0 -2
  993. package/dist/server-restart-sentinel-ByFI_0MB.js +0 -697
  994. package/dist/server.impl-BBBEDK9u.js +0 -12864
  995. package/dist/session-kill-http-9MoO6FXC.js +0 -110
  996. package/dist/session-reset-service-redPsOs-.js +0 -497
  997. package/dist/session-route-C8oB2UYs.js +0 -93
  998. package/dist/session-status.runtime-D3bYBPJe.js +0 -2
  999. package/dist/session-subagent-reactivation.runtime-aat7tUag.js +0 -2
  1000. package/dist/session-tab-registry-CAJ_oDsb.js +0 -581
  1001. package/dist/session-visibility-Dq88jJYB.js +0 -147
  1002. package/dist/sessions-helpers-C8-IkqhO.js +0 -305
  1003. package/dist/sessions-history-http-4Ftuwnes.js +0 -383
  1004. package/dist/sessions-patch-BsyNHOaz.js +0 -309
  1005. package/dist/sessions-resolve-gKLz2Bup.js +0 -174
  1006. package/dist/sessions.runtime-C1W59rQY.js +0 -2
  1007. package/dist/setup-DhvXyU_5.js +0 -636
  1008. package/dist/setup-api-B9Y4qPgq.js +0 -29
  1009. package/dist/setup-core-CdFQ6ZXC.js +0 -176
  1010. package/dist/setup-core-kXUD3Kat.js +0 -171
  1011. package/dist/setup-surface-BFL9WfBs.js +0 -219
  1012. package/dist/setup-surface-Cxg_nSWc.js +0 -286
  1013. package/dist/setup-surface-DbooMj782.js +0 -403
  1014. package/dist/setup.finalize-CKxukDYi.js +0 -547
  1015. package/dist/setup.gateway-config-BhEtXwaB.js +0 -250
  1016. package/dist/shared-BNVKrp5y.js +0 -76
  1017. package/dist/shared-CM3mnx7z.js +0 -198
  1018. package/dist/shared-CfrsSVhL.js +0 -121
  1019. package/dist/slash-state-2Z-om57Q.js +0 -1911
  1020. package/dist/src-DAoKvK_N.js +0 -3974
  1021. package/dist/startup-context-CtYAdYwd.js +0 -312
  1022. package/dist/status-B2M0Imij.js +0 -3
  1023. package/dist/status-Bd-BNmiE.js +0 -2
  1024. package/dist/status-D6nbpHFi.js +0 -397
  1025. package/dist/status-MByUxUGu.js +0 -209
  1026. package/dist/status-QUjO1tkz.js +0 -2
  1027. package/dist/status-all-DPa-BiHk.js +0 -498
  1028. package/dist/status-erNo8YmW.js +0 -190
  1029. package/dist/status-json-command-C9rbAyj-.js +0 -84
  1030. package/dist/status-json-tO3CQXIQ.js +0 -14
  1031. package/dist/status-runtime-shared-DmBB_gmT.js +0 -257
  1032. package/dist/status-subagents.runtime-BXAZr5y0.js +0 -18
  1033. package/dist/status-text-BCeYk0-q.js +0 -237
  1034. package/dist/status.gateway-connection.runtime-bt35dapy.js +0 -2
  1035. package/dist/status.gather-B9a-CEev.js +0 -292
  1036. package/dist/status.gather-ahBLFzk6.js +0 -2
  1037. package/dist/status.runtime-BrErwtfc.js +0 -2
  1038. package/dist/status.scan-D2mvM4II.js +0 -65
  1039. package/dist/status.scan-overview-uOOaqp1t.js +0 -379
  1040. package/dist/status.scan.fast-json-C9dkN28s.js +0 -2
  1041. package/dist/status.scan.fast-json-DY3Or8S4.js +0 -132
  1042. package/dist/status.summary-Cf4p2BPK.js +0 -2
  1043. package/dist/status.summary-DxfZCcNa.js +0 -214
  1044. package/dist/subagent-announce-CyQZsAIm.js +0 -351
  1045. package/dist/subagent-announce-delivery-CgdPNjMA.js +0 -726
  1046. package/dist/subagent-announce-output-D1xi4Tk1.js +0 -364
  1047. package/dist/subagent-control-D-O6I8Mt.js +0 -506
  1048. package/dist/subagent-followup.runtime-BbA7NPAq.js +0 -68
  1049. package/dist/subagent-orphan-recovery-C6_cmAyE.js +0 -305
  1050. package/dist/subagent-registry-Dn_XpDh0.js +0 -1753
  1051. package/dist/subagent-registry-DodFw3pu.js +0 -3
  1052. package/dist/subagent-spawn-Dw5lttXp.js +0 -1005
  1053. package/dist/system-cli-CSqO2Z4K.js +0 -59
  1054. package/dist/targets-CMdwh9lR.js +0 -67
  1055. package/dist/task-executor-DgZSfcBk.js +0 -360
  1056. package/dist/task-owner-access-9c38idlo.js +0 -74
  1057. package/dist/task-registry-Z-lBPkNj.js +0 -2366
  1058. package/dist/task-registry-delivery-runtime-DOV4qoj4.js +0 -2
  1059. package/dist/task-registry-delivery-runtime-EATr0C3C.js +0 -3
  1060. package/dist/task-registry.maintenance-C1YMEwhk.js +0 -416
  1061. package/dist/task-registry.maintenance-CBfaUWcp.js +0 -2
  1062. package/dist/testing-CFk04o9M.js +0 -575
  1063. package/dist/text-report-QhVG354o.js +0 -587
  1064. package/dist/tool-resolution-D6V4tg-G.js +0 -90
  1065. package/dist/tools-effective-inventory-DFU7yYvD.js +0 -152
  1066. package/dist/tools-invoke-http-y6WIa3Ku.js +0 -206
  1067. package/dist/trash-rhbwNhfQ.js +0 -24
  1068. package/dist/tui-cli-BfxeO4YM.js +0 -4575
  1069. package/dist/update-cli-DaN9bvPV.js +0 -1759
  1070. package/dist/upgrade-f5dlIxir.js +0 -1226
  1071. package/dist/video-generation-task-status-yX54iO8n.js +0 -163
  1072. package/dist/wait-for-idle-before-flush-mZrBNr5z.js +0 -5986
  1073. package/dist/wizard-models-D_avLyHR.js +0 -334
@@ -1,2892 +0,0 @@
1
- import { a as normalizeLowercaseStringOrEmpty, c as normalizeOptionalString, f as readStringValue, s as normalizeOptionalLowercaseString } from "./string-coerce-DPP_aYVc.js";
2
- import { _ as shortenHomePath } from "./utils-CWrkFsp0.js";
3
- import { n as defaultRuntime } from "./runtime-DDkDH9fa.js";
4
- import { t as formatDocsLink } from "./links-C1-jbHJx.js";
5
- import { r as theme } from "./theme-DD6pQv2_.js";
6
- import { n as inheritOptionFromParent } from "./command-options-BAeBeFgJ.js";
7
- import { t as formatCliCommand } from "./command-format-B3Q5KD9o.js";
8
- import { n as info, t as danger } from "./globals-wYf9_gv5.js";
9
- import { a as loadConfig } from "./io-B1sv_bx7.js";
10
- import { En as errorShape, Tn as ErrorCodes } from "./protocol-C4I0nfuT.js";
11
- import { t as parseBooleanValue } from "./boolean-X_ITY8mk.js";
12
- import { c as imageResultFromFile, g as readStringParam, l as jsonResult } from "./common-BtK-bRqD.js";
13
- import { t as callGatewayTool } from "./gateway-D-dDKqwi.js";
14
- import { i as stringEnum, r as optionalStringEnum } from "./typebox-DZB5krxi.js";
15
- import { a as selectDefaultNodeFromList, i as resolveNodeIdFromList, t as listNodes } from "./nodes-utils-Cp8QZO8-.js";
16
- import { i as wrapExternalContent } from "./external-content-Dmoxx-Ic.js";
17
- import { t as withTimeout } from "./with-timeout-CFh4cUs-.js";
18
- import "./text-runtime-DuYzmNnc.js";
19
- import { t as startLazyPluginServiceModule } from "./lazy-service-module-DP9zBTob.js";
20
- import "./browser-config-runtime-B1v_5K97.js";
21
- import { n as callGatewayFromCli, t as addGatewayClientOptions } from "./gateway-rpc-Cxa8dVW5.js";
22
- import { n as runCommandWithRuntime } from "./cli-utils-C80mOHVm.js";
23
- import { i as resolveNodeCommandAllowlist, n as isNodeCommandAllowed } from "./node-command-policy-BaEyd8HH.js";
24
- import { i as safeParseJson, n as respondUnavailableOnNodeInvokeError } from "./nodes.helpers-CwKAAnRA.js";
25
- import "./browser-node-runtime-BecPmKOx.js";
26
- import "./browser-security-runtime-bMw-CyNH.js";
27
- import { t as formatHelpExamples } from "./help-format-DziqFQ8a.js";
28
- import "./browser-setup-tools--AQGWGvl.js";
29
- import "./channel-actions-JVR1YG7X.js";
30
- import { _ as browserStop, a as untrackSessionBrowserTab, d as browserOpenTab, f as browserProfiles, g as browserStatus, h as browserStart, i as trackSessionBrowserTab, l as browserDoctor, m as browserSnapshot, o as browserCloseTab, r as touchSessionBrowserTab, u as browserFocusTab, y as browserTabs } from "./session-tab-registry-CAJ_oDsb.js";
31
- import { c as DEFAULT_AI_SNAPSHOT_MAX_CHARS, i as resolveExistingPathsWithinRoot, r as DEFAULT_UPLOAD_DIR } from "./paths-CQ_G-HVX.js";
32
- import { a as applyBrowserProxyPaths, c as browserPdfSave, d as browserArmFileChooser, f as browserNavigate, i as resolveRequestedBrowserProfile, l as browserAct, n as isPersistentBrowserProfileMutation, o as persistBrowserProxyFiles, p as browserScreenshotAction, s as browserConsoleMessages, u as browserArmDialog } from "./browser-runtime-D9fTDscJ.js";
33
- import { n as resolveProfile, t as resolveBrowserConfig } from "./config-Bnb9qa1S.js";
34
- import { f as redactCdpUrl } from "./cdp.helpers-Ch0SX_4B.js";
35
- import { r as getBrowserProfileCapabilities } from "./target-id-2b0JJ9TC.js";
36
- import { l as normalizeBrowserFormField, u as normalizeBrowserFormFieldValue } from "./pw-role-snapshot-CWu8vOvM.js";
37
- import { a as createBrowserRouteDispatcher, r as startBrowserControlServiceFromConfig, t as createBrowserControlContext } from "./control-service-CqUPgxlx.js";
38
- import fs from "node:fs/promises";
39
- import crypto from "node:crypto";
40
- import { Type } from "typebox";
41
- //#region extensions/browser/src/browser-tool.schema.ts
42
- const BROWSER_ACT_KINDS = [
43
- "click",
44
- "clickCoords",
45
- "type",
46
- "press",
47
- "hover",
48
- "drag",
49
- "select",
50
- "fill",
51
- "resize",
52
- "wait",
53
- "evaluate",
54
- "close"
55
- ];
56
- const BROWSER_TOOL_ACTIONS = [
57
- "doctor",
58
- "status",
59
- "start",
60
- "stop",
61
- "profiles",
62
- "tabs",
63
- "open",
64
- "focus",
65
- "close",
66
- "snapshot",
67
- "screenshot",
68
- "navigate",
69
- "console",
70
- "pdf",
71
- "upload",
72
- "dialog",
73
- "act"
74
- ];
75
- const BROWSER_TARGETS = [
76
- "sandbox",
77
- "host",
78
- "node"
79
- ];
80
- const BROWSER_SNAPSHOT_FORMATS = ["aria", "ai"];
81
- const BROWSER_SNAPSHOT_MODES = ["efficient"];
82
- const BROWSER_SNAPSHOT_REFS = ["role", "aria"];
83
- const BROWSER_IMAGE_TYPES = ["png", "jpeg"];
84
- const BrowserActSchema = Type.Object({
85
- kind: stringEnum(BROWSER_ACT_KINDS),
86
- targetId: Type.Optional(Type.String()),
87
- ref: Type.Optional(Type.String()),
88
- doubleClick: Type.Optional(Type.Boolean()),
89
- button: Type.Optional(Type.String()),
90
- modifiers: Type.Optional(Type.Array(Type.String())),
91
- x: Type.Optional(Type.Number()),
92
- y: Type.Optional(Type.Number()),
93
- text: Type.Optional(Type.String()),
94
- submit: Type.Optional(Type.Boolean()),
95
- slowly: Type.Optional(Type.Boolean()),
96
- key: Type.Optional(Type.String()),
97
- delayMs: Type.Optional(Type.Number()),
98
- startRef: Type.Optional(Type.String()),
99
- endRef: Type.Optional(Type.String()),
100
- values: Type.Optional(Type.Array(Type.String())),
101
- fields: Type.Optional(Type.Array(Type.Object({}, { additionalProperties: true }))),
102
- width: Type.Optional(Type.Number()),
103
- height: Type.Optional(Type.Number()),
104
- timeMs: Type.Optional(Type.Number()),
105
- selector: Type.Optional(Type.String()),
106
- url: Type.Optional(Type.String()),
107
- loadState: Type.Optional(Type.String()),
108
- textGone: Type.Optional(Type.String()),
109
- timeoutMs: Type.Optional(Type.Number()),
110
- fn: Type.Optional(Type.String())
111
- });
112
- const BrowserToolSchema = Type.Object({
113
- action: stringEnum(BROWSER_TOOL_ACTIONS),
114
- target: optionalStringEnum(BROWSER_TARGETS),
115
- node: Type.Optional(Type.String()),
116
- profile: Type.Optional(Type.String()),
117
- targetUrl: Type.Optional(Type.String()),
118
- url: Type.Optional(Type.String()),
119
- targetId: Type.Optional(Type.String()),
120
- label: Type.Optional(Type.String()),
121
- limit: Type.Optional(Type.Number()),
122
- maxChars: Type.Optional(Type.Number()),
123
- mode: optionalStringEnum(BROWSER_SNAPSHOT_MODES),
124
- snapshotFormat: optionalStringEnum(BROWSER_SNAPSHOT_FORMATS),
125
- refs: optionalStringEnum(BROWSER_SNAPSHOT_REFS),
126
- interactive: Type.Optional(Type.Boolean()),
127
- compact: Type.Optional(Type.Boolean()),
128
- depth: Type.Optional(Type.Number()),
129
- selector: Type.Optional(Type.String()),
130
- frame: Type.Optional(Type.String()),
131
- labels: Type.Optional(Type.Boolean()),
132
- urls: Type.Optional(Type.Boolean()),
133
- fullPage: Type.Optional(Type.Boolean()),
134
- ref: Type.Optional(Type.String()),
135
- element: Type.Optional(Type.String()),
136
- type: optionalStringEnum(BROWSER_IMAGE_TYPES),
137
- level: Type.Optional(Type.String()),
138
- paths: Type.Optional(Type.Array(Type.String())),
139
- inputRef: Type.Optional(Type.String()),
140
- timeoutMs: Type.Optional(Type.Number()),
141
- accept: Type.Optional(Type.Boolean()),
142
- promptText: Type.Optional(Type.String()),
143
- kind: Type.Optional(stringEnum(BROWSER_ACT_KINDS)),
144
- doubleClick: Type.Optional(Type.Boolean()),
145
- button: Type.Optional(Type.String()),
146
- modifiers: Type.Optional(Type.Array(Type.String())),
147
- x: Type.Optional(Type.Number()),
148
- y: Type.Optional(Type.Number()),
149
- text: Type.Optional(Type.String()),
150
- submit: Type.Optional(Type.Boolean()),
151
- slowly: Type.Optional(Type.Boolean()),
152
- key: Type.Optional(Type.String()),
153
- delayMs: Type.Optional(Type.Number()),
154
- startRef: Type.Optional(Type.String()),
155
- endRef: Type.Optional(Type.String()),
156
- values: Type.Optional(Type.Array(Type.String())),
157
- fields: Type.Optional(Type.Array(Type.Object({}, { additionalProperties: true }))),
158
- width: Type.Optional(Type.Number()),
159
- height: Type.Optional(Type.Number()),
160
- timeMs: Type.Optional(Type.Number()),
161
- textGone: Type.Optional(Type.String()),
162
- loadState: Type.Optional(Type.String()),
163
- fn: Type.Optional(Type.String()),
164
- request: Type.Optional(BrowserActSchema)
165
- });
166
- //#endregion
167
- //#region extensions/browser/src/browser-tool.actions.ts
168
- const browserToolActionDeps = {
169
- browserAct,
170
- browserConsoleMessages,
171
- browserSnapshot,
172
- browserTabs,
173
- imageResultFromFile,
174
- loadConfig
175
- };
176
- const BROWSER_ACT_REQUEST_TIMEOUT_SLACK_MS = 5e3;
177
- function normalizePositiveTimeoutMs(value) {
178
- return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.floor(value) : void 0;
179
- }
180
- function supportsBrowserActTimeout(request) {
181
- switch (request.kind) {
182
- case "click":
183
- case "type":
184
- case "hover":
185
- case "scrollIntoView":
186
- case "drag":
187
- case "select":
188
- case "fill":
189
- case "evaluate":
190
- case "wait": return true;
191
- default: return false;
192
- }
193
- }
194
- function existingSessionRejectsActTimeout(request) {
195
- switch (request.kind) {
196
- case "type":
197
- case "hover":
198
- case "scrollIntoView":
199
- case "drag":
200
- case "select":
201
- case "fill":
202
- case "evaluate": return true;
203
- default: return false;
204
- }
205
- }
206
- function usesExistingSessionProfile(profileName) {
207
- const cfg = browserToolActionDeps.loadConfig();
208
- const resolved = resolveBrowserConfig(cfg.browser, cfg);
209
- const profile = resolveProfile(resolved, profileName ?? resolved.defaultProfile);
210
- return profile ? getBrowserProfileCapabilities(profile).usesChromeMcp : false;
211
- }
212
- function withConfiguredActTimeout(request, profileName) {
213
- const typedRequest = request;
214
- if (normalizePositiveTimeoutMs(typedRequest.timeoutMs) !== void 0) return request;
215
- if (!supportsBrowserActTimeout(request)) return request;
216
- if (existingSessionRejectsActTimeout(request) && usesExistingSessionProfile(profileName)) return request;
217
- const configuredTimeout = normalizePositiveTimeoutMs(browserToolActionDeps.loadConfig().browser?.actionTimeoutMs) ?? 6e4;
218
- return {
219
- ...typedRequest,
220
- timeoutMs: configuredTimeout
221
- };
222
- }
223
- function resolveActProxyTimeoutMs(request) {
224
- const candidateTimeouts = [];
225
- const explicitTimeout = normalizePositiveTimeoutMs(request.timeoutMs);
226
- if (explicitTimeout !== void 0) candidateTimeouts.push(explicitTimeout + BROWSER_ACT_REQUEST_TIMEOUT_SLACK_MS);
227
- if (request.kind === "wait") {
228
- const waitDuration = normalizePositiveTimeoutMs(request.timeMs);
229
- if (waitDuration !== void 0) candidateTimeouts.push(waitDuration + BROWSER_ACT_REQUEST_TIMEOUT_SLACK_MS);
230
- }
231
- return candidateTimeouts.length ? Math.max(...candidateTimeouts) : void 0;
232
- }
233
- function formatAgentTab(tab) {
234
- if (!tab || typeof tab !== "object") return { value: tab };
235
- const source = tab;
236
- const targetId = readStringValue(source.targetId);
237
- const tabId = readStringValue(source.tabId);
238
- const label = readStringValue(source.label);
239
- const suggestedTargetId = readStringValue(source.suggestedTargetId) ?? label ?? tabId ?? targetId;
240
- return {
241
- ...suggestedTargetId ? { suggestedTargetId } : {},
242
- ...tabId ? { tabId } : {},
243
- ...label ? { label } : {},
244
- title: source.title,
245
- url: source.url,
246
- type: source.type,
247
- ...targetId ? { targetId } : {},
248
- ...source.wsUrl ? { wsUrl: source.wsUrl } : {}
249
- };
250
- }
251
- function wrapBrowserExternalJson(params) {
252
- return {
253
- wrappedText: wrapExternalContent(JSON.stringify(params.payload, null, 2), {
254
- source: "browser",
255
- includeWarning: params.includeWarning ?? true
256
- }),
257
- safeDetails: {
258
- ok: true,
259
- externalContent: {
260
- untrusted: true,
261
- source: "browser",
262
- kind: params.kind,
263
- wrapped: true
264
- }
265
- }
266
- };
267
- }
268
- function formatTabsToolResult(tabs) {
269
- const formattedTabs = tabs.map((tab) => formatAgentTab(tab));
270
- const wrapped = wrapBrowserExternalJson({
271
- kind: "tabs",
272
- payload: { tabs: formattedTabs },
273
- includeWarning: false
274
- });
275
- return {
276
- content: [{
277
- type: "text",
278
- text: wrapped.wrappedText
279
- }],
280
- details: {
281
- ...wrapped.safeDetails,
282
- tabCount: tabs.length,
283
- tabs: formattedTabs
284
- }
285
- };
286
- }
287
- function formatConsoleToolResult(result) {
288
- const wrapped = wrapBrowserExternalJson({
289
- kind: "console",
290
- payload: result,
291
- includeWarning: false
292
- });
293
- return {
294
- content: [{
295
- type: "text",
296
- text: wrapped.wrappedText
297
- }],
298
- details: {
299
- ...wrapped.safeDetails,
300
- targetId: readStringValue(result.targetId),
301
- messageCount: Array.isArray(result.messages) ? result.messages.length : void 0
302
- }
303
- };
304
- }
305
- function isChromeStaleTargetError(profile, err) {
306
- if (!profile) return false;
307
- if (profile === "user") {
308
- const msg = String(err);
309
- return msg.includes("404:") && msg.includes("tab not found");
310
- }
311
- const cfg = browserToolActionDeps.loadConfig();
312
- const browserProfile = resolveProfile(resolveBrowserConfig(cfg.browser, cfg), profile);
313
- if (!browserProfile || !getBrowserProfileCapabilities(browserProfile).usesChromeMcp) return false;
314
- const msg = String(err);
315
- return msg.includes("404:") && msg.includes("tab not found");
316
- }
317
- function stripTargetIdFromActRequest(request) {
318
- if (!normalizeOptionalString(request.targetId)) return null;
319
- const retryRequest = { ...request };
320
- delete retryRequest.targetId;
321
- return retryRequest;
322
- }
323
- function canRetryChromeActWithoutTargetId(request) {
324
- const typedRequest = request;
325
- const kind = typeof typedRequest.kind === "string" ? typedRequest.kind : typeof typedRequest.action === "string" ? typedRequest.action : "";
326
- return kind === "hover" || kind === "scrollIntoView" || kind === "wait";
327
- }
328
- function isAriaRefsUnsupportedError(err) {
329
- const msg = String(err).toLowerCase();
330
- return msg.includes("refs=aria") && msg.includes("not support");
331
- }
332
- function withRoleRefsFallback(snapshotQuery) {
333
- return {
334
- ...snapshotQuery,
335
- refs: "role"
336
- };
337
- }
338
- async function executeTabsAction(params) {
339
- const { baseUrl, profile, timeoutMs, proxyRequest } = params;
340
- if (proxyRequest) return formatTabsToolResult((await proxyRequest({
341
- method: "GET",
342
- path: "/tabs",
343
- profile,
344
- timeoutMs
345
- })).tabs ?? []);
346
- return formatTabsToolResult(await browserToolActionDeps.browserTabs(baseUrl, {
347
- profile,
348
- timeoutMs
349
- }));
350
- }
351
- async function executeSnapshotAction(params) {
352
- const { input, baseUrl, profile, proxyRequest } = params;
353
- const snapshotDefaults = browserToolActionDeps.loadConfig().browser?.snapshotDefaults;
354
- const format = input.snapshotFormat === "ai" ? "ai" : input.snapshotFormat === "aria" ? "aria" : void 0;
355
- const formatExplicit = format !== void 0;
356
- const mode = input.mode === "efficient" ? "efficient" : !formatExplicit && format !== "aria" && snapshotDefaults?.mode === "efficient" ? "efficient" : void 0;
357
- const labels = typeof input.labels === "boolean" ? input.labels : void 0;
358
- const urls = typeof input.urls === "boolean" ? input.urls : void 0;
359
- const refs = input.refs === "aria" || input.refs === "role" ? input.refs : void 0;
360
- const hasMaxChars = Object.hasOwn(input, "maxChars");
361
- const targetId = normalizeOptionalString(input.targetId);
362
- const limit = typeof input.limit === "number" && Number.isFinite(input.limit) ? input.limit : void 0;
363
- const maxChars = typeof input.maxChars === "number" && Number.isFinite(input.maxChars) && input.maxChars > 0 ? Math.floor(input.maxChars) : void 0;
364
- const interactive = typeof input.interactive === "boolean" ? input.interactive : void 0;
365
- const compact = typeof input.compact === "boolean" ? input.compact : void 0;
366
- const depth = typeof input.depth === "number" && Number.isFinite(input.depth) ? input.depth : void 0;
367
- const selector = normalizeOptionalString(input.selector);
368
- const frame = normalizeOptionalString(input.frame);
369
- const resolvedMaxChars = format === "ai" ? hasMaxChars ? maxChars : mode === "efficient" ? void 0 : DEFAULT_AI_SNAPSHOT_MAX_CHARS : hasMaxChars ? maxChars : void 0;
370
- const snapshotQuery = {
371
- ...format ? { format } : {},
372
- targetId,
373
- limit,
374
- ...typeof resolvedMaxChars === "number" ? { maxChars: resolvedMaxChars } : {},
375
- refs,
376
- interactive,
377
- compact,
378
- depth,
379
- selector,
380
- frame,
381
- labels,
382
- urls,
383
- mode
384
- };
385
- let refsFallback;
386
- const readSnapshot = async (query) => proxyRequest ? await proxyRequest({
387
- method: "GET",
388
- path: "/snapshot",
389
- profile,
390
- query
391
- }) : await browserToolActionDeps.browserSnapshot(baseUrl, {
392
- ...query,
393
- profile
394
- });
395
- let snapshot;
396
- try {
397
- snapshot = await readSnapshot(snapshotQuery);
398
- } catch (err) {
399
- if (refs !== "aria" || !isAriaRefsUnsupportedError(err)) throw err;
400
- refsFallback = "role";
401
- snapshot = await readSnapshot(withRoleRefsFallback(snapshotQuery));
402
- }
403
- params.onTabActivity?.(readStringValue(snapshot.targetId) ?? targetId, snapshot.url);
404
- if (snapshot.format === "ai") {
405
- const wrappedSnapshot = wrapExternalContent(snapshot.snapshot ?? "", {
406
- source: "browser",
407
- includeWarning: true
408
- });
409
- const safeDetails = {
410
- ok: true,
411
- format: snapshot.format,
412
- targetId: snapshot.targetId,
413
- url: snapshot.url,
414
- truncated: snapshot.truncated,
415
- stats: snapshot.stats,
416
- refs: snapshot.refs ? Object.keys(snapshot.refs).length : void 0,
417
- labels: snapshot.labels,
418
- labelsCount: snapshot.labelsCount,
419
- labelsSkipped: snapshot.labelsSkipped,
420
- imagePath: snapshot.imagePath,
421
- imageType: snapshot.imageType,
422
- refsFallback,
423
- externalContent: {
424
- untrusted: true,
425
- source: "browser",
426
- kind: "snapshot",
427
- format: "ai",
428
- wrapped: true
429
- }
430
- };
431
- if (labels && snapshot.imagePath) return await browserToolActionDeps.imageResultFromFile({
432
- label: "browser:snapshot",
433
- path: snapshot.imagePath,
434
- extraText: wrappedSnapshot,
435
- details: safeDetails
436
- });
437
- return {
438
- content: [{
439
- type: "text",
440
- text: wrappedSnapshot
441
- }],
442
- details: safeDetails
443
- };
444
- }
445
- {
446
- const wrapped = wrapBrowserExternalJson({
447
- kind: "snapshot",
448
- payload: snapshot
449
- });
450
- return {
451
- content: [{
452
- type: "text",
453
- text: wrapped.wrappedText
454
- }],
455
- details: {
456
- ...wrapped.safeDetails,
457
- format: "aria",
458
- targetId: snapshot.targetId,
459
- url: snapshot.url,
460
- nodeCount: snapshot.nodes.length,
461
- externalContent: {
462
- untrusted: true,
463
- source: "browser",
464
- kind: "snapshot",
465
- format: "aria",
466
- wrapped: true
467
- }
468
- }
469
- };
470
- }
471
- }
472
- async function executeConsoleAction(params) {
473
- const { input, baseUrl, profile, proxyRequest } = params;
474
- const level = normalizeOptionalString(input.level);
475
- const targetId = normalizeOptionalString(input.targetId);
476
- if (proxyRequest) return formatConsoleToolResult(await proxyRequest({
477
- method: "GET",
478
- path: "/console",
479
- profile,
480
- query: {
481
- level,
482
- targetId
483
- }
484
- }));
485
- return formatConsoleToolResult(await browserToolActionDeps.browserConsoleMessages(baseUrl, {
486
- level,
487
- targetId,
488
- profile
489
- }));
490
- }
491
- async function executeActAction(params) {
492
- const { request, baseUrl, profile, proxyRequest } = params;
493
- const effectiveRequest = withConfiguredActTimeout(request, profile);
494
- try {
495
- const result = proxyRequest ? await proxyRequest({
496
- method: "POST",
497
- path: "/act",
498
- profile,
499
- body: effectiveRequest,
500
- timeoutMs: resolveActProxyTimeoutMs(effectiveRequest)
501
- }) : await browserToolActionDeps.browserAct(baseUrl, effectiveRequest, { profile });
502
- params.onTabActivity?.(readStringValue(result.targetId) ?? readStringValue(effectiveRequest.targetId), readStringValue(result.url));
503
- return jsonResult(result);
504
- } catch (err) {
505
- if (isChromeStaleTargetError(profile, err)) {
506
- const retryRequest = stripTargetIdFromActRequest(effectiveRequest);
507
- const tabs = proxyRequest ? (await proxyRequest({
508
- method: "GET",
509
- path: "/tabs",
510
- profile
511
- })).tabs ?? [] : await browserToolActionDeps.browserTabs(baseUrl, { profile }).catch(() => []);
512
- if (retryRequest && canRetryChromeActWithoutTargetId(effectiveRequest) && tabs.length === 1) try {
513
- const retryResult = proxyRequest ? await proxyRequest({
514
- method: "POST",
515
- path: "/act",
516
- profile,
517
- body: retryRequest,
518
- timeoutMs: resolveActProxyTimeoutMs(retryRequest)
519
- }) : await browserToolActionDeps.browserAct(baseUrl, retryRequest, { profile });
520
- params.onTabActivity?.(readStringValue(retryResult.targetId) ?? readStringValue(retryRequest.targetId), readStringValue(retryResult.url));
521
- return jsonResult(retryResult);
522
- } catch {}
523
- if (!tabs.length) throw new Error(`No browser tabs found for profile="${profile}". Make sure the configured Chromium-based browser (v144+) is running and has open tabs, then retry.`, { cause: err });
524
- throw new Error(`Chrome tab not found (stale targetId?). Run action=tabs profile="${profile}" and use one of the returned targetIds.`, { cause: err });
525
- }
526
- throw err;
527
- }
528
- }
529
- //#endregion
530
- //#region extensions/browser/src/browser-tool.ts
531
- const browserToolDeps = {
532
- browserAct,
533
- browserArmDialog,
534
- browserArmFileChooser,
535
- browserCloseTab,
536
- browserDoctor,
537
- browserFocusTab,
538
- browserNavigate,
539
- browserOpenTab,
540
- browserPdfSave,
541
- browserProfiles,
542
- browserScreenshotAction,
543
- browserStart,
544
- browserStatus,
545
- browserStop,
546
- imageResultFromFile,
547
- loadConfig,
548
- listNodes,
549
- callGatewayTool,
550
- touchSessionBrowserTab,
551
- trackSessionBrowserTab,
552
- untrackSessionBrowserTab
553
- };
554
- function readOptionalTargetAndTimeout(params) {
555
- return {
556
- targetId: normalizeOptionalString(params.targetId),
557
- timeoutMs: typeof params.timeoutMs === "number" && Number.isFinite(params.timeoutMs) ? params.timeoutMs : void 0
558
- };
559
- }
560
- function readTargetUrlParam(params) {
561
- return readStringParam(params, "targetUrl") ?? readStringParam(params, "url", {
562
- required: true,
563
- label: "targetUrl"
564
- });
565
- }
566
- const LEGACY_BROWSER_ACT_REQUEST_KEYS = [
567
- "targetId",
568
- "ref",
569
- "doubleClick",
570
- "button",
571
- "modifiers",
572
- "x",
573
- "y",
574
- "text",
575
- "submit",
576
- "slowly",
577
- "key",
578
- "delayMs",
579
- "startRef",
580
- "endRef",
581
- "values",
582
- "fields",
583
- "width",
584
- "height",
585
- "timeMs",
586
- "textGone",
587
- "selector",
588
- "url",
589
- "loadState",
590
- "fn",
591
- "timeoutMs"
592
- ];
593
- function readActRequestParam(params) {
594
- const requestParam = params.request;
595
- if (requestParam && typeof requestParam === "object") return requestParam;
596
- const kind = readStringParam(params, "kind");
597
- if (!kind) return;
598
- const request = { kind };
599
- for (const key of LEGACY_BROWSER_ACT_REQUEST_KEYS) {
600
- if (!Object.hasOwn(params, key)) continue;
601
- request[key] = params[key];
602
- }
603
- return request;
604
- }
605
- const DEFAULT_BROWSER_PROXY_TIMEOUT_MS = 2e4;
606
- const BROWSER_PROXY_GATEWAY_TIMEOUT_SLACK_MS = 5e3;
607
- function isBrowserNode$1(node) {
608
- const caps = Array.isArray(node.caps) ? node.caps : [];
609
- const commands = Array.isArray(node.commands) ? node.commands : [];
610
- return caps.includes("browser") || commands.includes("browser.proxy");
611
- }
612
- async function resolveBrowserNodeTarget$1(params) {
613
- const policy = browserToolDeps.loadConfig().gateway?.nodes?.browser;
614
- const mode = policy?.mode ?? "auto";
615
- if (mode === "off") {
616
- if (params.target === "node" || params.requestedNode) throw new Error("Node browser proxy is disabled (gateway.nodes.browser.mode=off).");
617
- return null;
618
- }
619
- if (params.sandboxBridgeUrl?.trim() && params.target !== "node" && !params.requestedNode) return null;
620
- if (params.target && params.target !== "node") return null;
621
- if (mode === "manual" && params.target !== "node" && !params.requestedNode) return null;
622
- const browserNodes = (await browserToolDeps.listNodes({})).filter((node) => node.connected && isBrowserNode$1(node));
623
- if (browserNodes.length === 0) {
624
- if (params.target === "node" || params.requestedNode) throw new Error("No connected browser-capable nodes.");
625
- return null;
626
- }
627
- const requested = params.requestedNode?.trim() || policy?.node?.trim();
628
- if (requested) {
629
- const nodeId = resolveNodeIdFromList(browserNodes, requested, false);
630
- const node = browserNodes.find((entry) => entry.nodeId === nodeId);
631
- return {
632
- nodeId,
633
- label: node?.displayName ?? node?.remoteIp ?? nodeId
634
- };
635
- }
636
- const selected = selectDefaultNodeFromList(browserNodes, {
637
- preferLocalMac: false,
638
- fallback: "none"
639
- });
640
- if (params.target === "node") {
641
- if (selected) return {
642
- nodeId: selected.nodeId,
643
- label: selected.displayName ?? selected.remoteIp ?? selected.nodeId
644
- };
645
- throw new Error(`Multiple browser-capable nodes connected (${browserNodes.length}). Set gateway.nodes.browser.node or pass node=<id>.`);
646
- }
647
- if (mode === "manual") return null;
648
- if (selected) return {
649
- nodeId: selected.nodeId,
650
- label: selected.displayName ?? selected.remoteIp ?? selected.nodeId
651
- };
652
- return null;
653
- }
654
- async function callBrowserProxy(params) {
655
- const proxyTimeoutMs = typeof params.timeoutMs === "number" && Number.isFinite(params.timeoutMs) ? Math.max(1, Math.floor(params.timeoutMs)) : DEFAULT_BROWSER_PROXY_TIMEOUT_MS;
656
- const gatewayTimeoutMs = proxyTimeoutMs + BROWSER_PROXY_GATEWAY_TIMEOUT_SLACK_MS;
657
- const payload = await browserToolDeps.callGatewayTool("node.invoke", { timeoutMs: gatewayTimeoutMs }, {
658
- nodeId: params.nodeId,
659
- command: "browser.proxy",
660
- params: {
661
- method: params.method,
662
- path: params.path,
663
- query: params.query,
664
- body: params.body,
665
- timeoutMs: proxyTimeoutMs,
666
- profile: params.profile
667
- },
668
- idempotencyKey: crypto.randomUUID()
669
- });
670
- const parsed = payload?.payload ?? (typeof payload?.payloadJSON === "string" && payload.payloadJSON ? JSON.parse(payload.payloadJSON) : null);
671
- if (!parsed || typeof parsed !== "object" || !("result" in parsed)) throw new Error("browser proxy failed");
672
- return parsed;
673
- }
674
- async function persistProxyFiles$1(files) {
675
- return await persistBrowserProxyFiles(files);
676
- }
677
- function applyProxyPaths$1(result, mapping) {
678
- applyBrowserProxyPaths(result, mapping);
679
- }
680
- function resolveBrowserBaseUrl(params) {
681
- const cfg = loadConfig();
682
- const resolved = resolveBrowserConfig(cfg.browser, cfg);
683
- const normalizedSandbox = params.sandboxBridgeUrl?.trim() ?? "";
684
- if ((params.target ?? (normalizedSandbox ? "sandbox" : "host")) === "sandbox") {
685
- if (!normalizedSandbox) throw new Error("Sandbox browser is unavailable. Enable agents.defaults.sandbox.browser.enabled or use target=\"host\" if allowed.");
686
- return normalizedSandbox.replace(/\/$/, "");
687
- }
688
- if (params.allowHostControl === false) throw new Error("Host browser control is disabled by sandbox policy.");
689
- if (!resolved.enabled) throw new Error("Browser control is disabled. Set browser.enabled=true in ~/.genesis/genesis.json.");
690
- }
691
- function shouldPreferHostForProfile(profileName) {
692
- if (!profileName) return false;
693
- const cfg = browserToolDeps.loadConfig();
694
- const profile = resolveProfile(resolveBrowserConfig(cfg.browser, cfg), profileName);
695
- if (!profile) return false;
696
- return getBrowserProfileCapabilities(profile).usesChromeMcp;
697
- }
698
- const DEFAULT_EXISTING_SESSION_MANAGE_TIMEOUT_MS = 45e3;
699
- const EXISTING_SESSION_MANAGE_ACTIONS = new Set([
700
- "status",
701
- "start",
702
- "stop",
703
- "profiles",
704
- "tabs",
705
- "open",
706
- "focus",
707
- "close"
708
- ]);
709
- function usesExistingSessionManageFlow(params) {
710
- if (!EXISTING_SESSION_MANAGE_ACTIONS.has(params.action)) return false;
711
- const cfg = browserToolDeps.loadConfig();
712
- const resolved = resolveBrowserConfig(cfg.browser, cfg);
713
- const profile = resolveProfile(resolved, params.profileName ?? resolved.defaultProfile);
714
- if (profile && getBrowserProfileCapabilities(profile).usesChromeMcp) return true;
715
- if (params.action !== "profiles") return false;
716
- return Object.keys(resolved.profiles).some((name) => {
717
- const candidate = resolveProfile(resolved, name);
718
- return candidate ? getBrowserProfileCapabilities(candidate).usesChromeMcp : false;
719
- });
720
- }
721
- function readToolTimeoutMs(params) {
722
- return typeof params.timeoutMs === "number" && Number.isFinite(params.timeoutMs) ? Math.max(1, Math.floor(params.timeoutMs)) : void 0;
723
- }
724
- function createBrowserTool(opts) {
725
- const targetDefault = opts?.sandboxBridgeUrl ? "sandbox" : "host";
726
- const hostHint = opts?.allowHostControl === false ? "Host target blocked by policy." : "Host target allowed.";
727
- return {
728
- label: "Browser",
729
- name: "browser",
730
- description: [
731
- "Control the browser via Genesis's browser control server (status/start/stop/profiles/tabs/open/snapshot/screenshot/actions).",
732
- "Browser choice: omit profile by default for the isolated Genesis-managed browser (`genesis`).",
733
- "For the logged-in user browser, use profile=\"user\". A supported Chromium-based browser (v144+) must be running on the selected host or browser node. Use only when existing logins/cookies matter and the user is present.",
734
- "For profile=\"user\" or other existing-session profiles, omit timeoutMs on act:type, evaluate, hover, scrollIntoView, drag, select, and fill; that driver rejects per-call timeout overrides for those actions.",
735
- "When a node-hosted browser proxy is available, the tool may auto-route to it. Pin a node with node=<id|name> or target=\"node\".",
736
- "When using refs from snapshot (e.g. e12), keep the same tab: prefer passing targetId from the snapshot response into subsequent actions (act/click/type/etc). For tab operations, targetId also accepts tabId handles (t1) and labels from action=tabs.",
737
- "For multi-step browser work, login checks, stale refs, duplicate tabs, or Google Meet flows, use the bundled browser-automation skill when it is available.",
738
- "For stable, self-resolving refs across calls, use snapshot with refs=\"aria\" (Playwright aria-ref ids). Default refs=\"role\" are role+name-based.",
739
- "Use snapshot+act for UI automation. Avoid act:wait by default; use only in exceptional cases when no reliable UI state exists.",
740
- `target selects browser location (sandbox|host|node). Default: ${targetDefault}.`,
741
- hostHint
742
- ].join(" "),
743
- parameters: BrowserToolSchema,
744
- execute: async (_toolCallId, args) => {
745
- const params = args;
746
- const action = readStringParam(params, "action", { required: true });
747
- const profile = readStringParam(params, "profile");
748
- const requestedNode = readStringParam(params, "node");
749
- const requestedTimeoutMs = readToolTimeoutMs(params);
750
- let target = readStringParam(params, "target");
751
- const configuredNode = browserToolDeps.loadConfig().gateway?.nodes?.browser?.node?.trim();
752
- if (requestedNode && target && target !== "node") throw new Error("node is only supported with target=\"node\".");
753
- const isUserBrowserProfile = shouldPreferHostForProfile(profile);
754
- if (isUserBrowserProfile) {
755
- if (target === "sandbox") throw new Error(`profile="${profile}" cannot use the sandbox browser; use target="host" or omit target.`);
756
- }
757
- let nodeTarget = null;
758
- try {
759
- nodeTarget = await resolveBrowserNodeTarget$1({
760
- requestedNode: requestedNode ?? void 0,
761
- target,
762
- sandboxBridgeUrl: opts?.sandboxBridgeUrl
763
- });
764
- } catch (error) {
765
- if (!(isUserBrowserProfile && !target && !requestedNode && !configuredNode)) throw error;
766
- }
767
- if (isUserBrowserProfile && !target && !requestedNode && !nodeTarget) target = "host";
768
- const baseUrl = nodeTarget ? void 0 : resolveBrowserBaseUrl({
769
- target: target === "node" ? void 0 : target,
770
- sandboxBridgeUrl: opts?.sandboxBridgeUrl,
771
- allowHostControl: opts?.allowHostControl
772
- });
773
- const proxyRequest = nodeTarget ? async (opts) => {
774
- const proxy = await callBrowserProxy({
775
- nodeId: nodeTarget.nodeId,
776
- method: opts.method,
777
- path: opts.path,
778
- query: opts.query,
779
- body: opts.body,
780
- timeoutMs: opts.timeoutMs,
781
- profile: opts.profile
782
- });
783
- const mapping = await persistProxyFiles$1(proxy.files);
784
- applyProxyPaths$1(proxy.result, mapping);
785
- return proxy.result;
786
- } : null;
787
- const toolTimeoutMs = requestedTimeoutMs ?? (usesExistingSessionManageFlow({
788
- action,
789
- profileName: profile
790
- }) ? DEFAULT_EXISTING_SESSION_MANAGE_TIMEOUT_MS : void 0);
791
- const touchTrackedTab = (targetId, url) => {
792
- if (proxyRequest || !targetId) return;
793
- browserToolDeps.touchSessionBrowserTab({
794
- sessionKey: opts?.agentSessionKey,
795
- targetId,
796
- baseUrl,
797
- profile,
798
- url
799
- });
800
- };
801
- switch (action) {
802
- case "doctor":
803
- if (proxyRequest) return jsonResult(await proxyRequest({
804
- method: "GET",
805
- path: "/doctor",
806
- profile
807
- }));
808
- return jsonResult(await browserToolDeps.browserDoctor(baseUrl, { profile }));
809
- case "status":
810
- if (proxyRequest) return jsonResult(await proxyRequest({
811
- method: "GET",
812
- path: "/",
813
- profile,
814
- timeoutMs: toolTimeoutMs
815
- }));
816
- return jsonResult(await browserToolDeps.browserStatus(baseUrl, {
817
- profile,
818
- timeoutMs: toolTimeoutMs
819
- }));
820
- case "start":
821
- if (proxyRequest) {
822
- await proxyRequest({
823
- method: "POST",
824
- path: "/start",
825
- profile,
826
- timeoutMs: toolTimeoutMs
827
- });
828
- return jsonResult(await proxyRequest({
829
- method: "GET",
830
- path: "/",
831
- profile,
832
- timeoutMs: toolTimeoutMs
833
- }));
834
- }
835
- await browserToolDeps.browserStart(baseUrl, {
836
- profile,
837
- timeoutMs: toolTimeoutMs
838
- });
839
- return jsonResult(await browserToolDeps.browserStatus(baseUrl, {
840
- profile,
841
- timeoutMs: toolTimeoutMs
842
- }));
843
- case "stop":
844
- if (proxyRequest) {
845
- await proxyRequest({
846
- method: "POST",
847
- path: "/stop",
848
- profile,
849
- timeoutMs: toolTimeoutMs
850
- });
851
- return jsonResult(await proxyRequest({
852
- method: "GET",
853
- path: "/",
854
- profile,
855
- timeoutMs: toolTimeoutMs
856
- }));
857
- }
858
- await browserToolDeps.browserStop(baseUrl, {
859
- profile,
860
- timeoutMs: toolTimeoutMs
861
- });
862
- return jsonResult(await browserToolDeps.browserStatus(baseUrl, {
863
- profile,
864
- timeoutMs: toolTimeoutMs
865
- }));
866
- case "profiles":
867
- if (proxyRequest) return jsonResult(await proxyRequest({
868
- method: "GET",
869
- path: "/profiles",
870
- timeoutMs: toolTimeoutMs
871
- }));
872
- return jsonResult({ profiles: await browserToolDeps.browserProfiles(baseUrl, { timeoutMs: toolTimeoutMs }) });
873
- case "tabs": return await executeTabsAction({
874
- baseUrl,
875
- profile,
876
- timeoutMs: toolTimeoutMs,
877
- proxyRequest
878
- });
879
- case "open": {
880
- const targetUrl = readTargetUrlParam(params);
881
- const label = normalizeOptionalString(params.label);
882
- if (proxyRequest) return jsonResult(await proxyRequest({
883
- method: "POST",
884
- path: "/tabs/open",
885
- profile,
886
- body: {
887
- url: targetUrl,
888
- ...label ? { label } : {}
889
- },
890
- timeoutMs: toolTimeoutMs
891
- }));
892
- const opened = await browserToolDeps.browserOpenTab(baseUrl, targetUrl, {
893
- profile,
894
- label,
895
- timeoutMs: toolTimeoutMs
896
- });
897
- browserToolDeps.trackSessionBrowserTab({
898
- sessionKey: opts?.agentSessionKey,
899
- targetId: opened.targetId,
900
- baseUrl,
901
- profile,
902
- url: readStringValue(opened.url) ?? targetUrl
903
- });
904
- return jsonResult(opened);
905
- }
906
- case "focus": {
907
- const targetId = readStringParam(params, "targetId", { required: true });
908
- if (proxyRequest) return jsonResult(await proxyRequest({
909
- method: "POST",
910
- path: "/tabs/focus",
911
- profile,
912
- body: { targetId },
913
- timeoutMs: toolTimeoutMs
914
- }));
915
- await browserToolDeps.browserFocusTab(baseUrl, targetId, {
916
- profile,
917
- timeoutMs: toolTimeoutMs
918
- });
919
- touchTrackedTab(targetId);
920
- return jsonResult({ ok: true });
921
- }
922
- case "close": {
923
- const targetId = readStringParam(params, "targetId");
924
- if (proxyRequest) return jsonResult(targetId ? await proxyRequest({
925
- method: "DELETE",
926
- path: `/tabs/${encodeURIComponent(targetId)}`,
927
- profile,
928
- timeoutMs: toolTimeoutMs
929
- }) : await proxyRequest({
930
- method: "POST",
931
- path: "/act",
932
- profile,
933
- body: { kind: "close" },
934
- timeoutMs: toolTimeoutMs
935
- }));
936
- if (targetId) {
937
- await browserToolDeps.browserCloseTab(baseUrl, targetId, {
938
- profile,
939
- timeoutMs: toolTimeoutMs
940
- });
941
- browserToolDeps.untrackSessionBrowserTab({
942
- sessionKey: opts?.agentSessionKey,
943
- targetId,
944
- baseUrl,
945
- profile
946
- });
947
- } else await browserToolDeps.browserAct(baseUrl, { kind: "close" }, {
948
- profile,
949
- timeoutMs: toolTimeoutMs
950
- });
951
- return jsonResult({ ok: true });
952
- }
953
- case "snapshot": return await executeSnapshotAction({
954
- input: params,
955
- baseUrl,
956
- profile,
957
- proxyRequest,
958
- onTabActivity: touchTrackedTab
959
- });
960
- case "screenshot": {
961
- const targetId = readStringParam(params, "targetId");
962
- const fullPage = Boolean(params.fullPage);
963
- const ref = readStringParam(params, "ref");
964
- const element = readStringParam(params, "element");
965
- const labels = typeof params.labels === "boolean" ? params.labels : void 0;
966
- const type = params.type === "jpeg" ? "jpeg" : "png";
967
- const effectiveTimeoutMs = (typeof params.timeoutMs === "number" && Number.isFinite(params.timeoutMs) ? Math.max(1, Math.floor(params.timeoutMs)) : void 0) ?? 2e4;
968
- const result = proxyRequest ? await proxyRequest({
969
- method: "POST",
970
- path: "/screenshot",
971
- profile,
972
- timeoutMs: effectiveTimeoutMs,
973
- body: {
974
- targetId,
975
- fullPage,
976
- ref,
977
- element,
978
- type,
979
- labels,
980
- timeoutMs: effectiveTimeoutMs
981
- }
982
- }) : await browserToolDeps.browserScreenshotAction(baseUrl, {
983
- targetId,
984
- fullPage,
985
- ref,
986
- element,
987
- type,
988
- labels,
989
- timeoutMs: effectiveTimeoutMs,
990
- profile
991
- });
992
- touchTrackedTab(readStringValue(result.targetId) ?? targetId, readStringValue(result.url));
993
- return await browserToolDeps.imageResultFromFile({
994
- label: "browser:screenshot",
995
- path: result.path,
996
- details: result
997
- });
998
- }
999
- case "navigate": {
1000
- const targetUrl = readTargetUrlParam(params);
1001
- const targetId = readStringParam(params, "targetId");
1002
- if (proxyRequest) return jsonResult(await proxyRequest({
1003
- method: "POST",
1004
- path: "/navigate",
1005
- profile,
1006
- body: {
1007
- url: targetUrl,
1008
- targetId
1009
- }
1010
- }));
1011
- const result = await browserToolDeps.browserNavigate(baseUrl, {
1012
- url: targetUrl,
1013
- targetId,
1014
- profile
1015
- });
1016
- touchTrackedTab(readStringValue(result.targetId) ?? targetId, readStringValue(result.url) ?? targetUrl);
1017
- return jsonResult(result);
1018
- }
1019
- case "console": return await executeConsoleAction({
1020
- input: params,
1021
- baseUrl,
1022
- profile,
1023
- proxyRequest
1024
- });
1025
- case "pdf": {
1026
- const targetId = normalizeOptionalString(params.targetId);
1027
- const result = proxyRequest ? await proxyRequest({
1028
- method: "POST",
1029
- path: "/pdf",
1030
- profile,
1031
- body: { targetId }
1032
- }) : await browserToolDeps.browserPdfSave(baseUrl, {
1033
- targetId,
1034
- profile
1035
- });
1036
- touchTrackedTab(readStringValue(result.targetId) ?? targetId, readStringValue(result.url));
1037
- return {
1038
- content: [{
1039
- type: "text",
1040
- text: `FILE:${result.path}`
1041
- }],
1042
- details: result
1043
- };
1044
- }
1045
- case "upload": {
1046
- const paths = Array.isArray(params.paths) ? params.paths.map((p) => String(p)) : [];
1047
- if (paths.length === 0) throw new Error("paths required");
1048
- const uploadPathsResult = await resolveExistingPathsWithinRoot({
1049
- rootDir: DEFAULT_UPLOAD_DIR,
1050
- requestedPaths: paths,
1051
- scopeLabel: `uploads directory (${DEFAULT_UPLOAD_DIR})`
1052
- });
1053
- if (!uploadPathsResult.ok) throw new Error(uploadPathsResult.error);
1054
- const normalizedPaths = uploadPathsResult.paths;
1055
- const ref = readStringParam(params, "ref");
1056
- const inputRef = readStringParam(params, "inputRef");
1057
- const element = readStringParam(params, "element");
1058
- const { targetId, timeoutMs } = readOptionalTargetAndTimeout(params);
1059
- if (proxyRequest) return jsonResult(await proxyRequest({
1060
- method: "POST",
1061
- path: "/hooks/file-chooser",
1062
- profile,
1063
- body: {
1064
- paths: normalizedPaths,
1065
- ref,
1066
- inputRef,
1067
- element,
1068
- targetId,
1069
- timeoutMs
1070
- }
1071
- }));
1072
- const result = await browserToolDeps.browserArmFileChooser(baseUrl, {
1073
- paths: normalizedPaths,
1074
- ref,
1075
- inputRef,
1076
- element,
1077
- targetId,
1078
- timeoutMs,
1079
- profile
1080
- });
1081
- touchTrackedTab(readStringValue(result.targetId) ?? targetId, readStringValue(result.url));
1082
- return jsonResult(result);
1083
- }
1084
- case "dialog": {
1085
- const accept = Boolean(params.accept);
1086
- const promptText = readStringValue(params.promptText);
1087
- const { targetId, timeoutMs } = readOptionalTargetAndTimeout(params);
1088
- if (proxyRequest) return jsonResult(await proxyRequest({
1089
- method: "POST",
1090
- path: "/hooks/dialog",
1091
- profile,
1092
- body: {
1093
- accept,
1094
- promptText,
1095
- targetId,
1096
- timeoutMs
1097
- }
1098
- }));
1099
- const result = await browserToolDeps.browserArmDialog(baseUrl, {
1100
- accept,
1101
- promptText,
1102
- targetId,
1103
- timeoutMs,
1104
- profile
1105
- });
1106
- touchTrackedTab(readStringValue(result.targetId) ?? targetId, readStringValue(result.url));
1107
- return jsonResult(result);
1108
- }
1109
- case "act": {
1110
- const request = readActRequestParam(params);
1111
- if (!request) throw new Error("request required");
1112
- return await executeActAction({
1113
- request,
1114
- baseUrl,
1115
- profile,
1116
- proxyRequest,
1117
- onTabActivity: touchTrackedTab
1118
- });
1119
- }
1120
- default: throw new Error(`Unknown action: ${action}`);
1121
- }
1122
- }
1123
- };
1124
- }
1125
- //#endregion
1126
- //#region extensions/browser/src/cli/browser-cli-shared.ts
1127
- function normalizeQuery(query) {
1128
- if (!query) return;
1129
- const out = {};
1130
- for (const [key, value] of Object.entries(query)) {
1131
- if (value === void 0) continue;
1132
- out[key] = String(value);
1133
- }
1134
- return Object.keys(out).length ? out : void 0;
1135
- }
1136
- async function callBrowserRequest(opts, params, extra) {
1137
- const resolvedTimeoutMs = typeof extra?.timeoutMs === "number" && Number.isFinite(extra.timeoutMs) ? Math.max(1, Math.floor(extra.timeoutMs)) : typeof opts.timeout === "string" ? Number.parseInt(opts.timeout, 10) : void 0;
1138
- const resolvedTimeout = typeof resolvedTimeoutMs === "number" && Number.isFinite(resolvedTimeoutMs) ? resolvedTimeoutMs : void 0;
1139
- const timeout = typeof resolvedTimeout === "number" ? String(resolvedTimeout) : opts.timeout;
1140
- const payload = await callGatewayFromCli("browser.request", {
1141
- ...opts,
1142
- timeout
1143
- }, {
1144
- method: params.method,
1145
- path: params.path,
1146
- query: normalizeQuery(params.query),
1147
- body: params.body,
1148
- timeoutMs: resolvedTimeout
1149
- }, { progress: extra?.progress });
1150
- if (payload === void 0) throw new Error("Unexpected browser.request response");
1151
- return payload;
1152
- }
1153
- async function callBrowserResize(opts, params, extra) {
1154
- return callBrowserRequest(opts, {
1155
- method: "POST",
1156
- path: "/act",
1157
- query: params.profile ? { profile: params.profile } : void 0,
1158
- body: {
1159
- kind: "resize",
1160
- width: params.width,
1161
- height: params.height,
1162
- targetId: normalizeOptionalString(params.targetId)
1163
- }
1164
- }, extra);
1165
- }
1166
- //#endregion
1167
- //#region extensions/browser/src/cli/browser-cli-actions-input/shared.ts
1168
- function resolveBrowserActionContext(cmd, parentOpts) {
1169
- const parent = parentOpts(cmd);
1170
- return {
1171
- parent,
1172
- profile: parent?.browserProfile
1173
- };
1174
- }
1175
- async function callBrowserAct(params) {
1176
- return await callBrowserRequest(params.parent, {
1177
- method: "POST",
1178
- path: "/act",
1179
- query: params.profile ? { profile: params.profile } : void 0,
1180
- body: params.body
1181
- }, { timeoutMs: params.timeoutMs ?? 2e4 });
1182
- }
1183
- function logBrowserActionResult(parent, result, successMessage) {
1184
- if (parent?.json) {
1185
- defaultRuntime.writeJson(result);
1186
- return;
1187
- }
1188
- defaultRuntime.log(successMessage);
1189
- }
1190
- function requireRef(ref) {
1191
- const refValue = typeof ref === "string" ? ref.trim() : "";
1192
- if (!refValue) {
1193
- defaultRuntime.error(danger("ref is required"));
1194
- defaultRuntime.exit(1);
1195
- return null;
1196
- }
1197
- return refValue;
1198
- }
1199
- async function readFile$1(path) {
1200
- return await fs.readFile(path, "utf8");
1201
- }
1202
- async function readFields(opts) {
1203
- const payload = opts.fieldsFile ? await readFile$1(opts.fieldsFile) : opts.fields ?? "";
1204
- if (!payload.trim()) throw new Error("fields are required");
1205
- const parsed = JSON.parse(payload);
1206
- if (!Array.isArray(parsed)) throw new Error("fields must be an array");
1207
- return parsed.map((entry, index) => {
1208
- if (!entry || typeof entry !== "object") throw new Error(`fields[${index}] must be an object`);
1209
- const rec = entry;
1210
- const parsedField = normalizeBrowserFormField(rec);
1211
- if (!parsedField) throw new Error(`fields[${index}] must include ref`);
1212
- if (rec.value === void 0 || rec.value === null || normalizeBrowserFormFieldValue(rec.value) !== void 0) return parsedField;
1213
- throw new Error(`fields[${index}].value must be string, number, boolean, or null`);
1214
- });
1215
- }
1216
- //#endregion
1217
- //#region extensions/browser/src/cli/browser-cli-actions-input/register.element.ts
1218
- function registerBrowserElementCommands(browser, parentOpts) {
1219
- const runElementAction = async (params) => {
1220
- const { parent, profile } = resolveBrowserActionContext(params.cmd, parentOpts);
1221
- try {
1222
- const result = await callBrowserAct({
1223
- parent,
1224
- profile,
1225
- body: params.body,
1226
- timeoutMs: params.timeoutMs
1227
- });
1228
- logBrowserActionResult(parent, result, typeof params.successMessage === "function" ? params.successMessage(result) : params.successMessage);
1229
- } catch (err) {
1230
- defaultRuntime.error(danger(String(err)));
1231
- defaultRuntime.exit(1);
1232
- }
1233
- };
1234
- browser.command("click").description("Click an element by ref from snapshot").argument("<ref>", "Ref id from snapshot").option("--target-id <id>", "CDP target id (or unique prefix)").option("--double", "Double click", false).option("--button <left|right|middle>", "Mouse button to use").option("--modifiers <list>", "Comma-separated modifiers (Shift,Alt,Meta)").action(async (ref, opts, cmd) => {
1235
- const refValue = requireRef(ref);
1236
- if (!refValue) return;
1237
- const modifiers = opts.modifiers ? String(opts.modifiers).split(",").map((v) => v.trim()).filter(Boolean) : void 0;
1238
- await runElementAction({
1239
- cmd,
1240
- body: {
1241
- kind: "click",
1242
- ref: refValue,
1243
- targetId: normalizeOptionalString(opts.targetId),
1244
- doubleClick: Boolean(opts.double),
1245
- button: normalizeOptionalString(opts.button),
1246
- modifiers
1247
- },
1248
- successMessage: (result) => {
1249
- const url = result.url;
1250
- return `clicked ref ${refValue}${typeof url === "string" && url ? ` on ${url}` : ""}`;
1251
- }
1252
- });
1253
- });
1254
- browser.command("click-coords").description("Click viewport coordinates").argument("<x>", "Viewport x coordinate").argument("<y>", "Viewport y coordinate").option("--target-id <id>", "CDP target id (or unique prefix)").option("--double", "Double click", false).option("--button <left|right|middle>", "Mouse button to use").option("--delay-ms <ms>", "Delay between mouse down/up", (v) => Number(v)).action(async (xRaw, yRaw, opts, cmd) => {
1255
- const x = Number(xRaw);
1256
- const y = Number(yRaw);
1257
- await runElementAction({
1258
- cmd,
1259
- body: {
1260
- kind: "clickCoords",
1261
- x,
1262
- y,
1263
- targetId: normalizeOptionalString(opts.targetId),
1264
- doubleClick: Boolean(opts.double),
1265
- button: normalizeOptionalString(opts.button),
1266
- delayMs: Number.isFinite(opts.delayMs) ? opts.delayMs : void 0
1267
- },
1268
- successMessage: (result) => {
1269
- const url = result.url;
1270
- return `clicked ${x},${y}${typeof url === "string" && url ? ` on ${url}` : ""}`;
1271
- }
1272
- });
1273
- });
1274
- browser.command("type").description("Type into an element by ref from snapshot").argument("<ref>", "Ref id from snapshot").argument("<text>", "Text to type").option("--submit", "Press Enter after typing", false).option("--slowly", "Type slowly (human-like)", false).option("--target-id <id>", "CDP target id (or unique prefix)").action(async (ref, text, opts, cmd) => {
1275
- const refValue = requireRef(ref);
1276
- if (!refValue) return;
1277
- await runElementAction({
1278
- cmd,
1279
- body: {
1280
- kind: "type",
1281
- ref: refValue,
1282
- text,
1283
- submit: Boolean(opts.submit),
1284
- slowly: Boolean(opts.slowly),
1285
- targetId: normalizeOptionalString(opts.targetId)
1286
- },
1287
- successMessage: `typed into ref ${refValue}`
1288
- });
1289
- });
1290
- browser.command("press").description("Press a key").argument("<key>", "Key to press (e.g. Enter)").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (key, opts, cmd) => {
1291
- await runElementAction({
1292
- cmd,
1293
- body: {
1294
- kind: "press",
1295
- key,
1296
- targetId: normalizeOptionalString(opts.targetId)
1297
- },
1298
- successMessage: `pressed ${key}`
1299
- });
1300
- });
1301
- browser.command("hover").description("Hover an element by ai ref").argument("<ref>", "Ref id from snapshot").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (ref, opts, cmd) => {
1302
- await runElementAction({
1303
- cmd,
1304
- body: {
1305
- kind: "hover",
1306
- ref,
1307
- targetId: normalizeOptionalString(opts.targetId)
1308
- },
1309
- successMessage: `hovered ref ${ref}`
1310
- });
1311
- });
1312
- browser.command("scrollintoview").description("Scroll an element into view by ref from snapshot").argument("<ref>", "Ref id from snapshot").option("--target-id <id>", "CDP target id (or unique prefix)").option("--timeout-ms <ms>", "How long to wait for scroll (default: 20000)", (v) => Number(v)).action(async (ref, opts, cmd) => {
1313
- const refValue = requireRef(ref);
1314
- if (!refValue) return;
1315
- const timeoutMs = Number.isFinite(opts.timeoutMs) ? opts.timeoutMs : void 0;
1316
- await runElementAction({
1317
- cmd,
1318
- body: {
1319
- kind: "scrollIntoView",
1320
- ref: refValue,
1321
- targetId: normalizeOptionalString(opts.targetId),
1322
- timeoutMs
1323
- },
1324
- timeoutMs,
1325
- successMessage: `scrolled into view: ${refValue}`
1326
- });
1327
- });
1328
- browser.command("drag").description("Drag from one ref to another").argument("<startRef>", "Start ref id").argument("<endRef>", "End ref id").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (startRef, endRef, opts, cmd) => {
1329
- await runElementAction({
1330
- cmd,
1331
- body: {
1332
- kind: "drag",
1333
- startRef,
1334
- endRef,
1335
- targetId: normalizeOptionalString(opts.targetId)
1336
- },
1337
- successMessage: `dragged ${startRef} → ${endRef}`
1338
- });
1339
- });
1340
- browser.command("select").description("Select option(s) in a select element").argument("<ref>", "Ref id from snapshot").argument("<values...>", "Option values to select").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (ref, values, opts, cmd) => {
1341
- await runElementAction({
1342
- cmd,
1343
- body: {
1344
- kind: "select",
1345
- ref,
1346
- values,
1347
- targetId: normalizeOptionalString(opts.targetId)
1348
- },
1349
- successMessage: `selected ${values.join(", ")}`
1350
- });
1351
- });
1352
- }
1353
- //#endregion
1354
- //#region extensions/browser/src/cli/browser-cli-actions-input/register.files-downloads.ts
1355
- async function normalizeUploadPaths(paths) {
1356
- const result = await resolveExistingPathsWithinRoot({
1357
- rootDir: DEFAULT_UPLOAD_DIR,
1358
- requestedPaths: paths,
1359
- scopeLabel: `uploads directory (${DEFAULT_UPLOAD_DIR})`
1360
- });
1361
- if (!result.ok) throw new Error(result.error);
1362
- return result.paths;
1363
- }
1364
- async function runBrowserPostAction(params) {
1365
- try {
1366
- const result = await callBrowserRequest(params.parent, {
1367
- method: "POST",
1368
- path: params.path,
1369
- query: params.profile ? { profile: params.profile } : void 0,
1370
- body: params.body
1371
- }, { timeoutMs: params.timeoutMs });
1372
- if (params.parent?.json) {
1373
- defaultRuntime.writeJson(result);
1374
- return;
1375
- }
1376
- defaultRuntime.log(params.describeSuccess(result));
1377
- } catch (err) {
1378
- defaultRuntime.error(danger(String(err)));
1379
- defaultRuntime.exit(1);
1380
- }
1381
- }
1382
- function registerBrowserFilesAndDownloadsCommands(browser, parentOpts) {
1383
- const resolveTimeoutAndTarget = (opts) => {
1384
- return {
1385
- timeoutMs: Number.isFinite(opts.timeoutMs) ? Number(opts.timeoutMs) : void 0,
1386
- targetId: normalizeOptionalString(opts.targetId)
1387
- };
1388
- };
1389
- const runDownloadCommand = async (cmd, opts, request) => {
1390
- const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
1391
- const { timeoutMs, targetId } = resolveTimeoutAndTarget(opts);
1392
- await runBrowserPostAction({
1393
- parent,
1394
- profile,
1395
- path: request.path,
1396
- body: {
1397
- ...request.body,
1398
- targetId,
1399
- timeoutMs
1400
- },
1401
- timeoutMs: timeoutMs ?? 2e4,
1402
- describeSuccess: (result) => `downloaded: ${shortenHomePath(result.download.path)}`
1403
- });
1404
- };
1405
- browser.command("upload").description("Arm file upload for the next file chooser").argument("<paths...>", "File paths to upload (must be within Genesis temp uploads dir, e.g. /tmp/genesis/uploads/file.pdf)").option("--ref <ref>", "Ref id from snapshot to click after arming").option("--input-ref <ref>", "Ref id for <input type=file> to set directly").option("--element <selector>", "CSS selector for <input type=file>").option("--target-id <id>", "CDP target id (or unique prefix)").option("--timeout-ms <ms>", "How long to wait for the next file chooser (default: 120000)", (v) => Number(v)).action(async (paths, opts, cmd) => {
1406
- const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
1407
- const normalizedPaths = await normalizeUploadPaths(paths);
1408
- const { timeoutMs, targetId } = resolveTimeoutAndTarget(opts);
1409
- await runBrowserPostAction({
1410
- parent,
1411
- profile,
1412
- path: "/hooks/file-chooser",
1413
- body: {
1414
- paths: normalizedPaths,
1415
- ref: normalizeOptionalString(opts.ref),
1416
- inputRef: normalizeOptionalString(opts.inputRef),
1417
- element: normalizeOptionalString(opts.element),
1418
- targetId,
1419
- timeoutMs
1420
- },
1421
- timeoutMs: timeoutMs ?? 2e4,
1422
- describeSuccess: () => `upload armed for ${paths.length} file(s)`
1423
- });
1424
- });
1425
- browser.command("waitfordownload").description("Wait for the next download (and save it)").argument("[path]", "Save path within genesis temp downloads dir (default: /tmp/genesis/downloads/...; fallback: os.tmpdir()/genesis/downloads/...)").option("--target-id <id>", "CDP target id (or unique prefix)").option("--timeout-ms <ms>", "How long to wait for the next download (default: 120000)", (v) => Number(v)).action(async (outPath, opts, cmd) => {
1426
- await runDownloadCommand(cmd, opts, {
1427
- path: "/wait/download",
1428
- body: { path: normalizeOptionalString(outPath) }
1429
- });
1430
- });
1431
- browser.command("download").description("Click a ref and save the resulting download").argument("<ref>", "Ref id from snapshot to click").argument("<path>", "Save path within genesis temp downloads dir (e.g. report.pdf or /tmp/genesis/downloads/report.pdf)").option("--target-id <id>", "CDP target id (or unique prefix)").option("--timeout-ms <ms>", "How long to wait for the download to start (default: 120000)", (v) => Number(v)).action(async (ref, outPath, opts, cmd) => {
1432
- await runDownloadCommand(cmd, opts, {
1433
- path: "/download",
1434
- body: {
1435
- ref,
1436
- path: outPath
1437
- }
1438
- });
1439
- });
1440
- browser.command("dialog").description("Arm the next modal dialog (alert/confirm/prompt)").option("--accept", "Accept the dialog", false).option("--dismiss", "Dismiss the dialog", false).option("--prompt <text>", "Prompt response text").option("--target-id <id>", "CDP target id (or unique prefix)").option("--timeout-ms <ms>", "How long to wait for the next dialog (default: 120000)", (v) => Number(v)).action(async (opts, cmd) => {
1441
- const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
1442
- const accept = opts.accept ? true : opts.dismiss ? false : void 0;
1443
- if (accept === void 0) {
1444
- defaultRuntime.error(danger("Specify --accept or --dismiss"));
1445
- defaultRuntime.exit(1);
1446
- return;
1447
- }
1448
- const { timeoutMs, targetId } = resolveTimeoutAndTarget(opts);
1449
- await runBrowserPostAction({
1450
- parent,
1451
- profile,
1452
- path: "/hooks/dialog",
1453
- body: {
1454
- accept,
1455
- promptText: normalizeOptionalString(opts.prompt),
1456
- targetId,
1457
- timeoutMs
1458
- },
1459
- timeoutMs: timeoutMs ?? 2e4,
1460
- describeSuccess: () => "dialog armed"
1461
- });
1462
- });
1463
- }
1464
- //#endregion
1465
- //#region extensions/browser/src/cli/browser-cli-actions-input/register.form-wait-eval.ts
1466
- function registerBrowserFormWaitEvalCommands(browser, parentOpts) {
1467
- browser.command("fill").description("Fill a form with JSON field descriptors").option("--fields <json>", "JSON array of field objects").option("--fields-file <path>", "Read JSON array from a file").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (opts, cmd) => {
1468
- const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
1469
- try {
1470
- const fields = await readFields({
1471
- fields: opts.fields,
1472
- fieldsFile: opts.fieldsFile
1473
- });
1474
- logBrowserActionResult(parent, await callBrowserAct({
1475
- parent,
1476
- profile,
1477
- body: {
1478
- kind: "fill",
1479
- fields,
1480
- targetId: normalizeOptionalString(opts.targetId)
1481
- }
1482
- }), `filled ${fields.length} field(s)`);
1483
- } catch (err) {
1484
- defaultRuntime.error(danger(String(err)));
1485
- defaultRuntime.exit(1);
1486
- }
1487
- });
1488
- browser.command("wait").description("Wait for time, selector, URL, load state, or JS conditions").argument("[selector]", "CSS selector to wait for (visible)").option("--time <ms>", "Wait for N milliseconds", (v) => Number(v)).option("--text <value>", "Wait for text to appear").option("--text-gone <value>", "Wait for text to disappear").option("--url <pattern>", "Wait for URL (supports globs like **/dash)").option("--load <load|domcontentloaded|networkidle>", "Wait for load state").option("--fn <js>", "Wait for JS condition (passed to waitForFunction)").option("--timeout-ms <ms>", "How long to wait for each condition (default: 20000)", (v) => Number(v)).option("--target-id <id>", "CDP target id (or unique prefix)").action(async (selector, opts, cmd) => {
1489
- const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
1490
- try {
1491
- const sel = normalizeOptionalString(selector);
1492
- const load = opts.load === "load" || opts.load === "domcontentloaded" || opts.load === "networkidle" ? opts.load : void 0;
1493
- const timeoutMs = Number.isFinite(opts.timeoutMs) ? opts.timeoutMs : void 0;
1494
- logBrowserActionResult(parent, await callBrowserAct({
1495
- parent,
1496
- profile,
1497
- body: {
1498
- kind: "wait",
1499
- timeMs: Number.isFinite(opts.time) ? opts.time : void 0,
1500
- text: normalizeOptionalString(opts.text),
1501
- textGone: normalizeOptionalString(opts.textGone),
1502
- selector: sel,
1503
- url: normalizeOptionalString(opts.url),
1504
- loadState: load,
1505
- fn: normalizeOptionalString(opts.fn),
1506
- targetId: normalizeOptionalString(opts.targetId),
1507
- timeoutMs
1508
- },
1509
- timeoutMs
1510
- }), "wait complete");
1511
- } catch (err) {
1512
- defaultRuntime.error(danger(String(err)));
1513
- defaultRuntime.exit(1);
1514
- }
1515
- });
1516
- browser.command("evaluate").description("Evaluate a function against the page or a ref").option("--fn <code>", "Function source, e.g. (el) => el.textContent").option("--ref <id>", "Ref from snapshot").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (opts, cmd) => {
1517
- const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
1518
- if (!opts.fn) {
1519
- defaultRuntime.error(danger("Missing --fn"));
1520
- defaultRuntime.exit(1);
1521
- return;
1522
- }
1523
- try {
1524
- const result = await callBrowserAct({
1525
- parent,
1526
- profile,
1527
- body: {
1528
- kind: "evaluate",
1529
- fn: opts.fn,
1530
- ref: normalizeOptionalString(opts.ref),
1531
- targetId: normalizeOptionalString(opts.targetId)
1532
- }
1533
- });
1534
- if (parent?.json) {
1535
- defaultRuntime.writeJson(result);
1536
- return;
1537
- }
1538
- defaultRuntime.writeJson(result.result ?? null);
1539
- } catch (err) {
1540
- defaultRuntime.error(danger(String(err)));
1541
- defaultRuntime.exit(1);
1542
- }
1543
- });
1544
- }
1545
- //#endregion
1546
- //#region extensions/browser/src/cli/browser-cli-resize.ts
1547
- async function runBrowserResizeWithOutput(params) {
1548
- const { width, height } = params;
1549
- if (!Number.isFinite(width) || !Number.isFinite(height)) {
1550
- defaultRuntime.error(danger("width and height must be numbers"));
1551
- defaultRuntime.exit(1);
1552
- return;
1553
- }
1554
- const result = await callBrowserResize(params.parent, {
1555
- profile: params.profile,
1556
- width,
1557
- height,
1558
- targetId: params.targetId
1559
- }, { timeoutMs: params.timeoutMs ?? 2e4 });
1560
- if (params.parent?.json) {
1561
- defaultRuntime.writeJson(result);
1562
- return;
1563
- }
1564
- defaultRuntime.log(params.successMessage);
1565
- }
1566
- //#endregion
1567
- //#region extensions/browser/src/cli/browser-cli-actions-input/register.navigation.ts
1568
- function registerBrowserNavigationCommands(browser, parentOpts) {
1569
- browser.command("navigate").description("Navigate the current tab to a URL").argument("<url>", "URL to navigate to").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (url, opts, cmd) => {
1570
- const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
1571
- try {
1572
- const result = await callBrowserRequest(parent, {
1573
- method: "POST",
1574
- path: "/navigate",
1575
- query: profile ? { profile } : void 0,
1576
- body: {
1577
- url,
1578
- targetId: normalizeOptionalString(opts.targetId)
1579
- }
1580
- }, { timeoutMs: 2e4 });
1581
- if (parent?.json) {
1582
- defaultRuntime.writeJson(result);
1583
- return;
1584
- }
1585
- defaultRuntime.log(`navigated to ${result.url ?? url}`);
1586
- } catch (err) {
1587
- defaultRuntime.error(danger(String(err)));
1588
- defaultRuntime.exit(1);
1589
- }
1590
- });
1591
- browser.command("resize").description("Resize the viewport").argument("<width>", "Viewport width", (v) => Number(v)).argument("<height>", "Viewport height", (v) => Number(v)).option("--target-id <id>", "CDP target id (or unique prefix)").action(async (width, height, opts, cmd) => {
1592
- const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
1593
- try {
1594
- await runBrowserResizeWithOutput({
1595
- parent,
1596
- profile,
1597
- width,
1598
- height,
1599
- targetId: opts.targetId,
1600
- timeoutMs: 2e4,
1601
- successMessage: `resized to ${width}x${height}`
1602
- });
1603
- } catch (err) {
1604
- defaultRuntime.error(danger(String(err)));
1605
- defaultRuntime.exit(1);
1606
- }
1607
- });
1608
- }
1609
- //#endregion
1610
- //#region extensions/browser/src/cli/browser-cli-actions-input/register.ts
1611
- function registerBrowserActionInputCommands(browser, parentOpts) {
1612
- registerBrowserNavigationCommands(browser, parentOpts);
1613
- registerBrowserElementCommands(browser, parentOpts);
1614
- registerBrowserFilesAndDownloadsCommands(browser, parentOpts);
1615
- registerBrowserFormWaitEvalCommands(browser, parentOpts);
1616
- }
1617
- //#endregion
1618
- //#region extensions/browser/src/cli/browser-cli-actions-observe.ts
1619
- function runBrowserObserve(action) {
1620
- return runCommandWithRuntime(defaultRuntime, action, (err) => {
1621
- defaultRuntime.error(danger(String(err)));
1622
- defaultRuntime.exit(1);
1623
- });
1624
- }
1625
- function registerBrowserActionObserveCommands(browser, parentOpts) {
1626
- browser.command("console").description("Get recent console messages").option("--level <level>", "Filter by level (error, warn, info)").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (opts, cmd) => {
1627
- const parent = parentOpts(cmd);
1628
- const profile = parent?.browserProfile;
1629
- await runBrowserObserve(async () => {
1630
- const result = await callBrowserRequest(parent, {
1631
- method: "GET",
1632
- path: "/console",
1633
- query: {
1634
- level: normalizeOptionalString(opts.level),
1635
- targetId: normalizeOptionalString(opts.targetId),
1636
- profile
1637
- }
1638
- }, { timeoutMs: 2e4 });
1639
- if (parent?.json) {
1640
- defaultRuntime.writeJson(result);
1641
- return;
1642
- }
1643
- defaultRuntime.writeJson(result.messages);
1644
- });
1645
- });
1646
- browser.command("pdf").description("Save page as PDF").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (opts, cmd) => {
1647
- const parent = parentOpts(cmd);
1648
- const profile = parent?.browserProfile;
1649
- await runBrowserObserve(async () => {
1650
- const result = await callBrowserRequest(parent, {
1651
- method: "POST",
1652
- path: "/pdf",
1653
- query: profile ? { profile } : void 0,
1654
- body: { targetId: normalizeOptionalString(opts.targetId) }
1655
- }, { timeoutMs: 2e4 });
1656
- if (parent?.json) {
1657
- defaultRuntime.writeJson(result);
1658
- return;
1659
- }
1660
- defaultRuntime.log(`PDF: ${shortenHomePath(result.path)}`);
1661
- });
1662
- });
1663
- browser.command("responsebody").description("Wait for a network response and return its body").argument("<url>", "URL (exact, substring, or glob like **/api)").option("--target-id <id>", "CDP target id (or unique prefix)").option("--timeout-ms <ms>", "How long to wait for the response (default: 20000)", (v) => Number(v)).option("--max-chars <n>", "Max body chars to return (default: 200000)", (v) => Number(v)).action(async (url, opts, cmd) => {
1664
- const parent = parentOpts(cmd);
1665
- const profile = parent?.browserProfile;
1666
- await runBrowserObserve(async () => {
1667
- const timeoutMs = Number.isFinite(opts.timeoutMs) ? opts.timeoutMs : void 0;
1668
- const maxChars = Number.isFinite(opts.maxChars) ? opts.maxChars : void 0;
1669
- const result = await callBrowserRequest(parent, {
1670
- method: "POST",
1671
- path: "/response/body",
1672
- query: profile ? { profile } : void 0,
1673
- body: {
1674
- url,
1675
- targetId: normalizeOptionalString(opts.targetId),
1676
- timeoutMs,
1677
- maxChars
1678
- }
1679
- }, { timeoutMs: timeoutMs ?? 2e4 });
1680
- if (parent?.json) {
1681
- defaultRuntime.writeJson(result);
1682
- return;
1683
- }
1684
- defaultRuntime.log(result.response.body);
1685
- });
1686
- });
1687
- }
1688
- //#endregion
1689
- //#region extensions/browser/src/cli/browser-cli-debug.ts
1690
- const BROWSER_DEBUG_TIMEOUT_MS = 2e4;
1691
- function runBrowserDebug(action) {
1692
- return runCommandWithRuntime(defaultRuntime, action, (err) => {
1693
- defaultRuntime.error(danger(String(err)));
1694
- defaultRuntime.exit(1);
1695
- });
1696
- }
1697
- async function withDebugContext(cmd, parentOpts, action) {
1698
- const parent = parentOpts(cmd);
1699
- await runBrowserDebug(() => action({
1700
- parent,
1701
- profile: parent.browserProfile
1702
- }));
1703
- }
1704
- function printJsonResult$1(parent, result) {
1705
- if (!parent.json) return false;
1706
- defaultRuntime.writeJson(result);
1707
- return true;
1708
- }
1709
- async function callDebugRequest(parent, params) {
1710
- return callBrowserRequest(parent, params, { timeoutMs: BROWSER_DEBUG_TIMEOUT_MS });
1711
- }
1712
- function resolveProfileQuery$1(profile) {
1713
- return profile ? { profile } : void 0;
1714
- }
1715
- function resolveDebugQuery(params) {
1716
- return {
1717
- targetId: normalizeOptionalString(params.targetId),
1718
- filter: normalizeOptionalString(params.filter),
1719
- clear: Boolean(params.clear),
1720
- profile: params.profile
1721
- };
1722
- }
1723
- function registerBrowserDebugCommands(browser, parentOpts) {
1724
- browser.command("highlight").description("Highlight an element by ref").argument("<ref>", "Ref id from snapshot").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (ref, opts, cmd) => {
1725
- await withDebugContext(cmd, parentOpts, async ({ parent, profile }) => {
1726
- if (printJsonResult$1(parent, await callDebugRequest(parent, {
1727
- method: "POST",
1728
- path: "/highlight",
1729
- query: resolveProfileQuery$1(profile),
1730
- body: {
1731
- ref: ref.trim(),
1732
- targetId: normalizeOptionalString(opts.targetId)
1733
- }
1734
- }))) return;
1735
- defaultRuntime.log(`highlighted ${ref.trim()}`);
1736
- });
1737
- });
1738
- browser.command("errors").description("Get recent page errors").option("--clear", "Clear stored errors after reading", false).option("--target-id <id>", "CDP target id (or unique prefix)").action(async (opts, cmd) => {
1739
- await withDebugContext(cmd, parentOpts, async ({ parent, profile }) => {
1740
- const result = await callDebugRequest(parent, {
1741
- method: "GET",
1742
- path: "/errors",
1743
- query: resolveDebugQuery({
1744
- targetId: opts.targetId,
1745
- clear: opts.clear,
1746
- profile
1747
- })
1748
- });
1749
- if (printJsonResult$1(parent, result)) return;
1750
- if (!result.errors.length) {
1751
- defaultRuntime.log("No page errors.");
1752
- return;
1753
- }
1754
- defaultRuntime.log(result.errors.map((e) => `${e.timestamp} ${e.name ? `${e.name}: ` : ""}${e.message}`).join("\n"));
1755
- });
1756
- });
1757
- browser.command("requests").description("Get recent network requests (best-effort)").option("--filter <text>", "Only show URLs that contain this substring").option("--clear", "Clear stored requests after reading", false).option("--target-id <id>", "CDP target id (or unique prefix)").action(async (opts, cmd) => {
1758
- await withDebugContext(cmd, parentOpts, async ({ parent, profile }) => {
1759
- const result = await callDebugRequest(parent, {
1760
- method: "GET",
1761
- path: "/requests",
1762
- query: resolveDebugQuery({
1763
- targetId: opts.targetId,
1764
- filter: opts.filter,
1765
- clear: opts.clear,
1766
- profile
1767
- })
1768
- });
1769
- if (printJsonResult$1(parent, result)) return;
1770
- if (!result.requests.length) {
1771
- defaultRuntime.log("No requests recorded.");
1772
- return;
1773
- }
1774
- defaultRuntime.log(result.requests.map((r) => {
1775
- const status = typeof r.status === "number" ? ` ${r.status}` : "";
1776
- const ok = r.ok === true ? " ok" : r.ok === false ? " fail" : "";
1777
- const fail = r.failureText ? ` (${r.failureText})` : "";
1778
- return `${r.timestamp} ${r.method}${status}${ok} ${r.url}${fail}`;
1779
- }).join("\n"));
1780
- });
1781
- });
1782
- const trace = browser.command("trace").description("Record a Playwright trace");
1783
- trace.command("start").description("Start trace recording").option("--target-id <id>", "CDP target id (or unique prefix)").option("--no-screenshots", "Disable screenshots").option("--no-snapshots", "Disable snapshots").option("--sources", "Include sources (bigger traces)", false).action(async (opts, cmd) => {
1784
- await withDebugContext(cmd, parentOpts, async ({ parent, profile }) => {
1785
- if (printJsonResult$1(parent, await callDebugRequest(parent, {
1786
- method: "POST",
1787
- path: "/trace/start",
1788
- query: resolveProfileQuery$1(profile),
1789
- body: {
1790
- targetId: normalizeOptionalString(opts.targetId),
1791
- screenshots: Boolean(opts.screenshots),
1792
- snapshots: Boolean(opts.snapshots),
1793
- sources: Boolean(opts.sources)
1794
- }
1795
- }))) return;
1796
- defaultRuntime.log("trace started");
1797
- });
1798
- });
1799
- trace.command("stop").description("Stop trace recording and write a .zip").option("--out <path>", "Output path within genesis temp dir (e.g. trace.zip or /tmp/genesis/trace.zip)").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (opts, cmd) => {
1800
- await withDebugContext(cmd, parentOpts, async ({ parent, profile }) => {
1801
- const result = await callDebugRequest(parent, {
1802
- method: "POST",
1803
- path: "/trace/stop",
1804
- query: resolveProfileQuery$1(profile),
1805
- body: {
1806
- targetId: normalizeOptionalString(opts.targetId),
1807
- path: normalizeOptionalString(opts.out)
1808
- }
1809
- });
1810
- if (printJsonResult$1(parent, result)) return;
1811
- defaultRuntime.log(`TRACE:${shortenHomePath(result.path)}`);
1812
- });
1813
- });
1814
- }
1815
- //#endregion
1816
- //#region extensions/browser/src/cli/browser-cli-examples.ts
1817
- const browserCoreExamples = [
1818
- "genesis browser status",
1819
- "genesis browser start",
1820
- "genesis browser stop",
1821
- "genesis browser tabs",
1822
- "genesis browser open https://example.com",
1823
- "genesis browser focus abcd1234",
1824
- "genesis browser close abcd1234",
1825
- "genesis browser screenshot",
1826
- "genesis browser screenshot --full-page",
1827
- "genesis browser screenshot --ref 12",
1828
- "genesis browser snapshot",
1829
- "genesis browser snapshot --format aria --limit 200",
1830
- "genesis browser snapshot --efficient",
1831
- "genesis browser snapshot --labels"
1832
- ];
1833
- const browserActionExamples = [
1834
- "genesis browser navigate https://example.com",
1835
- "genesis browser resize 1280 720",
1836
- "genesis browser click 12 --double",
1837
- "genesis browser click-coords 120 340",
1838
- "genesis browser type 23 \"hello\" --submit",
1839
- "genesis browser press Enter",
1840
- "genesis browser hover 44",
1841
- "genesis browser drag 10 11",
1842
- "genesis browser select 9 OptionA OptionB",
1843
- "genesis browser upload /tmp/genesis/uploads/file.pdf",
1844
- "genesis browser fill --fields '[{\"ref\":\"1\",\"value\":\"Ada\"}]'",
1845
- "genesis browser dialog --accept",
1846
- "genesis browser wait --text \"Done\"",
1847
- "genesis browser evaluate --fn '(el) => el.textContent' --ref 7",
1848
- "genesis browser console --level error",
1849
- "genesis browser pdf"
1850
- ];
1851
- //#endregion
1852
- //#region extensions/browser/src/cli/browser-cli-inspect.ts
1853
- function registerBrowserInspectCommands(browser, parentOpts) {
1854
- browser.command("screenshot").description("Capture a screenshot (MEDIA:<path>)").argument("[targetId]", "CDP target id (or unique prefix)").option("--full-page", "Capture full scrollable page", false).option("--ref <ref>", "ARIA ref from ai snapshot").option("--element <selector>", "CSS selector for element screenshot").option("--labels", "Overlay role refs on the screenshot", false).option("--type <png|jpeg>", "Output type (default: png)", "png").action(async (targetId, opts, cmd) => {
1855
- const parent = parentOpts(cmd);
1856
- const profile = parent?.browserProfile;
1857
- try {
1858
- const result = await callBrowserRequest(parent, {
1859
- method: "POST",
1860
- path: "/screenshot",
1861
- query: profile ? { profile } : void 0,
1862
- body: {
1863
- targetId: normalizeOptionalString(targetId),
1864
- fullPage: Boolean(opts.fullPage),
1865
- ref: normalizeOptionalString(opts.ref),
1866
- element: normalizeOptionalString(opts.element),
1867
- labels: Boolean(opts.labels),
1868
- type: opts.type === "jpeg" ? "jpeg" : "png"
1869
- }
1870
- }, { timeoutMs: 2e4 });
1871
- if (parent?.json) {
1872
- defaultRuntime.writeJson(result);
1873
- return;
1874
- }
1875
- defaultRuntime.log(`MEDIA:${shortenHomePath(result.path)}`);
1876
- } catch (err) {
1877
- defaultRuntime.error(danger(String(err)));
1878
- defaultRuntime.exit(1);
1879
- }
1880
- });
1881
- browser.command("snapshot").description("Capture a snapshot (default: ai; aria is the accessibility tree)").option("--format <aria|ai>", "Snapshot format (default: ai)", "ai").option("--target-id <id>", "CDP target id (or unique prefix)").option("--limit <n>", "Max nodes (default: 500/800)", (v) => Number(v)).option("--mode <efficient>", "Snapshot preset (efficient)").option("--efficient", "Use the efficient snapshot preset", false).option("--interactive", "Role snapshot: interactive elements only", false).option("--compact", "Role snapshot: compact output", false).option("--depth <n>", "Role snapshot: max depth", (v) => Number(v)).option("--selector <sel>", "Role snapshot: scope to CSS selector").option("--frame <sel>", "Role snapshot: scope to an iframe selector").option("--labels", "Include viewport label overlay screenshot", false).option("--urls", "Append discovered link URLs to AI snapshots", false).option("--out <path>", "Write snapshot to a file").action(async (opts, cmd) => {
1882
- const parent = parentOpts(cmd);
1883
- const profile = parent?.browserProfile;
1884
- const format = opts.format === "aria" ? "aria" : "ai";
1885
- const configMode = !(typeof cmd.getOptionValueSource === "function" && cmd.getOptionValueSource("format") === "cli") && format === "ai" && loadConfig().browser?.snapshotDefaults?.mode === "efficient" ? "efficient" : void 0;
1886
- const mode = opts.efficient === true || opts.mode === "efficient" ? "efficient" : configMode;
1887
- try {
1888
- const result = await callBrowserRequest(parent, {
1889
- method: "GET",
1890
- path: "/snapshot",
1891
- query: {
1892
- format,
1893
- targetId: normalizeOptionalString(opts.targetId),
1894
- limit: Number.isFinite(opts.limit) ? opts.limit : void 0,
1895
- interactive: opts.interactive ? true : void 0,
1896
- compact: opts.compact ? true : void 0,
1897
- depth: Number.isFinite(opts.depth) ? opts.depth : void 0,
1898
- selector: normalizeOptionalString(opts.selector),
1899
- frame: normalizeOptionalString(opts.frame),
1900
- labels: opts.labels ? true : void 0,
1901
- urls: opts.urls ? true : void 0,
1902
- mode,
1903
- profile
1904
- }
1905
- }, { timeoutMs: 2e4 });
1906
- if (opts.out) {
1907
- if (result.format === "ai") await fs.writeFile(opts.out, result.snapshot, "utf8");
1908
- else {
1909
- const payload = JSON.stringify(result, null, 2);
1910
- await fs.writeFile(opts.out, payload, "utf8");
1911
- }
1912
- if (parent?.json) defaultRuntime.writeJson({
1913
- ok: true,
1914
- out: opts.out,
1915
- ...result.format === "ai" && result.imagePath ? { imagePath: result.imagePath } : {}
1916
- });
1917
- else {
1918
- defaultRuntime.log(shortenHomePath(opts.out));
1919
- if (result.format === "ai" && result.imagePath) defaultRuntime.log(`MEDIA:${shortenHomePath(result.imagePath)}`);
1920
- }
1921
- return;
1922
- }
1923
- if (parent?.json) {
1924
- defaultRuntime.writeJson(result);
1925
- return;
1926
- }
1927
- if (result.format === "ai") {
1928
- defaultRuntime.log(result.snapshot);
1929
- if (result.imagePath) defaultRuntime.log(`MEDIA:${shortenHomePath(result.imagePath)}`);
1930
- return;
1931
- }
1932
- const nodes = "nodes" in result ? result.nodes : [];
1933
- defaultRuntime.log(nodes.map((n) => {
1934
- const indent = " ".repeat(Math.min(20, n.depth));
1935
- const name = n.name ? ` "${n.name}"` : "";
1936
- const value = n.value ? ` = "${n.value}"` : "";
1937
- return `${indent}- ${n.role}${name}${value}`;
1938
- }).join("\n"));
1939
- } catch (err) {
1940
- defaultRuntime.error(danger(String(err)));
1941
- defaultRuntime.exit(1);
1942
- }
1943
- });
1944
- }
1945
- //#endregion
1946
- //#region extensions/browser/src/cli/browser-cli-manage.ts
1947
- const BROWSER_MANAGE_REQUEST_TIMEOUT_MS = 45e3;
1948
- function resolveProfileQuery(profile) {
1949
- return profile ? { profile } : void 0;
1950
- }
1951
- function printJsonResult(parent, payload) {
1952
- if (!parent?.json) return false;
1953
- defaultRuntime.writeJson(payload);
1954
- return true;
1955
- }
1956
- async function callTabAction(parent, profile, body) {
1957
- return callBrowserRequest(parent, {
1958
- method: "POST",
1959
- path: "/tabs/action",
1960
- query: resolveProfileQuery(profile),
1961
- body
1962
- }, { timeoutMs: BROWSER_MANAGE_REQUEST_TIMEOUT_MS });
1963
- }
1964
- async function fetchBrowserStatus(parent, profile) {
1965
- return await callBrowserRequest(parent, {
1966
- method: "GET",
1967
- path: "/",
1968
- query: resolveProfileQuery(profile)
1969
- }, { timeoutMs: BROWSER_MANAGE_REQUEST_TIMEOUT_MS });
1970
- }
1971
- async function runBrowserToggle(parent, params) {
1972
- await callBrowserRequest(parent, {
1973
- method: "POST",
1974
- path: params.path,
1975
- query: resolveProfileQuery(params.profile)
1976
- });
1977
- const status = await fetchBrowserStatus(parent, params.profile);
1978
- if (printJsonResult(parent, status)) return;
1979
- const name = status.profile ?? "genesis";
1980
- defaultRuntime.log(info(`🦞 browser [${name}] running: ${status.running}`));
1981
- }
1982
- function runBrowserCommand$1(action) {
1983
- return runCommandWithRuntime(defaultRuntime, action, (err) => {
1984
- defaultRuntime.error(danger(String(err)));
1985
- defaultRuntime.exit(1);
1986
- });
1987
- }
1988
- function logBrowserTabs(tabs, json) {
1989
- if (json) {
1990
- defaultRuntime.writeJson({ tabs });
1991
- return;
1992
- }
1993
- if (tabs.length === 0) {
1994
- defaultRuntime.log("No tabs (browser closed or no targets).");
1995
- return;
1996
- }
1997
- defaultRuntime.log(tabs.map((t, i) => {
1998
- const alias = [t.tabId, t.label ? `label:${t.label}` : void 0].filter(Boolean).join(" ");
1999
- return `${i + 1}. ${t.title || "(untitled)"}${alias ? ` [${alias}]` : ""}\n ${t.url}\n id: ${t.targetId}`;
2000
- }).join("\n"));
2001
- }
2002
- function formatDoctorLine(check) {
2003
- return `${check.ok ? "OK" : "FAIL"} ${check.name}${check.detail ? `: ${check.detail}` : ""}`;
2004
- }
2005
- async function runBrowserDoctor(parent, profile) {
2006
- const checks = [];
2007
- let status = null;
2008
- try {
2009
- status = await fetchBrowserStatus(parent, profile);
2010
- checks.push({
2011
- name: "gateway",
2012
- ok: true,
2013
- detail: "browser control endpoint reachable"
2014
- });
2015
- } catch (err) {
2016
- checks.push({
2017
- name: "gateway",
2018
- ok: false,
2019
- detail: String(err)
2020
- });
2021
- return {
2022
- ok: false,
2023
- checks
2024
- };
2025
- }
2026
- checks.push({
2027
- name: "plugin",
2028
- ok: status.enabled,
2029
- detail: status.enabled ? "enabled" : "disabled in config"
2030
- });
2031
- checks.push({
2032
- name: "profile",
2033
- ok: true,
2034
- detail: `${status.profile ?? "genesis"} (${usesChromeMcpTransport(status) ? "chrome-mcp" : status.transport ?? "cdp"})`
2035
- });
2036
- checks.push({
2037
- name: "browser",
2038
- ok: status.running,
2039
- detail: status.running ? `running${status.cdpReady === false ? ", CDP not ready" : ""}` : "not running; run `genesis browser start`"
2040
- });
2041
- try {
2042
- const profiles = await callBrowserRequest(parent, {
2043
- method: "GET",
2044
- path: "/profiles"
2045
- }, { timeoutMs: BROWSER_MANAGE_REQUEST_TIMEOUT_MS });
2046
- checks.push({
2047
- name: "profiles",
2048
- ok: true,
2049
- detail: `${profiles.profiles?.length ?? 0} configured`
2050
- });
2051
- } catch (err) {
2052
- checks.push({
2053
- name: "profiles",
2054
- ok: false,
2055
- detail: String(err)
2056
- });
2057
- }
2058
- if (status.running) try {
2059
- const tabs = (await callBrowserRequest(parent, {
2060
- method: "GET",
2061
- path: "/tabs",
2062
- query: resolveProfileQuery(profile)
2063
- }, { timeoutMs: BROWSER_MANAGE_REQUEST_TIMEOUT_MS })).tabs ?? [];
2064
- checks.push({
2065
- name: "tabs",
2066
- ok: true,
2067
- detail: `${tabs.length} visible${tabs.length > 0 && tabs[0]?.suggestedTargetId ? `, use target ${tabs[0].suggestedTargetId}` : ""}`
2068
- });
2069
- } catch (err) {
2070
- checks.push({
2071
- name: "tabs",
2072
- ok: false,
2073
- detail: String(err)
2074
- });
2075
- }
2076
- return {
2077
- ok: checks.every((check) => check.ok),
2078
- checks,
2079
- status
2080
- };
2081
- }
2082
- function usesChromeMcpTransport(params) {
2083
- return params.transport === "chrome-mcp" || params.driver === "existing-session";
2084
- }
2085
- function formatBrowserConnectionSummary(params) {
2086
- if (usesChromeMcpTransport(params)) {
2087
- const userDataDir = params.userDataDir ? shortenHomePath(params.userDataDir) : null;
2088
- return userDataDir ? `transport: chrome-mcp, userDataDir: ${userDataDir}` : "transport: chrome-mcp";
2089
- }
2090
- if (params.isRemote) return `cdpUrl: ${params.cdpUrl ?? "(unset)"}`;
2091
- return `port: ${params.cdpPort ?? "(unset)"}`;
2092
- }
2093
- function registerBrowserManageCommands(browser, parentOpts) {
2094
- browser.command("status").description("Show browser status").action(async (_opts, cmd) => {
2095
- const parent = parentOpts(cmd);
2096
- await runBrowserCommand$1(async () => {
2097
- const status = await fetchBrowserStatus(parent, parent?.browserProfile);
2098
- if (printJsonResult(parent, status)) return;
2099
- const detectedPath = status.detectedExecutablePath ?? status.executablePath;
2100
- const detectedDisplay = detectedPath ? shortenHomePath(detectedPath) : "auto";
2101
- defaultRuntime.log([
2102
- `profile: ${status.profile ?? "genesis"}`,
2103
- `enabled: ${status.enabled}`,
2104
- `running: ${status.running}`,
2105
- `transport: ${usesChromeMcpTransport(status) ? "chrome-mcp" : status.transport ?? "cdp"}`,
2106
- ...!usesChromeMcpTransport(status) ? [`cdpPort: ${status.cdpPort ?? "(unset)"}`, `cdpUrl: ${redactCdpUrl(status.cdpUrl ?? `http://127.0.0.1:${status.cdpPort}`)}`] : status.userDataDir ? [`userDataDir: ${shortenHomePath(status.userDataDir)}`] : [],
2107
- `browser: ${status.chosenBrowser ?? "unknown"}`,
2108
- `detectedBrowser: ${status.detectedBrowser ?? "unknown"}`,
2109
- `detectedPath: ${detectedDisplay}`,
2110
- `profileColor: ${status.color}`,
2111
- ...status.tor ? [`tor: ${status.tor.mode}/${status.tor.routeMode} ${status.tor.socksHost}:${status.tor.socksPort}${status.tor.running === true ? " (running)" : ""}`] : [],
2112
- ...status.detectError ? [`detectError: ${status.detectError}`] : []
2113
- ].join("\n"));
2114
- });
2115
- });
2116
- browser.command("doctor").description("Check browser plugin readiness").action(async (_opts, cmd) => {
2117
- const parent = parentOpts(cmd);
2118
- const profile = parent?.browserProfile;
2119
- await runBrowserCommand$1(async () => {
2120
- const result = await runBrowserDoctor(parent, profile);
2121
- if (printJsonResult(parent, result)) return;
2122
- defaultRuntime.log(result.checks.map(formatDoctorLine).join("\n"));
2123
- if (!result.ok) defaultRuntime.exit(1);
2124
- });
2125
- });
2126
- browser.command("start").description("Start the browser (no-op if already running)").action(async (_opts, cmd) => {
2127
- const parent = parentOpts(cmd);
2128
- const profile = parent?.browserProfile;
2129
- await runBrowserCommand$1(async () => {
2130
- await runBrowserToggle(parent, {
2131
- profile,
2132
- path: "/start"
2133
- });
2134
- });
2135
- });
2136
- browser.command("stop").description("Stop the browser (best-effort)").action(async (_opts, cmd) => {
2137
- const parent = parentOpts(cmd);
2138
- const profile = parent?.browserProfile;
2139
- await runBrowserCommand$1(async () => {
2140
- await runBrowserToggle(parent, {
2141
- profile,
2142
- path: "/stop"
2143
- });
2144
- });
2145
- });
2146
- browser.command("reset-profile").description("Reset browser profile (moves it to Trash)").action(async (_opts, cmd) => {
2147
- const parent = parentOpts(cmd);
2148
- const profile = parent?.browserProfile;
2149
- await runBrowserCommand$1(async () => {
2150
- const result = await callBrowserRequest(parent, {
2151
- method: "POST",
2152
- path: "/reset-profile",
2153
- query: resolveProfileQuery(profile)
2154
- }, { timeoutMs: 2e4 });
2155
- if (printJsonResult(parent, result)) return;
2156
- if (!result.moved) {
2157
- defaultRuntime.log(info(`🦞 browser profile already missing.`));
2158
- return;
2159
- }
2160
- const dest = result.to ?? result.from;
2161
- defaultRuntime.log(info(`🦞 browser profile moved to Trash (${dest})`));
2162
- });
2163
- });
2164
- browser.command("tabs").description("List open tabs").action(async (_opts, cmd) => {
2165
- const parent = parentOpts(cmd);
2166
- const profile = parent?.browserProfile;
2167
- await runBrowserCommand$1(async () => {
2168
- logBrowserTabs((await callBrowserRequest(parent, {
2169
- method: "GET",
2170
- path: "/tabs",
2171
- query: resolveProfileQuery(profile)
2172
- }, { timeoutMs: BROWSER_MANAGE_REQUEST_TIMEOUT_MS })).tabs ?? [], parent?.json);
2173
- });
2174
- });
2175
- const tab = browser.command("tab").description("Tab shortcuts (index-based)").action(async (_opts, cmd) => {
2176
- const parent = parentOpts(cmd);
2177
- const profile = parent?.browserProfile;
2178
- await runBrowserCommand$1(async () => {
2179
- logBrowserTabs((await callBrowserRequest(parent, {
2180
- method: "POST",
2181
- path: "/tabs/action",
2182
- query: resolveProfileQuery(profile),
2183
- body: { action: "list" }
2184
- }, { timeoutMs: BROWSER_MANAGE_REQUEST_TIMEOUT_MS })).tabs ?? [], parent?.json);
2185
- });
2186
- });
2187
- tab.command("new").description("Open a new tab (about:blank)").option("--label <label>", "Assign a friendly tab label").action(async (opts, cmd) => {
2188
- const parent = parentOpts(cmd);
2189
- const profile = parent?.browserProfile;
2190
- await runBrowserCommand$1(async () => {
2191
- const result = await callTabAction(parent, profile, {
2192
- action: "new",
2193
- label: opts.label
2194
- });
2195
- if (printJsonResult(parent, result)) return;
2196
- const opened = result.tab;
2197
- defaultRuntime.log(opened?.tabId ? `opened new tab ${opened.tabId}${opened.label ? ` (${opened.label})` : ""}` : "opened new tab");
2198
- });
2199
- });
2200
- tab.command("label").description("Assign a friendly label to a tab").argument("<targetId>", "Target id, tab id, label, or unique target id prefix").argument("<label>", "Friendly label").action(async (targetId, label, _opts, cmd) => {
2201
- const parent = parentOpts(cmd);
2202
- const profile = parent?.browserProfile;
2203
- await runBrowserCommand$1(async () => {
2204
- const result = await callTabAction(parent, profile, {
2205
- action: "label",
2206
- targetId,
2207
- label
2208
- });
2209
- if (printJsonResult(parent, result)) return;
2210
- const tab = result.tab;
2211
- defaultRuntime.log(`labeled tab ${tab?.tabId ?? targetId} as ${tab?.label ?? label}`);
2212
- });
2213
- });
2214
- tab.command("select").description("Focus tab by index (1-based)").argument("<index>", "Tab index (1-based)", (v) => Number(v)).action(async (index, _opts, cmd) => {
2215
- const parent = parentOpts(cmd);
2216
- const profile = parent?.browserProfile;
2217
- if (!Number.isFinite(index) || index < 1) {
2218
- defaultRuntime.error(danger("index must be a positive number"));
2219
- defaultRuntime.exit(1);
2220
- return;
2221
- }
2222
- await runBrowserCommand$1(async () => {
2223
- if (printJsonResult(parent, await callTabAction(parent, profile, {
2224
- action: "select",
2225
- index: Math.floor(index) - 1
2226
- }))) return;
2227
- defaultRuntime.log(`selected tab ${Math.floor(index)}`);
2228
- });
2229
- });
2230
- tab.command("close").description("Close tab by index (1-based); default: first tab").argument("[index]", "Tab index (1-based)", (v) => Number(v)).action(async (index, _opts, cmd) => {
2231
- const parent = parentOpts(cmd);
2232
- const profile = parent?.browserProfile;
2233
- const idx = typeof index === "number" && Number.isFinite(index) ? Math.floor(index) - 1 : void 0;
2234
- if (typeof idx === "number" && idx < 0) {
2235
- defaultRuntime.error(danger("index must be >= 1"));
2236
- defaultRuntime.exit(1);
2237
- return;
2238
- }
2239
- await runBrowserCommand$1(async () => {
2240
- if (printJsonResult(parent, await callTabAction(parent, profile, {
2241
- action: "close",
2242
- index: idx
2243
- }))) return;
2244
- defaultRuntime.log("closed tab");
2245
- });
2246
- });
2247
- browser.command("open").description("Open a URL in a new tab").argument("<url>", "URL to open").option("--label <label>", "Assign a friendly tab label").action(async (url, opts, cmd) => {
2248
- const parent = parentOpts(cmd);
2249
- const profile = parent?.browserProfile;
2250
- await runBrowserCommand$1(async () => {
2251
- const tab = await callBrowserRequest(parent, {
2252
- method: "POST",
2253
- path: "/tabs/open",
2254
- query: resolveProfileQuery(profile),
2255
- body: {
2256
- url,
2257
- ...opts.label ? { label: opts.label } : {}
2258
- }
2259
- }, { timeoutMs: BROWSER_MANAGE_REQUEST_TIMEOUT_MS });
2260
- if (printJsonResult(parent, tab)) return;
2261
- defaultRuntime.log(`opened: ${tab.url}\n${tab.tabId ? `tab: ${tab.tabId}\n` : ""}${tab.label ? `label: ${tab.label}\n` : ""}id: ${tab.targetId}`);
2262
- });
2263
- });
2264
- browser.command("focus").description("Focus a tab by target id, tab id, label, or unique target id prefix").argument("<targetId>", "Target id, tab id, label, or unique target id prefix").action(async (targetId, _opts, cmd) => {
2265
- const parent = parentOpts(cmd);
2266
- const profile = parent?.browserProfile;
2267
- await runBrowserCommand$1(async () => {
2268
- await callBrowserRequest(parent, {
2269
- method: "POST",
2270
- path: "/tabs/focus",
2271
- query: resolveProfileQuery(profile),
2272
- body: { targetId }
2273
- }, { timeoutMs: BROWSER_MANAGE_REQUEST_TIMEOUT_MS });
2274
- if (printJsonResult(parent, { ok: true })) return;
2275
- defaultRuntime.log(`focused tab ${targetId}`);
2276
- });
2277
- });
2278
- browser.command("close").description("Close a tab (target id optional)").argument("[targetId]", "Target id, tab id, label, or unique target id prefix (optional)").action(async (targetId, _opts, cmd) => {
2279
- const parent = parentOpts(cmd);
2280
- const profile = parent?.browserProfile;
2281
- await runBrowserCommand$1(async () => {
2282
- if (targetId?.trim()) await callBrowserRequest(parent, {
2283
- method: "DELETE",
2284
- path: `/tabs/${encodeURIComponent(targetId.trim())}`,
2285
- query: resolveProfileQuery(profile)
2286
- }, { timeoutMs: BROWSER_MANAGE_REQUEST_TIMEOUT_MS });
2287
- else await callBrowserRequest(parent, {
2288
- method: "POST",
2289
- path: "/act",
2290
- query: resolveProfileQuery(profile),
2291
- body: { kind: "close" }
2292
- }, { timeoutMs: BROWSER_MANAGE_REQUEST_TIMEOUT_MS });
2293
- if (printJsonResult(parent, { ok: true })) return;
2294
- defaultRuntime.log("closed tab");
2295
- });
2296
- });
2297
- browser.command("profiles").description("List all browser profiles").action(async (_opts, cmd) => {
2298
- const parent = parentOpts(cmd);
2299
- await runBrowserCommand$1(async () => {
2300
- const profiles = (await callBrowserRequest(parent, {
2301
- method: "GET",
2302
- path: "/profiles"
2303
- }, { timeoutMs: BROWSER_MANAGE_REQUEST_TIMEOUT_MS })).profiles ?? [];
2304
- if (printJsonResult(parent, { profiles })) return;
2305
- if (profiles.length === 0) {
2306
- defaultRuntime.log("No profiles configured.");
2307
- return;
2308
- }
2309
- defaultRuntime.log(profiles.map((p) => {
2310
- const status = p.running ? "running" : "stopped";
2311
- const tabs = p.running ? ` (${p.tabCount} tabs)` : "";
2312
- const def = p.isDefault ? " [default]" : "";
2313
- const loc = formatBrowserConnectionSummary(p);
2314
- const remote = p.isRemote ? " [remote]" : "";
2315
- const driver = p.driver !== "genesis" ? ` [${p.driver}]` : "";
2316
- const tor = p.tor ? `\n tor: ${p.tor.mode}/${p.tor.routeMode} ${p.tor.socksHost}:${p.tor.socksPort}${p.tor.running === true ? " (running)" : ""}` : "";
2317
- return `${p.name}: ${status}${tabs}${def}${remote}${driver}\n ${loc}, color: ${p.color}${tor}`;
2318
- }).join("\n"));
2319
- });
2320
- });
2321
- browser.command("create-profile").description("Create a new browser profile").requiredOption("--name <name>", "Profile name (lowercase, numbers, hyphens)").option("--color <hex>", "Profile color (hex format, e.g. #0066CC)").option("--cdp-url <url>", "CDP URL for remote Chrome (http/https)").option("--user-data-dir <path>", "User data dir for existing-session Chromium attach").option("--driver <driver>", "Profile driver (genesis|existing-session). Default: genesis").option("--tor", "Route this managed headless profile through a Tor SOCKS sidecar").action(async (opts, cmd) => {
2322
- const parent = parentOpts(cmd);
2323
- await runBrowserCommand$1(async () => {
2324
- const result = await callBrowserRequest(parent, {
2325
- method: "POST",
2326
- path: "/profiles/create",
2327
- body: {
2328
- name: opts.name,
2329
- color: opts.color,
2330
- cdpUrl: opts.cdpUrl,
2331
- userDataDir: opts.userDataDir,
2332
- tor: opts.tor === true,
2333
- driver: opts.driver === "existing-session" ? "existing-session" : void 0
2334
- }
2335
- }, { timeoutMs: 1e4 });
2336
- if (printJsonResult(parent, result)) return;
2337
- const loc = ` ${formatBrowserConnectionSummary(result)}`;
2338
- defaultRuntime.log(info(`🦞 Created profile "${result.profile}"\n${loc}\n color: ${result.color}${result.userDataDir ? `\n userDataDir: ${shortenHomePath(result.userDataDir)}` : ""}${opts.driver === "existing-session" ? "\n driver: existing-session" : ""}${opts.tor ? "\n tor: managed" : ""}`));
2339
- });
2340
- });
2341
- browser.command("delete-profile").description("Delete a browser profile").requiredOption("--name <name>", "Profile name to delete").action(async (opts, cmd) => {
2342
- const parent = parentOpts(cmd);
2343
- await runBrowserCommand$1(async () => {
2344
- const result = await callBrowserRequest(parent, {
2345
- method: "DELETE",
2346
- path: `/profiles/${encodeURIComponent(opts.name)}`
2347
- }, { timeoutMs: 2e4 });
2348
- if (printJsonResult(parent, result)) return;
2349
- const msg = result.deleted ? `🦞 Deleted profile "${result.profile}" (user data removed)` : `🦞 Deleted profile "${result.profile}" (no user data found)`;
2350
- defaultRuntime.log(info(msg));
2351
- });
2352
- });
2353
- }
2354
- //#endregion
2355
- //#region extensions/browser/src/cli/browser-cli-state.cookies-storage.ts
2356
- function resolveUrl(opts, command) {
2357
- return normalizeOptionalString(opts.url) ?? normalizeOptionalString(inheritOptionFromParent(command, "url"));
2358
- }
2359
- function resolveTargetId(rawTargetId, command) {
2360
- return normalizeOptionalString(rawTargetId) ?? normalizeOptionalString(inheritOptionFromParent(command, "targetId"));
2361
- }
2362
- async function runMutationRequest(params) {
2363
- try {
2364
- const result = await callBrowserRequest(params.parent, params.request, { timeoutMs: 2e4 });
2365
- if (params.parent?.json) {
2366
- defaultRuntime.writeJson(result);
2367
- return;
2368
- }
2369
- defaultRuntime.log(params.successMessage);
2370
- } catch (err) {
2371
- defaultRuntime.error(danger(String(err)));
2372
- defaultRuntime.exit(1);
2373
- }
2374
- }
2375
- function registerBrowserCookiesAndStorageCommands(browser, parentOpts) {
2376
- const cookies = browser.command("cookies").description("Read/write cookies");
2377
- cookies.option("--target-id <id>", "CDP target id (or unique prefix)").action(async (opts, cmd) => {
2378
- const parent = parentOpts(cmd);
2379
- const profile = parent?.browserProfile;
2380
- const targetId = resolveTargetId(opts.targetId, cmd);
2381
- try {
2382
- const result = await callBrowserRequest(parent, {
2383
- method: "GET",
2384
- path: "/cookies",
2385
- query: {
2386
- targetId,
2387
- profile
2388
- }
2389
- }, { timeoutMs: 2e4 });
2390
- if (parent?.json) {
2391
- defaultRuntime.writeJson(result);
2392
- return;
2393
- }
2394
- defaultRuntime.writeJson(result.cookies ?? []);
2395
- } catch (err) {
2396
- defaultRuntime.error(danger(String(err)));
2397
- defaultRuntime.exit(1);
2398
- }
2399
- });
2400
- cookies.command("set").description("Set a cookie (requires --url or domain+path)").argument("<name>", "Cookie name").argument("<value>", "Cookie value").option("--url <url>", "Cookie URL scope (recommended)").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (name, value, opts, cmd) => {
2401
- const parent = parentOpts(cmd);
2402
- const profile = parent?.browserProfile;
2403
- const targetId = resolveTargetId(opts.targetId, cmd);
2404
- const url = resolveUrl(opts, cmd);
2405
- if (!url) {
2406
- defaultRuntime.error(danger("Missing required --url option for cookies set"));
2407
- defaultRuntime.exit(1);
2408
- return;
2409
- }
2410
- await runMutationRequest({
2411
- parent,
2412
- request: {
2413
- method: "POST",
2414
- path: "/cookies/set",
2415
- query: profile ? { profile } : void 0,
2416
- body: {
2417
- targetId,
2418
- cookie: {
2419
- name,
2420
- value,
2421
- url
2422
- }
2423
- }
2424
- },
2425
- successMessage: `cookie set: ${name}`
2426
- });
2427
- });
2428
- cookies.command("clear").description("Clear all cookies").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (opts, cmd) => {
2429
- const parent = parentOpts(cmd);
2430
- const profile = parent?.browserProfile;
2431
- const targetId = resolveTargetId(opts.targetId, cmd);
2432
- await runMutationRequest({
2433
- parent,
2434
- request: {
2435
- method: "POST",
2436
- path: "/cookies/clear",
2437
- query: profile ? { profile } : void 0,
2438
- body: { targetId }
2439
- },
2440
- successMessage: "cookies cleared"
2441
- });
2442
- });
2443
- const storage = browser.command("storage").description("Read/write localStorage/sessionStorage");
2444
- function registerStorageKind(kind) {
2445
- const cmd = storage.command(kind).description(`${kind}Storage commands`);
2446
- cmd.command("get").description(`Get ${kind}Storage (all keys or one key)`).argument("[key]", "Key (optional)").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (key, opts, cmd2) => {
2447
- const parent = parentOpts(cmd2);
2448
- const profile = parent?.browserProfile;
2449
- const targetId = resolveTargetId(opts.targetId, cmd2);
2450
- try {
2451
- const result = await callBrowserRequest(parent, {
2452
- method: "GET",
2453
- path: `/storage/${kind}`,
2454
- query: {
2455
- key: normalizeOptionalString(key),
2456
- targetId,
2457
- profile
2458
- }
2459
- }, { timeoutMs: 2e4 });
2460
- if (parent?.json) {
2461
- defaultRuntime.writeJson(result);
2462
- return;
2463
- }
2464
- defaultRuntime.writeJson(result.values ?? {});
2465
- } catch (err) {
2466
- defaultRuntime.error(danger(String(err)));
2467
- defaultRuntime.exit(1);
2468
- }
2469
- });
2470
- cmd.command("set").description(`Set a ${kind}Storage key`).argument("<key>", "Key").argument("<value>", "Value").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (key, value, opts, cmd2) => {
2471
- const parent = parentOpts(cmd2);
2472
- const profile = parent?.browserProfile;
2473
- const targetId = resolveTargetId(opts.targetId, cmd2);
2474
- await runMutationRequest({
2475
- parent,
2476
- request: {
2477
- method: "POST",
2478
- path: `/storage/${kind}/set`,
2479
- query: profile ? { profile } : void 0,
2480
- body: {
2481
- key,
2482
- value,
2483
- targetId
2484
- }
2485
- },
2486
- successMessage: `${kind}Storage set: ${key}`
2487
- });
2488
- });
2489
- cmd.command("clear").description(`Clear all ${kind}Storage keys`).option("--target-id <id>", "CDP target id (or unique prefix)").action(async (opts, cmd2) => {
2490
- const parent = parentOpts(cmd2);
2491
- const profile = parent?.browserProfile;
2492
- const targetId = resolveTargetId(opts.targetId, cmd2);
2493
- await runMutationRequest({
2494
- parent,
2495
- request: {
2496
- method: "POST",
2497
- path: `/storage/${kind}/clear`,
2498
- query: profile ? { profile } : void 0,
2499
- body: { targetId }
2500
- },
2501
- successMessage: `${kind}Storage cleared`
2502
- });
2503
- });
2504
- }
2505
- registerStorageKind("local");
2506
- registerStorageKind("session");
2507
- }
2508
- //#endregion
2509
- //#region extensions/browser/src/cli/browser-cli-state.ts
2510
- function parseOnOff(raw) {
2511
- const parsed = parseBooleanValue(raw);
2512
- return parsed === void 0 ? null : parsed;
2513
- }
2514
- function runBrowserCommand(action) {
2515
- return runCommandWithRuntime(defaultRuntime, action, (err) => {
2516
- defaultRuntime.error(danger(String(err)));
2517
- defaultRuntime.exit(1);
2518
- });
2519
- }
2520
- async function runBrowserSetRequest(params) {
2521
- await runBrowserCommand(async () => {
2522
- const profile = params.parent?.browserProfile;
2523
- const result = await callBrowserRequest(params.parent, {
2524
- method: "POST",
2525
- path: params.path,
2526
- query: profile ? { profile } : void 0,
2527
- body: params.body
2528
- }, { timeoutMs: 2e4 });
2529
- if (params.parent?.json) {
2530
- defaultRuntime.writeJson(result);
2531
- return;
2532
- }
2533
- defaultRuntime.log(params.successMessage);
2534
- });
2535
- }
2536
- function registerBrowserStateCommands(browser, parentOpts) {
2537
- registerBrowserCookiesAndStorageCommands(browser, parentOpts);
2538
- const set = browser.command("set").description("Browser environment settings");
2539
- set.command("viewport").description("Set viewport size (alias for resize)").argument("<width>", "Viewport width", (v) => Number(v)).argument("<height>", "Viewport height", (v) => Number(v)).option("--target-id <id>", "CDP target id (or unique prefix)").action(async (width, height, opts, cmd) => {
2540
- const parent = parentOpts(cmd);
2541
- const profile = parent?.browserProfile;
2542
- await runBrowserCommand(async () => {
2543
- await runBrowserResizeWithOutput({
2544
- parent,
2545
- profile,
2546
- width,
2547
- height,
2548
- targetId: opts.targetId,
2549
- timeoutMs: 2e4,
2550
- successMessage: `viewport set: ${width}x${height}`
2551
- });
2552
- });
2553
- });
2554
- set.command("offline").description("Toggle offline mode").argument("<on|off>", "on/off").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (value, opts, cmd) => {
2555
- const parent = parentOpts(cmd);
2556
- const offline = parseOnOff(value);
2557
- if (offline === null) {
2558
- defaultRuntime.error(danger("Expected on|off"));
2559
- defaultRuntime.exit(1);
2560
- return;
2561
- }
2562
- await runBrowserSetRequest({
2563
- parent,
2564
- path: "/set/offline",
2565
- body: {
2566
- offline,
2567
- targetId: normalizeOptionalString(opts.targetId)
2568
- },
2569
- successMessage: `offline: ${offline}`
2570
- });
2571
- });
2572
- set.command("headers").description("Set extra HTTP headers (JSON object)").argument("[headersJson]", "JSON object of headers (alternative to --headers-json)").option("--headers-json <json>", "JSON object of headers").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (headersJson, opts, cmd) => {
2573
- const parent = parentOpts(cmd);
2574
- await runBrowserCommand(async () => {
2575
- const headersJsonValue = normalizeOptionalString(opts.headersJson) ?? normalizeOptionalString(headersJson);
2576
- if (!headersJsonValue) throw new Error("Missing headers JSON (pass --headers-json or positional JSON argument)");
2577
- const parsed = JSON.parse(headersJsonValue);
2578
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("Headers JSON must be a JSON object");
2579
- const headers = {};
2580
- for (const [k, v] of Object.entries(parsed)) if (typeof v === "string") headers[k] = v;
2581
- const profile = parent?.browserProfile;
2582
- const result = await callBrowserRequest(parent, {
2583
- method: "POST",
2584
- path: "/set/headers",
2585
- query: profile ? { profile } : void 0,
2586
- body: {
2587
- headers,
2588
- targetId: normalizeOptionalString(opts.targetId)
2589
- }
2590
- }, { timeoutMs: 2e4 });
2591
- if (parent?.json) {
2592
- defaultRuntime.writeJson(result);
2593
- return;
2594
- }
2595
- defaultRuntime.log("headers set");
2596
- });
2597
- });
2598
- set.command("credentials").description("Set HTTP basic auth credentials").option("--clear", "Clear credentials", false).argument("[username]", "Username").argument("[password]", "Password").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (username, password, opts, cmd) => {
2599
- await runBrowserSetRequest({
2600
- parent: parentOpts(cmd),
2601
- path: "/set/credentials",
2602
- body: {
2603
- username: normalizeOptionalString(username),
2604
- password,
2605
- clear: Boolean(opts.clear),
2606
- targetId: normalizeOptionalString(opts.targetId)
2607
- },
2608
- successMessage: opts.clear ? "credentials cleared" : "credentials set"
2609
- });
2610
- });
2611
- set.command("geo").description("Set geolocation (and grant permission)").option("--clear", "Clear geolocation + permissions", false).argument("[latitude]", "Latitude", (v) => Number(v)).argument("[longitude]", "Longitude", (v) => Number(v)).option("--accuracy <m>", "Accuracy in meters", (v) => Number(v)).option("--origin <origin>", "Origin to grant permissions for").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (latitude, longitude, opts, cmd) => {
2612
- await runBrowserSetRequest({
2613
- parent: parentOpts(cmd),
2614
- path: "/set/geolocation",
2615
- body: {
2616
- latitude: Number.isFinite(latitude) ? latitude : void 0,
2617
- longitude: Number.isFinite(longitude) ? longitude : void 0,
2618
- accuracy: Number.isFinite(opts.accuracy) ? opts.accuracy : void 0,
2619
- origin: normalizeOptionalString(opts.origin),
2620
- clear: Boolean(opts.clear),
2621
- targetId: normalizeOptionalString(opts.targetId)
2622
- },
2623
- successMessage: opts.clear ? "geolocation cleared" : "geolocation set"
2624
- });
2625
- });
2626
- set.command("media").description("Emulate prefers-color-scheme").argument("<dark|light|none>", "dark/light/none").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (value, opts, cmd) => {
2627
- const parent = parentOpts(cmd);
2628
- const v = normalizeOptionalLowercaseString(value);
2629
- const colorScheme = v === "dark" ? "dark" : v === "light" ? "light" : v === "none" ? "none" : null;
2630
- if (!colorScheme) {
2631
- defaultRuntime.error(danger("Expected dark|light|none"));
2632
- defaultRuntime.exit(1);
2633
- return;
2634
- }
2635
- await runBrowserSetRequest({
2636
- parent,
2637
- path: "/set/media",
2638
- body: {
2639
- colorScheme,
2640
- targetId: normalizeOptionalString(opts.targetId)
2641
- },
2642
- successMessage: `media colorScheme: ${colorScheme}`
2643
- });
2644
- });
2645
- set.command("timezone").description("Override timezone (CDP)").argument("<timezoneId>", "Timezone ID (e.g. America/New_York)").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (timezoneId, opts, cmd) => {
2646
- await runBrowserSetRequest({
2647
- parent: parentOpts(cmd),
2648
- path: "/set/timezone",
2649
- body: {
2650
- timezoneId,
2651
- targetId: normalizeOptionalString(opts.targetId)
2652
- },
2653
- successMessage: `timezone: ${timezoneId}`
2654
- });
2655
- });
2656
- set.command("locale").description("Override locale (CDP)").argument("<locale>", "Locale (e.g. en-US)").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (locale, opts, cmd) => {
2657
- await runBrowserSetRequest({
2658
- parent: parentOpts(cmd),
2659
- path: "/set/locale",
2660
- body: {
2661
- locale,
2662
- targetId: normalizeOptionalString(opts.targetId)
2663
- },
2664
- successMessage: `locale: ${locale}`
2665
- });
2666
- });
2667
- set.command("device").description("Apply a Playwright device descriptor (e.g. \"iPhone 14\")").argument("<name>", "Device name (Playwright devices)").option("--target-id <id>", "CDP target id (or unique prefix)").action(async (name, opts, cmd) => {
2668
- await runBrowserSetRequest({
2669
- parent: parentOpts(cmd),
2670
- path: "/set/device",
2671
- body: {
2672
- name,
2673
- targetId: normalizeOptionalString(opts.targetId)
2674
- },
2675
- successMessage: `device: ${name}`
2676
- });
2677
- });
2678
- }
2679
- //#endregion
2680
- //#region extensions/browser/src/cli/browser-cli.ts
2681
- function registerBrowserCli(program) {
2682
- const browser = program.command("browser").description("Manage Genesis's dedicated browser (Chrome/Chromium)").option("--browser-profile <name>", "Browser profile name (default from config)").option("--json", "Output machine-readable JSON", false).addHelpText("after", () => `\n${theme.heading("Examples:")}\n${formatHelpExamples([...browserCoreExamples, ...browserActionExamples].map((cmd) => [cmd, ""]), true)}\n\n${theme.muted("Docs:")} ${formatDocsLink("/cli/browser", "genesis.pixelzx.com/docs/cli/browser")}\n`).action(() => {
2683
- browser.outputHelp();
2684
- defaultRuntime.error(danger(`Missing subcommand. Try: "${formatCliCommand("genesis browser status")}"`));
2685
- defaultRuntime.exit(1);
2686
- });
2687
- addGatewayClientOptions(browser);
2688
- const parentOpts = (cmd) => cmd.parent?.opts?.();
2689
- registerBrowserManageCommands(browser, parentOpts);
2690
- registerBrowserInspectCommands(browser, parentOpts);
2691
- registerBrowserActionInputCommands(browser, parentOpts);
2692
- registerBrowserActionObserveCommands(browser, parentOpts);
2693
- registerBrowserDebugCommands(browser, parentOpts);
2694
- registerBrowserStateCommands(browser, parentOpts);
2695
- }
2696
- //#endregion
2697
- //#region extensions/browser/src/gateway/browser-request.ts
2698
- function isBrowserNode(node) {
2699
- const caps = Array.isArray(node.caps) ? node.caps : [];
2700
- const commands = Array.isArray(node.commands) ? node.commands : [];
2701
- return caps.includes("browser") || commands.includes("browser.proxy");
2702
- }
2703
- function normalizeNodeKey(value) {
2704
- return normalizeLowercaseStringOrEmpty(value).replace(/[^a-z0-9]+/g, "");
2705
- }
2706
- function resolveBrowserNode(nodes, query) {
2707
- const q = normalizeOptionalString(query) ?? "";
2708
- if (!q) return null;
2709
- const qNorm = normalizeNodeKey(q);
2710
- const matches = nodes.filter((node) => {
2711
- if (node.nodeId === q) return true;
2712
- if (typeof node.remoteIp === "string" && node.remoteIp === q) return true;
2713
- const name = typeof node.displayName === "string" ? node.displayName : "";
2714
- if (name && normalizeNodeKey(name) === qNorm) return true;
2715
- if (q.length >= 6 && node.nodeId.startsWith(q)) return true;
2716
- return false;
2717
- });
2718
- if (matches.length === 1) return matches[0] ?? null;
2719
- if (matches.length === 0) return null;
2720
- throw new Error(`ambiguous node: ${q} (matches: ${matches.map((node) => node.displayName || node.remoteIp || node.nodeId).join(", ")})`);
2721
- }
2722
- function resolveBrowserNodeTarget(params) {
2723
- const policy = params.cfg.gateway?.nodes?.browser;
2724
- const mode = policy?.mode ?? "auto";
2725
- if (mode === "off") return null;
2726
- const browserNodes = params.nodes.filter((node) => isBrowserNode(node));
2727
- if (browserNodes.length === 0) {
2728
- if (normalizeOptionalString(policy?.node)) throw new Error("No connected browser-capable nodes.");
2729
- return null;
2730
- }
2731
- const requested = normalizeOptionalString(policy?.node) ?? "";
2732
- if (requested) {
2733
- const resolved = resolveBrowserNode(browserNodes, requested);
2734
- if (!resolved) throw new Error(`Configured browser node not connected: ${requested}`);
2735
- return resolved;
2736
- }
2737
- if (mode === "manual") return null;
2738
- if (browserNodes.length === 1) return browserNodes[0] ?? null;
2739
- return null;
2740
- }
2741
- async function persistProxyFiles(files) {
2742
- return await persistBrowserProxyFiles(files);
2743
- }
2744
- function applyProxyPaths(result, mapping) {
2745
- applyBrowserProxyPaths(result, mapping);
2746
- }
2747
- async function handleBrowserGatewayRequest({ params, respond, context }) {
2748
- const typed = params;
2749
- const methodRaw = (normalizeOptionalString(typed.method) ?? "").toUpperCase();
2750
- const path = normalizeOptionalString(typed.path) ?? "";
2751
- const query = typed.query && typeof typed.query === "object" ? typed.query : void 0;
2752
- const body = typed.body;
2753
- const timeoutMs = typeof typed.timeoutMs === "number" && Number.isFinite(typed.timeoutMs) ? Math.max(1, Math.floor(typed.timeoutMs)) : void 0;
2754
- if (!methodRaw || !path) {
2755
- respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "method and path are required"));
2756
- return;
2757
- }
2758
- if (methodRaw !== "GET" && methodRaw !== "POST" && methodRaw !== "DELETE") {
2759
- respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "method must be GET, POST, or DELETE"));
2760
- return;
2761
- }
2762
- if (isPersistentBrowserProfileMutation(methodRaw, path)) {
2763
- respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "browser.request cannot mutate persistent browser profiles"));
2764
- return;
2765
- }
2766
- const cfg = loadConfig();
2767
- let nodeTarget = null;
2768
- try {
2769
- nodeTarget = resolveBrowserNodeTarget({
2770
- cfg,
2771
- nodes: context.nodeRegistry.listConnected()
2772
- });
2773
- } catch (err) {
2774
- respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(err)));
2775
- return;
2776
- }
2777
- if (nodeTarget) {
2778
- const allowlist = resolveNodeCommandAllowlist(cfg, nodeTarget);
2779
- const allowed = isNodeCommandAllowed({
2780
- command: "browser.proxy",
2781
- declaredCommands: nodeTarget.commands,
2782
- allowlist
2783
- });
2784
- if (!allowed.ok) {
2785
- const platform = nodeTarget.platform ?? "unknown";
2786
- const hint = `node command not allowed: ${allowed.reason} (platform: ${platform}, command: browser.proxy)`;
2787
- respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, hint, { details: {
2788
- reason: allowed.reason,
2789
- command: "browser.proxy"
2790
- } }));
2791
- return;
2792
- }
2793
- const proxyParams = {
2794
- method: methodRaw,
2795
- path,
2796
- query,
2797
- body,
2798
- timeoutMs,
2799
- profile: resolveRequestedBrowserProfile({
2800
- query,
2801
- body
2802
- })
2803
- };
2804
- const res = await context.nodeRegistry.invoke({
2805
- nodeId: nodeTarget.nodeId,
2806
- command: "browser.proxy",
2807
- params: proxyParams,
2808
- timeoutMs,
2809
- idempotencyKey: crypto.randomUUID()
2810
- });
2811
- if (!respondUnavailableOnNodeInvokeError(respond, res)) return;
2812
- const payload = res.payloadJSON ? safeParseJson(res.payloadJSON) : res.payload;
2813
- const proxy = payload && typeof payload === "object" ? payload : null;
2814
- if (!proxy || !("result" in proxy)) {
2815
- respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, "browser proxy failed"));
2816
- return;
2817
- }
2818
- const mapping = await persistProxyFiles(proxy.files);
2819
- applyProxyPaths(proxy.result, mapping);
2820
- respond(true, proxy.result);
2821
- return;
2822
- }
2823
- if (!await startBrowserControlServiceFromConfig()) {
2824
- respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, "browser control is disabled"));
2825
- return;
2826
- }
2827
- let dispatcher;
2828
- try {
2829
- dispatcher = createBrowserRouteDispatcher(createBrowserControlContext());
2830
- } catch (err) {
2831
- respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(err)));
2832
- return;
2833
- }
2834
- let result;
2835
- try {
2836
- result = timeoutMs ? await withTimeout((signal) => dispatcher.dispatch({
2837
- method: methodRaw,
2838
- path,
2839
- query,
2840
- body,
2841
- signal
2842
- }), timeoutMs, "browser request") : await dispatcher.dispatch({
2843
- method: methodRaw,
2844
- path,
2845
- query,
2846
- body
2847
- });
2848
- } catch (err) {
2849
- respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(err)));
2850
- return;
2851
- }
2852
- if (result.status >= 400) {
2853
- const message = result.body && typeof result.body === "object" && "error" in result.body ? String(result.body.error) : `browser request failed (${result.status})`;
2854
- respond(false, void 0, errorShape(result.status >= 500 ? ErrorCodes.UNAVAILABLE : ErrorCodes.INVALID_REQUEST, message, { details: result.body }));
2855
- return;
2856
- }
2857
- respond(true, result.body);
2858
- }
2859
- const browserHandlers = { "browser.request": handleBrowserGatewayRequest };
2860
- //#endregion
2861
- //#region extensions/browser/src/plugin-service.ts
2862
- const UNSAFE_BROWSER_CONTROL_OVERRIDE_SPECIFIER = /^(?:data|http|https|node):/i;
2863
- function validateBrowserControlOverrideSpecifier(specifier) {
2864
- const trimmed = specifier.trim();
2865
- if (UNSAFE_BROWSER_CONTROL_OVERRIDE_SPECIFIER.test(trimmed)) throw new Error(`Refusing unsafe browser control override specifier: ${trimmed}`);
2866
- return trimmed;
2867
- }
2868
- function createBrowserPluginService() {
2869
- let handle = null;
2870
- return {
2871
- id: "browser-control",
2872
- start: async () => {
2873
- if (handle) return;
2874
- handle = await startLazyPluginServiceModule({
2875
- skipEnvVar: "GENESIS_SKIP_BROWSER_CONTROL_SERVER",
2876
- overrideEnvVar: "GENESIS_BROWSER_CONTROL_MODULE",
2877
- validateOverrideSpecifier: validateBrowserControlOverrideSpecifier,
2878
- loadDefaultModule: async () => await import("./server-D58E1Cua.js"),
2879
- startExportNames: ["startBrowserControlServiceFromConfig", "startBrowserControlServerFromConfig"],
2880
- stopExportNames: ["stopBrowserControlService", "stopBrowserControlServer"]
2881
- });
2882
- },
2883
- stop: async () => {
2884
- const current = handle;
2885
- handle = null;
2886
- if (!current) return;
2887
- await current.stop().catch(() => {});
2888
- }
2889
- };
2890
- }
2891
- //#endregion
2892
- export { createBrowserTool as a, registerBrowserCli as i, browserHandlers as n, handleBrowserGatewayRequest as r, createBrowserPluginService as t };