@mastra/server 1.66.0-alpha.0 → 1.66.0-alpha.2
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/_types/@internal_core/dist/storage/index.d.ts +29 -1
- package/dist/{api-schema-manifest-DxEVjj1H.js → api-schema-manifest-BkKHbFJi.js} +2 -2
- package/dist/{api-schema-manifest-DxEVjj1H.js.map → api-schema-manifest-BkKHbFJi.js.map} +1 -1
- package/dist/{api-schema-manifest-Dkxez6Mn.cjs → api-schema-manifest-Cpw4nIVv.cjs} +2 -2
- package/dist/{api-schema-manifest-Dkxez6Mn.cjs.map → api-schema-manifest-Cpw4nIVv.cjs.map} +1 -1
- package/dist/{datasets-D0C0V2kk.js → datasets-B4qPHzEy.js} +8 -2
- package/dist/datasets-B4qPHzEy.js.map +1 -0
- package/dist/{datasets-BVbtevHd.cjs → datasets-C-_ZWnxR.cjs} +13 -1
- package/dist/datasets-C-_ZWnxR.cjs.map +1 -0
- package/dist/{dist-CX9x93MJ.js → dist-4Qm6OSPJ.js} +58 -21
- package/dist/dist-4Qm6OSPJ.js.map +1 -0
- package/dist/{dist-BnPncT17.cjs → dist-BmrsK_KX.cjs} +58 -21
- package/dist/{dist-BnPncT17.cjs.map → dist-BmrsK_KX.cjs.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-observability-tracing-trace-query.md +169 -9
- package/dist/{observability-new-endpoints-DF85EOQS.cjs → observability-new-endpoints-BNPjbEXf.cjs} +53 -1
- package/dist/observability-new-endpoints-BNPjbEXf.cjs.map +1 -0
- package/dist/{observability-new-endpoints-Zm5VNGIa.js → observability-new-endpoints-CSiMF_Kf.js} +42 -2
- package/dist/observability-new-endpoints-CSiMF_Kf.js.map +1 -0
- package/dist/{routes-DD3joMdw.js → routes-DCwOOz84.js} +4 -2
- package/dist/routes-DCwOOz84.js.map +1 -0
- package/dist/{routes-KL4Vw4qy.cjs → routes-Dgd2S9av.cjs} +4 -2
- package/dist/routes-Dgd2S9av.cjs.map +1 -0
- package/dist/server/handlers/agent-builder.cjs +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/datasets.cjs +5 -4
- package/dist/server/handlers/datasets.cjs.map +1 -1
- package/dist/server/handlers/datasets.d.ts +2 -0
- package/dist/server/handlers/datasets.d.ts.map +1 -1
- package/dist/server/handlers/datasets.js +5 -4
- package/dist/server/handlers/datasets.js.map +1 -1
- package/dist/server/handlers/observability-new-endpoints.cjs +3 -1
- package/dist/server/handlers/observability-new-endpoints.d.ts +132 -0
- package/dist/server/handlers/observability-new-endpoints.d.ts.map +1 -1
- package/dist/server/handlers/observability-new-endpoints.js +2 -2
- package/dist/server/handlers/observability-shared.cjs +14 -0
- package/dist/server/handlers/observability-shared.cjs.map +1 -1
- package/dist/server/handlers/observability-shared.d.ts +14 -0
- package/dist/server/handlers/observability-shared.d.ts.map +1 -1
- package/dist/server/handlers/observability-shared.js +14 -0
- package/dist/server/handlers/observability-shared.js.map +1 -1
- package/dist/server/handlers/observability.cjs +5 -1
- package/dist/server/handlers/observability.cjs.map +1 -1
- package/dist/server/handlers/observability.js +4 -2
- package/dist/server/handlers/observability.js.map +1 -1
- package/dist/server/handlers/system.cjs +1 -1
- package/dist/server/handlers/system.js +1 -1
- package/dist/server/schemas/datasets.d.ts +5 -0
- package/dist/server/schemas/datasets.d.ts.map +1 -1
- package/dist/server/schemas/index.cjs +2 -1
- package/dist/server/schemas/index.js +2 -2
- package/dist/server/server-adapter/index.cjs +1 -1
- package/dist/server/server-adapter/index.js +1 -1
- package/dist/server/server-adapter/routes/datasets.d.ts +2 -0
- package/dist/server/server-adapter/routes/datasets.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/observability.d.ts +64 -0
- package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/datasets-BVbtevHd.cjs.map +0 -1
- package/dist/datasets-D0C0V2kk.js.map +0 -1
- package/dist/dist-CX9x93MJ.js.map +0 -1
- package/dist/observability-new-endpoints-DF85EOQS.cjs.map +0 -1
- package/dist/observability-new-endpoints-Zm5VNGIa.js.map +0 -1
- package/dist/routes-DD3joMdw.js.map +0 -1
- package/dist/routes-KL4Vw4qy.cjs.map +0 -1
|
@@ -4694,7 +4694,7 @@ function splitLines(text) {
|
|
|
4694
4694
|
return result;
|
|
4695
4695
|
}
|
|
4696
4696
|
//#endregion
|
|
4697
|
-
//#region ../memory/dist/src-
|
|
4697
|
+
//#region ../memory/dist/src-BNB8ko_o.js
|
|
4698
4698
|
var __defProp$3 = Object.defineProperty;
|
|
4699
4699
|
var __exportAll = (all, no_symbols) => {
|
|
4700
4700
|
let target = {};
|
|
@@ -23464,11 +23464,11 @@ function formatObserverAttachmentPlaceholder(part, counter) {
|
|
|
23464
23464
|
const label = resolveObserverAttachmentLabel(part);
|
|
23465
23465
|
return label ? `[${attachmentType} #${attachmentId}: ${label}]` : `[${attachmentType} #${attachmentId}]`;
|
|
23466
23466
|
}
|
|
23467
|
-
function isRecord$
|
|
23467
|
+
function isRecord$4(value) {
|
|
23468
23468
|
return !!value && typeof value === "object";
|
|
23469
23469
|
}
|
|
23470
23470
|
function mapToolResultBlockToAttachment(block) {
|
|
23471
|
-
if (!isRecord$
|
|
23471
|
+
if (!isRecord$4(block) || typeof block.type !== "string") return;
|
|
23472
23472
|
const mediaType = typeof block.mediaType === "string" ? block.mediaType : void 0;
|
|
23473
23473
|
const filename = typeof block.filename === "string" ? block.filename : void 0;
|
|
23474
23474
|
switch (block.type) {
|
|
@@ -23529,7 +23529,7 @@ function mapToolResultBlockToAttachment(block) {
|
|
|
23529
23529
|
}
|
|
23530
23530
|
}
|
|
23531
23531
|
function extractToolResultAttachments(result, counter, attachmentFilter) {
|
|
23532
|
-
if (!isRecord$
|
|
23532
|
+
if (!isRecord$4(result) || result.type !== "content" || !Array.isArray(result.value)) return {
|
|
23533
23533
|
resultWithoutAttachments: result,
|
|
23534
23534
|
attachments: []
|
|
23535
23535
|
};
|
|
@@ -23543,7 +23543,7 @@ function extractToolResultAttachments(result, counter, attachmentFilter) {
|
|
|
23543
23543
|
if (shouldIncludeObserverAttachment(attachment, attachmentFilter)) attachments.push(toObserverInputAttachmentPart(attachment));
|
|
23544
23544
|
const placeholder = formatObserverAttachmentPlaceholder(attachment, counter);
|
|
23545
23545
|
return {
|
|
23546
|
-
type: isRecord$
|
|
23546
|
+
type: isRecord$4(block) ? block.type : void 0,
|
|
23547
23547
|
placeholder
|
|
23548
23548
|
};
|
|
23549
23549
|
});
|
|
@@ -24162,17 +24162,17 @@ const TRANSIENT_MESSAGE_SUBSTRINGS = [
|
|
|
24162
24162
|
"connection reset",
|
|
24163
24163
|
"connection closed"
|
|
24164
24164
|
];
|
|
24165
|
-
function isRecord$
|
|
24165
|
+
function isRecord$3(value) {
|
|
24166
24166
|
return typeof value === "object" && value !== null;
|
|
24167
24167
|
}
|
|
24168
24168
|
function isAbortError$5(error) {
|
|
24169
|
-
if (!isRecord$
|
|
24169
|
+
if (!isRecord$3(error)) return false;
|
|
24170
24170
|
if (error.name === "AbortError") return true;
|
|
24171
24171
|
if (typeof error.code === "string" && error.code === "ABORT_ERR") return true;
|
|
24172
24172
|
return false;
|
|
24173
24173
|
}
|
|
24174
24174
|
function hasTransientMessage(value) {
|
|
24175
|
-
if (!isRecord$
|
|
24175
|
+
if (!isRecord$3(value)) return false;
|
|
24176
24176
|
const message = typeof value.message === "string" ? value.message.toLowerCase() : "";
|
|
24177
24177
|
if (message && TRANSIENT_MESSAGE_SUBSTRINGS.some((sub) => message.includes(sub))) return true;
|
|
24178
24178
|
if (typeof value.code === "string" && value.code.toUpperCase().startsWith("UND_ERR_")) return true;
|
|
@@ -24183,13 +24183,13 @@ function isRetryableHttpStatus(status) {
|
|
|
24183
24183
|
return status >= 500 && status <= 599;
|
|
24184
24184
|
}
|
|
24185
24185
|
function hasRetryableHttpStatus(value) {
|
|
24186
|
-
if (!isRecord$
|
|
24186
|
+
if (!isRecord$3(value)) return false;
|
|
24187
24187
|
if (typeof value.statusCode === "number" && isRetryableHttpStatus(value.statusCode)) return true;
|
|
24188
24188
|
if (typeof value.code === "number" && isRetryableHttpStatus(value.code)) return true;
|
|
24189
24189
|
return false;
|
|
24190
24190
|
}
|
|
24191
24191
|
function hasIsRetryableFlag(value) {
|
|
24192
|
-
if (!isRecord$
|
|
24192
|
+
if (!isRecord$3(value)) return false;
|
|
24193
24193
|
return value.isRetryable === true;
|
|
24194
24194
|
}
|
|
24195
24195
|
/**
|
|
@@ -24207,14 +24207,14 @@ function isTransientLLMError(error) {
|
|
|
24207
24207
|
if (isAbortError$5(error)) return false;
|
|
24208
24208
|
const visited = /* @__PURE__ */ new WeakSet();
|
|
24209
24209
|
function visit(candidate) {
|
|
24210
|
-
if (isRecord$
|
|
24210
|
+
if (isRecord$3(candidate)) {
|
|
24211
24211
|
if (visited.has(candidate)) return false;
|
|
24212
24212
|
visited.add(candidate);
|
|
24213
24213
|
}
|
|
24214
24214
|
if (hasTransientMessage(candidate)) return true;
|
|
24215
24215
|
if (hasRetryableHttpStatus(candidate)) return true;
|
|
24216
24216
|
if (hasIsRetryableFlag(candidate)) return true;
|
|
24217
|
-
if (isRecord$
|
|
24217
|
+
if (isRecord$3(candidate)) {
|
|
24218
24218
|
if (visit(candidate.cause)) return true;
|
|
24219
24219
|
if (visit(candidate.error)) return true;
|
|
24220
24220
|
}
|
|
@@ -27946,6 +27946,43 @@ function didProviderChange(actorModel, lastModel) {
|
|
|
27946
27946
|
if (actorContext.provider && lastContext.provider) return actorContext.provider !== lastContext.provider;
|
|
27947
27947
|
return false;
|
|
27948
27948
|
}
|
|
27949
|
+
function isRecord$2(value) {
|
|
27950
|
+
return typeof value === "object" && value !== null;
|
|
27951
|
+
}
|
|
27952
|
+
/** Keep provider diagnostics in streamed/persisted markers, not whole API request/response objects. */
|
|
27953
|
+
function formatOmError(error) {
|
|
27954
|
+
const details = /* @__PURE__ */ new Set();
|
|
27955
|
+
const visited = /* @__PURE__ */ new Set();
|
|
27956
|
+
const add = (value) => {
|
|
27957
|
+
if (typeof value === "string" && value.trim()) details.add(value.trim().slice(0, 2e3));
|
|
27958
|
+
};
|
|
27959
|
+
function collectErrorDetails(value, depth) {
|
|
27960
|
+
if (depth > 5) return;
|
|
27961
|
+
if (!isRecord$2(value)) {
|
|
27962
|
+
if (value !== void 0) add(String(value));
|
|
27963
|
+
return;
|
|
27964
|
+
}
|
|
27965
|
+
if (visited.has(value)) return;
|
|
27966
|
+
visited.add(value);
|
|
27967
|
+
add(value.message);
|
|
27968
|
+
if (typeof value.statusCode === "number") add(`HTTP ${value.statusCode}`);
|
|
27969
|
+
if (typeof value.responseBody === "string") try {
|
|
27970
|
+
const body = JSON.parse(value.responseBody);
|
|
27971
|
+
if (isRecord$2(body)) {
|
|
27972
|
+
add(body.message);
|
|
27973
|
+
if (isRecord$2(body.error)) add(body.error.message);
|
|
27974
|
+
else add(body.error);
|
|
27975
|
+
}
|
|
27976
|
+
} catch {}
|
|
27977
|
+
if (value.cause !== void 0) collectErrorDetails(value.cause, depth + 1);
|
|
27978
|
+
if (value.error !== void 0) collectErrorDetails(value.error, depth + 1);
|
|
27979
|
+
}
|
|
27980
|
+
try {
|
|
27981
|
+
collectErrorDetails(error, 0);
|
|
27982
|
+
} catch {}
|
|
27983
|
+
const message = [...details].join(": ") || "Unknown error";
|
|
27984
|
+
return message.length > 2e3 ? `${message.slice(0, 1997)}...` : message;
|
|
27985
|
+
}
|
|
27949
27986
|
/**
|
|
27950
27987
|
* Create a start marker for when observation begins.
|
|
27951
27988
|
*/
|
|
@@ -28003,7 +28040,7 @@ function createObservationFailedMarker(params) {
|
|
|
28003
28040
|
failedAt,
|
|
28004
28041
|
durationMs,
|
|
28005
28042
|
tokensAttempted: params.tokensAttempted,
|
|
28006
|
-
error: params.error,
|
|
28043
|
+
error: formatOmError(params.error),
|
|
28007
28044
|
recordId: params.recordId,
|
|
28008
28045
|
threadId: params.threadId
|
|
28009
28046
|
}
|
|
@@ -28064,7 +28101,7 @@ function createBufferingFailedMarker(params) {
|
|
|
28064
28101
|
failedAt,
|
|
28065
28102
|
durationMs,
|
|
28066
28103
|
tokensAttempted: params.tokensAttempted,
|
|
28067
|
-
error: params.error,
|
|
28104
|
+
error: formatOmError(params.error),
|
|
28068
28105
|
recordId: params.recordId,
|
|
28069
28106
|
threadId: params.threadId
|
|
28070
28107
|
}
|
|
@@ -28679,7 +28716,7 @@ var ObservationStrategy = class ObservationStrategy {
|
|
|
28679
28716
|
cycleId,
|
|
28680
28717
|
operationType: "observation",
|
|
28681
28718
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
28682
|
-
error:
|
|
28719
|
+
error: formatOmError(error),
|
|
28683
28720
|
recordId: record.id,
|
|
28684
28721
|
threadId
|
|
28685
28722
|
}
|
|
@@ -29078,7 +29115,7 @@ var SyncObservationStrategy = class extends ObservationStrategy {
|
|
|
29078
29115
|
operationType: "observation",
|
|
29079
29116
|
startedAt: this.startedAt,
|
|
29080
29117
|
tokensAttempted: this.tokensToObserve,
|
|
29081
|
-
error
|
|
29118
|
+
error,
|
|
29082
29119
|
recordId: this.opts.record.id,
|
|
29083
29120
|
threadId: this.opts.threadId
|
|
29084
29121
|
});
|
|
@@ -29277,7 +29314,7 @@ var AsyncBufferObservationStrategy = class extends ObservationStrategy {
|
|
|
29277
29314
|
operationType: "observation",
|
|
29278
29315
|
startedAt: this.startedAt,
|
|
29279
29316
|
tokensAttempted,
|
|
29280
|
-
error
|
|
29317
|
+
error,
|
|
29281
29318
|
recordId: record.id,
|
|
29282
29319
|
threadId
|
|
29283
29320
|
});
|
|
@@ -29643,7 +29680,7 @@ var ResourceScopedObservationStrategy = class extends ObservationStrategy {
|
|
|
29643
29680
|
operationType: "observation",
|
|
29644
29681
|
startedAt: this.startedAt,
|
|
29645
29682
|
tokensAttempted,
|
|
29646
|
-
error
|
|
29683
|
+
error,
|
|
29647
29684
|
recordId: this.opts.record.id,
|
|
29648
29685
|
threadId
|
|
29649
29686
|
});
|
|
@@ -30897,7 +30934,7 @@ var ReflectorRunner = class {
|
|
|
30897
30934
|
operationType: "reflection",
|
|
30898
30935
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
30899
30936
|
tokensAttempted: observationTokens,
|
|
30900
|
-
error
|
|
30937
|
+
error,
|
|
30901
30938
|
recordId: record.id,
|
|
30902
30939
|
threadId: record.threadId ?? ""
|
|
30903
30940
|
});
|
|
@@ -31316,7 +31353,7 @@ var ReflectorRunner = class {
|
|
|
31316
31353
|
operationType: "reflection",
|
|
31317
31354
|
startedAt: streamContext.startedAt,
|
|
31318
31355
|
tokensAttempted: observationTokens,
|
|
31319
|
-
error
|
|
31356
|
+
error,
|
|
31320
31357
|
recordId: record.id,
|
|
31321
31358
|
threadId
|
|
31322
31359
|
});
|
|
@@ -46946,4 +46983,4 @@ const agentBuilderWorkflows = {
|
|
|
46946
46983
|
//#endregion
|
|
46947
46984
|
exports.agentBuilderWorkflows = agentBuilderWorkflows;
|
|
46948
46985
|
|
|
46949
|
-
//# sourceMappingURL=dist-
|
|
46986
|
+
//# sourceMappingURL=dist-BmrsK_KX.cjs.map
|