clawvault 3.5.0 → 3.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/README.md +33 -25
- package/bin/command-registration.test.js +179 -0
- package/bin/command-runtime.test.js +154 -0
- package/bin/help-contract.test.js +55 -0
- package/bin/register-config-route-commands.test.js +121 -0
- package/bin/register-core-commands.test.js +80 -0
- package/bin/register-kanban-commands.test.js +83 -0
- package/bin/register-project-commands.test.js +206 -0
- package/bin/register-query-commands.test.js +80 -0
- package/bin/register-resilience-commands.test.js +81 -0
- package/bin/register-task-commands.test.js +69 -0
- package/bin/register-template-commands.test.js +87 -0
- package/bin/test-helpers/cli-command-fixtures.js +120 -0
- package/dashboard/lib/graph-diff.test.js +75 -0
- package/dashboard/lib/vault-parser.test.js +254 -0
- package/dist/{chunk-DCF4KMFD.js → chunk-DPK6P6BO.js} +3 -3
- package/dist/{chunk-BLQXXX7Q.js → chunk-FNFP7N6A.js} +2 -2
- package/dist/{chunk-JI7VUQV7.js → chunk-IFUHSHN3.js} +146 -118
- package/dist/{chunk-QFWERBDP.js → chunk-J6DW6HBX.js} +1 -1
- package/dist/{chunk-VXAGOLDP.js → chunk-LCBHM3D6.js} +1 -1
- package/dist/{chunk-HGDDW24U.js → chunk-NTQD55S3.js} +3 -3
- package/dist/{chunk-QUFQBAHP.js → chunk-P35SHNAU.js} +93 -147
- package/dist/cli/index.js +8 -8
- package/dist/commands/compat.js +1 -1
- package/dist/commands/inject.js +2 -2
- package/dist/commands/maintain.js +2 -2
- package/dist/commands/observe.js +4 -4
- package/dist/commands/rebuild.js +3 -3
- package/dist/commands/replay.js +4 -4
- package/dist/commands/sleep.js +5 -5
- package/dist/commands/status.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -17
- package/dist/{openclaw-plugin--gqA2BZw.d.ts → openclaw-plugin-9M9qCZgl.d.ts} +2 -2
- package/dist/openclaw-plugin.d.ts +1 -1
- package/dist/openclaw-plugin.js +6 -1
- package/package.json +4 -26
- package/CHANGELOG.md +0 -543
- package/SKILL.md +0 -369
- package/docs/clawhub-security-release-playbook.md +0 -75
- package/docs/getting-started/installation.md +0 -99
- package/docs/openclaw-plugin-usage.md +0 -152
- package/dist/{chunk-7SWP5FKU.js → chunk-FSYISBTU.js} +4 -4
- package/dist/{chunk-D5U3Q4N5.js → chunk-IOKLQR4W.js} +4 -4
- package/dist/{chunk-OFOCU2V4.js → chunk-QL34TMGN.js} +3 -3
|
@@ -4,9 +4,6 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
recover
|
|
6
6
|
} from "./chunk-OIWVQYQF.js";
|
|
7
|
-
import {
|
|
8
|
-
formatAge
|
|
9
|
-
} from "./chunk-7ZRP733D.js";
|
|
10
7
|
import {
|
|
11
8
|
buildSessionRecap
|
|
12
9
|
} from "./chunk-ZKGY7WTT.js";
|
|
@@ -17,6 +14,9 @@ import {
|
|
|
17
14
|
import {
|
|
18
15
|
synthesizeEntityProfiles
|
|
19
16
|
} from "./chunk-NSXYM6EZ.js";
|
|
17
|
+
import {
|
|
18
|
+
runReflection
|
|
19
|
+
} from "./chunk-TWMI3SNN.js";
|
|
20
20
|
import {
|
|
21
21
|
normalizeForDedup,
|
|
22
22
|
similarityScore
|
|
@@ -861,66 +861,6 @@ function formatSessionContextInjection(recapEntries, memoryEntries) {
|
|
|
861
861
|
function resolveVaultPathForAgent(pluginConfig, options = {}) {
|
|
862
862
|
return findVaultPath(pluginConfig, options);
|
|
863
863
|
}
|
|
864
|
-
function runClawvault(args, pluginConfig, options = {}) {
|
|
865
|
-
if (!isOptInEnabled(pluginConfig, "allowClawvaultExec")) {
|
|
866
|
-
return {
|
|
867
|
-
success: false,
|
|
868
|
-
skipped: true,
|
|
869
|
-
output: "ClawVault CLI execution is disabled. Set allowClawvaultExec=true to enable.",
|
|
870
|
-
code: 0
|
|
871
|
-
};
|
|
872
|
-
}
|
|
873
|
-
const timeoutMs = Number.isFinite(options.timeoutMs) ? Math.max(1e3, Number(options.timeoutMs)) : 15e3;
|
|
874
|
-
const executablePath = resolveExecutablePath(CLAWVAULT_EXECUTABLE, {
|
|
875
|
-
explicitPath: getConfiguredExecutablePath(pluginConfig)
|
|
876
|
-
});
|
|
877
|
-
if (!executablePath) {
|
|
878
|
-
return {
|
|
879
|
-
success: false,
|
|
880
|
-
output: "Unable to resolve clawvault executable path.",
|
|
881
|
-
code: 1
|
|
882
|
-
};
|
|
883
|
-
}
|
|
884
|
-
const expectedSha256 = getConfiguredExecutableSha256(pluginConfig);
|
|
885
|
-
const integrityResult = verifyExecutableIntegrity(executablePath, expectedSha256);
|
|
886
|
-
if (!integrityResult.ok) {
|
|
887
|
-
return {
|
|
888
|
-
success: false,
|
|
889
|
-
output: `Executable integrity verification failed for ${executablePath}.`,
|
|
890
|
-
code: 1
|
|
891
|
-
};
|
|
892
|
-
}
|
|
893
|
-
let sanitizedArgs;
|
|
894
|
-
try {
|
|
895
|
-
sanitizedArgs = sanitizeExecArgs(args);
|
|
896
|
-
} catch (error) {
|
|
897
|
-
return {
|
|
898
|
-
success: false,
|
|
899
|
-
output: error instanceof Error ? error.message : "Invalid command arguments",
|
|
900
|
-
code: 1
|
|
901
|
-
};
|
|
902
|
-
}
|
|
903
|
-
try {
|
|
904
|
-
const output = execFileSync(executablePath, sanitizedArgs, {
|
|
905
|
-
encoding: "utf-8",
|
|
906
|
-
timeout: timeoutMs,
|
|
907
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
908
|
-
shell: false
|
|
909
|
-
});
|
|
910
|
-
return {
|
|
911
|
-
success: true,
|
|
912
|
-
output: output.trim(),
|
|
913
|
-
code: 0
|
|
914
|
-
};
|
|
915
|
-
} catch (error) {
|
|
916
|
-
const details = error;
|
|
917
|
-
return {
|
|
918
|
-
success: false,
|
|
919
|
-
output: details.stderr?.toString() || details.message || "unknown error",
|
|
920
|
-
code: details.status || 1
|
|
921
|
-
};
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
864
|
function getObserveCursorPath(vaultPath) {
|
|
925
865
|
return path3.join(vaultPath, ".clawvault", OBSERVE_CURSOR_FILE);
|
|
926
866
|
}
|
|
@@ -1006,10 +946,6 @@ function runObserverCron(vaultPath, agentId, pluginConfig, options = {}) {
|
|
|
1006
946
|
if (!isOptInEnabled(pluginConfig, "allowClawvaultExec")) {
|
|
1007
947
|
return false;
|
|
1008
948
|
}
|
|
1009
|
-
const args = ["observe", "--cron", "--agent", agentId, "-v", vaultPath];
|
|
1010
|
-
if (Number.isFinite(options.minNewBytes) && Number(options.minNewBytes) > 0) {
|
|
1011
|
-
args.push("--min-new", String(Math.floor(Number(options.minNewBytes))));
|
|
1012
|
-
}
|
|
1013
949
|
const executablePath = resolveExecutablePath(CLAWVAULT_EXECUTABLE, {
|
|
1014
950
|
explicitPath: getConfiguredExecutablePath(pluginConfig)
|
|
1015
951
|
});
|
|
@@ -1021,6 +957,10 @@ function runObserverCron(vaultPath, agentId, pluginConfig, options = {}) {
|
|
|
1021
957
|
if (!integrityResult.ok) {
|
|
1022
958
|
return false;
|
|
1023
959
|
}
|
|
960
|
+
const args = ["observe", "--cron", "--agent", agentId, "-v", vaultPath];
|
|
961
|
+
if (Number.isFinite(options.minNewBytes) && Number(options.minNewBytes) > 0) {
|
|
962
|
+
args.push("--min-new", String(Math.floor(Number(options.minNewBytes))));
|
|
963
|
+
}
|
|
1024
964
|
let sanitizedArgs;
|
|
1025
965
|
try {
|
|
1026
966
|
sanitizedArgs = sanitizeExecArgs(args);
|
|
@@ -1029,12 +969,9 @@ function runObserverCron(vaultPath, agentId, pluginConfig, options = {}) {
|
|
|
1029
969
|
}
|
|
1030
970
|
try {
|
|
1031
971
|
const child = spawn(executablePath, sanitizedArgs, {
|
|
1032
|
-
detached: process.platform !== "win32",
|
|
1033
972
|
stdio: "ignore",
|
|
1034
973
|
shell: false
|
|
1035
974
|
});
|
|
1036
|
-
child.on("error", () => {
|
|
1037
|
-
});
|
|
1038
975
|
child.unref();
|
|
1039
976
|
return true;
|
|
1040
977
|
} catch {
|
|
@@ -1115,8 +1052,8 @@ function toSafeFilePath(vaultPath, relPath) {
|
|
|
1115
1052
|
if (!mapped || mapped.includes("..")) {
|
|
1116
1053
|
throw new Error("Invalid memory path");
|
|
1117
1054
|
}
|
|
1118
|
-
if (!mapped.
|
|
1119
|
-
throw new Error("memory_get only allows
|
|
1055
|
+
if (mapped !== "MEMORY.md" && !mapped.startsWith("memory/")) {
|
|
1056
|
+
throw new Error("memory_get only allows MEMORY.md or memory/* paths");
|
|
1120
1057
|
}
|
|
1121
1058
|
const absolute = path4.resolve(vaultPath, mapped);
|
|
1122
1059
|
const vaultRootWithSep = vaultPath.endsWith(path4.sep) ? vaultPath : `${vaultPath}${path4.sep}`;
|
|
@@ -1243,17 +1180,8 @@ function buildToolSchema(properties, required = []) {
|
|
|
1243
1180
|
additionalProperties: false
|
|
1244
1181
|
};
|
|
1245
1182
|
}
|
|
1246
|
-
function resolveToolInput(toolCallIdOrInput, maybeInput) {
|
|
1247
|
-
if (maybeInput && typeof maybeInput === "object" && !Array.isArray(maybeInput)) {
|
|
1248
|
-
return maybeInput;
|
|
1249
|
-
}
|
|
1250
|
-
if (toolCallIdOrInput && typeof toolCallIdOrInput === "object" && !Array.isArray(toolCallIdOrInput)) {
|
|
1251
|
-
return toolCallIdOrInput;
|
|
1252
|
-
}
|
|
1253
|
-
return {};
|
|
1254
|
-
}
|
|
1255
1183
|
function createMemorySearchToolFactory(memoryManager) {
|
|
1256
|
-
return (
|
|
1184
|
+
return () => {
|
|
1257
1185
|
const inputSchema = buildToolSchema({
|
|
1258
1186
|
query: {
|
|
1259
1187
|
type: "string",
|
|
@@ -1276,8 +1204,7 @@ function createMemorySearchToolFactory(memoryManager) {
|
|
|
1276
1204
|
description: "Optional OpenClaw session key for scoped recall."
|
|
1277
1205
|
}
|
|
1278
1206
|
}, ["query"]);
|
|
1279
|
-
const execute = async (
|
|
1280
|
-
const input = resolveToolInput(toolCallIdOrInput, maybeInput);
|
|
1207
|
+
const execute = async (input) => {
|
|
1281
1208
|
const query = typeof input.query === "string" ? input.query : "";
|
|
1282
1209
|
if (!query.trim()) {
|
|
1283
1210
|
return { query, count: 0, results: [] };
|
|
@@ -1294,7 +1221,6 @@ function createMemorySearchToolFactory(memoryManager) {
|
|
|
1294
1221
|
};
|
|
1295
1222
|
};
|
|
1296
1223
|
return {
|
|
1297
|
-
label: "Memory Search",
|
|
1298
1224
|
name: "memory_search",
|
|
1299
1225
|
description: "Search ClawVault memory for relevant snippets before answering.",
|
|
1300
1226
|
inputSchema,
|
|
@@ -1307,15 +1233,11 @@ function createMemorySearchToolFactory(memoryManager) {
|
|
|
1307
1233
|
};
|
|
1308
1234
|
}
|
|
1309
1235
|
function createMemoryGetToolFactory(memoryManager) {
|
|
1310
|
-
return (
|
|
1236
|
+
return () => {
|
|
1311
1237
|
const inputSchema = buildToolSchema({
|
|
1312
|
-
path: {
|
|
1313
|
-
type: "string",
|
|
1314
|
-
description: "Relative path from memory_search result (for OpenClaw compatibility)."
|
|
1315
|
-
},
|
|
1316
1238
|
relPath: {
|
|
1317
1239
|
type: "string",
|
|
1318
|
-
description: "
|
|
1240
|
+
description: "Relative path from memory_search result (e.g. memory/2026-01-01.md)."
|
|
1319
1241
|
},
|
|
1320
1242
|
from: {
|
|
1321
1243
|
type: "number",
|
|
@@ -1328,11 +1250,9 @@ function createMemoryGetToolFactory(memoryManager) {
|
|
|
1328
1250
|
maximum: 400,
|
|
1329
1251
|
description: "Optional number of lines to read."
|
|
1330
1252
|
}
|
|
1331
|
-
});
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
const input = resolveToolInput(toolCallIdOrInput, maybeInput);
|
|
1335
|
-
const relPath = typeof input.path === "string" ? input.path : typeof input.relPath === "string" ? input.relPath : "";
|
|
1253
|
+
}, ["relPath"]);
|
|
1254
|
+
const execute = async (input) => {
|
|
1255
|
+
const relPath = typeof input.relPath === "string" ? input.relPath : "";
|
|
1336
1256
|
if (!relPath.trim()) {
|
|
1337
1257
|
return { path: relPath, text: "" };
|
|
1338
1258
|
}
|
|
@@ -1343,7 +1263,6 @@ function createMemoryGetToolFactory(memoryManager) {
|
|
|
1343
1263
|
});
|
|
1344
1264
|
};
|
|
1345
1265
|
return {
|
|
1346
|
-
label: "Memory Get",
|
|
1347
1266
|
name: "memory_get",
|
|
1348
1267
|
description: "Read a specific memory file or line range from ClawVault.",
|
|
1349
1268
|
inputSchema,
|
|
@@ -1471,45 +1390,76 @@ function rewriteQuestionWithMemoryEvidence(originalContent, memoryHits) {
|
|
|
1471
1390
|
import * as path5 from "path";
|
|
1472
1391
|
var DEFAULT_MAX_CONTEXT_RESULTS = 4;
|
|
1473
1392
|
var DEFAULT_MAX_RECAP_RESULTS = 6;
|
|
1474
|
-
var
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1393
|
+
var DEFAULT_MIN_SCORE2 = 0.2;
|
|
1394
|
+
var MAX_CONTEXT_SNIPPET_LENGTH = 220;
|
|
1395
|
+
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
1396
|
+
function clamp2(value, min, max) {
|
|
1397
|
+
return Math.max(min, Math.min(max, value));
|
|
1398
|
+
}
|
|
1399
|
+
function truncateContextSnippet(snippet) {
|
|
1400
|
+
const normalized = sanitizeForDisplay(snippet).replace(/\s+/g, " ").trim();
|
|
1401
|
+
if (normalized.length <= MAX_CONTEXT_SNIPPET_LENGTH) {
|
|
1402
|
+
return normalized;
|
|
1479
1403
|
}
|
|
1480
|
-
return
|
|
1404
|
+
return `${normalized.slice(0, MAX_CONTEXT_SNIPPET_LENGTH - 3).trimEnd()}...`;
|
|
1405
|
+
}
|
|
1406
|
+
function toRelativeVaultPath(vaultPath, absolutePath) {
|
|
1407
|
+
const rel = path5.relative(vaultPath, absolutePath).replace(/\\/g, "/");
|
|
1408
|
+
return rel.startsWith(".") ? path5.basename(absolutePath) : rel;
|
|
1481
1409
|
}
|
|
1482
|
-
function
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1410
|
+
function formatAgeLabel(modifiedAt) {
|
|
1411
|
+
const modified = modifiedAt.getTime();
|
|
1412
|
+
if (!Number.isFinite(modified)) {
|
|
1413
|
+
return "unknown age";
|
|
1414
|
+
}
|
|
1415
|
+
const elapsedMs = Date.now() - modified;
|
|
1416
|
+
if (elapsedMs < ONE_DAY_MS) {
|
|
1417
|
+
return "today";
|
|
1418
|
+
}
|
|
1419
|
+
const days = Math.max(1, Math.floor(elapsedMs / ONE_DAY_MS));
|
|
1420
|
+
if (days < 7) {
|
|
1421
|
+
return `${days}d ago`;
|
|
1422
|
+
}
|
|
1423
|
+
const weeks = Math.floor(days / 7);
|
|
1424
|
+
if (weeks < 5) {
|
|
1425
|
+
return `${weeks}w ago`;
|
|
1426
|
+
}
|
|
1427
|
+
const months = Math.floor(days / 30);
|
|
1428
|
+
if (months < 12) {
|
|
1429
|
+
return `${months}mo ago`;
|
|
1430
|
+
}
|
|
1431
|
+
const years = Math.floor(days / 365);
|
|
1432
|
+
return `${years}y ago`;
|
|
1485
1433
|
}
|
|
1486
|
-
function
|
|
1487
|
-
const
|
|
1434
|
+
function mapSearchResultToContextEntry(vaultPath, result) {
|
|
1435
|
+
const snippet = truncateContextSnippet(result.snippet);
|
|
1436
|
+
if (!snippet) {
|
|
1437
|
+
return null;
|
|
1438
|
+
}
|
|
1488
1439
|
return {
|
|
1489
1440
|
title: sanitizeForDisplay(result.document.title || "Untitled"),
|
|
1490
|
-
path: sanitizeForDisplay(
|
|
1491
|
-
age:
|
|
1492
|
-
snippet
|
|
1493
|
-
score: Number.isFinite(
|
|
1441
|
+
path: sanitizeForDisplay(toRelativeVaultPath(vaultPath, result.document.path)),
|
|
1442
|
+
age: formatAgeLabel(result.document.modified),
|
|
1443
|
+
snippet,
|
|
1444
|
+
score: Number.isFinite(result.score) ? result.score : 0
|
|
1494
1445
|
};
|
|
1495
1446
|
}
|
|
1496
|
-
function truncateRecapText(text) {
|
|
1497
|
-
const cleaned = sanitizeForDisplay(text).replace(/\s+/g, " ").trim();
|
|
1498
|
-
if (cleaned.length <= 220) return cleaned;
|
|
1499
|
-
return `${cleaned.slice(0, 217).trimEnd()}...`;
|
|
1500
|
-
}
|
|
1501
1447
|
async function fetchSessionRecapEntries(options) {
|
|
1502
1448
|
const sessionKey = resolveSessionKey(options.sessionKey);
|
|
1503
1449
|
if (!sessionKey) return [];
|
|
1504
1450
|
try {
|
|
1505
1451
|
const recap = await buildSessionRecap(sessionKey, {
|
|
1506
|
-
|
|
1507
|
-
|
|
1452
|
+
agentId: options.agentId,
|
|
1453
|
+
limit: DEFAULT_MAX_RECAP_RESULTS
|
|
1508
1454
|
});
|
|
1509
|
-
return recap.messages.slice(-DEFAULT_MAX_RECAP_RESULTS).map((
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1455
|
+
return recap.messages.slice(-DEFAULT_MAX_RECAP_RESULTS).map((entry) => {
|
|
1456
|
+
const text = sanitizeForDisplay(entry.text);
|
|
1457
|
+
if (!text) return null;
|
|
1458
|
+
return {
|
|
1459
|
+
role: entry.role === "user" ? "User" : "Assistant",
|
|
1460
|
+
text
|
|
1461
|
+
};
|
|
1462
|
+
}).filter((entry) => Boolean(entry));
|
|
1513
1463
|
} catch {
|
|
1514
1464
|
return [];
|
|
1515
1465
|
}
|
|
@@ -1526,19 +1476,17 @@ async function fetchMemoryContextEntries(options) {
|
|
|
1526
1476
|
if (!vaultPath) {
|
|
1527
1477
|
return { entries: [], vaultPath: null };
|
|
1528
1478
|
}
|
|
1529
|
-
const maxResults = Number.isFinite(options.maxResults) ?
|
|
1479
|
+
const maxResults = Number.isFinite(options.maxResults) ? clamp2(Math.floor(Number(options.maxResults)), 1, 20) : DEFAULT_MAX_CONTEXT_RESULTS;
|
|
1530
1480
|
try {
|
|
1531
1481
|
const vault = new ClawVault(vaultPath);
|
|
1532
1482
|
await vault.load();
|
|
1533
|
-
const
|
|
1483
|
+
const matches = await vault.find(prompt, {
|
|
1534
1484
|
limit: maxResults,
|
|
1535
|
-
minScore:
|
|
1485
|
+
minScore: DEFAULT_MIN_SCORE2,
|
|
1536
1486
|
temporalBoost: true
|
|
1537
1487
|
});
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
vaultPath
|
|
1541
|
-
};
|
|
1488
|
+
const entries = matches.map((match) => mapSearchResultToContextEntry(vaultPath, match)).filter((entry) => Boolean(entry));
|
|
1489
|
+
return { entries, vaultPath };
|
|
1542
1490
|
} catch {
|
|
1543
1491
|
return { entries: [], vaultPath };
|
|
1544
1492
|
}
|
|
@@ -1859,13 +1807,13 @@ async function runWeeklyReflectionIfNeeded(deps, agentId, workspaceDir) {
|
|
|
1859
1807
|
if (!vaultPath) {
|
|
1860
1808
|
return;
|
|
1861
1809
|
}
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1810
|
+
try {
|
|
1811
|
+
const result = await runReflection({ vaultPath });
|
|
1812
|
+
if (result.writtenWeeks > 0) {
|
|
1813
|
+
deps.logger?.info("[clawvault] Weekly reflection complete");
|
|
1814
|
+
}
|
|
1866
1815
|
deps.runtimeState.markWeeklyReflectionRun(weekKey);
|
|
1867
|
-
|
|
1868
|
-
} else if (!result.skipped) {
|
|
1816
|
+
} catch {
|
|
1869
1817
|
deps.logger?.warn("[clawvault] Weekly reflection failed");
|
|
1870
1818
|
}
|
|
1871
1819
|
}
|
|
@@ -1879,16 +1827,16 @@ async function handleGatewayStart(event, ctx, deps) {
|
|
|
1879
1827
|
deps.logger?.warn("[clawvault] No vault found, skipping startup recovery");
|
|
1880
1828
|
return;
|
|
1881
1829
|
}
|
|
1882
|
-
let
|
|
1830
|
+
let recoveryInfo;
|
|
1883
1831
|
try {
|
|
1884
|
-
|
|
1832
|
+
recoveryInfo = await recover(vaultPath, { clearFlag: true });
|
|
1885
1833
|
} catch {
|
|
1886
1834
|
deps.logger?.warn("[clawvault] Startup recovery command failed");
|
|
1887
1835
|
return;
|
|
1888
1836
|
}
|
|
1889
|
-
if (
|
|
1890
|
-
const
|
|
1891
|
-
const message =
|
|
1837
|
+
if (recoveryInfo.died) {
|
|
1838
|
+
const workingOn = recoveryInfo.checkpoint?.workingOn?.trim();
|
|
1839
|
+
const message = workingOn ? `[ClawVault] Context death detected. Last working on: ${workingOn}. Run \`clawvault wake\` for full recovery context.` : "[ClawVault] Context death detected. Run `clawvault wake` for full recovery context.";
|
|
1892
1840
|
deps.runtimeState.setStartupRecoveryNotice(message);
|
|
1893
1841
|
deps.logger?.warn("[clawvault] Context death detected at startup");
|
|
1894
1842
|
}
|
|
@@ -2017,7 +1965,7 @@ function isOpenClawPluginApi(value) {
|
|
|
2017
1965
|
const record = value;
|
|
2018
1966
|
return typeof record.on === "function" && typeof record.registerTool === "function" && typeof record.logger === "object";
|
|
2019
1967
|
}
|
|
2020
|
-
|
|
1968
|
+
function registerOpenClawPlugin(api) {
|
|
2021
1969
|
const pluginConfig = readPluginConfig(api);
|
|
2022
1970
|
const runtimeState = new ClawVaultPluginRuntimeState();
|
|
2023
1971
|
const memoryManager = new ClawVaultMemoryManager({
|
|
@@ -2028,10 +1976,8 @@ async function registerOpenClawPlugin(api) {
|
|
|
2028
1976
|
warn: api.logger.warn
|
|
2029
1977
|
}
|
|
2030
1978
|
});
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
api.registerTool(memorySearchTool, { name: "memory_search" });
|
|
2034
|
-
api.registerTool(memoryGetTool, { name: "memory_get" });
|
|
1979
|
+
api.registerTool(createMemorySearchToolFactory(memoryManager), { name: "memory_search" });
|
|
1980
|
+
api.registerTool(createMemoryGetToolFactory(memoryManager), { name: "memory_get" });
|
|
2035
1981
|
api.on("before_prompt_build", createBeforePromptBuildHandler({
|
|
2036
1982
|
pluginConfig,
|
|
2037
1983
|
runtimeState
|
|
@@ -2093,7 +2039,7 @@ var clawvaultPlugin = {
|
|
|
2093
2039
|
name: "ClawVault",
|
|
2094
2040
|
kind: "memory",
|
|
2095
2041
|
description: "Structured memory system for AI agents with proactive recall and protocol-safe messaging",
|
|
2096
|
-
|
|
2042
|
+
register(apiOrRuntime) {
|
|
2097
2043
|
if (isOpenClawPluginApi(apiOrRuntime)) {
|
|
2098
2044
|
return registerOpenClawPlugin(apiOrRuntime);
|
|
2099
2045
|
}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerCliCommands
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-DPK6P6BO.js";
|
|
4
4
|
import "../chunk-KCYWJDDW.js";
|
|
5
5
|
import "../chunk-TIGW564L.js";
|
|
6
6
|
import "../chunk-IVRIKYFE.js";
|
|
7
7
|
import "../chunk-DOIUYIXV.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-7SWP5FKU.js";
|
|
14
|
-
import "../chunk-DVOUSOR3.js";
|
|
8
|
+
import "../chunk-QL34TMGN.js";
|
|
9
|
+
import "../chunk-IOKLQR4W.js";
|
|
10
|
+
import "../chunk-FNFP7N6A.js";
|
|
11
|
+
import "../chunk-LCBHM3D6.js";
|
|
12
|
+
import "../chunk-FSYISBTU.js";
|
|
15
13
|
import "../chunk-4PY655YM.js";
|
|
16
14
|
import "../chunk-AXSJIFOJ.js";
|
|
17
15
|
import "../chunk-GFCHWMGD.js";
|
|
18
16
|
import "../chunk-T7E764W3.js";
|
|
19
17
|
import "../chunk-HEHO7SMV.js";
|
|
20
18
|
import "../chunk-2PKBIKDH.js";
|
|
19
|
+
import "../chunk-TWMI3SNN.js";
|
|
21
20
|
import "../chunk-35JCYSRR.js";
|
|
22
21
|
import "../chunk-HRLWZGMA.js";
|
|
22
|
+
import "../chunk-DVOUSOR3.js";
|
|
23
23
|
import "../chunk-BSJ6RIT7.js";
|
|
24
24
|
import "../chunk-ECGJYWNA.js";
|
|
25
25
|
import "../chunk-2CDEETQN.js";
|
package/dist/commands/compat.js
CHANGED
package/dist/commands/inject.js
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
buildInjectionResult,
|
|
3
3
|
injectCommand,
|
|
4
4
|
registerInjectCommand
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-DVOUSOR3.js";
|
|
5
|
+
} from "../chunk-QL34TMGN.js";
|
|
7
6
|
import "../chunk-AXSJIFOJ.js";
|
|
7
|
+
import "../chunk-DVOUSOR3.js";
|
|
8
8
|
import "../chunk-2CDEETQN.js";
|
|
9
9
|
import "../chunk-33DOSHTA.js";
|
|
10
10
|
import "../chunk-2ZDO52B4.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
maintainCommand,
|
|
3
3
|
registerMaintainCommand
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-DVOUSOR3.js";
|
|
4
|
+
} from "../chunk-IOKLQR4W.js";
|
|
6
5
|
import "../chunk-2PKBIKDH.js";
|
|
7
6
|
import "../chunk-35JCYSRR.js";
|
|
7
|
+
import "../chunk-DVOUSOR3.js";
|
|
8
8
|
import "../chunk-GJO3CFUN.js";
|
|
9
9
|
import "../chunk-2ZDO52B4.js";
|
|
10
10
|
export {
|
package/dist/commands/observe.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
observeCommand,
|
|
3
3
|
registerObserveCommand
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-DVOUSOR3.js";
|
|
4
|
+
} from "../chunk-FNFP7N6A.js";
|
|
5
|
+
import "../chunk-LCBHM3D6.js";
|
|
6
|
+
import "../chunk-FSYISBTU.js";
|
|
8
7
|
import "../chunk-4PY655YM.js";
|
|
9
8
|
import "../chunk-AXSJIFOJ.js";
|
|
10
9
|
import "../chunk-HRLWZGMA.js";
|
|
10
|
+
import "../chunk-DVOUSOR3.js";
|
|
11
11
|
import "../chunk-BSJ6RIT7.js";
|
|
12
12
|
import "../chunk-2CDEETQN.js";
|
|
13
13
|
import "../chunk-GJO3CFUN.js";
|
package/dist/commands/rebuild.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rebuildCommand,
|
|
3
3
|
registerRebuildCommand
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-DVOUSOR3.js";
|
|
4
|
+
} from "../chunk-J6DW6HBX.js";
|
|
5
|
+
import "../chunk-FSYISBTU.js";
|
|
7
6
|
import "../chunk-4PY655YM.js";
|
|
8
7
|
import "../chunk-AXSJIFOJ.js";
|
|
8
|
+
import "../chunk-DVOUSOR3.js";
|
|
9
9
|
import "../chunk-BSJ6RIT7.js";
|
|
10
10
|
import "../chunk-2CDEETQN.js";
|
|
11
11
|
import "../chunk-GJO3CFUN.js";
|
package/dist/commands/replay.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerReplayCommand,
|
|
3
3
|
replayCommand
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-7SWP5FKU.js";
|
|
7
|
-
import "../chunk-DVOUSOR3.js";
|
|
4
|
+
} from "../chunk-NTQD55S3.js";
|
|
5
|
+
import "../chunk-FSYISBTU.js";
|
|
8
6
|
import "../chunk-4PY655YM.js";
|
|
9
7
|
import "../chunk-AXSJIFOJ.js";
|
|
8
|
+
import "../chunk-TWMI3SNN.js";
|
|
9
|
+
import "../chunk-DVOUSOR3.js";
|
|
10
10
|
import "../chunk-BSJ6RIT7.js";
|
|
11
11
|
import "../chunk-2CDEETQN.js";
|
|
12
12
|
import "../chunk-MQUJNOHK.js";
|
package/dist/commands/sleep.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clearDirtyFlag
|
|
3
3
|
} from "../chunk-F55HGNU4.js";
|
|
4
|
-
import {
|
|
5
|
-
runReflection
|
|
6
|
-
} from "../chunk-TWMI3SNN.js";
|
|
7
4
|
import {
|
|
8
5
|
Observer
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-DVOUSOR3.js";
|
|
6
|
+
} from "../chunk-FSYISBTU.js";
|
|
11
7
|
import "../chunk-4PY655YM.js";
|
|
12
8
|
import "../chunk-AXSJIFOJ.js";
|
|
9
|
+
import {
|
|
10
|
+
runReflection
|
|
11
|
+
} from "../chunk-TWMI3SNN.js";
|
|
12
|
+
import "../chunk-DVOUSOR3.js";
|
|
13
13
|
import "../chunk-BSJ6RIT7.js";
|
|
14
14
|
import {
|
|
15
15
|
ClawVault
|
package/dist/commands/status.js
CHANGED
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
} from "../chunk-7ZRP733D.js";
|
|
8
8
|
import {
|
|
9
9
|
getObserverStaleness
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-DVOUSOR3.js";
|
|
10
|
+
} from "../chunk-LCBHM3D6.js";
|
|
11
|
+
import "../chunk-FSYISBTU.js";
|
|
13
12
|
import "../chunk-4PY655YM.js";
|
|
14
13
|
import "../chunk-AXSJIFOJ.js";
|
|
15
14
|
import "../chunk-HRLWZGMA.js";
|
|
15
|
+
import "../chunk-DVOUSOR3.js";
|
|
16
16
|
import "../chunk-BSJ6RIT7.js";
|
|
17
17
|
import {
|
|
18
18
|
ClawVault
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { V as VaultConfig, S as StoreOptions, D as Document, P as PatchOptions, a as SearchOptions, b as SearchResult, c as SyncOptions, d as SyncResult, C as Category, M as MemoryType, H as HandoffDocument, e as SessionRecap, f as VaultSearchConfig } from './types-DslKvCaj.js';
|
|
3
3
|
export { g as DEFAULT_CATEGORIES, h as DEFAULT_CONFIG, E as EmbeddingProvider, i as MEMORY_TYPES, j as PatchMode, R as RerankProvider, k as SearchBackend, T as TYPE_TO_CATEGORY, l as VaultMeta } from './types-DslKvCaj.js';
|
|
4
|
-
import { C as CaptureOptions, a as CaptureStoreResult, b as CaptureCandidate } from './openclaw-plugin
|
|
5
|
-
export { c as CaptureMessage, d as CaptureRejection, e as CapturedMemoryType, M as MemorySlot, f as MemorySlotInitOptions, g as MemorySlotRecallOptions, h as MemorySlotSearchOptions, i as MemorySlotStoreOptions, j as MemoryStoreMetadata, k as createMemorySlot, l as createMemorySlotPlugin, m as openclawHookPlugin, r as registerMemorySlot } from './openclaw-plugin
|
|
4
|
+
import { C as CaptureOptions, a as CaptureStoreResult, b as CaptureCandidate } from './openclaw-plugin-9M9qCZgl.js';
|
|
5
|
+
export { c as CaptureMessage, d as CaptureRejection, e as CapturedMemoryType, M as MemorySlot, f as MemorySlotInitOptions, g as MemorySlotRecallOptions, h as MemorySlotSearchOptions, i as MemorySlotStoreOptions, j as MemoryStoreMetadata, k as createMemorySlot, l as createMemorySlotPlugin, m as openclawHookPlugin, r as registerMemorySlot } from './openclaw-plugin-9M9qCZgl.js';
|
|
6
6
|
export { setupCommand } from './commands/setup.js';
|
|
7
7
|
export { CompatCheck, CompatCommandOptions, CompatReport, CompatStatus, checkOpenClawCompatibility, compatCommand, compatibilityExitCode } from './commands/compat.js';
|
|
8
8
|
export { GraphSummary, graphCommand, graphSummary } from './commands/graph.js';
|