agent-inspect 6.28.0 → 6.29.0
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 +6 -0
- package/README.md +1 -1
- package/docs/LIMITATIONS.md +1 -1
- package/docs/SCHEMA.md +1 -1
- package/package.json +2 -1
- package/packages/cli/dist/{chunk-JVQ4LTHR.mjs → chunk-D7PT6TXM.mjs} +57 -8
- package/packages/cli/dist/chunk-D7PT6TXM.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +56 -7
- 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-M5J5YC5E.mjs → src-QONEBW2F.mjs} +3 -3
- package/packages/cli/dist/{src-M5J5YC5E.mjs.map → src-QONEBW2F.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +53 -6
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +9 -7
- package/packages/core/dist/advanced.d.ts +9 -7
- package/packages/core/dist/advanced.mjs +14 -14
- package/packages/core/dist/checks.cjs +10 -1
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +5 -5
- package/packages/core/dist/checks.d.ts +5 -5
- package/packages/core/dist/checks.mjs +5 -5
- package/packages/core/dist/{chunk-U25RHRSU.mjs → chunk-3B24355S.mjs} +12 -5
- package/packages/core/dist/chunk-3B24355S.mjs.map +1 -0
- package/packages/core/dist/{chunk-NXQF73EC.mjs → chunk-5B4DNGFB.mjs} +9 -5
- package/packages/core/dist/chunk-5B4DNGFB.mjs.map +1 -0
- package/packages/core/dist/{chunk-NDRMIL7Z.mjs → chunk-FKUTGUFG.mjs} +12 -4
- package/packages/core/dist/chunk-FKUTGUFG.mjs.map +1 -0
- package/packages/core/dist/{chunk-ME4WXYY3.mjs → chunk-LGTPSHH2.mjs} +13 -4
- package/packages/core/dist/chunk-LGTPSHH2.mjs.map +1 -0
- package/packages/core/dist/{chunk-R4SSYU6D.mjs → chunk-MVRZ7JBH.mjs} +3 -3
- package/packages/core/dist/{chunk-R4SSYU6D.mjs.map → chunk-MVRZ7JBH.mjs.map} +1 -1
- package/packages/core/dist/{chunk-P366CCL2.mjs → chunk-QJI52TH3.mjs} +4 -2
- package/packages/core/dist/chunk-QJI52TH3.mjs.map +1 -0
- package/packages/core/dist/{chunk-WRE4CNPF.mjs → chunk-SJ3C5RIS.mjs} +3 -3
- package/packages/core/dist/chunk-SJ3C5RIS.mjs.map +1 -0
- package/packages/core/dist/{chunk-WGDSM37E.mjs → chunk-TIGBAVED.mjs} +5 -5
- package/packages/core/dist/{chunk-WGDSM37E.mjs.map → chunk-TIGBAVED.mjs.map} +1 -1
- package/packages/core/dist/{chunk-JBNRJLIV.mjs → chunk-TNOPL75V.mjs} +33 -7
- package/packages/core/dist/chunk-TNOPL75V.mjs.map +1 -0
- package/packages/core/dist/{context-DgcvkJ9t.d.ts → context-B8zzsmjX.d.ts} +2 -2
- package/packages/core/dist/{context-DGMqxFpz.d.cts → context-BhaVHtOT.d.cts} +2 -2
- package/packages/core/dist/diff.d.cts +1 -1
- package/packages/core/dist/diff.d.ts +1 -1
- package/packages/core/dist/exporters.cjs +29 -3
- package/packages/core/dist/exporters.cjs.map +1 -1
- package/packages/core/dist/exporters.d.cts +1 -1
- package/packages/core/dist/exporters.d.ts +1 -1
- package/packages/core/dist/exporters.mjs +5 -5
- package/packages/core/dist/{index-C6bCIbFO.d.cts → index-BT3KcO6-.d.cts} +1 -1
- package/packages/core/dist/{index-DVetZwGG.d.cts → index-C61p7wBR.d.cts} +3 -3
- package/packages/core/dist/{index-BOA1AeEU.d.ts → index-DTO2iGeq.d.ts} +3 -3
- package/packages/core/dist/{index-BzyNPfLm.d.ts → index-reskZCVW.d.ts} +1 -1
- package/packages/core/dist/index.cjs +10 -1
- package/packages/core/dist/index.cjs.map +1 -1
- package/packages/core/dist/index.d.cts +4 -4
- package/packages/core/dist/index.d.ts +4 -4
- package/packages/core/dist/index.mjs +6 -6
- package/packages/core/dist/{persisted-inspect-event-CbaRYpbw.d.ts → persisted-inspect-event-BMwvGIB8.d.ts} +5 -0
- package/packages/core/dist/{persisted-inspect-event-DiJ0I_vi.d.cts → persisted-inspect-event-DPaCiars.d.cts} +5 -0
- package/packages/core/dist/persisted.cjs +8 -2
- package/packages/core/dist/persisted.cjs.map +1 -1
- package/packages/core/dist/persisted.d.cts +3 -3
- package/packages/core/dist/persisted.d.ts +3 -3
- package/packages/core/dist/persisted.mjs +3 -3
- package/packages/core/dist/readers.cjs +16 -2
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.d.cts +2 -2
- package/packages/core/dist/readers.d.ts +2 -2
- package/packages/core/dist/readers.mjs +4 -4
- package/packages/core/dist/{types-wXuxMUop.d.cts → types-BSzhK7Z1.d.cts} +9 -0
- package/packages/core/dist/{types-xv9bSgOK.d.ts → types-C5Y8Idle.d.ts} +9 -0
- package/packages/core/dist/writers.cjs +10 -1
- package/packages/core/dist/writers.cjs.map +1 -1
- package/packages/core/dist/writers.d.cts +1 -1
- package/packages/core/dist/writers.d.ts +1 -1
- package/packages/core/dist/writers.mjs +3 -3
- package/packages/cli/dist/chunk-JVQ4LTHR.mjs.map +0 -1
- package/packages/core/dist/chunk-JBNRJLIV.mjs.map +0 -1
- package/packages/core/dist/chunk-ME4WXYY3.mjs.map +0 -1
- package/packages/core/dist/chunk-NDRMIL7Z.mjs.map +0 -1
- package/packages/core/dist/chunk-NXQF73EC.mjs.map +0 -1
- package/packages/core/dist/chunk-P366CCL2.mjs.map +0 -1
- package/packages/core/dist/chunk-U25RHRSU.mjs.map +0 -1
- package/packages/core/dist/chunk-WRE4CNPF.mjs.map +0 -1
|
@@ -358,6 +358,8 @@ function isPersistedTokenUsage(value) {
|
|
|
358
358
|
if (!isOptionalNonNegativeNumber(value.output)) return false;
|
|
359
359
|
if (!isOptionalNonNegativeNumber(value.total)) return false;
|
|
360
360
|
if (!isOptionalNonNegativeNumber(value.cached)) return false;
|
|
361
|
+
if (!isOptionalNonNegativeNumber(value.cacheWrite)) return false;
|
|
362
|
+
if (!isOptionalNonNegativeNumber(value.reasoning)) return false;
|
|
361
363
|
return true;
|
|
362
364
|
}
|
|
363
365
|
function isPersistedTraceContext(value) {
|
|
@@ -2136,7 +2138,13 @@ function buildRunSummary(events) {
|
|
|
2136
2138
|
tokensInput: isNonNegativeFiniteNumber(s.metadata?.tokens?.input) ? s.metadata.tokens.input : void 0,
|
|
2137
2139
|
tokensOutput: isNonNegativeFiniteNumber(s.metadata?.tokens?.output) ? s.metadata.tokens.output : void 0,
|
|
2138
2140
|
tokensTotal: isNonNegativeFiniteNumber(s.metadata?.tokens?.total) ? s.metadata.tokens.total : void 0,
|
|
2139
|
-
tokensCached: isNonNegativeFiniteNumber(s.metadata?.tokens?.cached) ? s.metadata.tokens.cached : void 0
|
|
2141
|
+
tokensCached: isNonNegativeFiniteNumber(s.metadata?.tokens?.cached) ? s.metadata.tokens.cached : void 0,
|
|
2142
|
+
tokensCacheWrite: isNonNegativeFiniteNumber(
|
|
2143
|
+
s.metadata?.tokens?.cacheWrite
|
|
2144
|
+
) ? s.metadata.tokens.cacheWrite : void 0,
|
|
2145
|
+
tokensReasoning: isNonNegativeFiniteNumber(
|
|
2146
|
+
s.metadata?.tokens?.reasoning
|
|
2147
|
+
) ? s.metadata.tokens.reasoning : void 0
|
|
2140
2148
|
});
|
|
2141
2149
|
}
|
|
2142
2150
|
}
|
|
@@ -2160,9 +2168,13 @@ function buildRunSummary(events) {
|
|
|
2160
2168
|
let totalTokensOutput = 0;
|
|
2161
2169
|
let totalTokensTotal = 0;
|
|
2162
2170
|
let totalTokensCached = 0;
|
|
2171
|
+
let totalTokensCacheWrite = 0;
|
|
2172
|
+
let totalTokensReasoning = 0;
|
|
2163
2173
|
let tokenBearingSteps = 0;
|
|
2164
2174
|
let stepsWithKnownTotal = 0;
|
|
2165
2175
|
let hasCachedTokens = false;
|
|
2176
|
+
let hasCacheWriteTokens = false;
|
|
2177
|
+
let hasReasoningTokens = false;
|
|
2166
2178
|
const depthCache = /* @__PURE__ */ new Map();
|
|
2167
2179
|
for (const [id, s] of steps.entries()) {
|
|
2168
2180
|
totalSteps += 1;
|
|
@@ -2177,7 +2189,7 @@ function buildRunSummary(events) {
|
|
|
2177
2189
|
longestStep = { name: s.name, durationMs: s.durationMs, type: s.type };
|
|
2178
2190
|
}
|
|
2179
2191
|
}
|
|
2180
|
-
if (s.tokensInput !== void 0 || s.tokensOutput !== void 0 || s.tokensTotal !== void 0 || s.tokensCached !== void 0) {
|
|
2192
|
+
if (s.tokensInput !== void 0 || s.tokensOutput !== void 0 || s.tokensTotal !== void 0 || s.tokensCached !== void 0 || s.tokensCacheWrite !== void 0 || s.tokensReasoning !== void 0) {
|
|
2181
2193
|
tokenBearingSteps += 1;
|
|
2182
2194
|
if (s.tokensInput !== void 0) totalTokensInput += s.tokensInput;
|
|
2183
2195
|
if (s.tokensOutput !== void 0) totalTokensOutput += s.tokensOutput;
|
|
@@ -2192,6 +2204,14 @@ function buildRunSummary(events) {
|
|
|
2192
2204
|
totalTokensCached += s.tokensCached;
|
|
2193
2205
|
hasCachedTokens = true;
|
|
2194
2206
|
}
|
|
2207
|
+
if (s.tokensCacheWrite !== void 0) {
|
|
2208
|
+
totalTokensCacheWrite += s.tokensCacheWrite;
|
|
2209
|
+
hasCacheWriteTokens = true;
|
|
2210
|
+
}
|
|
2211
|
+
if (s.tokensReasoning !== void 0) {
|
|
2212
|
+
totalTokensReasoning += s.tokensReasoning;
|
|
2213
|
+
hasReasoningTokens = true;
|
|
2214
|
+
}
|
|
2195
2215
|
}
|
|
2196
2216
|
}
|
|
2197
2217
|
const summary = {
|
|
@@ -2211,7 +2231,9 @@ function buildRunSummary(events) {
|
|
|
2211
2231
|
input: totalTokensInput,
|
|
2212
2232
|
output: totalTokensOutput,
|
|
2213
2233
|
...stepsWithKnownTotal === tokenBearingSteps ? { total: totalTokensTotal } : {},
|
|
2214
|
-
...hasCachedTokens ? { cached: totalTokensCached } : {}
|
|
2234
|
+
...hasCachedTokens ? { cached: totalTokensCached } : {},
|
|
2235
|
+
...hasCacheWriteTokens ? { cacheWrite: totalTokensCacheWrite } : {},
|
|
2236
|
+
...hasReasoningTokens ? { reasoning: totalTokensReasoning } : {}
|
|
2215
2237
|
}
|
|
2216
2238
|
} : {}
|
|
2217
2239
|
};
|
|
@@ -2751,6 +2773,12 @@ function renderRunWhat(summary, options = {}) {
|
|
|
2751
2773
|
if (summary.totalTokens.cached !== void 0) {
|
|
2752
2774
|
tokenParts.push(`${summary.totalTokens.cached} cached`);
|
|
2753
2775
|
}
|
|
2776
|
+
if (summary.totalTokens.cacheWrite !== void 0) {
|
|
2777
|
+
tokenParts.push(`${summary.totalTokens.cacheWrite} cache-write`);
|
|
2778
|
+
}
|
|
2779
|
+
if (summary.totalTokens.reasoning !== void 0) {
|
|
2780
|
+
tokenParts.push(`${summary.totalTokens.reasoning} reasoning`);
|
|
2781
|
+
}
|
|
2754
2782
|
lines.push(`Tokens: ${tokenParts.join(" / ")}`);
|
|
2755
2783
|
}
|
|
2756
2784
|
if (showCorrelation && summary.correlation) {
|
|
@@ -6896,6 +6924,9 @@ var init_checks2 = __esm({
|
|
|
6896
6924
|
"output",
|
|
6897
6925
|
"total",
|
|
6898
6926
|
"cached",
|
|
6927
|
+
"cachewrite",
|
|
6928
|
+
"cache_write",
|
|
6929
|
+
"reasoning",
|
|
6899
6930
|
"input_tokens",
|
|
6900
6931
|
"inputtokens",
|
|
6901
6932
|
"output_tokens",
|
|
@@ -6905,7 +6936,13 @@ var init_checks2 = __esm({
|
|
|
6905
6936
|
"prompt_tokens",
|
|
6906
6937
|
"prompttokens",
|
|
6907
6938
|
"completion_tokens",
|
|
6908
|
-
"completiontokens"
|
|
6939
|
+
"completiontokens",
|
|
6940
|
+
"cache_read",
|
|
6941
|
+
"cacheread",
|
|
6942
|
+
"cache_creation",
|
|
6943
|
+
"cachecreation",
|
|
6944
|
+
"reasoning_tokens",
|
|
6945
|
+
"reasoningtokens"
|
|
6909
6946
|
]);
|
|
6910
6947
|
DEFAULT_SECRET_PATTERNS = [
|
|
6911
6948
|
{ id: "bearer-token", pattern: /Bearer\s+[A-Za-z0-9._~+/-]{12,}=*/ },
|
|
@@ -9424,16 +9461,20 @@ function normalizeTokenUsage(value) {
|
|
|
9424
9461
|
const output2 = nonNegativeFinite(value.output);
|
|
9425
9462
|
const suppliedTotal = nonNegativeFinite(value.total);
|
|
9426
9463
|
const cached2 = nonNegativeFinite(value.cached);
|
|
9464
|
+
const cacheWrite = nonNegativeFinite(value.cacheWrite);
|
|
9465
|
+
const reasoning = nonNegativeFinite(value.reasoning);
|
|
9427
9466
|
const derivedTotal = input3 !== void 0 && output2 !== void 0 && Number.isFinite(input3 + output2) ? input3 + output2 : void 0;
|
|
9428
9467
|
const total = suppliedTotal ?? derivedTotal;
|
|
9429
|
-
if (input3 === void 0 && output2 === void 0 && total === void 0 && cached2 === void 0) {
|
|
9468
|
+
if (input3 === void 0 && output2 === void 0 && total === void 0 && cached2 === void 0 && cacheWrite === void 0 && reasoning === void 0) {
|
|
9430
9469
|
return void 0;
|
|
9431
9470
|
}
|
|
9432
9471
|
return {
|
|
9433
9472
|
...input3 !== void 0 ? { input: input3 } : {},
|
|
9434
9473
|
...output2 !== void 0 ? { output: output2 } : {},
|
|
9435
9474
|
...total !== void 0 ? { total } : {},
|
|
9436
|
-
...cached2 !== void 0 ? { cached: cached2 } : {}
|
|
9475
|
+
...cached2 !== void 0 ? { cached: cached2 } : {},
|
|
9476
|
+
...cacheWrite !== void 0 ? { cacheWrite } : {},
|
|
9477
|
+
...reasoning !== void 0 ? { reasoning } : {}
|
|
9437
9478
|
};
|
|
9438
9479
|
}
|
|
9439
9480
|
var init_token_usage = __esm({
|
|
@@ -10545,6 +10586,8 @@ function readOpenInferenceTokenUsage(attributes) {
|
|
|
10545
10586
|
const completion = attributes["llm.token_count.completion"];
|
|
10546
10587
|
const total = attributes["llm.token_count.total"];
|
|
10547
10588
|
const cached2 = attributes["llm.token_count.prompt_details.cache_read"];
|
|
10589
|
+
const cacheWrite = attributes["llm.token_count.prompt_details.cache_write"] ?? attributes["llm.token_count.prompt_details.cache_creation"];
|
|
10590
|
+
const reasoning = attributes["llm.token_count.completion_details.reasoning"] ?? attributes["llm.token_count.completion_details.reasoning_tokens"];
|
|
10548
10591
|
const usage = {};
|
|
10549
10592
|
if (typeof prompt === "number" && Number.isFinite(prompt) && prompt >= 0) {
|
|
10550
10593
|
usage.input = prompt;
|
|
@@ -10558,6 +10601,12 @@ function readOpenInferenceTokenUsage(attributes) {
|
|
|
10558
10601
|
if (typeof cached2 === "number" && Number.isFinite(cached2) && cached2 >= 0) {
|
|
10559
10602
|
usage.cached = cached2;
|
|
10560
10603
|
}
|
|
10604
|
+
if (typeof cacheWrite === "number" && Number.isFinite(cacheWrite) && cacheWrite >= 0) {
|
|
10605
|
+
usage.cacheWrite = cacheWrite;
|
|
10606
|
+
}
|
|
10607
|
+
if (typeof reasoning === "number" && Number.isFinite(reasoning) && reasoning >= 0) {
|
|
10608
|
+
usage.reasoning = reasoning;
|
|
10609
|
+
}
|
|
10561
10610
|
if (usage.total === void 0 && usage.input !== void 0 && usage.output !== void 0) {
|
|
10562
10611
|
usage.total = usage.input + usage.output;
|
|
10563
10612
|
}
|
|
@@ -13599,7 +13648,7 @@ var init_src = __esm({
|
|
|
13599
13648
|
});
|
|
13600
13649
|
|
|
13601
13650
|
// package.json
|
|
13602
|
-
var version = "6.
|
|
13651
|
+
var version = "6.29.0";
|
|
13603
13652
|
|
|
13604
13653
|
// packages/cli/src/list.ts
|
|
13605
13654
|
init_advanced();
|