@mastra/server 1.1.0 → 1.2.0-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.
Files changed (156) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/dist/{chunk-37DO73XV.cjs → chunk-2ABZICAN.cjs} +6824 -488
  3. package/dist/chunk-2ABZICAN.cjs.map +1 -0
  4. package/dist/{chunk-J3EJR43M.js → chunk-32IP4IQQ.js} +436 -25
  5. package/dist/chunk-32IP4IQQ.js.map +1 -0
  6. package/dist/chunk-3NG2FRSI.js +41 -0
  7. package/dist/chunk-3NG2FRSI.js.map +1 -0
  8. package/dist/{chunk-7XIMPDJV.js → chunk-5A2J7TUN.js} +4 -3
  9. package/dist/chunk-5A2J7TUN.js.map +1 -0
  10. package/dist/chunk-5ZBS3CWT.cjs +43 -0
  11. package/dist/chunk-5ZBS3CWT.cjs.map +1 -0
  12. package/dist/{chunk-JUGGEWCR.js → chunk-7PYTUOM6.js} +4 -4
  13. package/dist/{chunk-JUGGEWCR.js.map → chunk-7PYTUOM6.js.map} +1 -1
  14. package/dist/chunk-7XBOJMBD.js +56 -0
  15. package/dist/chunk-7XBOJMBD.js.map +1 -0
  16. package/dist/{chunk-WWVDNKEF.cjs → chunk-CAPYNS3W.cjs} +9 -9
  17. package/dist/{chunk-WWVDNKEF.cjs.map → chunk-CAPYNS3W.cjs.map} +1 -1
  18. package/dist/chunk-CXL3KPGO.cjs +58 -0
  19. package/dist/chunk-CXL3KPGO.cjs.map +1 -0
  20. package/dist/{chunk-5P2VGES5.js → chunk-DURK4Z3A.js} +5 -5
  21. package/dist/chunk-DURK4Z3A.js.map +1 -0
  22. package/dist/{chunk-I3CJUT6J.cjs → chunk-E2JHVKGO.cjs} +5 -5
  23. package/dist/chunk-E2JHVKGO.cjs.map +1 -0
  24. package/dist/{chunk-BWINB344.js → chunk-FJTSBRYT.js} +4 -4
  25. package/dist/chunk-FJTSBRYT.js.map +1 -0
  26. package/dist/{chunk-6DHJKQLP.cjs → chunk-GQJJSFM3.cjs} +102 -92
  27. package/dist/chunk-GQJJSFM3.cjs.map +1 -0
  28. package/dist/{chunk-SONAXR2M.cjs → chunk-KPDZYFEE.cjs} +4 -3
  29. package/dist/chunk-KPDZYFEE.cjs.map +1 -0
  30. package/dist/{chunk-A2K5ZL47.cjs → chunk-LHQBSFTY.cjs} +18 -18
  31. package/dist/{chunk-A2K5ZL47.cjs.map → chunk-LHQBSFTY.cjs.map} +1 -1
  32. package/dist/{chunk-K2SXZLA3.cjs → chunk-LHWGX4IO.cjs} +4 -3
  33. package/dist/chunk-LHWGX4IO.cjs.map +1 -0
  34. package/dist/{chunk-KPHPNRVH.js → chunk-LTEIJ6D3.js} +174 -124
  35. package/dist/chunk-LTEIJ6D3.js.map +1 -0
  36. package/dist/{chunk-LFNP3ACE.js → chunk-MDKUY3AV.js} +4 -3
  37. package/dist/chunk-MDKUY3AV.js.map +1 -0
  38. package/dist/{chunk-F2WTCJ5C.js → chunk-MSI7KYQL.js} +4 -4
  39. package/dist/{chunk-F2WTCJ5C.js.map → chunk-MSI7KYQL.js.map} +1 -1
  40. package/dist/{chunk-GDWZ2R7I.js → chunk-OBH5ZLNK.js} +73 -4
  41. package/dist/chunk-OBH5ZLNK.js.map +1 -0
  42. package/dist/{chunk-AO7LIZRK.cjs → chunk-OGSBJMPX.cjs} +17 -17
  43. package/dist/chunk-OGSBJMPX.cjs.map +1 -0
  44. package/dist/{chunk-MZRJNOYJ.cjs → chunk-RGMLSZHU.cjs} +11 -11
  45. package/dist/{chunk-MZRJNOYJ.cjs.map → chunk-RGMLSZHU.cjs.map} +1 -1
  46. package/dist/{chunk-H4VFL22H.cjs → chunk-SEE2MAOJ.cjs} +25 -25
  47. package/dist/{chunk-H4VFL22H.cjs.map → chunk-SEE2MAOJ.cjs.map} +1 -1
  48. package/dist/{chunk-VXPVROQJ.cjs → chunk-T4ZBRGJU.cjs} +26 -26
  49. package/dist/{chunk-VXPVROQJ.cjs.map → chunk-T4ZBRGJU.cjs.map} +1 -1
  50. package/dist/{chunk-ZFHZRI6C.js → chunk-TGPGUUET.js} +4 -4
  51. package/dist/{chunk-ZFHZRI6C.js.map → chunk-TGPGUUET.js.map} +1 -1
  52. package/dist/{chunk-ED6NQBHF.js → chunk-UABQC3SK.js} +3 -3
  53. package/dist/{chunk-ED6NQBHF.js.map → chunk-UABQC3SK.js.map} +1 -1
  54. package/dist/{chunk-4UNYZYBB.cjs → chunk-W7AZENC3.cjs} +84 -3
  55. package/dist/chunk-W7AZENC3.cjs.map +1 -0
  56. package/dist/{chunk-RWV4GKEY.cjs → chunk-WK2FRQEW.cjs} +480 -62
  57. package/dist/chunk-WK2FRQEW.cjs.map +1 -0
  58. package/dist/{chunk-AN42MFD5.cjs → chunk-XI35WFHZ.cjs} +249 -9
  59. package/dist/chunk-XI35WFHZ.cjs.map +1 -0
  60. package/dist/{chunk-C4NZAUUW.js → chunk-Z3ZWANXZ.js} +6684 -348
  61. package/dist/chunk-Z3ZWANXZ.js.map +1 -0
  62. package/dist/{chunk-7YCFHDWX.js → chunk-ZIAEKNPT.js} +23 -14
  63. package/dist/chunk-ZIAEKNPT.js.map +1 -0
  64. package/dist/{chunk-XXBURIYX.js → chunk-ZVYEL4VO.js} +4 -4
  65. package/dist/{chunk-XXBURIYX.js.map → chunk-ZVYEL4VO.js.map} +1 -1
  66. package/dist/{chunk-L6AKFVEX.cjs → chunk-ZWYF2ADF.cjs} +175 -125
  67. package/dist/chunk-ZWYF2ADF.cjs.map +1 -0
  68. package/dist/{chunk-4JAEBN6N.js → chunk-ZX4RYNOP.js} +249 -10
  69. package/dist/chunk-ZX4RYNOP.js.map +1 -0
  70. package/dist/docs/README.md +1 -1
  71. package/dist/docs/SKILL.md +1 -1
  72. package/dist/docs/SOURCE_MAP.json +1 -1
  73. package/dist/observational-memory-VXLHOSDZ-H2TJ6BI4.js +3439 -0
  74. package/dist/observational-memory-VXLHOSDZ-H2TJ6BI4.js.map +1 -0
  75. package/dist/observational-memory-VXLHOSDZ-YUXHRMDP.cjs +3451 -0
  76. package/dist/observational-memory-VXLHOSDZ-YUXHRMDP.cjs.map +1 -0
  77. package/dist/server/handlers/a2a.cjs +9 -9
  78. package/dist/server/handlers/a2a.js +1 -1
  79. package/dist/server/handlers/agent-builder.cjs +16 -16
  80. package/dist/server/handlers/agent-builder.js +1 -1
  81. package/dist/server/handlers/agent-versions.cjs +14 -14
  82. package/dist/server/handlers/agent-versions.d.ts +591 -76
  83. package/dist/server/handlers/agent-versions.d.ts.map +1 -1
  84. package/dist/server/handlers/agent-versions.js +1 -1
  85. package/dist/server/handlers/agents.cjs +35 -31
  86. package/dist/server/handlers/agents.d.ts +148 -4
  87. package/dist/server/handlers/agents.d.ts.map +1 -1
  88. package/dist/server/handlers/agents.js +1 -1
  89. package/dist/server/handlers/memory.cjs +29 -25
  90. package/dist/server/handlers/memory.d.ts +86 -1
  91. package/dist/server/handlers/memory.d.ts.map +1 -1
  92. package/dist/server/handlers/memory.js +1 -1
  93. package/dist/server/handlers/observability.d.ts +2 -2
  94. package/dist/server/handlers/observability.d.ts.map +1 -1
  95. package/dist/server/handlers/processors.cjs +4 -4
  96. package/dist/server/handlers/processors.d.ts.map +1 -1
  97. package/dist/server/handlers/processors.js +1 -1
  98. package/dist/server/handlers/scores.cjs +7 -7
  99. package/dist/server/handlers/scores.js +1 -1
  100. package/dist/server/handlers/stored-agents.cjs +6 -6
  101. package/dist/server/handlers/stored-agents.d.ts +1082 -78
  102. package/dist/server/handlers/stored-agents.d.ts.map +1 -1
  103. package/dist/server/handlers/stored-agents.js +1 -1
  104. package/dist/server/handlers/tools.cjs +6 -6
  105. package/dist/server/handlers/tools.js +1 -1
  106. package/dist/server/handlers/voice.cjs +8 -8
  107. package/dist/server/handlers/voice.js +1 -1
  108. package/dist/server/handlers/workflows.cjs +24 -24
  109. package/dist/server/handlers/workflows.js +1 -1
  110. package/dist/server/handlers/workspace.cjs +47 -19
  111. package/dist/server/handlers/workspace.d.ts +269 -4
  112. package/dist/server/handlers/workspace.d.ts.map +1 -1
  113. package/dist/server/handlers/workspace.js +1 -1
  114. package/dist/server/handlers.cjs +16 -16
  115. package/dist/server/handlers.js +8 -8
  116. package/dist/server/schemas/agent-versions.d.ts +4433 -321
  117. package/dist/server/schemas/agent-versions.d.ts.map +1 -1
  118. package/dist/server/schemas/agents.d.ts +1031 -11
  119. package/dist/server/schemas/agents.d.ts.map +1 -1
  120. package/dist/server/schemas/default-options.d.ts +256 -0
  121. package/dist/server/schemas/default-options.d.ts.map +1 -0
  122. package/dist/server/schemas/memory-config.d.ts +188 -0
  123. package/dist/server/schemas/memory-config.d.ts.map +1 -0
  124. package/dist/server/schemas/memory.d.ts +403 -3
  125. package/dist/server/schemas/memory.d.ts.map +1 -1
  126. package/dist/server/schemas/stored-agents.d.ts +4800 -341
  127. package/dist/server/schemas/stored-agents.d.ts.map +1 -1
  128. package/dist/server/schemas/workspace.d.ts +257 -2
  129. package/dist/server/schemas/workspace.d.ts.map +1 -1
  130. package/dist/server/server-adapter/index.cjs +142 -139
  131. package/dist/server/server-adapter/index.cjs.map +1 -1
  132. package/dist/server/server-adapter/index.js +18 -15
  133. package/dist/server/server-adapter/index.js.map +1 -1
  134. package/dist/server/server-adapter/routes/memory.d.ts.map +1 -1
  135. package/dist/server/server-adapter/routes/workspace.d.ts.map +1 -1
  136. package/package.json +5 -5
  137. package/dist/chunk-37DO73XV.cjs.map +0 -1
  138. package/dist/chunk-4JAEBN6N.js.map +0 -1
  139. package/dist/chunk-4UNYZYBB.cjs.map +0 -1
  140. package/dist/chunk-5P2VGES5.js.map +0 -1
  141. package/dist/chunk-6DHJKQLP.cjs.map +0 -1
  142. package/dist/chunk-7XIMPDJV.js.map +0 -1
  143. package/dist/chunk-7YCFHDWX.js.map +0 -1
  144. package/dist/chunk-AN42MFD5.cjs.map +0 -1
  145. package/dist/chunk-AO7LIZRK.cjs.map +0 -1
  146. package/dist/chunk-BWINB344.js.map +0 -1
  147. package/dist/chunk-C4NZAUUW.js.map +0 -1
  148. package/dist/chunk-GDWZ2R7I.js.map +0 -1
  149. package/dist/chunk-I3CJUT6J.cjs.map +0 -1
  150. package/dist/chunk-J3EJR43M.js.map +0 -1
  151. package/dist/chunk-K2SXZLA3.cjs.map +0 -1
  152. package/dist/chunk-KPHPNRVH.js.map +0 -1
  153. package/dist/chunk-L6AKFVEX.cjs.map +0 -1
  154. package/dist/chunk-LFNP3ACE.js.map +0 -1
  155. package/dist/chunk-RWV4GKEY.cjs.map +0 -1
  156. package/dist/chunk-SONAXR2M.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,127 @@
1
1
  # @mastra/server
2
2
 
3
+ ## 1.2.0-alpha.1
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
+ ### Patch Changes
42
+
43
+ - Created @mastra/editor package for managing and resolving stored agent configurations ([#12631](https://github.com/mastra-ai/mastra/pull/12631))
44
+
45
+ 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.
46
+
47
+ **Key Features:**
48
+ - **Agent Storage & Retrieval**: Store complete agent configurations including instructions, model settings, tools, workflows, nested agents, scorers, processors, and memory configuration
49
+ - **Version Management**: Create and manage multiple versions of agents, with support for activating specific versions
50
+ - **Dependency Resolution**: Automatically resolves and instantiates all agent dependencies (tools, workflows, sub-agents, etc.) from the Mastra registry
51
+ - **Caching**: Built-in caching for improved performance when repeatedly accessing stored agents
52
+ - **Type Safety**: Full TypeScript support with proper typing for stored configurations
53
+
54
+ **Usage Example:**
55
+
56
+ ```typescript
57
+ import { MastraEditor } from '@mastra/editor';
58
+ import { Mastra } from '@mastra/core';
59
+
60
+ // Initialize editor with Mastra
61
+ const mastra = new Mastra({
62
+ /* config */
63
+ editor: new MastraEditor(),
64
+ });
65
+
66
+ // Store an agent configuration
67
+ const agentId = await mastra.storage.stores?.agents?.createAgent({
68
+ name: 'customer-support',
69
+ instructions: 'Help customers with inquiries',
70
+ model: { provider: 'openai', name: 'gpt-4' },
71
+ tools: ['search-kb', 'create-ticket'],
72
+ workflows: ['escalation-flow'],
73
+ memory: { vector: 'pinecone-db' },
74
+ });
75
+
76
+ // Retrieve and use the stored agent
77
+ const agent = await mastra.getEditor()?.getStoredAgentById(agentId);
78
+ const response = await agent?.generate('How do I reset my password?');
79
+
80
+ // List all stored agents
81
+ const agents = await mastra.getEditor()?.listStoredAgents({ pageSize: 10 });
82
+ ```
83
+
84
+ **Storage Improvements:**
85
+ - Fixed JSONB handling in LibSQL, PostgreSQL, and MongoDB adapters
86
+ - Improved agent resolution queries to properly merge version data
87
+ - Enhanced type safety for serialized configurations
88
+
89
+ - Updated dependencies [[`2770921`](https://github.com/mastra-ai/mastra/commit/2770921eec4d55a36b278d15c3a83f694e462ee5), [`b1695db`](https://github.com/mastra-ai/mastra/commit/b1695db2d7be0c329d499619c7881899649188d0), [`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), [`c987384`](https://github.com/mastra-ai/mastra/commit/c987384d6c8ca844a9701d7778f09f5a88da7f9f), [`cb8cc12`](https://github.com/mastra-ai/mastra/commit/cb8cc12bfadd526aa95a01125076f1da44e4afa7), [`62f5d50`](https://github.com/mastra-ai/mastra/commit/62f5d5043debbba497dacb7ab008fe86b38b8de3)]:
90
+ - @mastra/core@1.2.0-alpha.1
91
+
92
+ ## 1.2.0-alpha.0
93
+
94
+ ### Minor Changes
95
+
96
+ - Added skills.sh proxy endpoints for browsing, searching, and installing skills from the community registry. ([#12492](https://github.com/mastra-ai/mastra/pull/12492))
97
+
98
+ **New endpoints:**
99
+ - GET /api/workspaces/:id/skills-sh/search - Search skills
100
+ - GET /api/workspaces/:id/skills-sh/popular - Browse popular skills
101
+ - GET /api/workspaces/:id/skills-sh/preview - Preview skill SKILL.md content
102
+ - POST /api/workspaces/:id/skills-sh/install - Install a skill from GitHub
103
+ - POST /api/workspaces/:id/skills-sh/update - Update installed skills
104
+ - POST /api/workspaces/:id/skills-sh/remove - Remove an installed skill
105
+
106
+ ### Patch Changes
107
+
108
+ - Fixed custom gateway provider detection in Studio. ([#11815](https://github.com/mastra-ai/mastra/pull/11815))
109
+
110
+ **What changed:**
111
+ - 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`)
112
+ - The model selector properly displays and updates models for custom gateway providers
113
+ - "Enhance prompt" feature works correctly with custom gateway providers
114
+
115
+ **Why:**
116
+ 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.
117
+
118
+ Fixes #11732
119
+
120
+ - 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))
121
+
122
+ - Updated dependencies [[`e6fc281`](https://github.com/mastra-ai/mastra/commit/e6fc281896a3584e9e06465b356a44fe7faade65), [`97be6c8`](https://github.com/mastra-ai/mastra/commit/97be6c8963130fca8a664fcf99d7b3a38e463595), [`5fe1fe0`](https://github.com/mastra-ai/mastra/commit/5fe1fe0109faf2c87db34b725d8a4571a594f80e), [`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), [`aa37c84`](https://github.com/mastra-ai/mastra/commit/aa37c84d29b7db68c72517337932ef486c316275), [`47eba72`](https://github.com/mastra-ai/mastra/commit/47eba72f0397d0d14fbe324b97940c3d55e5a525)]:
123
+ - @mastra/core@1.2.0-alpha.0
124
+
3
125
  ## 1.1.0
4
126
 
5
127
  ### Minor Changes