@karmaniverous/jeeves-watcher-openclaw 0.3.1 → 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 CHANGED
@@ -28,7 +28,7 @@ function getWorkspacePath(api) {
28
28
  }
29
29
  /** Resolve the watcher API base URL from plugin config. */
30
30
  function getApiUrl(api) {
31
- const url = api.config?.plugins?.entries?.['jeeves-watcher']?.config?.apiUrl;
31
+ const url = api.config?.plugins?.entries?.['jeeves-watcher-openclaw']?.config?.apiUrl;
32
32
  return typeof url === 'string' ? url : DEFAULT_API_URL;
33
33
  }
34
34
  /** Format a successful tool result. */
@@ -60,7 +60,7 @@ function connectionFail(error, baseUrl) {
60
60
  text: [
61
61
  `Watcher service not reachable at ${baseUrl}.`,
62
62
  'Either start the watcher service, or if it runs on a different port,',
63
- 'set plugins.entries.jeeves-watcher.config.apiUrl in openclaw.json.',
63
+ 'set plugins.entries.jeeves-watcher-openclaw.config.apiUrl in openclaw.json.',
64
64
  ].join('\n'),
65
65
  },
66
66
  ],
@@ -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
- if (state.initialized)
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
- // Check watcher is reachable
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',
@@ -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.1",
5
+ "version": "0.3.3",
6
6
  "kind": "memory",
7
7
  "skills": [
8
8
  "dist/skills/jeeves-watcher"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karmaniverous/jeeves-watcher-openclaw",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
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",