chat-recall 0.5.20 → 0.5.22

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.
@@ -0,0 +1,21 @@
1
+ /** The steps that may report. A closed set: an open one turns this into a log. */
2
+ export type InstallStep = 'cli_login_probe' | 'cli_login_device' | 'cli_mcp_config' | 'cli_first_sync' | 'cli_node_version';
3
+ export interface InstallFailure {
4
+ step: InstallStep;
5
+ /** The classification, not the prose: 'dns', 'tls', 'timeout', 'HTTP 502'. */
6
+ reason?: string | null;
7
+ /** One line, already free of paths. Truncated again server-side. */
8
+ message?: string | null;
9
+ }
10
+ /**
11
+ * Post one failure. Resolves whether or not it was sent.
12
+ *
13
+ * `serverUrl` decides WHERE to report and is never part of the payload. When the
14
+ * user has opted out, or the server has not said telemetry is allowed, this does
15
+ * nothing at all.
16
+ */
17
+ export declare function reportInstallFailure(serverUrl: string, failure: InstallFailure, opts?: {
18
+ fetchImpl?: typeof fetch;
19
+ timeoutMs?: number;
20
+ }): Promise<boolean>;
21
+ //# sourceMappingURL=install-report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-report.d.ts","sourceRoot":"","sources":["../src/install-report.ts"],"names":[],"mappings":"AA4BA,kFAAkF;AAClF,MAAM,MAAM,WAAW,GACnB,iBAAiB,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,CAAC;AAEvB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,WAAW,CAAC;IAClB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,cAAc,EACvB,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAC1D,OAAO,CAAC,OAAO,CAAC,CAoClB"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Tell the server that an install FAILED, when nothing else can.
3
+ *
4
+ * Every other funnel event fires after the user got past login, so a first run
5
+ * that dies before that is invisible: no credential, no tenant, nothing to
6
+ * attribute. The way the last one was found was the founder running the command
7
+ * on his own laptop and pasting the output. This is the mechanism that replaces
8
+ * that.
9
+ *
10
+ * ── What it will not do ───────────────────────────────────────────────────
11
+ *
12
+ * It sends a step name, a classification, a one-line message and three
13
+ * environment strings. Not a path, not an argument, not a stack trace, not a
14
+ * hostname — and `assertNoSensitiveKeys` enforces that structurally rather than
15
+ * by review, so the next person adding "just the server URL for context" gets a
16
+ * failure instead of a shipped leak.
17
+ *
18
+ * The server URL is the ONE thing worth wanting here and it is deliberately
19
+ * absent: a self-hoster's hostname is their infrastructure, and the failures we
20
+ * need to see are the hosted ones, which we already know the address of.
21
+ *
22
+ * ── Fire and forget, and silent ───────────────────────────────────────────
23
+ *
24
+ * Never awaited on the user's critical path, never logged, never able to fail a
25
+ * command. A diagnostic that can break an install is worse than no diagnostic.
26
+ */
27
+ import { mayReport, userConsents, assertNoSensitiveKeys } from './telemetry-consent.js';
28
+ /**
29
+ * Post one failure. Resolves whether or not it was sent.
30
+ *
31
+ * `serverUrl` decides WHERE to report and is never part of the payload. When the
32
+ * user has opted out, or the server has not said telemetry is allowed, this does
33
+ * nothing at all.
34
+ */
35
+ export async function reportInstallFailure(serverUrl, failure, opts = {}) {
36
+ if (!serverUrl)
37
+ return false;
38
+ // mayReport() needs the server to have confirmed eligibility, which it cannot
39
+ // have done when the very first request failed — so consent alone is the gate
40
+ // here, and the payload carries nothing that needs a server's permission.
41
+ if (!userConsents() && !mayReport(serverUrl))
42
+ return false;
43
+ const payload = {
44
+ step: failure.step,
45
+ reason: trim(failure.reason, 40),
46
+ message: trim(failure.message, 200),
47
+ cliVersion: trim(process.env.CHAT_RECALL_CLI_VERSION, 20),
48
+ node: trim(process.versions.node, 20),
49
+ os: `${process.platform}-${process.arch}`,
50
+ };
51
+ try {
52
+ // Structural check, not a promise in a comment. Throws on a forbidden key.
53
+ assertNoSensitiveKeys(payload);
54
+ }
55
+ catch {
56
+ return false;
57
+ }
58
+ const f = opts.fetchImpl || fetch;
59
+ try {
60
+ const res = await f(`${serverUrl.replace(/\/+$/, '')}/install/report`, {
61
+ method: 'POST',
62
+ headers: { 'content-type': 'application/json' },
63
+ body: JSON.stringify(payload),
64
+ signal: AbortSignal.timeout(opts.timeoutMs ?? 3000),
65
+ });
66
+ return res.ok || res.status === 204;
67
+ }
68
+ catch {
69
+ // The machine that cannot reach us cannot report. Known and accepted.
70
+ return false;
71
+ }
72
+ }
73
+ function trim(v, n) {
74
+ return typeof v === 'string' && v.trim() ? v.trim().slice(0, n) : null;
75
+ }
76
+ //# sourceMappingURL=install-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-report.js","sourceRoot":"","sources":["../src/install-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAkBxF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,SAAiB,EACjB,OAAuB,EACvB,OAAyD,EAAE;IAE3D,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7B,8EAA8E;IAC9E,8EAA8E;IAC9E,0EAA0E;IAC1E,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;QAAE,OAAO,KAAK,CAAC;IAE3D,MAAM,OAAO,GAAG;QACd,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;QAChC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAA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,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.20";
20633
+ if (true) CLI_VERSION = "0.5.22";
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.20" : "dev";
21145
+ return true ? "0.5.22" : "dev";
21146
21146
  } catch {
21147
21147
  return "dev";
21148
21148
  }
@@ -22802,7 +22802,7 @@ var init_sync_client = __esm({
22802
22802
  ownVersion = JSON.parse(readFileSync39(join49(dir, "../package.json"), "utf-8")).version || ownVersion;
22803
22803
  } catch {
22804
22804
  try {
22805
- if (true) ownVersion = "0.5.20";
22805
+ if (true) ownVersion = "0.5.22";
22806
22806
  } catch {
22807
22807
  }
22808
22808
  }
@@ -24351,7 +24351,32 @@ function setServerVersion(version2) {
24351
24351
  }
24352
24352
  function createMcpServer() {
24353
24353
  const s = new Server(
24354
- { name: "chat-recall", version: serverVersion },
24354
+ {
24355
+ name: "chat-recall",
24356
+ version: serverVersion,
24357
+ // WHO WE ARE, in the protocol rather than left to be scraped.
24358
+ //
24359
+ // MCP's Implementation object carries title, description, websiteUrl and
24360
+ // icons, and we sent none of them — so every directory had to guess. The
24361
+ // cost was visible: Smithery scored our server metadata 3 out of 35, the
24362
+ // three points being the display name it could infer from `name`. A
24363
+ // listing with no description and no icon is one a human scrolls past, and
24364
+ // the information was ours to supply all along.
24365
+ //
24366
+ // These are also what a client shows a user when it asks whether to trust
24367
+ // this server, which is a better reason than a score.
24368
+ title: "chat-recall",
24369
+ description: "One memory across every AI coding tool you use. Indexes your Claude Code, Codex, Gemini CLI, OpenCode and Cursor sessions into one searchable history, so an assistant can resume past work, search what you actually typed, read the diffs and commits from a session, recall decisions, and flag secrets pasted into old conversations.",
24370
+ websiteUrl: "https://chatrecall.dev",
24371
+ // Served from the product's own origin, which is what the spec asks for
24372
+ // ("URLs serving icons SHOULD be from the same domain"). PNG first: every
24373
+ // client that renders icons must support it, while SVG support is only a
24374
+ // SHOULD and carries a scripting caveat.
24375
+ icons: [
24376
+ { src: "https://chatrecall.dev/apple-touch-icon.png", mimeType: "image/png", sizes: ["180x180"] },
24377
+ { src: "https://chatrecall.dev/favicon.svg", mimeType: "image/svg+xml", sizes: ["any"] }
24378
+ ]
24379
+ },
24355
24380
  // resources and prompts are declared EMPTY rather than omitted: clients probe
24356
24381
  // them regardless of what is advertised, and an unregistered method answers
24357
24382
  // -32601, which every directory scan logs as a failure of a server that is
@@ -50,10 +50,19 @@ export type ProbeResult =
50
50
  snippet: string;
51
51
  }
52
52
  /** Never got an HTTP response at all: DNS, TLS, connection, timeout. */
53
+ /** No HTTP response at all. `reason` names WHY — the thing `fetch failed`
54
+ * refuses to tell you — and `error` keeps the raw string for a report. */
53
55
  | {
54
56
  kind: 'unreachable';
55
57
  error: string;
58
+ reason: UnreachableReason;
56
59
  };
60
+ /** Why a request never got an answer. Node's fetch reports every one of these as
61
+ * the same five characters, "fetch failed", with the real code hidden in
62
+ * `err.cause`. A user pasting that string leaves nothing to diagnose — which is
63
+ * exactly what happened on a macOS install: the message named SSO, the cause
64
+ * was the network, and nobody could tell which. */
65
+ export type UnreachableReason = 'dns' | 'refused' | 'tls' | 'timeout' | 'reset' | 'unknown';
57
66
  /** True when the probe proves a usable chat-recall server. */
58
67
  export declare function probeOk(r: ProbeResult): r is Extract<ProbeResult, {
59
68
  kind: 'ok';
@@ -73,4 +82,15 @@ export declare function probeServer(base: string, opts?: {
73
82
  * One line the user can act on. Never a stack trace, always the next command.
74
83
  */
75
84
  export declare function probeAdvice(r: ProbeResult, base: string): string;
85
+ /**
86
+ * Dig the real code out of a fetch failure.
87
+ *
88
+ * `err.message` on a failed `fetch` is the constant string "fetch failed" for
89
+ * every network cause there is. undici puts the truth in `err.cause`, one or two
90
+ * levels down, as a Node error code. Walk the chain and classify.
91
+ */
92
+ export declare function classifyUnreachable(err: unknown): UnreachableReason;
93
+ /** The most specific string available: the underlying code where there is one,
94
+ * because "fetch failed" is worth nothing in a bug report. */
95
+ export declare function describeCause(err: unknown): string;
76
96
  //# sourceMappingURL=server-probe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-probe.d.ts","sourceRoot":"","sources":["../src/server-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,WAAW;AACrB,+DAA+D;AAC7D;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE;AAC3E,iFAAiF;GAC/E;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AACnC,sDAAsD;GACpD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAC1C,sCAAsC;GACpC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAC1C,mFAAmF;GACjF;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE;AACtD,wEAAwE;GACtE;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,8DAA8D;AAC9D,wBAAgB,OAAO,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,IAAI,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAEjF;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,IAA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,CAAC,IAAI,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAEjF;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CAAO,GAC1D,OAAO,CAAC,WAAW,CAAC,CAyCtB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAwChE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,iBAAiB,CAgBnE;AAED;+DAC+D;AAC/D,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CASlD"}
@@ -40,7 +40,11 @@ export async function probeServer(base, opts = {}) {
40
40
  });
41
41
  }
42
42
  catch (err) {
43
- return { kind: 'unreachable', error: err instanceof Error ? err.message : String(err) };
43
+ return {
44
+ kind: 'unreachable',
45
+ error: describeCause(err),
46
+ reason: classifyUnreachable(err),
47
+ };
44
48
  }
45
49
  if (res.status === 401 || res.status === 403)
46
50
  return { kind: 'unauthorized', status: res.status };
@@ -59,7 +63,7 @@ export async function probeServer(base, opts = {}) {
59
63
  body = await res.text();
60
64
  }
61
65
  catch (err) {
62
- return { kind: 'unreachable', error: err instanceof Error ? err.message : String(err) };
66
+ return { kind: 'unreachable', error: describeCause(err), reason: classifyUnreachable(err) };
63
67
  }
64
68
  let parsed;
65
69
  try {
@@ -100,7 +104,69 @@ export function probeAdvice(r, base) {
100
104
  return `${base} answered ${r.status} with something that is not the chat-recall API `
101
105
  + `(${JSON.stringify(r.snippet)}) — check the URL, a proxy or a captive portal`;
102
106
  case 'unreachable':
103
- return `no HTTP response from ${base} (${r.error}) — check the URL, DNS, or that the server is running`;
107
+ // One sentence per cause, each naming the fix rather than the error.
108
+ switch (r.reason) {
109
+ case 'dns':
110
+ return `cannot resolve the host in ${base} (${r.error}) — check the URL for a typo, `
111
+ + 'and your DNS or VPN';
112
+ case 'refused':
113
+ return `${base} resolves but refused the connection (${r.error}) — the server is not `
114
+ + 'running, or the port is wrong';
115
+ case 'tls':
116
+ return `the TLS certificate at ${base} was rejected (${r.error}) — expired, self-signed, `
117
+ + 'or issued for another host. A corporate proxy that re-signs traffic does this.';
118
+ case 'timeout':
119
+ return `${base} did not answer in time (${r.error}) — a firewall or proxy that drops `
120
+ + 'traffic silently looks exactly like this';
121
+ case 'reset':
122
+ return `the connection to ${base} was cut (${r.error}) — often a proxy or a captive portal`;
123
+ default:
124
+ return `no HTTP response from ${base} (${r.error}) — check the URL, DNS, or that the `
125
+ + 'server is running';
126
+ }
104
127
  }
105
128
  }
129
+ /**
130
+ * Dig the real code out of a fetch failure.
131
+ *
132
+ * `err.message` on a failed `fetch` is the constant string "fetch failed" for
133
+ * every network cause there is. undici puts the truth in `err.cause`, one or two
134
+ * levels down, as a Node error code. Walk the chain and classify.
135
+ */
136
+ export function classifyUnreachable(err) {
137
+ if (err instanceof Error && (err.name === 'TimeoutError' || err.name === 'AbortError'))
138
+ return 'timeout';
139
+ for (let e = err, depth = 0; e && depth < 5; depth++) {
140
+ const code = String(e.code ?? '');
141
+ const msg = String(e.message ?? '');
142
+ if (code === 'ENOTFOUND' || code === 'EAI_AGAIN')
143
+ return 'dns';
144
+ if (code === 'ECONNREFUSED')
145
+ return 'refused';
146
+ if (code === 'ECONNRESET' || code === 'EPIPE')
147
+ return 'reset';
148
+ if (code === 'ETIMEDOUT' || code === 'UND_ERR_CONNECT_TIMEOUT' || code === 'UND_ERR_HEADERS_TIMEOUT')
149
+ return 'timeout';
150
+ // TLS codes are many and all start the same way, plus the self-signed pair.
151
+ if (code.startsWith('CERT_') || code.startsWith('ERR_TLS')
152
+ || code === 'DEPTH_ZERO_SELF_SIGNED_CERT' || code === 'SELF_SIGNED_CERT_IN_CHAIN'
153
+ || code === 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' || /certificate/i.test(msg))
154
+ return 'tls';
155
+ e = e.cause;
156
+ }
157
+ return 'unknown';
158
+ }
159
+ /** The most specific string available: the underlying code where there is one,
160
+ * because "fetch failed" is worth nothing in a bug report. */
161
+ export function describeCause(err) {
162
+ const parts = [];
163
+ for (let e = err, depth = 0; e && depth < 5; depth++) {
164
+ const code = e.code;
165
+ if (typeof code === 'string' && code && !parts.includes(code))
166
+ parts.push(code);
167
+ e = e.cause;
168
+ }
169
+ const base = err instanceof Error ? err.message : String(err);
170
+ return parts.length ? `${base}: ${parts.join(' → ')}` : base;
171
+ }
106
172
  //# sourceMappingURL=server-probe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-probe.js","sourceRoot":"","sources":["../src/server-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAgBH,8DAA8D;AAC9D,MAAM,UAAU,OAAO,CAAC,CAAc;IACpC,OAAO,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAY,EACZ,OAAyD,EAAE;IAE3D,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC;IAClC,IAAI,GAAa,CAAC;IAClB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,mBAAmB,EAAE;YAC5D,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC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dist/watch.js CHANGED
@@ -19210,7 +19210,7 @@ var init_http = __esm({
19210
19210
  CLI_VERSION = JSON.parse(readFileSync33(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
19211
19211
  } catch {
19212
19212
  try {
19213
- if (true) CLI_VERSION = "0.5.20";
19213
+ if (true) CLI_VERSION = "0.5.22";
19214
19214
  } catch {
19215
19215
  }
19216
19216
  }
@@ -19718,7 +19718,7 @@ var init_telemetry = __esm({
19718
19718
  init_sync_client();
19719
19719
  cliVersion = () => {
19720
19720
  try {
19721
- return true ? "0.5.20" : "dev";
19721
+ return true ? "0.5.22" : "dev";
19722
19722
  } catch {
19723
19723
  return "dev";
19724
19724
  }
@@ -21414,7 +21414,7 @@ var init_sync_client = __esm({
21414
21414
  ownVersion = JSON.parse(readFileSync37(join44(dir, "../package.json"), "utf-8")).version || ownVersion;
21415
21415
  } catch {
21416
21416
  try {
21417
- if (true) ownVersion = "0.5.20";
21417
+ if (true) ownVersion = "0.5.22";
21418
21418
  } catch {
21419
21419
  }
21420
21420
  }
@@ -24207,7 +24207,7 @@ try {
24207
24207
  ownVersion2 = JSON.parse(readFileSync41(join49(dir, "../package.json"), "utf-8")).version || ownVersion2;
24208
24208
  } catch {
24209
24209
  try {
24210
- if (true) ownVersion2 = "0.5.20";
24210
+ if (true) ownVersion2 = "0.5.22";
24211
24211
  } catch {
24212
24212
  }
24213
24213
  }
@@ -24551,7 +24551,7 @@ async function runCollectorMigration(opts) {
24551
24551
  init_sync_ledger();
24552
24552
  init_collector_health();
24553
24553
  import { existsSync as existsSync50, readFileSync as readFileSync46 } from "fs";
24554
- var CLI_VERSION3 = true ? "0.5.20" : "0.0.0";
24554
+ var CLI_VERSION3 = true ? "0.5.22" : "0.0.0";
24555
24555
  var DEBOUNCE_MS = 5e3;
24556
24556
  var CLAUDE_DIR = claudeBackend.projectsDir();
24557
24557
  var PLANS_DIR = claudeBackend.plansDir();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chat-recall",
3
- "version": "0.5.20",
3
+ "version": "0.5.22",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/munhq/chat-recall.git"