chat-recall 0.5.18 → 0.5.19
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/auto-update.d.ts +11 -0
- package/dist/auto-update.d.ts.map +1 -1
- package/dist/auto-update.js +50 -2
- package/dist/auto-update.js.map +1 -1
- package/dist/cli.js +125 -106
- package/dist/mcp.js +60 -40
- package/dist/watch.js +85 -66
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7030,8 +7030,8 @@ var init_claude = __esm({
|
|
|
7030
7030
|
|
|
7031
7031
|
// ../engine/dist/transcript/gemini.js
|
|
7032
7032
|
async function parseGeminiTranscript(sessionPath) {
|
|
7033
|
-
const { readFileSync:
|
|
7034
|
-
return parseGeminiTranscriptText(
|
|
7033
|
+
const { readFileSync: readFileSync50 } = await import("fs");
|
|
7034
|
+
return parseGeminiTranscriptText(readFileSync50(sessionPath, "utf-8"));
|
|
7035
7035
|
}
|
|
7036
7036
|
function parseGeminiTranscriptText(text) {
|
|
7037
7037
|
let content;
|
|
@@ -7487,11 +7487,11 @@ async function archiveRawSession(store, sessionId) {
|
|
|
7487
7487
|
return await store.putRawSession(sessionId, exp.tool, Math.floor(exp.mtime), gz, size);
|
|
7488
7488
|
}
|
|
7489
7489
|
function detectForkPredecessor(sessionPath) {
|
|
7490
|
-
const { readFileSync:
|
|
7491
|
-
const { dirname:
|
|
7490
|
+
const { readFileSync: readFileSync50, readdirSync: readdirSync35 } = requireFs();
|
|
7491
|
+
const { dirname: dirname28, join: join61, basename: basename29 } = requirePath();
|
|
7492
7492
|
let text;
|
|
7493
7493
|
try {
|
|
7494
|
-
text =
|
|
7494
|
+
text = readFileSync50(sessionPath, "utf-8");
|
|
7495
7495
|
} catch {
|
|
7496
7496
|
return null;
|
|
7497
7497
|
}
|
|
@@ -7513,7 +7513,7 @@ function detectForkPredecessor(sessionPath) {
|
|
|
7513
7513
|
return null;
|
|
7514
7514
|
if (text.includes(`"uuid":"${headParent}"`))
|
|
7515
7515
|
return null;
|
|
7516
|
-
const dir =
|
|
7516
|
+
const dir = dirname28(sessionPath);
|
|
7517
7517
|
const self = basename29(sessionPath);
|
|
7518
7518
|
let entries;
|
|
7519
7519
|
try {
|
|
@@ -7525,7 +7525,7 @@ function detectForkPredecessor(sessionPath) {
|
|
|
7525
7525
|
if (!f.endsWith(".jsonl") || f === self || f === "sessions-index.json")
|
|
7526
7526
|
continue;
|
|
7527
7527
|
try {
|
|
7528
|
-
if (
|
|
7528
|
+
if (readFileSync50(join61(dir, f), "utf-8").includes(`"uuid":"${headParent}"`)) {
|
|
7529
7529
|
return basename29(f, ".jsonl");
|
|
7530
7530
|
}
|
|
7531
7531
|
} catch {
|
|
@@ -19727,7 +19727,7 @@ var init_http = __esm({
|
|
|
19727
19727
|
CLI_VERSION = JSON.parse(readFileSync33(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
|
|
19728
19728
|
} catch {
|
|
19729
19729
|
try {
|
|
19730
|
-
if (true) CLI_VERSION = "0.5.
|
|
19730
|
+
if (true) CLI_VERSION = "0.5.19";
|
|
19731
19731
|
} catch {
|
|
19732
19732
|
}
|
|
19733
19733
|
}
|
|
@@ -20239,7 +20239,7 @@ var init_telemetry = __esm({
|
|
|
20239
20239
|
init_sync_client();
|
|
20240
20240
|
cliVersion2 = () => {
|
|
20241
20241
|
try {
|
|
20242
|
-
return true ? "0.5.
|
|
20242
|
+
return true ? "0.5.19" : "dev";
|
|
20243
20243
|
} catch {
|
|
20244
20244
|
return "dev";
|
|
20245
20245
|
}
|
|
@@ -20421,14 +20421,18 @@ var auto_update_exports = {};
|
|
|
20421
20421
|
__export(auto_update_exports, {
|
|
20422
20422
|
compareVersions: () => compareVersions,
|
|
20423
20423
|
executeAutoUpdate: () => executeAutoUpdate,
|
|
20424
|
+
installedVersion: () => installedVersion,
|
|
20424
20425
|
isAutoUpdateEnabled: () => isAutoUpdateEnabled,
|
|
20426
|
+
newerOf: () => newerOf,
|
|
20425
20427
|
planAutoUpdate: () => planAutoUpdate,
|
|
20426
20428
|
runAutoUpdate: () => runAutoUpdate,
|
|
20427
20429
|
tarballUrl: () => tarballUrl
|
|
20428
20430
|
});
|
|
20429
20431
|
import { execSync as execSync2 } from "node:child_process";
|
|
20432
|
+
import { readFileSync as readFileSync36 } from "node:fs";
|
|
20433
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
20430
20434
|
import { writeFileSync as writeFileSync8, mkdtempSync as mkdtempSync3 } from "node:fs";
|
|
20431
|
-
import { join as join43 } from "node:path";
|
|
20435
|
+
import { join as join43, dirname as dirname18 } from "node:path";
|
|
20432
20436
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
20433
20437
|
import { createHash as createHash12 } from "node:crypto";
|
|
20434
20438
|
function compareVersions(a, b) {
|
|
@@ -20445,6 +20449,20 @@ function isAutoUpdateEnabled(_edition, flag) {
|
|
|
20445
20449
|
if (flag === "1" || flag === "true" || flag === "on") return true;
|
|
20446
20450
|
return true;
|
|
20447
20451
|
}
|
|
20452
|
+
function newerOf(a, b) {
|
|
20453
|
+
if (!b) return a;
|
|
20454
|
+
if (!a) return b;
|
|
20455
|
+
return compareVersions(a, b) >= 0 ? a : b;
|
|
20456
|
+
}
|
|
20457
|
+
function installedVersion() {
|
|
20458
|
+
try {
|
|
20459
|
+
const here = dirname18(fileURLToPath2(import.meta.url));
|
|
20460
|
+
const raw = readFileSync36(join43(here, "..", "package.json"), "utf-8");
|
|
20461
|
+
return JSON.parse(raw).version || null;
|
|
20462
|
+
} catch {
|
|
20463
|
+
return null;
|
|
20464
|
+
}
|
|
20465
|
+
}
|
|
20448
20466
|
function planAutoUpdate(base2, caps, ownVersion3, flag) {
|
|
20449
20467
|
const rel = caps.cli;
|
|
20450
20468
|
if (!rel || !rel.version || !rel.sha256) return { update: false, reason: "server advertises no CLI release" };
|
|
@@ -20502,7 +20520,8 @@ async function runAutoUpdate(base2, authHeaders, ownVersion3, deps) {
|
|
|
20502
20520
|
} catch (e) {
|
|
20503
20521
|
return { updated: false, reason: `capabilities unreachable: ${e instanceof Error ? e.message : e}` };
|
|
20504
20522
|
}
|
|
20505
|
-
const
|
|
20523
|
+
const effectiveOwn = newerOf(ownVersion3, installedVersion());
|
|
20524
|
+
const plan = planAutoUpdate(base2, caps, effectiveOwn, process.env.CHAT_RECALL_AUTO_UPDATE);
|
|
20506
20525
|
if (!plan.update) return { updated: false, reason: plan.reason };
|
|
20507
20526
|
const result = await executeAutoUpdate(plan, {
|
|
20508
20527
|
download: deps?.download ?? realDownload,
|
|
@@ -20554,11 +20573,11 @@ __export(sync_client_exports, {
|
|
|
20554
20573
|
syncIncremental: () => syncIncremental,
|
|
20555
20574
|
syncSessions: () => syncSessions
|
|
20556
20575
|
});
|
|
20557
|
-
import { join as join44, dirname as
|
|
20558
|
-
import { readFileSync as
|
|
20576
|
+
import { join as join44, dirname as dirname19, basename as basename22 } from "node:path";
|
|
20577
|
+
import { readFileSync as readFileSync37, writeFileSync as writeFileSync9, mkdirSync as mkdirSync9, mkdtempSync as mkdtempSync4, rmSync as rmSync5, chmodSync as chmodSync3, unlinkSync as unlinkSync2, readdirSync as readdirSync32, statSync as statSync38 } from "node:fs";
|
|
20559
20578
|
import { tmpdir as tmpdir3, hostname as hostname2 } from "node:os";
|
|
20560
20579
|
import { createHash as createHash13 } from "node:crypto";
|
|
20561
|
-
import { fileURLToPath as
|
|
20580
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
20562
20581
|
import { gzipSync as gzipSync3 } from "zlib";
|
|
20563
20582
|
function classifyError(msg) {
|
|
20564
20583
|
const m = msg.toLowerCase();
|
|
@@ -20575,7 +20594,7 @@ function classifyError(msg) {
|
|
|
20575
20594
|
}
|
|
20576
20595
|
function saveCredentials(c) {
|
|
20577
20596
|
assertTransportSafe(c.serverUrl);
|
|
20578
|
-
mkdirSync9(
|
|
20597
|
+
mkdirSync9(dirname19(credPath()), { recursive: true });
|
|
20579
20598
|
const targets = loadAllCredentials().filter((t) => t.serverUrl !== c.serverUrl);
|
|
20580
20599
|
targets.unshift(c);
|
|
20581
20600
|
writeFileSync9(credPath(), JSON.stringify({ targets }, null, 2));
|
|
@@ -20595,7 +20614,7 @@ function loadAllCredentials() {
|
|
|
20595
20614
|
const fromEnv = envCredentials();
|
|
20596
20615
|
if (fromEnv) return [{ serverUrl: fromEnv.serverUrl, token: fromEnv.token }];
|
|
20597
20616
|
try {
|
|
20598
|
-
const parsed = JSON.parse(
|
|
20617
|
+
const parsed = JSON.parse(readFileSync37(credPath(), "utf-8"));
|
|
20599
20618
|
if (Array.isArray(parsed?.targets)) return parsed.targets.filter((t) => t?.serverUrl).map((t) => ({ serverUrl: t.serverUrl, token: t.token || "" }));
|
|
20600
20619
|
if (parsed?.serverUrl) return [{ serverUrl: parsed.serverUrl, token: parsed.token || "" }];
|
|
20601
20620
|
} catch {
|
|
@@ -20661,7 +20680,7 @@ function syncConfigCachePath() {
|
|
|
20661
20680
|
}
|
|
20662
20681
|
function readPersistedSyncConfigs() {
|
|
20663
20682
|
try {
|
|
20664
|
-
return JSON.parse(
|
|
20683
|
+
return JSON.parse(readFileSync37(syncConfigCachePath(), "utf-8"));
|
|
20665
20684
|
} catch {
|
|
20666
20685
|
return {};
|
|
20667
20686
|
}
|
|
@@ -20670,7 +20689,7 @@ function persistSyncConfig(base2, config2) {
|
|
|
20670
20689
|
try {
|
|
20671
20690
|
const all = readPersistedSyncConfigs();
|
|
20672
20691
|
all[base2] = { fetchedAt: Date.now(), config: config2 };
|
|
20673
|
-
mkdirSync9(
|
|
20692
|
+
mkdirSync9(dirname19(syncConfigCachePath()), { recursive: true });
|
|
20674
20693
|
writeFileSync9(syncConfigCachePath(), JSON.stringify(all, null, 2));
|
|
20675
20694
|
} catch {
|
|
20676
20695
|
}
|
|
@@ -22043,11 +22062,11 @@ var init_sync_client = __esm({
|
|
|
22043
22062
|
init_backends();
|
|
22044
22063
|
ownVersion = "0.0.0";
|
|
22045
22064
|
try {
|
|
22046
|
-
const dir =
|
|
22047
|
-
ownVersion = JSON.parse(
|
|
22065
|
+
const dir = dirname19(fileURLToPath3(import.meta.url));
|
|
22066
|
+
ownVersion = JSON.parse(readFileSync37(join44(dir, "../package.json"), "utf-8")).version || ownVersion;
|
|
22048
22067
|
} catch {
|
|
22049
22068
|
try {
|
|
22050
|
-
if (true) ownVersion = "0.5.
|
|
22069
|
+
if (true) ownVersion = "0.5.19";
|
|
22051
22070
|
} catch {
|
|
22052
22071
|
}
|
|
22053
22072
|
}
|
|
@@ -22079,11 +22098,11 @@ __export(update_notice_exports, {
|
|
|
22079
22098
|
refreshUpdateCheck: () => refreshUpdateCheck,
|
|
22080
22099
|
updateNotice: () => updateNotice
|
|
22081
22100
|
});
|
|
22082
|
-
import { readFileSync as
|
|
22101
|
+
import { readFileSync as readFileSync38, writeFileSync as writeFileSync10 } from "node:fs";
|
|
22083
22102
|
import { join as join45 } from "node:path";
|
|
22084
22103
|
function readCheck() {
|
|
22085
22104
|
try {
|
|
22086
|
-
const c = JSON.parse(
|
|
22105
|
+
const c = JSON.parse(readFileSync38(checkPath(), "utf-8"));
|
|
22087
22106
|
return c && typeof c.serverVersion === "string" ? c : null;
|
|
22088
22107
|
} catch {
|
|
22089
22108
|
return null;
|
|
@@ -22296,22 +22315,22 @@ __export(mcp_clients_exports, {
|
|
|
22296
22315
|
inspectMcpClients: () => inspectMcpClients,
|
|
22297
22316
|
registerMcpEverywhere: () => registerMcpEverywhere
|
|
22298
22317
|
});
|
|
22299
|
-
import { existsSync as existsSync44, mkdirSync as mkdirSync10, readFileSync as
|
|
22318
|
+
import { existsSync as existsSync44, mkdirSync as mkdirSync10, readFileSync as readFileSync39, writeFileSync as writeFileSync11 } from "fs";
|
|
22300
22319
|
import { homedir as homedir15 } from "os";
|
|
22301
|
-
import { dirname as
|
|
22320
|
+
import { dirname as dirname20, join as join47 } from "path";
|
|
22302
22321
|
function envHome(varName, fallback) {
|
|
22303
22322
|
const v = process.env[varName];
|
|
22304
22323
|
return v && v.trim() ? v.trim() : fallback;
|
|
22305
22324
|
}
|
|
22306
22325
|
function writeFileMkdir(path, body) {
|
|
22307
|
-
mkdirSync10(
|
|
22326
|
+
mkdirSync10(dirname20(path), { recursive: true });
|
|
22308
22327
|
writeFileSync11(path, body);
|
|
22309
22328
|
}
|
|
22310
22329
|
function registerMcpServersJson(target, path, spec) {
|
|
22311
22330
|
let cfg = {};
|
|
22312
22331
|
if (existsSync44(path)) {
|
|
22313
22332
|
try {
|
|
22314
|
-
cfg = JSON.parse(
|
|
22333
|
+
cfg = JSON.parse(readFileSync39(path, "utf-8"));
|
|
22315
22334
|
} catch (err) {
|
|
22316
22335
|
return { id: target.id, label: target.label, path, state: "unparseable", error: String(err) };
|
|
22317
22336
|
}
|
|
@@ -22340,7 +22359,7 @@ function registerOpencodeJson(path, spec) {
|
|
|
22340
22359
|
let cfg = {};
|
|
22341
22360
|
if (existsSync44(path)) {
|
|
22342
22361
|
try {
|
|
22343
|
-
cfg = JSON.parse(
|
|
22362
|
+
cfg = JSON.parse(readFileSync39(path, "utf-8"));
|
|
22344
22363
|
} catch (err) {
|
|
22345
22364
|
return { id, label, path, state: "unparseable", error: String(err) };
|
|
22346
22365
|
}
|
|
@@ -22377,7 +22396,7 @@ function registerCodexToml(path, spec) {
|
|
|
22377
22396
|
const id = "codex";
|
|
22378
22397
|
const label = "Codex";
|
|
22379
22398
|
const block = codexBlock(spec);
|
|
22380
|
-
const prev = existsSync44(path) ?
|
|
22399
|
+
const prev = existsSync44(path) ? readFileSync39(path, "utf-8") : "";
|
|
22381
22400
|
const lines = prev.length ? prev.split("\n") : [];
|
|
22382
22401
|
const start = lines.findIndex((l) => l.trim() === CODEX_HEADER);
|
|
22383
22402
|
if (start === -1) {
|
|
@@ -22420,7 +22439,7 @@ function inspectMcpClients(opts = {}) {
|
|
|
22420
22439
|
let registered = false;
|
|
22421
22440
|
if (existsSync44(path)) {
|
|
22422
22441
|
try {
|
|
22423
|
-
const raw =
|
|
22442
|
+
const raw = readFileSync39(path, "utf-8");
|
|
22424
22443
|
registered = c.id === "codex" ? raw.includes(CODEX_HEADER) : !!(JSON.parse(raw).mcpServers?.[MCP_SERVER_NAME] ?? JSON.parse(raw).mcp?.[MCP_SERVER_NAME]);
|
|
22425
22444
|
} catch {
|
|
22426
22445
|
registered = false;
|
|
@@ -22455,7 +22474,7 @@ var init_mcp_clients = __esm({
|
|
|
22455
22474
|
configPath: (home) => join47(envHome("CHAT_RECALL_CODEX_HOME", join47(home, ".codex")), "config.toml"),
|
|
22456
22475
|
isPresent(home) {
|
|
22457
22476
|
const p = this.configPath(home);
|
|
22458
|
-
return existsSync44(p) || existsSync44(
|
|
22477
|
+
return existsSync44(p) || existsSync44(dirname20(p));
|
|
22459
22478
|
},
|
|
22460
22479
|
register(spec, home) {
|
|
22461
22480
|
return registerCodexToml(this.configPath(home), spec);
|
|
@@ -22468,7 +22487,7 @@ var init_mcp_clients = __esm({
|
|
|
22468
22487
|
configPath: (home) => join47(envHome("CHAT_RECALL_GEMINI_HOME", join47(home, ".gemini")), "settings.json"),
|
|
22469
22488
|
isPresent(home) {
|
|
22470
22489
|
const p = this.configPath(home);
|
|
22471
|
-
return existsSync44(p) || existsSync44(
|
|
22490
|
+
return existsSync44(p) || existsSync44(dirname20(p));
|
|
22472
22491
|
},
|
|
22473
22492
|
register(spec, home) {
|
|
22474
22493
|
return registerMcpServersJson(this, this.configPath(home), spec);
|
|
@@ -22481,7 +22500,7 @@ var init_mcp_clients = __esm({
|
|
|
22481
22500
|
configPath: (home) => join47(envHome("XDG_CONFIG_HOME", join47(home, ".config")), "opencode", "opencode.json"),
|
|
22482
22501
|
isPresent(home) {
|
|
22483
22502
|
const p = this.configPath(home);
|
|
22484
|
-
return existsSync44(p) || existsSync44(
|
|
22503
|
+
return existsSync44(p) || existsSync44(dirname20(p));
|
|
22485
22504
|
},
|
|
22486
22505
|
register(spec, home) {
|
|
22487
22506
|
return registerOpencodeJson(this.configPath(home), spec);
|
|
@@ -22508,7 +22527,7 @@ var init_mcp_clients = __esm({
|
|
|
22508
22527
|
configPath: (home) => join47(home, ".cursor", "mcp.json"),
|
|
22509
22528
|
isPresent(home) {
|
|
22510
22529
|
const p = this.configPath(home);
|
|
22511
|
-
return existsSync44(p) || existsSync44(
|
|
22530
|
+
return existsSync44(p) || existsSync44(dirname20(p));
|
|
22512
22531
|
},
|
|
22513
22532
|
register(spec, home) {
|
|
22514
22533
|
return registerMcpServersJson(this, this.configPath(home), spec);
|
|
@@ -22532,7 +22551,7 @@ __export(companions_exports, {
|
|
|
22532
22551
|
uninstallCodeindex: () => uninstallCodeindex,
|
|
22533
22552
|
unregisterCodeindexMcp: () => unregisterCodeindexMcp
|
|
22534
22553
|
});
|
|
22535
|
-
import { existsSync as existsSync45, mkdirSync as mkdirSync11, statSync as statSync40, chmodSync as chmodSync4, unlinkSync as unlinkSync3, renameSync as renameSync5, createWriteStream, readFileSync as
|
|
22554
|
+
import { existsSync as existsSync45, mkdirSync as mkdirSync11, statSync as statSync40, chmodSync as chmodSync4, unlinkSync as unlinkSync3, renameSync as renameSync5, createWriteStream, readFileSync as readFileSync40, writeFileSync as writeFileSync12 } from "node:fs";
|
|
22536
22555
|
import { homedir as homedir16 } from "node:os";
|
|
22537
22556
|
import { join as join48 } from "node:path";
|
|
22538
22557
|
import { execSync as execSync3 } from "node:child_process";
|
|
@@ -22644,7 +22663,7 @@ async function installCodeindex(opts = {}) {
|
|
|
22644
22663
|
if (!expected) {
|
|
22645
22664
|
throw new Error(`No pinned checksum for ${status.artifactName} \u2014 refusing to install an unverified binary. Add its sha256 to CODEINDEX_SHA256 in companions.ts.`);
|
|
22646
22665
|
}
|
|
22647
|
-
const actual = createHash14("sha256").update(
|
|
22666
|
+
const actual = createHash14("sha256").update(readFileSync40(tmpPath)).digest("hex");
|
|
22648
22667
|
if (actual !== expected) {
|
|
22649
22668
|
throw new Error(`Checksum mismatch for ${status.artifactName}.
|
|
22650
22669
|
expected ${expected}
|
|
@@ -22674,7 +22693,7 @@ function registerCodeindexMcp(mcpJsonPath, binaryPath) {
|
|
|
22674
22693
|
let cfg = {};
|
|
22675
22694
|
if (existsSync45(mcpJsonPath)) {
|
|
22676
22695
|
try {
|
|
22677
|
-
cfg = JSON.parse(
|
|
22696
|
+
cfg = JSON.parse(readFileSync40(mcpJsonPath, "utf-8"));
|
|
22678
22697
|
} catch {
|
|
22679
22698
|
cfg = {};
|
|
22680
22699
|
}
|
|
@@ -22691,7 +22710,7 @@ function unregisterCodeindexMcp(mcpJsonPath) {
|
|
|
22691
22710
|
return { removed: false };
|
|
22692
22711
|
let cfg;
|
|
22693
22712
|
try {
|
|
22694
|
-
cfg = JSON.parse(
|
|
22713
|
+
cfg = JSON.parse(readFileSync40(mcpJsonPath, "utf-8"));
|
|
22695
22714
|
} catch {
|
|
22696
22715
|
return { removed: false };
|
|
22697
22716
|
}
|
|
@@ -22733,7 +22752,7 @@ __export(install_skills_exports, {
|
|
|
22733
22752
|
skillsSourceDir: () => skillsSourceDir,
|
|
22734
22753
|
uninstallSkills: () => uninstallSkills
|
|
22735
22754
|
});
|
|
22736
|
-
import { readdirSync as readdirSync33, existsSync as existsSync46, mkdirSync as mkdirSync12, rmSync as rmSync6, cpSync, writeFileSync as writeFileSync13, readFileSync as
|
|
22755
|
+
import { readdirSync as readdirSync33, existsSync as existsSync46, mkdirSync as mkdirSync12, rmSync as rmSync6, cpSync, writeFileSync as writeFileSync13, readFileSync as readFileSync41, statSync as statSync41, realpathSync as realpathSync4 } from "fs";
|
|
22737
22756
|
import { createHash as createHash15 } from "crypto";
|
|
22738
22757
|
import { join as join49, basename as basename23 } from "path";
|
|
22739
22758
|
function skillsSourceDir() {
|
|
@@ -22741,7 +22760,7 @@ function skillsSourceDir() {
|
|
|
22741
22760
|
}
|
|
22742
22761
|
function version() {
|
|
22743
22762
|
try {
|
|
22744
|
-
return JSON.parse(
|
|
22763
|
+
return JSON.parse(readFileSync41(new URL("../package.json", import.meta.url), "utf-8")).version || "0.0.0";
|
|
22745
22764
|
} catch {
|
|
22746
22765
|
return "0.0.0";
|
|
22747
22766
|
}
|
|
@@ -22752,7 +22771,7 @@ function skillsFingerprint() {
|
|
|
22752
22771
|
for (const name of bundledSkillNames()) {
|
|
22753
22772
|
for (const rel of filesUnder(join49(src, name)).sort()) {
|
|
22754
22773
|
h.update(name + "/" + rel);
|
|
22755
|
-
h.update(
|
|
22774
|
+
h.update(readFileSync41(join49(src, name, rel)));
|
|
22756
22775
|
}
|
|
22757
22776
|
}
|
|
22758
22777
|
return h.digest("hex").slice(0, 12);
|
|
@@ -22887,7 +22906,7 @@ function skillsNeedRefresh() {
|
|
|
22887
22906
|
const marker = join49(t.dir, name, MARKER);
|
|
22888
22907
|
if (!existsSync46(marker)) return true;
|
|
22889
22908
|
try {
|
|
22890
|
-
if (
|
|
22909
|
+
if (readFileSync41(marker, "utf-8").trim() !== cur) return true;
|
|
22891
22910
|
} catch {
|
|
22892
22911
|
return true;
|
|
22893
22912
|
}
|
|
@@ -22906,7 +22925,7 @@ function skillStatus() {
|
|
|
22906
22925
|
if (existsSync46(marker)) {
|
|
22907
22926
|
installed++;
|
|
22908
22927
|
try {
|
|
22909
|
-
ver =
|
|
22928
|
+
ver = readFileSync41(marker, "utf-8").trim();
|
|
22910
22929
|
} catch {
|
|
22911
22930
|
}
|
|
22912
22931
|
}
|
|
@@ -22931,7 +22950,7 @@ var init_install_skills = __esm({
|
|
|
22931
22950
|
});
|
|
22932
22951
|
|
|
22933
22952
|
// ../engine/dist/core/artifact-codec.js
|
|
22934
|
-
import { readFileSync as
|
|
22953
|
+
import { readFileSync as readFileSync42 } from "fs";
|
|
22935
22954
|
import { join as join50 } from "path";
|
|
22936
22955
|
import { homedir as homedir17 } from "os";
|
|
22937
22956
|
function parseCommandText(content, format, fallbackName) {
|
|
@@ -22955,13 +22974,13 @@ function parseAgentText(content, format, fallbackName) {
|
|
|
22955
22974
|
return { name: fm.name || fallbackName, description: fm.description || "", tools: fm.tools, body: body.trim() };
|
|
22956
22975
|
}
|
|
22957
22976
|
function readCommand(filePath, format) {
|
|
22958
|
-
return parseCommandText(
|
|
22977
|
+
return parseCommandText(readFileSync42(filePath, "utf-8"), format, base(filePath));
|
|
22959
22978
|
}
|
|
22960
22979
|
function readAgent(filePath, format) {
|
|
22961
|
-
return parseAgentText(
|
|
22980
|
+
return parseAgentText(readFileSync42(filePath, "utf-8"), format, base(filePath));
|
|
22962
22981
|
}
|
|
22963
22982
|
function readInstructions(filePath, name) {
|
|
22964
|
-
const content =
|
|
22983
|
+
const content = readFileSync42(filePath, "utf-8");
|
|
22965
22984
|
return { name, description: "", body: content };
|
|
22966
22985
|
}
|
|
22967
22986
|
function commandPath(tool, name) {
|
|
@@ -23095,8 +23114,8 @@ __export(toolkit_sync_exports, {
|
|
|
23095
23114
|
supportedTargetsFor: () => supportedTargetsFor,
|
|
23096
23115
|
writeMcpEntry: () => writeMcpEntry
|
|
23097
23116
|
});
|
|
23098
|
-
import { existsSync as existsSync47, mkdirSync as mkdirSync13, readFileSync as
|
|
23099
|
-
import { dirname as
|
|
23117
|
+
import { existsSync as existsSync47, mkdirSync as mkdirSync13, readFileSync as readFileSync43, writeFileSync as writeFileSync14, cpSync as cpSync2 } from "fs";
|
|
23118
|
+
import { dirname as dirname21, join as join51, basename as basename24 } from "path";
|
|
23100
23119
|
import { homedir as homedir18 } from "os";
|
|
23101
23120
|
function supportedTargetsFor(type) {
|
|
23102
23121
|
return SUPPORTED_TARGETS[type];
|
|
@@ -23151,7 +23170,7 @@ function skillsDirFor(tool) {
|
|
|
23151
23170
|
}
|
|
23152
23171
|
}
|
|
23153
23172
|
function copySkill(row, toTool) {
|
|
23154
|
-
const skillDir = row.extra.skillDir ||
|
|
23173
|
+
const skillDir = row.extra.skillDir || dirname21(row.filePath);
|
|
23155
23174
|
if (!existsSync47(skillDir))
|
|
23156
23175
|
return { ok: false, status: 404, error: `Source dir missing: ${skillDir}` };
|
|
23157
23176
|
const name = row.extra.skillName || basename24(skillDir);
|
|
@@ -23159,7 +23178,7 @@ function copySkill(row, toTool) {
|
|
|
23159
23178
|
if (existsSync47(targetDir))
|
|
23160
23179
|
return { ok: false, status: 409, error: `Already exists: ${targetDir}` };
|
|
23161
23180
|
try {
|
|
23162
|
-
mkdirSync13(
|
|
23181
|
+
mkdirSync13(dirname21(targetDir), { recursive: true });
|
|
23163
23182
|
cpSync2(skillDir, targetDir, { recursive: true });
|
|
23164
23183
|
return { ok: true, targetPath: targetDir };
|
|
23165
23184
|
} catch (e) {
|
|
@@ -23191,7 +23210,7 @@ function readMcpEntry(tool, name) {
|
|
|
23191
23210
|
if (!existsSync47(t.path))
|
|
23192
23211
|
continue;
|
|
23193
23212
|
try {
|
|
23194
|
-
const cfg = JSON.parse(
|
|
23213
|
+
const cfg = JSON.parse(readFileSync43(t.path, "utf-8"));
|
|
23195
23214
|
const block = cfg[t.key] || {};
|
|
23196
23215
|
if (block[name])
|
|
23197
23216
|
return block[name];
|
|
@@ -23205,7 +23224,7 @@ function readCodexMcpEntry(path, target) {
|
|
|
23205
23224
|
return null;
|
|
23206
23225
|
let content;
|
|
23207
23226
|
try {
|
|
23208
|
-
content =
|
|
23227
|
+
content = readFileSync43(path, "utf-8");
|
|
23209
23228
|
} catch {
|
|
23210
23229
|
return null;
|
|
23211
23230
|
}
|
|
@@ -23256,7 +23275,7 @@ function readCodexMcpEntry(path, target) {
|
|
|
23256
23275
|
function writeCodexMcpEntry(path, name, entry) {
|
|
23257
23276
|
let content = "";
|
|
23258
23277
|
if (existsSync47(path))
|
|
23259
|
-
content =
|
|
23278
|
+
content = readFileSync43(path, "utf-8");
|
|
23260
23279
|
const header = `[mcp_servers.${name}]`;
|
|
23261
23280
|
if (content.includes(header))
|
|
23262
23281
|
return false;
|
|
@@ -23285,7 +23304,7 @@ function writeCodexMcpEntry(path, name, entry) {
|
|
|
23285
23304
|
for (const [k, v] of Object.entries(entry.env))
|
|
23286
23305
|
lines.push(`${k} = ${escape(String(v))}`);
|
|
23287
23306
|
}
|
|
23288
|
-
mkdirSync13(
|
|
23307
|
+
mkdirSync13(dirname21(path), { recursive: true });
|
|
23289
23308
|
writeFileSync14(path, content + lines.join("\n") + "\n");
|
|
23290
23309
|
return true;
|
|
23291
23310
|
}
|
|
@@ -23318,12 +23337,12 @@ function writeMcpEntry(toTool, name, entry) {
|
|
|
23318
23337
|
let cfg = {};
|
|
23319
23338
|
if (existsSync47(path)) {
|
|
23320
23339
|
try {
|
|
23321
|
-
cfg = JSON.parse(
|
|
23340
|
+
cfg = JSON.parse(readFileSync43(path, "utf-8"));
|
|
23322
23341
|
} catch {
|
|
23323
23342
|
return { ok: false, status: 500, error: `Target config is malformed: ${path}` };
|
|
23324
23343
|
}
|
|
23325
23344
|
} else {
|
|
23326
|
-
mkdirSync13(
|
|
23345
|
+
mkdirSync13(dirname21(path), { recursive: true });
|
|
23327
23346
|
}
|
|
23328
23347
|
cfg[key2] = cfg[key2] || {};
|
|
23329
23348
|
if (cfg[key2][name])
|
|
@@ -23383,7 +23402,7 @@ function copyCommandOrAgent(type, row, toTool) {
|
|
|
23383
23402
|
if (existsSync47(out.path))
|
|
23384
23403
|
return { ok: false, status: 409, error: `Already exists: ${out.path}` };
|
|
23385
23404
|
try {
|
|
23386
|
-
mkdirSync13(
|
|
23405
|
+
mkdirSync13(dirname21(out.path), { recursive: true });
|
|
23387
23406
|
writeFileSync14(out.path, out.content);
|
|
23388
23407
|
return { ok: true, targetPath: out.path };
|
|
23389
23408
|
} catch (e) {
|
|
@@ -23403,7 +23422,7 @@ function copyInstructions(row, toTool) {
|
|
|
23403
23422
|
if (existsSync47(out.path))
|
|
23404
23423
|
return { ok: false, status: 409, error: `Already exists: ${out.path}` };
|
|
23405
23424
|
try {
|
|
23406
|
-
mkdirSync13(
|
|
23425
|
+
mkdirSync13(dirname21(out.path), { recursive: true });
|
|
23407
23426
|
writeFileSync14(out.path, out.content);
|
|
23408
23427
|
return { ok: true, targetPath: out.path };
|
|
23409
23428
|
} catch (e) {
|
|
@@ -23552,7 +23571,7 @@ __export(toolkit_pull_exports, {
|
|
|
23552
23571
|
portableCommand: () => portableCommand
|
|
23553
23572
|
});
|
|
23554
23573
|
import { existsSync as existsSync48, mkdirSync as mkdirSync14, statSync as statSync42, writeFileSync as writeFileSync15 } from "node:fs";
|
|
23555
|
-
import { delimiter as delimiter3, dirname as
|
|
23574
|
+
import { delimiter as delimiter3, dirname as dirname22, join as join52, basename as basename25, isAbsolute as isAbsolute3 } from "node:path";
|
|
23556
23575
|
function isExecutableFile(p) {
|
|
23557
23576
|
try {
|
|
23558
23577
|
return statSync42(p).isFile();
|
|
@@ -23764,7 +23783,7 @@ function executePull(rows, opts = {}) {
|
|
|
23764
23783
|
continue;
|
|
23765
23784
|
}
|
|
23766
23785
|
try {
|
|
23767
|
-
mkdirSync14(
|
|
23786
|
+
mkdirSync14(dirname22(out.path), { recursive: true });
|
|
23768
23787
|
writeFileSync15(out.path, out.content);
|
|
23769
23788
|
outcomes.push({ type, name, tool, status: "written", path: out.path, redactedContent: redacted });
|
|
23770
23789
|
} catch (e) {
|
|
@@ -24525,7 +24544,7 @@ __export(collector_exports, {
|
|
|
24525
24544
|
});
|
|
24526
24545
|
import { spawn } from "node:child_process";
|
|
24527
24546
|
import { execSync as execSync4 } from "node:child_process";
|
|
24528
|
-
import { readFileSync as
|
|
24547
|
+
import { readFileSync as readFileSync44 } from "node:fs";
|
|
24529
24548
|
import { join as join53, basename as basename27 } from "node:path";
|
|
24530
24549
|
async function resolveCodeindexBin(autoInstall = true) {
|
|
24531
24550
|
let st = checkCodeindexStatus();
|
|
@@ -24705,7 +24724,7 @@ async function collectCode(opts) {
|
|
|
24705
24724
|
}
|
|
24706
24725
|
const complexity = (r) => {
|
|
24707
24726
|
try {
|
|
24708
|
-
const txt =
|
|
24727
|
+
const txt = readFileSync44(join53(ws, r), "utf8");
|
|
24709
24728
|
if (txt.length > 2e6)
|
|
24710
24729
|
return 1;
|
|
24711
24730
|
const m = txt.match(CF_RE);
|
|
@@ -25489,8 +25508,8 @@ __export(project_tasks_exports, {
|
|
|
25489
25508
|
pushProjectTaskStatuses: () => pushProjectTaskStatuses,
|
|
25490
25509
|
renderTeamTasksMd: () => renderTeamTasksMd
|
|
25491
25510
|
});
|
|
25492
|
-
import { existsSync as existsSync50, readFileSync as
|
|
25493
|
-
import { join as join54, dirname as
|
|
25511
|
+
import { existsSync as existsSync50, readFileSync as readFileSync45, writeFileSync as writeFileSync16, mkdirSync as mkdirSync15, statSync as statSync43 } from "node:fs";
|
|
25512
|
+
import { join as join54, dirname as dirname23 } from "node:path";
|
|
25494
25513
|
import { homedir as homedir19 } from "node:os";
|
|
25495
25514
|
function isTeamTaskStatus(v) {
|
|
25496
25515
|
return !!v && TEAM_STATUSES.has(v);
|
|
@@ -25545,14 +25564,14 @@ function ledgerPath2() {
|
|
|
25545
25564
|
}
|
|
25546
25565
|
function readLedger() {
|
|
25547
25566
|
try {
|
|
25548
|
-
return JSON.parse(
|
|
25567
|
+
return JSON.parse(readFileSync45(ledgerPath2(), "utf8"));
|
|
25549
25568
|
} catch {
|
|
25550
25569
|
return {};
|
|
25551
25570
|
}
|
|
25552
25571
|
}
|
|
25553
25572
|
function writeLedger(l) {
|
|
25554
25573
|
try {
|
|
25555
|
-
mkdirSync15(
|
|
25574
|
+
mkdirSync15(dirname23(ledgerPath2()), { recursive: true });
|
|
25556
25575
|
} catch {
|
|
25557
25576
|
}
|
|
25558
25577
|
try {
|
|
@@ -25585,7 +25604,7 @@ async function pushProjectTaskStatuses(base2, authHeaders, opts = {}) {
|
|
|
25585
25604
|
if (ledger[file] === mtime) continue;
|
|
25586
25605
|
let changed;
|
|
25587
25606
|
try {
|
|
25588
|
-
changed = parseTaskFile(
|
|
25607
|
+
changed = parseTaskFile(readFileSync45(file, "utf8")).filter((t) => t.kind === fk.kind);
|
|
25589
25608
|
} catch {
|
|
25590
25609
|
continue;
|
|
25591
25610
|
}
|
|
@@ -25655,11 +25674,11 @@ var intent_drain_exports = {};
|
|
|
25655
25674
|
__export(intent_drain_exports, {
|
|
25656
25675
|
drainSyncIntents: () => drainSyncIntents
|
|
25657
25676
|
});
|
|
25658
|
-
import { existsSync as existsSync51, readFileSync as
|
|
25677
|
+
import { existsSync as existsSync51, readFileSync as readFileSync46, writeFileSync as writeFileSync17, appendFileSync, mkdirSync as mkdirSync16 } from "node:fs";
|
|
25659
25678
|
import { join as join55 } from "node:path";
|
|
25660
25679
|
import { homedir as homedir20 } from "node:os";
|
|
25661
|
-
import { fileURLToPath as
|
|
25662
|
-
import { dirname as
|
|
25680
|
+
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
25681
|
+
import { dirname as dirname24 } from "node:path";
|
|
25663
25682
|
function applyCodeRecommendation(intent) {
|
|
25664
25683
|
try {
|
|
25665
25684
|
const meta = JSON.parse(intent.name || "{}");
|
|
@@ -25685,7 +25704,7 @@ function applyCodeRecommendation(intent) {
|
|
|
25685
25704
|
if (!meta.rootPath) return { status: "error", result: JSON.stringify({ error: "missing rootPath" }) };
|
|
25686
25705
|
file = join55(meta.rootPath, "CLAUDE.md");
|
|
25687
25706
|
}
|
|
25688
|
-
const existing = existsSync51(file) ?
|
|
25707
|
+
const existing = existsSync51(file) ? readFileSync46(file, "utf8") : "";
|
|
25689
25708
|
if (existing.includes(text)) return { status: "done", result: JSON.stringify({ skipped: "rule already present", file }) };
|
|
25690
25709
|
const block = `${existing && !existing.endsWith("\n") ? "\n" : ""}
|
|
25691
25710
|
## Rule (added by chat-recall recommendation)
|
|
@@ -25839,11 +25858,11 @@ var init_intent_drain = __esm({
|
|
|
25839
25858
|
init_project_tasks();
|
|
25840
25859
|
ownVersion2 = "0.0.0";
|
|
25841
25860
|
try {
|
|
25842
|
-
const dir =
|
|
25843
|
-
ownVersion2 = JSON.parse(
|
|
25861
|
+
const dir = dirname24(fileURLToPath4(import.meta.url));
|
|
25862
|
+
ownVersion2 = JSON.parse(readFileSync46(join55(dir, "../package.json"), "utf-8")).version || ownVersion2;
|
|
25844
25863
|
} catch {
|
|
25845
25864
|
try {
|
|
25846
|
-
if (true) ownVersion2 = "0.5.
|
|
25865
|
+
if (true) ownVersion2 = "0.5.19";
|
|
25847
25866
|
} catch {
|
|
25848
25867
|
}
|
|
25849
25868
|
}
|
|
@@ -26044,8 +26063,8 @@ var team_merge_exports = {};
|
|
|
26044
26063
|
__export(team_merge_exports, {
|
|
26045
26064
|
mergePullResult: () => mergePullResult
|
|
26046
26065
|
});
|
|
26047
|
-
import { existsSync as existsSync52, mkdirSync as mkdirSync17, readFileSync as
|
|
26048
|
-
import { dirname as
|
|
26066
|
+
import { existsSync as existsSync52, mkdirSync as mkdirSync17, readFileSync as readFileSync47, rmSync as rmSync7, writeFileSync as writeFileSync18, statSync as statSync44 } from "fs";
|
|
26067
|
+
import { dirname as dirname25, join as join56 } from "path";
|
|
26049
26068
|
import { createHash as createHash18 } from "crypto";
|
|
26050
26069
|
function installPathFor(art, tool) {
|
|
26051
26070
|
switch (art.type) {
|
|
@@ -26138,7 +26157,7 @@ async function mergePullResult(opts) {
|
|
|
26138
26157
|
pending.push({ artifactId: a.id, tool, artifactType: a.type, artifactName: a.name, sha256: sha, installedAt: Date.now() });
|
|
26139
26158
|
continue;
|
|
26140
26159
|
}
|
|
26141
|
-
mkdirSync17(
|
|
26160
|
+
mkdirSync17(dirname25(path), { recursive: true });
|
|
26142
26161
|
writeFileSync18(path, body);
|
|
26143
26162
|
pending.push({ artifactId: a.id, tool, artifactType: a.type, artifactName: a.name, sha256: sha, installedAt: Date.now() });
|
|
26144
26163
|
report.written.push({ artifactId: a.id, path });
|
|
@@ -26183,7 +26202,7 @@ function readFileIfExists(path) {
|
|
|
26183
26202
|
const s = statSync44(path);
|
|
26184
26203
|
if (!s.isFile())
|
|
26185
26204
|
return null;
|
|
26186
|
-
return
|
|
26205
|
+
return readFileSync47(path);
|
|
26187
26206
|
} catch {
|
|
26188
26207
|
return null;
|
|
26189
26208
|
}
|
|
@@ -26465,8 +26484,8 @@ __export(vault_client_exports, {
|
|
|
26465
26484
|
vaultStatus: () => vaultStatus,
|
|
26466
26485
|
vaultSync: () => vaultSync
|
|
26467
26486
|
});
|
|
26468
|
-
import { mkdirSync as mkdirSync18, readFileSync as
|
|
26469
|
-
import { dirname as
|
|
26487
|
+
import { mkdirSync as mkdirSync18, readFileSync as readFileSync48, writeFileSync as writeFileSync19, existsSync as existsSync54 } from "fs";
|
|
26488
|
+
import { dirname as dirname26, join as join58 } from "path";
|
|
26470
26489
|
function context2() {
|
|
26471
26490
|
const s = loadSettings().team;
|
|
26472
26491
|
if (!s.enabled)
|
|
@@ -26605,7 +26624,7 @@ async function vaultSync(passphrase) {
|
|
|
26605
26624
|
continue;
|
|
26606
26625
|
}
|
|
26607
26626
|
try {
|
|
26608
|
-
const plaintext =
|
|
26627
|
+
const plaintext = readFileSync48(src.path);
|
|
26609
26628
|
const sourceSha = sha256Hex(plaintext);
|
|
26610
26629
|
const priorSha = uploaded.get(uploadKey(src.sessionId, src.tool));
|
|
26611
26630
|
if (priorSha === sourceSha) {
|
|
@@ -26694,7 +26713,7 @@ async function vaultRestore(passphrase, opts = {}) {
|
|
|
26694
26713
|
throw new Error("cipher integrity check failed");
|
|
26695
26714
|
}
|
|
26696
26715
|
const plaintext = decryptBlob(key2, cipher);
|
|
26697
|
-
mkdirSync18(
|
|
26716
|
+
mkdirSync18(dirname26(path), { recursive: true });
|
|
26698
26717
|
writeFileSync19(path, Buffer.from(plaintext));
|
|
26699
26718
|
const { utimesSync } = await import("fs");
|
|
26700
26719
|
const t = blob.mtimeSourceMs / 1e3;
|
|
@@ -26903,9 +26922,9 @@ import { execSync as execSync5 } from "child_process";
|
|
|
26903
26922
|
import { existsSync as existsSync55, mkdirSync as mkdirSync19, rmSync as rmSync8, writeFileSync as writeFileSync20 } from "fs";
|
|
26904
26923
|
import { homedir as homedir21 } from "os";
|
|
26905
26924
|
import { join as join59 } from "path";
|
|
26906
|
-
import { fileURLToPath as
|
|
26925
|
+
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
26907
26926
|
function resolveDaemonPaths() {
|
|
26908
|
-
const watchJs =
|
|
26927
|
+
const watchJs = fileURLToPath5(new URL("./watch.js", import.meta.url));
|
|
26909
26928
|
const node = process.execPath;
|
|
26910
26929
|
const dataDir = join59(homedir21(), ".chat-recall");
|
|
26911
26930
|
const logFile = join59(dataDir, "watch.log");
|
|
@@ -27289,9 +27308,9 @@ init_project_resolver();
|
|
|
27289
27308
|
import { config } from "dotenv";
|
|
27290
27309
|
import { Command } from "commander";
|
|
27291
27310
|
import chalk from "chalk";
|
|
27292
|
-
import { existsSync as existsSync56, readFileSync as
|
|
27311
|
+
import { existsSync as existsSync56, readFileSync as readFileSync49, writeFileSync as writeFileSync21, realpathSync as realpathSync5 } from "fs";
|
|
27293
27312
|
import { homedir as homedir22 } from "os";
|
|
27294
|
-
import { join as join60, resolve as resolve2, dirname as
|
|
27313
|
+
import { join as join60, resolve as resolve2, dirname as dirname27, basename as basename28 } from "path";
|
|
27295
27314
|
|
|
27296
27315
|
// ../engine/dist/core/score-tier.js
|
|
27297
27316
|
var STRONG_RATIO = 0.85;
|
|
@@ -27462,7 +27481,7 @@ async function serverDelete(path, body) {
|
|
|
27462
27481
|
return res.json();
|
|
27463
27482
|
}
|
|
27464
27483
|
var pkgVersion = JSON.parse(
|
|
27465
|
-
|
|
27484
|
+
readFileSync49(new URL("../package.json", import.meta.url), "utf-8")
|
|
27466
27485
|
).version;
|
|
27467
27486
|
var DEFAULT_SERVER = "https://chatrecall.dev";
|
|
27468
27487
|
var DEFAULT_ALLOW = [
|
|
@@ -28092,7 +28111,7 @@ memory.command("wake-up").description("Generate wake-up context (high-importance
|
|
|
28092
28111
|
const identityFile = getIdentityFilePath();
|
|
28093
28112
|
let identity = "AI coding assistant";
|
|
28094
28113
|
if (existsSync56(identityFile)) {
|
|
28095
|
-
identity =
|
|
28114
|
+
identity = readFileSync49(identityFile, "utf-8").trim();
|
|
28096
28115
|
}
|
|
28097
28116
|
const lines = [
|
|
28098
28117
|
chalk.bold("# Wake-Up Context"),
|
|
@@ -28149,7 +28168,7 @@ program.command("escalate [sessionId]").description("Escalate a finished session
|
|
|
28149
28168
|
}
|
|
28150
28169
|
});
|
|
28151
28170
|
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) => {
|
|
28152
|
-
const { existsSync: existsSync57, readFileSync:
|
|
28171
|
+
const { existsSync: existsSync57, readFileSync: readFileSync50, statSync: statSync46 } = await import("fs");
|
|
28153
28172
|
const { execSync: execSync6 } = await import("child_process");
|
|
28154
28173
|
const rows = [];
|
|
28155
28174
|
const note = (ok, label, detail) => rows.push({ ok, label, detail });
|
|
@@ -28226,7 +28245,7 @@ program.command("doctor").description("Quick health check across login, server,
|
|
|
28226
28245
|
}
|
|
28227
28246
|
}
|
|
28228
28247
|
for (const hooksJson of claudeHookConfigFiles()) {
|
|
28229
|
-
const profile = basename28(
|
|
28248
|
+
const profile = basename28(dirname27(hooksJson));
|
|
28230
28249
|
const label = `Claude hooks (${profile})`;
|
|
28231
28250
|
if (!existsSync57(hooksJson)) {
|
|
28232
28251
|
note(false, label, `no ${hooksJson} \u2014 run \`chat-recall install-hooks\``);
|
|
@@ -28236,13 +28255,13 @@ program.command("doctor").description("Quick health check across login, server,
|
|
|
28236
28255
|
const readHooks = (file) => {
|
|
28237
28256
|
if (!existsSync57(file)) return {};
|
|
28238
28257
|
try {
|
|
28239
|
-
return JSON.parse(
|
|
28258
|
+
return JSON.parse(readFileSync50(file, "utf-8")).hooks || {};
|
|
28240
28259
|
} catch {
|
|
28241
28260
|
return {};
|
|
28242
28261
|
}
|
|
28243
28262
|
};
|
|
28244
28263
|
const cfg = readHooks(hooksJson);
|
|
28245
|
-
const settings2 = readHooks(join60(
|
|
28264
|
+
const settings2 = readHooks(join60(dirname27(hooksJson), "settings.json"));
|
|
28246
28265
|
const all = ["SessionStart", "UserPromptSubmit", "Stop", "PreCompact", "SessionEnd"];
|
|
28247
28266
|
const hits = [];
|
|
28248
28267
|
for (const ev of all) {
|
|
@@ -28994,10 +29013,10 @@ tasks.command("pull [dir]").description("Write TEAM_TASKS.md for your tasks in t
|
|
|
28994
29013
|
try {
|
|
28995
29014
|
const { resolveProjectId: resolveProjectId2 } = await Promise.resolve().then(() => (init_project_resolver(), project_resolver_exports));
|
|
28996
29015
|
const { renderTeamTasksMd: renderTeamTasksMd2, parseTeamTasksFile: parseTeamTasksFile2 } = await Promise.resolve().then(() => (init_project_tasks(), project_tasks_exports));
|
|
28997
|
-
const { writeFileSync: writeFileSync22, readFileSync:
|
|
29016
|
+
const { writeFileSync: writeFileSync22, readFileSync: readFileSync50, existsSync: existsSync57 } = await import("node:fs");
|
|
28998
29017
|
const { join: join61 } = await import("node:path");
|
|
28999
29018
|
const file = join61(cwd, "TEAM_TASKS.md");
|
|
29000
|
-
if (!opts.force && existsSync57(file) && parseTeamTasksFile2(
|
|
29019
|
+
if (!opts.force && existsSync57(file) && parseTeamTasksFile2(readFileSync50(file, "utf8")).length > 0) {
|
|
29001
29020
|
console.error(chalk.red("TEAM_TASKS.md has unpushed edits."), "Run", chalk.bold("chat-recall tasks push"), "first, or", chalk.bold("tasks pull --force"), "to discard.");
|
|
29002
29021
|
process.exit(1);
|
|
29003
29022
|
}
|
|
@@ -29016,14 +29035,14 @@ tasks.command("push [dir]").description("Push TEAM_TASKS.md status edits back to
|
|
|
29016
29035
|
const cwd = dir || process.cwd();
|
|
29017
29036
|
try {
|
|
29018
29037
|
const { parseTeamTasksFile: parseTeamTasksFile2 } = await Promise.resolve().then(() => (init_project_tasks(), project_tasks_exports));
|
|
29019
|
-
const { readFileSync:
|
|
29038
|
+
const { readFileSync: readFileSync50, existsSync: existsSync57 } = await import("node:fs");
|
|
29020
29039
|
const { join: join61 } = await import("node:path");
|
|
29021
29040
|
const file = join61(cwd, "TEAM_TASKS.md");
|
|
29022
29041
|
if (!existsSync57(file)) {
|
|
29023
29042
|
console.error(chalk.red("no TEAM_TASKS.md here \u2014"), "run", chalk.bold("chat-recall tasks pull"), "first");
|
|
29024
29043
|
process.exit(1);
|
|
29025
29044
|
}
|
|
29026
|
-
const edits = parseTeamTasksFile2(
|
|
29045
|
+
const edits = parseTeamTasksFile2(readFileSync50(file, "utf8"));
|
|
29027
29046
|
let n = 0;
|
|
29028
29047
|
for (const e of edits) {
|
|
29029
29048
|
await serverPatch(`/api/tasks/${encodeURIComponent(e.id)}`, { status: e.intent });
|
|
@@ -29129,8 +29148,8 @@ team.command("publish <type> <name> <file>").description("Publish a local file a
|
|
|
29129
29148
|
console.error(chalk.red(`Invalid tool: ${opts.tool}. Must be one of: ${validTools.join(", ")}`));
|
|
29130
29149
|
process.exit(1);
|
|
29131
29150
|
}
|
|
29132
|
-
const { readFileSync:
|
|
29133
|
-
const body =
|
|
29151
|
+
const { readFileSync: readFileSync50 } = await import("fs");
|
|
29152
|
+
const body = readFileSync50(file);
|
|
29134
29153
|
const { teamPublish: teamPublish2 } = await Promise.resolve().then(() => (init_team_client(), team_client_exports));
|
|
29135
29154
|
const a = await teamPublish2({
|
|
29136
29155
|
type,
|
|
@@ -29317,9 +29336,9 @@ vault.command("forget").description("Remove the stored passphrase from this mach
|
|
|
29317
29336
|
console.log(keyringDelete2() ? chalk.green("\u2713 Passphrase removed from the OS keyring.") : chalk.dim("Nothing stored in the OS keyring."));
|
|
29318
29337
|
}));
|
|
29319
29338
|
program.command("install-hooks").description("Install Claude Code hooks (Stop + PreCompact + UserPromptSubmit + SessionEnd + SessionStart) into every Claude profile").option("--uninstall", "Remove hooks instead of installing them").option("--no-resume-hint", "Don't install the UserPromptSubmit resume-hint hook").option("--no-escalate", "Don't install the SessionEnd learnings-escalation hook").option("--no-wakeup", "Don't install the SessionStart wake-up hook").action(async (opts) => {
|
|
29320
|
-
const { mkdirSync: mkdirSync20, copyFileSync: copyFileSync4, chmodSync: chmodSync5, existsSync: existsSync57, readFileSync:
|
|
29321
|
-
const { fileURLToPath:
|
|
29322
|
-
const here =
|
|
29339
|
+
const { mkdirSync: mkdirSync20, copyFileSync: copyFileSync4, chmodSync: chmodSync5, existsSync: existsSync57, readFileSync: readFileSync50, writeFileSync: writeFileSync22, statSync: statSync46 } = await import("fs");
|
|
29340
|
+
const { fileURLToPath: fileURLToPath6 } = await import("url");
|
|
29341
|
+
const here = fileURLToPath6(new URL(".", import.meta.url));
|
|
29323
29342
|
const findHook = (name) => {
|
|
29324
29343
|
const candidates2 = [
|
|
29325
29344
|
join60(here, "..", "hooks", name),
|
|
@@ -29344,7 +29363,7 @@ program.command("install-hooks").description("Install Claude Code hooks (Stop +
|
|
|
29344
29363
|
const settings2 = join60(home, "settings.json");
|
|
29345
29364
|
if (!existsSync57(settings2)) return false;
|
|
29346
29365
|
try {
|
|
29347
|
-
const cfg = JSON.parse(
|
|
29366
|
+
const cfg = JSON.parse(readFileSync50(settings2, "utf-8"));
|
|
29348
29367
|
const arr = Array.isArray(cfg.hooks?.SessionStart) ? cfg.hooks.SessionStart : [];
|
|
29349
29368
|
return arr.some((h) => (h?.hooks?.[0]?.command || "").includes("chat_recall_wakeup_hook"));
|
|
29350
29369
|
} catch {
|
|
@@ -29355,7 +29374,7 @@ program.command("install-hooks").description("Install Claude Code hooks (Stop +
|
|
|
29355
29374
|
const readHookConfig = (file) => {
|
|
29356
29375
|
if (!existsSync57(file)) return { hooks: {} };
|
|
29357
29376
|
try {
|
|
29358
|
-
const c = JSON.parse(
|
|
29377
|
+
const c = JSON.parse(readFileSync50(file, "utf-8"));
|
|
29359
29378
|
if (!c.hooks || typeof c.hooks !== "object") c.hooks = {};
|
|
29360
29379
|
return c;
|
|
29361
29380
|
} catch (err) {
|
|
@@ -29435,7 +29454,7 @@ program.command("install-hooks").description("Install Claude Code hooks (Stop +
|
|
|
29435
29454
|
const wakeupSkipped = [];
|
|
29436
29455
|
for (const hooksJson of hookConfigFiles) {
|
|
29437
29456
|
const config2 = readHookConfig(hooksJson);
|
|
29438
|
-
const home =
|
|
29457
|
+
const home = dirname27(hooksJson);
|
|
29439
29458
|
const alreadyWired = wakeupWiredInSettings(home);
|
|
29440
29459
|
if (alreadyWired) wakeupSkipped.push(join60(home, "settings.json"));
|
|
29441
29460
|
const perProfile = installWakeup && !alreadyWired ? [...events, ["SessionStart", wakeupEntry]] : events;
|
|
@@ -29447,7 +29466,7 @@ program.command("install-hooks").description("Install Claude Code hooks (Stop +
|
|
|
29447
29466
|
if (without.length) config2.hooks[event] = without;
|
|
29448
29467
|
else delete config2.hooks[event];
|
|
29449
29468
|
}
|
|
29450
|
-
mkdirSync20(
|
|
29469
|
+
mkdirSync20(dirname27(hooksJson), { recursive: true });
|
|
29451
29470
|
writeFileSync22(hooksJson, JSON.stringify(config2, null, 2) + "\n");
|
|
29452
29471
|
}
|
|
29453
29472
|
const saveSz = statSync46(installedSaveHook).size;
|