@mastra/memory 1.41.2-alpha.0 → 1.41.2-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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +76 -76
- 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/token-counter.d.ts.map +1 -1
- package/dist/{src-C-vHUKMZ.cjs → src-D49WAwNu.cjs} +17 -4
- package/dist/{src-C-vHUKMZ.cjs.map → src-D49WAwNu.cjs.map} +1 -1
- package/dist/{src-CshY_uyn.js → src-DGBUSKXy.js} +17 -4
- package/dist/{src-CshY_uyn.js.map → src-DGBUSKXy.js.map} +1 -1
- package/package.json +2 -2
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,243 +1,243 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.41.2-alpha.
|
|
2
|
+
"version": "1.41.2-alpha.1",
|
|
3
3
|
"package": "@mastra/memory",
|
|
4
4
|
"exports": {
|
|
5
5
|
"AUTO_MODEL_BY_PROVIDER": {
|
|
6
6
|
"types": "dist/processors/observational-memory/auto-model.d.ts",
|
|
7
|
-
"implementation": "dist/src-
|
|
8
|
-
"line":
|
|
7
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
8
|
+
"line": 32213
|
|
9
9
|
},
|
|
10
10
|
"Extractor": {
|
|
11
11
|
"types": "dist/processors/observational-memory/extractor.d.ts",
|
|
12
|
-
"implementation": "dist/src-
|
|
12
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
13
13
|
"line": 23939
|
|
14
14
|
},
|
|
15
15
|
"ModelByInputTokens": {
|
|
16
16
|
"types": "dist/processors/observational-memory/model-by-input-tokens.d.ts",
|
|
17
|
-
"implementation": "dist/src-
|
|
18
|
-
"line":
|
|
17
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
18
|
+
"line": 31996
|
|
19
19
|
},
|
|
20
20
|
"OBSERVATIONAL_MEMORY_DEFAULTS": {
|
|
21
21
|
"types": "dist/processors/observational-memory/constants.d.ts",
|
|
22
|
-
"implementation": "dist/src-
|
|
22
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
23
23
|
"line": 23675
|
|
24
24
|
},
|
|
25
25
|
"OBSERVATION_CONTEXT_INSTRUCTIONS": {
|
|
26
26
|
"types": "dist/processors/observational-memory/constants.d.ts",
|
|
27
|
-
"implementation": "dist/src-
|
|
27
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
28
28
|
"line": 23736
|
|
29
29
|
},
|
|
30
30
|
"OBSERVATION_CONTEXT_PROMPT": {
|
|
31
31
|
"types": "dist/processors/observational-memory/constants.d.ts",
|
|
32
|
-
"implementation": "dist/src-
|
|
32
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
33
33
|
"line": 23718
|
|
34
34
|
},
|
|
35
35
|
"OBSERVATION_CONTEXT_PROMPT_THREAD": {
|
|
36
36
|
"types": "dist/processors/observational-memory/constants.d.ts",
|
|
37
|
-
"implementation": "dist/src-
|
|
37
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
38
38
|
"line": 23723
|
|
39
39
|
},
|
|
40
40
|
"OBSERVATION_CONTINUATION_HINT": {
|
|
41
41
|
"types": "dist/processors/observational-memory/constants.d.ts",
|
|
42
|
-
"implementation": "dist/src-
|
|
42
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
43
43
|
"line": 23705
|
|
44
44
|
},
|
|
45
45
|
"OBSERVER_SYSTEM_PROMPT": {
|
|
46
46
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
47
|
-
"implementation": "dist/src-
|
|
47
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
48
48
|
"line": 26300
|
|
49
49
|
},
|
|
50
50
|
"ObservationalMemory": {
|
|
51
51
|
"types": "dist/processors/observational-memory/observational-memory.d.ts",
|
|
52
|
-
"implementation": "dist/src-
|
|
53
|
-
"line":
|
|
52
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
53
|
+
"line": 37021
|
|
54
54
|
},
|
|
55
55
|
"ObservationalMemoryProcessor": {
|
|
56
56
|
"types": "dist/processors/observational-memory/processor.d.ts",
|
|
57
|
-
"implementation": "dist/src-
|
|
58
|
-
"line":
|
|
57
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
58
|
+
"line": 39756
|
|
59
59
|
},
|
|
60
60
|
"TokenCounter": {
|
|
61
61
|
"types": "dist/processors/observational-memory/token-counter.d.ts",
|
|
62
|
-
"implementation": "dist/src-
|
|
63
|
-
"line":
|
|
62
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
63
|
+
"line": 28818
|
|
64
64
|
},
|
|
65
65
|
"WorkingMemoryExtractor": {
|
|
66
66
|
"types": "dist/processors/observational-memory/working-memory-extractor.d.ts",
|
|
67
|
-
"implementation": "dist/src-
|
|
68
|
-
"line":
|
|
67
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
68
|
+
"line": 29837
|
|
69
69
|
},
|
|
70
70
|
"buildObserverPrompt": {
|
|
71
71
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
72
|
-
"implementation": "dist/src-
|
|
72
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
73
73
|
"line": 26984
|
|
74
74
|
},
|
|
75
75
|
"buildObserverSystemPrompt": {
|
|
76
76
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
77
|
-
"implementation": "dist/src-
|
|
77
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
78
78
|
"line": 26194
|
|
79
79
|
},
|
|
80
80
|
"combineObservationGroupRanges": {
|
|
81
81
|
"types": "dist/processors/observational-memory/observation-groups.d.ts",
|
|
82
|
-
"implementation": "dist/src-
|
|
83
|
-
"line":
|
|
82
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
83
|
+
"line": 30316
|
|
84
84
|
},
|
|
85
85
|
"deriveObservationGroupProvenance": {
|
|
86
86
|
"types": "dist/processors/observational-memory/observation-groups.d.ts",
|
|
87
|
-
"implementation": "dist/src-
|
|
88
|
-
"line":
|
|
87
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
88
|
+
"line": 30360
|
|
89
89
|
},
|
|
90
90
|
"extractCurrentTask": {
|
|
91
91
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
92
|
-
"implementation": "dist/src-
|
|
92
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
93
93
|
"line": 27297
|
|
94
94
|
},
|
|
95
95
|
"formatMessagesForObserver": {
|
|
96
96
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
97
|
-
"implementation": "dist/src-
|
|
97
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
98
98
|
"line": 26735
|
|
99
99
|
},
|
|
100
100
|
"getObservationContextPrompt": {
|
|
101
101
|
"types": "dist/processors/observational-memory/constants.d.ts",
|
|
102
|
-
"implementation": "dist/src-
|
|
102
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
103
103
|
"line": 23729
|
|
104
104
|
},
|
|
105
105
|
"getObservationsAsOf": {
|
|
106
106
|
"types": "dist/processors/observational-memory/observation-utils.d.ts",
|
|
107
|
-
"implementation": "dist/src-
|
|
108
|
-
"line":
|
|
107
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
108
|
+
"line": 40063
|
|
109
109
|
},
|
|
110
110
|
"hasCurrentTaskSection": {
|
|
111
111
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
112
|
-
"implementation": "dist/src-
|
|
112
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
113
113
|
"line": 27285
|
|
114
114
|
},
|
|
115
115
|
"injectAnchorIds": {
|
|
116
116
|
"types": "dist/processors/observational-memory/anchor-ids.d.ts",
|
|
117
|
-
"implementation": "dist/src-
|
|
117
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
118
118
|
"line": 24916
|
|
119
119
|
},
|
|
120
120
|
"optimizeObservationsForContext": {
|
|
121
121
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
122
|
-
"implementation": "dist/src-
|
|
122
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
123
123
|
"line": 27318
|
|
124
124
|
},
|
|
125
125
|
"parseAnchorId": {
|
|
126
126
|
"types": "dist/processors/observational-memory/anchor-ids.d.ts",
|
|
127
|
-
"implementation": "dist/src-
|
|
127
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
128
128
|
"line": 24900
|
|
129
129
|
},
|
|
130
130
|
"parseObservationGroups": {
|
|
131
131
|
"types": "dist/processors/observational-memory/observation-groups.d.ts",
|
|
132
|
-
"implementation": "dist/src-
|
|
133
|
-
"line":
|
|
132
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
133
|
+
"line": 30271
|
|
134
134
|
},
|
|
135
135
|
"parseObserverOutput": {
|
|
136
136
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
137
|
-
"implementation": "dist/src-
|
|
137
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
138
138
|
"line": 26995
|
|
139
139
|
},
|
|
140
140
|
"reconcileObservationGroupsFromReflection": {
|
|
141
141
|
"types": "dist/processors/observational-memory/observation-groups.d.ts",
|
|
142
|
-
"implementation": "dist/src-
|
|
143
|
-
"line":
|
|
142
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
143
|
+
"line": 30379
|
|
144
144
|
},
|
|
145
145
|
"renderObservationGroupsForReflection": {
|
|
146
146
|
"types": "dist/processors/observational-memory/observation-groups.d.ts",
|
|
147
|
-
"implementation": "dist/src-
|
|
148
|
-
"line":
|
|
147
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
148
|
+
"line": 30345
|
|
149
149
|
},
|
|
150
150
|
"resolveAutoModelId": {
|
|
151
151
|
"types": "dist/processors/observational-memory/auto-model.d.ts",
|
|
152
|
-
"implementation": "dist/src-
|
|
153
|
-
"line":
|
|
152
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
153
|
+
"line": 32233
|
|
154
154
|
},
|
|
155
155
|
"stripEphemeralAnchorIds": {
|
|
156
156
|
"types": "dist/processors/observational-memory/anchor-ids.d.ts",
|
|
157
|
-
"implementation": "dist/src-
|
|
157
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
158
158
|
"line": 24939
|
|
159
159
|
},
|
|
160
160
|
"stripObservationGroups": {
|
|
161
161
|
"types": "dist/processors/observational-memory/observation-groups.d.ts",
|
|
162
|
-
"implementation": "dist/src-
|
|
163
|
-
"line":
|
|
162
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
163
|
+
"line": 30288
|
|
164
164
|
},
|
|
165
165
|
"summarizeConversation": {
|
|
166
166
|
"types": "dist/processors/observational-memory/summarize.d.ts",
|
|
167
|
-
"implementation": "dist/src-
|
|
168
|
-
"line":
|
|
167
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
168
|
+
"line": 29449
|
|
169
169
|
},
|
|
170
170
|
"wrapInObservationGroup": {
|
|
171
171
|
"types": "dist/processors/observational-memory/observation-groups.d.ts",
|
|
172
|
-
"implementation": "dist/src-
|
|
173
|
-
"line":
|
|
172
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
173
|
+
"line": 30242
|
|
174
174
|
},
|
|
175
175
|
"KnowledgeSemanticIndexCoordinator": {
|
|
176
176
|
"types": "dist/removed-subconscious.d.ts",
|
|
177
|
-
"implementation": "dist/src-
|
|
178
|
-
"line":
|
|
177
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
178
|
+
"line": 29884
|
|
179
179
|
},
|
|
180
180
|
"Memory": {
|
|
181
181
|
"types": "dist/index.d.ts",
|
|
182
|
-
"implementation": "dist/src-
|
|
183
|
-
"line":
|
|
182
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
183
|
+
"line": 40274
|
|
184
184
|
},
|
|
185
185
|
"SUMMARIZE_THREAD_DEFAULTS": {
|
|
186
186
|
"types": "dist/processors/observational-memory/summarize.d.ts",
|
|
187
|
-
"implementation": "dist/src-
|
|
188
|
-
"line":
|
|
187
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
188
|
+
"line": 29405
|
|
189
189
|
},
|
|
190
190
|
"StaleKnowledgeSemanticIndexError": {
|
|
191
191
|
"types": "dist/removed-subconscious.d.ts",
|
|
192
|
-
"implementation": "dist/src-
|
|
193
|
-
"line":
|
|
192
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
193
|
+
"line": 29890
|
|
194
194
|
},
|
|
195
195
|
"Subconscious": {
|
|
196
196
|
"types": "dist/removed-subconscious.d.ts",
|
|
197
|
-
"implementation": "dist/src-
|
|
198
|
-
"line":
|
|
197
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
198
|
+
"line": 29878
|
|
199
199
|
},
|
|
200
200
|
"WORKING_MEMORY_STATE_ID": {
|
|
201
201
|
"types": "dist/processors/working-memory-state/processor.d.ts",
|
|
202
|
-
"implementation": "dist/src-
|
|
203
|
-
"line":
|
|
202
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
203
|
+
"line": 32042
|
|
204
204
|
},
|
|
205
205
|
"WORKING_MEMORY_STATE_PROCESSOR_ID": {
|
|
206
206
|
"types": "dist/processors/working-memory-state/processor.d.ts",
|
|
207
|
-
"implementation": "dist/src-
|
|
208
|
-
"line":
|
|
207
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
208
|
+
"line": 32043
|
|
209
209
|
},
|
|
210
210
|
"WorkingMemoryStateProcessor": {
|
|
211
211
|
"types": "dist/processors/working-memory-state/processor.d.ts",
|
|
212
|
-
"implementation": "dist/src-
|
|
213
|
-
"line":
|
|
212
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
213
|
+
"line": 32044
|
|
214
214
|
},
|
|
215
215
|
"deepMergeWorkingMemory": {
|
|
216
216
|
"types": "dist/tools/working-memory.d.ts",
|
|
217
|
-
"implementation": "dist/src-
|
|
218
|
-
"line":
|
|
217
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
218
|
+
"line": 29528
|
|
219
219
|
},
|
|
220
220
|
"extractWorkingMemoryContent": {
|
|
221
221
|
"types": "dist/index.d.ts",
|
|
222
|
-
"implementation": "dist/src-
|
|
223
|
-
"line":
|
|
222
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
223
|
+
"line": 40128
|
|
224
224
|
},
|
|
225
225
|
"extractWorkingMemoryTags": {
|
|
226
226
|
"types": "dist/index.d.ts",
|
|
227
|
-
"implementation": "dist/src-
|
|
228
|
-
"line":
|
|
227
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
228
|
+
"line": 40096
|
|
229
229
|
},
|
|
230
230
|
"removeWorkingMemoryTags": {
|
|
231
231
|
"types": "dist/index.d.ts",
|
|
232
|
-
"implementation": "dist/src-
|
|
233
|
-
"line":
|
|
232
|
+
"implementation": "dist/src-DGBUSKXy.js",
|
|
233
|
+
"line": 40109
|
|
234
234
|
}
|
|
235
235
|
},
|
|
236
236
|
"modules": {
|
|
237
237
|
"processors": {
|
|
238
238
|
"index": "dist/processors/index.js",
|
|
239
239
|
"chunks": [
|
|
240
|
-
"src-
|
|
240
|
+
"src-DGBUSKXy.js"
|
|
241
241
|
]
|
|
242
242
|
}
|
|
243
243
|
}
|
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-D49WAwNu.cjs");
|
|
3
3
|
let _mastra_core_processors = require("@mastra/core/processors");
|
|
4
4
|
exports.AUTO_MODEL_BY_PROVIDER = require_src.AUTO_MODEL_BY_PROVIDER;
|
|
5
5
|
exports.Extractor = require_src.Extractor;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { d as AUTO_MODEL_BY_PROVIDER, U as Extractor, w as KnowledgeSemanticIndexCoordinator, t as Memory, n as MessageHistory, g as ModelByInputTokens, k as SUMMARIZE_THREAD_DEFAULTS, r as SemanticRecall, T as StaleKnowledgeSemanticIndexError, E as Subconscious, p as WORKING_MEMORY_STATE_ID, m as WORKING_MEMORY_STATE_PROCESSOR_ID, i as WorkingMemory, D as WorkingMemoryExtractor, h as WorkingMemoryStateProcessor, O as deepMergeWorkingMemory, a as extractWorkingMemoryContent, o as extractWorkingMemoryTags, c as getObservationsAsOf, s as removeWorkingMemoryTags, f as resolveAutoModelId, A as summarizeConversation } from "./src-
|
|
1
|
+
export { d as AUTO_MODEL_BY_PROVIDER, U as Extractor, w as KnowledgeSemanticIndexCoordinator, t as Memory, n as MessageHistory, g as ModelByInputTokens, k as SUMMARIZE_THREAD_DEFAULTS, r as SemanticRecall, T as StaleKnowledgeSemanticIndexError, E as Subconscious, p as WORKING_MEMORY_STATE_ID, m as WORKING_MEMORY_STATE_PROCESSOR_ID, i as WorkingMemory, D as WorkingMemoryExtractor, h as WorkingMemoryStateProcessor, O as deepMergeWorkingMemory, a as extractWorkingMemoryContent, o as extractWorkingMemoryTags, c as getObservationsAsOf, s as removeWorkingMemoryTags, f as resolveAutoModelId, A as summarizeConversation } from "./src-DGBUSKXy.js";
|
|
@@ -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-D49WAwNu.cjs");
|
|
3
3
|
exports.AUTO_MODEL_BY_PROVIDER = require_src.AUTO_MODEL_BY_PROVIDER;
|
|
4
4
|
exports.Extractor = require_src.Extractor;
|
|
5
5
|
exports.ModelByInputTokens = require_src.ModelByInputTokens;
|
package/dist/processors/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { d as AUTO_MODEL_BY_PROVIDER, U as Extractor, g as ModelByInputTokens, W as OBSERVATIONAL_MEMORY_DEFAULTS, G as OBSERVATION_CONTEXT_INSTRUCTIONS, K as OBSERVATION_CONTEXT_PROMPT, q as OBSERVATION_CONTEXT_PROMPT_THREAD, J as OBSERVATION_CONTINUATION_HINT, M as OBSERVER_SYSTEM_PROMPT, u as ObservationalMemory, l as ObservationalMemoryProcessor, j as TokenCounter, D as WorkingMemoryExtractor, N as buildObserverPrompt, P as buildObserverSystemPrompt, _ as combineObservationGroupRanges, v as deriveObservationGroupProvenance, F as extractCurrentTask, I as formatMessagesForObserver, Y as getObservationContextPrompt, c as getObservationsAsOf, L as hasCurrentTaskSection, B as injectAnchorIds, R as optimizeObservationsForContext, V as parseAnchorId, y as parseObservationGroups, z as parseObserverOutput, b as reconcileObservationGroupsFromReflection, x as renderObservationGroupsForReflection, f as resolveAutoModelId, H as stripEphemeralAnchorIds, S as stripObservationGroups, A as summarizeConversation, C as wrapInObservationGroup } from "../src-
|
|
1
|
+
export { d as AUTO_MODEL_BY_PROVIDER, U as Extractor, g as ModelByInputTokens, W as OBSERVATIONAL_MEMORY_DEFAULTS, G as OBSERVATION_CONTEXT_INSTRUCTIONS, K as OBSERVATION_CONTEXT_PROMPT, q as OBSERVATION_CONTEXT_PROMPT_THREAD, J as OBSERVATION_CONTINUATION_HINT, M as OBSERVER_SYSTEM_PROMPT, u as ObservationalMemory, l as ObservationalMemoryProcessor, j as TokenCounter, D as WorkingMemoryExtractor, N as buildObserverPrompt, P as buildObserverSystemPrompt, _ as combineObservationGroupRanges, v as deriveObservationGroupProvenance, F as extractCurrentTask, I as formatMessagesForObserver, Y as getObservationContextPrompt, c as getObservationsAsOf, L as hasCurrentTaskSection, B as injectAnchorIds, R as optimizeObservationsForContext, V as parseAnchorId, y as parseObservationGroups, z as parseObserverOutput, b as reconcileObservationGroupsFromReflection, x as renderObservationGroupsForReflection, f as resolveAutoModelId, H as stripEphemeralAnchorIds, S as stripObservationGroups, A as summarizeConversation, C as wrapInObservationGroup } from "../src-DGBUSKXy.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-counter.d.ts","sourceRoot":"","sources":["../../../src/processors/observational-memory/token-counter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAkB1D,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,wBAAwB,CAAC;CAC3C,CAAC;
|
|
1
|
+
{"version":3,"file":"token-counter.d.ts","sourceRoot":"","sources":["../../../src/processors/observational-memory/token-counter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAkB1D,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,wBAAwB,CAAC;CAC3C,CAAC;AA0ZF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEvD;AAqBD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAuCpE;AA4tBD;;;;GAIG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAA2B;IAChE,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAkD;IAC3F,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAgE;IAI3G,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAO;IAEjD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAM;IAErD,YAAY,OAAO,CAAC,EAAE,mBAAmB,EAGxC;IAED,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAI3F;IAED,OAAO,CAAC,eAAe;IAIvB;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhC;IAED,OAAO,CAAC,yBAAyB;IAkBjC,OAAO,CAAC,8BAA8B;IAiBtC,OAAO,CAAC,4BAA4B;IAkBpC,OAAO,CAAC,iCAAiC;IAOzC,OAAO,CAAC,gCAAgC;IA4IxC,OAAO,CAAC,wBAAwB;IAsEhC,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,2BAA2B;IAInC,OAAO,CAAC,uBAAuB;IAkC/B,OAAO,CAAC,iCAAiC;YAiC3B,oCAAoC;YAyBpC,wBAAwB;IAyFtC;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAuB9B,OAAO,CAAC,sBAAsB;IAwI9B;;;;;;;OAOG;IACH,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CA+B7C;IAEK,iBAAiB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BjE;IAED;;OAEG;IACH,aAAa,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,MAAM,CAQjD;IAEK,kBAAkB,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAKrE;IAED;;OAEG;IACH,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAE9C;CACF"}
|
|
@@ -28100,6 +28100,19 @@ function buildEstimateKey(kind, text) {
|
|
|
28100
28100
|
function resolveEstimatorId() {
|
|
28101
28101
|
return "tokenx";
|
|
28102
28102
|
}
|
|
28103
|
+
const ATTACHMENT_CONTENT_PART_TYPES = /* @__PURE__ */ new Set([
|
|
28104
|
+
"image",
|
|
28105
|
+
"image-data",
|
|
28106
|
+
"media",
|
|
28107
|
+
"audio",
|
|
28108
|
+
"file-data"
|
|
28109
|
+
]);
|
|
28110
|
+
/** Mirrors the parts countMultimodalToolResultContent counts as attachments. */
|
|
28111
|
+
function isAttachmentContentPart(item) {
|
|
28112
|
+
if (!item || typeof item !== "object") return false;
|
|
28113
|
+
const contentPart = item;
|
|
28114
|
+
return ATTACHMENT_CONTENT_PART_TYPES.has(contentPart.type) && typeof contentPart.data === "string";
|
|
28115
|
+
}
|
|
28103
28116
|
function isTokenEstimateEntry(value) {
|
|
28104
28117
|
if (!value || typeof value !== "object") return false;
|
|
28105
28118
|
const entry = value;
|
|
@@ -28892,12 +28905,12 @@ var TokenCounter = class TokenCounter {
|
|
|
28892
28905
|
}
|
|
28893
28906
|
countMultimodalToolResultContent(part, toolResult) {
|
|
28894
28907
|
if (!toolResult || typeof toolResult !== "object") return;
|
|
28908
|
+
const output = toolResult;
|
|
28909
|
+
const content = output.type === "content" && Array.isArray(output.value) ? output.value : output.content;
|
|
28910
|
+
if (!Array.isArray(content) || !content.some(isAttachmentContentPart)) return;
|
|
28895
28911
|
const resultKey = buildEstimateKey("tool-result-multimodal-content-source", JSON.stringify(toolResult));
|
|
28896
28912
|
const cached = this.multimodalToolResultCounts.get(part);
|
|
28897
28913
|
if (cached?.resultKey === resultKey) return cached.tokens;
|
|
28898
|
-
const output = toolResult;
|
|
28899
|
-
const content = output.type === "content" && Array.isArray(output.value) ? output.value : output.content;
|
|
28900
|
-
if (!Array.isArray(content)) return;
|
|
28901
28914
|
let hasAttachment = false;
|
|
28902
28915
|
let tokens = 0;
|
|
28903
28916
|
const cacheParts = [];
|
|
@@ -42798,4 +42811,4 @@ Object.defineProperty(exports, "wrapInObservationGroup", {
|
|
|
42798
42811
|
}
|
|
42799
42812
|
});
|
|
42800
42813
|
|
|
42801
|
-
//# sourceMappingURL=src-
|
|
42814
|
+
//# sourceMappingURL=src-D49WAwNu.cjs.map
|