chat-recall 0.5.23 → 0.5.25

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
@@ -2480,7 +2480,7 @@ var require_transport = __commonJS({
2480
2480
  "use strict";
2481
2481
  var { createRequire: createRequire3 } = __require("module");
2482
2482
  var getCallers = require_caller();
2483
- var { join: join53, isAbsolute: isAbsolute3, sep: sep3 } = __require("node:path");
2483
+ var { join: join53, isAbsolute: isAbsolute3, sep: sep4 } = __require("node:path");
2484
2484
  var sleep = require_atomic_sleep();
2485
2485
  var onExit = require_on_exit_leak_free();
2486
2486
  var ThreadStream = require_thread_stream();
@@ -2588,7 +2588,7 @@ var require_transport = __commonJS({
2588
2588
  let fixTarget2;
2589
2589
  for (const filePath of callers) {
2590
2590
  try {
2591
- const context = filePath === "node:repl" ? process.cwd() + sep3 : filePath;
2591
+ const context = filePath === "node:repl" ? process.cwd() + sep4 : filePath;
2592
2592
  fixTarget2 = createRequire3(context).resolve(origin);
2593
2593
  break;
2594
2594
  } catch (err) {
@@ -7044,8 +7044,8 @@ function decodeDirName(dirName) {
7044
7044
  }
7045
7045
  for (let len = 2; len <= segments.length - i; len++) {
7046
7046
  const joinedSegments = segments.slice(i, i + len);
7047
- for (const sep3 of ["-", "_", "."]) {
7048
- const candidate = join6(currentPath, joinedSegments.join(sep3));
7047
+ for (const sep4 of ["-", "_", "."]) {
7048
+ const candidate = join6(currentPath, joinedSegments.join(sep4));
7049
7049
  if (existsSync6(candidate)) {
7050
7050
  currentPath = candidate;
7051
7051
  i += len;
@@ -20633,7 +20633,7 @@ var init_http = __esm({
20633
20633
  CLI_VERSION = JSON.parse(readFileSync37(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
20634
20634
  } catch {
20635
20635
  try {
20636
- if (true) CLI_VERSION = "0.5.23";
20636
+ if (true) CLI_VERSION = "0.5.25";
20637
20637
  } catch {
20638
20638
  }
20639
20639
  }
@@ -21145,7 +21145,7 @@ var init_telemetry = __esm({
21145
21145
  init_sync_client();
21146
21146
  cliVersion2 = () => {
21147
21147
  try {
21148
- return true ? "0.5.23" : "dev";
21148
+ return true ? "0.5.25" : "dev";
21149
21149
  } catch {
21150
21150
  return "dev";
21151
21151
  }
@@ -21302,13 +21302,14 @@ __export(auto_update_exports, {
21302
21302
  newerOf: () => newerOf,
21303
21303
  planAutoUpdate: () => planAutoUpdate,
21304
21304
  runAutoUpdate: () => runAutoUpdate,
21305
+ runningPrefix: () => runningPrefix,
21305
21306
  tarballUrl: () => tarballUrl
21306
21307
  });
21307
21308
  import { execSync as execSync4 } from "node:child_process";
21308
21309
  import { readFileSync as readFileSync38 } from "node:fs";
21309
21310
  import { fileURLToPath as fileURLToPath2 } from "node:url";
21310
21311
  import { writeFileSync as writeFileSync9, mkdtempSync as mkdtempSync3 } from "node:fs";
21311
- import { join as join48, dirname as dirname18 } from "node:path";
21312
+ import { join as join48, dirname as dirname18, sep as sep3 } from "node:path";
21312
21313
  import { tmpdir as tmpdir2 } from "node:os";
21313
21314
  import { createHash as createHash13 } from "node:crypto";
21314
21315
  function compareVersions(a, b) {
@@ -21364,6 +21365,13 @@ async function executeAutoUpdate(plan, deps) {
21364
21365
  } catch (e) {
21365
21366
  return { updated: false, reason: `install failed: ${e instanceof Error ? e.message : e}` };
21366
21367
  }
21368
+ const landed = (deps.verify ?? installedVersion)();
21369
+ if (landed && plan.to && compareVersions(landed, plan.to) < 0) {
21370
+ return {
21371
+ updated: false,
21372
+ reason: `install reported success but ${landed} is still on disk (wanted ${plan.to}) \u2014 the package that runs is not the one npm wrote. Reinstall by hand: npm install -g ${plan.url}`
21373
+ };
21374
+ }
21367
21375
  try {
21368
21376
  deps.restart(deps.platform ?? process.platform);
21369
21377
  } catch {
@@ -21375,7 +21383,20 @@ async function realDownload(url) {
21375
21383
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
21376
21384
  return Buffer.from(await res.arrayBuffer());
21377
21385
  }
21386
+ function runningPrefix(moduleUrl = import.meta.url) {
21387
+ const here = fileURLToPath2(moduleUrl);
21388
+ const marker = `${sep3}node_modules${sep3}`;
21389
+ const at = here.lastIndexOf(marker);
21390
+ if (at === -1) return null;
21391
+ const beforeNodeModules = here.slice(0, at);
21392
+ return beforeNodeModules.endsWith(`${sep3}lib`) ? beforeNodeModules.slice(0, -4) : beforeNodeModules;
21393
+ }
21378
21394
  function realInstall(tgz) {
21395
+ const prefix = runningPrefix();
21396
+ if (prefix) {
21397
+ execSync4(`npm install -g --prefix "${prefix}" "${tgz}"`, { stdio: "ignore" });
21398
+ return;
21399
+ }
21379
21400
  try {
21380
21401
  execSync4(`npm install -g "${tgz}"`, { stdio: "ignore" });
21381
21402
  } catch {
@@ -22953,7 +22974,7 @@ var init_sync_client = __esm({
22953
22974
  ownVersion = JSON.parse(readFileSync39(join49(dir, "../package.json"), "utf-8")).version || ownVersion;
22954
22975
  } catch {
22955
22976
  try {
22956
- if (true) ownVersion = "0.5.23";
22977
+ if (true) ownVersion = "0.5.25";
22957
22978
  } catch {
22958
22979
  }
22959
22980
  }
package/dist/watch.js CHANGED
@@ -2587,7 +2587,7 @@ var require_transport = __commonJS({
2587
2587
  "use strict";
2588
2588
  var { createRequire: createRequire3 } = __require("module");
2589
2589
  var getCallers = require_caller();
2590
- var { join: join56, isAbsolute: isAbsolute4, sep: sep4 } = __require("node:path");
2590
+ var { join: join56, isAbsolute: isAbsolute4, sep: sep5 } = __require("node:path");
2591
2591
  var sleep = require_atomic_sleep();
2592
2592
  var onExit = require_on_exit_leak_free();
2593
2593
  var ThreadStream = require_thread_stream();
@@ -2695,7 +2695,7 @@ var require_transport = __commonJS({
2695
2695
  let fixTarget2;
2696
2696
  for (const filePath of callers) {
2697
2697
  try {
2698
- const context = filePath === "node:repl" ? process.cwd() + sep4 : filePath;
2698
+ const context = filePath === "node:repl" ? process.cwd() + sep5 : filePath;
2699
2699
  fixTarget2 = createRequire3(context).resolve(origin);
2700
2700
  break;
2701
2701
  } catch (err) {
@@ -6513,8 +6513,8 @@ function decodeDirName(dirName) {
6513
6513
  }
6514
6514
  for (let len = 2; len <= segments.length - i; len++) {
6515
6515
  const joinedSegments = segments.slice(i, i + len);
6516
- for (const sep4 of ["-", "_", "."]) {
6517
- const candidate = join5(currentPath, joinedSegments.join(sep4));
6516
+ for (const sep5 of ["-", "_", "."]) {
6517
+ const candidate = join5(currentPath, joinedSegments.join(sep5));
6518
6518
  if (existsSync5(candidate)) {
6519
6519
  currentPath = candidate;
6520
6520
  i += len;
@@ -7266,7 +7266,7 @@ async function archiveRawSession(store, sessionId) {
7266
7266
  }
7267
7267
  function detectForkPredecessor(sessionPath) {
7268
7268
  const { readFileSync: readFileSync47, readdirSync: readdirSync34 } = requireFs();
7269
- const { dirname: dirname26, join: join56, basename: basename27 } = requirePath();
7269
+ const { dirname: dirname26, join: join56, basename: basename28 } = requirePath();
7270
7270
  let text;
7271
7271
  try {
7272
7272
  text = readFileSync47(sessionPath, "utf-8");
@@ -7292,7 +7292,7 @@ function detectForkPredecessor(sessionPath) {
7292
7292
  if (text.includes(`"uuid":"${headParent}"`))
7293
7293
  return null;
7294
7294
  const dir = dirname26(sessionPath);
7295
- const self = basename27(sessionPath);
7295
+ const self = basename28(sessionPath);
7296
7296
  let entries;
7297
7297
  try {
7298
7298
  entries = readdirSync34(dir);
@@ -7304,7 +7304,7 @@ function detectForkPredecessor(sessionPath) {
7304
7304
  continue;
7305
7305
  try {
7306
7306
  if (readFileSync47(join56(dir, f), "utf-8").includes(`"uuid":"${headParent}"`)) {
7307
- return basename27(f, ".jsonl");
7307
+ return basename28(f, ".jsonl");
7308
7308
  }
7309
7309
  } catch {
7310
7310
  }
@@ -19213,7 +19213,7 @@ var init_http = __esm({
19213
19213
  CLI_VERSION = JSON.parse(readFileSync33(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
19214
19214
  } catch {
19215
19215
  try {
19216
- if (true) CLI_VERSION = "0.5.23";
19216
+ if (true) CLI_VERSION = "0.5.25";
19217
19217
  } catch {
19218
19218
  }
19219
19219
  }
@@ -19721,7 +19721,7 @@ var init_telemetry = __esm({
19721
19721
  init_sync_client();
19722
19722
  cliVersion = () => {
19723
19723
  try {
19724
- return true ? "0.5.23" : "dev";
19724
+ return true ? "0.5.25" : "dev";
19725
19725
  } catch {
19726
19726
  return "dev";
19727
19727
  }
@@ -19997,13 +19997,14 @@ __export(auto_update_exports, {
19997
19997
  newerOf: () => newerOf,
19998
19998
  planAutoUpdate: () => planAutoUpdate,
19999
19999
  runAutoUpdate: () => runAutoUpdate,
20000
+ runningPrefix: () => runningPrefix,
20000
20001
  tarballUrl: () => tarballUrl
20001
20002
  });
20002
20003
  import { execSync as execSync2 } from "node:child_process";
20003
20004
  import { readFileSync as readFileSync36 } from "node:fs";
20004
20005
  import { fileURLToPath as fileURLToPath2 } from "node:url";
20005
20006
  import { writeFileSync as writeFileSync8, mkdtempSync as mkdtempSync3 } from "node:fs";
20006
- import { join as join43, dirname as dirname18 } from "node:path";
20007
+ import { join as join43, dirname as dirname18, sep as sep2 } from "node:path";
20007
20008
  import { tmpdir as tmpdir2 } from "node:os";
20008
20009
  import { createHash as createHash11 } from "node:crypto";
20009
20010
  function compareVersions(a, b) {
@@ -20059,6 +20060,13 @@ async function executeAutoUpdate(plan, deps) {
20059
20060
  } catch (e) {
20060
20061
  return { updated: false, reason: `install failed: ${e instanceof Error ? e.message : e}` };
20061
20062
  }
20063
+ const landed = (deps.verify ?? installedVersion)();
20064
+ if (landed && plan.to && compareVersions(landed, plan.to) < 0) {
20065
+ return {
20066
+ updated: false,
20067
+ reason: `install reported success but ${landed} is still on disk (wanted ${plan.to}) \u2014 the package that runs is not the one npm wrote. Reinstall by hand: npm install -g ${plan.url}`
20068
+ };
20069
+ }
20062
20070
  try {
20063
20071
  deps.restart(deps.platform ?? process.platform);
20064
20072
  } catch {
@@ -20070,7 +20078,20 @@ async function realDownload(url) {
20070
20078
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
20071
20079
  return Buffer.from(await res.arrayBuffer());
20072
20080
  }
20081
+ function runningPrefix(moduleUrl = import.meta.url) {
20082
+ const here = fileURLToPath2(moduleUrl);
20083
+ const marker = `${sep2}node_modules${sep2}`;
20084
+ const at = here.lastIndexOf(marker);
20085
+ if (at === -1) return null;
20086
+ const beforeNodeModules = here.slice(0, at);
20087
+ return beforeNodeModules.endsWith(`${sep2}lib`) ? beforeNodeModules.slice(0, -4) : beforeNodeModules;
20088
+ }
20073
20089
  function realInstall(tgz) {
20090
+ const prefix = runningPrefix();
20091
+ if (prefix) {
20092
+ execSync2(`npm install -g --prefix "${prefix}" "${tgz}"`, { stdio: "ignore" });
20093
+ return;
20094
+ }
20074
20095
  try {
20075
20096
  execSync2(`npm install -g "${tgz}"`, { stdio: "ignore" });
20076
20097
  } catch {
@@ -21565,7 +21586,7 @@ var init_sync_client = __esm({
21565
21586
  ownVersion = JSON.parse(readFileSync37(join44(dir, "../package.json"), "utf-8")).version || ownVersion;
21566
21587
  } catch {
21567
21588
  try {
21568
- if (true) ownVersion = "0.5.23";
21589
+ if (true) ownVersion = "0.5.25";
21569
21590
  } catch {
21570
21591
  }
21571
21592
  }
@@ -21592,7 +21613,7 @@ var init_sync_client = __esm({
21592
21613
 
21593
21614
  // ../engine/dist/core/artifact-codec.js
21594
21615
  import { readFileSync as readFileSync38 } from "fs";
21595
- import { join as join45 } from "path";
21616
+ import { basename as basename23, join as join45 } from "path";
21596
21617
  import { homedir as homedir15 } from "os";
21597
21618
  function parseCommandText(content, format, fallbackName) {
21598
21619
  if (format === "toml") {
@@ -21720,8 +21741,7 @@ function emit(type, art, toTool, projectPath) {
21720
21741
  };
21721
21742
  }
21722
21743
  function base(filePath) {
21723
- const b = filePath.split("/").pop() || filePath;
21724
- return b.replace(/\.(md|toml)$/, "");
21744
+ return basename23(filePath).replace(/\.(md|toml)$/, "");
21725
21745
  }
21726
21746
  var init_artifact_codec = __esm({
21727
21747
  "../engine/dist/core/artifact-codec.js"() {
@@ -21738,7 +21758,7 @@ var init_artifact_codec = __esm({
21738
21758
 
21739
21759
  // ../engine/dist/core/toolkit-sync.js
21740
21760
  import { existsSync as existsSync43, mkdirSync as mkdirSync10, readFileSync as readFileSync39, writeFileSync as writeFileSync10, cpSync } from "fs";
21741
- import { dirname as dirname20, join as join46, basename as basename23 } from "path";
21761
+ import { dirname as dirname20, join as join46, basename as basename24 } from "path";
21742
21762
  import { homedir as homedir16 } from "os";
21743
21763
  function rowFromMemoryItem(type, item) {
21744
21764
  const extra = item.extra || {};
@@ -21775,7 +21795,7 @@ function copySkill(row, toTool) {
21775
21795
  const skillDir = row.extra.skillDir || dirname20(row.filePath);
21776
21796
  if (!existsSync43(skillDir))
21777
21797
  return { ok: false, status: 404, error: `Source dir missing: ${skillDir}` };
21778
- const name = row.extra.skillName || basename23(skillDir);
21798
+ const name = row.extra.skillName || basename24(skillDir);
21779
21799
  const targetDir = join46(skillsDirFor(toTool), name);
21780
21800
  if (existsSync43(targetDir))
21781
21801
  return { ok: false, status: 409, error: `Already exists: ${targetDir}` };
@@ -22166,7 +22186,7 @@ var init_toolkit_sync = __esm({
22166
22186
 
22167
22187
  // ../engine/dist/core/which.js
22168
22188
  import { existsSync as existsSync45, statSync as statSync40, accessSync, constants } from "node:fs";
22169
- import { join as join48, isAbsolute as isAbsolute2, delimiter as delimiter2, sep as sep2 } from "node:path";
22189
+ import { join as join48, isAbsolute as isAbsolute2, delimiter as delimiter2, sep as sep3 } from "node:path";
22170
22190
  function executable(p) {
22171
22191
  try {
22172
22192
  if (!statSync40(p).isFile())
@@ -22194,7 +22214,7 @@ function candidates(name) {
22194
22214
  function resolveOnPath(name) {
22195
22215
  if (!name)
22196
22216
  return null;
22197
- if (name.includes("/") || isWindows && name.includes(sep2) || isAbsolute2(name)) {
22217
+ if (name.includes("/") || isWindows && name.includes(sep3) || isAbsolute2(name)) {
22198
22218
  for (const c of candidates(name))
22199
22219
  if (executable(c))
22200
22220
  return c;
@@ -22232,7 +22252,7 @@ __export(toolkit_pull_exports, {
22232
22252
  portableCommand: () => portableCommand
22233
22253
  });
22234
22254
  import { existsSync as existsSync46, mkdirSync as mkdirSync12, statSync as statSync41, writeFileSync as writeFileSync12 } from "node:fs";
22235
- import { dirname as dirname22, join as join49, basename as basename24, isAbsolute as isAbsolute3 } from "node:path";
22255
+ import { dirname as dirname22, join as join49, basename as basename25, isAbsolute as isAbsolute3 } from "node:path";
22236
22256
  function isExecutableFile(p) {
22237
22257
  try {
22238
22258
  return statSync41(p).isFile();
@@ -22249,7 +22269,7 @@ function portableCommand(cmd) {
22249
22269
  }
22250
22270
  if (isExecutableFile(cmd))
22251
22271
  return { command: cmd, rewritten: false };
22252
- const base2 = basename24(cmd);
22272
+ const base2 = basename25(cmd);
22253
22273
  if (onPath(base2))
22254
22274
  return { command: base2, rewritten: true };
22255
22275
  return { missing: cmd };
@@ -23133,7 +23153,7 @@ __export(collector_exports, {
23133
23153
  import { spawn as spawn2 } from "node:child_process";
23134
23154
  import { execSync as execSync4 } from "node:child_process";
23135
23155
  import { readFileSync as readFileSync45 } from "node:fs";
23136
- import { join as join54, basename as basename25 } from "node:path";
23156
+ import { join as join54, basename as basename26 } from "node:path";
23137
23157
  async function resolveCodeindexBin(autoInstall = true) {
23138
23158
  let st = checkCodeindexStatus();
23139
23159
  if (!st.installed && autoInstall)
@@ -23511,7 +23531,7 @@ async function collectCode(opts) {
23511
23531
  file,
23512
23532
  line: null,
23513
23533
  rule: "god_module",
23514
- title: `God module ${basename25(file)}`,
23534
+ title: `God module ${basename26(file)}`,
23515
23535
  snippet: `fan-in ${m.fan_in}, fan-out ${m.fan_out}`,
23516
23536
  why: FINDING_WHY.coupling,
23517
23537
  agentPrompt: couplingPrompt(file, m.fan_in ?? 0, m.fan_out ?? 0, Math.round((m.instability ?? 0) * 100) / 100)
@@ -23679,7 +23699,7 @@ async function collectCode(opts) {
23679
23699
  file,
23680
23700
  line: v.line ?? null,
23681
23701
  rule: v.violation_type ?? "manifest_violation",
23682
- title: `${v.violation_type} in ${basename25(file)}`,
23702
+ title: `${v.violation_type} in ${basename26(file)}`,
23683
23703
  snippet: v.description ?? "",
23684
23704
  why: FINDING_WHY.manifest,
23685
23705
  agentPrompt: manifestPrompt(v.violation_type ?? "", file, v.line ?? null, v.description ?? "")
@@ -24069,7 +24089,7 @@ init_settings();
24069
24089
  init_sync_client();
24070
24090
  init_http();
24071
24091
  import chokidar from "chokidar";
24072
- import { dirname as dirname25, basename as basename26, join as join55, resolve as resolve2, sep as sep3 } from "path";
24092
+ import { dirname as dirname25, basename as basename27, join as join55, resolve as resolve2, sep as sep4 } from "path";
24073
24093
  import { homedir as homedir20 } from "os";
24074
24094
 
24075
24095
  // src/intent-drain.ts
@@ -24354,7 +24374,7 @@ try {
24354
24374
  ownVersion2 = JSON.parse(readFileSync41(join50(dir, "../package.json"), "utf-8")).version || ownVersion2;
24355
24375
  } catch {
24356
24376
  try {
24357
- if (true) ownVersion2 = "0.5.23";
24377
+ if (true) ownVersion2 = "0.5.25";
24358
24378
  } catch {
24359
24379
  }
24360
24380
  }
@@ -24698,7 +24718,7 @@ async function runCollectorMigration(opts) {
24698
24718
  init_sync_ledger();
24699
24719
  init_collector_health();
24700
24720
  import { existsSync as existsSync50, readFileSync as readFileSync46 } from "fs";
24701
- var CLI_VERSION3 = true ? "0.5.23" : "0.0.0";
24721
+ var CLI_VERSION3 = true ? "0.5.25" : "0.0.0";
24702
24722
  var DEBOUNCE_MS = 5e3;
24703
24723
  var CLAUDE_DIR = claudeBackend.projectsDir();
24704
24724
  var PLANS_DIR = claudeBackend.plansDir();
@@ -24799,7 +24819,7 @@ function watchWithFallback(name, pattern, t) {
24799
24819
  return w;
24800
24820
  }
24801
24821
  var sessionWatcher = watchWithFallback("sessions", `${CLAUDE_DIR}/**/*.jsonl`, {
24802
- ignored: (p) => /agent-/.test(p) || /^\./.test(basename26(p)),
24822
+ ignored: (p) => /agent-/.test(p) || /^\./.test(basename27(p)),
24803
24823
  interval: 5e3
24804
24824
  });
24805
24825
  var plansWatcher = chokidar.watch(`${PLANS_DIR}/*.md`, {
@@ -25091,7 +25111,7 @@ function discoverWorkspaces() {
25091
25111
  }
25092
25112
  }).filter(([p]) => isCodeWorkspace(p)).sort((a, b) => b[1] - a[1]);
25093
25113
  const roots = candidates2.map(([p]) => p);
25094
- const notAnAncestor = ([p]) => !roots.some((other) => other !== p && other.startsWith(p.endsWith(sep3) ? p : p + sep3));
25114
+ const notAnAncestor = ([p]) => !roots.some((other) => other !== p && other.startsWith(p.endsWith(sep4) ? p : p + sep4));
25095
25115
  return candidates2.filter(notAnAncestor).slice(0, CODE_INDEX_MAX).map(([p]) => p);
25096
25116
  }
25097
25117
  var WORKSPACE_MARKERS = [
@@ -25111,7 +25131,7 @@ var WORKSPACE_MARKERS = [
25111
25131
  function isCodeWorkspace(p) {
25112
25132
  try {
25113
25133
  const resolved = resolve2(p);
25114
- if (resolved === sep3 || resolved === homedir20() || dirname25(resolved) === resolved) return false;
25134
+ if (resolved === sep4 || resolved === homedir20() || dirname25(resolved) === resolved) return false;
25115
25135
  } catch {
25116
25136
  return false;
25117
25137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chat-recall",
3
- "version": "0.5.23",
3
+ "version": "0.5.25",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/munhq/chat-recall.git"