@mastra/libsql 0.0.0-working-memory-undefined-20260212204651 → 0.0.0-workshop-yj-20260903030708

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 (109) hide show
  1. package/LICENSE.md +17 -0
  2. package/README.md +13 -107
  3. package/dist/docs/SKILL.md +30 -27
  4. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  5. package/dist/docs/references/docs-agents-human-in-the-loop.md +682 -0
  6. package/dist/docs/references/docs-agents-networks.md +109 -213
  7. package/dist/docs/references/docs-deployment-workers.md +394 -0
  8. package/dist/docs/references/docs-memory-memory-processors.md +162 -91
  9. package/dist/docs/references/docs-memory-message-history.md +160 -70
  10. package/dist/docs/references/docs-memory-multi-user-threads.md +210 -0
  11. package/dist/docs/references/docs-memory-overview.md +248 -25
  12. package/dist/docs/references/docs-memory-semantic-recall.md +228 -79
  13. package/dist/docs/references/docs-memory-working-memory.md +104 -70
  14. package/dist/docs/references/docs-storage.md +222 -0
  15. package/dist/docs/references/docs-studio-editor.md +353 -0
  16. package/dist/docs/references/docs-workflows-snapshots.md +51 -45
  17. package/dist/docs/references/integrations-channels-github.md +152 -0
  18. package/dist/docs/references/{reference-storage-dynamodb.md → integrations-databases-dynamodb.md} +48 -44
  19. package/dist/docs/references/{reference-storage-libsql.md → integrations-databases-libsql.md} +54 -28
  20. package/dist/docs/references/{guides-agent-frameworks-ai-sdk.md → reference-ai-sdk-overview.md} +42 -38
  21. package/dist/docs/references/reference-core-getMemory.md +19 -16
  22. package/dist/docs/references/reference-core-listMemory.md +21 -18
  23. package/dist/docs/references/reference-core-mastra-class.md +119 -28
  24. package/dist/docs/references/reference-file-based-agents-memory.md +62 -0
  25. package/dist/docs/references/reference-file-based-agents-storage.md +34 -0
  26. package/dist/docs/references/reference-memory-memory-class.md +48 -44
  27. package/dist/docs/references/{docs-rag-retrieval.md → reference-rag-retrieval.md} +286 -152
  28. package/dist/docs/references/reference-storage-composite.md +223 -59
  29. package/dist/docs/references/reference-storage-retention.md +250 -0
  30. package/dist/docs/references/reference-vectors-libsql.md +77 -73
  31. package/dist/index.cjs +14255 -7157
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.js +14222 -7140
  34. package/dist/index.js.map +1 -1
  35. package/dist/storage/db/client.d.ts +31 -0
  36. package/dist/storage/db/client.d.ts.map +1 -0
  37. package/dist/storage/db/index.d.ts +86 -2
  38. package/dist/storage/db/index.d.ts.map +1 -1
  39. package/dist/storage/db/utils.d.ts +17 -1
  40. package/dist/storage/db/utils.d.ts.map +1 -1
  41. package/dist/storage/db/write-lock.d.ts +8 -0
  42. package/dist/storage/db/write-lock.d.ts.map +1 -0
  43. package/dist/storage/domains/agents/index.d.ts +1 -0
  44. package/dist/storage/domains/agents/index.d.ts.map +1 -1
  45. package/dist/storage/domains/background-tasks/index.d.ts +29 -0
  46. package/dist/storage/domains/background-tasks/index.d.ts.map +1 -0
  47. package/dist/storage/domains/blobs/index.d.ts +17 -0
  48. package/dist/storage/domains/blobs/index.d.ts.map +1 -0
  49. package/dist/storage/domains/channels/index.d.ts +20 -0
  50. package/dist/storage/domains/channels/index.d.ts.map +1 -0
  51. package/dist/storage/domains/datasets/index.d.ts +43 -0
  52. package/dist/storage/domains/datasets/index.d.ts.map +1 -0
  53. package/dist/storage/domains/experiments/index.d.ts +55 -0
  54. package/dist/storage/domains/experiments/index.d.ts.map +1 -0
  55. package/dist/storage/domains/favorites/index.d.ts +17 -0
  56. package/dist/storage/domains/favorites/index.d.ts.map +1 -0
  57. package/dist/storage/domains/harness/index.d.ts +17 -0
  58. package/dist/storage/domains/harness/index.d.ts.map +1 -0
  59. package/dist/storage/domains/knowledge/index.d.ts +81 -0
  60. package/dist/storage/domains/knowledge/index.d.ts.map +1 -0
  61. package/dist/storage/domains/mcp-clients/index.d.ts.map +1 -1
  62. package/dist/storage/domains/mcp-servers/index.d.ts +26 -0
  63. package/dist/storage/domains/mcp-servers/index.d.ts.map +1 -0
  64. package/dist/storage/domains/memory/index.d.ts +30 -5
  65. package/dist/storage/domains/memory/index.d.ts.map +1 -1
  66. package/dist/storage/domains/notifications/index.d.ts +23 -0
  67. package/dist/storage/domains/notifications/index.d.ts.map +1 -0
  68. package/dist/storage/domains/observability/index.d.ts +9 -1
  69. package/dist/storage/domains/observability/index.d.ts.map +1 -1
  70. package/dist/storage/domains/prompt-blocks/index.d.ts.map +1 -1
  71. package/dist/storage/domains/schedules/index.d.ts +27 -0
  72. package/dist/storage/domains/schedules/index.d.ts.map +1 -0
  73. package/dist/storage/domains/scorer-definitions/index.d.ts.map +1 -1
  74. package/dist/storage/domains/scores/index.d.ts +15 -5
  75. package/dist/storage/domains/scores/index.d.ts.map +1 -1
  76. package/dist/storage/domains/skills/index.d.ts +27 -0
  77. package/dist/storage/domains/skills/index.d.ts.map +1 -0
  78. package/dist/storage/domains/thread-state/index.d.ts +38 -0
  79. package/dist/storage/domains/thread-state/index.d.ts.map +1 -0
  80. package/dist/storage/domains/tool-provider-connections/index.d.ts +14 -0
  81. package/dist/storage/domains/tool-provider-connections/index.d.ts.map +1 -0
  82. package/dist/storage/domains/utils.d.ts +34 -0
  83. package/dist/storage/domains/utils.d.ts.map +1 -0
  84. package/dist/storage/domains/workflow-definitions/index.d.ts +14 -0
  85. package/dist/storage/domains/workflow-definitions/index.d.ts.map +1 -0
  86. package/dist/storage/domains/workflows/index.d.ts +9 -1
  87. package/dist/storage/domains/workflows/index.d.ts.map +1 -1
  88. package/dist/storage/domains/workspaces/index.d.ts +26 -0
  89. package/dist/storage/domains/workspaces/index.d.ts.map +1 -0
  90. package/dist/storage/factory-storage.d.ts +28 -0
  91. package/dist/storage/factory-storage.d.ts.map +1 -0
  92. package/dist/storage/index.d.ts +85 -3
  93. package/dist/storage/index.d.ts.map +1 -1
  94. package/dist/storage/retention.d.ts +77 -0
  95. package/dist/storage/retention.d.ts.map +1 -0
  96. package/dist/vector/filter.d.ts.map +1 -1
  97. package/dist/vector/index.d.ts +26 -1
  98. package/dist/vector/index.d.ts.map +1 -1
  99. package/dist/vector/sql-builder.d.ts.map +1 -1
  100. package/dist/vector/write-lock.d.ts +7 -0
  101. package/dist/vector/write-lock.d.ts.map +1 -0
  102. package/package.json +20 -19
  103. package/CHANGELOG.md +0 -3696
  104. package/dist/docs/references/docs-agents-agent-approval.md +0 -377
  105. package/dist/docs/references/docs-agents-agent-memory.md +0 -212
  106. package/dist/docs/references/docs-agents-network-approval.md +0 -275
  107. package/dist/docs/references/docs-memory-storage.md +0 -261
  108. package/dist/docs/references/docs-observability-overview.md +0 -70
  109. package/dist/docs/references/docs-observability-tracing-exporters-default.md +0 -211
@@ -1,16 +1,48 @@
1
- import type { Client } from '@libsql/client';
2
- import type { StorageDomains } from '@mastra/core/storage';
1
+ import type { RetentionConfig, StorageDomains } from '@mastra/core/storage';
3
2
  import { MastraCompositeStore } from '@mastra/core/storage';
3
+ import type { SqliteClient as Client } from './db/client.js';
4
4
  import { AgentsLibSQL } from './domains/agents/index.js';
5
+ import { BackgroundTasksLibSQL } from './domains/background-tasks/index.js';
6
+ import { BlobsLibSQL } from './domains/blobs/index.js';
7
+ import { ChannelsLibSQL } from './domains/channels/index.js';
8
+ import { DatasetsLibSQL } from './domains/datasets/index.js';
9
+ import { ExperimentsLibSQL } from './domains/experiments/index.js';
10
+ import { FavoritesLibSQL } from './domains/favorites/index.js';
11
+ import { HarnessLibSQL } from './domains/harness/index.js';
12
+ import { KnowledgeLibSQL } from './domains/knowledge/index.js';
5
13
  import { MCPClientsLibSQL } from './domains/mcp-clients/index.js';
14
+ import { MCPServersLibSQL } from './domains/mcp-servers/index.js';
6
15
  import { MemoryLibSQL } from './domains/memory/index.js';
16
+ import { NotificationsLibSQL } from './domains/notifications/index.js';
7
17
  import { ObservabilityLibSQL } from './domains/observability/index.js';
8
18
  import { PromptBlocksLibSQL } from './domains/prompt-blocks/index.js';
19
+ import { SchedulesLibSQL } from './domains/schedules/index.js';
9
20
  import { ScorerDefinitionsLibSQL } from './domains/scorer-definitions/index.js';
10
21
  import { ScoresLibSQL } from './domains/scores/index.js';
22
+ import { SkillsLibSQL } from './domains/skills/index.js';
23
+ import { ThreadStateLibSQL } from './domains/thread-state/index.js';
24
+ import { ToolProviderConnectionsLibSQL } from './domains/tool-provider-connections/index.js';
25
+ import { WorkflowDefinitionsLibSQL } from './domains/workflow-definitions/index.js';
11
26
  import { WorkflowsLibSQL } from './domains/workflows/index.js';
12
- export { AgentsLibSQL, MCPClientsLibSQL, MemoryLibSQL, ObservabilityLibSQL, PromptBlocksLibSQL, ScorerDefinitionsLibSQL, ScoresLibSQL, WorkflowsLibSQL, };
27
+ import { WorkspacesLibSQL } from './domains/workspaces/index.js';
28
+ export { AgentsLibSQL, BackgroundTasksLibSQL, BlobsLibSQL, ChannelsLibSQL, DatasetsLibSQL, ExperimentsLibSQL, HarnessLibSQL, MCPClientsLibSQL, MCPServersLibSQL, MemoryLibSQL, KnowledgeLibSQL, NotificationsLibSQL, ObservabilityLibSQL, PromptBlocksLibSQL, SchedulesLibSQL, ScorerDefinitionsLibSQL, ScoresLibSQL, SkillsLibSQL, FavoritesLibSQL, ThreadStateLibSQL, ToolProviderConnectionsLibSQL, WorkflowDefinitionsLibSQL, WorkflowsLibSQL, WorkspacesLibSQL, };
13
29
  export type { LibSQLDomainConfig } from './db/index.js';
30
+ export type { SqliteClient, SqliteInArgs, SqliteInValue, SqliteResultSet, SqliteStatement, SqliteTransaction, SqliteTransactionMode, SqliteValue, } from './db/client.js';
31
+ export { LibSQLFactoryStorage, type LibSQLFactoryStorageConfig } from './factory-storage.js';
32
+ export type LibSQLStorageDomain = keyof StorageDomains;
33
+ export type LibSQLLocalPragmaOptions = {
34
+ /**
35
+ * SQLite PRAGMA cache_size value for local databases.
36
+ * Negative values are interpreted as kibibytes by SQLite.
37
+ * @default -16000
38
+ */
39
+ cacheSize?: number;
40
+ /**
41
+ * SQLite PRAGMA mmap_size value in bytes for local databases.
42
+ * @default 134217728
43
+ */
44
+ mmapSize?: number;
45
+ };
14
46
  /**
15
47
  * Base configuration options shared across LibSQL configurations
16
48
  */
@@ -27,6 +59,24 @@ export type LibSQLBaseConfig = {
27
59
  * @default 100
28
60
  */
29
61
  initialBackoffMs?: number;
62
+ /**
63
+ * SQLite `busy_timeout` (in milliseconds) applied to the underlying connection
64
+ * for local (`file:`/`:memory:`) databases. When a write hits a locked
65
+ * database, the driver waits up to this long for the lock to clear instead of
66
+ * failing immediately with `SQLITE_BUSY`. Requires `@libsql/client` >= 0.17.4,
67
+ * which also ensures the timeout survives connections created after
68
+ * `transaction()` (see libsql-client-ts#288/#345).
69
+ *
70
+ * Has no effect for remote (`libsql://`/`https://`) clients or when an existing
71
+ * `client` is supplied.
72
+ * @default 5000
73
+ */
74
+ connectionTimeoutMs?: number;
75
+ /**
76
+ * Overrides local SQLite PRAGMA values used for startup/read performance.
77
+ * Only applies to local file and in-memory databases.
78
+ */
79
+ localPragmas?: LibSQLLocalPragmaOptions;
30
80
  /**
31
81
  * When true, automatic initialization (table creation/migrations) is disabled.
32
82
  * This is useful for CI/CD pipelines where you want to:
@@ -47,10 +97,27 @@ export type LibSQLBaseConfig = {
47
97
  * // No auto-init, tables must already exist
48
98
  */
49
99
  disableInit?: boolean;
100
+ /**
101
+ * Opt-in, table-granular, age-based retention policies. Declare per-table
102
+ * `maxAge` per domain (e.g. `{ memory: { messages: { maxAge: '30d' } } }`);
103
+ * unset tables are kept forever. Wire `storage.prune()` to your own cron to
104
+ * apply them. See {@link RetentionConfig}.
105
+ */
106
+ retention?: RetentionConfig;
50
107
  };
51
108
  export type LibSQLConfig = (LibSQLBaseConfig & {
52
109
  url: string;
53
110
  authToken?: string;
111
+ /**
112
+ * URL of the remote primary database to sync from, enabling an embedded
113
+ * replica (e.g. 'libsql://your-db.turso.io'). Requires a local `file:` url.
114
+ */
115
+ syncUrl?: string;
116
+ /**
117
+ * Interval in seconds for automatic sync with the remote primary.
118
+ * Only applies when `syncUrl` is set.
119
+ */
120
+ syncInterval?: number;
54
121
  }) | (LibSQLBaseConfig & {
55
122
  client: Client;
56
123
  });
@@ -76,8 +143,23 @@ export declare class LibSQLStore extends MastraCompositeStore {
76
143
  private client;
77
144
  private readonly maxRetries;
78
145
  private readonly initialBackoffMs;
146
+ private readonly connectionTimeoutMs;
147
+ private readonly pragmasReady;
148
+ private readonly isLocalDb;
149
+ private readonly localPragmas;
79
150
  stores: StorageDomains;
80
151
  constructor(config: LibSQLConfig);
152
+ private applyLocalPragmas;
153
+ private getStoresToInit;
154
+ private initDomainsSequentially;
155
+ private initDomainsInParallel;
156
+ init(): Promise<void>;
157
+ /**
158
+ * Closes the underlying libsql client, releasing this store's OS file handles.
159
+ *
160
+ * Safe to call more than once; subsequent calls are no-ops.
161
+ */
162
+ close(): Promise<void>;
81
163
  }
82
164
  export { LibSQLStore as DefaultStorage };
83
165
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EACL,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;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC,GACF,CAAC,gBAAgB,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEP;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,WAAY,SAAQ,oBAAoB;IACnD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;IAC7C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB;IAC7C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;IACpC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAqC;IAElE,MAAM,EAAE,cAAc,CAAC;IAEvB,YAAY,MAAM,EAAE,YAAY,EAiG/B;YAEa,iBAAiB;IAsB/B,OAAO,CAAC,eAAe;YAIT,uBAAuB;YAOvB,qBAAqB;IAKpB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAgCnC;IAED;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAI3B;CACF;AAED,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,CAAC"}
@@ -0,0 +1,77 @@
1
+ import type { TABLE_NAMES, PruneOptions, PruneResult, TableRetentionPolicy } from '@mastra/core/storage';
2
+ import type { LibSQLDB } from './db/index.js';
3
+ /** One table to prune, resolved from a policy + the domain's descriptor. */
4
+ export interface PruneTarget {
5
+ /** Physical table name. */
6
+ table: TABLE_NAMES;
7
+ /** Timestamp anchor column for the age comparison. */
8
+ column: string;
9
+ /**
10
+ * How the anchor column stores time, which decides how the cutoff is bound:
11
+ * - `timestamp` (default): ISO-8601 string comparison.
12
+ * - `epoch-ms`: raw millisecond number comparison (e.g. `schedules.triggers`).
13
+ */
14
+ anchorType: 'timestamp' | 'epoch-ms';
15
+ /** Whether the anchor column should get a supporting index before pruning. */
16
+ indexed: boolean;
17
+ /** Retention policy (maxAge + optional batchSize). */
18
+ policy: TableRetentionPolicy;
19
+ }
20
+ /**
21
+ * Runs the bounded, batched, cancellable delete loop for a set of tables in the
22
+ * given order (callers pass children before parents for cascade-safe pruning),
23
+ * and returns one {@link PruneResult} per table.
24
+ *
25
+ * The loop:
26
+ * - deletes in chunks of `batchSize` (default 1000), each its own statement;
27
+ * - stops a table's loop when a batch deletes fewer rows than requested (drained),
28
+ * or when `maxBatches`/`maxRows` is hit, or the `signal` aborts — the latter
29
+ * three leave `done: false` so the caller can resume;
30
+ * - pauses `pauseMs` between batches when set, to avoid starving live traffic.
31
+ *
32
+ * `prune()` only deletes rows; it never reclaims disk. Freed pages are reused
33
+ * by future writes so the file stops growing. Handing disk back to the OS is
34
+ * left to the underlying database and the operator to manage.
35
+ */
36
+ /** Convert a policy's `maxAge` into a cutoff bound matching the anchor's storage type. */
37
+ export declare function cutoffFor(policy: TableRetentionPolicy, anchorType: 'timestamp' | 'epoch-ms', now?: number): string | number;
38
+ /**
39
+ * Run the bounded/cancellable batched-delete loop for a single logical target,
40
+ * delegating the actual delete of up to `limit` rows to `deleteBatch`. Returns
41
+ * `{ deleted, done }`; `done: false` means the loop stopped on a bound or the
42
+ * abort signal and eligible rows may remain.
43
+ */
44
+ export declare function runBatchedDelete({ deleteBatch, batchSize, options, }: {
45
+ deleteBatch: (limit: number) => Promise<number>;
46
+ batchSize: number;
47
+ options?: PruneOptions;
48
+ }): Promise<{
49
+ deleted: number;
50
+ done: boolean;
51
+ }>;
52
+ export declare function runPrune({ db, domain, targets, options, logger, }: {
53
+ db: LibSQLDB;
54
+ domain: string;
55
+ targets: PruneTarget[];
56
+ options?: PruneOptions;
57
+ logger?: {
58
+ warn?: (msg: string, err?: unknown) => void;
59
+ };
60
+ }): Promise<PruneResult[]>;
61
+ /**
62
+ * Resolve a domain's `{ tableKey: policy }` map plus its descriptor into an
63
+ * ordered list of {@link PruneTarget}s. `order` lists table keys children-first
64
+ * so cascade-dependent rows are removed before their parents. Table keys not in
65
+ * `policies` are skipped (unset = keep forever).
66
+ */
67
+ export declare function resolveTargets({ policies, descriptor, order, }: {
68
+ policies: Record<string, TableRetentionPolicy>;
69
+ descriptor: Record<string, {
70
+ table: string;
71
+ column: string;
72
+ anchorType?: 'timestamp' | 'epoch-ms';
73
+ indexed?: boolean;
74
+ }>;
75
+ order: string[];
76
+ }): PruneTarget[];
77
+ //# sourceMappingURL=retention.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retention.d.ts","sourceRoot":"","sources":["../../src/storage/retention.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACzG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAIrC,4EAA4E;AAC5E,MAAM,WAAW,WAAW;IAC1B,2BAA2B;IAC3B,KAAK,EAAE,WAAW,CAAC;IACnB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,UAAU,EAAE,WAAW,GAAG,UAAU,CAAC;IACrC,8EAA8E;IAC9E,OAAO,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAwCD;;;;;;;;;;;;;;;GAeG;AACH,0FAA0F;AAC1F,wBAAgB,SAAS,CAAC,MAAM,EAAE,oBAAoB,EAAE,UAAU,EAAE,WAAW,GAAG,UAAU,EAAE,GAAG,SAAa,mBAG7G;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,WAAW,EACX,SAAS,EACT,OAAO,GACR,EAAE;IACD,WAAW,EAAE,CAAC,KAAK,E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C;IACtD,IAAI,EAAE,gBAAgB,CAAC;IACvB,GAAG,EAAE,gBAAgB,CAAC;IACtB,IAAI,EAAE,gBAAgB,CAAC;IACvB,GAAG,EAAE,gBAAgB,CAAC;IACtB,GAAG,EAAE,gBAAgB,CAAC;CACvB,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;AAEpG;;;;;;;;;GASG;AACH,qBAAa,sBAAuB,SAAQ,oBAAoB,CAAC,kBAAkB,CAAC;IAClF,UAAmB,qBAAqB,IAAI,eAAe,CAM1D;IAED,SAAS,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,kBAAkB,CAMzD;IAED,OAAO,CAAC,aAAa;CAsFtB"}
@@ -24,16 +24,41 @@ export interface LibSQLVectorConfig {
24
24
  * @default 100
25
25
  */
26
26
  initialBackoffMs?: number;
27
+ /**
28
+ * Over-fetch multiplier for vector_top_k queries when metadata filters are present.
29
+ * Since vector_top_k doesn't support inline WHERE clauses, we fetch topK * this multiplier
30
+ * candidates and post-filter. Higher values improve recall at the cost of more data scanned.
31
+ * @default 10
32
+ */
33
+ vectorTopKOverFetchMultiplier?: number;
27
34
  }
28
35
  export declare class LibSQLVector extends MastraVector<LibSQLVectorFilter> {
29
36
  private turso;
30
37
  private readonly maxRetries;
31
38
  private readonly initialBackoffMs;
32
- constructor({ url, authToken, syncUrl, syncInterval, maxRetries, initialBackoffMs, id, }: LibSQLVectorConfig & {
39
+ private readonly overFetchMultiplier;
40
+ private readonly isMemoryDb;
41
+ private readonly initialization;
42
+ private databaseKey;
43
+ private vectorIndexes;
44
+ constructor({ url, authToken, syncUrl, syncInterval, maxRetries, initialBackoffMs, vectorTopKOverFetchMultiplier, id, }: LibSQLVectorConfig & {
33
45
  id: string;
34
46
  });
47
+ private initialize;
48
+ private applyLocalPragmas;
49
+ private ensureInitialized;
50
+ private executeMutation;
51
+ /**
52
+ * Closes the underlying libsql client, releasing this vector store's OS file handles.
53
+ *
54
+ * Safe to call more than once; subsequent calls are no-ops.
55
+ */
56
+ close(): Promise<void>;
57
+ private discoverVectorIndexes;
35
58
  private executeWriteOperationWithRetry;
36
59
  transformFilter(filter?: LibSQLVectorFilter): LibSQLVectorFilter;
60
+ private hasVectorIndex;
61
+ private queryWithIndex;
37
62
  query({ indexName, queryVector, topK, filter, includeVector, minScore, }: LibSQLQueryVectorParams): Promise<QueryResult[]>;
38
63
  upsert(args: UpsertVectorParams): Promise<string[]>;
39
64
  private doUpsert;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAqC,MAAM,qBAAqB,CAAC;AACtF,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD,UAAU,uBAAwB,SAAQ,iBAAiB,CAAC,kBAAkB,CAAC;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,YAAa,SAAQ,YAAY,CAAC,kBAAkB,CAAC;IAChE,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CA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kB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjF;YAEa,eAAe;IAiHhB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAcjE;YAEa,gBAAgB;CAM/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"sql-builder.d.ts","sourceRoot":"","sources":["../../src/vector/sql-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAS9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AA+WnD,UAAU,YAAY;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,EAAE,CAAC;CACnB;AA6BD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CAkBzE"}
1
+ {"version":3,"file":"sql-builder.d.ts","sourceRoot":"","sources":["../../src/vector/sql-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAS9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAmXnD,UAAU,YAAY;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,EAAE,CAAC;CACnB;AA6BD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CAkBzE"}
@@ -0,0 +1,7 @@
1
+ export declare function getLocalFileDatabaseKey({ url, syncUrl, cwd, }: {
2
+ url: string;
3
+ syncUrl?: string;
4
+ cwd: string;
5
+ }): Promise<string | undefined>;
6
+ export declare function withLocalFileDatabaseWriteLock<T>(key: string | undefined, fn: () => Promise<T>): Promise<T>;
7
+ //# sourceMappingURL=write-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-lock.d.ts","sourceRoot":"","sources":["../../src/vector/write-lock.ts"],"names":[],"mappings":"AAKA,wBAAsB,uBAAuB,CAAC,EAC5C,GAAG,EACH,OAAO,EACP,GAAG,GACJ,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAkB9B;AAED,wBAAgB,8BAA8B,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAoB3G"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/libsql",
3
- "version": "0.0.0-working-memory-undefined-20260212204651",
3
+ "version": "0.0.0-workshop-yj-20260903030708",
4
4
  "description": "Libsql provider for Mastra - includes both vector and db storage capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,27 +20,27 @@
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@libsql/client": "^0.15.15"
23
+ "@libsql/client": "^0.17.4"
24
24
  },
25
25
  "devDependencies": {
26
- "@types/node": "22.19.7",
27
- "@vitest/coverage-v8": "4.0.12",
28
- "@vitest/ui": "4.0.12",
29
- "eslint": "^9.37.0",
30
- "tsup": "^8.5.1",
31
- "typescript": "^5.9.3",
32
- "vitest": "4.0.16",
33
- "@internal/lint": "0.0.0-working-memory-undefined-20260212204651",
34
- "@internal/storage-test-utils": "0.0.54",
35
- "@internal/types-builder": "0.0.0-working-memory-undefined-20260212204651",
36
- "@mastra/core": "0.0.0-working-memory-undefined-20260212204651"
26
+ "@types/node": "22.20.1",
27
+ "@vitest/coverage-v8": "4.1.10",
28
+ "@vitest/ui": "4.1.10",
29
+ "eslint": "^10.7.0",
30
+ "tsdown": "0.22.9",
31
+ "tsx": "^4.23.1",
32
+ "typescript": "^7.0.2",
33
+ "vitest": "4.1.10",
34
+ "@internal/types-builder": "0.0.0-workshop-yj-20260903030708",
35
+ "@internal/lint": "0.0.0-workshop-yj-20260903030708",
36
+ "@internal/storage-test-utils": "0.0.125",
37
+ "@mastra/core": "0.0.0-workshop-yj-20260903030708"
37
38
  },
38
39
  "peerDependencies": {
39
- "@mastra/core": "0.0.0-working-memory-undefined-20260212204651"
40
+ "@mastra/core": "0.0.0-workshop-yj-20260903030708"
40
41
  },
41
42
  "files": [
42
- "dist",
43
- "CHANGELOG.md"
43
+ "dist"
44
44
  ],
45
45
  "homepage": "https://mastra.ai",
46
46
  "repository": {
@@ -55,9 +55,10 @@
55
55
  "node": ">=22.13.0"
56
56
  },
57
57
  "scripts": {
58
- "build:lib": "tsup --silent --config tsup.config.ts",
59
- "build:watch": "tsup --watch --silent --config tsup.config.ts",
58
+ "build:lib": "tsdown --silent --config tsdown.config.ts",
59
+ "build:watch": "tsdown --watch --silent --config tsdown.config.ts",
60
60
  "test": "vitest run",
61
- "lint": "eslint ."
61
+ "lint": "oxlint . && eslint .",
62
+ "lint:fix": "oxlint --fix . && eslint --fix ."
62
63
  }
63
64
  }