agent-messenger 1.3.0 → 1.3.2

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 (236) hide show
  1. package/.claude-plugin/marketplace.json +27 -1
  2. package/.claude-plugin/plugin.json +17 -4
  3. package/.env.template +3 -0
  4. package/.github/workflows/release.yml +80 -0
  5. package/AGENTS.md +48 -0
  6. package/README.md +25 -20
  7. package/biome.json +15 -39
  8. package/bun.lock +69 -0
  9. package/dist/package.json +10 -3
  10. package/dist/src/cli.d.ts.map +1 -1
  11. package/dist/src/cli.js +1 -4
  12. package/dist/src/cli.js.map +1 -1
  13. package/dist/src/platforms/discord/client.d.ts.map +1 -1
  14. package/dist/src/platforms/discord/client.js.map +1 -1
  15. package/dist/src/platforms/discord/commands/auth.d.ts.map +1 -1
  16. package/dist/src/platforms/discord/commands/auth.js.map +1 -1
  17. package/dist/src/platforms/discord/commands/channel.d.ts.map +1 -1
  18. package/dist/src/platforms/discord/commands/channel.js.map +1 -1
  19. package/dist/src/platforms/discord/commands/dm.d.ts.map +1 -1
  20. package/dist/src/platforms/discord/commands/dm.js.map +1 -1
  21. package/dist/src/platforms/discord/commands/file.d.ts.map +1 -1
  22. package/dist/src/platforms/discord/commands/file.js +1 -4
  23. package/dist/src/platforms/discord/commands/file.js.map +1 -1
  24. package/dist/src/platforms/discord/commands/friend.d.ts.map +1 -1
  25. package/dist/src/platforms/discord/commands/friend.js +1 -3
  26. package/dist/src/platforms/discord/commands/friend.js.map +1 -1
  27. package/dist/src/platforms/discord/commands/member.d.ts.map +1 -1
  28. package/dist/src/platforms/discord/commands/member.js.map +1 -1
  29. package/dist/src/platforms/discord/commands/mention.d.ts.map +1 -1
  30. package/dist/src/platforms/discord/commands/mention.js.map +1 -1
  31. package/dist/src/platforms/discord/commands/message.d.ts.map +1 -1
  32. package/dist/src/platforms/discord/commands/message.js.map +1 -1
  33. package/dist/src/platforms/discord/commands/note.d.ts.map +1 -1
  34. package/dist/src/platforms/discord/commands/note.js.map +1 -1
  35. package/dist/src/platforms/discord/commands/profile.d.ts.map +1 -1
  36. package/dist/src/platforms/discord/commands/profile.js.map +1 -1
  37. package/dist/src/platforms/discord/commands/reaction.d.ts.map +1 -1
  38. package/dist/src/platforms/discord/commands/reaction.js.map +1 -1
  39. package/dist/src/platforms/discord/commands/server.d.ts.map +1 -1
  40. package/dist/src/platforms/discord/commands/server.js.map +1 -1
  41. package/dist/src/platforms/discord/commands/snapshot.d.ts.map +1 -1
  42. package/dist/src/platforms/discord/commands/snapshot.js.map +1 -1
  43. package/dist/src/platforms/discord/commands/thread.d.ts.map +1 -1
  44. package/dist/src/platforms/discord/commands/thread.js.map +1 -1
  45. package/dist/src/platforms/discord/commands/user.d.ts.map +1 -1
  46. package/dist/src/platforms/discord/commands/user.js.map +1 -1
  47. package/dist/src/platforms/discord/credential-manager.d.ts.map +1 -1
  48. package/dist/src/platforms/discord/credential-manager.js.map +1 -1
  49. package/dist/src/platforms/discord/token-extractor.d.ts.map +1 -1
  50. package/dist/src/platforms/discord/token-extractor.js +2 -7
  51. package/dist/src/platforms/discord/token-extractor.js.map +1 -1
  52. package/dist/src/platforms/slack/client.d.ts.map +1 -1
  53. package/dist/src/platforms/slack/client.js +2 -0
  54. package/dist/src/platforms/slack/client.js.map +1 -1
  55. package/dist/src/platforms/slack/commands/activity.d.ts.map +1 -1
  56. package/dist/src/platforms/slack/commands/activity.js.map +1 -1
  57. package/dist/src/platforms/slack/commands/auth.d.ts.map +1 -1
  58. package/dist/src/platforms/slack/commands/auth.js.map +1 -1
  59. package/dist/src/platforms/slack/commands/channel.d.ts.map +1 -1
  60. package/dist/src/platforms/slack/commands/channel.js.map +1 -1
  61. package/dist/src/platforms/slack/commands/drafts.d.ts.map +1 -1
  62. package/dist/src/platforms/slack/commands/drafts.js.map +1 -1
  63. package/dist/src/platforms/slack/commands/file.d.ts.map +1 -1
  64. package/dist/src/platforms/slack/commands/file.js +1 -4
  65. package/dist/src/platforms/slack/commands/file.js.map +1 -1
  66. package/dist/src/platforms/slack/commands/message.d.ts.map +1 -1
  67. package/dist/src/platforms/slack/commands/message.js.map +1 -1
  68. package/dist/src/platforms/slack/commands/reaction.d.ts.map +1 -1
  69. package/dist/src/platforms/slack/commands/reaction.js +1 -2
  70. package/dist/src/platforms/slack/commands/reaction.js.map +1 -1
  71. package/dist/src/platforms/slack/commands/saved.d.ts.map +1 -1
  72. package/dist/src/platforms/slack/commands/saved.js.map +1 -1
  73. package/dist/src/platforms/slack/commands/sections.d.ts.map +1 -1
  74. package/dist/src/platforms/slack/commands/sections.js.map +1 -1
  75. package/dist/src/platforms/slack/commands/snapshot.d.ts.map +1 -1
  76. package/dist/src/platforms/slack/commands/snapshot.js.map +1 -1
  77. package/dist/src/platforms/slack/commands/unread.d.ts.map +1 -1
  78. package/dist/src/platforms/slack/commands/unread.js.map +1 -1
  79. package/dist/src/platforms/slack/commands/user.d.ts.map +1 -1
  80. package/dist/src/platforms/slack/commands/user.js.map +1 -1
  81. package/dist/src/platforms/slack/commands/workspace.d.ts.map +1 -1
  82. package/dist/src/platforms/slack/commands/workspace.js.map +1 -1
  83. package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -1
  84. package/dist/src/platforms/slack/token-extractor.js +4 -5
  85. package/dist/src/platforms/slack/token-extractor.js.map +1 -1
  86. package/dist/src/platforms/slack/types.d.ts +24 -0
  87. package/dist/src/platforms/slack/types.d.ts.map +1 -1
  88. package/dist/src/platforms/slack/types.js +7 -0
  89. package/dist/src/platforms/slack/types.js.map +1 -1
  90. package/dist/src/platforms/slackbot/cli.d.ts.map +1 -1
  91. package/dist/src/platforms/slackbot/cli.js +1 -1
  92. package/dist/src/platforms/slackbot/cli.js.map +1 -1
  93. package/dist/src/platforms/slackbot/client.d.ts.map +1 -1
  94. package/dist/src/platforms/slackbot/client.js.map +1 -1
  95. package/dist/src/platforms/slackbot/commands/auth.js.map +1 -1
  96. package/dist/src/platforms/slackbot/commands/channel.js.map +1 -1
  97. package/dist/src/platforms/slackbot/commands/message.d.ts.map +1 -1
  98. package/dist/src/platforms/slackbot/commands/message.js.map +1 -1
  99. package/dist/src/platforms/slackbot/commands/reaction.d.ts.map +1 -1
  100. package/dist/src/platforms/slackbot/commands/reaction.js.map +1 -1
  101. package/dist/src/platforms/slackbot/commands/shared.d.ts.map +1 -1
  102. package/dist/src/platforms/slackbot/commands/shared.js.map +1 -1
  103. package/dist/src/platforms/slackbot/commands/user.js.map +1 -1
  104. package/dist/src/platforms/slackbot/credential-manager.d.ts.map +1 -1
  105. package/dist/src/platforms/slackbot/credential-manager.js +2 -4
  106. package/dist/src/platforms/slackbot/credential-manager.js.map +1 -1
  107. package/dist/src/platforms/teams/client.d.ts.map +1 -1
  108. package/dist/src/platforms/teams/client.js.map +1 -1
  109. package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
  110. package/dist/src/platforms/teams/commands/auth.js.map +1 -1
  111. package/dist/src/platforms/teams/commands/channel.d.ts.map +1 -1
  112. package/dist/src/platforms/teams/commands/channel.js.map +1 -1
  113. package/dist/src/platforms/teams/commands/file.d.ts.map +1 -1
  114. package/dist/src/platforms/teams/commands/file.js.map +1 -1
  115. package/dist/src/platforms/teams/commands/message.d.ts.map +1 -1
  116. package/dist/src/platforms/teams/commands/message.js.map +1 -1
  117. package/dist/src/platforms/teams/commands/reaction.d.ts.map +1 -1
  118. package/dist/src/platforms/teams/commands/reaction.js.map +1 -1
  119. package/dist/src/platforms/teams/commands/snapshot.d.ts.map +1 -1
  120. package/dist/src/platforms/teams/commands/snapshot.js.map +1 -1
  121. package/dist/src/platforms/teams/commands/team.d.ts.map +1 -1
  122. package/dist/src/platforms/teams/commands/team.js +1 -4
  123. package/dist/src/platforms/teams/commands/team.js.map +1 -1
  124. package/dist/src/platforms/teams/commands/user.d.ts.map +1 -1
  125. package/dist/src/platforms/teams/commands/user.js.map +1 -1
  126. package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
  127. package/dist/src/platforms/teams/token-extractor.js +3 -1
  128. package/dist/src/platforms/teams/token-extractor.js.map +1 -1
  129. package/docs/content/docs/agent-skills.mdx +4 -4
  130. package/docs/content/docs/index.mdx +11 -18
  131. package/docs/content/docs/integrations/discord.mdx +65 -1
  132. package/docs/content/docs/integrations/slack.mdx +51 -1
  133. package/docs/content/docs/integrations/slackbot.mdx +11 -1
  134. package/docs/content/docs/integrations/teams.mdx +4 -1
  135. package/docs/content/docs/quick-start.mdx +3 -2
  136. package/docs/src/app/icon.png +0 -0
  137. package/docs/src/app/layout.config.tsx +8 -1
  138. package/package.json +16 -9
  139. package/scripts/prepublish.ts +11 -0
  140. package/skills/agent-discord/SKILL.md +14 -0
  141. package/skills/agent-slack/SKILL.md +14 -0
  142. package/skills/agent-slackbot/SKILL.md +14 -0
  143. package/skills/agent-teams/SKILL.md +14 -0
  144. package/src/cli.ts +1 -4
  145. package/src/platforms/discord/client.test.ts +6 -14
  146. package/src/platforms/discord/client.ts +12 -34
  147. package/src/platforms/discord/commands/auth.test.ts +2 -7
  148. package/src/platforms/discord/commands/auth.ts +14 -19
  149. package/src/platforms/discord/commands/channel.test.ts +18 -20
  150. package/src/platforms/discord/commands/channel.ts +9 -18
  151. package/src/platforms/discord/commands/dm.test.ts +1 -3
  152. package/src/platforms/discord/commands/dm.ts +6 -10
  153. package/src/platforms/discord/commands/file.ts +10 -23
  154. package/src/platforms/discord/commands/friend.ts +33 -35
  155. package/src/platforms/discord/commands/member.ts +5 -7
  156. package/src/platforms/discord/commands/mention.ts +5 -11
  157. package/src/platforms/discord/commands/message.test.ts +1 -3
  158. package/src/platforms/discord/commands/message.ts +23 -61
  159. package/src/platforms/discord/commands/note.ts +7 -15
  160. package/src/platforms/discord/commands/profile.ts +4 -6
  161. package/src/platforms/discord/commands/reaction.test.ts +1 -3
  162. package/src/platforms/discord/commands/reaction.ts +19 -29
  163. package/src/platforms/discord/commands/server.test.ts +14 -18
  164. package/src/platforms/discord/commands/server.ts +9 -15
  165. package/src/platforms/discord/commands/snapshot.ts +5 -7
  166. package/src/platforms/discord/commands/thread.ts +8 -15
  167. package/src/platforms/discord/commands/user.ts +9 -20
  168. package/src/platforms/discord/credential-manager.test.ts +2 -2
  169. package/src/platforms/discord/credential-manager.ts +1 -3
  170. package/src/platforms/discord/token-extractor.test.ts +28 -57
  171. package/src/platforms/discord/token-extractor.ts +10 -30
  172. package/src/platforms/discord/types.ts +1 -1
  173. package/src/platforms/slack/client.test.ts +14 -20
  174. package/src/platforms/slack/client.ts +6 -11
  175. package/src/platforms/slack/commands/activity.test.ts +3 -9
  176. package/src/platforms/slack/commands/activity.ts +7 -12
  177. package/src/platforms/slack/commands/auth.test.ts +2 -2
  178. package/src/platforms/slack/commands/auth.ts +15 -31
  179. package/src/platforms/slack/commands/channel.ts +10 -32
  180. package/src/platforms/slack/commands/drafts.ts +5 -14
  181. package/src/platforms/slack/commands/file.ts +9 -29
  182. package/src/platforms/slack/commands/message.ts +23 -67
  183. package/src/platforms/slack/commands/reaction.test.ts +37 -33
  184. package/src/platforms/slack/commands/reaction.ts +21 -51
  185. package/src/platforms/slack/commands/saved.ts +5 -14
  186. package/src/platforms/slack/commands/sections.ts +4 -11
  187. package/src/platforms/slack/commands/snapshot.test.ts +1 -3
  188. package/src/platforms/slack/commands/snapshot.ts +5 -10
  189. package/src/platforms/slack/commands/unread.test.ts +6 -8
  190. package/src/platforms/slack/commands/unread.ts +10 -33
  191. package/src/platforms/slack/commands/user.test.ts +1 -4
  192. package/src/platforms/slack/commands/user.ts +6 -8
  193. package/src/platforms/slack/commands/workspace.test.ts +1 -1
  194. package/src/platforms/slack/commands/workspace.ts +7 -12
  195. package/src/platforms/slack/token-extractor-node-test.ts +1 -1
  196. package/src/platforms/slack/token-extractor.ts +8 -17
  197. package/src/platforms/slack/types.ts +11 -1
  198. package/src/platforms/slackbot/cli.ts +1 -7
  199. package/src/platforms/slackbot/client.test.ts +7 -7
  200. package/src/platforms/slackbot/client.ts +4 -11
  201. package/src/platforms/slackbot/commands/auth.test.ts +1 -1
  202. package/src/platforms/slackbot/commands/auth.ts +7 -7
  203. package/src/platforms/slackbot/commands/channel.ts +4 -4
  204. package/src/platforms/slackbot/commands/message.ts +16 -29
  205. package/src/platforms/slackbot/commands/reaction.ts +6 -16
  206. package/src/platforms/slackbot/commands/shared.ts +2 -4
  207. package/src/platforms/slackbot/commands/user.ts +4 -4
  208. package/src/platforms/slackbot/credential-manager.ts +2 -7
  209. package/src/platforms/slackbot/types.ts +1 -1
  210. package/src/platforms/teams/client.test.ts +15 -32
  211. package/src/platforms/teams/client.ts +18 -51
  212. package/src/platforms/teams/commands/auth.test.ts +6 -16
  213. package/src/platforms/teams/commands/auth.ts +16 -26
  214. package/src/platforms/teams/commands/channel.test.ts +2 -5
  215. package/src/platforms/teams/commands/channel.ts +10 -20
  216. package/src/platforms/teams/commands/file.test.ts +1 -4
  217. package/src/platforms/teams/commands/file.ts +11 -21
  218. package/src/platforms/teams/commands/message.test.ts +1 -3
  219. package/src/platforms/teams/commands/message.ts +15 -25
  220. package/src/platforms/teams/commands/reaction.test.ts +2 -7
  221. package/src/platforms/teams/commands/reaction.ts +12 -16
  222. package/src/platforms/teams/commands/snapshot.ts +6 -11
  223. package/src/platforms/teams/commands/team.test.ts +15 -26
  224. package/src/platforms/teams/commands/team.ts +10 -19
  225. package/src/platforms/teams/commands/user.ts +8 -14
  226. package/src/platforms/teams/credential-manager.test.ts +2 -5
  227. package/src/platforms/teams/token-extractor.test.ts +21 -50
  228. package/src/platforms/teams/token-extractor.ts +12 -20
  229. package/src/platforms/teams/types.ts +1 -1
  230. package/src/shared/utils/concurrency.test.ts +2 -2
  231. package/src/shared/utils/concurrency.ts +1 -1
  232. package/.claude/commands/release.md +0 -92
  233. package/dist/src/platforms/discord/commands/guild.d.ts +0 -15
  234. package/dist/src/platforms/discord/commands/guild.d.ts.map +0 -1
  235. package/dist/src/platforms/discord/commands/guild.js +0 -102
  236. package/dist/src/platforms/discord/commands/guild.js.map +0 -1
@@ -154,8 +154,58 @@ agent-slack snapshot --users-only
154
154
  agent-slack snapshot --limit 10
155
155
  ```
156
156
 
157
+ ### Activity Commands
158
+
159
+ ```bash
160
+ # List activity feed
161
+ agent-slack activity list
162
+ agent-slack activity list --limit 50
163
+
164
+ # Show only unread activity
165
+ agent-slack activity list --unread
166
+
167
+ # Filter by activity types
168
+ agent-slack activity list --types thread_reply,message_reaction,at_user,at_channel,keyword
169
+ ```
170
+
171
+ ### Unread Commands
172
+
173
+ ```bash
174
+ # Get unread counts for all channels
175
+ agent-slack unread counts
176
+
177
+ # Get thread subscription details
178
+ agent-slack unread threads <channel> <thread_ts>
179
+
180
+ # Mark channel as read up to a timestamp
181
+ agent-slack unread mark <channel> <ts>
182
+ ```
183
+
184
+ ### Drafts Commands
185
+
186
+ ```bash
187
+ # List message drafts
188
+ agent-slack drafts list
189
+ agent-slack drafts list --limit 10
190
+ ```
191
+
192
+ ### Saved Items Commands
193
+
194
+ ```bash
195
+ # List saved items
196
+ agent-slack saved list
197
+ agent-slack saved list --limit 10
198
+ ```
199
+
200
+ ### Sections Commands
201
+
202
+ ```bash
203
+ # List channel sections (sidebar folders)
204
+ agent-slack sections list
205
+ ```
206
+
157
207
  ## AI Agent Integration
158
208
 
159
- See `skills/agent-messenger/` directory for:
209
+ See [`skills/agent-slack/`](https://github.com/devxoul/agent-messenger/tree/main/skills/agent-slack) for:
160
210
  - Complete skill documentation
161
211
  - Runnable templates
@@ -74,6 +74,16 @@ agent-slackbot auth set xoxb-your-bot-token --bot deploy --name "Deploy Bot"
74
74
  agent-slackbot auth status
75
75
  ```
76
76
 
77
+ ### Authentication Commands
78
+
79
+ ```bash
80
+ # Check bot auth status
81
+ agent-slackbot auth status
82
+
83
+ # Clear all stored credentials
84
+ agent-slackbot auth clear
85
+ ```
86
+
77
87
  ### Multi-Bot Support
78
88
 
79
89
  Store multiple bot tokens and switch between them:
@@ -198,7 +208,7 @@ agent-slackbot reaction remove <channel> <ts> <emoji>
198
208
 
199
209
  ## AI Agent Integration
200
210
 
201
- See `skills/agent-slackbot/` directory for:
211
+ See [`skills/agent-slackbot/`](https://github.com/devxoul/agent-messenger/tree/main/skills/agent-slackbot) for:
202
212
  - Complete skill documentation
203
213
  - Runnable templates
204
214
  - Common patterns for AI agents
@@ -109,6 +109,9 @@ agent-teams team current
109
109
 
110
110
  # Get team info
111
111
  agent-teams team info <team-id>
112
+
113
+ # Remove a stored team
114
+ agent-teams team remove <team-id>
112
115
  ```
113
116
 
114
117
  ## Commands
@@ -283,7 +286,7 @@ Some operations require specific Microsoft 365 permissions. Check with your IT a
283
286
 
284
287
  ## AI Agent Integration
285
288
 
286
- See `skills/agent-messenger/` directory for:
289
+ See [`skills/agent-teams/`](https://github.com/devxoul/agent-messenger/tree/main/skills/agent-teams) for:
287
290
  - Complete skill documentation
288
291
  - Runnable templates
289
292
 
@@ -23,8 +23,9 @@ yarn global add agent-messenger
23
23
  bun add -g agent-messenger
24
24
  ```
25
25
 
26
- This installs three CLI tools:
27
- - `agent-slack` — Slack CLI
26
+ This installs four CLI tools:
27
+ - `agent-slack` — Slack CLI (user token, zero-config)
28
+ - `agent-slackbot` — Slack Bot CLI (bot token, for server-side/CI/CD)
28
29
  - `agent-discord` — Discord CLI
29
30
  - `agent-teams` — Microsoft Teams CLI
30
31
 
Binary file
@@ -1,7 +1,14 @@
1
1
  import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared'
2
+ import Image from 'next/image'
3
+ import icon from './icon.png'
2
4
 
3
5
  export const baseOptions: BaseLayoutProps = {
4
6
  nav: {
5
- title: 'Agent Messenger',
7
+ title: (
8
+ <>
9
+ <Image src={icon} alt="Agent Messenger" width={24} height={24} />
10
+ Agent Messenger
11
+ </>
12
+ ),
6
13
  },
7
14
  }
package/package.json CHANGED
@@ -1,28 +1,34 @@
1
1
  {
2
2
  "name": "agent-messenger",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Multi-platform messaging CLI for AI agents (Slack, Discord, Teams)",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/devxoul/agent-messenger"
8
+ },
5
9
  "type": "module",
6
10
  "module": "dist/cli.js",
7
11
  "main": "dist/cli.js",
8
12
  "bin": {
9
- "agent-messenger": "./src/cli.ts",
10
- "amsg": "./src/cli.ts",
11
- "agent-slack": "./src/platforms/slack/cli.ts",
12
- "agent-discord": "./src/platforms/discord/cli.ts",
13
- "agent-teams": "./src/platforms/teams/cli.ts",
14
- "agent-slackbot": "./src/platforms/slackbot/cli.ts"
13
+ "agent-messenger": "dist/src/cli.js",
14
+ "amsg": "dist/src/cli.js",
15
+ "agent-slack": "dist/src/platforms/slack/cli.js",
16
+ "agent-discord": "dist/src/platforms/discord/cli.js",
17
+ "agent-teams": "dist/src/platforms/teams/cli.js",
18
+ "agent-slackbot": "dist/src/platforms/slackbot/cli.js"
15
19
  },
16
20
  "scripts": {
17
- "build": "tsc",
21
+ "build": "tsc && tsc-alias",
18
22
  "postbuild": "bun scripts/postbuild.ts",
19
23
  "test": "bun test src/",
20
24
  "test:e2e": "bun test e2e/",
21
25
  "typecheck": "tsc --noEmit",
22
26
  "lint": "biome check .",
27
+ "lint:fix": "biome check --write --unsafe .",
23
28
  "format": "biome format --write .",
24
29
  "dev": "bun --hot ./dist/cli.js",
25
- "prepublishOnly": "bun run build"
30
+ "prepublishOnly": "bun run build && bun scripts/prepublish.ts",
31
+ "postpublish": "git checkout package.json"
26
32
  },
27
33
  "dependencies": {
28
34
  "@slack/web-api": "^6.9.0",
@@ -36,6 +42,7 @@
36
42
  "@types/better-sqlite3": "^7.6.8",
37
43
  "@types/bun": "latest",
38
44
  "@types/node": "^20.10.6",
45
+ "tsc-alias": "^1.8.16",
39
46
  "tsx": "^4.21.0",
40
47
  "typescript": "^5.9.3"
41
48
  }
@@ -0,0 +1,11 @@
1
+ import { readFileSync, writeFileSync } from 'node:fs'
2
+
3
+ const pkgPath = 'package.json'
4
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'))
5
+
6
+ for (const [name, path] of Object.entries(pkg.bin as Record<string, string>)) {
7
+ pkg.bin[name] = path.replace(/^\.\/src\//, 'dist/src/').replace(/\.ts$/, '.js')
8
+ }
9
+
10
+ writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`)
11
+ console.log('Rewrote bin paths for publish')
@@ -333,6 +333,20 @@ Format:
333
333
  - Plain text messages only (no embeds in v1)
334
334
  - User tokens only (no bot tokens)
335
335
 
336
+ ## Troubleshooting
337
+
338
+ ### `agent-discord: command not found`
339
+
340
+ The `agent-messenger` package is not installed. Run it directly using a package runner. Ask the user which one to use:
341
+
342
+ ```bash
343
+ npx -p agent-messenger agent-discord ...
344
+ bunx -p agent-messenger agent-discord ...
345
+ pnpm dlx --package agent-messenger agent-discord ...
346
+ ```
347
+
348
+ If you already know the user's preferred package runner, use it directly instead of asking.
349
+
336
350
  ## References
337
351
 
338
352
  - [Authentication Guide](references/authentication.md)
@@ -315,6 +315,20 @@ Format:
315
315
  - No user presence features
316
316
  - Plain text messages only (no blocks/formatting in v1)
317
317
 
318
+ ## Troubleshooting
319
+
320
+ ### `agent-slack: command not found`
321
+
322
+ The `agent-messenger` package is not installed. Run it directly using a package runner. Ask the user which one to use:
323
+
324
+ ```bash
325
+ npx -p agent-messenger agent-slack ...
326
+ bunx -p agent-messenger agent-slack ...
327
+ pnpm dlx --package agent-messenger agent-slack ...
328
+ ```
329
+
330
+ If you already know the user's preferred package runner, use it directly instead of asking.
331
+
318
332
  ## References
319
333
 
320
334
  - [Authentication Guide](references/authentication.md)
@@ -279,6 +279,20 @@ Format:
279
279
  - No scheduled messages
280
280
  - Plain text messages only (no blocks/formatting)
281
281
 
282
+ ## Troubleshooting
283
+
284
+ ### `agent-slackbot: command not found`
285
+
286
+ The `agent-messenger` package is not installed. Run it directly using a package runner. Ask the user which one to use:
287
+
288
+ ```bash
289
+ npx -p agent-messenger agent-slackbot ...
290
+ bunx -p agent-messenger agent-slackbot ...
291
+ pnpm dlx --package agent-messenger agent-slackbot ...
292
+ ```
293
+
294
+ If you already know the user's preferred package runner, use it directly instead of asking.
295
+
282
296
  ## References
283
297
 
284
298
  - [Authentication Guide](references/authentication.md)
@@ -286,6 +286,20 @@ Format:
286
286
  - User tokens only (no app tokens)
287
287
  - **Token expires in 60-90 minutes** - must re-authenticate frequently
288
288
 
289
+ ## Troubleshooting
290
+
291
+ ### `agent-teams: command not found`
292
+
293
+ The `agent-messenger` package is not installed. Run it directly using a package runner. Ask the user which one to use:
294
+
295
+ ```bash
296
+ npx -p agent-messenger agent-teams ...
297
+ bunx -p agent-messenger agent-teams ...
298
+ pnpm dlx --package agent-messenger agent-teams ...
299
+ ```
300
+
301
+ If you already know the user's preferred package runner, use it directly instead of asking.
302
+
289
303
  ## References
290
304
 
291
305
  - [Authentication Guide](references/authentication.md)
package/src/cli.ts CHANGED
@@ -10,10 +10,7 @@ const __dirname = dirname(__filename)
10
10
 
11
11
  const program = new Command()
12
12
 
13
- program
14
- .name('agent-messenger')
15
- .description('Multi-platform messaging CLI for AI agents')
16
- .version(pkg.version)
13
+ program.name('agent-messenger').description('Multi-platform messaging CLI for AI agents').version(pkg.version)
17
14
 
18
15
  // Use absolute paths for CWD-independence
19
16
  program.command('slack', 'Interact with Slack workspaces', {
@@ -11,10 +11,7 @@ describe('DiscordClient', () => {
11
11
  fetchCalls = []
12
12
  fetchResponses = []
13
13
  fetchIndex = 0
14
- ;(globalThis as any).fetch = async (
15
- url: string | URL | Request,
16
- options?: RequestInit
17
- ): Promise<Response> => {
14
+ ;(globalThis as any).fetch = async (url: string | URL | Request, options?: RequestInit): Promise<Response> => {
18
15
  fetchCalls.push({ url: url.toString(), options })
19
16
  const response = fetchResponses[fetchIndex]
20
17
  fetchIndex++
@@ -45,7 +42,7 @@ describe('DiscordClient', () => {
45
42
  new Response(body === null ? null : JSON.stringify(body), {
46
43
  status,
47
44
  headers: defaultHeaders,
48
- })
45
+ }),
49
46
  )
50
47
  }
51
48
 
@@ -236,7 +233,7 @@ describe('DiscordClient', () => {
236
233
  await client.addReaction('ch1', 'msg1', '👍')
237
234
 
238
235
  expect(fetchCalls[0].url).toBe(
239
- 'https://discord.com/api/v10/channels/ch1/messages/msg1/reactions/%F0%9F%91%8D/@me'
236
+ 'https://discord.com/api/v10/channels/ch1/messages/msg1/reactions/%F0%9F%91%8D/@me',
240
237
  )
241
238
  expect(fetchCalls[0].options?.method).toBe('PUT')
242
239
  })
@@ -250,7 +247,7 @@ describe('DiscordClient', () => {
250
247
  await client.removeReaction('ch1', 'msg1', '👍')
251
248
 
252
249
  expect(fetchCalls[0].url).toBe(
253
- 'https://discord.com/api/v10/channels/ch1/messages/msg1/reactions/%F0%9F%91%8D/@me'
250
+ 'https://discord.com/api/v10/channels/ch1/messages/msg1/reactions/%F0%9F%91%8D/@me',
254
251
  )
255
252
  expect(fetchCalls[0].options?.method).toBe('DELETE')
256
253
  })
@@ -258,10 +255,7 @@ describe('DiscordClient', () => {
258
255
 
259
256
  describe('listUsers', () => {
260
257
  test('returns list of server members', async () => {
261
- mockResponse([
262
- { user: { id: 'u1', username: 'user1' } },
263
- { user: { id: 'u2', username: 'user2' } },
264
- ])
258
+ mockResponse([{ user: { id: 'u1', username: 'user1' } }, { user: { id: 'u2', username: 'user2' } }])
265
259
 
266
260
  const client = new DiscordClient('test-token')
267
261
  const users = await client.listUsers('111')
@@ -324,9 +318,7 @@ describe('DiscordClient', () => {
324
318
  author: { id: '123', username: 'user1' },
325
319
  content: '',
326
320
  timestamp: '2024-01-01T00:00:00.000Z',
327
- attachments: [
328
- { id: 'att1', filename: 'file1.txt', size: 100, url: 'https://example.com/file1.txt' },
329
- ],
321
+ attachments: [{ id: 'att1', filename: 'file1.txt', size: 100, url: 'https://example.com/file1.txt' }],
330
322
  },
331
323
  {
332
324
  id: 'msg2',
@@ -143,7 +143,7 @@ export class DiscordClient {
143
143
  const errorBody = await response.json().catch(() => ({}))
144
144
  throw new DiscordError(
145
145
  (errorBody as any).message || `HTTP ${response.status}`,
146
- (errorBody as any).code?.toString() || `http_${response.status}`
146
+ (errorBody as any).code?.toString() || `http_${response.status}`,
147
147
  )
148
148
  }
149
149
 
@@ -176,7 +176,7 @@ export class DiscordClient {
176
176
  const errorBody = await response.json().catch(() => ({}))
177
177
  throw new DiscordError(
178
178
  (errorBody as any).message || `HTTP ${response.status}`,
179
- (errorBody as any).code?.toString() || `http_${response.status}`
179
+ (errorBody as any).code?.toString() || `http_${response.status}`,
180
180
  )
181
181
  }
182
182
 
@@ -221,18 +221,12 @@ export class DiscordClient {
221
221
 
222
222
  async addReaction(channelId: string, messageId: string, emoji: string): Promise<void> {
223
223
  const encodedEmoji = encodeURIComponent(emoji)
224
- return this.request<void>(
225
- 'PUT',
226
- `/channels/${channelId}/messages/${messageId}/reactions/${encodedEmoji}/@me`
227
- )
224
+ return this.request<void>('PUT', `/channels/${channelId}/messages/${messageId}/reactions/${encodedEmoji}/@me`)
228
225
  }
229
226
 
230
227
  async removeReaction(channelId: string, messageId: string, emoji: string): Promise<void> {
231
228
  const encodedEmoji = encodeURIComponent(emoji)
232
- return this.request<void>(
233
- 'DELETE',
234
- `/channels/${channelId}/messages/${messageId}/reactions/${encodedEmoji}/@me`
235
- )
229
+ return this.request<void>('DELETE', `/channels/${channelId}/messages/${messageId}/reactions/${encodedEmoji}/@me`)
236
230
  }
237
231
 
238
232
  async ackMessage(channelId: string, messageId: string): Promise<void> {
@@ -245,10 +239,7 @@ export class DiscordClient {
245
239
  interface GuildMember {
246
240
  user: DiscordUser
247
241
  }
248
- const members = await this.request<GuildMember[]>(
249
- 'GET',
250
- `/guilds/${serverId}/members?limit=1000`
251
- )
242
+ const members = await this.request<GuildMember[]>('GET', `/guilds/${serverId}/members?limit=1000`)
252
243
  return members.map((m) => m.user)
253
244
  }
254
245
 
@@ -266,10 +257,7 @@ export class DiscordClient {
266
257
  interface MessageWithAttachments extends DiscordMessage {
267
258
  attachments: DiscordFile[]
268
259
  }
269
- const message = await this.requestFormData<MessageWithAttachments>(
270
- `/channels/${channelId}/messages`,
271
- formData
272
- )
260
+ const message = await this.requestFormData<MessageWithAttachments>(`/channels/${channelId}/messages`, formData)
273
261
 
274
262
  return message.attachments[0]
275
263
  }
@@ -278,10 +266,7 @@ export class DiscordClient {
278
266
  interface MessageWithAttachments extends DiscordMessage {
279
267
  attachments: DiscordFile[]
280
268
  }
281
- const messages = await this.request<MessageWithAttachments[]>(
282
- 'GET',
283
- `/channels/${channelId}/messages?limit=100`
284
- )
269
+ const messages = await this.request<MessageWithAttachments[]>('GET', `/channels/${channelId}/messages?limit=100`)
285
270
 
286
271
  const files: DiscordFile[] = []
287
272
  for (const msg of messages) {
@@ -334,25 +319,18 @@ export class DiscordClient {
334
319
  return this.request<DiscordRelationship[]>('GET', '/users/@me/relationships')
335
320
  }
336
321
 
337
- async searchMembers(
338
- guildId: string,
339
- query: string,
340
- limit: number = 10
341
- ): Promise<DiscordGuildMember[]> {
322
+ async searchMembers(guildId: string, query: string, limit: number = 10): Promise<DiscordGuildMember[]> {
342
323
  const params = new URLSearchParams()
343
324
  params.set('query', query)
344
325
  params.set('limit', limit.toString())
345
326
 
346
- return this.request<DiscordGuildMember[]>(
347
- 'GET',
348
- `/guilds/${guildId}/members/search?${params.toString()}`
349
- )
327
+ return this.request<DiscordGuildMember[]>('GET', `/guilds/${guildId}/members/search?${params.toString()}`)
350
328
  }
351
329
 
352
330
  async searchMessages(
353
331
  guildId: string,
354
332
  query: string,
355
- options: DiscordSearchOptions = {}
333
+ options: DiscordSearchOptions = {},
356
334
  ): Promise<{ results: DiscordSearchResult[]; total: number }> {
357
335
  const params = new URLSearchParams()
358
336
  params.set('content', query)
@@ -381,7 +359,7 @@ export class DiscordClient {
381
359
 
382
360
  const response = await this.request<DiscordSearchResponse>(
383
361
  'GET',
384
- `/guilds/${guildId}/messages/search?${params.toString()}`
362
+ `/guilds/${guildId}/messages/search?${params.toString()}`,
385
363
  )
386
364
 
387
365
  const results = response.messages
@@ -413,7 +391,7 @@ export class DiscordClient {
413
391
  options?: {
414
392
  auto_archive_duration?: number
415
393
  rate_limit_per_user?: number
416
- }
394
+ },
417
395
  ): Promise<DiscordChannel> {
418
396
  return this.request<DiscordChannel>('POST', `/channels/${channelId}/threads`, {
419
397
  name,
@@ -34,14 +34,9 @@ beforeEach(() => {
34
34
  servers: {},
35
35
  })
36
36
 
37
- credManagerSaveSpy = spyOn(DiscordCredentialManager.prototype, 'save').mockResolvedValue(
38
- undefined
39
- )
37
+ credManagerSaveSpy = spyOn(DiscordCredentialManager.prototype, 'save').mockResolvedValue(undefined)
40
38
 
41
- credManagerClearTokenSpy = spyOn(
42
- DiscordCredentialManager.prototype,
43
- 'clearToken'
44
- ).mockResolvedValue(undefined)
39
+ credManagerClearTokenSpy = spyOn(DiscordCredentialManager.prototype, 'clearToken').mockResolvedValue(undefined)
45
40
  })
46
41
 
47
42
  afterEach(() => {
@@ -1,6 +1,6 @@
1
1
  import { Command } from 'commander'
2
- import { handleError } from '../../../shared/utils/error-handler'
3
- import { formatOutput } from '../../../shared/utils/output'
2
+ import { handleError } from '@/shared/utils/error-handler'
3
+ import { formatOutput } from '@/shared/utils/output'
4
4
  import { DiscordClient } from '../client'
5
5
  import { DiscordCredentialManager } from '../credential-manager'
6
6
  import { DiscordTokenExtractor } from '../token-extractor'
@@ -36,12 +36,11 @@ export async function extractAction(options: { pretty?: boolean; debug?: boolean
36
36
  console.log(
37
37
  formatOutput(
38
38
  {
39
- error:
40
- 'No Discord token found. Make sure Discord desktop app is installed and logged in.',
39
+ error: 'No Discord token found. Make sure Discord desktop app is installed and logged in.',
41
40
  hint: options.debug ? undefined : 'Run with --debug for more info.',
42
41
  },
43
- options.pretty
44
- )
42
+ options.pretty,
43
+ ),
45
44
  )
46
45
  process.exit(1)
47
46
  }
@@ -76,8 +75,8 @@ export async function extractAction(options: { pretty?: boolean; debug?: boolean
76
75
  {
77
76
  error: 'No servers found. Make sure you are a member of at least one Discord server.',
78
77
  },
79
- options.pretty
80
- )
78
+ options.pretty,
79
+ ),
81
80
  )
82
81
  process.exit(1)
83
82
  }
@@ -117,8 +116,8 @@ export async function extractAction(options: { pretty?: boolean; debug?: boolean
117
116
  error: `Token validation failed: ${(error as Error).message}`,
118
117
  hint: 'Make sure your Discord token is valid and has not expired.',
119
118
  },
120
- options.pretty
121
- )
119
+ options.pretty,
120
+ ),
122
121
  )
123
122
  process.exit(1)
124
123
  }
@@ -133,9 +132,7 @@ export async function logoutAction(options: { pretty?: boolean }): Promise<void>
133
132
  const config = await credManager.load()
134
133
 
135
134
  if (!config.token) {
136
- console.log(
137
- formatOutput({ error: 'Not authenticated. Run "auth extract" first.' }, options.pretty)
138
- )
135
+ console.log(formatOutput({ error: 'Not authenticated. Run "auth extract" first.' }, options.pretty))
139
136
  process.exit(1)
140
137
  }
141
138
 
@@ -153,9 +150,7 @@ export async function statusAction(options: { pretty?: boolean }): Promise<void>
153
150
  const config = await credManager.load()
154
151
 
155
152
  if (!config.token) {
156
- console.log(
157
- formatOutput({ error: 'Not authenticated. Run "auth extract" first.' }, options.pretty)
158
- )
153
+ console.log(formatOutput({ error: 'Not authenticated. Run "auth extract" first.' }, options.pretty))
159
154
  process.exit(1)
160
155
  }
161
156
 
@@ -190,17 +185,17 @@ export const authCommand = new Command('auth')
190
185
  .description('Extract token from Discord desktop app')
191
186
  .option('--pretty', 'Pretty print JSON output')
192
187
  .option('--debug', 'Show debug output for troubleshooting')
193
- .action(extractAction)
188
+ .action(extractAction),
194
189
  )
195
190
  .addCommand(
196
191
  new Command('logout')
197
192
  .description('Logout from Discord')
198
193
  .option('--pretty', 'Pretty print JSON output')
199
- .action(logoutAction)
194
+ .action(logoutAction),
200
195
  )
201
196
  .addCommand(
202
197
  new Command('status')
203
198
  .description('Show authentication status')
204
199
  .option('--pretty', 'Pretty print JSON output')
205
- .action(statusAction)
200
+ .action(statusAction),
206
201
  )
@@ -15,29 +15,27 @@ beforeEach(() => {
15
15
  { id: 'ch-3', guild_id: 'guild-1', name: 'voice-channel', type: 2, topic: undefined },
16
16
  ])
17
17
 
18
- clientGetChannelSpy = spyOn(DiscordClient.prototype, 'getChannel').mockImplementation(
19
- async (channelId: string) => {
20
- if (channelId === 'ch-1') {
21
- return {
22
- id: 'ch-1',
23
- guild_id: 'guild-1',
24
- name: 'general',
25
- type: 0,
26
- topic: 'General discussion',
27
- }
18
+ clientGetChannelSpy = spyOn(DiscordClient.prototype, 'getChannel').mockImplementation(async (channelId: string) => {
19
+ if (channelId === 'ch-1') {
20
+ return {
21
+ id: 'ch-1',
22
+ guild_id: 'guild-1',
23
+ name: 'general',
24
+ type: 0,
25
+ topic: 'General discussion',
28
26
  }
29
- if (channelId === 'ch-2') {
30
- return {
31
- id: 'ch-2',
32
- guild_id: 'guild-1',
33
- name: 'announcements',
34
- type: 0,
35
- topic: 'Announcements',
36
- }
27
+ }
28
+ if (channelId === 'ch-2') {
29
+ return {
30
+ id: 'ch-2',
31
+ guild_id: 'guild-1',
32
+ name: 'announcements',
33
+ type: 0,
34
+ topic: 'Announcements',
37
35
  }
38
- throw new Error('Channel not found')
39
36
  }
40
- )
37
+ throw new Error('Channel not found')
38
+ })
41
39
 
42
40
  clientGetMessagesSpy = spyOn(DiscordClient.prototype, 'getMessages').mockResolvedValue([
43
41
  {