@echomem/mcp 1.4.65 → 1.4.67

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/README.md CHANGED
@@ -54,17 +54,18 @@ npx -y @echomem/mcp@latest init
54
54
  Windows PowerShell:
55
55
 
56
56
  ```powershell
57
- npx.cmd -y @echomem/mcp@latest connect
57
+ npx.cmd -y @echomem/mcp@latest init
58
58
  ```
59
59
 
60
60
  The one-off `npx` command is the recommended install path; it stages a durable per-user runtime
61
61
  and does not require a global npm install. On Windows, use a new PowerShell window after installing
62
- Node if `npx.cmd` is not found.
62
+ Node if `npx.cmd` is not found. Use `init` for first-time setup and local-history selection; use
63
+ `connect` later for account status, Doctor, repair, and uninstall.
63
64
 
64
65
  | Command | What it does |
65
66
  |---|---|
66
67
  | `npx -y @echomem/mcp@latest connect` | Open Connect Echo for account readiness, per-host setup, Doctor, repair, and uninstall (use `npx.cmd` in Windows PowerShell) |
67
- | `npx -y @echomem/mcp@latest init` | One-command setup for installed agents + login (use `npx.cmd` in Windows PowerShell) |
68
+ | `npx -y @echomem/mcp@latest init` | One-command setup for installed agents, login, and selected local-history import (use `npx.cmd` in Windows PowerShell) |
68
69
  | `npm i -g @echomem/mcp@latest`, then `echomem-mcp init` | Optional global install for a persistent CLI command |
69
70
  | `npm i -g @echomem/mcp@latest && echomem-mcp setup` | Install the CLI globally and configure just the detected editor |
70
71
  | `npx -y @echomem/mcp@latest setup` | One-off setup without keeping a global CLI command |
@@ -85,6 +85,16 @@ export function resolveClaudeProjectsDir(opts = {}) {
85
85
  const root = configuredRoot("CLAUDE_CONFIG_DIR", ".claude", opts);
86
86
  return resolveReadableDirectory(root ? path.join(root, "projects") : null);
87
87
  }
88
+ /**
89
+ * Cursor's per-project data root. Its Agent writes one transcript per conversation at
90
+ * `projects/<slug>/agent-transcripts/<uuid>/<uuid>.jsonl`. Cursor itself honours no profile
91
+ * variable; `CURSOR_HOME` is the override Echo Desktop and this bridge share so tests and
92
+ * relocated profiles can point both at the same directory.
93
+ */
94
+ export function resolveCursorProjectsDir(opts = {}) {
95
+ const root = configuredRoot("CURSOR_HOME", ".cursor", opts);
96
+ return resolveReadableDirectory(root ? path.join(root, "projects") : null);
97
+ }
88
98
  /** Resolve every readable Claude Desktop support directory, including Windows Store/MSIX data. */
89
99
  export function resolveClaudeDesktopSupportRoots(opts = {}) {
90
100
  const homeDir = normalizedHomeDir(opts.homeDir ?? os.homedir());
package/dist/migrate.js CHANGED
@@ -189,7 +189,7 @@ function statSafe(file) {
189
189
  export function normalizeCwd(cwd) {
190
190
  if (!cwd)
191
191
  return null;
192
- const m = cwd.match(/worktrees\/[^/]+\/(.+)$/);
192
+ const m = cwd.match(/worktrees[\\/][^\\/]+[\\/](.+)$/);
193
193
  return m ? m[1] : cwd;
194
194
  }
195
195
  function userCreatedCodexSessionFiles(codexRoot) {
@@ -28,7 +28,7 @@ export const MCP_VAULT_UNLOCK_INSTRUCTION = MCP_DESKTOP_MANAGED
28
28
  ? "open Echo Desktop and unlock the vault there"
29
29
  : "run `echomem-mcp unlock` locally";
30
30
  const MCP_UPDATE_INSTRUCTION = MCP_DESKTOP_MANAGED
31
- ? "Echo Desktop auto-installs compatible MCP updates"
31
+ ? "install the MCP update from Echo Desktop (Settings, MCP)"
32
32
  : `updates auto-install in the background; on failure run \`${MCP_UPDATE_ALL_COMMAND}\``;
33
33
  export const MEMORY_CITATION_INSTRUCTION = 'If the user-facing answer materially relies on one or more EchoMem memories, end it with a compact "EchoMem sources:" list containing only the memories actually used. For memories owned by teammates or accepted friends, call record_memory_citations immediately before the final answer with those exact Memory IDs. Do not cite memories that were merely retrieved. Use each memory key as the Markdown label and its canonical https://echoknows.com/memory/<memory-id> URL. Omit the sources section and citation receipt when no memory informed the answer.';
34
34
  export const SAVED_MEMORY_RECEIPT_INSTRUCTION = 'After save_conversation succeeds and returns one or more saved memory IDs, make the save visible in the final user-facing answer with a compact "EchoMem saved:" list containing every memory created by that call. Use each memory key as the Markdown label and its canonical https://echoknows.com/memory/<memory-id> URL. This save receipt is separate from "EchoMem sources:" and does not imply that the newly saved memories informed the answer.';
@@ -5,7 +5,7 @@ const DURABLE_COMMAND_RE = /\b(?:git\s+commit|npm\s+(?:run\s+)?(?:test|build|lin
5
5
  const DURABLE_LANGUAGE_RE = /\b(?:implemented|fixed|resolved|shipped|deployed|published|committed|milestone|decision|architecture|root cause|tests? pass(?:ed|ing)?|build pass(?:ed|ing)?)\b|(?:实现|修复|解决|发布|提交|里程碑|决定|架构|根因|测试通过|构建通过)/i;
6
6
  const CHECKPOINT_REASON = [
7
7
  "Run EchoMem's private completion checkpoint before finishing this turn.",
8
- "Review the work that just completed. If it produced a durable decision, confirmed preference, implementation, resolved bug, commit, passing verification, release, or project milestone, call `save_conversation` now with a concise structured summary of the outcome, reasoning, relevant files, and constraints.",
8
+ "Review the work that just completed. If it produced a durable decision, confirmed preference, implementation, resolved bug, commit, passing verification, release, or project milestone, call `save_conversation` now. Prefer the `messages` field and omit `conversation`: copy the smallest relevant contiguous set of user and assistant turns verbatim, preserving role and order. Exclude system instructions, tool calls, and hidden content. Use at most six messages and 12,000 total characters; drop whole older turns instead of truncating or rewriting them. If exact source text is unavailable, use `conversation` with a concise structured summary prefixed `Summary (source excerpt unavailable):`.",
9
9
  "Do not save secrets or incidental chatter. If the work was not durable, do not call the tool and finish normally.",
10
10
  "Private persistence happens first. For a user with a company group, call `request_group_session_sharing` near conversation start or after a qualifying private save.",
11
11
  "On the first request_group_session_sharing call in a conversation, omit groupSharingScopeId so EchoMem mints a fresh opaque scope. Reuse that exact scope only in this conversation for later get/request/set/save calls, and never persist it as memory. If multiple groups are returned, reuse the same scope and call once per groupId. Relay the tool's exact text question and call set_group_session_sharing only after an explicit Yes/No. Silence leaves that group's state unset. A Share decision syncs eligible memories from later saves carrying the same scope to that group; saves automatically sync to every approved group. Keep private keeps them private for that group.",
@@ -47,6 +47,11 @@ function toolNamesFromTranscript(transcript) {
47
47
  if ((type === "function_call" || type === "tool_use" || type === "mcp_tool_call")
48
48
  && typeof record.name === "string") {
49
49
  names.push(record.name);
50
+ // Cursor wraps MCP calls as CallDynamicTool and keeps the real tool name in input.toolName.
51
+ const input = record.input;
52
+ if (record.name === "CallDynamicTool" && typeof input?.toolName === "string") {
53
+ names.push(input.toolName);
54
+ }
50
55
  }
51
56
  Object.values(record).forEach(visit);
52
57
  };
@@ -61,7 +66,8 @@ function toolNamesFromTranscript(transcript) {
61
66
  return names;
62
67
  }
63
68
  export function evaluateSaveCheckpoint(payload, transcript) {
64
- if (payload.stop_hook_active === true) {
69
+ // Claude Code and Codex send stop_hook_active; Cursor instead counts auto-submitted follow-ups in loop_count.
70
+ if (payload.stop_hook_active === true || (typeof payload.loop_count === "number" && payload.loop_count >= 1)) {
65
71
  return { decision: "allow", reason: "already_checked" };
66
72
  }
67
73
  if (!transcript) {
@@ -20,6 +20,9 @@ export const SETUP_PAGE_CLIENT_CORE = String.raw ` var params = new URLSear
20
20
  var exStartAt = 0; // extraction start (ms) — drives the countdown
21
21
  var exDeadline = 0; // first honest ETA deadline; passing it while running → "taking longer" banner
22
22
  var extractionEnded = false; // user chose to leave the extraction flow before natural completion
23
+ var setupFinished = false; // a terminal screen is showing; the bridge closing afterwards is expected
24
+ var bridgeStopped = false; // the local bridge closed early; every later action would be refused
25
+ var bridgeStoppedReason = "";
23
26
  var progressPollRunId = 0; // invalidates older progress loops when extraction resumes
24
27
  var dashMounted = false; // dashboard shell mounted once; persists across /stats polls
25
28
  var workspacePath = "";
@@ -121,7 +124,9 @@ export const SETUP_PAGE_CLIENT_CORE = String.raw ` var params = new URLSear
121
124
  '<b>' + esc(label) + '</b>' +
122
125
  '</li>';
123
126
  }).join("");
124
- return '<nav class="setupJourney" aria-label="EchoMem setup progress"><ol>' + items + '</ol></nav>';
127
+ return '<nav class="setupJourney" aria-label="EchoMem setup progress">' +
128
+ '<div class="setupWordmark" aria-label="Echo">echo<span aria-hidden="true">.</span></div>' +
129
+ '<ol>' + items + '</ol></nav>';
125
130
  }
126
131
  function setHead(nextTitle, nextStatus) {
127
132
  title.textContent = nextTitle;
@@ -156,11 +161,51 @@ export const SETUP_PAGE_CLIENT_CORE = String.raw ` var params = new URLSear
156
161
  clearTimeout(timer);
157
162
  }
158
163
  }
164
+ function markBridgeStopped(reason) {
165
+ if (bridgeStopped || setupFinished) return;
166
+ bridgeStopped = true;
167
+ bridgeStoppedReason = reason || "";
168
+ renderBridgeStopped();
169
+ }
170
+ // One refused request is not proof the bridge exited: the browser can drop a connection to a
171
+ // live bridge (sleep, network change). The bridge is gone only if follow-up checks are refused
172
+ // too; a check that times out means it is busy, not gone.
173
+ var bridgeProbe = null;
174
+ function confirmBridgeGone() {
175
+ if (!bridgeProbe) {
176
+ bridgeProbe = (async function () {
177
+ for (var attempt = 1; attempt <= 3; attempt++) {
178
+ await sleep(300 * attempt);
179
+ try {
180
+ await fetchWithTimeout("/config?nonce=" + encodeURIComponent(nonce), { credentials: "omit", cache: "no-store" }, 2000);
181
+ return false;
182
+ } catch (error) {
183
+ if (!error || error.name !== "TypeError") return false;
184
+ }
185
+ }
186
+ return true;
187
+ })().finally(function () { bridgeProbe = null; });
188
+ }
189
+ return bridgeProbe;
190
+ }
191
+ async function bridgeFetch(request) {
192
+ try {
193
+ return await request();
194
+ } catch (error) {
195
+ if (error && error.name === "TypeError" && !bridgeStopped && !setupFinished && await confirmBridgeGone()) {
196
+ markBridgeStopped("");
197
+ throw new Error("Echo setup on this computer has stopped.");
198
+ }
199
+ throw error;
200
+ }
201
+ }
159
202
  async function getJson(path) {
160
203
  var sep = path.indexOf("?") >= 0 ? "&" : "?";
161
- var res = await fetch(path + sep + "nonce=" + encodeURIComponent(nonce), {
162
- credentials: "omit",
163
- cache: "no-store"
204
+ var res = await bridgeFetch(function () {
205
+ return fetch(path + sep + "nonce=" + encodeURIComponent(nonce), {
206
+ credentials: "omit",
207
+ cache: "no-store"
208
+ });
164
209
  });
165
210
  if (!res.ok) throw new Error(await res.text() || ("HTTP " + res.status));
166
211
  return await res.json();
@@ -172,10 +217,13 @@ export const SETUP_PAGE_CLIENT_CORE = String.raw ` var params = new URLSear
172
217
  headers: { "Content-Type": "application/json" },
173
218
  body: JSON.stringify(Object.assign({ nonce: nonce }, body || {}))
174
219
  };
175
- var res = timeoutMs ? await fetchWithTimeout(path, options, timeoutMs) : await fetch(path, options);
220
+ var res = await bridgeFetch(function () {
221
+ return timeoutMs ? fetchWithTimeout(path, options, timeoutMs) : fetch(path, options);
222
+ });
176
223
  var raw = await res.text();
177
224
  var data = {};
178
225
  try { data = raw ? JSON.parse(raw) : {}; } catch (_) {}
226
+ if (!res.ok && data.bridgeClosing === true) markBridgeStopped(data.message || routeError(data.error));
179
227
  if (!res.ok) throw new Error(data.message || data.error || raw || ("HTTP " + res.status));
180
228
  return data;
181
229
  }
@@ -278,8 +326,7 @@ export const SETUP_PAGE_CLIENT_CORE = String.raw ` var params = new URLSear
278
326
  app.className = "localAuthCompleteStage";
279
327
  app.innerHTML =
280
328
  '<section class="localAuthComplete" aria-labelledby="localAuthCompleteTitle">' +
281
- '<img src="/hud-assets/echo-face-cutout.png" alt="" />' +
282
- '<h2 id="localAuthCompleteTitle">You\'re signed in.</h2>' +
329
+ '<h2 id="localAuthCompleteTitle">You\'re <strong>signed in.</strong></h2>' +
283
330
  '<p>Return to your terminal.</p>' +
284
331
  '<p class="localAuthCompleteNext">Run <code>echomem-mcp init</code> when you\'re ready to start onboarding.</p>' +
285
332
  '</section>';
@@ -30,6 +30,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
30
30
  app.innerHTML = '<div style="padding:24px"><h2>Signing this device out</h2><p class="helper">If Echo is scanning local files, this can take a few seconds to answer.</p></div>';
31
31
  }
32
32
  function renderLogoutIssue(error) {
33
+ if (bridgeStopped) return void renderBridgeStopped();
33
34
  setHead("Sign out did not finish", "Needs attention");
34
35
  app.className = "loading-panel";
35
36
  app.innerHTML =
@@ -39,6 +40,24 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
39
40
  '<div class="actions"><button id="logout" class="secondary">Retry sign out</button></div></div>';
40
41
  var lo = document.getElementById("logout"); if (lo) lo.onclick = localLogout;
41
42
  }
43
+ function renderBridgeStopped() {
44
+ stopBillingPoll();
45
+ var picker = document.getElementById("sessionPicker");
46
+ if (picker && picker.open && typeof picker.close === "function") picker.close();
47
+ setExtractMode(false);
48
+ setReadyMode(true);
49
+ setHead("Echo setup stopped", "Stopped");
50
+ app.className = "loading-panel";
51
+ // Once extraction started, the terminal holds the outcome; it may have finished normally.
52
+ var helper = lastExtractionProgress
53
+ ? 'The setup command in your terminal has ended. Check the terminal for the final import result; memories already saved stay saved. Run <code>echomem-mcp init</code> again to import more.'
54
+ : 'The setup command in your terminal has ended, so this page can no longer import history or open checkout. Run <code>echomem-mcp init</code> again and continue in the new page it opens.';
55
+ app.innerHTML =
56
+ '<div style="padding:24px"><h2>Echo setup stopped</h2>' +
57
+ '<p class="helper">' + helper + '</p>' +
58
+ (bridgeStoppedReason ? '<div class="warning" style="margin-top:16px;margin-bottom:0">' + esc(bridgeStoppedReason) + '</div>' : '') +
59
+ '</div>';
60
+ }
42
61
  async function waitForStats() {
43
62
  if (statsPollStarted) return;
44
63
  var statsEpoch = accountStateEpoch;
@@ -108,6 +127,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
108
127
  if (skipPlan) skipPlan.onclick = skip;
109
128
  }
110
129
  function renderDashboard(error) {
130
+ if (bridgeStopped) return void renderBridgeStopped();
111
131
  setExtractMode(false);
112
132
  setReadyMode(true);
113
133
  var migratable = stats && stats.migratable ? stats.migratable : {};
@@ -142,7 +162,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
142
162
  var currentPlan = String(billingStatus && billingStatus.plan || "").toLowerCase();
143
163
  var currentPlanLabel = paidRecallPlan(currentPlan)
144
164
  ? currentPlan.charAt(0).toUpperCase() + currentPlan.slice(1) + " Echo"
145
- : "Original Echo";
165
+ : "Free Echo";
146
166
  setHead("Turn coding history into memory", degradedWithoutCounts ? "Ready" : (pendingTrusted ? (knownDone ? "Done" : "Ready") : (localScanReady ? "Ready" : "Scanning")));
147
167
  var headlineHtml = degradedWithoutCounts
148
168
  ? "Local history counting <strong>couldn’t finish.</strong>"
@@ -185,7 +205,6 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
185
205
  '<div id="exBanner"></div>' +
186
206
  '<section class="readyDecision extractionReady">' +
187
207
  '<div class="readyHero">' +
188
- '<img class="readyMascot" src="/hud-assets/echo-face-cutout.png" alt="" />' +
189
208
  '<div class="exCopy">' +
190
209
  '<h2 class="siteHeadline" id="exHeadline"></h2>' +
191
210
  '<p class="exSub" id="exSub"></p>' +
@@ -278,7 +297,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
278
297
  // blocked start into a silent bounce back to the dashboard — or all the way to the plan gate,
279
298
  // because a billing refresh can flip setupPlanConfirmed() while the picker is open.
280
299
  function migrateBlockedReason() {
281
- if (!setupPlanConfirmed()) return "Choose Original, Pro, or Power to bring Echo home.";
300
+ if (!setupPlanConfirmed()) return "Choose Free, Pro, or Power to bring Echo home.";
282
301
  if (!selectedSessionKeyList().length) return "Choose at least one conversation to extract.";
283
302
  return "";
284
303
  }
@@ -371,6 +390,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
371
390
  progress = await getJson("/progress");
372
391
  failures = 0;
373
392
  } catch (_) {
393
+ if (bridgeStopped) return;
374
394
  failures++;
375
395
  var reconnecting = Object.assign({
376
396
  status: "running",
@@ -394,12 +414,13 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
394
414
  }
395
415
  }
396
416
  function renderProgress(progress) {
397
- if (extractionEnded) return;
417
+ if (extractionEnded || bridgeStopped) return;
398
418
  lastExtractionProgress = progress;
399
419
  setExtractMode(true);
400
420
  var status = progress.status;
401
421
  var done = status === "completed";
402
422
  var stopped = status === "failed";
423
+ if (done || stopped) setupFinished = true;
403
424
  var total = progress.total || progress.jobCount || 0;
404
425
  var completed = progress.completed || 0;
405
426
  var failed = progress.failed || 0;
@@ -1137,82 +1158,75 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
1137
1158
  id: "power",
1138
1159
  name: "Power",
1139
1160
  homeName: "Power",
1140
- promise: "More room. More agents. Much more Echo.",
1141
1161
  price: "$100",
1142
1162
  cadence: trialAvailable ? "per month · 14-day trial" : "per month · billed immediately",
1143
- sticker: "/hud-assets/echo-pricing-power-sticker.png",
1144
- stickerAlt: "Power Echo arrives with a gold key and a crew of notebook helpers.",
1145
1163
  features: features
1146
1164
  };
1147
1165
  if (plan === "pro") return {
1148
1166
  id: "pro",
1149
1167
  name: "Pro",
1150
1168
  homeName: "Pro",
1151
- promise: "A room for the work you return to every day.",
1152
1169
  price: "$20",
1153
1170
  cadence: trialAvailable ? "per month · 14-day trial" : "per month · billed immediately",
1154
- sticker: "/hud-assets/echo-pricing-pro-sticker.png",
1155
- stickerAlt: "Pro Echo organizes tabbed notebooks and a daily refresh control.",
1156
- popular: true,
1157
1171
  features: features
1158
1172
  };
1159
1173
  return {
1160
1174
  id: "free",
1161
1175
  name: "Free",
1162
- homeName: "Original",
1163
- promise: "A little corner is enough to start.",
1176
+ homeName: "Free",
1164
1177
  price: "$0",
1165
1178
  cadence: "free forever · no card needed",
1166
- sticker: "/hud-assets/echo-pricing-free-sticker.png",
1167
- stickerAlt: "Original Echo hugs one simple memory card.",
1168
1179
  features: features
1169
1180
  };
1170
1181
  }
1171
1182
  function renderPlanHabitat() {
1172
1183
  setupPlanPreview = setupPlanPreview === "pro" || setupPlanPreview === "power" ? setupPlanPreview : "free";
1173
1184
  var plan = setupPlanDefinition(setupPlanPreview);
1174
- var tabs = ["free", "pro", "power"].map(function (id) {
1175
- var tab = setupPlanDefinition(id);
1185
+ var trialOn = !billingStatus || billingStatus.trialAvailable !== false;
1186
+ // The desktop app's plan grid: three ruled columns, the chosen one inverted, one action below.
1187
+ var columns = ["free", "pro", "power"].map(function (id) {
1188
+ var column = setupPlanDefinition(id);
1176
1189
  var selected = id === plan.id;
1177
- return '<button type="button" class="mvpPlanTab" id="planTab-' + id + '" data-plan-tab="' + id + '" role="tab" aria-selected="' + (selected ? "true" : "false") + '" aria-controls="activePlanHabitat"><span>' + esc(tab.homeName) + '</span><b>' + esc(tab.price) + '</b></button>';
1178
- }).join("");
1179
- var facts = plan.features.map(function (feature) {
1180
- return '<li>' + setupIcon("check") + '<span>' + esc(feature) + '</span></li>';
1190
+ var billingNote = id === "free" ? "" : (trialOn ? "14 days free" : "Billed immediately");
1191
+ var accessibleName = column.homeName + " " + column.price + " " + (id === "free" ? "forever" : "/ month") + (billingNote ? " · " + billingNote : "");
1192
+ var facts = column.features.map(function (feature) {
1193
+ return '<li>' + setupIcon("check") + '<span>' + esc(feature) + '</span></li>';
1194
+ }).join("");
1195
+ return '<div class="planColumn' + (selected ? " is-selected" : "") + '" id="planTab-' + id + '" data-plan-tab="' + id + '" role="radio" tabindex="0" aria-checked="' + (selected ? "true" : "false") + '" aria-label="' + esc(accessibleName) + '">' +
1196
+ '<span class="planColumnHead"><span class="planColumnState">' + (selected ? "Selected" : "") + '</span><span class="planColumnMark" aria-hidden="true">' + (selected ? setupIcon("check") : "") + '</span></span>' +
1197
+ '<span class="planColumnName">' + esc(column.homeName) + '</span>' +
1198
+ '<span class="planColumnPrice"><strong>' + esc(column.price) + '</strong><span>' + (id === "free" ? "forever" : "/ month") + '</span></span>' +
1199
+ '<span class="planColumnTrial' + (billingNote ? "" : " is-hidden") + '"' + (billingNote ? "" : ' aria-hidden="true"') + '>' + (billingNote || "14 days free") + '</span>' +
1200
+ '<ul class="planColumnFacts">' + facts + '</ul>' +
1201
+ '</div>';
1181
1202
  }).join("");
1182
1203
  var chooseId = plan.id === "free" ? "chooseFreePlan" : (plan.id === "power" ? "choosePowerPlan" : "chooseProPlan");
1183
1204
  var chooseLabel = plan.id === "free"
1184
- ? "Continue with " + plan.homeName + " — Free"
1185
- : ((!billingStatus || billingStatus.trialAvailable !== false)
1205
+ ? "Continue with " + plan.homeName
1206
+ : (trialOn
1186
1207
  ? "Start " + plan.homeName + " trial — $0 today"
1187
1208
  : "Subscribe to " + plan.homeName);
1188
1209
  return '<section class="mvpPricing" aria-labelledby="setupPlanHeading">' +
1189
- '<header class="mvpPricingIntro"><h2 id="setupPlanHeading">Choose your Echo.</h2></header>' +
1190
- '<div class="mvpPlanTabs" role="tablist" aria-label="Choose an Echo plan">' + tabs + '</div>' +
1191
- '<article class="mvpPlanHabitat" id="activePlanHabitat" role="tabpanel" aria-labelledby="planTab-' + plan.id + '" data-plan="' + plan.id + '">' +
1192
- '<div class="mvpHabitatScene">' +
1193
- '<div class="mvpHabitatWindow" aria-hidden="true"></div>' +
1194
- '<div class="mvpHabitatShelf" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></div>' +
1195
- '<div class="mvpHabitatRug" aria-hidden="true"></div>' +
1196
- '<img class="mvpHabitatEcho" src="' + esc(plan.sticker) + '" alt="' + esc(plan.stickerAlt) + '" />' +
1197
- '</div>' +
1198
- '<div class="mvpHabitatDetails">' +
1199
- '<div class="mvpPlanIdentity"><span>' + esc(plan.name) + '</span>' + (plan.popular ? "<b>Echo&rsquo;s pick</b>" : "") + '</div>' +
1200
- '<h3>' + esc(plan.homeName) + ' Echo</h3>' +
1201
- '<div class="mvpPlanPrice"><strong>' + esc(plan.price) + '</strong><span>' + esc(plan.cadence) + '</span></div>' +
1202
- '<ul class="mvpPlanFacts">' + facts + '</ul>' +
1203
- '<button type="button" class="primary mvpPlanCta" id="' + chooseId + '">' + esc(chooseLabel) + ' <span aria-hidden="true">→</span></button>' +
1204
- '</div>' +
1205
- '</article>' +
1210
+ '<header class="mvpPricingIntro"><h2 id="setupPlanHeading">Choose your <strong>Echo.</strong></h2><p>Choose how much past work Echo can bring with you.</p></header>' +
1211
+ '<div class="planGrid" role="radiogroup" aria-label="Choose an Echo plan">' + columns + '</div>' +
1212
+ '<div class="planGridAction"><button type="button" class="primary mvpPlanCta" id="' + chooseId + '">' + esc(chooseLabel) + ' <span aria-hidden="true">→</span></button></div>' +
1206
1213
  '<p class="mvpPlanStatus" id="setupPlanStatus" role="status"></p>' +
1214
+ '<p class="mvpTeamPlanLink">Buying for a team? <a href="https://echoknows.com/dashboard/workspace/billing" target="_blank" rel="noopener noreferrer">Set up a team plan on the web</a>. Use code <strong class="mvpTeamPlanCode">TEAM80</strong> at checkout for 80% off every seat for your first year.</p>' +
1207
1215
  '</section>';
1208
1216
  }
1209
1217
  function bindPlanHabitat() {
1210
1218
  Array.prototype.forEach.call(document.querySelectorAll("[data-plan-tab]"), function (tab) {
1211
- tab.onclick = function () {
1219
+ var select = function () {
1212
1220
  setupPlanPreview = tab.getAttribute("data-plan-tab") || "free";
1213
1221
  var slot = document.getElementById("setupPlan");
1214
1222
  if (slot) slot.innerHTML = renderPlanHabitat();
1215
1223
  bindPlanHabitat();
1224
+ var next = document.getElementById("planTab-" + setupPlanPreview);
1225
+ if (next) next.focus({ preventScroll: true });
1226
+ };
1227
+ tab.onclick = select;
1228
+ tab.onkeydown = function (event) {
1229
+ if (event.key === "Enter" || event.key === " ") { event.preventDefault(); select(); }
1216
1230
  };
1217
1231
  });
1218
1232
  var free = document.getElementById("chooseFreePlan");
@@ -1297,7 +1311,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
1297
1311
  var freePlanCopy = freeLimits
1298
1312
  ? quotaNumber(freeLimits.historicalConversationLimit) + " coding sessions and " + quotaNumber(freeLimits.memorySearchWeeklyLimit) + " memory recalls each week."
1299
1313
  : "Your managed import and weekly memory allowances are ready.";
1300
- slot.innerHTML = '<div class="setupPlanConfirmed"><span class="setupPlanConfirmedIcon" aria-hidden="true">' + setupIcon("check") + '</span><span class="setupPlanConfirmedCopy"><strong>Original Echo</strong><span>' + esc(freePlanCopy) + '</span></span><button type="button" class="textButton" id="changeSetupPlan">Change</button></div>';
1314
+ slot.innerHTML = '<div class="setupPlanConfirmed"><span class="setupPlanConfirmedIcon" aria-hidden="true">' + setupIcon("check") + '</span><span class="setupPlanConfirmedCopy"><strong>Free Echo</strong><span>' + esc(freePlanCopy) + '</span></span><button type="button" class="textButton" id="changeSetupPlan">Change</button></div>';
1301
1315
  renderBillingCommitment("");
1302
1316
  var changeBtn = document.getElementById("changeSetupPlan");
1303
1317
  if (changeBtn) changeBtn.onclick = function () {
@@ -1415,14 +1429,14 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
1415
1429
  renderAccountChoice();
1416
1430
  renderSessionSelection(true);
1417
1431
  }
1418
- if (billingStatus && billingStatus.plan === "unknown") setSetupPlanStatus("Plan check unavailable. Original still works.");
1432
+ if (billingStatus && billingStatus.plan === "unknown") setSetupPlanStatus("Plan check unavailable. Free still works.");
1419
1433
  } catch (_) {
1420
1434
  if (billingEpoch !== accountStateEpoch || !connected) return;
1421
1435
  billingLastCheckedAt = Date.now();
1422
1436
  billingCheckMessage = "Could not check payment yet. Echo will keep trying automatically.";
1423
1437
  var fellBackToFree = applyFreePlanFallback();
1424
1438
  if (fellBackToFree && stats) renderDashboard();
1425
- setSetupPlanStatus("Plan check unavailable. Original still works.");
1439
+ setSetupPlanStatus("Plan check unavailable. Free still works.");
1426
1440
  } finally {
1427
1441
  if (billingEpoch === accountStateEpoch) billingStatusLoading = false;
1428
1442
  }
@@ -1538,6 +1552,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
1538
1552
  '</section>';
1539
1553
  }
1540
1554
  function renderSkipped() {
1555
+ setupFinished = true;
1541
1556
  setExtractMode(true);
1542
1557
  setHead("Extraction ended for now", "Ended");
1543
1558
  app.className = "";
@@ -9,9 +9,8 @@ export const SETUP_PAGE_CLIENT_LIFECYCLE = String.raw ` /* ---------- local
9
9
  setupJourney(1) +
10
10
  '<section class="mvpConsent" aria-labelledby="mvpConsentTitle">' +
11
11
  '<div class="mvpConsentHero">' +
12
- '<img class="mvpConsentEcho" src="/hud-assets/echo-face-cutout.png" alt="" />' +
13
12
  '<div class="mvpConsentPitch">' +
14
- '<h2 id="mvpConsentTitle">Start with the context you’ve already built.</h2>' +
13
+ '<h2 id="mvpConsentTitle">Start with the context <strong>you’ve already built.</strong></h2>' +
15
14
  '<p class="mvpConsentIntro">Choose which local coding conversations to bring into EchoMem.</p>' +
16
15
  '</div>' +
17
16
  '</div>' +
@@ -29,6 +28,35 @@ export const SETUP_PAGE_CLIENT_LIFECYCLE = String.raw ` /* ---------- local
29
28
  node.classList.toggle("is-required", tone === "required");
30
29
  }
31
30
  }
31
+ function renderInactiveSetupPage() {
32
+ setExtractMode(false);
33
+ setReadyMode(true);
34
+ setHead("Setup session ended", "Reconnect");
35
+ app.className = "consentStage mvpConsentStage";
36
+ var isWindows = /Win/i.test(String((navigator && navigator.platform) || "")) || /Windows/i.test(navigator.userAgent || "");
37
+ var restartCommand = (isWindows ? "npx.cmd" : "npx") + " -y @echomem/mcp@latest init";
38
+ app.innerHTML =
39
+ setupJourney(1) +
40
+ '<section class="mvpConsent" aria-labelledby="inactiveSetupTitle">' +
41
+ '<div class="mvpConsentHero">' +
42
+ '<img class="mvpConsentEcho" src="/hud-assets/echo-face-cutout.png" alt="" />' +
43
+ '<div class="mvpConsentPitch">' +
44
+ '<h2 id="inactiveSetupTitle">This setup page is no longer active.</h2>' +
45
+ '<p class="mvpConsentIntro">The temporary EchoMem process on this computer is not reachable.</p>' +
46
+ '</div>' +
47
+ '</div>' +
48
+ '<p class="mvpConsentTrustLine">Return to the terminal that opened this page. If it has ended, run <code>' + esc(restartCommand) + '</code> and use the new tab.</p>' +
49
+ '<button type="button" class="primary mvpPrimary" id="retrySetupConnection">Retry connection <span aria-hidden="true">→</span></button>' +
50
+ '<p class="consentFine" id="inactiveSetupStatus" role="status" aria-live="polite"></p>' +
51
+ '</section>';
52
+ var retry = document.getElementById("retrySetupConnection");
53
+ if (retry) retry.onclick = function () {
54
+ retry.disabled = true;
55
+ var retryStatus = document.getElementById("inactiveSetupStatus");
56
+ if (retryStatus) retryStatus.textContent = "Checking the local setup process…";
57
+ void init();
58
+ };
59
+ }
32
60
  function continueAfterLocalHistoryConsent() {
33
61
  if (connected) {
34
62
  try { void refreshBillingStatus(); } catch (_) {}
@@ -61,7 +89,10 @@ export const SETUP_PAGE_CLIENT_LIFECYCLE = String.raw ` /* ---------- local
61
89
  continueAfterLocalHistoryConsent();
62
90
  return;
63
91
  }
64
- } catch (_) {}
92
+ } catch (_) {
93
+ renderInactiveSetupPage();
94
+ return;
95
+ }
65
96
  if (allow) allow.disabled = false;
66
97
  setConsentStatus(error && error.message ? error.message : "Could not save local-history access.", "required");
67
98
  }
@@ -99,7 +130,10 @@ export const SETUP_PAGE_CLIENT_LIFECYCLE = String.raw ` /* ---------- local
99
130
  consentRequired = cfg.consentRequired !== false;
100
131
  consentGranted = cfg.consentGranted === true;
101
132
  localHistoryConsentGranted = consentGranted;
102
- } catch (_) {}
133
+ } catch (_) {
134
+ renderInactiveSetupPage();
135
+ return;
136
+ }
103
137
  if (setupFlow === "login") {
104
138
  if (connected) renderLocalLoginComplete();
105
139
  else renderLocalLogin("");
@@ -29,7 +29,7 @@ export function renderSetupPageDocument(options) {
29
29
  <title>EchoMem Device Setup</title>
30
30
  <link rel="preconnect" href="https://fonts.googleapis.com" />
31
31
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32
- <link href="https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&display=swap" rel="stylesheet" />
32
+ <link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,700&display=swap" rel="stylesheet" />
33
33
  <style>
34
34
  ${SETUP_PAGE_STYLES} </style>${SETUP_PAGE_BODY}${renderSetupPageClient(options.previewState, options.startupScript)}
35
35
  </body>
@@ -617,12 +617,6 @@ export const SETUP_PAGE_STYLES_EXTRACTION = String.raw ` /* ---- dashboard (p
617
617
  gap: 13px;
618
618
  margin: 0 auto;
619
619
  }
620
- .readyMascot {
621
- width: 76px;
622
- height: 76px;
623
- object-fit: contain;
624
- filter: drop-shadow(0 12px 18px rgba(26,58,143,0.18));
625
- }
626
620
  .readyHero .exCopy h2 {
627
621
  margin: 0;
628
622
  max-width: 790px;
@@ -1508,7 +1502,6 @@ export const SETUP_PAGE_STYLES_EXTRACTION = String.raw ` /* ---- dashboard (p
1508
1502
  @media (max-width: 820px) {
1509
1503
  .exHero, .resultTop, .finishStats, .agentLaunch, .sourceGrid, .readySteps, .readyRun, .readyAction { grid-template-columns: 1fr; }
1510
1504
  .readyHero { grid-template-columns: 1fr; }
1511
- .readyMascot { width: 76px; height: 76px; }
1512
1505
  .readyDecision .actions { justify-content: stretch; }
1513
1506
  .readyDecision .actions .primary { width: 100%; }
1514
1507
  .resultNumber span { text-align: left; }
@@ -2093,11 +2086,6 @@ export const SETUP_PAGE_STYLES_EXTRACTION = String.raw ` /* ---- dashboard (p
2093
2086
  border-bottom: 1px solid #d7d8d3;
2094
2087
  padding: clamp(26px, 4vw, 42px) clamp(22px, 4vw, 34px);
2095
2088
  }
2096
- .readyMascot {
2097
- width: 84px;
2098
- height: 84px;
2099
- filter: none;
2100
- }
2101
2089
  .readyHero .exCopy h2 {
2102
2090
  max-width: 760px;
2103
2091
  font-size: clamp(38px, 5vw, 60px);
@@ -2468,7 +2456,6 @@ export const SETUP_PAGE_STYLES_EXTRACTION = String.raw ` /* ---- dashboard (p
2468
2456
  .readyDecision { max-width: 100%; gap: 0; border-left-width: 4px; }
2469
2457
  .readyEyebrow { padding: 12px 18px; }
2470
2458
  .readyHero { grid-template-columns: 1fr; gap: 14px; padding: 24px 18px; }
2471
- .readyMascot { width: 68px; height: 68px; }
2472
2459
  .readyHero .exCopy h2 { font-size: clamp(34px, 11vw, 48px); }
2473
2460
  .readyHero .exCopy .exSub { font-size: 15px; }
2474
2461
  .proofStrip { max-width: 100%; border-radius: 0; padding: 9px 18px; }
@@ -1,33 +1,45 @@
1
1
  // Generated from the prior inline setup page. This content is emitted into one browser IIFE/style tag.
2
2
  export const SETUP_PAGE_STYLES_FOUNDATION = String.raw ` :root {
3
3
  color-scheme: light;
4
- --echo-ink-primary: #1a3a8f;
5
- --echo-ink-accent: #4ecdc4;
6
- --echo-ink-seal: #c7372f;
7
- --echo-ink-text: #2b2a26;
8
- --echo-ink-mute: #6b6f69;
9
- --echo-ink-faint: #9a9b94;
10
- --echo-paper-canvas: #faf7f0;
4
+ /* The website's "monochrome canvas" system (WebPageReactVersion/DESIGN.md), value for
5
+ value with the desktop app's OnboardingPalette, so the CLI setup page reads as the
6
+ same product as echoknows.com and Echo for Mac. */
7
+ --echo-ink-primary: #111111;
8
+ --echo-ink-accent: #6f7de8;
9
+ --echo-ink-seal: #9a3f35;
10
+ --echo-ink-text: #111111;
11
+ --echo-ink-graphite: #3e3e3c;
12
+ --echo-ink-mute: #6b6b68;
13
+ --echo-ink-faint: #9c9c98;
14
+ --echo-paper-canvas: #f4f4f2;
11
15
  --echo-paper-white: #ffffff;
12
- --echo-paper-soft: #f0efe9;
13
- --echo-line-soft: #e4e0d6;
14
- --echo-ink-accent-deep: #2f9d93;
15
- --echo-night: #8b95cf;
16
- --rdo-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
17
- --echo-font-brand: "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
18
- --echo-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
19
- --echo-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
16
+ --echo-paper-soft: #ececea;
17
+ --echo-line-soft: #d7d7d2;
18
+ --echo-line-card: #dededa;
19
+ --echo-line-field-hover: #92928e;
20
+ --echo-line-checkbox: #9c9c98;
21
+ --echo-ink-accent-deep: #3e3e3c;
22
+ --echo-night: #6f7de8;
23
+ --echo-logo-dot: #4169e1;
24
+ --echo-disabled-fill: #dedddb;
25
+ --echo-disabled-ink: #6b6b68;
26
+ --rdo-ease: cubic-bezier(0.16, 1, 0.3, 1);
27
+ --echo-font-brand: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
28
+ --echo-font-body: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
29
+ /* Labels and eyebrows were set in mono; the website sets them in Poppins small caps. */
30
+ --echo-font-mono: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
31
+ --echo-font-code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
20
32
  --bg: var(--echo-paper-canvas);
21
33
  --ink: var(--echo-ink-text);
22
34
  --muted: var(--echo-ink-mute);
23
35
  --line: var(--echo-line-soft);
24
36
  --panel: var(--echo-paper-white);
25
- --good-bg: #eff7ec;
26
- --good-line: #cbd9c8;
27
- --warn-bg: #fff6dc;
28
- --warn-line: #edce79;
29
- --error-bg: #fff1ef;
30
- --error-line: #e7aaa2;
37
+ --good-bg: #f2f4f0;
38
+ --good-line: #cfd6cb;
39
+ --warn-bg: #f7f3e8;
40
+ --warn-line: #d9cdae;
41
+ --error-bg: #f9f4f3;
42
+ --error-line: #c7b0a9;
31
43
  }
32
44
  * { box-sizing: border-box; }
33
45
  body {