engine7 7.1.143 → 7.1.145
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/auth-server.mjs +1 -1
- package/dist/bg-worker.mjs +10983 -2576
- package/dist/cc-desktop.mjs +9 -0
- package/dist/cli.mjs +13173 -12097
- package/dist/engine-startup.mjs +6986 -6729
- package/dist/main.mjs +6969 -6712
- package/dist/recall-worker.mjs +4557 -1435
- package/dist/sqlite-maintenance-worker.mjs +43 -29
- package/dist/topics-worker.mjs +456 -249
- package/dist/travel-data.mjs +95 -86
- package/dist/travel-gateway.mjs +953 -541
- package/dist/travel-host.mjs +1235 -937
- package/dist/travel-initial-baseline.mjs +63 -54
- package/dist/travel-node-data.mjs +53 -44
- package/dist/travel-node.mjs +432 -299
- package/dist/travel-oss-bundle-stream.mjs +636 -0
- package/dist/travel-pairing.mjs +984 -572
- package/dist/travel-sync-worker.mjs +4929 -0
- package/dist/web-console.mjs +998 -299
- package/package.json +7 -6
- package/templates/config.template.json +0 -1
- package/templates/skills/screenshot-annotate/SKILL.md +56 -0
- package/templates/skills/screenshot-annotate/scripts/annotate.py +156 -0
- package/templates/skills/screenshot-annotate/scripts/annotate_test.py +130 -0
|
@@ -534,31 +534,31 @@ var init_mem7_replication = __esm({
|
|
|
534
534
|
// src/continuity/runtime-replication.ts
|
|
535
535
|
import { constants as constants4, lstatSync as lstatSync6, realpathSync as realpathSync3, mkdirSync as mkdirSync5, openSync as openSync6, closeSync as closeSync6, fstatSync as fstatSync4, readFileSync as readFileSync4, writeFileSync as writeFileSync3, fsyncSync as fsyncSync5 } from "node:fs";
|
|
536
536
|
import { basename as basename2, dirname as dirname4, join as join5, resolve as resolve3 } from "node:path";
|
|
537
|
-
function checkKey(component,
|
|
538
|
-
if (component === "topics-vectors" && typeof
|
|
539
|
-
if (component === "legacy-memory" && typeof
|
|
540
|
-
if (["calendar", "proactive", "session-events"].includes(component) &&
|
|
537
|
+
function checkKey(component, key2) {
|
|
538
|
+
if (component === "topics-vectors" && typeof key2 === "string" && /^[a-f0-9]{64}$/.test(key2)) return;
|
|
539
|
+
if (component === "legacy-memory" && typeof key2 === "string" && /^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/.test(key2) && !/[. ]$/.test(key2) && !/^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\.|$)/i.test(key2)) return;
|
|
540
|
+
if (["calendar", "proactive", "session-events"].includes(component) && key2 === void 0) return;
|
|
541
541
|
throw new Error("REPLICATION_REGISTRATION_INVALID");
|
|
542
542
|
}
|
|
543
|
-
function location2(stateDir, component,
|
|
544
|
-
checkKey(component,
|
|
545
|
-
return join5(stateDir, ".continuity", component + (
|
|
543
|
+
function location2(stateDir, component, key2) {
|
|
544
|
+
checkKey(component, key2);
|
|
545
|
+
return join5(stateDir, ".continuity", component + (key2 === void 0 ? "" : "-" + key2) + "-replication.json");
|
|
546
546
|
}
|
|
547
|
-
function runtimeReplicationFile(stateDir, component,
|
|
548
|
-
checkKey(component,
|
|
549
|
-
if (component === "legacy-memory") return join5(stateDir, "agents",
|
|
550
|
-
if (component === "topics-vectors") return join5(stateDir, "topics-history",
|
|
547
|
+
function runtimeReplicationFile(stateDir, component, key2) {
|
|
548
|
+
checkKey(component, key2);
|
|
549
|
+
if (component === "legacy-memory") return join5(stateDir, "agents", key2, "memory", "memory.db");
|
|
550
|
+
if (component === "topics-vectors") return join5(stateDir, "topics-history", key2, "vectors.db");
|
|
551
551
|
if (component === "session-events") return join5(stateDir, ".continuity", "session-events.db");
|
|
552
552
|
return join5(stateDir, "." + component, component + ".db");
|
|
553
553
|
}
|
|
554
554
|
function runtimeReplicationLocation(stateDir, component, file) {
|
|
555
|
-
const
|
|
555
|
+
const key2 = component === "legacy-memory" ? basename2(dirname4(dirname4(file))) : component === "topics-vectors" ? basename2(dirname4(file)) : void 0;
|
|
556
556
|
try {
|
|
557
|
-
if (resolve3(file) !== resolve3(runtimeReplicationFile(stateDir, component,
|
|
557
|
+
if (resolve3(file) !== resolve3(runtimeReplicationFile(stateDir, component, key2))) throw new Error();
|
|
558
558
|
} catch (error) {
|
|
559
559
|
throw new Error("REPLICATION_RUNTIME_PATH_UNSUPPORTED", { cause: error });
|
|
560
560
|
}
|
|
561
|
-
return { component, ...
|
|
561
|
+
return { component, ...key2 === void 0 ? {} : { key: key2 } };
|
|
562
562
|
}
|
|
563
563
|
function normalize3(input) {
|
|
564
564
|
if (!input || !/^[a-f0-9]{64}$/.test(input.schemaHash)) throw new Error("REPLICATION_REGISTRATION_INVALID");
|
|
@@ -569,8 +569,8 @@ function directory(path2) {
|
|
|
569
569
|
if (!info.isDirectory() || info.isSymbolicLink() || realpathSync3(path2) !== resolve3(path2) || process.platform !== "win32" && (info.mode & 63 || info.uid !== process.getuid()))
|
|
570
570
|
throw new Error("REPLICATION_REGISTRATION_INVALID");
|
|
571
571
|
}
|
|
572
|
-
function readRuntimeReplicationRegistration(stateDir, component,
|
|
573
|
-
const file = location2(stateDir, component,
|
|
572
|
+
function readRuntimeReplicationRegistration(stateDir, component, key2) {
|
|
573
|
+
const file = location2(stateDir, component, key2);
|
|
574
574
|
try {
|
|
575
575
|
lstatSync6(dirname4(file));
|
|
576
576
|
} catch (error) {
|
|
@@ -834,10 +834,10 @@ var init_live = __esm({
|
|
|
834
834
|
/** 安全取子段('services.voice-chat.start' → current.services.voice-chat.start) */
|
|
835
835
|
get(dotPath) {
|
|
836
836
|
if (!this.current) return void 0;
|
|
837
|
-
return dotPath.split(".").reduce((acc,
|
|
837
|
+
return dotPath.split(".").reduce((acc, key2) => {
|
|
838
838
|
if (acc == null) return void 0;
|
|
839
|
-
if (
|
|
840
|
-
return acc[
|
|
839
|
+
if (key2 === "__proto__" || key2 === "constructor" || key2 === "prototype") return void 0;
|
|
840
|
+
return acc[key2];
|
|
841
841
|
}, this.current);
|
|
842
842
|
}
|
|
843
843
|
/** reload 时原地更新(Object.assign 保持引用不变)
|
|
@@ -955,7 +955,7 @@ var init_scope = __esm({
|
|
|
955
955
|
function canonicalJson(value) {
|
|
956
956
|
const normalize4 = (input) => {
|
|
957
957
|
if (Array.isArray(input)) return input.map(normalize4);
|
|
958
|
-
if (input && typeof input === "object") return Object.fromEntries(Object.entries(input).filter(([, entry]) => entry !== void 0).sort(([a], [b]) => a.localeCompare(b)).map(([
|
|
958
|
+
if (input && typeof input === "object") return Object.fromEntries(Object.entries(input).filter(([, entry]) => entry !== void 0).sort(([a], [b]) => a.localeCompare(b)).map(([key2, entry]) => [key2, normalize4(entry)]));
|
|
959
959
|
return input;
|
|
960
960
|
};
|
|
961
961
|
const json = JSON.stringify(normalize4(value));
|
|
@@ -1029,9 +1029,9 @@ function invalidateChildren(db, scope, pending, reason) {
|
|
|
1029
1029
|
let referencedPlan;
|
|
1030
1030
|
while (pending.length) {
|
|
1031
1031
|
const child = pending.shift();
|
|
1032
|
-
const
|
|
1033
|
-
if (visited.has(
|
|
1034
|
-
visited.set(
|
|
1032
|
+
const key2 = JSON.stringify([child.child_kind, child.child_id]);
|
|
1033
|
+
if (visited.has(key2) && (visited.get(key2) || !child.deleted)) continue;
|
|
1034
|
+
visited.set(key2, Boolean(child.deleted));
|
|
1035
1035
|
if (child.child_kind === "graph_plan") {
|
|
1036
1036
|
referencedPlan ??= db.prepare(`SELECT 1 WHERE EXISTS (SELECT 1 FROM memory_dependencies
|
|
1037
1037
|
WHERE scope_id=? AND parent_kind='artifact' AND parent_id=?)
|
|
@@ -1192,8 +1192,8 @@ var init_change_feed = __esm({
|
|
|
1192
1192
|
* 事件重放失败一次即回死信+skip,不重烧 5 轮预算)。先 UPDATE 后记账:中间崩溃只会
|
|
1193
1193
|
* 多治一次(幂等无害),反过来会出现"记了账但没治"的永久死锁。 */
|
|
1194
1194
|
reenqueueGapPrefix(sinkId, head, now2 = Date.now()) {
|
|
1195
|
-
const
|
|
1196
|
-
if (this.healedGaps.has(
|
|
1195
|
+
const key2 = `${sinkId}:${head.scopeId}:${head.eventSeq}`;
|
|
1196
|
+
if (this.healedGaps.has(key2)) return;
|
|
1197
1197
|
const ledgerPath = this.gapHealLedgerPath;
|
|
1198
1198
|
let ledger = {};
|
|
1199
1199
|
if (ledgerPath) {
|
|
@@ -1201,8 +1201,8 @@ var init_change_feed = __esm({
|
|
|
1201
1201
|
ledger = JSON.parse(readFileSync6(ledgerPath, "utf8"))?.heals ?? {};
|
|
1202
1202
|
} catch {
|
|
1203
1203
|
}
|
|
1204
|
-
if (Number.isFinite(ledger[
|
|
1205
|
-
this.healedGaps.add(
|
|
1204
|
+
if (Number.isFinite(ledger[key2])) {
|
|
1205
|
+
this.healedGaps.add(key2);
|
|
1206
1206
|
return;
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
@@ -1216,11 +1216,11 @@ var init_change_feed = __esm({
|
|
|
1216
1216
|
const count = Number(result?.changes ?? 0);
|
|
1217
1217
|
if (count > 0) console.warn(`[mem7] \u5E8F\u5217\u7F3A\u53E3\u81EA\u6108\uFF1Ahead seq=${head.eventSeq} \u524D ${count} \u6761\u5DF2 ack \u6295\u9012\u884C\u91CD\u7F6E\u5F85\u6295\uFF08\u65B0\u56FE\u5982\u5B9E\u91CD\u653E / \u65E7\u56FE\u5E42\u7B49 duplicate-ack\uFF1B\u6B7B\u4FE1\u884C\u4FDD\u7559 attempts\uFF09`);
|
|
1218
1218
|
});
|
|
1219
|
-
this.healedGaps.add(
|
|
1219
|
+
this.healedGaps.add(key2);
|
|
1220
1220
|
if (!ledgerPath) return;
|
|
1221
1221
|
const cutoff = now2 - _ChangeFeed.GAP_HEAL_RETENTION_MS, retained = {};
|
|
1222
1222
|
for (const [entry, at] of Object.entries(ledger)) if (Number.isFinite(at) && at >= cutoff) retained[entry] = at;
|
|
1223
|
-
retained[
|
|
1223
|
+
retained[key2] = now2;
|
|
1224
1224
|
const temp = `${ledgerPath}.${randomUUID4()}.tmp`;
|
|
1225
1225
|
try {
|
|
1226
1226
|
writeFileSync5(temp, JSON.stringify({ version: 1, heals: retained }));
|
|
@@ -1880,6 +1880,19 @@ var init_timing = __esm({
|
|
|
1880
1880
|
}
|
|
1881
1881
|
});
|
|
1882
1882
|
|
|
1883
|
+
// src/mem7/core/lance-cache.ts
|
|
1884
|
+
var LANCE_INDEX_CACHE_BYTES, LANCE_METADATA_CACHE_BYTES, key, globals, sessions;
|
|
1885
|
+
var init_lance_cache = __esm({
|
|
1886
|
+
"src/mem7/core/lance-cache.ts"() {
|
|
1887
|
+
"use strict";
|
|
1888
|
+
LANCE_INDEX_CACHE_BYTES = 256 * 1024 * 1024;
|
|
1889
|
+
LANCE_METADATA_CACHE_BYTES = 64 * 1024 * 1024;
|
|
1890
|
+
key = Symbol.for("engine7.mem7.lanceCacheSessions");
|
|
1891
|
+
globals = globalThis;
|
|
1892
|
+
sessions = globals[key] ??= /* @__PURE__ */ new WeakMap();
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1895
|
+
|
|
1883
1896
|
// src/mem7/core/vector-store.ts
|
|
1884
1897
|
import { DatabaseSync as DatabaseSync7 } from "node:sqlite";
|
|
1885
1898
|
function lanceSpecifierFor(platform, arch) {
|
|
@@ -1897,6 +1910,7 @@ var init_vector_store = __esm({
|
|
|
1897
1910
|
init_read_guard();
|
|
1898
1911
|
init_timing();
|
|
1899
1912
|
init_runtime_authority();
|
|
1913
|
+
init_lance_cache();
|
|
1900
1914
|
isIntelMac = process.platform === "darwin" && process.arch === "x64";
|
|
1901
1915
|
bootAt = Date.now();
|
|
1902
1916
|
}
|