@xdarkicex/openclaw-memory-libravdb 1.5.1 → 1.5.2
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 +30 -26
- package/dist/plugin-runtime.d.ts +1 -0
- package/dist/plugin-runtime.js +28 -24
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40242,32 +40242,7 @@ function createPluginRuntime(cfg, logger = console) {
|
|
|
40242
40242
|
}
|
|
40243
40243
|
if (!started) {
|
|
40244
40244
|
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
|
-
}
|
|
40245
|
+
validateGrpcKernelConfig(cfg, logger);
|
|
40271
40246
|
const sidecar = await startSidecar(cfg, logger);
|
|
40272
40247
|
const rpc = new RpcClient(sidecar.socket, {
|
|
40273
40248
|
timeoutMs: cfg.rpcTimeoutMs ?? DEFAULT_RPC_TIMEOUT_MS
|
|
@@ -40356,6 +40331,35 @@ function createPluginRuntime(cfg, logger = console) {
|
|
|
40356
40331
|
}
|
|
40357
40332
|
};
|
|
40358
40333
|
}
|
|
40334
|
+
function validateGrpcKernelConfig(cfg, logger) {
|
|
40335
|
+
if (!cfg.grpcEndpoint) {
|
|
40336
|
+
return;
|
|
40337
|
+
}
|
|
40338
|
+
if (cfg.grpcEndpointTlsMode !== void 0 && !isTlsModeValid(cfg.grpcEndpointTlsMode)) {
|
|
40339
|
+
throw new Error(
|
|
40340
|
+
`LibraVDB: invalid grpcEndpointTlsMode "${cfg.grpcEndpointTlsMode}" \u2014 must be "auto", "tls", or "insecure"`
|
|
40341
|
+
);
|
|
40342
|
+
}
|
|
40343
|
+
const hasClientCert = cfg.grpcEndpointTlsClientCert !== void 0;
|
|
40344
|
+
const hasClientKey = cfg.grpcEndpointTlsClientKey !== void 0;
|
|
40345
|
+
if (hasClientCert !== hasClientKey) {
|
|
40346
|
+
throw new Error(
|
|
40347
|
+
"LibraVDB: grpcEndpointTlsClientCert and grpcEndpointTlsClientKey must both be set or both be omitted"
|
|
40348
|
+
);
|
|
40349
|
+
}
|
|
40350
|
+
if (cfg.grpcEndpointTlsMode === "insecure") {
|
|
40351
|
+
if (cfg.grpcEndpointTlsCa) {
|
|
40352
|
+
logger.warn?.(
|
|
40353
|
+
`LibraVDB: grpcEndpointTlsCa is set but grpcEndpointTlsMode is "insecure" \u2014 the CA file will not be used`
|
|
40354
|
+
);
|
|
40355
|
+
}
|
|
40356
|
+
if (cfg.grpcEndpointTlsClientCert) {
|
|
40357
|
+
logger.warn?.(
|
|
40358
|
+
`LibraVDB: grpcEndpointTlsClientCert is set but grpcEndpointTlsMode is "insecure" \u2014 client certificate will not be sent`
|
|
40359
|
+
);
|
|
40360
|
+
}
|
|
40361
|
+
}
|
|
40362
|
+
}
|
|
40359
40363
|
function loadSecretFromEnv() {
|
|
40360
40364
|
const secret = process.env.LIBRAVDB_AUTH_SECRET;
|
|
40361
40365
|
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/openclaw.plugin.json
CHANGED