@mastra/libsql 1.0.0-beta.3 → 1.0.0-beta.5
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 +47 -0
- package/dist/index.cjs +72 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +72 -72
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/observability/index.d.ts.map +1 -1
- package/dist/storage/domains/operations/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +2 -2
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +32 -10
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @mastra/libsql
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix saveScore not persisting ID correctly, breaking getScoreById retrieval ([#10915](https://github.com/mastra-ai/mastra/pull/10915))
|
|
8
|
+
|
|
9
|
+
**What Changed**
|
|
10
|
+
- saveScore now correctly returns scores that can be retrieved with getScoreById
|
|
11
|
+
- Validation errors now include contextual information (scorer, entity, trace details) for easier debugging
|
|
12
|
+
|
|
13
|
+
**Impact**
|
|
14
|
+
Previously, calling getScoreById after saveScore would return null because the generated ID wasn't persisted to the database. This is now fixed across all store implementations, ensuring consistent behavior and data integrity.
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`0d41fe2`](https://github.com/mastra-ai/mastra/commit/0d41fe245355dfc66d61a0d9c85d9400aac351ff), [`6b3ba91`](https://github.com/mastra-ai/mastra/commit/6b3ba91494cc10394df96782f349a4f7b1e152cc), [`7907fd1`](https://github.com/mastra-ai/mastra/commit/7907fd1c5059813b7b870b81ca71041dc807331b)]:
|
|
17
|
+
- @mastra/core@1.0.0-beta.8
|
|
18
|
+
|
|
19
|
+
## 1.0.0-beta.4
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- Add `disableInit` option to all storage adapters ([#10851](https://github.com/mastra-ai/mastra/pull/10851))
|
|
24
|
+
|
|
25
|
+
Adds a new `disableInit` config option to all storage providers that allows users to disable automatic table creation/migrations at runtime. This is useful for CI/CD pipelines where you want to run migrations during deployment with elevated credentials, then run the application with `disableInit: true` so it doesn't attempt schema changes at runtime.
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
// CI/CD script - run migrations
|
|
29
|
+
const storage = new PostgresStore({
|
|
30
|
+
connectionString: DATABASE_URL,
|
|
31
|
+
id: 'pg-storage',
|
|
32
|
+
});
|
|
33
|
+
await storage.init();
|
|
34
|
+
|
|
35
|
+
// Runtime - skip auto-init
|
|
36
|
+
const storage = new PostgresStore({
|
|
37
|
+
connectionString: DATABASE_URL,
|
|
38
|
+
id: 'pg-storage',
|
|
39
|
+
disableInit: true,
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- Standardize error IDs across all storage and vector stores using centralized helper functions (`createStorageErrorId` and `createVectorErrorId`). This ensures consistent error ID patterns (`MASTRA_STORAGE_{STORE}_{OPERATION}_{STATUS}` and `MASTRA_VECTOR_{STORE}_{OPERATION}_{STATUS}`) across the codebase for better error tracking and debugging. ([#10913](https://github.com/mastra-ai/mastra/pull/10913))
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [[`3076c67`](https://github.com/mastra-ai/mastra/commit/3076c6778b18988ae7d5c4c5c466366974b2d63f), [`85d7ee1`](https://github.com/mastra-ai/mastra/commit/85d7ee18ff4e14d625a8a30ec6656bb49804989b), [`c6c1092`](https://github.com/mastra-ai/mastra/commit/c6c1092f8fbf76109303f69e000e96fd1960c4ce), [`81dc110`](https://github.com/mastra-ai/mastra/commit/81dc11008d147cf5bdc8996ead1aa61dbdebb6fc), [`7aedb74`](https://github.com/mastra-ai/mastra/commit/7aedb74883adf66af38e270e4068fd42e7a37036), [`8f02d80`](https://github.com/mastra-ai/mastra/commit/8f02d800777397e4b45d7f1ad041988a8b0c6630), [`d7aad50`](https://github.com/mastra-ai/mastra/commit/d7aad501ce61646b76b4b511e558ac4eea9884d0), [`ce0a73a`](https://github.com/mastra-ai/mastra/commit/ce0a73abeaa75b10ca38f9e40a255a645d50ebfb), [`a02e542`](https://github.com/mastra-ai/mastra/commit/a02e542d23179bad250b044b17ff023caa61739f), [`a372c64`](https://github.com/mastra-ai/mastra/commit/a372c640ad1fd12e8f0613cebdc682fc156b4d95), [`8846867`](https://github.com/mastra-ai/mastra/commit/8846867ffa9a3746767618e314bebac08eb77d87), [`42a42cf`](https://github.com/mastra-ai/mastra/commit/42a42cf3132b9786feecbb8c13c583dce5b0e198), [`ae08bf0`](https://github.com/mastra-ai/mastra/commit/ae08bf0ebc6a4e4da992b711c4a389c32ba84cf4), [`21735a7`](https://github.com/mastra-ai/mastra/commit/21735a7ef306963554a69a89b44f06c3bcd85141), [`1d877b8`](https://github.com/mastra-ai/mastra/commit/1d877b8d7b536a251c1a7a18db7ddcf4f68d6f8b)]:
|
|
48
|
+
- @mastra/core@1.0.0-beta.7
|
|
49
|
+
|
|
3
50
|
## 1.0.0-beta.3
|
|
4
51
|
|
|
5
52
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var client = require('@libsql/client');
|
|
4
4
|
var error = require('@mastra/core/error');
|
|
5
|
+
var storage = require('@mastra/core/storage');
|
|
5
6
|
var utils = require('@mastra/core/utils');
|
|
6
7
|
var vector = require('@mastra/core/vector');
|
|
7
8
|
var filter = require('@mastra/core/vector/filter');
|
|
8
|
-
var storage = require('@mastra/core/storage');
|
|
9
9
|
var agent = require('@mastra/core/agent');
|
|
10
10
|
var evals = require('@mastra/core/evals');
|
|
11
11
|
|
|
@@ -583,7 +583,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
583
583
|
} catch (error$1) {
|
|
584
584
|
throw new error.MastraError(
|
|
585
585
|
{
|
|
586
|
-
id: "
|
|
586
|
+
id: storage.createVectorErrorId("LIBSQL", "QUERY", "INVALID_ARGS"),
|
|
587
587
|
domain: error.ErrorDomain.STORAGE,
|
|
588
588
|
category: error.ErrorCategory.USER
|
|
589
589
|
},
|
|
@@ -625,7 +625,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
625
625
|
} catch (error$1) {
|
|
626
626
|
throw new error.MastraError(
|
|
627
627
|
{
|
|
628
|
-
id: "
|
|
628
|
+
id: storage.createVectorErrorId("LIBSQL", "QUERY", "FAILED"),
|
|
629
629
|
domain: error.ErrorDomain.STORAGE,
|
|
630
630
|
category: error.ErrorCategory.THIRD_PARTY
|
|
631
631
|
},
|
|
@@ -639,7 +639,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
639
639
|
} catch (error$1) {
|
|
640
640
|
throw new error.MastraError(
|
|
641
641
|
{
|
|
642
|
-
id: "
|
|
642
|
+
id: storage.createVectorErrorId("LIBSQL", "UPSERT", "FAILED"),
|
|
643
643
|
domain: error.ErrorDomain.STORAGE,
|
|
644
644
|
category: error.ErrorCategory.THIRD_PARTY
|
|
645
645
|
},
|
|
@@ -693,7 +693,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
693
693
|
} catch (error$1) {
|
|
694
694
|
throw new error.MastraError(
|
|
695
695
|
{
|
|
696
|
-
id: "
|
|
696
|
+
id: storage.createVectorErrorId("LIBSQL", "CREATE_INDEX", "FAILED"),
|
|
697
697
|
domain: error.ErrorDomain.STORAGE,
|
|
698
698
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
699
699
|
details: { indexName: args.indexName, dimension: args.dimension }
|
|
@@ -732,7 +732,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
732
732
|
} catch (error$1) {
|
|
733
733
|
throw new error.MastraError(
|
|
734
734
|
{
|
|
735
|
-
id: "
|
|
735
|
+
id: storage.createVectorErrorId("LIBSQL", "DELETE_INDEX", "FAILED"),
|
|
736
736
|
domain: error.ErrorDomain.STORAGE,
|
|
737
737
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
738
738
|
details: { indexName: args.indexName }
|
|
@@ -763,7 +763,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
763
763
|
} catch (error$1) {
|
|
764
764
|
throw new error.MastraError(
|
|
765
765
|
{
|
|
766
|
-
id: "
|
|
766
|
+
id: storage.createVectorErrorId("LIBSQL", "LIST_INDEXES", "FAILED"),
|
|
767
767
|
domain: error.ErrorDomain.STORAGE,
|
|
768
768
|
category: error.ErrorCategory.THIRD_PARTY
|
|
769
769
|
},
|
|
@@ -811,7 +811,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
811
811
|
} catch (e) {
|
|
812
812
|
throw new error.MastraError(
|
|
813
813
|
{
|
|
814
|
-
id: "
|
|
814
|
+
id: storage.createVectorErrorId("LIBSQL", "DESCRIBE_INDEX", "FAILED"),
|
|
815
815
|
domain: error.ErrorDomain.STORAGE,
|
|
816
816
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
817
817
|
details: { indexName }
|
|
@@ -839,7 +839,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
839
839
|
const parsedIndexName = utils.parseSqlIdentifier(indexName, "index name");
|
|
840
840
|
if ("id" in params && params.id && "filter" in params && params.filter) {
|
|
841
841
|
throw new error.MastraError({
|
|
842
|
-
id: "
|
|
842
|
+
id: storage.createVectorErrorId("LIBSQL", "UPDATE_VECTOR", "MUTUALLY_EXCLUSIVE"),
|
|
843
843
|
domain: error.ErrorDomain.STORAGE,
|
|
844
844
|
category: error.ErrorCategory.USER,
|
|
845
845
|
details: { indexName },
|
|
@@ -848,7 +848,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
848
848
|
}
|
|
849
849
|
if (!update.vector && !update.metadata) {
|
|
850
850
|
throw new error.MastraError({
|
|
851
|
-
id: "
|
|
851
|
+
id: storage.createVectorErrorId("LIBSQL", "UPDATE_VECTOR", "NO_PAYLOAD"),
|
|
852
852
|
domain: error.ErrorDomain.STORAGE,
|
|
853
853
|
category: error.ErrorCategory.USER,
|
|
854
854
|
details: { indexName },
|
|
@@ -877,7 +877,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
877
877
|
const filter = params.filter;
|
|
878
878
|
if (!filter || Object.keys(filter).length === 0) {
|
|
879
879
|
throw new error.MastraError({
|
|
880
|
-
id: "
|
|
880
|
+
id: storage.createVectorErrorId("LIBSQL", "UPDATE_VECTOR", "EMPTY_FILTER"),
|
|
881
881
|
domain: error.ErrorDomain.STORAGE,
|
|
882
882
|
category: error.ErrorCategory.USER,
|
|
883
883
|
details: { indexName },
|
|
@@ -888,7 +888,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
888
888
|
const { sql: filterSql, values: filterValues } = buildFilterQuery(translatedFilter);
|
|
889
889
|
if (!filterSql || filterSql.trim() === "") {
|
|
890
890
|
throw new error.MastraError({
|
|
891
|
-
id: "
|
|
891
|
+
id: storage.createVectorErrorId("LIBSQL", "UPDATE_VECTOR", "INVALID_FILTER"),
|
|
892
892
|
domain: error.ErrorDomain.STORAGE,
|
|
893
893
|
category: error.ErrorCategory.USER,
|
|
894
894
|
details: { indexName },
|
|
@@ -899,7 +899,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
899
899
|
const matchAllPatterns = ["true", "1 = 1", "1=1"];
|
|
900
900
|
if (matchAllPatterns.includes(normalizedCondition)) {
|
|
901
901
|
throw new error.MastraError({
|
|
902
|
-
id: "
|
|
902
|
+
id: storage.createVectorErrorId("LIBSQL", "UPDATE_VECTOR", "MATCH_ALL_FILTER"),
|
|
903
903
|
domain: error.ErrorDomain.STORAGE,
|
|
904
904
|
category: error.ErrorCategory.USER,
|
|
905
905
|
details: { indexName, filterSql: normalizedCondition },
|
|
@@ -910,7 +910,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
910
910
|
whereValues = filterValues;
|
|
911
911
|
} else {
|
|
912
912
|
throw new error.MastraError({
|
|
913
|
-
id: "
|
|
913
|
+
id: storage.createVectorErrorId("LIBSQL", "UPDATE_VECTOR", "NO_TARGET"),
|
|
914
914
|
domain: error.ErrorDomain.STORAGE,
|
|
915
915
|
category: error.ErrorCategory.USER,
|
|
916
916
|
details: { indexName },
|
|
@@ -937,7 +937,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
937
937
|
}
|
|
938
938
|
throw new error.MastraError(
|
|
939
939
|
{
|
|
940
|
-
id: "
|
|
940
|
+
id: storage.createVectorErrorId("LIBSQL", "UPDATE_VECTOR", "FAILED"),
|
|
941
941
|
domain: error.ErrorDomain.STORAGE,
|
|
942
942
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
943
943
|
details: errorDetails
|
|
@@ -959,7 +959,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
959
959
|
} catch (error$1) {
|
|
960
960
|
throw new error.MastraError(
|
|
961
961
|
{
|
|
962
|
-
id: "
|
|
962
|
+
id: storage.createVectorErrorId("LIBSQL", "DELETE_VECTOR", "FAILED"),
|
|
963
963
|
domain: error.ErrorDomain.STORAGE,
|
|
964
964
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
965
965
|
details: {
|
|
@@ -985,7 +985,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
985
985
|
const parsedIndexName = utils.parseSqlIdentifier(indexName, "index name");
|
|
986
986
|
if (!filter && !ids) {
|
|
987
987
|
throw new error.MastraError({
|
|
988
|
-
id: "
|
|
988
|
+
id: storage.createVectorErrorId("LIBSQL", "DELETE_VECTORS", "NO_TARGET"),
|
|
989
989
|
domain: error.ErrorDomain.STORAGE,
|
|
990
990
|
category: error.ErrorCategory.USER,
|
|
991
991
|
details: { indexName },
|
|
@@ -994,7 +994,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
994
994
|
}
|
|
995
995
|
if (filter && ids) {
|
|
996
996
|
throw new error.MastraError({
|
|
997
|
-
id: "
|
|
997
|
+
id: storage.createVectorErrorId("LIBSQL", "DELETE_VECTORS", "MUTUALLY_EXCLUSIVE"),
|
|
998
998
|
domain: error.ErrorDomain.STORAGE,
|
|
999
999
|
category: error.ErrorCategory.USER,
|
|
1000
1000
|
details: { indexName },
|
|
@@ -1006,7 +1006,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
1006
1006
|
if (ids) {
|
|
1007
1007
|
if (ids.length === 0) {
|
|
1008
1008
|
throw new error.MastraError({
|
|
1009
|
-
id: "
|
|
1009
|
+
id: storage.createVectorErrorId("LIBSQL", "DELETE_VECTORS", "EMPTY_IDS"),
|
|
1010
1010
|
domain: error.ErrorDomain.STORAGE,
|
|
1011
1011
|
category: error.ErrorCategory.USER,
|
|
1012
1012
|
details: { indexName },
|
|
@@ -1019,7 +1019,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
1019
1019
|
} else {
|
|
1020
1020
|
if (!filter || Object.keys(filter).length === 0) {
|
|
1021
1021
|
throw new error.MastraError({
|
|
1022
|
-
id: "
|
|
1022
|
+
id: storage.createVectorErrorId("LIBSQL", "DELETE_VECTORS", "EMPTY_FILTER"),
|
|
1023
1023
|
domain: error.ErrorDomain.STORAGE,
|
|
1024
1024
|
category: error.ErrorCategory.USER,
|
|
1025
1025
|
details: { indexName },
|
|
@@ -1030,7 +1030,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
1030
1030
|
const { sql: filterSql, values: filterValues } = buildFilterQuery(translatedFilter);
|
|
1031
1031
|
if (!filterSql || filterSql.trim() === "") {
|
|
1032
1032
|
throw new error.MastraError({
|
|
1033
|
-
id: "
|
|
1033
|
+
id: storage.createVectorErrorId("LIBSQL", "DELETE_VECTORS", "INVALID_FILTER"),
|
|
1034
1034
|
domain: error.ErrorDomain.STORAGE,
|
|
1035
1035
|
category: error.ErrorCategory.USER,
|
|
1036
1036
|
details: { indexName },
|
|
@@ -1041,7 +1041,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
1041
1041
|
const matchAllPatterns = ["true", "1 = 1", "1=1"];
|
|
1042
1042
|
if (matchAllPatterns.includes(normalizedCondition)) {
|
|
1043
1043
|
throw new error.MastraError({
|
|
1044
|
-
id: "
|
|
1044
|
+
id: storage.createVectorErrorId("LIBSQL", "DELETE_VECTORS", "MATCH_ALL_FILTER"),
|
|
1045
1045
|
domain: error.ErrorDomain.STORAGE,
|
|
1046
1046
|
category: error.ErrorCategory.USER,
|
|
1047
1047
|
details: { indexName, filterSql: normalizedCondition },
|
|
@@ -1059,7 +1059,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
1059
1059
|
} catch (error$1) {
|
|
1060
1060
|
throw new error.MastraError(
|
|
1061
1061
|
{
|
|
1062
|
-
id: "
|
|
1062
|
+
id: storage.createVectorErrorId("LIBSQL", "DELETE_VECTORS", "FAILED"),
|
|
1063
1063
|
domain: error.ErrorDomain.STORAGE,
|
|
1064
1064
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1065
1065
|
details: {
|
|
@@ -1078,7 +1078,7 @@ var LibSQLVector = class extends vector.MastraVector {
|
|
|
1078
1078
|
} catch (error$1) {
|
|
1079
1079
|
throw new error.MastraError(
|
|
1080
1080
|
{
|
|
1081
|
-
id: "
|
|
1081
|
+
id: storage.createVectorErrorId("LIBSQL", "TRUNCATE_INDEX", "FAILED"),
|
|
1082
1082
|
domain: error.ErrorDomain.STORAGE,
|
|
1083
1083
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1084
1084
|
details: { indexName: args.indexName }
|
|
@@ -1187,7 +1187,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1187
1187
|
} catch (error$1) {
|
|
1188
1188
|
throw new error.MastraError(
|
|
1189
1189
|
{
|
|
1190
|
-
id: "
|
|
1190
|
+
id: storage.createStorageErrorId("LIBSQL", "LIST_MESSAGES_BY_ID", "FAILED"),
|
|
1191
1191
|
domain: error.ErrorDomain.STORAGE,
|
|
1192
1192
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1193
1193
|
details: { messageIds: JSON.stringify(messageIds) }
|
|
@@ -1202,7 +1202,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1202
1202
|
if (threadIds.length === 0 || threadIds.some((id) => !id.trim())) {
|
|
1203
1203
|
throw new error.MastraError(
|
|
1204
1204
|
{
|
|
1205
|
-
id: "
|
|
1205
|
+
id: storage.createStorageErrorId("LIBSQL", "LIST_MESSAGES", "INVALID_THREAD_ID"),
|
|
1206
1206
|
domain: error.ErrorDomain.STORAGE,
|
|
1207
1207
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1208
1208
|
details: { threadId: Array.isArray(threadId) ? threadId.join(",") : threadId }
|
|
@@ -1213,7 +1213,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1213
1213
|
if (page < 0) {
|
|
1214
1214
|
throw new error.MastraError(
|
|
1215
1215
|
{
|
|
1216
|
-
id: "
|
|
1216
|
+
id: storage.createStorageErrorId("LIBSQL", "LIST_MESSAGES", "INVALID_PAGE"),
|
|
1217
1217
|
domain: error.ErrorDomain.STORAGE,
|
|
1218
1218
|
category: error.ErrorCategory.USER,
|
|
1219
1219
|
details: { page }
|
|
@@ -1305,7 +1305,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1305
1305
|
} catch (error$1) {
|
|
1306
1306
|
const mastraError = new error.MastraError(
|
|
1307
1307
|
{
|
|
1308
|
-
id: "
|
|
1308
|
+
id: storage.createStorageErrorId("LIBSQL", "LIST_MESSAGES", "FAILED"),
|
|
1309
1309
|
domain: error.ErrorDomain.STORAGE,
|
|
1310
1310
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1311
1311
|
details: {
|
|
@@ -1388,7 +1388,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1388
1388
|
} catch (error$1) {
|
|
1389
1389
|
throw new error.MastraError(
|
|
1390
1390
|
{
|
|
1391
|
-
id: "
|
|
1391
|
+
id: storage.createStorageErrorId("LIBSQL", "SAVE_MESSAGES", "FAILED"),
|
|
1392
1392
|
domain: error.ErrorDomain.STORAGE,
|
|
1393
1393
|
category: error.ErrorCategory.THIRD_PARTY
|
|
1394
1394
|
},
|
|
@@ -1516,7 +1516,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1516
1516
|
} catch (error$1) {
|
|
1517
1517
|
throw new error.MastraError(
|
|
1518
1518
|
{
|
|
1519
|
-
id: "
|
|
1519
|
+
id: storage.createStorageErrorId("LIBSQL", "DELETE_MESSAGES", "FAILED"),
|
|
1520
1520
|
domain: error.ErrorDomain.STORAGE,
|
|
1521
1521
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1522
1522
|
details: { messageIds: messageIds.join(", ") }
|
|
@@ -1614,7 +1614,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1614
1614
|
} catch (error$1) {
|
|
1615
1615
|
throw new error.MastraError(
|
|
1616
1616
|
{
|
|
1617
|
-
id: "
|
|
1617
|
+
id: storage.createStorageErrorId("LIBSQL", "GET_THREAD_BY_ID", "FAILED"),
|
|
1618
1618
|
domain: error.ErrorDomain.STORAGE,
|
|
1619
1619
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1620
1620
|
details: { threadId }
|
|
@@ -1628,7 +1628,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1628
1628
|
if (page < 0) {
|
|
1629
1629
|
throw new error.MastraError(
|
|
1630
1630
|
{
|
|
1631
|
-
id: "
|
|
1631
|
+
id: storage.createStorageErrorId("LIBSQL", "LIST_THREADS_BY_RESOURCE_ID", "INVALID_PAGE"),
|
|
1632
1632
|
domain: error.ErrorDomain.STORAGE,
|
|
1633
1633
|
category: error.ErrorCategory.USER,
|
|
1634
1634
|
details: { page }
|
|
@@ -1682,7 +1682,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1682
1682
|
} catch (error$1) {
|
|
1683
1683
|
const mastraError = new error.MastraError(
|
|
1684
1684
|
{
|
|
1685
|
-
id: "
|
|
1685
|
+
id: storage.createStorageErrorId("LIBSQL", "LIST_THREADS_BY_RESOURCE_ID", "FAILED"),
|
|
1686
1686
|
domain: error.ErrorDomain.STORAGE,
|
|
1687
1687
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1688
1688
|
details: { resourceId }
|
|
@@ -1713,7 +1713,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1713
1713
|
} catch (error$1) {
|
|
1714
1714
|
const mastraError = new error.MastraError(
|
|
1715
1715
|
{
|
|
1716
|
-
id: "
|
|
1716
|
+
id: storage.createStorageErrorId("LIBSQL", "SAVE_THREAD", "FAILED"),
|
|
1717
1717
|
domain: error.ErrorDomain.STORAGE,
|
|
1718
1718
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1719
1719
|
details: { threadId: thread.id }
|
|
@@ -1733,7 +1733,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1733
1733
|
const thread = await this.getThreadById({ threadId: id });
|
|
1734
1734
|
if (!thread) {
|
|
1735
1735
|
throw new error.MastraError({
|
|
1736
|
-
id: "
|
|
1736
|
+
id: storage.createStorageErrorId("LIBSQL", "UPDATE_THREAD", "NOT_FOUND"),
|
|
1737
1737
|
domain: error.ErrorDomain.STORAGE,
|
|
1738
1738
|
category: error.ErrorCategory.USER,
|
|
1739
1739
|
text: `Thread ${id} not found`,
|
|
@@ -1760,7 +1760,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1760
1760
|
} catch (error$1) {
|
|
1761
1761
|
throw new error.MastraError(
|
|
1762
1762
|
{
|
|
1763
|
-
id: "
|
|
1763
|
+
id: storage.createStorageErrorId("LIBSQL", "UPDATE_THREAD", "FAILED"),
|
|
1764
1764
|
domain: error.ErrorDomain.STORAGE,
|
|
1765
1765
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1766
1766
|
text: `Failed to update thread ${id}`,
|
|
@@ -1783,7 +1783,7 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
1783
1783
|
} catch (error$1) {
|
|
1784
1784
|
throw new error.MastraError(
|
|
1785
1785
|
{
|
|
1786
|
-
id: "
|
|
1786
|
+
id: storage.createStorageErrorId("LIBSQL", "DELETE_THREAD", "FAILED"),
|
|
1787
1787
|
domain: error.ErrorDomain.STORAGE,
|
|
1788
1788
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1789
1789
|
details: { threadId }
|
|
@@ -1980,7 +1980,7 @@ var ObservabilityLibSQL = class extends storage.ObservabilityStorage {
|
|
|
1980
1980
|
} catch (error$1) {
|
|
1981
1981
|
throw new error.MastraError(
|
|
1982
1982
|
{
|
|
1983
|
-
id: "
|
|
1983
|
+
id: storage.createStorageErrorId("LIBSQL", "CREATE_SPAN", "FAILED"),
|
|
1984
1984
|
domain: error.ErrorDomain.STORAGE,
|
|
1985
1985
|
category: error.ErrorCategory.USER,
|
|
1986
1986
|
details: {
|
|
@@ -2011,7 +2011,7 @@ var ObservabilityLibSQL = class extends storage.ObservabilityStorage {
|
|
|
2011
2011
|
} catch (error$1) {
|
|
2012
2012
|
throw new error.MastraError(
|
|
2013
2013
|
{
|
|
2014
|
-
id: "
|
|
2014
|
+
id: storage.createStorageErrorId("LIBSQL", "GET_TRACE", "FAILED"),
|
|
2015
2015
|
domain: error.ErrorDomain.STORAGE,
|
|
2016
2016
|
category: error.ErrorCategory.USER,
|
|
2017
2017
|
details: {
|
|
@@ -2036,7 +2036,7 @@ var ObservabilityLibSQL = class extends storage.ObservabilityStorage {
|
|
|
2036
2036
|
} catch (error$1) {
|
|
2037
2037
|
throw new error.MastraError(
|
|
2038
2038
|
{
|
|
2039
|
-
id: "
|
|
2039
|
+
id: storage.createStorageErrorId("LIBSQL", "UPDATE_SPAN", "FAILED"),
|
|
2040
2040
|
domain: error.ErrorDomain.STORAGE,
|
|
2041
2041
|
category: error.ErrorCategory.USER,
|
|
2042
2042
|
details: {
|
|
@@ -2071,7 +2071,7 @@ var ObservabilityLibSQL = class extends storage.ObservabilityStorage {
|
|
|
2071
2071
|
name = `agent run: '${entityId}'`;
|
|
2072
2072
|
} else {
|
|
2073
2073
|
const error$1 = new error.MastraError({
|
|
2074
|
-
id: "
|
|
2074
|
+
id: storage.createStorageErrorId("LIBSQL", "GET_TRACES_PAGINATED", "INVALID_ENTITY_TYPE"),
|
|
2075
2075
|
domain: error.ErrorDomain.STORAGE,
|
|
2076
2076
|
category: error.ErrorCategory.USER,
|
|
2077
2077
|
details: {
|
|
@@ -2099,7 +2099,7 @@ var ObservabilityLibSQL = class extends storage.ObservabilityStorage {
|
|
|
2099
2099
|
} catch (error$1) {
|
|
2100
2100
|
throw new error.MastraError(
|
|
2101
2101
|
{
|
|
2102
|
-
id: "
|
|
2102
|
+
id: storage.createStorageErrorId("LIBSQL", "GET_TRACES_PAGINATED", "COUNT_FAILED"),
|
|
2103
2103
|
domain: error.ErrorDomain.STORAGE,
|
|
2104
2104
|
category: error.ErrorCategory.USER
|
|
2105
2105
|
},
|
|
@@ -2140,7 +2140,7 @@ var ObservabilityLibSQL = class extends storage.ObservabilityStorage {
|
|
|
2140
2140
|
} catch (error$1) {
|
|
2141
2141
|
throw new error.MastraError(
|
|
2142
2142
|
{
|
|
2143
|
-
id: "
|
|
2143
|
+
id: storage.createStorageErrorId("LIBSQL", "GET_TRACES_PAGINATED", "FAILED"),
|
|
2144
2144
|
domain: error.ErrorDomain.STORAGE,
|
|
2145
2145
|
category: error.ErrorCategory.USER
|
|
2146
2146
|
},
|
|
@@ -2162,7 +2162,7 @@ var ObservabilityLibSQL = class extends storage.ObservabilityStorage {
|
|
|
2162
2162
|
} catch (error$1) {
|
|
2163
2163
|
throw new error.MastraError(
|
|
2164
2164
|
{
|
|
2165
|
-
id: "
|
|
2165
|
+
id: storage.createStorageErrorId("LIBSQL", "BATCH_CREATE_SPANS", "FAILED"),
|
|
2166
2166
|
domain: error.ErrorDomain.STORAGE,
|
|
2167
2167
|
category: error.ErrorCategory.USER
|
|
2168
2168
|
},
|
|
@@ -2182,7 +2182,7 @@ var ObservabilityLibSQL = class extends storage.ObservabilityStorage {
|
|
|
2182
2182
|
} catch (error$1) {
|
|
2183
2183
|
throw new error.MastraError(
|
|
2184
2184
|
{
|
|
2185
|
-
id: "
|
|
2185
|
+
id: storage.createStorageErrorId("LIBSQL", "BATCH_UPDATE_SPANS", "FAILED"),
|
|
2186
2186
|
domain: error.ErrorDomain.STORAGE,
|
|
2187
2187
|
category: error.ErrorCategory.USER
|
|
2188
2188
|
},
|
|
@@ -2200,7 +2200,7 @@ var ObservabilityLibSQL = class extends storage.ObservabilityStorage {
|
|
|
2200
2200
|
} catch (error$1) {
|
|
2201
2201
|
throw new error.MastraError(
|
|
2202
2202
|
{
|
|
2203
|
-
id: "
|
|
2203
|
+
id: storage.createStorageErrorId("LIBSQL", "BATCH_DELETE_TRACES", "FAILED"),
|
|
2204
2204
|
domain: error.ErrorDomain.STORAGE,
|
|
2205
2205
|
category: error.ErrorCategory.USER
|
|
2206
2206
|
},
|
|
@@ -2276,7 +2276,7 @@ var StoreOperationsLibSQL = class extends storage.StoreOperations {
|
|
|
2276
2276
|
} catch (error$1) {
|
|
2277
2277
|
throw new error.MastraError(
|
|
2278
2278
|
{
|
|
2279
|
-
id: "
|
|
2279
|
+
id: storage.createStorageErrorId("LIBSQL", "CREATE_TABLE", "FAILED"),
|
|
2280
2280
|
domain: error.ErrorDomain.STORAGE,
|
|
2281
2281
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2282
2282
|
details: {
|
|
@@ -2420,7 +2420,7 @@ var StoreOperationsLibSQL = class extends storage.StoreOperations {
|
|
|
2420
2420
|
).catch((error$1) => {
|
|
2421
2421
|
throw new error.MastraError(
|
|
2422
2422
|
{
|
|
2423
|
-
id: "
|
|
2423
|
+
id: storage.createStorageErrorId("LIBSQL", "BATCH_INSERT", "FAILED"),
|
|
2424
2424
|
domain: error.ErrorDomain.STORAGE,
|
|
2425
2425
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2426
2426
|
details: {
|
|
@@ -2446,7 +2446,7 @@ var StoreOperationsLibSQL = class extends storage.StoreOperations {
|
|
|
2446
2446
|
).catch((error$1) => {
|
|
2447
2447
|
throw new error.MastraError(
|
|
2448
2448
|
{
|
|
2449
|
-
id: "
|
|
2449
|
+
id: storage.createStorageErrorId("LIBSQL", "BATCH_UPDATE", "FAILED"),
|
|
2450
2450
|
domain: error.ErrorDomain.STORAGE,
|
|
2451
2451
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2452
2452
|
details: {
|
|
@@ -2489,7 +2489,7 @@ var StoreOperationsLibSQL = class extends storage.StoreOperations {
|
|
|
2489
2489
|
).catch((error$1) => {
|
|
2490
2490
|
throw new error.MastraError(
|
|
2491
2491
|
{
|
|
2492
|
-
id: "
|
|
2492
|
+
id: storage.createStorageErrorId("LIBSQL", "BATCH_DELETE", "FAILED"),
|
|
2493
2493
|
domain: error.ErrorDomain.STORAGE,
|
|
2494
2494
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2495
2495
|
details: {
|
|
@@ -2546,7 +2546,7 @@ var StoreOperationsLibSQL = class extends storage.StoreOperations {
|
|
|
2546
2546
|
} catch (error$1) {
|
|
2547
2547
|
throw new error.MastraError(
|
|
2548
2548
|
{
|
|
2549
|
-
id: "
|
|
2549
|
+
id: storage.createStorageErrorId("LIBSQL", "ALTER_TABLE", "FAILED"),
|
|
2550
2550
|
domain: error.ErrorDomain.STORAGE,
|
|
2551
2551
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2552
2552
|
details: {
|
|
@@ -2564,7 +2564,7 @@ var StoreOperationsLibSQL = class extends storage.StoreOperations {
|
|
|
2564
2564
|
} catch (e) {
|
|
2565
2565
|
const mastraError = new error.MastraError(
|
|
2566
2566
|
{
|
|
2567
|
-
id: "
|
|
2567
|
+
id: storage.createStorageErrorId("LIBSQL", "CLEAR_TABLE", "FAILED"),
|
|
2568
2568
|
domain: error.ErrorDomain.STORAGE,
|
|
2569
2569
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2570
2570
|
details: {
|
|
@@ -2584,7 +2584,7 @@ var StoreOperationsLibSQL = class extends storage.StoreOperations {
|
|
|
2584
2584
|
} catch (e) {
|
|
2585
2585
|
throw new error.MastraError(
|
|
2586
2586
|
{
|
|
2587
|
-
id: "
|
|
2587
|
+
id: storage.createStorageErrorId("LIBSQL", "DROP_TABLE", "FAILED"),
|
|
2588
2588
|
domain: error.ErrorDomain.STORAGE,
|
|
2589
2589
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2590
2590
|
details: {
|
|
@@ -2647,7 +2647,7 @@ var ScoresLibSQL = class extends storage.ScoresStorage {
|
|
|
2647
2647
|
} catch (error$1) {
|
|
2648
2648
|
throw new error.MastraError(
|
|
2649
2649
|
{
|
|
2650
|
-
id: "
|
|
2650
|
+
id: storage.createStorageErrorId("LIBSQL", "LIST_SCORES_BY_RUN_ID", "FAILED"),
|
|
2651
2651
|
domain: error.ErrorDomain.STORAGE,
|
|
2652
2652
|
category: error.ErrorCategory.THIRD_PARTY
|
|
2653
2653
|
},
|
|
@@ -2720,7 +2720,7 @@ var ScoresLibSQL = class extends storage.ScoresStorage {
|
|
|
2720
2720
|
} catch (error$1) {
|
|
2721
2721
|
throw new error.MastraError(
|
|
2722
2722
|
{
|
|
2723
|
-
id: "
|
|
2723
|
+
id: storage.createStorageErrorId("LIBSQL", "LIST_SCORES_BY_SCORER_ID", "FAILED"),
|
|
2724
2724
|
domain: error.ErrorDomain.STORAGE,
|
|
2725
2725
|
category: error.ErrorCategory.THIRD_PARTY
|
|
2726
2726
|
},
|
|
@@ -2751,15 +2751,15 @@ var ScoresLibSQL = class extends storage.ScoresStorage {
|
|
|
2751
2751
|
} catch (error$1) {
|
|
2752
2752
|
throw new error.MastraError(
|
|
2753
2753
|
{
|
|
2754
|
-
id: "
|
|
2754
|
+
id: storage.createStorageErrorId("LIBSQL", "SAVE_SCORE", "VALIDATION_FAILED"),
|
|
2755
2755
|
domain: error.ErrorDomain.STORAGE,
|
|
2756
2756
|
category: error.ErrorCategory.USER,
|
|
2757
2757
|
details: {
|
|
2758
|
-
scorer: score.scorer
|
|
2759
|
-
entityId: score.entityId,
|
|
2760
|
-
entityType: score.entityType,
|
|
2761
|
-
traceId: score.traceId
|
|
2762
|
-
spanId: score.spanId
|
|
2758
|
+
scorer: score.scorer?.id ?? "unknown",
|
|
2759
|
+
entityId: score.entityId ?? "unknown",
|
|
2760
|
+
entityType: score.entityType ?? "unknown",
|
|
2761
|
+
traceId: score.traceId ?? "",
|
|
2762
|
+
spanId: score.spanId ?? ""
|
|
2763
2763
|
}
|
|
2764
2764
|
},
|
|
2765
2765
|
error$1
|
|
@@ -2767,21 +2767,21 @@ var ScoresLibSQL = class extends storage.ScoresStorage {
|
|
|
2767
2767
|
}
|
|
2768
2768
|
try {
|
|
2769
2769
|
const id = crypto.randomUUID();
|
|
2770
|
+
const now = /* @__PURE__ */ new Date();
|
|
2770
2771
|
await this.operations.insert({
|
|
2771
2772
|
tableName: storage.TABLE_SCORERS,
|
|
2772
2773
|
record: {
|
|
2774
|
+
...parsedScore,
|
|
2773
2775
|
id,
|
|
2774
|
-
createdAt:
|
|
2775
|
-
updatedAt:
|
|
2776
|
-
...parsedScore
|
|
2776
|
+
createdAt: now.toISOString(),
|
|
2777
|
+
updatedAt: now.toISOString()
|
|
2777
2778
|
}
|
|
2778
2779
|
});
|
|
2779
|
-
|
|
2780
|
-
return { score: scoreFromDb };
|
|
2780
|
+
return { score: { ...parsedScore, id, createdAt: now, updatedAt: now } };
|
|
2781
2781
|
} catch (error$1) {
|
|
2782
2782
|
throw new error.MastraError(
|
|
2783
2783
|
{
|
|
2784
|
-
id: "
|
|
2784
|
+
id: storage.createStorageErrorId("LIBSQL", "SAVE_SCORE", "FAILED"),
|
|
2785
2785
|
domain: error.ErrorDomain.STORAGE,
|
|
2786
2786
|
category: error.ErrorCategory.THIRD_PARTY
|
|
2787
2787
|
},
|
|
@@ -2833,7 +2833,7 @@ var ScoresLibSQL = class extends storage.ScoresStorage {
|
|
|
2833
2833
|
} catch (error$1) {
|
|
2834
2834
|
throw new error.MastraError(
|
|
2835
2835
|
{
|
|
2836
|
-
id: "
|
|
2836
|
+
id: storage.createStorageErrorId("LIBSQL", "LIST_SCORES_BY_ENTITY_ID", "FAILED"),
|
|
2837
2837
|
domain: error.ErrorDomain.STORAGE,
|
|
2838
2838
|
category: error.ErrorCategory.THIRD_PARTY
|
|
2839
2839
|
},
|
|
@@ -2874,7 +2874,7 @@ var ScoresLibSQL = class extends storage.ScoresStorage {
|
|
|
2874
2874
|
} catch (error$1) {
|
|
2875
2875
|
throw new error.MastraError(
|
|
2876
2876
|
{
|
|
2877
|
-
id: "
|
|
2877
|
+
id: storage.createStorageErrorId("LIBSQL", "LIST_SCORES_BY_SPAN", "FAILED"),
|
|
2878
2878
|
domain: error.ErrorDomain.STORAGE,
|
|
2879
2879
|
category: error.ErrorCategory.THIRD_PARTY
|
|
2880
2880
|
},
|
|
@@ -3124,7 +3124,7 @@ var WorkflowsLibSQL = class extends storage.WorkflowsStorage {
|
|
|
3124
3124
|
} catch (error$1) {
|
|
3125
3125
|
throw new error.MastraError(
|
|
3126
3126
|
{
|
|
3127
|
-
id: "
|
|
3127
|
+
id: storage.createStorageErrorId("LIBSQL", "GET_WORKFLOW_RUN_BY_ID", "FAILED"),
|
|
3128
3128
|
domain: error.ErrorDomain.STORAGE,
|
|
3129
3129
|
category: error.ErrorCategory.THIRD_PARTY
|
|
3130
3130
|
},
|
|
@@ -3190,7 +3190,7 @@ var WorkflowsLibSQL = class extends storage.WorkflowsStorage {
|
|
|
3190
3190
|
} catch (error$1) {
|
|
3191
3191
|
throw new error.MastraError(
|
|
3192
3192
|
{
|
|
3193
|
-
id: "
|
|
3193
|
+
id: storage.createStorageErrorId("LIBSQL", "LIST_WORKFLOW_RUNS", "FAILED"),
|
|
3194
3194
|
domain: error.ErrorDomain.STORAGE,
|
|
3195
3195
|
category: error.ErrorCategory.THIRD_PARTY
|
|
3196
3196
|
},
|
|
@@ -3210,7 +3210,7 @@ var LibSQLStore = class extends storage.MastraStorage {
|
|
|
3210
3210
|
if (!config.id || typeof config.id !== "string" || config.id.trim() === "") {
|
|
3211
3211
|
throw new Error("LibSQLStore: id must be provided and cannot be empty.");
|
|
3212
3212
|
}
|
|
3213
|
-
super({ id: config.id, name: `LibSQLStore
|
|
3213
|
+
super({ id: config.id, name: `LibSQLStore`, disableInit: config.disableInit });
|
|
3214
3214
|
this.maxRetries = config.maxRetries ?? 5;
|
|
3215
3215
|
this.initialBackoffMs = config.initialBackoffMs ?? 100;
|
|
3216
3216
|
if ("url" in config) {
|