agent-messenger 2.27.2 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/.claude-plugin/README.md +11 -1
  2. package/.claude-plugin/marketplace.json +14 -1
  3. package/.claude-plugin/plugin.json +4 -2
  4. package/AGENTS.md +4 -0
  5. package/README.md +58 -10
  6. package/dist/package.json +10 -2
  7. package/dist/src/cli.d.ts.map +1 -1
  8. package/dist/src/cli.js +3 -0
  9. package/dist/src/cli.js.map +1 -1
  10. package/dist/src/platforms/discord/client.d.ts +6 -2
  11. package/dist/src/platforms/discord/client.d.ts.map +1 -1
  12. package/dist/src/platforms/discord/client.js +10 -3
  13. package/dist/src/platforms/discord/client.js.map +1 -1
  14. package/dist/src/platforms/discordbot/cli.js +1 -1
  15. package/dist/src/platforms/imessage/cli.d.ts +5 -0
  16. package/dist/src/platforms/imessage/cli.d.ts.map +1 -0
  17. package/dist/src/platforms/imessage/cli.js +31 -0
  18. package/dist/src/platforms/imessage/cli.js.map +1 -0
  19. package/dist/src/platforms/imessage/client.d.ts +43 -0
  20. package/dist/src/platforms/imessage/client.d.ts.map +1 -0
  21. package/dist/src/platforms/imessage/client.js +190 -0
  22. package/dist/src/platforms/imessage/client.js.map +1 -0
  23. package/dist/src/platforms/imessage/commands/auth.d.ts +31 -0
  24. package/dist/src/platforms/imessage/commands/auth.d.ts.map +1 -0
  25. package/dist/src/platforms/imessage/commands/auth.js +100 -0
  26. package/dist/src/platforms/imessage/commands/auth.js.map +1 -0
  27. package/dist/src/platforms/imessage/commands/chat.d.ts +3 -0
  28. package/dist/src/platforms/imessage/commands/chat.d.ts.map +1 -0
  29. package/dist/src/platforms/imessage/commands/chat.js +42 -0
  30. package/dist/src/platforms/imessage/commands/chat.js.map +1 -0
  31. package/dist/src/platforms/imessage/commands/doctor.d.ts +25 -0
  32. package/dist/src/platforms/imessage/commands/doctor.d.ts.map +1 -0
  33. package/dist/src/platforms/imessage/commands/doctor.js +101 -0
  34. package/dist/src/platforms/imessage/commands/doctor.js.map +1 -0
  35. package/dist/src/platforms/imessage/commands/index.d.ts +7 -0
  36. package/dist/src/platforms/imessage/commands/index.d.ts.map +1 -0
  37. package/dist/src/platforms/imessage/commands/index.js +7 -0
  38. package/dist/src/platforms/imessage/commands/index.js.map +1 -0
  39. package/dist/src/platforms/imessage/commands/message.d.ts +5 -0
  40. package/dist/src/platforms/imessage/commands/message.d.ts.map +1 -0
  41. package/dist/src/platforms/imessage/commands/message.js +127 -0
  42. package/dist/src/platforms/imessage/commands/message.js.map +1 -0
  43. package/dist/src/platforms/imessage/commands/setup.d.ts +20 -0
  44. package/dist/src/platforms/imessage/commands/setup.d.ts.map +1 -0
  45. package/dist/src/platforms/imessage/commands/setup.js +57 -0
  46. package/dist/src/platforms/imessage/commands/setup.js.map +1 -0
  47. package/dist/src/platforms/imessage/commands/shared.d.ts +10 -0
  48. package/dist/src/platforms/imessage/commands/shared.d.ts.map +1 -0
  49. package/dist/src/platforms/imessage/commands/shared.js +53 -0
  50. package/dist/src/platforms/imessage/commands/shared.js.map +1 -0
  51. package/dist/src/platforms/imessage/commands/whoami.d.ts +3 -0
  52. package/dist/src/platforms/imessage/commands/whoami.d.ts.map +1 -0
  53. package/dist/src/platforms/imessage/commands/whoami.js +20 -0
  54. package/dist/src/platforms/imessage/commands/whoami.js.map +1 -0
  55. package/dist/src/platforms/imessage/credential-manager.d.ts +22 -0
  56. package/dist/src/platforms/imessage/credential-manager.d.ts.map +1 -0
  57. package/dist/src/platforms/imessage/credential-manager.js +111 -0
  58. package/dist/src/platforms/imessage/credential-manager.js.map +1 -0
  59. package/dist/src/platforms/imessage/ensure-auth.d.ts +2 -0
  60. package/dist/src/platforms/imessage/ensure-auth.d.ts.map +1 -0
  61. package/dist/src/platforms/imessage/ensure-auth.js +13 -0
  62. package/dist/src/platforms/imessage/ensure-auth.js.map +1 -0
  63. package/dist/src/platforms/imessage/errors.d.ts +3 -0
  64. package/dist/src/platforms/imessage/errors.d.ts.map +1 -0
  65. package/dist/src/platforms/imessage/errors.js +25 -0
  66. package/dist/src/platforms/imessage/errors.js.map +1 -0
  67. package/dist/src/platforms/imessage/index.d.ts +7 -0
  68. package/dist/src/platforms/imessage/index.d.ts.map +1 -0
  69. package/dist/src/platforms/imessage/index.js +5 -0
  70. package/dist/src/platforms/imessage/index.js.map +1 -0
  71. package/dist/src/platforms/imessage/rpc.d.ts +20 -0
  72. package/dist/src/platforms/imessage/rpc.d.ts.map +1 -0
  73. package/dist/src/platforms/imessage/rpc.js +133 -0
  74. package/dist/src/platforms/imessage/rpc.js.map +1 -0
  75. package/dist/src/platforms/imessage/types.d.ts +59 -0
  76. package/dist/src/platforms/imessage/types.d.ts.map +1 -0
  77. package/dist/src/platforms/imessage/types.js +29 -0
  78. package/dist/src/platforms/imessage/types.js.map +1 -0
  79. package/dist/src/platforms/instagram/cli.js +1 -1
  80. package/dist/src/platforms/instagram/client.d.ts +29 -2
  81. package/dist/src/platforms/instagram/client.d.ts.map +1 -1
  82. package/dist/src/platforms/instagram/client.js +360 -53
  83. package/dist/src/platforms/instagram/client.js.map +1 -1
  84. package/dist/src/platforms/instagram/commands/auth.d.ts +1 -0
  85. package/dist/src/platforms/instagram/commands/auth.d.ts.map +1 -1
  86. package/dist/src/platforms/instagram/commands/auth.js +123 -11
  87. package/dist/src/platforms/instagram/commands/auth.js.map +1 -1
  88. package/dist/src/platforms/instagram/credential-manager.d.ts +4 -1
  89. package/dist/src/platforms/instagram/credential-manager.d.ts.map +1 -1
  90. package/dist/src/platforms/instagram/credential-manager.js +17 -1
  91. package/dist/src/platforms/instagram/credential-manager.js.map +1 -1
  92. package/dist/src/platforms/instagram/hybrid-listener.d.ts +48 -0
  93. package/dist/src/platforms/instagram/hybrid-listener.d.ts.map +1 -0
  94. package/dist/src/platforms/instagram/hybrid-listener.js +154 -0
  95. package/dist/src/platforms/instagram/hybrid-listener.js.map +1 -0
  96. package/dist/src/platforms/instagram/index.d.ts +2 -0
  97. package/dist/src/platforms/instagram/index.d.ts.map +1 -1
  98. package/dist/src/platforms/instagram/index.js +2 -0
  99. package/dist/src/platforms/instagram/index.js.map +1 -1
  100. package/dist/src/platforms/instagram/mqtt/connection.d.ts +4 -0
  101. package/dist/src/platforms/instagram/mqtt/connection.d.ts.map +1 -0
  102. package/dist/src/platforms/instagram/mqtt/connection.js +66 -0
  103. package/dist/src/platforms/instagram/mqtt/connection.js.map +1 -0
  104. package/dist/src/platforms/instagram/mqtt/thrift.d.ts +22 -0
  105. package/dist/src/platforms/instagram/mqtt/thrift.d.ts.map +1 -0
  106. package/dist/src/platforms/instagram/mqtt/thrift.js +143 -0
  107. package/dist/src/platforms/instagram/mqtt/thrift.js.map +1 -0
  108. package/dist/src/platforms/instagram/mqtt/transport.d.ts +42 -0
  109. package/dist/src/platforms/instagram/mqtt/transport.d.ts.map +1 -0
  110. package/dist/src/platforms/instagram/mqtt/transport.js +246 -0
  111. package/dist/src/platforms/instagram/mqtt/transport.js.map +1 -0
  112. package/dist/src/platforms/instagram/realtime-listener.d.ts +33 -0
  113. package/dist/src/platforms/instagram/realtime-listener.d.ts.map +1 -0
  114. package/dist/src/platforms/instagram/realtime-listener.js +151 -0
  115. package/dist/src/platforms/instagram/realtime-listener.js.map +1 -0
  116. package/dist/src/platforms/instagram/types.d.ts +10 -8
  117. package/dist/src/platforms/instagram/types.d.ts.map +1 -1
  118. package/dist/src/platforms/instagram/types.js.map +1 -1
  119. package/dist/src/platforms/kakaotalk/cli.js +1 -1
  120. package/dist/src/platforms/line/cli.js +1 -1
  121. package/dist/src/platforms/teams/app-config.d.ts +36 -0
  122. package/dist/src/platforms/teams/app-config.d.ts.map +1 -0
  123. package/dist/src/platforms/teams/app-config.js +69 -0
  124. package/dist/src/platforms/teams/app-config.js.map +1 -0
  125. package/dist/src/platforms/teams/client.d.ts +19 -2
  126. package/dist/src/platforms/teams/client.d.ts.map +1 -1
  127. package/dist/src/platforms/teams/client.js +295 -7
  128. package/dist/src/platforms/teams/client.js.map +1 -1
  129. package/dist/src/platforms/teams/commands/auth.d.ts +10 -0
  130. package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
  131. package/dist/src/platforms/teams/commands/auth.js +137 -3
  132. package/dist/src/platforms/teams/commands/auth.js.map +1 -1
  133. package/dist/src/platforms/teams/commands/file.d.ts +3 -0
  134. package/dist/src/platforms/teams/commands/file.d.ts.map +1 -1
  135. package/dist/src/platforms/teams/commands/file.js +59 -2
  136. package/dist/src/platforms/teams/commands/file.js.map +1 -1
  137. package/dist/src/platforms/teams/commands/message.d.ts +11 -0
  138. package/dist/src/platforms/teams/commands/message.d.ts.map +1 -1
  139. package/dist/src/platforms/teams/commands/message.js +121 -2
  140. package/dist/src/platforms/teams/commands/message.js.map +1 -1
  141. package/dist/src/platforms/teams/credential-manager.d.ts +23 -1
  142. package/dist/src/platforms/teams/credential-manager.d.ts.map +1 -1
  143. package/dist/src/platforms/teams/credential-manager.js +46 -2
  144. package/dist/src/platforms/teams/credential-manager.js.map +1 -1
  145. package/dist/src/platforms/teams/device-code.d.ts +48 -0
  146. package/dist/src/platforms/teams/device-code.d.ts.map +1 -0
  147. package/dist/src/platforms/teams/device-code.js +199 -0
  148. package/dist/src/platforms/teams/device-code.js.map +1 -0
  149. package/dist/src/platforms/teams/device-login.d.ts +37 -0
  150. package/dist/src/platforms/teams/device-login.d.ts.map +1 -0
  151. package/dist/src/platforms/teams/device-login.js +129 -0
  152. package/dist/src/platforms/teams/device-login.js.map +1 -0
  153. package/dist/src/platforms/teams/ensure-auth.d.ts.map +1 -1
  154. package/dist/src/platforms/teams/ensure-auth.js +12 -0
  155. package/dist/src/platforms/teams/ensure-auth.js.map +1 -1
  156. package/dist/src/platforms/teams/index.d.ts +7 -3
  157. package/dist/src/platforms/teams/index.d.ts.map +1 -1
  158. package/dist/src/platforms/teams/index.js +5 -2
  159. package/dist/src/platforms/teams/index.js.map +1 -1
  160. package/dist/src/platforms/teams/listener.d.ts +35 -0
  161. package/dist/src/platforms/teams/listener.d.ts.map +1 -0
  162. package/dist/src/platforms/teams/listener.js +236 -0
  163. package/dist/src/platforms/teams/listener.js.map +1 -0
  164. package/dist/src/platforms/teams/realm-discovery.d.ts +3 -0
  165. package/dist/src/platforms/teams/realm-discovery.d.ts.map +1 -0
  166. package/dist/src/platforms/teams/realm-discovery.js +33 -0
  167. package/dist/src/platforms/teams/realm-discovery.js.map +1 -0
  168. package/dist/src/platforms/teams/token-extractor.d.ts +3 -0
  169. package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
  170. package/dist/src/platforms/teams/token-extractor.js +60 -0
  171. package/dist/src/platforms/teams/token-extractor.js.map +1 -1
  172. package/dist/src/platforms/teams/token-provider.d.ts +25 -0
  173. package/dist/src/platforms/teams/token-provider.d.ts.map +1 -0
  174. package/dist/src/platforms/teams/token-provider.js +190 -0
  175. package/dist/src/platforms/teams/token-provider.js.map +1 -0
  176. package/dist/src/platforms/teams/trouter.d.ts +31 -0
  177. package/dist/src/platforms/teams/trouter.d.ts.map +1 -0
  178. package/dist/src/platforms/teams/trouter.js +181 -0
  179. package/dist/src/platforms/teams/trouter.js.map +1 -0
  180. package/dist/src/platforms/teams/types.d.ts +94 -0
  181. package/dist/src/platforms/teams/types.d.ts.map +1 -1
  182. package/dist/src/platforms/teams/types.js +30 -0
  183. package/dist/src/platforms/teams/types.js.map +1 -1
  184. package/dist/src/platforms/webex/cli.js +1 -1
  185. package/dist/src/platforms/webex/types.d.ts +1 -1
  186. package/dist/src/platforms/webexbot/cli.js +1 -1
  187. package/dist/src/platforms/wechatbot/cli.js +1 -1
  188. package/dist/src/platforms/whatsapp/cli.js +1 -1
  189. package/dist/src/platforms/whatsappbot/cli.js +1 -1
  190. package/dist/src/tui/adapters/imessage-adapter.d.ts +21 -0
  191. package/dist/src/tui/adapters/imessage-adapter.d.ts.map +1 -0
  192. package/dist/src/tui/adapters/imessage-adapter.js +110 -0
  193. package/dist/src/tui/adapters/imessage-adapter.js.map +1 -0
  194. package/dist/src/tui/adapters/instagram-adapter.d.ts.map +1 -1
  195. package/dist/src/tui/adapters/instagram-adapter.js +16 -0
  196. package/dist/src/tui/adapters/instagram-adapter.js.map +1 -1
  197. package/dist/src/tui/adapters/teams-adapter.d.ts +3 -0
  198. package/dist/src/tui/adapters/teams-adapter.d.ts.map +1 -1
  199. package/dist/src/tui/adapters/teams-adapter.js +21 -0
  200. package/dist/src/tui/adapters/teams-adapter.js.map +1 -1
  201. package/dist/src/tui/app.d.ts.map +1 -1
  202. package/dist/src/tui/app.js +12 -3
  203. package/dist/src/tui/app.js.map +1 -1
  204. package/docs/content/docs/agent-skills.mdx +1 -1
  205. package/docs/content/docs/cli/imessage.mdx +99 -0
  206. package/docs/content/docs/cli/instagram.mdx +2 -1
  207. package/docs/content/docs/cli/meta.json +1 -0
  208. package/docs/content/docs/cli/teams.mdx +22 -0
  209. package/docs/content/docs/index.mdx +9 -6
  210. package/docs/content/docs/quick-start.mdx +2 -0
  211. package/docs/content/docs/sdk/instagram.mdx +90 -5
  212. package/docs/content/docs/tui.mdx +4 -3
  213. package/package.json +10 -2
  214. package/scripts/postbuild.ts +12 -15
  215. package/skills/agent-channeltalk/SKILL.md +1 -1
  216. package/skills/agent-channeltalkbot/SKILL.md +1 -1
  217. package/skills/agent-discord/SKILL.md +1 -1
  218. package/skills/agent-discordbot/SKILL.md +1 -1
  219. package/skills/agent-imessage/SKILL.md +133 -0
  220. package/skills/agent-imessage/references/authentication.md +66 -0
  221. package/skills/agent-imessage/references/permissions.md +31 -0
  222. package/skills/agent-imessage/references/setup.md +49 -0
  223. package/skills/agent-instagram/SKILL.md +72 -2
  224. package/skills/agent-instagram/references/authentication.md +11 -0
  225. package/skills/agent-instagram/references/common-patterns.md +36 -0
  226. package/skills/agent-instagram/templates/monitor-chat.sh +5 -0
  227. package/skills/agent-kakaotalk/SKILL.md +1 -1
  228. package/skills/agent-line/SKILL.md +1 -1
  229. package/skills/agent-slack/SKILL.md +1 -1
  230. package/skills/agent-slackbot/SKILL.md +1 -1
  231. package/skills/agent-teams/SKILL.md +59 -6
  232. package/skills/agent-teams/references/authentication.md +31 -1
  233. package/skills/agent-telegram/SKILL.md +1 -1
  234. package/skills/agent-telegrambot/SKILL.md +1 -1
  235. package/skills/agent-webex/SKILL.md +1 -1
  236. package/skills/agent-webexbot/SKILL.md +1 -1
  237. package/skills/agent-wechatbot/SKILL.md +1 -1
  238. package/skills/agent-whatsapp/SKILL.md +1 -1
  239. package/skills/agent-whatsappbot/SKILL.md +1 -1
  240. package/src/cli.ts +4 -0
  241. package/src/platforms/discord/client.test.ts +86 -0
  242. package/src/platforms/discord/client.ts +10 -3
  243. package/src/platforms/imessage/cli.ts +39 -0
  244. package/src/platforms/imessage/client.test.ts +137 -0
  245. package/src/platforms/imessage/client.ts +253 -0
  246. package/src/platforms/imessage/commands/auth.ts +142 -0
  247. package/src/platforms/imessage/commands/chat.ts +51 -0
  248. package/src/platforms/imessage/commands/doctor.test.ts +80 -0
  249. package/src/platforms/imessage/commands/doctor.ts +139 -0
  250. package/src/platforms/imessage/commands/index.ts +6 -0
  251. package/src/platforms/imessage/commands/message.test.ts +20 -0
  252. package/src/platforms/imessage/commands/message.ts +151 -0
  253. package/src/platforms/imessage/commands/setup.test.ts +52 -0
  254. package/src/platforms/imessage/commands/setup.ts +76 -0
  255. package/src/platforms/imessage/commands/shared.test.ts +19 -0
  256. package/src/platforms/imessage/commands/shared.ts +69 -0
  257. package/src/platforms/imessage/commands/whoami.ts +22 -0
  258. package/src/platforms/imessage/credential-manager.test.ts +122 -0
  259. package/src/platforms/imessage/credential-manager.ts +123 -0
  260. package/src/platforms/imessage/ensure-auth.ts +18 -0
  261. package/src/platforms/imessage/errors.ts +27 -0
  262. package/src/platforms/imessage/index.test.ts +13 -0
  263. package/src/platforms/imessage/index.ts +16 -0
  264. package/src/platforms/imessage/rpc.ts +157 -0
  265. package/src/platforms/imessage/test-stub-imsg.mjs +147 -0
  266. package/src/platforms/imessage/types.test.ts +47 -0
  267. package/src/platforms/imessage/types.ts +95 -0
  268. package/src/platforms/instagram/client.test.ts +478 -33
  269. package/src/platforms/instagram/client.ts +472 -68
  270. package/src/platforms/instagram/commands/auth.test.ts +177 -1
  271. package/src/platforms/instagram/commands/auth.ts +182 -11
  272. package/src/platforms/instagram/credential-manager.test.ts +30 -0
  273. package/src/platforms/instagram/credential-manager.ts +23 -1
  274. package/src/platforms/instagram/hybrid-listener.test.ts +135 -0
  275. package/src/platforms/instagram/hybrid-listener.ts +196 -0
  276. package/src/platforms/instagram/index.ts +10 -0
  277. package/src/platforms/instagram/mqtt/connection.ts +72 -0
  278. package/src/platforms/instagram/mqtt/thrift.test.ts +91 -0
  279. package/src/platforms/instagram/mqtt/thrift.ts +159 -0
  280. package/src/platforms/instagram/mqtt/transport.ts +285 -0
  281. package/src/platforms/instagram/realtime-listener.test.ts +34 -0
  282. package/src/platforms/instagram/realtime-listener.ts +201 -0
  283. package/src/platforms/instagram/types.ts +11 -8
  284. package/src/platforms/teams/app-config.ts +92 -0
  285. package/src/platforms/teams/client.test.ts +335 -1
  286. package/src/platforms/teams/client.ts +342 -7
  287. package/src/platforms/teams/commands/auth.test.ts +93 -1
  288. package/src/platforms/teams/commands/auth.ts +182 -3
  289. package/src/platforms/teams/commands/file.test.ts +92 -1
  290. package/src/platforms/teams/commands/file.ts +76 -1
  291. package/src/platforms/teams/commands/message.test.ts +95 -1
  292. package/src/platforms/teams/commands/message.ts +145 -3
  293. package/src/platforms/teams/credential-manager.test.ts +20 -0
  294. package/src/platforms/teams/credential-manager.ts +68 -3
  295. package/src/platforms/teams/device-code.test.ts +311 -0
  296. package/src/platforms/teams/device-code.ts +277 -0
  297. package/src/platforms/teams/device-login.test.ts +288 -0
  298. package/src/platforms/teams/device-login.ts +206 -0
  299. package/src/platforms/teams/ensure-auth.ts +11 -0
  300. package/src/platforms/teams/index.test.ts +10 -0
  301. package/src/platforms/teams/index.ts +16 -1
  302. package/src/platforms/teams/listener.ts +295 -0
  303. package/src/platforms/teams/realm-discovery.test.ts +73 -0
  304. package/src/platforms/teams/realm-discovery.ts +42 -0
  305. package/src/platforms/teams/token-extractor.ts +69 -0
  306. package/src/platforms/teams/token-provider.test.ts +227 -0
  307. package/src/platforms/teams/token-provider.ts +284 -0
  308. package/src/platforms/teams/trouter.test.ts +114 -0
  309. package/src/platforms/teams/trouter.ts +228 -0
  310. package/src/platforms/teams/types.test.ts +17 -0
  311. package/src/platforms/teams/types.ts +86 -0
  312. package/src/platforms/webexbot/cli.ts +0 -0
  313. package/src/tui/adapters/imessage-adapter.ts +131 -0
  314. package/src/tui/adapters/instagram-adapter.ts +13 -0
  315. package/src/tui/adapters/teams-adapter.ts +23 -0
  316. package/src/tui/app.ts +16 -3
@@ -0,0 +1,66 @@
1
+ # Authentication
2
+
3
+ iMessage authentication is unlike the other platforms: there are **no tokens, cookies, or login flow**. `agent-imessage` drives the local [imsg](https://github.com/openclaw/imsg) tool, which relies on **macOS permissions** (Full Disk Access + Automation) granted to the process that launches it. "Authentication" here means: imsg is installed, Messages.app is signed into your Apple ID, and the permissions are granted.
4
+
5
+ ## What gets stored
6
+
7
+ The credential manager stores an **account record with no secrets** in `~/.config/agent-messenger/imessage-credentials.json` (mode `0600`):
8
+
9
+ ```jsonc
10
+ {
11
+ "current": "default",
12
+ "accounts": {
13
+ "default": {
14
+ "account_id": "default",
15
+ "provider": "imsg", // backend-agnostic discriminator
16
+ "binary_path": "/opt/homebrew/bin/imsg", // optional; defaults to "imsg" on PATH
17
+ "region": "US", // optional; default region for local-format phone numbers
18
+ "created_at": "…",
19
+ "updated_at": "…"
20
+ }
21
+ }
22
+ }
23
+ ```
24
+
25
+ There is no password/token field — access is governed entirely by macOS TCC permissions.
26
+
27
+ ## Configuring an account
28
+
29
+ Guided:
30
+ ```bash
31
+ agent-imessage setup # verifies imsg + permissions (honors --bin/--region), then saves
32
+ ```
33
+
34
+ Scriptable:
35
+ ```bash
36
+ agent-imessage auth set --bin /opt/homebrew/bin/imsg --region US --current
37
+ agent-imessage auth status # via: agent-imessage doctor
38
+ agent-imessage auth list
39
+ agent-imessage auth use <account-id>
40
+ agent-imessage auth remove <account-id>
41
+ agent-imessage auth logout # clears all stored accounts
42
+ ```
43
+
44
+ ## Credential resolution order
45
+
46
+ When a command runs, the active configuration is resolved as:
47
+
48
+ 1. `--account <id>` (explicit account selection), then
49
+ 2. `AGENT_IMESSAGE_BIN` / `AGENT_IMESSAGE_REGION` environment variables (runtime override — **never persisted to disk**), then
50
+ 3. the stored **current** account, then
51
+ 4. defaults (`imsg` on PATH, no region).
52
+
53
+ If nothing resolves, commands exit with `{ "code": "not_authenticated" }` and point to `agent-imessage setup`.
54
+
55
+ ## Permissions (the real "auth")
56
+
57
+ imsg needs two macOS permissions, granted to the **parent process** (the terminal / agent runtime that launches `agent-messenger`), not to `imsg` in isolation:
58
+
59
+ - **Full Disk Access** — to read `~/Library/Messages/chat.db`. Missing → `{ "code": "full_disk_access" }`.
60
+ - **Automation → Messages** — to send. Missing → `{ "code": "automation_denied" }`.
61
+
62
+ These are user-consent TCC grants and **cannot be scripted**. See [permissions](permissions.md) for the exact steps and the parent-process caveat. Run `agent-imessage doctor` to check status.
63
+
64
+ ## Multi-account
65
+
66
+ Each account is an imsg configuration (binary path + default region). Messages.app has no from-selector, so **send is single-account per Mac**; multiple accounts are only meaningful if you run distinct imsg setups.
@@ -0,0 +1,31 @@
1
+ # macOS Permissions for imsg
2
+
3
+ `agent-imessage` drives [imsg](https://github.com/openclaw/imsg), which needs two macOS permissions. These are TCC (Transparency, Consent, and Control) grants that **cannot be scripted** — a human must approve them once in System Settings.
4
+
5
+ ## Full Disk Access (required for everything)
6
+
7
+ imsg reads the Messages database at `~/Library/Messages/chat.db`, which macOS protects behind Full Disk Access.
8
+
9
+ - **Grant to:** the app/terminal/agent-runtime that launches `agent-messenger` — **the parent process**, not `imsg` alone.
10
+ - **Where:** System Settings → Privacy & Security → Full Disk Access → enable your terminal/app → restart it.
11
+ - **Symptom when missing:** `agent-imessage doctor` reports `full_disk_access: denied`; commands return `{ "code": "full_disk_access" }`.
12
+
13
+ ## Automation → Messages (required to send)
14
+
15
+ Sending uses AppleScript automation of Messages.app.
16
+
17
+ - **Grant to:** same parent process.
18
+ - **Where:** System Settings → Privacy & Security → Automation → (your app) → enable **Messages**. macOS prompts automatically on the first send attempt.
19
+ - **Symptom when missing:** sends fail with `{ "code": "automation_denied" }`.
20
+
21
+ ## Contacts (optional)
22
+
23
+ Used only to resolve sender names. Nothing breaks without it; `from_name` is simply absent.
24
+
25
+ ## Why these can't be automated
26
+
27
+ TCC grants are deliberately user-consent-only. `tccutil` can reset permissions but cannot grant them, and the TCC database is protected by SIP. There is no supported way to grant Full Disk Access or Automation programmatically on an unmanaged Mac — plan for a one-time manual approval (a quick Screen Sharing/VNC session works for a headless Mac).
28
+
29
+ ## SIP and the advanced bridge
30
+
31
+ Core features (send/read/watch/standard tapbacks) need **no SIP changes**. Only the advanced bridge (`imsg launch`: typing, edit/unsend, group management, targeted/custom reactions) requires **disabling SIP**, which is a separate, deliberate step and out of scope for the core `agent-imessage` features.
@@ -0,0 +1,49 @@
1
+ # imsg Setup (Operator Guide)
2
+
3
+ iMessage has no public API. `agent-imessage` runs **on a Mac** and uses [imsg](https://github.com/openclaw/imsg) — a native Swift CLI — to read the local Messages database and send through Messages.app. The agent must run on the same Mac (imsg is local-only; there is no network/server).
4
+
5
+ ## Requirements
6
+
7
+ - **macOS 14+** (Sonoma or newer). imsg supports macOS 26/Tahoe with caveats (group sends via AppleScript can fail; imsg reports the failure honestly rather than lying).
8
+ - **Messages.app signed in** to your Apple ID. A **dedicated Apple ID** is recommended to avoid mixing automated traffic with your personal account.
9
+ - **imsg installed**: `brew install steipete/tap/imsg`.
10
+ - **Full Disk Access** and **Automation → Messages** permissions (see below).
11
+
12
+ ## One-time setup
13
+
14
+ 1. **Install imsg**
15
+ ```bash
16
+ brew install steipete/tap/imsg
17
+ imsg --version
18
+ ```
19
+ 2. **Sign Messages.app into iMessage** with your (dedicated) Apple ID.
20
+ 3. **Grant Full Disk Access** — System Settings → Privacy & Security → Full Disk Access → add the app/terminal that will launch `agent-messenger`. This is required to read `~/Library/Messages/chat.db`.
21
+ 4. **Grant Automation → Messages** — triggered on first send; approve the prompt (System Settings → Privacy & Security → Automation → Messages).
22
+ 5. **Verify and save an account**
23
+ ```bash
24
+ agent-imessage setup # guided: checks imsg + permissions, saves account
25
+ agent-imessage doctor # re-check anytime
26
+ ```
27
+
28
+ ### The parent-process permission caveat (important)
29
+
30
+ macOS grants Full Disk Access and Automation to the **process that launches imsg** — i.e. the terminal, IDE, or agent runtime that runs `agent-imessage`, not `imsg` in isolation. If `doctor` reports `full_disk_access: denied`, grant Full Disk Access to **that launching app** and restart it.
31
+
32
+ ## Feature tiers
33
+
34
+ - **Core (no SIP):** list/search chats, read history, send text, watch new messages, standard tapbacks (to the most recent incoming message). This is all that `agent-imessage` v1 uses.
35
+ - **Bridge (advanced):** typing indicators, read receipts, edit/unsend, group create/rename/members, and reacting to a *specific* message or with custom emoji. These require `imsg launch` (which injects into IMCore) and **disabling SIP**. Not used by v1; documented for completeness.
36
+
37
+ ## Multi-account
38
+
39
+ Each `agent-imessage` account is an imsg configuration (binary path + default region). Messages.app has no from-selector, so **send is single-account** per Mac. Configure additional accounts only if you run multiple imsg binaries/setups:
40
+ ```bash
41
+ agent-imessage auth set --bin /opt/homebrew/bin/imsg --region US --account home --current
42
+ agent-imessage auth use home
43
+ ```
44
+
45
+ ## Reliability notes
46
+
47
+ - The Mac must stay awake and logged in for live `watch` to keep receiving.
48
+ - imsg's watcher uses filesystem events + polling and re-arms across Messages database (WAL) rotation, so it keeps up on busy/iCloud-synced databases.
49
+ - Pin macOS updates if stability matters — major updates can change AppleScript/IMCore behavior.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-instagram
3
3
  description: Interact with Instagram DMs - send messages, read conversations, manage accounts
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-instagram:*)
6
6
  metadata:
7
7
  openclaw:
@@ -27,7 +27,7 @@ Use one of these entrypoints:
27
27
  - **Thread ID** = Instagram's identifier for a DM conversation. Numeric string returned by `chat list`.
28
28
  - **Browser cookie extraction** = recommended auth method. Extracts cookies from Chromium browsers (Chrome, Chrome Canary, Edge, Arc, Brave, Vivaldi, Chromium) where you're logged into instagram.com. Zero-config.
29
29
  - **Username/password auth** = fallback method. Authenticates using Instagram credentials. Supports two-factor authentication via SMS or authenticator app.
30
- - **HTTP-based** = each command makes HTTP requests and returns. No persistent connection or background process.
30
+ - **HTTP-based** = each CLI command makes HTTP requests and returns. No persistent connection or background process. The SDK additionally offers real-time listeners (`InstagramHybridListener`, `InstagramRealtimeListener`) for streaming DMs — see [SDK: Real-Time Events](#sdk-real-time-events) below.
31
31
  - **Multi-account** = multiple Instagram accounts can be stored. Use `auth list` and `auth use` to switch between them.
32
32
  - **DM-only** = this CLI focuses on Instagram Direct Messages. It does not manage posts, stories, or followers.
33
33
 
@@ -440,3 +440,73 @@ Instagram invalidates sessions based on device fingerprinting and activity patte
440
440
  1. Avoid frequent re-authentication
441
441
  2. Space out API calls
442
442
  3. Don't switch between multiple IP addresses rapidly
443
+
444
+ ## SDK: Real-Time Events
445
+
446
+ `InstagramHybridListener` connects over Instagram's MQTToT transport (a persistent TLS connection to `edge-mqtt.facebook.com`) and falls back to polling automatically if the connection fails. It retries realtime with capped exponential backoff. This is the recommended listener for most use cases.
447
+
448
+ `InstagramRealtimeListener` is the pure-realtime option with no polling fallback — use it when you want direct MQTToT and prefer to handle reconnection yourself.
449
+
450
+ Both use the unofficial private API, the same risk surface as the existing polling listener.
451
+
452
+ ### Setup
453
+
454
+ ```typescript
455
+ import { InstagramClient, InstagramHybridListener } from 'agent-messenger/instagram'
456
+
457
+ const client = await new InstagramClient().login()
458
+ const listener = new InstagramHybridListener(client, {
459
+ pollInterval: 5000, // fallback poll interval in ms
460
+ realtimeRetryBaseMs: 2000, // backoff base for realtime reconnect
461
+ realtimeRetryMaxMs: 60000, // backoff cap
462
+ })
463
+ ```
464
+
465
+ Or for pure realtime:
466
+
467
+ ```typescript
468
+ import { InstagramClient, InstagramRealtimeListener } from 'agent-messenger/instagram'
469
+
470
+ const client = await new InstagramClient().login()
471
+ const listener = new InstagramRealtimeListener(client)
472
+ ```
473
+
474
+ ### Listening for Events
475
+
476
+ ```typescript
477
+ listener.on('connected', ({ userId, transport }) => {
478
+ // transport is 'realtime' or 'polling' (hybrid only)
479
+ console.log(`Listening as ${userId} via ${transport}`)
480
+ })
481
+
482
+ listener.on('message', (msg) => {
483
+ // msg.id, msg.thread_id, msg.from, msg.timestamp
484
+ // msg.is_outgoing, msg.type, msg.text, msg.media_url
485
+ if (msg.is_outgoing) return
486
+ console.log(`[${msg.thread_id}] ${msg.from}: ${msg.text}`)
487
+ })
488
+
489
+ listener.on('error', (err) => {
490
+ console.error(err.message)
491
+ })
492
+
493
+ listener.on('disconnected', () => {
494
+ // hybrid listener retries realtime automatically
495
+ })
496
+ ```
497
+
498
+ ### Lifecycle
499
+
500
+ ```typescript
501
+ await listener.start() // connects via MQTToT (or starts polling fallback)
502
+ listener.stop() // clean shutdown
503
+ ```
504
+
505
+ ### Event Types
506
+
507
+ | Event | Payload (Hybrid) | Payload (Realtime / Polling) | Description |
508
+ | -------------- | --------------------------------------------------------- | ---------------------------- | ------------------------------ |
509
+ | `message` | `InstagramMessageSummary` | `InstagramMessageSummary` | New DM received |
510
+ | `connected` | `{ userId: string; transport: 'realtime' \| 'polling' }` | `{ userId: string }` | Listener active |
511
+ | `disconnected` | — | — | Connection closed |
512
+ | `error` | `Error` | `Error` | Connection or API error |
@@ -196,10 +196,21 @@ Session data (cookies and tokens) is stored per account:
196
196
  ~/.config/agent-messenger/instagram/<account-id>/
197
197
  ```
198
198
 
199
+ A device profile (randomized Android device identifiers) is generated once and
200
+ shared across all accounts on this machine, so repeat logins present a
201
+ consistent device fingerprint:
202
+
203
+ ```
204
+ ~/.config/agent-messenger/instagram/device.json
205
+ ```
206
+
199
207
  ### Security
200
208
 
201
209
  - Credentials file permissions: `0600` (owner read/write only)
202
210
  - Session cookies are stored in plaintext on disk
211
+ - `device.json` holds no secrets — only synthetic device identifiers — but is
212
+ shared across accounts, so all accounts on this machine share one device
213
+ fingerprint
203
214
  - Keep these files secure. They grant full access to your Instagram account
204
215
  - Never commit to version control
205
216
 
@@ -323,6 +323,39 @@ agent-instagram message send-to alice "Hello!"
323
323
  agent-instagram message send 12345678901 "Hello!"
324
324
  ```
325
325
 
326
+ ## Pattern 11: Real-Time DM Monitor (SDK)
327
+
328
+ **Use case**: Receive new DMs as they arrive, without polling
329
+
330
+ The SDK's `InstagramHybridListener` is the right tool for continuous DM monitoring. It connects over Instagram's MQTToT transport and falls back to polling automatically — no manual loop or `sleep` needed.
331
+
332
+ ```typescript
333
+ import { InstagramClient, InstagramHybridListener } from 'agent-messenger/instagram'
334
+
335
+ const client = await new InstagramClient().login()
336
+ const listener = new InstagramHybridListener(client)
337
+
338
+ listener.on('connected', ({ userId, transport }) => {
339
+ console.log(`Listening as ${userId} via ${transport}`)
340
+ })
341
+
342
+ listener.on('message', (msg) => {
343
+ if (msg.is_outgoing) return
344
+ console.log(`[${msg.thread_id}] ${msg.from}: ${msg.text ?? `[${msg.type}]`}`)
345
+ })
346
+
347
+ listener.on('error', (err) => {
348
+ console.error('Listener error:', err.message)
349
+ })
350
+
351
+ await listener.start()
352
+ // Runs until listener.stop() is called
353
+ ```
354
+
355
+ **When to use**: Any time you need to react to incoming DMs in real time — notifications, bots, monitoring dashboards. Prefer this over a polling shell loop.
356
+
357
+ **Contrast with shell polling**: The `monitor-chat.sh` template uses `sleep` + `message list` in a loop. That works for simple scripts but makes one HTTP request per interval and can't react faster than the interval. The SDK listener holds a persistent connection and delivers messages as they arrive.
358
+
326
359
  ## Anti-Patterns
327
360
 
328
361
  ### Don't Poll Too Frequently
@@ -341,6 +374,8 @@ while true; do
341
374
  done
342
375
  ```
343
376
 
377
+ For real-time monitoring, the SDK's `InstagramHybridListener` is a better alternative — it holds a persistent connection and avoids repeated HTTP requests entirely. See [Pattern 11](#pattern-11-real-time-dm-monitor-sdk) above.
378
+
344
379
  ### Don't Spam Threads
345
380
 
346
381
  ```bash
@@ -360,3 +395,4 @@ agent-instagram message send "$THREAD" "$MESSAGE"
360
395
  ## See Also
361
396
 
362
397
  - [Authentication Guide](authentication.md) - Setting up credentials
398
+ - For real-time events, use the `InstagramHybridListener` SDK (see SKILL.md → SDK: Real-Time Events)
@@ -12,6 +12,11 @@
12
12
  # Example:
13
13
  # ./monitor-chat.sh 340282366841710300949128138443434234567
14
14
  # ./monitor-chat.sh 340282366841710300949128138443434234567 10
15
+ #
16
+ # NOTE: For real-time monitoring, prefer the SDK's InstagramHybridListener over
17
+ # this poll-based approach. It connects over Instagram's MQTToT transport and
18
+ # delivers messages as they arrive, with automatic fallback to polling if needed.
19
+ # See SKILL.md -> SDK: Real-Time Events for setup and usage.
15
20
 
16
21
  set -euo pipefail
17
22
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-kakaotalk
3
3
  description: Interact with KakaoTalk - send messages, read chats, manage conversations
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-kakaotalk:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-line
3
3
  description: Interact with LINE - send messages, read chats, manage conversations
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-line:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-slack
3
3
  description: Interact with Slack workspaces - send messages, read channels, manage reactions
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-slack:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-slackbot
3
3
  description: Interact with Slack workspaces using bot tokens - send messages, read channels, manage reactions
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-slackbot:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-teams
3
3
  description: Interact with Microsoft Teams - send messages, read channels, manage reactions
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-teams:*)
6
6
  metadata:
7
7
  openclaw:
@@ -33,11 +33,30 @@ agent-teams channel list <team-id>
33
33
 
34
34
  ## Authentication
35
35
 
36
- Credentials are extracted automatically from the Teams desktop app (or Chromium browser as fallback) on first use. No manual setup required just run any command and authentication happens silently in the background.
36
+ Two co-equal ways to sign inpick whichever fits:
37
37
 
38
- Teams tokens expire in 60-90 minutes. The CLI automatically re-extracts a fresh token when the current one expires, so you don't need to manage token lifecycle manually.
38
+ 1. **`agent-teams auth login`** (work/school **or** personal Microsoft accounts) — device-code sign-in. Open the printed URL, enter the code, and approve in your browser. No desktop app or browser extraction needed. It prompts for your Microsoft email (or pass `--email <email>`) and auto-detects work vs personal, then starts the matching flow; pass `--account-type work|personal` to force it and skip detection. Only `auth login` stores the AAD refresh token required by `message search`.
39
+ 2. **`agent-teams auth extract`** — zero-config extraction from the Teams desktop app, falling back to a Chromium browser. Best when you're already signed into Teams locally. Yields a Skype token only — sufficient for messaging, but **not** for `message search` (see below).
39
40
 
40
- **IMPORTANT**: Always use `agent-teams auth extract` to obtain tokens. The CLI extracts from the desktop app first, falling back to Chromium browsers if the app isn't installed.
41
+ Credentials are also extracted automatically on first use of any command if none are stored, so `auth extract` can happen silently in the background.
42
+
43
+ Teams tokens are short-lived (60-90 minutes for extraction, a few hours for device-code). **Device-code accounts (`auth login`) refresh silently** — the CLI re-mints an expired token from the stored refresh token with no re-login needed. Extraction accounts re-extract automatically as long as you're still signed into the Teams desktop app or a supported browser; if that fails, re-run `auth extract` (or switch to `auth login`).
44
+
45
+ ### Non-interactive `auth login` (agents / CI)
46
+
47
+ When there's no TTY, `auth login` splits into two calls:
48
+
49
+ ```bash
50
+ # 1. Start — returns verification_uri, user_code, and device_code as JSON.
51
+ # Pass --email to auto-detect the account type (no prompt without a TTY),
52
+ # or --account-type work|personal to force it.
53
+ agent-teams auth login --email <email>
54
+
55
+ # 2. After the user approves in a browser, finish with the device_code
56
+ agent-teams auth login --device-code <device_code>
57
+ ```
58
+
59
+ `--client-id <id>` overrides the AAD client ID on either call (or set `AGENT_TEAMS_CLIENT_ID`). `--account-type <work|personal>` selects the account (default `work`); it is preserved across the two-call flow, so pass it to both calls when signing in to a personal account non-interactively.
41
60
 
42
61
  ### Multi-Team Support
43
62
 
@@ -145,6 +164,10 @@ If a memorized ID returns an error (channel not found, team not found), remove i
145
164
  ### Auth Commands
146
165
 
147
166
  ```bash
167
+ # Sign in via device code (personal Microsoft accounts).
168
+ agent-teams auth login
169
+ agent-teams auth login --device-code <code> # finish a non-interactive login
170
+
148
171
  # Extract token from Teams desktop app or browser (usually automatic)
149
172
  agent-teams auth extract
150
173
  agent-teams auth extract --debug
@@ -191,8 +214,14 @@ agent-teams message get <team-id> <channel-id> <message-id>
191
214
 
192
215
  # Delete a message
193
216
  agent-teams message delete <team-id> <channel-id> <message-id> --force
217
+
218
+ # Search messages across Teams (requires `auth login` — see Authentication)
219
+ agent-teams message search <query>
220
+ agent-teams message search "deploy" --limit 10 --from 0
194
221
  ```
195
222
 
223
+ `message search` requires an `auth login` account: it queries Microsoft's Substrate search API with an AAD token that `auth extract` (cookie-based) cannot provide. Cookie-only accounts get a clear error telling you to run `auth login`. `--limit` is a positive integer (default 20); `--from` is a non-negative offset for pagination (default 0).
224
+
196
225
  ### Channel Commands
197
226
 
198
227
  ```bash
@@ -279,8 +308,15 @@ agent-teams file list <team-id> <channel-id>
279
308
 
280
309
  # Get file info
281
310
  agent-teams file info <team-id> <channel-id> <file-id>
311
+
312
+ # Download a file (to a path or directory; defaults to the current dir)
313
+ agent-teams file download <team-id> <channel-id> <file-id>
314
+ agent-teams file download <team-id> <channel-id> <file-id> ./report.pdf
315
+ agent-teams file download <team-id> <channel-id> <file-id> ./downloads/ --pretty
282
316
  ```
283
317
 
318
+ `file download` output: `{ "id", "name", "size", "content_type", "path" }` where `path` is where the file was written. Inline/image attachments download with the extracted Skype token and work for any signed-in account; SharePoint/OneDrive documents download via Microsoft Graph and require an `auth login` account (cookie-only `auth extract` accounts get a clear error telling you to run `auth login`).
319
+
284
320
  ### Snapshot Command
285
321
 
286
322
  Get team overview for AI agents (brief by default):
@@ -427,13 +463,30 @@ await client.addReaction(teams[0].id, channels[0].id, msg.id, 'like')
427
463
  await client.uploadFile(teams[0].id, channels[0].id, './report.pdf')
428
464
  ```
429
465
 
466
+ ### Real-time Events
467
+
468
+ Stream Teams chat messages in real time over the internal trouter WebSocket — as a user, no bot and no public endpoint. Requires the Teams desktop app to be logged in.
469
+
470
+ ```typescript
471
+ import { TeamsClient, TeamsListener } from 'agent-messenger/teams'
472
+
473
+ const client = await new TeamsClient().login()
474
+ const listener = new TeamsListener(client)
475
+
476
+ listener.on('message', (message) => {
477
+ console.log(`New message in ${message.chatId}: ${message.content}`)
478
+ })
479
+
480
+ await listener.start()
481
+ ```
482
+
430
483
  ### Full API Reference
431
484
 
432
485
  See the [Teams SDK documentation](https://agent-messenger.dev/docs/sdk/teams) for complete method signatures, types, schemas, and examples.
433
486
 
434
487
  ## Limitations
435
488
 
436
- - No real-time events / WebSocket connection
489
+ - Real-time events are SDK-only (`TeamsListener`); the CLI has no `watch` command
437
490
  - No voice/video channel support
438
491
  - No team management (create/delete channels, roles)
439
492
  - Personal accounts: chats only (no teams/channels); use the `chat` commands
@@ -441,7 +494,7 @@ See the [Teams SDK documentation](https://agent-messenger.dev/docs/sdk/teams) fo
441
494
  - No webhook support
442
495
  - Plain text messages only (no adaptive cards in v1)
443
496
  - User tokens only (no app tokens)
444
- - **Token expires in 60-90 minutes** - auto-refreshed, but requires Teams desktop app or browser to be logged in
497
+ - **Tokens are short-lived** - device-code (`auth login`) accounts refresh silently from the stored refresh token; extraction accounts auto-refresh but need the Teams desktop app or browser to still be logged in
445
498
 
446
499
  ## Troubleshooting
447
500
 
@@ -95,10 +95,21 @@ The tool searches within:
95
95
 
96
96
  ### What Gets Extracted
97
97
 
98
- - **skypetoken_asm**: Authentication token for Teams API
98
+ - **skypetoken_asm**: Authentication token for Teams API (sent as the `X-Skypetoken` header)
99
99
  - **teams**: All teams you're a member of
100
100
  - **token_extracted_at**: Timestamp for expiry tracking
101
101
 
102
+ ### Real-time Auth (`authtoken` / id_token)
103
+
104
+ The real-time `TeamsListener` (SDK) additionally needs an OAuth Bearer token to
105
+ authenticate its trouter WebSocket connection. This is **not** persisted with
106
+ your credentials — the client extracts it on demand from the Teams `authtoken`
107
+ cookie (a JWE, stored URL-encoded with a `Bearer=` prefix), decrypted with the
108
+ same keychain machinery as `skypetoken_asm`. The listener re-extracts it on
109
+ every (re)connection, so it always uses the current cookie value. Because it is
110
+ read live from the desktop app's cookie store, the Teams desktop app must be
111
+ logged in for real-time streaming to work.
112
+
102
113
  ## Multi-Team Management
103
114
 
104
115
  ### List Teams
@@ -181,6 +192,25 @@ Credentials are stored in:
181
192
  - Keep this file secure - it grants access to your Teams account
182
193
  - **Tokens auto-expire in 60-90 minutes** - provides some security
183
194
 
195
+ ## AAD Tokens (required for `message search`)
196
+
197
+ Most commands use only the Skype token above. **`message search` is different**: it queries Microsoft's Substrate search API, which requires an AAD Bearer token for the `substrate.office.com` audience — a token the Skype cookie cannot produce.
198
+
199
+ - **Only `auth login` (device-code) can mint it.** That flow stores an `aad_refresh_token` (and `aad_client_id`) alongside the Skype token. `auth extract` (cookie extraction) yields a Skype token only and therefore **cannot** run `message search` — the CLI returns an actionable error telling you to run `auth login`.
200
+ - **Work and personal accounts** are both supported by `auth login`. It detects the account type from your Microsoft email (prompted interactively, or via `--email <email>`) and starts the matching flow; `--account-type work|personal` forces it and skips detection. If a personal account still reaches the work flow, the CLI stops with an actionable hint to rerun with `--account-type personal`.
201
+ - At search time, the CLI silently exchanges the stored refresh token for a short-lived Substrate access token (per-scope AAD grant), caches it in memory only (never written to disk), and rotates the refresh token. The same mechanism can mint a Graph token for other AAD-gated features.
202
+
203
+ Credentials for an `auth login` account therefore include additional fields:
204
+
205
+ ```json
206
+ {
207
+ "account_type": "work",
208
+ "auth_method": "device-code",
209
+ "aad_refresh_token": "0.AXoA...redacted...",
210
+ "aad_client_id": "5e3ce6c0-2b1f-4285-8d4b-75ee78787346"
211
+ }
212
+ ```
213
+
184
214
  ## Authentication Status
185
215
 
186
216
  Check if you're authenticated:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-telegram
3
3
  description: Interact with Telegram through TDLib - authenticate, inspect chats, and send messages
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-telegram:*)
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-telegrambot
3
3
  description: Interact with Telegram using bot tokens - send messages, read chats, manage reactions
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-telegrambot:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-webex
3
3
  description: Interact with Cisco Webex - send messages, read spaces, manage memberships
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-webex:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-webexbot
3
3
  description: Interact with Cisco Webex using bot tokens - send messages, reply in threads, upload and download files, look up people, read spaces, manage memberships, stream real-time events
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-webexbot:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-wechatbot
3
3
  description: Interact with WeChat Official Account using API credentials - send messages, manage templates, list followers
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-wechatbot:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-whatsapp
3
3
  description: Interact with WhatsApp - send messages, read chats, manage conversations
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-whatsapp:*)
6
6
  metadata:
7
7
  openclaw:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-whatsappbot
3
3
  description: Interact with WhatsApp using Cloud API credentials - send messages, manage templates
4
- version: 2.27.2
4
+ version: 2.29.0
5
5
  allowed-tools: Bash(agent-whatsappbot:*)
6
6
  metadata:
7
7
  openclaw:
package/src/cli.ts CHANGED
@@ -68,6 +68,10 @@ program.command('channeltalk', 'Interact with Channel Talk', {
68
68
  executableFile: join(__dirname, 'platforms', 'channeltalk', `cli${ext}`),
69
69
  })
70
70
 
71
+ program.command('imessage', 'Interact with iMessage via imsg (local, on-Mac)', {
72
+ executableFile: join(__dirname, 'platforms', 'imessage', `cli${ext}`),
73
+ })
74
+
71
75
  program.command('channeltalkbot', 'Interact with Channel Talk using API credentials', {
72
76
  executableFile: join(__dirname, 'platforms', 'channeltalkbot', `cli${ext}`),
73
77
  })