@echomem/mcp 1.2.0 → 1.3.1

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.
@@ -6,6 +6,7 @@ export const canonicalToolNames = {
6
6
  keywords: "search_memories_by_keywords",
7
7
  others: "search_others_memories",
8
8
  report: "echomem_usage_report",
9
+ delete: "delete_memory",
9
10
  };
10
11
  export const legacyAliasToCanonical = {
11
12
  search_memories_by_description_semantic: canonicalToolNames.search,
@@ -14,14 +15,21 @@ export const legacyAliasToCanonical = {
14
15
  export function resolveCanonicalToolName(toolName) {
15
16
  return legacyAliasToCanonical[toolName] ?? toolName;
16
17
  }
18
+ const triggerMetadataSchema = {
19
+ triggerMessage: z.string().optional(),
20
+ triggerMessageRole: z.string().optional(),
21
+ };
17
22
  export const searchMemoriesSchema = z.object({
23
+ ...triggerMetadataSchema,
18
24
  query: z.string().optional(),
19
25
  k: z.number().optional(),
20
26
  limit: z.number().optional(),
21
27
  threshold: z.number().optional().default(0.1),
22
28
  timeFrameDays: z.number().optional(),
29
+ includeAnswer: z.boolean().optional().default(false),
23
30
  });
24
31
  export const saveConversationSchema = z.object({
32
+ ...triggerMetadataSchema,
25
33
  conversation: z.string().optional(),
26
34
  title: z.string().optional(),
27
35
  url: z.string().optional(),
@@ -35,17 +43,25 @@ export const saveConversationSchema = z.object({
35
43
  .optional(),
36
44
  });
37
45
  export const timeRangeSchema = z.object({
46
+ ...triggerMetadataSchema,
38
47
  startDate: z.string(),
39
48
  endDate: z.string(),
40
49
  limit: z.number().optional().default(50),
41
50
  });
42
51
  export const keywordsSchema = z.object({
52
+ ...triggerMetadataSchema,
43
53
  keywords: z.array(z.string()),
44
54
  limit: z.number().optional().default(10),
45
55
  });
46
56
  export const othersSchema = z.object({
57
+ ...triggerMetadataSchema,
47
58
  query: z.string(),
48
59
  });
60
+ export const deleteMemorySchema = z.object({
61
+ memoryId: z.string().min(1),
62
+ confirmed: z.boolean().optional().default(false),
63
+ confirmationToken: z.string().optional(),
64
+ });
49
65
  export function listToolSpecs(opts = {}) {
50
66
  const currentTime = new Date().toISOString();
51
67
  const map = opts.map?.trim();
@@ -55,7 +71,7 @@ export function listToolSpecs(opts = {}) {
55
71
  return [
56
72
  {
57
73
  name: canonicalToolNames.search,
58
- description: `Recall the user's prior decisions, preferences, constraints, and project context from EchoMem — their long-term memory across ALL their AI tools (Claude.ai, ChatGPT, other agents), not just this session.${mapSection}\nCall this when the task plausibly relates to that remembered context — a topic above, or when the user refers to past work ("what did we decide", "like before", "the usual") — so you don't re-derive or re-ask what they already settled. Skip it for self-contained tasks with no link to their history (e.g. a generic algorithm question). Returns ranked memories with provenance. Current time: ${currentTime}.`,
74
+ description: `Recall the user's prior decisions, preferences, constraints, and project context from EchoMem — their long-term memory across ALL their AI tools (Claude.ai, ChatGPT, other agents), not just this session.${mapSection}\nCall this when the task plausibly relates to that remembered context — a topic above, or when the user refers to past work ("what did we decide", "like before", "the usual") — so you don't re-derive or re-ask what they already settled. Skip it for self-contained tasks with no link to their history (e.g. a generic algorithm question). By default this returns only the ranked memories retrieved for recall and skips EchoMem answer generation; set includeAnswer=true only when you explicitly need EchoMem's legacy synthesized recall. Current time: ${currentTime}.`,
59
75
  inputSchema: {
60
76
  type: "object",
61
77
  properties: {
@@ -63,6 +79,16 @@ export function listToolSpecs(opts = {}) {
63
79
  limit: { type: "number", default: 10 },
64
80
  threshold: { type: "number", default: 0.1 },
65
81
  timeFrameDays: { type: "number" },
82
+ includeAnswer: {
83
+ type: "boolean",
84
+ default: false,
85
+ description: "Default false: return only retrieved memories and skip answer generation. Set true for the legacy synthesized recall answer.",
86
+ },
87
+ triggerMessage: {
88
+ type: "string",
89
+ description: "Optional: the user's message that caused this recall. EchoMem stores only a redacted analytics preview and hash.",
90
+ },
91
+ triggerMessageRole: { type: "string", default: "user" },
66
92
  },
67
93
  },
68
94
  },
@@ -76,6 +102,16 @@ export function listToolSpecs(opts = {}) {
76
102
  limit: { type: "number", default: 10 },
77
103
  threshold: { type: "number", default: 0.1 },
78
104
  timeFrameDays: { type: "number" },
105
+ includeAnswer: {
106
+ type: "boolean",
107
+ default: false,
108
+ description: "Default false: return only retrieved memories and skip answer generation. Set true for the legacy synthesized recall answer.",
109
+ },
110
+ triggerMessage: {
111
+ type: "string",
112
+ description: "Optional: the user's message that caused this recall. EchoMem stores only a redacted analytics preview and hash.",
113
+ },
114
+ triggerMessageRole: { type: "string", default: "user" },
79
115
  },
80
116
  },
81
117
  },
@@ -100,6 +136,11 @@ export function listToolSpecs(opts = {}) {
100
136
  },
101
137
  },
102
138
  },
139
+ triggerMessage: {
140
+ type: "string",
141
+ description: "Optional: the user's message that caused this save. EchoMem stores only a redacted analytics preview and hash.",
142
+ },
143
+ triggerMessageRole: { type: "string", default: "user" },
103
144
  },
104
145
  },
105
146
  },
@@ -112,6 +153,11 @@ export function listToolSpecs(opts = {}) {
112
153
  startDate: { type: "string" },
113
154
  endDate: { type: "string" },
114
155
  limit: { type: "number", default: 50 },
156
+ triggerMessage: {
157
+ type: "string",
158
+ description: "Optional: the user's message that caused this lookup. EchoMem stores only a redacted analytics preview and hash.",
159
+ },
160
+ triggerMessageRole: { type: "string", default: "user" },
115
161
  },
116
162
  required: ["startDate", "endDate"],
117
163
  },
@@ -124,6 +170,11 @@ export function listToolSpecs(opts = {}) {
124
170
  properties: {
125
171
  keywords: { type: "array", items: { type: "string" } },
126
172
  limit: { type: "number", default: 10 },
173
+ triggerMessage: {
174
+ type: "string",
175
+ description: "Optional: the user's message that caused this keyword search. EchoMem stores only a redacted analytics preview and hash.",
176
+ },
177
+ triggerMessageRole: { type: "string", default: "user" },
127
178
  },
128
179
  required: ["keywords"],
129
180
  },
@@ -135,10 +186,38 @@ export function listToolSpecs(opts = {}) {
135
186
  type: "object",
136
187
  properties: {
137
188
  query: { type: "string" },
189
+ triggerMessage: {
190
+ type: "string",
191
+ description: "Optional: the user's message that caused this public-memory search. EchoMem stores only a redacted analytics preview and hash.",
192
+ },
193
+ triggerMessageRole: { type: "string", default: "user" },
138
194
  },
139
195
  required: ["query"],
140
196
  },
141
197
  },
198
+ {
199
+ name: canonicalToolNames.delete,
200
+ description: "Delete one of the user's EchoMem memories only after explicit user confirmation. First call with memoryId and confirmed omitted/false to preview the target and receive a confirmationToken; this first call never deletes. Only call again with confirmed=true and that exact confirmationToken after the user explicitly confirms deletion. Deletes the memory row only; raw source_of_truth conversation records are preserved.",
201
+ inputSchema: {
202
+ type: "object",
203
+ properties: {
204
+ memoryId: {
205
+ type: "string",
206
+ description: "The EchoMem memory id to delete.",
207
+ },
208
+ confirmed: {
209
+ type: "boolean",
210
+ default: false,
211
+ description: "Leave false for the preview step. Set true only after the user explicitly confirms deletion.",
212
+ },
213
+ confirmationToken: {
214
+ type: "string",
215
+ description: "Required when confirmed=true. Use the exact token returned by the preview step.",
216
+ },
217
+ },
218
+ required: ["memoryId"],
219
+ },
220
+ },
142
221
  {
143
222
  name: canonicalToolNames.report,
144
223
  description: "Show the user a one-screen audit of THEIR OWN AI coding usage — computed locally from their Codex/Claude Code logs ($0, nothing uploaded): how many tokens their agents spent, how much was re-reading context, reads vs memory recalls, and what changes with EchoMem. Call this when the user asks about their usage, token spend, cost, how much they're wasting, or wants a summary of their agent activity — and you may offer it once right after EchoMem is first connected. Returns formatted text to show the user verbatim. Needs no login.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@echomem/mcp",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "description": "EchoMem Cloud-First MCP Server",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -17,7 +17,7 @@
17
17
  "start": "node dist/index.js",
18
18
  "dev": "tsx src/index.ts",
19
19
  "smoke": "node smoke.mjs",
20
- "test": "npm run build && node test/crypto.test.mjs && node test/integration.test.mjs && node test/no-restart.test.mjs && node test/report.test.mjs && node test/tools.test.mjs",
20
+ "test": "npm run build && node test/crypto.test.mjs && node test/integration.test.mjs && node test/no-restart.test.mjs && node test/report.test.mjs && node test/tools.test.mjs && node test/delete.test.mjs && node test/migrate.test.mjs",
21
21
  "prepack": "npm run build"
22
22
  },
23
23
  "dependencies": {