@karmaniverous/jeeves-watcher-openclaw 0.4.0 → 0.4.1

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.
@@ -118,7 +118,7 @@ Memory-core and the watcher both use embeddings, but may use different models by
118
118
 
119
119
  This gives memory-core the same 3072-dimensional Gemini embeddings the watcher uses, ensuring semantic similarity scores are comparable across memory and archive searches.
120
120
 
121
- ## Installation
121
+ ## Plugin Installation
122
122
 
123
123
  ```
124
124
  npx @karmaniverous/jeeves-watcher-openclaw install
@@ -131,24 +131,237 @@ To remove:
131
131
  npx @karmaniverous/jeeves-watcher-openclaw uninstall
132
132
  ```
133
133
 
134
- ## Quick Start
134
+ ## Quick Start (Existing Deployment)
135
+
136
+ If the watcher service is already running and healthy:
135
137
 
136
138
  1. **Orient yourself** (once per session) — use `watcher_query` to learn the deployment's organizational strategy and available record types (see Orientation Pattern below)
137
139
  2. **Search** — use `watcher_search` with a natural language query and optional metadata filters
138
140
  3. **Read source** — use `read` (standard file read) with `file_path` from search results for full document content
139
141
 
140
- ## Bootstrap (First Session)
142
+ ## Bootstrap (First-Time Setup)
143
+
144
+ When the plugin loads and the watcher service is NOT yet set up, drive the entire setup proactively. The user should be able to install the plugin with nothing else in place and the bootstrap process gets them to a working system.
145
+
146
+ **The agent drives this process.** Don't hand the user CLI commands and wait. Check each prerequisite, explain what's needed, execute what you can, and prompt the user only for decisions that require human judgment.
147
+
148
+ ### Step 1: Check Node.js
149
+
150
+ Verify Node.js is installed and version ≥ 20:
151
+ ```bash
152
+ node --version
153
+ ```
154
+
155
+ If missing or too old, guide the user to install Node.js 20+ from https://nodejs.org or via their package manager.
156
+
157
+ ### Step 2: Install Qdrant
158
+
159
+ Check if Qdrant is already running:
160
+ ```bash
161
+ curl -s http://localhost:6333/healthz
162
+ ```
163
+
164
+ If not running, install it. **Prefer native installation** (especially on cloud instances where Docker may not be available):
165
+
166
+ **Linux (recommended for servers):**
167
+ ```bash
168
+ # Download latest release
169
+ curl -L https://github.com/qdrant/qdrant/releases/latest/download/qdrant-x86_64-unknown-linux-musl.tar.gz -o qdrant.tar.gz
170
+ tar xzf qdrant.tar.gz
171
+
172
+ # Run (foreground for testing)
173
+ ./qdrant
174
+
175
+ # For production: create a systemd service
176
+ sudo tee /etc/systemd/system/qdrant.service > /dev/null <<EOF
177
+ [Unit]
178
+ Description=Qdrant Vector Database
179
+ After=network.target
180
+
181
+ [Service]
182
+ Type=simple
183
+ ExecStart=/usr/local/bin/qdrant --config-path /etc/qdrant/config.yaml
184
+ Restart=always
185
+ User=qdrant
186
+
187
+ [Install]
188
+ WantedBy=multi-user.target
189
+ EOF
190
+ sudo systemctl enable --now qdrant
191
+ ```
192
+
193
+ **Windows:**
194
+ ```powershell
195
+ # Download from GitHub releases page
196
+ # https://github.com/qdrant/qdrant/releases
197
+ # Extract and run, or register as NSSM service:
198
+ nssm install Qdrant <path-to-qdrant.exe>
199
+ nssm start Qdrant
200
+ ```
201
+
202
+ **Docker (fallback, if available):**
203
+ ```bash
204
+ docker run -d -p 6333:6333 -v qdrant_data:/qdrant/storage qdrant/qdrant
205
+ ```
206
+
207
+ After installation, verify:
208
+ ```bash
209
+ curl -s http://localhost:6333/healthz
210
+ ```
211
+
212
+ ### Step 3: Install Watcher Service
213
+
214
+ Install the watcher CLI globally:
215
+ ```bash
216
+ npm install -g @karmaniverous/jeeves-watcher
217
+ ```
218
+
219
+ Verify:
220
+ ```bash
221
+ jeeves-watcher --version
222
+ ```
223
+
224
+ ### Step 4: Set Up Embedding Provider
225
+
226
+ The watcher uses Google Gemini for embeddings by default (`gemini-embedding-001`, 3072 dimensions).
227
+
228
+ Check for an existing API key:
229
+ ```bash
230
+ echo $GOOGLE_API_KEY # Linux/Mac
231
+ echo %GOOGLE_API_KEY% # Windows cmd
232
+ $env:GOOGLE_API_KEY # PowerShell
233
+ ```
234
+
235
+ If not set, guide the user:
236
+ 1. Go to https://aistudio.google.com/apikey
237
+ 2. Create an API key (free tier supports 1,000 embedding requests/minute)
238
+ 3. Set it as a persistent environment variable:
239
+ - **Linux:** Add `export GOOGLE_API_KEY=<key>` to `~/.bashrc` or `~/.profile`
240
+ - **Windows:** `setx GOOGLE_API_KEY "<key>"` (new shell sessions only) or set via System Properties → Environment Variables
241
+ - **macOS:** Add to `~/.zshrc` or use `launchctl setenv`
242
+
243
+ Verify the key works by testing a Gemini API call:
244
+ ```bash
245
+ curl -s "https://generativelanguage.googleapis.com/v1beta/models/gemini-embedding-001:embedContent?key=$GOOGLE_API_KEY" \
246
+ -H "Content-Type: application/json" \
247
+ -d '{"model":"models/gemini-embedding-001","content":{"parts":[{"text":"test"}]}}'
248
+ ```
249
+
250
+ A successful response contains an `embedding.values` array.
251
+
252
+ ### Step 5: Author Initial Config
253
+
254
+ Ask the user these questions:
255
+ - **What directories should the watcher index?** (e.g., `~/documents`, `~/projects`, a workspace path)
256
+ - **What types of files matter?** (helps determine file extensions for watch globs)
257
+ - **Are there directories to exclude?** (node_modules, .git, build outputs, etc.)
258
+
259
+ Then generate a starter config file. Example minimal config:
260
+
261
+ ```json
262
+ {
263
+ "description": "Personal knowledge base indexing",
264
+ "api": { "port": 1936 },
265
+ "watch": {
266
+ "paths": [
267
+ "/home/user/documents/**/*.{md,txt,json,pdf,html,docx}"
268
+ ],
269
+ "ignored": ["**/node_modules/**", "**/.git/**", "**/dist/**"]
270
+ },
271
+ "embedding": {
272
+ "provider": "gemini",
273
+ "model": "gemini-embedding-001",
274
+ "dimensions": 3072,
275
+ "apiKey": "${GOOGLE_API_KEY}",
276
+ "chunkSize": 1000,
277
+ "chunkOverlap": 200,
278
+ "rateLimitPerMinute": 1000,
279
+ "concurrency": 5
280
+ },
281
+ "vectorStore": {
282
+ "url": "http://localhost:6333",
283
+ "collection": "jeeves_archive"
284
+ },
285
+ "search": {
286
+ "scoreThresholds": { "strong": 0.75, "relevant": 0.5, "noise": 0.25 },
287
+ "hybrid": { "enabled": true }
288
+ },
289
+ "logging": { "level": "info" },
290
+ "inferenceRules": []
291
+ }
292
+ ```
293
+
294
+ Write the config to a sensible location (e.g., `~/.config/jeeves-watcher.config.json` on Linux, or alongside the user's workspace). Validate with:
295
+ ```bash
296
+ jeeves-watcher validate -c <config-path>
297
+ ```
298
+
299
+ ### Step 6: Register and Start as a Service
300
+
301
+ **The watcher should run as a persistent service, not a foreground process.**
302
+
303
+ **Linux (systemd):**
304
+ ```bash
305
+ sudo tee /etc/systemd/system/jeeves-watcher.service > /dev/null <<EOF
306
+ [Unit]
307
+ Description=Jeeves Watcher - Filesystem Indexing Service
308
+ After=network.target qdrant.service
309
+
310
+ [Service]
311
+ Type=simple
312
+ ExecStart=$(which jeeves-watcher) start -c <config-path>
313
+ Restart=always
314
+ Environment=GOOGLE_API_KEY=<key>
315
+ User=$USER
316
+
317
+ [Install]
318
+ WantedBy=multi-user.target
319
+ EOF
320
+ sudo systemctl enable --now jeeves-watcher
321
+ ```
322
+
323
+ **Windows (NSSM):**
324
+ ```powershell
325
+ jeeves-watcher service install
326
+ # Or manually:
327
+ nssm install jeeves-watcher "$(which jeeves-watcher)" start -c <config-path>
328
+ nssm set jeeves-watcher AppEnvironmentExtra GOOGLE_API_KEY=<key>
329
+ nssm start jeeves-watcher
330
+ ```
331
+
332
+ Verify the service started:
333
+ ```bash
334
+ curl -s http://127.0.0.1:1936/status
335
+ ```
336
+
337
+ ### Step 7: Verify Health
338
+
339
+ Call `watcher_status` (or `curl http://127.0.0.1:1936/status`). Confirm:
340
+ - Service is running
341
+ - Qdrant collection exists with expected dimensions (3072)
342
+ - Point count is increasing (initial indexing in progress)
343
+
344
+ If the point count is 0 after a minute, check `watcher_issues` for embedding failures.
345
+
346
+ ### Step 8: Orientation
347
+
348
+ Once health is confirmed and initial indexing has started:
349
+
350
+ 1. Query `$.['description','search']` for the deployment's organizational strategy and score thresholds.
351
+ 2. Query `$.inferenceRules[*].['name','description']` for available record types.
352
+ 3. Report to the user: how many points indexed so far, which domains are available, estimated time to complete initial indexing (based on file count and embedding rate).
353
+
354
+ ### Step 9: Align Memory-Core Embeddings
141
355
 
142
- The first time the watcher plugin loads in a new deployment, orient yourself proactively. Don't wait for the user to ask a question understand what you have access to.
356
+ After the watcher is healthy, offer to align OpenClaw's memory-core with the same embedding model for consistent vector quality across both systems. See the **Embedding Alignment** section above for the procedure.
143
357
 
144
- **Automatic bootstrap sequence:**
358
+ ### On Subsequent Sessions
145
359
 
146
- 1. **Health check** call `watcher_status`. Confirm the service is running, note point count and collection dimensions.
147
- 2. **Discover the deployment** — run the Orientation Pattern (see below): query `$.['description','search']` for organizational strategy and score thresholds, then `$.inferenceRules[*].['name','description']` for available record types.
148
- 3. **Cache context** — store the orientation results mentally for the session. You now know what domains exist, what record types are searchable, and how to interpret scores.
149
- 4. **Report readiness** — briefly tell the user what you found: how many points, which domains, any issues. One or two sentences, not a wall of text.
360
+ On sessions after bootstrap is complete:
150
361
 
151
- **On subsequent sessions:** Repeat steps 1-3 silently. Only report if something changed (service down, point count dropped significantly, new domains appeared).
362
+ 1. Call `watcher_status` silently.
363
+ 2. Run the orientation queries silently.
364
+ 3. Only report if something changed (service down, point count dropped significantly, new domains appeared).
152
365
 
153
366
  **Key principle:** The agent drives discovery. The user shouldn't have to explain their archive to you — the archive explains itself through its config.
154
367
 
@@ -2,7 +2,7 @@
2
2
  "id": "jeeves-watcher-openclaw",
3
3
  "name": "Jeeves Watcher",
4
4
  "description": "Semantic search, metadata enrichment, and instance administration for a jeeves-watcher deployment.",
5
- "version": "0.4.0",
5
+ "version": "0.4.1",
6
6
  "skills": [
7
7
  "dist/skills/jeeves-watcher"
8
8
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karmaniverous/jeeves-watcher-openclaw",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "author": "Jason Williscroft",
5
5
  "description": "OpenClaw plugin for jeeves-watcher — semantic search and metadata enrichment tools",
6
6
  "license": "BSD-3-Clause",