obsidian-agent-fleet 0.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/README.md +367 -0
- package/bin/cli.js +125 -0
- package/package.json +31 -0
- package/plugin/main.js +20761 -0
- package/plugin/manifest.json +10 -0
- package/plugin/styles.css +3911 -0
package/README.md
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
# Agent Fleet for Obsidian
|
|
2
|
+
|
|
3
|
+
**Turn Obsidian into an AI-powered command center. Create autonomous agents, schedule tasks, chat in real-time, and connect to any MCP service — all from your vault.**
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What is Agent Fleet?
|
|
10
|
+
|
|
11
|
+
Agent Fleet is an Obsidian plugin that lets you build, configure, and run AI agents directly from your vault. Agents are powered by **Claude Code CLI** — works with a Claude Max/Pro subscription or Anthropic API key. Every agent, skill, task, and run log is a markdown file. If the plugin disappears, your knowledge stays.
|
|
12
|
+
|
|
13
|
+
### Core Capabilities
|
|
14
|
+
|
|
15
|
+
🤖 **AI Agents** — Create specialized agents with system prompts, skills, permissions, and memory. Each agent is a folder of markdown files you fully own and control.
|
|
16
|
+
|
|
17
|
+
💬 **Interactive Chat** — Dock a chat panel anywhere in Obsidian. Switch between agents. Attach documents and images. Send follow-up messages while the agent works.
|
|
18
|
+
|
|
19
|
+
📋 **Task Board** — Kanban view with scheduling, priority, real-time progress tracking, and abort. Tasks run on cron schedules or on-demand.
|
|
20
|
+
|
|
21
|
+
🔌 **MCP Integration** — Discover, authenticate, and inspect MCP servers. One-click OAuth 2.1 authentication. Assign MCP tools to specific agents.
|
|
22
|
+
|
|
23
|
+
🧠 **Agent Memory** — Agents persist context across sessions using `[REMEMBER]` tags stored as markdown.
|
|
24
|
+
|
|
25
|
+
📊 **Dashboard** — Overview with run charts, success rates, activity timeline, fleet status, and streaming output from active agents.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
### Install
|
|
32
|
+
|
|
33
|
+
**Via npm (recommended):**
|
|
34
|
+
```bash
|
|
35
|
+
npm install -g obsidian-agent-fleet
|
|
36
|
+
```
|
|
37
|
+
The installer automatically finds your Obsidian vaults and copies the plugin files.
|
|
38
|
+
|
|
39
|
+
**Via BRAT:**
|
|
40
|
+
1. Install the [BRAT plugin](https://github.com/TfTHacker/obsidian42-brat)
|
|
41
|
+
2. Add beta plugin: `denberek/obsidian-agent-fleet`
|
|
42
|
+
3. Enable Agent Fleet in Settings → Community Plugins
|
|
43
|
+
|
|
44
|
+
**Manual:**
|
|
45
|
+
1. Download `main.js`, `manifest.json`, `styles.css` from the [latest release](https://github.com/denberek/obsidian-agent-fleet/releases)
|
|
46
|
+
2. Create `<vault>/.obsidian/plugins/agent-fleet/`
|
|
47
|
+
3. Copy the 3 files into that folder
|
|
48
|
+
4. Restart Obsidian → Enable Agent Fleet
|
|
49
|
+
|
|
50
|
+
### Requirements
|
|
51
|
+
|
|
52
|
+
- **Obsidian** 1.6.0+ (desktop only)
|
|
53
|
+
- **[Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code)** — the engine behind all agent execution:
|
|
54
|
+
```bash
|
|
55
|
+
npm install -g @anthropic-ai/claude-code
|
|
56
|
+
claude # authenticate on first run
|
|
57
|
+
```
|
|
58
|
+
- **Claude subscription** (Max or Pro) or **Anthropic API key** — Claude Code works with your existing subscription, no separate API costs. If you're already paying for Claude, you're ready to go.
|
|
59
|
+
|
|
60
|
+
### First Launch
|
|
61
|
+
|
|
62
|
+
On first launch, Agent Fleet creates a `_fleet/` folder in your vault:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
_fleet/
|
|
66
|
+
├── agents/
|
|
67
|
+
│ └── fleet-orchestrator/ ← default agent (manages the fleet)
|
|
68
|
+
├── skills/ ← 18 built-in skills
|
|
69
|
+
├── tasks/
|
|
70
|
+
├── runs/
|
|
71
|
+
└── memory/
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The **Fleet Orchestrator** agent is ready — click Chat to ask it to create new agents, tasks, or skills.
|
|
75
|
+
|
|
76
|
+
### Update
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm update -g obsidian-agent-fleet
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Or via BRAT: settings → check for updates.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Features
|
|
87
|
+
|
|
88
|
+
### Agents
|
|
89
|
+
|
|
90
|
+
Agents are AI assistants with specific personalities, capabilities, and permissions. Each agent is a folder in `_fleet/agents/` containing markdown files:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
agents/my-agent/
|
|
94
|
+
├── agent.md ← Identity: name, description, system prompt
|
|
95
|
+
├── config.md ← Runtime: model, timeout, permissions
|
|
96
|
+
├── SKILLS.md ← Agent-specific skills
|
|
97
|
+
└── CONTEXT.md ← Project context
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**What you can configure:**
|
|
101
|
+
|
|
102
|
+
| Setting | Description |
|
|
103
|
+
|---------|-------------|
|
|
104
|
+
| **Name & Description** | Identity shown in the dashboard |
|
|
105
|
+
| **Avatar** | Lucide icon picker (1,400+ icons) or emoji |
|
|
106
|
+
| **System Prompt** | Core instructions that define the agent's behavior |
|
|
107
|
+
| **Model** | Claude Opus 4.6, Sonnet 4.6, Haiku 4.5, Bedrock models, or custom |
|
|
108
|
+
| **Adapter** | Claude Code (more adapters coming soon) |
|
|
109
|
+
| **Working Directory** | Where the agent operates (defaults to vault root) |
|
|
110
|
+
| **Timeout** | Max execution time in seconds |
|
|
111
|
+
| **Permission Mode** | bypassPermissions, dontAsk, acceptEdits, or plan |
|
|
112
|
+
| **Allow/Deny Lists** | Fine-grained tool control (e.g., allow `Bash(curl *)`, deny `Bash(rm -rf *)`) |
|
|
113
|
+
| **Skills** | Shared skills from the skill library |
|
|
114
|
+
| **MCP Servers** | Which MCP servers the agent can access |
|
|
115
|
+
| **Memory** | Persistent context across sessions via `[REMEMBER]` tags |
|
|
116
|
+
|
|
117
|
+
**Permission Modes:**
|
|
118
|
+
|
|
119
|
+
| Mode | Behavior |
|
|
120
|
+
|------|----------|
|
|
121
|
+
| `bypassPermissions` | Auto-runs everything except deny list |
|
|
122
|
+
| `dontAsk` | Only allow-listed commands run |
|
|
123
|
+
| `acceptEdits` | File edits auto-approved, bash blocked unless allowed |
|
|
124
|
+
| `plan` | Read-only — no writes, no commands |
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### Interactive Chat
|
|
129
|
+
|
|
130
|
+
The chat panel is a first-class Obsidian view — dock it in the sidebar, center, or any split.
|
|
131
|
+
|
|
132
|
+
**Features:**
|
|
133
|
+
- **Agent Switcher** — dropdown to switch between agents instantly. Each agent has its own conversation.
|
|
134
|
+
- **Session Persistence** — conversations survive Obsidian restarts via Claude CLI `--resume`
|
|
135
|
+
- **Bidirectional Streaming** — send follow-up messages while the agent is working. Steer it mid-task.
|
|
136
|
+
- **Document Attachment** — click + to attach the active document. Agent gets the full content; you see a compact pill.
|
|
137
|
+
- **Image Paste & Drop** — paste from clipboard or drag images into chat. Saved to vault, passed to Claude.
|
|
138
|
+
- **Stop Button** — + button becomes ■ while agent works. Click to abort.
|
|
139
|
+
- **Streaming Markdown** — responses render in real-time with syntax highlighting
|
|
140
|
+
- **Code Block Copy** — hover any code block for a copy button
|
|
141
|
+
- **Tool Activity** — see which tools the agent is using in real-time
|
|
142
|
+
|
|
143
|
+
**Keyboard shortcuts:**
|
|
144
|
+
- `Ctrl+Enter` / `Cmd+Enter` — send message
|
|
145
|
+
- Ribbon icon (💬) or command palette to open chat
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### Task Board
|
|
150
|
+
|
|
151
|
+
A kanban view for managing agent tasks with five columns:
|
|
152
|
+
|
|
153
|
+
| Column | Description |
|
|
154
|
+
|--------|-------------|
|
|
155
|
+
| **Backlog** | Tasks with no schedule, waiting to be run manually |
|
|
156
|
+
| **Scheduled** | Tasks with a cron schedule, enabled and waiting |
|
|
157
|
+
| **Running** | Currently executing — shows real-time progress bar tied to timeout |
|
|
158
|
+
| **Done** | Completed today |
|
|
159
|
+
| **Failed** | Failed, timed out, or cancelled today |
|
|
160
|
+
|
|
161
|
+
**Task features:**
|
|
162
|
+
- **Priority** — low / medium / high / critical (color-coded left border)
|
|
163
|
+
- **Real-time Progress** — progress bar shows elapsed time vs timeout, updates every second
|
|
164
|
+
- **Stop Button** — red ■ on running cards to abort (shows as "Cancelled", not "Failed")
|
|
165
|
+
- **Cron Scheduling** — human-friendly picker (daily, weekdays, weekly, monthly, custom)
|
|
166
|
+
- **Catch Up If Missed** — auto-run overdue tasks when Obsidian opens
|
|
167
|
+
- **Run Now** — execute any task immediately regardless of schedule
|
|
168
|
+
- **Drag & Drop** — move tasks between backlog and scheduled columns
|
|
169
|
+
|
|
170
|
+
**Creating tasks:**
|
|
171
|
+
|
|
172
|
+
Full-page form with:
|
|
173
|
+
1. Title + Agent + Priority + Tags
|
|
174
|
+
2. Instructions (what the agent should do)
|
|
175
|
+
3. Optional schedule with frequency picker
|
|
176
|
+
4. "Catch up if missed" toggle for scheduled tasks
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
### MCP Servers
|
|
181
|
+
|
|
182
|
+
Discover and manage all MCP (Model Context Protocol) servers configured in Claude Code.
|
|
183
|
+
|
|
184
|
+
**Discovery:**
|
|
185
|
+
- **stdio servers** — spawned and probed directly via JSON-RPC (~1-2s)
|
|
186
|
+
- **HTTP/SSE servers** — probed with OAuth tokens for full tool schemas
|
|
187
|
+
- **Plugin metadata** — descriptions from Claude's plugin directory
|
|
188
|
+
|
|
189
|
+
**OAuth 2.1 Authentication:**
|
|
190
|
+
|
|
191
|
+
One-click browser-based auth for MCP servers:
|
|
192
|
+
1. Click "Authenticate" on any server card
|
|
193
|
+
2. Plugin discovers OAuth endpoints automatically
|
|
194
|
+
3. Registers via Dynamic Client Registration
|
|
195
|
+
4. Opens browser for approval (PKCE flow)
|
|
196
|
+
5. Tokens stored in plugin settings, auto-refresh
|
|
197
|
+
|
|
198
|
+
**Server Management:**
|
|
199
|
+
- Enable/disable toggle per server (writes to Claude's settings)
|
|
200
|
+
- Server cards show status, tool count, type, description
|
|
201
|
+
- Detail slideover with full tool list, descriptions, input schemas, parameters
|
|
202
|
+
- Assign MCP servers to specific agents in the agent editor
|
|
203
|
+
|
|
204
|
+
**Progress Indicator:**
|
|
205
|
+
Animated loading during discovery with phase-specific feedback (scanning → details → tools → done).
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
### Skills
|
|
210
|
+
|
|
211
|
+
Reusable instruction sets that agents share. Each skill is a folder:
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
skills/my-skill/
|
|
215
|
+
├── skill.md ← Core instructions
|
|
216
|
+
├── tools.md ← CLI/API tool documentation
|
|
217
|
+
├── references.md ← Background docs
|
|
218
|
+
└── examples.md ← Few-shot examples
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**18 Built-in Skills:**
|
|
222
|
+
|
|
223
|
+
| Skill | Description |
|
|
224
|
+
|-------|-------------|
|
|
225
|
+
| `agent-fleet-system` | Full knowledge of the Agent Fleet plugin |
|
|
226
|
+
| `algorithmic-art` | Generative art with p5.js |
|
|
227
|
+
| `canvas-design` | Visual art, posters, static designs as PNG/PDF |
|
|
228
|
+
| `claude-api` | Build apps with Claude API and Anthropic SDKs |
|
|
229
|
+
| `doc-coauthoring` | Structured co-authoring workflow for documentation |
|
|
230
|
+
| `docx` | Create, read, edit Word (.docx) files |
|
|
231
|
+
| `frontend-design` | Production-grade web UIs and components |
|
|
232
|
+
| `internal-comms` | Status reports, newsletters, incident reports |
|
|
233
|
+
| `mcp-builder` | Build MCP servers for LLM-to-service integration |
|
|
234
|
+
| `pdf` | Read, create, merge, split, OCR PDF files |
|
|
235
|
+
| `pptx` | Create, read, edit PowerPoint (.pptx) files |
|
|
236
|
+
| `skill-creator` | Create, evaluate, and optimize skills |
|
|
237
|
+
| `slack-gif-creator` | Animated GIFs optimized for Slack |
|
|
238
|
+
| `taste-skill` | Senior UI/UX engineering for frontend design |
|
|
239
|
+
| `frontend-slides` | HTML presentation creation |
|
|
240
|
+
| And more... | |
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
### Dashboard
|
|
245
|
+
|
|
246
|
+
The main overview with:
|
|
247
|
+
|
|
248
|
+
- **Stat Cards** — active agents, runs today, tokens used, scheduled tasks
|
|
249
|
+
- **Run Activity Chart** — 14-day bar chart with green (success), yellow (cancelled), red (failure)
|
|
250
|
+
- **Success Rate Donut** — overall success percentage
|
|
251
|
+
- **Active Agent Cards** — fixed-height streaming output from running agents with agent→task title
|
|
252
|
+
- **Activity Timeline** — recent runs with status, duration, tokens
|
|
253
|
+
- **Fleet Status** — agent list with quick-run capability
|
|
254
|
+
|
|
255
|
+
**Additional tabs:**
|
|
256
|
+
- **Agents** — grid of agent cards with stats, toggle, edit, run
|
|
257
|
+
- **Tasks Board** — kanban view (described above)
|
|
258
|
+
- **Run History** — searchable table of all executions
|
|
259
|
+
- **Skills Library** — browse, create, and edit skills
|
|
260
|
+
- **Approvals** — pending tool use approvals
|
|
261
|
+
- **MCP Servers** — server discovery and management
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### Agent Memory
|
|
266
|
+
|
|
267
|
+
Agents persist context across sessions:
|
|
268
|
+
|
|
269
|
+
1. Agent includes `[REMEMBER]important context[/REMEMBER]` in its output
|
|
270
|
+
2. Extracted and appended to `_fleet/memory/<agent-name>.md`
|
|
271
|
+
3. Injected into the agent's prompt on every future run
|
|
272
|
+
4. The Fleet Orchestrator automatically includes memory instructions when creating new agents
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
### Run History
|
|
277
|
+
|
|
278
|
+
Every execution is logged in `_fleet/runs/YYYY-MM-DD/`:
|
|
279
|
+
|
|
280
|
+
```yaml
|
|
281
|
+
---
|
|
282
|
+
run_id: abc123
|
|
283
|
+
agent: fleet-orchestrator
|
|
284
|
+
task: daily-report
|
|
285
|
+
status: success
|
|
286
|
+
started: 2026-04-03T09:00:00
|
|
287
|
+
completed: 2026-04-03T09:02:30
|
|
288
|
+
duration_seconds: 150
|
|
289
|
+
tokens_used: 4500
|
|
290
|
+
model: claude-opus-4-6
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Prompt
|
|
294
|
+
...
|
|
295
|
+
|
|
296
|
+
## Output
|
|
297
|
+
...
|
|
298
|
+
|
|
299
|
+
## Tools Used
|
|
300
|
+
...
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Click any run in the dashboard to see full details in a slideover panel.
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Configuration
|
|
308
|
+
|
|
309
|
+
### Plugin Settings
|
|
310
|
+
|
|
311
|
+
| Setting | Default | Description |
|
|
312
|
+
|---------|---------|-------------|
|
|
313
|
+
| Fleet Folder | `_fleet` | Root folder for all fleet data |
|
|
314
|
+
| Claude CLI Path | `claude` | Path to Claude Code CLI |
|
|
315
|
+
| Default Model | `default` | Default model for new agents |
|
|
316
|
+
| AWS Region | `us-east-1` | For AWS Bedrock model support |
|
|
317
|
+
| Max Concurrent Runs | `2` | Parallel task execution limit |
|
|
318
|
+
| Run Log Retention | `30` days | Auto-cleanup old logs |
|
|
319
|
+
| Catch Up Missed Tasks | `true` | Run overdue tasks on startup |
|
|
320
|
+
| Notification Level | `all` | `all`, `failures-only`, `none` |
|
|
321
|
+
|
|
322
|
+
### File Structure
|
|
323
|
+
|
|
324
|
+
All data lives in `_fleet/` as plain markdown:
|
|
325
|
+
|
|
326
|
+
```
|
|
327
|
+
_fleet/
|
|
328
|
+
├── agents/ Agent folders (agent.md, config.md, etc.)
|
|
329
|
+
├── skills/ Shared skill folders (skill.md, tools.md, etc.)
|
|
330
|
+
├── tasks/ Task files with frontmatter
|
|
331
|
+
├── runs/ Execution logs by date
|
|
332
|
+
│ └── YYYY-MM-DD/
|
|
333
|
+
├── memory/ Agent memory files
|
|
334
|
+
└── chat-images/ Images pasted into chat
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Everything is searchable, version-controllable, and fully yours.
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## FAQ
|
|
342
|
+
|
|
343
|
+
**Q: Do I need an API key?**
|
|
344
|
+
Not necessarily. Agent Fleet works with your **Claude Max or Pro subscription** via Claude Code CLI. No separate API key or billing. If you prefer, you can also use an Anthropic API key directly.
|
|
345
|
+
|
|
346
|
+
**Q: Does it work without internet?**
|
|
347
|
+
No — agents need the Claude API to run. But all your data (agents, tasks, skills, memory) is local markdown.
|
|
348
|
+
|
|
349
|
+
**Q: Can I use different models per agent?**
|
|
350
|
+
Yes. Each agent has its own model setting. Supports Anthropic direct (Opus, Sonnet, Haiku) and AWS Bedrock models.
|
|
351
|
+
|
|
352
|
+
**Q: What happens if I delete the plugin?**
|
|
353
|
+
Your `_fleet/` folder stays. All agents, tasks, skills, run logs, and memory are plain markdown files in your vault.
|
|
354
|
+
|
|
355
|
+
**Q: Can multiple agents run at the same time?**
|
|
356
|
+
Yes, up to `maxConcurrentRuns` (default 2). Additional tasks queue until a slot opens.
|
|
357
|
+
|
|
358
|
+
**Q: Does the chat remember previous conversations?**
|
|
359
|
+
Yes. Each agent has persistent chat sessions that survive Obsidian restarts via Claude CLI `--resume`.
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## Links
|
|
364
|
+
|
|
365
|
+
- [Releases](https://github.com/denberek/obsidian-agent-fleet/releases)
|
|
366
|
+
- [npm package](https://www.npmjs.com/package/obsidian-agent-fleet)
|
|
367
|
+
- [Report Issues](https://github.com/denberek/obsidian-agent-fleet/issues)
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const os = require("os");
|
|
6
|
+
|
|
7
|
+
const PLUGIN_ID = "agent-fleet";
|
|
8
|
+
const PLUGIN_DIR = path.join(__dirname, "..", "plugin");
|
|
9
|
+
|
|
10
|
+
function getObsidianConfigPath() {
|
|
11
|
+
switch (process.platform) {
|
|
12
|
+
case "darwin":
|
|
13
|
+
return path.join(os.homedir(), "Library", "Application Support", "obsidian", "obsidian.json");
|
|
14
|
+
case "win32":
|
|
15
|
+
return path.join(process.env.APPDATA || "", "obsidian", "obsidian.json");
|
|
16
|
+
case "linux":
|
|
17
|
+
return path.join(os.homedir(), ".config", "obsidian", "obsidian.json");
|
|
18
|
+
default:
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function getVaults() {
|
|
24
|
+
const configPath = getObsidianConfigPath();
|
|
25
|
+
if (!configPath || !fs.existsSync(configPath)) return [];
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
|
|
29
|
+
const vaults = config.vaults || {};
|
|
30
|
+
return Object.values(vaults)
|
|
31
|
+
.filter((v) => v.path && fs.existsSync(v.path))
|
|
32
|
+
.map((v) => ({ path: v.path, open: v.open || false }));
|
|
33
|
+
} catch {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function installToVault(vaultPath) {
|
|
39
|
+
const pluginDir = path.join(vaultPath, ".obsidian", "plugins", PLUGIN_ID);
|
|
40
|
+
|
|
41
|
+
// Ensure directories exist
|
|
42
|
+
fs.mkdirSync(pluginDir, { recursive: true });
|
|
43
|
+
|
|
44
|
+
// Copy plugin files
|
|
45
|
+
const files = ["main.js", "manifest.json", "styles.css"];
|
|
46
|
+
for (const file of files) {
|
|
47
|
+
const src = path.join(PLUGIN_DIR, file);
|
|
48
|
+
const dst = path.join(pluginDir, file);
|
|
49
|
+
if (fs.existsSync(src)) {
|
|
50
|
+
fs.copyFileSync(src, dst);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return pluginDir;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function main() {
|
|
58
|
+
const args = process.argv.slice(2);
|
|
59
|
+
const command = args[0] || "install";
|
|
60
|
+
const isAuto = args.includes("--auto");
|
|
61
|
+
|
|
62
|
+
if (command === "install" || command === "update") {
|
|
63
|
+
const vaults = getVaults();
|
|
64
|
+
|
|
65
|
+
if (vaults.length === 0) {
|
|
66
|
+
if (isAuto) return; // Silent fail for postinstall
|
|
67
|
+
console.error("❌ No Obsidian vaults found.");
|
|
68
|
+
console.error(" Make sure Obsidian is installed and has at least one vault.");
|
|
69
|
+
console.error("");
|
|
70
|
+
console.error(" Manual install:");
|
|
71
|
+
console.error(" Copy the files from node_modules/agent-fleet/plugin/");
|
|
72
|
+
console.error(" to <your-vault>/.obsidian/plugins/agent-fleet/");
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Install to all vaults
|
|
77
|
+
let installed = 0;
|
|
78
|
+
for (const vault of vaults) {
|
|
79
|
+
try {
|
|
80
|
+
const dest = installToVault(vault.path);
|
|
81
|
+
const vaultName = path.basename(vault.path);
|
|
82
|
+
console.log(`✅ Installed to "${vaultName}" → ${dest}`);
|
|
83
|
+
installed++;
|
|
84
|
+
} catch (err) {
|
|
85
|
+
const vaultName = path.basename(vault.path);
|
|
86
|
+
if (!isAuto) {
|
|
87
|
+
console.error(`❌ Failed to install to "${vaultName}": ${err.message}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (installed > 0 && !isAuto) {
|
|
93
|
+
console.log("");
|
|
94
|
+
console.log(`🎉 Agent Fleet installed to ${installed} vault${installed > 1 ? "s" : ""}.`);
|
|
95
|
+
console.log(" Restart Obsidian, then enable Agent Fleet in Settings → Community Plugins.");
|
|
96
|
+
}
|
|
97
|
+
} else if (command === "vaults") {
|
|
98
|
+
const vaults = getVaults();
|
|
99
|
+
if (vaults.length === 0) {
|
|
100
|
+
console.log("No Obsidian vaults found.");
|
|
101
|
+
} else {
|
|
102
|
+
console.log("Obsidian vaults:");
|
|
103
|
+
for (const vault of vaults) {
|
|
104
|
+
const name = path.basename(vault.path);
|
|
105
|
+
console.log(` ${vault.open ? "🟢" : "⚪"} ${name} → ${vault.path}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
} else if (command === "help" || command === "--help" || command === "-h") {
|
|
109
|
+
console.log("Agent Fleet for Obsidian");
|
|
110
|
+
console.log("");
|
|
111
|
+
console.log("Usage: agent-fleet <command>");
|
|
112
|
+
console.log("");
|
|
113
|
+
console.log("Commands:");
|
|
114
|
+
console.log(" install Install plugin to all Obsidian vaults");
|
|
115
|
+
console.log(" update Same as install (copies latest files)");
|
|
116
|
+
console.log(" vaults List detected Obsidian vaults");
|
|
117
|
+
console.log(" help Show this help message");
|
|
118
|
+
} else {
|
|
119
|
+
console.error(`Unknown command: ${command}`);
|
|
120
|
+
console.error("Run 'agent-fleet help' for usage.");
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "obsidian-agent-fleet",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Agent Fleet for Obsidian \u2014 AI agents, task scheduling, and interactive chat",
|
|
5
|
+
"author": "Denis Berekchiyan",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"bin": {
|
|
8
|
+
"obsidian-agent-fleet": "./bin/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin/",
|
|
12
|
+
"plugin/",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"obsidian",
|
|
17
|
+
"ai",
|
|
18
|
+
"agent",
|
|
19
|
+
"claude",
|
|
20
|
+
"task",
|
|
21
|
+
"automation"
|
|
22
|
+
],
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/denberek/obsidian-agent-fleet"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/denberek/obsidian-agent-fleet",
|
|
28
|
+
"scripts": {
|
|
29
|
+
"postinstall": "node bin/cli.js install --auto 2>/dev/null || true"
|
|
30
|
+
}
|
|
31
|
+
}
|