agent-inspect 6.31.9 → 6.31.10
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/package.json +1 -1
- package/packages/cli/dist/{chunk-SWUZRRDT.mjs → chunk-JCKC4ZRV.mjs} +78 -2
- package/packages/cli/dist/chunk-JCKC4ZRV.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +79 -1
- 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-XFIPYODW.mjs → src-4UD7JNDR.mjs} +3 -3
- package/packages/cli/dist/{src-XFIPYODW.mjs.map → src-4UD7JNDR.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +24 -0
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +7 -6
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +79 -0
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +1 -1
- package/packages/core/dist/checks.d.ts +1 -1
- package/packages/core/dist/checks.mjs +3 -2
- package/packages/core/dist/{chunk-L5WLVBW4.mjs → chunk-AHUZNHFI.mjs} +4 -55
- package/packages/core/dist/chunk-AHUZNHFI.mjs.map +1 -0
- package/packages/core/dist/{chunk-2CCRUI42.mjs → chunk-CPQAOJW4.mjs} +72 -3
- package/packages/core/dist/chunk-CPQAOJW4.mjs.map +1 -0
- package/packages/core/dist/{chunk-2IRRUNIN.mjs → chunk-OAUNS5CS.mjs} +3 -3
- package/packages/core/dist/{chunk-2IRRUNIN.mjs.map → chunk-OAUNS5CS.mjs.map} +1 -1
- package/packages/core/dist/{chunk-IJJSPJXV.mjs → chunk-QOC3PJO3.mjs} +4 -4
- package/packages/core/dist/{chunk-IJJSPJXV.mjs.map → chunk-QOC3PJO3.mjs.map} +1 -1
- package/packages/core/dist/chunk-S6LQBLX5.mjs +67 -0
- package/packages/core/dist/chunk-S6LQBLX5.mjs.map +1 -0
- package/packages/core/dist/{chunk-3SPBELJB.mjs → chunk-SSG3ICI4.mjs} +16 -2
- package/packages/core/dist/chunk-SSG3ICI4.mjs.map +1 -0
- package/packages/core/dist/index.cjs +77 -0
- package/packages/core/dist/index.cjs.map +1 -1
- package/packages/core/dist/index.mjs +3 -2
- package/packages/core/dist/index.mjs.map +1 -1
- package/packages/core/dist/persisted.cjs +11 -0
- package/packages/core/dist/persisted.cjs.map +1 -1
- package/packages/core/dist/persisted.mjs +4 -3
- package/packages/core/dist/persisted.mjs.map +1 -1
- package/packages/core/dist/{programmatic-gZTWLObB.d.cts → programmatic-BLlC7Ytq.d.cts} +1 -1
- package/packages/core/dist/{programmatic-gZTWLObB.d.ts → programmatic-BLlC7Ytq.d.ts} +1 -1
- package/packages/core/dist/readers.cjs +11 -0
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.d.cts +1 -1
- package/packages/core/dist/readers.d.ts +1 -1
- package/packages/core/dist/readers.mjs +4 -3
- package/packages/cli/dist/chunk-SWUZRRDT.mjs.map +0 -1
- package/packages/core/dist/chunk-2CCRUI42.mjs.map +0 -1
- package/packages/core/dist/chunk-3SPBELJB.mjs.map +0 -1
- package/packages/core/dist/chunk-L5WLVBW4.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.31.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1327356: Return actionable diagnostics for reversed evaluateTraceContract arguments and warn (without throwing) when inspectRun is passed an unsupported writer option, pointing callers at createInspector({ writer }).
|
|
8
|
+
|
|
3
9
|
## 6.31.9
|
|
4
10
|
|
|
5
11
|
### 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.
|
|
216
|
+
**Current published baseline:** **6.31.10** · 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-inspect",
|
|
3
|
-
"version": "6.31.
|
|
3
|
+
"version": "6.31.10",
|
|
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",
|
|
@@ -4403,6 +4403,17 @@ var PROGRAMMATIC_DIAGNOSTIC_SPECS = Object.freeze({
|
|
|
4403
4403
|
summary: "Trace contains a parentId cycle.",
|
|
4404
4404
|
remediation: "Use visibility-first tree linking for legacy fixtures; prefer acyclic capture for new adapter output.",
|
|
4405
4405
|
relatedCodes: ["structure.cycle"]
|
|
4406
|
+
},
|
|
4407
|
+
AI_TRACE_CONTRACT_INPUT_INVALID: {
|
|
4408
|
+
code: "AI_TRACE_CONTRACT_INPUT_INVALID",
|
|
4409
|
+
summary: "evaluateTraceContract expects ({ read }, contract) or use evaluateTraceContractRead(read, contract).",
|
|
4410
|
+
remediation: "Pass TraceCheckInput as the first argument: evaluateTraceContract({ read }, contract).",
|
|
4411
|
+
relatedCodes: ["AI_CHECK_INVALID_ARGUMENTS"]
|
|
4412
|
+
},
|
|
4413
|
+
AI_INSPECT_RUN_UNSUPPORTED_OPTION: {
|
|
4414
|
+
code: "AI_INSPECT_RUN_UNSUPPORTED_OPTION",
|
|
4415
|
+
summary: 'inspectRun does not accept a "writer" option.',
|
|
4416
|
+
remediation: "Use createInspector({ writer }) then inspector.run(...). inspectRun persists via the global JSONL path (schema 0.1)."
|
|
4406
4417
|
}
|
|
4407
4418
|
});
|
|
4408
4419
|
function formatProgrammaticDiagnostic(code, detail) {
|
|
@@ -7134,7 +7145,72 @@ function defineTraceContract(input) {
|
|
|
7134
7145
|
...alternatives ? { alternatives } : {}
|
|
7135
7146
|
};
|
|
7136
7147
|
}
|
|
7148
|
+
function isTraceReadLike(value) {
|
|
7149
|
+
if (typeof value !== "object" || value === null) return false;
|
|
7150
|
+
const candidate = value;
|
|
7151
|
+
return typeof candidate.format === "string" && Array.isArray(candidate.runs) && Array.isArray(candidate.events);
|
|
7152
|
+
}
|
|
7153
|
+
function isTraceCheckInputLike(value) {
|
|
7154
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
7155
|
+
return false;
|
|
7156
|
+
}
|
|
7157
|
+
return isTraceReadLike(value.read);
|
|
7158
|
+
}
|
|
7159
|
+
function looksLikeTraceContract(value) {
|
|
7160
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
7161
|
+
return false;
|
|
7162
|
+
}
|
|
7163
|
+
if (isTraceReadLike(value) || isTraceCheckInputLike(value)) {
|
|
7164
|
+
return false;
|
|
7165
|
+
}
|
|
7166
|
+
return true;
|
|
7167
|
+
}
|
|
7168
|
+
function invalidContractInputResult() {
|
|
7169
|
+
return {
|
|
7170
|
+
ok: false,
|
|
7171
|
+
status: "error",
|
|
7172
|
+
format: "unknown",
|
|
7173
|
+
summary: {
|
|
7174
|
+
passed: 0,
|
|
7175
|
+
failed: 0,
|
|
7176
|
+
warnings: 0,
|
|
7177
|
+
errors: 1,
|
|
7178
|
+
rulesEvaluated: 0
|
|
7179
|
+
},
|
|
7180
|
+
findings: [],
|
|
7181
|
+
diagnostics: [
|
|
7182
|
+
{
|
|
7183
|
+
code: "AI_CHECK_INVALID_ARGUMENTS",
|
|
7184
|
+
message: formatProgrammaticDiagnostic("AI_TRACE_CONTRACT_INPUT_INVALID"),
|
|
7185
|
+
severity: "error"
|
|
7186
|
+
}
|
|
7187
|
+
],
|
|
7188
|
+
ruleExecutions: []
|
|
7189
|
+
};
|
|
7190
|
+
}
|
|
7191
|
+
function validateEvaluateTraceContractArgs(input, contract) {
|
|
7192
|
+
if (isTraceCheckInputLike(input) && looksLikeTraceContract(contract)) {
|
|
7193
|
+
return void 0;
|
|
7194
|
+
}
|
|
7195
|
+
if (looksLikeTraceContract(input) && (isTraceCheckInputLike(contract) || isTraceReadLike(contract))) {
|
|
7196
|
+
return invalidContractInputResult();
|
|
7197
|
+
}
|
|
7198
|
+
if (isTraceReadLike(input)) {
|
|
7199
|
+
return invalidContractInputResult();
|
|
7200
|
+
}
|
|
7201
|
+
if (!isTraceCheckInputLike(input)) {
|
|
7202
|
+
return invalidContractInputResult();
|
|
7203
|
+
}
|
|
7204
|
+
if (!looksLikeTraceContract(contract)) {
|
|
7205
|
+
return invalidContractInputResult();
|
|
7206
|
+
}
|
|
7207
|
+
return void 0;
|
|
7208
|
+
}
|
|
7137
7209
|
function evaluateTraceContract(input, contract, options = {}) {
|
|
7210
|
+
const inputGuard = validateEvaluateTraceContractArgs(input, contract);
|
|
7211
|
+
if (inputGuard !== void 0) {
|
|
7212
|
+
return inputGuard;
|
|
7213
|
+
}
|
|
7138
7214
|
const shapeErrors = [
|
|
7139
7215
|
...validateAllowedStatusesShape(contract.run?.allowedStatuses),
|
|
7140
7216
|
...validateAlternativesShape(contract.alternatives),
|
|
@@ -15097,5 +15173,5 @@ function renderGateReport(result, options = {}) {
|
|
|
15097
15173
|
}
|
|
15098
15174
|
|
|
15099
15175
|
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 };
|
|
15100
|
-
//# sourceMappingURL=chunk-
|
|
15101
|
-
//# sourceMappingURL=chunk-
|
|
15176
|
+
//# sourceMappingURL=chunk-JCKC4ZRV.mjs.map
|
|
15177
|
+
//# sourceMappingURL=chunk-JCKC4ZRV.mjs.map
|