@captain-app/openclaw 2026.2.4

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 (1686) hide show
  1. package/CHANGELOG.md +1528 -0
  2. package/LICENSE +21 -0
  3. package/README-header.png +0 -0
  4. package/README.md +539 -0
  5. package/assets/avatar-placeholder.svg +19 -0
  6. package/assets/chrome-extension/README.md +22 -0
  7. package/assets/chrome-extension/background.js +438 -0
  8. package/assets/chrome-extension/icons/icon128.png +0 -0
  9. package/assets/chrome-extension/icons/icon16.png +0 -0
  10. package/assets/chrome-extension/icons/icon32.png +0 -0
  11. package/assets/chrome-extension/icons/icon48.png +0 -0
  12. package/assets/chrome-extension/manifest.json +25 -0
  13. package/assets/chrome-extension/options.html +196 -0
  14. package/assets/chrome-extension/options.js +59 -0
  15. package/assets/dmg-background-small.png +0 -0
  16. package/assets/dmg-background.png +0 -0
  17. package/dist/accounts-ClnuDahN.js +250 -0
  18. package/dist/accounts-DzBgAM3C.js +251 -0
  19. package/dist/acp-cli-BEDDkzXH.js +926 -0
  20. package/dist/acp-cli-CwV4mdnW.js +923 -0
  21. package/dist/agent-CArjbSeE.js +695 -0
  22. package/dist/agent-CB7x5HLT.js +695 -0
  23. package/dist/agent-scope-BbT4OG2N.js +545 -0
  24. package/dist/agent-scope-C_O6Vpl0.js +545 -0
  25. package/dist/agent-scope-Csu2B6AM.js +606 -0
  26. package/dist/archive-CWrnG1CH.js +85 -0
  27. package/dist/archive-ccN9aDgq.js +85 -0
  28. package/dist/audit-DXPkQ275.js +1686 -0
  29. package/dist/audit-eH7nwgsM.js +1686 -0
  30. package/dist/auth-health-Bj7Gjbv0.js +149 -0
  31. package/dist/auth-health-CjjJhHey.js +149 -0
  32. package/dist/auth-nnRYiqpH.js +192 -0
  33. package/dist/auth-profiles-DVLfuixr.js +2954 -0
  34. package/dist/auth-y1BLPUhX.js +192 -0
  35. package/dist/boolean-Wzu0-e0P.js +30 -0
  36. package/dist/brew-Cqi8b49_.js +46 -0
  37. package/dist/brew-DyBGNK8A.js +46 -0
  38. package/dist/build-info.json +5 -0
  39. package/dist/call-B7EveN4V.js +252 -0
  40. package/dist/call-vuUQIjOj.js +252 -0
  41. package/dist/canvas-host/a2ui/.bundle.hash +1 -0
  42. package/dist/canvas-host/a2ui/a2ui.bundle.js +17780 -0
  43. package/dist/canvas-host/a2ui/index.html +307 -0
  44. package/dist/channel-options-CJfmOkol.js +32 -0
  45. package/dist/channel-options-lFguMTz1.js +62 -0
  46. package/dist/channel-selection-BmND9mWj.js +51 -0
  47. package/dist/channel-selection-cGhL9G0c.js +51 -0
  48. package/dist/channel-summary-B4G513Eb.js +1154 -0
  49. package/dist/channel-summary-MCwBCa5y.js +1154 -0
  50. package/dist/channels-cli-C2Of1mZG.js +1411 -0
  51. package/dist/channels-cli-DFynrP1H.js +1413 -0
  52. package/dist/channels-status-issues-YohTjZ-I.js +18 -0
  53. package/dist/channels-status-issues-ZcR1U-m5.js +18 -0
  54. package/dist/chrome-B3IuUad-.js +1953 -0
  55. package/dist/chrome-BZ9K48w9.js +1973 -0
  56. package/dist/clack-prompter-B9yLhyOm.js +92 -0
  57. package/dist/clack-prompter-BybM9xdL.js +92 -0
  58. package/dist/cli/daemon-cli.js +2 -0
  59. package/dist/cli-BJZdJwug.js +89 -0
  60. package/dist/cli-BQSoKu3d.js +86 -0
  61. package/dist/cli-utils-CO4jEMn0.js +43 -0
  62. package/dist/cli-utils-gtE-0a0D.js +43 -0
  63. package/dist/client-DPqNOpK3.js +1609 -0
  64. package/dist/client-DySXIFCA.js +1609 -0
  65. package/dist/command-format-CFzL448l.js +52 -0
  66. package/dist/command-format-DELazozB.js +52 -0
  67. package/dist/command-format-ayFsmwwz.js +38 -0
  68. package/dist/command-options-CsjxK4cZ.js +33 -0
  69. package/dist/commands-BRe9VTyU.js +229 -0
  70. package/dist/completion-cli-DlkjK0iC.js +390 -0
  71. package/dist/completion-cli-E6Pt41AL.js +387 -0
  72. package/dist/config-BtSTwPcH.js +4882 -0
  73. package/dist/config-DfMIMT-f.js +4881 -0
  74. package/dist/config-_d7_WcRv.js +5623 -0
  75. package/dist/config-guard-wSnm-U8a.js +5628 -0
  76. package/dist/configure-CPHAFKlg.js +895 -0
  77. package/dist/configure-DK1XgXYx.js +894 -0
  78. package/dist/constants-CNTiY-ZN.js +65 -0
  79. package/dist/constants-hpmbslG7.js +65 -0
  80. package/dist/control-service-CqX5g_ko.js +61 -0
  81. package/dist/control-service-o6xe3hEb.js +61 -0
  82. package/dist/control-ui/apple-touch-icon.png +0 -0
  83. package/dist/control-ui/assets/index-RwcW4Xl0.css +1 -0
  84. package/dist/control-ui/assets/index-ryaCcbyp.js +4584 -0
  85. package/dist/control-ui/assets/index-ryaCcbyp.js.map +1 -0
  86. package/dist/control-ui/favicon-32.png +0 -0
  87. package/dist/control-ui/favicon.ico +0 -0
  88. package/dist/control-ui/favicon.svg +22 -0
  89. package/dist/control-ui/index.html +17 -0
  90. package/dist/cron-cli-BoSaDgvH.js +453 -0
  91. package/dist/cron-cli-qVandvsD.js +456 -0
  92. package/dist/daemon-cli-C4gGWa15.js +760 -0
  93. package/dist/daemon-cli-DV_X0Krf.js +761 -0
  94. package/dist/daemon-runtime-D5hbSrdO.js +460 -0
  95. package/dist/daemon-runtime-DXUfrXBC.js +460 -0
  96. package/dist/deliver-BxK5nI2P.js +2587 -0
  97. package/dist/deliver-Dwzg9LUd.js +2557 -0
  98. package/dist/deliver-qpYZp20m.js +2587 -0
  99. package/dist/deps-CUXtMV9d.js +27 -0
  100. package/dist/deps-WBvZpFV_.js +27 -0
  101. package/dist/devices-cli-B2s18Qrh.js +207 -0
  102. package/dist/devices-cli-D1UEtMUJ.js +204 -0
  103. package/dist/directory-cli-BXQbrkfM.js +247 -0
  104. package/dist/directory-cli-CqA7tRbq.js +244 -0
  105. package/dist/dispatcher-Dyv7T-1r.js +160 -0
  106. package/dist/dns-cli-CWxKD22D.js +198 -0
  107. package/dist/dns-cli-CzKr_Fxj.js +201 -0
  108. package/dist/docs-cli-BNyxUbWr.js +159 -0
  109. package/dist/docs-cli-DYpTbo3i.js +161 -0
  110. package/dist/doctor-C8fDYZLq.js +2583 -0
  111. package/dist/doctor-hYcqp7c0.js +2585 -0
  112. package/dist/entry.js +1326 -0
  113. package/dist/env-l7QVNj6j.js +32 -0
  114. package/dist/errors-CMCg46fK.js +1952 -0
  115. package/dist/exec-B8JKbXKW.js +246 -0
  116. package/dist/exec-BMnoMcZW.js +1099 -0
  117. package/dist/exec-HEWTMJ7j.js +246 -0
  118. package/dist/exec-approvals-DtrnHx6M.js +1026 -0
  119. package/dist/exec-approvals-Y42bE8ud.js +1026 -0
  120. package/dist/exec-approvals-cli-CIedYxP3.js +385 -0
  121. package/dist/exec-approvals-cli-xpbxnj4O.js +388 -0
  122. package/dist/extensionAPI.js +66572 -0
  123. package/dist/format-Dzy9uRLE.js +34 -0
  124. package/dist/format-sj0fELBK.js +34 -0
  125. package/dist/gateway-cli-5A-KNLEC.js +16635 -0
  126. package/dist/gateway-cli-B8kS4chb.js +16637 -0
  127. package/dist/gateway-rpc-15n38Ize.js +28 -0
  128. package/dist/gateway-rpc-TMVRgGfj.js +28 -0
  129. package/dist/github-copilot-auth-DVZj4Zgh.js +1104 -0
  130. package/dist/github-copilot-auth-DeGYyLY9.js +1104 -0
  131. package/dist/github-copilot-token-B3SA95yo.js +103 -0
  132. package/dist/github-copilot-token-C8XFYz0i.js +103 -0
  133. package/dist/github-copilot-token-CnxakiSC.js +103 -0
  134. package/dist/gmail-setup-utils-CWPC386a.js +428 -0
  135. package/dist/gmail-setup-utils-eJVB5Ewp.js +428 -0
  136. package/dist/health-format-B0tMTk3C.js +1189 -0
  137. package/dist/health-format-DaURVaUn.js +1188 -0
  138. package/dist/help-format-CEsRHU2f.js +17 -0
  139. package/dist/help-format-GuCWws6r.js +17 -0
  140. package/dist/helpers-BEJ-phFf.js +25 -0
  141. package/dist/helpers-BtbBZVKZ.js +10 -0
  142. package/dist/helpers-C12w9zxf.js +10 -0
  143. package/dist/helpers-CzjGJZmJ.js +25 -0
  144. package/dist/hooks/bundled/boot-md/HOOK.md +19 -0
  145. package/dist/hooks/bundled/command-logger/HOOK.md +122 -0
  146. package/dist/hooks/bundled/session-memory/HOOK.md +109 -0
  147. package/dist/hooks/bundled/soul-evil/HOOK.md +71 -0
  148. package/dist/hooks-cli-BZCMAnW2.js +1058 -0
  149. package/dist/hooks-cli-D0CEFg3P.js +1061 -0
  150. package/dist/hooks-status-Bn7_O8PM.js +443 -0
  151. package/dist/hooks-status-BrWVfIn0.js +443 -0
  152. package/dist/image-BS022pvv.js +1421 -0
  153. package/dist/image-BzJtY34J.js +629 -0
  154. package/dist/image-CBqmIbQQ.js +629 -0
  155. package/dist/index.js +5809 -0
  156. package/dist/installs-BP4K5L33.js +388 -0
  157. package/dist/installs-DOpTt7VZ.js +388 -0
  158. package/dist/is-main-B4o72sqg.js +25 -0
  159. package/dist/is-main-PYGa3tDA.js +25 -0
  160. package/dist/links-B4nk2iDf.js +15 -0
  161. package/dist/links-DwjRqxgR.js +15 -0
  162. package/dist/loader-Cn4EV_pf.js +63690 -0
  163. package/dist/logging-CS3tbYDj.js +15 -0
  164. package/dist/logging-CY-Q5cwf.js +1 -0
  165. package/dist/logging-DhiLkhLw.js +15 -0
  166. package/dist/logging-pqyrk15z.js +1 -0
  167. package/dist/login-qr-CD164Aw1.js +478 -0
  168. package/dist/login-qr-D7Zdgji2.js +478 -0
  169. package/dist/login-qr-YgILJ4VC.js +475 -0
  170. package/dist/logs-cli-BdS0Uv0I.js +227 -0
  171. package/dist/logs-cli-CqSN1GzB.js +230 -0
  172. package/dist/manager-CfGY5zND.js +2870 -0
  173. package/dist/manager-CjuBqFRL.js +2870 -0
  174. package/dist/manager-CoBEAQKm.js +2872 -0
  175. package/dist/manifest-registry-Bwjq9Iev.js +668 -0
  176. package/dist/manifest-registry-D2Yntqcb.js +668 -0
  177. package/dist/message-channel-Cjsiqxok.js +105 -0
  178. package/dist/message-channel-D6v_oPAg.js +105 -0
  179. package/dist/model-selection-Cv5Ox_tY.js +2956 -0
  180. package/dist/model-selection-Dr-5U5-l.js +2708 -0
  181. package/dist/models-cli-B39ckynD.js +2541 -0
  182. package/dist/models-cli-DoiYsBYw.js +2544 -0
  183. package/dist/net-CFCxaipF.js +137 -0
  184. package/dist/net-DKJPqXuW.js +137 -0
  185. package/dist/node-cli-C_FYF-RA.js +1456 -0
  186. package/dist/node-cli-DWPoNsQS.js +1459 -0
  187. package/dist/node-service-DcJREOww.js +67 -0
  188. package/dist/node-service-DuZ9Us9h.js +67 -0
  189. package/dist/nodes-cli-Elo6tlen.js +1210 -0
  190. package/dist/nodes-cli-zqryRUWB.js +1207 -0
  191. package/dist/nodes-screen-C4aCrxie.js +157 -0
  192. package/dist/nodes-screen-D4PSynkR.js +157 -0
  193. package/dist/note-CQhSvgQv.js +73 -0
  194. package/dist/note-_C44YfAQ.js +73 -0
  195. package/dist/onboard-channels-CHBDi-ZA.js +670 -0
  196. package/dist/onboard-channels-DOEKyxaL.js +670 -0
  197. package/dist/onboard-skills-BUTXREDZ.js +3327 -0
  198. package/dist/onboard-skills-CSLYZmZA.js +3327 -0
  199. package/dist/onboarding-CgKb8b39.js +3232 -0
  200. package/dist/openclaw-root-9ILYSmJ9.js +84 -0
  201. package/dist/openclaw-root-Cvotktkd.js +84 -0
  202. package/dist/pairing-cli-B4UGR2at.js +114 -0
  203. package/dist/pairing-cli-BWDDl8cf.js +117 -0
  204. package/dist/pairing-labels-ClZ-fTWT.js +9 -0
  205. package/dist/pairing-labels-Ds7BPOkj.js +9 -0
  206. package/dist/pairing-store-DDLNuzmx.js +391 -0
  207. package/dist/pairing-store-DRn08lZD.js +391 -0
  208. package/dist/parse-87ybtYW1.js +23 -0
  209. package/dist/parse-OCFfznr3.js +23 -0
  210. package/dist/parse-log-line-C9aL5PUL.js +44 -0
  211. package/dist/parse-log-line-DxRaGzQb.js +44 -0
  212. package/dist/parse-timeout-CFqNj7No.js +16 -0
  213. package/dist/parse-timeout-DV8NQQWk.js +16 -0
  214. package/dist/path-env-C7kiJUgG.js +77 -0
  215. package/dist/path-env-DEj4CiFN.js +77 -0
  216. package/dist/paths-B-q1nXdY.js +43 -0
  217. package/dist/paths-B1kfl4h5.js +164 -0
  218. package/dist/paths-B4kigINg.js +40 -0
  219. package/dist/paths-CHGbP1-A.js +43 -0
  220. package/dist/paths-scjhy7N2.js +180 -0
  221. package/dist/pi-embedded-helpers-C19wUpMB.js +8451 -0
  222. package/dist/pi-embedded-helpers-CT5VuLCb.js +1293 -0
  223. package/dist/pi-embedded-helpers-Dl8e5Rf8.js +1293 -0
  224. package/dist/pi-model-discovery-B6CsmK6Y.js +20 -0
  225. package/dist/pi-model-discovery-DsRqYJLy.js +20 -0
  226. package/dist/pi-model-discovery-EhM2JAQo.js +20 -0
  227. package/dist/pi-tools.policy-BvkSDFDN.js +229 -0
  228. package/dist/plugin-auto-enable-Bd_StZzz.js +461 -0
  229. package/dist/plugin-auto-enable-DBhXb_0x.js +461 -0
  230. package/dist/plugin-sdk/agent-scope-DdwUKIOe.js +606 -0
  231. package/dist/plugin-sdk/chrome-G8apFa5p.js +1953 -0
  232. package/dist/plugin-sdk/command-format-qUVxzqYm.js +52 -0
  233. package/dist/plugin-sdk/config-Cm1M7tgH.js +5623 -0
  234. package/dist/plugin-sdk/deliver-Cl8uowiO.js +2557 -0
  235. package/dist/plugin-sdk/exec-Cm9b2r9Q.js +1107 -0
  236. package/dist/plugin-sdk/github-copilot-token-BHNcM4_B.js +103 -0
  237. package/dist/plugin-sdk/image-7PgoS2VD.js +1421 -0
  238. package/dist/plugin-sdk/index.d.ts +8908 -0
  239. package/dist/plugin-sdk/index.js +70888 -0
  240. package/dist/plugin-sdk/login-qr-qTALvWi2.js +475 -0
  241. package/dist/plugin-sdk/manager-Cs3EQZCb.js +2870 -0
  242. package/dist/plugin-sdk/model-selection-BgC1E1a7.js +2708 -0
  243. package/dist/plugin-sdk/paths-BYpoyRv5.js +164 -0
  244. package/dist/plugin-sdk/paths-DNQE-bvr.js +40 -0
  245. package/dist/plugin-sdk/pi-embedded-helpers-5jNqW_dE.js +8755 -0
  246. package/dist/plugin-sdk/pi-model-discovery-BUGEht9A.js +20 -0
  247. package/dist/plugin-sdk/pw-ai-COTtei4a.js +1649 -0
  248. package/dist/plugin-sdk/qmd-manager-ClSwiAJl.js +615 -0
  249. package/dist/plugin-sdk/redact-2AzjOfk2.js +94 -0
  250. package/dist/plugin-sdk/rolldown-runtime-Cbj13DAv.js +20 -0
  251. package/dist/plugin-sdk/sqlite-gCW7MlLs.js +215 -0
  252. package/dist/plugin-sdk/transcript-events-DGF257vD.js +17 -0
  253. package/dist/plugins-C3Bm-HQV.js +494 -0
  254. package/dist/plugins-QJjTXliB.js +495 -0
  255. package/dist/plugins-cli-DTci0JQb.js +443 -0
  256. package/dist/plugins-cli-wJsN1HHK.js +440 -0
  257. package/dist/ports-CiW9dmMq.js +96 -0
  258. package/dist/program-BWpTHh1I.js +188 -0
  259. package/dist/progress-Bcjniu7m.js +133 -0
  260. package/dist/progress-CvaSPjS9.js +133 -0
  261. package/dist/prompt-style-CFsleyxV.js +9 -0
  262. package/dist/prompt-style-DYJdrXyV.js +9 -0
  263. package/dist/prompts-Bt9fwsg2.js +10 -0
  264. package/dist/prompts-CudpZgTI.js +10 -0
  265. package/dist/pw-ai-08F3GD-3.js +1649 -0
  266. package/dist/pw-ai-ZmHxHQnx.js +1651 -0
  267. package/dist/pw-ai-tNPuRNn3.js +1649 -0
  268. package/dist/qmd-manager-2r-4n3sP.js +617 -0
  269. package/dist/qmd-manager-CF52nuBg.js +615 -0
  270. package/dist/qmd-manager-HEm5H2mk.js +616 -0
  271. package/dist/redact-BICFkpn7.js +97 -0
  272. package/dist/redact-BIMJ3ntQ.js +94 -0
  273. package/dist/redact-KzWHRS5J.js +97 -0
  274. package/dist/register.subclis-D2K25c84.js +348 -0
  275. package/dist/register.subclis-Dd8LbOLi.js +342 -0
  276. package/dist/reply-5UNWRwMn.js +63693 -0
  277. package/dist/restart-sentinel-Cr0vUxB8.js +65 -0
  278. package/dist/restart-sentinel-DUemCjgU.js +65 -0
  279. package/dist/rolldown-runtime-Cbj13DAv.js +20 -0
  280. package/dist/routes-C6UpTPas.js +2410 -0
  281. package/dist/routes-ClNyEvlm.js +2410 -0
  282. package/dist/rpc-D0mf7DIw.js +95 -0
  283. package/dist/rpc-DYdOrgd9.js +95 -0
  284. package/dist/run-main-CojI7gWx.js +194 -0
  285. package/dist/runtime-guard-68M_evhb.js +60 -0
  286. package/dist/runtime-guard-DkjmhnBD.js +60 -0
  287. package/dist/sandbox-Ca81z3Tw.js +2924 -0
  288. package/dist/sandbox-cli-D75GApgp.js +459 -0
  289. package/dist/sandbox-cli-E4SJsC1C.js +462 -0
  290. package/dist/sandbox-knontqD9.js +2925 -0
  291. package/dist/security-cli-BLihvXO-.js +503 -0
  292. package/dist/security-cli-IGQCsK4g.js +506 -0
  293. package/dist/server-context-B9GX5GOI.js +740 -0
  294. package/dist/server-context-BFH7HB_M.js +740 -0
  295. package/dist/server-node-events-CTdHBiEA.js +218 -0
  296. package/dist/server-node-events-DAV14qPr.js +215 -0
  297. package/dist/service-BZNBq9hq.js +680 -0
  298. package/dist/service-C-BLXx9U.js +680 -0
  299. package/dist/service-audit-BfJv4NqZ.js +542 -0
  300. package/dist/service-audit-Bw3M2OEI.js +542 -0
  301. package/dist/shared-5SH-45AX.js +74 -0
  302. package/dist/shared-BxRm5uLU.js +74 -0
  303. package/dist/shared-C80Rmxsd.js +150 -0
  304. package/dist/shared-fGK6_D2v.js +150 -0
  305. package/dist/skills-Bhp0l6UK.js +693 -0
  306. package/dist/skills-Tky2kCMO.js +694 -0
  307. package/dist/skills-cli-6rCClAE4.js +287 -0
  308. package/dist/skills-cli-C4nLCrLw.js +290 -0
  309. package/dist/skills-status-CENcKr3I.js +187 -0
  310. package/dist/skills-status-DX1eUYvk.js +187 -0
  311. package/dist/sqlite-CmdZSZRx.js +197 -0
  312. package/dist/sqlite-Dnmf3LS7.js +215 -0
  313. package/dist/sqlite-QDf0yuU0.js +215 -0
  314. package/dist/status-BSfGAp2D.js +27 -0
  315. package/dist/status-Bp_2NMjt.js +27 -0
  316. package/dist/status-C0ANDr0T.js +3140 -0
  317. package/dist/status-CCHBIZnm.js +21 -0
  318. package/dist/status-Vuqbw2Bb.js +21 -0
  319. package/dist/status.update-BZW5r8Su.js +79 -0
  320. package/dist/status.update-BnD93_O8.js +79 -0
  321. package/dist/subsystem-CAq3uyo7.js +834 -0
  322. package/dist/system-cli-Bb9zmCO1.js +83 -0
  323. package/dist/system-cli-TIIQ04ls.js +80 -0
  324. package/dist/systemd-0Qa_nGqe.js +438 -0
  325. package/dist/systemd-Czb0Xsm7.js +438 -0
  326. package/dist/systemd-hints-CWoEOQRb.js +19 -0
  327. package/dist/systemd-hints-Cv3RN_mZ.js +19 -0
  328. package/dist/systemd-linger-CsdvcIoS.js +75 -0
  329. package/dist/systemd-linger-DKUFHcLn.js +75 -0
  330. package/dist/table-DNPESyNj.js +279 -0
  331. package/dist/table-DS4-gmkV.js +279 -0
  332. package/dist/tailnet-Bg_vE5qi.js +42 -0
  333. package/dist/tailnet-CrNWlQRJ.js +42 -0
  334. package/dist/tailscale-CBv58toW.js +252 -0
  335. package/dist/tailscale-DCnMs7_q.js +225 -0
  336. package/dist/tool-display-BEACy9rK.js +795 -0
  337. package/dist/tool-display-NYQnSpdo.js +795 -0
  338. package/dist/transcript-events-CsB1Saa6.js +17 -0
  339. package/dist/transcript-events-DDYvbmRV.js +17 -0
  340. package/dist/transcript-events-JLH5W4He.js +17 -0
  341. package/dist/tui--NY0rnjr.js +2542 -0
  342. package/dist/tui-DqJfGtvM.js +2543 -0
  343. package/dist/tui-cli-BuHNY6wF.js +54 -0
  344. package/dist/tui-cli-LMFV982e.js +57 -0
  345. package/dist/update-CRpHtCgz.js +317 -0
  346. package/dist/update-D3qruxhj.js +317 -0
  347. package/dist/update-cli-CFF-pslM.js +948 -0
  348. package/dist/update-cli-cn9pEMX7.js +951 -0
  349. package/dist/update-runner-CxGU142L.js +1221 -0
  350. package/dist/update-runner-DNobz_ft.js +1221 -0
  351. package/dist/utils-CKSrBNwq.js +192 -0
  352. package/dist/utils-DX85MiPR.js +188 -0
  353. package/dist/webhooks-cli-BGtt2HAR.js +312 -0
  354. package/dist/webhooks-cli-DHLZrEO_.js +309 -0
  355. package/dist/widearea-dns-BpG7ATO8.js +127 -0
  356. package/dist/widearea-dns-D4wkCJly.js +127 -0
  357. package/dist/ws-3zr8WUwL.js +13 -0
  358. package/dist/ws-log-BXcT2xQk.js +267 -0
  359. package/dist/ws-log-DbDIUsgz.js +267 -0
  360. package/dist/ws-lzrgabja.js +13 -0
  361. package/dist/wsl-D2O2qOrl.js +160 -0
  362. package/docs/.i18n/README.md +31 -0
  363. package/docs/.i18n/glossary.zh-CN.json +190 -0
  364. package/docs/.i18n/zh-CN.tm.jsonl +1329 -0
  365. package/docs/CNAME +1 -0
  366. package/docs/_config.yml +53 -0
  367. package/docs/_layouts/default.html +145 -0
  368. package/docs/assets/markdown.css +179 -0
  369. package/docs/assets/openclaw-logo-text-dark.png +0 -0
  370. package/docs/assets/openclaw-logo-text.png +0 -0
  371. package/docs/assets/pixel-lobster.svg +60 -0
  372. package/docs/assets/showcase/agents-ui.jpg +0 -0
  373. package/docs/assets/showcase/bambu-cli.png +0 -0
  374. package/docs/assets/showcase/codexmonitor.png +0 -0
  375. package/docs/assets/showcase/gohome-grafana.png +0 -0
  376. package/docs/assets/showcase/ios-testflight.jpg +0 -0
  377. package/docs/assets/showcase/oura-health.png +0 -0
  378. package/docs/assets/showcase/padel-cli.svg +11 -0
  379. package/docs/assets/showcase/padel-screenshot.jpg +0 -0
  380. package/docs/assets/showcase/papla-tts.jpg +0 -0
  381. package/docs/assets/showcase/pr-review-telegram.jpg +0 -0
  382. package/docs/assets/showcase/roborock-screenshot.jpg +0 -0
  383. package/docs/assets/showcase/roborock-status.svg +13 -0
  384. package/docs/assets/showcase/roof-camera-sky.jpg +0 -0
  385. package/docs/assets/showcase/snag.png +0 -0
  386. package/docs/assets/showcase/tesco-shop.jpg +0 -0
  387. package/docs/assets/showcase/wienerlinien.png +0 -0
  388. package/docs/assets/showcase/wine-cellar-skill.jpg +0 -0
  389. package/docs/assets/showcase/winix-air-purifier.jpg +0 -0
  390. package/docs/assets/showcase/xuezh-pronunciation.jpeg +0 -0
  391. package/docs/assets/terminal.css +473 -0
  392. package/docs/assets/theme.js +55 -0
  393. package/docs/automation/auth-monitoring.md +44 -0
  394. package/docs/automation/cron-jobs.md +468 -0
  395. package/docs/automation/cron-vs-heartbeat.md +282 -0
  396. package/docs/automation/gmail-pubsub.md +256 -0
  397. package/docs/automation/poll.md +69 -0
  398. package/docs/automation/webhook.md +163 -0
  399. package/docs/bedrock.md +176 -0
  400. package/docs/brave-search.md +41 -0
  401. package/docs/broadcast-groups.md +442 -0
  402. package/docs/channels/bluebubbles.md +338 -0
  403. package/docs/channels/discord.md +475 -0
  404. package/docs/channels/feishu.md +507 -0
  405. package/docs/channels/googlechat.md +250 -0
  406. package/docs/channels/grammy.md +31 -0
  407. package/docs/channels/imessage.md +299 -0
  408. package/docs/channels/index.md +46 -0
  409. package/docs/channels/line.md +186 -0
  410. package/docs/channels/location.md +56 -0
  411. package/docs/channels/matrix.md +233 -0
  412. package/docs/channels/mattermost.md +138 -0
  413. package/docs/channels/msteams.md +768 -0
  414. package/docs/channels/nextcloud-talk.md +136 -0
  415. package/docs/channels/nostr.md +233 -0
  416. package/docs/channels/signal.md +202 -0
  417. package/docs/channels/slack.md +548 -0
  418. package/docs/channels/telegram.md +750 -0
  419. package/docs/channels/tlon.md +132 -0
  420. package/docs/channels/troubleshooting.md +29 -0
  421. package/docs/channels/twitch.md +379 -0
  422. package/docs/channels/whatsapp.md +404 -0
  423. package/docs/channels/zalo.md +189 -0
  424. package/docs/channels/zalouser.md +140 -0
  425. package/docs/cli/acp.md +170 -0
  426. package/docs/cli/agent.md +24 -0
  427. package/docs/cli/agents.md +75 -0
  428. package/docs/cli/approvals.md +50 -0
  429. package/docs/cli/browser.md +107 -0
  430. package/docs/cli/channels.md +79 -0
  431. package/docs/cli/config.md +50 -0
  432. package/docs/cli/configure.md +33 -0
  433. package/docs/cli/cron.md +42 -0
  434. package/docs/cli/dashboard.md +16 -0
  435. package/docs/cli/devices.md +67 -0
  436. package/docs/cli/directory.md +63 -0
  437. package/docs/cli/dns.md +23 -0
  438. package/docs/cli/docs.md +15 -0
  439. package/docs/cli/doctor.md +41 -0
  440. package/docs/cli/gateway.md +199 -0
  441. package/docs/cli/health.md +21 -0
  442. package/docs/cli/hooks.md +304 -0
  443. package/docs/cli/index.md +1029 -0
  444. package/docs/cli/logs.md +24 -0
  445. package/docs/cli/memory.md +45 -0
  446. package/docs/cli/message.md +239 -0
  447. package/docs/cli/models.md +79 -0
  448. package/docs/cli/node.md +112 -0
  449. package/docs/cli/nodes.md +73 -0
  450. package/docs/cli/onboard.md +29 -0
  451. package/docs/cli/pairing.md +21 -0
  452. package/docs/cli/plugins.md +62 -0
  453. package/docs/cli/reset.md +17 -0
  454. package/docs/cli/sandbox.md +152 -0
  455. package/docs/cli/security.md +26 -0
  456. package/docs/cli/sessions.md +16 -0
  457. package/docs/cli/setup.md +29 -0
  458. package/docs/cli/skills.md +26 -0
  459. package/docs/cli/status.md +26 -0
  460. package/docs/cli/system.md +60 -0
  461. package/docs/cli/tui.md +23 -0
  462. package/docs/cli/uninstall.md +17 -0
  463. package/docs/cli/update.md +98 -0
  464. package/docs/cli/voicecall.md +34 -0
  465. package/docs/cli/webhooks.md +25 -0
  466. package/docs/concepts/agent-loop.md +146 -0
  467. package/docs/concepts/agent-workspace.md +233 -0
  468. package/docs/concepts/agent.md +123 -0
  469. package/docs/concepts/architecture.md +129 -0
  470. package/docs/concepts/channel-routing.md +114 -0
  471. package/docs/concepts/compaction.md +61 -0
  472. package/docs/concepts/context.md +161 -0
  473. package/docs/concepts/group-messages.md +84 -0
  474. package/docs/concepts/groups.md +373 -0
  475. package/docs/concepts/markdown-formatting.md +130 -0
  476. package/docs/concepts/memory.md +546 -0
  477. package/docs/concepts/messages.md +154 -0
  478. package/docs/concepts/model-failover.md +149 -0
  479. package/docs/concepts/model-providers.md +316 -0
  480. package/docs/concepts/models.md +208 -0
  481. package/docs/concepts/multi-agent.md +376 -0
  482. package/docs/concepts/oauth.md +145 -0
  483. package/docs/concepts/presence.md +102 -0
  484. package/docs/concepts/queue.md +89 -0
  485. package/docs/concepts/retry.md +69 -0
  486. package/docs/concepts/session-pruning.md +122 -0
  487. package/docs/concepts/session-tool.md +193 -0
  488. package/docs/concepts/session.md +188 -0
  489. package/docs/concepts/sessions.md +10 -0
  490. package/docs/concepts/streaming.md +135 -0
  491. package/docs/concepts/system-prompt.md +115 -0
  492. package/docs/concepts/timezone.md +91 -0
  493. package/docs/concepts/typebox.md +289 -0
  494. package/docs/concepts/typing-indicators.md +68 -0
  495. package/docs/concepts/usage-tracking.md +35 -0
  496. package/docs/date-time.md +128 -0
  497. package/docs/debug/node-issue.md +83 -0
  498. package/docs/debugging.md +162 -0
  499. package/docs/diagnostics/flags.md +91 -0
  500. package/docs/docs.json +1587 -0
  501. package/docs/environment.md +81 -0
  502. package/docs/experiments/onboarding-config-protocol.md +40 -0
  503. package/docs/experiments/plans/cron-add-hardening.md +63 -0
  504. package/docs/experiments/plans/group-policy-hardening.md +40 -0
  505. package/docs/experiments/plans/openresponses-gateway.md +123 -0
  506. package/docs/experiments/proposals/model-config.md +36 -0
  507. package/docs/experiments/research/memory.md +228 -0
  508. package/docs/gateway/authentication.md +145 -0
  509. package/docs/gateway/background-process.md +93 -0
  510. package/docs/gateway/bonjour.md +167 -0
  511. package/docs/gateway/bridge-protocol.md +89 -0
  512. package/docs/gateway/cli-backends.md +223 -0
  513. package/docs/gateway/configuration-examples.md +606 -0
  514. package/docs/gateway/configuration.md +3393 -0
  515. package/docs/gateway/discovery.md +116 -0
  516. package/docs/gateway/doctor.md +282 -0
  517. package/docs/gateway/gateway-lock.md +34 -0
  518. package/docs/gateway/health.md +35 -0
  519. package/docs/gateway/heartbeat.md +302 -0
  520. package/docs/gateway/index.md +328 -0
  521. package/docs/gateway/local-models.md +150 -0
  522. package/docs/gateway/logging.md +113 -0
  523. package/docs/gateway/multiple-gateways.md +112 -0
  524. package/docs/gateway/openai-http-api.md +118 -0
  525. package/docs/gateway/openresponses-http-api.md +317 -0
  526. package/docs/gateway/pairing.md +99 -0
  527. package/docs/gateway/protocol.md +221 -0
  528. package/docs/gateway/remote-gateway-readme.md +157 -0
  529. package/docs/gateway/remote.md +127 -0
  530. package/docs/gateway/sandbox-vs-tool-policy-vs-elevated.md +128 -0
  531. package/docs/gateway/sandboxing.md +193 -0
  532. package/docs/gateway/security/formal-verification.md +164 -0
  533. package/docs/gateway/security/index.md +825 -0
  534. package/docs/gateway/tailscale.md +127 -0
  535. package/docs/gateway/tools-invoke-http-api.md +85 -0
  536. package/docs/gateway/troubleshooting.md +767 -0
  537. package/docs/help/faq.md +2830 -0
  538. package/docs/help/index.md +21 -0
  539. package/docs/help/troubleshooting.md +98 -0
  540. package/docs/hooks/soul-evil.md +69 -0
  541. package/docs/hooks.md +913 -0
  542. package/docs/images/feishu-step2-create-app.png +0 -0
  543. package/docs/images/feishu-step3-credentials.png +0 -0
  544. package/docs/images/feishu-step4-permissions.png +0 -0
  545. package/docs/images/feishu-step5-bot-capability.png +0 -0
  546. package/docs/images/feishu-step6-event-subscription.png +0 -0
  547. package/docs/images/groups-flow.svg +52 -0
  548. package/docs/images/mobile-ui-screenshot.png +0 -0
  549. package/docs/index.md +258 -0
  550. package/docs/install/ansible.md +208 -0
  551. package/docs/install/bun.md +59 -0
  552. package/docs/install/development-channels.md +75 -0
  553. package/docs/install/docker.md +567 -0
  554. package/docs/install/index.md +185 -0
  555. package/docs/install/installer.md +123 -0
  556. package/docs/install/migrating.md +192 -0
  557. package/docs/install/nix.md +96 -0
  558. package/docs/install/node.md +78 -0
  559. package/docs/install/uninstall.md +128 -0
  560. package/docs/install/updating.md +228 -0
  561. package/docs/logging.md +350 -0
  562. package/docs/multi-agent-sandbox-tools.md +395 -0
  563. package/docs/network.md +54 -0
  564. package/docs/nodes/audio.md +114 -0
  565. package/docs/nodes/camera.md +156 -0
  566. package/docs/nodes/images.md +72 -0
  567. package/docs/nodes/index.md +341 -0
  568. package/docs/nodes/location-command.md +113 -0
  569. package/docs/nodes/media-understanding.md +379 -0
  570. package/docs/nodes/talk.md +90 -0
  571. package/docs/nodes/voicewake.md +65 -0
  572. package/docs/northflank.mdx +53 -0
  573. package/docs/perplexity.md +80 -0
  574. package/docs/pi-dev.md +70 -0
  575. package/docs/pi.md +612 -0
  576. package/docs/platforms/android.md +148 -0
  577. package/docs/platforms/digitalocean.md +262 -0
  578. package/docs/platforms/exe-dev.md +125 -0
  579. package/docs/platforms/fly.md +486 -0
  580. package/docs/platforms/gcp.md +503 -0
  581. package/docs/platforms/hetzner.md +330 -0
  582. package/docs/platforms/index.md +53 -0
  583. package/docs/platforms/ios.md +107 -0
  584. package/docs/platforms/linux.md +94 -0
  585. package/docs/platforms/mac/bundled-gateway.md +73 -0
  586. package/docs/platforms/mac/canvas.md +125 -0
  587. package/docs/platforms/mac/child-process.md +69 -0
  588. package/docs/platforms/mac/dev-setup.md +102 -0
  589. package/docs/platforms/mac/health.md +34 -0
  590. package/docs/platforms/mac/icon.md +31 -0
  591. package/docs/platforms/mac/logging.md +57 -0
  592. package/docs/platforms/mac/menu-bar.md +81 -0
  593. package/docs/platforms/mac/peekaboo.md +65 -0
  594. package/docs/platforms/mac/permissions.md +44 -0
  595. package/docs/platforms/mac/release.md +85 -0
  596. package/docs/platforms/mac/remote.md +83 -0
  597. package/docs/platforms/mac/signing.md +47 -0
  598. package/docs/platforms/mac/skills.md +33 -0
  599. package/docs/platforms/mac/voice-overlay.md +60 -0
  600. package/docs/platforms/mac/voicewake.md +67 -0
  601. package/docs/platforms/mac/webchat.md +41 -0
  602. package/docs/platforms/mac/xpc.md +61 -0
  603. package/docs/platforms/macos-vm.md +281 -0
  604. package/docs/platforms/macos.md +203 -0
  605. package/docs/platforms/oracle.md +303 -0
  606. package/docs/platforms/raspberry-pi.md +358 -0
  607. package/docs/platforms/windows.md +159 -0
  608. package/docs/plugin.md +664 -0
  609. package/docs/plugins/agent-tools.md +99 -0
  610. package/docs/plugins/manifest.md +71 -0
  611. package/docs/plugins/voice-call.md +284 -0
  612. package/docs/plugins/zalouser.md +81 -0
  613. package/docs/prose.md +134 -0
  614. package/docs/providers/anthropic.md +152 -0
  615. package/docs/providers/claude-max-api-proxy.md +148 -0
  616. package/docs/providers/cloudflare-ai-gateway.md +71 -0
  617. package/docs/providers/deepgram.md +93 -0
  618. package/docs/providers/github-copilot.md +72 -0
  619. package/docs/providers/glm.md +33 -0
  620. package/docs/providers/index.md +63 -0
  621. package/docs/providers/minimax.md +208 -0
  622. package/docs/providers/models.md +51 -0
  623. package/docs/providers/moonshot.md +142 -0
  624. package/docs/providers/ollama.md +223 -0
  625. package/docs/providers/openai.md +62 -0
  626. package/docs/providers/opencode.md +36 -0
  627. package/docs/providers/openrouter.md +37 -0
  628. package/docs/providers/qwen.md +53 -0
  629. package/docs/providers/synthetic.md +99 -0
  630. package/docs/providers/venice.md +267 -0
  631. package/docs/providers/vercel-ai-gateway.md +50 -0
  632. package/docs/providers/xiaomi.md +64 -0
  633. package/docs/providers/zai.md +36 -0
  634. package/docs/railway.mdx +99 -0
  635. package/docs/refactor/clawnet.md +417 -0
  636. package/docs/refactor/exec-host.md +316 -0
  637. package/docs/refactor/outbound-session-mirroring.md +85 -0
  638. package/docs/refactor/plugin-sdk.md +214 -0
  639. package/docs/refactor/strict-config.md +93 -0
  640. package/docs/reference/AGENTS.default.md +124 -0
  641. package/docs/reference/RELEASING.md +120 -0
  642. package/docs/reference/api-usage-costs.md +137 -0
  643. package/docs/reference/device-models.md +47 -0
  644. package/docs/reference/rpc.md +43 -0
  645. package/docs/reference/session-management-compaction.md +285 -0
  646. package/docs/reference/templates/AGENTS.dev.md +83 -0
  647. package/docs/reference/templates/AGENTS.md +218 -0
  648. package/docs/reference/templates/BOOT.md +10 -0
  649. package/docs/reference/templates/BOOTSTRAP.md +61 -0
  650. package/docs/reference/templates/HEARTBEAT.md +11 -0
  651. package/docs/reference/templates/IDENTITY.dev.md +47 -0
  652. package/docs/reference/templates/IDENTITY.md +27 -0
  653. package/docs/reference/templates/SOUL.dev.md +76 -0
  654. package/docs/reference/templates/SOUL.md +42 -0
  655. package/docs/reference/templates/TOOLS.dev.md +24 -0
  656. package/docs/reference/templates/TOOLS.md +46 -0
  657. package/docs/reference/templates/USER.dev.md +18 -0
  658. package/docs/reference/templates/USER.md +22 -0
  659. package/docs/reference/test.md +50 -0
  660. package/docs/reference/transcript-hygiene.md +129 -0
  661. package/docs/render.mdx +165 -0
  662. package/docs/scripts.md +28 -0
  663. package/docs/security/formal-verification.md +164 -0
  664. package/docs/start/getting-started.md +208 -0
  665. package/docs/start/hubs.md +185 -0
  666. package/docs/start/lore.md +219 -0
  667. package/docs/start/onboarding.md +110 -0
  668. package/docs/start/openclaw.md +241 -0
  669. package/docs/start/pairing.md +86 -0
  670. package/docs/start/setup.md +149 -0
  671. package/docs/start/showcase.md +416 -0
  672. package/docs/start/wizard.md +349 -0
  673. package/docs/testing.md +368 -0
  674. package/docs/token-use.md +112 -0
  675. package/docs/tools/agent-send.md +53 -0
  676. package/docs/tools/apply-patch.md +50 -0
  677. package/docs/tools/browser-linux-troubleshooting.md +139 -0
  678. package/docs/tools/browser-login.md +68 -0
  679. package/docs/tools/browser.md +576 -0
  680. package/docs/tools/chrome-extension.md +178 -0
  681. package/docs/tools/clawhub.md +257 -0
  682. package/docs/tools/creating-skills.md +54 -0
  683. package/docs/tools/elevated.md +57 -0
  684. package/docs/tools/exec-approvals.md +246 -0
  685. package/docs/tools/exec.md +179 -0
  686. package/docs/tools/firecrawl.md +61 -0
  687. package/docs/tools/index.md +509 -0
  688. package/docs/tools/llm-task.md +115 -0
  689. package/docs/tools/lobster.md +342 -0
  690. package/docs/tools/reactions.md +22 -0
  691. package/docs/tools/skills-config.md +76 -0
  692. package/docs/tools/skills.md +300 -0
  693. package/docs/tools/slash-commands.md +198 -0
  694. package/docs/tools/subagents.md +151 -0
  695. package/docs/tools/thinking.md +73 -0
  696. package/docs/tools/web.md +261 -0
  697. package/docs/tts.md +396 -0
  698. package/docs/tui.md +159 -0
  699. package/docs/vps.md +43 -0
  700. package/docs/web/control-ui.md +221 -0
  701. package/docs/web/dashboard.md +46 -0
  702. package/docs/web/index.md +116 -0
  703. package/docs/web/webchat.md +49 -0
  704. package/docs/whatsapp-openclaw-ai-zh.jpg +0 -0
  705. package/docs/whatsapp-openclaw.jpg +0 -0
  706. package/docs/zh-CN/AGENTS.md +59 -0
  707. package/docs/zh-CN/automation/auth-monitoring.md +47 -0
  708. package/docs/zh-CN/automation/cron-jobs.md +424 -0
  709. package/docs/zh-CN/automation/cron-vs-heartbeat.md +286 -0
  710. package/docs/zh-CN/automation/gmail-pubsub.md +249 -0
  711. package/docs/zh-CN/automation/poll.md +76 -0
  712. package/docs/zh-CN/automation/webhook.md +163 -0
  713. package/docs/zh-CN/bedrock.md +170 -0
  714. package/docs/zh-CN/brave-search.md +48 -0
  715. package/docs/zh-CN/broadcast-groups.md +449 -0
  716. package/docs/zh-CN/channels/bluebubbles.md +271 -0
  717. package/docs/zh-CN/channels/discord.md +468 -0
  718. package/docs/zh-CN/channels/feishu.md +513 -0
  719. package/docs/zh-CN/channels/googlechat.md +257 -0
  720. package/docs/zh-CN/channels/grammy.md +38 -0
  721. package/docs/zh-CN/channels/imessage.md +302 -0
  722. package/docs/zh-CN/channels/index.md +53 -0
  723. package/docs/zh-CN/channels/line.md +180 -0
  724. package/docs/zh-CN/channels/location.md +63 -0
  725. package/docs/zh-CN/channels/matrix.md +221 -0
  726. package/docs/zh-CN/channels/mattermost.md +144 -0
  727. package/docs/zh-CN/channels/msteams.md +775 -0
  728. package/docs/zh-CN/channels/nextcloud-talk.md +142 -0
  729. package/docs/zh-CN/channels/nostr.md +240 -0
  730. package/docs/zh-CN/channels/signal.md +209 -0
  731. package/docs/zh-CN/channels/slack.md +531 -0
  732. package/docs/zh-CN/channels/telegram.md +751 -0
  733. package/docs/zh-CN/channels/tlon.md +136 -0
  734. package/docs/zh-CN/channels/troubleshooting.md +36 -0
  735. package/docs/zh-CN/channels/twitch.md +385 -0
  736. package/docs/zh-CN/channels/whatsapp.md +411 -0
  737. package/docs/zh-CN/channels/zalo.md +196 -0
  738. package/docs/zh-CN/channels/zalouser.md +147 -0
  739. package/docs/zh-CN/cli/acp.md +173 -0
  740. package/docs/zh-CN/cli/agent.md +30 -0
  741. package/docs/zh-CN/cli/agents.md +82 -0
  742. package/docs/zh-CN/cli/approvals.md +57 -0
  743. package/docs/zh-CN/cli/browser.md +114 -0
  744. package/docs/zh-CN/cli/channels.md +86 -0
  745. package/docs/zh-CN/cli/config.md +57 -0
  746. package/docs/zh-CN/cli/configure.md +38 -0
  747. package/docs/zh-CN/cli/cron.md +43 -0
  748. package/docs/zh-CN/cli/dashboard.md +23 -0
  749. package/docs/zh-CN/cli/devices.md +74 -0
  750. package/docs/zh-CN/cli/directory.md +70 -0
  751. package/docs/zh-CN/cli/dns.md +30 -0
  752. package/docs/zh-CN/cli/docs.md +22 -0
  753. package/docs/zh-CN/cli/doctor.md +48 -0
  754. package/docs/zh-CN/cli/gateway.md +206 -0
  755. package/docs/zh-CN/cli/health.md +28 -0
  756. package/docs/zh-CN/cli/hooks.md +311 -0
  757. package/docs/zh-CN/cli/index.md +1032 -0
  758. package/docs/zh-CN/cli/logs.md +31 -0
  759. package/docs/zh-CN/cli/memory.md +52 -0
  760. package/docs/zh-CN/cli/message.md +246 -0
  761. package/docs/zh-CN/cli/models.md +85 -0
  762. package/docs/zh-CN/cli/node.md +115 -0
  763. package/docs/zh-CN/cli/nodes.md +80 -0
  764. package/docs/zh-CN/cli/onboard.md +36 -0
  765. package/docs/zh-CN/cli/pairing.md +28 -0
  766. package/docs/zh-CN/cli/plugins.md +66 -0
  767. package/docs/zh-CN/cli/reset.md +24 -0
  768. package/docs/zh-CN/cli/sandbox.md +158 -0
  769. package/docs/zh-CN/cli/security.md +33 -0
  770. package/docs/zh-CN/cli/sessions.md +23 -0
  771. package/docs/zh-CN/cli/setup.md +36 -0
  772. package/docs/zh-CN/cli/skills.md +33 -0
  773. package/docs/zh-CN/cli/status.md +33 -0
  774. package/docs/zh-CN/cli/system.md +63 -0
  775. package/docs/zh-CN/cli/tui.md +30 -0
  776. package/docs/zh-CN/cli/uninstall.md +24 -0
  777. package/docs/zh-CN/cli/update.md +101 -0
  778. package/docs/zh-CN/cli/voicecall.md +41 -0
  779. package/docs/zh-CN/cli/webhooks.md +32 -0
  780. package/docs/zh-CN/concepts/agent-loop.md +146 -0
  781. package/docs/zh-CN/concepts/agent-workspace.md +219 -0
  782. package/docs/zh-CN/concepts/agent.md +115 -0
  783. package/docs/zh-CN/concepts/architecture.md +123 -0
  784. package/docs/zh-CN/concepts/channel-routing.md +117 -0
  785. package/docs/zh-CN/concepts/compaction.md +67 -0
  786. package/docs/zh-CN/concepts/context.md +168 -0
  787. package/docs/zh-CN/concepts/group-messages.md +91 -0
  788. package/docs/zh-CN/concepts/groups.md +379 -0
  789. package/docs/zh-CN/concepts/markdown-formatting.md +117 -0
  790. package/docs/zh-CN/concepts/memory.md +412 -0
  791. package/docs/zh-CN/concepts/messages.md +141 -0
  792. package/docs/zh-CN/concepts/model-failover.md +145 -0
  793. package/docs/zh-CN/concepts/model-providers.md +320 -0
  794. package/docs/zh-CN/concepts/models.md +196 -0
  795. package/docs/zh-CN/concepts/multi-agent.md +372 -0
  796. package/docs/zh-CN/concepts/oauth.md +151 -0
  797. package/docs/zh-CN/concepts/presence.md +99 -0
  798. package/docs/zh-CN/concepts/queue.md +94 -0
  799. package/docs/zh-CN/concepts/retry.md +76 -0
  800. package/docs/zh-CN/concepts/session-pruning.md +129 -0
  801. package/docs/zh-CN/concepts/session-tool.md +200 -0
  802. package/docs/zh-CN/concepts/session.md +166 -0
  803. package/docs/zh-CN/concepts/sessions.md +17 -0
  804. package/docs/zh-CN/concepts/streaming.md +133 -0
  805. package/docs/zh-CN/concepts/system-prompt.md +101 -0
  806. package/docs/zh-CN/concepts/timezone.md +96 -0
  807. package/docs/zh-CN/concepts/typebox.md +284 -0
  808. package/docs/zh-CN/concepts/typing-indicators.md +74 -0
  809. package/docs/zh-CN/concepts/usage-tracking.md +42 -0
  810. package/docs/zh-CN/date-time.md +129 -0
  811. package/docs/zh-CN/debug/node-issue.md +90 -0
  812. package/docs/zh-CN/debugging.md +160 -0
  813. package/docs/zh-CN/diagnostics/flags.md +98 -0
  814. package/docs/zh-CN/environment.md +88 -0
  815. package/docs/zh-CN/experiments/onboarding-config-protocol.md +47 -0
  816. package/docs/zh-CN/experiments/plans/cron-add-hardening.md +70 -0
  817. package/docs/zh-CN/experiments/plans/group-policy-hardening.md +45 -0
  818. package/docs/zh-CN/experiments/plans/openresponses-gateway.md +121 -0
  819. package/docs/zh-CN/experiments/proposals/model-config.md +42 -0
  820. package/docs/zh-CN/experiments/research/memory.md +235 -0
  821. package/docs/zh-CN/gateway/authentication.md +142 -0
  822. package/docs/zh-CN/gateway/background-process.md +100 -0
  823. package/docs/zh-CN/gateway/bonjour.md +174 -0
  824. package/docs/zh-CN/gateway/bridge-protocol.md +86 -0
  825. package/docs/zh-CN/gateway/cli-backends.md +213 -0
  826. package/docs/zh-CN/gateway/configuration-examples.md +587 -0
  827. package/docs/zh-CN/gateway/configuration.md +3332 -0
  828. package/docs/zh-CN/gateway/discovery.md +123 -0
  829. package/docs/zh-CN/gateway/doctor.md +238 -0
  830. package/docs/zh-CN/gateway/gateway-lock.md +41 -0
  831. package/docs/zh-CN/gateway/health.md +42 -0
  832. package/docs/zh-CN/gateway/heartbeat.md +274 -0
  833. package/docs/zh-CN/gateway/index.md +335 -0
  834. package/docs/zh-CN/gateway/local-models.md +157 -0
  835. package/docs/zh-CN/gateway/logging.md +114 -0
  836. package/docs/zh-CN/gateway/multiple-gateways.md +119 -0
  837. package/docs/zh-CN/gateway/openai-http-api.md +125 -0
  838. package/docs/zh-CN/gateway/openresponses-http-api.md +317 -0
  839. package/docs/zh-CN/gateway/pairing.md +99 -0
  840. package/docs/zh-CN/gateway/protocol.md +220 -0
  841. package/docs/zh-CN/gateway/remote-gateway-readme.md +164 -0
  842. package/docs/zh-CN/gateway/remote.md +133 -0
  843. package/docs/zh-CN/gateway/sandbox-vs-tool-policy-vs-elevated.md +135 -0
  844. package/docs/zh-CN/gateway/sandboxing.md +188 -0
  845. package/docs/zh-CN/gateway/security/formal-verification.md +169 -0
  846. package/docs/zh-CN/gateway/security/index.md +777 -0
  847. package/docs/zh-CN/gateway/tailscale.md +124 -0
  848. package/docs/zh-CN/gateway/tools-invoke-http-api.md +92 -0
  849. package/docs/zh-CN/gateway/troubleshooting.md +771 -0
  850. package/docs/zh-CN/help/faq.md +2628 -0
  851. package/docs/zh-CN/help/index.md +28 -0
  852. package/docs/zh-CN/help/troubleshooting.md +104 -0
  853. package/docs/zh-CN/hooks/soul-evil.md +72 -0
  854. package/docs/zh-CN/hooks.md +919 -0
  855. package/docs/zh-CN/index.md +264 -0
  856. package/docs/zh-CN/install/ansible.md +215 -0
  857. package/docs/zh-CN/install/bun.md +65 -0
  858. package/docs/zh-CN/install/development-channels.md +81 -0
  859. package/docs/zh-CN/install/docker.md +532 -0
  860. package/docs/zh-CN/install/index.md +193 -0
  861. package/docs/zh-CN/install/installer.md +128 -0
  862. package/docs/zh-CN/install/migrating.md +199 -0
  863. package/docs/zh-CN/install/nix.md +99 -0
  864. package/docs/zh-CN/install/node.md +85 -0
  865. package/docs/zh-CN/install/uninstall.md +135 -0
  866. package/docs/zh-CN/install/updating.md +233 -0
  867. package/docs/zh-CN/logging.md +329 -0
  868. package/docs/zh-CN/multi-agent-sandbox-tools.md +401 -0
  869. package/docs/zh-CN/network.md +59 -0
  870. package/docs/zh-CN/nodes/audio.md +120 -0
  871. package/docs/zh-CN/nodes/camera.md +162 -0
  872. package/docs/zh-CN/nodes/images.md +79 -0
  873. package/docs/zh-CN/nodes/index.md +348 -0
  874. package/docs/zh-CN/nodes/location-command.md +120 -0
  875. package/docs/zh-CN/nodes/media-understanding.md +380 -0
  876. package/docs/zh-CN/nodes/talk.md +97 -0
  877. package/docs/zh-CN/nodes/voicewake.md +72 -0
  878. package/docs/zh-CN/northflank.mdx +60 -0
  879. package/docs/zh-CN/perplexity.md +84 -0
  880. package/docs/zh-CN/pi-dev.md +77 -0
  881. package/docs/zh-CN/pi.md +619 -0
  882. package/docs/zh-CN/platforms/android.md +155 -0
  883. package/docs/zh-CN/platforms/digitalocean.md +269 -0
  884. package/docs/zh-CN/platforms/exe-dev.md +127 -0
  885. package/docs/zh-CN/platforms/fly.md +490 -0
  886. package/docs/zh-CN/platforms/gcp.md +510 -0
  887. package/docs/zh-CN/platforms/hetzner.md +337 -0
  888. package/docs/zh-CN/platforms/index.md +60 -0
  889. package/docs/zh-CN/platforms/ios.md +114 -0
  890. package/docs/zh-CN/platforms/linux.md +101 -0
  891. package/docs/zh-CN/platforms/mac/bundled-gateway.md +75 -0
  892. package/docs/zh-CN/platforms/mac/canvas.md +128 -0
  893. package/docs/zh-CN/platforms/mac/child-process.md +73 -0
  894. package/docs/zh-CN/platforms/mac/dev-setup.md +109 -0
  895. package/docs/zh-CN/platforms/mac/health.md +41 -0
  896. package/docs/zh-CN/platforms/mac/icon.md +38 -0
  897. package/docs/zh-CN/platforms/mac/logging.md +64 -0
  898. package/docs/zh-CN/platforms/mac/menu-bar.md +88 -0
  899. package/docs/zh-CN/platforms/mac/peekaboo.md +62 -0
  900. package/docs/zh-CN/platforms/mac/permissions.md +46 -0
  901. package/docs/zh-CN/platforms/mac/release.md +92 -0
  902. package/docs/zh-CN/platforms/mac/remote.md +90 -0
  903. package/docs/zh-CN/platforms/mac/signing.md +54 -0
  904. package/docs/zh-CN/platforms/mac/skills.md +40 -0
  905. package/docs/zh-CN/platforms/mac/voice-overlay.md +67 -0
  906. package/docs/zh-CN/platforms/mac/voicewake.md +74 -0
  907. package/docs/zh-CN/platforms/mac/webchat.md +43 -0
  908. package/docs/zh-CN/platforms/mac/xpc.md +68 -0
  909. package/docs/zh-CN/platforms/macos-vm.md +288 -0
  910. package/docs/zh-CN/platforms/macos.md +193 -0
  911. package/docs/zh-CN/platforms/oracle.md +310 -0
  912. package/docs/zh-CN/platforms/raspberry-pi.md +365 -0
  913. package/docs/zh-CN/platforms/windows.md +156 -0
  914. package/docs/zh-CN/plugin.md +639 -0
  915. package/docs/zh-CN/plugins/agent-tools.md +99 -0
  916. package/docs/zh-CN/plugins/manifest.md +68 -0
  917. package/docs/zh-CN/plugins/voice-call.md +250 -0
  918. package/docs/zh-CN/plugins/zalouser.md +88 -0
  919. package/docs/zh-CN/prose.md +141 -0
  920. package/docs/zh-CN/providers/anthropic.md +159 -0
  921. package/docs/zh-CN/providers/claude-max-api-proxy.md +155 -0
  922. package/docs/zh-CN/providers/deepgram.md +97 -0
  923. package/docs/zh-CN/providers/github-copilot.md +67 -0
  924. package/docs/zh-CN/providers/glm.md +39 -0
  925. package/docs/zh-CN/providers/index.md +68 -0
  926. package/docs/zh-CN/providers/minimax.md +206 -0
  927. package/docs/zh-CN/providers/models.md +55 -0
  928. package/docs/zh-CN/providers/moonshot.md +145 -0
  929. package/docs/zh-CN/providers/ollama.md +230 -0
  930. package/docs/zh-CN/providers/openai.md +68 -0
  931. package/docs/zh-CN/providers/opencode.md +41 -0
  932. package/docs/zh-CN/providers/openrouter.md +43 -0
  933. package/docs/zh-CN/providers/qwen.md +55 -0
  934. package/docs/zh-CN/providers/synthetic.md +102 -0
  935. package/docs/zh-CN/providers/venice.md +274 -0
  936. package/docs/zh-CN/providers/vercel-ai-gateway.md +57 -0
  937. package/docs/zh-CN/providers/xiaomi.md +68 -0
  938. package/docs/zh-CN/providers/zai.md +41 -0
  939. package/docs/zh-CN/railway.mdx +106 -0
  940. package/docs/zh-CN/refactor/clawnet.md +424 -0
  941. package/docs/zh-CN/refactor/exec-host.md +323 -0
  942. package/docs/zh-CN/refactor/outbound-session-mirroring.md +92 -0
  943. package/docs/zh-CN/refactor/plugin-sdk.md +221 -0
  944. package/docs/zh-CN/refactor/strict-config.md +100 -0
  945. package/docs/zh-CN/reference/AGENTS.default.md +131 -0
  946. package/docs/zh-CN/reference/RELEASING.md +123 -0
  947. package/docs/zh-CN/reference/api-usage-costs.md +136 -0
  948. package/docs/zh-CN/reference/device-models.md +54 -0
  949. package/docs/zh-CN/reference/rpc.md +48 -0
  950. package/docs/zh-CN/reference/session-management-compaction.md +287 -0
  951. package/docs/zh-CN/reference/templates/AGENTS.dev.md +89 -0
  952. package/docs/zh-CN/reference/templates/AGENTS.md +225 -0
  953. package/docs/zh-CN/reference/templates/BOOT.md +17 -0
  954. package/docs/zh-CN/reference/templates/BOOTSTRAP.md +68 -0
  955. package/docs/zh-CN/reference/templates/HEARTBEAT.md +18 -0
  956. package/docs/zh-CN/reference/templates/IDENTITY.dev.md +54 -0
  957. package/docs/zh-CN/reference/templates/IDENTITY.md +35 -0
  958. package/docs/zh-CN/reference/templates/SOUL.dev.md +83 -0
  959. package/docs/zh-CN/reference/templates/SOUL.md +49 -0
  960. package/docs/zh-CN/reference/templates/TOOLS.dev.md +31 -0
  961. package/docs/zh-CN/reference/templates/TOOLS.md +53 -0
  962. package/docs/zh-CN/reference/templates/USER.dev.md +25 -0
  963. package/docs/zh-CN/reference/templates/USER.md +30 -0
  964. package/docs/zh-CN/reference/test.md +57 -0
  965. package/docs/zh-CN/reference/transcript-hygiene.md +109 -0
  966. package/docs/zh-CN/render.mdx +169 -0
  967. package/docs/zh-CN/scripts.md +35 -0
  968. package/docs/zh-CN/security/formal-verification.md +171 -0
  969. package/docs/zh-CN/start/getting-started.md +206 -0
  970. package/docs/zh-CN/start/hubs.md +191 -0
  971. package/docs/zh-CN/start/lore.md +226 -0
  972. package/docs/zh-CN/start/onboarding.md +105 -0
  973. package/docs/zh-CN/start/openclaw.md +248 -0
  974. package/docs/zh-CN/start/pairing.md +89 -0
  975. package/docs/zh-CN/start/setup.md +153 -0
  976. package/docs/zh-CN/start/showcase.md +423 -0
  977. package/docs/zh-CN/start/wizard.md +331 -0
  978. package/docs/zh-CN/testing.md +375 -0
  979. package/docs/zh-CN/token-use.md +119 -0
  980. package/docs/zh-CN/tools/agent-send.md +59 -0
  981. package/docs/zh-CN/tools/apply-patch.md +57 -0
  982. package/docs/zh-CN/tools/browser-linux-troubleshooting.md +144 -0
  983. package/docs/zh-CN/tools/browser-login.md +75 -0
  984. package/docs/zh-CN/tools/browser.md +553 -0
  985. package/docs/zh-CN/tools/chrome-extension.md +183 -0
  986. package/docs/zh-CN/tools/clawhub.md +209 -0
  987. package/docs/zh-CN/tools/creating-skills.md +61 -0
  988. package/docs/zh-CN/tools/elevated.md +64 -0
  989. package/docs/zh-CN/tools/exec-approvals.md +234 -0
  990. package/docs/zh-CN/tools/exec.md +169 -0
  991. package/docs/zh-CN/tools/firecrawl.md +68 -0
  992. package/docs/zh-CN/tools/index.md +515 -0
  993. package/docs/zh-CN/tools/llm-task.md +117 -0
  994. package/docs/zh-CN/tools/lobster.md +349 -0
  995. package/docs/zh-CN/tools/reactions.md +29 -0
  996. package/docs/zh-CN/tools/skills-config.md +78 -0
  997. package/docs/zh-CN/tools/skills.md +279 -0
  998. package/docs/zh-CN/tools/slash-commands.md +205 -0
  999. package/docs/zh-CN/tools/subagents.md +156 -0
  1000. package/docs/zh-CN/tools/thinking.md +80 -0
  1001. package/docs/zh-CN/tools/web.md +257 -0
  1002. package/docs/zh-CN/tts.md +375 -0
  1003. package/docs/zh-CN/tui.md +166 -0
  1004. package/docs/zh-CN/vps.md +47 -0
  1005. package/docs/zh-CN/web/control-ui.md +191 -0
  1006. package/docs/zh-CN/web/dashboard.md +53 -0
  1007. package/docs/zh-CN/web/index.md +118 -0
  1008. package/docs/zh-CN/web/webchat.md +56 -0
  1009. package/extensions/bluebubbles/README.md +45 -0
  1010. package/extensions/bluebubbles/index.ts +19 -0
  1011. package/extensions/bluebubbles/node_modules/.bin/openclaw +21 -0
  1012. package/extensions/bluebubbles/openclaw.plugin.json +9 -0
  1013. package/extensions/bluebubbles/package.json +36 -0
  1014. package/extensions/bluebubbles/src/accounts.ts +88 -0
  1015. package/extensions/bluebubbles/src/actions.test.ts +650 -0
  1016. package/extensions/bluebubbles/src/actions.ts +438 -0
  1017. package/extensions/bluebubbles/src/attachments.test.ts +345 -0
  1018. package/extensions/bluebubbles/src/attachments.ts +300 -0
  1019. package/extensions/bluebubbles/src/channel.ts +414 -0
  1020. package/extensions/bluebubbles/src/chat.test.ts +461 -0
  1021. package/extensions/bluebubbles/src/chat.ts +378 -0
  1022. package/extensions/bluebubbles/src/config-schema.ts +51 -0
  1023. package/extensions/bluebubbles/src/media-send.ts +174 -0
  1024. package/extensions/bluebubbles/src/monitor.test.ts +2342 -0
  1025. package/extensions/bluebubbles/src/monitor.ts +2490 -0
  1026. package/extensions/bluebubbles/src/onboarding.ts +352 -0
  1027. package/extensions/bluebubbles/src/probe.ts +135 -0
  1028. package/extensions/bluebubbles/src/reactions.test.ts +392 -0
  1029. package/extensions/bluebubbles/src/reactions.ts +188 -0
  1030. package/extensions/bluebubbles/src/runtime.ts +14 -0
  1031. package/extensions/bluebubbles/src/send.test.ts +808 -0
  1032. package/extensions/bluebubbles/src/send.ts +467 -0
  1033. package/extensions/bluebubbles/src/targets.test.ts +183 -0
  1034. package/extensions/bluebubbles/src/targets.ts +422 -0
  1035. package/extensions/bluebubbles/src/types.ts +127 -0
  1036. package/extensions/copilot-proxy/README.md +24 -0
  1037. package/extensions/copilot-proxy/index.ts +148 -0
  1038. package/extensions/copilot-proxy/node_modules/.bin/openclaw +21 -0
  1039. package/extensions/copilot-proxy/openclaw.plugin.json +9 -0
  1040. package/extensions/copilot-proxy/package.json +14 -0
  1041. package/extensions/diagnostics-otel/index.ts +15 -0
  1042. package/extensions/diagnostics-otel/node_modules/.bin/openclaw +21 -0
  1043. package/extensions/diagnostics-otel/openclaw.plugin.json +8 -0
  1044. package/extensions/diagnostics-otel/package.json +27 -0
  1045. package/extensions/diagnostics-otel/src/service.test.ts +226 -0
  1046. package/extensions/diagnostics-otel/src/service.ts +635 -0
  1047. package/extensions/discord/index.ts +17 -0
  1048. package/extensions/discord/node_modules/.bin/openclaw +21 -0
  1049. package/extensions/discord/openclaw.plugin.json +9 -0
  1050. package/extensions/discord/package.json +14 -0
  1051. package/extensions/discord/src/channel.ts +422 -0
  1052. package/extensions/discord/src/runtime.ts +14 -0
  1053. package/extensions/feishu/README.md +47 -0
  1054. package/extensions/feishu/index.ts +15 -0
  1055. package/extensions/feishu/node_modules/.bin/openclaw +21 -0
  1056. package/extensions/feishu/openclaw.plugin.json +9 -0
  1057. package/extensions/feishu/package.json +33 -0
  1058. package/extensions/feishu/src/channel.ts +276 -0
  1059. package/extensions/feishu/src/config-schema.ts +46 -0
  1060. package/extensions/feishu/src/onboarding.ts +278 -0
  1061. package/extensions/google-antigravity-auth/README.md +24 -0
  1062. package/extensions/google-antigravity-auth/index.ts +461 -0
  1063. package/extensions/google-antigravity-auth/node_modules/.bin/openclaw +21 -0
  1064. package/extensions/google-antigravity-auth/openclaw.plugin.json +9 -0
  1065. package/extensions/google-antigravity-auth/package.json +14 -0
  1066. package/extensions/google-gemini-cli-auth/README.md +35 -0
  1067. package/extensions/google-gemini-cli-auth/index.ts +88 -0
  1068. package/extensions/google-gemini-cli-auth/node_modules/.bin/openclaw +21 -0
  1069. package/extensions/google-gemini-cli-auth/oauth.test.ts +240 -0
  1070. package/extensions/google-gemini-cli-auth/oauth.ts +662 -0
  1071. package/extensions/google-gemini-cli-auth/openclaw.plugin.json +9 -0
  1072. package/extensions/google-gemini-cli-auth/package.json +14 -0
  1073. package/extensions/googlechat/index.ts +19 -0
  1074. package/extensions/googlechat/node_modules/.bin/openclaw +21 -0
  1075. package/extensions/googlechat/openclaw.plugin.json +9 -0
  1076. package/extensions/googlechat/package.json +39 -0
  1077. package/extensions/googlechat/src/accounts.ts +147 -0
  1078. package/extensions/googlechat/src/actions.ts +181 -0
  1079. package/extensions/googlechat/src/api.test.ts +61 -0
  1080. package/extensions/googlechat/src/api.ts +282 -0
  1081. package/extensions/googlechat/src/auth.ts +123 -0
  1082. package/extensions/googlechat/src/channel.ts +583 -0
  1083. package/extensions/googlechat/src/monitor.test.ts +22 -0
  1084. package/extensions/googlechat/src/monitor.ts +949 -0
  1085. package/extensions/googlechat/src/onboarding.ts +269 -0
  1086. package/extensions/googlechat/src/runtime.ts +14 -0
  1087. package/extensions/googlechat/src/targets.test.ts +32 -0
  1088. package/extensions/googlechat/src/targets.ts +65 -0
  1089. package/extensions/googlechat/src/types.config.ts +3 -0
  1090. package/extensions/googlechat/src/types.ts +73 -0
  1091. package/extensions/imessage/index.ts +17 -0
  1092. package/extensions/imessage/node_modules/.bin/openclaw +21 -0
  1093. package/extensions/imessage/openclaw.plugin.json +9 -0
  1094. package/extensions/imessage/package.json +14 -0
  1095. package/extensions/imessage/src/channel.ts +294 -0
  1096. package/extensions/imessage/src/runtime.ts +14 -0
  1097. package/extensions/line/index.ts +19 -0
  1098. package/extensions/line/node_modules/.bin/openclaw +21 -0
  1099. package/extensions/line/openclaw.plugin.json +9 -0
  1100. package/extensions/line/package.json +29 -0
  1101. package/extensions/line/src/card-command.ts +344 -0
  1102. package/extensions/line/src/channel.logout.test.ts +99 -0
  1103. package/extensions/line/src/channel.sendPayload.test.ts +306 -0
  1104. package/extensions/line/src/channel.ts +780 -0
  1105. package/extensions/line/src/runtime.ts +14 -0
  1106. package/extensions/llm-task/README.md +97 -0
  1107. package/extensions/llm-task/index.ts +6 -0
  1108. package/extensions/llm-task/node_modules/.bin/openclaw +21 -0
  1109. package/extensions/llm-task/openclaw.plugin.json +21 -0
  1110. package/extensions/llm-task/package.json +14 -0
  1111. package/extensions/llm-task/src/llm-task-tool.test.ts +138 -0
  1112. package/extensions/llm-task/src/llm-task-tool.ts +245 -0
  1113. package/extensions/lobster/README.md +75 -0
  1114. package/extensions/lobster/SKILL.md +97 -0
  1115. package/extensions/lobster/index.ts +14 -0
  1116. package/extensions/lobster/node_modules/.bin/openclaw +21 -0
  1117. package/extensions/lobster/openclaw.plugin.json +10 -0
  1118. package/extensions/lobster/package.json +14 -0
  1119. package/extensions/lobster/src/lobster-tool.test.ts +247 -0
  1120. package/extensions/lobster/src/lobster-tool.ts +328 -0
  1121. package/extensions/matrix/CHANGELOG.md +87 -0
  1122. package/extensions/matrix/index.ts +17 -0
  1123. package/extensions/matrix/node_modules/.bin/markdown-it +21 -0
  1124. package/extensions/matrix/node_modules/.bin/openclaw +21 -0
  1125. package/extensions/matrix/openclaw.plugin.json +9 -0
  1126. package/extensions/matrix/package.json +36 -0
  1127. package/extensions/matrix/src/actions.ts +195 -0
  1128. package/extensions/matrix/src/channel.directory.test.ts +64 -0
  1129. package/extensions/matrix/src/channel.ts +439 -0
  1130. package/extensions/matrix/src/config-schema.ts +62 -0
  1131. package/extensions/matrix/src/directory-live.ts +188 -0
  1132. package/extensions/matrix/src/group-mentions.ts +66 -0
  1133. package/extensions/matrix/src/matrix/accounts.test.ts +82 -0
  1134. package/extensions/matrix/src/matrix/accounts.ts +65 -0
  1135. package/extensions/matrix/src/matrix/actions/client.ts +57 -0
  1136. package/extensions/matrix/src/matrix/actions/messages.ts +128 -0
  1137. package/extensions/matrix/src/matrix/actions/pins.ts +76 -0
  1138. package/extensions/matrix/src/matrix/actions/reactions.ts +96 -0
  1139. package/extensions/matrix/src/matrix/actions/room.ts +85 -0
  1140. package/extensions/matrix/src/matrix/actions/summary.ts +75 -0
  1141. package/extensions/matrix/src/matrix/actions/types.ts +84 -0
  1142. package/extensions/matrix/src/matrix/actions.ts +15 -0
  1143. package/extensions/matrix/src/matrix/active-client.ts +11 -0
  1144. package/extensions/matrix/src/matrix/client/config.ts +160 -0
  1145. package/extensions/matrix/src/matrix/client/create-client.ts +123 -0
  1146. package/extensions/matrix/src/matrix/client/logging.ts +36 -0
  1147. package/extensions/matrix/src/matrix/client/runtime.ts +4 -0
  1148. package/extensions/matrix/src/matrix/client/shared.ts +170 -0
  1149. package/extensions/matrix/src/matrix/client/storage.ts +131 -0
  1150. package/extensions/matrix/src/matrix/client/types.ts +34 -0
  1151. package/extensions/matrix/src/matrix/client.test.ts +56 -0
  1152. package/extensions/matrix/src/matrix/client.ts +5 -0
  1153. package/extensions/matrix/src/matrix/credentials.ts +105 -0
  1154. package/extensions/matrix/src/matrix/deps.ts +60 -0
  1155. package/extensions/matrix/src/matrix/format.test.ts +33 -0
  1156. package/extensions/matrix/src/matrix/format.ts +22 -0
  1157. package/extensions/matrix/src/matrix/index.ts +11 -0
  1158. package/extensions/matrix/src/matrix/monitor/allowlist.test.ts +45 -0
  1159. package/extensions/matrix/src/matrix/monitor/allowlist.ts +103 -0
  1160. package/extensions/matrix/src/matrix/monitor/auto-join.ts +71 -0
  1161. package/extensions/matrix/src/matrix/monitor/direct.ts +104 -0
  1162. package/extensions/matrix/src/matrix/monitor/events.ts +101 -0
  1163. package/extensions/matrix/src/matrix/monitor/handler.ts +661 -0
  1164. package/extensions/matrix/src/matrix/monitor/index.ts +338 -0
  1165. package/extensions/matrix/src/matrix/monitor/location.ts +100 -0
  1166. package/extensions/matrix/src/matrix/monitor/media.test.ts +102 -0
  1167. package/extensions/matrix/src/matrix/monitor/media.ts +113 -0
  1168. package/extensions/matrix/src/matrix/monitor/mentions.ts +31 -0
  1169. package/extensions/matrix/src/matrix/monitor/replies.ts +97 -0
  1170. package/extensions/matrix/src/matrix/monitor/room-info.ts +55 -0
  1171. package/extensions/matrix/src/matrix/monitor/rooms.test.ts +39 -0
  1172. package/extensions/matrix/src/matrix/monitor/rooms.ts +47 -0
  1173. package/extensions/matrix/src/matrix/monitor/threads.ts +68 -0
  1174. package/extensions/matrix/src/matrix/monitor/types.ts +39 -0
  1175. package/extensions/matrix/src/matrix/poll-types.test.ts +21 -0
  1176. package/extensions/matrix/src/matrix/poll-types.ts +166 -0
  1177. package/extensions/matrix/src/matrix/probe.ts +70 -0
  1178. package/extensions/matrix/src/matrix/send/client.ts +66 -0
  1179. package/extensions/matrix/src/matrix/send/formatting.ts +89 -0
  1180. package/extensions/matrix/src/matrix/send/media.ts +229 -0
  1181. package/extensions/matrix/src/matrix/send/targets.test.ts +98 -0
  1182. package/extensions/matrix/src/matrix/send/targets.ts +136 -0
  1183. package/extensions/matrix/src/matrix/send/types.ts +109 -0
  1184. package/extensions/matrix/src/matrix/send.test.ts +171 -0
  1185. package/extensions/matrix/src/matrix/send.ts +260 -0
  1186. package/extensions/matrix/src/onboarding.ts +449 -0
  1187. package/extensions/matrix/src/outbound.ts +52 -0
  1188. package/extensions/matrix/src/resolve-targets.test.ts +48 -0
  1189. package/extensions/matrix/src/resolve-targets.ts +135 -0
  1190. package/extensions/matrix/src/runtime.ts +14 -0
  1191. package/extensions/matrix/src/tool-actions.ts +164 -0
  1192. package/extensions/matrix/src/types.ts +95 -0
  1193. package/extensions/mattermost/index.ts +17 -0
  1194. package/extensions/mattermost/node_modules/.bin/openclaw +21 -0
  1195. package/extensions/mattermost/openclaw.plugin.json +9 -0
  1196. package/extensions/mattermost/package.json +28 -0
  1197. package/extensions/mattermost/src/channel.test.ts +48 -0
  1198. package/extensions/mattermost/src/channel.ts +337 -0
  1199. package/extensions/mattermost/src/config-schema.ts +55 -0
  1200. package/extensions/mattermost/src/group-mentions.ts +15 -0
  1201. package/extensions/mattermost/src/mattermost/accounts.ts +128 -0
  1202. package/extensions/mattermost/src/mattermost/client.ts +220 -0
  1203. package/extensions/mattermost/src/mattermost/index.ts +9 -0
  1204. package/extensions/mattermost/src/mattermost/monitor-helpers.ts +166 -0
  1205. package/extensions/mattermost/src/mattermost/monitor.ts +987 -0
  1206. package/extensions/mattermost/src/mattermost/probe.ts +74 -0
  1207. package/extensions/mattermost/src/mattermost/send.ts +231 -0
  1208. package/extensions/mattermost/src/normalize.ts +46 -0
  1209. package/extensions/mattermost/src/onboarding-helpers.ts +44 -0
  1210. package/extensions/mattermost/src/onboarding.ts +186 -0
  1211. package/extensions/mattermost/src/runtime.ts +14 -0
  1212. package/extensions/mattermost/src/types.ts +50 -0
  1213. package/extensions/memory-core/index.ts +38 -0
  1214. package/extensions/memory-core/node_modules/.bin/openclaw +21 -0
  1215. package/extensions/memory-core/openclaw.plugin.json +9 -0
  1216. package/extensions/memory-core/package.json +17 -0
  1217. package/extensions/memory-lancedb/config.ts +139 -0
  1218. package/extensions/memory-lancedb/index.test.ts +295 -0
  1219. package/extensions/memory-lancedb/index.ts +608 -0
  1220. package/extensions/memory-lancedb/node_modules/.bin/openai +21 -0
  1221. package/extensions/memory-lancedb/node_modules/.bin/openclaw +21 -0
  1222. package/extensions/memory-lancedb/openclaw.plugin.json +60 -0
  1223. package/extensions/memory-lancedb/package.json +19 -0
  1224. package/extensions/minimax-portal-auth/README.md +33 -0
  1225. package/extensions/minimax-portal-auth/index.ts +155 -0
  1226. package/extensions/minimax-portal-auth/node_modules/.bin/openclaw +21 -0
  1227. package/extensions/minimax-portal-auth/oauth.ts +247 -0
  1228. package/extensions/minimax-portal-auth/openclaw.plugin.json +9 -0
  1229. package/extensions/minimax-portal-auth/package.json +14 -0
  1230. package/extensions/msteams/CHANGELOG.md +83 -0
  1231. package/extensions/msteams/index.ts +17 -0
  1232. package/extensions/msteams/node_modules/.bin/openclaw +21 -0
  1233. package/extensions/msteams/openclaw.plugin.json +9 -0
  1234. package/extensions/msteams/package.json +39 -0
  1235. package/extensions/msteams/src/attachments/download.ts +283 -0
  1236. package/extensions/msteams/src/attachments/graph.ts +353 -0
  1237. package/extensions/msteams/src/attachments/html.ts +90 -0
  1238. package/extensions/msteams/src/attachments/payload.ts +22 -0
  1239. package/extensions/msteams/src/attachments/shared.ts +291 -0
  1240. package/extensions/msteams/src/attachments/types.ts +37 -0
  1241. package/extensions/msteams/src/attachments.test.ts +459 -0
  1242. package/extensions/msteams/src/attachments.ts +18 -0
  1243. package/extensions/msteams/src/channel.directory.test.ts +48 -0
  1244. package/extensions/msteams/src/channel.ts +459 -0
  1245. package/extensions/msteams/src/conversation-store-fs.test.ts +88 -0
  1246. package/extensions/msteams/src/conversation-store-fs.ts +165 -0
  1247. package/extensions/msteams/src/conversation-store-memory.ts +47 -0
  1248. package/extensions/msteams/src/conversation-store.ts +41 -0
  1249. package/extensions/msteams/src/directory-live.ts +205 -0
  1250. package/extensions/msteams/src/errors.test.ts +45 -0
  1251. package/extensions/msteams/src/errors.ts +190 -0
  1252. package/extensions/msteams/src/file-consent-helpers.test.ts +243 -0
  1253. package/extensions/msteams/src/file-consent-helpers.ts +73 -0
  1254. package/extensions/msteams/src/file-consent.ts +126 -0
  1255. package/extensions/msteams/src/graph-chat.ts +53 -0
  1256. package/extensions/msteams/src/graph-upload.ts +453 -0
  1257. package/extensions/msteams/src/inbound.test.ts +66 -0
  1258. package/extensions/msteams/src/inbound.ts +48 -0
  1259. package/extensions/msteams/src/index.ts +4 -0
  1260. package/extensions/msteams/src/media-helpers.test.ts +189 -0
  1261. package/extensions/msteams/src/media-helpers.ts +86 -0
  1262. package/extensions/msteams/src/messenger.test.ts +248 -0
  1263. package/extensions/msteams/src/messenger.ts +495 -0
  1264. package/extensions/msteams/src/monitor-handler/inbound-media.ts +128 -0
  1265. package/extensions/msteams/src/monitor-handler/message-handler.ts +640 -0
  1266. package/extensions/msteams/src/monitor-handler.ts +162 -0
  1267. package/extensions/msteams/src/monitor-types.ts +5 -0
  1268. package/extensions/msteams/src/monitor.ts +295 -0
  1269. package/extensions/msteams/src/onboarding.ts +431 -0
  1270. package/extensions/msteams/src/outbound.ts +46 -0
  1271. package/extensions/msteams/src/pending-uploads.ts +89 -0
  1272. package/extensions/msteams/src/policy.test.ts +209 -0
  1273. package/extensions/msteams/src/policy.ts +273 -0
  1274. package/extensions/msteams/src/polls-store-memory.ts +32 -0
  1275. package/extensions/msteams/src/polls-store.test.ts +38 -0
  1276. package/extensions/msteams/src/polls.test.ts +72 -0
  1277. package/extensions/msteams/src/polls.ts +315 -0
  1278. package/extensions/msteams/src/probe.test.ts +58 -0
  1279. package/extensions/msteams/src/probe.ts +107 -0
  1280. package/extensions/msteams/src/reply-dispatcher.ts +130 -0
  1281. package/extensions/msteams/src/resolve-allowlist.ts +297 -0
  1282. package/extensions/msteams/src/runtime.ts +14 -0
  1283. package/extensions/msteams/src/sdk-types.ts +19 -0
  1284. package/extensions/msteams/src/sdk.ts +33 -0
  1285. package/extensions/msteams/src/send-context.ts +164 -0
  1286. package/extensions/msteams/src/send.ts +519 -0
  1287. package/extensions/msteams/src/sent-message-cache.test.ts +15 -0
  1288. package/extensions/msteams/src/sent-message-cache.ts +47 -0
  1289. package/extensions/msteams/src/storage.ts +25 -0
  1290. package/extensions/msteams/src/store-fs.ts +83 -0
  1291. package/extensions/msteams/src/token.ts +19 -0
  1292. package/extensions/nextcloud-talk/index.ts +17 -0
  1293. package/extensions/nextcloud-talk/node_modules/.bin/openclaw +21 -0
  1294. package/extensions/nextcloud-talk/openclaw.plugin.json +9 -0
  1295. package/extensions/nextcloud-talk/package.json +33 -0
  1296. package/extensions/nextcloud-talk/src/accounts.ts +174 -0
  1297. package/extensions/nextcloud-talk/src/channel.ts +409 -0
  1298. package/extensions/nextcloud-talk/src/config-schema.ts +78 -0
  1299. package/extensions/nextcloud-talk/src/format.ts +79 -0
  1300. package/extensions/nextcloud-talk/src/inbound.ts +317 -0
  1301. package/extensions/nextcloud-talk/src/monitor.ts +246 -0
  1302. package/extensions/nextcloud-talk/src/normalize.ts +39 -0
  1303. package/extensions/nextcloud-talk/src/onboarding.ts +343 -0
  1304. package/extensions/nextcloud-talk/src/policy.test.ts +33 -0
  1305. package/extensions/nextcloud-talk/src/policy.ts +180 -0
  1306. package/extensions/nextcloud-talk/src/room-info.ts +125 -0
  1307. package/extensions/nextcloud-talk/src/runtime.ts +14 -0
  1308. package/extensions/nextcloud-talk/src/send.ts +210 -0
  1309. package/extensions/nextcloud-talk/src/signature.ts +72 -0
  1310. package/extensions/nextcloud-talk/src/types.ts +179 -0
  1311. package/extensions/nostr/CHANGELOG.md +74 -0
  1312. package/extensions/nostr/README.md +136 -0
  1313. package/extensions/nostr/index.ts +68 -0
  1314. package/extensions/nostr/node_modules/.bin/openclaw +21 -0
  1315. package/extensions/nostr/openclaw.plugin.json +9 -0
  1316. package/extensions/nostr/package.json +34 -0
  1317. package/extensions/nostr/src/channel.test.ts +151 -0
  1318. package/extensions/nostr/src/channel.ts +353 -0
  1319. package/extensions/nostr/src/config-schema.ts +90 -0
  1320. package/extensions/nostr/src/metrics.ts +478 -0
  1321. package/extensions/nostr/src/nostr-bus.fuzz.test.ts +533 -0
  1322. package/extensions/nostr/src/nostr-bus.integration.test.ts +448 -0
  1323. package/extensions/nostr/src/nostr-bus.test.ts +199 -0
  1324. package/extensions/nostr/src/nostr-bus.ts +715 -0
  1325. package/extensions/nostr/src/nostr-profile-http.test.ts +378 -0
  1326. package/extensions/nostr/src/nostr-profile-http.ts +519 -0
  1327. package/extensions/nostr/src/nostr-profile-import.test.ts +119 -0
  1328. package/extensions/nostr/src/nostr-profile-import.ts +262 -0
  1329. package/extensions/nostr/src/nostr-profile.fuzz.test.ts +477 -0
  1330. package/extensions/nostr/src/nostr-profile.test.ts +410 -0
  1331. package/extensions/nostr/src/nostr-profile.ts +277 -0
  1332. package/extensions/nostr/src/nostr-state-store.test.ts +131 -0
  1333. package/extensions/nostr/src/nostr-state-store.ts +226 -0
  1334. package/extensions/nostr/src/runtime.ts +14 -0
  1335. package/extensions/nostr/src/seen-tracker.ts +303 -0
  1336. package/extensions/nostr/src/types.test.ts +157 -0
  1337. package/extensions/nostr/src/types.ts +101 -0
  1338. package/extensions/nostr/test/setup.ts +5 -0
  1339. package/extensions/open-prose/README.md +25 -0
  1340. package/extensions/open-prose/index.ts +5 -0
  1341. package/extensions/open-prose/node_modules/.bin/openclaw +21 -0
  1342. package/extensions/open-prose/openclaw.plugin.json +11 -0
  1343. package/extensions/open-prose/package.json +14 -0
  1344. package/extensions/open-prose/skills/prose/LICENSE +21 -0
  1345. package/extensions/open-prose/skills/prose/SKILL.md +323 -0
  1346. package/extensions/open-prose/skills/prose/alt-borges.md +141 -0
  1347. package/extensions/open-prose/skills/prose/alts/arabian-nights.md +358 -0
  1348. package/extensions/open-prose/skills/prose/alts/borges.md +360 -0
  1349. package/extensions/open-prose/skills/prose/alts/folk.md +322 -0
  1350. package/extensions/open-prose/skills/prose/alts/homer.md +346 -0
  1351. package/extensions/open-prose/skills/prose/alts/kafka.md +373 -0
  1352. package/extensions/open-prose/skills/prose/compiler.md +2971 -0
  1353. package/extensions/open-prose/skills/prose/examples/01-hello-world.prose +4 -0
  1354. package/extensions/open-prose/skills/prose/examples/02-research-and-summarize.prose +6 -0
  1355. package/extensions/open-prose/skills/prose/examples/03-code-review.prose +17 -0
  1356. package/extensions/open-prose/skills/prose/examples/04-write-and-refine.prose +14 -0
  1357. package/extensions/open-prose/skills/prose/examples/05-debug-issue.prose +20 -0
  1358. package/extensions/open-prose/skills/prose/examples/06-explain-codebase.prose +17 -0
  1359. package/extensions/open-prose/skills/prose/examples/07-refactor.prose +20 -0
  1360. package/extensions/open-prose/skills/prose/examples/08-blog-post.prose +20 -0
  1361. package/extensions/open-prose/skills/prose/examples/09-research-with-agents.prose +25 -0
  1362. package/extensions/open-prose/skills/prose/examples/10-code-review-agents.prose +32 -0
  1363. package/extensions/open-prose/skills/prose/examples/11-skills-and-imports.prose +27 -0
  1364. package/extensions/open-prose/skills/prose/examples/12-secure-agent-permissions.prose +43 -0
  1365. package/extensions/open-prose/skills/prose/examples/13-variables-and-context.prose +51 -0
  1366. package/extensions/open-prose/skills/prose/examples/14-composition-blocks.prose +48 -0
  1367. package/extensions/open-prose/skills/prose/examples/15-inline-sequences.prose +23 -0
  1368. package/extensions/open-prose/skills/prose/examples/16-parallel-reviews.prose +19 -0
  1369. package/extensions/open-prose/skills/prose/examples/17-parallel-research.prose +19 -0
  1370. package/extensions/open-prose/skills/prose/examples/18-mixed-parallel-sequential.prose +36 -0
  1371. package/extensions/open-prose/skills/prose/examples/19-advanced-parallel.prose +71 -0
  1372. package/extensions/open-prose/skills/prose/examples/20-fixed-loops.prose +20 -0
  1373. package/extensions/open-prose/skills/prose/examples/21-pipeline-operations.prose +35 -0
  1374. package/extensions/open-prose/skills/prose/examples/22-error-handling.prose +51 -0
  1375. package/extensions/open-prose/skills/prose/examples/23-retry-with-backoff.prose +63 -0
  1376. package/extensions/open-prose/skills/prose/examples/24-choice-blocks.prose +86 -0
  1377. package/extensions/open-prose/skills/prose/examples/25-conditionals.prose +114 -0
  1378. package/extensions/open-prose/skills/prose/examples/26-parameterized-blocks.prose +100 -0
  1379. package/extensions/open-prose/skills/prose/examples/27-string-interpolation.prose +105 -0
  1380. package/extensions/open-prose/skills/prose/examples/28-automated-pr-review.prose +37 -0
  1381. package/extensions/open-prose/skills/prose/examples/28-gas-town.prose +1572 -0
  1382. package/extensions/open-prose/skills/prose/examples/29-captains-chair.prose +218 -0
  1383. package/extensions/open-prose/skills/prose/examples/30-captains-chair-simple.prose +42 -0
  1384. package/extensions/open-prose/skills/prose/examples/31-captains-chair-with-memory.prose +145 -0
  1385. package/extensions/open-prose/skills/prose/examples/33-pr-review-autofix.prose +168 -0
  1386. package/extensions/open-prose/skills/prose/examples/34-content-pipeline.prose +204 -0
  1387. package/extensions/open-prose/skills/prose/examples/35-feature-factory.prose +296 -0
  1388. package/extensions/open-prose/skills/prose/examples/36-bug-hunter.prose +237 -0
  1389. package/extensions/open-prose/skills/prose/examples/37-the-forge.prose +1474 -0
  1390. package/extensions/open-prose/skills/prose/examples/38-skill-scan.prose +455 -0
  1391. package/extensions/open-prose/skills/prose/examples/39-architect-by-simulation.prose +277 -0
  1392. package/extensions/open-prose/skills/prose/examples/40-rlm-self-refine.prose +32 -0
  1393. package/extensions/open-prose/skills/prose/examples/41-rlm-divide-conquer.prose +38 -0
  1394. package/extensions/open-prose/skills/prose/examples/42-rlm-filter-recurse.prose +46 -0
  1395. package/extensions/open-prose/skills/prose/examples/43-rlm-pairwise.prose +50 -0
  1396. package/extensions/open-prose/skills/prose/examples/44-run-endpoint-ux-test.prose +261 -0
  1397. package/extensions/open-prose/skills/prose/examples/45-plugin-release.prose +159 -0
  1398. package/extensions/open-prose/skills/prose/examples/45-run-endpoint-ux-test-with-remediation.prose +637 -0
  1399. package/extensions/open-prose/skills/prose/examples/46-run-endpoint-ux-test-fast.prose +148 -0
  1400. package/extensions/open-prose/skills/prose/examples/46-workflow-crystallizer.prose +225 -0
  1401. package/extensions/open-prose/skills/prose/examples/47-language-self-improvement.prose +356 -0
  1402. package/extensions/open-prose/skills/prose/examples/48-habit-miner.prose +445 -0
  1403. package/extensions/open-prose/skills/prose/examples/49-prose-run-retrospective.prose +210 -0
  1404. package/extensions/open-prose/skills/prose/examples/README.md +391 -0
  1405. package/extensions/open-prose/skills/prose/examples/roadmap/README.md +22 -0
  1406. package/extensions/open-prose/skills/prose/examples/roadmap/iterative-refinement.prose +20 -0
  1407. package/extensions/open-prose/skills/prose/examples/roadmap/parallel-review.prose +18 -0
  1408. package/extensions/open-prose/skills/prose/examples/roadmap/simple-pipeline.prose +17 -0
  1409. package/extensions/open-prose/skills/prose/examples/roadmap/syntax/open-prose-syntax.prose +223 -0
  1410. package/extensions/open-prose/skills/prose/guidance/antipatterns.md +951 -0
  1411. package/extensions/open-prose/skills/prose/guidance/patterns.md +700 -0
  1412. package/extensions/open-prose/skills/prose/guidance/system-prompt.md +180 -0
  1413. package/extensions/open-prose/skills/prose/help.md +144 -0
  1414. package/extensions/open-prose/skills/prose/lib/README.md +108 -0
  1415. package/extensions/open-prose/skills/prose/lib/calibrator.prose +215 -0
  1416. package/extensions/open-prose/skills/prose/lib/cost-analyzer.prose +174 -0
  1417. package/extensions/open-prose/skills/prose/lib/error-forensics.prose +250 -0
  1418. package/extensions/open-prose/skills/prose/lib/inspector.prose +196 -0
  1419. package/extensions/open-prose/skills/prose/lib/profiler.prose +460 -0
  1420. package/extensions/open-prose/skills/prose/lib/program-improver.prose +275 -0
  1421. package/extensions/open-prose/skills/prose/lib/project-memory.prose +118 -0
  1422. package/extensions/open-prose/skills/prose/lib/user-memory.prose +93 -0
  1423. package/extensions/open-prose/skills/prose/lib/vm-improver.prose +243 -0
  1424. package/extensions/open-prose/skills/prose/primitives/session.md +593 -0
  1425. package/extensions/open-prose/skills/prose/prose.md +1237 -0
  1426. package/extensions/open-prose/skills/prose/state/filesystem.md +498 -0
  1427. package/extensions/open-prose/skills/prose/state/in-context.md +384 -0
  1428. package/extensions/open-prose/skills/prose/state/postgres.md +880 -0
  1429. package/extensions/open-prose/skills/prose/state/sqlite.md +574 -0
  1430. package/extensions/qwen-portal-auth/README.md +24 -0
  1431. package/extensions/qwen-portal-auth/index.ts +130 -0
  1432. package/extensions/qwen-portal-auth/oauth.ts +190 -0
  1433. package/extensions/qwen-portal-auth/openclaw.plugin.json +9 -0
  1434. package/extensions/signal/index.ts +17 -0
  1435. package/extensions/signal/node_modules/.bin/openclaw +21 -0
  1436. package/extensions/signal/openclaw.plugin.json +9 -0
  1437. package/extensions/signal/package.json +14 -0
  1438. package/extensions/signal/src/channel.ts +315 -0
  1439. package/extensions/signal/src/runtime.ts +14 -0
  1440. package/extensions/slack/index.ts +17 -0
  1441. package/extensions/slack/node_modules/.bin/openclaw +21 -0
  1442. package/extensions/slack/openclaw.plugin.json +9 -0
  1443. package/extensions/slack/package.json +14 -0
  1444. package/extensions/slack/src/channel.ts +604 -0
  1445. package/extensions/slack/src/runtime.ts +14 -0
  1446. package/extensions/telegram/index.ts +17 -0
  1447. package/extensions/telegram/node_modules/.bin/openclaw +21 -0
  1448. package/extensions/telegram/openclaw.plugin.json +9 -0
  1449. package/extensions/telegram/package.json +14 -0
  1450. package/extensions/telegram/src/channel.ts +482 -0
  1451. package/extensions/telegram/src/runtime.ts +14 -0
  1452. package/extensions/tlon/README.md +5 -0
  1453. package/extensions/tlon/index.ts +17 -0
  1454. package/extensions/tlon/node_modules/.bin/openclaw +21 -0
  1455. package/extensions/tlon/openclaw.plugin.json +9 -0
  1456. package/extensions/tlon/package.json +33 -0
  1457. package/extensions/tlon/src/channel.ts +392 -0
  1458. package/extensions/tlon/src/config-schema.test.ts +31 -0
  1459. package/extensions/tlon/src/config-schema.ts +43 -0
  1460. package/extensions/tlon/src/monitor/discovery.ts +76 -0
  1461. package/extensions/tlon/src/monitor/history.ts +90 -0
  1462. package/extensions/tlon/src/monitor/index.ts +553 -0
  1463. package/extensions/tlon/src/monitor/processed-messages.test.ts +23 -0
  1464. package/extensions/tlon/src/monitor/processed-messages.ts +46 -0
  1465. package/extensions/tlon/src/monitor/utils.ts +105 -0
  1466. package/extensions/tlon/src/onboarding.ts +214 -0
  1467. package/extensions/tlon/src/runtime.ts +14 -0
  1468. package/extensions/tlon/src/targets.ts +89 -0
  1469. package/extensions/tlon/src/types.ts +92 -0
  1470. package/extensions/tlon/src/urbit/auth.ts +18 -0
  1471. package/extensions/tlon/src/urbit/http-api.ts +38 -0
  1472. package/extensions/tlon/src/urbit/send.test.ts +38 -0
  1473. package/extensions/tlon/src/urbit/send.ts +131 -0
  1474. package/extensions/tlon/src/urbit/sse-client.test.ts +40 -0
  1475. package/extensions/tlon/src/urbit/sse-client.ts +395 -0
  1476. package/extensions/twitch/CHANGELOG.md +45 -0
  1477. package/extensions/twitch/README.md +89 -0
  1478. package/extensions/twitch/index.ts +20 -0
  1479. package/extensions/twitch/node_modules/.bin/openclaw +21 -0
  1480. package/extensions/twitch/openclaw.plugin.json +9 -0
  1481. package/extensions/twitch/package.json +20 -0
  1482. package/extensions/twitch/src/access-control.test.ts +489 -0
  1483. package/extensions/twitch/src/access-control.ts +166 -0
  1484. package/extensions/twitch/src/actions.ts +173 -0
  1485. package/extensions/twitch/src/client-manager-registry.ts +115 -0
  1486. package/extensions/twitch/src/config-schema.ts +82 -0
  1487. package/extensions/twitch/src/config.test.ts +87 -0
  1488. package/extensions/twitch/src/config.ts +116 -0
  1489. package/extensions/twitch/src/monitor.ts +261 -0
  1490. package/extensions/twitch/src/onboarding.test.ts +311 -0
  1491. package/extensions/twitch/src/onboarding.ts +417 -0
  1492. package/extensions/twitch/src/outbound.test.ts +373 -0
  1493. package/extensions/twitch/src/outbound.ts +184 -0
  1494. package/extensions/twitch/src/plugin.test.ts +39 -0
  1495. package/extensions/twitch/src/plugin.ts +274 -0
  1496. package/extensions/twitch/src/probe.test.ts +195 -0
  1497. package/extensions/twitch/src/probe.ts +120 -0
  1498. package/extensions/twitch/src/resolver.ts +137 -0
  1499. package/extensions/twitch/src/runtime.ts +14 -0
  1500. package/extensions/twitch/src/send.test.ts +289 -0
  1501. package/extensions/twitch/src/send.ts +136 -0
  1502. package/extensions/twitch/src/status.test.ts +270 -0
  1503. package/extensions/twitch/src/status.ts +178 -0
  1504. package/extensions/twitch/src/token.test.ts +171 -0
  1505. package/extensions/twitch/src/token.ts +91 -0
  1506. package/extensions/twitch/src/twitch-client.test.ts +589 -0
  1507. package/extensions/twitch/src/twitch-client.ts +277 -0
  1508. package/extensions/twitch/src/types.ts +141 -0
  1509. package/extensions/twitch/src/utils/markdown.ts +98 -0
  1510. package/extensions/twitch/src/utils/twitch.ts +78 -0
  1511. package/extensions/twitch/test/setup.ts +7 -0
  1512. package/extensions/voice-call/CHANGELOG.md +109 -0
  1513. package/extensions/voice-call/README.md +139 -0
  1514. package/extensions/voice-call/index.ts +493 -0
  1515. package/extensions/voice-call/node_modules/.bin/openclaw +21 -0
  1516. package/extensions/voice-call/openclaw.plugin.json +559 -0
  1517. package/extensions/voice-call/package.json +19 -0
  1518. package/extensions/voice-call/src/allowlist.ts +19 -0
  1519. package/extensions/voice-call/src/cli.ts +279 -0
  1520. package/extensions/voice-call/src/config.test.ts +234 -0
  1521. package/extensions/voice-call/src/config.ts +523 -0
  1522. package/extensions/voice-call/src/core-bridge.ts +159 -0
  1523. package/extensions/voice-call/src/manager/context.ts +21 -0
  1524. package/extensions/voice-call/src/manager/events.ts +188 -0
  1525. package/extensions/voice-call/src/manager/lookup.ts +35 -0
  1526. package/extensions/voice-call/src/manager/outbound.ts +275 -0
  1527. package/extensions/voice-call/src/manager/state.ts +48 -0
  1528. package/extensions/voice-call/src/manager/store.ts +91 -0
  1529. package/extensions/voice-call/src/manager/timers.ts +89 -0
  1530. package/extensions/voice-call/src/manager/twiml.ts +9 -0
  1531. package/extensions/voice-call/src/manager.test.ts +194 -0
  1532. package/extensions/voice-call/src/manager.ts +887 -0
  1533. package/extensions/voice-call/src/media-stream.test.ts +96 -0
  1534. package/extensions/voice-call/src/media-stream.ts +411 -0
  1535. package/extensions/voice-call/src/providers/base.ts +67 -0
  1536. package/extensions/voice-call/src/providers/index.ts +10 -0
  1537. package/extensions/voice-call/src/providers/mock.ts +165 -0
  1538. package/extensions/voice-call/src/providers/plivo.test.ts +27 -0
  1539. package/extensions/voice-call/src/providers/plivo.ts +515 -0
  1540. package/extensions/voice-call/src/providers/stt-openai-realtime.ts +311 -0
  1541. package/extensions/voice-call/src/providers/telnyx.ts +371 -0
  1542. package/extensions/voice-call/src/providers/tts-openai.ts +259 -0
  1543. package/extensions/voice-call/src/providers/twilio/api.ts +42 -0
  1544. package/extensions/voice-call/src/providers/twilio/webhook.ts +32 -0
  1545. package/extensions/voice-call/src/providers/twilio.test.ts +60 -0
  1546. package/extensions/voice-call/src/providers/twilio.ts +626 -0
  1547. package/extensions/voice-call/src/response-generator.ts +158 -0
  1548. package/extensions/voice-call/src/runtime.ts +212 -0
  1549. package/extensions/voice-call/src/telephony-audio.ts +90 -0
  1550. package/extensions/voice-call/src/telephony-tts.ts +104 -0
  1551. package/extensions/voice-call/src/tunnel.ts +314 -0
  1552. package/extensions/voice-call/src/types.ts +272 -0
  1553. package/extensions/voice-call/src/utils.ts +14 -0
  1554. package/extensions/voice-call/src/voice-mapping.ts +67 -0
  1555. package/extensions/voice-call/src/webhook-security.test.ts +377 -0
  1556. package/extensions/voice-call/src/webhook-security.ts +689 -0
  1557. package/extensions/voice-call/src/webhook.ts +491 -0
  1558. package/extensions/whatsapp/index.ts +17 -0
  1559. package/extensions/whatsapp/node_modules/.bin/openclaw +21 -0
  1560. package/extensions/whatsapp/openclaw.plugin.json +9 -0
  1561. package/extensions/whatsapp/package.json +14 -0
  1562. package/extensions/whatsapp/src/channel.ts +508 -0
  1563. package/extensions/whatsapp/src/runtime.ts +14 -0
  1564. package/extensions/zalo/CHANGELOG.md +89 -0
  1565. package/extensions/zalo/README.md +50 -0
  1566. package/extensions/zalo/index.ts +19 -0
  1567. package/extensions/zalo/node_modules/.bin/openclaw +21 -0
  1568. package/extensions/zalo/openclaw.plugin.json +9 -0
  1569. package/extensions/zalo/package.json +36 -0
  1570. package/extensions/zalo/src/accounts.ts +80 -0
  1571. package/extensions/zalo/src/actions.ts +67 -0
  1572. package/extensions/zalo/src/api.ts +208 -0
  1573. package/extensions/zalo/src/channel.directory.test.ts +43 -0
  1574. package/extensions/zalo/src/channel.ts +414 -0
  1575. package/extensions/zalo/src/config-schema.ts +24 -0
  1576. package/extensions/zalo/src/monitor.ts +753 -0
  1577. package/extensions/zalo/src/monitor.webhook.test.ts +73 -0
  1578. package/extensions/zalo/src/onboarding.ts +401 -0
  1579. package/extensions/zalo/src/probe.ts +46 -0
  1580. package/extensions/zalo/src/proxy.ts +21 -0
  1581. package/extensions/zalo/src/runtime.ts +14 -0
  1582. package/extensions/zalo/src/send.ts +124 -0
  1583. package/extensions/zalo/src/status-issues.ts +53 -0
  1584. package/extensions/zalo/src/token.ts +63 -0
  1585. package/extensions/zalo/src/types.ts +42 -0
  1586. package/extensions/zalouser/CHANGELOG.md +61 -0
  1587. package/extensions/zalouser/README.md +225 -0
  1588. package/extensions/zalouser/index.ts +31 -0
  1589. package/extensions/zalouser/node_modules/.bin/openclaw +21 -0
  1590. package/extensions/zalouser/openclaw.plugin.json +9 -0
  1591. package/extensions/zalouser/package.json +36 -0
  1592. package/extensions/zalouser/src/accounts.ts +135 -0
  1593. package/extensions/zalouser/src/channel.test.ts +18 -0
  1594. package/extensions/zalouser/src/channel.ts +686 -0
  1595. package/extensions/zalouser/src/config-schema.ts +27 -0
  1596. package/extensions/zalouser/src/monitor.ts +590 -0
  1597. package/extensions/zalouser/src/onboarding.ts +504 -0
  1598. package/extensions/zalouser/src/probe.ts +28 -0
  1599. package/extensions/zalouser/src/runtime.ts +14 -0
  1600. package/extensions/zalouser/src/send.ts +160 -0
  1601. package/extensions/zalouser/src/status-issues.test.ts +57 -0
  1602. package/extensions/zalouser/src/status-issues.ts +89 -0
  1603. package/extensions/zalouser/src/tool.ts +164 -0
  1604. package/extensions/zalouser/src/types.ts +108 -0
  1605. package/extensions/zalouser/src/zca.ts +202 -0
  1606. package/openclaw.mjs +14 -0
  1607. package/package.json +245 -0
  1608. package/skills/1password/SKILL.md +70 -0
  1609. package/skills/1password/references/cli-examples.md +29 -0
  1610. package/skills/1password/references/get-started.md +17 -0
  1611. package/skills/apple-notes/SKILL.md +77 -0
  1612. package/skills/apple-reminders/SKILL.md +96 -0
  1613. package/skills/bear-notes/SKILL.md +107 -0
  1614. package/skills/bird/SKILL.md +224 -0
  1615. package/skills/blogwatcher/SKILL.md +69 -0
  1616. package/skills/blucli/SKILL.md +47 -0
  1617. package/skills/bluebubbles/SKILL.md +131 -0
  1618. package/skills/camsnap/SKILL.md +45 -0
  1619. package/skills/canvas/SKILL.md +198 -0
  1620. package/skills/clawhub/SKILL.md +77 -0
  1621. package/skills/coding-agent/SKILL.md +284 -0
  1622. package/skills/discord/SKILL.md +578 -0
  1623. package/skills/eightctl/SKILL.md +50 -0
  1624. package/skills/food-order/SKILL.md +48 -0
  1625. package/skills/gemini/SKILL.md +43 -0
  1626. package/skills/ghostly-projects/SKILL.md +160 -0
  1627. package/skills/gifgrep/SKILL.md +79 -0
  1628. package/skills/github/SKILL.md +77 -0
  1629. package/skills/gog/SKILL.md +116 -0
  1630. package/skills/goplaces/SKILL.md +52 -0
  1631. package/skills/healthcheck/SKILL.md +245 -0
  1632. package/skills/himalaya/SKILL.md +257 -0
  1633. package/skills/himalaya/references/configuration.md +184 -0
  1634. package/skills/himalaya/references/message-composition.md +199 -0
  1635. package/skills/imsg/SKILL.md +74 -0
  1636. package/skills/linear/SKILL.md +111 -0
  1637. package/skills/linear/linear.sh +204 -0
  1638. package/skills/local-places/SERVER_README.md +101 -0
  1639. package/skills/local-places/SKILL.md +102 -0
  1640. package/skills/local-places/pyproject.toml +21 -0
  1641. package/skills/local-places/src/local_places/__init__.py +2 -0
  1642. package/skills/local-places/src/local_places/google_places.py +314 -0
  1643. package/skills/local-places/src/local_places/main.py +65 -0
  1644. package/skills/local-places/src/local_places/schemas.py +107 -0
  1645. package/skills/mcporter/SKILL.md +61 -0
  1646. package/skills/model-usage/SKILL.md +69 -0
  1647. package/skills/model-usage/references/codexbar-cli.md +33 -0
  1648. package/skills/model-usage/scripts/model_usage.py +310 -0
  1649. package/skills/nano-banana-pro/SKILL.md +58 -0
  1650. package/skills/nano-banana-pro/scripts/generate_image.py +184 -0
  1651. package/skills/nano-pdf/SKILL.md +38 -0
  1652. package/skills/notion/SKILL.md +172 -0
  1653. package/skills/obsidian/SKILL.md +81 -0
  1654. package/skills/openai-image-gen/SKILL.md +89 -0
  1655. package/skills/openai-image-gen/scripts/gen.py +240 -0
  1656. package/skills/openai-whisper/SKILL.md +38 -0
  1657. package/skills/openai-whisper-api/SKILL.md +52 -0
  1658. package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
  1659. package/skills/openhue/SKILL.md +51 -0
  1660. package/skills/oracle/SKILL.md +125 -0
  1661. package/skills/ordercli/SKILL.md +78 -0
  1662. package/skills/peekaboo/SKILL.md +190 -0
  1663. package/skills/sag/SKILL.md +87 -0
  1664. package/skills/session-logs/SKILL.md +115 -0
  1665. package/skills/sherpa-onnx-tts/SKILL.md +103 -0
  1666. package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
  1667. package/skills/skill-creator/SKILL.md +370 -0
  1668. package/skills/skill-creator/license.txt +202 -0
  1669. package/skills/skill-creator/scripts/init_skill.py +378 -0
  1670. package/skills/skill-creator/scripts/package_skill.py +111 -0
  1671. package/skills/skill-creator/scripts/quick_validate.py +101 -0
  1672. package/skills/slack/SKILL.md +144 -0
  1673. package/skills/songsee/SKILL.md +49 -0
  1674. package/skills/sonoscli/SKILL.md +46 -0
  1675. package/skills/spotify-player/SKILL.md +64 -0
  1676. package/skills/summarize/SKILL.md +87 -0
  1677. package/skills/things-mac/SKILL.md +86 -0
  1678. package/skills/tmux/SKILL.md +135 -0
  1679. package/skills/tmux/scripts/find-sessions.sh +112 -0
  1680. package/skills/tmux/scripts/wait-for-text.sh +83 -0
  1681. package/skills/trello/SKILL.md +95 -0
  1682. package/skills/video-frames/SKILL.md +46 -0
  1683. package/skills/video-frames/scripts/frame.sh +81 -0
  1684. package/skills/voice-call/SKILL.md +45 -0
  1685. package/skills/wacli/SKILL.md +72 -0
  1686. package/skills/weather/SKILL.md +54 -0
@@ -0,0 +1,2342 @@
1
+ import type { IncomingMessage, ServerResponse } from "node:http";
2
+ import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk";
3
+ import { EventEmitter } from "node:events";
4
+ import { removeAckReactionAfterReply, shouldAckReaction } from "openclaw/plugin-sdk";
5
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
6
+ import type { ResolvedBlueBubblesAccount } from "./accounts.js";
7
+ import {
8
+ handleBlueBubblesWebhookRequest,
9
+ registerBlueBubblesWebhookTarget,
10
+ resolveBlueBubblesMessageId,
11
+ _resetBlueBubblesShortIdState,
12
+ } from "./monitor.js";
13
+ import { setBlueBubblesRuntime } from "./runtime.js";
14
+
15
+ // Mock dependencies
16
+ vi.mock("./send.js", () => ({
17
+ resolveChatGuidForTarget: vi.fn().mockResolvedValue("iMessage;-;+15551234567"),
18
+ sendMessageBlueBubbles: vi.fn().mockResolvedValue({ messageId: "msg-123" }),
19
+ }));
20
+
21
+ vi.mock("./chat.js", () => ({
22
+ markBlueBubblesChatRead: vi.fn().mockResolvedValue(undefined),
23
+ sendBlueBubblesTyping: vi.fn().mockResolvedValue(undefined),
24
+ }));
25
+
26
+ vi.mock("./attachments.js", () => ({
27
+ downloadBlueBubblesAttachment: vi.fn().mockResolvedValue({
28
+ buffer: Buffer.from("test"),
29
+ contentType: "image/jpeg",
30
+ }),
31
+ }));
32
+
33
+ vi.mock("./reactions.js", async () => {
34
+ const actual = await vi.importActual<typeof import("./reactions.js")>("./reactions.js");
35
+ return {
36
+ ...actual,
37
+ sendBlueBubblesReaction: vi.fn().mockResolvedValue(undefined),
38
+ };
39
+ });
40
+
41
+ // Mock runtime
42
+ const mockEnqueueSystemEvent = vi.fn();
43
+ const mockBuildPairingReply = vi.fn(() => "Pairing code: TESTCODE");
44
+ const mockReadAllowFromStore = vi.fn().mockResolvedValue([]);
45
+ const mockUpsertPairingRequest = vi.fn().mockResolvedValue({ code: "TESTCODE", created: true });
46
+ const mockResolveAgentRoute = vi.fn(() => ({
47
+ agentId: "main",
48
+ accountId: "default",
49
+ sessionKey: "agent:main:bluebubbles:dm:+15551234567",
50
+ }));
51
+ const mockBuildMentionRegexes = vi.fn(() => [/\bbert\b/i]);
52
+ const mockMatchesMentionPatterns = vi.fn((text: string, regexes: RegExp[]) =>
53
+ regexes.some((r) => r.test(text)),
54
+ );
55
+ const mockResolveRequireMention = vi.fn(() => false);
56
+ const mockResolveGroupPolicy = vi.fn(() => "open");
57
+ const mockDispatchReplyWithBufferedBlockDispatcher = vi.fn(async () => undefined);
58
+ const mockHasControlCommand = vi.fn(() => false);
59
+ const mockResolveCommandAuthorizedFromAuthorizers = vi.fn(() => false);
60
+ const mockSaveMediaBuffer = vi.fn().mockResolvedValue({
61
+ path: "/tmp/test-media.jpg",
62
+ contentType: "image/jpeg",
63
+ });
64
+ const mockResolveStorePath = vi.fn(() => "/tmp/sessions.json");
65
+ const mockReadSessionUpdatedAt = vi.fn(() => undefined);
66
+ const mockResolveEnvelopeFormatOptions = vi.fn(() => ({
67
+ template: "channel+name+time",
68
+ }));
69
+ const mockFormatAgentEnvelope = vi.fn((opts: { body: string }) => opts.body);
70
+ const mockChunkMarkdownText = vi.fn((text: string) => [text]);
71
+
72
+ function createMockRuntime(): PluginRuntime {
73
+ return {
74
+ version: "1.0.0",
75
+ config: {
76
+ loadConfig: vi.fn(() => ({})) as unknown as PluginRuntime["config"]["loadConfig"],
77
+ writeConfigFile: vi.fn() as unknown as PluginRuntime["config"]["writeConfigFile"],
78
+ },
79
+ system: {
80
+ enqueueSystemEvent:
81
+ mockEnqueueSystemEvent as unknown as PluginRuntime["system"]["enqueueSystemEvent"],
82
+ runCommandWithTimeout: vi.fn() as unknown as PluginRuntime["system"]["runCommandWithTimeout"],
83
+ },
84
+ media: {
85
+ loadWebMedia: vi.fn() as unknown as PluginRuntime["media"]["loadWebMedia"],
86
+ detectMime: vi.fn() as unknown as PluginRuntime["media"]["detectMime"],
87
+ mediaKindFromMime: vi.fn() as unknown as PluginRuntime["media"]["mediaKindFromMime"],
88
+ isVoiceCompatibleAudio:
89
+ vi.fn() as unknown as PluginRuntime["media"]["isVoiceCompatibleAudio"],
90
+ getImageMetadata: vi.fn() as unknown as PluginRuntime["media"]["getImageMetadata"],
91
+ resizeToJpeg: vi.fn() as unknown as PluginRuntime["media"]["resizeToJpeg"],
92
+ },
93
+ tools: {
94
+ createMemoryGetTool: vi.fn() as unknown as PluginRuntime["tools"]["createMemoryGetTool"],
95
+ createMemorySearchTool:
96
+ vi.fn() as unknown as PluginRuntime["tools"]["createMemorySearchTool"],
97
+ registerMemoryCli: vi.fn() as unknown as PluginRuntime["tools"]["registerMemoryCli"],
98
+ },
99
+ channel: {
100
+ text: {
101
+ chunkMarkdownText:
102
+ mockChunkMarkdownText as unknown as PluginRuntime["channel"]["text"]["chunkMarkdownText"],
103
+ chunkText: vi.fn() as unknown as PluginRuntime["channel"]["text"]["chunkText"],
104
+ resolveTextChunkLimit: vi.fn(
105
+ () => 4000,
106
+ ) as unknown as PluginRuntime["channel"]["text"]["resolveTextChunkLimit"],
107
+ hasControlCommand:
108
+ mockHasControlCommand as unknown as PluginRuntime["channel"]["text"]["hasControlCommand"],
109
+ resolveMarkdownTableMode: vi.fn(
110
+ () => "code",
111
+ ) as unknown as PluginRuntime["channel"]["text"]["resolveMarkdownTableMode"],
112
+ convertMarkdownTables: vi.fn(
113
+ (text: string) => text,
114
+ ) as unknown as PluginRuntime["channel"]["text"]["convertMarkdownTables"],
115
+ },
116
+ reply: {
117
+ dispatchReplyWithBufferedBlockDispatcher:
118
+ mockDispatchReplyWithBufferedBlockDispatcher as unknown as PluginRuntime["channel"]["reply"]["dispatchReplyWithBufferedBlockDispatcher"],
119
+ createReplyDispatcherWithTyping:
120
+ vi.fn() as unknown as PluginRuntime["channel"]["reply"]["createReplyDispatcherWithTyping"],
121
+ resolveEffectiveMessagesConfig:
122
+ vi.fn() as unknown as PluginRuntime["channel"]["reply"]["resolveEffectiveMessagesConfig"],
123
+ resolveHumanDelayConfig:
124
+ vi.fn() as unknown as PluginRuntime["channel"]["reply"]["resolveHumanDelayConfig"],
125
+ dispatchReplyFromConfig:
126
+ vi.fn() as unknown as PluginRuntime["channel"]["reply"]["dispatchReplyFromConfig"],
127
+ finalizeInboundContext:
128
+ vi.fn() as unknown as PluginRuntime["channel"]["reply"]["finalizeInboundContext"],
129
+ formatAgentEnvelope:
130
+ mockFormatAgentEnvelope as unknown as PluginRuntime["channel"]["reply"]["formatAgentEnvelope"],
131
+ formatInboundEnvelope:
132
+ vi.fn() as unknown as PluginRuntime["channel"]["reply"]["formatInboundEnvelope"],
133
+ resolveEnvelopeFormatOptions:
134
+ mockResolveEnvelopeFormatOptions as unknown as PluginRuntime["channel"]["reply"]["resolveEnvelopeFormatOptions"],
135
+ },
136
+ routing: {
137
+ resolveAgentRoute:
138
+ mockResolveAgentRoute as unknown as PluginRuntime["channel"]["routing"]["resolveAgentRoute"],
139
+ },
140
+ pairing: {
141
+ buildPairingReply:
142
+ mockBuildPairingReply as unknown as PluginRuntime["channel"]["pairing"]["buildPairingReply"],
143
+ readAllowFromStore:
144
+ mockReadAllowFromStore as unknown as PluginRuntime["channel"]["pairing"]["readAllowFromStore"],
145
+ upsertPairingRequest:
146
+ mockUpsertPairingRequest as unknown as PluginRuntime["channel"]["pairing"]["upsertPairingRequest"],
147
+ },
148
+ media: {
149
+ fetchRemoteMedia:
150
+ vi.fn() as unknown as PluginRuntime["channel"]["media"]["fetchRemoteMedia"],
151
+ saveMediaBuffer:
152
+ mockSaveMediaBuffer as unknown as PluginRuntime["channel"]["media"]["saveMediaBuffer"],
153
+ },
154
+ session: {
155
+ resolveStorePath:
156
+ mockResolveStorePath as unknown as PluginRuntime["channel"]["session"]["resolveStorePath"],
157
+ readSessionUpdatedAt:
158
+ mockReadSessionUpdatedAt as unknown as PluginRuntime["channel"]["session"]["readSessionUpdatedAt"],
159
+ recordInboundSession:
160
+ vi.fn() as unknown as PluginRuntime["channel"]["session"]["recordInboundSession"],
161
+ recordSessionMetaFromInbound:
162
+ vi.fn() as unknown as PluginRuntime["channel"]["session"]["recordSessionMetaFromInbound"],
163
+ updateLastRoute:
164
+ vi.fn() as unknown as PluginRuntime["channel"]["session"]["updateLastRoute"],
165
+ },
166
+ mentions: {
167
+ buildMentionRegexes:
168
+ mockBuildMentionRegexes as unknown as PluginRuntime["channel"]["mentions"]["buildMentionRegexes"],
169
+ matchesMentionPatterns:
170
+ mockMatchesMentionPatterns as unknown as PluginRuntime["channel"]["mentions"]["matchesMentionPatterns"],
171
+ },
172
+ reactions: {
173
+ shouldAckReaction,
174
+ removeAckReactionAfterReply,
175
+ },
176
+ groups: {
177
+ resolveGroupPolicy:
178
+ mockResolveGroupPolicy as unknown as PluginRuntime["channel"]["groups"]["resolveGroupPolicy"],
179
+ resolveRequireMention:
180
+ mockResolveRequireMention as unknown as PluginRuntime["channel"]["groups"]["resolveRequireMention"],
181
+ },
182
+ debounce: {
183
+ // Create a pass-through debouncer that immediately calls onFlush
184
+ createInboundDebouncer: vi.fn(
185
+ (params: { onFlush: (items: unknown[]) => Promise<void> }) => ({
186
+ enqueue: async (item: unknown) => {
187
+ await params.onFlush([item]);
188
+ },
189
+ flushKey: vi.fn(),
190
+ }),
191
+ ) as unknown as PluginRuntime["channel"]["debounce"]["createInboundDebouncer"],
192
+ resolveInboundDebounceMs: vi.fn(
193
+ () => 0,
194
+ ) as unknown as PluginRuntime["channel"]["debounce"]["resolveInboundDebounceMs"],
195
+ },
196
+ commands: {
197
+ resolveCommandAuthorizedFromAuthorizers:
198
+ mockResolveCommandAuthorizedFromAuthorizers as unknown as PluginRuntime["channel"]["commands"]["resolveCommandAuthorizedFromAuthorizers"],
199
+ isControlCommandMessage:
200
+ vi.fn() as unknown as PluginRuntime["channel"]["commands"]["isControlCommandMessage"],
201
+ shouldComputeCommandAuthorized:
202
+ vi.fn() as unknown as PluginRuntime["channel"]["commands"]["shouldComputeCommandAuthorized"],
203
+ shouldHandleTextCommands:
204
+ vi.fn() as unknown as PluginRuntime["channel"]["commands"]["shouldHandleTextCommands"],
205
+ },
206
+ discord: {} as PluginRuntime["channel"]["discord"],
207
+ slack: {} as PluginRuntime["channel"]["slack"],
208
+ telegram: {} as PluginRuntime["channel"]["telegram"],
209
+ signal: {} as PluginRuntime["channel"]["signal"],
210
+ imessage: {} as PluginRuntime["channel"]["imessage"],
211
+ whatsapp: {} as PluginRuntime["channel"]["whatsapp"],
212
+ },
213
+ logging: {
214
+ shouldLogVerbose: vi.fn(
215
+ () => false,
216
+ ) as unknown as PluginRuntime["logging"]["shouldLogVerbose"],
217
+ getChildLogger: vi.fn(() => ({
218
+ info: vi.fn(),
219
+ warn: vi.fn(),
220
+ error: vi.fn(),
221
+ debug: vi.fn(),
222
+ })) as unknown as PluginRuntime["logging"]["getChildLogger"],
223
+ },
224
+ state: {
225
+ resolveStateDir: vi.fn(
226
+ () => "/tmp/openclaw",
227
+ ) as unknown as PluginRuntime["state"]["resolveStateDir"],
228
+ },
229
+ };
230
+ }
231
+
232
+ function createMockAccount(
233
+ overrides: Partial<ResolvedBlueBubblesAccount["config"]> = {},
234
+ ): ResolvedBlueBubblesAccount {
235
+ return {
236
+ accountId: "default",
237
+ enabled: true,
238
+ configured: true,
239
+ config: {
240
+ serverUrl: "http://localhost:1234",
241
+ password: "test-password",
242
+ dmPolicy: "open",
243
+ groupPolicy: "open",
244
+ allowFrom: [],
245
+ groupAllowFrom: [],
246
+ ...overrides,
247
+ },
248
+ };
249
+ }
250
+
251
+ function createMockRequest(
252
+ method: string,
253
+ url: string,
254
+ body: unknown,
255
+ headers: Record<string, string> = {},
256
+ ): IncomingMessage {
257
+ const req = new EventEmitter() as IncomingMessage;
258
+ req.method = method;
259
+ req.url = url;
260
+ req.headers = headers;
261
+ (req as unknown as { socket: { remoteAddress: string } }).socket = { remoteAddress: "127.0.0.1" };
262
+
263
+ // Emit body data after a microtask
264
+ // oxlint-disable-next-line no-floating-promises
265
+ Promise.resolve().then(() => {
266
+ const bodyStr = typeof body === "string" ? body : JSON.stringify(body);
267
+ req.emit("data", Buffer.from(bodyStr));
268
+ req.emit("end");
269
+ });
270
+
271
+ return req;
272
+ }
273
+
274
+ function createMockResponse(): ServerResponse & { body: string; statusCode: number } {
275
+ const res = {
276
+ statusCode: 200,
277
+ body: "",
278
+ setHeader: vi.fn(),
279
+ end: vi.fn((data?: string) => {
280
+ res.body = data ?? "";
281
+ }),
282
+ } as unknown as ServerResponse & { body: string; statusCode: number };
283
+ return res;
284
+ }
285
+
286
+ const flushAsync = async () => {
287
+ for (let i = 0; i < 2; i += 1) {
288
+ await new Promise<void>((resolve) => setImmediate(resolve));
289
+ }
290
+ };
291
+
292
+ describe("BlueBubbles webhook monitor", () => {
293
+ let unregister: () => void;
294
+
295
+ beforeEach(() => {
296
+ vi.clearAllMocks();
297
+ // Reset short ID state between tests for predictable behavior
298
+ _resetBlueBubblesShortIdState();
299
+ mockReadAllowFromStore.mockResolvedValue([]);
300
+ mockUpsertPairingRequest.mockResolvedValue({ code: "TESTCODE", created: true });
301
+ mockResolveRequireMention.mockReturnValue(false);
302
+ mockHasControlCommand.mockReturnValue(false);
303
+ mockResolveCommandAuthorizedFromAuthorizers.mockReturnValue(false);
304
+ mockBuildMentionRegexes.mockReturnValue([/\bbert\b/i]);
305
+
306
+ setBlueBubblesRuntime(createMockRuntime());
307
+ });
308
+
309
+ afterEach(() => {
310
+ unregister?.();
311
+ });
312
+
313
+ describe("webhook parsing + auth handling", () => {
314
+ it("rejects non-POST requests", async () => {
315
+ const account = createMockAccount();
316
+ const config: OpenClawConfig = {};
317
+ const core = createMockRuntime();
318
+ setBlueBubblesRuntime(core);
319
+
320
+ unregister = registerBlueBubblesWebhookTarget({
321
+ account,
322
+ config,
323
+ runtime: { log: vi.fn(), error: vi.fn() },
324
+ core,
325
+ path: "/bluebubbles-webhook",
326
+ });
327
+
328
+ const req = createMockRequest("GET", "/bluebubbles-webhook", {});
329
+ const res = createMockResponse();
330
+
331
+ const handled = await handleBlueBubblesWebhookRequest(req, res);
332
+
333
+ expect(handled).toBe(true);
334
+ expect(res.statusCode).toBe(405);
335
+ });
336
+
337
+ it("accepts POST requests with valid JSON payload", async () => {
338
+ const account = createMockAccount();
339
+ const config: OpenClawConfig = {};
340
+ const core = createMockRuntime();
341
+ setBlueBubblesRuntime(core);
342
+
343
+ unregister = registerBlueBubblesWebhookTarget({
344
+ account,
345
+ config,
346
+ runtime: { log: vi.fn(), error: vi.fn() },
347
+ core,
348
+ path: "/bluebubbles-webhook",
349
+ });
350
+
351
+ const payload = {
352
+ type: "new-message",
353
+ data: {
354
+ text: "hello",
355
+ handle: { address: "+15551234567" },
356
+ isGroup: false,
357
+ isFromMe: false,
358
+ guid: "msg-1",
359
+ date: Date.now(),
360
+ },
361
+ };
362
+
363
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
364
+ const res = createMockResponse();
365
+
366
+ const handled = await handleBlueBubblesWebhookRequest(req, res);
367
+
368
+ expect(handled).toBe(true);
369
+ expect(res.statusCode).toBe(200);
370
+ expect(res.body).toBe("ok");
371
+ });
372
+
373
+ it("rejects requests with invalid JSON", async () => {
374
+ const account = createMockAccount();
375
+ const config: OpenClawConfig = {};
376
+ const core = createMockRuntime();
377
+ setBlueBubblesRuntime(core);
378
+
379
+ unregister = registerBlueBubblesWebhookTarget({
380
+ account,
381
+ config,
382
+ runtime: { log: vi.fn(), error: vi.fn() },
383
+ core,
384
+ path: "/bluebubbles-webhook",
385
+ });
386
+
387
+ const req = createMockRequest("POST", "/bluebubbles-webhook", "invalid json {{");
388
+ const res = createMockResponse();
389
+
390
+ const handled = await handleBlueBubblesWebhookRequest(req, res);
391
+
392
+ expect(handled).toBe(true);
393
+ expect(res.statusCode).toBe(400);
394
+ });
395
+
396
+ it("authenticates via password query parameter", async () => {
397
+ const account = createMockAccount({ password: "secret-token" });
398
+ const config: OpenClawConfig = {};
399
+ const core = createMockRuntime();
400
+ setBlueBubblesRuntime(core);
401
+
402
+ // Mock non-localhost request
403
+ const req = createMockRequest("POST", "/bluebubbles-webhook?password=secret-token", {
404
+ type: "new-message",
405
+ data: {
406
+ text: "hello",
407
+ handle: { address: "+15551234567" },
408
+ isGroup: false,
409
+ isFromMe: false,
410
+ guid: "msg-1",
411
+ },
412
+ });
413
+ (req as unknown as { socket: { remoteAddress: string } }).socket = {
414
+ remoteAddress: "192.168.1.100",
415
+ };
416
+
417
+ unregister = registerBlueBubblesWebhookTarget({
418
+ account,
419
+ config,
420
+ runtime: { log: vi.fn(), error: vi.fn() },
421
+ core,
422
+ path: "/bluebubbles-webhook",
423
+ });
424
+
425
+ const res = createMockResponse();
426
+ const handled = await handleBlueBubblesWebhookRequest(req, res);
427
+
428
+ expect(handled).toBe(true);
429
+ expect(res.statusCode).toBe(200);
430
+ });
431
+
432
+ it("authenticates via x-password header", async () => {
433
+ const account = createMockAccount({ password: "secret-token" });
434
+ const config: OpenClawConfig = {};
435
+ const core = createMockRuntime();
436
+ setBlueBubblesRuntime(core);
437
+
438
+ const req = createMockRequest(
439
+ "POST",
440
+ "/bluebubbles-webhook",
441
+ {
442
+ type: "new-message",
443
+ data: {
444
+ text: "hello",
445
+ handle: { address: "+15551234567" },
446
+ isGroup: false,
447
+ isFromMe: false,
448
+ guid: "msg-1",
449
+ },
450
+ },
451
+ { "x-password": "secret-token" },
452
+ );
453
+ (req as unknown as { socket: { remoteAddress: string } }).socket = {
454
+ remoteAddress: "192.168.1.100",
455
+ };
456
+
457
+ unregister = registerBlueBubblesWebhookTarget({
458
+ account,
459
+ config,
460
+ runtime: { log: vi.fn(), error: vi.fn() },
461
+ core,
462
+ path: "/bluebubbles-webhook",
463
+ });
464
+
465
+ const res = createMockResponse();
466
+ const handled = await handleBlueBubblesWebhookRequest(req, res);
467
+
468
+ expect(handled).toBe(true);
469
+ expect(res.statusCode).toBe(200);
470
+ });
471
+
472
+ it("rejects unauthorized requests with wrong password", async () => {
473
+ const account = createMockAccount({ password: "secret-token" });
474
+ const config: OpenClawConfig = {};
475
+ const core = createMockRuntime();
476
+ setBlueBubblesRuntime(core);
477
+
478
+ const req = createMockRequest("POST", "/bluebubbles-webhook?password=wrong-token", {
479
+ type: "new-message",
480
+ data: {
481
+ text: "hello",
482
+ handle: { address: "+15551234567" },
483
+ isGroup: false,
484
+ isFromMe: false,
485
+ guid: "msg-1",
486
+ },
487
+ });
488
+ (req as unknown as { socket: { remoteAddress: string } }).socket = {
489
+ remoteAddress: "192.168.1.100",
490
+ };
491
+
492
+ unregister = registerBlueBubblesWebhookTarget({
493
+ account,
494
+ config,
495
+ runtime: { log: vi.fn(), error: vi.fn() },
496
+ core,
497
+ path: "/bluebubbles-webhook",
498
+ });
499
+
500
+ const res = createMockResponse();
501
+ const handled = await handleBlueBubblesWebhookRequest(req, res);
502
+
503
+ expect(handled).toBe(true);
504
+ expect(res.statusCode).toBe(401);
505
+ });
506
+
507
+ it("allows localhost requests without authentication", async () => {
508
+ const account = createMockAccount({ password: "secret-token" });
509
+ const config: OpenClawConfig = {};
510
+ const core = createMockRuntime();
511
+ setBlueBubblesRuntime(core);
512
+
513
+ const req = createMockRequest("POST", "/bluebubbles-webhook", {
514
+ type: "new-message",
515
+ data: {
516
+ text: "hello",
517
+ handle: { address: "+15551234567" },
518
+ isGroup: false,
519
+ isFromMe: false,
520
+ guid: "msg-1",
521
+ },
522
+ });
523
+ // Localhost address
524
+ (req as unknown as { socket: { remoteAddress: string } }).socket = {
525
+ remoteAddress: "127.0.0.1",
526
+ };
527
+
528
+ unregister = registerBlueBubblesWebhookTarget({
529
+ account,
530
+ config,
531
+ runtime: { log: vi.fn(), error: vi.fn() },
532
+ core,
533
+ path: "/bluebubbles-webhook",
534
+ });
535
+
536
+ const res = createMockResponse();
537
+ const handled = await handleBlueBubblesWebhookRequest(req, res);
538
+
539
+ expect(handled).toBe(true);
540
+ expect(res.statusCode).toBe(200);
541
+ });
542
+
543
+ it("ignores unregistered webhook paths", async () => {
544
+ const req = createMockRequest("POST", "/unregistered-path", {});
545
+ const res = createMockResponse();
546
+
547
+ const handled = await handleBlueBubblesWebhookRequest(req, res);
548
+
549
+ expect(handled).toBe(false);
550
+ });
551
+
552
+ it("parses chatId when provided as a string (webhook variant)", async () => {
553
+ const { resolveChatGuidForTarget } = await import("./send.js");
554
+ vi.mocked(resolveChatGuidForTarget).mockClear();
555
+
556
+ const account = createMockAccount({ groupPolicy: "open" });
557
+ const config: OpenClawConfig = {};
558
+ const core = createMockRuntime();
559
+ setBlueBubblesRuntime(core);
560
+
561
+ unregister = registerBlueBubblesWebhookTarget({
562
+ account,
563
+ config,
564
+ runtime: { log: vi.fn(), error: vi.fn() },
565
+ core,
566
+ path: "/bluebubbles-webhook",
567
+ });
568
+
569
+ const payload = {
570
+ type: "new-message",
571
+ data: {
572
+ text: "hello from group",
573
+ handle: { address: "+15551234567" },
574
+ isGroup: true,
575
+ isFromMe: false,
576
+ guid: "msg-1",
577
+ chatId: "123",
578
+ date: Date.now(),
579
+ },
580
+ };
581
+
582
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
583
+ const res = createMockResponse();
584
+
585
+ await handleBlueBubblesWebhookRequest(req, res);
586
+ await flushAsync();
587
+
588
+ expect(resolveChatGuidForTarget).toHaveBeenCalledWith(
589
+ expect.objectContaining({
590
+ target: { kind: "chat_id", chatId: 123 },
591
+ }),
592
+ );
593
+ });
594
+
595
+ it("extracts chatGuid from nested chat object fields (webhook variant)", async () => {
596
+ const { sendMessageBlueBubbles, resolveChatGuidForTarget } = await import("./send.js");
597
+ vi.mocked(sendMessageBlueBubbles).mockClear();
598
+ vi.mocked(resolveChatGuidForTarget).mockClear();
599
+
600
+ mockDispatchReplyWithBufferedBlockDispatcher.mockImplementationOnce(async (params) => {
601
+ await params.dispatcherOptions.deliver({ text: "replying now" }, { kind: "final" });
602
+ });
603
+
604
+ const account = createMockAccount({ groupPolicy: "open" });
605
+ const config: OpenClawConfig = {};
606
+ const core = createMockRuntime();
607
+ setBlueBubblesRuntime(core);
608
+
609
+ unregister = registerBlueBubblesWebhookTarget({
610
+ account,
611
+ config,
612
+ runtime: { log: vi.fn(), error: vi.fn() },
613
+ core,
614
+ path: "/bluebubbles-webhook",
615
+ });
616
+
617
+ const payload = {
618
+ type: "new-message",
619
+ data: {
620
+ text: "hello from group",
621
+ handle: { address: "+15551234567" },
622
+ isGroup: true,
623
+ isFromMe: false,
624
+ guid: "msg-1",
625
+ chat: { chatGuid: "iMessage;+;chat123456" },
626
+ date: Date.now(),
627
+ },
628
+ };
629
+
630
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
631
+ const res = createMockResponse();
632
+
633
+ await handleBlueBubblesWebhookRequest(req, res);
634
+ await flushAsync();
635
+
636
+ expect(resolveChatGuidForTarget).not.toHaveBeenCalled();
637
+ expect(sendMessageBlueBubbles).toHaveBeenCalledWith(
638
+ "chat_guid:iMessage;+;chat123456",
639
+ expect.any(String),
640
+ expect.any(Object),
641
+ );
642
+ });
643
+ });
644
+
645
+ describe("DM pairing behavior vs allowFrom", () => {
646
+ it("allows DM from sender in allowFrom list", async () => {
647
+ const account = createMockAccount({
648
+ dmPolicy: "allowlist",
649
+ allowFrom: ["+15551234567"],
650
+ });
651
+ const config: OpenClawConfig = {};
652
+ const core = createMockRuntime();
653
+ setBlueBubblesRuntime(core);
654
+
655
+ unregister = registerBlueBubblesWebhookTarget({
656
+ account,
657
+ config,
658
+ runtime: { log: vi.fn(), error: vi.fn() },
659
+ core,
660
+ path: "/bluebubbles-webhook",
661
+ });
662
+
663
+ const payload = {
664
+ type: "new-message",
665
+ data: {
666
+ text: "hello from allowed sender",
667
+ handle: { address: "+15551234567" },
668
+ isGroup: false,
669
+ isFromMe: false,
670
+ guid: "msg-1",
671
+ date: Date.now(),
672
+ },
673
+ };
674
+
675
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
676
+ const res = createMockResponse();
677
+
678
+ await handleBlueBubblesWebhookRequest(req, res);
679
+
680
+ // Wait for async processing
681
+ await flushAsync();
682
+
683
+ expect(res.statusCode).toBe(200);
684
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
685
+ });
686
+
687
+ it("blocks DM from sender not in allowFrom when dmPolicy=allowlist", async () => {
688
+ const account = createMockAccount({
689
+ dmPolicy: "allowlist",
690
+ allowFrom: ["+15559999999"], // Different number
691
+ });
692
+ const config: OpenClawConfig = {};
693
+ const core = createMockRuntime();
694
+ setBlueBubblesRuntime(core);
695
+
696
+ unregister = registerBlueBubblesWebhookTarget({
697
+ account,
698
+ config,
699
+ runtime: { log: vi.fn(), error: vi.fn() },
700
+ core,
701
+ path: "/bluebubbles-webhook",
702
+ });
703
+
704
+ const payload = {
705
+ type: "new-message",
706
+ data: {
707
+ text: "hello from blocked sender",
708
+ handle: { address: "+15551234567" },
709
+ isGroup: false,
710
+ isFromMe: false,
711
+ guid: "msg-1",
712
+ date: Date.now(),
713
+ },
714
+ };
715
+
716
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
717
+ const res = createMockResponse();
718
+
719
+ await handleBlueBubblesWebhookRequest(req, res);
720
+ await flushAsync();
721
+
722
+ expect(res.statusCode).toBe(200);
723
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
724
+ });
725
+
726
+ it("triggers pairing flow for unknown sender when dmPolicy=pairing", async () => {
727
+ // Note: empty allowFrom = allow all. To trigger pairing, we need a non-empty
728
+ // allowlist that doesn't include the sender
729
+ const account = createMockAccount({
730
+ dmPolicy: "pairing",
731
+ allowFrom: ["+15559999999"], // Different number than sender
732
+ });
733
+ const config: OpenClawConfig = {};
734
+ const core = createMockRuntime();
735
+ setBlueBubblesRuntime(core);
736
+
737
+ unregister = registerBlueBubblesWebhookTarget({
738
+ account,
739
+ config,
740
+ runtime: { log: vi.fn(), error: vi.fn() },
741
+ core,
742
+ path: "/bluebubbles-webhook",
743
+ });
744
+
745
+ const payload = {
746
+ type: "new-message",
747
+ data: {
748
+ text: "hello",
749
+ handle: { address: "+15551234567" },
750
+ isGroup: false,
751
+ isFromMe: false,
752
+ guid: "msg-1",
753
+ date: Date.now(),
754
+ },
755
+ };
756
+
757
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
758
+ const res = createMockResponse();
759
+
760
+ await handleBlueBubblesWebhookRequest(req, res);
761
+ await flushAsync();
762
+
763
+ expect(mockUpsertPairingRequest).toHaveBeenCalled();
764
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
765
+ });
766
+
767
+ it("does not resend pairing reply when request already exists", async () => {
768
+ mockUpsertPairingRequest.mockResolvedValue({ code: "TESTCODE", created: false });
769
+
770
+ // Note: empty allowFrom = allow all. To trigger pairing, we need a non-empty
771
+ // allowlist that doesn't include the sender
772
+ const account = createMockAccount({
773
+ dmPolicy: "pairing",
774
+ allowFrom: ["+15559999999"], // Different number than sender
775
+ });
776
+ const config: OpenClawConfig = {};
777
+ const core = createMockRuntime();
778
+ setBlueBubblesRuntime(core);
779
+
780
+ unregister = registerBlueBubblesWebhookTarget({
781
+ account,
782
+ config,
783
+ runtime: { log: vi.fn(), error: vi.fn() },
784
+ core,
785
+ path: "/bluebubbles-webhook",
786
+ });
787
+
788
+ const payload = {
789
+ type: "new-message",
790
+ data: {
791
+ text: "hello again",
792
+ handle: { address: "+15551234567" },
793
+ isGroup: false,
794
+ isFromMe: false,
795
+ guid: "msg-2",
796
+ date: Date.now(),
797
+ },
798
+ };
799
+
800
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
801
+ const res = createMockResponse();
802
+
803
+ await handleBlueBubblesWebhookRequest(req, res);
804
+ await flushAsync();
805
+
806
+ expect(mockUpsertPairingRequest).toHaveBeenCalled();
807
+ // Should not send pairing reply since created=false
808
+ const { sendMessageBlueBubbles } = await import("./send.js");
809
+ expect(sendMessageBlueBubbles).not.toHaveBeenCalled();
810
+ });
811
+
812
+ it("allows all DMs when dmPolicy=open", async () => {
813
+ const account = createMockAccount({
814
+ dmPolicy: "open",
815
+ allowFrom: [],
816
+ });
817
+ const config: OpenClawConfig = {};
818
+ const core = createMockRuntime();
819
+ setBlueBubblesRuntime(core);
820
+
821
+ unregister = registerBlueBubblesWebhookTarget({
822
+ account,
823
+ config,
824
+ runtime: { log: vi.fn(), error: vi.fn() },
825
+ core,
826
+ path: "/bluebubbles-webhook",
827
+ });
828
+
829
+ const payload = {
830
+ type: "new-message",
831
+ data: {
832
+ text: "hello from anyone",
833
+ handle: { address: "+15559999999" },
834
+ isGroup: false,
835
+ isFromMe: false,
836
+ guid: "msg-1",
837
+ date: Date.now(),
838
+ },
839
+ };
840
+
841
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
842
+ const res = createMockResponse();
843
+
844
+ await handleBlueBubblesWebhookRequest(req, res);
845
+ await flushAsync();
846
+
847
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
848
+ });
849
+
850
+ it("blocks all DMs when dmPolicy=disabled", async () => {
851
+ const account = createMockAccount({
852
+ dmPolicy: "disabled",
853
+ });
854
+ const config: OpenClawConfig = {};
855
+ const core = createMockRuntime();
856
+ setBlueBubblesRuntime(core);
857
+
858
+ unregister = registerBlueBubblesWebhookTarget({
859
+ account,
860
+ config,
861
+ runtime: { log: vi.fn(), error: vi.fn() },
862
+ core,
863
+ path: "/bluebubbles-webhook",
864
+ });
865
+
866
+ const payload = {
867
+ type: "new-message",
868
+ data: {
869
+ text: "hello",
870
+ handle: { address: "+15551234567" },
871
+ isGroup: false,
872
+ isFromMe: false,
873
+ guid: "msg-1",
874
+ date: Date.now(),
875
+ },
876
+ };
877
+
878
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
879
+ const res = createMockResponse();
880
+
881
+ await handleBlueBubblesWebhookRequest(req, res);
882
+ await flushAsync();
883
+
884
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
885
+ });
886
+ });
887
+
888
+ describe("group message gating", () => {
889
+ it("allows group messages when groupPolicy=open and no allowlist", async () => {
890
+ const account = createMockAccount({
891
+ groupPolicy: "open",
892
+ });
893
+ const config: OpenClawConfig = {};
894
+ const core = createMockRuntime();
895
+ setBlueBubblesRuntime(core);
896
+
897
+ unregister = registerBlueBubblesWebhookTarget({
898
+ account,
899
+ config,
900
+ runtime: { log: vi.fn(), error: vi.fn() },
901
+ core,
902
+ path: "/bluebubbles-webhook",
903
+ });
904
+
905
+ const payload = {
906
+ type: "new-message",
907
+ data: {
908
+ text: "hello from group",
909
+ handle: { address: "+15551234567" },
910
+ isGroup: true,
911
+ isFromMe: false,
912
+ guid: "msg-1",
913
+ chatGuid: "iMessage;+;chat123456",
914
+ date: Date.now(),
915
+ },
916
+ };
917
+
918
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
919
+ const res = createMockResponse();
920
+
921
+ await handleBlueBubblesWebhookRequest(req, res);
922
+ await flushAsync();
923
+
924
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
925
+ });
926
+
927
+ it("blocks group messages when groupPolicy=disabled", async () => {
928
+ const account = createMockAccount({
929
+ groupPolicy: "disabled",
930
+ });
931
+ const config: OpenClawConfig = {};
932
+ const core = createMockRuntime();
933
+ setBlueBubblesRuntime(core);
934
+
935
+ unregister = registerBlueBubblesWebhookTarget({
936
+ account,
937
+ config,
938
+ runtime: { log: vi.fn(), error: vi.fn() },
939
+ core,
940
+ path: "/bluebubbles-webhook",
941
+ });
942
+
943
+ const payload = {
944
+ type: "new-message",
945
+ data: {
946
+ text: "hello from group",
947
+ handle: { address: "+15551234567" },
948
+ isGroup: true,
949
+ isFromMe: false,
950
+ guid: "msg-1",
951
+ chatGuid: "iMessage;+;chat123456",
952
+ date: Date.now(),
953
+ },
954
+ };
955
+
956
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
957
+ const res = createMockResponse();
958
+
959
+ await handleBlueBubblesWebhookRequest(req, res);
960
+ await flushAsync();
961
+
962
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
963
+ });
964
+
965
+ it("treats chat_guid groups as group even when isGroup=false", async () => {
966
+ const account = createMockAccount({
967
+ groupPolicy: "allowlist",
968
+ dmPolicy: "open",
969
+ });
970
+ const config: OpenClawConfig = {};
971
+ const core = createMockRuntime();
972
+ setBlueBubblesRuntime(core);
973
+
974
+ unregister = registerBlueBubblesWebhookTarget({
975
+ account,
976
+ config,
977
+ runtime: { log: vi.fn(), error: vi.fn() },
978
+ core,
979
+ path: "/bluebubbles-webhook",
980
+ });
981
+
982
+ const payload = {
983
+ type: "new-message",
984
+ data: {
985
+ text: "hello from group",
986
+ handle: { address: "+15551234567" },
987
+ isGroup: false,
988
+ isFromMe: false,
989
+ guid: "msg-1",
990
+ chatGuid: "iMessage;+;chat123456",
991
+ date: Date.now(),
992
+ },
993
+ };
994
+
995
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
996
+ const res = createMockResponse();
997
+
998
+ await handleBlueBubblesWebhookRequest(req, res);
999
+ await flushAsync();
1000
+
1001
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
1002
+ });
1003
+
1004
+ it("allows group messages from allowed chat_guid in groupAllowFrom", async () => {
1005
+ const account = createMockAccount({
1006
+ groupPolicy: "allowlist",
1007
+ groupAllowFrom: ["chat_guid:iMessage;+;chat123456"],
1008
+ });
1009
+ const config: OpenClawConfig = {};
1010
+ const core = createMockRuntime();
1011
+ setBlueBubblesRuntime(core);
1012
+
1013
+ unregister = registerBlueBubblesWebhookTarget({
1014
+ account,
1015
+ config,
1016
+ runtime: { log: vi.fn(), error: vi.fn() },
1017
+ core,
1018
+ path: "/bluebubbles-webhook",
1019
+ });
1020
+
1021
+ const payload = {
1022
+ type: "new-message",
1023
+ data: {
1024
+ text: "hello from allowed group",
1025
+ handle: { address: "+15551234567" },
1026
+ isGroup: true,
1027
+ isFromMe: false,
1028
+ guid: "msg-1",
1029
+ chatGuid: "iMessage;+;chat123456",
1030
+ date: Date.now(),
1031
+ },
1032
+ };
1033
+
1034
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1035
+ const res = createMockResponse();
1036
+
1037
+ await handleBlueBubblesWebhookRequest(req, res);
1038
+ await flushAsync();
1039
+
1040
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
1041
+ });
1042
+ });
1043
+
1044
+ describe("mention gating (group messages)", () => {
1045
+ it("processes group message when mentioned and requireMention=true", async () => {
1046
+ mockResolveRequireMention.mockReturnValue(true);
1047
+ mockMatchesMentionPatterns.mockReturnValue(true);
1048
+
1049
+ const account = createMockAccount({ groupPolicy: "open" });
1050
+ const config: OpenClawConfig = {};
1051
+ const core = createMockRuntime();
1052
+ setBlueBubblesRuntime(core);
1053
+
1054
+ unregister = registerBlueBubblesWebhookTarget({
1055
+ account,
1056
+ config,
1057
+ runtime: { log: vi.fn(), error: vi.fn() },
1058
+ core,
1059
+ path: "/bluebubbles-webhook",
1060
+ });
1061
+
1062
+ const payload = {
1063
+ type: "new-message",
1064
+ data: {
1065
+ text: "bert, can you help me?",
1066
+ handle: { address: "+15551234567" },
1067
+ isGroup: true,
1068
+ isFromMe: false,
1069
+ guid: "msg-1",
1070
+ chatGuid: "iMessage;+;chat123456",
1071
+ date: Date.now(),
1072
+ },
1073
+ };
1074
+
1075
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1076
+ const res = createMockResponse();
1077
+
1078
+ await handleBlueBubblesWebhookRequest(req, res);
1079
+ await flushAsync();
1080
+
1081
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
1082
+ const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
1083
+ expect(callArgs.ctx.WasMentioned).toBe(true);
1084
+ });
1085
+
1086
+ it("skips group message when not mentioned and requireMention=true", async () => {
1087
+ mockResolveRequireMention.mockReturnValue(true);
1088
+ mockMatchesMentionPatterns.mockReturnValue(false);
1089
+
1090
+ const account = createMockAccount({ groupPolicy: "open" });
1091
+ const config: OpenClawConfig = {};
1092
+ const core = createMockRuntime();
1093
+ setBlueBubblesRuntime(core);
1094
+
1095
+ unregister = registerBlueBubblesWebhookTarget({
1096
+ account,
1097
+ config,
1098
+ runtime: { log: vi.fn(), error: vi.fn() },
1099
+ core,
1100
+ path: "/bluebubbles-webhook",
1101
+ });
1102
+
1103
+ const payload = {
1104
+ type: "new-message",
1105
+ data: {
1106
+ text: "hello everyone",
1107
+ handle: { address: "+15551234567" },
1108
+ isGroup: true,
1109
+ isFromMe: false,
1110
+ guid: "msg-1",
1111
+ chatGuid: "iMessage;+;chat123456",
1112
+ date: Date.now(),
1113
+ },
1114
+ };
1115
+
1116
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1117
+ const res = createMockResponse();
1118
+
1119
+ await handleBlueBubblesWebhookRequest(req, res);
1120
+ await flushAsync();
1121
+
1122
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
1123
+ });
1124
+
1125
+ it("processes group message without mention when requireMention=false", async () => {
1126
+ mockResolveRequireMention.mockReturnValue(false);
1127
+
1128
+ const account = createMockAccount({ groupPolicy: "open" });
1129
+ const config: OpenClawConfig = {};
1130
+ const core = createMockRuntime();
1131
+ setBlueBubblesRuntime(core);
1132
+
1133
+ unregister = registerBlueBubblesWebhookTarget({
1134
+ account,
1135
+ config,
1136
+ runtime: { log: vi.fn(), error: vi.fn() },
1137
+ core,
1138
+ path: "/bluebubbles-webhook",
1139
+ });
1140
+
1141
+ const payload = {
1142
+ type: "new-message",
1143
+ data: {
1144
+ text: "hello everyone",
1145
+ handle: { address: "+15551234567" },
1146
+ isGroup: true,
1147
+ isFromMe: false,
1148
+ guid: "msg-1",
1149
+ chatGuid: "iMessage;+;chat123456",
1150
+ date: Date.now(),
1151
+ },
1152
+ };
1153
+
1154
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1155
+ const res = createMockResponse();
1156
+
1157
+ await handleBlueBubblesWebhookRequest(req, res);
1158
+ await flushAsync();
1159
+
1160
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
1161
+ });
1162
+ });
1163
+
1164
+ describe("group metadata", () => {
1165
+ it("includes group subject + members in ctx", async () => {
1166
+ const account = createMockAccount({ groupPolicy: "open" });
1167
+ const config: OpenClawConfig = {};
1168
+ const core = createMockRuntime();
1169
+ setBlueBubblesRuntime(core);
1170
+
1171
+ unregister = registerBlueBubblesWebhookTarget({
1172
+ account,
1173
+ config,
1174
+ runtime: { log: vi.fn(), error: vi.fn() },
1175
+ core,
1176
+ path: "/bluebubbles-webhook",
1177
+ });
1178
+
1179
+ const payload = {
1180
+ type: "new-message",
1181
+ data: {
1182
+ text: "hello group",
1183
+ handle: { address: "+15551234567" },
1184
+ isGroup: true,
1185
+ isFromMe: false,
1186
+ guid: "msg-1",
1187
+ chatGuid: "iMessage;+;chat123456",
1188
+ chatName: "Family",
1189
+ participants: [
1190
+ { address: "+15551234567", displayName: "Alice" },
1191
+ { address: "+15557654321", displayName: "Bob" },
1192
+ ],
1193
+ date: Date.now(),
1194
+ },
1195
+ };
1196
+
1197
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1198
+ const res = createMockResponse();
1199
+
1200
+ await handleBlueBubblesWebhookRequest(req, res);
1201
+ await flushAsync();
1202
+
1203
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
1204
+ const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
1205
+ expect(callArgs.ctx.GroupSubject).toBe("Family");
1206
+ expect(callArgs.ctx.GroupMembers).toBe("Alice (+15551234567), Bob (+15557654321)");
1207
+ });
1208
+ });
1209
+
1210
+ describe("inbound debouncing", () => {
1211
+ it("coalesces text-only then attachment webhook events by messageId", async () => {
1212
+ vi.useFakeTimers();
1213
+ try {
1214
+ const account = createMockAccount({ dmPolicy: "open" });
1215
+ const config: OpenClawConfig = {};
1216
+ const core = createMockRuntime();
1217
+
1218
+ // Use a timing-aware debouncer test double that respects debounceMs/buildKey/shouldDebounce.
1219
+ // oxlint-disable-next-line typescript/no-explicit-any
1220
+ core.channel.debounce.createInboundDebouncer = vi.fn((params: any) => {
1221
+ // oxlint-disable-next-line typescript/no-explicit-any
1222
+ type Item = any;
1223
+ const buckets = new Map<
1224
+ string,
1225
+ { items: Item[]; timer: ReturnType<typeof setTimeout> | null }
1226
+ >();
1227
+
1228
+ const flush = async (key: string) => {
1229
+ const bucket = buckets.get(key);
1230
+ if (!bucket) {
1231
+ return;
1232
+ }
1233
+ if (bucket.timer) {
1234
+ clearTimeout(bucket.timer);
1235
+ bucket.timer = null;
1236
+ }
1237
+ const items = bucket.items;
1238
+ bucket.items = [];
1239
+ if (items.length > 0) {
1240
+ try {
1241
+ await params.onFlush(items);
1242
+ } catch (err) {
1243
+ params.onError?.(err);
1244
+ throw err;
1245
+ }
1246
+ }
1247
+ };
1248
+
1249
+ return {
1250
+ enqueue: async (item: Item) => {
1251
+ if (params.shouldDebounce && !params.shouldDebounce(item)) {
1252
+ await params.onFlush([item]);
1253
+ return;
1254
+ }
1255
+
1256
+ const key = params.buildKey(item);
1257
+ const existing = buckets.get(key);
1258
+ const bucket = existing ?? { items: [], timer: null };
1259
+ bucket.items.push(item);
1260
+ if (bucket.timer) {
1261
+ clearTimeout(bucket.timer);
1262
+ }
1263
+ bucket.timer = setTimeout(async () => {
1264
+ await flush(key);
1265
+ }, params.debounceMs);
1266
+ buckets.set(key, bucket);
1267
+ },
1268
+ flushKey: vi.fn(async (key: string) => {
1269
+ await flush(key);
1270
+ }),
1271
+ };
1272
+ }) as unknown as PluginRuntime["channel"]["debounce"]["createInboundDebouncer"];
1273
+
1274
+ setBlueBubblesRuntime(core);
1275
+
1276
+ unregister = registerBlueBubblesWebhookTarget({
1277
+ account,
1278
+ config,
1279
+ runtime: { log: vi.fn(), error: vi.fn() },
1280
+ core,
1281
+ path: "/bluebubbles-webhook",
1282
+ });
1283
+
1284
+ const messageId = "race-msg-1";
1285
+ const chatGuid = "iMessage;-;+15551234567";
1286
+
1287
+ const payloadA = {
1288
+ type: "new-message",
1289
+ data: {
1290
+ text: "hello",
1291
+ handle: { address: "+15551234567" },
1292
+ isGroup: false,
1293
+ isFromMe: false,
1294
+ guid: messageId,
1295
+ chatGuid,
1296
+ date: Date.now(),
1297
+ },
1298
+ };
1299
+
1300
+ const payloadB = {
1301
+ type: "new-message",
1302
+ data: {
1303
+ text: "hello",
1304
+ handle: { address: "+15551234567" },
1305
+ isGroup: false,
1306
+ isFromMe: false,
1307
+ guid: messageId,
1308
+ chatGuid,
1309
+ attachments: [
1310
+ {
1311
+ guid: "att-1",
1312
+ mimeType: "image/jpeg",
1313
+ totalBytes: 1024,
1314
+ },
1315
+ ],
1316
+ date: Date.now(),
1317
+ },
1318
+ };
1319
+
1320
+ await handleBlueBubblesWebhookRequest(
1321
+ createMockRequest("POST", "/bluebubbles-webhook", payloadA),
1322
+ createMockResponse(),
1323
+ );
1324
+
1325
+ // Simulate the real-world delay where the attachment-bearing webhook arrives shortly after.
1326
+ await vi.advanceTimersByTimeAsync(300);
1327
+
1328
+ await handleBlueBubblesWebhookRequest(
1329
+ createMockRequest("POST", "/bluebubbles-webhook", payloadB),
1330
+ createMockResponse(),
1331
+ );
1332
+
1333
+ // Not flushed yet; still within the debounce window.
1334
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
1335
+
1336
+ // After the debounce window, the combined message should be processed exactly once.
1337
+ await vi.advanceTimersByTimeAsync(600);
1338
+
1339
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalledTimes(1);
1340
+ const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
1341
+ expect(callArgs.ctx.MediaPaths).toEqual(["/tmp/test-media.jpg"]);
1342
+ expect(callArgs.ctx.Body).toContain("hello");
1343
+ } finally {
1344
+ vi.useRealTimers();
1345
+ }
1346
+ });
1347
+ });
1348
+
1349
+ describe("reply metadata", () => {
1350
+ it("surfaces reply fields in ctx when provided", async () => {
1351
+ const account = createMockAccount({ dmPolicy: "open" });
1352
+ const config: OpenClawConfig = {};
1353
+ const core = createMockRuntime();
1354
+ setBlueBubblesRuntime(core);
1355
+
1356
+ unregister = registerBlueBubblesWebhookTarget({
1357
+ account,
1358
+ config,
1359
+ runtime: { log: vi.fn(), error: vi.fn() },
1360
+ core,
1361
+ path: "/bluebubbles-webhook",
1362
+ });
1363
+
1364
+ const payload = {
1365
+ type: "new-message",
1366
+ data: {
1367
+ text: "replying now",
1368
+ handle: { address: "+15551234567" },
1369
+ isGroup: false,
1370
+ isFromMe: false,
1371
+ guid: "msg-1",
1372
+ chatGuid: "iMessage;-;+15551234567",
1373
+ replyTo: {
1374
+ guid: "msg-0",
1375
+ text: "original message",
1376
+ handle: { address: "+15550000000", displayName: "Alice" },
1377
+ },
1378
+ date: Date.now(),
1379
+ },
1380
+ };
1381
+
1382
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1383
+ const res = createMockResponse();
1384
+
1385
+ await handleBlueBubblesWebhookRequest(req, res);
1386
+ await flushAsync();
1387
+
1388
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
1389
+ const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
1390
+ // ReplyToId is the full UUID since it wasn't previously cached
1391
+ expect(callArgs.ctx.ReplyToId).toBe("msg-0");
1392
+ expect(callArgs.ctx.ReplyToBody).toBe("original message");
1393
+ expect(callArgs.ctx.ReplyToSender).toBe("+15550000000");
1394
+ // Body uses inline [[reply_to:N]] tag format
1395
+ expect(callArgs.ctx.Body).toContain("[[reply_to:msg-0]]");
1396
+ });
1397
+
1398
+ it("preserves part index prefixes in reply tags when short IDs are unavailable", async () => {
1399
+ const account = createMockAccount({ dmPolicy: "open" });
1400
+ const config: OpenClawConfig = {};
1401
+ const core = createMockRuntime();
1402
+ setBlueBubblesRuntime(core);
1403
+
1404
+ unregister = registerBlueBubblesWebhookTarget({
1405
+ account,
1406
+ config,
1407
+ runtime: { log: vi.fn(), error: vi.fn() },
1408
+ core,
1409
+ path: "/bluebubbles-webhook",
1410
+ });
1411
+
1412
+ const payload = {
1413
+ type: "new-message",
1414
+ data: {
1415
+ text: "replying now",
1416
+ handle: { address: "+15551234567" },
1417
+ isGroup: false,
1418
+ isFromMe: false,
1419
+ guid: "msg-1",
1420
+ chatGuid: "iMessage;-;+15551234567",
1421
+ replyTo: {
1422
+ guid: "p:1/msg-0",
1423
+ text: "original message",
1424
+ handle: { address: "+15550000000", displayName: "Alice" },
1425
+ },
1426
+ date: Date.now(),
1427
+ },
1428
+ };
1429
+
1430
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1431
+ const res = createMockResponse();
1432
+
1433
+ await handleBlueBubblesWebhookRequest(req, res);
1434
+ await flushAsync();
1435
+
1436
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
1437
+ const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
1438
+ expect(callArgs.ctx.ReplyToId).toBe("p:1/msg-0");
1439
+ expect(callArgs.ctx.ReplyToIdFull).toBe("p:1/msg-0");
1440
+ expect(callArgs.ctx.Body).toContain("[[reply_to:p:1/msg-0]]");
1441
+ });
1442
+
1443
+ it("hydrates missing reply sender/body from the recent-message cache", async () => {
1444
+ const account = createMockAccount({ dmPolicy: "open", groupPolicy: "open" });
1445
+ const config: OpenClawConfig = {};
1446
+ const core = createMockRuntime();
1447
+ setBlueBubblesRuntime(core);
1448
+
1449
+ unregister = registerBlueBubblesWebhookTarget({
1450
+ account,
1451
+ config,
1452
+ runtime: { log: vi.fn(), error: vi.fn() },
1453
+ core,
1454
+ path: "/bluebubbles-webhook",
1455
+ });
1456
+
1457
+ const chatGuid = "iMessage;+;chat-reply-cache";
1458
+
1459
+ const originalPayload = {
1460
+ type: "new-message",
1461
+ data: {
1462
+ text: "original message (cached)",
1463
+ handle: { address: "+15550000000" },
1464
+ isGroup: true,
1465
+ isFromMe: false,
1466
+ guid: "cache-msg-0",
1467
+ chatGuid,
1468
+ date: Date.now(),
1469
+ },
1470
+ };
1471
+
1472
+ const originalReq = createMockRequest("POST", "/bluebubbles-webhook", originalPayload);
1473
+ const originalRes = createMockResponse();
1474
+
1475
+ await handleBlueBubblesWebhookRequest(originalReq, originalRes);
1476
+ await flushAsync();
1477
+
1478
+ // Only assert the reply message behavior below.
1479
+ mockDispatchReplyWithBufferedBlockDispatcher.mockClear();
1480
+
1481
+ const replyPayload = {
1482
+ type: "new-message",
1483
+ data: {
1484
+ text: "replying now",
1485
+ handle: { address: "+15551234567" },
1486
+ isGroup: true,
1487
+ isFromMe: false,
1488
+ guid: "cache-msg-1",
1489
+ chatGuid,
1490
+ // Only the GUID is provided; sender/body must be hydrated.
1491
+ replyToMessageGuid: "cache-msg-0",
1492
+ date: Date.now(),
1493
+ },
1494
+ };
1495
+
1496
+ const replyReq = createMockRequest("POST", "/bluebubbles-webhook", replyPayload);
1497
+ const replyRes = createMockResponse();
1498
+
1499
+ await handleBlueBubblesWebhookRequest(replyReq, replyRes);
1500
+ await flushAsync();
1501
+
1502
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
1503
+ const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
1504
+ // ReplyToId uses short ID "1" (first cached message) for token savings
1505
+ expect(callArgs.ctx.ReplyToId).toBe("1");
1506
+ expect(callArgs.ctx.ReplyToIdFull).toBe("cache-msg-0");
1507
+ expect(callArgs.ctx.ReplyToBody).toBe("original message (cached)");
1508
+ expect(callArgs.ctx.ReplyToSender).toBe("+15550000000");
1509
+ // Body uses inline [[reply_to:N]] tag format with short ID
1510
+ expect(callArgs.ctx.Body).toContain("[[reply_to:1]]");
1511
+ });
1512
+
1513
+ it("falls back to threadOriginatorGuid when reply metadata is absent", async () => {
1514
+ const account = createMockAccount({ dmPolicy: "open" });
1515
+ const config: OpenClawConfig = {};
1516
+ const core = createMockRuntime();
1517
+ setBlueBubblesRuntime(core);
1518
+
1519
+ unregister = registerBlueBubblesWebhookTarget({
1520
+ account,
1521
+ config,
1522
+ runtime: { log: vi.fn(), error: vi.fn() },
1523
+ core,
1524
+ path: "/bluebubbles-webhook",
1525
+ });
1526
+
1527
+ const payload = {
1528
+ type: "new-message",
1529
+ data: {
1530
+ text: "replying now",
1531
+ handle: { address: "+15551234567" },
1532
+ isGroup: false,
1533
+ isFromMe: false,
1534
+ guid: "msg-1",
1535
+ threadOriginatorGuid: "msg-0",
1536
+ chatGuid: "iMessage;-;+15551234567",
1537
+ date: Date.now(),
1538
+ },
1539
+ };
1540
+
1541
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1542
+ const res = createMockResponse();
1543
+
1544
+ await handleBlueBubblesWebhookRequest(req, res);
1545
+ await flushAsync();
1546
+
1547
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
1548
+ const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
1549
+ expect(callArgs.ctx.ReplyToId).toBe("msg-0");
1550
+ });
1551
+ });
1552
+
1553
+ describe("tapback text parsing", () => {
1554
+ it("does not rewrite tapback-like text without metadata", async () => {
1555
+ const account = createMockAccount({ dmPolicy: "open" });
1556
+ const config: OpenClawConfig = {};
1557
+ const core = createMockRuntime();
1558
+ setBlueBubblesRuntime(core);
1559
+
1560
+ unregister = registerBlueBubblesWebhookTarget({
1561
+ account,
1562
+ config,
1563
+ runtime: { log: vi.fn(), error: vi.fn() },
1564
+ core,
1565
+ path: "/bluebubbles-webhook",
1566
+ });
1567
+
1568
+ const payload = {
1569
+ type: "new-message",
1570
+ data: {
1571
+ text: "Loved this idea",
1572
+ handle: { address: "+15551234567" },
1573
+ isGroup: false,
1574
+ isFromMe: false,
1575
+ guid: "msg-1",
1576
+ chatGuid: "iMessage;-;+15551234567",
1577
+ date: Date.now(),
1578
+ },
1579
+ };
1580
+
1581
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1582
+ const res = createMockResponse();
1583
+
1584
+ await handleBlueBubblesWebhookRequest(req, res);
1585
+ await flushAsync();
1586
+
1587
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
1588
+ const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
1589
+ expect(callArgs.ctx.RawBody).toBe("Loved this idea");
1590
+ expect(callArgs.ctx.Body).toContain("Loved this idea");
1591
+ expect(callArgs.ctx.Body).not.toContain("reacted with");
1592
+ });
1593
+
1594
+ it("parses tapback text with custom emoji when metadata is present", async () => {
1595
+ const account = createMockAccount({ dmPolicy: "open" });
1596
+ const config: OpenClawConfig = {};
1597
+ const core = createMockRuntime();
1598
+ setBlueBubblesRuntime(core);
1599
+
1600
+ unregister = registerBlueBubblesWebhookTarget({
1601
+ account,
1602
+ config,
1603
+ runtime: { log: vi.fn(), error: vi.fn() },
1604
+ core,
1605
+ path: "/bluebubbles-webhook",
1606
+ });
1607
+
1608
+ const payload = {
1609
+ type: "new-message",
1610
+ data: {
1611
+ text: 'Reacted 😅 to "nice one"',
1612
+ handle: { address: "+15551234567" },
1613
+ isGroup: false,
1614
+ isFromMe: false,
1615
+ guid: "msg-2",
1616
+ chatGuid: "iMessage;-;+15551234567",
1617
+ date: Date.now(),
1618
+ },
1619
+ };
1620
+
1621
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1622
+ const res = createMockResponse();
1623
+
1624
+ await handleBlueBubblesWebhookRequest(req, res);
1625
+ await flushAsync();
1626
+
1627
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
1628
+ const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
1629
+ expect(callArgs.ctx.RawBody).toBe("reacted with 😅");
1630
+ expect(callArgs.ctx.Body).toContain("reacted with 😅");
1631
+ expect(callArgs.ctx.Body).not.toContain("[[reply_to:");
1632
+ });
1633
+ });
1634
+
1635
+ describe("ack reactions", () => {
1636
+ it("sends ack reaction when configured", async () => {
1637
+ const { sendBlueBubblesReaction } = await import("./reactions.js");
1638
+ vi.mocked(sendBlueBubblesReaction).mockClear();
1639
+
1640
+ const account = createMockAccount({ dmPolicy: "open" });
1641
+ const config: OpenClawConfig = {
1642
+ messages: {
1643
+ ackReaction: "❤️",
1644
+ ackReactionScope: "direct",
1645
+ },
1646
+ };
1647
+ const core = createMockRuntime();
1648
+ setBlueBubblesRuntime(core);
1649
+
1650
+ unregister = registerBlueBubblesWebhookTarget({
1651
+ account,
1652
+ config,
1653
+ runtime: { log: vi.fn(), error: vi.fn() },
1654
+ core,
1655
+ path: "/bluebubbles-webhook",
1656
+ });
1657
+
1658
+ const payload = {
1659
+ type: "new-message",
1660
+ data: {
1661
+ text: "hello",
1662
+ handle: { address: "+15551234567" },
1663
+ isGroup: false,
1664
+ isFromMe: false,
1665
+ guid: "msg-1",
1666
+ chatGuid: "iMessage;-;+15551234567",
1667
+ date: Date.now(),
1668
+ },
1669
+ };
1670
+
1671
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1672
+ const res = createMockResponse();
1673
+
1674
+ await handleBlueBubblesWebhookRequest(req, res);
1675
+ await flushAsync();
1676
+
1677
+ expect(sendBlueBubblesReaction).toHaveBeenCalledWith(
1678
+ expect.objectContaining({
1679
+ chatGuid: "iMessage;-;+15551234567",
1680
+ messageGuid: "msg-1",
1681
+ emoji: "❤️",
1682
+ opts: expect.objectContaining({ accountId: "default" }),
1683
+ }),
1684
+ );
1685
+ });
1686
+ });
1687
+
1688
+ describe("command gating", () => {
1689
+ it("allows control command to bypass mention gating when authorized", async () => {
1690
+ mockResolveRequireMention.mockReturnValue(true);
1691
+ mockMatchesMentionPatterns.mockReturnValue(false); // Not mentioned
1692
+ mockHasControlCommand.mockReturnValue(true); // Has control command
1693
+ mockResolveCommandAuthorizedFromAuthorizers.mockReturnValue(true); // Authorized
1694
+
1695
+ const account = createMockAccount({
1696
+ groupPolicy: "open",
1697
+ allowFrom: ["+15551234567"],
1698
+ });
1699
+ const config: OpenClawConfig = {};
1700
+ const core = createMockRuntime();
1701
+ setBlueBubblesRuntime(core);
1702
+
1703
+ unregister = registerBlueBubblesWebhookTarget({
1704
+ account,
1705
+ config,
1706
+ runtime: { log: vi.fn(), error: vi.fn() },
1707
+ core,
1708
+ path: "/bluebubbles-webhook",
1709
+ });
1710
+
1711
+ const payload = {
1712
+ type: "new-message",
1713
+ data: {
1714
+ text: "/status",
1715
+ handle: { address: "+15551234567" },
1716
+ isGroup: true,
1717
+ isFromMe: false,
1718
+ guid: "msg-1",
1719
+ chatGuid: "iMessage;+;chat123456",
1720
+ date: Date.now(),
1721
+ },
1722
+ };
1723
+
1724
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1725
+ const res = createMockResponse();
1726
+
1727
+ await handleBlueBubblesWebhookRequest(req, res);
1728
+ await flushAsync();
1729
+
1730
+ // Should process even without mention because it's an authorized control command
1731
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
1732
+ });
1733
+
1734
+ it("blocks control command from unauthorized sender in group", async () => {
1735
+ mockHasControlCommand.mockReturnValue(true);
1736
+ mockResolveCommandAuthorizedFromAuthorizers.mockReturnValue(false);
1737
+
1738
+ const account = createMockAccount({
1739
+ groupPolicy: "open",
1740
+ allowFrom: [], // No one authorized
1741
+ });
1742
+ const config: OpenClawConfig = {};
1743
+ const core = createMockRuntime();
1744
+ setBlueBubblesRuntime(core);
1745
+
1746
+ unregister = registerBlueBubblesWebhookTarget({
1747
+ account,
1748
+ config,
1749
+ runtime: { log: vi.fn(), error: vi.fn() },
1750
+ core,
1751
+ path: "/bluebubbles-webhook",
1752
+ });
1753
+
1754
+ const payload = {
1755
+ type: "new-message",
1756
+ data: {
1757
+ text: "/status",
1758
+ handle: { address: "+15559999999" },
1759
+ isGroup: true,
1760
+ isFromMe: false,
1761
+ guid: "msg-1",
1762
+ chatGuid: "iMessage;+;chat123456",
1763
+ date: Date.now(),
1764
+ },
1765
+ };
1766
+
1767
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1768
+ const res = createMockResponse();
1769
+
1770
+ await handleBlueBubblesWebhookRequest(req, res);
1771
+ await flushAsync();
1772
+
1773
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
1774
+ });
1775
+ });
1776
+
1777
+ describe("typing/read receipt toggles", () => {
1778
+ it("marks chat as read when sendReadReceipts=true (default)", async () => {
1779
+ const { markBlueBubblesChatRead } = await import("./chat.js");
1780
+ vi.mocked(markBlueBubblesChatRead).mockClear();
1781
+
1782
+ const account = createMockAccount({
1783
+ sendReadReceipts: true,
1784
+ });
1785
+ const config: OpenClawConfig = {};
1786
+ const core = createMockRuntime();
1787
+ setBlueBubblesRuntime(core);
1788
+
1789
+ unregister = registerBlueBubblesWebhookTarget({
1790
+ account,
1791
+ config,
1792
+ runtime: { log: vi.fn(), error: vi.fn() },
1793
+ core,
1794
+ path: "/bluebubbles-webhook",
1795
+ });
1796
+
1797
+ const payload = {
1798
+ type: "new-message",
1799
+ data: {
1800
+ text: "hello",
1801
+ handle: { address: "+15551234567" },
1802
+ isGroup: false,
1803
+ isFromMe: false,
1804
+ guid: "msg-1",
1805
+ chatGuid: "iMessage;-;+15551234567",
1806
+ date: Date.now(),
1807
+ },
1808
+ };
1809
+
1810
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1811
+ const res = createMockResponse();
1812
+
1813
+ await handleBlueBubblesWebhookRequest(req, res);
1814
+ await flushAsync();
1815
+
1816
+ expect(markBlueBubblesChatRead).toHaveBeenCalled();
1817
+ });
1818
+
1819
+ it("does not mark chat as read when sendReadReceipts=false", async () => {
1820
+ const { markBlueBubblesChatRead } = await import("./chat.js");
1821
+ vi.mocked(markBlueBubblesChatRead).mockClear();
1822
+
1823
+ const account = createMockAccount({
1824
+ sendReadReceipts: false,
1825
+ });
1826
+ const config: OpenClawConfig = {};
1827
+ const core = createMockRuntime();
1828
+ setBlueBubblesRuntime(core);
1829
+
1830
+ unregister = registerBlueBubblesWebhookTarget({
1831
+ account,
1832
+ config,
1833
+ runtime: { log: vi.fn(), error: vi.fn() },
1834
+ core,
1835
+ path: "/bluebubbles-webhook",
1836
+ });
1837
+
1838
+ const payload = {
1839
+ type: "new-message",
1840
+ data: {
1841
+ text: "hello",
1842
+ handle: { address: "+15551234567" },
1843
+ isGroup: false,
1844
+ isFromMe: false,
1845
+ guid: "msg-1",
1846
+ chatGuid: "iMessage;-;+15551234567",
1847
+ date: Date.now(),
1848
+ },
1849
+ };
1850
+
1851
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1852
+ const res = createMockResponse();
1853
+
1854
+ await handleBlueBubblesWebhookRequest(req, res);
1855
+ await flushAsync();
1856
+
1857
+ expect(markBlueBubblesChatRead).not.toHaveBeenCalled();
1858
+ });
1859
+
1860
+ it("sends typing indicator when processing message", async () => {
1861
+ const { sendBlueBubblesTyping } = await import("./chat.js");
1862
+ vi.mocked(sendBlueBubblesTyping).mockClear();
1863
+
1864
+ const account = createMockAccount();
1865
+ const config: OpenClawConfig = {};
1866
+ const core = createMockRuntime();
1867
+ setBlueBubblesRuntime(core);
1868
+
1869
+ unregister = registerBlueBubblesWebhookTarget({
1870
+ account,
1871
+ config,
1872
+ runtime: { log: vi.fn(), error: vi.fn() },
1873
+ core,
1874
+ path: "/bluebubbles-webhook",
1875
+ });
1876
+
1877
+ const payload = {
1878
+ type: "new-message",
1879
+ data: {
1880
+ text: "hello",
1881
+ handle: { address: "+15551234567" },
1882
+ isGroup: false,
1883
+ isFromMe: false,
1884
+ guid: "msg-1",
1885
+ chatGuid: "iMessage;-;+15551234567",
1886
+ date: Date.now(),
1887
+ },
1888
+ };
1889
+
1890
+ mockDispatchReplyWithBufferedBlockDispatcher.mockImplementationOnce(async (params) => {
1891
+ await params.dispatcherOptions.onReplyStart?.();
1892
+ });
1893
+
1894
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1895
+ const res = createMockResponse();
1896
+
1897
+ await handleBlueBubblesWebhookRequest(req, res);
1898
+ await flushAsync();
1899
+
1900
+ // Should call typing start when reply flow triggers it.
1901
+ expect(sendBlueBubblesTyping).toHaveBeenCalledWith(
1902
+ expect.any(String),
1903
+ true,
1904
+ expect.any(Object),
1905
+ );
1906
+ });
1907
+
1908
+ it("stops typing on idle", async () => {
1909
+ const { sendBlueBubblesTyping } = await import("./chat.js");
1910
+ vi.mocked(sendBlueBubblesTyping).mockClear();
1911
+
1912
+ const account = createMockAccount();
1913
+ const config: OpenClawConfig = {};
1914
+ const core = createMockRuntime();
1915
+ setBlueBubblesRuntime(core);
1916
+
1917
+ unregister = registerBlueBubblesWebhookTarget({
1918
+ account,
1919
+ config,
1920
+ runtime: { log: vi.fn(), error: vi.fn() },
1921
+ core,
1922
+ path: "/bluebubbles-webhook",
1923
+ });
1924
+
1925
+ const payload = {
1926
+ type: "new-message",
1927
+ data: {
1928
+ text: "hello",
1929
+ handle: { address: "+15551234567" },
1930
+ isGroup: false,
1931
+ isFromMe: false,
1932
+ guid: "msg-1",
1933
+ chatGuid: "iMessage;-;+15551234567",
1934
+ date: Date.now(),
1935
+ },
1936
+ };
1937
+
1938
+ mockDispatchReplyWithBufferedBlockDispatcher.mockImplementationOnce(async (params) => {
1939
+ await params.dispatcherOptions.onReplyStart?.();
1940
+ await params.dispatcherOptions.deliver({ text: "replying now" }, { kind: "final" });
1941
+ await params.dispatcherOptions.onIdle?.();
1942
+ });
1943
+
1944
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1945
+ const res = createMockResponse();
1946
+
1947
+ await handleBlueBubblesWebhookRequest(req, res);
1948
+ await flushAsync();
1949
+
1950
+ expect(sendBlueBubblesTyping).toHaveBeenCalledWith(
1951
+ expect.any(String),
1952
+ false,
1953
+ expect.any(Object),
1954
+ );
1955
+ });
1956
+
1957
+ it("stops typing when no reply is sent", async () => {
1958
+ const { sendBlueBubblesTyping } = await import("./chat.js");
1959
+ vi.mocked(sendBlueBubblesTyping).mockClear();
1960
+
1961
+ const account = createMockAccount();
1962
+ const config: OpenClawConfig = {};
1963
+ const core = createMockRuntime();
1964
+ setBlueBubblesRuntime(core);
1965
+
1966
+ unregister = registerBlueBubblesWebhookTarget({
1967
+ account,
1968
+ config,
1969
+ runtime: { log: vi.fn(), error: vi.fn() },
1970
+ core,
1971
+ path: "/bluebubbles-webhook",
1972
+ });
1973
+
1974
+ const payload = {
1975
+ type: "new-message",
1976
+ data: {
1977
+ text: "hello",
1978
+ handle: { address: "+15551234567" },
1979
+ isGroup: false,
1980
+ isFromMe: false,
1981
+ guid: "msg-1",
1982
+ chatGuid: "iMessage;-;+15551234567",
1983
+ date: Date.now(),
1984
+ },
1985
+ };
1986
+
1987
+ mockDispatchReplyWithBufferedBlockDispatcher.mockImplementationOnce(async () => undefined);
1988
+
1989
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
1990
+ const res = createMockResponse();
1991
+
1992
+ await handleBlueBubblesWebhookRequest(req, res);
1993
+ await flushAsync();
1994
+
1995
+ expect(sendBlueBubblesTyping).toHaveBeenCalledWith(
1996
+ expect.any(String),
1997
+ false,
1998
+ expect.any(Object),
1999
+ );
2000
+ });
2001
+ });
2002
+
2003
+ describe("outbound message ids", () => {
2004
+ it("enqueues system event for outbound message id", async () => {
2005
+ mockEnqueueSystemEvent.mockClear();
2006
+
2007
+ mockDispatchReplyWithBufferedBlockDispatcher.mockImplementationOnce(async (params) => {
2008
+ await params.dispatcherOptions.deliver({ text: "replying now" }, { kind: "final" });
2009
+ });
2010
+
2011
+ const account = createMockAccount();
2012
+ const config: OpenClawConfig = {};
2013
+ const core = createMockRuntime();
2014
+ setBlueBubblesRuntime(core);
2015
+
2016
+ unregister = registerBlueBubblesWebhookTarget({
2017
+ account,
2018
+ config,
2019
+ runtime: { log: vi.fn(), error: vi.fn() },
2020
+ core,
2021
+ path: "/bluebubbles-webhook",
2022
+ });
2023
+
2024
+ const payload = {
2025
+ type: "new-message",
2026
+ data: {
2027
+ text: "hello",
2028
+ handle: { address: "+15551234567" },
2029
+ isGroup: false,
2030
+ isFromMe: false,
2031
+ guid: "msg-1",
2032
+ chatGuid: "iMessage;-;+15551234567",
2033
+ date: Date.now(),
2034
+ },
2035
+ };
2036
+
2037
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
2038
+ const res = createMockResponse();
2039
+
2040
+ await handleBlueBubblesWebhookRequest(req, res);
2041
+ await flushAsync();
2042
+
2043
+ // Outbound message ID uses short ID "2" (inbound msg-1 is "1", outbound msg-123 is "2")
2044
+ expect(mockEnqueueSystemEvent).toHaveBeenCalledWith(
2045
+ 'Assistant sent "replying now" [message_id:2]',
2046
+ expect.objectContaining({
2047
+ sessionKey: "agent:main:bluebubbles:dm:+15551234567",
2048
+ }),
2049
+ );
2050
+ });
2051
+ });
2052
+
2053
+ describe("reaction events", () => {
2054
+ it("enqueues system event for reaction added", async () => {
2055
+ mockEnqueueSystemEvent.mockClear();
2056
+
2057
+ const account = createMockAccount();
2058
+ const config: OpenClawConfig = {};
2059
+ const core = createMockRuntime();
2060
+ setBlueBubblesRuntime(core);
2061
+
2062
+ unregister = registerBlueBubblesWebhookTarget({
2063
+ account,
2064
+ config,
2065
+ runtime: { log: vi.fn(), error: vi.fn() },
2066
+ core,
2067
+ path: "/bluebubbles-webhook",
2068
+ });
2069
+
2070
+ const payload = {
2071
+ type: "message-reaction",
2072
+ data: {
2073
+ handle: { address: "+15551234567" },
2074
+ isGroup: false,
2075
+ isFromMe: false,
2076
+ associatedMessageGuid: "msg-original-123",
2077
+ associatedMessageType: 2000, // Heart reaction added
2078
+ date: Date.now(),
2079
+ },
2080
+ };
2081
+
2082
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
2083
+ const res = createMockResponse();
2084
+
2085
+ await handleBlueBubblesWebhookRequest(req, res);
2086
+ await flushAsync();
2087
+
2088
+ expect(mockEnqueueSystemEvent).toHaveBeenCalledWith(
2089
+ expect.stringContaining("reacted with ❤️ [[reply_to:"),
2090
+ expect.any(Object),
2091
+ );
2092
+ });
2093
+
2094
+ it("enqueues system event for reaction removed", async () => {
2095
+ mockEnqueueSystemEvent.mockClear();
2096
+
2097
+ const account = createMockAccount();
2098
+ const config: OpenClawConfig = {};
2099
+ const core = createMockRuntime();
2100
+ setBlueBubblesRuntime(core);
2101
+
2102
+ unregister = registerBlueBubblesWebhookTarget({
2103
+ account,
2104
+ config,
2105
+ runtime: { log: vi.fn(), error: vi.fn() },
2106
+ core,
2107
+ path: "/bluebubbles-webhook",
2108
+ });
2109
+
2110
+ const payload = {
2111
+ type: "message-reaction",
2112
+ data: {
2113
+ handle: { address: "+15551234567" },
2114
+ isGroup: false,
2115
+ isFromMe: false,
2116
+ associatedMessageGuid: "msg-original-123",
2117
+ associatedMessageType: 3000, // Heart reaction removed
2118
+ date: Date.now(),
2119
+ },
2120
+ };
2121
+
2122
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
2123
+ const res = createMockResponse();
2124
+
2125
+ await handleBlueBubblesWebhookRequest(req, res);
2126
+ await flushAsync();
2127
+
2128
+ expect(mockEnqueueSystemEvent).toHaveBeenCalledWith(
2129
+ expect.stringContaining("removed ❤️ reaction [[reply_to:"),
2130
+ expect.any(Object),
2131
+ );
2132
+ });
2133
+
2134
+ it("ignores reaction from self (fromMe=true)", async () => {
2135
+ mockEnqueueSystemEvent.mockClear();
2136
+
2137
+ const account = createMockAccount();
2138
+ const config: OpenClawConfig = {};
2139
+ const core = createMockRuntime();
2140
+ setBlueBubblesRuntime(core);
2141
+
2142
+ unregister = registerBlueBubblesWebhookTarget({
2143
+ account,
2144
+ config,
2145
+ runtime: { log: vi.fn(), error: vi.fn() },
2146
+ core,
2147
+ path: "/bluebubbles-webhook",
2148
+ });
2149
+
2150
+ const payload = {
2151
+ type: "message-reaction",
2152
+ data: {
2153
+ handle: { address: "+15551234567" },
2154
+ isGroup: false,
2155
+ isFromMe: true, // From self
2156
+ associatedMessageGuid: "msg-original-123",
2157
+ associatedMessageType: 2000,
2158
+ date: Date.now(),
2159
+ },
2160
+ };
2161
+
2162
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
2163
+ const res = createMockResponse();
2164
+
2165
+ await handleBlueBubblesWebhookRequest(req, res);
2166
+ await flushAsync();
2167
+
2168
+ expect(mockEnqueueSystemEvent).not.toHaveBeenCalled();
2169
+ });
2170
+
2171
+ it("maps reaction types to correct emojis", async () => {
2172
+ mockEnqueueSystemEvent.mockClear();
2173
+
2174
+ const account = createMockAccount();
2175
+ const config: OpenClawConfig = {};
2176
+ const core = createMockRuntime();
2177
+ setBlueBubblesRuntime(core);
2178
+
2179
+ unregister = registerBlueBubblesWebhookTarget({
2180
+ account,
2181
+ config,
2182
+ runtime: { log: vi.fn(), error: vi.fn() },
2183
+ core,
2184
+ path: "/bluebubbles-webhook",
2185
+ });
2186
+
2187
+ // Test thumbs up reaction (2001)
2188
+ const payload = {
2189
+ type: "message-reaction",
2190
+ data: {
2191
+ handle: { address: "+15551234567" },
2192
+ isGroup: false,
2193
+ isFromMe: false,
2194
+ associatedMessageGuid: "msg-123",
2195
+ associatedMessageType: 2001, // Thumbs up
2196
+ date: Date.now(),
2197
+ },
2198
+ };
2199
+
2200
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
2201
+ const res = createMockResponse();
2202
+
2203
+ await handleBlueBubblesWebhookRequest(req, res);
2204
+ await flushAsync();
2205
+
2206
+ expect(mockEnqueueSystemEvent).toHaveBeenCalledWith(
2207
+ expect.stringContaining("👍"),
2208
+ expect.any(Object),
2209
+ );
2210
+ });
2211
+ });
2212
+
2213
+ describe("short message ID mapping", () => {
2214
+ it("assigns sequential short IDs to messages", async () => {
2215
+ const account = createMockAccount({ dmPolicy: "open" });
2216
+ const config: OpenClawConfig = {};
2217
+ const core = createMockRuntime();
2218
+ setBlueBubblesRuntime(core);
2219
+
2220
+ unregister = registerBlueBubblesWebhookTarget({
2221
+ account,
2222
+ config,
2223
+ runtime: { log: vi.fn(), error: vi.fn() },
2224
+ core,
2225
+ path: "/bluebubbles-webhook",
2226
+ });
2227
+
2228
+ const payload = {
2229
+ type: "new-message",
2230
+ data: {
2231
+ text: "hello",
2232
+ handle: { address: "+15551234567" },
2233
+ isGroup: false,
2234
+ isFromMe: false,
2235
+ guid: "p:1/msg-uuid-12345",
2236
+ chatGuid: "iMessage;-;+15551234567",
2237
+ date: Date.now(),
2238
+ },
2239
+ };
2240
+
2241
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
2242
+ const res = createMockResponse();
2243
+
2244
+ await handleBlueBubblesWebhookRequest(req, res);
2245
+ await flushAsync();
2246
+
2247
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
2248
+ const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
2249
+ // MessageSid should be short ID "1" instead of full UUID
2250
+ expect(callArgs.ctx.MessageSid).toBe("1");
2251
+ expect(callArgs.ctx.MessageSidFull).toBe("p:1/msg-uuid-12345");
2252
+ });
2253
+
2254
+ it("resolves short ID back to UUID", async () => {
2255
+ const account = createMockAccount({ dmPolicy: "open" });
2256
+ const config: OpenClawConfig = {};
2257
+ const core = createMockRuntime();
2258
+ setBlueBubblesRuntime(core);
2259
+
2260
+ unregister = registerBlueBubblesWebhookTarget({
2261
+ account,
2262
+ config,
2263
+ runtime: { log: vi.fn(), error: vi.fn() },
2264
+ core,
2265
+ path: "/bluebubbles-webhook",
2266
+ });
2267
+
2268
+ const payload = {
2269
+ type: "new-message",
2270
+ data: {
2271
+ text: "hello",
2272
+ handle: { address: "+15551234567" },
2273
+ isGroup: false,
2274
+ isFromMe: false,
2275
+ guid: "p:1/msg-uuid-12345",
2276
+ chatGuid: "iMessage;-;+15551234567",
2277
+ date: Date.now(),
2278
+ },
2279
+ };
2280
+
2281
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
2282
+ const res = createMockResponse();
2283
+
2284
+ await handleBlueBubblesWebhookRequest(req, res);
2285
+ await flushAsync();
2286
+
2287
+ // The short ID "1" should resolve back to the full UUID
2288
+ expect(resolveBlueBubblesMessageId("1")).toBe("p:1/msg-uuid-12345");
2289
+ });
2290
+
2291
+ it("returns UUID unchanged when not in cache", () => {
2292
+ expect(resolveBlueBubblesMessageId("msg-not-cached")).toBe("msg-not-cached");
2293
+ });
2294
+
2295
+ it("returns short ID unchanged when numeric but not in cache", () => {
2296
+ expect(resolveBlueBubblesMessageId("999")).toBe("999");
2297
+ });
2298
+
2299
+ it("throws when numeric short ID is missing and requireKnownShortId is set", () => {
2300
+ expect(() => resolveBlueBubblesMessageId("999", { requireKnownShortId: true })).toThrow(
2301
+ /short message id/i,
2302
+ );
2303
+ });
2304
+ });
2305
+
2306
+ describe("fromMe messages", () => {
2307
+ it("ignores messages from self (fromMe=true)", async () => {
2308
+ const account = createMockAccount();
2309
+ const config: OpenClawConfig = {};
2310
+ const core = createMockRuntime();
2311
+ setBlueBubblesRuntime(core);
2312
+
2313
+ unregister = registerBlueBubblesWebhookTarget({
2314
+ account,
2315
+ config,
2316
+ runtime: { log: vi.fn(), error: vi.fn() },
2317
+ core,
2318
+ path: "/bluebubbles-webhook",
2319
+ });
2320
+
2321
+ const payload = {
2322
+ type: "new-message",
2323
+ data: {
2324
+ text: "my own message",
2325
+ handle: { address: "+15551234567" },
2326
+ isGroup: false,
2327
+ isFromMe: true,
2328
+ guid: "msg-1",
2329
+ date: Date.now(),
2330
+ },
2331
+ };
2332
+
2333
+ const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
2334
+ const res = createMockResponse();
2335
+
2336
+ await handleBlueBubblesWebhookRequest(req, res);
2337
+ await flushAsync();
2338
+
2339
+ expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
2340
+ });
2341
+ });
2342
+ });