chat-recall 0.7.80 → 0.7.82
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 +1 -1
- package/dist/cli.js +317 -192
- package/dist/heavy-session-work.d.ts +49 -0
- package/dist/heavy-session-work.d.ts.map +1 -0
- package/dist/heavy-session-work.js +98 -0
- package/dist/heavy-session-work.js.map +1 -0
- package/dist/mcp.js +275 -150
- package/dist/scan-pool.d.ts +13 -1
- package/dist/scan-pool.d.ts.map +1 -1
- package/dist/scan-pool.js +17 -1
- package/dist/scan-pool.js.map +1 -1
- package/dist/scan-worker.d.ts +54 -0
- package/dist/scan-worker.d.ts.map +1 -1
- package/dist/scan-worker.js +434 -47
- package/dist/scan-worker.js.map +1 -1
- package/dist/sync-client.d.ts +2 -16
- package/dist/sync-client.d.ts.map +1 -1
- package/dist/sync-client.js +60 -81
- package/dist/sync-client.js.map +1 -1
- package/dist/watch.js +327 -202
- package/dist/yield-loop.d.ts +15 -0
- package/dist/yield-loop.d.ts.map +1 -0
- package/dist/yield-loop.js +17 -0
- package/dist/yield-loop.js.map +1 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7615,7 +7615,38 @@ var init_first_prompt = __esm({
|
|
|
7615
7615
|
});
|
|
7616
7616
|
|
|
7617
7617
|
// ../engine/dist/core/project-dir-name.js
|
|
7618
|
-
import { readdirSync as readdirSync6 } from "node:fs";
|
|
7618
|
+
import { readdirSync as readdirSync6, statSync as statSync8 } from "node:fs";
|
|
7619
|
+
function makeChildDirsLister(fs = realFs) {
|
|
7620
|
+
const cache4 = /* @__PURE__ */ new Map();
|
|
7621
|
+
let diskListings = 0;
|
|
7622
|
+
return {
|
|
7623
|
+
list(path) {
|
|
7624
|
+
let stamp = null;
|
|
7625
|
+
try {
|
|
7626
|
+
stamp = fs.statDir(path);
|
|
7627
|
+
} catch {
|
|
7628
|
+
}
|
|
7629
|
+
const hit = cache4.get(path);
|
|
7630
|
+
if (stamp && hit && hit.mtimeMs === stamp.mtimeMs && hit.nlink === stamp.nlink)
|
|
7631
|
+
return hit.names;
|
|
7632
|
+
const listedAt = fs.now();
|
|
7633
|
+
const names = fs.listDirs(path);
|
|
7634
|
+
diskListings++;
|
|
7635
|
+
cache4.delete(path);
|
|
7636
|
+
if (stamp && listedAt - stamp.mtimeMs > CHILD_DIRS_RACY_MS) {
|
|
7637
|
+
if (cache4.size >= CHILD_DIRS_CACHE_MAX) {
|
|
7638
|
+
const oldest = cache4.keys().next().value;
|
|
7639
|
+
if (oldest !== void 0)
|
|
7640
|
+
cache4.delete(oldest);
|
|
7641
|
+
}
|
|
7642
|
+
cache4.set(path, { ...stamp, names });
|
|
7643
|
+
}
|
|
7644
|
+
return names;
|
|
7645
|
+
},
|
|
7646
|
+
diskListings: () => diskListings,
|
|
7647
|
+
clear: () => cache4.clear()
|
|
7648
|
+
};
|
|
7649
|
+
}
|
|
7619
7650
|
function looksWindowsEncoded(dirName) {
|
|
7620
7651
|
return /^[A-Za-z]--/.test(dirName);
|
|
7621
7652
|
}
|
|
@@ -7635,7 +7666,7 @@ function resolveProjectDirName(dirName, deps = {}) {
|
|
|
7635
7666
|
return structural;
|
|
7636
7667
|
if (looksWindowsEncoded(dirName))
|
|
7637
7668
|
return structural;
|
|
7638
|
-
const readdir3 = deps.readdir ??
|
|
7669
|
+
const readdir3 = deps.readdir ?? childDirs.list;
|
|
7639
7670
|
const encodeName = (name) => name.replace(/[-_.]/g, "-");
|
|
7640
7671
|
let remaining = dirName.replace(/^-/, "");
|
|
7641
7672
|
let current = "/";
|
|
@@ -7666,9 +7697,21 @@ function resolveProjectDirName(dirName, deps = {}) {
|
|
|
7666
7697
|
}
|
|
7667
7698
|
return remaining ? structural : current;
|
|
7668
7699
|
}
|
|
7700
|
+
var CHILD_DIRS_RACY_MS, CHILD_DIRS_CACHE_MAX, realFs, childDirs;
|
|
7669
7701
|
var init_project_dir_name = __esm({
|
|
7670
7702
|
"../engine/dist/core/project-dir-name.js"() {
|
|
7671
7703
|
"use strict";
|
|
7704
|
+
CHILD_DIRS_RACY_MS = 2e3;
|
|
7705
|
+
CHILD_DIRS_CACHE_MAX = 512;
|
|
7706
|
+
realFs = {
|
|
7707
|
+
statDir: (p) => {
|
|
7708
|
+
const st = statSync8(p);
|
|
7709
|
+
return { mtimeMs: st.mtimeMs, nlink: st.nlink };
|
|
7710
|
+
},
|
|
7711
|
+
listDirs: (p) => readdirSync6(p, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name),
|
|
7712
|
+
now: () => Date.now()
|
|
7713
|
+
};
|
|
7714
|
+
childDirs = makeChildDirsLister();
|
|
7672
7715
|
}
|
|
7673
7716
|
});
|
|
7674
7717
|
|
|
@@ -7946,7 +7989,7 @@ var init_generic_engine = __esm({
|
|
|
7946
7989
|
});
|
|
7947
7990
|
|
|
7948
7991
|
// ../engine/dist/core/backends/claude.js
|
|
7949
|
-
import { existsSync as existsSync9, readdirSync as readdirSync7, readFileSync as readFileSync7, statSync as
|
|
7992
|
+
import { existsSync as existsSync9, readdirSync as readdirSync7, readFileSync as readFileSync7, statSync as statSync9, openSync as openSync3, readSync as readSync3, closeSync as closeSync3 } from "fs";
|
|
7950
7993
|
import { join as join10, basename as basename5 } from "path";
|
|
7951
7994
|
function stripReminders(text) {
|
|
7952
7995
|
return text.replace(/<system-reminder>[\s\S]*?<\/system-reminder>/g, "").trim();
|
|
@@ -8077,7 +8120,7 @@ var init_claude = __esm({
|
|
|
8077
8120
|
let mtime = 0;
|
|
8078
8121
|
for (const c of copies) {
|
|
8079
8122
|
try {
|
|
8080
|
-
mtime = Math.max(mtime,
|
|
8123
|
+
mtime = Math.max(mtime, statSync9(c.path).mtimeMs);
|
|
8081
8124
|
} catch {
|
|
8082
8125
|
}
|
|
8083
8126
|
}
|
|
@@ -8144,7 +8187,7 @@ var init_claude = __esm({
|
|
|
8144
8187
|
if (!f.endsWith(".jsonl") || f === "sessions-index.json")
|
|
8145
8188
|
continue;
|
|
8146
8189
|
try {
|
|
8147
|
-
if (
|
|
8190
|
+
if (statSync9(join10(projPath, f)).mtimeMs >= cutoff)
|
|
8148
8191
|
ids.add(basename5(f, ".jsonl"));
|
|
8149
8192
|
} catch {
|
|
8150
8193
|
}
|
|
@@ -8222,7 +8265,7 @@ var init_claude = __esm({
|
|
|
8222
8265
|
const fullPath = join10(projPath, f);
|
|
8223
8266
|
let stat3;
|
|
8224
8267
|
try {
|
|
8225
|
-
stat3 =
|
|
8268
|
+
stat3 = statSync9(fullPath);
|
|
8226
8269
|
} catch {
|
|
8227
8270
|
continue;
|
|
8228
8271
|
}
|
|
@@ -8476,7 +8519,7 @@ var init_claude = __esm({
|
|
|
8476
8519
|
const events = this.readEvents(rawId);
|
|
8477
8520
|
let fileMtime = 0;
|
|
8478
8521
|
try {
|
|
8479
|
-
fileMtime =
|
|
8522
|
+
fileMtime = statSync9(located.path).mtimeMs;
|
|
8480
8523
|
} catch {
|
|
8481
8524
|
}
|
|
8482
8525
|
return liveScanEditsFromEvents(events, this.fileToolMap, {
|
|
@@ -8531,13 +8574,13 @@ var init_claude = __esm({
|
|
|
8531
8574
|
continue;
|
|
8532
8575
|
const fp = join10(projPath, f);
|
|
8533
8576
|
try {
|
|
8534
|
-
const st =
|
|
8577
|
+
const st = statSync9(fp);
|
|
8535
8578
|
let mtime = st.mtimeMs;
|
|
8536
8579
|
const subDir = join10(projPath, f.slice(0, -6), "subagents");
|
|
8537
8580
|
if (existsSync9(subDir)) {
|
|
8538
8581
|
for (const sub of readdirSync7(subDir)) {
|
|
8539
8582
|
try {
|
|
8540
|
-
const subSt =
|
|
8583
|
+
const subSt = statSync9(join10(subDir, sub));
|
|
8541
8584
|
if (subSt.mtimeMs > mtime)
|
|
8542
8585
|
mtime = subSt.mtimeMs;
|
|
8543
8586
|
} catch {
|
|
@@ -8602,7 +8645,7 @@ var init_claude = __esm({
|
|
|
8602
8645
|
let total = 0;
|
|
8603
8646
|
for (const located of findSessionFiles(this.toRawId(prefixedId))) {
|
|
8604
8647
|
try {
|
|
8605
|
-
total +=
|
|
8648
|
+
total += statSync9(located.path).size;
|
|
8606
8649
|
} catch {
|
|
8607
8650
|
}
|
|
8608
8651
|
}
|
|
@@ -8631,7 +8674,7 @@ var init_claude = __esm({
|
|
|
8631
8674
|
return copies.slice(0, -1).map((c) => {
|
|
8632
8675
|
let size = -1;
|
|
8633
8676
|
try {
|
|
8634
|
-
size =
|
|
8677
|
+
size = statSync9(c.path).size;
|
|
8635
8678
|
} catch {
|
|
8636
8679
|
}
|
|
8637
8680
|
return `${c.path}:${size}`;
|
|
@@ -8827,7 +8870,7 @@ var init_model_pricing = __esm({
|
|
|
8827
8870
|
});
|
|
8828
8871
|
|
|
8829
8872
|
// ../engine/dist/parsers/session.js
|
|
8830
|
-
import { createReadStream as createReadStream2, existsSync as existsSync10, readdirSync as readdirSync8, readFileSync as readFileSync8, statSync as
|
|
8873
|
+
import { createReadStream as createReadStream2, existsSync as existsSync10, readdirSync as readdirSync8, readFileSync as readFileSync8, statSync as statSync10, openSync as openSync4, readSync as readSync4, closeSync as closeSync4 } from "fs";
|
|
8831
8874
|
import { createInterface } from "readline";
|
|
8832
8875
|
import { join as join11, basename as basename6 } from "path";
|
|
8833
8876
|
function removeCodeBlocks(text) {
|
|
@@ -10928,7 +10971,7 @@ var init_opencode = __esm({
|
|
|
10928
10971
|
});
|
|
10929
10972
|
|
|
10930
10973
|
// ../engine/dist/core/backends/codex.js
|
|
10931
|
-
import { readdirSync as readdirSync9, readFileSync as readFileSync9, statSync as
|
|
10974
|
+
import { readdirSync as readdirSync9, readFileSync as readFileSync9, statSync as statSync11, openSync as openSync5, readSync as readSync5, closeSync as closeSync5 } from "fs";
|
|
10932
10975
|
import { basename as basename9, dirname as dirname11, join as join15 } from "path";
|
|
10933
10976
|
function parseShellWrites(cmd) {
|
|
10934
10977
|
const out = [];
|
|
@@ -11163,7 +11206,7 @@ var init_codex2 = __esm({
|
|
|
11163
11206
|
return null;
|
|
11164
11207
|
let mtime = 0;
|
|
11165
11208
|
try {
|
|
11166
|
-
mtime =
|
|
11209
|
+
mtime = statSync11(located.path).mtimeMs;
|
|
11167
11210
|
} catch {
|
|
11168
11211
|
}
|
|
11169
11212
|
return {
|
|
@@ -11183,7 +11226,7 @@ var init_codex2 = __esm({
|
|
|
11183
11226
|
for (const filePath of walkRollouts(root)) {
|
|
11184
11227
|
let stat3;
|
|
11185
11228
|
try {
|
|
11186
|
-
stat3 =
|
|
11229
|
+
stat3 = statSync11(filePath);
|
|
11187
11230
|
} catch {
|
|
11188
11231
|
continue;
|
|
11189
11232
|
}
|
|
@@ -11380,7 +11423,7 @@ var init_codex2 = __esm({
|
|
|
11380
11423
|
let mtime = 0;
|
|
11381
11424
|
try {
|
|
11382
11425
|
raw = readFileSync9(path, "utf-8");
|
|
11383
|
-
mtime =
|
|
11426
|
+
mtime = statSync11(path).mtimeMs;
|
|
11384
11427
|
} catch {
|
|
11385
11428
|
return [];
|
|
11386
11429
|
}
|
|
@@ -11480,7 +11523,7 @@ var init_codex2 = __esm({
|
|
|
11480
11523
|
const events = this.readEvents(this.toRawId(id));
|
|
11481
11524
|
let fileMtime = 0;
|
|
11482
11525
|
try {
|
|
11483
|
-
fileMtime =
|
|
11526
|
+
fileMtime = statSync11(located.path).mtimeMs;
|
|
11484
11527
|
} catch {
|
|
11485
11528
|
}
|
|
11486
11529
|
return liveScanEditsFromEvents(events, this.fileToolMap, {
|
|
@@ -11544,7 +11587,7 @@ var init_codex2 = __esm({
|
|
|
11544
11587
|
const p = join15(dir, entry.name);
|
|
11545
11588
|
let st;
|
|
11546
11589
|
try {
|
|
11547
|
-
st =
|
|
11590
|
+
st = statSync11(p);
|
|
11548
11591
|
} catch {
|
|
11549
11592
|
continue;
|
|
11550
11593
|
}
|
|
@@ -11611,7 +11654,7 @@ var init_codex2 = __esm({
|
|
|
11611
11654
|
let mtime = 0;
|
|
11612
11655
|
const push = (path, name) => {
|
|
11613
11656
|
try {
|
|
11614
|
-
const st =
|
|
11657
|
+
const st = statSync11(path);
|
|
11615
11658
|
files.push({ name, bytes: readFileSync9(path) });
|
|
11616
11659
|
if (st.mtimeMs > mtime)
|
|
11617
11660
|
mtime = st.mtimeMs;
|
|
@@ -11653,7 +11696,7 @@ var init_codex2 = __esm({
|
|
|
11653
11696
|
if (!loc)
|
|
11654
11697
|
return 0;
|
|
11655
11698
|
try {
|
|
11656
|
-
return
|
|
11699
|
+
return statSync11(loc.path).size;
|
|
11657
11700
|
} catch {
|
|
11658
11701
|
return 0;
|
|
11659
11702
|
}
|
|
@@ -11670,7 +11713,7 @@ var init_codex2 = __esm({
|
|
|
11670
11713
|
});
|
|
11671
11714
|
|
|
11672
11715
|
// ../engine/dist/core/backends/agy.js
|
|
11673
|
-
import { existsSync as existsSync12, readdirSync as readdirSync10, readFileSync as readFileSync10, statSync as
|
|
11716
|
+
import { existsSync as existsSync12, readdirSync as readdirSync10, readFileSync as readFileSync10, statSync as statSync12 } from "fs";
|
|
11674
11717
|
import { basename as basename10, dirname as dirname12, join as join16 } from "path";
|
|
11675
11718
|
function agyTranscriptPath(logsDir) {
|
|
11676
11719
|
const full = join16(logsDir, "transcript_full.jsonl");
|
|
@@ -11867,7 +11910,7 @@ var init_agy = __esm({
|
|
|
11867
11910
|
return null;
|
|
11868
11911
|
let mtime = 0;
|
|
11869
11912
|
try {
|
|
11870
|
-
mtime =
|
|
11913
|
+
mtime = statSync12(path).mtimeMs;
|
|
11871
11914
|
} catch {
|
|
11872
11915
|
}
|
|
11873
11916
|
const projectPath = resolveAgyProject(dirname12(path), this.homeDir());
|
|
@@ -11895,7 +11938,7 @@ var init_agy = __esm({
|
|
|
11895
11938
|
for (const rawId of sessionDirs) {
|
|
11896
11939
|
const sessionPath = join16(brainDir, rawId);
|
|
11897
11940
|
try {
|
|
11898
|
-
if (!
|
|
11941
|
+
if (!statSync12(sessionPath).isDirectory())
|
|
11899
11942
|
continue;
|
|
11900
11943
|
} catch {
|
|
11901
11944
|
continue;
|
|
@@ -11905,7 +11948,7 @@ var init_agy = __esm({
|
|
|
11905
11948
|
continue;
|
|
11906
11949
|
let stat3;
|
|
11907
11950
|
try {
|
|
11908
|
-
stat3 =
|
|
11951
|
+
stat3 = statSync12(filePath);
|
|
11909
11952
|
} catch {
|
|
11910
11953
|
continue;
|
|
11911
11954
|
}
|
|
@@ -12171,7 +12214,7 @@ var init_agy = __esm({
|
|
|
12171
12214
|
for (const rawId of sessionDirs) {
|
|
12172
12215
|
const sessionPath = join16(brainDir, rawId);
|
|
12173
12216
|
try {
|
|
12174
|
-
if (!
|
|
12217
|
+
if (!statSync12(sessionPath).isDirectory())
|
|
12175
12218
|
continue;
|
|
12176
12219
|
} catch {
|
|
12177
12220
|
continue;
|
|
@@ -12180,7 +12223,7 @@ var init_agy = __esm({
|
|
|
12180
12223
|
if (!filePath)
|
|
12181
12224
|
continue;
|
|
12182
12225
|
try {
|
|
12183
|
-
const st =
|
|
12226
|
+
const st = statSync12(filePath);
|
|
12184
12227
|
if (st.mtimeMs < opts.sinceMs)
|
|
12185
12228
|
continue;
|
|
12186
12229
|
candidates2.push({ rawId, mtime: st.mtimeMs });
|
|
@@ -12208,7 +12251,7 @@ var init_agy = __esm({
|
|
|
12208
12251
|
try {
|
|
12209
12252
|
return {
|
|
12210
12253
|
tool: "agy",
|
|
12211
|
-
mtime:
|
|
12254
|
+
mtime: statSync12(loc.path).mtimeMs,
|
|
12212
12255
|
files: [{ name: basename10(loc.path), bytes: readFileSync10(loc.path) }]
|
|
12213
12256
|
};
|
|
12214
12257
|
} catch {
|
|
@@ -12223,7 +12266,7 @@ var init_agy = __esm({
|
|
|
12223
12266
|
if (!loc)
|
|
12224
12267
|
return 0;
|
|
12225
12268
|
try {
|
|
12226
|
-
return
|
|
12269
|
+
return statSync12(loc.path).size;
|
|
12227
12270
|
} catch {
|
|
12228
12271
|
return 0;
|
|
12229
12272
|
}
|
|
@@ -12240,7 +12283,7 @@ var init_agy = __esm({
|
|
|
12240
12283
|
});
|
|
12241
12284
|
|
|
12242
12285
|
// ../engine/dist/core/backends/cursor-store.js
|
|
12243
|
-
import { existsSync as existsSync13, readdirSync as readdirSync11, readFileSync as readFileSync11, statSync as
|
|
12286
|
+
import { existsSync as existsSync13, readdirSync as readdirSync11, readFileSync as readFileSync11, statSync as statSync13 } from "fs";
|
|
12244
12287
|
import { join as join17 } from "path";
|
|
12245
12288
|
function cursorProjectSlug(absPath) {
|
|
12246
12289
|
return absPath.replace(/[^a-zA-Z0-9]/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
@@ -12257,7 +12300,7 @@ function listChatsIn(chatsRoot) {
|
|
|
12257
12300
|
const hashPath3 = join17(chatsRoot, workspaceHash);
|
|
12258
12301
|
let chatIds;
|
|
12259
12302
|
try {
|
|
12260
|
-
if (!
|
|
12303
|
+
if (!statSync13(hashPath3).isDirectory())
|
|
12261
12304
|
continue;
|
|
12262
12305
|
chatIds = readdirSync11(hashPath3);
|
|
12263
12306
|
} catch {
|
|
@@ -12279,7 +12322,7 @@ function listChatsIn(chatsRoot) {
|
|
|
12279
12322
|
let created = meta.createdAtMs ?? 0;
|
|
12280
12323
|
if (!mtime || !created) {
|
|
12281
12324
|
try {
|
|
12282
|
-
const st =
|
|
12325
|
+
const st = statSync13(dbPath);
|
|
12283
12326
|
mtime = mtime || st.mtimeMs;
|
|
12284
12327
|
created = created || st.birthtimeMs || st.mtimeMs;
|
|
12285
12328
|
} catch {
|
|
@@ -12322,7 +12365,7 @@ function findChat(chatsRoots, chatId) {
|
|
|
12322
12365
|
let created = meta.createdAtMs ?? 0;
|
|
12323
12366
|
if (!mtime || !created) {
|
|
12324
12367
|
try {
|
|
12325
|
-
const st =
|
|
12368
|
+
const st = statSync13(dbPath);
|
|
12326
12369
|
mtime = mtime || st.mtimeMs;
|
|
12327
12370
|
created = created || st.birthtimeMs || st.mtimeMs;
|
|
12328
12371
|
} catch {
|
|
@@ -12625,7 +12668,7 @@ var init_cursor_store = __esm({
|
|
|
12625
12668
|
});
|
|
12626
12669
|
|
|
12627
12670
|
// ../engine/dist/core/backends/cursor-ide.js
|
|
12628
|
-
import { existsSync as existsSync14, readFileSync as readFileSync12, readdirSync as readdirSync12, statSync as
|
|
12671
|
+
import { existsSync as existsSync14, readFileSync as readFileSync12, readdirSync as readdirSync12, statSync as statSync14 } from "fs";
|
|
12629
12672
|
import { dirname as dirname13, join as join18 } from "path";
|
|
12630
12673
|
function jsonOf(value) {
|
|
12631
12674
|
if (value == null)
|
|
@@ -12695,7 +12738,7 @@ function workspaceIndex(workspaceRoots) {
|
|
|
12695
12738
|
for (const id of entries) {
|
|
12696
12739
|
const dir = join18(root, id);
|
|
12697
12740
|
try {
|
|
12698
|
-
if (!
|
|
12741
|
+
if (!statSync14(dir).isDirectory())
|
|
12699
12742
|
continue;
|
|
12700
12743
|
} catch {
|
|
12701
12744
|
continue;
|
|
@@ -13041,7 +13084,7 @@ var init_cursor_ide = __esm({
|
|
|
13041
13084
|
});
|
|
13042
13085
|
|
|
13043
13086
|
// ../engine/dist/core/backends/cursor.js
|
|
13044
|
-
import { existsSync as existsSync15, readFileSync as readFileSync13, statSync as
|
|
13087
|
+
import { existsSync as existsSync15, readFileSync as readFileSync13, statSync as statSync15 } from "fs";
|
|
13045
13088
|
import { join as join19 } from "path";
|
|
13046
13089
|
var PREFIX4, CursorBackend, cursorBackend;
|
|
13047
13090
|
var init_cursor = __esm({
|
|
@@ -13094,7 +13137,7 @@ var init_cursor = __esm({
|
|
|
13094
13137
|
if (r.surface === "cli") {
|
|
13095
13138
|
let mtime2 = r.chat.updatedAtMs;
|
|
13096
13139
|
try {
|
|
13097
|
-
mtime2 =
|
|
13140
|
+
mtime2 = statSync15(r.chat.dbPath).mtimeMs || mtime2;
|
|
13098
13141
|
} catch {
|
|
13099
13142
|
}
|
|
13100
13143
|
return {
|
|
@@ -13107,7 +13150,7 @@ var init_cursor = __esm({
|
|
|
13107
13150
|
}
|
|
13108
13151
|
let mtime = r.composer.updatedAtMs;
|
|
13109
13152
|
try {
|
|
13110
|
-
mtime =
|
|
13153
|
+
mtime = statSync15(r.composer.globalDbPath).mtimeMs || mtime;
|
|
13111
13154
|
} catch {
|
|
13112
13155
|
}
|
|
13113
13156
|
return {
|
|
@@ -13353,7 +13396,7 @@ var init_cursor = __esm({
|
|
|
13353
13396
|
if (existsSync15(metaPath)) {
|
|
13354
13397
|
files.push({ name: "meta.json", bytes: readFileSync13(metaPath) });
|
|
13355
13398
|
}
|
|
13356
|
-
return { tool: "cursor", mtime:
|
|
13399
|
+
return { tool: "cursor", mtime: statSync15(r.chat.dbPath).mtimeMs, files };
|
|
13357
13400
|
}
|
|
13358
13401
|
const events = readComposerEvents(r.composer);
|
|
13359
13402
|
if (events.length === 0)
|
|
@@ -13361,7 +13404,7 @@ var init_cursor = __esm({
|
|
|
13361
13404
|
const body2 = events.map((e) => JSON.stringify(e)).join("\n") + "\n";
|
|
13362
13405
|
return {
|
|
13363
13406
|
tool: "cursor",
|
|
13364
|
-
mtime:
|
|
13407
|
+
mtime: statSync15(r.composer.globalDbPath).mtimeMs,
|
|
13365
13408
|
files: [{ name: `${r.composer.composerId}.jsonl`, bytes: Buffer.from(body2, "utf8") }]
|
|
13366
13409
|
};
|
|
13367
13410
|
} catch {
|
|
@@ -13903,7 +13946,7 @@ var init_backends = __esm({
|
|
|
13903
13946
|
// ../engine/dist/transcript/shadow.js
|
|
13904
13947
|
import { gzipSync as gzipSync2, gunzipSync as gunzipSync2 } from "zlib";
|
|
13905
13948
|
import { createHash as createHash6 } from "crypto";
|
|
13906
|
-
import { existsSync as existsSync17, mkdirSync as mkdirSync4, readFileSync as readFileSync14, writeFileSync as writeFileSync4, renameSync as renameSync2, statSync as
|
|
13949
|
+
import { existsSync as existsSync17, mkdirSync as mkdirSync4, readFileSync as readFileSync14, writeFileSync as writeFileSync4, renameSync as renameSync2, statSync as statSync16, openSync as openSync6, readSync as readSync6, closeSync as closeSync6 } from "fs";
|
|
13907
13950
|
import { dirname as dirname14, join as join20 } from "path";
|
|
13908
13951
|
function shadowRoot() {
|
|
13909
13952
|
return join20(getDataDir(), "shadow");
|
|
@@ -14112,7 +14155,7 @@ function liveFingerprint(backend, rawId) {
|
|
|
14112
14155
|
const loc = backend.findSession(rawId);
|
|
14113
14156
|
if (!loc?.path)
|
|
14114
14157
|
return "";
|
|
14115
|
-
const st =
|
|
14158
|
+
const st = statSync16(loc.path);
|
|
14116
14159
|
return `${st.mtimeMs}:${st.size}`;
|
|
14117
14160
|
} catch {
|
|
14118
14161
|
return "";
|
|
@@ -14132,7 +14175,7 @@ function shadowUncompressedBytes(tool, rawId) {
|
|
|
14132
14175
|
const path = shadowFileFor(tool, rawId);
|
|
14133
14176
|
let fd = null;
|
|
14134
14177
|
try {
|
|
14135
|
-
const size =
|
|
14178
|
+
const size = statSync16(path).size;
|
|
14136
14179
|
if (size < 18)
|
|
14137
14180
|
return 0;
|
|
14138
14181
|
fd = openSync6(path, "r");
|
|
@@ -14153,7 +14196,7 @@ function shadowUncompressedBytes(tool, rawId) {
|
|
|
14153
14196
|
}
|
|
14154
14197
|
function shadowSizeOnDisk(tool, rawId) {
|
|
14155
14198
|
try {
|
|
14156
|
-
return
|
|
14199
|
+
return statSync16(shadowFileFor(tool, rawId)).size;
|
|
14157
14200
|
} catch {
|
|
14158
14201
|
return 0;
|
|
14159
14202
|
}
|
|
@@ -14195,7 +14238,7 @@ __export(live_session_scan_exports, {
|
|
|
14195
14238
|
withSessionReadCache: () => withSessionReadCache,
|
|
14196
14239
|
withSessionScanScope: () => withSessionScanScope
|
|
14197
14240
|
});
|
|
14198
|
-
import { existsSync as existsSync18, readdirSync as readdirSync13, readFileSync as readFileSync15, statSync as
|
|
14241
|
+
import { existsSync as existsSync18, readdirSync as readdirSync13, readFileSync as readFileSync15, statSync as statSync17, openSync as openSync7, readSync as readSync7, closeSync as closeSync7 } from "fs";
|
|
14199
14242
|
import { join as join21, basename as basename11 } from "path";
|
|
14200
14243
|
import { createHash as createHash7 } from "crypto";
|
|
14201
14244
|
function lazyGeminiProjectsJson() {
|
|
@@ -14348,7 +14391,7 @@ function readSessionGroupText(group) {
|
|
|
14348
14391
|
const parts = [];
|
|
14349
14392
|
for (const p of group.paths) {
|
|
14350
14393
|
try {
|
|
14351
|
-
const st =
|
|
14394
|
+
const st = statSync17(p);
|
|
14352
14395
|
parts.push(`${p}:${st.mtimeMs}:${st.size}`);
|
|
14353
14396
|
} catch {
|
|
14354
14397
|
parts.push(`${p}:missing`);
|
|
@@ -14368,7 +14411,7 @@ function readSessionGroupText(group) {
|
|
|
14368
14411
|
continue;
|
|
14369
14412
|
}
|
|
14370
14413
|
try {
|
|
14371
|
-
mtime = Math.max(mtime,
|
|
14414
|
+
mtime = Math.max(mtime, statSync17(p).mtimeMs);
|
|
14372
14415
|
} catch {
|
|
14373
14416
|
}
|
|
14374
14417
|
text = text ? mergeLineText(text, raw).text : raw;
|
|
@@ -14683,7 +14726,7 @@ var init_live_session_scan = __esm({
|
|
|
14683
14726
|
INDEX_RECHECK_MS = 1e3;
|
|
14684
14727
|
dirMtime = (p) => {
|
|
14685
14728
|
try {
|
|
14686
|
-
return
|
|
14729
|
+
return statSync17(p).mtimeMs;
|
|
14687
14730
|
} catch {
|
|
14688
14731
|
return -1;
|
|
14689
14732
|
}
|
|
@@ -14904,7 +14947,7 @@ var init_session_outcome = __esm({
|
|
|
14904
14947
|
});
|
|
14905
14948
|
|
|
14906
14949
|
// ../engine/dist/core/backends/pi.js
|
|
14907
|
-
import { readdirSync as readdirSync14, readFileSync as readFileSync16, statSync as
|
|
14950
|
+
import { readdirSync as readdirSync14, readFileSync as readFileSync16, statSync as statSync18, openSync as openSync8, readSync as readSync8, closeSync as closeSync8 } from "fs";
|
|
14908
14951
|
import { createHash as createHash8 } from "crypto";
|
|
14909
14952
|
import { basename as basename12, join as join22 } from "path";
|
|
14910
14953
|
function parsePiFile(path) {
|
|
@@ -14990,7 +15033,7 @@ function readPiHeader(path) {
|
|
|
14990
15033
|
function dirSignature(root) {
|
|
14991
15034
|
const parts = [];
|
|
14992
15035
|
try {
|
|
14993
|
-
parts.push(String(
|
|
15036
|
+
parts.push(String(statSync18(root).mtimeMs));
|
|
14994
15037
|
} catch {
|
|
14995
15038
|
return "missing";
|
|
14996
15039
|
}
|
|
@@ -15004,7 +15047,7 @@ function dirSignature(root) {
|
|
|
15004
15047
|
if (!entry.isDirectory())
|
|
15005
15048
|
continue;
|
|
15006
15049
|
try {
|
|
15007
|
-
parts.push(`${entry.name}:${
|
|
15050
|
+
parts.push(`${entry.name}:${statSync18(join22(root, entry.name)).mtimeMs}`);
|
|
15008
15051
|
} catch {
|
|
15009
15052
|
}
|
|
15010
15053
|
}
|
|
@@ -15029,7 +15072,7 @@ function projectSuffix(projectDir) {
|
|
|
15029
15072
|
}
|
|
15030
15073
|
function mtimeOf(path, fallback) {
|
|
15031
15074
|
try {
|
|
15032
|
-
return
|
|
15075
|
+
return statSync18(path).mtimeMs;
|
|
15033
15076
|
} catch {
|
|
15034
15077
|
return fallback;
|
|
15035
15078
|
}
|
|
@@ -15123,7 +15166,7 @@ var init_pi = __esm({
|
|
|
15123
15166
|
for (const path of walkSessionFiles(root)) {
|
|
15124
15167
|
let mtime = 0;
|
|
15125
15168
|
try {
|
|
15126
|
-
mtime =
|
|
15169
|
+
mtime = statSync18(path).mtimeMs;
|
|
15127
15170
|
} catch {
|
|
15128
15171
|
continue;
|
|
15129
15172
|
}
|
|
@@ -15179,7 +15222,7 @@ var init_pi = __esm({
|
|
|
15179
15222
|
return null;
|
|
15180
15223
|
let mtime = 0;
|
|
15181
15224
|
try {
|
|
15182
|
-
mtime =
|
|
15225
|
+
mtime = statSync18(path).mtimeMs;
|
|
15183
15226
|
} catch {
|
|
15184
15227
|
}
|
|
15185
15228
|
return {
|
|
@@ -15197,7 +15240,7 @@ var init_pi = __esm({
|
|
|
15197
15240
|
for (const [rawId, path] of this.fileIndex()) {
|
|
15198
15241
|
let stat3;
|
|
15199
15242
|
try {
|
|
15200
|
-
stat3 =
|
|
15243
|
+
stat3 = statSync18(path);
|
|
15201
15244
|
} catch {
|
|
15202
15245
|
continue;
|
|
15203
15246
|
}
|
|
@@ -15448,7 +15491,7 @@ var init_pi = __esm({
|
|
|
15448
15491
|
for (const [rawId, path] of this.fileIndex()) {
|
|
15449
15492
|
let stat3;
|
|
15450
15493
|
try {
|
|
15451
|
-
stat3 =
|
|
15494
|
+
stat3 = statSync18(path);
|
|
15452
15495
|
} catch {
|
|
15453
15496
|
continue;
|
|
15454
15497
|
}
|
|
@@ -15496,7 +15539,7 @@ var init_pi = __esm({
|
|
|
15496
15539
|
if (!located)
|
|
15497
15540
|
return null;
|
|
15498
15541
|
try {
|
|
15499
|
-
const st =
|
|
15542
|
+
const st = statSync18(located.path);
|
|
15500
15543
|
return {
|
|
15501
15544
|
tool: "pi",
|
|
15502
15545
|
mtime: st.mtimeMs,
|
|
@@ -15514,7 +15557,7 @@ var init_pi = __esm({
|
|
|
15514
15557
|
if (!located)
|
|
15515
15558
|
return 0;
|
|
15516
15559
|
try {
|
|
15517
|
-
return
|
|
15560
|
+
return statSync18(located.path).size;
|
|
15518
15561
|
} catch {
|
|
15519
15562
|
return 0;
|
|
15520
15563
|
}
|
|
@@ -15541,7 +15584,7 @@ __export(home_discovery_exports, {
|
|
|
15541
15584
|
sessionIdsInHome: () => sessionIdsInHome
|
|
15542
15585
|
});
|
|
15543
15586
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
15544
|
-
import { existsSync as existsSync19, readdirSync as readdirSync15, readFileSync as readFileSync17, realpathSync as realpathSync4, statSync as
|
|
15587
|
+
import { existsSync as existsSync19, readdirSync as readdirSync15, readFileSync as readFileSync17, realpathSync as realpathSync4, statSync as statSync19 } from "fs";
|
|
15545
15588
|
import { homedir as homedir6, platform as osPlatform } from "os";
|
|
15546
15589
|
import { basename as basename13, join as join23 } from "path";
|
|
15547
15590
|
function candidateRoots(plat = osPlatform(), env = process.env) {
|
|
@@ -15752,7 +15795,7 @@ function sessionIdsInHome(dir, tool) {
|
|
|
15752
15795
|
continue;
|
|
15753
15796
|
let mtime = 0;
|
|
15754
15797
|
try {
|
|
15755
|
-
mtime =
|
|
15798
|
+
mtime = statSync19(full).mtimeMs;
|
|
15756
15799
|
} catch {
|
|
15757
15800
|
continue;
|
|
15758
15801
|
}
|
|
@@ -15908,7 +15951,7 @@ function discoverHomes(opts = {}) {
|
|
|
15908
15951
|
return;
|
|
15909
15952
|
}
|
|
15910
15953
|
try {
|
|
15911
|
-
if (!
|
|
15954
|
+
if (!statSync19(real).isDirectory())
|
|
15912
15955
|
return;
|
|
15913
15956
|
} catch {
|
|
15914
15957
|
return;
|
|
@@ -16010,7 +16053,7 @@ __export(detector_install_exports, {
|
|
|
16010
16053
|
});
|
|
16011
16054
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
16012
16055
|
import { createHash as createHash9 } from "crypto";
|
|
16013
|
-
import { existsSync as existsSync20, mkdirSync as mkdirSync5, mkdtempSync, chmodSync as chmodSync3, renameSync as renameSync3, rmSync as rmSync2, writeFileSync as writeFileSync5, readFileSync as readFileSync18, statSync as
|
|
16056
|
+
import { existsSync as existsSync20, mkdirSync as mkdirSync5, mkdtempSync, chmodSync as chmodSync3, renameSync as renameSync3, rmSync as rmSync2, writeFileSync as writeFileSync5, readFileSync as readFileSync18, statSync as statSync20, copyFileSync as copyFileSync2 } from "fs";
|
|
16014
16057
|
import { join as join24 } from "path";
|
|
16015
16058
|
function managedDetectorPath(name) {
|
|
16016
16059
|
return join24(getDetectorBinDir(), name + exeSuffix());
|
|
@@ -16031,7 +16074,7 @@ function readReceipt(name) {
|
|
|
16031
16074
|
function verifiedSha(path) {
|
|
16032
16075
|
let st;
|
|
16033
16076
|
try {
|
|
16034
|
-
st =
|
|
16077
|
+
st = statSync20(path);
|
|
16035
16078
|
} catch {
|
|
16036
16079
|
return null;
|
|
16037
16080
|
}
|
|
@@ -16812,7 +16855,7 @@ __export(sync_ledger_exports, {
|
|
|
16812
16855
|
syncMode: () => syncMode,
|
|
16813
16856
|
unackedCursorAttemptCount: () => unackedCursorAttemptCount
|
|
16814
16857
|
});
|
|
16815
|
-
import { readFileSync as readFileSync21, writeFileSync as writeFileSync6, renameSync as renameSync4, mkdirSync as mkdirSync6, statSync as
|
|
16858
|
+
import { readFileSync as readFileSync21, writeFileSync as writeFileSync6, renameSync as renameSync4, mkdirSync as mkdirSync6, statSync as statSync21 } from "node:fs";
|
|
16816
16859
|
import { join as join26, dirname as dirname15 } from "node:path";
|
|
16817
16860
|
function toRow(entry) {
|
|
16818
16861
|
if (entry === void 0) return void 0;
|
|
@@ -16823,7 +16866,7 @@ function ledgerFilePath() {
|
|
|
16823
16866
|
}
|
|
16824
16867
|
function stampOf(path) {
|
|
16825
16868
|
try {
|
|
16826
|
-
const st =
|
|
16869
|
+
const st = statSync21(path);
|
|
16827
16870
|
return `${st.mtimeMs}:${st.size}`;
|
|
16828
16871
|
} catch {
|
|
16829
16872
|
return null;
|
|
@@ -17462,7 +17505,7 @@ __export(transcript_exports, {
|
|
|
17462
17505
|
writeShadowContainer: () => writeShadowContainer,
|
|
17463
17506
|
writeTranscriptEnvelope: () => writeTranscriptEnvelope
|
|
17464
17507
|
});
|
|
17465
|
-
import { statSync as
|
|
17508
|
+
import { statSync as statSync22 } from "fs";
|
|
17466
17509
|
async function parseTranscript(sessionId, opts = {}) {
|
|
17467
17510
|
const t = await parseTranscriptUncut(sessionId, opts);
|
|
17468
17511
|
const cap = opts.payloadCap;
|
|
@@ -17540,7 +17583,7 @@ async function parseTranscriptUncut(sessionId, opts) {
|
|
|
17540
17583
|
}
|
|
17541
17584
|
function safeMtime(path) {
|
|
17542
17585
|
try {
|
|
17543
|
-
return
|
|
17586
|
+
return statSync22(path).mtimeMs;
|
|
17544
17587
|
} catch {
|
|
17545
17588
|
return 0;
|
|
17546
17589
|
}
|
|
@@ -18022,11 +18065,11 @@ var init_entity_extractor = __esm({
|
|
|
18022
18065
|
});
|
|
18023
18066
|
|
|
18024
18067
|
// ../engine/dist/core/source-policy.js
|
|
18025
|
-
import { statSync as
|
|
18068
|
+
import { statSync as statSync23 } from "fs";
|
|
18026
18069
|
function settings() {
|
|
18027
18070
|
let mtimeMs = -1;
|
|
18028
18071
|
try {
|
|
18029
|
-
mtimeMs =
|
|
18072
|
+
mtimeMs = statSync23(settingsFilePath()).mtimeMs;
|
|
18030
18073
|
} catch {
|
|
18031
18074
|
}
|
|
18032
18075
|
if (cache3 && cache3.mtimeMs === mtimeMs)
|
|
@@ -18296,7 +18339,7 @@ var init_utils = __esm({
|
|
|
18296
18339
|
});
|
|
18297
18340
|
|
|
18298
18341
|
// ../engine/dist/parsers/plan-source.js
|
|
18299
|
-
import { existsSync as existsSync23, readdirSync as readdirSync17, readFileSync as readFileSync22, statSync as
|
|
18342
|
+
import { existsSync as existsSync23, readdirSync as readdirSync17, readFileSync as readFileSync22, statSync as statSync24 } from "fs";
|
|
18300
18343
|
import { homedir as homedir8 } from "os";
|
|
18301
18344
|
import { join as join28, basename as basename14 } from "path";
|
|
18302
18345
|
function parseFrontmatter(content) {
|
|
@@ -18395,7 +18438,7 @@ var init_plan_source = __esm({
|
|
|
18395
18438
|
seenClaude.add(file);
|
|
18396
18439
|
const filePath = join28(plansDir, file);
|
|
18397
18440
|
try {
|
|
18398
|
-
const stat3 =
|
|
18441
|
+
const stat3 = statSync24(filePath);
|
|
18399
18442
|
const planName = basename14(file, ".md");
|
|
18400
18443
|
const isAgentPlan = planName.includes("-agent-");
|
|
18401
18444
|
const content = readFileSync22(filePath, "utf-8");
|
|
@@ -18439,7 +18482,7 @@ var init_plan_source = __esm({
|
|
|
18439
18482
|
for (const file of files) {
|
|
18440
18483
|
const filePath = join28(plansDir, file);
|
|
18441
18484
|
try {
|
|
18442
|
-
const stat3 =
|
|
18485
|
+
const stat3 = statSync24(filePath);
|
|
18443
18486
|
const content = readFileSync22(filePath, "utf-8");
|
|
18444
18487
|
const firstLine = content.split("\n").find((l) => l.trim())?.replace(/^#+\s*/, "").trim() || file;
|
|
18445
18488
|
const planName = `${opencodeBackend.idPrefix}plan_${basename14(file, ".md")}`;
|
|
@@ -18642,7 +18685,7 @@ var init_plan_source = __esm({
|
|
|
18642
18685
|
for (const rawId of sessionDirs) {
|
|
18643
18686
|
const sessionPath = join28(brainDir, rawId);
|
|
18644
18687
|
try {
|
|
18645
|
-
if (!
|
|
18688
|
+
if (!statSync24(sessionPath).isDirectory())
|
|
18646
18689
|
continue;
|
|
18647
18690
|
} catch {
|
|
18648
18691
|
continue;
|
|
@@ -18656,7 +18699,7 @@ var init_plan_source = __esm({
|
|
|
18656
18699
|
for (const file of files) {
|
|
18657
18700
|
const filePath = join28(sessionPath, file);
|
|
18658
18701
|
try {
|
|
18659
|
-
const stat3 =
|
|
18702
|
+
const stat3 = statSync24(filePath);
|
|
18660
18703
|
const content = readFileSync22(filePath, "utf-8");
|
|
18661
18704
|
const firstLine = content.split("\n").find((l) => l.trim())?.replace(/^#+\s*/, "").trim() || file;
|
|
18662
18705
|
const sessionLoc = agyBackend.findSession(rawId);
|
|
@@ -18686,7 +18729,7 @@ var init_plan_source = __esm({
|
|
|
18686
18729
|
});
|
|
18687
18730
|
|
|
18688
18731
|
// ../engine/dist/parsers/task-source.js
|
|
18689
|
-
import { existsSync as existsSync24, readdirSync as readdirSync18, readFileSync as readFileSync23, statSync as
|
|
18732
|
+
import { existsSync as existsSync24, readdirSync as readdirSync18, readFileSync as readFileSync23, statSync as statSync25 } from "fs";
|
|
18690
18733
|
import { join as join29 } from "path";
|
|
18691
18734
|
var MAX_CHUNK_CHARS2, TaskSource;
|
|
18692
18735
|
var init_task_source = __esm({
|
|
@@ -18728,7 +18771,7 @@ var init_task_source = __esm({
|
|
|
18728
18771
|
const filePath = join29(todosDir, file);
|
|
18729
18772
|
let stat3;
|
|
18730
18773
|
try {
|
|
18731
|
-
stat3 =
|
|
18774
|
+
stat3 = statSync25(filePath);
|
|
18732
18775
|
} catch {
|
|
18733
18776
|
continue;
|
|
18734
18777
|
}
|
|
@@ -18776,7 +18819,7 @@ var init_task_source = __esm({
|
|
|
18776
18819
|
const sessionUuid = entry.name;
|
|
18777
18820
|
const taskDir = join29(tasksDir, sessionUuid);
|
|
18778
18821
|
try {
|
|
18779
|
-
const stat3 =
|
|
18822
|
+
const stat3 = statSync25(taskDir);
|
|
18780
18823
|
const taskFiles = readdirSync18(taskDir).filter((f) => f.endsWith(".json"));
|
|
18781
18824
|
if (taskFiles.length === 0)
|
|
18782
18825
|
continue;
|
|
@@ -18922,7 +18965,7 @@ ${task.description}`.slice(0, MAX_CHUNK_CHARS2);
|
|
|
18922
18965
|
});
|
|
18923
18966
|
|
|
18924
18967
|
// ../engine/dist/parsers/claude-md-source.js
|
|
18925
|
-
import { existsSync as existsSync25, readFileSync as readFileSync24, readdirSync as readdirSync19, statSync as
|
|
18968
|
+
import { existsSync as existsSync25, readFileSync as readFileSync24, readdirSync as readdirSync19, statSync as statSync26 } from "fs";
|
|
18926
18969
|
import { homedir as homedir9 } from "os";
|
|
18927
18970
|
import { join as join30, basename as basename15, dirname as dirname16 } from "path";
|
|
18928
18971
|
import { createHash as createHash10 } from "crypto";
|
|
@@ -19119,7 +19162,7 @@ var init_claude_md_source = __esm({
|
|
|
19119
19162
|
}
|
|
19120
19163
|
fileToItem(filePath, filename, tool) {
|
|
19121
19164
|
try {
|
|
19122
|
-
const stat3 =
|
|
19165
|
+
const stat3 = statSync26(filePath);
|
|
19123
19166
|
const projectDir = dirname16(filePath);
|
|
19124
19167
|
const projectName = basename15(projectDir);
|
|
19125
19168
|
const projectPath = projectDir;
|
|
@@ -19148,7 +19191,7 @@ var init_claude_md_source = __esm({
|
|
|
19148
19191
|
});
|
|
19149
19192
|
|
|
19150
19193
|
// ../engine/dist/parsers/agent-memory-source.js
|
|
19151
|
-
import { existsSync as existsSync26, readFileSync as readFileSync25, readdirSync as readdirSync20, statSync as
|
|
19194
|
+
import { existsSync as existsSync26, readFileSync as readFileSync25, readdirSync as readdirSync20, statSync as statSync27 } from "fs";
|
|
19152
19195
|
import { homedir as homedir10 } from "os";
|
|
19153
19196
|
import { join as join31, basename as basename16 } from "path";
|
|
19154
19197
|
function parseFrontmatter2(content) {
|
|
@@ -19301,7 +19344,7 @@ var init_agent_memory_source = __esm({
|
|
|
19301
19344
|
}
|
|
19302
19345
|
fileToItem(filePath, filename, projectPath, _projectHash) {
|
|
19303
19346
|
try {
|
|
19304
|
-
const stat3 =
|
|
19347
|
+
const stat3 = statSync27(filePath);
|
|
19305
19348
|
const content = readFileSync25(filePath, "utf-8");
|
|
19306
19349
|
const { fm } = parseFrontmatter2(content);
|
|
19307
19350
|
const stem = filename.replace(/\.md$/, "");
|
|
@@ -19333,7 +19376,7 @@ var init_agent_memory_source = __esm({
|
|
|
19333
19376
|
});
|
|
19334
19377
|
|
|
19335
19378
|
// ../engine/dist/parsers/history-source.js
|
|
19336
|
-
import { existsSync as existsSync27, readdirSync as readdirSync21, statSync as
|
|
19379
|
+
import { existsSync as existsSync27, readdirSync as readdirSync21, statSync as statSync28 } from "fs";
|
|
19337
19380
|
import { createReadStream as createReadStream3 } from "fs";
|
|
19338
19381
|
import { createInterface as createInterface2 } from "readline";
|
|
19339
19382
|
import { homedir as homedir11 } from "os";
|
|
@@ -19376,7 +19419,7 @@ var init_history_source = __esm({
|
|
|
19376
19419
|
const historyPath = this.historyPaths.find((p) => existsSync27(p));
|
|
19377
19420
|
if (!historyPath)
|
|
19378
19421
|
return;
|
|
19379
|
-
const stat3 =
|
|
19422
|
+
const stat3 = statSync28(historyPath);
|
|
19380
19423
|
const groups = await this.groupByProject();
|
|
19381
19424
|
for (const [project, group] of groups) {
|
|
19382
19425
|
const projectId = project.replace(/\//g, "-").replace(/^-/, "");
|
|
@@ -19517,7 +19560,7 @@ var init_history_source = __esm({
|
|
|
19517
19560
|
});
|
|
19518
19561
|
|
|
19519
19562
|
// ../engine/dist/parsers/paste-source.js
|
|
19520
|
-
import { existsSync as existsSync28, readdirSync as readdirSync22, readFileSync as readFileSync26, statSync as
|
|
19563
|
+
import { existsSync as existsSync28, readdirSync as readdirSync22, readFileSync as readFileSync26, statSync as statSync29 } from "fs";
|
|
19521
19564
|
import { homedir as homedir12 } from "os";
|
|
19522
19565
|
import { join as join33, basename as basename17 } from "path";
|
|
19523
19566
|
var MAX_CHUNK_CHARS6, MAX_FILE_SIZE, PasteSource;
|
|
@@ -19567,7 +19610,7 @@ var init_paste_source = __esm({
|
|
|
19567
19610
|
seen.add(file);
|
|
19568
19611
|
const filePath = join33(cacheDir, file);
|
|
19569
19612
|
try {
|
|
19570
|
-
const stat3 =
|
|
19613
|
+
const stat3 = statSync29(filePath);
|
|
19571
19614
|
if (stat3.size > MAX_FILE_SIZE)
|
|
19572
19615
|
continue;
|
|
19573
19616
|
if (stat3.size < 10)
|
|
@@ -19617,7 +19660,7 @@ var init_paste_source = __esm({
|
|
|
19617
19660
|
});
|
|
19618
19661
|
|
|
19619
19662
|
// ../engine/dist/parsers/antigravity-brain-source.js
|
|
19620
|
-
import { existsSync as existsSync29, readdirSync as readdirSync23, readFileSync as readFileSync27, statSync as
|
|
19663
|
+
import { existsSync as existsSync29, readdirSync as readdirSync23, readFileSync as readFileSync27, statSync as statSync30 } from "fs";
|
|
19621
19664
|
import { join as join34 } from "path";
|
|
19622
19665
|
var MAX_CHUNK_CHARS7, AntigravityBrainSource;
|
|
19623
19666
|
var init_antigravity_brain_source = __esm({
|
|
@@ -19649,7 +19692,7 @@ var init_antigravity_brain_source = __esm({
|
|
|
19649
19692
|
for (const file of files) {
|
|
19650
19693
|
const filePath = join34(sessionDir, file);
|
|
19651
19694
|
try {
|
|
19652
|
-
const stat3 =
|
|
19695
|
+
const stat3 = statSync30(filePath);
|
|
19653
19696
|
const content = readFileSync27(filePath, "utf-8");
|
|
19654
19697
|
const firstLine = content.split("\n").find((l) => l.trim() && !l.startsWith("#"))?.trim() || "";
|
|
19655
19698
|
const heading = content.split("\n").find((l) => l.startsWith("#"))?.replace(/^#+\s*/, "").trim() || file;
|
|
@@ -20031,7 +20074,7 @@ var init_opencode_todo_source = __esm({
|
|
|
20031
20074
|
});
|
|
20032
20075
|
|
|
20033
20076
|
// ../engine/dist/parsers/codex-session-source.js
|
|
20034
|
-
import { existsSync as existsSync32, readdirSync as readdirSync24, readFileSync as readFileSync28, statSync as
|
|
20077
|
+
import { existsSync as existsSync32, readdirSync as readdirSync24, readFileSync as readFileSync28, statSync as statSync31 } from "fs";
|
|
20035
20078
|
import { join as join35, basename as basename18 } from "path";
|
|
20036
20079
|
function getCodexSessionsDir() {
|
|
20037
20080
|
return codexBackend.sessionsDir();
|
|
@@ -20093,7 +20136,7 @@ var init_codex_session_source = __esm({
|
|
|
20093
20136
|
const jsonlFiles = this.collectJsonlFiles(this.sessionsDir);
|
|
20094
20137
|
for (const filePath of jsonlFiles) {
|
|
20095
20138
|
try {
|
|
20096
|
-
const stat3 =
|
|
20139
|
+
const stat3 = statSync31(filePath);
|
|
20097
20140
|
const lines = readFileSync28(filePath, "utf-8").split("\n");
|
|
20098
20141
|
const firstLine = lines.find((l) => l.trim());
|
|
20099
20142
|
if (!firstLine)
|
|
@@ -20267,7 +20310,7 @@ var init_codex_session_source = __esm({
|
|
|
20267
20310
|
});
|
|
20268
20311
|
|
|
20269
20312
|
// ../engine/dist/parsers/diary-source.js
|
|
20270
|
-
import { existsSync as existsSync33, mkdirSync as mkdirSync7, readdirSync as readdirSync25, readFileSync as readFileSync29, writeFileSync as writeFileSync7, statSync as
|
|
20313
|
+
import { existsSync as existsSync33, mkdirSync as mkdirSync7, readdirSync as readdirSync25, readFileSync as readFileSync29, writeFileSync as writeFileSync7, statSync as statSync32 } from "fs";
|
|
20271
20314
|
import { join as join36, basename as basename19 } from "path";
|
|
20272
20315
|
var MAX_CHUNK_CHARS10, DiarySource;
|
|
20273
20316
|
var init_diary_source = __esm({
|
|
@@ -20292,7 +20335,7 @@ var init_diary_source = __esm({
|
|
|
20292
20335
|
for (const file of files) {
|
|
20293
20336
|
const filePath = join36(agentPath2, file);
|
|
20294
20337
|
try {
|
|
20295
|
-
const stat3 =
|
|
20338
|
+
const stat3 = statSync32(filePath);
|
|
20296
20339
|
const raw = readFileSync29(filePath, "utf-8");
|
|
20297
20340
|
const entry = JSON.parse(raw);
|
|
20298
20341
|
const entryId = basename19(file, ".json");
|
|
@@ -20428,7 +20471,7 @@ var init_redact_inline = __esm({
|
|
|
20428
20471
|
});
|
|
20429
20472
|
|
|
20430
20473
|
// ../engine/dist/parsers/skills-source.js
|
|
20431
|
-
import { existsSync as existsSync34, readdirSync as readdirSync26, readFileSync as readFileSync30, statSync as
|
|
20474
|
+
import { existsSync as existsSync34, readdirSync as readdirSync26, readFileSync as readFileSync30, statSync as statSync33 } from "fs";
|
|
20432
20475
|
import { homedir as homedir13 } from "os";
|
|
20433
20476
|
import { join as join37 } from "path";
|
|
20434
20477
|
function rebuildBody(content) {
|
|
@@ -20536,7 +20579,7 @@ var init_skills_source = __esm({
|
|
|
20536
20579
|
const skillDir = join37(root.path, name);
|
|
20537
20580
|
let st;
|
|
20538
20581
|
try {
|
|
20539
|
-
st =
|
|
20582
|
+
st = statSync33(skillDir);
|
|
20540
20583
|
} catch {
|
|
20541
20584
|
continue;
|
|
20542
20585
|
}
|
|
@@ -20558,7 +20601,7 @@ var init_skills_source = __esm({
|
|
|
20558
20601
|
const skillName = fm.name || name;
|
|
20559
20602
|
let mtime = st.mtimeMs;
|
|
20560
20603
|
try {
|
|
20561
|
-
mtime =
|
|
20604
|
+
mtime = statSync33(skillMd).mtimeMs;
|
|
20562
20605
|
} catch {
|
|
20563
20606
|
}
|
|
20564
20607
|
const subdirs = {};
|
|
@@ -20566,7 +20609,7 @@ var init_skills_source = __esm({
|
|
|
20566
20609
|
for (const sub of readdirSync26(skillDir)) {
|
|
20567
20610
|
const subPath = join37(skillDir, sub);
|
|
20568
20611
|
try {
|
|
20569
|
-
const ss =
|
|
20612
|
+
const ss = statSync33(subPath);
|
|
20570
20613
|
if (ss.isDirectory()) {
|
|
20571
20614
|
let count = 0;
|
|
20572
20615
|
try {
|
|
@@ -28025,7 +28068,7 @@ var init_hermes_config = __esm({
|
|
|
28025
28068
|
});
|
|
28026
28069
|
|
|
28027
28070
|
// ../engine/dist/parsers/mcps-source.js
|
|
28028
|
-
import { existsSync as existsSync36, readFileSync as readFileSync32, statSync as
|
|
28071
|
+
import { existsSync as existsSync36, readFileSync as readFileSync32, statSync as statSync34 } from "fs";
|
|
28029
28072
|
import { homedir as homedir14 } from "os";
|
|
28030
28073
|
import { join as join39 } from "path";
|
|
28031
28074
|
function readJson(path) {
|
|
@@ -28164,7 +28207,7 @@ var init_mcps_source = __esm({
|
|
|
28164
28207
|
return;
|
|
28165
28208
|
let mtime = 0;
|
|
28166
28209
|
try {
|
|
28167
|
-
mtime =
|
|
28210
|
+
mtime = statSync34(ctx.filePath).mtimeMs;
|
|
28168
28211
|
} catch {
|
|
28169
28212
|
}
|
|
28170
28213
|
for (const [name, cfgRaw] of Object.entries(obj2)) {
|
|
@@ -28378,7 +28421,7 @@ var init_toolkit_format = __esm({
|
|
|
28378
28421
|
});
|
|
28379
28422
|
|
|
28380
28423
|
// ../engine/dist/parsers/slash-commands-source.js
|
|
28381
|
-
import { existsSync as existsSync37, readdirSync as readdirSync27, readFileSync as readFileSync33, statSync as
|
|
28424
|
+
import { existsSync as existsSync37, readdirSync as readdirSync27, readFileSync as readFileSync33, statSync as statSync35 } from "fs";
|
|
28382
28425
|
import { join as join40, basename as basename20 } from "path";
|
|
28383
28426
|
function rebuildBody2(content) {
|
|
28384
28427
|
const { text, redacted } = redactInlineSecrets(content);
|
|
@@ -28476,7 +28519,7 @@ var init_slash_commands_source = __esm({
|
|
|
28476
28519
|
for (const file of files) {
|
|
28477
28520
|
const filePath = join40(root.path, file);
|
|
28478
28521
|
try {
|
|
28479
|
-
const stat3 =
|
|
28522
|
+
const stat3 = statSync35(filePath);
|
|
28480
28523
|
const content = readFileSync33(filePath, "utf-8");
|
|
28481
28524
|
const parsed = parseCommand(content, basename20(file, ext), root.format);
|
|
28482
28525
|
yield {
|
|
@@ -28529,7 +28572,7 @@ var init_slash_commands_source = __esm({
|
|
|
28529
28572
|
});
|
|
28530
28573
|
|
|
28531
28574
|
// ../engine/dist/parsers/subagents-source.js
|
|
28532
|
-
import { existsSync as existsSync38, readdirSync as readdirSync28, readFileSync as readFileSync34, statSync as
|
|
28575
|
+
import { existsSync as existsSync38, readdirSync as readdirSync28, readFileSync as readFileSync34, statSync as statSync36 } from "fs";
|
|
28533
28576
|
import { join as join41, basename as basename21 } from "path";
|
|
28534
28577
|
function rebuildBody3(content) {
|
|
28535
28578
|
const { text, redacted } = redactInlineSecrets(content);
|
|
@@ -28625,7 +28668,7 @@ var init_subagents_source = __esm({
|
|
|
28625
28668
|
for (const file of files) {
|
|
28626
28669
|
const filePath = join41(root.path, file);
|
|
28627
28670
|
try {
|
|
28628
|
-
const stat3 =
|
|
28671
|
+
const stat3 = statSync36(filePath);
|
|
28629
28672
|
const content = readFileSync34(filePath, "utf-8");
|
|
28630
28673
|
const parsed = parseAgent(content, basename21(file, ext), root.format);
|
|
28631
28674
|
yield {
|
|
@@ -28679,7 +28722,7 @@ var init_subagents_source = __esm({
|
|
|
28679
28722
|
});
|
|
28680
28723
|
|
|
28681
28724
|
// ../engine/dist/parsers/hooks-source.js
|
|
28682
|
-
import { existsSync as existsSync39, readFileSync as readFileSync35, readdirSync as readdirSync29, statSync as
|
|
28725
|
+
import { existsSync as existsSync39, readFileSync as readFileSync35, readdirSync as readdirSync29, statSync as statSync37 } from "fs";
|
|
28683
28726
|
import { join as join42 } from "path";
|
|
28684
28727
|
function readJson2(path) {
|
|
28685
28728
|
if (!existsSync39(path))
|
|
@@ -28728,7 +28771,7 @@ var init_hooks_source = __esm({
|
|
|
28728
28771
|
return;
|
|
28729
28772
|
let mtime = 0;
|
|
28730
28773
|
try {
|
|
28731
|
-
mtime =
|
|
28774
|
+
mtime = statSync37(settingsPath2).mtimeMs;
|
|
28732
28775
|
} catch {
|
|
28733
28776
|
}
|
|
28734
28777
|
for (const [event, groups] of Object.entries(hooks)) {
|
|
@@ -28802,7 +28845,7 @@ var init_hooks_source = __esm({
|
|
|
28802
28845
|
});
|
|
28803
28846
|
|
|
28804
28847
|
// ../engine/dist/parsers/plugins-source.js
|
|
28805
|
-
import { existsSync as existsSync40, readFileSync as readFileSync36, readdirSync as readdirSync30, statSync as
|
|
28848
|
+
import { existsSync as existsSync40, readFileSync as readFileSync36, readdirSync as readdirSync30, statSync as statSync38 } from "fs";
|
|
28806
28849
|
import { homedir as homedir15 } from "os";
|
|
28807
28850
|
import { join as join43 } from "path";
|
|
28808
28851
|
function readJson3(path) {
|
|
@@ -28831,7 +28874,7 @@ var init_plugins_source = __esm({
|
|
|
28831
28874
|
if (claudeJson?.plugins && typeof claudeJson.plugins === "object") {
|
|
28832
28875
|
let mtime = 0;
|
|
28833
28876
|
try {
|
|
28834
|
-
mtime =
|
|
28877
|
+
mtime = statSync38(claudePluginsManifest).mtimeMs;
|
|
28835
28878
|
} catch {
|
|
28836
28879
|
}
|
|
28837
28880
|
for (const [pluginRef, installs] of Object.entries(claudeJson.plugins)) {
|
|
@@ -28872,7 +28915,7 @@ var init_plugins_source = __esm({
|
|
|
28872
28915
|
const dir = join43(gemRoot, name);
|
|
28873
28916
|
let st;
|
|
28874
28917
|
try {
|
|
28875
|
-
st =
|
|
28918
|
+
st = statSync38(dir);
|
|
28876
28919
|
} catch {
|
|
28877
28920
|
continue;
|
|
28878
28921
|
}
|
|
@@ -28884,7 +28927,7 @@ var init_plugins_source = __esm({
|
|
|
28884
28927
|
continue;
|
|
28885
28928
|
let mtime = st.mtimeMs;
|
|
28886
28929
|
try {
|
|
28887
|
-
mtime =
|
|
28930
|
+
mtime = statSync38(manifestPath).mtimeMs;
|
|
28888
28931
|
} catch {
|
|
28889
28932
|
}
|
|
28890
28933
|
const mcpServers = manifest.mcpServers ? Object.keys(manifest.mcpServers) : [];
|
|
@@ -28912,7 +28955,7 @@ var init_plugins_source = __esm({
|
|
|
28912
28955
|
for (const { name, dir: pluginDir } of codexBackend.installedPluginDirs()) {
|
|
28913
28956
|
let st;
|
|
28914
28957
|
try {
|
|
28915
|
-
st =
|
|
28958
|
+
st = statSync38(pluginDir);
|
|
28916
28959
|
} catch {
|
|
28917
28960
|
continue;
|
|
28918
28961
|
}
|
|
@@ -29047,7 +29090,7 @@ var init_sync_fields = __esm({
|
|
|
29047
29090
|
});
|
|
29048
29091
|
|
|
29049
29092
|
// ../engine/dist/core/index-lock.js
|
|
29050
|
-
import { existsSync as existsSync41, mkdirSync as mkdirSync8, openSync as openSync9, writeFileSync as writeFileSync8, readFileSync as readFileSync37, rmSync as rmSync4, statSync as
|
|
29093
|
+
import { existsSync as existsSync41, mkdirSync as mkdirSync8, openSync as openSync9, writeFileSync as writeFileSync8, readFileSync as readFileSync37, rmSync as rmSync4, statSync as statSync39, closeSync as closeSync9 } from "fs";
|
|
29051
29094
|
import { dirname as dirname17, join as join44 } from "path";
|
|
29052
29095
|
function acquireIndexLock(opts) {
|
|
29053
29096
|
const lockPath = lockFilePath(opts.file);
|
|
@@ -29097,7 +29140,7 @@ function lockFilePath(file = ".compact.lock") {
|
|
|
29097
29140
|
}
|
|
29098
29141
|
function stealStaleLock(lockPath, staleAfterMs) {
|
|
29099
29142
|
try {
|
|
29100
|
-
const s =
|
|
29143
|
+
const s = statSync39(lockPath);
|
|
29101
29144
|
const age = Date.now() - s.mtimeMs;
|
|
29102
29145
|
let payload;
|
|
29103
29146
|
try {
|
|
@@ -29329,7 +29372,7 @@ var init_scan_pool = __esm({
|
|
|
29329
29372
|
slot.pending = null;
|
|
29330
29373
|
this.slots = this.slots.filter((s) => s !== slot);
|
|
29331
29374
|
if (this.slots.length === 0) this.disabled = true;
|
|
29332
|
-
resolve3?.({ id: -1, findings: [], redactions: 0, rows: null, error: `scan worker died: ${err}` });
|
|
29375
|
+
resolve3?.({ id: -1, findings: [], redactions: 0, rows: null, archive: null, error: `scan worker died: ${err}` });
|
|
29333
29376
|
this.pump();
|
|
29334
29377
|
};
|
|
29335
29378
|
worker.on("error", die);
|
|
@@ -29406,6 +29449,22 @@ var init_scan_pool = __esm({
|
|
|
29406
29449
|
async runDerived(task) {
|
|
29407
29450
|
return this.dispatch({ ...task, task: "derived", id: 0 });
|
|
29408
29451
|
}
|
|
29452
|
+
/**
|
|
29453
|
+
* The secret scan of a session read in chunks, on a worker.
|
|
29454
|
+
*
|
|
29455
|
+
* The worker reads the session itself. Null means the caller scans inline.
|
|
29456
|
+
*/
|
|
29457
|
+
async runFindings(task) {
|
|
29458
|
+
return this.dispatch({ ...task, task: "findings", id: 0 });
|
|
29459
|
+
}
|
|
29460
|
+
/**
|
|
29461
|
+
* The redacted raw archive of a streamed session, written to a temp file on a worker.
|
|
29462
|
+
*
|
|
29463
|
+
* Null means the caller writes it inline.
|
|
29464
|
+
*/
|
|
29465
|
+
async runArchive(task) {
|
|
29466
|
+
return this.dispatch({ ...task, task: "archive", id: 0 });
|
|
29467
|
+
}
|
|
29409
29468
|
async dispatch(task) {
|
|
29410
29469
|
this.start();
|
|
29411
29470
|
if (this.disabled) return null;
|
|
@@ -29836,13 +29895,13 @@ var init_collector_health = __esm({
|
|
|
29836
29895
|
|
|
29837
29896
|
// src/session-file-scan.ts
|
|
29838
29897
|
import { open as open3 } from "node:fs/promises";
|
|
29839
|
-
import { statSync as
|
|
29898
|
+
import { statSync as statSync40 } from "node:fs";
|
|
29840
29899
|
function sessionGroupsBytes(groups) {
|
|
29841
29900
|
let total = 0;
|
|
29842
29901
|
for (const g of groups) {
|
|
29843
29902
|
for (const p of g.paths) {
|
|
29844
29903
|
try {
|
|
29845
|
-
total +=
|
|
29904
|
+
total += statSync40(p).size;
|
|
29846
29905
|
} catch {
|
|
29847
29906
|
}
|
|
29848
29907
|
}
|
|
@@ -29961,7 +30020,7 @@ var init_session_file_scan = __esm({
|
|
|
29961
30020
|
});
|
|
29962
30021
|
|
|
29963
30022
|
// src/raw-archive-parts.ts
|
|
29964
|
-
import { createReadStream as createReadStream4, createWriteStream, openSync as openSync10, readSync as readSync9, closeSync as closeSync10, rmSync as rmSync5, statSync as
|
|
30023
|
+
import { createReadStream as createReadStream4, createWriteStream, openSync as openSync10, readSync as readSync9, closeSync as closeSync10, rmSync as rmSync5, statSync as statSync41 } from "node:fs";
|
|
29965
30024
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
29966
30025
|
import { join as join46 } from "node:path";
|
|
29967
30026
|
import { randomBytes } from "node:crypto";
|
|
@@ -30029,7 +30088,7 @@ async function writeArchiveFile(source, meta, redact, dir = tmpdir2()) {
|
|
|
30029
30088
|
rmSync5(path, { force: true });
|
|
30030
30089
|
throw err;
|
|
30031
30090
|
}
|
|
30032
|
-
return { path, gzSize:
|
|
30091
|
+
return { path, gzSize: statSync41(path).size, size };
|
|
30033
30092
|
}
|
|
30034
30093
|
async function putPart(url, body2) {
|
|
30035
30094
|
let last;
|
|
@@ -30104,6 +30163,84 @@ var init_raw_archive_parts = __esm({
|
|
|
30104
30163
|
}
|
|
30105
30164
|
});
|
|
30106
30165
|
|
|
30166
|
+
// src/yield-loop.ts
|
|
30167
|
+
function yieldToEventLoop() {
|
|
30168
|
+
return new Promise((resolve3) => setImmediate(resolve3));
|
|
30169
|
+
}
|
|
30170
|
+
var init_yield_loop = __esm({
|
|
30171
|
+
"src/yield-loop.ts"() {
|
|
30172
|
+
"use strict";
|
|
30173
|
+
}
|
|
30174
|
+
});
|
|
30175
|
+
|
|
30176
|
+
// src/heavy-session-work.ts
|
|
30177
|
+
async function scanTranscriptFindingsChunked(ref, tenantRules) {
|
|
30178
|
+
const backend = getBackendForId(ref.prefixedId);
|
|
30179
|
+
const findings = [];
|
|
30180
|
+
if (!backend?.readFromOffset) return findings;
|
|
30181
|
+
let offset = 0;
|
|
30182
|
+
let lineBase = 0;
|
|
30183
|
+
for (; ; ) {
|
|
30184
|
+
await yieldToEventLoop();
|
|
30185
|
+
const chunk = await backend.readFromOffset(ref.prefixedId, offset, SYNC_CHUNK_BYTES);
|
|
30186
|
+
if (chunk.newOffset <= offset) break;
|
|
30187
|
+
offset = chunk.newOffset;
|
|
30188
|
+
if (chunk.skippedBytes) {
|
|
30189
|
+
lineBase += 1;
|
|
30190
|
+
continue;
|
|
30191
|
+
}
|
|
30192
|
+
try {
|
|
30193
|
+
for (const f of scanTextForFindings(chunk.text)) {
|
|
30194
|
+
findings.push({ session_id: ref.prefixedId, detector: "builtin", rule: f.rule, line: lineBase + f.line, preview: f.preview });
|
|
30195
|
+
}
|
|
30196
|
+
if (tenantRules && tenantRules.length > 0) {
|
|
30197
|
+
for (const f of scanTenantRules(chunk.text, tenantRules)) {
|
|
30198
|
+
findings.push({ session_id: ref.prefixedId, detector: f.detector, rule: f.rule, line: lineBase + f.line, preview: f.preview });
|
|
30199
|
+
}
|
|
30200
|
+
}
|
|
30201
|
+
} catch {
|
|
30202
|
+
}
|
|
30203
|
+
for (let i = chunk.text.indexOf("\n"); i >= 0; i = chunk.text.indexOf("\n", i + 1)) lineBase++;
|
|
30204
|
+
}
|
|
30205
|
+
return dropFuzzyFindings(findings, (f) => ({ detector: f.detector, rule: f.rule }));
|
|
30206
|
+
}
|
|
30207
|
+
function diskArchiveSource(ref) {
|
|
30208
|
+
if (ref.toolId !== "claude") return null;
|
|
30209
|
+
const groups = resolveSessionContentGroups(ref.rawId);
|
|
30210
|
+
if (groups.length === 0 || groups.some((g) => g.paths.length !== 1)) return null;
|
|
30211
|
+
return {
|
|
30212
|
+
kind: "disk",
|
|
30213
|
+
files: groups.map((g) => ({ name: g.name === "main" ? `${ref.rawId}.jsonl` : g.name, path: g.paths[0] }))
|
|
30214
|
+
};
|
|
30215
|
+
}
|
|
30216
|
+
function streamedArchiveSource(ref) {
|
|
30217
|
+
const disk = diskArchiveSource(ref);
|
|
30218
|
+
if (disk) return disk;
|
|
30219
|
+
const backend = getBackendForId(ref.prefixedId);
|
|
30220
|
+
if (ref.toolId === "claude" || !backend?.iterateRawSessionLines) return null;
|
|
30221
|
+
return { kind: "lines", files: [{ name: `${ref.rawId}.dump.jsonl`, lines: () => backend.iterateRawSessionLines(ref.prefixedId) }] };
|
|
30222
|
+
}
|
|
30223
|
+
async function writeStreamedArchive(ref, redact) {
|
|
30224
|
+
const source = streamedArchiveSource(ref);
|
|
30225
|
+
if (!source) return null;
|
|
30226
|
+
return writeArchiveFile(source, { tool: ref.toolId, mtime: Math.floor(ref.mtime ?? 0) || 0 }, redact);
|
|
30227
|
+
}
|
|
30228
|
+
var SYNC_CHUNK_BYTES;
|
|
30229
|
+
var init_heavy_session_work = __esm({
|
|
30230
|
+
"src/heavy-session-work.ts"() {
|
|
30231
|
+
"use strict";
|
|
30232
|
+
init_backends();
|
|
30233
|
+
init_tool_backend();
|
|
30234
|
+
init_live_session_scan();
|
|
30235
|
+
init_secret_redactor();
|
|
30236
|
+
init_secret_scanner();
|
|
30237
|
+
init_secret_precision();
|
|
30238
|
+
init_raw_archive_parts();
|
|
30239
|
+
init_yield_loop();
|
|
30240
|
+
SYNC_CHUNK_BYTES = 8 * 1024 * 1024;
|
|
30241
|
+
}
|
|
30242
|
+
});
|
|
30243
|
+
|
|
30107
30244
|
// src/server-probe.ts
|
|
30108
30245
|
var server_probe_exports = {};
|
|
30109
30246
|
__export(server_probe_exports, {
|
|
@@ -30332,7 +30469,7 @@ __export(auto_update_exports, {
|
|
|
30332
30469
|
import { execSync as execSync2, execFileSync as execFileSync3 } from "node:child_process";
|
|
30333
30470
|
import { readFileSync as readFileSync41, existsSync as existsSync43 } from "node:fs";
|
|
30334
30471
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
30335
|
-
import { writeFileSync as writeFileSync10, mkdtempSync as mkdtempSync3, rmSync as rmSync6, readdirSync as readdirSync31, statSync as
|
|
30472
|
+
import { writeFileSync as writeFileSync10, mkdtempSync as mkdtempSync3, rmSync as rmSync6, readdirSync as readdirSync31, statSync as statSync42, mkdirSync as mkdirSync10 } from "node:fs";
|
|
30336
30473
|
import { join as join47, dirname as dirname19, sep as sep2, posix as pathPosix, win32 as pathWin32 } from "node:path";
|
|
30337
30474
|
import { tmpdir as tmpdir3, homedir as homedir16 } from "node:os";
|
|
30338
30475
|
import { createHash as createHash11 } from "node:crypto";
|
|
@@ -30385,7 +30522,7 @@ function sweepStaleStaging(root = tmpdir3(), now = Date.now()) {
|
|
|
30385
30522
|
if (!MKDTEMP_SUFFIX.test(name)) continue;
|
|
30386
30523
|
const dir = join47(root, name);
|
|
30387
30524
|
try {
|
|
30388
|
-
const st =
|
|
30525
|
+
const st = statSync42(dir);
|
|
30389
30526
|
if (!st.isDirectory() || now - st.mtimeMs < COLD_MS) continue;
|
|
30390
30527
|
const inside = readdirSync31(dir);
|
|
30391
30528
|
if (inside.length > 1 || inside.length === 1 && inside[0] !== "chat-recall.tgz") continue;
|
|
@@ -30671,7 +30808,7 @@ __export(sync_client_exports, {
|
|
|
30671
30808
|
syncSessions: () => syncSessions
|
|
30672
30809
|
});
|
|
30673
30810
|
import { join as join48, dirname as dirname20, basename as basename22 } from "node:path";
|
|
30674
|
-
import { readFileSync as readFileSync42, writeFileSync as writeFileSync11, mkdirSync as mkdirSync11, mkdtempSync as mkdtempSync4, rmSync as rmSync7, chmodSync as chmodSync4, unlinkSync as unlinkSync2, readdirSync as readdirSync32, statSync as
|
|
30811
|
+
import { readFileSync as readFileSync42, writeFileSync as writeFileSync11, mkdirSync as mkdirSync11, mkdtempSync as mkdtempSync4, rmSync as rmSync7, chmodSync as chmodSync4, unlinkSync as unlinkSync2, readdirSync as readdirSync32, statSync as statSync43 } from "node:fs";
|
|
30675
30812
|
import { tmpdir as tmpdir4, hostname as hostname2 } from "node:os";
|
|
30676
30813
|
import { createHash as createHash12 } from "node:crypto";
|
|
30677
30814
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
@@ -31148,7 +31285,7 @@ function reapStaleScanDirs(dir = tmpdir4(), maxAgeMs = 6 * 36e5, now = Date.now(
|
|
|
31148
31285
|
if (!name.startsWith("cr-batchscan-")) continue;
|
|
31149
31286
|
const p = join48(dir, name);
|
|
31150
31287
|
try {
|
|
31151
|
-
if (now -
|
|
31288
|
+
if (now - statSync43(p).mtimeMs < maxAgeMs) continue;
|
|
31152
31289
|
rmSync7(p, { recursive: true, force: true });
|
|
31153
31290
|
reaped++;
|
|
31154
31291
|
} catch {
|
|
@@ -31675,7 +31812,7 @@ async function syncToTargetInScope(cred, opts = {}) {
|
|
|
31675
31812
|
let walkPaused = false;
|
|
31676
31813
|
let considered = 0;
|
|
31677
31814
|
for (const ref of slice) {
|
|
31678
|
-
await
|
|
31815
|
+
await yieldToEventLoop();
|
|
31679
31816
|
considered++;
|
|
31680
31817
|
const usedNow = usedMb();
|
|
31681
31818
|
if (shouldPause(usedNow, memBudget, sessionsBuilt)) {
|
|
@@ -31713,7 +31850,7 @@ async function syncToTargetInScope(cred, opts = {}) {
|
|
|
31713
31850
|
await appendAdd(tail.conv, tail.bytes);
|
|
31714
31851
|
if (tail.findings.length > 0) {
|
|
31715
31852
|
await appendFlush();
|
|
31716
|
-
const all = await
|
|
31853
|
+
const all = await scanFindingsOffloaded(ref, tenantRules);
|
|
31717
31854
|
if (all.length > 0) await findingsBatch.add(all);
|
|
31718
31855
|
}
|
|
31719
31856
|
walked++;
|
|
@@ -32021,35 +32158,6 @@ function exportByteLength(exp) {
|
|
|
32021
32158
|
if (!exp) return 0;
|
|
32022
32159
|
return exp.files.reduce((n, f) => n + f.bytes.length, 0);
|
|
32023
32160
|
}
|
|
32024
|
-
async function scanTranscriptFindingsChunked(ref, tenantRules) {
|
|
32025
|
-
const backend = getBackendForId(ref.prefixedId);
|
|
32026
|
-
const findings = [];
|
|
32027
|
-
if (!backend?.readFromOffset) return findings;
|
|
32028
|
-
let offset = 0;
|
|
32029
|
-
let lineBase = 0;
|
|
32030
|
-
for (; ; ) {
|
|
32031
|
-
const chunk = await backend.readFromOffset(ref.prefixedId, offset, SYNC_CHUNK_BYTES);
|
|
32032
|
-
if (chunk.newOffset <= offset) break;
|
|
32033
|
-
offset = chunk.newOffset;
|
|
32034
|
-
if (chunk.skippedBytes) {
|
|
32035
|
-
lineBase += 1;
|
|
32036
|
-
continue;
|
|
32037
|
-
}
|
|
32038
|
-
try {
|
|
32039
|
-
for (const f of scanTextForFindings(chunk.text)) {
|
|
32040
|
-
findings.push({ session_id: ref.prefixedId, detector: "builtin", rule: f.rule, line: lineBase + f.line, preview: f.preview });
|
|
32041
|
-
}
|
|
32042
|
-
if (tenantRules && tenantRules.length > 0) {
|
|
32043
|
-
for (const f of scanTenantRules(chunk.text, tenantRules)) {
|
|
32044
|
-
findings.push({ session_id: ref.prefixedId, detector: f.detector, rule: f.rule, line: lineBase + f.line, preview: f.preview });
|
|
32045
|
-
}
|
|
32046
|
-
}
|
|
32047
|
-
} catch {
|
|
32048
|
-
}
|
|
32049
|
-
for (let i = chunk.text.indexOf("\n"); i >= 0; i = chunk.text.indexOf("\n", i + 1)) lineBase++;
|
|
32050
|
-
}
|
|
32051
|
-
return dropFuzzyFindings(findings, (f) => ({ detector: f.detector, rule: f.rule }));
|
|
32052
|
-
}
|
|
32053
32161
|
function sessionFileBytes(ref) {
|
|
32054
32162
|
const backend = getBackendForId(ref.prefixedId);
|
|
32055
32163
|
if (!backend?.isAppendOnly?.()) return 0;
|
|
@@ -32067,6 +32175,42 @@ function sessionBuildBytes(ref) {
|
|
|
32067
32175
|
if (main === 0) return 0;
|
|
32068
32176
|
return Math.max(main, shadowUncompressedBytes(ref.toolId, ref.rawId));
|
|
32069
32177
|
}
|
|
32178
|
+
async function scanFindingsOffloaded(ref, tenantRules) {
|
|
32179
|
+
const pool = scanPool();
|
|
32180
|
+
if (pool.enabled) {
|
|
32181
|
+
const packVersion = lastServerPackSpec?.version ?? "";
|
|
32182
|
+
const sendPack = lastServerPackSpec !== null && pool.needsPack(packVersion);
|
|
32183
|
+
const result = await pool.runFindings({
|
|
32184
|
+
ref: { prefixedId: ref.prefixedId, rawId: ref.rawId, toolId: ref.toolId },
|
|
32185
|
+
tenantRules,
|
|
32186
|
+
pack: sendPack && lastServerPackSpec ? { version: packVersion, rules: lastServerPackSpec.rules } : void 0,
|
|
32187
|
+
packVersion
|
|
32188
|
+
});
|
|
32189
|
+
if (result) {
|
|
32190
|
+
if (sendPack) pool.markPackSent(packVersion);
|
|
32191
|
+
return result.findings;
|
|
32192
|
+
}
|
|
32193
|
+
}
|
|
32194
|
+
return scanTranscriptFindingsChunked(ref, tenantRules);
|
|
32195
|
+
}
|
|
32196
|
+
async function writeStreamedArchiveOffloaded(ref, count) {
|
|
32197
|
+
const pool = scanPool();
|
|
32198
|
+
if (pool.enabled) {
|
|
32199
|
+
const packVersion = lastServerPackSpec?.version ?? "";
|
|
32200
|
+
const sendPack = lastServerPackSpec !== null && pool.needsPack(packVersion);
|
|
32201
|
+
const result = await pool.runArchive({
|
|
32202
|
+
ref: { prefixedId: ref.prefixedId, rawId: ref.rawId, toolId: ref.toolId, mtime: ref.mtime },
|
|
32203
|
+
pack: sendPack && lastServerPackSpec ? { version: packVersion, rules: lastServerPackSpec.rules } : void 0,
|
|
32204
|
+
packVersion
|
|
32205
|
+
});
|
|
32206
|
+
if (result) {
|
|
32207
|
+
if (sendPack) pool.markPackSent(packVersion);
|
|
32208
|
+
count.redactions += result.redactions;
|
|
32209
|
+
return result.archive;
|
|
32210
|
+
}
|
|
32211
|
+
}
|
|
32212
|
+
return writeStreamedArchive(ref, (t) => redactSecrets(t, { force: true, count }));
|
|
32213
|
+
}
|
|
32070
32214
|
async function buildConversationSync(ref, mtime, opts = {}) {
|
|
32071
32215
|
const mapPath = opts.mapPath ?? ((p) => p);
|
|
32072
32216
|
let includeRaw = opts.includeRaw !== false;
|
|
@@ -32095,7 +32239,7 @@ async function buildConversationSync(ref, mtime, opts = {}) {
|
|
|
32095
32239
|
} catch {
|
|
32096
32240
|
}
|
|
32097
32241
|
includeRaw = false;
|
|
32098
|
-
oversizedFindings = await
|
|
32242
|
+
oversizedFindings = await scanFindingsOffloaded(ref, opts.tenantRules);
|
|
32099
32243
|
} else {
|
|
32100
32244
|
try {
|
|
32101
32245
|
const backend = getBackendForId(ref.prefixedId) ?? getBackend("claude");
|
|
@@ -32356,17 +32500,13 @@ async function buildConversationSync(ref, mtime, opts = {}) {
|
|
|
32356
32500
|
if (wantRaw && !raw_b64) {
|
|
32357
32501
|
try {
|
|
32358
32502
|
const redact = (t) => redactSecrets(t, { force: true, count });
|
|
32359
|
-
let source = null;
|
|
32360
|
-
let archiveMtime = Math.floor(ref.mtime) || 0;
|
|
32361
|
-
let archiveTool = ref.toolId;
|
|
32362
32503
|
if (container) {
|
|
32363
|
-
source = { kind: "memory", files: container.files };
|
|
32364
|
-
|
|
32365
|
-
archiveTool = container.tool;
|
|
32504
|
+
const source = { kind: "memory", files: container.files };
|
|
32505
|
+
archive = { file: await writeArchiveFile(source, { tool: container.tool, mtime: container.mtime }, redact), tool: container.tool, mtime: container.mtime };
|
|
32366
32506
|
} else if (oversized || exportOverCeiling) {
|
|
32367
|
-
|
|
32507
|
+
const file = await writeStreamedArchiveOffloaded(ref, count);
|
|
32508
|
+
if (file) archive = { file, tool: ref.toolId, mtime: Math.floor(ref.mtime) || 0 };
|
|
32368
32509
|
}
|
|
32369
|
-
if (source) archive = { file: await writeArchiveFile(source, { tool: archiveTool, mtime: archiveMtime }, redact), tool: archiveTool, mtime: archiveMtime };
|
|
32370
32510
|
} catch (err) {
|
|
32371
32511
|
console.error(`[sync] raw archive for ${ref.prefixedId} not written: ${err instanceof Error ? err.message : err}`);
|
|
32372
32512
|
}
|
|
@@ -32406,22 +32546,6 @@ async function buildConversationSync(ref, mtime, opts = {}) {
|
|
|
32406
32546
|
archive
|
|
32407
32547
|
};
|
|
32408
32548
|
}
|
|
32409
|
-
function streamedArchiveSource(ref) {
|
|
32410
|
-
const disk = diskArchiveSource(ref);
|
|
32411
|
-
if (disk) return disk;
|
|
32412
|
-
const backend = getBackendForId(ref.prefixedId);
|
|
32413
|
-
if (ref.toolId === "claude" || !backend?.iterateRawSessionLines) return null;
|
|
32414
|
-
return { kind: "lines", files: [{ name: `${ref.rawId}.dump.jsonl`, lines: () => backend.iterateRawSessionLines(ref.prefixedId) }] };
|
|
32415
|
-
}
|
|
32416
|
-
function diskArchiveSource(ref) {
|
|
32417
|
-
if (ref.toolId !== "claude") return null;
|
|
32418
|
-
const groups = resolveSessionContentGroups(ref.rawId);
|
|
32419
|
-
if (groups.length === 0 || groups.some((g) => g.paths.length !== 1)) return null;
|
|
32420
|
-
return {
|
|
32421
|
-
kind: "disk",
|
|
32422
|
-
files: groups.map((g) => ({ name: g.name === "main" ? `${ref.rawId}.jsonl` : g.name, path: g.paths[0] }))
|
|
32423
|
-
};
|
|
32424
|
-
}
|
|
32425
32549
|
function parseTailMessages(tool, text, backend = null) {
|
|
32426
32550
|
if (!text || !text.trim()) return [];
|
|
32427
32551
|
if (tool === "claude") return parseClaudeTranscriptText(text);
|
|
@@ -32539,7 +32663,7 @@ async function syncIncremental(opts = {}) {
|
|
|
32539
32663
|
lock.release();
|
|
32540
32664
|
}
|
|
32541
32665
|
}
|
|
32542
|
-
var ownVersion, ERROR_CLASS, STANDING_FAILURE, walkProgressForUpload, lastServerPackSpec, credPath, fileTarget, _securityConfigCache, SECURITY_CONFIG_TTL_MS, _syncConfigCache, EMPTY_SYNC_CONFIG, _fetchTenantSyncConfigForTests, SYNC_RULES_REFUSAL, hashPath, acceptedUploads, MAX_DERIVED_ROW_BYTES, isLocalHost, FULL_KEY, CAPS_TTL_MS, capsOk, advertisedIngestConc, advertisedGzipBody, FULL_BUILD_MAX_BYTES, DERIVED_MAX_BYTES,
|
|
32666
|
+
var ownVersion, ERROR_CLASS, STANDING_FAILURE, walkProgressForUpload, lastServerPackSpec, credPath, fileTarget, _securityConfigCache, SECURITY_CONFIG_TTL_MS, _syncConfigCache, EMPTY_SYNC_CONFIG, _fetchTenantSyncConfigForTests, SYNC_RULES_REFUSAL, hashPath, acceptedUploads, MAX_DERIVED_ROW_BYTES, isLocalHost, FULL_KEY, CAPS_TTL_MS, capsOk, advertisedIngestConc, advertisedGzipBody, FULL_BUILD_MAX_BYTES, DERIVED_MAX_BYTES, TOOLKIT_INVENTORY_TYPES, BATCH_SCAN_MAX_BYTES;
|
|
32543
32667
|
var init_sync_client = __esm({
|
|
32544
32668
|
"src/sync-client.ts"() {
|
|
32545
32669
|
"use strict";
|
|
@@ -32587,6 +32711,8 @@ var init_sync_client = __esm({
|
|
|
32587
32711
|
init_live_session_scan();
|
|
32588
32712
|
init_session_file_scan();
|
|
32589
32713
|
init_raw_archive_parts();
|
|
32714
|
+
init_yield_loop();
|
|
32715
|
+
init_heavy_session_work();
|
|
32590
32716
|
init_backends();
|
|
32591
32717
|
ownVersion = "0.0.0";
|
|
32592
32718
|
try {
|
|
@@ -32625,7 +32751,6 @@ var init_sync_client = __esm({
|
|
|
32625
32751
|
advertisedGzipBody = /* @__PURE__ */ new Set();
|
|
32626
32752
|
FULL_BUILD_MAX_BYTES = Math.max(8, parseInt(process.env.CHAT_RECALL_FULL_BUILD_MAX_MB || "12", 10)) * 1024 * 1024;
|
|
32627
32753
|
DERIVED_MAX_BYTES = Math.max(8, parseInt(process.env.CHAT_RECALL_DERIVED_MAX_MB || "64", 10)) * 1024 * 1024;
|
|
32628
|
-
SYNC_CHUNK_BYTES = 8 * 1024 * 1024;
|
|
32629
32754
|
TOOLKIT_INVENTORY_TYPES = /* @__PURE__ */ new Set(["skill", "mcp", "command", "agent", "plugin"]);
|
|
32630
32755
|
BATCH_SCAN_MAX_BYTES = Math.max(1, parseInt(process.env.CHAT_RECALL_BATCHSCAN_MAX_MB || "64", 10)) * 1024 * 1024;
|
|
32631
32756
|
}
|
|
@@ -32747,11 +32872,11 @@ var init_update_notice = __esm({
|
|
|
32747
32872
|
});
|
|
32748
32873
|
|
|
32749
32874
|
// ../engine/dist/core/which.js
|
|
32750
|
-
import { existsSync as existsSync44, statSync as
|
|
32875
|
+
import { existsSync as existsSync44, statSync as statSync44, accessSync, constants } from "node:fs";
|
|
32751
32876
|
import { join as join50, isAbsolute as isAbsolute3, delimiter as delimiter2, sep as sep3 } from "node:path";
|
|
32752
32877
|
function executable(p) {
|
|
32753
32878
|
try {
|
|
32754
|
-
if (!
|
|
32879
|
+
if (!statSync44(p).isFile())
|
|
32755
32880
|
return false;
|
|
32756
32881
|
} catch {
|
|
32757
32882
|
return false;
|
|
@@ -34920,7 +35045,7 @@ __export(companions_exports, {
|
|
|
34920
35045
|
uninstallCodeindex: () => uninstallCodeindex,
|
|
34921
35046
|
unregisterCodeindexMcp: () => unregisterCodeindexMcp
|
|
34922
35047
|
});
|
|
34923
|
-
import { existsSync as existsSync49, mkdirSync as mkdirSync15, statSync as
|
|
35048
|
+
import { existsSync as existsSync49, mkdirSync as mkdirSync15, statSync as statSync45, chmodSync as chmodSync6, unlinkSync as unlinkSync3, renameSync as renameSync7, createWriteStream as createWriteStream2, readFileSync as readFileSync47, writeFileSync as writeFileSync17 } from "node:fs";
|
|
34924
35049
|
import { homedir as homedir21 } from "node:os";
|
|
34925
35050
|
import { join as join59 } from "node:path";
|
|
34926
35051
|
import { execSync as execSync3 } from "node:child_process";
|
|
@@ -34971,7 +35096,7 @@ function checkCodeindexStatus() {
|
|
|
34971
35096
|
status.installed = true;
|
|
34972
35097
|
status.path = foundPath;
|
|
34973
35098
|
try {
|
|
34974
|
-
status.size =
|
|
35099
|
+
status.size = statSync45(foundPath).size;
|
|
34975
35100
|
} catch {
|
|
34976
35101
|
}
|
|
34977
35102
|
try {
|
|
@@ -35121,7 +35246,7 @@ __export(install_skills_exports, {
|
|
|
35121
35246
|
skillsSourceDir: () => skillsSourceDir,
|
|
35122
35247
|
uninstallSkills: () => uninstallSkills
|
|
35123
35248
|
});
|
|
35124
|
-
import { readdirSync as readdirSync33, existsSync as existsSync50, mkdirSync as mkdirSync16, rmSync as rmSync8, cpSync, writeFileSync as writeFileSync18, readFileSync as readFileSync48, statSync as
|
|
35249
|
+
import { readdirSync as readdirSync33, existsSync as existsSync50, mkdirSync as mkdirSync16, rmSync as rmSync8, cpSync, writeFileSync as writeFileSync18, readFileSync as readFileSync48, statSync as statSync46, realpathSync as realpathSync5 } from "fs";
|
|
35125
35250
|
import { createHash as createHash15 } from "crypto";
|
|
35126
35251
|
import { join as join60, basename as basename23 } from "path";
|
|
35127
35252
|
function skillsSourceDir() {
|
|
@@ -36136,11 +36261,11 @@ __export(toolkit_pull_exports, {
|
|
|
36136
36261
|
platformRefusal: () => platformRefusal,
|
|
36137
36262
|
portableCommand: () => portableCommand
|
|
36138
36263
|
});
|
|
36139
|
-
import { existsSync as existsSync52, mkdirSync as mkdirSync18, statSync as
|
|
36264
|
+
import { existsSync as existsSync52, mkdirSync as mkdirSync18, statSync as statSync47, writeFileSync as writeFileSync20 } from "node:fs";
|
|
36140
36265
|
import { dirname as dirname26, join as join63, basename as basename26, isAbsolute as isAbsolute4 } from "node:path";
|
|
36141
36266
|
function isExecutableFile(p) {
|
|
36142
36267
|
try {
|
|
36143
|
-
return
|
|
36268
|
+
return statSync47(p).isFile();
|
|
36144
36269
|
} catch {
|
|
36145
36270
|
return false;
|
|
36146
36271
|
}
|
|
@@ -38566,7 +38691,7 @@ __export(project_tasks_exports, {
|
|
|
38566
38691
|
pushProjectTaskStatuses: () => pushProjectTaskStatuses,
|
|
38567
38692
|
renderTeamTasksMd: () => renderTeamTasksMd
|
|
38568
38693
|
});
|
|
38569
|
-
import { existsSync as existsSync56, readFileSync as readFileSync53, writeFileSync as writeFileSync22, mkdirSync as mkdirSync20, statSync as
|
|
38694
|
+
import { existsSync as existsSync56, readFileSync as readFileSync53, writeFileSync as writeFileSync22, mkdirSync as mkdirSync20, statSync as statSync48 } from "node:fs";
|
|
38570
38695
|
import { join as join67, dirname as dirname28 } from "node:path";
|
|
38571
38696
|
import { homedir as homedir24 } from "node:os";
|
|
38572
38697
|
function isTeamTaskStatus(v) {
|
|
@@ -38655,7 +38780,7 @@ async function pushProjectTaskStatuses(base4, authHeaders, opts = {}) {
|
|
|
38655
38780
|
if (!existsSync56(file)) continue;
|
|
38656
38781
|
let mtime;
|
|
38657
38782
|
try {
|
|
38658
|
-
mtime =
|
|
38783
|
+
mtime = statSync48(file).mtimeMs;
|
|
38659
38784
|
} catch {
|
|
38660
38785
|
continue;
|
|
38661
38786
|
}
|
|
@@ -39168,7 +39293,7 @@ var team_merge_exports = {};
|
|
|
39168
39293
|
__export(team_merge_exports, {
|
|
39169
39294
|
mergePullResult: () => mergePullResult
|
|
39170
39295
|
});
|
|
39171
|
-
import { existsSync as existsSync58, mkdirSync as mkdirSync22, readFileSync as readFileSync55, rmSync as rmSync11, writeFileSync as writeFileSync24, statSync as
|
|
39296
|
+
import { existsSync as existsSync58, mkdirSync as mkdirSync22, readFileSync as readFileSync55, rmSync as rmSync11, writeFileSync as writeFileSync24, statSync as statSync49 } from "fs";
|
|
39172
39297
|
import { dirname as dirname30, join as join69 } from "path";
|
|
39173
39298
|
import { createHash as createHash18 } from "crypto";
|
|
39174
39299
|
function installPathFor(art, tool) {
|
|
@@ -39305,7 +39430,7 @@ function readFileIfExists(path) {
|
|
|
39305
39430
|
try {
|
|
39306
39431
|
if (!existsSync58(path))
|
|
39307
39432
|
return null;
|
|
39308
|
-
const s =
|
|
39433
|
+
const s = statSync49(path);
|
|
39309
39434
|
if (!s.isFile())
|
|
39310
39435
|
return null;
|
|
39311
39436
|
return readFileSync55(path);
|
|
@@ -39389,7 +39514,7 @@ var init_vault_crypto = __esm({
|
|
|
39389
39514
|
});
|
|
39390
39515
|
|
|
39391
39516
|
// ../engine/dist/core/vault-source.js
|
|
39392
|
-
import { existsSync as existsSync59, readdirSync as readdirSync35, statSync as
|
|
39517
|
+
import { existsSync as existsSync59, readdirSync as readdirSync35, statSync as statSync50 } from "fs";
|
|
39393
39518
|
import { extname, join as join70 } from "path";
|
|
39394
39519
|
function* walkVaultSources() {
|
|
39395
39520
|
const t = loadSettings().team.vault;
|
|
@@ -39405,7 +39530,7 @@ function* walkVaultSources() {
|
|
|
39405
39530
|
}
|
|
39406
39531
|
function safeStat(path) {
|
|
39407
39532
|
try {
|
|
39408
|
-
const s =
|
|
39533
|
+
const s = statSync50(path);
|
|
39409
39534
|
if (!s.isFile())
|
|
39410
39535
|
return null;
|
|
39411
39536
|
return { mtimeMs: s.mtimeMs, size: s.size };
|
|
@@ -39508,7 +39633,7 @@ function* walkAgy() {
|
|
|
39508
39633
|
for (const rawId of sessionDirs) {
|
|
39509
39634
|
const sessionPath = join70(brainDir, rawId);
|
|
39510
39635
|
try {
|
|
39511
|
-
if (!
|
|
39636
|
+
if (!statSync50(sessionPath).isDirectory())
|
|
39512
39637
|
continue;
|
|
39513
39638
|
} catch {
|
|
39514
39639
|
continue;
|
|
@@ -42119,7 +42244,7 @@ program.command("feedback").argument("<message...>", "what you want to say \u201
|
|
|
42119
42244
|
}
|
|
42120
42245
|
});
|
|
42121
42246
|
program.command("doctor").description("Quick health check across login, server, credentials, hooks, MCP server, and codeindex").option("--purge-local", "Remove the legacy local index (cache.db + vector/KG files) left by pre-thin-collector versions \u2014 storage is server-side now. Requires login; keeps credentials, sync ledger, identity, and the audit log.").action(async (opts) => {
|
|
42122
|
-
const { existsSync: existsSync63, readFileSync: readFileSync60, statSync:
|
|
42247
|
+
const { existsSync: existsSync63, readFileSync: readFileSync60, statSync: statSync51 } = await import("fs");
|
|
42123
42248
|
const { execSync: execSync6 } = await import("child_process");
|
|
42124
42249
|
const rows = [];
|
|
42125
42250
|
const note = (ok, label, detail) => rows.push({ ok, label, detail });
|
|
@@ -42187,7 +42312,7 @@ program.command("doctor").description("Quick health check across login, server,
|
|
|
42187
42312
|
note(false, "Credentials file", `missing \u2014 run \`chat-recall login <server-url>\``);
|
|
42188
42313
|
} else {
|
|
42189
42314
|
try {
|
|
42190
|
-
const mode =
|
|
42315
|
+
const mode = statSync51(credFile).mode & 511;
|
|
42191
42316
|
const isWin = process.platform === "win32";
|
|
42192
42317
|
const safe = isWin || (mode & 63) === 0;
|
|
42193
42318
|
note(safe, "Credentials file", isWin ? `${credFile} (Windows ACL \u2014 POSIX mode does not apply)` : `${credFile} (mode ${mode.toString(8).padStart(3, "0")}${safe ? "" : " \u2014 should be 600"})`);
|