chat-recall 0.7.1 → 0.7.2

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
@@ -4585,12 +4585,13 @@ function resolveProjectId(inputPath) {
4585
4585
  if (!isAbsolute(inputPath)) {
4586
4586
  return { id: `path:${inputPath}`, displayName: inputPath, source: "path" };
4587
4587
  }
4588
+ const known = inputCache.get(inputPath);
4589
+ if (known)
4590
+ return known;
4588
4591
  const realPath = safeRealpath(inputPath);
4589
- const cached = resolveCache.get(realPath);
4590
- if (cached)
4591
- return cached;
4592
- const result = doResolve(realPath);
4592
+ const result = resolveCache.get(realPath) ?? doResolve(realPath);
4593
4593
  resolveCache.set(realPath, result);
4594
+ inputCache.set(inputPath, result);
4594
4595
  return result;
4595
4596
  }
4596
4597
  function resolveWorkspaceId(inputPath) {
@@ -4891,7 +4892,7 @@ function globToRegex(glob) {
4891
4892
  function escapeRe(s) {
4892
4893
  return s.replace(/[.+^${}()|[\]\\]/g, "\\$&");
4893
4894
  }
4894
- var DEFAULT_AUTO_WORKSPACE_MIN_REPOS, BOT_WORKTREE_MARKERS, resolveCache, gitCache, workspaceCache, wsIdCache, cachedConfig, GIT_TIMEOUT_MS, AUTO_WORKSPACE_MAX_DEPTH;
4895
+ var DEFAULT_AUTO_WORKSPACE_MIN_REPOS, BOT_WORKTREE_MARKERS, resolveCache, inputCache, gitCache, workspaceCache, wsIdCache, cachedConfig, GIT_TIMEOUT_MS, AUTO_WORKSPACE_MAX_DEPTH;
4895
4896
  var init_project_resolver = __esm({
4896
4897
  "../engine/dist/core/project-resolver.js"() {
4897
4898
  "use strict";
@@ -4899,6 +4900,7 @@ var init_project_resolver = __esm({
4899
4900
  DEFAULT_AUTO_WORKSPACE_MIN_REPOS = 3;
4900
4901
  BOT_WORKTREE_MARKERS = [".claude-pr-bot"];
4901
4902
  resolveCache = /* @__PURE__ */ new Map();
4903
+ inputCache = /* @__PURE__ */ new Map();
4902
4904
  gitCache = /* @__PURE__ */ new Map();
4903
4905
  workspaceCache = /* @__PURE__ */ new Map();
4904
4906
  wsIdCache = /* @__PURE__ */ new Map();
@@ -8714,12 +8716,12 @@ var init_claude2 = __esm({
8714
8716
  const seen = /* @__PURE__ */ new Set();
8715
8717
  const out = [];
8716
8718
  for (const root of claudeProjectDirs()) {
8717
- this.collectSessionsFromRoot(root, cutoff, filter, seen, out);
8719
+ this.collectSessionsFromRoot(root, cutoff, filter, seen, out, opts.previews !== false);
8718
8720
  }
8719
8721
  out.sort((a, b) => b.mtime - a.mtime);
8720
8722
  return opts.limit ? out.slice(0, opts.limit) : out;
8721
8723
  }
8722
- collectSessionsFromRoot(root, cutoff, filter, seen, out) {
8724
+ collectSessionsFromRoot(root, cutoff, filter, seen, out, previews) {
8723
8725
  if (!existsSync11(root))
8724
8726
  return;
8725
8727
  for (const proj of readdirSync9(root, { withFileTypes: true })) {
@@ -8778,7 +8780,7 @@ var init_claude2 = __esm({
8778
8780
  }
8779
8781
  if (stat3.mtimeMs < cutoff)
8780
8782
  continue;
8781
- const firstPrompt = extractFirstUserPromptSync(fullPath, { maxLength: 200 });
8783
+ const firstPrompt = previews ? extractFirstUserPromptSync(fullPath, { maxLength: 200 }) : "";
8782
8784
  out.push({
8783
8785
  toolId: "claude",
8784
8786
  rawId: sessionId,
@@ -9376,23 +9378,8 @@ var init_opencode = __esm({
9376
9378
  const projectPath = row.project_path || row.directory || "";
9377
9379
  if (filter && !projectPath.toLowerCase().includes(filter))
9378
9380
  continue;
9379
- const firstUser = db.prepare(`
9380
- SELECT p.data
9381
- FROM part p JOIN message m ON m.id = p.message_id
9382
- WHERE p.session_id = ?
9383
- AND p.data LIKE '%"type":"text"%'
9384
- AND m.data LIKE '%"role":"user"%'
9385
- ORDER BY p.time_created ASC LIMIT 1
9386
- `).get(row.id);
9387
- let firstPrompt = "";
9388
- if (firstUser) {
9389
- try {
9390
- const parsed = JSON.parse(firstUser.data);
9391
- firstPrompt = flatString(String(parsed?.text || "").slice(0, 200));
9392
- } catch {
9393
- }
9394
- }
9395
- const messageCount = db.prepare("SELECT COUNT(*) as c FROM message WHERE session_id = ?").get(row.id)?.c ?? 0;
9381
+ const firstPrompt = opts.previews === false ? "" : this.firstUserPrompt(db, row.id);
9382
+ const messageCount = opts.previews === false ? 0 : db.prepare("SELECT COUNT(*) as c FROM message WHERE session_id = ?").get(row.id)?.c ?? 0;
9396
9383
  const created = new Date(row.time_created || row.time_updated).toISOString();
9397
9384
  const modified = new Date(row.time_updated).toISOString();
9398
9385
  out.push({
@@ -9416,6 +9403,45 @@ var init_opencode = __esm({
9416
9403
  db.close();
9417
9404
  }
9418
9405
  }
9406
+ /**
9407
+ * The first user text part of a session.
9408
+ *
9409
+ * Walks the session's user messages oldest first through the
9410
+ * (session_id, time_created, id) index and stops at the first one with a
9411
+ * text part. The role and the text are read by SQLite: a first message can
9412
+ * carry whole diffs in `summary` (107 MB on one row), and parsing that in JS
9413
+ * to read one field took the process to 510 MB. The earlier query filtered
9414
+ * every part and message with LIKE and then sorted, so it read all of a
9415
+ * session's data: 423 MB for a 236-session listing.
9416
+ */
9417
+ firstUserPrompt(db, sessionId) {
9418
+ try {
9419
+ const has = (table, col) => !!db.prepare(`SELECT 1 FROM pragma_table_info(?) WHERE name = ?`).get(table, col);
9420
+ const msgOrder = has("message", "time_created") ? "time_created, id" : "rowid";
9421
+ const partOrder = has("part", "time_created") ? "time_created, id" : "rowid";
9422
+ const nextUser = db.prepare(`SELECT id, ${msgOrder === "rowid" ? "rowid AS k1, 0 AS k2" : "time_created AS k1, id AS k2"} FROM message
9423
+ WHERE session_id = ? AND (${msgOrder === "rowid" ? "rowid, 0" : "time_created, id"}) > (?, ?)
9424
+ AND json_extract(data, '$.role') = 'user'
9425
+ ORDER BY ${msgOrder} LIMIT 1`);
9426
+ const firstText = db.prepare(`SELECT substr(json_extract(data, '$.text'), 1, 400) AS text FROM part
9427
+ WHERE message_id = ? AND json_extract(data, '$.type') = 'text'
9428
+ AND length(trim(json_extract(data, '$.text'))) > 0
9429
+ ORDER BY ${partOrder} LIMIT 1`);
9430
+ let k1 = Number.MIN_SAFE_INTEGER, k2 = msgOrder === "rowid" ? 0 : "";
9431
+ for (; ; ) {
9432
+ const m = nextUser.get(sessionId, k1, k2);
9433
+ if (!m)
9434
+ return "";
9435
+ k1 = m.k1;
9436
+ k2 = m.k2;
9437
+ const t = firstText.get(m.id);
9438
+ if (t?.text)
9439
+ return flatString(t.text.slice(0, 200));
9440
+ }
9441
+ } catch {
9442
+ return "";
9443
+ }
9444
+ }
9419
9445
  /** OpenCode auto-generates a session title (model-written, distinct from the
9420
9446
  * first prompt — e.g. "Replacing Claude with Gemini CLI"). It's a plain
9421
9447
  * column on the session row. */
@@ -9978,28 +10004,29 @@ var init_codex2 = __esm({
9978
10004
  continue;
9979
10005
  let firstPrompt = "";
9980
10006
  let messageCount = 0;
9981
- try {
9982
- const lines = readFileSync8(filePath, "utf-8").split("\n");
9983
- for (const line of lines) {
9984
- if (!line.trim())
9985
- continue;
9986
- let ev;
9987
- try {
9988
- ev = JSON.parse(line);
9989
- } catch {
9990
- continue;
9991
- }
9992
- if (ev.type === "event_msg" && ev.payload?.type === "user_message") {
9993
- messageCount++;
9994
- if (!firstPrompt && ev.payload.message) {
9995
- firstPrompt = flatString(String(ev.payload.message).slice(0, 200));
10007
+ if (opts.previews !== false)
10008
+ try {
10009
+ const lines = readFileSync8(filePath, "utf-8").split("\n");
10010
+ for (const line of lines) {
10011
+ if (!line.trim())
10012
+ continue;
10013
+ let ev;
10014
+ try {
10015
+ ev = JSON.parse(line);
10016
+ } catch {
10017
+ continue;
10018
+ }
10019
+ if (ev.type === "event_msg" && ev.payload?.type === "user_message") {
10020
+ messageCount++;
10021
+ if (!firstPrompt && ev.payload.message) {
10022
+ firstPrompt = flatString(String(ev.payload.message).slice(0, 200));
10023
+ }
10024
+ } else if (ev.type === "response_item" && ev.payload?.type === "message") {
10025
+ messageCount++;
9996
10026
  }
9997
- } else if (ev.type === "response_item" && ev.payload?.type === "message") {
9998
- messageCount++;
9999
10027
  }
10028
+ } catch {
10000
10029
  }
10001
- } catch {
10002
- }
10003
10030
  const prior = seen.get(rawId);
10004
10031
  if (prior) {
10005
10032
  if (stat3.mtimeMs > prior.mtime) {
@@ -10689,21 +10716,22 @@ var init_agy = __esm({
10689
10716
  const projectDir = projectPath ? basename12(projectPath) : "";
10690
10717
  let firstPrompt = "";
10691
10718
  let messageCount = 0;
10692
- try {
10693
- const lines = readFileSync9(filePath, "utf-8").split("\n").filter(Boolean);
10694
- messageCount = lines.length;
10695
- for (const line of lines) {
10696
- const obj = JSON.parse(line);
10697
- if (obj.source === "USER_EXPLICIT" && obj.type === "USER_INPUT" && typeof obj.content === "string") {
10698
- const content = obj.content;
10699
- const match = content.match(/<USER_REQUEST>([\s\S]*?)<\/USER_REQUEST>/);
10700
- const rawText = match ? match[1].trim() : content.trim();
10701
- firstPrompt = flatString(rawText.slice(0, 200));
10702
- break;
10719
+ if (opts.previews !== false)
10720
+ try {
10721
+ const lines = readFileSync9(filePath, "utf-8").split("\n").filter(Boolean);
10722
+ messageCount = lines.length;
10723
+ for (const line of lines) {
10724
+ const obj = JSON.parse(line);
10725
+ if (obj.source === "USER_EXPLICIT" && obj.type === "USER_INPUT" && typeof obj.content === "string") {
10726
+ const content = obj.content;
10727
+ const match = content.match(/<USER_REQUEST>([\s\S]*?)<\/USER_REQUEST>/);
10728
+ const rawText = match ? match[1].trim() : content.trim();
10729
+ firstPrompt = flatString(rawText.slice(0, 200));
10730
+ break;
10731
+ }
10703
10732
  }
10733
+ } catch {
10704
10734
  }
10705
- } catch {
10706
- }
10707
10735
  if (seenIds.has(rawId))
10708
10736
  continue;
10709
10737
  seenIds.add(rawId);
@@ -13394,7 +13422,10 @@ async function resolveCodeindexBin(autoInstall = true) {
13394
13422
  }
13395
13423
  function runMcp(binPath, workspace, calls, timeoutMs = 18e4) {
13396
13424
  return new Promise((resolve3, reject) => {
13397
- const p = spawn(binPath, ["--mcp", "--workspace", workspace], { stdio: ["pipe", "pipe", "ignore"] });
13425
+ const p = spawn(binPath, ["--mcp", "--workspace", workspace], {
13426
+ stdio: ["pipe", "pipe", "ignore"],
13427
+ env: { ...process.env, CODEINDEX_NO_DAEMON: "1" }
13428
+ });
13398
13429
  const res = /* @__PURE__ */ new Map();
13399
13430
  let pending2 = "";
13400
13431
  let failed = false;
@@ -19418,7 +19449,7 @@ var init_http = __esm({
19418
19449
  CLI_VERSION = JSON.parse(readFileSync36(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
19419
19450
  } catch {
19420
19451
  try {
19421
- if (true) CLI_VERSION = "0.7.1";
19452
+ if (true) CLI_VERSION = "0.7.2";
19422
19453
  } catch {
19423
19454
  }
19424
19455
  }
@@ -19917,7 +19948,7 @@ var init_telemetry = __esm({
19917
19948
  init_sync_client();
19918
19949
  cliVersion2 = () => {
19919
19950
  try {
19920
- return true ? "0.7.1" : "dev";
19951
+ return true ? "0.7.2" : "dev";
19921
19952
  } catch {
19922
19953
  return "dev";
19923
19954
  }
@@ -20756,7 +20787,7 @@ async function reconcileFields(opts = {}) {
20756
20787
  let cached = null;
20757
20788
  const fullRefs = () => cached ??= listAvailableBackends().flatMap((b) => {
20758
20789
  try {
20759
- return b.listSessions({});
20790
+ return b.listSessions({ previews: false });
20760
20791
  } catch {
20761
20792
  return [];
20762
20793
  }
@@ -20919,7 +20950,7 @@ async function syncToTargetInScope(cred, opts = {}) {
20919
20950
  const listSinceMs = changedWalk ? Math.max(0, (opts.sinceMs ?? 0) - CHANGED_WALK_OVERLAP_MS) : opts.useLedger ? void 0 : opts.sinceMs;
20920
20951
  const refs = listAvailableBackends().flatMap((b) => {
20921
20952
  try {
20922
- return b.listSessions({ sinceMs: listSinceMs });
20953
+ return b.listSessions({ sinceMs: listSinceMs, previews: false });
20923
20954
  } catch {
20924
20955
  return [];
20925
20956
  }
@@ -21234,7 +21265,7 @@ async function syncToTargetInScope(cred, opts = {}) {
21234
21265
  cred,
21235
21266
  () => listAvailableBackends().flatMap((b) => {
21236
21267
  try {
21237
- return b.listSessions({});
21268
+ return b.listSessions({ previews: false });
21238
21269
  } catch {
21239
21270
  return [];
21240
21271
  }
@@ -22001,7 +22032,7 @@ var init_sync_client = __esm({
22001
22032
  ownVersion = JSON.parse(readFileSync38(join49(dir, "../package.json"), "utf-8")).version || ownVersion;
22002
22033
  } catch {
22003
22034
  try {
22004
- if (true) ownVersion = "0.7.1";
22035
+ if (true) ownVersion = "0.7.2";
22005
22036
  } catch {
22006
22037
  }
22007
22038
  }
@@ -28686,7 +28717,7 @@ function installCrashGuards() {
28686
28717
  reportClientEvent2("mcp_crash", { message: err.stack || err.message });
28687
28718
  });
28688
28719
  }
28689
- var RELAY_VERSION = true ? "0.7.1" : "0.0.0";
28720
+ var RELAY_VERSION = true ? "0.7.2" : "0.0.0";
28690
28721
  function daemonIdleSecs() {
28691
28722
  const raw = process.env.CHAT_RECALL_DAEMON_IDLE_SECS;
28692
28723
  if (raw === void 0) return 900;
@@ -6309,23 +6309,8 @@ var init_opencode = __esm({
6309
6309
  const projectPath = row.project_path || row.directory || "";
6310
6310
  if (filter && !projectPath.toLowerCase().includes(filter))
6311
6311
  continue;
6312
- const firstUser = db.prepare(`
6313
- SELECT p.data
6314
- FROM part p JOIN message m ON m.id = p.message_id
6315
- WHERE p.session_id = ?
6316
- AND p.data LIKE '%"type":"text"%'
6317
- AND m.data LIKE '%"role":"user"%'
6318
- ORDER BY p.time_created ASC LIMIT 1
6319
- `).get(row.id);
6320
- let firstPrompt = "";
6321
- if (firstUser) {
6322
- try {
6323
- const parsed = JSON.parse(firstUser.data);
6324
- firstPrompt = flatString(String(parsed?.text || "").slice(0, 200));
6325
- } catch {
6326
- }
6327
- }
6328
- const messageCount = db.prepare("SELECT COUNT(*) as c FROM message WHERE session_id = ?").get(row.id)?.c ?? 0;
6312
+ const firstPrompt = opts.previews === false ? "" : this.firstUserPrompt(db, row.id);
6313
+ const messageCount = opts.previews === false ? 0 : db.prepare("SELECT COUNT(*) as c FROM message WHERE session_id = ?").get(row.id)?.c ?? 0;
6329
6314
  const created = new Date(row.time_created || row.time_updated).toISOString();
6330
6315
  const modified = new Date(row.time_updated).toISOString();
6331
6316
  out.push({
@@ -6349,6 +6334,45 @@ var init_opencode = __esm({
6349
6334
  db.close();
6350
6335
  }
6351
6336
  }
6337
+ /**
6338
+ * The first user text part of a session.
6339
+ *
6340
+ * Walks the session's user messages oldest first through the
6341
+ * (session_id, time_created, id) index and stops at the first one with a
6342
+ * text part. The role and the text are read by SQLite: a first message can
6343
+ * carry whole diffs in `summary` (107 MB on one row), and parsing that in JS
6344
+ * to read one field took the process to 510 MB. The earlier query filtered
6345
+ * every part and message with LIKE and then sorted, so it read all of a
6346
+ * session's data: 423 MB for a 236-session listing.
6347
+ */
6348
+ firstUserPrompt(db, sessionId) {
6349
+ try {
6350
+ const has = (table, col) => !!db.prepare(`SELECT 1 FROM pragma_table_info(?) WHERE name = ?`).get(table, col);
6351
+ const msgOrder = has("message", "time_created") ? "time_created, id" : "rowid";
6352
+ const partOrder = has("part", "time_created") ? "time_created, id" : "rowid";
6353
+ const nextUser = db.prepare(`SELECT id, ${msgOrder === "rowid" ? "rowid AS k1, 0 AS k2" : "time_created AS k1, id AS k2"} FROM message
6354
+ WHERE session_id = ? AND (${msgOrder === "rowid" ? "rowid, 0" : "time_created, id"}) > (?, ?)
6355
+ AND json_extract(data, '$.role') = 'user'
6356
+ ORDER BY ${msgOrder} LIMIT 1`);
6357
+ const firstText = db.prepare(`SELECT substr(json_extract(data, '$.text'), 1, 400) AS text FROM part
6358
+ WHERE message_id = ? AND json_extract(data, '$.type') = 'text'
6359
+ AND length(trim(json_extract(data, '$.text'))) > 0
6360
+ ORDER BY ${partOrder} LIMIT 1`);
6361
+ let k1 = Number.MIN_SAFE_INTEGER, k2 = msgOrder === "rowid" ? 0 : "";
6362
+ for (; ; ) {
6363
+ const m = nextUser.get(sessionId, k1, k2);
6364
+ if (!m)
6365
+ return "";
6366
+ k1 = m.k1;
6367
+ k2 = m.k2;
6368
+ const t = firstText.get(m.id);
6369
+ if (t?.text)
6370
+ return flatString(t.text.slice(0, 200));
6371
+ }
6372
+ } catch {
6373
+ return "";
6374
+ }
6375
+ }
6352
6376
  /** OpenCode auto-generates a session title (model-written, distinct from the
6353
6377
  * first prompt — e.g. "Replacing Claude with Gemini CLI"). It's a plain
6354
6378
  * column on the session row. */
@@ -6982,28 +7006,29 @@ var init_codex = __esm({
6982
7006
  continue;
6983
7007
  let firstPrompt = "";
6984
7008
  let messageCount = 0;
6985
- try {
6986
- const lines = readFileSync2(filePath, "utf-8").split("\n");
6987
- for (const line of lines) {
6988
- if (!line.trim())
6989
- continue;
6990
- let ev;
6991
- try {
6992
- ev = JSON.parse(line);
6993
- } catch {
6994
- continue;
6995
- }
6996
- if (ev.type === "event_msg" && ev.payload?.type === "user_message") {
6997
- messageCount++;
6998
- if (!firstPrompt && ev.payload.message) {
6999
- firstPrompt = flatString(String(ev.payload.message).slice(0, 200));
7009
+ if (opts.previews !== false)
7010
+ try {
7011
+ const lines = readFileSync2(filePath, "utf-8").split("\n");
7012
+ for (const line of lines) {
7013
+ if (!line.trim())
7014
+ continue;
7015
+ let ev;
7016
+ try {
7017
+ ev = JSON.parse(line);
7018
+ } catch {
7019
+ continue;
7020
+ }
7021
+ if (ev.type === "event_msg" && ev.payload?.type === "user_message") {
7022
+ messageCount++;
7023
+ if (!firstPrompt && ev.payload.message) {
7024
+ firstPrompt = flatString(String(ev.payload.message).slice(0, 200));
7025
+ }
7026
+ } else if (ev.type === "response_item" && ev.payload?.type === "message") {
7027
+ messageCount++;
7000
7028
  }
7001
- } else if (ev.type === "response_item" && ev.payload?.type === "message") {
7002
- messageCount++;
7003
7029
  }
7030
+ } catch {
7004
7031
  }
7005
- } catch {
7006
- }
7007
7032
  const prior = seen.get(rawId);
7008
7033
  if (prior) {
7009
7034
  if (stat.mtimeMs > prior.mtime) {
@@ -7693,21 +7718,22 @@ var init_agy = __esm({
7693
7718
  const projectDir = projectPath ? basename5(projectPath) : "";
7694
7719
  let firstPrompt = "";
7695
7720
  let messageCount = 0;
7696
- try {
7697
- const lines = readFileSync3(filePath, "utf-8").split("\n").filter(Boolean);
7698
- messageCount = lines.length;
7699
- for (const line of lines) {
7700
- const obj = JSON.parse(line);
7701
- if (obj.source === "USER_EXPLICIT" && obj.type === "USER_INPUT" && typeof obj.content === "string") {
7702
- const content = obj.content;
7703
- const match = content.match(/<USER_REQUEST>([\s\S]*?)<\/USER_REQUEST>/);
7704
- const rawText = match ? match[1].trim() : content.trim();
7705
- firstPrompt = flatString(rawText.slice(0, 200));
7706
- break;
7721
+ if (opts.previews !== false)
7722
+ try {
7723
+ const lines = readFileSync3(filePath, "utf-8").split("\n").filter(Boolean);
7724
+ messageCount = lines.length;
7725
+ for (const line of lines) {
7726
+ const obj = JSON.parse(line);
7727
+ if (obj.source === "USER_EXPLICIT" && obj.type === "USER_INPUT" && typeof obj.content === "string") {
7728
+ const content = obj.content;
7729
+ const match = content.match(/<USER_REQUEST>([\s\S]*?)<\/USER_REQUEST>/);
7730
+ const rawText = match ? match[1].trim() : content.trim();
7731
+ firstPrompt = flatString(rawText.slice(0, 200));
7732
+ break;
7733
+ }
7707
7734
  }
7735
+ } catch {
7708
7736
  }
7709
- } catch {
7710
- }
7711
7737
  if (seenIds.has(rawId))
7712
7738
  continue;
7713
7739
  seenIds.add(rawId);
@@ -9704,12 +9730,12 @@ var init_claude = __esm({
9704
9730
  const seen = /* @__PURE__ */ new Set();
9705
9731
  const out = [];
9706
9732
  for (const root of claudeProjectDirs()) {
9707
- this.collectSessionsFromRoot(root, cutoff, filter, seen, out);
9733
+ this.collectSessionsFromRoot(root, cutoff, filter, seen, out, opts.previews !== false);
9708
9734
  }
9709
9735
  out.sort((a, b) => b.mtime - a.mtime);
9710
9736
  return opts.limit ? out.slice(0, opts.limit) : out;
9711
9737
  }
9712
- collectSessionsFromRoot(root, cutoff, filter, seen, out) {
9738
+ collectSessionsFromRoot(root, cutoff, filter, seen, out, previews) {
9713
9739
  if (!existsSync11(root))
9714
9740
  return;
9715
9741
  for (const proj of readdirSync8(root, { withFileTypes: true })) {
@@ -9768,7 +9794,7 @@ var init_claude = __esm({
9768
9794
  }
9769
9795
  if (stat.mtimeMs < cutoff)
9770
9796
  continue;
9771
- const firstPrompt = extractFirstUserPromptSync(fullPath, { maxLength: 200 });
9797
+ const firstPrompt = previews ? extractFirstUserPromptSync(fullPath, { maxLength: 200 }) : "";
9772
9798
  out.push({
9773
9799
  toolId: "claude",
9774
9800
  rawId: sessionId,
@@ -732,7 +732,7 @@ export async function reconcileFields(opts = {}) {
732
732
  throw new Error('Not logged in — run `chat-recall login <server-url> --token <token>`');
733
733
  let cached = null;
734
734
  const fullRefs = () => (cached ??= listAvailableBackends().flatMap((b) => { try {
735
- return b.listSessions({});
735
+ return b.listSessions({ previews: false });
736
736
  }
737
737
  catch {
738
738
  return [];
@@ -1057,7 +1057,7 @@ async function syncToTargetInScope(cred, opts = {}) {
1057
1057
  : (opts.useLedger ? undefined : opts.sinceMs);
1058
1058
  const refs = listAvailableBackends().flatMap((b) => {
1059
1059
  try {
1060
- return b.listSessions({ sinceMs: listSinceMs });
1060
+ return b.listSessions({ sinceMs: listSinceMs, previews: false });
1061
1061
  }
1062
1062
  catch {
1063
1063
  return [];
@@ -1630,7 +1630,7 @@ async function syncToTargetInScope(cred, opts = {}) {
1630
1630
  if (upload.sessionMeta) {
1631
1631
  try {
1632
1632
  await reconcileFieldsForTarget(cred, () => listAvailableBackends().flatMap((b) => { try {
1633
- return b.listSessions({});
1633
+ return b.listSessions({ previews: false });
1634
1634
  }
1635
1635
  catch {
1636
1636
  return [];