obsidian-agent-fleet 0.13.4 → 0.14.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/DISCORD_SETUP.md +101 -0
- package/README.md +44 -13
- package/package.json +4 -3
- package/plugin/main.js +114 -83
- package/plugin/manifest.json +1 -1
- package/plugin/styles.css +4 -5
package/DISCORD_SETUP.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Discord Setup Guide
|
|
2
|
+
|
|
3
|
+
Connect your Agent Fleet agents to Discord so you can chat with them from your phone, desktop, or anywhere Discord runs — in servers, channels, threads, or DMs.
|
|
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 Discord server** where you have permission to add bots (your own server or admin access)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Part 1: Create the Discord Application
|
|
18
|
+
|
|
19
|
+
### Step 1 — Create a new application
|
|
20
|
+
|
|
21
|
+
1. Go to **https://discord.com/developers/applications**
|
|
22
|
+
2. Click **New Application**
|
|
23
|
+
3. **Name:** `Agent Fleet` (or any name you prefer)
|
|
24
|
+
4. Accept the terms and click **Create**
|
|
25
|
+
|
|
26
|
+
### Step 2 — Create the bot and copy its token
|
|
27
|
+
|
|
28
|
+
1. In the left sidebar, click **Bot**
|
|
29
|
+
2. Click **Reset Token** (or **Add Bot** on older UIs) and confirm
|
|
30
|
+
3. **Copy the token** — this is your **Bot Token**. Save it somewhere safe; you won't see it again without resetting.
|
|
31
|
+
|
|
32
|
+
### Step 3 — Enable the Message Content intent (required)
|
|
33
|
+
|
|
34
|
+
The bot can't read message text without this privileged intent.
|
|
35
|
+
|
|
36
|
+
1. Still on the **Bot** page, scroll to **Privileged Gateway Intents**
|
|
37
|
+
2. Toggle **Message Content Intent** → ON
|
|
38
|
+
3. Save changes
|
|
39
|
+
|
|
40
|
+
> If you skip this, the bot connects but every message arrives with empty text, and the Gateway may close with error code `4014`. The plugin logs a clear hint in the console when this happens.
|
|
41
|
+
|
|
42
|
+
### Step 4 — Invite the bot to your server
|
|
43
|
+
|
|
44
|
+
1. In the left sidebar, open **OAuth2 → URL Generator**
|
|
45
|
+
2. Under **Scopes**, check:
|
|
46
|
+
- `bot`
|
|
47
|
+
- `applications.commands` (for the `/agents` slash command)
|
|
48
|
+
3. Under **Bot Permissions**, check:
|
|
49
|
+
- **Send Messages**
|
|
50
|
+
- **Send Messages in Threads**
|
|
51
|
+
- **Read Message History**
|
|
52
|
+
- **Use Slash Commands**
|
|
53
|
+
4. Copy the generated URL at the bottom, open it in your browser, pick your server, and click **Authorize**.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Part 2: Configure Agent Fleet
|
|
58
|
+
|
|
59
|
+
### Step 5 — Add the credential
|
|
60
|
+
|
|
61
|
+
1. In Obsidian, open **Settings → Agent Fleet → Channel Credentials**
|
|
62
|
+
2. Under **Add a channel credential**:
|
|
63
|
+
- **Reference name:** `discord-creds` (any name; referenced by `credential_ref` in the channel file)
|
|
64
|
+
- **Type:** `Discord`
|
|
65
|
+
- **Bot token:** paste the token from Step 2
|
|
66
|
+
3. Click **Add credential**
|
|
67
|
+
|
|
68
|
+
### Step 6 — Create the channel
|
|
69
|
+
|
|
70
|
+
1. Open the Agent Fleet dashboard → **Channels** → **New Channel**
|
|
71
|
+
2. Fill in:
|
|
72
|
+
- **Name:** e.g. `my-discord`
|
|
73
|
+
- **Type:** `discord`
|
|
74
|
+
- **Credential:** `discord-creds`
|
|
75
|
+
- **Default agent:** the agent to use when no `@agent-name` prefix is given
|
|
76
|
+
- **Allowed agents:** (optional) the agents reachable via `@agent-name` or `/agents`
|
|
77
|
+
- **Allowed users:** your numeric Discord user ID(s), one per line. Only listed users can reach the bot. (Enable Developer Mode in Discord → right-click your name → **Copy User ID**.)
|
|
78
|
+
3. Save. The channel should show **connected** in the dashboard within a few seconds.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Using it
|
|
83
|
+
|
|
84
|
+
- **Mention or DM the bot.** In a server channel, `@Agent Fleet do the thing` (or just message it in a DM).
|
|
85
|
+
- **Pick an agent per conversation.** Prefix a message with `@agent-name ...`, or run the **`/agents`** slash command and click a button. The choice sticks for that channel/thread until you change it.
|
|
86
|
+
- Global slash commands can take up to ~1 hour to appear the first time after the bot joins.
|
|
87
|
+
- **Threads and channels are isolated.** Each channel or thread keeps its own conversation and agent binding.
|
|
88
|
+
- **Images.** Attach an image and the agent receives it (saved into your vault).
|
|
89
|
+
- **Long replies** are automatically split to fit Discord's 2000-character limit.
|
|
90
|
+
- **Heartbeats.** If an agent's `heartbeatChannel` points at this Discord channel, the heartbeat result is delivered as a DM to the first allowed user.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Troubleshooting
|
|
95
|
+
|
|
96
|
+
| Symptom | Fix |
|
|
97
|
+
|---------|-----|
|
|
98
|
+
| Channel stuck on **needs-auth** | Check the bot token; ensure the **Message Content intent** is enabled (Step 3). |
|
|
99
|
+
| Bot replies but ignores your text / empty messages | Message Content intent is off — enable it and reconnect. |
|
|
100
|
+
| `/agents` command missing | Global commands can take up to ~1h to propagate; ensure the bot was invited with the `applications.commands` scope. |
|
|
101
|
+
| Bot doesn't respond at all | Confirm your numeric user ID is in **Allowed users**, and the bot has Send Messages / Read Message History in that channel. |
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent Fleet for Obsidian
|
|
2
2
|
|
|
3
|
-
**Turn Obsidian into an AI-powered command center. Create autonomous agents on Claude Code or OpenAI Codex, schedule tasks, chat in real-time, connect via Slack or
|
|
3
|
+
**Turn Obsidian into an AI-powered command center. Create autonomous agents on Claude Code or OpenAI Codex, schedule tasks, chat in real-time, connect via Slack, Telegram, or Discord, and hook into any MCP service — all from your vault.**
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
@@ -22,19 +22,19 @@ Agent Fleet is an Obsidian plugin that lets you build, configure, and run AI age
|
|
|
22
22
|
|
|
23
23
|
📊 **Live chat stats** — Compact terminal-style strip under the composer shows the model and a context-usage bar so you always know where you stand on context.
|
|
24
24
|
|
|
25
|
-
📡 **Slack &
|
|
25
|
+
📡 **Slack, Telegram & Discord** — Chat with your agents from Slack, Telegram, or Discord. Multi-agent routing via `@agent-name` prefix or interactive buttons, native typing indicators, image attachments, and session persistence across restarts. Any task or heartbeat can also post its full output to a specific channel.
|
|
26
26
|
|
|
27
|
-
💓 **Heartbeat** — Autonomous periodic agent runs. Define what an agent does when no one is asking — monitoring, reports, health checks — with results posted to Slack.
|
|
27
|
+
💓 **Heartbeat** — Autonomous periodic agent runs. Define what an agent does when no one is asking — monitoring, reports, health checks — with results posted to a Slack, Telegram, or Discord channel (broadcast, DM, or a specific channel/chat by id).
|
|
28
28
|
|
|
29
|
-
📋 **Task Board** — Kanban view with scheduling, priority, real-time progress tracking, and abort. Tasks run on cron schedules or on-demand. Per-task model override lets you route a simple nightly summary to Haiku while keeping the agent on Opus.
|
|
29
|
+
📋 **Task Board** — Kanban view with scheduling, priority, real-time progress tracking, and abort. Tasks run on cron schedules or on-demand. Per-task model override lets you route a simple nightly summary to Haiku while keeping the agent on Opus, and per-task channel delivery posts the result straight to Slack/Telegram/Discord.
|
|
30
30
|
|
|
31
31
|
🎛️ **Model picker** — Choose between aliases (`opus` / `sonnet` / `haiku` / `opusplan` — backend-agnostic), pinned IDs, or Bedrock/Vertex/Foundry formats. One place to configure: settings default, per-agent, or per-task override. Runs log both the requested alias and the concrete resolved model.
|
|
32
32
|
|
|
33
33
|
🔌 **MCP Integration** — Register an MCP server **once** and it's available to **any** agent on **either** adapter (Claude Code or Codex). Servers live in a fleet-owned registry (`_fleet/mcp/`) and are projected into each run; your native `~/.claude.json` and `~/.codex/config.toml` are never modified. One-click OAuth 2.1 (or a static bearer token), stored in your OS keychain and projected to both backends.
|
|
34
34
|
|
|
35
|
-
🧠 **Agent Memory** — A two-tier, self-curating memory (curated working set + append-only ground truth) that agents write via a `remember` tool or `[REMEMBER]` tags, on both Claude and Codex. An optional nightly **reflection** consolidates it and can propose new skills from recurring patterns (approval-gated).
|
|
35
|
+
🧠 **Agent Memory** — A two-tier, self-curating memory (curated working set + append-only ground truth) that agents write via a `remember` tool or `[REMEMBER]` tags, on both Claude and Codex. An optional nightly **reflection** consolidates it and can propose new skills from recurring patterns (approval-gated) — and now runs visibly, showing live in the dashboard and writing a run log with its full output.
|
|
36
36
|
|
|
37
|
-
📊 **Dashboard** — Overview with run charts, success rates, token/cost tracking, activity timeline, fleet status, streaming output from active agents, and focused run-detail panels that lead with the final result and hide the full reasoning transcript behind a toggle.
|
|
37
|
+
📊 **Dashboard** — Overview with run charts, success rates, token/cost tracking, activity timeline, fleet status, streaming output from active agents, and focused run-detail panels that lead with the final result and hide the full reasoning transcript behind a toggle. Token and cost totals span **every** run — tasks, heartbeats, chat, and channel turns — via a unified usage ledger.
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
@@ -186,7 +186,8 @@ A heartbeat gives an agent autonomous behavior — what it does when no one is a
|
|
|
186
186
|
enabled: true
|
|
187
187
|
schedule: "0 */6 * * *" # every 6 hours
|
|
188
188
|
notify: true # Obsidian notice on completion
|
|
189
|
-
channel: my-slack # post results to
|
|
189
|
+
channel: my-slack # post results to a channel (optional)
|
|
190
|
+
channel_target: C0123456789 # a specific Slack/Discord channel id or Telegram chat id (optional)
|
|
190
191
|
---
|
|
191
192
|
|
|
192
193
|
Check all monitored endpoints for availability and response time.
|
|
@@ -197,7 +198,7 @@ If everything is healthy, respond with a one-line "all clear".
|
|
|
197
198
|
**Key behaviors:**
|
|
198
199
|
- The **"Run Now" button** on any agent with a heartbeat uses the heartbeat instruction (no more generic fallback)
|
|
199
200
|
- **Agent memory integration** — heartbeats can use `[REMEMBER]` tags to track trends across runs
|
|
200
|
-
- **
|
|
201
|
+
- **Channel delivery** — results automatically posted to a configured Slack, Telegram, or Discord channel; set `channel_target` to route to one specific channel/chat rather than the channel's default
|
|
201
202
|
- **Dashboard** — heartbeat status shown on the agent's Overview tab with enable/disable toggle, schedule, and next run time
|
|
202
203
|
|
|
203
204
|
---
|
|
@@ -270,6 +271,33 @@ Chat with your agents from Telegram — simpler setup than Slack, no @mention re
|
|
|
270
271
|
|
|
271
272
|
---
|
|
272
273
|
|
|
274
|
+
### Discord
|
|
275
|
+
|
|
276
|
+
Chat with your agents from Discord — in servers, channels, threads, or DMs.
|
|
277
|
+
|
|
278
|
+
> **📖 [Step-by-step Discord setup guide →](DISCORD_SETUP.md)** — complete walkthrough from creating the Discord app to sending your first message.
|
|
279
|
+
|
|
280
|
+
**Setup:**
|
|
281
|
+
1. Create an application at [discord.com/developers](https://discord.com/developers/applications), add a bot, and copy its token
|
|
282
|
+
2. **Enable the Message Content privileged intent** (required to read messages)
|
|
283
|
+
3. Invite the bot with the `bot` + `applications.commands` scopes
|
|
284
|
+
4. Add the token in Settings → Agent Fleet → Channel Credentials (type: Discord)
|
|
285
|
+
5. Create a channel via the dashboard or as `_fleet/channels/my-discord.md`
|
|
286
|
+
6. Mention or DM the bot in Discord
|
|
287
|
+
|
|
288
|
+
**Features:**
|
|
289
|
+
- **Gateway over WebSocket** — outbound connection, works behind NAT/firewalls, no public URL; hand-rolled over `ws`, no `discord.js` dependency
|
|
290
|
+
- **Servers, threads & DMs** — every channel or thread is an isolated conversation with its own agent binding
|
|
291
|
+
- **Typing indicator** — native typing dots while the agent works (auto-refreshed)
|
|
292
|
+
- **Button agent picker** — the `/agents` slash command shows interactive buttons to switch agents; `@agent-name` prefix routing also works
|
|
293
|
+
- **Image attachments** — images are downloaded into your vault and passed to the agent
|
|
294
|
+
- **Session persistence** — conversations survive Obsidian restarts via the backend's resume (Claude `--resume` / Codex `exec resume`)
|
|
295
|
+
- **Allowlist** — only approved Discord users (by numeric ID) can reach the bot
|
|
296
|
+
- **2000-char message splitting** — long replies automatically chunked at paragraph boundaries
|
|
297
|
+
- **Auto-reconnect & resume** — Gateway RESUME on transient drops with exponential backoff
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
273
301
|
### Interactive Chat
|
|
274
302
|
|
|
275
303
|
The chat panel is a first-class Obsidian view — dock it in the sidebar, center, or any split.
|
|
@@ -277,6 +305,7 @@ The chat panel is a first-class Obsidian view — dock it in the sidebar, center
|
|
|
277
305
|
**Features:**
|
|
278
306
|
- **Agent Switcher** — dropdown to switch between agents instantly. Each agent has its own conversation.
|
|
279
307
|
- **Session Persistence** — conversations survive Obsidian restarts via the backend's resume (Claude `--resume` / Codex `exec resume`)
|
|
308
|
+
- **Enter to send** — Enter sends your message, Shift+Enter inserts a newline (IME-safe, so composing in other languages won't fire early).
|
|
280
309
|
- **Bidirectional Streaming** — send follow-up messages while the agent is working. Steer it mid-task.
|
|
281
310
|
- **Document Attachment** — click + to attach the active document. Agent gets the full content; you see a compact pill.
|
|
282
311
|
- **Image Paste & Drop** — paste from clipboard or drag images into chat. Saved to vault, passed to the agent.
|
|
@@ -306,6 +335,7 @@ A kanban view for managing agent tasks with five columns:
|
|
|
306
335
|
- **Cron Scheduling** — human-friendly picker (daily, weekdays, weekly, monthly, custom)
|
|
307
336
|
- **Catch Up If Missed** — auto-run overdue tasks when Obsidian opens
|
|
308
337
|
- **Run Now** — execute any task immediately regardless of schedule
|
|
338
|
+
- **Channel delivery** — post a task's full output to a channel via `channel:` (broadcast or DM) and optionally `channel_target:` (a specific Slack/Discord channel id or Telegram chat id); works on every transport
|
|
309
339
|
- **Drag & Drop** — move tasks between backlog and scheduled columns
|
|
310
340
|
|
|
311
341
|
---
|
|
@@ -417,7 +447,7 @@ A two-tier, self-curating memory that works on **task, heartbeat, and chat** run
|
|
|
417
447
|
|
|
418
448
|
Captures land in `working.md` immediately, so the next run/turn sees them. Memory is agent-scoped (shared across all conversations, including channels).
|
|
419
449
|
|
|
420
|
-
**Reflection ("dreaming")** — enable `reflection_enabled` and a nightly run (`reflection_schedule`, default `0 3 * * *`) consolidates memory from the raw log: dedups, resolves contradictions, summarizes from ground truth to fit the budget, and keeps pinned preferences. With `reflection_propose_skills`, recurring friction becomes an approval-gated **skill proposal** in the Inbox. A failed reflection never wipes memory. Trigger manually with **Reflect now** on the agent.
|
|
450
|
+
**Reflection ("dreaming")** — enable `reflection_enabled` and a nightly run (`reflection_schedule`, default `0 3 * * *`) consolidates memory from the raw log: dedups, resolves contradictions, summarizes from ground truth to fit the budget, and keeps pinned preferences. With `reflection_propose_skills`, recurring friction becomes an approval-gated **skill proposal** in the Inbox. A failed reflection never wipes memory. Trigger manually with **Reflect now** on the agent. Reflection runs **visibly** — it shows live in the dashboard's Active Agents card and writes a run log to Recent Activity with its full output, so you can see exactly what it consolidated.
|
|
421
451
|
|
|
422
452
|
> Legacy single-file memory (`_fleet/memory/<agent>.md`) is migrated automatically. `memory_max_entries` is superseded by `memory_token_budget`.
|
|
423
453
|
|
|
@@ -497,7 +527,7 @@ _fleet/
|
|
|
497
527
|
├── agents/ Agent folders (agent.md, config.md, HEARTBEAT.md, etc.)
|
|
498
528
|
├── skills/ Shared skill folders (skill.md, tools.md, etc.)
|
|
499
529
|
├── tasks/ Task files with frontmatter
|
|
500
|
-
├── channels/ Channel bindings (Slack, Telegram)
|
|
530
|
+
├── channels/ Channel bindings (Slack, Telegram, Discord)
|
|
501
531
|
├── mcp/ Registered MCP servers (one markdown file each)
|
|
502
532
|
├── runs/ Execution logs by date
|
|
503
533
|
│ └── YYYY-MM-DD/
|
|
@@ -535,20 +565,21 @@ Yes. Each agent has persistent chat sessions that survive Obsidian restarts via
|
|
|
535
565
|
**Q: Does the Slack bot work when Obsidian is closed?**
|
|
536
566
|
No. The bot runs inside Obsidian via Socket Mode — when Obsidian is closed, the bot goes offline. Slack buffers messages briefly during short disconnects.
|
|
537
567
|
|
|
538
|
-
**Q: Can I use multiple agents in Slack or
|
|
539
|
-
Yes. Type `@agent-name: message` to switch agents, or use `/agents` to get interactive buttons. Each agent maintains its own session. Works in
|
|
568
|
+
**Q: Can I use multiple agents in Slack, Telegram, or Discord?**
|
|
569
|
+
Yes. Type `@agent-name: message` to switch agents, or use `/agents` to get interactive buttons. Each agent maintains its own session. Works in all three transports.
|
|
540
570
|
|
|
541
571
|
**Q: Which is easier to set up — Slack or Telegram?**
|
|
542
572
|
Telegram. Create a bot via @BotFather (30 seconds), paste the token, create a channel. Slack requires creating an app with Socket Mode, scopes, events, and reinstalls after scope changes.
|
|
543
573
|
|
|
544
574
|
**Q: What is a heartbeat?**
|
|
545
|
-
An autonomous periodic run — what an agent does on a schedule without user input. Configured via `HEARTBEAT.md` in the agent's folder. Results can be posted to Slack or
|
|
575
|
+
An autonomous periodic run — what an agent does on a schedule without user input. Configured via `HEARTBEAT.md` in the agent's folder. Results can be posted to Slack, Telegram, or Discord automatically — to the channel default or a specific channel/chat via `channel_target`.
|
|
546
576
|
|
|
547
577
|
---
|
|
548
578
|
|
|
549
579
|
## Links
|
|
550
580
|
|
|
551
581
|
- [Slack Setup Guide](SLACK_SETUP.md)
|
|
582
|
+
- [Discord Setup Guide](DISCORD_SETUP.md)
|
|
552
583
|
- [Releases](https://github.com/denberek/obsidian-agent-fleet/releases)
|
|
553
584
|
- [npm package](https://www.npmjs.com/package/obsidian-agent-fleet)
|
|
554
585
|
- [Report Issues](https://github.com/denberek/obsidian-agent-fleet/issues)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "obsidian-agent-fleet",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Obsidian plugin for file-backed AI agents, task scheduling, channels (Slack), heartbeat, and interactive chat.",
|
|
3
|
+
"version": "0.14.0",
|
|
4
|
+
"description": "Obsidian plugin for file-backed AI agents, task scheduling, channels (Slack, Telegram, Discord), heartbeat, and interactive chat.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "plugin/main.js",
|
|
7
7
|
"bin": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"plugin/styles.css",
|
|
15
15
|
"README.md",
|
|
16
16
|
"SLACK_SETUP.md",
|
|
17
|
+
"DISCORD_SETUP.md",
|
|
17
18
|
"LICENSE",
|
|
18
19
|
"screenshot.png"
|
|
19
20
|
],
|
|
@@ -35,6 +36,6 @@
|
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
38
|
"croner": "^8.1.2",
|
|
38
|
-
"ws": "^8.
|
|
39
|
+
"ws": "^8.21.0"
|
|
39
40
|
}
|
|
40
41
|
}
|