@agent-inspect/mcp-server 6.31.18 → 6.31.20

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/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { runReadOnlyMcpServer } from './chunk-X4QXIQSR.mjs';
1
+ import { runReadOnlyMcpServer } from './chunk-L5YP42Q6.mjs';
2
2
  import { readFileSync } from 'fs';
3
3
  import path from 'path';
4
4
  import { fileURLToPath } from 'url';
package/dist/index.cjs CHANGED
@@ -2568,7 +2568,7 @@ function extractSessionWorkflowMetadata(record) {
2568
2568
  assignString("conversationId", record.conversationId);
2569
2569
  assignString("groupId", record.groupId);
2570
2570
  assignString("parentGroupId", record.parentGroupId);
2571
- assignString("retryOf", record.retryOf);
2571
+ assignString("retryOf", record.retryOf ?? record["agent_inspect.retry_of"]);
2572
2572
  assignString("retryReason", record.retryReason);
2573
2573
  assignString("handoffFrom", record.handoffFrom);
2574
2574
  assignString("handoffTo", record.handoffTo);
@@ -2581,8 +2581,8 @@ function extractSessionWorkflowMetadata(record) {
2581
2581
  assignString("toolCallId", record.toolCallId);
2582
2582
  assignString("mcpToolCallId", record.mcpToolCallId);
2583
2583
  assignString("linkedStepId", record.linkedStepId);
2584
- assignString("operationId", record.operationId);
2585
- assignString("attemptId", record.attemptId);
2584
+ assignString("operationId", record.operationId ?? record["agent_inspect.operation_id"]);
2585
+ assignString("attemptId", record.attemptId ?? record["agent_inspect.attempt_id"]);
2586
2586
  assignString("fallbackOf", record.fallbackOf);
2587
2587
  assignString("idempotencyKey", record.idempotencyKey);
2588
2588
  assignString("correlationId", record.correlationId);
@@ -2593,7 +2593,9 @@ function extractSessionWorkflowMetadata(record) {
2593
2593
  out.attempt = attempt;
2594
2594
  found = true;
2595
2595
  }
2596
- const attemptNumber = finitePositiveInt(record.attemptNumber);
2596
+ const attemptNumber = finitePositiveInt(
2597
+ record.attemptNumber ?? record["agent_inspect.attempt_number"]
2598
+ );
2597
2599
  if (attemptNumber !== void 0) {
2598
2600
  out.attemptNumber = attemptNumber;
2599
2601
  found = true;
@@ -6420,6 +6422,70 @@ function mapOtlpEvents(value, pathPrefix) {
6420
6422
  unsupportedFields
6421
6423
  };
6422
6424
  }
6425
+ function promoteAgentInspectWorkflowIdentity(attributes, pathPrefix) {
6426
+ const warnings = [];
6427
+ const mapping = [
6428
+ ["agent_inspect.operation_id", "operationId", "string"],
6429
+ ["agent_inspect.attempt_id", "attemptId", "string"],
6430
+ ["agent_inspect.retry_of", "retryOf", "string"],
6431
+ ["agent_inspect.attempt_number", "attemptNumber", "int"]
6432
+ ];
6433
+ const metadata = attributes.metadata && typeof attributes.metadata === "object" && !Array.isArray(attributes.metadata) ? { ...attributes.metadata } : {};
6434
+ for (const [dotted, camel, kind] of mapping) {
6435
+ const raw = attributes[dotted];
6436
+ if (raw === void 0 || raw === null) continue;
6437
+ let promoted;
6438
+ if (kind === "int") {
6439
+ const n = typeof raw === "number" ? raw : typeof raw === "string" ? Number(raw) : NaN;
6440
+ if (!Number.isFinite(n) || n < 1) {
6441
+ warnings.push({
6442
+ code: "otlp_identity_invalid",
6443
+ message: `Ignoring invalid ${dotted} identity value.`,
6444
+ severity: "warning",
6445
+ field: `${pathPrefix}.${dotted}`
6446
+ });
6447
+ continue;
6448
+ }
6449
+ promoted = Math.trunc(n);
6450
+ } else if (typeof raw === "string" && raw.trim() !== "") {
6451
+ promoted = raw.trim();
6452
+ } else {
6453
+ warnings.push({
6454
+ code: "otlp_identity_invalid",
6455
+ message: `Ignoring non-string ${dotted} identity value.`,
6456
+ severity: "warning",
6457
+ field: `${pathPrefix}.${dotted}`
6458
+ });
6459
+ continue;
6460
+ }
6461
+ const direct = attributes[camel];
6462
+ const nested = metadata[camel];
6463
+ if (direct !== void 0 && direct !== promoted) {
6464
+ warnings.push({
6465
+ code: "otlp_identity_conflict",
6466
+ message: `Conflicting ${camel}: attributes.${camel} vs ${dotted}; keeping camelCase.`,
6467
+ severity: "warning",
6468
+ field: `${pathPrefix}.${dotted}`
6469
+ });
6470
+ continue;
6471
+ }
6472
+ if (nested !== void 0 && nested !== promoted && direct === void 0) {
6473
+ warnings.push({
6474
+ code: "otlp_identity_conflict",
6475
+ message: `Conflicting ${camel}: attributes.metadata.${camel} vs ${dotted}; keeping nested.`,
6476
+ severity: "warning",
6477
+ field: `${pathPrefix}.${dotted}`
6478
+ });
6479
+ continue;
6480
+ }
6481
+ if (direct === void 0) attributes[camel] = promoted;
6482
+ if (nested === void 0) metadata[camel] = promoted;
6483
+ }
6484
+ if (Object.keys(metadata).length > 0) {
6485
+ attributes.metadata = metadata;
6486
+ }
6487
+ return warnings;
6488
+ }
6423
6489
  function mapOtlpSpan(context) {
6424
6490
  const { span, pathPrefix } = context;
6425
6491
  const warnings = [];
@@ -6451,6 +6517,7 @@ function mapOtlpSpan(context) {
6451
6517
  if (context.scopeVersion !== void 0) {
6452
6518
  attributes["scope.version"] = context.scopeVersion;
6453
6519
  }
6520
+ warnings.push(...promoteAgentInspectWorkflowIdentity(attributes, pathPrefix));
6454
6521
  for (const [key, value] of Object.entries(span)) {
6455
6522
  if (OTLP_SPAN_KEYS.has(key)) continue;
6456
6523
  unsupportedFields.push(`${pathPrefix}.${key}`);
@@ -6488,6 +6555,7 @@ function mapOtlpSpan(context) {
6488
6555
  if (events.events !== void 0) {
6489
6556
  attributes["otlp.events"] = events.events;
6490
6557
  }
6558
+ warnings.push(...promoteAgentInspectWorkflowIdentity(attributes, pathPrefix));
6491
6559
  const traceId = readStringField(span, ["traceId"]) ?? "trace-unknown";
6492
6560
  const spanId = readStringField(span, ["spanId"]) ?? "span-unknown";
6493
6561
  const parentSpanId = readStringField(span, ["parentSpanId"]);