@mastra/libsql 0.0.2-alpha.1 → 0.0.2-alpha.4

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.2-alpha.1 build /home/runner/work/mastra/mastra/stores/libsql
2
+ > @mastra/libsql@0.0.2-alpha.4 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 8604ms
9
+ TSC ⚡️ Build success in 10145ms
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 7806ms
16
+ DTS ⚡️ Build success in 11868ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- CJS dist/index.cjs 41.41 KB
21
- CJS ⚡️ Build success in 865ms
22
- ESM dist/index.js 41.28 KB
23
- ESM ⚡️ Build success in 865ms
20
+ ESM dist/index.js 41.56 KB
21
+ ESM ⚡️ Build success in 1333ms
22
+ CJS dist/index.cjs 41.69 KB
23
+ CJS ⚡️ Build success in 1328ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @mastra/libsql
2
2
 
3
+ ## 0.0.2-alpha.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ccef9f9]
8
+ - Updated dependencies [51e6923]
9
+ - @mastra/core@0.9.2-alpha.4
10
+
11
+ ## 0.0.2-alpha.3
12
+
13
+ ### Patch Changes
14
+
15
+ - 4155f47: Add parameters to filter workflow runs
16
+ Add fromDate and toDate to telemetry parameters
17
+ - Updated dependencies [967b41c]
18
+ - Updated dependencies [4155f47]
19
+ - Updated dependencies [17826a9]
20
+ - @mastra/core@0.9.2-alpha.3
21
+
22
+ ## 0.0.2-alpha.2
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [26738f4]
27
+ - @mastra/core@0.9.2-alpha.2
28
+
3
29
  ## 0.0.2-alpha.1
4
30
 
5
31
  ### Patch Changes
@@ -128,13 +128,15 @@ declare class LibSQLStore extends MastraStorage {
128
128
  }): Promise<MessageType[]>;
129
129
  private transformEvalRow;
130
130
  getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
131
- getTraces({ name, scope, page, perPage, attributes, filters, }?: {
131
+ getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }?: {
132
132
  name?: string;
133
133
  scope?: string;
134
134
  page: number;
135
135
  perPage: number;
136
136
  attributes?: Record<string, string>;
137
137
  filters?: Record<string, any>;
138
+ fromDate?: Date;
139
+ toDate?: Date;
138
140
  }): Promise<any[]>;
139
141
  getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
140
142
  workflowName?: string;
@@ -128,13 +128,15 @@ declare class LibSQLStore extends MastraStorage {
128
128
  }): Promise<MessageType[]>;
129
129
  private transformEvalRow;
130
130
  getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
131
- getTraces({ name, scope, page, perPage, attributes, filters, }?: {
131
+ getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }?: {
132
132
  name?: string;
133
133
  scope?: string;
134
134
  page: number;
135
135
  perPage: number;
136
136
  attributes?: Record<string, string>;
137
137
  filters?: Record<string, any>;
138
+ fromDate?: Date;
139
+ toDate?: Date;
138
140
  }): Promise<any[]>;
139
141
  getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
140
142
  workflowName?: string;
package/dist/index.cjs CHANGED
@@ -1016,7 +1016,9 @@ var LibSQLStore = class extends storage.MastraStorage {
1016
1016
  page,
1017
1017
  perPage,
1018
1018
  attributes,
1019
- filters
1019
+ filters,
1020
+ fromDate,
1021
+ toDate
1020
1022
  } = {
1021
1023
  page: 0,
1022
1024
  perPage: 100
@@ -1041,6 +1043,12 @@ var LibSQLStore = class extends storage.MastraStorage {
1041
1043
  conditions.push(`${key} = ?`);
1042
1044
  });
1043
1045
  }
1046
+ if (fromDate) {
1047
+ conditions.push("createdAt >= ?");
1048
+ }
1049
+ if (toDate) {
1050
+ conditions.push("createdAt <= ?");
1051
+ }
1044
1052
  const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
1045
1053
  if (name) {
1046
1054
  args.push(name);
@@ -1058,6 +1066,12 @@ var LibSQLStore = class extends storage.MastraStorage {
1058
1066
  args.push(value);
1059
1067
  }
1060
1068
  }
1069
+ if (fromDate) {
1070
+ args.push(fromDate.toISOString());
1071
+ }
1072
+ if (toDate) {
1073
+ args.push(toDate.toISOString());
1074
+ }
1061
1075
  args.push(limit, offset);
1062
1076
  const result = await this.client.execute({
1063
1077
  sql: `SELECT * FROM ${storage.TABLE_TRACES} ${whereClause} ORDER BY "startTime" DESC LIMIT ? OFFSET ?`,
package/dist/index.js CHANGED
@@ -1014,7 +1014,9 @@ var LibSQLStore = class extends MastraStorage {
1014
1014
  page,
1015
1015
  perPage,
1016
1016
  attributes,
1017
- filters
1017
+ filters,
1018
+ fromDate,
1019
+ toDate
1018
1020
  } = {
1019
1021
  page: 0,
1020
1022
  perPage: 100
@@ -1039,6 +1041,12 @@ var LibSQLStore = class extends MastraStorage {
1039
1041
  conditions.push(`${key} = ?`);
1040
1042
  });
1041
1043
  }
1044
+ if (fromDate) {
1045
+ conditions.push("createdAt >= ?");
1046
+ }
1047
+ if (toDate) {
1048
+ conditions.push("createdAt <= ?");
1049
+ }
1042
1050
  const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
1043
1051
  if (name) {
1044
1052
  args.push(name);
@@ -1056,6 +1064,12 @@ var LibSQLStore = class extends MastraStorage {
1056
1064
  args.push(value);
1057
1065
  }
1058
1066
  }
1067
+ if (fromDate) {
1068
+ args.push(fromDate.toISOString());
1069
+ }
1070
+ if (toDate) {
1071
+ args.push(toDate.toISOString());
1072
+ }
1059
1073
  args.push(limit, offset);
1060
1074
  const result = await this.client.execute({
1061
1075
  sql: `SELECT * FROM ${TABLE_TRACES} ${whereClause} ORDER BY "startTime" DESC LIMIT ? OFFSET ?`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/libsql",
3
- "version": "0.0.2-alpha.1",
3
+ "version": "0.0.2-alpha.4",
4
4
  "description": "Libsql provider for Mastra - includes both vector and db storage capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
23
  "@libsql/client": "^0.15.4",
24
- "@mastra/core": "^0.9.2-alpha.1"
24
+ "@mastra/core": "^0.9.2-alpha.4"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@microsoft/api-extractor": "^7.52.5",
@@ -31,7 +31,7 @@
31
31
  "typescript": "^5.8.3",
32
32
  "vitest": "^3.1.2",
33
33
  "@internal/lint": "0.0.2",
34
- "@internal/storage-test-utils": "0.0.2-alpha.1"
34
+ "@internal/storage-test-utils": "0.0.2-alpha.4"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
@@ -459,6 +459,8 @@ export class LibSQLStore extends MastraStorage {
459
459
  perPage,
460
460
  attributes,
461
461
  filters,
462
+ fromDate,
463
+ toDate,
462
464
  }: {
463
465
  name?: string;
464
466
  scope?: string;
@@ -466,6 +468,8 @@ export class LibSQLStore extends MastraStorage {
466
468
  perPage: number;
467
469
  attributes?: Record<string, string>;
468
470
  filters?: Record<string, any>;
471
+ fromDate?: Date;
472
+ toDate?: Date;
469
473
  } = {
470
474
  page: 0,
471
475
  perPage: 100,
@@ -494,6 +498,14 @@ export class LibSQLStore extends MastraStorage {
494
498
  conditions.push(`${key} = ?`);
495
499
  });
496
500
  }
501
+
502
+ if (fromDate) {
503
+ conditions.push('createdAt >= ?');
504
+ }
505
+
506
+ if (toDate) {
507
+ conditions.push('createdAt <= ?');
508
+ }
497
509
  const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(' AND ')}` : '';
498
510
 
499
511
  if (name) {
@@ -516,6 +528,14 @@ export class LibSQLStore extends MastraStorage {
516
528
  }
517
529
  }
518
530
 
531
+ if (fromDate) {
532
+ args.push(fromDate.toISOString());
533
+ }
534
+
535
+ if (toDate) {
536
+ args.push(toDate.toISOString());
537
+ }
538
+
519
539
  args.push(limit, offset);
520
540
 
521
541
  const result = await this.client.execute({