agent-messenger 2.0.0 → 2.2.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-plugin/marketplace.json +14 -1
- package/.claude-plugin/plugin.json +4 -2
- package/.env.template +35 -17
- package/README.md +37 -33
- package/bun.lock +6 -6
- package/dist/package.json +11 -3
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +3 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/platforms/channeltalk/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/commands/auth.js +35 -28
- package/dist/src/platforms/channeltalk/commands/auth.js.map +1 -1
- package/dist/src/platforms/channeltalk/ensure-auth.js +6 -6
- package/dist/src/platforms/channeltalk/ensure-auth.js.map +1 -1
- package/dist/src/platforms/channeltalk/token-extractor.d.ts +23 -1
- package/dist/src/platforms/channeltalk/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/token-extractor.js +299 -29
- package/dist/src/platforms/channeltalk/token-extractor.js.map +1 -1
- package/dist/src/platforms/discord/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/auth.js +57 -49
- package/dist/src/platforms/discord/commands/auth.js.map +1 -1
- package/dist/src/platforms/discord/ensure-auth.js +3 -3
- package/dist/src/platforms/discord/ensure-auth.js.map +1 -1
- package/dist/src/platforms/discord/token-extractor.d.ts +6 -1
- package/dist/src/platforms/discord/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/discord/token-extractor.js +167 -14
- package/dist/src/platforms/discord/token-extractor.js.map +1 -1
- package/dist/src/platforms/instagram/client.d.ts +2 -0
- package/dist/src/platforms/instagram/client.d.ts.map +1 -1
- package/dist/src/platforms/instagram/client.js +2 -2
- package/dist/src/platforms/instagram/client.js.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.js +107 -14
- package/dist/src/platforms/instagram/commands/auth.js.map +1 -1
- package/dist/src/platforms/instagram/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/instagram/ensure-auth.js +57 -11
- package/dist/src/platforms/instagram/ensure-auth.js.map +1 -1
- package/dist/src/platforms/instagram/index.d.ts +1 -0
- package/dist/src/platforms/instagram/index.d.ts.map +1 -1
- package/dist/src/platforms/instagram/index.js +1 -0
- package/dist/src/platforms/instagram/index.js.map +1 -1
- package/dist/src/platforms/instagram/token-extractor.d.ts +44 -0
- package/dist/src/platforms/instagram/token-extractor.d.ts.map +1 -0
- package/dist/src/platforms/instagram/token-extractor.js +407 -0
- package/dist/src/platforms/instagram/token-extractor.js.map +1 -0
- package/dist/src/platforms/kakaotalk/client.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/client.js +2 -1
- package/dist/src/platforms/kakaotalk/client.js.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/auth.js +14 -13
- package/dist/src/platforms/kakaotalk/commands/auth.js.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/connection.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/connection.js +2 -1
- package/dist/src/platforms/kakaotalk/protocol/connection.js.map +1 -1
- package/dist/src/platforms/line/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/line/commands/auth.js +6 -5
- package/dist/src/platforms/line/commands/auth.js.map +1 -1
- package/dist/src/platforms/slack/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/auth.js +11 -10
- package/dist/src/platforms/slack/commands/auth.js.map +1 -1
- package/dist/src/platforms/slack/token-extractor.d.ts +9 -0
- package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/slack/token-extractor.js +300 -23
- package/dist/src/platforms/slack/token-extractor.js.map +1 -1
- package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/auth.js +9 -8
- package/dist/src/platforms/teams/commands/auth.js.map +1 -1
- package/dist/src/platforms/teams/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/teams/ensure-auth.js +2 -1
- package/dist/src/platforms/teams/ensure-auth.js.map +1 -1
- package/dist/src/platforms/teams/token-extractor.d.ts +5 -0
- package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/teams/token-extractor.js +161 -29
- package/dist/src/platforms/teams/token-extractor.js.map +1 -1
- package/dist/src/platforms/telegram/client.d.ts.map +1 -1
- package/dist/src/platforms/telegram/client.js +25 -7
- package/dist/src/platforms/telegram/client.js.map +1 -1
- package/dist/src/platforms/telegram/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/telegram/commands/auth.js +6 -5
- package/dist/src/platforms/telegram/commands/auth.js.map +1 -1
- package/dist/src/platforms/webex/app-config.d.ts +7 -0
- package/dist/src/platforms/webex/app-config.d.ts.map +1 -0
- package/dist/src/platforms/webex/app-config.js +20 -0
- package/dist/src/platforms/webex/app-config.js.map +1 -0
- package/dist/src/platforms/webex/cli.d.ts +5 -0
- package/dist/src/platforms/webex/cli.d.ts.map +1 -0
- package/dist/src/platforms/webex/cli.js +32 -0
- package/dist/src/platforms/webex/cli.js.map +1 -0
- package/dist/src/platforms/webex/client.d.ts +55 -0
- package/dist/src/platforms/webex/client.d.ts.map +1 -0
- package/dist/src/platforms/webex/client.js +299 -0
- package/dist/src/platforms/webex/client.js.map +1 -0
- package/dist/src/platforms/webex/commands/auth.d.ts +19 -0
- package/dist/src/platforms/webex/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/webex/commands/auth.js +166 -0
- package/dist/src/platforms/webex/commands/auth.js.map +1 -0
- package/dist/src/platforms/webex/commands/index.d.ts +6 -0
- package/dist/src/platforms/webex/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/webex/commands/index.js +6 -0
- package/dist/src/platforms/webex/commands/index.js.map +1 -0
- package/dist/src/platforms/webex/commands/member.d.ts +7 -0
- package/dist/src/platforms/webex/commands/member.d.ts.map +1 -0
- package/dist/src/platforms/webex/commands/member.js +34 -0
- package/dist/src/platforms/webex/commands/member.js.map +1 -0
- package/dist/src/platforms/webex/commands/message.d.ts +26 -0
- package/dist/src/platforms/webex/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/webex/commands/message.js +153 -0
- package/dist/src/platforms/webex/commands/message.js.map +1 -0
- package/dist/src/platforms/webex/commands/snapshot.d.ts +9 -0
- package/dist/src/platforms/webex/commands/snapshot.d.ts.map +1 -0
- package/dist/src/platforms/webex/commands/snapshot.js +72 -0
- package/dist/src/platforms/webex/commands/snapshot.js.map +1 -0
- package/dist/src/platforms/webex/commands/space.d.ts +11 -0
- package/dist/src/platforms/webex/commands/space.d.ts.map +1 -0
- package/dist/src/platforms/webex/commands/space.js +59 -0
- package/dist/src/platforms/webex/commands/space.js.map +1 -0
- package/dist/src/platforms/webex/credential-manager.d.ts +23 -0
- package/dist/src/platforms/webex/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/webex/credential-manager.js +148 -0
- package/dist/src/platforms/webex/credential-manager.js.map +1 -0
- package/dist/src/platforms/webex/ensure-auth.d.ts +2 -0
- package/dist/src/platforms/webex/ensure-auth.d.ts.map +1 -0
- package/dist/src/platforms/webex/ensure-auth.js +36 -0
- package/dist/src/platforms/webex/ensure-auth.js.map +1 -0
- package/dist/src/platforms/webex/index.d.ts +8 -0
- package/dist/src/platforms/webex/index.d.ts.map +1 -0
- package/dist/src/platforms/webex/index.js +6 -0
- package/dist/src/platforms/webex/index.js.map +1 -0
- package/dist/src/platforms/webex/token-extractor.d.ts +28 -0
- package/dist/src/platforms/webex/token-extractor.d.ts.map +1 -0
- package/dist/src/platforms/webex/token-extractor.js +344 -0
- package/dist/src/platforms/webex/token-extractor.js.map +1 -0
- package/dist/src/platforms/webex/types.d.ts +127 -0
- package/dist/src/platforms/webex/types.d.ts.map +1 -0
- package/dist/src/platforms/webex/types.js +64 -0
- package/dist/src/platforms/webex/types.js.map +1 -0
- package/dist/src/platforms/whatsapp/client.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/client.js +6 -2
- package/dist/src/platforms/whatsapp/client.js.map +1 -1
- package/dist/src/shared/utils/derived-key-cache.d.ts +1 -1
- package/dist/src/shared/utils/derived-key-cache.d.ts.map +1 -1
- package/dist/src/shared/utils/error-handler.d.ts +1 -1
- package/dist/src/shared/utils/error-handler.d.ts.map +1 -1
- package/dist/src/shared/utils/error-handler.js +3 -2
- package/dist/src/shared/utils/error-handler.js.map +1 -1
- package/dist/src/shared/utils/stderr.d.ts +5 -0
- package/dist/src/shared/utils/stderr.d.ts.map +1 -0
- package/dist/src/shared/utils/stderr.js +18 -0
- package/dist/src/shared/utils/stderr.js.map +1 -0
- package/dist/src/tui/adapters/webex-adapter.d.ts +14 -0
- package/dist/src/tui/adapters/webex-adapter.d.ts.map +1 -0
- package/dist/src/tui/adapters/webex-adapter.js +79 -0
- package/dist/src/tui/adapters/webex-adapter.js.map +1 -0
- package/dist/src/tui/app.d.ts.map +1 -1
- package/dist/src/tui/app.js +2 -0
- package/dist/src/tui/app.js.map +1 -1
- package/docs/content/docs/cli/channeltalk.mdx +7 -7
- package/docs/content/docs/cli/discord.mdx +3 -3
- package/docs/content/docs/cli/instagram.mdx +28 -6
- package/docs/content/docs/cli/meta.json +1 -0
- package/docs/content/docs/cli/slack.mdx +2 -2
- package/docs/content/docs/cli/teams.mdx +6 -4
- package/docs/content/docs/cli/webex.mdx +310 -0
- package/docs/content/docs/sdk/meta.json +1 -1
- package/docs/content/docs/sdk/webex.mdx +260 -0
- package/docs/content/docs/tui.mdx +4 -3
- package/docs/src/app/page.tsx +2 -2
- package/e2e/README.md +132 -8
- package/e2e/channeltalk.e2e.test.ts +2 -7
- package/e2e/channeltalkbot.e2e.test.ts +2 -6
- package/e2e/config.ts +172 -10
- package/e2e/helpers.ts +7 -0
- package/e2e/instagram.e2e.test.ts +97 -0
- package/e2e/kakaotalk.e2e.test.ts +74 -0
- package/e2e/line.e2e.test.ts +92 -0
- package/e2e/teams.e2e.test.ts +46 -1
- package/e2e/telegram.e2e.test.ts +84 -0
- package/e2e/webex.e2e.test.ts +190 -0
- package/e2e/whatsapp.e2e.test.ts +90 -0
- package/e2e/whatsappbot.e2e.test.ts +78 -0
- package/package.json +11 -3
- package/skills/agent-channeltalk/SKILL.md +9 -9
- package/skills/agent-channeltalk/references/authentication.md +21 -18
- package/skills/agent-channeltalkbot/SKILL.md +1 -1
- package/skills/agent-discord/SKILL.md +5 -5
- package/skills/agent-discord/references/authentication.md +8 -8
- package/skills/agent-discordbot/SKILL.md +1 -1
- package/skills/agent-instagram/SKILL.md +51 -9
- package/skills/agent-instagram/references/authentication.md +35 -3
- package/skills/agent-kakaotalk/SKILL.md +1 -1
- package/skills/agent-line/SKILL.md +1 -1
- package/skills/agent-slack/SKILL.md +5 -5
- package/skills/agent-slack/references/authentication.md +8 -8
- package/skills/agent-slackbot/SKILL.md +1 -1
- package/skills/agent-teams/SKILL.md +6 -6
- package/skills/agent-teams/references/authentication.md +8 -8
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +406 -0
- package/skills/agent-webex/references/authentication.md +371 -0
- package/skills/agent-webex/references/common-patterns.md +726 -0
- package/skills/agent-webex/templates/monitor-space.sh +165 -0
- package/skills/agent-webex/templates/post-message.sh +170 -0
- package/skills/agent-whatsapp/SKILL.md +1 -1
- package/skills/agent-whatsappbot/SKILL.md +1 -1
- package/src/cli.ts +4 -0
- package/src/platforms/channeltalk/commands/auth.test.ts +5 -5
- package/src/platforms/channeltalk/commands/auth.ts +38 -32
- package/src/platforms/channeltalk/ensure-auth.test.ts +6 -6
- package/src/platforms/channeltalk/ensure-auth.ts +6 -6
- package/src/platforms/channeltalk/token-extractor.test.ts +182 -15
- package/src/platforms/channeltalk/token-extractor.ts +344 -30
- package/src/platforms/discord/commands/auth.test.ts +3 -3
- package/src/platforms/discord/commands/auth.ts +58 -54
- package/src/platforms/discord/ensure-auth.test.ts +3 -3
- package/src/platforms/discord/ensure-auth.ts +3 -3
- package/src/platforms/discord/token-extractor.test.ts +199 -27
- package/src/platforms/discord/token-extractor.ts +190 -17
- package/src/platforms/instagram/client.ts +2 -2
- package/src/platforms/instagram/commands/auth.ts +133 -14
- package/src/platforms/instagram/ensure-auth.ts +63 -12
- package/src/platforms/instagram/index.ts +1 -0
- package/src/platforms/instagram/token-extractor.test.ts +424 -0
- package/src/platforms/instagram/token-extractor.ts +478 -0
- package/src/platforms/kakaotalk/client.ts +3 -1
- package/src/platforms/kakaotalk/commands/auth.ts +14 -13
- package/src/platforms/kakaotalk/protocol/connection.ts +3 -1
- package/src/platforms/line/commands/auth.ts +7 -6
- package/src/platforms/slack/cli.test.ts +6 -5
- package/src/platforms/slack/commands/auth.test.ts +11 -7
- package/src/platforms/slack/commands/auth.ts +11 -10
- package/src/platforms/slack/token-extractor.test.ts +98 -1
- package/src/platforms/slack/token-extractor.ts +338 -26
- package/src/platforms/teams/commands/auth.ts +9 -8
- package/src/platforms/teams/ensure-auth.ts +3 -1
- package/src/platforms/teams/token-extractor.test.ts +136 -17
- package/src/platforms/teams/token-extractor.ts +182 -31
- package/src/platforms/telegram/client.test.ts +134 -0
- package/src/platforms/telegram/client.ts +27 -6
- package/src/platforms/telegram/commands/auth.ts +6 -5
- package/src/platforms/webex/app-config.test.ts +98 -0
- package/src/platforms/webex/app-config.ts +31 -0
- package/src/platforms/webex/cli.test.ts +58 -0
- package/src/platforms/webex/cli.ts +39 -0
- package/src/platforms/webex/client.test.ts +743 -0
- package/src/platforms/webex/client.ts +405 -0
- package/src/platforms/webex/commands/auth.test.ts +222 -0
- package/src/platforms/webex/commands/auth.ts +243 -0
- package/src/platforms/webex/commands/index.ts +5 -0
- package/src/platforms/webex/commands/member.test.ts +112 -0
- package/src/platforms/webex/commands/member.ts +45 -0
- package/src/platforms/webex/commands/message.test.ts +235 -0
- package/src/platforms/webex/commands/message.ts +204 -0
- package/src/platforms/webex/commands/snapshot.test.ts +105 -0
- package/src/platforms/webex/commands/snapshot.ts +91 -0
- package/src/platforms/webex/commands/space.test.ts +216 -0
- package/src/platforms/webex/commands/space.ts +74 -0
- package/src/platforms/webex/credential-manager.test.ts +314 -0
- package/src/platforms/webex/credential-manager.ts +197 -0
- package/src/platforms/webex/ensure-auth.test.ts +89 -0
- package/src/platforms/webex/ensure-auth.ts +38 -0
- package/src/platforms/webex/index.test.ts +25 -0
- package/src/platforms/webex/index.ts +19 -0
- package/src/platforms/webex/token-extractor.test.ts +327 -0
- package/src/platforms/webex/token-extractor.ts +393 -0
- package/src/platforms/webex/types.test.ts +307 -0
- package/src/platforms/webex/types.ts +129 -0
- package/src/platforms/whatsapp/client.ts +11 -7
- package/src/shared/utils/derived-key-cache.ts +1 -1
- package/src/shared/utils/error-handler.ts +4 -2
- package/src/shared/utils/stderr.ts +22 -0
- package/src/tui/adapters/webex-adapter.ts +103 -0
- package/src/tui/app.ts +2 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Webex
|
|
3
|
+
description: TypeScript SDK reference for Cisco Webex — client, credential management, and types.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install agent-messenger
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
import {
|
|
14
|
+
WebexClient,
|
|
15
|
+
WebexCredentialManager,
|
|
16
|
+
WebexError,
|
|
17
|
+
} from 'agent-messenger/webex'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## WebexClient
|
|
21
|
+
|
|
22
|
+
The main client for interacting with the Webex REST API programmatically. All API methods include automatic rate-limit handling with per-bucket tracking and exponential backoff on server errors.
|
|
23
|
+
|
|
24
|
+
OAuth tokens auto-refresh via the stored refresh token. Bot tokens never expire. PATs expire in 12 hours.
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { WebexClient } from 'agent-messenger/webex'
|
|
28
|
+
|
|
29
|
+
const client = await new WebexClient().login({ token })
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or use automatic credential extraction — credentials are loaded from stored OAuth/bot tokens, no manual token needed:
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { WebexClient } from 'agent-messenger/webex'
|
|
36
|
+
|
|
37
|
+
const client = await new WebexClient().login()
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Authentication
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
// Verify credentials and get identity
|
|
44
|
+
const me = await client.testAuth()
|
|
45
|
+
// → WebexPerson { id, displayName, emails, orgId, type }
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Spaces
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
// List all spaces (default limit: 50)
|
|
52
|
+
const spaces = await client.listSpaces()
|
|
53
|
+
const grouped = await client.listSpaces({ type: 'group', max: 20 })
|
|
54
|
+
// → WebexSpace[]
|
|
55
|
+
|
|
56
|
+
// Get a specific space by ID
|
|
57
|
+
const space = await client.getSpace(spaceId)
|
|
58
|
+
// → WebexSpace { id, title, type, isLocked, lastActivity, created, creatorId }
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Messages
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
// Send a message to a space
|
|
65
|
+
const msg = await client.sendMessage(roomId, 'Hello world')
|
|
66
|
+
// → WebexMessage { id, roomId, roomType, text, personId, personEmail, created }
|
|
67
|
+
|
|
68
|
+
// Send a markdown message
|
|
69
|
+
await client.sendMessage(roomId, '**Bold** and _italic_', { markdown: true })
|
|
70
|
+
|
|
71
|
+
// Send a direct message by email
|
|
72
|
+
const dm = await client.sendDirectMessage('alice@example.com', 'Hey!')
|
|
73
|
+
await client.sendDirectMessage('alice@example.com', '**Important**', { markdown: true })
|
|
74
|
+
|
|
75
|
+
// List messages in a space (default limit: 50)
|
|
76
|
+
const messages = await client.listMessages(roomId)
|
|
77
|
+
const limited = await client.listMessages(roomId, { max: 25 })
|
|
78
|
+
// → WebexMessage[]
|
|
79
|
+
|
|
80
|
+
// Get a single message by ID
|
|
81
|
+
const message = await client.getMessage(messageId)
|
|
82
|
+
// → WebexMessage
|
|
83
|
+
|
|
84
|
+
// Edit a message
|
|
85
|
+
const updated = await client.editMessage(messageId, roomId, 'Updated text')
|
|
86
|
+
await client.editMessage(messageId, roomId, '**Updated**', { markdown: true })
|
|
87
|
+
// → WebexMessage
|
|
88
|
+
|
|
89
|
+
// Delete a message
|
|
90
|
+
await client.deleteMessage(messageId)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### People
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
// List people (search by email or display name)
|
|
97
|
+
const people = await client.listPeople({ email: 'alice@example.com' })
|
|
98
|
+
const byName = await client.listPeople({ displayName: 'Alice', max: 10 })
|
|
99
|
+
// → WebexPerson[]
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Memberships
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
// List members of a space
|
|
106
|
+
const members = await client.listMemberships(roomId)
|
|
107
|
+
const limited = await client.listMemberships(roomId, { max: 100 })
|
|
108
|
+
// → WebexMembership[]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## WebexCredentialManager
|
|
112
|
+
|
|
113
|
+
Manages Webex credentials stored at `~/.config/agent-messenger/webex-credentials.json`. Files are written with `0o600` permissions. Supports OAuth Device Grant flow, bot tokens, and PATs.
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
import { WebexCredentialManager } from 'agent-messenger/webex'
|
|
117
|
+
|
|
118
|
+
const manager = new WebexCredentialManager()
|
|
119
|
+
// Custom path: new WebexCredentialManager('/custom/config/dir')
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
// Load config from disk (returns null if file doesn't exist)
|
|
124
|
+
const config = await manager.loadConfig()
|
|
125
|
+
// → WebexConfig | null
|
|
126
|
+
|
|
127
|
+
// Save config to disk (atomic write)
|
|
128
|
+
await manager.saveConfig(config)
|
|
129
|
+
|
|
130
|
+
// Get stored access token (auto-refreshes OAuth tokens if expired)
|
|
131
|
+
const token = await manager.getToken()
|
|
132
|
+
// → string | null
|
|
133
|
+
|
|
134
|
+
// Refresh an OAuth token manually
|
|
135
|
+
const refreshed = await manager.refreshToken(refreshToken, clientId, clientSecret)
|
|
136
|
+
// → WebexConfig | null
|
|
137
|
+
|
|
138
|
+
// Start OAuth Device Grant flow (request device code)
|
|
139
|
+
const device = await manager.requestDeviceCode(clientId)
|
|
140
|
+
// → { deviceCode, userCode, verificationUri, verificationUriComplete, expiresIn, interval }
|
|
141
|
+
|
|
142
|
+
// Poll for device token approval
|
|
143
|
+
const tokenConfig = await manager.pollDeviceToken(deviceCode, interval, expiresIn, clientId, clientSecret)
|
|
144
|
+
// → WebexConfig
|
|
145
|
+
|
|
146
|
+
// Clear all stored credentials (deletes the file)
|
|
147
|
+
await manager.clearCredentials()
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Types
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
import type {
|
|
154
|
+
WebexSpace,
|
|
155
|
+
WebexMessage,
|
|
156
|
+
WebexPerson,
|
|
157
|
+
WebexMembership,
|
|
158
|
+
WebexConfig,
|
|
159
|
+
} from 'agent-messenger/webex'
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Zod Schemas
|
|
163
|
+
|
|
164
|
+
Runtime-validated schemas are also exported for parsing API responses:
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
import {
|
|
168
|
+
WebexSpaceSchema,
|
|
169
|
+
WebexMessageSchema,
|
|
170
|
+
WebexPersonSchema,
|
|
171
|
+
WebexMembershipSchema,
|
|
172
|
+
WebexConfigSchema,
|
|
173
|
+
} from 'agent-messenger/webex'
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Examples
|
|
177
|
+
|
|
178
|
+
### Deploy Notifier
|
|
179
|
+
|
|
180
|
+
Post a deployment message, then update it when done.
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
import { WebexClient } from 'agent-messenger/webex'
|
|
184
|
+
|
|
185
|
+
const client = await new WebexClient().login()
|
|
186
|
+
|
|
187
|
+
// Post initial status
|
|
188
|
+
const msg = await client.sendMessage(spaceId, 'Deploying v2.1.0 to production...')
|
|
189
|
+
|
|
190
|
+
// Stream progress
|
|
191
|
+
await client.sendMessage(spaceId, 'Building application...')
|
|
192
|
+
await client.sendMessage(spaceId, 'Running tests (142 passed)...')
|
|
193
|
+
await client.sendMessage(spaceId, 'Rolling out to 3 regions...')
|
|
194
|
+
|
|
195
|
+
// Update original message with final status
|
|
196
|
+
await client.editMessage(msg.id, spaceId, 'Deployed v2.1.0 to production')
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Space Monitor
|
|
200
|
+
|
|
201
|
+
List spaces and pull recent messages from each one.
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
import { WebexClient } from 'agent-messenger/webex'
|
|
205
|
+
|
|
206
|
+
const client = await new WebexClient().login()
|
|
207
|
+
|
|
208
|
+
const spaces = await client.listSpaces({ type: 'group', max: 10 })
|
|
209
|
+
|
|
210
|
+
for (const space of spaces) {
|
|
211
|
+
const messages = await client.listMessages(space.id, { max: 5 })
|
|
212
|
+
console.log(`${space.title} (${messages.length} recent messages)`)
|
|
213
|
+
|
|
214
|
+
for (const msg of messages) {
|
|
215
|
+
console.log(` [${msg.personEmail}] ${(msg.text ?? '').slice(0, 80)}`)
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Workspace Summary
|
|
221
|
+
|
|
222
|
+
Build a snapshot-style overview: spaces, members, and latest activity.
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
import { WebexClient } from 'agent-messenger/webex'
|
|
226
|
+
|
|
227
|
+
const client = await new WebexClient().login()
|
|
228
|
+
|
|
229
|
+
const spaces = await client.listSpaces()
|
|
230
|
+
console.log(`Total spaces: ${spaces.length}`)
|
|
231
|
+
|
|
232
|
+
for (const space of spaces.slice(0, 5)) {
|
|
233
|
+
const members = await client.listMemberships(space.id)
|
|
234
|
+
const messages = await client.listMessages(space.id, { max: 1 })
|
|
235
|
+
const latest = messages[0]
|
|
236
|
+
|
|
237
|
+
console.log(`${space.title} (${members.length} members)`)
|
|
238
|
+
if (latest) {
|
|
239
|
+
console.log(` Latest: "${(latest.text ?? '').slice(0, 60)}" — ${latest.personEmail}`)
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Direct Message Pipeline
|
|
245
|
+
|
|
246
|
+
Send a DM to multiple people by email.
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
import { WebexClient } from 'agent-messenger/webex'
|
|
250
|
+
|
|
251
|
+
const client = await new WebexClient().login()
|
|
252
|
+
|
|
253
|
+
const recipients = ['alice@example.com', 'bob@example.com', 'carol@example.com']
|
|
254
|
+
|
|
255
|
+
for (const email of recipients) {
|
|
256
|
+
await client.sendDirectMessage(email, 'Reminder: standup in 5 minutes')
|
|
257
|
+
// Respect rate limits
|
|
258
|
+
await new Promise((r) => setTimeout(r, 200))
|
|
259
|
+
}
|
|
260
|
+
```
|
|
@@ -4,11 +4,11 @@ description: A unified terminal interface for all your messaging platforms in on
|
|
|
4
4
|
icon: Monitor
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
> **Experimental** — The TUI is a showcase of what's possible with Agent Messenger's SDK. It's not intended for production use, but demonstrates the power of having a unified adapter layer across
|
|
7
|
+
> **Experimental** — The TUI is a showcase of what's possible with Agent Messenger's SDK. It's not intended for production use, but demonstrates the power of having a unified adapter layer across 10 messaging platforms.
|
|
8
8
|
|
|
9
9
|
## What Is It?
|
|
10
10
|
|
|
11
|
-
The TUI (Terminal User Interface) is a `blessed`-based interactive terminal app that unifies all your messaging platforms into a single screen. Navigate between Slack, Discord, Teams, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, and Channel Talk — all from your terminal.
|
|
11
|
+
The TUI (Terminal User Interface) is a `blessed`-based interactive terminal app that unifies all your messaging platforms into a single screen. Navigate between Slack, Discord, Teams, Webex, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, and Channel Talk — all from your terminal.
|
|
12
12
|
|
|
13
13
|

|
|
14
14
|
|
|
@@ -30,7 +30,7 @@ The TUI has three navigation levels and three input modes.
|
|
|
30
30
|
|
|
31
31
|
| Level | What it shows | How to enter |
|
|
32
32
|
| --- | --- | --- |
|
|
33
|
-
| **Platform** | All
|
|
33
|
+
| **Platform** | All 10 platforms with online/offline status | Launch or press `Esc` from workspace level |
|
|
34
34
|
| **Workspace** | Workspaces for the selected platform (skipped if only one) | Select a platform |
|
|
35
35
|
| **Channel** | Channels in the current workspace | Select a workspace |
|
|
36
36
|
|
|
@@ -125,6 +125,7 @@ src/tui/
|
|
|
125
125
|
│ ├── slack-adapter.ts
|
|
126
126
|
│ ├── discord-adapter.ts
|
|
127
127
|
│ ├── teams-adapter.ts
|
|
128
|
+
│ ├── webex-adapter.ts
|
|
128
129
|
│ ├── telegram-adapter.ts
|
|
129
130
|
│ ├── whatsapp-adapter.ts
|
|
130
131
|
│ ├── line-adapter.ts
|
package/docs/src/app/page.tsx
CHANGED
|
@@ -648,8 +648,8 @@ export default function Home() {
|
|
|
648
648
|
|
|
649
649
|
{/* Subtitle */}
|
|
650
650
|
<p className="mx-auto mt-6 max-w-2xl text-lg leading-relaxed text-zinc-600 dark:text-zinc-400">
|
|
651
|
-
One CLI for Slack, Discord, Teams, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, and Channel Talk.
|
|
652
|
-
Credentials extracted from desktop apps or authenticated in seconds — no API keys, no
|
|
651
|
+
One CLI for Slack, Discord, Teams, Webex, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, and Channel Talk.
|
|
652
|
+
Credentials extracted from desktop apps or authenticated in seconds — no API keys, no admin approval.
|
|
653
653
|
</p>
|
|
654
654
|
|
|
655
655
|
{/* CTAs with glass treatment in dark mode */}
|
package/e2e/README.md
CHANGED
|
@@ -20,14 +20,24 @@ Before running E2E tests, you need:
|
|
|
20
20
|
|
|
21
21
|
## Test Infrastructure
|
|
22
22
|
|
|
23
|
-
| File
|
|
24
|
-
|
|
|
25
|
-
| `config.ts`
|
|
26
|
-
| `helpers.ts`
|
|
27
|
-
| `slack.e2e.test.ts`
|
|
28
|
-
| `slackbot.e2e.test.ts`
|
|
29
|
-
| `discord.e2e.test.ts`
|
|
30
|
-
| `
|
|
23
|
+
| File | Description |
|
|
24
|
+
| ------------------------- | -------------------------------------------------- |
|
|
25
|
+
| `config.ts` | Hardcoded test workspace/server IDs and validation |
|
|
26
|
+
| `helpers.ts` | CLI runner, JSON parser, message cleanup utilities |
|
|
27
|
+
| `slack.e2e.test.ts` | Slack command tests |
|
|
28
|
+
| `slackbot.e2e.test.ts` | SlackBot command tests |
|
|
29
|
+
| `discord.e2e.test.ts` | Discord command tests |
|
|
30
|
+
| `discordbot.e2e.test.ts` | DiscordBot command tests |
|
|
31
|
+
| `teams.e2e.test.ts` | Teams command tests |
|
|
32
|
+
| `webex.e2e.test.ts` | Webex command tests |
|
|
33
|
+
| `telegram.e2e.test.ts` | Telegram command tests |
|
|
34
|
+
| `whatsapp.e2e.test.ts` | WhatsApp command tests |
|
|
35
|
+
| `whatsappbot.e2e.test.ts` | WhatsApp Bot command tests |
|
|
36
|
+
| `line.e2e.test.ts` | LINE command tests |
|
|
37
|
+
| `instagram.e2e.test.ts` | Instagram command tests |
|
|
38
|
+
| `kakaotalk.e2e.test.ts` | KakaoTalk command tests |
|
|
39
|
+
| `channeltalk.e2e.test.ts` | Channel Talk command tests |
|
|
40
|
+
| `channeltalkbot.e2e.test.ts` | Channel Talk Bot command tests |
|
|
31
41
|
|
|
32
42
|
## Running E2E Tests Locally
|
|
33
43
|
|
|
@@ -211,6 +221,120 @@ When triggering manually, you can select which platform to test:
|
|
|
211
221
|
|
|
212
222
|
> ⚠️ Teams tests require `E2E_TEAMS_TEAM_ID` and `E2E_TEAMS_CHANNEL_ID` environment variables. Teams tokens expire in 60-90 minutes.
|
|
213
223
|
|
|
224
|
+
### DiscordBot Tests
|
|
225
|
+
|
|
226
|
+
| Command Group | Tests |
|
|
227
|
+
| ------------- | ------------------------------------------------ |
|
|
228
|
+
| `auth` | status |
|
|
229
|
+
| `message` | send, list, get, update, delete, thread, replies |
|
|
230
|
+
| `channel` | list, info |
|
|
231
|
+
| `user` | list, info |
|
|
232
|
+
| `reaction` | add, remove |
|
|
233
|
+
| `server` | list, current |
|
|
234
|
+
|
|
235
|
+
### Webex Tests
|
|
236
|
+
|
|
237
|
+
| Command Group | Tests |
|
|
238
|
+
| ------------- | -------------------------------------------- |
|
|
239
|
+
| `auth` | status |
|
|
240
|
+
| `message` | send, list, get, delete, edit |
|
|
241
|
+
| `space` | list, info |
|
|
242
|
+
| `member` | list |
|
|
243
|
+
| `snapshot` | default, --spaces-only, --members-only |
|
|
244
|
+
|
|
245
|
+
> ⚠️ Webex tests require `E2E_WEBEX_SPACE_ID`. Optionally set `E2E_WEBEX_DM_EMAIL` for DM tests.
|
|
246
|
+
|
|
247
|
+
### Telegram Tests
|
|
248
|
+
|
|
249
|
+
| Command Group | Tests |
|
|
250
|
+
| ------------- | -------------------- |
|
|
251
|
+
| `auth` | status, list |
|
|
252
|
+
| `chat` | list, search, get |
|
|
253
|
+
| `message` | send, list |
|
|
254
|
+
|
|
255
|
+
> ⚠️ Telegram tests require `E2E_TELEGRAM_CHAT_ID`.
|
|
256
|
+
|
|
257
|
+
### WhatsApp Tests
|
|
258
|
+
|
|
259
|
+
| Command Group | Tests |
|
|
260
|
+
| ------------- | -------------------- |
|
|
261
|
+
| `auth` | status, list |
|
|
262
|
+
| `chat` | list, search |
|
|
263
|
+
| `message` | send, list, react |
|
|
264
|
+
|
|
265
|
+
> ⚠️ WhatsApp tests require `E2E_WHATSAPP_CHAT_ID`.
|
|
266
|
+
|
|
267
|
+
### WhatsApp Bot Tests
|
|
268
|
+
|
|
269
|
+
| Command Group | Tests |
|
|
270
|
+
| ------------- | -------------------- |
|
|
271
|
+
| `auth` | status, list |
|
|
272
|
+
| `message` | send |
|
|
273
|
+
| `template` | list, get |
|
|
274
|
+
|
|
275
|
+
> ⚠️ WhatsApp Bot tests require `E2E_WHATSAPPBOT_PHONE_NUMBER`.
|
|
276
|
+
|
|
277
|
+
### LINE Tests
|
|
278
|
+
|
|
279
|
+
| Command Group | Tests |
|
|
280
|
+
| ------------- | -------------------- |
|
|
281
|
+
| `auth` | status, list |
|
|
282
|
+
| `chat` | list |
|
|
283
|
+
| `friend` | list |
|
|
284
|
+
| `message` | send, list |
|
|
285
|
+
| `profile` | (top-level command) |
|
|
286
|
+
|
|
287
|
+
> ⚠️ LINE tests require `E2E_LINE_CHAT_ID`.
|
|
288
|
+
|
|
289
|
+
### Instagram Tests
|
|
290
|
+
|
|
291
|
+
| Command Group | Tests |
|
|
292
|
+
| ------------- | --------------------------------------- |
|
|
293
|
+
| `auth` | status, list |
|
|
294
|
+
| `chat` | list, search |
|
|
295
|
+
| `message` | send, list, send-to\*, search, search-users |
|
|
296
|
+
|
|
297
|
+
\* `message send-to` requires `E2E_INSTAGRAM_USERNAME` to be set.
|
|
298
|
+
|
|
299
|
+
> ⚠️ Instagram tests require `E2E_INSTAGRAM_THREAD_ID`. Optionally set `E2E_INSTAGRAM_USERNAME` for send-to tests.
|
|
300
|
+
|
|
301
|
+
### KakaoTalk Tests
|
|
302
|
+
|
|
303
|
+
| Command Group | Tests |
|
|
304
|
+
| ------------- | -------------------- |
|
|
305
|
+
| `auth` | status, list |
|
|
306
|
+
| `chat` | list, list --search |
|
|
307
|
+
| `message` | send, list |
|
|
308
|
+
|
|
309
|
+
> ⚠️ KakaoTalk tests require `E2E_KAKAOTALK_CHAT_ID`.
|
|
310
|
+
|
|
311
|
+
### Channel Talk Tests
|
|
312
|
+
|
|
313
|
+
| Command Group | Tests |
|
|
314
|
+
| ------------- | --------------------------------- |
|
|
315
|
+
| `auth` | status, list |
|
|
316
|
+
| `group` | list, get, messages |
|
|
317
|
+
| `message` | send, list, get |
|
|
318
|
+
| `chat` | list |
|
|
319
|
+
| `manager` | list |
|
|
320
|
+
| `bot` | list |
|
|
321
|
+
| `snapshot` | default |
|
|
322
|
+
|
|
323
|
+
> ⚠️ Channel Talk tests require `E2E_CHANNEL_WORKSPACE_ID`.
|
|
324
|
+
|
|
325
|
+
### Channel Talk Bot Tests
|
|
326
|
+
|
|
327
|
+
| Command Group | Tests |
|
|
328
|
+
| ------------- | --------------------------------- |
|
|
329
|
+
| `auth` | status |
|
|
330
|
+
| `group` | list, get (by id), get (by @name), messages |
|
|
331
|
+
| `message` | send, list, get |
|
|
332
|
+
| `manager` | list, get |
|
|
333
|
+
| `bot` | list |
|
|
334
|
+
| `snapshot` | default |
|
|
335
|
+
|
|
336
|
+
> ⚠️ Channel Talk Bot tests require `E2E_CHANNELBOT_WORKSPACE_ID`.
|
|
337
|
+
|
|
214
338
|
## Troubleshooting
|
|
215
339
|
|
|
216
340
|
### "Wrong workspace" / "Wrong server" Error
|
|
@@ -11,14 +11,9 @@ let testGroupName = ''
|
|
|
11
11
|
|
|
12
12
|
describe('Channel E2E Tests', () => {
|
|
13
13
|
beforeAll(async () => {
|
|
14
|
-
if (!CHANNEL_TEST_WORKSPACE_ID) {
|
|
15
|
-
console.warn(
|
|
16
|
-
'Skipping Channel E2E: set E2E_CHANNEL_WORKSPACE_ID to run against a dedicated test workspace.',
|
|
17
|
-
)
|
|
18
|
-
return
|
|
19
|
-
}
|
|
20
|
-
|
|
21
14
|
const group = await validateChannelEnvironment()
|
|
15
|
+
if (!group) return
|
|
16
|
+
|
|
22
17
|
testGroupId = group.groupId
|
|
23
18
|
testGroupName = group.groupName
|
|
24
19
|
|
|
@@ -13,13 +13,9 @@ let testGroupName = ''
|
|
|
13
13
|
|
|
14
14
|
describe('ChannelBot E2E Tests', () => {
|
|
15
15
|
beforeAll(async () => {
|
|
16
|
-
if (!CHANNELBOT_TEST_WORKSPACE_ID) {
|
|
17
|
-
console.warn(
|
|
18
|
-
'Skipping ChannelBot E2E: set E2E_CHANNELBOT_WORKSPACE_ID to run against a dedicated test workspace.',
|
|
19
|
-
)
|
|
20
|
-
return
|
|
21
|
-
}
|
|
22
16
|
const group = await validateChannelBotEnvironment()
|
|
17
|
+
if (!group) return
|
|
18
|
+
|
|
23
19
|
testGroupId = group.groupId
|
|
24
20
|
testGroupName = group.groupName
|
|
25
21
|
channelbotAvailable = true
|