@echomem/mcp 1.5.1 → 1.5.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/index.js CHANGED
@@ -26,7 +26,7 @@ import { startSaveLocalTrace } from "./save-local-trace.js";
26
26
  import { readToolMapCache, writeToolMapCache } from "./tool-map-cache.js";
27
27
  import { claimSourceSessionProofNonce, registerDirectBridge, registerRelayBridge, takeSourceSessionProof, takeSourceSessionProofForCall, verifySourceSessionProof, } from "./source-session-local.js";
28
28
  import { EventLogger, hashText } from "./events.js";
29
- import { requestFailureDetails } from "./request-failure.js";
29
+ import { BACKEND_UNREACHABLE, backendUnreachable, requestFailureDetails } from "./request-failure.js";
30
30
  import { contextHealthMarkdown, recomposeCapsuleMarkdown } from "./hud/api.js";
31
31
  import { refreshInstalledLifecycleHooks } from "./hud/hooks.js";
32
32
  import { createHash, randomUUID } from "node:crypto";
@@ -121,6 +121,9 @@ function stringifyErrorValue(value) {
121
121
  return String(value);
122
122
  }
123
123
  function describeError(error) {
124
+ // The socket error ("connect ECONNREFUSED 127.0.0.1:3000") tells a user nothing.
125
+ if (backendUnreachable(error))
126
+ return BACKEND_UNREACHABLE;
124
127
  if (axios.isAxiosError(error)) {
125
128
  const status = error.response?.status;
126
129
  const body = stringifyErrorValue(error.response?.data);
@@ -1231,7 +1234,7 @@ class EchoMemApiClient {
1231
1234
  if (this.encConfigPromise === request)
1232
1235
  this.encConfigPromise = null; // allow retry next call
1233
1236
  console.error(`[encryption] config fetch failed: ${describeError(error)} — refusing memory access`);
1234
- throw new EncryptionStatusUnavailableError("EchoMem could not verify the account encryption state");
1237
+ throw new EncryptionStatusUnavailableError("EchoMem could not verify the account encryption state", { cause: error });
1235
1238
  });
1236
1239
  this.encConfigPromise = request;
1237
1240
  }
@@ -2653,6 +2656,14 @@ class EchoMemMCPServer {
2653
2656
  ],
2654
2657
  };
2655
2658
  }
2659
+ // Whichever request met the dead address first, say the one thing that is wrong.
2660
+ if (backendUnreachable(error instanceof EncryptionStatusUnavailableError ? error.cause : error)) {
2661
+ const outcome = canonicalName === canonicalToolNames.save ? "nothing was saved" : "nothing was returned or changed";
2662
+ return {
2663
+ content: [{ type: "text", text: `${BACKEND_UNREACHABLE}; ${outcome}.` }],
2664
+ isError: true,
2665
+ };
2666
+ }
2656
2667
  if (error instanceof EncryptionStatusUnavailableError) {
2657
2668
  return {
2658
2669
  content: [{
@@ -99,6 +99,11 @@ export function resolveClaudeProjectsDir(opts = {}) {
99
99
  const root = configuredRoot("CLAUDE_CONFIG_DIR", ".claude", opts);
100
100
  return resolveReadableDirectory(root ? path.join(root, "projects") : null);
101
101
  }
102
+ /** Claude Code publishes one live process record per PID in the active profile. */
103
+ export function resolveClaudeProcessSessionsDir() {
104
+ const root = configuredRoot("CLAUDE_CONFIG_DIR", ".claude");
105
+ return resolveReadableDirectory(root ? path.join(root, "sessions") : null);
106
+ }
102
107
  /**
103
108
  * Cursor's per-project data root. Its Agent writes one transcript per conversation at
104
109
  * `projects/<slug>/agent-transcripts/<uuid>/<uuid>.jsonl`. Cursor itself honours no profile
@@ -30,3 +30,12 @@ export function requestFailureDetails(error) {
30
30
  }
31
31
  return { errorCode: analyticsErrorCode(error) === "timeout" ? "timeout" : "network" };
32
32
  }
33
+ // Node reports these when no connection to the backend was made, so the
34
+ // request never arrived. A reset or a timeout is not among them: the backend
35
+ // may have received that request.
36
+ const UNREACHABLE_CODES = new Set(["ECONNREFUSED", "ENOTFOUND", "EAI_AGAIN", "ENETUNREACH", "EHOSTUNREACH"]);
37
+ export const BACKEND_UNREACHABLE = "EchoMem's server can't be reached";
38
+ /** True when a backend request failed because nothing answered at its address. */
39
+ export function backendUnreachable(error) {
40
+ return axios.isAxiosError(error) && !error.response && UNREACHABLE_CODES.has(error.code ?? "");
41
+ }
@@ -5,8 +5,10 @@ import path from "node:path";
5
5
  import axios from "axios";
6
6
  import { KeyStore } from "./keystore.js";
7
7
  import { MCP_PACKAGE_VERSION } from "./package-metadata.js";
8
- import { registerLocalSourceSession } from "./source-session-local.js";
8
+ import { resolveClaudeProcessSessionsDir } from "./local-data-paths.js";
9
+ import { hookParentPids, registeredDesktopSession, registerLocalSourceSession } from "./source-session-local.js";
9
10
  import { SOURCE_SESSION_HOOK_EVIDENCE, verifiedClaudeDesktopSession, verifiedSourceSession, } from "./source-session.js";
11
+ export const DESKTOP_RECORD_WAIT_MS = 3_500;
10
12
  const API_BASE = (resolveBackendURL()).replace(/\/$/, "");
11
13
  const MAX_HEAD_BYTES = 256 * 1024;
12
14
  const MAX_CLAUDE_DESKTOP_INDEX_FILES = 2_000;
@@ -58,10 +60,10 @@ function claudeDesktopSessionsRoot() {
58
60
  || path.join(process.env.HOME || "", "Library", "Application Support", "Claude");
59
61
  return path.join(support, "claude-code-sessions");
60
62
  }
61
- function readClaudeDesktopClaim(file) {
63
+ function readClaudeDesktopClaim(file, exactHost = false) {
62
64
  try {
63
65
  const stat = fs.statSync(file);
64
- if (!stat.isFile() || stat.size > MAX_HEAD_BYTES)
66
+ if (!stat.isFile() || (!exactHost && stat.size > MAX_HEAD_BYTES))
65
67
  return null;
66
68
  const row = JSON.parse(fs.readFileSync(file, "utf8"));
67
69
  if (!isRecord(row) || row.isArchived === true)
@@ -135,18 +137,52 @@ function claudeDesktopSessionForCliId(cliSessionId) {
135
137
  }
136
138
  return best ? verifiedClaudeDesktopSession(best.desktopSessionId, best.cliSessionIds) : null;
137
139
  }
140
+ // Use only the nearest Claude process record. An inner CLI can inherit the outer tab's
141
+ // environment, so both host-owned IDs must match the current hook.
142
+ function isActiveCodeTab(hostId, cliId) {
143
+ if (process.env.CLAUDE_CODE_ENTRYPOINT !== "claude-desktop" || !UUID_RE.test(cliId))
144
+ return false;
145
+ const directory = resolveClaudeProcessSessionsDir();
146
+ if (!directory)
147
+ return false;
148
+ for (const pid of hookParentPids()) {
149
+ let row;
150
+ try {
151
+ row = JSON.parse(fs.readFileSync(path.join(directory, `${pid}.json`), "utf8"));
152
+ }
153
+ catch (error) {
154
+ if (error.code === "ENOENT")
155
+ continue;
156
+ return false;
157
+ }
158
+ if (isRecord(row) && row.pid === pid && row.entrypoint === "claude-desktop"
159
+ && row.hostSessionId === hostId && row.sessionId === cliId) {
160
+ return true;
161
+ }
162
+ return false;
163
+ }
164
+ return false;
165
+ }
138
166
  /** The session the Claude desktop app says it hosts here, if that session's own record names
139
167
  * this CLI session. The app writes the record a few seconds after the session's first message, so
140
168
  * a call made sooner finds none: within `waitMs` it is waited for, because without it the session
141
- * would be known by its CLI ID alone from then on. A record that names another CLI session is
142
- * not waited on: a `claude` started inside a hosted session inherits that session's ID. Looking
169
+ * would be known by its CLI ID alone from then on. A nested CLI inherits the outer tab's ID;
170
+ * only a verified active tab can wait for a desktop record that still names a different CLI. Looking
143
171
  * the record up by its name also keeps this independent of how many records there are. */
144
- function hostedClaudeDesktopSession(cliSessionId, waitMs) {
172
+ function hostedClaudeDesktopSession(cliSessionId, waitMs, includePriorCliIds) {
145
173
  const hostSessionId = process.env.CLAUDE_CODE_HOST_SESSION_ID?.trim() ?? "";
146
174
  if (!CLAUDE_DESKTOP_ID_RE.test(hostSessionId))
147
175
  return null;
148
176
  const pause = new Int32Array(new SharedArrayBuffer(4));
149
177
  for (const deadline = Date.now() + waitMs;;) {
178
+ const active = isActiveCodeTab(hostSessionId, cliSessionId);
179
+ // Binding a resumed tab may promote a context stored under a previous CLI ID.
180
+ // Read the full mapping on a cold lookup. Warm searches can reuse the signed mapping.
181
+ if (active && !includePriorCliIds) {
182
+ const cached = registeredDesktopSession(cliSessionId, hostSessionId, new KeyStore().getToken());
183
+ if (cached)
184
+ return cached;
185
+ }
150
186
  const pending = [claudeDesktopSessionsRoot()];
151
187
  const claims = [];
152
188
  for (let directory = pending.pop(); directory; directory = pending.pop()) {
@@ -161,8 +197,8 @@ function hostedClaudeDesktopSession(cliSessionId, waitMs) {
161
197
  if (entry.isDirectory())
162
198
  pending.push(path.join(directory, entry.name));
163
199
  else if (entry.isFile() && entry.name === `${hostSessionId}.json`) {
164
- const claim = readClaudeDesktopClaim(path.join(directory, entry.name));
165
- if (claim)
200
+ const claim = readClaudeDesktopClaim(path.join(directory, entry.name), true);
201
+ if (claim?.desktopSessionId === hostSessionId)
166
202
  claims.push(claim);
167
203
  }
168
204
  }
@@ -170,7 +206,8 @@ function hostedClaudeDesktopSession(cliSessionId, waitMs) {
170
206
  const claim = claims.find((candidate) => candidate.cliSessionIds.includes(cliSessionId));
171
207
  if (claim)
172
208
  return verifiedClaudeDesktopSession(claim.desktopSessionId, claim.cliSessionIds);
173
- if (claims.length > 0)
209
+ // A verified, resumed tab may still have a desktop record naming its previous CLI session.
210
+ if (claims.length > 0 && !active)
174
211
  return null;
175
212
  if (Date.now() >= deadline) {
176
213
  if (process.env.CLAUDE_CODE_ENTRYPOINT === "claude-desktop") {
@@ -209,8 +246,8 @@ export function resolveSourceSessionFromHookPayload(payload, options = {}) {
209
246
  const filenameSession = path.basename(file, path.extname(file));
210
247
  if (filenameSession !== requestedSessionId)
211
248
  return null;
212
- const desktopSession = hostedClaudeDesktopSession(filenameSession.toLowerCase(), options.awaitDesktopRecordMs ?? 0)
213
- ?? claudeDesktopSessionForCliId(filenameSession.toLowerCase());
249
+ const cliSessionId = filenameSession.toLowerCase();
250
+ const desktopSession = hostedClaudeDesktopSession(cliSessionId, options.awaitDesktopRecordMs ?? 0, options.includePriorCliIds === true) ?? claudeDesktopSessionForCliId(cliSessionId);
214
251
  if (desktopSession)
215
252
  return desktopSession;
216
253
  return verifiedSourceSession("claude-code", filenameSession, SOURCE_SESSION_HOOK_EVIDENCE);
@@ -240,7 +277,7 @@ export async function runSourceSessionStartHook(input) {
240
277
  const parsed = JSON.parse(input);
241
278
  if (!isRecord(parsed))
242
279
  return JSON.stringify({ continue: true });
243
- const identity = resolveSourceSessionFromHookPayload(parsed);
280
+ const identity = resolveSourceSessionFromHookPayload(parsed, { includePriorCliIds: true });
244
281
  if (identity) {
245
282
  const sessionId = typeof parsed.session_id === "string" ? parsed.session_id : "";
246
283
  try {
@@ -3,7 +3,7 @@ import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
5
5
  import { echoConfigDir } from "./keystore.js";
6
- import { SOURCE_SESSION_HOOK_EVIDENCE, verifiedClaudeDesktopSession, verifiedSourceSession, } from "./source-session.js";
6
+ import { SOURCE_SESSION_DESKTOP_INDEX_EVIDENCE, SOURCE_SESSION_HOOK_EVIDENCE, verifiedClaudeDesktopSession, verifiedSourceSession, } from "./source-session.js";
7
7
  const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
8
8
  const PROOF_TTL_MS = 60 * 60 * 1000;
9
9
  const REGISTRY_TTL_MS = 7 * 24 * 60 * 60 * 1000;
@@ -74,6 +74,7 @@ export function registerLocalSourceSession(sessionId, identity, secret) {
74
74
  transcript: identity.transcript,
75
75
  },
76
76
  registeredAt: Date.now(),
77
+ ...(identity.evidence === SOURCE_SESSION_DESKTOP_INDEX_EVIDENCE ? { desktopAliasesVerified: true } : {}),
77
78
  };
78
79
  const payload = JSON.stringify(entry);
79
80
  const dir = path.dirname(file);
@@ -83,6 +84,7 @@ export function registerLocalSourceSession(sessionId, identity, secret) {
83
84
  fs.renameSync(temporary, file);
84
85
  fs.chmodSync(file, 0o600);
85
86
  pruneExpiredProofClaims(secret);
87
+ return entry;
86
88
  }
87
89
  function readLocalSourceSession(sessionId, secret) {
88
90
  try {
@@ -106,11 +108,19 @@ function readLocalSourceSession(sessionId, secret) {
106
108
  return null;
107
109
  }
108
110
  }
109
- export function mintSourceSessionProof(sessionId, toolName, secret) {
111
+ /** Reuse aliases only for the same live tab, current CLI process and signing account. */
112
+ export function registeredDesktopSession(cliId, hostId, secret) {
113
+ const entry = secret ? readLocalSourceSession(cliId, secret) : null;
114
+ if (!entry?.desktopAliasesVerified || entry.identity.provider !== "claude-code"
115
+ || entry.identity.providerSessionId !== hostId || entry.identity.providerSessionAliases?.[0] !== cliId)
116
+ return null;
117
+ return verifiedClaudeDesktopSession(hostId, entry.identity.providerSessionAliases);
118
+ }
119
+ export function mintSourceSessionProof(sessionId, toolName, secret, fresh) {
110
120
  if (!secret || !/^mcp__echomem__/.test(toolName))
111
121
  return null;
112
- const registered = readLocalSourceSession(sessionId, secret);
113
- if (!registered)
122
+ const registered = fresh ?? readLocalSourceSession(sessionId, secret);
123
+ if (!registered || registered.sessionId !== sessionId.toLowerCase())
114
124
  return null;
115
125
  const issuedAt = Date.now();
116
126
  const proof = {
@@ -344,6 +354,22 @@ export function registerDirectBridge(hostPid = process.ppid) {
344
354
  // Without the record the hook puts the proof in the call's input, which every bridge reads.
345
355
  }
346
356
  }
357
+ /** A command hook can run directly under its host or through a shell wrapper. */
358
+ export function* hookParentPids() {
359
+ if (process.ppid <= 1)
360
+ return;
361
+ yield process.ppid;
362
+ try {
363
+ const parents = new Map(execFileSync("ps", ["-ax", "-o", "pid=,ppid="], { encoding: "utf8", timeout: 2000 })
364
+ .split("\n").map(line => line.trim().split(/\s+/).map(Number)));
365
+ for (let pid = parents.get(process.ppid) ?? 0, depth = 1; pid > 1 && depth < 8; pid = parents.get(pid) ?? 0, depth++) {
366
+ yield pid;
367
+ }
368
+ }
369
+ catch {
370
+ // On hosts without a process table, only the direct parent is known.
371
+ }
372
+ }
347
373
  /** Whether the host running this hook has a bridge of its own: one of this process's ancestors
348
374
  * launched a bridge that is still running. */
349
375
  export function hostRunsDirectBridge() {
@@ -352,9 +378,7 @@ export function hostRunsDirectBridge() {
352
378
  .filter(([host, bridge]) => host > 0 && bridge > 0 && running(bridge));
353
379
  if (!bridges.length)
354
380
  return false;
355
- const parents = new Map(execFileSync("ps", ["-ax", "-o", "pid=,ppid="], { encoding: "utf8", timeout: 2000 })
356
- .split("\n").map(line => line.trim().split(/\s+/).map(Number)));
357
- for (let pid = process.ppid, depth = 0; pid > 1 && depth < 8; pid = parents.get(pid) ?? 0, depth++) {
381
+ for (const pid of hookParentPids()) {
358
382
  if (bridges.some(([host]) => host === pid))
359
383
  return true;
360
384
  }
@@ -1,6 +1,6 @@
1
1
  import { KeyStore } from "./keystore.js";
2
2
  import { hostRunsDirectBridge, leaveSourceSessionProof, leaveSourceSessionProofForCall, mintSourceSessionProof, registerLocalSourceSession, relayBridgeCollectsProofs, } from "./source-session-local.js";
3
- import { resolveSourceSessionFromHookPayload } from "./source-session-hook.js";
3
+ import { DESKTOP_RECORD_WAIT_MS, resolveSourceSessionFromHookPayload } from "./source-session-hook.js";
4
4
  function isRecord(value) {
5
5
  return typeof value === "object" && value !== null && !Array.isArray(value);
6
6
  }
@@ -21,16 +21,21 @@ export function runSourceSessionPreToolHook(input) {
21
21
  return "";
22
22
  // Resolve the current host evidence before minting. A cached CLI ID can predate the
23
23
  // desktop record, and a resumed chat can have a new CLI transcript under the same key.
24
+ let registered;
24
25
  if (typeof payload.transcript_path === "string" && payload.transcript_path) {
25
- const identity = resolveSourceSessionFromHookPayload(payload, { awaitDesktopRecordMs: 3_500 });
26
+ const identity = resolveSourceSessionFromHookPayload(payload, {
27
+ awaitDesktopRecordMs: DESKTOP_RECORD_WAIT_MS,
28
+ includePriorCliIds: toolName === "mcp__echomem__save_conversation",
29
+ });
26
30
  if (!identity)
27
31
  throw new Error("SOURCE_SESSION_NOT_READY: the host transcript is not readable yet. Retry this call shortly.");
28
32
  if (identity.provider === "claude-code") {
29
33
  identity.transcript = { path: payload.transcript_path, sessionId };
30
34
  }
31
- registerLocalSourceSession(sessionId, identity, secret);
35
+ registered = registerLocalSourceSession(sessionId, identity, secret);
32
36
  }
33
- const proof = mintSourceSessionProof(sessionId, toolName, secret);
37
+ // A parallel hook can replace the shared registry entry after registration.
38
+ const proof = mintSourceSessionProof(sessionId, toolName, secret, registered);
34
39
  if (!proof)
35
40
  return "";
36
41
  // Rewriting the input makes auto mode refuse the call, because the input no longer matches
@@ -2,7 +2,7 @@ import fs from "node:fs";
2
2
  import os from "node:os";
3
3
  import path from "node:path";
4
4
  import { readStrictRawSession, selectSaveEvidence, } from "./strict-raw-session.js";
5
- import { resolveSourceSessionFromHookPayload } from "./source-session-hook.js";
5
+ import { DESKTOP_RECORD_WAIT_MS, resolveSourceSessionFromHookPayload } from "./source-session-hook.js";
6
6
  import { validateSourceSnapshot } from "./source-snapshot.js";
7
7
  /** Private-file IPC for Echo Desktop. Stdout never carries conversation contents. */
8
8
  export function exportSourceSnapshot(input) {
@@ -25,6 +25,9 @@ export function exportSourceSnapshot(input) {
25
25
  const identity = resolveSourceSessionFromHookPayload({
26
26
  session_id: nativeId,
27
27
  transcript_path: value.transcriptPath,
28
+ }, {
29
+ includePriorCliIds: true,
30
+ awaitDesktopRecordMs: process.env.CLAUDE_CODE_ENTRYPOINT === "claude-desktop" ? DESKTOP_RECORD_WAIT_MS : 0,
28
31
  });
29
32
  if (!identity ||
30
33
  identity.provider !== value.provider ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@echomem/mcp",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "EchoMem MCP bridge for cross-agent memory, local history import, and recall",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -36,7 +36,7 @@
36
36
  "test:config-safety": "npm run build && node test/config-safety.test.mjs",
37
37
  "test:billing-ui": "npm run build && node test/setup-ui.test.mjs billing",
38
38
  "test:mcp-control": "npm run build && node test/mcp-control.test.mjs",
39
- "test": "npm run build && node test/source-session.test.mjs && node test/source-session-stress.test.mjs && node test/source-session-proof.test.mjs && node test/shared-desktop-proof.test.mjs && node test/cowork-source.test.mjs && node test/source-snapshot-export.test.mjs && node test/cowork-ticket-session.test.mjs && node test/strict-raw-session.test.mjs && node test/agent-messages-fallback.test.mjs && node test/pending-save.test.mjs && node test/save-retry.test.mjs && node test/gemini-save-contract.test.mjs && node test/ticket-review-format.test.mjs && node test/schema-parity.test.mjs && node test/ticket-overview.test.mjs && node test/ticket-stewardship-contract.test.mjs && node test/stewardship-integration.test.mjs && node test/source-session-hook.test.mjs && node test/local-data-paths.test.mjs && node test/crypto.test.mjs && node test/tool-map-cache.test.mjs && node test/integration.test.mjs && node test/onboarding-resilience.test.mjs && node test/local-auth.test.mjs && node test/product-analytics.test.mjs && node test/retrieval-only.test.mjs && node test/no-restart.test.mjs && node test/canonical-golden.test.mjs && node test/tools.test.mjs && node test/workspace-selector.test.mjs && node test/group-map.test.mjs && node test/update-check.test.mjs && node test/headless-runtime.test.mjs && node test/claude-code-config.test.mjs && node test/config-safety.test.mjs && node test/mcp-control.test.mjs && node test/delete.test.mjs && node test/low-touch-tools.test.mjs && node test/migrate.test.mjs && node test/restart-recovery.test.mjs && node test/desktop-save-activity.test.mjs && node test/desktop-presence.test.mjs && node test/desktop-workspace.test.mjs && node test/durable-entry.test.mjs && node test/lifecycle-hook-refresh.test.mjs && node test/durable-reexec.test.mjs && node test/doctor.test.mjs && node test/environment-matrix.test.mjs && node test/request-failure.test.mjs && node test/turn-end-save.test.mjs && node test/in-turn-save.test.mjs && node test/save-receipt.test.mjs && node test/proof-beside-call.test.mjs && node test/code-tab-proof-delivery.test.mjs && node --import tsx test/session-lifecycle.test.mjs && node test/full-turn-reading.test.mjs && node test/memory-links.test.mjs && node test/notch-reply-contract.test.mjs",
39
+ "test": "npm run build && node test/source-session.test.mjs && node test/source-session-stress.test.mjs && node test/source-session-proof.test.mjs && node test/shared-desktop-proof.test.mjs && node test/cowork-source.test.mjs && node test/source-snapshot-export.test.mjs && node test/cowork-ticket-session.test.mjs && node test/strict-raw-session.test.mjs && node test/agent-messages-fallback.test.mjs && node test/pending-save.test.mjs && node test/save-retry.test.mjs && node test/gemini-save-contract.test.mjs && node test/ticket-review-format.test.mjs && node test/schema-parity.test.mjs && node test/ticket-overview.test.mjs && node test/ticket-stewardship-contract.test.mjs && node test/stewardship-integration.test.mjs && node test/source-session-hook.test.mjs && node test/local-data-paths.test.mjs && node test/crypto.test.mjs && node test/tool-map-cache.test.mjs && node test/integration.test.mjs && node test/onboarding-resilience.test.mjs && node test/local-auth.test.mjs && node test/product-analytics.test.mjs && node test/retrieval-only.test.mjs && node test/no-restart.test.mjs && node test/canonical-golden.test.mjs && node test/tools.test.mjs && node test/workspace-selector.test.mjs && node test/group-map.test.mjs && node test/update-check.test.mjs && node test/headless-runtime.test.mjs && node test/claude-code-config.test.mjs && node test/config-safety.test.mjs && node test/mcp-control.test.mjs && node test/delete.test.mjs && node test/low-touch-tools.test.mjs && node test/migrate.test.mjs && node test/restart-recovery.test.mjs && node test/desktop-save-activity.test.mjs && node test/desktop-presence.test.mjs && node test/desktop-workspace.test.mjs && node test/durable-entry.test.mjs && node test/lifecycle-hook-refresh.test.mjs && node test/durable-reexec.test.mjs && node test/doctor.test.mjs && node test/environment-matrix.test.mjs && node test/request-failure.test.mjs && node test/backend-unreachable.test.mjs && node test/turn-end-save.test.mjs && node test/in-turn-save.test.mjs && node test/save-receipt.test.mjs && node test/proof-beside-call.test.mjs && node test/code-tab-proof-delivery.test.mjs && node --import tsx test/session-lifecycle.test.mjs && node test/full-turn-reading.test.mjs && node test/memory-links.test.mjs && node test/notch-reply-contract.test.mjs",
40
40
  "prepack": "npm run build",
41
41
  "test:save-trace": "npm run build && node --test test/save-local-trace.test.mjs",
42
42
  "test:backend-policy": "npm run build && node test/backend-policy.test.mjs"