@mastra/memory 1.18.2-alpha.1 → 1.18.3-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 +47 -0
- package/dist/{chunk-4AQHFADP.cjs → chunk-BK3AYI7X.cjs} +26 -3
- package/dist/chunk-BK3AYI7X.cjs.map +1 -0
- package/dist/{chunk-LCALB7W6.js → chunk-KLETR4RS.js} +26 -3
- package/dist/chunk-KLETR4RS.js.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +39 -39
- package/dist/index.cjs +13 -13
- package/dist/index.js +4 -4
- package/dist/{observational-memory-SYNXJVL4.js → observational-memory-K5ES5KKQ.js} +3 -3
- package/dist/{observational-memory-SYNXJVL4.js.map → observational-memory-K5ES5KKQ.js.map} +1 -1
- package/dist/{observational-memory-7M2T5EOV.cjs → observational-memory-SRGNHILF.cjs} +26 -26
- package/dist/{observational-memory-7M2T5EOV.cjs.map → observational-memory-SRGNHILF.cjs.map} +1 -1
- package/dist/processors/index.cjs +24 -24
- package/dist/processors/index.js +1 -1
- package/dist/processors/observational-memory/observation-turn/turn.d.ts +6 -1
- package/dist/processors/observational-memory/observation-turn/turn.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/chunk-4AQHFADP.cjs.map +0 -1
- package/dist/chunk-LCALB7W6.js.map +0 -1
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.18.
|
|
2
|
+
"version": "1.18.3-alpha.0",
|
|
3
3
|
"package": "@mastra/memory",
|
|
4
4
|
"exports": {
|
|
5
5
|
"ModelByInputTokens": {
|
|
6
6
|
"types": "dist/processors/index.d.ts",
|
|
7
|
-
"implementation": "dist/chunk-
|
|
7
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
8
8
|
"line": 745
|
|
9
9
|
},
|
|
10
10
|
"OBSERVER_SYSTEM_PROMPT": {
|
|
11
11
|
"types": "dist/processors/index.d.ts",
|
|
12
|
-
"implementation": "dist/chunk-
|
|
12
|
+
"implementation": "dist/chunk-KLETR4RS.js"
|
|
13
13
|
},
|
|
14
14
|
"ObservationalMemory": {
|
|
15
15
|
"types": "dist/processors/index.d.ts",
|
|
16
|
-
"implementation": "dist/chunk-
|
|
17
|
-
"line":
|
|
16
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
17
|
+
"line": 6922
|
|
18
18
|
},
|
|
19
19
|
"ObservationalMemoryProcessor": {
|
|
20
20
|
"types": "dist/processors/index.d.ts",
|
|
21
|
-
"implementation": "dist/chunk-
|
|
22
|
-
"line":
|
|
21
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
22
|
+
"line": 9496
|
|
23
23
|
},
|
|
24
24
|
"TokenCounter": {
|
|
25
25
|
"types": "dist/processors/index.d.ts",
|
|
26
|
-
"implementation": "dist/chunk-
|
|
27
|
-
"line":
|
|
26
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
27
|
+
"line": 6371
|
|
28
28
|
},
|
|
29
29
|
"buildObserverPrompt": {
|
|
30
30
|
"types": "dist/processors/index.d.ts",
|
|
31
|
-
"implementation": "dist/chunk-
|
|
32
|
-
"line":
|
|
31
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
32
|
+
"line": 3682
|
|
33
33
|
},
|
|
34
34
|
"buildObserverSystemPrompt": {
|
|
35
35
|
"types": "dist/processors/index.d.ts",
|
|
36
|
-
"implementation": "dist/chunk-
|
|
37
|
-
"line":
|
|
36
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
37
|
+
"line": 2990
|
|
38
38
|
},
|
|
39
39
|
"combineObservationGroupRanges": {
|
|
40
40
|
"types": "dist/processors/index.d.ts",
|
|
41
|
-
"implementation": "dist/chunk-
|
|
41
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
42
42
|
"line": 837
|
|
43
43
|
},
|
|
44
44
|
"deriveObservationGroupProvenance": {
|
|
45
45
|
"types": "dist/processors/index.d.ts",
|
|
46
|
-
"implementation": "dist/chunk-
|
|
46
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
47
47
|
"line": 871
|
|
48
48
|
},
|
|
49
49
|
"extractCurrentTask": {
|
|
50
50
|
"types": "dist/processors/index.d.ts",
|
|
51
|
-
"implementation": "dist/chunk-
|
|
52
|
-
"line":
|
|
51
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
52
|
+
"line": 3796
|
|
53
53
|
},
|
|
54
54
|
"formatMessagesForObserver": {
|
|
55
55
|
"types": "dist/processors/index.d.ts",
|
|
56
|
-
"implementation": "dist/chunk-
|
|
57
|
-
"line":
|
|
56
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
57
|
+
"line": 3408
|
|
58
58
|
},
|
|
59
59
|
"getObservationsAsOf": {
|
|
60
60
|
"types": "dist/processors/index.d.ts",
|
|
61
|
-
"implementation": "dist/chunk-
|
|
62
|
-
"line":
|
|
61
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
62
|
+
"line": 9708
|
|
63
63
|
},
|
|
64
64
|
"hasCurrentTaskSection": {
|
|
65
65
|
"types": "dist/processors/index.d.ts",
|
|
66
|
-
"implementation": "dist/chunk-
|
|
67
|
-
"line":
|
|
66
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
67
|
+
"line": 3784
|
|
68
68
|
},
|
|
69
69
|
"injectAnchorIds": {
|
|
70
70
|
"types": "dist/processors/index.d.ts",
|
|
71
|
-
"implementation": "dist/chunk-
|
|
72
|
-
"line":
|
|
71
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
72
|
+
"line": 2538
|
|
73
73
|
},
|
|
74
74
|
"optimizeObservationsForContext": {
|
|
75
75
|
"types": "dist/processors/index.d.ts",
|
|
76
|
-
"implementation": "dist/chunk-
|
|
77
|
-
"line":
|
|
76
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
77
|
+
"line": 3807
|
|
78
78
|
},
|
|
79
79
|
"parseAnchorId": {
|
|
80
80
|
"types": "dist/processors/index.d.ts",
|
|
81
|
-
"implementation": "dist/chunk-
|
|
82
|
-
"line":
|
|
81
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
82
|
+
"line": 2511
|
|
83
83
|
},
|
|
84
84
|
"parseObservationGroups": {
|
|
85
85
|
"types": "dist/processors/index.d.ts",
|
|
86
|
-
"implementation": "dist/chunk-
|
|
86
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
87
87
|
"line": 806
|
|
88
88
|
},
|
|
89
89
|
"parseObserverOutput": {
|
|
90
90
|
"types": "dist/processors/index.d.ts",
|
|
91
|
-
"implementation": "dist/chunk-
|
|
92
|
-
"line":
|
|
91
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
92
|
+
"line": 3692
|
|
93
93
|
},
|
|
94
94
|
"reconcileObservationGroupsFromReflection": {
|
|
95
95
|
"types": "dist/processors/index.d.ts",
|
|
96
|
-
"implementation": "dist/chunk-
|
|
96
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
97
97
|
"line": 895
|
|
98
98
|
},
|
|
99
99
|
"renderObservationGroupsForReflection": {
|
|
100
100
|
"types": "dist/processors/index.d.ts",
|
|
101
|
-
"implementation": "dist/chunk-
|
|
101
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
102
102
|
"line": 851
|
|
103
103
|
},
|
|
104
104
|
"stripEphemeralAnchorIds": {
|
|
105
105
|
"types": "dist/processors/index.d.ts",
|
|
106
|
-
"implementation": "dist/chunk-
|
|
107
|
-
"line":
|
|
106
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
107
|
+
"line": 2568
|
|
108
108
|
},
|
|
109
109
|
"stripObservationGroups": {
|
|
110
110
|
"types": "dist/processors/index.d.ts",
|
|
111
|
-
"implementation": "dist/chunk-
|
|
111
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
112
112
|
"line": 828
|
|
113
113
|
},
|
|
114
114
|
"wrapInObservationGroup": {
|
|
115
115
|
"types": "dist/processors/index.d.ts",
|
|
116
|
-
"implementation": "dist/chunk-
|
|
116
|
+
"implementation": "dist/chunk-KLETR4RS.js",
|
|
117
117
|
"line": 799
|
|
118
118
|
},
|
|
119
119
|
"OBSERVATIONAL_MEMORY_DEFAULTS": {
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"processors": {
|
|
150
150
|
"index": "dist/processors/index.js",
|
|
151
151
|
"chunks": [
|
|
152
|
-
"chunk-
|
|
152
|
+
"chunk-KLETR4RS.js",
|
|
153
153
|
"chunk-LSJJAJAF.js"
|
|
154
154
|
]
|
|
155
155
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkBK3AYI7X_cjs = require('./chunk-BK3AYI7X.cjs');
|
|
4
4
|
var v3 = require('zod/v3');
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
var z4 = require('zod/v4');
|
|
@@ -16056,7 +16056,7 @@ function formatTimestamp(date) {
|
|
|
16056
16056
|
}
|
|
16057
16057
|
function truncateByTokens(text4, maxTokens, hint) {
|
|
16058
16058
|
if (tokenx.estimateTokenCount(text4) <= maxTokens) return { text: text4, wasTruncated: false };
|
|
16059
|
-
const truncated =
|
|
16059
|
+
const truncated = chunkBK3AYI7X_cjs.truncateStringByTokens(text4, maxTokens);
|
|
16060
16060
|
const suffix = hint ? ` [${hint} for more]` : "";
|
|
16061
16061
|
return { text: truncated + suffix, wasTruncated: true };
|
|
16062
16062
|
}
|
|
@@ -16108,11 +16108,11 @@ ${JSON.stringify(inv.args, null, 2)}`;
|
|
|
16108
16108
|
});
|
|
16109
16109
|
}
|
|
16110
16110
|
if (inv.state === "result") {
|
|
16111
|
-
const { value: resultValue } =
|
|
16111
|
+
const { value: resultValue } = chunkBK3AYI7X_cjs.resolveToolResultValue(
|
|
16112
16112
|
part,
|
|
16113
16113
|
inv.result
|
|
16114
16114
|
);
|
|
16115
|
-
const resultStr =
|
|
16115
|
+
const resultStr = chunkBK3AYI7X_cjs.formatToolResultForObserver(resultValue, { maxTokens: HIGH_DETAIL_TOOL_RESULT_TOKENS });
|
|
16116
16116
|
const fullText = `[Tool Result: ${inv.toolName}]
|
|
16117
16117
|
${resultStr}`;
|
|
16118
16118
|
parts.push(makePart(msg, i, "tool-result", fullText, detail, inv.toolName));
|
|
@@ -16139,7 +16139,7 @@ ${typeof rawArgs === "string" ? rawArgs : JSON.stringify(rawArgs, null, 2)}`;
|
|
|
16139
16139
|
const toolName = part.toolName;
|
|
16140
16140
|
if (toolName) {
|
|
16141
16141
|
const rawResult = part.output ?? part.result;
|
|
16142
|
-
const resultStr =
|
|
16142
|
+
const resultStr = chunkBK3AYI7X_cjs.formatToolResultForObserver(rawResult, { maxTokens: HIGH_DETAIL_TOOL_RESULT_TOKENS });
|
|
16143
16143
|
const fullText = `[Tool Result: ${toolName}]
|
|
16144
16144
|
${resultStr}`;
|
|
16145
16145
|
parts.push(makePart(msg, i, "tool-result", fullText, detail, toolName));
|
|
@@ -16218,7 +16218,7 @@ function renderFormattedParts(parts, timestamps, options) {
|
|
|
16218
16218
|
const text4 = buildRenderedText(parts, timestamps);
|
|
16219
16219
|
let totalTokens = tokenx.estimateTokenCount(text4);
|
|
16220
16220
|
if (totalTokens > options.maxTokens) {
|
|
16221
|
-
const truncated =
|
|
16221
|
+
const truncated = chunkBK3AYI7X_cjs.truncateStringByTokens(text4, options.maxTokens);
|
|
16222
16222
|
return { text: truncated, truncated: true, tokenOffset: totalTokens - options.maxTokens };
|
|
16223
16223
|
}
|
|
16224
16224
|
const truncatedIndices = parts.map((p, i) => ({ part: p, index: i })).filter(({ part }) => part.text !== part.fullText).sort((a, b) => expandPriority(a.part) - expandPriority(b.part));
|
|
@@ -16251,7 +16251,7 @@ function renderFormattedParts(parts, timestamps, options) {
|
|
|
16251
16251
|
if (expandedTokens <= options.maxTokens) {
|
|
16252
16252
|
return { text: expanded, truncated: false, tokenOffset: 0 };
|
|
16253
16253
|
}
|
|
16254
|
-
const hardTruncated =
|
|
16254
|
+
const hardTruncated = chunkBK3AYI7X_cjs.truncateStringByTokens(expanded, options.maxTokens);
|
|
16255
16255
|
return { text: hardTruncated, truncated: true, tokenOffset: expandedTokens - options.maxTokens };
|
|
16256
16256
|
}
|
|
16257
16257
|
async function recallPart({
|
|
@@ -16302,7 +16302,7 @@ async function recallPart({
|
|
|
16302
16302
|
|
|
16303
16303
|
`;
|
|
16304
16304
|
const fallbackText = `${fallbackNote}${firstNextPart.text}`;
|
|
16305
|
-
const truncatedText2 =
|
|
16305
|
+
const truncatedText2 = chunkBK3AYI7X_cjs.truncateStringByTokens(fallbackText, maxTokens);
|
|
16306
16306
|
const wasTruncated2 = truncatedText2 !== fallbackText;
|
|
16307
16307
|
return {
|
|
16308
16308
|
text: truncatedText2,
|
|
@@ -16317,7 +16317,7 @@ async function recallPart({
|
|
|
16317
16317
|
}
|
|
16318
16318
|
throw new Error(`Part index ${partIndex} not found in message ${cursor}. Available indices: ${availableIndices}`);
|
|
16319
16319
|
}
|
|
16320
|
-
const truncatedText =
|
|
16320
|
+
const truncatedText = chunkBK3AYI7X_cjs.truncateStringByTokens(target.text, maxTokens);
|
|
16321
16321
|
const wasTruncated = truncatedText !== target.text;
|
|
16322
16322
|
return {
|
|
16323
16323
|
text: truncatedText,
|
|
@@ -18079,7 +18079,7 @@ ${workingMemory}`;
|
|
|
18079
18079
|
"Observational memory requires @mastra/core support for request-response-id-rotation. Please bump @mastra/core to a newer version."
|
|
18080
18080
|
);
|
|
18081
18081
|
}
|
|
18082
|
-
const { ObservationalMemory: OMClass } = await import('./observational-memory-
|
|
18082
|
+
const { ObservationalMemory: OMClass } = await import('./observational-memory-SRGNHILF.cjs');
|
|
18083
18083
|
const onIndexObservations = this.hasRetrievalSearch(omConfig.retrieval) ? async (observation) => {
|
|
18084
18084
|
await this.indexObservation(observation);
|
|
18085
18085
|
} : void 0;
|
|
@@ -19005,7 +19005,7 @@ Notes:
|
|
|
19005
19005
|
if (!effectiveConfig) return null;
|
|
19006
19006
|
const engine = await this.omEngine;
|
|
19007
19007
|
if (!engine) return null;
|
|
19008
|
-
const { ObservationalMemoryProcessor } = await import('./observational-memory-
|
|
19008
|
+
const { ObservationalMemoryProcessor } = await import('./observational-memory-SRGNHILF.cjs');
|
|
19009
19009
|
return new ObservationalMemoryProcessor(engine, this, {
|
|
19010
19010
|
temporalMarkers: effectiveConfig.temporalMarkers
|
|
19011
19011
|
});
|
|
@@ -19014,11 +19014,11 @@ Notes:
|
|
|
19014
19014
|
|
|
19015
19015
|
Object.defineProperty(exports, "ModelByInputTokens", {
|
|
19016
19016
|
enumerable: true,
|
|
19017
|
-
get: function () { return
|
|
19017
|
+
get: function () { return chunkBK3AYI7X_cjs.ModelByInputTokens; }
|
|
19018
19018
|
});
|
|
19019
19019
|
Object.defineProperty(exports, "getObservationsAsOf", {
|
|
19020
19020
|
enumerable: true,
|
|
19021
|
-
get: function () { return
|
|
19021
|
+
get: function () { return chunkBK3AYI7X_cjs.getObservationsAsOf; }
|
|
19022
19022
|
});
|
|
19023
19023
|
Object.defineProperty(exports, "MessageHistory", {
|
|
19024
19024
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { truncateStringByTokens, resolveToolResultValue, formatToolResultForObserver } from './chunk-
|
|
2
|
-
export { ModelByInputTokens, getObservationsAsOf } from './chunk-
|
|
1
|
+
import { truncateStringByTokens, resolveToolResultValue, formatToolResultForObserver } from './chunk-KLETR4RS.js';
|
|
2
|
+
export { ModelByInputTokens, getObservationsAsOf } from './chunk-KLETR4RS.js';
|
|
3
3
|
import { ZodFirstPartyTypeKind } from 'zod/v3';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import * as z4 from 'zod/v4';
|
|
@@ -18056,7 +18056,7 @@ ${workingMemory}`;
|
|
|
18056
18056
|
"Observational memory requires @mastra/core support for request-response-id-rotation. Please bump @mastra/core to a newer version."
|
|
18057
18057
|
);
|
|
18058
18058
|
}
|
|
18059
|
-
const { ObservationalMemory: OMClass } = await import('./observational-memory-
|
|
18059
|
+
const { ObservationalMemory: OMClass } = await import('./observational-memory-K5ES5KKQ.js');
|
|
18060
18060
|
const onIndexObservations = this.hasRetrievalSearch(omConfig.retrieval) ? async (observation) => {
|
|
18061
18061
|
await this.indexObservation(observation);
|
|
18062
18062
|
} : void 0;
|
|
@@ -18982,7 +18982,7 @@ Notes:
|
|
|
18982
18982
|
if (!effectiveConfig) return null;
|
|
18983
18983
|
const engine = await this.omEngine;
|
|
18984
18984
|
if (!engine) return null;
|
|
18985
|
-
const { ObservationalMemoryProcessor } = await import('./observational-memory-
|
|
18985
|
+
const { ObservationalMemoryProcessor } = await import('./observational-memory-K5ES5KKQ.js');
|
|
18986
18986
|
return new ObservationalMemoryProcessor(engine, this, {
|
|
18987
18987
|
temporalMarkers: effectiveConfig.temporalMarkers
|
|
18988
18988
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ModelByInputTokens, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, ObservationalMemoryProcessor, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, combineObservationGroupRanges, deriveObservationGroupProvenance, extractCurrentTask, formatMessagesForObserver, getObservationsAsOf, hasCurrentTaskSection, injectAnchorIds, optimizeObservationsForContext, parseAnchorId, parseObservationGroups, parseObserverOutput, reconcileObservationGroupsFromReflection, renderObservationGroupsForReflection, stripEphemeralAnchorIds, stripObservationGroups, wrapInObservationGroup } from './chunk-
|
|
1
|
+
export { ModelByInputTokens, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, ObservationalMemoryProcessor, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, combineObservationGroupRanges, deriveObservationGroupProvenance, extractCurrentTask, formatMessagesForObserver, getObservationsAsOf, hasCurrentTaskSection, injectAnchorIds, optimizeObservationsForContext, parseAnchorId, parseObservationGroups, parseObserverOutput, reconcileObservationGroupsFromReflection, renderObservationGroupsForReflection, stripEphemeralAnchorIds, stripObservationGroups, wrapInObservationGroup } from './chunk-KLETR4RS.js';
|
|
2
2
|
export { OBSERVATIONAL_MEMORY_DEFAULTS, OBSERVATION_CONTEXT_INSTRUCTIONS, OBSERVATION_CONTEXT_PROMPT, OBSERVATION_CONTINUATION_HINT } from './chunk-LSJJAJAF.js';
|
|
3
|
-
//# sourceMappingURL=observational-memory-
|
|
4
|
-
//# sourceMappingURL=observational-memory-
|
|
3
|
+
//# sourceMappingURL=observational-memory-K5ES5KKQ.js.map
|
|
4
|
+
//# sourceMappingURL=observational-memory-K5ES5KKQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"observational-memory-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"observational-memory-K5ES5KKQ.js"}
|
|
@@ -1,101 +1,101 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkBK3AYI7X_cjs = require('./chunk-BK3AYI7X.cjs');
|
|
4
4
|
var chunkD4J4XPGM_cjs = require('./chunk-D4J4XPGM.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "ModelByInputTokens", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkBK3AYI7X_cjs.ModelByInputTokens; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "OBSERVER_SYSTEM_PROMPT", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkBK3AYI7X_cjs.OBSERVER_SYSTEM_PROMPT; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "ObservationalMemory", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkBK3AYI7X_cjs.ObservationalMemory; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "ObservationalMemoryProcessor", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkBK3AYI7X_cjs.ObservationalMemoryProcessor; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "TokenCounter", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkBK3AYI7X_cjs.TokenCounter; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "buildObserverPrompt", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkBK3AYI7X_cjs.buildObserverPrompt; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "buildObserverSystemPrompt", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkBK3AYI7X_cjs.buildObserverSystemPrompt; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "combineObservationGroupRanges", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkBK3AYI7X_cjs.combineObservationGroupRanges; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "deriveObservationGroupProvenance", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkBK3AYI7X_cjs.deriveObservationGroupProvenance; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "extractCurrentTask", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkBK3AYI7X_cjs.extractCurrentTask; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "formatMessagesForObserver", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkBK3AYI7X_cjs.formatMessagesForObserver; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "getObservationsAsOf", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkBK3AYI7X_cjs.getObservationsAsOf; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "hasCurrentTaskSection", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkBK3AYI7X_cjs.hasCurrentTaskSection; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "injectAnchorIds", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkBK3AYI7X_cjs.injectAnchorIds; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "optimizeObservationsForContext", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunkBK3AYI7X_cjs.optimizeObservationsForContext; }
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "parseAnchorId", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunkBK3AYI7X_cjs.parseAnchorId; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "parseObservationGroups", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkBK3AYI7X_cjs.parseObservationGroups; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "parseObserverOutput", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkBK3AYI7X_cjs.parseObserverOutput; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "reconcileObservationGroupsFromReflection", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkBK3AYI7X_cjs.reconcileObservationGroupsFromReflection; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "renderObservationGroupsForReflection", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkBK3AYI7X_cjs.renderObservationGroupsForReflection; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "stripEphemeralAnchorIds", {
|
|
89
89
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkBK3AYI7X_cjs.stripEphemeralAnchorIds; }
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "stripObservationGroups", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkBK3AYI7X_cjs.stripObservationGroups; }
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "wrapInObservationGroup", {
|
|
97
97
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkBK3AYI7X_cjs.wrapInObservationGroup; }
|
|
99
99
|
});
|
|
100
100
|
Object.defineProperty(exports, "OBSERVATIONAL_MEMORY_DEFAULTS", {
|
|
101
101
|
enumerable: true,
|
|
@@ -113,5 +113,5 @@ Object.defineProperty(exports, "OBSERVATION_CONTINUATION_HINT", {
|
|
|
113
113
|
enumerable: true,
|
|
114
114
|
get: function () { return chunkD4J4XPGM_cjs.OBSERVATION_CONTINUATION_HINT; }
|
|
115
115
|
});
|
|
116
|
-
//# sourceMappingURL=observational-memory-
|
|
117
|
-
//# sourceMappingURL=observational-memory-
|
|
116
|
+
//# sourceMappingURL=observational-memory-SRGNHILF.cjs.map
|
|
117
|
+
//# sourceMappingURL=observational-memory-SRGNHILF.cjs.map
|
package/dist/{observational-memory-7M2T5EOV.cjs.map → observational-memory-SRGNHILF.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"observational-memory-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"observational-memory-SRGNHILF.cjs"}
|
|
@@ -1,101 +1,101 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkBK3AYI7X_cjs = require('../chunk-BK3AYI7X.cjs');
|
|
4
4
|
var chunkD4J4XPGM_cjs = require('../chunk-D4J4XPGM.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "ModelByInputTokens", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkBK3AYI7X_cjs.ModelByInputTokens; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "OBSERVER_SYSTEM_PROMPT", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkBK3AYI7X_cjs.OBSERVER_SYSTEM_PROMPT; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "ObservationalMemory", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkBK3AYI7X_cjs.ObservationalMemory; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "ObservationalMemoryProcessor", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkBK3AYI7X_cjs.ObservationalMemoryProcessor; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "TokenCounter", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkBK3AYI7X_cjs.TokenCounter; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "buildObserverPrompt", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkBK3AYI7X_cjs.buildObserverPrompt; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "buildObserverSystemPrompt", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkBK3AYI7X_cjs.buildObserverSystemPrompt; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "combineObservationGroupRanges", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkBK3AYI7X_cjs.combineObservationGroupRanges; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "deriveObservationGroupProvenance", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkBK3AYI7X_cjs.deriveObservationGroupProvenance; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "extractCurrentTask", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkBK3AYI7X_cjs.extractCurrentTask; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "formatMessagesForObserver", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkBK3AYI7X_cjs.formatMessagesForObserver; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "getObservationsAsOf", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkBK3AYI7X_cjs.getObservationsAsOf; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "hasCurrentTaskSection", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkBK3AYI7X_cjs.hasCurrentTaskSection; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "injectAnchorIds", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkBK3AYI7X_cjs.injectAnchorIds; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "optimizeObservationsForContext", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunkBK3AYI7X_cjs.optimizeObservationsForContext; }
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "parseAnchorId", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunkBK3AYI7X_cjs.parseAnchorId; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "parseObservationGroups", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkBK3AYI7X_cjs.parseObservationGroups; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "parseObserverOutput", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkBK3AYI7X_cjs.parseObserverOutput; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "reconcileObservationGroupsFromReflection", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkBK3AYI7X_cjs.reconcileObservationGroupsFromReflection; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "renderObservationGroupsForReflection", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkBK3AYI7X_cjs.renderObservationGroupsForReflection; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "stripEphemeralAnchorIds", {
|
|
89
89
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkBK3AYI7X_cjs.stripEphemeralAnchorIds; }
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "stripObservationGroups", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkBK3AYI7X_cjs.stripObservationGroups; }
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "wrapInObservationGroup", {
|
|
97
97
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkBK3AYI7X_cjs.wrapInObservationGroup; }
|
|
99
99
|
});
|
|
100
100
|
Object.defineProperty(exports, "OBSERVATIONAL_MEMORY_DEFAULTS", {
|
|
101
101
|
enumerable: true,
|
package/dist/processors/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ModelByInputTokens, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, ObservationalMemoryProcessor, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, combineObservationGroupRanges, deriveObservationGroupProvenance, extractCurrentTask, formatMessagesForObserver, getObservationsAsOf, hasCurrentTaskSection, injectAnchorIds, optimizeObservationsForContext, parseAnchorId, parseObservationGroups, parseObserverOutput, reconcileObservationGroupsFromReflection, renderObservationGroupsForReflection, stripEphemeralAnchorIds, stripObservationGroups, wrapInObservationGroup } from '../chunk-
|
|
1
|
+
export { ModelByInputTokens, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, ObservationalMemoryProcessor, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, combineObservationGroupRanges, deriveObservationGroupProvenance, extractCurrentTask, formatMessagesForObserver, getObservationsAsOf, hasCurrentTaskSection, injectAnchorIds, optimizeObservationsForContext, parseAnchorId, parseObservationGroups, parseObserverOutput, reconcileObservationGroupsFromReflection, renderObservationGroupsForReflection, stripEphemeralAnchorIds, stripObservationGroups, wrapInObservationGroup } from '../chunk-KLETR4RS.js';
|
|
2
2
|
export { OBSERVATIONAL_MEMORY_DEFAULTS, OBSERVATION_CONTEXT_INSTRUCTIONS, OBSERVATION_CONTEXT_PROMPT, OBSERVATION_CONTINUATION_HINT } from '../chunk-LSJJAJAF.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -83,7 +83,12 @@ export declare class ObservationTurn {
|
|
|
83
83
|
*/
|
|
84
84
|
step(stepNumber: number): ObservationStep;
|
|
85
85
|
/**
|
|
86
|
-
* Finalize the turn: save any remaining messages and return the
|
|
86
|
+
* Finalize the turn: save any remaining messages and return the current cached record.
|
|
87
|
+
*
|
|
88
|
+
* When async observation buffering is enabled and there are unobserved messages,
|
|
89
|
+
* a background buffer operation is kicked off so that observations are computed
|
|
90
|
+
* proactively while the agent is idle, rather than waiting for the next turn.
|
|
91
|
+
* The returned record does not wait for that background buffering pass to finish.
|
|
87
92
|
*/
|
|
88
93
|
end(): Promise<TurnResult>;
|
|
89
94
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn.d.ts","sourceRoot":"","sources":["../../../../src/processors/observational-memory/observation-turn/turn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"turn.d.ts","sourceRoot":"","sources":["../../../../src/processors/observational-memory/observation-turn/turn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAGtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,OAAO,CAAC,CAA4B;IAC5C,OAAO,CAAC,QAAQ,CAAC,CAAc;IAC/B,OAAO,CAAC,YAAY,CAAC,CAAkB;IACvC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;IAEvB,8FAA8F;IAC9F,OAAO,CAAC,uBAAuB,CAAM;IAErC,6FAA6F;IAC7F,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAE/B,mDAAmD;IACnD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAE/B,sDAAsD;IACtD,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAE5C,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;IAE5C,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC;gBAEzB,IAAI,EAAE;QAChB,EAAE,EAAE,mBAAmB,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,WAAW,CAAC;QACzB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;QAC5C,KAAK,CAAC,EAAE,oBAAoB,CAAC;KAC9B;IASD,QAAQ,CAAC,EAAE,EAAE,mBAAmB,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAElC,uFAAuF;IACvF,IAAI,MAAM,IAAI,yBAAyB,CAGtC;IAED,yCAAyC;IACzC,IAAI,OAAO,IAAI,WAAW,CAGzB;IAED,uCAAuC;IACvC,IAAI,WAAW,IAAI,eAAe,GAAG,SAAS,CAE7C;IAED,QAAQ,CAAC,KAAK,CAAC,EAAE,oBAAoB,GAAG,IAAI;IAK5C;;;;;OAKG;IACG,KAAK,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC;IAoCjE;;;OAGG;IACH,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe;IAQzC;;;;;;;OAOG;IACG,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;IAuChC;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC;;;OAGG;IACG,0BAA0B,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAUhE"}
|