@noxsoft/anima 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1570) hide show
  1. package/CHANGELOG.md +2065 -0
  2. package/LICENSE +23 -0
  3. package/README.md +47 -0
  4. package/anima.mjs +56 -0
  5. package/dist/accounts-Cc5E4IDO.js +260 -0
  6. package/dist/accounts-CcVrwKqv.js +259 -0
  7. package/dist/acp-cli-BbvR4dNz.js +1081 -0
  8. package/dist/acp-cli-CePIi7gD.js +1084 -0
  9. package/dist/agent-CSrGrAg1.js +725 -0
  10. package/dist/agent-NgeWEcBM.js +725 -0
  11. package/dist/agent-events-UF0DxwKS.js +182 -0
  12. package/dist/agent-scope-BVf4aSwY.js +112 -0
  13. package/dist/agent-scope-OZi7lb8S.js +452 -0
  14. package/dist/agent-scope-V1bi9OYL.js +452 -0
  15. package/dist/agents-Bw06WthM.js +809 -0
  16. package/dist/agents.config-Dvo2ULxs.js +182 -0
  17. package/dist/agents.config-d6H0_3oj.js +182 -0
  18. package/dist/argv-DqUHKf0o.js +73 -0
  19. package/dist/audit-Buja3mbS.js +2401 -0
  20. package/dist/audit-CWIz6mM7.js +2401 -0
  21. package/dist/auth-91o2YM96.js +648 -0
  22. package/dist/auth-choice-7dFCqblU.js +2681 -0
  23. package/dist/auth-choice-S_0K9gpl.js +2681 -0
  24. package/dist/auth-health-CctpRTdC.js +149 -0
  25. package/dist/auth-health-DoHai4eD.js +149 -0
  26. package/dist/auth-lZ26wsbN.js +639 -0
  27. package/dist/auth-profiles-Cz2rxrav.js +2690 -0
  28. package/dist/auth-profiles-_5BsNObq.js +1565 -0
  29. package/dist/banner-ieAUufx9.js +294 -0
  30. package/dist/boolean-Ce2-qkSB.js +30 -0
  31. package/dist/boolean-Wzu0-e0P.js +30 -0
  32. package/dist/brew-CVZkr0GU.js +46 -0
  33. package/dist/brew-DAdyX1_1.js +46 -0
  34. package/dist/browser-cli-D_qgYDik.js +1679 -0
  35. package/dist/browser-cli-DldrdaCW.js +1676 -0
  36. package/dist/budget-ChKARYPY.js +132 -0
  37. package/dist/budget-Dspr6N_e.js +132 -0
  38. package/dist/build-info.json +5 -0
  39. package/dist/bundled/boot-md/HOOK.md +19 -0
  40. package/dist/bundled/boot-md/handler.js +861 -0
  41. package/dist/bundled/bootstrap-extra-files/HOOK.md +53 -0
  42. package/dist/bundled/bootstrap-extra-files/handler.js +39 -0
  43. package/dist/bundled/command-logger/HOOK.md +122 -0
  44. package/dist/bundled/command-logger/handler.js +55 -0
  45. package/dist/bundled/session-memory/HOOK.md +109 -0
  46. package/dist/bundled/session-memory/handler.js +128 -0
  47. package/dist/call-DPzNR_Qi.js +282 -0
  48. package/dist/call-ktoEhkOQ.js +282 -0
  49. package/dist/canvas-host/a2ui/.bundle.hash +1 -0
  50. package/dist/canvas-host/a2ui/a2ui.bundle.js +19040 -0
  51. package/dist/canvas-host/a2ui/index.html +307 -0
  52. package/dist/catalog-BAayBt1L.js +185 -0
  53. package/dist/catalog-BNsf97BM.js +185 -0
  54. package/dist/channel-options-C3GV4Fgg.js +33 -0
  55. package/dist/channel-options-DJ4GNfwk.js +32 -0
  56. package/dist/channel-selection-CujyiWGM.js +51 -0
  57. package/dist/channel-selection-DfGpCyh2.js +51 -0
  58. package/dist/channel-web-D42mzlCJ.js +2162 -0
  59. package/dist/channels-cli-BAtARz4A.js +1306 -0
  60. package/dist/channels-cli-Ddo_tIRR.js +1304 -0
  61. package/dist/channels-status-issues-DBc1pU_R.js +18 -0
  62. package/dist/channels-status-issues-DjO9MHIG.js +18 -0
  63. package/dist/chrome-Bi6iZ5sG.js +1601 -0
  64. package/dist/chrome-DNSv7Cpy.js +1629 -0
  65. package/dist/chrome-DScZx4Lk.js +1601 -0
  66. package/dist/chunk-mxPVo000.js +348 -0
  67. package/dist/clack-prompter-B0kl7shw.js +92 -0
  68. package/dist/clack-prompter-B1YxZdRy.js +92 -0
  69. package/dist/cli/daemon-cli.js +9 -0
  70. package/dist/cli-D3hUnL_G.js +101 -0
  71. package/dist/cli-DDwD6VgH.js +99 -0
  72. package/dist/cli-session-CP7ZH2-6.js +5463 -0
  73. package/dist/cli-session-oXJQpenl.js +5408 -0
  74. package/dist/cli-utils-BTBABPX9.js +40 -0
  75. package/dist/cli-utils-DtAxdCte.js +40 -0
  76. package/dist/client-C1avc0vD.js +1692 -0
  77. package/dist/client-CC94YZrT.js +1692 -0
  78. package/dist/clipboard-B2fBy8tG.js +31 -0
  79. package/dist/clipboard-BbGnZskJ.js +31 -0
  80. package/dist/command-format-Clp46jkj.js +38 -0
  81. package/dist/command-format-DELazozB.js +52 -0
  82. package/dist/command-format-SkzzRqR1.js +52 -0
  83. package/dist/command-options-CSbuuqHr.js +8 -0
  84. package/dist/command-options-Cp1tf96a.js +8 -0
  85. package/dist/command-registry-DDGudZEQ.js +248 -0
  86. package/dist/commands-CRcFD5MO.js +509 -0
  87. package/dist/commands-Dh40OpQL.js +509 -0
  88. package/dist/commands-registry-Bd0xbvwG.js +766 -0
  89. package/dist/commands-registry-DYfRSVF3.js +766 -0
  90. package/dist/common-D6bu0zHC.js +287 -0
  91. package/dist/common-zW9Y2P1B.js +287 -0
  92. package/dist/completion-cli-B9Cn374l.js +431 -0
  93. package/dist/completion-cli-BEHghUFx.js +432 -0
  94. package/dist/config-Bmm8tmZF.js +6523 -0
  95. package/dist/config-CHc5qzaI.js +5704 -0
  96. package/dist/config-Co6UXXF5.js +11 -0
  97. package/dist/config-Xm0j9LUa.js +5705 -0
  98. package/dist/config-cli-9ZbCHoV8.js +247 -0
  99. package/dist/config-cli-sxuGl29N.js +244 -0
  100. package/dist/config-guard-BwRD-b9Z.js +93 -0
  101. package/dist/config-guard-Dy7wyhAX.js +76 -0
  102. package/dist/config-sync-Bllc1TJ4.js +89 -0
  103. package/dist/config-sync-mfuOoGHl.js +89 -0
  104. package/dist/configure-CCyVzQZ7.js +1006 -0
  105. package/dist/configure-Nntbxt4t.js +1008 -0
  106. package/dist/constants-BwBn5CGe.js +65 -0
  107. package/dist/constants-O8yBqCBv.js +65 -0
  108. package/dist/context-DKaQYnCH.js +60 -0
  109. package/dist/control-service-BeOtZCCS.js +72 -0
  110. package/dist/control-service-vyKJ-XUp.js +72 -0
  111. package/dist/cron-cli-BasqtsJ0.js +451 -0
  112. package/dist/cron-cli-C8XzIpyX.js +448 -0
  113. package/dist/daemon-cli-cwL2GI5i.js +565 -0
  114. package/dist/daemon-cli-sjDh2xbf.js +566 -0
  115. package/dist/daemon-cli.js +13117 -0
  116. package/dist/daemon-runtime-BuMT6nck.js +460 -0
  117. package/dist/daemon-runtime-CTvi3m4D.js +460 -0
  118. package/dist/dangerous-tools-5ObDWy1N.js +32 -0
  119. package/dist/dangerous-tools-Jwr7jqNw.js +32 -0
  120. package/dist/deliver-D6cdhg5m.js +1097 -0
  121. package/dist/deliver-DlNDKlA4.js +1162 -0
  122. package/dist/deliver-bC6iI_rv.js +1097 -0
  123. package/dist/delivery-queue-B6IHz4Ry.js +220 -0
  124. package/dist/delivery-queue-TnQykYsg.js +220 -0
  125. package/dist/deps-C9kDG-Ru.js +42 -0
  126. package/dist/devices-cli-BE-Nib4Y.js +198 -0
  127. package/dist/devices-cli-GyPlNRyd.js +195 -0
  128. package/dist/diagnostics-Dj75aEHN.js +35 -0
  129. package/dist/diagnostics-DlIw6fqD.js +35 -0
  130. package/dist/directory-cli-BEaIvWkc.js +246 -0
  131. package/dist/directory-cli-CZ_-DP5Z.js +243 -0
  132. package/dist/dispatcher-Bkcui7jz.js +100 -0
  133. package/dist/dispatcher-C1B6cT_7.js +100 -0
  134. package/dist/display-A8k-mxv8.js +171 -0
  135. package/dist/display-BDOsXu8F.js +171 -0
  136. package/dist/dns-cli-BUzpVoMv.js +200 -0
  137. package/dist/dns-cli-DstQOMQt.js +197 -0
  138. package/dist/dock-DbxBBv30.js +753 -0
  139. package/dist/dock-cPBY4qGl.js +753 -0
  140. package/dist/docs-cli-BWp6p-Tq.js +161 -0
  141. package/dist/docs-cli-x22FnZfL.js +159 -0
  142. package/dist/doctor-B5HFw-nC.js +1813 -0
  143. package/dist/doctor-DnEyqGcQ.js +1815 -0
  144. package/dist/doctor-completion-BMEPXgVg.js +92 -0
  145. package/dist/doctor-completion-usPeH2ol.js +92 -0
  146. package/dist/doctor-config-flow-CS0WFnjL.js +1232 -0
  147. package/dist/doctor-config-flow-Cs4O_Kmq.js +1232 -0
  148. package/dist/engine-DgK9s3lk.js +561 -0
  149. package/dist/engine-ZSd5I5JN.js +561 -0
  150. package/dist/entry.js +1560 -0
  151. package/dist/env-0lJfCPsw.js +32 -0
  152. package/dist/errors-A_GqUU6B.js +26 -0
  153. package/dist/errors-CHow2wtt.js +37 -0
  154. package/dist/errors-Cojm0Kl7.js +37 -0
  155. package/dist/exec-BenD3A5l.js +1167 -0
  156. package/dist/exec-BizYYQgP.js +255 -0
  157. package/dist/exec-Bv3pyjeM.js +255 -0
  158. package/dist/exec-approvals-BP9AhCSw.js +1221 -0
  159. package/dist/exec-approvals-CdLmKX2R.js +1221 -0
  160. package/dist/exec-approvals-cli-25CGlFNw.js +368 -0
  161. package/dist/exec-approvals-cli-BXZ-hOlT.js +371 -0
  162. package/dist/extensionAPI.js +8542 -0
  163. package/dist/format-CjKG6raZ.js +20 -0
  164. package/dist/format-Mq6iU0_5.js +20 -0
  165. package/dist/format-duration-Cm3xh8xz.js +58 -0
  166. package/dist/format-duration-DhWzz_5b.js +58 -0
  167. package/dist/format-relative-C6kUHuOj.js +55 -0
  168. package/dist/format-relative-sy9iviQN.js +55 -0
  169. package/dist/frontmatter-YijVi0FQ.js +204 -0
  170. package/dist/gateway-cli-B9uc0RCI.js +19971 -0
  171. package/dist/gateway-cli-D8Qz7kCf.js +19972 -0
  172. package/dist/gateway-rpc-Ch9mCYEB.js +28 -0
  173. package/dist/gateway-rpc-DBhcdLFs.js +28 -0
  174. package/dist/github-copilot-auth-D6ZErYqa.js +1418 -0
  175. package/dist/github-copilot-auth-DGmyWJms.js +1418 -0
  176. package/dist/gmail-setup-utils-BPo_LkKI.js +428 -0
  177. package/dist/gmail-setup-utils-D3Yqgor7.js +428 -0
  178. package/dist/health-DsTZaAzV.js +1258 -0
  179. package/dist/health-V6dGthLA.js +1253 -0
  180. package/dist/health-format-CdP99j3Y.js +208 -0
  181. package/dist/health-format-JEChH08S.js +208 -0
  182. package/dist/heartbeat-visibility-CkL00WRR.js +98 -0
  183. package/dist/heartbeat-visibility-Cmni9671.js +98 -0
  184. package/dist/help-format-DUBI91Ti.js +17 -0
  185. package/dist/help-format-Dl4bsrLI.js +17 -0
  186. package/dist/helpers-9N2Q5aZj.js +25 -0
  187. package/dist/helpers-DLgbkcEn.js +25 -0
  188. package/dist/helpers-ZKNRexvX.js +10 -0
  189. package/dist/helpers-eJFa4K6r.js +10 -0
  190. package/dist/hooks-cli-Cu0D0fPS.js +993 -0
  191. package/dist/hooks-cli-E63uffR6.js +991 -0
  192. package/dist/hooks-status-B-e96dZj.js +356 -0
  193. package/dist/hooks-status-C_9sE0ox.js +356 -0
  194. package/dist/image-ops-Dlt3T7th.js +541 -0
  195. package/dist/image-ops-omlvdfah.js +541 -0
  196. package/dist/index.js +499 -0
  197. package/dist/init-Bm04RagW.js +122 -0
  198. package/dist/init-CaJBf4p1.js +122 -0
  199. package/dist/input-provenance-BgwBljRz.js +35 -0
  200. package/dist/input-provenance-DJBdpeKk.js +35 -0
  201. package/dist/input-provenance-iu26y0GH.js +35 -0
  202. package/dist/installs-C2iMRBVz.js +383 -0
  203. package/dist/installs-D-cPGdCw.js +383 -0
  204. package/dist/internal-hooks-DFTIurVM.js +77 -0
  205. package/dist/ipv4-C5QxzriV.js +1964 -0
  206. package/dist/ipv4-TxR9wQCQ.js +1964 -0
  207. package/dist/is-main-Dt9DTcH1.js +25 -0
  208. package/dist/is-main-cB3p7uob.js +25 -0
  209. package/dist/lanes-CNxj3tit.js +232 -0
  210. package/dist/legacy-names-CKU7tKQR.js +8 -0
  211. package/dist/lifecycle-core-B_7XRcvF.js +388 -0
  212. package/dist/lifecycle-core-By83PVAK.js +387 -0
  213. package/dist/links-BfjHVTB_.js +15 -0
  214. package/dist/links-DPGe0OHw.js +15 -0
  215. package/dist/llm-slug-generator.js +62 -0
  216. package/dist/loader-6Qkyybg1.js +87 -0
  217. package/dist/loader-Dmc0KyQK.js +87 -0
  218. package/dist/logging-54nXj81z.js +1 -0
  219. package/dist/logging-BdnOSVPD.js +1 -0
  220. package/dist/logging-DB6BQmhi.js +15 -0
  221. package/dist/logging-mcb66J0p.js +15 -0
  222. package/dist/login--8D8kyRy.js +61 -0
  223. package/dist/login-C-ugYHKt.js +61 -0
  224. package/dist/login-CX5Q2fYl.js +59 -0
  225. package/dist/login-qr-BLmGvITg.js +321 -0
  226. package/dist/login-qr-BNtuXLKL.js +323 -0
  227. package/dist/login-qr-PcyTC7Ra.js +326 -0
  228. package/dist/logs-cli-BEQVkiXp.js +245 -0
  229. package/dist/logs-cli-CIqiVMkY.js +242 -0
  230. package/dist/manager-Bsy9ifug.js +3244 -0
  231. package/dist/manager-CDgcZ51c.js +3246 -0
  232. package/dist/manager-D7QQ5XrE.js +3244 -0
  233. package/dist/manifest-registry-CW1zCyRF.js +748 -0
  234. package/dist/manifest-registry-D4lM2RdV.js +748 -0
  235. package/dist/markdown-tables-BT1X6jqH.js +347 -0
  236. package/dist/markdown-tables-DHgOK2vI.js +348 -0
  237. package/dist/media-THyainiE.js +1342 -0
  238. package/dist/memory-cli-BmIyAOZm.js +869 -0
  239. package/dist/memory-cli-BoXdfCLT.js +868 -0
  240. package/dist/message-channel-dSTVVCyX.js +110 -0
  241. package/dist/message-channel-w4F2b2F6.js +110 -0
  242. package/dist/migrate-BR6iAIjO.js +157 -0
  243. package/dist/migrate-D0EcMs0f.js +157 -0
  244. package/dist/mime-B1ZoR53M.js +145 -0
  245. package/dist/mime-Bm1xTtpY.js +145 -0
  246. package/dist/mime-C1RlpUSs.js +145 -0
  247. package/dist/model-param-b-C4BL7w0Z.js +16 -0
  248. package/dist/model-param-b-DPwyNGn8.js +16 -0
  249. package/dist/model-selection-BnEobs_z.js +2692 -0
  250. package/dist/models-KLd8Evmq.js +2545 -0
  251. package/dist/models-cli-D4UFQLid.js +258 -0
  252. package/dist/models-cli-DJHs5rJF.js +2739 -0
  253. package/dist/net-B5lXhYLV.js +218 -0
  254. package/dist/net-CDi_lJMH.js +88 -0
  255. package/dist/node-cli-BNCJUkgA.js +1319 -0
  256. package/dist/node-cli-C7S0vk0_.js +1322 -0
  257. package/dist/node-match-8XZnaid6.js +34 -0
  258. package/dist/node-match-B3Osv-5C.js +34 -0
  259. package/dist/node-service-BFxHJsno.js +67 -0
  260. package/dist/node-service-DUnan4uK.js +67 -0
  261. package/dist/nodes-cli-DOXhYgc8.js +1200 -0
  262. package/dist/nodes-cli-wvPZ3HwH.js +1197 -0
  263. package/dist/nodes-screen-1YiLkqr5.js +234 -0
  264. package/dist/nodes-screen-DZeD8hE5.js +234 -0
  265. package/dist/normalize-Dlcj9D3K.js +52 -0
  266. package/dist/normalize-GDK8JTNW.js +52 -0
  267. package/dist/note-Bi8Wb8DV.js +73 -0
  268. package/dist/note-uiuPxhyX.js +73 -0
  269. package/dist/npm-registry-spec-B-XIShkB.js +351 -0
  270. package/dist/npm-registry-spec-za3itb5Y.js +351 -0
  271. package/dist/onboard-DiTRW6CH.js +1165 -0
  272. package/dist/onboard-channels-BgruIpyg.js +672 -0
  273. package/dist/onboard-channels-gyq0VHHp.js +672 -0
  274. package/dist/onboard-helpers-BEaUind0.js +365 -0
  275. package/dist/onboard-helpers-f5Zprayl.js +365 -0
  276. package/dist/onboard-lH3XPWAK.js +1166 -0
  277. package/dist/onboarding-D0FOkXGt.js +910 -0
  278. package/dist/onboarding-kQVgbiIR.js +911 -0
  279. package/dist/openclaw-root-0yHXtO35.js +88 -0
  280. package/dist/openclaw-root-C85WMnVV.js +88 -0
  281. package/dist/orchestrator-CYTk7mq6.js +355 -0
  282. package/dist/orchestrator-J6ELnJXl.js +355 -0
  283. package/dist/outbound-BEq0qbPR.js +214 -0
  284. package/dist/outbound-BSVD-rjk.js +2062 -0
  285. package/dist/outbound-DXijk0db.js +214 -0
  286. package/dist/outbound-send-deps-ANnAhImn.js +14 -0
  287. package/dist/outbound-send-deps-BNGPU7jV.js +55 -0
  288. package/dist/pairing-cli-DKUyb6eK.js +118 -0
  289. package/dist/pairing-cli-ET2p_mXH.js +121 -0
  290. package/dist/pairing-store-CGYSwICJ.js +388 -0
  291. package/dist/pairing-store-DqQPqRMe.js +388 -0
  292. package/dist/parse-6-2MDhdT.js +23 -0
  293. package/dist/parse-CpunmTOS.js +23 -0
  294. package/dist/parse-log-line-Bqh1SSzC.js +44 -0
  295. package/dist/parse-log-line-DUZCjXbl.js +44 -0
  296. package/dist/parse-port-BKB9Exlg.js +12 -0
  297. package/dist/parse-port-DrfvwwiL.js +12 -0
  298. package/dist/parse-timeout-Di_tcEmi.js +16 -0
  299. package/dist/parse-timeout-vVlESvju.js +16 -0
  300. package/dist/path-env-Bu6k0jDQ.js +89 -0
  301. package/dist/path-env-C0zQSjw8.js +89 -0
  302. package/dist/paths-BTc4nk-6.js +126 -0
  303. package/dist/paths-BgUi2Z2G.js +54 -0
  304. package/dist/paths-C6VCWKo3.js +238 -0
  305. package/dist/paths-CCxa0o9c.js +222 -0
  306. package/dist/paths-CxRf2rBG.js +129 -0
  307. package/dist/paths-DcVEkYX5.js +54 -0
  308. package/dist/paths-hcX1Gqg5.js +129 -0
  309. package/dist/pi-auth-json-BzX-qyRo.js +82 -0
  310. package/dist/pi-auth-json-eesA38iW.js +78 -0
  311. package/dist/pi-auth-json-uEDdgg8K.js +80 -0
  312. package/dist/pi-embedded-C1Nl7L89.js +22 -0
  313. package/dist/pi-model-discovery-BkqhoPls.js +20 -0
  314. package/dist/pi-model-discovery-CQOWUAmK.js +3 -0
  315. package/dist/pi-model-discovery-DsRqYJLy.js +20 -0
  316. package/dist/pi-tools.policy-D9AUlreI.js +200 -0
  317. package/dist/pi-tools.policy-DRDm3v-2.js +200 -0
  318. package/dist/plugin-auto-enable-C-JwYMlZ.js +282 -0
  319. package/dist/plugin-auto-enable-DLIDBBfi.js +282 -0
  320. package/dist/plugin-registry-Bp8mivr-.js +32 -0
  321. package/dist/plugin-registry-CP7KgCvC.js +32 -0
  322. package/dist/plugin-sdk/account-id.d.ts +1 -0
  323. package/dist/plugin-sdk/account-id.js +15 -0
  324. package/dist/plugin-sdk/agents/agent-paths.d.ts +6 -0
  325. package/dist/plugin-sdk/agents/agent-scope.d.ts +37 -0
  326. package/dist/plugin-sdk/agents/anima-tools.d.ts +1 -0
  327. package/dist/plugin-sdk/agents/apply-patch-update.d.ts +10 -0
  328. package/dist/plugin-sdk/agents/apply-patch.d.ts +35 -0
  329. package/dist/plugin-sdk/agents/auth-profiles/constants.d.ts +20 -0
  330. package/dist/plugin-sdk/agents/auth-profiles/display.d.ts +7 -0
  331. package/dist/plugin-sdk/agents/auth-profiles/doctor.d.ts +8 -0
  332. package/dist/plugin-sdk/agents/auth-profiles/external-cli-sync.d.ts +7 -0
  333. package/dist/plugin-sdk/agents/auth-profiles/oauth.d.ts +12 -0
  334. package/dist/plugin-sdk/agents/auth-profiles/order.d.ts +8 -0
  335. package/dist/plugin-sdk/agents/auth-profiles/paths.d.ts +4 -0
  336. package/dist/plugin-sdk/agents/auth-profiles/profiles.d.ts +23 -0
  337. package/dist/plugin-sdk/agents/auth-profiles/repair.d.ts +14 -0
  338. package/dist/plugin-sdk/agents/auth-profiles/session-override.d.ts +18 -0
  339. package/dist/plugin-sdk/agents/auth-profiles/store.d.ts +10 -0
  340. package/dist/plugin-sdk/agents/auth-profiles/types.d.ts +60 -0
  341. package/dist/plugin-sdk/agents/auth-profiles/usage.d.ts +47 -0
  342. package/dist/plugin-sdk/agents/auth-profiles.d.ts +11 -0
  343. package/dist/plugin-sdk/agents/bash-process-registry.d.ts +70 -0
  344. package/dist/plugin-sdk/agents/bash-tools.d.ts +4 -0
  345. package/dist/plugin-sdk/agents/bash-tools.exec-runtime.d.ts +73 -0
  346. package/dist/plugin-sdk/agents/bash-tools.exec.d.ts +55 -0
  347. package/dist/plugin-sdk/agents/bash-tools.process.d.ts +7 -0
  348. package/dist/plugin-sdk/agents/bash-tools.shared.d.ts +48 -0
  349. package/dist/plugin-sdk/agents/bedrock-discovery.d.ts +9 -0
  350. package/dist/plugin-sdk/agents/bootstrap-files.d.ts +25 -0
  351. package/dist/plugin-sdk/agents/bootstrap-hooks.d.ts +10 -0
  352. package/dist/plugin-sdk/agents/channel-tools.d.ts +27 -0
  353. package/dist/plugin-sdk/agents/chutes-oauth.d.ts +46 -0
  354. package/dist/plugin-sdk/agents/cli-backends.d.ts +8 -0
  355. package/dist/plugin-sdk/agents/cli-credentials.d.ts +83 -0
  356. package/dist/plugin-sdk/agents/cli-runner/helpers.d.ts +76 -0
  357. package/dist/plugin-sdk/agents/cli-runner.d.ts +41 -0
  358. package/dist/plugin-sdk/agents/cli-session.d.ts +3 -0
  359. package/dist/plugin-sdk/agents/cloudflare-ai-gateway.d.ts +22 -0
  360. package/dist/plugin-sdk/agents/context.d.ts +1 -0
  361. package/dist/plugin-sdk/agents/current-time.d.ts +17 -0
  362. package/dist/plugin-sdk/agents/date-time.d.ts +13 -0
  363. package/dist/plugin-sdk/agents/defaults.d.ts +3 -0
  364. package/dist/plugin-sdk/agents/docs-path.d.ts +6 -0
  365. package/dist/plugin-sdk/agents/failover-error.d.ts +33 -0
  366. package/dist/plugin-sdk/agents/glob-pattern.d.ts +18 -0
  367. package/dist/plugin-sdk/agents/huggingface-models.d.ts +17 -0
  368. package/dist/plugin-sdk/agents/identity-avatar.d.ts +15 -0
  369. package/dist/plugin-sdk/agents/identity-file.d.ts +12 -0
  370. package/dist/plugin-sdk/agents/identity.d.ts +25 -0
  371. package/dist/plugin-sdk/agents/lanes.d.ts +3 -0
  372. package/dist/plugin-sdk/agents/memory-search.d.ts +66 -0
  373. package/dist/plugin-sdk/agents/minimax-vlm.d.ts +7 -0
  374. package/dist/plugin-sdk/agents/model-alias-lines.d.ts +2 -0
  375. package/dist/plugin-sdk/agents/model-auth.d.ts +36 -0
  376. package/dist/plugin-sdk/agents/model-catalog.d.ts +25 -0
  377. package/dist/plugin-sdk/agents/model-fallback.d.ts +40 -0
  378. package/dist/plugin-sdk/agents/model-selection.d.ts +94 -0
  379. package/dist/plugin-sdk/agents/models-config.d.ts +13 -0
  380. package/dist/plugin-sdk/agents/models-config.providers.d.ts +37 -0
  381. package/dist/plugin-sdk/agents/ollama-stream.d.ts +45 -0
  382. package/dist/plugin-sdk/agents/openclaw-tools.d.ts +46 -0
  383. package/dist/plugin-sdk/agents/pi-auth-json.d.ts +14 -0
  384. package/dist/plugin-sdk/agents/pi-embedded-helpers.d.ts +7 -0
  385. package/dist/plugin-sdk/agents/pi-embedded-runner/model.d.ts +1 -0
  386. package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +5 -0
  387. package/dist/plugin-sdk/agents/pi-embedded-runner.d.ts +25 -0
  388. package/dist/plugin-sdk/agents/pi-embedded-utils.d.ts +7 -0
  389. package/dist/plugin-sdk/agents/pi-embedded.d.ts +25 -0
  390. package/dist/plugin-sdk/agents/pi-model-discovery.d.ts +4 -0
  391. package/dist/plugin-sdk/agents/pi-settings.d.ts +19 -0
  392. package/dist/plugin-sdk/agents/pi-tools.abort.d.ts +2 -0
  393. package/dist/plugin-sdk/agents/pi-tools.before-tool-call.d.ts +29 -0
  394. package/dist/plugin-sdk/agents/pi-tools.d.ts +69 -0
  395. package/dist/plugin-sdk/agents/pi-tools.policy.d.ts +37 -0
  396. package/dist/plugin-sdk/agents/pi-tools.read.d.ts +44 -0
  397. package/dist/plugin-sdk/agents/pi-tools.schema.d.ts +3 -0
  398. package/dist/plugin-sdk/agents/pi-tools.types.d.ts +2 -0
  399. package/dist/plugin-sdk/agents/pty-dsr.d.ts +5 -0
  400. package/dist/plugin-sdk/agents/pty-keys.d.ts +13 -0
  401. package/dist/plugin-sdk/agents/sandbox/browser-bridges.d.ts +7 -0
  402. package/dist/plugin-sdk/agents/sandbox/browser.d.ts +12 -0
  403. package/dist/plugin-sdk/agents/sandbox/config-hash.d.ts +17 -0
  404. package/dist/plugin-sdk/agents/sandbox/config.d.ts +26 -0
  405. package/dist/plugin-sdk/agents/sandbox/constants.d.ts +19 -0
  406. package/dist/plugin-sdk/agents/sandbox/context.d.ts +12 -0
  407. package/dist/plugin-sdk/agents/sandbox/docker.d.ts +40 -0
  408. package/dist/plugin-sdk/agents/sandbox/fs-bridge.d.ts +56 -0
  409. package/dist/plugin-sdk/agents/sandbox/fs-paths.d.ts +28 -0
  410. package/dist/plugin-sdk/agents/sandbox/manage.d.ts +13 -0
  411. package/dist/plugin-sdk/agents/sandbox/prune.d.ts +3 -0
  412. package/dist/plugin-sdk/agents/sandbox/registry.d.ts +31 -0
  413. package/dist/plugin-sdk/agents/sandbox/runtime-status.d.ts +18 -0
  414. package/dist/plugin-sdk/agents/sandbox/shared.d.ts +4 -0
  415. package/dist/plugin-sdk/agents/sandbox/tool-policy.d.ts +4 -0
  416. package/dist/plugin-sdk/agents/sandbox/types.d.ts +76 -0
  417. package/dist/plugin-sdk/agents/sandbox/types.docker.d.ts +25 -0
  418. package/dist/plugin-sdk/agents/sandbox/workspace.d.ts +1 -0
  419. package/dist/plugin-sdk/agents/sandbox-paths.d.ts +23 -0
  420. package/dist/plugin-sdk/agents/sandbox.d.ts +8 -0
  421. package/dist/plugin-sdk/agents/schema/clean-for-gemini.d.ts +2 -0
  422. package/dist/plugin-sdk/agents/schema/typebox.d.ts +14 -0
  423. package/dist/plugin-sdk/agents/session-slug.d.ts +1 -0
  424. package/dist/plugin-sdk/agents/session-write-lock.d.ts +21 -0
  425. package/dist/plugin-sdk/agents/shell-utils.d.ts +7 -0
  426. package/dist/plugin-sdk/agents/skills/bundled-dir.d.ts +7 -0
  427. package/dist/plugin-sdk/agents/skills/config.d.ts +13 -0
  428. package/dist/plugin-sdk/agents/skills/env-overrides.d.ts +10 -0
  429. package/dist/plugin-sdk/agents/skills/frontmatter.d.ts +6 -0
  430. package/dist/plugin-sdk/agents/skills/plugin-skills.d.ts +5 -0
  431. package/dist/plugin-sdk/agents/skills/refresh.d.ts +19 -0
  432. package/dist/plugin-sdk/agents/skills/serialize.d.ts +1 -0
  433. package/dist/plugin-sdk/agents/skills/types.d.ts +80 -0
  434. package/dist/plugin-sdk/agents/skills/workspace.d.ts +49 -0
  435. package/dist/plugin-sdk/agents/skills.d.ts +7 -0
  436. package/dist/plugin-sdk/agents/subagent-announce-queue.d.ts +23 -0
  437. package/dist/plugin-sdk/agents/subagent-announce.d.ts +34 -0
  438. package/dist/plugin-sdk/agents/subagent-depth.d.ts +11 -0
  439. package/dist/plugin-sdk/agents/subagent-registry.d.ts +62 -0
  440. package/dist/plugin-sdk/agents/subagent-registry.store.d.ts +5 -0
  441. package/dist/plugin-sdk/agents/synthetic-models.d.ts +160 -0
  442. package/dist/plugin-sdk/agents/system-prompt-params.d.ts +30 -0
  443. package/dist/plugin-sdk/agents/system-prompt-report.d.ts +20 -0
  444. package/dist/plugin-sdk/agents/system-prompt.d.ts +78 -0
  445. package/dist/plugin-sdk/agents/timeout.d.ts +8 -0
  446. package/dist/plugin-sdk/agents/together-models.d.ts +4 -0
  447. package/dist/plugin-sdk/agents/tool-images.d.ts +19 -0
  448. package/dist/plugin-sdk/agents/tool-policy-pipeline.d.ts +27 -0
  449. package/dist/plugin-sdk/agents/tool-policy.d.ts +39 -0
  450. package/dist/plugin-sdk/agents/tool-summaries.d.ts +2 -0
  451. package/dist/plugin-sdk/agents/tools/agent-step.d.ts +15 -0
  452. package/dist/plugin-sdk/agents/tools/agents-list-tool.d.ts +6 -0
  453. package/dist/plugin-sdk/agents/tools/browser-tool.d.ts +5 -0
  454. package/dist/plugin-sdk/agents/tools/browser-tool.schema.d.ts +50 -0
  455. package/dist/plugin-sdk/agents/tools/canvas-tool.d.ts +2 -0
  456. package/dist/plugin-sdk/agents/tools/common.d.ts +56 -0
  457. package/dist/plugin-sdk/agents/tools/cron-tool.d.ts +6 -0
  458. package/dist/plugin-sdk/agents/tools/discord-actions-guild.d.ts +4 -0
  459. package/dist/plugin-sdk/agents/tools/discord-actions-messaging.d.ts +4 -0
  460. package/dist/plugin-sdk/agents/tools/discord-actions-moderation.d.ts +4 -0
  461. package/dist/plugin-sdk/agents/tools/discord-actions-presence.d.ts +4 -0
  462. package/dist/plugin-sdk/agents/tools/discord-actions.d.ts +3 -0
  463. package/dist/plugin-sdk/agents/tools/gateway-tool.d.ts +6 -0
  464. package/dist/plugin-sdk/agents/tools/gateway.d.ts +14 -0
  465. package/dist/plugin-sdk/agents/tools/image-tool.d.ts +35 -0
  466. package/dist/plugin-sdk/agents/tools/image-tool.helpers.d.ts +21 -0
  467. package/dist/plugin-sdk/agents/tools/memory-tool.d.ts +10 -0
  468. package/dist/plugin-sdk/agents/tools/message-tool.d.ts +18 -0
  469. package/dist/plugin-sdk/agents/tools/nodes-tool.d.ts +6 -0
  470. package/dist/plugin-sdk/agents/tools/nodes-utils.d.ts +20 -0
  471. package/dist/plugin-sdk/agents/tools/session-status-tool.d.ts +6 -0
  472. package/dist/plugin-sdk/agents/tools/sessions-announce-target.d.ts +5 -0
  473. package/dist/plugin-sdk/agents/tools/sessions-helpers.d.ts +90 -0
  474. package/dist/plugin-sdk/agents/tools/sessions-history-tool.d.ts +5 -0
  475. package/dist/plugin-sdk/agents/tools/sessions-list-tool.d.ts +5 -0
  476. package/dist/plugin-sdk/agents/tools/sessions-send-helpers.d.ts +34 -0
  477. package/dist/plugin-sdk/agents/tools/sessions-send-tool.a2a.d.ts +12 -0
  478. package/dist/plugin-sdk/agents/tools/sessions-send-tool.d.ts +7 -0
  479. package/dist/plugin-sdk/agents/tools/sessions-spawn-tool.d.ts +15 -0
  480. package/dist/plugin-sdk/agents/tools/slack-actions.d.ts +15 -0
  481. package/dist/plugin-sdk/agents/tools/subagents-tool.d.ts +4 -0
  482. package/dist/plugin-sdk/agents/tools/telegram-actions.d.ts +9 -0
  483. package/dist/plugin-sdk/agents/tools/tts-tool.d.ts +7 -0
  484. package/dist/plugin-sdk/agents/tools/web-fetch-utils.d.ts +18 -0
  485. package/dist/plugin-sdk/agents/tools/web-fetch.d.ts +25 -0
  486. package/dist/plugin-sdk/agents/tools/web-search.d.ts +71 -0
  487. package/dist/plugin-sdk/agents/tools/web-shared.d.ts +17 -0
  488. package/dist/plugin-sdk/agents/tools/web-tools.d.ts +2 -0
  489. package/dist/plugin-sdk/agents/tools/whatsapp-actions.d.ts +3 -0
  490. package/dist/plugin-sdk/agents/usage.d.ts +45 -0
  491. package/dist/plugin-sdk/agents/venice-models.d.ts +238 -0
  492. package/dist/plugin-sdk/agents/workspace-dir.d.ts +2 -0
  493. package/dist/plugin-sdk/agents/workspace-run.d.ts +18 -0
  494. package/dist/plugin-sdk/agents/workspace-templates.d.ts +6 -0
  495. package/dist/plugin-sdk/agents/workspace.d.ts +34 -0
  496. package/dist/plugin-sdk/auto-reply/chunk.d.ts +45 -0
  497. package/dist/plugin-sdk/auto-reply/command-auth.d.ts +17 -0
  498. package/dist/plugin-sdk/auto-reply/command-detection.d.ts +13 -0
  499. package/dist/plugin-sdk/auto-reply/commands-args.d.ts +3 -0
  500. package/dist/plugin-sdk/auto-reply/commands-registry.d.ts +54 -0
  501. package/dist/plugin-sdk/auto-reply/commands-registry.data.d.ts +3 -0
  502. package/dist/plugin-sdk/auto-reply/commands-registry.types.d.ts +66 -0
  503. package/dist/plugin-sdk/auto-reply/dispatch.d.ts +32 -0
  504. package/dist/plugin-sdk/auto-reply/envelope.d.ts +58 -0
  505. package/dist/plugin-sdk/auto-reply/group-activation.d.ts +6 -0
  506. package/dist/plugin-sdk/auto-reply/heartbeat-reply-payload.d.ts +2 -0
  507. package/dist/plugin-sdk/auto-reply/heartbeat.d.ts +26 -0
  508. package/dist/plugin-sdk/auto-reply/inbound-debounce.d.ts +16 -0
  509. package/dist/plugin-sdk/auto-reply/media-note.d.ts +2 -0
  510. package/dist/plugin-sdk/auto-reply/model.d.ts +8 -0
  511. package/dist/plugin-sdk/auto-reply/reply/abort.d.ts +22 -0
  512. package/dist/plugin-sdk/auto-reply/reply/agent-runner-execution.d.ts +49 -0
  513. package/dist/plugin-sdk/auto-reply/reply/agent-runner-helpers.d.ts +17 -0
  514. package/dist/plugin-sdk/auto-reply/reply/agent-runner-memory.d.ts +20 -0
  515. package/dist/plugin-sdk/auto-reply/reply/agent-runner-payloads.d.ts +25 -0
  516. package/dist/plugin-sdk/auto-reply/reply/agent-runner-utils.d.ts +30 -0
  517. package/dist/plugin-sdk/auto-reply/reply/agent-runner.d.ts +38 -0
  518. package/dist/plugin-sdk/auto-reply/reply/bash-command.d.ts +19 -0
  519. package/dist/plugin-sdk/auto-reply/reply/block-reply-coalescer.d.ts +15 -0
  520. package/dist/plugin-sdk/auto-reply/reply/block-reply-pipeline.d.ts +31 -0
  521. package/dist/plugin-sdk/auto-reply/reply/block-streaming.d.ts +22 -0
  522. package/dist/plugin-sdk/auto-reply/reply/body.d.ts +10 -0
  523. package/dist/plugin-sdk/auto-reply/reply/commands-allowlist.d.ts +2 -0
  524. package/dist/plugin-sdk/auto-reply/reply/commands-approve.d.ts +2 -0
  525. package/dist/plugin-sdk/auto-reply/reply/commands-bash.d.ts +2 -0
  526. package/dist/plugin-sdk/auto-reply/reply/commands-compact.d.ts +2 -0
  527. package/dist/plugin-sdk/auto-reply/reply/commands-config.d.ts +3 -0
  528. package/dist/plugin-sdk/auto-reply/reply/commands-context-report.d.ts +3 -0
  529. package/dist/plugin-sdk/auto-reply/reply/commands-context.d.ts +12 -0
  530. package/dist/plugin-sdk/auto-reply/reply/commands-core.d.ts +2 -0
  531. package/dist/plugin-sdk/auto-reply/reply/commands-info.d.ts +10 -0
  532. package/dist/plugin-sdk/auto-reply/reply/commands-models.d.ts +23 -0
  533. package/dist/plugin-sdk/auto-reply/reply/commands-plugin.d.ts +13 -0
  534. package/dist/plugin-sdk/auto-reply/reply/commands-session.d.ts +7 -0
  535. package/dist/plugin-sdk/auto-reply/reply/commands-status.d.ts +25 -0
  536. package/dist/plugin-sdk/auto-reply/reply/commands-subagents.d.ts +13 -0
  537. package/dist/plugin-sdk/auto-reply/reply/commands-tts.d.ts +2 -0
  538. package/dist/plugin-sdk/auto-reply/reply/commands-types.d.ts +60 -0
  539. package/dist/plugin-sdk/auto-reply/reply/commands.d.ts +4 -0
  540. package/dist/plugin-sdk/auto-reply/reply/config-commands.d.ts +15 -0
  541. package/dist/plugin-sdk/auto-reply/reply/config-value.d.ts +4 -0
  542. package/dist/plugin-sdk/auto-reply/reply/debug-commands.d.ts +16 -0
  543. package/dist/plugin-sdk/auto-reply/reply/directive-handling.auth.d.ts +19 -0
  544. package/dist/plugin-sdk/auto-reply/reply/directive-handling.d.ts +6 -0
  545. package/dist/plugin-sdk/auto-reply/reply/directive-handling.fast-lane.d.ts +7 -0
  546. package/dist/plugin-sdk/auto-reply/reply/directive-handling.impl.d.ts +3 -0
  547. package/dist/plugin-sdk/auto-reply/reply/directive-handling.model-picker.d.ts +13 -0
  548. package/dist/plugin-sdk/auto-reply/reply/directive-handling.model.d.ts +42 -0
  549. package/dist/plugin-sdk/auto-reply/reply/directive-handling.params.d.ts +51 -0
  550. package/dist/plugin-sdk/auto-reply/reply/directive-handling.parse.d.ts +62 -0
  551. package/dist/plugin-sdk/auto-reply/reply/directive-handling.persist.d.ts +37 -0
  552. package/dist/plugin-sdk/auto-reply/reply/directive-handling.queue-validation.d.ts +10 -0
  553. package/dist/plugin-sdk/auto-reply/reply/directive-handling.shared.d.ts +16 -0
  554. package/dist/plugin-sdk/auto-reply/reply/directive-parsing.d.ts +5 -0
  555. package/dist/plugin-sdk/auto-reply/reply/directives.d.ts +38 -0
  556. package/dist/plugin-sdk/auto-reply/reply/dispatch-from-config.d.ts +16 -0
  557. package/dist/plugin-sdk/auto-reply/reply/dispatcher-registry.d.ts +24 -0
  558. package/dist/plugin-sdk/auto-reply/reply/elevated-unavailable.d.ts +8 -0
  559. package/dist/plugin-sdk/auto-reply/reply/exec/directive.d.ts +20 -0
  560. package/dist/plugin-sdk/auto-reply/reply/exec.d.ts +1 -0
  561. package/dist/plugin-sdk/auto-reply/reply/followup-runner.d.ts +16 -0
  562. package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-apply.d.ts +64 -0
  563. package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-utils.d.ts +2 -0
  564. package/dist/plugin-sdk/auto-reply/reply/get-reply-directives.d.ts +92 -0
  565. package/dist/plugin-sdk/auto-reply/reply/get-reply-inline-actions.d.ts +59 -0
  566. package/dist/plugin-sdk/auto-reply/reply/get-reply-run.d.ts +69 -0
  567. package/dist/plugin-sdk/auto-reply/reply/get-reply.d.ts +4 -0
  568. package/dist/plugin-sdk/auto-reply/reply/groups.d.ts +26 -0
  569. package/dist/plugin-sdk/auto-reply/reply/history.d.ts +72 -0
  570. package/dist/plugin-sdk/auto-reply/reply/inbound-context.d.ts +8 -0
  571. package/dist/plugin-sdk/auto-reply/reply/inbound-dedupe.d.ts +8 -0
  572. package/dist/plugin-sdk/auto-reply/reply/inbound-meta.d.ts +3 -0
  573. package/dist/plugin-sdk/auto-reply/reply/inbound-text.d.ts +1 -0
  574. package/dist/plugin-sdk/auto-reply/reply/line-directives.d.ts +22 -0
  575. package/dist/plugin-sdk/auto-reply/reply/memory-flush.d.ts +23 -0
  576. package/dist/plugin-sdk/auto-reply/reply/mentions.d.ts +19 -0
  577. package/dist/plugin-sdk/auto-reply/reply/model-selection.d.ts +64 -0
  578. package/dist/plugin-sdk/auto-reply/reply/normalize-reply.d.ts +13 -0
  579. package/dist/plugin-sdk/auto-reply/reply/provider-dispatcher.d.ts +19 -0
  580. package/dist/plugin-sdk/auto-reply/reply/queue/cleanup.d.ts +6 -0
  581. package/dist/plugin-sdk/auto-reply/reply/queue/directive.d.ts +15 -0
  582. package/dist/plugin-sdk/auto-reply/reply/queue/drain.d.ts +2 -0
  583. package/dist/plugin-sdk/auto-reply/reply/queue/enqueue.d.ts +3 -0
  584. package/dist/plugin-sdk/auto-reply/reply/queue/normalize.d.ts +3 -0
  585. package/dist/plugin-sdk/auto-reply/reply/queue/settings.d.ts +2 -0
  586. package/dist/plugin-sdk/auto-reply/reply/queue/state.d.ts +19 -0
  587. package/dist/plugin-sdk/auto-reply/reply/queue/types.d.ts +84 -0
  588. package/dist/plugin-sdk/auto-reply/reply/queue.d.ts +8 -0
  589. package/dist/plugin-sdk/auto-reply/reply/reply-delivery.d.ts +27 -0
  590. package/dist/plugin-sdk/auto-reply/reply/reply-directives.d.ts +14 -0
  591. package/dist/plugin-sdk/auto-reply/reply/reply-dispatcher.d.ts +52 -0
  592. package/dist/plugin-sdk/auto-reply/reply/reply-elevated.d.ts +16 -0
  593. package/dist/plugin-sdk/auto-reply/reply/reply-inline.d.ts +8 -0
  594. package/dist/plugin-sdk/auto-reply/reply/reply-payloads.d.ts +22 -0
  595. package/dist/plugin-sdk/auto-reply/reply/reply-tags.d.ts +6 -0
  596. package/dist/plugin-sdk/auto-reply/reply/reply-threading.d.ts +9 -0
  597. package/dist/plugin-sdk/auto-reply/reply/response-prefix-template.d.ts +51 -0
  598. package/dist/plugin-sdk/auto-reply/reply/route-reply.d.ts +56 -0
  599. package/dist/plugin-sdk/auto-reply/reply/session-reset-model.d.ts +24 -0
  600. package/dist/plugin-sdk/auto-reply/reply/session-reset-prompt.d.ts +1 -0
  601. package/dist/plugin-sdk/auto-reply/reply/session-run-accounting.d.ts +11 -0
  602. package/dist/plugin-sdk/auto-reply/reply/session-updates.d.ts +34 -0
  603. package/dist/plugin-sdk/auto-reply/reply/session-usage.d.ts +21 -0
  604. package/dist/plugin-sdk/auto-reply/reply/session.d.ts +26 -0
  605. package/dist/plugin-sdk/auto-reply/reply/stage-sandbox-media.d.ts +9 -0
  606. package/dist/plugin-sdk/auto-reply/reply/subagents-utils.d.ts +7 -0
  607. package/dist/plugin-sdk/auto-reply/reply/typing-mode.d.ts +27 -0
  608. package/dist/plugin-sdk/auto-reply/reply/typing.d.ts +18 -0
  609. package/dist/plugin-sdk/auto-reply/reply/untrusted-context.d.ts +1 -0
  610. package/dist/plugin-sdk/auto-reply/reply.d.ts +6 -0
  611. package/dist/plugin-sdk/auto-reply/send-policy.d.ts +6 -0
  612. package/dist/plugin-sdk/auto-reply/skill-commands.d.ts +18 -0
  613. package/dist/plugin-sdk/auto-reply/status.d.ts +55 -0
  614. package/dist/plugin-sdk/auto-reply/templating.d.ts +152 -0
  615. package/dist/plugin-sdk/auto-reply/thinking.d.ts +22 -0
  616. package/dist/plugin-sdk/auto-reply/tokens.d.ts +3 -0
  617. package/dist/plugin-sdk/auto-reply/types.d.ts +61 -0
  618. package/dist/plugin-sdk/browser/bridge-auth-registry.d.ts +8 -0
  619. package/dist/plugin-sdk/browser/bridge-server.d.ts +18 -0
  620. package/dist/plugin-sdk/browser/cdp.d.ts +123 -0
  621. package/dist/plugin-sdk/browser/cdp.helpers.d.ts +13 -0
  622. package/dist/plugin-sdk/browser/chrome.d.ts +20 -0
  623. package/dist/plugin-sdk/browser/chrome.executables.d.ts +9 -0
  624. package/dist/plugin-sdk/browser/chrome.profile-decoration.d.ts +10 -0
  625. package/dist/plugin-sdk/browser/client-actions-core.d.ts +144 -0
  626. package/dist/plugin-sdk/browser/client-actions-observe.d.ts +68 -0
  627. package/dist/plugin-sdk/browser/client-actions-state.d.ts +90 -0
  628. package/dist/plugin-sdk/browser/client-actions-types.d.ts +18 -0
  629. package/dist/plugin-sdk/browser/client-actions.d.ts +4 -0
  630. package/dist/plugin-sdk/browser/client-fetch.d.ts +20 -0
  631. package/dist/plugin-sdk/browser/client.d.ts +147 -0
  632. package/dist/plugin-sdk/browser/config.d.ts +39 -0
  633. package/dist/plugin-sdk/browser/constants.d.ts +8 -0
  634. package/dist/plugin-sdk/browser/control-auth.d.ts +13 -0
  635. package/dist/plugin-sdk/browser/control-service.d.ts +5 -0
  636. package/dist/plugin-sdk/browser/csrf.d.ts +8 -0
  637. package/dist/plugin-sdk/browser/extension-relay.d.ts +15 -0
  638. package/dist/plugin-sdk/browser/http-auth.d.ts +5 -0
  639. package/dist/plugin-sdk/browser/paths.d.ts +27 -0
  640. package/dist/plugin-sdk/browser/profiles-service.d.ts +25 -0
  641. package/dist/plugin-sdk/browser/profiles.d.ts +30 -0
  642. package/dist/plugin-sdk/browser/proxy-files.d.ts +7 -0
  643. package/dist/plugin-sdk/browser/pw-ai-module.d.ts +6 -0
  644. package/dist/plugin-sdk/browser/pw-ai-state.d.ts +2 -0
  645. package/dist/plugin-sdk/browser/pw-ai.d.ts +2 -0
  646. package/dist/plugin-sdk/browser/pw-role-snapshot.d.ts +35 -0
  647. package/dist/plugin-sdk/browser/pw-session.d.ts +160 -0
  648. package/dist/plugin-sdk/browser/pw-tools-core.activity.d.ts +21 -0
  649. package/dist/plugin-sdk/browser/pw-tools-core.d.ts +8 -0
  650. package/dist/plugin-sdk/browser/pw-tools-core.downloads.d.ts +34 -0
  651. package/dist/plugin-sdk/browser/pw-tools-core.interactions.d.ts +114 -0
  652. package/dist/plugin-sdk/browser/pw-tools-core.responses.d.ts +13 -0
  653. package/dist/plugin-sdk/browser/pw-tools-core.shared.d.ts +6 -0
  654. package/dist/plugin-sdk/browser/pw-tools-core.snapshot.d.ts +64 -0
  655. package/dist/plugin-sdk/browser/pw-tools-core.state.d.ts +46 -0
  656. package/dist/plugin-sdk/browser/pw-tools-core.storage.d.ts +47 -0
  657. package/dist/plugin-sdk/browser/pw-tools-core.trace.d.ts +12 -0
  658. package/dist/plugin-sdk/browser/resolved-config-refresh.d.ts +12 -0
  659. package/dist/plugin-sdk/browser/routes/agent.act.d.ts +3 -0
  660. package/dist/plugin-sdk/browser/routes/agent.act.shared.d.ts +10 -0
  661. package/dist/plugin-sdk/browser/routes/agent.d.ts +3 -0
  662. package/dist/plugin-sdk/browser/routes/agent.debug.d.ts +3 -0
  663. package/dist/plugin-sdk/browser/routes/agent.shared.d.ts +9 -0
  664. package/dist/plugin-sdk/browser/routes/agent.snapshot.d.ts +3 -0
  665. package/dist/plugin-sdk/browser/routes/agent.storage.d.ts +3 -0
  666. package/dist/plugin-sdk/browser/routes/basic.d.ts +3 -0
  667. package/dist/plugin-sdk/browser/routes/dispatcher.d.ts +16 -0
  668. package/dist/plugin-sdk/browser/routes/index.d.ts +3 -0
  669. package/dist/plugin-sdk/browser/routes/path-output.d.ts +1 -0
  670. package/dist/plugin-sdk/browser/routes/tabs.d.ts +3 -0
  671. package/dist/plugin-sdk/browser/routes/types.d.ts +20 -0
  672. package/dist/plugin-sdk/browser/routes/utils.d.ts +15 -0
  673. package/dist/plugin-sdk/browser/screenshot.d.ts +9 -0
  674. package/dist/plugin-sdk/browser/server-context.d.ts +4 -0
  675. package/dist/plugin-sdk/browser/server-context.types.d.ts +79 -0
  676. package/dist/plugin-sdk/browser/server-middleware.d.ts +6 -0
  677. package/dist/plugin-sdk/browser/target-id.d.ts +11 -0
  678. package/dist/plugin-sdk/browser/trash.d.ts +1 -0
  679. package/dist/plugin-sdk/channel-web.d.ts +6 -0
  680. package/dist/plugin-sdk/channels/account-summary.d.ts +17 -0
  681. package/dist/plugin-sdk/channels/ack-reactions.d.ts +29 -0
  682. package/dist/plugin-sdk/channels/allowlist-match.d.ts +15 -0
  683. package/dist/plugin-sdk/channels/allowlists/resolve-utils.d.ts +20 -0
  684. package/dist/plugin-sdk/channels/channel-config.d.ts +39 -0
  685. package/dist/plugin-sdk/channels/chat-type.d.ts +2 -0
  686. package/dist/plugin-sdk/channels/command-gating.d.ts +20 -0
  687. package/dist/plugin-sdk/channels/conversation-label.d.ts +2 -0
  688. package/dist/plugin-sdk/channels/dock.d.ts +36 -0
  689. package/dist/plugin-sdk/channels/location.d.ts +21 -0
  690. package/dist/plugin-sdk/channels/logging.d.ts +20 -0
  691. package/dist/plugin-sdk/channels/mention-gating.d.ts +27 -0
  692. package/dist/plugin-sdk/channels/plugins/actions/discord/handle-action.d.ts +3 -0
  693. package/dist/plugin-sdk/channels/plugins/actions/discord/handle-action.guild-admin.d.ts +9 -0
  694. package/dist/plugin-sdk/channels/plugins/actions/discord.d.ts +2 -0
  695. package/dist/plugin-sdk/channels/plugins/actions/signal.d.ts +2 -0
  696. package/dist/plugin-sdk/channels/plugins/actions/telegram.d.ts +2 -0
  697. package/dist/plugin-sdk/channels/plugins/agent-tools/whatsapp-login.d.ts +2 -0
  698. package/dist/plugin-sdk/channels/plugins/allowlist-match.d.ts +2 -0
  699. package/dist/plugin-sdk/channels/plugins/bluebubbles-actions.d.ts +48 -0
  700. package/dist/plugin-sdk/channels/plugins/channel-config.d.ts +2 -0
  701. package/dist/plugin-sdk/channels/plugins/config-helpers.d.ts +14 -0
  702. package/dist/plugin-sdk/channels/plugins/config-schema.d.ts +3 -0
  703. package/dist/plugin-sdk/channels/plugins/config-writes.d.ts +7 -0
  704. package/dist/plugin-sdk/channels/plugins/directory-config.d.ts +16 -0
  705. package/dist/plugin-sdk/channels/plugins/group-mentions.d.ts +28 -0
  706. package/dist/plugin-sdk/channels/plugins/helpers.d.ts +8 -0
  707. package/dist/plugin-sdk/channels/plugins/index.d.ts +8 -0
  708. package/dist/plugin-sdk/channels/plugins/media-limits.d.ts +9 -0
  709. package/dist/plugin-sdk/channels/plugins/message-action-names.d.ts +2 -0
  710. package/dist/plugin-sdk/channels/plugins/message-actions.d.ts +7 -0
  711. package/dist/plugin-sdk/channels/plugins/normalize/discord.d.ts +2 -0
  712. package/dist/plugin-sdk/channels/plugins/normalize/imessage.d.ts +2 -0
  713. package/dist/plugin-sdk/channels/plugins/normalize/signal.d.ts +2 -0
  714. package/dist/plugin-sdk/channels/plugins/normalize/slack.d.ts +2 -0
  715. package/dist/plugin-sdk/channels/plugins/normalize/telegram.d.ts +2 -0
  716. package/dist/plugin-sdk/channels/plugins/normalize/whatsapp.d.ts +2 -0
  717. package/dist/plugin-sdk/channels/plugins/onboarding/channel-access.d.ts +31 -0
  718. package/dist/plugin-sdk/channels/plugins/onboarding/discord.d.ts +2 -0
  719. package/dist/plugin-sdk/channels/plugins/onboarding/helpers.d.ts +3 -0
  720. package/dist/plugin-sdk/channels/plugins/onboarding/imessage.d.ts +2 -0
  721. package/dist/plugin-sdk/channels/plugins/onboarding/signal.d.ts +3 -0
  722. package/dist/plugin-sdk/channels/plugins/onboarding/slack.d.ts +2 -0
  723. package/dist/plugin-sdk/channels/plugins/onboarding/telegram.d.ts +2 -0
  724. package/dist/plugin-sdk/channels/plugins/onboarding/whatsapp.d.ts +2 -0
  725. package/dist/plugin-sdk/channels/plugins/onboarding-types.d.ts +77 -0
  726. package/dist/plugin-sdk/channels/plugins/outbound/load.d.ts +2 -0
  727. package/dist/plugin-sdk/channels/plugins/pairing-message.d.ts +1 -0
  728. package/dist/plugin-sdk/channels/plugins/pairing.d.ts +16 -0
  729. package/dist/plugin-sdk/channels/plugins/setup-helpers.d.ts +13 -0
  730. package/dist/plugin-sdk/channels/plugins/status-issues/bluebubbles.d.ts +2 -0
  731. package/dist/plugin-sdk/channels/plugins/status-issues/discord.d.ts +2 -0
  732. package/dist/plugin-sdk/channels/plugins/status-issues/shared.d.ts +11 -0
  733. package/dist/plugin-sdk/channels/plugins/status-issues/telegram.d.ts +2 -0
  734. package/dist/plugin-sdk/channels/plugins/status-issues/whatsapp.d.ts +2 -0
  735. package/dist/plugin-sdk/channels/plugins/types.adapters.d.ts +297 -0
  736. package/dist/plugin-sdk/channels/plugins/types.core.d.ts +329 -0
  737. package/dist/plugin-sdk/channels/plugins/types.d.ts +6 -0
  738. package/dist/plugin-sdk/channels/plugins/types.plugin.d.ts +53 -0
  739. package/dist/plugin-sdk/channels/plugins/whatsapp-heartbeat.d.ts +11 -0
  740. package/dist/plugin-sdk/channels/registry.d.ts +16 -0
  741. package/dist/plugin-sdk/channels/reply-prefix.d.ts +24 -0
  742. package/dist/plugin-sdk/channels/sender-label.d.ts +9 -0
  743. package/dist/plugin-sdk/channels/session.d.ts +18 -0
  744. package/dist/plugin-sdk/channels/typing.d.ts +12 -0
  745. package/dist/plugin-sdk/channels/web/index.d.ts +1 -0
  746. package/dist/plugin-sdk/cli/cli-name.d.ts +3 -0
  747. package/dist/plugin-sdk/cli/cli-utils.d.ts +19 -0
  748. package/dist/plugin-sdk/cli/command-format.d.ts +1 -0
  749. package/dist/plugin-sdk/cli/deps.d.ts +18 -0
  750. package/dist/plugin-sdk/cli/memory-cli.d.ts +12 -0
  751. package/dist/plugin-sdk/cli/nodes-camera.d.ts +32 -0
  752. package/dist/plugin-sdk/cli/nodes-canvas.d.ts +10 -0
  753. package/dist/plugin-sdk/cli/nodes-run.d.ts +3 -0
  754. package/dist/plugin-sdk/cli/nodes-screen.d.ts +18 -0
  755. package/dist/plugin-sdk/cli/parse-bytes.d.ts +4 -0
  756. package/dist/plugin-sdk/cli/parse-duration.d.ts +4 -0
  757. package/dist/plugin-sdk/cli/parse-timeout.d.ts +1 -0
  758. package/dist/plugin-sdk/cli/profile-utils.d.ts +2 -0
  759. package/dist/plugin-sdk/cli/progress.d.ts +24 -0
  760. package/dist/plugin-sdk/cli/prompt.d.ts +1 -0
  761. package/dist/plugin-sdk/cli/wait.d.ts +1 -0
  762. package/dist/plugin-sdk/commands/agent/types.d.ts +77 -0
  763. package/dist/plugin-sdk/commands/daemon-runtime.d.ts +8 -0
  764. package/dist/plugin-sdk/commands/health.d.ts +63 -0
  765. package/dist/plugin-sdk/commands/oauth-flow.d.ts +21 -0
  766. package/dist/plugin-sdk/commands/onboard-helpers.d.ts +82 -0
  767. package/dist/plugin-sdk/commands/onboard-types.d.ts +76 -0
  768. package/dist/plugin-sdk/commands/signal-install.d.ts +30 -0
  769. package/dist/plugin-sdk/compat/legacy-names.d.ts +8 -0
  770. package/dist/plugin-sdk/config/agent-dirs.d.ts +14 -0
  771. package/dist/plugin-sdk/config/agent-limits.d.ts +5 -0
  772. package/dist/plugin-sdk/config/backup-rotation.d.ts +5 -0
  773. package/dist/plugin-sdk/config/cache-utils.d.ts +6 -0
  774. package/dist/plugin-sdk/config/config-paths.d.ts +10 -0
  775. package/dist/plugin-sdk/config/config.d.ts +7 -0
  776. package/dist/plugin-sdk/config/defaults.d.ts +18 -0
  777. package/dist/plugin-sdk/config/env-preserve.d.ts +25 -0
  778. package/dist/plugin-sdk/config/env-substitution.d.ts +36 -0
  779. package/dist/plugin-sdk/config/env-vars.d.ts +3 -0
  780. package/dist/plugin-sdk/config/group-policy.d.ts +47 -0
  781. package/dist/plugin-sdk/config/includes.d.ts +32 -0
  782. package/dist/plugin-sdk/config/io.d.ts +55 -0
  783. package/dist/plugin-sdk/config/legacy-migrate.d.ts +5 -0
  784. package/dist/plugin-sdk/config/legacy.d.ts +6 -0
  785. package/dist/plugin-sdk/config/legacy.migrations.d.ts +1 -0
  786. package/dist/plugin-sdk/config/legacy.migrations.part-1.d.ts +2 -0
  787. package/dist/plugin-sdk/config/legacy.migrations.part-2.d.ts +2 -0
  788. package/dist/plugin-sdk/config/legacy.migrations.part-3.d.ts +2 -0
  789. package/dist/plugin-sdk/config/legacy.rules.d.ts +2 -0
  790. package/dist/plugin-sdk/config/legacy.shared.d.ts +19 -0
  791. package/dist/plugin-sdk/config/markdown-tables.d.ts +7 -0
  792. package/dist/plugin-sdk/config/merge-config.d.ts +7 -0
  793. package/dist/plugin-sdk/config/merge-patch.d.ts +5 -0
  794. package/dist/plugin-sdk/config/normalize-paths.d.ts +8 -0
  795. package/dist/plugin-sdk/config/paths.d.ts +57 -0
  796. package/dist/plugin-sdk/config/port-defaults.d.ts +13 -0
  797. package/dist/plugin-sdk/config/runtime-overrides.d.ts +15 -0
  798. package/dist/plugin-sdk/config/sessions/delivery-info.d.ts +12 -0
  799. package/dist/plugin-sdk/config/sessions/group.d.ts +11 -0
  800. package/dist/plugin-sdk/config/sessions/main-session.d.ts +43 -0
  801. package/dist/plugin-sdk/config/sessions/metadata.d.ts +16 -0
  802. package/dist/plugin-sdk/config/sessions/paths.d.ts +21 -0
  803. package/dist/plugin-sdk/config/sessions/reset.d.ts +43 -0
  804. package/dist/plugin-sdk/config/sessions/session-key.d.ts +8 -0
  805. package/dist/plugin-sdk/config/sessions/store.d.ts +99 -0
  806. package/dist/plugin-sdk/config/sessions/transcript.d.ts +18 -0
  807. package/dist/plugin-sdk/config/sessions/types.d.ts +156 -0
  808. package/dist/plugin-sdk/config/sessions.d.ts +10 -0
  809. package/dist/plugin-sdk/config/talk.d.ts +11 -0
  810. package/dist/plugin-sdk/config/telegram-custom-commands.d.ts +24 -0
  811. package/dist/plugin-sdk/config/types.agent-defaults.d.ts +260 -0
  812. package/dist/plugin-sdk/config/types.agents.d.ts +80 -0
  813. package/dist/plugin-sdk/config/types.anima.d.ts +1 -0
  814. package/dist/plugin-sdk/config/types.approvals.d.ts +26 -0
  815. package/dist/plugin-sdk/config/types.auth.d.ts +28 -0
  816. package/dist/plugin-sdk/config/types.base.d.ts +172 -0
  817. package/dist/plugin-sdk/config/types.browser.d.ts +41 -0
  818. package/dist/plugin-sdk/config/types.channels.d.ts +48 -0
  819. package/dist/plugin-sdk/config/types.cron.d.ts +11 -0
  820. package/dist/plugin-sdk/config/types.d.ts +30 -0
  821. package/dist/plugin-sdk/config/types.discord.d.ts +188 -0
  822. package/dist/plugin-sdk/config/types.gateway.d.ts +288 -0
  823. package/dist/plugin-sdk/config/types.googlechat.d.ts +100 -0
  824. package/dist/plugin-sdk/config/types.hooks.d.ts +128 -0
  825. package/dist/plugin-sdk/config/types.imessage.d.ts +71 -0
  826. package/dist/plugin-sdk/config/types.irc.d.ts +96 -0
  827. package/dist/plugin-sdk/config/types.memory.d.ts +45 -0
  828. package/dist/plugin-sdk/config/types.messages.d.ts +121 -0
  829. package/dist/plugin-sdk/config/types.models.d.ts +54 -0
  830. package/dist/plugin-sdk/config/types.msteams.d.ts +101 -0
  831. package/dist/plugin-sdk/config/types.node-host.d.ts +10 -0
  832. package/dist/plugin-sdk/config/types.openclaw.d.ts +114 -0
  833. package/dist/plugin-sdk/config/types.plugins.d.ts +32 -0
  834. package/dist/plugin-sdk/config/types.queue.d.ts +14 -0
  835. package/dist/plugin-sdk/config/types.sandbox.d.ts +78 -0
  836. package/dist/plugin-sdk/config/types.signal.d.ts +86 -0
  837. package/dist/plugin-sdk/config/types.skills.d.ts +28 -0
  838. package/dist/plugin-sdk/config/types.slack.d.ts +150 -0
  839. package/dist/plugin-sdk/config/types.telegram.d.ts +163 -0
  840. package/dist/plugin-sdk/config/types.tools.d.ts +467 -0
  841. package/dist/plugin-sdk/config/types.tts.d.ts +78 -0
  842. package/dist/plugin-sdk/config/types.whatsapp.d.ts +142 -0
  843. package/dist/plugin-sdk/config/validation.d.ts +37 -0
  844. package/dist/plugin-sdk/config/version.d.ts +8 -0
  845. package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +249 -0
  846. package/dist/plugin-sdk/config/zod-schema.agent-runtime.d.ts +856 -0
  847. package/dist/plugin-sdk/config/zod-schema.agents.d.ts +504 -0
  848. package/dist/plugin-sdk/config/zod-schema.allowdeny.d.ts +13 -0
  849. package/dist/plugin-sdk/config/zod-schema.approvals.d.ts +15 -0
  850. package/dist/plugin-sdk/config/zod-schema.channels.d.ts +6 -0
  851. package/dist/plugin-sdk/config/zod-schema.core.d.ts +683 -0
  852. package/dist/plugin-sdk/config/zod-schema.d.ts +3401 -0
  853. package/dist/plugin-sdk/config/zod-schema.hooks.d.ts +79 -0
  854. package/dist/plugin-sdk/config/zod-schema.providers-core.d.ts +3233 -0
  855. package/dist/plugin-sdk/config/zod-schema.providers-whatsapp.d.ts +231 -0
  856. package/dist/plugin-sdk/config/zod-schema.providers.d.ts +1900 -0
  857. package/dist/plugin-sdk/config/zod-schema.sensitive.d.ts +2 -0
  858. package/dist/plugin-sdk/config/zod-schema.session.d.ts +203 -0
  859. package/dist/plugin-sdk/cron/delivery.d.ts +9 -0
  860. package/dist/plugin-sdk/cron/normalize.d.ts +9 -0
  861. package/dist/plugin-sdk/cron/parse.d.ts +1 -0
  862. package/dist/plugin-sdk/cron/payload-migration.d.ts +3 -0
  863. package/dist/plugin-sdk/cron/schedule.d.ts +2 -0
  864. package/dist/plugin-sdk/cron/service/jobs.d.ts +21 -0
  865. package/dist/plugin-sdk/cron/service/locked.d.ts +2 -0
  866. package/dist/plugin-sdk/cron/service/normalize.d.ts +17 -0
  867. package/dist/plugin-sdk/cron/service/ops.d.ts +43 -0
  868. package/dist/plugin-sdk/cron/service/state.d.ts +121 -0
  869. package/dist/plugin-sdk/cron/service/store.d.ts +9 -0
  870. package/dist/plugin-sdk/cron/service/timer.d.ts +25 -0
  871. package/dist/plugin-sdk/cron/service.d.ts +48 -0
  872. package/dist/plugin-sdk/cron/session-reaper.d.ts +35 -0
  873. package/dist/plugin-sdk/cron/store.d.ts +6 -0
  874. package/dist/plugin-sdk/cron/types.d.ts +95 -0
  875. package/dist/plugin-sdk/daemon/constants.d.ts +30 -0
  876. package/dist/plugin-sdk/discord/accounts.d.ts +9 -0
  877. package/dist/plugin-sdk/discord/audit.d.ts +2 -0
  878. package/dist/plugin-sdk/discord/directory-live.d.ts +4 -0
  879. package/dist/plugin-sdk/discord/monitor/allow-list.d.ts +1 -0
  880. package/dist/plugin-sdk/discord/monitor/gateway-registry.d.ts +3 -0
  881. package/dist/plugin-sdk/discord/monitor/presence-cache.d.ts +1 -0
  882. package/dist/plugin-sdk/discord/monitor.d.ts +3 -0
  883. package/dist/plugin-sdk/discord/pluralkit.d.ts +1 -0
  884. package/dist/plugin-sdk/discord/probe.d.ts +3 -0
  885. package/dist/plugin-sdk/discord/resolve-channels.d.ts +1 -0
  886. package/dist/plugin-sdk/discord/resolve-users.d.ts +1 -0
  887. package/dist/plugin-sdk/discord/send.d.ts +6 -0
  888. package/dist/plugin-sdk/discord/targets.d.ts +2 -0
  889. package/dist/plugin-sdk/gateway/auth-rate-limit.d.ts +59 -0
  890. package/dist/plugin-sdk/gateway/auth.d.ts +48 -0
  891. package/dist/plugin-sdk/gateway/call.d.ts +51 -0
  892. package/dist/plugin-sdk/gateway/chat-abort.d.ts +44 -0
  893. package/dist/plugin-sdk/gateway/chat-sanitize.d.ts +4 -0
  894. package/dist/plugin-sdk/gateway/client.d.ts +63 -0
  895. package/dist/plugin-sdk/gateway/control-ui-shared.d.ts +9 -0
  896. package/dist/plugin-sdk/gateway/device-auth.d.ts +12 -0
  897. package/dist/plugin-sdk/gateway/exec-approval-manager.d.ts +44 -0
  898. package/dist/plugin-sdk/gateway/net.d.ts +57 -0
  899. package/dist/plugin-sdk/gateway/node-registry.d.ts +60 -0
  900. package/dist/plugin-sdk/gateway/protocol/client-info.d.ts +58 -0
  901. package/dist/plugin-sdk/gateway/protocol/index.d.ts +661 -0
  902. package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +86 -0
  903. package/dist/plugin-sdk/gateway/protocol/schema/agents-models-skills.d.ts +152 -0
  904. package/dist/plugin-sdk/gateway/protocol/schema/channels.d.ts +126 -0
  905. package/dist/plugin-sdk/gateway/protocol/schema/config.d.ts +51 -0
  906. package/dist/plugin-sdk/gateway/protocol/schema/cron.d.ts +353 -0
  907. package/dist/plugin-sdk/gateway/protocol/schema/devices.d.ts +38 -0
  908. package/dist/plugin-sdk/gateway/protocol/schema/error-codes.d.ts +14 -0
  909. package/dist/plugin-sdk/gateway/protocol/schema/exec-approvals.d.ts +163 -0
  910. package/dist/plugin-sdk/gateway/protocol/schema/frames.d.ts +164 -0
  911. package/dist/plugin-sdk/gateway/protocol/schema/logs-chat.d.ts +45 -0
  912. package/dist/plugin-sdk/gateway/protocol/schema/nodes.d.ts +64 -0
  913. package/dist/plugin-sdk/gateway/protocol/schema/primitives.d.ts +4 -0
  914. package/dist/plugin-sdk/gateway/protocol/schema/protocol-schemas.d.ts +3 -0
  915. package/dist/plugin-sdk/gateway/protocol/schema/sessions.d.ts +76 -0
  916. package/dist/plugin-sdk/gateway/protocol/schema/snapshot.d.ts +64 -0
  917. package/dist/plugin-sdk/gateway/protocol/schema/types.d.ts +124 -0
  918. package/dist/plugin-sdk/gateway/protocol/schema/wizard.d.ts +86 -0
  919. package/dist/plugin-sdk/gateway/protocol/schema.d.ts +16 -0
  920. package/dist/plugin-sdk/gateway/server/ws-types.d.ts +9 -0
  921. package/dist/plugin-sdk/gateway/server-channels.d.ts +24 -0
  922. package/dist/plugin-sdk/gateway/server-methods/types.d.ts +98 -0
  923. package/dist/plugin-sdk/gateway/server-shared.d.ts +7 -0
  924. package/dist/plugin-sdk/gateway/session-utils.d.ts +71 -0
  925. package/dist/plugin-sdk/gateway/session-utils.fs.d.ts +33 -0
  926. package/dist/plugin-sdk/gateway/session-utils.types.d.ts +84 -0
  927. package/dist/plugin-sdk/globals.d.ts +11 -0
  928. package/dist/plugin-sdk/hooks/internal-hooks.d.ts +95 -0
  929. package/dist/plugin-sdk/hooks/types.d.ts +62 -0
  930. package/dist/plugin-sdk/imessage/accounts.d.ts +8 -0
  931. package/dist/plugin-sdk/imessage/monitor.d.ts +3 -0
  932. package/dist/plugin-sdk/imessage/probe.d.ts +3 -0
  933. package/dist/plugin-sdk/imessage/send.d.ts +1 -0
  934. package/dist/plugin-sdk/imessage/target-parsing-helpers.d.ts +4 -0
  935. package/dist/plugin-sdk/imessage/targets.d.ts +2 -0
  936. package/dist/plugin-sdk/index.d.ts +1 -0
  937. package/dist/plugin-sdk/index.js +27570 -0
  938. package/dist/plugin-sdk/infra/agent-events.d.ts +21 -0
  939. package/dist/plugin-sdk/infra/anima-root.d.ts +1 -0
  940. package/dist/plugin-sdk/infra/archive.d.ts +41 -0
  941. package/dist/plugin-sdk/infra/backoff.d.ts +8 -0
  942. package/dist/plugin-sdk/infra/binaries.d.ts +3 -0
  943. package/dist/plugin-sdk/infra/brew.d.ts +8 -0
  944. package/dist/plugin-sdk/infra/channel-activity.d.ts +18 -0
  945. package/dist/plugin-sdk/infra/channel-summary.d.ts +6 -0
  946. package/dist/plugin-sdk/infra/dedupe.d.ts +11 -0
  947. package/dist/plugin-sdk/infra/device-auth-store.d.ts +18 -0
  948. package/dist/plugin-sdk/infra/device-identity.d.ts +11 -0
  949. package/dist/plugin-sdk/infra/device-pairing.d.ts +96 -0
  950. package/dist/plugin-sdk/infra/diagnostic-events.d.ts +121 -0
  951. package/dist/plugin-sdk/infra/dotenv.d.ts +3 -0
  952. package/dist/plugin-sdk/infra/env.d.ts +11 -0
  953. package/dist/plugin-sdk/infra/errors.d.ts +11 -0
  954. package/dist/plugin-sdk/infra/exec-approvals-allowlist.d.ts +45 -0
  955. package/dist/plugin-sdk/infra/exec-approvals-analysis.d.ts +78 -0
  956. package/dist/plugin-sdk/infra/exec-approvals.d.ts +107 -0
  957. package/dist/plugin-sdk/infra/exec-safety.d.ts +1 -0
  958. package/dist/plugin-sdk/infra/fetch.d.ts +2 -0
  959. package/dist/plugin-sdk/infra/file-lock.d.ts +2 -0
  960. package/dist/plugin-sdk/infra/format-time/format-datetime.d.ts +35 -0
  961. package/dist/plugin-sdk/infra/format-time/format-duration.d.ts +23 -0
  962. package/dist/plugin-sdk/infra/format-time/format-relative.d.ts +39 -0
  963. package/dist/plugin-sdk/infra/git-commit.d.ts +4 -0
  964. package/dist/plugin-sdk/infra/heartbeat-active-hours.d.ts +5 -0
  965. package/dist/plugin-sdk/infra/heartbeat-events-filter.d.ts +3 -0
  966. package/dist/plugin-sdk/infra/heartbeat-events.d.ts +21 -0
  967. package/dist/plugin-sdk/infra/heartbeat-runner.d.ts +45 -0
  968. package/dist/plugin-sdk/infra/heartbeat-visibility.d.ts +17 -0
  969. package/dist/plugin-sdk/infra/heartbeat-wake.d.ts +27 -0
  970. package/dist/plugin-sdk/infra/home-dir.d.ts +7 -0
  971. package/dist/plugin-sdk/infra/http-body.d.ts +46 -0
  972. package/dist/plugin-sdk/infra/json-file.d.ts +2 -0
  973. package/dist/plugin-sdk/infra/net/fetch-guard.d.ts +21 -0
  974. package/dist/plugin-sdk/infra/net/ssrf.d.ts +32 -0
  975. package/dist/plugin-sdk/infra/node-pairing.d.ts +62 -0
  976. package/dist/plugin-sdk/infra/node-shell.d.ts +1 -0
  977. package/dist/plugin-sdk/infra/openclaw-root.d.ts +10 -0
  978. package/dist/plugin-sdk/infra/outbound/abort.d.ts +8 -0
  979. package/dist/plugin-sdk/infra/outbound/channel-adapters.d.ts +6 -0
  980. package/dist/plugin-sdk/infra/outbound/channel-selection.d.ts +11 -0
  981. package/dist/plugin-sdk/infra/outbound/channel-target.d.ts +6 -0
  982. package/dist/plugin-sdk/infra/outbound/deliver.d.ts +77 -0
  983. package/dist/plugin-sdk/infra/outbound/delivery-queue.d.ts +103 -0
  984. package/dist/plugin-sdk/infra/outbound/directory-cache.d.ts +24 -0
  985. package/dist/plugin-sdk/infra/outbound/identity.d.ts +8 -0
  986. package/dist/plugin-sdk/infra/outbound/message-action-params.d.ts +47 -0
  987. package/dist/plugin-sdk/infra/outbound/message-action-runner.d.ts +74 -0
  988. package/dist/plugin-sdk/infra/outbound/message-action-spec.d.ts +5 -0
  989. package/dist/plugin-sdk/infra/outbound/message.d.ts +85 -0
  990. package/dist/plugin-sdk/infra/outbound/outbound-policy.d.ts +31 -0
  991. package/dist/plugin-sdk/infra/outbound/outbound-send-service.d.ts +64 -0
  992. package/dist/plugin-sdk/infra/outbound/outbound-session.d.ts +31 -0
  993. package/dist/plugin-sdk/infra/outbound/payloads.d.ts +16 -0
  994. package/dist/plugin-sdk/infra/outbound/target-errors.d.ts +6 -0
  995. package/dist/plugin-sdk/infra/outbound/target-normalization.d.ts +4 -0
  996. package/dist/plugin-sdk/infra/outbound/target-resolver.d.ts +53 -0
  997. package/dist/plugin-sdk/infra/outbound/targets.d.ts +65 -0
  998. package/dist/plugin-sdk/infra/outbound/tool-payload.d.ts +2 -0
  999. package/dist/plugin-sdk/infra/pairing-files.d.ts +11 -0
  1000. package/dist/plugin-sdk/infra/pairing-token.d.ts +3 -0
  1001. package/dist/plugin-sdk/infra/path-prepend.d.ts +5 -0
  1002. package/dist/plugin-sdk/infra/ports-format.d.ts +5 -0
  1003. package/dist/plugin-sdk/infra/ports-inspect.d.ts +2 -0
  1004. package/dist/plugin-sdk/infra/ports-lsof.d.ts +2 -0
  1005. package/dist/plugin-sdk/infra/ports-types.d.ts +17 -0
  1006. package/dist/plugin-sdk/infra/ports.d.ts +14 -0
  1007. package/dist/plugin-sdk/infra/provider-usage.auth.d.ts +11 -0
  1008. package/dist/plugin-sdk/infra/provider-usage.d.ts +4 -0
  1009. package/dist/plugin-sdk/infra/provider-usage.fetch.antigravity.d.ts +2 -0
  1010. package/dist/plugin-sdk/infra/provider-usage.fetch.claude.d.ts +2 -0
  1011. package/dist/plugin-sdk/infra/provider-usage.fetch.codex.d.ts +2 -0
  1012. package/dist/plugin-sdk/infra/provider-usage.fetch.copilot.d.ts +2 -0
  1013. package/dist/plugin-sdk/infra/provider-usage.fetch.d.ts +7 -0
  1014. package/dist/plugin-sdk/infra/provider-usage.fetch.gemini.d.ts +2 -0
  1015. package/dist/plugin-sdk/infra/provider-usage.fetch.minimax.d.ts +2 -0
  1016. package/dist/plugin-sdk/infra/provider-usage.fetch.shared.d.ts +1 -0
  1017. package/dist/plugin-sdk/infra/provider-usage.fetch.zai.d.ts +2 -0
  1018. package/dist/plugin-sdk/infra/provider-usage.format.d.ts +13 -0
  1019. package/dist/plugin-sdk/infra/provider-usage.load.d.ts +12 -0
  1020. package/dist/plugin-sdk/infra/provider-usage.shared.d.ts +8 -0
  1021. package/dist/plugin-sdk/infra/provider-usage.types.d.ts +17 -0
  1022. package/dist/plugin-sdk/infra/restart-sentinel.d.ts +50 -0
  1023. package/dist/plugin-sdk/infra/restart.d.ts +61 -0
  1024. package/dist/plugin-sdk/infra/retry.d.ts +21 -0
  1025. package/dist/plugin-sdk/infra/session-cost-usage.d.ts +45 -0
  1026. package/dist/plugin-sdk/infra/session-cost-usage.types.d.ts +153 -0
  1027. package/dist/plugin-sdk/infra/session-maintenance-warning.d.ts +10 -0
  1028. package/dist/plugin-sdk/infra/shell-env.d.ts +33 -0
  1029. package/dist/plugin-sdk/infra/skills-remote.d.ts +25 -0
  1030. package/dist/plugin-sdk/infra/system-events.d.ts +18 -0
  1031. package/dist/plugin-sdk/infra/tailnet.d.ts +7 -0
  1032. package/dist/plugin-sdk/infra/tailscale.d.ts +34 -0
  1033. package/dist/plugin-sdk/infra/tls/fingerprint.d.ts +1 -0
  1034. package/dist/plugin-sdk/infra/tls/gateway.d.ts +16 -0
  1035. package/dist/plugin-sdk/infra/tmp-anima-dir.d.ts +1 -0
  1036. package/dist/plugin-sdk/infra/tmp-openclaw-dir.d.ts +18 -0
  1037. package/dist/plugin-sdk/infra/unhandled-rejections.d.ts +15 -0
  1038. package/dist/plugin-sdk/infra/warning-filter.d.ts +7 -0
  1039. package/dist/plugin-sdk/infra/ws.d.ts +2 -0
  1040. package/dist/plugin-sdk/infra/wsl.d.ts +11 -0
  1041. package/dist/plugin-sdk/line/accounts.d.ts +9 -0
  1042. package/dist/plugin-sdk/line/config-schema.d.ts +1 -0
  1043. package/dist/plugin-sdk/line/flex-templates.d.ts +14 -0
  1044. package/dist/plugin-sdk/line/markdown-to-line.d.ts +6 -0
  1045. package/dist/plugin-sdk/line/monitor.d.ts +3 -0
  1046. package/dist/plugin-sdk/line/probe.d.ts +3 -0
  1047. package/dist/plugin-sdk/line/send.d.ts +14 -0
  1048. package/dist/plugin-sdk/line/template-messages.d.ts +1 -0
  1049. package/dist/plugin-sdk/line/types.d.ts +6 -0
  1050. package/dist/plugin-sdk/link-understanding/apply.d.ts +10 -0
  1051. package/dist/plugin-sdk/link-understanding/defaults.d.ts +2 -0
  1052. package/dist/plugin-sdk/link-understanding/detect.d.ts +3 -0
  1053. package/dist/plugin-sdk/link-understanding/format.d.ts +4 -0
  1054. package/dist/plugin-sdk/link-understanding/runner.d.ts +11 -0
  1055. package/dist/plugin-sdk/logger.d.ts +6 -0
  1056. package/dist/plugin-sdk/logging/config.d.ts +4 -0
  1057. package/dist/plugin-sdk/logging/console.d.ts +23 -0
  1058. package/dist/plugin-sdk/logging/diagnostic-session-state.d.ts +17 -0
  1059. package/dist/plugin-sdk/logging/diagnostic.d.ts +56 -0
  1060. package/dist/plugin-sdk/logging/levels.d.ts +4 -0
  1061. package/dist/plugin-sdk/logging/logger.d.ts +42 -0
  1062. package/dist/plugin-sdk/logging/redact-identifier.d.ts +4 -0
  1063. package/dist/plugin-sdk/logging/redact.d.ts +9 -0
  1064. package/dist/plugin-sdk/logging/state.d.ts +18 -0
  1065. package/dist/plugin-sdk/logging/subsystem.d.ts +18 -0
  1066. package/dist/plugin-sdk/logging.d.ts +10 -0
  1067. package/dist/plugin-sdk/markdown/fences.d.ts +10 -0
  1068. package/dist/plugin-sdk/markdown/frontmatter.d.ts +2 -0
  1069. package/dist/plugin-sdk/markdown/ir.d.ts +32 -0
  1070. package/dist/plugin-sdk/markdown/render.d.ts +18 -0
  1071. package/dist/plugin-sdk/markdown/tables.d.ts +2 -0
  1072. package/dist/plugin-sdk/markdown/whatsapp.d.ts +14 -0
  1073. package/dist/plugin-sdk/media/audio-tags.d.ts +10 -0
  1074. package/dist/plugin-sdk/media/audio.d.ts +19 -0
  1075. package/dist/plugin-sdk/media/base64.d.ts +1 -0
  1076. package/dist/plugin-sdk/media/constants.d.ts +7 -0
  1077. package/dist/plugin-sdk/media/fetch.d.ts +23 -0
  1078. package/dist/plugin-sdk/media/image-ops.d.ts +39 -0
  1079. package/dist/plugin-sdk/media/input-files.d.ts +81 -0
  1080. package/dist/plugin-sdk/media/mime.d.ts +16 -0
  1081. package/dist/plugin-sdk/media/parse.d.ts +8 -0
  1082. package/dist/plugin-sdk/media/png-encode.d.ts +8 -0
  1083. package/dist/plugin-sdk/media/read-response-with-limit.d.ts +7 -0
  1084. package/dist/plugin-sdk/media/sniff-mime-from-base64.d.ts +1 -0
  1085. package/dist/plugin-sdk/media/store.d.ts +28 -0
  1086. package/dist/plugin-sdk/media-understanding/apply.d.ts +19 -0
  1087. package/dist/plugin-sdk/media-understanding/attachments.d.ts +43 -0
  1088. package/dist/plugin-sdk/media-understanding/concurrency.d.ts +1 -0
  1089. package/dist/plugin-sdk/media-understanding/defaults.d.ts +14 -0
  1090. package/dist/plugin-sdk/media-understanding/errors.d.ts +6 -0
  1091. package/dist/plugin-sdk/media-understanding/format.d.ts +7 -0
  1092. package/dist/plugin-sdk/media-understanding/output-extract.d.ts +2 -0
  1093. package/dist/plugin-sdk/media-understanding/providers/image.d.ts +1 -0
  1094. package/dist/plugin-sdk/media-understanding/providers/index.d.ts +8 -0
  1095. package/dist/plugin-sdk/media-understanding/providers/shared.d.ts +4 -0
  1096. package/dist/plugin-sdk/media-understanding/resolve.d.ts +44 -0
  1097. package/dist/plugin-sdk/media-understanding/runner.d.ts +35 -0
  1098. package/dist/plugin-sdk/media-understanding/runner.entries.d.ts +33 -0
  1099. package/dist/plugin-sdk/media-understanding/scope.d.ts +9 -0
  1100. package/dist/plugin-sdk/media-understanding/types.d.ts +93 -0
  1101. package/dist/plugin-sdk/media-understanding/video.d.ts +2 -0
  1102. package/dist/plugin-sdk/memory/backend-config.d.ts +49 -0
  1103. package/dist/plugin-sdk/memory/batch-gemini.d.ts +55 -0
  1104. package/dist/plugin-sdk/memory/batch-http.d.ts +6 -0
  1105. package/dist/plugin-sdk/memory/batch-openai.d.ts +45 -0
  1106. package/dist/plugin-sdk/memory/batch-output.d.ts +23 -0
  1107. package/dist/plugin-sdk/memory/batch-voyage.d.ts +46 -0
  1108. package/dist/plugin-sdk/memory/embedding-chunk-limits.d.ts +3 -0
  1109. package/dist/plugin-sdk/memory/embedding-input-limits.d.ts +2 -0
  1110. package/dist/plugin-sdk/memory/embedding-model-limits.d.ts +2 -0
  1111. package/dist/plugin-sdk/memory/embeddings-gemini.d.ts +13 -0
  1112. package/dist/plugin-sdk/memory/embeddings-openai.d.ts +13 -0
  1113. package/dist/plugin-sdk/memory/embeddings-voyage.d.ts +13 -0
  1114. package/dist/plugin-sdk/memory/embeddings.d.ts +44 -0
  1115. package/dist/plugin-sdk/memory/hybrid.d.ts +34 -0
  1116. package/dist/plugin-sdk/memory/index.d.ts +3 -0
  1117. package/dist/plugin-sdk/memory/internal.d.ts +38 -0
  1118. package/dist/plugin-sdk/memory/manager-embedding-ops.d.ts +32 -0
  1119. package/dist/plugin-sdk/memory/manager-search.d.ts +60 -0
  1120. package/dist/plugin-sdk/memory/manager-sync-ops.d.ts +40 -0
  1121. package/dist/plugin-sdk/memory/manager.d.ts +75 -0
  1122. package/dist/plugin-sdk/memory/memory-schema.d.ts +10 -0
  1123. package/dist/plugin-sdk/memory/node-llama.d.ts +8 -0
  1124. package/dist/plugin-sdk/memory/qmd-manager.d.ts +109 -0
  1125. package/dist/plugin-sdk/memory/qmd-query-parser.d.ts +8 -0
  1126. package/dist/plugin-sdk/memory/qmd-scope.d.ts +4 -0
  1127. package/dist/plugin-sdk/memory/search-manager.d.ts +11 -0
  1128. package/dist/plugin-sdk/memory/session-files.d.ts +14 -0
  1129. package/dist/plugin-sdk/memory/sqlite-vec.d.ts +9 -0
  1130. package/dist/plugin-sdk/memory/sqlite.d.ts +1 -0
  1131. package/dist/plugin-sdk/memory/types.d.ts +94 -0
  1132. package/dist/plugin-sdk/pairing/pairing-messages.d.ts +6 -0
  1133. package/dist/plugin-sdk/pairing/pairing-store.d.ts +46 -0
  1134. package/dist/plugin-sdk/pi-model-discovery-Dw3A6oXH.js +37 -0
  1135. package/dist/plugin-sdk/plugin-sdk/account-id.d.ts +1 -0
  1136. package/dist/plugin-sdk/plugin-sdk/allow-from.d.ts +4 -0
  1137. package/dist/plugin-sdk/plugin-sdk/config-paths.d.ts +6 -0
  1138. package/dist/plugin-sdk/plugin-sdk/file-lock.d.ts +16 -0
  1139. package/dist/plugin-sdk/plugin-sdk/index.d.ts +123 -0
  1140. package/dist/plugin-sdk/plugin-sdk/onboarding.d.ts +11 -0
  1141. package/dist/plugin-sdk/plugin-sdk/text-chunking.d.ts +1 -0
  1142. package/dist/plugin-sdk/plugins/bundled-dir.d.ts +1 -0
  1143. package/dist/plugin-sdk/plugins/commands.d.ts +83 -0
  1144. package/dist/plugin-sdk/plugins/config-schema.d.ts +2 -0
  1145. package/dist/plugin-sdk/plugins/config-state.d.ts +33 -0
  1146. package/dist/plugin-sdk/plugins/discovery.d.ts +22 -0
  1147. package/dist/plugin-sdk/plugins/hook-runner-global.d.ts +37 -0
  1148. package/dist/plugin-sdk/plugins/hooks.d.ts +42 -0
  1149. package/dist/plugin-sdk/plugins/http-path.d.ts +1 -0
  1150. package/dist/plugin-sdk/plugins/http-registry.d.ts +13 -0
  1151. package/dist/plugin-sdk/plugins/loader.d.ts +14 -0
  1152. package/dist/plugin-sdk/plugins/manifest-registry.d.ts +33 -0
  1153. package/dist/plugin-sdk/plugins/manifest.d.ts +64 -0
  1154. package/dist/plugin-sdk/plugins/registry.d.ts +130 -0
  1155. package/dist/plugin-sdk/plugins/runtime/index.d.ts +3 -0
  1156. package/dist/plugin-sdk/plugins/runtime/native-deps.d.ts +8 -0
  1157. package/dist/plugin-sdk/plugins/runtime/types.d.ts +317 -0
  1158. package/dist/plugin-sdk/plugins/runtime.d.ts +5 -0
  1159. package/dist/plugin-sdk/plugins/schema-validator.d.ts +10 -0
  1160. package/dist/plugin-sdk/plugins/slots.d.ts +24 -0
  1161. package/dist/plugin-sdk/plugins/tools.d.ts +13 -0
  1162. package/dist/plugin-sdk/plugins/types.d.ts +411 -0
  1163. package/dist/plugin-sdk/polls.d.ts +31 -0
  1164. package/dist/plugin-sdk/process/command-queue.d.ts +51 -0
  1165. package/dist/plugin-sdk/process/exec.d.ts +26 -0
  1166. package/dist/plugin-sdk/process/lanes.d.ts +6 -0
  1167. package/dist/plugin-sdk/process/spawn-utils.d.ts +26 -0
  1168. package/dist/plugin-sdk/providers/github-copilot-token.d.ts +8 -0
  1169. package/dist/plugin-sdk/providers/qwen-portal-oauth.d.ts +8 -0
  1170. package/dist/plugin-sdk/routing/bindings.d.ts +11 -0
  1171. package/dist/plugin-sdk/routing/resolve-route.d.ts +42 -0
  1172. package/dist/plugin-sdk/routing/session-key.d.ts +48 -0
  1173. package/dist/plugin-sdk/runtime.d.ts +7 -0
  1174. package/dist/plugin-sdk/security/external-content.d.ts +67 -0
  1175. package/dist/plugin-sdk/security/secret-equal.d.ts +1 -0
  1176. package/dist/plugin-sdk/sessions/input-provenance.d.ts +16 -0
  1177. package/dist/plugin-sdk/sessions/level-overrides.d.ts +10 -0
  1178. package/dist/plugin-sdk/sessions/model-overrides.d.ts +14 -0
  1179. package/dist/plugin-sdk/sessions/send-policy.d.ts +11 -0
  1180. package/dist/plugin-sdk/sessions/session-key-utils.d.ts +11 -0
  1181. package/dist/plugin-sdk/sessions/session-label.d.ts +9 -0
  1182. package/dist/plugin-sdk/sessions/transcript-events.d.ts +7 -0
  1183. package/dist/plugin-sdk/shared/chat-envelope.d.ts +2 -0
  1184. package/dist/plugin-sdk/shared/config-eval.d.ts +5 -0
  1185. package/dist/plugin-sdk/shared/device-auth.d.ts +13 -0
  1186. package/dist/plugin-sdk/shared/frontmatter.d.ts +7 -0
  1187. package/dist/plugin-sdk/shared/node-match.d.ts +8 -0
  1188. package/dist/plugin-sdk/shared/subagents-format.d.ts +15 -0
  1189. package/dist/plugin-sdk/shared/text/reasoning-tags.d.ts +6 -0
  1190. package/dist/plugin-sdk/signal/accounts.d.ts +9 -0
  1191. package/dist/plugin-sdk/signal/format.d.ts +9 -0
  1192. package/dist/plugin-sdk/signal/identity.d.ts +3 -0
  1193. package/dist/plugin-sdk/signal/index.d.ts +3 -0
  1194. package/dist/plugin-sdk/signal/probe.d.ts +3 -0
  1195. package/dist/plugin-sdk/signal/reaction-level.d.ts +1 -0
  1196. package/dist/plugin-sdk/signal/send-reactions.d.ts +2 -0
  1197. package/dist/plugin-sdk/signal/send.d.ts +1 -0
  1198. package/dist/plugin-sdk/slack/accounts.d.ts +11 -0
  1199. package/dist/plugin-sdk/slack/actions.d.ts +17 -0
  1200. package/dist/plugin-sdk/slack/client.d.ts +1 -0
  1201. package/dist/plugin-sdk/slack/directory-live.d.ts +4 -0
  1202. package/dist/plugin-sdk/slack/index.d.ts +3 -0
  1203. package/dist/plugin-sdk/slack/message-actions.d.ts +2 -0
  1204. package/dist/plugin-sdk/slack/monitor/allow-list.d.ts +1 -0
  1205. package/dist/plugin-sdk/slack/probe.d.ts +3 -0
  1206. package/dist/plugin-sdk/slack/resolve-channels.d.ts +1 -0
  1207. package/dist/plugin-sdk/slack/resolve-users.d.ts +1 -0
  1208. package/dist/plugin-sdk/slack/send.d.ts +5 -0
  1209. package/dist/plugin-sdk/slack/targets.d.ts +2 -0
  1210. package/dist/plugin-sdk/slack/threading-tool-context.d.ts +1 -0
  1211. package/dist/plugin-sdk/telegram/accounts.d.ts +9 -0
  1212. package/dist/plugin-sdk/telegram/audit.d.ts +4 -0
  1213. package/dist/plugin-sdk/telegram/bot/helpers.d.ts +1 -0
  1214. package/dist/plugin-sdk/telegram/bot/types.d.ts +5 -0
  1215. package/dist/plugin-sdk/telegram/inline-buttons.d.ts +2 -0
  1216. package/dist/plugin-sdk/telegram/model-buttons.d.ts +5 -0
  1217. package/dist/plugin-sdk/telegram/monitor.d.ts +3 -0
  1218. package/dist/plugin-sdk/telegram/outbound-params.d.ts +2 -0
  1219. package/dist/plugin-sdk/telegram/probe.d.ts +6 -0
  1220. package/dist/plugin-sdk/telegram/reaction-level.d.ts +1 -0
  1221. package/dist/plugin-sdk/telegram/send.d.ts +10 -0
  1222. package/dist/plugin-sdk/telegram/sticker-cache.d.ts +2 -0
  1223. package/dist/plugin-sdk/telegram/targets.d.ts +1 -0
  1224. package/dist/plugin-sdk/telegram/token.d.ts +1 -0
  1225. package/dist/plugin-sdk/terminal/ansi.d.ts +2 -0
  1226. package/dist/plugin-sdk/terminal/health-style.d.ts +1 -0
  1227. package/dist/plugin-sdk/terminal/links.d.ts +6 -0
  1228. package/dist/plugin-sdk/terminal/palette.d.ts +10 -0
  1229. package/dist/plugin-sdk/terminal/progress-line.d.ts +3 -0
  1230. package/dist/plugin-sdk/terminal/prompt-style.d.ts +3 -0
  1231. package/dist/plugin-sdk/terminal/restore.d.ts +17 -0
  1232. package/dist/plugin-sdk/terminal/theme.d.ts +15 -0
  1233. package/dist/plugin-sdk/tts/tts-core.d.ts +52 -0
  1234. package/dist/plugin-sdk/tts/tts.d.ts +179 -0
  1235. package/dist/plugin-sdk/utils/account-id.d.ts +1 -0
  1236. package/dist/plugin-sdk/utils/boolean.d.ts +5 -0
  1237. package/dist/plugin-sdk/utils/delivery-context.d.ts +29 -0
  1238. package/dist/plugin-sdk/utils/directive-tags.d.ts +16 -0
  1239. package/dist/plugin-sdk/utils/fetch-timeout.d.ts +13 -0
  1240. package/dist/plugin-sdk/utils/message-channel.d.ts +27 -0
  1241. package/dist/plugin-sdk/utils/normalize-secret-input.d.ts +11 -0
  1242. package/dist/plugin-sdk/utils/provider-utils.d.ts +9 -0
  1243. package/dist/plugin-sdk/utils/queue-helpers.d.ts +41 -0
  1244. package/dist/plugin-sdk/utils/shell-argv.d.ts +1 -0
  1245. package/dist/plugin-sdk/utils/transcript-tools.d.ts +8 -0
  1246. package/dist/plugin-sdk/utils/usage-format.d.ts +26 -0
  1247. package/dist/plugin-sdk/utils.d.ts +67 -0
  1248. package/dist/plugin-sdk/version.d.ts +4 -0
  1249. package/dist/plugin-sdk/web/accounts.d.ts +39 -0
  1250. package/dist/plugin-sdk/web/active-listener.d.ts +25 -0
  1251. package/dist/plugin-sdk/web/auth-store.d.ts +25 -0
  1252. package/dist/plugin-sdk/web/auto-reply/constants.d.ts +1 -0
  1253. package/dist/plugin-sdk/web/auto-reply/deliver-reply.d.ts +18 -0
  1254. package/dist/plugin-sdk/web/auto-reply/heartbeat-runner.d.ts +20 -0
  1255. package/dist/plugin-sdk/web/auto-reply/loggers.d.ts +4 -0
  1256. package/dist/plugin-sdk/web/auto-reply/mentions.d.ts +19 -0
  1257. package/dist/plugin-sdk/web/auto-reply/monitor/ack-reaction.d.ts +13 -0
  1258. package/dist/plugin-sdk/web/auto-reply/monitor/broadcast.d.ts +16 -0
  1259. package/dist/plugin-sdk/web/auto-reply/monitor/commands.d.ts +2 -0
  1260. package/dist/plugin-sdk/web/auto-reply/monitor/echo.d.ts +17 -0
  1261. package/dist/plugin-sdk/web/auto-reply/monitor/group-activation.d.ts +9 -0
  1262. package/dist/plugin-sdk/web/auto-reply/monitor/group-gating.d.ts +29 -0
  1263. package/dist/plugin-sdk/web/auto-reply/monitor/group-members.d.ts +6 -0
  1264. package/dist/plugin-sdk/web/auto-reply/monitor/last-route.d.ts +15 -0
  1265. package/dist/plugin-sdk/web/auto-reply/monitor/message-line.d.ts +11 -0
  1266. package/dist/plugin-sdk/web/auto-reply/monitor/on-message.d.ts +24 -0
  1267. package/dist/plugin-sdk/web/auto-reply/monitor/peer.d.ts +2 -0
  1268. package/dist/plugin-sdk/web/auto-reply/monitor/process-message.d.ts +40 -0
  1269. package/dist/plugin-sdk/web/auto-reply/monitor.d.ts +5 -0
  1270. package/dist/plugin-sdk/web/auto-reply/session-snapshot.d.ts +17 -0
  1271. package/dist/plugin-sdk/web/auto-reply/types.d.ts +28 -0
  1272. package/dist/plugin-sdk/web/auto-reply/util.d.ts +2 -0
  1273. package/dist/plugin-sdk/web/auto-reply.d.ts +1 -0
  1274. package/dist/plugin-sdk/web/auto-reply.impl.d.ts +6 -0
  1275. package/dist/plugin-sdk/web/inbound/access-control.d.ts +24 -0
  1276. package/dist/plugin-sdk/web/inbound/dedupe.d.ts +2 -0
  1277. package/dist/plugin-sdk/web/inbound/extract.d.ts +13 -0
  1278. package/dist/plugin-sdk/web/inbound/media.d.ts +7 -0
  1279. package/dist/plugin-sdk/web/inbound/monitor.d.ts +30 -0
  1280. package/dist/plugin-sdk/web/inbound/send-api.d.ts +22 -0
  1281. package/dist/plugin-sdk/web/inbound/types.d.ts +41 -0
  1282. package/dist/plugin-sdk/web/inbound.d.ts +4 -0
  1283. package/dist/plugin-sdk/web/login-qr.d.ts +19 -0
  1284. package/dist/plugin-sdk/web/login.d.ts +3 -0
  1285. package/dist/plugin-sdk/web/media.d.ts +38 -0
  1286. package/dist/plugin-sdk/web/outbound.d.ts +23 -0
  1287. package/dist/plugin-sdk/web/qr-image.d.ts +4 -0
  1288. package/dist/plugin-sdk/web/reconnect.d.ts +12 -0
  1289. package/dist/plugin-sdk/web/session.d.ts +14 -0
  1290. package/dist/plugin-sdk/web/vcard.d.ts +6 -0
  1291. package/dist/plugin-sdk/whatsapp/normalize.d.ts +2 -0
  1292. package/dist/plugin-sdk/whatsapp/resolve-outbound-target.d.ts +1 -0
  1293. package/dist/plugin-sdk/wizard/prompts.d.ts +42 -0
  1294. package/dist/plugin-sdk/wizard/session.d.ts +42 -0
  1295. package/dist/plugins-B362e77G.js +168 -0
  1296. package/dist/plugins-CDJw924T.js +38 -0
  1297. package/dist/plugins-CmSUIUNi.js +38 -0
  1298. package/dist/plugins-cli-CtFRTC2I.js +734 -0
  1299. package/dist/plugins-cli-D1lvqLG9.js +736 -0
  1300. package/dist/polls-CItfB1H8.js +1343 -0
  1301. package/dist/ports-BVLMN1Sr.js +96 -0
  1302. package/dist/ports-CqLSlU6Z.js +317 -0
  1303. package/dist/ports-D94CwCrv.js +344 -0
  1304. package/dist/ports-D_NHthOz.js +96 -0
  1305. package/dist/program-Bve7k4jO.js +176 -0
  1306. package/dist/program-context-8lqacY-M.js +496 -0
  1307. package/dist/program-context-Bvn8046-.js +17 -0
  1308. package/dist/progress-Bek_GyWS.js +133 -0
  1309. package/dist/progress-CbZ2D53A.js +133 -0
  1310. package/dist/prompt-style-DKy6qQxR.js +9 -0
  1311. package/dist/prompt-style-lu0clOOE.js +9 -0
  1312. package/dist/prompts-BI__va99.js +10 -0
  1313. package/dist/prompts-_dDWkCAz.js +10 -0
  1314. package/dist/pw-ai-BLVMuSLv.js +1867 -0
  1315. package/dist/pw-ai-DZJWEF_f.js +1865 -0
  1316. package/dist/pw-ai-dzf-ptcn.js +1868 -0
  1317. package/dist/qmd-manager-B0FWDi1x.js +938 -0
  1318. package/dist/qmd-manager-CrDrpgh3.js +937 -0
  1319. package/dist/qmd-manager-DepEoASu.js +935 -0
  1320. package/dist/queue-2CW7pnm1.js +209 -0
  1321. package/dist/queue-DhjMEG_Q.js +209 -0
  1322. package/dist/redact-BHmk44DI.js +97 -0
  1323. package/dist/redact-ClVwO7Nn.js +97 -0
  1324. package/dist/register.agent-CE_8JbTE.js +265 -0
  1325. package/dist/register.agent-CGRdcftb.js +1003 -0
  1326. package/dist/register.anima-B4NPeesF.js +167 -0
  1327. package/dist/register.anima-hNCtQ_jl.js +167 -0
  1328. package/dist/register.configure-3prVPXwx.js +101 -0
  1329. package/dist/register.configure-Dqm2IveL.js +103 -0
  1330. package/dist/register.maintenance-BSIx4eNS.js +543 -0
  1331. package/dist/register.maintenance-DDeG6CHa.js +543 -0
  1332. package/dist/register.message-DcYPDzYr.js +657 -0
  1333. package/dist/register.message-RbFrjbch.js +660 -0
  1334. package/dist/register.onboard-BBJK_0_C.js +170 -0
  1335. package/dist/register.onboard-BrcWHC9j.js +170 -0
  1336. package/dist/register.setup-ByvEHxYQ.js +175 -0
  1337. package/dist/register.setup-CNwO5Yq3.js +175 -0
  1338. package/dist/register.status-health-sessions-CGT7bn4C.js +142 -0
  1339. package/dist/register.status-health-sessions-QK6iQSJc.js +313 -0
  1340. package/dist/register.subclis-Bd8eE94r.js +255 -0
  1341. package/dist/registry-BiekeB9q.js +116 -0
  1342. package/dist/registry-qI6V4gqU.js +116 -0
  1343. package/dist/reply-Clj5jcM5.js +32212 -0
  1344. package/dist/reply-DnH1Ueoz.js +32212 -0
  1345. package/dist/reply-prefix-D2NxVzGZ.js +100 -0
  1346. package/dist/reply-prefix-DPpz_mEi.js +100 -0
  1347. package/dist/requirements-BzZxj2Wu.js +107 -0
  1348. package/dist/requirements-DIW1svgA.js +107 -0
  1349. package/dist/rolldown-runtime-Cbj13DAv.js +20 -0
  1350. package/dist/routes-CXpne1-p.js +1820 -0
  1351. package/dist/routes-DtRwwTy6.js +1820 -0
  1352. package/dist/rpc-BBB_Fbes.js +70 -0
  1353. package/dist/rpc-CMEWfcci.js +70 -0
  1354. package/dist/run-main-DOXNrnL2.js +371 -0
  1355. package/dist/runtime-guard-BSUFiAQV.js +60 -0
  1356. package/dist/runtime-guard-DeOXA_86.js +60 -0
  1357. package/dist/sandbox-Bk0ZXcag.js +859 -0
  1358. package/dist/sandbox-D3CFkNeF.js +858 -0
  1359. package/dist/sandbox-cli-BCnnmQ03.js +458 -0
  1360. package/dist/sandbox-cli-Ctpa2Isy.js +461 -0
  1361. package/dist/secret-equal-B268kALC.js +13 -0
  1362. package/dist/secret-equal-Dghy3xsA.js +13 -0
  1363. package/dist/security-cli-BiiLLcQV.js +462 -0
  1364. package/dist/security-cli-DOZmLENS.js +465 -0
  1365. package/dist/send-BTA6qupx.js +10 -0
  1366. package/dist/send-BhAfdGII.js +10 -0
  1367. package/dist/send-C2t9xpXI.js +10 -0
  1368. package/dist/send-C6ccOW_U.js +10 -0
  1369. package/dist/send-CP74DxzJ.js +28 -0
  1370. package/dist/send-CS3G_YWr.js +10 -0
  1371. package/dist/send-D5JnqErc.js +10 -0
  1372. package/dist/send-DEMhcauI.js +32 -0
  1373. package/dist/send-DF8KJImx.js +28 -0
  1374. package/dist/send-DVW0CcHX.js +32 -0
  1375. package/dist/send-DigO-i9j.js +28 -0
  1376. package/dist/send-DqMLjD9Z.js +10 -0
  1377. package/dist/send-Dz2BDHll.js +32 -0
  1378. package/dist/send-ga9udK1_.js +10 -0
  1379. package/dist/send-oDz9NATu.js +10 -0
  1380. package/dist/server-context-BznDS2td.js +824 -0
  1381. package/dist/server-context-CXnE2F7d.js +824 -0
  1382. package/dist/server-node-events-Cu6Qkjor.js +231 -0
  1383. package/dist/server-node-events-Cv8MuF1g.js +233 -0
  1384. package/dist/service-BNVpYcQe.js +642 -0
  1385. package/dist/service-D56aMXUB.js +642 -0
  1386. package/dist/service-audit-DBsygs7y.js +488 -0
  1387. package/dist/service-audit-DKWJcTu4.js +488 -0
  1388. package/dist/session-CXcl3Xrp.js +181 -0
  1389. package/dist/session-DUFuU29j.js +179 -0
  1390. package/dist/session-M_uCxF0U.js +181 -0
  1391. package/dist/session-cost-usage-BwiTZuKl.js +600 -0
  1392. package/dist/session-cost-usage-DT9YNXTJ.js +600 -0
  1393. package/dist/session-key-BGiG_JcT.js +198 -0
  1394. package/dist/session-key-DxcgHezu.js +198 -0
  1395. package/dist/sessions-B8GUAiF6.js +1296 -0
  1396. package/dist/sessions-D0Zd1CND.js +1296 -0
  1397. package/dist/sessions-D0spLCm7.js +187 -0
  1398. package/dist/sessions-XvkHLXt4.js +2038 -0
  1399. package/dist/shared-CEHU0exQ.js +77 -0
  1400. package/dist/shared-Cgly1vPb.js +66 -0
  1401. package/dist/shared-DAHxpviD.js +77 -0
  1402. package/dist/shared-JOo05hST.js +66 -0
  1403. package/dist/shell-argv-CAq1mLa2.js +72 -0
  1404. package/dist/shell-argv-Ce41guJv.js +72 -0
  1405. package/dist/skill-scanner-CkaVLABv.js +263 -0
  1406. package/dist/skill-scanner-Coo4QoCd.js +263 -0
  1407. package/dist/skills-B-G7UHOa.js +808 -0
  1408. package/dist/skills-B5LQx4lT.js +807 -0
  1409. package/dist/skills-cli-DF9XJ2_0.js +286 -0
  1410. package/dist/skills-cli-eLBluVoD.js +289 -0
  1411. package/dist/skills-status-Clq9ZnYu.js +166 -0
  1412. package/dist/skills-status-JQluhU-P.js +166 -0
  1413. package/dist/sqlite-BukcjdJa.js +321 -0
  1414. package/dist/sqlite-CGcOZZ0C.js +368 -0
  1415. package/dist/sqlite-Ck6f9KWc.js +453 -0
  1416. package/dist/start-BvsoGNHJ.js +354 -0
  1417. package/dist/start-CF_Cp6YC.js +353 -0
  1418. package/dist/status-BKGJ7VPQ.js +27 -0
  1419. package/dist/status-BZip7mx9.js +27 -0
  1420. package/dist/status-BqYq_J5J.js +2132 -0
  1421. package/dist/status-CMnlcBVc.js +21 -0
  1422. package/dist/status-CXQrTLri.js +2137 -0
  1423. package/dist/status-tDZPwewW.js +21 -0
  1424. package/dist/status.update-CWiod7o_.js +79 -0
  1425. package/dist/status.update-D1PyrhoB.js +79 -0
  1426. package/dist/subagent-registry-CpSZ2RSO.js +2760 -0
  1427. package/dist/subagent-registry-DkCXRdwf.js +2759 -0
  1428. package/dist/subagent-registry-MPrTYaEB.js +14 -0
  1429. package/dist/subsystem-Dowf8fSU.js +860 -0
  1430. package/dist/system-cli-4Urk9KV1.js +79 -0
  1431. package/dist/system-cli-CgMzkg8R.js +82 -0
  1432. package/dist/system-run-command-DGk7dwQP.js +93 -0
  1433. package/dist/system-run-command-X9lDJIy0.js +93 -0
  1434. package/dist/systemd-BSrHDyeU.js +452 -0
  1435. package/dist/systemd-By5xdSB4.js +452 -0
  1436. package/dist/systemd-hints-BtjL_5Rh.js +36 -0
  1437. package/dist/systemd-hints-sJmr6cjb.js +36 -0
  1438. package/dist/systemd-linger-BNz8PXPF.js +75 -0
  1439. package/dist/systemd-linger-D5vLilKH.js +75 -0
  1440. package/dist/table-BL0lJzsm.js +279 -0
  1441. package/dist/table-DoiRPsn0.js +279 -0
  1442. package/dist/tailnet-CuiNECdL.js +42 -0
  1443. package/dist/tailnet-__ODlBOT.js +42 -0
  1444. package/dist/templates-DJ0ii6X2.js +47 -0
  1445. package/dist/templates-DPTs18po.js +47 -0
  1446. package/dist/thinking-BLU0jXR8.js +204 -0
  1447. package/dist/thinking-BXEswx1X.js +204 -0
  1448. package/dist/timeout-CswI_K-U.js +232 -0
  1449. package/dist/tokens-C-X7wDKj.js +14 -0
  1450. package/dist/tokens-DkvqA72p.js +14 -0
  1451. package/dist/transcript-events-C1hdue6u.js +17 -0
  1452. package/dist/transcript-events-C8Tqw4td.js +17 -0
  1453. package/dist/transcript-events-DW_H__a1.js +17 -0
  1454. package/dist/transcript-tools-DtE5di1q.js +108 -0
  1455. package/dist/transcript-tools-DuyYOkUq.js +108 -0
  1456. package/dist/trash-BJLK1vMn.js +23 -0
  1457. package/dist/trash-_x5UZ94k.js +23 -0
  1458. package/dist/tui-Cj25a9wc.js +3894 -0
  1459. package/dist/tui-Iv4T-9gg.js +3894 -0
  1460. package/dist/tui-cli-BkJxFa_n.js +50 -0
  1461. package/dist/tui-cli-DeFmBtZ7.js +47 -0
  1462. package/dist/update-DZRKbMjq.js +317 -0
  1463. package/dist/update-LFgxHHPd.js +317 -0
  1464. package/dist/update-check-CWc7YXmc.js +400 -0
  1465. package/dist/update-check-IhlWaui6.js +400 -0
  1466. package/dist/update-cli-qGGlL5Lg.js +1105 -0
  1467. package/dist/update-cli-rMqhSUMc.js +1105 -0
  1468. package/dist/update-runner-BT77y3bz.js +894 -0
  1469. package/dist/update-runner-DvzFqFJf.js +894 -0
  1470. package/dist/usage-BeZuVAY4.js +4516 -0
  1471. package/dist/usage-format-BAirWUSO.js +36 -0
  1472. package/dist/usage-format-CpORtVCG.js +36 -0
  1473. package/dist/utils-Bsw__U-F.js +243 -0
  1474. package/dist/utils-C9sj30YY.js +239 -0
  1475. package/dist/warning-filter.js +48 -0
  1476. package/dist/web-DEx7MMYq.js +2203 -0
  1477. package/dist/web-DHSoj6bL.js +46842 -0
  1478. package/dist/web-DI0g5K4c.js +63 -0
  1479. package/dist/webhooks-cli-sfLRE89X.js +319 -0
  1480. package/dist/webhooks-cli-xtZBlaD1.js +316 -0
  1481. package/dist/whatsapp-actions-DIREhxrq.js +49 -0
  1482. package/dist/whatsapp-actions-TGHl9p4i.js +45 -0
  1483. package/dist/whatsapp-actions-dBHozeuk.js +53 -0
  1484. package/dist/widearea-dns-B6ocX23x.js +127 -0
  1485. package/dist/widearea-dns-NsEUNYwz.js +127 -0
  1486. package/dist/workspace-Dcfoy5JJ.js +649 -0
  1487. package/dist/ws-COSqlEPx.js +218 -0
  1488. package/dist/ws-log-N8R5MvGE.js +267 -0
  1489. package/dist/ws-log-gwFxPxj5.js +267 -0
  1490. package/dist/wsl-CqyuRvtM.js +26 -0
  1491. package/dist/wsl-ymJYvc9Q.js +26 -0
  1492. package/package.json +209 -0
  1493. package/skills/1password/SKILL.md +70 -0
  1494. package/skills/1password/references/cli-examples.md +29 -0
  1495. package/skills/1password/references/get-started.md +17 -0
  1496. package/skills/animahub/SKILL.md +77 -0
  1497. package/skills/apple-notes/SKILL.md +77 -0
  1498. package/skills/apple-reminders/SKILL.md +96 -0
  1499. package/skills/audit/SKILL.md +68 -0
  1500. package/skills/bear-notes/SKILL.md +107 -0
  1501. package/skills/blogwatcher/SKILL.md +69 -0
  1502. package/skills/blucli/SKILL.md +47 -0
  1503. package/skills/bluebubbles/SKILL.md +131 -0
  1504. package/skills/camsnap/SKILL.md +45 -0
  1505. package/skills/canvas/SKILL.md +198 -0
  1506. package/skills/coding-agent/SKILL.md +284 -0
  1507. package/skills/deploy/SKILL.md +45 -0
  1508. package/skills/discord/SKILL.md +160 -0
  1509. package/skills/eightctl/SKILL.md +50 -0
  1510. package/skills/food-order/SKILL.md +48 -0
  1511. package/skills/gemini/SKILL.md +43 -0
  1512. package/skills/gifgrep/SKILL.md +79 -0
  1513. package/skills/github/SKILL.md +77 -0
  1514. package/skills/gog/SKILL.md +116 -0
  1515. package/skills/goplaces/SKILL.md +52 -0
  1516. package/skills/healthcheck/SKILL.md +245 -0
  1517. package/skills/himalaya/SKILL.md +257 -0
  1518. package/skills/himalaya/references/configuration.md +184 -0
  1519. package/skills/himalaya/references/message-composition.md +199 -0
  1520. package/skills/imsg/SKILL.md +74 -0
  1521. package/skills/mcporter/SKILL.md +61 -0
  1522. package/skills/model-usage/SKILL.md +69 -0
  1523. package/skills/model-usage/references/codexbar-cli.md +33 -0
  1524. package/skills/model-usage/scripts/model_usage.py +310 -0
  1525. package/skills/nano-banana-pro/SKILL.md +58 -0
  1526. package/skills/nano-banana-pro/scripts/generate_image.py +184 -0
  1527. package/skills/nano-pdf/SKILL.md +38 -0
  1528. package/skills/notion/SKILL.md +172 -0
  1529. package/skills/obsidian/SKILL.md +81 -0
  1530. package/skills/openai-image-gen/SKILL.md +89 -0
  1531. package/skills/openai-image-gen/scripts/gen.py +240 -0
  1532. package/skills/openai-whisper/SKILL.md +38 -0
  1533. package/skills/openai-whisper-api/SKILL.md +52 -0
  1534. package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
  1535. package/skills/openhue/SKILL.md +51 -0
  1536. package/skills/oracle/SKILL.md +125 -0
  1537. package/skills/ordercli/SKILL.md +78 -0
  1538. package/skills/peekaboo/SKILL.md +190 -0
  1539. package/skills/review/SKILL.md +58 -0
  1540. package/skills/sag/SKILL.md +87 -0
  1541. package/skills/session-logs/SKILL.md +115 -0
  1542. package/skills/sherpa-onnx-tts/SKILL.md +103 -0
  1543. package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
  1544. package/skills/skill-creator/SKILL.md +370 -0
  1545. package/skills/skill-creator/license.txt +202 -0
  1546. package/skills/skill-creator/scripts/init_skill.py +378 -0
  1547. package/skills/skill-creator/scripts/package_skill.py +111 -0
  1548. package/skills/skill-creator/scripts/quick_validate.py +101 -0
  1549. package/skills/slack/SKILL.md +144 -0
  1550. package/skills/songsee/SKILL.md +49 -0
  1551. package/skills/sonoscli/SKILL.md +46 -0
  1552. package/skills/spotify-player/SKILL.md +64 -0
  1553. package/skills/summarize/SKILL.md +87 -0
  1554. package/skills/things-mac/SKILL.md +86 -0
  1555. package/skills/tmux/SKILL.md +135 -0
  1556. package/skills/tmux/scripts/find-sessions.sh +112 -0
  1557. package/skills/tmux/scripts/wait-for-text.sh +83 -0
  1558. package/skills/trello/SKILL.md +95 -0
  1559. package/skills/video-frames/SKILL.md +46 -0
  1560. package/skills/video-frames/scripts/frame.sh +81 -0
  1561. package/skills/voice-call/SKILL.md +45 -0
  1562. package/skills/wacli/SKILL.md +72 -0
  1563. package/skills/weather/SKILL.md +54 -0
  1564. package/templates/BRAIN.md +65 -0
  1565. package/templates/GUT.md +44 -0
  1566. package/templates/HEART.md +51 -0
  1567. package/templates/MEMORY.md +66 -0
  1568. package/templates/SHADOW.md +68 -0
  1569. package/templates/SOUL.md +38 -0
  1570. package/templates/SPIRIT.md +43 -0
@@ -0,0 +1,2203 @@
1
+ import { D as shouldLogVerbose, N as getChildLogger, h as defaultRuntime, o as createSubsystemLogger, w as logVerbose } from "./entry.js";
2
+ import "./auth-profiles-Cz2rxrav.js";
3
+ import { t as formatCliCommand } from "./command-format-Clp46jkj.js";
4
+ import { i as buildAgentMainSessionKey, l as normalizeAgentId, o as buildGroupHistoryKey, r as DEFAULT_MAIN_KEY } from "./session-key-BGiG_JcT.js";
5
+ import { C as sleep, T as toWhatsappJid, f as isSelfChatMode, m as normalizeE164, n as clamp, p as jidToE164, v as resolveJidToE164 } from "./utils-C9sj30YY.js";
6
+ import "./exec-BizYYQgP.js";
7
+ import "./agent-scope-OZi7lb8S.js";
8
+ import "./pi-model-discovery-DsRqYJLy.js";
9
+ import "./skills-B5LQx4lT.js";
10
+ import "./manifest-registry-D4lM2RdV.js";
11
+ import { i as loadConfig } from "./config-CHc5qzaI.js";
12
+ import "./client-C1avc0vD.js";
13
+ import "./call-ktoEhkOQ.js";
14
+ import "./message-channel-w4F2b2F6.js";
15
+ import "./timeout-CswI_K-U.js";
16
+ import { a as readSessionUpdatedAt, c as updateLastRoute, i as loadSessionStore, k as resolveGroupSessionKey, o as recordSessionMetaFromInbound } from "./sessions-D0Zd1CND.js";
17
+ import { B as resolveIdentityNamePrefix, V as resolveMessagePrefix } from "./subagent-registry-DkCXRdwf.js";
18
+ import "./logging-BdnOSVPD.js";
19
+ import { a as logWebSelfId, c as pickWebChannel, i as getWebAuthAgeMs, l as readWebSelfId, n as resolveWhatsAppAccount, p as webAuthExists, r as WA_WEB_AUTH_DIR } from "./accounts-CcVrwKqv.js";
20
+ import { $ as buildAgentSessionKey, At as registerUnhandledRejectionHandler, Dt as buildMentionRegexes, Gt as finalizeInboundContext, Ot as normalizeMentionText, _t as hasControlCommand, at as recordChannelActivity, ct as dispatchReplyWithBufferedBlockDispatcher, et as resolveAgentRoute, f as normalizeGroupActivation, ft as createDedupeCache, gt as resolveEnvelopeFormatOptions, ht as formatInboundEnvelope, mt as resolveInboundDebounceMs, p as parseActivationCommand, pt as createInboundDebouncer, rt as buildPairingReply, st as shouldAckReactionForWhatsApp, t as getReplyFromConfig, vt as shouldComputeCommandAuthorized } from "./reply-Clj5jcM5.js";
21
+ import "./plugins-CDJw924T.js";
22
+ import "./tokens-C-X7wDKj.js";
23
+ import { o as resolveChannelGroupPolicy, s as resolveChannelGroupRequireMention } from "./dock-DbxBBv30.js";
24
+ import { c as resolveStorePath } from "./paths-CxRf2rBG.js";
25
+ import { c as resolveTextChunkLimit, i as chunkMarkdownTextWithMode, s as resolveChunkMode, u as resolveMarkdownTableMode } from "./chunk-mxPVo000.js";
26
+ import { d as setActiveWebListener, n as loadWebMedia, p as convertMarkdownTables } from "./media-THyainiE.js";
27
+ import { i as markdownToWhatsApp, n as sendMessageWhatsApp, r as sendReactionWhatsApp } from "./outbound-BEq0qbPR.js";
28
+ import "./mime-B1ZoR53M.js";
29
+ import "./image-ops-Dlt3T7th.js";
30
+ import "./common-D6bu0zHC.js";
31
+ import "./server-context-BznDS2td.js";
32
+ import "./chrome-Bi6iZ5sG.js";
33
+ import "./auth-lZ26wsbN.js";
34
+ import "./ports-CqLSlU6Z.js";
35
+ import "./trash-BJLK1vMn.js";
36
+ import "./control-service-vyKJ-XUp.js";
37
+ import { Wt as enqueueSystemEvent } from "./cli-session-oXJQpenl.js";
38
+ import "./thinking-BXEswx1X.js";
39
+ import "./context-DKaQYnCH.js";
40
+ import "./sandbox-D3CFkNeF.js";
41
+ import { r as saveMediaBuffer } from "./routes-CXpne1-p.js";
42
+ import "./paths-DcVEkYX5.js";
43
+ import "./commands-registry-Bd0xbvwG.js";
44
+ import "./deliver-bC6iI_rv.js";
45
+ import { i as readChannelAllowFromStore, o as upsertChannelPairingRequest } from "./pairing-store-DqQPqRMe.js";
46
+ import "./nodes-screen-DZeD8hE5.js";
47
+ import { r as formatDurationPrecise } from "./format-duration-DhWzz_5b.js";
48
+ import "./memory-cli-BoXdfCLT.js";
49
+ import "./manager-Bsy9ifug.js";
50
+ import "./sqlite-BukcjdJa.js";
51
+ import "./redact-ClVwO7Nn.js";
52
+ import "./links-BfjHVTB_.js";
53
+ import "./progress-CbZ2D53A.js";
54
+ import "./dispatcher-Bkcui7jz.js";
55
+ import "./channel-selection-DfGpCyh2.js";
56
+ import "./delivery-queue-B6IHz4Ry.js";
57
+ import "./pi-tools.policy-DRDm3v-2.js";
58
+ import "./session-cost-usage-BwiTZuKl.js";
59
+ import { i as waitForWaConnection, n as formatError, r as getStatusCode, t as createWaSocket } from "./session-CXcl3Xrp.js";
60
+ import { i as recordPendingHistoryEntryIfEnabled, n as DEFAULT_GROUP_HISTORY_LIMIT, r as buildHistoryContextFromEntries, t as createReplyPrefixOptions } from "./reply-prefix-D2NxVzGZ.js";
61
+ import { t as loginWeb } from "./login--8D8kyRy.js";
62
+ import { randomUUID } from "node:crypto";
63
+ import { setTimeout } from "node:timers/promises";
64
+ import { DisconnectReason, downloadMediaMessage, extractMessageContent, getContentType, isJidGroup, normalizeMessageContent } from "@whiskeysockets/baileys";
65
+
66
+ //#region src/web/auto-reply/constants.ts
67
+ const DEFAULT_WEB_MEDIA_BYTES = 5 * 1024 * 1024;
68
+
69
+ //#endregion
70
+ //#region src/infra/backoff.ts
71
+ function computeBackoff(policy, attempt) {
72
+ const base = policy.initialMs * policy.factor ** Math.max(attempt - 1, 0);
73
+ const jitter = base * policy.jitter * Math.random();
74
+ return Math.min(policy.maxMs, Math.round(base + jitter));
75
+ }
76
+ async function sleepWithAbort(ms, abortSignal) {
77
+ if (ms <= 0) return;
78
+ try {
79
+ await setTimeout(ms, void 0, { signal: abortSignal });
80
+ } catch (err) {
81
+ if (abortSignal?.aborted) throw new Error("aborted", { cause: err });
82
+ throw err;
83
+ }
84
+ }
85
+
86
+ //#endregion
87
+ //#region src/web/reconnect.ts
88
+ const DEFAULT_HEARTBEAT_SECONDS = 60;
89
+ const DEFAULT_RECONNECT_POLICY = {
90
+ initialMs: 2e3,
91
+ maxMs: 3e4,
92
+ factor: 1.8,
93
+ jitter: .25,
94
+ maxAttempts: 12
95
+ };
96
+ function resolveHeartbeatSeconds(cfg, overrideSeconds) {
97
+ const candidate = overrideSeconds ?? cfg.web?.heartbeatSeconds;
98
+ if (typeof candidate === "number" && candidate > 0) return candidate;
99
+ return DEFAULT_HEARTBEAT_SECONDS;
100
+ }
101
+ function resolveReconnectPolicy(cfg, overrides) {
102
+ const reconnectOverrides = cfg.web?.reconnect ?? {};
103
+ const overrideConfig = overrides ?? {};
104
+ const merged = {
105
+ ...DEFAULT_RECONNECT_POLICY,
106
+ ...reconnectOverrides,
107
+ ...overrideConfig
108
+ };
109
+ merged.initialMs = Math.max(250, merged.initialMs);
110
+ merged.maxMs = Math.max(merged.initialMs, merged.maxMs);
111
+ merged.factor = clamp(merged.factor, 1.1, 10);
112
+ merged.jitter = clamp(merged.jitter, 0, 1);
113
+ merged.maxAttempts = Math.max(0, Math.floor(merged.maxAttempts));
114
+ return merged;
115
+ }
116
+ function newConnectionId() {
117
+ return randomUUID();
118
+ }
119
+
120
+ //#endregion
121
+ //#region src/web/auto-reply/loggers.ts
122
+ const whatsappLog = createSubsystemLogger("gateway/channels/whatsapp");
123
+ const whatsappInboundLog = whatsappLog.child("inbound");
124
+ const whatsappOutboundLog = whatsappLog.child("outbound");
125
+ const whatsappHeartbeatLog = whatsappLog.child("heartbeat");
126
+
127
+ //#endregion
128
+ //#region src/web/auto-reply/util.ts
129
+ function elide(text, limit = 400) {
130
+ if (!text) return text;
131
+ if (text.length <= limit) return text;
132
+ return `${text.slice(0, limit)}… (truncated ${text.length - limit} chars)`;
133
+ }
134
+ function isLikelyWhatsAppCryptoError(reason) {
135
+ const formatReason = (value) => {
136
+ if (value == null) return "";
137
+ if (typeof value === "string") return value;
138
+ if (value instanceof Error) return `${value.message}\n${value.stack ?? ""}`;
139
+ if (typeof value === "object") try {
140
+ return JSON.stringify(value);
141
+ } catch {
142
+ return Object.prototype.toString.call(value);
143
+ }
144
+ if (typeof value === "number") return String(value);
145
+ if (typeof value === "boolean") return String(value);
146
+ if (typeof value === "bigint") return String(value);
147
+ if (typeof value === "symbol") return value.description ?? value.toString();
148
+ if (typeof value === "function") return value.name ? `[function ${value.name}]` : "[function]";
149
+ return Object.prototype.toString.call(value);
150
+ };
151
+ const haystack = (reason instanceof Error ? `${reason.message}\n${reason.stack ?? ""}` : formatReason(reason)).toLowerCase();
152
+ if (!(haystack.includes("unsupported state or unable to authenticate data") || haystack.includes("bad mac"))) return false;
153
+ return haystack.includes("@whiskeysockets/baileys") || haystack.includes("baileys") || haystack.includes("noise-handler") || haystack.includes("aesdecryptgcm");
154
+ }
155
+
156
+ //#endregion
157
+ //#region src/cli/wait.ts
158
+ function waitForever() {
159
+ setInterval(() => {}, 1e6).unref();
160
+ return new Promise(() => {});
161
+ }
162
+
163
+ //#endregion
164
+ //#region src/web/inbound/dedupe.ts
165
+ const recentInboundMessages = createDedupeCache({
166
+ ttlMs: 20 * 6e4,
167
+ maxSize: 5e3
168
+ });
169
+ function isRecentInboundMessage(key) {
170
+ return recentInboundMessages.check(key);
171
+ }
172
+
173
+ //#endregion
174
+ //#region src/channels/location.ts
175
+ function resolveLocation(location) {
176
+ const source = location.source ?? (location.isLive ? "live" : location.name || location.address ? "place" : "pin");
177
+ const isLive = Boolean(location.isLive ?? source === "live");
178
+ return {
179
+ ...location,
180
+ source,
181
+ isLive
182
+ };
183
+ }
184
+ function formatAccuracy(accuracy) {
185
+ if (!Number.isFinite(accuracy)) return "";
186
+ return ` ±${Math.round(accuracy ?? 0)}m`;
187
+ }
188
+ function formatCoords(latitude, longitude) {
189
+ return `${latitude.toFixed(6)}, ${longitude.toFixed(6)}`;
190
+ }
191
+ function formatLocationText(location) {
192
+ const resolved = resolveLocation(location);
193
+ const coords = formatCoords(resolved.latitude, resolved.longitude);
194
+ const accuracy = formatAccuracy(resolved.accuracy);
195
+ const caption = resolved.caption?.trim();
196
+ let header = "";
197
+ if (resolved.source === "live" || resolved.isLive) header = `🛰 Live location: ${coords}${accuracy}`;
198
+ else if (resolved.name || resolved.address) header = `📍 ${[resolved.name, resolved.address].filter(Boolean).join(" — ")} (${coords}${accuracy})`;
199
+ else header = `📍 ${coords}${accuracy}`;
200
+ return caption ? `${header}\n${caption}` : header;
201
+ }
202
+ function toLocationContext(location) {
203
+ const resolved = resolveLocation(location);
204
+ return {
205
+ LocationLat: resolved.latitude,
206
+ LocationLon: resolved.longitude,
207
+ LocationAccuracy: resolved.accuracy,
208
+ LocationName: resolved.name,
209
+ LocationAddress: resolved.address,
210
+ LocationSource: resolved.source,
211
+ LocationIsLive: resolved.isLive
212
+ };
213
+ }
214
+
215
+ //#endregion
216
+ //#region src/web/vcard.ts
217
+ const ALLOWED_VCARD_KEYS = new Set([
218
+ "FN",
219
+ "N",
220
+ "TEL"
221
+ ]);
222
+ function parseVcard(vcard) {
223
+ if (!vcard) return { phones: [] };
224
+ const lines = vcard.split(/\r?\n/);
225
+ let nameFromN;
226
+ let nameFromFn;
227
+ const phones = [];
228
+ for (const rawLine of lines) {
229
+ const line = rawLine.trim();
230
+ if (!line) continue;
231
+ const colonIndex = line.indexOf(":");
232
+ if (colonIndex === -1) continue;
233
+ const key = line.slice(0, colonIndex).toUpperCase();
234
+ const rawValue = line.slice(colonIndex + 1).trim();
235
+ if (!rawValue) continue;
236
+ const baseKey = normalizeVcardKey(key);
237
+ if (!baseKey || !ALLOWED_VCARD_KEYS.has(baseKey)) continue;
238
+ const value = cleanVcardValue(rawValue);
239
+ if (!value) continue;
240
+ if (baseKey === "FN" && !nameFromFn) {
241
+ nameFromFn = normalizeVcardName(value);
242
+ continue;
243
+ }
244
+ if (baseKey === "N" && !nameFromN) {
245
+ nameFromN = normalizeVcardName(value);
246
+ continue;
247
+ }
248
+ if (baseKey === "TEL") {
249
+ const phone = normalizeVcardPhone(value);
250
+ if (phone) phones.push(phone);
251
+ }
252
+ }
253
+ return {
254
+ name: nameFromFn ?? nameFromN,
255
+ phones
256
+ };
257
+ }
258
+ function normalizeVcardKey(key) {
259
+ const [primary] = key.split(";");
260
+ if (!primary) return;
261
+ const segments = primary.split(".");
262
+ return segments[segments.length - 1] || void 0;
263
+ }
264
+ function cleanVcardValue(value) {
265
+ return value.replace(/\\n/gi, " ").replace(/\\,/g, ",").replace(/\\;/g, ";").trim();
266
+ }
267
+ function normalizeVcardName(value) {
268
+ return value.replace(/;/g, " ").replace(/\s+/g, " ").trim();
269
+ }
270
+ function normalizeVcardPhone(value) {
271
+ const trimmed = value.trim();
272
+ if (!trimmed) return "";
273
+ if (trimmed.toLowerCase().startsWith("tel:")) return trimmed.slice(4).trim();
274
+ return trimmed;
275
+ }
276
+
277
+ //#endregion
278
+ //#region src/web/inbound/extract.ts
279
+ function unwrapMessage$1(message) {
280
+ return normalizeMessageContent(message);
281
+ }
282
+ function extractContextInfo(message) {
283
+ if (!message) return;
284
+ const contentType = getContentType(message);
285
+ const candidate = contentType ? message[contentType] : void 0;
286
+ const contextInfo = candidate && typeof candidate === "object" && "contextInfo" in candidate ? candidate.contextInfo : void 0;
287
+ if (contextInfo) return contextInfo;
288
+ const fallback = message.extendedTextMessage?.contextInfo ?? message.imageMessage?.contextInfo ?? message.videoMessage?.contextInfo ?? message.documentMessage?.contextInfo ?? message.audioMessage?.contextInfo ?? message.stickerMessage?.contextInfo ?? message.buttonsResponseMessage?.contextInfo ?? message.listResponseMessage?.contextInfo ?? message.templateButtonReplyMessage?.contextInfo ?? message.interactiveResponseMessage?.contextInfo ?? message.buttonsMessage?.contextInfo ?? message.listMessage?.contextInfo;
289
+ if (fallback) return fallback;
290
+ for (const value of Object.values(message)) {
291
+ if (!value || typeof value !== "object") continue;
292
+ if (!("contextInfo" in value)) continue;
293
+ const candidateContext = value.contextInfo;
294
+ if (candidateContext) return candidateContext;
295
+ }
296
+ }
297
+ function extractMentionedJids(rawMessage) {
298
+ const message = unwrapMessage$1(rawMessage);
299
+ if (!message) return;
300
+ const flattened = [
301
+ message.extendedTextMessage?.contextInfo?.mentionedJid,
302
+ message.extendedTextMessage?.contextInfo?.quotedMessage?.extendedTextMessage?.contextInfo?.mentionedJid,
303
+ message.imageMessage?.contextInfo?.mentionedJid,
304
+ message.videoMessage?.contextInfo?.mentionedJid,
305
+ message.documentMessage?.contextInfo?.mentionedJid,
306
+ message.audioMessage?.contextInfo?.mentionedJid,
307
+ message.stickerMessage?.contextInfo?.mentionedJid,
308
+ message.buttonsResponseMessage?.contextInfo?.mentionedJid,
309
+ message.listResponseMessage?.contextInfo?.mentionedJid
310
+ ].flatMap((arr) => arr ?? []).filter(Boolean);
311
+ if (flattened.length === 0) return;
312
+ return Array.from(new Set(flattened));
313
+ }
314
+ function extractText(rawMessage) {
315
+ const message = unwrapMessage$1(rawMessage);
316
+ if (!message) return;
317
+ const extracted = extractMessageContent(message);
318
+ const candidates = [message, extracted && extracted !== message ? extracted : void 0];
319
+ for (const candidate of candidates) {
320
+ if (!candidate) continue;
321
+ if (typeof candidate.conversation === "string" && candidate.conversation.trim()) return candidate.conversation.trim();
322
+ const extended = candidate.extendedTextMessage?.text;
323
+ if (extended?.trim()) return extended.trim();
324
+ const caption = candidate.imageMessage?.caption ?? candidate.videoMessage?.caption ?? candidate.documentMessage?.caption;
325
+ if (caption?.trim()) return caption.trim();
326
+ }
327
+ const contactPlaceholder = extractContactPlaceholder(message) ?? (extracted && extracted !== message ? extractContactPlaceholder(extracted) : void 0);
328
+ if (contactPlaceholder) return contactPlaceholder;
329
+ }
330
+ function extractMediaPlaceholder(rawMessage) {
331
+ const message = unwrapMessage$1(rawMessage);
332
+ if (!message) return;
333
+ if (message.imageMessage) return "<media:image>";
334
+ if (message.videoMessage) return "<media:video>";
335
+ if (message.audioMessage) return "<media:audio>";
336
+ if (message.documentMessage) return "<media:document>";
337
+ if (message.stickerMessage) return "<media:sticker>";
338
+ }
339
+ function extractContactPlaceholder(rawMessage) {
340
+ const message = unwrapMessage$1(rawMessage);
341
+ if (!message) return;
342
+ const contact = message.contactMessage ?? void 0;
343
+ if (contact) {
344
+ const { name, phones } = describeContact({
345
+ displayName: contact.displayName,
346
+ vcard: contact.vcard
347
+ });
348
+ return formatContactPlaceholder(name, phones);
349
+ }
350
+ const contactsArray = message.contactsArrayMessage?.contacts ?? void 0;
351
+ if (!contactsArray || contactsArray.length === 0) return;
352
+ return formatContactsPlaceholder(contactsArray.map((entry) => describeContact({
353
+ displayName: entry.displayName,
354
+ vcard: entry.vcard
355
+ })).map((entry) => formatContactLabel(entry.name, entry.phones)).filter((value) => Boolean(value)), contactsArray.length);
356
+ }
357
+ function describeContact(input) {
358
+ const displayName = (input.displayName ?? "").trim();
359
+ const parsed = parseVcard(input.vcard ?? void 0);
360
+ return {
361
+ name: displayName || parsed.name,
362
+ phones: parsed.phones
363
+ };
364
+ }
365
+ function formatContactPlaceholder(name, phones) {
366
+ const label = formatContactLabel(name, phones);
367
+ if (!label) return "<contact>";
368
+ return `<contact: ${label}>`;
369
+ }
370
+ function formatContactsPlaceholder(labels, total) {
371
+ const cleaned = labels.map((label) => label.trim()).filter(Boolean);
372
+ if (cleaned.length === 0) return `<contacts: ${total} ${total === 1 ? "contact" : "contacts"}>`;
373
+ const remaining = Math.max(total - cleaned.length, 0);
374
+ const suffix = remaining > 0 ? ` +${remaining} more` : "";
375
+ return `<contacts: ${cleaned.join(", ")}${suffix}>`;
376
+ }
377
+ function formatContactLabel(name, phones) {
378
+ const parts = [name, formatPhoneList(phones)].filter((value) => Boolean(value));
379
+ if (parts.length === 0) return;
380
+ return parts.join(", ");
381
+ }
382
+ function formatPhoneList(phones) {
383
+ const cleaned = phones?.map((phone) => phone.trim()).filter(Boolean) ?? [];
384
+ if (cleaned.length === 0) return;
385
+ const { shown, remaining } = summarizeList(cleaned, cleaned.length, 1);
386
+ const [primary] = shown;
387
+ if (!primary) return;
388
+ if (remaining === 0) return primary;
389
+ return `${primary} (+${remaining} more)`;
390
+ }
391
+ function summarizeList(values, total, maxShown) {
392
+ const shown = values.slice(0, maxShown);
393
+ return {
394
+ shown,
395
+ remaining: Math.max(total - shown.length, 0)
396
+ };
397
+ }
398
+ function extractLocationData(rawMessage) {
399
+ const message = unwrapMessage$1(rawMessage);
400
+ if (!message) return null;
401
+ const live = message.liveLocationMessage ?? void 0;
402
+ if (live) {
403
+ const latitudeRaw = live.degreesLatitude;
404
+ const longitudeRaw = live.degreesLongitude;
405
+ if (latitudeRaw != null && longitudeRaw != null) {
406
+ const latitude = Number(latitudeRaw);
407
+ const longitude = Number(longitudeRaw);
408
+ if (Number.isFinite(latitude) && Number.isFinite(longitude)) return {
409
+ latitude,
410
+ longitude,
411
+ accuracy: live.accuracyInMeters ?? void 0,
412
+ caption: live.caption ?? void 0,
413
+ source: "live",
414
+ isLive: true
415
+ };
416
+ }
417
+ }
418
+ const location = message.locationMessage ?? void 0;
419
+ if (location) {
420
+ const latitudeRaw = location.degreesLatitude;
421
+ const longitudeRaw = location.degreesLongitude;
422
+ if (latitudeRaw != null && longitudeRaw != null) {
423
+ const latitude = Number(latitudeRaw);
424
+ const longitude = Number(longitudeRaw);
425
+ if (Number.isFinite(latitude) && Number.isFinite(longitude)) {
426
+ const isLive = Boolean(location.isLive);
427
+ return {
428
+ latitude,
429
+ longitude,
430
+ accuracy: location.accuracyInMeters ?? void 0,
431
+ name: location.name ?? void 0,
432
+ address: location.address ?? void 0,
433
+ caption: location.comment ?? void 0,
434
+ source: isLive ? "live" : location.name || location.address ? "place" : "pin",
435
+ isLive
436
+ };
437
+ }
438
+ }
439
+ }
440
+ return null;
441
+ }
442
+ function describeReplyContext(rawMessage) {
443
+ const message = unwrapMessage$1(rawMessage);
444
+ if (!message) return null;
445
+ const contextInfo = extractContextInfo(message);
446
+ const quoted = normalizeMessageContent(contextInfo?.quotedMessage);
447
+ if (!quoted) return null;
448
+ const location = extractLocationData(quoted);
449
+ const locationText = location ? formatLocationText(location) : void 0;
450
+ let body = [extractText(quoted), locationText].filter(Boolean).join("\n").trim();
451
+ if (!body) body = extractMediaPlaceholder(quoted);
452
+ if (!body) {
453
+ const quotedType = quoted ? getContentType(quoted) : void 0;
454
+ logVerbose(`Quoted message missing extractable body${quotedType ? ` (type ${quotedType})` : ""}`);
455
+ return null;
456
+ }
457
+ const senderJid = contextInfo?.participant ?? void 0;
458
+ const senderE164 = senderJid ? jidToE164(senderJid) ?? senderJid : void 0;
459
+ const sender = senderE164 ?? "unknown sender";
460
+ return {
461
+ id: contextInfo?.stanzaId ? String(contextInfo.stanzaId) : void 0,
462
+ body,
463
+ sender,
464
+ senderJid,
465
+ senderE164
466
+ };
467
+ }
468
+
469
+ //#endregion
470
+ //#region src/web/inbound/access-control.ts
471
+ const PAIRING_REPLY_HISTORY_GRACE_MS = 3e4;
472
+ async function checkInboundAccessControl(params) {
473
+ const cfg = loadConfig();
474
+ const account = resolveWhatsAppAccount({
475
+ cfg,
476
+ accountId: params.accountId
477
+ });
478
+ const dmPolicy = account.dmPolicy ?? "pairing";
479
+ const configuredAllowFrom = account.allowFrom;
480
+ const storeAllowFrom = await readChannelAllowFromStore("whatsapp").catch(() => []);
481
+ const combinedAllowFrom = Array.from(new Set([...configuredAllowFrom ?? [], ...storeAllowFrom]));
482
+ const defaultAllowFrom = combinedAllowFrom.length === 0 && params.selfE164 ? [params.selfE164] : void 0;
483
+ const allowFrom = combinedAllowFrom.length > 0 ? combinedAllowFrom : defaultAllowFrom;
484
+ const groupAllowFrom = account.groupAllowFrom ?? (configuredAllowFrom && configuredAllowFrom.length > 0 ? configuredAllowFrom : void 0);
485
+ const isSamePhone = params.from === params.selfE164;
486
+ const isSelfChat = isSelfChatMode(params.selfE164, configuredAllowFrom);
487
+ const pairingGraceMs = typeof params.pairingGraceMs === "number" && params.pairingGraceMs > 0 ? params.pairingGraceMs : PAIRING_REPLY_HISTORY_GRACE_MS;
488
+ const suppressPairingReply = typeof params.connectedAtMs === "number" && typeof params.messageTimestampMs === "number" && params.messageTimestampMs < params.connectedAtMs - pairingGraceMs;
489
+ const dmHasWildcard = allowFrom?.includes("*") ?? false;
490
+ const normalizedAllowFrom = allowFrom && allowFrom.length > 0 ? allowFrom.filter((entry) => entry !== "*").map(normalizeE164) : [];
491
+ const groupHasWildcard = groupAllowFrom?.includes("*") ?? false;
492
+ const normalizedGroupAllowFrom = groupAllowFrom && groupAllowFrom.length > 0 ? groupAllowFrom.filter((entry) => entry !== "*").map(normalizeE164) : [];
493
+ const defaultGroupPolicy = cfg.channels?.defaults?.groupPolicy;
494
+ const groupPolicy = account.groupPolicy ?? defaultGroupPolicy ?? "open";
495
+ if (params.group && groupPolicy === "disabled") {
496
+ logVerbose("Blocked group message (groupPolicy: disabled)");
497
+ return {
498
+ allowed: false,
499
+ shouldMarkRead: false,
500
+ isSelfChat,
501
+ resolvedAccountId: account.accountId
502
+ };
503
+ }
504
+ if (params.group && groupPolicy === "allowlist") {
505
+ if (!groupAllowFrom || groupAllowFrom.length === 0) {
506
+ logVerbose("Blocked group message (groupPolicy: allowlist, no groupAllowFrom)");
507
+ return {
508
+ allowed: false,
509
+ shouldMarkRead: false,
510
+ isSelfChat,
511
+ resolvedAccountId: account.accountId
512
+ };
513
+ }
514
+ if (!(groupHasWildcard || params.senderE164 != null && normalizedGroupAllowFrom.includes(params.senderE164))) {
515
+ logVerbose(`Blocked group message from ${params.senderE164 ?? "unknown sender"} (groupPolicy: allowlist)`);
516
+ return {
517
+ allowed: false,
518
+ shouldMarkRead: false,
519
+ isSelfChat,
520
+ resolvedAccountId: account.accountId
521
+ };
522
+ }
523
+ }
524
+ if (!params.group) {
525
+ if (params.isFromMe && !isSamePhone) {
526
+ logVerbose("Skipping outbound DM (fromMe); no pairing reply needed.");
527
+ return {
528
+ allowed: false,
529
+ shouldMarkRead: false,
530
+ isSelfChat,
531
+ resolvedAccountId: account.accountId
532
+ };
533
+ }
534
+ if (dmPolicy === "disabled") {
535
+ logVerbose("Blocked dm (dmPolicy: disabled)");
536
+ return {
537
+ allowed: false,
538
+ shouldMarkRead: false,
539
+ isSelfChat,
540
+ resolvedAccountId: account.accountId
541
+ };
542
+ }
543
+ if (dmPolicy !== "open" && !isSamePhone) {
544
+ const candidate = params.from;
545
+ if (!(dmHasWildcard || normalizedAllowFrom.length > 0 && normalizedAllowFrom.includes(candidate))) {
546
+ if (dmPolicy === "pairing") if (suppressPairingReply) logVerbose(`Skipping pairing reply for historical DM from ${candidate}.`);
547
+ else {
548
+ const { code, created } = await upsertChannelPairingRequest({
549
+ channel: "whatsapp",
550
+ id: candidate,
551
+ meta: { name: (params.pushName ?? "").trim() || void 0 }
552
+ });
553
+ if (created) {
554
+ logVerbose(`whatsapp pairing request sender=${candidate} name=${params.pushName ?? "unknown"}`);
555
+ try {
556
+ await params.sock.sendMessage(params.remoteJid, { text: buildPairingReply({
557
+ channel: "whatsapp",
558
+ idLine: `Your WhatsApp phone number: ${candidate}`,
559
+ code
560
+ }) });
561
+ } catch (err) {
562
+ logVerbose(`whatsapp pairing reply failed for ${candidate}: ${String(err)}`);
563
+ }
564
+ }
565
+ }
566
+ else logVerbose(`Blocked unauthorized sender ${candidate} (dmPolicy=${dmPolicy})`);
567
+ return {
568
+ allowed: false,
569
+ shouldMarkRead: false,
570
+ isSelfChat,
571
+ resolvedAccountId: account.accountId
572
+ };
573
+ }
574
+ }
575
+ }
576
+ return {
577
+ allowed: true,
578
+ shouldMarkRead: true,
579
+ isSelfChat,
580
+ resolvedAccountId: account.accountId
581
+ };
582
+ }
583
+
584
+ //#endregion
585
+ //#region src/web/inbound/media.ts
586
+ function unwrapMessage(message) {
587
+ return normalizeMessageContent(message);
588
+ }
589
+ /**
590
+ * Resolve the MIME type for an inbound media message.
591
+ * Falls back to WhatsApp's standard formats when Baileys omits the MIME.
592
+ */
593
+ function resolveMediaMimetype(message) {
594
+ const explicit = message.imageMessage?.mimetype ?? message.videoMessage?.mimetype ?? message.documentMessage?.mimetype ?? message.audioMessage?.mimetype ?? message.stickerMessage?.mimetype ?? void 0;
595
+ if (explicit) return explicit;
596
+ if (message.audioMessage) return "audio/ogg; codecs=opus";
597
+ if (message.imageMessage) return "image/jpeg";
598
+ if (message.videoMessage) return "video/mp4";
599
+ if (message.stickerMessage) return "image/webp";
600
+ }
601
+ async function downloadInboundMedia(msg, sock) {
602
+ const message = unwrapMessage(msg.message);
603
+ if (!message) return;
604
+ const mimetype = resolveMediaMimetype(message);
605
+ const fileName = message.documentMessage?.fileName ?? void 0;
606
+ if (!message.imageMessage && !message.videoMessage && !message.documentMessage && !message.audioMessage && !message.stickerMessage) return;
607
+ try {
608
+ return {
609
+ buffer: await downloadMediaMessage(msg, "buffer", {}, {
610
+ reuploadRequest: sock.updateMediaMessage,
611
+ logger: sock.logger
612
+ }),
613
+ mimetype,
614
+ fileName
615
+ };
616
+ } catch (err) {
617
+ logVerbose(`downloadMediaMessage failed: ${String(err)}`);
618
+ return;
619
+ }
620
+ }
621
+
622
+ //#endregion
623
+ //#region src/web/inbound/send-api.ts
624
+ function createWebSendApi(params) {
625
+ return {
626
+ sendMessage: async (to, text, mediaBuffer, mediaType, sendOptions) => {
627
+ const jid = toWhatsappJid(to);
628
+ let payload;
629
+ if (mediaBuffer && mediaType) if (mediaType.startsWith("image/")) payload = {
630
+ image: mediaBuffer,
631
+ caption: text || void 0,
632
+ mimetype: mediaType
633
+ };
634
+ else if (mediaType.startsWith("audio/")) payload = {
635
+ audio: mediaBuffer,
636
+ ptt: true,
637
+ mimetype: mediaType
638
+ };
639
+ else if (mediaType.startsWith("video/")) {
640
+ const gifPlayback = sendOptions?.gifPlayback;
641
+ payload = {
642
+ video: mediaBuffer,
643
+ caption: text || void 0,
644
+ mimetype: mediaType,
645
+ ...gifPlayback ? { gifPlayback: true } : {}
646
+ };
647
+ } else payload = {
648
+ document: mediaBuffer,
649
+ fileName: sendOptions?.fileName?.trim() || "file",
650
+ caption: text || void 0,
651
+ mimetype: mediaType
652
+ };
653
+ else payload = { text };
654
+ const result = await params.sock.sendMessage(jid, payload);
655
+ recordChannelActivity({
656
+ channel: "whatsapp",
657
+ accountId: sendOptions?.accountId ?? params.defaultAccountId,
658
+ direction: "outbound"
659
+ });
660
+ return { messageId: typeof result === "object" && result && "key" in result ? String(result.key?.id ?? "unknown") : "unknown" };
661
+ },
662
+ sendPoll: async (to, poll) => {
663
+ const jid = toWhatsappJid(to);
664
+ const result = await params.sock.sendMessage(jid, { poll: {
665
+ name: poll.question,
666
+ values: poll.options,
667
+ selectableCount: poll.maxSelections ?? 1
668
+ } });
669
+ recordChannelActivity({
670
+ channel: "whatsapp",
671
+ accountId: params.defaultAccountId,
672
+ direction: "outbound"
673
+ });
674
+ return { messageId: typeof result === "object" && result && "key" in result ? String(result.key?.id ?? "unknown") : "unknown" };
675
+ },
676
+ sendReaction: async (chatJid, messageId, emoji, fromMe, participant) => {
677
+ const jid = toWhatsappJid(chatJid);
678
+ await params.sock.sendMessage(jid, { react: {
679
+ text: emoji,
680
+ key: {
681
+ remoteJid: jid,
682
+ id: messageId,
683
+ fromMe,
684
+ participant: participant ? toWhatsappJid(participant) : void 0
685
+ }
686
+ } });
687
+ },
688
+ sendComposingTo: async (to) => {
689
+ const jid = toWhatsappJid(to);
690
+ await params.sock.sendPresenceUpdate("composing", jid);
691
+ }
692
+ };
693
+ }
694
+
695
+ //#endregion
696
+ //#region src/web/inbound/monitor.ts
697
+ async function monitorWebInbox(options) {
698
+ const inboundLogger = getChildLogger({ module: "web-inbound" });
699
+ const inboundConsoleLog = createSubsystemLogger("gateway/channels/whatsapp").child("inbound");
700
+ const sock = await createWaSocket(false, options.verbose, { authDir: options.authDir });
701
+ await waitForWaConnection(sock);
702
+ const connectedAtMs = Date.now();
703
+ let onCloseResolve = null;
704
+ const onClose = new Promise((resolve) => {
705
+ onCloseResolve = resolve;
706
+ });
707
+ const resolveClose = (reason) => {
708
+ if (!onCloseResolve) return;
709
+ const resolver = onCloseResolve;
710
+ onCloseResolve = null;
711
+ resolver(reason);
712
+ };
713
+ try {
714
+ await sock.sendPresenceUpdate("available");
715
+ if (shouldLogVerbose()) logVerbose("Sent global 'available' presence on connect");
716
+ } catch (err) {
717
+ logVerbose(`Failed to send 'available' presence on connect: ${String(err)}`);
718
+ }
719
+ const selfJid = sock.user?.id;
720
+ const selfE164 = selfJid ? jidToE164(selfJid) : null;
721
+ const debouncer = createInboundDebouncer({
722
+ debounceMs: options.debounceMs ?? 0,
723
+ buildKey: (msg) => {
724
+ const senderKey = msg.chatType === "group" ? msg.senderJid ?? msg.senderE164 ?? msg.senderName ?? msg.from : msg.from;
725
+ if (!senderKey) return null;
726
+ const conversationKey = msg.chatType === "group" ? msg.chatId : msg.from;
727
+ return `${msg.accountId}:${conversationKey}:${senderKey}`;
728
+ },
729
+ shouldDebounce: options.shouldDebounce,
730
+ onFlush: async (entries) => {
731
+ const last = entries.at(-1);
732
+ if (!last) return;
733
+ if (entries.length === 1) {
734
+ await options.onMessage(last);
735
+ return;
736
+ }
737
+ const mentioned = /* @__PURE__ */ new Set();
738
+ for (const entry of entries) for (const jid of entry.mentionedJids ?? []) mentioned.add(jid);
739
+ const combinedBody = entries.map((entry) => entry.body).filter(Boolean).join("\n");
740
+ const combinedMessage = {
741
+ ...last,
742
+ body: combinedBody,
743
+ mentionedJids: mentioned.size > 0 ? Array.from(mentioned) : void 0
744
+ };
745
+ await options.onMessage(combinedMessage);
746
+ },
747
+ onError: (err) => {
748
+ inboundLogger.error({ error: String(err) }, "failed handling inbound web message");
749
+ inboundConsoleLog.error(`Failed handling inbound web message: ${String(err)}`);
750
+ }
751
+ });
752
+ const groupMetaCache = /* @__PURE__ */ new Map();
753
+ const GROUP_META_TTL_MS = 300 * 1e3;
754
+ const lidLookup = sock.signalRepository?.lidMapping;
755
+ const resolveInboundJid = async (jid) => resolveJidToE164(jid, {
756
+ authDir: options.authDir,
757
+ lidLookup
758
+ });
759
+ const getGroupMeta = async (jid) => {
760
+ const cached = groupMetaCache.get(jid);
761
+ if (cached && cached.expires > Date.now()) return cached;
762
+ try {
763
+ const meta = await sock.groupMetadata(jid);
764
+ const participants = (await Promise.all(meta.participants?.map(async (p) => {
765
+ return await resolveInboundJid(p.id) ?? p.id;
766
+ }) ?? [])).filter(Boolean) ?? [];
767
+ const entry = {
768
+ subject: meta.subject,
769
+ participants,
770
+ expires: Date.now() + GROUP_META_TTL_MS
771
+ };
772
+ groupMetaCache.set(jid, entry);
773
+ return entry;
774
+ } catch (err) {
775
+ logVerbose(`Failed to fetch group metadata for ${jid}: ${String(err)}`);
776
+ return { expires: Date.now() + GROUP_META_TTL_MS };
777
+ }
778
+ };
779
+ const handleMessagesUpsert = async (upsert) => {
780
+ if (upsert.type !== "notify" && upsert.type !== "append") return;
781
+ for (const msg of upsert.messages ?? []) {
782
+ recordChannelActivity({
783
+ channel: "whatsapp",
784
+ accountId: options.accountId,
785
+ direction: "inbound"
786
+ });
787
+ const id = msg.key?.id ?? void 0;
788
+ const remoteJid = msg.key?.remoteJid;
789
+ if (!remoteJid) continue;
790
+ if (remoteJid.endsWith("@status") || remoteJid.endsWith("@broadcast")) continue;
791
+ const group = isJidGroup(remoteJid) === true;
792
+ if (id) {
793
+ if (isRecentInboundMessage(`${options.accountId}:${remoteJid}:${id}`)) continue;
794
+ }
795
+ const participantJid = msg.key?.participant ?? void 0;
796
+ const from = group ? remoteJid : await resolveInboundJid(remoteJid);
797
+ if (!from) continue;
798
+ const senderE164 = group ? participantJid ? await resolveInboundJid(participantJid) : null : from;
799
+ let groupSubject;
800
+ let groupParticipants;
801
+ if (group) {
802
+ const meta = await getGroupMeta(remoteJid);
803
+ groupSubject = meta.subject;
804
+ groupParticipants = meta.participants;
805
+ }
806
+ const messageTimestampMs = msg.messageTimestamp ? Number(msg.messageTimestamp) * 1e3 : void 0;
807
+ const access = await checkInboundAccessControl({
808
+ accountId: options.accountId,
809
+ from,
810
+ selfE164,
811
+ senderE164,
812
+ group,
813
+ pushName: msg.pushName ?? void 0,
814
+ isFromMe: Boolean(msg.key?.fromMe),
815
+ messageTimestampMs,
816
+ connectedAtMs,
817
+ sock: { sendMessage: (jid, content) => sock.sendMessage(jid, content) },
818
+ remoteJid
819
+ });
820
+ if (!access.allowed) continue;
821
+ if (id && !access.isSelfChat && options.sendReadReceipts !== false) {
822
+ const participant = msg.key?.participant;
823
+ try {
824
+ await sock.readMessages([{
825
+ remoteJid,
826
+ id,
827
+ participant,
828
+ fromMe: false
829
+ }]);
830
+ if (shouldLogVerbose()) logVerbose(`Marked message ${id} as read for ${remoteJid}${participant ? ` (participant ${participant})` : ""}`);
831
+ } catch (err) {
832
+ logVerbose(`Failed to mark message ${id} read: ${String(err)}`);
833
+ }
834
+ } else if (id && access.isSelfChat && shouldLogVerbose()) logVerbose(`Self-chat mode: skipping read receipt for ${id}`);
835
+ if (upsert.type === "append") continue;
836
+ const location = extractLocationData(msg.message ?? void 0);
837
+ const locationText = location ? formatLocationText(location) : void 0;
838
+ let body = extractText(msg.message ?? void 0);
839
+ if (locationText) body = [body, locationText].filter(Boolean).join("\n").trim();
840
+ if (!body) {
841
+ body = extractMediaPlaceholder(msg.message ?? void 0);
842
+ if (!body) continue;
843
+ }
844
+ const replyContext = describeReplyContext(msg.message);
845
+ let mediaPath;
846
+ let mediaType;
847
+ let mediaFileName;
848
+ try {
849
+ const inboundMedia = await downloadInboundMedia(msg, sock);
850
+ if (inboundMedia) {
851
+ const maxBytes = (typeof options.mediaMaxMb === "number" && options.mediaMaxMb > 0 ? options.mediaMaxMb : 50) * 1024 * 1024;
852
+ mediaPath = (await saveMediaBuffer(inboundMedia.buffer, inboundMedia.mimetype, "inbound", maxBytes, inboundMedia.fileName)).path;
853
+ mediaType = inboundMedia.mimetype;
854
+ mediaFileName = inboundMedia.fileName;
855
+ }
856
+ } catch (err) {
857
+ logVerbose(`Inbound media download failed: ${String(err)}`);
858
+ }
859
+ const chatJid = remoteJid;
860
+ const sendComposing = async () => {
861
+ try {
862
+ await sock.sendPresenceUpdate("composing", chatJid);
863
+ } catch (err) {
864
+ logVerbose(`Presence update failed: ${String(err)}`);
865
+ }
866
+ };
867
+ const reply = async (text) => {
868
+ await sock.sendMessage(chatJid, { text });
869
+ };
870
+ const sendMedia = async (payload) => {
871
+ await sock.sendMessage(chatJid, payload);
872
+ };
873
+ const timestamp = messageTimestampMs;
874
+ const mentionedJids = extractMentionedJids(msg.message);
875
+ const senderName = msg.pushName ?? void 0;
876
+ inboundLogger.info({
877
+ from,
878
+ to: selfE164 ?? "me",
879
+ body,
880
+ mediaPath,
881
+ mediaType,
882
+ mediaFileName,
883
+ timestamp
884
+ }, "inbound message");
885
+ const inboundMessage = {
886
+ id,
887
+ from,
888
+ conversationId: from,
889
+ to: selfE164 ?? "me",
890
+ accountId: access.resolvedAccountId,
891
+ body,
892
+ pushName: senderName,
893
+ timestamp,
894
+ chatType: group ? "group" : "direct",
895
+ chatId: remoteJid,
896
+ senderJid: participantJid,
897
+ senderE164: senderE164 ?? void 0,
898
+ senderName,
899
+ replyToId: replyContext?.id,
900
+ replyToBody: replyContext?.body,
901
+ replyToSender: replyContext?.sender,
902
+ replyToSenderJid: replyContext?.senderJid,
903
+ replyToSenderE164: replyContext?.senderE164,
904
+ groupSubject,
905
+ groupParticipants,
906
+ mentionedJids: mentionedJids ?? void 0,
907
+ selfJid,
908
+ selfE164,
909
+ location: location ?? void 0,
910
+ sendComposing,
911
+ reply,
912
+ sendMedia,
913
+ mediaPath,
914
+ mediaType,
915
+ mediaFileName
916
+ };
917
+ try {
918
+ Promise.resolve(debouncer.enqueue(inboundMessage)).catch((err) => {
919
+ inboundLogger.error({ error: String(err) }, "failed handling inbound web message");
920
+ inboundConsoleLog.error(`Failed handling inbound web message: ${String(err)}`);
921
+ });
922
+ } catch (err) {
923
+ inboundLogger.error({ error: String(err) }, "failed handling inbound web message");
924
+ inboundConsoleLog.error(`Failed handling inbound web message: ${String(err)}`);
925
+ }
926
+ }
927
+ };
928
+ sock.ev.on("messages.upsert", handleMessagesUpsert);
929
+ const handleConnectionUpdate = (update) => {
930
+ try {
931
+ if (update.connection === "close") {
932
+ const status = getStatusCode(update.lastDisconnect?.error);
933
+ resolveClose({
934
+ status,
935
+ isLoggedOut: status === DisconnectReason.loggedOut,
936
+ error: update.lastDisconnect?.error
937
+ });
938
+ }
939
+ } catch (err) {
940
+ inboundLogger.error({ error: String(err) }, "connection.update handler error");
941
+ resolveClose({
942
+ status: void 0,
943
+ isLoggedOut: false,
944
+ error: err
945
+ });
946
+ }
947
+ };
948
+ sock.ev.on("connection.update", handleConnectionUpdate);
949
+ return {
950
+ close: async () => {
951
+ try {
952
+ const ev = sock.ev;
953
+ const messagesUpsertHandler = handleMessagesUpsert;
954
+ const connectionUpdateHandler = handleConnectionUpdate;
955
+ if (typeof ev.off === "function") {
956
+ ev.off("messages.upsert", messagesUpsertHandler);
957
+ ev.off("connection.update", connectionUpdateHandler);
958
+ } else if (typeof ev.removeListener === "function") {
959
+ ev.removeListener("messages.upsert", messagesUpsertHandler);
960
+ ev.removeListener("connection.update", connectionUpdateHandler);
961
+ }
962
+ sock.ws?.close();
963
+ } catch (err) {
964
+ logVerbose(`Socket close failed: ${String(err)}`);
965
+ }
966
+ },
967
+ onClose,
968
+ signalClose: (reason) => {
969
+ resolveClose(reason ?? {
970
+ status: void 0,
971
+ isLoggedOut: false,
972
+ error: "closed"
973
+ });
974
+ },
975
+ ...createWebSendApi({
976
+ sock: {
977
+ sendMessage: (jid, content) => sock.sendMessage(jid, content),
978
+ sendPresenceUpdate: (presence, jid) => sock.sendPresenceUpdate(presence, jid)
979
+ },
980
+ defaultAccountId: options.accountId
981
+ })
982
+ };
983
+ }
984
+
985
+ //#endregion
986
+ //#region src/web/auto-reply/mentions.ts
987
+ function buildMentionConfig(cfg, agentId) {
988
+ return {
989
+ mentionRegexes: buildMentionRegexes(cfg, agentId),
990
+ allowFrom: cfg.channels?.whatsapp?.allowFrom
991
+ };
992
+ }
993
+ function resolveMentionTargets(msg, authDir) {
994
+ const jidOptions = authDir ? { authDir } : void 0;
995
+ return {
996
+ normalizedMentions: msg.mentionedJids?.length ? msg.mentionedJids.map((jid) => jidToE164(jid, jidOptions) ?? jid).filter(Boolean) : [],
997
+ selfE164: msg.selfE164 ?? (msg.selfJid ? jidToE164(msg.selfJid, jidOptions) : null),
998
+ selfJid: msg.selfJid ? msg.selfJid.replace(/:\\d+/, "") : null
999
+ };
1000
+ }
1001
+ function isBotMentionedFromTargets(msg, mentionCfg, targets) {
1002
+ const clean = (text) => normalizeMentionText(text);
1003
+ const isSelfChat = isSelfChatMode(targets.selfE164, mentionCfg.allowFrom);
1004
+ const hasMentions = (msg.mentionedJids?.length ?? 0) > 0;
1005
+ if (hasMentions && !isSelfChat) {
1006
+ if (targets.selfE164 && targets.normalizedMentions.includes(targets.selfE164)) return true;
1007
+ if (targets.selfJid) {
1008
+ if (targets.normalizedMentions.includes(targets.selfJid)) return true;
1009
+ }
1010
+ return false;
1011
+ } else if (hasMentions && isSelfChat) {}
1012
+ const bodyClean = clean(msg.body);
1013
+ if (mentionCfg.mentionRegexes.some((re) => re.test(bodyClean))) return true;
1014
+ if (targets.selfE164) {
1015
+ const selfDigits = targets.selfE164.replace(/\D/g, "");
1016
+ if (selfDigits) {
1017
+ if (bodyClean.replace(/[^\d]/g, "").includes(selfDigits)) return true;
1018
+ const bodyNoSpace = msg.body.replace(/[\s-]/g, "");
1019
+ if (new RegExp(`\\+?${selfDigits}`, "i").test(bodyNoSpace)) return true;
1020
+ }
1021
+ }
1022
+ return false;
1023
+ }
1024
+ function debugMention(msg, mentionCfg, authDir) {
1025
+ const mentionTargets = resolveMentionTargets(msg, authDir);
1026
+ return {
1027
+ wasMentioned: isBotMentionedFromTargets(msg, mentionCfg, mentionTargets),
1028
+ details: {
1029
+ from: msg.from,
1030
+ body: msg.body,
1031
+ bodyClean: normalizeMentionText(msg.body),
1032
+ mentionedJids: msg.mentionedJids ?? null,
1033
+ normalizedMentionedJids: mentionTargets.normalizedMentions.length ? mentionTargets.normalizedMentions : null,
1034
+ selfJid: msg.selfJid ?? null,
1035
+ selfJidBare: mentionTargets.selfJid,
1036
+ selfE164: msg.selfE164 ?? null,
1037
+ resolvedSelfE164: mentionTargets.selfE164
1038
+ }
1039
+ };
1040
+ }
1041
+ function resolveOwnerList(mentionCfg, selfE164) {
1042
+ const allowFrom = mentionCfg.allowFrom;
1043
+ return (Array.isArray(allowFrom) && allowFrom.length > 0 ? allowFrom : selfE164 ? [selfE164] : []).filter((entry) => Boolean(entry && entry !== "*")).map((entry) => normalizeE164(entry)).filter((entry) => Boolean(entry));
1044
+ }
1045
+
1046
+ //#endregion
1047
+ //#region src/web/auto-reply/monitor/echo.ts
1048
+ function createEchoTracker(params) {
1049
+ const recentlySent = /* @__PURE__ */ new Set();
1050
+ const maxItems = Math.max(1, params.maxItems ?? 100);
1051
+ const buildCombinedKey = (p) => `combined:${p.sessionKey}:${p.combinedBody}`;
1052
+ const trim = () => {
1053
+ while (recentlySent.size > maxItems) {
1054
+ const firstKey = recentlySent.values().next().value;
1055
+ if (!firstKey) break;
1056
+ recentlySent.delete(firstKey);
1057
+ }
1058
+ };
1059
+ const rememberText = (text, opts) => {
1060
+ if (!text) return;
1061
+ recentlySent.add(text);
1062
+ if (opts.combinedBody && opts.combinedBodySessionKey) recentlySent.add(buildCombinedKey({
1063
+ sessionKey: opts.combinedBodySessionKey,
1064
+ combinedBody: opts.combinedBody
1065
+ }));
1066
+ if (opts.logVerboseMessage) params.logVerbose?.(`Added to echo detection set (size now: ${recentlySent.size}): ${text.substring(0, 50)}...`);
1067
+ trim();
1068
+ };
1069
+ return {
1070
+ rememberText,
1071
+ has: (key) => recentlySent.has(key),
1072
+ forget: (key) => {
1073
+ recentlySent.delete(key);
1074
+ },
1075
+ buildCombinedKey
1076
+ };
1077
+ }
1078
+
1079
+ //#endregion
1080
+ //#region src/web/auto-reply/monitor/broadcast.ts
1081
+ async function maybeBroadcastMessage(params) {
1082
+ const broadcastAgents = params.cfg.broadcast?.[params.peerId];
1083
+ if (!broadcastAgents || !Array.isArray(broadcastAgents)) return false;
1084
+ if (broadcastAgents.length === 0) return false;
1085
+ const strategy = params.cfg.broadcast?.strategy || "parallel";
1086
+ whatsappInboundLog.info(`Broadcasting message to ${broadcastAgents.length} agents (${strategy})`);
1087
+ const agentIds = params.cfg.agents?.list?.map((agent) => normalizeAgentId(agent.id));
1088
+ const hasKnownAgents = (agentIds?.length ?? 0) > 0;
1089
+ const groupHistorySnapshot = params.msg.chatType === "group" ? params.groupHistories.get(params.groupHistoryKey) ?? [] : void 0;
1090
+ const processForAgent = async (agentId) => {
1091
+ const normalizedAgentId = normalizeAgentId(agentId);
1092
+ if (hasKnownAgents && !agentIds?.includes(normalizedAgentId)) {
1093
+ whatsappInboundLog.warn(`Broadcast agent ${agentId} not found in agents.list; skipping`);
1094
+ return false;
1095
+ }
1096
+ const agentRoute = {
1097
+ ...params.route,
1098
+ agentId: normalizedAgentId,
1099
+ sessionKey: buildAgentSessionKey({
1100
+ agentId: normalizedAgentId,
1101
+ channel: "whatsapp",
1102
+ accountId: params.route.accountId,
1103
+ peer: {
1104
+ kind: params.msg.chatType === "group" ? "group" : "direct",
1105
+ id: params.peerId
1106
+ },
1107
+ dmScope: params.cfg.session?.dmScope,
1108
+ identityLinks: params.cfg.session?.identityLinks
1109
+ }),
1110
+ mainSessionKey: buildAgentMainSessionKey({
1111
+ agentId: normalizedAgentId,
1112
+ mainKey: DEFAULT_MAIN_KEY
1113
+ })
1114
+ };
1115
+ try {
1116
+ return await params.processMessage(params.msg, agentRoute, params.groupHistoryKey, {
1117
+ groupHistory: groupHistorySnapshot,
1118
+ suppressGroupHistoryClear: true
1119
+ });
1120
+ } catch (err) {
1121
+ whatsappInboundLog.error(`Broadcast agent ${agentId} failed: ${formatError(err)}`);
1122
+ return false;
1123
+ }
1124
+ };
1125
+ if (strategy === "sequential") for (const agentId of broadcastAgents) await processForAgent(agentId);
1126
+ else await Promise.allSettled(broadcastAgents.map(processForAgent));
1127
+ if (params.msg.chatType === "group") params.groupHistories.set(params.groupHistoryKey, []);
1128
+ return true;
1129
+ }
1130
+
1131
+ //#endregion
1132
+ //#region src/channels/mention-gating.ts
1133
+ function resolveMentionGating(params) {
1134
+ const implicit = params.implicitMention === true;
1135
+ const bypass = params.shouldBypassMention === true;
1136
+ const effectiveWasMentioned = params.wasMentioned || implicit || bypass;
1137
+ return {
1138
+ effectiveWasMentioned,
1139
+ shouldSkip: params.requireMention && params.canDetectMention && !effectiveWasMentioned
1140
+ };
1141
+ }
1142
+
1143
+ //#endregion
1144
+ //#region src/web/auto-reply/monitor/commands.ts
1145
+ function stripMentionsForCommand(text, mentionRegexes, selfE164) {
1146
+ let result = text;
1147
+ for (const re of mentionRegexes) result = result.replace(re, " ");
1148
+ if (selfE164) {
1149
+ const digits = selfE164.replace(/\D/g, "");
1150
+ if (digits) {
1151
+ const pattern = new RegExp(`\\+?${digits}`, "g");
1152
+ result = result.replace(pattern, " ");
1153
+ }
1154
+ }
1155
+ return result.replace(/\s+/g, " ").trim();
1156
+ }
1157
+
1158
+ //#endregion
1159
+ //#region src/web/auto-reply/monitor/group-activation.ts
1160
+ function resolveGroupPolicyFor(cfg, conversationId) {
1161
+ const groupId = resolveGroupSessionKey({
1162
+ From: conversationId,
1163
+ ChatType: "group",
1164
+ Provider: "whatsapp"
1165
+ })?.id;
1166
+ return resolveChannelGroupPolicy({
1167
+ cfg,
1168
+ channel: "whatsapp",
1169
+ groupId: groupId ?? conversationId
1170
+ });
1171
+ }
1172
+ function resolveGroupRequireMentionFor(cfg, conversationId) {
1173
+ const groupId = resolveGroupSessionKey({
1174
+ From: conversationId,
1175
+ ChatType: "group",
1176
+ Provider: "whatsapp"
1177
+ })?.id;
1178
+ return resolveChannelGroupRequireMention({
1179
+ cfg,
1180
+ channel: "whatsapp",
1181
+ groupId: groupId ?? conversationId
1182
+ });
1183
+ }
1184
+ function resolveGroupActivationFor(params) {
1185
+ const entry = loadSessionStore(resolveStorePath(params.cfg.session?.store, { agentId: params.agentId }))[params.sessionKey];
1186
+ const defaultActivation = !resolveGroupRequireMentionFor(params.cfg, params.conversationId) ? "always" : "mention";
1187
+ return normalizeGroupActivation(entry?.groupActivation) ?? defaultActivation;
1188
+ }
1189
+
1190
+ //#endregion
1191
+ //#region src/web/auto-reply/monitor/group-members.ts
1192
+ function noteGroupMember(groupMemberNames, conversationId, e164, name) {
1193
+ if (!e164 || !name) return;
1194
+ const key = normalizeE164(e164) ?? e164;
1195
+ if (!key) return;
1196
+ let roster = groupMemberNames.get(conversationId);
1197
+ if (!roster) {
1198
+ roster = /* @__PURE__ */ new Map();
1199
+ groupMemberNames.set(conversationId, roster);
1200
+ }
1201
+ roster.set(key, name);
1202
+ }
1203
+ function formatGroupMembers(params) {
1204
+ const { participants, roster, fallbackE164 } = params;
1205
+ const seen = /* @__PURE__ */ new Set();
1206
+ const ordered = [];
1207
+ if (participants?.length) for (const entry of participants) {
1208
+ if (!entry) continue;
1209
+ const normalized = normalizeE164(entry) ?? entry;
1210
+ if (!normalized || seen.has(normalized)) continue;
1211
+ seen.add(normalized);
1212
+ ordered.push(normalized);
1213
+ }
1214
+ if (roster) for (const entry of roster.keys()) {
1215
+ const normalized = normalizeE164(entry) ?? entry;
1216
+ if (!normalized || seen.has(normalized)) continue;
1217
+ seen.add(normalized);
1218
+ ordered.push(normalized);
1219
+ }
1220
+ if (ordered.length === 0 && fallbackE164) {
1221
+ const normalized = normalizeE164(fallbackE164) ?? fallbackE164;
1222
+ if (normalized) ordered.push(normalized);
1223
+ }
1224
+ if (ordered.length === 0) return;
1225
+ return ordered.map((entry) => {
1226
+ const name = roster?.get(entry);
1227
+ return name ? `${name} (${entry})` : entry;
1228
+ }).join(", ");
1229
+ }
1230
+
1231
+ //#endregion
1232
+ //#region src/web/auto-reply/monitor/group-gating.ts
1233
+ function isOwnerSender(baseMentionConfig, msg) {
1234
+ const sender = normalizeE164(msg.senderE164 ?? "");
1235
+ if (!sender) return false;
1236
+ return resolveOwnerList(baseMentionConfig, msg.selfE164 ?? void 0).includes(sender);
1237
+ }
1238
+ function recordPendingGroupHistoryEntry(params) {
1239
+ const sender = params.msg.senderName && params.msg.senderE164 ? `${params.msg.senderName} (${params.msg.senderE164})` : params.msg.senderName ?? params.msg.senderE164 ?? "Unknown";
1240
+ recordPendingHistoryEntryIfEnabled({
1241
+ historyMap: params.groupHistories,
1242
+ historyKey: params.groupHistoryKey,
1243
+ limit: params.groupHistoryLimit,
1244
+ entry: {
1245
+ sender,
1246
+ body: params.msg.body,
1247
+ timestamp: params.msg.timestamp,
1248
+ id: params.msg.id,
1249
+ senderJid: params.msg.senderJid
1250
+ }
1251
+ });
1252
+ }
1253
+ function applyGroupGating(params) {
1254
+ const groupPolicy = resolveGroupPolicyFor(params.cfg, params.conversationId);
1255
+ if (groupPolicy.allowlistEnabled && !groupPolicy.allowed) {
1256
+ params.logVerbose(`Skipping group message ${params.conversationId} (not in allowlist)`);
1257
+ return { shouldProcess: false };
1258
+ }
1259
+ noteGroupMember(params.groupMemberNames, params.groupHistoryKey, params.msg.senderE164, params.msg.senderName);
1260
+ const mentionConfig = buildMentionConfig(params.cfg, params.agentId);
1261
+ const commandBody = stripMentionsForCommand(params.msg.body, mentionConfig.mentionRegexes, params.msg.selfE164);
1262
+ const activationCommand = parseActivationCommand(commandBody);
1263
+ const owner = isOwnerSender(params.baseMentionConfig, params.msg);
1264
+ const shouldBypassMention = owner && hasControlCommand(commandBody, params.cfg);
1265
+ if (activationCommand.hasCommand && !owner) {
1266
+ params.logVerbose(`Ignoring /activation from non-owner in group ${params.conversationId}`);
1267
+ recordPendingGroupHistoryEntry({
1268
+ msg: params.msg,
1269
+ groupHistories: params.groupHistories,
1270
+ groupHistoryKey: params.groupHistoryKey,
1271
+ groupHistoryLimit: params.groupHistoryLimit
1272
+ });
1273
+ return { shouldProcess: false };
1274
+ }
1275
+ const mentionDebug = debugMention(params.msg, mentionConfig, params.authDir);
1276
+ params.replyLogger.debug({
1277
+ conversationId: params.conversationId,
1278
+ wasMentioned: mentionDebug.wasMentioned,
1279
+ ...mentionDebug.details
1280
+ }, "group mention debug");
1281
+ const wasMentioned = mentionDebug.wasMentioned;
1282
+ const requireMention = resolveGroupActivationFor({
1283
+ cfg: params.cfg,
1284
+ agentId: params.agentId,
1285
+ sessionKey: params.sessionKey,
1286
+ conversationId: params.conversationId
1287
+ }) !== "always";
1288
+ const selfJid = params.msg.selfJid?.replace(/:\\d+/, "");
1289
+ const replySenderJid = params.msg.replyToSenderJid?.replace(/:\\d+/, "");
1290
+ const selfE164 = params.msg.selfE164 ? normalizeE164(params.msg.selfE164) : null;
1291
+ const replySenderE164 = params.msg.replyToSenderE164 ? normalizeE164(params.msg.replyToSenderE164) : null;
1292
+ const mentionGate = resolveMentionGating({
1293
+ requireMention,
1294
+ canDetectMention: true,
1295
+ wasMentioned,
1296
+ implicitMention: Boolean(selfJid && replySenderJid && selfJid === replySenderJid || selfE164 && replySenderE164 && selfE164 === replySenderE164),
1297
+ shouldBypassMention
1298
+ });
1299
+ params.msg.wasMentioned = mentionGate.effectiveWasMentioned;
1300
+ if (!shouldBypassMention && requireMention && mentionGate.shouldSkip) {
1301
+ params.logVerbose(`Group message stored for context (no mention detected) in ${params.conversationId}: ${params.msg.body}`);
1302
+ recordPendingGroupHistoryEntry({
1303
+ msg: params.msg,
1304
+ groupHistories: params.groupHistories,
1305
+ groupHistoryKey: params.groupHistoryKey,
1306
+ groupHistoryLimit: params.groupHistoryLimit
1307
+ });
1308
+ return { shouldProcess: false };
1309
+ }
1310
+ return { shouldProcess: true };
1311
+ }
1312
+
1313
+ //#endregion
1314
+ //#region src/web/auto-reply/monitor/last-route.ts
1315
+ function trackBackgroundTask(backgroundTasks, task) {
1316
+ backgroundTasks.add(task);
1317
+ task.finally(() => {
1318
+ backgroundTasks.delete(task);
1319
+ });
1320
+ }
1321
+ function updateLastRouteInBackground(params) {
1322
+ const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.storeAgentId });
1323
+ const task = updateLastRoute({
1324
+ storePath,
1325
+ sessionKey: params.sessionKey,
1326
+ deliveryContext: {
1327
+ channel: params.channel,
1328
+ to: params.to,
1329
+ accountId: params.accountId
1330
+ },
1331
+ ctx: params.ctx
1332
+ }).catch((err) => {
1333
+ params.warn({
1334
+ error: formatError(err),
1335
+ storePath,
1336
+ sessionKey: params.sessionKey,
1337
+ to: params.to
1338
+ }, "failed updating last route");
1339
+ });
1340
+ trackBackgroundTask(params.backgroundTasks, task);
1341
+ }
1342
+
1343
+ //#endregion
1344
+ //#region src/web/auto-reply/monitor/peer.ts
1345
+ function resolvePeerId(msg) {
1346
+ if (msg.chatType === "group") return msg.conversationId ?? msg.from;
1347
+ if (msg.senderE164) return normalizeE164(msg.senderE164) ?? msg.senderE164;
1348
+ if (msg.from.includes("@")) return jidToE164(msg.from) ?? msg.from;
1349
+ return normalizeE164(msg.from) ?? msg.from;
1350
+ }
1351
+
1352
+ //#endregion
1353
+ //#region src/web/auto-reply/deliver-reply.ts
1354
+ async function deliverWebReply(params) {
1355
+ const { replyResult, msg, maxMediaBytes, textLimit, replyLogger, connectionId, skipLog } = params;
1356
+ const replyStarted = Date.now();
1357
+ const tableMode = params.tableMode ?? "code";
1358
+ const chunkMode = params.chunkMode ?? "length";
1359
+ const textChunks = chunkMarkdownTextWithMode(markdownToWhatsApp(convertMarkdownTables(replyResult.text || "", tableMode)), textLimit, chunkMode);
1360
+ const mediaList = replyResult.mediaUrls?.length ? replyResult.mediaUrls : replyResult.mediaUrl ? [replyResult.mediaUrl] : [];
1361
+ const sendWithRetry = async (fn, label, maxAttempts = 3) => {
1362
+ let lastErr;
1363
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) try {
1364
+ return await fn();
1365
+ } catch (err) {
1366
+ lastErr = err;
1367
+ const errText = formatError(err);
1368
+ const isLast = attempt === maxAttempts;
1369
+ if (!/closed|reset|timed\\s*out|disconnect/i.test(errText) || isLast) throw err;
1370
+ const backoffMs = 500 * attempt;
1371
+ logVerbose(`Retrying ${label} to ${msg.from} after failure (${attempt}/${maxAttempts - 1}) in ${backoffMs}ms: ${errText}`);
1372
+ await sleep(backoffMs);
1373
+ }
1374
+ throw lastErr;
1375
+ };
1376
+ if (mediaList.length === 0 && textChunks.length) {
1377
+ const totalChunks = textChunks.length;
1378
+ for (const [index, chunk] of textChunks.entries()) {
1379
+ const chunkStarted = Date.now();
1380
+ await sendWithRetry(() => msg.reply(chunk), "text");
1381
+ if (!skipLog) {
1382
+ const durationMs = Date.now() - chunkStarted;
1383
+ whatsappOutboundLog.debug(`Sent chunk ${index + 1}/${totalChunks} to ${msg.from} (${durationMs.toFixed(0)}ms)`);
1384
+ }
1385
+ }
1386
+ replyLogger.info({
1387
+ correlationId: msg.id ?? newConnectionId(),
1388
+ connectionId: connectionId ?? null,
1389
+ to: msg.from,
1390
+ from: msg.to,
1391
+ text: elide(replyResult.text, 240),
1392
+ mediaUrl: null,
1393
+ mediaSizeBytes: null,
1394
+ mediaKind: null,
1395
+ durationMs: Date.now() - replyStarted
1396
+ }, "auto-reply sent (text)");
1397
+ return;
1398
+ }
1399
+ const remainingText = [...textChunks];
1400
+ for (const [index, mediaUrl] of mediaList.entries()) {
1401
+ const caption = index === 0 ? remainingText.shift() || void 0 : void 0;
1402
+ try {
1403
+ const media = await loadWebMedia(mediaUrl, maxMediaBytes);
1404
+ if (shouldLogVerbose()) {
1405
+ logVerbose(`Web auto-reply media size: ${(media.buffer.length / (1024 * 1024)).toFixed(2)}MB`);
1406
+ logVerbose(`Web auto-reply media source: ${mediaUrl} (kind ${media.kind})`);
1407
+ }
1408
+ if (media.kind === "image") await sendWithRetry(() => msg.sendMedia({
1409
+ image: media.buffer,
1410
+ caption,
1411
+ mimetype: media.contentType
1412
+ }), "media:image");
1413
+ else if (media.kind === "audio") await sendWithRetry(() => msg.sendMedia({
1414
+ audio: media.buffer,
1415
+ ptt: true,
1416
+ mimetype: media.contentType,
1417
+ caption
1418
+ }), "media:audio");
1419
+ else if (media.kind === "video") await sendWithRetry(() => msg.sendMedia({
1420
+ video: media.buffer,
1421
+ caption,
1422
+ mimetype: media.contentType
1423
+ }), "media:video");
1424
+ else {
1425
+ const fileName = media.fileName ?? mediaUrl.split("/").pop() ?? "file";
1426
+ const mimetype = media.contentType ?? "application/octet-stream";
1427
+ await sendWithRetry(() => msg.sendMedia({
1428
+ document: media.buffer,
1429
+ fileName,
1430
+ caption,
1431
+ mimetype
1432
+ }), "media:document");
1433
+ }
1434
+ whatsappOutboundLog.info(`Sent media reply to ${msg.from} (${(media.buffer.length / (1024 * 1024)).toFixed(2)}MB)`);
1435
+ replyLogger.info({
1436
+ correlationId: msg.id ?? newConnectionId(),
1437
+ connectionId: connectionId ?? null,
1438
+ to: msg.from,
1439
+ from: msg.to,
1440
+ text: caption ?? null,
1441
+ mediaUrl,
1442
+ mediaSizeBytes: media.buffer.length,
1443
+ mediaKind: media.kind,
1444
+ durationMs: Date.now() - replyStarted
1445
+ }, "auto-reply sent (media)");
1446
+ } catch (err) {
1447
+ whatsappOutboundLog.error(`Failed sending web media to ${msg.from}: ${formatError(err)}`);
1448
+ replyLogger.warn({
1449
+ err,
1450
+ mediaUrl
1451
+ }, "failed to send web media reply");
1452
+ if (index === 0) {
1453
+ const warning = err instanceof Error ? `⚠️ Media failed: ${err.message}` : "⚠️ Media failed.";
1454
+ const fallbackText = [remainingText.shift() ?? caption ?? "", warning].filter(Boolean).join("\n");
1455
+ if (fallbackText) {
1456
+ whatsappOutboundLog.warn(`Media skipped; sent text-only to ${msg.from}`);
1457
+ await msg.reply(fallbackText);
1458
+ }
1459
+ }
1460
+ }
1461
+ }
1462
+ for (const chunk of remainingText) await msg.reply(chunk);
1463
+ }
1464
+
1465
+ //#endregion
1466
+ //#region src/web/auto-reply/monitor/ack-reaction.ts
1467
+ function maybeSendAckReaction(params) {
1468
+ if (!params.msg.id) return;
1469
+ const ackConfig = params.cfg.channels?.whatsapp?.ackReaction;
1470
+ const emoji = (ackConfig?.emoji ?? "").trim();
1471
+ const directEnabled = ackConfig?.direct ?? true;
1472
+ const groupMode = ackConfig?.group ?? "mentions";
1473
+ const conversationIdForCheck = params.msg.conversationId ?? params.msg.from;
1474
+ const activation = params.msg.chatType === "group" ? resolveGroupActivationFor({
1475
+ cfg: params.cfg,
1476
+ agentId: params.agentId,
1477
+ sessionKey: params.sessionKey,
1478
+ conversationId: conversationIdForCheck
1479
+ }) : null;
1480
+ const shouldSendReaction = () => shouldAckReactionForWhatsApp({
1481
+ emoji,
1482
+ isDirect: params.msg.chatType === "direct",
1483
+ isGroup: params.msg.chatType === "group",
1484
+ directEnabled,
1485
+ groupMode,
1486
+ wasMentioned: params.msg.wasMentioned === true,
1487
+ groupActivated: activation === "always"
1488
+ });
1489
+ if (!shouldSendReaction()) return;
1490
+ params.info({
1491
+ chatId: params.msg.chatId,
1492
+ messageId: params.msg.id,
1493
+ emoji
1494
+ }, "sending ack reaction");
1495
+ sendReactionWhatsApp(params.msg.chatId, params.msg.id, emoji, {
1496
+ verbose: params.verbose,
1497
+ fromMe: false,
1498
+ participant: params.msg.senderJid,
1499
+ accountId: params.accountId
1500
+ }).catch((err) => {
1501
+ params.warn({
1502
+ error: formatError(err),
1503
+ chatId: params.msg.chatId,
1504
+ messageId: params.msg.id
1505
+ }, "failed to send ack reaction");
1506
+ logVerbose(`WhatsApp ack reaction failed for chat ${params.msg.chatId}: ${formatError(err)}`);
1507
+ });
1508
+ }
1509
+
1510
+ //#endregion
1511
+ //#region src/web/auto-reply/monitor/message-line.ts
1512
+ function formatReplyContext(msg) {
1513
+ if (!msg.replyToBody) return null;
1514
+ return `[Replying to ${msg.replyToSender ?? "unknown sender"}${msg.replyToId ? ` id:${msg.replyToId}` : ""}]\n${msg.replyToBody}\n[/Replying]`;
1515
+ }
1516
+ function buildInboundLine(params) {
1517
+ const { cfg, msg, agentId, previousTimestamp, envelope } = params;
1518
+ const messagePrefix = resolveMessagePrefix(cfg, agentId, {
1519
+ configured: cfg.channels?.whatsapp?.messagePrefix,
1520
+ hasAllowFrom: (cfg.channels?.whatsapp?.allowFrom?.length ?? 0) > 0
1521
+ });
1522
+ const prefixStr = messagePrefix ? `${messagePrefix} ` : "";
1523
+ const replyContext = formatReplyContext(msg);
1524
+ const baseLine = `${prefixStr}${msg.body}${replyContext ? `\n\n${replyContext}` : ""}`;
1525
+ return formatInboundEnvelope({
1526
+ channel: "WhatsApp",
1527
+ from: msg.chatType === "group" ? msg.from : msg.from?.replace(/^whatsapp:/, ""),
1528
+ timestamp: msg.timestamp,
1529
+ body: baseLine,
1530
+ chatType: msg.chatType,
1531
+ sender: {
1532
+ name: msg.senderName,
1533
+ e164: msg.senderE164,
1534
+ id: msg.senderJid
1535
+ },
1536
+ previousTimestamp,
1537
+ envelope
1538
+ });
1539
+ }
1540
+
1541
+ //#endregion
1542
+ //#region src/web/auto-reply/monitor/process-message.ts
1543
+ function normalizeAllowFromE164(values) {
1544
+ return (Array.isArray(values) ? values : []).map((entry) => String(entry).trim()).filter((entry) => entry && entry !== "*").map((entry) => normalizeE164(entry)).filter((entry) => Boolean(entry));
1545
+ }
1546
+ async function resolveWhatsAppCommandAuthorized(params) {
1547
+ if (!(params.cfg.commands?.useAccessGroups !== false)) return true;
1548
+ const isGroup = params.msg.chatType === "group";
1549
+ const senderE164 = normalizeE164(isGroup ? params.msg.senderE164 ?? "" : params.msg.senderE164 ?? params.msg.from ?? "");
1550
+ if (!senderE164) return false;
1551
+ const configuredAllowFrom = params.cfg.channels?.whatsapp?.allowFrom ?? [];
1552
+ const configuredGroupAllowFrom = params.cfg.channels?.whatsapp?.groupAllowFrom ?? (configuredAllowFrom.length > 0 ? configuredAllowFrom : void 0);
1553
+ if (isGroup) {
1554
+ if (!configuredGroupAllowFrom || configuredGroupAllowFrom.length === 0) return false;
1555
+ if (configuredGroupAllowFrom.some((v) => String(v).trim() === "*")) return true;
1556
+ return normalizeAllowFromE164(configuredGroupAllowFrom).includes(senderE164);
1557
+ }
1558
+ const storeAllowFrom = await readChannelAllowFromStore("whatsapp").catch(() => []);
1559
+ const combinedAllowFrom = Array.from(new Set([...configuredAllowFrom ?? [], ...storeAllowFrom]));
1560
+ const allowFrom = combinedAllowFrom.length > 0 ? combinedAllowFrom : params.msg.selfE164 ? [params.msg.selfE164] : [];
1561
+ if (allowFrom.some((v) => String(v).trim() === "*")) return true;
1562
+ return normalizeAllowFromE164(allowFrom).includes(senderE164);
1563
+ }
1564
+ async function processMessage(params) {
1565
+ const conversationId = params.msg.conversationId ?? params.msg.from;
1566
+ const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.route.agentId });
1567
+ const envelopeOptions = resolveEnvelopeFormatOptions(params.cfg);
1568
+ const previousTimestamp = readSessionUpdatedAt({
1569
+ storePath,
1570
+ sessionKey: params.route.sessionKey
1571
+ });
1572
+ let combinedBody = buildInboundLine({
1573
+ cfg: params.cfg,
1574
+ msg: params.msg,
1575
+ agentId: params.route.agentId,
1576
+ previousTimestamp,
1577
+ envelope: envelopeOptions
1578
+ });
1579
+ let shouldClearGroupHistory = false;
1580
+ if (params.msg.chatType === "group") {
1581
+ const history = params.groupHistory ?? params.groupHistories.get(params.groupHistoryKey) ?? [];
1582
+ if (history.length > 0) combinedBody = buildHistoryContextFromEntries({
1583
+ entries: history.map((m) => ({
1584
+ sender: m.sender,
1585
+ body: m.body,
1586
+ timestamp: m.timestamp
1587
+ })),
1588
+ currentMessage: combinedBody,
1589
+ excludeLast: false,
1590
+ formatEntry: (entry) => {
1591
+ return formatInboundEnvelope({
1592
+ channel: "WhatsApp",
1593
+ from: conversationId,
1594
+ timestamp: entry.timestamp,
1595
+ body: entry.body,
1596
+ chatType: "group",
1597
+ senderLabel: entry.sender,
1598
+ envelope: envelopeOptions
1599
+ });
1600
+ }
1601
+ });
1602
+ shouldClearGroupHistory = !(params.suppressGroupHistoryClear ?? false);
1603
+ }
1604
+ const combinedEchoKey = params.buildCombinedEchoKey({
1605
+ sessionKey: params.route.sessionKey,
1606
+ combinedBody
1607
+ });
1608
+ if (params.echoHas(combinedEchoKey)) {
1609
+ logVerbose("Skipping auto-reply: detected echo for combined message");
1610
+ params.echoForget(combinedEchoKey);
1611
+ return false;
1612
+ }
1613
+ maybeSendAckReaction({
1614
+ cfg: params.cfg,
1615
+ msg: params.msg,
1616
+ agentId: params.route.agentId,
1617
+ sessionKey: params.route.sessionKey,
1618
+ conversationId,
1619
+ verbose: params.verbose,
1620
+ accountId: params.route.accountId,
1621
+ info: params.replyLogger.info.bind(params.replyLogger),
1622
+ warn: params.replyLogger.warn.bind(params.replyLogger)
1623
+ });
1624
+ const correlationId = params.msg.id ?? newConnectionId();
1625
+ params.replyLogger.info({
1626
+ connectionId: params.connectionId,
1627
+ correlationId,
1628
+ from: params.msg.chatType === "group" ? conversationId : params.msg.from,
1629
+ to: params.msg.to,
1630
+ body: elide(combinedBody, 240),
1631
+ mediaType: params.msg.mediaType ?? null,
1632
+ mediaPath: params.msg.mediaPath ?? null
1633
+ }, "inbound web message");
1634
+ const fromDisplay = params.msg.chatType === "group" ? conversationId : params.msg.from;
1635
+ const kindLabel = params.msg.mediaType ? `, ${params.msg.mediaType}` : "";
1636
+ whatsappInboundLog.info(`Inbound message ${fromDisplay} -> ${params.msg.to} (${params.msg.chatType}${kindLabel}, ${combinedBody.length} chars)`);
1637
+ if (shouldLogVerbose()) whatsappInboundLog.debug(`Inbound body: ${elide(combinedBody, 400)}`);
1638
+ const dmRouteTarget = params.msg.chatType !== "group" ? (() => {
1639
+ if (params.msg.senderE164) return normalizeE164(params.msg.senderE164);
1640
+ if (params.msg.from.includes("@")) return jidToE164(params.msg.from);
1641
+ return normalizeE164(params.msg.from);
1642
+ })() : void 0;
1643
+ const textLimit = params.maxMediaTextChunkLimit ?? resolveTextChunkLimit(params.cfg, "whatsapp");
1644
+ const chunkMode = resolveChunkMode(params.cfg, "whatsapp", params.route.accountId);
1645
+ const tableMode = resolveMarkdownTableMode({
1646
+ cfg: params.cfg,
1647
+ channel: "whatsapp",
1648
+ accountId: params.route.accountId
1649
+ });
1650
+ let didLogHeartbeatStrip = false;
1651
+ let didSendReply = false;
1652
+ const commandAuthorized = shouldComputeCommandAuthorized(params.msg.body, params.cfg) ? await resolveWhatsAppCommandAuthorized({
1653
+ cfg: params.cfg,
1654
+ msg: params.msg
1655
+ }) : void 0;
1656
+ const configuredResponsePrefix = params.cfg.messages?.responsePrefix;
1657
+ const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
1658
+ cfg: params.cfg,
1659
+ agentId: params.route.agentId,
1660
+ channel: "whatsapp",
1661
+ accountId: params.route.accountId
1662
+ });
1663
+ const isSelfChat = params.msg.chatType !== "group" && Boolean(params.msg.selfE164) && normalizeE164(params.msg.from) === normalizeE164(params.msg.selfE164 ?? "");
1664
+ const responsePrefix = prefixOptions.responsePrefix ?? (configuredResponsePrefix === void 0 && isSelfChat ? resolveIdentityNamePrefix(params.cfg, params.route.agentId) ?? "[anima]" : void 0);
1665
+ const inboundHistory = params.msg.chatType === "group" ? (params.groupHistory ?? params.groupHistories.get(params.groupHistoryKey) ?? []).map((entry) => ({
1666
+ sender: entry.sender,
1667
+ body: entry.body,
1668
+ timestamp: entry.timestamp
1669
+ })) : void 0;
1670
+ const ctxPayload = finalizeInboundContext({
1671
+ Body: combinedBody,
1672
+ BodyForAgent: params.msg.body,
1673
+ InboundHistory: inboundHistory,
1674
+ RawBody: params.msg.body,
1675
+ CommandBody: params.msg.body,
1676
+ From: params.msg.from,
1677
+ To: params.msg.to,
1678
+ SessionKey: params.route.sessionKey,
1679
+ AccountId: params.route.accountId,
1680
+ MessageSid: params.msg.id,
1681
+ ReplyToId: params.msg.replyToId,
1682
+ ReplyToBody: params.msg.replyToBody,
1683
+ ReplyToSender: params.msg.replyToSender,
1684
+ MediaPath: params.msg.mediaPath,
1685
+ MediaUrl: params.msg.mediaUrl,
1686
+ MediaType: params.msg.mediaType,
1687
+ ChatType: params.msg.chatType,
1688
+ ConversationLabel: params.msg.chatType === "group" ? conversationId : params.msg.from,
1689
+ GroupSubject: params.msg.groupSubject,
1690
+ GroupMembers: formatGroupMembers({
1691
+ participants: params.msg.groupParticipants,
1692
+ roster: params.groupMemberNames.get(params.groupHistoryKey),
1693
+ fallbackE164: params.msg.senderE164
1694
+ }),
1695
+ SenderName: params.msg.senderName,
1696
+ SenderId: params.msg.senderJid?.trim() || params.msg.senderE164,
1697
+ SenderE164: params.msg.senderE164,
1698
+ CommandAuthorized: commandAuthorized,
1699
+ WasMentioned: params.msg.wasMentioned,
1700
+ ...params.msg.location ? toLocationContext(params.msg.location) : {},
1701
+ Provider: "whatsapp",
1702
+ Surface: "whatsapp",
1703
+ OriginatingChannel: "whatsapp",
1704
+ OriginatingTo: params.msg.from
1705
+ });
1706
+ if (dmRouteTarget) updateLastRouteInBackground({
1707
+ cfg: params.cfg,
1708
+ backgroundTasks: params.backgroundTasks,
1709
+ storeAgentId: params.route.agentId,
1710
+ sessionKey: params.route.mainSessionKey,
1711
+ channel: "whatsapp",
1712
+ to: dmRouteTarget,
1713
+ accountId: params.route.accountId,
1714
+ ctx: ctxPayload,
1715
+ warn: params.replyLogger.warn.bind(params.replyLogger)
1716
+ });
1717
+ const metaTask = recordSessionMetaFromInbound({
1718
+ storePath,
1719
+ sessionKey: params.route.sessionKey,
1720
+ ctx: ctxPayload
1721
+ }).catch((err) => {
1722
+ params.replyLogger.warn({
1723
+ error: formatError(err),
1724
+ storePath,
1725
+ sessionKey: params.route.sessionKey
1726
+ }, "failed updating session meta");
1727
+ });
1728
+ trackBackgroundTask(params.backgroundTasks, metaTask);
1729
+ const { queuedFinal } = await dispatchReplyWithBufferedBlockDispatcher({
1730
+ ctx: ctxPayload,
1731
+ cfg: params.cfg,
1732
+ replyResolver: params.replyResolver,
1733
+ dispatcherOptions: {
1734
+ ...prefixOptions,
1735
+ responsePrefix,
1736
+ onHeartbeatStrip: () => {
1737
+ if (!didLogHeartbeatStrip) {
1738
+ didLogHeartbeatStrip = true;
1739
+ logVerbose("Stripped stray HEARTBEAT_OK token from web reply");
1740
+ }
1741
+ },
1742
+ deliver: async (payload, info) => {
1743
+ await deliverWebReply({
1744
+ replyResult: payload,
1745
+ msg: params.msg,
1746
+ maxMediaBytes: params.maxMediaBytes,
1747
+ textLimit,
1748
+ chunkMode,
1749
+ replyLogger: params.replyLogger,
1750
+ connectionId: params.connectionId,
1751
+ skipLog: info.kind !== "final",
1752
+ tableMode
1753
+ });
1754
+ didSendReply = true;
1755
+ if (info.kind === "tool") {
1756
+ params.rememberSentText(payload.text, {});
1757
+ return;
1758
+ }
1759
+ const shouldLog = info.kind === "final" && payload.text ? true : void 0;
1760
+ params.rememberSentText(payload.text, {
1761
+ combinedBody,
1762
+ combinedBodySessionKey: params.route.sessionKey,
1763
+ logVerboseMessage: shouldLog
1764
+ });
1765
+ if (info.kind === "final") {
1766
+ const fromDisplay = params.msg.chatType === "group" ? conversationId : params.msg.from ?? "unknown";
1767
+ const hasMedia = Boolean(payload.mediaUrl || payload.mediaUrls?.length);
1768
+ whatsappOutboundLog.info(`Auto-replied to ${fromDisplay}${hasMedia ? " (media)" : ""}`);
1769
+ if (shouldLogVerbose()) {
1770
+ const preview = payload.text != null ? elide(payload.text, 400) : "<media>";
1771
+ whatsappOutboundLog.debug(`Reply body: ${preview}${hasMedia ? " (media)" : ""}`);
1772
+ }
1773
+ }
1774
+ },
1775
+ onError: (err, info) => {
1776
+ const label = info.kind === "tool" ? "tool update" : info.kind === "block" ? "block update" : "auto-reply";
1777
+ whatsappOutboundLog.error(`Failed sending web ${label} to ${params.msg.from ?? conversationId}: ${formatError(err)}`);
1778
+ },
1779
+ onReplyStart: params.msg.sendComposing
1780
+ },
1781
+ replyOptions: {
1782
+ disableBlockStreaming: typeof params.cfg.channels?.whatsapp?.blockStreaming === "boolean" ? !params.cfg.channels.whatsapp.blockStreaming : void 0,
1783
+ onModelSelected
1784
+ }
1785
+ });
1786
+ if (!queuedFinal) {
1787
+ if (shouldClearGroupHistory) params.groupHistories.set(params.groupHistoryKey, []);
1788
+ logVerbose("Skipping auto-reply: silent token or no text/media returned from resolver");
1789
+ return false;
1790
+ }
1791
+ if (shouldClearGroupHistory) params.groupHistories.set(params.groupHistoryKey, []);
1792
+ return didSendReply;
1793
+ }
1794
+
1795
+ //#endregion
1796
+ //#region src/web/auto-reply/monitor/on-message.ts
1797
+ function createWebOnMessageHandler(params) {
1798
+ const processForRoute = async (msg, route, groupHistoryKey, opts) => processMessage({
1799
+ cfg: params.cfg,
1800
+ msg,
1801
+ route,
1802
+ groupHistoryKey,
1803
+ groupHistories: params.groupHistories,
1804
+ groupMemberNames: params.groupMemberNames,
1805
+ connectionId: params.connectionId,
1806
+ verbose: params.verbose,
1807
+ maxMediaBytes: params.maxMediaBytes,
1808
+ replyResolver: params.replyResolver,
1809
+ replyLogger: params.replyLogger,
1810
+ backgroundTasks: params.backgroundTasks,
1811
+ rememberSentText: params.echoTracker.rememberText,
1812
+ echoHas: params.echoTracker.has,
1813
+ echoForget: params.echoTracker.forget,
1814
+ buildCombinedEchoKey: params.echoTracker.buildCombinedKey,
1815
+ groupHistory: opts?.groupHistory,
1816
+ suppressGroupHistoryClear: opts?.suppressGroupHistoryClear
1817
+ });
1818
+ return async (msg) => {
1819
+ const conversationId = msg.conversationId ?? msg.from;
1820
+ const peerId = resolvePeerId(msg);
1821
+ const route = resolveAgentRoute({
1822
+ cfg: loadConfig(),
1823
+ channel: "whatsapp",
1824
+ accountId: msg.accountId,
1825
+ peer: {
1826
+ kind: msg.chatType === "group" ? "group" : "direct",
1827
+ id: peerId
1828
+ }
1829
+ });
1830
+ const groupHistoryKey = msg.chatType === "group" ? buildGroupHistoryKey({
1831
+ channel: "whatsapp",
1832
+ accountId: route.accountId,
1833
+ peerKind: "group",
1834
+ peerId
1835
+ }) : route.sessionKey;
1836
+ if (msg.from === msg.to) logVerbose(`📱 Same-phone mode detected (from === to: ${msg.from})`);
1837
+ if (params.echoTracker.has(msg.body)) {
1838
+ logVerbose("Skipping auto-reply: detected echo (message matches recently sent text)");
1839
+ params.echoTracker.forget(msg.body);
1840
+ return;
1841
+ }
1842
+ if (msg.chatType === "group") {
1843
+ const metaCtx = {
1844
+ From: msg.from,
1845
+ To: msg.to,
1846
+ SessionKey: route.sessionKey,
1847
+ AccountId: route.accountId,
1848
+ ChatType: msg.chatType,
1849
+ ConversationLabel: conversationId,
1850
+ GroupSubject: msg.groupSubject,
1851
+ SenderName: msg.senderName,
1852
+ SenderId: msg.senderJid?.trim() || msg.senderE164,
1853
+ SenderE164: msg.senderE164,
1854
+ Provider: "whatsapp",
1855
+ Surface: "whatsapp",
1856
+ OriginatingChannel: "whatsapp",
1857
+ OriginatingTo: conversationId
1858
+ };
1859
+ updateLastRouteInBackground({
1860
+ cfg: params.cfg,
1861
+ backgroundTasks: params.backgroundTasks,
1862
+ storeAgentId: route.agentId,
1863
+ sessionKey: route.sessionKey,
1864
+ channel: "whatsapp",
1865
+ to: conversationId,
1866
+ accountId: route.accountId,
1867
+ ctx: metaCtx,
1868
+ warn: params.replyLogger.warn.bind(params.replyLogger)
1869
+ });
1870
+ if (!applyGroupGating({
1871
+ cfg: params.cfg,
1872
+ msg,
1873
+ conversationId,
1874
+ groupHistoryKey,
1875
+ agentId: route.agentId,
1876
+ sessionKey: route.sessionKey,
1877
+ baseMentionConfig: params.baseMentionConfig,
1878
+ authDir: params.account.authDir,
1879
+ groupHistories: params.groupHistories,
1880
+ groupHistoryLimit: params.groupHistoryLimit,
1881
+ groupMemberNames: params.groupMemberNames,
1882
+ logVerbose,
1883
+ replyLogger: params.replyLogger
1884
+ }).shouldProcess) return;
1885
+ } else if (!msg.senderE164 && peerId && peerId.startsWith("+")) msg.senderE164 = normalizeE164(peerId) ?? msg.senderE164;
1886
+ if (await maybeBroadcastMessage({
1887
+ cfg: params.cfg,
1888
+ msg,
1889
+ peerId,
1890
+ route,
1891
+ groupHistoryKey,
1892
+ groupHistories: params.groupHistories,
1893
+ processMessage: processForRoute
1894
+ })) return;
1895
+ await processForRoute(msg, route, groupHistoryKey);
1896
+ };
1897
+ }
1898
+
1899
+ //#endregion
1900
+ //#region src/web/auto-reply/monitor.ts
1901
+ async function monitorWebChannel(verbose, listenerFactory = monitorWebInbox, keepAlive = true, replyResolver = getReplyFromConfig, runtime = defaultRuntime, abortSignal, tuning = {}) {
1902
+ const runId = newConnectionId();
1903
+ const replyLogger = getChildLogger({
1904
+ module: "web-auto-reply",
1905
+ runId
1906
+ });
1907
+ const heartbeatLogger = getChildLogger({
1908
+ module: "web-heartbeat",
1909
+ runId
1910
+ });
1911
+ const reconnectLogger = getChildLogger({
1912
+ module: "web-reconnect",
1913
+ runId
1914
+ });
1915
+ const status = {
1916
+ running: true,
1917
+ connected: false,
1918
+ reconnectAttempts: 0,
1919
+ lastConnectedAt: null,
1920
+ lastDisconnect: null,
1921
+ lastMessageAt: null,
1922
+ lastEventAt: null,
1923
+ lastError: null
1924
+ };
1925
+ const emitStatus = () => {
1926
+ tuning.statusSink?.({
1927
+ ...status,
1928
+ lastDisconnect: status.lastDisconnect ? { ...status.lastDisconnect } : null
1929
+ });
1930
+ };
1931
+ emitStatus();
1932
+ const baseCfg = loadConfig();
1933
+ const account = resolveWhatsAppAccount({
1934
+ cfg: baseCfg,
1935
+ accountId: tuning.accountId
1936
+ });
1937
+ const cfg = {
1938
+ ...baseCfg,
1939
+ channels: {
1940
+ ...baseCfg.channels,
1941
+ whatsapp: {
1942
+ ...baseCfg.channels?.whatsapp,
1943
+ ackReaction: account.ackReaction,
1944
+ messagePrefix: account.messagePrefix,
1945
+ allowFrom: account.allowFrom,
1946
+ groupAllowFrom: account.groupAllowFrom,
1947
+ groupPolicy: account.groupPolicy,
1948
+ textChunkLimit: account.textChunkLimit,
1949
+ chunkMode: account.chunkMode,
1950
+ mediaMaxMb: account.mediaMaxMb,
1951
+ blockStreaming: account.blockStreaming,
1952
+ groups: account.groups
1953
+ }
1954
+ }
1955
+ };
1956
+ const configuredMaxMb = cfg.agents?.defaults?.mediaMaxMb;
1957
+ const maxMediaBytes = typeof configuredMaxMb === "number" && configuredMaxMb > 0 ? configuredMaxMb * 1024 * 1024 : DEFAULT_WEB_MEDIA_BYTES;
1958
+ const heartbeatSeconds = resolveHeartbeatSeconds(cfg, tuning.heartbeatSeconds);
1959
+ const reconnectPolicy = resolveReconnectPolicy(cfg, tuning.reconnect);
1960
+ const baseMentionConfig = buildMentionConfig(cfg);
1961
+ const groupHistoryLimit = cfg.channels?.whatsapp?.accounts?.[tuning.accountId ?? ""]?.historyLimit ?? cfg.channels?.whatsapp?.historyLimit ?? cfg.messages?.groupChat?.historyLimit ?? DEFAULT_GROUP_HISTORY_LIMIT;
1962
+ const groupHistories = /* @__PURE__ */ new Map();
1963
+ const groupMemberNames = /* @__PURE__ */ new Map();
1964
+ const echoTracker = createEchoTracker({
1965
+ maxItems: 100,
1966
+ logVerbose
1967
+ });
1968
+ const sleep = tuning.sleep ?? ((ms, signal) => sleepWithAbort(ms, signal ?? abortSignal));
1969
+ const stopRequested = () => abortSignal?.aborted === true;
1970
+ const abortPromise = abortSignal && new Promise((resolve) => abortSignal.addEventListener("abort", () => resolve("aborted"), { once: true }));
1971
+ const currentMaxListeners = process.getMaxListeners?.() ?? 10;
1972
+ if (process.setMaxListeners && currentMaxListeners < 50) process.setMaxListeners(50);
1973
+ let sigintStop = false;
1974
+ const handleSigint = () => {
1975
+ sigintStop = true;
1976
+ };
1977
+ process.once("SIGINT", handleSigint);
1978
+ let reconnectAttempts = 0;
1979
+ while (true) {
1980
+ if (stopRequested()) break;
1981
+ const connectionId = newConnectionId();
1982
+ const startedAt = Date.now();
1983
+ let heartbeat = null;
1984
+ let watchdogTimer = null;
1985
+ let lastMessageAt = null;
1986
+ let handledMessages = 0;
1987
+ let unregisterUnhandled = null;
1988
+ const MESSAGE_TIMEOUT_MS = 1800 * 1e3;
1989
+ const WATCHDOG_CHECK_MS = 60 * 1e3;
1990
+ const backgroundTasks = /* @__PURE__ */ new Set();
1991
+ const onMessage = createWebOnMessageHandler({
1992
+ cfg,
1993
+ verbose,
1994
+ connectionId,
1995
+ maxMediaBytes,
1996
+ groupHistoryLimit,
1997
+ groupHistories,
1998
+ groupMemberNames,
1999
+ echoTracker,
2000
+ backgroundTasks,
2001
+ replyResolver: replyResolver ?? getReplyFromConfig,
2002
+ replyLogger,
2003
+ baseMentionConfig,
2004
+ account
2005
+ });
2006
+ const inboundDebounceMs = resolveInboundDebounceMs({
2007
+ cfg,
2008
+ channel: "whatsapp"
2009
+ });
2010
+ const shouldDebounce = (msg) => {
2011
+ if (msg.mediaPath || msg.mediaType) return false;
2012
+ if (msg.location) return false;
2013
+ if (msg.replyToId || msg.replyToBody) return false;
2014
+ return !hasControlCommand(msg.body, cfg);
2015
+ };
2016
+ const listener = await (listenerFactory ?? monitorWebInbox)({
2017
+ verbose,
2018
+ accountId: account.accountId,
2019
+ authDir: account.authDir,
2020
+ mediaMaxMb: account.mediaMaxMb,
2021
+ sendReadReceipts: account.sendReadReceipts,
2022
+ debounceMs: inboundDebounceMs,
2023
+ shouldDebounce,
2024
+ onMessage: async (msg) => {
2025
+ handledMessages += 1;
2026
+ lastMessageAt = Date.now();
2027
+ status.lastMessageAt = lastMessageAt;
2028
+ status.lastEventAt = lastMessageAt;
2029
+ emitStatus();
2030
+ await onMessage(msg);
2031
+ }
2032
+ });
2033
+ status.connected = true;
2034
+ status.lastConnectedAt = Date.now();
2035
+ status.lastEventAt = status.lastConnectedAt;
2036
+ status.lastError = null;
2037
+ emitStatus();
2038
+ const { e164: selfE164 } = readWebSelfId(account.authDir);
2039
+ const connectRoute = resolveAgentRoute({
2040
+ cfg,
2041
+ channel: "whatsapp",
2042
+ accountId: account.accountId
2043
+ });
2044
+ enqueueSystemEvent(`WhatsApp gateway connected${selfE164 ? ` as ${selfE164}` : ""}.`, { sessionKey: connectRoute.sessionKey });
2045
+ setActiveWebListener(account.accountId, listener);
2046
+ unregisterUnhandled = registerUnhandledRejectionHandler((reason) => {
2047
+ if (!isLikelyWhatsAppCryptoError(reason)) return false;
2048
+ const errorStr = formatError(reason);
2049
+ reconnectLogger.warn({
2050
+ connectionId,
2051
+ error: errorStr
2052
+ }, "web reconnect: unhandled rejection from WhatsApp socket; forcing reconnect");
2053
+ listener.signalClose?.({
2054
+ status: 499,
2055
+ isLoggedOut: false,
2056
+ error: reason
2057
+ });
2058
+ return true;
2059
+ });
2060
+ const closeListener = async () => {
2061
+ setActiveWebListener(account.accountId, null);
2062
+ if (unregisterUnhandled) {
2063
+ unregisterUnhandled();
2064
+ unregisterUnhandled = null;
2065
+ }
2066
+ if (heartbeat) clearInterval(heartbeat);
2067
+ if (watchdogTimer) clearInterval(watchdogTimer);
2068
+ if (backgroundTasks.size > 0) {
2069
+ await Promise.allSettled(backgroundTasks);
2070
+ backgroundTasks.clear();
2071
+ }
2072
+ try {
2073
+ await listener.close();
2074
+ } catch (err) {
2075
+ logVerbose(`Socket close failed: ${formatError(err)}`);
2076
+ }
2077
+ };
2078
+ if (keepAlive) {
2079
+ heartbeat = setInterval(() => {
2080
+ const authAgeMs = getWebAuthAgeMs(account.authDir);
2081
+ const minutesSinceLastMessage = lastMessageAt ? Math.floor((Date.now() - lastMessageAt) / 6e4) : null;
2082
+ const logData = {
2083
+ connectionId,
2084
+ reconnectAttempts,
2085
+ messagesHandled: handledMessages,
2086
+ lastMessageAt,
2087
+ authAgeMs,
2088
+ uptimeMs: Date.now() - startedAt,
2089
+ ...minutesSinceLastMessage !== null && minutesSinceLastMessage > 30 ? { minutesSinceLastMessage } : {}
2090
+ };
2091
+ if (minutesSinceLastMessage && minutesSinceLastMessage > 30) heartbeatLogger.warn(logData, "⚠️ web gateway heartbeat - no messages in 30+ minutes");
2092
+ else heartbeatLogger.info(logData, "web gateway heartbeat");
2093
+ }, heartbeatSeconds * 1e3);
2094
+ watchdogTimer = setInterval(() => {
2095
+ if (!lastMessageAt) return;
2096
+ const timeSinceLastMessage = Date.now() - lastMessageAt;
2097
+ if (timeSinceLastMessage <= MESSAGE_TIMEOUT_MS) return;
2098
+ const minutesSinceLastMessage = Math.floor(timeSinceLastMessage / 6e4);
2099
+ heartbeatLogger.warn({
2100
+ connectionId,
2101
+ minutesSinceLastMessage,
2102
+ lastMessageAt: new Date(lastMessageAt),
2103
+ messagesHandled: handledMessages
2104
+ }, "Message timeout detected - forcing reconnect");
2105
+ whatsappHeartbeatLog.warn(`No messages received in ${minutesSinceLastMessage}m - restarting connection`);
2106
+ closeListener().catch((err) => {
2107
+ logVerbose(`Close listener failed: ${formatError(err)}`);
2108
+ });
2109
+ listener.signalClose?.({
2110
+ status: 499,
2111
+ isLoggedOut: false,
2112
+ error: "watchdog-timeout"
2113
+ });
2114
+ }, WATCHDOG_CHECK_MS);
2115
+ }
2116
+ whatsappLog.info("Listening for personal WhatsApp inbound messages.");
2117
+ if (process.stdout.isTTY || process.stderr.isTTY) whatsappLog.raw("Ctrl+C to stop.");
2118
+ if (!keepAlive) {
2119
+ await closeListener();
2120
+ process.removeListener("SIGINT", handleSigint);
2121
+ return;
2122
+ }
2123
+ const reason = await Promise.race([listener.onClose?.catch((err) => {
2124
+ reconnectLogger.error({ error: formatError(err) }, "listener.onClose rejected");
2125
+ return {
2126
+ status: 500,
2127
+ isLoggedOut: false,
2128
+ error: err
2129
+ };
2130
+ }) ?? waitForever(), abortPromise ?? waitForever()]);
2131
+ if (Date.now() - startedAt > heartbeatSeconds * 1e3) reconnectAttempts = 0;
2132
+ status.reconnectAttempts = reconnectAttempts;
2133
+ emitStatus();
2134
+ if (stopRequested() || sigintStop || reason === "aborted") {
2135
+ await closeListener();
2136
+ break;
2137
+ }
2138
+ const statusCode = (typeof reason === "object" && reason && "status" in reason ? reason.status : void 0) ?? "unknown";
2139
+ const loggedOut = typeof reason === "object" && reason && "isLoggedOut" in reason && reason.isLoggedOut;
2140
+ const errorStr = formatError(reason);
2141
+ status.connected = false;
2142
+ status.lastEventAt = Date.now();
2143
+ status.lastDisconnect = {
2144
+ at: status.lastEventAt,
2145
+ status: typeof statusCode === "number" ? statusCode : void 0,
2146
+ error: errorStr,
2147
+ loggedOut: Boolean(loggedOut)
2148
+ };
2149
+ status.lastError = errorStr;
2150
+ status.reconnectAttempts = reconnectAttempts;
2151
+ emitStatus();
2152
+ reconnectLogger.info({
2153
+ connectionId,
2154
+ status: statusCode,
2155
+ loggedOut,
2156
+ reconnectAttempts,
2157
+ error: errorStr
2158
+ }, "web reconnect: connection closed");
2159
+ enqueueSystemEvent(`WhatsApp gateway disconnected (status ${statusCode ?? "unknown"})`, { sessionKey: connectRoute.sessionKey });
2160
+ if (loggedOut) {
2161
+ runtime.error(`WhatsApp session logged out. Run \`${formatCliCommand("anima channels login --channel web")}\` to relink.`);
2162
+ await closeListener();
2163
+ break;
2164
+ }
2165
+ reconnectAttempts += 1;
2166
+ status.reconnectAttempts = reconnectAttempts;
2167
+ emitStatus();
2168
+ if (reconnectPolicy.maxAttempts > 0 && reconnectAttempts >= reconnectPolicy.maxAttempts) {
2169
+ reconnectLogger.warn({
2170
+ connectionId,
2171
+ status: statusCode,
2172
+ reconnectAttempts,
2173
+ maxAttempts: reconnectPolicy.maxAttempts
2174
+ }, "web reconnect: max attempts reached; continuing in degraded mode");
2175
+ runtime.error(`WhatsApp Web reconnect: max attempts reached (${reconnectAttempts}/${reconnectPolicy.maxAttempts}). Stopping web monitoring.`);
2176
+ await closeListener();
2177
+ break;
2178
+ }
2179
+ const delay = computeBackoff(reconnectPolicy, reconnectAttempts);
2180
+ reconnectLogger.info({
2181
+ connectionId,
2182
+ status: statusCode,
2183
+ reconnectAttempts,
2184
+ maxAttempts: reconnectPolicy.maxAttempts || "unlimited",
2185
+ delayMs: delay
2186
+ }, "web reconnect: scheduling retry");
2187
+ runtime.error(`WhatsApp Web connection closed (status ${statusCode}). Retry ${reconnectAttempts}/${reconnectPolicy.maxAttempts || "∞"} in ${formatDurationPrecise(delay)}… (${errorStr})`);
2188
+ await closeListener();
2189
+ try {
2190
+ await sleep(delay, abortSignal);
2191
+ } catch {
2192
+ break;
2193
+ }
2194
+ }
2195
+ status.running = false;
2196
+ status.connected = false;
2197
+ status.lastEventAt = Date.now();
2198
+ emitStatus();
2199
+ process.removeListener("SIGINT", handleSigint);
2200
+ }
2201
+
2202
+ //#endregion
2203
+ export { WA_WEB_AUTH_DIR, createWaSocket, logWebSelfId, loginWeb, monitorWebChannel, monitorWebInbox, pickWebChannel, sendMessageWhatsApp, waitForWaConnection, webAuthExists };