agent-inspect 6.22.0 → 6.24.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 +12 -0
- package/README.md +1 -1
- package/docs/ADOPTION.md +2 -0
- package/docs/CLI.md +35 -3
- package/docs/TRACE-CONTRACTS.md +56 -0
- package/docs/VSCODE.md +8 -3
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-CHBYF4LE.mjs → chunk-NHVN5AYW.mjs} +21 -2
- package/packages/cli/dist/chunk-NHVN5AYW.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +70 -5
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +28 -8
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-MY5WIBPF.mjs → src-SXWEZTIS.mjs} +3 -3
- package/packages/cli/dist/{src-MY5WIBPF.mjs.map → src-SXWEZTIS.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +20 -0
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +8 -2
- package/packages/core/dist/advanced.d.ts +8 -2
- package/packages/core/dist/advanced.mjs +22 -3
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +726 -50
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +174 -1
- package/packages/core/dist/checks.d.ts +174 -1
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-OG3GAWCX.mjs → chunk-VMDCDWBE.mjs} +680 -7
- package/packages/core/dist/chunk-VMDCDWBE.mjs.map +1 -0
- package/packages/cli/dist/chunk-CHBYF4LE.mjs.map +0 -1
- package/packages/core/dist/chunk-OG3GAWCX.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createSafetyOversizedAttributeRule, resolveTraceDir, parseDuration, buildSessionIndex, resolveBundleRunIds, getTraceFilePath, openTrace, sha256Hex, collectTraceSchemaVersions, aggregateBundleSafeStatus, bundleFailsOnSafety, bundleRunAssetRelativePath, buildPlaceholderArtifact, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceHtmlShell, buildEvidenceProvenanceViewHtml, EVIDENCE_FORMAT_VERSION, inferEvidenceFileRole, buildEvidenceSafetyViewHtml, buildEvidenceDiffViewHtml, buildEvidenceCircuitViewHtml, buildEvidenceOutcomesViewHtml, buildEvidenceContractsViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceCausalFailureViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceTreeViewHtml, buildEvidenceManifest, serializeEvidenceManifest, buildZipArchive, assertBundlePathContained, enrichSessionRunRecord, normalizeBundleOutputPath, sanitizeBundleRunId, defaultBundleOutputPath, runTraceChecks, assertEvidenceRelativePath, TraceDirectory, loadTraceMetadataList, loadSessionRunRecords, TraceReadError, resolveRedactionProfile, applyProfileMetadataCaps, Redactor, flattenTree, escapeHtml, safeString, compactAttributes, stableJson, escapeMarkdown, truncateStringForProfile, extractMetadata, filterTraces, truncateName, buildRunSummary, formatDuration, formatTimestamp, renderErrorLine, isAgentInspectTrace, filterMetasBySessionScope, aggregateSessionCheckResults, createBaselineRegressionRule, summarizeSemanticParity, buildEvidenceCiPackage, verifyEvidenceDirectory, diffTraceEvents, renderRunDiff, buildRunTimeline, renderTimeline, buildTraceStats, renderTraceStats, parseDurationFilter, searchTraces, formatStepLabel, buildActivitySummary, renderActivitySummaryHuman, buildRunWhatSummary, renderRunWhat, buildLocalExplanation, resolveSuiteTemplate, defaultSuiteConfigTemplate, loadSuiteConfig, validateSuiteConfig, runSuite, renderSuiteReport, analyzeCohort, renderCohortReport, gateHasThresholds, runGate, renderGateReport, persistedInspectEventsToTraceEvents, renderStepLine, getIndent, TreeBuilder, zeroKinds, validateEvent, traceEventToPersistedInspectEvent, isPersistedInspectEvent, createRunStatusRule, createStructureOrphanRule, createStructureCycleRule, createRunDurationRule, createMaxStepDurationRule, createRequireCompletedRule, createStallDetectionRule, createObservedOutcomeRule, createRunDepthRule, createToolUsageRule, createLlmUsageRule, createStructureRelationshipRule, createStructureParallelWidthRule, summarizeObservedOutcomes, extractOutcomesFromTraceEvents, renderObservedOutcomesMarkdown, renderObservedOutcomesHtml, DEFAULT_SUITE_ARTIFACTS_DIR, parseCohortMetricList, COHORT_METRIC_IDS, parseGateList, nanoid, diffRuns, manualTraceEventsToComparableRun } from './chunk-
|
|
2
|
+
import { createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createSafetyOversizedAttributeRule, resolveTraceDir, parseDuration, buildSessionIndex, resolveBundleRunIds, getTraceFilePath, openTrace, sha256Hex, collectTraceSchemaVersions, aggregateBundleSafeStatus, bundleFailsOnSafety, bundleRunAssetRelativePath, buildPlaceholderArtifact, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceHtmlShell, buildEvidenceProvenanceViewHtml, EVIDENCE_FORMAT_VERSION, inferEvidenceFileRole, buildEvidenceSafetyViewHtml, buildEvidenceDiffViewHtml, buildEvidenceCircuitViewHtml, buildEvidenceOutcomesViewHtml, buildEvidenceContractsViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceCausalFailureViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceTreeViewHtml, buildEvidenceManifest, serializeEvidenceManifest, buildZipArchive, assertBundlePathContained, enrichSessionRunRecord, normalizeBundleOutputPath, sanitizeBundleRunId, defaultBundleOutputPath, runTraceChecks, assertEvidenceRelativePath, TraceDirectory, loadTraceMetadataList, loadSessionRunRecords, TraceReadError, resolveRedactionProfile, applyProfileMetadataCaps, Redactor, flattenTree, escapeHtml, safeString, compactAttributes, stableJson, escapeMarkdown, truncateStringForProfile, extractMetadata, filterTraces, truncateName, buildRunSummary, formatDuration, formatTimestamp, renderErrorLine, isAgentInspectTrace, filterMetasBySessionScope, aggregateSessionCheckResults, createBaselineRegressionRule, summarizeSemanticParity, buildEvidenceCiPackage, verifyEvidenceDirectory, diffTraceEvents, renderRunDiff, buildRunTimeline, renderTimeline, buildTraceStats, renderTraceStats, parseDurationFilter, searchTraces, formatStepLabel, buildActivitySummary, renderActivitySummaryHuman, buildRunWhatSummary, renderRunWhat, buildLocalExplanation, resolveSuiteTemplate, defaultSuiteConfigTemplate, loadSuiteConfig, validateSuiteConfig, runSuite, renderSuiteReport, analyzeCohort, renderCohortReport, gateHasThresholds, runGate, renderGateReport, persistedInspectEventsToTraceEvents, renderStepLine, getIndent, TreeBuilder, zeroKinds, validateEvent, traceEventToPersistedInspectEvent, isPersistedInspectEvent, createRunStatusRule, createStructureOrphanRule, createStructureCycleRule, createRunDurationRule, createMaxStepDurationRule, createRequireCompletedRule, createStallDetectionRule, createObservedOutcomeRule, createRunDepthRule, createToolUsageRule, createLlmUsageRule, createStructureRelationshipRule, createStructureParallelWidthRule, summarizeObservedOutcomes, extractOutcomesFromTraceEvents, renderObservedOutcomesMarkdown, renderObservedOutcomesHtml, DEFAULT_SUITE_ARTIFACTS_DIR, parseCohortMetricList, COHORT_METRIC_IDS, parseGateList, nanoid, diffRuns, manualTraceEventsToComparableRun } from './chunk-NHVN5AYW.mjs';
|
|
3
3
|
import { realpathSync, constants as constants$1, existsSync, readFileSync } from 'fs';
|
|
4
4
|
import path19 from 'path';
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
@@ -13,7 +13,7 @@ import { createServer } from 'http';
|
|
|
13
13
|
import { createRequire } from 'module';
|
|
14
14
|
|
|
15
15
|
// package.json
|
|
16
|
-
var version = "6.
|
|
16
|
+
var version = "6.24.0";
|
|
17
17
|
|
|
18
18
|
// packages/cli/src/trace-dir-scale.ts
|
|
19
19
|
var TRACE_COUNT_WARN = 1e3;
|
|
@@ -3397,7 +3397,7 @@ async function newestTraceMtimeMs(traceDir) {
|
|
|
3397
3397
|
}
|
|
3398
3398
|
async function loadSessionRuns(traceDir) {
|
|
3399
3399
|
try {
|
|
3400
|
-
const mod = await import('./src-
|
|
3400
|
+
const mod = await import('./src-SXWEZTIS.mjs');
|
|
3401
3401
|
const dbPath = mod.resolveIndexDbPath(traceDir);
|
|
3402
3402
|
const status = mod.indexStatus(dbPath);
|
|
3403
3403
|
if (!status.healthy) {
|
|
@@ -11070,11 +11070,14 @@ var TRACE_DIR = ".agent-inspect";
|
|
|
11070
11070
|
var GITKEEP = ".agent-inspect/.gitkeep";
|
|
11071
11071
|
function normalizeFramework(value) {
|
|
11072
11072
|
const raw = (value ?? "custom").trim();
|
|
11073
|
+
if (raw === "observe" || raw === "manual") {
|
|
11074
|
+
return "custom";
|
|
11075
|
+
}
|
|
11073
11076
|
if (raw === "ai-sdk" || raw === "openai-agents" || raw === "langchain" || raw === "langgraph" || raw === "custom") {
|
|
11074
11077
|
return raw;
|
|
11075
11078
|
}
|
|
11076
11079
|
throw new Error(
|
|
11077
|
-
"Unsupported --framework value. Use ai-sdk, openai-agents, langchain, langgraph, or
|
|
11080
|
+
"Unsupported --framework value. Use ai-sdk, openai-agents, langchain, langgraph, custom, observe, or manual."
|
|
11078
11081
|
);
|
|
11079
11082
|
}
|
|
11080
11083
|
function configTemplate(framework) {
|
|
@@ -12060,7 +12063,7 @@ function isModuleNotFound4(e) {
|
|
|
12060
12063
|
}
|
|
12061
12064
|
async function loadIndexSqlite() {
|
|
12062
12065
|
try {
|
|
12063
|
-
return await import('./src-
|
|
12066
|
+
return await import('./src-SXWEZTIS.mjs');
|
|
12064
12067
|
} catch (e) {
|
|
12065
12068
|
if (isModuleNotFound4(e)) {
|
|
12066
12069
|
console.error(
|
|
@@ -12639,7 +12642,15 @@ async function cohortCommand(options = {}) {
|
|
|
12639
12642
|
process.exitCode = 1;
|
|
12640
12643
|
}
|
|
12641
12644
|
}
|
|
12642
|
-
var SUPPORTED_FORMATS = /* @__PURE__ */ new Set([
|
|
12645
|
+
var SUPPORTED_FORMATS = /* @__PURE__ */ new Set([
|
|
12646
|
+
"markdown",
|
|
12647
|
+
"json",
|
|
12648
|
+
"json-compact",
|
|
12649
|
+
"html",
|
|
12650
|
+
"junit",
|
|
12651
|
+
"github",
|
|
12652
|
+
"github-annotations"
|
|
12653
|
+
]);
|
|
12643
12654
|
function collectList(value) {
|
|
12644
12655
|
if (value === void 0) return [];
|
|
12645
12656
|
const items = Array.isArray(value) ? value : [value];
|
|
@@ -12674,7 +12685,8 @@ async function writeArtifacts2(result, outputDir) {
|
|
|
12674
12685
|
markdownPath: path19.join(outputDir, "gate-summary.md"),
|
|
12675
12686
|
htmlPath: path19.join(outputDir, "gate-report.html"),
|
|
12676
12687
|
junitPath: path19.join(outputDir, "junit.xml"),
|
|
12677
|
-
githubPath: path19.join(outputDir, "github-step-summary.md")
|
|
12688
|
+
githubPath: path19.join(outputDir, "github-step-summary.md"),
|
|
12689
|
+
annotationsPath: path19.join(outputDir, "github-annotations.txt")
|
|
12678
12690
|
};
|
|
12679
12691
|
await writeFile(
|
|
12680
12692
|
paths.jsonPath,
|
|
@@ -12703,6 +12715,12 @@ async function writeArtifacts2(result, outputDir) {
|
|
|
12703
12715
|
await writeFile(
|
|
12704
12716
|
paths.githubPath,
|
|
12705
12717
|
`${renderGateReport(result, { format: "github" })}
|
|
12718
|
+
`,
|
|
12719
|
+
"utf-8"
|
|
12720
|
+
);
|
|
12721
|
+
await writeFile(
|
|
12722
|
+
paths.annotationsPath,
|
|
12723
|
+
`${renderGateReport(result, { format: "github-annotations" })}
|
|
12706
12724
|
`,
|
|
12707
12725
|
"utf-8"
|
|
12708
12726
|
);
|
|
@@ -13253,7 +13271,9 @@ function createCliProgram() {
|
|
|
13253
13271
|
"openai-agents",
|
|
13254
13272
|
"langchain",
|
|
13255
13273
|
"langgraph",
|
|
13256
|
-
"custom"
|
|
13274
|
+
"custom",
|
|
13275
|
+
"observe",
|
|
13276
|
+
"manual"
|
|
13257
13277
|
])
|
|
13258
13278
|
).addOption(new Option("--ci <provider>", "optional CI snippet").choices(["github"])).option("--dry-run", "print planned files without writing").option("--yes", "non-interactive; skip existing files").option("--json", "print deterministic JSON plan/result").action((opts) => {
|
|
13259
13279
|
runCommand(() => initCommand(opts));
|