@xdarkicex/openclaw-memory-libravdb 1.6.6 → 1.6.8
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/identity.js +10 -0
- package/dist/index.js +26 -1
- package/dist/markdown-ingest.js +16 -1
- package/docs/configuration.md +2 -2
- package/docs/features.md +2 -2
- package/openclaw.plugin.json +31 -1
- package/package.json +1 -1
package/dist/identity.js
CHANGED
|
@@ -2,6 +2,7 @@ import { userInfo, hostname } from "node:os";
|
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { existsSync, readFileSync, writeFileSync, renameSync, mkdirSync, } from "node:fs";
|
|
4
4
|
import { join, dirname } from "node:path";
|
|
5
|
+
import { execSync } from "node:child_process";
|
|
5
6
|
/**
|
|
6
7
|
* Resolves the identity file path, respecting OpenClaw's state directory conventions.
|
|
7
8
|
*
|
|
@@ -58,6 +59,15 @@ function writeIdentityFile(path, userId, parts) {
|
|
|
58
59
|
const tmp = `${path}.${process.pid}.${Math.random().toString(36).slice(2, 8)}.tmp`;
|
|
59
60
|
writeFileSync(tmp, JSON.stringify(identity, null, 2) + "\n", { mode: 0o600 });
|
|
60
61
|
renameSync(tmp, path);
|
|
62
|
+
// POSIX mode bits are advisory on Windows — enforce owner-only access via ACLs.
|
|
63
|
+
if (process.platform === "win32") {
|
|
64
|
+
try {
|
|
65
|
+
execSync(`icacls "${path}" /inheritance:r /grant:r "%USERNAME%:(R,W)"`, { stdio: "ignore", timeout: 5000 });
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// best-effort; the file is already written with 0o600
|
|
69
|
+
}
|
|
70
|
+
}
|
|
61
71
|
}
|
|
62
72
|
export function resolveIdentity(params) {
|
|
63
73
|
// 1. Plugin config override (highest priority)
|
package/dist/index.js
CHANGED
|
@@ -24994,6 +24994,7 @@ import {
|
|
|
24994
24994
|
mkdirSync
|
|
24995
24995
|
} from "node:fs";
|
|
24996
24996
|
import { join, dirname } from "node:path";
|
|
24997
|
+
import { execSync } from "node:child_process";
|
|
24997
24998
|
function resolveIdentityPath(configuredPath) {
|
|
24998
24999
|
if (configuredPath) return configuredPath;
|
|
24999
25000
|
const stateDir = process.env.OPENCLAW_STATE_DIR?.trim();
|
|
@@ -25035,6 +25036,15 @@ function writeIdentityFile(path4, userId, parts) {
|
|
|
25035
25036
|
const tmp = `${path4}.${process.pid}.${Math.random().toString(36).slice(2, 8)}.tmp`;
|
|
25036
25037
|
writeFileSync(tmp, JSON.stringify(identity, null, 2) + "\n", { mode: 384 });
|
|
25037
25038
|
renameSync(tmp, path4);
|
|
25039
|
+
if (process.platform === "win32") {
|
|
25040
|
+
try {
|
|
25041
|
+
execSync(
|
|
25042
|
+
`icacls "${path4}" /inheritance:r /grant:r "%USERNAME%:(R,W)"`,
|
|
25043
|
+
{ stdio: "ignore", timeout: 5e3 }
|
|
25044
|
+
);
|
|
25045
|
+
} catch {
|
|
25046
|
+
}
|
|
25047
|
+
}
|
|
25038
25048
|
}
|
|
25039
25049
|
function resolveIdentity(params) {
|
|
25040
25050
|
const configUserId = params.configUserId?.trim();
|
|
@@ -32662,6 +32672,21 @@ var DEFAULT_TOKENIZER_ID = "markdown-ingest:v1";
|
|
|
32662
32672
|
var MARKDOWN_INGEST_VERSION = 3;
|
|
32663
32673
|
var HASH_BACKEND = "wasm-fnv1a64";
|
|
32664
32674
|
var STREAM_CHUNK_BYTES = 64 * 1024;
|
|
32675
|
+
var DEFAULT_MARKDOWN_INGEST_EXCLUDES = [
|
|
32676
|
+
"**/node_modules/**",
|
|
32677
|
+
"**/.git/**",
|
|
32678
|
+
"**/dist/**",
|
|
32679
|
+
"**/build/**",
|
|
32680
|
+
"**/coverage/**",
|
|
32681
|
+
"**/.next/**",
|
|
32682
|
+
"**/.nuxt/**",
|
|
32683
|
+
"**/.svelte-kit/**",
|
|
32684
|
+
"**/.turbo/**",
|
|
32685
|
+
"**/.cache/**",
|
|
32686
|
+
"**/.venv/**",
|
|
32687
|
+
"**/venv/**",
|
|
32688
|
+
"**/__pycache__/**"
|
|
32689
|
+
];
|
|
32665
32690
|
function createMarkdownIngestionHandle(cfg, getClient, logger = console, fsApi = createRealFsApi2()) {
|
|
32666
32691
|
const adapters = [];
|
|
32667
32692
|
const genericRoots = normalizeMarkdownRoots(cfg.markdownIngestionRoots);
|
|
@@ -32780,7 +32805,7 @@ var DirectoryMarkdownSourceAdapter = class {
|
|
|
32780
32805
|
this.kind = kind;
|
|
32781
32806
|
this.roots = config.roots;
|
|
32782
32807
|
this.includePatterns = config.include?.length ? config.include : [];
|
|
32783
|
-
this.excludePatterns = config.exclude?.length ? config.exclude :
|
|
32808
|
+
this.excludePatterns = config.exclude?.length ? config.exclude : DEFAULT_MARKDOWN_INGEST_EXCLUDES;
|
|
32784
32809
|
this.debounceMs = config.debounceMs ?? DEFAULT_DEBOUNCE_MS2;
|
|
32785
32810
|
this.fsApi = fsApi;
|
|
32786
32811
|
this.getClient = getClient;
|
package/dist/markdown-ingest.js
CHANGED
|
@@ -9,6 +9,21 @@ const DEFAULT_TOKENIZER_ID = "markdown-ingest:v1";
|
|
|
9
9
|
const MARKDOWN_INGEST_VERSION = 3;
|
|
10
10
|
const HASH_BACKEND = "wasm-fnv1a64";
|
|
11
11
|
const STREAM_CHUNK_BYTES = 64 * 1024;
|
|
12
|
+
const DEFAULT_MARKDOWN_INGEST_EXCLUDES = [
|
|
13
|
+
"**/node_modules/**",
|
|
14
|
+
"**/.git/**",
|
|
15
|
+
"**/dist/**",
|
|
16
|
+
"**/build/**",
|
|
17
|
+
"**/coverage/**",
|
|
18
|
+
"**/.next/**",
|
|
19
|
+
"**/.nuxt/**",
|
|
20
|
+
"**/.svelte-kit/**",
|
|
21
|
+
"**/.turbo/**",
|
|
22
|
+
"**/.cache/**",
|
|
23
|
+
"**/.venv/**",
|
|
24
|
+
"**/venv/**",
|
|
25
|
+
"**/__pycache__/**",
|
|
26
|
+
];
|
|
12
27
|
export function createMarkdownIngestionHandle(cfg, getClient, logger = console, fsApi = createRealFsApi()) {
|
|
13
28
|
const adapters = [];
|
|
14
29
|
const genericRoots = normalizeMarkdownRoots(cfg.markdownIngestionRoots);
|
|
@@ -108,7 +123,7 @@ class DirectoryMarkdownSourceAdapter {
|
|
|
108
123
|
this.kind = kind;
|
|
109
124
|
this.roots = config.roots;
|
|
110
125
|
this.includePatterns = config.include?.length ? config.include : [];
|
|
111
|
-
this.excludePatterns = config.exclude?.length ? config.exclude :
|
|
126
|
+
this.excludePatterns = config.exclude?.length ? config.exclude : DEFAULT_MARKDOWN_INGEST_EXCLUDES;
|
|
112
127
|
this.debounceMs = config.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
113
128
|
this.fsApi = fsApi;
|
|
114
129
|
this.getClient = getClient;
|
package/docs/configuration.md
CHANGED
|
@@ -140,12 +140,12 @@ The plugin exposes `ingestionGateThreshold` for host-side gating decisions:
|
|
|
140
140
|
| `markdownIngestionEnabled` | boolean | `false` | Watch markdown roots for changes |
|
|
141
141
|
| `markdownIngestionRoots` | string[] | — | Directories to watch |
|
|
142
142
|
| `markdownIngestionInclude` | string[] | — | Glob patterns to include |
|
|
143
|
-
| `markdownIngestionExclude` | string[] |
|
|
143
|
+
| `markdownIngestionExclude` | string[] | dependency/build dirs | Glob patterns to exclude; when empty, defaults exclude `node_modules`, `.git`, `dist`, `build`, `coverage`, `.next`, `.nuxt`, `.svelte-kit`, `.turbo`, `.cache`, `.venv`, `venv`, `__pycache__` at any depth |
|
|
144
144
|
| `markdownIngestionDebounceMs` | number | `150` | Debounce window for file change events |
|
|
145
145
|
| `markdownIngestionObsidianEnabled` | boolean | `false` | Watch Obsidian vault roots |
|
|
146
146
|
| `markdownIngestionObsidianRoots` | string[] | — | Obsidian vault directories |
|
|
147
147
|
| `markdownIngestionObsidianInclude` | string[] | — | Obsidian glob include patterns |
|
|
148
|
-
| `markdownIngestionObsidianExclude` | string[] |
|
|
148
|
+
| `markdownIngestionObsidianExclude` | string[] | same defaults as above | Obsidian glob exclude patterns; defaults to the same set as generic markdown ingestion |
|
|
149
149
|
| `markdownIngestionObsidianDebounceMs` | number | `150` | Obsidian debounce window |
|
|
150
150
|
|
|
151
151
|
Configured markdown roots are ignored unless the matching enable flag is set to
|
package/docs/features.md
CHANGED
|
@@ -53,12 +53,12 @@ Relevant config fields:
|
|
|
53
53
|
| `markdownIngestionEnabled` | Enables or disables generic markdown ingestion. |
|
|
54
54
|
| `markdownIngestionRoots` | Generic markdown roots to watch. |
|
|
55
55
|
| `markdownIngestionInclude` | Optional include globs for generic roots. |
|
|
56
|
-
| `markdownIngestionExclude` | Optional exclude globs for generic roots. |
|
|
56
|
+
| `markdownIngestionExclude` | Optional exclude globs for generic roots; defaults to common dependency/build directories (`**/node_modules/**`, `**/.git/**`, `**/dist/**`, and more) when not set. Setting an explicit list replaces the defaults entirely. |
|
|
57
57
|
| `markdownIngestionDebounceMs` | Watch debounce window, default `150`. |
|
|
58
58
|
| `markdownIngestionObsidianEnabled` | Enables Obsidian ingestion when vault roots exist. |
|
|
59
59
|
| `markdownIngestionObsidianRoots` | Obsidian vault roots to watch. |
|
|
60
60
|
| `markdownIngestionObsidianInclude` | Optional include globs for Obsidian roots. |
|
|
61
|
-
| `markdownIngestionObsidianExclude` | Optional exclude globs for Obsidian roots. |
|
|
61
|
+
| `markdownIngestionObsidianExclude` | Optional exclude globs for Obsidian roots; same defaults as generic markdown ingestion. |
|
|
62
62
|
| `markdownIngestionObsidianDebounceMs` | Obsidian watch debounce window, default `150`. |
|
|
63
63
|
|
|
64
64
|
By default, the Obsidian adapter auto-ingests notes that look like memory notes,
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "libravdb-memory",
|
|
3
3
|
"name": "LibraVDB Memory",
|
|
4
4
|
"description": "Persistent vector memory with three-tier hybrid scoring",
|
|
5
|
-
"version": "1.6.
|
|
5
|
+
"version": "1.6.8",
|
|
6
6
|
"kind": [
|
|
7
7
|
"memory",
|
|
8
8
|
"context-engine"
|
|
@@ -239,6 +239,21 @@
|
|
|
239
239
|
},
|
|
240
240
|
"markdownIngestionObsidianExclude": {
|
|
241
241
|
"type": "array",
|
|
242
|
+
"default": [
|
|
243
|
+
"**/node_modules/**",
|
|
244
|
+
"**/.git/**",
|
|
245
|
+
"**/dist/**",
|
|
246
|
+
"**/build/**",
|
|
247
|
+
"**/coverage/**",
|
|
248
|
+
"**/.next/**",
|
|
249
|
+
"**/.nuxt/**",
|
|
250
|
+
"**/.svelte-kit/**",
|
|
251
|
+
"**/.turbo/**",
|
|
252
|
+
"**/.cache/**",
|
|
253
|
+
"**/.venv/**",
|
|
254
|
+
"**/venv/**",
|
|
255
|
+
"**/__pycache__/**"
|
|
256
|
+
],
|
|
242
257
|
"items": {
|
|
243
258
|
"type": "string"
|
|
244
259
|
}
|
|
@@ -255,6 +270,21 @@
|
|
|
255
270
|
},
|
|
256
271
|
"markdownIngestionExclude": {
|
|
257
272
|
"type": "array",
|
|
273
|
+
"default": [
|
|
274
|
+
"**/node_modules/**",
|
|
275
|
+
"**/.git/**",
|
|
276
|
+
"**/dist/**",
|
|
277
|
+
"**/build/**",
|
|
278
|
+
"**/coverage/**",
|
|
279
|
+
"**/.next/**",
|
|
280
|
+
"**/.nuxt/**",
|
|
281
|
+
"**/.svelte-kit/**",
|
|
282
|
+
"**/.turbo/**",
|
|
283
|
+
"**/.cache/**",
|
|
284
|
+
"**/.venv/**",
|
|
285
|
+
"**/venv/**",
|
|
286
|
+
"**/__pycache__/**"
|
|
287
|
+
],
|
|
258
288
|
"items": {
|
|
259
289
|
"type": "string"
|
|
260
290
|
}
|