@xdarkicex/openclaw-memory-libravdb 1.4.43 → 1.4.45
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 +15 -4
- package/dist/dream-routing.d.ts +1 -1
- package/dist/dream-routing.js +25 -4
- package/dist/identity.d.ts +3 -0
- package/dist/identity.js +3 -0
- package/dist/index.js +137 -108
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createInterface } from "node:readline/promises";
|
|
|
2
2
|
import { stdin, stdout } from "node:process";
|
|
3
3
|
import { MEMORY_CLI_DESCRIPTOR, isMemorySlotSelected } from "./cli-descriptors.js";
|
|
4
4
|
import { resolveDurableNamespace } from "./memory-scopes.js";
|
|
5
|
+
import { resolveIdentity } from "./identity.js";
|
|
5
6
|
import { promoteDreamDiaryFile } from "./dream-promotion.js";
|
|
6
7
|
import { buildMemoryRuntimeBridge } from "./memory-runtime.js";
|
|
7
8
|
export function registerMemoryCli(api, runtime, cfg, logger = console) {
|
|
@@ -143,7 +144,7 @@ async function runStatus(runtime, cfg, logger, opts = {}) {
|
|
|
143
144
|
try {
|
|
144
145
|
const rpc = await runtime.getRpc();
|
|
145
146
|
const status = await rpc.call("status", {});
|
|
146
|
-
const deep = opts.deep ? await runDeepStatusProbe(rpc) : undefined;
|
|
147
|
+
const deep = opts.deep ? await runDeepStatusProbe(rpc, cfg) : undefined;
|
|
147
148
|
if (opts.json) {
|
|
148
149
|
console.log(JSON.stringify({ status, ...(deep ? { deep } : {}) }, null, 2));
|
|
149
150
|
if (deep && !deep.ok) {
|
|
@@ -192,10 +193,20 @@ async function runStatus(runtime, cfg, logger, opts = {}) {
|
|
|
192
193
|
process.exitCode = 1;
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
|
-
const
|
|
196
|
-
async function runDeepStatusProbe(rpc) {
|
|
196
|
+
const AUTHORED_STATUS_COLLECTIONS = ["authored:hard", "authored:soft", "authored:variant"];
|
|
197
|
+
async function runDeepStatusProbe(rpc, cfg) {
|
|
198
|
+
// Resolve userId without triggering auto-derive file writes.
|
|
199
|
+
// status --deep should be read-only; if no userId is configured and no
|
|
200
|
+
// identity file exists, fall back to "default" rather than creating one.
|
|
201
|
+
const { userId } = resolveIdentity({
|
|
202
|
+
configUserId: cfg.userId,
|
|
203
|
+
identityPath: cfg.identityPath,
|
|
204
|
+
noAutoPersist: true,
|
|
205
|
+
});
|
|
206
|
+
const durableCollections = [`user:${userId}`, "global"];
|
|
207
|
+
const allCollections = [...AUTHORED_STATUS_COLLECTIONS, ...durableCollections];
|
|
197
208
|
const probes = [];
|
|
198
|
-
for (const collection of
|
|
209
|
+
for (const collection of allCollections) {
|
|
199
210
|
try {
|
|
200
211
|
const result = await rpc.call("search_text", {
|
|
201
212
|
collection,
|
package/dist/dream-routing.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface DreamQuerySignal {
|
|
2
2
|
active: boolean;
|
|
3
|
-
matchedPatterns: string[];
|
|
3
|
+
matchedPatterns: readonly string[];
|
|
4
4
|
}
|
|
5
5
|
export declare function detectDreamQuerySignal(queryText: string): DreamQuerySignal;
|
|
6
6
|
export declare function resolveDreamCollection(userId: string): string;
|
package/dist/dream-routing.js
CHANGED
|
@@ -3,27 +3,48 @@ const DREAM_PATTERN_RULES = [
|
|
|
3
3
|
{
|
|
4
4
|
label: "dream",
|
|
5
5
|
patterns: [
|
|
6
|
-
|
|
6
|
+
// Direct questions about dreams / dreaming (memory-recall intent)
|
|
7
7
|
/\btell\s+me\s+about\s+(?:your\s+)?dreams?\b/i,
|
|
8
8
|
/\bwhat\s+did\s+i\s+dream\s+about\b/i,
|
|
9
9
|
/\bwhat\s+was\s+i\s+dreaming\s+about\b/i,
|
|
10
|
+
/\b(?:do\s+you\s+)?remember\s+(?:\w+\s+)?(?:the\s+)?dreams?\b/i,
|
|
11
|
+
/\brecall\s+(?:\w+\s+)?(?:the\s+)?dreams?\b/i,
|
|
12
|
+
/\bhad\s+a\s+dream\b/i,
|
|
13
|
+
/\bdreams?\s+(?:about|from|last|this|yesterday|recent)\b/i,
|
|
14
|
+
/\bdream(?:ed|ing)\s+about\b/i,
|
|
15
|
+
/\bdream\s+diary\b/i,
|
|
16
|
+
/\bdream\s+(?:journal|log|record|recall|memory|memories)\b/i,
|
|
10
17
|
],
|
|
11
18
|
},
|
|
12
19
|
];
|
|
20
|
+
/** Phrases that contain "dream" but are idiomatic (not memory-recall intent). */
|
|
21
|
+
const DREAM_FALSE_POSITIVE_PATTERNS = [
|
|
22
|
+
/\bpipe\s+dreams?\b/i,
|
|
23
|
+
/\bdream\s+team\b/i,
|
|
24
|
+
/\bamerican\s+dream\b/i,
|
|
25
|
+
/\bdream\s+(?:house|home|car|wedding|vacation|job|school)\b/i,
|
|
26
|
+
/\bin\s+(?:my|our|your)\s+dreams\b/i,
|
|
27
|
+
];
|
|
13
28
|
const DREAM_MATCHED_PATTERNS = ["dream"];
|
|
14
|
-
const EMPTY_MATCHED_PATTERNS = [];
|
|
15
29
|
export function detectDreamQuerySignal(queryText) {
|
|
16
30
|
for (const rule of DREAM_PATTERN_RULES) {
|
|
17
31
|
if (rule.patterns.some((pattern) => pattern.test(queryText))) {
|
|
32
|
+
// Reject known idiomatic false positives that slip through.
|
|
33
|
+
if (DREAM_FALSE_POSITIVE_PATTERNS.some((p) => p.test(queryText))) {
|
|
34
|
+
return {
|
|
35
|
+
active: false,
|
|
36
|
+
matchedPatterns: [],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
18
39
|
return {
|
|
19
40
|
active: true,
|
|
20
|
-
matchedPatterns: DREAM_MATCHED_PATTERNS,
|
|
41
|
+
matchedPatterns: [...DREAM_MATCHED_PATTERNS],
|
|
21
42
|
};
|
|
22
43
|
}
|
|
23
44
|
}
|
|
24
45
|
return {
|
|
25
46
|
active: false,
|
|
26
|
-
matchedPatterns:
|
|
47
|
+
matchedPatterns: [],
|
|
27
48
|
};
|
|
28
49
|
}
|
|
29
50
|
export function resolveDreamCollection(userId) {
|
package/dist/identity.d.ts
CHANGED
|
@@ -9,4 +9,7 @@ export declare function resolveIdentity(params: {
|
|
|
9
9
|
identityPath?: string;
|
|
10
10
|
sessionKey?: string;
|
|
11
11
|
logger?: LoggerLike;
|
|
12
|
+
/** When true, skip writing the auto-derived identity file. Useful for
|
|
13
|
+
* read-only commands (e.g. status --deep) that should not mutate disk. */
|
|
14
|
+
noAutoPersist?: boolean;
|
|
12
15
|
}): ResolvedIdentity;
|
package/dist/identity.js
CHANGED
|
@@ -96,6 +96,9 @@ export function resolveIdentity(params) {
|
|
|
96
96
|
return { userId: "default", source: "default" };
|
|
97
97
|
}
|
|
98
98
|
const autoId = deriveAutoId(parts);
|
|
99
|
+
if (params.noAutoPersist) {
|
|
100
|
+
return { userId: autoId, source: "auto" };
|
|
101
|
+
}
|
|
99
102
|
try {
|
|
100
103
|
writeIdentityFile(filePath, autoId, parts);
|
|
101
104
|
params.logger?.info?.(`LibraVDB: auto-derived identity "${autoId}" written to ${filePath}`);
|
package/dist/index.js
CHANGED
|
@@ -32179,6 +32179,108 @@ function firstNonEmpty(value) {
|
|
|
32179
32179
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
32180
32180
|
}
|
|
32181
32181
|
|
|
32182
|
+
// src/identity.ts
|
|
32183
|
+
import { userInfo, hostname } from "node:os";
|
|
32184
|
+
import { createHash } from "node:crypto";
|
|
32185
|
+
import {
|
|
32186
|
+
existsSync,
|
|
32187
|
+
readFileSync,
|
|
32188
|
+
writeFileSync,
|
|
32189
|
+
renameSync,
|
|
32190
|
+
mkdirSync
|
|
32191
|
+
} from "node:fs";
|
|
32192
|
+
import { join, dirname } from "node:path";
|
|
32193
|
+
function resolveIdentityPath(configuredPath) {
|
|
32194
|
+
if (configuredPath) return configuredPath;
|
|
32195
|
+
const stateDir = process.env.OPENCLAW_STATE_DIR?.trim();
|
|
32196
|
+
if (stateDir) return join(stateDir, "libravdb-identity.json");
|
|
32197
|
+
const home = userInfo().homedir;
|
|
32198
|
+
return join(home, ".openclaw", "libravdb-identity.json");
|
|
32199
|
+
}
|
|
32200
|
+
function deriveIdentityParts() {
|
|
32201
|
+
let username;
|
|
32202
|
+
let home;
|
|
32203
|
+
try {
|
|
32204
|
+
const info = userInfo();
|
|
32205
|
+
username = info.username;
|
|
32206
|
+
home = info.homedir;
|
|
32207
|
+
} catch {
|
|
32208
|
+
username = process.env.USER || process.env.USERNAME || process.env.LOGNAME || "anon";
|
|
32209
|
+
home = process.env.HOME || process.env.USERPROFILE || "unknown";
|
|
32210
|
+
}
|
|
32211
|
+
const host = hostname();
|
|
32212
|
+
const homeHash = createHash("sha256").update(home.replace(/\\/g, "/").toLowerCase()).digest("hex").slice(0, 8);
|
|
32213
|
+
return { username, host, home, homeHash };
|
|
32214
|
+
}
|
|
32215
|
+
function deriveAutoId(parts) {
|
|
32216
|
+
return `${parts.username}@${parts.host}#${parts.homeHash}`;
|
|
32217
|
+
}
|
|
32218
|
+
function writeIdentityFile(path5, userId, parts) {
|
|
32219
|
+
const identity = {
|
|
32220
|
+
userId,
|
|
32221
|
+
derivedFrom: {
|
|
32222
|
+
username: parts.username,
|
|
32223
|
+
hostname: parts.host,
|
|
32224
|
+
homeHash: parts.homeHash,
|
|
32225
|
+
platform: process.platform
|
|
32226
|
+
},
|
|
32227
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
32228
|
+
};
|
|
32229
|
+
const dir = dirname(path5);
|
|
32230
|
+
mkdirSync(dir, { recursive: true });
|
|
32231
|
+
const tmp = `${path5}.${process.pid}.${Math.random().toString(36).slice(2, 8)}.tmp`;
|
|
32232
|
+
writeFileSync(tmp, JSON.stringify(identity, null, 2) + "\n");
|
|
32233
|
+
renameSync(tmp, path5);
|
|
32234
|
+
}
|
|
32235
|
+
function resolveIdentity(params) {
|
|
32236
|
+
const configUserId = params.configUserId?.trim();
|
|
32237
|
+
if (configUserId) {
|
|
32238
|
+
return { userId: configUserId, source: "config" };
|
|
32239
|
+
}
|
|
32240
|
+
const filePath = resolveIdentityPath(params.identityPath);
|
|
32241
|
+
if (existsSync(filePath)) {
|
|
32242
|
+
try {
|
|
32243
|
+
const raw = readFileSync(filePath, "utf8");
|
|
32244
|
+
const parsed = JSON.parse(raw);
|
|
32245
|
+
if (parsed.userId && typeof parsed.userId === "string") {
|
|
32246
|
+
const trimmed = parsed.userId.trim();
|
|
32247
|
+
if (trimmed.length > 0) {
|
|
32248
|
+
return { userId: trimmed, source: "file" };
|
|
32249
|
+
}
|
|
32250
|
+
}
|
|
32251
|
+
} catch (error) {
|
|
32252
|
+
params.logger?.warn?.(
|
|
32253
|
+
`LibraVDB: failed to read identity file at ${filePath}: ${error instanceof Error ? error.message : String(error)}`
|
|
32254
|
+
);
|
|
32255
|
+
}
|
|
32256
|
+
}
|
|
32257
|
+
let parts;
|
|
32258
|
+
try {
|
|
32259
|
+
parts = deriveIdentityParts();
|
|
32260
|
+
} catch {
|
|
32261
|
+
const fallback = params.sessionKey?.trim();
|
|
32262
|
+
if (fallback) {
|
|
32263
|
+
return { userId: `session-key:${fallback}`, source: "session-key" };
|
|
32264
|
+
}
|
|
32265
|
+
return { userId: "default", source: "default" };
|
|
32266
|
+
}
|
|
32267
|
+
const autoId = deriveAutoId(parts);
|
|
32268
|
+
if (params.noAutoPersist) {
|
|
32269
|
+
return { userId: autoId, source: "auto" };
|
|
32270
|
+
}
|
|
32271
|
+
try {
|
|
32272
|
+
writeIdentityFile(filePath, autoId, parts);
|
|
32273
|
+
params.logger?.info?.(
|
|
32274
|
+
`LibraVDB: auto-derived identity "${autoId}" written to ${filePath}`
|
|
32275
|
+
);
|
|
32276
|
+
} catch (error) {
|
|
32277
|
+
params.logger?.warn?.(
|
|
32278
|
+
`LibraVDB: failed to persist identity file at ${filePath}: ${error instanceof Error ? error.message : String(error)}`
|
|
32279
|
+
);
|
|
32280
|
+
}
|
|
32281
|
+
return { userId: autoId, source: "auto" };
|
|
32282
|
+
}
|
|
32283
|
+
|
|
32182
32284
|
// src/dream-promotion.ts
|
|
32183
32285
|
import fs from "node:fs";
|
|
32184
32286
|
import fsp from "node:fs/promises";
|
|
@@ -32748,132 +32850,52 @@ function formatError(error) {
|
|
|
32748
32850
|
}
|
|
32749
32851
|
var textDecoder = new TextDecoder();
|
|
32750
32852
|
|
|
32751
|
-
// src/identity.ts
|
|
32752
|
-
import { userInfo, hostname } from "node:os";
|
|
32753
|
-
import { createHash } from "node:crypto";
|
|
32754
|
-
import {
|
|
32755
|
-
existsSync,
|
|
32756
|
-
readFileSync,
|
|
32757
|
-
writeFileSync,
|
|
32758
|
-
renameSync,
|
|
32759
|
-
mkdirSync
|
|
32760
|
-
} from "node:fs";
|
|
32761
|
-
import { join, dirname } from "node:path";
|
|
32762
|
-
function resolveIdentityPath(configuredPath) {
|
|
32763
|
-
if (configuredPath) return configuredPath;
|
|
32764
|
-
const stateDir = process.env.OPENCLAW_STATE_DIR?.trim();
|
|
32765
|
-
if (stateDir) return join(stateDir, "libravdb-identity.json");
|
|
32766
|
-
const home = userInfo().homedir;
|
|
32767
|
-
return join(home, ".openclaw", "libravdb-identity.json");
|
|
32768
|
-
}
|
|
32769
|
-
function deriveIdentityParts() {
|
|
32770
|
-
let username;
|
|
32771
|
-
let home;
|
|
32772
|
-
try {
|
|
32773
|
-
const info = userInfo();
|
|
32774
|
-
username = info.username;
|
|
32775
|
-
home = info.homedir;
|
|
32776
|
-
} catch {
|
|
32777
|
-
username = process.env.USER || process.env.USERNAME || process.env.LOGNAME || "anon";
|
|
32778
|
-
home = process.env.HOME || process.env.USERPROFILE || "unknown";
|
|
32779
|
-
}
|
|
32780
|
-
const host = hostname();
|
|
32781
|
-
const homeHash = createHash("sha256").update(home.replace(/\\/g, "/").toLowerCase()).digest("hex").slice(0, 8);
|
|
32782
|
-
return { username, host, home, homeHash };
|
|
32783
|
-
}
|
|
32784
|
-
function deriveAutoId(parts) {
|
|
32785
|
-
return `${parts.username}@${parts.host}#${parts.homeHash}`;
|
|
32786
|
-
}
|
|
32787
|
-
function writeIdentityFile(path5, userId, parts) {
|
|
32788
|
-
const identity = {
|
|
32789
|
-
userId,
|
|
32790
|
-
derivedFrom: {
|
|
32791
|
-
username: parts.username,
|
|
32792
|
-
hostname: parts.host,
|
|
32793
|
-
homeHash: parts.homeHash,
|
|
32794
|
-
platform: process.platform
|
|
32795
|
-
},
|
|
32796
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
32797
|
-
};
|
|
32798
|
-
const dir = dirname(path5);
|
|
32799
|
-
mkdirSync(dir, { recursive: true });
|
|
32800
|
-
const tmp = `${path5}.${process.pid}.${Math.random().toString(36).slice(2, 8)}.tmp`;
|
|
32801
|
-
writeFileSync(tmp, JSON.stringify(identity, null, 2) + "\n");
|
|
32802
|
-
renameSync(tmp, path5);
|
|
32803
|
-
}
|
|
32804
|
-
function resolveIdentity(params) {
|
|
32805
|
-
const configUserId = params.configUserId?.trim();
|
|
32806
|
-
if (configUserId) {
|
|
32807
|
-
return { userId: configUserId, source: "config" };
|
|
32808
|
-
}
|
|
32809
|
-
const filePath = resolveIdentityPath(params.identityPath);
|
|
32810
|
-
if (existsSync(filePath)) {
|
|
32811
|
-
try {
|
|
32812
|
-
const raw = readFileSync(filePath, "utf8");
|
|
32813
|
-
const parsed = JSON.parse(raw);
|
|
32814
|
-
if (parsed.userId && typeof parsed.userId === "string") {
|
|
32815
|
-
const trimmed = parsed.userId.trim();
|
|
32816
|
-
if (trimmed.length > 0) {
|
|
32817
|
-
return { userId: trimmed, source: "file" };
|
|
32818
|
-
}
|
|
32819
|
-
}
|
|
32820
|
-
} catch (error) {
|
|
32821
|
-
params.logger?.warn?.(
|
|
32822
|
-
`LibraVDB: failed to read identity file at ${filePath}: ${error instanceof Error ? error.message : String(error)}`
|
|
32823
|
-
);
|
|
32824
|
-
}
|
|
32825
|
-
}
|
|
32826
|
-
let parts;
|
|
32827
|
-
try {
|
|
32828
|
-
parts = deriveIdentityParts();
|
|
32829
|
-
} catch {
|
|
32830
|
-
const fallback = params.sessionKey?.trim();
|
|
32831
|
-
if (fallback) {
|
|
32832
|
-
return { userId: `session-key:${fallback}`, source: "session-key" };
|
|
32833
|
-
}
|
|
32834
|
-
return { userId: "default", source: "default" };
|
|
32835
|
-
}
|
|
32836
|
-
const autoId = deriveAutoId(parts);
|
|
32837
|
-
try {
|
|
32838
|
-
writeIdentityFile(filePath, autoId, parts);
|
|
32839
|
-
params.logger?.info?.(
|
|
32840
|
-
`LibraVDB: auto-derived identity "${autoId}" written to ${filePath}`
|
|
32841
|
-
);
|
|
32842
|
-
} catch (error) {
|
|
32843
|
-
params.logger?.warn?.(
|
|
32844
|
-
`LibraVDB: failed to persist identity file at ${filePath}: ${error instanceof Error ? error.message : String(error)}`
|
|
32845
|
-
);
|
|
32846
|
-
}
|
|
32847
|
-
return { userId: autoId, source: "auto" };
|
|
32848
|
-
}
|
|
32849
|
-
|
|
32850
32853
|
// src/dream-routing.ts
|
|
32851
32854
|
var DREAM_COLLECTION_PREFIX = "dream:";
|
|
32852
32855
|
var DREAM_PATTERN_RULES = [
|
|
32853
32856
|
{
|
|
32854
32857
|
label: "dream",
|
|
32855
32858
|
patterns: [
|
|
32856
|
-
|
|
32859
|
+
// Direct questions about dreams / dreaming (memory-recall intent)
|
|
32857
32860
|
/\btell\s+me\s+about\s+(?:your\s+)?dreams?\b/i,
|
|
32858
32861
|
/\bwhat\s+did\s+i\s+dream\s+about\b/i,
|
|
32859
|
-
/\bwhat\s+was\s+i\s+dreaming\s+about\b/i
|
|
32862
|
+
/\bwhat\s+was\s+i\s+dreaming\s+about\b/i,
|
|
32863
|
+
/\b(?:do\s+you\s+)?remember\s+(?:\w+\s+)?(?:the\s+)?dreams?\b/i,
|
|
32864
|
+
/\brecall\s+(?:\w+\s+)?(?:the\s+)?dreams?\b/i,
|
|
32865
|
+
/\bhad\s+a\s+dream\b/i,
|
|
32866
|
+
/\bdreams?\s+(?:about|from|last|this|yesterday|recent)\b/i,
|
|
32867
|
+
/\bdream(?:ed|ing)\s+about\b/i,
|
|
32868
|
+
/\bdream\s+diary\b/i,
|
|
32869
|
+
/\bdream\s+(?:journal|log|record|recall|memory|memories)\b/i
|
|
32860
32870
|
]
|
|
32861
32871
|
}
|
|
32862
32872
|
];
|
|
32873
|
+
var DREAM_FALSE_POSITIVE_PATTERNS = [
|
|
32874
|
+
/\bpipe\s+dreams?\b/i,
|
|
32875
|
+
/\bdream\s+team\b/i,
|
|
32876
|
+
/\bamerican\s+dream\b/i,
|
|
32877
|
+
/\bdream\s+(?:house|home|car|wedding|vacation|job|school)\b/i,
|
|
32878
|
+
/\bin\s+(?:my|our|your)\s+dreams\b/i
|
|
32879
|
+
];
|
|
32863
32880
|
var DREAM_MATCHED_PATTERNS = ["dream"];
|
|
32864
|
-
var EMPTY_MATCHED_PATTERNS = [];
|
|
32865
32881
|
function detectDreamQuerySignal(queryText) {
|
|
32866
32882
|
for (const rule of DREAM_PATTERN_RULES) {
|
|
32867
32883
|
if (rule.patterns.some((pattern) => pattern.test(queryText))) {
|
|
32884
|
+
if (DREAM_FALSE_POSITIVE_PATTERNS.some((p) => p.test(queryText))) {
|
|
32885
|
+
return {
|
|
32886
|
+
active: false,
|
|
32887
|
+
matchedPatterns: []
|
|
32888
|
+
};
|
|
32889
|
+
}
|
|
32868
32890
|
return {
|
|
32869
32891
|
active: true,
|
|
32870
|
-
matchedPatterns: DREAM_MATCHED_PATTERNS
|
|
32892
|
+
matchedPatterns: [...DREAM_MATCHED_PATTERNS]
|
|
32871
32893
|
};
|
|
32872
32894
|
}
|
|
32873
32895
|
}
|
|
32874
32896
|
return {
|
|
32875
32897
|
active: false,
|
|
32876
|
-
matchedPatterns:
|
|
32898
|
+
matchedPatterns: []
|
|
32877
32899
|
};
|
|
32878
32900
|
}
|
|
32879
32901
|
function resolveDreamCollection(userId) {
|
|
@@ -33223,7 +33245,7 @@ async function runStatus(runtime, cfg, logger, opts = {}) {
|
|
|
33223
33245
|
try {
|
|
33224
33246
|
const rpc = await runtime.getRpc();
|
|
33225
33247
|
const status = await rpc.call("status", {});
|
|
33226
|
-
const deep = opts.deep ? await runDeepStatusProbe(rpc) : void 0;
|
|
33248
|
+
const deep = opts.deep ? await runDeepStatusProbe(rpc, cfg) : void 0;
|
|
33227
33249
|
if (opts.json) {
|
|
33228
33250
|
console.log(JSON.stringify({ status, ...deep ? { deep } : {} }, null, 2));
|
|
33229
33251
|
if (deep && !deep.ok) {
|
|
@@ -33277,10 +33299,17 @@ async function runStatus(runtime, cfg, logger, opts = {}) {
|
|
|
33277
33299
|
process.exitCode = 1;
|
|
33278
33300
|
}
|
|
33279
33301
|
}
|
|
33280
|
-
var
|
|
33281
|
-
async function runDeepStatusProbe(rpc) {
|
|
33302
|
+
var AUTHORED_STATUS_COLLECTIONS = ["authored:hard", "authored:soft", "authored:variant"];
|
|
33303
|
+
async function runDeepStatusProbe(rpc, cfg) {
|
|
33304
|
+
const { userId } = resolveIdentity({
|
|
33305
|
+
configUserId: cfg.userId,
|
|
33306
|
+
identityPath: cfg.identityPath,
|
|
33307
|
+
noAutoPersist: true
|
|
33308
|
+
});
|
|
33309
|
+
const durableCollections = [`user:${userId}`, "global"];
|
|
33310
|
+
const allCollections = [...AUTHORED_STATUS_COLLECTIONS, ...durableCollections];
|
|
33282
33311
|
const probes = [];
|
|
33283
|
-
for (const collection of
|
|
33312
|
+
for (const collection of allCollections) {
|
|
33284
33313
|
try {
|
|
33285
33314
|
const result = await rpc.call("search_text", {
|
|
33286
33315
|
collection,
|
package/openclaw.plugin.json
CHANGED