@echomem/mcp 1.3.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,7 +15,12 @@ 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(),
@@ -23,6 +29,7 @@ export const searchMemoriesSchema = z.object({
23
29
  includeAnswer: z.boolean().optional().default(false),
24
30
  });
25
31
  export const saveConversationSchema = z.object({
32
+ ...triggerMetadataSchema,
26
33
  conversation: z.string().optional(),
27
34
  title: z.string().optional(),
28
35
  url: z.string().optional(),
@@ -36,17 +43,25 @@ export const saveConversationSchema = z.object({
36
43
  .optional(),
37
44
  });
38
45
  export const timeRangeSchema = z.object({
46
+ ...triggerMetadataSchema,
39
47
  startDate: z.string(),
40
48
  endDate: z.string(),
41
49
  limit: z.number().optional().default(50),
42
50
  });
43
51
  export const keywordsSchema = z.object({
52
+ ...triggerMetadataSchema,
44
53
  keywords: z.array(z.string()),
45
54
  limit: z.number().optional().default(10),
46
55
  });
47
56
  export const othersSchema = z.object({
57
+ ...triggerMetadataSchema,
48
58
  query: z.string(),
49
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
+ });
50
65
  export function listToolSpecs(opts = {}) {
51
66
  const currentTime = new Date().toISOString();
52
67
  const map = opts.map?.trim();
@@ -69,6 +84,11 @@ export function listToolSpecs(opts = {}) {
69
84
  default: false,
70
85
  description: "Default false: return only retrieved memories and skip answer generation. Set true for the legacy synthesized recall answer.",
71
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" },
72
92
  },
73
93
  },
74
94
  },
@@ -87,6 +107,11 @@ export function listToolSpecs(opts = {}) {
87
107
  default: false,
88
108
  description: "Default false: return only retrieved memories and skip answer generation. Set true for the legacy synthesized recall answer.",
89
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" },
90
115
  },
91
116
  },
92
117
  },
@@ -111,6 +136,11 @@ export function listToolSpecs(opts = {}) {
111
136
  },
112
137
  },
113
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" },
114
144
  },
115
145
  },
116
146
  },
@@ -123,6 +153,11 @@ export function listToolSpecs(opts = {}) {
123
153
  startDate: { type: "string" },
124
154
  endDate: { type: "string" },
125
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" },
126
161
  },
127
162
  required: ["startDate", "endDate"],
128
163
  },
@@ -135,6 +170,11 @@ export function listToolSpecs(opts = {}) {
135
170
  properties: {
136
171
  keywords: { type: "array", items: { type: "string" } },
137
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" },
138
178
  },
139
179
  required: ["keywords"],
140
180
  },
@@ -146,10 +186,38 @@ export function listToolSpecs(opts = {}) {
146
186
  type: "object",
147
187
  properties: {
148
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" },
149
194
  },
150
195
  required: ["query"],
151
196
  },
152
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
+ },
153
221
  {
154
222
  name: canonicalToolNames.report,
155
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.3.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 && node test/migrate.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": {