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.
Files changed (86) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/docs/LIMITATIONS.md +1 -1
  4. package/docs/SCHEMA.md +1 -1
  5. package/package.json +2 -1
  6. package/packages/cli/dist/{chunk-JVQ4LTHR.mjs → chunk-D7PT6TXM.mjs} +57 -8
  7. package/packages/cli/dist/chunk-D7PT6TXM.mjs.map +1 -0
  8. package/packages/cli/dist/index.cjs +56 -7
  9. package/packages/cli/dist/index.cjs.map +1 -1
  10. package/packages/cli/dist/index.mjs +4 -4
  11. package/packages/cli/dist/index.mjs.map +1 -1
  12. package/packages/cli/dist/{src-M5J5YC5E.mjs → src-QONEBW2F.mjs} +3 -3
  13. package/packages/cli/dist/{src-M5J5YC5E.mjs.map → src-QONEBW2F.mjs.map} +1 -1
  14. package/packages/core/dist/advanced.cjs +53 -6
  15. package/packages/core/dist/advanced.cjs.map +1 -1
  16. package/packages/core/dist/advanced.d.cts +9 -7
  17. package/packages/core/dist/advanced.d.ts +9 -7
  18. package/packages/core/dist/advanced.mjs +14 -14
  19. package/packages/core/dist/checks.cjs +10 -1
  20. package/packages/core/dist/checks.cjs.map +1 -1
  21. package/packages/core/dist/checks.d.cts +5 -5
  22. package/packages/core/dist/checks.d.ts +5 -5
  23. package/packages/core/dist/checks.mjs +5 -5
  24. package/packages/core/dist/{chunk-U25RHRSU.mjs → chunk-3B24355S.mjs} +12 -5
  25. package/packages/core/dist/chunk-3B24355S.mjs.map +1 -0
  26. package/packages/core/dist/{chunk-NXQF73EC.mjs → chunk-5B4DNGFB.mjs} +9 -5
  27. package/packages/core/dist/chunk-5B4DNGFB.mjs.map +1 -0
  28. package/packages/core/dist/{chunk-NDRMIL7Z.mjs → chunk-FKUTGUFG.mjs} +12 -4
  29. package/packages/core/dist/chunk-FKUTGUFG.mjs.map +1 -0
  30. package/packages/core/dist/{chunk-ME4WXYY3.mjs → chunk-LGTPSHH2.mjs} +13 -4
  31. package/packages/core/dist/chunk-LGTPSHH2.mjs.map +1 -0
  32. package/packages/core/dist/{chunk-R4SSYU6D.mjs → chunk-MVRZ7JBH.mjs} +3 -3
  33. package/packages/core/dist/{chunk-R4SSYU6D.mjs.map → chunk-MVRZ7JBH.mjs.map} +1 -1
  34. package/packages/core/dist/{chunk-P366CCL2.mjs → chunk-QJI52TH3.mjs} +4 -2
  35. package/packages/core/dist/chunk-QJI52TH3.mjs.map +1 -0
  36. package/packages/core/dist/{chunk-WRE4CNPF.mjs → chunk-SJ3C5RIS.mjs} +3 -3
  37. package/packages/core/dist/chunk-SJ3C5RIS.mjs.map +1 -0
  38. package/packages/core/dist/{chunk-WGDSM37E.mjs → chunk-TIGBAVED.mjs} +5 -5
  39. package/packages/core/dist/{chunk-WGDSM37E.mjs.map → chunk-TIGBAVED.mjs.map} +1 -1
  40. package/packages/core/dist/{chunk-JBNRJLIV.mjs → chunk-TNOPL75V.mjs} +33 -7
  41. package/packages/core/dist/chunk-TNOPL75V.mjs.map +1 -0
  42. package/packages/core/dist/{context-DgcvkJ9t.d.ts → context-B8zzsmjX.d.ts} +2 -2
  43. package/packages/core/dist/{context-DGMqxFpz.d.cts → context-BhaVHtOT.d.cts} +2 -2
  44. package/packages/core/dist/diff.d.cts +1 -1
  45. package/packages/core/dist/diff.d.ts +1 -1
  46. package/packages/core/dist/exporters.cjs +29 -3
  47. package/packages/core/dist/exporters.cjs.map +1 -1
  48. package/packages/core/dist/exporters.d.cts +1 -1
  49. package/packages/core/dist/exporters.d.ts +1 -1
  50. package/packages/core/dist/exporters.mjs +5 -5
  51. package/packages/core/dist/{index-C6bCIbFO.d.cts → index-BT3KcO6-.d.cts} +1 -1
  52. package/packages/core/dist/{index-DVetZwGG.d.cts → index-C61p7wBR.d.cts} +3 -3
  53. package/packages/core/dist/{index-BOA1AeEU.d.ts → index-DTO2iGeq.d.ts} +3 -3
  54. package/packages/core/dist/{index-BzyNPfLm.d.ts → index-reskZCVW.d.ts} +1 -1
  55. package/packages/core/dist/index.cjs +10 -1
  56. package/packages/core/dist/index.cjs.map +1 -1
  57. package/packages/core/dist/index.d.cts +4 -4
  58. package/packages/core/dist/index.d.ts +4 -4
  59. package/packages/core/dist/index.mjs +6 -6
  60. package/packages/core/dist/{persisted-inspect-event-CbaRYpbw.d.ts → persisted-inspect-event-BMwvGIB8.d.ts} +5 -0
  61. package/packages/core/dist/{persisted-inspect-event-DiJ0I_vi.d.cts → persisted-inspect-event-DPaCiars.d.cts} +5 -0
  62. package/packages/core/dist/persisted.cjs +8 -2
  63. package/packages/core/dist/persisted.cjs.map +1 -1
  64. package/packages/core/dist/persisted.d.cts +3 -3
  65. package/packages/core/dist/persisted.d.ts +3 -3
  66. package/packages/core/dist/persisted.mjs +3 -3
  67. package/packages/core/dist/readers.cjs +16 -2
  68. package/packages/core/dist/readers.cjs.map +1 -1
  69. package/packages/core/dist/readers.d.cts +2 -2
  70. package/packages/core/dist/readers.d.ts +2 -2
  71. package/packages/core/dist/readers.mjs +4 -4
  72. package/packages/core/dist/{types-wXuxMUop.d.cts → types-BSzhK7Z1.d.cts} +9 -0
  73. package/packages/core/dist/{types-xv9bSgOK.d.ts → types-C5Y8Idle.d.ts} +9 -0
  74. package/packages/core/dist/writers.cjs +10 -1
  75. package/packages/core/dist/writers.cjs.map +1 -1
  76. package/packages/core/dist/writers.d.cts +1 -1
  77. package/packages/core/dist/writers.d.ts +1 -1
  78. package/packages/core/dist/writers.mjs +3 -3
  79. package/packages/cli/dist/chunk-JVQ4LTHR.mjs.map +0 -1
  80. package/packages/core/dist/chunk-JBNRJLIV.mjs.map +0 -1
  81. package/packages/core/dist/chunk-ME4WXYY3.mjs.map +0 -1
  82. package/packages/core/dist/chunk-NDRMIL7Z.mjs.map +0 -1
  83. package/packages/core/dist/chunk-NXQF73EC.mjs.map +0 -1
  84. package/packages/core/dist/chunk-P366CCL2.mjs.map +0 -1
  85. package/packages/core/dist/chunk-U25RHRSU.mjs.map +0 -1
  86. 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.28.0";
13651
+ var version = "6.29.0";
13603
13652
 
13604
13653
  // packages/cli/src/list.ts
13605
13654
  init_advanced();