stratagate-dsh 0.2.80 → 0.2.81
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/CHANGELOG.md +4 -0
- package/dist/client.js +1 -1
- package/dist/plugin.js +9 -1
- package/dist/plugin.js.map +1 -1
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -5093,11 +5093,19 @@ var StrataGate = class _StrataGate {
|
|
|
5093
5093
|
});
|
|
5094
5094
|
let result;
|
|
5095
5095
|
try {
|
|
5096
|
+
const query = [target.l0Title, target.l1Summary, ...target.l2Keypoints ?? []].filter(Boolean).join(" ");
|
|
5097
|
+
const relevant = query ? (await this.searchEvents(query, { limit: 8, trackRetrieval: false })).map(({ event }) => event) : [];
|
|
5098
|
+
const sourceSequence = new Map(this.blocks.map((block) => [block.id, block.sequence]));
|
|
5099
|
+
const recent = this.events.filter((event) => event.status === "active" || event.status === "superseded").sort((left, right) => (sourceSequence.get(right.sourceBlockId) ?? -1) - (sourceSequence.get(left.sourceBlockId) ?? -1) || (right.formedTurn ?? -1) - (left.formedTurn ?? -1) || right.createdAt.localeCompare(left.createdAt) || right.id.localeCompare(left.id)).slice(0, 4);
|
|
5100
|
+
const timelineEvents = new Map(relevant.map((event) => [event.id, event]));
|
|
5101
|
+
for (const event of recent) {
|
|
5102
|
+
if (!timelineEvents.has(event.id)) timelineEvents.set(event.id, event);
|
|
5103
|
+
}
|
|
5096
5104
|
result = await this.extractor({
|
|
5097
5105
|
previous: threadBlocks.slice(0, targetIndex).reverse().find((block) => block.l2Keypoints !== void 0) ?? null,
|
|
5098
5106
|
target,
|
|
5099
5107
|
next,
|
|
5100
|
-
timeline:
|
|
5108
|
+
timeline: [...timelineEvents.values()].map((event) => ({ id: event.id, title: event.title, temporal: event.temporal }))
|
|
5101
5109
|
});
|
|
5102
5110
|
} catch (error) {
|
|
5103
5111
|
await this.commitMutation(() => {
|