@mastra/libsql 1.15.0-alpha.2 → 1.15.1-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,176 @@
1
1
  # @mastra/libsql
2
2
 
3
+ ## 1.15.1-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Update `@mastra/core` peer dependency for the unified schedules API ([#18874](https://github.com/mastra-ai/mastra/pull/18874))
8
+
9
+ - Schedule rows persisted with the legacy `target.type: 'heartbeat'` are now normalized to `target.type: 'agent'` when read, so existing agent schedules keep firing after the heartbeats-to-schedules rename in `@mastra/core`. ([#18874](https://github.com/mastra-ai/mastra/pull/18874))
10
+
11
+ - Updated dependencies [[`b291760`](https://github.com/mastra-ai/mastra/commit/b291760df9d6c7e4fc72606c8f0a4af2cf6e946c), [`29b7ea6`](https://github.com/mastra-ai/mastra/commit/29b7ea64e72b5523d5bdcbd34ee03d2b854d54e1), [`10959d5`](https://github.com/mastra-ai/mastra/commit/10959d509d824f682d40ff96e05ee044aec3b0e5), [`ffc3c17`](https://github.com/mastra-ai/mastra/commit/ffc3c17274ea17c11aa6f73d3140649cd7fc8abc), [`3908e53`](https://github.com/mastra-ai/mastra/commit/3908e53ce04bbea04f5e0c097d7aa298c35fabee)]:
12
+ - @mastra/core@1.50.0-alpha.3
13
+
14
+ ## 1.15.0
15
+
16
+ ### Minor Changes
17
+
18
+ - Added storage retention support to libSQL. When you set a `retention` config, `LibSQLStore` can prune old rows from every growth-table domain: `memory` (threads, messages, resources by `createdAt`), `threadState` (by `updatedAt`), `observability` (spans by `startedAt`), `scores` (by `createdAt`), `workflows` (run snapshots by `updatedAt`), `backgroundTasks` (by `completedAt`, so in-flight tasks are never pruned), `experiments` (whole runs by `completedAt`, results cascade with their parent), `notifications` and `harness` sessions (by `createdAt`), and `schedules` fire history (by `actual_fire_at`). ([#18733](https://github.com/mastra-ai/mastra/pull/18733))
19
+
20
+ Deletes run in batches so they stay safe on large tables. Anchor-column indexes are created lazily on the first `prune()` call — never at init — so deployments that don't configure retention pay no extra index overhead. `prune()` only deletes rows; reclaiming disk (for example a `VACUUM` on self-hosted libSQL) is left to you to run in a maintenance window.
21
+
22
+ ```typescript
23
+ const storage = new LibSQLStore({
24
+ id: 'mastra-storage',
25
+ url: 'file:./mastra.db',
26
+ retention: {
27
+ memory: { messages: { maxAge: '30d' } },
28
+ observability: { spans: { maxAge: '7d' } },
29
+ },
30
+ });
31
+
32
+ await storage.prune();
33
+ ```
34
+
35
+ ### Patch Changes
36
+
37
+ - Added optional tenancy arguments to `getDataset`, `updateDataset`, and `deleteDataset`. ([#18750](https://github.com/mastra-ai/mastra/pull/18750))
38
+
39
+ You can now pass `organizationId` and `projectId` to scope dataset reads, updates, and deletes to a specific tenant. Reads and updates against a dataset in a different tenant throw `DATASET_NOT_FOUND` (surfaced as a 404 over HTTP). Deletes silently no-op on a tenancy mismatch — matching the existing "delete non-existent id is a no-op" semantics so cross-tenant existence is never leaked via error timing or status.
40
+
41
+ **Example**
42
+
43
+ ```ts
44
+ // Before
45
+ await client.getDataset('abc123');
46
+ await client.deleteDataset('abc123');
47
+ await client.updateDataset({ id: 'abc123', name: 'renamed' });
48
+
49
+ // After — scope to a tenant
50
+ await client.getDataset('abc123', { organizationId: 'org_a', projectId: 'proj_1' });
51
+ await client.deleteDataset('abc123', { organizationId: 'org_a' });
52
+ await client.updateDataset({ id: 'abc123', name: 'renamed', organizationId: 'org_a' });
53
+ ```
54
+
55
+ - Pushed remaining dataset read filters and pagination down to storage. ([#18710](https://github.com/mastra-ai/mastra/pull/18710))
56
+
57
+ `DatasetsManager.list({ filters })` now accepts `targetType`, `targetIds` (overlap/union semantics), and `name` (substring, case-insensitive) in addition to the existing tenancy and candidate filters. Filtering is pushed down to the storage layer so callers no longer have to post-filter results.
58
+
59
+ Storage adapters must also be upgraded to the versions listed below to honor the new filters. If a caller is on this version of `@mastra/core` but on an older storage adapter, the new `targetType`/`targetIds`/`name` filter keys are silently ignored by the adapter — no runtime error, but the filter has no effect and every dataset in the tenancy is returned.
60
+
61
+ `Dataset.listItems({ version, search, page, perPage })` now applies `search` and pagination at the storage layer when `version` is provided alongside any of those. Previously they were silently dropped whenever `version` was set. The return shape is unchanged: passing only `version` still returns a bare `DatasetItem[]` snapshot; passing `search`, `page`, or `perPage` (with or without `version`) returns the paginated `{ items, pagination }` shape. The bare-array branch is marked `@deprecated`; prefer passing `page` / `perPage` to always receive the paginated shape.
62
+
63
+ - Fixed a double-encoding bug where `createDataset` stored `targetIds` and `scorerIds` as JSON-encoded strings instead of arrays. This caused the new `listDatasets({ filters: { targetIds } })` overlap query to never match. ([#18710](https://github.com/mastra-ai/mastra/pull/18710))
64
+
65
+ Existing rows written before this fix are still double-encoded and will not be matched by the new `targetIds` filter. They self-heal on the next `updateDataset` call. Deployments with a long tail of pre-existing datasets should run a one-time backfill (re-encoding `targetIds` and `scorerIds` on affected rows) rather than rely on incidental writes; this can be tracked as a follow-up if needed.
66
+
67
+ - Tenancy-scope experiments `getById` and `delete*` on `ExperimentsStorage`. ([#18770](https://github.com/mastra-ai/mastra/pull/18770))
68
+
69
+ `ExperimentsStorage.getExperimentById`, `getExperimentResultById`, `deleteExperiment`, and `deleteExperimentResults` used to key on the primary id alone, so any caller who knew the id could read or delete the row regardless of tenant. All four now accept an optional `filters: { organizationId?, projectId? }` argument that is enforced on every adapter (inmemory, libsql, pg, mysql, mongodb, spanner):
70
+ - On tenancy mismatch, `get*` returns `null` at the storage layer.
71
+ - On tenancy mismatch, `delete*` is a silent no-op.
72
+ - The tenancy predicate is folded into the destructive DML itself (scoped `WHERE` on the DELETE, an atomic gate + delete inside a transaction, or a scoped subquery for the results cascade). A concurrent tenant swap of the same id between a pre-check and the DELETE cannot let a scoped delete hit another tenant's row.
73
+
74
+ Both behaviors match how a missing id already responds, so existence does not leak through error timing or messages.
75
+
76
+ The same atomic-DML pattern is also applied to `DatasetsStorage.deleteDataset` across all 5 store adapters, closing a TOCTOU window between the pre-check and the parent DELETE that was introduced when tenancy filters were originally added.
77
+
78
+ `Dataset.getExperiment` and the shared experiment-ownership gate on `Dataset` now forward the dataset's tenancy scope to storage, so experiment reads and downstream mutations (list results, update result, delete experiment) reached through a dataset handle are automatically scoped to the owning tenant.
79
+
80
+ Legacy calls that omit `filters` are unchanged, so this is fully backwards-compatible.
81
+
82
+ ```ts
83
+ // Before: any caller who knew the id could read/delete across tenants.
84
+ await store.experiments.getExperimentById({ id: experimentId });
85
+ await store.experiments.deleteExperiment({ id: experimentId });
86
+
87
+ // After: pass the caller's scope; wrong tenant gets null / silent no-op.
88
+ await store.experiments.getExperimentById({
89
+ id: experimentId,
90
+ filters: { organizationId, projectId },
91
+ });
92
+ await store.experiments.deleteExperiment({
93
+ id: experimentId,
94
+ filters: { organizationId, projectId },
95
+ });
96
+ ```
97
+
98
+ - Fixed a cross-tenant data-access issue on datasets by scoping `DatasetsManager.get` and `DatasetsManager.delete` to tenancy filters. ([#18750](https://github.com/mastra-ai/mastra/pull/18750))
99
+
100
+ Previously `get({ id })` and `delete({ id })` looked up a dataset by its primary key alone. Any caller who knew a dataset id could read or delete it regardless of which `organizationId` / `projectId` it belonged to. This is now closed at the storage layer via a scoped SQL predicate (option (a) — no fetch-then-assert).
101
+
102
+ **What changed**
103
+ - `DatasetsManager.get` and `DatasetsManager.delete` accept optional `organizationId` and `projectId`.
104
+ - The tenancy is stashed on the returned `Dataset` handle and forwarded to every downstream storage call (`getDetails`, `update`, `addItem`, item batch ops, `startExperimentAsync`).
105
+ - The abstract storage contract (`getDatasetById`, `deleteDataset`) gained an optional `filters?: DatasetTenancyFilters` arg.
106
+ - Item-mutation inputs (`AddDatasetItemInput`, `UpdateDatasetItemInput`, `BatchInsertItemsInput`, `BatchDeleteItemsInput`) and `UpdateDatasetInput` accept optional `filters` for the internal existence check.
107
+
108
+ **Behavior**
109
+ - Omitting tenancy preserves the existing behavior (no predicate added) — fully backwards compatible.
110
+ - On tenancy mismatch, `get` throws NOT_FOUND (returns null at the storage layer) and `delete` is a silent no-op — matching how a missing id already behaves, so existence does not leak through error timing or messages.
111
+
112
+ **Example**
113
+
114
+ ```ts
115
+ // Before
116
+ const ds = await mastra.datasets.get({ id });
117
+ await mastra.datasets.delete({ id });
118
+
119
+ // After — scope to a tenant
120
+ const ds = await mastra.datasets.get({ id, organizationId, projectId });
121
+ await mastra.datasets.delete({ id, organizationId, projectId });
122
+ ```
123
+
124
+ - Add optional `batchId`, `datasetId`, and `datasetItemId` fields to persisted scores so saved baseline scores can be grouped as one scoring pass and joined back to the dataset items they came from. ([#18331](https://github.com/mastra-ai/mastra/pull/18331))
125
+ - `scoreTrace()` accepts top-level `batchId`, `datasetId`, and `datasetItemId` when persisting a score for a stored trace.
126
+ - `ScoreRowData` and score save payloads now include nullable `batchId`, `datasetId`, and `datasetItemId`.
127
+ - Built-in stores with explicit score schema or attribute mappings now persist these provenance fields on saved scores.
128
+ - D1, DSQL, MSSQL, and Upstash score stores now apply additive provenance migrations or deterministic score ordering for persisted score reads.
129
+
130
+ ```ts
131
+ await scoreTrace({
132
+ storage,
133
+ scorer,
134
+ target: { traceId },
135
+ batchId: 'baseline-batch-1',
136
+ datasetId,
137
+ datasetItemId,
138
+ });
139
+ ```
140
+
141
+ - Added optional `organizationId` and `projectId` fields to scores for multi-tenant isolation. Scores can now be saved with tenancy metadata and the `listScoresBy*` methods accept a `filters` option to scope results by organization and project. ([#18331](https://github.com/mastra-ai/mastra/pull/18331))
142
+
143
+ ```ts
144
+ await storage.saveScore({ ...score, organizationId: 'org-a', projectId: 'proj-1' });
145
+
146
+ const result = await storage.listScoresByScorerId({
147
+ scorerId,
148
+ filters: { organizationId: 'org-a', projectId: 'proj-1' },
149
+ });
150
+ ```
151
+
152
+ `projectId` identifies the project scope, separate from `resourceId` which continues to mean the agent memory resource.
153
+
154
+ - Raise `@mastra/core` peer floor to `>=1.49.0-0` on all storage adapters so the tenancy-related named exports the adapters now consume are guaranteed to exist at install time. ([#18861](https://github.com/mastra-ai/mastra/pull/18861))
155
+
156
+ - Scoped `getDatasetById` and `deleteDataset` to tenancy filters when the caller passes `organizationId` / `projectId`. ([#18750](https://github.com/mastra-ai/mastra/pull/18750))
157
+
158
+ The adapters now push the tenancy predicate into the SQL/query when the new optional `filters` argument is present. Legacy calls that omit tenancy are unchanged. On mismatch, `getDatasetById` returns `null` and `deleteDataset` is a silent no-op — the cascade delete (dataset items and versions) is gated by a scoped parent pre-check, so cross-tenant data is never touched.
159
+
160
+ - Added optional `organizationId` and `projectId` query parameters to the dataset routes. ([#18750](https://github.com/mastra-ai/mastra/pull/18750))
161
+
162
+ `GET /datasets/:datasetId`, `PATCH /datasets/:datasetId`, and `DELETE /datasets/:datasetId` now accept optional tenancy query parameters. When provided, they are forwarded to `mastra.datasets.get` / `.delete` and the operation returns 404 if the dataset does not belong to the requested tenant. Requests that omit the query parameters keep their existing behavior.
163
+
164
+ **Example**
165
+
166
+ ```
167
+ GET /datasets/abc123?organizationId=org_a&projectId=proj_1
168
+ DELETE /datasets/abc123?organizationId=org_a
169
+ ```
170
+
171
+ - Updated dependencies [[`700619b`](https://github.com/mastra-ai/mastra/commit/700619b61d572e592cbaaf758121d168844ca4d2), [`0f69865`](https://github.com/mastra-ai/mastra/commit/0f69865aced225d98eac812e22699dc445ee18cb), [`9250acd`](https://github.com/mastra-ai/mastra/commit/9250acd1357f0f1f33d0dcca16f9655084c58eca), [`0c3d4bc`](https://github.com/mastra-ai/mastra/commit/0c3d4bcae13ea3699d379403e6f350d5cf4efe9f), [`cc440a3`](https://github.com/mastra-ai/mastra/commit/cc440a39400d8ce06655462b26c1666a1b3d4320), [`6a61846`](https://github.com/mastra-ai/mastra/commit/6a61846eeda29fb714549b70f1bee2bf6b141c44), [`215f9b0`](https://github.com/mastra-ai/mastra/commit/215f9b0f3f3f6fc165edad360582dd4d3d7ea748), [`17369b2`](https://github.com/mastra-ai/mastra/commit/17369b25250561e9ed994ae509be1d15bfb33bcb), [`c64c2a8`](https://github.com/mastra-ai/mastra/commit/c64c2a8503a50252f9ca6b8e8c54cadee31b92a2), [`bcae929`](https://github.com/mastra-ai/mastra/commit/bcae929945cbf265bd9f327cc715ecafa072b5b9), [`ea6327b`](https://github.com/mastra-ai/mastra/commit/ea6327ba2d63ca647804bc97b347e03a58617162), [`3439fa8`](https://github.com/mastra-ai/mastra/commit/3439fa836ecfcaa257b40c20b30ac2a8be22e9ea), [`85107f2`](https://github.com/mastra-ai/mastra/commit/85107f2758b527147fccbedff962961927c2d3b8), [`b33822e`](https://github.com/mastra-ai/mastra/commit/b33822e8d470884954b02f7b0745407ee4ef74b1), [`06e2680`](https://github.com/mastra-ai/mastra/commit/06e26806b51d2cbd858afdc66daa2b86ff3ba64a), [`06ff9e0`](https://github.com/mastra-ai/mastra/commit/06ff9e0befd1d642ab87ff749285ee4091205c7e), [`d5c11e3`](https://github.com/mastra-ai/mastra/commit/d5c11e3ba5045969caa7272a7bd1fd141c93ab6c), [`7f5e1ff`](https://github.com/mastra-ai/mastra/commit/7f5e1ff695a92f672bb3976363925d1e9136b54a), [`ff80671`](https://github.com/mastra-ai/mastra/commit/ff8067185e208b27198b4e5b71803013175c3643), [`b8375c1`](https://github.com/mastra-ai/mastra/commit/b8375c1f8fe905df8ae2ae9a893bb365f17aec4e), [`dab1257`](https://github.com/mastra-ai/mastra/commit/dab1257b64e4ed576dc5038bb7a3f7072338bc9f), [`1240f05`](https://github.com/mastra-ai/mastra/commit/1240f051c8e5371f1c014448bf37b1a1b9a05e47), [`705ff39`](https://github.com/mastra-ai/mastra/commit/705ff3969e57214ff2fdaf3815d751dd558886ed), [`e6fbd5b`](https://github.com/mastra-ai/mastra/commit/e6fbd5bfdc28e92c0c0433f29aa1bc152d3430f6), [`215f9b0`](https://github.com/mastra-ai/mastra/commit/215f9b0f3f3f6fc165edad360582dd4d3d7ea748), [`24c10d3`](https://github.com/mastra-ai/mastra/commit/24c10d333e6649ac06075903aeeee13a933db3b3), [`24c10d3`](https://github.com/mastra-ai/mastra/commit/24c10d333e6649ac06075903aeeee13a933db3b3), [`24c10d3`](https://github.com/mastra-ai/mastra/commit/24c10d333e6649ac06075903aeeee13a933db3b3), [`6f2026c`](https://github.com/mastra-ai/mastra/commit/6f2026cdf114ff1e21e49133ca774ec7d5085059), [`24c10d3`](https://github.com/mastra-ai/mastra/commit/24c10d333e6649ac06075903aeeee13a933db3b3), [`215f9b0`](https://github.com/mastra-ai/mastra/commit/215f9b0f3f3f6fc165edad360582dd4d3d7ea748), [`215f9b0`](https://github.com/mastra-ai/mastra/commit/215f9b0f3f3f6fc165edad360582dd4d3d7ea748), [`003f35d`](https://github.com/mastra-ai/mastra/commit/003f35d19e07b23b4bacc591c8bc0c59b42124ae), [`f890eda`](https://github.com/mastra-ai/mastra/commit/f890eda2c8a2ae83d9b30bc6d85842f93b6c266b), [`1340fb7`](https://github.com/mastra-ai/mastra/commit/1340fb76262a3ca062130aa71859f07257a0a5a4)]:
172
+ - @mastra/core@1.49.0
173
+
3
174
  ## 1.15.0-alpha.2
4
175
 
5
176
  ### Patch 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.15.0-alpha.2"
6
+ version: "1.15.1-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.15.0-alpha.2",
2
+ "version": "1.15.1-alpha.0",
3
3
  "package": "@mastra/libsql",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -103,7 +103,7 @@ new Mastra({
103
103
 
104
104
  `S3Filesystem` uses the default AWS credential chain (environment variables, `~/.aws` config, IAM roles, EC2 instance profile). For long-running deployments, use a credential provider function so credentials refresh automatically.
105
105
 
106
- `DockerSandbox` and `VercelSandbox` are alternative cloud sandbox providers, pick whichever matches your runtime.
106
+ `DockerSandbox`, `VercelSandbox`, and `VercelServerlessSandbox` are alternative cloud sandbox providers. Pick whichever matches your runtime.
107
107
 
108
108
  > **Warning:** A local sandbox can't run commands safely in a shared environment. Always register a cloud sandbox provider and reference it in the workspace config before deploying.
109
109
 
@@ -49,6 +49,8 @@ for await (const chunk of stream.fullStream) {
49
49
  ```
50
50
 
51
51
  > **Note:** Agent approval uses snapshots to capture request state. Configure a [storage provider](https://mastra.ai/docs/memory/storage) on your Mastra instance or you'll see a "snapshot not found" error.
52
+ >
53
+ > Snapshots for agent runs are minimal resume artifacts: they hold only what's needed to resume the suspended run and are deleted once the run finishes. Use [tracing](https://mastra.ai/docs/observability/overview) for the execution record and [memory](https://mastra.ai/docs/memory/overview) for the conversation history.
52
54
 
53
55
  ## How approval works
54
56
 
@@ -399,7 +399,7 @@ const response = await agent.generate('What do you know about me?', {
399
399
 
400
400
  ## Opt in to state signals (experimental)
401
401
 
402
- By default, working memory reaches the model as part of the system message. You can opt into delivering it as a [state signal](https://mastra.ai/docs/agents/signals) instead by setting `useStateSignals: true`:
402
+ By default, working memory reaches the model as part of the system message. You can opt into delivering it as a [state signal](https://mastra.ai/docs/long-running-agents/signals) instead by setting `useStateSignals: true`:
403
403
 
404
404
  ```typescript
405
405
  const memory = new Memory({
@@ -235,6 +235,6 @@ if (result.status === 'suspended') {
235
235
  ## Related
236
236
 
237
237
  - [Control Flow](https://mastra.ai/docs/workflows/control-flow)
238
- - [Suspend & Resume](https://mastra.ai/docs/workflows/suspend-and-resume)
238
+ - [Suspend and Resume](https://mastra.ai/docs/workflows/suspend-and-resume)
239
239
  - [Time Travel](https://mastra.ai/docs/workflows/time-travel)
240
240
  - [Human-in-the-loop](https://mastra.ai/docs/workflows/human-in-the-loop)
@@ -69,7 +69,7 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
69
69
 
70
70
  **observability** (`ObservabilityEntrypoint`): Observability configuration for tracing and monitoring
71
71
 
72
- **environment** (`string`): Deployment environment name (e.g. \`production\`, \`staging\`, \`development\`). When set, automatically attached to all observability signals so they can be filtered by environment without passing \`tracingOptions.metadata.environment\` on each call. Falls back to \`process.env.NODE\_ENV\` when unset; left undefined if neither is set. Per-call \`tracingOptions.metadata.environment\` always takes precedence.
72
+ **environment** (`string`): Deployment environment name (e.g. production, staging, development). When set, automatically attached to all observability signals so they can be filtered by environment without passing tracingOptions.metadata.environment on each call. Falls back to process.env.NODE\_ENV when unset; left undefined if neither is set. Per-call tracingOptions.metadata.environment always takes precedence.
73
73
 
74
74
  **deployer** (`MastraDeployer`): An instance of a MastraDeployer for managing deployments.
75
75
 
@@ -91,13 +91,13 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
91
91
 
92
92
  **notifications.dispatch** (`NotificationDispatchConfig`): Scheduled dispatch configuration for deferred notifications and notification summaries. Dispatch is enabled by default.
93
93
 
94
- **notifications.dispatch.enabled** (`boolean`): Set to \`false\` to opt out of automatic scheduled notification dispatch.
94
+ **notifications.dispatch.enabled** (`boolean`): Set to false to opt out of automatic scheduled notification dispatch.
95
95
 
96
96
  **notifications.dispatch.cron** (`string`): Cron schedule used by the internal notification dispatcher workflow.
97
97
 
98
98
  **notifications.dispatch.batchSize** (`number`): Maximum number of due notification records to process per dispatch run.
99
99
 
100
- **versions** (`VersionOverrides`): Global version overrides for sub-agent delegation. When a supervisor agent delegates to a sub-agent, these overrides determine which stored version of that sub-agent to use instead of the code-defined default. Requires the editor package to be configured. See \[Sub-agent versioning]\(/docs/editor/overview#sub-agent-versioning) for details.
100
+ **versions** (`VersionOverrides`): Global version overrides for sub-agent delegation. When a supervisor agent delegates to a sub-agent, these overrides determine which stored version of that sub-agent to use instead of the code-defined default. Requires the editor package to be configured. See Sub-agent versioning for details.
101
101
 
102
102
  **versions.agents** (`Record<string, VersionSelector>`): A map of agent IDs to their version selectors. Each selector can target a specific version by ID or by publication status.
103
103
 
@@ -29,23 +29,23 @@ export const agent = new Agent({
29
29
 
30
30
  ## Constructor parameters
31
31
 
32
- **storage** (`MastraCompositeStore`): Storage implementation for persisting memory data. Defaults to \`new DefaultStorage({ config: { url: "file:memory.db" } })\` if not provided.
32
+ **storage** (`MastraCompositeStore`): Storage implementation for persisting memory data. Defaults to new DefaultStorage({ config: { url: "file:memory.db" } }) if not provided.
33
33
 
34
- **vector** (`MastraVector | false`): Vector store for semantic search capabilities. Set to \`false\` to disable vector operations.
34
+ **vector** (`MastraVector | false`): Vector store for semantic search capabilities. Set to false to disable vector operations.
35
35
 
36
36
  **embedder** (`EmbeddingModel<string> | EmbeddingModelV2<string>`): Embedder instance for vector embeddings. Required when semantic recall is enabled.
37
37
 
38
38
  **options** (`MemoryConfig`): Memory configuration options.
39
39
 
40
- **options.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.
40
+ **options.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.
41
41
 
42
42
  **options.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.
43
43
 
44
44
  **options.semanticRecall** (`boolean | { topK: number; messageRange: number | { before: number; after: number }; scope?: 'thread' | 'resource' }`): Enable semantic search in message history. Can be a boolean or an object with configuration options. When enabled, requires both vector store and embedder to be configured. Default topK is 4, default messageRange is {before: 1, after: 1}.
45
45
 
46
- **options.workingMemory** (`WorkingMemory`): Configuration for working memory feature. Can be \`{ enabled: boolean; template?: string; schema?: ZodObject\<any> | JSONSchema7; scope?: 'thread' | 'resource' }\` or \`{ enabled: boolean }\` to disable.
46
+ **options.workingMemory** (`WorkingMemory`): Configuration for working memory feature. Can be { enabled: boolean; template?: string; schema?: ZodObject\<any> | JSONSchema7; scope?: 'thread' | 'resource' } or { enabled: boolean } to disable.
47
47
 
48
- **options.observationalMemory** (`boolean | ObservationalMemoryOptions`): Enable Observational Memory for long-context agentic memory. Set to \`true\` for defaults, or pass a config object to customize token budgets, models, and scope. See \[Observational Memory reference]\(/reference/memory/observational-memory) for configuration details.
48
+ **options.observationalMemory** (`boolean | ObservationalMemoryOptions`): Enable Observational Memory for long-context agentic memory. Set to true for defaults, or pass a config object to customize token budgets, models, and scope. See Observational Memory reference for configuration details.
49
49
 
50
50
  **options.generateTitle** (`boolean | { model: DynamicArgument<MastraLanguageModel>; instructions?: DynamicArgument<string> }`): Controls automatic thread title generation from the user's first message. Can be a boolean or an object with custom model and instructions.
51
51
 
@@ -128,11 +128,11 @@ export const mastra = new Mastra({
128
128
 
129
129
  **id** (`string`): Unique identifier for this storage instance.
130
130
 
131
- **default** (`MastraCompositeStore`): Default storage adapter. Domains not explicitly specified in \`domains\` will use this storage's domains as fallbacks.
131
+ **default** (`MastraCompositeStore`): Default storage adapter. Domains not explicitly specified in domains will use this storage's domains as fallbacks.
132
132
 
133
133
  **disableInit** (`boolean`): When true, automatic initialization is disabled. You must call init() explicitly.
134
134
 
135
- **domains** (`object`): Individual domain overrides. Each domain can come from a different storage adapter. These take precedence over both \`editor\` and \`default\` storage.
135
+ **domains** (`object`): Individual domain overrides. Each domain can come from a different storage adapter. These take precedence over both editor and default storage.
136
136
 
137
137
  **domains.memory** (`MemoryStorage`): Storage for threads, messages, and resources.
138
138
 
@@ -118,7 +118,7 @@ For local development, you can use [DynamoDB Local](https://docs.aws.amazon.com/
118
118
 
119
119
  **config.endpoint** (`string`): Custom endpoint for DynamoDB (e.g., 'http\://localhost:8000' for local development).
120
120
 
121
- **config.credentials** (`object`): AWS credentials object with \`accessKeyId\` and \`secretAccessKey\`. If not provided, the AWS SDK will attempt to source credentials from environment variables, IAM roles (e.g., for EC2/Lambda), or the shared AWS credentials file.
121
+ **config.credentials** (`object`): AWS credentials object with accessKeyId and secretAccessKey. If not provided, the AWS SDK will attempt to source credentials from environment variables, IAM roles (e.g., for EC2/Lambda), or the shared AWS credentials file.
122
122
 
123
123
  **config.ttl** (`object`): TTL (Time To Live) configuration for automatic data expiration. Configure per entity type: thread, message, trace, eval, workflow\_snapshot, resource, score. Each entity config includes: enabled (boolean), attributeName (string, default: 'ttl'), defaultTtlSeconds (number).
124
124
 
@@ -91,7 +91,7 @@ storage: new LibSQLStore({
91
91
 
92
92
  ## Options
93
93
 
94
- **url** (`string`): Database URL. Use \`:memory:\` for in-memory database, \`file:filename.db\` for a file database, or a libSQL connection string (e.g., \`libsql://your-database.turso.io\`) for remote storage.
94
+ **url** (`string`): Database URL. Use :memory: for in-memory database, file:filename.db for a file database, or a libSQL connection string (e.g., libsql://your-database.turso.io) for remote storage.
95
95
 
96
96
  **authToken** (`string`): Authentication token for remote libSQL databases.
97
97
 
@@ -55,11 +55,11 @@ Set the `retention` field on the store config.
55
55
 
56
56
  **retention** (`RetentionConfig`): Per-domain, per-table age policies. Unset domains and tables are kept forever.
57
57
 
58
- **retention.\[domain]** (`Record<TableKey, TableRetentionPolicy>`): A real storage domain key (e.g. \`memory\`, \`observability\`). Maps that domain's retention-eligible table keys to their policies.
58
+ **retention.\[domain]** (`Record<TableKey, TableRetentionPolicy>`): A real storage domain key (e.g. memory, observability). Maps that domain's retention-eligible table keys to their policies.
59
59
 
60
60
  ### TableRetentionPolicy
61
61
 
62
- **maxAge** (`Duration`): Maximum age to keep rows. Rows whose anchor timestamp is strictly older than \`Date.now() - maxAge\` are eligible for deletion. A number is milliseconds, or a string with a unit suffix: \`ms\`, \`s\`, \`m\`, \`h\`, \`d\`, \`w\` (e.g. \`'30d'\`, \`'12h'\`).
62
+ **maxAge** (`Duration`): Maximum age to keep rows. Rows whose anchor timestamp is strictly older than Date.now() - maxAge are eligible for deletion. A number is milliseconds, or a string with a unit suffix: ms, s, m, h, d, w (e.g. '30d', '12h').
63
63
 
64
64
  **batchSize** (`number`): Rows deleted per batch. Each batch is its own transaction, which bounds lock duration and WAL growth on large tables. (Default: `1000`)
65
65
 
@@ -122,13 +122,13 @@ Returns: `Promise<PruneResult[]>`
122
122
 
123
123
  ##### PruneOptions
124
124
 
125
- **maxBatches** (`number`): Maximum delete batches per table per call. When reached, that table's result is returned with \`done: false\`.
125
+ **maxBatches** (`number`): Maximum delete batches per table per call. When reached, that table's result is returned with done: false.
126
126
 
127
- **maxRows** (`number`): Maximum rows deleted per table per call. When reached, that table's result is returned with \`done: false\`.
127
+ **maxRows** (`number`): Maximum rows deleted per table per call. When reached, that table's result is returned with done: false.
128
128
 
129
129
  **pauseMs** (`number`): Delay in milliseconds between batches, to avoid starving live traffic.
130
130
 
131
- **signal** (`AbortSignal`): Cooperative cancellation. The batch loop checks it between batches and stops cleanly, returning partial results with \`done: false\`.
131
+ **signal** (`AbortSignal`): Cooperative cancellation. The batch loop checks it between batches and stops cleanly, returning partial results with done: false.
132
132
 
133
133
  ##### PruneResult
134
134
 
package/dist/index.cjs CHANGED
@@ -10355,7 +10355,7 @@ function rowToSchedule(row) {
10355
10355
  }
10356
10356
  const schedule = {
10357
10357
  id: String(row.id),
10358
- target,
10358
+ target: storage.normalizeScheduleTarget(target),
10359
10359
  cron: String(row.cron),
10360
10360
  status: String(row.status),
10361
10361
  nextFireAt: toNumber(row.next_fire_at),