@mastra/memory 1.25.0-alpha.0 → 1.25.0-alpha.1
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 +15 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-agents-agent-approval.md +2 -2
- package/dist/docs/references/docs-memory-observational-memory.md +5 -5
- package/dist/docs/references/docs-memory-overview.md +1 -1
- package/dist/docs/references/reference-vectors-mongodb.md +13 -13
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/processors/index.cjs +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/observational-memory/internal-request-context.d.ts +7 -0
- package/dist/processors/observational-memory/internal-request-context.d.ts.map +1 -1
- package/dist/{src-naeQog_T.cjs → src-C3u7zaSu.cjs} +12 -6
- package/dist/{src-naeQog_T.cjs.map → src-C3u7zaSu.cjs.map} +1 -1
- package/dist/{src-BYZh9IBv.js → src-DoNjfXNm.js} +12 -6
- package/dist/{src-BYZh9IBv.js.map → src-DoNjfXNm.js.map} +1 -1
- package/package.json +4 -4
|
@@ -15190,13 +15190,19 @@ ${extractorInstructions}${priorLines.length > 0 ? `\n\n## Prior Extracted Values
|
|
|
15190
15190
|
* auth, versions, routing hints, and resource id, but they must not present as
|
|
15191
15191
|
* another run on the parent thread or core's cross-agent thread wait can block
|
|
15192
15192
|
* on the parent run that is waiting for OM to complete.
|
|
15193
|
+
*
|
|
15194
|
+
* A fresh RequestContext clone is always returned so that memory-scoped writes
|
|
15195
|
+
* made by the internal agent run (e.g. the `MastraMemory` entry that agent.generate
|
|
15196
|
+
* sets from the observer's temporary `structured-observer` memory) cannot leak back
|
|
15197
|
+
* into the parent's RequestContext. Without this isolation the parent's OM turn later
|
|
15198
|
+
* reads the temporary observer's resourceId and injects a continuation message that
|
|
15199
|
+
* fails MessageList's resourceId validation.
|
|
15193
15200
|
*/
|
|
15194
15201
|
function withOmInternalThreadId(requestContext, omAgentId) {
|
|
15195
15202
|
if (!requestContext) return void 0;
|
|
15196
|
-
const parentThreadId = requestContext.get(MASTRA_THREAD_ID_KEY);
|
|
15197
|
-
if (typeof parentThreadId !== "string" || !parentThreadId) return requestContext;
|
|
15198
15203
|
const internalRequestContext = new RequestContext(requestContext.entries());
|
|
15199
|
-
|
|
15204
|
+
const parentThreadId = requestContext.get(MASTRA_THREAD_ID_KEY);
|
|
15205
|
+
if (typeof parentThreadId === "string" && parentThreadId) internalRequestContext.set(MASTRA_THREAD_ID_KEY, `${parentThreadId}-${omAgentId}`);
|
|
15200
15206
|
return internalRequestContext;
|
|
15201
15207
|
}
|
|
15202
15208
|
//#endregion
|
|
@@ -17030,7 +17036,7 @@ var ObserverRunner = class {
|
|
|
17030
17036
|
extractors: activeExtractors,
|
|
17031
17037
|
memory: temporaryMemory?.options,
|
|
17032
17038
|
priorExtractedValues: options?.priorExtractedValues,
|
|
17033
|
-
requestContext:
|
|
17039
|
+
requestContext: internalRequestContext,
|
|
17034
17040
|
observabilityContext: options?.observabilityContext,
|
|
17035
17041
|
abortSignal
|
|
17036
17042
|
});
|
|
@@ -22820,7 +22826,7 @@ var ReflectorRunner = class {
|
|
|
22820
22826
|
extractors: activeExtractors,
|
|
22821
22827
|
memory: temporaryMemory?.options,
|
|
22822
22828
|
priorExtractedValues,
|
|
22823
|
-
requestContext,
|
|
22829
|
+
requestContext: internalRequestContext,
|
|
22824
22830
|
observabilityContext,
|
|
22825
22831
|
abortSignal
|
|
22826
22832
|
});
|
|
@@ -28247,4 +28253,4 @@ Notes:
|
|
|
28247
28253
|
//#endregion
|
|
28248
28254
|
export { extractCurrentTask as A, OBSERVATION_CONTEXT_INSTRUCTIONS as B, WorkingMemoryExtractor as C, OBSERVER_SYSTEM_PROMPT as D, TokenCounter as E, injectAnchorIds as F, OBSERVATION_CONTINUATION_HINT as H, parseAnchorId as I, stripEphemeralAnchorIds as L, hasCurrentTaskSection as M, optimizeObservationsForContext as N, buildObserverPrompt as O, parseObserverOutput as P, Extractor as R, deepMergeWorkingMemory as S, summarizeConversation as T, OBSERVATION_CONTEXT_PROMPT as V, reconcileObservationGroupsFromReflection as _, extractWorkingMemoryContent as a, wrapInObservationGroup as b, WORKING_MEMORY_STATE_ID as c, getObservationsAsOf as d, ObservationalMemoryProcessor as f, parseObservationGroups as g, deriveObservationGroupProvenance as h, WorkingMemory as i, formatMessagesForObserver as j, buildObserverSystemPrompt as k, WORKING_MEMORY_STATE_PROCESSOR_ID as l, combineObservationGroupRanges as m, MessageHistory$1 as n, extractWorkingMemoryTags as o, ObservationalMemory as p, SemanticRecall as r, removeWorkingMemoryTags as s, Memory as t, WorkingMemoryStateProcessor as u, renderObservationGroupsForReflection as v, SUMMARIZE_THREAD_DEFAULTS as w, ModelByInputTokens as x, stripObservationGroups as y, OBSERVATIONAL_MEMORY_DEFAULTS as z };
|
|
28249
28255
|
|
|
28250
|
-
//# sourceMappingURL=src-
|
|
28256
|
+
//# sourceMappingURL=src-DoNjfXNm.js.map
|