@karmaniverous/jeeves-watcher-openclaw 0.5.3 → 0.5.4
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/dist/index.js +11 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -195,7 +195,10 @@ function ensurePlatformToolsSection(toolsMd) {
|
|
|
195
195
|
function upsertWatcherSection(toolsMd, watcherMenu) {
|
|
196
196
|
const section = `## Watcher\n\n${watcherMenu}\n`;
|
|
197
197
|
// If we already injected a Watcher section, replace it.
|
|
198
|
-
|
|
198
|
+
// The `m` flag is needed so `^` matches line starts, but it also makes
|
|
199
|
+
// `$` match end-of-line instead of end-of-string. Use a negative
|
|
200
|
+
// lookahead `$(?![\s\S])` to anchor at true end-of-string.
|
|
201
|
+
const re = /^## Watcher\n[\s\S]*?(?=\n## |\n# |$(?![\s\S]))/m;
|
|
199
202
|
if (re.test(toolsMd)) {
|
|
200
203
|
return toolsMd.replace(re, section);
|
|
201
204
|
}
|
|
@@ -226,6 +229,13 @@ async function handleAgentBootstrap(event, api) {
|
|
|
226
229
|
context.bootstrapFiles.push(toolsFile);
|
|
227
230
|
}
|
|
228
231
|
const current = toolsFile.content ?? '';
|
|
232
|
+
// Guard: the bootstrap hook fires on every message turn because OpenClaw
|
|
233
|
+
// caches bootstrapFiles per session and returns the same mutable objects.
|
|
234
|
+
// If we already injected the watcher menu into this content, skip to
|
|
235
|
+
// avoid accumulating duplicate sections.
|
|
236
|
+
if (current.includes('## Watcher') && current.includes(watcherMenu)) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
229
239
|
const withH1 = ensurePlatformToolsSection(current);
|
|
230
240
|
const updated = upsertWatcherSection(withH1, watcherMenu);
|
|
231
241
|
toolsFile.content = updated;
|
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.4",
|
|
6
6
|
"skills": [
|
|
7
7
|
"dist/skills/jeeves-watcher"
|
|
8
8
|
],
|
package/package.json
CHANGED