agent-messenger 2.21.0 → 2.23.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/plugin.json +1 -1
- package/README.md +21 -0
- package/dist/package.json +1 -1
- package/dist/src/platforms/webex/client.d.ts +25 -0
- package/dist/src/platforms/webex/client.d.ts.map +1 -1
- package/dist/src/platforms/webex/client.js +115 -5
- package/dist/src/platforms/webex/client.js.map +1 -1
- package/dist/src/platforms/webex/commands/auth.d.ts +9 -1
- package/dist/src/platforms/webex/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/auth.js +141 -25
- package/dist/src/platforms/webex/commands/auth.js.map +1 -1
- package/dist/src/platforms/webex/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/webex/credential-manager.js +8 -4
- package/dist/src/platforms/webex/credential-manager.js.map +1 -1
- package/dist/src/platforms/webex/id-normalizer.d.ts +19 -0
- package/dist/src/platforms/webex/id-normalizer.d.ts.map +1 -0
- package/dist/src/platforms/webex/id-normalizer.js +60 -0
- package/dist/src/platforms/webex/id-normalizer.js.map +1 -0
- package/dist/src/platforms/webex/index.d.ts +4 -0
- package/dist/src/platforms/webex/index.d.ts.map +1 -1
- package/dist/src/platforms/webex/index.js +2 -0
- package/dist/src/platforms/webex/index.js.map +1 -1
- package/dist/src/platforms/webex/listener.d.ts +61 -0
- package/dist/src/platforms/webex/listener.d.ts.map +1 -0
- package/dist/src/platforms/webex/listener.js +222 -0
- package/dist/src/platforms/webex/listener.js.map +1 -0
- package/dist/src/platforms/webex/password-login.d.ts +18 -0
- package/dist/src/platforms/webex/password-login.d.ts.map +1 -0
- package/dist/src/platforms/webex/password-login.js +259 -0
- package/dist/src/platforms/webex/password-login.js.map +1 -0
- package/dist/src/platforms/webex/types.d.ts +2 -1
- package/dist/src/platforms/webex/types.d.ts.map +1 -1
- package/dist/src/platforms/webex/types.js +1 -1
- package/dist/src/platforms/webex/types.js.map +1 -1
- package/dist/src/platforms/webex/wdm-discovery.d.ts.map +1 -0
- package/dist/src/platforms/{webexbot → webex}/wdm-discovery.js +3 -3
- package/dist/src/platforms/webex/wdm-discovery.js.map +1 -0
- package/dist/src/platforms/webexbot/cli.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/cli.js +4 -1
- package/dist/src/platforms/webexbot/cli.js.map +1 -1
- package/dist/src/platforms/webexbot/client.d.ts +24 -0
- package/dist/src/platforms/webexbot/client.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/client.js +81 -5
- package/dist/src/platforms/webexbot/client.js.map +1 -1
- package/dist/src/platforms/webexbot/commands/file.d.ts +22 -0
- package/dist/src/platforms/webexbot/commands/file.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/file.js +64 -0
- package/dist/src/platforms/webexbot/commands/file.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/index.d.ts +3 -0
- package/dist/src/platforms/webexbot/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/commands/index.js +3 -0
- package/dist/src/platforms/webexbot/commands/index.js.map +1 -1
- package/dist/src/platforms/webexbot/commands/message.d.ts +7 -0
- package/dist/src/platforms/webexbot/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/commands/message.js +52 -1
- package/dist/src/platforms/webexbot/commands/message.js.map +1 -1
- package/dist/src/platforms/webexbot/commands/snapshot.d.ts +24 -0
- package/dist/src/platforms/webexbot/commands/snapshot.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/snapshot.js +37 -0
- package/dist/src/platforms/webexbot/commands/snapshot.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/user.d.ts +30 -0
- package/dist/src/platforms/webexbot/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/user.js +66 -0
- package/dist/src/platforms/webexbot/commands/user.js.map +1 -0
- package/dist/src/platforms/webexbot/index.d.ts +2 -0
- package/dist/src/platforms/webexbot/index.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/index.js +1 -0
- package/dist/src/platforms/webexbot/index.js.map +1 -1
- package/dist/src/platforms/webexbot/listener.d.ts +3 -41
- package/dist/src/platforms/webexbot/listener.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/listener.js +13 -208
- package/dist/src/platforms/webexbot/listener.js.map +1 -1
- package/dist/src/platforms/webexbot/types.d.ts +1 -18
- package/dist/src/platforms/webexbot/types.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/types.js.map +1 -1
- package/docs/content/docs/cli/webex.mdx +38 -12
- package/docs/content/docs/cli/webexbot.mdx +2 -0
- package/docs/content/docs/sdk/webexbot.mdx +18 -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-instagram/SKILL.md +1 -1
- 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 +1 -1
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-telegrambot/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +76 -22
- package/skills/agent-webex/references/authentication.md +55 -14
- package/skills/agent-webex/references/common-patterns.md +5 -2
- package/skills/agent-webexbot/SKILL.md +60 -5
- package/skills/agent-webexbot/references/common-patterns.md +118 -0
- 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/webex/cli.test.ts +31 -1
- package/src/platforms/webex/client.test.ts +67 -0
- package/src/platforms/webex/client.ts +136 -7
- package/src/platforms/webex/commands/auth.test.ts +189 -28
- package/src/platforms/webex/commands/auth.ts +194 -35
- package/src/platforms/webex/credential-manager.test.ts +40 -0
- package/src/platforms/webex/credential-manager.ts +7 -4
- package/src/platforms/webex/id-normalizer.test.ts +207 -0
- package/src/platforms/webex/id-normalizer.ts +76 -0
- package/src/platforms/webex/index.test.ts +6 -0
- package/src/platforms/webex/index.ts +4 -0
- package/src/platforms/webex/listener.test.ts +243 -0
- package/src/platforms/webex/listener.ts +285 -0
- package/src/platforms/webex/password-login.test.ts +193 -0
- package/src/platforms/webex/password-login.ts +332 -0
- package/src/platforms/webex/types.test.ts +16 -0
- package/src/platforms/webex/types.ts +2 -2
- package/src/platforms/{webexbot → webex}/wdm-discovery.ts +3 -3
- package/src/platforms/webexbot/cli.ts +6 -0
- package/src/platforms/webexbot/client.test.ts +322 -0
- package/src/platforms/webexbot/client.ts +104 -7
- package/src/platforms/webexbot/commands/file.ts +104 -0
- package/src/platforms/webexbot/commands/index.ts +3 -0
- package/src/platforms/webexbot/commands/message.ts +68 -2
- package/src/platforms/webexbot/commands/snapshot.ts +60 -0
- package/src/platforms/webexbot/commands/user.test.ts +77 -0
- package/src/platforms/webexbot/commands/user.ts +98 -0
- package/src/platforms/webexbot/index.ts +2 -0
- package/src/platforms/webexbot/listener.test.ts +37 -224
- package/src/platforms/webexbot/listener.ts +18 -250
- package/src/platforms/webexbot/types.ts +2 -23
- package/dist/src/platforms/webexbot/wdm-discovery.d.ts.map +0 -1
- package/dist/src/platforms/webexbot/wdm-discovery.js.map +0 -1
- /package/dist/src/platforms/{webexbot → webex}/wdm-discovery.d.ts +0 -0
- /package/src/platforms/{webexbot → webex}/wdm-discovery.test.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-webex
|
|
3
3
|
description: Interact with Cisco Webex - send messages, read spaces, manage memberships
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.23.0
|
|
5
5
|
allowed-tools: Bash(agent-webex:*)
|
|
6
6
|
metadata:
|
|
7
7
|
openclaw:
|
|
@@ -16,7 +16,7 @@ metadata:
|
|
|
16
16
|
|
|
17
17
|
# Agent Webex
|
|
18
18
|
|
|
19
|
-
A TypeScript CLI tool that enables AI agents and humans to interact with Cisco Webex through a simple command interface. Supports browser token extraction (zero-config, sends as you) and OAuth Device Grant flow.
|
|
19
|
+
A TypeScript CLI tool that enables AI agents and humans to interact with Cisco Webex through a simple command interface. Supports browser token extraction (zero-config, sends as you), headless password login, and OAuth Device Grant flow.
|
|
20
20
|
|
|
21
21
|
## Quick Start
|
|
22
22
|
|
|
@@ -24,8 +24,12 @@ A TypeScript CLI tool that enables AI agents and humans to interact with Cisco W
|
|
|
24
24
|
# Extract token from browser (Chrome, Edge, Arc, Brave) — messages appear as you
|
|
25
25
|
agent-webex auth extract
|
|
26
26
|
|
|
27
|
-
# Or: Log in
|
|
27
|
+
# Or: Log in with email/password — messages appear as you (prompts when flags are omitted)
|
|
28
28
|
agent-webex auth login
|
|
29
|
+
printf '%s' '<password>' | agent-webex auth login --email <email> --password-stdin
|
|
30
|
+
|
|
31
|
+
# Or: Log in via OAuth Device Grant (opens browser, messages show "via agent-messenger")
|
|
32
|
+
agent-webex auth oauth
|
|
29
33
|
|
|
30
34
|
# Get workspace snapshot
|
|
31
35
|
agent-webex snapshot
|
|
@@ -39,10 +43,11 @@ agent-webex space list
|
|
|
39
43
|
|
|
40
44
|
## Authentication
|
|
41
45
|
|
|
42
|
-
Webex supports
|
|
46
|
+
Webex supports three authentication methods:
|
|
43
47
|
|
|
44
|
-
1. **Browser token extraction** (recommended): Extracts your first-party token from a Chromium browser where you're logged into web.webex.com. Messages appear as you — no "via" label.
|
|
45
|
-
2. **
|
|
48
|
+
1. **Browser token extraction** (`auth extract`, recommended): Extracts your first-party token from a Chromium browser where you're logged into web.webex.com. Messages appear as you — no "via" label.
|
|
49
|
+
2. **Email/password login** (`auth login`): Exchanges Webex email/password for a first-party web token without opening a browser. Run `auth login` with no flags to be prompted, or pass `--email`/`--password-stdin` for headless use. Messages appear as you. Not supported for SSO/MFA accounts.
|
|
50
|
+
3. **OAuth Device Grant** (`auth oauth`): Opens a browser for you to authorize. Messages show "via agent-messenger" label.
|
|
46
51
|
|
|
47
52
|
### Browser Token Extraction (Recommended)
|
|
48
53
|
|
|
@@ -68,15 +73,32 @@ agent-webex auth extract --browser-profile ~/work-profile --browser-profile ~/pe
|
|
|
68
73
|
|
|
69
74
|
**When to re-extract**: Browser tokens expire. When your token expires, re-run `agent-webex auth extract` or let auto-extraction handle it (the CLI attempts extraction automatically on each run).
|
|
70
75
|
|
|
76
|
+
### Email/Password Login
|
|
77
|
+
|
|
78
|
+
`agent-webex auth login` logs you in with your Webex email and password. Run it with no flags in a terminal to be prompted for your email and then your password (the password is read without echoing). Use email/password login when no browser profile is available and the account does not require SSO or MFA.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Interactive — prompts for email, then password (hidden input)
|
|
82
|
+
agent-webex auth login
|
|
83
|
+
|
|
84
|
+
# Headless — provide the email and pipe the password from stdin (keeps it out of shell history)
|
|
85
|
+
printf '%s' '<password>' | agent-webex auth login --email <email> --password-stdin
|
|
86
|
+
|
|
87
|
+
# Provide the email only — the password is prompted securely when omitted
|
|
88
|
+
agent-webex auth login --email <email>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
This stores a refreshable first-party web token locally and supports encrypted messaging through the internal Webex API. Pass `--token <bot-or-personal-access-token>` to log in with a bot token or PAT instead.
|
|
92
|
+
|
|
71
93
|
### OAuth Device Grant (Fallback)
|
|
72
94
|
|
|
73
|
-
`agent-webex auth
|
|
95
|
+
`agent-webex auth oauth` starts the Device Grant flow: it displays a verification URL and user code, then opens the browser. You enter the code at the verification page and approve access. The CLI polls for the token automatically. Access and refresh tokens are stored locally, and the access token auto-refreshes via the refresh token.
|
|
74
96
|
|
|
75
97
|
Note: Messages sent via OAuth Device Grant show "via agent-messenger" because the token is associated with a third-party Webex Integration.
|
|
76
98
|
|
|
77
|
-
Optionally, pass `--
|
|
99
|
+
Optionally, pass `--client-id <id> --client-secret <secret>` to use your own Webex Integration credentials instead of the built-in ones.
|
|
78
100
|
|
|
79
|
-
**For AI agents (non-TTY)**: `agent-webex auth
|
|
101
|
+
**For AI agents (non-TTY)**: `agent-webex auth oauth` exposes the OAuth Device Grant flow as a stateless two-call sequence — no hangs, no polling loops, no on-disk state. Just structured JSON every time.
|
|
80
102
|
|
|
81
103
|
**Call 1** (no `--device-code` passed): the command requests a device code from Webex and returns immediately:
|
|
82
104
|
|
|
@@ -98,23 +120,28 @@ Show the user `verification_uri_complete` (or `verification_uri` + `user_code`)
|
|
|
98
120
|
|
|
99
121
|
- **Success** — returns `{ "authenticated": true, "user": { ... } }`, exit 0.
|
|
100
122
|
- **Still pending** — returns `{ "next_action": "still_pending", "device_code": "...", ... }`, exit 0. The user has not approved yet; confirm with them and retry with the same `--device-code` value.
|
|
101
|
-
- **Expired / failed** — returns `{ "next_action": "restart", "error": "..." }`, exit 1. The device code is no longer usable; start over with another `agent-webex auth
|
|
123
|
+
- **Expired / failed** — returns `{ "next_action": "restart", "error": "..." }`, exit 1. The device code is no longer usable; start over with another `agent-webex auth oauth` (no flags) to get a fresh one.
|
|
102
124
|
|
|
103
125
|
If you passed `--client-id` / `--client-secret` (custom Webex Integration) on Call 1, pass them again on Call 2.
|
|
104
126
|
|
|
105
127
|
Alternatives that skip the Device Grant flow entirely:
|
|
106
128
|
|
|
107
129
|
- `agent-webex auth login --token <bot-or-personal-access-token>` — fully unattended, no human required.
|
|
130
|
+
- `agent-webex auth login --email <email> --password-stdin` — headless first-party login for non-SSO, non-MFA accounts.
|
|
108
131
|
- `agent-webex auth extract` — read an existing browser session token (no auth flow at all).
|
|
109
132
|
|
|
110
133
|
Env vars `AGENT_WEBEX_CLIENT_ID` / `AGENT_WEBEX_CLIENT_SECRET` can also override the built-in credentials.
|
|
111
134
|
|
|
112
135
|
```bash
|
|
113
|
-
# Log in (
|
|
136
|
+
# Log in with email/password (prompts when flags are omitted)
|
|
114
137
|
agent-webex auth login
|
|
138
|
+
printf '%s' '<password>' | agent-webex auth login --email <email> --password-stdin
|
|
139
|
+
|
|
140
|
+
# Log in via OAuth Device Grant (opens browser)
|
|
141
|
+
agent-webex auth oauth
|
|
115
142
|
|
|
116
|
-
# Log in with custom Integration credentials
|
|
117
|
-
agent-webex auth
|
|
143
|
+
# Log in via OAuth with custom Integration credentials
|
|
144
|
+
agent-webex auth oauth --client-id <id> --client-secret <secret>
|
|
118
145
|
|
|
119
146
|
# Log in with a bot token
|
|
120
147
|
agent-webex auth login --token <token>
|
|
@@ -129,11 +156,12 @@ agent-webex auth logout
|
|
|
129
156
|
### Token Types
|
|
130
157
|
|
|
131
158
|
- **Extracted (browser)**: First-party token from web.webex.com. Messages appear as you. Requires re-extraction when expired.
|
|
159
|
+
- **Password**: First-party web token from headless email/password login. Messages appear as you. Not supported for SSO/MFA accounts.
|
|
132
160
|
- **OAuth Device Grant**: Zero-config login. Access token auto-refreshes. Messages show "via agent-messenger".
|
|
133
161
|
- **Bot Token**: Pass via `--token` flag. Never expires. Best for CI/CD.
|
|
134
162
|
- **Custom Integration**: Pass `--client-id` + `--client-secret` or set env vars for your own Webex Integration.
|
|
135
163
|
|
|
136
|
-
**IMPORTANT**: NEVER guide the user to open a web browser, use DevTools, or manually copy tokens from a browser's network inspector. Always use `agent-webex auth extract` or `agent-webex auth
|
|
164
|
+
**IMPORTANT**: NEVER guide the user to open a web browser, use DevTools, or manually copy tokens from a browser's network inspector. Always use `agent-webex auth extract`, `agent-webex auth login`, or `agent-webex auth oauth` for authentication.
|
|
137
165
|
|
|
138
166
|
For detailed token management, see [references/authentication.md](references/authentication.md).
|
|
139
167
|
|
|
@@ -209,15 +237,19 @@ If a memorized ID returns an error (space not found, member not found), remove i
|
|
|
209
237
|
### Auth Commands
|
|
210
238
|
|
|
211
239
|
```bash
|
|
212
|
-
# Log in (
|
|
240
|
+
# Log in with email/password (prompts when flags are omitted)
|
|
213
241
|
agent-webex auth login
|
|
214
|
-
|
|
215
|
-
# Log in with custom Integration credentials
|
|
216
|
-
agent-webex auth login --client-id <id> --client-secret <secret>
|
|
242
|
+
printf '%s' '<password>' | agent-webex auth login --email <email> --password-stdin
|
|
217
243
|
|
|
218
244
|
# Log in with a bot token
|
|
219
245
|
agent-webex auth login --token <token>
|
|
220
246
|
|
|
247
|
+
# Log in via OAuth Device Grant (opens browser)
|
|
248
|
+
agent-webex auth oauth
|
|
249
|
+
|
|
250
|
+
# Log in via OAuth with custom Integration credentials
|
|
251
|
+
agent-webex auth oauth --client-id <id> --client-secret <secret>
|
|
252
|
+
|
|
221
253
|
# Check auth status
|
|
222
254
|
agent-webex auth status
|
|
223
255
|
|
|
@@ -341,7 +373,7 @@ All commands return consistent error format:
|
|
|
341
373
|
Common errors:
|
|
342
374
|
|
|
343
375
|
- `Not authenticated`: No valid token. Run `auth login` first
|
|
344
|
-
- `Device authorization timed out`: User didn't complete verification in time. Run `auth
|
|
376
|
+
- `Device authorization timed out`: User didn't complete verification in time. Run `auth oauth` again.
|
|
345
377
|
- `401 Unauthorized`: Token expired or invalid. Re-run `auth login`
|
|
346
378
|
- `429 Too Many Requests`: Rate limited. Wait and retry (Webex allows ~600 requests per minute)
|
|
347
379
|
- `404 Not Found`: Invalid space ID, message ID, or resource
|
|
@@ -392,13 +424,33 @@ const msg = await client.sendMessage(spaces[0].id, 'Hello from SDK!')
|
|
|
392
424
|
await client.sendMessage(spaces[0].id, '**Status**: All systems go', { markdown: true })
|
|
393
425
|
```
|
|
394
426
|
|
|
427
|
+
### Real-time Events
|
|
428
|
+
|
|
429
|
+
The SDK provides a real-time `WebexListener` backed by Webex Mercury WebSocket.
|
|
430
|
+
|
|
431
|
+
```typescript
|
|
432
|
+
import { WebexClient, WebexListener } from 'agent-messenger/webex'
|
|
433
|
+
|
|
434
|
+
const client = await new WebexClient().login()
|
|
435
|
+
const listener = new WebexListener(client)
|
|
436
|
+
|
|
437
|
+
listener.on('message_created', (event) => {
|
|
438
|
+
console.log(`New message in ${event.roomId}: ${event.text}`)
|
|
439
|
+
})
|
|
440
|
+
|
|
441
|
+
listener.on('membership_created', (event) => {
|
|
442
|
+
console.log(`Membership changed in ${event.roomId}: ${event.personId}`)
|
|
443
|
+
})
|
|
444
|
+
|
|
445
|
+
await listener.start()
|
|
446
|
+
```
|
|
447
|
+
|
|
395
448
|
### Full API Reference
|
|
396
449
|
|
|
397
450
|
See the [Webex SDK documentation](https://agent-messenger.dev/docs/sdk/webex) for complete method signatures, types, schemas, and examples.
|
|
398
451
|
|
|
399
452
|
## Limitations
|
|
400
453
|
|
|
401
|
-
- No real-time events / WebSocket connection
|
|
402
454
|
- No file upload or download
|
|
403
455
|
- No reactions / emoji support
|
|
404
456
|
- No thread support
|
|
@@ -410,10 +462,12 @@ See the [Webex SDK documentation](https://agent-messenger.dev/docs/sdk/webex) fo
|
|
|
410
462
|
|
|
411
463
|
### Token refresh failed
|
|
412
464
|
|
|
413
|
-
OAuth tokens auto-refresh, so expiration is handled automatically. If a refresh fails (revoked access, network issues), re-run:
|
|
465
|
+
OAuth tokens auto-refresh, so expiration is handled automatically. If a refresh fails (revoked access, network issues), re-run the login method you used:
|
|
414
466
|
|
|
415
467
|
```bash
|
|
416
|
-
agent-webex auth
|
|
468
|
+
agent-webex auth oauth # OAuth Device Grant
|
|
469
|
+
agent-webex auth login # email/password
|
|
470
|
+
agent-webex auth extract # browser token
|
|
417
471
|
```
|
|
418
472
|
|
|
419
473
|
Bot tokens never expire and don't need refreshing.
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
agent-webex supports
|
|
5
|
+
agent-webex supports five authentication methods against the Webex REST API (`https://webexapis.com/v1`):
|
|
6
6
|
|
|
7
7
|
1. **Browser Token Extraction**: Extracts your first-party token and cached encryption keys from a Chromium browser where you're logged into web.webex.com. Supports all operations including encrypted messaging via the internal API. Zero-config.
|
|
8
|
-
2. **
|
|
9
|
-
3. **
|
|
10
|
-
4. **
|
|
8
|
+
2. **Email/Password Login**: Run `auth login` to exchange email/password for a first-party web token without opening a browser. Prompts for email and password when omitted (the password is read without echoing), or pass `--email`/`--password-stdin` for headless use. Supports encrypted messaging via the internal API. Not supported for SSO/MFA accounts.
|
|
9
|
+
3. **OAuth Device Grant** (recommended for messaging): Zero-config. Run `auth oauth`, approve in browser, done. Tokens refresh automatically. Supports all operations including sending messages (shows "via agent-messenger").
|
|
10
|
+
4. **Bot Token**: Pass via `auth login --token`. Never expires. Best for CI/CD.
|
|
11
|
+
5. **Personal Access Token (PAT)**: Pass via `auth login --token`. Expires in 12 hours. For quick testing.
|
|
11
12
|
|
|
12
13
|
## Token Types
|
|
13
14
|
|
|
@@ -40,11 +41,31 @@ Use `--browser-profile <path>` for agent-browser profiles, custom Chrome user da
|
|
|
40
41
|
|
|
41
42
|
**Limitations**: Direct messages (`message dm`) require an existing conversation with the recipient. The extracted token cannot create new 1:1 conversations — start one from the Webex app first, then use the CLI.
|
|
42
43
|
|
|
44
|
+
### Email/Password Login
|
|
45
|
+
|
|
46
|
+
Use this when a browser profile is unavailable and the Webex account accepts direct email/password login.
|
|
47
|
+
|
|
48
|
+
- **How it works**: Run `agent-webex auth login`. With no flags in a terminal, the CLI prompts for your email and then your password (read without echoing). For headless use, pass `--email <email> --password-stdin` (or `--email <email>` alone to be prompted only for the password). The CLI performs the Webex web OAuth + PKCE flow headlessly, registers a Webex device, and stores refreshable credentials.
|
|
49
|
+
- **Auto-refresh**: The CLI refreshes expired access tokens using the stored web refresh token.
|
|
50
|
+
- **End-to-end encryption**: Uses the internal Webex API with KMS key fetching, so messages appear as you without the "via" label.
|
|
51
|
+
- **Limitations**: SSO and MFA accounts are not supported by this headless flow.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Interactive — prompts for email, then password (hidden)
|
|
55
|
+
agent-webex auth login
|
|
56
|
+
|
|
57
|
+
# Headless — provide the email and pipe the password from stdin
|
|
58
|
+
printf '%s' '<password>' | agent-webex auth login --email <email> --password-stdin
|
|
59
|
+
|
|
60
|
+
# Provide the email only — password is prompted securely
|
|
61
|
+
agent-webex auth login --email <email>
|
|
62
|
+
```
|
|
63
|
+
|
|
43
64
|
### OAuth Device Grant
|
|
44
65
|
|
|
45
66
|
The fallback authentication method when browser extraction is unavailable. No credentials to copy, no developer portal setup required.
|
|
46
67
|
|
|
47
|
-
- **How it works**: Run `agent-webex auth
|
|
68
|
+
- **How it works**: Run `agent-webex auth oauth`. The CLI requests a device code from Webex, opens your browser, and waits for you to approve. Once approved, access and refresh tokens are stored automatically.
|
|
48
69
|
- **Access token lifetime**: 14 days
|
|
49
70
|
- **Refresh token lifetime**: 90 days
|
|
50
71
|
- **Auto-refresh**: The CLI refreshes expired access tokens automatically using the stored refresh token. No manual intervention needed until the refresh token itself expires (90 days).
|
|
@@ -52,7 +73,7 @@ The fallback authentication method when browser extraction is unavailable. No cr
|
|
|
52
73
|
- **Best for**: Interactive use, development, any scenario where a human can approve via browser
|
|
53
74
|
|
|
54
75
|
```bash
|
|
55
|
-
agent-webex auth
|
|
76
|
+
agent-webex auth oauth
|
|
56
77
|
```
|
|
57
78
|
|
|
58
79
|
The CLI ships with built-in Integration credentials so this works out of the box. You can override them with your own (see [Environment Variables](#environment-variables)).
|
|
@@ -89,11 +110,15 @@ agent-webex auth login --token "YOUR_PAT_HERE"
|
|
|
89
110
|
# Browser extraction (recommended — messages appear as you)
|
|
90
111
|
agent-webex auth extract
|
|
91
112
|
|
|
92
|
-
#
|
|
113
|
+
# Email/password login (messages appear as you; prompts when flags are omitted)
|
|
93
114
|
agent-webex auth login
|
|
115
|
+
printf '%s' '<password>' | agent-webex auth login --email <email> --password-stdin
|
|
116
|
+
|
|
117
|
+
# Device Grant (fallback — messages show "via agent-messenger")
|
|
118
|
+
agent-webex auth oauth
|
|
94
119
|
|
|
95
|
-
#
|
|
96
|
-
agent-webex auth
|
|
120
|
+
# Device Grant with custom Integration credentials
|
|
121
|
+
agent-webex auth oauth --client-id <id> --client-secret <secret>
|
|
97
122
|
|
|
98
123
|
# Bot token
|
|
99
124
|
agent-webex auth login --token <bot-token>
|
|
@@ -177,6 +202,22 @@ OAuth credentials (from Device Grant):
|
|
|
177
202
|
}
|
|
178
203
|
```
|
|
179
204
|
|
|
205
|
+
Password credentials (from `auth login --email`):
|
|
206
|
+
|
|
207
|
+
```json
|
|
208
|
+
{
|
|
209
|
+
"accessToken": "...",
|
|
210
|
+
"refreshToken": "...",
|
|
211
|
+
"expiresAt": 1234567890,
|
|
212
|
+
"clientId": "...",
|
|
213
|
+
"clientSecret": "...",
|
|
214
|
+
"tokenType": "password",
|
|
215
|
+
"deviceUrl": "...",
|
|
216
|
+
"userId": "...",
|
|
217
|
+
"encryptionKeys": {}
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
180
221
|
Manual credentials (from `--token`):
|
|
181
222
|
|
|
182
223
|
```json
|
|
@@ -217,7 +258,7 @@ Browser-extracted tokens have no refresh mechanism — when they expire, re-extr
|
|
|
217
258
|
### OAuth Device Grant
|
|
218
259
|
|
|
219
260
|
```
|
|
220
|
-
auth
|
|
261
|
+
auth oauth -> Device code -> Browser approval -> Access token (14 days) + Refresh token (90 days)
|
|
221
262
|
|
|
|
222
263
|
Token expires
|
|
223
264
|
|
|
|
@@ -225,7 +266,7 @@ auth login -> Device code -> Browser approval -> Access token (14 days) + Refres
|
|
|
225
266
|
|
|
|
226
267
|
Refresh token expires (90 days)
|
|
227
268
|
|
|
|
228
|
-
Re-run "auth
|
|
269
|
+
Re-run "auth oauth"
|
|
229
270
|
```
|
|
230
271
|
|
|
231
272
|
The CLI checks token expiry before each API call and refreshes automatically when needed. You won't notice this happening.
|
|
@@ -255,7 +296,7 @@ Override the built-in Integration credentials with your own:
|
|
|
255
296
|
| `AGENT_WEBEX_CLIENT_ID` | Webex Integration client ID |
|
|
256
297
|
| `AGENT_WEBEX_CLIENT_SECRET` | Webex Integration client secret |
|
|
257
298
|
|
|
258
|
-
Both must be set together. When set, `auth
|
|
299
|
+
Both must be set together. When set, `auth oauth` uses these instead of the built-in credentials.
|
|
259
300
|
|
|
260
301
|
Legacy aliases `AGENT_MESSENGER_WEBEX_CLIENT_ID` and `AGENT_MESSENGER_WEBEX_CLIENT_SECRET` are also supported.
|
|
261
302
|
|
|
@@ -273,7 +314,7 @@ agent-webex auth login
|
|
|
273
314
|
|
|
274
315
|
Token is expired or invalid.
|
|
275
316
|
|
|
276
|
-
**If using Device Grant**: The CLI auto-refreshes tokens, so this usually means the refresh token has expired (after 90 days). Run `agent-webex auth
|
|
317
|
+
**If using Device Grant**: The CLI auto-refreshes tokens, so this usually means the refresh token has expired (after 90 days). Run `agent-webex auth oauth` again.
|
|
277
318
|
|
|
278
319
|
**If using a PAT**: Generate a new one at https://developer.webex.com/docs/getting-started
|
|
279
320
|
|
|
@@ -293,7 +334,7 @@ The device code request was rejected. Possible causes:
|
|
|
293
334
|
|
|
294
335
|
### "Device authorization timed out"
|
|
295
336
|
|
|
296
|
-
You didn't approve the request in the browser before the code expired. Run `auth
|
|
337
|
+
You didn't approve the request in the browser before the code expired. Run `auth oauth` again.
|
|
297
338
|
|
|
298
339
|
### "Token validation failed"
|
|
299
340
|
|
|
@@ -18,9 +18,12 @@ This guide covers typical workflows for AI agents interacting with Cisco Webex u
|
|
|
18
18
|
# Recommended: Browser extraction (zero-config, sends as you, no "via" label)
|
|
19
19
|
agent-webex auth extract
|
|
20
20
|
|
|
21
|
-
#
|
|
21
|
+
# Email/password login (messages appear as you; prompts when flags are omitted)
|
|
22
22
|
agent-webex auth login
|
|
23
23
|
|
|
24
|
+
# Fallback: Device Grant (zero-config, opens browser, shows "via agent-messenger")
|
|
25
|
+
agent-webex auth oauth
|
|
26
|
+
|
|
24
27
|
# With a bot token (never expires, for CI/CD)
|
|
25
28
|
agent-webex auth login --token "YOUR_BOT_TOKEN_HERE"
|
|
26
29
|
|
|
@@ -628,7 +631,7 @@ done
|
|
|
628
631
|
|
|
629
632
|
```bash
|
|
630
633
|
# Best: Device Grant (auto-refreshes, no token management)
|
|
631
|
-
agent-webex auth
|
|
634
|
+
agent-webex auth oauth
|
|
632
635
|
|
|
633
636
|
# Also good: bot token (never expires)
|
|
634
637
|
agent-webex auth login --token "$BOT_TOKEN"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-webexbot
|
|
3
|
-
description: Interact with Cisco Webex using bot tokens - send messages, read spaces, manage memberships, stream real-time events
|
|
4
|
-
version: 2.
|
|
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.23.0
|
|
5
5
|
allowed-tools: Bash(agent-webexbot:*)
|
|
6
6
|
metadata:
|
|
7
7
|
openclaw:
|
|
@@ -172,11 +172,21 @@ agent-webexbot message send <space-id> "Hello world"
|
|
|
172
172
|
# Send a markdown message
|
|
173
173
|
agent-webexbot message send <space-id> "**Bold** and _italic_" --markdown
|
|
174
174
|
|
|
175
|
+
# Reply within a thread (parent message ID)
|
|
176
|
+
agent-webexbot message send <space-id> "Threaded reply" --parent <message-id>
|
|
177
|
+
agent-webexbot message reply <space-id> <parent-message-id> "Threaded reply"
|
|
178
|
+
|
|
179
|
+
# List replies in a thread
|
|
180
|
+
agent-webexbot message replies <space-id> <parent-message-id>
|
|
181
|
+
agent-webexbot message replies <space-id> <parent-message-id> --max 20
|
|
182
|
+
|
|
175
183
|
# Send a direct message by email
|
|
176
184
|
agent-webexbot message dm alice@example.com "Hey, quick question"
|
|
177
185
|
agent-webexbot message dm alice@example.com "**Build failed**" --markdown
|
|
178
186
|
|
|
179
187
|
# List messages in a space
|
|
188
|
+
# In group spaces, Webex only returns messages that mention the bot.
|
|
189
|
+
# Direct-space history is returned normally.
|
|
180
190
|
agent-webexbot message list <space-id>
|
|
181
191
|
agent-webexbot message list <space-id> --max 50
|
|
182
192
|
|
|
@@ -199,6 +209,51 @@ agent-webexbot member list <space-id>
|
|
|
199
209
|
agent-webexbot member list <space-id> --max 100
|
|
200
210
|
```
|
|
201
211
|
|
|
212
|
+
### User Commands
|
|
213
|
+
|
|
214
|
+
Search the Webex people directory and look up person details.
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
# Search people by email (exact) or display name (prefix)
|
|
218
|
+
agent-webexbot user list --email alice@example.com
|
|
219
|
+
agent-webexbot user list --display-name "Alice"
|
|
220
|
+
agent-webexbot user list --display-name "Al" --max 20
|
|
221
|
+
|
|
222
|
+
# Get details for a specific person
|
|
223
|
+
agent-webexbot user info <person-id>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### File Commands
|
|
227
|
+
|
|
228
|
+
Upload local files to a space and download attachments. Max file size is 100 MB; one file per message.
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Upload a local file
|
|
232
|
+
agent-webexbot file upload <space-id> ./report.pdf
|
|
233
|
+
agent-webexbot file upload <space-id> ./report.pdf --text "Latest report"
|
|
234
|
+
agent-webexbot file upload <space-id> ./report.pdf --text "**Done**" --markdown
|
|
235
|
+
|
|
236
|
+
# Upload a file as a threaded reply
|
|
237
|
+
agent-webexbot file upload <space-id> ./report.pdf --parent <message-id>
|
|
238
|
+
|
|
239
|
+
# Download an attachment (content URL comes from a message's "files" array)
|
|
240
|
+
agent-webexbot file download <content-url-or-id>
|
|
241
|
+
agent-webexbot file download <content-url-or-id> ./downloaded-report.pdf
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Snapshot Command
|
|
245
|
+
|
|
246
|
+
Get a workspace overview for AI agents.
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Brief snapshot (bot identity + space IDs/titles)
|
|
250
|
+
agent-webexbot snapshot
|
|
251
|
+
|
|
252
|
+
# Full snapshot (includes space type and last activity)
|
|
253
|
+
agent-webexbot snapshot --full
|
|
254
|
+
agent-webexbot snapshot --full --max 50
|
|
255
|
+
```
|
|
256
|
+
|
|
202
257
|
### Listen Command
|
|
203
258
|
|
|
204
259
|
Stream real-time Webex events over the Mercury WebSocket. No public URL required.
|
|
@@ -226,6 +281,8 @@ Output is NDJSON — one JSON object per line:
|
|
|
226
281
|
{"type":"message_created","payload":{"id":"Y2lz...","text":"Hello bot!","personEmail":"alice@example.com","roomId":"Y2lz..."}}
|
|
227
282
|
```
|
|
228
283
|
|
|
284
|
+
Event IDs (`id`, `parentId`, `messageId`, `roomId`, `personId`, `actorId`, `mentionedPeople`) are emitted as Webex REST IDs (`ciscospark://...` base64), so they compare directly with IDs returned by other `agent-webexbot` commands (`message get`, `space list`, `user list`). The Mercury-only activity IDs `membership_created.id` and `room_created`/`room_updated.id` stay as raw UUIDs; the raw Mercury payload is preserved under `payload.raw` (except for `message_deleted`, whose Mercury event does not carry the full payload).
|
|
285
|
+
|
|
229
286
|
## Output Format
|
|
230
287
|
|
|
231
288
|
### JSON (Default)
|
|
@@ -312,9 +369,7 @@ Credentials stored in `~/.config/agent-messenger/webexbot-credentials.json` (060
|
|
|
312
369
|
|
|
313
370
|
- Bot can only interact with spaces it has been added to
|
|
314
371
|
- Bot can only edit/delete its own messages
|
|
315
|
-
- No
|
|
316
|
-
- No reactions / emoji support
|
|
317
|
-
- No thread support
|
|
372
|
+
- No reactions / emoji support — the Webex public REST API does not expose a reactions endpoint, and reaction events are not delivered to bot webhooks
|
|
318
373
|
- No message search
|
|
319
374
|
- No voice/video or meeting support
|
|
320
375
|
- No space management (create/delete spaces, roles)
|