@memorilabs/openclaw-memori 0.0.17 → 0.0.18

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
@@ -30,7 +30,13 @@ const memoriPlugin = {
30
30
  // bypasses) and the schema validator temporarily rejected the key, crashing the app.
31
31
  // The platform stabilized the plugin loader in 2026.5.7 and re-clarified the rule in 5.9.
32
32
  // Therefore, we only enforce the warning on 2026.5.7 and newer.
33
- const ocVersion = api.runtime.version.replace(/^v/, '');
33
+ // `api.runtime` is typed as non-nullable but the loader passes `{}` during
34
+ // non-`full` registration modes (e.g. cli-metadata). Cast so we can guard.
35
+ const rawVersion = api.runtime?.version ??
36
+ api.version ??
37
+ process.env.OPENCLAW_VERSION ??
38
+ '2026.5.18';
39
+ const ocVersion = rawVersion.replace(/^v/, '');
34
40
  const [ocYear = 0, ocMonth = 0, ocDay = 0] = ocVersion
35
41
  .split('.')
36
42
  .map((s) => parseInt(s, 10) || 0);
@@ -1,10 +1,11 @@
1
- import { exec } from 'child_process';
1
+ import { execFile } from 'child_process';
2
2
  import { promisify } from 'util';
3
- import * as os from 'os';
4
3
  import * as path from 'path';
5
- const execAsync = promisify(exec);
4
+ import { createRequire } from 'module';
5
+ const execFileAsync = promisify(execFile);
6
+ const require = createRequire(import.meta.url);
6
7
  export function createMemoriQuotaTool(deps) {
7
- const { logger } = deps;
8
+ const { logger, config } = deps;
8
9
  return {
9
10
  name: 'memori_quota',
10
11
  label: 'Memori Quota',
@@ -16,10 +17,11 @@ export function createMemoriQuotaTool(deps) {
16
17
  async execute(_toolCallId) {
17
18
  try {
18
19
  logger.info('memori_quota checking usage...');
19
- const tmpDir = os.tmpdir();
20
- await execAsync(`npm install --prefix ${tmpDir} --no-save @memorilabs/memori@0.1.12-beta`);
21
- const binPath = path.join(tmpDir, 'node_modules', '.bin', 'memori');
22
- const { stdout } = await execAsync(`${binPath} quota`);
20
+ const sdkEntry = require.resolve('@memorilabs/memori');
21
+ const binPath = path.join(path.dirname(sdkEntry), 'bin/cli.js');
22
+ const { stdout } = await execFileAsync(process.execPath, [binPath, 'quota'], {
23
+ env: { ...process.env, MEMORI_API_KEY: config.apiKey },
24
+ });
23
25
  const result = {
24
26
  success: true,
25
27
  message: stdout.trim(),
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.17";
1
+ export declare const SDK_VERSION = "0.0.18";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const SDK_VERSION = '0.0.17';
1
+ export const SDK_VERSION = '0.0.18';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memorilabs/openclaw-memori",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "Official MemoriLabs.ai long-term memory plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -25,6 +25,11 @@
25
25
  "peerDependencies": {
26
26
  "openclaw": "^2026.3.2"
27
27
  },
28
+ "peerDependenciesMeta": {
29
+ "openclaw": {
30
+ "optional": true
31
+ }
32
+ },
28
33
  "devDependencies": {
29
34
  "@eslint/js": "^9.0.0",
30
35
  "@types/node": "^20.0.0",
@@ -32,6 +37,7 @@
32
37
  "eslint": "^9.0.0",
33
38
  "eslint-config-prettier": "^10.1.8",
34
39
  "eslint-plugin-tsdoc": "^0.5.1",
40
+ "openclaw": "^2026.3.2",
35
41
  "prettier": "^3.0.0",
36
42
  "typescript": "^5.0.0",
37
43
  "typescript-eslint": "^8.0.0",
@@ -67,6 +73,6 @@
67
73
  "@hono/node-server": "^1.19.10"
68
74
  },
69
75
  "dependencies": {
70
- "@memorilabs/memori": "^0.1.23-beta"
76
+ "@memorilabs/memori": "^0.1.24-beta"
71
77
  }
72
78
  }