agent-messenger 2.0.0 → 2.2.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 (272) hide show
  1. package/.claude-plugin/marketplace.json +14 -1
  2. package/.claude-plugin/plugin.json +4 -2
  3. package/.env.template +35 -17
  4. package/README.md +37 -33
  5. package/bun.lock +6 -6
  6. package/dist/package.json +11 -3
  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/channeltalk/commands/auth.d.ts.map +1 -1
  11. package/dist/src/platforms/channeltalk/commands/auth.js +35 -28
  12. package/dist/src/platforms/channeltalk/commands/auth.js.map +1 -1
  13. package/dist/src/platforms/channeltalk/ensure-auth.js +6 -6
  14. package/dist/src/platforms/channeltalk/ensure-auth.js.map +1 -1
  15. package/dist/src/platforms/channeltalk/token-extractor.d.ts +23 -1
  16. package/dist/src/platforms/channeltalk/token-extractor.d.ts.map +1 -1
  17. package/dist/src/platforms/channeltalk/token-extractor.js +299 -29
  18. package/dist/src/platforms/channeltalk/token-extractor.js.map +1 -1
  19. package/dist/src/platforms/discord/commands/auth.d.ts.map +1 -1
  20. package/dist/src/platforms/discord/commands/auth.js +57 -49
  21. package/dist/src/platforms/discord/commands/auth.js.map +1 -1
  22. package/dist/src/platforms/discord/ensure-auth.js +3 -3
  23. package/dist/src/platforms/discord/ensure-auth.js.map +1 -1
  24. package/dist/src/platforms/discord/token-extractor.d.ts +6 -1
  25. package/dist/src/platforms/discord/token-extractor.d.ts.map +1 -1
  26. package/dist/src/platforms/discord/token-extractor.js +167 -14
  27. package/dist/src/platforms/discord/token-extractor.js.map +1 -1
  28. package/dist/src/platforms/instagram/client.d.ts +2 -0
  29. package/dist/src/platforms/instagram/client.d.ts.map +1 -1
  30. package/dist/src/platforms/instagram/client.js +2 -2
  31. package/dist/src/platforms/instagram/client.js.map +1 -1
  32. package/dist/src/platforms/instagram/commands/auth.d.ts.map +1 -1
  33. package/dist/src/platforms/instagram/commands/auth.js +107 -14
  34. package/dist/src/platforms/instagram/commands/auth.js.map +1 -1
  35. package/dist/src/platforms/instagram/ensure-auth.d.ts.map +1 -1
  36. package/dist/src/platforms/instagram/ensure-auth.js +57 -11
  37. package/dist/src/platforms/instagram/ensure-auth.js.map +1 -1
  38. package/dist/src/platforms/instagram/index.d.ts +1 -0
  39. package/dist/src/platforms/instagram/index.d.ts.map +1 -1
  40. package/dist/src/platforms/instagram/index.js +1 -0
  41. package/dist/src/platforms/instagram/index.js.map +1 -1
  42. package/dist/src/platforms/instagram/token-extractor.d.ts +44 -0
  43. package/dist/src/platforms/instagram/token-extractor.d.ts.map +1 -0
  44. package/dist/src/platforms/instagram/token-extractor.js +407 -0
  45. package/dist/src/platforms/instagram/token-extractor.js.map +1 -0
  46. package/dist/src/platforms/kakaotalk/client.d.ts.map +1 -1
  47. package/dist/src/platforms/kakaotalk/client.js +2 -1
  48. package/dist/src/platforms/kakaotalk/client.js.map +1 -1
  49. package/dist/src/platforms/kakaotalk/commands/auth.d.ts.map +1 -1
  50. package/dist/src/platforms/kakaotalk/commands/auth.js +14 -13
  51. package/dist/src/platforms/kakaotalk/commands/auth.js.map +1 -1
  52. package/dist/src/platforms/kakaotalk/protocol/connection.d.ts.map +1 -1
  53. package/dist/src/platforms/kakaotalk/protocol/connection.js +2 -1
  54. package/dist/src/platforms/kakaotalk/protocol/connection.js.map +1 -1
  55. package/dist/src/platforms/line/commands/auth.d.ts.map +1 -1
  56. package/dist/src/platforms/line/commands/auth.js +6 -5
  57. package/dist/src/platforms/line/commands/auth.js.map +1 -1
  58. package/dist/src/platforms/slack/commands/auth.d.ts.map +1 -1
  59. package/dist/src/platforms/slack/commands/auth.js +11 -10
  60. package/dist/src/platforms/slack/commands/auth.js.map +1 -1
  61. package/dist/src/platforms/slack/token-extractor.d.ts +9 -0
  62. package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -1
  63. package/dist/src/platforms/slack/token-extractor.js +300 -23
  64. package/dist/src/platforms/slack/token-extractor.js.map +1 -1
  65. package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
  66. package/dist/src/platforms/teams/commands/auth.js +9 -8
  67. package/dist/src/platforms/teams/commands/auth.js.map +1 -1
  68. package/dist/src/platforms/teams/ensure-auth.d.ts.map +1 -1
  69. package/dist/src/platforms/teams/ensure-auth.js +2 -1
  70. package/dist/src/platforms/teams/ensure-auth.js.map +1 -1
  71. package/dist/src/platforms/teams/token-extractor.d.ts +5 -0
  72. package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
  73. package/dist/src/platforms/teams/token-extractor.js +161 -29
  74. package/dist/src/platforms/teams/token-extractor.js.map +1 -1
  75. package/dist/src/platforms/telegram/client.d.ts.map +1 -1
  76. package/dist/src/platforms/telegram/client.js +25 -7
  77. package/dist/src/platforms/telegram/client.js.map +1 -1
  78. package/dist/src/platforms/telegram/commands/auth.d.ts.map +1 -1
  79. package/dist/src/platforms/telegram/commands/auth.js +6 -5
  80. package/dist/src/platforms/telegram/commands/auth.js.map +1 -1
  81. package/dist/src/platforms/webex/app-config.d.ts +7 -0
  82. package/dist/src/platforms/webex/app-config.d.ts.map +1 -0
  83. package/dist/src/platforms/webex/app-config.js +20 -0
  84. package/dist/src/platforms/webex/app-config.js.map +1 -0
  85. package/dist/src/platforms/webex/cli.d.ts +5 -0
  86. package/dist/src/platforms/webex/cli.d.ts.map +1 -0
  87. package/dist/src/platforms/webex/cli.js +32 -0
  88. package/dist/src/platforms/webex/cli.js.map +1 -0
  89. package/dist/src/platforms/webex/client.d.ts +55 -0
  90. package/dist/src/platforms/webex/client.d.ts.map +1 -0
  91. package/dist/src/platforms/webex/client.js +299 -0
  92. package/dist/src/platforms/webex/client.js.map +1 -0
  93. package/dist/src/platforms/webex/commands/auth.d.ts +19 -0
  94. package/dist/src/platforms/webex/commands/auth.d.ts.map +1 -0
  95. package/dist/src/platforms/webex/commands/auth.js +166 -0
  96. package/dist/src/platforms/webex/commands/auth.js.map +1 -0
  97. package/dist/src/platforms/webex/commands/index.d.ts +6 -0
  98. package/dist/src/platforms/webex/commands/index.d.ts.map +1 -0
  99. package/dist/src/platforms/webex/commands/index.js +6 -0
  100. package/dist/src/platforms/webex/commands/index.js.map +1 -0
  101. package/dist/src/platforms/webex/commands/member.d.ts +7 -0
  102. package/dist/src/platforms/webex/commands/member.d.ts.map +1 -0
  103. package/dist/src/platforms/webex/commands/member.js +34 -0
  104. package/dist/src/platforms/webex/commands/member.js.map +1 -0
  105. package/dist/src/platforms/webex/commands/message.d.ts +26 -0
  106. package/dist/src/platforms/webex/commands/message.d.ts.map +1 -0
  107. package/dist/src/platforms/webex/commands/message.js +153 -0
  108. package/dist/src/platforms/webex/commands/message.js.map +1 -0
  109. package/dist/src/platforms/webex/commands/snapshot.d.ts +9 -0
  110. package/dist/src/platforms/webex/commands/snapshot.d.ts.map +1 -0
  111. package/dist/src/platforms/webex/commands/snapshot.js +72 -0
  112. package/dist/src/platforms/webex/commands/snapshot.js.map +1 -0
  113. package/dist/src/platforms/webex/commands/space.d.ts +11 -0
  114. package/dist/src/platforms/webex/commands/space.d.ts.map +1 -0
  115. package/dist/src/platforms/webex/commands/space.js +59 -0
  116. package/dist/src/platforms/webex/commands/space.js.map +1 -0
  117. package/dist/src/platforms/webex/credential-manager.d.ts +23 -0
  118. package/dist/src/platforms/webex/credential-manager.d.ts.map +1 -0
  119. package/dist/src/platforms/webex/credential-manager.js +148 -0
  120. package/dist/src/platforms/webex/credential-manager.js.map +1 -0
  121. package/dist/src/platforms/webex/ensure-auth.d.ts +2 -0
  122. package/dist/src/platforms/webex/ensure-auth.d.ts.map +1 -0
  123. package/dist/src/platforms/webex/ensure-auth.js +36 -0
  124. package/dist/src/platforms/webex/ensure-auth.js.map +1 -0
  125. package/dist/src/platforms/webex/index.d.ts +8 -0
  126. package/dist/src/platforms/webex/index.d.ts.map +1 -0
  127. package/dist/src/platforms/webex/index.js +6 -0
  128. package/dist/src/platforms/webex/index.js.map +1 -0
  129. package/dist/src/platforms/webex/token-extractor.d.ts +28 -0
  130. package/dist/src/platforms/webex/token-extractor.d.ts.map +1 -0
  131. package/dist/src/platforms/webex/token-extractor.js +344 -0
  132. package/dist/src/platforms/webex/token-extractor.js.map +1 -0
  133. package/dist/src/platforms/webex/types.d.ts +127 -0
  134. package/dist/src/platforms/webex/types.d.ts.map +1 -0
  135. package/dist/src/platforms/webex/types.js +64 -0
  136. package/dist/src/platforms/webex/types.js.map +1 -0
  137. package/dist/src/platforms/whatsapp/client.d.ts.map +1 -1
  138. package/dist/src/platforms/whatsapp/client.js +6 -2
  139. package/dist/src/platforms/whatsapp/client.js.map +1 -1
  140. package/dist/src/shared/utils/derived-key-cache.d.ts +1 -1
  141. package/dist/src/shared/utils/derived-key-cache.d.ts.map +1 -1
  142. package/dist/src/shared/utils/error-handler.d.ts +1 -1
  143. package/dist/src/shared/utils/error-handler.d.ts.map +1 -1
  144. package/dist/src/shared/utils/error-handler.js +3 -2
  145. package/dist/src/shared/utils/error-handler.js.map +1 -1
  146. package/dist/src/shared/utils/stderr.d.ts +5 -0
  147. package/dist/src/shared/utils/stderr.d.ts.map +1 -0
  148. package/dist/src/shared/utils/stderr.js +18 -0
  149. package/dist/src/shared/utils/stderr.js.map +1 -0
  150. package/dist/src/tui/adapters/webex-adapter.d.ts +14 -0
  151. package/dist/src/tui/adapters/webex-adapter.d.ts.map +1 -0
  152. package/dist/src/tui/adapters/webex-adapter.js +79 -0
  153. package/dist/src/tui/adapters/webex-adapter.js.map +1 -0
  154. package/dist/src/tui/app.d.ts.map +1 -1
  155. package/dist/src/tui/app.js +2 -0
  156. package/dist/src/tui/app.js.map +1 -1
  157. package/docs/content/docs/cli/channeltalk.mdx +7 -7
  158. package/docs/content/docs/cli/discord.mdx +3 -3
  159. package/docs/content/docs/cli/instagram.mdx +28 -6
  160. package/docs/content/docs/cli/meta.json +1 -0
  161. package/docs/content/docs/cli/slack.mdx +2 -2
  162. package/docs/content/docs/cli/teams.mdx +6 -4
  163. package/docs/content/docs/cli/webex.mdx +310 -0
  164. package/docs/content/docs/sdk/meta.json +1 -1
  165. package/docs/content/docs/sdk/webex.mdx +260 -0
  166. package/docs/content/docs/tui.mdx +4 -3
  167. package/docs/src/app/page.tsx +2 -2
  168. package/e2e/README.md +132 -8
  169. package/e2e/channeltalk.e2e.test.ts +2 -7
  170. package/e2e/channeltalkbot.e2e.test.ts +2 -6
  171. package/e2e/config.ts +172 -10
  172. package/e2e/helpers.ts +7 -0
  173. package/e2e/instagram.e2e.test.ts +97 -0
  174. package/e2e/kakaotalk.e2e.test.ts +74 -0
  175. package/e2e/line.e2e.test.ts +92 -0
  176. package/e2e/teams.e2e.test.ts +46 -1
  177. package/e2e/telegram.e2e.test.ts +84 -0
  178. package/e2e/webex.e2e.test.ts +190 -0
  179. package/e2e/whatsapp.e2e.test.ts +90 -0
  180. package/e2e/whatsappbot.e2e.test.ts +78 -0
  181. package/package.json +11 -3
  182. package/skills/agent-channeltalk/SKILL.md +9 -9
  183. package/skills/agent-channeltalk/references/authentication.md +21 -18
  184. package/skills/agent-channeltalkbot/SKILL.md +1 -1
  185. package/skills/agent-discord/SKILL.md +5 -5
  186. package/skills/agent-discord/references/authentication.md +8 -8
  187. package/skills/agent-discordbot/SKILL.md +1 -1
  188. package/skills/agent-instagram/SKILL.md +51 -9
  189. package/skills/agent-instagram/references/authentication.md +35 -3
  190. package/skills/agent-kakaotalk/SKILL.md +1 -1
  191. package/skills/agent-line/SKILL.md +1 -1
  192. package/skills/agent-slack/SKILL.md +5 -5
  193. package/skills/agent-slack/references/authentication.md +8 -8
  194. package/skills/agent-slackbot/SKILL.md +1 -1
  195. package/skills/agent-teams/SKILL.md +6 -6
  196. package/skills/agent-teams/references/authentication.md +8 -8
  197. package/skills/agent-telegram/SKILL.md +1 -1
  198. package/skills/agent-webex/SKILL.md +406 -0
  199. package/skills/agent-webex/references/authentication.md +371 -0
  200. package/skills/agent-webex/references/common-patterns.md +726 -0
  201. package/skills/agent-webex/templates/monitor-space.sh +165 -0
  202. package/skills/agent-webex/templates/post-message.sh +170 -0
  203. package/skills/agent-whatsapp/SKILL.md +1 -1
  204. package/skills/agent-whatsappbot/SKILL.md +1 -1
  205. package/src/cli.ts +4 -0
  206. package/src/platforms/channeltalk/commands/auth.test.ts +5 -5
  207. package/src/platforms/channeltalk/commands/auth.ts +38 -32
  208. package/src/platforms/channeltalk/ensure-auth.test.ts +6 -6
  209. package/src/platforms/channeltalk/ensure-auth.ts +6 -6
  210. package/src/platforms/channeltalk/token-extractor.test.ts +182 -15
  211. package/src/platforms/channeltalk/token-extractor.ts +344 -30
  212. package/src/platforms/discord/commands/auth.test.ts +3 -3
  213. package/src/platforms/discord/commands/auth.ts +58 -54
  214. package/src/platforms/discord/ensure-auth.test.ts +3 -3
  215. package/src/platforms/discord/ensure-auth.ts +3 -3
  216. package/src/platforms/discord/token-extractor.test.ts +199 -27
  217. package/src/platforms/discord/token-extractor.ts +190 -17
  218. package/src/platforms/instagram/client.ts +2 -2
  219. package/src/platforms/instagram/commands/auth.ts +133 -14
  220. package/src/platforms/instagram/ensure-auth.ts +63 -12
  221. package/src/platforms/instagram/index.ts +1 -0
  222. package/src/platforms/instagram/token-extractor.test.ts +424 -0
  223. package/src/platforms/instagram/token-extractor.ts +478 -0
  224. package/src/platforms/kakaotalk/client.ts +3 -1
  225. package/src/platforms/kakaotalk/commands/auth.ts +14 -13
  226. package/src/platforms/kakaotalk/protocol/connection.ts +3 -1
  227. package/src/platforms/line/commands/auth.ts +7 -6
  228. package/src/platforms/slack/cli.test.ts +6 -5
  229. package/src/platforms/slack/commands/auth.test.ts +11 -7
  230. package/src/platforms/slack/commands/auth.ts +11 -10
  231. package/src/platforms/slack/token-extractor.test.ts +98 -1
  232. package/src/platforms/slack/token-extractor.ts +338 -26
  233. package/src/platforms/teams/commands/auth.ts +9 -8
  234. package/src/platforms/teams/ensure-auth.ts +3 -1
  235. package/src/platforms/teams/token-extractor.test.ts +136 -17
  236. package/src/platforms/teams/token-extractor.ts +182 -31
  237. package/src/platforms/telegram/client.test.ts +134 -0
  238. package/src/platforms/telegram/client.ts +27 -6
  239. package/src/platforms/telegram/commands/auth.ts +6 -5
  240. package/src/platforms/webex/app-config.test.ts +98 -0
  241. package/src/platforms/webex/app-config.ts +31 -0
  242. package/src/platforms/webex/cli.test.ts +58 -0
  243. package/src/platforms/webex/cli.ts +39 -0
  244. package/src/platforms/webex/client.test.ts +743 -0
  245. package/src/platforms/webex/client.ts +405 -0
  246. package/src/platforms/webex/commands/auth.test.ts +222 -0
  247. package/src/platforms/webex/commands/auth.ts +243 -0
  248. package/src/platforms/webex/commands/index.ts +5 -0
  249. package/src/platforms/webex/commands/member.test.ts +112 -0
  250. package/src/platforms/webex/commands/member.ts +45 -0
  251. package/src/platforms/webex/commands/message.test.ts +235 -0
  252. package/src/platforms/webex/commands/message.ts +204 -0
  253. package/src/platforms/webex/commands/snapshot.test.ts +105 -0
  254. package/src/platforms/webex/commands/snapshot.ts +91 -0
  255. package/src/platforms/webex/commands/space.test.ts +216 -0
  256. package/src/platforms/webex/commands/space.ts +74 -0
  257. package/src/platforms/webex/credential-manager.test.ts +314 -0
  258. package/src/platforms/webex/credential-manager.ts +197 -0
  259. package/src/platforms/webex/ensure-auth.test.ts +89 -0
  260. package/src/platforms/webex/ensure-auth.ts +38 -0
  261. package/src/platforms/webex/index.test.ts +25 -0
  262. package/src/platforms/webex/index.ts +19 -0
  263. package/src/platforms/webex/token-extractor.test.ts +327 -0
  264. package/src/platforms/webex/token-extractor.ts +393 -0
  265. package/src/platforms/webex/types.test.ts +307 -0
  266. package/src/platforms/webex/types.ts +129 -0
  267. package/src/platforms/whatsapp/client.ts +11 -7
  268. package/src/shared/utils/derived-key-cache.ts +1 -1
  269. package/src/shared/utils/error-handler.ts +4 -2
  270. package/src/shared/utils/stderr.ts +22 -0
  271. package/src/tui/adapters/webex-adapter.ts +103 -0
  272. package/src/tui/app.ts +2 -0
@@ -0,0 +1,260 @@
1
+ ---
2
+ title: Webex
3
+ description: TypeScript SDK reference for Cisco Webex — client, credential management, and types.
4
+ ---
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ npm install agent-messenger
10
+ ```
11
+
12
+ ```typescript
13
+ import {
14
+ WebexClient,
15
+ WebexCredentialManager,
16
+ WebexError,
17
+ } from 'agent-messenger/webex'
18
+ ```
19
+
20
+ ## WebexClient
21
+
22
+ The main client for interacting with the Webex REST API programmatically. All API methods include automatic rate-limit handling with per-bucket tracking and exponential backoff on server errors.
23
+
24
+ OAuth tokens auto-refresh via the stored refresh token. Bot tokens never expire. PATs expire in 12 hours.
25
+
26
+ ```typescript
27
+ import { WebexClient } from 'agent-messenger/webex'
28
+
29
+ const client = await new WebexClient().login({ token })
30
+ ```
31
+
32
+ Or use automatic credential extraction — credentials are loaded from stored OAuth/bot tokens, no manual token needed:
33
+
34
+ ```typescript
35
+ import { WebexClient } from 'agent-messenger/webex'
36
+
37
+ const client = await new WebexClient().login()
38
+ ```
39
+
40
+ ### Authentication
41
+
42
+ ```typescript
43
+ // Verify credentials and get identity
44
+ const me = await client.testAuth()
45
+ // → WebexPerson { id, displayName, emails, orgId, type }
46
+ ```
47
+
48
+ ### Spaces
49
+
50
+ ```typescript
51
+ // List all spaces (default limit: 50)
52
+ const spaces = await client.listSpaces()
53
+ const grouped = await client.listSpaces({ type: 'group', max: 20 })
54
+ // → WebexSpace[]
55
+
56
+ // Get a specific space by ID
57
+ const space = await client.getSpace(spaceId)
58
+ // → WebexSpace { id, title, type, isLocked, lastActivity, created, creatorId }
59
+ ```
60
+
61
+ ### Messages
62
+
63
+ ```typescript
64
+ // Send a message to a space
65
+ const msg = await client.sendMessage(roomId, 'Hello world')
66
+ // → WebexMessage { id, roomId, roomType, text, personId, personEmail, created }
67
+
68
+ // Send a markdown message
69
+ await client.sendMessage(roomId, '**Bold** and _italic_', { markdown: true })
70
+
71
+ // Send a direct message by email
72
+ const dm = await client.sendDirectMessage('alice@example.com', 'Hey!')
73
+ await client.sendDirectMessage('alice@example.com', '**Important**', { markdown: true })
74
+
75
+ // List messages in a space (default limit: 50)
76
+ const messages = await client.listMessages(roomId)
77
+ const limited = await client.listMessages(roomId, { max: 25 })
78
+ // → WebexMessage[]
79
+
80
+ // Get a single message by ID
81
+ const message = await client.getMessage(messageId)
82
+ // → WebexMessage
83
+
84
+ // Edit a message
85
+ const updated = await client.editMessage(messageId, roomId, 'Updated text')
86
+ await client.editMessage(messageId, roomId, '**Updated**', { markdown: true })
87
+ // → WebexMessage
88
+
89
+ // Delete a message
90
+ await client.deleteMessage(messageId)
91
+ ```
92
+
93
+ ### People
94
+
95
+ ```typescript
96
+ // List people (search by email or display name)
97
+ const people = await client.listPeople({ email: 'alice@example.com' })
98
+ const byName = await client.listPeople({ displayName: 'Alice', max: 10 })
99
+ // → WebexPerson[]
100
+ ```
101
+
102
+ ### Memberships
103
+
104
+ ```typescript
105
+ // List members of a space
106
+ const members = await client.listMemberships(roomId)
107
+ const limited = await client.listMemberships(roomId, { max: 100 })
108
+ // → WebexMembership[]
109
+ ```
110
+
111
+ ## WebexCredentialManager
112
+
113
+ Manages Webex credentials stored at `~/.config/agent-messenger/webex-credentials.json`. Files are written with `0o600` permissions. Supports OAuth Device Grant flow, bot tokens, and PATs.
114
+
115
+ ```typescript
116
+ import { WebexCredentialManager } from 'agent-messenger/webex'
117
+
118
+ const manager = new WebexCredentialManager()
119
+ // Custom path: new WebexCredentialManager('/custom/config/dir')
120
+ ```
121
+
122
+ ```typescript
123
+ // Load config from disk (returns null if file doesn't exist)
124
+ const config = await manager.loadConfig()
125
+ // → WebexConfig | null
126
+
127
+ // Save config to disk (atomic write)
128
+ await manager.saveConfig(config)
129
+
130
+ // Get stored access token (auto-refreshes OAuth tokens if expired)
131
+ const token = await manager.getToken()
132
+ // → string | null
133
+
134
+ // Refresh an OAuth token manually
135
+ const refreshed = await manager.refreshToken(refreshToken, clientId, clientSecret)
136
+ // → WebexConfig | null
137
+
138
+ // Start OAuth Device Grant flow (request device code)
139
+ const device = await manager.requestDeviceCode(clientId)
140
+ // → { deviceCode, userCode, verificationUri, verificationUriComplete, expiresIn, interval }
141
+
142
+ // Poll for device token approval
143
+ const tokenConfig = await manager.pollDeviceToken(deviceCode, interval, expiresIn, clientId, clientSecret)
144
+ // → WebexConfig
145
+
146
+ // Clear all stored credentials (deletes the file)
147
+ await manager.clearCredentials()
148
+ ```
149
+
150
+ ## Types
151
+
152
+ ```typescript
153
+ import type {
154
+ WebexSpace,
155
+ WebexMessage,
156
+ WebexPerson,
157
+ WebexMembership,
158
+ WebexConfig,
159
+ } from 'agent-messenger/webex'
160
+ ```
161
+
162
+ ### Zod Schemas
163
+
164
+ Runtime-validated schemas are also exported for parsing API responses:
165
+
166
+ ```typescript
167
+ import {
168
+ WebexSpaceSchema,
169
+ WebexMessageSchema,
170
+ WebexPersonSchema,
171
+ WebexMembershipSchema,
172
+ WebexConfigSchema,
173
+ } from 'agent-messenger/webex'
174
+ ```
175
+
176
+ ## Examples
177
+
178
+ ### Deploy Notifier
179
+
180
+ Post a deployment message, then update it when done.
181
+
182
+ ```typescript
183
+ import { WebexClient } from 'agent-messenger/webex'
184
+
185
+ const client = await new WebexClient().login()
186
+
187
+ // Post initial status
188
+ const msg = await client.sendMessage(spaceId, 'Deploying v2.1.0 to production...')
189
+
190
+ // Stream progress
191
+ await client.sendMessage(spaceId, 'Building application...')
192
+ await client.sendMessage(spaceId, 'Running tests (142 passed)...')
193
+ await client.sendMessage(spaceId, 'Rolling out to 3 regions...')
194
+
195
+ // Update original message with final status
196
+ await client.editMessage(msg.id, spaceId, 'Deployed v2.1.0 to production')
197
+ ```
198
+
199
+ ### Space Monitor
200
+
201
+ List spaces and pull recent messages from each one.
202
+
203
+ ```typescript
204
+ import { WebexClient } from 'agent-messenger/webex'
205
+
206
+ const client = await new WebexClient().login()
207
+
208
+ const spaces = await client.listSpaces({ type: 'group', max: 10 })
209
+
210
+ for (const space of spaces) {
211
+ const messages = await client.listMessages(space.id, { max: 5 })
212
+ console.log(`${space.title} (${messages.length} recent messages)`)
213
+
214
+ for (const msg of messages) {
215
+ console.log(` [${msg.personEmail}] ${(msg.text ?? '').slice(0, 80)}`)
216
+ }
217
+ }
218
+ ```
219
+
220
+ ### Workspace Summary
221
+
222
+ Build a snapshot-style overview: spaces, members, and latest activity.
223
+
224
+ ```typescript
225
+ import { WebexClient } from 'agent-messenger/webex'
226
+
227
+ const client = await new WebexClient().login()
228
+
229
+ const spaces = await client.listSpaces()
230
+ console.log(`Total spaces: ${spaces.length}`)
231
+
232
+ for (const space of spaces.slice(0, 5)) {
233
+ const members = await client.listMemberships(space.id)
234
+ const messages = await client.listMessages(space.id, { max: 1 })
235
+ const latest = messages[0]
236
+
237
+ console.log(`${space.title} (${members.length} members)`)
238
+ if (latest) {
239
+ console.log(` Latest: "${(latest.text ?? '').slice(0, 60)}" — ${latest.personEmail}`)
240
+ }
241
+ }
242
+ ```
243
+
244
+ ### Direct Message Pipeline
245
+
246
+ Send a DM to multiple people by email.
247
+
248
+ ```typescript
249
+ import { WebexClient } from 'agent-messenger/webex'
250
+
251
+ const client = await new WebexClient().login()
252
+
253
+ const recipients = ['alice@example.com', 'bob@example.com', 'carol@example.com']
254
+
255
+ for (const email of recipients) {
256
+ await client.sendDirectMessage(email, 'Reminder: standup in 5 minutes')
257
+ // Respect rate limits
258
+ await new Promise((r) => setTimeout(r, 200))
259
+ }
260
+ ```
@@ -4,11 +4,11 @@ description: A unified terminal interface for all your messaging platforms in on
4
4
  icon: Monitor
5
5
  ---
6
6
 
7
- > **Experimental** — The TUI is a showcase of what's possible with Agent Messenger's SDK. It's not intended for production use, but demonstrates the power of having a unified adapter layer across 9 messaging platforms.
7
+ > **Experimental** — The TUI is a showcase of what's possible with Agent Messenger's SDK. It's not intended for production use, but demonstrates the power of having a unified adapter layer across 10 messaging platforms.
8
8
 
9
9
  ## What Is It?
10
10
 
11
- The TUI (Terminal User Interface) is a `blessed`-based interactive terminal app that unifies all your messaging platforms into a single screen. Navigate between Slack, Discord, Teams, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, and Channel Talk — all from your terminal.
11
+ The TUI (Terminal User Interface) is a `blessed`-based interactive terminal app that unifies all your messaging platforms into a single screen. Navigate between Slack, Discord, Teams, Webex, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, and Channel Talk — all from your terminal.
12
12
 
13
13
  ![Agent Messenger TUI](/tui.png)
14
14
 
@@ -30,7 +30,7 @@ The TUI has three navigation levels and three input modes.
30
30
 
31
31
  | Level | What it shows | How to enter |
32
32
  | --- | --- | --- |
33
- | **Platform** | All 9 platforms with online/offline status | Launch or press `Esc` from workspace level |
33
+ | **Platform** | All 10 platforms with online/offline status | Launch or press `Esc` from workspace level |
34
34
  | **Workspace** | Workspaces for the selected platform (skipped if only one) | Select a platform |
35
35
  | **Channel** | Channels in the current workspace | Select a workspace |
36
36
 
@@ -125,6 +125,7 @@ src/tui/
125
125
  │ ├── slack-adapter.ts
126
126
  │ ├── discord-adapter.ts
127
127
  │ ├── teams-adapter.ts
128
+ │ ├── webex-adapter.ts
128
129
  │ ├── telegram-adapter.ts
129
130
  │ ├── whatsapp-adapter.ts
130
131
  │ ├── line-adapter.ts
@@ -648,8 +648,8 @@ export default function Home() {
648
648
 
649
649
  {/* Subtitle */}
650
650
  <p className="mx-auto mt-6 max-w-2xl text-lg leading-relaxed text-zinc-600 dark:text-zinc-400">
651
- One CLI for Slack, Discord, Teams, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, and Channel Talk.
652
- Credentials extracted from desktop apps or authenticated in seconds — no API keys, no OAuth, no admin approval.
651
+ One CLI for Slack, Discord, Teams, Webex, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, and Channel Talk.
652
+ Credentials extracted from desktop apps or authenticated in seconds — no API keys, no admin approval.
653
653
  </p>
654
654
 
655
655
  {/* CTAs with glass treatment in dark mode */}
package/e2e/README.md CHANGED
@@ -20,14 +20,24 @@ Before running E2E tests, you need:
20
20
 
21
21
  ## Test Infrastructure
22
22
 
23
- | File | Description |
24
- | ---------------------- | -------------------------------------------------- |
25
- | `config.ts` | Hardcoded test workspace/server IDs and validation |
26
- | `helpers.ts` | CLI runner, JSON parser, message cleanup utilities |
27
- | `slack.e2e.test.ts` | Slack command tests |
28
- | `slackbot.e2e.test.ts` | SlackBot command tests |
29
- | `discord.e2e.test.ts` | Discord command tests |
30
- | `teams.e2e.test.ts` | Teams command tests |
23
+ | File | Description |
24
+ | ------------------------- | -------------------------------------------------- |
25
+ | `config.ts` | Hardcoded test workspace/server IDs and validation |
26
+ | `helpers.ts` | CLI runner, JSON parser, message cleanup utilities |
27
+ | `slack.e2e.test.ts` | Slack command tests |
28
+ | `slackbot.e2e.test.ts` | SlackBot command tests |
29
+ | `discord.e2e.test.ts` | Discord command tests |
30
+ | `discordbot.e2e.test.ts` | DiscordBot command tests |
31
+ | `teams.e2e.test.ts` | Teams command tests |
32
+ | `webex.e2e.test.ts` | Webex command tests |
33
+ | `telegram.e2e.test.ts` | Telegram command tests |
34
+ | `whatsapp.e2e.test.ts` | WhatsApp command tests |
35
+ | `whatsappbot.e2e.test.ts` | WhatsApp Bot command tests |
36
+ | `line.e2e.test.ts` | LINE command tests |
37
+ | `instagram.e2e.test.ts` | Instagram command tests |
38
+ | `kakaotalk.e2e.test.ts` | KakaoTalk command tests |
39
+ | `channeltalk.e2e.test.ts` | Channel Talk command tests |
40
+ | `channeltalkbot.e2e.test.ts` | Channel Talk Bot command tests |
31
41
 
32
42
  ## Running E2E Tests Locally
33
43
 
@@ -211,6 +221,120 @@ When triggering manually, you can select which platform to test:
211
221
 
212
222
  > ⚠️ Teams tests require `E2E_TEAMS_TEAM_ID` and `E2E_TEAMS_CHANNEL_ID` environment variables. Teams tokens expire in 60-90 minutes.
213
223
 
224
+ ### DiscordBot Tests
225
+
226
+ | Command Group | Tests |
227
+ | ------------- | ------------------------------------------------ |
228
+ | `auth` | status |
229
+ | `message` | send, list, get, update, delete, thread, replies |
230
+ | `channel` | list, info |
231
+ | `user` | list, info |
232
+ | `reaction` | add, remove |
233
+ | `server` | list, current |
234
+
235
+ ### Webex Tests
236
+
237
+ | Command Group | Tests |
238
+ | ------------- | -------------------------------------------- |
239
+ | `auth` | status |
240
+ | `message` | send, list, get, delete, edit |
241
+ | `space` | list, info |
242
+ | `member` | list |
243
+ | `snapshot` | default, --spaces-only, --members-only |
244
+
245
+ > ⚠️ Webex tests require `E2E_WEBEX_SPACE_ID`. Optionally set `E2E_WEBEX_DM_EMAIL` for DM tests.
246
+
247
+ ### Telegram Tests
248
+
249
+ | Command Group | Tests |
250
+ | ------------- | -------------------- |
251
+ | `auth` | status, list |
252
+ | `chat` | list, search, get |
253
+ | `message` | send, list |
254
+
255
+ > ⚠️ Telegram tests require `E2E_TELEGRAM_CHAT_ID`.
256
+
257
+ ### WhatsApp Tests
258
+
259
+ | Command Group | Tests |
260
+ | ------------- | -------------------- |
261
+ | `auth` | status, list |
262
+ | `chat` | list, search |
263
+ | `message` | send, list, react |
264
+
265
+ > ⚠️ WhatsApp tests require `E2E_WHATSAPP_CHAT_ID`.
266
+
267
+ ### WhatsApp Bot Tests
268
+
269
+ | Command Group | Tests |
270
+ | ------------- | -------------------- |
271
+ | `auth` | status, list |
272
+ | `message` | send |
273
+ | `template` | list, get |
274
+
275
+ > ⚠️ WhatsApp Bot tests require `E2E_WHATSAPPBOT_PHONE_NUMBER`.
276
+
277
+ ### LINE Tests
278
+
279
+ | Command Group | Tests |
280
+ | ------------- | -------------------- |
281
+ | `auth` | status, list |
282
+ | `chat` | list |
283
+ | `friend` | list |
284
+ | `message` | send, list |
285
+ | `profile` | (top-level command) |
286
+
287
+ > ⚠️ LINE tests require `E2E_LINE_CHAT_ID`.
288
+
289
+ ### Instagram Tests
290
+
291
+ | Command Group | Tests |
292
+ | ------------- | --------------------------------------- |
293
+ | `auth` | status, list |
294
+ | `chat` | list, search |
295
+ | `message` | send, list, send-to\*, search, search-users |
296
+
297
+ \* `message send-to` requires `E2E_INSTAGRAM_USERNAME` to be set.
298
+
299
+ > ⚠️ Instagram tests require `E2E_INSTAGRAM_THREAD_ID`. Optionally set `E2E_INSTAGRAM_USERNAME` for send-to tests.
300
+
301
+ ### KakaoTalk Tests
302
+
303
+ | Command Group | Tests |
304
+ | ------------- | -------------------- |
305
+ | `auth` | status, list |
306
+ | `chat` | list, list --search |
307
+ | `message` | send, list |
308
+
309
+ > ⚠️ KakaoTalk tests require `E2E_KAKAOTALK_CHAT_ID`.
310
+
311
+ ### Channel Talk Tests
312
+
313
+ | Command Group | Tests |
314
+ | ------------- | --------------------------------- |
315
+ | `auth` | status, list |
316
+ | `group` | list, get, messages |
317
+ | `message` | send, list, get |
318
+ | `chat` | list |
319
+ | `manager` | list |
320
+ | `bot` | list |
321
+ | `snapshot` | default |
322
+
323
+ > ⚠️ Channel Talk tests require `E2E_CHANNEL_WORKSPACE_ID`.
324
+
325
+ ### Channel Talk Bot Tests
326
+
327
+ | Command Group | Tests |
328
+ | ------------- | --------------------------------- |
329
+ | `auth` | status |
330
+ | `group` | list, get (by id), get (by @name), messages |
331
+ | `message` | send, list, get |
332
+ | `manager` | list, get |
333
+ | `bot` | list |
334
+ | `snapshot` | default |
335
+
336
+ > ⚠️ Channel Talk Bot tests require `E2E_CHANNELBOT_WORKSPACE_ID`.
337
+
214
338
  ## Troubleshooting
215
339
 
216
340
  ### "Wrong workspace" / "Wrong server" Error
@@ -11,14 +11,9 @@ let testGroupName = ''
11
11
 
12
12
  describe('Channel E2E Tests', () => {
13
13
  beforeAll(async () => {
14
- if (!CHANNEL_TEST_WORKSPACE_ID) {
15
- console.warn(
16
- 'Skipping Channel E2E: set E2E_CHANNEL_WORKSPACE_ID to run against a dedicated test workspace.',
17
- )
18
- return
19
- }
20
-
21
14
  const group = await validateChannelEnvironment()
15
+ if (!group) return
16
+
22
17
  testGroupId = group.groupId
23
18
  testGroupName = group.groupName
24
19
 
@@ -13,13 +13,9 @@ let testGroupName = ''
13
13
 
14
14
  describe('ChannelBot E2E Tests', () => {
15
15
  beforeAll(async () => {
16
- if (!CHANNELBOT_TEST_WORKSPACE_ID) {
17
- console.warn(
18
- 'Skipping ChannelBot E2E: set E2E_CHANNELBOT_WORKSPACE_ID to run against a dedicated test workspace.',
19
- )
20
- return
21
- }
22
16
  const group = await validateChannelBotEnvironment()
17
+ if (!group) return
18
+
23
19
  testGroupId = group.groupId
24
20
  testGroupName = group.groupName
25
21
  channelbotAvailable = true