@tpsdev-ai/flair-mcp 0.8.3 → 0.10.0

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -161,9 +161,27 @@ server.tool("memory_store", "Save information to persistent memory. Use for less
161
161
  dedup: true,
162
162
  dedupThreshold: 0.95,
163
163
  });
164
- // Signal when dedup returned an existing memory instead of writing.
164
+ // Dedup path: existing memory matched, NEW content was NOT written.
165
+ // Emit both prose AND structuredContent so callers can react
166
+ // programmatically even when LLMs compress prose imprecisely
167
+ // (see flair#449 — work agent missed dedup signal and lost data).
165
168
  if (result.deduped) {
166
- return { content: [{ type: "text", text: `Similar memory already exists (id: ${result.id}): ${result.content?.slice(0, 200)}\n(no new entry written)` }] };
169
+ const sc = {
170
+ deduplicated: true,
171
+ mergedWith: result.id,
172
+ existingContent: result.content,
173
+ written: false,
174
+ };
175
+ return {
176
+ content: [{
177
+ type: "text",
178
+ text: `⚠️ DEDUPLICATED — new content was NOT written. ` +
179
+ `Matched existing memory id=${result.id}: ${result.content?.slice(0, 200)}\n\n` +
180
+ `If the new content is genuinely distinct, retry with different phrasing ` +
181
+ `or call memory_store with the same id to update.`,
182
+ }],
183
+ structuredContent: sc,
184
+ };
167
185
  }
168
186
  const preview = content.length > 120 ? content.slice(0, 120) + "..." : content;
169
187
  const tagStr = tags && tags.length > 0 ? tags.join(", ") : "none";
@@ -174,7 +192,10 @@ server.tool("memory_store", "Save information to persistent memory. Use for less
174
192
  `Tags: ${tagStr}`,
175
193
  `Type: ${type}, Durability: ${durability}`,
176
194
  ].join("\n");
177
- return { content: [{ type: "text", text }] };
195
+ return {
196
+ content: [{ type: "text", text }],
197
+ structuredContent: { deduplicated: false, id: result.id, written: true },
198
+ };
178
199
  }
179
200
  catch (err) {
180
201
  return errorResult(err, flair.url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpsdev-ai/flair-mcp",
3
- "version": "0.8.3",
3
+ "version": "0.10.0",
4
4
  "description": "MCP server for Flair — persistent memory for Claude Code, Cursor, and any MCP client.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@modelcontextprotocol/sdk": "1.27.1",
28
- "@tpsdev-ai/flair-client": "0.8.3",
28
+ "@tpsdev-ai/flair-client": "0.10.0",
29
29
  "zod": "4.3.6"
30
30
  },
31
31
  "license": "Apache-2.0",