@memoryrelay/plugin-memoryrelay-ai 0.16.1 → 0.16.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/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * OpenClaw Memory Plugin - MemoryRelay
3
- * Version: 0.16.1
3
+ * Version: 0.16.3
4
4
  *
5
5
  * Long-term memory with vector search using MemoryRelay API.
6
6
  * Provides auto-recall and auto-capture via lifecycle hooks.
@@ -14,6 +14,8 @@
14
14
  * Docs: https://memoryrelay.ai
15
15
  */
16
16
 
17
+ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
18
+ import { join } from "node:path";
17
19
  import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
18
20
 
19
21
  // --- Core services ---
@@ -350,6 +352,25 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
350
352
  api.logger.error(`memory-memoryrelay: health check failed: ${String(err)}`);
351
353
  }
352
354
 
355
+ // --- Create stub store file so OpenClaw's existsSync checks pass ---
356
+ // OpenClaw 2026.3.28 scanner proceeds for all memory plugins but then checks
357
+ // existsSync(store.path) for a local SQLite file. Create a minimal empty file
358
+ // at the expected path so the scanner doesn't bail with "unavailable".
359
+ try {
360
+ const openclawHome = process.env.OPENCLAW_HOME || join(process.env.HOME || "/tmp", ".openclaw");
361
+ const storeDir = join(openclawHome, "memory");
362
+ // OpenClaw resolves store path as: ~/.openclaw/memory/{agentId}.sqlite
363
+ const resolvedAgentId = agentId || "main";
364
+ const storePath = join(storeDir, `${resolvedAgentId}.sqlite`);
365
+ if (!existsSync(storePath)) {
366
+ mkdirSync(storeDir, { recursive: true });
367
+ writeFileSync(storePath, Buffer.alloc(0));
368
+ api.logger.info?.(`memory-memoryrelay: created stub store file at ${storePath}`);
369
+ }
370
+ } catch (err) {
371
+ api.logger.warn?.(`memory-memoryrelay: failed to create stub store file: ${String(err)}`);
372
+ }
373
+
353
374
  // --- Tool enablement filter ---
354
375
  const enabledToolNames: Set<string> | null = (() => {
355
376
  if (!cfg?.enabledTools) return null;
@@ -404,7 +425,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
404
425
  // ========================================================================
405
426
 
406
427
  api.logger.info?.(
407
- `memory-memoryrelay: plugin v0.16.1 loaded (${Object.values(TOOL_GROUPS).flat().length} tools, autoRecall: ${pluginConfig.autoRecall}, autoCapture: ${autoCaptureConfig.enabled ? autoCaptureConfig.tier : "off"}, debug: ${debugEnabled})`,
428
+ `memory-memoryrelay: plugin v0.16.3 loaded (${Object.values(TOOL_GROUPS).flat().length} tools, autoRecall: ${pluginConfig.autoRecall}, autoCapture: ${autoCaptureConfig.enabled ? autoCaptureConfig.tier : "off"}, debug: ${debugEnabled})`,
408
429
  );
409
430
 
410
431
  // ========================================================================
@@ -442,28 +463,48 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
442
463
  // Gateway Methods (memory.probe, memory.status, memoryrelay.*)
443
464
  // ========================================================================
444
465
 
445
- // memory.probe — lightweight probe so `openclaw status` shows "available"
446
- // instead of "unavailable". OpenClaw checks this to determine if the memory
447
- // slot has a functioning provider.
466
+ // memory.probe — returns MemoryProviderStatus-compatible data so
467
+ // `openclaw status` shows memory count, vector info, and provider details
468
+ // instead of "unavailable". OpenClaw 2026.3.28+ calls this for all memory plugins.
448
469
  api.registerGatewayMethod?.("memory.probe", async ({ respond }) => {
449
470
  try {
450
- const health = await client.health();
471
+ const health = await client.health() as { status: string; embedding_info?: { dimension?: number } };
451
472
  const healthStatus = String(health.status).toLowerCase();
452
473
  const isConnected = VALID_HEALTH_STATUSES.includes(healthStatus);
453
474
 
475
+ let memoryCount = 0;
476
+ try {
477
+ const stats = await client.stats();
478
+ memoryCount = stats.total_memories;
479
+ } catch (_) {
480
+ // stats endpoint may be unavailable
481
+ }
482
+
483
+ const dims = health.embedding_info?.dimension ?? 768;
484
+
454
485
  respond(true, {
455
486
  available: isConnected,
456
487
  provider: "memoryrelay",
457
- endpoint: apiUrl,
458
- vector: { available: true, enabled: true },
488
+ backend: "builtin",
489
+ files: memoryCount,
490
+ chunks: memoryCount,
491
+ dirty: false,
492
+ vector: { enabled: true, available: true, dims },
493
+ fts: { enabled: false, available: false },
494
+ custom: { endpoint: apiUrl, agentId, tier: "remote" },
459
495
  });
460
496
  } catch (_err) {
461
497
  respond(true, {
462
498
  available: false,
463
499
  provider: "memoryrelay",
464
- endpoint: apiUrl,
500
+ backend: "builtin",
501
+ files: 0,
502
+ chunks: 0,
503
+ dirty: false,
504
+ vector: { enabled: true, available: false, dims: 768 },
505
+ fts: { enabled: false, available: false },
465
506
  error: String(_err),
466
- vector: { available: false, enabled: true },
507
+ custom: { endpoint: apiUrl, agentId, tier: "remote" },
467
508
  });
468
509
  }
469
510
  });
@@ -1273,7 +1314,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1273
1314
  description: "Show how to update the MemoryRelay plugin to the latest version",
1274
1315
  requireAuth: true,
1275
1316
  handler: async (_ctx) => {
1276
- const currentVersion = "0.16.0";
1317
+ const currentVersion = "0.16.3";
1277
1318
  return {
1278
1319
  text: [
1279
1320
  "MemoryRelay Plugin Update",
@@ -2,8 +2,8 @@
2
2
  "id": "plugin-memoryrelay-ai",
3
3
  "kind": "memory",
4
4
  "name": "MemoryRelay AI",
5
- "description": "MemoryRelay v0.16.1 - Long-term memory with pipeline architecture, 42 tools, 17 commands, V2 async, sessions, decisions, patterns & projects (api.memoryrelay.net)",
6
- "version": "0.16.1",
5
+ "description": "MemoryRelay v0.16.3 - Long-term memory with pipeline architecture, 42 tools, 17 commands, V2 async, sessions, decisions, patterns & projects (api.memoryrelay.net)",
6
+ "version": "0.16.3",
7
7
  "uiHints": {
8
8
  "apiKey": {
9
9
  "label": "MemoryRelay API Key",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memoryrelay/plugin-memoryrelay-ai",
3
- "version": "0.16.1",
3
+ "version": "0.16.3",
4
4
  "description": "OpenClaw memory plugin for MemoryRelay API - 42 tools, 17 commands, V2 async, sessions, decisions, patterns, projects & semantic search",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -153,7 +153,7 @@ export class MemoryRelayClient implements IMemoryRelayClient {
153
153
  headers: {
154
154
  "Content-Type": "application/json",
155
155
  Authorization: `Bearer ${this.apiKey}`,
156
- "User-Agent": "openclaw-memory-memoryrelay/0.16.1",
156
+ "User-Agent": "openclaw-memory-memoryrelay/0.16.3",
157
157
  },
158
158
  body: body ? JSON.stringify(body) : undefined,
159
159
  },