archer-wizard 0.2.2 → 0.2.3

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 (2) hide show
  1. package/README.md +96 -141
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -11,120 +11,99 @@
11
11
 
12
12
  **event intelligence layer for AI agents**
13
13
 
14
+ [![npm version](https://img.shields.io/npm/v/archer-wizard.svg)](https://www.npmjs.com/package/archer-wizard)
15
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
16
+
14
17
  </div>
15
18
 
16
19
  ---
17
20
 
18
- ## what is Archer
19
-
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.
21
-
22
- Archer is that layer.
23
-
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.
21
+ Every AI agent today is reactive. It sits idle until you talk to it. Archer gives your agent a nervous system — it watches your database 24/7, and fires the moment something changes.
25
22
 
26
23
  ---
27
24
 
28
- ## install
25
+ ## quickstart
29
26
 
30
27
  ```bash
31
28
  npx archer-wizard@latest
32
29
  ```
33
30
 
34
- Run this inside any project folder. Archer handles everything else automatically.
31
+ Run this inside any project folder. Archer scans for credentials, detects your agents, and injects itself — one command, no manual config.
35
32
 
36
33
  ---
37
34
 
38
- ## how it works
35
+ ## installation
39
36
 
40
- ```
41
- your data source ──→ Archer watches 24/7 ──→ event detected ──→ agent fires
42
- ```
43
-
44
- 1. **scans** your project for data source credentials automatically
45
- 2. **detects** which AI agents you have installed on your machine
46
- 3. **injects** itself into all their configs — one confirmation, no manual JSON
47
- 4. **teaches** every agent when to call `archer_watch` automatically via rules
48
- 5. your agent now has a nervous system — it feels the world and acts on its own
49
-
50
- ---
51
-
52
- ## quickstart
37
+ ### one-liner (recommended)
53
38
 
54
39
  ```bash
55
- # 1. run inside your project
56
40
  npx archer-wizard@latest
41
+ ```
57
42
 
58
- # 2. Archer scans your .env, finds your credentials, injects into your agents
59
-
60
- # 3. open your AI agent and say:
61
- "watch my users table for new inserts and fire https://your-webhook-url"
43
+ Archer will:
44
+ 1. Scan your `.env` files for Supabase credentials
45
+ 2. Detect which AI agents are installed on your machine
46
+ 3. Inject itself into all their MCP configs automatically
47
+ 4. Teach every agent when to call `archer_watch` via rules
62
48
 
63
- # 4. insert a row in your database
49
+ ### with explicit credentials
64
50
 
65
- # 5. your webhook fires with full event context
51
+ ```bash
52
+ SUPABASE_URL=https://xyz.supabase.co \
53
+ SUPABASE_SERVICE_ROLE_KEY=your-key \
54
+ npx archer-wizard@latest
66
55
  ```
67
56
 
68
57
  ---
69
58
 
70
59
  ## MCP tools
71
60
 
72
- Once Archer is set up, your AI agent has access to these tools natively. You never call them directlyyour agent calls them when you describe what you want.
61
+ Once set up, your agent has these tools available natively. You describe what you want in plain English the agent calls them.
73
62
 
74
- ### `archer_watch`
63
+ ```bash
64
+ # Tell your agent:
65
+ "watch the users table and fire https://your-webhook.com on new inserts"
66
+ "monitor orders where status equals shipped"
67
+ "show all active watches"
68
+ "stop watching the payments table"
69
+ ```
75
70
 
76
- Create a persistent real-time watch on a table. Watches survive agent session restarts.
71
+ ### `archer_watch`
77
72
 
78
73
  ```typescript
79
74
  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
75
+ table: string, // table to watch (required)
76
+ event?: string, // INSERT | UPDATE | DELETE | * (default: *)
77
+ filter?: string, // e.g. "status=eq.active", "amount=gt.1000"
78
+ webhookUrl: string // URL to POST when the event fires
84
79
  })
85
80
  ```
86
81
 
87
82
  ### `archer_unwatch`
88
83
 
89
- Remove an active watch by its ID.
90
-
91
84
  ```typescript
92
85
  archer_unwatch({
93
- watchId: string // the watch ID returned by archer_watch
86
+ watchId: string // ID returned by archer_watch
94
87
  })
95
88
  ```
96
89
 
97
90
  ### `archer_watches`
98
91
 
99
- List all active watches — their IDs, tables, events, filters, and webhook URLs.
100
-
101
92
  ```typescript
102
- archer_watches()
93
+ archer_watches() // list all active watches with status
103
94
  ```
104
95
 
105
96
  ---
106
97
 
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
- ```
116
-
117
- ```
118
- "alert me at https://your-webhook.com every time a row is deleted from sessions"
119
- ```
120
-
121
- ```
122
- "show me all active watches"
123
- ```
98
+ ## supported agents
124
99
 
125
- ```
126
- "stop watching the payments table"
127
- ```
100
+ | agent | config location |
101
+ |---|---|
102
+ | Cursor | `~/.cursor/mcp.json` |
103
+ | Claude Code | `~/Library/Application Support/Claude/claude_desktop_config.json` |
104
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` |
105
+ | OpenCode | `~/.config/opencode/opencode.json` |
106
+ | Antigravity | `~/.config/antigravity/config.json` |
128
107
 
129
108
  ---
130
109
 
@@ -133,67 +112,51 @@ archer_watches()
133
112
  | event | description |
134
113
  |---|---|
135
114
  | `INSERT` | new row inserted into a table |
136
- | `UPDATE` | existing row updated |
137
- | `DELETE` | row deleted |
138
- | `*` | all changes (default) |
115
+ | `UPDATE` | existing row modified |
116
+ | `DELETE` | row removed |
117
+ | `*` | all of the above (default) |
118
+ | `filter` | narrow by any Supabase filter expression |
139
119
 
140
120
  ---
141
121
 
142
122
  ## webhook payload
143
123
 
144
- Every time Archer fires, your webhook receives this:
124
+ Every event POSTs this to your webhook URL:
145
125
 
146
126
  ```json
147
127
  {
148
128
  "archer": {
149
- "watchId": "uuid",
129
+ "watchId": "550e8400-e29b-41d4-a716-446655440000",
150
130
  "event": "INSERT",
151
131
  "table": "users",
152
- "firedAt": "ISO timestamp"
132
+ "firedAt": "2025-03-16T09:15:00.000Z"
153
133
  },
154
134
  "data": {
155
135
  "id": "row-id",
156
136
  "email": "user@example.com",
157
- "created_at": "timestamp"
137
+ "created_at": "2025-03-16T09:15:00.000Z"
158
138
  }
159
139
  }
160
140
  ```
161
141
 
162
- ---
163
-
164
- ## supported agents
165
-
166
- Archer auto-detects and injects into all of these:
142
+ Headers included on every request:
167
143
 
168
- | agent | status |
144
+ | header | value |
169
145
  |---|---|
170
- | Cursor | supported |
171
- | Claude Code | supported |
172
- | opencode | supported |
173
- | Windsurf | ✓ supported |
174
- | Antigravity | ✓ supported |
146
+ | `Content-Type` | `application/json` |
147
+ | `User-Agent` | `Archer/0.2.2` |
148
+ | `X-Archer-Event` | event type (INSERT / UPDATE / DELETE) |
175
149
 
176
- ---
177
-
178
- ## supported data sources
179
-
180
- | source | status |
181
- |---|---|
182
- | Supabase | ✓ available now |
183
- | PostgreSQL | coming soon |
184
- | MySQL | coming soon |
185
- | GitHub | coming soon |
186
- | Stripe | coming soon |
187
- | custom webhooks | coming soon |
150
+ Archer retries failed deliveries 3 times with a 2s delay.
188
151
 
189
152
  ---
190
153
 
191
- ## credentials
154
+ ## credential discovery
192
155
 
193
- Archer scans these files automatically in priority order:
156
+ Archer scans these files automatically, in priority order:
194
157
 
195
158
  ```
196
- .env.local
159
+ .env.local ← checked first
197
160
  .env
198
161
  .env.development
199
162
  .env.production
@@ -201,73 +164,65 @@ Archer scans these files automatically in priority order:
201
164
 
202
165
  It recognizes common aliases automatically:
203
166
 
204
- ```bash
205
- # standard
206
- SUPABASE_URL=https://yourproject.supabase.co
207
- SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
167
+ | credential | aliases checked |
168
+ |---|---|
169
+ | Supabase URL | `SUPABASE_URL`, `NEXT_PUBLIC_SUPABASE_URL`, `VITE_SUPABASE_URL` |
170
+ | Service key | `SUPABASE_SERVICE_ROLE_KEY`, `SUPABASE_SERVICE_KEY` |
171
+ | Anon key | `SUPABASE_ANON_KEY`, `NEXT_PUBLIC_SUPABASE_ANON_KEY`, `VITE_SUPABASE_ANON_KEY` |
172
+
173
+ If no env file is found, Archer scans your codebase for hardcoded values as a fallback.
208
174
 
209
- # Next.js
210
- NEXT_PUBLIC_SUPABASE_URL=...
175
+ ---
211
176
 
212
- # Vite
213
- VITE_SUPABASE_URL=...
177
+ ## how it works
178
+
179
+ ```
180
+ your agent calls archer_watch
181
+
182
+ Archer daemon starts (detached, persists across sessions)
183
+
184
+ subscribes to Supabase Realtime channel
185
+
186
+ database change detected
187
+
188
+ POST to your webhook URL (3 retries)
214
189
  ```
215
190
 
216
- You never paste credentials manually. Archer finds them.
191
+ **The daemon runs at `127.0.0.1:44380` and survives MCP server restarts.** Watches are persisted to `~/.archer/state.json` — they resume automatically after machine restarts.
217
192
 
218
193
  ---
219
194
 
220
195
  ## requirements
221
196
 
222
197
  - Node.js 18 or higher
223
- - at least one supported AI agent installed
224
- - a `.env` file with your data source credentials
225
- - realtime enabled on tables you want to watch
198
+ - At least one supported AI agent installed
199
+ - A Supabase project with [Realtime enabled](https://supabase.com/docs/guides/realtime) on the tables you want to watch
226
200
 
227
201
  ---
228
202
 
229
- ## architecture
230
-
231
- ```
232
- developer's machine data source
233
- ─────────────────── ───────────
234
- npx archer-wizard@latest realtime channel
235
- ↓ ↓
236
- wizard scans .env Archer subscribes to changes 24/7
237
- ↓ ↓
238
- injects into agents event detected → webhook fires
239
- ↓ ↓
240
- agent calls archer_watch your agent wakes up with full context
241
- ```
242
-
243
- No AI at runtime. Once a watch is defined it is pure logic — fast, cheap, reliable.
203
+ ## supported data sources
244
204
 
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).
205
+ | source | status |
206
+ |---|---|
207
+ | Supabase | ✓ available |
208
+ | PostgreSQL (direct) | coming soon |
209
+ | MySQL | coming soon |
210
+ | GitHub events | coming soon |
211
+ | Stripe webhooks | coming soon |
246
212
 
247
213
  ---
248
214
 
249
- ## what v1 does not include
250
-
251
- - no dashboard
252
- - no account required
253
- - no sign in
254
- - no API key
255
- - no cloud service
215
+ ## architecture
256
216
 
257
- Everything runs locally on your machine using your own credentials. The architecture is universal from day one the simplicity is intentional.
217
+ See [ARCHITECTURE.md](./ARCHITECTURE.md) for a full deep dive daemon IPC protocol, state persistence, MCP tool implementation, and the setup wizard pipeline.
258
218
 
259
219
  ---
260
220
 
261
- ```bash
262
- # install from npm
263
- npx archer-wizard@latest
221
+ ## no account. no cloud. no dashboard.
264
222
 
265
- # or from source
266
- git clone https://github.com/amirlan-labs/archer-mcp
267
- cd archer-mcp
268
- npm install
269
- npm run dev
270
- ```
223
+ Archer runs entirely on your machine using your own credentials. No sign-in, no API keys, no data leaves your infrastructure.
224
+
225
+ ---
271
226
 
272
227
  <div align="center">
273
228
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archer-wizard",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "event intelligence layer for AI agents",
5
5
  "type": "module",
6
6
  "bin": {