agent-messenger 2.28.0 → 2.29.1
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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +29 -1
- package/dist/package.json +1 -1
- package/dist/src/platforms/discord/client.d.ts +6 -2
- package/dist/src/platforms/discord/client.d.ts.map +1 -1
- package/dist/src/platforms/discord/client.js +10 -3
- package/dist/src/platforms/discord/client.js.map +1 -1
- package/dist/src/platforms/instagram/client.d.ts +24 -2
- package/dist/src/platforms/instagram/client.d.ts.map +1 -1
- package/dist/src/platforms/instagram/client.js +343 -53
- package/dist/src/platforms/instagram/client.js.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.d.ts +1 -0
- package/dist/src/platforms/instagram/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.js +123 -11
- package/dist/src/platforms/instagram/commands/auth.js.map +1 -1
- package/dist/src/platforms/instagram/credential-manager.d.ts +4 -1
- package/dist/src/platforms/instagram/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/instagram/credential-manager.js +17 -1
- package/dist/src/platforms/instagram/credential-manager.js.map +1 -1
- package/dist/src/platforms/instagram/types.d.ts +10 -8
- package/dist/src/platforms/instagram/types.d.ts.map +1 -1
- package/dist/src/platforms/instagram/types.js.map +1 -1
- package/dist/src/platforms/teams/app-config.d.ts +36 -0
- package/dist/src/platforms/teams/app-config.d.ts.map +1 -0
- package/dist/src/platforms/teams/app-config.js +69 -0
- package/dist/src/platforms/teams/app-config.js.map +1 -0
- package/dist/src/platforms/teams/client.d.ts +20 -2
- package/dist/src/platforms/teams/client.d.ts.map +1 -1
- package/dist/src/platforms/teams/client.js +311 -7
- package/dist/src/platforms/teams/client.js.map +1 -1
- package/dist/src/platforms/teams/commands/auth.d.ts +10 -0
- package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/auth.js +137 -3
- package/dist/src/platforms/teams/commands/auth.js.map +1 -1
- package/dist/src/platforms/teams/commands/file.d.ts +3 -0
- package/dist/src/platforms/teams/commands/file.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/file.js +59 -2
- package/dist/src/platforms/teams/commands/file.js.map +1 -1
- package/dist/src/platforms/teams/commands/message.d.ts +11 -0
- package/dist/src/platforms/teams/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/message.js +121 -2
- package/dist/src/platforms/teams/commands/message.js.map +1 -1
- package/dist/src/platforms/teams/credential-manager.d.ts +23 -1
- package/dist/src/platforms/teams/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/teams/credential-manager.js +46 -2
- package/dist/src/platforms/teams/credential-manager.js.map +1 -1
- package/dist/src/platforms/teams/device-code.d.ts +48 -0
- package/dist/src/platforms/teams/device-code.d.ts.map +1 -0
- package/dist/src/platforms/teams/device-code.js +199 -0
- package/dist/src/platforms/teams/device-code.js.map +1 -0
- package/dist/src/platforms/teams/device-login.d.ts +37 -0
- package/dist/src/platforms/teams/device-login.d.ts.map +1 -0
- package/dist/src/platforms/teams/device-login.js +129 -0
- package/dist/src/platforms/teams/device-login.js.map +1 -0
- package/dist/src/platforms/teams/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/teams/ensure-auth.js +12 -0
- package/dist/src/platforms/teams/ensure-auth.js.map +1 -1
- package/dist/src/platforms/teams/index.d.ts +7 -3
- package/dist/src/platforms/teams/index.d.ts.map +1 -1
- package/dist/src/platforms/teams/index.js +5 -2
- package/dist/src/platforms/teams/index.js.map +1 -1
- package/dist/src/platforms/teams/listener.d.ts +40 -0
- package/dist/src/platforms/teams/listener.d.ts.map +1 -0
- package/dist/src/platforms/teams/listener.js +286 -0
- package/dist/src/platforms/teams/listener.js.map +1 -0
- package/dist/src/platforms/teams/realm-discovery.d.ts +3 -0
- package/dist/src/platforms/teams/realm-discovery.d.ts.map +1 -0
- package/dist/src/platforms/teams/realm-discovery.js +33 -0
- package/dist/src/platforms/teams/realm-discovery.js.map +1 -0
- package/dist/src/platforms/teams/token-extractor.d.ts +3 -0
- package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/teams/token-extractor.js +60 -0
- package/dist/src/platforms/teams/token-extractor.js.map +1 -1
- package/dist/src/platforms/teams/token-provider.d.ts +25 -0
- package/dist/src/platforms/teams/token-provider.d.ts.map +1 -0
- package/dist/src/platforms/teams/token-provider.js +190 -0
- package/dist/src/platforms/teams/token-provider.js.map +1 -0
- package/dist/src/platforms/teams/trouter.d.ts +38 -0
- package/dist/src/platforms/teams/trouter.d.ts.map +1 -0
- package/dist/src/platforms/teams/trouter.js +266 -0
- package/dist/src/platforms/teams/trouter.js.map +1 -0
- package/dist/src/platforms/teams/types.d.ts +103 -0
- package/dist/src/platforms/teams/types.d.ts.map +1 -1
- package/dist/src/platforms/teams/types.js +30 -0
- package/dist/src/platforms/teams/types.js.map +1 -1
- package/dist/src/platforms/webex/types.d.ts +1 -1
- package/dist/src/tui/adapters/instagram-adapter.d.ts.map +1 -1
- package/dist/src/tui/adapters/instagram-adapter.js +16 -0
- package/dist/src/tui/adapters/instagram-adapter.js.map +1 -1
- package/dist/src/tui/adapters/teams-adapter.d.ts +3 -0
- package/dist/src/tui/adapters/teams-adapter.d.ts.map +1 -1
- package/dist/src/tui/adapters/teams-adapter.js +21 -0
- package/dist/src/tui/adapters/teams-adapter.js.map +1 -1
- package/dist/src/tui/app.js +3 -3
- package/docs/content/docs/cli/instagram.mdx +1 -0
- package/docs/content/docs/cli/teams.mdx +36 -0
- package/docs/content/docs/sdk/teams.mdx +30 -0
- package/package.json +1 -1
- package/skills/agent-channeltalk/SKILL.md +1 -1
- package/skills/agent-channeltalkbot/SKILL.md +1 -1
- package/skills/agent-discord/SKILL.md +1 -1
- package/skills/agent-discordbot/SKILL.md +1 -1
- package/skills/agent-imessage/SKILL.md +1 -1
- package/skills/agent-instagram/SKILL.md +1 -1
- package/skills/agent-instagram/references/authentication.md +11 -0
- package/skills/agent-kakaotalk/SKILL.md +1 -1
- package/skills/agent-line/SKILL.md +1 -1
- package/skills/agent-slack/SKILL.md +1 -1
- package/skills/agent-slackbot/SKILL.md +1 -1
- package/skills/agent-teams/SKILL.md +82 -6
- package/skills/agent-teams/references/authentication.md +31 -1
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-telegrambot/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +1 -1
- package/skills/agent-webexbot/SKILL.md +1 -1
- package/skills/agent-wechatbot/SKILL.md +1 -1
- package/skills/agent-whatsapp/SKILL.md +1 -1
- package/skills/agent-whatsappbot/SKILL.md +1 -1
- package/src/platforms/discord/client.test.ts +86 -0
- package/src/platforms/discord/client.ts +10 -3
- package/src/platforms/instagram/client.test.ts +478 -33
- package/src/platforms/instagram/client.ts +449 -68
- package/src/platforms/instagram/commands/auth.test.ts +177 -1
- package/src/platforms/instagram/commands/auth.ts +182 -11
- package/src/platforms/instagram/credential-manager.test.ts +30 -0
- package/src/platforms/instagram/credential-manager.ts +23 -1
- package/src/platforms/instagram/types.ts +11 -8
- package/src/platforms/teams/app-config.ts +92 -0
- package/src/platforms/teams/client.test.ts +335 -1
- package/src/platforms/teams/client.ts +370 -7
- package/src/platforms/teams/commands/auth.test.ts +93 -1
- package/src/platforms/teams/commands/auth.ts +182 -3
- package/src/platforms/teams/commands/file.test.ts +92 -1
- package/src/platforms/teams/commands/file.ts +76 -1
- package/src/platforms/teams/commands/message.test.ts +95 -1
- package/src/platforms/teams/commands/message.ts +145 -3
- package/src/platforms/teams/credential-manager.test.ts +20 -0
- package/src/platforms/teams/credential-manager.ts +68 -3
- package/src/platforms/teams/device-code.test.ts +311 -0
- package/src/platforms/teams/device-code.ts +277 -0
- package/src/platforms/teams/device-login.test.ts +288 -0
- package/src/platforms/teams/device-login.ts +206 -0
- package/src/platforms/teams/ensure-auth.ts +11 -0
- package/src/platforms/teams/index.test.ts +10 -0
- package/src/platforms/teams/index.ts +17 -1
- package/src/platforms/teams/listener.test.ts +243 -0
- package/src/platforms/teams/listener.ts +351 -0
- package/src/platforms/teams/realm-discovery.test.ts +73 -0
- package/src/platforms/teams/realm-discovery.ts +42 -0
- package/src/platforms/teams/token-extractor.ts +69 -0
- package/src/platforms/teams/token-provider.test.ts +227 -0
- package/src/platforms/teams/token-provider.ts +284 -0
- package/src/platforms/teams/trouter.test.ts +174 -0
- package/src/platforms/teams/trouter.ts +323 -0
- package/src/platforms/teams/types.test.ts +17 -0
- package/src/platforms/teams/types.ts +96 -0
- package/src/tui/adapters/instagram-adapter.ts +13 -0
- package/src/tui/adapters/teams-adapter.ts +23 -0
- package/src/tui/app.ts +3 -3
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { TeamsClient } from '../../platforms/teams/client.js';
|
|
2
|
+
import { TeamsListener } from '../../platforms/teams/listener.js';
|
|
2
3
|
export class TeamsAdapter {
|
|
3
4
|
name = 'Teams';
|
|
4
5
|
client = null;
|
|
6
|
+
listener = null;
|
|
5
7
|
teamId = null;
|
|
6
8
|
teamName = null;
|
|
7
9
|
teams = [];
|
|
@@ -41,6 +43,25 @@ export class TeamsAdapter {
|
|
|
41
43
|
this.ensureClient();
|
|
42
44
|
await this.client.sendMessage(this.teamId, channelId, text);
|
|
43
45
|
}
|
|
46
|
+
async startListening(onMessage) {
|
|
47
|
+
this.ensureClient();
|
|
48
|
+
const listener = new TeamsListener(this.client);
|
|
49
|
+
listener.on('message', (message) => {
|
|
50
|
+
onMessage({
|
|
51
|
+
id: message.id,
|
|
52
|
+
channelId: message.chatId,
|
|
53
|
+
author: message.author.displayName,
|
|
54
|
+
content: message.content,
|
|
55
|
+
timestamp: message.timestamp,
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
await listener.start();
|
|
59
|
+
this.listener = listener;
|
|
60
|
+
}
|
|
61
|
+
stopListening() {
|
|
62
|
+
this.listener?.stop();
|
|
63
|
+
this.listener = null;
|
|
64
|
+
}
|
|
44
65
|
async getWorkspaces() {
|
|
45
66
|
return this.teams;
|
|
46
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teams-adapter.js","sourceRoot":"","sources":["../../../../src/tui/adapters/teams-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"teams-adapter.js","sourceRoot":"","sources":["../../../../src/tui/adapters/teams-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAI1D,MAAM,OAAO,YAAY;IACd,IAAI,GAAG,OAAO,CAAA;IAEf,MAAM,GAAuB,IAAI,CAAA;IACjC,QAAQ,GAAyB,IAAI,CAAA;IACrC,MAAM,GAAkB,IAAI,CAAA;IAC5B,QAAQ,GAAkB,IAAI,CAAA;IAC9B,KAAK,GAAgB,EAAE,CAAA;IAE/B,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;QAC/B,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;QACzB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAA;QAC3C,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAA;QACpD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;QAC3D,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QACzB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC/B,CAA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;IACjD,CAAC;IAED,WAAW;QACT,OAAO;YACL,OAAO,EAAE,0BAA0B;YACnC,WAAW,EAAE,+FAA+F;SAC7G,CAAA;IACH,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,EAAU;QAC3B,EAAE,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAA;QACtE,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;IACpE,CAAC;IAEO,SAAS,CAAC,IAAY;QAC5B,OAAO,IAAI;aACR,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;aACvB,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;aACtB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;aACrB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;aACrB,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;aACvB,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;aACtB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;aACpB,IAAI,EAAE,CAAA;IACX,CAAC;CACF"}
|
package/dist/src/tui/app.js
CHANGED
|
@@ -190,7 +190,7 @@ export async function createApp() {
|
|
|
190
190
|
left: 0,
|
|
191
191
|
top: 1,
|
|
192
192
|
width: 28,
|
|
193
|
-
height: '100%-
|
|
193
|
+
height: '100%-5',
|
|
194
194
|
border: { type: 'line' },
|
|
195
195
|
style: {
|
|
196
196
|
border: { fg: '#444444' },
|
|
@@ -207,7 +207,7 @@ export async function createApp() {
|
|
|
207
207
|
left: 28,
|
|
208
208
|
top: 1,
|
|
209
209
|
right: 0,
|
|
210
|
-
height: '100%-
|
|
210
|
+
height: '100%-5',
|
|
211
211
|
border: { type: 'line' },
|
|
212
212
|
style: {
|
|
213
213
|
border: { fg: '#444444' },
|
|
@@ -222,7 +222,7 @@ export async function createApp() {
|
|
|
222
222
|
});
|
|
223
223
|
const inputBox = blessed.textarea({
|
|
224
224
|
parent: screen,
|
|
225
|
-
bottom:
|
|
225
|
+
bottom: 1,
|
|
226
226
|
left: 0,
|
|
227
227
|
right: 0,
|
|
228
228
|
height: 3,
|
|
@@ -179,6 +179,7 @@ Thread IDs are numeric strings returned by `chat list` (e.g. `340282366841710300
|
|
|
179
179
|
|
|
180
180
|
- Credentials stored in `~/.config/agent-messenger/instagram-credentials.json`
|
|
181
181
|
- Session data stored in `~/.config/agent-messenger/instagram/<account-id>/`
|
|
182
|
+
- A machine-level device profile (synthetic Android device identifiers, no secrets) stored in `~/.config/agent-messenger/instagram/device.json` and shared across all accounts, so repeat logins present a consistent device fingerprint
|
|
182
183
|
|
|
183
184
|
## Limitations
|
|
184
185
|
|
|
@@ -253,6 +253,42 @@ All commands support these options:
|
|
|
253
253
|
--team <id> # Use specific team (overrides current team)
|
|
254
254
|
```
|
|
255
255
|
|
|
256
|
+
## Real-time Events (SDK)
|
|
257
|
+
|
|
258
|
+
Real-time message streaming is available through the SDK's `TeamsListener`, which
|
|
259
|
+
connects to Teams' internal trouter WebSocket as a user — no bot registration and
|
|
260
|
+
no public HTTP endpoint. There is no CLI `watch` command; use the SDK:
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
import { TeamsClient, TeamsListener } from 'agent-messenger/teams'
|
|
264
|
+
|
|
265
|
+
const client = await new TeamsClient().login()
|
|
266
|
+
const listener = new TeamsListener(client)
|
|
267
|
+
|
|
268
|
+
listener.on('message', async (message) => {
|
|
269
|
+
console.log(`New message in ${message.chatId}: ${message.content}`)
|
|
270
|
+
|
|
271
|
+
// Channel messages carry team/channel context and parsed @mentions.
|
|
272
|
+
if (message.conversationType === 'channel') {
|
|
273
|
+
for (const mention of message.mentions) {
|
|
274
|
+
console.log(`Mentioned: ${mention.displayName} (${mention.mri})`)
|
|
275
|
+
}
|
|
276
|
+
await client.sendMessage(message.teamId!, message.channelId!, 'On it 👍')
|
|
277
|
+
}
|
|
278
|
+
})
|
|
279
|
+
|
|
280
|
+
await listener.start()
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Each `message` is a `TeamsRealtimeMessage`. Alongside the unchanged
|
|
284
|
+
`chatId`/`content`/`author`, it carries `conversationType` (`'chat'` or
|
|
285
|
+
`'channel'`), `teamId`/`channelId` (set for channel messages, for use with
|
|
286
|
+
`sendMessage`), and `mentions` (always present, empty when there are no
|
|
287
|
+
`@mentions`; each is `{ id, mri?, displayName }`).
|
|
288
|
+
|
|
289
|
+
The listener reuses your extracted credentials, so the Teams desktop app must be
|
|
290
|
+
logged in. It reconnects automatically and re-authenticates on token expiry.
|
|
291
|
+
|
|
256
292
|
## Key Differences: Teams vs Discord vs Slack
|
|
257
293
|
|
|
258
294
|
| Concept | Slack | Discord | Teams |
|
|
@@ -206,9 +206,39 @@ import type {
|
|
|
206
206
|
TeamsAccount,
|
|
207
207
|
TeamsConfig,
|
|
208
208
|
TeamsConfigLegacy,
|
|
209
|
+
TeamsRealtimeMessage,
|
|
210
|
+
TeamsMention,
|
|
211
|
+
TeamsListenerEventMap,
|
|
212
|
+
TeamsTrouterGenericEvent,
|
|
209
213
|
} from 'agent-messenger/teams'
|
|
210
214
|
```
|
|
211
215
|
|
|
216
|
+
The real-time listener emits `TeamsRealtimeMessage`:
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
interface TeamsRealtimeMessage {
|
|
220
|
+
id: string
|
|
221
|
+
chatId: string
|
|
222
|
+
conversationType: 'chat' | 'channel'
|
|
223
|
+
teamId?: string // set for channel messages
|
|
224
|
+
channelId?: string // set for channel messages
|
|
225
|
+
content: string // HTML-stripped text
|
|
226
|
+
mentions: TeamsMention[] // always present; empty when no @mentions
|
|
227
|
+
author: { id: string; displayName: string }
|
|
228
|
+
messageType: string
|
|
229
|
+
timestamp: string
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
interface TeamsMention {
|
|
233
|
+
id: string // positional mention index
|
|
234
|
+
mri?: string // Skype MRI of the mentioned user/tag
|
|
235
|
+
displayName: string
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
These are type-only exports (no Zod schema — the listener constructs the event
|
|
240
|
+
internally rather than parsing untrusted input).
|
|
241
|
+
|
|
212
242
|
### Zod Schemas
|
|
213
243
|
|
|
214
244
|
Runtime-validated schemas are also exported for parsing API responses:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-messenger",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.29.1",
|
|
4
4
|
"description": "Multi-platform messaging CLI for AI agents (Slack, Discord, Teams, Webex, Telegram, Telegram Bot, WhatsApp, LINE, iMessage, Instagram, KakaoTalk, Channel Talk)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-channeltalk
|
|
3
3
|
description: Interact with Channel Talk using extracted desktop app or browser credentials - read chats, send messages, search messages, manage groups
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.29.1
|
|
5
5
|
allowed-tools: Bash(agent-channeltalk:*)
|
|
6
6
|
metadata:
|
|
7
7
|
openclaw:
|
|
@@ -196,10 +196,21 @@ Session data (cookies and tokens) is stored per account:
|
|
|
196
196
|
~/.config/agent-messenger/instagram/<account-id>/
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
+
A device profile (randomized Android device identifiers) is generated once and
|
|
200
|
+
shared across all accounts on this machine, so repeat logins present a
|
|
201
|
+
consistent device fingerprint:
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
~/.config/agent-messenger/instagram/device.json
|
|
205
|
+
```
|
|
206
|
+
|
|
199
207
|
### Security
|
|
200
208
|
|
|
201
209
|
- Credentials file permissions: `0600` (owner read/write only)
|
|
202
210
|
- Session cookies are stored in plaintext on disk
|
|
211
|
+
- `device.json` holds no secrets — only synthetic device identifiers — but is
|
|
212
|
+
shared across accounts, so all accounts on this machine share one device
|
|
213
|
+
fingerprint
|
|
203
214
|
- Keep these files secure. They grant full access to your Instagram account
|
|
204
215
|
- Never commit to version control
|
|
205
216
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-teams
|
|
3
3
|
description: Interact with Microsoft Teams - send messages, read channels, manage reactions
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.29.1
|
|
5
5
|
allowed-tools: Bash(agent-teams:*)
|
|
6
6
|
metadata:
|
|
7
7
|
openclaw:
|
|
@@ -33,11 +33,30 @@ agent-teams channel list <team-id>
|
|
|
33
33
|
|
|
34
34
|
## Authentication
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Two co-equal ways to sign in — pick whichever fits:
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
1. **`agent-teams auth login`** (work/school **or** personal Microsoft accounts) — device-code sign-in. Open the printed URL, enter the code, and approve in your browser. No desktop app or browser extraction needed. It prompts for your Microsoft email (or pass `--email <email>`) and auto-detects work vs personal, then starts the matching flow; pass `--account-type work|personal` to force it and skip detection. Only `auth login` stores the AAD refresh token required by `message search`.
|
|
39
|
+
2. **`agent-teams auth extract`** — zero-config extraction from the Teams desktop app, falling back to a Chromium browser. Best when you're already signed into Teams locally. Yields a Skype token only — sufficient for messaging, but **not** for `message search` (see below).
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
Credentials are also extracted automatically on first use of any command if none are stored, so `auth extract` can happen silently in the background.
|
|
42
|
+
|
|
43
|
+
Teams tokens are short-lived (60-90 minutes for extraction, a few hours for device-code). **Device-code accounts (`auth login`) refresh silently** — the CLI re-mints an expired token from the stored refresh token with no re-login needed. Extraction accounts re-extract automatically as long as you're still signed into the Teams desktop app or a supported browser; if that fails, re-run `auth extract` (or switch to `auth login`).
|
|
44
|
+
|
|
45
|
+
### Non-interactive `auth login` (agents / CI)
|
|
46
|
+
|
|
47
|
+
When there's no TTY, `auth login` splits into two calls:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# 1. Start — returns verification_uri, user_code, and device_code as JSON.
|
|
51
|
+
# Pass --email to auto-detect the account type (no prompt without a TTY),
|
|
52
|
+
# or --account-type work|personal to force it.
|
|
53
|
+
agent-teams auth login --email <email>
|
|
54
|
+
|
|
55
|
+
# 2. After the user approves in a browser, finish with the device_code
|
|
56
|
+
agent-teams auth login --device-code <device_code>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`--client-id <id>` overrides the AAD client ID on either call (or set `AGENT_TEAMS_CLIENT_ID`). `--account-type <work|personal>` selects the account (default `work`); it is preserved across the two-call flow, so pass it to both calls when signing in to a personal account non-interactively.
|
|
41
60
|
|
|
42
61
|
### Multi-Team Support
|
|
43
62
|
|
|
@@ -145,6 +164,10 @@ If a memorized ID returns an error (channel not found, team not found), remove i
|
|
|
145
164
|
### Auth Commands
|
|
146
165
|
|
|
147
166
|
```bash
|
|
167
|
+
# Sign in via device code (personal Microsoft accounts).
|
|
168
|
+
agent-teams auth login
|
|
169
|
+
agent-teams auth login --device-code <code> # finish a non-interactive login
|
|
170
|
+
|
|
148
171
|
# Extract token from Teams desktop app or browser (usually automatic)
|
|
149
172
|
agent-teams auth extract
|
|
150
173
|
agent-teams auth extract --debug
|
|
@@ -191,8 +214,14 @@ agent-teams message get <team-id> <channel-id> <message-id>
|
|
|
191
214
|
|
|
192
215
|
# Delete a message
|
|
193
216
|
agent-teams message delete <team-id> <channel-id> <message-id> --force
|
|
217
|
+
|
|
218
|
+
# Search messages across Teams (requires `auth login` — see Authentication)
|
|
219
|
+
agent-teams message search <query>
|
|
220
|
+
agent-teams message search "deploy" --limit 10 --from 0
|
|
194
221
|
```
|
|
195
222
|
|
|
223
|
+
`message search` requires an `auth login` account: it queries Microsoft's Substrate search API with an AAD token that `auth extract` (cookie-based) cannot provide. Cookie-only accounts get a clear error telling you to run `auth login`. `--limit` is a positive integer (default 20); `--from` is a non-negative offset for pagination (default 0).
|
|
224
|
+
|
|
196
225
|
### Channel Commands
|
|
197
226
|
|
|
198
227
|
```bash
|
|
@@ -279,8 +308,15 @@ agent-teams file list <team-id> <channel-id>
|
|
|
279
308
|
|
|
280
309
|
# Get file info
|
|
281
310
|
agent-teams file info <team-id> <channel-id> <file-id>
|
|
311
|
+
|
|
312
|
+
# Download a file (to a path or directory; defaults to the current dir)
|
|
313
|
+
agent-teams file download <team-id> <channel-id> <file-id>
|
|
314
|
+
agent-teams file download <team-id> <channel-id> <file-id> ./report.pdf
|
|
315
|
+
agent-teams file download <team-id> <channel-id> <file-id> ./downloads/ --pretty
|
|
282
316
|
```
|
|
283
317
|
|
|
318
|
+
`file download` output: `{ "id", "name", "size", "content_type", "path" }` where `path` is where the file was written. Inline/image attachments download with the extracted Skype token and work for any signed-in account; SharePoint/OneDrive documents download via Microsoft Graph and require an `auth login` account (cookie-only `auth extract` accounts get a clear error telling you to run `auth login`).
|
|
319
|
+
|
|
284
320
|
### Snapshot Command
|
|
285
321
|
|
|
286
322
|
Get team overview for AI agents (brief by default):
|
|
@@ -427,13 +463,53 @@ await client.addReaction(teams[0].id, channels[0].id, msg.id, 'like')
|
|
|
427
463
|
await client.uploadFile(teams[0].id, channels[0].id, './report.pdf')
|
|
428
464
|
```
|
|
429
465
|
|
|
466
|
+
### Real-time Events
|
|
467
|
+
|
|
468
|
+
Stream Teams chat messages in real time over the internal trouter WebSocket — as a user, no bot and no public endpoint. Requires the Teams desktop app to be logged in.
|
|
469
|
+
|
|
470
|
+
```typescript
|
|
471
|
+
import { TeamsClient, TeamsListener } from 'agent-messenger/teams'
|
|
472
|
+
|
|
473
|
+
const client = await new TeamsClient().login()
|
|
474
|
+
const listener = new TeamsListener(client)
|
|
475
|
+
|
|
476
|
+
listener.on('message', async (message) => {
|
|
477
|
+
console.log(`New message in ${message.chatId}: ${message.content}`)
|
|
478
|
+
|
|
479
|
+
// Channel messages carry team/channel context and parsed @mentions.
|
|
480
|
+
if (message.conversationType === 'channel') {
|
|
481
|
+
for (const mention of message.mentions) {
|
|
482
|
+
console.log(`Mentioned: ${mention.displayName} (${mention.mri})`)
|
|
483
|
+
}
|
|
484
|
+
await client.sendMessage(message.teamId!, message.channelId!, 'On it 👍')
|
|
485
|
+
}
|
|
486
|
+
})
|
|
487
|
+
|
|
488
|
+
await listener.start()
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
Each `message` is a `TeamsRealtimeMessage`:
|
|
492
|
+
|
|
493
|
+
| Field | Type | Notes |
|
|
494
|
+
| --- | --- | --- |
|
|
495
|
+
| `id` | `string` | Message id |
|
|
496
|
+
| `chatId` | `string` | Conversation id (unchanged) |
|
|
497
|
+
| `conversationType` | `'chat' \| 'channel'` | `'channel'` for team-channel messages |
|
|
498
|
+
| `teamId` | `string?` | Set for channel messages (use with `sendMessage`) |
|
|
499
|
+
| `channelId` | `string?` | Set for channel messages (use with `sendMessage`) |
|
|
500
|
+
| `content` | `string` | HTML-stripped text (unchanged) |
|
|
501
|
+
| `mentions` | `TeamsMention[]` | Always present; empty when no `@mentions`. Each is `{ id, mri?, displayName }` |
|
|
502
|
+
| `author` | `{ id, displayName }` | Sender (unchanged) |
|
|
503
|
+
| `messageType` | `string` | e.g. `Text`, `RichText/Html` |
|
|
504
|
+
| `timestamp` | `string` | ISO timestamp |
|
|
505
|
+
|
|
430
506
|
### Full API Reference
|
|
431
507
|
|
|
432
508
|
See the [Teams SDK documentation](https://agent-messenger.dev/docs/sdk/teams) for complete method signatures, types, schemas, and examples.
|
|
433
509
|
|
|
434
510
|
## Limitations
|
|
435
511
|
|
|
436
|
-
-
|
|
512
|
+
- Real-time events are SDK-only (`TeamsListener`); the CLI has no `watch` command
|
|
437
513
|
- No voice/video channel support
|
|
438
514
|
- No team management (create/delete channels, roles)
|
|
439
515
|
- Personal accounts: chats only (no teams/channels); use the `chat` commands
|
|
@@ -441,7 +517,7 @@ See the [Teams SDK documentation](https://agent-messenger.dev/docs/sdk/teams) fo
|
|
|
441
517
|
- No webhook support
|
|
442
518
|
- Plain text messages only (no adaptive cards in v1)
|
|
443
519
|
- User tokens only (no app tokens)
|
|
444
|
-
- **
|
|
520
|
+
- **Tokens are short-lived** - device-code (`auth login`) accounts refresh silently from the stored refresh token; extraction accounts auto-refresh but need the Teams desktop app or browser to still be logged in
|
|
445
521
|
|
|
446
522
|
## Troubleshooting
|
|
447
523
|
|
|
@@ -95,10 +95,21 @@ The tool searches within:
|
|
|
95
95
|
|
|
96
96
|
### What Gets Extracted
|
|
97
97
|
|
|
98
|
-
- **skypetoken_asm**: Authentication token for Teams API
|
|
98
|
+
- **skypetoken_asm**: Authentication token for Teams API (sent as the `X-Skypetoken` header)
|
|
99
99
|
- **teams**: All teams you're a member of
|
|
100
100
|
- **token_extracted_at**: Timestamp for expiry tracking
|
|
101
101
|
|
|
102
|
+
### Real-time Auth (`authtoken` / id_token)
|
|
103
|
+
|
|
104
|
+
The real-time `TeamsListener` (SDK) additionally needs an OAuth Bearer token to
|
|
105
|
+
authenticate its trouter WebSocket connection. This is **not** persisted with
|
|
106
|
+
your credentials — the client extracts it on demand from the Teams `authtoken`
|
|
107
|
+
cookie (a JWE, stored URL-encoded with a `Bearer=` prefix), decrypted with the
|
|
108
|
+
same keychain machinery as `skypetoken_asm`. The listener re-extracts it on
|
|
109
|
+
every (re)connection, so it always uses the current cookie value. Because it is
|
|
110
|
+
read live from the desktop app's cookie store, the Teams desktop app must be
|
|
111
|
+
logged in for real-time streaming to work.
|
|
112
|
+
|
|
102
113
|
## Multi-Team Management
|
|
103
114
|
|
|
104
115
|
### List Teams
|
|
@@ -181,6 +192,25 @@ Credentials are stored in:
|
|
|
181
192
|
- Keep this file secure - it grants access to your Teams account
|
|
182
193
|
- **Tokens auto-expire in 60-90 minutes** - provides some security
|
|
183
194
|
|
|
195
|
+
## AAD Tokens (required for `message search`)
|
|
196
|
+
|
|
197
|
+
Most commands use only the Skype token above. **`message search` is different**: it queries Microsoft's Substrate search API, which requires an AAD Bearer token for the `substrate.office.com` audience — a token the Skype cookie cannot produce.
|
|
198
|
+
|
|
199
|
+
- **Only `auth login` (device-code) can mint it.** That flow stores an `aad_refresh_token` (and `aad_client_id`) alongside the Skype token. `auth extract` (cookie extraction) yields a Skype token only and therefore **cannot** run `message search` — the CLI returns an actionable error telling you to run `auth login`.
|
|
200
|
+
- **Work and personal accounts** are both supported by `auth login`. It detects the account type from your Microsoft email (prompted interactively, or via `--email <email>`) and starts the matching flow; `--account-type work|personal` forces it and skips detection. If a personal account still reaches the work flow, the CLI stops with an actionable hint to rerun with `--account-type personal`.
|
|
201
|
+
- At search time, the CLI silently exchanges the stored refresh token for a short-lived Substrate access token (per-scope AAD grant), caches it in memory only (never written to disk), and rotates the refresh token. The same mechanism can mint a Graph token for other AAD-gated features.
|
|
202
|
+
|
|
203
|
+
Credentials for an `auth login` account therefore include additional fields:
|
|
204
|
+
|
|
205
|
+
```json
|
|
206
|
+
{
|
|
207
|
+
"account_type": "work",
|
|
208
|
+
"auth_method": "device-code",
|
|
209
|
+
"aad_refresh_token": "0.AXoA...redacted...",
|
|
210
|
+
"aad_client_id": "5e3ce6c0-2b1f-4285-8d4b-75ee78787346"
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
184
214
|
## Authentication Status
|
|
185
215
|
|
|
186
216
|
Check if you're authenticated:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-webexbot
|
|
3
3
|
description: Interact with Cisco Webex using bot tokens - send messages, reply in threads, upload and download files, look up people, read spaces, manage memberships, stream real-time events
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.29.1
|
|
5
5
|
allowed-tools: Bash(agent-webexbot:*)
|
|
6
6
|
metadata:
|
|
7
7
|
openclaw:
|