@xdarkicex/openclaw-memory-libravdb 1.4.22 → 1.4.23
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/cli.js +36 -34
- package/dist/context-engine.d.ts +1 -1
- package/dist/rpc-protobuf-codecs.d.ts +2 -1
- package/dist/rpc-protobuf-codecs.js +2 -1
- package/dist/rpc.js +1 -1
- package/dist/types.d.ts +0 -1
- package/docs/features.md +0 -1
- package/openclaw.plugin.json +1 -5
- package/package.json +3 -2
- package/dist/generated/libravdb/ipc/v1/rpc_pb.d.ts +0 -1810
- package/dist/generated/libravdb/ipc/v1/rpc_pb.d.ts.map +0 -1
- package/dist/generated/libravdb/ipc/v1/rpc_pb.js +0 -2808
- package/dist/generated/libravdb/ipc/v1/rpc_pb.js.map +0 -1
- package/dist/generated/libravdb/ipc/v1/rpc_pb.ts +0 -3429
package/dist/cli.js
CHANGED
|
@@ -19,7 +19,7 @@ export function registerMemoryCli(api, runtime, cfg, logger = console) {
|
|
|
19
19
|
// Non-full modes register structure only so `openclaw memory --help` works.
|
|
20
20
|
// No runtime available — do not attach action handlers.
|
|
21
21
|
ensureCommand(root, "status").description("Show sidecar health, record counts, and active thresholds");
|
|
22
|
-
ensureCommand(root, "index").description("
|
|
22
|
+
ensureCommand(root, "index").description("Rebuild LibraVDB memory vector index (requires --force)");
|
|
23
23
|
ensureCommand(root, "search").description("Search LibraVDB memory");
|
|
24
24
|
ensureCommand(root, "flush").description("Wipe a durable memory namespace after confirmation");
|
|
25
25
|
ensureCommand(root, "export").description("Stream stored memories as newline-delimited JSON");
|
|
@@ -32,7 +32,6 @@ export function registerMemoryCli(api, runtime, cfg, logger = console) {
|
|
|
32
32
|
.option("--agent <id>", "Agent id")
|
|
33
33
|
.option("--json", "Print JSON")
|
|
34
34
|
.option("--deep", "Probe daemon readiness")
|
|
35
|
-
.option("--index", "Refresh delegated index state before printing status")
|
|
36
35
|
.option("--fix", "Accepted for OpenClaw memory CLI compatibility")
|
|
37
36
|
.option("--verbose", "Verbose logging")
|
|
38
37
|
.action(async (opts) => {
|
|
@@ -41,9 +40,12 @@ export function registerMemoryCli(api, runtime, cfg, logger = console) {
|
|
|
41
40
|
});
|
|
42
41
|
});
|
|
43
42
|
ensureCommand(root, "index")
|
|
44
|
-
.description("
|
|
43
|
+
.description("Rebuild LibraVDB memory vector index (requires --force)")
|
|
45
44
|
.option("--agent <id>", "Agent id")
|
|
46
|
-
.option("--
|
|
45
|
+
.option("--user-id <userId>", "User id")
|
|
46
|
+
.option("--session-key <sessionKey>", "Session key")
|
|
47
|
+
.option("--collections <list>", "Comma-separated collection names to reindex")
|
|
48
|
+
.option("--force", "Required: confirm index rebuild")
|
|
47
49
|
.option("--verbose", "Verbose logging")
|
|
48
50
|
.action(async (opts) => {
|
|
49
51
|
await runCliCommand(runtime, logger, async () => {
|
|
@@ -142,9 +144,6 @@ async function runCliCommand(runtime, logger, action) {
|
|
|
142
144
|
}
|
|
143
145
|
}
|
|
144
146
|
async function runStatus(runtime, cfg, logger, opts = {}) {
|
|
145
|
-
if (opts.index) {
|
|
146
|
-
await runIndex(runtime, cfg, { ...opts, verbose: false }, logger, { quiet: true });
|
|
147
|
-
}
|
|
148
147
|
try {
|
|
149
148
|
const rpc = await runtime.getRpc();
|
|
150
149
|
const status = await rpc.call("status", {});
|
|
@@ -189,38 +188,40 @@ async function runStatus(runtime, cfg, logger, opts = {}) {
|
|
|
189
188
|
process.exitCode = 1;
|
|
190
189
|
}
|
|
191
190
|
}
|
|
192
|
-
async function runIndex(runtime,
|
|
191
|
+
async function runIndex(runtime, _cfg, opts, logger, params = {}) {
|
|
192
|
+
if (!opts?.force) {
|
|
193
|
+
logger.error("LibraVDB index rebuild requires --force. This re-embeds all stored documents with the current model and may be slow.");
|
|
194
|
+
process.exitCode = 1;
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const namespace = resolveCliNamespace(opts);
|
|
198
|
+
const collections = opts?.collections
|
|
199
|
+
?.split(",")
|
|
200
|
+
.map((c) => c.trim())
|
|
201
|
+
.filter((c) => c.length > 0);
|
|
193
202
|
try {
|
|
194
|
-
const
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
});
|
|
199
|
-
await manager.sync?.({
|
|
200
|
-
reason: "cli",
|
|
201
|
-
force: Boolean(opts?.force),
|
|
203
|
+
const rpc = await runtime.getRpc();
|
|
204
|
+
const result = await rpc.call("rebuild_index", {
|
|
205
|
+
namespace: namespace ?? "",
|
|
206
|
+
...(collections?.length ? { collections } : {}),
|
|
202
207
|
});
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
+
if (!params.quiet) {
|
|
209
|
+
console.log(`Collections processed: ${result.collectionsProcessed ?? 0}`);
|
|
210
|
+
console.log(`Records reindexed: ${result.recordsReindexed ?? 0}`);
|
|
211
|
+
if ((result.collectionsRecreated ?? 0) > 0) {
|
|
212
|
+
console.log(`Collections recreated: ${result.collectionsRecreated} (embedding dimensions changed)`);
|
|
213
|
+
}
|
|
208
214
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
Provider: status.provider ?? "libravdb",
|
|
212
|
-
Model: status.model ?? status.embeddingProfile ?? "unknown",
|
|
213
|
-
"Turns stored": status.turnCount ?? 0,
|
|
214
|
-
"Memories stored": status.memoryCount ?? 0,
|
|
215
|
-
Message: status.message ?? "ok",
|
|
216
|
-
});
|
|
215
|
+
for (const err of result.errors ?? []) {
|
|
216
|
+
logger.warn?.(`LibraVDB index rebuild: ${err}`);
|
|
217
217
|
}
|
|
218
|
-
if (
|
|
219
|
-
|
|
218
|
+
if ((result.errors?.length ?? 0) > 0 && (result.recordsReindexed ?? 0) === 0) {
|
|
219
|
+
logger.error("LibraVDB index rebuild completed with errors and no records reindexed.");
|
|
220
|
+
process.exitCode = 1;
|
|
220
221
|
}
|
|
221
222
|
}
|
|
222
223
|
catch (error) {
|
|
223
|
-
logger.error(`LibraVDB index
|
|
224
|
+
logger.error(`LibraVDB index rebuild failed: ${formatError(error)}`);
|
|
224
225
|
process.exitCode = 1;
|
|
225
226
|
}
|
|
226
227
|
}
|
|
@@ -390,8 +391,9 @@ function normalizeQueryArg(value) {
|
|
|
390
391
|
function resolveCliNamespace(opts) {
|
|
391
392
|
const userId = opts?.userId?.trim();
|
|
392
393
|
const sessionKey = opts?.sessionKey?.trim();
|
|
393
|
-
|
|
394
|
+
const agentId = opts?.agent?.trim();
|
|
395
|
+
if (!userId && !sessionKey && !agentId) {
|
|
394
396
|
return undefined;
|
|
395
397
|
}
|
|
396
|
-
return resolveDurableNamespace({ userId, sessionKey });
|
|
398
|
+
return resolveDurableNamespace({ userId, sessionKey, agentId });
|
|
397
399
|
}
|
package/dist/context-engine.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PluginRuntime } from "./plugin-runtime.js";
|
|
2
2
|
import type { LoggerLike, PluginConfig, RecallCache, SearchResult } from "./types.js";
|
|
3
|
-
import { AssembleContextInternalResponse } from "
|
|
3
|
+
import { AssembleContextInternalResponse } from "@xdarkicex/libravdb-contracts";
|
|
4
4
|
type KernelCompatibleMessage = {
|
|
5
5
|
role: string;
|
|
6
6
|
content: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AfterTurnKernelRequest, AfterTurnKernelResponse, AssembleContextInternalRequest, AssembleContextInternalResponse, BootstrapSessionKernelRequest, BootstrapSessionKernelResponse, CompactSessionRequest, CompactSessionResponse, DeleteAuthoredDocumentResponse, DreamPromotionResponse, ExportMemoryResponse, FlushNamespaceResponse, FlushResponse, HealthResponse, IngestMarkdownDocumentResponse, IngestMessageKernelRequest, IngestMessageKernelResponse, MemoryStatusResponse, RankCandidatesRequest, RankCandidatesResponse, SearchTextResponse, SessionLifecycleHintResponse } from "
|
|
1
|
+
import { AfterTurnKernelRequest, AfterTurnKernelResponse, AssembleContextInternalRequest, AssembleContextInternalResponse, BootstrapSessionKernelRequest, BootstrapSessionKernelResponse, CompactSessionRequest, CompactSessionResponse, DeleteAuthoredDocumentResponse, DreamPromotionResponse, ExportMemoryResponse, FlushNamespaceResponse, FlushResponse, HealthResponse, IngestMarkdownDocumentResponse, IngestMessageKernelRequest, IngestMessageKernelResponse, MemoryStatusResponse, RankCandidatesRequest, RankCandidatesResponse, RebuildIndexRequest, RebuildIndexResponse, SearchTextResponse, SessionLifecycleHintResponse } from "@xdarkicex/libravdb-contracts";
|
|
2
2
|
import type { LifecycleHint } from "./plugin-runtime.js";
|
|
3
3
|
export type RpcMethodCodec<Params = unknown, Result = unknown> = {
|
|
4
4
|
encodeParams(params: Params): Uint8Array;
|
|
@@ -66,5 +66,6 @@ export declare const rpcProtobufCodecs: {
|
|
|
66
66
|
assemble_context_internal: RpcMethodCodec<AssembleContextInternalRequest, AssembleContextInternalResponse>;
|
|
67
67
|
compact_session: RpcMethodCodec<CompactSessionRequest, CompactSessionResponse>;
|
|
68
68
|
rank_candidates: RpcMethodCodec<RankCandidatesRequest, RankCandidatesResponse>;
|
|
69
|
+
rebuild_index: RpcMethodCodec<RebuildIndexRequest, RebuildIndexResponse>;
|
|
69
70
|
};
|
|
70
71
|
export declare function getRpcMethodCodec(method: string): RpcMethodCodec<any, any> | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AfterTurnKernelRequest, AfterTurnKernelResponse, AssembleContextInternalRequest, AssembleContextInternalResponse, BootstrapSessionKernelRequest, BootstrapSessionKernelResponse, CompactSessionRequest, CompactSessionResponse, DeleteAuthoredDocumentRequest, DeleteAuthoredDocumentResponse, DreamPromotionResponse, ExportMemoryRequest, ExportMemoryResponse, FlushNamespaceRequest, FlushNamespaceResponse, FlushResponse, HealthResponse, IngestMarkdownDocumentRequest, IngestMarkdownDocumentResponse, IngestMessageKernelRequest, IngestMessageKernelResponse, ListCollectionRequest, ListLifecycleJournalRequest, MemoryStatusResponse, PromoteDreamEntriesRequest, RankCandidatesRequest, RankCandidatesResponse, SearchTextCollectionsRequest, SearchTextRequest, SearchTextResponse, SessionLifecycleHintRequest, SessionLifecycleHintResponse, StringList, } from "
|
|
1
|
+
import { AfterTurnKernelRequest, AfterTurnKernelResponse, AssembleContextInternalRequest, AssembleContextInternalResponse, BootstrapSessionKernelRequest, BootstrapSessionKernelResponse, CompactSessionRequest, CompactSessionResponse, DeleteAuthoredDocumentRequest, DeleteAuthoredDocumentResponse, DreamPromotionResponse, ExportMemoryRequest, ExportMemoryResponse, FlushNamespaceRequest, FlushNamespaceResponse, FlushResponse, HealthResponse, IngestMarkdownDocumentRequest, IngestMarkdownDocumentResponse, IngestMessageKernelRequest, IngestMessageKernelResponse, ListCollectionRequest, ListLifecycleJournalRequest, MemoryStatusResponse, PromoteDreamEntriesRequest, RankCandidatesRequest, RankCandidatesResponse, RebuildIndexRequest, RebuildIndexResponse, SearchTextCollectionsRequest, SearchTextRequest, SearchTextResponse, SessionLifecycleHintRequest, SessionLifecycleHintResponse, StringList, } from "@xdarkicex/libravdb-contracts";
|
|
2
2
|
function encodeMessage(schema, init) {
|
|
3
3
|
return new schema(init).toBinary();
|
|
4
4
|
}
|
|
@@ -78,6 +78,7 @@ export const rpcProtobufCodecs = {
|
|
|
78
78
|
assemble_context_internal: codec((params) => encodeMessage(AssembleContextInternalRequest, params), normalizeAssembleContextInternalResponse),
|
|
79
79
|
compact_session: codec((params) => encodeMessage(CompactSessionRequest, params), (bytes) => decodeProtobufResult(CompactSessionResponse, bytes)),
|
|
80
80
|
rank_candidates: codec((params) => encodeMessage(RankCandidatesRequest, params), (bytes) => decodeProtobufResult(RankCandidatesResponse, bytes)),
|
|
81
|
+
rebuild_index: codec((params) => encodeMessage(RebuildIndexRequest, params), (bytes) => decodeProtobufResult(RebuildIndexResponse, bytes)),
|
|
81
82
|
};
|
|
82
83
|
export function getRpcMethodCodec(method) {
|
|
83
84
|
return rpcProtobufCodecs[method];
|
package/dist/rpc.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -47,7 +47,6 @@ export interface PluginConfig {
|
|
|
47
47
|
markdownIngestionObsidianDebounceMs?: number;
|
|
48
48
|
markdownIngestionInclude?: string[];
|
|
49
49
|
markdownIngestionExclude?: string[];
|
|
50
|
-
markdownIngestionCollection?: string;
|
|
51
50
|
markdownIngestionDebounceMs?: number;
|
|
52
51
|
dreamPromotionEnabled?: boolean;
|
|
53
52
|
dreamPromotionDiaryPath?: string;
|
package/docs/features.md
CHANGED
|
@@ -51,7 +51,6 @@ Relevant config fields:
|
|
|
51
51
|
| `markdownIngestionRoots` | Generic markdown roots to watch. |
|
|
52
52
|
| `markdownIngestionInclude` | Optional include globs for generic roots. |
|
|
53
53
|
| `markdownIngestionExclude` | Optional exclude globs for generic roots. |
|
|
54
|
-
| `markdownIngestionCollection` | Target collection for generic markdown, default `global`. |
|
|
55
54
|
| `markdownIngestionDebounceMs` | Watch debounce window, default `150`. |
|
|
56
55
|
| `markdownIngestionObsidianEnabled` | Enables Obsidian ingestion when vault roots exist. |
|
|
57
56
|
| `markdownIngestionObsidianRoots` | Obsidian vault roots to watch. |
|
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.4.
|
|
5
|
+
"version": "1.4.23",
|
|
6
6
|
"kind": [
|
|
7
7
|
"memory",
|
|
8
8
|
"context-engine"
|
|
@@ -197,10 +197,6 @@
|
|
|
197
197
|
"type": "string"
|
|
198
198
|
}
|
|
199
199
|
},
|
|
200
|
-
"markdownIngestionCollection": {
|
|
201
|
-
"type": "string",
|
|
202
|
-
"default": "global"
|
|
203
|
-
},
|
|
204
200
|
"markdownIngestionDebounceMs": {
|
|
205
201
|
"type": "number",
|
|
206
202
|
"default": 150
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xdarkicex/openclaw-memory-libravdb",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
|
-
"build": "tsc -p tsconfig.build.json && mkdir -p dist/proto
|
|
41
|
+
"build": "tsc -p tsconfig.build.json && mkdir -p dist/proto && cp -rf api/proto/. dist/proto/",
|
|
42
42
|
"check": "tsc --noEmit && pnpm run test:ts",
|
|
43
43
|
"test:ts": "tsc -p tsconfig.tests.json && node --test .ts-build/test/unit/*.test.js",
|
|
44
44
|
"test:integration": "tsc -p tsconfig.tests.json && node --test .ts-build/test/integration/checklist-validation.test.js .ts-build/test/integration/dream-promotion.test.js .ts-build/test/integration/host-flow.test.js .ts-build/test/integration/markdown-ingest.test.js .ts-build/test/integration/sidecar-lifecycle.test.js",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"@bufbuild/protobuf": "1.7.2",
|
|
57
57
|
"@grpc/grpc-js": "^1.14.3",
|
|
58
58
|
"@grpc/proto-loader": "^0.8.0",
|
|
59
|
+
"@xdarkicex/libravdb-contracts": "^0.0.1",
|
|
59
60
|
"openclaw": "*"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|