@mastra/lance 0.1.1-alpha.0 → 0.1.1-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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/lance@0.1.1-alpha.0 build /home/runner/work/mastra/mastra/stores/lance
2
+ > @mastra/lance@0.1.1-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
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.5.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 11991ms
9
+ TSC ⚡️ Build success in 10013ms
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/lance/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/lance/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 13115ms
16
+ DTS ⚡️ Build success in 13065ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- ESM dist/index.js 52.70 KB
21
- ESM ⚡️ Build success in 1414ms
22
- CJS dist/index.cjs 52.99 KB
23
- CJS ⚡️ Build success in 1414ms
20
+ CJS dist/index.cjs 53.26 KB
21
+ CJS ⚡️ Build success in 1554ms
22
+ ESM dist/index.js 52.97 KB
23
+ ESM ⚡️ Build success in 1554ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @mastra/lance
2
2
 
3
+ ## 0.1.1-alpha.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 66f4424: Update peerdeps
8
+
9
+ ## 0.1.1-alpha.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 925ab94: added paginated functions to base class and added boilerplate and updated imports
14
+ - Updated dependencies [925ab94]
15
+ - @mastra/core@0.10.4-alpha.3
16
+
3
17
  ## 0.1.1-alpha.0
4
18
 
5
19
  ### Patch Changes
@@ -7,30 +7,33 @@ import type { CreateTableOptions } from '@lancedb/lancedb';
7
7
  import type { DeleteIndexParams } from '@mastra/core';
8
8
  import type { DeleteVectorParams } from '@mastra/core';
9
9
  import type { DescribeIndexParams } from '@mastra/core';
10
- import type { EvalRow } from '@mastra/core';
10
+ import type { EvalRow } from '@mastra/core/storage';
11
11
  import type { IndexStats } from '@mastra/core';
12
12
  import { LogicalOperator } from '@mastra/core/vector/filter';
13
- import type { MastraMessageV1 } from '@mastra/core';
14
- import type { MastraMessageV2 } from '@mastra/core';
13
+ import type { MastraMessageV1 } from '@mastra/core/memory';
14
+ import type { MastraMessageV2 } from '@mastra/core/memory';
15
15
  import { MastraStorage } from '@mastra/core/storage';
16
16
  import { MastraVector } from '@mastra/core/vector';
17
17
  import { NumericOperator } from '@mastra/core/vector/filter';
18
+ import type { PaginationInfo } from '@mastra/core/storage';
18
19
  import type { QueryResult } from '@mastra/core';
19
20
  import type { QueryVectorParams } from '@mastra/core';
20
21
  import { RegexOperator } from '@mastra/core/vector/filter';
21
22
  import type { SchemaLike } from '@lancedb/lancedb';
22
- import type { StorageColumn } from '@mastra/core';
23
- import type { StorageGetMessagesArg } from '@mastra/core';
24
- import type { StorageThreadType } from '@mastra/core';
23
+ import type { StorageColumn } from '@mastra/core/storage';
24
+ import type { StorageGetMessagesArg } from '@mastra/core/storage';
25
+ import type { StorageGetTracesArg } from '@mastra/core/storage';
26
+ import type { StorageThreadType } from '@mastra/core/memory';
25
27
  import type { Table } from '@lancedb/lancedb';
26
28
  import type { TABLE_NAMES } from '@mastra/core/storage';
27
29
  import type { TableLike } from '@lancedb/lancedb';
28
- import type { TraceType } from '@mastra/core';
30
+ import type { Trace } from '@mastra/core/telemetry';
31
+ import type { TraceType } from '@mastra/core/memory';
29
32
  import type { UpdateVectorParams } from '@mastra/core';
30
33
  import type { UpsertVectorParams } from '@mastra/core';
31
34
  import type { VectorFilter } from '@mastra/core/vector/filter';
32
- import type { WorkflowRuns } from '@mastra/core';
33
- import type { WorkflowRunState } from '@mastra/core';
35
+ import type { WorkflowRuns } from '@mastra/core/storage';
36
+ import type { WorkflowRunState } from '@mastra/core/workflows';
34
37
 
35
38
  declare interface HNSWConfig {
36
39
  m?: number;
@@ -293,6 +296,19 @@ declare class LanceStorage extends MastraStorage {
293
296
  workflowName: string;
294
297
  runId: string;
295
298
  }): Promise<WorkflowRunState | null>;
299
+ getTracesPaginated(_args: StorageGetTracesArg): Promise<PaginationInfo & {
300
+ traces: Trace[];
301
+ }>;
302
+ getThreadsByResourceIdPaginated(_args: {
303
+ resourceId: string;
304
+ page?: number;
305
+ perPage?: number;
306
+ }): Promise<PaginationInfo & {
307
+ threads: StorageThreadType[];
308
+ }>;
309
+ getMessagesPaginated(_args: StorageGetMessagesArg): Promise<PaginationInfo & {
310
+ messages: MastraMessageV1[] | MastraMessageV2[];
311
+ }>;
296
312
  }
297
313
  export { LanceStorage }
298
314
  export { LanceStorage as LanceStorage_alias_1 }
@@ -7,30 +7,33 @@ import type { CreateTableOptions } from '@lancedb/lancedb';
7
7
  import type { DeleteIndexParams } from '@mastra/core';
8
8
  import type { DeleteVectorParams } from '@mastra/core';
9
9
  import type { DescribeIndexParams } from '@mastra/core';
10
- import type { EvalRow } from '@mastra/core';
10
+ import type { EvalRow } from '@mastra/core/storage';
11
11
  import type { IndexStats } from '@mastra/core';
12
12
  import { LogicalOperator } from '@mastra/core/vector/filter';
13
- import type { MastraMessageV1 } from '@mastra/core';
14
- import type { MastraMessageV2 } from '@mastra/core';
13
+ import type { MastraMessageV1 } from '@mastra/core/memory';
14
+ import type { MastraMessageV2 } from '@mastra/core/memory';
15
15
  import { MastraStorage } from '@mastra/core/storage';
16
16
  import { MastraVector } from '@mastra/core/vector';
17
17
  import { NumericOperator } from '@mastra/core/vector/filter';
18
+ import type { PaginationInfo } from '@mastra/core/storage';
18
19
  import type { QueryResult } from '@mastra/core';
19
20
  import type { QueryVectorParams } from '@mastra/core';
20
21
  import { RegexOperator } from '@mastra/core/vector/filter';
21
22
  import type { SchemaLike } from '@lancedb/lancedb';
22
- import type { StorageColumn } from '@mastra/core';
23
- import type { StorageGetMessagesArg } from '@mastra/core';
24
- import type { StorageThreadType } from '@mastra/core';
23
+ import type { StorageColumn } from '@mastra/core/storage';
24
+ import type { StorageGetMessagesArg } from '@mastra/core/storage';
25
+ import type { StorageGetTracesArg } from '@mastra/core/storage';
26
+ import type { StorageThreadType } from '@mastra/core/memory';
25
27
  import type { Table } from '@lancedb/lancedb';
26
28
  import type { TABLE_NAMES } from '@mastra/core/storage';
27
29
  import type { TableLike } from '@lancedb/lancedb';
28
- import type { TraceType } from '@mastra/core';
30
+ import type { Trace } from '@mastra/core/telemetry';
31
+ import type { TraceType } from '@mastra/core/memory';
29
32
  import type { UpdateVectorParams } from '@mastra/core';
30
33
  import type { UpsertVectorParams } from '@mastra/core';
31
34
  import type { VectorFilter } from '@mastra/core/vector/filter';
32
- import type { WorkflowRuns } from '@mastra/core';
33
- import type { WorkflowRunState } from '@mastra/core';
35
+ import type { WorkflowRuns } from '@mastra/core/storage';
36
+ import type { WorkflowRunState } from '@mastra/core/workflows';
34
37
 
35
38
  declare interface HNSWConfig {
36
39
  m?: number;
@@ -293,6 +296,19 @@ declare class LanceStorage extends MastraStorage {
293
296
  workflowName: string;
294
297
  runId: string;
295
298
  }): Promise<WorkflowRunState | null>;
299
+ getTracesPaginated(_args: StorageGetTracesArg): Promise<PaginationInfo & {
300
+ traces: Trace[];
301
+ }>;
302
+ getThreadsByResourceIdPaginated(_args: {
303
+ resourceId: string;
304
+ page?: number;
305
+ perPage?: number;
306
+ }): Promise<PaginationInfo & {
307
+ threads: StorageThreadType[];
308
+ }>;
309
+ getMessagesPaginated(_args: StorageGetMessagesArg): Promise<PaginationInfo & {
310
+ messages: MastraMessageV1[] | MastraMessageV2[];
311
+ }>;
296
312
  }
297
313
  export { LanceStorage }
298
314
  export { LanceStorage as LanceStorage_alias_1 }
package/dist/index.cjs CHANGED
@@ -744,6 +744,15 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
744
744
  throw new Error(`Failed to load workflow snapshot: ${error}`);
745
745
  }
746
746
  }
747
+ async getTracesPaginated(_args) {
748
+ throw new Error("Method not implemented.");
749
+ }
750
+ async getThreadsByResourceIdPaginated(_args) {
751
+ throw new Error("Method not implemented.");
752
+ }
753
+ async getMessagesPaginated(_args) {
754
+ throw new Error("Method not implemented.");
755
+ }
747
756
  };
748
757
  var LanceFilterTranslator = class extends filter.BaseFilterTranslator {
749
758
  translate(filter) {
package/dist/index.js CHANGED
@@ -742,6 +742,15 @@ var LanceStorage = class _LanceStorage extends MastraStorage {
742
742
  throw new Error(`Failed to load workflow snapshot: ${error}`);
743
743
  }
744
744
  }
745
+ async getTracesPaginated(_args) {
746
+ throw new Error("Method not implemented.");
747
+ }
748
+ async getThreadsByResourceIdPaginated(_args) {
749
+ throw new Error("Method not implemented.");
750
+ }
751
+ async getMessagesPaginated(_args) {
752
+ throw new Error("Method not implemented.");
753
+ }
745
754
  };
746
755
  var LanceFilterTranslator = class extends BaseFilterTranslator {
747
756
  translate(filter) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/lance",
3
- "version": "0.1.1-alpha.0",
3
+ "version": "0.1.1-alpha.2",
4
4
  "description": "Lance provider for Mastra - includes both vector and db storage capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -30,10 +30,11 @@
30
30
  "typescript": "^5.8.2",
31
31
  "vitest": "^3.2.2",
32
32
  "@internal/lint": "0.0.10",
33
- "@mastra/core": "^0.10.4-alpha.1"
33
+ "@internal/storage-test-utils": "0.0.6",
34
+ "@mastra/core": "^0.10.4-alpha.3"
34
35
  },
35
36
  "peerDependencies": {
36
- "@mastra/core": "^0.10.2-alpha.0"
37
+ "@mastra/core": ">=0.10.4-0 <0.11.0"
37
38
  },
38
39
  "scripts": {
39
40
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
@@ -1,4 +1,5 @@
1
1
  import { randomUUID } from 'crypto';
2
+ import { checkWorkflowSnapshot } from '@internal/storage-test-utils';
2
3
  import type { EvalRow, MastraMessageV2, StorageThreadType, TraceType, WorkflowRunState } from '@mastra/core';
3
4
  import {
4
5
  TABLE_EVALS,
@@ -116,13 +117,6 @@ const generateWorkflowSnapshot = (status: WorkflowRunState['context']['steps']['
116
117
  return { snapshot, runId, stepId };
117
118
  };
118
119
 
119
- const checkWorkflowSnapshot = (snapshot: WorkflowRunState | string, stepId: string, status: string) => {
120
- if (typeof snapshot === 'string') {
121
- throw new Error('Expected WorkflowRunState, got string');
122
- }
123
- expect(snapshot.context?.[stepId]?.status).toBe(status);
124
- };
125
-
126
120
  describe('LanceStorage tests', async () => {
127
121
  let storage!: LanceStorage;
128
122
 
@@ -1,18 +1,7 @@
1
1
  import { connect } from '@lancedb/lancedb';
2
2
  import type { Connection, ConnectionOptions, SchemaLike, FieldLike } from '@lancedb/lancedb';
3
- import type {
4
- EvalRow,
5
- MastraMessageV1,
6
- MastraMessageV2,
7
- StorageColumn,
8
- StorageGetMessagesArg,
9
- StorageThreadType,
10
- TraceType,
11
- WorkflowRun,
12
- WorkflowRuns,
13
- WorkflowRunState,
14
- } from '@mastra/core';
15
3
  import { MessageList } from '@mastra/core/agent';
4
+ import type { MastraMessageV1, MastraMessageV2, StorageThreadType, TraceType } from '@mastra/core/memory';
16
5
  import {
17
6
  MastraStorage,
18
7
  TABLE_EVALS,
@@ -21,7 +10,18 @@ import {
21
10
  TABLE_TRACES,
22
11
  TABLE_WORKFLOW_SNAPSHOT,
23
12
  } from '@mastra/core/storage';
24
- import type { TABLE_NAMES } from '@mastra/core/storage';
13
+ import type {
14
+ TABLE_NAMES,
15
+ PaginationInfo,
16
+ StorageGetMessagesArg,
17
+ StorageGetTracesArg,
18
+ StorageColumn,
19
+ EvalRow,
20
+ WorkflowRun,
21
+ WorkflowRuns,
22
+ } from '@mastra/core/storage';
23
+ import type { Trace } from '@mastra/core/telemetry';
24
+ import type { WorkflowRunState } from '@mastra/core/workflows';
25
25
  import type { DataType } from 'apache-arrow';
26
26
  import { Utf8, Int32, Float32, Binary, Schema, Field, Float64 } from 'apache-arrow';
27
27
 
@@ -996,4 +996,22 @@ export class LanceStorage extends MastraStorage {
996
996
  throw new Error(`Failed to load workflow snapshot: ${error}`);
997
997
  }
998
998
  }
999
+
1000
+ async getTracesPaginated(_args: StorageGetTracesArg): Promise<PaginationInfo & { traces: Trace[] }> {
1001
+ throw new Error('Method not implemented.');
1002
+ }
1003
+
1004
+ async getThreadsByResourceIdPaginated(_args: {
1005
+ resourceId: string;
1006
+ page?: number;
1007
+ perPage?: number;
1008
+ }): Promise<PaginationInfo & { threads: StorageThreadType[] }> {
1009
+ throw new Error('Method not implemented.');
1010
+ }
1011
+
1012
+ async getMessagesPaginated(
1013
+ _args: StorageGetMessagesArg,
1014
+ ): Promise<PaginationInfo & { messages: MastraMessageV1[] | MastraMessageV2[] }> {
1015
+ throw new Error('Method not implemented.');
1016
+ }
999
1017
  }