@mastra/clickhouse 1.22.0 → 1.22.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.
@@ -3,7 +3,7 @@ name: mastra-clickhouse
3
3
  description: Documentation for @mastra/clickhouse. Use when working with @mastra/clickhouse APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/clickhouse"
6
- version: "1.22.0"
6
+ version: "1.22.1-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.22.0",
2
+ "version": "1.22.1-alpha.0",
3
3
  "package": "@mastra/clickhouse",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -27,7 +27,6 @@ let _mastra_core_storage = require("@mastra/core/storage");
27
27
  _mastra_core_storage = __toESM(_mastra_core_storage, 1);
28
28
  let _mastra_core_agent = require("@mastra/core/agent");
29
29
  let _mastra_core_base = require("@mastra/core/base");
30
- let crypto$1 = require("crypto");
31
30
  let _mastra_core_utils = require("@mastra/core/utils");
32
31
  let _mastra_core_features = require("@mastra/core/features");
33
32
  let zod_v4 = require("zod/v4");
@@ -3890,6 +3889,8 @@ function rowToLightSpanRecord(row) {
3890
3889
  entityType: nullableEntityType(row.entityType),
3891
3890
  entityId: nullableString(row.entityId),
3892
3891
  entityName: nullableString(row.entityName),
3892
+ threadId: nullableString(row.threadId),
3893
+ resourceId: nullableString(row.resourceId),
3893
3894
  error,
3894
3895
  status: (0, _mastra_core_storage.computeTraceStatus)({
3895
3896
  error,
@@ -4838,7 +4839,7 @@ async function batchCreateFeedback(client, args) {
4838
4839
  async function deleteFeedback(client, args, replication) {
4839
4840
  if (args.feedbackIds.length === 0) return;
4840
4841
  const request = await recordDeletionRequest(client, {
4841
- requestId: (0, crypto$1.randomUUID)(),
4842
+ requestId: globalThis.crypto.randomUUID(),
4842
4843
  organizationId: args.organizationId,
4843
4844
  resourceId: args.resourceId,
4844
4845
  signal: "feedback",
@@ -6293,7 +6294,7 @@ async function batchCreateScores(client, args) {
6293
6294
  async function deleteScores(client, args, replication) {
6294
6295
  if (args.scoreIds.length === 0) return;
6295
6296
  const request = await recordDeletionRequest(client, {
6296
- requestId: (0, crypto$1.randomUUID)(),
6297
+ requestId: globalThis.crypto.randomUUID(),
6297
6298
  organizationId: args.organizationId,
6298
6299
  resourceId: args.resourceId,
6299
6300
  signal: "scores",
@@ -7468,6 +7469,8 @@ const LIGHT_TRACE_ROOT_FIELDS = [
7468
7469
  "entityType",
7469
7470
  "entityId",
7470
7471
  "entityName",
7472
+ "threadId",
7473
+ "resourceId",
7471
7474
  "error",
7472
7475
  "metadataRaw",
7473
7476
  "input"
@@ -7667,17 +7670,6 @@ function buildTraceCursor(row) {
7667
7670
  }
7668
7671
  //#endregion
7669
7672
  //#region src/storage/domains/observability/v-next/tracing.ts
7670
- /**
7671
- * Tracing operations for ClickHouse v-next observability.
7672
- *
7673
- * Owns: batchCreateSpans, getSpan, getSpans, getTrace, getTraceLight,
7674
- * listBranches, batchDeleteTraces, dangerouslyClearSpanEvents.
7675
- * Delegates to trace-roots.ts: listTraces, getRootSpan.
7676
- *
7677
- * `listBranches` reads from the MV-fed `mastra_trace_branches` table (one row
7678
- * per branch anchor span). It lives here -- alongside the other read paths
7679
- * over the trace data -- since branches are conceptually a subset of traces.
7680
- */
7681
7673
  const BRANCH_SPAN_TYPE_SQL_LIST = _mastra_core_storage.BRANCH_SPAN_TYPES.map((t) => `'${t}'`).join(", ");
7682
7674
  /** Insert a single completed span. */
7683
7675
  async function createSpan(client, args) {
@@ -7844,7 +7836,7 @@ async function getTraceLight(client, args) {
7844
7836
  async function batchDeleteTraces(client, args, replication) {
7845
7837
  if (args.traceIds.length === 0) return;
7846
7838
  const request = await recordDeletionRequest(client, {
7847
- requestId: (0, crypto$1.randomUUID)(),
7839
+ requestId: globalThis.crypto.randomUUID(),
7848
7840
  organizationId: args.organizationId,
7849
7841
  resourceId: args.resourceId,
7850
7842
  signal: "traces",