@mastra/pg 1.0.0-beta.3 → 1.0.0-beta.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.
package/dist/index.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  var error = require('@mastra/core/error');
4
+ var storage = require('@mastra/core/storage');
4
5
  var utils = require('@mastra/core/utils');
5
6
  var vector = require('@mastra/core/vector');
6
7
  var asyncMutex = require('async-mutex');
7
8
  var pg = require('pg');
8
9
  var xxhash = require('xxhash-wasm');
9
10
  var filter = require('@mastra/core/vector/filter');
10
- var storage = require('@mastra/core/storage');
11
11
  var pgPromise = require('pg-promise');
12
12
  var agent = require('@mastra/core/agent');
13
13
  var evals = require('@mastra/core/evals');
@@ -576,7 +576,7 @@ var PgVector = class extends vector.MastraVector {
576
576
  } catch (error$1) {
577
577
  throw new error.MastraError(
578
578
  {
579
- id: "MASTRA_STORAGE_PG_VECTOR_INITIALIZATION_FAILED",
579
+ id: storage.createVectorErrorId("PG", "INITIALIZATION", "FAILED"),
580
580
  domain: error.ErrorDomain.MASTRA_VECTOR,
581
581
  category: error.ErrorCategory.THIRD_PARTY,
582
582
  details: {
@@ -670,7 +670,7 @@ var PgVector = class extends vector.MastraVector {
670
670
  } catch (error$1) {
671
671
  const mastraError = new error.MastraError(
672
672
  {
673
- id: "MASTRA_STORAGE_PG_VECTOR_QUERY_INVALID_INPUT",
673
+ id: storage.createVectorErrorId("PG", "QUERY", "INVALID_INPUT"),
674
674
  domain: error.ErrorDomain.MASTRA_VECTOR,
675
675
  category: error.ErrorCategory.USER,
676
676
  details: {
@@ -726,7 +726,7 @@ var PgVector = class extends vector.MastraVector {
726
726
  await client.query("ROLLBACK");
727
727
  const mastraError = new error.MastraError(
728
728
  {
729
- id: "MASTRA_STORAGE_PG_VECTOR_QUERY_FAILED",
729
+ id: storage.createVectorErrorId("PG", "QUERY", "FAILED"),
730
730
  domain: error.ErrorDomain.MASTRA_VECTOR,
731
731
  category: error.ErrorCategory.THIRD_PARTY,
732
732
  details: {
@@ -795,7 +795,7 @@ var PgVector = class extends vector.MastraVector {
795
795
  const [, expected, actual] = match;
796
796
  const mastraError2 = new error.MastraError(
797
797
  {
798
- id: "MASTRA_STORAGE_PG_VECTOR_UPSERT_INVALID_INPUT",
798
+ id: storage.createVectorErrorId("PG", "UPSERT", "INVALID_INPUT"),
799
799
  domain: error.ErrorDomain.MASTRA_VECTOR,
800
800
  category: error.ErrorCategory.USER,
801
801
  text: `Vector dimension mismatch: Index "${indexName}" expects ${expected} dimensions but got ${actual} dimensions. Either use a matching embedding model or delete and recreate the index with the new dimension.`,
@@ -813,7 +813,7 @@ var PgVector = class extends vector.MastraVector {
813
813
  }
814
814
  const mastraError = new error.MastraError(
815
815
  {
816
- id: "MASTRA_STORAGE_PG_VECTOR_UPSERT_FAILED",
816
+ id: storage.createVectorErrorId("PG", "UPSERT", "FAILED"),
817
817
  domain: error.ErrorDomain.MASTRA_VECTOR,
818
818
  category: error.ErrorCategory.THIRD_PARTY,
819
819
  details: {
@@ -901,7 +901,7 @@ var PgVector = class extends vector.MastraVector {
901
901
  } catch (error$1) {
902
902
  const mastraError = new error.MastraError(
903
903
  {
904
- id: "MASTRA_STORAGE_PG_VECTOR_CREATE_INDEX_INVALID_INPUT",
904
+ id: storage.createVectorErrorId("PG", "CREATE_INDEX", "INVALID_INPUT"),
905
905
  domain: error.ErrorDomain.MASTRA_VECTOR,
906
906
  category: error.ErrorCategory.USER,
907
907
  details: {
@@ -951,7 +951,7 @@ var PgVector = class extends vector.MastraVector {
951
951
  }).catch((error$1) => {
952
952
  const mastraError = new error.MastraError(
953
953
  {
954
- id: "MASTRA_STORAGE_PG_VECTOR_CREATE_INDEX_FAILED",
954
+ id: storage.createVectorErrorId("PG", "CREATE_INDEX", "FAILED"),
955
955
  domain: error.ErrorDomain.MASTRA_VECTOR,
956
956
  category: error.ErrorCategory.THIRD_PARTY,
957
957
  details: {
@@ -971,7 +971,7 @@ var PgVector = class extends vector.MastraVector {
971
971
  } catch (error$1) {
972
972
  const mastraError = new error.MastraError(
973
973
  {
974
- id: "MASTRA_STORAGE_PG_VECTOR_BUILD_INDEX_FAILED",
974
+ id: storage.createVectorErrorId("PG", "BUILD_INDEX", "FAILED"),
975
975
  domain: error.ErrorDomain.MASTRA_VECTOR,
976
976
  category: error.ErrorCategory.THIRD_PARTY,
977
977
  details: {
@@ -1171,7 +1171,7 @@ var PgVector = class extends vector.MastraVector {
1171
1171
  } catch (e) {
1172
1172
  const mastraError = new error.MastraError(
1173
1173
  {
1174
- id: "MASTRA_STORAGE_PG_VECTOR_LIST_INDEXES_FAILED",
1174
+ id: storage.createVectorErrorId("PG", "LIST_INDEXES", "FAILED"),
1175
1175
  domain: error.ErrorDomain.MASTRA_VECTOR,
1176
1176
  category: error.ErrorCategory.THIRD_PARTY
1177
1177
  },
@@ -1260,7 +1260,7 @@ var PgVector = class extends vector.MastraVector {
1260
1260
  await client.query("ROLLBACK");
1261
1261
  const mastraError = new error.MastraError(
1262
1262
  {
1263
- id: "MASTRA_STORAGE_PG_VECTOR_DESCRIBE_INDEX_FAILED",
1263
+ id: storage.createVectorErrorId("PG", "DESCRIBE_INDEX", "FAILED"),
1264
1264
  domain: error.ErrorDomain.MASTRA_VECTOR,
1265
1265
  category: error.ErrorCategory.THIRD_PARTY,
1266
1266
  details: {
@@ -1285,7 +1285,7 @@ var PgVector = class extends vector.MastraVector {
1285
1285
  await client.query("ROLLBACK");
1286
1286
  const mastraError = new error.MastraError(
1287
1287
  {
1288
- id: "MASTRA_STORAGE_PG_VECTOR_DELETE_INDEX_FAILED",
1288
+ id: storage.createVectorErrorId("PG", "DELETE_INDEX", "FAILED"),
1289
1289
  domain: error.ErrorDomain.MASTRA_VECTOR,
1290
1290
  category: error.ErrorCategory.THIRD_PARTY,
1291
1291
  details: {
@@ -1309,7 +1309,7 @@ var PgVector = class extends vector.MastraVector {
1309
1309
  await client.query("ROLLBACK");
1310
1310
  const mastraError = new error.MastraError(
1311
1311
  {
1312
- id: "MASTRA_STORAGE_PG_VECTOR_TRUNCATE_INDEX_FAILED",
1312
+ id: storage.createVectorErrorId("PG", "TRUNCATE_INDEX", "FAILED"),
1313
1313
  domain: error.ErrorDomain.MASTRA_VECTOR,
1314
1314
  category: error.ErrorCategory.THIRD_PARTY,
1315
1315
  details: {
@@ -1351,7 +1351,7 @@ var PgVector = class extends vector.MastraVector {
1351
1351
  }
1352
1352
  if (!id && !filter) {
1353
1353
  throw new error.MastraError({
1354
- id: "MASTRA_STORAGE_PG_VECTOR_UPDATE_MISSING_PARAMS",
1354
+ id: storage.createVectorErrorId("PG", "UPDATE_VECTOR", "NO_TARGET"),
1355
1355
  text: "Either id or filter must be provided",
1356
1356
  domain: error.ErrorDomain.MASTRA_VECTOR,
1357
1357
  category: error.ErrorCategory.USER,
@@ -1360,7 +1360,7 @@ var PgVector = class extends vector.MastraVector {
1360
1360
  }
1361
1361
  if (id && filter) {
1362
1362
  throw new error.MastraError({
1363
- id: "MASTRA_STORAGE_PG_VECTOR_UPDATE_CONFLICTING_PARAMS",
1363
+ id: storage.createVectorErrorId("PG", "UPDATE_VECTOR", "MUTUALLY_EXCLUSIVE"),
1364
1364
  text: "Cannot provide both id and filter - they are mutually exclusive",
1365
1365
  domain: error.ErrorDomain.MASTRA_VECTOR,
1366
1366
  category: error.ErrorCategory.USER,
@@ -1394,7 +1394,7 @@ var PgVector = class extends vector.MastraVector {
1394
1394
  } else {
1395
1395
  if (!filter || Object.keys(filter).length === 0) {
1396
1396
  throw new error.MastraError({
1397
- id: "MASTRA_STORAGE_PG_VECTOR_UPDATE_EMPTY_FILTER",
1397
+ id: storage.createVectorErrorId("PG", "UPDATE_VECTOR", "EMPTY_FILTER"),
1398
1398
  text: "Cannot update with empty filter",
1399
1399
  domain: error.ErrorDomain.MASTRA_VECTOR,
1400
1400
  category: error.ErrorCategory.USER,
@@ -1406,7 +1406,7 @@ var PgVector = class extends vector.MastraVector {
1406
1406
  whereClause = filterQuery.trim().replace(/^WHERE\s+/i, "");
1407
1407
  if (!whereClause) {
1408
1408
  throw new error.MastraError({
1409
- id: "MASTRA_STORAGE_PG_VECTOR_UPDATE_INVALID_FILTER",
1409
+ id: storage.createVectorErrorId("PG", "UPDATE_VECTOR", "INVALID_FILTER"),
1410
1410
  text: "Filter produced empty WHERE clause",
1411
1411
  domain: error.ErrorDomain.MASTRA_VECTOR,
1412
1412
  category: error.ErrorCategory.USER,
@@ -1437,7 +1437,7 @@ var PgVector = class extends vector.MastraVector {
1437
1437
  }
1438
1438
  const mastraError = new error.MastraError(
1439
1439
  {
1440
- id: "MASTRA_STORAGE_PG_VECTOR_UPDATE_VECTOR_FAILED",
1440
+ id: storage.createVectorErrorId("PG", "UPDATE_VECTOR", "FAILED"),
1441
1441
  domain: error.ErrorDomain.MASTRA_VECTOR,
1442
1442
  category: error.ErrorCategory.THIRD_PARTY,
1443
1443
  details: {
@@ -1474,7 +1474,7 @@ var PgVector = class extends vector.MastraVector {
1474
1474
  } catch (error$1) {
1475
1475
  const mastraError = new error.MastraError(
1476
1476
  {
1477
- id: "MASTRA_STORAGE_PG_VECTOR_DELETE_VECTOR_FAILED",
1477
+ id: storage.createVectorErrorId("PG", "DELETE_VECTOR", "FAILED"),
1478
1478
  domain: error.ErrorDomain.MASTRA_VECTOR,
1479
1479
  category: error.ErrorCategory.THIRD_PARTY,
1480
1480
  details: {
@@ -1504,7 +1504,7 @@ var PgVector = class extends vector.MastraVector {
1504
1504
  const { tableName } = this.getTableName(indexName);
1505
1505
  if (!filter && !ids) {
1506
1506
  throw new error.MastraError({
1507
- id: "MASTRA_STORAGE_PG_VECTOR_DELETE_MISSING_PARAMS",
1507
+ id: storage.createVectorErrorId("PG", "DELETE_VECTORS", "NO_TARGET"),
1508
1508
  text: "Either filter or ids must be provided",
1509
1509
  domain: error.ErrorDomain.MASTRA_VECTOR,
1510
1510
  category: error.ErrorCategory.USER,
@@ -1513,7 +1513,7 @@ var PgVector = class extends vector.MastraVector {
1513
1513
  }
1514
1514
  if (filter && ids) {
1515
1515
  throw new error.MastraError({
1516
- id: "MASTRA_STORAGE_PG_VECTOR_DELETE_CONFLICTING_PARAMS",
1516
+ id: storage.createVectorErrorId("PG", "DELETE_VECTORS", "MUTUALLY_EXCLUSIVE"),
1517
1517
  text: "Cannot provide both filter and ids - they are mutually exclusive",
1518
1518
  domain: error.ErrorDomain.MASTRA_VECTOR,
1519
1519
  category: error.ErrorCategory.USER,
@@ -1525,7 +1525,7 @@ var PgVector = class extends vector.MastraVector {
1525
1525
  if (ids) {
1526
1526
  if (ids.length === 0) {
1527
1527
  throw new error.MastraError({
1528
- id: "MASTRA_STORAGE_PG_VECTOR_DELETE_EMPTY_IDS",
1528
+ id: storage.createVectorErrorId("PG", "DELETE_VECTORS", "EMPTY_IDS"),
1529
1529
  text: "Cannot delete with empty ids array",
1530
1530
  domain: error.ErrorDomain.MASTRA_VECTOR,
1531
1531
  category: error.ErrorCategory.USER,
@@ -1538,7 +1538,7 @@ var PgVector = class extends vector.MastraVector {
1538
1538
  } else {
1539
1539
  if (!filter || Object.keys(filter).length === 0) {
1540
1540
  throw new error.MastraError({
1541
- id: "MASTRA_STORAGE_PG_VECTOR_DELETE_EMPTY_FILTER",
1541
+ id: storage.createVectorErrorId("PG", "DELETE_VECTORS", "EMPTY_FILTER"),
1542
1542
  text: "Cannot delete with empty filter. Use deleteIndex to delete all vectors.",
1543
1543
  domain: error.ErrorDomain.MASTRA_VECTOR,
1544
1544
  category: error.ErrorCategory.USER,
@@ -1550,7 +1550,7 @@ var PgVector = class extends vector.MastraVector {
1550
1550
  const whereClause = filterQuery.trim().replace(/^WHERE\s+/i, "");
1551
1551
  if (!whereClause) {
1552
1552
  throw new error.MastraError({
1553
- id: "MASTRA_STORAGE_PG_VECTOR_DELETE_INVALID_FILTER",
1553
+ id: storage.createVectorErrorId("PG", "DELETE_VECTORS", "INVALID_FILTER"),
1554
1554
  text: "Filter produced empty WHERE clause",
1555
1555
  domain: error.ErrorDomain.MASTRA_VECTOR,
1556
1556
  category: error.ErrorCategory.USER,
@@ -1573,7 +1573,7 @@ var PgVector = class extends vector.MastraVector {
1573
1573
  }
1574
1574
  const mastraError = new error.MastraError(
1575
1575
  {
1576
- id: "MASTRA_STORAGE_PG_VECTOR_DELETE_VECTORS_FAILED",
1576
+ id: storage.createVectorErrorId("PG", "DELETE_VECTORS", "FAILED"),
1577
1577
  domain: error.ErrorDomain.MASTRA_VECTOR,
1578
1578
  category: error.ErrorCategory.THIRD_PARTY,
1579
1579
  details: {
@@ -1713,7 +1713,7 @@ var MemoryPG = class extends storage.MemoryStorage {
1713
1713
  } catch (error$1) {
1714
1714
  throw new error.MastraError(
1715
1715
  {
1716
- id: "MASTRA_STORAGE_PG_STORE_GET_THREAD_BY_ID_FAILED",
1716
+ id: storage.createStorageErrorId("PG", "GET_THREAD_BY_ID", "FAILED"),
1717
1717
  domain: error.ErrorDomain.STORAGE,
1718
1718
  category: error.ErrorCategory.THIRD_PARTY,
1719
1719
  details: {
@@ -1728,7 +1728,7 @@ var MemoryPG = class extends storage.MemoryStorage {
1728
1728
  const { resourceId, page = 0, perPage: perPageInput, orderBy } = args;
1729
1729
  if (page < 0) {
1730
1730
  throw new error.MastraError({
1731
- id: "MASTRA_STORAGE_PG_STORE_INVALID_PAGE",
1731
+ id: storage.createStorageErrorId("PG", "LIST_THREADS_BY_RESOURCE_ID", "INVALID_PAGE"),
1732
1732
  domain: error.ErrorDomain.STORAGE,
1733
1733
  category: error.ErrorCategory.USER,
1734
1734
  text: "Page number must be non-negative",
@@ -1777,7 +1777,7 @@ var MemoryPG = class extends storage.MemoryStorage {
1777
1777
  } catch (error$1) {
1778
1778
  const mastraError = new error.MastraError(
1779
1779
  {
1780
- id: "MASTRA_STORAGE_PG_STORE_LIST_THREADS_BY_RESOURCE_ID_FAILED",
1780
+ id: storage.createStorageErrorId("PG", "LIST_THREADS_BY_RESOURCE_ID", "FAILED"),
1781
1781
  domain: error.ErrorDomain.STORAGE,
1782
1782
  category: error.ErrorCategory.THIRD_PARTY,
1783
1783
  details: {
@@ -1835,7 +1835,7 @@ var MemoryPG = class extends storage.MemoryStorage {
1835
1835
  } catch (error$1) {
1836
1836
  throw new error.MastraError(
1837
1837
  {
1838
- id: "MASTRA_STORAGE_PG_STORE_SAVE_THREAD_FAILED",
1838
+ id: storage.createStorageErrorId("PG", "SAVE_THREAD", "FAILED"),
1839
1839
  domain: error.ErrorDomain.STORAGE,
1840
1840
  category: error.ErrorCategory.THIRD_PARTY,
1841
1841
  details: {
@@ -1855,7 +1855,7 @@ var MemoryPG = class extends storage.MemoryStorage {
1855
1855
  const existingThread = await this.getThreadById({ threadId: id });
1856
1856
  if (!existingThread) {
1857
1857
  throw new error.MastraError({
1858
- id: "MASTRA_STORAGE_PG_STORE_UPDATE_THREAD_FAILED",
1858
+ id: storage.createStorageErrorId("PG", "UPDATE_THREAD", "FAILED"),
1859
1859
  domain: error.ErrorDomain.STORAGE,
1860
1860
  category: error.ErrorCategory.USER,
1861
1861
  text: `Thread ${id} not found`,
@@ -1893,7 +1893,7 @@ var MemoryPG = class extends storage.MemoryStorage {
1893
1893
  } catch (error$1) {
1894
1894
  throw new error.MastraError(
1895
1895
  {
1896
- id: "MASTRA_STORAGE_PG_STORE_UPDATE_THREAD_FAILED",
1896
+ id: storage.createStorageErrorId("PG", "UPDATE_THREAD", "FAILED"),
1897
1897
  domain: error.ErrorDomain.STORAGE,
1898
1898
  category: error.ErrorCategory.THIRD_PARTY,
1899
1899
  details: {
@@ -1930,7 +1930,7 @@ var MemoryPG = class extends storage.MemoryStorage {
1930
1930
  } catch (error$1) {
1931
1931
  throw new error.MastraError(
1932
1932
  {
1933
- id: "MASTRA_STORAGE_PG_STORE_DELETE_THREAD_FAILED",
1933
+ id: storage.createStorageErrorId("PG", "DELETE_THREAD", "FAILED"),
1934
1934
  domain: error.ErrorDomain.STORAGE,
1935
1935
  category: error.ErrorCategory.THIRD_PARTY,
1936
1936
  details: {
@@ -2037,7 +2037,7 @@ var MemoryPG = class extends storage.MemoryStorage {
2037
2037
  } catch (error$1) {
2038
2038
  const mastraError = new error.MastraError(
2039
2039
  {
2040
- id: "MASTRA_STORAGE_PG_STORE_LIST_MESSAGES_BY_ID_FAILED",
2040
+ id: storage.createStorageErrorId("PG", "LIST_MESSAGES_BY_ID", "FAILED"),
2041
2041
  domain: error.ErrorDomain.STORAGE,
2042
2042
  category: error.ErrorCategory.THIRD_PARTY,
2043
2043
  details: {
@@ -2059,7 +2059,7 @@ var MemoryPG = class extends storage.MemoryStorage {
2059
2059
  if (threadIds.length === 0 || threadIds.some((id) => !id.trim())) {
2060
2060
  throw new error.MastraError(
2061
2061
  {
2062
- id: "STORAGE_PG_LIST_MESSAGES_INVALID_THREAD_ID",
2062
+ id: storage.createStorageErrorId("PG", "LIST_MESSAGES", "INVALID_THREAD_ID"),
2063
2063
  domain: error.ErrorDomain.STORAGE,
2064
2064
  category: error.ErrorCategory.THIRD_PARTY,
2065
2065
  details: { threadId: Array.isArray(threadId) ? String(threadId) : String(threadId) }
@@ -2069,7 +2069,7 @@ var MemoryPG = class extends storage.MemoryStorage {
2069
2069
  }
2070
2070
  if (page < 0) {
2071
2071
  throw new error.MastraError({
2072
- id: "MASTRA_STORAGE_PG_STORE_INVALID_PAGE",
2072
+ id: storage.createStorageErrorId("PG", "LIST_MESSAGES", "INVALID_PAGE"),
2073
2073
  domain: error.ErrorDomain.STORAGE,
2074
2074
  category: error.ErrorCategory.USER,
2075
2075
  text: "Page number must be non-negative",
@@ -2164,7 +2164,7 @@ var MemoryPG = class extends storage.MemoryStorage {
2164
2164
  } catch (error$1) {
2165
2165
  const mastraError = new error.MastraError(
2166
2166
  {
2167
- id: "MASTRA_STORAGE_PG_STORE_LIST_MESSAGES_FAILED",
2167
+ id: storage.createStorageErrorId("PG", "LIST_MESSAGES", "FAILED"),
2168
2168
  domain: error.ErrorDomain.STORAGE,
2169
2169
  category: error.ErrorCategory.THIRD_PARTY,
2170
2170
  details: {
@@ -2190,7 +2190,7 @@ var MemoryPG = class extends storage.MemoryStorage {
2190
2190
  const threadId = messages[0]?.threadId;
2191
2191
  if (!threadId) {
2192
2192
  throw new error.MastraError({
2193
- id: "MASTRA_STORAGE_PG_STORE_SAVE_MESSAGES_FAILED",
2193
+ id: storage.createStorageErrorId("PG", "SAVE_MESSAGES", "FAILED"),
2194
2194
  domain: error.ErrorDomain.STORAGE,
2195
2195
  category: error.ErrorCategory.THIRD_PARTY,
2196
2196
  text: `Thread ID is required`
@@ -2199,7 +2199,7 @@ var MemoryPG = class extends storage.MemoryStorage {
2199
2199
  const thread = await this.getThreadById({ threadId });
2200
2200
  if (!thread) {
2201
2201
  throw new error.MastraError({
2202
- id: "MASTRA_STORAGE_PG_STORE_SAVE_MESSAGES_FAILED",
2202
+ id: storage.createStorageErrorId("PG", "SAVE_MESSAGES", "FAILED"),
2203
2203
  domain: error.ErrorDomain.STORAGE,
2204
2204
  category: error.ErrorCategory.THIRD_PARTY,
2205
2205
  text: `Thread ${threadId} not found`,
@@ -2270,7 +2270,7 @@ var MemoryPG = class extends storage.MemoryStorage {
2270
2270
  } catch (error$1) {
2271
2271
  throw new error.MastraError(
2272
2272
  {
2273
- id: "MASTRA_STORAGE_PG_STORE_SAVE_MESSAGES_FAILED",
2273
+ id: storage.createStorageErrorId("PG", "SAVE_MESSAGES", "FAILED"),
2274
2274
  domain: error.ErrorDomain.STORAGE,
2275
2275
  category: error.ErrorCategory.THIRD_PARTY,
2276
2276
  details: {
@@ -2399,7 +2399,7 @@ var MemoryPG = class extends storage.MemoryStorage {
2399
2399
  } catch (error$1) {
2400
2400
  throw new error.MastraError(
2401
2401
  {
2402
- id: "PG_STORE_DELETE_MESSAGES_FAILED",
2402
+ id: storage.createStorageErrorId("PG", "DELETE_MESSAGES", "FAILED"),
2403
2403
  domain: error.ErrorDomain.STORAGE,
2404
2404
  category: error.ErrorCategory.THIRD_PARTY,
2405
2405
  details: { messageIds: messageIds.join(", ") }
@@ -2520,7 +2520,7 @@ var ObservabilityPG = class extends storage.ObservabilityStorage {
2520
2520
  } catch (error$1) {
2521
2521
  throw new error.MastraError(
2522
2522
  {
2523
- id: "PG_STORE_CREATE_SPAN_FAILED",
2523
+ id: storage.createStorageErrorId("PG", "CREATE_SPAN", "FAILED"),
2524
2524
  domain: error.ErrorDomain.STORAGE,
2525
2525
  category: error.ErrorCategory.USER,
2526
2526
  details: {
@@ -2566,7 +2566,7 @@ var ObservabilityPG = class extends storage.ObservabilityStorage {
2566
2566
  } catch (error$1) {
2567
2567
  throw new error.MastraError(
2568
2568
  {
2569
- id: "PG_STORE_GET_TRACE_FAILED",
2569
+ id: storage.createStorageErrorId("PG", "GET_TRACE", "FAILED"),
2570
2570
  domain: error.ErrorDomain.STORAGE,
2571
2571
  category: error.ErrorCategory.USER,
2572
2572
  details: {
@@ -2598,7 +2598,7 @@ var ObservabilityPG = class extends storage.ObservabilityStorage {
2598
2598
  } catch (error$1) {
2599
2599
  throw new error.MastraError(
2600
2600
  {
2601
- id: "PG_STORE_UPDATE_SPAN_FAILED",
2601
+ id: storage.createStorageErrorId("PG", "UPDATE_SPAN", "FAILED"),
2602
2602
  domain: error.ErrorDomain.STORAGE,
2603
2603
  category: error.ErrorCategory.USER,
2604
2604
  details: {
@@ -2634,7 +2634,7 @@ var ObservabilityPG = class extends storage.ObservabilityStorage {
2634
2634
  name = `agent run: '${entityId}'`;
2635
2635
  } else {
2636
2636
  const error$1 = new error.MastraError({
2637
- id: "PG_STORE_GET_TRACES_PAGINATED_FAILED",
2637
+ id: storage.createStorageErrorId("PG", "GET_TRACES_PAGINATED", "INVALID_ENTITY_TYPE"),
2638
2638
  domain: error.ErrorDomain.STORAGE,
2639
2639
  category: error.ErrorCategory.USER,
2640
2640
  details: {
@@ -2702,7 +2702,7 @@ var ObservabilityPG = class extends storage.ObservabilityStorage {
2702
2702
  } catch (error$1) {
2703
2703
  throw new error.MastraError(
2704
2704
  {
2705
- id: "PG_STORE_GET_TRACES_PAGINATED_FAILED",
2705
+ id: storage.createStorageErrorId("PG", "GET_TRACES_PAGINATED", "FAILED"),
2706
2706
  domain: error.ErrorDomain.STORAGE,
2707
2707
  category: error.ErrorCategory.USER
2708
2708
  },
@@ -2731,7 +2731,7 @@ var ObservabilityPG = class extends storage.ObservabilityStorage {
2731
2731
  } catch (error$1) {
2732
2732
  throw new error.MastraError(
2733
2733
  {
2734
- id: "PG_STORE_BATCH_CREATE_SPANS_FAILED",
2734
+ id: storage.createStorageErrorId("PG", "BATCH_CREATE_SPANS", "FAILED"),
2735
2735
  domain: error.ErrorDomain.STORAGE,
2736
2736
  category: error.ErrorCategory.USER
2737
2737
  },
@@ -2766,7 +2766,7 @@ var ObservabilityPG = class extends storage.ObservabilityStorage {
2766
2766
  } catch (error$1) {
2767
2767
  throw new error.MastraError(
2768
2768
  {
2769
- id: "PG_STORE_BATCH_UPDATE_SPANS_FAILED",
2769
+ id: storage.createStorageErrorId("PG", "BATCH_UPDATE_SPANS", "FAILED"),
2770
2770
  domain: error.ErrorDomain.STORAGE,
2771
2771
  category: error.ErrorCategory.USER
2772
2772
  },
@@ -2785,7 +2785,7 @@ var ObservabilityPG = class extends storage.ObservabilityStorage {
2785
2785
  } catch (error$1) {
2786
2786
  throw new error.MastraError(
2787
2787
  {
2788
- id: "PG_STORE_BATCH_DELETE_TRACES_FAILED",
2788
+ id: storage.createStorageErrorId("PG", "BATCH_DELETE_TRACES", "FAILED"),
2789
2789
  domain: error.ErrorDomain.STORAGE,
2790
2790
  category: error.ErrorCategory.USER
2791
2791
  },
@@ -2915,7 +2915,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
2915
2915
  } catch (error$1) {
2916
2916
  throw new error.MastraError(
2917
2917
  {
2918
- id: "MASTRA_STORAGE_PG_STORE_INSERT_FAILED",
2918
+ id: storage.createStorageErrorId("PG", "INSERT", "FAILED"),
2919
2919
  domain: error.ErrorDomain.STORAGE,
2920
2920
  category: error.ErrorCategory.THIRD_PARTY,
2921
2921
  details: {
@@ -2934,7 +2934,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
2934
2934
  } catch (error$1) {
2935
2935
  throw new error.MastraError(
2936
2936
  {
2937
- id: "MASTRA_STORAGE_PG_STORE_CLEAR_TABLE_FAILED",
2937
+ id: storage.createStorageErrorId("PG", "CLEAR_TABLE", "FAILED"),
2938
2938
  domain: error.ErrorDomain.STORAGE,
2939
2939
  category: error.ErrorCategory.THIRD_PARTY,
2940
2940
  details: {
@@ -3007,7 +3007,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3007
3007
  } catch (error$1) {
3008
3008
  throw new error.MastraError(
3009
3009
  {
3010
- id: "MASTRA_STORAGE_PG_STORE_CREATE_TABLE_FAILED",
3010
+ id: storage.createStorageErrorId("PG", "CREATE_TABLE", "FAILED"),
3011
3011
  domain: error.ErrorDomain.STORAGE,
3012
3012
  category: error.ErrorCategory.THIRD_PARTY,
3013
3013
  details: {
@@ -3094,7 +3094,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3094
3094
  } catch (error$1) {
3095
3095
  throw new error.MastraError(
3096
3096
  {
3097
- id: "MASTRA_STORAGE_PG_STORE_ALTER_TABLE_FAILED",
3097
+ id: storage.createStorageErrorId("PG", "ALTER_TABLE", "FAILED"),
3098
3098
  domain: error.ErrorDomain.STORAGE,
3099
3099
  category: error.ErrorCategory.THIRD_PARTY,
3100
3100
  details: {
@@ -3128,7 +3128,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3128
3128
  } catch (error$1) {
3129
3129
  throw new error.MastraError(
3130
3130
  {
3131
- id: "MASTRA_STORAGE_PG_STORE_LOAD_FAILED",
3131
+ id: storage.createStorageErrorId("PG", "LOAD", "FAILED"),
3132
3132
  domain: error.ErrorDomain.STORAGE,
3133
3133
  category: error.ErrorCategory.THIRD_PARTY,
3134
3134
  details: {
@@ -3150,7 +3150,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3150
3150
  await this.client.query("ROLLBACK");
3151
3151
  throw new error.MastraError(
3152
3152
  {
3153
- id: "MASTRA_STORAGE_PG_STORE_BATCH_INSERT_FAILED",
3153
+ id: storage.createStorageErrorId("PG", "BATCH_INSERT", "FAILED"),
3154
3154
  domain: error.ErrorDomain.STORAGE,
3155
3155
  category: error.ErrorCategory.THIRD_PARTY,
3156
3156
  details: {
@@ -3170,7 +3170,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3170
3170
  } catch (error$1) {
3171
3171
  throw new error.MastraError(
3172
3172
  {
3173
- id: "MASTRA_STORAGE_PG_STORE_DROP_TABLE_FAILED",
3173
+ id: storage.createStorageErrorId("PG", "DROP_TABLE", "FAILED"),
3174
3174
  domain: error.ErrorDomain.STORAGE,
3175
3175
  category: error.ErrorCategory.THIRD_PARTY,
3176
3176
  details: {
@@ -3243,7 +3243,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3243
3243
  }
3244
3244
  throw new error.MastraError(
3245
3245
  {
3246
- id: "MASTRA_STORAGE_PG_INDEX_CREATE_FAILED",
3246
+ id: storage.createStorageErrorId("PG", "INDEX_CREATE", "FAILED"),
3247
3247
  domain: error.ErrorDomain.STORAGE,
3248
3248
  category: error.ErrorCategory.THIRD_PARTY,
3249
3249
  details: {
@@ -3275,7 +3275,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3275
3275
  } catch (error$1) {
3276
3276
  throw new error.MastraError(
3277
3277
  {
3278
- id: "MASTRA_STORAGE_PG_INDEX_DROP_FAILED",
3278
+ id: storage.createStorageErrorId("PG", "INDEX_DROP", "FAILED"),
3279
3279
  domain: error.ErrorDomain.STORAGE,
3280
3280
  category: error.ErrorCategory.THIRD_PARTY,
3281
3281
  details: {
@@ -3351,7 +3351,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3351
3351
  } catch (error$1) {
3352
3352
  throw new error.MastraError(
3353
3353
  {
3354
- id: "MASTRA_STORAGE_PG_INDEX_LIST_FAILED",
3354
+ id: storage.createStorageErrorId("PG", "INDEX_LIST", "FAILED"),
3355
3355
  domain: error.ErrorDomain.STORAGE,
3356
3356
  category: error.ErrorCategory.THIRD_PARTY,
3357
3357
  details: tableName ? {
@@ -3433,7 +3433,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3433
3433
  } catch (error$1) {
3434
3434
  throw new error.MastraError(
3435
3435
  {
3436
- id: "MASTRA_STORAGE_PG_STORE_CREATE_PERFORMANCE_INDEXES_FAILED",
3436
+ id: storage.createStorageErrorId("PG", "CREATE_AUTOMATIC_INDEXES", "FAILED"),
3437
3437
  domain: error.ErrorDomain.STORAGE,
3438
3438
  category: error.ErrorCategory.THIRD_PARTY
3439
3439
  },
@@ -3495,7 +3495,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3495
3495
  } catch (error$1) {
3496
3496
  throw new error.MastraError(
3497
3497
  {
3498
- id: "MASTRA_STORAGE_PG_INDEX_DESCRIBE_FAILED",
3498
+ id: storage.createStorageErrorId("PG", "INDEX_DESCRIBE", "FAILED"),
3499
3499
  domain: error.ErrorDomain.STORAGE,
3500
3500
  category: error.ErrorCategory.THIRD_PARTY,
3501
3501
  details: {
@@ -3540,7 +3540,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3540
3540
  } catch (error$1) {
3541
3541
  throw new error.MastraError(
3542
3542
  {
3543
- id: "MASTRA_STORAGE_PG_STORE_UPDATE_FAILED",
3543
+ id: storage.createStorageErrorId("PG", "UPDATE", "FAILED"),
3544
3544
  domain: error.ErrorDomain.STORAGE,
3545
3545
  category: error.ErrorCategory.THIRD_PARTY,
3546
3546
  details: {
@@ -3568,7 +3568,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3568
3568
  await this.client.query("ROLLBACK");
3569
3569
  throw new error.MastraError(
3570
3570
  {
3571
- id: "MASTRA_STORAGE_PG_STORE_BATCH_UPDATE_FAILED",
3571
+ id: storage.createStorageErrorId("PG", "BATCH_UPDATE", "FAILED"),
3572
3572
  domain: error.ErrorDomain.STORAGE,
3573
3573
  category: error.ErrorCategory.THIRD_PARTY,
3574
3574
  details: {
@@ -3609,7 +3609,7 @@ var StoreOperationsPG = class extends storage.StoreOperations {
3609
3609
  } catch (error$1) {
3610
3610
  throw new error.MastraError(
3611
3611
  {
3612
- id: "MASTRA_STORAGE_PG_STORE_BATCH_DELETE_FAILED",
3612
+ id: storage.createStorageErrorId("PG", "BATCH_DELETE", "FAILED"),
3613
3613
  domain: error.ErrorDomain.STORAGE,
3614
3614
  category: error.ErrorCategory.THIRD_PARTY,
3615
3615
  details: {
@@ -3654,7 +3654,7 @@ var ScoresPG = class extends storage.ScoresStorage {
3654
3654
  } catch (error$1) {
3655
3655
  throw new error.MastraError(
3656
3656
  {
3657
- id: "MASTRA_STORAGE_PG_STORE_GET_SCORE_BY_ID_FAILED",
3657
+ id: storage.createStorageErrorId("PG", "GET_SCORE_BY_ID", "FAILED"),
3658
3658
  domain: error.ErrorDomain.STORAGE,
3659
3659
  category: error.ErrorCategory.THIRD_PARTY
3660
3660
  },
@@ -3722,7 +3722,7 @@ var ScoresPG = class extends storage.ScoresStorage {
3722
3722
  } catch (error$1) {
3723
3723
  throw new error.MastraError(
3724
3724
  {
3725
- id: "MASTRA_STORAGE_PG_STORE_GET_SCORES_BY_SCORER_ID_FAILED",
3725
+ id: storage.createStorageErrorId("PG", "GET_SCORES_BY_SCORER_ID", "FAILED"),
3726
3726
  domain: error.ErrorDomain.STORAGE,
3727
3727
  category: error.ErrorCategory.THIRD_PARTY
3728
3728
  },
@@ -3737,7 +3737,7 @@ var ScoresPG = class extends storage.ScoresStorage {
3737
3737
  } catch (error$1) {
3738
3738
  throw new error.MastraError(
3739
3739
  {
3740
- id: "MASTRA_STORAGE_PG_STORE_SAVE_SCORE_FAILED_INVALID_SCORE_PAYLOAD",
3740
+ id: storage.createStorageErrorId("PG", "SAVE_SCORE", "INVALID_PAYLOAD"),
3741
3741
  domain: error.ErrorDomain.STORAGE,
3742
3742
  category: error.ErrorCategory.USER,
3743
3743
  details: {
@@ -3786,7 +3786,7 @@ var ScoresPG = class extends storage.ScoresStorage {
3786
3786
  } catch (error$1) {
3787
3787
  throw new error.MastraError(
3788
3788
  {
3789
- id: "MASTRA_STORAGE_PG_STORE_SAVE_SCORE_FAILED",
3789
+ id: storage.createStorageErrorId("PG", "SAVE_SCORE", "FAILED"),
3790
3790
  domain: error.ErrorDomain.STORAGE,
3791
3791
  category: error.ErrorCategory.THIRD_PARTY
3792
3792
  },
@@ -3835,7 +3835,7 @@ var ScoresPG = class extends storage.ScoresStorage {
3835
3835
  } catch (error$1) {
3836
3836
  throw new error.MastraError(
3837
3837
  {
3838
- id: "MASTRA_STORAGE_PG_STORE_GET_SCORES_BY_RUN_ID_FAILED",
3838
+ id: storage.createStorageErrorId("PG", "GET_SCORES_BY_RUN_ID", "FAILED"),
3839
3839
  domain: error.ErrorDomain.STORAGE,
3840
3840
  category: error.ErrorCategory.THIRD_PARTY
3841
3841
  },
@@ -3885,7 +3885,7 @@ var ScoresPG = class extends storage.ScoresStorage {
3885
3885
  } catch (error$1) {
3886
3886
  throw new error.MastraError(
3887
3887
  {
3888
- id: "MASTRA_STORAGE_PG_STORE_GET_SCORES_BY_ENTITY_ID_FAILED",
3888
+ id: storage.createStorageErrorId("PG", "GET_SCORES_BY_ENTITY_ID", "FAILED"),
3889
3889
  domain: error.ErrorDomain.STORAGE,
3890
3890
  category: error.ErrorCategory.THIRD_PARTY
3891
3891
  },
@@ -3928,7 +3928,7 @@ var ScoresPG = class extends storage.ScoresStorage {
3928
3928
  } catch (error$1) {
3929
3929
  throw new error.MastraError(
3930
3930
  {
3931
- id: "MASTRA_STORAGE_PG_STORE_GET_SCORES_BY_SPAN_FAILED",
3931
+ id: storage.createStorageErrorId("PG", "GET_SCORES_BY_SPAN", "FAILED"),
3932
3932
  domain: error.ErrorDomain.STORAGE,
3933
3933
  category: error.ErrorCategory.THIRD_PARTY
3934
3934
  },
@@ -4003,7 +4003,7 @@ var WorkflowsPG = class extends storage.WorkflowsStorage {
4003
4003
  } catch (error$1) {
4004
4004
  throw new error.MastraError(
4005
4005
  {
4006
- id: "MASTRA_STORAGE_PG_STORE_PERSIST_WORKFLOW_SNAPSHOT_FAILED",
4006
+ id: storage.createStorageErrorId("PG", "PERSIST_WORKFLOW_SNAPSHOT", "FAILED"),
4007
4007
  domain: error.ErrorDomain.STORAGE,
4008
4008
  category: error.ErrorCategory.THIRD_PARTY
4009
4009
  },
@@ -4024,7 +4024,7 @@ var WorkflowsPG = class extends storage.WorkflowsStorage {
4024
4024
  } catch (error$1) {
4025
4025
  throw new error.MastraError(
4026
4026
  {
4027
- id: "MASTRA_STORAGE_PG_STORE_LOAD_WORKFLOW_SNAPSHOT_FAILED",
4027
+ id: storage.createStorageErrorId("PG", "LOAD_WORKFLOW_SNAPSHOT", "FAILED"),
4028
4028
  domain: error.ErrorDomain.STORAGE,
4029
4029
  category: error.ErrorCategory.THIRD_PARTY
4030
4030
  },
@@ -4065,7 +4065,7 @@ var WorkflowsPG = class extends storage.WorkflowsStorage {
4065
4065
  } catch (error$1) {
4066
4066
  throw new error.MastraError(
4067
4067
  {
4068
- id: "MASTRA_STORAGE_PG_STORE_GET_WORKFLOW_RUN_BY_ID_FAILED",
4068
+ id: storage.createStorageErrorId("PG", "GET_WORKFLOW_RUN_BY_ID", "FAILED"),
4069
4069
  domain: error.ErrorDomain.STORAGE,
4070
4070
  category: error.ErrorCategory.THIRD_PARTY,
4071
4071
  details: {
@@ -4147,7 +4147,7 @@ var WorkflowsPG = class extends storage.WorkflowsStorage {
4147
4147
  } catch (error$1) {
4148
4148
  throw new error.MastraError(
4149
4149
  {
4150
- id: "MASTRA_STORAGE_PG_STORE_LIST_WORKFLOW_RUNS_FAILED",
4150
+ id: storage.createStorageErrorId("PG", "LIST_WORKFLOW_RUNS", "FAILED"),
4151
4151
  domain: error.ErrorDomain.STORAGE,
4152
4152
  category: error.ErrorCategory.THIRD_PARTY,
4153
4153
  details: {
@@ -4171,7 +4171,7 @@ var PostgresStore = class extends storage.MastraStorage {
4171
4171
  constructor(config) {
4172
4172
  try {
4173
4173
  validateConfig("PostgresStore", config);
4174
- super({ id: config.id, name: "PostgresStore" });
4174
+ super({ id: config.id, name: "PostgresStore", disableInit: config.disableInit });
4175
4175
  this.schema = config.schemaName || "public";
4176
4176
  if (isConnectionStringConfig(config)) {
4177
4177
  this.#config = {
@@ -4209,7 +4209,7 @@ var PostgresStore = class extends storage.MastraStorage {
4209
4209
  } catch (e) {
4210
4210
  throw new error.MastraError(
4211
4211
  {
4212
- id: "MASTRA_STORAGE_PG_STORE_INITIALIZATION_FAILED",
4212
+ id: storage.createStorageErrorId("PG", "INITIALIZATION", "FAILED"),
4213
4213
  domain: error.ErrorDomain.STORAGE,
4214
4214
  category: error.ErrorCategory.USER
4215
4215
  },
@@ -4247,7 +4247,7 @@ var PostgresStore = class extends storage.MastraStorage {
4247
4247
  this.isConnected = false;
4248
4248
  throw new error.MastraError(
4249
4249
  {
4250
- id: "MASTRA_STORAGE_POSTGRES_STORE_INIT_FAILED",
4250
+ id: storage.createStorageErrorId("PG", "INIT", "FAILED"),
4251
4251
  domain: error.ErrorDomain.STORAGE,
4252
4252
  category: error.ErrorCategory.THIRD_PARTY
4253
4253
  },
@@ -4404,7 +4404,7 @@ var PostgresStore = class extends storage.MastraStorage {
4404
4404
  async createSpan(span) {
4405
4405
  if (!this.stores.observability) {
4406
4406
  throw new error.MastraError({
4407
- id: "PG_STORE_OBSERVABILITY_NOT_INITIALIZED",
4407
+ id: storage.createStorageErrorId("PG", "OBSERVABILITY", "NOT_INITIALIZED"),
4408
4408
  domain: error.ErrorDomain.STORAGE,
4409
4409
  category: error.ErrorCategory.SYSTEM,
4410
4410
  text: "Observability storage is not initialized"
@@ -4419,7 +4419,7 @@ var PostgresStore = class extends storage.MastraStorage {
4419
4419
  }) {
4420
4420
  if (!this.stores.observability) {
4421
4421
  throw new error.MastraError({
4422
- id: "PG_STORE_OBSERVABILITY_NOT_INITIALIZED",
4422
+ id: storage.createStorageErrorId("PG", "OBSERVABILITY", "NOT_INITIALIZED"),
4423
4423
  domain: error.ErrorDomain.STORAGE,
4424
4424
  category: error.ErrorCategory.SYSTEM,
4425
4425
  text: "Observability storage is not initialized"
@@ -4430,7 +4430,7 @@ var PostgresStore = class extends storage.MastraStorage {
4430
4430
  async getTrace(traceId) {
4431
4431
  if (!this.stores.observability) {
4432
4432
  throw new error.MastraError({
4433
- id: "PG_STORE_OBSERVABILITY_NOT_INITIALIZED",
4433
+ id: storage.createStorageErrorId("PG", "OBSERVABILITY", "NOT_INITIALIZED"),
4434
4434
  domain: error.ErrorDomain.STORAGE,
4435
4435
  category: error.ErrorCategory.SYSTEM,
4436
4436
  text: "Observability storage is not initialized"
@@ -4441,7 +4441,7 @@ var PostgresStore = class extends storage.MastraStorage {
4441
4441
  async getTracesPaginated(args) {
4442
4442
  if (!this.stores.observability) {
4443
4443
  throw new error.MastraError({
4444
- id: "PG_STORE_OBSERVABILITY_NOT_INITIALIZED",
4444
+ id: storage.createStorageErrorId("PG", "OBSERVABILITY", "NOT_INITIALIZED"),
4445
4445
  domain: error.ErrorDomain.STORAGE,
4446
4446
  category: error.ErrorCategory.SYSTEM,
4447
4447
  text: "Observability storage is not initialized"
@@ -4452,7 +4452,7 @@ var PostgresStore = class extends storage.MastraStorage {
4452
4452
  async batchCreateSpans(args) {
4453
4453
  if (!this.stores.observability) {
4454
4454
  throw new error.MastraError({
4455
- id: "PG_STORE_OBSERVABILITY_NOT_INITIALIZED",
4455
+ id: storage.createStorageErrorId("PG", "OBSERVABILITY", "NOT_INITIALIZED"),
4456
4456
  domain: error.ErrorDomain.STORAGE,
4457
4457
  category: error.ErrorCategory.SYSTEM,
4458
4458
  text: "Observability storage is not initialized"
@@ -4463,7 +4463,7 @@ var PostgresStore = class extends storage.MastraStorage {
4463
4463
  async batchUpdateSpans(args) {
4464
4464
  if (!this.stores.observability) {
4465
4465
  throw new error.MastraError({
4466
- id: "PG_STORE_OBSERVABILITY_NOT_INITIALIZED",
4466
+ id: storage.createStorageErrorId("PG", "OBSERVABILITY", "NOT_INITIALIZED"),
4467
4467
  domain: error.ErrorDomain.STORAGE,
4468
4468
  category: error.ErrorCategory.SYSTEM,
4469
4469
  text: "Observability storage is not initialized"
@@ -4474,7 +4474,7 @@ var PostgresStore = class extends storage.MastraStorage {
4474
4474
  async batchDeleteTraces(args) {
4475
4475
  if (!this.stores.observability) {
4476
4476
  throw new error.MastraError({
4477
- id: "PG_STORE_OBSERVABILITY_NOT_INITIALIZED",
4477
+ id: storage.createStorageErrorId("PG", "OBSERVABILITY", "NOT_INITIALIZED"),
4478
4478
  domain: error.ErrorDomain.STORAGE,
4479
4479
  category: error.ErrorCategory.SYSTEM,
4480
4480
  text: "Observability storage is not initialized"