@mastra/libsql 0.0.0-bundle-recursion-20251030002519 → 0.0.0-bundle-studio-cloud-20251222034739
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/CHANGELOG.md +861 -3
- package/README.md +30 -20
- package/dist/index.cjs +2098 -1668
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2032 -1602
- package/dist/index.js.map +1 -1
- package/dist/storage/db/index.d.ts +259 -0
- package/dist/storage/db/index.d.ts.map +1 -0
- package/dist/storage/{domains → db}/utils.d.ts +4 -0
- package/dist/storage/db/utils.d.ts.map +1 -0
- package/dist/storage/domains/agents/index.d.ts +23 -0
- package/dist/storage/domains/agents/index.d.ts.map +1 -0
- package/dist/storage/domains/memory/index.d.ts +19 -53
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/observability/index.d.ts +17 -17
- package/dist/storage/domains/observability/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +15 -14
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +18 -32
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +70 -128
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/index.d.ts +7 -3
- package/dist/vector/index.d.ts.map +1 -1
- package/dist/vector/sql-builder.d.ts.map +1 -1
- package/package.json +12 -8
- package/dist/storage/domains/legacy-evals/index.d.ts +0 -18
- package/dist/storage/domains/legacy-evals/index.d.ts.map +0 -1
- package/dist/storage/domains/operations/index.d.ts +0 -110
- package/dist/storage/domains/operations/index.d.ts.map +0 -1
- package/dist/storage/domains/utils.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/dom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EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,SAAS,GACV,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,gBAAgB,CAAC;QAC3B,SAAS,CAAC,EAAE,IAAI,CAAC;QACjB,SAAS,CAAC,EAAE,IAAI,CAAC;KAClB;IAkBK,oBAAoB,CAAC,EACzB,YAAY,EACZ,KAAK,GACN,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAU9B,kBAAkB,CAAC,EACvB,KAAK,EACL,YAAY,GACb,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAuCzB,qBAAqB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBtG,gBAAgB,CAAC,EACrB,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAAM,GACP,GAAE,4BAAiC,GAAG,OAAO,CAAC,YAAY,CAAC;CAuE7D"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { Client } from '@libsql/client';
|
|
2
|
-
import type { MastraMessageContentV2,
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
2
|
+
import type { MastraMessageContentV2, MastraDBMessage } from '@mastra/core/agent';
|
|
3
|
+
import type { SaveScorePayload, ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
4
|
+
import type { StorageThreadType } from '@mastra/core/memory';
|
|
5
5
|
import { MastraStorage } from '@mastra/core/storage';
|
|
6
|
-
import type {
|
|
6
|
+
import type { PaginationInfo, StoragePagination, StorageResourceType, WorkflowRun, WorkflowRuns, StorageDomains, SpanRecord, TraceRecord, TracesPaginatedArg, StorageListWorkflowRunsInput, UpdateWorkflowStateOptions } from '@mastra/core/storage';
|
|
7
7
|
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Base configuration options shared across LibSQL configurations
|
|
10
|
+
*/
|
|
11
|
+
export type LibSQLBaseConfig = {
|
|
12
|
+
id: string;
|
|
11
13
|
/**
|
|
12
14
|
* Maximum number of retries for write operations if an SQLITE_BUSY error occurs.
|
|
13
15
|
* @default 5
|
|
@@ -19,11 +21,33 @@ export type LibSQLConfig = {
|
|
|
19
21
|
* @default 100
|
|
20
22
|
*/
|
|
21
23
|
initialBackoffMs?: number;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* When true, automatic initialization (table creation/migrations) is disabled.
|
|
26
|
+
* This is useful for CI/CD pipelines where you want to:
|
|
27
|
+
* 1. Run migrations explicitly during deployment (not at runtime)
|
|
28
|
+
* 2. Use different credentials for schema changes vs runtime operations
|
|
29
|
+
*
|
|
30
|
+
* When disableInit is true:
|
|
31
|
+
* - The storage will not automatically create/alter tables on first use
|
|
32
|
+
* - You must call `storage.init()` explicitly in your CI/CD scripts
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // In CI/CD script:
|
|
36
|
+
* const storage = new LibSQLStore({ ...config, disableInit: false });
|
|
37
|
+
* await storage.init(); // Explicitly run migrations
|
|
38
|
+
*
|
|
39
|
+
* // In runtime application:
|
|
40
|
+
* const storage = new LibSQLStore({ ...config, disableInit: true });
|
|
41
|
+
* // No auto-init, tables must already exist
|
|
42
|
+
*/
|
|
43
|
+
disableInit?: boolean;
|
|
26
44
|
};
|
|
45
|
+
export type LibSQLConfig = (LibSQLBaseConfig & {
|
|
46
|
+
url: string;
|
|
47
|
+
authToken?: string;
|
|
48
|
+
}) | (LibSQLBaseConfig & {
|
|
49
|
+
client: Client;
|
|
50
|
+
});
|
|
27
51
|
export declare class LibSQLStore extends MastraStorage {
|
|
28
52
|
private client;
|
|
29
53
|
private readonly maxRetries;
|
|
@@ -36,58 +60,13 @@ export declare class LibSQLStore extends MastraStorage {
|
|
|
36
60
|
hasColumn: boolean;
|
|
37
61
|
createTable: boolean;
|
|
38
62
|
deleteMessages: boolean;
|
|
39
|
-
|
|
40
|
-
|
|
63
|
+
observabilityInstance: boolean;
|
|
64
|
+
listScoresBySpan: boolean;
|
|
65
|
+
agents: boolean;
|
|
41
66
|
};
|
|
42
|
-
createTable({ tableName, schema, }: {
|
|
43
|
-
tableName: TABLE_NAMES;
|
|
44
|
-
schema: Record<string, StorageColumn>;
|
|
45
|
-
}): Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Alters table schema to add columns if they don't exist
|
|
48
|
-
* @param tableName Name of the table
|
|
49
|
-
* @param schema Schema of the table
|
|
50
|
-
* @param ifNotExists Array of column names to add if they don't exist
|
|
51
|
-
*/
|
|
52
|
-
alterTable({ tableName, schema, ifNotExists, }: {
|
|
53
|
-
tableName: TABLE_NAMES;
|
|
54
|
-
schema: Record<string, StorageColumn>;
|
|
55
|
-
ifNotExists: string[];
|
|
56
|
-
}): Promise<void>;
|
|
57
|
-
clearTable({ tableName }: {
|
|
58
|
-
tableName: TABLE_NAMES;
|
|
59
|
-
}): Promise<void>;
|
|
60
|
-
dropTable({ tableName }: {
|
|
61
|
-
tableName: TABLE_NAMES;
|
|
62
|
-
}): Promise<void>;
|
|
63
|
-
insert(args: {
|
|
64
|
-
tableName: TABLE_NAMES;
|
|
65
|
-
record: Record<string, any>;
|
|
66
|
-
}): Promise<void>;
|
|
67
|
-
batchInsert(args: {
|
|
68
|
-
tableName: TABLE_NAMES;
|
|
69
|
-
records: Record<string, any>[];
|
|
70
|
-
}): Promise<void>;
|
|
71
|
-
load<R>({ tableName, keys }: {
|
|
72
|
-
tableName: TABLE_NAMES;
|
|
73
|
-
keys: Record<string, string>;
|
|
74
|
-
}): Promise<R | null>;
|
|
75
67
|
getThreadById({ threadId }: {
|
|
76
68
|
threadId: string;
|
|
77
69
|
}): Promise<StorageThreadType | null>;
|
|
78
|
-
/**
|
|
79
|
-
* @deprecated use getThreadsByResourceIdPaginated instead for paginated results.
|
|
80
|
-
*/
|
|
81
|
-
getThreadsByResourceId(args: {
|
|
82
|
-
resourceId: string;
|
|
83
|
-
} & ThreadSortOptions): Promise<StorageThreadType[]>;
|
|
84
|
-
getThreadsByResourceIdPaginated(args: {
|
|
85
|
-
resourceId: string;
|
|
86
|
-
page: number;
|
|
87
|
-
perPage: number;
|
|
88
|
-
} & ThreadSortOptions): Promise<PaginationInfo & {
|
|
89
|
-
threads: StorageThreadType[];
|
|
90
|
-
}>;
|
|
91
70
|
saveThread({ thread }: {
|
|
92
71
|
thread: StorageThreadType;
|
|
93
72
|
}): Promise<StorageThreadType>;
|
|
@@ -99,61 +78,33 @@ export declare class LibSQLStore extends MastraStorage {
|
|
|
99
78
|
deleteThread({ threadId }: {
|
|
100
79
|
threadId: string;
|
|
101
80
|
}): Promise<void>;
|
|
102
|
-
|
|
103
|
-
* @deprecated use getMessagesPaginated instead for paginated results.
|
|
104
|
-
*/
|
|
105
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
106
|
-
format?: 'v1';
|
|
107
|
-
}): Promise<MastraMessageV1[]>;
|
|
108
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
109
|
-
format: 'v2';
|
|
110
|
-
}): Promise<MastraMessageV2[]>;
|
|
111
|
-
getMessagesById({ messageIds, format }: {
|
|
81
|
+
listMessagesById({ messageIds }: {
|
|
112
82
|
messageIds: string[];
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
getMessagesById({ messageIds, format }: {
|
|
116
|
-
messageIds: string[];
|
|
117
|
-
format?: 'v2';
|
|
118
|
-
}): Promise<MastraMessageV2[]>;
|
|
119
|
-
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
120
|
-
format?: 'v1' | 'v2';
|
|
121
|
-
}): Promise<PaginationInfo & {
|
|
122
|
-
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
83
|
+
}): Promise<{
|
|
84
|
+
messages: MastraDBMessage[];
|
|
123
85
|
}>;
|
|
124
86
|
saveMessages(args: {
|
|
125
|
-
messages:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
messages: MastraMessageV2[];
|
|
130
|
-
format: 'v2';
|
|
131
|
-
}): Promise<MastraMessageV2[]>;
|
|
87
|
+
messages: MastraDBMessage[];
|
|
88
|
+
}): Promise<{
|
|
89
|
+
messages: MastraDBMessage[];
|
|
90
|
+
}>;
|
|
132
91
|
updateMessages({ messages, }: {
|
|
133
|
-
messages: (Partial<Omit<
|
|
92
|
+
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
134
93
|
id: string;
|
|
135
94
|
content?: {
|
|
136
95
|
metadata?: MastraMessageContentV2['metadata'];
|
|
137
96
|
content?: MastraMessageContentV2['content'];
|
|
138
97
|
};
|
|
139
98
|
})[];
|
|
140
|
-
}): Promise<
|
|
99
|
+
}): Promise<MastraDBMessage[]>;
|
|
141
100
|
deleteMessages(messageIds: string[]): Promise<void>;
|
|
142
|
-
/** @deprecated use getEvals instead */
|
|
143
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
144
|
-
getEvals(options?: {
|
|
145
|
-
agentName?: string;
|
|
146
|
-
type?: 'test' | 'live';
|
|
147
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
148
|
-
evals: EvalRow[];
|
|
149
|
-
}>;
|
|
150
101
|
getScoreById({ id }: {
|
|
151
102
|
id: string;
|
|
152
103
|
}): Promise<ScoreRowData | null>;
|
|
153
|
-
saveScore(score:
|
|
104
|
+
saveScore(score: SaveScorePayload): Promise<{
|
|
154
105
|
score: ScoreRowData;
|
|
155
106
|
}>;
|
|
156
|
-
|
|
107
|
+
listScoresByScorerId({ scorerId, entityId, entityType, source, pagination, }: {
|
|
157
108
|
scorerId: string;
|
|
158
109
|
entityId?: string;
|
|
159
110
|
entityType?: string;
|
|
@@ -163,14 +114,14 @@ export declare class LibSQLStore extends MastraStorage {
|
|
|
163
114
|
pagination: PaginationInfo;
|
|
164
115
|
scores: ScoreRowData[];
|
|
165
116
|
}>;
|
|
166
|
-
|
|
117
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
167
118
|
runId: string;
|
|
168
119
|
pagination: StoragePagination;
|
|
169
120
|
}): Promise<{
|
|
170
121
|
pagination: PaginationInfo;
|
|
171
122
|
scores: ScoreRowData[];
|
|
172
123
|
}>;
|
|
173
|
-
|
|
124
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
174
125
|
pagination: StoragePagination;
|
|
175
126
|
entityId: string;
|
|
176
127
|
entityType: string;
|
|
@@ -181,23 +132,17 @@ export declare class LibSQLStore extends MastraStorage {
|
|
|
181
132
|
/**
|
|
182
133
|
* WORKFLOWS
|
|
183
134
|
*/
|
|
184
|
-
updateWorkflowResults({ workflowName, runId, stepId, result,
|
|
135
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
185
136
|
workflowName: string;
|
|
186
137
|
runId: string;
|
|
187
138
|
stepId: string;
|
|
188
139
|
result: StepResult<any, any, any, any>;
|
|
189
|
-
|
|
140
|
+
requestContext: Record<string, any>;
|
|
190
141
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
191
142
|
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
192
143
|
workflowName: string;
|
|
193
144
|
runId: string;
|
|
194
|
-
opts:
|
|
195
|
-
status: string;
|
|
196
|
-
result?: StepResult<any, any, any, any>;
|
|
197
|
-
error?: string;
|
|
198
|
-
suspendedPaths?: Record<string, number[]>;
|
|
199
|
-
waitingPaths?: Record<string, number[]>;
|
|
200
|
-
};
|
|
145
|
+
opts: UpdateWorkflowStateOptions;
|
|
201
146
|
}): Promise<WorkflowRunState | undefined>;
|
|
202
147
|
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
|
|
203
148
|
workflowName: string;
|
|
@@ -209,18 +154,15 @@ export declare class LibSQLStore extends MastraStorage {
|
|
|
209
154
|
workflowName: string;
|
|
210
155
|
runId: string;
|
|
211
156
|
}): Promise<WorkflowRunState | null>;
|
|
212
|
-
|
|
213
|
-
workflowName?: string;
|
|
214
|
-
fromDate?: Date;
|
|
215
|
-
toDate?: Date;
|
|
216
|
-
limit?: number;
|
|
217
|
-
offset?: number;
|
|
218
|
-
resourceId?: string;
|
|
219
|
-
}): Promise<WorkflowRuns>;
|
|
157
|
+
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
220
158
|
getWorkflowRunById({ runId, workflowName, }: {
|
|
221
159
|
runId: string;
|
|
222
160
|
workflowName?: string;
|
|
223
161
|
}): Promise<WorkflowRun | null>;
|
|
162
|
+
deleteWorkflowRunById({ runId, workflowName }: {
|
|
163
|
+
runId: string;
|
|
164
|
+
workflowName: string;
|
|
165
|
+
}): Promise<void>;
|
|
224
166
|
getResourceById({ resourceId }: {
|
|
225
167
|
resourceId: string;
|
|
226
168
|
}): Promise<StorageResourceType | null>;
|
|
@@ -232,18 +174,18 @@ export declare class LibSQLStore extends MastraStorage {
|
|
|
232
174
|
workingMemory?: string;
|
|
233
175
|
metadata?: Record<string, unknown>;
|
|
234
176
|
}): Promise<StorageResourceType>;
|
|
235
|
-
|
|
236
|
-
|
|
177
|
+
createSpan(span: SpanRecord): Promise<void>;
|
|
178
|
+
updateSpan(params: {
|
|
237
179
|
spanId: string;
|
|
238
180
|
traceId: string;
|
|
239
|
-
updates: Partial<Omit<
|
|
181
|
+
updates: Partial<Omit<SpanRecord, 'spanId' | 'traceId'>>;
|
|
240
182
|
}): Promise<void>;
|
|
241
|
-
|
|
242
|
-
|
|
183
|
+
getTrace(traceId: string): Promise<TraceRecord | null>;
|
|
184
|
+
getTracesPaginated(args: TracesPaginatedArg): Promise<{
|
|
243
185
|
pagination: PaginationInfo;
|
|
244
|
-
spans:
|
|
186
|
+
spans: SpanRecord[];
|
|
245
187
|
}>;
|
|
246
|
-
|
|
188
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
247
189
|
traceId: string;
|
|
248
190
|
spanId: string;
|
|
249
191
|
pagination: StoragePagination;
|
|
@@ -251,14 +193,14 @@ export declare class LibSQLStore extends MastraStorage {
|
|
|
251
193
|
pagination: PaginationInfo;
|
|
252
194
|
scores: ScoreRowData[];
|
|
253
195
|
}>;
|
|
254
|
-
|
|
255
|
-
records:
|
|
196
|
+
batchCreateSpans(args: {
|
|
197
|
+
records: SpanRecord[];
|
|
256
198
|
}): Promise<void>;
|
|
257
|
-
|
|
199
|
+
batchUpdateSpans(args: {
|
|
258
200
|
records: {
|
|
259
201
|
traceId: string;
|
|
260
202
|
spanId: string;
|
|
261
|
-
updates: Partial<Omit<
|
|
203
|
+
updates: Partial<Omit<SpanRecord, 'spanId' | 'traceId'>>;
|
|
262
204
|
}[];
|
|
263
205
|
}): Promise<void>;
|
|
264
206
|
}
|
|
@@ -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,sBAAsB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,
|
|
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,sBAAsB,EAAE,eAAe,E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iB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAI7D,gBAAgB,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,UAAU,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhE,gBAAgB,CAAC,IAAI,EAAE;QAC3B,OAAO,EAAE;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAA;SAAE,EAAE,CAAC;KAC1G,GAAG,OAAO,CAAC,IAAI,CAAC;CAGlB;AAED,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,CAAC"}
|
package/dist/vector/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MastraVector } from '@mastra/core/vector';
|
|
2
|
-
import type { IndexStats, QueryResult, QueryVectorParams, CreateIndexParams, UpsertVectorParams, DescribeIndexParams, DeleteIndexParams, DeleteVectorParams, UpdateVectorParams } from '@mastra/core/vector';
|
|
2
|
+
import type { IndexStats, QueryResult, QueryVectorParams, CreateIndexParams, UpsertVectorParams, DescribeIndexParams, DeleteIndexParams, DeleteVectorParams, UpdateVectorParams, DeleteVectorsParams } from '@mastra/core/vector';
|
|
3
3
|
import type { LibSQLVectorFilter } from './filter.js';
|
|
4
4
|
interface LibSQLQueryVectorParams extends QueryVectorParams<LibSQLVectorFilter> {
|
|
5
5
|
minScore?: number;
|
|
@@ -25,7 +25,9 @@ export declare class LibSQLVector extends MastraVector<LibSQLVectorFilter> {
|
|
|
25
25
|
private turso;
|
|
26
26
|
private readonly maxRetries;
|
|
27
27
|
private readonly initialBackoffMs;
|
|
28
|
-
constructor({ connectionUrl, authToken, syncUrl, syncInterval, maxRetries, initialBackoffMs, }: LibSQLVectorConfig
|
|
28
|
+
constructor({ connectionUrl, authToken, syncUrl, syncInterval, maxRetries, initialBackoffMs, id, }: LibSQLVectorConfig & {
|
|
29
|
+
id: string;
|
|
30
|
+
});
|
|
29
31
|
private executeWriteOperationWithRetry;
|
|
30
32
|
transformFilter(filter?: LibSQLVectorFilter): LibSQLVectorFilter;
|
|
31
33
|
query({ indexName, queryVector, topK, filter, includeVector, minScore, }: LibSQLQueryVectorParams): Promise<QueryResult[]>;
|
|
@@ -54,7 +56,7 @@ export declare class LibSQLVector extends MastraVector<LibSQLVectorFilter> {
|
|
|
54
56
|
* @returns A promise that resolves when the update is complete.
|
|
55
57
|
* @throws Will throw an error if no updates are provided or if the update operation fails.
|
|
56
58
|
*/
|
|
57
|
-
updateVector(args: UpdateVectorParams): Promise<void>;
|
|
59
|
+
updateVector(args: UpdateVectorParams<LibSQLVectorFilter>): Promise<void>;
|
|
58
60
|
private doUpdateVector;
|
|
59
61
|
/**
|
|
60
62
|
* Deletes a vector by its ID.
|
|
@@ -65,6 +67,8 @@ export declare class LibSQLVector extends MastraVector<LibSQLVectorFilter> {
|
|
|
65
67
|
*/
|
|
66
68
|
deleteVector(args: DeleteVectorParams): Promise<void>;
|
|
67
69
|
private doDeleteVector;
|
|
70
|
+
deleteVectors(args: DeleteVectorsParams<LibSQLVectorFilter>): Promise<void>;
|
|
71
|
+
private doDeleteVectors;
|
|
68
72
|
truncateIndex(args: DeleteIndexParams): Promise<void>;
|
|
69
73
|
private _doTruncateIndex;
|
|
70
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,iBAAiB,E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C;YAgB5C,aAAa;IAyBpB,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;YAgB5C,aAAa;IAQrB,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAwBtC;;;;;OAKG;IACG,aAAa,CAAC,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;IAqD5E;;;;;;;;;;OAUG;IACI,YAAY,CAAC,IAAI,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;YAIlE,cAAc;IA8I5B;;;;;;OAMG;IACI,YAAY,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;YAmB9C,cAAc;IAQrB,aAAa,CAAC,IAAI,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;YAIpE,eAAe;IAiHtB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;YAgB9C,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;
|
|
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;AA4WnD,UAAU,YAAY;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,EAAE,CAAC;CACnB;AA6BD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CAkBzE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/libsql",
|
|
3
|
-
"version": "0.0.0-bundle-
|
|
3
|
+
"version": "0.0.0-bundle-studio-cloud-20251222034739",
|
|
4
4
|
"description": "Libsql provider for Mastra - includes both vector and db storage capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,19 +23,20 @@
|
|
|
23
23
|
"@libsql/client": "^0.15.15"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
26
|
+
"@types/node": "22.13.17",
|
|
27
|
+
"@vitest/coverage-v8": "4.0.12",
|
|
28
|
+
"@vitest/ui": "4.0.12",
|
|
28
29
|
"eslint": "^9.37.0",
|
|
29
30
|
"tsup": "^8.5.0",
|
|
30
31
|
"typescript": "^5.8.3",
|
|
31
|
-
"vitest": "
|
|
32
|
-
"@internal/lint": "0.0.0-bundle-
|
|
32
|
+
"vitest": "4.0.12",
|
|
33
|
+
"@internal/lint": "0.0.0-bundle-studio-cloud-20251222034739",
|
|
33
34
|
"@internal/storage-test-utils": "0.0.49",
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
35
|
+
"@internal/types-builder": "0.0.0-bundle-studio-cloud-20251222034739",
|
|
36
|
+
"@mastra/core": "0.0.0-bundle-studio-cloud-20251222034739"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
|
-
"@mastra/core": "0.0.0-bundle-
|
|
39
|
+
"@mastra/core": "0.0.0-bundle-studio-cloud-20251222034739"
|
|
39
40
|
},
|
|
40
41
|
"files": [
|
|
41
42
|
"dist",
|
|
@@ -50,6 +51,9 @@
|
|
|
50
51
|
"bugs": {
|
|
51
52
|
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
52
53
|
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=22.13.0"
|
|
56
|
+
},
|
|
53
57
|
"scripts": {
|
|
54
58
|
"build": "tsup --silent --config tsup.config.ts",
|
|
55
59
|
"build:watch": "tsup --watch --silent --config tsup.config.ts",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Client } from '@libsql/client';
|
|
2
|
-
import { LegacyEvalsStorage } from '@mastra/core/storage';
|
|
3
|
-
import type { PaginationArgs, PaginationInfo, EvalRow } from '@mastra/core/storage';
|
|
4
|
-
export declare class LegacyEvalsLibSQL extends LegacyEvalsStorage {
|
|
5
|
-
private client;
|
|
6
|
-
constructor({ client }: {
|
|
7
|
-
client: Client;
|
|
8
|
-
});
|
|
9
|
-
/** @deprecated use getEvals instead */
|
|
10
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
11
|
-
getEvals(options?: {
|
|
12
|
-
agentName?: string;
|
|
13
|
-
type?: 'test' | 'live';
|
|
14
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
15
|
-
evals: EvalRow[];
|
|
16
|
-
}>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/legacy-evals/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAW,MAAM,gBAAgB,CAAC;AAGtD,OAAO,EAAE,kBAAkB,EAAe,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAwBpF,qBAAa,iBAAkB,SAAQ,kBAAkB;IACvD,OAAO,CAAC,MAAM,CAAS;gBACX,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;IAK1C,uCAAuC;IACjC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAiClF,QAAQ,CACZ,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,GAAG,cAAmB,GACtB,OAAO,CAAC,cAAc,GAAG;QAAE,KAAK,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;CA0ElD"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import type { Client, InValue } from '@libsql/client';
|
|
2
|
-
import { StoreOperations } from '@mastra/core/storage';
|
|
3
|
-
import type { StorageColumn, TABLE_NAMES } from '@mastra/core/storage';
|
|
4
|
-
export declare class StoreOperationsLibSQL extends StoreOperations {
|
|
5
|
-
private client;
|
|
6
|
-
/**
|
|
7
|
-
* Maximum number of retries for write operations if an SQLITE_BUSY error occurs.
|
|
8
|
-
* @default 5
|
|
9
|
-
*/
|
|
10
|
-
maxRetries: number;
|
|
11
|
-
/**
|
|
12
|
-
* Initial backoff time in milliseconds for retrying write operations on SQLITE_BUSY.
|
|
13
|
-
* The backoff time will double with each retry (exponential backoff).
|
|
14
|
-
* @default 100
|
|
15
|
-
*/
|
|
16
|
-
initialBackoffMs: number;
|
|
17
|
-
constructor({ client, maxRetries, initialBackoffMs, }: {
|
|
18
|
-
client: Client;
|
|
19
|
-
maxRetries?: number;
|
|
20
|
-
initialBackoffMs?: number;
|
|
21
|
-
});
|
|
22
|
-
hasColumn(table: string, column: string): Promise<boolean>;
|
|
23
|
-
private getCreateTableSQL;
|
|
24
|
-
createTable({ tableName, schema, }: {
|
|
25
|
-
tableName: TABLE_NAMES;
|
|
26
|
-
schema: Record<string, StorageColumn>;
|
|
27
|
-
}): Promise<void>;
|
|
28
|
-
protected getSqlType(type: StorageColumn['type']): string;
|
|
29
|
-
private doInsert;
|
|
30
|
-
insert(args: {
|
|
31
|
-
tableName: TABLE_NAMES;
|
|
32
|
-
record: Record<string, any>;
|
|
33
|
-
}): Promise<void>;
|
|
34
|
-
load<R>({ tableName, keys }: {
|
|
35
|
-
tableName: TABLE_NAMES;
|
|
36
|
-
keys: Record<string, string>;
|
|
37
|
-
}): Promise<R | null>;
|
|
38
|
-
loadMany<R>({ tableName, whereClause, orderBy, offset, limit, args, }: {
|
|
39
|
-
tableName: TABLE_NAMES;
|
|
40
|
-
whereClause?: {
|
|
41
|
-
sql: string;
|
|
42
|
-
args: InValue[];
|
|
43
|
-
};
|
|
44
|
-
orderBy?: string;
|
|
45
|
-
offset?: number;
|
|
46
|
-
limit?: number;
|
|
47
|
-
args?: any[];
|
|
48
|
-
}): Promise<R[]>;
|
|
49
|
-
loadTotalCount({ tableName, whereClause, }: {
|
|
50
|
-
tableName: TABLE_NAMES;
|
|
51
|
-
whereClause?: {
|
|
52
|
-
sql: string;
|
|
53
|
-
args: InValue[];
|
|
54
|
-
};
|
|
55
|
-
}): Promise<number>;
|
|
56
|
-
update(args: {
|
|
57
|
-
tableName: TABLE_NAMES;
|
|
58
|
-
keys: Record<string, any>;
|
|
59
|
-
data: Record<string, any>;
|
|
60
|
-
}): Promise<void>;
|
|
61
|
-
private executeUpdate;
|
|
62
|
-
private doBatchInsert;
|
|
63
|
-
batchInsert(args: {
|
|
64
|
-
tableName: TABLE_NAMES;
|
|
65
|
-
records: Record<string, any>[];
|
|
66
|
-
}): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Public batch update method with retry logic
|
|
69
|
-
*/
|
|
70
|
-
batchUpdate(args: {
|
|
71
|
-
tableName: TABLE_NAMES;
|
|
72
|
-
updates: Array<{
|
|
73
|
-
keys: Record<string, any>;
|
|
74
|
-
data: Record<string, any>;
|
|
75
|
-
}>;
|
|
76
|
-
}): Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Updates multiple records in batch. Each record can be updated based on single or composite keys.
|
|
79
|
-
*/
|
|
80
|
-
private executeBatchUpdate;
|
|
81
|
-
/**
|
|
82
|
-
* Public batch delete method with retry logic
|
|
83
|
-
*/
|
|
84
|
-
batchDelete({ tableName, keys }: {
|
|
85
|
-
tableName: TABLE_NAMES;
|
|
86
|
-
keys: Array<Record<string, any>>;
|
|
87
|
-
}): Promise<void>;
|
|
88
|
-
/**
|
|
89
|
-
* Deletes multiple records in batch. Each record can be deleted based on single or composite keys.
|
|
90
|
-
*/
|
|
91
|
-
private executeBatchDelete;
|
|
92
|
-
/**
|
|
93
|
-
* Alters table schema to add columns if they don't exist
|
|
94
|
-
* @param tableName Name of the table
|
|
95
|
-
* @param schema Schema of the table
|
|
96
|
-
* @param ifNotExists Array of column names to add if they don't exist
|
|
97
|
-
*/
|
|
98
|
-
alterTable({ tableName, schema, ifNotExists, }: {
|
|
99
|
-
tableName: TABLE_NAMES;
|
|
100
|
-
schema: Record<string, StorageColumn>;
|
|
101
|
-
ifNotExists: string[];
|
|
102
|
-
}): Promise<void>;
|
|
103
|
-
clearTable({ tableName }: {
|
|
104
|
-
tableName: TABLE_NAMES;
|
|
105
|
-
}): Promise<void>;
|
|
106
|
-
dropTable({ tableName }: {
|
|
107
|
-
tableName: TABLE_NAMES;
|
|
108
|
-
}): Promise<void>;
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/operations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAA2B,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AASvE,qBAAa,qBAAsB,SAAQ,eAAe;IACxD,OAAO,CAAC,MAAM,CAAS;IACvB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;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