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/mcp.js
CHANGED
|
@@ -6468,6 +6468,64 @@ var init_chunker = __esm({
|
|
|
6468
6468
|
}
|
|
6469
6469
|
});
|
|
6470
6470
|
|
|
6471
|
+
// ../engine/dist/core/project-dir-name.js
|
|
6472
|
+
import { readdirSync as readdirSync5 } from "node:fs";
|
|
6473
|
+
function looksWindowsEncoded(dirName) {
|
|
6474
|
+
return /^[A-Za-z]--/.test(dirName);
|
|
6475
|
+
}
|
|
6476
|
+
function decodeProjectDirName(dirName) {
|
|
6477
|
+
if (!dirName)
|
|
6478
|
+
return "";
|
|
6479
|
+
if (looksWindowsEncoded(dirName)) {
|
|
6480
|
+
const drive = dirName[0].toUpperCase();
|
|
6481
|
+
const rest = dirName.slice(3).replace(/-/g, "\\");
|
|
6482
|
+
return `${drive}:\\${rest}`;
|
|
6483
|
+
}
|
|
6484
|
+
return "/" + dirName.replace(/^-/, "").replace(/-/g, "/");
|
|
6485
|
+
}
|
|
6486
|
+
function resolveProjectDirName(dirName, deps = {}) {
|
|
6487
|
+
const structural = decodeProjectDirName(dirName);
|
|
6488
|
+
if (!dirName)
|
|
6489
|
+
return structural;
|
|
6490
|
+
if (looksWindowsEncoded(dirName))
|
|
6491
|
+
return structural;
|
|
6492
|
+
const readdir3 = deps.readdir ?? ((p) => readdirSync5(p, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name));
|
|
6493
|
+
const encodeName = (name) => name.replace(/[-_.]/g, "-");
|
|
6494
|
+
let remaining = dirName.replace(/^-/, "");
|
|
6495
|
+
let current = "/";
|
|
6496
|
+
while (remaining) {
|
|
6497
|
+
let children;
|
|
6498
|
+
try {
|
|
6499
|
+
children = readdir3(current);
|
|
6500
|
+
} catch {
|
|
6501
|
+
break;
|
|
6502
|
+
}
|
|
6503
|
+
let best = "";
|
|
6504
|
+
for (const child of children) {
|
|
6505
|
+
const encoded = encodeName(child);
|
|
6506
|
+
if (!encoded || encoded.length < best.length)
|
|
6507
|
+
continue;
|
|
6508
|
+
if (!remaining.startsWith(encoded))
|
|
6509
|
+
continue;
|
|
6510
|
+
const next = remaining[encoded.length];
|
|
6511
|
+
if (next !== void 0 && next !== "-")
|
|
6512
|
+
continue;
|
|
6513
|
+
if (encoded.length > best.length)
|
|
6514
|
+
best = child;
|
|
6515
|
+
}
|
|
6516
|
+
if (!best)
|
|
6517
|
+
break;
|
|
6518
|
+
current = current === "/" ? `/${best}` : `${current}/${best}`;
|
|
6519
|
+
remaining = remaining.slice(encodeName(best).length).replace(/^-/, "");
|
|
6520
|
+
}
|
|
6521
|
+
return remaining ? structural : current;
|
|
6522
|
+
}
|
|
6523
|
+
var init_project_dir_name = __esm({
|
|
6524
|
+
"../engine/dist/core/project-dir-name.js"() {
|
|
6525
|
+
"use strict";
|
|
6526
|
+
}
|
|
6527
|
+
});
|
|
6528
|
+
|
|
6471
6529
|
// ../engine/dist/core/model-pricing.js
|
|
6472
6530
|
function pricingFor(modelId) {
|
|
6473
6531
|
if (!modelId)
|
|
@@ -6639,7 +6697,7 @@ var init_model_pricing = __esm({
|
|
|
6639
6697
|
});
|
|
6640
6698
|
|
|
6641
6699
|
// ../engine/dist/parsers/session.js
|
|
6642
|
-
import { createReadStream, existsSync as existsSync6, readdirSync as
|
|
6700
|
+
import { createReadStream, existsSync as existsSync6, readdirSync as readdirSync6, readFileSync as readFileSync3, statSync as statSync5, openSync, readSync, closeSync } from "fs";
|
|
6643
6701
|
import { createInterface } from "readline";
|
|
6644
6702
|
import { join as join6, basename as basename3 } from "path";
|
|
6645
6703
|
function removeCodeBlocks(text) {
|
|
@@ -6710,7 +6768,7 @@ function* iterAllSessionIndices(claudeDir) {
|
|
|
6710
6768
|
if (!existsSync6(dir)) {
|
|
6711
6769
|
return;
|
|
6712
6770
|
}
|
|
6713
|
-
const entries =
|
|
6771
|
+
const entries = readdirSync6(dir, { withFileTypes: true });
|
|
6714
6772
|
for (const entry of entries) {
|
|
6715
6773
|
if (!entry.isDirectory())
|
|
6716
6774
|
continue;
|
|
@@ -6732,7 +6790,7 @@ function getSubagentPaths(sessionPath) {
|
|
|
6732
6790
|
const subagentsDir = join6(sessionPath.slice(0, -6), "subagents");
|
|
6733
6791
|
if (!existsSync6(subagentsDir))
|
|
6734
6792
|
return [];
|
|
6735
|
-
return
|
|
6793
|
+
return readdirSync6(subagentsDir).filter((f) => f.endsWith(".jsonl")).sort().map((f) => join6(subagentsDir, f));
|
|
6736
6794
|
}
|
|
6737
6795
|
function getSubagentProjectPath(sessionPath, folderDerivedPath) {
|
|
6738
6796
|
const subagentPaths = getSubagentPaths(sessionPath);
|
|
@@ -7049,40 +7107,6 @@ ${resultText}` : resultText;
|
|
|
7049
7107
|
});
|
|
7050
7108
|
return content;
|
|
7051
7109
|
}
|
|
7052
|
-
function decodeDirName(dirName) {
|
|
7053
|
-
const segments = dirName.replace(/^-/, "").split("-");
|
|
7054
|
-
let currentPath = "/";
|
|
7055
|
-
let i = 0;
|
|
7056
|
-
while (i < segments.length) {
|
|
7057
|
-
let matched = false;
|
|
7058
|
-
const singleCandidate = join6(currentPath, segments[i]);
|
|
7059
|
-
if (existsSync6(singleCandidate)) {
|
|
7060
|
-
currentPath = singleCandidate;
|
|
7061
|
-
i++;
|
|
7062
|
-
matched = true;
|
|
7063
|
-
continue;
|
|
7064
|
-
}
|
|
7065
|
-
for (let len = 2; len <= segments.length - i; len++) {
|
|
7066
|
-
const joinedSegments = segments.slice(i, i + len);
|
|
7067
|
-
for (const sep4 of ["-", "_", "."]) {
|
|
7068
|
-
const candidate = join6(currentPath, joinedSegments.join(sep4));
|
|
7069
|
-
if (existsSync6(candidate)) {
|
|
7070
|
-
currentPath = candidate;
|
|
7071
|
-
i += len;
|
|
7072
|
-
matched = true;
|
|
7073
|
-
break;
|
|
7074
|
-
}
|
|
7075
|
-
}
|
|
7076
|
-
if (matched)
|
|
7077
|
-
break;
|
|
7078
|
-
}
|
|
7079
|
-
if (!matched) {
|
|
7080
|
-
currentPath = join6(currentPath, segments[i]);
|
|
7081
|
-
i++;
|
|
7082
|
-
}
|
|
7083
|
-
}
|
|
7084
|
-
return currentPath;
|
|
7085
|
-
}
|
|
7086
7110
|
function* getAllSessions(claudeDir) {
|
|
7087
7111
|
const seenSessionIds = /* @__PURE__ */ new Set();
|
|
7088
7112
|
const projectDirs = claudeDir ? [claudeDir] : claudeProjectDirs();
|
|
@@ -7097,12 +7121,12 @@ function* getAllSessions(claudeDir) {
|
|
|
7097
7121
|
}
|
|
7098
7122
|
if (!existsSync6(dir))
|
|
7099
7123
|
continue;
|
|
7100
|
-
const dirEntries =
|
|
7124
|
+
const dirEntries = readdirSync6(dir, { withFileTypes: true });
|
|
7101
7125
|
for (const projDirEntry of dirEntries) {
|
|
7102
7126
|
if (!projDirEntry.isDirectory())
|
|
7103
7127
|
continue;
|
|
7104
7128
|
const projectPath = join6(dir, projDirEntry.name);
|
|
7105
|
-
const files =
|
|
7129
|
+
const files = readdirSync6(projectPath);
|
|
7106
7130
|
for (const file of files) {
|
|
7107
7131
|
if (!file.endsWith(".jsonl"))
|
|
7108
7132
|
continue;
|
|
@@ -7116,7 +7140,7 @@ function* getAllSessions(claudeDir) {
|
|
|
7116
7140
|
const fullPath = join6(projectPath, file);
|
|
7117
7141
|
try {
|
|
7118
7142
|
const stat3 = statSync5(fullPath);
|
|
7119
|
-
const derivedProjectPath =
|
|
7143
|
+
const derivedProjectPath = resolveProjectDirName(projDirEntry.name);
|
|
7120
7144
|
const effectiveMtime = getSessionMtime(fullPath);
|
|
7121
7145
|
let projectPath2 = "";
|
|
7122
7146
|
if (hasSubagentsDir(fullPath)) {
|
|
@@ -7155,6 +7179,7 @@ var init_session = __esm({
|
|
|
7155
7179
|
init_chunker();
|
|
7156
7180
|
init_claude2();
|
|
7157
7181
|
init_tool_paths();
|
|
7182
|
+
init_project_dir_name();
|
|
7158
7183
|
init_model_pricing();
|
|
7159
7184
|
}
|
|
7160
7185
|
});
|
|
@@ -7813,7 +7838,7 @@ async function archiveRawSession(store2, sessionId) {
|
|
|
7813
7838
|
return await store2.putRawSession(sessionId, exp.tool, Math.floor(exp.mtime), gz, size);
|
|
7814
7839
|
}
|
|
7815
7840
|
function detectForkPredecessor(sessionPath) {
|
|
7816
|
-
const { readFileSync: readFileSync44, readdirSync:
|
|
7841
|
+
const { readFileSync: readFileSync44, readdirSync: readdirSync36 } = requireFs();
|
|
7817
7842
|
const { dirname: dirname20, join: join53, basename: basename25 } = requirePath();
|
|
7818
7843
|
let text;
|
|
7819
7844
|
try {
|
|
@@ -7843,7 +7868,7 @@ function detectForkPredecessor(sessionPath) {
|
|
|
7843
7868
|
const self = basename25(sessionPath);
|
|
7844
7869
|
let entries;
|
|
7845
7870
|
try {
|
|
7846
|
-
entries =
|
|
7871
|
+
entries = readdirSync36(dir);
|
|
7847
7872
|
} catch {
|
|
7848
7873
|
return null;
|
|
7849
7874
|
}
|
|
@@ -8066,28 +8091,8 @@ var init_shadow = __esm({
|
|
|
8066
8091
|
}
|
|
8067
8092
|
});
|
|
8068
8093
|
|
|
8069
|
-
// ../engine/dist/core/project-dir-name.js
|
|
8070
|
-
function looksWindowsEncoded(dirName) {
|
|
8071
|
-
return /^[A-Za-z]--/.test(dirName);
|
|
8072
|
-
}
|
|
8073
|
-
function decodeProjectDirName(dirName) {
|
|
8074
|
-
if (!dirName)
|
|
8075
|
-
return "";
|
|
8076
|
-
if (looksWindowsEncoded(dirName)) {
|
|
8077
|
-
const drive = dirName[0].toUpperCase();
|
|
8078
|
-
const rest = dirName.slice(3).replace(/-/g, "\\");
|
|
8079
|
-
return `${drive}:\\${rest}`;
|
|
8080
|
-
}
|
|
8081
|
-
return "/" + dirName.replace(/^-/, "").replace(/-/g, "/");
|
|
8082
|
-
}
|
|
8083
|
-
var init_project_dir_name = __esm({
|
|
8084
|
-
"../engine/dist/core/project-dir-name.js"() {
|
|
8085
|
-
"use strict";
|
|
8086
|
-
}
|
|
8087
|
-
});
|
|
8088
|
-
|
|
8089
8094
|
// ../engine/dist/core/live-session-scan.js
|
|
8090
|
-
import { existsSync as existsSync8, readdirSync as
|
|
8095
|
+
import { existsSync as existsSync8, readdirSync as readdirSync7, readFileSync as readFileSync5, statSync as statSync7, openSync as openSync2, readSync as readSync2, closeSync as closeSync2 } from "fs";
|
|
8091
8096
|
import { join as join10, basename as basename6 } from "path";
|
|
8092
8097
|
import { createHash as createHash4 } from "crypto";
|
|
8093
8098
|
function lazyGeminiProjectsJson() {
|
|
@@ -8124,7 +8129,7 @@ function sessionFileIndex() {
|
|
|
8124
8129
|
seenRoots.add(root);
|
|
8125
8130
|
let entries;
|
|
8126
8131
|
try {
|
|
8127
|
-
entries =
|
|
8132
|
+
entries = readdirSync7(root, { withFileTypes: true });
|
|
8128
8133
|
} catch {
|
|
8129
8134
|
continue;
|
|
8130
8135
|
}
|
|
@@ -8134,7 +8139,7 @@ function sessionFileIndex() {
|
|
|
8134
8139
|
const dir = join10(root, entry.name);
|
|
8135
8140
|
let names;
|
|
8136
8141
|
try {
|
|
8137
|
-
names =
|
|
8142
|
+
names = readdirSync7(dir);
|
|
8138
8143
|
} catch {
|
|
8139
8144
|
continue;
|
|
8140
8145
|
}
|
|
@@ -8145,7 +8150,7 @@ function sessionFileIndex() {
|
|
|
8145
8150
|
const located = {
|
|
8146
8151
|
path: join10(dir, name),
|
|
8147
8152
|
projectDir: entry.name,
|
|
8148
|
-
projectPath:
|
|
8153
|
+
projectPath: resolveProjectDirName(entry.name)
|
|
8149
8154
|
};
|
|
8150
8155
|
const prior = byId.get(id);
|
|
8151
8156
|
if (prior)
|
|
@@ -8232,7 +8237,7 @@ function resolveSessionContentPaths(sessionFile) {
|
|
|
8232
8237
|
const subDir = join10(sessionFile.slice(0, -6), "subagents");
|
|
8233
8238
|
if (!existsSync8(subDir))
|
|
8234
8239
|
return [sessionFile];
|
|
8235
|
-
const subPaths =
|
|
8240
|
+
const subPaths = readdirSync7(subDir).filter((f) => f.endsWith(".jsonl")).sort().map((f) => join10(subDir, f));
|
|
8236
8241
|
return [sessionFile, ...subPaths];
|
|
8237
8242
|
}
|
|
8238
8243
|
function loadGeminiProjectMap() {
|
|
@@ -8280,7 +8285,7 @@ function geminiIndex() {
|
|
|
8280
8285
|
continue;
|
|
8281
8286
|
let projs;
|
|
8282
8287
|
try {
|
|
8283
|
-
projs =
|
|
8288
|
+
projs = readdirSync7(tmpRoot, { withFileTypes: true });
|
|
8284
8289
|
} catch {
|
|
8285
8290
|
continue;
|
|
8286
8291
|
}
|
|
@@ -8292,7 +8297,7 @@ function geminiIndex() {
|
|
|
8292
8297
|
continue;
|
|
8293
8298
|
let files;
|
|
8294
8299
|
try {
|
|
8295
|
-
files =
|
|
8300
|
+
files = readdirSync7(chats);
|
|
8296
8301
|
} catch {
|
|
8297
8302
|
continue;
|
|
8298
8303
|
}
|
|
@@ -8411,21 +8416,21 @@ function findCodexSessionFile(sessionId) {
|
|
|
8411
8416
|
function findCodexSessionFileIn(root, sessionId) {
|
|
8412
8417
|
if (!existsSync8(root))
|
|
8413
8418
|
return null;
|
|
8414
|
-
for (const year of
|
|
8419
|
+
for (const year of readdirSync7(root, { withFileTypes: true })) {
|
|
8415
8420
|
if (!year.isDirectory())
|
|
8416
8421
|
continue;
|
|
8417
8422
|
const yearPath = join10(root, year.name);
|
|
8418
|
-
for (const month of
|
|
8423
|
+
for (const month of readdirSync7(yearPath, { withFileTypes: true })) {
|
|
8419
8424
|
if (!month.isDirectory())
|
|
8420
8425
|
continue;
|
|
8421
8426
|
const monthPath = join10(yearPath, month.name);
|
|
8422
|
-
for (const day of
|
|
8427
|
+
for (const day of readdirSync7(monthPath, { withFileTypes: true })) {
|
|
8423
8428
|
if (!day.isDirectory())
|
|
8424
8429
|
continue;
|
|
8425
8430
|
const dayPath = join10(monthPath, day.name);
|
|
8426
8431
|
let files;
|
|
8427
8432
|
try {
|
|
8428
|
-
files =
|
|
8433
|
+
files = readdirSync7(dayPath);
|
|
8429
8434
|
} catch {
|
|
8430
8435
|
continue;
|
|
8431
8436
|
}
|
|
@@ -8440,7 +8445,7 @@ function findCodexSessionFileIn(root, sessionId) {
|
|
|
8440
8445
|
}
|
|
8441
8446
|
}
|
|
8442
8447
|
function scanDir(dir) {
|
|
8443
|
-
for (const entry of
|
|
8448
|
+
for (const entry of readdirSync7(dir, { withFileTypes: true })) {
|
|
8444
8449
|
if (entry.isDirectory()) {
|
|
8445
8450
|
const found = scanDir(join10(dir, entry.name));
|
|
8446
8451
|
if (found)
|
|
@@ -9385,7 +9390,7 @@ var init_generic_engine = __esm({
|
|
|
9385
9390
|
});
|
|
9386
9391
|
|
|
9387
9392
|
// ../engine/dist/core/backends/claude.js
|
|
9388
|
-
import { existsSync as existsSync11, readdirSync as
|
|
9393
|
+
import { existsSync as existsSync11, readdirSync as readdirSync8, readFileSync as readFileSync6, statSync as statSync9, openSync as openSync5, readSync as readSync5, closeSync as closeSync5 } from "fs";
|
|
9389
9394
|
import { join as join11, basename as basename9 } from "path";
|
|
9390
9395
|
function stripReminders(text) {
|
|
9391
9396
|
return text.replace(/<system-reminder>[\s\S]*?<\/system-reminder>/g, "").trim();
|
|
@@ -9540,13 +9545,13 @@ var init_claude2 = __esm({
|
|
|
9540
9545
|
collectSessionsFromRoot(root, cutoff, filter, seen, out) {
|
|
9541
9546
|
if (!existsSync11(root))
|
|
9542
9547
|
return;
|
|
9543
|
-
for (const proj of
|
|
9548
|
+
for (const proj of readdirSync8(root, { withFileTypes: true })) {
|
|
9544
9549
|
if (!proj.isDirectory())
|
|
9545
9550
|
continue;
|
|
9546
9551
|
if (filter && !proj.name.toLowerCase().includes(filter))
|
|
9547
9552
|
continue;
|
|
9548
9553
|
const projPath = join11(root, proj.name);
|
|
9549
|
-
const projectPath =
|
|
9554
|
+
const projectPath = resolveProjectDirName(proj.name);
|
|
9550
9555
|
const indexPath = join11(projPath, "sessions-index.json");
|
|
9551
9556
|
if (existsSync11(indexPath)) {
|
|
9552
9557
|
try {
|
|
@@ -9577,7 +9582,7 @@ var init_claude2 = __esm({
|
|
|
9577
9582
|
}
|
|
9578
9583
|
let files;
|
|
9579
9584
|
try {
|
|
9580
|
-
files =
|
|
9585
|
+
files = readdirSync8(projPath);
|
|
9581
9586
|
} catch {
|
|
9582
9587
|
continue;
|
|
9583
9588
|
}
|
|
@@ -9846,7 +9851,7 @@ var init_claude2 = __esm({
|
|
|
9846
9851
|
for (const root of claudeProjectDirs()) {
|
|
9847
9852
|
if (!existsSync11(root))
|
|
9848
9853
|
continue;
|
|
9849
|
-
for (const projEntry of
|
|
9854
|
+
for (const projEntry of readdirSync8(root, { withFileTypes: true })) {
|
|
9850
9855
|
if (!projEntry.isDirectory())
|
|
9851
9856
|
continue;
|
|
9852
9857
|
if (opts.projectFilter && !projEntry.name.toLowerCase().includes(opts.projectFilter.toLowerCase()))
|
|
@@ -9854,7 +9859,7 @@ var init_claude2 = __esm({
|
|
|
9854
9859
|
const projPath = join11(root, projEntry.name);
|
|
9855
9860
|
let files;
|
|
9856
9861
|
try {
|
|
9857
|
-
files =
|
|
9862
|
+
files = readdirSync8(projPath);
|
|
9858
9863
|
} catch {
|
|
9859
9864
|
continue;
|
|
9860
9865
|
}
|
|
@@ -9867,7 +9872,7 @@ var init_claude2 = __esm({
|
|
|
9867
9872
|
let mtime = st.mtimeMs;
|
|
9868
9873
|
const subDir = join11(projPath, f.slice(0, -6), "subagents");
|
|
9869
9874
|
if (existsSync11(subDir)) {
|
|
9870
|
-
for (const sub of
|
|
9875
|
+
for (const sub of readdirSync8(subDir)) {
|
|
9871
9876
|
try {
|
|
9872
9877
|
const subSt = statSync9(join11(subDir, sub));
|
|
9873
9878
|
if (subSt.mtimeMs > mtime)
|
|
@@ -9972,7 +9977,7 @@ var init_claude2 = __esm({
|
|
|
9972
9977
|
|
|
9973
9978
|
// ../engine/dist/core/backends/gemini.js
|
|
9974
9979
|
import { createHash as createHash5 } from "crypto";
|
|
9975
|
-
import { existsSync as existsSync12, readdirSync as
|
|
9980
|
+
import { existsSync as existsSync12, readdirSync as readdirSync9, readFileSync as readFileSync7, statSync as statSync10 } from "fs";
|
|
9976
9981
|
import { basename as basename10, join as join12 } from "path";
|
|
9977
9982
|
function readSessionId(path, format) {
|
|
9978
9983
|
try {
|
|
@@ -10086,7 +10091,7 @@ var init_gemini2 = __esm({
|
|
|
10086
10091
|
const out = [];
|
|
10087
10092
|
const seen = /* @__PURE__ */ new Map();
|
|
10088
10093
|
for (const root of geminiTmpDirs()) {
|
|
10089
|
-
for (const projDir of
|
|
10094
|
+
for (const projDir of readdirSync9(root, { withFileTypes: true })) {
|
|
10090
10095
|
if (!projDir.isDirectory())
|
|
10091
10096
|
continue;
|
|
10092
10097
|
const projectPath = projMap.get(projDir.name) || "";
|
|
@@ -10097,7 +10102,7 @@ var init_gemini2 = __esm({
|
|
|
10097
10102
|
continue;
|
|
10098
10103
|
let files;
|
|
10099
10104
|
try {
|
|
10100
|
-
files =
|
|
10105
|
+
files = readdirSync9(chatsDir);
|
|
10101
10106
|
} catch {
|
|
10102
10107
|
continue;
|
|
10103
10108
|
}
|
|
@@ -10320,7 +10325,7 @@ var init_gemini2 = __esm({
|
|
|
10320
10325
|
return [];
|
|
10321
10326
|
const projMap = this.loadProjectMap();
|
|
10322
10327
|
const candidates2 = [];
|
|
10323
|
-
for (const proj of
|
|
10328
|
+
for (const proj of readdirSync9(tmpRoot, { withFileTypes: true })) {
|
|
10324
10329
|
if (!proj.isDirectory())
|
|
10325
10330
|
continue;
|
|
10326
10331
|
const projectPath = projMap.get(proj.name) || "";
|
|
@@ -10334,7 +10339,7 @@ var init_gemini2 = __esm({
|
|
|
10334
10339
|
continue;
|
|
10335
10340
|
let files;
|
|
10336
10341
|
try {
|
|
10337
|
-
files =
|
|
10342
|
+
files = readdirSync9(chats);
|
|
10338
10343
|
} catch {
|
|
10339
10344
|
continue;
|
|
10340
10345
|
}
|
|
@@ -11000,7 +11005,7 @@ var init_opencode = __esm({
|
|
|
11000
11005
|
});
|
|
11001
11006
|
|
|
11002
11007
|
// ../engine/dist/core/backends/codex.js
|
|
11003
|
-
import { readdirSync as
|
|
11008
|
+
import { readdirSync as readdirSync10, readFileSync as readFileSync8, statSync as statSync11, openSync as openSync6, readSync as readSync6, closeSync as closeSync6 } from "fs";
|
|
11004
11009
|
import { basename as basename11, dirname as dirname11, join as join14 } from "path";
|
|
11005
11010
|
function parseShellWrites(cmd) {
|
|
11006
11011
|
const out = [];
|
|
@@ -11096,7 +11101,7 @@ function parseCodexPatch(input) {
|
|
|
11096
11101
|
function* walkRollouts(root) {
|
|
11097
11102
|
let entries;
|
|
11098
11103
|
try {
|
|
11099
|
-
entries =
|
|
11104
|
+
entries = readdirSync10(root, { withFileTypes: true });
|
|
11100
11105
|
} catch {
|
|
11101
11106
|
return;
|
|
11102
11107
|
}
|
|
@@ -11388,7 +11393,7 @@ var init_codex2 = __esm({
|
|
|
11388
11393
|
const dayDir = located.path.substring(0, located.path.lastIndexOf("/"));
|
|
11389
11394
|
let entries = [];
|
|
11390
11395
|
try {
|
|
11391
|
-
entries =
|
|
11396
|
+
entries = readdirSync10(dayDir);
|
|
11392
11397
|
} catch {
|
|
11393
11398
|
}
|
|
11394
11399
|
for (const entry of entries) {
|
|
@@ -11574,7 +11579,7 @@ var init_codex2 = __esm({
|
|
|
11574
11579
|
const scanDir = (dir) => {
|
|
11575
11580
|
let entries;
|
|
11576
11581
|
try {
|
|
11577
|
-
entries =
|
|
11582
|
+
entries = readdirSync10(dir, { withFileTypes: true });
|
|
11578
11583
|
} catch {
|
|
11579
11584
|
return;
|
|
11580
11585
|
}
|
|
@@ -11667,7 +11672,7 @@ var init_codex2 = __esm({
|
|
|
11667
11672
|
if (parentId) {
|
|
11668
11673
|
const dayDir = dirname11(loc.path);
|
|
11669
11674
|
try {
|
|
11670
|
-
for (const f of
|
|
11675
|
+
for (const f of readdirSync10(dayDir)) {
|
|
11671
11676
|
if (!f.endsWith(".jsonl") || !f.startsWith("rollout-"))
|
|
11672
11677
|
continue;
|
|
11673
11678
|
const p = join14(dayDir, f);
|
|
@@ -11714,7 +11719,7 @@ var init_codex2 = __esm({
|
|
|
11714
11719
|
});
|
|
11715
11720
|
|
|
11716
11721
|
// ../engine/dist/core/backends/agy.js
|
|
11717
|
-
import { existsSync as existsSync14, readdirSync as
|
|
11722
|
+
import { existsSync as existsSync14, readdirSync as readdirSync11, readFileSync as readFileSync9, statSync as statSync12 } from "fs";
|
|
11718
11723
|
import { basename as basename12, dirname as dirname12, join as join15 } from "path";
|
|
11719
11724
|
function agyTranscriptPath(logsDir) {
|
|
11720
11725
|
const full = join15(logsDir, "transcript_full.jsonl");
|
|
@@ -11883,7 +11888,7 @@ var init_agy = __esm({
|
|
|
11883
11888
|
for (const brainDir of agyBrainDirs()) {
|
|
11884
11889
|
let sessionDirs;
|
|
11885
11890
|
try {
|
|
11886
|
-
sessionDirs =
|
|
11891
|
+
sessionDirs = readdirSync11(brainDir);
|
|
11887
11892
|
} catch {
|
|
11888
11893
|
continue;
|
|
11889
11894
|
}
|
|
@@ -12158,7 +12163,7 @@ var init_agy = __esm({
|
|
|
12158
12163
|
const candidates2 = [];
|
|
12159
12164
|
let sessionDirs;
|
|
12160
12165
|
try {
|
|
12161
|
-
sessionDirs =
|
|
12166
|
+
sessionDirs = readdirSync11(brainDir);
|
|
12162
12167
|
} catch {
|
|
12163
12168
|
return [];
|
|
12164
12169
|
}
|
|
@@ -12234,7 +12239,7 @@ var init_agy = __esm({
|
|
|
12234
12239
|
});
|
|
12235
12240
|
|
|
12236
12241
|
// ../engine/dist/core/backends/cursor-store.js
|
|
12237
|
-
import { existsSync as existsSync15, readdirSync as
|
|
12242
|
+
import { existsSync as existsSync15, readdirSync as readdirSync12, readFileSync as readFileSync10, statSync as statSync13 } from "fs";
|
|
12238
12243
|
import { join as join16 } from "path";
|
|
12239
12244
|
function cursorProjectSlug(absPath) {
|
|
12240
12245
|
return absPath.replace(/[^a-zA-Z0-9]/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
@@ -12243,7 +12248,7 @@ function listChatsIn(chatsRoot) {
|
|
|
12243
12248
|
const out = [];
|
|
12244
12249
|
let hashDirs;
|
|
12245
12250
|
try {
|
|
12246
|
-
hashDirs =
|
|
12251
|
+
hashDirs = readdirSync12(chatsRoot);
|
|
12247
12252
|
} catch {
|
|
12248
12253
|
return out;
|
|
12249
12254
|
}
|
|
@@ -12253,7 +12258,7 @@ function listChatsIn(chatsRoot) {
|
|
|
12253
12258
|
try {
|
|
12254
12259
|
if (!statSync13(hashPath2).isDirectory())
|
|
12255
12260
|
continue;
|
|
12256
|
-
chatIds =
|
|
12261
|
+
chatIds = readdirSync12(hashPath2);
|
|
12257
12262
|
} catch {
|
|
12258
12263
|
continue;
|
|
12259
12264
|
}
|
|
@@ -12298,7 +12303,7 @@ function findChat(chatsRoots, chatId) {
|
|
|
12298
12303
|
for (const root of chatsRoots) {
|
|
12299
12304
|
let hashDirs;
|
|
12300
12305
|
try {
|
|
12301
|
-
hashDirs =
|
|
12306
|
+
hashDirs = readdirSync12(root);
|
|
12302
12307
|
} catch {
|
|
12303
12308
|
continue;
|
|
12304
12309
|
}
|
|
@@ -12619,7 +12624,7 @@ var init_cursor_store = __esm({
|
|
|
12619
12624
|
});
|
|
12620
12625
|
|
|
12621
12626
|
// ../engine/dist/core/backends/cursor-ide.js
|
|
12622
|
-
import { existsSync as existsSync16, readFileSync as readFileSync11, readdirSync as
|
|
12627
|
+
import { existsSync as existsSync16, readFileSync as readFileSync11, readdirSync as readdirSync13, statSync as statSync14 } from "fs";
|
|
12623
12628
|
import { dirname as dirname13, join as join17 } from "path";
|
|
12624
12629
|
function jsonOf(value) {
|
|
12625
12630
|
if (value == null)
|
|
@@ -12682,7 +12687,7 @@ function workspaceIndex(workspaceRoots) {
|
|
|
12682
12687
|
for (const root of workspaceRoots) {
|
|
12683
12688
|
let entries;
|
|
12684
12689
|
try {
|
|
12685
|
-
entries =
|
|
12690
|
+
entries = readdirSync13(root);
|
|
12686
12691
|
} catch {
|
|
12687
12692
|
continue;
|
|
12688
12693
|
}
|
|
@@ -12769,7 +12774,7 @@ function listComposers(globalDbPath, workspaceRoots) {
|
|
|
12769
12774
|
for (const root of workspaceRoots) {
|
|
12770
12775
|
let entries;
|
|
12771
12776
|
try {
|
|
12772
|
-
entries =
|
|
12777
|
+
entries = readdirSync13(root);
|
|
12773
12778
|
} catch {
|
|
12774
12779
|
continue;
|
|
12775
12780
|
}
|
|
@@ -15158,7 +15163,7 @@ var init_collector = __esm({
|
|
|
15158
15163
|
|
|
15159
15164
|
// ../engine/dist/core/source-discovery.js
|
|
15160
15165
|
import { createHash as createHash9 } from "crypto";
|
|
15161
|
-
import { existsSync as existsSync24, readdirSync as
|
|
15166
|
+
import { existsSync as existsSync24, readdirSync as readdirSync14, statSync as statSync20 } from "fs";
|
|
15162
15167
|
import { join as join27 } from "path";
|
|
15163
15168
|
function sourceId(path) {
|
|
15164
15169
|
return "src_" + createHash9("sha256").update(path).digest("hex").slice(0, 12);
|
|
@@ -15195,7 +15200,7 @@ function countTranscripts(root, tool) {
|
|
|
15195
15200
|
return;
|
|
15196
15201
|
let entries;
|
|
15197
15202
|
try {
|
|
15198
|
-
entries =
|
|
15203
|
+
entries = readdirSync14(dir, { withFileTypes: true });
|
|
15199
15204
|
} catch {
|
|
15200
15205
|
return;
|
|
15201
15206
|
}
|
|
@@ -15265,7 +15270,7 @@ var init_source_discovery = __esm({
|
|
|
15265
15270
|
|
|
15266
15271
|
// ../engine/dist/core/home-discovery.js
|
|
15267
15272
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
15268
|
-
import { existsSync as existsSync25, readdirSync as
|
|
15273
|
+
import { existsSync as existsSync25, readdirSync as readdirSync15, readFileSync as readFileSync19, realpathSync as realpathSync3, statSync as statSync21 } from "fs";
|
|
15269
15274
|
import { homedir as homedir7, platform as osPlatform } from "os";
|
|
15270
15275
|
import { join as join28 } from "path";
|
|
15271
15276
|
function candidateRoots(plat = osPlatform(), env = process.env) {
|
|
@@ -15309,7 +15314,7 @@ function dirHasTranscript(root, match, depth) {
|
|
|
15309
15314
|
return false;
|
|
15310
15315
|
let entries;
|
|
15311
15316
|
try {
|
|
15312
|
-
entries =
|
|
15317
|
+
entries = readdirSync15(root, { withFileTypes: true });
|
|
15313
15318
|
} catch {
|
|
15314
15319
|
return false;
|
|
15315
15320
|
}
|
|
@@ -15341,7 +15346,7 @@ function countSessions(dir, tool) {
|
|
|
15341
15346
|
return;
|
|
15342
15347
|
let entries;
|
|
15343
15348
|
try {
|
|
15344
|
-
entries =
|
|
15349
|
+
entries = readdirSync15(d, { withFileTypes: true });
|
|
15345
15350
|
} catch {
|
|
15346
15351
|
return;
|
|
15347
15352
|
}
|
|
@@ -15410,7 +15415,7 @@ function runningToolHomes(plat = osPlatform()) {
|
|
|
15410
15415
|
if (plat === "linux") {
|
|
15411
15416
|
let pids;
|
|
15412
15417
|
try {
|
|
15413
|
-
pids =
|
|
15418
|
+
pids = readdirSync15("/proc").filter((p) => /^\d+$/.test(p));
|
|
15414
15419
|
} catch {
|
|
15415
15420
|
return out;
|
|
15416
15421
|
}
|
|
@@ -15490,7 +15495,7 @@ function walkForHomes(dir, depth, visit) {
|
|
|
15490
15495
|
return;
|
|
15491
15496
|
let entries;
|
|
15492
15497
|
try {
|
|
15493
|
-
entries =
|
|
15498
|
+
entries = readdirSync15(dir, { withFileTypes: true });
|
|
15494
15499
|
} catch {
|
|
15495
15500
|
return;
|
|
15496
15501
|
}
|
|
@@ -16586,7 +16591,7 @@ var init_session_source = __esm({
|
|
|
16586
16591
|
});
|
|
16587
16592
|
|
|
16588
16593
|
// ../engine/dist/core/utils.js
|
|
16589
|
-
import { existsSync as existsSync26, readdirSync as
|
|
16594
|
+
import { existsSync as existsSync26, readdirSync as readdirSync16 } from "fs";
|
|
16590
16595
|
import { homedir as homedir8 } from "os";
|
|
16591
16596
|
import { join as join29 } from "path";
|
|
16592
16597
|
function splitByHeaders(markdown) {
|
|
@@ -16637,7 +16642,7 @@ function getClaudeDirs() {
|
|
|
16637
16642
|
}
|
|
16638
16643
|
add(join29(home, ".claude"));
|
|
16639
16644
|
try {
|
|
16640
|
-
const entries =
|
|
16645
|
+
const entries = readdirSync16(home, { withFileTypes: true });
|
|
16641
16646
|
for (const entry of entries) {
|
|
16642
16647
|
if (entry.isDirectory() && entry.name.startsWith(".claude-") && entry.name !== ".claude-code") {
|
|
16643
16648
|
const candidate = join29(home, entry.name);
|
|
@@ -16667,7 +16672,7 @@ var init_utils = __esm({
|
|
|
16667
16672
|
});
|
|
16668
16673
|
|
|
16669
16674
|
// ../engine/dist/parsers/plan-source.js
|
|
16670
|
-
import { existsSync as existsSync27, readdirSync as
|
|
16675
|
+
import { existsSync as existsSync27, readdirSync as readdirSync17, readFileSync as readFileSync20, statSync as statSync24 } from "fs";
|
|
16671
16676
|
import { homedir as homedir9 } from "os";
|
|
16672
16677
|
import { join as join30, basename as basename14 } from "path";
|
|
16673
16678
|
import { createHash as createHash10 } from "crypto";
|
|
@@ -16694,7 +16699,7 @@ function parseFrontmatter(content) {
|
|
|
16694
16699
|
}
|
|
16695
16700
|
function safeReaddir(dir) {
|
|
16696
16701
|
try {
|
|
16697
|
-
return
|
|
16702
|
+
return readdirSync17(dir);
|
|
16698
16703
|
} catch {
|
|
16699
16704
|
return [];
|
|
16700
16705
|
}
|
|
@@ -16730,11 +16735,11 @@ var init_plan_source = __esm({
|
|
|
16730
16735
|
if (!existsSync27(projectsDir))
|
|
16731
16736
|
return this._knownProjectDirs;
|
|
16732
16737
|
try {
|
|
16733
|
-
const entries =
|
|
16738
|
+
const entries = readdirSync17(projectsDir, { withFileTypes: true });
|
|
16734
16739
|
for (const entry of entries) {
|
|
16735
16740
|
if (!entry.isDirectory() || entry.name.startsWith("."))
|
|
16736
16741
|
continue;
|
|
16737
|
-
const projectPath =
|
|
16742
|
+
const projectPath = resolveProjectDirName(entry.name);
|
|
16738
16743
|
if (existsSync27(projectPath)) {
|
|
16739
16744
|
this._knownProjectDirs.push(projectPath);
|
|
16740
16745
|
}
|
|
@@ -16762,7 +16767,7 @@ var init_plan_source = __esm({
|
|
|
16762
16767
|
for (const plansDir of this.plansDirs) {
|
|
16763
16768
|
if (!existsSync27(plansDir))
|
|
16764
16769
|
continue;
|
|
16765
|
-
const files =
|
|
16770
|
+
const files = readdirSync17(plansDir).filter((f) => f.endsWith(".md"));
|
|
16766
16771
|
for (const file of files) {
|
|
16767
16772
|
if (seenClaude.has(file))
|
|
16768
16773
|
continue;
|
|
@@ -16806,7 +16811,7 @@ var init_plan_source = __esm({
|
|
|
16806
16811
|
return;
|
|
16807
16812
|
let files;
|
|
16808
16813
|
try {
|
|
16809
|
-
files =
|
|
16814
|
+
files = readdirSync17(plansDir).filter((f) => f.endsWith(".md"));
|
|
16810
16815
|
} catch {
|
|
16811
16816
|
return;
|
|
16812
16817
|
}
|
|
@@ -16853,7 +16858,7 @@ var init_plan_source = __esm({
|
|
|
16853
16858
|
}
|
|
16854
16859
|
let projDirs;
|
|
16855
16860
|
try {
|
|
16856
|
-
projDirs =
|
|
16861
|
+
projDirs = readdirSync17(tmpRoot);
|
|
16857
16862
|
} catch {
|
|
16858
16863
|
return;
|
|
16859
16864
|
}
|
|
@@ -16862,7 +16867,7 @@ var init_plan_source = __esm({
|
|
|
16862
16867
|
const projRoot = join30(tmpRoot, projDir);
|
|
16863
16868
|
let sessions;
|
|
16864
16869
|
try {
|
|
16865
|
-
sessions =
|
|
16870
|
+
sessions = readdirSync17(projRoot);
|
|
16866
16871
|
} catch {
|
|
16867
16872
|
continue;
|
|
16868
16873
|
}
|
|
@@ -16872,7 +16877,7 @@ var init_plan_source = __esm({
|
|
|
16872
16877
|
continue;
|
|
16873
16878
|
let files;
|
|
16874
16879
|
try {
|
|
16875
|
-
files =
|
|
16880
|
+
files = readdirSync17(plansDir).filter((f) => f.endsWith(".md"));
|
|
16876
16881
|
} catch {
|
|
16877
16882
|
continue;
|
|
16878
16883
|
}
|
|
@@ -17081,7 +17086,7 @@ var init_plan_source = __esm({
|
|
|
17081
17086
|
return;
|
|
17082
17087
|
let sessionDirs;
|
|
17083
17088
|
try {
|
|
17084
|
-
sessionDirs =
|
|
17089
|
+
sessionDirs = readdirSync17(brainDir);
|
|
17085
17090
|
} catch {
|
|
17086
17091
|
return;
|
|
17087
17092
|
}
|
|
@@ -17095,7 +17100,7 @@ var init_plan_source = __esm({
|
|
|
17095
17100
|
}
|
|
17096
17101
|
let files;
|
|
17097
17102
|
try {
|
|
17098
|
-
files =
|
|
17103
|
+
files = readdirSync17(sessionPath).filter((f) => f.endsWith(".md"));
|
|
17099
17104
|
} catch {
|
|
17100
17105
|
continue;
|
|
17101
17106
|
}
|
|
@@ -17132,7 +17137,7 @@ var init_plan_source = __esm({
|
|
|
17132
17137
|
});
|
|
17133
17138
|
|
|
17134
17139
|
// ../engine/dist/parsers/task-source.js
|
|
17135
|
-
import { existsSync as existsSync28, readdirSync as
|
|
17140
|
+
import { existsSync as existsSync28, readdirSync as readdirSync18, readFileSync as readFileSync21, statSync as statSync25 } from "fs";
|
|
17136
17141
|
import { join as join31 } from "path";
|
|
17137
17142
|
var MAX_CHUNK_CHARS2, TaskSource;
|
|
17138
17143
|
var init_task_source = __esm({
|
|
@@ -17166,7 +17171,7 @@ var init_task_source = __esm({
|
|
|
17166
17171
|
return;
|
|
17167
17172
|
let files;
|
|
17168
17173
|
try {
|
|
17169
|
-
files =
|
|
17174
|
+
files = readdirSync18(todosDir).filter((f) => f.endsWith(".json"));
|
|
17170
17175
|
} catch {
|
|
17171
17176
|
return;
|
|
17172
17177
|
}
|
|
@@ -17215,7 +17220,7 @@ var init_task_source = __esm({
|
|
|
17215
17220
|
async *discoverInDir(tasksDir) {
|
|
17216
17221
|
if (!existsSync28(tasksDir))
|
|
17217
17222
|
return;
|
|
17218
|
-
const entries =
|
|
17223
|
+
const entries = readdirSync18(tasksDir, { withFileTypes: true });
|
|
17219
17224
|
for (const entry of entries) {
|
|
17220
17225
|
if (!entry.isDirectory())
|
|
17221
17226
|
continue;
|
|
@@ -17223,7 +17228,7 @@ var init_task_source = __esm({
|
|
|
17223
17228
|
const taskDir = join31(tasksDir, sessionUuid);
|
|
17224
17229
|
try {
|
|
17225
17230
|
const stat3 = statSync25(taskDir);
|
|
17226
|
-
const taskFiles =
|
|
17231
|
+
const taskFiles = readdirSync18(taskDir).filter((f) => f.endsWith(".json"));
|
|
17227
17232
|
if (taskFiles.length === 0)
|
|
17228
17233
|
continue;
|
|
17229
17234
|
const tasks = this.readTasks(taskDir, taskFiles);
|
|
@@ -17257,7 +17262,7 @@ var init_task_source = __esm({
|
|
|
17257
17262
|
const taskDir = item.filePath;
|
|
17258
17263
|
if (!existsSync28(taskDir))
|
|
17259
17264
|
return [];
|
|
17260
|
-
const taskFiles =
|
|
17265
|
+
const taskFiles = readdirSync18(taskDir).filter((f) => f.endsWith(".json"));
|
|
17261
17266
|
const tasks = this.readTasks(taskDir, taskFiles);
|
|
17262
17267
|
if (tasks.length === 0)
|
|
17263
17268
|
return [];
|
|
@@ -17368,7 +17373,7 @@ ${task.description}`.slice(0, MAX_CHUNK_CHARS2);
|
|
|
17368
17373
|
});
|
|
17369
17374
|
|
|
17370
17375
|
// ../engine/dist/parsers/claude-md-source.js
|
|
17371
|
-
import { existsSync as existsSync29, readFileSync as readFileSync22, readdirSync as
|
|
17376
|
+
import { existsSync as existsSync29, readFileSync as readFileSync22, readdirSync as readdirSync19, statSync as statSync26 } from "fs";
|
|
17372
17377
|
import { homedir as homedir10 } from "os";
|
|
17373
17378
|
import { join as join32, basename as basename15, dirname as dirname15 } from "path";
|
|
17374
17379
|
import { createHash as createHash11 } from "crypto";
|
|
@@ -17385,11 +17390,11 @@ function discoverProjectDirs(claudeDir) {
|
|
|
17385
17390
|
if (!existsSync29(projectsDir))
|
|
17386
17391
|
return;
|
|
17387
17392
|
try {
|
|
17388
|
-
const entries =
|
|
17393
|
+
const entries = readdirSync19(projectsDir, { withFileTypes: true });
|
|
17389
17394
|
for (const entry of entries) {
|
|
17390
17395
|
if (!entry.isDirectory() || entry.name.startsWith("."))
|
|
17391
17396
|
continue;
|
|
17392
|
-
const projectPath =
|
|
17397
|
+
const projectPath = resolveProjectDirName(entry.name);
|
|
17393
17398
|
addProject(projectPath);
|
|
17394
17399
|
}
|
|
17395
17400
|
} catch {
|
|
@@ -17402,7 +17407,7 @@ function discoverProjectDirs(claudeDir) {
|
|
|
17402
17407
|
const home = homedir10();
|
|
17403
17408
|
scanProjectsDir(claudeBackend.projectsDir());
|
|
17404
17409
|
try {
|
|
17405
|
-
for (const entry of
|
|
17410
|
+
for (const entry of readdirSync19(home, { withFileTypes: true })) {
|
|
17406
17411
|
if (entry.isDirectory() && entry.name.startsWith(".claude-") && entry.name !== ".claude-code") {
|
|
17407
17412
|
scanProjectsDir(join32(home, entry.name, "projects"));
|
|
17408
17413
|
}
|
|
@@ -17504,7 +17509,7 @@ var init_claude_md_source = __esm({
|
|
|
17504
17509
|
}
|
|
17505
17510
|
}
|
|
17506
17511
|
try {
|
|
17507
|
-
const entries =
|
|
17512
|
+
const entries = readdirSync19(searchDir, { withFileTypes: true });
|
|
17508
17513
|
for (const entry of entries) {
|
|
17509
17514
|
if (!entry.isDirectory())
|
|
17510
17515
|
continue;
|
|
@@ -17594,7 +17599,7 @@ var init_claude_md_source = __esm({
|
|
|
17594
17599
|
});
|
|
17595
17600
|
|
|
17596
17601
|
// ../engine/dist/parsers/agent-memory-source.js
|
|
17597
|
-
import { existsSync as existsSync30, readFileSync as readFileSync23, readdirSync as
|
|
17602
|
+
import { existsSync as existsSync30, readFileSync as readFileSync23, readdirSync as readdirSync20, statSync as statSync27 } from "fs";
|
|
17598
17603
|
import { homedir as homedir11 } from "os";
|
|
17599
17604
|
import { join as join33, basename as basename16 } from "path";
|
|
17600
17605
|
function parseFrontmatter2(content) {
|
|
@@ -17622,7 +17627,7 @@ function parseFrontmatter2(content) {
|
|
|
17622
17627
|
return { fm, body };
|
|
17623
17628
|
}
|
|
17624
17629
|
function projectHashToPath(hashDir) {
|
|
17625
|
-
return
|
|
17630
|
+
return resolveProjectDirName(hashDir);
|
|
17626
17631
|
}
|
|
17627
17632
|
function discoverMemoryDirs() {
|
|
17628
17633
|
const out = [];
|
|
@@ -17636,7 +17641,7 @@ function discoverMemoryDirs() {
|
|
|
17636
17641
|
const home = homedir11();
|
|
17637
17642
|
const claudeRoots = [claudeBackend.projectsDir()];
|
|
17638
17643
|
try {
|
|
17639
|
-
for (const entry of
|
|
17644
|
+
for (const entry of readdirSync20(home, { withFileTypes: true })) {
|
|
17640
17645
|
if (entry.isDirectory() && entry.name.startsWith(".claude-") && entry.name !== ".claude-code") {
|
|
17641
17646
|
claudeRoots.push(join33(home, entry.name, "projects"));
|
|
17642
17647
|
}
|
|
@@ -17647,7 +17652,7 @@ function discoverMemoryDirs() {
|
|
|
17647
17652
|
if (!existsSync30(projectsDir))
|
|
17648
17653
|
continue;
|
|
17649
17654
|
try {
|
|
17650
|
-
for (const entry of
|
|
17655
|
+
for (const entry of readdirSync20(projectsDir, { withFileTypes: true })) {
|
|
17651
17656
|
if (!entry.isDirectory() || entry.name.startsWith("."))
|
|
17652
17657
|
continue;
|
|
17653
17658
|
add(join33(projectsDir, entry.name, "memory"), entry.name);
|
|
@@ -17676,7 +17681,7 @@ var init_agent_memory_source = __esm({
|
|
|
17676
17681
|
for (const { memoryDir, projectHash } of discoverMemoryDirs()) {
|
|
17677
17682
|
const projectPath = projectHashToPath(projectHash);
|
|
17678
17683
|
try {
|
|
17679
|
-
for (const entry of
|
|
17684
|
+
for (const entry of readdirSync20(memoryDir, { withFileTypes: true })) {
|
|
17680
17685
|
if (!entry.isFile() || !entry.name.endsWith(".md"))
|
|
17681
17686
|
continue;
|
|
17682
17687
|
const filePath = join33(memoryDir, entry.name);
|
|
@@ -17779,7 +17784,7 @@ var init_agent_memory_source = __esm({
|
|
|
17779
17784
|
});
|
|
17780
17785
|
|
|
17781
17786
|
// ../engine/dist/parsers/history-source.js
|
|
17782
|
-
import { existsSync as existsSync31, readdirSync as
|
|
17787
|
+
import { existsSync as existsSync31, readdirSync as readdirSync21, statSync as statSync28 } from "fs";
|
|
17783
17788
|
import { createReadStream as createReadStream3 } from "fs";
|
|
17784
17789
|
import { createInterface as createInterface2 } from "readline";
|
|
17785
17790
|
import { homedir as homedir12 } from "os";
|
|
@@ -17806,7 +17811,7 @@ var init_history_source = __esm({
|
|
|
17806
17811
|
};
|
|
17807
17812
|
tryAdd(claudeBackend.historyFile());
|
|
17808
17813
|
try {
|
|
17809
|
-
for (const entry of
|
|
17814
|
+
for (const entry of readdirSync21(home, { withFileTypes: true })) {
|
|
17810
17815
|
if (entry.isDirectory() && entry.name.startsWith(".claude-") && entry.name !== ".claude-code") {
|
|
17811
17816
|
tryAdd(join34(home, entry.name, "history.jsonl"));
|
|
17812
17817
|
}
|
|
@@ -17963,7 +17968,7 @@ var init_history_source = __esm({
|
|
|
17963
17968
|
});
|
|
17964
17969
|
|
|
17965
17970
|
// ../engine/dist/parsers/paste-source.js
|
|
17966
|
-
import { existsSync as existsSync32, readdirSync as
|
|
17971
|
+
import { existsSync as existsSync32, readdirSync as readdirSync22, readFileSync as readFileSync24, statSync as statSync29 } from "fs";
|
|
17967
17972
|
import { homedir as homedir13 } from "os";
|
|
17968
17973
|
import { join as join35, basename as basename17 } from "path";
|
|
17969
17974
|
var MAX_CHUNK_CHARS6, MAX_FILE_SIZE, PasteSource;
|
|
@@ -17989,7 +17994,7 @@ var init_paste_source = __esm({
|
|
|
17989
17994
|
};
|
|
17990
17995
|
tryAdd(claudeBackend.pasteCacheDir());
|
|
17991
17996
|
try {
|
|
17992
|
-
for (const entry of
|
|
17997
|
+
for (const entry of readdirSync22(home, { withFileTypes: true })) {
|
|
17993
17998
|
if (entry.isDirectory() && entry.name.startsWith(".claude-") && entry.name !== ".claude-code") {
|
|
17994
17999
|
tryAdd(join35(home, entry.name, "paste-cache"));
|
|
17995
18000
|
}
|
|
@@ -18006,7 +18011,7 @@ var init_paste_source = __esm({
|
|
|
18006
18011
|
for (const cacheDir of this.cacheDirs) {
|
|
18007
18012
|
if (!existsSync32(cacheDir))
|
|
18008
18013
|
continue;
|
|
18009
|
-
const files =
|
|
18014
|
+
const files = readdirSync22(cacheDir).filter((f) => f.endsWith(".txt"));
|
|
18010
18015
|
for (const file of files) {
|
|
18011
18016
|
if (seen.has(file))
|
|
18012
18017
|
continue;
|
|
@@ -18063,7 +18068,7 @@ var init_paste_source = __esm({
|
|
|
18063
18068
|
});
|
|
18064
18069
|
|
|
18065
18070
|
// ../engine/dist/parsers/gemini-source.js
|
|
18066
|
-
import { existsSync as existsSync33, readdirSync as
|
|
18071
|
+
import { existsSync as existsSync33, readdirSync as readdirSync23, readFileSync as readFileSync25, statSync as statSync30 } from "fs";
|
|
18067
18072
|
import { join as join36, basename as basename18 } from "path";
|
|
18068
18073
|
import { createHash as createHash12 } from "crypto";
|
|
18069
18074
|
function loadGeminiProjectMap2() {
|
|
@@ -18105,13 +18110,13 @@ var init_gemini_source = __esm({
|
|
|
18105
18110
|
return;
|
|
18106
18111
|
const seen = /* @__PURE__ */ new Set();
|
|
18107
18112
|
try {
|
|
18108
|
-
for (const projectDirEntry of
|
|
18113
|
+
for (const projectDirEntry of readdirSync23(tmpDir, { withFileTypes: true })) {
|
|
18109
18114
|
if (!projectDirEntry.isDirectory())
|
|
18110
18115
|
continue;
|
|
18111
18116
|
const chatsDir = join36(tmpDir, projectDirEntry.name, "chats");
|
|
18112
18117
|
if (!existsSync33(chatsDir))
|
|
18113
18118
|
continue;
|
|
18114
|
-
for (const file of
|
|
18119
|
+
for (const file of readdirSync23(chatsDir)) {
|
|
18115
18120
|
if (!file.endsWith(".json") || !file.startsWith("session-"))
|
|
18116
18121
|
continue;
|
|
18117
18122
|
const filePath = join36(chatsDir, file);
|
|
@@ -18246,7 +18251,7 @@ var init_gemini_source = __esm({
|
|
|
18246
18251
|
});
|
|
18247
18252
|
|
|
18248
18253
|
// ../engine/dist/parsers/gemini-brain-source.js
|
|
18249
|
-
import { existsSync as existsSync34, readdirSync as
|
|
18254
|
+
import { existsSync as existsSync34, readdirSync as readdirSync24, readFileSync as readFileSync26, statSync as statSync31 } from "fs";
|
|
18250
18255
|
import { join as join37 } from "path";
|
|
18251
18256
|
var MAX_CHUNK_CHARS8, GeminiBrainSource;
|
|
18252
18257
|
var init_gemini_brain_source = __esm({
|
|
@@ -18267,12 +18272,12 @@ var init_gemini_brain_source = __esm({
|
|
|
18267
18272
|
return;
|
|
18268
18273
|
if (!existsSync34(this.brainDir))
|
|
18269
18274
|
return;
|
|
18270
|
-
const sessions =
|
|
18275
|
+
const sessions = readdirSync24(this.brainDir, { withFileTypes: true });
|
|
18271
18276
|
for (const entry of sessions) {
|
|
18272
18277
|
if (!entry.isDirectory())
|
|
18273
18278
|
continue;
|
|
18274
18279
|
const sessionDir = join37(this.brainDir, entry.name);
|
|
18275
|
-
const files =
|
|
18280
|
+
const files = readdirSync24(sessionDir).filter((f) => f.endsWith(".md") && !f.includes(".resolved") && !f.includes(".metadata"));
|
|
18276
18281
|
if (files.length === 0)
|
|
18277
18282
|
continue;
|
|
18278
18283
|
for (const file of files) {
|
|
@@ -18660,7 +18665,7 @@ var init_opencode_todo_source = __esm({
|
|
|
18660
18665
|
});
|
|
18661
18666
|
|
|
18662
18667
|
// ../engine/dist/parsers/codex-session-source.js
|
|
18663
|
-
import { existsSync as existsSync37, readdirSync as
|
|
18668
|
+
import { existsSync as existsSync37, readdirSync as readdirSync25, readFileSync as readFileSync27, statSync as statSync32 } from "fs";
|
|
18664
18669
|
import { join as join38, basename as basename19 } from "path";
|
|
18665
18670
|
function getCodexSessionsDir() {
|
|
18666
18671
|
return codexBackend.sessionsDir();
|
|
@@ -18881,7 +18886,7 @@ var init_codex_session_source = __esm({
|
|
|
18881
18886
|
const results = [];
|
|
18882
18887
|
if (!existsSync37(dir))
|
|
18883
18888
|
return results;
|
|
18884
|
-
for (const entry of
|
|
18889
|
+
for (const entry of readdirSync25(dir, { withFileTypes: true })) {
|
|
18885
18890
|
const fullPath = join38(dir, entry.name);
|
|
18886
18891
|
if (entry.isDirectory()) {
|
|
18887
18892
|
results.push(...this.collectJsonlFiles(fullPath));
|
|
@@ -18896,7 +18901,7 @@ var init_codex_session_source = __esm({
|
|
|
18896
18901
|
});
|
|
18897
18902
|
|
|
18898
18903
|
// ../engine/dist/parsers/diary-source.js
|
|
18899
|
-
import { existsSync as existsSync38, mkdirSync as mkdirSync8, readdirSync as
|
|
18904
|
+
import { existsSync as existsSync38, mkdirSync as mkdirSync8, readdirSync as readdirSync26, readFileSync as readFileSync28, writeFileSync as writeFileSync6, statSync as statSync33 } from "fs";
|
|
18900
18905
|
import { join as join39, basename as basename20 } from "path";
|
|
18901
18906
|
var MAX_CHUNK_CHARS11, DiarySource;
|
|
18902
18907
|
var init_diary_source = __esm({
|
|
@@ -18914,10 +18919,10 @@ var init_diary_source = __esm({
|
|
|
18914
18919
|
async *discover() {
|
|
18915
18920
|
if (!existsSync38(this.diaryDir))
|
|
18916
18921
|
return;
|
|
18917
|
-
const agents =
|
|
18922
|
+
const agents = readdirSync26(this.diaryDir, { withFileTypes: true }).filter((d) => d.isDirectory());
|
|
18918
18923
|
for (const agentDir of agents) {
|
|
18919
18924
|
const agentPath = join39(this.diaryDir, agentDir.name);
|
|
18920
|
-
const files =
|
|
18925
|
+
const files = readdirSync26(agentPath).filter((f) => f.endsWith(".json"));
|
|
18921
18926
|
for (const file of files) {
|
|
18922
18927
|
const filePath = join39(agentPath, file);
|
|
18923
18928
|
try {
|
|
@@ -19008,7 +19013,7 @@ var init_diary_source = __esm({
|
|
|
19008
19013
|
const agentDir = join39(dir, agentName.toLowerCase().replace(/[^a-z0-9_-]/g, "_"));
|
|
19009
19014
|
if (!existsSync38(agentDir))
|
|
19010
19015
|
return [];
|
|
19011
|
-
const files =
|
|
19016
|
+
const files = readdirSync26(agentDir).filter((f) => f.endsWith(".json")).sort().reverse().slice(0, lastN);
|
|
19012
19017
|
const entries = [];
|
|
19013
19018
|
for (const file of files) {
|
|
19014
19019
|
try {
|
|
@@ -19057,7 +19062,7 @@ var init_redact_inline = __esm({
|
|
|
19057
19062
|
});
|
|
19058
19063
|
|
|
19059
19064
|
// ../engine/dist/parsers/skills-source.js
|
|
19060
|
-
import { existsSync as existsSync39, readdirSync as
|
|
19065
|
+
import { existsSync as existsSync39, readdirSync as readdirSync27, readFileSync as readFileSync29, statSync as statSync34 } from "fs";
|
|
19061
19066
|
import { homedir as homedir14 } from "os";
|
|
19062
19067
|
import { join as join40 } from "path";
|
|
19063
19068
|
function rebuildBody(content) {
|
|
@@ -19138,7 +19143,7 @@ var init_skills_source = __esm({
|
|
|
19138
19143
|
return;
|
|
19139
19144
|
const codexPluginsDir = codexBackend.pluginsDir();
|
|
19140
19145
|
if (existsSync39(codexPluginsDir)) {
|
|
19141
|
-
for (const pluginName of
|
|
19146
|
+
for (const pluginName of readdirSync27(codexPluginsDir)) {
|
|
19142
19147
|
const skillsDir = join40(codexPluginsDir, pluginName, "skills");
|
|
19143
19148
|
if (!existsSync39(skillsDir))
|
|
19144
19149
|
continue;
|
|
@@ -19149,7 +19154,7 @@ var init_skills_source = __esm({
|
|
|
19149
19154
|
async *fromSkillRoot(root, pluginName) {
|
|
19150
19155
|
let entries;
|
|
19151
19156
|
try {
|
|
19152
|
-
entries =
|
|
19157
|
+
entries = readdirSync27(root.path);
|
|
19153
19158
|
} catch {
|
|
19154
19159
|
return;
|
|
19155
19160
|
}
|
|
@@ -19183,14 +19188,14 @@ var init_skills_source = __esm({
|
|
|
19183
19188
|
}
|
|
19184
19189
|
const subdirs = {};
|
|
19185
19190
|
try {
|
|
19186
|
-
for (const sub of
|
|
19191
|
+
for (const sub of readdirSync27(skillDir)) {
|
|
19187
19192
|
const subPath = join40(skillDir, sub);
|
|
19188
19193
|
try {
|
|
19189
19194
|
const ss = statSync34(subPath);
|
|
19190
19195
|
if (ss.isDirectory()) {
|
|
19191
19196
|
let count = 0;
|
|
19192
19197
|
try {
|
|
19193
|
-
count =
|
|
19198
|
+
count = readdirSync27(subPath).length;
|
|
19194
19199
|
} catch {
|
|
19195
19200
|
}
|
|
19196
19201
|
subdirs[sub] = count;
|
|
@@ -19256,7 +19261,7 @@ var init_skills_source = __esm({
|
|
|
19256
19261
|
});
|
|
19257
19262
|
|
|
19258
19263
|
// ../engine/dist/parsers/mcps-source.js
|
|
19259
|
-
import { existsSync as existsSync40, readdirSync as
|
|
19264
|
+
import { existsSync as existsSync40, readdirSync as readdirSync28, readFileSync as readFileSync30, statSync as statSync35 } from "fs";
|
|
19260
19265
|
import { homedir as homedir15 } from "os";
|
|
19261
19266
|
import { join as join41 } from "path";
|
|
19262
19267
|
function readJson(path) {
|
|
@@ -19370,7 +19375,7 @@ var init_mcps_source = __esm({
|
|
|
19370
19375
|
yield* this.fromCodexToml(codexBackend.configToml());
|
|
19371
19376
|
const pluginsDir = codexBackend.pluginsDir();
|
|
19372
19377
|
if (existsSync40(pluginsDir)) {
|
|
19373
|
-
for (const plugin of
|
|
19378
|
+
for (const plugin of readdirSync28(pluginsDir)) {
|
|
19374
19379
|
const mcpPath = join41(pluginsDir, plugin, ".mcp.json");
|
|
19375
19380
|
yield* this.fromObject(readJson(mcpPath)?.mcpServers, {
|
|
19376
19381
|
tool: "codex",
|
|
@@ -19577,7 +19582,7 @@ var init_toolkit_format = __esm({
|
|
|
19577
19582
|
});
|
|
19578
19583
|
|
|
19579
19584
|
// ../engine/dist/parsers/slash-commands-source.js
|
|
19580
|
-
import { existsSync as existsSync41, readdirSync as
|
|
19585
|
+
import { existsSync as existsSync41, readdirSync as readdirSync29, readFileSync as readFileSync31, statSync as statSync36 } from "fs";
|
|
19581
19586
|
import { join as join42, basename as basename21 } from "path";
|
|
19582
19587
|
function rebuildBody2(content) {
|
|
19583
19588
|
const { text, redacted } = redactInlineSecrets(content);
|
|
@@ -19632,10 +19637,10 @@ var init_slash_commands_source = __esm({
|
|
|
19632
19637
|
const projectsRoot = claudeBackend.projectsDir();
|
|
19633
19638
|
if (existsSync41(projectsRoot)) {
|
|
19634
19639
|
try {
|
|
19635
|
-
for (const entry of
|
|
19640
|
+
for (const entry of readdirSync29(projectsRoot, { withFileTypes: true })) {
|
|
19636
19641
|
if (!entry.isDirectory() || entry.name.startsWith("."))
|
|
19637
19642
|
continue;
|
|
19638
|
-
const projectPath =
|
|
19643
|
+
const projectPath = resolveProjectDirName(entry.name);
|
|
19639
19644
|
const cmdDir = join42(projectPath, ".claude", "commands");
|
|
19640
19645
|
if (existsSync41(cmdDir))
|
|
19641
19646
|
roots.push({ path: cmdDir, tool: "claude", scope: "project", projectPath, format: "md" });
|
|
@@ -19663,7 +19668,7 @@ var init_slash_commands_source = __esm({
|
|
|
19663
19668
|
const ext = root.format === "toml" ? ".toml" : ".md";
|
|
19664
19669
|
let files;
|
|
19665
19670
|
try {
|
|
19666
|
-
files =
|
|
19671
|
+
files = readdirSync29(root.path).filter((f) => f.endsWith(ext));
|
|
19667
19672
|
} catch {
|
|
19668
19673
|
continue;
|
|
19669
19674
|
}
|
|
@@ -19723,7 +19728,7 @@ var init_slash_commands_source = __esm({
|
|
|
19723
19728
|
});
|
|
19724
19729
|
|
|
19725
19730
|
// ../engine/dist/parsers/subagents-source.js
|
|
19726
|
-
import { existsSync as existsSync42, readdirSync as
|
|
19731
|
+
import { existsSync as existsSync42, readdirSync as readdirSync30, readFileSync as readFileSync32, statSync as statSync37 } from "fs";
|
|
19727
19732
|
import { join as join43, basename as basename22 } from "path";
|
|
19728
19733
|
function rebuildBody3(content) {
|
|
19729
19734
|
const { text, redacted } = redactInlineSecrets(content);
|
|
@@ -19780,10 +19785,10 @@ var init_subagents_source = __esm({
|
|
|
19780
19785
|
const projectsRoot = claudeBackend.projectsDir();
|
|
19781
19786
|
if (existsSync42(projectsRoot)) {
|
|
19782
19787
|
try {
|
|
19783
|
-
for (const entry of
|
|
19788
|
+
for (const entry of readdirSync30(projectsRoot, { withFileTypes: true })) {
|
|
19784
19789
|
if (!entry.isDirectory() || entry.name.startsWith("."))
|
|
19785
19790
|
continue;
|
|
19786
|
-
const projectPath =
|
|
19791
|
+
const projectPath = resolveProjectDirName(entry.name);
|
|
19787
19792
|
const agentDir = join43(projectPath, ".claude", "agents");
|
|
19788
19793
|
if (existsSync42(agentDir))
|
|
19789
19794
|
roots.push({ path: agentDir, tool: "claude", scope: "project", projectPath, format: "md" });
|
|
@@ -19811,7 +19816,7 @@ var init_subagents_source = __esm({
|
|
|
19811
19816
|
const ext = root.format === "toml" ? ".toml" : ".md";
|
|
19812
19817
|
let files;
|
|
19813
19818
|
try {
|
|
19814
|
-
files =
|
|
19819
|
+
files = readdirSync30(root.path).filter((f) => f.endsWith(ext));
|
|
19815
19820
|
} catch {
|
|
19816
19821
|
continue;
|
|
19817
19822
|
}
|
|
@@ -19872,7 +19877,7 @@ var init_subagents_source = __esm({
|
|
|
19872
19877
|
});
|
|
19873
19878
|
|
|
19874
19879
|
// ../engine/dist/parsers/hooks-source.js
|
|
19875
|
-
import { existsSync as existsSync43, readFileSync as readFileSync33, readdirSync as
|
|
19880
|
+
import { existsSync as existsSync43, readFileSync as readFileSync33, readdirSync as readdirSync31, statSync as statSync38 } from "fs";
|
|
19876
19881
|
import { join as join44 } from "path";
|
|
19877
19882
|
function readJson2(path) {
|
|
19878
19883
|
if (!existsSync43(path))
|
|
@@ -19899,10 +19904,10 @@ var init_hooks_source = __esm({
|
|
|
19899
19904
|
const projectsRoot = claudeBackend.projectsDir();
|
|
19900
19905
|
if (existsSync43(projectsRoot)) {
|
|
19901
19906
|
try {
|
|
19902
|
-
for (const entry of
|
|
19907
|
+
for (const entry of readdirSync31(projectsRoot, { withFileTypes: true })) {
|
|
19903
19908
|
if (!entry.isDirectory() || entry.name.startsWith("."))
|
|
19904
19909
|
continue;
|
|
19905
|
-
const projectPath =
|
|
19910
|
+
const projectPath = resolveProjectDirName(entry.name);
|
|
19906
19911
|
const settingsPath2 = join44(projectPath, ".claude", "settings.json");
|
|
19907
19912
|
if (existsSync43(settingsPath2)) {
|
|
19908
19913
|
yield* this.fromSettings(settingsPath2, "project", projectPath);
|
|
@@ -19995,7 +20000,7 @@ var init_hooks_source = __esm({
|
|
|
19995
20000
|
});
|
|
19996
20001
|
|
|
19997
20002
|
// ../engine/dist/parsers/plugins-source.js
|
|
19998
|
-
import { existsSync as existsSync44, readFileSync as readFileSync34, readdirSync as
|
|
20003
|
+
import { existsSync as existsSync44, readFileSync as readFileSync34, readdirSync as readdirSync32, statSync as statSync39 } from "fs";
|
|
19999
20004
|
import { homedir as homedir16 } from "os";
|
|
20000
20005
|
import { join as join45 } from "path";
|
|
20001
20006
|
function readJson3(path) {
|
|
@@ -20057,7 +20062,7 @@ var init_plugins_source = __esm({
|
|
|
20057
20062
|
if (isSourceEnabled("gemini", "extensions") && existsSync44(gemRoot)) {
|
|
20058
20063
|
let entries;
|
|
20059
20064
|
try {
|
|
20060
|
-
entries =
|
|
20065
|
+
entries = readdirSync32(gemRoot);
|
|
20061
20066
|
} catch {
|
|
20062
20067
|
entries = [];
|
|
20063
20068
|
}
|
|
@@ -20105,7 +20110,7 @@ var init_plugins_source = __esm({
|
|
|
20105
20110
|
if (isSourceEnabled("codex", "plugins") && existsSync44(codexPluginsRoot)) {
|
|
20106
20111
|
let entries;
|
|
20107
20112
|
try {
|
|
20108
|
-
entries =
|
|
20113
|
+
entries = readdirSync32(codexPluginsRoot);
|
|
20109
20114
|
} catch {
|
|
20110
20115
|
entries = [];
|
|
20111
20116
|
}
|
|
@@ -20640,7 +20645,7 @@ var init_http = __esm({
|
|
|
20640
20645
|
CLI_VERSION = JSON.parse(readFileSync37(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
|
|
20641
20646
|
} catch {
|
|
20642
20647
|
try {
|
|
20643
|
-
if (true) CLI_VERSION = "0.5.
|
|
20648
|
+
if (true) CLI_VERSION = "0.5.32";
|
|
20644
20649
|
} catch {
|
|
20645
20650
|
}
|
|
20646
20651
|
}
|
|
@@ -21160,7 +21165,7 @@ var init_telemetry = __esm({
|
|
|
21160
21165
|
init_sync_client();
|
|
21161
21166
|
cliVersion2 = () => {
|
|
21162
21167
|
try {
|
|
21163
|
-
return true ? "0.5.
|
|
21168
|
+
return true ? "0.5.32" : "dev";
|
|
21164
21169
|
} catch {
|
|
21165
21170
|
return "dev";
|
|
21166
21171
|
}
|
|
@@ -21324,7 +21329,7 @@ __export(auto_update_exports, {
|
|
|
21324
21329
|
import { execSync as execSync4 } from "node:child_process";
|
|
21325
21330
|
import { readFileSync as readFileSync38 } from "node:fs";
|
|
21326
21331
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
21327
|
-
import { writeFileSync as writeFileSync9, mkdtempSync as mkdtempSync3, rmSync as rmSync5, readdirSync as
|
|
21332
|
+
import { writeFileSync as writeFileSync9, mkdtempSync as mkdtempSync3, rmSync as rmSync5, readdirSync as readdirSync33, statSync as statSync41 } from "node:fs";
|
|
21328
21333
|
import { join as join48, dirname as dirname18, sep as sep3 } from "node:path";
|
|
21329
21334
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
21330
21335
|
import { createHash as createHash13 } from "node:crypto";
|
|
@@ -21369,7 +21374,7 @@ function sweepStaleStaging(root = tmpdir2(), now = Date.now()) {
|
|
|
21369
21374
|
let removed = 0;
|
|
21370
21375
|
let entries;
|
|
21371
21376
|
try {
|
|
21372
|
-
entries =
|
|
21377
|
+
entries = readdirSync33(root);
|
|
21373
21378
|
} catch {
|
|
21374
21379
|
return 0;
|
|
21375
21380
|
}
|
|
@@ -21379,7 +21384,7 @@ function sweepStaleStaging(root = tmpdir2(), now = Date.now()) {
|
|
|
21379
21384
|
try {
|
|
21380
21385
|
const st = statSync41(dir);
|
|
21381
21386
|
if (!st.isDirectory() || now - st.mtimeMs < COLD_MS) continue;
|
|
21382
|
-
const inside =
|
|
21387
|
+
const inside = readdirSync33(dir);
|
|
21383
21388
|
if (inside.length > 1 || inside.length === 1 && inside[0] !== "chat-recall.tgz") continue;
|
|
21384
21389
|
rmSync5(dir, { recursive: true, force: true });
|
|
21385
21390
|
removed++;
|
|
@@ -21534,7 +21539,7 @@ __export(sync_client_exports, {
|
|
|
21534
21539
|
syncSessions: () => syncSessions
|
|
21535
21540
|
});
|
|
21536
21541
|
import { join as join49, dirname as dirname19, basename as basename23 } from "node:path";
|
|
21537
|
-
import { readFileSync as readFileSync39, writeFileSync as writeFileSync10, mkdirSync as mkdirSync11, mkdtempSync as mkdtempSync4, rmSync as rmSync6, chmodSync as chmodSync5, unlinkSync as unlinkSync3, readdirSync as
|
|
21542
|
+
import { readFileSync as readFileSync39, writeFileSync as writeFileSync10, mkdirSync as mkdirSync11, mkdtempSync as mkdtempSync4, rmSync as rmSync6, chmodSync as chmodSync5, unlinkSync as unlinkSync3, readdirSync as readdirSync34, statSync as statSync42 } from "node:fs";
|
|
21538
21543
|
import { tmpdir as tmpdir3, hostname as hostname2 } from "node:os";
|
|
21539
21544
|
import { createHash as createHash14 } from "node:crypto";
|
|
21540
21545
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
@@ -21933,7 +21938,7 @@ function reapStaleScanDirs(dir = tmpdir3(), maxAgeMs = 6 * 36e5, now = Date.now(
|
|
|
21933
21938
|
let reaped = 0;
|
|
21934
21939
|
let names;
|
|
21935
21940
|
try {
|
|
21936
|
-
names =
|
|
21941
|
+
names = readdirSync34(dir);
|
|
21937
21942
|
} catch {
|
|
21938
21943
|
return 0;
|
|
21939
21944
|
}
|
|
@@ -23071,7 +23076,7 @@ var init_sync_client = __esm({
|
|
|
23071
23076
|
ownVersion = JSON.parse(readFileSync39(join49(dir, "../package.json"), "utf-8")).version || ownVersion;
|
|
23072
23077
|
} catch {
|
|
23073
23078
|
try {
|
|
23074
|
-
if (true) ownVersion = "0.5.
|
|
23079
|
+
if (true) ownVersion = "0.5.32";
|
|
23075
23080
|
} catch {
|
|
23076
23081
|
}
|
|
23077
23082
|
}
|
|
@@ -23266,7 +23271,7 @@ __export(install_skills_exports, {
|
|
|
23266
23271
|
skillsSourceDir: () => skillsSourceDir,
|
|
23267
23272
|
uninstallSkills: () => uninstallSkills
|
|
23268
23273
|
});
|
|
23269
|
-
import { readdirSync as
|
|
23274
|
+
import { readdirSync as readdirSync35, existsSync as existsSync47, mkdirSync as mkdirSync12, rmSync as rmSync7, cpSync, writeFileSync as writeFileSync12, readFileSync as readFileSync42, statSync as statSync43, realpathSync as realpathSync4 } from "fs";
|
|
23270
23275
|
import { createHash as createHash15 } from "crypto";
|
|
23271
23276
|
import { join as join51, basename as basename24 } from "path";
|
|
23272
23277
|
function skillsSourceDir() {
|
|
@@ -23292,7 +23297,7 @@ function skillsFingerprint() {
|
|
|
23292
23297
|
}
|
|
23293
23298
|
function filesUnder(dir, prefix = "") {
|
|
23294
23299
|
const out = [];
|
|
23295
|
-
for (const e of
|
|
23300
|
+
for (const e of readdirSync35(dir, { withFileTypes: true })) {
|
|
23296
23301
|
if (e.name === MARKER) continue;
|
|
23297
23302
|
const rel = prefix ? `${prefix}/${e.name}` : e.name;
|
|
23298
23303
|
if (e.isDirectory()) out.push(...filesUnder(join51(dir, e.name), rel));
|
|
@@ -23306,7 +23311,7 @@ function skillStamp() {
|
|
|
23306
23311
|
function bundledSkillNames() {
|
|
23307
23312
|
const src = skillsSourceDir();
|
|
23308
23313
|
if (!existsSync47(src)) return [];
|
|
23309
|
-
return
|
|
23314
|
+
return readdirSync35(src, { withFileTypes: true }).filter((e) => e.isDirectory() && existsSync47(join51(src, e.name, "SKILL.md"))).map((e) => e.name).sort();
|
|
23310
23315
|
}
|
|
23311
23316
|
function realPathOrSelf(p) {
|
|
23312
23317
|
try {
|
|
@@ -23398,7 +23403,7 @@ function uninstallSkills() {
|
|
|
23398
23403
|
perTarget.push({ id: t.id, label: t.label, removed });
|
|
23399
23404
|
continue;
|
|
23400
23405
|
}
|
|
23401
|
-
for (const entry of
|
|
23406
|
+
for (const entry of readdirSync35(t.dir, { withFileTypes: true })) {
|
|
23402
23407
|
if (!entry.isDirectory()) continue;
|
|
23403
23408
|
const dir = join51(t.dir, entry.name);
|
|
23404
23409
|
if (isManaged(dir) && (names.has(entry.name) || entry.name.startsWith("chat-recall"))) {
|