@echomem/mcp 1.4.64 → 1.4.66

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 |
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import { clearBillingAlert, writeBillingAlert } from "./billing-alert.js";
17
17
  import { checkLatestUpdateStatus, formatUpdateNotice, formatUpdateStatusText, startBackgroundUpdateCheck, } from "./update-check.js";
18
18
  import { autoUpdateHeadlessRuntime } from "./headless-runtime.js";
19
19
  import { formatTicketFilingPacket, formatWorkspaceTicketOverview, ticketAddressById, } from "./ticket-review-format.js";
20
- import { SOURCE_SESSION_CLOUD_TOOL_ARGUMENT_EVIDENCE, resolveCloudCoworkSessionFromToolArguments, resolveSourceSessionRequestContext, resolveSourceSessionFromBindingToken, } from "./source-session.js";
20
+ import { SOURCE_SESSION_CLOUD_TOOL_ARGUMENT_EVIDENCE, resolveCloudCoworkSessionFromToolArguments, resolveSourceSessionRequestContext, resolveSourceSessionFromBindingToken, resolveSourceSessionFromBindingTokenWithRetry, } from "./source-session.js";
21
21
  const ECHO_API_BASE_URL = process.env.ECHO_API_BASE_URL || "https://echo-mem-chrome.vercel.app";
22
22
  const ECHO_PRICING_URL = process.env.ECHO_PRICING_URL || "https://echoknows.com/account";
23
23
  const ECHO_MEMORY_WEB_URL = (process.env.ECHO_MEMORY_WEB_URL || "https://echoknows.com/memory").replace(/\/$/, "");
@@ -1777,6 +1777,25 @@ class EchoMemMCPServer {
1777
1777
  if (provisionalCloudSession && sourceResolution.sourceSession) {
1778
1778
  throw new McpError(ErrorCode.InvalidParams, "This request already has a verified local source session. Omit cloudCoworkSessionId rather than mixing identities.");
1779
1779
  }
1780
+ const sourceSessionBindingToken = isRecord(toolArgs)
1781
+ && typeof toolArgs.sourceSessionBindingToken === "string"
1782
+ ? toolArgs.sourceSessionBindingToken
1783
+ : null;
1784
+ if (sourceSessionBindingToken && (sourceResolution.sourceSession || provisionalCloudSession)) {
1785
+ throw new McpError(ErrorCode.InvalidParams, "This request already has a source-session identity. Omit sourceSessionBindingToken rather than mixing identities.");
1786
+ }
1787
+ if (sourceSessionBindingToken) {
1788
+ try {
1789
+ sourceResolution = {
1790
+ sourceSession: await resolveSourceSessionFromBindingTokenWithRetry(sourceSessionBindingToken, { hostPlatform: this.getMcpClientAnalytics().host_platform }),
1791
+ isSubagent: false,
1792
+ lineageStatus: "not_applicable",
1793
+ };
1794
+ }
1795
+ catch (error) {
1796
+ throw new McpError(ErrorCode.InvalidParams, error instanceof Error ? error.message : "Could not verify the local source session");
1797
+ }
1798
+ }
1780
1799
  if (provisionalCloudSession) {
1781
1800
  sourceResolution = {
1782
1801
  sourceSession: provisionalCloudSession,
@@ -2376,7 +2395,8 @@ Details: ${m.details || "N/A"}`)
2376
2395
  "Final: false",
2377
2396
  `Ticket ${parsed.ticketId} was accepted for verified source-session discovery.`,
2378
2397
  "This is not a failed link. Echo Desktop can finish it asynchronously from the structured ticket marker or this exact local tool invocation.",
2379
- "The agent cannot verify final completion from this shared MCP request; use the ticket Activity as the current final-state evidence.",
2398
+ "For immediate request-scoped completion, retry once with a fresh random UUID in sourceSessionBindingToken. Never reuse that token or copy one from another conversation.",
2399
+ "If the retry cannot verify exactly one local transcript, leave Desktop recovery in place and use ticket Activity as the final-state evidence.",
2380
2400
  "Do not guess a context ID or call bind_source_session on the user's behalf unless its documented compatibility fallback is actually needed.",
2381
2401
  ].join("\n"),
2382
2402
  }],
@@ -2454,7 +2474,8 @@ Details: ${m.details || "N/A"}`)
2454
2474
  text: [
2455
2475
  "Status: source_session_unavailable",
2456
2476
  "No verified source-session identity is available for this request, so EchoMem cannot review its ticket assignment.",
2457
- "Do not guess or ask the user for a context ID. Retry after automatic source-session binding is available.",
2477
+ "Retry this exact operation once with a fresh random UUID in sourceSessionBindingToken. The bridge verifies it from this tool call in the local host JSONL and keeps the identity request-scoped.",
2478
+ "Never reuse that token, copy one from another conversation, guess a context ID, or ask the user for one.",
2458
2479
  ].join("\n"),
2459
2480
  }],
2460
2481
  };
@@ -2587,7 +2608,7 @@ Details: ${m.details || "N/A"}`)
2587
2608
  text: [
2588
2609
  "Status: source_session_unavailable",
2589
2610
  "No verified source-session identity is available, so EchoMem cannot build a filing packet for this conversation.",
2590
- "Do not guess or ask the user for a context ID. Retry after automatic source-session binding is available.",
2611
+ "Retry this exact operation once with a fresh random UUID in sourceSessionBindingToken. Never reuse the token, copy one from another conversation, guess a context ID, or ask the user for one.",
2591
2612
  ].join("\n"),
2592
2613
  }],
2593
2614
  };
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) {
@@ -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.",
@@ -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 : {};
@@ -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>' +
@@ -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,74 @@ 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
1176
  homeName: "Original",
1163
- promise: "A little corner is enough to start.",
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
1205
  ? "Continue with " + plan.homeName + " — Free"
1185
- : ((!billingStatus || billingStatus.trialAvailable !== false)
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>' +
1207
1214
  '</section>';
1208
1215
  }
1209
1216
  function bindPlanHabitat() {
1210
1217
  Array.prototype.forEach.call(document.querySelectorAll("[data-plan-tab]"), function (tab) {
1211
- tab.onclick = function () {
1218
+ var select = function () {
1212
1219
  setupPlanPreview = tab.getAttribute("data-plan-tab") || "free";
1213
1220
  var slot = document.getElementById("setupPlan");
1214
1221
  if (slot) slot.innerHTML = renderPlanHabitat();
1215
1222
  bindPlanHabitat();
1223
+ var next = document.getElementById("planTab-" + setupPlanPreview);
1224
+ if (next) next.focus({ preventScroll: true });
1225
+ };
1226
+ tab.onclick = select;
1227
+ tab.onkeydown = function (event) {
1228
+ if (event.key === "Enter" || event.key === " ") { event.preventDefault(); select(); }
1216
1229
  };
1217
1230
  });
1218
1231
  var free = document.getElementById("chooseFreePlan");
@@ -1538,6 +1551,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
1538
1551
  '</section>';
1539
1552
  }
1540
1553
  function renderSkipped() {
1554
+ setupFinished = true;
1541
1555
  setExtractMode(true);
1542
1556
  setHead("Extraction ended for now", "Ended");
1543
1557
  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 {