@mastra/memory 1.28.3-alpha.0 → 1.28.3-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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-subagents.md +1 -1
- package/dist/index.cjs +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/observation-strategies/async-buffer.d.ts.map +1 -1
- package/dist/processors/observational-memory/subconscious/remind.d.ts.map +1 -1
- package/dist/{src-UuzfQeGH.cjs → src-CFsPC_sG.cjs} +7 -3
- package/dist/{src-UuzfQeGH.cjs.map → src-CFsPC_sG.cjs.map} +1 -1
- package/dist/{src-DG_pqwPQ.js → src-xexf1pDz.js} +7 -3
- package/dist/{src-DG_pqwPQ.js.map → src-xexf1pDz.js.map} +1 -1
- package/package.json +3 -3
package/dist/docs/SKILL.md
CHANGED
|
@@ -138,7 +138,7 @@ Called after a delegation finishes. Use it to inspect results or provide feedbac
|
|
|
138
138
|
- Return `{ feedback: '...' }`: Add feedback that gets saved to the parent agent's memory and is visible to subsequent iterations
|
|
139
139
|
- Return `{ resultText: '...' }`: Replace the tool result text the parent model sees for this delegation, within the current run
|
|
140
140
|
|
|
141
|
-
Set `resultText` when the subagent's own result would give the parent a misleading signal. For example, empty text from a subagent stopped on a tool-calls step looks like a successful but empty delegation to the parent model. Unlike `feedback` on the next turn, `resultText` affects the parent's reasoning immediately.
|
|
141
|
+
Set `resultText` when the subagent's own result would give the parent a misleading signal. For example, empty text from a subagent stopped on a tool-calls step looks like a successful but empty delegation to the parent model. You can also replace the error text from a failed delegation with a more useful message. This doesn't recover the delegation. The parent still receives a failed tool result. Unlike `feedback` on the next turn, `resultText` affects the parent's reasoning immediately.
|
|
142
142
|
|
|
143
143
|
```typescript
|
|
144
144
|
const stream = await parentAgent.stream('Research AI trends', {
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_src = require("./src-
|
|
2
|
+
const require_src = require("./src-CFsPC_sG.cjs");
|
|
3
3
|
let _mastra_core_processors = require("@mastra/core/processors");
|
|
4
4
|
exports.Extractor = require_src.Extractor;
|
|
5
5
|
exports.KnowledgeSemanticIndexCoordinator = require_src.KnowledgeSemanticIndexCoordinator;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as SUMMARIZE_THREAD_DEFAULTS, G as ModelByInputTokens, H as KnowledgeSemanticIndexCoordinator, S as WorkingMemoryExtractor, U as StaleKnowledgeSemanticIndexError, V as Subconscious, X as Extractor, a as extractWorkingMemoryContent, b as WorkingMemoryStateProcessor, c as getObservationsAsOf, i as WorkingMemory, n as MessageHistory, o as extractWorkingMemoryTags, r as SemanticRecall, s as removeWorkingMemoryTags, t as Memory, v as WORKING_MEMORY_STATE_ID, w as summarizeConversation, x as deepMergeWorkingMemory, y as WORKING_MEMORY_STATE_PROCESSOR_ID } from "./src-
|
|
1
|
+
import { C as SUMMARIZE_THREAD_DEFAULTS, G as ModelByInputTokens, H as KnowledgeSemanticIndexCoordinator, S as WorkingMemoryExtractor, U as StaleKnowledgeSemanticIndexError, V as Subconscious, X as Extractor, a as extractWorkingMemoryContent, b as WorkingMemoryStateProcessor, c as getObservationsAsOf, i as WorkingMemory, n as MessageHistory, o as extractWorkingMemoryTags, r as SemanticRecall, s as removeWorkingMemoryTags, t as Memory, v as WORKING_MEMORY_STATE_ID, w as summarizeConversation, x as deepMergeWorkingMemory, y as WORKING_MEMORY_STATE_PROCESSOR_ID } from "./src-xexf1pDz.js";
|
|
2
2
|
export { Extractor, KnowledgeSemanticIndexCoordinator, Memory, MessageHistory, ModelByInputTokens, SUMMARIZE_THREAD_DEFAULTS, SemanticRecall, StaleKnowledgeSemanticIndexError, Subconscious, WORKING_MEMORY_STATE_ID, WORKING_MEMORY_STATE_PROCESSOR_ID, WorkingMemory, WorkingMemoryExtractor, WorkingMemoryStateProcessor, deepMergeWorkingMemory, extractWorkingMemoryContent, extractWorkingMemoryTags, getObservationsAsOf, removeWorkingMemoryTags, summarizeConversation };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_src = require("../src-
|
|
2
|
+
const require_src = require("../src-CFsPC_sG.cjs");
|
|
3
3
|
exports.Extractor = require_src.Extractor;
|
|
4
4
|
exports.KnowledgeSemanticIndexCoordinator = require_src.KnowledgeSemanticIndexCoordinator;
|
|
5
5
|
exports.ModelByInputTokens = require_src.ModelByInputTokens;
|
package/dist/processors/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as formatMessagesForObserver, B as OBSERVATION_CONTINUATION_HINT, D as buildObserverPrompt, E as OBSERVER_SYSTEM_PROMPT, F as parseAnchorId, G as ModelByInputTokens, H as KnowledgeSemanticIndexCoordinator, I as stripEphemeralAnchorIds, J as publishSubconsciousActivity, K as SUBCONSCIOUS_ACTIVITY_STATE_ID, L as OBSERVATIONAL_MEMORY_DEFAULTS, M as optimizeObservationsForContext, N as parseObserverOutput, O as buildObserverSystemPrompt, P as injectAnchorIds, R as OBSERVATION_CONTEXT_INSTRUCTIONS, S as WorkingMemoryExtractor, T as TokenCounter, U as StaleKnowledgeSemanticIndexError, V as Subconscious, W as SubconsciousRemindExtractor, X as Extractor, Y as renderSubconsciousActivity, _ as wrapInObservationGroup, c as getObservationsAsOf, d as combineObservationGroupRanges, f as deriveObservationGroupProvenance, g as stripObservationGroups, h as renderObservationGroupsForReflection, j as hasCurrentTaskSection, k as extractCurrentTask, l as ObservationalMemoryProcessor, m as reconcileObservationGroupsFromReflection, p as parseObservationGroups, q as buildSubconsciousActivitySnapshot, u as ObservationalMemory, w as summarizeConversation, z as OBSERVATION_CONTEXT_PROMPT } from "../src-
|
|
1
|
+
import { A as formatMessagesForObserver, B as OBSERVATION_CONTINUATION_HINT, D as buildObserverPrompt, E as OBSERVER_SYSTEM_PROMPT, F as parseAnchorId, G as ModelByInputTokens, H as KnowledgeSemanticIndexCoordinator, I as stripEphemeralAnchorIds, J as publishSubconsciousActivity, K as SUBCONSCIOUS_ACTIVITY_STATE_ID, L as OBSERVATIONAL_MEMORY_DEFAULTS, M as optimizeObservationsForContext, N as parseObserverOutput, O as buildObserverSystemPrompt, P as injectAnchorIds, R as OBSERVATION_CONTEXT_INSTRUCTIONS, S as WorkingMemoryExtractor, T as TokenCounter, U as StaleKnowledgeSemanticIndexError, V as Subconscious, W as SubconsciousRemindExtractor, X as Extractor, Y as renderSubconsciousActivity, _ as wrapInObservationGroup, c as getObservationsAsOf, d as combineObservationGroupRanges, f as deriveObservationGroupProvenance, g as stripObservationGroups, h as renderObservationGroupsForReflection, j as hasCurrentTaskSection, k as extractCurrentTask, l as ObservationalMemoryProcessor, m as reconcileObservationGroupsFromReflection, p as parseObservationGroups, q as buildSubconsciousActivitySnapshot, u as ObservationalMemory, w as summarizeConversation, z as OBSERVATION_CONTEXT_PROMPT } from "../src-xexf1pDz.js";
|
|
2
2
|
export { Extractor, KnowledgeSemanticIndexCoordinator, ModelByInputTokens, OBSERVATIONAL_MEMORY_DEFAULTS, OBSERVATION_CONTEXT_INSTRUCTIONS, OBSERVATION_CONTEXT_PROMPT, OBSERVATION_CONTINUATION_HINT, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, ObservationalMemoryProcessor, SUBCONSCIOUS_ACTIVITY_STATE_ID, StaleKnowledgeSemanticIndexError, Subconscious, SubconsciousRemindExtractor, TokenCounter, WorkingMemoryExtractor, buildObserverPrompt, buildObserverSystemPrompt, buildSubconsciousActivitySnapshot, combineObservationGroupRanges, deriveObservationGroupProvenance, extractCurrentTask, formatMessagesForObserver, getObservationsAsOf, hasCurrentTaskSection, injectAnchorIds, optimizeObservationsForContext, parseAnchorId, parseObservationGroups, parseObserverOutput, publishSubconsciousActivity, reconcileObservationGroupsFromReflection, renderObservationGroupsForReflection, renderSubconsciousActivity, stripEphemeralAnchorIds, stripObservationGroups, summarizeConversation, wrapInObservationGroup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-buffer.d.ts","sourceRoot":"","sources":["../../../../src/processors/observational-memory/observation-strategies/async-buffer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"async-buffer.d.ts","sourceRoot":"","sources":["../../../../src/processors/observational-memory/observation-strategies/async-buffer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAgB1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAExF,qBAAa,8BAA+B,SAAQ,mBAAmB;IACrE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,oBAAoB,CAAC,CAA0B;gBAE3C,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,kBAAkB;IAMxD,IAAI,SAAS,YAEZ;IACD,IAAI,eAAe,YAElB;IACD,IAAI,gBAAgB,YAEnB;cAEkB,eAAe,IAAI,MAAM;IAItC,OAAO;;;;IAQP,gBAAgB,CAAC,QAAQ,EAAE,MAAM;IAIjC,OAAO,CAAC,oBAAoB,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE;;;;;;;;;uBA6I/D,CAAR;wBAAuB,CAAA;uBAAqB,CAAC;;;;IAvGvC,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA6C7F,OAAO,CAAC,SAAS,EAAE,oBAAoB;IAsEvC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB;IA6BhE,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAkBzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remind.d.ts","sourceRoot":"","sources":["../../../../src/processors/observational-memory/subconscious/remind.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAOzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAsFzD,qBAAa,2BAA4B,SAAQ,SAAS,CAAC,MAAM,CAAC;gBACpD,MAAM,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,wBAAwB;
|
|
1
|
+
{"version":3,"file":"remind.d.ts","sourceRoot":"","sources":["../../../../src/processors/observational-memory/subconscious/remind.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAOzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAsFzD,qBAAa,2BAA4B,SAAQ,SAAS,CAAC,MAAM,CAAC;gBACpD,MAAM,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,wBAAwB;CAiHlF"}
|
|
@@ -17009,7 +17009,8 @@ var SubconsciousRemindExtractor = class extends Extractor {
|
|
|
17009
17009
|
let store;
|
|
17010
17010
|
try {
|
|
17011
17011
|
scope = resolveScope(context);
|
|
17012
|
-
const resourceId =
|
|
17012
|
+
const resourceId = context.resourceId;
|
|
17013
|
+
if (!resourceId) throw new Error("Subconscious remind requires a resourceId.");
|
|
17013
17014
|
store = await context.memory.storage.getStore("knowledge");
|
|
17014
17015
|
if (!store) throw new Error("Subconscious remind requires a configured knowledge storage domain.");
|
|
17015
17016
|
const sources = await dropFreshOwnRecords(store, await findReminderSources(store, scope, context.rawObservations), context.threadId);
|
|
@@ -24608,7 +24609,7 @@ var AsyncBufferObservationStrategy = class extends ObservationStrategy {
|
|
|
24608
24609
|
if (!processed.observations) return;
|
|
24609
24610
|
const { record, threadId, resourceId, messages } = this.opts;
|
|
24610
24611
|
const messageTokens = await this.tokenCounter.countMessagesAsync(messages);
|
|
24611
|
-
await this.storage.updateBufferedObservations({
|
|
24612
|
+
await withRetry(() => this.storage.updateBufferedObservations({
|
|
24612
24613
|
id: record.id,
|
|
24613
24614
|
chunk: {
|
|
24614
24615
|
cycleId: this.cycleId,
|
|
@@ -24624,6 +24625,9 @@ var AsyncBufferObservationStrategy = class extends ObservationStrategy {
|
|
|
24624
24625
|
extractionFailures: processed.extractionFailures
|
|
24625
24626
|
},
|
|
24626
24627
|
lastBufferedAtTime: processed.lastObservedAt
|
|
24628
|
+
}), {
|
|
24629
|
+
label: "persist-buffered-observations",
|
|
24630
|
+
abortSignal: this.opts.abortSignal
|
|
24627
24631
|
});
|
|
24628
24632
|
await this.indexObservationGroups(processed.observations, threadId, resourceId, processed.lastObservedAt);
|
|
24629
24633
|
const newTitle = processed.threadTitle?.trim();
|
|
@@ -32255,4 +32259,4 @@ Object.defineProperty(exports, "wrapInObservationGroup", {
|
|
|
32255
32259
|
}
|
|
32256
32260
|
});
|
|
32257
32261
|
|
|
32258
|
-
//# sourceMappingURL=src-
|
|
32262
|
+
//# sourceMappingURL=src-CFsPC_sG.cjs.map
|