@echomem/mcp 1.4.66 → 1.4.68

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
@@ -3506,7 +3506,7 @@ Details: ${m.details || "N/A"}`;
3506
3506
  text: [
3507
3507
  `Invite code for ${payload?.group?.name ?? "your group"}: ${payload?.code}`,
3508
3508
  `Expires: ${payload?.expiresAt}`,
3509
- `Maximum uses: ${payload?.maxUses}`,
3509
+ "Anyone with this code can join until it expires.",
3510
3510
  "Share this secret code only with intended teammates.",
3511
3511
  ].join("\n"),
3512
3512
  }],
@@ -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());
@@ -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.';
@@ -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) {
@@ -162,7 +162,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
162
162
  var currentPlan = String(billingStatus && billingStatus.plan || "").toLowerCase();
163
163
  var currentPlanLabel = paidRecallPlan(currentPlan)
164
164
  ? currentPlan.charAt(0).toUpperCase() + currentPlan.slice(1) + " Echo"
165
- : "Original Echo";
165
+ : "Free Echo";
166
166
  setHead("Turn coding history into memory", degradedWithoutCounts ? "Ready" : (pendingTrusted ? (knownDone ? "Done" : "Ready") : (localScanReady ? "Ready" : "Scanning")));
167
167
  var headlineHtml = degradedWithoutCounts
168
168
  ? "Local history counting <strong>couldn’t finish.</strong>"
@@ -297,7 +297,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
297
297
  // blocked start into a silent bounce back to the dashboard — or all the way to the plan gate,
298
298
  // because a billing refresh can flip setupPlanConfirmed() while the picker is open.
299
299
  function migrateBlockedReason() {
300
- 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.";
301
301
  if (!selectedSessionKeyList().length) return "Choose at least one conversation to extract.";
302
302
  return "";
303
303
  }
@@ -1173,7 +1173,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
1173
1173
  return {
1174
1174
  id: "free",
1175
1175
  name: "Free",
1176
- homeName: "Original",
1176
+ homeName: "Free",
1177
1177
  price: "$0",
1178
1178
  cadence: "free forever · no card needed",
1179
1179
  features: features
@@ -1202,7 +1202,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
1202
1202
  }).join("");
1203
1203
  var chooseId = plan.id === "free" ? "chooseFreePlan" : (plan.id === "power" ? "choosePowerPlan" : "chooseProPlan");
1204
1204
  var chooseLabel = plan.id === "free"
1205
- ? "Continue with " + plan.homeName + " — Free"
1205
+ ? "Continue with " + plan.homeName
1206
1206
  : (trialOn
1207
1207
  ? "Start " + plan.homeName + " trial — $0 today"
1208
1208
  : "Subscribe to " + plan.homeName);
@@ -1211,6 +1211,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
1211
1211
  '<div class="planGrid" role="radiogroup" aria-label="Choose an Echo plan">' + columns + '</div>' +
1212
1212
  '<div class="planGridAction"><button type="button" class="primary mvpPlanCta" id="' + chooseId + '">' + esc(chooseLabel) + ' <span aria-hidden="true">→</span></button></div>' +
1213
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>' +
1214
1215
  '</section>';
1215
1216
  }
1216
1217
  function bindPlanHabitat() {
@@ -1310,7 +1311,7 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
1310
1311
  var freePlanCopy = freeLimits
1311
1312
  ? quotaNumber(freeLimits.historicalConversationLimit) + " coding sessions and " + quotaNumber(freeLimits.memorySearchWeeklyLimit) + " memory recalls each week."
1312
1313
  : "Your managed import and weekly memory allowances are ready.";
1313
- 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>';
1314
1315
  renderBillingCommitment("");
1315
1316
  var changeBtn = document.getElementById("changeSetupPlan");
1316
1317
  if (changeBtn) changeBtn.onclick = function () {
@@ -1428,14 +1429,14 @@ export const SETUP_PAGE_CLIENT_EXTRACTION = String.raw ` /* ---------- dash
1428
1429
  renderAccountChoice();
1429
1430
  renderSessionSelection(true);
1430
1431
  }
1431
- 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.");
1432
1433
  } catch (_) {
1433
1434
  if (billingEpoch !== accountStateEpoch || !connected) return;
1434
1435
  billingLastCheckedAt = Date.now();
1435
1436
  billingCheckMessage = "Could not check payment yet. Echo will keep trying automatically.";
1436
1437
  var fellBackToFree = applyFreePlanFallback();
1437
1438
  if (fellBackToFree && stats) renderDashboard();
1438
- setSetupPlanStatus("Plan check unavailable. Original still works.");
1439
+ setSetupPlanStatus("Plan check unavailable. Free still works.");
1439
1440
  } finally {
1440
1441
  if (billingEpoch === accountStateEpoch) billingStatusLoading = false;
1441
1442
  }
@@ -748,6 +748,22 @@ export const SETUP_PAGE_STYLES_MONOCHROME = String.raw `
748
748
  font-size: 12.5px;
749
749
  }
750
750
  #app .mvpPlanStatus:empty { display: none; }
751
+ #app .mvpTeamPlanLink {
752
+ margin-top: 14px;
753
+ color: var(--echo-ink-mute);
754
+ font-size: 12.5px;
755
+ text-align: center;
756
+ }
757
+ #app .mvpTeamPlanCode {
758
+ padding: 1px 6px;
759
+ border: 1px solid var(--echo-line-checkbox);
760
+ border-radius: 5px;
761
+ color: var(--echo-ink-text);
762
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
763
+ font-weight: 600;
764
+ letter-spacing: 0.06em;
765
+ white-space: nowrap;
766
+ }
751
767
  #app .planGateSkip { margin-top: 24px; }
752
768
  #app .planGateSkip p { color: var(--echo-ink-faint); font-size: 11.5px; }
753
769
 
@@ -100,7 +100,7 @@ function extractionPreviewBootstrap(options) {
100
100
  discovery: { phase: "account", exact: false }
101
101
  };
102
102
  renderDashboard();
103
- ${options.showUnknownStatus ? 'setSetupPlanStatus("Plan check unavailable. Original still works.");' : ""}
103
+ ${options.showUnknownStatus ? 'setSetupPlanStatus("Plan check unavailable. Free still works.");' : ""}
104
104
  ${options.openSessionPicker ? "window.setTimeout(function () { openSessionPicker(); }, 0);" : ""}`;
105
105
  }
106
106
  export function renderSetupPreviewBootstrap(state) {
@@ -1,6 +1,6 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
- import { resolveClaudeCoworkSessionsDir, resolveClaudeDesktopSupportRoots, resolveClaudeProjectsDir, resolveCodexSessionRoots, } from "./local-data-paths.js";
3
+ import { resolveClaudeCoworkSessionsDir, resolveClaudeDesktopSupportRoots, resolveClaudeProjectsDir, resolveCodexSessionRoots, resolveCursorProjectsDir, } from "./local-data-paths.js";
4
4
  export const SOURCE_SESSION_BINDING_EVIDENCE = "local_jsonl_tool_call";
5
5
  export const SOURCE_SESSION_HOOK_EVIDENCE = "local_session_start_hook";
6
6
  export const SOURCE_SESSION_MCP_METADATA_EVIDENCE = "local_mcp_session_metadata";
@@ -22,6 +22,9 @@ function normalizedProviderSessionId(provider, value) {
22
22
  if (provider === "codex" && !UUID_RE.test(normalized)) {
23
23
  throw new Error("Codex source-session ID must be a UUID");
24
24
  }
25
+ if (provider === "cursor" && !UUID_RE.test(normalized)) {
26
+ throw new Error("Cursor source-session ID must be the conversation UUID that names its transcript");
27
+ }
25
28
  if (provider === "cowork"
26
29
  && !/^local_[A-Za-z0-9_-]{1,194}$/.test(normalized)
27
30
  && !/^session_[A-Za-z0-9_-]{1,192}$/.test(normalized)) {
@@ -166,10 +169,12 @@ function defaultRoots(options = {}) {
166
169
  };
167
170
  const claudeProjects = resolveClaudeProjectsDir(pathOptions);
168
171
  const desktopRoot = resolveClaudeCoworkSessionsDir(pathOptions);
172
+ const cursorProjects = resolveCursorProjectsDir(pathOptions);
169
173
  return {
170
174
  codex: resolveCodexSessionRoots(pathOptions).map((root) => root.path),
171
175
  claudeCode: claudeProjects ? [claudeProjects] : [],
172
176
  cowork: desktopRoot ? [desktopRoot] : [],
177
+ cursor: cursorProjects ? [cursorProjects] : [],
173
178
  };
174
179
  }
175
180
  function walkJsonlFiles(roots) {
@@ -432,6 +437,23 @@ function coworkSessionId(file) {
432
437
  const value = file.split(path.sep).find((part) => /^local_[A-Za-z0-9_-]{1,194}$/.test(part));
433
438
  return value ?? null;
434
439
  }
440
+ /**
441
+ * Cursor writes each Agent transcript at exactly `agent-transcripts/<uuid>/<uuid>.jsonl`, with
442
+ * the two UUIDs equal. A project directory also holds tool logs and terminal captures, some of
443
+ * them JSONL and some named with a UUID, so the full layout is required rather than a UUID
444
+ * somewhere in the name. Echo Desktop applies the same rule, so the two readers agree on which
445
+ * file is the session.
446
+ */
447
+ function cursorSessionId(file) {
448
+ const parts = file.split(path.sep);
449
+ if (parts.length < 3 || parts[parts.length - 3] !== "agent-transcripts")
450
+ return null;
451
+ if (!file.endsWith(".jsonl"))
452
+ return null;
453
+ const stem = path.basename(file, ".jsonl").trim().toLowerCase();
454
+ const directory = parts[parts.length - 2]?.trim().toLowerCase();
455
+ return UUID_RE.test(stem) && directory === stem ? stem : null;
456
+ }
435
457
  function enabledProviders(hostPlatform) {
436
458
  const normalized = hostPlatform?.toLowerCase().replace(/[^a-z0-9]+/g, "_") ?? "";
437
459
  if (normalized.includes("codex"))
@@ -441,7 +463,9 @@ function enabledProviders(hostPlatform) {
441
463
  if (normalized.includes("claude_desktop") || normalized === "claude") {
442
464
  return ["cowork", "claude-code"];
443
465
  }
444
- return ["codex", "claude-code", "cowork"];
466
+ if (normalized.includes("cursor"))
467
+ return ["cursor"];
468
+ return ["codex", "claude-code", "cowork", "cursor"];
445
469
  }
446
470
  /**
447
471
  * Resolve host-owned request metadata into EchoMem's root human-thread context. A Codex subagent
@@ -544,30 +568,41 @@ export function resolveSourceSessionFromBindingToken(bindingToken, options = {})
544
568
  }
545
569
  const needsDefaults = options.roots?.codex === undefined
546
570
  || options.roots?.claudeCode === undefined
547
- || options.roots?.cowork === undefined;
548
- const defaults = needsDefaults ? defaultRoots(options) : { codex: [], claudeCode: [], cowork: [] };
571
+ || options.roots?.cowork === undefined
572
+ || options.roots?.cursor === undefined;
573
+ const defaults = needsDefaults
574
+ ? defaultRoots(options)
575
+ : { codex: [], claudeCode: [], cowork: [], cursor: [] };
549
576
  const roots = {
550
577
  codex: options.roots?.codex ?? defaults.codex,
551
578
  claudeCode: options.roots?.claudeCode ?? defaults.claudeCode,
552
579
  cowork: options.roots?.cowork ?? defaults.cowork,
580
+ cursor: options.roots?.cursor ?? defaults.cursor,
553
581
  };
554
582
  const nowMs = options.nowMs ?? Date.now();
555
583
  const maxAgeMs = options.maxAgeMs ?? DEFAULT_MAX_AGE_MS;
556
584
  const matches = [];
585
+ const rootsFor = (provider) => {
586
+ switch (provider) {
587
+ case "codex": return roots.codex;
588
+ case "claude-code": return roots.claudeCode;
589
+ case "cowork": return roots.cowork;
590
+ case "cursor": return roots.cursor;
591
+ }
592
+ };
593
+ const sessionIdFor = (provider, file) => {
594
+ switch (provider) {
595
+ case "codex": return codexSessionId(file, roots.codex);
596
+ case "claude-code": return claudeCodeSessionId(file);
597
+ case "cowork": return coworkSessionId(file);
598
+ case "cursor": return cursorSessionId(file);
599
+ }
600
+ };
557
601
  for (const provider of enabledProviders(options.hostPlatform)) {
558
- const providerRoots = provider === "codex"
559
- ? roots.codex
560
- : provider === "claude-code"
561
- ? roots.claudeCode
562
- : roots.cowork;
563
- for (const file of recentFiles(providerRoots, nowMs, maxAgeMs, provider === "codex")) {
602
+ for (const file of recentFiles(rootsFor(provider), nowMs, maxAgeMs, provider === "codex")) {
564
603
  if (!tailContainsBinding(file, normalizedToken))
565
604
  continue;
566
- const providerSessionId = provider === "codex"
567
- ? codexSessionId(file, roots.codex)
568
- : provider === "claude-code"
569
- ? claudeCodeSessionId(file)
570
- : coworkSessionId(file);
605
+ const providerSessionId = sessionIdFor(provider, file);
571
606
  if (!providerSessionId)
572
607
  continue;
573
608
  if (provider === "claude-code" && enabledProviders(options.hostPlatform).includes("cowork")) {
@@ -733,7 +733,6 @@ export const createGroupInviteSchema = z.object({
733
733
  ...triggerMetadataSchema,
734
734
  ...workspaceSelectorSchema,
735
735
  expiresInDays: z.number().int().min(1).max(30).optional(),
736
- maxUses: z.number().int().min(1).max(100).optional(),
737
736
  });
738
737
  export const joinGroupSchema = z.object({
739
738
  ...triggerMetadataSchema,
@@ -915,7 +914,7 @@ export function listToolSpecs(opts = {}) {
915
914
  {
916
915
  name: canonicalToolNames.linkWorkspaceTicketSession,
917
916
  title: "Link this agent conversation to an Echo workspace ticket",
918
- description: withMcpVersion("Call when the user asks to work on, continue, attach, or bind this conversation to an Echo workspace ticket and supplies its UUID. Pass ticketId exactly. When a structured Echo ticket marker is present, also pass its workspaceId and launchId exactly; the backend verifies the registered launch nonce and treats that entry point as team-work sharing intent. Never invent a launchId for a session attached later. The operation is idempotent and makes this the session's one active ticket in that workspace; any previous active ticket is closed with timestamped history. A verified local source session links immediately. If you have a session_ identifier for this conversation, pass it as cloudCoworkSessionId; EchoMem records that path explicitly as provisional and links it immediately. Otherwise Echo Desktop can recover this exact invocation from a local transcript. An accepted_for_desktop_recovery response is asynchronous acceptance, not a failed link; do not claim final success or failure until ticket Activity provides final-state evidence. Never guess or ask the user for a source-session/context ID."),
917
+ description: withMcpVersion("Call when the user asks to work on, continue, attach, or bind this conversation to an Echo workspace ticket and supplies its UUID. Pass ticketId exactly. When a structured Echo ticket marker is present, also pass its workspaceId and launchId exactly; the backend verifies the registered launch nonce. Launching does not by itself share this session with the workspace: sharing follows the choice the user made in Echo Desktop when launching, and otherwise is asked as usual. Never invent a launchId for a session attached later. The operation is idempotent and makes this the session's one active ticket in that workspace; any previous active ticket is closed with timestamped history. A verified local source session links immediately. If you have a session_ identifier for this conversation, pass it as cloudCoworkSessionId; EchoMem records that path explicitly as provisional and links it immediately. Otherwise Echo Desktop can recover this exact invocation from a local transcript. An accepted_for_desktop_recovery response is asynchronous acceptance, not a failed link; do not claim final success or failure until ticket Activity provides final-state evidence. Never guess or ask the user for a source-session/context ID."),
919
918
  inputSchema: {
920
919
  type: "object",
921
920
  properties: {
@@ -1583,12 +1582,11 @@ export function listToolSpecs(opts = {}) {
1583
1582
  },
1584
1583
  {
1585
1584
  name: canonicalToolNames.createGroupInvite,
1586
- description: "Generate a secret, expiring invite code for the current group. Only the group creator may call this in the MVP. Return the code only to the user so they can share it intentionally; never log it.",
1585
+ description: "Generate a secret, expiring invite code for the current group; anyone with it can join until it expires. Only the group creator may call this in the MVP. Return the code only to the user so they can share it intentionally; never log it.",
1587
1586
  inputSchema: {
1588
1587
  type: "object",
1589
1588
  properties: {
1590
1589
  expiresInDays: { type: "number", default: 7 },
1591
- maxUses: { type: "number", default: 20 },
1592
1590
  },
1593
1591
  },
1594
1592
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@echomem/mcp",
3
- "version": "1.4.66",
3
+ "version": "1.4.68",
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",