@anuma/sdk 10.2.5 → 10.3.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/{chunk-ZIN4E7MR.mjs → chunk-4SOUKJD5.mjs} +2 -2
- package/dist/expo/{consolidate-4WLZMXOS.mjs → consolidate-7QUL3TOE.mjs} +1 -1
- package/dist/expo/index.cjs +228 -50
- package/dist/expo/index.d.mts +17 -2
- package/dist/expo/index.d.ts +17 -2
- package/dist/expo/index.mjs +228 -50
- package/dist/react/{chunk-7JYVPYGQ.mjs → chunk-6ANL34M3.mjs} +2 -2
- package/dist/react/{consolidate-3RQL75PJ.mjs → consolidate-JL4P6FXW.mjs} +1 -1
- package/dist/react/index.cjs +228 -50
- package/dist/react/index.d.mts +17 -2
- package/dist/react/index.d.ts +17 -2
- package/dist/react/index.mjs +228 -50
- package/dist/server/{chunk-QK62YWBH.mjs → chunk-BIMEZT3O.mjs} +2 -2
- package/dist/server/{consolidate-NW4UVA6T.mjs → consolidate-JZJYY3SZ.mjs} +1 -1
- package/dist/server/index.cjs +36 -9
- package/dist/server/index.mjs +36 -9
- package/package.json +1 -1
package/dist/server/index.cjs
CHANGED
|
@@ -15940,11 +15940,11 @@ async function requestPortalJson(req, endpoint, controller, deadlineAt) {
|
|
|
15940
15940
|
let value;
|
|
15941
15941
|
try {
|
|
15942
15942
|
value = JSON.parse(candidate);
|
|
15943
|
-
} catch
|
|
15943
|
+
} catch {
|
|
15944
15944
|
return {
|
|
15945
15945
|
kind: "retryable",
|
|
15946
15946
|
code: "invalid-json",
|
|
15947
|
-
reason:
|
|
15947
|
+
reason: "invalid-json"
|
|
15948
15948
|
};
|
|
15949
15949
|
}
|
|
15950
15950
|
if (value === null) {
|
|
@@ -29818,7 +29818,7 @@ async function backfillMemoryTopicsOp(ctx, memoryIds) {
|
|
|
29818
29818
|
const chunkIds = uniqueIds.slice(i, i + CHUNK);
|
|
29819
29819
|
await ctx.database.write(async () => {
|
|
29820
29820
|
await assertCanWrite2(ctx);
|
|
29821
|
-
const
|
|
29821
|
+
const records = [];
|
|
29822
29822
|
for (const id of chunkIds) {
|
|
29823
29823
|
let record;
|
|
29824
29824
|
try {
|
|
@@ -29828,13 +29828,40 @@ async function backfillMemoryTopicsOp(ctx, memoryIds) {
|
|
|
29828
29828
|
}
|
|
29829
29829
|
if (record.isDeleted || !isOwnedByCtxUser(ctx, record)) continue;
|
|
29830
29830
|
if (parseTopics(record.topics) !== null) continue;
|
|
29831
|
-
|
|
29832
|
-
|
|
29833
|
-
|
|
29834
|
-
|
|
29835
|
-
|
|
29831
|
+
records.push(record);
|
|
29832
|
+
}
|
|
29833
|
+
if (records.length === 0) return;
|
|
29834
|
+
const links = await entityCtx.memoryEntityCollection.query(import_watermelondb19.Q.where("memory_id", import_watermelondb19.Q.oneOf(records.map((record) => record.id)))).unsafeFetchRaw();
|
|
29835
|
+
const entityIds = Array.from(new Set(links.map((link) => String(link.entity_id))));
|
|
29836
|
+
const entitiesById = /* @__PURE__ */ new Map();
|
|
29837
|
+
for (let j = 0; j < entityIds.length; j += CHUNK) {
|
|
29838
|
+
const entities = await entityCtx.entityCollection.query(import_watermelondb19.Q.where("id", import_watermelondb19.Q.oneOf(entityIds.slice(j, j + CHUNK)))).fetch();
|
|
29839
|
+
for (const entity of entities) entitiesById.set(entity.id, entity);
|
|
29840
|
+
}
|
|
29841
|
+
const entitiesByMemory = /* @__PURE__ */ new Map();
|
|
29842
|
+
for (const link of links) {
|
|
29843
|
+
const entity = entitiesById.get(String(link.entity_id));
|
|
29844
|
+
if (!entity) continue;
|
|
29845
|
+
const memoryId = String(link.memory_id);
|
|
29846
|
+
let entities = entitiesByMemory.get(memoryId);
|
|
29847
|
+
if (!entities) {
|
|
29848
|
+
entities = /* @__PURE__ */ new Set();
|
|
29849
|
+
entitiesByMemory.set(memoryId, entities);
|
|
29850
|
+
}
|
|
29851
|
+
entities.add(entity);
|
|
29852
|
+
}
|
|
29853
|
+
const writes = [];
|
|
29854
|
+
for (const record of records) {
|
|
29855
|
+
const entities = entitiesByMemory.get(record.id);
|
|
29856
|
+
if (!entities?.size) continue;
|
|
29836
29857
|
const source = record.topicsUserManaged ? "user" : "auto";
|
|
29837
|
-
const write = await resolveMemoryTopicsWrite(
|
|
29858
|
+
const write = await resolveMemoryTopicsWrite(
|
|
29859
|
+
entityCtx,
|
|
29860
|
+
record.id,
|
|
29861
|
+
Array.from(entities),
|
|
29862
|
+
[],
|
|
29863
|
+
source
|
|
29864
|
+
);
|
|
29838
29865
|
if (write) writes.push(write);
|
|
29839
29866
|
}
|
|
29840
29867
|
if (writes.length === 0) return;
|
package/dist/server/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
taskTypeHeader,
|
|
14
14
|
validateEndpointOverride,
|
|
15
15
|
withInternalFlowMarker
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BIMEZT3O.mjs";
|
|
17
17
|
import {
|
|
18
18
|
BASE_URL,
|
|
19
19
|
__commonJS,
|
|
@@ -28076,7 +28076,7 @@ async function backfillMemoryTopicsOp(ctx, memoryIds) {
|
|
|
28076
28076
|
const chunkIds = uniqueIds.slice(i, i + CHUNK);
|
|
28077
28077
|
await ctx.database.write(async () => {
|
|
28078
28078
|
await assertCanWrite2(ctx);
|
|
28079
|
-
const
|
|
28079
|
+
const records = [];
|
|
28080
28080
|
for (const id of chunkIds) {
|
|
28081
28081
|
let record;
|
|
28082
28082
|
try {
|
|
@@ -28086,13 +28086,40 @@ async function backfillMemoryTopicsOp(ctx, memoryIds) {
|
|
|
28086
28086
|
}
|
|
28087
28087
|
if (record.isDeleted || !isOwnedByCtxUser(ctx, record)) continue;
|
|
28088
28088
|
if (parseTopics(record.topics) !== null) continue;
|
|
28089
|
-
|
|
28090
|
-
|
|
28091
|
-
|
|
28092
|
-
|
|
28093
|
-
|
|
28089
|
+
records.push(record);
|
|
28090
|
+
}
|
|
28091
|
+
if (records.length === 0) return;
|
|
28092
|
+
const links = await entityCtx.memoryEntityCollection.query(import_watermelondb19.Q.where("memory_id", import_watermelondb19.Q.oneOf(records.map((record) => record.id)))).unsafeFetchRaw();
|
|
28093
|
+
const entityIds = Array.from(new Set(links.map((link) => String(link.entity_id))));
|
|
28094
|
+
const entitiesById = /* @__PURE__ */ new Map();
|
|
28095
|
+
for (let j = 0; j < entityIds.length; j += CHUNK) {
|
|
28096
|
+
const entities = await entityCtx.entityCollection.query(import_watermelondb19.Q.where("id", import_watermelondb19.Q.oneOf(entityIds.slice(j, j + CHUNK)))).fetch();
|
|
28097
|
+
for (const entity of entities) entitiesById.set(entity.id, entity);
|
|
28098
|
+
}
|
|
28099
|
+
const entitiesByMemory = /* @__PURE__ */ new Map();
|
|
28100
|
+
for (const link of links) {
|
|
28101
|
+
const entity = entitiesById.get(String(link.entity_id));
|
|
28102
|
+
if (!entity) continue;
|
|
28103
|
+
const memoryId = String(link.memory_id);
|
|
28104
|
+
let entities = entitiesByMemory.get(memoryId);
|
|
28105
|
+
if (!entities) {
|
|
28106
|
+
entities = /* @__PURE__ */ new Set();
|
|
28107
|
+
entitiesByMemory.set(memoryId, entities);
|
|
28108
|
+
}
|
|
28109
|
+
entities.add(entity);
|
|
28110
|
+
}
|
|
28111
|
+
const writes = [];
|
|
28112
|
+
for (const record of records) {
|
|
28113
|
+
const entities = entitiesByMemory.get(record.id);
|
|
28114
|
+
if (!entities?.size) continue;
|
|
28094
28115
|
const source = record.topicsUserManaged ? "user" : "auto";
|
|
28095
|
-
const write = await resolveMemoryTopicsWrite(
|
|
28116
|
+
const write = await resolveMemoryTopicsWrite(
|
|
28117
|
+
entityCtx,
|
|
28118
|
+
record.id,
|
|
28119
|
+
Array.from(entities),
|
|
28120
|
+
[],
|
|
28121
|
+
source
|
|
28122
|
+
);
|
|
28096
28123
|
if (write) writes.push(write);
|
|
28097
28124
|
}
|
|
28098
28125
|
if (writes.length === 0) return;
|
|
@@ -31790,7 +31817,7 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
|
|
|
31790
31817
|
content: m.content,
|
|
31791
31818
|
similarity: m.similarity
|
|
31792
31819
|
}));
|
|
31793
|
-
const { consolidateMemory: doConsolidate } = await import("./consolidate-
|
|
31820
|
+
const { consolidateMemory: doConsolidate } = await import("./consolidate-JZJYY3SZ.mjs");
|
|
31794
31821
|
const decision = await doConsolidate(trimmed, candidates, consolidateOptions);
|
|
31795
31822
|
if (decision.action === "create") return decision.fallbackReason ? null : { create: true };
|
|
31796
31823
|
if (decision.action === "supersede" && decision.content) {
|