agent-messenger 1.3.4 → 1.3.6

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 (101) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.env.template +17 -1
  3. package/bunfig.e2e.toml +3 -0
  4. package/bunfig.toml +2 -0
  5. package/dist/package.json +3 -3
  6. package/dist/src/cli.d.ts.map +1 -1
  7. package/dist/src/cli.js +4 -3
  8. package/dist/src/cli.js.map +1 -1
  9. package/dist/src/platforms/discord/cli.js +1 -1
  10. package/dist/src/platforms/discord/client.d.ts +1 -1
  11. package/dist/src/platforms/discord/client.js +1 -1
  12. package/dist/src/platforms/discord/commands/auth.js +5 -5
  13. package/dist/src/platforms/discord/commands/channel.js +4 -4
  14. package/dist/src/platforms/discord/commands/dm.js +4 -4
  15. package/dist/src/platforms/discord/commands/file.js +4 -4
  16. package/dist/src/platforms/discord/commands/friend.js +2 -2
  17. package/dist/src/platforms/discord/commands/index.d.ts +8 -8
  18. package/dist/src/platforms/discord/commands/index.js +8 -8
  19. package/dist/src/platforms/discord/commands/member.js +4 -4
  20. package/dist/src/platforms/discord/commands/mention.js +4 -4
  21. package/dist/src/platforms/discord/commands/message.js +4 -4
  22. package/dist/src/platforms/discord/commands/note.js +4 -4
  23. package/dist/src/platforms/discord/commands/profile.js +4 -4
  24. package/dist/src/platforms/discord/commands/reaction.js +4 -4
  25. package/dist/src/platforms/discord/commands/server.js +4 -4
  26. package/dist/src/platforms/discord/commands/snapshot.js +5 -5
  27. package/dist/src/platforms/discord/commands/thread.js +4 -4
  28. package/dist/src/platforms/discord/commands/user.js +4 -4
  29. package/dist/src/platforms/discord/token-extractor.d.ts +1 -1
  30. package/dist/src/platforms/discord/token-extractor.js +1 -1
  31. package/dist/src/platforms/slack/cli.js +1 -1
  32. package/dist/src/platforms/slack/client.d.ts +1 -1
  33. package/dist/src/platforms/slack/client.js +3 -3
  34. package/dist/src/platforms/slack/client.js.map +1 -1
  35. package/dist/src/platforms/slack/commands/activity.js +4 -4
  36. package/dist/src/platforms/slack/commands/auth.js +5 -5
  37. package/dist/src/platforms/slack/commands/channel.js +4 -4
  38. package/dist/src/platforms/slack/commands/drafts.js +4 -4
  39. package/dist/src/platforms/slack/commands/file.js +4 -4
  40. package/dist/src/platforms/slack/commands/index.d.ts +13 -13
  41. package/dist/src/platforms/slack/commands/index.js +13 -13
  42. package/dist/src/platforms/slack/commands/message.js +4 -4
  43. package/dist/src/platforms/slack/commands/reaction.js +4 -4
  44. package/dist/src/platforms/slack/commands/saved.js +4 -4
  45. package/dist/src/platforms/slack/commands/sections.js +4 -4
  46. package/dist/src/platforms/slack/commands/snapshot.js +5 -5
  47. package/dist/src/platforms/slack/commands/unread.js +4 -4
  48. package/dist/src/platforms/slack/commands/user.js +4 -4
  49. package/dist/src/platforms/slack/commands/workspace.js +3 -3
  50. package/dist/src/platforms/slack/credential-manager.d.ts +1 -1
  51. package/dist/src/platforms/slack/index.d.ts +2 -2
  52. package/dist/src/platforms/slack/index.js +2 -2
  53. package/dist/src/platforms/slack/token-extractor.d.ts +1 -1
  54. package/dist/src/platforms/slack/token-extractor.js +1 -1
  55. package/dist/src/platforms/slackbot/cli.js +2 -2
  56. package/dist/src/platforms/slackbot/client.d.ts +1 -1
  57. package/dist/src/platforms/slackbot/client.js +1 -1
  58. package/dist/src/platforms/slackbot/commands/auth.d.ts +1 -1
  59. package/dist/src/platforms/slackbot/commands/auth.js +3 -3
  60. package/dist/src/platforms/slackbot/commands/channel.js +3 -3
  61. package/dist/src/platforms/slackbot/commands/index.d.ts +5 -5
  62. package/dist/src/platforms/slackbot/commands/index.js +5 -5
  63. package/dist/src/platforms/slackbot/commands/message.js +3 -3
  64. package/dist/src/platforms/slackbot/commands/reaction.js +3 -3
  65. package/dist/src/platforms/slackbot/commands/shared.d.ts +2 -2
  66. package/dist/src/platforms/slackbot/commands/shared.js +3 -3
  67. package/dist/src/platforms/slackbot/commands/user.js +3 -3
  68. package/dist/src/platforms/slackbot/credential-manager.d.ts +1 -1
  69. package/dist/src/platforms/slackbot/index.d.ts +3 -3
  70. package/dist/src/platforms/slackbot/index.js +3 -3
  71. package/dist/src/platforms/teams/cli.js +2 -2
  72. package/dist/src/platforms/teams/client.d.ts +1 -1
  73. package/dist/src/platforms/teams/client.js +1 -1
  74. package/dist/src/platforms/teams/commands/auth.js +5 -5
  75. package/dist/src/platforms/teams/commands/channel.js +4 -4
  76. package/dist/src/platforms/teams/commands/file.js +4 -4
  77. package/dist/src/platforms/teams/commands/index.d.ts +8 -8
  78. package/dist/src/platforms/teams/commands/index.js +8 -8
  79. package/dist/src/platforms/teams/commands/message.js +4 -4
  80. package/dist/src/platforms/teams/commands/reaction.js +4 -4
  81. package/dist/src/platforms/teams/commands/snapshot.js +5 -5
  82. package/dist/src/platforms/teams/commands/team.js +4 -4
  83. package/dist/src/platforms/teams/commands/user.js +4 -4
  84. package/dist/src/platforms/teams/credential-manager.d.ts +1 -1
  85. package/dist/src/platforms/teams/token-extractor.d.ts +1 -1
  86. package/dist/src/platforms/teams/token-extractor.js +1 -1
  87. package/e2e/README.md +62 -12
  88. package/e2e/config.ts +38 -0
  89. package/e2e/discord.e2e.test.ts +49 -2
  90. package/e2e/helpers.ts +1 -0
  91. package/e2e/setup.ts +10 -0
  92. package/e2e/slack.e2e.test.ts +77 -0
  93. package/e2e/teams.e2e.test.ts +287 -0
  94. package/package.json +3 -3
  95. package/scripts/postbuild.ts +2 -0
  96. package/skills/agent-discord/SKILL.md +11 -5
  97. package/skills/agent-slack/SKILL.md +11 -5
  98. package/skills/agent-slackbot/SKILL.md +11 -5
  99. package/skills/agent-teams/SKILL.md +11 -5
  100. package/src/cli.ts +4 -3
  101. package/src/platforms/slack/client.ts +4 -4
@@ -337,15 +337,21 @@ Format:
337
337
 
338
338
  ### `agent-discord: command not found`
339
339
 
340
- The `agent-messenger` package is not installed. Run it directly using a package runner. Ask the user which one to use:
340
+ **`agent-discord` is NOT the npm package name.** The npm package is `agent-messenger`.
341
+
342
+ If the package is installed globally, use `agent-discord` directly:
343
+
344
+ ```bash
345
+ agent-discord message list general
346
+ ```
347
+
348
+ If the package is NOT installed, use `bunx agent-messenger discord`:
341
349
 
342
350
  ```bash
343
- npx -p agent-messenger agent-discord ...
344
- bunx -p agent-messenger agent-discord ...
345
- pnpm dlx --package agent-messenger agent-discord ...
351
+ bunx agent-messenger discord message list general
346
352
  ```
347
353
 
348
- If you already know the user's preferred package runner, use it directly instead of asking.
354
+ **NEVER run `bunx agent-discord`** it will fail or install a wrong package since `agent-discord` is not the npm package name.
349
355
 
350
356
  ## References
351
357
 
@@ -319,15 +319,21 @@ Format:
319
319
 
320
320
  ### `agent-slack: command not found`
321
321
 
322
- The `agent-messenger` package is not installed. Run it directly using a package runner. Ask the user which one to use:
322
+ **`agent-slack` is NOT the npm package name.** The npm package is `agent-messenger`.
323
+
324
+ If the package is installed globally, use `agent-slack` directly:
325
+
326
+ ```bash
327
+ agent-slack message list general
328
+ ```
329
+
330
+ If the package is NOT installed, use `bunx agent-messenger slack` (note: `slack` subcommand, not `agent-slack`):
323
331
 
324
332
  ```bash
325
- npx -p agent-messenger agent-slack ...
326
- bunx -p agent-messenger agent-slack ...
327
- pnpm dlx --package agent-messenger agent-slack ...
333
+ bunx agent-messenger slack message list general
328
334
  ```
329
335
 
330
- If you already know the user's preferred package runner, use it directly instead of asking.
336
+ **NEVER run `bunx agent-slack`** a separate, unrelated npm package named `agent-slack` exists on npm. It will silently install the **wrong package** with different (fewer) commands.
331
337
 
332
338
  ## References
333
339
 
@@ -283,15 +283,21 @@ Format:
283
283
 
284
284
  ### `agent-slackbot: command not found`
285
285
 
286
- The `agent-messenger` package is not installed. Run it directly using a package runner. Ask the user which one to use:
286
+ **`agent-slackbot` is NOT the npm package name.** The npm package is `agent-messenger`.
287
+
288
+ If the package is installed globally, use `agent-slackbot` directly:
289
+
290
+ ```bash
291
+ agent-slackbot message send general "Hello"
292
+ ```
293
+
294
+ If the package is NOT installed, use `bunx agent-messenger slackbot`:
287
295
 
288
296
  ```bash
289
- npx -p agent-messenger agent-slackbot ...
290
- bunx -p agent-messenger agent-slackbot ...
291
- pnpm dlx --package agent-messenger agent-slackbot ...
297
+ bunx agent-messenger slackbot message send general "Hello"
292
298
  ```
293
299
 
294
- If you already know the user's preferred package runner, use it directly instead of asking.
300
+ **NEVER run `bunx agent-slackbot`** it will fail or install a wrong package since `agent-slackbot` is not the npm package name.
295
301
 
296
302
  ## References
297
303
 
@@ -290,15 +290,21 @@ Format:
290
290
 
291
291
  ### `agent-teams: command not found`
292
292
 
293
- The `agent-messenger` package is not installed. Run it directly using a package runner. Ask the user which one to use:
293
+ **`agent-teams` is NOT the npm package name.** The npm package is `agent-messenger`.
294
+
295
+ If the package is installed globally, use `agent-teams` directly:
296
+
297
+ ```bash
298
+ agent-teams message list general
299
+ ```
300
+
301
+ If the package is NOT installed, use `bunx agent-messenger teams`:
294
302
 
295
303
  ```bash
296
- npx -p agent-messenger agent-teams ...
297
- bunx -p agent-messenger agent-teams ...
298
- pnpm dlx --package agent-messenger agent-teams ...
304
+ bunx agent-messenger teams message list general
299
305
  ```
300
306
 
301
- If you already know the user's preferred package runner, use it directly instead of asking.
307
+ **NEVER run `bunx agent-teams`** it will fail or install a wrong package since `agent-teams` is not the npm package name.
302
308
 
303
309
  ## References
304
310
 
package/src/cli.ts CHANGED
@@ -7,6 +7,7 @@ import pkg from '../package.json' with { type: 'json' }
7
7
 
8
8
  const __filename = fileURLToPath(import.meta.url)
9
9
  const __dirname = dirname(__filename)
10
+ const ext = __filename.endsWith('.ts') ? '.ts' : '.js'
10
11
 
11
12
  const program = new Command()
12
13
 
@@ -14,15 +15,15 @@ program.name('agent-messenger').description('Multi-platform messaging CLI for AI
14
15
 
15
16
  // Use absolute paths for CWD-independence
16
17
  program.command('slack', 'Interact with Slack workspaces', {
17
- executableFile: join(__dirname, 'platforms', 'slack', 'cli.ts'),
18
+ executableFile: join(__dirname, 'platforms', 'slack', `cli${ext}`),
18
19
  })
19
20
 
20
21
  program.command('discord', 'Interact with Discord guilds', {
21
- executableFile: join(__dirname, 'platforms', 'discord', 'cli.ts'),
22
+ executableFile: join(__dirname, 'platforms', 'discord', `cli${ext}`),
22
23
  })
23
24
 
24
25
  program.command('teams', 'Interact with Microsoft Teams', {
25
- executableFile: join(__dirname, 'platforms', 'teams', 'cli.ts'),
26
+ executableFile: join(__dirname, 'platforms', 'teams', `cli${ext}`),
26
27
  })
27
28
 
28
29
  program.parse(process.argv)
@@ -526,14 +526,14 @@ export class SlackClient {
526
526
 
527
527
  async getActivityFeed(options?: { types?: string; mode?: string; limit?: number }): Promise<SlackActivityItem[]> {
528
528
  return this.withRetry(async () => {
529
- const response = await (this.client as any).activity.feed({
530
- types: options?.types,
529
+ const response = await this.client.apiCall('activity.feed', {
530
+ types: options?.types || 'thread_reply,message_reaction,at_user,at_channel,keyword',
531
531
  mode: options?.mode || 'chrono_reads_and_unreads',
532
532
  limit: options?.limit || 20,
533
533
  })
534
534
  this.checkResponse(response)
535
535
 
536
- const items = (response.items || []).map((item: any) => ({
536
+ const items = ((response as any).items || []).map((item: any) => ({
537
537
  id: item.id || '',
538
538
  type: item.type || '',
539
539
  channel: item.channel || '',
@@ -555,7 +555,7 @@ export class SlackClient {
555
555
  return this.withRetry(async () => {
556
556
  const response = await (this.client as any).apiCall('saved.list', {
557
557
  cursor,
558
- limit: 100,
558
+ limit: 50,
559
559
  })
560
560
  this.checkResponse(response)
561
561