@karmaniverous/jeeves-watcher-openclaw 0.5.5 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/dist/cli.js +52 -0
- package/dist/index.js +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,10 +38,14 @@ Set the `apiUrl` in the plugin configuration to point at your jeeves-watcher ser
|
|
|
38
38
|
|
|
39
39
|
```json
|
|
40
40
|
{
|
|
41
|
-
"apiUrl": "http://127.0.0.1:
|
|
41
|
+
"apiUrl": "http://127.0.0.1:1936"
|
|
42
42
|
}
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
## Dynamic TOOLS.md Injection
|
|
46
|
+
|
|
47
|
+
On startup, the plugin writes a `## Watcher` section to `TOOLS.md` in the agent's workspace, providing a live menu of indexed content, score thresholds, and escalation rules. This refreshes every 60 seconds. On uninstall, the CLI removes the section.
|
|
48
|
+
|
|
45
49
|
## Tools
|
|
46
50
|
|
|
47
51
|
| Tool | Description |
|
|
@@ -49,13 +53,11 @@ Set the `apiUrl` in the plugin configuration to point at your jeeves-watcher ser
|
|
|
49
53
|
| `watcher_status` | Service health, uptime, and collection stats |
|
|
50
54
|
| `watcher_search` | Semantic search across indexed documents |
|
|
51
55
|
| `watcher_enrich` | Enrich document metadata via rules engine |
|
|
52
|
-
| `watcher_query` |
|
|
56
|
+
| `watcher_query` | Query the merged virtual document via JSONPath |
|
|
53
57
|
| `watcher_validate` | Validate a watcher configuration |
|
|
54
58
|
| `watcher_config_apply` | Apply a new configuration |
|
|
55
59
|
| `watcher_reindex` | Trigger a full reindex |
|
|
56
60
|
| `watcher_issues` | List indexing issues and errors |
|
|
57
|
-
| `memory_search` | Semantically search memory files (MEMORY.md and memory/*.md) |
|
|
58
|
-
| `memory_get` | Read content from memory files with optional line range |
|
|
59
61
|
|
|
60
62
|
## Documentation
|
|
61
63
|
|
package/dist/cli.js
CHANGED
|
@@ -199,10 +199,62 @@ function uninstall() {
|
|
|
199
199
|
writeJson(configPath, config);
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
+
// Clean up TOOLS.md watcher section
|
|
203
|
+
cleanupToolsMd(home, configPath);
|
|
202
204
|
console.log();
|
|
203
205
|
console.log('✅ Plugin uninstalled successfully.');
|
|
204
206
|
console.log(' Restart the OpenClaw gateway to complete removal.');
|
|
205
207
|
}
|
|
208
|
+
/** Resolve the workspace directory from OpenClaw config. */
|
|
209
|
+
function resolveWorkspaceDir(home, configPath) {
|
|
210
|
+
const config = readJson(configPath);
|
|
211
|
+
if (!config)
|
|
212
|
+
return null;
|
|
213
|
+
// Check agents.defaults.workspace
|
|
214
|
+
const agents = config.agents;
|
|
215
|
+
const defaults = agents?.defaults;
|
|
216
|
+
const workspace = defaults?.workspace;
|
|
217
|
+
if (workspace) {
|
|
218
|
+
return resolve(workspace.replace(/^~/, homedir()));
|
|
219
|
+
}
|
|
220
|
+
// Default workspace location
|
|
221
|
+
return join(home, 'workspace');
|
|
222
|
+
}
|
|
223
|
+
/** Remove the ## Watcher section from TOOLS.md on uninstall. */
|
|
224
|
+
function cleanupToolsMd(home, configPath) {
|
|
225
|
+
const workspaceDir = resolveWorkspaceDir(home, configPath);
|
|
226
|
+
if (!workspaceDir)
|
|
227
|
+
return;
|
|
228
|
+
const toolsPath = join(workspaceDir, 'TOOLS.md');
|
|
229
|
+
if (!existsSync(toolsPath))
|
|
230
|
+
return;
|
|
231
|
+
let content = readFileSync(toolsPath, 'utf8');
|
|
232
|
+
// Remove ## Watcher section (from ## Watcher to next ## or # or EOF)
|
|
233
|
+
const watcherRe = /^## Watcher\n[\s\S]*?(?=\n## |\n# |$(?![\s\S]))/m;
|
|
234
|
+
if (!watcherRe.test(content))
|
|
235
|
+
return;
|
|
236
|
+
content = content.replace(watcherRe, '').replace(/\n{3,}/g, '\n\n');
|
|
237
|
+
// If # Jeeves Platform Tools has no remaining ## sections, remove it too
|
|
238
|
+
const platformH1 = '# Jeeves Platform Tools';
|
|
239
|
+
if (content.includes(platformH1)) {
|
|
240
|
+
const h1Idx = content.indexOf(platformH1);
|
|
241
|
+
const afterH1 = content.slice(h1Idx + platformH1.length);
|
|
242
|
+
// Check if there's a ## before the next # or EOF
|
|
243
|
+
const nextH2Match = afterH1.match(/^## /m);
|
|
244
|
+
const nextH1Match = afterH1.match(/^# /m);
|
|
245
|
+
const h2Pos = nextH2Match ? afterH1.indexOf(nextH2Match[0]) : Infinity;
|
|
246
|
+
const h1Pos = nextH1Match ? afterH1.indexOf(nextH1Match[0]) : Infinity;
|
|
247
|
+
if (h2Pos >= h1Pos) {
|
|
248
|
+
// No child ## sections remain — remove the empty H1
|
|
249
|
+
content =
|
|
250
|
+
content.slice(0, h1Idx) + content.slice(h1Idx + platformH1.length);
|
|
251
|
+
content = content.replace(/^\n{2,}/, '').replace(/\n{3,}/g, '\n\n');
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
content = content.trim() + '\n';
|
|
255
|
+
writeFileSync(toolsPath, content);
|
|
256
|
+
console.log('\u2713 Cleaned up TOOLS.md (removed Watcher section)');
|
|
257
|
+
}
|
|
206
258
|
// Main
|
|
207
259
|
const command = process.argv[2];
|
|
208
260
|
switch (command) {
|
package/dist/index.js
CHANGED
|
@@ -133,6 +133,7 @@ async function generateWatcherMenu(apiUrl) {
|
|
|
133
133
|
const lines = [
|
|
134
134
|
`This environment includes a semantic search index (\`watcher_search\`) covering ${pointCount.toLocaleString()} document chunks.`,
|
|
135
135
|
'**Escalation Rule:** Use `memory_search` for personal operational notes, decisions, and rules. Escalate to `watcher_search` when memory is thin, or when searching the broader archive (tickets, docs, code). ALWAYS use `watcher_search` BEFORE filesystem commands (exec, grep) when looking for information that matches the indexed categories below.',
|
|
136
|
+
'**Search-first rule:** When a task involves finding, reading, or modifying files in indexed paths, run `watcher_search` FIRST — even if you already know the file path. Search surfaces related files you may not have considered and catches stale artifacts. Direct filesystem access is for acting on search results, not bypassing them.',
|
|
136
137
|
'',
|
|
137
138
|
'### Score Interpretation:',
|
|
138
139
|
'* **Strong:** >= 0.75',
|
package/openclaw.plugin.json
CHANGED
|
@@ -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.5.
|
|
5
|
+
"version": "0.5.7",
|
|
6
6
|
"skills": [
|
|
7
7
|
"dist/skills/jeeves-watcher"
|
|
8
8
|
],
|
package/package.json
CHANGED