@mastra/memory 1.9.0 → 1.9.1-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.
@@ -24,13 +24,23 @@ export declare function buildReflectorSystemPrompt(instruction?: string): string
24
24
  * The Reflector's system prompt (default - for backwards compatibility)
25
25
  */
26
26
  export declare const REFLECTOR_SYSTEM_PROMPT: string;
27
+ /**
28
+ * Valid compression level values (0 = no guidance, 4 = most extreme).
29
+ */
30
+ export type CompressionLevel = 0 | 1 | 2 | 3 | 4;
31
+ /**
32
+ * The highest available compression level.
33
+ */
34
+ export declare const MAX_COMPRESSION_LEVEL: CompressionLevel;
27
35
  /**
28
36
  * Compression guidance by level.
29
37
  * - Level 0: No compression guidance (used as first attempt for regular reflection)
30
- * - Level 1: Gentle compression guidance (original wording — "slightly more" goes a long way for LLMs)
31
- * - Level 2: Aggressive compression guidance (stronger push when level 1 didn't work)
38
+ * - Level 1: Gentle compression guidance
39
+ * - Level 2: Aggressive compression guidance
40
+ * - Level 3: Critical compression guidance
41
+ * - Level 4: Extreme compression
32
42
  */
33
- export declare const COMPRESSION_GUIDANCE: Record<0 | 1 | 2 | 3, string>;
43
+ export declare const COMPRESSION_GUIDANCE: Record<CompressionLevel, string>;
34
44
  /**
35
45
  * Compression retry prompt - backwards compat alias for level 1
36
46
  */
@@ -38,7 +48,7 @@ export declare const COMPRESSION_RETRY_PROMPT: string;
38
48
  /**
39
49
  * Build the prompt for the Reflector agent
40
50
  */
41
- export declare function buildReflectorPrompt(observations: string, manualPrompt?: string, compressionLevel?: boolean | 0 | 1 | 2 | 3, skipContinuationHints?: boolean): string;
51
+ export declare function buildReflectorPrompt(observations: string, manualPrompt?: string, compressionLevel?: boolean | CompressionLevel, skipContinuationHints?: boolean): string;
42
52
  /**
43
53
  * Parse the Reflector's output to extract observations, current task, and suggested response.
44
54
  * Uses XML tag parsing for structured extraction.
@@ -1 +1 @@
1
- {"version":3,"file":"reflector-agent.d.ts","sourceRoot":"","sources":["../../../src/processors/observational-memory/reflector-agent.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEtE;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAgGvE;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAA+B,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,CAoD9D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAA0B,CAAC;AAEhE;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,MAAM,EACrB,gBAAgB,CAAC,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAC1C,qBAAqB,CAAC,EAAE,OAAO,GAC9B,MAAM,CAkCR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,GAAG,eAAe,CAoBjG;AAsED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAG7F"}
1
+ {"version":3,"file":"reflector-agent.d.ts","sourceRoot":"","sources":["../../../src/processors/observational-memory/reflector-agent.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEtE;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAgGvE;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAA+B,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,gBAAoB,CAAC;AAEzD;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAwEjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAA0B,CAAC;AAEhE;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,MAAM,EACrB,gBAAgB,CAAC,EAAE,OAAO,GAAG,gBAAgB,EAC7C,qBAAqB,CAAC,EAAE,OAAO,GAC9B,MAAM,CAkCR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,GAAG,eAAe,CAoBjG;AAsED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAG7F"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/memory",
3
- "version": "1.9.0",
3
+ "version": "1.9.1-alpha.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,7 +43,7 @@
43
43
  "probe-image-size": "^7.2.3",
44
44
  "tokenx": "^1.3.0",
45
45
  "xxhash-wasm": "^1.1.0",
46
- "@mastra/schema-compat": "1.2.6"
46
+ "@mastra/schema-compat": "1.2.7-alpha.1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@ai-sdk/openai": "^1.3.24",
@@ -59,12 +59,12 @@
59
59
  "typescript-eslint": "^8.57.0",
60
60
  "vitest": "4.0.18",
61
61
  "zod": "^4.3.6",
62
- "@internal/ai-sdk-v4": "0.0.20",
63
62
  "@internal/ai-sdk-v5": "0.0.20",
64
63
  "@internal/ai-v6": "0.0.20",
65
- "@internal/types-builder": "0.0.48",
64
+ "@internal/ai-sdk-v4": "0.0.20",
66
65
  "@internal/lint": "0.0.73",
67
- "@mastra/core": "1.15.0"
66
+ "@internal/types-builder": "0.0.48",
67
+ "@mastra/core": "1.16.0-alpha.3"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@mastra/core": ">=1.4.1-0 <2.0.0-0",