agent-messenger 1.4.0 → 1.6.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 (111) hide show
  1. package/.claude-plugin/README.md +38 -14
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.github/workflows/ci.yml +3 -0
  4. package/CONTRIBUTING.md +24 -1
  5. package/README.md +12 -8
  6. package/dist/package.json +1 -1
  7. package/dist/src/platforms/discord/cli.d.ts.map +1 -1
  8. package/dist/src/platforms/discord/cli.js +8 -1
  9. package/dist/src/platforms/discord/cli.js.map +1 -1
  10. package/dist/src/platforms/discord/commands/file.d.ts.map +1 -1
  11. package/dist/src/platforms/discord/commands/file.js +13 -7
  12. package/dist/src/platforms/discord/commands/file.js.map +1 -1
  13. package/dist/src/platforms/discord/commands/friend.d.ts.map +1 -1
  14. package/dist/src/platforms/discord/commands/friend.js +30 -30
  15. package/dist/src/platforms/discord/commands/friend.js.map +1 -1
  16. package/dist/src/platforms/discord/commands/index.d.ts +7 -0
  17. package/dist/src/platforms/discord/commands/index.d.ts.map +1 -1
  18. package/dist/src/platforms/discord/commands/index.js +7 -0
  19. package/dist/src/platforms/discord/commands/index.js.map +1 -1
  20. package/dist/src/platforms/discord/commands/snapshot.d.ts.map +1 -1
  21. package/dist/src/platforms/discord/commands/snapshot.js +1 -2
  22. package/dist/src/platforms/discord/commands/snapshot.js.map +1 -1
  23. package/dist/src/platforms/slack/commands/file.d.ts.map +1 -1
  24. package/dist/src/platforms/slack/commands/file.js +10 -4
  25. package/dist/src/platforms/slack/commands/file.js.map +1 -1
  26. package/dist/src/platforms/slack/commands/sections.d.ts.map +1 -1
  27. package/dist/src/platforms/slack/commands/sections.js +5 -6
  28. package/dist/src/platforms/slack/commands/sections.js.map +1 -1
  29. package/dist/src/platforms/slack/commands/snapshot.d.ts.map +1 -1
  30. package/dist/src/platforms/slack/commands/snapshot.js +1 -2
  31. package/dist/src/platforms/slack/commands/snapshot.js.map +1 -1
  32. package/dist/src/platforms/slack/commands/user.js +8 -8
  33. package/dist/src/platforms/slackbot/commands/reaction.js +2 -2
  34. package/dist/src/platforms/slackbot/commands/reaction.js.map +1 -1
  35. package/dist/src/platforms/teams/cli.d.ts.map +1 -1
  36. package/dist/src/platforms/teams/cli.js +7 -1
  37. package/dist/src/platforms/teams/cli.js.map +1 -1
  38. package/dist/src/platforms/teams/commands/auth.d.ts +3 -0
  39. package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
  40. package/dist/src/platforms/teams/commands/auth.js +208 -107
  41. package/dist/src/platforms/teams/commands/auth.js.map +1 -1
  42. package/dist/src/platforms/teams/commands/channel.js +9 -9
  43. package/dist/src/platforms/teams/commands/channel.js.map +1 -1
  44. package/dist/src/platforms/teams/commands/file.js +21 -21
  45. package/dist/src/platforms/teams/commands/file.js.map +1 -1
  46. package/dist/src/platforms/teams/commands/message.js +12 -12
  47. package/dist/src/platforms/teams/commands/message.js.map +1 -1
  48. package/dist/src/platforms/teams/commands/reaction.js +6 -6
  49. package/dist/src/platforms/teams/commands/reaction.js.map +1 -1
  50. package/dist/src/platforms/teams/commands/snapshot.d.ts.map +1 -1
  51. package/dist/src/platforms/teams/commands/snapshot.js +6 -6
  52. package/dist/src/platforms/teams/commands/snapshot.js.map +1 -1
  53. package/dist/src/platforms/teams/commands/team.d.ts.map +1 -1
  54. package/dist/src/platforms/teams/commands/team.js +21 -25
  55. package/dist/src/platforms/teams/commands/team.js.map +1 -1
  56. package/dist/src/platforms/teams/commands/user.js +9 -9
  57. package/dist/src/platforms/teams/commands/user.js.map +1 -1
  58. package/dist/src/platforms/teams/credential-manager.d.ts +15 -2
  59. package/dist/src/platforms/teams/credential-manager.d.ts.map +1 -1
  60. package/dist/src/platforms/teams/credential-manager.js +110 -28
  61. package/dist/src/platforms/teams/credential-manager.js.map +1 -1
  62. package/dist/src/platforms/teams/ensure-auth.d.ts.map +1 -1
  63. package/dist/src/platforms/teams/ensure-auth.js +46 -16
  64. package/dist/src/platforms/teams/ensure-auth.js.map +1 -1
  65. package/dist/src/platforms/teams/token-extractor.d.ts +8 -2
  66. package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
  67. package/dist/src/platforms/teams/token-extractor.js +36 -24
  68. package/dist/src/platforms/teams/token-extractor.js.map +1 -1
  69. package/dist/src/platforms/teams/types.d.ts +121 -0
  70. package/dist/src/platforms/teams/types.d.ts.map +1 -1
  71. package/dist/src/platforms/teams/types.js +16 -0
  72. package/dist/src/platforms/teams/types.js.map +1 -1
  73. package/e2e/README.md +1 -1
  74. package/package.json +1 -1
  75. package/skills/agent-discord/SKILL.md +5 -0
  76. package/skills/agent-slack/SKILL.md +11 -17
  77. package/skills/agent-teams/SKILL.md +21 -24
  78. package/skills/agent-teams/references/common-patterns.md +63 -49
  79. package/src/platforms/discord/cli.ts +14 -0
  80. package/src/platforms/discord/commands/file.ts +13 -7
  81. package/src/platforms/discord/commands/friend.ts +34 -34
  82. package/src/platforms/discord/commands/index.ts +7 -0
  83. package/src/platforms/discord/commands/snapshot.ts +1 -2
  84. package/src/platforms/slack/commands/file.ts +12 -4
  85. package/src/platforms/slack/commands/sections.ts +8 -9
  86. package/src/platforms/slack/commands/snapshot.ts +1 -2
  87. package/src/platforms/slack/commands/user.ts +8 -8
  88. package/src/platforms/slackbot/commands/reaction.ts +2 -2
  89. package/src/platforms/teams/cli.ts +7 -0
  90. package/src/platforms/teams/commands/auth.test.ts +6 -5
  91. package/src/platforms/teams/commands/auth.ts +283 -120
  92. package/src/platforms/teams/commands/channel.test.ts +10 -4
  93. package/src/platforms/teams/commands/channel.ts +9 -9
  94. package/src/platforms/teams/commands/file.test.ts +9 -3
  95. package/src/platforms/teams/commands/file.ts +21 -21
  96. package/src/platforms/teams/commands/message.test.ts +9 -3
  97. package/src/platforms/teams/commands/message.ts +12 -12
  98. package/src/platforms/teams/commands/reaction.test.ts +9 -3
  99. package/src/platforms/teams/commands/reaction.ts +6 -6
  100. package/src/platforms/teams/commands/snapshot.ts +6 -6
  101. package/src/platforms/teams/commands/team.test.ts +19 -12
  102. package/src/platforms/teams/commands/team.ts +22 -28
  103. package/src/platforms/teams/commands/user.ts +9 -9
  104. package/src/platforms/teams/credential-manager.test.ts +30 -24
  105. package/src/platforms/teams/credential-manager.ts +106 -31
  106. package/src/platforms/teams/ensure-auth.test.ts +125 -26
  107. package/src/platforms/teams/ensure-auth.ts +47 -15
  108. package/src/platforms/teams/token-extractor.test.ts +116 -85
  109. package/src/platforms/teams/token-extractor.ts +65 -97
  110. package/src/platforms/teams/types.test.ts +31 -13
  111. package/src/platforms/teams/types.ts +45 -0
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/platforms/teams/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAA;QACV,WAAW,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG5B,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWlC,CAAA;AAEF,qBAAa,UAAW,SAAQ,KAAK;IACnC,IAAI,EAAE,MAAM,CAAA;gBAEA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAK1C"}
@@ -45,7 +45,23 @@ export const TeamsCredentialsSchema = z.object({
45
45
  token: z.string(),
46
46
  cookie: z.string().optional(),
47
47
  });
48
+ export const TeamsAccountTypeSchema = z.enum(['work', 'personal']);
49
+ export const TeamsAccountSchema = z.object({
50
+ token: z.string(),
51
+ token_expires_at: z.string().optional(),
52
+ account_type: TeamsAccountTypeSchema,
53
+ user_name: z.string().optional(),
54
+ current_team: z.string().nullable(),
55
+ teams: z.record(z.string(), z.object({
56
+ team_id: z.string(),
57
+ team_name: z.string(),
58
+ })),
59
+ });
48
60
  export const TeamsConfigSchema = z.object({
61
+ current_account: z.string().nullable(),
62
+ accounts: z.record(z.string(), TeamsAccountSchema),
63
+ });
64
+ export const TeamsConfigLegacySchema = z.object({
49
65
  current_team: z.string().nullable(),
50
66
  token: z.string(),
51
67
  token_expires_at: z.string().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/platforms/teams/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAgEvB,yBAAyB;AACzB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,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E,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,kBAAkB,CAAC;CACnD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,KAAK,EAAE,CAAC,CAAC,MAAM,CACb,CAAC,CAAC,MAAM,EAAE,EACV,CAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;KACtB,CAAC,CACH;CACF,CAAC,CAAA;AAEF,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC,IAAI,CAAQ;IAEZ,YAAY,OAAe,EAAE,IAAY;QACvC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,YAAY,CAAA;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF"}
package/e2e/README.md CHANGED
@@ -253,7 +253,7 @@ If tests crash before cleanup, you may have leftover messages in the `e2e-test`
253
253
  agent-slack message list e2e-test --limit 20 --pretty
254
254
 
255
255
  # Delete specific message
256
- agent-slack message delete e2e-test <timestamp> --force
256
+ agent-slack message delete e2e-test <ts> --force
257
257
  ```
258
258
 
259
259
  ### CI Environment Variables Not Working
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-messenger",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "Multi-platform messaging CLI for AI agents (Slack, Discord, Teams)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -65,6 +65,11 @@ agent-discord message delete <channel-id> <message-id> --force
65
65
 
66
66
  # Acknowledge/mark a message as read
67
67
  agent-discord message ack <channel-id> <message-id>
68
+
69
+ # Search messages in current server
70
+ agent-discord message search <query>
71
+ agent-discord message search "project update" --limit 10
72
+ agent-discord message search "hello" --channel <channel-id> --author <user-id>
68
73
  ```
69
74
 
70
75
  ### Channel Commands
@@ -146,16 +146,14 @@ agent-slack file info <file-id>
146
146
  ### Unread Commands
147
147
 
148
148
  ```bash
149
- # List unread channels
150
- agent-slack unread list
151
- agent-slack unread list --pretty
149
+ # Get unread counts for all channels
150
+ agent-slack unread counts
152
151
 
153
- # Get unread counts summary
154
- agent-slack unread count
152
+ # Get thread subscription details
153
+ agent-slack unread threads <channel> <thread_ts>
155
154
 
156
- # Mark channel as read
157
- agent-slack mark read <channel>
158
- agent-slack mark read general
155
+ # Mark channel as read up to timestamp
156
+ agent-slack unread mark <channel> <ts>
159
157
  ```
160
158
 
161
159
  ### Activity Commands
@@ -164,6 +162,8 @@ agent-slack mark read general
164
162
  # List activity feed (mentions, reactions, replies)
165
163
  agent-slack activity list
166
164
  agent-slack activity list --limit 50
165
+ agent-slack activity list --unread
166
+ agent-slack activity list --types thread_reply,message_reaction
167
167
  ```
168
168
 
169
169
  ### Saved Items Commands
@@ -171,13 +171,7 @@ agent-slack activity list --limit 50
171
171
  ```bash
172
172
  # List saved items
173
173
  agent-slack saved list
174
-
175
- # Add item to saved
176
- agent-slack saved add <channel> <ts>
177
- agent-slack saved add general 1234567890.123456
178
-
179
- # Remove item from saved
180
- agent-slack saved remove <channel> <ts>
174
+ agent-slack saved list --limit 10
181
175
  ```
182
176
 
183
177
  ### Drafts Commands
@@ -192,8 +186,8 @@ agent-slack drafts list --pretty
192
186
 
193
187
  ```bash
194
188
  # List channel sections (sidebar organization)
195
- agent-slack section list
196
- agent-slack section list --pretty
189
+ agent-slack sections list
190
+ agent-slack sections list --pretty
197
191
  ```
198
192
 
199
193
  ### Snapshot Command
@@ -15,10 +15,10 @@ A TypeScript CLI tool that enables AI agents and humans to interact with Microso
15
15
  agent-teams snapshot
16
16
 
17
17
  # Send a message
18
- agent-teams message send <channel-id> "Hello from AI agent!"
18
+ agent-teams message send <team-id> <channel-id> "Hello from AI agent!"
19
19
 
20
20
  # List channels
21
- agent-teams channel list
21
+ agent-teams channel list <team-id>
22
22
  ```
23
23
 
24
24
  ## Authentication
@@ -49,32 +49,32 @@ agent-teams auth status
49
49
 
50
50
  ```bash
51
51
  # Send a message
52
- agent-teams message send <channel-id> <content>
53
- agent-teams message send 19:abc123@thread.tacv2 "Hello world"
52
+ agent-teams message send <team-id> <channel-id> <content>
53
+ agent-teams message send <team-id> 19:abc123@thread.tacv2 "Hello world"
54
54
 
55
55
  # List messages
56
- agent-teams message list <channel-id>
57
- agent-teams message list 19:abc123@thread.tacv2 --limit 50
56
+ agent-teams message list <team-id> <channel-id>
57
+ agent-teams message list <team-id> 19:abc123@thread.tacv2 --limit 50
58
58
 
59
59
  # Get a single message by ID
60
- agent-teams message get <channel-id> <message-id>
60
+ agent-teams message get <team-id> <channel-id> <message-id>
61
61
 
62
62
  # Delete a message
63
- agent-teams message delete <channel-id> <message-id> --force
63
+ agent-teams message delete <team-id> <channel-id> <message-id> --force
64
64
  ```
65
65
 
66
66
  ### Channel Commands
67
67
 
68
68
  ```bash
69
- # List channels in current team
70
- agent-teams channel list
69
+ # List channels in a team
70
+ agent-teams channel list <team-id>
71
71
 
72
72
  # Get channel info
73
- agent-teams channel info <channel-id>
74
- agent-teams channel info 19:abc123@thread.tacv2
73
+ agent-teams channel info <team-id> <channel-id>
74
+ agent-teams channel info <team-id> 19:abc123@thread.tacv2
75
75
 
76
76
  # Get channel history (alias for message list)
77
- agent-teams channel history <channel-id> --limit 100
77
+ agent-teams channel history <team-id> <channel-id> --limit 100
78
78
  ```
79
79
 
80
80
  ### Team Commands
@@ -97,7 +97,7 @@ agent-teams team current
97
97
 
98
98
  ```bash
99
99
  # List team members
100
- agent-teams user list
100
+ agent-teams user list <team-id>
101
101
 
102
102
  # Get user info
103
103
  agent-teams user info <user-id>
@@ -110,28 +110,25 @@ agent-teams user me
110
110
 
111
111
  ```bash
112
112
  # Add reaction (use emoji name)
113
- agent-teams reaction add <channel-id> <message-id> <emoji>
114
- agent-teams reaction add 19:abc123@thread.tacv2 1234567890 like
113
+ agent-teams reaction add <team-id> <channel-id> <message-id> <emoji>
114
+ agent-teams reaction add <team-id> 19:abc123@thread.tacv2 1234567890 like
115
115
 
116
116
  # Remove reaction
117
- agent-teams reaction remove <channel-id> <message-id> <emoji>
118
-
119
- # List reactions on a message
120
- agent-teams reaction list <channel-id> <message-id>
117
+ agent-teams reaction remove <team-id> <channel-id> <message-id> <emoji>
121
118
  ```
122
119
 
123
120
  ### File Commands
124
121
 
125
122
  ```bash
126
123
  # Upload file
127
- agent-teams file upload <channel-id> <path>
128
- agent-teams file upload 19:abc123@thread.tacv2 ./report.pdf
124
+ agent-teams file upload <team-id> <channel-id> <path>
125
+ agent-teams file upload <team-id> 19:abc123@thread.tacv2 ./report.pdf
129
126
 
130
127
  # List files in channel
131
- agent-teams file list <channel-id>
128
+ agent-teams file list <team-id> <channel-id>
132
129
 
133
130
  # Get file info
134
- agent-teams file info <channel-id> <file-id>
131
+ agent-teams file info <team-id> <channel-id> <file-id>
135
132
  ```
136
133
 
137
134
  ### Snapshot Command
@@ -15,18 +15,20 @@ This guide covers typical workflows for AI agents interacting with Microsoft Tea
15
15
  ```bash
16
16
  #!/bin/bash
17
17
 
18
+ TEAM_ID="team-uuid-here"
19
+
18
20
  # First, ensure token is valid
19
21
  agent-teams auth extract 2>/dev/null || true
20
22
 
21
23
  # Get channel ID from channel list
22
- CHANNELS=$(agent-teams channel list)
24
+ CHANNELS=$(agent-teams channel list "$TEAM_ID")
23
25
  CHANNEL_ID=$(echo "$CHANNELS" | jq -r '.[] | select(.name=="General") | .id')
24
26
 
25
27
  # Send message using channel ID
26
- agent-teams message send "$CHANNEL_ID" "Deployment completed successfully!"
28
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Deployment completed successfully!"
27
29
 
28
30
  # With error handling
29
- RESULT=$(agent-teams message send "$CHANNEL_ID" "Hello world")
31
+ RESULT=$(agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Hello world")
30
32
  if echo "$RESULT" | jq -e '.id' > /dev/null 2>&1; then
31
33
  echo "Message sent!"
32
34
  else
@@ -36,7 +38,7 @@ else
36
38
  if echo "$ERROR" | grep -qi "expired\|401"; then
37
39
  echo "Token expired, refreshing..."
38
40
  agent-teams auth extract
39
- agent-teams message send "$CHANNEL_ID" "Hello world"
41
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Hello world"
40
42
  else
41
43
  echo "Failed: $ERROR"
42
44
  exit 1
@@ -53,6 +55,7 @@ fi
53
55
  ```bash
54
56
  #!/bin/bash
55
57
 
58
+ TEAM_ID="team-uuid-here"
56
59
  CHANNEL_ID="19:abc123@thread.tacv2"
57
60
  LAST_ID=""
58
61
  TOKEN_CHECK_INTERVAL=300 # Check token every 5 minutes
@@ -81,7 +84,7 @@ while true; do
81
84
  refresh_token_if_needed
82
85
 
83
86
  # Get latest message
84
- MESSAGES=$(agent-teams message list "$CHANNEL_ID" --limit 1)
87
+ MESSAGES=$(agent-teams message list "$TEAM_ID" "$CHANNEL_ID" --limit 1)
85
88
 
86
89
  # Handle token expiry error
87
90
  if echo "$MESSAGES" | jq -e '.error' | grep -qi "expired\|401" 2>/dev/null; then
@@ -101,7 +104,7 @@ while true; do
101
104
 
102
105
  # Process message here
103
106
  if echo "$CONTENT" | grep -q "bot"; then
104
- agent-teams message send "$CHANNEL_ID" "You called?"
107
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "You called?"
105
108
  fi
106
109
  fi
107
110
 
@@ -154,10 +157,12 @@ echo "$SNAPSHOT" | jq -r '.recent_messages[] | " [\(.channel_name)] \(.author):
154
157
  ```bash
155
158
  #!/bin/bash
156
159
 
160
+ TEAM_ID="team-uuid-here"
161
+
157
162
  get_channel_id() {
158
163
  local channel_name=$1
159
164
 
160
- CHANNELS=$(agent-teams channel list)
165
+ CHANNELS=$(agent-teams channel list "$TEAM_ID")
161
166
  CHANNEL_ID=$(echo "$CHANNELS" | jq -r --arg name "$channel_name" '.[] | select(.name==$name) | .id')
162
167
 
163
168
  if [ -z "$CHANNEL_ID" ]; then
@@ -171,7 +176,7 @@ get_channel_id() {
171
176
  # Usage
172
177
  GENERAL_ID=$(get_channel_id "General")
173
178
  if [ $? -eq 0 ]; then
174
- agent-teams message send "$GENERAL_ID" "Hello!"
179
+ agent-teams message send "$TEAM_ID" "$GENERAL_ID" "Hello!"
175
180
  fi
176
181
  ```
177
182
 
@@ -184,6 +189,7 @@ fi
184
189
  ```bash
185
190
  #!/bin/bash
186
191
 
192
+ TEAM_ID="team-uuid-here"
187
193
  MESSAGE="System maintenance in 30 minutes"
188
194
  CHANNEL_NAMES=("General" "Announcements" "Engineering")
189
195
 
@@ -191,7 +197,7 @@ CHANNEL_NAMES=("General" "Announcements" "Engineering")
191
197
  agent-teams auth extract
192
198
 
193
199
  # Get all channels once
194
- CHANNELS=$(agent-teams channel list)
200
+ CHANNELS=$(agent-teams channel list "$TEAM_ID")
195
201
 
196
202
  for name in "${CHANNEL_NAMES[@]}"; do
197
203
  CHANNEL_ID=$(echo "$CHANNELS" | jq -r --arg n "$name" '.[] | select(.name==$n) | .id')
@@ -202,7 +208,7 @@ for name in "${CHANNEL_NAMES[@]}"; do
202
208
  fi
203
209
 
204
210
  echo "Posting to #$name..."
205
- RESULT=$(agent-teams message send "$CHANNEL_ID" "$MESSAGE")
211
+ RESULT=$(agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "$MESSAGE")
206
212
 
207
213
  if echo "$RESULT" | jq -e '.id' > /dev/null 2>&1; then
208
214
  echo " Posted to #$name"
@@ -224,18 +230,19 @@ done
224
230
  ```bash
225
231
  #!/bin/bash
226
232
 
233
+ TEAM_ID="team-uuid-here"
227
234
  CHANNEL_ID="19:abc123@thread.tacv2"
228
235
  REPORT_FILE="./daily-report.pdf"
229
236
 
230
237
  # Upload file
231
- UPLOAD_RESULT=$(agent-teams file upload "$CHANNEL_ID" "$REPORT_FILE")
238
+ UPLOAD_RESULT=$(agent-teams file upload "$TEAM_ID" "$CHANNEL_ID" "$REPORT_FILE")
232
239
 
233
240
  if echo "$UPLOAD_RESULT" | jq -e '.id' > /dev/null 2>&1; then
234
241
  FILE_ID=$(echo "$UPLOAD_RESULT" | jq -r '.id')
235
242
  echo "File uploaded: $FILE_ID"
236
243
 
237
244
  # Send context message
238
- agent-teams message send "$CHANNEL_ID" "Daily report is ready! Key highlights:
245
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Daily report is ready! Key highlights:
239
246
  - 95% test coverage
240
247
  - 3 bugs fixed
241
248
  - 2 new features deployed"
@@ -254,11 +261,12 @@ fi
254
261
  ```bash
255
262
  #!/bin/bash
256
263
 
264
+ TEAM_ID="team-uuid-here"
257
265
  CHANNEL_ID="19:abc123@thread.tacv2"
258
266
  USERNAME="john"
259
267
 
260
268
  # Get team members
261
- USERS=$(agent-teams user list)
269
+ USERS=$(agent-teams user list "$TEAM_ID")
262
270
  USER=$(echo "$USERS" | jq -r --arg name "$USERNAME" 'first(.[] | select(.displayName | ascii_downcase | contains($name | ascii_downcase)))')
263
271
  USER_ID=$(echo "$USER" | jq -r '.id')
264
272
  USER_NAME=$(echo "$USER" | jq -r '.displayName')
@@ -269,7 +277,7 @@ if [ -z "$USER_ID" ] || [ "$USER_ID" = "null" ]; then
269
277
  fi
270
278
 
271
279
  # Send message with mention (Teams format)
272
- agent-teams message send "$CHANNEL_ID" "Hey <at id=\"$USER_ID\">$USER_NAME</at>, the build is ready for review!"
280
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Hey <at id=\"$USER_ID\">$USER_NAME</at>, the build is ready for review!"
273
281
  ```
274
282
 
275
283
  **When to use**: Notifications, task assignments, code review requests.
@@ -283,24 +291,25 @@ agent-teams message send "$CHANNEL_ID" "Hey <at id=\"$USER_ID\">$USER_NAME</at>,
283
291
  ```bash
284
292
  #!/bin/bash
285
293
 
294
+ TEAM_ID="team-uuid-here"
286
295
  CHANNEL_ID="19:abc123@thread.tacv2"
287
296
 
288
297
  # Send deployment message
289
- RESULT=$(agent-teams message send "$CHANNEL_ID" "Deploying v2.1.0 to production...")
298
+ RESULT=$(agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Deploying v2.1.0 to production...")
290
299
  MSG_ID=$(echo "$RESULT" | jq -r '.id')
291
300
 
292
301
  # Mark as in-progress
293
- agent-teams reaction add "$CHANNEL_ID" "$MSG_ID" "hourglass"
302
+ agent-teams reaction add "$TEAM_ID" "$CHANNEL_ID" "$MSG_ID" "hourglass"
294
303
 
295
304
  # Simulate deployment
296
305
  sleep 5
297
306
 
298
307
  # Remove in-progress, add success
299
- agent-teams reaction remove "$CHANNEL_ID" "$MSG_ID" "hourglass"
300
- agent-teams reaction add "$CHANNEL_ID" "$MSG_ID" "checkmark"
308
+ agent-teams reaction remove "$TEAM_ID" "$CHANNEL_ID" "$MSG_ID" "hourglass"
309
+ agent-teams reaction add "$TEAM_ID" "$CHANNEL_ID" "$MSG_ID" "checkmark"
301
310
 
302
311
  # Send completion message
303
- agent-teams message send "$CHANNEL_ID" "Deployed v2.1.0 to production successfully!"
312
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Deployed v2.1.0 to production successfully!"
304
313
  ```
305
314
 
306
315
  **When to use**: Visual status tracking, workflow states, quick acknowledgments.
@@ -312,16 +321,19 @@ agent-teams message send "$CHANNEL_ID" "Deployed v2.1.0 to production successful
312
321
  ```bash
313
322
  #!/bin/bash
314
323
 
324
+ TEAM_ID="team-uuid-here"
325
+
315
326
  send_with_retry() {
316
- local channel_id=$1
317
- local message=$2
327
+ local team_id=$1
328
+ local channel_id=$2
329
+ local message=$3
318
330
  local max_attempts=3
319
331
  local attempt=1
320
332
 
321
333
  while [ $attempt -le $max_attempts ]; do
322
334
  echo "Attempt $attempt/$max_attempts..."
323
335
 
324
- RESULT=$(agent-teams message send "$channel_id" "$message")
336
+ RESULT=$(agent-teams message send "$team_id" "$channel_id" "$message")
325
337
 
326
338
  if echo "$RESULT" | jq -e '.id' > /dev/null 2>&1; then
327
339
  echo "Message sent successfully!"
@@ -358,7 +370,7 @@ send_with_retry() {
358
370
 
359
371
  # Usage
360
372
  CHANNEL_ID="19:abc123@thread.tacv2"
361
- send_with_retry "$CHANNEL_ID" "Important message!"
373
+ send_with_retry "$TEAM_ID" "$CHANNEL_ID" "Important message!"
362
374
  ```
363
375
 
364
376
  **When to use**: Production scripts, critical notifications, unreliable networks.
@@ -383,7 +395,7 @@ if [ -n "$TARGET_TEAM" ]; then
383
395
  fi
384
396
 
385
397
  # Now operations use the new team
386
- agent-teams channel list
398
+ agent-teams channel list "$TARGET_TEAM"
387
399
  ```
388
400
 
389
401
  **When to use**: Managing multiple teams, cross-team operations.
@@ -395,6 +407,8 @@ agent-teams channel list
395
407
  ```bash
396
408
  #!/bin/bash
397
409
 
410
+ TEAM_ID="team-uuid-here"
411
+
398
412
  # Wrapper function that handles token refresh
399
413
  teams_cmd() {
400
414
  local result
@@ -415,8 +429,8 @@ teams_cmd() {
415
429
  }
416
430
 
417
431
  # Usage - wrap any agent-teams command
418
- CHANNELS=$(teams_cmd agent-teams channel list)
419
- RESULT=$(teams_cmd agent-teams message send "$CHANNEL_ID" "Hello!")
432
+ CHANNELS=$(teams_cmd agent-teams channel list "$TEAM_ID")
433
+ RESULT=$(teams_cmd agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Hello!")
420
434
  SNAPSHOT=$(teams_cmd agent-teams snapshot)
421
435
  ```
422
436
 
@@ -428,14 +442,14 @@ SNAPSHOT=$(teams_cmd agent-teams snapshot)
428
442
 
429
443
  ```bash
430
444
  # Good - handle token expiry
431
- RESULT=$(agent-teams message send "$CHANNEL_ID" "Hello")
445
+ RESULT=$(agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Hello")
432
446
  if echo "$RESULT" | grep -qi "expired\|401"; then
433
447
  agent-teams auth extract
434
- RESULT=$(agent-teams message send "$CHANNEL_ID" "Hello")
448
+ RESULT=$(agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Hello")
435
449
  fi
436
450
 
437
451
  # Bad - assume token is always valid
438
- agent-teams message send "$CHANNEL_ID" "Hello"
452
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Hello"
439
453
  ```
440
454
 
441
455
  ### 2. Refresh Token Proactively for Long-Running Scripts
@@ -454,7 +468,7 @@ done
454
468
 
455
469
  # Bad - wait for failure
456
470
  while true; do
457
- agent-teams message send "$CHANNEL_ID" "Status update" # Will fail after 60-90 min
471
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Status update" # Will fail after 60-90 min
458
472
  sleep 60
459
473
  done
460
474
  ```
@@ -463,19 +477,19 @@ done
463
477
 
464
478
  ```bash
465
479
  # Good - look up channel ID
466
- CHANNELS=$(agent-teams channel list)
480
+ CHANNELS=$(agent-teams channel list "$TEAM_ID")
467
481
  CHANNEL_ID=$(echo "$CHANNELS" | jq -r '.[] | select(.name=="General") | .id')
468
- agent-teams message send "$CHANNEL_ID" "Hello"
482
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Hello"
469
483
 
470
484
  # Bad - hardcoded IDs without documentation
471
- agent-teams message send "19:abc123@thread.tacv2" "Hello"
485
+ agent-teams message send "$TEAM_ID" "19:abc123@thread.tacv2" "Hello"
472
486
  ```
473
487
 
474
488
  ### 4. Check for Success
475
489
 
476
490
  ```bash
477
491
  # Good
478
- RESULT=$(agent-teams message send "$CHANNEL_ID" "Hello")
492
+ RESULT=$(agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Hello")
479
493
  if echo "$RESULT" | jq -e '.id' > /dev/null 2>&1; then
480
494
  echo "Success!"
481
495
  else
@@ -483,7 +497,7 @@ else
483
497
  fi
484
498
 
485
499
  # Bad
486
- agent-teams message send "$CHANNEL_ID" "Hello" # No error checking
500
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Hello" # No error checking
487
501
  ```
488
502
 
489
503
  ### 5. Rate Limit Your Requests
@@ -491,13 +505,13 @@ agent-teams message send "$CHANNEL_ID" "Hello" # No error checking
491
505
  ```bash
492
506
  # Good - respect Teams API limits
493
507
  for channel_id in "${CHANNEL_IDS[@]}"; do
494
- agent-teams message send "$channel_id" "$MESSAGE"
508
+ agent-teams message send "$TEAM_ID" "$channel_id" "$MESSAGE"
495
509
  sleep 1 # 1 second between requests
496
510
  done
497
511
 
498
512
  # Bad - rapid-fire requests
499
513
  for channel_id in "${CHANNEL_IDS[@]}"; do
500
- agent-teams message send "$channel_id" "$MESSAGE"
514
+ agent-teams message send "$TEAM_ID" "$channel_id" "$MESSAGE"
501
515
  done
502
516
  ```
503
517
 
@@ -505,17 +519,17 @@ done
505
519
 
506
520
  ```bash
507
521
  # Good - fetch once, reuse
508
- CHANNELS=$(agent-teams channel list)
522
+ CHANNELS=$(agent-teams channel list "$TEAM_ID")
509
523
  for name in "${CHANNEL_NAMES[@]}"; do
510
524
  id=$(echo "$CHANNELS" | jq -r --arg n "$name" '.[] | select(.name==$n) | .id')
511
- agent-teams message send "$id" "$MESSAGE"
525
+ agent-teams message send "$TEAM_ID" "$id" "$MESSAGE"
512
526
  done
513
527
 
514
528
  # Bad - fetch repeatedly
515
529
  for name in "${CHANNEL_NAMES[@]}"; do
516
- CHANNELS=$(agent-teams channel list) # Wasteful!
530
+ CHANNELS=$(agent-teams channel list "$TEAM_ID") # Wasteful!
517
531
  id=$(echo "$CHANNELS" | jq -r --arg n "$name" '.[] | select(.name==$n) | .id')
518
- agent-teams message send "$id" "$MESSAGE"
532
+ agent-teams message send "$TEAM_ID" "$id" "$MESSAGE"
519
533
  done
520
534
  ```
521
535
 
@@ -526,7 +540,7 @@ done
526
540
  ```bash
527
541
  # Bad - ignores the 60-90 minute token limit
528
542
  while true; do
529
- agent-teams message list "$CHANNEL_ID" --limit 1
543
+ agent-teams message list "$TEAM_ID" "$CHANNEL_ID" --limit 1
530
544
  sleep 10
531
545
  done
532
546
  # Will fail silently after ~1 hour
@@ -538,7 +552,7 @@ while true; do
538
552
  agent-teams auth extract
539
553
  fi
540
554
 
541
- agent-teams message list "$CHANNEL_ID" --limit 1
555
+ agent-teams message list "$TEAM_ID" "$CHANNEL_ID" --limit 1
542
556
  sleep 10
543
557
  done
544
558
  ```
@@ -548,13 +562,13 @@ done
548
562
  ```bash
549
563
  # Bad - polls every second (may get rate limited)
550
564
  while true; do
551
- agent-teams message list "$CHANNEL_ID" --limit 1
565
+ agent-teams message list "$TEAM_ID" "$CHANNEL_ID" --limit 1
552
566
  sleep 1
553
567
  done
554
568
 
555
569
  # Good - reasonable interval
556
570
  while true; do
557
- agent-teams message list "$CHANNEL_ID" --limit 1
571
+ agent-teams message list "$TEAM_ID" "$CHANNEL_ID" --limit 1
558
572
  sleep 10 # 10 seconds
559
573
  done
560
574
  ```
@@ -563,11 +577,11 @@ done
563
577
 
564
578
  ```bash
565
579
  # Bad
566
- agent-teams message send "$CHANNEL_ID" "Hello"
580
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Hello"
567
581
  # Continues even if it failed
568
582
 
569
583
  # Good
570
- RESULT=$(agent-teams message send "$CHANNEL_ID" "Hello")
584
+ RESULT=$(agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Hello")
571
585
  if ! echo "$RESULT" | jq -e '.id' > /dev/null 2>&1; then
572
586
  echo "Failed to send message"
573
587
  exit 1
@@ -579,7 +593,7 @@ fi
579
593
  ```bash
580
594
  # Bad - sends 100 messages
581
595
  for i in {1..100}; do
582
- agent-teams message send "$CHANNEL_ID" "Message $i"
596
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "Message $i"
583
597
  done
584
598
 
585
599
  # Good - batch into single message
@@ -587,7 +601,7 @@ MESSAGE="Updates:"
587
601
  for i in {1..100}; do
588
602
  MESSAGE="$MESSAGE\n$i. Item $i"
589
603
  done
590
- agent-teams message send "$CHANNEL_ID" "$MESSAGE"
604
+ agent-teams message send "$TEAM_ID" "$CHANNEL_ID" "$MESSAGE"
591
605
  ```
592
606
 
593
607
  ## See Also
@@ -6,11 +6,18 @@ import pkg from '../../../package.json' with { type: 'json' }
6
6
  import {
7
7
  authCommand,
8
8
  channelCommand,
9
+ dmCommand,
9
10
  fileCommand,
11
+ friendCommand,
12
+ memberCommand,
13
+ mentionCommand,
10
14
  messageCommand,
15
+ noteCommand,
16
+ profileCommand,
11
17
  reactionCommand,
12
18
  serverCommand,
13
19
  snapshotCommand,
20
+ threadCommand,
14
21
  userCommand,
15
22
  } from './commands'
16
23
  import { ensureDiscordAuth } from './ensure-auth'
@@ -41,10 +48,17 @@ program.hook('preAction', async (_thisCommand, actionCommand) => {
41
48
  program.addCommand(authCommand)
42
49
  program.addCommand(serverCommand)
43
50
  program.addCommand(channelCommand)
51
+ program.addCommand(dmCommand)
44
52
  program.addCommand(fileCommand)
53
+ program.addCommand(friendCommand)
54
+ program.addCommand(memberCommand)
55
+ program.addCommand(mentionCommand)
45
56
  program.addCommand(messageCommand)
57
+ program.addCommand(noteCommand)
58
+ program.addCommand(profileCommand)
46
59
  program.addCommand(reactionCommand)
47
60
  program.addCommand(snapshotCommand)
61
+ program.addCommand(threadCommand)
48
62
  program.addCommand(userCommand)
49
63
 
50
64
  program.parse(process.argv)