@mastra/libsql 1.3.0 → 1.4.0-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 CHANGED
@@ -1,5 +1,65 @@
1
1
  # @mastra/libsql
2
2
 
3
+ ## 1.4.0-alpha.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added datasets and experiments storage implementations. Includes dataset CRUD, item versioning with SCD-2, experiment runs with scorer results, and table/type configurations for dataset and experiment tables. ([#12747](https://github.com/mastra-ai/mastra/pull/12747))
8
+
9
+ **Requires `@mastra/core` >= 1.4.0**
10
+
11
+ ### Patch Changes
12
+
13
+ - Fixed agent version storage to persist the requestContextSchema field. Previously, requestContextSchema was defined on the agent snapshot type but was not included in the database schema, INSERT statements, or row parsing logic, causing it to be silently dropped when saving and loading agent versions. ([#13003](https://github.com/mastra-ai/mastra/pull/13003))
14
+
15
+ - Added MCP client storage domain and ToolProvider interface for integrating external tool catalogs with stored agents. ([#12974](https://github.com/mastra-ai/mastra/pull/12974))
16
+
17
+ **MCP Client Storage**
18
+
19
+ New storage domain for persisting MCP client configurations with CRUD operations. Each MCP client can contain multiple servers with independent tool selection:
20
+
21
+ ```ts
22
+ // Store an MCP client with multiple servers
23
+ await storage.mcpClients.create({
24
+ id: 'my-mcp',
25
+ name: 'My MCP Client',
26
+ servers: {
27
+ 'github-server': { url: 'https://mcp.github.com/sse' },
28
+ 'slack-server': { url: 'https://mcp.slack.com/sse' },
29
+ },
30
+ });
31
+ ```
32
+
33
+ LibSQL, PostgreSQL, and MongoDB storage adapters all implement the new MCP client domain.
34
+
35
+ **ToolProvider Interface**
36
+
37
+ New `ToolProvider` interface at `@mastra/core/tool-provider` enables third-party tool catalog integration (e.g., Composio, Arcade AI):
38
+
39
+ ```ts
40
+ import type { ToolProvider } from '@mastra/core/tool-provider';
41
+
42
+ # Providers implement: listToolkits(), listTools(), getToolSchema(), resolveTools()
43
+ ```
44
+
45
+ `resolveTools()` receives `requestContext` from the current request, enabling per-user API keys and credentials in multi-tenant setups:
46
+
47
+ ```ts
48
+ const tools = await provider.resolveTools(slugs, configs, {
49
+ requestContext: { apiKey: 'user-specific-key', userId: 'tenant-123' },
50
+ });
51
+ ```
52
+
53
+ **Tool Selection Semantics**
54
+
55
+ Both `mcpClients` and `integrationTools` on stored agents follow consistent three-state selection:
56
+ - `{ tools: undefined }` — provider registered, no tools selected
57
+ - `{ tools: {} }` — all tools from provider included
58
+ - `{ tools: { 'TOOL_SLUG': { description: '...' } } }` — specific tools with optional overrides
59
+
60
+ - Updated dependencies [[`7ef618f`](https://github.com/mastra-ai/mastra/commit/7ef618f3c49c27e2f6b27d7f564c557c0734325b), [`b373564`](https://github.com/mastra-ai/mastra/commit/b37356491d43b4d53067f10cb669abaf2502f218), [`927c2af`](https://github.com/mastra-ai/mastra/commit/927c2af9792286c122e04409efce0f3c804f777f), [`b896b41`](https://github.com/mastra-ai/mastra/commit/b896b41343de7fcc14442fb40fe82d189e65bbe2), [`6415277`](https://github.com/mastra-ai/mastra/commit/6415277a438faa00db2af850ead5dee25f40c428), [`0831bbb`](https://github.com/mastra-ai/mastra/commit/0831bbb5bc750c18e9b22b45f18687c964b70828), [`63f7eda`](https://github.com/mastra-ai/mastra/commit/63f7eda605eb3e0c8c35ee3912ffe7c999c69f69), [`a5b67a3`](https://github.com/mastra-ai/mastra/commit/a5b67a3589a74415feb663a55d1858324a2afde9), [`877b02c`](https://github.com/mastra-ai/mastra/commit/877b02cdbb15e199184c7f2b8f217be8d3ebada7), [`7567222`](https://github.com/mastra-ai/mastra/commit/7567222b1366f0d39980594792dd9d5060bfe2ab), [`af71458`](https://github.com/mastra-ai/mastra/commit/af71458e3b566f09c11d0e5a0a836dc818e7a24a), [`eb36bd8`](https://github.com/mastra-ai/mastra/commit/eb36bd8c52fcd6ec9674ac3b7a6412405b5983e1), [`3cbf121`](https://github.com/mastra-ai/mastra/commit/3cbf121f55418141924754a83102aade89835947)]:
61
+ - @mastra/core@1.4.0-alpha.0
62
+
3
63
  ## 1.3.0
4
64
 
5
65
  ### Minor Changes
@@ -3,7 +3,7 @@ name: mastra-libsql
3
3
  description: Documentation for @mastra/libsql. Use when working with @mastra/libsql APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/libsql"
6
- version: "1.3.0"
6
+ version: "1.4.0-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.0",
2
+ "version": "1.4.0-alpha.0",
3
3
  "package": "@mastra/libsql",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -83,9 +83,11 @@ const storage = new LibSQLStore({
83
83
  });
84
84
  await storage.init();
85
85
 
86
+ const memoryStorage = await storage.getStore('memory');
87
+
86
88
  const model = withMastra(openai('gpt-4o'), {
87
89
  memory: {
88
- storage,
90
+ storage: memoryStorage!,
89
91
  threadId: 'user-thread-123',
90
92
  resourceId: 'user-123',
91
93
  lastMessages: 10,
@@ -111,11 +113,13 @@ import { LibSQLStore } from '@mastra/libsql';
111
113
  const storage = new LibSQLStore({ id: 'my-app', url: 'file:./data.db' });
112
114
  await storage.init();
113
115
 
116
+ const memoryStorage = await storage.getStore('memory');
117
+
114
118
  const model = withMastra(openai('gpt-4o'), {
115
119
  inputProcessors: [myGuardProcessor],
116
120
  outputProcessors: [myLoggingProcessor],
117
121
  memory: {
118
- storage,
122
+ storage: memoryStorage!,
119
123
  threadId: 'thread-123',
120
124
  resourceId: 'user-123',
121
125
  lastMessages: 10,