vigil-mcp 0.2.0__tar.gz

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 (32) hide show
  1. vigil_mcp-0.2.0/PKG-INFO +579 -0
  2. vigil_mcp-0.2.0/README.md +537 -0
  3. vigil_mcp-0.2.0/pyproject.toml +71 -0
  4. vigil_mcp-0.2.0/setup.cfg +4 -0
  5. vigil_mcp-0.2.0/tests/test_bugs.py +274 -0
  6. vigil_mcp-0.2.0/vigil_mcp/__init__.py +0 -0
  7. vigil_mcp-0.2.0/vigil_mcp/analyzer.py +274 -0
  8. vigil_mcp-0.2.0/vigil_mcp/api.py +458 -0
  9. vigil_mcp-0.2.0/vigil_mcp/dashboard.py +1396 -0
  10. vigil_mcp-0.2.0/vigil_mcp/db.py +697 -0
  11. vigil_mcp-0.2.0/vigil_mcp/features.py +99 -0
  12. vigil_mcp-0.2.0/vigil_mcp/integrations/__init__.py +26 -0
  13. vigil_mcp-0.2.0/vigil_mcp/integrations/accountability_partners.py +41 -0
  14. vigil_mcp-0.2.0/vigil_mcp/integrations/adaptive_policy.py +143 -0
  15. vigil_mcp-0.2.0/vigil_mcp/integrations/calendar_sync.py +36 -0
  16. vigil_mcp-0.2.0/vigil_mcp/integrations/github_integration.py +41 -0
  17. vigil_mcp-0.2.0/vigil_mcp/integrations/idle_detection.py +128 -0
  18. vigil_mcp-0.2.0/vigil_mcp/integrations/reliability_reports.py +159 -0
  19. vigil_mcp-0.2.0/vigil_mcp/integrations/shared_commitments.py +42 -0
  20. vigil_mcp-0.2.0/vigil_mcp/logger.py +56 -0
  21. vigil_mcp-0.2.0/vigil_mcp/notify.py +79 -0
  22. vigil_mcp-0.2.0/vigil_mcp/policy.py +233 -0
  23. vigil_mcp-0.2.0/vigil_mcp/push.py +138 -0
  24. vigil_mcp-0.2.0/vigil_mcp/pwa.py +89 -0
  25. vigil_mcp-0.2.0/vigil_mcp/server.py +765 -0
  26. vigil_mcp-0.2.0/vigil_mcp/webhooks.py +163 -0
  27. vigil_mcp-0.2.0/vigil_mcp.egg-info/PKG-INFO +579 -0
  28. vigil_mcp-0.2.0/vigil_mcp.egg-info/SOURCES.txt +30 -0
  29. vigil_mcp-0.2.0/vigil_mcp.egg-info/dependency_links.txt +1 -0
  30. vigil_mcp-0.2.0/vigil_mcp.egg-info/entry_points.txt +3 -0
  31. vigil_mcp-0.2.0/vigil_mcp.egg-info/requires.txt +27 -0
  32. vigil_mcp-0.2.0/vigil_mcp.egg-info/top_level.txt +1 -0
@@ -0,0 +1,579 @@
1
+ Metadata-Version: 2.4
2
+ Name: vigil-mcp
3
+ Version: 0.2.0
4
+ Summary: Proactive memory layer for AI — the AI that reaches back out to you
5
+ Author-email: Zsolt Csaszti <prodbysilky.as@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/prodbysilky/vigil-mcp
8
+ Project-URL: Repository, https://github.com/prodbysilky/vigil-mcp
9
+ Project-URL: Bug Tracker, https://github.com/prodbysilky/vigil-mcp/issues
10
+ Keywords: mcp,ai,commitments,productivity,claude,reminders
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Office/Business :: Scheduling
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ Requires-Dist: mcp>=1.0.0
21
+ Provides-Extra: api
22
+ Requires-Dist: fastapi>=0.100.0; extra == "api"
23
+ Requires-Dist: uvicorn>=0.23.0; extra == "api"
24
+ Provides-Extra: push
25
+ Requires-Dist: pywebpush>=2.0.0; extra == "push"
26
+ Requires-Dist: cryptography>=41.0.0; extra == "push"
27
+ Provides-Extra: hosted
28
+ Requires-Dist: fastapi>=0.100.0; extra == "hosted"
29
+ Requires-Dist: uvicorn>=0.23.0; extra == "hosted"
30
+ Requires-Dist: pywebpush>=2.0.0; extra == "hosted"
31
+ Requires-Dist: cryptography>=41.0.0; extra == "hosted"
32
+ Requires-Dist: anthropic>=0.25.0; extra == "hosted"
33
+ Provides-Extra: notify
34
+ Requires-Dist: plyer>=2.1.0; extra == "notify"
35
+ Provides-Extra: all
36
+ Requires-Dist: fastapi>=0.100.0; extra == "all"
37
+ Requires-Dist: uvicorn>=0.23.0; extra == "all"
38
+ Requires-Dist: pywebpush>=2.0.0; extra == "all"
39
+ Requires-Dist: cryptography>=41.0.0; extra == "all"
40
+ Requires-Dist: anthropic>=0.25.0; extra == "all"
41
+ Requires-Dist: plyer>=2.1.0; extra == "all"
42
+
43
+ # 🔥 Vigil MCP
44
+
45
+ > The AI that reaches back out to you.
46
+
47
+ Most AI tools wait. You open them, you ask, they answer. Vigil flips that.
48
+
49
+ Connect it to Claude once — and it remembers what you said you'd do, reasons about when it's worth interrupting you, and follows up on its own.
50
+
51
+ ---
52
+
53
+ ## The problem
54
+
55
+ Every AI interaction ends the same way: you close the tab and the context disappears. The AI has no persistence, no agency, no follow-through. It's reactive by design.
56
+
57
+ Vigil is a layer that changes that.
58
+
59
+ ---
60
+
61
+ ## How it works
62
+
63
+ Vigil is an [MCP server](https://modelcontextprotocol.io) — a tool layer that any compatible AI can plug into. When connected:
64
+
65
+ 1. **Claude detects commitments automatically** — "I'll come back tomorrow", "remind me to push this on Friday", "I'll do X after lunch" → saved instantly, no command needed
66
+ 2. **A policy engine runs in the background** — every 60 seconds, it evaluates every pending commitment against 7 conditions before deciding whether to act
67
+ 3. **When you open a new session**, Claude reads `vigil://pending` and opens with urgent items naturally — "Hey, you said you'd finish the README. Still on it?"
68
+ 4. **Desktop and push notifications fire** when things are overdue and you haven't opened Claude yet
69
+ 5. **Nudges go to Slack or Discord** if you've configured a webhook
70
+ 6. **V3 integrations run every 5 minutes** — idle detection, adaptive learning, and weekly reports work silently in the background
71
+ 7. **Every decision is logged and explainable** — ask "why did you message me?" and get the full trace
72
+
73
+ ---
74
+
75
+ ## Policy engine
76
+
77
+ Vigil doesn't act on a timer. It reasons.
78
+
79
+ Every potential nudge passes through a 7-step decision chain:
80
+
81
+ ```
82
+ 1. Hypothetical intent? → never act
83
+ 2. Grace period (<30 min old)? → too fresh, skip
84
+ 3. Early phase (>48h to deadline)? → too soon, skip
85
+ 4. Cooldown window active? → avoid spam (4h / 1h / 2h by phase)
86
+ 5. Daily attention budget exhausted? → suppress unless importance ≥ 0.8
87
+ 6. Soft intent? → reduce effective importance by 0.2
88
+ 7. Phase + importance threshold → fire or stay silent
89
+ ```
90
+
91
+ Every decision — including suppressed ones — is written to `decision_log` with phase, urgency, budget used, and full reasoning text.
92
+
93
+ ### Temporal phases
94
+
95
+ | Phase | Window | Cooldown | Behavior |
96
+ |---|---|---|---|
97
+ | `early` | > 48h until due | — | No nudge |
98
+ | `execution` | 4–48h until due | 4h | Nudge if importance ≥ 0.6 |
99
+ | `risk` | < 4h until due | 1h | Always nudge |
100
+ | `overdue` | Past deadline | 2h | Escalate |
101
+
102
+ ### Auto-decay
103
+
104
+ Nudged 3+ times with no response → importance decays 15% per cycle. After 6 ignored nudges → auto-archived. No noise, no spam.
105
+
106
+ ---
107
+
108
+ ## Features
109
+
110
+ | Feature | Description |
111
+ |---|---|
112
+ | 🧠 **Policy engine** | 7-step reasoning chain, not a simple timer |
113
+ | 💬 **Natural language input** | "remind me to push the PR before EOD" → parsed and saved automatically |
114
+ | 📬 **Proactive notifications** | Native macOS/Windows/Linux OR Web Push to phone/browser |
115
+ | 🔔 **Slack/Discord integration** | Nudges delivered to your Slack or Discord channel |
116
+ | 🤖 **Slack slash commands** | `/vigil remind me to X` creates a commitment from Slack |
117
+ | 📱 **Installable PWA** | Add dashboard to phone home screen — iOS 16.4+ / all Android |
118
+ | ☁️ **Hosted mode** | One-click Railway/Render deploy, auth-protected, multi-user |
119
+ | ✏️ **Edit commitments** | Update deadline, importance, intent, or description after saving |
120
+ | 🔁 **Recurring commitments** | Daily, weekly (specific days), monthly — auto-reschedules |
121
+ | 📉 **Auto-decay** | Importance drops on ignores; auto-archives after 6 nudges |
122
+ | 🌅 **Daily digest** | Optional morning summary notification |
123
+ | 🖥️ **Web dashboard** | Dark-theme UI at `localhost:7734` (or your hosted URL) |
124
+ | 🔍 **Full explainability** | Every decision logged with reasoning — "Why did you message me?" |
125
+ | 💤 **Idle detection** | Nudges escalate when no Claude session detected for 4+ hours |
126
+ | 📊 **Adaptive policy** | Learns your follow-through patterns per category, boosts flagging commitments |
127
+ | 📋 **Reliability reports** | Weekly Monday summary: follow-through % by category |
128
+
129
+ ---
130
+
131
+ ## Architecture
132
+
133
+ ```
134
+ Claude Desktop
135
+
136
+ ├── Tools (save / create_from_text / get / complete / snooze /
137
+ │ update / explain / budget / digest / set_slack_webhook /
138
+ │ set_discord_webhook / list_features / enable_feature /
139
+ │ disable_feature)
140
+ └── Resources (vigil://pending · vigil://status · vigil://history)
141
+
142
+ vigil-mcp process
143
+ ├── server.py — FastMCP server, tools, resources, background loop
144
+ ├── policy.py — Decision engine (phase → urgency → budget → action)
145
+ ├── db.py — SQLite layer (thread-local, multi-user, migrations)
146
+ ├── dashboard.py — HTTP dashboard + PWA + CRUD API (localhost:7734 / $PORT)
147
+ ├── api.py — FastAPI REST layer (localhost:7735) + cloud entrypoint
148
+ ├── analyzer.py — Signal analysis + NL commitment parsing (Claude API)
149
+ ├── webhooks.py — Slack/Discord outbound nudges + slash command handler
150
+ ├── push.py — Web Push delivery (VAPID + pywebpush)
151
+ ├── pwa.py — Manifest, service worker, icons
152
+ ├── notify.py — Shared notification delivery (push → webhooks → desktop)
153
+ ├── features.py — V3 feature flag registry (7 toggleable features)
154
+ ├── logger.py — Rotating structured log at ~/.vigil/vigil.log
155
+ └── integrations/
156
+ ├── __init__.py — Fan-out runner (importlib-based, fault-isolated)
157
+ ├── idle_detection.py — Live: session heartbeat + idle escalation
158
+ ├── adaptive_policy.py — Live: per-category follow-through learning
159
+ ├── reliability_reports.py — Live: weekly Monday digest by category
160
+ ├── github_integration.py — Stub: stale PR commitment creation
161
+ ├── calendar_sync.py — Stub: pre-meeting commitment surfacing
162
+ ├── accountability_partners.py — Stub: Slack DM to accountability partner
163
+ └── shared_commitments.py — Stub: team-visible commitments via Slack
164
+
165
+ ~/.vigil/
166
+ ├── commitments.db — All data (commitments, decision_log, settings)
167
+ └── vigil.log — Structured log (grep-friendly)
168
+ ```
169
+
170
+ ---
171
+
172
+ ## Tools
173
+
174
+ | Tool | What it does |
175
+ |---|---|
176
+ | `create_from_text` | Parse natural language into a commitment automatically |
177
+ | `save_commitment` | Capture a commitment with explicit fields (due date, intent, importance, recurrence) |
178
+ | `get_commitments` | List all pending with phase, state, and stats |
179
+ | `complete_commitment` | Mark done; auto-reschedules if recurring |
180
+ | `snooze_commitment` | Push deadline to a later time |
181
+ | `update_commitment` | Edit description, deadline, importance, intent, or summary |
182
+ | `explain_nudge` | Full decision trace for a commitment |
183
+ | `set_attention_budget` | Set daily nudge cap (default: 10) |
184
+ | `set_daily_digest_time` | Morning summary notification at HH:MM |
185
+ | `set_slack_webhook` | Route nudges to a Slack channel |
186
+ | `set_discord_webhook` | Route nudges to a Discord channel |
187
+ | `list_features` | Show all V3 features and their on/off state |
188
+ | `enable_feature` | Turn on a V3 feature by name |
189
+ | `disable_feature` | Turn off a V3 feature by name |
190
+
191
+ ## Resources
192
+
193
+ | Resource | Content |
194
+ |---|---|
195
+ | `vigil://pending` | Pending commitments grouped by phase — Claude reads this at session start |
196
+ | `vigil://status` | System health: budget used, config, stats |
197
+ | `vigil://history` | Completed commitments and follow-through rate |
198
+
199
+ ---
200
+
201
+ ## Commitment schema
202
+
203
+ ```python
204
+ {
205
+ description: str,
206
+ due_by: ISO 8601 datetime,
207
+ ai_summary: str, # 2-sentence context of what was being worked on
208
+ intent_strength: "hard" | "soft" | "hypothetical",
209
+ importance_score: 0.0–1.0,
210
+ confidence_score: 0.0–1.0,
211
+ state: "captured" | "scheduled" | "in_progress" | "at_risk" | "overdue" | "completed" | "abandoned",
212
+ recurrence: "none" | "daily" | "weekly" | "monthly",
213
+ recurrence_days: ["monday", "thursday"], # for weekly
214
+ recurrence_time: "HH:MM",
215
+ }
216
+ ```
217
+
218
+ ---
219
+
220
+ ## V3 Features
221
+
222
+ Vigil V3 adds three directions of capability behind toggleable feature flags. All are off by default — turn them on via Claude or the dashboard.
223
+
224
+ ### Enable via Claude
225
+
226
+ ```
227
+ list_features()
228
+ enable_feature("idle_detection")
229
+ enable_feature("adaptive_policy")
230
+ enable_feature("reliability_reports")
231
+ ```
232
+
233
+ ### Enable at startup (env var)
234
+
235
+ ```bash
236
+ VIGIL_FEATURES=idle_detection,adaptive_policy,reliability_reports vigil
237
+ ```
238
+
239
+ ### Feature registry
240
+
241
+ | Feature | Direction | Status | Required env var |
242
+ |---|---|---|---|
243
+ | `idle_detection` | Context Awareness | **Live** | — |
244
+ | `adaptive_policy` | Adaptive | **Live** | — |
245
+ | `reliability_reports` | Adaptive | **Live** | — |
246
+ | `github_integration` | Context Awareness | Stub | `GITHUB_TOKEN` |
247
+ | `calendar_sync` | Context Awareness | Stub | `GOOGLE_CALENDAR_TOKEN` |
248
+ | `accountability_partners` | Multi-Person / Team | Stub | `VIGIL_SLACK_BOT_TOKEN` |
249
+ | `shared_commitments` | Multi-Person / Team | Stub | `VIGIL_SLACK_BOT_TOKEN` |
250
+
251
+ ### Idle Detection
252
+
253
+ Tracks the last time Claude read `vigil://pending` (i.e. the last time you opened a session). If no session is detected for 4+ hours and you have overdue or at-risk commitments, Vigil fires a push/Slack/desktop nudge.
254
+
255
+ - Cooldown: 2 hours between idle nudges
256
+ - Threshold: `VIGIL_IDLE_HOURS` env var (default: `4`)
257
+ - Resumes normal nudge schedule once you open a new session
258
+
259
+ ### Adaptive Policy
260
+
261
+ Runs once per day. Looks at your completed and abandoned commitments grouped by `context` category. Categories with ≥ 3 resolved commitments and < 50% follow-through are marked low-reliability.
262
+
263
+ Pending commitments in those categories get their `importance_score` boosted 15% (capped at 0.95) so they are more likely to clear the policy engine's threshold and generate a nudge. Every boost is written to `decision_log` — `explain_nudge` shows you exactly why.
264
+
265
+ ### Reliability Reports
266
+
267
+ Every Monday at 09:00 (configurable via `VIGIL_REPORT_HOUR`), Vigil sends a summary of the past week's follow-through, broken down by category:
268
+
269
+ ```
270
+ Past 7 days: 7/10 done (70%)
271
+ 3 still pending
272
+ By category:
273
+ ✓ work: 4/5 (80%)
274
+ ✓ personal: 2/3 (67%)
275
+ ⚠ learning: 1/3 (33%)
276
+ ```
277
+
278
+ Categories marked ⚠ are candidates for Adaptive Policy boosting. Report is deduped by ISO week — it won't re-fire if the process restarts.
279
+
280
+ ---
281
+
282
+ ## Web dashboard
283
+
284
+ A local dashboard runs at `http://localhost:7734` whenever Vigil is active.
285
+
286
+ - **Natural language bar** at the top — type "remind me to push the PR before EOD" and press Enter
287
+ - Stats: follow-through %, completed, pending, overdue, nudges today
288
+ - Commitments grouped by phase with colour-coded left borders
289
+ - **"Why?"** expandable button — full policy decision trace per commitment
290
+ - **Integrations panel** — paste a Slack or Discord webhook URL and save
291
+ - **V3 Features panel** — toggle switches for all 7 features, amber warning when env var is missing
292
+ - Auto-refreshes every 30 seconds
293
+ - Installable as a PWA (mobile)
294
+
295
+ ---
296
+
297
+ ## Installation
298
+
299
+ **Requirements:** Python 3.10+, macOS / Windows / Linux
300
+
301
+ ```bash
302
+ git clone https://github.com/prodbysilky/vigil-mcp
303
+ cd vigil-mcp
304
+ python3 -m venv .venv
305
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
306
+ ```
307
+
308
+ ### Option A — Claude Desktop (MCP) — simplest
309
+
310
+ ```bash
311
+ pip install -e .
312
+ ```
313
+
314
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
315
+
316
+ ```json
317
+ {
318
+ "mcpServers": {
319
+ "vigil": {
320
+ "command": "/absolute/path/to/vigil-mcp/.venv/bin/vigil-mcp"
321
+ }
322
+ }
323
+ }
324
+ ```
325
+
326
+ Or with `uvx` (no venv needed):
327
+
328
+ ```json
329
+ {
330
+ "mcpServers": {
331
+ "vigil": {
332
+ "command": "uvx",
333
+ "args": ["vigil-mcp"]
334
+ }
335
+ }
336
+ }
337
+ ```
338
+
339
+ Restart Claude Desktop (Cmd+Q, then reopen). Vigil starts automatically.
340
+
341
+ ### Option B — Standalone / ChatGPT / any HTTP client
342
+
343
+ ```bash
344
+ pip install -e ".[api]" # adds FastAPI + uvicorn
345
+ vigil # starts dashboard + REST API, no Claude needed
346
+ ```
347
+
348
+ The REST API runs at `http://localhost:7735`. Interactive docs at `/docs`.
349
+ The dashboard runs at `http://localhost:7734`.
350
+
351
+ ### Option C — Hosted mode (public URL, mobile push, auth-protected)
352
+
353
+ Deploy once, visit from any device, install the PWA to your home screen, get push notifications on your phone. Works on iOS 16.4+ and all Android.
354
+
355
+ **1. Generate VAPID keys** (one-time):
356
+
357
+ ```bash
358
+ pip install -e ".[hosted]"
359
+ python -c "from vigil_mcp.push import generate_vapid_keys; \
360
+ priv, pub = generate_vapid_keys(); \
361
+ print('VIGIL_VAPID_PRIVATE_KEY=' + repr(priv)); \
362
+ print('VIGIL_VAPID_PUBLIC_KEY=' + pub)"
363
+ ```
364
+
365
+ **2. Deploy to Railway** (or Render / Fly — all read `$PORT`):
366
+
367
+ - New project → Deploy from GitHub repo
368
+ - Set environment variables (see table below)
369
+ - Railway auto-detects `Procfile` + `railway.json`; healthcheck hits `/manifest.json`
370
+
371
+ **3. Set a secret token** (so only you can access the dashboard):
372
+
373
+ ```
374
+ VIGIL_SECRET_TOKEN=your-secret-here
375
+ ```
376
+
377
+ Your dashboard URL becomes: `https://your-app.up.railway.app/?token=your-secret-here`
378
+
379
+ **4. Install on phone:**
380
+
381
+ - Open `https://your-app.up.railway.app/?token=your-secret-here` in Safari (iOS) or Chrome (Android)
382
+ - "Add to Home Screen"
383
+ - Launch from home screen, tap "Enable notifications"
384
+
385
+ ---
386
+
387
+ ## Environment variables
388
+
389
+ | Variable | Required | Purpose |
390
+ |---|---|---|
391
+ | `VIGIL_SECRET_TOKEN` | Recommended for hosted | Bearer token for dashboard + API auth |
392
+ | `ANTHROPIC_API_KEY` | For NL parsing + signal analysis | Powers `create_from_text` and auto-commitment creation |
393
+ | `VIGIL_VAPID_PRIVATE_KEY` | For Web Push | Signs push notifications |
394
+ | `VIGIL_VAPID_PUBLIC_KEY` | For Web Push | Sent to browsers for subscription |
395
+ | `VIGIL_VAPID_SUBJECT` | For Web Push | `mailto:you@example.com` (defaults to `mailto:admin@example.com`) |
396
+ | `VIGIL_SLACK_WEBHOOK` | For Slack nudges | Incoming webhook URL (alternative to setting via Claude/dashboard) |
397
+ | `VIGIL_DISCORD_WEBHOOK` | For Discord nudges | Webhook URL (alternative to setting via Claude/dashboard) |
398
+ | `VIGIL_SLACK_SIGNING_SECRET` | For Slack slash commands | Verifies `/vigil` commands come from Slack |
399
+ | `VIGIL_FEATURES` | Optional | Comma-separated list of V3 features to auto-enable on startup |
400
+ | `VIGIL_IDLE_HOURS` | Optional | Hours of inactivity before idle nudge fires (default: `4`) |
401
+ | `VIGIL_REPORT_HOUR` | Optional | Hour (0–23) for Monday reliability report (default: `9`) |
402
+ | `TIMEZONE` | Optional | Local timezone for recurring scheduling (default: `Europe/Budapest`) |
403
+ | `PORT` | Set by Railway/Render | Cloud port — auto-detected, do not set manually |
404
+ | `GITHUB_TOKEN` | For github_integration feature | Personal access token with `repo` scope |
405
+ | `GOOGLE_CALENDAR_TOKEN` | For calendar_sync feature | OAuth token for Google Calendar API |
406
+ | `VIGIL_SLACK_BOT_TOKEN` | For accountability/shared features | Bot token with `chat:write` scope |
407
+
408
+ ---
409
+
410
+ ## Slack integration
411
+
412
+ Vigil sends nudges to Slack and accepts `/vigil` slash commands.
413
+
414
+ ### Outbound nudges (via webhook)
415
+
416
+ 1. Go to [api.slack.com/apps](https://api.slack.com/apps) → Create New App → From Scratch
417
+ 2. **Incoming Webhooks** → Enable → Add to Workspace → pick a channel → copy the URL
418
+ 3. Set in Claude: `set_slack_webhook("https://hooks.slack.com/services/...")`
419
+ Or paste it in the dashboard Integrations panel.
420
+
421
+ ### Inbound slash commands (`/vigil remind me to X`)
422
+
423
+ 1. **Slash Commands** → Create New Command:
424
+ - Command: `/vigil`
425
+ - Request URL: `https://your-app.up.railway.app/api/slack/command`
426
+ - Short Description: `Create a Vigil commitment`
427
+ 2. **Basic Information** → Signing Secret → copy it → set `VIGIL_SLACK_SIGNING_SECRET` env var
428
+
429
+ Usage: `/vigil remind me to push the PR before EOD`
430
+
431
+ ---
432
+
433
+ ## Discord integration
434
+
435
+ 1. In Discord: **Channel Settings** → **Integrations** → **Webhooks** → **New Webhook** → copy URL
436
+ 2. Set in Claude: `set_discord_webhook("https://discord.com/api/webhooks/...")`
437
+ Or paste it in the dashboard Integrations panel.
438
+
439
+ Vigil sends rich embeds (amber colour) to the channel whenever a nudge fires.
440
+
441
+ ---
442
+
443
+ ## Example flows
444
+
445
+ **Natural language capture**
446
+ ```
447
+ You: "remind me to push this PR before EOD"
448
+ Vigil: parses → description="Push PR", due_by="today 18:00", importance=0.7
449
+ → saved. No form filling needed.
450
+ ```
451
+
452
+ **High-importance missed deadline**
453
+ ```
454
+ You: "I'll push this to GitHub before end of day"
455
+ Vigil: saves commitment, importance=0.7, due=17:00
456
+
457
+ [17:00 — no action yet]
458
+ Policy: phase=overdue, urgency=0.72, budget=3/10
459
+ → NOTIFY: desktop + Slack: "You said you'd push to GitHub"
460
+
461
+ [next Claude session]
462
+ Claude: "Hey — your GitHub push is overdue. Want to do it now?"
463
+ ```
464
+
465
+ **Idle detection escalation**
466
+ ```
467
+ You: "I'll review those PRs this afternoon"
468
+ Vigil: saves commitment, due=17:00
469
+
470
+ [No Claude session opened since 13:00 — 4 hours idle]
471
+ Idle: phase=overdue, no session detected
472
+ → PUSH + Slack: "4h idle — PR review is overdue"
473
+ ```
474
+
475
+ **Adaptive policy in action**
476
+ ```
477
+ [End of day — adaptive_policy runs]
478
+ Policy: "learning" category: 1/4 resolved (25% rate)
479
+ → 3 pending "learning" commitments boosted +15% importance
480
+ → Next policy cycle: importance 0.5 → 0.58, clears threshold
481
+ → Nudge fires that would have been suppressed
482
+ ```
483
+
484
+ **Recurring commitment**
485
+ ```
486
+ You: "Every Monday morning I want to review my job applications"
487
+ Vigil: saves with recurrence=weekly, recurrence_days=["monday"], recurrence_time="09:00"
488
+
489
+ [Monday 09:00] → NOTIFY
490
+ You: "Done" → complete_commitment → next Monday auto-scheduled
491
+ ```
492
+
493
+ **Weekly reliability report**
494
+ ```
495
+ [Monday 09:00]
496
+ Vigil: "Past 7 days: 7/10 done (70%)
497
+ ✓ work: 4/5 (80%)
498
+ ✓ personal: 2/3 (67%)
499
+ ⚠ learning: 1/3 (33%)"
500
+ ```
501
+
502
+ ---
503
+
504
+ ## REST API
505
+
506
+ The REST API runs at `http://localhost:7735` when `fastapi` + `uvicorn` are installed (`pip install vigil-mcp[api]`). Interactive OpenAPI docs at `/docs`.
507
+
508
+ | Method | Endpoint | Description |
509
+ |---|---|---|
510
+ | `GET` | `/commitments` | List all pending |
511
+ | `POST` | `/commitments` | Save a commitment (structured) |
512
+ | `POST` | `/commitments/from-text` | Create from natural language |
513
+ | `GET` | `/commitments/{id}` | Get one commitment |
514
+ | `PATCH` | `/commitments/{id}` | Edit fields |
515
+ | `POST` | `/commitments/{id}/complete` | Mark done |
516
+ | `POST` | `/commitments/{id}/snooze` | Snooze to new time |
517
+ | `DELETE` | `/commitments/{id}` | Archive |
518
+ | `GET` | `/commitments/{id}/decisions` | Policy decision trace |
519
+ | `GET` | `/signals` | Recent behavioral signals |
520
+ | `POST` | `/signals` | Ingest a signal |
521
+ | `GET` | `/stats` | Overall follow-through stats |
522
+ | `GET` | `/settings` | Current settings |
523
+ | `PUT` | `/settings/budget` | Set daily attention budget |
524
+ | `PUT` | `/settings/digest` | Set daily digest time |
525
+ | `GET` | `/features` | List V3 features |
526
+ | `PUT` | `/features/{name}` | Enable/disable a V3 feature |
527
+
528
+ All endpoints accept `Authorization: Bearer <VIGIL_SECRET_TOKEN>` when a token is set.
529
+
530
+ ---
531
+
532
+ ## Logs
533
+
534
+ ```bash
535
+ tail -f ~/.vigil/vigil.log
536
+ grep "action=notify" ~/.vigil/vigil.log
537
+ grep "auto_abandoned" ~/.vigil/vigil.log
538
+ grep "commitment_id=3" ~/.vigil/vigil.log
539
+ grep "adaptive_boost" ~/.vigil/vigil.log
540
+ grep "idle_nudge_sent" ~/.vigil/vigil.log
541
+ grep "reliability_report_sent" ~/.vigil/vigil.log
542
+ ```
543
+
544
+ ---
545
+
546
+ ## Compatibility
547
+
548
+ | Platform | How to connect | Notes |
549
+ |---|---|---|
550
+ | **Claude Desktop** | `pip install -e .` → MCP config | Plug-and-play, full tool support |
551
+ | **Cursor / Cline / Zed** | Same as Claude Desktop | Works out of the box |
552
+ | **ChatGPT Custom GPT** | Deploy hosted mode → point GPT Action at `/openapi.json` | Full CRUD via REST |
553
+ | **iPhone / Android** | Visit hosted URL → Add to Home Screen → enable notifications | PWA + Web Push, no app store |
554
+ | **Slack** | Incoming webhook (outbound) + slash command (inbound) | `/vigil` creates commitments |
555
+ | **Discord** | Incoming webhook | Nudges as rich embeds |
556
+ | **Any web app / script** | REST API at `localhost:7735` or hosted URL | Standard JSON HTTP |
557
+ | **No AI at all** | `vigil` → open `localhost:7734` | Full dashboard UI — add/complete/snooze without any AI |
558
+
559
+ ---
560
+
561
+ ## Why this is different
562
+
563
+ - **Not a reminder app** — it reasons about *when* to interrupt you, not just *what* to remind you about
564
+ - **Not a wrapper** — the policy engine is the product
565
+ - **Explainable** — every decision is logged and queryable. Ask "why did you message me?" and get the full trace
566
+ - **Self-tuning** — adaptive policy adjusts importance scores based on your actual follow-through behavior
567
+ - **Idle-aware** — knows when you've been away too long and escalates accordingly
568
+ - **Local-first** — all data stays on your machine (SQLite in `~/.vigil/`)
569
+ - **Natural input** — type plain English; Vigil figures out the structure
570
+ - **Extensible** — V3 feature flag system lets you add GitHub, calendar, and team features when you need them
571
+
572
+ ---
573
+
574
+ ## Built with
575
+
576
+ - [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk) — FastMCP server
577
+ - [Anthropic SDK](https://github.com/anthropics/anthropic-sdk-python) — NL parsing via claude-haiku
578
+ - SQLite — local-first, thread-safe persistence
579
+ - Python stdlib only for webhooks — no extra dependencies for Slack/Discord delivery