@mastra/duckdb 1.1.1-alpha.0 → 1.1.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @mastra/duckdb
2
2
 
3
+ ## 1.1.2-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Added `entityVersionId`, `parentEntityVersionId`, and `rootEntityVersionId` columns to observability storage tables (spans, metrics, scores, feedback, logs) for filtering and grouping traces by entity version. Added ALTER TABLE migrations for existing databases. Added `targetType`, `targetId`, `agentVersion`, and `status` filters to `listExperiments`, and `traceId` and `status` filters to `listExperimentResults`. ([#15317](https://github.com/mastra-ai/mastra/pull/15317))
8
+
9
+ - Updated dependencies [[`cbdf3e1`](https://github.com/mastra-ai/mastra/commit/cbdf3e12b3d0c30a6e5347be658e2009648c130a), [`8fe46d3`](https://github.com/mastra-ai/mastra/commit/8fe46d354027f3f0f0846e64219772348de106dd), [`18c67db`](https://github.com/mastra-ai/mastra/commit/18c67dbb9c9ebc26f26f65f7d3ff836e5691ef46), [`8dcc77e`](https://github.com/mastra-ai/mastra/commit/8dcc77e78a5340f5848f74b9e9f1b3da3513c1f5), [`aa67fc5`](https://github.com/mastra-ai/mastra/commit/aa67fc59ee8a5eeff1f23eb05970b8d7a536c8ff), [`fa8140b`](https://github.com/mastra-ai/mastra/commit/fa8140bcd4251d2e3ac85fdc5547dfc4f372b5be), [`190f452`](https://github.com/mastra-ai/mastra/commit/190f45258b0640e2adfc8219fa3258cdc5b8f071), [`7e7bf60`](https://github.com/mastra-ai/mastra/commit/7e7bf606886bf374a6f9d4ca9b09dd83d0533372), [`184907d`](https://github.com/mastra-ai/mastra/commit/184907d775d8609c03c26e78ccaf37315f3aa287), [`0c4cd13`](https://github.com/mastra-ai/mastra/commit/0c4cd131931c04ac5405373c932a242dbe88edd6), [`b16a753`](https://github.com/mastra-ai/mastra/commit/b16a753d5748440248d7df82e29bb987a9c8386c)]:
10
+ - @mastra/core@1.25.0-alpha.3
11
+
12
+ ## 1.1.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Fixed DuckDB observability migrations to support nullable score and feedback trace IDs on existing installs. ([#14942](https://github.com/mastra-ai/mastra/pull/14942))
17
+
18
+ - Updated dependencies [[`9a43b47`](https://github.com/mastra-ai/mastra/commit/9a43b476465e86c9aca381c2831066b5c33c999a), [`ec5c319`](https://github.com/mastra-ai/mastra/commit/ec5c3197a50d034cb8e9cc494eebfddc684b5d81), [`6517789`](https://github.com/mastra-ai/mastra/commit/65177895b74b5471fe2245c7292f0176d9b3385d), [`13f4327`](https://github.com/mastra-ai/mastra/commit/13f4327f052faebe199cefbe906d33bf90238767), [`9ad6aa6`](https://github.com/mastra-ai/mastra/commit/9ad6aa6dfe858afc6955d1df5f3f78c40bb96b9c), [`2862127`](https://github.com/mastra-ai/mastra/commit/2862127d0a7cbd28523120ad64fea067a95838e6), [`3d16814`](https://github.com/mastra-ai/mastra/commit/3d16814c395931373543728994ff45ac98093074), [`7f498d0`](https://github.com/mastra-ai/mastra/commit/7f498d099eacef64fd43ee412e3bd6f87965a8a6), [`8cf8a67`](https://github.com/mastra-ai/mastra/commit/8cf8a67b061b737cb06d501fb8c1967a98bbf3cb), [`d7827e3`](https://github.com/mastra-ai/mastra/commit/d7827e393937c6cb0c7a744dde4d31538cb542b7)]:
19
+ - @mastra/core@1.21.0
20
+
3
21
  ## 1.1.1-alpha.0
4
22
 
5
23
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-duckdb
3
3
  description: Documentation for @mastra/duckdb. Use when working with @mastra/duckdb APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/duckdb"
6
- version: "1.1.1-alpha.0"
6
+ version: "1.1.2-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.1-alpha.0",
2
+ "version": "1.1.2-alpha.0",
3
3
  "package": "@mastra/duckdb",
4
4
  "exports": {
5
5
  "DuckDBConnection": {
package/dist/index.cjs CHANGED
@@ -583,7 +583,7 @@ var ObservabilityStorageDuckDB = class extends storage.ObservabilityStorage {
583
583
  return null;
584
584
  }
585
585
  if (!this.loadPromise) {
586
- this.loadPromise = import('./observability-IME6BI7N.cjs').then(({ ObservabilityStorageDuckDB: ObservabilityStorageDuckDB2 }) => {
586
+ this.loadPromise = import('./observability-4TAPGTC4.cjs').then(({ ObservabilityStorageDuckDB: ObservabilityStorageDuckDB2 }) => {
587
587
  const delegate = new ObservabilityStorageDuckDB2({ db: this.db });
588
588
  this.delegate = delegate;
589
589
  return delegate;
package/dist/index.js CHANGED
@@ -582,7 +582,7 @@ var ObservabilityStorageDuckDB = class extends ObservabilityStorage {
582
582
  return null;
583
583
  }
584
584
  if (!this.loadPromise) {
585
- this.loadPromise = import('./observability-J4YTASAF.js').then(({ ObservabilityStorageDuckDB: ObservabilityStorageDuckDB2 }) => {
585
+ this.loadPromise = import('./observability-EMLEGDF7.js').then(({ ObservabilityStorageDuckDB: ObservabilityStorageDuckDB2 }) => {
586
586
  const delegate = new ObservabilityStorageDuckDB2({ db: this.db });
587
587
  this.delegate = delegate;
588
588
  return delegate;
@@ -22,6 +22,7 @@ CREATE TABLE IF NOT EXISTS span_events (
22
22
  entityType VARCHAR,
23
23
  entityId VARCHAR,
24
24
  entityName VARCHAR,
25
+ entityVersionId VARCHAR,
25
26
 
26
27
  -- Context
27
28
  userId VARCHAR,
@@ -66,9 +67,12 @@ CREATE TABLE IF NOT EXISTS metric_events (
66
67
  entityType VARCHAR,
67
68
  entityId VARCHAR,
68
69
  entityName VARCHAR,
70
+ entityVersionId VARCHAR,
71
+ parentEntityVersionId VARCHAR,
69
72
  parentEntityType VARCHAR,
70
73
  parentEntityId VARCHAR,
71
74
  parentEntityName VARCHAR,
75
+ rootEntityVersionId VARCHAR,
72
76
  rootEntityType VARCHAR,
73
77
  rootEntityId VARCHAR,
74
78
  rootEntityName VARCHAR,
@@ -114,9 +118,12 @@ CREATE TABLE IF NOT EXISTS log_events (
114
118
  entityType VARCHAR,
115
119
  entityId VARCHAR,
116
120
  entityName VARCHAR,
121
+ entityVersionId VARCHAR,
122
+ parentEntityVersionId VARCHAR,
117
123
  parentEntityType VARCHAR,
118
124
  parentEntityId VARCHAR,
119
125
  parentEntityName VARCHAR,
126
+ rootEntityVersionId VARCHAR,
120
127
  rootEntityType VARCHAR,
121
128
  rootEntityId VARCHAR,
122
129
  rootEntityName VARCHAR,
@@ -158,9 +165,12 @@ CREATE TABLE IF NOT EXISTS score_events (
158
165
  entityType VARCHAR,
159
166
  entityId VARCHAR,
160
167
  entityName VARCHAR,
168
+ entityVersionId VARCHAR,
169
+ parentEntityVersionId VARCHAR,
161
170
  parentEntityType VARCHAR,
162
171
  parentEntityId VARCHAR,
163
172
  parentEntityName VARCHAR,
173
+ rootEntityVersionId VARCHAR,
164
174
  rootEntityType VARCHAR,
165
175
  rootEntityId VARCHAR,
166
176
  rootEntityName VARCHAR,
@@ -203,9 +213,12 @@ CREATE TABLE IF NOT EXISTS feedback_events (
203
213
  entityType VARCHAR,
204
214
  entityId VARCHAR,
205
215
  entityName VARCHAR,
216
+ entityVersionId VARCHAR,
217
+ parentEntityVersionId VARCHAR,
206
218
  parentEntityType VARCHAR,
207
219
  parentEntityId VARCHAR,
208
220
  parentEntityName VARCHAR,
221
+ rootEntityVersionId VARCHAR,
209
222
  rootEntityType VARCHAR,
210
223
  rootEntityId VARCHAR,
211
224
  rootEntityName VARCHAR,
@@ -240,7 +253,12 @@ CREATE TABLE IF NOT EXISTS feedback_events (
240
253
  )`;
241
254
  var ALL_DDL = [SPAN_EVENTS_DDL, METRIC_EVENTS_DDL, LOG_EVENTS_DDL, SCORE_EVENTS_DDL, FEEDBACK_EVENTS_DDL];
242
255
  var ALL_MIGRATIONS = [
256
+ // Span events
257
+ `ALTER TABLE span_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
243
258
  // Metrics
259
+ `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
260
+ `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS parentEntityVersionId VARCHAR`,
261
+ `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS rootEntityVersionId VARCHAR`,
244
262
  `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS experimentId VARCHAR`,
245
263
  `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS parentEntityType VARCHAR`,
246
264
  `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS parentEntityId VARCHAR`,
@@ -262,6 +280,9 @@ var ALL_MIGRATIONS = [
262
280
  `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS metadata JSON`,
263
281
  `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS scope JSON`,
264
282
  // Logs
283
+ `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
284
+ `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS parentEntityVersionId VARCHAR`,
285
+ `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS rootEntityVersionId VARCHAR`,
265
286
  `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS experimentId VARCHAR`,
266
287
  `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS parentEntityType VARCHAR`,
267
288
  `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS parentEntityId VARCHAR`,
@@ -283,6 +304,9 @@ var ALL_MIGRATIONS = [
283
304
  `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS metadata JSON`,
284
305
  `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS scope JSON`,
285
306
  // Scores
307
+ `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
308
+ `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS parentEntityVersionId VARCHAR`,
309
+ `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS rootEntityVersionId VARCHAR`,
286
310
  `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS entityType VARCHAR`,
287
311
  `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS entityId VARCHAR`,
288
312
  `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS entityName VARCHAR`,
@@ -308,6 +332,9 @@ var ALL_MIGRATIONS = [
308
332
  `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS scoreSource VARCHAR`,
309
333
  `ALTER TABLE score_events ALTER COLUMN traceId DROP NOT NULL`,
310
334
  // Feedback
335
+ `ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
336
+ `ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS parentEntityVersionId VARCHAR`,
337
+ `ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS rootEntityVersionId VARCHAR`,
311
338
  `ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS entityType VARCHAR`,
312
339
  `ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS entityId VARCHAR`,
313
340
  `ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS entityName VARCHAR`,
@@ -578,9 +605,12 @@ var FEEDBACK_GROUP_BY_COLUMNS = /* @__PURE__ */ new Set([
578
605
  "entityType",
579
606
  "entityId",
580
607
  "entityName",
608
+ "entityVersionId",
609
+ "parentEntityVersionId",
581
610
  "parentEntityType",
582
611
  "parentEntityId",
583
612
  "parentEntityName",
613
+ "rootEntityVersionId",
584
614
  "rootEntityType",
585
615
  "rootEntityId",
586
616
  "rootEntityName",
@@ -696,9 +726,12 @@ function rowToFeedbackRecord(row) {
696
726
  entityType: row.entityType ?? null,
697
727
  entityId: row.entityId ?? null,
698
728
  entityName: row.entityName ?? null,
729
+ entityVersionId: row.entityVersionId ?? null,
730
+ parentEntityVersionId: row.parentEntityVersionId ?? null,
699
731
  parentEntityType: row.parentEntityType ?? null,
700
732
  parentEntityId: row.parentEntityId ?? null,
701
733
  parentEntityName: row.parentEntityName ?? null,
734
+ rootEntityVersionId: row.rootEntityVersionId ?? null,
702
735
  rootEntityType: row.rootEntityType ?? null,
703
736
  rootEntityId: row.rootEntityId ?? null,
704
737
  rootEntityName: row.rootEntityName ?? null,
@@ -758,7 +791,7 @@ async function createFeedback(db, args) {
758
791
  await db.execute(
759
792
  `INSERT INTO feedback_events (
760
793
  timestamp, traceId, spanId, experimentId,
761
- entityType, entityId, entityName, parentEntityType, parentEntityId, parentEntityName, rootEntityType, rootEntityId, rootEntityName,
794
+ entityType, entityId, entityName, entityVersionId, parentEntityVersionId, parentEntityType, parentEntityId, parentEntityName, rootEntityVersionId, rootEntityType, rootEntityId, rootEntityName,
762
795
  userId, organizationId, resourceId, runId, sessionId, threadId, requestId, environment, executionSource, serviceName,
763
796
  feedbackUserId, sourceId, feedbackSource, feedbackType, value, comment, tags, metadata, scope
764
797
  )
@@ -770,9 +803,12 @@ async function createFeedback(db, args) {
770
803
  v(f.entityType ?? null),
771
804
  v(f.entityId ?? null),
772
805
  v(f.entityName ?? null),
806
+ v(f.entityVersionId ?? null),
807
+ v(f.parentEntityVersionId ?? null),
773
808
  v(f.parentEntityType ?? null),
774
809
  v(f.parentEntityId ?? null),
775
810
  v(f.parentEntityName ?? null),
811
+ v(f.rootEntityVersionId ?? null),
776
812
  v(f.rootEntityType ?? null),
777
813
  v(f.rootEntityId ?? null),
778
814
  v(f.rootEntityName ?? null),
@@ -812,9 +848,12 @@ async function batchCreateFeedback(db, args) {
812
848
  v(legacyFeedback.entityType ?? null),
813
849
  v(legacyFeedback.entityId ?? null),
814
850
  v(legacyFeedback.entityName ?? null),
851
+ v(legacyFeedback.entityVersionId ?? null),
852
+ v(legacyFeedback.parentEntityVersionId ?? null),
815
853
  v(legacyFeedback.parentEntityType ?? null),
816
854
  v(legacyFeedback.parentEntityId ?? null),
817
855
  v(legacyFeedback.parentEntityName ?? null),
856
+ v(legacyFeedback.rootEntityVersionId ?? null),
818
857
  v(legacyFeedback.rootEntityType ?? null),
819
858
  v(legacyFeedback.rootEntityId ?? null),
820
859
  v(legacyFeedback.rootEntityName ?? null),
@@ -842,7 +881,7 @@ async function batchCreateFeedback(db, args) {
842
881
  await db.execute(
843
882
  `INSERT INTO feedback_events (
844
883
  timestamp, traceId, spanId, experimentId,
845
- entityType, entityId, entityName, parentEntityType, parentEntityId, parentEntityName, rootEntityType, rootEntityId, rootEntityName,
884
+ entityType, entityId, entityName, entityVersionId, parentEntityVersionId, parentEntityType, parentEntityId, parentEntityName, rootEntityVersionId, rootEntityType, rootEntityId, rootEntityName,
846
885
  userId, organizationId, resourceId, runId, sessionId, threadId, requestId, environment, executionSource, serviceName,
847
886
  feedbackUserId, sourceId, feedbackSource, feedbackType, value, comment, tags, metadata, scope
848
887
  )
@@ -1012,9 +1051,12 @@ var COLUMNS = [
1012
1051
  "entityType",
1013
1052
  "entityId",
1014
1053
  "entityName",
1054
+ "entityVersionId",
1055
+ "parentEntityVersionId",
1015
1056
  "parentEntityType",
1016
1057
  "parentEntityId",
1017
1058
  "parentEntityName",
1059
+ "rootEntityVersionId",
1018
1060
  "rootEntityType",
1019
1061
  "rootEntityId",
1020
1062
  "rootEntityName",
@@ -1045,9 +1087,12 @@ function rowToLogRecord(row) {
1045
1087
  entityType: row.entityType ?? null,
1046
1088
  entityId: row.entityId ?? null,
1047
1089
  entityName: row.entityName ?? null,
1090
+ entityVersionId: row.entityVersionId ?? null,
1091
+ parentEntityVersionId: row.parentEntityVersionId ?? null,
1048
1092
  parentEntityType: row.parentEntityType ?? null,
1049
1093
  parentEntityId: row.parentEntityId ?? null,
1050
1094
  parentEntityName: row.parentEntityName ?? null,
1095
+ rootEntityVersionId: row.rootEntityVersionId ?? null,
1051
1096
  rootEntityType: row.rootEntityType ?? null,
1052
1097
  rootEntityId: row.rootEntityId ?? null,
1053
1098
  rootEntityName: row.rootEntityName ?? null,
@@ -1080,9 +1125,12 @@ async function batchCreateLogs(db, args) {
1080
1125
  v(log.entityType ?? null),
1081
1126
  v(log.entityId ?? null),
1082
1127
  v(log.entityName ?? null),
1128
+ v(log.entityVersionId ?? null),
1129
+ v(log.parentEntityVersionId ?? null),
1083
1130
  v(log.parentEntityType ?? null),
1084
1131
  v(log.parentEntityId ?? null),
1085
1132
  v(log.parentEntityName ?? null),
1133
+ v(log.rootEntityVersionId ?? null),
1086
1134
  v(log.rootEntityType ?? null),
1087
1135
  v(log.rootEntityId ?? null),
1088
1136
  v(log.rootEntityName ?? null),
@@ -1177,9 +1225,12 @@ var METRIC_COLUMNS = [
1177
1225
  "entityType",
1178
1226
  "entityId",
1179
1227
  "entityName",
1228
+ "entityVersionId",
1229
+ "parentEntityVersionId",
1180
1230
  "parentEntityType",
1181
1231
  "parentEntityId",
1182
1232
  "parentEntityName",
1233
+ "rootEntityVersionId",
1183
1234
  "rootEntityType",
1184
1235
  "rootEntityId",
1185
1236
  "rootEntityName",
@@ -1277,9 +1328,12 @@ function rowToMetricRecord(row) {
1277
1328
  entityType: row.entityType ?? null,
1278
1329
  entityId: row.entityId ?? null,
1279
1330
  entityName: row.entityName ?? null,
1331
+ entityVersionId: row.entityVersionId ?? null,
1332
+ parentEntityVersionId: row.parentEntityVersionId ?? null,
1280
1333
  parentEntityType: row.parentEntityType ?? null,
1281
1334
  parentEntityId: row.parentEntityId ?? null,
1282
1335
  parentEntityName: row.parentEntityName ?? null,
1336
+ rootEntityVersionId: row.rootEntityVersionId ?? null,
1283
1337
  rootEntityType: row.rootEntityType ?? null,
1284
1338
  rootEntityId: row.rootEntityId ?? null,
1285
1339
  rootEntityName: row.rootEntityName ?? null,
@@ -1317,9 +1371,12 @@ async function batchCreateMetrics(db, args) {
1317
1371
  v(m.entityType ?? null),
1318
1372
  v(m.entityId ?? null),
1319
1373
  v(m.entityName ?? null),
1374
+ v(m.entityVersionId ?? null),
1375
+ v(m.parentEntityVersionId ?? null),
1320
1376
  v(m.parentEntityType ?? null),
1321
1377
  v(m.parentEntityId ?? null),
1322
1378
  v(m.parentEntityName ?? null),
1379
+ v(m.rootEntityVersionId ?? null),
1323
1380
  v(m.rootEntityType ?? null),
1324
1381
  v(m.rootEntityId ?? null),
1325
1382
  v(m.rootEntityName ?? null),
@@ -1653,9 +1710,12 @@ var SCORE_GROUP_BY_COLUMNS = /* @__PURE__ */ new Set([
1653
1710
  "entityType",
1654
1711
  "entityId",
1655
1712
  "entityName",
1713
+ "entityVersionId",
1714
+ "parentEntityVersionId",
1656
1715
  "parentEntityType",
1657
1716
  "parentEntityId",
1658
1717
  "parentEntityName",
1718
+ "rootEntityVersionId",
1659
1719
  "rootEntityType",
1660
1720
  "rootEntityId",
1661
1721
  "rootEntityName",
@@ -1764,9 +1824,12 @@ function rowToScoreRecord(row) {
1764
1824
  entityType: row.entityType ?? null,
1765
1825
  entityId: row.entityId ?? null,
1766
1826
  entityName: row.entityName ?? null,
1827
+ entityVersionId: row.entityVersionId ?? null,
1828
+ parentEntityVersionId: row.parentEntityVersionId ?? null,
1767
1829
  parentEntityType: row.parentEntityType ?? null,
1768
1830
  parentEntityId: row.parentEntityId ?? null,
1769
1831
  parentEntityName: row.parentEntityName ?? null,
1832
+ rootEntityVersionId: row.rootEntityVersionId ?? null,
1770
1833
  rootEntityType: row.rootEntityType ?? null,
1771
1834
  rootEntityId: row.rootEntityId ?? null,
1772
1835
  rootEntityName: row.rootEntityName ?? null,
@@ -1824,7 +1887,7 @@ async function createScore(db, args) {
1824
1887
  await db.execute(
1825
1888
  `INSERT INTO score_events (
1826
1889
  timestamp, traceId, spanId, experimentId, scoreTraceId,
1827
- entityType, entityId, entityName, parentEntityType, parentEntityId, parentEntityName, rootEntityType, rootEntityId, rootEntityName,
1890
+ entityType, entityId, entityName, entityVersionId, parentEntityVersionId, parentEntityType, parentEntityId, parentEntityName, rootEntityVersionId, rootEntityType, rootEntityId, rootEntityName,
1828
1891
  userId, organizationId, resourceId, runId, sessionId, threadId, requestId, environment, executionSource, serviceName,
1829
1892
  scorerId, scorerVersion, scoreSource, score, reason, tags, metadata, scope
1830
1893
  )
@@ -1837,9 +1900,12 @@ async function createScore(db, args) {
1837
1900
  v(s.entityType ?? null),
1838
1901
  v(s.entityId ?? null),
1839
1902
  v(s.entityName ?? null),
1903
+ v(s.entityVersionId ?? null),
1904
+ v(s.parentEntityVersionId ?? null),
1840
1905
  v(s.parentEntityType ?? null),
1841
1906
  v(s.parentEntityId ?? null),
1842
1907
  v(s.parentEntityName ?? null),
1908
+ v(s.rootEntityVersionId ?? null),
1843
1909
  v(s.rootEntityType ?? null),
1844
1910
  v(s.rootEntityId ?? null),
1845
1911
  v(s.rootEntityName ?? null),
@@ -1878,9 +1944,12 @@ async function batchCreateScores(db, args) {
1878
1944
  v(legacyScore.entityType ?? null),
1879
1945
  v(legacyScore.entityId ?? null),
1880
1946
  v(legacyScore.entityName ?? null),
1947
+ v(legacyScore.entityVersionId ?? null),
1948
+ v(legacyScore.parentEntityVersionId ?? null),
1881
1949
  v(legacyScore.parentEntityType ?? null),
1882
1950
  v(legacyScore.parentEntityId ?? null),
1883
1951
  v(legacyScore.parentEntityName ?? null),
1952
+ v(legacyScore.rootEntityVersionId ?? null),
1884
1953
  v(legacyScore.rootEntityType ?? null),
1885
1954
  v(legacyScore.rootEntityId ?? null),
1886
1955
  v(legacyScore.rootEntityName ?? null),
@@ -1907,7 +1976,7 @@ async function batchCreateScores(db, args) {
1907
1976
  await db.execute(
1908
1977
  `INSERT INTO score_events (
1909
1978
  timestamp, traceId, spanId, experimentId, scoreTraceId,
1910
- entityType, entityId, entityName, parentEntityType, parentEntityId, parentEntityName, rootEntityType, rootEntityId, rootEntityName,
1979
+ entityType, entityId, entityName, entityVersionId, parentEntityVersionId, parentEntityType, parentEntityId, parentEntityName, rootEntityVersionId, rootEntityType, rootEntityId, rootEntityName,
1911
1980
  userId, organizationId, resourceId, runId, sessionId, threadId, requestId, environment, executionSource, serviceName,
1912
1981
  scorerId, scorerVersion, scoreSource, score, reason, tags, metadata, scope
1913
1982
  )
@@ -2075,6 +2144,7 @@ var COLUMNS2 = [
2075
2144
  "entityType",
2076
2145
  "entityId",
2077
2146
  "entityName",
2147
+ "entityVersionId",
2078
2148
  "userId",
2079
2149
  "organizationId",
2080
2150
  "resourceId",
@@ -2112,6 +2182,7 @@ var SPAN_RECONSTRUCT_SELECT = `
2112
2182
  ${argMaxNonNull("entityType")},
2113
2183
  ${argMaxNonNull("entityId")},
2114
2184
  ${argMaxNonNull("entityName")},
2185
+ ${argMaxNonNull("entityVersionId")},
2115
2186
  ${argMaxNonNull("userId")},
2116
2187
  ${argMaxNonNull("organizationId")},
2117
2188
  ${argMaxNonNull("resourceId")},
@@ -2147,6 +2218,7 @@ function rowToSpanRecord(row) {
2147
2218
  entityType: row.entityType ?? null,
2148
2219
  entityId: row.entityId ?? null,
2149
2220
  entityName: row.entityName ?? null,
2221
+ entityVersionId: row.entityVersionId ?? null,
2150
2222
  userId: row.userId ?? null,
2151
2223
  organizationId: row.organizationId ?? null,
2152
2224
  resourceId: row.resourceId ?? null,
@@ -2190,6 +2262,7 @@ function toValuesTuple(row) {
2190
2262
  v(row.entityType),
2191
2263
  v(row.entityId),
2192
2264
  v(row.entityName),
2265
+ v(row.entityVersionId),
2193
2266
  v(row.userId),
2194
2267
  v(row.organizationId),
2195
2268
  v(row.resourceId),
@@ -2231,6 +2304,7 @@ function createStartSpanRow(s) {
2231
2304
  entityType: s.entityType ?? null,
2232
2305
  entityId: s.entityId ?? null,
2233
2306
  entityName: s.entityName ?? null,
2307
+ entityVersionId: s.entityVersionId ?? null,
2234
2308
  userId: s.userId ?? null,
2235
2309
  organizationId: s.organizationId ?? null,
2236
2310
  resourceId: s.resourceId ?? null,
@@ -2267,6 +2341,7 @@ function createEndSpanRow(s) {
2267
2341
  entityType: s.entityType ?? null,
2268
2342
  entityId: s.entityId ?? null,
2269
2343
  entityName: s.entityName ?? null,
2344
+ entityVersionId: s.entityVersionId ?? null,
2270
2345
  userId: s.userId ?? null,
2271
2346
  organizationId: s.organizationId ?? null,
2272
2347
  resourceId: s.resourceId ?? null,
@@ -2531,5 +2606,5 @@ var ObservabilityStorageDuckDB = class extends storage.ObservabilityStorage {
2531
2606
  };
2532
2607
 
2533
2608
  exports.ObservabilityStorageDuckDB = ObservabilityStorageDuckDB;
2534
- //# sourceMappingURL=observability-IME6BI7N.cjs.map
2535
- //# sourceMappingURL=observability-IME6BI7N.cjs.map
2609
+ //# sourceMappingURL=observability-4TAPGTC4.cjs.map
2610
+ //# sourceMappingURL=observability-4TAPGTC4.cjs.map