@mastra/server 1.2.0-alpha.1 → 1.2.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 CHANGED
@@ -1,5 +1,118 @@
1
1
  # @mastra/server
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added Observational Memory — a new memory system that keeps your agent's context window small while preserving long-term memory across conversations. ([#12599](https://github.com/mastra-ai/mastra/pull/12599))
8
+
9
+ **Why:** Long conversations cause context rot and waste tokens. Observational Memory compresses conversation history into observations (5–40x compression) and periodically condenses those into reflections. Your agent stays fast and focused, even after thousands of messages.
10
+
11
+ **Usage:**
12
+
13
+ ```ts
14
+ import { Memory } from '@mastra/memory';
15
+ import { PostgresStore } from '@mastra/pg';
16
+
17
+ const memory = new Memory({
18
+ storage: new PostgresStore({ connectionString: process.env.DATABASE_URL }),
19
+ options: {
20
+ observationalMemory: true,
21
+ },
22
+ });
23
+
24
+ const agent = new Agent({
25
+ name: 'my-agent',
26
+ model: openai('gpt-4o'),
27
+ memory,
28
+ });
29
+ ```
30
+
31
+ **What's new:**
32
+ - `observationalMemory: true` enables the three-tier memory system (recent messages → observations → reflections)
33
+ - Thread-scoped (per-conversation) and resource-scoped (shared across all threads for a user) modes
34
+ - Manual `observe()` API for triggering observation outside the normal agent loop
35
+ - New OM storage methods for pg, libsql, and mongodb adapters (conditionally enabled)
36
+ - `Agent.findProcessor()` method for looking up processors by ID
37
+ - `processorStates` for persisting processor state across loop iterations
38
+ - Abort signal propagation to processors
39
+ - `ProcessorStreamWriter` for custom stream events from processors
40
+
41
+ - Added skills.sh proxy endpoints for browsing, searching, and installing skills from the community registry. ([#12492](https://github.com/mastra-ai/mastra/pull/12492))
42
+
43
+ **New endpoints:**
44
+ - GET /api/workspaces/:id/skills-sh/search - Search skills
45
+ - GET /api/workspaces/:id/skills-sh/popular - Browse popular skills
46
+ - GET /api/workspaces/:id/skills-sh/preview - Preview skill SKILL.md content
47
+ - POST /api/workspaces/:id/skills-sh/install - Install a skill from GitHub
48
+ - POST /api/workspaces/:id/skills-sh/update - Update installed skills
49
+ - POST /api/workspaces/:id/skills-sh/remove - Remove an installed skill
50
+
51
+ ### Patch Changes
52
+
53
+ - Created @mastra/editor package for managing and resolving stored agent configurations ([#12631](https://github.com/mastra-ai/mastra/pull/12631))
54
+
55
+ This major addition introduces the editor package, which provides a complete solution for storing, versioning, and instantiating agent configurations from a database. The editor seamlessly integrates with Mastra's storage layer to enable dynamic agent management.
56
+
57
+ **Key Features:**
58
+ - **Agent Storage & Retrieval**: Store complete agent configurations including instructions, model settings, tools, workflows, nested agents, scorers, processors, and memory configuration
59
+ - **Version Management**: Create and manage multiple versions of agents, with support for activating specific versions
60
+ - **Dependency Resolution**: Automatically resolves and instantiates all agent dependencies (tools, workflows, sub-agents, etc.) from the Mastra registry
61
+ - **Caching**: Built-in caching for improved performance when repeatedly accessing stored agents
62
+ - **Type Safety**: Full TypeScript support with proper typing for stored configurations
63
+
64
+ **Usage Example:**
65
+
66
+ ```typescript
67
+ import { MastraEditor } from '@mastra/editor';
68
+ import { Mastra } from '@mastra/core';
69
+
70
+ // Initialize editor with Mastra
71
+ const mastra = new Mastra({
72
+ /* config */
73
+ editor: new MastraEditor(),
74
+ });
75
+
76
+ // Store an agent configuration
77
+ const agentId = await mastra.storage.stores?.agents?.createAgent({
78
+ name: 'customer-support',
79
+ instructions: 'Help customers with inquiries',
80
+ model: { provider: 'openai', name: 'gpt-4' },
81
+ tools: ['search-kb', 'create-ticket'],
82
+ workflows: ['escalation-flow'],
83
+ memory: { vector: 'pinecone-db' },
84
+ });
85
+
86
+ // Retrieve and use the stored agent
87
+ const agent = await mastra.getEditor()?.getStoredAgentById(agentId);
88
+ const response = await agent?.generate('How do I reset my password?');
89
+
90
+ // List all stored agents
91
+ const agents = await mastra.getEditor()?.listStoredAgents({ pageSize: 10 });
92
+ ```
93
+
94
+ **Storage Improvements:**
95
+ - Fixed JSONB handling in LibSQL, PostgreSQL, and MongoDB adapters
96
+ - Improved agent resolution queries to properly merge version data
97
+ - Enhanced type safety for serialized configurations
98
+
99
+ - Fixed custom gateway provider detection in Studio. ([#11815](https://github.com/mastra-ai/mastra/pull/11815))
100
+
101
+ **What changed:**
102
+ - Studio now correctly detects connected custom gateway providers (e.g., providers registered as `acme/custom` are now found when the agent uses model `acme/custom/gpt-4o`)
103
+ - The model selector properly displays and updates models for custom gateway providers
104
+ - "Enhance prompt" feature works correctly with custom gateway providers
105
+
106
+ **Why:**
107
+ Custom gateway providers are stored with a gateway prefix (e.g., `acme/custom`), but the model router extracts just the provider part (e.g., `custom`). The lookups were failing because they only did exact matching. Now both backend and frontend use fallback logic to find providers with gateway prefixes.
108
+
109
+ Fixes #11732
110
+
111
+ - Improved workspace filesystem error handling: return 404 for not-found errors instead of 500, show user-friendly error messages in UI, and add MastraClientError class with status/body properties for better error handling ([#12533](https://github.com/mastra-ai/mastra/pull/12533))
112
+
113
+ - Updated dependencies [[`e6fc281`](https://github.com/mastra-ai/mastra/commit/e6fc281896a3584e9e06465b356a44fe7faade65), [`97be6c8`](https://github.com/mastra-ai/mastra/commit/97be6c8963130fca8a664fcf99d7b3a38e463595), [`2770921`](https://github.com/mastra-ai/mastra/commit/2770921eec4d55a36b278d15c3a83f694e462ee5), [`b1695db`](https://github.com/mastra-ai/mastra/commit/b1695db2d7be0c329d499619c7881899649188d0), [`5fe1fe0`](https://github.com/mastra-ai/mastra/commit/5fe1fe0109faf2c87db34b725d8a4571a594f80e), [`4133d48`](https://github.com/mastra-ai/mastra/commit/4133d48eaa354cdb45920dc6265732ffbc96788d), [`5dd01cc`](https://github.com/mastra-ai/mastra/commit/5dd01cce68d61874aa3ecbd91ee17884cfd5aca2), [`13e0a2a`](https://github.com/mastra-ai/mastra/commit/13e0a2a2bcec01ff4d701274b3727d5e907a6a01), [`f6673b8`](https://github.com/mastra-ai/mastra/commit/f6673b893b65b7d273ad25ead42e990704cc1e17), [`cd6be8a`](https://github.com/mastra-ai/mastra/commit/cd6be8ad32741cd41cabf508355bb31b71e8a5bd), [`9eb4e8e`](https://github.com/mastra-ai/mastra/commit/9eb4e8e39efbdcfff7a40ff2ce07ce2714c65fa8), [`c987384`](https://github.com/mastra-ai/mastra/commit/c987384d6c8ca844a9701d7778f09f5a88da7f9f), [`cb8cc12`](https://github.com/mastra-ai/mastra/commit/cb8cc12bfadd526aa95a01125076f1da44e4afa7), [`aa37c84`](https://github.com/mastra-ai/mastra/commit/aa37c84d29b7db68c72517337932ef486c316275), [`62f5d50`](https://github.com/mastra-ai/mastra/commit/62f5d5043debbba497dacb7ab008fe86b38b8de3), [`47eba72`](https://github.com/mastra-ai/mastra/commit/47eba72f0397d0d14fbe324b97940c3d55e5a525)]:
114
+ - @mastra/core@1.2.0
115
+
3
116
  ## 1.2.0-alpha.1
4
117
 
5
118
  ### Minor Changes
@@ -28,4 +28,4 @@ docs/
28
28
  ## Version
29
29
 
30
30
  Package: @mastra/server
31
- Version: 1.2.0-alpha.1
31
+ Version: 1.2.0
@@ -5,7 +5,7 @@ description: Documentation for @mastra/server. Includes links to type definition
5
5
 
6
6
  # @mastra/server Documentation
7
7
 
8
- > **Version**: 1.2.0-alpha.1
8
+ > **Version**: 1.2.0
9
9
  > **Package**: @mastra/server
10
10
 
11
11
  ## Quick Navigation
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.0-alpha.1",
2
+ "version": "1.2.0",
3
3
  "package": "@mastra/server",
4
4
  "exports": {},
5
5
  "modules": {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/server",
3
- "version": "1.2.0-alpha.1",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -92,11 +92,11 @@
92
92
  "typescript": "^5.9.3",
93
93
  "vitest": "4.0.16",
94
94
  "zod": "^3.25.76",
95
- "@internal/storage-test-utils": "0.0.52",
96
- "@internal/types-builder": "0.0.31",
97
- "@mastra/agent-builder": "1.0.2-alpha.1",
98
- "@internal/lint": "0.0.56",
99
- "@mastra/core": "1.2.0-alpha.1"
95
+ "@internal/lint": "0.0.57",
96
+ "@internal/storage-test-utils": "0.0.53",
97
+ "@internal/types-builder": "0.0.32",
98
+ "@mastra/agent-builder": "1.0.2",
99
+ "@mastra/core": "1.2.0"
100
100
  },
101
101
  "homepage": "https://mastra.ai",
102
102
  "repository": {