@mastra/memory 1.10.0 → 1.10.1-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 +9 -0
- package/dist/{chunk-EVBFYGDL.cjs → chunk-HSOEY7M2.cjs} +10 -6
- package/dist/chunk-HSOEY7M2.cjs.map +1 -0
- package/dist/{chunk-7A3UGAXY.js → chunk-K2NLYL2O.js} +10 -6
- package/dist/chunk-K2NLYL2O.js.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +30 -30
- package/dist/index.cjs +10 -10
- package/dist/index.js +3 -3
- package/dist/{observational-memory-COYJCVX3.cjs → observational-memory-DJMF2UNC.cjs} +29 -29
- package/dist/{observational-memory-COYJCVX3.cjs.map → observational-memory-DJMF2UNC.cjs.map} +1 -1
- package/dist/{observational-memory-K2U3QQIO.js → observational-memory-NMQ7URIP.js} +3 -3
- package/dist/{observational-memory-K2U3QQIO.js.map → observational-memory-NMQ7URIP.js.map} +1 -1
- package/dist/processors/index.cjs +27 -27
- package/dist/processors/index.js +1 -1
- package/dist/processors/observational-memory/observational-memory.d.ts +2 -2
- package/dist/processors/observational-memory/observational-memory.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-7A3UGAXY.js.map +0 -1
- package/dist/chunk-EVBFYGDL.cjs.map +0 -1
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.10.0",
|
|
2
|
+
"version": "1.10.1-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-K2NLYL2O.js",
|
|
8
8
|
"line": 343
|
|
9
9
|
},
|
|
10
10
|
"OBSERVATIONAL_MEMORY_DEFAULTS": {
|
|
11
11
|
"types": "dist/processors/index.d.ts",
|
|
12
|
-
"implementation": "dist/chunk-
|
|
12
|
+
"implementation": "dist/chunk-K2NLYL2O.js"
|
|
13
13
|
},
|
|
14
14
|
"OBSERVATION_CONTEXT_INSTRUCTIONS": {
|
|
15
15
|
"types": "dist/processors/index.d.ts",
|
|
16
|
-
"implementation": "dist/chunk-
|
|
16
|
+
"implementation": "dist/chunk-K2NLYL2O.js"
|
|
17
17
|
},
|
|
18
18
|
"OBSERVATION_CONTEXT_PROMPT": {
|
|
19
19
|
"types": "dist/processors/index.d.ts",
|
|
20
|
-
"implementation": "dist/chunk-
|
|
20
|
+
"implementation": "dist/chunk-K2NLYL2O.js"
|
|
21
21
|
},
|
|
22
22
|
"OBSERVATION_CONTINUATION_HINT": {
|
|
23
23
|
"types": "dist/processors/index.d.ts",
|
|
24
|
-
"implementation": "dist/chunk-
|
|
24
|
+
"implementation": "dist/chunk-K2NLYL2O.js"
|
|
25
25
|
},
|
|
26
26
|
"OBSERVER_SYSTEM_PROMPT": {
|
|
27
27
|
"types": "dist/processors/index.d.ts",
|
|
28
|
-
"implementation": "dist/chunk-
|
|
28
|
+
"implementation": "dist/chunk-K2NLYL2O.js"
|
|
29
29
|
},
|
|
30
30
|
"ObservationalMemory": {
|
|
31
31
|
"types": "dist/processors/index.d.ts",
|
|
32
|
-
"implementation": "dist/chunk-
|
|
33
|
-
"line":
|
|
32
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
33
|
+
"line": 3509
|
|
34
34
|
},
|
|
35
35
|
"TokenCounter": {
|
|
36
36
|
"types": "dist/processors/index.d.ts",
|
|
37
|
-
"implementation": "dist/chunk-
|
|
37
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
38
38
|
"line": 2936
|
|
39
39
|
},
|
|
40
40
|
"buildObserverPrompt": {
|
|
41
41
|
"types": "dist/processors/index.d.ts",
|
|
42
|
-
"implementation": "dist/chunk-
|
|
42
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
43
43
|
"line": 1519
|
|
44
44
|
},
|
|
45
45
|
"buildObserverSystemPrompt": {
|
|
46
46
|
"types": "dist/processors/index.d.ts",
|
|
47
|
-
"implementation": "dist/chunk-
|
|
47
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
48
48
|
"line": 986
|
|
49
49
|
},
|
|
50
50
|
"combineObservationGroupRanges": {
|
|
51
51
|
"types": "dist/processors/index.d.ts",
|
|
52
|
-
"implementation": "dist/chunk-
|
|
52
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
53
53
|
"line": 432
|
|
54
54
|
},
|
|
55
55
|
"deriveObservationGroupProvenance": {
|
|
56
56
|
"types": "dist/processors/index.d.ts",
|
|
57
|
-
"implementation": "dist/chunk-
|
|
57
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
58
58
|
"line": 459
|
|
59
59
|
},
|
|
60
60
|
"extractCurrentTask": {
|
|
61
61
|
"types": "dist/processors/index.d.ts",
|
|
62
|
-
"implementation": "dist/chunk-
|
|
62
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
63
63
|
"line": 1633
|
|
64
64
|
},
|
|
65
65
|
"formatMessagesForObserver": {
|
|
66
66
|
"types": "dist/processors/index.d.ts",
|
|
67
|
-
"implementation": "dist/chunk-
|
|
67
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
68
68
|
"line": 1252
|
|
69
69
|
},
|
|
70
70
|
"getObservationsAsOf": {
|
|
71
71
|
"types": "dist/processors/index.d.ts",
|
|
72
|
-
"implementation": "dist/chunk-
|
|
73
|
-
"line":
|
|
72
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
73
|
+
"line": 7811
|
|
74
74
|
},
|
|
75
75
|
"hasCurrentTaskSection": {
|
|
76
76
|
"types": "dist/processors/index.d.ts",
|
|
77
|
-
"implementation": "dist/chunk-
|
|
77
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
78
78
|
"line": 1621
|
|
79
79
|
},
|
|
80
80
|
"injectAnchorIds": {
|
|
81
81
|
"types": "dist/processors/index.d.ts",
|
|
82
|
-
"implementation": "dist/chunk-
|
|
82
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
83
83
|
"line": 543
|
|
84
84
|
},
|
|
85
85
|
"optimizeObservationsForContext": {
|
|
86
86
|
"types": "dist/processors/index.d.ts",
|
|
87
|
-
"implementation": "dist/chunk-
|
|
87
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
88
88
|
"line": 1644
|
|
89
89
|
},
|
|
90
90
|
"parseAnchorId": {
|
|
91
91
|
"types": "dist/processors/index.d.ts",
|
|
92
|
-
"implementation": "dist/chunk-
|
|
92
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
93
93
|
"line": 516
|
|
94
94
|
},
|
|
95
95
|
"parseObservationGroups": {
|
|
96
96
|
"types": "dist/processors/index.d.ts",
|
|
97
|
-
"implementation": "dist/chunk-
|
|
97
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
98
98
|
"line": 404
|
|
99
99
|
},
|
|
100
100
|
"parseObserverOutput": {
|
|
101
101
|
"types": "dist/processors/index.d.ts",
|
|
102
|
-
"implementation": "dist/chunk-
|
|
102
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
103
103
|
"line": 1529
|
|
104
104
|
},
|
|
105
105
|
"reconcileObservationGroupsFromReflection": {
|
|
106
106
|
"types": "dist/processors/index.d.ts",
|
|
107
|
-
"implementation": "dist/chunk-
|
|
107
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
108
108
|
"line": 486
|
|
109
109
|
},
|
|
110
110
|
"renderObservationGroupsForReflection": {
|
|
111
111
|
"types": "dist/processors/index.d.ts",
|
|
112
|
-
"implementation": "dist/chunk-
|
|
112
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
113
113
|
"line": 439
|
|
114
114
|
},
|
|
115
115
|
"stripEphemeralAnchorIds": {
|
|
116
116
|
"types": "dist/processors/index.d.ts",
|
|
117
|
-
"implementation": "dist/chunk-
|
|
117
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
118
118
|
"line": 573
|
|
119
119
|
},
|
|
120
120
|
"stripObservationGroups": {
|
|
121
121
|
"types": "dist/processors/index.d.ts",
|
|
122
|
-
"implementation": "dist/chunk-
|
|
122
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
123
123
|
"line": 426
|
|
124
124
|
},
|
|
125
125
|
"wrapInObservationGroup": {
|
|
126
126
|
"types": "dist/processors/index.d.ts",
|
|
127
|
-
"implementation": "dist/chunk-
|
|
127
|
+
"implementation": "dist/chunk-K2NLYL2O.js",
|
|
128
128
|
"line": 397
|
|
129
129
|
},
|
|
130
130
|
"extractWorkingMemoryContent": {
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"processors": {
|
|
157
157
|
"index": "dist/processors/index.js",
|
|
158
158
|
"chunks": [
|
|
159
|
-
"chunk-
|
|
159
|
+
"chunk-K2NLYL2O.js"
|
|
160
160
|
]
|
|
161
161
|
}
|
|
162
162
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkCK4U3AYR_cjs = require('./chunk-CK4U3AYR.cjs');
|
|
4
4
|
var chunkIDRQZVB4_cjs = require('./chunk-IDRQZVB4.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkHSOEY7M2_cjs = require('./chunk-HSOEY7M2.cjs');
|
|
6
6
|
var v3 = require('zod/v3');
|
|
7
7
|
var zod = require('zod');
|
|
8
8
|
var z4 = require('zod/v4');
|
|
@@ -15503,7 +15503,7 @@ function formatTimestamp(date) {
|
|
|
15503
15503
|
}
|
|
15504
15504
|
function truncateByTokens(text4, maxTokens, hint) {
|
|
15505
15505
|
if (tokenx.estimateTokenCount(text4) <= maxTokens) return { text: text4, wasTruncated: false };
|
|
15506
|
-
const truncated =
|
|
15506
|
+
const truncated = chunkHSOEY7M2_cjs.truncateStringByTokens(text4, maxTokens);
|
|
15507
15507
|
const suffix = hint ? ` [${hint} for more]` : "";
|
|
15508
15508
|
return { text: truncated + suffix, wasTruncated: true };
|
|
15509
15509
|
}
|
|
@@ -15536,11 +15536,11 @@ function formatMessageParts(msg, detail) {
|
|
|
15536
15536
|
} else if (partType === "tool-invocation") {
|
|
15537
15537
|
const inv = part.toolInvocation;
|
|
15538
15538
|
if (inv.state === "result") {
|
|
15539
|
-
const { value: resultValue } =
|
|
15539
|
+
const { value: resultValue } = chunkHSOEY7M2_cjs.resolveToolResultValue(
|
|
15540
15540
|
part,
|
|
15541
15541
|
inv.result
|
|
15542
15542
|
);
|
|
15543
|
-
const resultStr =
|
|
15543
|
+
const resultStr = chunkHSOEY7M2_cjs.formatToolResultForObserver(resultValue, { maxTokens: HIGH_DETAIL_TOOL_RESULT_TOKENS });
|
|
15544
15544
|
const fullText = `[Tool Result: ${inv.toolName}]
|
|
15545
15545
|
${resultStr}`;
|
|
15546
15546
|
parts.push(makePart(msg, i, "tool-result", fullText, detail));
|
|
@@ -15603,7 +15603,7 @@ function renderFormattedParts(parts, timestamps, options) {
|
|
|
15603
15603
|
const text4 = buildRenderedText(parts, timestamps);
|
|
15604
15604
|
let totalTokens = tokenx.estimateTokenCount(text4);
|
|
15605
15605
|
if (totalTokens > options.maxTokens) {
|
|
15606
|
-
const truncated =
|
|
15606
|
+
const truncated = chunkHSOEY7M2_cjs.truncateStringByTokens(text4, options.maxTokens);
|
|
15607
15607
|
return { text: truncated, truncated: true, tokenOffset: totalTokens - options.maxTokens };
|
|
15608
15608
|
}
|
|
15609
15609
|
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));
|
|
@@ -15636,7 +15636,7 @@ function renderFormattedParts(parts, timestamps, options) {
|
|
|
15636
15636
|
if (expandedTokens <= options.maxTokens) {
|
|
15637
15637
|
return { text: expanded, truncated: false, tokenOffset: 0 };
|
|
15638
15638
|
}
|
|
15639
|
-
const hardTruncated =
|
|
15639
|
+
const hardTruncated = chunkHSOEY7M2_cjs.truncateStringByTokens(expanded, options.maxTokens);
|
|
15640
15640
|
return { text: hardTruncated, truncated: true, tokenOffset: expandedTokens - options.maxTokens };
|
|
15641
15641
|
}
|
|
15642
15642
|
async function recallPart({
|
|
@@ -15671,7 +15671,7 @@ async function recallPart({
|
|
|
15671
15671
|
`Part index ${partIndex} not found in message ${cursor}. Available indices: ${allParts.map((p) => p.partIndex).join(", ")}`
|
|
15672
15672
|
);
|
|
15673
15673
|
}
|
|
15674
|
-
const truncatedText =
|
|
15674
|
+
const truncatedText = chunkHSOEY7M2_cjs.truncateStringByTokens(target.text, maxTokens);
|
|
15675
15675
|
const wasTruncated = truncatedText !== target.text;
|
|
15676
15676
|
return {
|
|
15677
15677
|
text: truncatedText,
|
|
@@ -17438,7 +17438,7 @@ Notes:
|
|
|
17438
17438
|
"Observational memory requires @mastra/core support for request-response-id-rotation. Please bump @mastra/core to a newer version."
|
|
17439
17439
|
);
|
|
17440
17440
|
}
|
|
17441
|
-
const { ObservationalMemory } = await import('./observational-memory-
|
|
17441
|
+
const { ObservationalMemory } = await import('./observational-memory-DJMF2UNC.cjs');
|
|
17442
17442
|
return new ObservationalMemory({
|
|
17443
17443
|
storage: memoryStore,
|
|
17444
17444
|
scope: omConfig.scope,
|
|
@@ -17473,11 +17473,11 @@ Notes:
|
|
|
17473
17473
|
|
|
17474
17474
|
Object.defineProperty(exports, "ModelByInputTokens", {
|
|
17475
17475
|
enumerable: true,
|
|
17476
|
-
get: function () { return
|
|
17476
|
+
get: function () { return chunkHSOEY7M2_cjs.ModelByInputTokens; }
|
|
17477
17477
|
});
|
|
17478
17478
|
Object.defineProperty(exports, "getObservationsAsOf", {
|
|
17479
17479
|
enumerable: true,
|
|
17480
|
-
get: function () { return
|
|
17480
|
+
get: function () { return chunkHSOEY7M2_cjs.getObservationsAsOf; }
|
|
17481
17481
|
});
|
|
17482
17482
|
Object.defineProperty(exports, "extractWorkingMemoryContent", {
|
|
17483
17483
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __commonJS, require_token_error, __toESM } from './chunk-SVPZMV27.js';
|
|
2
2
|
import { __commonJS as __commonJS$1, require_token_error as require_token_error$1, __toESM as __toESM$1 } from './chunk-RC6RZVYE.js';
|
|
3
|
-
import { truncateStringByTokens, resolveToolResultValue, formatToolResultForObserver } from './chunk-
|
|
4
|
-
export { ModelByInputTokens, getObservationsAsOf } from './chunk-
|
|
3
|
+
import { truncateStringByTokens, resolveToolResultValue, formatToolResultForObserver } from './chunk-K2NLYL2O.js';
|
|
4
|
+
export { ModelByInputTokens, getObservationsAsOf } from './chunk-K2NLYL2O.js';
|
|
5
5
|
import { ZodFirstPartyTypeKind } from 'zod/v3';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import * as z4 from 'zod/v4';
|
|
@@ -17416,7 +17416,7 @@ Notes:
|
|
|
17416
17416
|
"Observational memory requires @mastra/core support for request-response-id-rotation. Please bump @mastra/core to a newer version."
|
|
17417
17417
|
);
|
|
17418
17418
|
}
|
|
17419
|
-
const { ObservationalMemory } = await import('./observational-memory-
|
|
17419
|
+
const { ObservationalMemory } = await import('./observational-memory-NMQ7URIP.js');
|
|
17420
17420
|
return new ObservationalMemory({
|
|
17421
17421
|
storage: memoryStore,
|
|
17422
17422
|
scope: omConfig.scope,
|
|
@@ -1,112 +1,112 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHSOEY7M2_cjs = require('./chunk-HSOEY7M2.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "ModelByInputTokens", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkHSOEY7M2_cjs.ModelByInputTokens; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "OBSERVATIONAL_MEMORY_DEFAULTS", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkHSOEY7M2_cjs.OBSERVATIONAL_MEMORY_DEFAULTS; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "OBSERVATION_CONTEXT_INSTRUCTIONS", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkHSOEY7M2_cjs.OBSERVATION_CONTEXT_INSTRUCTIONS; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "OBSERVATION_CONTEXT_PROMPT", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkHSOEY7M2_cjs.OBSERVATION_CONTEXT_PROMPT; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "OBSERVATION_CONTINUATION_HINT", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkHSOEY7M2_cjs.OBSERVATION_CONTINUATION_HINT; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "OBSERVER_SYSTEM_PROMPT", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkHSOEY7M2_cjs.OBSERVER_SYSTEM_PROMPT; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "ObservationalMemory", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkHSOEY7M2_cjs.ObservationalMemory; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "TokenCounter", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkHSOEY7M2_cjs.TokenCounter; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "buildObserverPrompt", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkHSOEY7M2_cjs.buildObserverPrompt; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "buildObserverSystemPrompt", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkHSOEY7M2_cjs.buildObserverSystemPrompt; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "combineObservationGroupRanges", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkHSOEY7M2_cjs.combineObservationGroupRanges; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "deriveObservationGroupProvenance", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunkHSOEY7M2_cjs.deriveObservationGroupProvenance; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "extractCurrentTask", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunkHSOEY7M2_cjs.extractCurrentTask; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "formatMessagesForObserver", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunkHSOEY7M2_cjs.formatMessagesForObserver; }
|
|
62
62
|
});
|
|
63
63
|
Object.defineProperty(exports, "getObservationsAsOf", {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkHSOEY7M2_cjs.getObservationsAsOf; }
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "hasCurrentTaskSection", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunkHSOEY7M2_cjs.hasCurrentTaskSection; }
|
|
70
70
|
});
|
|
71
71
|
Object.defineProperty(exports, "injectAnchorIds", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunkHSOEY7M2_cjs.injectAnchorIds; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "optimizeObservationsForContext", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkHSOEY7M2_cjs.optimizeObservationsForContext; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "parseAnchorId", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunkHSOEY7M2_cjs.parseAnchorId; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "parseObservationGroups", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunkHSOEY7M2_cjs.parseObservationGroups; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "parseObserverOutput", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkHSOEY7M2_cjs.parseObserverOutput; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "reconcileObservationGroupsFromReflection", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkHSOEY7M2_cjs.reconcileObservationGroupsFromReflection; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "renderObservationGroupsForReflection", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkHSOEY7M2_cjs.renderObservationGroupsForReflection; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "stripEphemeralAnchorIds", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkHSOEY7M2_cjs.stripEphemeralAnchorIds; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "stripObservationGroups", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkHSOEY7M2_cjs.stripObservationGroups; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "wrapInObservationGroup", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkHSOEY7M2_cjs.wrapInObservationGroup; }
|
|
110
110
|
});
|
|
111
|
-
//# sourceMappingURL=observational-memory-
|
|
112
|
-
//# sourceMappingURL=observational-memory-
|
|
111
|
+
//# sourceMappingURL=observational-memory-DJMF2UNC.cjs.map
|
|
112
|
+
//# sourceMappingURL=observational-memory-DJMF2UNC.cjs.map
|
package/dist/{observational-memory-COYJCVX3.cjs.map → observational-memory-DJMF2UNC.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"observational-memory-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"observational-memory-DJMF2UNC.cjs"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ModelByInputTokens, OBSERVATIONAL_MEMORY_DEFAULTS, OBSERVATION_CONTEXT_INSTRUCTIONS, OBSERVATION_CONTEXT_PROMPT, OBSERVATION_CONTINUATION_HINT, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, combineObservationGroupRanges, deriveObservationGroupProvenance, extractCurrentTask, formatMessagesForObserver, getObservationsAsOf, hasCurrentTaskSection, injectAnchorIds, optimizeObservationsForContext, parseAnchorId, parseObservationGroups, parseObserverOutput, reconcileObservationGroupsFromReflection, renderObservationGroupsForReflection, stripEphemeralAnchorIds, stripObservationGroups, wrapInObservationGroup } from './chunk-
|
|
2
|
-
//# sourceMappingURL=observational-memory-
|
|
3
|
-
//# sourceMappingURL=observational-memory-
|
|
1
|
+
export { ModelByInputTokens, OBSERVATIONAL_MEMORY_DEFAULTS, OBSERVATION_CONTEXT_INSTRUCTIONS, OBSERVATION_CONTEXT_PROMPT, OBSERVATION_CONTINUATION_HINT, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, combineObservationGroupRanges, deriveObservationGroupProvenance, extractCurrentTask, formatMessagesForObserver, getObservationsAsOf, hasCurrentTaskSection, injectAnchorIds, optimizeObservationsForContext, parseAnchorId, parseObservationGroups, parseObserverOutput, reconcileObservationGroupsFromReflection, renderObservationGroupsForReflection, stripEphemeralAnchorIds, stripObservationGroups, wrapInObservationGroup } from './chunk-K2NLYL2O.js';
|
|
2
|
+
//# sourceMappingURL=observational-memory-NMQ7URIP.js.map
|
|
3
|
+
//# sourceMappingURL=observational-memory-NMQ7URIP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"observational-memory-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"observational-memory-NMQ7URIP.js"}
|
|
@@ -1,112 +1,112 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHSOEY7M2_cjs = require('../chunk-HSOEY7M2.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "ModelByInputTokens", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkHSOEY7M2_cjs.ModelByInputTokens; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "OBSERVATIONAL_MEMORY_DEFAULTS", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkHSOEY7M2_cjs.OBSERVATIONAL_MEMORY_DEFAULTS; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "OBSERVATION_CONTEXT_INSTRUCTIONS", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkHSOEY7M2_cjs.OBSERVATION_CONTEXT_INSTRUCTIONS; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "OBSERVATION_CONTEXT_PROMPT", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkHSOEY7M2_cjs.OBSERVATION_CONTEXT_PROMPT; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "OBSERVATION_CONTINUATION_HINT", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkHSOEY7M2_cjs.OBSERVATION_CONTINUATION_HINT; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "OBSERVER_SYSTEM_PROMPT", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkHSOEY7M2_cjs.OBSERVER_SYSTEM_PROMPT; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "ObservationalMemory", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkHSOEY7M2_cjs.ObservationalMemory; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "TokenCounter", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkHSOEY7M2_cjs.TokenCounter; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "buildObserverPrompt", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkHSOEY7M2_cjs.buildObserverPrompt; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "buildObserverSystemPrompt", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkHSOEY7M2_cjs.buildObserverSystemPrompt; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "combineObservationGroupRanges", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkHSOEY7M2_cjs.combineObservationGroupRanges; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "deriveObservationGroupProvenance", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunkHSOEY7M2_cjs.deriveObservationGroupProvenance; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "extractCurrentTask", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunkHSOEY7M2_cjs.extractCurrentTask; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "formatMessagesForObserver", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunkHSOEY7M2_cjs.formatMessagesForObserver; }
|
|
62
62
|
});
|
|
63
63
|
Object.defineProperty(exports, "getObservationsAsOf", {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkHSOEY7M2_cjs.getObservationsAsOf; }
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "hasCurrentTaskSection", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunkHSOEY7M2_cjs.hasCurrentTaskSection; }
|
|
70
70
|
});
|
|
71
71
|
Object.defineProperty(exports, "injectAnchorIds", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunkHSOEY7M2_cjs.injectAnchorIds; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "optimizeObservationsForContext", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkHSOEY7M2_cjs.optimizeObservationsForContext; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "parseAnchorId", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunkHSOEY7M2_cjs.parseAnchorId; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "parseObservationGroups", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunkHSOEY7M2_cjs.parseObservationGroups; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "parseObserverOutput", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkHSOEY7M2_cjs.parseObserverOutput; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "reconcileObservationGroupsFromReflection", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkHSOEY7M2_cjs.reconcileObservationGroupsFromReflection; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "renderObservationGroupsForReflection", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkHSOEY7M2_cjs.renderObservationGroupsForReflection; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "stripEphemeralAnchorIds", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkHSOEY7M2_cjs.stripEphemeralAnchorIds; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "stripObservationGroups", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkHSOEY7M2_cjs.stripObservationGroups; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "wrapInObservationGroup", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkHSOEY7M2_cjs.wrapInObservationGroup; }
|
|
110
110
|
});
|
|
111
111
|
//# sourceMappingURL=index.cjs.map
|
|
112
112
|
//# sourceMappingURL=index.cjs.map
|
package/dist/processors/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ModelByInputTokens, OBSERVATIONAL_MEMORY_DEFAULTS, OBSERVATION_CONTEXT_INSTRUCTIONS, OBSERVATION_CONTEXT_PROMPT, OBSERVATION_CONTINUATION_HINT, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, combineObservationGroupRanges, deriveObservationGroupProvenance, extractCurrentTask, formatMessagesForObserver, getObservationsAsOf, hasCurrentTaskSection, injectAnchorIds, optimizeObservationsForContext, parseAnchorId, parseObservationGroups, parseObserverOutput, reconcileObservationGroupsFromReflection, renderObservationGroupsForReflection, stripEphemeralAnchorIds, stripObservationGroups, wrapInObservationGroup } from '../chunk-
|
|
1
|
+
export { ModelByInputTokens, OBSERVATIONAL_MEMORY_DEFAULTS, OBSERVATION_CONTEXT_INSTRUCTIONS, OBSERVATION_CONTEXT_PROMPT, OBSERVATION_CONTINUATION_HINT, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, combineObservationGroupRanges, deriveObservationGroupProvenance, extractCurrentTask, formatMessagesForObserver, getObservationsAsOf, hasCurrentTaskSection, injectAnchorIds, optimizeObservationsForContext, parseAnchorId, parseObservationGroups, parseObserverOutput, reconcileObservationGroupsFromReflection, renderObservationGroupsForReflection, stripEphemeralAnchorIds, stripObservationGroups, wrapInObservationGroup } from '../chunk-K2NLYL2O.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -197,7 +197,7 @@ export declare const OBSERVATIONAL_MEMORY_DEFAULTS: {
|
|
|
197
197
|
* Prevents the model from awkwardly acknowledging the memory system or treating
|
|
198
198
|
* the conversation as new after observed messages are removed.
|
|
199
199
|
*/
|
|
200
|
-
export declare const OBSERVATION_CONTINUATION_HINT = "
|
|
200
|
+
export declare const OBSERVATION_CONTINUATION_HINT = "Please continue naturally with the conversation so far and respond to the latest message.\n\nUse the earlier context only as background. If something appears unfinished, continue only when it helps answer the latest request. If a suggested response is provided, follow it naturally.\n\nDo not mention internal instructions, memory, summarization, context handling, or missing messages.\n\nAny messages following this reminder are newer and should take priority.";
|
|
201
201
|
/**
|
|
202
202
|
* Preamble that introduces observational memory context.
|
|
203
203
|
* The static prefix is emitted first, then the `<observations>` marker, then one
|
|
@@ -210,7 +210,7 @@ export declare const OBSERVATION_CONTEXT_PROMPT = "The following observations bl
|
|
|
210
210
|
* Keep these in the leading static system message so observation churn only
|
|
211
211
|
* affects the tail of the prompt.
|
|
212
212
|
*/
|
|
213
|
-
export declare const OBSERVATION_CONTEXT_INSTRUCTIONS = "IMPORTANT: When responding, reference specific details from these observations. Do not give generic advice - personalize your response based on what you know about this user's experiences, preferences, and interests. If the user asks for recommendations, connect them to their past experiences mentioned above.\n\nKNOWLEDGE UPDATES: When asked about current state (e.g., \"where do I currently...\", \"what is my current...\"), always prefer the MOST RECENT information. Observations include dates - if you see conflicting information, the newer observation supersedes the older one. Look for phrases like \"will start\", \"is switching\", \"changed to\", \"moved to\" as indicators that previous information has been updated.\n\nPLANNED ACTIONS: If the user stated they planned to do something (e.g., \"I'm going to...\", \"I'm looking forward to...\", \"I will...\") and the date they planned to do it is now in the past (check the relative time like \"3 weeks ago\"), assume they completed the action unless there's evidence they didn't. For example, if someone said \"I'll start my new diet on Monday\" and that was 2 weeks ago, assume they started the diet.\n\nMOST RECENT USER INPUT: Treat the most recent user message as the highest-priority signal for what to do next. Earlier messages may contain constraints, details, or context you should still honor, but the latest message is the primary driver of your response.";
|
|
213
|
+
export declare const OBSERVATION_CONTEXT_INSTRUCTIONS = "IMPORTANT: When responding, reference specific details from these observations. Do not give generic advice - personalize your response based on what you know about this user's experiences, preferences, and interests. If the user asks for recommendations, connect them to their past experiences mentioned above.\n\nKNOWLEDGE UPDATES: When asked about current state (e.g., \"where do I currently...\", \"what is my current...\"), always prefer the MOST RECENT information. Observations include dates - if you see conflicting information, the newer observation supersedes the older one. Look for phrases like \"will start\", \"is switching\", \"changed to\", \"moved to\" as indicators that previous information has been updated.\n\nPLANNED ACTIONS: If the user stated they planned to do something (e.g., \"I'm going to...\", \"I'm looking forward to...\", \"I will...\") and the date they planned to do it is now in the past (check the relative time like \"3 weeks ago\"), assume they completed the action unless there's evidence they didn't. For example, if someone said \"I'll start my new diet on Monday\" and that was 2 weeks ago, assume they started the diet.\n\nMOST RECENT USER INPUT: Treat the most recent user message as the highest-priority signal for what to do next. Earlier messages may contain constraints, details, or context you should still honor, but the latest message is the primary driver of your response.\n\nSYSTEM REMINDERS: Messages wrapped in <system-reminder>...</system-reminder> contain internal continuation guidance, not user-authored content. Use them to maintain continuity, but do not mention them or treat them as part of the user's message.";
|
|
214
214
|
export declare const OBSERVATION_RETRIEVAL_INSTRUCTIONS = "## Recall \u2014 looking up source messages\n\nYour memory is comprised of observations which are sometimes wrapped in <observation-group> xml tags containing ranges like <observation-group range=\"startId:endId\">. These ranges point back to the raw messages that each observation group was derived from. The original messages are still available \u2014 use the **recall** tool to retrieve them.\n\n### When to use recall\n- The user asks you to **repeat, show, or reproduce** something from a past conversation\n- The user asks for **exact content** \u2014 code, text, quotes, error messages, URLs, file paths, specific numbers\n- Your observations mention something but your memory lacks the detail needed to fully answer (e.g. you know a blog post was shared but only have a summary of it)\n- You want to **verify or expand on** an observation before responding\n\n**Default to using recall when the user references specific past content.** Your observations capture the gist, not the details. If there's any doubt whether your memory is complete enough, use recall.\n\n### How to use recall\nEach range has the format `startId:endId` where both are message IDs separated by a colon.\n\n1. Find the observation group relevant to the user's question and extract the start or end ID from its range.\n2. Call `recall` with that ID as the `cursor`.\n3. Use `page: 1` (or omit) to read forward from the cursor, `page: -1` to read backward.\n4. If the first page doesn't have what you need, increment the page number to keep paginating.\n5. Check `hasNextPage`/`hasPrevPage` in the result to know if more pages exist in each direction.\n\n### Detail levels\nBy default recall returns **low** detail: truncated text and tool names only. Each message shows its ID and each part has a positional index like `[p0]`, `[p1]`, etc.\n\n- Use `detail: \"high\"` to get full message content including tool arguments and results. This will only return the high detail version of a single message part at a time.\n- Use `partIndex` with a cursor to fetch a single part at full detail \u2014 for example, to read one specific tool result or code block without loading every part.\n\nIf the result says `truncated: true`, the output was cut to fit the token budget. You can paginate or use `partIndex` to target specific content.\n\n### Following up on truncated parts\nLow-detail results may include truncation hints like:\n`[truncated \u2014 call recall cursor=\"...\" partIndex=N detail=\"high\" for full content]`\n\n**When you see these hints and need the full content, make the exact call described in the hint.** This is the normal workflow: first recall at low detail to scan, then drill into specific parts at high detail. Do not stop at the low-detail result if the user asked for exact content.\n\n### When recall is NOT needed\n- The user is asking for a high-level summary and your observations already cover it\n- The question is about general preferences or facts that don't require source text\n- There is no relevant range in your observations for the topic\n\nObservation groups with range IDs and your recall tool allows you to think back and remember details you're fuzzy on.";
|
|
215
215
|
/**
|
|
216
216
|
* ObservationalMemory - A three-agent memory system for long conversations.
|