chat-recall 0.5.23 → 0.5.24

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/cli.js CHANGED
@@ -7134,13 +7134,13 @@ async function parseCodexSubagents(sessionPath) {
7134
7134
  if (meta?.type !== "session_meta")
7135
7135
  continue;
7136
7136
  const payload = meta.payload || {};
7137
- const spawn2 = payload.source?.subagent?.thread_spawn;
7138
- if (!spawn2)
7137
+ const spawn3 = payload.source?.subagent?.thread_spawn;
7138
+ if (!spawn3)
7139
7139
  continue;
7140
- if (spawn2.parent_thread_id !== parentId)
7140
+ if (spawn3.parent_thread_id !== parentId)
7141
7141
  continue;
7142
7142
  const id = fileName.replace(/\.jsonl$/i, "");
7143
- const role = String(spawn2.agent_role || payload.agent_role || "").toLowerCase();
7143
+ const role = String(spawn3.agent_role || payload.agent_role || "").toLowerCase();
7144
7144
  const kind = role.includes("compact") ? "compact" : role.includes("aside") ? "aside" : role.includes("worker") || role.includes("explore") ? "explore" : "other";
7145
7145
  let messages = [];
7146
7146
  try {
@@ -7152,8 +7152,8 @@ async function parseCodexSubagents(sessionPath) {
7152
7152
  subagents.push({
7153
7153
  id,
7154
7154
  kind,
7155
- agentType: spawn2.agent_role || payload.agent_role,
7156
- description: spawn2.agent_nickname || payload.agent_nickname,
7155
+ agentType: spawn3.agent_role || payload.agent_role,
7156
+ description: spawn3.agent_nickname || payload.agent_nickname,
7157
7157
  filePath,
7158
7158
  messageCount: messages.length,
7159
7159
  toolUseCount,
@@ -7488,7 +7488,7 @@ async function archiveRawSession(store, sessionId) {
7488
7488
  }
7489
7489
  function detectForkPredecessor(sessionPath) {
7490
7490
  const { readFileSync: readFileSync50, readdirSync: readdirSync35 } = requireFs();
7491
- const { dirname: dirname28, join: join61, basename: basename29 } = requirePath();
7491
+ const { dirname: dirname28, join: join61, basename: basename30 } = requirePath();
7492
7492
  let text;
7493
7493
  try {
7494
7494
  text = readFileSync50(sessionPath, "utf-8");
@@ -7514,7 +7514,7 @@ function detectForkPredecessor(sessionPath) {
7514
7514
  if (text.includes(`"uuid":"${headParent}"`))
7515
7515
  return null;
7516
7516
  const dir = dirname28(sessionPath);
7517
- const self = basename29(sessionPath);
7517
+ const self = basename30(sessionPath);
7518
7518
  let entries;
7519
7519
  try {
7520
7520
  entries = readdirSync35(dir);
@@ -7526,7 +7526,7 @@ function detectForkPredecessor(sessionPath) {
7526
7526
  continue;
7527
7527
  try {
7528
7528
  if (readFileSync50(join61(dir, f), "utf-8").includes(`"uuid":"${headParent}"`)) {
7529
- return basename29(f, ".jsonl");
7529
+ return basename30(f, ".jsonl");
7530
7530
  }
7531
7531
  } catch {
7532
7532
  }
@@ -9781,8 +9781,8 @@ var init_codex2 = __esm({
9781
9781
  } catch {
9782
9782
  continue;
9783
9783
  }
9784
- const spawn2 = meta?.payload?.source?.subagent?.thread_spawn;
9785
- if (!spawn2 || spawn2.parent_thread_id !== parentUuid)
9784
+ const spawn3 = meta?.payload?.source?.subagent?.thread_spawn;
9785
+ if (!spawn3 || spawn3.parent_thread_id !== parentUuid)
9786
9786
  continue;
9787
9787
  events.push(...this.parseRollout(path));
9788
9788
  }
@@ -9975,10 +9975,10 @@ var init_codex2 = __esm({
9975
9975
  const meta = JSON.parse(first);
9976
9976
  const payload = meta?.payload || {};
9977
9977
  projectPath = payload.cwd || "";
9978
- const spawn2 = payload.source?.subagent?.thread_spawn;
9979
- if (spawn2 || payload.agent_role || payload.agent_nickname) {
9978
+ const spawn3 = payload.source?.subagent?.thread_spawn;
9979
+ if (spawn3 || payload.agent_role || payload.agent_nickname) {
9980
9980
  isSubagent = true;
9981
- parentId = spawn2?.parent_thread_id || null;
9981
+ parentId = spawn3?.parent_thread_id || null;
9982
9982
  }
9983
9983
  }
9984
9984
  } catch {
@@ -19730,7 +19730,7 @@ var init_http = __esm({
19730
19730
  CLI_VERSION = JSON.parse(readFileSync33(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
19731
19731
  } catch {
19732
19732
  try {
19733
- if (true) CLI_VERSION = "0.5.23";
19733
+ if (true) CLI_VERSION = "0.5.24";
19734
19734
  } catch {
19735
19735
  }
19736
19736
  }
@@ -20242,7 +20242,7 @@ var init_telemetry = __esm({
20242
20242
  init_sync_client();
20243
20243
  cliVersion2 = () => {
20244
20244
  try {
20245
- return true ? "0.5.23" : "dev";
20245
+ return true ? "0.5.24" : "dev";
20246
20246
  } catch {
20247
20247
  return "dev";
20248
20248
  }
@@ -22217,7 +22217,7 @@ var init_sync_client = __esm({
22217
22217
  ownVersion = JSON.parse(readFileSync37(join44(dir, "../package.json"), "utf-8")).version || ownVersion;
22218
22218
  } catch {
22219
22219
  try {
22220
- if (true) ownVersion = "0.5.23";
22220
+ if (true) ownVersion = "0.5.24";
22221
22221
  } catch {
22222
22222
  }
22223
22223
  }
@@ -23034,7 +23034,7 @@ var init_install_skills = __esm({
23034
23034
 
23035
23035
  // ../engine/dist/core/artifact-codec.js
23036
23036
  import { readFileSync as readFileSync42 } from "fs";
23037
- import { join as join50 } from "path";
23037
+ import { basename as basename24, join as join50 } from "path";
23038
23038
  import { homedir as homedir17 } from "os";
23039
23039
  function parseCommandText(content, format, fallbackName) {
23040
23040
  if (format === "toml") {
@@ -23162,8 +23162,7 @@ function emit(type, art, toTool, projectPath) {
23162
23162
  };
23163
23163
  }
23164
23164
  function base(filePath) {
23165
- const b = filePath.split("/").pop() || filePath;
23166
- return b.replace(/\.(md|toml)$/, "");
23165
+ return basename24(filePath).replace(/\.(md|toml)$/, "");
23167
23166
  }
23168
23167
  var init_artifact_codec = __esm({
23169
23168
  "../engine/dist/core/artifact-codec.js"() {
@@ -23198,7 +23197,7 @@ __export(toolkit_sync_exports, {
23198
23197
  writeMcpEntry: () => writeMcpEntry
23199
23198
  });
23200
23199
  import { existsSync as existsSync47, mkdirSync as mkdirSync13, readFileSync as readFileSync43, writeFileSync as writeFileSync14, cpSync as cpSync2 } from "fs";
23201
- import { dirname as dirname21, join as join51, basename as basename24 } from "path";
23200
+ import { dirname as dirname21, join as join51, basename as basename25 } from "path";
23202
23201
  import { homedir as homedir18 } from "os";
23203
23202
  function supportedTargetsFor(type) {
23204
23203
  return SUPPORTED_TARGETS[type];
@@ -23256,7 +23255,7 @@ function copySkill(row, toTool) {
23256
23255
  const skillDir = row.extra.skillDir || dirname21(row.filePath);
23257
23256
  if (!existsSync47(skillDir))
23258
23257
  return { ok: false, status: 404, error: `Source dir missing: ${skillDir}` };
23259
- const name = row.extra.skillName || basename24(skillDir);
23258
+ const name = row.extra.skillName || basename25(skillDir);
23260
23259
  const targetDir = join51(skillsDirFor(toTool), name);
23261
23260
  if (existsSync47(targetDir))
23262
23261
  return { ok: false, status: 409, error: `Already exists: ${targetDir}` };
@@ -23654,7 +23653,7 @@ __export(toolkit_pull_exports, {
23654
23653
  portableCommand: () => portableCommand
23655
23654
  });
23656
23655
  import { existsSync as existsSync48, mkdirSync as mkdirSync14, statSync as statSync42, writeFileSync as writeFileSync15 } from "node:fs";
23657
- import { dirname as dirname22, join as join52, basename as basename25, isAbsolute as isAbsolute3 } from "node:path";
23656
+ import { dirname as dirname22, join as join52, basename as basename26, isAbsolute as isAbsolute3 } from "node:path";
23658
23657
  function isExecutableFile(p) {
23659
23658
  try {
23660
23659
  return statSync42(p).isFile();
@@ -23671,7 +23670,7 @@ function portableCommand(cmd) {
23671
23670
  }
23672
23671
  if (isExecutableFile(cmd))
23673
23672
  return { command: cmd, rewritten: false };
23674
- const base2 = basename25(cmd);
23673
+ const base2 = basename26(cmd);
23675
23674
  if (onPath(base2))
23676
23675
  return { command: base2, rewritten: true };
23677
23676
  return { missing: cmd };
@@ -24152,7 +24151,7 @@ __export(escalate_exports, {
24152
24151
  extractLearnings: () => extractLearnings,
24153
24152
  runEscalate: () => runEscalate
24154
24153
  });
24155
- import { basename as basename26 } from "node:path";
24154
+ import { basename as basename27 } from "node:path";
24156
24155
  function isNoiseUserMessage(content) {
24157
24156
  const c = content.trimStart();
24158
24157
  return c.length === 0 || c.length > 4e3 || c.startsWith("Caveat:") || c.startsWith("[Request interrupted") || c.includes("<command-name>") || c.includes("<local-command") || c.startsWith("<system-reminder>");
@@ -24219,10 +24218,10 @@ async function runEscalate(deps, opts) {
24219
24218
  return null;
24220
24219
  }
24221
24220
  sessionId = row.sessionId;
24222
- if (!projectName && row.projectPath) projectName = basename26(row.projectPath);
24221
+ if (!projectName && row.projectPath) projectName = basename27(row.projectPath);
24223
24222
  }
24224
24223
  if (!sessionId) throw new Error("pass a session id or --latest");
24225
- if (!projectName) projectName = basename26(opts.cwd);
24224
+ if (!projectName) projectName = basename27(opts.cwd);
24226
24225
  const convo = await deps.getSoft(`/api/conversations/${encodeURIComponent(sessionId)}?limit=0`);
24227
24226
  if (!convo.data || convo.data.messages.length === 0) {
24228
24227
  deps.log(`escalate: session ${sessionId} not synced yet${convo.message ? ` (${convo.message})` : ""} \u2014 nothing to do.`);
@@ -24552,10 +24551,10 @@ __export(collector_exports, {
24552
24551
  isSecretRule: () => isSecretRule,
24553
24552
  resolveCodeindexBin: () => resolveCodeindexBin
24554
24553
  });
24555
- import { spawn } from "node:child_process";
24554
+ import { spawn as spawn2 } from "node:child_process";
24556
24555
  import { execSync as execSync4 } from "node:child_process";
24557
24556
  import { readFileSync as readFileSync44 } from "node:fs";
24558
- import { join as join53, basename as basename27 } from "node:path";
24557
+ import { join as join53, basename as basename28 } from "node:path";
24559
24558
  async function resolveCodeindexBin(autoInstall = true) {
24560
24559
  let st = checkCodeindexStatus();
24561
24560
  if (!st.installed && autoInstall)
@@ -24567,7 +24566,7 @@ async function resolveCodeindexBin(autoInstall = true) {
24567
24566
  }
24568
24567
  function runMcp(binPath, workspace, calls, timeoutMs = 18e4) {
24569
24568
  return new Promise((resolve3, reject) => {
24570
- const p = spawn(binPath, ["--mcp", "--workspace", workspace], { stdio: ["pipe", "pipe", "ignore"] });
24569
+ const p = spawn2(binPath, ["--mcp", "--workspace", workspace], { stdio: ["pipe", "pipe", "ignore"] });
24571
24570
  const res = /* @__PURE__ */ new Map();
24572
24571
  let pending = "";
24573
24572
  let failed = false;
@@ -24933,7 +24932,7 @@ async function collectCode(opts) {
24933
24932
  file,
24934
24933
  line: null,
24935
24934
  rule: "god_module",
24936
- title: `God module ${basename27(file)}`,
24935
+ title: `God module ${basename28(file)}`,
24937
24936
  snippet: `fan-in ${m.fan_in}, fan-out ${m.fan_out}`,
24938
24937
  why: FINDING_WHY.coupling,
24939
24938
  agentPrompt: couplingPrompt(file, m.fan_in ?? 0, m.fan_out ?? 0, Math.round((m.instability ?? 0) * 100) / 100)
@@ -25101,7 +25100,7 @@ async function collectCode(opts) {
25101
25100
  file,
25102
25101
  line: v.line ?? null,
25103
25102
  rule: v.violation_type ?? "manifest_violation",
25104
- title: `${v.violation_type} in ${basename27(file)}`,
25103
+ title: `${v.violation_type} in ${basename28(file)}`,
25105
25104
  snippet: v.description ?? "",
25106
25105
  why: FINDING_WHY.manifest,
25107
25106
  agentPrompt: manifestPrompt(v.violation_type ?? "", file, v.line ?? null, v.description ?? "")
@@ -25872,7 +25871,7 @@ var init_intent_drain = __esm({
25872
25871
  ownVersion2 = JSON.parse(readFileSync46(join55(dir, "../package.json"), "utf-8")).version || ownVersion2;
25873
25872
  } catch {
25874
25873
  try {
25875
- if (true) ownVersion2 = "0.5.23";
25874
+ if (true) ownVersion2 = "0.5.24";
25876
25875
  } catch {
25877
25876
  }
25878
25877
  }
@@ -27382,7 +27381,7 @@ import { Command } from "commander";
27382
27381
  import chalk from "chalk";
27383
27382
  import { existsSync as existsSync56, readFileSync as readFileSync49, writeFileSync as writeFileSync21, realpathSync as realpathSync5 } from "fs";
27384
27383
  import { homedir as homedir22 } from "os";
27385
- import { join as join60, resolve as resolve2, dirname as dirname27, basename as basename28 } from "path";
27384
+ import { join as join60, resolve as resolve2, dirname as dirname27, basename as basename29 } from "path";
27386
27385
 
27387
27386
  // ../engine/dist/core/score-tier.js
27388
27387
  var STRONG_RATIO = 0.85;
@@ -27410,6 +27409,33 @@ function tierAll(results) {
27410
27409
  init_sync_client();
27411
27410
  init_update_notice();
27412
27411
  init_server_probe();
27412
+
27413
+ // src/open-browser.ts
27414
+ import { spawn } from "node:child_process";
27415
+ function isSafeUrl(url) {
27416
+ try {
27417
+ const u = new URL(url);
27418
+ return u.protocol === "https:" || u.protocol === "http:";
27419
+ } catch {
27420
+ return false;
27421
+ }
27422
+ }
27423
+ function openBrowser(url) {
27424
+ if (!isSafeUrl(url)) return false;
27425
+ if (process.env.CHAT_RECALL_NO_BROWSER === "1" || process.env.CI) return false;
27426
+ const [cmd, args] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["cmd", ["/c", "start", "", url]] : ["xdg-open", [url]];
27427
+ try {
27428
+ const child = spawn(cmd, args, { stdio: "ignore", detached: true });
27429
+ child.on("error", () => {
27430
+ });
27431
+ child.unref();
27432
+ return true;
27433
+ } catch {
27434
+ return false;
27435
+ }
27436
+ }
27437
+
27438
+ // src/cli.ts
27413
27439
  init_which();
27414
27440
  init_collector_health();
27415
27441
  init_telemetry_consent();
@@ -28355,7 +28381,7 @@ program.command("doctor").description("Quick health check across login, server,
28355
28381
  }
28356
28382
  }
28357
28383
  for (const hooksJson of claudeHookConfigFiles()) {
28358
- const profile = basename28(dirname27(hooksJson));
28384
+ const profile = basename29(dirname27(hooksJson));
28359
28385
  const label = `Claude hooks (${profile})`;
28360
28386
  if (!existsSync57(hooksJson)) {
28361
28387
  note(false, label, `no ${hooksJson} \u2014 run \`chat-recall install-hooks\``);
@@ -29806,6 +29832,8 @@ async function runLogin(serverUrl, opts) {
29806
29832
  console.log(chalk.bold("To log in, open:"));
29807
29833
  console.log(" " + chalk.cyan(p.url));
29808
29834
  console.log(chalk.dim(` (if prompted, enter code: ${chalk.bold(p.userCode)} at ${p.verificationUri})`));
29835
+ const opened = openBrowser(p.url);
29836
+ if (opened) console.log(chalk.dim(" (opening your browser\u2026 if nothing happens, use the link above)"));
29809
29837
  console.log(chalk.dim("After approving, come back to THIS terminal \u2014 it finishes the login by itself."));
29810
29838
  console.log(chalk.dim("Waiting for approval\u2026"));
29811
29839
  };