@leemat/atlas 2026.2.6-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2089) hide show
  1. package/CHANGELOG.md +1580 -0
  2. package/LICENSE +21 -0
  3. package/README.md +544 -0
  4. package/atlas.mjs +33 -0
  5. package/dist/accounts-B2CFjnU4.js +250 -0
  6. package/dist/accounts-CvZ72HMT.js +251 -0
  7. package/dist/acp-cli-B_NsEPUF.js +923 -0
  8. package/dist/acp-cli-Dm8_74Su.js +926 -0
  9. package/dist/agent-B1KyGOLc.js +704 -0
  10. package/dist/agent-CO7AGlj3.js +704 -0
  11. package/dist/agent-scope-BKOcVvmS.js +370 -0
  12. package/dist/agent-scope-CUMjEpma.js +612 -0
  13. package/dist/agent-scope-DbPV-klD.js +370 -0
  14. package/dist/archive-D0z3LZDK.js +85 -0
  15. package/dist/archive-Dy3Ezb-5.js +85 -0
  16. package/dist/atlas-root-DPjGhx7U.js +84 -0
  17. package/dist/atlas-root-F1I7aUzD.js +84 -0
  18. package/dist/audit-4IbU_Yq6.js +1853 -0
  19. package/dist/audit-B3-IhtiV.js +1853 -0
  20. package/dist/auth-B9k363u6.js +192 -0
  21. package/dist/auth-DZMv_djK.js +192 -0
  22. package/dist/auth-health-B5WXeaXo.js +149 -0
  23. package/dist/auth-health-CkS5AU7V.js +149 -0
  24. package/dist/auth-profiles-DVuTc3KD.js +2982 -0
  25. package/dist/boolean-BgXe2hyu.js +30 -0
  26. package/dist/brew-CAcErcKz.js +46 -0
  27. package/dist/brew-CcZV0dSS.js +46 -0
  28. package/dist/build-info.json +5 -0
  29. package/dist/call-B-YgfFca.js +278 -0
  30. package/dist/call-Ct_Pe8S_.js +278 -0
  31. package/dist/channel-options-DMkSEj2S.js +32 -0
  32. package/dist/channel-options-DNbHaxTc.js +62 -0
  33. package/dist/channel-selection-CiBb_0sf.js +51 -0
  34. package/dist/channel-selection-D6g27acA.js +51 -0
  35. package/dist/channel-summary-CVBxRY-m.js +1120 -0
  36. package/dist/channel-summary-Cii0qyXD.js +1120 -0
  37. package/dist/channels-cli-CcPXhyBw.js +1413 -0
  38. package/dist/channels-cli-D8W1-24C.js +1415 -0
  39. package/dist/channels-status-issues-B482aNiB.js +18 -0
  40. package/dist/channels-status-issues-DmUlNR2O.js +18 -0
  41. package/dist/chrome--o2SN4MI.js +1953 -0
  42. package/dist/chrome-DVA0NdqA.js +1973 -0
  43. package/dist/clack-prompter-DuBVnTKy.js +92 -0
  44. package/dist/clack-prompter-lan2z6rF.js +92 -0
  45. package/dist/cli/daemon-cli.js +2 -0
  46. package/dist/cli-2Nb0qAN-.js +89 -0
  47. package/dist/cli-D3dtxIjI.js +86 -0
  48. package/dist/cli-utils-BkRQdAoC.js +43 -0
  49. package/dist/cli-utils-ByANh4Sp.js +43 -0
  50. package/dist/client-B2vWxO-_.js +1629 -0
  51. package/dist/client-D74ONBvb.js +1629 -0
  52. package/dist/command-format-CBU5jCY8.js +52 -0
  53. package/dist/command-format-C_-Q-_o3.js +38 -0
  54. package/dist/command-format-DxY_r9MK.js +52 -0
  55. package/dist/command-options-DHtNt4I-.js +33 -0
  56. package/dist/commands-B7i6KXd8.js +233 -0
  57. package/dist/completion-cli-BfwMsZop.js +773 -0
  58. package/dist/completion-cli-BiGWNIxh.js +434 -0
  59. package/dist/config-BJMUdu-Q.js +5665 -0
  60. package/dist/config-BgzNMb8g.js +4924 -0
  61. package/dist/config-Cj3AMovm.js +4925 -0
  62. package/dist/config-guard-CATld9BC.js +5774 -0
  63. package/dist/configure-CfMz3i3p.js +896 -0
  64. package/dist/configure-DGI01ZDv.js +895 -0
  65. package/dist/constants-C2bzsGRk.js +65 -0
  66. package/dist/constants-Kx9rkT-e.js +65 -0
  67. package/dist/control-service-BguMnv1a.js +61 -0
  68. package/dist/control-service-DQdSjtFR.js +61 -0
  69. package/dist/control-ui/apple-touch-icon.png +0 -0
  70. package/dist/control-ui/assets/index-Bnuib5Ip.css +1 -0
  71. package/dist/control-ui/assets/index-CJDa-e45.js +7742 -0
  72. package/dist/control-ui/assets/index-CJDa-e45.js.map +1 -0
  73. package/dist/control-ui/favicon-32.png +0 -0
  74. package/dist/control-ui/favicon.ico +0 -0
  75. package/dist/control-ui/favicon.svg +10 -0
  76. package/dist/control-ui/index.html +17 -0
  77. package/dist/cron-cli-DxOHRJeP.js +457 -0
  78. package/dist/cron-cli-DyHq7PPn.js +454 -0
  79. package/dist/daemon-cli-DnG7hXBG.js +758 -0
  80. package/dist/daemon-cli-DtX6mLa3.js +757 -0
  81. package/dist/daemon-runtime-BBa_-tjq.js +517 -0
  82. package/dist/daemon-runtime-CFgWpGVG.js +517 -0
  83. package/dist/deliver-2RpZLJla.js +2557 -0
  84. package/dist/deliver-BqXGjEEH.js +2587 -0
  85. package/dist/deliver-CbpK_oAa.js +2587 -0
  86. package/dist/deps-BwQdWZ3T.js +27 -0
  87. package/dist/deps-xXApNuyT.js +27 -0
  88. package/dist/devices-cli-C9eUNH2s.js +207 -0
  89. package/dist/devices-cli-D1sHyAon.js +204 -0
  90. package/dist/directory-cli-CgzoxCDb.js +244 -0
  91. package/dist/directory-cli-ZaH0pGCD.js +247 -0
  92. package/dist/dispatcher-ah_Eqs3t.js +160 -0
  93. package/dist/dns-cli-DErlWHgR.js +198 -0
  94. package/dist/dns-cli-DGxOs29X.js +201 -0
  95. package/dist/docs-cli-CnFX3PTv.js +161 -0
  96. package/dist/docs-cli-DeharIH5.js +159 -0
  97. package/dist/doctor-DCce0xHW.js +2583 -0
  98. package/dist/doctor-DtfQuH6c.js +2581 -0
  99. package/dist/entry.js +1330 -0
  100. package/dist/env-zsgpOYKj.js +32 -0
  101. package/dist/errors--RNLFyOF.js +1952 -0
  102. package/dist/exec-B8JKbXKW.js +246 -0
  103. package/dist/exec-BxiGO6W4.js +1099 -0
  104. package/dist/exec-COj3548p.js +246 -0
  105. package/dist/exec-approvals-PnTNl5mV.js +1043 -0
  106. package/dist/exec-approvals-cli-9XZbw7c9.js +385 -0
  107. package/dist/exec-approvals-cli-DxN1xzt-.js +388 -0
  108. package/dist/exec-approvals-odA-6DHi.js +1043 -0
  109. package/dist/extensionAPI.js +69586 -0
  110. package/dist/format-B7OjpGnt.js +34 -0
  111. package/dist/format-CS7EI0xF.js +34 -0
  112. package/dist/gateway-cli-CBAh850v.js +17866 -0
  113. package/dist/gateway-cli-vdk_agft.js +17865 -0
  114. package/dist/gateway-rpc-DndVngdH.js +28 -0
  115. package/dist/gateway-rpc-gHTR5Cbc.js +28 -0
  116. package/dist/github-copilot-auth-Bk0_Aas5.js +1256 -0
  117. package/dist/github-copilot-auth-dtaSQ01h.js +1256 -0
  118. package/dist/github-copilot-token-BxyQgqz1.js +103 -0
  119. package/dist/github-copilot-token-C2AL0eDG.js +103 -0
  120. package/dist/github-copilot-token-SLWintYd.js +103 -0
  121. package/dist/gmail-setup-utils-Abq1qvuX.js +428 -0
  122. package/dist/gmail-setup-utils-CuUkI2Ka.js +428 -0
  123. package/dist/health-format-CKki6loN.js +1383 -0
  124. package/dist/health-format-DH676psg.js +1382 -0
  125. package/dist/help-format-CfZ94KRN.js +17 -0
  126. package/dist/help-format-Dds-jhO5.js +17 -0
  127. package/dist/helpers-5yebzF4C.js +25 -0
  128. package/dist/helpers-CSZtxHTa.js +10 -0
  129. package/dist/helpers-CeoEYUfW.js +10 -0
  130. package/dist/helpers-EKm3X92T.js +25 -0
  131. package/dist/hooks/bundled/audit-logger/HOOK.md +85 -0
  132. package/dist/hooks/bundled/boot-md/HOOK.md +19 -0
  133. package/dist/hooks/bundled/command-logger/HOOK.md +122 -0
  134. package/dist/hooks/bundled/hitl-approval/HOOK.md +42 -0
  135. package/dist/hooks/bundled/nightly-tasks/HOOK.md +114 -0
  136. package/dist/hooks/bundled/session-memory/HOOK.md +113 -0
  137. package/dist/hooks/bundled/soul-evil/HOOK.md +71 -0
  138. package/dist/hooks-cli-D8-spWPB.js +1058 -0
  139. package/dist/hooks-cli-_j8DNyo5.js +1061 -0
  140. package/dist/hooks-status-CajbXcRo.js +443 -0
  141. package/dist/hooks-status-f-U4xgPN.js +443 -0
  142. package/dist/image-4yiJAo6y.js +629 -0
  143. package/dist/image-BUFB_k8W.js +629 -0
  144. package/dist/image-CtVDEUHM.js +1421 -0
  145. package/dist/index.js +5957 -0
  146. package/dist/installs-BsauMWpx.js +425 -0
  147. package/dist/installs-iZIPKzVi.js +425 -0
  148. package/dist/is-main-B6kCyqsv.js +25 -0
  149. package/dist/is-main-qJ675wPV.js +25 -0
  150. package/dist/links-BfoNPOuN.js +15 -0
  151. package/dist/links-DlwSizsh.js +15 -0
  152. package/dist/loader-DdUyx3c8.js +66254 -0
  153. package/dist/logging-BCrQ_N_j.js +15 -0
  154. package/dist/logging-BWRYHvLp.js +1 -0
  155. package/dist/logging-CfEk_PnX.js +1 -0
  156. package/dist/logging-CoF0Bv_T.js +15 -0
  157. package/dist/login-qr-CQdQH62t.js +478 -0
  158. package/dist/login-qr-CvKDGUF4.js +478 -0
  159. package/dist/login-qr-Dl9dL1Jz.js +475 -0
  160. package/dist/logs-cli-BhrRuyRb.js +227 -0
  161. package/dist/logs-cli-DH4iwFU8.js +230 -0
  162. package/dist/manager-B27YqwcM.js +3218 -0
  163. package/dist/manager-BmM47v6p.js +3216 -0
  164. package/dist/manager-gS0CHyDA.js +3216 -0
  165. package/dist/manifest-registry-CxTVtFfj.js +668 -0
  166. package/dist/manifest-registry-DKY_KYIv.js +668 -0
  167. package/dist/message-channel-D1csMRHE.js +110 -0
  168. package/dist/message-channel-W5qX04Mh.js +110 -0
  169. package/dist/model-selection-Cgf5GXnY.js +2735 -0
  170. package/dist/model-selection-RJ94H_Fa.js +2984 -0
  171. package/dist/models-cli-Bh4XtEkb.js +2542 -0
  172. package/dist/models-cli-DQYDyH9_.js +2545 -0
  173. package/dist/net-C8YRVt16.js +137 -0
  174. package/dist/net-CWMMy37F.js +137 -0
  175. package/dist/node-cli-DiH4CzR7.js +1456 -0
  176. package/dist/node-cli-bOO40ezZ.js +1459 -0
  177. package/dist/node-service-BVHVpuzk.js +67 -0
  178. package/dist/node-service-CaoJUlNT.js +67 -0
  179. package/dist/nodes-cli-BLLUSaWc.js +1210 -0
  180. package/dist/nodes-cli-CH_5YF_E.js +1207 -0
  181. package/dist/nodes-screen-B9A3nMu0.js +157 -0
  182. package/dist/nodes-screen-aL7-_Dam.js +157 -0
  183. package/dist/note-Ci08TSbV.js +73 -0
  184. package/dist/note-tn_4OWcK.js +73 -0
  185. package/dist/onboard-channels-BEEU2UNU.js +671 -0
  186. package/dist/onboard-channels-ynCeHHwi.js +671 -0
  187. package/dist/onboard-skills-BLeO8BvO.js +3485 -0
  188. package/dist/onboard-skills-CFdpqxR-.js +3485 -0
  189. package/dist/onboarding-akYka8kO.js +3269 -0
  190. package/dist/pairing-cli-BYSP__d_.js +114 -0
  191. package/dist/pairing-cli-Dd11XK72.js +117 -0
  192. package/dist/pairing-labels-CaExZlyX.js +9 -0
  193. package/dist/pairing-labels-DpgaWX0-.js +9 -0
  194. package/dist/pairing-store-DeCzJbHE.js +391 -0
  195. package/dist/pairing-store-Dz8WHpyx.js +391 -0
  196. package/dist/parse-BZz5lHzQ.js +23 -0
  197. package/dist/parse-gTOGQPH6.js +23 -0
  198. package/dist/parse-log-line-C6szvNBZ.js +44 -0
  199. package/dist/parse-log-line-CARp5QyJ.js +44 -0
  200. package/dist/parse-timeout-CbVKLZ4B.js +16 -0
  201. package/dist/parse-timeout-Du-wHHNi.js +16 -0
  202. package/dist/path-env-CBt42KJm.js +77 -0
  203. package/dist/path-env-DBBZ3NDs.js +77 -0
  204. package/dist/paths-BhxDUiio.js +43 -0
  205. package/dist/paths-C2XPptKL.js +180 -0
  206. package/dist/paths-DHpqOQPB.js +43 -0
  207. package/dist/paths-DUxER0e-.js +40 -0
  208. package/dist/paths-Dnm60cBZ.js +164 -0
  209. package/dist/pi-embedded-helpers-BkBhYNNX.js +8957 -0
  210. package/dist/pi-embedded-helpers-DUeZHoPx.js +1298 -0
  211. package/dist/pi-embedded-helpers-DlQnQJyX.js +1298 -0
  212. package/dist/pi-model-discovery-BzaLYg2f.js +20 -0
  213. package/dist/pi-model-discovery-loGhFDjp.js +20 -0
  214. package/dist/pi-model-discovery-tRscuQ7_.js +20 -0
  215. package/dist/pi-tools.policy-D_N14UDS.js +233 -0
  216. package/dist/plugin-auto-enable-BZHGEtVT.js +460 -0
  217. package/dist/plugin-auto-enable-V8wa0pT5.js +460 -0
  218. package/dist/plugin-sdk/agents/agent-paths.d.ts +2 -0
  219. package/dist/plugin-sdk/agents/agent-scope.d.ts +37 -0
  220. package/dist/plugin-sdk/agents/anthropic-payload-log.d.ts +16 -0
  221. package/dist/plugin-sdk/agents/apply-patch-update.d.ts +8 -0
  222. package/dist/plugin-sdk/agents/apply-patch.d.ts +24 -0
  223. package/dist/plugin-sdk/agents/atlas-tools.d.ts +44 -0
  224. package/dist/plugin-sdk/agents/audit-log.d.ts +48 -0
  225. package/dist/plugin-sdk/agents/auth-profiles/constants.d.ts +20 -0
  226. package/dist/plugin-sdk/agents/auth-profiles/display.d.ts +7 -0
  227. package/dist/plugin-sdk/agents/auth-profiles/doctor.d.ts +8 -0
  228. package/dist/plugin-sdk/agents/auth-profiles/external-cli-sync.d.ts +7 -0
  229. package/dist/plugin-sdk/agents/auth-profiles/oauth.d.ts +12 -0
  230. package/dist/plugin-sdk/agents/auth-profiles/order.d.ts +8 -0
  231. package/dist/plugin-sdk/agents/auth-profiles/paths.d.ts +4 -0
  232. package/dist/plugin-sdk/agents/auth-profiles/profiles.d.ts +18 -0
  233. package/dist/plugin-sdk/agents/auth-profiles/repair.d.ts +14 -0
  234. package/dist/plugin-sdk/agents/auth-profiles/session-override.d.ts +18 -0
  235. package/dist/plugin-sdk/agents/auth-profiles/store.d.ts +10 -0
  236. package/dist/plugin-sdk/agents/auth-profiles/types.d.ts +60 -0
  237. package/dist/plugin-sdk/agents/auth-profiles/usage.d.ts +47 -0
  238. package/dist/plugin-sdk/agents/auth-profiles.d.ts +11 -0
  239. package/dist/plugin-sdk/agents/bash-process-registry.d.ts +68 -0
  240. package/dist/plugin-sdk/agents/bash-tools.d.ts +4 -0
  241. package/dist/plugin-sdk/agents/bash-tools.exec.d.ts +54 -0
  242. package/dist/plugin-sdk/agents/bash-tools.process.d.ts +7 -0
  243. package/dist/plugin-sdk/agents/bash-tools.shared.d.ts +46 -0
  244. package/dist/plugin-sdk/agents/bedrock-discovery.d.ts +9 -0
  245. package/dist/plugin-sdk/agents/bootstrap-files.d.ts +25 -0
  246. package/dist/plugin-sdk/agents/bootstrap-hooks.d.ts +10 -0
  247. package/dist/plugin-sdk/agents/cache-trace.d.ts +51 -0
  248. package/dist/plugin-sdk/agents/channel-tools.d.ts +27 -0
  249. package/dist/plugin-sdk/agents/chutes-oauth.d.ts +46 -0
  250. package/dist/plugin-sdk/agents/cli-backends.d.ts +8 -0
  251. package/dist/plugin-sdk/agents/cli-credentials.d.ts +82 -0
  252. package/dist/plugin-sdk/agents/cli-runner/helpers.d.ts +76 -0
  253. package/dist/plugin-sdk/agents/cli-runner.d.ts +41 -0
  254. package/dist/plugin-sdk/agents/cli-session.d.ts +3 -0
  255. package/dist/plugin-sdk/agents/cloudflare-ai-gateway.d.ts +22 -0
  256. package/dist/plugin-sdk/agents/context-window-guard.d.ts +24 -0
  257. package/dist/plugin-sdk/agents/context.d.ts +1 -0
  258. package/dist/plugin-sdk/agents/date-time.d.ts +13 -0
  259. package/dist/plugin-sdk/agents/defaults.d.ts +3 -0
  260. package/dist/plugin-sdk/agents/docs-path.d.ts +6 -0
  261. package/dist/plugin-sdk/agents/failover-error.d.ts +33 -0
  262. package/dist/plugin-sdk/agents/identity.d.ts +25 -0
  263. package/dist/plugin-sdk/agents/lanes.d.ts +3 -0
  264. package/dist/plugin-sdk/agents/memory-search.d.ts +66 -0
  265. package/dist/plugin-sdk/agents/minimax-vlm.d.ts +7 -0
  266. package/dist/plugin-sdk/agents/model-auth.d.ts +36 -0
  267. package/dist/plugin-sdk/agents/model-catalog.d.ts +25 -0
  268. package/dist/plugin-sdk/agents/model-compat.d.ts +2 -0
  269. package/dist/plugin-sdk/agents/model-fallback.d.ts +49 -0
  270. package/dist/plugin-sdk/agents/model-selection.d.ts +93 -0
  271. package/dist/plugin-sdk/agents/models-config.d.ts +5 -0
  272. package/dist/plugin-sdk/agents/models-config.providers.d.ts +26 -0
  273. package/dist/plugin-sdk/agents/pi-embedded-block-chunker.d.ts +19 -0
  274. package/dist/plugin-sdk/agents/pi-embedded-helpers/bootstrap.d.ts +28 -0
  275. package/dist/plugin-sdk/agents/pi-embedded-helpers/errors.d.ts +47 -0
  276. package/dist/plugin-sdk/agents/pi-embedded-helpers/google.d.ts +8 -0
  277. package/dist/plugin-sdk/agents/pi-embedded-helpers/images.d.ts +20 -0
  278. package/dist/plugin-sdk/agents/pi-embedded-helpers/messaging-dedupe.d.ts +10 -0
  279. package/dist/plugin-sdk/agents/pi-embedded-helpers/openai.d.ts +9 -0
  280. package/dist/plugin-sdk/agents/pi-embedded-helpers/thinking.d.ts +5 -0
  281. package/dist/plugin-sdk/agents/pi-embedded-helpers/turns.d.ts +20 -0
  282. package/dist/plugin-sdk/agents/pi-embedded-helpers/types.d.ts +5 -0
  283. package/dist/plugin-sdk/agents/pi-embedded-helpers.d.ts +11 -0
  284. package/dist/plugin-sdk/agents/pi-embedded-messaging.d.ts +8 -0
  285. package/dist/plugin-sdk/agents/pi-embedded-runner/abort.d.ts +1 -0
  286. package/dist/plugin-sdk/agents/pi-embedded-runner/cache-ttl.d.ts +9 -0
  287. package/dist/plugin-sdk/agents/pi-embedded-runner/compact.d.ts +50 -0
  288. package/dist/plugin-sdk/agents/pi-embedded-runner/extensions.d.ts +12 -0
  289. package/dist/plugin-sdk/agents/pi-embedded-runner/extra-params.d.ts +22 -0
  290. package/dist/plugin-sdk/agents/pi-embedded-runner/google.d.ts +39 -0
  291. package/dist/plugin-sdk/agents/pi-embedded-runner/history.d.ts +12 -0
  292. package/dist/plugin-sdk/agents/pi-embedded-runner/lanes.d.ts +3 -0
  293. package/dist/plugin-sdk/agents/pi-embedded-runner/logger.d.ts +1 -0
  294. package/dist/plugin-sdk/agents/pi-embedded-runner/model.d.ts +22 -0
  295. package/dist/plugin-sdk/agents/pi-embedded-runner/run/attempt.d.ts +5 -0
  296. package/dist/plugin-sdk/agents/pi-embedded-runner/run/images.d.ts +83 -0
  297. package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +116 -0
  298. package/dist/plugin-sdk/agents/pi-embedded-runner/run/payloads.d.ts +34 -0
  299. package/dist/plugin-sdk/agents/pi-embedded-runner/run/types.d.ts +133 -0
  300. package/dist/plugin-sdk/agents/pi-embedded-runner/run.d.ts +3 -0
  301. package/dist/plugin-sdk/agents/pi-embedded-runner/runs.d.ts +14 -0
  302. package/dist/plugin-sdk/agents/pi-embedded-runner/sandbox-info.d.ts +4 -0
  303. package/dist/plugin-sdk/agents/pi-embedded-runner/session-manager-cache.d.ts +2 -0
  304. package/dist/plugin-sdk/agents/pi-embedded-runner/session-manager-init.d.ts +17 -0
  305. package/dist/plugin-sdk/agents/pi-embedded-runner/system-prompt.d.ts +51 -0
  306. package/dist/plugin-sdk/agents/pi-embedded-runner/tool-split.d.ts +17 -0
  307. package/dist/plugin-sdk/agents/pi-embedded-runner/types.d.ts +70 -0
  308. package/dist/plugin-sdk/agents/pi-embedded-runner/utils.d.ts +8 -0
  309. package/dist/plugin-sdk/agents/pi-embedded-runner.d.ts +12 -0
  310. package/dist/plugin-sdk/agents/pi-embedded-subscribe.d.ts +20 -0
  311. package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.d.ts +2 -0
  312. package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.lifecycle.d.ts +8 -0
  313. package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.messages.d.ts +12 -0
  314. package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.tools.d.ts +18 -0
  315. package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.types.d.ts +108 -0
  316. package/dist/plugin-sdk/agents/pi-embedded-subscribe.raw-stream.d.ts +1 -0
  317. package/dist/plugin-sdk/agents/pi-embedded-subscribe.tools.d.ts +6 -0
  318. package/dist/plugin-sdk/agents/pi-embedded-subscribe.types.d.ts +44 -0
  319. package/dist/plugin-sdk/agents/pi-embedded-utils.d.ts +38 -0
  320. package/dist/plugin-sdk/agents/pi-embedded.d.ts +2 -0
  321. package/dist/plugin-sdk/agents/pi-extensions/compaction-safeguard-runtime.d.ts +6 -0
  322. package/dist/plugin-sdk/agents/pi-extensions/context-pruning/runtime.d.ts +9 -0
  323. package/dist/plugin-sdk/agents/pi-extensions/context-pruning/settings.d.ts +44 -0
  324. package/dist/plugin-sdk/agents/pi-extensions/context-pruning/tools.d.ts +2 -0
  325. package/dist/plugin-sdk/agents/pi-model-discovery.d.ts +4 -0
  326. package/dist/plugin-sdk/agents/pi-settings.d.ts +19 -0
  327. package/dist/plugin-sdk/agents/pi-tool-definition-adapter.d.ts +21 -0
  328. package/dist/plugin-sdk/agents/pi-tools.abort.d.ts +2 -0
  329. package/dist/plugin-sdk/agents/pi-tools.before-tool-call.d.ts +25 -0
  330. package/dist/plugin-sdk/agents/pi-tools.d.ts +69 -0
  331. package/dist/plugin-sdk/agents/pi-tools.policy.d.ts +38 -0
  332. package/dist/plugin-sdk/agents/pi-tools.read.d.ts +35 -0
  333. package/dist/plugin-sdk/agents/pi-tools.schema.d.ts +3 -0
  334. package/dist/plugin-sdk/agents/pi-tools.types.d.ts +2 -0
  335. package/dist/plugin-sdk/agents/pty-dsr.d.ts +5 -0
  336. package/dist/plugin-sdk/agents/pty-keys.d.ts +13 -0
  337. package/dist/plugin-sdk/agents/sandbox/browser-bridges.d.ts +5 -0
  338. package/dist/plugin-sdk/agents/sandbox/browser.d.ts +8 -0
  339. package/dist/plugin-sdk/agents/sandbox/config-hash.d.ts +9 -0
  340. package/dist/plugin-sdk/agents/sandbox/config.d.ts +22 -0
  341. package/dist/plugin-sdk/agents/sandbox/constants.d.ts +19 -0
  342. package/dist/plugin-sdk/agents/sandbox/context.d.ts +12 -0
  343. package/dist/plugin-sdk/agents/sandbox/docker.d.ts +28 -0
  344. package/dist/plugin-sdk/agents/sandbox/manage.d.ts +13 -0
  345. package/dist/plugin-sdk/agents/sandbox/prune.d.ts +3 -0
  346. package/dist/plugin-sdk/agents/sandbox/registry.d.ts +30 -0
  347. package/dist/plugin-sdk/agents/sandbox/runtime-status.d.ts +18 -0
  348. package/dist/plugin-sdk/agents/sandbox/shared.d.ts +4 -0
  349. package/dist/plugin-sdk/agents/sandbox/tool-policy.d.ts +4 -0
  350. package/dist/plugin-sdk/agents/sandbox/types.d.ts +73 -0
  351. package/dist/plugin-sdk/agents/sandbox/types.docker.d.ts +25 -0
  352. package/dist/plugin-sdk/agents/sandbox/workspace.d.ts +1 -0
  353. package/dist/plugin-sdk/agents/sandbox-paths.d.ts +21 -0
  354. package/dist/plugin-sdk/agents/sandbox.d.ts +8 -0
  355. package/dist/plugin-sdk/agents/schema/clean-for-gemini.d.ts +2 -0
  356. package/dist/plugin-sdk/agents/schema/typebox.d.ts +14 -0
  357. package/dist/plugin-sdk/agents/session-file-repair.d.ts +11 -0
  358. package/dist/plugin-sdk/agents/session-slug.d.ts +1 -0
  359. package/dist/plugin-sdk/agents/session-tool-result-guard-wrapper.d.ts +14 -0
  360. package/dist/plugin-sdk/agents/session-tool-result-guard.d.ts +21 -0
  361. package/dist/plugin-sdk/agents/session-transcript-repair.d.ts +26 -0
  362. package/dist/plugin-sdk/agents/session-write-lock.d.ts +21 -0
  363. package/dist/plugin-sdk/agents/shell-utils.d.ts +6 -0
  364. package/dist/plugin-sdk/agents/skills/bundled-dir.d.ts +7 -0
  365. package/dist/plugin-sdk/agents/skills/config.d.ts +14 -0
  366. package/dist/plugin-sdk/agents/skills/conflict-detector.d.ts +5 -0
  367. package/dist/plugin-sdk/agents/skills/dependency-manager.d.ts +47 -0
  368. package/dist/plugin-sdk/agents/skills/env-overrides.d.ts +10 -0
  369. package/dist/plugin-sdk/agents/skills/frontmatter.d.ts +6 -0
  370. package/dist/plugin-sdk/agents/skills/plugin-skills.d.ts +5 -0
  371. package/dist/plugin-sdk/agents/skills/refresh.d.ts +19 -0
  372. package/dist/plugin-sdk/agents/skills/serialize.d.ts +1 -0
  373. package/dist/plugin-sdk/agents/skills/types.d.ts +135 -0
  374. package/dist/plugin-sdk/agents/skills/workspace.d.ts +49 -0
  375. package/dist/plugin-sdk/agents/skills.d.ts +11 -0
  376. package/dist/plugin-sdk/agents/subagent-announce-queue.d.ts +22 -0
  377. package/dist/plugin-sdk/agents/subagent-announce.d.ts +28 -0
  378. package/dist/plugin-sdk/agents/subagent-registry.d.ts +35 -0
  379. package/dist/plugin-sdk/agents/subagent-registry.store.d.ts +5 -0
  380. package/dist/plugin-sdk/agents/synthetic-models.d.ts +153 -0
  381. package/dist/plugin-sdk/agents/system-prompt-params.d.ts +29 -0
  382. package/dist/plugin-sdk/agents/system-prompt-report.d.ts +20 -0
  383. package/dist/plugin-sdk/agents/system-prompt.d.ts +75 -0
  384. package/dist/plugin-sdk/agents/task-planner/engine.d.ts +24 -0
  385. package/dist/plugin-sdk/agents/task-planner/store.d.ts +6 -0
  386. package/dist/plugin-sdk/agents/task-planner/types.d.ts +38 -0
  387. package/dist/plugin-sdk/agents/timeout.d.ts +8 -0
  388. package/dist/plugin-sdk/agents/tool-call-id.d.ts +17 -0
  389. package/dist/plugin-sdk/agents/tool-display.d.ts +15 -0
  390. package/dist/plugin-sdk/agents/tool-images.d.ts +19 -0
  391. package/dist/plugin-sdk/agents/tool-policy.d.ts +39 -0
  392. package/dist/plugin-sdk/agents/tool-summaries.d.ts +2 -0
  393. package/dist/plugin-sdk/agents/tools/agent-step.d.ts +12 -0
  394. package/dist/plugin-sdk/agents/tools/agents-list-tool.d.ts +6 -0
  395. package/dist/plugin-sdk/agents/tools/browser-tool.d.ts +5 -0
  396. package/dist/plugin-sdk/agents/tools/browser-tool.schema.d.ts +50 -0
  397. package/dist/plugin-sdk/agents/tools/canvas-tool.d.ts +2 -0
  398. package/dist/plugin-sdk/agents/tools/common.d.ts +52 -0
  399. package/dist/plugin-sdk/agents/tools/cron-tool.d.ts +6 -0
  400. package/dist/plugin-sdk/agents/tools/discord-actions-guild.d.ts +4 -0
  401. package/dist/plugin-sdk/agents/tools/discord-actions-messaging.d.ts +4 -0
  402. package/dist/plugin-sdk/agents/tools/discord-actions-moderation.d.ts +4 -0
  403. package/dist/plugin-sdk/agents/tools/discord-actions-presence.d.ts +4 -0
  404. package/dist/plugin-sdk/agents/tools/discord-actions.d.ts +3 -0
  405. package/dist/plugin-sdk/agents/tools/document-tool.d.ts +4 -0
  406. package/dist/plugin-sdk/agents/tools/file-edit-tool.d.ts +4 -0
  407. package/dist/plugin-sdk/agents/tools/gateway-tool.d.ts +6 -0
  408. package/dist/plugin-sdk/agents/tools/gateway.d.ts +14 -0
  409. package/dist/plugin-sdk/agents/tools/image-tool.d.ts +26 -0
  410. package/dist/plugin-sdk/agents/tools/image-tool.helpers.d.ts +21 -0
  411. package/dist/plugin-sdk/agents/tools/memory-tool.d.ts +10 -0
  412. package/dist/plugin-sdk/agents/tools/message-tool.d.ts +18 -0
  413. package/dist/plugin-sdk/agents/tools/nodes-tool.d.ts +6 -0
  414. package/dist/plugin-sdk/agents/tools/nodes-utils.d.ts +20 -0
  415. package/dist/plugin-sdk/agents/tools/session-status-tool.d.ts +6 -0
  416. package/dist/plugin-sdk/agents/tools/sessions-announce-target.d.ts +5 -0
  417. package/dist/plugin-sdk/agents/tools/sessions-helpers.d.ts +90 -0
  418. package/dist/plugin-sdk/agents/tools/sessions-history-tool.d.ts +5 -0
  419. package/dist/plugin-sdk/agents/tools/sessions-list-tool.d.ts +5 -0
  420. package/dist/plugin-sdk/agents/tools/sessions-send-helpers.d.ts +34 -0
  421. package/dist/plugin-sdk/agents/tools/sessions-send-tool.a2a.d.ts +12 -0
  422. package/dist/plugin-sdk/agents/tools/sessions-send-tool.d.ts +7 -0
  423. package/dist/plugin-sdk/agents/tools/sessions-spawn-tool.d.ts +15 -0
  424. package/dist/plugin-sdk/agents/tools/slack-actions.d.ts +15 -0
  425. package/dist/plugin-sdk/agents/tools/task-planner-tool.d.ts +5 -0
  426. package/dist/plugin-sdk/agents/tools/telegram-actions.d.ts +9 -0
  427. package/dist/plugin-sdk/agents/tools/tts-tool.d.ts +7 -0
  428. package/dist/plugin-sdk/agents/tools/web-fetch-utils.d.ts +18 -0
  429. package/dist/plugin-sdk/agents/tools/web-fetch.d.ts +25 -0
  430. package/dist/plugin-sdk/agents/tools/web-search.d.ts +22 -0
  431. package/dist/plugin-sdk/agents/tools/web-shared.d.ts +17 -0
  432. package/dist/plugin-sdk/agents/tools/web-tools.d.ts +2 -0
  433. package/dist/plugin-sdk/agents/tools/whatsapp-actions.d.ts +3 -0
  434. package/dist/plugin-sdk/agents/transcript-policy.d.ts +23 -0
  435. package/dist/plugin-sdk/agents/usage.d.ts +35 -0
  436. package/dist/plugin-sdk/agents/venice-models.d.ts +238 -0
  437. package/dist/plugin-sdk/agents/workspace-run.d.ts +18 -0
  438. package/dist/plugin-sdk/agents/workspace-templates.d.ts +6 -0
  439. package/dist/plugin-sdk/agents/workspace.d.ts +33 -0
  440. package/dist/plugin-sdk/auto-reply/chunk.d.ts +45 -0
  441. package/dist/plugin-sdk/auto-reply/command-auth.d.ts +17 -0
  442. package/dist/plugin-sdk/auto-reply/command-detection.d.ts +13 -0
  443. package/dist/plugin-sdk/auto-reply/commands-args.d.ts +3 -0
  444. package/dist/plugin-sdk/auto-reply/commands-registry.d.ts +54 -0
  445. package/dist/plugin-sdk/auto-reply/commands-registry.data.d.ts +3 -0
  446. package/dist/plugin-sdk/auto-reply/commands-registry.types.d.ts +66 -0
  447. package/dist/plugin-sdk/auto-reply/dispatch.d.ts +27 -0
  448. package/dist/plugin-sdk/auto-reply/envelope.d.ts +59 -0
  449. package/dist/plugin-sdk/auto-reply/group-activation.d.ts +6 -0
  450. package/dist/plugin-sdk/auto-reply/heartbeat.d.ts +26 -0
  451. package/dist/plugin-sdk/auto-reply/inbound-debounce.d.ts +16 -0
  452. package/dist/plugin-sdk/auto-reply/media-note.d.ts +2 -0
  453. package/dist/plugin-sdk/auto-reply/model.d.ts +8 -0
  454. package/dist/plugin-sdk/auto-reply/reply/abort.d.ts +20 -0
  455. package/dist/plugin-sdk/auto-reply/reply/agent-runner-execution.d.ts +49 -0
  456. package/dist/plugin-sdk/auto-reply/reply/agent-runner-helpers.d.ts +17 -0
  457. package/dist/plugin-sdk/auto-reply/reply/agent-runner-memory.d.ts +20 -0
  458. package/dist/plugin-sdk/auto-reply/reply/agent-runner-payloads.d.ts +25 -0
  459. package/dist/plugin-sdk/auto-reply/reply/agent-runner-utils.d.ts +30 -0
  460. package/dist/plugin-sdk/auto-reply/reply/agent-runner.d.ts +38 -0
  461. package/dist/plugin-sdk/auto-reply/reply/bash-command.d.ts +19 -0
  462. package/dist/plugin-sdk/auto-reply/reply/block-reply-coalescer.d.ts +15 -0
  463. package/dist/plugin-sdk/auto-reply/reply/block-reply-pipeline.d.ts +31 -0
  464. package/dist/plugin-sdk/auto-reply/reply/block-streaming.d.ts +22 -0
  465. package/dist/plugin-sdk/auto-reply/reply/body.d.ts +11 -0
  466. package/dist/plugin-sdk/auto-reply/reply/commands-allowlist.d.ts +2 -0
  467. package/dist/plugin-sdk/auto-reply/reply/commands-approve.d.ts +2 -0
  468. package/dist/plugin-sdk/auto-reply/reply/commands-bash.d.ts +2 -0
  469. package/dist/plugin-sdk/auto-reply/reply/commands-compact.d.ts +2 -0
  470. package/dist/plugin-sdk/auto-reply/reply/commands-config.d.ts +3 -0
  471. package/dist/plugin-sdk/auto-reply/reply/commands-context-report.d.ts +3 -0
  472. package/dist/plugin-sdk/auto-reply/reply/commands-context.d.ts +12 -0
  473. package/dist/plugin-sdk/auto-reply/reply/commands-core.d.ts +2 -0
  474. package/dist/plugin-sdk/auto-reply/reply/commands-info.d.ts +10 -0
  475. package/dist/plugin-sdk/auto-reply/reply/commands-models.d.ts +23 -0
  476. package/dist/plugin-sdk/auto-reply/reply/commands-plugin.d.ts +13 -0
  477. package/dist/plugin-sdk/auto-reply/reply/commands-session.d.ts +7 -0
  478. package/dist/plugin-sdk/auto-reply/reply/commands-status.d.ts +24 -0
  479. package/dist/plugin-sdk/auto-reply/reply/commands-subagents.d.ts +13 -0
  480. package/dist/plugin-sdk/auto-reply/reply/commands-tts.d.ts +2 -0
  481. package/dist/plugin-sdk/auto-reply/reply/commands-types.d.ts +60 -0
  482. package/dist/plugin-sdk/auto-reply/reply/commands.d.ts +4 -0
  483. package/dist/plugin-sdk/auto-reply/reply/config-commands.d.ts +15 -0
  484. package/dist/plugin-sdk/auto-reply/reply/config-value.d.ts +4 -0
  485. package/dist/plugin-sdk/auto-reply/reply/debug-commands.d.ts +16 -0
  486. package/dist/plugin-sdk/auto-reply/reply/directive-handling.auth.d.ts +19 -0
  487. package/dist/plugin-sdk/auto-reply/reply/directive-handling.d.ts +6 -0
  488. package/dist/plugin-sdk/auto-reply/reply/directive-handling.fast-lane.d.ts +47 -0
  489. package/dist/plugin-sdk/auto-reply/reply/directive-handling.impl.d.ts +36 -0
  490. package/dist/plugin-sdk/auto-reply/reply/directive-handling.model-picker.d.ts +13 -0
  491. package/dist/plugin-sdk/auto-reply/reply/directive-handling.model.d.ts +42 -0
  492. package/dist/plugin-sdk/auto-reply/reply/directive-handling.parse.d.ts +62 -0
  493. package/dist/plugin-sdk/auto-reply/reply/directive-handling.persist.d.ts +37 -0
  494. package/dist/plugin-sdk/auto-reply/reply/directive-handling.queue-validation.d.ts +10 -0
  495. package/dist/plugin-sdk/auto-reply/reply/directive-handling.shared.d.ts +16 -0
  496. package/dist/plugin-sdk/auto-reply/reply/directives.d.ts +38 -0
  497. package/dist/plugin-sdk/auto-reply/reply/dispatch-from-config.d.ts +16 -0
  498. package/dist/plugin-sdk/auto-reply/reply/exec/directive.d.ts +20 -0
  499. package/dist/plugin-sdk/auto-reply/reply/exec.d.ts +1 -0
  500. package/dist/plugin-sdk/auto-reply/reply/followup-runner.d.ts +16 -0
  501. package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-apply.d.ts +64 -0
  502. package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-utils.d.ts +2 -0
  503. package/dist/plugin-sdk/auto-reply/reply/get-reply-directives.d.ts +91 -0
  504. package/dist/plugin-sdk/auto-reply/reply/get-reply-inline-actions.d.ts +59 -0
  505. package/dist/plugin-sdk/auto-reply/reply/get-reply-run.d.ts +69 -0
  506. package/dist/plugin-sdk/auto-reply/reply/get-reply.d.ts +4 -0
  507. package/dist/plugin-sdk/auto-reply/reply/groups.d.ts +16 -0
  508. package/dist/plugin-sdk/auto-reply/reply/history.d.ts +72 -0
  509. package/dist/plugin-sdk/auto-reply/reply/inbound-context.d.ts +8 -0
  510. package/dist/plugin-sdk/auto-reply/reply/inbound-dedupe.d.ts +8 -0
  511. package/dist/plugin-sdk/auto-reply/reply/inbound-sender-meta.d.ts +5 -0
  512. package/dist/plugin-sdk/auto-reply/reply/inbound-text.d.ts +1 -0
  513. package/dist/plugin-sdk/auto-reply/reply/line-directives.d.ts +22 -0
  514. package/dist/plugin-sdk/auto-reply/reply/memory-flush.d.ts +23 -0
  515. package/dist/plugin-sdk/auto-reply/reply/mentions.d.ts +18 -0
  516. package/dist/plugin-sdk/auto-reply/reply/model-selection.d.ts +61 -0
  517. package/dist/plugin-sdk/auto-reply/reply/normalize-reply.d.ts +13 -0
  518. package/dist/plugin-sdk/auto-reply/reply/provider-dispatcher.d.ts +19 -0
  519. package/dist/plugin-sdk/auto-reply/reply/queue/cleanup.d.ts +6 -0
  520. package/dist/plugin-sdk/auto-reply/reply/queue/directive.d.ts +15 -0
  521. package/dist/plugin-sdk/auto-reply/reply/queue/drain.d.ts +2 -0
  522. package/dist/plugin-sdk/auto-reply/reply/queue/enqueue.d.ts +3 -0
  523. package/dist/plugin-sdk/auto-reply/reply/queue/normalize.d.ts +3 -0
  524. package/dist/plugin-sdk/auto-reply/reply/queue/settings.d.ts +2 -0
  525. package/dist/plugin-sdk/auto-reply/reply/queue/state.d.ts +19 -0
  526. package/dist/plugin-sdk/auto-reply/reply/queue/types.d.ts +84 -0
  527. package/dist/plugin-sdk/auto-reply/reply/queue.d.ts +8 -0
  528. package/dist/plugin-sdk/auto-reply/reply/reply-directives.d.ts +14 -0
  529. package/dist/plugin-sdk/auto-reply/reply/reply-dispatcher.d.ts +51 -0
  530. package/dist/plugin-sdk/auto-reply/reply/reply-elevated.d.ts +23 -0
  531. package/dist/plugin-sdk/auto-reply/reply/reply-inline.d.ts +8 -0
  532. package/dist/plugin-sdk/auto-reply/reply/reply-payloads.d.ts +22 -0
  533. package/dist/plugin-sdk/auto-reply/reply/reply-reference.d.ts +20 -0
  534. package/dist/plugin-sdk/auto-reply/reply/reply-tags.d.ts +6 -0
  535. package/dist/plugin-sdk/auto-reply/reply/reply-threading.d.ts +9 -0
  536. package/dist/plugin-sdk/auto-reply/reply/response-prefix-template.d.ts +51 -0
  537. package/dist/plugin-sdk/auto-reply/reply/route-reply.d.ts +56 -0
  538. package/dist/plugin-sdk/auto-reply/reply/session-reset-model.d.ts +24 -0
  539. package/dist/plugin-sdk/auto-reply/reply/session-updates.d.ts +34 -0
  540. package/dist/plugin-sdk/auto-reply/reply/session-usage.d.ts +13 -0
  541. package/dist/plugin-sdk/auto-reply/reply/session.d.ts +26 -0
  542. package/dist/plugin-sdk/auto-reply/reply/stage-sandbox-media.d.ts +9 -0
  543. package/dist/plugin-sdk/auto-reply/reply/streaming-directives.d.ts +10 -0
  544. package/dist/plugin-sdk/auto-reply/reply/subagents-utils.d.ts +9 -0
  545. package/dist/plugin-sdk/auto-reply/reply/typing-mode.d.ts +27 -0
  546. package/dist/plugin-sdk/auto-reply/reply/typing.d.ts +18 -0
  547. package/dist/plugin-sdk/auto-reply/reply/untrusted-context.d.ts +1 -0
  548. package/dist/plugin-sdk/auto-reply/reply.d.ts +6 -0
  549. package/dist/plugin-sdk/auto-reply/send-policy.d.ts +6 -0
  550. package/dist/plugin-sdk/auto-reply/skill-commands.d.ts +18 -0
  551. package/dist/plugin-sdk/auto-reply/status.d.ts +53 -0
  552. package/dist/plugin-sdk/auto-reply/templating.d.ts +140 -0
  553. package/dist/plugin-sdk/auto-reply/thinking.d.ts +22 -0
  554. package/dist/plugin-sdk/auto-reply/tokens.d.ts +3 -0
  555. package/dist/plugin-sdk/auto-reply/tool-meta.d.ts +8 -0
  556. package/dist/plugin-sdk/auto-reply/types.d.ts +57 -0
  557. package/dist/plugin-sdk/browser/bridge-server.d.ts +17 -0
  558. package/dist/plugin-sdk/browser/cdp.d.ts +123 -0
  559. package/dist/plugin-sdk/browser/cdp.helpers.d.ts +11 -0
  560. package/dist/plugin-sdk/browser/chrome.d.ts +20 -0
  561. package/dist/plugin-sdk/browser/chrome.executables.d.ts +9 -0
  562. package/dist/plugin-sdk/browser/chrome.profile-decoration.d.ts +10 -0
  563. package/dist/plugin-sdk/browser/client-actions-core.d.ts +143 -0
  564. package/dist/plugin-sdk/browser/client-actions-observe.d.ts +68 -0
  565. package/dist/plugin-sdk/browser/client-actions-state.d.ts +90 -0
  566. package/dist/plugin-sdk/browser/client-actions-types.d.ts +18 -0
  567. package/dist/plugin-sdk/browser/client-actions.d.ts +4 -0
  568. package/dist/plugin-sdk/browser/client-fetch.d.ts +3 -0
  569. package/dist/plugin-sdk/browser/client.d.ts +147 -0
  570. package/dist/plugin-sdk/browser/config.d.ts +39 -0
  571. package/dist/plugin-sdk/browser/constants.d.ts +8 -0
  572. package/dist/plugin-sdk/browser/control-service.d.ts +5 -0
  573. package/dist/plugin-sdk/browser/extension-relay.d.ts +15 -0
  574. package/dist/plugin-sdk/browser/profiles-service.d.ts +25 -0
  575. package/dist/plugin-sdk/browser/profiles.d.ts +30 -0
  576. package/dist/plugin-sdk/browser/pw-ai-module.d.ts +6 -0
  577. package/dist/plugin-sdk/browser/pw-ai.d.ts +2 -0
  578. package/dist/plugin-sdk/browser/pw-role-snapshot.d.ts +35 -0
  579. package/dist/plugin-sdk/browser/pw-session.d.ts +135 -0
  580. package/dist/plugin-sdk/browser/pw-tools-core.activity.d.ts +21 -0
  581. package/dist/plugin-sdk/browser/pw-tools-core.d.ts +8 -0
  582. package/dist/plugin-sdk/browser/pw-tools-core.downloads.d.ts +34 -0
  583. package/dist/plugin-sdk/browser/pw-tools-core.interactions.d.ts +112 -0
  584. package/dist/plugin-sdk/browser/pw-tools-core.responses.d.ts +13 -0
  585. package/dist/plugin-sdk/browser/pw-tools-core.shared.d.ts +6 -0
  586. package/dist/plugin-sdk/browser/pw-tools-core.snapshot.d.ts +64 -0
  587. package/dist/plugin-sdk/browser/pw-tools-core.state.d.ts +46 -0
  588. package/dist/plugin-sdk/browser/pw-tools-core.storage.d.ts +47 -0
  589. package/dist/plugin-sdk/browser/pw-tools-core.trace.d.ts +12 -0
  590. package/dist/plugin-sdk/browser/routes/agent.act.d.ts +3 -0
  591. package/dist/plugin-sdk/browser/routes/agent.act.shared.d.ts +10 -0
  592. package/dist/plugin-sdk/browser/routes/agent.d.ts +3 -0
  593. package/dist/plugin-sdk/browser/routes/agent.debug.d.ts +3 -0
  594. package/dist/plugin-sdk/browser/routes/agent.shared.d.ts +9 -0
  595. package/dist/plugin-sdk/browser/routes/agent.snapshot.d.ts +3 -0
  596. package/dist/plugin-sdk/browser/routes/agent.storage.d.ts +3 -0
  597. package/dist/plugin-sdk/browser/routes/basic.d.ts +3 -0
  598. package/dist/plugin-sdk/browser/routes/dispatcher.d.ts +15 -0
  599. package/dist/plugin-sdk/browser/routes/index.d.ts +3 -0
  600. package/dist/plugin-sdk/browser/routes/tabs.d.ts +3 -0
  601. package/dist/plugin-sdk/browser/routes/types.d.ts +15 -0
  602. package/dist/plugin-sdk/browser/routes/utils.d.ts +15 -0
  603. package/dist/plugin-sdk/browser/screenshot.d.ts +9 -0
  604. package/dist/plugin-sdk/browser/server-context.d.ts +3 -0
  605. package/dist/plugin-sdk/browser/server-context.types.d.ts +78 -0
  606. package/dist/plugin-sdk/browser/target-id.d.ts +11 -0
  607. package/dist/plugin-sdk/browser/trash.d.ts +1 -0
  608. package/dist/plugin-sdk/channel-web.d.ts +6 -0
  609. package/dist/plugin-sdk/channels/ack-reactions.d.ts +29 -0
  610. package/dist/plugin-sdk/channels/allowlist-match.d.ts +10 -0
  611. package/dist/plugin-sdk/channels/allowlists/resolve-utils.d.ts +6 -0
  612. package/dist/plugin-sdk/channels/channel-config.d.ts +39 -0
  613. package/dist/plugin-sdk/channels/chat-type.d.ts +2 -0
  614. package/dist/plugin-sdk/channels/command-gating.d.ts +20 -0
  615. package/dist/plugin-sdk/channels/conversation-label.d.ts +2 -0
  616. package/dist/plugin-sdk/channels/dock.d.ts +36 -0
  617. package/dist/plugin-sdk/channels/location.d.ts +21 -0
  618. package/dist/plugin-sdk/channels/logging.d.ts +20 -0
  619. package/dist/plugin-sdk/channels/mention-gating.d.ts +27 -0
  620. package/dist/plugin-sdk/channels/plugins/actions/discord/handle-action.d.ts +3 -0
  621. package/dist/plugin-sdk/channels/plugins/actions/discord/handle-action.guild-admin.d.ts +9 -0
  622. package/dist/plugin-sdk/channels/plugins/actions/discord.d.ts +2 -0
  623. package/dist/plugin-sdk/channels/plugins/actions/signal.d.ts +2 -0
  624. package/dist/plugin-sdk/channels/plugins/actions/telegram.d.ts +2 -0
  625. package/dist/plugin-sdk/channels/plugins/agent-tools/whatsapp-login.d.ts +2 -0
  626. package/dist/plugin-sdk/channels/plugins/allowlist-match.d.ts +2 -0
  627. package/dist/plugin-sdk/channels/plugins/bluebubbles-actions.d.ts +48 -0
  628. package/dist/plugin-sdk/channels/plugins/channel-config.d.ts +2 -0
  629. package/dist/plugin-sdk/channels/plugins/config-helpers.d.ts +14 -0
  630. package/dist/plugin-sdk/channels/plugins/config-schema.d.ts +3 -0
  631. package/dist/plugin-sdk/channels/plugins/config-writes.d.ts +7 -0
  632. package/dist/plugin-sdk/channels/plugins/directory-config.d.ts +16 -0
  633. package/dist/plugin-sdk/channels/plugins/group-mentions.d.ts +28 -0
  634. package/dist/plugin-sdk/channels/plugins/helpers.d.ts +8 -0
  635. package/dist/plugin-sdk/channels/plugins/index.d.ts +8 -0
  636. package/dist/plugin-sdk/channels/plugins/media-limits.d.ts +9 -0
  637. package/dist/plugin-sdk/channels/plugins/message-action-names.d.ts +2 -0
  638. package/dist/plugin-sdk/channels/plugins/message-actions.d.ts +7 -0
  639. package/dist/plugin-sdk/channels/plugins/normalize/discord.d.ts +2 -0
  640. package/dist/plugin-sdk/channels/plugins/normalize/imessage.d.ts +2 -0
  641. package/dist/plugin-sdk/channels/plugins/normalize/signal.d.ts +2 -0
  642. package/dist/plugin-sdk/channels/plugins/normalize/slack.d.ts +2 -0
  643. package/dist/plugin-sdk/channels/plugins/normalize/telegram.d.ts +2 -0
  644. package/dist/plugin-sdk/channels/plugins/normalize/whatsapp.d.ts +2 -0
  645. package/dist/plugin-sdk/channels/plugins/onboarding/channel-access.d.ts +31 -0
  646. package/dist/plugin-sdk/channels/plugins/onboarding/discord.d.ts +2 -0
  647. package/dist/plugin-sdk/channels/plugins/onboarding/helpers.d.ts +3 -0
  648. package/dist/plugin-sdk/channels/plugins/onboarding/imessage.d.ts +2 -0
  649. package/dist/plugin-sdk/channels/plugins/onboarding/signal.d.ts +2 -0
  650. package/dist/plugin-sdk/channels/plugins/onboarding/slack.d.ts +2 -0
  651. package/dist/plugin-sdk/channels/plugins/onboarding/telegram.d.ts +2 -0
  652. package/dist/plugin-sdk/channels/plugins/onboarding/whatsapp.d.ts +2 -0
  653. package/dist/plugin-sdk/channels/plugins/onboarding-types.d.ts +77 -0
  654. package/dist/plugin-sdk/channels/plugins/outbound/load.d.ts +2 -0
  655. package/dist/plugin-sdk/channels/plugins/pairing-message.d.ts +1 -0
  656. package/dist/plugin-sdk/channels/plugins/pairing.d.ts +16 -0
  657. package/dist/plugin-sdk/channels/plugins/setup-helpers.d.ts +13 -0
  658. package/dist/plugin-sdk/channels/plugins/status-issues/bluebubbles.d.ts +2 -0
  659. package/dist/plugin-sdk/channels/plugins/status-issues/discord.d.ts +2 -0
  660. package/dist/plugin-sdk/channels/plugins/status-issues/shared.d.ts +10 -0
  661. package/dist/plugin-sdk/channels/plugins/status-issues/telegram.d.ts +2 -0
  662. package/dist/plugin-sdk/channels/plugins/status-issues/whatsapp.d.ts +2 -0
  663. package/dist/plugin-sdk/channels/plugins/types.adapters.d.ts +294 -0
  664. package/dist/plugin-sdk/channels/plugins/types.core.d.ts +311 -0
  665. package/dist/plugin-sdk/channels/plugins/types.d.ts +6 -0
  666. package/dist/plugin-sdk/channels/plugins/types.plugin.d.ts +53 -0
  667. package/dist/plugin-sdk/channels/plugins/whatsapp-heartbeat.d.ts +11 -0
  668. package/dist/plugin-sdk/channels/registry.d.ts +16 -0
  669. package/dist/plugin-sdk/channels/reply-prefix.d.ts +24 -0
  670. package/dist/plugin-sdk/channels/sender-label.d.ts +9 -0
  671. package/dist/plugin-sdk/channels/session.d.ts +18 -0
  672. package/dist/plugin-sdk/channels/targets.d.ts +25 -0
  673. package/dist/plugin-sdk/channels/typing.d.ts +12 -0
  674. package/dist/plugin-sdk/channels/web/index.d.ts +1 -0
  675. package/dist/plugin-sdk/cli/cli-name.d.ts +3 -0
  676. package/dist/plugin-sdk/cli/cli-utils.d.ts +18 -0
  677. package/dist/plugin-sdk/cli/command-format.d.ts +1 -0
  678. package/dist/plugin-sdk/cli/deps.d.ts +18 -0
  679. package/dist/plugin-sdk/cli/memory-cli.d.ts +12 -0
  680. package/dist/plugin-sdk/cli/nodes-camera.d.ts +26 -0
  681. package/dist/plugin-sdk/cli/nodes-canvas.d.ts +10 -0
  682. package/dist/plugin-sdk/cli/nodes-run.d.ts +3 -0
  683. package/dist/plugin-sdk/cli/nodes-screen.d.ts +18 -0
  684. package/dist/plugin-sdk/cli/parse-duration.d.ts +4 -0
  685. package/dist/plugin-sdk/cli/parse-timeout.d.ts +1 -0
  686. package/dist/plugin-sdk/cli/profile-utils.d.ts +2 -0
  687. package/dist/plugin-sdk/cli/progress.d.ts +24 -0
  688. package/dist/plugin-sdk/cli/wait.d.ts +1 -0
  689. package/dist/plugin-sdk/commands/agent/types.d.ts +75 -0
  690. package/dist/plugin-sdk/commands/daemon-runtime.d.ts +8 -0
  691. package/dist/plugin-sdk/commands/health.d.ts +63 -0
  692. package/dist/plugin-sdk/commands/oauth-flow.d.ts +21 -0
  693. package/dist/plugin-sdk/commands/onboard-helpers.d.ts +81 -0
  694. package/dist/plugin-sdk/commands/onboard-types.d.ts +67 -0
  695. package/dist/plugin-sdk/commands/signal-install.d.ts +8 -0
  696. package/dist/plugin-sdk/compat/legacy-names.d.ts +8 -0
  697. package/dist/plugin-sdk/config/agent-dirs.d.ts +14 -0
  698. package/dist/plugin-sdk/config/agent-limits.d.ts +5 -0
  699. package/dist/plugin-sdk/config/cache-utils.d.ts +6 -0
  700. package/dist/plugin-sdk/config/channel-capabilities.d.ts +6 -0
  701. package/dist/plugin-sdk/config/commands.d.ts +16 -0
  702. package/dist/plugin-sdk/config/config-paths.d.ts +10 -0
  703. package/dist/plugin-sdk/config/config.d.ts +7 -0
  704. package/dist/plugin-sdk/config/defaults.d.ts +18 -0
  705. package/dist/plugin-sdk/config/env-substitution.d.ts +35 -0
  706. package/dist/plugin-sdk/config/env-vars.d.ts +2 -0
  707. package/dist/plugin-sdk/config/group-policy.d.ts +44 -0
  708. package/dist/plugin-sdk/config/includes.d.ts +32 -0
  709. package/dist/plugin-sdk/config/io.d.ts +36 -0
  710. package/dist/plugin-sdk/config/legacy-migrate.d.ts +5 -0
  711. package/dist/plugin-sdk/config/legacy.d.ts +6 -0
  712. package/dist/plugin-sdk/config/legacy.migrations.d.ts +1 -0
  713. package/dist/plugin-sdk/config/legacy.migrations.part-1.d.ts +2 -0
  714. package/dist/plugin-sdk/config/legacy.migrations.part-2.d.ts +2 -0
  715. package/dist/plugin-sdk/config/legacy.migrations.part-3.d.ts +2 -0
  716. package/dist/plugin-sdk/config/legacy.rules.d.ts +2 -0
  717. package/dist/plugin-sdk/config/legacy.shared.d.ts +18 -0
  718. package/dist/plugin-sdk/config/markdown-tables.d.ts +7 -0
  719. package/dist/plugin-sdk/config/merge-config.d.ts +7 -0
  720. package/dist/plugin-sdk/config/normalize-paths.d.ts +8 -0
  721. package/dist/plugin-sdk/config/paths.d.ts +57 -0
  722. package/dist/plugin-sdk/config/port-defaults.d.ts +13 -0
  723. package/dist/plugin-sdk/config/runtime-overrides.d.ts +15 -0
  724. package/dist/plugin-sdk/config/sessions/group.d.ts +11 -0
  725. package/dist/plugin-sdk/config/sessions/main-session.d.ts +43 -0
  726. package/dist/plugin-sdk/config/sessions/metadata.d.ts +16 -0
  727. package/dist/plugin-sdk/config/sessions/paths.d.ts +11 -0
  728. package/dist/plugin-sdk/config/sessions/reset.d.ts +43 -0
  729. package/dist/plugin-sdk/config/sessions/session-key.d.ts +8 -0
  730. package/dist/plugin-sdk/config/sessions/store.d.ts +38 -0
  731. package/dist/plugin-sdk/config/sessions/transcript.d.ts +18 -0
  732. package/dist/plugin-sdk/config/sessions/types.d.ts +146 -0
  733. package/dist/plugin-sdk/config/sessions.d.ts +9 -0
  734. package/dist/plugin-sdk/config/talk.d.ts +11 -0
  735. package/dist/plugin-sdk/config/telegram-custom-commands.d.ts +24 -0
  736. package/dist/plugin-sdk/config/types.agent-defaults.d.ts +254 -0
  737. package/dist/plugin-sdk/config/types.agents.d.ts +77 -0
  738. package/dist/plugin-sdk/config/types.approvals.d.ts +26 -0
  739. package/dist/plugin-sdk/config/types.atlas.d.ts +108 -0
  740. package/dist/plugin-sdk/config/types.auth.d.ts +28 -0
  741. package/dist/plugin-sdk/config/types.base.d.ts +149 -0
  742. package/dist/plugin-sdk/config/types.browser.d.ts +41 -0
  743. package/dist/plugin-sdk/config/types.channels.d.ts +34 -0
  744. package/dist/plugin-sdk/config/types.cron.d.ts +5 -0
  745. package/dist/plugin-sdk/config/types.d.ts +29 -0
  746. package/dist/plugin-sdk/config/types.discord.d.ts +151 -0
  747. package/dist/plugin-sdk/config/types.gateway.d.ts +224 -0
  748. package/dist/plugin-sdk/config/types.googlechat.d.ts +100 -0
  749. package/dist/plugin-sdk/config/types.hooks.d.ts +106 -0
  750. package/dist/plugin-sdk/config/types.imessage.d.ts +71 -0
  751. package/dist/plugin-sdk/config/types.memory.d.ts +39 -0
  752. package/dist/plugin-sdk/config/types.messages.d.ts +106 -0
  753. package/dist/plugin-sdk/config/types.models.d.ts +47 -0
  754. package/dist/plugin-sdk/config/types.msteams.d.ts +101 -0
  755. package/dist/plugin-sdk/config/types.node-host.d.ts +10 -0
  756. package/dist/plugin-sdk/config/types.plugins.d.ts +32 -0
  757. package/dist/plugin-sdk/config/types.queue.d.ts +13 -0
  758. package/dist/plugin-sdk/config/types.sandbox.d.ts +76 -0
  759. package/dist/plugin-sdk/config/types.signal.d.ts +86 -0
  760. package/dist/plugin-sdk/config/types.skills.d.ts +28 -0
  761. package/dist/plugin-sdk/config/types.slack.d.ts +138 -0
  762. package/dist/plugin-sdk/config/types.telegram.d.ts +160 -0
  763. package/dist/plugin-sdk/config/types.tools.d.ts +477 -0
  764. package/dist/plugin-sdk/config/types.tts.d.ts +78 -0
  765. package/dist/plugin-sdk/config/types.whatsapp.d.ts +157 -0
  766. package/dist/plugin-sdk/config/validation.d.ts +17 -0
  767. package/dist/plugin-sdk/config/version.d.ts +8 -0
  768. package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +245 -0
  769. package/dist/plugin-sdk/config/zod-schema.agent-runtime.d.ts +831 -0
  770. package/dist/plugin-sdk/config/zod-schema.agents.d.ts +494 -0
  771. package/dist/plugin-sdk/config/zod-schema.approvals.d.ts +15 -0
  772. package/dist/plugin-sdk/config/zod-schema.channels.d.ts +6 -0
  773. package/dist/plugin-sdk/config/zod-schema.core.d.ts +647 -0
  774. package/dist/plugin-sdk/config/zod-schema.d.ts +3092 -0
  775. package/dist/plugin-sdk/config/zod-schema.hooks.d.ts +78 -0
  776. package/dist/plugin-sdk/config/zod-schema.providers-core.d.ts +2761 -0
  777. package/dist/plugin-sdk/config/zod-schema.providers-whatsapp.d.ts +231 -0
  778. package/dist/plugin-sdk/config/zod-schema.providers.d.ts +1662 -0
  779. package/dist/plugin-sdk/config/zod-schema.session.d.ts +183 -0
  780. package/dist/plugin-sdk/cron/delivery.d.ts +9 -0
  781. package/dist/plugin-sdk/cron/normalize.d.ts +9 -0
  782. package/dist/plugin-sdk/cron/parse.d.ts +1 -0
  783. package/dist/plugin-sdk/cron/payload-migration.d.ts +3 -0
  784. package/dist/plugin-sdk/cron/schedule.d.ts +2 -0
  785. package/dist/plugin-sdk/cron/service/jobs.d.ts +13 -0
  786. package/dist/plugin-sdk/cron/service/locked.d.ts +2 -0
  787. package/dist/plugin-sdk/cron/service/normalize.d.ts +17 -0
  788. package/dist/plugin-sdk/cron/service/ops.d.ts +43 -0
  789. package/dist/plugin-sdk/cron/service/state.d.ts +96 -0
  790. package/dist/plugin-sdk/cron/service/store.d.ts +9 -0
  791. package/dist/plugin-sdk/cron/service/timer.d.ts +23 -0
  792. package/dist/plugin-sdk/cron/service.d.ts +48 -0
  793. package/dist/plugin-sdk/cron/store.d.ts +6 -0
  794. package/dist/plugin-sdk/cron/types.d.ts +91 -0
  795. package/dist/plugin-sdk/daemon/constants.d.ts +30 -0
  796. package/dist/plugin-sdk/discord/accounts.d.ts +17 -0
  797. package/dist/plugin-sdk/discord/api.d.ts +11 -0
  798. package/dist/plugin-sdk/discord/audit.d.ts +29 -0
  799. package/dist/plugin-sdk/discord/chunk.d.ts +20 -0
  800. package/dist/plugin-sdk/discord/directory-live.d.ts +4 -0
  801. package/dist/plugin-sdk/discord/gateway-logging.d.ts +8 -0
  802. package/dist/plugin-sdk/discord/monitor/allow-list.d.ts +137 -0
  803. package/dist/plugin-sdk/discord/monitor/exec-approvals.d.ts +70 -0
  804. package/dist/plugin-sdk/discord/monitor/format.d.ts +13 -0
  805. package/dist/plugin-sdk/discord/monitor/gateway-registry.d.ts +9 -0
  806. package/dist/plugin-sdk/discord/monitor/listeners.d.ts +49 -0
  807. package/dist/plugin-sdk/discord/monitor/message-handler.d.ts +26 -0
  808. package/dist/plugin-sdk/discord/monitor/message-handler.preflight.d.ts +3 -0
  809. package/dist/plugin-sdk/discord/monitor/message-handler.preflight.types.d.ts +86 -0
  810. package/dist/plugin-sdk/discord/monitor/message-handler.process.d.ts +2 -0
  811. package/dist/plugin-sdk/discord/monitor/message-utils.d.ts +31 -0
  812. package/dist/plugin-sdk/discord/monitor/native-command.d.ts +20 -0
  813. package/dist/plugin-sdk/discord/monitor/presence-cache.d.ts +9 -0
  814. package/dist/plugin-sdk/discord/monitor/provider.d.ts +13 -0
  815. package/dist/plugin-sdk/discord/monitor/reply-context.d.ts +13 -0
  816. package/dist/plugin-sdk/discord/monitor/reply-delivery.d.ts +18 -0
  817. package/dist/plugin-sdk/discord/monitor/sender-identity.d.ts +31 -0
  818. package/dist/plugin-sdk/discord/monitor/system-events.d.ts +2 -0
  819. package/dist/plugin-sdk/discord/monitor/threading.d.ts +101 -0
  820. package/dist/plugin-sdk/discord/monitor/typing.d.ts +5 -0
  821. package/dist/plugin-sdk/discord/monitor.d.ts +10 -0
  822. package/dist/plugin-sdk/discord/monitor.gateway.d.ts +12 -0
  823. package/dist/plugin-sdk/discord/pluralkit.d.ts +26 -0
  824. package/dist/plugin-sdk/discord/probe.d.ts +29 -0
  825. package/dist/plugin-sdk/discord/resolve-channels.d.ts +15 -0
  826. package/dist/plugin-sdk/discord/resolve-users.d.ts +14 -0
  827. package/dist/plugin-sdk/discord/send.channels.d.ts +17 -0
  828. package/dist/plugin-sdk/discord/send.d.ts +8 -0
  829. package/dist/plugin-sdk/discord/send.emojis-stickers.d.ts +4 -0
  830. package/dist/plugin-sdk/discord/send.guild.d.ts +24 -0
  831. package/dist/plugin-sdk/discord/send.messages.d.ts +18 -0
  832. package/dist/plugin-sdk/discord/send.outbound.d.ts +22 -0
  833. package/dist/plugin-sdk/discord/send.permissions.d.ts +4 -0
  834. package/dist/plugin-sdk/discord/send.reactions.d.ts +15 -0
  835. package/dist/plugin-sdk/discord/send.shared.d.ts +69 -0
  836. package/dist/plugin-sdk/discord/send.types.d.ts +130 -0
  837. package/dist/plugin-sdk/discord/targets.d.ts +18 -0
  838. package/dist/plugin-sdk/discord/token.d.ts +11 -0
  839. package/dist/plugin-sdk/documents/document-log.d.ts +18 -0
  840. package/dist/plugin-sdk/documents/extractor.d.ts +13 -0
  841. package/dist/plugin-sdk/documents/file-editor.d.ts +72 -0
  842. package/dist/plugin-sdk/documents/key-fields.d.ts +11 -0
  843. package/dist/plugin-sdk/gateway/call.d.ts +51 -0
  844. package/dist/plugin-sdk/gateway/chat-abort.d.ts +44 -0
  845. package/dist/plugin-sdk/gateway/chat-sanitize.d.ts +3 -0
  846. package/dist/plugin-sdk/gateway/client.d.ts +61 -0
  847. package/dist/plugin-sdk/gateway/control-ui-shared.d.ts +9 -0
  848. package/dist/plugin-sdk/gateway/device-auth.d.ts +12 -0
  849. package/dist/plugin-sdk/gateway/node-registry.d.ts +60 -0
  850. package/dist/plugin-sdk/gateway/protocol/client-info.d.ts +58 -0
  851. package/dist/plugin-sdk/gateway/protocol/index.d.ts +635 -0
  852. package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +72 -0
  853. package/dist/plugin-sdk/gateway/protocol/schema/agents-models-skills.d.ts +120 -0
  854. package/dist/plugin-sdk/gateway/protocol/schema/channels.d.ts +105 -0
  855. package/dist/plugin-sdk/gateway/protocol/schema/config.d.ts +51 -0
  856. package/dist/plugin-sdk/gateway/protocol/schema/cron.d.ts +348 -0
  857. package/dist/plugin-sdk/gateway/protocol/schema/devices.d.ts +38 -0
  858. package/dist/plugin-sdk/gateway/protocol/schema/error-codes.d.ts +14 -0
  859. package/dist/plugin-sdk/gateway/protocol/schema/exec-approvals.d.ts +162 -0
  860. package/dist/plugin-sdk/gateway/protocol/schema/frames.d.ts +163 -0
  861. package/dist/plugin-sdk/gateway/protocol/schema/logs-chat.d.ts +45 -0
  862. package/dist/plugin-sdk/gateway/protocol/schema/nodes.d.ts +64 -0
  863. package/dist/plugin-sdk/gateway/protocol/schema/primitives.d.ts +4 -0
  864. package/dist/plugin-sdk/gateway/protocol/schema/protocol-schemas.d.ts +3 -0
  865. package/dist/plugin-sdk/gateway/protocol/schema/sessions.d.ts +74 -0
  866. package/dist/plugin-sdk/gateway/protocol/schema/snapshot.d.ts +63 -0
  867. package/dist/plugin-sdk/gateway/protocol/schema/types.d.ts +116 -0
  868. package/dist/plugin-sdk/gateway/protocol/schema/wizard.d.ts +86 -0
  869. package/dist/plugin-sdk/gateway/protocol/schema.d.ts +16 -0
  870. package/dist/plugin-sdk/gateway/server/ws-types.d.ts +9 -0
  871. package/dist/plugin-sdk/gateway/server-channels.d.ts +24 -0
  872. package/dist/plugin-sdk/gateway/server-methods/types.d.ts +96 -0
  873. package/dist/plugin-sdk/gateway/server-shared.d.ts +7 -0
  874. package/dist/plugin-sdk/gateway/session-utils.d.ts +53 -0
  875. package/dist/plugin-sdk/gateway/session-utils.fs.d.ts +11 -0
  876. package/dist/plugin-sdk/gateway/session-utils.types.d.ts +83 -0
  877. package/dist/plugin-sdk/globals.d.ts +11 -0
  878. package/dist/plugin-sdk/hooks/internal-hooks.d.ts +95 -0
  879. package/dist/plugin-sdk/hooks/types.d.ts +62 -0
  880. package/dist/plugin-sdk/imessage/accounts.d.ts +16 -0
  881. package/dist/plugin-sdk/imessage/client.d.ts +46 -0
  882. package/dist/plugin-sdk/imessage/constants.d.ts +2 -0
  883. package/dist/plugin-sdk/imessage/monitor/deliver.d.ts +17 -0
  884. package/dist/plugin-sdk/imessage/monitor/monitor-provider.d.ts +2 -0
  885. package/dist/plugin-sdk/imessage/monitor/runtime.d.ts +4 -0
  886. package/dist/plugin-sdk/imessage/monitor/types.d.ts +37 -0
  887. package/dist/plugin-sdk/imessage/monitor.d.ts +2 -0
  888. package/dist/plugin-sdk/imessage/probe.d.ts +18 -0
  889. package/dist/plugin-sdk/imessage/send.d.ts +18 -0
  890. package/dist/plugin-sdk/imessage/targets.d.ts +39 -0
  891. package/dist/plugin-sdk/index.d.ts +1 -0
  892. package/dist/plugin-sdk/index.js +24585 -0
  893. package/dist/plugin-sdk/infra/agent-events.d.ts +21 -0
  894. package/dist/plugin-sdk/infra/atlas-root.d.ts +10 -0
  895. package/dist/plugin-sdk/infra/backoff.d.ts +8 -0
  896. package/dist/plugin-sdk/infra/channel-activity.d.ts +18 -0
  897. package/dist/plugin-sdk/infra/channel-summary.d.ts +7 -0
  898. package/dist/plugin-sdk/infra/dedupe.d.ts +11 -0
  899. package/dist/plugin-sdk/infra/device-auth-store.d.ts +23 -0
  900. package/dist/plugin-sdk/infra/device-identity.d.ts +11 -0
  901. package/dist/plugin-sdk/infra/diagnostic-events.d.ts +121 -0
  902. package/dist/plugin-sdk/infra/diagnostic-flags.d.ts +4 -0
  903. package/dist/plugin-sdk/infra/env.d.ts +11 -0
  904. package/dist/plugin-sdk/infra/errors.d.ts +3 -0
  905. package/dist/plugin-sdk/infra/exec-approvals.d.ts +155 -0
  906. package/dist/plugin-sdk/infra/exec-safety.d.ts +1 -0
  907. package/dist/plugin-sdk/infra/fetch.d.ts +2 -0
  908. package/dist/plugin-sdk/infra/format-duration.d.ts +10 -0
  909. package/dist/plugin-sdk/infra/git-commit.d.ts +4 -0
  910. package/dist/plugin-sdk/infra/heartbeat-events.d.ts +21 -0
  911. package/dist/plugin-sdk/infra/heartbeat-runner.d.ts +44 -0
  912. package/dist/plugin-sdk/infra/heartbeat-visibility.d.ts +17 -0
  913. package/dist/plugin-sdk/infra/heartbeat-wake.d.ts +20 -0
  914. package/dist/plugin-sdk/infra/json-file.d.ts +2 -0
  915. package/dist/plugin-sdk/infra/machine-name.d.ts +1 -0
  916. package/dist/plugin-sdk/infra/net/fetch-guard.d.ts +20 -0
  917. package/dist/plugin-sdk/infra/net/ssrf.d.ts +31 -0
  918. package/dist/plugin-sdk/infra/node-pairing.d.ts +62 -0
  919. package/dist/plugin-sdk/infra/node-shell.d.ts +1 -0
  920. package/dist/plugin-sdk/infra/outbound/channel-adapters.d.ts +6 -0
  921. package/dist/plugin-sdk/infra/outbound/channel-selection.d.ts +11 -0
  922. package/dist/plugin-sdk/infra/outbound/channel-target.d.ts +6 -0
  923. package/dist/plugin-sdk/infra/outbound/deliver.d.ts +69 -0
  924. package/dist/plugin-sdk/infra/outbound/directory-cache.d.ts +21 -0
  925. package/dist/plugin-sdk/infra/outbound/message-action-runner.d.ts +74 -0
  926. package/dist/plugin-sdk/infra/outbound/message-action-spec.d.ts +5 -0
  927. package/dist/plugin-sdk/infra/outbound/message.d.ts +76 -0
  928. package/dist/plugin-sdk/infra/outbound/outbound-policy.d.ts +31 -0
  929. package/dist/plugin-sdk/infra/outbound/outbound-send-service.d.ts +58 -0
  930. package/dist/plugin-sdk/infra/outbound/outbound-session.d.ts +31 -0
  931. package/dist/plugin-sdk/infra/outbound/payloads.d.ts +16 -0
  932. package/dist/plugin-sdk/infra/outbound/target-errors.d.ts +6 -0
  933. package/dist/plugin-sdk/infra/outbound/target-normalization.d.ts +4 -0
  934. package/dist/plugin-sdk/infra/outbound/target-resolver.d.ts +53 -0
  935. package/dist/plugin-sdk/infra/outbound/targets.d.ts +65 -0
  936. package/dist/plugin-sdk/infra/ports-format.d.ts +5 -0
  937. package/dist/plugin-sdk/infra/ports-inspect.d.ts +2 -0
  938. package/dist/plugin-sdk/infra/ports-lsof.d.ts +2 -0
  939. package/dist/plugin-sdk/infra/ports-types.d.ts +17 -0
  940. package/dist/plugin-sdk/infra/ports.d.ts +14 -0
  941. package/dist/plugin-sdk/infra/provider-usage.auth.d.ts +11 -0
  942. package/dist/plugin-sdk/infra/provider-usage.d.ts +4 -0
  943. package/dist/plugin-sdk/infra/provider-usage.fetch.antigravity.d.ts +2 -0
  944. package/dist/plugin-sdk/infra/provider-usage.fetch.claude.d.ts +2 -0
  945. package/dist/plugin-sdk/infra/provider-usage.fetch.codex.d.ts +2 -0
  946. package/dist/plugin-sdk/infra/provider-usage.fetch.copilot.d.ts +2 -0
  947. package/dist/plugin-sdk/infra/provider-usage.fetch.d.ts +7 -0
  948. package/dist/plugin-sdk/infra/provider-usage.fetch.gemini.d.ts +2 -0
  949. package/dist/plugin-sdk/infra/provider-usage.fetch.minimax.d.ts +2 -0
  950. package/dist/plugin-sdk/infra/provider-usage.fetch.shared.d.ts +1 -0
  951. package/dist/plugin-sdk/infra/provider-usage.fetch.zai.d.ts +2 -0
  952. package/dist/plugin-sdk/infra/provider-usage.format.d.ts +13 -0
  953. package/dist/plugin-sdk/infra/provider-usage.load.d.ts +12 -0
  954. package/dist/plugin-sdk/infra/provider-usage.shared.d.ts +8 -0
  955. package/dist/plugin-sdk/infra/provider-usage.types.d.ts +17 -0
  956. package/dist/plugin-sdk/infra/restart-sentinel.d.ts +50 -0
  957. package/dist/plugin-sdk/infra/restart.d.ts +28 -0
  958. package/dist/plugin-sdk/infra/retry-policy.d.ts +25 -0
  959. package/dist/plugin-sdk/infra/retry.d.ts +21 -0
  960. package/dist/plugin-sdk/infra/session-cost-usage.d.ts +160 -0
  961. package/dist/plugin-sdk/infra/shell-env.d.ts +33 -0
  962. package/dist/plugin-sdk/infra/skills-remote.d.ts +24 -0
  963. package/dist/plugin-sdk/infra/system-events.d.ts +16 -0
  964. package/dist/plugin-sdk/infra/tailnet.d.ts +7 -0
  965. package/dist/plugin-sdk/infra/tls/fingerprint.d.ts +1 -0
  966. package/dist/plugin-sdk/infra/tls/gateway.d.ts +16 -0
  967. package/dist/plugin-sdk/infra/transport-ready.d.ts +16 -0
  968. package/dist/plugin-sdk/infra/unhandled-rejections.d.ts +15 -0
  969. package/dist/plugin-sdk/infra/warnings.d.ts +1 -0
  970. package/dist/plugin-sdk/infra/ws.d.ts +2 -0
  971. package/dist/plugin-sdk/infra/wsl.d.ts +2 -0
  972. package/dist/plugin-sdk/line/accounts.d.ts +10 -0
  973. package/dist/plugin-sdk/line/auto-reply-delivery.d.ts +49 -0
  974. package/dist/plugin-sdk/line/bot-access.d.ts +15 -0
  975. package/dist/plugin-sdk/line/bot-handlers.d.ts +13 -0
  976. package/dist/plugin-sdk/line/bot-message-context.d.ts +102 -0
  977. package/dist/plugin-sdk/line/bot.d.ts +24 -0
  978. package/dist/plugin-sdk/line/config-schema.d.ts +64 -0
  979. package/dist/plugin-sdk/line/download.d.ts +7 -0
  980. package/dist/plugin-sdk/line/flex-templates.d.ts +195 -0
  981. package/dist/plugin-sdk/line/markdown-to-line.d.ts +72 -0
  982. package/dist/plugin-sdk/line/monitor.d.ts +28 -0
  983. package/dist/plugin-sdk/line/probe.d.ts +2 -0
  984. package/dist/plugin-sdk/line/reply-chunks.d.ts +24 -0
  985. package/dist/plugin-sdk/line/send.d.ts +118 -0
  986. package/dist/plugin-sdk/line/signature.d.ts +1 -0
  987. package/dist/plugin-sdk/line/template-messages.d.ts +119 -0
  988. package/dist/plugin-sdk/line/types.d.ts +125 -0
  989. package/dist/plugin-sdk/line/webhook.d.ts +19 -0
  990. package/dist/plugin-sdk/link-understanding/apply.d.ts +10 -0
  991. package/dist/plugin-sdk/link-understanding/defaults.d.ts +2 -0
  992. package/dist/plugin-sdk/link-understanding/detect.d.ts +3 -0
  993. package/dist/plugin-sdk/link-understanding/format.d.ts +4 -0
  994. package/dist/plugin-sdk/link-understanding/runner.d.ts +11 -0
  995. package/dist/plugin-sdk/logger.d.ts +6 -0
  996. package/dist/plugin-sdk/logging/config.d.ts +4 -0
  997. package/dist/plugin-sdk/logging/console.d.ts +19 -0
  998. package/dist/plugin-sdk/logging/diagnostic.d.ts +58 -0
  999. package/dist/plugin-sdk/logging/levels.d.ts +4 -0
  1000. package/dist/plugin-sdk/logging/logger.d.ts +42 -0
  1001. package/dist/plugin-sdk/logging/redact-identifier.d.ts +4 -0
  1002. package/dist/plugin-sdk/logging/redact.d.ts +9 -0
  1003. package/dist/plugin-sdk/logging/state.d.ts +17 -0
  1004. package/dist/plugin-sdk/logging/subsystem.d.ts +16 -0
  1005. package/dist/plugin-sdk/logging.d.ts +10 -0
  1006. package/dist/plugin-sdk/markdown/code-spans.d.ts +10 -0
  1007. package/dist/plugin-sdk/markdown/fences.d.ts +10 -0
  1008. package/dist/plugin-sdk/markdown/frontmatter.d.ts +2 -0
  1009. package/dist/plugin-sdk/markdown/ir.d.ts +32 -0
  1010. package/dist/plugin-sdk/markdown/render.d.ts +18 -0
  1011. package/dist/plugin-sdk/markdown/tables.d.ts +2 -0
  1012. package/dist/plugin-sdk/media/audio-tags.d.ts +10 -0
  1013. package/dist/plugin-sdk/media/audio.d.ts +4 -0
  1014. package/dist/plugin-sdk/media/constants.d.ts +7 -0
  1015. package/dist/plugin-sdk/media/fetch.d.ts +23 -0
  1016. package/dist/plugin-sdk/media/image-ops.d.ts +39 -0
  1017. package/dist/plugin-sdk/media/input-files.d.ts +76 -0
  1018. package/dist/plugin-sdk/media/mime.d.ts +15 -0
  1019. package/dist/plugin-sdk/media/parse.d.ts +8 -0
  1020. package/dist/plugin-sdk/media/store.d.ts +18 -0
  1021. package/dist/plugin-sdk/media-understanding/apply.d.ts +19 -0
  1022. package/dist/plugin-sdk/media-understanding/attachments.d.ts +43 -0
  1023. package/dist/plugin-sdk/media-understanding/concurrency.d.ts +1 -0
  1024. package/dist/plugin-sdk/media-understanding/defaults.d.ts +10 -0
  1025. package/dist/plugin-sdk/media-understanding/errors.d.ts +6 -0
  1026. package/dist/plugin-sdk/media-understanding/format.d.ts +7 -0
  1027. package/dist/plugin-sdk/media-understanding/providers/anthropic/index.d.ts +2 -0
  1028. package/dist/plugin-sdk/media-understanding/providers/deepgram/audio.d.ts +4 -0
  1029. package/dist/plugin-sdk/media-understanding/providers/deepgram/index.d.ts +2 -0
  1030. package/dist/plugin-sdk/media-understanding/providers/google/audio.d.ts +3 -0
  1031. package/dist/plugin-sdk/media-understanding/providers/google/index.d.ts +2 -0
  1032. package/dist/plugin-sdk/media-understanding/providers/google/video.d.ts +3 -0
  1033. package/dist/plugin-sdk/media-understanding/providers/groq/index.d.ts +2 -0
  1034. package/dist/plugin-sdk/media-understanding/providers/image.d.ts +2 -0
  1035. package/dist/plugin-sdk/media-understanding/providers/index.d.ts +4 -0
  1036. package/dist/plugin-sdk/media-understanding/providers/minimax/index.d.ts +2 -0
  1037. package/dist/plugin-sdk/media-understanding/providers/openai/audio.d.ts +3 -0
  1038. package/dist/plugin-sdk/media-understanding/providers/openai/index.d.ts +2 -0
  1039. package/dist/plugin-sdk/media-understanding/providers/shared.d.ts +10 -0
  1040. package/dist/plugin-sdk/media-understanding/resolve.d.ts +44 -0
  1041. package/dist/plugin-sdk/media-understanding/runner.d.ts +34 -0
  1042. package/dist/plugin-sdk/media-understanding/scope.d.ts +9 -0
  1043. package/dist/plugin-sdk/media-understanding/types.d.ts +92 -0
  1044. package/dist/plugin-sdk/media-understanding/video.d.ts +2 -0
  1045. package/dist/plugin-sdk/memory/backend-config.d.ts +44 -0
  1046. package/dist/plugin-sdk/memory/batch-gemini.d.ts +55 -0
  1047. package/dist/plugin-sdk/memory/batch-openai.d.ts +45 -0
  1048. package/dist/plugin-sdk/memory/batch-voyage.d.ts +46 -0
  1049. package/dist/plugin-sdk/memory/embeddings-gemini.d.ts +13 -0
  1050. package/dist/plugin-sdk/memory/embeddings-openai.d.ts +13 -0
  1051. package/dist/plugin-sdk/memory/embeddings-voyage.d.ts +13 -0
  1052. package/dist/plugin-sdk/memory/embeddings.d.ts +39 -0
  1053. package/dist/plugin-sdk/memory/hybrid.d.ts +34 -0
  1054. package/dist/plugin-sdk/memory/index.d.ts +3 -0
  1055. package/dist/plugin-sdk/memory/internal.d.ts +27 -0
  1056. package/dist/plugin-sdk/memory/manager-search.d.ts +60 -0
  1057. package/dist/plugin-sdk/memory/manager.d.ts +136 -0
  1058. package/dist/plugin-sdk/memory/memory-schema.d.ts +10 -0
  1059. package/dist/plugin-sdk/memory/node-llama.d.ts +8 -0
  1060. package/dist/plugin-sdk/memory/qmd-manager.d.ts +78 -0
  1061. package/dist/plugin-sdk/memory/search-manager.d.ts +10 -0
  1062. package/dist/plugin-sdk/memory/session-files.d.ts +12 -0
  1063. package/dist/plugin-sdk/memory/sqlite-vec.d.ts +9 -0
  1064. package/dist/plugin-sdk/memory/sqlite.d.ts +1 -0
  1065. package/dist/plugin-sdk/memory/types.d.ts +94 -0
  1066. package/dist/plugin-sdk/pairing/pairing-labels.d.ts +2 -0
  1067. package/dist/plugin-sdk/pairing/pairing-messages.d.ts +6 -0
  1068. package/dist/plugin-sdk/pairing/pairing-store.d.ts +46 -0
  1069. package/dist/plugin-sdk/pi-model-discovery-BKdHZoFR.js +37 -0
  1070. package/dist/plugin-sdk/plugin-sdk/index.d.ts +100 -0
  1071. package/dist/plugin-sdk/plugins/bundled-dir.d.ts +1 -0
  1072. package/dist/plugin-sdk/plugins/commands.d.ts +78 -0
  1073. package/dist/plugin-sdk/plugins/config-schema.d.ts +2 -0
  1074. package/dist/plugin-sdk/plugins/config-state.d.ts +33 -0
  1075. package/dist/plugin-sdk/plugins/discovery.d.ts +22 -0
  1076. package/dist/plugin-sdk/plugins/hook-runner-global.d.ts +31 -0
  1077. package/dist/plugin-sdk/plugins/hooks.d.ts +41 -0
  1078. package/dist/plugin-sdk/plugins/http-path.d.ts +1 -0
  1079. package/dist/plugin-sdk/plugins/http-registry.d.ts +13 -0
  1080. package/dist/plugin-sdk/plugins/loader.d.ts +14 -0
  1081. package/dist/plugin-sdk/plugins/manifest-registry.d.ts +33 -0
  1082. package/dist/plugin-sdk/plugins/manifest.d.ts +64 -0
  1083. package/dist/plugin-sdk/plugins/registry.d.ts +130 -0
  1084. package/dist/plugin-sdk/plugins/runtime/index.d.ts +3 -0
  1085. package/dist/plugin-sdk/plugins/runtime/native-deps.d.ts +8 -0
  1086. package/dist/plugin-sdk/plugins/runtime/types.d.ts +314 -0
  1087. package/dist/plugin-sdk/plugins/runtime.d.ts +5 -0
  1088. package/dist/plugin-sdk/plugins/schema-validator.d.ts +10 -0
  1089. package/dist/plugin-sdk/plugins/slots.d.ts +24 -0
  1090. package/dist/plugin-sdk/plugins/tools.d.ts +13 -0
  1091. package/dist/plugin-sdk/plugins/types.d.ts +381 -0
  1092. package/dist/plugin-sdk/polls.d.ts +21 -0
  1093. package/dist/plugin-sdk/process/command-queue.d.ts +12 -0
  1094. package/dist/plugin-sdk/process/exec.d.ts +22 -0
  1095. package/dist/plugin-sdk/process/lanes.d.ts +6 -0
  1096. package/dist/plugin-sdk/process/spawn-utils.d.ts +26 -0
  1097. package/dist/plugin-sdk/providers/github-copilot-token.d.ts +19 -0
  1098. package/dist/plugin-sdk/providers/qwen-portal-oauth.d.ts +2 -0
  1099. package/dist/plugin-sdk/routing/bindings.d.ts +11 -0
  1100. package/dist/plugin-sdk/routing/resolve-route.d.ts +38 -0
  1101. package/dist/plugin-sdk/routing/session-key.d.ts +47 -0
  1102. package/dist/plugin-sdk/runtime.d.ts +6 -0
  1103. package/dist/plugin-sdk/security/channel-metadata.d.ts +6 -0
  1104. package/dist/plugin-sdk/security/external-content.d.ts +67 -0
  1105. package/dist/plugin-sdk/sessions/level-overrides.d.ts +10 -0
  1106. package/dist/plugin-sdk/sessions/model-overrides.d.ts +14 -0
  1107. package/dist/plugin-sdk/sessions/send-policy.d.ts +11 -0
  1108. package/dist/plugin-sdk/sessions/session-key-utils.d.ts +8 -0
  1109. package/dist/plugin-sdk/sessions/session-label.d.ts +9 -0
  1110. package/dist/plugin-sdk/sessions/transcript-events.d.ts +7 -0
  1111. package/dist/plugin-sdk/shared/text/reasoning-tags.d.ts +6 -0
  1112. package/dist/plugin-sdk/signal/accounts.d.ts +17 -0
  1113. package/dist/plugin-sdk/signal/client.d.ts +32 -0
  1114. package/dist/plugin-sdk/signal/daemon.d.ts +18 -0
  1115. package/dist/plugin-sdk/signal/format.d.ts +17 -0
  1116. package/dist/plugin-sdk/signal/identity.d.ts +23 -0
  1117. package/dist/plugin-sdk/signal/index.d.ts +5 -0
  1118. package/dist/plugin-sdk/signal/monitor/event-handler.d.ts +5 -0
  1119. package/dist/plugin-sdk/signal/monitor/event-handler.types.d.ts +117 -0
  1120. package/dist/plugin-sdk/signal/monitor.d.ts +23 -0
  1121. package/dist/plugin-sdk/signal/probe.d.ts +8 -0
  1122. package/dist/plugin-sdk/signal/reaction-level.d.ts +24 -0
  1123. package/dist/plugin-sdk/signal/send-reactions.d.ts +32 -0
  1124. package/dist/plugin-sdk/signal/send.d.ts +24 -0
  1125. package/dist/plugin-sdk/signal/sse-reconnect.d.ts +13 -0
  1126. package/dist/plugin-sdk/slack/accounts.d.ts +32 -0
  1127. package/dist/plugin-sdk/slack/actions.d.ts +53 -0
  1128. package/dist/plugin-sdk/slack/channel-migration.d.ts +20 -0
  1129. package/dist/plugin-sdk/slack/client.d.ts +4 -0
  1130. package/dist/plugin-sdk/slack/directory-live.d.ts +4 -0
  1131. package/dist/plugin-sdk/slack/format.d.ts +7 -0
  1132. package/dist/plugin-sdk/slack/http/index.d.ts +1 -0
  1133. package/dist/plugin-sdk/slack/http/registry.d.ts +12 -0
  1134. package/dist/plugin-sdk/slack/index.d.ts +6 -0
  1135. package/dist/plugin-sdk/slack/monitor/allow-list.d.ts +20 -0
  1136. package/dist/plugin-sdk/slack/monitor/auth.d.ts +10 -0
  1137. package/dist/plugin-sdk/slack/monitor/channel-config.d.ts +40 -0
  1138. package/dist/plugin-sdk/slack/monitor/commands.d.ts +4 -0
  1139. package/dist/plugin-sdk/slack/monitor/context.d.ts +109 -0
  1140. package/dist/plugin-sdk/slack/monitor/events/channels.d.ts +4 -0
  1141. package/dist/plugin-sdk/slack/monitor/events/members.d.ts +4 -0
  1142. package/dist/plugin-sdk/slack/monitor/events/messages.d.ts +6 -0
  1143. package/dist/plugin-sdk/slack/monitor/events/pins.d.ts +4 -0
  1144. package/dist/plugin-sdk/slack/monitor/events/reactions.d.ts +4 -0
  1145. package/dist/plugin-sdk/slack/monitor/events.d.ts +8 -0
  1146. package/dist/plugin-sdk/slack/monitor/media.d.ts +29 -0
  1147. package/dist/plugin-sdk/slack/monitor/message-handler/dispatch.d.ts +2 -0
  1148. package/dist/plugin-sdk/slack/monitor/message-handler/prepare.d.ts +13 -0
  1149. package/dist/plugin-sdk/slack/monitor/message-handler/types.d.ts +22 -0
  1150. package/dist/plugin-sdk/slack/monitor/message-handler.d.ts +11 -0
  1151. package/dist/plugin-sdk/slack/monitor/policy.d.ts +5 -0
  1152. package/dist/plugin-sdk/slack/monitor/provider.d.ts +2 -0
  1153. package/dist/plugin-sdk/slack/monitor/replies.d.ts +50 -0
  1154. package/dist/plugin-sdk/slack/monitor/slash.d.ts +6 -0
  1155. package/dist/plugin-sdk/slack/monitor/thread-resolution.d.ts +12 -0
  1156. package/dist/plugin-sdk/slack/monitor/types.d.ts +97 -0
  1157. package/dist/plugin-sdk/slack/monitor.d.ts +5 -0
  1158. package/dist/plugin-sdk/slack/probe.d.ts +15 -0
  1159. package/dist/plugin-sdk/slack/resolve-channels.d.ts +19 -0
  1160. package/dist/plugin-sdk/slack/resolve-users.d.ts +26 -0
  1161. package/dist/plugin-sdk/slack/send.d.ts +14 -0
  1162. package/dist/plugin-sdk/slack/targets.d.ts +7 -0
  1163. package/dist/plugin-sdk/slack/threading-tool-context.d.ts +10 -0
  1164. package/dist/plugin-sdk/slack/threading.d.ts +20 -0
  1165. package/dist/plugin-sdk/slack/token.d.ts +3 -0
  1166. package/dist/plugin-sdk/slack/types.d.ts +36 -0
  1167. package/dist/plugin-sdk/telegram/accounts.d.ts +17 -0
  1168. package/dist/plugin-sdk/telegram/allowed-updates.d.ts +4 -0
  1169. package/dist/plugin-sdk/telegram/api-logging.d.ts +11 -0
  1170. package/dist/plugin-sdk/telegram/audit.d.ts +29 -0
  1171. package/dist/plugin-sdk/telegram/bot/delivery.d.ts +34 -0
  1172. package/dist/plugin-sdk/telegram/bot/helpers.d.ts +93 -0
  1173. package/dist/plugin-sdk/telegram/bot/types.d.ts +28 -0
  1174. package/dist/plugin-sdk/telegram/bot-access.d.ts +24 -0
  1175. package/dist/plugin-sdk/telegram/bot-handlers.d.ts +2 -0
  1176. package/dist/plugin-sdk/telegram/bot-message-context.d.ts +130 -0
  1177. package/dist/plugin-sdk/telegram/bot-message-dispatch.d.ts +21 -0
  1178. package/dist/plugin-sdk/telegram/bot-message.d.ts +21 -0
  1179. package/dist/plugin-sdk/telegram/bot-native-commands.d.ts +59 -0
  1180. package/dist/plugin-sdk/telegram/bot-updates.d.ts +27 -0
  1181. package/dist/plugin-sdk/telegram/bot.d.ts +54 -0
  1182. package/dist/plugin-sdk/telegram/caption.d.ts +5 -0
  1183. package/dist/plugin-sdk/telegram/draft-chunking.d.ts +6 -0
  1184. package/dist/plugin-sdk/telegram/draft-stream.d.ts +17 -0
  1185. package/dist/plugin-sdk/telegram/fetch.d.ts +4 -0
  1186. package/dist/plugin-sdk/telegram/format.d.ts +16 -0
  1187. package/dist/plugin-sdk/telegram/group-migration.d.ts +20 -0
  1188. package/dist/plugin-sdk/telegram/inline-buttons.d.ts +11 -0
  1189. package/dist/plugin-sdk/telegram/model-buttons.d.ts +63 -0
  1190. package/dist/plugin-sdk/telegram/monitor.d.ts +18 -0
  1191. package/dist/plugin-sdk/telegram/network-config.d.ts +12 -0
  1192. package/dist/plugin-sdk/telegram/network-errors.d.ts +5 -0
  1193. package/dist/plugin-sdk/telegram/probe.d.ts +18 -0
  1194. package/dist/plugin-sdk/telegram/proxy.d.ts +1 -0
  1195. package/dist/plugin-sdk/telegram/reaction-level.d.ts +18 -0
  1196. package/dist/plugin-sdk/telegram/send.d.ts +96 -0
  1197. package/dist/plugin-sdk/telegram/sent-message-cache.d.ts +16 -0
  1198. package/dist/plugin-sdk/telegram/sticker-cache.d.ts +46 -0
  1199. package/dist/plugin-sdk/telegram/targets.d.ts +14 -0
  1200. package/dist/plugin-sdk/telegram/token.d.ts +13 -0
  1201. package/dist/plugin-sdk/telegram/update-offset-store.d.ts +9 -0
  1202. package/dist/plugin-sdk/telegram/voice.d.ts +20 -0
  1203. package/dist/plugin-sdk/telegram/webhook.d.ts +20 -0
  1204. package/dist/plugin-sdk/terminal/ansi.d.ts +2 -0
  1205. package/dist/plugin-sdk/terminal/links.d.ts +6 -0
  1206. package/dist/plugin-sdk/terminal/palette.d.ts +10 -0
  1207. package/dist/plugin-sdk/terminal/progress-line.d.ts +3 -0
  1208. package/dist/plugin-sdk/terminal/prompt-style.d.ts +3 -0
  1209. package/dist/plugin-sdk/terminal/restore.d.ts +1 -0
  1210. package/dist/plugin-sdk/terminal/theme.d.ts +15 -0
  1211. package/dist/plugin-sdk/tts/tts.d.ts +198 -0
  1212. package/dist/plugin-sdk/tui/tui-formatters.d.ts +31 -0
  1213. package/dist/plugin-sdk/utils/account-id.d.ts +1 -0
  1214. package/dist/plugin-sdk/utils/boolean.d.ts +5 -0
  1215. package/dist/plugin-sdk/utils/delivery-context.d.ts +29 -0
  1216. package/dist/plugin-sdk/utils/directive-tags.d.ts +16 -0
  1217. package/dist/plugin-sdk/utils/message-channel.d.ts +27 -0
  1218. package/dist/plugin-sdk/utils/provider-utils.d.ts +9 -0
  1219. package/dist/plugin-sdk/utils/queue-helpers.d.ts +41 -0
  1220. package/dist/plugin-sdk/utils/shell-argv.d.ts +1 -0
  1221. package/dist/plugin-sdk/utils/transcript-tools.d.ts +8 -0
  1222. package/dist/plugin-sdk/utils/usage-format.d.ts +26 -0
  1223. package/dist/plugin-sdk/utils.d.ts +43 -0
  1224. package/dist/plugin-sdk/version.d.ts +4 -0
  1225. package/dist/plugin-sdk/web/accounts.d.ts +39 -0
  1226. package/dist/plugin-sdk/web/active-listener.d.ts +24 -0
  1227. package/dist/plugin-sdk/web/auth-store.d.ts +25 -0
  1228. package/dist/plugin-sdk/web/auto-reply/constants.d.ts +1 -0
  1229. package/dist/plugin-sdk/web/auto-reply/deliver-reply.d.ts +18 -0
  1230. package/dist/plugin-sdk/web/auto-reply/heartbeat-runner.d.ts +20 -0
  1231. package/dist/plugin-sdk/web/auto-reply/loggers.d.ts +4 -0
  1232. package/dist/plugin-sdk/web/auto-reply/mentions.d.ts +19 -0
  1233. package/dist/plugin-sdk/web/auto-reply/monitor/ack-reaction.d.ts +13 -0
  1234. package/dist/plugin-sdk/web/auto-reply/monitor/broadcast.d.ts +16 -0
  1235. package/dist/plugin-sdk/web/auto-reply/monitor/commands.d.ts +2 -0
  1236. package/dist/plugin-sdk/web/auto-reply/monitor/echo.d.ts +17 -0
  1237. package/dist/plugin-sdk/web/auto-reply/monitor/group-activation.d.ts +9 -0
  1238. package/dist/plugin-sdk/web/auto-reply/monitor/group-gating.d.ts +29 -0
  1239. package/dist/plugin-sdk/web/auto-reply/monitor/group-members.d.ts +6 -0
  1240. package/dist/plugin-sdk/web/auto-reply/monitor/last-route.d.ts +15 -0
  1241. package/dist/plugin-sdk/web/auto-reply/monitor/message-line.d.ts +11 -0
  1242. package/dist/plugin-sdk/web/auto-reply/monitor/on-message.d.ts +24 -0
  1243. package/dist/plugin-sdk/web/auto-reply/monitor/peer.d.ts +2 -0
  1244. package/dist/plugin-sdk/web/auto-reply/monitor/process-message.d.ts +40 -0
  1245. package/dist/plugin-sdk/web/auto-reply/monitor.d.ts +5 -0
  1246. package/dist/plugin-sdk/web/auto-reply/session-snapshot.d.ts +17 -0
  1247. package/dist/plugin-sdk/web/auto-reply/types.d.ts +28 -0
  1248. package/dist/plugin-sdk/web/auto-reply/util.d.ts +2 -0
  1249. package/dist/plugin-sdk/web/auto-reply.d.ts +1 -0
  1250. package/dist/plugin-sdk/web/auto-reply.impl.d.ts +6 -0
  1251. package/dist/plugin-sdk/web/inbound/access-control.d.ts +24 -0
  1252. package/dist/plugin-sdk/web/inbound/dedupe.d.ts +2 -0
  1253. package/dist/plugin-sdk/web/inbound/extract.d.ts +13 -0
  1254. package/dist/plugin-sdk/web/inbound/media.d.ts +6 -0
  1255. package/dist/plugin-sdk/web/inbound/monitor.d.ts +30 -0
  1256. package/dist/plugin-sdk/web/inbound/send-api.d.ts +22 -0
  1257. package/dist/plugin-sdk/web/inbound/types.d.ts +40 -0
  1258. package/dist/plugin-sdk/web/inbound.d.ts +4 -0
  1259. package/dist/plugin-sdk/web/login-qr.d.ts +19 -0
  1260. package/dist/plugin-sdk/web/login.d.ts +3 -0
  1261. package/dist/plugin-sdk/web/media.d.ts +25 -0
  1262. package/dist/plugin-sdk/web/outbound.d.ts +23 -0
  1263. package/dist/plugin-sdk/web/qr-image.d.ts +4 -0
  1264. package/dist/plugin-sdk/web/reconnect.d.ts +12 -0
  1265. package/dist/plugin-sdk/web/session.d.ts +14 -0
  1266. package/dist/plugin-sdk/web/vcard.d.ts +6 -0
  1267. package/dist/plugin-sdk/whatsapp/normalize.d.ts +6 -0
  1268. package/dist/plugin-sdk/wizard/prompts.d.ts +42 -0
  1269. package/dist/plugin-sdk/wizard/session.d.ts +42 -0
  1270. package/dist/plugins-CK_wLC2r.js +495 -0
  1271. package/dist/plugins-DSznjxmW.js +496 -0
  1272. package/dist/plugins-cli-BmjLl7Cd.js +441 -0
  1273. package/dist/plugins-cli-D9QNFbou.js +444 -0
  1274. package/dist/ports-BiqbeCmv.js +96 -0
  1275. package/dist/program-DId0vhaP.js +191 -0
  1276. package/dist/progress-Da1ehW-x.js +133 -0
  1277. package/dist/progress-Dt7sIoYI.js +133 -0
  1278. package/dist/prompt-style-DRiVu2Qi.js +9 -0
  1279. package/dist/prompt-style-Dc0C5HC9.js +9 -0
  1280. package/dist/prompts-CXLLIBwP.js +10 -0
  1281. package/dist/prompts-FbZThK8w.js +10 -0
  1282. package/dist/pw-ai-B2s3PF-5.js +1649 -0
  1283. package/dist/pw-ai-BH1WNBfo.js +1649 -0
  1284. package/dist/pw-ai-DzC4QEcy.js +1651 -0
  1285. package/dist/qmd-manager-BYeATj9H.js +617 -0
  1286. package/dist/qmd-manager-CP6WOZee.js +615 -0
  1287. package/dist/qmd-manager-DBylkq-O.js +618 -0
  1288. package/dist/redact-B8YiFlwn.js +97 -0
  1289. package/dist/redact-BIMJ3ntQ.js +94 -0
  1290. package/dist/redact-DJCFY628.js +97 -0
  1291. package/dist/register.subclis-h-lG6x5M.js +348 -0
  1292. package/dist/reply-BQIY73Cp.js +66257 -0
  1293. package/dist/rolldown-runtime-Cbj13DAv.js +20 -0
  1294. package/dist/routes-5IglAVwZ.js +2410 -0
  1295. package/dist/routes-NYlqzYFF.js +2410 -0
  1296. package/dist/rpc-B3CddYuS.js +95 -0
  1297. package/dist/rpc-DRfHHhH_.js +95 -0
  1298. package/dist/run-main-CR3Giw5f.js +194 -0
  1299. package/dist/sandbox-C6Az-1Fp.js +2945 -0
  1300. package/dist/sandbox-VThHZ3Io.js +2944 -0
  1301. package/dist/sandbox-cli-Bh7RS4EG.js +463 -0
  1302. package/dist/sandbox-cli-DcifF-r8.js +460 -0
  1303. package/dist/security-cli-BnKsSbcE.js +508 -0
  1304. package/dist/security-cli-vvOe7Qcs.js +505 -0
  1305. package/dist/server-context-B69ff6gq.js +740 -0
  1306. package/dist/server-context-D-t-yRD6.js +740 -0
  1307. package/dist/server-node-events-BT3emtUC.js +216 -0
  1308. package/dist/server-node-events-UI4hiEIP.js +219 -0
  1309. package/dist/service-BbblpUT5.js +680 -0
  1310. package/dist/service-CYGfiAk2.js +680 -0
  1311. package/dist/service-audit-CzKtNPb1.js +542 -0
  1312. package/dist/service-audit-D4kVQ6jb.js +542 -0
  1313. package/dist/session-cost-usage-C9bgCj2T.js +692 -0
  1314. package/dist/session-cost-usage-DMWtcNjU.js +692 -0
  1315. package/dist/session-key-Dk6vSAOv.js +183 -0
  1316. package/dist/session-key-ezJ78bLC.js +183 -0
  1317. package/dist/shared-BsJRU_sz.js +74 -0
  1318. package/dist/shared-CNGm66Fx.js +74 -0
  1319. package/dist/shared-DveRmOGn.js +150 -0
  1320. package/dist/shared-JRNT7BtY.js +150 -0
  1321. package/dist/skill-scanner-BoGjHXUZ.js +255 -0
  1322. package/dist/skill-scanner-Bp1D9gra.js +255 -0
  1323. package/dist/skills-DQK2ES0C.js +1163 -0
  1324. package/dist/skills-cli-BqioQX95.js +290 -0
  1325. package/dist/skills-cli-DCHeTofx.js +287 -0
  1326. package/dist/skills-kM758c46.js +1164 -0
  1327. package/dist/skills-status-BAchqVPC.js +187 -0
  1328. package/dist/skills-status-CwN0cYYM.js +187 -0
  1329. package/dist/sqlite-B-AYr9M_.js +239 -0
  1330. package/dist/sqlite-DODNHWJb.js +221 -0
  1331. package/dist/sqlite-bgADxnjM.js +239 -0
  1332. package/dist/status-CLnFDZ0P.js +3177 -0
  1333. package/dist/status-CRIEi8Mc.js +21 -0
  1334. package/dist/status-CZfTuv4-.js +27 -0
  1335. package/dist/status-VGh-G-xY.js +27 -0
  1336. package/dist/status-tCu4RWZH.js +21 -0
  1337. package/dist/subsystem-1-F6BAP-.js +834 -0
  1338. package/dist/system-cli-CMP-tiCD.js +80 -0
  1339. package/dist/system-cli-DIxhGFML.js +83 -0
  1340. package/dist/systemd-CZB6clek.js +438 -0
  1341. package/dist/systemd-DD8I7Soi.js +438 -0
  1342. package/dist/systemd-hints-DJT0NgJe.js +19 -0
  1343. package/dist/systemd-hints-kufV4gRh.js +19 -0
  1344. package/dist/systemd-linger-BWRVs7kt.js +75 -0
  1345. package/dist/systemd-linger-BfYGJJmy.js +75 -0
  1346. package/dist/table-C9J8xCsv.js +279 -0
  1347. package/dist/table-DBNjIT3r.js +279 -0
  1348. package/dist/tailnet-Byp3obcc.js +42 -0
  1349. package/dist/tailnet-DLDGNuH2.js +42 -0
  1350. package/dist/tailscale-9MusRvOi.js +225 -0
  1351. package/dist/tailscale-He1MuXiT.js +252 -0
  1352. package/dist/tool-display-DDoVBYci.js +795 -0
  1353. package/dist/tool-display-DFNshYEl.js +795 -0
  1354. package/dist/transcript-events-CZ8CG4ht.js +17 -0
  1355. package/dist/transcript-events-ChU6IQwp.js +17 -0
  1356. package/dist/transcript-events-JLH5W4He.js +17 -0
  1357. package/dist/tui-2fdbEHPX.js +2671 -0
  1358. package/dist/tui-cli-Bqmv8mRp.js +55 -0
  1359. package/dist/tui-cli-COxv8x_5.js +58 -0
  1360. package/dist/tui-sZ_d1-Qt.js +2672 -0
  1361. package/dist/update-CWO51A3N.js +317 -0
  1362. package/dist/update-DoYnQeHo.js +317 -0
  1363. package/dist/update-cli-Bjvc3Fis.js +1036 -0
  1364. package/dist/update-cli-BqFpAE13.js +1034 -0
  1365. package/dist/update-runner-BOArPXbA.js +1458 -0
  1366. package/dist/update-runner-BfODZHQY.js +1458 -0
  1367. package/dist/usage-format-DvowRSs-.js +36 -0
  1368. package/dist/usage-format-E3bMcUMV.js +36 -0
  1369. package/dist/utils-BcIVMaVq.js +192 -0
  1370. package/dist/utils-C1qSQAOk.js +188 -0
  1371. package/dist/webhooks-cli-BgpTUeM3.js +312 -0
  1372. package/dist/webhooks-cli-DVvvhSqu.js +309 -0
  1373. package/dist/widearea-dns-CvO8xXPV.js +127 -0
  1374. package/dist/widearea-dns-DP9Nk9OR.js +127 -0
  1375. package/dist/ws-CEcdsnN9.js +13 -0
  1376. package/dist/ws-D091yo4M.js +13 -0
  1377. package/dist/ws-log-CPCss-ho.js +267 -0
  1378. package/dist/ws-log-Dv6iRbCu.js +267 -0
  1379. package/dist/wsl-DNY0CRR9.js +160 -0
  1380. package/extensions/bluebubbles/README.md +45 -0
  1381. package/extensions/bluebubbles/atlas.plugin.json +9 -0
  1382. package/extensions/bluebubbles/index.ts +19 -0
  1383. package/extensions/bluebubbles/node_modules/.bin/atlas +22 -0
  1384. package/extensions/bluebubbles/package.json +36 -0
  1385. package/extensions/bluebubbles/src/accounts.ts +88 -0
  1386. package/extensions/bluebubbles/src/actions.test.ts +650 -0
  1387. package/extensions/bluebubbles/src/actions.ts +438 -0
  1388. package/extensions/bluebubbles/src/attachments.test.ts +345 -0
  1389. package/extensions/bluebubbles/src/attachments.ts +302 -0
  1390. package/extensions/bluebubbles/src/channel.ts +414 -0
  1391. package/extensions/bluebubbles/src/chat.test.ts +461 -0
  1392. package/extensions/bluebubbles/src/chat.ts +382 -0
  1393. package/extensions/bluebubbles/src/config-schema.ts +51 -0
  1394. package/extensions/bluebubbles/src/media-send.ts +174 -0
  1395. package/extensions/bluebubbles/src/monitor.test.ts +2384 -0
  1396. package/extensions/bluebubbles/src/monitor.ts +2517 -0
  1397. package/extensions/bluebubbles/src/onboarding.ts +352 -0
  1398. package/extensions/bluebubbles/src/probe.ts +144 -0
  1399. package/extensions/bluebubbles/src/reactions.test.ts +392 -0
  1400. package/extensions/bluebubbles/src/reactions.ts +188 -0
  1401. package/extensions/bluebubbles/src/runtime.ts +14 -0
  1402. package/extensions/bluebubbles/src/send.test.ts +889 -0
  1403. package/extensions/bluebubbles/src/send.ts +474 -0
  1404. package/extensions/bluebubbles/src/targets.test.ts +183 -0
  1405. package/extensions/bluebubbles/src/targets.ts +422 -0
  1406. package/extensions/bluebubbles/src/types.ts +127 -0
  1407. package/extensions/copilot-proxy/README.md +24 -0
  1408. package/extensions/copilot-proxy/atlas.plugin.json +9 -0
  1409. package/extensions/copilot-proxy/index.ts +149 -0
  1410. package/extensions/copilot-proxy/node_modules/.bin/atlas +22 -0
  1411. package/extensions/copilot-proxy/package.json +14 -0
  1412. package/extensions/diagnostics-otel/atlas.plugin.json +8 -0
  1413. package/extensions/diagnostics-otel/index.ts +15 -0
  1414. package/extensions/diagnostics-otel/node_modules/.bin/acorn +22 -0
  1415. package/extensions/diagnostics-otel/node_modules/.bin/atlas +22 -0
  1416. package/extensions/diagnostics-otel/package.json +27 -0
  1417. package/extensions/diagnostics-otel/src/service.test.ts +226 -0
  1418. package/extensions/diagnostics-otel/src/service.ts +635 -0
  1419. package/extensions/discord/atlas.plugin.json +9 -0
  1420. package/extensions/discord/index.ts +17 -0
  1421. package/extensions/discord/node_modules/.bin/atlas +22 -0
  1422. package/extensions/discord/package.json +14 -0
  1423. package/extensions/discord/src/channel.ts +422 -0
  1424. package/extensions/discord/src/runtime.ts +14 -0
  1425. package/extensions/feishu/atlas.plugin.json +10 -0
  1426. package/extensions/feishu/index.ts +63 -0
  1427. package/extensions/feishu/node_modules/.bin/atlas +22 -0
  1428. package/extensions/feishu/package.json +37 -0
  1429. package/extensions/feishu/skills/feishu-doc/SKILL.md +105 -0
  1430. package/extensions/feishu/skills/feishu-doc/references/block-types.md +103 -0
  1431. package/extensions/feishu/skills/feishu-drive/SKILL.md +97 -0
  1432. package/extensions/feishu/skills/feishu-perm/SKILL.md +119 -0
  1433. package/extensions/feishu/skills/feishu-wiki/SKILL.md +111 -0
  1434. package/extensions/feishu/src/accounts.ts +144 -0
  1435. package/extensions/feishu/src/bitable.ts +459 -0
  1436. package/extensions/feishu/src/bot.ts +871 -0
  1437. package/extensions/feishu/src/channel.ts +341 -0
  1438. package/extensions/feishu/src/client.ts +118 -0
  1439. package/extensions/feishu/src/config-schema.ts +172 -0
  1440. package/extensions/feishu/src/directory.ts +177 -0
  1441. package/extensions/feishu/src/doc-schema.ts +47 -0
  1442. package/extensions/feishu/src/docx.ts +521 -0
  1443. package/extensions/feishu/src/drive-schema.ts +46 -0
  1444. package/extensions/feishu/src/drive.ts +227 -0
  1445. package/extensions/feishu/src/media.ts +527 -0
  1446. package/extensions/feishu/src/mention.ts +126 -0
  1447. package/extensions/feishu/src/monitor.ts +190 -0
  1448. package/extensions/feishu/src/onboarding.ts +356 -0
  1449. package/extensions/feishu/src/outbound.ts +40 -0
  1450. package/extensions/feishu/src/perm-schema.ts +52 -0
  1451. package/extensions/feishu/src/perm.ts +173 -0
  1452. package/extensions/feishu/src/policy.ts +104 -0
  1453. package/extensions/feishu/src/probe.ts +44 -0
  1454. package/extensions/feishu/src/reactions.ts +160 -0
  1455. package/extensions/feishu/src/reply-dispatcher.ts +184 -0
  1456. package/extensions/feishu/src/runtime.ts +14 -0
  1457. package/extensions/feishu/src/send.ts +358 -0
  1458. package/extensions/feishu/src/targets.ts +78 -0
  1459. package/extensions/feishu/src/tools-config.ts +21 -0
  1460. package/extensions/feishu/src/types.ts +75 -0
  1461. package/extensions/feishu/src/typing.ts +80 -0
  1462. package/extensions/feishu/src/wiki-schema.ts +55 -0
  1463. package/extensions/feishu/src/wiki.ts +232 -0
  1464. package/extensions/google-antigravity-auth/README.md +24 -0
  1465. package/extensions/google-antigravity-auth/atlas.plugin.json +9 -0
  1466. package/extensions/google-antigravity-auth/index.ts +458 -0
  1467. package/extensions/google-antigravity-auth/node_modules/.bin/atlas +22 -0
  1468. package/extensions/google-antigravity-auth/package.json +14 -0
  1469. package/extensions/google-gemini-cli-auth/README.md +35 -0
  1470. package/extensions/google-gemini-cli-auth/atlas.plugin.json +9 -0
  1471. package/extensions/google-gemini-cli-auth/index.ts +88 -0
  1472. package/extensions/google-gemini-cli-auth/node_modules/.bin/atlas +22 -0
  1473. package/extensions/google-gemini-cli-auth/oauth.test.ts +240 -0
  1474. package/extensions/google-gemini-cli-auth/oauth.ts +662 -0
  1475. package/extensions/google-gemini-cli-auth/package.json +14 -0
  1476. package/extensions/googlechat/atlas.plugin.json +9 -0
  1477. package/extensions/googlechat/index.ts +19 -0
  1478. package/extensions/googlechat/node_modules/.bin/atlas +22 -0
  1479. package/extensions/googlechat/package.json +39 -0
  1480. package/extensions/googlechat/src/accounts.ts +147 -0
  1481. package/extensions/googlechat/src/actions.ts +181 -0
  1482. package/extensions/googlechat/src/api.test.ts +61 -0
  1483. package/extensions/googlechat/src/api.ts +282 -0
  1484. package/extensions/googlechat/src/auth.ts +137 -0
  1485. package/extensions/googlechat/src/channel.ts +583 -0
  1486. package/extensions/googlechat/src/monitor.test.ts +22 -0
  1487. package/extensions/googlechat/src/monitor.ts +960 -0
  1488. package/extensions/googlechat/src/onboarding.ts +269 -0
  1489. package/extensions/googlechat/src/runtime.ts +14 -0
  1490. package/extensions/googlechat/src/targets.test.ts +32 -0
  1491. package/extensions/googlechat/src/targets.ts +65 -0
  1492. package/extensions/googlechat/src/types.config.ts +3 -0
  1493. package/extensions/googlechat/src/types.ts +73 -0
  1494. package/extensions/imessage/atlas.plugin.json +9 -0
  1495. package/extensions/imessage/index.ts +17 -0
  1496. package/extensions/imessage/node_modules/.bin/atlas +22 -0
  1497. package/extensions/imessage/package.json +14 -0
  1498. package/extensions/imessage/src/channel.ts +294 -0
  1499. package/extensions/imessage/src/runtime.ts +14 -0
  1500. package/extensions/line/atlas.plugin.json +9 -0
  1501. package/extensions/line/index.ts +19 -0
  1502. package/extensions/line/node_modules/.bin/atlas +22 -0
  1503. package/extensions/line/package.json +29 -0
  1504. package/extensions/line/src/card-command.ts +344 -0
  1505. package/extensions/line/src/channel.logout.test.ts +99 -0
  1506. package/extensions/line/src/channel.sendPayload.test.ts +306 -0
  1507. package/extensions/line/src/channel.ts +780 -0
  1508. package/extensions/line/src/runtime.ts +14 -0
  1509. package/extensions/llm-task/README.md +97 -0
  1510. package/extensions/llm-task/atlas.plugin.json +21 -0
  1511. package/extensions/llm-task/index.ts +6 -0
  1512. package/extensions/llm-task/node_modules/.bin/atlas +22 -0
  1513. package/extensions/llm-task/package.json +14 -0
  1514. package/extensions/llm-task/src/llm-task-tool.test.ts +138 -0
  1515. package/extensions/llm-task/src/llm-task-tool.ts +245 -0
  1516. package/extensions/lobster/README.md +75 -0
  1517. package/extensions/lobster/SKILL.md +97 -0
  1518. package/extensions/lobster/atlas.plugin.json +10 -0
  1519. package/extensions/lobster/index.ts +14 -0
  1520. package/extensions/lobster/node_modules/.bin/atlas +22 -0
  1521. package/extensions/lobster/package.json +14 -0
  1522. package/extensions/lobster/src/lobster-tool.test.ts +247 -0
  1523. package/extensions/lobster/src/lobster-tool.ts +328 -0
  1524. package/extensions/matrix/CHANGELOG.md +111 -0
  1525. package/extensions/matrix/atlas.plugin.json +9 -0
  1526. package/extensions/matrix/index.ts +17 -0
  1527. package/extensions/matrix/node_modules/.bin/atlas +22 -0
  1528. package/extensions/matrix/node_modules/.bin/markdown-it +22 -0
  1529. package/extensions/matrix/package.json +36 -0
  1530. package/extensions/matrix/src/actions.ts +195 -0
  1531. package/extensions/matrix/src/channel.directory.test.ts +64 -0
  1532. package/extensions/matrix/src/channel.ts +439 -0
  1533. package/extensions/matrix/src/config-schema.ts +63 -0
  1534. package/extensions/matrix/src/directory-live.ts +188 -0
  1535. package/extensions/matrix/src/group-mentions.ts +66 -0
  1536. package/extensions/matrix/src/matrix/accounts.test.ts +82 -0
  1537. package/extensions/matrix/src/matrix/accounts.ts +65 -0
  1538. package/extensions/matrix/src/matrix/actions/client.ts +57 -0
  1539. package/extensions/matrix/src/matrix/actions/messages.ts +128 -0
  1540. package/extensions/matrix/src/matrix/actions/pins.ts +76 -0
  1541. package/extensions/matrix/src/matrix/actions/reactions.ts +96 -0
  1542. package/extensions/matrix/src/matrix/actions/room.ts +85 -0
  1543. package/extensions/matrix/src/matrix/actions/summary.ts +75 -0
  1544. package/extensions/matrix/src/matrix/actions/types.ts +84 -0
  1545. package/extensions/matrix/src/matrix/actions.ts +15 -0
  1546. package/extensions/matrix/src/matrix/active-client.ts +11 -0
  1547. package/extensions/matrix/src/matrix/client/config.ts +160 -0
  1548. package/extensions/matrix/src/matrix/client/create-client.ts +123 -0
  1549. package/extensions/matrix/src/matrix/client/logging.ts +36 -0
  1550. package/extensions/matrix/src/matrix/client/runtime.ts +4 -0
  1551. package/extensions/matrix/src/matrix/client/shared.ts +170 -0
  1552. package/extensions/matrix/src/matrix/client/storage.ts +131 -0
  1553. package/extensions/matrix/src/matrix/client/types.ts +34 -0
  1554. package/extensions/matrix/src/matrix/client.test.ts +56 -0
  1555. package/extensions/matrix/src/matrix/client.ts +5 -0
  1556. package/extensions/matrix/src/matrix/credentials.ts +105 -0
  1557. package/extensions/matrix/src/matrix/deps.ts +60 -0
  1558. package/extensions/matrix/src/matrix/format.test.ts +33 -0
  1559. package/extensions/matrix/src/matrix/format.ts +22 -0
  1560. package/extensions/matrix/src/matrix/index.ts +11 -0
  1561. package/extensions/matrix/src/matrix/monitor/allowlist.test.ts +45 -0
  1562. package/extensions/matrix/src/matrix/monitor/allowlist.ts +103 -0
  1563. package/extensions/matrix/src/matrix/monitor/auto-join.ts +71 -0
  1564. package/extensions/matrix/src/matrix/monitor/direct.ts +104 -0
  1565. package/extensions/matrix/src/matrix/monitor/events.ts +101 -0
  1566. package/extensions/matrix/src/matrix/monitor/handler.ts +665 -0
  1567. package/extensions/matrix/src/matrix/monitor/index.ts +338 -0
  1568. package/extensions/matrix/src/matrix/monitor/location.ts +100 -0
  1569. package/extensions/matrix/src/matrix/monitor/media.test.ts +102 -0
  1570. package/extensions/matrix/src/matrix/monitor/media.ts +113 -0
  1571. package/extensions/matrix/src/matrix/monitor/mentions.ts +31 -0
  1572. package/extensions/matrix/src/matrix/monitor/replies.ts +97 -0
  1573. package/extensions/matrix/src/matrix/monitor/room-info.ts +55 -0
  1574. package/extensions/matrix/src/matrix/monitor/rooms.test.ts +39 -0
  1575. package/extensions/matrix/src/matrix/monitor/rooms.ts +47 -0
  1576. package/extensions/matrix/src/matrix/monitor/threads.ts +68 -0
  1577. package/extensions/matrix/src/matrix/monitor/types.ts +39 -0
  1578. package/extensions/matrix/src/matrix/poll-types.test.ts +21 -0
  1579. package/extensions/matrix/src/matrix/poll-types.ts +166 -0
  1580. package/extensions/matrix/src/matrix/probe.ts +70 -0
  1581. package/extensions/matrix/src/matrix/send/client.ts +66 -0
  1582. package/extensions/matrix/src/matrix/send/formatting.ts +89 -0
  1583. package/extensions/matrix/src/matrix/send/media.ts +229 -0
  1584. package/extensions/matrix/src/matrix/send/targets.test.ts +98 -0
  1585. package/extensions/matrix/src/matrix/send/targets.ts +147 -0
  1586. package/extensions/matrix/src/matrix/send/types.ts +109 -0
  1587. package/extensions/matrix/src/matrix/send.test.ts +171 -0
  1588. package/extensions/matrix/src/matrix/send.ts +260 -0
  1589. package/extensions/matrix/src/onboarding.ts +449 -0
  1590. package/extensions/matrix/src/outbound.ts +52 -0
  1591. package/extensions/matrix/src/resolve-targets.test.ts +48 -0
  1592. package/extensions/matrix/src/resolve-targets.ts +135 -0
  1593. package/extensions/matrix/src/runtime.ts +14 -0
  1594. package/extensions/matrix/src/tool-actions.ts +164 -0
  1595. package/extensions/matrix/src/types.ts +97 -0
  1596. package/extensions/mattermost/atlas.plugin.json +9 -0
  1597. package/extensions/mattermost/index.ts +17 -0
  1598. package/extensions/mattermost/node_modules/.bin/atlas +22 -0
  1599. package/extensions/mattermost/package.json +28 -0
  1600. package/extensions/mattermost/src/channel.test.ts +72 -0
  1601. package/extensions/mattermost/src/channel.ts +337 -0
  1602. package/extensions/mattermost/src/config-schema.ts +56 -0
  1603. package/extensions/mattermost/src/group-mentions.ts +15 -0
  1604. package/extensions/mattermost/src/mattermost/accounts.ts +128 -0
  1605. package/extensions/mattermost/src/mattermost/client.ts +220 -0
  1606. package/extensions/mattermost/src/mattermost/index.ts +9 -0
  1607. package/extensions/mattermost/src/mattermost/monitor-helpers.ts +166 -0
  1608. package/extensions/mattermost/src/mattermost/monitor.ts +991 -0
  1609. package/extensions/mattermost/src/mattermost/probe.ts +74 -0
  1610. package/extensions/mattermost/src/mattermost/send.ts +231 -0
  1611. package/extensions/mattermost/src/normalize.ts +46 -0
  1612. package/extensions/mattermost/src/onboarding-helpers.ts +44 -0
  1613. package/extensions/mattermost/src/onboarding.ts +186 -0
  1614. package/extensions/mattermost/src/runtime.ts +14 -0
  1615. package/extensions/mattermost/src/types.ts +52 -0
  1616. package/extensions/memory-core/atlas.plugin.json +9 -0
  1617. package/extensions/memory-core/index.ts +38 -0
  1618. package/extensions/memory-core/node_modules/.bin/atlas +22 -0
  1619. package/extensions/memory-core/package.json +17 -0
  1620. package/extensions/memory-lancedb/atlas.plugin.json +60 -0
  1621. package/extensions/memory-lancedb/config.ts +139 -0
  1622. package/extensions/memory-lancedb/index.test.ts +295 -0
  1623. package/extensions/memory-lancedb/index.ts +622 -0
  1624. package/extensions/memory-lancedb/node_modules/.bin/arrow2csv +22 -0
  1625. package/extensions/memory-lancedb/node_modules/.bin/atlas +22 -0
  1626. package/extensions/memory-lancedb/node_modules/.bin/openai +22 -0
  1627. package/extensions/memory-lancedb/package.json +19 -0
  1628. package/extensions/minimax-portal-auth/README.md +33 -0
  1629. package/extensions/minimax-portal-auth/atlas.plugin.json +9 -0
  1630. package/extensions/minimax-portal-auth/index.ts +155 -0
  1631. package/extensions/minimax-portal-auth/node_modules/.bin/atlas +22 -0
  1632. package/extensions/minimax-portal-auth/oauth.ts +247 -0
  1633. package/extensions/minimax-portal-auth/package.json +14 -0
  1634. package/extensions/msteams/CHANGELOG.md +107 -0
  1635. package/extensions/msteams/atlas.plugin.json +9 -0
  1636. package/extensions/msteams/index.ts +17 -0
  1637. package/extensions/msteams/node_modules/.bin/atlas +22 -0
  1638. package/extensions/msteams/package.json +39 -0
  1639. package/extensions/msteams/src/attachments/download.ts +283 -0
  1640. package/extensions/msteams/src/attachments/graph.ts +353 -0
  1641. package/extensions/msteams/src/attachments/html.ts +90 -0
  1642. package/extensions/msteams/src/attachments/payload.ts +22 -0
  1643. package/extensions/msteams/src/attachments/shared.ts +291 -0
  1644. package/extensions/msteams/src/attachments/types.ts +37 -0
  1645. package/extensions/msteams/src/attachments.test.ts +459 -0
  1646. package/extensions/msteams/src/attachments.ts +18 -0
  1647. package/extensions/msteams/src/channel.directory.test.ts +48 -0
  1648. package/extensions/msteams/src/channel.ts +459 -0
  1649. package/extensions/msteams/src/conversation-store-fs.test.ts +88 -0
  1650. package/extensions/msteams/src/conversation-store-fs.ts +165 -0
  1651. package/extensions/msteams/src/conversation-store-memory.ts +47 -0
  1652. package/extensions/msteams/src/conversation-store.ts +41 -0
  1653. package/extensions/msteams/src/directory-live.ts +205 -0
  1654. package/extensions/msteams/src/errors.test.ts +45 -0
  1655. package/extensions/msteams/src/errors.ts +190 -0
  1656. package/extensions/msteams/src/file-consent-helpers.test.ts +243 -0
  1657. package/extensions/msteams/src/file-consent-helpers.ts +73 -0
  1658. package/extensions/msteams/src/file-consent.ts +126 -0
  1659. package/extensions/msteams/src/graph-chat.ts +53 -0
  1660. package/extensions/msteams/src/graph-upload.ts +453 -0
  1661. package/extensions/msteams/src/inbound.test.ts +66 -0
  1662. package/extensions/msteams/src/inbound.ts +48 -0
  1663. package/extensions/msteams/src/index.ts +4 -0
  1664. package/extensions/msteams/src/media-helpers.test.ts +189 -0
  1665. package/extensions/msteams/src/media-helpers.ts +86 -0
  1666. package/extensions/msteams/src/messenger.test.ts +248 -0
  1667. package/extensions/msteams/src/messenger.ts +495 -0
  1668. package/extensions/msteams/src/monitor-handler/inbound-media.ts +128 -0
  1669. package/extensions/msteams/src/monitor-handler/message-handler.ts +641 -0
  1670. package/extensions/msteams/src/monitor-handler.ts +162 -0
  1671. package/extensions/msteams/src/monitor-types.ts +5 -0
  1672. package/extensions/msteams/src/monitor.ts +295 -0
  1673. package/extensions/msteams/src/onboarding.ts +431 -0
  1674. package/extensions/msteams/src/outbound.ts +46 -0
  1675. package/extensions/msteams/src/pending-uploads.ts +89 -0
  1676. package/extensions/msteams/src/policy.test.ts +209 -0
  1677. package/extensions/msteams/src/policy.ts +273 -0
  1678. package/extensions/msteams/src/polls-store-memory.ts +32 -0
  1679. package/extensions/msteams/src/polls-store.test.ts +38 -0
  1680. package/extensions/msteams/src/polls.test.ts +72 -0
  1681. package/extensions/msteams/src/polls.ts +315 -0
  1682. package/extensions/msteams/src/probe.test.ts +58 -0
  1683. package/extensions/msteams/src/probe.ts +107 -0
  1684. package/extensions/msteams/src/reply-dispatcher.ts +132 -0
  1685. package/extensions/msteams/src/resolve-allowlist.ts +297 -0
  1686. package/extensions/msteams/src/runtime.ts +14 -0
  1687. package/extensions/msteams/src/sdk-types.ts +19 -0
  1688. package/extensions/msteams/src/sdk.ts +33 -0
  1689. package/extensions/msteams/src/send-context.ts +164 -0
  1690. package/extensions/msteams/src/send.ts +519 -0
  1691. package/extensions/msteams/src/sent-message-cache.test.ts +15 -0
  1692. package/extensions/msteams/src/sent-message-cache.ts +47 -0
  1693. package/extensions/msteams/src/storage.ts +25 -0
  1694. package/extensions/msteams/src/store-fs.ts +83 -0
  1695. package/extensions/msteams/src/token.ts +19 -0
  1696. package/extensions/nextcloud-talk/atlas.plugin.json +9 -0
  1697. package/extensions/nextcloud-talk/index.ts +17 -0
  1698. package/extensions/nextcloud-talk/node_modules/.bin/atlas +22 -0
  1699. package/extensions/nextcloud-talk/package.json +33 -0
  1700. package/extensions/nextcloud-talk/src/accounts.ts +174 -0
  1701. package/extensions/nextcloud-talk/src/channel.ts +409 -0
  1702. package/extensions/nextcloud-talk/src/config-schema.ts +79 -0
  1703. package/extensions/nextcloud-talk/src/format.ts +79 -0
  1704. package/extensions/nextcloud-talk/src/inbound.ts +327 -0
  1705. package/extensions/nextcloud-talk/src/monitor.ts +246 -0
  1706. package/extensions/nextcloud-talk/src/normalize.ts +39 -0
  1707. package/extensions/nextcloud-talk/src/onboarding.ts +343 -0
  1708. package/extensions/nextcloud-talk/src/policy.test.ts +33 -0
  1709. package/extensions/nextcloud-talk/src/policy.ts +180 -0
  1710. package/extensions/nextcloud-talk/src/room-info.ts +125 -0
  1711. package/extensions/nextcloud-talk/src/runtime.ts +14 -0
  1712. package/extensions/nextcloud-talk/src/send.ts +215 -0
  1713. package/extensions/nextcloud-talk/src/signature.ts +72 -0
  1714. package/extensions/nextcloud-talk/src/types.ts +181 -0
  1715. package/extensions/nostr/CHANGELOG.md +98 -0
  1716. package/extensions/nostr/README.md +136 -0
  1717. package/extensions/nostr/atlas.plugin.json +9 -0
  1718. package/extensions/nostr/index.ts +68 -0
  1719. package/extensions/nostr/node_modules/.bin/atlas +22 -0
  1720. package/extensions/nostr/node_modules/.bin/tsc +22 -0
  1721. package/extensions/nostr/node_modules/.bin/tsserver +22 -0
  1722. package/extensions/nostr/package.json +34 -0
  1723. package/extensions/nostr/src/channel.test.ts +151 -0
  1724. package/extensions/nostr/src/channel.ts +353 -0
  1725. package/extensions/nostr/src/config-schema.ts +90 -0
  1726. package/extensions/nostr/src/metrics.ts +478 -0
  1727. package/extensions/nostr/src/nostr-bus.fuzz.test.ts +533 -0
  1728. package/extensions/nostr/src/nostr-bus.integration.test.ts +448 -0
  1729. package/extensions/nostr/src/nostr-bus.test.ts +199 -0
  1730. package/extensions/nostr/src/nostr-bus.ts +715 -0
  1731. package/extensions/nostr/src/nostr-profile-http.test.ts +378 -0
  1732. package/extensions/nostr/src/nostr-profile-http.ts +546 -0
  1733. package/extensions/nostr/src/nostr-profile-import.test.ts +119 -0
  1734. package/extensions/nostr/src/nostr-profile-import.ts +262 -0
  1735. package/extensions/nostr/src/nostr-profile.fuzz.test.ts +477 -0
  1736. package/extensions/nostr/src/nostr-profile.test.ts +410 -0
  1737. package/extensions/nostr/src/nostr-profile.ts +277 -0
  1738. package/extensions/nostr/src/nostr-state-store.test.ts +131 -0
  1739. package/extensions/nostr/src/nostr-state-store.ts +226 -0
  1740. package/extensions/nostr/src/runtime.ts +14 -0
  1741. package/extensions/nostr/src/seen-tracker.ts +303 -0
  1742. package/extensions/nostr/src/types.test.ts +157 -0
  1743. package/extensions/nostr/src/types.ts +101 -0
  1744. package/extensions/nostr/test/setup.ts +5 -0
  1745. package/extensions/open-prose/README.md +25 -0
  1746. package/extensions/open-prose/atlas.plugin.json +11 -0
  1747. package/extensions/open-prose/index.ts +5 -0
  1748. package/extensions/open-prose/node_modules/.bin/atlas +22 -0
  1749. package/extensions/open-prose/package.json +14 -0
  1750. package/extensions/open-prose/skills/prose/LICENSE +21 -0
  1751. package/extensions/open-prose/skills/prose/SKILL.md +323 -0
  1752. package/extensions/open-prose/skills/prose/alt-borges.md +141 -0
  1753. package/extensions/open-prose/skills/prose/alts/arabian-nights.md +358 -0
  1754. package/extensions/open-prose/skills/prose/alts/borges.md +360 -0
  1755. package/extensions/open-prose/skills/prose/alts/folk.md +322 -0
  1756. package/extensions/open-prose/skills/prose/alts/homer.md +346 -0
  1757. package/extensions/open-prose/skills/prose/alts/kafka.md +373 -0
  1758. package/extensions/open-prose/skills/prose/compiler.md +2971 -0
  1759. package/extensions/open-prose/skills/prose/examples/01-hello-world.prose +4 -0
  1760. package/extensions/open-prose/skills/prose/examples/02-research-and-summarize.prose +6 -0
  1761. package/extensions/open-prose/skills/prose/examples/03-code-review.prose +17 -0
  1762. package/extensions/open-prose/skills/prose/examples/04-write-and-refine.prose +14 -0
  1763. package/extensions/open-prose/skills/prose/examples/05-debug-issue.prose +20 -0
  1764. package/extensions/open-prose/skills/prose/examples/06-explain-codebase.prose +17 -0
  1765. package/extensions/open-prose/skills/prose/examples/07-refactor.prose +20 -0
  1766. package/extensions/open-prose/skills/prose/examples/08-blog-post.prose +20 -0
  1767. package/extensions/open-prose/skills/prose/examples/09-research-with-agents.prose +25 -0
  1768. package/extensions/open-prose/skills/prose/examples/10-code-review-agents.prose +32 -0
  1769. package/extensions/open-prose/skills/prose/examples/11-skills-and-imports.prose +27 -0
  1770. package/extensions/open-prose/skills/prose/examples/12-secure-agent-permissions.prose +43 -0
  1771. package/extensions/open-prose/skills/prose/examples/13-variables-and-context.prose +51 -0
  1772. package/extensions/open-prose/skills/prose/examples/14-composition-blocks.prose +48 -0
  1773. package/extensions/open-prose/skills/prose/examples/15-inline-sequences.prose +23 -0
  1774. package/extensions/open-prose/skills/prose/examples/16-parallel-reviews.prose +19 -0
  1775. package/extensions/open-prose/skills/prose/examples/17-parallel-research.prose +19 -0
  1776. package/extensions/open-prose/skills/prose/examples/18-mixed-parallel-sequential.prose +36 -0
  1777. package/extensions/open-prose/skills/prose/examples/19-advanced-parallel.prose +71 -0
  1778. package/extensions/open-prose/skills/prose/examples/20-fixed-loops.prose +20 -0
  1779. package/extensions/open-prose/skills/prose/examples/21-pipeline-operations.prose +35 -0
  1780. package/extensions/open-prose/skills/prose/examples/22-error-handling.prose +51 -0
  1781. package/extensions/open-prose/skills/prose/examples/23-retry-with-backoff.prose +63 -0
  1782. package/extensions/open-prose/skills/prose/examples/24-choice-blocks.prose +86 -0
  1783. package/extensions/open-prose/skills/prose/examples/25-conditionals.prose +114 -0
  1784. package/extensions/open-prose/skills/prose/examples/26-parameterized-blocks.prose +100 -0
  1785. package/extensions/open-prose/skills/prose/examples/27-string-interpolation.prose +105 -0
  1786. package/extensions/open-prose/skills/prose/examples/28-automated-pr-review.prose +37 -0
  1787. package/extensions/open-prose/skills/prose/examples/28-gas-town.prose +1572 -0
  1788. package/extensions/open-prose/skills/prose/examples/29-captains-chair.prose +218 -0
  1789. package/extensions/open-prose/skills/prose/examples/30-captains-chair-simple.prose +42 -0
  1790. package/extensions/open-prose/skills/prose/examples/31-captains-chair-with-memory.prose +145 -0
  1791. package/extensions/open-prose/skills/prose/examples/33-pr-review-autofix.prose +168 -0
  1792. package/extensions/open-prose/skills/prose/examples/34-content-pipeline.prose +204 -0
  1793. package/extensions/open-prose/skills/prose/examples/35-feature-factory.prose +296 -0
  1794. package/extensions/open-prose/skills/prose/examples/36-bug-hunter.prose +237 -0
  1795. package/extensions/open-prose/skills/prose/examples/37-the-forge.prose +1474 -0
  1796. package/extensions/open-prose/skills/prose/examples/38-skill-scan.prose +455 -0
  1797. package/extensions/open-prose/skills/prose/examples/39-architect-by-simulation.prose +277 -0
  1798. package/extensions/open-prose/skills/prose/examples/40-rlm-self-refine.prose +32 -0
  1799. package/extensions/open-prose/skills/prose/examples/41-rlm-divide-conquer.prose +38 -0
  1800. package/extensions/open-prose/skills/prose/examples/42-rlm-filter-recurse.prose +46 -0
  1801. package/extensions/open-prose/skills/prose/examples/43-rlm-pairwise.prose +50 -0
  1802. package/extensions/open-prose/skills/prose/examples/44-run-endpoint-ux-test.prose +261 -0
  1803. package/extensions/open-prose/skills/prose/examples/45-plugin-release.prose +159 -0
  1804. package/extensions/open-prose/skills/prose/examples/45-run-endpoint-ux-test-with-remediation.prose +637 -0
  1805. package/extensions/open-prose/skills/prose/examples/46-run-endpoint-ux-test-fast.prose +148 -0
  1806. package/extensions/open-prose/skills/prose/examples/46-workflow-crystallizer.prose +225 -0
  1807. package/extensions/open-prose/skills/prose/examples/47-language-self-improvement.prose +356 -0
  1808. package/extensions/open-prose/skills/prose/examples/48-habit-miner.prose +445 -0
  1809. package/extensions/open-prose/skills/prose/examples/49-prose-run-retrospective.prose +210 -0
  1810. package/extensions/open-prose/skills/prose/examples/README.md +391 -0
  1811. package/extensions/open-prose/skills/prose/examples/roadmap/README.md +22 -0
  1812. package/extensions/open-prose/skills/prose/examples/roadmap/iterative-refinement.prose +20 -0
  1813. package/extensions/open-prose/skills/prose/examples/roadmap/parallel-review.prose +18 -0
  1814. package/extensions/open-prose/skills/prose/examples/roadmap/simple-pipeline.prose +17 -0
  1815. package/extensions/open-prose/skills/prose/examples/roadmap/syntax/open-prose-syntax.prose +223 -0
  1816. package/extensions/open-prose/skills/prose/guidance/antipatterns.md +951 -0
  1817. package/extensions/open-prose/skills/prose/guidance/patterns.md +700 -0
  1818. package/extensions/open-prose/skills/prose/guidance/system-prompt.md +180 -0
  1819. package/extensions/open-prose/skills/prose/help.md +144 -0
  1820. package/extensions/open-prose/skills/prose/lib/README.md +108 -0
  1821. package/extensions/open-prose/skills/prose/lib/calibrator.prose +215 -0
  1822. package/extensions/open-prose/skills/prose/lib/cost-analyzer.prose +174 -0
  1823. package/extensions/open-prose/skills/prose/lib/error-forensics.prose +250 -0
  1824. package/extensions/open-prose/skills/prose/lib/inspector.prose +196 -0
  1825. package/extensions/open-prose/skills/prose/lib/profiler.prose +460 -0
  1826. package/extensions/open-prose/skills/prose/lib/program-improver.prose +275 -0
  1827. package/extensions/open-prose/skills/prose/lib/project-memory.prose +118 -0
  1828. package/extensions/open-prose/skills/prose/lib/user-memory.prose +93 -0
  1829. package/extensions/open-prose/skills/prose/lib/vm-improver.prose +243 -0
  1830. package/extensions/open-prose/skills/prose/primitives/session.md +593 -0
  1831. package/extensions/open-prose/skills/prose/prose.md +1237 -0
  1832. package/extensions/open-prose/skills/prose/state/filesystem.md +498 -0
  1833. package/extensions/open-prose/skills/prose/state/in-context.md +384 -0
  1834. package/extensions/open-prose/skills/prose/state/postgres.md +880 -0
  1835. package/extensions/open-prose/skills/prose/state/sqlite.md +574 -0
  1836. package/extensions/qwen-portal-auth/README.md +24 -0
  1837. package/extensions/qwen-portal-auth/atlas.plugin.json +9 -0
  1838. package/extensions/qwen-portal-auth/index.ts +130 -0
  1839. package/extensions/qwen-portal-auth/oauth.ts +190 -0
  1840. package/extensions/signal/atlas.plugin.json +9 -0
  1841. package/extensions/signal/index.ts +17 -0
  1842. package/extensions/signal/node_modules/.bin/atlas +22 -0
  1843. package/extensions/signal/package.json +14 -0
  1844. package/extensions/signal/src/channel.ts +315 -0
  1845. package/extensions/signal/src/runtime.ts +14 -0
  1846. package/extensions/slack/atlas.plugin.json +9 -0
  1847. package/extensions/slack/index.ts +17 -0
  1848. package/extensions/slack/node_modules/.bin/atlas +22 -0
  1849. package/extensions/slack/package.json +14 -0
  1850. package/extensions/slack/src/channel.ts +604 -0
  1851. package/extensions/slack/src/runtime.ts +14 -0
  1852. package/extensions/telegram/atlas.plugin.json +9 -0
  1853. package/extensions/telegram/index.ts +17 -0
  1854. package/extensions/telegram/node_modules/.bin/atlas +22 -0
  1855. package/extensions/telegram/package.json +14 -0
  1856. package/extensions/telegram/src/channel.ts +482 -0
  1857. package/extensions/telegram/src/runtime.ts +14 -0
  1858. package/extensions/tlon/README.md +5 -0
  1859. package/extensions/tlon/atlas.plugin.json +9 -0
  1860. package/extensions/tlon/index.ts +17 -0
  1861. package/extensions/tlon/node_modules/.bin/atlas +22 -0
  1862. package/extensions/tlon/package.json +33 -0
  1863. package/extensions/tlon/src/channel.ts +392 -0
  1864. package/extensions/tlon/src/config-schema.test.ts +31 -0
  1865. package/extensions/tlon/src/config-schema.ts +45 -0
  1866. package/extensions/tlon/src/monitor/discovery.ts +76 -0
  1867. package/extensions/tlon/src/monitor/history.ts +90 -0
  1868. package/extensions/tlon/src/monitor/index.ts +580 -0
  1869. package/extensions/tlon/src/monitor/processed-messages.test.ts +23 -0
  1870. package/extensions/tlon/src/monitor/processed-messages.ts +46 -0
  1871. package/extensions/tlon/src/monitor/utils.ts +106 -0
  1872. package/extensions/tlon/src/onboarding.ts +214 -0
  1873. package/extensions/tlon/src/runtime.ts +14 -0
  1874. package/extensions/tlon/src/targets.ts +89 -0
  1875. package/extensions/tlon/src/types.ts +92 -0
  1876. package/extensions/tlon/src/urbit/auth.ts +18 -0
  1877. package/extensions/tlon/src/urbit/http-api.ts +38 -0
  1878. package/extensions/tlon/src/urbit/send.test.ts +38 -0
  1879. package/extensions/tlon/src/urbit/send.ts +131 -0
  1880. package/extensions/tlon/src/urbit/sse-client.test.ts +40 -0
  1881. package/extensions/tlon/src/urbit/sse-client.ts +395 -0
  1882. package/extensions/twitch/CHANGELOG.md +69 -0
  1883. package/extensions/twitch/README.md +89 -0
  1884. package/extensions/twitch/atlas.plugin.json +9 -0
  1885. package/extensions/twitch/index.ts +20 -0
  1886. package/extensions/twitch/node_modules/.bin/atlas +22 -0
  1887. package/extensions/twitch/package.json +20 -0
  1888. package/extensions/twitch/src/access-control.test.ts +489 -0
  1889. package/extensions/twitch/src/access-control.ts +166 -0
  1890. package/extensions/twitch/src/actions.ts +173 -0
  1891. package/extensions/twitch/src/client-manager-registry.ts +115 -0
  1892. package/extensions/twitch/src/config-schema.ts +84 -0
  1893. package/extensions/twitch/src/config.test.ts +87 -0
  1894. package/extensions/twitch/src/config.ts +116 -0
  1895. package/extensions/twitch/src/monitor.ts +272 -0
  1896. package/extensions/twitch/src/onboarding.test.ts +311 -0
  1897. package/extensions/twitch/src/onboarding.ts +417 -0
  1898. package/extensions/twitch/src/outbound.test.ts +373 -0
  1899. package/extensions/twitch/src/outbound.ts +184 -0
  1900. package/extensions/twitch/src/plugin.test.ts +39 -0
  1901. package/extensions/twitch/src/plugin.ts +274 -0
  1902. package/extensions/twitch/src/probe.test.ts +195 -0
  1903. package/extensions/twitch/src/probe.ts +120 -0
  1904. package/extensions/twitch/src/resolver.ts +137 -0
  1905. package/extensions/twitch/src/runtime.ts +14 -0
  1906. package/extensions/twitch/src/send.test.ts +289 -0
  1907. package/extensions/twitch/src/send.ts +136 -0
  1908. package/extensions/twitch/src/status.test.ts +270 -0
  1909. package/extensions/twitch/src/status.ts +178 -0
  1910. package/extensions/twitch/src/token.test.ts +171 -0
  1911. package/extensions/twitch/src/token.ts +91 -0
  1912. package/extensions/twitch/src/twitch-client.test.ts +589 -0
  1913. package/extensions/twitch/src/twitch-client.ts +277 -0
  1914. package/extensions/twitch/src/types.ts +143 -0
  1915. package/extensions/twitch/src/utils/markdown.ts +98 -0
  1916. package/extensions/twitch/src/utils/twitch.ts +78 -0
  1917. package/extensions/twitch/test/setup.ts +7 -0
  1918. package/extensions/voice-call/CHANGELOG.md +133 -0
  1919. package/extensions/voice-call/README.md +139 -0
  1920. package/extensions/voice-call/atlas.plugin.json +559 -0
  1921. package/extensions/voice-call/index.ts +493 -0
  1922. package/extensions/voice-call/node_modules/.bin/atlas +22 -0
  1923. package/extensions/voice-call/package.json +19 -0
  1924. package/extensions/voice-call/src/allowlist.ts +19 -0
  1925. package/extensions/voice-call/src/cli.ts +279 -0
  1926. package/extensions/voice-call/src/config.test.ts +234 -0
  1927. package/extensions/voice-call/src/config.ts +523 -0
  1928. package/extensions/voice-call/src/core-bridge.ts +159 -0
  1929. package/extensions/voice-call/src/manager/context.ts +21 -0
  1930. package/extensions/voice-call/src/manager/events.ts +188 -0
  1931. package/extensions/voice-call/src/manager/lookup.ts +35 -0
  1932. package/extensions/voice-call/src/manager/outbound.ts +275 -0
  1933. package/extensions/voice-call/src/manager/state.ts +48 -0
  1934. package/extensions/voice-call/src/manager/store.ts +91 -0
  1935. package/extensions/voice-call/src/manager/timers.ts +89 -0
  1936. package/extensions/voice-call/src/manager/twiml.ts +9 -0
  1937. package/extensions/voice-call/src/manager.test.ts +224 -0
  1938. package/extensions/voice-call/src/manager.ts +887 -0
  1939. package/extensions/voice-call/src/media-stream.test.ts +96 -0
  1940. package/extensions/voice-call/src/media-stream.ts +411 -0
  1941. package/extensions/voice-call/src/providers/base.ts +67 -0
  1942. package/extensions/voice-call/src/providers/index.ts +10 -0
  1943. package/extensions/voice-call/src/providers/mock.ts +165 -0
  1944. package/extensions/voice-call/src/providers/plivo.test.ts +27 -0
  1945. package/extensions/voice-call/src/providers/plivo.ts +515 -0
  1946. package/extensions/voice-call/src/providers/stt-openai-realtime.ts +311 -0
  1947. package/extensions/voice-call/src/providers/telnyx.ts +371 -0
  1948. package/extensions/voice-call/src/providers/tts-openai.ts +259 -0
  1949. package/extensions/voice-call/src/providers/twilio/api.ts +42 -0
  1950. package/extensions/voice-call/src/providers/twilio/webhook.ts +32 -0
  1951. package/extensions/voice-call/src/providers/twilio.test.ts +60 -0
  1952. package/extensions/voice-call/src/providers/twilio.ts +626 -0
  1953. package/extensions/voice-call/src/response-generator.ts +158 -0
  1954. package/extensions/voice-call/src/runtime.ts +212 -0
  1955. package/extensions/voice-call/src/telephony-audio.ts +90 -0
  1956. package/extensions/voice-call/src/telephony-tts.ts +104 -0
  1957. package/extensions/voice-call/src/tunnel.ts +314 -0
  1958. package/extensions/voice-call/src/types.ts +272 -0
  1959. package/extensions/voice-call/src/utils.ts +14 -0
  1960. package/extensions/voice-call/src/voice-mapping.ts +67 -0
  1961. package/extensions/voice-call/src/webhook-security.test.ts +377 -0
  1962. package/extensions/voice-call/src/webhook-security.ts +689 -0
  1963. package/extensions/voice-call/src/webhook.ts +516 -0
  1964. package/extensions/whatsapp/atlas.plugin.json +9 -0
  1965. package/extensions/whatsapp/index.ts +17 -0
  1966. package/extensions/whatsapp/node_modules/.bin/atlas +22 -0
  1967. package/extensions/whatsapp/package.json +14 -0
  1968. package/extensions/whatsapp/src/channel.ts +508 -0
  1969. package/extensions/whatsapp/src/runtime.ts +14 -0
  1970. package/extensions/zalo/CHANGELOG.md +113 -0
  1971. package/extensions/zalo/README.md +50 -0
  1972. package/extensions/zalo/atlas.plugin.json +9 -0
  1973. package/extensions/zalo/index.ts +19 -0
  1974. package/extensions/zalo/node_modules/.bin/atlas +22 -0
  1975. package/extensions/zalo/package.json +36 -0
  1976. package/extensions/zalo/src/accounts.ts +80 -0
  1977. package/extensions/zalo/src/actions.ts +67 -0
  1978. package/extensions/zalo/src/api.ts +208 -0
  1979. package/extensions/zalo/src/channel.directory.test.ts +43 -0
  1980. package/extensions/zalo/src/channel.ts +414 -0
  1981. package/extensions/zalo/src/config-schema.ts +25 -0
  1982. package/extensions/zalo/src/monitor.ts +764 -0
  1983. package/extensions/zalo/src/monitor.webhook.test.ts +73 -0
  1984. package/extensions/zalo/src/onboarding.ts +401 -0
  1985. package/extensions/zalo/src/probe.ts +46 -0
  1986. package/extensions/zalo/src/proxy.ts +21 -0
  1987. package/extensions/zalo/src/runtime.ts +14 -0
  1988. package/extensions/zalo/src/send.ts +124 -0
  1989. package/extensions/zalo/src/status-issues.ts +53 -0
  1990. package/extensions/zalo/src/token.ts +63 -0
  1991. package/extensions/zalo/src/types.ts +44 -0
  1992. package/extensions/zalouser/CHANGELOG.md +85 -0
  1993. package/extensions/zalouser/README.md +225 -0
  1994. package/extensions/zalouser/atlas.plugin.json +9 -0
  1995. package/extensions/zalouser/index.ts +31 -0
  1996. package/extensions/zalouser/node_modules/.bin/atlas +22 -0
  1997. package/extensions/zalouser/package.json +36 -0
  1998. package/extensions/zalouser/src/accounts.ts +135 -0
  1999. package/extensions/zalouser/src/channel.test.ts +18 -0
  2000. package/extensions/zalouser/src/channel.ts +686 -0
  2001. package/extensions/zalouser/src/config-schema.ts +28 -0
  2002. package/extensions/zalouser/src/monitor.ts +601 -0
  2003. package/extensions/zalouser/src/onboarding.ts +504 -0
  2004. package/extensions/zalouser/src/probe.ts +28 -0
  2005. package/extensions/zalouser/src/runtime.ts +14 -0
  2006. package/extensions/zalouser/src/send.ts +160 -0
  2007. package/extensions/zalouser/src/status-issues.test.ts +57 -0
  2008. package/extensions/zalouser/src/status-issues.ts +89 -0
  2009. package/extensions/zalouser/src/tool.ts +164 -0
  2010. package/extensions/zalouser/src/types.ts +110 -0
  2011. package/extensions/zalouser/src/zca.ts +202 -0
  2012. package/package.json +225 -0
  2013. package/skills/1password/SKILL.md +70 -0
  2014. package/skills/1password/references/cli-examples.md +29 -0
  2015. package/skills/1password/references/get-started.md +17 -0
  2016. package/skills/apple-notes/SKILL.md +77 -0
  2017. package/skills/apple-reminders/SKILL.md +96 -0
  2018. package/skills/bear-notes/SKILL.md +107 -0
  2019. package/skills/blogwatcher/SKILL.md +69 -0
  2020. package/skills/blucli/SKILL.md +47 -0
  2021. package/skills/bluebubbles/SKILL.md +131 -0
  2022. package/skills/camsnap/SKILL.md +45 -0
  2023. package/skills/canvas/SKILL.md +198 -0
  2024. package/skills/clawhub/SKILL.md +77 -0
  2025. package/skills/coding-agent/SKILL.md +284 -0
  2026. package/skills/discord/SKILL.md +578 -0
  2027. package/skills/document-processor/SKILL.md +124 -0
  2028. package/skills/eightctl/SKILL.md +50 -0
  2029. package/skills/file-editor/SKILL.md +153 -0
  2030. package/skills/food-order/SKILL.md +48 -0
  2031. package/skills/gemini/SKILL.md +43 -0
  2032. package/skills/gifgrep/SKILL.md +79 -0
  2033. package/skills/github/SKILL.md +77 -0
  2034. package/skills/gog/SKILL.md +116 -0
  2035. package/skills/goplaces/SKILL.md +52 -0
  2036. package/skills/healthcheck/SKILL.md +245 -0
  2037. package/skills/himalaya/SKILL.md +257 -0
  2038. package/skills/himalaya/references/configuration.md +184 -0
  2039. package/skills/himalaya/references/message-composition.md +199 -0
  2040. package/skills/imsg/SKILL.md +74 -0
  2041. package/skills/local-places/SERVER_README.md +101 -0
  2042. package/skills/local-places/SKILL.md +102 -0
  2043. package/skills/local-places/pyproject.toml +21 -0
  2044. package/skills/local-places/src/local_places/__init__.py +2 -0
  2045. package/skills/local-places/src/local_places/google_places.py +314 -0
  2046. package/skills/local-places/src/local_places/main.py +65 -0
  2047. package/skills/local-places/src/local_places/schemas.py +107 -0
  2048. package/skills/mcporter/SKILL.md +61 -0
  2049. package/skills/model-usage/SKILL.md +69 -0
  2050. package/skills/model-usage/references/codexbar-cli.md +33 -0
  2051. package/skills/model-usage/scripts/model_usage.py +310 -0
  2052. package/skills/nano-banana-pro/SKILL.md +58 -0
  2053. package/skills/nano-banana-pro/scripts/generate_image.py +184 -0
  2054. package/skills/nano-pdf/SKILL.md +38 -0
  2055. package/skills/notion/SKILL.md +172 -0
  2056. package/skills/obsidian/SKILL.md +81 -0
  2057. package/skills/openai-image-gen/SKILL.md +89 -0
  2058. package/skills/openai-image-gen/scripts/gen.py +240 -0
  2059. package/skills/openai-whisper/SKILL.md +38 -0
  2060. package/skills/openai-whisper-api/SKILL.md +52 -0
  2061. package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
  2062. package/skills/openhue/SKILL.md +51 -0
  2063. package/skills/oracle/SKILL.md +125 -0
  2064. package/skills/ordercli/SKILL.md +78 -0
  2065. package/skills/peekaboo/SKILL.md +190 -0
  2066. package/skills/sag/SKILL.md +87 -0
  2067. package/skills/session-logs/SKILL.md +115 -0
  2068. package/skills/sherpa-onnx-tts/SKILL.md +103 -0
  2069. package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
  2070. package/skills/skill-creator/SKILL.md +370 -0
  2071. package/skills/skill-creator/license.txt +202 -0
  2072. package/skills/skill-creator/scripts/init_skill.py +378 -0
  2073. package/skills/skill-creator/scripts/package_skill.py +111 -0
  2074. package/skills/skill-creator/scripts/quick_validate.py +101 -0
  2075. package/skills/slack/SKILL.md +144 -0
  2076. package/skills/songsee/SKILL.md +49 -0
  2077. package/skills/sonoscli/SKILL.md +46 -0
  2078. package/skills/spotify-player/SKILL.md +64 -0
  2079. package/skills/summarize/SKILL.md +87 -0
  2080. package/skills/things-mac/SKILL.md +86 -0
  2081. package/skills/tmux/SKILL.md +135 -0
  2082. package/skills/tmux/scripts/find-sessions.sh +112 -0
  2083. package/skills/tmux/scripts/wait-for-text.sh +83 -0
  2084. package/skills/trello/SKILL.md +95 -0
  2085. package/skills/video-frames/SKILL.md +46 -0
  2086. package/skills/video-frames/scripts/frame.sh +81 -0
  2087. package/skills/voice-call/SKILL.md +45 -0
  2088. package/skills/wacli/SKILL.md +72 -0
  2089. package/skills/weather/SKILL.md +54 -0
@@ -0,0 +1,2410 @@
1
+ import { f as resolveConfigDir } from "./utils-BcIVMaVq.js";
2
+ import { n as runExec } from "./exec-COj3548p.js";
3
+ import { t as parseBooleanValue } from "./boolean-BgXe2hyu.js";
4
+ import { c as writeConfigFile, i as loadConfig } from "./config-Cj3AMovm.js";
5
+ import { D as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, N as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, O as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS, a as resolveAtlasUserDataDir, h as captureScreenshot, k as DEFAULT_AI_SNAPSHOT_MAX_CHARS, m as resolveBrowserExecutableForPlatform, y as snapshotAria } from "./chrome-DVA0NdqA.js";
6
+ import { a as resolveProfile, c as getUsedColors, d as deriveDefaultBrowserCdpPortRange, f as getPwAiModule$1, l as getUsedPorts, n as movePathToTrash, o as allocateCdpPort, r as parseHttpUrl, s as allocateColor, u as isValidProfileName } from "./server-context-B69ff6gq.js";
7
+ import os from "node:os";
8
+ import path from "node:path";
9
+ import fs from "node:fs";
10
+ import fs$1 from "node:fs/promises";
11
+ import crypto from "node:crypto";
12
+ import { pipeline } from "node:stream/promises";
13
+ import { lookup } from "node:dns";
14
+ import { lookup as lookup$1 } from "node:dns/promises";
15
+ import { Agent } from "undici";
16
+ import { fileTypeFromBuffer } from "file-type";
17
+
18
+ //#region src/browser/routes/agent.act.shared.ts
19
+ const ACT_KINDS = [
20
+ "click",
21
+ "close",
22
+ "drag",
23
+ "evaluate",
24
+ "fill",
25
+ "hover",
26
+ "scrollIntoView",
27
+ "press",
28
+ "resize",
29
+ "select",
30
+ "type",
31
+ "wait"
32
+ ];
33
+ function isActKind(value) {
34
+ if (typeof value !== "string") return false;
35
+ return ACT_KINDS.includes(value);
36
+ }
37
+ const ALLOWED_CLICK_MODIFIERS = new Set([
38
+ "Alt",
39
+ "Control",
40
+ "ControlOrMeta",
41
+ "Meta",
42
+ "Shift"
43
+ ]);
44
+ function parseClickButton(raw) {
45
+ if (raw === "left" || raw === "right" || raw === "middle") return raw;
46
+ }
47
+ function parseClickModifiers(raw) {
48
+ if (raw.filter((m) => !ALLOWED_CLICK_MODIFIERS.has(m)).length) return { error: "modifiers must be Alt|Control|ControlOrMeta|Meta|Shift" };
49
+ return { modifiers: raw.length ? raw : void 0 };
50
+ }
51
+
52
+ //#endregion
53
+ //#region src/browser/routes/utils.ts
54
+ /**
55
+ * Extract profile name from query string or body and get profile context.
56
+ * Query string takes precedence over body for consistency with GET routes.
57
+ */
58
+ function getProfileContext(req, ctx) {
59
+ let profileName;
60
+ if (typeof req.query.profile === "string") profileName = req.query.profile.trim() || void 0;
61
+ if (!profileName && req.body && typeof req.body === "object") {
62
+ const body = req.body;
63
+ if (typeof body.profile === "string") profileName = body.profile.trim() || void 0;
64
+ }
65
+ try {
66
+ return ctx.forProfile(profileName);
67
+ } catch (err) {
68
+ return {
69
+ error: String(err),
70
+ status: 404
71
+ };
72
+ }
73
+ }
74
+ function jsonError(res, status, message) {
75
+ res.status(status).json({ error: message });
76
+ }
77
+ function toStringOrEmpty(value) {
78
+ if (typeof value === "string") return value.trim();
79
+ if (typeof value === "number" || typeof value === "boolean") return String(value).trim();
80
+ return "";
81
+ }
82
+ function toNumber(value) {
83
+ if (typeof value === "number" && Number.isFinite(value)) return value;
84
+ if (typeof value === "string" && value.trim()) {
85
+ const parsed = Number(value);
86
+ return Number.isFinite(parsed) ? parsed : void 0;
87
+ }
88
+ }
89
+ function toBoolean(value) {
90
+ return parseBooleanValue(value, {
91
+ truthy: [
92
+ "true",
93
+ "1",
94
+ "yes"
95
+ ],
96
+ falsy: [
97
+ "false",
98
+ "0",
99
+ "no"
100
+ ]
101
+ });
102
+ }
103
+ function toStringArray(value) {
104
+ if (!Array.isArray(value)) return;
105
+ const strings = value.map((v) => toStringOrEmpty(v)).filter(Boolean);
106
+ return strings.length ? strings : void 0;
107
+ }
108
+
109
+ //#endregion
110
+ //#region src/browser/routes/agent.shared.ts
111
+ const SELECTOR_UNSUPPORTED_MESSAGE = [
112
+ "Error: 'selector' is not supported. Use 'ref' from snapshot instead.",
113
+ "",
114
+ "Example workflow:",
115
+ "1. snapshot action to get page state with refs",
116
+ "2. act with ref: \"e123\" to interact with element",
117
+ "",
118
+ "This is more reliable for modern SPAs."
119
+ ].join("\n");
120
+ function readBody(req) {
121
+ const body = req.body;
122
+ if (!body || typeof body !== "object" || Array.isArray(body)) return {};
123
+ return body;
124
+ }
125
+ function handleRouteError(ctx, res, err) {
126
+ const mapped = ctx.mapTabError(err);
127
+ if (mapped) return jsonError(res, mapped.status, mapped.message);
128
+ jsonError(res, 500, String(err));
129
+ }
130
+ function resolveProfileContext(req, res, ctx) {
131
+ const profileCtx = getProfileContext(req, ctx);
132
+ if ("error" in profileCtx) {
133
+ jsonError(res, profileCtx.status, profileCtx.error);
134
+ return null;
135
+ }
136
+ return profileCtx;
137
+ }
138
+ async function getPwAiModule() {
139
+ return await getPwAiModule$1({ mode: "soft" });
140
+ }
141
+ async function requirePwAi(res, feature) {
142
+ const mod = await getPwAiModule();
143
+ if (mod) return mod;
144
+ jsonError(res, 501, [
145
+ `Playwright is not available in this gateway build; '${feature}' is unsupported.`,
146
+ "Install the full Playwright package (not playwright-core) and restart the gateway, or reinstall with browser support.",
147
+ "Docs: /tools/browser#playwright-requirement"
148
+ ].join("\n"));
149
+ return null;
150
+ }
151
+
152
+ //#endregion
153
+ //#region src/browser/routes/agent.act.ts
154
+ function registerBrowserAgentActRoutes(app, ctx) {
155
+ app.post("/act", async (req, res) => {
156
+ const profileCtx = resolveProfileContext(req, res, ctx);
157
+ if (!profileCtx) return;
158
+ const body = readBody(req);
159
+ const kindRaw = toStringOrEmpty(body.kind);
160
+ if (!isActKind(kindRaw)) return jsonError(res, 400, "kind is required");
161
+ const kind = kindRaw;
162
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
163
+ if (Object.hasOwn(body, "selector") && kind !== "wait") return jsonError(res, 400, SELECTOR_UNSUPPORTED_MESSAGE);
164
+ try {
165
+ const tab = await profileCtx.ensureTabAvailable(targetId);
166
+ const cdpUrl = profileCtx.profile.cdpUrl;
167
+ const pw = await requirePwAi(res, `act:${kind}`);
168
+ if (!pw) return;
169
+ const evaluateEnabled = ctx.state().resolved.evaluateEnabled;
170
+ switch (kind) {
171
+ case "click": {
172
+ const ref = toStringOrEmpty(body.ref);
173
+ if (!ref) return jsonError(res, 400, "ref is required");
174
+ const doubleClick = toBoolean(body.doubleClick) ?? false;
175
+ const timeoutMs = toNumber(body.timeoutMs);
176
+ const buttonRaw = toStringOrEmpty(body.button) || "";
177
+ const button = buttonRaw ? parseClickButton(buttonRaw) : void 0;
178
+ if (buttonRaw && !button) return jsonError(res, 400, "button must be left|right|middle");
179
+ const parsedModifiers = parseClickModifiers(toStringArray(body.modifiers) ?? []);
180
+ if (parsedModifiers.error) return jsonError(res, 400, parsedModifiers.error);
181
+ const modifiers = parsedModifiers.modifiers;
182
+ const clickRequest = {
183
+ cdpUrl,
184
+ targetId: tab.targetId,
185
+ ref,
186
+ doubleClick
187
+ };
188
+ if (button) clickRequest.button = button;
189
+ if (modifiers) clickRequest.modifiers = modifiers;
190
+ if (timeoutMs) clickRequest.timeoutMs = timeoutMs;
191
+ await pw.clickViaPlaywright(clickRequest);
192
+ return res.json({
193
+ ok: true,
194
+ targetId: tab.targetId,
195
+ url: tab.url
196
+ });
197
+ }
198
+ case "type": {
199
+ const ref = toStringOrEmpty(body.ref);
200
+ if (!ref) return jsonError(res, 400, "ref is required");
201
+ if (typeof body.text !== "string") return jsonError(res, 400, "text is required");
202
+ const text = body.text;
203
+ const submit = toBoolean(body.submit) ?? false;
204
+ const slowly = toBoolean(body.slowly) ?? false;
205
+ const timeoutMs = toNumber(body.timeoutMs);
206
+ const typeRequest = {
207
+ cdpUrl,
208
+ targetId: tab.targetId,
209
+ ref,
210
+ text,
211
+ submit,
212
+ slowly
213
+ };
214
+ if (timeoutMs) typeRequest.timeoutMs = timeoutMs;
215
+ await pw.typeViaPlaywright(typeRequest);
216
+ return res.json({
217
+ ok: true,
218
+ targetId: tab.targetId
219
+ });
220
+ }
221
+ case "press": {
222
+ const key = toStringOrEmpty(body.key);
223
+ if (!key) return jsonError(res, 400, "key is required");
224
+ const delayMs = toNumber(body.delayMs);
225
+ await pw.pressKeyViaPlaywright({
226
+ cdpUrl,
227
+ targetId: tab.targetId,
228
+ key,
229
+ delayMs: delayMs ?? void 0
230
+ });
231
+ return res.json({
232
+ ok: true,
233
+ targetId: tab.targetId
234
+ });
235
+ }
236
+ case "hover": {
237
+ const ref = toStringOrEmpty(body.ref);
238
+ if (!ref) return jsonError(res, 400, "ref is required");
239
+ const timeoutMs = toNumber(body.timeoutMs);
240
+ await pw.hoverViaPlaywright({
241
+ cdpUrl,
242
+ targetId: tab.targetId,
243
+ ref,
244
+ timeoutMs: timeoutMs ?? void 0
245
+ });
246
+ return res.json({
247
+ ok: true,
248
+ targetId: tab.targetId
249
+ });
250
+ }
251
+ case "scrollIntoView": {
252
+ const ref = toStringOrEmpty(body.ref);
253
+ if (!ref) return jsonError(res, 400, "ref is required");
254
+ const timeoutMs = toNumber(body.timeoutMs);
255
+ const scrollRequest = {
256
+ cdpUrl,
257
+ targetId: tab.targetId,
258
+ ref
259
+ };
260
+ if (timeoutMs) scrollRequest.timeoutMs = timeoutMs;
261
+ await pw.scrollIntoViewViaPlaywright(scrollRequest);
262
+ return res.json({
263
+ ok: true,
264
+ targetId: tab.targetId
265
+ });
266
+ }
267
+ case "drag": {
268
+ const startRef = toStringOrEmpty(body.startRef);
269
+ const endRef = toStringOrEmpty(body.endRef);
270
+ if (!startRef || !endRef) return jsonError(res, 400, "startRef and endRef are required");
271
+ const timeoutMs = toNumber(body.timeoutMs);
272
+ await pw.dragViaPlaywright({
273
+ cdpUrl,
274
+ targetId: tab.targetId,
275
+ startRef,
276
+ endRef,
277
+ timeoutMs: timeoutMs ?? void 0
278
+ });
279
+ return res.json({
280
+ ok: true,
281
+ targetId: tab.targetId
282
+ });
283
+ }
284
+ case "select": {
285
+ const ref = toStringOrEmpty(body.ref);
286
+ const values = toStringArray(body.values);
287
+ if (!ref || !values?.length) return jsonError(res, 400, "ref and values are required");
288
+ const timeoutMs = toNumber(body.timeoutMs);
289
+ await pw.selectOptionViaPlaywright({
290
+ cdpUrl,
291
+ targetId: tab.targetId,
292
+ ref,
293
+ values,
294
+ timeoutMs: timeoutMs ?? void 0
295
+ });
296
+ return res.json({
297
+ ok: true,
298
+ targetId: tab.targetId
299
+ });
300
+ }
301
+ case "fill": {
302
+ const fields = (Array.isArray(body.fields) ? body.fields : []).map((field) => {
303
+ if (!field || typeof field !== "object") return null;
304
+ const rec = field;
305
+ const ref = toStringOrEmpty(rec.ref);
306
+ const type = toStringOrEmpty(rec.type);
307
+ if (!ref || !type) return null;
308
+ const value = typeof rec.value === "string" || typeof rec.value === "number" || typeof rec.value === "boolean" ? rec.value : void 0;
309
+ return value === void 0 ? {
310
+ ref,
311
+ type
312
+ } : {
313
+ ref,
314
+ type,
315
+ value
316
+ };
317
+ }).filter((field) => field !== null);
318
+ if (!fields.length) return jsonError(res, 400, "fields are required");
319
+ const timeoutMs = toNumber(body.timeoutMs);
320
+ await pw.fillFormViaPlaywright({
321
+ cdpUrl,
322
+ targetId: tab.targetId,
323
+ fields,
324
+ timeoutMs: timeoutMs ?? void 0
325
+ });
326
+ return res.json({
327
+ ok: true,
328
+ targetId: tab.targetId
329
+ });
330
+ }
331
+ case "resize": {
332
+ const width = toNumber(body.width);
333
+ const height = toNumber(body.height);
334
+ if (!width || !height) return jsonError(res, 400, "width and height are required");
335
+ await pw.resizeViewportViaPlaywright({
336
+ cdpUrl,
337
+ targetId: tab.targetId,
338
+ width,
339
+ height
340
+ });
341
+ return res.json({
342
+ ok: true,
343
+ targetId: tab.targetId,
344
+ url: tab.url
345
+ });
346
+ }
347
+ case "wait": {
348
+ const timeMs = toNumber(body.timeMs);
349
+ const text = toStringOrEmpty(body.text) || void 0;
350
+ const textGone = toStringOrEmpty(body.textGone) || void 0;
351
+ const selector = toStringOrEmpty(body.selector) || void 0;
352
+ const url = toStringOrEmpty(body.url) || void 0;
353
+ const loadStateRaw = toStringOrEmpty(body.loadState);
354
+ const loadState = loadStateRaw === "load" || loadStateRaw === "domcontentloaded" || loadStateRaw === "networkidle" ? loadStateRaw : void 0;
355
+ const fn = toStringOrEmpty(body.fn) || void 0;
356
+ const timeoutMs = toNumber(body.timeoutMs) ?? void 0;
357
+ if (fn && !evaluateEnabled) return jsonError(res, 403, ["wait --fn is disabled by config (browser.evaluateEnabled=false).", "Docs: /gateway/configuration#browser-atlas-managed-browser"].join("\n"));
358
+ if (timeMs === void 0 && !text && !textGone && !selector && !url && !loadState && !fn) return jsonError(res, 400, "wait requires at least one of: timeMs, text, textGone, selector, url, loadState, fn");
359
+ await pw.waitForViaPlaywright({
360
+ cdpUrl,
361
+ targetId: tab.targetId,
362
+ timeMs,
363
+ text,
364
+ textGone,
365
+ selector,
366
+ url,
367
+ loadState,
368
+ fn,
369
+ timeoutMs
370
+ });
371
+ return res.json({
372
+ ok: true,
373
+ targetId: tab.targetId
374
+ });
375
+ }
376
+ case "evaluate": {
377
+ if (!evaluateEnabled) return jsonError(res, 403, ["act:evaluate is disabled by config (browser.evaluateEnabled=false).", "Docs: /gateway/configuration#browser-atlas-managed-browser"].join("\n"));
378
+ const fn = toStringOrEmpty(body.fn);
379
+ if (!fn) return jsonError(res, 400, "fn is required");
380
+ const ref = toStringOrEmpty(body.ref) || void 0;
381
+ const result = await pw.evaluateViaPlaywright({
382
+ cdpUrl,
383
+ targetId: tab.targetId,
384
+ fn,
385
+ ref
386
+ });
387
+ return res.json({
388
+ ok: true,
389
+ targetId: tab.targetId,
390
+ url: tab.url,
391
+ result
392
+ });
393
+ }
394
+ case "close":
395
+ await pw.closePageViaPlaywright({
396
+ cdpUrl,
397
+ targetId: tab.targetId
398
+ });
399
+ return res.json({
400
+ ok: true,
401
+ targetId: tab.targetId
402
+ });
403
+ default: return jsonError(res, 400, "unsupported kind");
404
+ }
405
+ } catch (err) {
406
+ handleRouteError(ctx, res, err);
407
+ }
408
+ });
409
+ app.post("/hooks/file-chooser", async (req, res) => {
410
+ const profileCtx = resolveProfileContext(req, res, ctx);
411
+ if (!profileCtx) return;
412
+ const body = readBody(req);
413
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
414
+ const ref = toStringOrEmpty(body.ref) || void 0;
415
+ const inputRef = toStringOrEmpty(body.inputRef) || void 0;
416
+ const element = toStringOrEmpty(body.element) || void 0;
417
+ const paths = toStringArray(body.paths) ?? [];
418
+ const timeoutMs = toNumber(body.timeoutMs);
419
+ if (!paths.length) return jsonError(res, 400, "paths are required");
420
+ try {
421
+ const tab = await profileCtx.ensureTabAvailable(targetId);
422
+ const pw = await requirePwAi(res, "file chooser hook");
423
+ if (!pw) return;
424
+ if (inputRef || element) {
425
+ if (ref) return jsonError(res, 400, "ref cannot be combined with inputRef/element");
426
+ await pw.setInputFilesViaPlaywright({
427
+ cdpUrl: profileCtx.profile.cdpUrl,
428
+ targetId: tab.targetId,
429
+ inputRef,
430
+ element,
431
+ paths
432
+ });
433
+ } else {
434
+ await pw.armFileUploadViaPlaywright({
435
+ cdpUrl: profileCtx.profile.cdpUrl,
436
+ targetId: tab.targetId,
437
+ paths,
438
+ timeoutMs: timeoutMs ?? void 0
439
+ });
440
+ if (ref) await pw.clickViaPlaywright({
441
+ cdpUrl: profileCtx.profile.cdpUrl,
442
+ targetId: tab.targetId,
443
+ ref
444
+ });
445
+ }
446
+ res.json({ ok: true });
447
+ } catch (err) {
448
+ handleRouteError(ctx, res, err);
449
+ }
450
+ });
451
+ app.post("/hooks/dialog", async (req, res) => {
452
+ const profileCtx = resolveProfileContext(req, res, ctx);
453
+ if (!profileCtx) return;
454
+ const body = readBody(req);
455
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
456
+ const accept = toBoolean(body.accept);
457
+ const promptText = toStringOrEmpty(body.promptText) || void 0;
458
+ const timeoutMs = toNumber(body.timeoutMs);
459
+ if (accept === void 0) return jsonError(res, 400, "accept is required");
460
+ try {
461
+ const tab = await profileCtx.ensureTabAvailable(targetId);
462
+ const pw = await requirePwAi(res, "dialog hook");
463
+ if (!pw) return;
464
+ await pw.armDialogViaPlaywright({
465
+ cdpUrl: profileCtx.profile.cdpUrl,
466
+ targetId: tab.targetId,
467
+ accept,
468
+ promptText,
469
+ timeoutMs: timeoutMs ?? void 0
470
+ });
471
+ res.json({ ok: true });
472
+ } catch (err) {
473
+ handleRouteError(ctx, res, err);
474
+ }
475
+ });
476
+ app.post("/wait/download", async (req, res) => {
477
+ const profileCtx = resolveProfileContext(req, res, ctx);
478
+ if (!profileCtx) return;
479
+ const body = readBody(req);
480
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
481
+ const out = toStringOrEmpty(body.path) || void 0;
482
+ const timeoutMs = toNumber(body.timeoutMs);
483
+ try {
484
+ const tab = await profileCtx.ensureTabAvailable(targetId);
485
+ const pw = await requirePwAi(res, "wait for download");
486
+ if (!pw) return;
487
+ const result = await pw.waitForDownloadViaPlaywright({
488
+ cdpUrl: profileCtx.profile.cdpUrl,
489
+ targetId: tab.targetId,
490
+ path: out,
491
+ timeoutMs: timeoutMs ?? void 0
492
+ });
493
+ res.json({
494
+ ok: true,
495
+ targetId: tab.targetId,
496
+ download: result
497
+ });
498
+ } catch (err) {
499
+ handleRouteError(ctx, res, err);
500
+ }
501
+ });
502
+ app.post("/download", async (req, res) => {
503
+ const profileCtx = resolveProfileContext(req, res, ctx);
504
+ if (!profileCtx) return;
505
+ const body = readBody(req);
506
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
507
+ const ref = toStringOrEmpty(body.ref);
508
+ const out = toStringOrEmpty(body.path);
509
+ const timeoutMs = toNumber(body.timeoutMs);
510
+ if (!ref) return jsonError(res, 400, "ref is required");
511
+ if (!out) return jsonError(res, 400, "path is required");
512
+ try {
513
+ const tab = await profileCtx.ensureTabAvailable(targetId);
514
+ const pw = await requirePwAi(res, "download");
515
+ if (!pw) return;
516
+ const result = await pw.downloadViaPlaywright({
517
+ cdpUrl: profileCtx.profile.cdpUrl,
518
+ targetId: tab.targetId,
519
+ ref,
520
+ path: out,
521
+ timeoutMs: timeoutMs ?? void 0
522
+ });
523
+ res.json({
524
+ ok: true,
525
+ targetId: tab.targetId,
526
+ download: result
527
+ });
528
+ } catch (err) {
529
+ handleRouteError(ctx, res, err);
530
+ }
531
+ });
532
+ app.post("/response/body", async (req, res) => {
533
+ const profileCtx = resolveProfileContext(req, res, ctx);
534
+ if (!profileCtx) return;
535
+ const body = readBody(req);
536
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
537
+ const url = toStringOrEmpty(body.url);
538
+ const timeoutMs = toNumber(body.timeoutMs);
539
+ const maxChars = toNumber(body.maxChars);
540
+ if (!url) return jsonError(res, 400, "url is required");
541
+ try {
542
+ const tab = await profileCtx.ensureTabAvailable(targetId);
543
+ const pw = await requirePwAi(res, "response body");
544
+ if (!pw) return;
545
+ const result = await pw.responseBodyViaPlaywright({
546
+ cdpUrl: profileCtx.profile.cdpUrl,
547
+ targetId: tab.targetId,
548
+ url,
549
+ timeoutMs: timeoutMs ?? void 0,
550
+ maxChars: maxChars ?? void 0
551
+ });
552
+ res.json({
553
+ ok: true,
554
+ targetId: tab.targetId,
555
+ response: result
556
+ });
557
+ } catch (err) {
558
+ handleRouteError(ctx, res, err);
559
+ }
560
+ });
561
+ app.post("/highlight", async (req, res) => {
562
+ const profileCtx = resolveProfileContext(req, res, ctx);
563
+ if (!profileCtx) return;
564
+ const body = readBody(req);
565
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
566
+ const ref = toStringOrEmpty(body.ref);
567
+ if (!ref) return jsonError(res, 400, "ref is required");
568
+ try {
569
+ const tab = await profileCtx.ensureTabAvailable(targetId);
570
+ const pw = await requirePwAi(res, "highlight");
571
+ if (!pw) return;
572
+ await pw.highlightViaPlaywright({
573
+ cdpUrl: profileCtx.profile.cdpUrl,
574
+ targetId: tab.targetId,
575
+ ref
576
+ });
577
+ res.json({
578
+ ok: true,
579
+ targetId: tab.targetId
580
+ });
581
+ } catch (err) {
582
+ handleRouteError(ctx, res, err);
583
+ }
584
+ });
585
+ }
586
+
587
+ //#endregion
588
+ //#region src/browser/routes/agent.debug.ts
589
+ function registerBrowserAgentDebugRoutes(app, ctx) {
590
+ app.get("/console", async (req, res) => {
591
+ const profileCtx = resolveProfileContext(req, res, ctx);
592
+ if (!profileCtx) return;
593
+ const targetId = typeof req.query.targetId === "string" ? req.query.targetId.trim() : "";
594
+ const level = typeof req.query.level === "string" ? req.query.level : "";
595
+ try {
596
+ const tab = await profileCtx.ensureTabAvailable(targetId || void 0);
597
+ const pw = await requirePwAi(res, "console messages");
598
+ if (!pw) return;
599
+ const messages = await pw.getConsoleMessagesViaPlaywright({
600
+ cdpUrl: profileCtx.profile.cdpUrl,
601
+ targetId: tab.targetId,
602
+ level: level.trim() || void 0
603
+ });
604
+ res.json({
605
+ ok: true,
606
+ messages,
607
+ targetId: tab.targetId
608
+ });
609
+ } catch (err) {
610
+ handleRouteError(ctx, res, err);
611
+ }
612
+ });
613
+ app.get("/errors", async (req, res) => {
614
+ const profileCtx = resolveProfileContext(req, res, ctx);
615
+ if (!profileCtx) return;
616
+ const targetId = typeof req.query.targetId === "string" ? req.query.targetId.trim() : "";
617
+ const clear = toBoolean(req.query.clear) ?? false;
618
+ try {
619
+ const tab = await profileCtx.ensureTabAvailable(targetId || void 0);
620
+ const pw = await requirePwAi(res, "page errors");
621
+ if (!pw) return;
622
+ const result = await pw.getPageErrorsViaPlaywright({
623
+ cdpUrl: profileCtx.profile.cdpUrl,
624
+ targetId: tab.targetId,
625
+ clear
626
+ });
627
+ res.json({
628
+ ok: true,
629
+ targetId: tab.targetId,
630
+ ...result
631
+ });
632
+ } catch (err) {
633
+ handleRouteError(ctx, res, err);
634
+ }
635
+ });
636
+ app.get("/requests", async (req, res) => {
637
+ const profileCtx = resolveProfileContext(req, res, ctx);
638
+ if (!profileCtx) return;
639
+ const targetId = typeof req.query.targetId === "string" ? req.query.targetId.trim() : "";
640
+ const filter = typeof req.query.filter === "string" ? req.query.filter : "";
641
+ const clear = toBoolean(req.query.clear) ?? false;
642
+ try {
643
+ const tab = await profileCtx.ensureTabAvailable(targetId || void 0);
644
+ const pw = await requirePwAi(res, "network requests");
645
+ if (!pw) return;
646
+ const result = await pw.getNetworkRequestsViaPlaywright({
647
+ cdpUrl: profileCtx.profile.cdpUrl,
648
+ targetId: tab.targetId,
649
+ filter: filter.trim() || void 0,
650
+ clear
651
+ });
652
+ res.json({
653
+ ok: true,
654
+ targetId: tab.targetId,
655
+ ...result
656
+ });
657
+ } catch (err) {
658
+ handleRouteError(ctx, res, err);
659
+ }
660
+ });
661
+ app.post("/trace/start", async (req, res) => {
662
+ const profileCtx = resolveProfileContext(req, res, ctx);
663
+ if (!profileCtx) return;
664
+ const body = readBody(req);
665
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
666
+ const screenshots = toBoolean(body.screenshots) ?? void 0;
667
+ const snapshots = toBoolean(body.snapshots) ?? void 0;
668
+ const sources = toBoolean(body.sources) ?? void 0;
669
+ try {
670
+ const tab = await profileCtx.ensureTabAvailable(targetId);
671
+ const pw = await requirePwAi(res, "trace start");
672
+ if (!pw) return;
673
+ await pw.traceStartViaPlaywright({
674
+ cdpUrl: profileCtx.profile.cdpUrl,
675
+ targetId: tab.targetId,
676
+ screenshots,
677
+ snapshots,
678
+ sources
679
+ });
680
+ res.json({
681
+ ok: true,
682
+ targetId: tab.targetId
683
+ });
684
+ } catch (err) {
685
+ handleRouteError(ctx, res, err);
686
+ }
687
+ });
688
+ app.post("/trace/stop", async (req, res) => {
689
+ const profileCtx = resolveProfileContext(req, res, ctx);
690
+ if (!profileCtx) return;
691
+ const body = readBody(req);
692
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
693
+ const out = toStringOrEmpty(body.path) || "";
694
+ try {
695
+ const tab = await profileCtx.ensureTabAvailable(targetId);
696
+ const pw = await requirePwAi(res, "trace stop");
697
+ if (!pw) return;
698
+ const id = crypto.randomUUID();
699
+ const dir = "/tmp/atlas";
700
+ await fs$1.mkdir(dir, { recursive: true });
701
+ const tracePath = out.trim() || path.join(dir, `browser-trace-${id}.zip`);
702
+ await pw.traceStopViaPlaywright({
703
+ cdpUrl: profileCtx.profile.cdpUrl,
704
+ targetId: tab.targetId,
705
+ path: tracePath
706
+ });
707
+ res.json({
708
+ ok: true,
709
+ targetId: tab.targetId,
710
+ path: path.resolve(tracePath)
711
+ });
712
+ } catch (err) {
713
+ handleRouteError(ctx, res, err);
714
+ }
715
+ });
716
+ }
717
+
718
+ //#endregion
719
+ //#region src/infra/net/ssrf.ts
720
+ var SsrFBlockedError = class extends Error {
721
+ constructor(message) {
722
+ super(message);
723
+ this.name = "SsrFBlockedError";
724
+ }
725
+ };
726
+ const PRIVATE_IPV6_PREFIXES = [
727
+ "fe80:",
728
+ "fec0:",
729
+ "fc",
730
+ "fd"
731
+ ];
732
+ const BLOCKED_HOSTNAMES = new Set(["localhost", "metadata.google.internal"]);
733
+ function normalizeHostname(hostname) {
734
+ const normalized = hostname.trim().toLowerCase().replace(/\.$/, "");
735
+ if (normalized.startsWith("[") && normalized.endsWith("]")) return normalized.slice(1, -1);
736
+ return normalized;
737
+ }
738
+ function normalizeHostnameSet(values) {
739
+ if (!values || values.length === 0) return /* @__PURE__ */ new Set();
740
+ return new Set(values.map((value) => normalizeHostname(value)).filter(Boolean));
741
+ }
742
+ function parseIpv4(address) {
743
+ const parts = address.split(".");
744
+ if (parts.length !== 4) return null;
745
+ const numbers = parts.map((part) => Number.parseInt(part, 10));
746
+ if (numbers.some((value) => Number.isNaN(value) || value < 0 || value > 255)) return null;
747
+ return numbers;
748
+ }
749
+ function parseIpv4FromMappedIpv6(mapped) {
750
+ if (mapped.includes(".")) return parseIpv4(mapped);
751
+ const parts = mapped.split(":").filter(Boolean);
752
+ if (parts.length === 1) {
753
+ const value = Number.parseInt(parts[0], 16);
754
+ if (Number.isNaN(value) || value < 0 || value > 4294967295) return null;
755
+ return [
756
+ value >>> 24 & 255,
757
+ value >>> 16 & 255,
758
+ value >>> 8 & 255,
759
+ value & 255
760
+ ];
761
+ }
762
+ if (parts.length !== 2) return null;
763
+ const high = Number.parseInt(parts[0], 16);
764
+ const low = Number.parseInt(parts[1], 16);
765
+ if (Number.isNaN(high) || Number.isNaN(low) || high < 0 || low < 0 || high > 65535 || low > 65535) return null;
766
+ const value = (high << 16) + low;
767
+ return [
768
+ value >>> 24 & 255,
769
+ value >>> 16 & 255,
770
+ value >>> 8 & 255,
771
+ value & 255
772
+ ];
773
+ }
774
+ function isPrivateIpv4(parts) {
775
+ const [octet1, octet2] = parts;
776
+ if (octet1 === 0) return true;
777
+ if (octet1 === 10) return true;
778
+ if (octet1 === 127) return true;
779
+ if (octet1 === 169 && octet2 === 254) return true;
780
+ if (octet1 === 172 && octet2 >= 16 && octet2 <= 31) return true;
781
+ if (octet1 === 192 && octet2 === 168) return true;
782
+ if (octet1 === 100 && octet2 >= 64 && octet2 <= 127) return true;
783
+ return false;
784
+ }
785
+ function isPrivateIpAddress(address) {
786
+ let normalized = address.trim().toLowerCase();
787
+ if (normalized.startsWith("[") && normalized.endsWith("]")) normalized = normalized.slice(1, -1);
788
+ if (!normalized) return false;
789
+ if (normalized.startsWith("::ffff:")) {
790
+ const ipv4 = parseIpv4FromMappedIpv6(normalized.slice(7));
791
+ if (ipv4) return isPrivateIpv4(ipv4);
792
+ }
793
+ if (normalized.includes(":")) {
794
+ if (normalized === "::" || normalized === "::1") return true;
795
+ return PRIVATE_IPV6_PREFIXES.some((prefix) => normalized.startsWith(prefix));
796
+ }
797
+ const ipv4 = parseIpv4(normalized);
798
+ if (!ipv4) return false;
799
+ return isPrivateIpv4(ipv4);
800
+ }
801
+ function isBlockedHostname(hostname) {
802
+ const normalized = normalizeHostname(hostname);
803
+ if (!normalized) return false;
804
+ if (BLOCKED_HOSTNAMES.has(normalized)) return true;
805
+ return normalized.endsWith(".localhost") || normalized.endsWith(".local") || normalized.endsWith(".internal");
806
+ }
807
+ function createPinnedLookup(params) {
808
+ const normalizedHost = normalizeHostname(params.hostname);
809
+ const fallback = params.fallback ?? lookup;
810
+ const fallbackLookup = fallback;
811
+ const fallbackWithOptions = fallback;
812
+ const records = params.addresses.map((address) => ({
813
+ address,
814
+ family: address.includes(":") ? 6 : 4
815
+ }));
816
+ let index = 0;
817
+ return ((host, options, callback) => {
818
+ const cb = typeof options === "function" ? options : callback;
819
+ if (!cb) return;
820
+ const normalized = normalizeHostname(host);
821
+ if (!normalized || normalized !== normalizedHost) {
822
+ if (typeof options === "function" || options === void 0) return fallbackLookup(host, cb);
823
+ return fallbackWithOptions(host, options, cb);
824
+ }
825
+ const opts = typeof options === "object" && options !== null ? options : {};
826
+ const requestedFamily = typeof options === "number" ? options : typeof opts.family === "number" ? opts.family : 0;
827
+ const candidates = requestedFamily === 4 || requestedFamily === 6 ? records.filter((entry) => entry.family === requestedFamily) : records;
828
+ const usable = candidates.length > 0 ? candidates : records;
829
+ if (opts.all) {
830
+ cb(null, usable);
831
+ return;
832
+ }
833
+ const chosen = usable[index % usable.length];
834
+ index += 1;
835
+ cb(null, chosen.address, chosen.family);
836
+ });
837
+ }
838
+ async function resolvePinnedHostnameWithPolicy(hostname, params = {}) {
839
+ const normalized = normalizeHostname(hostname);
840
+ if (!normalized) throw new Error("Invalid hostname");
841
+ const allowPrivateNetwork = Boolean(params.policy?.allowPrivateNetwork);
842
+ const isExplicitAllowed = normalizeHostnameSet(params.policy?.allowedHostnames).has(normalized);
843
+ if (!allowPrivateNetwork && !isExplicitAllowed) {
844
+ if (isBlockedHostname(normalized)) throw new SsrFBlockedError(`Blocked hostname: ${hostname}`);
845
+ if (isPrivateIpAddress(normalized)) throw new SsrFBlockedError("Blocked: private/internal IP address");
846
+ }
847
+ const results = await (params.lookupFn ?? lookup$1)(normalized, { all: true });
848
+ if (results.length === 0) throw new Error(`Unable to resolve hostname: ${hostname}`);
849
+ if (!allowPrivateNetwork && !isExplicitAllowed) {
850
+ for (const entry of results) if (isPrivateIpAddress(entry.address)) throw new SsrFBlockedError("Blocked: resolves to private/internal IP address");
851
+ }
852
+ const addresses = Array.from(new Set(results.map((entry) => entry.address)));
853
+ if (addresses.length === 0) throw new Error(`Unable to resolve hostname: ${hostname}`);
854
+ return {
855
+ hostname: normalized,
856
+ addresses,
857
+ lookup: createPinnedLookup({
858
+ hostname: normalized,
859
+ addresses
860
+ })
861
+ };
862
+ }
863
+ async function resolvePinnedHostname(hostname, lookupFn = lookup$1) {
864
+ return await resolvePinnedHostnameWithPolicy(hostname, { lookupFn });
865
+ }
866
+ function createPinnedDispatcher(pinned) {
867
+ return new Agent({ connect: { lookup: pinned.lookup } });
868
+ }
869
+ async function closeDispatcher(dispatcher) {
870
+ if (!dispatcher) return;
871
+ const candidate = dispatcher;
872
+ try {
873
+ if (typeof candidate.close === "function") {
874
+ await candidate.close();
875
+ return;
876
+ }
877
+ if (typeof candidate.destroy === "function") candidate.destroy();
878
+ } catch {}
879
+ }
880
+
881
+ //#endregion
882
+ //#region src/media/constants.ts
883
+ const MAX_IMAGE_BYTES = 6 * 1024 * 1024;
884
+ const MAX_AUDIO_BYTES = 16 * 1024 * 1024;
885
+ const MAX_VIDEO_BYTES = 16 * 1024 * 1024;
886
+ const MAX_DOCUMENT_BYTES = 100 * 1024 * 1024;
887
+ function mediaKindFromMime(mime) {
888
+ if (!mime) return "unknown";
889
+ if (mime.startsWith("image/")) return "image";
890
+ if (mime.startsWith("audio/")) return "audio";
891
+ if (mime.startsWith("video/")) return "video";
892
+ if (mime === "application/pdf") return "document";
893
+ if (mime.startsWith("application/")) return "document";
894
+ return "unknown";
895
+ }
896
+ function maxBytesForKind(kind) {
897
+ switch (kind) {
898
+ case "image": return MAX_IMAGE_BYTES;
899
+ case "audio": return MAX_AUDIO_BYTES;
900
+ case "video": return MAX_VIDEO_BYTES;
901
+ case "document": return MAX_DOCUMENT_BYTES;
902
+ default: return MAX_DOCUMENT_BYTES;
903
+ }
904
+ }
905
+
906
+ //#endregion
907
+ //#region src/media/mime.ts
908
+ const EXT_BY_MIME = {
909
+ "image/heic": ".heic",
910
+ "image/heif": ".heif",
911
+ "image/jpeg": ".jpg",
912
+ "image/png": ".png",
913
+ "image/webp": ".webp",
914
+ "image/gif": ".gif",
915
+ "audio/ogg": ".ogg",
916
+ "audio/mpeg": ".mp3",
917
+ "audio/x-m4a": ".m4a",
918
+ "audio/mp4": ".m4a",
919
+ "video/mp4": ".mp4",
920
+ "video/quicktime": ".mov",
921
+ "application/pdf": ".pdf",
922
+ "application/json": ".json",
923
+ "application/zip": ".zip",
924
+ "application/gzip": ".gz",
925
+ "application/x-tar": ".tar",
926
+ "application/x-7z-compressed": ".7z",
927
+ "application/vnd.rar": ".rar",
928
+ "application/msword": ".doc",
929
+ "application/vnd.ms-excel": ".xls",
930
+ "application/vnd.ms-powerpoint": ".ppt",
931
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ".docx",
932
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ".xlsx",
933
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": ".pptx",
934
+ "text/csv": ".csv",
935
+ "text/plain": ".txt",
936
+ "text/markdown": ".md"
937
+ };
938
+ const MIME_BY_EXT = {
939
+ ...Object.fromEntries(Object.entries(EXT_BY_MIME).map(([mime, ext]) => [ext, mime])),
940
+ ".jpeg": "image/jpeg"
941
+ };
942
+ const AUDIO_FILE_EXTENSIONS = new Set([
943
+ ".aac",
944
+ ".flac",
945
+ ".m4a",
946
+ ".mp3",
947
+ ".oga",
948
+ ".ogg",
949
+ ".opus",
950
+ ".wav"
951
+ ]);
952
+ function normalizeHeaderMime(mime) {
953
+ if (!mime) return;
954
+ return mime.split(";")[0]?.trim().toLowerCase() || void 0;
955
+ }
956
+ async function sniffMime(buffer) {
957
+ if (!buffer) return;
958
+ try {
959
+ return (await fileTypeFromBuffer(buffer))?.mime ?? void 0;
960
+ } catch {
961
+ return;
962
+ }
963
+ }
964
+ function getFileExtension(filePath) {
965
+ if (!filePath) return;
966
+ try {
967
+ if (/^https?:\/\//i.test(filePath)) {
968
+ const url = new URL(filePath);
969
+ return path.extname(url.pathname).toLowerCase() || void 0;
970
+ }
971
+ } catch {}
972
+ return path.extname(filePath).toLowerCase() || void 0;
973
+ }
974
+ function isAudioFileName(fileName) {
975
+ const ext = getFileExtension(fileName);
976
+ if (!ext) return false;
977
+ return AUDIO_FILE_EXTENSIONS.has(ext);
978
+ }
979
+ function detectMime(opts) {
980
+ return detectMimeImpl(opts);
981
+ }
982
+ function isGenericMime(mime) {
983
+ if (!mime) return true;
984
+ const m = mime.toLowerCase();
985
+ return m === "application/octet-stream" || m === "application/zip";
986
+ }
987
+ async function detectMimeImpl(opts) {
988
+ const ext = getFileExtension(opts.filePath);
989
+ const extMime = ext ? MIME_BY_EXT[ext] : void 0;
990
+ const headerMime = normalizeHeaderMime(opts.headerMime);
991
+ const sniffed = await sniffMime(opts.buffer);
992
+ if (sniffed && (!isGenericMime(sniffed) || !extMime)) return sniffed;
993
+ if (extMime) return extMime;
994
+ if (headerMime && !isGenericMime(headerMime)) return headerMime;
995
+ if (sniffed) return sniffed;
996
+ if (headerMime) return headerMime;
997
+ }
998
+ function extensionForMime(mime) {
999
+ if (!mime) return;
1000
+ return EXT_BY_MIME[mime.toLowerCase()];
1001
+ }
1002
+ function isGifMedia(opts) {
1003
+ if (opts.contentType?.toLowerCase() === "image/gif") return true;
1004
+ return getFileExtension(opts.fileName) === ".gif";
1005
+ }
1006
+ function imageMimeFromFormat(format) {
1007
+ if (!format) return;
1008
+ switch (format.toLowerCase()) {
1009
+ case "jpg":
1010
+ case "jpeg": return "image/jpeg";
1011
+ case "heic": return "image/heic";
1012
+ case "heif": return "image/heif";
1013
+ case "png": return "image/png";
1014
+ case "webp": return "image/webp";
1015
+ case "gif": return "image/gif";
1016
+ default: return;
1017
+ }
1018
+ }
1019
+ function kindFromMime(mime) {
1020
+ return mediaKindFromMime(mime);
1021
+ }
1022
+
1023
+ //#endregion
1024
+ //#region src/media/store.ts
1025
+ const resolveMediaDir = () => path.join(resolveConfigDir(), "media");
1026
+ const MEDIA_MAX_BYTES = 5 * 1024 * 1024;
1027
+ const MAX_BYTES = MEDIA_MAX_BYTES;
1028
+ const DEFAULT_TTL_MS = 120 * 1e3;
1029
+ /**
1030
+ * Sanitize a filename for cross-platform safety.
1031
+ * Removes chars unsafe on Windows/SharePoint/all platforms.
1032
+ * Keeps: alphanumeric, dots, hyphens, underscores, Unicode letters/numbers.
1033
+ */
1034
+ function sanitizeFilename(name) {
1035
+ const trimmed = name.trim();
1036
+ if (!trimmed) return "";
1037
+ return trimmed.replace(/[^\p{L}\p{N}._-]+/gu, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").slice(0, 60);
1038
+ }
1039
+ function getMediaDir() {
1040
+ return resolveMediaDir();
1041
+ }
1042
+ async function ensureMediaDir() {
1043
+ const mediaDir = resolveMediaDir();
1044
+ await fs$1.mkdir(mediaDir, {
1045
+ recursive: true,
1046
+ mode: 448
1047
+ });
1048
+ return mediaDir;
1049
+ }
1050
+ async function saveMediaBuffer(buffer, contentType, subdir = "inbound", maxBytes = MAX_BYTES, originalFilename) {
1051
+ if (buffer.byteLength > maxBytes) throw new Error(`Media exceeds ${(maxBytes / (1024 * 1024)).toFixed(0)}MB limit`);
1052
+ const dir = path.join(resolveMediaDir(), subdir);
1053
+ await fs$1.mkdir(dir, {
1054
+ recursive: true,
1055
+ mode: 448
1056
+ });
1057
+ const uuid = crypto.randomUUID();
1058
+ const headerExt = extensionForMime(contentType?.split(";")[0]?.trim() ?? void 0);
1059
+ const mime = await detectMime({
1060
+ buffer,
1061
+ headerMime: contentType
1062
+ });
1063
+ const ext = headerExt ?? extensionForMime(mime) ?? "";
1064
+ let id;
1065
+ if (originalFilename) {
1066
+ const base = path.parse(originalFilename).name;
1067
+ const sanitized = sanitizeFilename(base);
1068
+ id = sanitized ? `${sanitized}---${uuid}${ext}` : `${uuid}${ext}`;
1069
+ } else id = ext ? `${uuid}${ext}` : uuid;
1070
+ const dest = path.join(dir, id);
1071
+ await fs$1.writeFile(dest, buffer, { mode: 384 });
1072
+ return {
1073
+ id,
1074
+ path: dest,
1075
+ size: buffer.byteLength,
1076
+ contentType: mime
1077
+ };
1078
+ }
1079
+
1080
+ //#endregion
1081
+ //#region src/media/image-ops.ts
1082
+ function isBun() {
1083
+ return typeof process.versions.bun === "string";
1084
+ }
1085
+ function prefersSips() {
1086
+ return process.env.ATLAS_IMAGE_BACKEND === "sips" || process.env.ATLAS_IMAGE_BACKEND !== "sharp" && isBun() && process.platform === "darwin";
1087
+ }
1088
+ async function loadSharp() {
1089
+ const mod = await import("sharp");
1090
+ const sharp = mod.default ?? mod;
1091
+ return (buffer) => sharp(buffer, { failOnError: false });
1092
+ }
1093
+ /**
1094
+ * Reads EXIF orientation from JPEG buffer.
1095
+ * Returns orientation value 1-8, or null if not found/not JPEG.
1096
+ *
1097
+ * EXIF orientation values:
1098
+ * 1 = Normal, 2 = Flip H, 3 = Rotate 180, 4 = Flip V,
1099
+ * 5 = Rotate 270 CW + Flip H, 6 = Rotate 90 CW, 7 = Rotate 90 CW + Flip H, 8 = Rotate 270 CW
1100
+ */
1101
+ function readJpegExifOrientation(buffer) {
1102
+ if (buffer.length < 2 || buffer[0] !== 255 || buffer[1] !== 216) return null;
1103
+ let offset = 2;
1104
+ while (offset < buffer.length - 4) {
1105
+ if (buffer[offset] !== 255) {
1106
+ offset++;
1107
+ continue;
1108
+ }
1109
+ const marker = buffer[offset + 1];
1110
+ if (marker === 255) {
1111
+ offset++;
1112
+ continue;
1113
+ }
1114
+ if (marker === 225) {
1115
+ const exifStart = offset + 4;
1116
+ if (buffer.length > exifStart + 6 && buffer.toString("ascii", exifStart, exifStart + 4) === "Exif" && buffer[exifStart + 4] === 0 && buffer[exifStart + 5] === 0) {
1117
+ const tiffStart = exifStart + 6;
1118
+ if (buffer.length < tiffStart + 8) return null;
1119
+ const isLittleEndian = buffer.toString("ascii", tiffStart, tiffStart + 2) === "II";
1120
+ const readU16 = (pos) => isLittleEndian ? buffer.readUInt16LE(pos) : buffer.readUInt16BE(pos);
1121
+ const readU32 = (pos) => isLittleEndian ? buffer.readUInt32LE(pos) : buffer.readUInt32BE(pos);
1122
+ const ifd0Start = tiffStart + readU32(tiffStart + 4);
1123
+ if (buffer.length < ifd0Start + 2) return null;
1124
+ const numEntries = readU16(ifd0Start);
1125
+ for (let i = 0; i < numEntries; i++) {
1126
+ const entryOffset = ifd0Start + 2 + i * 12;
1127
+ if (buffer.length < entryOffset + 12) break;
1128
+ if (readU16(entryOffset) === 274) {
1129
+ const value = readU16(entryOffset + 8);
1130
+ return value >= 1 && value <= 8 ? value : null;
1131
+ }
1132
+ }
1133
+ }
1134
+ return null;
1135
+ }
1136
+ if (marker >= 224 && marker <= 239) {
1137
+ const segmentLength = buffer.readUInt16BE(offset + 2);
1138
+ offset += 2 + segmentLength;
1139
+ continue;
1140
+ }
1141
+ if (marker === 192 || marker === 218) break;
1142
+ offset++;
1143
+ }
1144
+ return null;
1145
+ }
1146
+ async function withTempDir(fn) {
1147
+ const dir = await fs$1.mkdtemp(path.join(os.tmpdir(), "atlas-img-"));
1148
+ try {
1149
+ return await fn(dir);
1150
+ } finally {
1151
+ await fs$1.rm(dir, {
1152
+ recursive: true,
1153
+ force: true
1154
+ }).catch(() => {});
1155
+ }
1156
+ }
1157
+ async function sipsMetadataFromBuffer(buffer) {
1158
+ return await withTempDir(async (dir) => {
1159
+ const input = path.join(dir, "in.img");
1160
+ await fs$1.writeFile(input, buffer);
1161
+ const { stdout } = await runExec("/usr/bin/sips", [
1162
+ "-g",
1163
+ "pixelWidth",
1164
+ "-g",
1165
+ "pixelHeight",
1166
+ input
1167
+ ], {
1168
+ timeoutMs: 1e4,
1169
+ maxBuffer: 512 * 1024
1170
+ });
1171
+ const w = stdout.match(/pixelWidth:\s*([0-9]+)/);
1172
+ const h = stdout.match(/pixelHeight:\s*([0-9]+)/);
1173
+ if (!w?.[1] || !h?.[1]) return null;
1174
+ const width = Number.parseInt(w[1], 10);
1175
+ const height = Number.parseInt(h[1], 10);
1176
+ if (!Number.isFinite(width) || !Number.isFinite(height)) return null;
1177
+ if (width <= 0 || height <= 0) return null;
1178
+ return {
1179
+ width,
1180
+ height
1181
+ };
1182
+ });
1183
+ }
1184
+ async function sipsResizeToJpeg(params) {
1185
+ return await withTempDir(async (dir) => {
1186
+ const input = path.join(dir, "in.img");
1187
+ const output = path.join(dir, "out.jpg");
1188
+ await fs$1.writeFile(input, params.buffer);
1189
+ await runExec("/usr/bin/sips", [
1190
+ "-Z",
1191
+ String(Math.max(1, Math.round(params.maxSide))),
1192
+ "-s",
1193
+ "format",
1194
+ "jpeg",
1195
+ "-s",
1196
+ "formatOptions",
1197
+ String(Math.max(1, Math.min(100, Math.round(params.quality)))),
1198
+ input,
1199
+ "--out",
1200
+ output
1201
+ ], {
1202
+ timeoutMs: 2e4,
1203
+ maxBuffer: 1024 * 1024
1204
+ });
1205
+ return await fs$1.readFile(output);
1206
+ });
1207
+ }
1208
+ async function sipsConvertToJpeg(buffer) {
1209
+ return await withTempDir(async (dir) => {
1210
+ const input = path.join(dir, "in.heic");
1211
+ const output = path.join(dir, "out.jpg");
1212
+ await fs$1.writeFile(input, buffer);
1213
+ await runExec("/usr/bin/sips", [
1214
+ "-s",
1215
+ "format",
1216
+ "jpeg",
1217
+ input,
1218
+ "--out",
1219
+ output
1220
+ ], {
1221
+ timeoutMs: 2e4,
1222
+ maxBuffer: 1024 * 1024
1223
+ });
1224
+ return await fs$1.readFile(output);
1225
+ });
1226
+ }
1227
+ async function getImageMetadata(buffer) {
1228
+ if (prefersSips()) return await sipsMetadataFromBuffer(buffer).catch(() => null);
1229
+ try {
1230
+ const meta = await (await loadSharp())(buffer).metadata();
1231
+ const width = Number(meta.width ?? 0);
1232
+ const height = Number(meta.height ?? 0);
1233
+ if (!Number.isFinite(width) || !Number.isFinite(height)) return null;
1234
+ if (width <= 0 || height <= 0) return null;
1235
+ return {
1236
+ width,
1237
+ height
1238
+ };
1239
+ } catch {
1240
+ return null;
1241
+ }
1242
+ }
1243
+ /**
1244
+ * Applies rotation/flip to image buffer using sips based on EXIF orientation.
1245
+ */
1246
+ async function sipsApplyOrientation(buffer, orientation) {
1247
+ const ops = [];
1248
+ switch (orientation) {
1249
+ case 2:
1250
+ ops.push("-f", "horizontal");
1251
+ break;
1252
+ case 3:
1253
+ ops.push("-r", "180");
1254
+ break;
1255
+ case 4:
1256
+ ops.push("-f", "vertical");
1257
+ break;
1258
+ case 5:
1259
+ ops.push("-r", "270", "-f", "horizontal");
1260
+ break;
1261
+ case 6:
1262
+ ops.push("-r", "90");
1263
+ break;
1264
+ case 7:
1265
+ ops.push("-r", "90", "-f", "horizontal");
1266
+ break;
1267
+ case 8:
1268
+ ops.push("-r", "270");
1269
+ break;
1270
+ default: return buffer;
1271
+ }
1272
+ return await withTempDir(async (dir) => {
1273
+ const input = path.join(dir, "in.jpg");
1274
+ const output = path.join(dir, "out.jpg");
1275
+ await fs$1.writeFile(input, buffer);
1276
+ await runExec("/usr/bin/sips", [
1277
+ ...ops,
1278
+ input,
1279
+ "--out",
1280
+ output
1281
+ ], {
1282
+ timeoutMs: 2e4,
1283
+ maxBuffer: 1024 * 1024
1284
+ });
1285
+ return await fs$1.readFile(output);
1286
+ });
1287
+ }
1288
+ async function resizeToJpeg(params) {
1289
+ if (prefersSips()) {
1290
+ const normalized = await normalizeExifOrientationSips(params.buffer);
1291
+ if (params.withoutEnlargement !== false) {
1292
+ const meta = await getImageMetadata(normalized);
1293
+ if (meta) {
1294
+ const maxDim = Math.max(meta.width, meta.height);
1295
+ if (maxDim > 0 && maxDim <= params.maxSide) return await sipsResizeToJpeg({
1296
+ buffer: normalized,
1297
+ maxSide: maxDim,
1298
+ quality: params.quality
1299
+ });
1300
+ }
1301
+ }
1302
+ return await sipsResizeToJpeg({
1303
+ buffer: normalized,
1304
+ maxSide: params.maxSide,
1305
+ quality: params.quality
1306
+ });
1307
+ }
1308
+ return await (await loadSharp())(params.buffer).rotate().resize({
1309
+ width: params.maxSide,
1310
+ height: params.maxSide,
1311
+ fit: "inside",
1312
+ withoutEnlargement: params.withoutEnlargement !== false
1313
+ }).jpeg({
1314
+ quality: params.quality,
1315
+ mozjpeg: true
1316
+ }).toBuffer();
1317
+ }
1318
+ async function convertHeicToJpeg(buffer) {
1319
+ if (prefersSips()) return await sipsConvertToJpeg(buffer);
1320
+ return await (await loadSharp())(buffer).jpeg({
1321
+ quality: 90,
1322
+ mozjpeg: true
1323
+ }).toBuffer();
1324
+ }
1325
+ /**
1326
+ * Checks if an image has an alpha channel (transparency).
1327
+ * Returns true if the image has alpha, false otherwise.
1328
+ */
1329
+ async function hasAlphaChannel(buffer) {
1330
+ try {
1331
+ const meta = await (await loadSharp())(buffer).metadata();
1332
+ return meta.hasAlpha || meta.channels === 4;
1333
+ } catch {
1334
+ return false;
1335
+ }
1336
+ }
1337
+ /**
1338
+ * Resizes an image to PNG format, preserving alpha channel (transparency).
1339
+ * Falls back to sharp only (no sips fallback for PNG with alpha).
1340
+ */
1341
+ async function resizeToPng(params) {
1342
+ const sharp = await loadSharp();
1343
+ const compressionLevel = params.compressionLevel ?? 6;
1344
+ return await sharp(params.buffer).rotate().resize({
1345
+ width: params.maxSide,
1346
+ height: params.maxSide,
1347
+ fit: "inside",
1348
+ withoutEnlargement: params.withoutEnlargement !== false
1349
+ }).png({ compressionLevel }).toBuffer();
1350
+ }
1351
+ async function optimizeImageToPng(buffer, maxBytes) {
1352
+ const sides = [
1353
+ 2048,
1354
+ 1536,
1355
+ 1280,
1356
+ 1024,
1357
+ 800
1358
+ ];
1359
+ const compressionLevels = [
1360
+ 6,
1361
+ 7,
1362
+ 8,
1363
+ 9
1364
+ ];
1365
+ let smallest = null;
1366
+ for (const side of sides) for (const compressionLevel of compressionLevels) try {
1367
+ const out = await resizeToPng({
1368
+ buffer,
1369
+ maxSide: side,
1370
+ compressionLevel,
1371
+ withoutEnlargement: true
1372
+ });
1373
+ const size = out.length;
1374
+ if (!smallest || size < smallest.size) smallest = {
1375
+ buffer: out,
1376
+ size,
1377
+ resizeSide: side,
1378
+ compressionLevel
1379
+ };
1380
+ if (size <= maxBytes) return {
1381
+ buffer: out,
1382
+ optimizedSize: size,
1383
+ resizeSide: side,
1384
+ compressionLevel
1385
+ };
1386
+ } catch {}
1387
+ if (smallest) return {
1388
+ buffer: smallest.buffer,
1389
+ optimizedSize: smallest.size,
1390
+ resizeSide: smallest.resizeSide,
1391
+ compressionLevel: smallest.compressionLevel
1392
+ };
1393
+ throw new Error("Failed to optimize PNG image");
1394
+ }
1395
+ /**
1396
+ * Internal sips-only EXIF normalization (no sharp fallback).
1397
+ * Used by resizeToJpeg to normalize before sips resize.
1398
+ */
1399
+ async function normalizeExifOrientationSips(buffer) {
1400
+ try {
1401
+ const orientation = readJpegExifOrientation(buffer);
1402
+ if (!orientation || orientation === 1) return buffer;
1403
+ return await sipsApplyOrientation(buffer, orientation);
1404
+ } catch {
1405
+ return buffer;
1406
+ }
1407
+ }
1408
+
1409
+ //#endregion
1410
+ //#region src/browser/screenshot.ts
1411
+ const DEFAULT_BROWSER_SCREENSHOT_MAX_SIDE = 2e3;
1412
+ const DEFAULT_BROWSER_SCREENSHOT_MAX_BYTES = 5 * 1024 * 1024;
1413
+ async function normalizeBrowserScreenshot(buffer, opts) {
1414
+ const maxSide = Math.max(1, Math.round(opts?.maxSide ?? DEFAULT_BROWSER_SCREENSHOT_MAX_SIDE));
1415
+ const maxBytes = Math.max(1, Math.round(opts?.maxBytes ?? DEFAULT_BROWSER_SCREENSHOT_MAX_BYTES));
1416
+ const meta = await getImageMetadata(buffer);
1417
+ const width = Number(meta?.width ?? 0);
1418
+ const height = Number(meta?.height ?? 0);
1419
+ const maxDim = Math.max(width, height);
1420
+ if (buffer.byteLength <= maxBytes && (maxDim === 0 || width <= maxSide && height <= maxSide)) return { buffer };
1421
+ const qualities = [
1422
+ 85,
1423
+ 75,
1424
+ 65,
1425
+ 55,
1426
+ 45,
1427
+ 35
1428
+ ];
1429
+ const sideGrid = [
1430
+ maxDim > 0 ? Math.min(maxSide, maxDim) : maxSide,
1431
+ 1800,
1432
+ 1600,
1433
+ 1400,
1434
+ 1200,
1435
+ 1e3,
1436
+ 800
1437
+ ].map((v) => Math.min(maxSide, v)).filter((v, i, arr) => v > 0 && arr.indexOf(v) === i).toSorted((a, b) => b - a);
1438
+ let smallest = null;
1439
+ for (const side of sideGrid) for (const quality of qualities) {
1440
+ const out = await resizeToJpeg({
1441
+ buffer,
1442
+ maxSide: side,
1443
+ quality,
1444
+ withoutEnlargement: true
1445
+ });
1446
+ if (!smallest || out.byteLength < smallest.size) smallest = {
1447
+ buffer: out,
1448
+ size: out.byteLength
1449
+ };
1450
+ if (out.byteLength <= maxBytes) return {
1451
+ buffer: out,
1452
+ contentType: "image/jpeg"
1453
+ };
1454
+ }
1455
+ const best = smallest?.buffer ?? buffer;
1456
+ throw new Error(`Browser screenshot could not be reduced below ${(maxBytes / (1024 * 1024)).toFixed(0)}MB (got ${(best.byteLength / (1024 * 1024)).toFixed(2)}MB)`);
1457
+ }
1458
+
1459
+ //#endregion
1460
+ //#region src/browser/routes/agent.snapshot.ts
1461
+ function registerBrowserAgentSnapshotRoutes(app, ctx) {
1462
+ app.post("/navigate", async (req, res) => {
1463
+ const profileCtx = resolveProfileContext(req, res, ctx);
1464
+ if (!profileCtx) return;
1465
+ const body = readBody(req);
1466
+ const url = toStringOrEmpty(body.url);
1467
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
1468
+ if (!url) return jsonError(res, 400, "url is required");
1469
+ try {
1470
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1471
+ const pw = await requirePwAi(res, "navigate");
1472
+ if (!pw) return;
1473
+ const result = await pw.navigateViaPlaywright({
1474
+ cdpUrl: profileCtx.profile.cdpUrl,
1475
+ targetId: tab.targetId,
1476
+ url
1477
+ });
1478
+ res.json({
1479
+ ok: true,
1480
+ targetId: tab.targetId,
1481
+ ...result
1482
+ });
1483
+ } catch (err) {
1484
+ handleRouteError(ctx, res, err);
1485
+ }
1486
+ });
1487
+ app.post("/pdf", async (req, res) => {
1488
+ const profileCtx = resolveProfileContext(req, res, ctx);
1489
+ if (!profileCtx) return;
1490
+ const targetId = toStringOrEmpty(readBody(req).targetId) || void 0;
1491
+ try {
1492
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1493
+ const pw = await requirePwAi(res, "pdf");
1494
+ if (!pw) return;
1495
+ const pdf = await pw.pdfViaPlaywright({
1496
+ cdpUrl: profileCtx.profile.cdpUrl,
1497
+ targetId: tab.targetId
1498
+ });
1499
+ await ensureMediaDir();
1500
+ const saved = await saveMediaBuffer(pdf.buffer, "application/pdf", "browser", pdf.buffer.byteLength);
1501
+ res.json({
1502
+ ok: true,
1503
+ path: path.resolve(saved.path),
1504
+ targetId: tab.targetId,
1505
+ url: tab.url
1506
+ });
1507
+ } catch (err) {
1508
+ handleRouteError(ctx, res, err);
1509
+ }
1510
+ });
1511
+ app.post("/screenshot", async (req, res) => {
1512
+ const profileCtx = resolveProfileContext(req, res, ctx);
1513
+ if (!profileCtx) return;
1514
+ const body = readBody(req);
1515
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
1516
+ const fullPage = toBoolean(body.fullPage) ?? false;
1517
+ const ref = toStringOrEmpty(body.ref) || void 0;
1518
+ const element = toStringOrEmpty(body.element) || void 0;
1519
+ const type = body.type === "jpeg" ? "jpeg" : "png";
1520
+ if (fullPage && (ref || element)) return jsonError(res, 400, "fullPage is not supported for element screenshots");
1521
+ try {
1522
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1523
+ let buffer;
1524
+ if (profileCtx.profile.driver === "extension" || !tab.wsUrl || Boolean(ref) || Boolean(element)) {
1525
+ const pw = await requirePwAi(res, "screenshot");
1526
+ if (!pw) return;
1527
+ buffer = (await pw.takeScreenshotViaPlaywright({
1528
+ cdpUrl: profileCtx.profile.cdpUrl,
1529
+ targetId: tab.targetId,
1530
+ ref,
1531
+ element,
1532
+ fullPage,
1533
+ type
1534
+ })).buffer;
1535
+ } else buffer = await captureScreenshot({
1536
+ wsUrl: tab.wsUrl ?? "",
1537
+ fullPage,
1538
+ format: type,
1539
+ quality: type === "jpeg" ? 85 : void 0
1540
+ });
1541
+ const normalized = await normalizeBrowserScreenshot(buffer, {
1542
+ maxSide: DEFAULT_BROWSER_SCREENSHOT_MAX_SIDE,
1543
+ maxBytes: DEFAULT_BROWSER_SCREENSHOT_MAX_BYTES
1544
+ });
1545
+ await ensureMediaDir();
1546
+ const saved = await saveMediaBuffer(normalized.buffer, normalized.contentType ?? `image/${type}`, "browser", DEFAULT_BROWSER_SCREENSHOT_MAX_BYTES);
1547
+ res.json({
1548
+ ok: true,
1549
+ path: path.resolve(saved.path),
1550
+ targetId: tab.targetId,
1551
+ url: tab.url
1552
+ });
1553
+ } catch (err) {
1554
+ handleRouteError(ctx, res, err);
1555
+ }
1556
+ });
1557
+ app.get("/snapshot", async (req, res) => {
1558
+ const profileCtx = resolveProfileContext(req, res, ctx);
1559
+ if (!profileCtx) return;
1560
+ const targetId = typeof req.query.targetId === "string" ? req.query.targetId.trim() : "";
1561
+ const mode = req.query.mode === "efficient" ? "efficient" : void 0;
1562
+ const labels = toBoolean(req.query.labels) ?? void 0;
1563
+ const format = (req.query.format === "aria" ? "aria" : req.query.format === "ai" ? "ai" : void 0) ?? (mode ? "ai" : await getPwAiModule() ? "ai" : "aria");
1564
+ const limitRaw = typeof req.query.limit === "string" ? Number(req.query.limit) : void 0;
1565
+ const hasMaxChars = Object.hasOwn(req.query, "maxChars");
1566
+ const maxCharsRaw = typeof req.query.maxChars === "string" ? Number(req.query.maxChars) : void 0;
1567
+ const limit = Number.isFinite(limitRaw) ? limitRaw : void 0;
1568
+ const resolvedMaxChars = format === "ai" ? hasMaxChars ? typeof maxCharsRaw === "number" && Number.isFinite(maxCharsRaw) && maxCharsRaw > 0 ? Math.floor(maxCharsRaw) : void 0 : mode === "efficient" ? DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS : DEFAULT_AI_SNAPSHOT_MAX_CHARS : void 0;
1569
+ const interactiveRaw = toBoolean(req.query.interactive);
1570
+ const compactRaw = toBoolean(req.query.compact);
1571
+ const depthRaw = toNumber(req.query.depth);
1572
+ const refsModeRaw = toStringOrEmpty(req.query.refs).trim();
1573
+ const refsMode = refsModeRaw === "aria" ? "aria" : refsModeRaw === "role" ? "role" : void 0;
1574
+ const interactive = interactiveRaw ?? (mode === "efficient" ? true : void 0);
1575
+ const compact = compactRaw ?? (mode === "efficient" ? true : void 0);
1576
+ const depth = depthRaw ?? (mode === "efficient" ? DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH : void 0);
1577
+ const selector = toStringOrEmpty(req.query.selector);
1578
+ const frameSelector = toStringOrEmpty(req.query.frame);
1579
+ try {
1580
+ const tab = await profileCtx.ensureTabAvailable(targetId || void 0);
1581
+ if ((labels || mode === "efficient") && format === "aria") return jsonError(res, 400, "labels/mode=efficient require format=ai");
1582
+ if (format === "ai") {
1583
+ const pw = await requirePwAi(res, "ai snapshot");
1584
+ if (!pw) return;
1585
+ const snap = labels === true || mode === "efficient" || interactive === true || compact === true || depth !== void 0 || Boolean(selector.trim()) || Boolean(frameSelector.trim()) ? await pw.snapshotRoleViaPlaywright({
1586
+ cdpUrl: profileCtx.profile.cdpUrl,
1587
+ targetId: tab.targetId,
1588
+ selector: selector.trim() || void 0,
1589
+ frameSelector: frameSelector.trim() || void 0,
1590
+ refsMode,
1591
+ options: {
1592
+ interactive: interactive ?? void 0,
1593
+ compact: compact ?? void 0,
1594
+ maxDepth: depth ?? void 0
1595
+ }
1596
+ }) : await pw.snapshotAiViaPlaywright({
1597
+ cdpUrl: profileCtx.profile.cdpUrl,
1598
+ targetId: tab.targetId,
1599
+ ...typeof resolvedMaxChars === "number" ? { maxChars: resolvedMaxChars } : {}
1600
+ }).catch(async (err) => {
1601
+ if (String(err).toLowerCase().includes("_snapshotforai")) return await pw.snapshotRoleViaPlaywright({
1602
+ cdpUrl: profileCtx.profile.cdpUrl,
1603
+ targetId: tab.targetId,
1604
+ selector: selector.trim() || void 0,
1605
+ frameSelector: frameSelector.trim() || void 0,
1606
+ refsMode,
1607
+ options: {
1608
+ interactive: interactive ?? void 0,
1609
+ compact: compact ?? void 0,
1610
+ maxDepth: depth ?? void 0
1611
+ }
1612
+ });
1613
+ throw err;
1614
+ });
1615
+ if (labels) {
1616
+ const labeled = await pw.screenshotWithLabelsViaPlaywright({
1617
+ cdpUrl: profileCtx.profile.cdpUrl,
1618
+ targetId: tab.targetId,
1619
+ refs: "refs" in snap ? snap.refs : {},
1620
+ type: "png"
1621
+ });
1622
+ const normalized = await normalizeBrowserScreenshot(labeled.buffer, {
1623
+ maxSide: DEFAULT_BROWSER_SCREENSHOT_MAX_SIDE,
1624
+ maxBytes: DEFAULT_BROWSER_SCREENSHOT_MAX_BYTES
1625
+ });
1626
+ await ensureMediaDir();
1627
+ const saved = await saveMediaBuffer(normalized.buffer, normalized.contentType ?? "image/png", "browser", DEFAULT_BROWSER_SCREENSHOT_MAX_BYTES);
1628
+ const imageType = normalized.contentType?.includes("jpeg") ? "jpeg" : "png";
1629
+ return res.json({
1630
+ ok: true,
1631
+ format,
1632
+ targetId: tab.targetId,
1633
+ url: tab.url,
1634
+ labels: true,
1635
+ labelsCount: labeled.labels,
1636
+ labelsSkipped: labeled.skipped,
1637
+ imagePath: path.resolve(saved.path),
1638
+ imageType,
1639
+ ...snap
1640
+ });
1641
+ }
1642
+ return res.json({
1643
+ ok: true,
1644
+ format,
1645
+ targetId: tab.targetId,
1646
+ url: tab.url,
1647
+ ...snap
1648
+ });
1649
+ }
1650
+ const snap = profileCtx.profile.driver === "extension" || !tab.wsUrl ? requirePwAi(res, "aria snapshot").then(async (pw) => {
1651
+ if (!pw) return null;
1652
+ return await pw.snapshotAriaViaPlaywright({
1653
+ cdpUrl: profileCtx.profile.cdpUrl,
1654
+ targetId: tab.targetId,
1655
+ limit
1656
+ });
1657
+ }) : snapshotAria({
1658
+ wsUrl: tab.wsUrl ?? "",
1659
+ limit
1660
+ });
1661
+ const resolved = await Promise.resolve(snap);
1662
+ if (!resolved) return;
1663
+ return res.json({
1664
+ ok: true,
1665
+ format,
1666
+ targetId: tab.targetId,
1667
+ url: tab.url,
1668
+ ...resolved
1669
+ });
1670
+ } catch (err) {
1671
+ handleRouteError(ctx, res, err);
1672
+ }
1673
+ });
1674
+ }
1675
+
1676
+ //#endregion
1677
+ //#region src/browser/routes/agent.storage.ts
1678
+ function registerBrowserAgentStorageRoutes(app, ctx) {
1679
+ app.get("/cookies", async (req, res) => {
1680
+ const profileCtx = resolveProfileContext(req, res, ctx);
1681
+ if (!profileCtx) return;
1682
+ const targetId = typeof req.query.targetId === "string" ? req.query.targetId.trim() : "";
1683
+ try {
1684
+ const tab = await profileCtx.ensureTabAvailable(targetId || void 0);
1685
+ const pw = await requirePwAi(res, "cookies");
1686
+ if (!pw) return;
1687
+ const result = await pw.cookiesGetViaPlaywright({
1688
+ cdpUrl: profileCtx.profile.cdpUrl,
1689
+ targetId: tab.targetId
1690
+ });
1691
+ res.json({
1692
+ ok: true,
1693
+ targetId: tab.targetId,
1694
+ ...result
1695
+ });
1696
+ } catch (err) {
1697
+ handleRouteError(ctx, res, err);
1698
+ }
1699
+ });
1700
+ app.post("/cookies/set", async (req, res) => {
1701
+ const profileCtx = resolveProfileContext(req, res, ctx);
1702
+ if (!profileCtx) return;
1703
+ const body = readBody(req);
1704
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
1705
+ const cookie = body.cookie && typeof body.cookie === "object" && !Array.isArray(body.cookie) ? body.cookie : null;
1706
+ if (!cookie) return jsonError(res, 400, "cookie is required");
1707
+ try {
1708
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1709
+ const pw = await requirePwAi(res, "cookies set");
1710
+ if (!pw) return;
1711
+ await pw.cookiesSetViaPlaywright({
1712
+ cdpUrl: profileCtx.profile.cdpUrl,
1713
+ targetId: tab.targetId,
1714
+ cookie: {
1715
+ name: toStringOrEmpty(cookie.name),
1716
+ value: toStringOrEmpty(cookie.value),
1717
+ url: toStringOrEmpty(cookie.url) || void 0,
1718
+ domain: toStringOrEmpty(cookie.domain) || void 0,
1719
+ path: toStringOrEmpty(cookie.path) || void 0,
1720
+ expires: toNumber(cookie.expires) ?? void 0,
1721
+ httpOnly: toBoolean(cookie.httpOnly) ?? void 0,
1722
+ secure: toBoolean(cookie.secure) ?? void 0,
1723
+ sameSite: cookie.sameSite === "Lax" || cookie.sameSite === "None" || cookie.sameSite === "Strict" ? cookie.sameSite : void 0
1724
+ }
1725
+ });
1726
+ res.json({
1727
+ ok: true,
1728
+ targetId: tab.targetId
1729
+ });
1730
+ } catch (err) {
1731
+ handleRouteError(ctx, res, err);
1732
+ }
1733
+ });
1734
+ app.post("/cookies/clear", async (req, res) => {
1735
+ const profileCtx = resolveProfileContext(req, res, ctx);
1736
+ if (!profileCtx) return;
1737
+ const targetId = toStringOrEmpty(readBody(req).targetId) || void 0;
1738
+ try {
1739
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1740
+ const pw = await requirePwAi(res, "cookies clear");
1741
+ if (!pw) return;
1742
+ await pw.cookiesClearViaPlaywright({
1743
+ cdpUrl: profileCtx.profile.cdpUrl,
1744
+ targetId: tab.targetId
1745
+ });
1746
+ res.json({
1747
+ ok: true,
1748
+ targetId: tab.targetId
1749
+ });
1750
+ } catch (err) {
1751
+ handleRouteError(ctx, res, err);
1752
+ }
1753
+ });
1754
+ app.get("/storage/:kind", async (req, res) => {
1755
+ const profileCtx = resolveProfileContext(req, res, ctx);
1756
+ if (!profileCtx) return;
1757
+ const kind = toStringOrEmpty(req.params.kind);
1758
+ if (kind !== "local" && kind !== "session") return jsonError(res, 400, "kind must be local|session");
1759
+ const targetId = typeof req.query.targetId === "string" ? req.query.targetId.trim() : "";
1760
+ const key = typeof req.query.key === "string" ? req.query.key : "";
1761
+ try {
1762
+ const tab = await profileCtx.ensureTabAvailable(targetId || void 0);
1763
+ const pw = await requirePwAi(res, "storage get");
1764
+ if (!pw) return;
1765
+ const result = await pw.storageGetViaPlaywright({
1766
+ cdpUrl: profileCtx.profile.cdpUrl,
1767
+ targetId: tab.targetId,
1768
+ kind,
1769
+ key: key.trim() || void 0
1770
+ });
1771
+ res.json({
1772
+ ok: true,
1773
+ targetId: tab.targetId,
1774
+ ...result
1775
+ });
1776
+ } catch (err) {
1777
+ handleRouteError(ctx, res, err);
1778
+ }
1779
+ });
1780
+ app.post("/storage/:kind/set", async (req, res) => {
1781
+ const profileCtx = resolveProfileContext(req, res, ctx);
1782
+ if (!profileCtx) return;
1783
+ const kind = toStringOrEmpty(req.params.kind);
1784
+ if (kind !== "local" && kind !== "session") return jsonError(res, 400, "kind must be local|session");
1785
+ const body = readBody(req);
1786
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
1787
+ const key = toStringOrEmpty(body.key);
1788
+ if (!key) return jsonError(res, 400, "key is required");
1789
+ const value = typeof body.value === "string" ? body.value : "";
1790
+ try {
1791
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1792
+ const pw = await requirePwAi(res, "storage set");
1793
+ if (!pw) return;
1794
+ await pw.storageSetViaPlaywright({
1795
+ cdpUrl: profileCtx.profile.cdpUrl,
1796
+ targetId: tab.targetId,
1797
+ kind,
1798
+ key,
1799
+ value
1800
+ });
1801
+ res.json({
1802
+ ok: true,
1803
+ targetId: tab.targetId
1804
+ });
1805
+ } catch (err) {
1806
+ handleRouteError(ctx, res, err);
1807
+ }
1808
+ });
1809
+ app.post("/storage/:kind/clear", async (req, res) => {
1810
+ const profileCtx = resolveProfileContext(req, res, ctx);
1811
+ if (!profileCtx) return;
1812
+ const kind = toStringOrEmpty(req.params.kind);
1813
+ if (kind !== "local" && kind !== "session") return jsonError(res, 400, "kind must be local|session");
1814
+ const targetId = toStringOrEmpty(readBody(req).targetId) || void 0;
1815
+ try {
1816
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1817
+ const pw = await requirePwAi(res, "storage clear");
1818
+ if (!pw) return;
1819
+ await pw.storageClearViaPlaywright({
1820
+ cdpUrl: profileCtx.profile.cdpUrl,
1821
+ targetId: tab.targetId,
1822
+ kind
1823
+ });
1824
+ res.json({
1825
+ ok: true,
1826
+ targetId: tab.targetId
1827
+ });
1828
+ } catch (err) {
1829
+ handleRouteError(ctx, res, err);
1830
+ }
1831
+ });
1832
+ app.post("/set/offline", async (req, res) => {
1833
+ const profileCtx = resolveProfileContext(req, res, ctx);
1834
+ if (!profileCtx) return;
1835
+ const body = readBody(req);
1836
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
1837
+ const offline = toBoolean(body.offline);
1838
+ if (offline === void 0) return jsonError(res, 400, "offline is required");
1839
+ try {
1840
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1841
+ const pw = await requirePwAi(res, "offline");
1842
+ if (!pw) return;
1843
+ await pw.setOfflineViaPlaywright({
1844
+ cdpUrl: profileCtx.profile.cdpUrl,
1845
+ targetId: tab.targetId,
1846
+ offline
1847
+ });
1848
+ res.json({
1849
+ ok: true,
1850
+ targetId: tab.targetId
1851
+ });
1852
+ } catch (err) {
1853
+ handleRouteError(ctx, res, err);
1854
+ }
1855
+ });
1856
+ app.post("/set/headers", async (req, res) => {
1857
+ const profileCtx = resolveProfileContext(req, res, ctx);
1858
+ if (!profileCtx) return;
1859
+ const body = readBody(req);
1860
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
1861
+ const headers = body.headers && typeof body.headers === "object" && !Array.isArray(body.headers) ? body.headers : null;
1862
+ if (!headers) return jsonError(res, 400, "headers is required");
1863
+ const parsed = {};
1864
+ for (const [k, v] of Object.entries(headers)) if (typeof v === "string") parsed[k] = v;
1865
+ try {
1866
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1867
+ const pw = await requirePwAi(res, "headers");
1868
+ if (!pw) return;
1869
+ await pw.setExtraHTTPHeadersViaPlaywright({
1870
+ cdpUrl: profileCtx.profile.cdpUrl,
1871
+ targetId: tab.targetId,
1872
+ headers: parsed
1873
+ });
1874
+ res.json({
1875
+ ok: true,
1876
+ targetId: tab.targetId
1877
+ });
1878
+ } catch (err) {
1879
+ handleRouteError(ctx, res, err);
1880
+ }
1881
+ });
1882
+ app.post("/set/credentials", async (req, res) => {
1883
+ const profileCtx = resolveProfileContext(req, res, ctx);
1884
+ if (!profileCtx) return;
1885
+ const body = readBody(req);
1886
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
1887
+ const clear = toBoolean(body.clear) ?? false;
1888
+ const username = toStringOrEmpty(body.username) || void 0;
1889
+ const password = typeof body.password === "string" ? body.password : void 0;
1890
+ try {
1891
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1892
+ const pw = await requirePwAi(res, "http credentials");
1893
+ if (!pw) return;
1894
+ await pw.setHttpCredentialsViaPlaywright({
1895
+ cdpUrl: profileCtx.profile.cdpUrl,
1896
+ targetId: tab.targetId,
1897
+ username,
1898
+ password,
1899
+ clear
1900
+ });
1901
+ res.json({
1902
+ ok: true,
1903
+ targetId: tab.targetId
1904
+ });
1905
+ } catch (err) {
1906
+ handleRouteError(ctx, res, err);
1907
+ }
1908
+ });
1909
+ app.post("/set/geolocation", async (req, res) => {
1910
+ const profileCtx = resolveProfileContext(req, res, ctx);
1911
+ if (!profileCtx) return;
1912
+ const body = readBody(req);
1913
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
1914
+ const clear = toBoolean(body.clear) ?? false;
1915
+ const latitude = toNumber(body.latitude);
1916
+ const longitude = toNumber(body.longitude);
1917
+ const accuracy = toNumber(body.accuracy) ?? void 0;
1918
+ const origin = toStringOrEmpty(body.origin) || void 0;
1919
+ try {
1920
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1921
+ const pw = await requirePwAi(res, "geolocation");
1922
+ if (!pw) return;
1923
+ await pw.setGeolocationViaPlaywright({
1924
+ cdpUrl: profileCtx.profile.cdpUrl,
1925
+ targetId: tab.targetId,
1926
+ latitude,
1927
+ longitude,
1928
+ accuracy,
1929
+ origin,
1930
+ clear
1931
+ });
1932
+ res.json({
1933
+ ok: true,
1934
+ targetId: tab.targetId
1935
+ });
1936
+ } catch (err) {
1937
+ handleRouteError(ctx, res, err);
1938
+ }
1939
+ });
1940
+ app.post("/set/media", async (req, res) => {
1941
+ const profileCtx = resolveProfileContext(req, res, ctx);
1942
+ if (!profileCtx) return;
1943
+ const body = readBody(req);
1944
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
1945
+ const schemeRaw = toStringOrEmpty(body.colorScheme);
1946
+ const colorScheme = schemeRaw === "dark" || schemeRaw === "light" || schemeRaw === "no-preference" ? schemeRaw : schemeRaw === "none" ? null : void 0;
1947
+ if (colorScheme === void 0) return jsonError(res, 400, "colorScheme must be dark|light|no-preference|none");
1948
+ try {
1949
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1950
+ const pw = await requirePwAi(res, "media emulation");
1951
+ if (!pw) return;
1952
+ await pw.emulateMediaViaPlaywright({
1953
+ cdpUrl: profileCtx.profile.cdpUrl,
1954
+ targetId: tab.targetId,
1955
+ colorScheme
1956
+ });
1957
+ res.json({
1958
+ ok: true,
1959
+ targetId: tab.targetId
1960
+ });
1961
+ } catch (err) {
1962
+ handleRouteError(ctx, res, err);
1963
+ }
1964
+ });
1965
+ app.post("/set/timezone", async (req, res) => {
1966
+ const profileCtx = resolveProfileContext(req, res, ctx);
1967
+ if (!profileCtx) return;
1968
+ const body = readBody(req);
1969
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
1970
+ const timezoneId = toStringOrEmpty(body.timezoneId);
1971
+ if (!timezoneId) return jsonError(res, 400, "timezoneId is required");
1972
+ try {
1973
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1974
+ const pw = await requirePwAi(res, "timezone");
1975
+ if (!pw) return;
1976
+ await pw.setTimezoneViaPlaywright({
1977
+ cdpUrl: profileCtx.profile.cdpUrl,
1978
+ targetId: tab.targetId,
1979
+ timezoneId
1980
+ });
1981
+ res.json({
1982
+ ok: true,
1983
+ targetId: tab.targetId
1984
+ });
1985
+ } catch (err) {
1986
+ handleRouteError(ctx, res, err);
1987
+ }
1988
+ });
1989
+ app.post("/set/locale", async (req, res) => {
1990
+ const profileCtx = resolveProfileContext(req, res, ctx);
1991
+ if (!profileCtx) return;
1992
+ const body = readBody(req);
1993
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
1994
+ const locale = toStringOrEmpty(body.locale);
1995
+ if (!locale) return jsonError(res, 400, "locale is required");
1996
+ try {
1997
+ const tab = await profileCtx.ensureTabAvailable(targetId);
1998
+ const pw = await requirePwAi(res, "locale");
1999
+ if (!pw) return;
2000
+ await pw.setLocaleViaPlaywright({
2001
+ cdpUrl: profileCtx.profile.cdpUrl,
2002
+ targetId: tab.targetId,
2003
+ locale
2004
+ });
2005
+ res.json({
2006
+ ok: true,
2007
+ targetId: tab.targetId
2008
+ });
2009
+ } catch (err) {
2010
+ handleRouteError(ctx, res, err);
2011
+ }
2012
+ });
2013
+ app.post("/set/device", async (req, res) => {
2014
+ const profileCtx = resolveProfileContext(req, res, ctx);
2015
+ if (!profileCtx) return;
2016
+ const body = readBody(req);
2017
+ const targetId = toStringOrEmpty(body.targetId) || void 0;
2018
+ const name = toStringOrEmpty(body.name);
2019
+ if (!name) return jsonError(res, 400, "name is required");
2020
+ try {
2021
+ const tab = await profileCtx.ensureTabAvailable(targetId);
2022
+ const pw = await requirePwAi(res, "device emulation");
2023
+ if (!pw) return;
2024
+ await pw.setDeviceViaPlaywright({
2025
+ cdpUrl: profileCtx.profile.cdpUrl,
2026
+ targetId: tab.targetId,
2027
+ name
2028
+ });
2029
+ res.json({
2030
+ ok: true,
2031
+ targetId: tab.targetId
2032
+ });
2033
+ } catch (err) {
2034
+ handleRouteError(ctx, res, err);
2035
+ }
2036
+ });
2037
+ }
2038
+
2039
+ //#endregion
2040
+ //#region src/browser/routes/agent.ts
2041
+ function registerBrowserAgentRoutes(app, ctx) {
2042
+ registerBrowserAgentSnapshotRoutes(app, ctx);
2043
+ registerBrowserAgentActRoutes(app, ctx);
2044
+ registerBrowserAgentDebugRoutes(app, ctx);
2045
+ registerBrowserAgentStorageRoutes(app, ctx);
2046
+ }
2047
+
2048
+ //#endregion
2049
+ //#region src/browser/profiles-service.ts
2050
+ const HEX_COLOR_RE = /^#[0-9A-Fa-f]{6}$/;
2051
+ function createBrowserProfilesService(ctx) {
2052
+ const listProfiles = async () => {
2053
+ return await ctx.listProfiles();
2054
+ };
2055
+ const createProfile = async (params) => {
2056
+ const name = params.name.trim();
2057
+ const rawCdpUrl = params.cdpUrl?.trim() || void 0;
2058
+ const driver = params.driver === "extension" ? "extension" : void 0;
2059
+ if (!isValidProfileName(name)) throw new Error("invalid profile name: use lowercase letters, numbers, and hyphens only");
2060
+ const state = ctx.state();
2061
+ const resolvedProfiles = state.resolved.profiles;
2062
+ if (name in resolvedProfiles) throw new Error(`profile "${name}" already exists`);
2063
+ const cfg = loadConfig();
2064
+ const rawProfiles = cfg.browser?.profiles ?? {};
2065
+ if (name in rawProfiles) throw new Error(`profile "${name}" already exists`);
2066
+ const usedColors = getUsedColors(resolvedProfiles);
2067
+ const profileColor = params.color && HEX_COLOR_RE.test(params.color) ? params.color : allocateColor(usedColors);
2068
+ let profileConfig;
2069
+ if (rawCdpUrl) profileConfig = {
2070
+ cdpUrl: parseHttpUrl(rawCdpUrl, "browser.profiles.cdpUrl").normalized,
2071
+ ...driver ? { driver } : {},
2072
+ color: profileColor
2073
+ };
2074
+ else {
2075
+ const cdpPort = allocateCdpPort(getUsedPorts(resolvedProfiles), deriveDefaultBrowserCdpPortRange(state.resolved.controlPort));
2076
+ if (cdpPort === null) throw new Error("no available CDP ports in range");
2077
+ profileConfig = {
2078
+ cdpPort,
2079
+ ...driver ? { driver } : {},
2080
+ color: profileColor
2081
+ };
2082
+ }
2083
+ await writeConfigFile({
2084
+ ...cfg,
2085
+ browser: {
2086
+ ...cfg.browser,
2087
+ profiles: {
2088
+ ...rawProfiles,
2089
+ [name]: profileConfig
2090
+ }
2091
+ }
2092
+ });
2093
+ state.resolved.profiles[name] = profileConfig;
2094
+ const resolved = resolveProfile(state.resolved, name);
2095
+ if (!resolved) throw new Error(`profile "${name}" not found after creation`);
2096
+ return {
2097
+ ok: true,
2098
+ profile: name,
2099
+ cdpPort: resolved.cdpPort,
2100
+ cdpUrl: resolved.cdpUrl,
2101
+ color: resolved.color,
2102
+ isRemote: !resolved.cdpIsLoopback
2103
+ };
2104
+ };
2105
+ const deleteProfile = async (nameRaw) => {
2106
+ const name = nameRaw.trim();
2107
+ if (!name) throw new Error("profile name is required");
2108
+ if (!isValidProfileName(name)) throw new Error("invalid profile name");
2109
+ const cfg = loadConfig();
2110
+ const profiles = cfg.browser?.profiles ?? {};
2111
+ if (!(name in profiles)) throw new Error(`profile "${name}" not found`);
2112
+ if (name === (cfg.browser?.defaultProfile ?? DEFAULT_BROWSER_DEFAULT_PROFILE_NAME)) throw new Error(`cannot delete the default profile "${name}"; change browser.defaultProfile first`);
2113
+ let deleted = false;
2114
+ const state = ctx.state();
2115
+ if (resolveProfile(state.resolved, name)?.cdpIsLoopback) {
2116
+ try {
2117
+ await ctx.forProfile(name).stopRunningBrowser();
2118
+ } catch {}
2119
+ const userDataDir = resolveAtlasUserDataDir(name);
2120
+ const profileDir = path.dirname(userDataDir);
2121
+ if (fs.existsSync(profileDir)) {
2122
+ await movePathToTrash(profileDir);
2123
+ deleted = true;
2124
+ }
2125
+ }
2126
+ const { [name]: _removed, ...remainingProfiles } = profiles;
2127
+ await writeConfigFile({
2128
+ ...cfg,
2129
+ browser: {
2130
+ ...cfg.browser,
2131
+ profiles: remainingProfiles
2132
+ }
2133
+ });
2134
+ delete state.resolved.profiles[name];
2135
+ state.profiles.delete(name);
2136
+ return {
2137
+ ok: true,
2138
+ profile: name,
2139
+ deleted
2140
+ };
2141
+ };
2142
+ return {
2143
+ listProfiles,
2144
+ createProfile,
2145
+ deleteProfile
2146
+ };
2147
+ }
2148
+
2149
+ //#endregion
2150
+ //#region src/browser/routes/basic.ts
2151
+ function registerBrowserBasicRoutes(app, ctx) {
2152
+ app.get("/profiles", async (_req, res) => {
2153
+ try {
2154
+ const profiles = await createBrowserProfilesService(ctx).listProfiles();
2155
+ res.json({ profiles });
2156
+ } catch (err) {
2157
+ jsonError(res, 500, String(err));
2158
+ }
2159
+ });
2160
+ app.get("/", async (req, res) => {
2161
+ let current;
2162
+ try {
2163
+ current = ctx.state();
2164
+ } catch {
2165
+ return jsonError(res, 503, "browser server not started");
2166
+ }
2167
+ const profileCtx = getProfileContext(req, ctx);
2168
+ if ("error" in profileCtx) return jsonError(res, profileCtx.status, profileCtx.error);
2169
+ const [cdpHttp, cdpReady] = await Promise.all([profileCtx.isHttpReachable(300), profileCtx.isReachable(600)]);
2170
+ const profileState = current.profiles.get(profileCtx.profile.name);
2171
+ let detectedBrowser = null;
2172
+ let detectedExecutablePath = null;
2173
+ let detectError = null;
2174
+ try {
2175
+ const detected = resolveBrowserExecutableForPlatform(current.resolved, process.platform);
2176
+ if (detected) {
2177
+ detectedBrowser = detected.kind;
2178
+ detectedExecutablePath = detected.path;
2179
+ }
2180
+ } catch (err) {
2181
+ detectError = String(err);
2182
+ }
2183
+ res.json({
2184
+ enabled: current.resolved.enabled,
2185
+ profile: profileCtx.profile.name,
2186
+ running: cdpReady,
2187
+ cdpReady,
2188
+ cdpHttp,
2189
+ pid: profileState?.running?.pid ?? null,
2190
+ cdpPort: profileCtx.profile.cdpPort,
2191
+ cdpUrl: profileCtx.profile.cdpUrl,
2192
+ chosenBrowser: profileState?.running?.exe.kind ?? null,
2193
+ detectedBrowser,
2194
+ detectedExecutablePath,
2195
+ detectError,
2196
+ userDataDir: profileState?.running?.userDataDir ?? null,
2197
+ color: profileCtx.profile.color,
2198
+ headless: current.resolved.headless,
2199
+ noSandbox: current.resolved.noSandbox,
2200
+ executablePath: current.resolved.executablePath ?? null,
2201
+ attachOnly: current.resolved.attachOnly
2202
+ });
2203
+ });
2204
+ app.post("/start", async (req, res) => {
2205
+ const profileCtx = getProfileContext(req, ctx);
2206
+ if ("error" in profileCtx) return jsonError(res, profileCtx.status, profileCtx.error);
2207
+ try {
2208
+ await profileCtx.ensureBrowserAvailable();
2209
+ res.json({
2210
+ ok: true,
2211
+ profile: profileCtx.profile.name
2212
+ });
2213
+ } catch (err) {
2214
+ jsonError(res, 500, String(err));
2215
+ }
2216
+ });
2217
+ app.post("/stop", async (req, res) => {
2218
+ const profileCtx = getProfileContext(req, ctx);
2219
+ if ("error" in profileCtx) return jsonError(res, profileCtx.status, profileCtx.error);
2220
+ try {
2221
+ const result = await profileCtx.stopRunningBrowser();
2222
+ res.json({
2223
+ ok: true,
2224
+ stopped: result.stopped,
2225
+ profile: profileCtx.profile.name
2226
+ });
2227
+ } catch (err) {
2228
+ jsonError(res, 500, String(err));
2229
+ }
2230
+ });
2231
+ app.post("/reset-profile", async (req, res) => {
2232
+ const profileCtx = getProfileContext(req, ctx);
2233
+ if ("error" in profileCtx) return jsonError(res, profileCtx.status, profileCtx.error);
2234
+ try {
2235
+ const result = await profileCtx.resetProfile();
2236
+ res.json({
2237
+ ok: true,
2238
+ profile: profileCtx.profile.name,
2239
+ ...result
2240
+ });
2241
+ } catch (err) {
2242
+ jsonError(res, 500, String(err));
2243
+ }
2244
+ });
2245
+ app.post("/profiles/create", async (req, res) => {
2246
+ const name = toStringOrEmpty(req.body?.name);
2247
+ const color = toStringOrEmpty(req.body?.color);
2248
+ const cdpUrl = toStringOrEmpty(req.body?.cdpUrl);
2249
+ const driver = toStringOrEmpty(req.body?.driver);
2250
+ if (!name) return jsonError(res, 400, "name is required");
2251
+ try {
2252
+ const result = await createBrowserProfilesService(ctx).createProfile({
2253
+ name,
2254
+ color: color || void 0,
2255
+ cdpUrl: cdpUrl || void 0,
2256
+ driver: driver === "extension" ? "extension" : void 0
2257
+ });
2258
+ res.json(result);
2259
+ } catch (err) {
2260
+ const msg = String(err);
2261
+ if (msg.includes("already exists")) return jsonError(res, 409, msg);
2262
+ if (msg.includes("invalid profile name")) return jsonError(res, 400, msg);
2263
+ if (msg.includes("no available CDP ports")) return jsonError(res, 507, msg);
2264
+ if (msg.includes("cdpUrl")) return jsonError(res, 400, msg);
2265
+ jsonError(res, 500, msg);
2266
+ }
2267
+ });
2268
+ app.delete("/profiles/:name", async (req, res) => {
2269
+ const name = toStringOrEmpty(req.params.name);
2270
+ if (!name) return jsonError(res, 400, "profile name is required");
2271
+ try {
2272
+ const result = await createBrowserProfilesService(ctx).deleteProfile(name);
2273
+ res.json(result);
2274
+ } catch (err) {
2275
+ const msg = String(err);
2276
+ if (msg.includes("invalid profile name")) return jsonError(res, 400, msg);
2277
+ if (msg.includes("default profile")) return jsonError(res, 400, msg);
2278
+ if (msg.includes("not found")) return jsonError(res, 404, msg);
2279
+ jsonError(res, 500, msg);
2280
+ }
2281
+ });
2282
+ }
2283
+
2284
+ //#endregion
2285
+ //#region src/browser/routes/tabs.ts
2286
+ function registerBrowserTabRoutes(app, ctx) {
2287
+ app.get("/tabs", async (req, res) => {
2288
+ const profileCtx = getProfileContext(req, ctx);
2289
+ if ("error" in profileCtx) return jsonError(res, profileCtx.status, profileCtx.error);
2290
+ try {
2291
+ if (!await profileCtx.isReachable(300)) return res.json({
2292
+ running: false,
2293
+ tabs: []
2294
+ });
2295
+ const tabs = await profileCtx.listTabs();
2296
+ res.json({
2297
+ running: true,
2298
+ tabs
2299
+ });
2300
+ } catch (err) {
2301
+ jsonError(res, 500, String(err));
2302
+ }
2303
+ });
2304
+ app.post("/tabs/open", async (req, res) => {
2305
+ const profileCtx = getProfileContext(req, ctx);
2306
+ if ("error" in profileCtx) return jsonError(res, profileCtx.status, profileCtx.error);
2307
+ const url = toStringOrEmpty(req.body?.url);
2308
+ if (!url) return jsonError(res, 400, "url is required");
2309
+ try {
2310
+ await profileCtx.ensureBrowserAvailable();
2311
+ const tab = await profileCtx.openTab(url);
2312
+ res.json(tab);
2313
+ } catch (err) {
2314
+ jsonError(res, 500, String(err));
2315
+ }
2316
+ });
2317
+ app.post("/tabs/focus", async (req, res) => {
2318
+ const profileCtx = getProfileContext(req, ctx);
2319
+ if ("error" in profileCtx) return jsonError(res, profileCtx.status, profileCtx.error);
2320
+ const targetId = toStringOrEmpty(req.body?.targetId);
2321
+ if (!targetId) return jsonError(res, 400, "targetId is required");
2322
+ try {
2323
+ if (!await profileCtx.isReachable(300)) return jsonError(res, 409, "browser not running");
2324
+ await profileCtx.focusTab(targetId);
2325
+ res.json({ ok: true });
2326
+ } catch (err) {
2327
+ const mapped = ctx.mapTabError(err);
2328
+ if (mapped) return jsonError(res, mapped.status, mapped.message);
2329
+ jsonError(res, 500, String(err));
2330
+ }
2331
+ });
2332
+ app.delete("/tabs/:targetId", async (req, res) => {
2333
+ const profileCtx = getProfileContext(req, ctx);
2334
+ if ("error" in profileCtx) return jsonError(res, profileCtx.status, profileCtx.error);
2335
+ const targetId = toStringOrEmpty(req.params.targetId);
2336
+ if (!targetId) return jsonError(res, 400, "targetId is required");
2337
+ try {
2338
+ if (!await profileCtx.isReachable(300)) return jsonError(res, 409, "browser not running");
2339
+ await profileCtx.closeTab(targetId);
2340
+ res.json({ ok: true });
2341
+ } catch (err) {
2342
+ const mapped = ctx.mapTabError(err);
2343
+ if (mapped) return jsonError(res, mapped.status, mapped.message);
2344
+ jsonError(res, 500, String(err));
2345
+ }
2346
+ });
2347
+ app.post("/tabs/action", async (req, res) => {
2348
+ const profileCtx = getProfileContext(req, ctx);
2349
+ if ("error" in profileCtx) return jsonError(res, profileCtx.status, profileCtx.error);
2350
+ const action = toStringOrEmpty(req.body?.action);
2351
+ const index = toNumber(req.body?.index);
2352
+ try {
2353
+ if (action === "list") {
2354
+ if (!await profileCtx.isReachable(300)) return res.json({
2355
+ ok: true,
2356
+ tabs: []
2357
+ });
2358
+ const tabs = await profileCtx.listTabs();
2359
+ return res.json({
2360
+ ok: true,
2361
+ tabs
2362
+ });
2363
+ }
2364
+ if (action === "new") {
2365
+ await profileCtx.ensureBrowserAvailable();
2366
+ const tab = await profileCtx.openTab("about:blank");
2367
+ return res.json({
2368
+ ok: true,
2369
+ tab
2370
+ });
2371
+ }
2372
+ if (action === "close") {
2373
+ const tabs = await profileCtx.listTabs();
2374
+ const target = typeof index === "number" ? tabs[index] : tabs.at(0);
2375
+ if (!target) return jsonError(res, 404, "tab not found");
2376
+ await profileCtx.closeTab(target.targetId);
2377
+ return res.json({
2378
+ ok: true,
2379
+ targetId: target.targetId
2380
+ });
2381
+ }
2382
+ if (action === "select") {
2383
+ if (typeof index !== "number") return jsonError(res, 400, "index is required");
2384
+ const target = (await profileCtx.listTabs())[index];
2385
+ if (!target) return jsonError(res, 404, "tab not found");
2386
+ await profileCtx.focusTab(target.targetId);
2387
+ return res.json({
2388
+ ok: true,
2389
+ targetId: target.targetId
2390
+ });
2391
+ }
2392
+ return jsonError(res, 400, "unknown tab action");
2393
+ } catch (err) {
2394
+ const mapped = ctx.mapTabError(err);
2395
+ if (mapped) return jsonError(res, mapped.status, mapped.message);
2396
+ jsonError(res, 500, String(err));
2397
+ }
2398
+ });
2399
+ }
2400
+
2401
+ //#endregion
2402
+ //#region src/browser/routes/index.ts
2403
+ function registerBrowserRoutes(app, ctx) {
2404
+ registerBrowserBasicRoutes(app, ctx);
2405
+ registerBrowserTabRoutes(app, ctx);
2406
+ registerBrowserAgentRoutes(app, ctx);
2407
+ }
2408
+
2409
+ //#endregion
2410
+ export { resolvePinnedHostnameWithPolicy as C, resolvePinnedHostname as S, maxBytesForKind as _, optimizeImageToPng as a, closeDispatcher as b, saveMediaBuffer as c, getFileExtension as d, imageMimeFromFormat as f, MAX_IMAGE_BYTES as g, kindFromMime as h, hasAlphaChannel as i, detectMime as l, isGifMedia as m, convertHeicToJpeg as n, resizeToJpeg as o, isAudioFileName as p, getImageMetadata as r, getMediaDir as s, registerBrowserRoutes as t, extensionForMime as u, mediaKindFromMime as v, createPinnedDispatcher as x, SsrFBlockedError as y };