@xdarkicex/openclaw-memory-libravdb 1.5.1 → 1.5.3
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 +31 -26
- package/dist/plugin-runtime.d.ts +1 -0
- package/dist/plugin-runtime.js +28 -24
- package/dist/sidecar.js +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40058,6 +40058,7 @@ var SidecarSupervisor = class {
|
|
|
40058
40058
|
this.reconnectScheduled = false;
|
|
40059
40059
|
const message = error instanceof Error ? error.message : String(error);
|
|
40060
40060
|
this.logger.error(`[libravdb] sidecar reconnect failed: ${message}`);
|
|
40061
|
+
void this.handleExit(1);
|
|
40061
40062
|
});
|
|
40062
40063
|
});
|
|
40063
40064
|
}
|
|
@@ -40242,32 +40243,7 @@ function createPluginRuntime(cfg, logger = console) {
|
|
|
40242
40243
|
}
|
|
40243
40244
|
if (!started) {
|
|
40244
40245
|
started = (async () => {
|
|
40245
|
-
|
|
40246
|
-
if (cfg.grpcEndpointTlsMode !== void 0 && !isTlsModeValid(cfg.grpcEndpointTlsMode)) {
|
|
40247
|
-
throw new Error(
|
|
40248
|
-
`LibraVDB: invalid grpcEndpointTlsMode "${cfg.grpcEndpointTlsMode}" \u2014 must be "auto", "tls", or "insecure"`
|
|
40249
|
-
);
|
|
40250
|
-
}
|
|
40251
|
-
const hasClientCert = cfg.grpcEndpointTlsClientCert !== void 0;
|
|
40252
|
-
const hasClientKey = cfg.grpcEndpointTlsClientKey !== void 0;
|
|
40253
|
-
if (hasClientCert !== hasClientKey) {
|
|
40254
|
-
throw new Error(
|
|
40255
|
-
"LibraVDB: grpcEndpointTlsClientCert and grpcEndpointTlsClientKey must both be set or both be omitted"
|
|
40256
|
-
);
|
|
40257
|
-
}
|
|
40258
|
-
if (cfg.grpcEndpointTlsMode === "insecure") {
|
|
40259
|
-
if (cfg.grpcEndpointTlsCa) {
|
|
40260
|
-
logger.warn?.(
|
|
40261
|
-
`LibraVDB: grpcEndpointTlsCa is set but grpcEndpointTlsMode is "insecure" \u2014 the CA file will not be used`
|
|
40262
|
-
);
|
|
40263
|
-
}
|
|
40264
|
-
if (cfg.grpcEndpointTlsClientCert) {
|
|
40265
|
-
logger.warn?.(
|
|
40266
|
-
`LibraVDB: grpcEndpointTlsClientCert is set but grpcEndpointTlsMode is "insecure" \u2014 client certificate will not be sent`
|
|
40267
|
-
);
|
|
40268
|
-
}
|
|
40269
|
-
}
|
|
40270
|
-
}
|
|
40246
|
+
validateGrpcKernelConfig(cfg, logger);
|
|
40271
40247
|
const sidecar = await startSidecar(cfg, logger);
|
|
40272
40248
|
const rpc = new RpcClient(sidecar.socket, {
|
|
40273
40249
|
timeoutMs: cfg.rpcTimeoutMs ?? DEFAULT_RPC_TIMEOUT_MS
|
|
@@ -40356,6 +40332,35 @@ function createPluginRuntime(cfg, logger = console) {
|
|
|
40356
40332
|
}
|
|
40357
40333
|
};
|
|
40358
40334
|
}
|
|
40335
|
+
function validateGrpcKernelConfig(cfg, logger) {
|
|
40336
|
+
if (!cfg.grpcEndpoint) {
|
|
40337
|
+
return;
|
|
40338
|
+
}
|
|
40339
|
+
if (cfg.grpcEndpointTlsMode !== void 0 && !isTlsModeValid(cfg.grpcEndpointTlsMode)) {
|
|
40340
|
+
throw new Error(
|
|
40341
|
+
`LibraVDB: invalid grpcEndpointTlsMode "${cfg.grpcEndpointTlsMode}" \u2014 must be "auto", "tls", or "insecure"`
|
|
40342
|
+
);
|
|
40343
|
+
}
|
|
40344
|
+
const hasClientCert = cfg.grpcEndpointTlsClientCert !== void 0;
|
|
40345
|
+
const hasClientKey = cfg.grpcEndpointTlsClientKey !== void 0;
|
|
40346
|
+
if (hasClientCert !== hasClientKey) {
|
|
40347
|
+
throw new Error(
|
|
40348
|
+
"LibraVDB: grpcEndpointTlsClientCert and grpcEndpointTlsClientKey must both be set or both be omitted"
|
|
40349
|
+
);
|
|
40350
|
+
}
|
|
40351
|
+
if (cfg.grpcEndpointTlsMode === "insecure") {
|
|
40352
|
+
if (cfg.grpcEndpointTlsCa) {
|
|
40353
|
+
logger.warn?.(
|
|
40354
|
+
`LibraVDB: grpcEndpointTlsCa is set but grpcEndpointTlsMode is "insecure" \u2014 the CA file will not be used`
|
|
40355
|
+
);
|
|
40356
|
+
}
|
|
40357
|
+
if (cfg.grpcEndpointTlsClientCert) {
|
|
40358
|
+
logger.warn?.(
|
|
40359
|
+
`LibraVDB: grpcEndpointTlsClientCert is set but grpcEndpointTlsMode is "insecure" \u2014 client certificate will not be sent`
|
|
40360
|
+
);
|
|
40361
|
+
}
|
|
40362
|
+
}
|
|
40363
|
+
}
|
|
40359
40364
|
function loadSecretFromEnv() {
|
|
40360
40365
|
const secret = process.env.LIBRAVDB_AUTH_SECRET;
|
|
40361
40366
|
if (secret) return secret;
|
package/dist/plugin-runtime.d.ts
CHANGED
|
@@ -30,4 +30,5 @@ export interface PluginRuntime {
|
|
|
30
30
|
shutdown(): Promise<void>;
|
|
31
31
|
}
|
|
32
32
|
export declare function createPluginRuntime(cfg: PluginConfig, logger?: LoggerLike): PluginRuntime;
|
|
33
|
+
export declare function validateGrpcKernelConfig(cfg: PluginConfig, logger: LoggerLike): void;
|
|
33
34
|
export declare function enrichStartupError(error: unknown, healthMessage?: string): Error;
|
package/dist/plugin-runtime.js
CHANGED
|
@@ -21,30 +21,7 @@ export function createPluginRuntime(cfg, logger = console) {
|
|
|
21
21
|
}
|
|
22
22
|
if (!started) {
|
|
23
23
|
started = (async () => {
|
|
24
|
-
|
|
25
|
-
if (cfg.grpcEndpointTlsMode !== undefined &&
|
|
26
|
-
!isTlsModeValid(cfg.grpcEndpointTlsMode)) {
|
|
27
|
-
throw new Error(`LibraVDB: invalid grpcEndpointTlsMode "${cfg.grpcEndpointTlsMode}" — ` +
|
|
28
|
-
`must be "auto", "tls", or "insecure"`);
|
|
29
|
-
}
|
|
30
|
-
const hasClientCert = cfg.grpcEndpointTlsClientCert !== undefined;
|
|
31
|
-
const hasClientKey = cfg.grpcEndpointTlsClientKey !== undefined;
|
|
32
|
-
if (hasClientCert !== hasClientKey) {
|
|
33
|
-
throw new Error("LibraVDB: grpcEndpointTlsClientCert and " +
|
|
34
|
-
"grpcEndpointTlsClientKey must both be set or both be omitted");
|
|
35
|
-
}
|
|
36
|
-
if (cfg.grpcEndpointTlsMode === "insecure") {
|
|
37
|
-
if (cfg.grpcEndpointTlsCa) {
|
|
38
|
-
logger.warn?.(`LibraVDB: grpcEndpointTlsCa is set but grpcEndpointTlsMode ` +
|
|
39
|
-
`is "insecure" — the CA file will not be used`);
|
|
40
|
-
}
|
|
41
|
-
if (cfg.grpcEndpointTlsClientCert) {
|
|
42
|
-
logger.warn?.(`LibraVDB: grpcEndpointTlsClientCert is set but ` +
|
|
43
|
-
`grpcEndpointTlsMode is "insecure" — client certificate ` +
|
|
44
|
-
`will not be sent`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
24
|
+
validateGrpcKernelConfig(cfg, logger);
|
|
48
25
|
const sidecar = await startSidecar(cfg, logger);
|
|
49
26
|
const rpc = new RpcClient(sidecar.socket, {
|
|
50
27
|
timeoutMs: cfg.rpcTimeoutMs ?? DEFAULT_RPC_TIMEOUT_MS,
|
|
@@ -141,6 +118,33 @@ export function createPluginRuntime(cfg, logger = console) {
|
|
|
141
118
|
},
|
|
142
119
|
};
|
|
143
120
|
}
|
|
121
|
+
export function validateGrpcKernelConfig(cfg, logger) {
|
|
122
|
+
if (!cfg.grpcEndpoint) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (cfg.grpcEndpointTlsMode !== undefined &&
|
|
126
|
+
!isTlsModeValid(cfg.grpcEndpointTlsMode)) {
|
|
127
|
+
throw new Error(`LibraVDB: invalid grpcEndpointTlsMode "${cfg.grpcEndpointTlsMode}" — ` +
|
|
128
|
+
`must be "auto", "tls", or "insecure"`);
|
|
129
|
+
}
|
|
130
|
+
const hasClientCert = cfg.grpcEndpointTlsClientCert !== undefined;
|
|
131
|
+
const hasClientKey = cfg.grpcEndpointTlsClientKey !== undefined;
|
|
132
|
+
if (hasClientCert !== hasClientKey) {
|
|
133
|
+
throw new Error("LibraVDB: grpcEndpointTlsClientCert and " +
|
|
134
|
+
"grpcEndpointTlsClientKey must both be set or both be omitted");
|
|
135
|
+
}
|
|
136
|
+
if (cfg.grpcEndpointTlsMode === "insecure") {
|
|
137
|
+
if (cfg.grpcEndpointTlsCa) {
|
|
138
|
+
logger.warn?.(`LibraVDB: grpcEndpointTlsCa is set but grpcEndpointTlsMode ` +
|
|
139
|
+
`is "insecure" — the CA file will not be used`);
|
|
140
|
+
}
|
|
141
|
+
if (cfg.grpcEndpointTlsClientCert) {
|
|
142
|
+
logger.warn?.(`LibraVDB: grpcEndpointTlsClientCert is set but ` +
|
|
143
|
+
`grpcEndpointTlsMode is "insecure" — client certificate ` +
|
|
144
|
+
`will not be sent`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
144
148
|
function loadSecretFromEnv() {
|
|
145
149
|
const secret = process.env.LIBRAVDB_AUTH_SECRET;
|
|
146
150
|
if (secret)
|
package/dist/sidecar.js
CHANGED
|
@@ -317,6 +317,7 @@ class SidecarSupervisor {
|
|
|
317
317
|
this.reconnectScheduled = false;
|
|
318
318
|
const message = error instanceof Error ? error.message : String(error);
|
|
319
319
|
this.logger.error(`[libravdb] sidecar reconnect failed: ${message}`);
|
|
320
|
+
void this.handleExit(1);
|
|
320
321
|
});
|
|
321
322
|
});
|
|
322
323
|
}
|
package/openclaw.plugin.json
CHANGED