@bamdra/bamdra-memory-vector 0.1.11 → 0.1.13

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/README.md CHANGED
@@ -6,6 +6,8 @@ The local knowledge and semantic recall layer for the Bamdra suite.
6
6
 
7
7
  It can run independently, and it becomes most powerful when paired with `bamdra-openclaw-memory`.
8
8
 
9
+ Tested with OpenClaw `v2026.3.23`.
10
+
9
11
  Install directly:
10
12
 
11
13
  ```bash
@@ -34,6 +36,11 @@ It indexes:
34
36
 
35
37
  and helps OpenClaw search that local knowledge before falling back to the web.
36
38
 
39
+ Recent compatibility improvements:
40
+
41
+ - npm installs on OpenClaw `v2026.3.23` now backfill `plugins.installs` metadata for the standalone vector plugin
42
+ - vector storage paths that use `~/.openclaw/...` are now resolved against the active user home instead of being treated as literal directories
43
+
37
44
  ## Why it matters
38
45
 
39
46
  The weakest part of many memory systems is the knowledge layer:
package/README.zh-CN.md CHANGED
@@ -6,6 +6,8 @@ Bamdra 套件中的本地知识库与语义召回层。
6
6
 
7
7
  它可以独立运行,和 `bamdra-openclaw-memory` 配合时效果最好。
8
8
 
9
+ 已验证适配 OpenClaw `v2026.3.23`。
10
+
9
11
  单独安装:
10
12
 
11
13
  ```bash
@@ -34,6 +36,11 @@ openclaw plugins install @bamdra/bamdra-memory-vector
34
36
 
35
37
  并尽量让 OpenClaw 在上网之前先查本地知识。
36
38
 
39
+ 这轮兼容性修复还包括:
40
+
41
+ - 在 OpenClaw `v2026.3.23` 下通过 npm 单独安装时,会自动补齐 `plugins.installs` 元数据
42
+ - 使用 `~/.openclaw/...` 的向量存储路径现在会正确解析到当前用户目录,而不是被当成字面目录名
43
+
37
44
  ## 为什么重要
38
45
 
39
46
  很多记忆系统最弱的一层,其实就是知识库层:
package/dist/index.js CHANGED
@@ -230,16 +230,28 @@ function exposeVectorApi(runtime) {
230
230
  }
231
231
  function normalizeConfig(input) {
232
232
  const root = (0, import_node_path.join)((0, import_node_os.homedir)(), ".openclaw", "memory", "vector");
233
- const markdownRoot = input?.markdownRoot ?? (0, import_node_path.join)(root, "markdown");
233
+ const markdownRoot = expandHomePath(input?.markdownRoot) ?? (0, import_node_path.join)(root, "markdown");
234
234
  return {
235
235
  enabled: input?.enabled ?? true,
236
236
  markdownRoot,
237
- privateMarkdownRoot: input?.privateMarkdownRoot ?? (0, import_node_path.join)(markdownRoot, "private"),
238
- sharedMarkdownRoot: input?.sharedMarkdownRoot ?? (0, import_node_path.join)(markdownRoot, "shared"),
239
- indexPath: input?.indexPath ?? (0, import_node_path.join)(root, "index.json"),
237
+ privateMarkdownRoot: expandHomePath(input?.privateMarkdownRoot) ?? (0, import_node_path.join)(markdownRoot, "private"),
238
+ sharedMarkdownRoot: expandHomePath(input?.sharedMarkdownRoot) ?? (0, import_node_path.join)(markdownRoot, "shared"),
239
+ indexPath: expandHomePath(input?.indexPath) ?? (0, import_node_path.join)(root, "index.json"),
240
240
  dimensions: input?.dimensions ?? 64
241
241
  };
242
242
  }
243
+ function expandHomePath(value) {
244
+ if (!value) {
245
+ return null;
246
+ }
247
+ if (value === "~") {
248
+ return (0, import_node_os.homedir)();
249
+ }
250
+ if (value.startsWith("~/")) {
251
+ return (0, import_node_path.join)((0, import_node_os.homedir)(), value.slice(2));
252
+ }
253
+ return value;
254
+ }
243
255
  function bootstrapOpenClawHost() {
244
256
  const currentFile = (0, import_node_url.fileURLToPath)(importMetaUrl);
245
257
  const runtimeDir = (0, import_node_path.dirname)(currentFile);
@@ -259,17 +271,58 @@ function bootstrapOpenClawHost() {
259
271
  }
260
272
  const original = (0, import_node_fs.readFileSync)(configPath, "utf8");
261
273
  const config = JSON.parse(original);
262
- const changed = ensureHostConfig(config);
274
+ const changed = ensureHostConfig(config, packageRoot);
263
275
  if (!changed) {
264
276
  return;
265
277
  }
266
278
  (0, import_node_fs.writeFileSync)(configPath, `${JSON.stringify(config, null, 2)}
267
279
  `, "utf8");
268
280
  }
269
- function ensureHostConfig(config) {
281
+ function readPluginInstallMetadata(pluginId, packageRoot, installPath) {
282
+ try {
283
+ const pkg = JSON.parse((0, import_node_fs.readFileSync)((0, import_node_path.join)(packageRoot, "package.json"), "utf8"));
284
+ const packageName = typeof pkg.name === "string" ? pkg.name : pluginId;
285
+ const version = typeof pkg.version === "string" ? pkg.version : "0.0.0";
286
+ const now = (/* @__PURE__ */ new Date()).toISOString();
287
+ return {
288
+ source: "npm",
289
+ spec: packageName,
290
+ installPath,
291
+ version,
292
+ resolvedName: packageName,
293
+ resolvedVersion: version,
294
+ resolvedSpec: `${packageName}@${version}`,
295
+ resolvedAt: now,
296
+ installedAt: now
297
+ };
298
+ } catch {
299
+ return null;
300
+ }
301
+ }
302
+ function ensureInstallMetadata(installs, pluginId, metadata) {
303
+ if (!metadata) {
304
+ return false;
305
+ }
306
+ const current = installs[pluginId];
307
+ if (current && typeof current === "object" && !Array.isArray(current)) {
308
+ const install = current;
309
+ let changed = false;
310
+ for (const [key, value] of Object.entries(metadata)) {
311
+ if (typeof install[key] !== "string" || install[key] === "") {
312
+ install[key] = value;
313
+ changed = true;
314
+ }
315
+ }
316
+ return changed;
317
+ }
318
+ installs[pluginId] = metadata;
319
+ return true;
320
+ }
321
+ function ensureHostConfig(config, packageRoot) {
270
322
  let changed = false;
271
323
  const plugins = ensureObject(config, "plugins");
272
324
  const entries = ensureObject(plugins, "entries");
325
+ const installs = ensureObject(plugins, "installs");
273
326
  const load = ensureObject(plugins, "load");
274
327
  const tools = ensureObject(config, "tools");
275
328
  const skills = ensureObject(config, "skills");
@@ -280,6 +333,11 @@ function ensureHostConfig(config) {
280
333
  changed = ensureArrayIncludes(plugins, "allow", PLUGIN_ID) || changed;
281
334
  changed = ensureArrayIncludes(load, "paths", (0, import_node_path.join)((0, import_node_os.homedir)(), ".openclaw", "extensions")) || changed;
282
335
  changed = ensureArrayIncludes(skillsLoad, "extraDirs", (0, import_node_path.join)((0, import_node_os.homedir)(), ".openclaw", "skills")) || changed;
336
+ changed = ensureInstallMetadata(
337
+ installs,
338
+ PLUGIN_ID,
339
+ readPluginInstallMetadata(PLUGIN_ID, packageRoot, (0, import_node_path.join)((0, import_node_os.homedir)(), ".openclaw", "extensions", PLUGIN_ID))
340
+ ) || changed;
283
341
  changed = ensureArrayIncludes(tools, "allow", SEARCH_TOOL_NAME) || changed;
284
342
  changed = ensureArrayIncludes(tools, "allow", REINDEX_TOOL_NAME) || changed;
285
343
  if (typeof entry.enabled !== "boolean") {
@@ -3,10 +3,13 @@
3
3
  "type": "tool",
4
4
  "name": "Bamdra Memory Vector",
5
5
  "description": "Local vector-style semantic retrieval enhancement for Bamdra memory.",
6
- "version": "0.1.0",
6
+ "version": "0.1.13",
7
7
  "main": "./index.js",
8
+ "skills": [
9
+ "./skills"
10
+ ],
8
11
  "configSchema": {
9
12
  "type": "object",
10
13
  "additionalProperties": true
11
14
  }
12
- }
15
+ }
package/dist/package.json CHANGED
@@ -1,12 +1,41 @@
1
1
  {
2
2
  "name": "@bamdra/bamdra-memory-vector",
3
- "version": "0.1.0",
4
- "private": true,
3
+ "version": "0.1.13",
4
+ "description": "Lightweight local semantic retrieval enhancement for the Bamdra OpenClaw memory suite.",
5
+ "license": "MIT",
6
+ "homepage": "https://www.bamdra.com",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/bamdra/bamdra-memory-vector.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/bamdra/bamdra-memory-vector/issues"
13
+ },
5
14
  "type": "commonjs",
6
15
  "main": "./index.js",
7
16
  "types": "./dist/index.d.ts",
17
+ "files": [
18
+ "dist",
19
+ "skills",
20
+ "openclaw.plugin.json",
21
+ "README.md",
22
+ "LICENSE"
23
+ ],
24
+ "keywords": [
25
+ "openclaw",
26
+ "openclaw-plugin",
27
+ "vector-search",
28
+ "semantic-search",
29
+ "memory",
30
+ "markdown"
31
+ ],
32
+ "engines": {
33
+ "node": ">=22"
34
+ },
8
35
  "scripts": {
9
- "bundle": "node ../../scripts/run-local-bin.mjs tsup && node ../../scripts/prepare-plugin-dist.mjs bamdra-memory-vector"
36
+ "bundle": "node ../bamdra-openclaw-memory/scripts/run-local-bin.mjs tsup && node ./scripts/prepare-plugin-dist.mjs",
37
+ "prepublishOnly": "pnpm run bundle",
38
+ "package:release": "node ./scripts/package-release.mjs"
10
39
  },
11
40
  "openclaw": {
12
41
  "id": "bamdra-memory-vector",
@@ -22,10 +51,11 @@
22
51
  "default": "./dist/index.js"
23
52
  }
24
53
  },
25
- "dependencies": {
26
- "@openclaw-enhanced/memory-core": "workspace:*"
54
+ "publishConfig": {
55
+ "access": "public"
27
56
  },
57
+ "dependencies": {},
28
58
  "devDependencies": {
29
59
  "@types/node": "^24.5.2"
30
60
  }
31
- }
61
+ }
@@ -3,7 +3,7 @@
3
3
  "type": "tool",
4
4
  "name": "Bamdra Memory Vector",
5
5
  "description": "Local vector-style semantic retrieval enhancement for Bamdra memory.",
6
- "version": "0.1.10",
6
+ "version": "0.1.12",
7
7
  "main": "./dist/index.js",
8
8
  "skills": ["./skills"],
9
9
  "configSchema": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamdra/bamdra-memory-vector",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Lightweight local semantic retrieval enhancement for the Bamdra OpenClaw memory suite.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.bamdra.com",
@@ -33,7 +33,7 @@
33
33
  "node": ">=22"
34
34
  },
35
35
  "scripts": {
36
- "bundle": "node ../bamdra-openclaw-memory/scripts/run-local-bin.mjs tsup",
36
+ "bundle": "node ../bamdra-openclaw-memory/scripts/run-local-bin.mjs tsup && node ./scripts/prepare-plugin-dist.mjs",
37
37
  "prepublishOnly": "pnpm run bundle",
38
38
  "package:release": "node ./scripts/package-release.mjs"
39
39
  },