@echomem/mcp 1.4.39 → 1.4.41

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.
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { MCP_DESKTOP_MANAGED, MCP_VAULT_UNLOCK_INSTRUCTION, MEMORY_CITATION_INSTRUCTION, SAVED_MEMORY_RECEIPT_INSTRUCTION, withMcpVersion, } from "./package-metadata.js";
3
3
  export const canonicalToolNames = {
4
+ bindSourceSession: "bind_source_session",
4
5
  search: "search_memories",
5
6
  save: "save_conversation",
6
7
  timeRange: "get_memories_by_time_range",
@@ -59,6 +60,7 @@ const READ_ONLY_TOOL_NAMES = new Set([
59
60
  canonicalToolNames.recompose,
60
61
  ]);
61
62
  const IDEMPOTENT_WRITE_TOOL_NAMES = new Set([
63
+ canonicalToolNames.bindSourceSession,
62
64
  canonicalToolNames.recordCitations,
63
65
  canonicalToolNames.setGroupSessionSharing,
64
66
  canonicalToolNames.updateGroupProfile,
@@ -77,6 +79,7 @@ const REQUIRES_USER_INTERACTION_TOOL_NAMES = new Set([
77
79
  canonicalToolNames.delete,
78
80
  ]);
79
81
  const ALWAYS_LOAD_TOOL_NAMES = new Set([
82
+ canonicalToolNames.bindSourceSession,
80
83
  canonicalToolNames.search,
81
84
  canonicalToolNames.save,
82
85
  ]);
@@ -187,6 +190,9 @@ export const saveConversationSchema = z.object({
187
190
  }))
188
191
  .optional(),
189
192
  });
193
+ export const bindSourceSessionSchema = z.object({
194
+ bindingToken: z.string().uuid(),
195
+ });
190
196
  const dateBoundarySchema = z.string().trim().min(1).refine((value) => Number.isFinite(Date.parse(value)), "Expected an ISO-8601 date or date-time string");
191
197
  export const timeRangeSchema = z.object({
192
198
  ...triggerMetadataSchema,
@@ -403,6 +409,22 @@ export function listToolSpecs(opts = {}) {
403
409
  required: ["startDate", "endDate"],
404
410
  };
405
411
  const tools = [
412
+ {
413
+ name: canonicalToolNames.bindSourceSession,
414
+ title: "Bind this agent conversation to its source session",
415
+ description: withMcpVersion("Compatibility fallback for clients where EchoMem's automatic SessionStart binding is unavailable or reports that the session is unbound. Generate a fresh random UUID for bindingToken and pass only that token. EchoMem finds this exact tool call in the local host JSONL, derives the real provider session ID itself, and idempotently binds the authenticated backend context. Never reuse a bindingToken, guess a session ID, or copy a token between conversations. After success, later saves, recalls, citations, sharing decisions, and MCP activity from this bridge are attached to the returned context automatically. Do not call it routinely when automatic binding is active."),
416
+ inputSchema: {
417
+ type: "object",
418
+ properties: {
419
+ bindingToken: {
420
+ type: "string",
421
+ format: "uuid",
422
+ description: "A fresh random UUID generated only for this invocation. The local bridge verifies it inside the current host JSONL.",
423
+ },
424
+ },
425
+ required: ["bindingToken"],
426
+ },
427
+ },
406
428
  {
407
429
  name: canonicalToolNames.search,
408
430
  title: "Search your memories by topic",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@echomem/mcp",
3
- "version": "1.4.39",
3
+ "version": "1.4.41",
4
4
  "description": "EchoMem MCP bridge: cloud-first memory tools and the Agent Doctor workspace forensics report (cost ledger + 3D repo city)",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -33,7 +33,7 @@
33
33
  "test:ui": "npm run build && node test/setup-ui.test.mjs",
34
34
  "test:onboarding-resilience": "npm run build && node test/onboarding-resilience.test.mjs",
35
35
  "test:billing-ui": "npm run build && node test/setup-ui.test.mjs billing",
36
- "test": "npm run build && node test/local-data-paths.test.mjs && node test/crypto.test.mjs && node test/integration.test.mjs && node test/onboarding-resilience.test.mjs && node test/local-auth.test.mjs && node test/retrieval-only.test.mjs && node test/no-restart.test.mjs && node test/report.test.mjs && node test/forensics.test.mjs && node test/canonical-golden.test.mjs && node test/tools.test.mjs && node test/group-map.test.mjs && node test/update-check.test.mjs && node test/headless-runtime.test.mjs && node test/claude-code-config.test.mjs && node test/delete.test.mjs && node test/low-touch-tools.test.mjs && node test/migrate.test.mjs && node test/restart-recovery.test.mjs && node test/save-checkpoint-hook.test.mjs",
36
+ "test": "npm run build && node test/source-session.test.mjs && node test/source-session-hook.test.mjs && node test/local-data-paths.test.mjs && node test/crypto.test.mjs && node test/integration.test.mjs && node test/onboarding-resilience.test.mjs && node test/local-auth.test.mjs && node test/retrieval-only.test.mjs && node test/no-restart.test.mjs && node test/report.test.mjs && node test/forensics.test.mjs && node test/canonical-golden.test.mjs && node test/tools.test.mjs && node test/group-map.test.mjs && node test/update-check.test.mjs && node test/headless-runtime.test.mjs && node test/claude-code-config.test.mjs && node test/delete.test.mjs && node test/low-touch-tools.test.mjs && node test/migrate.test.mjs && node test/restart-recovery.test.mjs && node test/save-checkpoint-hook.test.mjs",
37
37
  "prepack": "npm run build && node scripts/bundle-city.mjs"
38
38
  },
39
39
  "dependencies": {
@@ -6,6 +6,9 @@
6
6
 
7
7
  This project has EchoMem connected — the user's long-term memory across all their AI tools.
8
8
 
9
+ - EchoMem's local SessionStart hook automatically binds new Codex and Claude Code conversations to
10
+ their real provider session. Call `bind_source_session` with a fresh random UUID only as a
11
+ compatibility fallback when automatic binding is unavailable or reports that the session is unbound.
9
12
  - **At the start of any non-trivial task**, call `search_memories` first to recall the user's
10
13
  prior decisions, preferences, and constraints before planning or writing code. Don't re-derive
11
14
  things they've already decided.