chat-recall 0.7.13 → 0.7.14

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
@@ -10956,12 +10956,14 @@ function lineKey(line) {
10956
10956
  try {
10957
10957
  const o = JSON.parse(line);
10958
10958
  if (typeof o?.uuid === "string" && o.uuid)
10959
- return { key: `u:${o.uuid}`, singleton: false };
10960
- if (typeof o?.type === "string" && SINGLETON_META.has(o.type))
10961
- return { key: `m:${o.type}`, singleton: true };
10959
+ return { key: `u:${o.uuid}`, meta: false, json: true };
10960
+ return { key: `h:${sha1(line)}`, meta: typeof o?.type === "string" && STATE_META.has(o.type), json: true };
10962
10961
  } catch {
10963
10962
  }
10964
- return { key: `h:${sha1(line)}`, singleton: false };
10963
+ return { key: `h:${sha1(line)}`, meta: false, json: false };
10964
+ }
10965
+ function isHalfWritten(line, currentLines) {
10966
+ return currentLines.some((c) => c.length > line.length && c.startsWith(line));
10965
10967
  }
10966
10968
  function mergeLineText(shadowText, currentText) {
10967
10969
  const shadowLines = shadowText.split("\n").filter((l) => l.trim());
@@ -10969,27 +10971,24 @@ function mergeLineText(shadowText, currentText) {
10969
10971
  const currentKeys = /* @__PURE__ */ new Set();
10970
10972
  for (const l of currentLines)
10971
10973
  currentKeys.add(lineKey(l).key);
10972
- const shadowKeys = /* @__PURE__ */ new Set();
10973
- for (const l of shadowLines)
10974
- shadowKeys.add(lineKey(l).key);
10975
- let recovered = 0;
10976
- for (const k of shadowKeys)
10977
- if (!currentKeys.has(k))
10978
- recovered++;
10979
- if (recovered === 0) {
10980
- return { text: currentText.endsWith("\n") ? currentText : currentText + "\n", recovered: 0, totalRecords: currentKeys.size };
10981
- }
10982
- const out = [];
10983
- const emitted = /* @__PURE__ */ new Set();
10974
+ const kept = [];
10975
+ const keptKeys = /* @__PURE__ */ new Set();
10976
+ const counted = /* @__PURE__ */ new Set();
10984
10977
  for (const l of shadowLines) {
10985
- const { key: key2, singleton } = lineKey(l);
10986
- if (singleton && currentKeys.has(key2))
10978
+ const { key: key2, meta, json } = lineKey(l);
10979
+ if (!json && isHalfWritten(l, currentLines))
10987
10980
  continue;
10988
- if (emitted.has(key2))
10989
- continue;
10990
- out.push(l);
10991
- emitted.add(key2);
10981
+ kept.push(l);
10982
+ keptKeys.add(key2);
10983
+ if (!meta && !currentKeys.has(key2))
10984
+ counted.add(key2);
10985
+ }
10986
+ const recovered = counted.size;
10987
+ if (recovered === 0) {
10988
+ return { text: currentText.endsWith("\n") ? currentText : currentText + "\n", recovered: 0, totalRecords: currentKeys.size };
10992
10989
  }
10990
+ const out = [...kept];
10991
+ const emitted = keptKeys;
10993
10992
  for (const l of currentLines) {
10994
10993
  const { key: key2 } = lineKey(l);
10995
10994
  if (emitted.has(key2))
@@ -11174,14 +11173,14 @@ function shadowSizeOnDisk(tool, rawId) {
11174
11173
  return 0;
11175
11174
  }
11176
11175
  }
11177
- var WHOLE_FILE_TOOLS, SINGLETON_META, lastLiveFingerprint;
11176
+ var WHOLE_FILE_TOOLS, STATE_META, lastLiveFingerprint;
11178
11177
  var init_shadow = __esm({
11179
11178
  "../engine/dist/transcript/shadow.js"() {
11180
11179
  "use strict";
11181
11180
  init_paths();
11182
11181
  init_raw();
11183
11182
  WHOLE_FILE_TOOLS = /* @__PURE__ */ new Set(["cursor"]);
11184
- SINGLETON_META = /* @__PURE__ */ new Set(["mode", "permission-mode", "ai-title", "last-prompt", "pr-link", "summary"]);
11183
+ STATE_META = /* @__PURE__ */ new Set(["mode", "permission-mode", "ai-title", "last-prompt", "pr-link", "summary"]);
11185
11184
  lastLiveFingerprint = /* @__PURE__ */ new Map();
11186
11185
  }
11187
11186
  });
@@ -18938,7 +18937,7 @@ var init_http = __esm({
18938
18937
  CLI_VERSION = JSON.parse(readFileSync31(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
18939
18938
  } catch {
18940
18939
  try {
18941
- if (true) CLI_VERSION = "0.7.13";
18940
+ if (true) CLI_VERSION = "0.7.14";
18942
18941
  } catch {
18943
18942
  }
18944
18943
  }
@@ -19436,7 +19435,7 @@ var init_telemetry = __esm({
19436
19435
  init_sync_client();
19437
19436
  cliVersion2 = () => {
19438
19437
  try {
19439
- return true ? "0.7.13" : "dev";
19438
+ return true ? "0.7.14" : "dev";
19440
19439
  } catch {
19441
19440
  return "dev";
19442
19441
  }
@@ -21817,7 +21816,7 @@ var init_sync_client = __esm({
21817
21816
  ownVersion = JSON.parse(readFileSync35(join42(dir, "../package.json"), "utf-8")).version || ownVersion;
21818
21817
  } catch {
21819
21818
  try {
21820
- if (true) ownVersion = "0.7.13";
21819
+ if (true) ownVersion = "0.7.14";
21821
21820
  } catch {
21822
21821
  }
21823
21822
  }
@@ -25979,7 +25978,7 @@ var init_intent_drain = __esm({
25979
25978
  ownVersion2 = JSON.parse(readFileSync45(join56(dir, "../package.json"), "utf-8")).version || ownVersion2;
25980
25979
  } catch {
25981
25980
  try {
25982
- if (true) ownVersion2 = "0.7.13";
25981
+ if (true) ownVersion2 = "0.7.14";
25983
25982
  } catch {
25984
25983
  }
25985
25984
  }
package/dist/mcp-relay.js CHANGED
@@ -192,7 +192,7 @@ function bridge(input, output, sock, exit, opts = {}) {
192
192
  }
193
193
 
194
194
  // src/mcp-relay.ts
195
- var VERSION = true ? "0.7.13" : "0.0.0";
195
+ var VERSION = true ? "0.7.14" : "0.0.0";
196
196
  var SERVER_URL = new URL("./mcp.js", import.meta.url);
197
197
  var SERVER_PATH = fileURLToPath(SERVER_URL);
198
198
  var START_TIMEOUT_MS = 15e3;
package/dist/mcp.js CHANGED
@@ -12022,12 +12022,14 @@ function lineKey(line) {
12022
12022
  try {
12023
12023
  const o = JSON.parse(line);
12024
12024
  if (typeof o?.uuid === "string" && o.uuid)
12025
- return { key: `u:${o.uuid}`, singleton: false };
12026
- if (typeof o?.type === "string" && SINGLETON_META.has(o.type))
12027
- return { key: `m:${o.type}`, singleton: true };
12025
+ return { key: `u:${o.uuid}`, meta: false, json: true };
12026
+ return { key: `h:${sha1(line)}`, meta: typeof o?.type === "string" && STATE_META.has(o.type), json: true };
12028
12027
  } catch {
12029
12028
  }
12030
- return { key: `h:${sha1(line)}`, singleton: false };
12029
+ return { key: `h:${sha1(line)}`, meta: false, json: false };
12030
+ }
12031
+ function isHalfWritten(line, currentLines) {
12032
+ return currentLines.some((c) => c.length > line.length && c.startsWith(line));
12031
12033
  }
12032
12034
  function mergeLineText(shadowText, currentText) {
12033
12035
  const shadowLines = shadowText.split("\n").filter((l) => l.trim());
@@ -12035,27 +12037,24 @@ function mergeLineText(shadowText, currentText) {
12035
12037
  const currentKeys = /* @__PURE__ */ new Set();
12036
12038
  for (const l of currentLines)
12037
12039
  currentKeys.add(lineKey(l).key);
12038
- const shadowKeys = /* @__PURE__ */ new Set();
12039
- for (const l of shadowLines)
12040
- shadowKeys.add(lineKey(l).key);
12041
- let recovered = 0;
12042
- for (const k of shadowKeys)
12043
- if (!currentKeys.has(k))
12044
- recovered++;
12045
- if (recovered === 0) {
12046
- return { text: currentText.endsWith("\n") ? currentText : currentText + "\n", recovered: 0, totalRecords: currentKeys.size };
12047
- }
12048
- const out = [];
12049
- const emitted = /* @__PURE__ */ new Set();
12040
+ const kept = [];
12041
+ const keptKeys = /* @__PURE__ */ new Set();
12042
+ const counted = /* @__PURE__ */ new Set();
12050
12043
  for (const l of shadowLines) {
12051
- const { key: key2, singleton } = lineKey(l);
12052
- if (singleton && currentKeys.has(key2))
12044
+ const { key: key2, meta, json } = lineKey(l);
12045
+ if (!json && isHalfWritten(l, currentLines))
12053
12046
  continue;
12054
- if (emitted.has(key2))
12055
- continue;
12056
- out.push(l);
12057
- emitted.add(key2);
12047
+ kept.push(l);
12048
+ keptKeys.add(key2);
12049
+ if (!meta && !currentKeys.has(key2))
12050
+ counted.add(key2);
12051
+ }
12052
+ const recovered = counted.size;
12053
+ if (recovered === 0) {
12054
+ return { text: currentText.endsWith("\n") ? currentText : currentText + "\n", recovered: 0, totalRecords: currentKeys.size };
12058
12055
  }
12056
+ const out = [...kept];
12057
+ const emitted = keptKeys;
12059
12058
  for (const l of currentLines) {
12060
12059
  const { key: key2 } = lineKey(l);
12061
12060
  if (emitted.has(key2))
@@ -12185,14 +12184,14 @@ function shadowUncompressedBytes(tool, rawId) {
12185
12184
  }
12186
12185
  }
12187
12186
  }
12188
- var WHOLE_FILE_TOOLS, SINGLETON_META;
12187
+ var WHOLE_FILE_TOOLS, STATE_META;
12189
12188
  var init_shadow = __esm({
12190
12189
  "../engine/dist/transcript/shadow.js"() {
12191
12190
  "use strict";
12192
12191
  init_paths();
12193
12192
  init_raw();
12194
12193
  WHOLE_FILE_TOOLS = /* @__PURE__ */ new Set(["cursor"]);
12195
- SINGLETON_META = /* @__PURE__ */ new Set(["mode", "permission-mode", "ai-title", "last-prompt", "pr-link", "summary"]);
12194
+ STATE_META = /* @__PURE__ */ new Set(["mode", "permission-mode", "ai-title", "last-prompt", "pr-link", "summary"]);
12196
12195
  }
12197
12196
  });
12198
12197
 
@@ -19846,7 +19845,7 @@ var init_http = __esm({
19846
19845
  CLI_VERSION = JSON.parse(readFileSync36(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
19847
19846
  } catch {
19848
19847
  try {
19849
- if (true) CLI_VERSION = "0.7.13";
19848
+ if (true) CLI_VERSION = "0.7.14";
19850
19849
  } catch {
19851
19850
  }
19852
19851
  }
@@ -20344,7 +20343,7 @@ var init_telemetry = __esm({
20344
20343
  init_sync_client();
20345
20344
  cliVersion2 = () => {
20346
20345
  try {
20347
- return true ? "0.7.13" : "dev";
20346
+ return true ? "0.7.14" : "dev";
20348
20347
  } catch {
20349
20348
  return "dev";
20350
20349
  }
@@ -22507,7 +22506,7 @@ var init_sync_client = __esm({
22507
22506
  ownVersion = JSON.parse(readFileSync38(join49(dir, "../package.json"), "utf-8")).version || ownVersion;
22508
22507
  } catch {
22509
22508
  try {
22510
- if (true) ownVersion = "0.7.13";
22509
+ if (true) ownVersion = "0.7.14";
22511
22510
  } catch {
22512
22511
  }
22513
22512
  }
@@ -29498,7 +29497,7 @@ function installCrashGuards() {
29498
29497
  reportClientEvent2("mcp_crash", { message: err.stack || err.message });
29499
29498
  });
29500
29499
  }
29501
- var RELAY_VERSION = true ? "0.7.13" : "0.0.0";
29500
+ var RELAY_VERSION = true ? "0.7.14" : "0.0.0";
29502
29501
  function daemonIdleSecs() {
29503
29502
  const raw = process.env.CHAT_RECALL_DAEMON_IDLE_SECS;
29504
29503
  if (raw === void 0) return 900;
@@ -10495,12 +10495,14 @@ function lineKey(line) {
10495
10495
  try {
10496
10496
  const o = JSON.parse(line);
10497
10497
  if (typeof o?.uuid === "string" && o.uuid)
10498
- return { key: `u:${o.uuid}`, singleton: false };
10499
- if (typeof o?.type === "string" && SINGLETON_META.has(o.type))
10500
- return { key: `m:${o.type}`, singleton: true };
10498
+ return { key: `u:${o.uuid}`, meta: false, json: true };
10499
+ return { key: `h:${sha1(line)}`, meta: typeof o?.type === "string" && STATE_META.has(o.type), json: true };
10501
10500
  } catch {
10502
10501
  }
10503
- return { key: `h:${sha1(line)}`, singleton: false };
10502
+ return { key: `h:${sha1(line)}`, meta: false, json: false };
10503
+ }
10504
+ function isHalfWritten(line, currentLines) {
10505
+ return currentLines.some((c) => c.length > line.length && c.startsWith(line));
10504
10506
  }
10505
10507
  function mergeLineText(shadowText, currentText) {
10506
10508
  const shadowLines = shadowText.split("\n").filter((l) => l.trim());
@@ -10508,27 +10510,24 @@ function mergeLineText(shadowText, currentText) {
10508
10510
  const currentKeys = /* @__PURE__ */ new Set();
10509
10511
  for (const l of currentLines)
10510
10512
  currentKeys.add(lineKey(l).key);
10511
- const shadowKeys = /* @__PURE__ */ new Set();
10512
- for (const l of shadowLines)
10513
- shadowKeys.add(lineKey(l).key);
10514
- let recovered = 0;
10515
- for (const k of shadowKeys)
10516
- if (!currentKeys.has(k))
10517
- recovered++;
10518
- if (recovered === 0) {
10519
- return { text: currentText.endsWith("\n") ? currentText : currentText + "\n", recovered: 0, totalRecords: currentKeys.size };
10520
- }
10521
- const out = [];
10522
- const emitted = /* @__PURE__ */ new Set();
10513
+ const kept = [];
10514
+ const keptKeys = /* @__PURE__ */ new Set();
10515
+ const counted = /* @__PURE__ */ new Set();
10523
10516
  for (const l of shadowLines) {
10524
- const { key, singleton } = lineKey(l);
10525
- if (singleton && currentKeys.has(key))
10526
- continue;
10527
- if (emitted.has(key))
10517
+ const { key, meta, json } = lineKey(l);
10518
+ if (!json && isHalfWritten(l, currentLines))
10528
10519
  continue;
10529
- out.push(l);
10530
- emitted.add(key);
10520
+ kept.push(l);
10521
+ keptKeys.add(key);
10522
+ if (!meta && !currentKeys.has(key))
10523
+ counted.add(key);
10524
+ }
10525
+ const recovered = counted.size;
10526
+ if (recovered === 0) {
10527
+ return { text: currentText.endsWith("\n") ? currentText : currentText + "\n", recovered: 0, totalRecords: currentKeys.size };
10531
10528
  }
10529
+ const out = [...kept];
10530
+ const emitted = keptKeys;
10532
10531
  for (const l of currentLines) {
10533
10532
  const { key } = lineKey(l);
10534
10533
  if (emitted.has(key))
@@ -10538,13 +10537,13 @@ function mergeLineText(shadowText, currentText) {
10538
10537
  }
10539
10538
  return { text: out.join("\n") + "\n", recovered, totalRecords: out.length };
10540
10539
  }
10541
- var SINGLETON_META;
10540
+ var STATE_META;
10542
10541
  var init_shadow = __esm({
10543
10542
  "../engine/dist/transcript/shadow.js"() {
10544
10543
  "use strict";
10545
10544
  init_paths();
10546
10545
  init_raw();
10547
- SINGLETON_META = /* @__PURE__ */ new Set(["mode", "permission-mode", "ai-title", "last-prompt", "pr-link", "summary"]);
10546
+ STATE_META = /* @__PURE__ */ new Set(["mode", "permission-mode", "ai-title", "last-prompt", "pr-link", "summary"]);
10548
10547
  }
10549
10548
  });
10550
10549
 
package/dist/watch.js CHANGED
@@ -6850,12 +6850,14 @@ function lineKey(line) {
6850
6850
  try {
6851
6851
  const o = JSON.parse(line);
6852
6852
  if (typeof o?.uuid === "string" && o.uuid)
6853
- return { key: `u:${o.uuid}`, singleton: false };
6854
- if (typeof o?.type === "string" && SINGLETON_META.has(o.type))
6855
- return { key: `m:${o.type}`, singleton: true };
6853
+ return { key: `u:${o.uuid}`, meta: false, json: true };
6854
+ return { key: `h:${sha1(line)}`, meta: typeof o?.type === "string" && STATE_META.has(o.type), json: true };
6856
6855
  } catch {
6857
6856
  }
6858
- return { key: `h:${sha1(line)}`, singleton: false };
6857
+ return { key: `h:${sha1(line)}`, meta: false, json: false };
6858
+ }
6859
+ function isHalfWritten(line, currentLines) {
6860
+ return currentLines.some((c) => c.length > line.length && c.startsWith(line));
6859
6861
  }
6860
6862
  function mergeLineText(shadowText, currentText) {
6861
6863
  const shadowLines = shadowText.split("\n").filter((l) => l.trim());
@@ -6863,27 +6865,24 @@ function mergeLineText(shadowText, currentText) {
6863
6865
  const currentKeys = /* @__PURE__ */ new Set();
6864
6866
  for (const l of currentLines)
6865
6867
  currentKeys.add(lineKey(l).key);
6866
- const shadowKeys = /* @__PURE__ */ new Set();
6867
- for (const l of shadowLines)
6868
- shadowKeys.add(lineKey(l).key);
6869
- let recovered = 0;
6870
- for (const k of shadowKeys)
6871
- if (!currentKeys.has(k))
6872
- recovered++;
6873
- if (recovered === 0) {
6874
- return { text: currentText.endsWith("\n") ? currentText : currentText + "\n", recovered: 0, totalRecords: currentKeys.size };
6875
- }
6876
- const out = [];
6877
- const emitted = /* @__PURE__ */ new Set();
6868
+ const kept = [];
6869
+ const keptKeys = /* @__PURE__ */ new Set();
6870
+ const counted = /* @__PURE__ */ new Set();
6878
6871
  for (const l of shadowLines) {
6879
- const { key: key2, singleton } = lineKey(l);
6880
- if (singleton && currentKeys.has(key2))
6872
+ const { key: key2, meta, json } = lineKey(l);
6873
+ if (!json && isHalfWritten(l, currentLines))
6881
6874
  continue;
6882
- if (emitted.has(key2))
6883
- continue;
6884
- out.push(l);
6885
- emitted.add(key2);
6875
+ kept.push(l);
6876
+ keptKeys.add(key2);
6877
+ if (!meta && !currentKeys.has(key2))
6878
+ counted.add(key2);
6879
+ }
6880
+ const recovered = counted.size;
6881
+ if (recovered === 0) {
6882
+ return { text: currentText.endsWith("\n") ? currentText : currentText + "\n", recovered: 0, totalRecords: currentKeys.size };
6886
6883
  }
6884
+ const out = [...kept];
6885
+ const emitted = keptKeys;
6887
6886
  for (const l of currentLines) {
6888
6887
  const { key: key2 } = lineKey(l);
6889
6888
  if (emitted.has(key2))
@@ -7068,14 +7067,14 @@ function shadowSizeOnDisk(tool, rawId) {
7068
7067
  return 0;
7069
7068
  }
7070
7069
  }
7071
- var WHOLE_FILE_TOOLS, SINGLETON_META, lastLiveFingerprint;
7070
+ var WHOLE_FILE_TOOLS, STATE_META, lastLiveFingerprint;
7072
7071
  var init_shadow = __esm({
7073
7072
  "../engine/dist/transcript/shadow.js"() {
7074
7073
  "use strict";
7075
7074
  init_paths();
7076
7075
  init_raw();
7077
7076
  WHOLE_FILE_TOOLS = /* @__PURE__ */ new Set(["cursor"]);
7078
- SINGLETON_META = /* @__PURE__ */ new Set(["mode", "permission-mode", "ai-title", "last-prompt", "pr-link", "summary"]);
7077
+ STATE_META = /* @__PURE__ */ new Set(["mode", "permission-mode", "ai-title", "last-prompt", "pr-link", "summary"]);
7079
7078
  lastLiveFingerprint = /* @__PURE__ */ new Map();
7080
7079
  }
7081
7080
  });
@@ -18485,7 +18484,7 @@ var init_http = __esm({
18485
18484
  CLI_VERSION = JSON.parse(readFileSync32(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
18486
18485
  } catch {
18487
18486
  try {
18488
- if (true) CLI_VERSION = "0.7.13";
18487
+ if (true) CLI_VERSION = "0.7.14";
18489
18488
  } catch {
18490
18489
  }
18491
18490
  }
@@ -18979,7 +18978,7 @@ var init_telemetry = __esm({
18979
18978
  init_sync_client();
18980
18979
  cliVersion = () => {
18981
18980
  try {
18982
- return true ? "0.7.13" : "dev";
18981
+ return true ? "0.7.14" : "dev";
18983
18982
  } catch {
18984
18983
  return "dev";
18985
18984
  }
@@ -21112,7 +21111,7 @@ var init_sync_client = __esm({
21112
21111
  ownVersion = JSON.parse(readFileSync35(join42(dir, "../package.json"), "utf-8")).version || ownVersion;
21113
21112
  } catch {
21114
21113
  try {
21115
- if (true) ownVersion = "0.7.13";
21114
+ if (true) ownVersion = "0.7.14";
21116
21115
  } catch {
21117
21116
  }
21118
21117
  }
@@ -24249,7 +24248,7 @@ try {
24249
24248
  ownVersion2 = JSON.parse(readFileSync39(join48(dir, "../package.json"), "utf-8")).version || ownVersion2;
24250
24249
  } catch {
24251
24250
  try {
24252
- if (true) ownVersion2 = "0.7.13";
24251
+ if (true) ownVersion2 = "0.7.14";
24253
24252
  } catch {
24254
24253
  }
24255
24254
  }
@@ -24634,7 +24633,7 @@ async function runCollectorMigration(opts) {
24634
24633
  init_sync_ledger();
24635
24634
  init_collector_health();
24636
24635
  import { existsSync as existsSync50, readFileSync as readFileSync45, statSync as statSync45 } from "fs";
24637
- var CLI_VERSION3 = true ? "0.7.13" : "0.0.0";
24636
+ var CLI_VERSION3 = true ? "0.7.14" : "0.0.0";
24638
24637
  var DEBOUNCE_MS = 5e3;
24639
24638
  var PLANS_DIR = claudeBackend.plansDir();
24640
24639
  var TASKS_DIR = claudeBackend.tasksDir();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chat-recall",
3
- "version": "0.7.13",
3
+ "version": "0.7.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/munhq/chat-recall.git"