@anuma/sdk 6.39.3 → 6.40.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.
- package/dist/expo/index.cjs +229 -26
- package/dist/expo/index.d.mts +24 -2
- package/dist/expo/index.d.ts +24 -2
- package/dist/expo/index.mjs +229 -26
- package/dist/react/index.cjs +229 -26
- package/dist/react/index.d.mts +24 -2
- package/dist/react/index.d.ts +24 -2
- package/dist/react/index.mjs +229 -26
- package/dist/server/index.cjs +19 -16
- package/dist/server/index.d.mts +24 -2
- package/dist/server/index.d.ts +24 -2
- package/dist/server/index.mjs +19 -16
- package/package.json +1 -1
package/dist/server/index.mjs
CHANGED
|
@@ -33404,6 +33404,14 @@ function createLocalMemoryStore(options) {
|
|
|
33404
33404
|
getLogger().warn("[memory/store] Failed to embed memory:", err);
|
|
33405
33405
|
});
|
|
33406
33406
|
};
|
|
33407
|
+
const maintenance = {
|
|
33408
|
+
createDecaySweeper: (sweeperOptions) => createDecaySweeper({ ...sweeperOptions, vaultCtx }),
|
|
33409
|
+
getTopicBacklog: (backlogOptions) => getMemoriesNeedingTopicExtractionOp(vaultCtx, backlogOptions),
|
|
33410
|
+
extractTopics: (memoryIds, extractOptions) => extractAndLinkEntitiesForMemoriesOp(vaultCtx, memoryIds, extractOptions),
|
|
33411
|
+
stampTopicsExtracted: (memoryIds, extractedAt, version) => stampTopicsExtractedAtOp(vaultCtx, memoryIds, extractedAt, version),
|
|
33412
|
+
relinkTopics: (memoryIds) => relinkMemoryTopicsOp(vaultCtx, memoryIds),
|
|
33413
|
+
backfillTopics: (memoryIds) => backfillMemoryTopicsOp(vaultCtx, memoryIds)
|
|
33414
|
+
};
|
|
33407
33415
|
return {
|
|
33408
33416
|
masksEmbeddingInput: options.embeddingOptions.maskInput !== void 0,
|
|
33409
33417
|
list: (listOptions) => getAllVaultMemoriesOp(vaultCtx, listOptions),
|
|
@@ -33417,21 +33425,22 @@ function createLocalMemoryStore(options) {
|
|
|
33417
33425
|
memoriesByTopics: (names) => getMemoriesByEntityNamesOp(entityCtx, names),
|
|
33418
33426
|
topicsByMemories: (memoryIds) => getEntitiesByMemoryIdsOp(entityCtx, memoryIds),
|
|
33419
33427
|
listTopics: async () => {
|
|
33420
|
-
const links = await entityCtx.memoryEntityCollection.query(...linksOwnedBy).
|
|
33428
|
+
const links = await entityCtx.memoryEntityCollection.query(...linksOwnedBy).unsafeFetchRaw();
|
|
33421
33429
|
const members = /* @__PURE__ */ new Map();
|
|
33422
33430
|
for (const link of links) {
|
|
33423
|
-
const entityId = String(link.
|
|
33431
|
+
const entityId = String(link.entity_id);
|
|
33424
33432
|
const set = members.get(entityId) ?? /* @__PURE__ */ new Set();
|
|
33425
|
-
set.add(String(link.
|
|
33433
|
+
set.add(String(link.memory_id));
|
|
33426
33434
|
members.set(entityId, set);
|
|
33427
33435
|
}
|
|
33428
|
-
const entities = userId === void 0 ? await entityCtx.entityCollection.query().
|
|
33436
|
+
const entities = userId === void 0 ? await entityCtx.entityCollection.query().unsafeFetchRaw() : members.size ? await entityCtx.entityCollection.query(import_watermelondb24.Q.where("id", import_watermelondb24.Q.oneOf([...members.keys()]))).unsafeFetchRaw() : [];
|
|
33429
33437
|
const byName = /* @__PURE__ */ new Map();
|
|
33430
33438
|
for (const entity of entities) {
|
|
33431
|
-
const
|
|
33432
|
-
const
|
|
33433
|
-
byName.
|
|
33434
|
-
|
|
33439
|
+
const name = String(entity.canonical_name);
|
|
33440
|
+
const count = members.get(String(entity.id))?.size ?? 0;
|
|
33441
|
+
const existing = byName.get(name);
|
|
33442
|
+
byName.set(name, {
|
|
33443
|
+
name,
|
|
33435
33444
|
kind: existing?.kind ?? entity.kind ?? null,
|
|
33436
33445
|
memoryCount: (existing?.memoryCount ?? 0) + count
|
|
33437
33446
|
});
|
|
@@ -33522,14 +33531,8 @@ function createLocalMemoryStore(options) {
|
|
|
33522
33531
|
}
|
|
33523
33532
|
return () => subscriptions.forEach((s) => s.unsubscribe());
|
|
33524
33533
|
},
|
|
33525
|
-
maintenance
|
|
33526
|
-
|
|
33527
|
-
getTopicBacklog: (backlogOptions) => getMemoriesNeedingTopicExtractionOp(vaultCtx, backlogOptions),
|
|
33528
|
-
extractTopics: (memoryIds, extractOptions) => extractAndLinkEntitiesForMemoriesOp(vaultCtx, memoryIds, extractOptions),
|
|
33529
|
-
stampTopicsExtracted: (memoryIds, extractedAt, version) => stampTopicsExtractedAtOp(vaultCtx, memoryIds, extractedAt, version),
|
|
33530
|
-
relinkTopics: (memoryIds) => relinkMemoryTopicsOp(vaultCtx, memoryIds),
|
|
33531
|
-
backfillTopics: (memoryIds) => backfillMemoryTopicsOp(vaultCtx, memoryIds)
|
|
33532
|
-
}
|
|
33534
|
+
maintenance,
|
|
33535
|
+
topicMaintenance: maintenance
|
|
33533
33536
|
};
|
|
33534
33537
|
}
|
|
33535
33538
|
|