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/mcp.js CHANGED
@@ -7333,8 +7333,8 @@ var init_claude = __esm({
7333
7333
 
7334
7334
  // ../engine/dist/transcript/gemini.js
7335
7335
  async function parseGeminiTranscript(sessionPath) {
7336
- const { readFileSync: readFileSync43 } = await import("fs");
7337
- return parseGeminiTranscriptText(readFileSync43(sessionPath, "utf-8"));
7336
+ const { readFileSync: readFileSync44 } = await import("fs");
7337
+ return parseGeminiTranscriptText(readFileSync44(sessionPath, "utf-8"));
7338
7338
  }
7339
7339
  function parseGeminiTranscriptText(text) {
7340
7340
  let content;
@@ -7790,11 +7790,11 @@ async function archiveRawSession(store2, sessionId) {
7790
7790
  return await store2.putRawSession(sessionId, exp.tool, Math.floor(exp.mtime), gz, size);
7791
7791
  }
7792
7792
  function detectForkPredecessor(sessionPath) {
7793
- const { readFileSync: readFileSync43, readdirSync: readdirSync34 } = requireFs();
7794
- const { dirname: dirname19, join: join53, basename: basename25 } = requirePath();
7793
+ const { readFileSync: readFileSync44, readdirSync: readdirSync34 } = requireFs();
7794
+ const { dirname: dirname20, join: join53, basename: basename25 } = requirePath();
7795
7795
  let text;
7796
7796
  try {
7797
- text = readFileSync43(sessionPath, "utf-8");
7797
+ text = readFileSync44(sessionPath, "utf-8");
7798
7798
  } catch {
7799
7799
  return null;
7800
7800
  }
@@ -7816,7 +7816,7 @@ function detectForkPredecessor(sessionPath) {
7816
7816
  return null;
7817
7817
  if (text.includes(`"uuid":"${headParent}"`))
7818
7818
  return null;
7819
- const dir = dirname19(sessionPath);
7819
+ const dir = dirname20(sessionPath);
7820
7820
  const self = basename25(sessionPath);
7821
7821
  let entries;
7822
7822
  try {
@@ -7828,7 +7828,7 @@ function detectForkPredecessor(sessionPath) {
7828
7828
  if (!f.endsWith(".jsonl") || f === self || f === "sessions-index.json")
7829
7829
  continue;
7830
7830
  try {
7831
- if (readFileSync43(join53(dir, f), "utf-8").includes(`"uuid":"${headParent}"`)) {
7831
+ if (readFileSync44(join53(dir, f), "utf-8").includes(`"uuid":"${headParent}"`)) {
7832
7832
  return basename25(f, ".jsonl");
7833
7833
  }
7834
7834
  } catch {
@@ -20630,7 +20630,7 @@ var init_http = __esm({
20630
20630
  CLI_VERSION = JSON.parse(readFileSync37(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
20631
20631
  } catch {
20632
20632
  try {
20633
- if (true) CLI_VERSION = "0.5.18";
20633
+ if (true) CLI_VERSION = "0.5.19";
20634
20634
  } catch {
20635
20635
  }
20636
20636
  }
@@ -21142,7 +21142,7 @@ var init_telemetry = __esm({
21142
21142
  init_sync_client();
21143
21143
  cliVersion2 = () => {
21144
21144
  try {
21145
- return true ? "0.5.18" : "dev";
21145
+ return true ? "0.5.19" : "dev";
21146
21146
  } catch {
21147
21147
  return "dev";
21148
21148
  }
@@ -21157,14 +21157,18 @@ var auto_update_exports = {};
21157
21157
  __export(auto_update_exports, {
21158
21158
  compareVersions: () => compareVersions,
21159
21159
  executeAutoUpdate: () => executeAutoUpdate,
21160
+ installedVersion: () => installedVersion,
21160
21161
  isAutoUpdateEnabled: () => isAutoUpdateEnabled,
21162
+ newerOf: () => newerOf,
21161
21163
  planAutoUpdate: () => planAutoUpdate,
21162
21164
  runAutoUpdate: () => runAutoUpdate,
21163
21165
  tarballUrl: () => tarballUrl
21164
21166
  });
21165
21167
  import { execSync as execSync4 } from "node:child_process";
21168
+ import { readFileSync as readFileSync38 } from "node:fs";
21169
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
21166
21170
  import { writeFileSync as writeFileSync9, mkdtempSync as mkdtempSync3 } from "node:fs";
21167
- import { join as join48 } from "node:path";
21171
+ import { join as join48, dirname as dirname18 } from "node:path";
21168
21172
  import { tmpdir as tmpdir2 } from "node:os";
21169
21173
  import { createHash as createHash13 } from "node:crypto";
21170
21174
  function compareVersions(a, b) {
@@ -21181,6 +21185,20 @@ function isAutoUpdateEnabled(_edition, flag) {
21181
21185
  if (flag === "1" || flag === "true" || flag === "on") return true;
21182
21186
  return true;
21183
21187
  }
21188
+ function newerOf(a, b) {
21189
+ if (!b) return a;
21190
+ if (!a) return b;
21191
+ return compareVersions(a, b) >= 0 ? a : b;
21192
+ }
21193
+ function installedVersion() {
21194
+ try {
21195
+ const here = dirname18(fileURLToPath2(import.meta.url));
21196
+ const raw = readFileSync38(join48(here, "..", "package.json"), "utf-8");
21197
+ return JSON.parse(raw).version || null;
21198
+ } catch {
21199
+ return null;
21200
+ }
21201
+ }
21184
21202
  function planAutoUpdate(base, caps, ownVersion2, flag) {
21185
21203
  const rel = caps.cli;
21186
21204
  if (!rel || !rel.version || !rel.sha256) return { update: false, reason: "server advertises no CLI release" };
@@ -21238,7 +21256,8 @@ async function runAutoUpdate(base, authHeaders, ownVersion2, deps) {
21238
21256
  } catch (e) {
21239
21257
  return { updated: false, reason: `capabilities unreachable: ${e instanceof Error ? e.message : e}` };
21240
21258
  }
21241
- const plan = planAutoUpdate(base, caps, ownVersion2, process.env.CHAT_RECALL_AUTO_UPDATE);
21259
+ const effectiveOwn = newerOf(ownVersion2, installedVersion());
21260
+ const plan = planAutoUpdate(base, caps, effectiveOwn, process.env.CHAT_RECALL_AUTO_UPDATE);
21242
21261
  if (!plan.update) return { updated: false, reason: plan.reason };
21243
21262
  const result = await executeAutoUpdate(plan, {
21244
21263
  download: deps?.download ?? realDownload,
@@ -21290,11 +21309,11 @@ __export(sync_client_exports, {
21290
21309
  syncIncremental: () => syncIncremental,
21291
21310
  syncSessions: () => syncSessions
21292
21311
  });
21293
- import { join as join49, dirname as dirname18, basename as basename23 } from "node:path";
21294
- import { readFileSync as readFileSync38, writeFileSync as writeFileSync10, mkdirSync as mkdirSync11, mkdtempSync as mkdtempSync4, rmSync as rmSync5, chmodSync as chmodSync5, unlinkSync as unlinkSync3, readdirSync as readdirSync32, statSync as statSync41 } from "node:fs";
21312
+ import { join as join49, dirname as dirname19, basename as basename23 } from "node:path";
21313
+ import { readFileSync as readFileSync39, writeFileSync as writeFileSync10, mkdirSync as mkdirSync11, mkdtempSync as mkdtempSync4, rmSync as rmSync5, chmodSync as chmodSync5, unlinkSync as unlinkSync3, readdirSync as readdirSync32, statSync as statSync41 } from "node:fs";
21295
21314
  import { tmpdir as tmpdir3, hostname as hostname2 } from "node:os";
21296
21315
  import { createHash as createHash14 } from "node:crypto";
21297
- import { fileURLToPath as fileURLToPath2 } from "node:url";
21316
+ import { fileURLToPath as fileURLToPath3 } from "node:url";
21298
21317
  import { gzipSync as gzipSync3 } from "zlib";
21299
21318
  function classifyError(msg) {
21300
21319
  const m = msg.toLowerCase();
@@ -21311,7 +21330,7 @@ function classifyError(msg) {
21311
21330
  }
21312
21331
  function saveCredentials(c) {
21313
21332
  assertTransportSafe(c.serverUrl);
21314
- mkdirSync11(dirname18(credPath()), { recursive: true });
21333
+ mkdirSync11(dirname19(credPath()), { recursive: true });
21315
21334
  const targets = loadAllCredentials().filter((t) => t.serverUrl !== c.serverUrl);
21316
21335
  targets.unshift(c);
21317
21336
  writeFileSync10(credPath(), JSON.stringify({ targets }, null, 2));
@@ -21331,7 +21350,7 @@ function loadAllCredentials() {
21331
21350
  const fromEnv = envCredentials();
21332
21351
  if (fromEnv) return [{ serverUrl: fromEnv.serverUrl, token: fromEnv.token }];
21333
21352
  try {
21334
- const parsed = JSON.parse(readFileSync38(credPath(), "utf-8"));
21353
+ const parsed = JSON.parse(readFileSync39(credPath(), "utf-8"));
21335
21354
  if (Array.isArray(parsed?.targets)) return parsed.targets.filter((t) => t?.serverUrl).map((t) => ({ serverUrl: t.serverUrl, token: t.token || "" }));
21336
21355
  if (parsed?.serverUrl) return [{ serverUrl: parsed.serverUrl, token: parsed.token || "" }];
21337
21356
  } catch {
@@ -21397,7 +21416,7 @@ function syncConfigCachePath() {
21397
21416
  }
21398
21417
  function readPersistedSyncConfigs() {
21399
21418
  try {
21400
- return JSON.parse(readFileSync38(syncConfigCachePath(), "utf-8"));
21419
+ return JSON.parse(readFileSync39(syncConfigCachePath(), "utf-8"));
21401
21420
  } catch {
21402
21421
  return {};
21403
21422
  }
@@ -21406,7 +21425,7 @@ function persistSyncConfig(base, config2) {
21406
21425
  try {
21407
21426
  const all = readPersistedSyncConfigs();
21408
21427
  all[base] = { fetchedAt: Date.now(), config: config2 };
21409
- mkdirSync11(dirname18(syncConfigCachePath()), { recursive: true });
21428
+ mkdirSync11(dirname19(syncConfigCachePath()), { recursive: true });
21410
21429
  writeFileSync10(syncConfigCachePath(), JSON.stringify(all, null, 2));
21411
21430
  } catch {
21412
21431
  }
@@ -22779,11 +22798,11 @@ var init_sync_client = __esm({
22779
22798
  init_backends();
22780
22799
  ownVersion = "0.0.0";
22781
22800
  try {
22782
- const dir = dirname18(fileURLToPath2(import.meta.url));
22783
- ownVersion = JSON.parse(readFileSync38(join49(dir, "../package.json"), "utf-8")).version || ownVersion;
22801
+ const dir = dirname19(fileURLToPath3(import.meta.url));
22802
+ ownVersion = JSON.parse(readFileSync39(join49(dir, "../package.json"), "utf-8")).version || ownVersion;
22784
22803
  } catch {
22785
22804
  try {
22786
- if (true) ownVersion = "0.5.18";
22805
+ if (true) ownVersion = "0.5.19";
22787
22806
  } catch {
22788
22807
  }
22789
22808
  }
@@ -22814,7 +22833,7 @@ __export(client_events_exports, {
22814
22833
  isTelemetryEnabled: () => isTelemetryEnabled,
22815
22834
  reportClientEvent: () => reportClientEvent2
22816
22835
  });
22817
- import { readFileSync as readFileSync39 } from "node:fs";
22836
+ import { readFileSync as readFileSync40 } from "node:fs";
22818
22837
  function scrub(msg) {
22819
22838
  if (!msg) return "";
22820
22839
  const noHome = msg.replace(/\/(?:home|Users)\/[^/\s]+/g, "~");
@@ -22867,7 +22886,7 @@ var init_client_events = __esm({
22867
22886
  init_secret_redactor();
22868
22887
  CLI_VERSION2 = "0.0.0";
22869
22888
  try {
22870
- CLI_VERSION2 = JSON.parse(readFileSync39(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION2;
22889
+ CLI_VERSION2 = JSON.parse(readFileSync40(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION2;
22871
22890
  } catch {
22872
22891
  }
22873
22892
  }
@@ -22880,11 +22899,11 @@ __export(update_notice_exports, {
22880
22899
  refreshUpdateCheck: () => refreshUpdateCheck,
22881
22900
  updateNotice: () => updateNotice2
22882
22901
  });
22883
- import { readFileSync as readFileSync40, writeFileSync as writeFileSync11 } from "node:fs";
22902
+ import { readFileSync as readFileSync41, writeFileSync as writeFileSync11 } from "node:fs";
22884
22903
  import { join as join50 } from "node:path";
22885
22904
  function readCheck() {
22886
22905
  try {
22887
- const c = JSON.parse(readFileSync40(checkPath(), "utf-8"));
22906
+ const c = JSON.parse(readFileSync41(checkPath(), "utf-8"));
22888
22907
  return c && typeof c.serverVersion === "string" ? c : null;
22889
22908
  } catch {
22890
22909
  return null;
@@ -22971,7 +22990,7 @@ __export(install_skills_exports, {
22971
22990
  skillsSourceDir: () => skillsSourceDir,
22972
22991
  uninstallSkills: () => uninstallSkills
22973
22992
  });
22974
- import { readdirSync as readdirSync33, existsSync as existsSync47, mkdirSync as mkdirSync12, rmSync as rmSync6, cpSync, writeFileSync as writeFileSync12, readFileSync as readFileSync41, statSync as statSync42, realpathSync as realpathSync4 } from "fs";
22993
+ import { readdirSync as readdirSync33, existsSync as existsSync47, mkdirSync as mkdirSync12, rmSync as rmSync6, cpSync, writeFileSync as writeFileSync12, readFileSync as readFileSync42, statSync as statSync42, realpathSync as realpathSync4 } from "fs";
22975
22994
  import { createHash as createHash15 } from "crypto";
22976
22995
  import { join as join51, basename as basename24 } from "path";
22977
22996
  function skillsSourceDir() {
@@ -22979,7 +22998,7 @@ function skillsSourceDir() {
22979
22998
  }
22980
22999
  function version() {
22981
23000
  try {
22982
- return JSON.parse(readFileSync41(new URL("../package.json", import.meta.url), "utf-8")).version || "0.0.0";
23001
+ return JSON.parse(readFileSync42(new URL("../package.json", import.meta.url), "utf-8")).version || "0.0.0";
22983
23002
  } catch {
22984
23003
  return "0.0.0";
22985
23004
  }
@@ -22990,7 +23009,7 @@ function skillsFingerprint() {
22990
23009
  for (const name of bundledSkillNames()) {
22991
23010
  for (const rel of filesUnder(join51(src, name)).sort()) {
22992
23011
  h.update(name + "/" + rel);
22993
- h.update(readFileSync41(join51(src, name, rel)));
23012
+ h.update(readFileSync42(join51(src, name, rel)));
22994
23013
  }
22995
23014
  }
22996
23015
  return h.digest("hex").slice(0, 12);
@@ -23125,7 +23144,7 @@ function skillsNeedRefresh() {
23125
23144
  const marker = join51(t.dir, name, MARKER);
23126
23145
  if (!existsSync47(marker)) return true;
23127
23146
  try {
23128
- if (readFileSync41(marker, "utf-8").trim() !== cur) return true;
23147
+ if (readFileSync42(marker, "utf-8").trim() !== cur) return true;
23129
23148
  } catch {
23130
23149
  return true;
23131
23150
  }
@@ -23144,7 +23163,7 @@ function skillStatus() {
23144
23163
  if (existsSync47(marker)) {
23145
23164
  installed++;
23146
23165
  try {
23147
- ver = readFileSync41(marker, "utf-8").trim();
23166
+ ver = readFileSync42(marker, "utf-8").trim();
23148
23167
  } catch {
23149
23168
  }
23150
23169
  }
@@ -23184,9 +23203,9 @@ import { execSync as execSync5 } from "child_process";
23184
23203
  import { existsSync as existsSync48, mkdirSync as mkdirSync13, rmSync as rmSync7, writeFileSync as writeFileSync13 } from "fs";
23185
23204
  import { homedir as homedir17 } from "os";
23186
23205
  import { join as join52 } from "path";
23187
- import { fileURLToPath as fileURLToPath3 } from "url";
23206
+ import { fileURLToPath as fileURLToPath4 } from "url";
23188
23207
  function resolveDaemonPaths() {
23189
- const watchJs = fileURLToPath3(new URL("./watch.js", import.meta.url));
23208
+ const watchJs = fileURLToPath4(new URL("./watch.js", import.meta.url));
23190
23209
  const node = process.execPath;
23191
23210
  const dataDir = join52(homedir17(), ".chat-recall");
23192
23211
  const logFile = join52(dataDir, "watch.log");
@@ -23392,7 +23411,7 @@ var init_service_installer = __esm({
23392
23411
  // src/mcp.ts
23393
23412
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
23394
23413
  import { spawn as spawn3 } from "child_process";
23395
- import { fileURLToPath as fileURLToPath4 } from "node:url";
23414
+ import { fileURLToPath as fileURLToPath5 } from "node:url";
23396
23415
 
23397
23416
  // ../engine/dist/mcp/tools.js
23398
23417
  import { homedir as homedir6 } from "node:os";
@@ -25608,9 +25627,10 @@ Complements recall_memory_search: search finds candidates, this reads the specif
25608
25627
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
25609
25628
  const result = await dispatchTool(request);
25610
25629
  try {
25611
- const reported = readCollectorHealth();
25612
- const health = judgeHealth(reported);
25613
- const progress = progressLine(reported);
25630
+ const local = !isMultiTenant();
25631
+ const reported = local ? readCollectorHealth() : null;
25632
+ const health = local ? judgeHealth(reported) : { ok: true, summary: "" };
25633
+ const progress = local ? progressLine(reported) : null;
25614
25634
  const state2 = await syncState();
25615
25635
  const banners = [
25616
25636
  health.ok ? null : `\u26A0 ${health.summary} Recent work may be missing from these answers. Tell the user, and suggest \`chat-recall doctor\`.`,
@@ -27866,9 +27886,9 @@ function openBrowser(url) {
27866
27886
  // src/mcp.ts
27867
27887
  init_client_events();
27868
27888
  init_update_notice();
27869
- import { readFileSync as readFileSync42 } from "node:fs";
27889
+ import { readFileSync as readFileSync43 } from "node:fs";
27870
27890
  setServerVersion(JSON.parse(
27871
- readFileSync42(new URL("../package.json", import.meta.url), "utf-8")
27891
+ readFileSync43(new URL("../package.json", import.meta.url), "utf-8")
27872
27892
  ).version);
27873
27893
  setEventReporter(reportClientEvent2);
27874
27894
  setIndexRunner(runIndexChild2);
@@ -27887,7 +27907,7 @@ function startLoginChild(server) {
27887
27907
  return new Promise((resolve3, reject) => {
27888
27908
  let cliPath;
27889
27909
  try {
27890
- cliPath = fileURLToPath4(new URL("./cli.js", import.meta.url));
27910
+ cliPath = fileURLToPath5(new URL("./cli.js", import.meta.url));
27891
27911
  } catch {
27892
27912
  reject(new Error("could not locate the CLI entry point"));
27893
27913
  return;
@@ -27938,7 +27958,7 @@ function runIndexChild2(force) {
27938
27958
  return new Promise((resolve3) => {
27939
27959
  let cliPath;
27940
27960
  try {
27941
- cliPath = fileURLToPath4(new URL("./cli.js", import.meta.url));
27961
+ cliPath = fileURLToPath5(new URL("./cli.js", import.meta.url));
27942
27962
  } catch {
27943
27963
  resolve3("Index unavailable: could not locate the CLI entry point.");
27944
27964
  return;