agent-inspect 4.3.0 → 4.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 +6 -0
- package/docs/API.md +3 -0
- package/docs/CLI.md +3 -0
- package/docs/SCHEMA.md +27 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-BS5LSKZ3.mjs → chunk-ORHDQUT6.mjs} +198 -7
- package/packages/cli/dist/chunk-ORHDQUT6.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +409 -17
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +176 -10
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-YFMPWEIS.mjs → src-FJOHPC4X.mjs} +3 -3
- package/packages/cli/dist/{src-YFMPWEIS.mjs.map → src-FJOHPC4X.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +201 -9
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +12 -8
- package/packages/core/dist/advanced.d.ts +12 -8
- package/packages/core/dist/advanced.mjs +30 -13
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +117 -18
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +11 -3
- package/packages/core/dist/checks.d.ts +11 -3
- package/packages/core/dist/checks.mjs +42 -1
- package/packages/core/dist/checks.mjs.map +1 -1
- package/packages/core/dist/{chunk-2ZXEMWGK.mjs → chunk-3USJVBLA.mjs} +3 -3
- package/packages/core/dist/{chunk-2ZXEMWGK.mjs.map → chunk-3USJVBLA.mjs.map} +1 -1
- package/packages/core/dist/{chunk-HY7H3CQM.mjs → chunk-CAWPF22J.mjs} +4 -3
- package/packages/core/dist/chunk-CAWPF22J.mjs.map +1 -0
- package/packages/core/dist/{chunk-XUNJMAPD.mjs → chunk-KNYL56KZ.mjs} +38 -3
- package/packages/core/dist/chunk-KNYL56KZ.mjs.map +1 -0
- package/packages/core/dist/{chunk-IZBJAZGF.mjs → chunk-P366CCL2.mjs} +34 -3
- package/packages/core/dist/chunk-P366CCL2.mjs.map +1 -0
- package/packages/core/dist/{chunk-4JVGFNQH.mjs → chunk-ULCGIRTC.mjs} +95 -8
- package/packages/core/dist/chunk-ULCGIRTC.mjs.map +1 -0
- package/packages/core/dist/chunk-VFO76UH3.mjs +228 -0
- package/packages/core/dist/chunk-VFO76UH3.mjs.map +1 -0
- package/packages/core/dist/{chunk-NQZPZ2FN.mjs → chunk-WRE4CNPF.mjs} +6 -3
- package/packages/core/dist/chunk-WRE4CNPF.mjs.map +1 -0
- package/packages/core/dist/{chunk-A4V2H3YU.mjs → chunk-ZWA5RWMV.mjs} +40 -4
- package/packages/core/dist/chunk-ZWA5RWMV.mjs.map +1 -0
- package/packages/core/dist/{context-DjY-jvQk.d.cts → context-BbfkMYjz.d.cts} +5 -3
- package/packages/core/dist/{context-BDZmi53V.d.ts → context-Cp8NRbBX.d.ts} +5 -3
- package/packages/core/dist/diff.cjs.map +1 -1
- package/packages/core/dist/diff.d.cts +3 -3
- package/packages/core/dist/diff.d.ts +3 -3
- package/packages/core/dist/diff.mjs +1 -1
- package/packages/core/dist/exporters.cjs +137 -1
- package/packages/core/dist/exporters.cjs.map +1 -1
- package/packages/core/dist/exporters.d.cts +6 -3
- package/packages/core/dist/exporters.d.ts +6 -3
- package/packages/core/dist/exporters.mjs +71 -6
- package/packages/core/dist/exporters.mjs.map +1 -1
- package/packages/core/dist/index.cjs +181 -6
- package/packages/core/dist/index.cjs.map +1 -1
- package/packages/core/dist/index.d.cts +14 -7
- package/packages/core/dist/index.d.ts +14 -7
- package/packages/core/dist/index.mjs +51 -7
- package/packages/core/dist/index.mjs.map +1 -1
- package/packages/core/dist/{inspect-event-CYAV7Hxm.d.cts → inspect-event-IqwOHbGo.d.cts} +1 -1
- package/packages/core/dist/{inspect-event-CYAV7Hxm.d.ts → inspect-event-IqwOHbGo.d.ts} +1 -1
- package/packages/core/dist/{log-config-BNQ9UTmP.d.cts → log-config-CW8w5YQ9.d.cts} +1 -1
- package/packages/core/dist/{log-config-D3Yp1SZN.d.ts → log-config-SRA4xTp8.d.ts} +1 -1
- package/packages/core/dist/logs.d.cts +3 -3
- package/packages/core/dist/logs.d.ts +3 -3
- package/packages/core/dist/{persisted-inspect-event-BLvb0jSX.d.ts → persisted-inspect-event-DruwqARZ.d.ts} +1 -1
- package/packages/core/dist/{persisted-inspect-event-D5SjBz9b.d.cts → persisted-inspect-event-Gd-W8vB7.d.cts} +1 -1
- package/packages/core/dist/persisted.cjs +67 -1
- package/packages/core/dist/persisted.cjs.map +1 -1
- package/packages/core/dist/persisted.d.cts +5 -5
- package/packages/core/dist/persisted.d.ts +5 -5
- package/packages/core/dist/persisted.mjs +3 -3
- package/packages/core/dist/readers.cjs +72 -3
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.d.cts +2 -2
- package/packages/core/dist/readers.d.ts +2 -2
- package/packages/core/dist/readers.mjs +5 -5
- package/packages/core/dist/readers.mjs.map +1 -1
- package/packages/core/dist/{types-CQun9LW6.d.ts → types-B1X87dUW.d.cts} +16 -2
- package/packages/core/dist/{types-C-llnPH0.d.cts → types-BVkjSd0q.d.ts} +16 -2
- package/packages/core/dist/types-CvsKGweN.d.cts +12 -0
- package/packages/core/dist/types-CvsKGweN.d.ts +12 -0
- package/packages/core/dist/writers.cjs +2 -1
- package/packages/core/dist/writers.cjs.map +1 -1
- package/packages/core/dist/writers.d.cts +2 -2
- package/packages/core/dist/writers.d.ts +2 -2
- package/packages/core/dist/writers.mjs +3 -4
- package/packages/core/dist/writers.mjs.map +1 -1
- package/packages/cli/dist/chunk-BS5LSKZ3.mjs.map +0 -1
- package/packages/core/dist/chunk-4JVGFNQH.mjs.map +0 -1
- package/packages/core/dist/chunk-A4V2H3YU.mjs.map +0 -1
- package/packages/core/dist/chunk-EDTQHZPM.mjs +0 -88
- package/packages/core/dist/chunk-EDTQHZPM.mjs.map +0 -1
- package/packages/core/dist/chunk-HY7H3CQM.mjs.map +0 -1
- package/packages/core/dist/chunk-IZBJAZGF.mjs.map +0 -1
- package/packages/core/dist/chunk-NQZPZ2FN.mjs.map +0 -1
- package/packages/core/dist/chunk-XUNJMAPD.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as InspectRunTree, c as InspectNode } from './inspect-event-
|
|
2
|
-
import { R as RedactionProfile, h as TraceEvent } from './types-
|
|
3
|
-
import './log-config-
|
|
1
|
+
import { b as InspectRunTree, c as InspectNode } from './inspect-event-IqwOHbGo.cjs';
|
|
2
|
+
import { R as RedactionProfile, h as TraceEvent } from './types-B1X87dUW.cjs';
|
|
3
|
+
import './log-config-CW8w5YQ9.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* v0.7 local export formats. No sinks — string output only.
|
|
@@ -112,6 +112,7 @@ declare function exportRunTree(tree: InspectRunTree, options: ExportOptions): Ex
|
|
|
112
112
|
declare function validateExport(result: ExportResult): ExportValidationResult;
|
|
113
113
|
|
|
114
114
|
type ReportFormat = "markdown" | "html";
|
|
115
|
+
type ReportSection = "all" | "observations" | "what" | "timeline" | "tree";
|
|
115
116
|
interface ReportOptions {
|
|
116
117
|
format: ReportFormat;
|
|
117
118
|
includeAttributes?: boolean;
|
|
@@ -119,6 +120,8 @@ interface ReportOptions {
|
|
|
119
120
|
redactionProfile?: RedactionProfile;
|
|
120
121
|
/** Include correlation ids in the what section (default true). */
|
|
121
122
|
correlation?: boolean;
|
|
123
|
+
/** Limit output to one section (`observations` shows observed outcomes only). */
|
|
124
|
+
section?: ReportSection;
|
|
122
125
|
}
|
|
123
126
|
interface ReportResult {
|
|
124
127
|
format: ReportFormat;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as InspectRunTree, c as InspectNode } from './inspect-event-
|
|
2
|
-
import { R as RedactionProfile, h as TraceEvent } from './types-
|
|
3
|
-
import './log-config-
|
|
1
|
+
import { b as InspectRunTree, c as InspectNode } from './inspect-event-IqwOHbGo.js';
|
|
2
|
+
import { R as RedactionProfile, h as TraceEvent } from './types-BVkjSd0q.js';
|
|
3
|
+
import './log-config-SRA4xTp8.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* v0.7 local export formats. No sinks — string output only.
|
|
@@ -112,6 +112,7 @@ declare function exportRunTree(tree: InspectRunTree, options: ExportOptions): Ex
|
|
|
112
112
|
declare function validateExport(result: ExportResult): ExportValidationResult;
|
|
113
113
|
|
|
114
114
|
type ReportFormat = "markdown" | "html";
|
|
115
|
+
type ReportSection = "all" | "observations" | "what" | "timeline" | "tree";
|
|
115
116
|
interface ReportOptions {
|
|
116
117
|
format: ReportFormat;
|
|
117
118
|
includeAttributes?: boolean;
|
|
@@ -119,6 +120,8 @@ interface ReportOptions {
|
|
|
119
120
|
redactionProfile?: RedactionProfile;
|
|
120
121
|
/** Include correlation ids in the what section (default true). */
|
|
121
122
|
correlation?: boolean;
|
|
123
|
+
/** Limit output to one section (`observations` shows observed outcomes only). */
|
|
124
|
+
section?: ReportSection;
|
|
122
125
|
}
|
|
123
126
|
interface ReportResult {
|
|
124
127
|
format: ReportFormat;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { buildRunWhatSummary, renderRunWhat, renderTimeline, buildRunTimeline } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { buildRunWhatSummary, renderRunWhat, renderTimeline, buildRunTimeline } from './chunk-3USJVBLA.mjs';
|
|
2
|
+
import { summarizeObservedOutcomes, extractOutcomesFromTraceEvents, renderObservedOutcomesMarkdown, renderObservedOutcomesHtml } from './chunk-VFO76UH3.mjs';
|
|
3
|
+
import { escapeHtml, flattenTree, safeString, compactAttributes, stableJson, escapeMarkdown, zeroKinds } from './chunk-CAWPF22J.mjs';
|
|
4
|
+
export { compactAttributes, escapeHtml, escapeMarkdown, flattenTree, safeString, stableJson, summarizeTree } from './chunk-CAWPF22J.mjs';
|
|
5
|
+
import { resolveRedactionProfile, applyProfileMetadataCaps, truncateStringForProfile } from './chunk-ULCGIRTC.mjs';
|
|
5
6
|
import { Redactor } from './chunk-VU6O5QAH.mjs';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-WRE4CNPF.mjs';
|
|
8
|
+
import './chunk-P366CCL2.mjs';
|
|
8
9
|
import './chunk-7TGZLWEE.mjs';
|
|
9
10
|
import crypto from 'crypto';
|
|
10
11
|
|
|
@@ -187,6 +188,40 @@ function redactTraceEventsForReport(events, options) {
|
|
|
187
188
|
)
|
|
188
189
|
} : {}
|
|
189
190
|
};
|
|
191
|
+
case "outcome_observed": {
|
|
192
|
+
const actualAttrs = event.actual !== void 0 ? redactEventAttributes(
|
|
193
|
+
{ value: event.actual },
|
|
194
|
+
redactor,
|
|
195
|
+
maxMetadataValueLength,
|
|
196
|
+
maxPreviewLength
|
|
197
|
+
) : void 0;
|
|
198
|
+
const redactedActual = actualAttrs !== void 0 && "value" in actualAttrs ? actualAttrs.value : void 0;
|
|
199
|
+
const redactedEvidence = event.evidence !== void 0 ? redactEventAttributes(
|
|
200
|
+
isRecord(event.evidence) ? event.evidence : { value: event.evidence },
|
|
201
|
+
redactor,
|
|
202
|
+
maxMetadataValueLength,
|
|
203
|
+
maxPreviewLength
|
|
204
|
+
) : void 0;
|
|
205
|
+
return {
|
|
206
|
+
...event,
|
|
207
|
+
name: truncateStringForProfile(
|
|
208
|
+
event.name,
|
|
209
|
+
"name",
|
|
210
|
+
maxMetadataValueLength,
|
|
211
|
+
maxPreviewLength
|
|
212
|
+
),
|
|
213
|
+
expectation: truncateStringForProfile(
|
|
214
|
+
event.expectation,
|
|
215
|
+
"expectation",
|
|
216
|
+
maxMetadataValueLength,
|
|
217
|
+
maxPreviewLength
|
|
218
|
+
),
|
|
219
|
+
...redactedActual !== void 0 ? { actual: redactedActual } : {},
|
|
220
|
+
...redactedEvidence !== void 0 ? { evidence: redactedEvidence } : {}
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
default:
|
|
224
|
+
return event;
|
|
190
225
|
}
|
|
191
226
|
});
|
|
192
227
|
}
|
|
@@ -1021,9 +1056,34 @@ footer{margin-top:2rem;font-size:0.85rem;color:#555}
|
|
|
1021
1056
|
`.trim();
|
|
1022
1057
|
function buildRunReport(events, options) {
|
|
1023
1058
|
const profile = options.redactionProfile ?? "local";
|
|
1059
|
+
const section = options.section ?? "all";
|
|
1024
1060
|
const safeEvents = redactTraceEventsForReport(events, {
|
|
1025
1061
|
redactionProfile: profile
|
|
1026
1062
|
});
|
|
1063
|
+
const outcomes = summarizeObservedOutcomes(
|
|
1064
|
+
extractOutcomesFromTraceEvents(safeEvents)
|
|
1065
|
+
);
|
|
1066
|
+
const observationsMarkdown = renderObservedOutcomesMarkdown(outcomes);
|
|
1067
|
+
const observationsHtml = renderObservedOutcomesHtml(outcomes);
|
|
1068
|
+
if (section === "observations") {
|
|
1069
|
+
if (options.format === "markdown") {
|
|
1070
|
+
return {
|
|
1071
|
+
format: "markdown",
|
|
1072
|
+
content: `## Observed outcomes
|
|
1073
|
+
|
|
1074
|
+
${observationsMarkdown}
|
|
1075
|
+
`,
|
|
1076
|
+
contentType: "text/markdown",
|
|
1077
|
+
fileExtension: ".md"
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1080
|
+
return {
|
|
1081
|
+
format: "html",
|
|
1082
|
+
content: `<!doctype html><html lang="en"><head><meta charset="utf-8"/><title>Observed outcomes</title><style>${REPORT_HTML_CSS}</style></head><body><h1>Observed outcomes</h1>${observationsHtml}</body></html>`,
|
|
1083
|
+
contentType: "text/html",
|
|
1084
|
+
fileExtension: ".html"
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1027
1087
|
const whatSummary = buildRunWhatSummary(safeEvents);
|
|
1028
1088
|
const whatText = renderRunWhat(whatSummary, {
|
|
1029
1089
|
correlation: options.correlation !== false
|
|
@@ -1057,6 +1117,10 @@ function buildRunReport(events, options) {
|
|
|
1057
1117
|
"```text",
|
|
1058
1118
|
timelineText,
|
|
1059
1119
|
"```",
|
|
1120
|
+
"",
|
|
1121
|
+
"## Observed outcomes",
|
|
1122
|
+
"",
|
|
1123
|
+
observationsMarkdown,
|
|
1060
1124
|
""
|
|
1061
1125
|
];
|
|
1062
1126
|
if (tail) {
|
|
@@ -1100,6 +1164,7 @@ function buildRunReport(events, options) {
|
|
|
1100
1164
|
<p class="note">Generated locally by AgentInspect. Review for sensitive data before sharing.</p>
|
|
1101
1165
|
<section class="what"><h2>What happened</h2><pre>${escapeHtml(whatText)}</pre></section>
|
|
1102
1166
|
<section class="timeline"><h2>Timeline</h2><pre>${escapeHtml(timelineText)}</pre></section>
|
|
1167
|
+
<section class="observations"><h2>Observed outcomes</h2>${observationsHtml}</section>
|
|
1103
1168
|
${treeSection || '<section class="tree"><h2>Execution tree</h2><p>No steps recorded.</p></section>'}
|
|
1104
1169
|
${errorsSection}
|
|
1105
1170
|
${attrsSection}
|