@psiclawops/hypermem-memory 0.7.0 → 0.8.2
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 +18 -5
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -15,13 +15,23 @@
|
|
|
15
15
|
* Both plugins share the same HyperMem singleton (loaded from repo dist).
|
|
16
16
|
*/
|
|
17
17
|
import { definePluginEntry, emptyPluginConfigSchema } from 'openclaw/plugin-sdk/plugin-entry';
|
|
18
|
-
import os from 'os';
|
|
19
18
|
import path from 'path';
|
|
20
19
|
import fs from 'fs/promises';
|
|
20
|
+
import os from 'os';
|
|
21
|
+
import { fileURLToPath } from 'url';
|
|
21
22
|
// ─── HyperMem singleton ────────────────────────────────────────
|
|
22
23
|
// Reuses the same singleton pattern as the context engine plugin.
|
|
23
|
-
// Both plugins load from the same
|
|
24
|
-
const
|
|
24
|
+
// Both plugins load from the same installed runtime payload and share the instance.
|
|
25
|
+
const __pluginDir = path.dirname(fileURLToPath(import.meta.url));
|
|
26
|
+
async function resolveHyperMemPath() {
|
|
27
|
+
try {
|
|
28
|
+
const resolvedUrl = await import.meta.resolve('@psiclawops/hypermem');
|
|
29
|
+
return resolvedUrl.startsWith('file:') ? fileURLToPath(resolvedUrl) : resolvedUrl;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return path.resolve(__pluginDir, '../../dist/index.js');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
25
35
|
let _hm = null;
|
|
26
36
|
let _hmInitPromise = null;
|
|
27
37
|
async function getHyperMem() {
|
|
@@ -30,7 +40,8 @@ async function getHyperMem() {
|
|
|
30
40
|
if (_hmInitPromise)
|
|
31
41
|
return _hmInitPromise;
|
|
32
42
|
_hmInitPromise = (async () => {
|
|
33
|
-
const
|
|
43
|
+
const hypermemPath = await resolveHyperMemPath();
|
|
44
|
+
const mod = await import(hypermemPath);
|
|
34
45
|
const HyperMem = mod.HyperMem;
|
|
35
46
|
const instance = await HyperMem.create({
|
|
36
47
|
dataDir: path.join(os.homedir(), '.openclaw/hypermem'),
|
|
@@ -168,7 +179,9 @@ function createMemorySearchManager(hm, agentId, workspaceDir) {
|
|
|
168
179
|
vector: {
|
|
169
180
|
enabled: !!vectorStore,
|
|
170
181
|
available: !!vectorStore,
|
|
171
|
-
dims: vectorStats
|
|
182
|
+
dims: vectorStats?.dimensions
|
|
183
|
+
?? vectorStats?.dims
|
|
184
|
+
?? undefined,
|
|
172
185
|
},
|
|
173
186
|
custom: {
|
|
174
187
|
vectorStats: vectorStats ?? undefined,
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@psiclawops/hypermem-memory",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "HyperMem memory plugin for OpenClaw
|
|
3
|
+
"version": "0.8.2",
|
|
4
|
+
"description": "HyperMem memory plugin for OpenClaw \u2014 bridges HyperMem retrieval into the memory slot",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"author": "PsiClawOps",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/PsiClawOps/hypermem
|
|
11
|
+
"url": "https://github.com/PsiClawOps/hypermem.git",
|
|
12
12
|
"directory": "memory-plugin"
|
|
13
13
|
},
|
|
14
14
|
"publishConfig": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"typecheck": "tsc --noEmit"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@psiclawops/hypermem": "
|
|
41
|
+
"@psiclawops/hypermem": "file:.."
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"openclaw": "*",
|