@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
|
@@ -4693,7 +4693,7 @@ function splitLines(text) {
|
|
|
4693
4693
|
return result;
|
|
4694
4694
|
}
|
|
4695
4695
|
//#endregion
|
|
4696
|
-
//#region ../memory/dist/src-
|
|
4696
|
+
//#region ../memory/dist/src-BNB8ko_o.js
|
|
4697
4697
|
var __defProp$3 = Object.defineProperty;
|
|
4698
4698
|
var __exportAll = (all, no_symbols) => {
|
|
4699
4699
|
let target = {};
|
|
@@ -23463,11 +23463,11 @@ function formatObserverAttachmentPlaceholder(part, counter) {
|
|
|
23463
23463
|
const label = resolveObserverAttachmentLabel(part);
|
|
23464
23464
|
return label ? `[${attachmentType} #${attachmentId}: ${label}]` : `[${attachmentType} #${attachmentId}]`;
|
|
23465
23465
|
}
|
|
23466
|
-
function isRecord$
|
|
23466
|
+
function isRecord$4(value) {
|
|
23467
23467
|
return !!value && typeof value === "object";
|
|
23468
23468
|
}
|
|
23469
23469
|
function mapToolResultBlockToAttachment(block) {
|
|
23470
|
-
if (!isRecord$
|
|
23470
|
+
if (!isRecord$4(block) || typeof block.type !== "string") return;
|
|
23471
23471
|
const mediaType = typeof block.mediaType === "string" ? block.mediaType : void 0;
|
|
23472
23472
|
const filename = typeof block.filename === "string" ? block.filename : void 0;
|
|
23473
23473
|
switch (block.type) {
|
|
@@ -23528,7 +23528,7 @@ function mapToolResultBlockToAttachment(block) {
|
|
|
23528
23528
|
}
|
|
23529
23529
|
}
|
|
23530
23530
|
function extractToolResultAttachments(result, counter, attachmentFilter) {
|
|
23531
|
-
if (!isRecord$
|
|
23531
|
+
if (!isRecord$4(result) || result.type !== "content" || !Array.isArray(result.value)) return {
|
|
23532
23532
|
resultWithoutAttachments: result,
|
|
23533
23533
|
attachments: []
|
|
23534
23534
|
};
|
|
@@ -23542,7 +23542,7 @@ function extractToolResultAttachments(result, counter, attachmentFilter) {
|
|
|
23542
23542
|
if (shouldIncludeObserverAttachment(attachment, attachmentFilter)) attachments.push(toObserverInputAttachmentPart(attachment));
|
|
23543
23543
|
const placeholder = formatObserverAttachmentPlaceholder(attachment, counter);
|
|
23544
23544
|
return {
|
|
23545
|
-
type: isRecord$
|
|
23545
|
+
type: isRecord$4(block) ? block.type : void 0,
|
|
23546
23546
|
placeholder
|
|
23547
23547
|
};
|
|
23548
23548
|
});
|
|
@@ -24161,17 +24161,17 @@ const TRANSIENT_MESSAGE_SUBSTRINGS = [
|
|
|
24161
24161
|
"connection reset",
|
|
24162
24162
|
"connection closed"
|
|
24163
24163
|
];
|
|
24164
|
-
function isRecord$
|
|
24164
|
+
function isRecord$3(value) {
|
|
24165
24165
|
return typeof value === "object" && value !== null;
|
|
24166
24166
|
}
|
|
24167
24167
|
function isAbortError$5(error) {
|
|
24168
|
-
if (!isRecord$
|
|
24168
|
+
if (!isRecord$3(error)) return false;
|
|
24169
24169
|
if (error.name === "AbortError") return true;
|
|
24170
24170
|
if (typeof error.code === "string" && error.code === "ABORT_ERR") return true;
|
|
24171
24171
|
return false;
|
|
24172
24172
|
}
|
|
24173
24173
|
function hasTransientMessage(value) {
|
|
24174
|
-
if (!isRecord$
|
|
24174
|
+
if (!isRecord$3(value)) return false;
|
|
24175
24175
|
const message = typeof value.message === "string" ? value.message.toLowerCase() : "";
|
|
24176
24176
|
if (message && TRANSIENT_MESSAGE_SUBSTRINGS.some((sub) => message.includes(sub))) return true;
|
|
24177
24177
|
if (typeof value.code === "string" && value.code.toUpperCase().startsWith("UND_ERR_")) return true;
|
|
@@ -24182,13 +24182,13 @@ function isRetryableHttpStatus(status) {
|
|
|
24182
24182
|
return status >= 500 && status <= 599;
|
|
24183
24183
|
}
|
|
24184
24184
|
function hasRetryableHttpStatus(value) {
|
|
24185
|
-
if (!isRecord$
|
|
24185
|
+
if (!isRecord$3(value)) return false;
|
|
24186
24186
|
if (typeof value.statusCode === "number" && isRetryableHttpStatus(value.statusCode)) return true;
|
|
24187
24187
|
if (typeof value.code === "number" && isRetryableHttpStatus(value.code)) return true;
|
|
24188
24188
|
return false;
|
|
24189
24189
|
}
|
|
24190
24190
|
function hasIsRetryableFlag(value) {
|
|
24191
|
-
if (!isRecord$
|
|
24191
|
+
if (!isRecord$3(value)) return false;
|
|
24192
24192
|
return value.isRetryable === true;
|
|
24193
24193
|
}
|
|
24194
24194
|
/**
|
|
@@ -24206,14 +24206,14 @@ function isTransientLLMError(error) {
|
|
|
24206
24206
|
if (isAbortError$5(error)) return false;
|
|
24207
24207
|
const visited = /* @__PURE__ */ new WeakSet();
|
|
24208
24208
|
function visit(candidate) {
|
|
24209
|
-
if (isRecord$
|
|
24209
|
+
if (isRecord$3(candidate)) {
|
|
24210
24210
|
if (visited.has(candidate)) return false;
|
|
24211
24211
|
visited.add(candidate);
|
|
24212
24212
|
}
|
|
24213
24213
|
if (hasTransientMessage(candidate)) return true;
|
|
24214
24214
|
if (hasRetryableHttpStatus(candidate)) return true;
|
|
24215
24215
|
if (hasIsRetryableFlag(candidate)) return true;
|
|
24216
|
-
if (isRecord$
|
|
24216
|
+
if (isRecord$3(candidate)) {
|
|
24217
24217
|
if (visit(candidate.cause)) return true;
|
|
24218
24218
|
if (visit(candidate.error)) return true;
|
|
24219
24219
|
}
|
|
@@ -27945,6 +27945,43 @@ function didProviderChange(actorModel, lastModel) {
|
|
|
27945
27945
|
if (actorContext.provider && lastContext.provider) return actorContext.provider !== lastContext.provider;
|
|
27946
27946
|
return false;
|
|
27947
27947
|
}
|
|
27948
|
+
function isRecord$2(value) {
|
|
27949
|
+
return typeof value === "object" && value !== null;
|
|
27950
|
+
}
|
|
27951
|
+
/** Keep provider diagnostics in streamed/persisted markers, not whole API request/response objects. */
|
|
27952
|
+
function formatOmError(error) {
|
|
27953
|
+
const details = /* @__PURE__ */ new Set();
|
|
27954
|
+
const visited = /* @__PURE__ */ new Set();
|
|
27955
|
+
const add = (value) => {
|
|
27956
|
+
if (typeof value === "string" && value.trim()) details.add(value.trim().slice(0, 2e3));
|
|
27957
|
+
};
|
|
27958
|
+
function collectErrorDetails(value, depth) {
|
|
27959
|
+
if (depth > 5) return;
|
|
27960
|
+
if (!isRecord$2(value)) {
|
|
27961
|
+
if (value !== void 0) add(String(value));
|
|
27962
|
+
return;
|
|
27963
|
+
}
|
|
27964
|
+
if (visited.has(value)) return;
|
|
27965
|
+
visited.add(value);
|
|
27966
|
+
add(value.message);
|
|
27967
|
+
if (typeof value.statusCode === "number") add(`HTTP ${value.statusCode}`);
|
|
27968
|
+
if (typeof value.responseBody === "string") try {
|
|
27969
|
+
const body = JSON.parse(value.responseBody);
|
|
27970
|
+
if (isRecord$2(body)) {
|
|
27971
|
+
add(body.message);
|
|
27972
|
+
if (isRecord$2(body.error)) add(body.error.message);
|
|
27973
|
+
else add(body.error);
|
|
27974
|
+
}
|
|
27975
|
+
} catch {}
|
|
27976
|
+
if (value.cause !== void 0) collectErrorDetails(value.cause, depth + 1);
|
|
27977
|
+
if (value.error !== void 0) collectErrorDetails(value.error, depth + 1);
|
|
27978
|
+
}
|
|
27979
|
+
try {
|
|
27980
|
+
collectErrorDetails(error, 0);
|
|
27981
|
+
} catch {}
|
|
27982
|
+
const message = [...details].join(": ") || "Unknown error";
|
|
27983
|
+
return message.length > 2e3 ? `${message.slice(0, 1997)}...` : message;
|
|
27984
|
+
}
|
|
27948
27985
|
/**
|
|
27949
27986
|
* Create a start marker for when observation begins.
|
|
27950
27987
|
*/
|
|
@@ -28002,7 +28039,7 @@ function createObservationFailedMarker(params) {
|
|
|
28002
28039
|
failedAt,
|
|
28003
28040
|
durationMs,
|
|
28004
28041
|
tokensAttempted: params.tokensAttempted,
|
|
28005
|
-
error: params.error,
|
|
28042
|
+
error: formatOmError(params.error),
|
|
28006
28043
|
recordId: params.recordId,
|
|
28007
28044
|
threadId: params.threadId
|
|
28008
28045
|
}
|
|
@@ -28063,7 +28100,7 @@ function createBufferingFailedMarker(params) {
|
|
|
28063
28100
|
failedAt,
|
|
28064
28101
|
durationMs,
|
|
28065
28102
|
tokensAttempted: params.tokensAttempted,
|
|
28066
|
-
error: params.error,
|
|
28103
|
+
error: formatOmError(params.error),
|
|
28067
28104
|
recordId: params.recordId,
|
|
28068
28105
|
threadId: params.threadId
|
|
28069
28106
|
}
|
|
@@ -28678,7 +28715,7 @@ var ObservationStrategy = class ObservationStrategy {
|
|
|
28678
28715
|
cycleId,
|
|
28679
28716
|
operationType: "observation",
|
|
28680
28717
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
28681
|
-
error:
|
|
28718
|
+
error: formatOmError(error),
|
|
28682
28719
|
recordId: record.id,
|
|
28683
28720
|
threadId
|
|
28684
28721
|
}
|
|
@@ -29077,7 +29114,7 @@ var SyncObservationStrategy = class extends ObservationStrategy {
|
|
|
29077
29114
|
operationType: "observation",
|
|
29078
29115
|
startedAt: this.startedAt,
|
|
29079
29116
|
tokensAttempted: this.tokensToObserve,
|
|
29080
|
-
error
|
|
29117
|
+
error,
|
|
29081
29118
|
recordId: this.opts.record.id,
|
|
29082
29119
|
threadId: this.opts.threadId
|
|
29083
29120
|
});
|
|
@@ -29276,7 +29313,7 @@ var AsyncBufferObservationStrategy = class extends ObservationStrategy {
|
|
|
29276
29313
|
operationType: "observation",
|
|
29277
29314
|
startedAt: this.startedAt,
|
|
29278
29315
|
tokensAttempted,
|
|
29279
|
-
error
|
|
29316
|
+
error,
|
|
29280
29317
|
recordId: record.id,
|
|
29281
29318
|
threadId
|
|
29282
29319
|
});
|
|
@@ -29642,7 +29679,7 @@ var ResourceScopedObservationStrategy = class extends ObservationStrategy {
|
|
|
29642
29679
|
operationType: "observation",
|
|
29643
29680
|
startedAt: this.startedAt,
|
|
29644
29681
|
tokensAttempted,
|
|
29645
|
-
error
|
|
29682
|
+
error,
|
|
29646
29683
|
recordId: this.opts.record.id,
|
|
29647
29684
|
threadId
|
|
29648
29685
|
});
|
|
@@ -30896,7 +30933,7 @@ var ReflectorRunner = class {
|
|
|
30896
30933
|
operationType: "reflection",
|
|
30897
30934
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
30898
30935
|
tokensAttempted: observationTokens,
|
|
30899
|
-
error
|
|
30936
|
+
error,
|
|
30900
30937
|
recordId: record.id,
|
|
30901
30938
|
threadId: record.threadId ?? ""
|
|
30902
30939
|
});
|
|
@@ -31315,7 +31352,7 @@ var ReflectorRunner = class {
|
|
|
31315
31352
|
operationType: "reflection",
|
|
31316
31353
|
startedAt: streamContext.startedAt,
|
|
31317
31354
|
tokensAttempted: observationTokens,
|
|
31318
|
-
error
|
|
31355
|
+
error,
|
|
31319
31356
|
recordId: record.id,
|
|
31320
31357
|
threadId
|
|
31321
31358
|
});
|
|
@@ -46942,4 +46979,4 @@ const agentBuilderWorkflows = {
|
|
|
46942
46979
|
//#endregion
|
|
46943
46980
|
export { agentBuilderWorkflows };
|
|
46944
46981
|
|
|
46945
|
-
//# sourceMappingURL=dist-
|
|
46982
|
+
//# sourceMappingURL=dist-4Qm6OSPJ.js.map
|