@tpsdev-ai/pi-flair 0.17.0 → 0.19.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,+BAA+B,CAAC;AAEpF,OAAO,EAA2B,KAAK,iBAAiB,EAAwB,MAAM,yBAAyB,CAAC;AAIhH,UAAU,YAAa,SAAQ,iBAAiB;IAC9C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAkFD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoBpE;AAQD,MAAM,CAAC,OAAO,WAAW,EAAE,EAAE,YAAY,QAqNxC;AAID,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,EACpB,SAAS,SAAO,GACf,OAAO,CAAC,MAAM,CAAC,CAIjB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,+BAA+B,CAAC;AAEpF,OAAO,EAA2B,KAAK,iBAAiB,EAAwB,MAAM,yBAAyB,CAAC;AAIhH,UAAU,YAAa,SAAQ,iBAAiB;IAC9C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAkFD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoBpE;AAQD,MAAM,CAAC,OAAO,WAAW,EAAE,EAAE,YAAY,QAkNxC;AAID,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,EACpB,SAAS,SAAO,GACf,OAAO,CAAC,MAAM,CAAC,CAIjB"}
package/dist/index.js CHANGED
@@ -196,35 +196,33 @@ export default function (pi) {
196
196
  dedup: true,
197
197
  dedupThreshold: 0.95,
198
198
  });
199
- // Dedup signal: use the explicit `deduped` flag that flair-client
200
- // sets on the returned record. The previous prefix-match check
201
- // (`!result.id.startsWith(`${agentId}-`)`) was unreliable when
202
- // a dedup hit returned an existing memory from the SAME agent,
203
- // both IDs start with the same prefix and the check silently
204
- // returned the success path, dropping the new content. Same fix
205
- // class as #358 (P0 silent data loss) applied to flair-mcp;
206
- // pi-flair was missed. See flair#449 (filed by a Claude Code
207
- // session that hit this exact failure).
208
- const wasDeduped = result.deduped === true;
209
- if (wasDeduped) {
210
- return {
211
- content: [{
212
- type: "text",
213
- text: `Similar memory already exists (id: ${result.id}): ${result.content?.slice(0, 200)}\n(no new entry written)`,
214
- }],
215
- details: { deduplicated: true, mergedWith: result.id },
216
- };
217
- }
199
+ // Dedup signal: the server's conservative gate NEVER suppresses a
200
+ // write (memory-integrity fix, flair#526) — `result.deduplicated`
201
+ // is a collision SIGNAL, not a "was this dropped" flag. The content
202
+ // is always written; when flagged, `result.matchedId` names the
203
+ // similar existing memory. (Historical note: this tool used to check
204
+ // the now-removed `result.deduped` flag from a client-side gate that
205
+ // DID suppress the write, and told the user "no new entry written" —
206
+ // that was the #449/#526 silent-data-loss failure mode. Both the
207
+ // suppression and the misleading text are gone.)
208
+ const wasDeduplicated = result.deduplicated === true;
209
+ const matchedId = result.matchedId;
218
210
  const preview = content.length > 120 ? content.slice(0, 120) + "..." : content;
219
211
  const tagStr = params.tags?.length ? params.tags.join(", ") : "none";
220
- const text = [
212
+ const lines = [
221
213
  `Memory stored (id: ${result.id})`,
222
214
  `Preview: ${preview}`,
223
215
  `Size: ${content.length} chars`,
224
216
  `Tags: ${tagStr}`,
225
217
  `Durability: ${durability}`,
226
- ].join("\n");
227
- return { content: [{ type: "text", text }], details: { deduplicated: false, id: result.id } };
218
+ ];
219
+ if (wasDeduplicated && matchedId) {
220
+ lines.push(`Note: similar to existing memory (id: ${matchedId}) — both are kept.`);
221
+ }
222
+ return {
223
+ content: [{ type: "text", text: lines.join("\n") }],
224
+ details: { deduplicated: wasDeduplicated, id: result.id, written: true, ...(wasDeduplicated ? { matchedId } : {}) },
225
+ };
228
226
  }
229
227
  catch (err) {
230
228
  return errorResult(err, flair.url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpsdev-ai/pi-flair",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "Flair memory extension for pi — persistent memory access from within pi sessions",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "node": ">=18"
22
22
  },
23
23
  "dependencies": {
24
- "@tpsdev-ai/flair-client": "0.17.0",
24
+ "@tpsdev-ai/flair-client": "0.19.0",
25
25
  "@sinclair/typebox": "0.34.48"
26
26
  },
27
27
  "license": "Apache-2.0",