obsidian-agent-fleet 0.4.3 → 0.4.4
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/README.md +5 -2
- package/SLACK_SETUP.md +285 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -163,10 +163,12 @@ If everything is healthy, respond with a one-line "all clear".
|
|
|
163
163
|
|
|
164
164
|
Chat with your agents from Slack — every message flows through the same Claude CLI session pipeline, with full tool use, session persistence, and agent memory.
|
|
165
165
|
|
|
166
|
-
**
|
|
166
|
+
> **📖 [Step-by-step Slack setup guide →](SLACK_SETUP.md)** — complete walkthrough from creating the Slack app to sending your first message.
|
|
167
|
+
|
|
168
|
+
**Quick overview:**
|
|
167
169
|
1. Create a Slack app at [api.slack.com](https://api.slack.com/apps) with Socket Mode + Agents & AI Apps enabled
|
|
168
170
|
2. Add credentials in Settings → Agent Fleet → Channel Credentials
|
|
169
|
-
3. Create `_fleet/channels/my-slack.md`
|
|
171
|
+
3. Create a channel via the dashboard or as `_fleet/channels/my-slack.md`
|
|
170
172
|
4. DM the bot from Slack
|
|
171
173
|
|
|
172
174
|
```yaml
|
|
@@ -445,6 +447,7 @@ An autonomous periodic run — what an agent does on a schedule without user inp
|
|
|
445
447
|
|
|
446
448
|
## Links
|
|
447
449
|
|
|
450
|
+
- [Slack Setup Guide](SLACK_SETUP.md)
|
|
448
451
|
- [Releases](https://github.com/denberek/obsidian-agent-fleet/releases)
|
|
449
452
|
- [npm package](https://www.npmjs.com/package/obsidian-agent-fleet)
|
|
450
453
|
- [Report Issues](https://github.com/denberek/obsidian-agent-fleet/issues)
|
package/SLACK_SETUP.md
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# Slack Setup Guide
|
|
2
|
+
|
|
3
|
+
Connect your Agent Fleet agents to Slack so you can chat with them from your phone, desktop, or anywhere Slack runs.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
Before you start, make sure you have:
|
|
10
|
+
|
|
11
|
+
- **Agent Fleet plugin** installed and running in Obsidian
|
|
12
|
+
- **At least one agent** configured in your fleet (the default Fleet Orchestrator works)
|
|
13
|
+
- **A Slack workspace** where you have permission to install apps (your own workspace or admin access)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Part 1: Create the Slack App
|
|
18
|
+
|
|
19
|
+
### Step 1 — Create a new app
|
|
20
|
+
|
|
21
|
+
1. Go to **https://api.slack.com/apps**
|
|
22
|
+
2. Click **Create New App** → **From scratch**
|
|
23
|
+
3. **App Name:** `Agent Fleet` (or any name you prefer)
|
|
24
|
+
4. **Pick a workspace:** select the Slack workspace you want to use
|
|
25
|
+
5. Click **Create App**
|
|
26
|
+
|
|
27
|
+
### Step 2 — Enable Socket Mode
|
|
28
|
+
|
|
29
|
+
Socket Mode lets the bot connect to Slack via an outbound WebSocket — no public URL, no port forwarding, works behind any firewall or NAT.
|
|
30
|
+
|
|
31
|
+
1. In the left sidebar, click **Socket Mode**
|
|
32
|
+
2. Toggle **Enable Socket Mode** → ON
|
|
33
|
+
3. You'll be prompted to create an App-Level Token:
|
|
34
|
+
- **Token Name:** `socket-token`
|
|
35
|
+
- **Scope:** select `connections:write`
|
|
36
|
+
- Click **Generate**
|
|
37
|
+
4. **Copy the `xapp-...` token** — this is your **App Token**. Save it somewhere safe, you won't see it again without regenerating.
|
|
38
|
+
|
|
39
|
+
### Step 3 — Enable Agents & AI Apps
|
|
40
|
+
|
|
41
|
+
This gives you the native "is thinking..." indicator and threaded assistant conversations.
|
|
42
|
+
|
|
43
|
+
1. In the left sidebar, click **Agents & AI Apps**
|
|
44
|
+
2. Click **Opt In** (or toggle ON)
|
|
45
|
+
3. Save
|
|
46
|
+
|
|
47
|
+
### Step 4 — Add Bot Token Scopes
|
|
48
|
+
|
|
49
|
+
1. In the left sidebar, click **OAuth & Permissions**
|
|
50
|
+
2. Scroll down to **Bot Token Scopes**
|
|
51
|
+
3. Click **Add an OAuth Scope** and add ALL of the following (one at a time):
|
|
52
|
+
|
|
53
|
+
| Scope | Purpose |
|
|
54
|
+
|-------|---------|
|
|
55
|
+
| `assistant:write` | Native "is thinking..." indicator and thread titles |
|
|
56
|
+
| `chat:write` | Send messages and replies |
|
|
57
|
+
| `commands` | Handle the `/agents` slash command |
|
|
58
|
+
| `im:history` | Read DM conversation history |
|
|
59
|
+
| `im:read` | Access DM metadata |
|
|
60
|
+
| `im:write` | Open DM conversations |
|
|
61
|
+
| `app_mentions:read` | Respond when @mentioned in channels |
|
|
62
|
+
| `reactions:write` | Add/remove emoji reactions (legacy, harmless to keep) |
|
|
63
|
+
|
|
64
|
+
### Step 5 — Subscribe to Bot Events
|
|
65
|
+
|
|
66
|
+
1. In the left sidebar, click **Event Subscriptions**
|
|
67
|
+
2. Toggle **Enable Events** → ON
|
|
68
|
+
3. Expand **Subscribe to bot events**
|
|
69
|
+
4. Click **Add Bot User Event** and add all four:
|
|
70
|
+
|
|
71
|
+
| Event | Purpose |
|
|
72
|
+
|-------|---------|
|
|
73
|
+
| `assistant_thread_started` | Detect new assistant conversations |
|
|
74
|
+
| `assistant_thread_context_changed` | Context switching (reserved for future use) |
|
|
75
|
+
| `message.im` | Receive DM messages |
|
|
76
|
+
| `app_mention` | Respond to @mentions in channels |
|
|
77
|
+
|
|
78
|
+
5. Click **Save Changes** at the bottom of the page
|
|
79
|
+
|
|
80
|
+
### Step 6 — Enable the Messages Tab
|
|
81
|
+
|
|
82
|
+
1. In the left sidebar, click **App Home**
|
|
83
|
+
2. Scroll to **Show Tabs**
|
|
84
|
+
3. Under **Messages Tab**, check: **Allow users to send Slash commands and messages from the messages tab**
|
|
85
|
+
|
|
86
|
+
### Step 7 — Register the /agents Slash Command
|
|
87
|
+
|
|
88
|
+
1. In the left sidebar, click **Slash Commands**
|
|
89
|
+
2. Click **Create New Command**
|
|
90
|
+
3. Fill in:
|
|
91
|
+
- **Command:** `/agents`
|
|
92
|
+
- **Short Description:** `List available agents`
|
|
93
|
+
- **Usage Hint:** _(leave blank)_
|
|
94
|
+
4. Click **Save**
|
|
95
|
+
|
|
96
|
+
### Step 8 — Install the App to Your Workspace
|
|
97
|
+
|
|
98
|
+
1. In the left sidebar, click **Install App**
|
|
99
|
+
2. Click **Install to Workspace**
|
|
100
|
+
3. Review and approve the permission screen
|
|
101
|
+
4. **Copy the Bot User OAuth Token** (`xoxb-...`) — this is your **Bot Token**
|
|
102
|
+
|
|
103
|
+
You now have two tokens:
|
|
104
|
+
- **App Token** (`xapp-...`) from Step 2
|
|
105
|
+
- **Bot Token** (`xoxb-...`) from Step 8
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Part 2: Configure Agent Fleet
|
|
110
|
+
|
|
111
|
+
### Step 1 — Add Slack Credentials
|
|
112
|
+
|
|
113
|
+
1. Open Obsidian
|
|
114
|
+
2. Go to **Settings → Agent Fleet**
|
|
115
|
+
3. Scroll down to **Channel Credentials**
|
|
116
|
+
4. Under **Add a Slack credential:**
|
|
117
|
+
- **Reference name:** `slack` (or any name — this is what your channel file will reference)
|
|
118
|
+
- **Bot token:** paste your `xoxb-...` token
|
|
119
|
+
- **App-level token:** paste your `xapp-...` token
|
|
120
|
+
5. Click **Add credential**
|
|
121
|
+
|
|
122
|
+
You should see the credential appear in the list above the form.
|
|
123
|
+
|
|
124
|
+
### Step 2 — Create a Channel
|
|
125
|
+
|
|
126
|
+
**Option A — Via the dashboard (recommended):**
|
|
127
|
+
|
|
128
|
+
1. Open the Agent Fleet dashboard
|
|
129
|
+
2. Click the **Channels** tab (last tab)
|
|
130
|
+
3. Click **+ New Channel**
|
|
131
|
+
4. Fill in:
|
|
132
|
+
- **Name:** `my-slack`
|
|
133
|
+
- **Type:** Slack (only option for now)
|
|
134
|
+
- **Credential:** select the credential you just added
|
|
135
|
+
- **Enabled:** ON
|
|
136
|
+
- **Default agent:** pick which agent handles messages by default
|
|
137
|
+
- **Allowed agents:** check the agents you want reachable via `@agent-name` prefix (leave unchecked for all)
|
|
138
|
+
- **Per-user sessions:** ON (each Slack user gets their own Claude session)
|
|
139
|
+
- **Allowed users:** enter your Slack user ID (see below how to find it)
|
|
140
|
+
- **Channel context:** optionally add instructions like "Keep replies concise, use Slack formatting"
|
|
141
|
+
5. Click **Create Channel**
|
|
142
|
+
|
|
143
|
+
**Option B — Via markdown file:**
|
|
144
|
+
|
|
145
|
+
Create `_fleet/channels/my-slack.md` in your vault:
|
|
146
|
+
|
|
147
|
+
```yaml
|
|
148
|
+
---
|
|
149
|
+
name: my-slack
|
|
150
|
+
type: slack
|
|
151
|
+
default_agent: fleet-orchestrator
|
|
152
|
+
allowed_agents:
|
|
153
|
+
- fleet-orchestrator
|
|
154
|
+
enabled: true
|
|
155
|
+
credential_ref: slack
|
|
156
|
+
allowed_users:
|
|
157
|
+
- U0AQW6P37N1
|
|
158
|
+
per_user_sessions: true
|
|
159
|
+
channel_context: |
|
|
160
|
+
You are being contacted via Slack. Keep replies concise.
|
|
161
|
+
---
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Step 3 — Find Your Slack User ID
|
|
165
|
+
|
|
166
|
+
The `allowed_users` field requires Slack user IDs (not usernames). To find yours:
|
|
167
|
+
|
|
168
|
+
1. Open Slack
|
|
169
|
+
2. Click your **avatar** or **profile picture** (top-right on desktop, or tap your name on mobile)
|
|
170
|
+
3. Click **Profile**
|
|
171
|
+
4. Click the **⋯** (three dots / more) button
|
|
172
|
+
5. Click **Copy member ID**
|
|
173
|
+
6. You'll get something like `U0AQW6P37N1`
|
|
174
|
+
|
|
175
|
+
Paste this into the **Allowed users** field.
|
|
176
|
+
|
|
177
|
+
### Step 4 — Verify the Connection
|
|
178
|
+
|
|
179
|
+
1. Go to the **Channels** tab in the Agent Fleet dashboard
|
|
180
|
+
2. Your channel card should show a **green status dot** within a few seconds
|
|
181
|
+
3. Status should say **connected**
|
|
182
|
+
|
|
183
|
+
**If the status is red**, open the Obsidian developer console (`Cmd+Opt+I` on Mac, `Ctrl+Shift+I` on Windows) and check for error messages:
|
|
184
|
+
|
|
185
|
+
| Error | Fix |
|
|
186
|
+
|-------|-----|
|
|
187
|
+
| `invalid_auth` | Wrong token — double-check both tokens in Settings |
|
|
188
|
+
| `not_enabled_for_socket_mode` | Go back to api.slack.com → Socket Mode → make sure it's ON |
|
|
189
|
+
| `missing_scope` | A required scope is missing — check Step 4 of Part 1 |
|
|
190
|
+
| `no_permission` | App wasn't reinstalled after adding scopes — reinstall in api.slack.com |
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Part 3: Start Chatting
|
|
195
|
+
|
|
196
|
+
### Send Your First Message
|
|
197
|
+
|
|
198
|
+
1. Open **Slack**
|
|
199
|
+
2. Find your bot in the **Apps** section of the left sidebar (not Direct Messages — Agents & AI Apps moves the bot to Apps)
|
|
200
|
+
3. Click on the bot → click **New chat** to start an assistant thread
|
|
201
|
+
4. Type a message: `Hey, what can you do?`
|
|
202
|
+
5. You should see:
|
|
203
|
+
- **"is thinking..."** indicator below the message composer
|
|
204
|
+
- A reply from the agent within 5-30 seconds
|
|
205
|
+
|
|
206
|
+
### Switch Between Agents
|
|
207
|
+
|
|
208
|
+
If you configured multiple agents in `allowed_agents`, you can switch mid-conversation:
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
@site-monitor: check if example.com is up
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
The thread title updates to show the active agent. Each agent gets its own isolated Claude session — switching back and forth resumes where each left off.
|
|
215
|
+
|
|
216
|
+
### List Available Agents
|
|
217
|
+
|
|
218
|
+
Type `/agents` in Slack. An ephemeral message (only visible to you) lists all agents configured for this channel.
|
|
219
|
+
|
|
220
|
+
### Use the Bot in Channels
|
|
221
|
+
|
|
222
|
+
You can also invite the bot to Slack channels:
|
|
223
|
+
|
|
224
|
+
1. Go to a channel (e.g., `#monitoring`)
|
|
225
|
+
2. Type `/invite @Agent Fleet`
|
|
226
|
+
3. Now anyone in the channel can mention the bot: `@Agent Fleet check the deployment status`
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Troubleshooting
|
|
231
|
+
|
|
232
|
+
### Bot Doesn't Appear in Slack
|
|
233
|
+
|
|
234
|
+
- Make sure you completed Step 6 (Enable Messages Tab)
|
|
235
|
+
- The bot appears under **Apps** in the sidebar, not under **Direct Messages** (this is how Slack's Agents & AI Apps works)
|
|
236
|
+
|
|
237
|
+
### Messages Are Silently Dropped
|
|
238
|
+
|
|
239
|
+
- Check that your Slack user ID is in the `allowed_users` list
|
|
240
|
+
- Empty `allowed_users` means NO ONE can reach the bot — add at least one user ID
|
|
241
|
+
|
|
242
|
+
### "is thinking..." Indicator Doesn't Show
|
|
243
|
+
|
|
244
|
+
- Verify the `assistant:write` scope is added (Step 4 of Part 1)
|
|
245
|
+
- Make sure you **reinstalled the app** after adding scopes (Step 8)
|
|
246
|
+
|
|
247
|
+
### Bot Stops Working When Obsidian Closes
|
|
248
|
+
|
|
249
|
+
This is expected. The Slack bot runs inside Obsidian via Socket Mode — when Obsidian is closed, the bot goes offline. Slack buffers messages briefly (~1 minute) during disconnects.
|
|
250
|
+
|
|
251
|
+
### Token Rotation After Reinstall
|
|
252
|
+
|
|
253
|
+
Every time you reinstall the Slack app (required after scope changes), the **Bot Token (`xoxb-...`) rotates**. You must:
|
|
254
|
+
1. Copy the new bot token from api.slack.com → Install App
|
|
255
|
+
2. Update it in Obsidian → Settings → Agent Fleet → Channel Credentials (remove old, add new)
|
|
256
|
+
|
|
257
|
+
The **App Token (`xapp-...`) does NOT rotate** on reinstall — it stays the same.
|
|
258
|
+
|
|
259
|
+
### Multiple Obsidian Instances
|
|
260
|
+
|
|
261
|
+
If you run the plugin on two machines pointed at the same Slack app, one will get kicked off the Socket Mode connection. Only one instance can be active per app token.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Heartbeat → Slack Delivery
|
|
266
|
+
|
|
267
|
+
You can configure agents to post their heartbeat results to Slack automatically:
|
|
268
|
+
|
|
269
|
+
1. Open the agent's edit page in the dashboard
|
|
270
|
+
2. Scroll to the **Heartbeat** section
|
|
271
|
+
3. Enable heartbeat and set a schedule
|
|
272
|
+
4. Set **Post to channel** to your Slack channel name (e.g., `my-slack`)
|
|
273
|
+
5. Write the heartbeat instruction
|
|
274
|
+
6. Save
|
|
275
|
+
|
|
276
|
+
Every time the heartbeat runs, the result is posted to the Slack channel as a DM to the first user in the allowed list, prefixed with the agent's name.
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Security Notes
|
|
281
|
+
|
|
282
|
+
- **Credentials** are stored in the plugin's `data.json` inside your vault's `.obsidian` folder. If you sync `.obsidian` across devices, credentials sync too. Do not commit this file to a public git repository.
|
|
283
|
+
- **Allowed users** is checked against Slack's cryptographically signed sender field (Socket Mode envelopes). It cannot be spoofed.
|
|
284
|
+
- **Agents with `approval_required`** cannot be bound to channels — they would deadlock because Slack has no approval UI.
|
|
285
|
+
- **Rate limiting** (default 20 messages per 5 minutes per conversation) protects against accidental or hostile budget burn.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "obsidian-agent-fleet",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Obsidian plugin for file-backed AI agents, task scheduling, channels (Slack), heartbeat, and interactive chat.",
|
|
5
5
|
"main": "plugin/main.js",
|
|
6
6
|
"bin": {
|
|
@@ -11,13 +11,15 @@
|
|
|
11
11
|
"plugin/main.js",
|
|
12
12
|
"plugin/manifest.json",
|
|
13
13
|
"plugin/styles.css",
|
|
14
|
-
"README.md"
|
|
14
|
+
"README.md",
|
|
15
|
+
"SLACK_SETUP.md"
|
|
15
16
|
],
|
|
16
17
|
"scripts": {
|
|
17
18
|
"build": "node esbuild.config.mjs production",
|
|
18
19
|
"dev": "node esbuild.config.mjs",
|
|
19
20
|
"test": "vitest run",
|
|
20
|
-
"typecheck": "tsc --noEmit"
|
|
21
|
+
"typecheck": "tsc --noEmit",
|
|
22
|
+
"postinstall": "node bin/cli.js install --auto || true"
|
|
21
23
|
},
|
|
22
24
|
"devDependencies": {
|
|
23
25
|
"@types/node": "^24.5.2",
|