@anuma/sdk 11.3.3 → 11.3.4

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.
@@ -23501,15 +23501,16 @@ async function extractAndRetain(messages, retainCtx, options) {
23501
23501
  if (isQuarantined) {
23502
23502
  let existingId;
23503
23503
  if (memoryStore) {
23504
- auditRows ?? (auditRows = memoryStore.list({
23504
+ auditRows ?? (auditRows = await memoryStore.list({
23505
23505
  scopes: [.../* @__PURE__ */ new Set([options.scope ?? "private", "private"])],
23506
23506
  includeArchived: true,
23507
23507
  includeQuarantined: true,
23508
- includeSuperseded: true
23508
+ includeSuperseded: true,
23509
+ withEmbeddings: false
23509
23510
  }));
23510
23511
  const sourceKey = [...new Set(candidate.sourceMessageIds)].sort().join("\0");
23511
23512
  const normalize = (value) => value.normalize("NFKC").trim().replace(/\s+/g, " ").toLowerCase();
23512
- existingId = (await auditRows).find(
23513
+ existingId = auditRows.find(
23513
23514
  (row) => row.trustTier === "quarantined" && row.scope === (scope ?? "private") && [...new Set(row.sourceChunkIds ?? [])].sort().join("\0") === sourceKey && normalize(row.content) === normalize(candidate.content)
23514
23515
  )?.uniqueId ?? null;
23515
23516
  } else {
@@ -23549,7 +23550,15 @@ async function extractAndRetain(messages, retainCtx, options) {
23549
23550
  ...options.folderId !== void 0 && { folderId: options.folderId }
23550
23551
  });
23551
23552
  if (isQuarantined) {
23552
- auditRows = void 0;
23553
+ if (result.action === "create") {
23554
+ auditRows?.push({
23555
+ uniqueId: result.memoryId,
23556
+ content: candidate.content,
23557
+ sourceChunkIds: candidate.sourceMessageIds,
23558
+ scope: scope ?? "private",
23559
+ trustTier: "quarantined"
23560
+ });
23561
+ }
23553
23562
  const info = {
23554
23563
  candidate,
23555
23564
  memoryId: result.memoryId,
@@ -21791,15 +21791,16 @@ async function extractAndRetain(messages, retainCtx, options) {
21791
21791
  if (isQuarantined) {
21792
21792
  let existingId;
21793
21793
  if (memoryStore) {
21794
- auditRows ?? (auditRows = memoryStore.list({
21794
+ auditRows ?? (auditRows = await memoryStore.list({
21795
21795
  scopes: [.../* @__PURE__ */ new Set([options.scope ?? "private", "private"])],
21796
21796
  includeArchived: true,
21797
21797
  includeQuarantined: true,
21798
- includeSuperseded: true
21798
+ includeSuperseded: true,
21799
+ withEmbeddings: false
21799
21800
  }));
21800
21801
  const sourceKey = [...new Set(candidate.sourceMessageIds)].sort().join("\0");
21801
21802
  const normalize = (value) => value.normalize("NFKC").trim().replace(/\s+/g, " ").toLowerCase();
21802
- existingId = (await auditRows).find(
21803
+ existingId = auditRows.find(
21803
21804
  (row) => row.trustTier === "quarantined" && row.scope === (scope ?? "private") && [...new Set(row.sourceChunkIds ?? [])].sort().join("\0") === sourceKey && normalize(row.content) === normalize(candidate.content)
21804
21805
  )?.uniqueId ?? null;
21805
21806
  } else {
@@ -21839,7 +21840,15 @@ async function extractAndRetain(messages, retainCtx, options) {
21839
21840
  ...options.folderId !== void 0 && { folderId: options.folderId }
21840
21841
  });
21841
21842
  if (isQuarantined) {
21842
- auditRows = void 0;
21843
+ if (result.action === "create") {
21844
+ auditRows?.push({
21845
+ uniqueId: result.memoryId,
21846
+ content: candidate.content,
21847
+ sourceChunkIds: candidate.sourceMessageIds,
21848
+ scope: scope ?? "private",
21849
+ trustTier: "quarantined"
21850
+ });
21851
+ }
21843
21852
  const info = {
21844
21853
  candidate,
21845
21854
  memoryId: result.memoryId,
@@ -25792,15 +25792,16 @@ async function extractAndRetain(messages, retainCtx, options) {
25792
25792
  if (isQuarantined) {
25793
25793
  let existingId;
25794
25794
  if (memoryStore) {
25795
- auditRows ?? (auditRows = memoryStore.list({
25795
+ auditRows ?? (auditRows = await memoryStore.list({
25796
25796
  scopes: [.../* @__PURE__ */ new Set([options.scope ?? "private", "private"])],
25797
25797
  includeArchived: true,
25798
25798
  includeQuarantined: true,
25799
- includeSuperseded: true
25799
+ includeSuperseded: true,
25800
+ withEmbeddings: false
25800
25801
  }));
25801
25802
  const sourceKey = [...new Set(candidate.sourceMessageIds)].sort().join("\0");
25802
25803
  const normalize = (value) => value.normalize("NFKC").trim().replace(/\s+/g, " ").toLowerCase();
25803
- existingId = (await auditRows).find(
25804
+ existingId = auditRows.find(
25804
25805
  (row) => row.trustTier === "quarantined" && row.scope === (scope ?? "private") && [...new Set(row.sourceChunkIds ?? [])].sort().join("\0") === sourceKey && normalize(row.content) === normalize(candidate.content)
25805
25806
  )?.uniqueId ?? null;
25806
25807
  } else {
@@ -25840,7 +25841,15 @@ async function extractAndRetain(messages, retainCtx, options) {
25840
25841
  ...options.folderId !== void 0 && { folderId: options.folderId }
25841
25842
  });
25842
25843
  if (isQuarantined) {
25843
- auditRows = void 0;
25844
+ if (result.action === "create") {
25845
+ auditRows?.push({
25846
+ uniqueId: result.memoryId,
25847
+ content: candidate.content,
25848
+ sourceChunkIds: candidate.sourceMessageIds,
25849
+ scope: scope ?? "private",
25850
+ trustTier: "quarantined"
25851
+ });
25852
+ }
25844
25853
  const info = {
25845
25854
  candidate,
25846
25855
  memoryId: result.memoryId,
@@ -23875,15 +23875,16 @@ async function extractAndRetain(messages, retainCtx, options) {
23875
23875
  if (isQuarantined) {
23876
23876
  let existingId;
23877
23877
  if (memoryStore) {
23878
- auditRows ?? (auditRows = memoryStore.list({
23878
+ auditRows ?? (auditRows = await memoryStore.list({
23879
23879
  scopes: [.../* @__PURE__ */ new Set([options.scope ?? "private", "private"])],
23880
23880
  includeArchived: true,
23881
23881
  includeQuarantined: true,
23882
- includeSuperseded: true
23882
+ includeSuperseded: true,
23883
+ withEmbeddings: false
23883
23884
  }));
23884
23885
  const sourceKey = [...new Set(candidate.sourceMessageIds)].sort().join("\0");
23885
23886
  const normalize = (value) => value.normalize("NFKC").trim().replace(/\s+/g, " ").toLowerCase();
23886
- existingId = (await auditRows).find(
23887
+ existingId = auditRows.find(
23887
23888
  (row) => row.trustTier === "quarantined" && row.scope === (scope ?? "private") && [...new Set(row.sourceChunkIds ?? [])].sort().join("\0") === sourceKey && normalize(row.content) === normalize(candidate.content)
23888
23889
  )?.uniqueId ?? null;
23889
23890
  } else {
@@ -23923,7 +23924,15 @@ async function extractAndRetain(messages, retainCtx, options) {
23923
23924
  ...options.folderId !== void 0 && { folderId: options.folderId }
23924
23925
  });
23925
23926
  if (isQuarantined) {
23926
- auditRows = void 0;
23927
+ if (result.action === "create") {
23928
+ auditRows?.push({
23929
+ uniqueId: result.memoryId,
23930
+ content: candidate.content,
23931
+ sourceChunkIds: candidate.sourceMessageIds,
23932
+ scope: scope ?? "private",
23933
+ trustTier: "quarantined"
23934
+ });
23935
+ }
23927
23936
  const info = {
23928
23937
  candidate,
23929
23938
  memoryId: result.memoryId,
@@ -34250,15 +34250,16 @@ async function extractAndRetain(messages, retainCtx, options) {
34250
34250
  if (isQuarantined) {
34251
34251
  let existingId;
34252
34252
  if (memoryStore) {
34253
- auditRows ?? (auditRows = memoryStore.list({
34253
+ auditRows ?? (auditRows = await memoryStore.list({
34254
34254
  scopes: [.../* @__PURE__ */ new Set([options.scope ?? "private", "private"])],
34255
34255
  includeArchived: true,
34256
34256
  includeQuarantined: true,
34257
- includeSuperseded: true
34257
+ includeSuperseded: true,
34258
+ withEmbeddings: false
34258
34259
  }));
34259
34260
  const sourceKey = [...new Set(candidate.sourceMessageIds)].sort().join("\0");
34260
34261
  const normalize = (value) => value.normalize("NFKC").trim().replace(/\s+/g, " ").toLowerCase();
34261
- existingId = (await auditRows).find(
34262
+ existingId = auditRows.find(
34262
34263
  (row) => row.trustTier === "quarantined" && row.scope === (scope ?? "private") && [...new Set(row.sourceChunkIds ?? [])].sort().join("\0") === sourceKey && normalize(row.content) === normalize(candidate.content)
34263
34264
  )?.uniqueId ?? null;
34264
34265
  } else {
@@ -34298,7 +34299,15 @@ async function extractAndRetain(messages, retainCtx, options) {
34298
34299
  ...options.folderId !== void 0 && { folderId: options.folderId }
34299
34300
  });
34300
34301
  if (isQuarantined) {
34301
- auditRows = void 0;
34302
+ if (result.action === "create") {
34303
+ auditRows?.push({
34304
+ uniqueId: result.memoryId,
34305
+ content: candidate.content,
34306
+ sourceChunkIds: candidate.sourceMessageIds,
34307
+ scope: scope ?? "private",
34308
+ trustTier: "quarantined"
34309
+ });
34310
+ }
34302
34311
  const info = {
34303
34312
  candidate,
34304
34313
  memoryId: result.memoryId,
@@ -32486,15 +32486,16 @@ async function extractAndRetain(messages, retainCtx, options) {
32486
32486
  if (isQuarantined) {
32487
32487
  let existingId;
32488
32488
  if (memoryStore) {
32489
- auditRows ?? (auditRows = memoryStore.list({
32489
+ auditRows ?? (auditRows = await memoryStore.list({
32490
32490
  scopes: [.../* @__PURE__ */ new Set([options.scope ?? "private", "private"])],
32491
32491
  includeArchived: true,
32492
32492
  includeQuarantined: true,
32493
- includeSuperseded: true
32493
+ includeSuperseded: true,
32494
+ withEmbeddings: false
32494
32495
  }));
32495
32496
  const sourceKey = [...new Set(candidate.sourceMessageIds)].sort().join("\0");
32496
32497
  const normalize = (value) => value.normalize("NFKC").trim().replace(/\s+/g, " ").toLowerCase();
32497
- existingId = (await auditRows).find(
32498
+ existingId = auditRows.find(
32498
32499
  (row) => row.trustTier === "quarantined" && row.scope === (scope ?? "private") && [...new Set(row.sourceChunkIds ?? [])].sort().join("\0") === sourceKey && normalize(row.content) === normalize(candidate.content)
32499
32500
  )?.uniqueId ?? null;
32500
32501
  } else {
@@ -32534,7 +32535,15 @@ async function extractAndRetain(messages, retainCtx, options) {
32534
32535
  ...options.folderId !== void 0 && { folderId: options.folderId }
32535
32536
  });
32536
32537
  if (isQuarantined) {
32537
- auditRows = void 0;
32538
+ if (result.action === "create") {
32539
+ auditRows?.push({
32540
+ uniqueId: result.memoryId,
32541
+ content: candidate.content,
32542
+ sourceChunkIds: candidate.sourceMessageIds,
32543
+ scope: scope ?? "private",
32544
+ trustTier: "quarantined"
32545
+ });
32546
+ }
32538
32547
  const info = {
32539
32548
  candidate,
32540
32549
  memoryId: result.memoryId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuma/sdk",
3
- "version": "11.3.3",
3
+ "version": "11.3.4",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",