agent-messenger 1.2.0 → 1.3.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 +1 -1
- package/dist/package.json +3 -2
- package/dist/src/platforms/slackbot/cli.d.ts +5 -0
- package/dist/src/platforms/slackbot/cli.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/cli.js +19 -0
- package/dist/src/platforms/slackbot/cli.js.map +1 -0
- package/dist/src/platforms/slackbot/client.d.ts +43 -0
- package/dist/src/platforms/slackbot/client.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/client.js +347 -0
- package/dist/src/platforms/slackbot/client.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/auth.d.ts +35 -0
- package/dist/src/platforms/slackbot/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/auth.js +185 -0
- package/dist/src/platforms/slackbot/commands/auth.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/channel.d.ts +3 -0
- package/dist/src/platforms/slackbot/commands/channel.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/channel.js +40 -0
- package/dist/src/platforms/slackbot/commands/channel.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/index.d.ts +6 -0
- package/dist/src/platforms/slackbot/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/index.js +6 -0
- package/dist/src/platforms/slackbot/commands/index.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/message.d.ts +3 -0
- package/dist/src/platforms/slackbot/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/message.js +135 -0
- package/dist/src/platforms/slackbot/commands/message.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/reaction.d.ts +3 -0
- package/dist/src/platforms/slackbot/commands/reaction.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/reaction.js +43 -0
- package/dist/src/platforms/slackbot/commands/reaction.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/shared.d.ts +9 -0
- package/dist/src/platforms/slackbot/commands/shared.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/shared.js +13 -0
- package/dist/src/platforms/slackbot/commands/shared.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/user.d.ts +3 -0
- package/dist/src/platforms/slackbot/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/user.js +40 -0
- package/dist/src/platforms/slackbot/commands/user.js.map +1 -0
- package/dist/src/platforms/slackbot/credential-manager.d.ts +18 -0
- package/dist/src/platforms/slackbot/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/credential-manager.js +187 -0
- package/dist/src/platforms/slackbot/credential-manager.js.map +1 -0
- package/dist/src/platforms/slackbot/index.d.ts +4 -0
- package/dist/src/platforms/slackbot/index.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/index.js +4 -0
- package/dist/src/platforms/slackbot/index.js.map +1 -0
- package/dist/src/platforms/slackbot/types.d.ts +460 -0
- package/dist/src/platforms/slackbot/types.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/types.js +114 -0
- package/dist/src/platforms/slackbot/types.js.map +1 -0
- package/docs/content/docs/integrations/meta.json +1 -1
- package/docs/content/docs/integrations/slackbot.mdx +204 -0
- package/docs/src/app/page.tsx +18 -1
- package/e2e/config.ts +26 -0
- package/e2e/helpers.ts +6 -1
- package/e2e/slackbot.e2e.test.ts +306 -0
- package/package.json +3 -2
- package/skills/agent-slackbot/SKILL.md +285 -0
- package/skills/agent-slackbot/references/authentication.md +253 -0
- package/skills/agent-slackbot/references/common-patterns.md +218 -0
- package/skills/agent-slackbot/templates/monitor-channel.sh +98 -0
- package/skills/agent-slackbot/templates/post-message.sh +107 -0
- package/skills/agent-slackbot/templates/workspace-summary.sh +113 -0
- package/src/platforms/slackbot/cli.ts +30 -0
- package/src/platforms/slackbot/client.test.ts +282 -0
- package/src/platforms/slackbot/client.ts +401 -0
- package/src/platforms/slackbot/commands/auth.test.ts +245 -0
- package/src/platforms/slackbot/commands/auth.ts +240 -0
- package/src/platforms/slackbot/commands/channel.ts +46 -0
- package/src/platforms/slackbot/commands/index.ts +5 -0
- package/src/platforms/slackbot/commands/message.ts +182 -0
- package/src/platforms/slackbot/commands/reaction.ts +59 -0
- package/src/platforms/slackbot/commands/shared.ts +23 -0
- package/src/platforms/slackbot/commands/user.ts +46 -0
- package/src/platforms/slackbot/credential-manager.test.ts +264 -0
- package/src/platforms/slackbot/credential-manager.ts +218 -0
- package/src/platforms/slackbot/index.ts +19 -0
- package/src/platforms/slackbot/types.test.ts +90 -0
- package/src/platforms/slackbot/types.ts +222 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// Error class for SlackBot operations
|
|
3
|
+
export class SlackBotError extends Error {
|
|
4
|
+
code;
|
|
5
|
+
constructor(message, code) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'SlackBotError';
|
|
8
|
+
this.code = code;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
// Zod validation schemas
|
|
12
|
+
export const SlackBotEntrySchema = z.object({
|
|
13
|
+
bot_id: z.string(),
|
|
14
|
+
bot_name: z.string(),
|
|
15
|
+
token: z.string().startsWith('xoxb-', 'Token must be a bot token (xoxb-)'),
|
|
16
|
+
});
|
|
17
|
+
export const SlackBotWorkspaceSchema = z.object({
|
|
18
|
+
workspace_id: z.string(),
|
|
19
|
+
workspace_name: z.string(),
|
|
20
|
+
bots: z.record(z.string(), SlackBotEntrySchema),
|
|
21
|
+
});
|
|
22
|
+
export const SlackBotCredentialsSchema = z.object({
|
|
23
|
+
token: z.string().startsWith('xoxb-', 'Token must be a bot token (xoxb-)'),
|
|
24
|
+
workspace_id: z.string(),
|
|
25
|
+
workspace_name: z.string(),
|
|
26
|
+
bot_id: z.string(),
|
|
27
|
+
bot_name: z.string(),
|
|
28
|
+
});
|
|
29
|
+
export const SlackBotConfigSchema = z.object({
|
|
30
|
+
current: z
|
|
31
|
+
.object({
|
|
32
|
+
workspace_id: z.string(),
|
|
33
|
+
bot_id: z.string(),
|
|
34
|
+
})
|
|
35
|
+
.nullable(),
|
|
36
|
+
workspaces: z.record(z.string(), SlackBotWorkspaceSchema),
|
|
37
|
+
});
|
|
38
|
+
export const SlackChannelSchema = z.object({
|
|
39
|
+
id: z.string(),
|
|
40
|
+
name: z.string(),
|
|
41
|
+
is_private: z.boolean(),
|
|
42
|
+
is_archived: z.boolean(),
|
|
43
|
+
created: z.number(),
|
|
44
|
+
creator: z.string(),
|
|
45
|
+
topic: z
|
|
46
|
+
.object({
|
|
47
|
+
value: z.string(),
|
|
48
|
+
creator: z.string(),
|
|
49
|
+
last_set: z.number(),
|
|
50
|
+
})
|
|
51
|
+
.optional(),
|
|
52
|
+
purpose: z
|
|
53
|
+
.object({
|
|
54
|
+
value: z.string(),
|
|
55
|
+
creator: z.string(),
|
|
56
|
+
last_set: z.number(),
|
|
57
|
+
})
|
|
58
|
+
.optional(),
|
|
59
|
+
});
|
|
60
|
+
export const SlackMessageSchema = z.object({
|
|
61
|
+
ts: z.string(),
|
|
62
|
+
text: z.string(),
|
|
63
|
+
user: z.string().optional(),
|
|
64
|
+
username: z.string().optional(),
|
|
65
|
+
type: z.string(),
|
|
66
|
+
thread_ts: z.string().optional(),
|
|
67
|
+
reply_count: z.number().optional(),
|
|
68
|
+
replies: z
|
|
69
|
+
.array(z.object({
|
|
70
|
+
user: z.string(),
|
|
71
|
+
ts: z.string(),
|
|
72
|
+
}))
|
|
73
|
+
.optional(),
|
|
74
|
+
edited: z
|
|
75
|
+
.object({
|
|
76
|
+
user: z.string(),
|
|
77
|
+
ts: z.string(),
|
|
78
|
+
})
|
|
79
|
+
.optional(),
|
|
80
|
+
});
|
|
81
|
+
export const SlackUserSchema = z.object({
|
|
82
|
+
id: z.string(),
|
|
83
|
+
name: z.string(),
|
|
84
|
+
real_name: z.string(),
|
|
85
|
+
is_admin: z.boolean(),
|
|
86
|
+
is_owner: z.boolean(),
|
|
87
|
+
is_bot: z.boolean(),
|
|
88
|
+
is_app_user: z.boolean(),
|
|
89
|
+
profile: z
|
|
90
|
+
.object({
|
|
91
|
+
email: z.string().optional(),
|
|
92
|
+
phone: z.string().optional(),
|
|
93
|
+
title: z.string().optional(),
|
|
94
|
+
status_text: z.string().optional(),
|
|
95
|
+
})
|
|
96
|
+
.optional(),
|
|
97
|
+
});
|
|
98
|
+
export const SlackReactionSchema = z.object({
|
|
99
|
+
name: z.string(),
|
|
100
|
+
count: z.number(),
|
|
101
|
+
users: z.array(z.string()),
|
|
102
|
+
});
|
|
103
|
+
export const SlackFileSchema = z.object({
|
|
104
|
+
id: z.string(),
|
|
105
|
+
name: z.string(),
|
|
106
|
+
title: z.string(),
|
|
107
|
+
mimetype: z.string(),
|
|
108
|
+
size: z.number(),
|
|
109
|
+
url_private: z.string(),
|
|
110
|
+
created: z.number(),
|
|
111
|
+
user: z.string(),
|
|
112
|
+
channels: z.array(z.string()).optional(),
|
|
113
|
+
});
|
|
114
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/platforms/slackbot/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA6BvB,sCAAsC;AACtC,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,IAAI,CAAQ;IAEZ,YAAY,OAAe,EAAE,IAAY;QACvC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF;AAuED,yBAAyB;AACzB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB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AI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAA"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Slack Bot
|
|
3
|
+
description: Complete reference for the agent-slackbot CLI.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> **Tip**: `agent-slackbot` uses bot tokens (xoxb-) instead of user tokens. Ideal for server-side and CI/CD integrations.
|
|
7
|
+
|
|
8
|
+
## Quick Start
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# 1. Set your bot token (from api.slack.com/apps)
|
|
12
|
+
agent-slackbot auth set xoxb-your-bot-token
|
|
13
|
+
|
|
14
|
+
# 2. Verify authentication
|
|
15
|
+
agent-slackbot auth status
|
|
16
|
+
|
|
17
|
+
# 3. Send a message
|
|
18
|
+
agent-slackbot message send C0ACZKTDDC0 "Hello from bot!"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Authentication
|
|
22
|
+
|
|
23
|
+
### Create a Slack App
|
|
24
|
+
|
|
25
|
+
The fastest way to get started is to create an app from the manifest below:
|
|
26
|
+
|
|
27
|
+
1. Go to [api.slack.com/apps](https://api.slack.com/apps) → **Create New App** → **From an app manifest**
|
|
28
|
+
2. Select your workspace
|
|
29
|
+
3. Paste the manifest below (choose YAML tab) and click **Next** → **Create**
|
|
30
|
+
4. Click **Install App** in the left sidebar, then hit **Install to Workspace**
|
|
31
|
+
5. Copy the **Bot User OAuth Token** (starts with `xoxb-`) from the **Install App** page
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
display_information:
|
|
35
|
+
name: Agent Messenger Bot
|
|
36
|
+
description: Bot for agent-messenger CLI integration
|
|
37
|
+
background_color: "#1a1a2e"
|
|
38
|
+
|
|
39
|
+
features:
|
|
40
|
+
bot_user:
|
|
41
|
+
display_name: agent-messenger
|
|
42
|
+
always_online: false
|
|
43
|
+
|
|
44
|
+
oauth_config:
|
|
45
|
+
scopes:
|
|
46
|
+
bot:
|
|
47
|
+
- chat:write
|
|
48
|
+
- channels:history
|
|
49
|
+
- channels:read
|
|
50
|
+
- channels:join
|
|
51
|
+
- groups:history
|
|
52
|
+
- groups:read
|
|
53
|
+
- users:read
|
|
54
|
+
- users:read.email
|
|
55
|
+
- reactions:write
|
|
56
|
+
- reactions:read
|
|
57
|
+
|
|
58
|
+
settings:
|
|
59
|
+
org_deploy_enabled: false
|
|
60
|
+
socket_mode_enabled: false
|
|
61
|
+
token_rotation_enabled: false
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Then set the token:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Basic setup
|
|
68
|
+
agent-slackbot auth set xoxb-your-bot-token
|
|
69
|
+
|
|
70
|
+
# Or with a custom bot identifier for multi-bot setups
|
|
71
|
+
agent-slackbot auth set xoxb-your-bot-token --bot deploy --name "Deploy Bot"
|
|
72
|
+
|
|
73
|
+
# Verify it works
|
|
74
|
+
agent-slackbot auth status
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Multi-Bot Support
|
|
78
|
+
|
|
79
|
+
Store multiple bot tokens and switch between them:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Add multiple bots
|
|
83
|
+
agent-slackbot auth set xoxb-deploy-token --bot deploy --name "Deploy Bot"
|
|
84
|
+
agent-slackbot auth set xoxb-alert-token --bot alert --name "Alert Bot"
|
|
85
|
+
|
|
86
|
+
# List all stored bots
|
|
87
|
+
agent-slackbot auth list
|
|
88
|
+
|
|
89
|
+
# Switch active bot
|
|
90
|
+
agent-slackbot auth use deploy
|
|
91
|
+
|
|
92
|
+
# Use a specific bot for one command (without switching)
|
|
93
|
+
agent-slackbot message send C0ACZKTDDC0 "Alert!" --bot alert
|
|
94
|
+
|
|
95
|
+
# Remove a stored bot
|
|
96
|
+
agent-slackbot auth remove deploy
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Scopes Reference
|
|
100
|
+
|
|
101
|
+
| Scope | Used For |
|
|
102
|
+
|-------|----------|
|
|
103
|
+
| `chat:write` | Sending and updating messages |
|
|
104
|
+
| `channels:history` | Reading public channel messages |
|
|
105
|
+
| `channels:read` | Listing public channels |
|
|
106
|
+
| `channels:join` | Joining public channels |
|
|
107
|
+
| `groups:history` | Reading private channel messages |
|
|
108
|
+
| `groups:read` | Listing private channels |
|
|
109
|
+
| `users:read` | Listing users |
|
|
110
|
+
| `users:read.email` | Reading user emails |
|
|
111
|
+
| `reactions:write` | Adding/removing reactions |
|
|
112
|
+
| `reactions:read` | Listing reactions |
|
|
113
|
+
|
|
114
|
+
### Environment Variables (CI/CD)
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
export E2E_SLACKBOT_TOKEN=xoxb-your-bot-token
|
|
118
|
+
export E2E_SLACKBOT_WORKSPACE_ID=T123456
|
|
119
|
+
export E2E_SLACKBOT_WORKSPACE_NAME="My Workspace"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Commands
|
|
123
|
+
|
|
124
|
+
### Message Commands
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Send a message
|
|
128
|
+
agent-slackbot message send <channel> <text>
|
|
129
|
+
agent-slackbot message send C0ACZKTDDC0 "Hello world"
|
|
130
|
+
|
|
131
|
+
# Send a threaded reply
|
|
132
|
+
agent-slackbot message send C0ACZKTDDC0 "Reply" --thread <ts>
|
|
133
|
+
|
|
134
|
+
# List messages
|
|
135
|
+
agent-slackbot message list <channel>
|
|
136
|
+
agent-slackbot message list C0ACZKTDDC0 --limit 50
|
|
137
|
+
|
|
138
|
+
# Get a single message
|
|
139
|
+
agent-slackbot message get <channel> <ts>
|
|
140
|
+
|
|
141
|
+
# Get thread replies
|
|
142
|
+
agent-slackbot message replies <channel> <thread_ts>
|
|
143
|
+
agent-slackbot message replies C0ACZKTDDC0 1234567890.123456
|
|
144
|
+
|
|
145
|
+
# Update a message (bot's own messages only)
|
|
146
|
+
agent-slackbot message update <channel> <ts> <new-text>
|
|
147
|
+
|
|
148
|
+
# Delete a message (bot's own messages only)
|
|
149
|
+
agent-slackbot message delete <channel> <ts> --force
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Channel Commands
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# List channels
|
|
156
|
+
agent-slackbot channel list
|
|
157
|
+
agent-slackbot channel list --limit 50
|
|
158
|
+
|
|
159
|
+
# Get channel info
|
|
160
|
+
agent-slackbot channel info <channel>
|
|
161
|
+
agent-slackbot channel info C0ACZKTDDC0
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### User Commands
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# List users
|
|
168
|
+
agent-slackbot user list
|
|
169
|
+
agent-slackbot user list --limit 50
|
|
170
|
+
|
|
171
|
+
# Get user info
|
|
172
|
+
agent-slackbot user info <user-id>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Reaction Commands
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Add reaction
|
|
179
|
+
agent-slackbot reaction add <channel> <ts> <emoji>
|
|
180
|
+
agent-slackbot reaction add C0ACZKTDDC0 1234567890.123456 thumbsup
|
|
181
|
+
|
|
182
|
+
# Remove reaction
|
|
183
|
+
agent-slackbot reaction remove <channel> <ts> <emoji>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Key Differences from agent-slack
|
|
187
|
+
|
|
188
|
+
| Feature | agent-slack | agent-slackbot |
|
|
189
|
+
|---------|------------|----------------|
|
|
190
|
+
| Token type | User token (xoxc-) | Bot token (xoxb-) |
|
|
191
|
+
| Token source | Auto-extracted from desktop app | Manual from Slack App config |
|
|
192
|
+
| Message search | Yes | No |
|
|
193
|
+
| File operations | Yes | No |
|
|
194
|
+
| Snapshot | Yes | No |
|
|
195
|
+
| Edit/delete messages | Any message | Bot's own only |
|
|
196
|
+
| Multi-bot support | N/A | Yes (`--bot` flag) |
|
|
197
|
+
| CI/CD friendly | Requires desktop app | Yes |
|
|
198
|
+
|
|
199
|
+
## AI Agent Integration
|
|
200
|
+
|
|
201
|
+
See `skills/agent-slackbot/` directory for:
|
|
202
|
+
- Complete skill documentation
|
|
203
|
+
- Runnable templates
|
|
204
|
+
- Common patterns for AI agents
|
package/docs/src/app/page.tsx
CHANGED
|
@@ -232,7 +232,24 @@ function ThemeToggle() {
|
|
|
232
232
|
)
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
async function fetchNpmVersion(): Promise<string | null> {
|
|
236
|
+
try {
|
|
237
|
+
const res = await fetch('https://registry.npmjs.org/agent-messenger/latest')
|
|
238
|
+
if (!res.ok) return null
|
|
239
|
+
const data = await res.json()
|
|
240
|
+
return data.version ?? null
|
|
241
|
+
} catch {
|
|
242
|
+
return null
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
235
246
|
export default function Home() {
|
|
247
|
+
const [npmVersion, setNpmVersion] = useState<string | null>(null)
|
|
248
|
+
|
|
249
|
+
useEffect(() => {
|
|
250
|
+
fetchNpmVersion().then(setNpmVersion)
|
|
251
|
+
}, [])
|
|
252
|
+
|
|
236
253
|
return (
|
|
237
254
|
<div className="flex min-h-screen flex-col bg-zinc-50 dark:bg-black">
|
|
238
255
|
<header className="sticky top-0 z-50 border-b border-zinc-200 bg-zinc-50/80 backdrop-blur-sm dark:border-zinc-800 dark:bg-black/80">
|
|
@@ -266,7 +283,7 @@ export default function Home() {
|
|
|
266
283
|
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"></span>
|
|
267
284
|
<span className="relative inline-flex rounded-full h-2 w-2 bg-green-500"></span>
|
|
268
285
|
</span>
|
|
269
|
-
|
|
286
|
+
{npmVersion ? `v${npmVersion} Available Now` : 'Available Now'}
|
|
270
287
|
</div>
|
|
271
288
|
<h1 className="max-w-4xl text-5xl font-extrabold tracking-tight text-zinc-900 dark:text-white sm:text-6xl md:text-7xl">
|
|
272
289
|
Give your AI agent the power to <br className="hidden sm:block" />
|
package/e2e/config.ts
CHANGED
|
@@ -29,6 +29,32 @@ export async function validateSlackEnvironment() {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
// SlackBot Test Environment (same workspace as Slack, bot token)
|
|
33
|
+
export const SLACKBOT_TEST_WORKSPACE_ID = 'T0AC55BSF6E'
|
|
34
|
+
export const SLACKBOT_TEST_WORKSPACE_NAME = 'Agent Messenger'
|
|
35
|
+
export const SLACKBOT_TEST_CHANNEL_ID = 'C0ACZKTDDC0'
|
|
36
|
+
export const SLACKBOT_TEST_CHANNEL = 'e2e-test'
|
|
37
|
+
|
|
38
|
+
export async function validateSlackBotEnvironment() {
|
|
39
|
+
const { runCLI, parseJSON } = await import('./helpers')
|
|
40
|
+
|
|
41
|
+
const result = await runCLI('slackbot', ['auth', 'status'])
|
|
42
|
+
if (result.exitCode !== 0) {
|
|
43
|
+
throw new Error('SlackBot authentication failed. Please run: agent-slackbot auth set <token>')
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const data = parseJSON<{ workspace_id: string; valid: boolean }>(result.stdout)
|
|
47
|
+
if (!data?.valid) {
|
|
48
|
+
throw new Error('SlackBot token is invalid or expired. Please run: agent-slackbot auth set <token>')
|
|
49
|
+
}
|
|
50
|
+
if (data?.workspace_id !== SLACKBOT_TEST_WORKSPACE_ID) {
|
|
51
|
+
throw new Error(
|
|
52
|
+
`Wrong SlackBot workspace. Expected: ${SLACKBOT_TEST_WORKSPACE_NAME} (${SLACKBOT_TEST_WORKSPACE_ID}), ` +
|
|
53
|
+
`Got: ${data?.workspace_id}`
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
32
58
|
export async function validateDiscordEnvironment() {
|
|
33
59
|
const { runCLI, parseJSON } = await import('./helpers')
|
|
34
60
|
|
package/e2e/helpers.ts
CHANGED
|
@@ -7,7 +7,12 @@ export interface CLIResult {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export async function runCLI(platform: string, args: string[]): Promise<CLIResult> {
|
|
10
|
-
const
|
|
10
|
+
const commandMap: Record<string, string> = {
|
|
11
|
+
slack: 'agent-slack',
|
|
12
|
+
discord: 'agent-discord',
|
|
13
|
+
slackbot: 'agent-slackbot',
|
|
14
|
+
}
|
|
15
|
+
const command = commandMap[platform] || platform
|
|
11
16
|
|
|
12
17
|
try {
|
|
13
18
|
const result = await $`${command} ${args}`.quiet()
|