@herdctl/slack 1.1.1 → 1.1.3

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.
Files changed (2) hide show
  1. package/README.md +155 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,155 @@
1
+ # @herdctl/slack
2
+
3
+ > Slack connector for herdctl fleet management
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@herdctl/slack.svg)](https://www.npmjs.com/package/@herdctl/slack)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ **Documentation**: [herdctl.dev](https://herdctl.dev)
9
+
10
+ ## Overview
11
+
12
+ `@herdctl/slack` enables your [herdctl](https://herdctl.dev) agents to interact via Slack. Users can chat with agents in channels or DMs, and agents stream responses in real time. The connector handles session management automatically, maintaining conversation context across messages.
13
+
14
+ Herdctl is an open-source system for running fleets of autonomous AI agents powered by Claude Code. This package is part of the herdctl monorepo.
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install @herdctl/slack
20
+ ```
21
+
22
+ > **Note**: This package is typically used automatically by `@herdctl/core` when Slack is configured in your agent YAML. Direct installation is only needed for advanced use cases.
23
+
24
+ ## Configuration
25
+
26
+ Add Slack chat configuration to your agent YAML:
27
+
28
+ ### Channel Bot
29
+
30
+ ```yaml
31
+ name: support-bot
32
+ model: claude-sonnet-4-20250514
33
+
34
+ chat:
35
+ slack:
36
+ bot_token_env: SLACK_BOT_TOKEN
37
+ app_token_env: SLACK_APP_TOKEN
38
+ channels:
39
+ - id: "C0123456789"
40
+ name: "#support"
41
+ mode: mention # Only respond when @mentioned
42
+ - id: "C9876543210"
43
+ name: "#general"
44
+ mode: auto # Respond to all messages
45
+ ```
46
+
47
+ ### DM-Only Bot
48
+
49
+ ```yaml
50
+ name: my-assistant
51
+ model: claude-sonnet-4-20250514
52
+
53
+ chat:
54
+ slack:
55
+ bot_token_env: SLACK_BOT_TOKEN
56
+ app_token_env: SLACK_APP_TOKEN
57
+ channels: []
58
+ dm:
59
+ enabled: true
60
+ mode: auto
61
+ ```
62
+
63
+ ### Full Configuration Reference
64
+
65
+ ```yaml
66
+ chat:
67
+ slack:
68
+ # Required: Environment variables containing tokens
69
+ bot_token_env: SLACK_BOT_TOKEN
70
+ app_token_env: SLACK_APP_TOKEN
71
+
72
+ # Optional: Session expiry in hours (default: 24)
73
+ session_expiry_hours: 24
74
+
75
+ # Channel configurations
76
+ channels:
77
+ - id: "C0123456789"
78
+ name: "#support" # Optional, for logging
79
+ mode: mention # mention | auto
80
+
81
+ # Optional: DM configuration
82
+ dm:
83
+ enabled: true
84
+ mode: auto # mention | auto
85
+ allowlist: ["U001", "U002"] # Only these users can DM
86
+ blocklist: ["U999"] # These users cannot DM
87
+ ```
88
+
89
+ ### Chat Modes
90
+
91
+ - **`auto`** - Respond to all messages in allowed channels/DMs
92
+ - **`mention`** - Only respond when the bot is @mentioned
93
+
94
+ ## Features
95
+
96
+ - **Conversation Continuity** - Sessions persist across messages using Claude SDK session resumption
97
+ - **DM Support** - Users can chat privately with agents, with allowlist/blocklist controls
98
+ - **Channel Support** - Agents can participate in multiple Slack channels
99
+ - **Streaming Responses** - Responses are delivered incrementally as the agent generates them
100
+ - **Typing Indicators** - Hourglass emoji reaction while the agent is processing
101
+ - **Message Splitting** - Long responses are automatically split to fit Slack's 4,000-character limit
102
+ - **Markdown Conversion** - Agent Markdown output is converted to Slack's mrkdwn format
103
+ - **Socket Mode** - No public URL required; uses Slack Socket Mode for event delivery
104
+
105
+ ## Commands
106
+
107
+ Type these in any channel where the bot is active:
108
+
109
+ | Command | Description |
110
+ |---------|-------------|
111
+ | `!help` | Show available commands and usage |
112
+ | `!status` | Show agent status and current session info |
113
+ | `!reset` | Clear conversation context and start fresh |
114
+
115
+ ## Slack App Setup
116
+
117
+ 1. Create a Slack app at [api.slack.com/apps](https://api.slack.com/apps)
118
+ 2. Enable **Socket Mode** and generate an App-Level Token (`xapp-...`)
119
+ 3. Add the following **Bot Token Scopes** under OAuth & Permissions:
120
+ - `chat:write`
121
+ - `channels:history`
122
+ - `groups:history`
123
+ - `im:history`
124
+ - `reactions:write`
125
+ 4. Enable **Event Subscriptions** and subscribe to:
126
+ - `message.channels`
127
+ - `message.groups`
128
+ - `message.im`
129
+ 5. Install the app to your workspace and copy the Bot User OAuth Token (`xoxb-...`)
130
+ 6. Set your tokens as environment variables:
131
+ ```bash
132
+ export SLACK_BOT_TOKEN="xoxb-..."
133
+ export SLACK_APP_TOKEN="xapp-..."
134
+ ```
135
+
136
+ For a full walkthrough, see the [Slack Quick Start](https://herdctl.dev/guides/slack-quick-start/) guide.
137
+
138
+ ## Documentation
139
+
140
+ For complete setup instructions, visit [herdctl.dev](https://herdctl.dev):
141
+
142
+ - [Slack Quick Start](https://herdctl.dev/guides/slack-quick-start/)
143
+ - [Chat Configuration](https://herdctl.dev/configuration/agent-config/#chat)
144
+
145
+ ## Related Packages
146
+
147
+ - [`herdctl`](https://www.npmjs.com/package/herdctl) - CLI for running agent fleets
148
+ - [`@herdctl/core`](https://www.npmjs.com/package/@herdctl/core) - Core library for programmatic use
149
+ - [`@herdctl/chat`](https://www.npmjs.com/package/@herdctl/chat) - Shared chat infrastructure (used internally)
150
+ - [`@herdctl/discord`](https://www.npmjs.com/package/@herdctl/discord) - Discord connector
151
+ - [`@herdctl/web`](https://www.npmjs.com/package/@herdctl/web) - Web dashboard
152
+
153
+ ## License
154
+
155
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herdctl/slack",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Slack connector for herdctl fleet management",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -15,8 +15,8 @@
15
15
  "slackify-markdown": "^5.0.0",
16
16
  "yaml": "^2.3.0",
17
17
  "zod": "^3.22.0",
18
- "@herdctl/chat": "0.2.2",
19
- "@herdctl/core": "5.2.0"
18
+ "@herdctl/chat": "0.2.4",
19
+ "@herdctl/core": "5.2.2"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@vitest/coverage-v8": "^4.0.17",