@karmaniverous/jeeves-watcher-openclaw 0.3.2 → 0.3.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.
- package/dist/index.js +7 -3
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -168,15 +168,19 @@ function createMemoryTools(api, baseUrl) {
|
|
|
168
168
|
const workspace = getWorkspacePath(api);
|
|
169
169
|
const state = {
|
|
170
170
|
initialized: false,
|
|
171
|
+
lastWatcherUptime: 0,
|
|
171
172
|
workspace,
|
|
172
173
|
baseUrl,
|
|
173
174
|
};
|
|
174
175
|
/** Lazy init: register virtual rules with watcher. */
|
|
175
176
|
async function ensureInit() {
|
|
176
|
-
|
|
177
|
+
// Check watcher is reachable and detect restarts
|
|
178
|
+
const status = (await fetchJson(`${state.baseUrl}/status`));
|
|
179
|
+
const uptime = status.uptime ?? 0;
|
|
180
|
+
// If watcher restarted (uptime decreased), re-register virtual rules
|
|
181
|
+
if (state.initialized && uptime >= state.lastWatcherUptime)
|
|
177
182
|
return;
|
|
178
|
-
|
|
179
|
-
await fetchJson(`${state.baseUrl}/status`);
|
|
183
|
+
state.lastWatcherUptime = uptime;
|
|
180
184
|
// Clear any stale rules
|
|
181
185
|
await fetchJson(`${state.baseUrl}/rules/unregister`, {
|
|
182
186
|
method: 'DELETE',
|
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.3.
|
|
5
|
+
"version": "0.3.3",
|
|
6
6
|
"kind": "memory",
|
|
7
7
|
"skills": [
|
|
8
8
|
"dist/skills/jeeves-watcher"
|
package/package.json
CHANGED