@mastra/lance 0.1.3-alpha.0 → 0.1.3-alpha.2
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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +26 -0
- package/dist/_tsup-dts-rollup.d.cts +18 -4
- package/dist/_tsup-dts-rollup.d.ts +18 -4
- package/dist/index.cjs +802 -160
- package/dist/index.js +769 -127
- package/package.json +5 -5
- package/src/storage/index.test.ts +72 -2
- package/src/storage/index.ts +486 -68
- package/src/vector/filter.test.ts +3 -3
- package/src/vector/filter.ts +24 -4
- package/src/vector/index.test.ts +3 -3
- package/src/vector/index.ts +320 -79
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/lance@0.1.3-alpha.
|
|
2
|
+
> @mastra/lance@0.1.3-alpha.2 build /home/runner/work/mastra/mastra/stores/lance
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.5.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 10342ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/lance/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
14
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
15
15
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/lance/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 13286ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
20
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m72.48 KB[39m
|
|
21
|
+
[32mCJS[39m ⚡️ Build success in 1677ms
|
|
22
|
+
[32mESM[39m [1mdist/index.js [22m[32m70.94 KB[39m
|
|
23
|
+
[32mESM[39m ⚡️ Build success in 1693ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @mastra/lance
|
|
2
2
|
|
|
3
|
+
## 0.1.3-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0fb9d64: [MASTRA-4018] Update saveMessages in storage adapters to upsert messages
|
|
8
|
+
- 144eb0b: [MASTRA-3669] Metadata Filter Types
|
|
9
|
+
- Updated dependencies [15e9d26]
|
|
10
|
+
- Updated dependencies [07d6d88]
|
|
11
|
+
- Updated dependencies [5d74aab]
|
|
12
|
+
- Updated dependencies [144eb0b]
|
|
13
|
+
- @mastra/core@0.10.7-alpha.2
|
|
14
|
+
|
|
15
|
+
## 0.1.3-alpha.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 2097952: [MASTRA-4021] Fix PG getMessages and update messageLimit for all storage adapters
|
|
20
|
+
- 0e17048: Throw mastra errors in storage packages
|
|
21
|
+
- Updated dependencies [d1baedb]
|
|
22
|
+
- Updated dependencies [4d21bf2]
|
|
23
|
+
- Updated dependencies [2097952]
|
|
24
|
+
- Updated dependencies [4fb0cc2]
|
|
25
|
+
- Updated dependencies [d2a7a31]
|
|
26
|
+
- Updated dependencies [0e17048]
|
|
27
|
+
- @mastra/core@0.10.7-alpha.1
|
|
28
|
+
|
|
3
29
|
## 0.1.3-alpha.0
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ArrayOperator } from '@mastra/core/vector/filter';
|
|
2
2
|
import { BaseFilterTranslator } from '@mastra/core/vector/filter';
|
|
3
3
|
import { BasicOperator } from '@mastra/core/vector/filter';
|
|
4
|
+
import type { BlacklistedRootOperators } from '@mastra/core/vector/filter';
|
|
4
5
|
import type { ConnectionOptions } from '@lancedb/lancedb';
|
|
5
6
|
import type { CreateIndexParams } from '@mastra/core';
|
|
6
7
|
import type { CreateTableOptions } from '@lancedb/lancedb';
|
|
@@ -10,12 +11,14 @@ import type { DescribeIndexParams } from '@mastra/core';
|
|
|
10
11
|
import type { EvalRow } from '@mastra/core/storage';
|
|
11
12
|
import type { IndexStats } from '@mastra/core';
|
|
12
13
|
import { LogicalOperator } from '@mastra/core/vector/filter';
|
|
14
|
+
import type { LogicalOperatorValueMap } from '@mastra/core/vector/filter';
|
|
13
15
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
14
16
|
import type { MastraMessageV1 } from '@mastra/core/memory';
|
|
15
17
|
import type { MastraMessageV2 } from '@mastra/core/memory';
|
|
16
18
|
import { MastraStorage } from '@mastra/core/storage';
|
|
17
19
|
import { MastraVector } from '@mastra/core/vector';
|
|
18
20
|
import { NumericOperator } from '@mastra/core/vector/filter';
|
|
21
|
+
import type { OperatorValueMap } from '@mastra/core/vector/filter';
|
|
19
22
|
import type { PaginationInfo } from '@mastra/core/storage';
|
|
20
23
|
import type { QueryResult } from '@mastra/core';
|
|
21
24
|
import type { QueryVectorParams } from '@mastra/core';
|
|
@@ -53,13 +56,15 @@ declare interface IVFConfig {
|
|
|
53
56
|
lists?: number;
|
|
54
57
|
}
|
|
55
58
|
|
|
59
|
+
declare type LanceBlacklisted = BlacklistedRootOperators | '$like' | '$notLike' | '$contains';
|
|
60
|
+
|
|
56
61
|
declare interface LanceCreateIndexParams extends CreateIndexParams {
|
|
57
62
|
indexConfig?: LanceIndexConfig;
|
|
58
63
|
tableName?: string;
|
|
59
64
|
}
|
|
60
65
|
|
|
61
|
-
export declare class LanceFilterTranslator extends BaseFilterTranslator {
|
|
62
|
-
translate(filter:
|
|
66
|
+
export declare class LanceFilterTranslator extends BaseFilterTranslator<LanceVectorFilter, string> {
|
|
67
|
+
translate(filter: LanceVectorFilter): string;
|
|
63
68
|
private processFilter;
|
|
64
69
|
private processLogicalOperator;
|
|
65
70
|
private processNestedObject;
|
|
@@ -94,7 +99,13 @@ declare interface LanceIndexConfig extends IndexConfig {
|
|
|
94
99
|
numSubVectors?: number;
|
|
95
100
|
}
|
|
96
101
|
|
|
97
|
-
declare
|
|
102
|
+
declare type LanceOperatorValueMap = OperatorValueMap & {
|
|
103
|
+
$like: string;
|
|
104
|
+
$notLike: string;
|
|
105
|
+
$contains: string;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
declare interface LanceQueryVectorParams extends QueryVectorParams<LanceVectorFilter> {
|
|
98
109
|
tableName: string;
|
|
99
110
|
columns?: string[];
|
|
100
111
|
includeAllColumns?: boolean;
|
|
@@ -125,6 +136,7 @@ declare class LanceStorage extends MastraStorage {
|
|
|
125
136
|
* ```
|
|
126
137
|
*/
|
|
127
138
|
static create(name: string, uri: string, options?: ConnectionOptions): Promise<LanceStorage>;
|
|
139
|
+
private getPrimaryKeys;
|
|
128
140
|
/**
|
|
129
141
|
* @internal
|
|
130
142
|
* Private constructor to enforce using the create factory method
|
|
@@ -327,7 +339,9 @@ declare interface LanceUpsertVectorParams extends UpsertVectorParams {
|
|
|
327
339
|
tableName: string;
|
|
328
340
|
}
|
|
329
341
|
|
|
330
|
-
declare
|
|
342
|
+
export declare type LanceVectorFilter = VectorFilter<keyof LanceOperatorValueMap, LanceOperatorValueMap, LogicalOperatorValueMap, LanceBlacklisted>;
|
|
343
|
+
|
|
344
|
+
declare class LanceVectorStore extends MastraVector<LanceVectorFilter> {
|
|
331
345
|
private lanceClient;
|
|
332
346
|
/**
|
|
333
347
|
* Creates a new instance of LanceVectorStore
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ArrayOperator } from '@mastra/core/vector/filter';
|
|
2
2
|
import { BaseFilterTranslator } from '@mastra/core/vector/filter';
|
|
3
3
|
import { BasicOperator } from '@mastra/core/vector/filter';
|
|
4
|
+
import type { BlacklistedRootOperators } from '@mastra/core/vector/filter';
|
|
4
5
|
import type { ConnectionOptions } from '@lancedb/lancedb';
|
|
5
6
|
import type { CreateIndexParams } from '@mastra/core';
|
|
6
7
|
import type { CreateTableOptions } from '@lancedb/lancedb';
|
|
@@ -10,12 +11,14 @@ import type { DescribeIndexParams } from '@mastra/core';
|
|
|
10
11
|
import type { EvalRow } from '@mastra/core/storage';
|
|
11
12
|
import type { IndexStats } from '@mastra/core';
|
|
12
13
|
import { LogicalOperator } from '@mastra/core/vector/filter';
|
|
14
|
+
import type { LogicalOperatorValueMap } from '@mastra/core/vector/filter';
|
|
13
15
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
14
16
|
import type { MastraMessageV1 } from '@mastra/core/memory';
|
|
15
17
|
import type { MastraMessageV2 } from '@mastra/core/memory';
|
|
16
18
|
import { MastraStorage } from '@mastra/core/storage';
|
|
17
19
|
import { MastraVector } from '@mastra/core/vector';
|
|
18
20
|
import { NumericOperator } from '@mastra/core/vector/filter';
|
|
21
|
+
import type { OperatorValueMap } from '@mastra/core/vector/filter';
|
|
19
22
|
import type { PaginationInfo } from '@mastra/core/storage';
|
|
20
23
|
import type { QueryResult } from '@mastra/core';
|
|
21
24
|
import type { QueryVectorParams } from '@mastra/core';
|
|
@@ -53,13 +56,15 @@ declare interface IVFConfig {
|
|
|
53
56
|
lists?: number;
|
|
54
57
|
}
|
|
55
58
|
|
|
59
|
+
declare type LanceBlacklisted = BlacklistedRootOperators | '$like' | '$notLike' | '$contains';
|
|
60
|
+
|
|
56
61
|
declare interface LanceCreateIndexParams extends CreateIndexParams {
|
|
57
62
|
indexConfig?: LanceIndexConfig;
|
|
58
63
|
tableName?: string;
|
|
59
64
|
}
|
|
60
65
|
|
|
61
|
-
export declare class LanceFilterTranslator extends BaseFilterTranslator {
|
|
62
|
-
translate(filter:
|
|
66
|
+
export declare class LanceFilterTranslator extends BaseFilterTranslator<LanceVectorFilter, string> {
|
|
67
|
+
translate(filter: LanceVectorFilter): string;
|
|
63
68
|
private processFilter;
|
|
64
69
|
private processLogicalOperator;
|
|
65
70
|
private processNestedObject;
|
|
@@ -94,7 +99,13 @@ declare interface LanceIndexConfig extends IndexConfig {
|
|
|
94
99
|
numSubVectors?: number;
|
|
95
100
|
}
|
|
96
101
|
|
|
97
|
-
declare
|
|
102
|
+
declare type LanceOperatorValueMap = OperatorValueMap & {
|
|
103
|
+
$like: string;
|
|
104
|
+
$notLike: string;
|
|
105
|
+
$contains: string;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
declare interface LanceQueryVectorParams extends QueryVectorParams<LanceVectorFilter> {
|
|
98
109
|
tableName: string;
|
|
99
110
|
columns?: string[];
|
|
100
111
|
includeAllColumns?: boolean;
|
|
@@ -125,6 +136,7 @@ declare class LanceStorage extends MastraStorage {
|
|
|
125
136
|
* ```
|
|
126
137
|
*/
|
|
127
138
|
static create(name: string, uri: string, options?: ConnectionOptions): Promise<LanceStorage>;
|
|
139
|
+
private getPrimaryKeys;
|
|
128
140
|
/**
|
|
129
141
|
* @internal
|
|
130
142
|
* Private constructor to enforce using the create factory method
|
|
@@ -327,7 +339,9 @@ declare interface LanceUpsertVectorParams extends UpsertVectorParams {
|
|
|
327
339
|
tableName: string;
|
|
328
340
|
}
|
|
329
341
|
|
|
330
|
-
declare
|
|
342
|
+
export declare type LanceVectorFilter = VectorFilter<keyof LanceOperatorValueMap, LanceOperatorValueMap, LogicalOperatorValueMap, LanceBlacklisted>;
|
|
343
|
+
|
|
344
|
+
declare class LanceVectorStore extends MastraVector<LanceVectorFilter> {
|
|
331
345
|
private lanceClient;
|
|
332
346
|
/**
|
|
333
347
|
* Creates a new instance of LanceVectorStore
|