@mastra/memory 1.41.1-alpha.2 → 1.41.1-alpha.3
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 +67 -67
- package/dist/docs/references/docs-memory-semantic-recall.md +2 -0
- 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-groups.d.ts +8 -0
- package/dist/processors/observational-memory/observation-groups.d.ts.map +1 -1
- package/dist/processors/observational-memory/reflector-runner.d.ts.map +1 -1
- package/dist/{src-DrWCcSnW.cjs → src-DvkS93hU.cjs} +27 -2
- package/dist/{src-DrWCcSnW.cjs.map → src-DvkS93hU.cjs.map} +1 -1
- package/dist/{src-wMl-5Ms8.js → src-KIKQ7ztT.js} +27 -2
- package/dist/{src-wMl-5Ms8.js.map → src-KIKQ7ztT.js.map} +1 -1
- package/package.json +3 -3
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,243 +1,243 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.41.1-alpha.
|
|
2
|
+
"version": "1.41.1-alpha.3",
|
|
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-KIKQ7ztT.js",
|
|
8
|
+
"line": 32196
|
|
9
9
|
},
|
|
10
10
|
"Extractor": {
|
|
11
11
|
"types": "dist/processors/observational-memory/extractor.d.ts",
|
|
12
|
-
"implementation": "dist/src-
|
|
12
|
+
"implementation": "dist/src-KIKQ7ztT.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-KIKQ7ztT.js",
|
|
18
|
+
"line": 31979
|
|
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-KIKQ7ztT.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-KIKQ7ztT.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-KIKQ7ztT.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-KIKQ7ztT.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-KIKQ7ztT.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-KIKQ7ztT.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-KIKQ7ztT.js",
|
|
53
|
+
"line": 37004
|
|
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-KIKQ7ztT.js",
|
|
58
|
+
"line": 39739
|
|
59
59
|
},
|
|
60
60
|
"TokenCounter": {
|
|
61
61
|
"types": "dist/processors/observational-memory/token-counter.d.ts",
|
|
62
|
-
"implementation": "dist/src-
|
|
62
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
63
63
|
"line": 28804
|
|
64
64
|
},
|
|
65
65
|
"WorkingMemoryExtractor": {
|
|
66
66
|
"types": "dist/processors/observational-memory/working-memory-extractor.d.ts",
|
|
67
|
-
"implementation": "dist/src-
|
|
67
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
68
68
|
"line": 29820
|
|
69
69
|
},
|
|
70
70
|
"buildObserverPrompt": {
|
|
71
71
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
72
|
-
"implementation": "dist/src-
|
|
72
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
73
73
|
"line": 26983
|
|
74
74
|
},
|
|
75
75
|
"buildObserverSystemPrompt": {
|
|
76
76
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
77
|
-
"implementation": "dist/src-
|
|
77
|
+
"implementation": "dist/src-KIKQ7ztT.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-KIKQ7ztT.js",
|
|
83
|
+
"line": 30299
|
|
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-KIKQ7ztT.js",
|
|
88
|
+
"line": 30343
|
|
89
89
|
},
|
|
90
90
|
"extractCurrentTask": {
|
|
91
91
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
92
|
-
"implementation": "dist/src-
|
|
92
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
93
93
|
"line": 27296
|
|
94
94
|
},
|
|
95
95
|
"formatMessagesForObserver": {
|
|
96
96
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
97
|
-
"implementation": "dist/src-
|
|
97
|
+
"implementation": "dist/src-KIKQ7ztT.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-KIKQ7ztT.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-KIKQ7ztT.js",
|
|
108
|
+
"line": 40046
|
|
109
109
|
},
|
|
110
110
|
"hasCurrentTaskSection": {
|
|
111
111
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
112
|
-
"implementation": "dist/src-
|
|
112
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
113
113
|
"line": 27284
|
|
114
114
|
},
|
|
115
115
|
"injectAnchorIds": {
|
|
116
116
|
"types": "dist/processors/observational-memory/anchor-ids.d.ts",
|
|
117
|
-
"implementation": "dist/src-
|
|
117
|
+
"implementation": "dist/src-KIKQ7ztT.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-KIKQ7ztT.js",
|
|
123
123
|
"line": 27317
|
|
124
124
|
},
|
|
125
125
|
"parseAnchorId": {
|
|
126
126
|
"types": "dist/processors/observational-memory/anchor-ids.d.ts",
|
|
127
|
-
"implementation": "dist/src-
|
|
127
|
+
"implementation": "dist/src-KIKQ7ztT.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-KIKQ7ztT.js",
|
|
133
|
+
"line": 30254
|
|
134
134
|
},
|
|
135
135
|
"parseObserverOutput": {
|
|
136
136
|
"types": "dist/processors/observational-memory/observer-agent.d.ts",
|
|
137
|
-
"implementation": "dist/src-
|
|
137
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
138
138
|
"line": 26994
|
|
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-KIKQ7ztT.js",
|
|
143
|
+
"line": 30362
|
|
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-KIKQ7ztT.js",
|
|
148
|
+
"line": 30328
|
|
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-KIKQ7ztT.js",
|
|
153
|
+
"line": 32216
|
|
154
154
|
},
|
|
155
155
|
"stripEphemeralAnchorIds": {
|
|
156
156
|
"types": "dist/processors/observational-memory/anchor-ids.d.ts",
|
|
157
|
-
"implementation": "dist/src-
|
|
157
|
+
"implementation": "dist/src-KIKQ7ztT.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-KIKQ7ztT.js",
|
|
163
|
+
"line": 30271
|
|
164
164
|
},
|
|
165
165
|
"summarizeConversation": {
|
|
166
166
|
"types": "dist/processors/observational-memory/summarize.d.ts",
|
|
167
|
-
"implementation": "dist/src-
|
|
167
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
168
168
|
"line": 29435
|
|
169
169
|
},
|
|
170
170
|
"wrapInObservationGroup": {
|
|
171
171
|
"types": "dist/processors/observational-memory/observation-groups.d.ts",
|
|
172
|
-
"implementation": "dist/src-
|
|
172
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
173
173
|
"line": 30225
|
|
174
174
|
},
|
|
175
175
|
"KnowledgeSemanticIndexCoordinator": {
|
|
176
176
|
"types": "dist/removed-subconscious.d.ts",
|
|
177
|
-
"implementation": "dist/src-
|
|
177
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
178
178
|
"line": 29867
|
|
179
179
|
},
|
|
180
180
|
"Memory": {
|
|
181
181
|
"types": "dist/index.d.ts",
|
|
182
|
-
"implementation": "dist/src-
|
|
183
|
-
"line":
|
|
182
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
183
|
+
"line": 40257
|
|
184
184
|
},
|
|
185
185
|
"SUMMARIZE_THREAD_DEFAULTS": {
|
|
186
186
|
"types": "dist/processors/observational-memory/summarize.d.ts",
|
|
187
|
-
"implementation": "dist/src-
|
|
187
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
188
188
|
"line": 29391
|
|
189
189
|
},
|
|
190
190
|
"StaleKnowledgeSemanticIndexError": {
|
|
191
191
|
"types": "dist/removed-subconscious.d.ts",
|
|
192
|
-
"implementation": "dist/src-
|
|
192
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
193
193
|
"line": 29873
|
|
194
194
|
},
|
|
195
195
|
"Subconscious": {
|
|
196
196
|
"types": "dist/removed-subconscious.d.ts",
|
|
197
|
-
"implementation": "dist/src-
|
|
197
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
198
198
|
"line": 29861
|
|
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-KIKQ7ztT.js",
|
|
203
|
+
"line": 32025
|
|
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-KIKQ7ztT.js",
|
|
208
|
+
"line": 32026
|
|
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-KIKQ7ztT.js",
|
|
213
|
+
"line": 32027
|
|
214
214
|
},
|
|
215
215
|
"deepMergeWorkingMemory": {
|
|
216
216
|
"types": "dist/tools/working-memory.d.ts",
|
|
217
|
-
"implementation": "dist/src-
|
|
217
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
218
218
|
"line": 29514
|
|
219
219
|
},
|
|
220
220
|
"extractWorkingMemoryContent": {
|
|
221
221
|
"types": "dist/index.d.ts",
|
|
222
|
-
"implementation": "dist/src-
|
|
223
|
-
"line":
|
|
222
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
223
|
+
"line": 40111
|
|
224
224
|
},
|
|
225
225
|
"extractWorkingMemoryTags": {
|
|
226
226
|
"types": "dist/index.d.ts",
|
|
227
|
-
"implementation": "dist/src-
|
|
228
|
-
"line":
|
|
227
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
228
|
+
"line": 40079
|
|
229
229
|
},
|
|
230
230
|
"removeWorkingMemoryTags": {
|
|
231
231
|
"types": "dist/index.d.ts",
|
|
232
|
-
"implementation": "dist/src-
|
|
233
|
-
"line":
|
|
232
|
+
"implementation": "dist/src-KIKQ7ztT.js",
|
|
233
|
+
"line": 40092
|
|
234
234
|
}
|
|
235
235
|
},
|
|
236
236
|
"modules": {
|
|
237
237
|
"processors": {
|
|
238
238
|
"index": "dist/processors/index.js",
|
|
239
239
|
"chunks": [
|
|
240
|
-
"src-
|
|
240
|
+
"src-KIKQ7ztT.js"
|
|
241
241
|
]
|
|
242
242
|
}
|
|
243
243
|
}
|
|
@@ -210,6 +210,8 @@ const agent = new Agent({
|
|
|
210
210
|
|
|
211
211
|
Filters match metadata stored on message embeddings when messages are saved. If thread metadata changes later, existing embeddings keep their previous metadata until those messages are saved or indexed again.
|
|
212
212
|
|
|
213
|
+
Agent runs store thread metadata on message embeddings. Messages saved by older versions, which didn't store it, don't match a filter until they're saved or indexed again.
|
|
214
|
+
|
|
213
215
|
Supported filter operators:
|
|
214
216
|
|
|
215
217
|
- `$and`: Logical AND
|
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-DvkS93hU.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-KIKQ7ztT.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-DvkS93hU.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-KIKQ7ztT.js";
|
|
@@ -6,6 +6,14 @@ export interface ObservationGroup {
|
|
|
6
6
|
}
|
|
7
7
|
export declare function generateAnchorId(): string;
|
|
8
8
|
export declare function wrapInObservationGroup(observations: string, range: string, id?: string, _sourceGroupIds?: string[], kind?: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Moves a cut of `cut` leading lines so it never splits an observation group. A cut inside a group
|
|
11
|
+
* moves back to just before the group's opening tag (and the blank lines that separate it from the
|
|
12
|
+
* previous group). When nothing precedes that group, the cut moves forward to just after its closing
|
|
13
|
+
* tag instead, so the whole group is cut. A cut outside every group, and observations without group
|
|
14
|
+
* tags, are returned unchanged.
|
|
15
|
+
*/
|
|
16
|
+
export declare function alignLineCutToObservationGroups(lines: readonly string[], cut: number): number;
|
|
9
17
|
export declare function parseObservationGroups(observations: string): ObservationGroup[];
|
|
10
18
|
export declare function stripObservationGroups(observations: string): string;
|
|
11
19
|
export declare function combineObservationGroupRanges(groups: ObservationGroup[]): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observation-groups.d.ts","sourceRoot":"","sources":["../../../src/processors/observational-memory/observation-groups.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAuKD,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,EAAE,SAAqB,EACvB,eAAe,CAAC,EAAE,MAAM,EAAE,EAC1B,IAAI,CAAC,EAAE,MAAM,GACZ,MAAM,CAIR;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAyB/E;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAQnE;AAmCD,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAiChF;AAED,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE;IAAE,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAAE,GAC5C,MAAM,GAAG,IAAI,CAcf;AAcD,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CA6ChH;AAED,wBAAgB,wCAAwC,CAAC,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAyBnH"}
|
|
1
|
+
{"version":3,"file":"observation-groups.d.ts","sourceRoot":"","sources":["../../../src/processors/observational-memory/observation-groups.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAuKD,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,EAAE,SAAqB,EACvB,eAAe,CAAC,EAAE,MAAM,EAAE,EAC1B,IAAI,CAAC,EAAE,MAAM,GACZ,MAAM,CAIR;AAOD;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAqB7F;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAyB/E;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAQnE;AAmCD,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAiChF;AAED,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE;IAAE,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAAE,GAC5C,MAAM,GAAG,IAAI,CAcf;AAcD,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CA6ChH;AAED,wBAAgB,wCAAwC,CAAC,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAyBnH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflector-runner.d.ts","sourceRoot":"","sources":["../../../src/processors/observational-memory/reflector-runner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,WAAW,EAAoB,MAAM,oBAAoB,CAAC;AAE3F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE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CAAC;YAAC,YAAY,CAAC,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAC9E,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;KACrC,CAAC,CAiSD;IAED;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAqGpC;;;OAGG;YACW,yBAAyB;IA0KvC;;;;;OAKG;YACW,6BAA6B;IAuL3C;;;;OAIG;IACG,YAAY,CAAC,IAAI,EAAE;QACvB,MAAM,EAAE,yBAAyB,CAAC;QAClC,iBAAiB,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,qBAAqB,CAAC;QAC/B,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,SAAS,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACtC,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAC5C,eAAe,CAAC,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;QACtD,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,YAAY,CAAC,EAAE,uBAAuB,CAAC;QACvC,eAAe,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,mBAAmB,GAAG,iBAAiB,CAAC,CAAC;QAC9E,8EAA8E;QAC9E,OAAO,CAAC,EAAE,cAAc,CAAC;QACzB,cAAc,CAAC,EAAE,cAAc,CAAC;QAChC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;QAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmbhB;CACF"}
|
|
@@ -30247,6 +30247,31 @@ function wrapInObservationGroup(observations, range, id = generateAnchorId(), _s
|
|
|
30247
30247
|
const content = observations.trim();
|
|
30248
30248
|
return `<observation-group id="${id}" range="${range}"${kind ? ` kind="${kind}"` : ""}>\n${content}\n</observation-group>`;
|
|
30249
30249
|
}
|
|
30250
|
+
function isObservationGroupOpeningLine(line) {
|
|
30251
|
+
const trimmed = line.trimStart();
|
|
30252
|
+
return trimmed.startsWith(OBSERVATION_GROUP_OPEN) && /\s/.test(trimmed[18] ?? "");
|
|
30253
|
+
}
|
|
30254
|
+
/**
|
|
30255
|
+
* Moves a cut of `cut` leading lines so it never splits an observation group. A cut inside a group
|
|
30256
|
+
* moves back to just before the group's opening tag (and the blank lines that separate it from the
|
|
30257
|
+
* previous group). When nothing precedes that group, the cut moves forward to just after its closing
|
|
30258
|
+
* tag instead, so the whole group is cut. A cut outside every group, and observations without group
|
|
30259
|
+
* tags, are returned unchanged.
|
|
30260
|
+
*/
|
|
30261
|
+
function alignLineCutToObservationGroups(lines, cut) {
|
|
30262
|
+
let openingLine = -1;
|
|
30263
|
+
for (let i = 0; i < cut; i++) {
|
|
30264
|
+
const line = lines[i];
|
|
30265
|
+
if (isObservationGroupOpeningLine(line)) openingLine = i;
|
|
30266
|
+
else if (line.trim() === OBSERVATION_GROUP_CLOSE) openingLine = -1;
|
|
30267
|
+
}
|
|
30268
|
+
if (openingLine === -1) return cut;
|
|
30269
|
+
let before = openingLine;
|
|
30270
|
+
while (before > 0 && lines[before - 1].trim() === "") before--;
|
|
30271
|
+
if (before > 0) return before;
|
|
30272
|
+
for (let i = cut; i < lines.length; i++) if (lines[i].trim() === OBSERVATION_GROUP_CLOSE) return i + 1;
|
|
30273
|
+
return cut;
|
|
30274
|
+
}
|
|
30250
30275
|
function parseObservationGroups(observations) {
|
|
30251
30276
|
if (!observations) return [];
|
|
30252
30277
|
const groups = [];
|
|
@@ -36070,7 +36095,7 @@ var ReflectorRunner = class {
|
|
|
36070
36095
|
const totalLines = allLines.length;
|
|
36071
36096
|
const avgTokensPerLine = totalLines > 0 ? observationTokens / totalLines : 0;
|
|
36072
36097
|
const activationPointTokens = reflectThreshold * bufferActivation;
|
|
36073
|
-
const linesToReflect = avgTokensPerLine > 0 ? Math.min(Math.floor(activationPointTokens / avgTokensPerLine), totalLines) : totalLines;
|
|
36098
|
+
const linesToReflect = alignLineCutToObservationGroups(allLines, avgTokensPerLine > 0 ? Math.min(Math.floor(activationPointTokens / avgTokensPerLine), totalLines) : totalLines);
|
|
36074
36099
|
const hookContext = {
|
|
36075
36100
|
threadId: currentRecord.threadId ?? void 0,
|
|
36076
36101
|
resourceId: currentRecord.resourceId ?? void 0,
|
|
@@ -42769,4 +42794,4 @@ Object.defineProperty(exports, "wrapInObservationGroup", {
|
|
|
42769
42794
|
}
|
|
42770
42795
|
});
|
|
42771
42796
|
|
|
42772
|
-
//# sourceMappingURL=src-
|
|
42797
|
+
//# sourceMappingURL=src-DvkS93hU.cjs.map
|