agent-inspect 5.2.0 → 5.4.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/docs/CLI.md +28 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-SJ5R2XBE.mjs → chunk-YS2I722C.mjs} +112 -3
- package/packages/cli/dist/chunk-YS2I722C.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +2487 -2163
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +2313 -2112
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-PK22BBMH.mjs → src-FVNE44UA.mjs} +3 -3
- package/packages/cli/dist/{src-PK22BBMH.mjs.map → src-FVNE44UA.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +118 -0
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +14 -4
- package/packages/core/dist/advanced.d.ts +14 -4
- package/packages/core/dist/advanced.mjs +114 -1
- package/packages/core/dist/advanced.mjs.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/{context-Cp8NRbBX.d.ts → context-BJ5UQLDi.d.ts} +1 -1
- package/packages/core/dist/{context-BbfkMYjz.d.cts → context-DyKbkmd4.d.cts} +1 -1
- package/packages/core/dist/index.d.cts +2 -2
- package/packages/core/dist/index.d.ts +2 -2
- package/packages/core/dist/{types-CvsKGweN.d.cts → types-J3Xtuf9x.d.cts} +13 -1
- package/packages/core/dist/{types-CvsKGweN.d.ts → types-J3Xtuf9x.d.ts} +13 -1
- package/packages/cli/dist/chunk-SJ5R2XBE.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 31d5324: Add PM/QA suite templates and `suite init --template` for eight common agent scenarios.
|
|
8
|
+
|
|
9
|
+
## 5.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 165b1dc: Add suite and workspace viewer modes with `agent-inspect viewer --suite` and `--workspace` for local read-only evidence inspection.
|
|
14
|
+
|
|
3
15
|
## 5.2.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/docs/CLI.md
CHANGED
|
@@ -901,7 +901,7 @@ Recipe: [shareable-bundle-basic](../examples/recipes/shareable-bundle-basic/READ
|
|
|
901
901
|
Define and run **local trace suites** for CI trajectory checks (v5.0+). Suites read existing traces only — no agent replay, no model calls, no upload.
|
|
902
902
|
|
|
903
903
|
```bash
|
|
904
|
-
agent-inspect suite init
|
|
904
|
+
agent-inspect suite init [--template <name>]
|
|
905
905
|
agent-inspect suite validate [--config path]
|
|
906
906
|
agent-inspect suite list [--config path]
|
|
907
907
|
agent-inspect suite run [--config path] [--json] [--markdown] [-o dir]
|
|
@@ -914,6 +914,10 @@ Options (shared):
|
|
|
914
914
|
|
|
915
915
|
- `--config <path>` — suite config (`.json`, `.js`, `.mjs`, `.cjs`)
|
|
916
916
|
|
|
917
|
+
`init` also supports:
|
|
918
|
+
|
|
919
|
+
- `--template <name>` — PM/QA template (v5.4+): `customer-support-agent`, `refund-agent`, `sales-assistant`, `browser-task-agent`, `mcp-tool-agent`, `workflow-agent`, `rag-answer-agent`, `human-approval-agent`
|
|
920
|
+
|
|
917
921
|
`run` also supports:
|
|
918
922
|
|
|
919
923
|
- `-o, --output <dir>` — write JSON run artifact (default: `.agent-inspect/suite-runs`)
|
|
@@ -995,6 +999,29 @@ npx agent-inspect gate --dir fixtures/cohorts/before-after --max-error-rate 5 --
|
|
|
995
999
|
|
|
996
1000
|
Recipe: [github-actions-gate](../examples/recipes/github-actions-gate/README.md).
|
|
997
1001
|
|
|
1002
|
+
### 6.28 `viewer`
|
|
1003
|
+
|
|
1004
|
+
Start the **localhost read-only viewer** for traces, suite evidence, or workspace status (v5.3+).
|
|
1005
|
+
|
|
1006
|
+
```bash
|
|
1007
|
+
agent-inspect viewer [--suite | --workspace] [options]
|
|
1008
|
+
```
|
|
1009
|
+
|
|
1010
|
+
Options:
|
|
1011
|
+
|
|
1012
|
+
- `--suite` — suite evidence mode (runs suite config and shows case status, failures, observations)
|
|
1013
|
+
- `--workspace` — workspace mode (project status, runs, artifacts)
|
|
1014
|
+
- `--config <path>` — suite config for `--suite` mode
|
|
1015
|
+
- `--dir <path>` — trace directory (trace mode default)
|
|
1016
|
+
- `--host`, `--port`, `--open` — same as `serve`
|
|
1017
|
+
|
|
1018
|
+
Example:
|
|
1019
|
+
|
|
1020
|
+
```bash
|
|
1021
|
+
npx agent-inspect viewer --suite --config fixtures/configs/outcome-suite.suite.json
|
|
1022
|
+
npx agent-inspect viewer --workspace
|
|
1023
|
+
```
|
|
1024
|
+
|
|
998
1025
|
## 7. Optional TUI behavior
|
|
999
1026
|
|
|
1000
1027
|
`view --tui` delegates to `@agent-inspect/tui` and requires an interactive terminal. If the package is not installed, the CLI prints a short install hint.
|
package/package.json
CHANGED
|
@@ -7876,6 +7876,115 @@ function renderSuiteReport(result, options = {}) {
|
|
|
7876
7876
|
return renderSuiteReportMarkdown(result);
|
|
7877
7877
|
}
|
|
7878
7878
|
|
|
7879
|
+
// packages/core/src/suite/templates.ts
|
|
7880
|
+
var SUITE_TEMPLATE_IDS = [
|
|
7881
|
+
"customer-support-agent",
|
|
7882
|
+
"refund-agent",
|
|
7883
|
+
"sales-assistant",
|
|
7884
|
+
"browser-task-agent",
|
|
7885
|
+
"mcp-tool-agent",
|
|
7886
|
+
"workflow-agent",
|
|
7887
|
+
"rag-answer-agent",
|
|
7888
|
+
"human-approval-agent"
|
|
7889
|
+
];
|
|
7890
|
+
function baseTemplate(name, cases) {
|
|
7891
|
+
return {
|
|
7892
|
+
name,
|
|
7893
|
+
traces: "./.agent-inspect",
|
|
7894
|
+
cases,
|
|
7895
|
+
checks: {
|
|
7896
|
+
select: ["run.status", "outcome.status"],
|
|
7897
|
+
run: { maxDurationMs: 6e4 }
|
|
7898
|
+
},
|
|
7899
|
+
redactionProfile: "local",
|
|
7900
|
+
artifacts: { outputDir: ".agent-inspect/suite-runs" }
|
|
7901
|
+
};
|
|
7902
|
+
}
|
|
7903
|
+
var TEMPLATES = {
|
|
7904
|
+
"customer-support-agent": baseTemplate("customer-support-agent", [
|
|
7905
|
+
{
|
|
7906
|
+
id: "support-ticket",
|
|
7907
|
+
runId: "support-ticket",
|
|
7908
|
+
requireTools: ["searchDocs"],
|
|
7909
|
+
forbidTools: ["deleteAccount"],
|
|
7910
|
+
expectedObservations: ["answerReady"],
|
|
7911
|
+
maxDurationMs: 45e3
|
|
7912
|
+
}
|
|
7913
|
+
]),
|
|
7914
|
+
"refund-agent": baseTemplate("refund-agent", [
|
|
7915
|
+
{
|
|
7916
|
+
id: "refund-flow",
|
|
7917
|
+
runId: "refund-flow",
|
|
7918
|
+
requireTools: ["searchDocs"],
|
|
7919
|
+
forbidTools: ["deleteAccount"],
|
|
7920
|
+
expectedObservations: ["policyShown"],
|
|
7921
|
+
maxDurationMs: 3e4
|
|
7922
|
+
}
|
|
7923
|
+
]),
|
|
7924
|
+
"sales-assistant": baseTemplate("sales-assistant", [
|
|
7925
|
+
{
|
|
7926
|
+
id: "quote-request",
|
|
7927
|
+
runId: "quote-request",
|
|
7928
|
+
requireTools: ["lookupPricing"],
|
|
7929
|
+
maxDurationMs: 3e4
|
|
7930
|
+
}
|
|
7931
|
+
]),
|
|
7932
|
+
"browser-task-agent": baseTemplate("browser-task-agent", [
|
|
7933
|
+
{
|
|
7934
|
+
id: "browser-nav",
|
|
7935
|
+
runId: "browser-nav",
|
|
7936
|
+
requireTools: ["browserNavigate"],
|
|
7937
|
+
maxDurationMs: 12e4
|
|
7938
|
+
}
|
|
7939
|
+
]),
|
|
7940
|
+
"mcp-tool-agent": baseTemplate("mcp-tool-agent", [
|
|
7941
|
+
{
|
|
7942
|
+
id: "mcp-call",
|
|
7943
|
+
runId: "mcp-call",
|
|
7944
|
+
requireTools: ["mcp:tools/list"],
|
|
7945
|
+
maxDurationMs: 3e4
|
|
7946
|
+
}
|
|
7947
|
+
]),
|
|
7948
|
+
"workflow-agent": baseTemplate("workflow-agent", [
|
|
7949
|
+
{
|
|
7950
|
+
id: "workflow-handoff",
|
|
7951
|
+
runId: "workflow-handoff",
|
|
7952
|
+
requireTools: ["handoff"],
|
|
7953
|
+
maxDurationMs: 6e4
|
|
7954
|
+
}
|
|
7955
|
+
]),
|
|
7956
|
+
"rag-answer-agent": baseTemplate("rag-answer-agent", [
|
|
7957
|
+
{
|
|
7958
|
+
id: "rag-answer",
|
|
7959
|
+
runId: "rag-answer",
|
|
7960
|
+
requireTools: ["retrieve", "answer"],
|
|
7961
|
+
expectedObservations: ["citationShown"],
|
|
7962
|
+
maxDurationMs: 45e3
|
|
7963
|
+
}
|
|
7964
|
+
]),
|
|
7965
|
+
"human-approval-agent": baseTemplate("human-approval-agent", [
|
|
7966
|
+
{
|
|
7967
|
+
id: "approval-gate",
|
|
7968
|
+
runId: "approval-gate",
|
|
7969
|
+
expectedObservations: ["approvalRequested", "approvalGranted"],
|
|
7970
|
+
maxDurationMs: 6e4
|
|
7971
|
+
}
|
|
7972
|
+
])
|
|
7973
|
+
};
|
|
7974
|
+
function getSuiteTemplate(id) {
|
|
7975
|
+
if (!SUITE_TEMPLATE_IDS.includes(id)) return void 0;
|
|
7976
|
+
return structuredClone(TEMPLATES[id]);
|
|
7977
|
+
}
|
|
7978
|
+
function resolveSuiteTemplate(id) {
|
|
7979
|
+
const template = getSuiteTemplate(id);
|
|
7980
|
+
if (template === void 0) {
|
|
7981
|
+
throw new Error(
|
|
7982
|
+
`Unknown suite template "${id}". Available: ${SUITE_TEMPLATE_IDS.join(", ")}`
|
|
7983
|
+
);
|
|
7984
|
+
}
|
|
7985
|
+
return template;
|
|
7986
|
+
}
|
|
7987
|
+
|
|
7879
7988
|
// packages/core/src/cohort/types.ts
|
|
7880
7989
|
var COHORT_METRIC_IDS = [
|
|
7881
7990
|
"errorRate",
|
|
@@ -8888,6 +8997,6 @@ function renderGateReport(result, options = {}) {
|
|
|
8888
8997
|
return renderGateSummaryMarkdown(result);
|
|
8889
8998
|
}
|
|
8890
8999
|
|
|
8891
|
-
export { COHORT_METRIC_IDS, DEFAULT_SUITE_ARTIFACTS_DIR, Redactor, TraceDirectory, TraceReadError, TreeBuilder, __commonJS, __require, __toESM, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, applyProfileMetadataCaps, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, bundleFailsOnSafety, compactAttributes3 as compactAttributes, createBaselineRegressionRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRunDepthRule, createRunDurationRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStructureCycleRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolUsageRule, defaultBundleOutputPath, defaultSuiteConfigTemplate, enrichSessionRunRecord, escapeHtml, escapeMarkdown, extractMetadata, extractOutcomesFromTraceEvents, filterMetasBySessionScope, filterTraces, flattenTree, formatDuration2 as formatDuration, formatTimestamp, gateHasThresholds, getIndent, getTraceFilePath, isAgentInspectTrace, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToTraceEvents, renderActivitySummaryHuman, renderCohortReport, renderErrorLine, renderGateReport, renderObservedOutcomesHtml, renderObservedOutcomesMarkdown, renderRunWhat, renderStepLine, renderSuiteReport, renderTimeline, renderTraceStats, resolveBundleRunIds, resolveRedactionProfile, resolveTraceDir, runGate, runSuite, runTraceChecks, safeString, searchTraces, source_default, stableJson, summarizeObservedOutcomes, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, zeroKinds };
|
|
8892
|
-
//# sourceMappingURL=chunk-
|
|
8893
|
-
//# sourceMappingURL=chunk-
|
|
9000
|
+
export { COHORT_METRIC_IDS, DEFAULT_SUITE_ARTIFACTS_DIR, Redactor, TraceDirectory, TraceReadError, TreeBuilder, __commonJS, __require, __toESM, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, applyProfileMetadataCaps, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, bundleFailsOnSafety, compactAttributes3 as compactAttributes, createBaselineRegressionRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRunDepthRule, createRunDurationRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStructureCycleRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolUsageRule, defaultBundleOutputPath, defaultSuiteConfigTemplate, enrichSessionRunRecord, escapeHtml, escapeMarkdown, extractMetadata, extractOutcomesFromTraceEvents, filterMetasBySessionScope, filterTraces, flattenTree, formatDuration2 as formatDuration, formatTimestamp, gateHasThresholds, getIndent, getTraceFilePath, isAgentInspectTrace, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToTraceEvents, renderActivitySummaryHuman, renderCohortReport, renderErrorLine, renderGateReport, renderObservedOutcomesHtml, renderObservedOutcomesMarkdown, renderRunWhat, renderStepLine, renderSuiteReport, renderTimeline, renderTraceStats, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteTemplate, resolveTraceDir, runGate, runSuite, runTraceChecks, safeString, searchTraces, source_default, stableJson, summarizeObservedOutcomes, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, zeroKinds };
|
|
9001
|
+
//# sourceMappingURL=chunk-YS2I722C.mjs.map
|
|
9002
|
+
//# sourceMappingURL=chunk-YS2I722C.mjs.map
|