@mastra/libsql 0.10.1-alpha.3 → 0.10.2-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.
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +44 -0
- package/dist/_tsup-dts-rollup.d.cts +41 -3
- package/dist/_tsup-dts-rollup.d.ts +41 -3
- package/dist/index.cjs +295 -128
- package/dist/index.js +295 -128
- package/package.json +10 -10
- package/src/storage/index.test.ts +353 -6
- package/src/storage/index.ts +371 -155
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/libsql@0.10.
|
|
2
|
+
> @mastra/libsql@0.10.2-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
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.
|
|
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 9535ms
|
|
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/libsql/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/libsql/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 9079ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
20
|
+
[32mESM[39m [1mdist/index.js [22m[32m55.48 KB[39m
|
|
21
|
+
[32mESM[39m ⚡️ Build success in 980ms
|
|
22
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m55.76 KB[39m
|
|
23
|
+
[32mCJS[39m ⚡️ Build success in 980ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# @mastra/libsql
|
|
2
2
|
|
|
3
|
+
## 0.10.2-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5d3dc1e: dependencies updates:
|
|
8
|
+
- Updated dependency [`@libsql/client@^0.15.8` ↗︎](https://www.npmjs.com/package/@libsql/client/v/0.15.8) (from `^0.15.4`, in `dependencies`)
|
|
9
|
+
- 14a2566: Add pagination to libsql storage APIs
|
|
10
|
+
- Updated dependencies [d1ed912]
|
|
11
|
+
- Updated dependencies [f1f1f1b]
|
|
12
|
+
- Updated dependencies [f9816ae]
|
|
13
|
+
- Updated dependencies [82090c1]
|
|
14
|
+
- Updated dependencies [1b443fd]
|
|
15
|
+
- Updated dependencies [ce97900]
|
|
16
|
+
- Updated dependencies [14a2566]
|
|
17
|
+
- @mastra/core@0.10.4-alpha.0
|
|
18
|
+
|
|
19
|
+
## 0.10.1
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- e5dc18d: Added a backwards compatible layer to begin storing/retrieving UIMessages in storage instead of CoreMessages
|
|
24
|
+
- a3f1b39: feat(libsql): update thread timestamp when saving messages
|
|
25
|
+
- 9e37877: Fixes SQLITE_BUSY error often seen when working locally on the playground
|
|
26
|
+
- c5bf1ce: Add backwards compat code for new MessageList in storage
|
|
27
|
+
- f0d559f: Fix peerdeps for alpha channel
|
|
28
|
+
- Updated dependencies [ee77e78]
|
|
29
|
+
- Updated dependencies [592a2db]
|
|
30
|
+
- Updated dependencies [e5dc18d]
|
|
31
|
+
- Updated dependencies [ab5adbe]
|
|
32
|
+
- Updated dependencies [1e8bb40]
|
|
33
|
+
- Updated dependencies [1b5fc55]
|
|
34
|
+
- Updated dependencies [195c428]
|
|
35
|
+
- Updated dependencies [f73e11b]
|
|
36
|
+
- Updated dependencies [37643b8]
|
|
37
|
+
- Updated dependencies [99fd6cf]
|
|
38
|
+
- Updated dependencies [c5bf1ce]
|
|
39
|
+
- Updated dependencies [add596e]
|
|
40
|
+
- Updated dependencies [8dc94d8]
|
|
41
|
+
- Updated dependencies [ecebbeb]
|
|
42
|
+
- Updated dependencies [79d5145]
|
|
43
|
+
- Updated dependencies [12b7002]
|
|
44
|
+
- Updated dependencies [2901125]
|
|
45
|
+
- @mastra/core@0.10.2
|
|
46
|
+
|
|
3
47
|
## 0.10.1-alpha.3
|
|
4
48
|
|
|
5
49
|
### Patch Changes
|
|
@@ -11,12 +11,15 @@ import type { MastraMessageV2 } from '@mastra/core/agent';
|
|
|
11
11
|
import { MastraStorage } from '@mastra/core/storage';
|
|
12
12
|
import { MastraVector } from '@mastra/core/vector';
|
|
13
13
|
import type { OperatorSupport } from '@mastra/core/vector/filter';
|
|
14
|
+
import type { PaginationArgs } from '@mastra/core/storage';
|
|
15
|
+
import type { PaginationInfo } from '@mastra/core/storage';
|
|
14
16
|
import type { QueryResult } from '@mastra/core/vector';
|
|
15
17
|
import type { QueryVectorParams } from '@mastra/core/vector';
|
|
16
18
|
import type { StorageColumn } from '@mastra/core/storage';
|
|
17
19
|
import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
18
20
|
import type { StorageThreadType } from '@mastra/core/memory';
|
|
19
21
|
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
22
|
+
import type { Trace } from '@mastra/core/telemetry';
|
|
20
23
|
import type { UpdateVectorParams } from '@mastra/core/vector';
|
|
21
24
|
import type { UpsertVectorParams } from '@mastra/core/vector';
|
|
22
25
|
import type { VectorFilter } from '@mastra/core/vector/filter';
|
|
@@ -108,9 +111,17 @@ declare class LibSQLStore extends MastraStorage {
|
|
|
108
111
|
getThreadById({ threadId }: {
|
|
109
112
|
threadId: string;
|
|
110
113
|
}): Promise<StorageThreadType | null>;
|
|
111
|
-
|
|
114
|
+
/**
|
|
115
|
+
* @deprecated use getThreadsByResourceIdPaginated instead for paginated results.
|
|
116
|
+
*/
|
|
117
|
+
getThreadsByResourceId(args: {
|
|
112
118
|
resourceId: string;
|
|
113
119
|
}): Promise<StorageThreadType[]>;
|
|
120
|
+
getThreadsByResourceIdPaginated(args: {
|
|
121
|
+
resourceId: string;
|
|
122
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
123
|
+
threads: StorageThreadType[];
|
|
124
|
+
}>;
|
|
114
125
|
saveThread({ thread }: {
|
|
115
126
|
thread: StorageThreadType;
|
|
116
127
|
}): Promise<StorageThreadType>;
|
|
@@ -123,12 +134,21 @@ declare class LibSQLStore extends MastraStorage {
|
|
|
123
134
|
threadId: string;
|
|
124
135
|
}): Promise<void>;
|
|
125
136
|
private parseRow;
|
|
137
|
+
private _getIncludedMessages;
|
|
138
|
+
/**
|
|
139
|
+
* @deprecated use getMessagesPaginated instead for paginated results.
|
|
140
|
+
*/
|
|
126
141
|
getMessages(args: StorageGetMessagesArg & {
|
|
127
142
|
format?: 'v1';
|
|
128
143
|
}): Promise<MastraMessageV1[]>;
|
|
129
144
|
getMessages(args: StorageGetMessagesArg & {
|
|
130
145
|
format: 'v2';
|
|
131
146
|
}): Promise<MastraMessageV2[]>;
|
|
147
|
+
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
148
|
+
format?: 'v1' | 'v2';
|
|
149
|
+
}): Promise<PaginationInfo & {
|
|
150
|
+
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
151
|
+
}>;
|
|
132
152
|
saveMessages(args: {
|
|
133
153
|
messages: MastraMessageV1[];
|
|
134
154
|
format?: undefined | 'v1';
|
|
@@ -138,8 +158,18 @@ declare class LibSQLStore extends MastraStorage {
|
|
|
138
158
|
format: 'v2';
|
|
139
159
|
}): Promise<MastraMessageV2[]>;
|
|
140
160
|
private transformEvalRow;
|
|
161
|
+
/** @deprecated use getEvals instead */
|
|
141
162
|
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
142
|
-
|
|
163
|
+
getEvals(options?: {
|
|
164
|
+
agentName?: string;
|
|
165
|
+
type?: 'test' | 'live';
|
|
166
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
167
|
+
evals: EvalRow[];
|
|
168
|
+
}>;
|
|
169
|
+
/**
|
|
170
|
+
* @deprecated use getTracesPaginated instead.
|
|
171
|
+
*/
|
|
172
|
+
getTraces(args: {
|
|
143
173
|
name?: string;
|
|
144
174
|
scope?: string;
|
|
145
175
|
page: number;
|
|
@@ -148,7 +178,15 @@ declare class LibSQLStore extends MastraStorage {
|
|
|
148
178
|
filters?: Record<string, any>;
|
|
149
179
|
fromDate?: Date;
|
|
150
180
|
toDate?: Date;
|
|
151
|
-
}): Promise<
|
|
181
|
+
}): Promise<Trace[]>;
|
|
182
|
+
getTracesPaginated(args: {
|
|
183
|
+
name?: string;
|
|
184
|
+
scope?: string;
|
|
185
|
+
attributes?: Record<string, string>;
|
|
186
|
+
filters?: Record<string, any>;
|
|
187
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
188
|
+
traces: Trace[];
|
|
189
|
+
}>;
|
|
152
190
|
getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
|
|
153
191
|
workflowName?: string;
|
|
154
192
|
fromDate?: Date;
|
|
@@ -11,12 +11,15 @@ import type { MastraMessageV2 } from '@mastra/core/agent';
|
|
|
11
11
|
import { MastraStorage } from '@mastra/core/storage';
|
|
12
12
|
import { MastraVector } from '@mastra/core/vector';
|
|
13
13
|
import type { OperatorSupport } from '@mastra/core/vector/filter';
|
|
14
|
+
import type { PaginationArgs } from '@mastra/core/storage';
|
|
15
|
+
import type { PaginationInfo } from '@mastra/core/storage';
|
|
14
16
|
import type { QueryResult } from '@mastra/core/vector';
|
|
15
17
|
import type { QueryVectorParams } from '@mastra/core/vector';
|
|
16
18
|
import type { StorageColumn } from '@mastra/core/storage';
|
|
17
19
|
import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
18
20
|
import type { StorageThreadType } from '@mastra/core/memory';
|
|
19
21
|
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
22
|
+
import type { Trace } from '@mastra/core/telemetry';
|
|
20
23
|
import type { UpdateVectorParams } from '@mastra/core/vector';
|
|
21
24
|
import type { UpsertVectorParams } from '@mastra/core/vector';
|
|
22
25
|
import type { VectorFilter } from '@mastra/core/vector/filter';
|
|
@@ -108,9 +111,17 @@ declare class LibSQLStore extends MastraStorage {
|
|
|
108
111
|
getThreadById({ threadId }: {
|
|
109
112
|
threadId: string;
|
|
110
113
|
}): Promise<StorageThreadType | null>;
|
|
111
|
-
|
|
114
|
+
/**
|
|
115
|
+
* @deprecated use getThreadsByResourceIdPaginated instead for paginated results.
|
|
116
|
+
*/
|
|
117
|
+
getThreadsByResourceId(args: {
|
|
112
118
|
resourceId: string;
|
|
113
119
|
}): Promise<StorageThreadType[]>;
|
|
120
|
+
getThreadsByResourceIdPaginated(args: {
|
|
121
|
+
resourceId: string;
|
|
122
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
123
|
+
threads: StorageThreadType[];
|
|
124
|
+
}>;
|
|
114
125
|
saveThread({ thread }: {
|
|
115
126
|
thread: StorageThreadType;
|
|
116
127
|
}): Promise<StorageThreadType>;
|
|
@@ -123,12 +134,21 @@ declare class LibSQLStore extends MastraStorage {
|
|
|
123
134
|
threadId: string;
|
|
124
135
|
}): Promise<void>;
|
|
125
136
|
private parseRow;
|
|
137
|
+
private _getIncludedMessages;
|
|
138
|
+
/**
|
|
139
|
+
* @deprecated use getMessagesPaginated instead for paginated results.
|
|
140
|
+
*/
|
|
126
141
|
getMessages(args: StorageGetMessagesArg & {
|
|
127
142
|
format?: 'v1';
|
|
128
143
|
}): Promise<MastraMessageV1[]>;
|
|
129
144
|
getMessages(args: StorageGetMessagesArg & {
|
|
130
145
|
format: 'v2';
|
|
131
146
|
}): Promise<MastraMessageV2[]>;
|
|
147
|
+
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
148
|
+
format?: 'v1' | 'v2';
|
|
149
|
+
}): Promise<PaginationInfo & {
|
|
150
|
+
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
151
|
+
}>;
|
|
132
152
|
saveMessages(args: {
|
|
133
153
|
messages: MastraMessageV1[];
|
|
134
154
|
format?: undefined | 'v1';
|
|
@@ -138,8 +158,18 @@ declare class LibSQLStore extends MastraStorage {
|
|
|
138
158
|
format: 'v2';
|
|
139
159
|
}): Promise<MastraMessageV2[]>;
|
|
140
160
|
private transformEvalRow;
|
|
161
|
+
/** @deprecated use getEvals instead */
|
|
141
162
|
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
142
|
-
|
|
163
|
+
getEvals(options?: {
|
|
164
|
+
agentName?: string;
|
|
165
|
+
type?: 'test' | 'live';
|
|
166
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
167
|
+
evals: EvalRow[];
|
|
168
|
+
}>;
|
|
169
|
+
/**
|
|
170
|
+
* @deprecated use getTracesPaginated instead.
|
|
171
|
+
*/
|
|
172
|
+
getTraces(args: {
|
|
143
173
|
name?: string;
|
|
144
174
|
scope?: string;
|
|
145
175
|
page: number;
|
|
@@ -148,7 +178,15 @@ declare class LibSQLStore extends MastraStorage {
|
|
|
148
178
|
filters?: Record<string, any>;
|
|
149
179
|
fromDate?: Date;
|
|
150
180
|
toDate?: Date;
|
|
151
|
-
}): Promise<
|
|
181
|
+
}): Promise<Trace[]>;
|
|
182
|
+
getTracesPaginated(args: {
|
|
183
|
+
name?: string;
|
|
184
|
+
scope?: string;
|
|
185
|
+
attributes?: Record<string, string>;
|
|
186
|
+
filters?: Record<string, any>;
|
|
187
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
188
|
+
traces: Trace[];
|
|
189
|
+
}>;
|
|
152
190
|
getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
|
|
153
191
|
workflowName?: string;
|
|
154
192
|
fromDate?: Date;
|