agent-inspect 6.31.16 → 6.31.18

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 (42) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/SECURITY.md +1 -0
  4. package/docs/COMPARE.md +11 -0
  5. package/package.json +2 -2
  6. package/packages/cli/dist/{chunk-ZAYVAHIH.mjs → chunk-AHARYDFO.mjs} +62 -28
  7. package/packages/cli/dist/chunk-AHARYDFO.mjs.map +1 -0
  8. package/packages/cli/dist/index.cjs +122 -32
  9. package/packages/cli/dist/index.cjs.map +1 -1
  10. package/packages/cli/dist/index.mjs +64 -9
  11. package/packages/cli/dist/index.mjs.map +1 -1
  12. package/packages/cli/dist/{src-KP4UIFK5.mjs → src-YNZZ2KYR.mjs} +3 -3
  13. package/packages/cli/dist/{src-KP4UIFK5.mjs.map → src-YNZZ2KYR.mjs.map} +1 -1
  14. package/packages/core/dist/advanced.cjs +1 -1
  15. package/packages/core/dist/advanced.cjs.map +1 -1
  16. package/packages/core/dist/advanced.mjs +9 -9
  17. package/packages/core/dist/checks.cjs +59 -25
  18. package/packages/core/dist/checks.cjs.map +1 -1
  19. package/packages/core/dist/checks.mjs +3 -3
  20. package/packages/core/dist/{chunk-SSG3ICI4.mjs → chunk-6C244CAV.mjs} +4 -4
  21. package/packages/core/dist/{chunk-SSG3ICI4.mjs.map → chunk-6C244CAV.mjs.map} +1 -1
  22. package/packages/core/dist/{chunk-N5PZAI6Q.mjs → chunk-77UZIMMD.mjs} +3 -3
  23. package/packages/core/dist/{chunk-N5PZAI6Q.mjs.map → chunk-77UZIMMD.mjs.map} +1 -1
  24. package/packages/core/dist/{chunk-DK3OW6UI.mjs → chunk-EOXUEQB6.mjs} +3 -3
  25. package/packages/core/dist/chunk-EOXUEQB6.mjs.map +1 -0
  26. package/packages/core/dist/{chunk-CCYKNAOD.mjs → chunk-FRBBZUEP.mjs} +62 -28
  27. package/packages/core/dist/chunk-FRBBZUEP.mjs.map +1 -0
  28. package/packages/core/dist/{chunk-M3RJD3BP.mjs → chunk-NX25C7JZ.mjs} +3 -3
  29. package/packages/core/dist/{chunk-M3RJD3BP.mjs.map → chunk-NX25C7JZ.mjs.map} +1 -1
  30. package/packages/core/dist/exporters.cjs +55 -3
  31. package/packages/core/dist/exporters.cjs.map +1 -1
  32. package/packages/core/dist/exporters.mjs +57 -5
  33. package/packages/core/dist/exporters.mjs.map +1 -1
  34. package/packages/core/dist/index.cjs +1 -1
  35. package/packages/core/dist/index.cjs.map +1 -1
  36. package/packages/core/dist/index.mjs +4 -4
  37. package/packages/core/dist/writers.cjs +1 -1
  38. package/packages/core/dist/writers.cjs.map +1 -1
  39. package/packages/core/dist/writers.mjs +1 -1
  40. package/packages/cli/dist/chunk-ZAYVAHIH.mjs.map +0 -1
  41. package/packages/core/dist/chunk-CCYKNAOD.mjs.map +0 -1
  42. package/packages/core/dist/chunk-DK3OW6UI.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.31.18
4
+
5
+ ### Patch Changes
6
+
7
+ - c65817e: Fix recovery result-availability ordering and mixed attemptId counting; emit bounded OTLP operation/attempt identity without broad attribute dump; add real MCP SDK packed e2e and Fix-Owes recipe corpus (variable paths, timeout ledger, access disclosure, browser observed outcomes, NestJS tenant, causal failure, headsign, Keniel B8).
8
+
9
+ ## 6.31.17
10
+
11
+ ### Patch Changes
12
+
13
+ - dc9aaf2: Harden sensitive-key complete-marker handling so arbitrary `[REDACTED:…]` / `[HASH:…]` payloads are re-scrubbed (library-emitted markers only), and ship the already-merged Windows `--policy` drive-path fix.
14
+
3
15
  ## 6.31.16
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -213,7 +213,7 @@ The root package is enough for custom capture, the CLI, checks, and Evidence wor
213
213
 
214
214
  ## Status and documentation
215
215
 
216
- **Current published baseline:** **6.31.16** · persisted schema `1.0` · Node.js `>=20` · MIT.
216
+ **Current published baseline:** **6.31.18** · persisted schema `1.0` · Node.js `>=20` · MIT.
217
217
 
218
218
  Legacy v0.1 and v0.2 traces remain readable. Check the npm badge and [changelog](CHANGELOG.md) for the current published version.
219
219
 
package/SECURITY.md CHANGED
@@ -62,6 +62,7 @@ AgentInspect aims to be safe-by-default for **log-derived attributes** and **exp
62
62
 
63
63
  - Log ingestion applies redaction to parsed attributes using configured rules (with conservative defaults).
64
64
  - Exporters default to redacted output and bounded attribute previews.
65
+ - Sensitive-key complete-marker bypass trusts only library-emitted placeholders (`[REDACTED]`, `[HASH:<8 hex>]`, `[HASH:unknown]`). Arbitrary `[REDACTED:…]` / `[HASH:…]` strings are re-scrubbed. Report residual marker-grammar gaps via a private advisory when possible.
65
66
 
66
67
  Important limitations:
67
68
 
package/docs/COMPARE.md CHANGED
@@ -100,6 +100,16 @@ AgentInspect avoids SDK/collector setup for local debugging:
100
100
  - Use OpenTelemetry when you need organization-wide production telemetry pipelines.
101
101
  - Local OTLP JSON export can help bridge later, but AgentInspect is not an OpenTelemetry SDK replacement.
102
102
 
103
+ ## AgentInspect vs OrcaReplay
104
+
105
+ OrcaReplay is a local CLI that records an agent run at the model-provider boundary and serves the recorded turns back later without contacting the provider.
106
+
107
+ AgentInspect is local-first CLI debugging:
108
+
109
+ - Use AgentInspect to inspect and gate a run's trajectory; the two capture at different layers. AgentInspect builds a local execution tree from in-process instrumentation and from existing log/trace readers; OrcaReplay proxies the provider connection and records the bytes on the wire. Simultaneous AgentInspect + OrcaReplay capture on one run is possible in principle but **untested** here until a retained joint experiment exists.
110
+ - If you reach for OrcaReplay, two limits are worth knowing: a matching replay is not a determinism result, and replay blocks model-provider egress only — it is not a sandbox, so recorded tool calls still execute and a tool that opens its own connection still reaches the network.
111
+ - AgentInspect does not replay a recorded run; the README lists "a replay engine" among the things it is not.
112
+
103
113
  ## Quick decision table
104
114
 
105
115
  | Need | AgentInspect fit |
@@ -112,6 +122,7 @@ AgentInspect avoids SDK/collector setup for local debugging:
112
122
  | Share-safe local redaction copy | Good fit |
113
123
  | Existing structured logs to trees | Good fit |
114
124
  | VS Code trace review (in-repo extension) | Good fit; Marketplace listing separate |
125
+ | Offline replay of a recorded run | Not the goal |
115
126
  | Production dashboards | Not the goal |
116
127
  | Hosted eval datasets | Not the goal |
117
128
  | Prompt management | Not the goal |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "6.31.16",
3
+ "version": "6.31.18",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Local evidence debugger and trajectory-test toolkit for TypeScript AI agents — execution trees, TraceContract checks, Evidence v2, and read-only MCP",
@@ -236,7 +236,7 @@
236
236
  "test:all": "pnpm run typecheck && pnpm run linked-versions:check && pnpm run build && pnpm run test && pnpm run size",
237
237
  "prepublish:checks": "pnpm run typecheck && pnpm run build && pnpm run test && pnpm run test:coverage && pnpm run fixtures:check && pnpm run recipes:check && pnpm run test:integration-offline && pnpm run size && pnpm run linked-versions:check && pnpm run repo:health && pnpm run pack:smoke",
238
238
  "pack:dry-run": "pnpm run build && npm pack --dry-run",
239
- "pack:smoke": "pnpm run package-licenses:check && pnpm run build && node scripts/package-smoke.mjs && node scripts/packed-openai-agents-e2e.mjs && node scripts/packed-ai-sdk-e2e.mjs && node scripts/packed-mcp-e2e.mjs && node scripts/packed-quickstart-e2e.mjs && node scripts/packed-semantic-loop-e2e.mjs && node scripts/packed-swarm-loop-e2e.mjs && node scripts/evidence-ci-golden-paths.mjs",
239
+ "pack:smoke": "pnpm run package-licenses:check && pnpm run build && node scripts/package-smoke.mjs && node scripts/packed-openai-agents-e2e.mjs && node scripts/packed-ai-sdk-e2e.mjs && node scripts/packed-mcp-e2e.mjs && node scripts/packed-mcp-sdk-e2e.mjs && node scripts/packed-quickstart-e2e.mjs && node scripts/packed-semantic-loop-e2e.mjs && node scripts/packed-swarm-loop-e2e.mjs && node scripts/evidence-ci-golden-paths.mjs",
240
240
  "linked-versions:check": "node scripts/check-linked-versions.mjs",
241
241
  "docs:commands": "node scripts/validate-doc-commands.mjs",
242
242
  "docs:links": "node scripts/validate-doc-links.mjs",
@@ -930,7 +930,7 @@ var Redactor = class {
930
930
  };
931
931
 
932
932
  // packages/core/src/safety/credential-value-patterns.ts
933
- var KEY_VALUE_SECRET_PATTERN = /\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=(?!\[(?:REDACTED(?::[^\]]*)?|HASH:[0-9a-f]{8})\](?![^\s"'\\&#?]))([^\s"'\\]{8,})/i;
933
+ var KEY_VALUE_SECRET_PATTERN = /\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=(?!\[(?:REDACTED|HASH:(?:[0-9a-f]{8}|unknown))\](?![^\s"'\\&#?]))([^\s"'\\]{8,})/i;
934
934
  var HIGH_CONFIDENCE_CREDENTIAL_PATTERNS = [
935
935
  /^(?:basic|bearer|digest|apikey)\s+[a-z0-9._~+/=-]+$/i,
936
936
  /\bbearer\s+[a-z0-9._~+/=-]{12,}\b/i,
@@ -5737,24 +5737,26 @@ function attemptIdOf(event) {
5737
5737
  return typeof value === "string" && value.trim() !== "" ? value : void 0;
5738
5738
  }
5739
5739
  function countOperationAttempts(members) {
5740
- const attemptIds = new Set(
5741
- members.map((event) => attemptIdOf(event)).filter((value) => value !== void 0)
5742
- );
5743
- if (attemptIds.size > 0) {
5744
- return attemptIds.size;
5740
+ const identified = /* @__PURE__ */ new Set();
5741
+ let unidentified = 0;
5742
+ for (const event of members) {
5743
+ if (event.kind !== "TOOL" && event.kind !== "LLM") continue;
5744
+ const id = attemptIdOf(event);
5745
+ if (id !== void 0) {
5746
+ identified.add(id);
5747
+ continue;
5748
+ }
5749
+ unidentified += 1;
5750
+ }
5751
+ if (identified.size > 0) {
5752
+ return identified.size + unidentified;
5745
5753
  }
5746
5754
  const numbers = members.map((event) => attemptNumberOf(event)).filter((value) => value !== void 0).sort((a, b) => a - b);
5747
5755
  if (numbers.length > 0) {
5748
5756
  const unique = [...new Set(numbers)];
5749
- const min = unique[0];
5750
- const max = unique[unique.length - 1];
5751
- const contiguous = unique.length === max - min + 1 && unique.every((value, index) => value === min + index);
5752
- if (contiguous) {
5753
- return unique.length;
5754
- }
5755
5757
  return unique.length;
5756
5758
  }
5757
- return members.filter((event) => event.kind === "TOOL" || event.kind === "LLM").length;
5759
+ return unidentified;
5758
5760
  }
5759
5761
  function classifyRetryAttempt(event, priorOrdered, allMembers) {
5760
5762
  const workflow = workflowFor(event);
@@ -6029,8 +6031,30 @@ function eventEvidence2(event) {
6029
6031
  function eventTime2(event) {
6030
6032
  return event.startedAt ?? event.timestamp ?? "";
6031
6033
  }
6034
+ function parseComparableMs(value) {
6035
+ if (!value) return void 0;
6036
+ const parsed = Date.parse(value);
6037
+ return Number.isFinite(parsed) ? parsed : void 0;
6038
+ }
6039
+ function consumerStartMs(event) {
6040
+ return parseComparableMs(event.startedAt) ?? parseComparableMs(event.timestamp);
6041
+ }
6042
+ function resultAvailableMs(event) {
6043
+ const ended = parseComparableMs(event.endedAt);
6044
+ if (ended !== void 0) return ended;
6045
+ const started = parseComparableMs(event.startedAt) ?? parseComparableMs(event.timestamp);
6046
+ if (started !== void 0 && event.durationMs !== void 0 && Number.isFinite(event.durationMs)) {
6047
+ return started + event.durationMs;
6048
+ }
6049
+ return parseComparableMs(event.timestamp);
6050
+ }
6032
6051
  function sortByTime2(events) {
6033
- return [...events].sort((a, b) => eventTime2(a).localeCompare(eventTime2(b)));
6052
+ return [...events].sort((a, b) => {
6053
+ const aMs = consumerStartMs(a) ?? 0;
6054
+ const bMs = consumerStartMs(b) ?? 0;
6055
+ if (aMs !== bMs) return aMs - bMs;
6056
+ return eventTime2(a).localeCompare(eventTime2(b));
6057
+ });
6034
6058
  }
6035
6059
  function errorCodeOf(event) {
6036
6060
  if (typeof event.error?.code === "string" && event.error.code.trim() !== "") {
@@ -6098,13 +6122,20 @@ function sameArguments(left, right) {
6098
6122
  }
6099
6123
  return { ok: true };
6100
6124
  }
6125
+ var UNEVALUABLE_WRITE_ERROR_CODES = /* @__PURE__ */ new Set([
6126
+ "TIMEOUT",
6127
+ "ETIMEDOUT",
6128
+ "UNKNOWN_COMPLETION",
6129
+ "DEADLINE_EXCEEDED"
6130
+ ]);
6101
6131
  function isUnevaluableWriteCompletion(event) {
6102
6132
  if (event.status === "running" || event.status === "unknown") return true;
6103
6133
  const attrs = event.attributes ?? {};
6104
6134
  if (attrs.timeout === true) return true;
6135
+ if (attrs.unknownCompletion === true) return true;
6105
6136
  if (attrs.completionState === "unknown" || attrs.completionState === "timeout") return true;
6106
6137
  const code = errorCodeOf(event)?.toUpperCase();
6107
- if (code === "TIMEOUT" || code === "UNKNOWN_COMPLETION" || code === "DEADLINE_EXCEEDED") {
6138
+ if (code && UNEVALUABLE_WRITE_ERROR_CODES.has(code)) {
6108
6139
  return true;
6109
6140
  }
6110
6141
  return false;
@@ -6152,14 +6183,17 @@ function collectExplicitReferences(event) {
6152
6183
  return refs;
6153
6184
  }
6154
6185
  function llmReferencesTool(llm, toolEvent, requireExplicit) {
6155
- if (!requireExplicit) {
6156
- return eventTime2(llm) >= eventTime2(toolEvent);
6157
- }
6158
- const refs = collectExplicitReferences(llm);
6159
- if (refs.has(toolEvent.eventId)) return true;
6160
- const toolCallId = workflowFor2(toolEvent).toolCallId;
6161
- if (toolCallId && refs.has(toolCallId)) return true;
6162
- return false;
6186
+ if (llm.runId !== toolEvent.runId) return false;
6187
+ if (requireExplicit) {
6188
+ const refs = collectExplicitReferences(llm);
6189
+ const toolCallId = workflowFor2(toolEvent).toolCallId;
6190
+ const hasRef = refs.has(toolEvent.eventId) || toolCallId !== void 0 && refs.has(toolCallId);
6191
+ if (!hasRef) return false;
6192
+ }
6193
+ const resultMs = resultAvailableMs(toolEvent);
6194
+ const consumerMs = consumerStartMs(llm);
6195
+ if (resultMs === void 0 || consumerMs === void 0) return false;
6196
+ return resultMs <= consumerMs;
6163
6197
  }
6164
6198
  function attemptIdOf2(event) {
6165
6199
  const value = workflowFor2(event).attemptId;
@@ -7525,7 +7559,7 @@ var DEFAULT_SECRET_PATTERNS = [
7525
7559
  // Keep in sync with packages/redact/src/key-value-secret.ts (KEY_VALUE_SECRET_PATTERN_SOURCE).
7526
7560
  {
7527
7561
  id: "key-value-secret",
7528
- pattern: /\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=(?!\[(?:REDACTED(?::[^\]]*)?|HASH:[0-9a-f]{8})\](?![^\s"'\\&#?]))([^\s"'\\]{8,})/i
7562
+ pattern: /\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=(?!\[(?:REDACTED|HASH:(?:[0-9a-f]{8}|unknown))\](?![^\s"'\\&#?]))([^\s"'\\]{8,})/i
7529
7563
  }
7530
7564
  ];
7531
7565
  function compareStrings(a, b) {
@@ -7966,8 +8000,8 @@ function isFullyRedactedValue(value, markers = ["[REDACTED]", "[REDACTED:"]) {
7966
8000
  if (typeof value !== "string") return false;
7967
8001
  const trimmed = value.trim();
7968
8002
  if (trimmed.length === 0) return false;
7969
- if (/^\[HASH:[A-Za-z0-9_-]+\]$/.test(trimmed)) return true;
7970
- if (/^\[REDACTED:[^\]]*\]$/.test(trimmed)) return true;
8003
+ if (trimmed === "[HASH:unknown]") return true;
8004
+ if (/^\[HASH:[0-9a-f]{8}\]$/.test(trimmed)) return true;
7971
8005
  for (const marker of markers) {
7972
8006
  if (marker.endsWith(":")) continue;
7973
8007
  if (trimmed === marker) return true;
@@ -15547,5 +15581,5 @@ function renderGateReport(result, options = {}) {
15547
15581
  }
15548
15582
 
15549
15583
  export { ATTRIBUTION_CONFIDENCES, COHORT_METRIC_IDS, DEFAULT_REDACT_KEYS, DEFAULT_SUITE_ARTIFACTS_DIR, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, Redactor, TraceDirectory, TraceReadError, TreeBuilder, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, applyProfileMetadataCaps, assertBundlePathContained, assertEvidenceRelativePath, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceCausalFailureViewHtml, buildEvidenceCiPackage, buildEvidenceCircuitViewHtml, buildEvidenceContractsViewHtml, buildEvidenceDiffViewHtml, buildEvidenceHtmlShell, buildEvidenceManifest, buildEvidenceOutcomesViewHtml, buildEvidenceProvenanceViewHtml, buildEvidenceSafetyViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceTreeViewHtml, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, buildZipArchive, bundleFailsOnSafety, bundleRunAssetRelativePath, collectTraceSchemaVersions, compactAttributes, createBaselineRegressionRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRunDepthRule, createRunDurationRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStructureCycleRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolUsageRule, defaultBundleOutputPath, defaultSuiteConfigTemplate, defineTraceContract, diffRuns, diffTraceEvents, enrichSessionRunRecord, escapeHtml, escapeMarkdown, evaluateTraceContract, extractMetadata, extractOutcomesFromTraceEvents, filterMetasBySessionScope, filterTraces, flattenTree, formatDuration2 as formatDuration, formatStepLabel, formatTimestamp, gateHasThresholds, getIndent, getTraceFilePath, inferEvidenceFileRole, isAgentInspectTrace, isAttributionConfidence, isCredentialSensitiveKey, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, manualTraceEventsToComparableRun, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToRunTrees, persistedInspectEventsToTraceEvents, projectLogicalEvents, renderActivitySummaryHuman, renderCohortReport, renderErrorLine, renderGateReport, renderObservedOutcomesHtml, renderObservedOutcomesMarkdown, renderRunDiff, renderRunWhat, renderStepLine, renderSuiteReport, renderTimeline, renderTraceStats, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteTemplate, resolveTraceDir, runGate, runSuite, runTraceChecks, safeString, sanitizeBundleRunId, searchTraces, serializeEvidenceManifest, sha256Hex, stableJson, stringContainsHighConfidenceCredential, summarizeObservedOutcomes, summarizeSemanticParity, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, verifyEvidenceDirectory, zeroKinds };
15550
- //# sourceMappingURL=chunk-ZAYVAHIH.mjs.map
15551
- //# sourceMappingURL=chunk-ZAYVAHIH.mjs.map
15584
+ //# sourceMappingURL=chunk-AHARYDFO.mjs.map
15585
+ //# sourceMappingURL=chunk-AHARYDFO.mjs.map