@mastra/memory 1.19.0 → 1.19.1-alpha.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/CHANGELOG.md +9 -0
- package/dist/{chunk-NZXH5WER.js → chunk-BCYGTJF2.js} +22 -34
- package/dist/chunk-BCYGTJF2.js.map +1 -0
- package/dist/{chunk-5IJQOXJM.cjs → chunk-IRMLP4QH.cjs} +22 -34
- package/dist/chunk-IRMLP4QH.cjs.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +27 -27
- package/dist/index.cjs +13 -13
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/{observational-memory-KFKHBTCB.js → observational-memory-CSI3OZXQ.js} +3 -3
- package/dist/{observational-memory-KFKHBTCB.js.map → observational-memory-CSI3OZXQ.js.map} +1 -1
- package/dist/{observational-memory-V2APY3TO.cjs → observational-memory-RWXMKXJP.cjs} +26 -26
- package/dist/{observational-memory-V2APY3TO.cjs.map → observational-memory-RWXMKXJP.cjs.map} +1 -1
- package/dist/processors/index.cjs +24 -24
- package/dist/processors/index.js +1 -1
- package/dist/processors/observational-memory/processor.d.ts.map +1 -1
- package/dist/processors/observational-memory/temporal-markers.d.ts +1 -1
- package/dist/processors/observational-memory/temporal-markers.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-5IJQOXJM.cjs.map +0 -1
- package/dist/chunk-NZXH5WER.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mastra/memory
|
|
2
2
|
|
|
3
|
+
## 1.19.1-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed processor workflow steps so `sendSignal` is available when processors inject Agent signals, and updated Observational Memory temporal gap markers to use Agent signals. ([#16927](https://github.com/mastra-ai/mastra/pull/16927))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`df1947a`](https://github.com/mastra-ai/mastra/commit/df1947affa40f742067542251fac7ca759492ef4), [`ee59b74`](https://github.com/mastra-ai/mastra/commit/ee59b743ce73ad11784b4d9c6fbba8568edee1c8), [`a97b1a0`](https://github.com/mastra-ai/mastra/commit/a97b1a0abaed83946c3519d1e0f680d0815b8a67)]:
|
|
10
|
+
- @mastra/core@1.37.0-alpha.2
|
|
11
|
+
|
|
3
12
|
## 1.19.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -9466,6 +9466,16 @@ function getTemporalGapReminderMetadata(message, gapText, gapMs, timestamp) {
|
|
|
9466
9466
|
}
|
|
9467
9467
|
};
|
|
9468
9468
|
}
|
|
9469
|
+
function getTemporalGapReminderAttributes(message, gapText, gapMs, timestamp) {
|
|
9470
|
+
return {
|
|
9471
|
+
type: TEMPORAL_GAP_REMINDER_TYPE,
|
|
9472
|
+
gapText,
|
|
9473
|
+
gapMs,
|
|
9474
|
+
timestamp: formatTemporalTimestamp(new Date(timestamp)),
|
|
9475
|
+
timestampMs: timestamp,
|
|
9476
|
+
precedesMessageId: message.id
|
|
9477
|
+
};
|
|
9478
|
+
}
|
|
9469
9479
|
function isTemporalGapMarkerForMessage(message, targetMessageId) {
|
|
9470
9480
|
if (!isTemporalGapMarker(message)) {
|
|
9471
9481
|
return false;
|
|
@@ -9476,29 +9486,9 @@ function isTemporalGapMarkerForMessage(message, targetMessageId) {
|
|
|
9476
9486
|
}
|
|
9477
9487
|
return metadata?.systemReminder?.type === TEMPORAL_GAP_REMINDER_TYPE && metadata.systemReminder.precedesMessageId === targetMessageId;
|
|
9478
9488
|
}
|
|
9479
|
-
function createTemporalGapMarker(message, gapText, gapMs, timestamp) {
|
|
9480
|
-
const metadata = getTemporalGapReminderMetadata(message, gapText, gapMs, timestamp);
|
|
9481
|
-
return {
|
|
9482
|
-
id: `__temporal_gap_${crypto.randomUUID()}`,
|
|
9483
|
-
role: "user",
|
|
9484
|
-
createdAt: new Date(timestamp - 1),
|
|
9485
|
-
threadId: message.threadId,
|
|
9486
|
-
resourceId: message.resourceId,
|
|
9487
|
-
content: {
|
|
9488
|
-
format: 2,
|
|
9489
|
-
parts: [
|
|
9490
|
-
{
|
|
9491
|
-
type: "text",
|
|
9492
|
-
text: `<system-reminder type="${TEMPORAL_GAP_REMINDER_TYPE}" precedesMessageId="${message.id}">${getTemporalGapReminderText(gapText, timestamp)}</system-reminder>`
|
|
9493
|
-
}
|
|
9494
|
-
],
|
|
9495
|
-
metadata
|
|
9496
|
-
}
|
|
9497
|
-
};
|
|
9498
|
-
}
|
|
9499
9489
|
async function insertTemporalGapMarkers({
|
|
9500
9490
|
messageList,
|
|
9501
|
-
|
|
9491
|
+
sendSignal
|
|
9502
9492
|
}) {
|
|
9503
9493
|
const inputMessages = messageList.get.input.db().filter((message) => Boolean(message));
|
|
9504
9494
|
const latestInputMessage = inputMessages.at(-1);
|
|
@@ -9530,17 +9520,15 @@ async function insertTemporalGapMarkers({
|
|
|
9530
9520
|
if (!gapText) {
|
|
9531
9521
|
return;
|
|
9532
9522
|
}
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
type: "
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9523
|
+
await sendSignal?.({
|
|
9524
|
+
id: `__temporal_gap_${crypto.randomUUID()}`,
|
|
9525
|
+
type: "system-reminder",
|
|
9526
|
+
contents: getTemporalGapReminderText(gapText, timestamp),
|
|
9527
|
+
createdAt: new Date(timestamp - 1),
|
|
9528
|
+
acceptedAt: new Date(timestamp),
|
|
9529
|
+
attributes: getTemporalGapReminderAttributes(latestInputMessage, gapText, gapMs, timestamp),
|
|
9530
|
+
metadata: getTemporalGapReminderMetadata(latestInputMessage, gapText, gapMs, timestamp)
|
|
9541
9531
|
});
|
|
9542
|
-
const marker = createTemporalGapMarker(latestInputMessage, gapText, gapMs, timestamp);
|
|
9543
|
-
messageList.add(marker, "input");
|
|
9544
9532
|
}
|
|
9545
9533
|
|
|
9546
9534
|
// src/processors/observational-memory/processor.ts
|
|
@@ -9689,7 +9677,7 @@ var ObservationalMemoryProcessor = class {
|
|
|
9689
9677
|
this.turn.requestContext = requestContext;
|
|
9690
9678
|
await this.turn.start(this.memory);
|
|
9691
9679
|
if (stepNumber === 0 && this.temporalMarkers) {
|
|
9692
|
-
await insertTemporalGapMarkers({ messageList,
|
|
9680
|
+
await insertTemporalGapMarkers({ messageList, sendSignal: args.sendSignal });
|
|
9693
9681
|
}
|
|
9694
9682
|
state.__omTurn = this.turn;
|
|
9695
9683
|
}
|
|
@@ -9821,5 +9809,5 @@ function getObservationsAsOf(activeObservations, asOf) {
|
|
|
9821
9809
|
}
|
|
9822
9810
|
|
|
9823
9811
|
export { ModelByInputTokens, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, ObservationalMemoryProcessor, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, combineObservationGroupRanges, deriveObservationGroupProvenance, extractCurrentTask, formatMessagesForObserver, formatToolResultForObserver, getObservationsAsOf, hasCurrentTaskSection, injectAnchorIds, optimizeObservationsForContext, parseAnchorId, parseObservationGroups, parseObserverOutput, reconcileObservationGroupsFromReflection, renderObservationGroupsForReflection, resolveToolResultValue, stripEphemeralAnchorIds, stripObservationGroups, truncateStringByTokens, wrapInObservationGroup };
|
|
9824
|
-
//# sourceMappingURL=chunk-
|
|
9825
|
-
//# sourceMappingURL=chunk-
|
|
9812
|
+
//# sourceMappingURL=chunk-BCYGTJF2.js.map
|
|
9813
|
+
//# sourceMappingURL=chunk-BCYGTJF2.js.map
|