@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.
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +7 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -15
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/observability/v-next/feedback.d.ts.map +1 -1
- package/dist/storage/domains/observability/v-next/helpers.d.ts.map +1 -1
- package/dist/storage/domains/observability/v-next/scores.d.ts.map +1 -1
- package/dist/storage/domains/observability/v-next/trace-roots.d.ts.map +1 -1
- package/dist/storage/domains/observability/v-next/tracing.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import * as coreStorage from "@mastra/core/storage";
|
|
|
4
4
|
import { BRANCH_SPAN_TYPES, EntityType, METRIC_DISTINCT_COLUMNS, MastraCompositeStore, MemoryStorage, ObservabilityStorage, SCORERS_SCHEMA, SPAN_SCHEMA, ScoresStorage, TABLE_AGENT_VERSIONS, TABLE_DATASETS, TABLE_DATASET_ITEMS, TABLE_DATASET_VERSIONS, TABLE_EXPERIMENTS, TABLE_EXPERIMENT_RESULTS, TABLE_FAVORITES, TABLE_HARNESS_SESSIONS, TABLE_KNOWLEDGE_ACTIVITY, TABLE_KNOWLEDGE_CURSORS, TABLE_KNOWLEDGE_MENTIONS, TABLE_KNOWLEDGE_NODES, TABLE_KNOWLEDGE_RECORDS, TABLE_KNOWLEDGE_SEMANTIC_OUTBOX, TABLE_MCP_CLIENTS, TABLE_MCP_CLIENT_VERSIONS, TABLE_MCP_SERVERS, TABLE_MCP_SERVER_VERSIONS, TABLE_MESSAGES, TABLE_NOTIFICATIONS, TABLE_PROMPT_BLOCKS, TABLE_PROMPT_BLOCK_VERSIONS, TABLE_RESOURCES, TABLE_SCHEDULES, TABLE_SCHEDULE_TRIGGERS, TABLE_SCHEMAS, TABLE_SCORERS, TABLE_SCORER_DEFINITIONS, TABLE_SCORER_DEFINITION_VERSIONS, TABLE_SKILLS, TABLE_SKILL_BLOBS, TABLE_SKILL_VERSIONS, TABLE_SPANS, TABLE_THREADS, TABLE_THREAD_STATE, TABLE_TOOL_PROVIDER_CONNECTIONS, TABLE_TRACES, TABLE_WORKFLOW_DEFINITIONS, TABLE_WORKFLOW_SNAPSHOT, TABLE_WORKSPACES, TABLE_WORKSPACE_VERSIONS, TraceStatus, WorkflowsStorage, buildInputPreview, calculatePagination, computeTraceStatus, createStorageErrorId, getDefaultValue, getSqlType, listBranchesArgsSchema, listFeedbackArgsSchema, listLogsArgsSchema, listMetricsArgsSchema, listScoresArgsSchema, listTracesArgsSchema, normalizePerPage, safelyParseJSON, toTraceSpans, transformScoreRow, validateStorageMetadataFilter } from "@mastra/core/storage";
|
|
5
5
|
import { MessageList } from "@mastra/core/agent";
|
|
6
6
|
import { MastraBase } from "@mastra/core/base";
|
|
7
|
-
import { randomUUID } from "crypto";
|
|
8
7
|
import { parseFieldKey } from "@mastra/core/utils";
|
|
9
8
|
import { coreFeatures } from "@mastra/core/features";
|
|
10
9
|
import { z } from "zod/v4";
|
|
@@ -3867,6 +3866,8 @@ function rowToLightSpanRecord(row) {
|
|
|
3867
3866
|
entityType: nullableEntityType(row.entityType),
|
|
3868
3867
|
entityId: nullableString(row.entityId),
|
|
3869
3868
|
entityName: nullableString(row.entityName),
|
|
3869
|
+
threadId: nullableString(row.threadId),
|
|
3870
|
+
resourceId: nullableString(row.resourceId),
|
|
3870
3871
|
error,
|
|
3871
3872
|
status: computeTraceStatus({
|
|
3872
3873
|
error,
|
|
@@ -4815,7 +4816,7 @@ async function batchCreateFeedback(client, args) {
|
|
|
4815
4816
|
async function deleteFeedback(client, args, replication) {
|
|
4816
4817
|
if (args.feedbackIds.length === 0) return;
|
|
4817
4818
|
const request = await recordDeletionRequest(client, {
|
|
4818
|
-
requestId: randomUUID(),
|
|
4819
|
+
requestId: globalThis.crypto.randomUUID(),
|
|
4819
4820
|
organizationId: args.organizationId,
|
|
4820
4821
|
resourceId: args.resourceId,
|
|
4821
4822
|
signal: "feedback",
|
|
@@ -6270,7 +6271,7 @@ async function batchCreateScores(client, args) {
|
|
|
6270
6271
|
async function deleteScores(client, args, replication) {
|
|
6271
6272
|
if (args.scoreIds.length === 0) return;
|
|
6272
6273
|
const request = await recordDeletionRequest(client, {
|
|
6273
|
-
requestId: randomUUID(),
|
|
6274
|
+
requestId: globalThis.crypto.randomUUID(),
|
|
6274
6275
|
organizationId: args.organizationId,
|
|
6275
6276
|
resourceId: args.resourceId,
|
|
6276
6277
|
signal: "scores",
|
|
@@ -7445,6 +7446,8 @@ const LIGHT_TRACE_ROOT_FIELDS = [
|
|
|
7445
7446
|
"entityType",
|
|
7446
7447
|
"entityId",
|
|
7447
7448
|
"entityName",
|
|
7449
|
+
"threadId",
|
|
7450
|
+
"resourceId",
|
|
7448
7451
|
"error",
|
|
7449
7452
|
"metadataRaw",
|
|
7450
7453
|
"input"
|
|
@@ -7644,17 +7647,6 @@ function buildTraceCursor(row) {
|
|
|
7644
7647
|
}
|
|
7645
7648
|
//#endregion
|
|
7646
7649
|
//#region src/storage/domains/observability/v-next/tracing.ts
|
|
7647
|
-
/**
|
|
7648
|
-
* Tracing operations for ClickHouse v-next observability.
|
|
7649
|
-
*
|
|
7650
|
-
* Owns: batchCreateSpans, getSpan, getSpans, getTrace, getTraceLight,
|
|
7651
|
-
* listBranches, batchDeleteTraces, dangerouslyClearSpanEvents.
|
|
7652
|
-
* Delegates to trace-roots.ts: listTraces, getRootSpan.
|
|
7653
|
-
*
|
|
7654
|
-
* `listBranches` reads from the MV-fed `mastra_trace_branches` table (one row
|
|
7655
|
-
* per branch anchor span). It lives here -- alongside the other read paths
|
|
7656
|
-
* over the trace data -- since branches are conceptually a subset of traces.
|
|
7657
|
-
*/
|
|
7658
7650
|
const BRANCH_SPAN_TYPE_SQL_LIST = BRANCH_SPAN_TYPES.map((t) => `'${t}'`).join(", ");
|
|
7659
7651
|
/** Insert a single completed span. */
|
|
7660
7652
|
async function createSpan(client, args) {
|
|
@@ -7821,7 +7813,7 @@ async function getTraceLight(client, args) {
|
|
|
7821
7813
|
async function batchDeleteTraces(client, args, replication) {
|
|
7822
7814
|
if (args.traceIds.length === 0) return;
|
|
7823
7815
|
const request = await recordDeletionRequest(client, {
|
|
7824
|
-
requestId: randomUUID(),
|
|
7816
|
+
requestId: globalThis.crypto.randomUUID(),
|
|
7825
7817
|
organizationId: args.organizationId,
|
|
7826
7818
|
resourceId: args.resourceId,
|
|
7827
7819
|
signal: "traces",
|