agent-inspect 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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-AHARYDFO.mjs → chunk-EVSIYDB2.mjs} +111 -15
- package/packages/cli/dist/chunk-EVSIYDB2.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +110 -14
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +4 -4
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-YNZZ2KYR.mjs → src-NWDDK72G.mjs} +3 -3
- package/packages/cli/dist/{src-YNZZ2KYR.mjs.map → src-NWDDK72G.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +72 -4
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +3 -3
- package/packages/core/dist/checks.cjs +43 -13
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-NJUSSJX3.mjs → chunk-EIP5CNEL.mjs} +68 -2
- package/packages/core/dist/chunk-EIP5CNEL.mjs.map +1 -0
- package/packages/core/dist/{chunk-FRBBZUEP.mjs → chunk-GFQPPNSF.mjs} +45 -15
- package/packages/core/dist/chunk-GFQPPNSF.mjs.map +1 -0
- package/packages/core/dist/readers.cjs +66 -0
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.mjs +1 -1
- package/packages/cli/dist/chunk-AHARYDFO.mjs.map +0 -1
- package/packages/core/dist/chunk-FRBBZUEP.mjs.map +0 -1
- package/packages/core/dist/chunk-NJUSSJX3.mjs.map +0 -1
|
@@ -3851,7 +3851,7 @@ function extractSessionWorkflowMetadata(record) {
|
|
|
3851
3851
|
assignString("conversationId", record.conversationId);
|
|
3852
3852
|
assignString("groupId", record.groupId);
|
|
3853
3853
|
assignString("parentGroupId", record.parentGroupId);
|
|
3854
|
-
assignString("retryOf", record.retryOf);
|
|
3854
|
+
assignString("retryOf", record.retryOf ?? record["agent_inspect.retry_of"]);
|
|
3855
3855
|
assignString("retryReason", record.retryReason);
|
|
3856
3856
|
assignString("handoffFrom", record.handoffFrom);
|
|
3857
3857
|
assignString("handoffTo", record.handoffTo);
|
|
@@ -3864,8 +3864,8 @@ function extractSessionWorkflowMetadata(record) {
|
|
|
3864
3864
|
assignString("toolCallId", record.toolCallId);
|
|
3865
3865
|
assignString("mcpToolCallId", record.mcpToolCallId);
|
|
3866
3866
|
assignString("linkedStepId", record.linkedStepId);
|
|
3867
|
-
assignString("operationId", record.operationId);
|
|
3868
|
-
assignString("attemptId", record.attemptId);
|
|
3867
|
+
assignString("operationId", record.operationId ?? record["agent_inspect.operation_id"]);
|
|
3868
|
+
assignString("attemptId", record.attemptId ?? record["agent_inspect.attempt_id"]);
|
|
3869
3869
|
assignString("fallbackOf", record.fallbackOf);
|
|
3870
3870
|
assignString("idempotencyKey", record.idempotencyKey);
|
|
3871
3871
|
assignString("correlationId", record.correlationId);
|
|
@@ -3876,7 +3876,9 @@ function extractSessionWorkflowMetadata(record) {
|
|
|
3876
3876
|
out.attempt = attempt;
|
|
3877
3877
|
found = true;
|
|
3878
3878
|
}
|
|
3879
|
-
const attemptNumber2 = finitePositiveInt(
|
|
3879
|
+
const attemptNumber2 = finitePositiveInt(
|
|
3880
|
+
record.attemptNumber ?? record["agent_inspect.attempt_number"]
|
|
3881
|
+
);
|
|
3880
3882
|
if (attemptNumber2 !== void 0) {
|
|
3881
3883
|
out.attemptNumber = attemptNumber2;
|
|
3882
3884
|
found = true;
|
|
@@ -8180,12 +8182,21 @@ function countOperationAttempts(members) {
|
|
|
8180
8182
|
if (identified.size > 0) {
|
|
8181
8183
|
return identified.size + unidentified;
|
|
8182
8184
|
}
|
|
8183
|
-
const
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8185
|
+
const numbered = /* @__PURE__ */ new Set();
|
|
8186
|
+
let unnumbered = 0;
|
|
8187
|
+
for (const event of members) {
|
|
8188
|
+
if (event.kind !== "TOOL" && event.kind !== "LLM") continue;
|
|
8189
|
+
const num2 = attemptNumberOf(event);
|
|
8190
|
+
if (num2 !== void 0) {
|
|
8191
|
+
numbered.add(num2);
|
|
8192
|
+
continue;
|
|
8193
|
+
}
|
|
8194
|
+
unnumbered += 1;
|
|
8195
|
+
}
|
|
8196
|
+
if (numbered.size > 0) {
|
|
8197
|
+
return numbered.size + unnumbered;
|
|
8187
8198
|
}
|
|
8188
|
-
return
|
|
8199
|
+
return unnumbered;
|
|
8189
8200
|
}
|
|
8190
8201
|
function classifyRetryAttempt(event, priorOrdered, allMembers) {
|
|
8191
8202
|
const workflow = workflowFor(event);
|
|
@@ -8475,11 +8486,23 @@ function consumerStartMs(event) {
|
|
|
8475
8486
|
return parseComparableMs(event.startedAt) ?? parseComparableMs(event.timestamp);
|
|
8476
8487
|
}
|
|
8477
8488
|
function resultAvailableMs(event) {
|
|
8478
|
-
const ended = parseComparableMs(event.endedAt);
|
|
8479
|
-
if (ended !== void 0) return ended;
|
|
8480
8489
|
const started = parseComparableMs(event.startedAt) ?? parseComparableMs(event.timestamp);
|
|
8481
|
-
|
|
8482
|
-
|
|
8490
|
+
const endedRaw = event.endedAt;
|
|
8491
|
+
const endedPresent = endedRaw !== void 0 && endedRaw !== null && String(endedRaw).trim() !== "";
|
|
8492
|
+
if (endedPresent) {
|
|
8493
|
+
const ended = parseComparableMs(typeof endedRaw === "string" ? endedRaw : String(endedRaw));
|
|
8494
|
+
if (ended === void 0) return void 0;
|
|
8495
|
+
if (started !== void 0 && ended < started) return void 0;
|
|
8496
|
+
return ended;
|
|
8497
|
+
}
|
|
8498
|
+
if (event.durationMs !== void 0) {
|
|
8499
|
+
if (!Number.isFinite(event.durationMs) || event.durationMs < 0) {
|
|
8500
|
+
return void 0;
|
|
8501
|
+
}
|
|
8502
|
+
if (started !== void 0) {
|
|
8503
|
+
return started + event.durationMs;
|
|
8504
|
+
}
|
|
8505
|
+
return void 0;
|
|
8483
8506
|
}
|
|
8484
8507
|
return parseComparableMs(event.timestamp);
|
|
8485
8508
|
}
|
|
@@ -8505,6 +8528,13 @@ function errorCodeOf(event) {
|
|
|
8505
8528
|
const code = nested.code;
|
|
8506
8529
|
if (typeof code === "string" && code.trim() !== "") return code.trim();
|
|
8507
8530
|
}
|
|
8531
|
+
const meta2 = attrs.metadata;
|
|
8532
|
+
if (meta2 && typeof meta2 === "object") {
|
|
8533
|
+
for (const key of ["errorCode", "code"]) {
|
|
8534
|
+
const value = meta2[key];
|
|
8535
|
+
if (typeof value === "string" && value.trim() !== "") return value.trim();
|
|
8536
|
+
}
|
|
8537
|
+
}
|
|
8508
8538
|
return void 0;
|
|
8509
8539
|
}
|
|
8510
8540
|
function argumentDigestOf(event) {
|
|
@@ -14132,6 +14162,70 @@ function mapOtlpEvents(value, pathPrefix) {
|
|
|
14132
14162
|
unsupportedFields
|
|
14133
14163
|
};
|
|
14134
14164
|
}
|
|
14165
|
+
function promoteAgentInspectWorkflowIdentity(attributes, pathPrefix) {
|
|
14166
|
+
const warnings = [];
|
|
14167
|
+
const mapping = [
|
|
14168
|
+
["agent_inspect.operation_id", "operationId", "string"],
|
|
14169
|
+
["agent_inspect.attempt_id", "attemptId", "string"],
|
|
14170
|
+
["agent_inspect.retry_of", "retryOf", "string"],
|
|
14171
|
+
["agent_inspect.attempt_number", "attemptNumber", "int"]
|
|
14172
|
+
];
|
|
14173
|
+
const metadata = attributes.metadata && typeof attributes.metadata === "object" && !Array.isArray(attributes.metadata) ? { ...attributes.metadata } : {};
|
|
14174
|
+
for (const [dotted, camel, kind] of mapping) {
|
|
14175
|
+
const raw = attributes[dotted];
|
|
14176
|
+
if (raw === void 0 || raw === null) continue;
|
|
14177
|
+
let promoted;
|
|
14178
|
+
if (kind === "int") {
|
|
14179
|
+
const n = typeof raw === "number" ? raw : typeof raw === "string" ? Number(raw) : NaN;
|
|
14180
|
+
if (!Number.isFinite(n) || n < 1) {
|
|
14181
|
+
warnings.push({
|
|
14182
|
+
code: "otlp_identity_invalid",
|
|
14183
|
+
message: `Ignoring invalid ${dotted} identity value.`,
|
|
14184
|
+
severity: "warning",
|
|
14185
|
+
field: `${pathPrefix}.${dotted}`
|
|
14186
|
+
});
|
|
14187
|
+
continue;
|
|
14188
|
+
}
|
|
14189
|
+
promoted = Math.trunc(n);
|
|
14190
|
+
} else if (typeof raw === "string" && raw.trim() !== "") {
|
|
14191
|
+
promoted = raw.trim();
|
|
14192
|
+
} else {
|
|
14193
|
+
warnings.push({
|
|
14194
|
+
code: "otlp_identity_invalid",
|
|
14195
|
+
message: `Ignoring non-string ${dotted} identity value.`,
|
|
14196
|
+
severity: "warning",
|
|
14197
|
+
field: `${pathPrefix}.${dotted}`
|
|
14198
|
+
});
|
|
14199
|
+
continue;
|
|
14200
|
+
}
|
|
14201
|
+
const direct = attributes[camel];
|
|
14202
|
+
const nested = metadata[camel];
|
|
14203
|
+
if (direct !== void 0 && direct !== promoted) {
|
|
14204
|
+
warnings.push({
|
|
14205
|
+
code: "otlp_identity_conflict",
|
|
14206
|
+
message: `Conflicting ${camel}: attributes.${camel} vs ${dotted}; keeping camelCase.`,
|
|
14207
|
+
severity: "warning",
|
|
14208
|
+
field: `${pathPrefix}.${dotted}`
|
|
14209
|
+
});
|
|
14210
|
+
continue;
|
|
14211
|
+
}
|
|
14212
|
+
if (nested !== void 0 && nested !== promoted && direct === void 0) {
|
|
14213
|
+
warnings.push({
|
|
14214
|
+
code: "otlp_identity_conflict",
|
|
14215
|
+
message: `Conflicting ${camel}: attributes.metadata.${camel} vs ${dotted}; keeping nested.`,
|
|
14216
|
+
severity: "warning",
|
|
14217
|
+
field: `${pathPrefix}.${dotted}`
|
|
14218
|
+
});
|
|
14219
|
+
continue;
|
|
14220
|
+
}
|
|
14221
|
+
if (direct === void 0) attributes[camel] = promoted;
|
|
14222
|
+
if (nested === void 0) metadata[camel] = promoted;
|
|
14223
|
+
}
|
|
14224
|
+
if (Object.keys(metadata).length > 0) {
|
|
14225
|
+
attributes.metadata = metadata;
|
|
14226
|
+
}
|
|
14227
|
+
return warnings;
|
|
14228
|
+
}
|
|
14135
14229
|
function mapOtlpSpan(context) {
|
|
14136
14230
|
const { span, pathPrefix } = context;
|
|
14137
14231
|
const warnings = [];
|
|
@@ -14163,6 +14257,7 @@ function mapOtlpSpan(context) {
|
|
|
14163
14257
|
if (context.scopeVersion !== void 0) {
|
|
14164
14258
|
attributes["scope.version"] = context.scopeVersion;
|
|
14165
14259
|
}
|
|
14260
|
+
warnings.push(...promoteAgentInspectWorkflowIdentity(attributes, pathPrefix));
|
|
14166
14261
|
for (const [key, value] of Object.entries(span)) {
|
|
14167
14262
|
if (OTLP_SPAN_KEYS.has(key)) continue;
|
|
14168
14263
|
unsupportedFields.push(`${pathPrefix}.${key}`);
|
|
@@ -14200,6 +14295,7 @@ function mapOtlpSpan(context) {
|
|
|
14200
14295
|
if (events.events !== void 0) {
|
|
14201
14296
|
attributes["otlp.events"] = events.events;
|
|
14202
14297
|
}
|
|
14298
|
+
warnings.push(...promoteAgentInspectWorkflowIdentity(attributes, pathPrefix));
|
|
14203
14299
|
const traceId = readStringField(span, ["traceId"]) ?? "trace-unknown";
|
|
14204
14300
|
const spanId = readStringField(span, ["spanId"]) ?? "span-unknown";
|
|
14205
14301
|
const parentSpanId = readStringField(span, ["parentSpanId"]);
|
|
@@ -16864,7 +16960,7 @@ var init_src = __esm({
|
|
|
16864
16960
|
});
|
|
16865
16961
|
|
|
16866
16962
|
// package.json
|
|
16867
|
-
var version = "6.31.
|
|
16963
|
+
var version = "6.31.20";
|
|
16868
16964
|
|
|
16869
16965
|
// packages/cli/src/list.ts
|
|
16870
16966
|
init_advanced();
|