@mastra/clickhouse 1.30.0-alpha.2 → 1.30.0-alpha.3

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.js CHANGED
@@ -8216,7 +8216,7 @@ function afterCursor$1(plan, parameters) {
8216
8216
  const equal = [];
8217
8217
  if (cursor.sortValue === null) equal.push(`isNull(${field})`);
8218
8218
  else {
8219
- const numeric = plan.orderBy.field === "timeToFirstChunkMs" || plan.orderBy.field === "timeToFirstTokenMs";
8219
+ const numeric = typeof cursor.sortValue === "number";
8220
8220
  const value = parameters.add(cursor.sortValue, numeric ? "Float64" : "DateTime64(3, 'UTC')");
8221
8221
  terms.push(`${field} ${plan.orderBy.direction === "asc" ? ">" : "<"} ${value}`);
8222
8222
  if (numeric) terms.push(`isNull(${field})`);
@@ -8444,7 +8444,8 @@ async function querySpans(client, plan, timeoutMs) {
8444
8444
  const selected = (await run(compileClickHouseSpanQuery(plan))).map((row) => ({
8445
8445
  ...row,
8446
8446
  startedAt: iso$1(row.startedAt),
8447
- endedAt: iso$1(row.endedAt)
8447
+ endedAt: iso$1(row.endedAt),
8448
+ ...row.durationMs === void 0 ? {} : { durationMs: Number(row.durationMs) }
8448
8449
  }));
8449
8450
  const page = selected.slice(0, plan.limit);
8450
8451
  if (!page.length) return {
@@ -10041,6 +10042,7 @@ function buildBranchCursor(row) {
10041
10042
  const spanQueryFeatures = typeof coreStorage.planSpanQuery === "function" ? [
10042
10043
  "span-query",
10043
10044
  "span-query-context-fields",
10045
+ ...coreStorage.SPAN_QUERY_ORDER_FIELDS?.includes("durationMs") ? ["span-query-duration-sort"] : [],
10044
10046
  ..."model" in (coreStorage.SPAN_QUERY_FIELD_REGISTRY ?? {}) ? ["span-query-model-fields"] : []
10045
10047
  ] : [];
10046
10048
  const spanAggregateFeatures = typeof coreStorage.planSpanAggregate === "function" ? ["span-aggregate", ..."model" in (coreStorage.SPAN_AGGREGATE_DIMENSION_REGISTRY ?? {}) ? ["span-aggregate-model-dimensions"] : []] : [];