@eliya-oss/agent-slack 0.1.6 → 0.1.8
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/.agents/cli-api.md +12 -12
- package/CHANGELOG.md +13 -1
- package/README.md +12 -23
- package/assets/terminal.webp +0 -0
- package/dist/application/commands.js +2 -2
- package/dist/cli/metadata.js +26 -27
- package/dist/output/envelope.js +1 -1
- package/package.json +1 -1
- package/skills/agent-slack/SKILL.md +10 -10
package/.agents/cli-api.md
CHANGED
|
@@ -50,12 +50,12 @@ agent-slack auth logout --profile work
|
|
|
50
50
|
|
|
51
51
|
Auth behavior:
|
|
52
52
|
|
|
53
|
-
- Primary setup: `agent-slack auth login` uses the bundled Agent Slack public Client ID, opens Slack in the browser with PKCE, and stores a local
|
|
54
|
-
- Users can also provide an existing
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
- OAuth opens the Slack OAuth URL in the default browser by default. Use `--no-open` to print the URL only, or `--auth-url-out PATH` for headless agents
|
|
58
|
-
- PKCE uses `user_scope=...`;
|
|
53
|
+
- Primary setup: `agent-slack auth login` uses the bundled Agent Slack public Client ID, opens Slack in the browser with PKCE, and stores a local Slack profile.
|
|
54
|
+
- Users can also provide an existing Slack bot token with `--token`.
|
|
55
|
+
- Browser login uses Agent Slack's public Slack app.
|
|
56
|
+
- Development and self-hosted OAuth can use Slack app credentials. The **Client ID** and **Client Secret** come from the Slack app's **Basic Information > App Credentials** section.
|
|
57
|
+
- OAuth opens the Slack OAuth URL in the default browser by default. Use `--no-open` to print the URL only, or `--auth-url-out PATH` for headless agents.
|
|
58
|
+
- PKCE uses `user_scope=...`; OAuth with app credentials uses `scope=...` for bot scopes.
|
|
59
59
|
- Default local callback: `http://localhost:45454/oauth/slack/callback`.
|
|
60
60
|
- Stores profiles outside the project directory. The default store is `~/.config/agent-slack/profiles.json`; set `AGENT_SLACK_TOKEN_STORE=keychain` on macOS to keep token secrets in Keychain and only profile metadata on disk.
|
|
61
61
|
- Supports multiple profiles and workspaces.
|
|
@@ -111,7 +111,7 @@ agent-slack conversation history CHANNEL_ID [--oldest TS] [--latest TS] [--all]
|
|
|
111
111
|
agent-slack conversation context CHANNEL_ID [--since 24h] [--include users,reactions,files,threads]
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
`conversation context`
|
|
114
|
+
`conversation context` returns normalized messages, hydrated users, thread refs, file refs, reactions, and permalinks in one deterministic payload for agents.
|
|
115
115
|
|
|
116
116
|
### Threads and messages
|
|
117
117
|
|
|
@@ -172,8 +172,8 @@ cat payload.json | agent-slack api call conversations.history -
|
|
|
172
172
|
|
|
173
173
|
Rules:
|
|
174
174
|
|
|
175
|
-
- `--payload`, `@file`, and `-` pass
|
|
176
|
-
- Convenience flags may be added later, but
|
|
175
|
+
- `--payload`, `@file`, and `-` pass JSON matching Slack's API fields.
|
|
176
|
+
- Convenience flags may be added later, but JSON payloads keep full Web API coverage.
|
|
177
177
|
- `--raw` returns Slack's exact response body.
|
|
178
178
|
- Without `--raw`, responses use the CLI envelope below.
|
|
179
179
|
- `--all --format ndjson` streams item records for cursor-paginated methods.
|
|
@@ -252,7 +252,7 @@ Schema output includes:
|
|
|
252
252
|
|
|
253
253
|
- command description and examples
|
|
254
254
|
- positional args and flags
|
|
255
|
-
-
|
|
255
|
+
- payload schema when known
|
|
256
256
|
- required Slack method/scopes
|
|
257
257
|
- output schema
|
|
258
258
|
- pagination behavior
|
|
@@ -286,8 +286,8 @@ agent-slack api call some.newMethod --payload @request.json --json
|
|
|
286
286
|
|
|
287
287
|
## Build Order
|
|
288
288
|
|
|
289
|
-
1.
|
|
290
|
-
2. Generic `api call`,
|
|
289
|
+
1. Slack profiles, keychain storage, and `auth test/status/scopes`.
|
|
290
|
+
2. Generic `api call`, JSON payload input, JSON envelope, structured errors.
|
|
291
291
|
3. `describe --json` and generated method catalog.
|
|
292
292
|
4. Conversation, thread, user, file, and search convenience commands.
|
|
293
293
|
5. Agent context commands with hydration and NDJSON streaming.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @eliya-oss/agent-slack
|
|
2
2
|
|
|
3
|
+
## 0.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Keep README auth onboarding focused on browser login and clean up auth help copy.
|
|
8
|
+
|
|
9
|
+
## 0.1.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Polish CLI, README, bundled skill, and agent docs copy.
|
|
14
|
+
|
|
3
15
|
## 0.1.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -18,7 +30,7 @@
|
|
|
18
30
|
|
|
19
31
|
- Add Slack PKCE browser login.
|
|
20
32
|
|
|
21
|
-
No-flag `auth login` now uses the bundled Agent Slack public Client ID with Slack OAuth PKCE for browser
|
|
33
|
+
No-flag `auth login` now uses the bundled Agent Slack public Client ID with Slack OAuth PKCE for browser login without a client secret. Token setup and OAuth with app credentials remain available for bot-token, development, and self-hosted workflows.
|
|
22
34
|
|
|
23
35
|
## 0.1.3
|
|
24
36
|
|
package/README.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# agent-slack
|
|
4
4
|
|
|
5
|
-
Slack context for AI agents
|
|
5
|
+
Slack context for AI agents via the `agent-slack` CLI.
|
|
6
6
|
Short alias: `aslk`.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
npm install -g @eliya-oss/agent-slack
|
|
10
|
-
```
|
|
8
|
+
<pre align="center">npm install -g @eliya-oss/agent-slack</pre>
|
|
11
9
|
|
|
12
10
|
<img src="./assets/terminal.webp" alt="Agent Slack terminal screenshot" width="820">
|
|
13
11
|
|
|
@@ -25,28 +23,11 @@ agent-slack api call conversations.info --payload '{"channel":"C123"}' --json
|
|
|
25
23
|
|
|
26
24
|
## Auth
|
|
27
25
|
|
|
28
|
-
Browser login:
|
|
29
|
-
|
|
30
26
|
```bash
|
|
31
27
|
agent-slack auth login
|
|
32
28
|
```
|
|
33
29
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Token setup:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
agent-slack auth login --token "$SLACK_BOT_TOKEN" --scopes channels:read,channels:history,users:read
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Developer/self-hosted fallback:
|
|
43
|
-
|
|
44
|
-
1. Create a Slack app at <https://api.slack.com/apps>.
|
|
45
|
-
2. Add the needed scopes under **OAuth & Permissions**.
|
|
46
|
-
3. Install it to your workspace and copy the **Bot User OAuth Token**.
|
|
47
|
-
4. Run `agent-slack auth login --token "$SLACK_BOT_TOKEN" --scopes ...`.
|
|
48
|
-
|
|
49
|
-
OAuth with `--client-id` and `--client-secret` is only for bring-your-own-app development and self-hosted setups.
|
|
30
|
+
Opens Slack in your browser and stores a local profile for future commands.
|
|
50
31
|
|
|
51
32
|
## Skill
|
|
52
33
|
|
|
@@ -63,3 +44,11 @@ Project docs live in `.agents/`.
|
|
|
63
44
|
## License
|
|
64
45
|
|
|
65
46
|
MIT
|
|
47
|
+
|
|
48
|
+
## Sponsors
|
|
49
|
+
|
|
50
|
+
<p align="center">
|
|
51
|
+
<a href="https://github.com/sponsors/Newbie012">
|
|
52
|
+
<img src="https://cdn.jsdelivr.net/gh/newbie012/sponsors/sponsors.svg">
|
|
53
|
+
</a>
|
|
54
|
+
</p>
|
package/assets/terminal.webp
CHANGED
|
Binary file
|
|
@@ -200,8 +200,8 @@ const authCommand = async (parsed, services) => {
|
|
|
200
200
|
const clientSecret = flagString(parsed, "client-secret") ?? process.env.AGENT_SLACK_CLIENT_SECRET ?? process.env.SLK_CLIENT_SECRET ?? process.env.SLACK_CLIENT_SECRET;
|
|
201
201
|
const byoOAuth = flagBoolean(parsed, "oauth");
|
|
202
202
|
if (byoOAuth && (clientId === undefined || clientSecret === undefined)) {
|
|
203
|
-
throw new UsageError("
|
|
204
|
-
suggestion: "Use --token with an existing
|
|
203
|
+
throw new UsageError("Slack OAuth with app credentials needs both --client-id and --client-secret.", {
|
|
204
|
+
suggestion: "Use --token with an existing Slack bot token, or pass both app credentials from Basic Information > App Credentials."
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
const scopes = splitCsv(flagString(parsed, "scopes"));
|
package/dist/cli/metadata.js
CHANGED
|
@@ -8,7 +8,7 @@ export const CLI_VERSION = packageJson.version ?? "0.0.0";
|
|
|
8
8
|
export const commandMetadata = [
|
|
9
9
|
{
|
|
10
10
|
path: ["describe"],
|
|
11
|
-
summary: "
|
|
11
|
+
summary: "Print the full command catalog as JSON.",
|
|
12
12
|
flags: ["--json"],
|
|
13
13
|
safety: "read",
|
|
14
14
|
output: "command metadata",
|
|
@@ -16,7 +16,7 @@ export const commandMetadata = [
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
path: ["completion"],
|
|
19
|
-
summary: "Generate shell completion
|
|
19
|
+
summary: "Generate a shell completion script.",
|
|
20
20
|
args: ["bash|zsh"],
|
|
21
21
|
safety: "read",
|
|
22
22
|
output: "shell completion script",
|
|
@@ -24,7 +24,7 @@ export const commandMetadata = [
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
path: ["auth", "status"],
|
|
27
|
-
summary: "Show the active Slack
|
|
27
|
+
summary: "Show the active Slack profile.",
|
|
28
28
|
flags: ["--profile", "--json"],
|
|
29
29
|
safety: "read",
|
|
30
30
|
output: "profile status",
|
|
@@ -44,7 +44,7 @@ export const commandMetadata = [
|
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
path: ["auth", "scopes"],
|
|
47
|
-
summary: "Show granted
|
|
47
|
+
summary: "Show scopes granted to the active profile.",
|
|
48
48
|
flags: ["--profile", "--json"],
|
|
49
49
|
safety: "read",
|
|
50
50
|
output: "scope list",
|
|
@@ -52,7 +52,7 @@ export const commandMetadata = [
|
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
path: ["auth", "profiles", "list"],
|
|
55
|
-
summary: "List local
|
|
55
|
+
summary: "List local Slack profiles.",
|
|
56
56
|
flags: ["--json"],
|
|
57
57
|
safety: "read",
|
|
58
58
|
output: "profile list",
|
|
@@ -60,7 +60,7 @@ export const commandMetadata = [
|
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
path: ["auth", "logout"],
|
|
63
|
-
summary: "Delete a local
|
|
63
|
+
summary: "Delete a local Slack profile.",
|
|
64
64
|
flags: ["--profile", "--json"],
|
|
65
65
|
safety: "destructive",
|
|
66
66
|
output: "deleted profile status",
|
|
@@ -68,7 +68,7 @@ export const commandMetadata = [
|
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
path: ["auth", "test"],
|
|
71
|
-
summary: "
|
|
71
|
+
summary: "Test the active Slack profile.",
|
|
72
72
|
methods: ["auth.test"],
|
|
73
73
|
scopes: [],
|
|
74
74
|
safety: "read",
|
|
@@ -77,7 +77,7 @@ export const commandMetadata = [
|
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
path: ["team", "get"],
|
|
80
|
-
summary: "Show workspace
|
|
80
|
+
summary: "Show Slack workspace details.",
|
|
81
81
|
methods: ["team.info"],
|
|
82
82
|
scopes: ["team:read"],
|
|
83
83
|
safety: "read",
|
|
@@ -95,7 +95,7 @@ export const commandMetadata = [
|
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
path: ["enterprise", "get"],
|
|
98
|
-
summary: "Show enterprise
|
|
98
|
+
summary: "Show enterprise and workspace identity.",
|
|
99
99
|
methods: ["team.info"],
|
|
100
100
|
scopes: ["team:read"],
|
|
101
101
|
safety: "read",
|
|
@@ -163,7 +163,7 @@ export const commandMetadata = [
|
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
path: ["api", "call"],
|
|
166
|
-
summary: "Call
|
|
166
|
+
summary: "Call a Slack Web API method with a JSON payload.",
|
|
167
167
|
args: ["METHOD", "PAYLOAD_STDIN_MARKER"],
|
|
168
168
|
flags: ["--payload", "--profile", "--token", "--all", "--raw", "--format", "--allow-write", "--yes", "--json"],
|
|
169
169
|
safety: "unknown",
|
|
@@ -175,7 +175,7 @@ export const commandMetadata = [
|
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
path: ["api", "methods", "list"],
|
|
178
|
-
summary: "List bundled Slack
|
|
178
|
+
summary: "List bundled Slack Web API metadata.",
|
|
179
179
|
flags: ["--family", "--json"],
|
|
180
180
|
safety: "read",
|
|
181
181
|
output: "method metadata list",
|
|
@@ -211,7 +211,7 @@ export const commandMetadata = [
|
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
213
|
path: ["conversation", "context"],
|
|
214
|
-
summary: "
|
|
214
|
+
summary: "Build channel context for agents.",
|
|
215
215
|
args: ["CHANNEL_ID"],
|
|
216
216
|
methods: ["conversations.history", "conversations.replies", "users.info"],
|
|
217
217
|
scopes: ["channels:history", "users:read"],
|
|
@@ -241,7 +241,7 @@ export const commandMetadata = [
|
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
243
|
path: ["message", "permalink"],
|
|
244
|
-
summary: "
|
|
244
|
+
summary: "Get a Slack permalink for a message.",
|
|
245
245
|
flags: ["--channel", "--ts", "--json"],
|
|
246
246
|
methods: ["chat.getPermalink"],
|
|
247
247
|
safety: "read",
|
|
@@ -250,7 +250,7 @@ export const commandMetadata = [
|
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
252
|
path: ["search", "context"],
|
|
253
|
-
summary: "Search Slack for
|
|
253
|
+
summary: "Search Slack for relevant context.",
|
|
254
254
|
flags: ["--query", "--content-types", "--json"],
|
|
255
255
|
methods: ["assistant.search.context"],
|
|
256
256
|
scopes: ["search:read.public", "search:read.private"],
|
|
@@ -312,7 +312,7 @@ export const renderHumanHelp = (path) => {
|
|
|
312
312
|
return [
|
|
313
313
|
PRIMARY_COMMAND_NAME,
|
|
314
314
|
"",
|
|
315
|
-
"
|
|
315
|
+
"Slack context CLI for agents.",
|
|
316
316
|
"",
|
|
317
317
|
"Commands:",
|
|
318
318
|
...commands.map((item) => ` ${item.path.join(" ").padEnd(28)} ${item.summary}`)
|
|
@@ -326,32 +326,31 @@ const renderAuthLoginHelp = () => [
|
|
|
326
326
|
"Browser login",
|
|
327
327
|
" agent-slack auth login",
|
|
328
328
|
"",
|
|
329
|
-
" Opens Slack in the browser
|
|
330
|
-
" No Slack app secret is stored in the CLI.",
|
|
329
|
+
" Opens Slack in the browser and stores a local Slack profile.",
|
|
331
330
|
"",
|
|
332
|
-
"
|
|
331
|
+
"Headless setup",
|
|
333
332
|
" agent-slack auth login --token \"$SLACK_BOT_TOKEN\" --scopes channels:read,channels:history,users:read",
|
|
334
333
|
"",
|
|
335
|
-
" Stores an existing
|
|
334
|
+
" Stores an existing bot token as a local Slack profile.",
|
|
336
335
|
"",
|
|
337
|
-
"
|
|
336
|
+
"Development and self-hosted OAuth",
|
|
338
337
|
" agent-slack auth login --oauth --client-id \"$SLACK_CLIENT_ID\" --client-secret \"$SLACK_CLIENT_SECRET\"",
|
|
339
338
|
"",
|
|
340
339
|
"Options",
|
|
341
340
|
" --profile NAME Save as a named profile.",
|
|
342
|
-
" --token TOKEN Store an existing
|
|
343
|
-
" --scopes LIST
|
|
344
|
-
" --user-scopes LIST
|
|
345
|
-
" --oauth Use Slack OAuth with
|
|
341
|
+
" --token TOKEN Store an existing Slack bot token.",
|
|
342
|
+
" --scopes LIST Scopes to request or record.",
|
|
343
|
+
" --user-scopes LIST User scopes to request during OAuth.",
|
|
344
|
+
" --oauth Use Slack OAuth with app credentials.",
|
|
346
345
|
" --client-id VALUE Override the Slack app Client ID.",
|
|
347
346
|
" --client-secret VALUE Slack app Client Secret.",
|
|
348
347
|
" --no-open Print OAuth URL instead of opening the browser.",
|
|
349
348
|
" --auth-url-out PATH Write OAuth URL for headless flows.",
|
|
350
|
-
" --json Emit
|
|
349
|
+
" --json Emit machine-readable JSON.",
|
|
351
350
|
"",
|
|
352
351
|
"Notes",
|
|
353
|
-
"
|
|
354
|
-
"
|
|
352
|
+
" Browser login uses PKCE with Agent Slack's public Slack app.",
|
|
353
|
+
" App credentials are for development and self-hosted setups.",
|
|
355
354
|
""
|
|
356
355
|
].join("\n");
|
|
357
356
|
export const renderCompletion = (shell) => {
|
package/dist/output/envelope.js
CHANGED
|
@@ -46,7 +46,7 @@ export const errorEnvelope = (error) => {
|
|
|
46
46
|
const suggestionFor = (tag) => {
|
|
47
47
|
switch (tag) {
|
|
48
48
|
case "NotAuthenticated":
|
|
49
|
-
return "Run agent-slack auth login or
|
|
49
|
+
return "Run agent-slack auth login, or use --token with an existing Slack bot token.";
|
|
50
50
|
case "MissingScope":
|
|
51
51
|
return "Reinstall or reauthorize the Slack app with the missing scope.";
|
|
52
52
|
case "SlackRateLimited":
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-slack
|
|
3
|
-
description: "Use when Codex needs Slack context through the `agent-slack` CLI: authenticate, inspect profiles/scopes, read channels, messages, threads, files, users, search context, or call Slack Web API methods with
|
|
3
|
+
description: "Use when Codex needs Slack context through the `agent-slack` CLI: authenticate, inspect profiles/scopes, read channels, messages, threads, files, users, search context, or call Slack Web API methods with JSON or NDJSON output."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# agent-slack CLI
|
|
7
7
|
|
|
8
|
-
Use `agent-slack` as the Slack context boundary. `aslk` is the short alias. Prefer read-only commands
|
|
8
|
+
Use `agent-slack` as the Slack context boundary. `aslk` is the short alias. Prefer read-only commands. The CLI can only return data allowed by the active token, scopes, channel membership, workspace policy, and Slack plan.
|
|
9
9
|
|
|
10
10
|
## Workflow
|
|
11
11
|
|
|
12
12
|
1. Check availability: `agent-slack describe --json`.
|
|
13
13
|
2. Check auth: `agent-slack auth status --json`.
|
|
14
|
-
3. If auth is missing, ask the user to run `agent-slack auth login`. It opens Slack in the browser with PKCE and stores a local
|
|
14
|
+
3. If auth is missing, ask the user to run `agent-slack auth login`. It opens Slack in the browser with PKCE and stores a local Slack profile.
|
|
15
15
|
4. Use specific read commands before raw API calls.
|
|
16
16
|
5. Use `--json` for bounded results and `--format ndjson` for large context streams.
|
|
17
17
|
6. Read structured errors from stderr; do not parse progress text from stdout.
|
|
@@ -24,27 +24,27 @@ Browser login:
|
|
|
24
24
|
agent-slack auth login
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Agent Slack opens Slack in the browser
|
|
27
|
+
Agent Slack opens Slack in the browser and stores a local Slack profile.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Headless setup with an existing bot token:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
agent-slack auth login --token "$SLACK_BOT_TOKEN" --scopes channels:read,channels:history,users:read --json
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
This stores an existing Slack
|
|
35
|
+
This stores an existing Slack bot token as a local profile.
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Development and self-hosted OAuth:
|
|
38
38
|
|
|
39
39
|
1. Create or open a Slack app at https://api.slack.com/apps.
|
|
40
|
-
2. Go to **OAuth & Permissions**, add the needed bot scopes, install the app to the workspace, and copy the
|
|
41
|
-
3. For OAuth auth, get the **Client ID** and **Client Secret** from **Basic Information
|
|
40
|
+
2. Go to **OAuth & Permissions**, add the needed bot scopes, install the app to the workspace, and copy the bot token.
|
|
41
|
+
3. For OAuth auth, get the **Client ID** and **Client Secret** from **Basic Information > App Credentials** in that Slack app, then run:
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
44
|
agent-slack auth login --oauth --client-id "$SLACK_CLIENT_ID" --client-secret "$SLACK_CLIENT_SECRET" --json
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Use Slack app credentials only when the user explicitly asks for development or self-hosted OAuth setup.
|
|
48
48
|
|
|
49
49
|
## Common Commands
|
|
50
50
|
|