@agent-inspect/mcp-server 6.31.18 → 6.31.19
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/{chunk-X4QXIQSR.mjs → chunk-L5YP42Q6.mjs} +74 -6
- package/dist/chunk-L5YP42Q6.mjs.map +1 -0
- package/dist/cli.cjs +72 -4
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +72 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-X4QXIQSR.mjs.map +0 -1
|
@@ -2558,7 +2558,7 @@ function extractSessionWorkflowMetadata(record) {
|
|
|
2558
2558
|
assignString("conversationId", record.conversationId);
|
|
2559
2559
|
assignString("groupId", record.groupId);
|
|
2560
2560
|
assignString("parentGroupId", record.parentGroupId);
|
|
2561
|
-
assignString("retryOf", record.retryOf);
|
|
2561
|
+
assignString("retryOf", record.retryOf ?? record["agent_inspect.retry_of"]);
|
|
2562
2562
|
assignString("retryReason", record.retryReason);
|
|
2563
2563
|
assignString("handoffFrom", record.handoffFrom);
|
|
2564
2564
|
assignString("handoffTo", record.handoffTo);
|
|
@@ -2571,8 +2571,8 @@ function extractSessionWorkflowMetadata(record) {
|
|
|
2571
2571
|
assignString("toolCallId", record.toolCallId);
|
|
2572
2572
|
assignString("mcpToolCallId", record.mcpToolCallId);
|
|
2573
2573
|
assignString("linkedStepId", record.linkedStepId);
|
|
2574
|
-
assignString("operationId", record.operationId);
|
|
2575
|
-
assignString("attemptId", record.attemptId);
|
|
2574
|
+
assignString("operationId", record.operationId ?? record["agent_inspect.operation_id"]);
|
|
2575
|
+
assignString("attemptId", record.attemptId ?? record["agent_inspect.attempt_id"]);
|
|
2576
2576
|
assignString("fallbackOf", record.fallbackOf);
|
|
2577
2577
|
assignString("idempotencyKey", record.idempotencyKey);
|
|
2578
2578
|
assignString("correlationId", record.correlationId);
|
|
@@ -2583,7 +2583,9 @@ function extractSessionWorkflowMetadata(record) {
|
|
|
2583
2583
|
out.attempt = attempt;
|
|
2584
2584
|
found = true;
|
|
2585
2585
|
}
|
|
2586
|
-
const attemptNumber = finitePositiveInt(
|
|
2586
|
+
const attemptNumber = finitePositiveInt(
|
|
2587
|
+
record.attemptNumber ?? record["agent_inspect.attempt_number"]
|
|
2588
|
+
);
|
|
2587
2589
|
if (attemptNumber !== void 0) {
|
|
2588
2590
|
out.attemptNumber = attemptNumber;
|
|
2589
2591
|
found = true;
|
|
@@ -6410,6 +6412,70 @@ function mapOtlpEvents(value, pathPrefix) {
|
|
|
6410
6412
|
unsupportedFields
|
|
6411
6413
|
};
|
|
6412
6414
|
}
|
|
6415
|
+
function promoteAgentInspectWorkflowIdentity(attributes, pathPrefix) {
|
|
6416
|
+
const warnings = [];
|
|
6417
|
+
const mapping = [
|
|
6418
|
+
["agent_inspect.operation_id", "operationId", "string"],
|
|
6419
|
+
["agent_inspect.attempt_id", "attemptId", "string"],
|
|
6420
|
+
["agent_inspect.retry_of", "retryOf", "string"],
|
|
6421
|
+
["agent_inspect.attempt_number", "attemptNumber", "int"]
|
|
6422
|
+
];
|
|
6423
|
+
const metadata = attributes.metadata && typeof attributes.metadata === "object" && !Array.isArray(attributes.metadata) ? { ...attributes.metadata } : {};
|
|
6424
|
+
for (const [dotted, camel, kind] of mapping) {
|
|
6425
|
+
const raw = attributes[dotted];
|
|
6426
|
+
if (raw === void 0 || raw === null) continue;
|
|
6427
|
+
let promoted;
|
|
6428
|
+
if (kind === "int") {
|
|
6429
|
+
const n = typeof raw === "number" ? raw : typeof raw === "string" ? Number(raw) : NaN;
|
|
6430
|
+
if (!Number.isFinite(n) || n < 1) {
|
|
6431
|
+
warnings.push({
|
|
6432
|
+
code: "otlp_identity_invalid",
|
|
6433
|
+
message: `Ignoring invalid ${dotted} identity value.`,
|
|
6434
|
+
severity: "warning",
|
|
6435
|
+
field: `${pathPrefix}.${dotted}`
|
|
6436
|
+
});
|
|
6437
|
+
continue;
|
|
6438
|
+
}
|
|
6439
|
+
promoted = Math.trunc(n);
|
|
6440
|
+
} else if (typeof raw === "string" && raw.trim() !== "") {
|
|
6441
|
+
promoted = raw.trim();
|
|
6442
|
+
} else {
|
|
6443
|
+
warnings.push({
|
|
6444
|
+
code: "otlp_identity_invalid",
|
|
6445
|
+
message: `Ignoring non-string ${dotted} identity value.`,
|
|
6446
|
+
severity: "warning",
|
|
6447
|
+
field: `${pathPrefix}.${dotted}`
|
|
6448
|
+
});
|
|
6449
|
+
continue;
|
|
6450
|
+
}
|
|
6451
|
+
const direct = attributes[camel];
|
|
6452
|
+
const nested = metadata[camel];
|
|
6453
|
+
if (direct !== void 0 && direct !== promoted) {
|
|
6454
|
+
warnings.push({
|
|
6455
|
+
code: "otlp_identity_conflict",
|
|
6456
|
+
message: `Conflicting ${camel}: attributes.${camel} vs ${dotted}; keeping camelCase.`,
|
|
6457
|
+
severity: "warning",
|
|
6458
|
+
field: `${pathPrefix}.${dotted}`
|
|
6459
|
+
});
|
|
6460
|
+
continue;
|
|
6461
|
+
}
|
|
6462
|
+
if (nested !== void 0 && nested !== promoted && direct === void 0) {
|
|
6463
|
+
warnings.push({
|
|
6464
|
+
code: "otlp_identity_conflict",
|
|
6465
|
+
message: `Conflicting ${camel}: attributes.metadata.${camel} vs ${dotted}; keeping nested.`,
|
|
6466
|
+
severity: "warning",
|
|
6467
|
+
field: `${pathPrefix}.${dotted}`
|
|
6468
|
+
});
|
|
6469
|
+
continue;
|
|
6470
|
+
}
|
|
6471
|
+
if (direct === void 0) attributes[camel] = promoted;
|
|
6472
|
+
if (nested === void 0) metadata[camel] = promoted;
|
|
6473
|
+
}
|
|
6474
|
+
if (Object.keys(metadata).length > 0) {
|
|
6475
|
+
attributes.metadata = metadata;
|
|
6476
|
+
}
|
|
6477
|
+
return warnings;
|
|
6478
|
+
}
|
|
6413
6479
|
function mapOtlpSpan(context) {
|
|
6414
6480
|
const { span, pathPrefix } = context;
|
|
6415
6481
|
const warnings = [];
|
|
@@ -6441,6 +6507,7 @@ function mapOtlpSpan(context) {
|
|
|
6441
6507
|
if (context.scopeVersion !== void 0) {
|
|
6442
6508
|
attributes["scope.version"] = context.scopeVersion;
|
|
6443
6509
|
}
|
|
6510
|
+
warnings.push(...promoteAgentInspectWorkflowIdentity(attributes, pathPrefix));
|
|
6444
6511
|
for (const [key, value] of Object.entries(span)) {
|
|
6445
6512
|
if (OTLP_SPAN_KEYS.has(key)) continue;
|
|
6446
6513
|
unsupportedFields.push(`${pathPrefix}.${key}`);
|
|
@@ -6478,6 +6545,7 @@ function mapOtlpSpan(context) {
|
|
|
6478
6545
|
if (events.events !== void 0) {
|
|
6479
6546
|
attributes["otlp.events"] = events.events;
|
|
6480
6547
|
}
|
|
6548
|
+
warnings.push(...promoteAgentInspectWorkflowIdentity(attributes, pathPrefix));
|
|
6481
6549
|
const traceId = readStringField(span, ["traceId"]) ?? "trace-unknown";
|
|
6482
6550
|
const spanId = readStringField(span, ["spanId"]) ?? "span-unknown";
|
|
6483
6551
|
const parentSpanId = readStringField(span, ["parentSpanId"]);
|
|
@@ -9412,5 +9480,5 @@ async function runReadOnlyMcpServer(options = {}) {
|
|
|
9412
9480
|
}
|
|
9413
9481
|
|
|
9414
9482
|
export { MCP_MAX_REQUEST_BYTES, MCP_PROTOCOL_VERSION, MCP_SERVER_INSTRUCTIONS, READ_ONLY_TOOLS, TRACE_DATA_UNTRUSTED_WARNING, callReadOnlyTool, createMcpServerContext, handleMcpProtocolLine, runReadOnlyMcpServer };
|
|
9415
|
-
//# sourceMappingURL=chunk-
|
|
9416
|
-
//# sourceMappingURL=chunk-
|
|
9483
|
+
//# sourceMappingURL=chunk-L5YP42Q6.mjs.map
|
|
9484
|
+
//# sourceMappingURL=chunk-L5YP42Q6.mjs.map
|