@mastra/libsql 0.0.4-alpha.4 → 0.0.5-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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/libsql@0.0.4-alpha.4 build /home/runner/work/mastra/mastra/stores/libsql
2
+ > @mastra/libsql@0.0.5-alpha.0 build /home/runner/work/mastra/mastra/stores/libsql
3
3
  > tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
4
4
 
5
5
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.4.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 7143ms
9
+ TSC ⚡️ Build success in 8603ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.3
13
13
  Writing package typings: /home/runner/work/mastra/mastra/stores/libsql/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.3
15
15
  Writing package typings: /home/runner/work/mastra/mastra/stores/libsql/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 7325ms
16
+ DTS ⚡️ Build success in 8936ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- ESM dist/index.js 43.50 KB
21
- ESM ⚡️ Build success in 891ms
22
- CJS dist/index.cjs 43.63 KB
23
- CJS ⚡️ Build success in 891ms
20
+ CJS dist/index.cjs 47.82 KB
21
+ CJS ⚡️ Build success in 807ms
22
+ ESM dist/index.js 47.62 KB
23
+ ESM ⚡️ Build success in 808ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @mastra/libsql
2
2
 
3
+ ## 0.0.5-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - eabdcd9: [MASTRA-3451] SQL Injection Protection
8
+ - d0ee3c6: Change all public functions and constructors in vector stores to use named args and prepare to phase out positional args
9
+ - Updated dependencies [f53a6ac]
10
+ - Updated dependencies [eabdcd9]
11
+ - Updated dependencies [90be034]
12
+ - Updated dependencies [99f050a]
13
+ - Updated dependencies [d0ee3c6]
14
+ - Updated dependencies [23f258c]
15
+ - Updated dependencies [2672a05]
16
+ - @mastra/core@0.9.5-alpha.0
17
+
18
+ ## 0.0.4
19
+
20
+ ### Patch Changes
21
+
22
+ - c3bd795: [MASTRA-3358] Deprecate updateIndexById and deleteIndexById
23
+ - Updated dependencies [396be50]
24
+ - Updated dependencies [ab80e7e]
25
+ - Updated dependencies [c3bd795]
26
+ - Updated dependencies [da082f8]
27
+ - Updated dependencies [a5810ce]
28
+ - Updated dependencies [3e9c131]
29
+ - Updated dependencies [3171b5b]
30
+ - Updated dependencies [973e5ac]
31
+ - Updated dependencies [daf942f]
32
+ - Updated dependencies [0b8b868]
33
+ - Updated dependencies [9e1eff5]
34
+ - Updated dependencies [6fa1ad1]
35
+ - Updated dependencies [c28d7a0]
36
+ - Updated dependencies [edf1e88]
37
+ - @mastra/core@0.9.4
38
+
3
39
  ## 0.0.4-alpha.4
4
40
 
5
41
  ### Patch Changes
@@ -1,26 +1,24 @@
1
- import type { ArrayOperator } from '@mastra/core/vector/filter';
2
1
  import { BaseFilterTranslator } from '@mastra/core/vector/filter';
3
- import type { BasicOperator } from '@mastra/core/vector/filter';
4
2
  import type { CreateIndexParams } from '@mastra/core/vector';
5
- import type { ElementOperator } from '@mastra/core/vector/filter';
3
+ import type { DeleteIndexParams } from '@mastra/core/vector';
4
+ import type { DeleteVectorParams } from '@mastra/core/vector';
5
+ import type { DescribeIndexParams } from '@mastra/core/vector';
6
6
  import type { EvalRow } from '@mastra/core/storage';
7
7
  import type { IndexStats } from '@mastra/core/vector';
8
8
  import type { InValue } from '@libsql/client';
9
- import type { LogicalOperator } from '@mastra/core/vector/filter';
10
9
  import { MastraStorage } from '@mastra/core/storage';
11
10
  import { MastraVector } from '@mastra/core/vector';
12
11
  import type { MessageType } from '@mastra/core/memory';
13
- import type { NumericOperator } from '@mastra/core/vector/filter';
14
12
  import type { OperatorSupport } from '@mastra/core/vector/filter';
15
13
  import type { ParamsToArgs } from '@mastra/core/vector';
16
14
  import type { QueryResult } from '@mastra/core/vector';
17
15
  import type { QueryVectorArgs } from '@mastra/core/vector';
18
16
  import type { QueryVectorParams } from '@mastra/core/vector';
19
- import type { RegexOperator } from '@mastra/core/vector/filter';
20
17
  import type { StorageColumn } from '@mastra/core/storage';
21
18
  import type { StorageGetMessagesArg } from '@mastra/core/storage';
22
19
  import type { StorageThreadType } from '@mastra/core/memory';
23
20
  import type { TABLE_NAMES } from '@mastra/core/storage';
21
+ import type { UpdateVectorParams } from '@mastra/core/vector';
24
22
  import type { UpsertVectorParams } from '@mastra/core/vector';
25
23
  import type { VectorFilter } from '@mastra/core/vector/filter';
26
24
  import type { WorkflowRun } from '@mastra/core/storage';
@@ -28,21 +26,11 @@ import type { WorkflowRuns } from '@mastra/core/storage';
28
26
 
29
27
  export declare function buildFilterQuery(filter: VectorFilter): FilterResult;
30
28
 
31
- export declare const FILTER_OPERATORS: Record<string, OperatorFn>;
32
-
33
- declare type FilterOperator = {
34
- sql: string;
35
- needsValue: boolean;
36
- transformValue?: (value: any) => any;
37
- };
38
-
39
- export declare interface FilterResult {
29
+ declare interface FilterResult {
40
30
  sql: string;
41
31
  values: InValue[];
42
32
  }
43
33
 
44
- export declare const handleKey: (key: string) => string;
45
-
46
34
  /**
47
35
  * Vector store specific prompt that details supported operators and examples.
48
36
  * This prompt helps users construct valid filters for LibSQL Vector.
@@ -170,9 +158,16 @@ declare class LibSQLVector extends MastraVector {
170
158
  query(...args: ParamsToArgs<LibSQLQueryParams> | LibSQLQueryArgs): Promise<QueryResult[]>;
171
159
  upsert(...args: ParamsToArgs<UpsertVectorParams>): Promise<string[]>;
172
160
  createIndex(...args: ParamsToArgs<CreateIndexParams>): Promise<void>;
173
- deleteIndex(indexName: string): Promise<void>;
161
+ deleteIndex(...args: ParamsToArgs<DeleteIndexParams>): Promise<void>;
174
162
  listIndexes(): Promise<string[]>;
175
- describeIndex(indexName: string): Promise<IndexStats>;
163
+ /**
164
+ * Retrieves statistics about a vector index.
165
+ *
166
+ * @param params - The parameters for describing an index
167
+ * @param params.indexName - The name of the index to describe
168
+ * @returns A promise that resolves to the index statistics including dimension, count and metric
169
+ */
170
+ describeIndex(...args: ParamsToArgs<DescribeIndexParams>): Promise<IndexStats>;
176
171
  /**
177
172
  * @deprecated Use {@link updateVector} instead. This method will be removed on May 20th, 2025.
178
173
  *
@@ -191,6 +186,7 @@ declare class LibSQLVector extends MastraVector {
191
186
  }): Promise<void>;
192
187
  /**
193
188
  * Updates a vector by its ID with the provided vector and/or metadata.
189
+ *
194
190
  * @param indexName - The name of the index containing the vector.
195
191
  * @param id - The ID of the vector to update.
196
192
  * @param update - An object containing the vector and/or metadata to update.
@@ -199,10 +195,7 @@ declare class LibSQLVector extends MastraVector {
199
195
  * @returns A promise that resolves when the update is complete.
200
196
  * @throws Will throw an error if no updates are provided or if the update operation fails.
201
197
  */
202
- updateVector(indexName: string, id: string, update: {
203
- vector?: number[];
204
- metadata?: Record<string, any>;
205
- }): Promise<void>;
198
+ updateVector(...args: ParamsToArgs<UpdateVectorParams>): Promise<void>;
206
199
  /**
207
200
  * @deprecated Use {@link deleteVector} instead. This method will be removed on May 20th, 2025.
208
201
  *
@@ -220,14 +213,10 @@ declare class LibSQLVector extends MastraVector {
220
213
  * @returns A promise that resolves when the deletion is complete.
221
214
  * @throws Will throw an error if the deletion operation fails.
222
215
  */
223
- deleteVector(indexName: string, id: string): Promise<void>;
224
- truncateIndex(indexName: string): Promise<void>;
216
+ deleteVector(...args: ParamsToArgs<DeleteVectorParams>): Promise<void>;
217
+ truncateIndex(...args: ParamsToArgs<DeleteIndexParams>): Promise<void>;
225
218
  }
226
219
  export { LibSQLVector }
227
220
  export { LibSQLVector as LibSQLVector_alias_1 }
228
221
 
229
- declare type OperatorFn = (key: string, value?: any) => FilterOperator;
230
-
231
- export declare type OperatorType = BasicOperator | NumericOperator | ArrayOperator | ElementOperator | LogicalOperator | '$contains' | Exclude<RegexOperator, '$options'>;
232
-
233
222
  export { }
@@ -1,26 +1,24 @@
1
- import type { ArrayOperator } from '@mastra/core/vector/filter';
2
1
  import { BaseFilterTranslator } from '@mastra/core/vector/filter';
3
- import type { BasicOperator } from '@mastra/core/vector/filter';
4
2
  import type { CreateIndexParams } from '@mastra/core/vector';
5
- import type { ElementOperator } from '@mastra/core/vector/filter';
3
+ import type { DeleteIndexParams } from '@mastra/core/vector';
4
+ import type { DeleteVectorParams } from '@mastra/core/vector';
5
+ import type { DescribeIndexParams } from '@mastra/core/vector';
6
6
  import type { EvalRow } from '@mastra/core/storage';
7
7
  import type { IndexStats } from '@mastra/core/vector';
8
8
  import type { InValue } from '@libsql/client';
9
- import type { LogicalOperator } from '@mastra/core/vector/filter';
10
9
  import { MastraStorage } from '@mastra/core/storage';
11
10
  import { MastraVector } from '@mastra/core/vector';
12
11
  import type { MessageType } from '@mastra/core/memory';
13
- import type { NumericOperator } from '@mastra/core/vector/filter';
14
12
  import type { OperatorSupport } from '@mastra/core/vector/filter';
15
13
  import type { ParamsToArgs } from '@mastra/core/vector';
16
14
  import type { QueryResult } from '@mastra/core/vector';
17
15
  import type { QueryVectorArgs } from '@mastra/core/vector';
18
16
  import type { QueryVectorParams } from '@mastra/core/vector';
19
- import type { RegexOperator } from '@mastra/core/vector/filter';
20
17
  import type { StorageColumn } from '@mastra/core/storage';
21
18
  import type { StorageGetMessagesArg } from '@mastra/core/storage';
22
19
  import type { StorageThreadType } from '@mastra/core/memory';
23
20
  import type { TABLE_NAMES } from '@mastra/core/storage';
21
+ import type { UpdateVectorParams } from '@mastra/core/vector';
24
22
  import type { UpsertVectorParams } from '@mastra/core/vector';
25
23
  import type { VectorFilter } from '@mastra/core/vector/filter';
26
24
  import type { WorkflowRun } from '@mastra/core/storage';
@@ -28,21 +26,11 @@ import type { WorkflowRuns } from '@mastra/core/storage';
28
26
 
29
27
  export declare function buildFilterQuery(filter: VectorFilter): FilterResult;
30
28
 
31
- export declare const FILTER_OPERATORS: Record<string, OperatorFn>;
32
-
33
- declare type FilterOperator = {
34
- sql: string;
35
- needsValue: boolean;
36
- transformValue?: (value: any) => any;
37
- };
38
-
39
- export declare interface FilterResult {
29
+ declare interface FilterResult {
40
30
  sql: string;
41
31
  values: InValue[];
42
32
  }
43
33
 
44
- export declare const handleKey: (key: string) => string;
45
-
46
34
  /**
47
35
  * Vector store specific prompt that details supported operators and examples.
48
36
  * This prompt helps users construct valid filters for LibSQL Vector.
@@ -170,9 +158,16 @@ declare class LibSQLVector extends MastraVector {
170
158
  query(...args: ParamsToArgs<LibSQLQueryParams> | LibSQLQueryArgs): Promise<QueryResult[]>;
171
159
  upsert(...args: ParamsToArgs<UpsertVectorParams>): Promise<string[]>;
172
160
  createIndex(...args: ParamsToArgs<CreateIndexParams>): Promise<void>;
173
- deleteIndex(indexName: string): Promise<void>;
161
+ deleteIndex(...args: ParamsToArgs<DeleteIndexParams>): Promise<void>;
174
162
  listIndexes(): Promise<string[]>;
175
- describeIndex(indexName: string): Promise<IndexStats>;
163
+ /**
164
+ * Retrieves statistics about a vector index.
165
+ *
166
+ * @param params - The parameters for describing an index
167
+ * @param params.indexName - The name of the index to describe
168
+ * @returns A promise that resolves to the index statistics including dimension, count and metric
169
+ */
170
+ describeIndex(...args: ParamsToArgs<DescribeIndexParams>): Promise<IndexStats>;
176
171
  /**
177
172
  * @deprecated Use {@link updateVector} instead. This method will be removed on May 20th, 2025.
178
173
  *
@@ -191,6 +186,7 @@ declare class LibSQLVector extends MastraVector {
191
186
  }): Promise<void>;
192
187
  /**
193
188
  * Updates a vector by its ID with the provided vector and/or metadata.
189
+ *
194
190
  * @param indexName - The name of the index containing the vector.
195
191
  * @param id - The ID of the vector to update.
196
192
  * @param update - An object containing the vector and/or metadata to update.
@@ -199,10 +195,7 @@ declare class LibSQLVector extends MastraVector {
199
195
  * @returns A promise that resolves when the update is complete.
200
196
  * @throws Will throw an error if no updates are provided or if the update operation fails.
201
197
  */
202
- updateVector(indexName: string, id: string, update: {
203
- vector?: number[];
204
- metadata?: Record<string, any>;
205
- }): Promise<void>;
198
+ updateVector(...args: ParamsToArgs<UpdateVectorParams>): Promise<void>;
206
199
  /**
207
200
  * @deprecated Use {@link deleteVector} instead. This method will be removed on May 20th, 2025.
208
201
  *
@@ -220,14 +213,10 @@ declare class LibSQLVector extends MastraVector {
220
213
  * @returns A promise that resolves when the deletion is complete.
221
214
  * @throws Will throw an error if the deletion operation fails.
222
215
  */
223
- deleteVector(indexName: string, id: string): Promise<void>;
224
- truncateIndex(indexName: string): Promise<void>;
216
+ deleteVector(...args: ParamsToArgs<DeleteVectorParams>): Promise<void>;
217
+ truncateIndex(...args: ParamsToArgs<DeleteIndexParams>): Promise<void>;
225
218
  }
226
219
  export { LibSQLVector }
227
220
  export { LibSQLVector as LibSQLVector_alias_1 }
228
221
 
229
- declare type OperatorFn = (key: string, value?: any) => FilterOperator;
230
-
231
- export declare type OperatorType = BasicOperator | NumericOperator | ArrayOperator | ElementOperator | LogicalOperator | '$contains' | Exclude<RegexOperator, '$options'>;
232
-
233
222
  export { }