@mastra/server 1.21.0-alpha.0 → 1.21.0-alpha.2
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 +16 -0
- package/dist/_types/@internal_core/dist/index.d.ts +24 -14
- package/dist/{chunk-DAEHQAZC.cjs → chunk-DNYJSPA5.cjs} +27 -6
- package/dist/chunk-DNYJSPA5.cjs.map +1 -0
- package/dist/{chunk-EDP2Y6XD.cjs → chunk-DWXE75AZ.cjs} +19 -19
- package/dist/{chunk-EDP2Y6XD.cjs.map → chunk-DWXE75AZ.cjs.map} +1 -1
- package/dist/{chunk-5CDCKTHB.js → chunk-FCLPA23B.js} +27 -6
- package/dist/chunk-FCLPA23B.js.map +1 -0
- package/dist/{chunk-3VVDBDS5.cjs → chunk-IRRJW5EA.cjs} +4 -3
- package/dist/chunk-IRRJW5EA.cjs.map +1 -0
- package/dist/{chunk-XINNAPVH.cjs → chunk-JMOCVI6W.cjs} +29 -29
- package/dist/{chunk-XINNAPVH.cjs.map → chunk-JMOCVI6W.cjs.map} +1 -1
- package/dist/{chunk-YFQ5JIUD.js → chunk-M7MFCJT4.js} +14 -9
- package/dist/chunk-M7MFCJT4.js.map +1 -0
- package/dist/{chunk-VGHQI3X3.js → chunk-NCW7IFFR.js} +4 -3
- package/dist/chunk-NCW7IFFR.js.map +1 -0
- package/dist/{chunk-MYFV2L3T.js → chunk-PKONZNTB.js} +3 -3
- package/dist/{chunk-MYFV2L3T.js.map → chunk-PKONZNTB.js.map} +1 -1
- package/dist/{chunk-O7CC4J2Y.js → chunk-SW6IJZFQ.js} +5 -5
- package/dist/{chunk-O7CC4J2Y.js.map → chunk-SW6IJZFQ.js.map} +1 -1
- package/dist/{chunk-OSMI5XLT.cjs → chunk-VUW7PJZC.cjs} +14 -9
- package/dist/chunk-VUW7PJZC.cjs.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/{observational-memory-B25SASRW-T76NSRNU.cjs → observational-memory-WOEVNCG4-5THJIIQE.cjs} +26 -26
- package/dist/{observational-memory-B25SASRW-T76NSRNU.cjs.map → observational-memory-WOEVNCG4-5THJIIQE.cjs.map} +1 -1
- package/dist/{observational-memory-B25SASRW-L4GYD2ZN.js → observational-memory-WOEVNCG4-DT36JHO2.js} +3 -3
- package/dist/{observational-memory-B25SASRW-L4GYD2ZN.js.map → observational-memory-WOEVNCG4-DT36JHO2.js.map} +1 -1
- package/dist/server/handlers/agent-builder.cjs +16 -16
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/observability-new-endpoints.cjs +27 -27
- package/dist/server/handlers/observability-new-endpoints.d.ts +24 -16
- package/dist/server/handlers/observability-new-endpoints.d.ts.map +1 -1
- package/dist/server/handlers/observability-new-endpoints.js +1 -1
- package/dist/server/handlers/observability.cjs +32 -32
- package/dist/server/handlers/observability.js +2 -2
- package/dist/server/handlers/responses.cjs +4 -4
- package/dist/server/handlers/responses.d.ts.map +1 -1
- package/dist/server/handlers/responses.js +1 -1
- package/dist/server/handlers.cjs +6 -6
- package/dist/server/handlers.js +3 -3
- package/dist/server/server-adapter/index.cjs +49 -49
- package/dist/server/server-adapter/index.js +4 -4
- package/dist/server/server-adapter/routes/observability.d.ts +12 -8
- package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/chunk-3VVDBDS5.cjs.map +0 -1
- package/dist/chunk-5CDCKTHB.js.map +0 -1
- package/dist/chunk-DAEHQAZC.cjs.map +0 -1
- package/dist/chunk-OSMI5XLT.cjs.map +0 -1
- package/dist/chunk-VGHQI3X3.js.map +0 -1
- package/dist/chunk-YFQ5JIUD.js.map +0 -1
|
@@ -7699,7 +7699,7 @@ ${suggestedResponse}
|
|
|
7699
7699
|
* In resource scope mode, loads messages for the entire resource (all threads).
|
|
7700
7700
|
* In thread scope mode, loads messages for just the current thread.
|
|
7701
7701
|
*/
|
|
7702
|
-
async
|
|
7702
|
+
async loadMessagesFromStorage(threadId, resourceId, lastObservedAt) {
|
|
7703
7703
|
const startDate = lastObservedAt ? new Date(lastObservedAt.getTime() + 1) : void 0;
|
|
7704
7704
|
let result;
|
|
7705
7705
|
if (this.scope === "resource" && resourceId) {
|
|
@@ -8387,7 +8387,7 @@ ${grouped}` : grouped;
|
|
|
8387
8387
|
if (opts.messages) {
|
|
8388
8388
|
unobservedMessages = this.getUnobservedMessages(opts.messages, record);
|
|
8389
8389
|
} else {
|
|
8390
|
-
const rawMessages = await this.
|
|
8390
|
+
const rawMessages = await this.loadMessagesFromStorage(
|
|
8391
8391
|
threadId,
|
|
8392
8392
|
resourceId,
|
|
8393
8393
|
record.lastObservedAt ? new Date(record.lastObservedAt) : void 0
|
|
@@ -8500,6 +8500,27 @@ ${grouped}` : grouped;
|
|
|
8500
8500
|
const record = await this.getOrCreateRecord(threadId, resourceId);
|
|
8501
8501
|
return this.getUnobservedMessages(messages, record);
|
|
8502
8502
|
}
|
|
8503
|
+
/**
|
|
8504
|
+
* Load unobserved messages from storage for a thread/resource.
|
|
8505
|
+
*
|
|
8506
|
+
* Fetches the OM record, queries storage for messages after the
|
|
8507
|
+
* lastObservedAt cursor, then applies part-level filtering so
|
|
8508
|
+
* partially-observed messages only include their unobserved parts.
|
|
8509
|
+
*
|
|
8510
|
+
* Use this when you need to load stored conversation history that
|
|
8511
|
+
* hasn't been observed yet (e.g. in a stateless gateway proxy that
|
|
8512
|
+
* only receives the latest message from the HTTP request).
|
|
8513
|
+
*/
|
|
8514
|
+
async loadUnobservedMessages(opts) {
|
|
8515
|
+
const { threadId, resourceId } = opts;
|
|
8516
|
+
const record = await this.getOrCreateRecord(threadId, resourceId);
|
|
8517
|
+
const rawMessages = await this.loadMessagesFromStorage(
|
|
8518
|
+
threadId,
|
|
8519
|
+
resourceId,
|
|
8520
|
+
record.lastObservedAt ? new Date(record.lastObservedAt) : void 0
|
|
8521
|
+
);
|
|
8522
|
+
return this.getUnobservedMessages(rawMessages, record);
|
|
8523
|
+
}
|
|
8503
8524
|
/**
|
|
8504
8525
|
* Create a buffered observation chunk without merging into active observations.
|
|
8505
8526
|
*
|
|
@@ -8561,7 +8582,7 @@ ${grouped}` : grouped;
|
|
|
8561
8582
|
if (opts.messages) {
|
|
8562
8583
|
candidateMessages = this.getUnobservedMessages(opts.messages, record, { excludeBuffered: true });
|
|
8563
8584
|
} else {
|
|
8564
|
-
const rawMessages = await this.
|
|
8585
|
+
const rawMessages = await this.loadMessagesFromStorage(
|
|
8565
8586
|
threadId,
|
|
8566
8587
|
resourceId,
|
|
8567
8588
|
record.lastObservedAt ? new Date(record.lastObservedAt) : void 0
|
|
@@ -8803,7 +8824,7 @@ ${grouped}` : grouped;
|
|
|
8803
8824
|
await this.withLock(lockKey, async () => {
|
|
8804
8825
|
const freshRecord = await this.getOrCreateRecord(threadId, resourceId);
|
|
8805
8826
|
generationBefore = freshRecord.generationCount;
|
|
8806
|
-
const unobservedMessages = messages ? this.getUnobservedMessages(messages, freshRecord) : await this.
|
|
8827
|
+
const unobservedMessages = messages ? this.getUnobservedMessages(messages, freshRecord) : await this.loadMessagesFromStorage(
|
|
8807
8828
|
threadId,
|
|
8808
8829
|
resourceId,
|
|
8809
8830
|
freshRecord.lastObservedAt ? new Date(freshRecord.lastObservedAt) : void 0
|
|
@@ -9430,5 +9451,5 @@ function getObservationsAsOf(activeObservations, asOf) {
|
|
|
9430
9451
|
}
|
|
9431
9452
|
|
|
9432
9453
|
export { ModelByInputTokens, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, ObservationalMemoryProcessor, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, combineObservationGroupRanges, deriveObservationGroupProvenance, e, estimateTokenCount, extractCurrentTask, formatMessagesForObserver, formatToolResultForObserver, getObservationsAsOf, hasCurrentTaskSection, injectAnchorIds, optimizeObservationsForContext, parseAnchorId, parseObservationGroups, parseObserverOutput, reconcileObservationGroupsFromReflection, renderObservationGroupsForReflection, resolveToolResultValue, stripEphemeralAnchorIds, stripObservationGroups, truncateStringByTokens, wrapInObservationGroup };
|
|
9433
|
-
//# sourceMappingURL=chunk-
|
|
9434
|
-
//# sourceMappingURL=chunk-
|
|
9454
|
+
//# sourceMappingURL=chunk-FCLPA23B.js.map
|
|
9455
|
+
//# sourceMappingURL=chunk-FCLPA23B.js.map
|