@karmaniverous/jeeves-watcher-openclaw 0.3.2 → 0.3.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 +8 -8
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,11 +11,7 @@ const DEFAULT_API_URL = 'http://127.0.0.1:3458';
|
|
|
11
11
|
const PLUGIN_SOURCE = 'jeeves-watcher-openclaw';
|
|
12
12
|
/** Normalize a path to forward slashes and lowercase drive letter on Windows. */
|
|
13
13
|
function normalizePath(p) {
|
|
14
|
-
|
|
15
|
-
if (/^[A-Z]:/.test(result)) {
|
|
16
|
-
result = result[0].toLowerCase() + result.slice(1);
|
|
17
|
-
}
|
|
18
|
-
return result;
|
|
14
|
+
return p.replace(/\\/g, '/');
|
|
19
15
|
}
|
|
20
16
|
/**
|
|
21
17
|
* Resolve the workspace path from gateway config.
|
|
@@ -168,15 +164,19 @@ function createMemoryTools(api, baseUrl) {
|
|
|
168
164
|
const workspace = getWorkspacePath(api);
|
|
169
165
|
const state = {
|
|
170
166
|
initialized: false,
|
|
167
|
+
lastWatcherUptime: 0,
|
|
171
168
|
workspace,
|
|
172
169
|
baseUrl,
|
|
173
170
|
};
|
|
174
171
|
/** Lazy init: register virtual rules with watcher. */
|
|
175
172
|
async function ensureInit() {
|
|
176
|
-
|
|
173
|
+
// Check watcher is reachable and detect restarts
|
|
174
|
+
const status = (await fetchJson(`${state.baseUrl}/status`));
|
|
175
|
+
const uptime = status.uptime ?? 0;
|
|
176
|
+
// If watcher restarted (uptime decreased), re-register virtual rules
|
|
177
|
+
if (state.initialized && uptime >= state.lastWatcherUptime)
|
|
177
178
|
return;
|
|
178
|
-
|
|
179
|
-
await fetchJson(`${state.baseUrl}/status`);
|
|
179
|
+
state.lastWatcherUptime = uptime;
|
|
180
180
|
// Clear any stale rules
|
|
181
181
|
await fetchJson(`${state.baseUrl}/rules/unregister`, {
|
|
182
182
|
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.4",
|
|
6
6
|
"kind": "memory",
|
|
7
7
|
"skills": [
|
|
8
8
|
"dist/skills/jeeves-watcher"
|
package/package.json
CHANGED