agent-messenger 1.0.0 → 1.1.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.
- package/.claude/commands/release.md +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/e2e.yml.disabled +69 -0
- package/README.md +16 -14
- package/biome.json +33 -1
- package/bun.lock +63 -0
- package/dist/package.json +8 -4
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +4 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/platforms/discord/cli.js +1 -1
- package/dist/src/platforms/discord/client.d.ts.map +1 -1
- package/dist/src/platforms/discord/client.js +3 -3
- package/dist/src/platforms/discord/client.js.map +1 -1
- package/dist/src/platforms/discord/commands/user.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/user.js +10 -1
- package/dist/src/platforms/discord/commands/user.js.map +1 -1
- package/dist/src/platforms/discord/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/discord/credential-manager.js +18 -12
- package/dist/src/platforms/discord/credential-manager.js.map +1 -1
- package/dist/src/platforms/slack/cli.js +1 -1
- package/dist/src/platforms/slack/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/slack/credential-manager.js +20 -6
- package/dist/src/platforms/slack/credential-manager.js.map +1 -1
- package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/slack/token-extractor.js +34 -9
- package/dist/src/platforms/slack/token-extractor.js.map +1 -1
- package/dist/src/platforms/teams/cli.d.ts.map +1 -0
- package/dist/{cli.js → src/platforms/teams/cli.js} +11 -10
- package/dist/src/platforms/teams/cli.js.map +1 -0
- package/dist/src/platforms/teams/client.d.ts +32 -0
- package/dist/src/platforms/teams/client.d.ts.map +1 -0
- package/dist/src/platforms/teams/client.js +202 -0
- package/dist/src/platforms/teams/client.js.map +1 -0
- package/dist/src/platforms/teams/commands/auth.d.ts +14 -0
- package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/auth.js +176 -0
- package/dist/src/platforms/teams/commands/auth.js.map +1 -0
- package/dist/src/platforms/teams/commands/channel.d.ts +13 -0
- package/dist/src/platforms/teams/commands/channel.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/channel.js +97 -0
- package/dist/src/platforms/teams/commands/channel.js.map +1 -0
- package/dist/src/platforms/teams/commands/file.d.ts +12 -0
- package/dist/src/platforms/teams/commands/file.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/file.js +104 -0
- package/dist/src/platforms/teams/commands/file.js.map +1 -0
- package/dist/{commands → src/platforms/teams/commands}/index.d.ts +5 -2
- package/dist/src/platforms/teams/commands/index.d.ts.map +1 -0
- package/dist/{commands → src/platforms/teams/commands}/index.js +5 -2
- package/dist/src/platforms/teams/commands/index.js.map +1 -0
- package/dist/src/platforms/teams/commands/message.d.ts +17 -0
- package/dist/src/platforms/teams/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/message.js +133 -0
- package/dist/src/platforms/teams/commands/message.js.map +1 -0
- package/dist/src/platforms/teams/commands/reaction.d.ts +9 -0
- package/dist/src/platforms/teams/commands/reaction.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/reaction.js +68 -0
- package/dist/src/platforms/teams/commands/reaction.js.map +1 -0
- package/dist/src/platforms/teams/commands/snapshot.d.ts +10 -0
- package/dist/src/platforms/teams/commands/snapshot.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/snapshot.js +85 -0
- package/dist/src/platforms/teams/commands/snapshot.js.map +1 -0
- package/dist/src/platforms/teams/commands/team.d.ts +18 -0
- package/dist/src/platforms/teams/commands/team.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/team.js +130 -0
- package/dist/src/platforms/teams/commands/team.js.map +1 -0
- package/dist/src/platforms/teams/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/user.js +88 -0
- package/dist/src/platforms/teams/commands/user.js.map +1 -0
- package/dist/src/platforms/teams/credential-manager.d.ts +18 -0
- package/dist/src/platforms/teams/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/teams/credential-manager.js +81 -0
- package/dist/src/platforms/teams/credential-manager.js.map +1 -0
- package/dist/src/platforms/teams/index.d.ts +4 -0
- package/dist/src/platforms/teams/index.d.ts.map +1 -0
- package/dist/src/platforms/teams/index.js +6 -0
- package/dist/src/platforms/teams/index.js.map +1 -0
- package/dist/src/platforms/teams/token-extractor.d.ts +36 -0
- package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -0
- package/dist/src/platforms/teams/token-extractor.js +335 -0
- package/dist/src/platforms/teams/token-extractor.js.map +1 -0
- package/dist/src/platforms/teams/types.d.ts +209 -0
- package/dist/src/platforms/teams/types.d.ts.map +1 -0
- package/dist/src/platforms/teams/types.js +65 -0
- package/dist/src/platforms/teams/types.js.map +1 -0
- package/docs/teams.md +321 -0
- package/e2e/README.md +256 -0
- package/e2e/config.ts +45 -0
- package/e2e/discord.e2e.test.ts +252 -0
- package/e2e/helpers.ts +107 -0
- package/e2e/slack.e2e.test.ts +309 -0
- package/package.json +8 -4
- package/scripts/postbuild.ts +15 -0
- package/skills/agent-teams/SKILL.md +292 -0
- package/skills/agent-teams/references/authentication.md +375 -0
- package/skills/agent-teams/references/common-patterns.md +596 -0
- package/skills/agent-teams/templates/monitor-channel.sh +239 -0
- package/skills/agent-teams/templates/post-message.sh +224 -0
- package/skills/agent-teams/templates/team-summary.sh +210 -0
- package/src/cli.ts +4 -0
- package/src/platforms/discord/client.ts +3 -3
- package/src/platforms/discord/commands/auth.test.ts +48 -32
- package/src/platforms/discord/commands/channel.test.ts +54 -42
- package/src/platforms/discord/commands/file.test.ts +40 -53
- package/src/platforms/discord/commands/guild.test.ts +47 -27
- package/src/platforms/discord/commands/message.test.ts +54 -51
- package/src/platforms/discord/commands/reaction.test.ts +54 -42
- package/src/platforms/discord/commands/user.ts +12 -1
- package/src/platforms/discord/credential-manager.test.ts +137 -136
- package/src/platforms/discord/credential-manager.ts +20 -13
- package/src/platforms/discord/token-extractor.test.ts +133 -383
- package/{tests → src/platforms/slack}/cli.test.ts +3 -3
- package/{tests/slack-client.test.ts → src/platforms/slack/client.test.ts} +1 -1
- package/{tests → src/platforms/slack}/commands/auth.test.ts +25 -13
- package/{tests → src/platforms/slack}/commands/channel.test.ts +2 -2
- package/{tests → src/platforms/slack}/commands/file.test.ts +2 -2
- package/{tests → src/platforms/slack}/commands/message.test.ts +2 -2
- package/{tests → src/platforms/slack}/commands/reaction.test.ts +1 -1
- package/{tests → src/platforms/slack}/commands/snapshot.test.ts +117 -105
- package/{tests → src/platforms/slack}/commands/user.test.ts +3 -3
- package/{tests → src/platforms/slack}/commands/workspace.test.ts +44 -95
- package/{tests → src/platforms/slack}/credential-manager.test.ts +2 -2
- package/src/platforms/slack/credential-manager.ts +22 -7
- package/src/platforms/slack/token-extractor-node-test.ts +40 -0
- package/src/platforms/slack/token-extractor-node.test.ts +10 -0
- package/src/platforms/slack/token-extractor.ts +36 -10
- package/{tests → src/platforms/slack}/types.test.ts +1 -1
- package/src/platforms/teams/cli.ts +36 -0
- package/src/platforms/teams/client.test.ts +500 -0
- package/src/platforms/teams/client.ts +365 -0
- package/src/platforms/teams/commands/auth.test.ts +99 -0
- package/src/platforms/teams/commands/auth.ts +232 -0
- package/src/platforms/teams/commands/channel.test.ts +147 -0
- package/src/platforms/teams/commands/channel.ts +129 -0
- package/src/platforms/teams/commands/file.test.ts +88 -0
- package/src/platforms/teams/commands/file.ts +144 -0
- package/src/platforms/teams/commands/index.ts +12 -0
- package/src/platforms/teams/commands/message.test.ts +110 -0
- package/src/platforms/teams/commands/message.ts +188 -0
- package/src/platforms/teams/commands/reaction.test.ts +87 -0
- package/src/platforms/teams/commands/reaction.ts +104 -0
- package/src/platforms/teams/commands/snapshot.test.ts +35 -0
- package/src/platforms/teams/commands/snapshot.ts +115 -0
- package/src/platforms/teams/commands/team.test.ts +157 -0
- package/src/platforms/teams/commands/team.ts +164 -0
- package/src/platforms/teams/commands/user.test.ts +83 -0
- package/src/platforms/teams/commands/user.ts +112 -0
- package/src/platforms/teams/credential-manager.test.ts +178 -0
- package/src/platforms/teams/credential-manager.ts +92 -0
- package/src/platforms/teams/index.ts +5 -0
- package/src/platforms/teams/token-extractor.test.ts +429 -0
- package/src/platforms/teams/token-extractor.ts +462 -0
- package/src/platforms/teams/types.test.ts +226 -0
- package/src/platforms/teams/types.ts +140 -0
- package/tsconfig.json +1 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/auth.d.ts +0 -3
- package/dist/commands/auth.d.ts.map +0 -1
- package/dist/commands/auth.js +0 -140
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/channel.d.ts +0 -3
- package/dist/commands/channel.d.ts.map +0 -1
- package/dist/commands/channel.js +0 -118
- package/dist/commands/channel.js.map +0 -1
- package/dist/commands/file.d.ts +0 -3
- package/dist/commands/file.d.ts.map +0 -1
- package/dist/commands/file.js +0 -113
- package/dist/commands/file.js.map +0 -1
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/message.d.ts +0 -3
- package/dist/commands/message.d.ts.map +0 -1
- package/dist/commands/message.js +0 -214
- package/dist/commands/message.js.map +0 -1
- package/dist/commands/reaction.d.ts +0 -3
- package/dist/commands/reaction.d.ts.map +0 -1
- package/dist/commands/reaction.js +0 -100
- package/dist/commands/reaction.js.map +0 -1
- package/dist/commands/snapshot.d.ts +0 -3
- package/dist/commands/snapshot.d.ts.map +0 -1
- package/dist/commands/snapshot.js +0 -88
- package/dist/commands/snapshot.js.map +0 -1
- package/dist/commands/user.d.ts.map +0 -1
- package/dist/commands/user.js +0 -96
- package/dist/commands/user.js.map +0 -1
- package/dist/commands/workspace.d.ts +0 -3
- package/dist/commands/workspace.d.ts.map +0 -1
- package/dist/commands/workspace.js +0 -89
- package/dist/commands/workspace.js.map +0 -1
- package/dist/lib/credential-manager.d.ts +0 -13
- package/dist/lib/credential-manager.d.ts.map +0 -1
- package/dist/lib/credential-manager.js +0 -58
- package/dist/lib/credential-manager.js.map +0 -1
- package/dist/lib/index.d.ts +0 -3
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/index.js +0 -3
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/ref-manager.d.ts +0 -26
- package/dist/lib/ref-manager.d.ts.map +0 -1
- package/dist/lib/ref-manager.js +0 -92
- package/dist/lib/ref-manager.js.map +0 -1
- package/dist/lib/slack-client.d.ts +0 -37
- package/dist/lib/slack-client.d.ts.map +0 -1
- package/dist/lib/slack-client.js +0 -379
- package/dist/lib/slack-client.js.map +0 -1
- package/dist/lib/token-extractor.d.ts +0 -28
- package/dist/lib/token-extractor.d.ts.map +0 -1
- package/dist/lib/token-extractor.js +0 -401
- package/dist/lib/token-extractor.js.map +0 -1
- package/dist/src/platforms/discord/client.test.d.ts +0 -2
- package/dist/src/platforms/discord/client.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/client.test.js +0 -367
- package/dist/src/platforms/discord/client.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/auth.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/auth.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/auth.test.js +0 -65
- package/dist/src/platforms/discord/commands/auth.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/channel.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/channel.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/channel.test.js +0 -136
- package/dist/src/platforms/discord/commands/channel.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/file.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/file.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/file.test.js +0 -83
- package/dist/src/platforms/discord/commands/file.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/guild.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/guild.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/guild.test.js +0 -100
- package/dist/src/platforms/discord/commands/guild.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/message.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/message.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/message.test.js +0 -91
- package/dist/src/platforms/discord/commands/message.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/reaction.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/reaction.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/reaction.test.js +0 -115
- package/dist/src/platforms/discord/commands/reaction.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/snapshot.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/snapshot.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/snapshot.test.js +0 -25
- package/dist/src/platforms/discord/commands/snapshot.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/user.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/user.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/user.test.js +0 -103
- package/dist/src/platforms/discord/commands/user.test.js.map +0 -1
- package/dist/src/platforms/discord/credential-manager.test.d.ts +0 -2
- package/dist/src/platforms/discord/credential-manager.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/credential-manager.test.js +0 -136
- package/dist/src/platforms/discord/credential-manager.test.js.map +0 -1
- package/dist/src/platforms/discord/token-extractor.test.d.ts +0 -2
- package/dist/src/platforms/discord/token-extractor.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/token-extractor.test.js +0 -789
- package/dist/src/platforms/discord/token-extractor.test.js.map +0 -1
- package/dist/src/platforms/discord/types.test.d.ts +0 -2
- package/dist/src/platforms/discord/types.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/types.test.js +0 -211
- package/dist/src/platforms/discord/types.test.js.map +0 -1
- package/dist/src/shared/utils/concurrency.test.d.ts +0 -2
- package/dist/src/shared/utils/concurrency.test.d.ts.map +0 -1
- package/dist/src/shared/utils/concurrency.test.js +0 -39
- package/dist/src/shared/utils/concurrency.test.js.map +0 -1
- package/dist/tests/cli.test.d.ts +0 -2
- package/dist/tests/cli.test.d.ts.map +0 -1
- package/dist/tests/cli.test.js +0 -83
- package/dist/tests/cli.test.js.map +0 -1
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/CURRENT +0 -1
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOCK +0 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOG +0 -3
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOG.old +0 -1
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/MANIFEST-000004 +0 -0
- package/dist/tests/commands/auth.test.d.ts +0 -2
- package/dist/tests/commands/auth.test.d.ts.map +0 -1
- package/dist/tests/commands/auth.test.js +0 -304
- package/dist/tests/commands/auth.test.js.map +0 -1
- package/dist/tests/commands/channel.test.d.ts +0 -2
- package/dist/tests/commands/channel.test.d.ts.map +0 -1
- package/dist/tests/commands/channel.test.js +0 -166
- package/dist/tests/commands/channel.test.js.map +0 -1
- package/dist/tests/commands/file.test.d.ts +0 -2
- package/dist/tests/commands/file.test.d.ts.map +0 -1
- package/dist/tests/commands/file.test.js +0 -175
- package/dist/tests/commands/file.test.js.map +0 -1
- package/dist/tests/commands/message.test.d.ts +0 -2
- package/dist/tests/commands/message.test.d.ts.map +0 -1
- package/dist/tests/commands/message.test.js +0 -293
- package/dist/tests/commands/message.test.js.map +0 -1
- package/dist/tests/commands/reaction.test.d.ts +0 -2
- package/dist/tests/commands/reaction.test.d.ts.map +0 -1
- package/dist/tests/commands/reaction.test.js +0 -84
- package/dist/tests/commands/reaction.test.js.map +0 -1
- package/dist/tests/commands/snapshot.test.d.ts +0 -2
- package/dist/tests/commands/snapshot.test.d.ts.map +0 -1
- package/dist/tests/commands/snapshot.test.js +0 -280
- package/dist/tests/commands/snapshot.test.js.map +0 -1
- package/dist/tests/commands/user.test.d.ts +0 -2
- package/dist/tests/commands/user.test.d.ts.map +0 -1
- package/dist/tests/commands/user.test.js +0 -117
- package/dist/tests/commands/user.test.js.map +0 -1
- package/dist/tests/commands/workspace.test.d.ts +0 -2
- package/dist/tests/commands/workspace.test.d.ts.map +0 -1
- package/dist/tests/commands/workspace.test.js +0 -453
- package/dist/tests/commands/workspace.test.js.map +0 -1
- package/dist/tests/credential-manager.test.d.ts +0 -2
- package/dist/tests/credential-manager.test.d.ts.map +0 -1
- package/dist/tests/credential-manager.test.js +0 -199
- package/dist/tests/credential-manager.test.js.map +0 -1
- package/dist/tests/slack-client.test.d.ts +0 -2
- package/dist/tests/slack-client.test.d.ts.map +0 -1
- package/dist/tests/slack-client.test.js +0 -741
- package/dist/tests/slack-client.test.js.map +0 -1
- package/dist/tests/types.test.d.ts +0 -2
- package/dist/tests/types.test.d.ts.map +0 -1
- package/dist/tests/types.test.js +0 -215
- package/dist/tests/types.test.js.map +0 -1
- package/dist/types/index.d.ts +0 -369
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -92
- package/dist/types/index.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -2
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -5
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/output.d.ts +0 -2
- package/dist/utils/output.d.ts.map +0 -1
- package/dist/utils/output.js +0 -4
- package/dist/utils/output.js.map +0 -1
- /package/dist/{cli.d.ts → src/platforms/teams/cli.d.ts} +0 -0
- /package/dist/{commands → src/platforms/teams/commands}/user.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-messenger",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Multi-platform messaging CLI for AI agents (Slack, Discord, Teams)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/cli.js",
|
|
@@ -9,11 +9,14 @@
|
|
|
9
9
|
"agent-messenger": "./src/cli.ts",
|
|
10
10
|
"amsg": "./src/cli.ts",
|
|
11
11
|
"agent-slack": "./src/platforms/slack/cli.ts",
|
|
12
|
-
"agent-discord": "./src/platforms/discord/cli.ts"
|
|
12
|
+
"agent-discord": "./src/platforms/discord/cli.ts",
|
|
13
|
+
"agent-teams": "./src/platforms/teams/cli.ts"
|
|
13
14
|
},
|
|
14
15
|
"scripts": {
|
|
15
|
-
"build": "tsc
|
|
16
|
-
"
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"postbuild": "bun scripts/postbuild.ts",
|
|
18
|
+
"test": "bun test src/",
|
|
19
|
+
"test:e2e": "bun test e2e/",
|
|
17
20
|
"typecheck": "tsc --noEmit",
|
|
18
21
|
"lint": "biome check .",
|
|
19
22
|
"format": "biome format --write .",
|
|
@@ -32,6 +35,7 @@
|
|
|
32
35
|
"@types/better-sqlite3": "^7.6.8",
|
|
33
36
|
"@types/bun": "latest",
|
|
34
37
|
"@types/node": "^20.10.6",
|
|
38
|
+
"tsx": "^4.21.0",
|
|
35
39
|
"typescript": "^5.9.3"
|
|
36
40
|
}
|
|
37
41
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from 'node:fs'
|
|
2
|
+
|
|
3
|
+
const cliFiles = [
|
|
4
|
+
'dist/src/cli.js',
|
|
5
|
+
'dist/src/platforms/slack/cli.js',
|
|
6
|
+
'dist/src/platforms/discord/cli.js',
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
for (const file of cliFiles) {
|
|
10
|
+
const content = readFileSync(file, 'utf8')
|
|
11
|
+
const updated = content.replace('#!/usr/bin/env bun', '#!/usr/bin/env node')
|
|
12
|
+
writeFileSync(file, updated)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
console.log(`Updated shebang in ${cliFiles.length} CLI files`)
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-teams
|
|
3
|
+
description: Interact with Microsoft Teams - send messages, read channels, manage reactions
|
|
4
|
+
allowed-tools: Bash(agent-teams:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Agent Teams
|
|
8
|
+
|
|
9
|
+
A TypeScript CLI tool that enables AI agents and humans to interact with Microsoft Teams through a simple command interface. Features seamless token extraction from the Teams desktop app and multi-team support.
|
|
10
|
+
|
|
11
|
+
## TOKEN EXPIRY WARNING
|
|
12
|
+
|
|
13
|
+
**CRITICAL**: Microsoft Teams tokens expire in **60-90 minutes**! Unlike Discord/Slack, Teams tokens have a short lifespan. You MUST:
|
|
14
|
+
|
|
15
|
+
1. Check token validity before operations
|
|
16
|
+
2. Re-extract credentials when tokens expire
|
|
17
|
+
3. Handle `401 Unauthorized` errors gracefully
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Always check auth status first
|
|
21
|
+
agent-teams auth status
|
|
22
|
+
|
|
23
|
+
# If expired, re-extract
|
|
24
|
+
agent-teams auth extract
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Extract credentials from Teams desktop app (zero-config)
|
|
31
|
+
agent-teams auth extract
|
|
32
|
+
|
|
33
|
+
# Get team snapshot
|
|
34
|
+
agent-teams snapshot
|
|
35
|
+
|
|
36
|
+
# Send a message
|
|
37
|
+
agent-teams message send <channel-id> "Hello from AI agent!"
|
|
38
|
+
|
|
39
|
+
# List channels
|
|
40
|
+
agent-teams channel list
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Authentication
|
|
44
|
+
|
|
45
|
+
### Seamless Token Extraction
|
|
46
|
+
|
|
47
|
+
agent-teams automatically extracts your Teams credentials from the desktop app:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Just run this - no manual token copying needed
|
|
51
|
+
agent-teams auth extract
|
|
52
|
+
|
|
53
|
+
# Use --debug for troubleshooting
|
|
54
|
+
agent-teams auth extract --debug
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
This command:
|
|
58
|
+
- Auto-detects your platform (macOS/Linux/Windows)
|
|
59
|
+
- Extracts skypetoken_asm from Teams desktop app's Cookies SQLite database
|
|
60
|
+
- Validates token against Teams API before saving
|
|
61
|
+
- Discovers ALL joined teams
|
|
62
|
+
- Stores credentials securely in `~/.config/agent-messenger/`
|
|
63
|
+
|
|
64
|
+
### Multi-Team Support
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# List all available teams
|
|
68
|
+
agent-teams team list
|
|
69
|
+
|
|
70
|
+
# Switch to a different team
|
|
71
|
+
agent-teams team switch <team-id>
|
|
72
|
+
|
|
73
|
+
# Show current team
|
|
74
|
+
agent-teams team current
|
|
75
|
+
|
|
76
|
+
# Check auth status (includes token expiry info)
|
|
77
|
+
agent-teams auth status
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Commands
|
|
81
|
+
|
|
82
|
+
### Message Commands
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Send a message
|
|
86
|
+
agent-teams message send <channel-id> <content>
|
|
87
|
+
agent-teams message send 19:abc123@thread.tacv2 "Hello world"
|
|
88
|
+
|
|
89
|
+
# List messages
|
|
90
|
+
agent-teams message list <channel-id>
|
|
91
|
+
agent-teams message list 19:abc123@thread.tacv2 --limit 50
|
|
92
|
+
|
|
93
|
+
# Get a single message by ID
|
|
94
|
+
agent-teams message get <channel-id> <message-id>
|
|
95
|
+
|
|
96
|
+
# Delete a message
|
|
97
|
+
agent-teams message delete <channel-id> <message-id> --force
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Channel Commands
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# List channels in current team
|
|
104
|
+
agent-teams channel list
|
|
105
|
+
|
|
106
|
+
# Get channel info
|
|
107
|
+
agent-teams channel info <channel-id>
|
|
108
|
+
agent-teams channel info 19:abc123@thread.tacv2
|
|
109
|
+
|
|
110
|
+
# Get channel history (alias for message list)
|
|
111
|
+
agent-teams channel history <channel-id> --limit 100
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Team Commands
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# List all teams
|
|
118
|
+
agent-teams team list
|
|
119
|
+
|
|
120
|
+
# Get team info
|
|
121
|
+
agent-teams team info <team-id>
|
|
122
|
+
|
|
123
|
+
# Switch active team
|
|
124
|
+
agent-teams team switch <team-id>
|
|
125
|
+
|
|
126
|
+
# Show current team
|
|
127
|
+
agent-teams team current
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### User Commands
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# List team members
|
|
134
|
+
agent-teams user list
|
|
135
|
+
|
|
136
|
+
# Get user info
|
|
137
|
+
agent-teams user info <user-id>
|
|
138
|
+
|
|
139
|
+
# Get current user
|
|
140
|
+
agent-teams user me
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Reaction Commands
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Add reaction (use emoji name)
|
|
147
|
+
agent-teams reaction add <channel-id> <message-id> <emoji>
|
|
148
|
+
agent-teams reaction add 19:abc123@thread.tacv2 1234567890 like
|
|
149
|
+
|
|
150
|
+
# Remove reaction
|
|
151
|
+
agent-teams reaction remove <channel-id> <message-id> <emoji>
|
|
152
|
+
|
|
153
|
+
# List reactions on a message
|
|
154
|
+
agent-teams reaction list <channel-id> <message-id>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### File Commands
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Upload file
|
|
161
|
+
agent-teams file upload <channel-id> <path>
|
|
162
|
+
agent-teams file upload 19:abc123@thread.tacv2 ./report.pdf
|
|
163
|
+
|
|
164
|
+
# List files in channel
|
|
165
|
+
agent-teams file list <channel-id>
|
|
166
|
+
|
|
167
|
+
# Get file info
|
|
168
|
+
agent-teams file info <channel-id> <file-id>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Snapshot Command
|
|
172
|
+
|
|
173
|
+
Get comprehensive team state for AI agents:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Full snapshot
|
|
177
|
+
agent-teams snapshot
|
|
178
|
+
|
|
179
|
+
# Filtered snapshots
|
|
180
|
+
agent-teams snapshot --channels-only
|
|
181
|
+
agent-teams snapshot --users-only
|
|
182
|
+
|
|
183
|
+
# Limit messages per channel
|
|
184
|
+
agent-teams snapshot --limit 10
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Returns JSON with:
|
|
188
|
+
- Team metadata (id, name)
|
|
189
|
+
- Channels (id, name, type, description)
|
|
190
|
+
- Recent messages (id, content, author, timestamp)
|
|
191
|
+
- Members (id, displayName, email)
|
|
192
|
+
|
|
193
|
+
## Output Format
|
|
194
|
+
|
|
195
|
+
### JSON (Default)
|
|
196
|
+
|
|
197
|
+
All commands output JSON by default for AI consumption:
|
|
198
|
+
|
|
199
|
+
```json
|
|
200
|
+
{
|
|
201
|
+
"id": "19:abc123@thread.tacv2",
|
|
202
|
+
"content": "Hello world",
|
|
203
|
+
"author": "John Doe",
|
|
204
|
+
"timestamp": "2024-01-15T10:30:00.000Z"
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Pretty (Human-Readable)
|
|
209
|
+
|
|
210
|
+
Use `--pretty` flag for formatted output:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
agent-teams channel list --pretty
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Key Differences from Discord/Slack
|
|
217
|
+
|
|
218
|
+
| Feature | Teams | Discord | Slack |
|
|
219
|
+
|---------|-------|---------|-------|
|
|
220
|
+
| Server terminology | Team | Guild | Workspace |
|
|
221
|
+
| Channel identifiers | UUID format (19:xxx@thread.tacv2) | Snowflake IDs | Channel name or ID |
|
|
222
|
+
| Token storage | Cookies SQLite | LevelDB | LevelDB |
|
|
223
|
+
| Token expiry | **60-90 minutes** | Rarely expires | Rarely expires |
|
|
224
|
+
| Mentions | `<at id="user-id">Name</at>` | `<@user_id>` | `<@USER_ID>` |
|
|
225
|
+
|
|
226
|
+
**Important**: Teams uses UUID-style channel IDs (like `19:abc123@thread.tacv2`). You cannot use channel names directly - use `channel list` to find IDs first.
|
|
227
|
+
|
|
228
|
+
## Common Patterns
|
|
229
|
+
|
|
230
|
+
See `references/common-patterns.md` for typical AI agent workflows.
|
|
231
|
+
|
|
232
|
+
## Templates
|
|
233
|
+
|
|
234
|
+
See `templates/` directory for runnable examples:
|
|
235
|
+
- `post-message.sh` - Send messages with error handling
|
|
236
|
+
- `monitor-channel.sh` - Monitor channel for new messages (with token refresh)
|
|
237
|
+
- `team-summary.sh` - Generate team summary
|
|
238
|
+
|
|
239
|
+
## Error Handling
|
|
240
|
+
|
|
241
|
+
All commands return consistent error format:
|
|
242
|
+
|
|
243
|
+
```json
|
|
244
|
+
{
|
|
245
|
+
"error": "Not authenticated. Run \"auth extract\" first."
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Common errors:
|
|
250
|
+
- `Not authenticated`: No valid token - run `auth extract`
|
|
251
|
+
- `Token expired`: Token has expired (60-90 min limit) - run `auth extract` again
|
|
252
|
+
- `No current team set`: Run `team switch <id>` first
|
|
253
|
+
- `Message not found`: Invalid message ID
|
|
254
|
+
- `Channel not found`: Invalid channel ID
|
|
255
|
+
- `401 Unauthorized`: Token expired - re-authenticate immediately
|
|
256
|
+
|
|
257
|
+
## Configuration
|
|
258
|
+
|
|
259
|
+
Credentials stored in: `~/.config/agent-messenger/teams-credentials.json`
|
|
260
|
+
|
|
261
|
+
Format:
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"token": "skypetoken_asm_value_here",
|
|
265
|
+
"token_extracted_at": "2024-01-15T10:00:00.000Z",
|
|
266
|
+
"current_team": "team-uuid-here",
|
|
267
|
+
"teams": {
|
|
268
|
+
"team-uuid-here": {
|
|
269
|
+
"team_id": "team-uuid-here",
|
|
270
|
+
"team_name": "My Team"
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**Security**: File permissions set to 0600 (owner read/write only)
|
|
277
|
+
|
|
278
|
+
## Limitations
|
|
279
|
+
|
|
280
|
+
- No real-time events / WebSocket connection
|
|
281
|
+
- No voice/video channel support
|
|
282
|
+
- No team management (create/delete channels, roles)
|
|
283
|
+
- No meeting support
|
|
284
|
+
- No webhook support
|
|
285
|
+
- Plain text messages only (no adaptive cards in v1)
|
|
286
|
+
- User tokens only (no app tokens)
|
|
287
|
+
- **Token expires in 60-90 minutes** - must re-authenticate frequently
|
|
288
|
+
|
|
289
|
+
## References
|
|
290
|
+
|
|
291
|
+
- [Authentication Guide](references/authentication.md)
|
|
292
|
+
- [Common Patterns](references/common-patterns.md)
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
# Authentication Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
agent-teams uses Microsoft Teams' user token extracted directly from the Teams desktop application. This provides seamless authentication without manual token management.
|
|
6
|
+
|
|
7
|
+
## TOKEN EXPIRY WARNING
|
|
8
|
+
|
|
9
|
+
**CRITICAL**: Microsoft Teams tokens expire in **60-90 minutes**!
|
|
10
|
+
|
|
11
|
+
Unlike Discord or Slack tokens which rarely expire, Teams tokens have a short lifespan. Your scripts and workflows MUST handle token expiry gracefully.
|
|
12
|
+
|
|
13
|
+
### Token Lifecycle
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Token Extracted → Valid for 60-90 min → Expires → Must Re-extract
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Checking Token Age
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Check auth status - includes token age
|
|
23
|
+
agent-teams auth status
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Output:
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"authenticated": true,
|
|
30
|
+
"user": "john.doe@company.com",
|
|
31
|
+
"current_team": "team-uuid-here",
|
|
32
|
+
"teams_count": 3,
|
|
33
|
+
"token_age_minutes": 45,
|
|
34
|
+
"token_expires_soon": false
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
When `token_expires_soon` is `true` (>50 min old), re-authenticate proactively.
|
|
39
|
+
|
|
40
|
+
## Token Extraction
|
|
41
|
+
|
|
42
|
+
### Automatic Extraction
|
|
43
|
+
|
|
44
|
+
The simplest way to authenticate:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
agent-teams auth extract
|
|
48
|
+
|
|
49
|
+
# Use --debug for troubleshooting extraction issues
|
|
50
|
+
agent-teams auth extract --debug
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
This command:
|
|
54
|
+
1. Detects your operating system (macOS, Linux, Windows)
|
|
55
|
+
2. Locates the Teams desktop app data directory
|
|
56
|
+
3. Reads the **Cookies SQLite database** containing session data
|
|
57
|
+
4. Extracts `skypetoken_asm` cookie value
|
|
58
|
+
5. Validates token against Teams API before saving
|
|
59
|
+
6. Discovers ALL joined teams
|
|
60
|
+
7. Stores credentials securely in `~/.config/agent-messenger/teams-credentials.json`
|
|
61
|
+
|
|
62
|
+
### Platform-Specific Paths
|
|
63
|
+
|
|
64
|
+
**macOS:**
|
|
65
|
+
```
|
|
66
|
+
~/Library/Application Support/Microsoft/Teams/
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Linux:**
|
|
70
|
+
```
|
|
71
|
+
~/.config/Microsoft/Microsoft Teams/
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Windows:**
|
|
75
|
+
```
|
|
76
|
+
%APPDATA%\Microsoft\Teams\
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The tool searches within:
|
|
80
|
+
- `Cookies` - SQLite database containing `skypetoken_asm`
|
|
81
|
+
- `Network/Cookies` - Alternative location on some versions
|
|
82
|
+
|
|
83
|
+
### What Gets Extracted
|
|
84
|
+
|
|
85
|
+
- **skypetoken_asm**: Authentication token for Teams API
|
|
86
|
+
- **teams**: All teams you're a member of
|
|
87
|
+
- **token_extracted_at**: Timestamp for expiry tracking
|
|
88
|
+
|
|
89
|
+
## Multi-Team Management
|
|
90
|
+
|
|
91
|
+
### List Teams
|
|
92
|
+
|
|
93
|
+
See all available teams:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
agent-teams team list
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Output:
|
|
100
|
+
```json
|
|
101
|
+
[
|
|
102
|
+
{
|
|
103
|
+
"id": "team-uuid-1",
|
|
104
|
+
"name": "Engineering",
|
|
105
|
+
"current": true
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "team-uuid-2",
|
|
109
|
+
"name": "Marketing",
|
|
110
|
+
"current": false
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Switch Team
|
|
116
|
+
|
|
117
|
+
Change the active team:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
agent-teams team switch team-uuid-2
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
All subsequent commands will use the selected team until you switch again.
|
|
124
|
+
|
|
125
|
+
### Current Team
|
|
126
|
+
|
|
127
|
+
Check which team is active:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
agent-teams team current
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Credential Storage
|
|
134
|
+
|
|
135
|
+
### Location
|
|
136
|
+
|
|
137
|
+
Credentials are stored in:
|
|
138
|
+
```
|
|
139
|
+
~/.config/agent-messenger/teams-credentials.json
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Format
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"token": "skypetoken_asm_value_here",
|
|
147
|
+
"token_extracted_at": "2024-01-15T10:00:00.000Z",
|
|
148
|
+
"current_team": "team-uuid-1",
|
|
149
|
+
"teams": {
|
|
150
|
+
"team-uuid-1": {
|
|
151
|
+
"team_id": "team-uuid-1",
|
|
152
|
+
"team_name": "Engineering"
|
|
153
|
+
},
|
|
154
|
+
"team-uuid-2": {
|
|
155
|
+
"team_id": "team-uuid-2",
|
|
156
|
+
"team_name": "Marketing"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Security
|
|
163
|
+
|
|
164
|
+
- File permissions: `0600` (owner read/write only)
|
|
165
|
+
- Tokens are stored in plaintext (same as Teams desktop app)
|
|
166
|
+
- Keep this file secure - it grants access to your Teams account
|
|
167
|
+
- **Tokens auto-expire in 60-90 minutes** - provides some security
|
|
168
|
+
|
|
169
|
+
## Authentication Status
|
|
170
|
+
|
|
171
|
+
Check if you're authenticated:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
agent-teams auth status
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Output when authenticated:
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"authenticated": true,
|
|
181
|
+
"user": "john.doe@company.com",
|
|
182
|
+
"current_team": "team-uuid-here",
|
|
183
|
+
"teams_count": 3,
|
|
184
|
+
"token_age_minutes": 45,
|
|
185
|
+
"token_expires_soon": false
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Output when token expired:
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"authenticated": false,
|
|
193
|
+
"error": "Token expired. Run \"auth extract\" to re-authenticate."
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Output when not authenticated:
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"error": "Not authenticated. Run \"auth extract\" first."
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Token Lifecycle
|
|
205
|
+
|
|
206
|
+
### When Tokens Expire
|
|
207
|
+
|
|
208
|
+
Teams tokens are invalidated when:
|
|
209
|
+
- **60-90 minutes have passed** (most common!)
|
|
210
|
+
- You sign out of the desktop app
|
|
211
|
+
- Your password is changed
|
|
212
|
+
- Admin revokes your session
|
|
213
|
+
- You manually log out
|
|
214
|
+
|
|
215
|
+
### Re-authentication Workflow
|
|
216
|
+
|
|
217
|
+
**Proactive (Recommended):**
|
|
218
|
+
```bash
|
|
219
|
+
# Check token age before operations
|
|
220
|
+
STATUS=$(agent-teams auth status)
|
|
221
|
+
EXPIRES_SOON=$(echo "$STATUS" | jq -r '.token_expires_soon // true')
|
|
222
|
+
|
|
223
|
+
if [ "$EXPIRES_SOON" = "true" ]; then
|
|
224
|
+
echo "Token expiring soon, refreshing..."
|
|
225
|
+
agent-teams auth extract
|
|
226
|
+
fi
|
|
227
|
+
|
|
228
|
+
# Now proceed with operations
|
|
229
|
+
agent-teams message send "$CHANNEL_ID" "Hello!"
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Reactive (On Error):**
|
|
233
|
+
```bash
|
|
234
|
+
RESULT=$(agent-teams message send "$CHANNEL_ID" "Hello!")
|
|
235
|
+
|
|
236
|
+
if echo "$RESULT" | jq -e '.error' | grep -q "expired\|401"; then
|
|
237
|
+
echo "Token expired, re-authenticating..."
|
|
238
|
+
agent-teams auth extract
|
|
239
|
+
|
|
240
|
+
# Retry the operation
|
|
241
|
+
agent-teams message send "$CHANNEL_ID" "Hello!"
|
|
242
|
+
fi
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Troubleshooting
|
|
246
|
+
|
|
247
|
+
### Using Debug Mode
|
|
248
|
+
|
|
249
|
+
For any extraction issues, run with `--debug` to see detailed information:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
agent-teams auth extract --debug
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
This shows:
|
|
256
|
+
- Which Teams directory was found
|
|
257
|
+
- Cookies database location
|
|
258
|
+
- Token extraction progress
|
|
259
|
+
- Token validation results
|
|
260
|
+
- Team discovery details
|
|
261
|
+
|
|
262
|
+
### "Teams desktop app not found"
|
|
263
|
+
|
|
264
|
+
**Cause**: Teams desktop app not installed or in non-standard location
|
|
265
|
+
|
|
266
|
+
**Solution**:
|
|
267
|
+
1. Install Microsoft Teams desktop app
|
|
268
|
+
2. Log in to your account
|
|
269
|
+
3. Run `agent-teams auth extract` again
|
|
270
|
+
|
|
271
|
+
### "No Teams token found"
|
|
272
|
+
|
|
273
|
+
**Cause**: Not logged into Teams or cookie storage corrupted
|
|
274
|
+
|
|
275
|
+
**Solution**:
|
|
276
|
+
1. Open Teams desktop app
|
|
277
|
+
2. Make sure you're logged in (can see your teams)
|
|
278
|
+
3. Run `agent-teams auth extract --debug` to see details
|
|
279
|
+
|
|
280
|
+
### "Permission denied reading Teams data"
|
|
281
|
+
|
|
282
|
+
**Cause**: Insufficient file system permissions
|
|
283
|
+
|
|
284
|
+
**Solution** (macOS):
|
|
285
|
+
1. Grant Terminal/iTerm full disk access in System Preferences
|
|
286
|
+
2. Security & Privacy -> Privacy -> Full Disk Access
|
|
287
|
+
3. Add your terminal application
|
|
288
|
+
|
|
289
|
+
### "Token validation failed" / "401 Unauthorized"
|
|
290
|
+
|
|
291
|
+
**Cause**: Token expired (most likely) or invalidated
|
|
292
|
+
|
|
293
|
+
**Solution**:
|
|
294
|
+
```bash
|
|
295
|
+
# Re-extract fresh credentials
|
|
296
|
+
agent-teams auth extract
|
|
297
|
+
|
|
298
|
+
# Test authentication
|
|
299
|
+
agent-teams auth status
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### "Token expired" errors
|
|
303
|
+
|
|
304
|
+
**Cause**: Token is older than 60-90 minutes
|
|
305
|
+
|
|
306
|
+
**Solution**:
|
|
307
|
+
```bash
|
|
308
|
+
# Simply re-extract - this is normal for Teams!
|
|
309
|
+
agent-teams auth extract
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Prevention**: Build token refresh into your scripts (see common-patterns.md)
|
|
313
|
+
|
|
314
|
+
## Security Considerations
|
|
315
|
+
|
|
316
|
+
### What agent-teams Can Access
|
|
317
|
+
|
|
318
|
+
With extracted credentials, agent-teams has the same permissions as you in Teams:
|
|
319
|
+
- Read all channels you have access to
|
|
320
|
+
- Send messages as you
|
|
321
|
+
- Upload/download files
|
|
322
|
+
- Manage reactions
|
|
323
|
+
- Access user information
|
|
324
|
+
- View team member lists
|
|
325
|
+
|
|
326
|
+
### What agent-teams Cannot Do
|
|
327
|
+
|
|
328
|
+
- Access channels you don't have permission for
|
|
329
|
+
- Perform admin operations (unless you're an admin)
|
|
330
|
+
- Access other users' private chats without existing conversation
|
|
331
|
+
- Manage team settings (not implemented)
|
|
332
|
+
|
|
333
|
+
### Best Practices
|
|
334
|
+
|
|
335
|
+
1. **Protect credentials.json**: Never commit to version control
|
|
336
|
+
2. **Use team switching**: Keep different contexts separate
|
|
337
|
+
3. **Handle token expiry**: Build refresh logic into all scripts
|
|
338
|
+
4. **Re-extract frequently**: Tokens expire in 60-90 minutes
|
|
339
|
+
5. **Revoke if compromised**: Sign out of Teams desktop app to invalidate tokens
|
|
340
|
+
|
|
341
|
+
## Manual Token Management (Advanced)
|
|
342
|
+
|
|
343
|
+
If automatic extraction fails, you can manually create credentials:
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
# Create config directory
|
|
347
|
+
mkdir -p ~/.config/agent-messenger
|
|
348
|
+
|
|
349
|
+
# Create credentials file
|
|
350
|
+
cat > ~/.config/agent-messenger/teams-credentials.json << 'EOF'
|
|
351
|
+
{
|
|
352
|
+
"token": "YOUR_SKYPETOKEN_ASM_HERE",
|
|
353
|
+
"token_extracted_at": "2024-01-15T10:00:00.000Z",
|
|
354
|
+
"current_team": "team-uuid-here",
|
|
355
|
+
"teams": {
|
|
356
|
+
"team-uuid-here": {
|
|
357
|
+
"team_id": "team-uuid-here",
|
|
358
|
+
"team_name": "My Team"
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
EOF
|
|
363
|
+
|
|
364
|
+
# Set secure permissions
|
|
365
|
+
chmod 600 ~/.config/agent-messenger/teams-credentials.json
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
To find your token manually:
|
|
369
|
+
1. Open Teams in browser (teams.microsoft.com)
|
|
370
|
+
2. Open DevTools -> Application tab
|
|
371
|
+
3. Go to Cookies -> teams.microsoft.com
|
|
372
|
+
4. Find `skypetoken_asm` cookie
|
|
373
|
+
5. Copy the value
|
|
374
|
+
|
|
375
|
+
**Warning**: Using user tokens for automation may violate Microsoft's Terms of Service. Use responsibly and at your own risk.
|