chat-recall 0.5.31 → 0.5.32
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/bulk-delete.d.ts +131 -0
- package/dist/bulk-delete.d.ts.map +1 -0
- package/dist/bulk-delete.js +211 -0
- package/dist/bulk-delete.js.map +1 -0
- package/dist/cli.js +686 -435
- package/dist/cli.js.map +1 -1
- package/dist/mcp.js +191 -186
- package/dist/scan-worker.js +59 -20
- package/dist/watch.js +194 -189
- package/package.json +1 -1
package/dist/scan-worker.js
CHANGED
|
@@ -9861,6 +9861,7 @@ var init_first_prompt = __esm({
|
|
|
9861
9861
|
});
|
|
9862
9862
|
|
|
9863
9863
|
// ../engine/dist/core/project-dir-name.js
|
|
9864
|
+
import { readdirSync as readdirSync8 } from "node:fs";
|
|
9864
9865
|
function looksWindowsEncoded(dirName) {
|
|
9865
9866
|
return /^[A-Za-z]--/.test(dirName);
|
|
9866
9867
|
}
|
|
@@ -9874,6 +9875,43 @@ function decodeProjectDirName(dirName) {
|
|
|
9874
9875
|
}
|
|
9875
9876
|
return "/" + dirName.replace(/^-/, "").replace(/-/g, "/");
|
|
9876
9877
|
}
|
|
9878
|
+
function resolveProjectDirName(dirName, deps = {}) {
|
|
9879
|
+
const structural = decodeProjectDirName(dirName);
|
|
9880
|
+
if (!dirName)
|
|
9881
|
+
return structural;
|
|
9882
|
+
if (looksWindowsEncoded(dirName))
|
|
9883
|
+
return structural;
|
|
9884
|
+
const readdir = deps.readdir ?? ((p) => readdirSync8(p, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name));
|
|
9885
|
+
const encodeName = (name) => name.replace(/[-_.]/g, "-");
|
|
9886
|
+
let remaining = dirName.replace(/^-/, "");
|
|
9887
|
+
let current = "/";
|
|
9888
|
+
while (remaining) {
|
|
9889
|
+
let children;
|
|
9890
|
+
try {
|
|
9891
|
+
children = readdir(current);
|
|
9892
|
+
} catch {
|
|
9893
|
+
break;
|
|
9894
|
+
}
|
|
9895
|
+
let best = "";
|
|
9896
|
+
for (const child of children) {
|
|
9897
|
+
const encoded = encodeName(child);
|
|
9898
|
+
if (!encoded || encoded.length < best.length)
|
|
9899
|
+
continue;
|
|
9900
|
+
if (!remaining.startsWith(encoded))
|
|
9901
|
+
continue;
|
|
9902
|
+
const next = remaining[encoded.length];
|
|
9903
|
+
if (next !== void 0 && next !== "-")
|
|
9904
|
+
continue;
|
|
9905
|
+
if (encoded.length > best.length)
|
|
9906
|
+
best = child;
|
|
9907
|
+
}
|
|
9908
|
+
if (!best)
|
|
9909
|
+
break;
|
|
9910
|
+
current = current === "/" ? `/${best}` : `${current}/${best}`;
|
|
9911
|
+
remaining = remaining.slice(encodeName(best).length).replace(/^-/, "");
|
|
9912
|
+
}
|
|
9913
|
+
return remaining ? structural : current;
|
|
9914
|
+
}
|
|
9877
9915
|
var init_project_dir_name = __esm({
|
|
9878
9916
|
"../engine/dist/core/project-dir-name.js"() {
|
|
9879
9917
|
"use strict";
|
|
@@ -9881,7 +9919,7 @@ var init_project_dir_name = __esm({
|
|
|
9881
9919
|
});
|
|
9882
9920
|
|
|
9883
9921
|
// ../engine/dist/core/backends/claude.js
|
|
9884
|
-
import { existsSync as existsSync12, readdirSync as
|
|
9922
|
+
import { existsSync as existsSync12, readdirSync as readdirSync9, readFileSync as readFileSync8, statSync as statSync10, openSync as openSync4, readSync as readSync4, closeSync as closeSync4 } from "fs";
|
|
9885
9923
|
import { join as join12, basename as basename7 } from "path";
|
|
9886
9924
|
function stripReminders(text) {
|
|
9887
9925
|
return text.replace(/<system-reminder>[\s\S]*?<\/system-reminder>/g, "").trim();
|
|
@@ -10036,13 +10074,13 @@ var init_claude = __esm({
|
|
|
10036
10074
|
collectSessionsFromRoot(root, cutoff, filter, seen, out) {
|
|
10037
10075
|
if (!existsSync12(root))
|
|
10038
10076
|
return;
|
|
10039
|
-
for (const proj of
|
|
10077
|
+
for (const proj of readdirSync9(root, { withFileTypes: true })) {
|
|
10040
10078
|
if (!proj.isDirectory())
|
|
10041
10079
|
continue;
|
|
10042
10080
|
if (filter && !proj.name.toLowerCase().includes(filter))
|
|
10043
10081
|
continue;
|
|
10044
10082
|
const projPath = join12(root, proj.name);
|
|
10045
|
-
const projectPath =
|
|
10083
|
+
const projectPath = resolveProjectDirName(proj.name);
|
|
10046
10084
|
const indexPath = join12(projPath, "sessions-index.json");
|
|
10047
10085
|
if (existsSync12(indexPath)) {
|
|
10048
10086
|
try {
|
|
@@ -10073,7 +10111,7 @@ var init_claude = __esm({
|
|
|
10073
10111
|
}
|
|
10074
10112
|
let files;
|
|
10075
10113
|
try {
|
|
10076
|
-
files =
|
|
10114
|
+
files = readdirSync9(projPath);
|
|
10077
10115
|
} catch {
|
|
10078
10116
|
continue;
|
|
10079
10117
|
}
|
|
@@ -10342,7 +10380,7 @@ var init_claude = __esm({
|
|
|
10342
10380
|
for (const root of claudeProjectDirs()) {
|
|
10343
10381
|
if (!existsSync12(root))
|
|
10344
10382
|
continue;
|
|
10345
|
-
for (const projEntry of
|
|
10383
|
+
for (const projEntry of readdirSync9(root, { withFileTypes: true })) {
|
|
10346
10384
|
if (!projEntry.isDirectory())
|
|
10347
10385
|
continue;
|
|
10348
10386
|
if (opts.projectFilter && !projEntry.name.toLowerCase().includes(opts.projectFilter.toLowerCase()))
|
|
@@ -10350,7 +10388,7 @@ var init_claude = __esm({
|
|
|
10350
10388
|
const projPath = join12(root, projEntry.name);
|
|
10351
10389
|
let files;
|
|
10352
10390
|
try {
|
|
10353
|
-
files =
|
|
10391
|
+
files = readdirSync9(projPath);
|
|
10354
10392
|
} catch {
|
|
10355
10393
|
continue;
|
|
10356
10394
|
}
|
|
@@ -10363,7 +10401,7 @@ var init_claude = __esm({
|
|
|
10363
10401
|
let mtime = st.mtimeMs;
|
|
10364
10402
|
const subDir = join12(projPath, f.slice(0, -6), "subagents");
|
|
10365
10403
|
if (existsSync12(subDir)) {
|
|
10366
|
-
for (const sub of
|
|
10404
|
+
for (const sub of readdirSync9(subDir)) {
|
|
10367
10405
|
try {
|
|
10368
10406
|
const subSt = statSync10(join12(subDir, sub));
|
|
10369
10407
|
if (subSt.mtimeMs > mtime)
|
|
@@ -10474,7 +10512,7 @@ var init_model_pricing = __esm({
|
|
|
10474
10512
|
});
|
|
10475
10513
|
|
|
10476
10514
|
// ../engine/dist/parsers/session.js
|
|
10477
|
-
import { createReadStream as createReadStream2, existsSync as existsSync13, readdirSync as
|
|
10515
|
+
import { createReadStream as createReadStream2, existsSync as existsSync13, readdirSync as readdirSync10, readFileSync as readFileSync9, statSync as statSync11, openSync as openSync5, readSync as readSync5, closeSync as closeSync5 } from "fs";
|
|
10478
10516
|
import { join as join13, basename as basename8 } from "path";
|
|
10479
10517
|
function hasSubagentsDir(sessionPath) {
|
|
10480
10518
|
const dir = sessionPath.slice(0, -6);
|
|
@@ -10486,6 +10524,7 @@ var init_session = __esm({
|
|
|
10486
10524
|
init_chunker();
|
|
10487
10525
|
init_claude();
|
|
10488
10526
|
init_tool_paths();
|
|
10527
|
+
init_project_dir_name();
|
|
10489
10528
|
init_model_pricing();
|
|
10490
10529
|
}
|
|
10491
10530
|
});
|
|
@@ -10599,7 +10638,7 @@ var init_shadow = __esm({
|
|
|
10599
10638
|
});
|
|
10600
10639
|
|
|
10601
10640
|
// ../engine/dist/core/live-session-scan.js
|
|
10602
|
-
import { existsSync as existsSync14, readdirSync as
|
|
10641
|
+
import { existsSync as existsSync14, readdirSync as readdirSync11, readFileSync as readFileSync10, statSync as statSync12, openSync as openSync6, readSync as readSync6, closeSync as closeSync6 } from "fs";
|
|
10603
10642
|
import { join as join14, basename as basename9 } from "path";
|
|
10604
10643
|
import { createHash as createHash3 } from "crypto";
|
|
10605
10644
|
function lazyGeminiProjectsJson() {
|
|
@@ -10619,7 +10658,7 @@ function sessionFileIndex() {
|
|
|
10619
10658
|
seenRoots.add(root);
|
|
10620
10659
|
let entries;
|
|
10621
10660
|
try {
|
|
10622
|
-
entries =
|
|
10661
|
+
entries = readdirSync11(root, { withFileTypes: true });
|
|
10623
10662
|
} catch {
|
|
10624
10663
|
continue;
|
|
10625
10664
|
}
|
|
@@ -10629,7 +10668,7 @@ function sessionFileIndex() {
|
|
|
10629
10668
|
const dir = join14(root, entry.name);
|
|
10630
10669
|
let names;
|
|
10631
10670
|
try {
|
|
10632
|
-
names =
|
|
10671
|
+
names = readdirSync11(dir);
|
|
10633
10672
|
} catch {
|
|
10634
10673
|
continue;
|
|
10635
10674
|
}
|
|
@@ -10640,7 +10679,7 @@ function sessionFileIndex() {
|
|
|
10640
10679
|
const located = {
|
|
10641
10680
|
path: join14(dir, name),
|
|
10642
10681
|
projectDir: entry.name,
|
|
10643
|
-
projectPath:
|
|
10682
|
+
projectPath: resolveProjectDirName(entry.name)
|
|
10644
10683
|
};
|
|
10645
10684
|
const prior = byId.get(id);
|
|
10646
10685
|
if (prior)
|
|
@@ -10727,7 +10766,7 @@ function resolveSessionContentPaths(sessionFile) {
|
|
|
10727
10766
|
const subDir = join14(sessionFile.slice(0, -6), "subagents");
|
|
10728
10767
|
if (!existsSync14(subDir))
|
|
10729
10768
|
return [sessionFile];
|
|
10730
|
-
const subPaths =
|
|
10769
|
+
const subPaths = readdirSync11(subDir).filter((f) => f.endsWith(".jsonl")).sort().map((f) => join14(subDir, f));
|
|
10731
10770
|
return [sessionFile, ...subPaths];
|
|
10732
10771
|
}
|
|
10733
10772
|
function loadGeminiProjectMap() {
|
|
@@ -10772,7 +10811,7 @@ function geminiIndex() {
|
|
|
10772
10811
|
continue;
|
|
10773
10812
|
let projs;
|
|
10774
10813
|
try {
|
|
10775
|
-
projs =
|
|
10814
|
+
projs = readdirSync11(tmpRoot, { withFileTypes: true });
|
|
10776
10815
|
} catch {
|
|
10777
10816
|
continue;
|
|
10778
10817
|
}
|
|
@@ -10784,7 +10823,7 @@ function geminiIndex() {
|
|
|
10784
10823
|
continue;
|
|
10785
10824
|
let files;
|
|
10786
10825
|
try {
|
|
10787
|
-
files =
|
|
10826
|
+
files = readdirSync11(chats);
|
|
10788
10827
|
} catch {
|
|
10789
10828
|
continue;
|
|
10790
10829
|
}
|
|
@@ -10903,21 +10942,21 @@ function findCodexSessionFile(sessionId) {
|
|
|
10903
10942
|
function findCodexSessionFileIn(root, sessionId) {
|
|
10904
10943
|
if (!existsSync14(root))
|
|
10905
10944
|
return null;
|
|
10906
|
-
for (const year of
|
|
10945
|
+
for (const year of readdirSync11(root, { withFileTypes: true })) {
|
|
10907
10946
|
if (!year.isDirectory())
|
|
10908
10947
|
continue;
|
|
10909
10948
|
const yearPath = join14(root, year.name);
|
|
10910
|
-
for (const month of
|
|
10949
|
+
for (const month of readdirSync11(yearPath, { withFileTypes: true })) {
|
|
10911
10950
|
if (!month.isDirectory())
|
|
10912
10951
|
continue;
|
|
10913
10952
|
const monthPath = join14(yearPath, month.name);
|
|
10914
|
-
for (const day of
|
|
10953
|
+
for (const day of readdirSync11(monthPath, { withFileTypes: true })) {
|
|
10915
10954
|
if (!day.isDirectory())
|
|
10916
10955
|
continue;
|
|
10917
10956
|
const dayPath = join14(monthPath, day.name);
|
|
10918
10957
|
let files;
|
|
10919
10958
|
try {
|
|
10920
|
-
files =
|
|
10959
|
+
files = readdirSync11(dayPath);
|
|
10921
10960
|
} catch {
|
|
10922
10961
|
continue;
|
|
10923
10962
|
}
|
|
@@ -10932,7 +10971,7 @@ function findCodexSessionFileIn(root, sessionId) {
|
|
|
10932
10971
|
}
|
|
10933
10972
|
}
|
|
10934
10973
|
function scanDir(dir) {
|
|
10935
|
-
for (const entry of
|
|
10974
|
+
for (const entry of readdirSync11(dir, { withFileTypes: true })) {
|
|
10936
10975
|
if (entry.isDirectory()) {
|
|
10937
10976
|
const found = scanDir(join14(dir, entry.name));
|
|
10938
10977
|
if (found)
|