agent-inspect 6.17.2 → 6.17.4

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 (32) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +5 -8
  3. package/docs/ADAPTER-CONFORMANCE.md +24 -0
  4. package/docs/CI-ARTIFACTS.md +2 -1
  5. package/docs/OPENAI-AGENTS-LOCAL.md +14 -0
  6. package/docs/SAFE-TRACE-SHARING.md +3 -0
  7. package/docs/SCREENSHOTS.md +2 -1
  8. package/docs/SELF-HOSTING.md +2 -0
  9. package/docs/STANDARDS.md +15 -0
  10. package/docs/SUPPORT-LEVELS.md +23 -0
  11. package/docs/assets/agent-inspect-logo-mark.svg +12 -0
  12. package/docs/assets/readme-product-loop.svg +17 -26
  13. package/package.json +5 -3
  14. package/packages/cli/dist/{chunk-FXGWXSFV.mjs → chunk-YX6RFLV5.mjs} +15 -5
  15. package/packages/cli/dist/chunk-YX6RFLV5.mjs.map +1 -0
  16. package/packages/cli/dist/index.cjs +32 -10
  17. package/packages/cli/dist/index.cjs.map +1 -1
  18. package/packages/cli/dist/index.mjs +22 -10
  19. package/packages/cli/dist/index.mjs.map +1 -1
  20. package/packages/cli/dist/{src-EW7KW2BK.mjs → src-X6SLMBNH.mjs} +3 -3
  21. package/packages/cli/dist/{src-EW7KW2BK.mjs.map → src-X6SLMBNH.mjs.map} +1 -1
  22. package/packages/core/dist/advanced.cjs +7 -2
  23. package/packages/core/dist/advanced.cjs.map +1 -1
  24. package/packages/core/dist/advanced.mjs +7 -2
  25. package/packages/core/dist/advanced.mjs.map +1 -1
  26. package/packages/core/dist/checks.cjs +7 -2
  27. package/packages/core/dist/checks.cjs.map +1 -1
  28. package/packages/core/dist/checks.mjs +1 -1
  29. package/packages/core/dist/{chunk-UFP54T7F.mjs → chunk-HN377P23.mjs} +9 -4
  30. package/packages/core/dist/chunk-HN377P23.mjs.map +1 -0
  31. package/packages/cli/dist/chunk-FXGWXSFV.mjs.map +0 -1
  32. package/packages/core/dist/chunk-UFP54T7F.mjs.map +0 -1
@@ -2765,7 +2765,12 @@ function countErrorNodes(nodes) {
2765
2765
  return nodes.filter((entry) => entry.node.event.status === "error").length;
2766
2766
  }
2767
2767
  function slowestNode(nodes) {
2768
- return nodes.filter((entry) => entry.node.event.durationMs !== void 0).sort((a, b) => {
2768
+ return nodes.filter(
2769
+ (entry) => entry.node.event.durationMs !== void 0 && // The RUN boundary spans the whole run, so its duration always dominates
2770
+ // and shadows every real step. Rank actual work nodes only, matching the
2771
+ // stats slowest-step ranking, which never counts the run envelope.
2772
+ entry.node.event.kind !== "RUN"
2773
+ ).sort((a, b) => {
2769
2774
  const delta = (b.node.event.durationMs ?? 0) - (a.node.event.durationMs ?? 0);
2770
2775
  return delta !== 0 ? delta : a.index - b.index;
2771
2776
  })[0];
@@ -6414,8 +6419,11 @@ var init_programmatic = __esm({
6414
6419
  });
6415
6420
 
6416
6421
  // packages/core/src/safety/sensitive-key.ts
6422
+ function keyHasExplicitSeparator(value) {
6423
+ return /[_\-.]/.test(value);
6424
+ }
6417
6425
  function normalizeSensitiveKey(value) {
6418
- return value.toLowerCase().replace(/[^a-z0-9_]/g, "");
6426
+ return value.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
6419
6427
  }
6420
6428
  function isTokenCredentialKey(normalized) {
6421
6429
  if (NON_CREDENTIAL_TOKEN_CONFIG_KEYS.has(normalized)) return false;
@@ -6428,6 +6436,7 @@ function isCredentialSensitiveKey(key, sensitiveKeys = DEFAULT_CREDENTIAL_SENSIT
6428
6436
  const normalized = normalizeSensitiveKey(key);
6429
6437
  if (!normalized) return false;
6430
6438
  if (NON_CREDENTIAL_TOKEN_CONFIG_KEYS.has(normalized)) return false;
6439
+ const allowPrefixCompound = keyHasExplicitSeparator(key);
6431
6440
  for (const sensitive of sensitiveKeys) {
6432
6441
  const s = normalizeSensitiveKey(sensitive);
6433
6442
  if (!s) continue;
@@ -6436,7 +6445,8 @@ function isCredentialSensitiveKey(key, sensitiveKeys = DEFAULT_CREDENTIAL_SENSIT
6436
6445
  continue;
6437
6446
  }
6438
6447
  if (normalized === s) return true;
6439
- if (normalized.endsWith(`_${s}`) || normalized.startsWith(`${s}_`)) return true;
6448
+ if (normalized.endsWith(`_${s}`)) return true;
6449
+ if (allowPrefixCompound && normalized.startsWith(`${s}_`)) return true;
6440
6450
  }
6441
6451
  return false;
6442
6452
  }
@@ -12501,7 +12511,7 @@ var init_src = __esm({
12501
12511
  });
12502
12512
 
12503
12513
  // package.json
12504
- var version = "6.17.2";
12514
+ var version = "6.17.4";
12505
12515
 
12506
12516
  // packages/cli/src/list.ts
12507
12517
  init_advanced();
@@ -16394,8 +16404,11 @@ async function reportCommand(runId, options = {}) {
16394
16404
  init_advanced();
16395
16405
 
16396
16406
  // packages/redact/src/sensitive-key.ts
16407
+ function keyHasExplicitSeparator2(value) {
16408
+ return /[_\-.]/.test(value);
16409
+ }
16397
16410
  function normalizeSensitiveKey2(value) {
16398
- return value.toLowerCase().replace(/[^a-z0-9_]/g, "");
16411
+ return value.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
16399
16412
  }
16400
16413
  var NON_CREDENTIAL_TOKEN_CONFIG_KEYS2 = new Set(
16401
16414
  [
@@ -16425,6 +16438,7 @@ function isCredentialSensitiveKey2(key, sensitiveKeys) {
16425
16438
  const normalized = normalizeSensitiveKey2(key);
16426
16439
  if (!normalized) return false;
16427
16440
  if (NON_CREDENTIAL_TOKEN_CONFIG_KEYS2.has(normalized)) return false;
16441
+ const allowPrefixCompound = keyHasExplicitSeparator2(key);
16428
16442
  for (const sensitive of sensitiveKeys) {
16429
16443
  const s = normalizeSensitiveKey2(sensitive);
16430
16444
  if (!s) continue;
@@ -16433,7 +16447,8 @@ function isCredentialSensitiveKey2(key, sensitiveKeys) {
16433
16447
  continue;
16434
16448
  }
16435
16449
  if (normalized === s) return true;
16436
- if (normalized.endsWith(`_${s}`) || normalized.startsWith(`${s}_`)) return true;
16450
+ if (normalized.endsWith(`_${s}`)) return true;
16451
+ if (allowPrefixCompound && normalized.startsWith(`${s}_`)) return true;
16437
16452
  }
16438
16453
  return false;
16439
16454
  }
@@ -24373,9 +24388,15 @@ function normalizeMetrics2(raw) {
24373
24388
  const parsed = parseCohortMetricList(raw);
24374
24389
  if (parsed.length === 0) return void 0;
24375
24390
  const allowed = new Set(COHORT_METRIC_IDS);
24376
- return parsed.filter(
24377
- (item) => allowed.has(item)
24378
- );
24391
+ const invalid = parsed.filter((metric) => !allowed.has(metric));
24392
+ if (invalid.length > 0) {
24393
+ const valueLabel = invalid.length === 1 ? "value" : "values";
24394
+ const invalidList = invalid.map((metric) => `"${metric}"`).join(", ");
24395
+ throw new Error(
24396
+ `Unsupported cohort --metric ${valueLabel}: ${invalidList}. Valid metrics: ${COHORT_METRIC_IDS.join(", ")}.`
24397
+ );
24398
+ }
24399
+ return parsed;
24379
24400
  }
24380
24401
  async function writeArtifacts(result, outputDir) {
24381
24402
  await promises.mkdir(outputDir, { recursive: true });
@@ -24396,6 +24417,7 @@ async function writeArtifacts(result, outputDir) {
24396
24417
  }
24397
24418
  async function cohortCommand(options = {}) {
24398
24419
  try {
24420
+ const metrics = normalizeMetrics2(options.metric);
24399
24421
  const traceDir = resolveTraceDir({ dir: options.dir });
24400
24422
  const { runs } = await loadSessionRuns(traceDir);
24401
24423
  const result = await analyzeCohort(runs, {
@@ -24404,7 +24426,7 @@ async function cohortCommand(options = {}) {
24404
24426
  candidate: options.candidate,
24405
24427
  cohortKey: options.cohortKey,
24406
24428
  groupBy: options.groupBy,
24407
- metrics: normalizeMetrics2(options.metric)
24429
+ metrics
24408
24430
  });
24409
24431
  const format = options.format ?? (options.json ? "json" : "markdown");
24410
24432
  let artifacts;