@mastra/duckdb 1.6.0 → 1.6.1-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,20 @@
1
1
  # @mastra/duckdb
2
2
 
3
+ ## 1.6.1-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed the lightweight trace list on DuckDB ignoring delta polling and leaving the input preview column blank. ([#20677](https://github.com/mastra-ai/mastra/pull/20677))
8
+
9
+ `listTracesLight` previously ignored `mode`, `after` and `limit`, so a client live-tailing a lightweight list refetched the first page on every poll and never received `delta` or `deltaCursor`. Delta requests now return only the traces recorded since the cursor, as lightweight rows.
10
+
11
+ Rows now carry a short `inputPreview` in place of the full input, plus a computed `status` and the span `metadata`, so Studio's configurable trace columns work on the lightweight list. Page responses include a `deltaCursor` so polling can switch to delta mode.
12
+
13
+ Requires `@mastra/core` >= 1.57.0, which ships the shared `buildInputPreview` and `computeTraceStatus` helpers this store now imports (peer dependency bumped accordingly).
14
+
15
+ - Updated dependencies [[`e7109ee`](https://github.com/mastra-ai/mastra/commit/e7109ee6f731bacc79c885906f3c7dca8d8f013a), [`772c0c8`](https://github.com/mastra-ai/mastra/commit/772c0c897cec383258de2e6178147f8014767c7b), [`578bf2e`](https://github.com/mastra-ai/mastra/commit/578bf2e6a88e9d5b8bf502204e15a95dfbb679ae), [`06b2d87`](https://github.com/mastra-ai/mastra/commit/06b2d87e63bcdd0ed59215c6789692b9b12de376), [`ac01d63`](https://github.com/mastra-ai/mastra/commit/ac01d6355974aec73fdb8781449ed12bac582094), [`a810a05`](https://github.com/mastra-ai/mastra/commit/a810a058f62ad407cfc1701e0be36ae91145d7cf), [`f8da216`](https://github.com/mastra-ai/mastra/commit/f8da21633e7eb0e31c9ce0fc30567870d19416d3), [`6104347`](https://github.com/mastra-ai/mastra/commit/61043473ba6bfd0a25156824e853e13165562e6c), [`45bfb88`](https://github.com/mastra-ai/mastra/commit/45bfb88fd52f1dd3be20e2a38905777c96499c90), [`e3b9307`](https://github.com/mastra-ai/mastra/commit/e3b9307098daefbfae2a52ae2ef51bc9fc701190), [`d6834c5`](https://github.com/mastra-ai/mastra/commit/d6834c5a7866b16734d23900163c2414ed70d791), [`c52d346`](https://github.com/mastra-ai/mastra/commit/c52d3462ec831a5d95926ecd3d3373f5928ad2e5), [`0023e79`](https://github.com/mastra-ai/mastra/commit/0023e7919431078280abd11c89d1edeae35fcc69), [`c2ad51e`](https://github.com/mastra-ai/mastra/commit/c2ad51e2467f901eecba8c9f4a45e22a50bd7c18), [`3dc97ea`](https://github.com/mastra-ai/mastra/commit/3dc97ea415fad353b48a13095fad1835933cc12a), [`3d01cd3`](https://github.com/mastra-ai/mastra/commit/3d01cd387321b6f9c5cac31d487c84bf51b19c78), [`7bf3086`](https://github.com/mastra-ai/mastra/commit/7bf308663f0115ca74ad20554ade740f06640859), [`a8dd139`](https://github.com/mastra-ai/mastra/commit/a8dd1391a9fe9a6632c25809ef236980afa9a020), [`e5786be`](https://github.com/mastra-ai/mastra/commit/e5786be02bb903073082bd9d6da880ebaacc343f), [`2093fbd`](https://github.com/mastra-ai/mastra/commit/2093fbd53bb744bae19ec89f6d73db9a66fbe8a7), [`e7a5da4`](https://github.com/mastra-ai/mastra/commit/e7a5da4ef8e4dd452d2f232961b4e682a85ffe43), [`7b4393d`](https://github.com/mastra-ai/mastra/commit/7b4393d557411fdcf07b0e30e5acaf7cc85154ae)]:
16
+ - @mastra/core@1.58.0-alpha.1
17
+
3
18
  ## 1.6.0
4
19
 
5
20
  ### Minor 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.6.0"
6
+ version: "1.6.1-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.6.0",
2
+ "version": "1.6.1-alpha.0",
3
3
  "package": "@mastra/duckdb",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -518,7 +518,7 @@ var ObservabilityStorageDuckDB = class extends _mastra_core_storage.Observabilit
518
518
  async loadDelegate() {
519
519
  if (this.delegate) return this.delegate;
520
520
  if (this.unavailableError) return null;
521
- if (!this.loadPromise) this.loadPromise = Promise.resolve().then(() => require("./observability-DjqzPR8Z.cjs")).then(({ ObservabilityStorageDuckDB }) => {
521
+ if (!this.loadPromise) this.loadPromise = Promise.resolve().then(() => require("./observability-BN6FroNp.cjs")).then(({ ObservabilityStorageDuckDB }) => {
522
522
  const delegate = new ObservabilityStorageDuckDB({ db: this.db });
523
523
  this.delegate = delegate;
524
524
  return delegate;
package/dist/index.js CHANGED
@@ -517,7 +517,7 @@ var ObservabilityStorageDuckDB = class extends ObservabilityStorage {
517
517
  async loadDelegate() {
518
518
  if (this.delegate) return this.delegate;
519
519
  if (this.unavailableError) return null;
520
- if (!this.loadPromise) this.loadPromise = import("./observability-5ro3rotr.js").then(({ ObservabilityStorageDuckDB }) => {
520
+ if (!this.loadPromise) this.loadPromise = import("./observability-BtPeWunq.js").then(({ ObservabilityStorageDuckDB }) => {
521
521
  const delegate = new ObservabilityStorageDuckDB({ db: this.db });
522
522
  this.delegate = delegate;
523
523
  return delegate;
@@ -2538,6 +2538,28 @@ const SPAN_RECONSTRUCT_SELECT_LIGHT = `
2538
2538
  FROM span_events
2539
2539
  `;
2540
2540
  /**
2541
+ * Lightweight list variant — also reconstructs `metadata` for the list's
2542
+ * configurable columns and `input` so the row mapper can derive `inputPreview`
2543
+ * without shipping the blob to the caller.
2544
+ */
2545
+ const SPAN_RECONSTRUCT_SELECT_LIGHT_LIST = `
2546
+ SELECT
2547
+ traceId, spanId,
2548
+ ${argMaxNonNull("name")},
2549
+ ${argMaxNonNull("spanType")},
2550
+ ${argMaxNonNull("parentSpanId")},
2551
+ ${argMaxNonNull("isEvent")},
2552
+ coalesce(min(timestamp) FILTER (WHERE eventType = 'start'), min(timestamp)) as startedAt,
2553
+ ${argMaxNonNull("endedAt")},
2554
+ ${argMaxNonNull("entityType")},
2555
+ ${argMaxNonNull("entityId")},
2556
+ ${argMaxNonNull("entityName")},
2557
+ ${argMaxNonNull("error")},
2558
+ ${argMaxNonNull("metadata")},
2559
+ ${argMaxNonNull("input")}
2560
+ FROM span_events
2561
+ `;
2562
+ /**
2541
2563
  * Which reconstructed columns each post-aggregation filter key can reference.
2542
2564
  * `status` is derived from endedAt + error (see buildWhereClause).
2543
2565
  */
@@ -2621,6 +2643,15 @@ function rowToLightSpanRecord(row) {
2621
2643
  updatedAt: toDateOrNull(row.endedAt)
2622
2644
  };
2623
2645
  }
2646
+ function rowToLightSpanRecordWithPreview(row) {
2647
+ const record = rowToLightSpanRecord(row);
2648
+ return {
2649
+ ...record,
2650
+ status: (0, _mastra_core_storage.computeTraceStatus)(record),
2651
+ metadata: parseJson(row.metadata),
2652
+ inputPreview: (0, _mastra_core_storage.buildInputPreview)(row.input)
2653
+ };
2654
+ }
2624
2655
  function rowToSpanRecord(row) {
2625
2656
  return {
2626
2657
  traceId: row.traceId,
@@ -3152,7 +3183,18 @@ async function listTraces(db, args) {
3152
3183
  };
3153
3184
  }
3154
3185
  async function listTracesLight(db, args) {
3155
- return listTraceRows(db, args, SPAN_RECONSTRUCT_SELECT_LIGHT, rowToLightSpanRecord, (spans) => spans);
3186
+ const { filters, pagination, orderBy } = _mastra_core_storage.listTracesArgsSchema.parse(args);
3187
+ const currentDeltaCursor = deltaPollingFeatureEnabled() ? await getTraceDeltaCursor(db, filters) : void 0;
3188
+ const { pagination: resultPagination, spans } = await listTraceRows(db, {
3189
+ filters,
3190
+ pagination,
3191
+ orderBy
3192
+ }, SPAN_RECONSTRUCT_SELECT_LIGHT_LIST, rowToLightSpanRecordWithPreview, (spans) => spans);
3193
+ return {
3194
+ pagination: resultPagination,
3195
+ spans,
3196
+ ...deltaPollingFeatureEnabled() ? { deltaCursor: currentDeltaCursor } : {}
3197
+ };
3156
3198
  }
3157
3199
  const BRANCH_SPAN_TYPE_PLACEHOLDERS = _mastra_core_storage.BRANCH_SPAN_TYPES.map(() => "?").join(", ");
3158
3200
  /**
@@ -3628,6 +3670,7 @@ var ObservabilityStorageDuckDB = class extends _mastra_core_storage.Observabilit
3628
3670
  return listTraces(this.db, args);
3629
3671
  }
3630
3672
  async listTracesLight(args) {
3673
+ if (args.mode === "delta") return super.listTracesLight(args);
3631
3674
  return listTracesLight(this.db, args);
3632
3675
  }
3633
3676
  async listBranches(args) {
@@ -3730,4 +3773,4 @@ var ObservabilityStorageDuckDB = class extends _mastra_core_storage.Observabilit
3730
3773
  //#endregion
3731
3774
  exports.ObservabilityStorageDuckDB = ObservabilityStorageDuckDB;
3732
3775
 
3733
- //# sourceMappingURL=observability-DjqzPR8Z.cjs.map
3776
+ //# sourceMappingURL=observability-BN6FroNp.cjs.map