archer-wizard 0.2.1 → 0.2.2

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.
@@ -0,0 +1,378 @@
1
+ # Archer MCP — Complete Architecture Deep Dive
2
+
3
+ Archer is an **MCP server + persistent daemon** system that gives AI agents real-time event intelligence over Supabase databases. It operates in two modes: a **setup wizard** (interactive CLI) and an **MCP server** (stdio transport for AI agents), backed by a **TCP daemon** that holds Supabase Realtime channels independently of agent sessions.
4
+
5
+ ---
6
+
7
+ ## High-Level Architecture
8
+
9
+ ```mermaid
10
+ graph TB
11
+ subgraph "User's Machine"
12
+ CLI["npx archer-wizard<br/>(wizard mode)"]
13
+ MCP["MCP Server<br/>(--mcp mode)"]
14
+ Daemon["Daemon Process<br/>(detached, TCP :44380)"]
15
+ State["~/.archer/state.json"]
16
+ PID["~/.archer/daemon.pid"]
17
+ end
18
+
19
+ subgraph "Agent Configs"
20
+ Cursor["Cursor mcp.json"]
21
+ Claude["Claude Desktop config"]
22
+ Windsurf["Windsurf mcp_config.json"]
23
+ OpenCode["OpenCode config"]
24
+ end
25
+
26
+ subgraph "External"
27
+ Supabase["Supabase Realtime"]
28
+ Webhook["User Webhook URLs"]
29
+ end
30
+
31
+ CLI -->|"scans .env files"| CLI
32
+ CLI -->|"injects archer entry"| Cursor & Claude & Windsurf & OpenCode
33
+
34
+ MCP -->|"TCP IPC"| Daemon
35
+ Daemon -->|"persists"| State
36
+ Daemon -->|"writes"| PID
37
+ Daemon -->|"Realtime channels"| Supabase
38
+ Supabase -->|"postgres_changes event"| Daemon
39
+ Daemon -->|"POST payload"| Webhook
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Entry Point — [index.ts](file:///Users/amirlankalmukhan/archer-mcp/src/index.ts)
45
+
46
+ The single entry point routes between two modes based on CLI flags:
47
+
48
+ | Flag | Mode | Function |
49
+ |---|---|---|
50
+ | `--mcp` | MCP Server | Starts stdio MCP server, auto-starts daemon via `ensureDaemon()` |
51
+ | *(none)* | Setup Wizard | Runs interactive `clack`-based CLI setup |
52
+ | `--daemon` | Daemon Process | Internal: starts the TCP daemon directly (used by lifecycle spawner) |
53
+
54
+ **MCP Server setup** registers 3 tools (`archer_watch`, `archer_unwatch`, `archer_watches`) on a `StdioServerTransport`, then calls `ensureDaemon()` to guarantee the background process is running.
55
+
56
+ ---
57
+
58
+ ## Module 1: Daemon (`src/daemon/`)
59
+
60
+ The daemon is the heart of Archer — a **detached Node.js process** that holds Supabase Realtime subscriptions and delivers webhooks, surviving agent session restarts.
61
+
62
+ ### IPC Protocol — [types.ts](file:///Users/amirlankalmukhan/archer-mcp/src/daemon/types.ts)
63
+
64
+ Defines JSON-over-TCP protocol on `127.0.0.1:44380`:
65
+
66
+ ```typescript
67
+ // Request types (MCP → Daemon)
68
+ type IpcRequestType = 'add_watch' | 'remove_watch' | 'list_watches' | 'ping';
69
+
70
+ // WatchConfig carries everything needed to subscribe
71
+ interface WatchConfig {
72
+ id: string; // UUID
73
+ table: string;
74
+ event: '*' | 'INSERT' | 'UPDATE' | 'DELETE';
75
+ filter?: string;
76
+ webhookUrl: string;
77
+ supabaseUrl: string; // per-watch credentials for multi-project
78
+ supabaseKey: string;
79
+ createdAt: string; // ISO timestamp
80
+ }
81
+ ```
82
+
83
+ Key constant: `ARCHER_DIR = ~/.archer` — stores `state.json` + `daemon.pid`.
84
+
85
+ ### Persistent Store — [store.ts](file:///Users/amirlankalmukhan/archer-mcp/src/daemon/store.ts)
86
+
87
+ Implements **atomic JSON persistence** at `~/.archer/state.json`:
88
+
89
+ - `loadState()` — reads + parses, returns empty `{ watches: {} }` on failure
90
+ - `saveState()` — writes to temp file first, then `fs.renameSync` for atomicity (no partial writes)
91
+ - State shape: `{ watches: Record<string, WatchConfig> }`
92
+
93
+ ### TCP Server & Channel Manager — [process.ts](file:///Users/amirlankalmukhan/archer-mcp/src/daemon/process.ts)
94
+
95
+ The main daemon loop (~190 lines). On startup:
96
+
97
+ 1. Loads persisted state from `state.json`
98
+ 2. **Reconnects all saved watches** — for each `WatchConfig`, creates a Supabase client + Realtime channel
99
+ 3. Starts TCP server on port `44380`
100
+
101
+ **IPC request handling:**
102
+
103
+ | Request | Action |
104
+ |---|---|
105
+ | `add_watch` | Creates Supabase client, subscribes to `postgres_changes` channel, saves to state, begins delivering webhooks |
106
+ | `remove_watch` | Unsubscribes channel, removes from in-memory map + state file |
107
+ | `list_watches` | Returns all `WatchConfig` entries from state |
108
+ | `ping` | Returns `{ status: 'ok', watches: count }` |
109
+
110
+ **Channel subscription pattern:**
111
+ - Event `*` → subscribes to `INSERT`, `UPDATE`, `DELETE` separately
112
+ - Specific event → subscribes to just that one
113
+ - Filter support via Supabase's `filter` parameter on `postgres_changes`
114
+
115
+ **Webhook delivery** happens inline on each Realtime event — builds a payload with Archer metadata + the row data, then POSTs to the configured URL with retry logic (3 attempts, 2s delay).
116
+
117
+ ### IPC Client — [client.ts](file:///Users/amirlankalmukhan/archer-mcp/src/daemon/client.ts)
118
+
119
+ Used by MCP tools to talk to the daemon:
120
+
121
+ ```
122
+ Tool → sendIpcRequest() → TCP connect → JSON write → read response → parse
123
+ ```
124
+
125
+ - `connectToDaemon()` — creates a `net.Socket`, connects to `127.0.0.1:44380`
126
+ - `sendIpcRequest()` — sends JSON line, reads response, returns parsed `IpcResponse`
127
+ - 5-second timeout on connections
128
+
129
+ ### Lifecycle Manager — [lifecycle.ts](file:///Users/amirlankalmukhan/archer-mcp/src/daemon/lifecycle.ts)
130
+
131
+ Manages the daemon as a detached child process:
132
+
133
+ - `ensureDaemon()` — checks if daemon is already running (PID file + `ping`), spawns if not
134
+ - `startDaemon()` — `child_process.spawn` with `detached: true`, `stdio: 'ignore'`, saves PID file
135
+ - `stopDaemon()` — reads PID file, sends `SIGTERM`, removes PID file
136
+ - `isDaemonRunning()` — reads PID, sends `kill(pid, 0)` to check, falls back to TCP `ping`
137
+
138
+ Spawns: `node dist/daemon/run.js` as a fully detached process.
139
+
140
+ ### Runner — [run.ts](file:///Users/amirlankalmukhan/archer-mcp/src/daemon/run.ts)
141
+
142
+ 7-line entry point for the detached child process — just imports and calls `startDaemonProcess()`.
143
+
144
+ ---
145
+
146
+ ## Module 2: MCP Tools (`src/tools/`)
147
+
148
+ Three tools exposed via the Model Context Protocol:
149
+
150
+ ### archer_watch — [watch.ts](file:///Users/amirlankalmukhan/archer-mcp/src/tools/watch.ts)
151
+
152
+ Creates a persistent real-time watch. Accepts:
153
+ - `table` (required) — Supabase table name
154
+ - `event` — `INSERT` | `UPDATE` | `DELETE` | `*` (default: `*`)
155
+ - `filter` — optional Supabase filter expression
156
+ - `webhookUrl` (required) — destination for event payloads
157
+
158
+ **Flow:** Reads `SUPABASE_URL` + `SUPABASE_SERVICE_ROLE_KEY` from env → generates UUID → builds `WatchConfig` → sends `add_watch` IPC to daemon → returns watch ID to agent.
159
+
160
+ ### archer_unwatch — [unwatch.ts](file:///Users/amirlankalmukhan/archer-mcp/src/tools/unwatch.ts)
161
+
162
+ Removes a watch by ID. Sends `remove_watch` IPC to daemon.
163
+
164
+ ### archer_watches — [watches.ts](file:///Users/amirlankalmukhan/archer-mcp/src/tools/watches.ts)
165
+
166
+ Lists all active watches. Sends `list_watches` IPC to daemon, formats response as a readable list showing table, event, filter, webhook URL, and creation time.
167
+
168
+ ---
169
+
170
+ ## Module 3: Setup Wizard (`src/wizard/`)
171
+
172
+ Interactive CLI that discovers credentials and injects Archer into AI agent configs.
173
+
174
+ ### Orchestrator — [index.ts](file:///Users/amirlankalmukhan/archer-mcp/src/wizard/index.ts)
175
+
176
+ 10-step `clack`-based flow:
177
+
178
+ 1. Show ASCII art banner
179
+ 2. Start clack intro
180
+ 3. Scan project for Supabase credentials
181
+ 4. Detect project framework (Next.js / Vite)
182
+ 5. Prompt for any missing credentials
183
+ 6. Detect installed AI agents
184
+ 7. Inject Archer MCP config into agents
185
+ 8. Filter successful injections
186
+ 9. Inject agent rules (tool documentation)
187
+ 10. Show success box
188
+
189
+ ### Scanner — [scanner.ts](file:///Users/amirlankalmukhan/archer-mcp/src/wizard/scanner.ts)
190
+
191
+ Discovers Supabase credentials from the user's project:
192
+
193
+ **Env file priority:** `.env.local` > `.env` > `.env.development` > `.env.production`
194
+
195
+ **Key aliases searched:**
196
+ | Credential | Aliases |
197
+ |---|---|
198
+ | URL | `SUPABASE_URL`, `NEXT_PUBLIC_SUPABASE_URL`, `VITE_SUPABASE_URL` |
199
+ | Service Key | `SUPABASE_SERVICE_ROLE_KEY`, `SUPABASE_SERVICE_KEY` |
200
+ | Anon Key | `SUPABASE_ANON_KEY`, `NEXT_PUBLIC_SUPABASE_ANON_KEY`, `VITE_SUPABASE_ANON_KEY` |
201
+
202
+ Also **scans the entire codebase** (recursive file search, skipping `node_modules` and hidden dirs) for hardcoded credential patterns as a fallback.
203
+
204
+ `promptForMissing()` — interactive prompts with Zod validation for any credentials not found.
205
+
206
+ ### Detector — [detector.ts](file:///Users/amirlankalmukhan/archer-mcp/src/wizard/detector.ts)
207
+
208
+ Discovers installed AI agents by checking platform-specific config paths:
209
+
210
+ | Agent | macOS Config Path |
211
+ |---|---|
212
+ | Cursor | `~/.cursor/mcp.json` |
213
+ | Claude Code | `~/Library/Application Support/Claude/claude_desktop_config.json` |
214
+ | OpenCode | `~/.config/opencode/opencode.json` |
215
+ | Antigravity | `~/.config/antigravity/config.json` |
216
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` |
217
+
218
+ Cross-platform: has `darwin`, `linux`, `win32` paths for each agent.
219
+
220
+ An agent is considered "installed" if its config file or parent directory exists.
221
+
222
+ ### Injector — [injector.ts](file:///Users/amirlankalmukhan/archer-mcp/src/wizard/injector.ts)
223
+
224
+ Writes Archer's MCP server entry into each agent's config JSON:
225
+
226
+ ```json
227
+ // Standard format (Cursor, Claude, Windsurf, Antigravity)
228
+ { "command": "npx", "args": ["-y", "archer-wizard@latest", "--mcp"],
229
+ "env": { "SUPABASE_URL": "...", "SUPABASE_SERVICE_ROLE_KEY": "..." } }
230
+
231
+ // OpenCode format
232
+ { "type": "local", "command": ["npx", "-y", "archer-wizard@latest", "--mcp"],
233
+ "environment": { ... } }
234
+ ```
235
+
236
+ Reads existing config, merges without overwriting other MCP servers, writes back.
237
+
238
+ ### Rules — [rules.ts](file:///Users/amirlankalmukhan/archer-mcp/src/wizard/rules.ts)
239
+
240
+ Injects a **markdown documentation block** into each agent's rules file so the agent knows about Archer's tools. Uses `<!-- archer:start -->` / `<!-- archer:end -->` comment markers for idempotent updates.
241
+
242
+ Content includes: tool descriptions, parameter docs, usage examples, trigger words ("watch", "monitor", "alert me", etc.).
243
+
244
+ ---
245
+
246
+ ## Module 4: Shared Libraries (`src/lib/`)
247
+
248
+ ### ascii.ts — [ascii.ts](file:///Users/amirlankalmukhan/archer-mcp/src/lib/ascii.ts)
249
+
250
+ Terminal UI utilities:
251
+ - `showAsciiArt()` — green block-character ARCHER banner
252
+ - Status loggers: `logAction` (◆ blue), `logSuccess` (✓ green), `logError` (✗ red), `logProgress` (● white), `logReady` (▶ green)
253
+ - `maskCredential()` — shows first 3-8 chars + `******`
254
+ - `showSuccessBox()` — bordered box with setup summary
255
+ - `stderr*` variants — for MCP mode (stdout is reserved for JSON-RPC)
256
+
257
+ ### supabase.ts — [supabase.ts](file:///Users/amirlankalmukhan/archer-mcp/src/lib/supabase.ts)
258
+
259
+ Supabase client factory + channel helpers:
260
+ - Singleton client from `SUPABASE_URL` + `SUPABASE_SERVICE_ROLE_KEY` env vars
261
+ - `createAuthChannel()` — listens to `auth.users` INSERT events
262
+ - `createTableChannel()` — listens to arbitrary table events in `public` schema
263
+ - `removeChannel()` — cleanup helper
264
+
265
+ ### webhook.ts — [webhook.ts](file:///Users/amirlankalmukhan/archer-mcp/src/lib/webhook.ts)
266
+
267
+ HTTP webhook delivery with retry:
268
+ - 3 attempts, 2-second delay between retries
269
+ - Headers: `Content-Type: application/json`, `User-Agent: Archer/0.1.0`, `X-Archer-Event: <event>`
270
+ - `buildWebhookPayload()` — wraps data in `{ archer: { watchId, event, source, firedAt }, data }`
271
+
272
+ ---
273
+
274
+ ## Module 5: Type System (`src/types/index.ts`)
275
+
276
+ All shared types in one file, Zod-validated where applicable:
277
+
278
+ | Type | Purpose |
279
+ |---|---|
280
+ | `Framework` | `'nextjs' \| 'vite' \| 'unknown'` |
281
+ | `ScanResult` | Scanner output: credentials, framework, source file |
282
+ | `AgentInfo` | Detected agent: name, install status, config path |
283
+ | `WatchEvent` | Zod enum: `auth.signup`, `table.insert/update/delete` |
284
+ | `WatchInput` | Zod schema with refinement: table required for non-auth events |
285
+ | `WatchResult` | Tool response: success, watchId, message |
286
+ | `WebhookPayload` | Structured payload with archer metadata + data |
287
+ | `PostgresEvent` | `'INSERT' \| 'UPDATE' \| 'DELETE'` |
288
+ | `InjectionResult` | Agent injection outcome |
289
+
290
+ ---
291
+
292
+ ## Data Flow: End-to-End Watch Lifecycle
293
+
294
+ ```mermaid
295
+ sequenceDiagram
296
+ participant Agent as AI Agent
297
+ participant MCP as MCP Server
298
+ participant Daemon as Daemon (:44380)
299
+ participant SB as Supabase
300
+ participant WH as Webhook URL
301
+
302
+ Agent->>MCP: archer_watch({ table, event, webhookUrl })
303
+ MCP->>MCP: Read SUPABASE_URL/KEY from env
304
+ MCP->>MCP: Generate UUID watchId
305
+ MCP->>Daemon: TCP: add_watch(WatchConfig)
306
+ Daemon->>Daemon: Create Supabase client
307
+ Daemon->>SB: Subscribe postgres_changes channel
308
+ Daemon->>Daemon: Save to state.json (atomic)
309
+ Daemon->>MCP: TCP: { success, watchId }
310
+ MCP->>Agent: "Watch created: {watchId}"
311
+
312
+ Note over SB,Daemon: Later, a database change occurs...
313
+
314
+ SB->>Daemon: Realtime: row INSERT/UPDATE/DELETE
315
+ Daemon->>Daemon: Build webhook payload
316
+ Daemon->>WH: POST { archer: {...}, data: {...} }
317
+ WH->>Daemon: 200 OK
318
+
319
+ Note over Agent,Daemon: Agent session can restart...
320
+ Note over Daemon: Daemon survives, keeps watching
321
+ ```
322
+
323
+ ---
324
+
325
+ ## Key Design Decisions
326
+
327
+ | Decision | Rationale |
328
+ |---|---|
329
+ | **TCP IPC over Unix sockets** | Cross-platform (macOS, Linux, Windows) |
330
+ | **JSON lines protocol** | Simple, debuggable, no binary framing |
331
+ | **Detached daemon process** | Survives parent MCP server lifecycle |
332
+ | **Per-watch credentials** | Multi-project Supabase support |
333
+ | **Atomic state writes** | Temp file + rename prevents corruption |
334
+ | **Auto-start daemon** | `ensureDaemon()` on MCP boot — zero friction |
335
+ | **Agent-aware config injection** | Different JSON shapes for OpenCode vs others |
336
+ | **Idempotent rules injection** | HTML comment markers for safe re-runs |
337
+ | **Env file priority chain** | `.env.local` wins over `.env` — matches Next.js convention |
338
+ | **Codebase-wide credential scan** | Fallback when env files are missing |
339
+
340
+ ---
341
+
342
+ ## File Map (17 source files)
343
+
344
+ ```
345
+ src/
346
+ ├── index.ts ← Entry point: --mcp / --daemon / wizard
347
+ ├── daemon/
348
+ │ ├── types.ts ← IPC protocol, WatchConfig, constants
349
+ │ ├── store.ts ← Atomic JSON persistence (~/.archer/state.json)
350
+ │ ├── process.ts ← TCP server, Supabase channels, webhook delivery
351
+ │ ├── client.ts ← IPC client (tools → daemon)
352
+ │ ├── lifecycle.ts ← Start/stop/ensure daemon, PID management
353
+ │ └── run.ts ← Detached process entry point
354
+ ├── tools/
355
+ │ ├── watch.ts ← archer_watch tool
356
+ │ ├── unwatch.ts ← archer_unwatch tool
357
+ │ └── watches.ts ← archer_watches tool
358
+ ├── wizard/
359
+ │ ├── index.ts ← 10-step clack CLI orchestrator
360
+ │ ├── scanner.ts ← Credential discovery (env files + codebase)
361
+ │ ├── detector.ts ← AI agent detection (5 agents, 3 platforms)
362
+ │ ├── injector.ts ← MCP config injection
363
+ │ └── rules.ts ← Agent rules/docs injection
364
+ ├── lib/
365
+ │ ├── ascii.ts ← Terminal UI (banner, loggers, stderr)
366
+ │ ├── supabase.ts ← Client factory + channel helpers
367
+ │ └── webhook.ts ← HTTP delivery with retry
368
+ └── types/
369
+ └── index.ts ← All shared types + Zod schemas
370
+ ```
371
+
372
+ ## Verification
373
+
374
+ - ✅ TypeScript build (`npm run build`) — zero errors
375
+ - ✅ All source files compiled to `dist/`
376
+ - ✅ IPC protocol uses JSON-over-TCP on `127.0.0.1:44380`
377
+ - ✅ State persists to `~/.archer/state.json` with atomic writes
378
+ - ✅ 5 AI agents supported across 3 platforms (macOS/Linux/Windows)
package/README.md CHANGED
@@ -17,21 +17,18 @@
17
17
 
18
18
  ## what is Archer
19
19
 
20
- Zapier was built for apps talking to apps.
21
- **Archer was built for the world talking to AI agents.**
22
-
23
20
  Every AI agent today is reactive. Cursor, Claude Code, opencode — they sit completely idle until you manually talk to them. Nobody built the layer that lets them feel what's happening in real time and act on their own.
24
21
 
25
22
  Archer is that layer.
26
23
 
27
- You define a condition once in plain english. Archer watches your data sources 24/7. The moment that condition is true — your AI agent wakes up, already loaded with full context, and acts immediately. No prompting. No polling. No manual triggers.
24
+ You tell your agent what to watch. Archer monitors your data sources 24/7. The moment something changes — your agent fires, already loaded with full context. No prompting. No polling. No manual triggers.
28
25
 
29
26
  ---
30
27
 
31
28
  ## install
32
29
 
33
30
  ```bash
34
- npx archer@latest
31
+ npx archer-wizard@latest
35
32
  ```
36
33
 
37
34
  Run this inside any project folder. Archer handles everything else automatically.
@@ -41,13 +38,13 @@ Run this inside any project folder. Archer handles everything else automatically
41
38
  ## how it works
42
39
 
43
40
  ```
44
- your data source ──→ Archer watches 24/7 ──→ condition met ──→ agent fires
41
+ your data source ──→ Archer watches 24/7 ──→ event detected ──→ agent fires
45
42
  ```
46
43
 
47
44
  1. **scans** your project for data source credentials automatically
48
45
  2. **detects** which AI agents you have installed on your machine
49
46
  3. **injects** itself into all their configs — one confirmation, no manual JSON
50
- 4. **teaches** every agent when to call `archer.watch()` automatically via global rules
47
+ 4. **teaches** every agent when to call `archer_watch` automatically via rules
51
48
  5. your agent now has a nervous system — it feels the world and acts on its own
52
49
 
53
50
  ---
@@ -61,72 +58,102 @@ npx archer-wizard@latest
61
58
  # 2. Archer scans your .env, finds your credentials, injects into your agents
62
59
 
63
60
  # 3. open your AI agent and say:
64
- "watch my users table for new signups and fire https://your-webhook-url"
61
+ "watch my users table for new inserts and fire https://your-webhook-url"
65
62
 
66
63
  # 4. insert a row in your database
67
64
 
68
- # 5. your agent fires automatically
65
+ # 5. your webhook fires with full event context
69
66
  ```
70
67
 
71
68
  ---
72
69
 
73
- ## the tool — `archer.watch()`
70
+ ## MCP tools
71
+
72
+ Once Archer is set up, your AI agent has access to these tools natively. You never call them directly — your agent calls them when you describe what you want.
73
+
74
+ ### `archer_watch`
75
+
76
+ Create a persistent real-time watch on a table. Watches survive agent session restarts.
77
+
78
+ ```typescript
79
+ archer_watch({
80
+ table: string, // table or resource to watch (required)
81
+ event?: string, // INSERT | UPDATE | DELETE | * (default: *)
82
+ filter?: string, // e.g. "status=eq.active", "amount=gt.1000"
83
+ webhookUrl?: string // URL to receive POST when event fires
84
+ })
85
+ ```
86
+
87
+ ### `archer_unwatch`
74
88
 
75
- Once Archer is set up, your AI agent has access to this tool natively. You never call it directly — your agent calls it when you describe what you want.
89
+ Remove an active watch by its ID.
76
90
 
77
91
  ```typescript
78
- archer.watch({
79
- source: string, // data source
80
- event: string, // what to listen for
81
- table?: string, // table name for table events
82
- condition?: string, // plain english condition (optional)
83
- webhookUrl: string // where to fire when condition is met
92
+ archer_unwatch({
93
+ watchId: string // the watch ID returned by archer_watch
84
94
  })
85
95
  ```
86
96
 
87
- **just talk to your agent:**
97
+ ### `archer_watches`
98
+
99
+ List all active watches — their IDs, tables, events, filters, and webhook URLs.
100
+
101
+ ```typescript
102
+ archer_watches()
103
+ ```
104
+
105
+ ---
106
+
107
+ ## talk to your agent
108
+
109
+ ```
110
+ "watch my users table and fire https://your-webhook.com when a new row is inserted"
111
+ ```
112
+
113
+ ```
114
+ "monitor the orders table for updates where status equals shipped"
115
+ ```
88
116
 
89
117
  ```
90
- "watch my users table and fire https://your-webhook.com
91
- when a new user signs up with a .edu email"
118
+ "alert me at https://your-webhook.com every time a row is deleted from sessions"
92
119
  ```
93
120
 
94
121
  ```
95
- "watch my orders table for new inserts and notify https://your-webhook.com"
122
+ "show me all active watches"
96
123
  ```
97
124
 
98
125
  ```
99
- "fire https://your-webhook.com every time a row is deleted from sessions"
126
+ "stop watching the payments table"
100
127
  ```
101
128
 
102
129
  ---
103
130
 
104
- ## supported events (currently only supabase, p.s. we will add more soon)
131
+ ## supported events
105
132
 
106
133
  | event | description |
107
134
  |---|---|
108
- | `auth.signup` | new user registers |
109
- | `table.insert` | new row inserted into any table |
110
- | `table.update` | existing row updated |
111
- | `table.delete` | row deleted |
135
+ | `INSERT` | new row inserted into a table |
136
+ | `UPDATE` | existing row updated |
137
+ | `DELETE` | row deleted |
138
+ | `*` | all changes (default) |
112
139
 
113
140
  ---
114
141
 
115
142
  ## webhook payload
116
143
 
117
- Every time Archer fires, your agent receives this:
144
+ Every time Archer fires, your webhook receives this:
118
145
 
119
146
  ```json
120
147
  {
121
148
  "archer": {
122
149
  "watchId": "uuid",
123
- "event": "table.insert",
124
- "source": "supabase",
150
+ "event": "INSERT",
151
+ "table": "users",
125
152
  "firedAt": "ISO timestamp"
126
153
  },
127
154
  "data": {
128
155
  "id": "row-id",
129
- "email": "user@university.edu",
156
+ "email": "user@example.com",
130
157
  "created_at": "timestamp"
131
158
  }
132
159
  }
@@ -143,22 +170,20 @@ Archer auto-detects and injects into all of these:
143
170
  | Cursor | ✓ supported |
144
171
  | Claude Code | ✓ supported |
145
172
  | opencode | ✓ supported |
146
- | Google Antigravity | ✓ supported |
147
173
  | Windsurf | ✓ supported |
174
+ | Antigravity | ✓ supported |
148
175
 
149
176
  ---
150
177
 
151
178
  ## supported data sources
152
179
 
153
- Archer is built universal — any data source, any platform.
154
-
155
180
  | source | status |
156
181
  |---|---|
157
182
  | Supabase | ✓ available now |
183
+ | PostgreSQL | coming soon |
184
+ | MySQL | coming soon |
158
185
  | GitHub | coming soon |
159
186
  | Stripe | coming soon |
160
- | Linear | coming soon |
161
- | Vercel | coming soon |
162
187
  | custom webhooks | coming soon |
163
188
 
164
189
  ---
@@ -174,17 +199,17 @@ Archer scans these files automatically in priority order:
174
199
  .env.production
175
200
  ```
176
201
 
177
- It recognizes all common aliases automatically:
202
+ It recognizes common aliases automatically:
178
203
 
179
204
  ```bash
180
205
  # standard
181
206
  SUPABASE_URL=https://yourproject.supabase.co
182
207
  SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
183
208
 
184
- # Next.js — also recognized automatically
209
+ # Next.js
185
210
  NEXT_PUBLIC_SUPABASE_URL=...
186
211
 
187
- # Vite — also recognized automatically
212
+ # Vite
188
213
  VITE_SUPABASE_URL=...
189
214
  ```
190
215
 
@@ -210,12 +235,14 @@ npx archer-wizard@latest realtime channel
210
235
  ↓ ↓
211
236
  wizard scans .env Archer subscribes to changes 24/7
212
237
  ↓ ↓
213
- injects into agents condition matched → webhook fires
238
+ injects into agents event detected → webhook fires
214
239
  ↓ ↓
215
- agent calls archer.watch() AI agent wakes up with full context
240
+ agent calls archer_watch your agent wakes up with full context
216
241
  ```
217
242
 
218
- No AI at runtime. Once a condition is defined it is pure logic — fast, cheap, reliable.
243
+ No AI at runtime. Once a watch is defined it is pure logic — fast, cheap, reliable.
244
+
245
+ For a deep dive into how Archer is built internally — daemon IPC, state persistence, MCP tools, and the wizard pipeline — see [ARCHITECTURE.md](./ARCHITECTURE.md).
219
246
 
220
247
  ---
221
248
 
@@ -229,20 +256,19 @@ No AI at runtime. Once a condition is defined it is pure logic — fast, cheap,
229
256
 
230
257
  Everything runs locally on your machine using your own credentials. The architecture is universal from day one — the simplicity is intentional.
231
258
 
232
-
259
+ ---
233
260
 
234
261
  ```bash
235
- # Install from npm
262
+ # install from npm
236
263
  npx archer-wizard@latest
237
264
 
238
- # Or from source:
265
+ # or from source
239
266
  git clone https://github.com/amirlan-labs/archer-mcp
240
267
  cd archer-mcp
241
268
  npm install
242
269
  npm run dev
243
270
  ```
244
271
 
245
-
246
272
  <div align="center">
247
273
 
248
274
  *agents stop waiting. the world starts talking.*
package/dist/lib/ascii.js CHANGED
@@ -50,7 +50,7 @@ export function showSuccessBox(agentCount) {
50
50
  ` ${pc.green('▶')} Archer is ready`,
51
51
  '',
52
52
  ` injected into ${agentCount} agent${agentCount !== 1 ? 's' : ''}`,
53
- ' connected to your Supabase project',
53
+ ' connected to your backend',
54
54
  '',
55
55
  ' open your AI agent and say:',
56
56
  ` ${pc.dim('"watch my users table for new signups"')}`,
@@ -1 +1 @@
1
- {"version":3,"file":"ascii.js","sourceRoot":"","sources":["../../src/lib/ascii.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,qCAAqC;AACrC,MAAM,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AAErC,yDAAyD;AACzD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;AAC7B,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC;AAE9B,+DAA+D;AAE/D,MAAM,UAAU,YAAY;IAC1B,MAAM,KAAK,GAAG;QACZ,EAAE;QACF,oDAAoD;QACpD,oDAAoD;QACpD,oDAAoD;QACpD,oDAAoD;QACpD,oDAAoD;QACpD,oDAAoD;QACpD,EAAE;KACH,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC;AAED,+DAA+D;AAE/D,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,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,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,+DAA+D;AAE/D,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,IAAI,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,OAAO,IAAI,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,OAAO,IAAI,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,OAAO,IAAI,CAAC,CAAC;AACzD,CAAC"}
@@ -76,9 +76,5 @@ export interface InjectionResult {
76
76
  success: boolean;
77
77
  error?: string;
78
78
  }
79
- export interface McpServerEntry {
80
- command: string;
81
- args: string[];
82
- env: Record<string, string>;
83
- }
79
+ export type McpServerEntry = Record<string, unknown>;
84
80
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d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AC7B,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,UAAU,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAID,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3D,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,CAAC;CACtB;AAID,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
@@ -21,9 +21,9 @@ const AGENTS = [
21
21
  {
22
22
  name: 'opencode',
23
23
  paths: {
24
- darwin: path.join(os.homedir(), '.config', 'opencode', 'config.json'),
25
- linux: path.join(os.homedir(), '.config', 'opencode', 'config.json'),
26
- win32: path.join(process.env['APPDATA'] ?? os.homedir(), 'opencode', 'config.json'),
24
+ darwin: path.join(os.homedir(), '.config', 'opencode', 'opencode.json'),
25
+ linux: path.join(os.homedir(), '.config', 'opencode', 'opencode.json'),
26
+ win32: path.join(process.env['APPDATA'] ?? os.homedir(), 'opencode', 'opencode.json'),
27
27
  },
28
28
  },
29
29
  {
@@ -1 +1 @@
1
- {"version":3,"file":"detector.js","sourceRoot":"","sources":["../../src/wizard/detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;A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AAE,CAAC,OAAO,EAAE,CAAC;IAE7B,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;QAC9D,KAAK,aAAa;YAChB,qDAAqD;YACrD,mDAAmD;YACnD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;QAC/C,KAAK,UAAU;YACb,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;QAC/D,KAAK,aAAa;YAChB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;QAClE,KAAK,UAAU;YACb,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;QAChE;YACE,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"injector.d.ts","sourceRoot":"","sources":["../../src/wizard/injector.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAkB,MAAM,mBAAmB,CAAC;AAuEpF,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,SAAS,EAAE,EACnB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,eAAe,EAAE,CAAC,CAiC5B"}
1
+ {"version":3,"file":"injector.d.ts","sourceRoot":"","sources":["../../src/wizard/injector.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAkB,MAAM,mBAAmB,CAAC;AAuFpF,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,SAAS,EAAE,EACnB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,eAAe,EAAE,CAAC,CAiC5B"}
@@ -4,15 +4,25 @@ import * as clack from '@clack/prompts';
4
4
  import pc from 'picocolors';
5
5
  import { logSuccess, logError, logAction } from '../lib/ascii.js';
6
6
  import { getConfigKey } from './detector.js';
7
- // ─── Archer MCP Entry ───────────────────────────────────────
8
- function buildArcherEntry(supabaseUrl, serviceRoleKey) {
7
+ // ─── Archer MCP Entry (agent-aware) ─────────────────────────
8
+ function buildArcherEntry(agentName, supabaseUrl, serviceRoleKey) {
9
+ const envVars = {
10
+ SUPABASE_URL: supabaseUrl,
11
+ SUPABASE_SERVICE_ROLE_KEY: serviceRoleKey,
12
+ };
13
+ // opencode uses { type, command[], environment }
14
+ if (agentName === 'opencode') {
15
+ return {
16
+ type: 'local',
17
+ command: ['npx', '-y', 'archer-wizard@latest', '--mcp'],
18
+ environment: envVars,
19
+ };
20
+ }
21
+ // cursor, claude-code, windsurf, antigravity use { command, args, env }
9
22
  return {
10
23
  command: 'npx',
11
24
  args: ['-y', 'archer-wizard@latest', '--mcp'],
12
- env: {
13
- SUPABASE_URL: supabaseUrl,
14
- SUPABASE_SERVICE_ROLE_KEY: serviceRoleKey,
15
- },
25
+ env: envVars,
16
26
  };
17
27
  }
18
28
  // ─── Read or Create Config ──────────────────────────────────
@@ -40,7 +50,7 @@ function injectIntoAgent(agent, supabaseUrl, serviceRoleKey) {
40
50
  try {
41
51
  const configKey = getConfigKey(agent.name);
42
52
  const config = readConfig(agent.configPath);
43
- const archerEntry = buildArcherEntry(supabaseUrl, serviceRoleKey);
53
+ const archerEntry = buildArcherEntry(agent.name, supabaseUrl, serviceRoleKey);
44
54
  // Ensure the config key object exists
45
55
  if (!config[configKey] || typeof config[configKey] !== 'object') {
46
56
  config[configKey] = {};
@@ -1 +1 @@
1
- {"version":3,"file":"injector.js","sourceRoot":"","sources":["../../src/wizard/injector.ts"],"names":[],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AC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG;QACtF,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IAEH,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClD,SAAS,CAAC,mBAAmB,CAAC,CAAC;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,mCAAmC;IACnC,MAAM,OAAO,GAAsB,EAAE,CAAC;IACtC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/wizard/rules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAsHnD,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAIrD"}
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/wizard/rules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AA4InD,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAIrD"}
@@ -6,53 +6,75 @@ import { getRulesPath } from './detector.js';
6
6
  const RULE_CONTENT = `
7
7
  # Archer — Event Intelligence for AI Agents
8
8
 
9
- Archer is the event intelligence layer for AI agents. It connects to your data sources (Supabase, GitHub, Stripe, Linear, etc.), watches for conditions you define in plain english, and fires your AI agent the moment those conditions are true, with full context already loaded.
9
+ Archer is the universal event intelligence layer for AI agents. It watches your data sources in real time, detects changes the moment they happen, and delivers full context to your webhook so your agent can react instantly, without polling.
10
10
 
11
- ## Available Tool: archer.watch
11
+ ## Available MCP Tools
12
12
 
13
- You can watch real-time events from data sources using the \`archer.watch\` MCP tool.
13
+ ### archer_watch
14
+ Create a persistent real-time watch on a data source. Watches survive agent session restarts.
14
15
 
15
- ### When to Use Archer
16
+ **Parameters:**
17
+ - **table** *(required)* — name of the table or resource to watch
18
+ - **event** — type of change: \`INSERT\`, \`UPDATE\`, \`DELETE\`, or \`*\` (all). Default: \`*\`
19
+ - **filter** — optional filter expression, e.g. \`"status=eq.active"\` or \`"amount=gt.1000"\`
20
+ - **webhookUrl** — URL to receive a POST with full event payload when a match fires
16
21
 
17
- Use Archer whenever you need to:
18
- - Monitor database changes (inserts, updates, deletes)
19
- - Watch for new user signups
20
- - React to events in external services
21
- - Automate responses to data changes
22
- - Set up real-time notifications
22
+ ### archer_unwatch
23
+ Remove an active watch by its ID. Stops listening and cleans up.
23
24
 
24
- ### Parameters
25
+ **Parameters:**
26
+ - **watchId** *(required)* — the watch ID returned by \`archer_watch\`
25
27
 
26
- - **source**: data source (currently \`"supabase"\`)
27
- - **event**: one of \`"auth.signup"\`, \`"table.insert"\`, \`"table.update"\`, \`"table.delete"\`
28
- - **table**: the table name (required for table events)
29
- - **condition**: optional filter like \`"email ends with @gmail.com"\`
30
- - **webhookUrl**: URL to receive POST notifications when events match
28
+ ### archer_watches
29
+ List all active watches their IDs, tables, events, filters, and webhook URLs.
31
30
 
32
- ### Examples
31
+ ## When to Use Archer
33
32
 
34
- 1. Watch for new user signups:
33
+ Use Archer any time the user wants to:
34
+ - **Monitor data changes** — new rows, updates, deletions in any table
35
+ - **React to events** — trigger automations when conditions are met
36
+ - **Set up alerts** — notify on signups, new orders, status changes, threshold breaches
37
+ - **Build event-driven workflows** — chain watches with webhooks for real-time pipelines
38
+ - **Track activity** — audit logs, user actions, system events
39
+
40
+ ## Examples
41
+
42
+ 1. Watch for new rows in a table:
43
+ \`\`\`
44
+ archer_watch({ table: "users", event: "INSERT", webhookUrl: "https://hooks.example.com/new-users" })
45
+ \`\`\`
46
+
47
+ 2. Watch for updates with a filter:
35
48
  \`\`\`
36
- archer.watch({ source: "supabase", event: "auth.signup", webhookUrl: "https://hooks.example.com/signups" })
49
+ archer_watch({ table: "orders", event: "UPDATE", filter: "status=eq.shipped", webhookUrl: "https://hooks.example.com/shipped" })
37
50
  \`\`\`
38
51
 
39
- 2. Watch for inserts to the orders table:
52
+ 3. Watch all changes on a table:
40
53
  \`\`\`
41
- archer.watch({ source: "supabase", event: "table.insert", table: "orders", webhookUrl: "https://hooks.example.com/orders" })
54
+ archer_watch({ table: "payments", webhookUrl: "https://hooks.example.com/payments" })
42
55
  \`\`\`
43
56
 
44
- 3. Watch with a condition:
57
+ 4. List active watches:
45
58
  \`\`\`
46
- archer.watch({ source: "supabase", event: "table.insert", table: "users", condition: "email ends with @company.com", webhookUrl: "https://hooks.example.com/vip" })
59
+ archer_watches()
47
60
  \`\`\`
48
61
 
49
- ### Best Practices
62
+ 5. Stop a watch:
63
+ \`\`\`
64
+ archer_unwatch({ watchId: "abc-123" })
65
+ \`\`\`
66
+
67
+ ## Best Practices
68
+
69
+ - Add filters to reduce noise — only fire on events that matter
70
+ - Use descriptive webhook URLs that map to specific actions
71
+ - Chain multiple watches for complex event-driven workflows
72
+ - Use \`archer_watches\` to inspect and manage active watchers
73
+ - Clean up watches you no longer need with \`archer_unwatch\`
50
74
 
51
- - Use descriptive webhook URLs that indicate the action to take
52
- - Add conditions to filter events and reduce noise
53
- - Combine with your existing workflows for maximum impact
75
+ ## Trigger Words
54
76
 
55
- When the user asks to "watch", "monitor", "notify", or "fire" something, use Archer.
77
+ When the user says **"watch"**, **"monitor"**, **"notify me"**, **"alert me"**, **"track"**, **"listen for"**, or **"fire when"** use Archer.
56
78
  `.trim();
57
79
  // ─── Archer Block Markers ───────────────────────────────────
58
80
  const BLOCK_START = '<!-- archer:start -->';
@@ -1 +1 @@
1
- {"version":3,"file":"rules.js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AAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,+DAA+D;AAE/D,MAAM,UAAU,WAAW,CAAC,MAAmB;IAC7C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archer-wizard",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "event intelligence layer for AI agents",
5
5
  "type": "module",
6
6
  "bin": {
package/src/lib/ascii.ts CHANGED
@@ -65,7 +65,7 @@ export function showSuccessBox(agentCount: number): void {
65
65
  ` ${pc.green('▶')} Archer is ready`,
66
66
  '',
67
67
  ` injected into ${agentCount} agent${agentCount !== 1 ? 's' : ''}`,
68
- ' connected to your Supabase project',
68
+ ' connected to your backend',
69
69
  '',
70
70
  ' open your AI agent and say:',
71
71
  ` ${pc.dim('"watch my users table for new signups"')}`,
@@ -113,8 +113,4 @@ export interface InjectionResult {
113
113
  error?: string;
114
114
  }
115
115
 
116
- export interface McpServerEntry {
117
- command: string;
118
- args: string[];
119
- env: Record<string, string>;
120
- }
116
+ export type McpServerEntry = Record<string, unknown>;
@@ -34,9 +34,9 @@ const AGENTS: AgentPathConfig[] = [
34
34
  {
35
35
  name: 'opencode',
36
36
  paths: {
37
- darwin: path.join(os.homedir(), '.config', 'opencode', 'config.json'),
38
- linux: path.join(os.homedir(), '.config', 'opencode', 'config.json'),
39
- win32: path.join(process.env['APPDATA'] ?? os.homedir(), 'opencode', 'config.json'),
37
+ darwin: path.join(os.homedir(), '.config', 'opencode', 'opencode.json'),
38
+ linux: path.join(os.homedir(), '.config', 'opencode', 'opencode.json'),
39
+ win32: path.join(process.env['APPDATA'] ?? os.homedir(), 'opencode', 'opencode.json'),
40
40
  },
41
41
  },
42
42
  {
@@ -6,16 +6,32 @@ import { logSuccess, logError, logAction } from '../lib/ascii.js';
6
6
  import { getConfigKey } from './detector.js';
7
7
  import type { AgentInfo, InjectionResult, McpServerEntry } from '../types/index.js';
8
8
 
9
- // ─── Archer MCP Entry ───────────────────────────────────────
9
+ // ─── Archer MCP Entry (agent-aware) ─────────────────────────
10
10
 
11
- function buildArcherEntry(supabaseUrl: string, serviceRoleKey: string): McpServerEntry {
11
+ function buildArcherEntry(
12
+ agentName: string,
13
+ supabaseUrl: string,
14
+ serviceRoleKey: string,
15
+ ): McpServerEntry {
16
+ const envVars = {
17
+ SUPABASE_URL: supabaseUrl,
18
+ SUPABASE_SERVICE_ROLE_KEY: serviceRoleKey,
19
+ };
20
+
21
+ // opencode uses { type, command[], environment }
22
+ if (agentName === 'opencode') {
23
+ return {
24
+ type: 'local',
25
+ command: ['npx', '-y', 'archer-wizard@latest', '--mcp'],
26
+ environment: envVars,
27
+ };
28
+ }
29
+
30
+ // cursor, claude-code, windsurf, antigravity use { command, args, env }
12
31
  return {
13
32
  command: 'npx',
14
33
  args: ['-y', 'archer-wizard@latest', '--mcp'],
15
- env: {
16
- SUPABASE_URL: supabaseUrl,
17
- SUPABASE_SERVICE_ROLE_KEY: serviceRoleKey,
18
- },
34
+ env: envVars,
19
35
  };
20
36
  }
21
37
 
@@ -51,7 +67,7 @@ function injectIntoAgent(
51
67
  try {
52
68
  const configKey = getConfigKey(agent.name);
53
69
  const config = readConfig(agent.configPath);
54
- const archerEntry = buildArcherEntry(supabaseUrl, serviceRoleKey);
70
+ const archerEntry = buildArcherEntry(agent.name, supabaseUrl, serviceRoleKey);
55
71
 
56
72
  // Ensure the config key object exists
57
73
  if (!config[configKey] || typeof config[configKey] !== 'object') {
@@ -9,53 +9,75 @@ import type { AgentInfo } from '../types/index.js';
9
9
  const RULE_CONTENT = `
10
10
  # Archer — Event Intelligence for AI Agents
11
11
 
12
- Archer is the event intelligence layer for AI agents. It connects to your data sources (Supabase, GitHub, Stripe, Linear, etc.), watches for conditions you define in plain english, and fires your AI agent the moment those conditions are true, with full context already loaded.
12
+ Archer is the universal event intelligence layer for AI agents. It watches your data sources in real time, detects changes the moment they happen, and delivers full context to your webhook so your agent can react instantly, without polling.
13
13
 
14
- ## Available Tool: archer.watch
14
+ ## Available MCP Tools
15
15
 
16
- You can watch real-time events from data sources using the \`archer.watch\` MCP tool.
16
+ ### archer_watch
17
+ Create a persistent real-time watch on a data source. Watches survive agent session restarts.
17
18
 
18
- ### When to Use Archer
19
+ **Parameters:**
20
+ - **table** *(required)* — name of the table or resource to watch
21
+ - **event** — type of change: \`INSERT\`, \`UPDATE\`, \`DELETE\`, or \`*\` (all). Default: \`*\`
22
+ - **filter** — optional filter expression, e.g. \`"status=eq.active"\` or \`"amount=gt.1000"\`
23
+ - **webhookUrl** — URL to receive a POST with full event payload when a match fires
19
24
 
20
- Use Archer whenever you need to:
21
- - Monitor database changes (inserts, updates, deletes)
22
- - Watch for new user signups
23
- - React to events in external services
24
- - Automate responses to data changes
25
- - Set up real-time notifications
25
+ ### archer_unwatch
26
+ Remove an active watch by its ID. Stops listening and cleans up.
26
27
 
27
- ### Parameters
28
+ **Parameters:**
29
+ - **watchId** *(required)* — the watch ID returned by \`archer_watch\`
28
30
 
29
- - **source**: data source (currently \`"supabase"\`)
30
- - **event**: one of \`"auth.signup"\`, \`"table.insert"\`, \`"table.update"\`, \`"table.delete"\`
31
- - **table**: the table name (required for table events)
32
- - **condition**: optional filter like \`"email ends with @gmail.com"\`
33
- - **webhookUrl**: URL to receive POST notifications when events match
31
+ ### archer_watches
32
+ List all active watches their IDs, tables, events, filters, and webhook URLs.
34
33
 
35
- ### Examples
34
+ ## When to Use Archer
36
35
 
37
- 1. Watch for new user signups:
36
+ Use Archer any time the user wants to:
37
+ - **Monitor data changes** — new rows, updates, deletions in any table
38
+ - **React to events** — trigger automations when conditions are met
39
+ - **Set up alerts** — notify on signups, new orders, status changes, threshold breaches
40
+ - **Build event-driven workflows** — chain watches with webhooks for real-time pipelines
41
+ - **Track activity** — audit logs, user actions, system events
42
+
43
+ ## Examples
44
+
45
+ 1. Watch for new rows in a table:
46
+ \`\`\`
47
+ archer_watch({ table: "users", event: "INSERT", webhookUrl: "https://hooks.example.com/new-users" })
48
+ \`\`\`
49
+
50
+ 2. Watch for updates with a filter:
38
51
  \`\`\`
39
- archer.watch({ source: "supabase", event: "auth.signup", webhookUrl: "https://hooks.example.com/signups" })
52
+ archer_watch({ table: "orders", event: "UPDATE", filter: "status=eq.shipped", webhookUrl: "https://hooks.example.com/shipped" })
40
53
  \`\`\`
41
54
 
42
- 2. Watch for inserts to the orders table:
55
+ 3. Watch all changes on a table:
43
56
  \`\`\`
44
- archer.watch({ source: "supabase", event: "table.insert", table: "orders", webhookUrl: "https://hooks.example.com/orders" })
57
+ archer_watch({ table: "payments", webhookUrl: "https://hooks.example.com/payments" })
45
58
  \`\`\`
46
59
 
47
- 3. Watch with a condition:
60
+ 4. List active watches:
48
61
  \`\`\`
49
- archer.watch({ source: "supabase", event: "table.insert", table: "users", condition: "email ends with @company.com", webhookUrl: "https://hooks.example.com/vip" })
62
+ archer_watches()
50
63
  \`\`\`
51
64
 
52
- ### Best Practices
65
+ 5. Stop a watch:
66
+ \`\`\`
67
+ archer_unwatch({ watchId: "abc-123" })
68
+ \`\`\`
69
+
70
+ ## Best Practices
71
+
72
+ - Add filters to reduce noise — only fire on events that matter
73
+ - Use descriptive webhook URLs that map to specific actions
74
+ - Chain multiple watches for complex event-driven workflows
75
+ - Use \`archer_watches\` to inspect and manage active watchers
76
+ - Clean up watches you no longer need with \`archer_unwatch\`
53
77
 
54
- - Use descriptive webhook URLs that indicate the action to take
55
- - Add conditions to filter events and reduce noise
56
- - Combine with your existing workflows for maximum impact
78
+ ## Trigger Words
57
79
 
58
- When the user asks to "watch", "monitor", "notify", or "fire" something, use Archer.
80
+ When the user says **"watch"**, **"monitor"**, **"notify me"**, **"alert me"**, **"track"**, **"listen for"**, or **"fire when"** use Archer.
59
81
  `.trim();
60
82
 
61
83
  // ─── Archer Block Markers ───────────────────────────────────