@xdarkicex/openclaw-memory-libravdb 1.5.5 → 1.6.1
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 +19 -21
- package/dist/context-engine.d.ts +3 -3
- package/dist/context-engine.js +19 -123
- package/dist/dream-promotion.d.ts +4 -6
- package/dist/dream-promotion.js +22 -13
- package/dist/index.js +25240 -29191
- package/dist/ingest-queue.d.ts +9 -2
- package/dist/ingest-queue.js +13 -5
- package/dist/libravdb-client.d.ts +59 -0
- package/dist/libravdb-client.js +296 -0
- package/dist/markdown-ingest.d.ts +2 -5
- package/dist/markdown-ingest.js +40 -8
- package/dist/memory-provider.d.ts +2 -2
- package/dist/memory-provider.js +1 -1
- package/dist/memory-runtime.d.ts +4 -33
- package/dist/memory-runtime.js +40 -51
- package/dist/plugin-runtime.d.ts +4 -6
- package/dist/plugin-runtime.js +33 -72
- package/dist/types.d.ts +1 -21
- package/openclaw.plugin.json +1 -1
- package/package.json +7 -4
- package/dist/grpc-client.d.ts +0 -44
- package/dist/grpc-client.js +0 -188
- package/dist/rpc-protobuf-codecs.d.ts +0 -71
- package/dist/rpc-protobuf-codecs.js +0 -91
- package/dist/rpc.d.ts +0 -15
- package/dist/rpc.js +0 -203
- package/dist/sidecar.d.ts +0 -40
- package/dist/sidecar.js +0 -588
package/dist/memory-runtime.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { resolveDurableNamespace, resolveUserCollection } from "./memory-scopes.js";
|
|
2
2
|
import { resolveIdentity } from "./identity.js";
|
|
3
3
|
import { detectDreamQuerySignal, resolveDreamCollection } from "./dream-routing.js";
|
|
4
|
-
export function buildMemoryRuntimeBridge(
|
|
4
|
+
export function buildMemoryRuntimeBridge(getClient, cfg) {
|
|
5
5
|
return {
|
|
6
6
|
async getMemorySearchManager(params = {}) {
|
|
7
|
-
const status = await readStatus(
|
|
7
|
+
const status = await readStatus(getClient, params.purpose);
|
|
8
8
|
return {
|
|
9
|
-
manager: createMemorySearchManager(
|
|
9
|
+
manager: createMemorySearchManager(getClient, cfg, params, status),
|
|
10
10
|
};
|
|
11
11
|
},
|
|
12
12
|
resolveMemoryBackendConfig() {
|
|
13
|
-
// We keep retrieval inside the plugin-side sidecar rather than delegating to
|
|
14
|
-
// OpenClaw's external QMD path.
|
|
15
13
|
return { backend: "builtin" };
|
|
16
14
|
},
|
|
17
15
|
async closeAllMemorySearchManagers() {
|
|
@@ -19,10 +17,10 @@ export function buildMemoryRuntimeBridge(getRpc, cfg) {
|
|
|
19
17
|
},
|
|
20
18
|
};
|
|
21
19
|
}
|
|
22
|
-
function createMemorySearchManager(
|
|
20
|
+
function createMemorySearchManager(getClient, cfg, defaults, initialStatus) {
|
|
23
21
|
let cachedStatus = initialStatus;
|
|
24
22
|
let cachedIdentityUserId = null;
|
|
25
|
-
const returnedSearchPaths = new
|
|
23
|
+
const returnedSearchPaths = new Map();
|
|
26
24
|
function getResolvedUserId(sessionKey) {
|
|
27
25
|
if (cachedIdentityUserId !== null)
|
|
28
26
|
return cachedIdentityUserId;
|
|
@@ -65,14 +63,14 @@ function createMemorySearchManager(getRpc, cfg, defaults, initialStatus) {
|
|
|
65
63
|
});
|
|
66
64
|
const k = normalizePositiveInteger(params.k, params.limit, params.maxResults, params.topK, cfg.topK, 8);
|
|
67
65
|
const minScore = normalizeNumber(params.minScore);
|
|
68
|
-
const
|
|
66
|
+
const client = await getClient();
|
|
69
67
|
const result = dreamQuery.active && cfg.crossSessionRecall !== false
|
|
70
|
-
? await
|
|
68
|
+
? await client.searchText({
|
|
71
69
|
collection: resolveDreamCollection(userId),
|
|
72
70
|
text: queryText,
|
|
73
71
|
k,
|
|
74
72
|
})
|
|
75
|
-
: await searchResolvedCollections(
|
|
73
|
+
: await searchResolvedCollections(client, cfg, userId, sessionId, queryText, k);
|
|
76
74
|
const filteredResults = minScore === undefined
|
|
77
75
|
? result.results
|
|
78
76
|
: result.results.filter((item) => item.score >= minScore);
|
|
@@ -83,32 +81,34 @@ function createMemorySearchManager(getRpc, cfg, defaults, initialStatus) {
|
|
|
83
81
|
if (legacyCall) {
|
|
84
82
|
return { results: legacyResults };
|
|
85
83
|
}
|
|
86
|
-
const memoryResults = filteredResults.map(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
const memoryResults = filteredResults.map((item) => {
|
|
85
|
+
const meta = parseMetadataJson(item);
|
|
86
|
+
const collection = typeof meta.collection === "string" ? meta.collection : "memory";
|
|
87
|
+
const relPath = encodeSearchResultPath(collection, item.id);
|
|
88
|
+
returnedSearchPaths.set(relPath, item.text);
|
|
89
|
+
return toMemorySearchResult(item);
|
|
90
|
+
});
|
|
90
91
|
return memoryResults;
|
|
91
92
|
},
|
|
92
93
|
async readFile(params) {
|
|
93
|
-
|
|
94
|
+
const cachedText = returnedSearchPaths.get(params.relPath);
|
|
95
|
+
if (cachedText === undefined) {
|
|
94
96
|
throw new Error("LibraVDB memory path was not returned by this search manager");
|
|
95
97
|
}
|
|
96
|
-
const located = await loadSearchResultText(getRpc, params.relPath);
|
|
97
98
|
const fromLine = Math.max(1, params.from ?? 1);
|
|
98
99
|
const lineCount = Math.max(1, params.lines ?? 200);
|
|
99
|
-
const lines =
|
|
100
|
+
const lines = cachedText.split("\n");
|
|
100
101
|
const text = lines.slice(fromLine - 1, fromLine - 1 + lineCount).join("\n");
|
|
101
102
|
return {
|
|
102
103
|
text,
|
|
103
|
-
path:
|
|
104
|
+
path: params.relPath,
|
|
104
105
|
};
|
|
105
106
|
},
|
|
106
107
|
async ingest() {
|
|
107
|
-
// The plugin already owns per-turn ingest through the context engine.
|
|
108
108
|
return { ingested: false, delegatedToContextEngine: true };
|
|
109
109
|
},
|
|
110
110
|
async sync(_params) {
|
|
111
|
-
cachedStatus = await readStatus(
|
|
111
|
+
cachedStatus = await readStatus(getClient, defaults.purpose);
|
|
112
112
|
return { synced: true, delegatedToContextEngine: true };
|
|
113
113
|
},
|
|
114
114
|
status() {
|
|
@@ -126,22 +126,22 @@ function createMemorySearchManager(getRpc, cfg, defaults, initialStatus) {
|
|
|
126
126
|
return cachedStatus.ok ?? false;
|
|
127
127
|
},
|
|
128
128
|
async close() {
|
|
129
|
-
// The
|
|
129
|
+
// The client connection is shared by the plugin runtime.
|
|
130
130
|
},
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
async function searchResolvedCollections(
|
|
133
|
+
async function searchResolvedCollections(client, cfg, userId, sessionId, queryText, k) {
|
|
134
134
|
const collections = resolveSearchCollections(cfg, userId, sessionId);
|
|
135
135
|
if (collections.length === 0) {
|
|
136
136
|
return { results: [] };
|
|
137
137
|
}
|
|
138
138
|
return collections.length === 1
|
|
139
|
-
? await
|
|
139
|
+
? await client.searchText({
|
|
140
140
|
collection: collections[0],
|
|
141
141
|
text: queryText,
|
|
142
142
|
k,
|
|
143
143
|
})
|
|
144
|
-
: await
|
|
144
|
+
: await client.searchTextCollections({
|
|
145
145
|
collections,
|
|
146
146
|
text: queryText,
|
|
147
147
|
k,
|
|
@@ -180,8 +180,20 @@ function firstString(...values) {
|
|
|
180
180
|
}
|
|
181
181
|
return undefined;
|
|
182
182
|
}
|
|
183
|
+
function parseMetadataJson(item) {
|
|
184
|
+
if (item.metadataJson && item.metadataJson.length > 0) {
|
|
185
|
+
try {
|
|
186
|
+
return JSON.parse(new TextDecoder().decode(item.metadataJson));
|
|
187
|
+
}
|
|
188
|
+
catch (e) {
|
|
189
|
+
// ignore
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return {};
|
|
193
|
+
}
|
|
183
194
|
function toMemorySearchResult(item) {
|
|
184
|
-
const
|
|
195
|
+
const meta = parseMetadataJson(item);
|
|
196
|
+
const collection = typeof meta.collection === "string" ? meta.collection : "memory";
|
|
185
197
|
return {
|
|
186
198
|
path: encodeSearchResultPath(collection, item.id),
|
|
187
199
|
startLine: 1,
|
|
@@ -192,36 +204,13 @@ function toMemorySearchResult(item) {
|
|
|
192
204
|
citation: `${collection}:${item.id}`,
|
|
193
205
|
};
|
|
194
206
|
}
|
|
195
|
-
async function loadSearchResultText(getRpc, relPath) {
|
|
196
|
-
const { collection, id } = decodeSearchResultPath(relPath);
|
|
197
|
-
const rpc = await getRpc();
|
|
198
|
-
const result = await rpc.call("list_collection", { collection });
|
|
199
|
-
const item = result.results.find((entry) => entry.id === id);
|
|
200
|
-
if (!item) {
|
|
201
|
-
throw new Error(`LibraVDB memory path not found: ${relPath}`);
|
|
202
|
-
}
|
|
203
|
-
return {
|
|
204
|
-
path: relPath,
|
|
205
|
-
text: item.text,
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
207
|
function encodeSearchResultPath(collection, id) {
|
|
209
208
|
return `${encodeURIComponent(collection)}::${encodeURIComponent(id)}`;
|
|
210
209
|
}
|
|
211
|
-
function
|
|
212
|
-
const separator = relPath.indexOf("::");
|
|
213
|
-
if (separator <= 0) {
|
|
214
|
-
throw new Error(`Unsupported LibraVDB memory path: ${relPath}`);
|
|
215
|
-
}
|
|
216
|
-
return {
|
|
217
|
-
collection: decodeURIComponent(relPath.slice(0, separator)),
|
|
218
|
-
id: decodeURIComponent(relPath.slice(separator + 2)),
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
async function readStatus(getRpc, purpose) {
|
|
210
|
+
async function readStatus(getClient, purpose) {
|
|
222
211
|
try {
|
|
223
|
-
const
|
|
224
|
-
const status = await
|
|
212
|
+
const client = await getClient();
|
|
213
|
+
const status = await client.status({});
|
|
225
214
|
return {
|
|
226
215
|
...status,
|
|
227
216
|
backend: "builtin",
|
package/dist/plugin-runtime.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GrpcKernelClient } from "./grpc-client.js";
|
|
1
|
+
import { LibravDBClient } from "./libravdb-client.js";
|
|
3
2
|
import type { LoggerLike, PluginConfig } from "./types.js";
|
|
4
|
-
export type
|
|
3
|
+
export type ClientGetter = () => Promise<LibravDBClient>;
|
|
5
4
|
export declare const DEFAULT_RPC_TIMEOUT_MS = 30000;
|
|
6
5
|
export declare const STARTUP_HEALTH_TIMEOUT_MS = 2000;
|
|
7
6
|
export declare const VALID_TLS_MODES: readonly ["auto", "tls", "insecure"];
|
|
@@ -23,12 +22,11 @@ export interface LifecycleHint {
|
|
|
23
22
|
}
|
|
24
23
|
export type RuntimeShutdownTask = () => Promise<void> | void;
|
|
25
24
|
export interface PluginRuntime {
|
|
26
|
-
|
|
27
|
-
getKernel(): Promise<GrpcKernelClient | null>;
|
|
25
|
+
getClient: ClientGetter;
|
|
28
26
|
emitLifecycleHint(hint: LifecycleHint): Promise<void>;
|
|
29
27
|
onShutdown(task: RuntimeShutdownTask): void;
|
|
30
28
|
shutdown(): Promise<void>;
|
|
31
29
|
}
|
|
30
|
+
export declare function daemonProvisioningHint(): string;
|
|
32
31
|
export declare function createPluginRuntime(cfg: PluginConfig, logger?: LoggerLike): PluginRuntime;
|
|
33
|
-
export declare function validateGrpcKernelConfig(cfg: PluginConfig, logger: LoggerLike): void;
|
|
34
32
|
export declare function enrichStartupError(error: unknown, healthMessage?: string): Error;
|
package/dist/plugin-runtime.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GrpcKernelClient } from "./grpc-client.js";
|
|
3
|
-
import { daemonProvisioningHint, startSidecar } from "./sidecar.js";
|
|
1
|
+
import { LibravDBClient } from "./libravdb-client.js";
|
|
4
2
|
import { formatError } from "./format-error.js";
|
|
5
|
-
import { readFileSync } from "node:fs";
|
|
6
3
|
export const DEFAULT_RPC_TIMEOUT_MS = 30000;
|
|
7
4
|
export const STARTUP_HEALTH_TIMEOUT_MS = 2000;
|
|
8
5
|
export const VALID_TLS_MODES = ["auto", "tls", "insecure"];
|
|
@@ -10,6 +7,9 @@ const isTlsModeValid = (m) => VALID_TLS_MODES.includes(m);
|
|
|
10
7
|
export function resolveStartupHealthTimeoutMs(cfg) {
|
|
11
8
|
return Math.max(STARTUP_HEALTH_TIMEOUT_MS, cfg.rpcTimeoutMs ?? DEFAULT_RPC_TIMEOUT_MS);
|
|
12
9
|
}
|
|
10
|
+
export function daemonProvisioningHint() {
|
|
11
|
+
return "If you installed the npm package, install and start libravdbd separately; the package does not provision the daemon binary, ONNX Runtime, or model assets.";
|
|
12
|
+
}
|
|
13
13
|
export function createPluginRuntime(cfg, logger = console) {
|
|
14
14
|
let started = null;
|
|
15
15
|
let stopped = false;
|
|
@@ -20,62 +20,35 @@ export function createPluginRuntime(cfg, logger = console) {
|
|
|
20
20
|
throw new Error("LibraVDB plugin runtime has been shut down");
|
|
21
21
|
}
|
|
22
22
|
if (!started) {
|
|
23
|
+
let client;
|
|
23
24
|
started = (async () => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
validateTlsConfig(cfg, logger);
|
|
26
|
+
client = new LibravDBClient({
|
|
27
|
+
endpoint: cfg.grpcEndpoint || cfg.sidecarPath,
|
|
27
28
|
timeoutMs: cfg.rpcTimeoutMs ?? DEFAULT_RPC_TIMEOUT_MS,
|
|
29
|
+
tlsCaPath: cfg.grpcEndpointTlsCa,
|
|
30
|
+
tlsMode: cfg.grpcEndpointTlsMode,
|
|
31
|
+
tlsClientCertPath: cfg.grpcEndpointTlsClientCert,
|
|
32
|
+
tlsClientKeyPath: cfg.grpcEndpointTlsClientKey,
|
|
28
33
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
if (!health.ok) {
|
|
33
|
-
try {
|
|
34
|
-
await sidecar.shutdown();
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
// Ignore cleanup failure on startup rejection.
|
|
38
|
-
}
|
|
39
|
-
throw enrichStartupError("LibraVDB daemon failed health check", health.message);
|
|
40
|
-
}
|
|
41
|
-
let kernel = null;
|
|
42
|
-
if (cfg.grpcEndpoint) {
|
|
43
|
-
const secret = loadSecretFromEnv();
|
|
44
|
-
try {
|
|
45
|
-
kernel = new GrpcKernelClient({
|
|
46
|
-
endpoint: cfg.grpcEndpoint,
|
|
47
|
-
secret,
|
|
48
|
-
timeoutMs: cfg.rpcTimeoutMs ?? DEFAULT_RPC_TIMEOUT_MS,
|
|
49
|
-
tlsCaPath: cfg.grpcEndpointTlsCa,
|
|
50
|
-
tlsMode: cfg.grpcEndpointTlsMode,
|
|
51
|
-
tlsClientCertPath: cfg.grpcEndpointTlsClientCert,
|
|
52
|
-
tlsClientKeyPath: cfg.grpcEndpointTlsClientKey,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
// Only gRPC init errors land here — config validation already threw above
|
|
57
|
-
logger.warn?.(`LibraVDB: failed to initialize gRPC kernel client: ${formatError(error)}`);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return { rpc, sidecar, kernel };
|
|
34
|
+
await client.bootstrapHandshake();
|
|
35
|
+
return client;
|
|
61
36
|
})().catch((error) => {
|
|
62
37
|
started = null;
|
|
38
|
+
client?.close();
|
|
63
39
|
throw enrichStartupError(error);
|
|
64
40
|
});
|
|
65
41
|
}
|
|
66
42
|
return await started;
|
|
67
43
|
};
|
|
68
44
|
return {
|
|
69
|
-
async
|
|
70
|
-
return
|
|
71
|
-
},
|
|
72
|
-
async getKernel() {
|
|
73
|
-
return (await ensureStarted()).kernel;
|
|
45
|
+
async getClient() {
|
|
46
|
+
return await ensureStarted();
|
|
74
47
|
},
|
|
75
48
|
async emitLifecycleHint(hint) {
|
|
76
49
|
try {
|
|
77
|
-
const
|
|
78
|
-
await
|
|
50
|
+
const client = await ensureStarted();
|
|
51
|
+
await client.sessionLifecycleHint(hint);
|
|
79
52
|
}
|
|
80
53
|
catch (error) {
|
|
81
54
|
logger.warn?.(`LibraVDB lifecycle hint dropped: ${formatError(error)}`);
|
|
@@ -104,24 +77,27 @@ export function createPluginRuntime(cfg, logger = console) {
|
|
|
104
77
|
if (!started) {
|
|
105
78
|
return;
|
|
106
79
|
}
|
|
107
|
-
const
|
|
80
|
+
const client = started;
|
|
108
81
|
started = null;
|
|
109
|
-
const { rpc, sidecar, kernel } = await active;
|
|
110
82
|
try {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
83
|
+
const resolved = await client;
|
|
84
|
+
try {
|
|
85
|
+
await resolved.flush({});
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
logger.warn?.(`LibraVDB flush failed during shutdown: ${formatError(error)}`);
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
resolved.close();
|
|
92
|
+
}
|
|
114
93
|
}
|
|
115
|
-
|
|
116
|
-
|
|
94
|
+
catch {
|
|
95
|
+
// startup may have failed before client resolution; nothing to flush or close
|
|
117
96
|
}
|
|
118
97
|
},
|
|
119
98
|
};
|
|
120
99
|
}
|
|
121
|
-
|
|
122
|
-
if (!cfg.grpcEndpoint) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
100
|
+
function validateTlsConfig(cfg, logger) {
|
|
125
101
|
if (cfg.grpcEndpointTlsMode !== undefined &&
|
|
126
102
|
!isTlsModeValid(cfg.grpcEndpointTlsMode)) {
|
|
127
103
|
throw new Error(`LibraVDB: invalid grpcEndpointTlsMode "${cfg.grpcEndpointTlsMode}" — ` +
|
|
@@ -145,21 +121,6 @@ export function validateGrpcKernelConfig(cfg, logger) {
|
|
|
145
121
|
}
|
|
146
122
|
}
|
|
147
123
|
}
|
|
148
|
-
function loadSecretFromEnv() {
|
|
149
|
-
const secret = process.env.LIBRAVDB_AUTH_SECRET;
|
|
150
|
-
if (secret)
|
|
151
|
-
return secret;
|
|
152
|
-
const path = process.env.LIBRAVDB_AUTH_SECRET_FILE;
|
|
153
|
-
if (path) {
|
|
154
|
-
try {
|
|
155
|
-
return readFileSync(path, "utf8").trim();
|
|
156
|
-
}
|
|
157
|
-
catch {
|
|
158
|
-
return undefined;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return undefined;
|
|
162
|
-
}
|
|
163
124
|
export function enrichStartupError(error, healthMessage) {
|
|
164
125
|
const rawMessage = error instanceof Error ? error.message : String(error);
|
|
165
126
|
const message = rawMessage.trim() || "LibraVDB daemon startup failed";
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export interface PluginConfig {
|
|
2
2
|
dbPath?: string;
|
|
3
|
+
/** Legacy fallback alias for grpcEndpoint. */
|
|
3
4
|
sidecarPath?: string;
|
|
4
5
|
/** Stable identity for cross-session durable memory. When set, all sessions
|
|
5
6
|
* share memories under user:{userId}. When unset, the plugin auto-derives
|
|
@@ -89,7 +90,6 @@ export interface PluginConfig {
|
|
|
89
90
|
ollamaUrl?: string;
|
|
90
91
|
compactModel?: string;
|
|
91
92
|
rpcTimeoutMs?: number;
|
|
92
|
-
maxRetries?: number;
|
|
93
93
|
logLevel?: "debug" | "info" | "warn" | "error";
|
|
94
94
|
grpcEndpoint?: string;
|
|
95
95
|
grpcEndpointTlsCa?: string;
|
|
@@ -146,31 +146,11 @@ export interface SearchResult {
|
|
|
146
146
|
};
|
|
147
147
|
finalScore?: number;
|
|
148
148
|
}
|
|
149
|
-
export interface SidecarSocket {
|
|
150
|
-
setEncoding(encoding: string): void;
|
|
151
|
-
on(event: "data", handler: (chunk: Buffer) => void): void;
|
|
152
|
-
on(event: "close", handler: () => void): void;
|
|
153
|
-
on(event: "error", handler: (error: Error) => void): void;
|
|
154
|
-
once(event: "connect", handler: () => void): void;
|
|
155
|
-
once(event: "error", handler: (error: Error) => void): void;
|
|
156
|
-
off(event: "connect", handler: () => void): void;
|
|
157
|
-
off(event: "error", handler: (error: Error) => void): void;
|
|
158
|
-
write(chunk: Buffer | string): void;
|
|
159
|
-
destroy(err?: Error): void;
|
|
160
|
-
}
|
|
161
149
|
export interface LoggerLike {
|
|
162
150
|
error(message: string): void;
|
|
163
151
|
info?(message: string): void;
|
|
164
152
|
warn?(message: string): void;
|
|
165
153
|
}
|
|
166
|
-
export interface SidecarHandle {
|
|
167
|
-
socket: SidecarSocket;
|
|
168
|
-
isDegraded(): boolean;
|
|
169
|
-
shutdown(): Promise<void>;
|
|
170
|
-
}
|
|
171
|
-
export interface RpcCallOptions {
|
|
172
|
-
timeoutMs: number;
|
|
173
|
-
}
|
|
174
154
|
export interface PredictedContext {
|
|
175
155
|
id: string;
|
|
176
156
|
text: string;
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xdarkicex/openclaw-memory-libravdb",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -51,12 +51,11 @@
|
|
|
51
51
|
"check": "tsc --noEmit && pnpm run test:ts",
|
|
52
52
|
"test:inspect": "pnpm run plugin:ci",
|
|
53
53
|
"test:ts": "pnpm run test:inspect && tsc -p tsconfig.tests.json && node --test .ts-build/test/unit/*.test.js",
|
|
54
|
-
"test:integration": "pnpm run test:inspect && 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
|
|
54
|
+
"test:integration": "pnpm run test:inspect && 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",
|
|
55
55
|
"benchmark:session_search_mid": "tsc -p tsconfig.tests.json && OPENCLAW_PROFILE_ASSEMBLE=1 node --test --test-name-pattern=\"real sidecar mid-sized session search benchmark\" .ts-build/test/integration/host-flow.test.js",
|
|
56
56
|
"gate:assemble_optimization": "tsc -p tsconfig.tests.json && OPENCLAW_PROFILE_ASSEMBLE=1 OPENCLAW_ENFORCE_ASSEMBLE_EVIDENCE_GATE=1 node --test --test-name-pattern=\"real sidecar mid-sized session search benchmark\" .ts-build/test/integration/host-flow.test.js",
|
|
57
57
|
"probe:session_recall": "tsc -p tsconfig.tests.json && OPENCLAW_PROFILE_ASSEMBLE=1 node --test --test-name-pattern=\"real sidecar mid-sized session search benchmark\" .ts-build/test/integration/host-flow.test.js",
|
|
58
58
|
"probe:session_recall_threshold": "tsc -p tsconfig.tests.json && OPENCLAW_PROFILE_ASSEMBLE=1 node --test --test-name-pattern=\"real sidecar session_recall index threshold probe\" .ts-build/test/integration/host-flow.test.js",
|
|
59
|
-
"benchmark:longmemeval": "tsc -p tsconfig.tests.json && node --test .ts-build/test/integration/longmemeval-benchmark.test.js",
|
|
60
59
|
"benchmark:longmemeval:score": "node scripts/longmemeval-score.mjs",
|
|
61
60
|
"benchmark:longmemeval:diagnose": "node scripts/longmemeval-diagnose.mjs",
|
|
62
61
|
"plugin:check": "plugin-inspector inspect --no-openclaw",
|
|
@@ -70,12 +69,16 @@
|
|
|
70
69
|
"@grpc/proto-loader": "^0.8.0",
|
|
71
70
|
"@openclaw/plugin-inspector": "0.3.7",
|
|
72
71
|
"@types/node": "^20.11.0",
|
|
73
|
-
"@xdarkicex/libravdb-contracts": "^0.0.7",
|
|
74
72
|
"esbuild": "^0.27.0",
|
|
75
73
|
"openclaw": "2026.4.11",
|
|
76
74
|
"typescript": "^6.0.3"
|
|
77
75
|
},
|
|
78
76
|
"peerDependencies": {
|
|
79
77
|
"openclaw": ">=2026.3.22"
|
|
78
|
+
},
|
|
79
|
+
"dependencies": {
|
|
80
|
+
"@connectrpc/connect": "^1.7.0",
|
|
81
|
+
"@connectrpc/connect-node": "^1.7.0",
|
|
82
|
+
"@xdarkicex/libravdb-contracts": "^0.3.0"
|
|
80
83
|
}
|
|
81
84
|
}
|
package/dist/grpc-client.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as grpc from "@grpc/grpc-js";
|
|
2
|
-
export interface GrpcClientOptions {
|
|
3
|
-
endpoint: string;
|
|
4
|
-
secret?: string;
|
|
5
|
-
timeoutMs?: number;
|
|
6
|
-
tlsCaPath?: string;
|
|
7
|
-
tlsMode?: "auto" | "tls" | "insecure";
|
|
8
|
-
tlsClientCertPath?: string;
|
|
9
|
-
tlsClientKeyPath?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function resolveGrpcTarget(endpoint: string): string;
|
|
12
|
-
/**
|
|
13
|
-
* Selects gRPC credential mode based on endpoint address class.
|
|
14
|
-
*
|
|
15
|
-
* - Unix socket endpoints → plaintext (local-only transport)
|
|
16
|
-
* - Loopback addresses (localhost, 127.0.0.1, ::1) → plaintext
|
|
17
|
-
* - All other TCP and DNS targets → TLS
|
|
18
|
-
*
|
|
19
|
-
* resolveGrpcCredentials uses this classification to return the
|
|
20
|
-
* appropriate grpc.ChannelCredentials. Pass tlsCaPath to load a
|
|
21
|
-
* custom CA certificate PEM file for self-signed or private CA
|
|
22
|
-
* deployments. Omit tlsCaPath for publicly trusted certificates
|
|
23
|
-
* (Let's Encrypt, cert-manager) — the system CA pool is used.
|
|
24
|
-
*/
|
|
25
|
-
export declare function resolveGrpcCredentialMode(endpoint: string, tlsMode?: "auto" | "tls" | "insecure"): "insecure" | "tls";
|
|
26
|
-
export declare function resolveGrpcCredentials(endpoint: string, tlsCaPath?: string, tlsMode?: "auto" | "tls" | "insecure", tlsClientCertPath?: string, tlsClientKeyPath?: string): grpc.ChannelCredentials;
|
|
27
|
-
export declare class GrpcKernelClient {
|
|
28
|
-
private client;
|
|
29
|
-
private readonly secret;
|
|
30
|
-
private readonly timeoutMs;
|
|
31
|
-
private nonceHex;
|
|
32
|
-
constructor(options: GrpcClientOptions);
|
|
33
|
-
private getMetadata;
|
|
34
|
-
private call;
|
|
35
|
-
initializeSession(req: any): Promise<any>;
|
|
36
|
-
assembleContext(req: any): Promise<any>;
|
|
37
|
-
rankCandidates(req: any): Promise<any>;
|
|
38
|
-
ingestMessage(req: any): Promise<any>;
|
|
39
|
-
afterTurn(req: any): Promise<any>;
|
|
40
|
-
bootstrapSession(req: any): Promise<any>;
|
|
41
|
-
compactSession(req: any): Promise<any>;
|
|
42
|
-
getStatus(req?: any): Promise<any>;
|
|
43
|
-
close(): void;
|
|
44
|
-
}
|