Skip to content

fix(deps): update dependency @mastra/libsql to v1#49

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/mastra-libsql-1.x
Open

fix(deps): update dependency @mastra/libsql to v1#49
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/mastra-libsql-1.x

Conversation

@renovate

@renovate renovate Bot commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
@mastra/libsql (source) ^0.12.0^1.0.0 age confidence

Release Notes

mastra-ai/mastra (@​mastra/libsql)

v1.15.0

Compare Source

Minor Changes
  • 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)

    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.

    const storage = new LibSQLStore({
      id: 'mastra-storage',
      url: 'file:./mastra.db',
      retention: {
        memory: { messages: { maxAge: '30d' } },
        observability: { spans: { maxAge: '7d' } },
      },
    });
    
    await storage.prune();
Patch Changes
  • Added optional tenancy arguments to getDataset, updateDataset, and deleteDataset. (#​18750)

    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.

    Example

    // Before
    await client.getDataset('abc123');
    await client.deleteDataset('abc123');
    await client.updateDataset({ id: 'abc123', name: 'renamed' });
    
    // After — scope to a tenant
    await client.getDataset('abc123', { organizationId: 'org_a', projectId: 'proj_1' });
    await client.deleteDataset('abc123', { organizationId: 'org_a' });
    await client.updateDataset({ id: 'abc123', name: 'renamed', organizationId: 'org_a' });
  • Pushed remaining dataset read filters and pagination down to storage. (#​18710)

    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.

    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.

    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.

  • 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)

    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.

  • Tenancy-scope experiments getById and delete* on ExperimentsStorage. (#​18770)

    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):

    • On tenancy mismatch, get* returns null at the storage layer.
    • On tenancy mismatch, delete* is a silent no-op.
    • 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.

    Both behaviors match how a missing id already responds, so existence does not leak through error timing or messages.

    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.

    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.

    Legacy calls that omit filters are unchanged, so this is fully backwards-compatible.

    // Before: any caller who knew the id could read/delete across tenants.
    await store.experiments.getExperimentById({ id: experimentId });
    await store.experiments.deleteExperiment({ id: experimentId });
    
    // After: pass the caller's scope; wrong tenant gets null / silent no-op.
    await store.experiments.getExperimentById({
      id: experimentId,
      filters: { organizationId, projectId },
    });
    await store.experiments.deleteExperiment({
      id: experimentId,
      filters: { organizationId, projectId },
    });
  • Fixed a cross-tenant data-access issue on datasets by scoping DatasetsManager.get and DatasetsManager.delete to tenancy filters. (#​18750)

    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).

    What changed

    • DatasetsManager.get and DatasetsManager.delete accept optional organizationId and projectId.
    • The tenancy is stashed on the returned Dataset handle and forwarded to every downstream storage call (getDetails, update, addItem, item batch ops, startExperimentAsync).
    • The abstract storage contract (getDatasetById, deleteDataset) gained an optional filters?: DatasetTenancyFilters arg.
    • Item-mutation inputs (AddDatasetItemInput, UpdateDatasetItemInput, BatchInsertItemsInput, BatchDeleteItemsInput) and UpdateDatasetInput accept optional filters for the internal existence check.

    Behavior

    • Omitting tenancy preserves the existing behavior (no predicate added) — fully backwards compatible.
    • 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.

    Example

    // Before
    const ds = await mastra.datasets.get({ id });
    await mastra.datasets.delete({ id });
    
    // After — scope to a tenant
    const ds = await mastra.datasets.get({ id, organizationId, projectId });
    await mastra.datasets.delete({ id, organizationId, projectId });
  • 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)

    • scoreTrace() accepts top-level batchId, datasetId, and datasetItemId when persisting a score for a stored trace.
    • ScoreRowData and score save payloads now include nullable batchId, datasetId, and datasetItemId.
    • Built-in stores with explicit score schema or attribute mappings now persist these provenance fields on saved scores.
    • D1, DSQL, MSSQL, and Upstash score stores now apply additive provenance migrations or deterministic score ordering for persisted score reads.
    await scoreTrace({
      storage,
      scorer,
      target: { traceId },
      batchId: 'baseline-batch-1',
      datasetId,
      datasetItemId,
    });
  • 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)

    await storage.saveScore({ ...score, organizationId: 'org-a', projectId: 'proj-1' });
    
    const result = await storage.listScoresByScorerId({
      scorerId,
      filters: { organizationId: 'org-a', projectId: 'proj-1' },
    });

    projectId identifies the project scope, separate from resourceId which continues to mean the agent memory resource.

  • 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)

  • Scoped getDatasetById and deleteDataset to tenancy filters when the caller passes organizationId / projectId. (#​18750)

    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.

  • Added optional organizationId and projectId query parameters to the dataset routes. (#​18750)

    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.

    Example

    GET /datasets/abc123?organizationId=org_a&projectId=proj_1
    DELETE /datasets/abc123?organizationId=org_a
    
  • Updated dependencies [700619b, 0f69865, 9250acd, 0c3d4bc, cc440a3, 6a61846, 215f9b0, 17369b2, c64c2a8, bcae929, ea6327b, 3439fa8, 85107f2, b33822e, 06e2680, 06ff9e0, d5c11e3, 7f5e1ff, ff80671, b8375c1, dab1257, 1240f05, 705ff39, e6fbd5b, 215f9b0, 24c10d3, 24c10d3, 24c10d3, 6f2026c, 24c10d3, 215f9b0, 215f9b0, 003f35d, f890eda, 1340fb7]:

v1.14.3

Compare Source

Patch Changes

v1.14.2

Compare Source

Patch Changes

v1.14.1

Compare Source

Patch Changes
  • Added multi-tenant scoping columns (organizationId, projectId) to the experiments domain so experiment records and per-item results inherit the tenancy bucket of their parent dataset. (#​18388)

    Experiment, ExperimentResult, CreateExperimentInput, and AddExperimentResultInput now carry optional organizationId / projectId fields. ListExperimentsInput and ListExperimentResultsInput gain a filters: ExperimentTenancyFilters block (mirrors DatasetTenancyFilters) for scoping queries within a (organizationId, projectId) bucket. Tenancy is hydrated from the parent dataset on createExperiment and denormalized onto each ExperimentResult for efficient tenancy-scoped queries.

    The corresponding columns are also added to the mastra_experiments and mastra_experiment_results table schemas. Existing rows backfill to null, matching the rest of the dataset-tenancy surface.

    This release also clarifies the targetType contract via JSDoc:

    • CreateDatasetInput.targetType remains optional. Datasets without a TargetType are not experiment-eligible — the experiment runner requires a non-null CreateExperimentInput.targetType to resolve an executor.
    • Experiment.targetType / CreateExperimentInput.targetType stay required. An experiment by definition replays inputs against a specific target.

    No behavior change for existing OSS-created experiments; the new fields are additive and optional.

    Example:

    // Create an experiment scoped to a tenancy bucket. When the parent dataset
    // already carries `organizationId` / `projectId`, `runExperiment` hydrates
    // these fields automatically from the dataset record.
    const experiment = await storage.createExperiment({
      name: 'qa-regression',
      datasetId: 'ds_123',
      datasetVersion: 1,
      targetType: 'agent',
      targetId: 'agent_qa',
      totalItems: 10,
      organizationId: 'org_123',
      projectId: 'proj_123',
    });
    
    // List experiments within a tenancy bucket.
    const experiments = await storage.listExperiments({
      pagination: { page: 0, perPage: 20 },
      filters: { organizationId: 'org_123', projectId: 'proj_123' },
    });
    
    // List per-item results within the same bucket.
    const results = await storage.listExperimentResults({
      experimentId: experiment.id,
      pagination: { page: 0, perPage: 50 },
      filters: { organizationId: 'org_123', projectId: 'proj_123' },
    });
  • Persist and filter dataset tenancy + candidate identity in storage adapters. (#​18314)

    createDataset now persists organizationId, projectId, candidateKey, and candidateId. listDatasets and listItems accept matching tenancy filters. Dataset items inherit organizationId / projectId from their parent dataset on insert, update, delete, and batch insert/delete — items are never settable per call (item tenancy follows dataset tenancy).

    All new columns are nullable and added retroactively via each adapter's existing column-migration path; no breaking DDL. Existing rows continue to read and write fine; new writes can choose to stamp tenancy.

    await storage.createDataset({
      name: 'candidates/missing-tool-call/incident-123',
      organizationId: 'org_abc',
      projectId: 'project_xyz',
      candidateKey: 'missing-tool-call',
      candidateId: 'incident-123',
    });
    
    await storage.listDatasets({
      pagination: { page: 0, perPage: 20 },
      filters: { organizationId: 'org_abc', projectId: 'project_xyz' },
    });
  • Fixed: mastra build output no longer hangs on the first storage-touching request when an app uses LibSQLStore, PostgresStore, or MySQLStore with observational memory. mastra dev was unaffected; only the bundled mastra start output deadlocked. No code changes or bundler.externals workaround required on the app side after upgrading. (#​18302)

  • Added storage for item-level tool mocks. Dataset items persist their toolMocks and experiment results persist their toolMockReport, so mocks and run diagnostics survive across sessions. (#​18036)

  • Updated dependencies [5bd72d2, 1cc9ee1, 417baae, 65f255a, 74955f9, 30ebaf0, 5704634, 5c4e9a4, 4a88c6e, 417baae, 74955f9, 74955f9, 25961e3, 6a1428a, 87a17ef, e11ff30, 7794d71, 9d2c946, c0eda2b, 7b29f33, c0eda2b, b13925b, f1ec385, e14986f, 24912b1, bf94ec6, a29f371, 7686216, 74955f9, 073f910, 0be490f, 0be490f, ebbe1d3, 974f614, 3818814, 975c59a, 1f97ce5, 74955f9, 7f51548, 64f58c0, 74955f9, ebbe1d3, d95f394, 417baae, 8e25a78, 417baae, f3f0c9d, a5b22d3, 31be1cf, 417baae, 74955f9, 74955f9]:

v1.14.0

Compare Source

Minor Changes
Patch Changes

v1.13.2

Compare Source

v1.13.0

Compare Source

Minor Changes
  • Added LibSQL storage support for durable harness sessions. (#​17712)

    const storage = new LibSQLStore({ id: 'mastra-storage', url: 'file:./mastra.db' });
    
    const harness = new Harness({
      ownerId: 'my-app',
      agent,
      memory,
      storage,
      modes: [{ id: 'default', defaultModelId: '__GATEWAY_OPENAI_MODEL__' }],
      defaultModeId: 'default',
    });
  • Add ThreadStateLibSQL, the LibSQL implementation of the new ThreadStateStorage domain. It persists per-thread, per-type state (e.g. the agent task list under type: "task") in the mastra_thread_state table, keyed by (threadId, type). Composing a LibSQL store wires this domain automatically, so an agent's task list now survives a process restart. (#​17820)

Patch Changes

v1.12.1

Compare Source

Patch Changes
  • Added LibSQL support for the notifications storage domain so notification signals can persist thread-scoped inbox records. (#​17241)

    import { LibSQLStore } from '@​mastra/libsql';
    
    const storage = new LibSQLStore({ url: 'file:./mastra.db' });
  • Fixed LibSQL memory cleanup so in-memory stores initialize their tables before clearing data. This prevents reset flows from failing with missing table errors such as mastra_resources. (#​17532)

  • Updated dependencies [c973db4, 552285e, 77e686c, ece8dba, e751af2, e2a8380, be3f1cd, a34d9db]:

v1.12.0

Compare Source

Minor Changes
  • Added the tool_provider_connections storage domain. Stored agents can now persist per-agent ToolProvider config that round-trips on read/write/create. Runtime connection resolution (per-author, shared, caller-supplied) ships in a follow-up PR. (#​17247)

    What you can do

    • Pin a connection on a stored agent's config and have it round-trip on read/write/create.
    • Persist multiple connections per toolkit so a follow-up runtime PR can fan-out to the right one at execution time.

    Example

    import { LibSQLStore } from '@​mastra/libsql';
    
    const storage = new LibSQLStore({ url: process.env.DATABASE_URL });
    
    // Persist an OAuth connection that an agent can pin later
    await storage.toolProviders.upsertConnection({
      authorId: 'user-123',
      providerId: 'composio',
      connectionId: 'auth_abc',
      toolkit: 'gmail',
      label: 'Work inbox',
      scope: 'per-author',
    });
    
    // List a user's own connections (admin can omit authorId to list across users)
    const { items } = await storage.toolProviders.listConnectionsByAuthor({
      authorId: 'user-123',
      providerId: 'composio',
    });

    Additive — existing stored agents continue to work unchanged. The runtime that consumes this domain ships in a follow-up PR.

    PR 1 of 3 split from #​17224.

Patch Changes

v1.11.1

Compare Source

Patch Changes
  • Fixed scheduler performance and correctness issues that could cause excessive Postgres CPU and noisy failed runs. (#​16805)

    • Added missing indexes on the schedules tables that the tick loop polls every 10 seconds: (status, next_fire_at) on mastra_schedules and (schedule_id, actual_fire_at) on mastra_schedule_triggers. Without these the scheduler performed a full sequential scan on every tick.
    • The scheduler tick loop is now only started when at least one workflow declares a schedule (or scheduler.enabled is set explicitly), so deployments without scheduled workflows no longer poll the database at all.
    • The scheduler now validates that a schedule's target workflow is still registered before firing it. Schedules whose target workflow has been removed from the Mastra config are skipped for a short grace window and then deleted, so stale rows stop producing failed workflow runs forever.
    • The scheduler is now lazily initialized inside startWorkers(). Accessing mastra.scheduler before startWorkers() runs throws a descriptive error instead of returning a half-initialized instance.
  • Updated dependencies [452036a, c272d50, 27fd1b7, 5ba7253, 5556cc1, f73980d, 5499303, a702009, 9aee493, d8692af, 1a9cc60, 8cdb86c, 8534d79, [eda90c5](https://redirect.github.com/m

Note

PR body was truncated to here.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 2 times, most recently from 0f31af0 to c8a1017 Compare January 30, 2026 09:42
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 2 times, most recently from 671d98a to 293792e Compare February 11, 2026 18:14
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 2 times, most recently from 7f9d8cf to 630398d Compare February 19, 2026 10:12
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 3 times, most recently from 2dcdb6d to 50800d9 Compare February 26, 2026 00:51
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 3 times, most recently from cf57051 to 15c191d Compare March 6, 2026 01:33
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 2 times, most recently from bf2f144 to f2d02c9 Compare March 18, 2026 05:23
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 2 times, most recently from 1aaa8d0 to dd0fbef Compare March 31, 2026 01:49
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 2 times, most recently from 5551cef to 56a2887 Compare April 7, 2026 05:32
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 2 times, most recently from 0efc669 to f32ad51 Compare April 15, 2026 09:10
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch from f32ad51 to cbd2103 Compare April 22, 2026 04:51
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 3 times, most recently from 12381f2 to 0ce1ac7 Compare May 5, 2026 01:06
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 2 times, most recently from 457860f to fa2481f Compare May 16, 2026 00:22
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch from fa2481f to 93ab440 Compare May 21, 2026 01:10
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 2 times, most recently from a936250 to e1dc812 Compare June 3, 2026 20:13
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch from e1dc812 to 5789634 Compare June 13, 2026 16:07
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 4 times, most recently from 3256f3d to ab51a5a Compare June 19, 2026 10:36
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch 2 times, most recently from 76a5b30 to eea95c2 Compare June 26, 2026 20:36
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch from eea95c2 to 55cb13b Compare July 1, 2026 22:16
@renovate renovate Bot force-pushed the renovate/mastra-libsql-1.x branch from 55cb13b to 8982ec4 Compare July 3, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants