@memorilabs/openclaw-memori 0.0.16 → 0.0.17

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
@@ -24,11 +24,67 @@ const memoriPlugin = {
24
24
  }
25
25
  logger.info(`\n=== ${PLUGIN_CONFIG.LOG_PREFIX} INITIALIZING PLUGIN ===`);
26
26
  logger.info(`${PLUGIN_CONFIG.LOG_PREFIX} Tracking Entity ID: ${config.entityId}`);
27
+ // This code is temp. will be removed when https://github.com/openclaw/openclaw/issues/71428 is fixed.
28
+ // allowConversationAccess was added to the schema in 2026.4.29.
29
+ // However, during the 5.2/5.3 package refactor, origin detection was bugged (allowing
30
+ // bypasses) and the schema validator temporarily rejected the key, crashing the app.
31
+ // The platform stabilized the plugin loader in 2026.5.7 and re-clarified the rule in 5.9.
32
+ // Therefore, we only enforce the warning on 2026.5.7 and newer.
33
+ const ocVersion = api.runtime.version.replace(/^v/, '');
34
+ const [ocYear = 0, ocMonth = 0, ocDay = 0] = ocVersion
35
+ .split('.')
36
+ .map((s) => parseInt(s, 10) || 0);
37
+ const needsAccessPermission = ocYear > 2026 ||
38
+ (ocYear === 2026 && ocMonth > 5) ||
39
+ (ocYear === 2026 && ocMonth === 5 && ocDay >= 7);
40
+ const hasConversationAccess = !needsAccessPermission ||
41
+ api.config.plugins?.entries?.[PLUGIN_CONFIG.ID]?.hooks?.allowConversationAccess === true;
42
+ // B: log at startup so the operator sees it immediately in gateway logs
43
+ if (!hasConversationAccess) {
44
+ api.logger.warn(`${PLUGIN_CONFIG.LOG_PREFIX} Conversation access is not enabled — agent_end memory capture will not work.\n` +
45
+ ` To fix, run:\n` +
46
+ ` openclaw config set plugins.entries.${PLUGIN_CONFIG.ID}.hooks.allowConversationAccess true\n` +
47
+ ` Then restart the gateway.`);
48
+ }
27
49
  const configContext = `Memori plugin configuration: projectId="${config.projectId}", entityId="${config.entityId}"`;
50
+ const accessWarning = !hasConversationAccess
51
+ ? [
52
+ '⚠️ MEMORI SETUP REQUIRED — respond to this before anything else.',
53
+ 'Tell the user exactly this:',
54
+ '',
55
+ 'It seems Memori needs to be set up properly. Please run the following command and restart the gateway:',
56
+ '',
57
+ '```bash',
58
+ `openclaw config set plugins.entries.${PLUGIN_CONFIG.ID}.hooks.allowConversationAccess true`,
59
+ '```',
60
+ '',
61
+ '**Instructions:**',
62
+ '1. Navigate back to your terminal',
63
+ '2. Run:',
64
+ '```bash',
65
+ `openclaw config set plugins.entries.${PLUGIN_CONFIG.ID}.hooks.allowConversationAccess true`,
66
+ '```',
67
+ '3. Restart OpenClaw. Run:',
68
+ '```bash',
69
+ 'openclaw gateway restart',
70
+ '```',
71
+ '',
72
+ 'For help with instructions, ask your openclaw:',
73
+ '```bash',
74
+ `Look at my computer's settings thoroughly and give me the step-by-step instructions to update openclaw config by running the following command and then restarting openclaw gateway: openclaw config set plugins.entries.${PLUGIN_CONFIG.ID}.hooks.allowConversationAccess true`,
75
+ '```',
76
+ ].join('\n')
77
+ : null;
78
+ // Static skills + config go in appendSystemContext (cached).
79
+ // The access warning uses prependContext so it lands above the user's message
80
+ // on every turn — the model reads it before any user input.
28
81
  api.on('before_prompt_build', () => ({
29
82
  appendSystemContext: [skillsContent, configContext].filter(Boolean).join('\n\n'),
83
+ ...(accessWarning ? { prependContext: accessWarning } : {}),
30
84
  }));
31
- api.on('agent_end', (event, ctx) => handleAugmentation(event, ctx, config, logger));
85
+ if (hasConversationAccess) {
86
+ api.on('agent_end', (event, ctx) => handleAugmentation(event, ctx, config, logger));
87
+ }
32
88
  registerAuthenticatedTools({ api, config, logger });
33
89
  },
34
90
  };
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.16";
1
+ export declare const SDK_VERSION = "0.0.17";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const SDK_VERSION = '0.0.16';
1
+ export const SDK_VERSION = '0.0.17';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memorilabs/openclaw-memori",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "Official MemoriLabs.ai long-term memory plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",