@mastra/libsql 1.5.0-alpha.0 → 1.6.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,164 @@
1
1
  # @mastra/libsql
2
2
 
3
+ ## 1.6.0-alpha.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added MCP server table and CRUD operations to storage adapters, enabling MCP server configurations to be persisted alongside agents and workflows. ([#13357](https://github.com/mastra-ai/mastra/pull/13357))
8
+
9
+ ### Patch Changes
10
+
11
+ - Added storage schema support for processor graphs on stored agents. ([#13357](https://github.com/mastra-ai/mastra/pull/13357))
12
+
13
+ - Storage adapters now return `suggestedContinuation` and `currentTask` fields on Observational Memory activation, enabling agents to maintain conversational context across activation boundaries. ([#13357](https://github.com/mastra-ai/mastra/pull/13357))
14
+
15
+ - Updated dependencies [[`0d9efb4`](https://github.com/mastra-ai/mastra/commit/0d9efb47992c34aa90581c18b9f51f774f6252a5), [`5caa13d`](https://github.com/mastra-ai/mastra/commit/5caa13d1b2a496e2565ab124a11de9a51ad3e3b9), [`940163f`](https://github.com/mastra-ai/mastra/commit/940163fc492401d7562301e6f106ccef4fefe06f), [`b260123`](https://github.com/mastra-ai/mastra/commit/b2601234bd093d358c92081a58f9b0befdae52b3), [`47892c8`](https://github.com/mastra-ai/mastra/commit/47892c85708eac348209f99f10f9a5f5267e11c0), [`45bb78b`](https://github.com/mastra-ai/mastra/commit/45bb78b70bd9db29678fe49476cd9f4ed01bfd0b), [`70eef84`](https://github.com/mastra-ai/mastra/commit/70eef84b8f44493598fdafa2980a0e7283415eda), [`d84e52d`](https://github.com/mastra-ai/mastra/commit/d84e52d0f6511283ddd21ed5fe7f945449d0f799), [`24b80af`](https://github.com/mastra-ai/mastra/commit/24b80af87da93bb84d389340181e17b7477fa9ca), [`608e156`](https://github.com/mastra-ai/mastra/commit/608e156def954c9604c5e3f6d9dfce3bcc7aeab0), [`2b2e157`](https://github.com/mastra-ai/mastra/commit/2b2e157a092cd597d9d3f0000d62b8bb4a7348ed), [`59d30b5`](https://github.com/mastra-ai/mastra/commit/59d30b5d0cb44ea7a1c440e7460dfb57eac9a9b5), [`453693b`](https://github.com/mastra-ai/mastra/commit/453693bf9e265ddccecef901d50da6caaea0fbc6), [`78d1c80`](https://github.com/mastra-ai/mastra/commit/78d1c808ad90201897a300af551bcc1d34458a20), [`c204b63`](https://github.com/mastra-ai/mastra/commit/c204b632d19e66acb6d6e19b11c4540dd6ad5380), [`742a417`](https://github.com/mastra-ai/mastra/commit/742a417896088220a3b5560c354c45c5ca6d88b9)]:
16
+ - @mastra/core@1.6.0-alpha.0
17
+
18
+ ## 1.5.0
19
+
20
+ ### Minor Changes
21
+
22
+ - Added workspace and skill storage domains with full CRUD, versioning, and implementations across LibSQL, Postgres, and MongoDB. Added `editor.workspace` and `editor.skill` namespaces for managing workspace configurations and skill definitions through the editor. Agents stored in the editor can now reference workspaces (by ID or inline config) and skills, with full hydration to runtime `Workspace` instances during agent resolution. ([#13156](https://github.com/mastra-ai/mastra/pull/13156))
23
+
24
+ **Filesystem-native skill versioning (draft → publish model):**
25
+
26
+ Skills are versioned as filesystem trees with content-addressable blob storage. The editing surface (live filesystem) is separated from the serving surface (versioned blob store), enabling a `draft → publish` workflow:
27
+ - `editor.skill.publish(skillId, source, skillPath)` — Snapshots a skill directory from the filesystem into blob storage, creates a new version with a tree manifest, and sets `activeVersionId`
28
+ - Version switching via `editor.skill.update({ id, activeVersionId })` — Points the skill to a previous version without re-publishing
29
+ - Publishing a skill automatically invalidates cached agents that reference it, so they re-hydrate with the updated version on next access
30
+
31
+ **Agent skill resolution strategies:**
32
+
33
+ Agents can reference skills with different resolution strategies:
34
+ - `strategy: 'latest'` — Resolves the skill's active version (honors `activeVersionId` for rollback)
35
+ - `pin: '<versionId>'` — Pins to a specific version, immune to publishes
36
+ - `strategy: 'live'` — Reads directly from the live filesystem (no blob store)
37
+
38
+ **Blob storage infrastructure:**
39
+ - `BlobStore` abstract class for content-addressable storage keyed by SHA-256 hash
40
+ - `InMemoryBlobStore` for testing
41
+ - LibSQL, Postgres, and MongoDB implementations
42
+ - `S3BlobStore` for storing blobs in S3 or S3-compatible storage (AWS, R2, MinIO, DO Spaces)
43
+ - `BlobStoreProvider` interface and `MastraEditorConfig.blobStores` registry for pluggable blob storage
44
+ - `VersionedSkillSource` and `CompositeVersionedSkillSource` for reading skill files from the blob store at runtime
45
+
46
+ **New storage types:**
47
+ - `StorageWorkspaceSnapshotType` and `StorageSkillSnapshotType` with corresponding input/output types
48
+ - `StorageWorkspaceRef` for ID-based or inline workspace references on agents
49
+ - `StorageSkillConfig` for per-agent skill overrides (`pin`, `strategy`, description, instructions)
50
+ - `SkillVersionTree` and `SkillVersionTreeEntry` for tree manifests
51
+ - `StorageBlobEntry` for content-addressable blob entries
52
+ - `SKILL_BLOBS_SCHEMA` for the `mastra_skill_blobs` table
53
+
54
+ **New editor namespaces:**
55
+ - `editor.workspace` — CRUD for workspace configs, plus `hydrateSnapshotToWorkspace()` for resolving to runtime `Workspace` instances
56
+ - `editor.skill` — CRUD for skill definitions, plus `publish()` for filesystem-to-blob snapshots
57
+
58
+ **Provider registries:**
59
+ - `MastraEditorConfig` accepts `filesystems`, `sandboxes`, and `blobStores` provider registries (keyed by provider ID)
60
+ - Built-in `local` filesystem and sandbox providers are auto-registered
61
+ - `editor.resolveBlobStore()` resolves from provider registry or falls back to the storage backend's blobs domain
62
+ - Providers expose `id`, `name`, `description`, `configSchema` (JSON Schema for UI form rendering), and a factory method
63
+
64
+ **Storage adapter support:**
65
+ - LibSQL: Full `workspaces`, `skills`, and `blobs` domain implementations
66
+ - Postgres: Full `workspaces`, `skills`, and `blobs` domain implementations
67
+ - MongoDB: Full `workspaces`, `skills`, and `blobs` domain implementations
68
+ - All three include `workspace`, `skills`, and `skillsFormat` fields on agent versions
69
+
70
+ **Server endpoints:**
71
+ - `GET/POST/PATCH/DELETE /stored/workspaces` — CRUD for stored workspaces
72
+ - `GET/POST/PATCH/DELETE /stored/skills` — CRUD for stored skills
73
+ - `POST /stored/skills/:id/publish` — Publish a skill from a filesystem source
74
+
75
+ ```ts
76
+ import { MastraEditor } from '@mastra/editor';
77
+ import { s3FilesystemProvider, s3BlobStoreProvider } from '@mastra/s3';
78
+ import { e2bSandboxProvider } from '@mastra/e2b';
79
+
80
+ const editor = new MastraEditor({
81
+ filesystems: { s3: s3FilesystemProvider },
82
+ sandboxes: { e2b: e2bSandboxProvider },
83
+ blobStores: { s3: s3BlobStoreProvider },
84
+ });
85
+
86
+ // Create a skill and publish it
87
+ const skill = await editor.skill.create({
88
+ name: 'Code Review',
89
+ description: 'Reviews code for best practices',
90
+ instructions: 'Analyze the code and provide feedback...',
91
+ });
92
+ await editor.skill.publish(skill.id, source, 'skills/code-review');
93
+
94
+ // Agents resolve skills by strategy
95
+ await editor.agent.create({
96
+ name: 'Dev Assistant',
97
+ model: { provider: 'openai', name: 'gpt-4' },
98
+ workspace: { type: 'id', workspaceId: workspace.id },
99
+ skills: { [skill.id]: { strategy: 'latest' } },
100
+ skillsFormat: 'xml',
101
+ });
102
+ ```
103
+
104
+ - Added draft/publish version management for all editor primitives (agents, scorers, MCP clients, prompt blocks). ([#13061](https://github.com/mastra-ai/mastra/pull/13061))
105
+
106
+ **Status filtering on list endpoints** — All list endpoints now accept a `?status=draft|published|archived` query parameter to filter by entity status. Defaults to `published` to preserve backward compatibility.
107
+
108
+ **Draft vs published resolution on get-by-id endpoints** — All get-by-id endpoints now accept `?status=draft` to resolve the entity with its latest (unpublished) version, or `?status=published` (default) to resolve with the active published version.
109
+
110
+ **Edits no longer auto-publish** — When updating any primitive, a new version is created but `activeVersionId` is no longer automatically updated. Edits stay as drafts until explicitly published via the activate endpoint.
111
+
112
+ **Full version management for all primitives** — Scorers, MCP clients, and prompt blocks now have the same version management API that agents have: list versions, create version snapshots, get specific versions, activate/publish, restore from a previous version, delete versions, and compare versions.
113
+
114
+ **New prompt block CRUD routes** — Prompt blocks now have full server routes (`GET /stored/prompt-blocks`, `GET /stored/prompt-blocks/:id`, `POST`, `PATCH`, `DELETE`).
115
+
116
+ **New version endpoints** — Each primitive now exposes 7 version management endpoints under `/stored/{type}/:id/versions` (list, create, get, activate, restore, delete, compare).
117
+
118
+ ```ts
119
+ // Fetch the published version (default behavior, backward compatible)
120
+ const published = await fetch('/api/stored/scorers/my-scorer');
121
+
122
+ // Fetch the draft version for editing in the UI
123
+ const draft = await fetch('/api/stored/scorers/my-scorer?status=draft');
124
+
125
+ // Publish a specific version
126
+ await fetch('/api/stored/scorers/my-scorer/versions/abc123/activate', { method: 'POST' });
127
+
128
+ // Compare two versions
129
+ const diff = await fetch('/api/stored/scorers/my-scorer/versions/compare?from=v1&to=v2');
130
+ ```
131
+
132
+ ### Patch Changes
133
+
134
+ - Dataset schemas now appear in the Edit Dataset dialog. Previously the `inputSchema` and `groundTruthSchema` fields were not passed to the dialog, so editing a dataset always showed empty schemas. ([#13175](https://github.com/mastra-ai/mastra/pull/13175))
135
+
136
+ Schema edits in the JSON editor no longer cause the cursor to jump to the top of the field. Typing `{"type": "object"}` in the schema editor now behaves like a normal text input instead of resetting on every keystroke.
137
+
138
+ Validation errors are now surfaced when updating a dataset schema that conflicts with existing items. For example, adding a `required: ["name"]` constraint when existing items lack a `name` field now shows "2 existing item(s) fail validation" in the dialog instead of silently dropping the error.
139
+
140
+ Disabling a dataset schema from the Studio UI now correctly clears it. Previously the server converted `null` (disable) to `undefined` (no change), so the old schema persisted and validation continued.
141
+
142
+ Workflow schemas fetched via `client.getWorkflow().getSchema()` are now correctly parsed. The server serializes schemas with `superjson`, but the client was using plain `JSON.parse`, yielding a `{json: {...}}` wrapper instead of the actual JSON Schema object.
143
+
144
+ - CMS draft support with status badges for agents. ([#13194](https://github.com/mastra-ai/mastra/pull/13194))
145
+ - Agent list now resolves the latest (draft) version for each stored agent, showing current edits rather than the last published state.
146
+ - Added `hasDraft` and `activeVersionId` fields to the agent list API response.
147
+ - Agent list badges: "Published" (green) when a published version exists, "Draft" (colored when unpublished changes exist, grayed out otherwise).
148
+ - Added `resolvedVersionId` to all `StorageResolved*Type` types so the server can detect whether the latest version differs from the active version.
149
+ - Added `status` option to `GetByIdOptions` to allow resolving draft vs published versions through the editor layer.
150
+ - Fixed editor cache not being cleared on version activate, restore, and delete — all four versioned domains (agents, scorers, prompt-blocks, mcp-clients) now clear the cache after version mutations.
151
+ - Added `ALTER TABLE` migration for `mastra_agent_versions` in libsql and pg to add newer columns (`mcpClients`, `requestContextSchema`, `workspace`, `skills`, `skillsFormat`).
152
+
153
+ - Added scorer version management and CMS draft/publish flow for scorers. ([#13194](https://github.com/mastra-ai/mastra/pull/13194))
154
+ - Added scorer version methods to the client SDK: `listVersions`, `createVersion`, `getVersion`, `activateVersion`, `restoreVersion`, `deleteVersion`, `compareVersions`.
155
+ - Added `ScorerVersionCombobox` for navigating scorer versions with Published/Draft labels.
156
+ - Scorer edit page now supports Save (draft) and Publish workflows with an "Unpublished changes" indicator.
157
+ - Storage list methods for agents and scorers no longer default to filtering only published entities, allowing drafts to appear in the playground.
158
+
159
+ - Updated dependencies [[`252580a`](https://github.com/mastra-ai/mastra/commit/252580a71feb0e46d0ccab04a70a79ff6a2ee0ab), [`f8e819f`](https://github.com/mastra-ai/mastra/commit/f8e819fabdfdc43d2da546a3ad81ba23685f603d), [`5c75261`](https://github.com/mastra-ai/mastra/commit/5c7526120d936757d4ffb7b82232e1641ebd45cb), [`e27d832`](https://github.com/mastra-ai/mastra/commit/e27d83281b5e166fd63a13969689e928d8605944), [`e37ef84`](https://github.com/mastra-ai/mastra/commit/e37ef8404043c94ca0c8e35ecdedb093b8087878), [`6fdd3d4`](https://github.com/mastra-ai/mastra/commit/6fdd3d451a07a8e7e216c62ac364f8dd8e36c2af), [`10cf521`](https://github.com/mastra-ai/mastra/commit/10cf52183344743a0d7babe24cd24fd78870c354), [`efdb682`](https://github.com/mastra-ai/mastra/commit/efdb682887f6522149769383908f9790c188ab88), [`0dee7a0`](https://github.com/mastra-ai/mastra/commit/0dee7a0ff4c2507e6eb6e6ee5f9738877ebd4ad1), [`04c2c8e`](https://github.com/mastra-ai/mastra/commit/04c2c8e888984364194131aecb490a3d6e920e61), [`02dc07a`](https://github.com/mastra-ai/mastra/commit/02dc07acc4ad42d93335825e3308f5b42266eba2), [`bb7262b`](https://github.com/mastra-ai/mastra/commit/bb7262b7c0ca76320d985b40510b6ffbbb936582), [`cf1c6e7`](https://github.com/mastra-ai/mastra/commit/cf1c6e789b131f55638fed52183a89d5078b4876), [`5ffadfe`](https://github.com/mastra-ai/mastra/commit/5ffadfefb1468ac2612b20bb84d24c39de6961c0), [`1e1339c`](https://github.com/mastra-ai/mastra/commit/1e1339cc276e571a48cfff5014487877086bfe68), [`d03df73`](https://github.com/mastra-ai/mastra/commit/d03df73f8fe9496064a33e1c3b74ba0479bf9ee6), [`79b8f45`](https://github.com/mastra-ai/mastra/commit/79b8f45a6767e1a5c3d56cd3c5b1214326b81661), [`9bbf08e`](https://github.com/mastra-ai/mastra/commit/9bbf08e3c20731c79dea13a765895b9fcf29cbf1), [`0a25952`](https://github.com/mastra-ai/mastra/commit/0a259526b5e1ac11e6efa53db1f140272962af2d), [`ffa5468`](https://github.com/mastra-ai/mastra/commit/ffa546857fc4821753979b3a34e13b4d76fbbcd4), [`3264a04`](https://github.com/mastra-ai/mastra/commit/3264a04e30340c3c5447433300a035ea0878df85), [`6fdd3d4`](https://github.com/mastra-ai/mastra/commit/6fdd3d451a07a8e7e216c62ac364f8dd8e36c2af), [`088d9ba`](https://github.com/mastra-ai/mastra/commit/088d9ba2577518703c52b0dccd617178d9ee6b0d), [`74fbebd`](https://github.com/mastra-ai/mastra/commit/74fbebd918a03832a2864965a8bea59bf617d3a2), [`aea6217`](https://github.com/mastra-ai/mastra/commit/aea621790bfb2291431b08da0cc5e6e150303ae7), [`b6a855e`](https://github.com/mastra-ai/mastra/commit/b6a855edc056e088279075506442ba1d6fa6def9), [`ae408ea`](https://github.com/mastra-ai/mastra/commit/ae408ea7128f0d2710b78d8623185198e7cb19c1), [`17e942e`](https://github.com/mastra-ai/mastra/commit/17e942eee2ba44985b1f807e6208cdde672f82f9), [`2015cf9`](https://github.com/mastra-ai/mastra/commit/2015cf921649f44c3f5bcd32a2c052335f8e49b4), [`7ef454e`](https://github.com/mastra-ai/mastra/commit/7ef454eaf9dcec6de60021c8f42192052dd490d6), [`2be1d99`](https://github.com/mastra-ai/mastra/commit/2be1d99564ce79acc4846071082bff353035a87a), [`2708fa1`](https://github.com/mastra-ai/mastra/commit/2708fa1055ac91c03e08b598869f6b8fb51fa37f), [`ba74aef`](https://github.com/mastra-ai/mastra/commit/ba74aef5716142dbbe931351f5243c9c6e4128a9), [`ba74aef`](https://github.com/mastra-ai/mastra/commit/ba74aef5716142dbbe931351f5243c9c6e4128a9), [`ec53e89`](https://github.com/mastra-ai/mastra/commit/ec53e8939c76c638991e21af762e51378eff7543), [`9b5a8cb`](https://github.com/mastra-ai/mastra/commit/9b5a8cb13e120811b0bf14140ada314f1c067894), [`607e66b`](https://github.com/mastra-ai/mastra/commit/607e66b02dc7f531ee37799f3456aa2dc0ca7ac5), [`a215d06`](https://github.com/mastra-ai/mastra/commit/a215d06758dcf590eabfe0b7afd4ae39bdbf082c), [`6909c74`](https://github.com/mastra-ai/mastra/commit/6909c74a7781e0447d475e9dbc1dc871b700f426), [`192438f`](https://github.com/mastra-ai/mastra/commit/192438f8a90c4f375e955f8ff179bf8dc6821a83)]:
160
+ - @mastra/core@1.5.0
161
+
3
162
  ## 1.5.0-alpha.0
4
163
 
5
164
  ### 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.5.0-alpha.0"
6
+ version: "1.6.0-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.0-alpha.0",
2
+ "version": "1.6.0-alpha.0",
3
3
  "package": "@mastra/libsql",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -36,7 +36,7 @@ export const agent = new Agent({
36
36
 
37
37
  ### Options parameters
38
38
 
39
- **lastMessages?:** (`number | false`): Number of most recent messages to retrieve. Set to false to disable. (Default: `10`)
39
+ **lastMessages?:** (`number | false`): Number of most recent messages to include in context. Set to \`false\` to disable loading conversation history into context. Use \`Number.MAX\_SAFE\_INTEGER\` to retrieve all messages with no limit. To prevent saving new messages, use the \`readOnly\` option instead. (Default: `10`)
40
40
 
41
41
  **readOnly?:** (`boolean`): When true, prevents memory from saving new messages and provides working memory as read-only context (without the updateWorkingMemory tool). Useful for read-only operations like previews, internal routing agents, or sub agents that should reference but not modify memory. (Default: `false`)
42
42