@mastra/observability 1.9.1 → 1.9.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 +11 -0
- package/dist/exporters/cloud.d.ts.map +1 -1
- package/dist/index.cjs +5 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -52
- package/dist/index.js.map +1 -1
- package/dist/model-tracing.d.ts.map +1 -1
- package/dist/spans/serialization.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -15050,7 +15050,6 @@ var SIGNAL_PUBLISH_SEGMENTS = {
|
|
|
15050
15050
|
scores: "scores",
|
|
15051
15051
|
feedback: "feedback"
|
|
15052
15052
|
};
|
|
15053
|
-
var DEFAULT_CLOUD_ENDPOINT = "https://api.mastra.ai";
|
|
15054
15053
|
function trimTrailingSlashes(value) {
|
|
15055
15054
|
let end = value.length;
|
|
15056
15055
|
while (end > 0 && value.charCodeAt(end - 1) === 47) {
|
|
@@ -15179,7 +15178,7 @@ var CloudExporter = class extends BaseExporter {
|
|
|
15179
15178
|
if (tracesEndpointOverride) {
|
|
15180
15179
|
tracesEndpoint = resolveExplicitSignalEndpoint("traces", tracesEndpointOverride, projectId);
|
|
15181
15180
|
} else {
|
|
15182
|
-
baseEndpoint = resolveBaseEndpoint(config2.endpoint ??
|
|
15181
|
+
baseEndpoint = resolveBaseEndpoint(config2.endpoint ?? "https://observability.mastra.ai");
|
|
15183
15182
|
tracesEndpoint = buildSignalEndpoint(baseEndpoint, "traces", projectId);
|
|
15184
15183
|
}
|
|
15185
15184
|
const resolveConfiguredSignalEndpoint = (signal, explicitEndpoint) => {
|
|
@@ -17428,51 +17427,6 @@ function isJsonSchema(val) {
|
|
|
17428
17427
|
}
|
|
17429
17428
|
return false;
|
|
17430
17429
|
}
|
|
17431
|
-
function compressJsonSchema(schema, depth = 0) {
|
|
17432
|
-
if (depth > 3) {
|
|
17433
|
-
return schema.type || "object";
|
|
17434
|
-
}
|
|
17435
|
-
const compositionKeys = ["oneOf", "anyOf", "allOf"].filter((key) => Array.isArray(schema[key]));
|
|
17436
|
-
if (compositionKeys.length > 0) {
|
|
17437
|
-
const compressed2 = {};
|
|
17438
|
-
for (const key of compositionKeys) {
|
|
17439
|
-
compressed2[key] = schema[key].map((entry) => compressJsonSchema(entry, depth + 1));
|
|
17440
|
-
}
|
|
17441
|
-
if (typeof schema.type === "string") {
|
|
17442
|
-
compressed2.type = schema.type;
|
|
17443
|
-
}
|
|
17444
|
-
return compressed2;
|
|
17445
|
-
}
|
|
17446
|
-
if (schema.type !== "object" || !schema.properties) {
|
|
17447
|
-
return schema.type || schema;
|
|
17448
|
-
}
|
|
17449
|
-
const required2 = new Set(Array.isArray(schema.required) ? schema.required : []);
|
|
17450
|
-
const compressed = {};
|
|
17451
|
-
for (const [key, propSchema] of Object.entries(schema.properties)) {
|
|
17452
|
-
const prop = propSchema;
|
|
17453
|
-
let value = prop.type || "unknown";
|
|
17454
|
-
if (prop.type === "object" && prop.properties) {
|
|
17455
|
-
value = compressJsonSchema(prop, depth + 1);
|
|
17456
|
-
if (required2.has(key)) {
|
|
17457
|
-
compressed[key + " (required)"] = value;
|
|
17458
|
-
continue;
|
|
17459
|
-
}
|
|
17460
|
-
} else if (prop.type === "array" && prop.items) {
|
|
17461
|
-
if (prop.items.type === "object" && prop.items.properties) {
|
|
17462
|
-
value = [compressJsonSchema(prop.items, depth + 1)];
|
|
17463
|
-
} else {
|
|
17464
|
-
value = `${prop.items.type || "any"}[]`;
|
|
17465
|
-
}
|
|
17466
|
-
} else if (prop.enum) {
|
|
17467
|
-
value = prop.enum.map((v) => JSON.stringify(v)).join(" | ");
|
|
17468
|
-
}
|
|
17469
|
-
if (required2.has(key) && typeof value === "string") {
|
|
17470
|
-
value += " (required)";
|
|
17471
|
-
}
|
|
17472
|
-
compressed[key] = value;
|
|
17473
|
-
}
|
|
17474
|
-
return compressed;
|
|
17475
|
-
}
|
|
17476
17430
|
function deepClean(value, options = DEFAULT_DEEP_CLEAN_OPTIONS) {
|
|
17477
17431
|
const { keysToStrip, maxDepth, maxStringLength, maxArrayLength, maxObjectKeys } = options;
|
|
17478
17432
|
const stripSet = keysToStrip instanceof Set ? keysToStrip : new Set(Array.isArray(keysToStrip) ? keysToStrip : Object.keys(keysToStrip));
|
|
@@ -17652,11 +17606,7 @@ function deepClean(value, options = DEFAULT_DEEP_CLEAN_OPTIONS) {
|
|
|
17652
17606
|
looksLikeJsonSchema = false;
|
|
17653
17607
|
}
|
|
17654
17608
|
if (looksLikeJsonSchema) {
|
|
17655
|
-
|
|
17656
|
-
const compressed = compressJsonSchema(val);
|
|
17657
|
-
return compressed === val ? "[JSONSchema]" : helper(compressed, depth);
|
|
17658
|
-
} catch {
|
|
17659
|
-
}
|
|
17609
|
+
return val;
|
|
17660
17610
|
}
|
|
17661
17611
|
const cleaned = {};
|
|
17662
17612
|
const keys = Object.keys(val).filter((key) => !stripSet.has(key));
|
|
@@ -18759,6 +18709,9 @@ function summarizeRequestBody(body) {
|
|
|
18759
18709
|
if (Array.isArray(body.messages)) {
|
|
18760
18710
|
return normalizeMessages(body.messages);
|
|
18761
18711
|
}
|
|
18712
|
+
if (Array.isArray(body.input)) {
|
|
18713
|
+
return normalizeMessages(body.input);
|
|
18714
|
+
}
|
|
18762
18715
|
if (Array.isArray(body.contents)) {
|
|
18763
18716
|
return body.contents.map((item) => ({
|
|
18764
18717
|
role: typeof item?.role === "string" ? item.role : "user",
|