agent-inspect 4.3.0 → 5.0.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/API.md +3 -0
- package/docs/CLI.md +37 -0
- package/docs/SCHEMA.md +27 -1
- package/package.json +1 -1
- package/packages/cli/dist/chunk-TB45H3QT.mjs +7881 -0
- package/packages/cli/dist/chunk-TB45H3QT.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +10461 -9188
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +2619 -5688
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-YFMPWEIS.mjs → src-ZRFSYML6.mjs} +3 -3
- package/packages/cli/dist/{src-YFMPWEIS.mjs.map → src-ZRFSYML6.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +3410 -21
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +147 -9
- package/packages/core/dist/advanced.d.ts +147 -9
- package/packages/core/dist/advanced.mjs +603 -20
- 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 +7 -1612
- 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-QLYOCCEF.mjs +1650 -0
- package/packages/core/dist/chunk-QLYOCCEF.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-X2FLDF7M.mjs +1581 -0
- package/packages/core/dist/chunk-X2FLDF7M.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 +4 -1580
- 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 +0 -3671
- 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,13 +1,14 @@
|
|
|
1
|
-
export { C as CreateInspectorOptions, D as DEFAULT_MAX_EVENT_BYTES, f as DEFAULT_MAX_METADATA_VALUE_LENGTH, h as DEFAULT_MAX_PREVIEW_LENGTH, I as Inspector, a as InspectorCaptureOptions, b as InspectorObserveOptions, c as InspectorRunOptions, i as InspectorRuntime, j as InspectorRuntimeContext, k as InspectorRuntimeDiagnostics, l as InspectorRuntimeOptions, d as InspectorStepOptions, T as TraceSafetyOptions, e as createInspector, n as createInspectorRuntime, o as getCurrentContext, g as getCurrentCorrelationMetadata, p as getCurrentDepth, q as getCurrentRunId, r as getCurrentRunName, s as getCurrentStepId, t as getParentStepId, u as getTraceDirFromContext, v as getTraceSafetyFromContext, w as hasActiveContext, x as isAgentInspectEnabled, y as isSilentContext, m as maybeInspectRun, z as prepareMetadataForDisk, A as prepareTraceEventForDisk, B as resolveTraceSafetyOptions, E as runWithContext, F as runWithStepContext } from './context-
|
|
2
|
-
import { R as RedactionProfile, E as ErrorInfo, b as RunStatus, e as StepStatus, h as TraceEvent, j as RunSummary, k as TraceMetadata, l as TraceMetadataStatus, f as StepType, g as TraceCorrelationMetadata } from './types-
|
|
3
|
-
export { A as ActiveStepContext, i as ExecutionContext, I as InspectRunOptions, O as ObserveOptions, a as Run, m as RunCompletedEvent, n as RunStartedEvent, c as Step, o as StepCompletedEvent, d as StepMetadata, S as StepOptions, p as StepStartedEvent, T as TokenMetadata, q as TraceEventBase, r as TraceSchemaVersion, s as isStepStatus, t as isStepType, u as isTraceEvent } from './types-
|
|
4
|
-
import { b as InspectRunTree } from './inspect-event-
|
|
5
|
-
export { A as AttributionConfidence, E as EventSource, a as InspectEvent, I as InspectKind, c as InspectNode } from './inspect-event-
|
|
6
|
-
import { P as PersistedInspectEvent } from './persisted-inspect-event-
|
|
1
|
+
export { C as CreateInspectorOptions, D as DEFAULT_MAX_EVENT_BYTES, f as DEFAULT_MAX_METADATA_VALUE_LENGTH, h as DEFAULT_MAX_PREVIEW_LENGTH, I as Inspector, a as InspectorCaptureOptions, b as InspectorObserveOptions, c as InspectorRunOptions, i as InspectorRuntime, j as InspectorRuntimeContext, k as InspectorRuntimeDiagnostics, l as InspectorRuntimeOptions, d as InspectorStepOptions, T as TraceSafetyOptions, e as createInspector, n as createInspectorRuntime, o as getCurrentContext, g as getCurrentCorrelationMetadata, p as getCurrentDepth, q as getCurrentRunId, r as getCurrentRunName, s as getCurrentStepId, t as getParentStepId, u as getTraceDirFromContext, v as getTraceSafetyFromContext, w as hasActiveContext, x as isAgentInspectEnabled, y as isSilentContext, m as maybeInspectRun, z as prepareMetadataForDisk, A as prepareTraceEventForDisk, B as resolveTraceSafetyOptions, E as runWithContext, F as runWithStepContext } from './context-BbfkMYjz.cjs';
|
|
2
|
+
import { R as RedactionProfile, E as ErrorInfo, b as RunStatus, e as StepStatus, h as TraceEvent, j as RunSummary, k as TraceMetadata, l as TraceMetadataStatus, f as StepType, g as TraceCorrelationMetadata } from './types-B1X87dUW.cjs';
|
|
3
|
+
export { A as ActiveStepContext, i as ExecutionContext, I as InspectRunOptions, O as ObserveOptions, a as Run, m as RunCompletedEvent, n as RunStartedEvent, c as Step, o as StepCompletedEvent, d as StepMetadata, S as StepOptions, p as StepStartedEvent, T as TokenMetadata, q as TraceEventBase, r as TraceSchemaVersion, s as isStepStatus, t as isStepType, u as isTraceEvent } from './types-B1X87dUW.cjs';
|
|
4
|
+
import { b as InspectRunTree } from './inspect-event-IqwOHbGo.cjs';
|
|
5
|
+
export { A as AttributionConfidence, E as EventSource, a as InspectEvent, I as InspectKind, c as InspectNode } from './inspect-event-IqwOHbGo.cjs';
|
|
6
|
+
import { P as PersistedInspectEvent } from './persisted-inspect-event-Gd-W8vB7.cjs';
|
|
7
7
|
import { Stats } from 'node:fs';
|
|
8
8
|
import { TraceCheckResult, TraceCheckStatus } from './checks.cjs';
|
|
9
9
|
import './writers.cjs';
|
|
10
|
-
import './
|
|
10
|
+
import './types-CvsKGweN.cjs';
|
|
11
|
+
import './log-config-CW8w5YQ9.cjs';
|
|
11
12
|
import './readers.cjs';
|
|
12
13
|
|
|
13
14
|
interface ResolvedRedactionProfile {
|
|
@@ -369,6 +370,7 @@ interface TraceSearchOptions {
|
|
|
369
370
|
limit?: number;
|
|
370
371
|
session?: string;
|
|
371
372
|
correlateGroup?: boolean;
|
|
373
|
+
observation?: string;
|
|
372
374
|
}
|
|
373
375
|
interface TraceSearchResult {
|
|
374
376
|
runId: string;
|
|
@@ -563,7 +565,9 @@ declare function enrichSessionSummary(summary: Omit<SessionSummary, "status" | "
|
|
|
563
565
|
*/
|
|
564
566
|
declare function buildActivitySummary(index: SessionIndex, options?: BuildActivitySummaryOptions): ActivitySummary;
|
|
565
567
|
/** Renders a human activity summary for terminal output. */
|
|
566
|
-
declare function renderActivitySummaryHuman(summary: ActivitySummary
|
|
568
|
+
declare function renderActivitySummaryHuman(summary: ActivitySummary, options?: {
|
|
569
|
+
nowMs?: number;
|
|
570
|
+
}): string;
|
|
567
571
|
|
|
568
572
|
/** Enriches trace metadata with run_started metadata for session indexing. */
|
|
569
573
|
declare function enrichSessionRunRecord(meta: TraceMetadata): Promise<SessionRunRecord>;
|
|
@@ -735,4 +739,138 @@ declare function normalizeBundleOutputPath(out: string): string;
|
|
|
735
739
|
*/
|
|
736
740
|
declare function defaultBundleOutputPath(runIds: readonly string[]): string;
|
|
737
741
|
|
|
738
|
-
|
|
742
|
+
type SuiteCaseStatus = "pass" | "fail" | "error" | "skipped";
|
|
743
|
+
type SuiteDiagnosticCode = "AI_SUITE_CONFIG_INVALID" | "AI_SUITE_CONFIG_LOAD_FAILED" | "AI_SUITE_CASE_TRACE_MISSING" | "AI_SUITE_CASE_CHECK_FAILED" | "AI_SUITE_CASE_EVAL_FAILED" | "AI_SUITE_CASE_OBSERVATION_FAILED" | "AI_SUITE_TRACE_UNREADABLE";
|
|
744
|
+
interface SuiteDiagnostic {
|
|
745
|
+
code: SuiteDiagnosticCode;
|
|
746
|
+
severity: "error" | "warning" | "info";
|
|
747
|
+
message: string;
|
|
748
|
+
caseId?: string;
|
|
749
|
+
}
|
|
750
|
+
interface SuiteCaseConfig {
|
|
751
|
+
id: string;
|
|
752
|
+
trace?: string;
|
|
753
|
+
runId?: string;
|
|
754
|
+
input?: string;
|
|
755
|
+
requireTools?: string[];
|
|
756
|
+
forbidTools?: string[];
|
|
757
|
+
maxDurationMs?: number;
|
|
758
|
+
expectedObservations?: string[];
|
|
759
|
+
}
|
|
760
|
+
interface SuiteChecksConfig {
|
|
761
|
+
select?: string[];
|
|
762
|
+
run?: {
|
|
763
|
+
maxDurationMs?: number;
|
|
764
|
+
maxDepth?: number;
|
|
765
|
+
};
|
|
766
|
+
tool?: {
|
|
767
|
+
required?: string[];
|
|
768
|
+
forbidden?: string[];
|
|
769
|
+
};
|
|
770
|
+
llm?: {
|
|
771
|
+
allowedModels?: string[];
|
|
772
|
+
maxTotalTokens?: number;
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
interface SuiteEvalConfig {
|
|
776
|
+
requireSuccess?: boolean;
|
|
777
|
+
requiredTools?: string[];
|
|
778
|
+
forbiddenTools?: string[];
|
|
779
|
+
maxDurationMs?: number;
|
|
780
|
+
maxDepth?: number;
|
|
781
|
+
maxRetries?: number;
|
|
782
|
+
maxTotalTokens?: number;
|
|
783
|
+
}
|
|
784
|
+
interface SuiteArtifactsConfig {
|
|
785
|
+
outputDir?: string;
|
|
786
|
+
}
|
|
787
|
+
interface SuiteConfig {
|
|
788
|
+
name: string;
|
|
789
|
+
traces: string;
|
|
790
|
+
cases: SuiteCaseConfig[];
|
|
791
|
+
checks?: SuiteChecksConfig;
|
|
792
|
+
eval?: SuiteEvalConfig;
|
|
793
|
+
redactionProfile?: RedactionProfile;
|
|
794
|
+
artifacts?: SuiteArtifactsConfig;
|
|
795
|
+
baseline?: string;
|
|
796
|
+
candidate?: string;
|
|
797
|
+
}
|
|
798
|
+
interface SuiteCaseResult {
|
|
799
|
+
id: string;
|
|
800
|
+
status: SuiteCaseStatus;
|
|
801
|
+
tracePath?: string;
|
|
802
|
+
runId?: string;
|
|
803
|
+
checkOk?: boolean;
|
|
804
|
+
evalOk?: boolean;
|
|
805
|
+
observationsOk?: boolean;
|
|
806
|
+
message?: string;
|
|
807
|
+
diagnostics: SuiteDiagnostic[];
|
|
808
|
+
}
|
|
809
|
+
interface SuiteRunSummary {
|
|
810
|
+
passed: number;
|
|
811
|
+
failed: number;
|
|
812
|
+
errors: number;
|
|
813
|
+
skipped: number;
|
|
814
|
+
}
|
|
815
|
+
interface SuiteRunResult {
|
|
816
|
+
ok: boolean;
|
|
817
|
+
status: "pass" | "fail" | "error";
|
|
818
|
+
suiteName: string;
|
|
819
|
+
configPath: string;
|
|
820
|
+
tracesDir: string;
|
|
821
|
+
startedAt: string;
|
|
822
|
+
finishedAt: string;
|
|
823
|
+
summary: SuiteRunSummary;
|
|
824
|
+
cases: SuiteCaseResult[];
|
|
825
|
+
diagnostics: SuiteDiagnostic[];
|
|
826
|
+
}
|
|
827
|
+
interface LoadSuiteConfigOptions {
|
|
828
|
+
configPath?: string;
|
|
829
|
+
cwd?: string;
|
|
830
|
+
}
|
|
831
|
+
interface ValidateSuiteConfigResult {
|
|
832
|
+
ok: boolean;
|
|
833
|
+
diagnostics: SuiteDiagnostic[];
|
|
834
|
+
}
|
|
835
|
+
interface RunSuiteOptions {
|
|
836
|
+
configPath?: string;
|
|
837
|
+
cwd?: string;
|
|
838
|
+
nowMs?: number;
|
|
839
|
+
}
|
|
840
|
+
interface RenderSuiteReportOptions {
|
|
841
|
+
format?: "markdown" | "json";
|
|
842
|
+
}
|
|
843
|
+
declare const DEFAULT_SUITE_CONFIG_NAMES: readonly ["agent-inspect.suite.json", "agent-inspect.suite.js", "agent-inspect.suite.mjs", "agent-inspect.suite.cjs"];
|
|
844
|
+
declare const DEFAULT_SUITE_ARTIFACTS_DIR = ".agent-inspect/suite-runs";
|
|
845
|
+
|
|
846
|
+
declare function resolveSuiteConfigPath(options?: LoadSuiteConfigOptions): Promise<string>;
|
|
847
|
+
declare function loadSuiteConfig(options?: LoadSuiteConfigOptions): Promise<{
|
|
848
|
+
config: SuiteConfig;
|
|
849
|
+
configPath: string;
|
|
850
|
+
configDir: string;
|
|
851
|
+
}>;
|
|
852
|
+
declare function defaultSuiteConfigTemplate(): SuiteConfig;
|
|
853
|
+
|
|
854
|
+
declare function normalizeSuiteConfig(value: unknown): SuiteConfig;
|
|
855
|
+
declare function validateSuiteConfig(config: SuiteConfig, options: {
|
|
856
|
+
configDir: string;
|
|
857
|
+
}): Promise<ValidateSuiteConfigResult>;
|
|
858
|
+
|
|
859
|
+
interface ResolvedSuiteCase {
|
|
860
|
+
caseId: string;
|
|
861
|
+
tracePath?: string;
|
|
862
|
+
runId?: string;
|
|
863
|
+
missing: boolean;
|
|
864
|
+
reason?: string;
|
|
865
|
+
}
|
|
866
|
+
declare function resolveSuiteCaseTrace(suiteCase: SuiteCaseConfig, options: {
|
|
867
|
+
configDir: string;
|
|
868
|
+
tracesDir: string;
|
|
869
|
+
}): Promise<ResolvedSuiteCase>;
|
|
870
|
+
|
|
871
|
+
declare function runSuite(options?: RunSuiteOptions): Promise<SuiteRunResult>;
|
|
872
|
+
|
|
873
|
+
declare function renderSuiteReportMarkdown(result: SuiteRunResult): string;
|
|
874
|
+
declare function renderSuiteReport(result: SuiteRunResult, options?: RenderSuiteReportOptions): string;
|
|
875
|
+
|
|
876
|
+
export { type ActivityEntry, type ActivitySummary, type BuildActivitySummaryOptions, type BuildSessionIndexOptions, type BundleCheckResults, type BundleCheckRunResult, type BundleMetadata, type BundlePlaceholderArtifact, type BundleRedactionProfile, type BundleRedactionReport, type BundleRedactionReportRun, type BundleResolveOptions, type BundleResolveResult, type BundleSafeStatus, type BundleSafeStatusMetadata, type CriticalPathStep, DEFAULT_SUITE_ARTIFACTS_DIR, DEFAULT_SUITE_CONFIG_NAMES, DEFAULT_TRACE_DIR_NAME, type DurationStats, type EnrichSessionSummaryOptions, ErrorInfo, type ExplainFact, type ExplainInference, type ExplainMode, type ExplainOptions, type ExplainResult, FALLBACK_TRACE_DIR, type GroupSessionCohortsOptions, type HandoffEdge, InspectRunTree, type LoadSuiteConfigOptions, MAX_NAME_LENGTH, MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, type ParseTraceJsonlOptions, type ParseTraceJsonlResult, type ParsedDurationFilter, RUNS_DIR_NAME, RedactionProfile, type RenderSuiteReportOptions, type RenderTimelineOptions, type RenderWhatOptions, type ResolvedRedactionProfile, type ResolvedSuiteCase, type RetryLink, RunStatus, type RunSuiteOptions, RunSummary, type RunTimeline, type RunWhatSummary, SESSION_WORKFLOW_KEYS, type SessionCheckSummary, type SessionCohort, type SessionCohortKind, type SessionConfidence, type SessionEdgeSource, type SessionGroup, type SessionIndex, type SessionLastError, type SessionRunRecord, type SessionScopeOptions, type SessionScopeResult, type SessionStatus, type SessionSummary, type SessionWarning, type SessionWorkflowKey, type SessionWorkflowMetadata, StepStatus, StepType, type SuiteArtifactsConfig, type SuiteCaseConfig, type SuiteCaseResult, type SuiteCaseStatus, type SuiteChecksConfig, type SuiteConfig, type SuiteDiagnostic, type SuiteDiagnosticCode, type SuiteEvalConfig, type SuiteRunResult, type SuiteRunSummary, TERMINAL_INDENT, type TimelineEntry, type TimelineFocus, type TimelineOptions, TraceCorrelationMetadata, TraceDirectory, type TraceDirectoryOptions, TraceEvent, type TraceFilterOptions, type TraceJsonlFormat, TraceMetadata, TraceMetadataStatus, type TraceSearchOptions, type TraceSearchResult, type TraceSessionCheckResult, type TraceStats, type TraceStatsOptions, type TraceStatsRankedRun, type TraceStatsRankedStep, type ValidateSuiteConfigResult, aggregateBundleSafeStatus, aggregateSessionCheckResults, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, bundleFailsOnSafety, createRunId, createStepId, defaultBundleOutputPath, defaultSuiteConfigTemplate, deriveSessionStatus, enrichSessionRunRecord, enrichSessionSummary, ensureTraceDir, extractMetadata, extractSessionWorkflowMetadata, filterMetasBySessionScope, filterTraces, formatDuration, formatError, formatTerminalName, formatTimestamp, getDefaultTraceDir, getIndent, getRunIdFromTraceFileName, getTraceFilePath, groupSessionCohorts, initializeTraceFile, isAgentInspectTrace, listTraceFiles, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, normalizeBundleOutputPath, normalizeSuiteConfig, parseDuration, parseDurationFilter, parseTraceJsonl, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, readTraceEvents, readTraceFile, renderActivitySummaryHuman, renderErrorLine, renderRunSummary, renderRunWhat, renderStepLine, renderSuiteReport, renderSuiteReportMarkdown, renderTimeline, renderTraceStats, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteCaseTrace, resolveSuiteConfigPath, resolveTraceDir, runSuite, searchTraces, serializeEvent, sessionKeyForRun, toMetadataSafeStatus, traceMetasToSessionRunRecords, truncateName, unknownTraceFormatMessage, validateEvent, validateSuiteConfig, warn, writeTraceEvent };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export { C as CreateInspectorOptions, D as DEFAULT_MAX_EVENT_BYTES, f as DEFAULT_MAX_METADATA_VALUE_LENGTH, h as DEFAULT_MAX_PREVIEW_LENGTH, I as Inspector, a as InspectorCaptureOptions, b as InspectorObserveOptions, c as InspectorRunOptions, i as InspectorRuntime, j as InspectorRuntimeContext, k as InspectorRuntimeDiagnostics, l as InspectorRuntimeOptions, d as InspectorStepOptions, T as TraceSafetyOptions, e as createInspector, n as createInspectorRuntime, o as getCurrentContext, g as getCurrentCorrelationMetadata, p as getCurrentDepth, q as getCurrentRunId, r as getCurrentRunName, s as getCurrentStepId, t as getParentStepId, u as getTraceDirFromContext, v as getTraceSafetyFromContext, w as hasActiveContext, x as isAgentInspectEnabled, y as isSilentContext, m as maybeInspectRun, z as prepareMetadataForDisk, A as prepareTraceEventForDisk, B as resolveTraceSafetyOptions, E as runWithContext, F as runWithStepContext } from './context-
|
|
2
|
-
import { R as RedactionProfile, E as ErrorInfo, b as RunStatus, e as StepStatus, h as TraceEvent, j as RunSummary, k as TraceMetadata, l as TraceMetadataStatus, f as StepType, g as TraceCorrelationMetadata } from './types-
|
|
3
|
-
export { A as ActiveStepContext, i as ExecutionContext, I as InspectRunOptions, O as ObserveOptions, a as Run, m as RunCompletedEvent, n as RunStartedEvent, c as Step, o as StepCompletedEvent, d as StepMetadata, S as StepOptions, p as StepStartedEvent, T as TokenMetadata, q as TraceEventBase, r as TraceSchemaVersion, s as isStepStatus, t as isStepType, u as isTraceEvent } from './types-
|
|
4
|
-
import { b as InspectRunTree } from './inspect-event-
|
|
5
|
-
export { A as AttributionConfidence, E as EventSource, a as InspectEvent, I as InspectKind, c as InspectNode } from './inspect-event-
|
|
6
|
-
import { P as PersistedInspectEvent } from './persisted-inspect-event-
|
|
1
|
+
export { C as CreateInspectorOptions, D as DEFAULT_MAX_EVENT_BYTES, f as DEFAULT_MAX_METADATA_VALUE_LENGTH, h as DEFAULT_MAX_PREVIEW_LENGTH, I as Inspector, a as InspectorCaptureOptions, b as InspectorObserveOptions, c as InspectorRunOptions, i as InspectorRuntime, j as InspectorRuntimeContext, k as InspectorRuntimeDiagnostics, l as InspectorRuntimeOptions, d as InspectorStepOptions, T as TraceSafetyOptions, e as createInspector, n as createInspectorRuntime, o as getCurrentContext, g as getCurrentCorrelationMetadata, p as getCurrentDepth, q as getCurrentRunId, r as getCurrentRunName, s as getCurrentStepId, t as getParentStepId, u as getTraceDirFromContext, v as getTraceSafetyFromContext, w as hasActiveContext, x as isAgentInspectEnabled, y as isSilentContext, m as maybeInspectRun, z as prepareMetadataForDisk, A as prepareTraceEventForDisk, B as resolveTraceSafetyOptions, E as runWithContext, F as runWithStepContext } from './context-Cp8NRbBX.js';
|
|
2
|
+
import { R as RedactionProfile, E as ErrorInfo, b as RunStatus, e as StepStatus, h as TraceEvent, j as RunSummary, k as TraceMetadata, l as TraceMetadataStatus, f as StepType, g as TraceCorrelationMetadata } from './types-BVkjSd0q.js';
|
|
3
|
+
export { A as ActiveStepContext, i as ExecutionContext, I as InspectRunOptions, O as ObserveOptions, a as Run, m as RunCompletedEvent, n as RunStartedEvent, c as Step, o as StepCompletedEvent, d as StepMetadata, S as StepOptions, p as StepStartedEvent, T as TokenMetadata, q as TraceEventBase, r as TraceSchemaVersion, s as isStepStatus, t as isStepType, u as isTraceEvent } from './types-BVkjSd0q.js';
|
|
4
|
+
import { b as InspectRunTree } from './inspect-event-IqwOHbGo.js';
|
|
5
|
+
export { A as AttributionConfidence, E as EventSource, a as InspectEvent, I as InspectKind, c as InspectNode } from './inspect-event-IqwOHbGo.js';
|
|
6
|
+
import { P as PersistedInspectEvent } from './persisted-inspect-event-DruwqARZ.js';
|
|
7
7
|
import { Stats } from 'node:fs';
|
|
8
8
|
import { TraceCheckResult, TraceCheckStatus } from './checks.js';
|
|
9
9
|
import './writers.js';
|
|
10
|
-
import './
|
|
10
|
+
import './types-CvsKGweN.js';
|
|
11
|
+
import './log-config-SRA4xTp8.js';
|
|
11
12
|
import './readers.js';
|
|
12
13
|
|
|
13
14
|
interface ResolvedRedactionProfile {
|
|
@@ -369,6 +370,7 @@ interface TraceSearchOptions {
|
|
|
369
370
|
limit?: number;
|
|
370
371
|
session?: string;
|
|
371
372
|
correlateGroup?: boolean;
|
|
373
|
+
observation?: string;
|
|
372
374
|
}
|
|
373
375
|
interface TraceSearchResult {
|
|
374
376
|
runId: string;
|
|
@@ -563,7 +565,9 @@ declare function enrichSessionSummary(summary: Omit<SessionSummary, "status" | "
|
|
|
563
565
|
*/
|
|
564
566
|
declare function buildActivitySummary(index: SessionIndex, options?: BuildActivitySummaryOptions): ActivitySummary;
|
|
565
567
|
/** Renders a human activity summary for terminal output. */
|
|
566
|
-
declare function renderActivitySummaryHuman(summary: ActivitySummary
|
|
568
|
+
declare function renderActivitySummaryHuman(summary: ActivitySummary, options?: {
|
|
569
|
+
nowMs?: number;
|
|
570
|
+
}): string;
|
|
567
571
|
|
|
568
572
|
/** Enriches trace metadata with run_started metadata for session indexing. */
|
|
569
573
|
declare function enrichSessionRunRecord(meta: TraceMetadata): Promise<SessionRunRecord>;
|
|
@@ -735,4 +739,138 @@ declare function normalizeBundleOutputPath(out: string): string;
|
|
|
735
739
|
*/
|
|
736
740
|
declare function defaultBundleOutputPath(runIds: readonly string[]): string;
|
|
737
741
|
|
|
738
|
-
|
|
742
|
+
type SuiteCaseStatus = "pass" | "fail" | "error" | "skipped";
|
|
743
|
+
type SuiteDiagnosticCode = "AI_SUITE_CONFIG_INVALID" | "AI_SUITE_CONFIG_LOAD_FAILED" | "AI_SUITE_CASE_TRACE_MISSING" | "AI_SUITE_CASE_CHECK_FAILED" | "AI_SUITE_CASE_EVAL_FAILED" | "AI_SUITE_CASE_OBSERVATION_FAILED" | "AI_SUITE_TRACE_UNREADABLE";
|
|
744
|
+
interface SuiteDiagnostic {
|
|
745
|
+
code: SuiteDiagnosticCode;
|
|
746
|
+
severity: "error" | "warning" | "info";
|
|
747
|
+
message: string;
|
|
748
|
+
caseId?: string;
|
|
749
|
+
}
|
|
750
|
+
interface SuiteCaseConfig {
|
|
751
|
+
id: string;
|
|
752
|
+
trace?: string;
|
|
753
|
+
runId?: string;
|
|
754
|
+
input?: string;
|
|
755
|
+
requireTools?: string[];
|
|
756
|
+
forbidTools?: string[];
|
|
757
|
+
maxDurationMs?: number;
|
|
758
|
+
expectedObservations?: string[];
|
|
759
|
+
}
|
|
760
|
+
interface SuiteChecksConfig {
|
|
761
|
+
select?: string[];
|
|
762
|
+
run?: {
|
|
763
|
+
maxDurationMs?: number;
|
|
764
|
+
maxDepth?: number;
|
|
765
|
+
};
|
|
766
|
+
tool?: {
|
|
767
|
+
required?: string[];
|
|
768
|
+
forbidden?: string[];
|
|
769
|
+
};
|
|
770
|
+
llm?: {
|
|
771
|
+
allowedModels?: string[];
|
|
772
|
+
maxTotalTokens?: number;
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
interface SuiteEvalConfig {
|
|
776
|
+
requireSuccess?: boolean;
|
|
777
|
+
requiredTools?: string[];
|
|
778
|
+
forbiddenTools?: string[];
|
|
779
|
+
maxDurationMs?: number;
|
|
780
|
+
maxDepth?: number;
|
|
781
|
+
maxRetries?: number;
|
|
782
|
+
maxTotalTokens?: number;
|
|
783
|
+
}
|
|
784
|
+
interface SuiteArtifactsConfig {
|
|
785
|
+
outputDir?: string;
|
|
786
|
+
}
|
|
787
|
+
interface SuiteConfig {
|
|
788
|
+
name: string;
|
|
789
|
+
traces: string;
|
|
790
|
+
cases: SuiteCaseConfig[];
|
|
791
|
+
checks?: SuiteChecksConfig;
|
|
792
|
+
eval?: SuiteEvalConfig;
|
|
793
|
+
redactionProfile?: RedactionProfile;
|
|
794
|
+
artifacts?: SuiteArtifactsConfig;
|
|
795
|
+
baseline?: string;
|
|
796
|
+
candidate?: string;
|
|
797
|
+
}
|
|
798
|
+
interface SuiteCaseResult {
|
|
799
|
+
id: string;
|
|
800
|
+
status: SuiteCaseStatus;
|
|
801
|
+
tracePath?: string;
|
|
802
|
+
runId?: string;
|
|
803
|
+
checkOk?: boolean;
|
|
804
|
+
evalOk?: boolean;
|
|
805
|
+
observationsOk?: boolean;
|
|
806
|
+
message?: string;
|
|
807
|
+
diagnostics: SuiteDiagnostic[];
|
|
808
|
+
}
|
|
809
|
+
interface SuiteRunSummary {
|
|
810
|
+
passed: number;
|
|
811
|
+
failed: number;
|
|
812
|
+
errors: number;
|
|
813
|
+
skipped: number;
|
|
814
|
+
}
|
|
815
|
+
interface SuiteRunResult {
|
|
816
|
+
ok: boolean;
|
|
817
|
+
status: "pass" | "fail" | "error";
|
|
818
|
+
suiteName: string;
|
|
819
|
+
configPath: string;
|
|
820
|
+
tracesDir: string;
|
|
821
|
+
startedAt: string;
|
|
822
|
+
finishedAt: string;
|
|
823
|
+
summary: SuiteRunSummary;
|
|
824
|
+
cases: SuiteCaseResult[];
|
|
825
|
+
diagnostics: SuiteDiagnostic[];
|
|
826
|
+
}
|
|
827
|
+
interface LoadSuiteConfigOptions {
|
|
828
|
+
configPath?: string;
|
|
829
|
+
cwd?: string;
|
|
830
|
+
}
|
|
831
|
+
interface ValidateSuiteConfigResult {
|
|
832
|
+
ok: boolean;
|
|
833
|
+
diagnostics: SuiteDiagnostic[];
|
|
834
|
+
}
|
|
835
|
+
interface RunSuiteOptions {
|
|
836
|
+
configPath?: string;
|
|
837
|
+
cwd?: string;
|
|
838
|
+
nowMs?: number;
|
|
839
|
+
}
|
|
840
|
+
interface RenderSuiteReportOptions {
|
|
841
|
+
format?: "markdown" | "json";
|
|
842
|
+
}
|
|
843
|
+
declare const DEFAULT_SUITE_CONFIG_NAMES: readonly ["agent-inspect.suite.json", "agent-inspect.suite.js", "agent-inspect.suite.mjs", "agent-inspect.suite.cjs"];
|
|
844
|
+
declare const DEFAULT_SUITE_ARTIFACTS_DIR = ".agent-inspect/suite-runs";
|
|
845
|
+
|
|
846
|
+
declare function resolveSuiteConfigPath(options?: LoadSuiteConfigOptions): Promise<string>;
|
|
847
|
+
declare function loadSuiteConfig(options?: LoadSuiteConfigOptions): Promise<{
|
|
848
|
+
config: SuiteConfig;
|
|
849
|
+
configPath: string;
|
|
850
|
+
configDir: string;
|
|
851
|
+
}>;
|
|
852
|
+
declare function defaultSuiteConfigTemplate(): SuiteConfig;
|
|
853
|
+
|
|
854
|
+
declare function normalizeSuiteConfig(value: unknown): SuiteConfig;
|
|
855
|
+
declare function validateSuiteConfig(config: SuiteConfig, options: {
|
|
856
|
+
configDir: string;
|
|
857
|
+
}): Promise<ValidateSuiteConfigResult>;
|
|
858
|
+
|
|
859
|
+
interface ResolvedSuiteCase {
|
|
860
|
+
caseId: string;
|
|
861
|
+
tracePath?: string;
|
|
862
|
+
runId?: string;
|
|
863
|
+
missing: boolean;
|
|
864
|
+
reason?: string;
|
|
865
|
+
}
|
|
866
|
+
declare function resolveSuiteCaseTrace(suiteCase: SuiteCaseConfig, options: {
|
|
867
|
+
configDir: string;
|
|
868
|
+
tracesDir: string;
|
|
869
|
+
}): Promise<ResolvedSuiteCase>;
|
|
870
|
+
|
|
871
|
+
declare function runSuite(options?: RunSuiteOptions): Promise<SuiteRunResult>;
|
|
872
|
+
|
|
873
|
+
declare function renderSuiteReportMarkdown(result: SuiteRunResult): string;
|
|
874
|
+
declare function renderSuiteReport(result: SuiteRunResult, options?: RenderSuiteReportOptions): string;
|
|
875
|
+
|
|
876
|
+
export { type ActivityEntry, type ActivitySummary, type BuildActivitySummaryOptions, type BuildSessionIndexOptions, type BundleCheckResults, type BundleCheckRunResult, type BundleMetadata, type BundlePlaceholderArtifact, type BundleRedactionProfile, type BundleRedactionReport, type BundleRedactionReportRun, type BundleResolveOptions, type BundleResolveResult, type BundleSafeStatus, type BundleSafeStatusMetadata, type CriticalPathStep, DEFAULT_SUITE_ARTIFACTS_DIR, DEFAULT_SUITE_CONFIG_NAMES, DEFAULT_TRACE_DIR_NAME, type DurationStats, type EnrichSessionSummaryOptions, ErrorInfo, type ExplainFact, type ExplainInference, type ExplainMode, type ExplainOptions, type ExplainResult, FALLBACK_TRACE_DIR, type GroupSessionCohortsOptions, type HandoffEdge, InspectRunTree, type LoadSuiteConfigOptions, MAX_NAME_LENGTH, MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, type ParseTraceJsonlOptions, type ParseTraceJsonlResult, type ParsedDurationFilter, RUNS_DIR_NAME, RedactionProfile, type RenderSuiteReportOptions, type RenderTimelineOptions, type RenderWhatOptions, type ResolvedRedactionProfile, type ResolvedSuiteCase, type RetryLink, RunStatus, type RunSuiteOptions, RunSummary, type RunTimeline, type RunWhatSummary, SESSION_WORKFLOW_KEYS, type SessionCheckSummary, type SessionCohort, type SessionCohortKind, type SessionConfidence, type SessionEdgeSource, type SessionGroup, type SessionIndex, type SessionLastError, type SessionRunRecord, type SessionScopeOptions, type SessionScopeResult, type SessionStatus, type SessionSummary, type SessionWarning, type SessionWorkflowKey, type SessionWorkflowMetadata, StepStatus, StepType, type SuiteArtifactsConfig, type SuiteCaseConfig, type SuiteCaseResult, type SuiteCaseStatus, type SuiteChecksConfig, type SuiteConfig, type SuiteDiagnostic, type SuiteDiagnosticCode, type SuiteEvalConfig, type SuiteRunResult, type SuiteRunSummary, TERMINAL_INDENT, type TimelineEntry, type TimelineFocus, type TimelineOptions, TraceCorrelationMetadata, TraceDirectory, type TraceDirectoryOptions, TraceEvent, type TraceFilterOptions, type TraceJsonlFormat, TraceMetadata, TraceMetadataStatus, type TraceSearchOptions, type TraceSearchResult, type TraceSessionCheckResult, type TraceStats, type TraceStatsOptions, type TraceStatsRankedRun, type TraceStatsRankedStep, type ValidateSuiteConfigResult, aggregateBundleSafeStatus, aggregateSessionCheckResults, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, bundleFailsOnSafety, createRunId, createStepId, defaultBundleOutputPath, defaultSuiteConfigTemplate, deriveSessionStatus, enrichSessionRunRecord, enrichSessionSummary, ensureTraceDir, extractMetadata, extractSessionWorkflowMetadata, filterMetasBySessionScope, filterTraces, formatDuration, formatError, formatTerminalName, formatTimestamp, getDefaultTraceDir, getIndent, getRunIdFromTraceFileName, getTraceFilePath, groupSessionCohorts, initializeTraceFile, isAgentInspectTrace, listTraceFiles, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, normalizeBundleOutputPath, normalizeSuiteConfig, parseDuration, parseDurationFilter, parseTraceJsonl, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, readTraceEvents, readTraceFile, renderActivitySummaryHuman, renderErrorLine, renderRunSummary, renderRunWhat, renderStepLine, renderSuiteReport, renderSuiteReportMarkdown, renderTimeline, renderTraceStats, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteCaseTrace, resolveSuiteConfigPath, resolveTraceDir, runSuite, searchTraces, serializeEvent, sessionKeyForRun, toMetadataSafeStatus, traceMetasToSessionRunRecords, truncateName, unknownTraceFormatMessage, validateEvent, validateSuiteConfig, warn, writeTraceEvent };
|