@anuma/sdk 7.2.0 → 7.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/index.cjs +21 -1
- package/dist/expo/index.d.mts +4 -1
- package/dist/expo/index.d.ts +4 -1
- package/dist/expo/index.mjs +21 -1
- package/dist/react/index.cjs +21 -1
- package/dist/react/index.d.mts +4 -1
- package/dist/react/index.d.ts +4 -1
- package/dist/react/index.mjs +21 -1
- package/package.json +1 -1
package/dist/expo/index.cjs
CHANGED
|
@@ -20962,6 +20962,7 @@ var queryFields = [
|
|
|
20962
20962
|
"updated_after",
|
|
20963
20963
|
"topics_due",
|
|
20964
20964
|
"topics_extracted",
|
|
20965
|
+
"event_time_overlaps",
|
|
20965
20966
|
"order",
|
|
20966
20967
|
"cursor",
|
|
20967
20968
|
"limit",
|
|
@@ -22211,6 +22212,7 @@ var MAX_QUERY_IDS = 1e3;
|
|
|
22211
22212
|
var MAX_QUERY_TOPICS = 100;
|
|
22212
22213
|
var MAX_QUERY_FILTER = 20;
|
|
22213
22214
|
var GRAPH_LANE_ROWS = 256;
|
|
22215
|
+
var TEMPORAL_LANE_ROWS = 256;
|
|
22214
22216
|
var RemoteMemoryPartialCreateError = class extends Error {
|
|
22215
22217
|
constructor(created, cause) {
|
|
22216
22218
|
super(`createMany stored ${created.length} memories before a batch failed`);
|
|
@@ -22309,7 +22311,7 @@ function createRemoteMemoryStore(options) {
|
|
|
22309
22311
|
const pipeline = createRemoteMemoryPipeline({
|
|
22310
22312
|
...options,
|
|
22311
22313
|
graphRanking: options.graphRanking ?? ((query, _traverse, recallOptions) => topicGraphRanking(query, recallOptions)),
|
|
22312
|
-
temporalRanking: options.temporalRanking ?? (() =>
|
|
22314
|
+
temporalRanking: options.temporalRanking ?? ((query, now) => eventTimeRanking(query, now))
|
|
22313
22315
|
});
|
|
22314
22316
|
const subscribers = /* @__PURE__ */ new Set();
|
|
22315
22317
|
const seen = /* @__PURE__ */ new Map();
|
|
@@ -22372,6 +22374,24 @@ function createRemoteMemoryStore(options) {
|
|
|
22372
22374
|
matched: [...canonicalTopics(memory)].filter((name) => wanted.has(name)).length
|
|
22373
22375
|
})).filter((row) => row.matched > 0).sort((a, b) => b.matched - a.matched).slice(0, NODE_BUDGET).map((row) => row.memoryId);
|
|
22374
22376
|
};
|
|
22377
|
+
const eventTimeRanking = async (query, now) => {
|
|
22378
|
+
const window2 = parseQueryTimeWindow(query, now);
|
|
22379
|
+
if (!window2) return [];
|
|
22380
|
+
const rows = await pages(
|
|
22381
|
+
metadata2,
|
|
22382
|
+
{ event_time_overlaps: { start: window2.start, end: window2.end } },
|
|
22383
|
+
TEMPORAL_LANE_ROWS
|
|
22384
|
+
);
|
|
22385
|
+
return rows.map(({ memory }) => ({
|
|
22386
|
+
memoryId: memory.memory_id,
|
|
22387
|
+
score: scoreEventTimeOverlap(
|
|
22388
|
+
memory.event_time_start ?? null,
|
|
22389
|
+
memory.event_time_end ?? null,
|
|
22390
|
+
memory.event_time_kind ?? null,
|
|
22391
|
+
window2
|
|
22392
|
+
)
|
|
22393
|
+
})).filter((row) => row.score > 0).sort((a, b) => b.score - a.score).map((row) => row.memoryId);
|
|
22394
|
+
};
|
|
22375
22395
|
const enumerateIds = async (read, ids, filters) => (await Promise.all(
|
|
22376
22396
|
chunks2([...new Set(ids)], MAX_QUERY_IDS).map(
|
|
22377
22397
|
(memory_ids) => pages(read, { ...filters, memory_ids })
|
package/dist/expo/index.d.mts
CHANGED
|
@@ -9654,6 +9654,10 @@ interface RemoteMemoryQueryOptions extends RemoteMemoryReadFilters {
|
|
|
9654
9654
|
updated_after?: number;
|
|
9655
9655
|
topics_due?: number;
|
|
9656
9656
|
topics_extracted?: boolean;
|
|
9657
|
+
event_time_overlaps?: {
|
|
9658
|
+
start: number;
|
|
9659
|
+
end: number;
|
|
9660
|
+
};
|
|
9657
9661
|
order?: "created" | "updated" | "archived" | "changed";
|
|
9658
9662
|
cursor?: string;
|
|
9659
9663
|
limit?: number;
|
|
@@ -9832,7 +9836,6 @@ interface RemoteMemoryStoreOptions {
|
|
|
9832
9836
|
embeddingOptions: EmbeddingOptions;
|
|
9833
9837
|
/** Defaults to ranking memories by how many query entities their topics name. */
|
|
9834
9838
|
graphRanking?: RecallFactSource["graphRanking"];
|
|
9835
|
-
/** Defaults to no temporal lane: nearby has no event-time filter yet. */
|
|
9836
9839
|
temporalRanking?: RecallFactSource["temporalRanking"];
|
|
9837
9840
|
pollIntervalMs?: number;
|
|
9838
9841
|
}
|
package/dist/expo/index.d.ts
CHANGED
|
@@ -9654,6 +9654,10 @@ interface RemoteMemoryQueryOptions extends RemoteMemoryReadFilters {
|
|
|
9654
9654
|
updated_after?: number;
|
|
9655
9655
|
topics_due?: number;
|
|
9656
9656
|
topics_extracted?: boolean;
|
|
9657
|
+
event_time_overlaps?: {
|
|
9658
|
+
start: number;
|
|
9659
|
+
end: number;
|
|
9660
|
+
};
|
|
9657
9661
|
order?: "created" | "updated" | "archived" | "changed";
|
|
9658
9662
|
cursor?: string;
|
|
9659
9663
|
limit?: number;
|
|
@@ -9832,7 +9836,6 @@ interface RemoteMemoryStoreOptions {
|
|
|
9832
9836
|
embeddingOptions: EmbeddingOptions;
|
|
9833
9837
|
/** Defaults to ranking memories by how many query entities their topics name. */
|
|
9834
9838
|
graphRanking?: RecallFactSource["graphRanking"];
|
|
9835
|
-
/** Defaults to no temporal lane: nearby has no event-time filter yet. */
|
|
9836
9839
|
temporalRanking?: RecallFactSource["temporalRanking"];
|
|
9837
9840
|
pollIntervalMs?: number;
|
|
9838
9841
|
}
|
package/dist/expo/index.mjs
CHANGED
|
@@ -19321,6 +19321,7 @@ var queryFields = [
|
|
|
19321
19321
|
"updated_after",
|
|
19322
19322
|
"topics_due",
|
|
19323
19323
|
"topics_extracted",
|
|
19324
|
+
"event_time_overlaps",
|
|
19324
19325
|
"order",
|
|
19325
19326
|
"cursor",
|
|
19326
19327
|
"limit",
|
|
@@ -20568,6 +20569,7 @@ var MAX_QUERY_IDS = 1e3;
|
|
|
20568
20569
|
var MAX_QUERY_TOPICS = 100;
|
|
20569
20570
|
var MAX_QUERY_FILTER = 20;
|
|
20570
20571
|
var GRAPH_LANE_ROWS = 256;
|
|
20572
|
+
var TEMPORAL_LANE_ROWS = 256;
|
|
20571
20573
|
var RemoteMemoryPartialCreateError = class extends Error {
|
|
20572
20574
|
constructor(created, cause) {
|
|
20573
20575
|
super(`createMany stored ${created.length} memories before a batch failed`);
|
|
@@ -20666,7 +20668,7 @@ function createRemoteMemoryStore(options) {
|
|
|
20666
20668
|
const pipeline = createRemoteMemoryPipeline({
|
|
20667
20669
|
...options,
|
|
20668
20670
|
graphRanking: options.graphRanking ?? ((query, _traverse, recallOptions) => topicGraphRanking(query, recallOptions)),
|
|
20669
|
-
temporalRanking: options.temporalRanking ?? (() =>
|
|
20671
|
+
temporalRanking: options.temporalRanking ?? ((query, now) => eventTimeRanking(query, now))
|
|
20670
20672
|
});
|
|
20671
20673
|
const subscribers = /* @__PURE__ */ new Set();
|
|
20672
20674
|
const seen = /* @__PURE__ */ new Map();
|
|
@@ -20729,6 +20731,24 @@ function createRemoteMemoryStore(options) {
|
|
|
20729
20731
|
matched: [...canonicalTopics(memory)].filter((name) => wanted.has(name)).length
|
|
20730
20732
|
})).filter((row) => row.matched > 0).sort((a, b) => b.matched - a.matched).slice(0, NODE_BUDGET).map((row) => row.memoryId);
|
|
20731
20733
|
};
|
|
20734
|
+
const eventTimeRanking = async (query, now) => {
|
|
20735
|
+
const window2 = parseQueryTimeWindow(query, now);
|
|
20736
|
+
if (!window2) return [];
|
|
20737
|
+
const rows = await pages(
|
|
20738
|
+
metadata2,
|
|
20739
|
+
{ event_time_overlaps: { start: window2.start, end: window2.end } },
|
|
20740
|
+
TEMPORAL_LANE_ROWS
|
|
20741
|
+
);
|
|
20742
|
+
return rows.map(({ memory }) => ({
|
|
20743
|
+
memoryId: memory.memory_id,
|
|
20744
|
+
score: scoreEventTimeOverlap(
|
|
20745
|
+
memory.event_time_start ?? null,
|
|
20746
|
+
memory.event_time_end ?? null,
|
|
20747
|
+
memory.event_time_kind ?? null,
|
|
20748
|
+
window2
|
|
20749
|
+
)
|
|
20750
|
+
})).filter((row) => row.score > 0).sort((a, b) => b.score - a.score).map((row) => row.memoryId);
|
|
20751
|
+
};
|
|
20732
20752
|
const enumerateIds = async (read, ids, filters) => (await Promise.all(
|
|
20733
20753
|
chunks2([...new Set(ids)], MAX_QUERY_IDS).map(
|
|
20734
20754
|
(memory_ids) => pages(read, { ...filters, memory_ids })
|
package/dist/react/index.cjs
CHANGED
|
@@ -23267,6 +23267,7 @@ var queryFields = [
|
|
|
23267
23267
|
"updated_after",
|
|
23268
23268
|
"topics_due",
|
|
23269
23269
|
"topics_extracted",
|
|
23270
|
+
"event_time_overlaps",
|
|
23270
23271
|
"order",
|
|
23271
23272
|
"cursor",
|
|
23272
23273
|
"limit",
|
|
@@ -24516,6 +24517,7 @@ var MAX_QUERY_IDS = 1e3;
|
|
|
24516
24517
|
var MAX_QUERY_TOPICS = 100;
|
|
24517
24518
|
var MAX_QUERY_FILTER = 20;
|
|
24518
24519
|
var GRAPH_LANE_ROWS = 256;
|
|
24520
|
+
var TEMPORAL_LANE_ROWS = 256;
|
|
24519
24521
|
var RemoteMemoryPartialCreateError = class extends Error {
|
|
24520
24522
|
constructor(created, cause) {
|
|
24521
24523
|
super(`createMany stored ${created.length} memories before a batch failed`);
|
|
@@ -24614,7 +24616,7 @@ function createRemoteMemoryStore(options) {
|
|
|
24614
24616
|
const pipeline = createRemoteMemoryPipeline({
|
|
24615
24617
|
...options,
|
|
24616
24618
|
graphRanking: options.graphRanking ?? ((query, _traverse, recallOptions) => topicGraphRanking(query, recallOptions)),
|
|
24617
|
-
temporalRanking: options.temporalRanking ?? (() =>
|
|
24619
|
+
temporalRanking: options.temporalRanking ?? ((query, now) => eventTimeRanking(query, now))
|
|
24618
24620
|
});
|
|
24619
24621
|
const subscribers = /* @__PURE__ */ new Set();
|
|
24620
24622
|
const seen = /* @__PURE__ */ new Map();
|
|
@@ -24677,6 +24679,24 @@ function createRemoteMemoryStore(options) {
|
|
|
24677
24679
|
matched: [...canonicalTopics(memory)].filter((name) => wanted.has(name)).length
|
|
24678
24680
|
})).filter((row) => row.matched > 0).sort((a, b) => b.matched - a.matched).slice(0, NODE_BUDGET).map((row) => row.memoryId);
|
|
24679
24681
|
};
|
|
24682
|
+
const eventTimeRanking = async (query, now) => {
|
|
24683
|
+
const window2 = parseQueryTimeWindow(query, now);
|
|
24684
|
+
if (!window2) return [];
|
|
24685
|
+
const rows = await pages(
|
|
24686
|
+
metadata2,
|
|
24687
|
+
{ event_time_overlaps: { start: window2.start, end: window2.end } },
|
|
24688
|
+
TEMPORAL_LANE_ROWS
|
|
24689
|
+
);
|
|
24690
|
+
return rows.map(({ memory }) => ({
|
|
24691
|
+
memoryId: memory.memory_id,
|
|
24692
|
+
score: scoreEventTimeOverlap(
|
|
24693
|
+
memory.event_time_start ?? null,
|
|
24694
|
+
memory.event_time_end ?? null,
|
|
24695
|
+
memory.event_time_kind ?? null,
|
|
24696
|
+
window2
|
|
24697
|
+
)
|
|
24698
|
+
})).filter((row) => row.score > 0).sort((a, b) => b.score - a.score).map((row) => row.memoryId);
|
|
24699
|
+
};
|
|
24680
24700
|
const enumerateIds = async (read, ids, filters) => (await Promise.all(
|
|
24681
24701
|
chunks2([...new Set(ids)], MAX_QUERY_IDS).map(
|
|
24682
24702
|
(memory_ids) => pages(read, { ...filters, memory_ids })
|
package/dist/react/index.d.mts
CHANGED
|
@@ -11387,6 +11387,10 @@ interface RemoteMemoryQueryOptions extends RemoteMemoryReadFilters {
|
|
|
11387
11387
|
updated_after?: number;
|
|
11388
11388
|
topics_due?: number;
|
|
11389
11389
|
topics_extracted?: boolean;
|
|
11390
|
+
event_time_overlaps?: {
|
|
11391
|
+
start: number;
|
|
11392
|
+
end: number;
|
|
11393
|
+
};
|
|
11390
11394
|
order?: "created" | "updated" | "archived" | "changed";
|
|
11391
11395
|
cursor?: string;
|
|
11392
11396
|
limit?: number;
|
|
@@ -11565,7 +11569,6 @@ interface RemoteMemoryStoreOptions {
|
|
|
11565
11569
|
embeddingOptions: EmbeddingOptions;
|
|
11566
11570
|
/** Defaults to ranking memories by how many query entities their topics name. */
|
|
11567
11571
|
graphRanking?: RecallFactSource["graphRanking"];
|
|
11568
|
-
/** Defaults to no temporal lane: nearby has no event-time filter yet. */
|
|
11569
11572
|
temporalRanking?: RecallFactSource["temporalRanking"];
|
|
11570
11573
|
pollIntervalMs?: number;
|
|
11571
11574
|
}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -11387,6 +11387,10 @@ interface RemoteMemoryQueryOptions extends RemoteMemoryReadFilters {
|
|
|
11387
11387
|
updated_after?: number;
|
|
11388
11388
|
topics_due?: number;
|
|
11389
11389
|
topics_extracted?: boolean;
|
|
11390
|
+
event_time_overlaps?: {
|
|
11391
|
+
start: number;
|
|
11392
|
+
end: number;
|
|
11393
|
+
};
|
|
11390
11394
|
order?: "created" | "updated" | "archived" | "changed";
|
|
11391
11395
|
cursor?: string;
|
|
11392
11396
|
limit?: number;
|
|
@@ -11565,7 +11569,6 @@ interface RemoteMemoryStoreOptions {
|
|
|
11565
11569
|
embeddingOptions: EmbeddingOptions;
|
|
11566
11570
|
/** Defaults to ranking memories by how many query entities their topics name. */
|
|
11567
11571
|
graphRanking?: RecallFactSource["graphRanking"];
|
|
11568
|
-
/** Defaults to no temporal lane: nearby has no event-time filter yet. */
|
|
11569
11572
|
temporalRanking?: RecallFactSource["temporalRanking"];
|
|
11570
11573
|
pollIntervalMs?: number;
|
|
11571
11574
|
}
|
package/dist/react/index.mjs
CHANGED
|
@@ -21418,6 +21418,7 @@ var queryFields = [
|
|
|
21418
21418
|
"updated_after",
|
|
21419
21419
|
"topics_due",
|
|
21420
21420
|
"topics_extracted",
|
|
21421
|
+
"event_time_overlaps",
|
|
21421
21422
|
"order",
|
|
21422
21423
|
"cursor",
|
|
21423
21424
|
"limit",
|
|
@@ -22665,6 +22666,7 @@ var MAX_QUERY_IDS = 1e3;
|
|
|
22665
22666
|
var MAX_QUERY_TOPICS = 100;
|
|
22666
22667
|
var MAX_QUERY_FILTER = 20;
|
|
22667
22668
|
var GRAPH_LANE_ROWS = 256;
|
|
22669
|
+
var TEMPORAL_LANE_ROWS = 256;
|
|
22668
22670
|
var RemoteMemoryPartialCreateError = class extends Error {
|
|
22669
22671
|
constructor(created, cause) {
|
|
22670
22672
|
super(`createMany stored ${created.length} memories before a batch failed`);
|
|
@@ -22763,7 +22765,7 @@ function createRemoteMemoryStore(options) {
|
|
|
22763
22765
|
const pipeline = createRemoteMemoryPipeline({
|
|
22764
22766
|
...options,
|
|
22765
22767
|
graphRanking: options.graphRanking ?? ((query, _traverse, recallOptions) => topicGraphRanking(query, recallOptions)),
|
|
22766
|
-
temporalRanking: options.temporalRanking ?? (() =>
|
|
22768
|
+
temporalRanking: options.temporalRanking ?? ((query, now) => eventTimeRanking(query, now))
|
|
22767
22769
|
});
|
|
22768
22770
|
const subscribers = /* @__PURE__ */ new Set();
|
|
22769
22771
|
const seen = /* @__PURE__ */ new Map();
|
|
@@ -22826,6 +22828,24 @@ function createRemoteMemoryStore(options) {
|
|
|
22826
22828
|
matched: [...canonicalTopics(memory)].filter((name) => wanted.has(name)).length
|
|
22827
22829
|
})).filter((row) => row.matched > 0).sort((a, b) => b.matched - a.matched).slice(0, NODE_BUDGET).map((row) => row.memoryId);
|
|
22828
22830
|
};
|
|
22831
|
+
const eventTimeRanking = async (query, now) => {
|
|
22832
|
+
const window2 = parseQueryTimeWindow(query, now);
|
|
22833
|
+
if (!window2) return [];
|
|
22834
|
+
const rows = await pages(
|
|
22835
|
+
metadata2,
|
|
22836
|
+
{ event_time_overlaps: { start: window2.start, end: window2.end } },
|
|
22837
|
+
TEMPORAL_LANE_ROWS
|
|
22838
|
+
);
|
|
22839
|
+
return rows.map(({ memory }) => ({
|
|
22840
|
+
memoryId: memory.memory_id,
|
|
22841
|
+
score: scoreEventTimeOverlap(
|
|
22842
|
+
memory.event_time_start ?? null,
|
|
22843
|
+
memory.event_time_end ?? null,
|
|
22844
|
+
memory.event_time_kind ?? null,
|
|
22845
|
+
window2
|
|
22846
|
+
)
|
|
22847
|
+
})).filter((row) => row.score > 0).sort((a, b) => b.score - a.score).map((row) => row.memoryId);
|
|
22848
|
+
};
|
|
22829
22849
|
const enumerateIds = async (read, ids, filters) => (await Promise.all(
|
|
22830
22850
|
chunks2([...new Set(ids)], MAX_QUERY_IDS).map(
|
|
22831
22851
|
(memory_ids) => pages(read, { ...filters, memory_ids })
|