agent-inspect 6.20.0 → 6.22.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/TRACE-CONTRACTS.md +39 -0
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-QPRJUVLH.mjs → chunk-CHBYF4LE.mjs} +25 -2
- package/packages/cli/dist/chunk-CHBYF4LE.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +50 -3
- 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-6W5ZR3I7.mjs → src-MY5WIBPF.mjs} +3 -3
- package/packages/cli/dist/{src-6W5ZR3I7.mjs.map → src-MY5WIBPF.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +41 -0
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +39 -157
- package/packages/core/dist/advanced.d.ts +39 -157
- package/packages/core/dist/advanced.mjs +35 -61
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +736 -45
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +132 -5
- package/packages/core/dist/checks.d.ts +132 -5
- package/packages/core/dist/checks.mjs +2 -2
- package/packages/core/dist/{chunk-HT54OLPE.mjs → chunk-NDRMIL7Z.mjs} +103 -3
- package/packages/core/dist/chunk-NDRMIL7Z.mjs.map +1 -0
- package/packages/core/dist/{chunk-G47KQB42.mjs → chunk-OG3GAWCX.mjs} +727 -43
- package/packages/core/dist/chunk-OG3GAWCX.mjs.map +1 -0
- package/packages/core/dist/{chunk-3XS5O4JI.mjs → chunk-R4SSYU6D.mjs} +3 -3
- package/packages/core/dist/chunk-R4SSYU6D.mjs.map +1 -0
- package/packages/core/dist/{chunk-5YFJJFXU.mjs → chunk-WGDSM37E.mjs} +3 -3
- package/packages/core/dist/{chunk-5YFJJFXU.mjs.map → chunk-WGDSM37E.mjs.map} +1 -1
- package/packages/core/dist/{context-C5ye_xcS.d.cts → context-DOOT9GZ-.d.cts} +1 -1
- package/packages/core/dist/{context-CNsNSgE2.d.ts → context-DOX2-RjH.d.ts} +1 -1
- package/packages/core/dist/diff.d.cts +1 -1
- package/packages/core/dist/diff.d.ts +1 -1
- package/packages/core/dist/exporters.d.cts +1 -1
- package/packages/core/dist/exporters.d.ts +1 -1
- package/packages/core/dist/exporters.mjs +1 -1
- package/packages/core/dist/{index-rVpX5PPh.d.cts → index-CR4CCRqP.d.cts} +159 -2
- package/packages/core/dist/{index-Bg9ZdsdS.d.ts → index-CtK_p-ps.d.ts} +159 -2
- package/packages/core/dist/{index-AMAGuO_i.d.ts → index-D72DPqAF.d.ts} +2 -1
- package/packages/core/dist/{index-vqr-g6ev.d.cts → index-DLLz9sce.d.cts} +2 -1
- package/packages/core/dist/index.d.cts +3 -3
- package/packages/core/dist/index.d.ts +3 -3
- package/packages/core/dist/index.mjs +3 -3
- package/packages/core/dist/persisted.d.cts +1 -1
- package/packages/core/dist/persisted.d.ts +1 -1
- package/packages/core/dist/programmatic-gZTWLObB.d.cts +25 -0
- package/packages/core/dist/programmatic-gZTWLObB.d.ts +25 -0
- package/packages/core/dist/readers.cjs +105 -0
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.d.cts +43 -18
- package/packages/core/dist/readers.d.ts +43 -18
- package/packages/core/dist/readers.mjs +1 -1
- package/packages/core/dist/{types--ainI31J.d.ts → types-Bx3mEZ04.d.ts} +1 -1
- package/packages/core/dist/{types-UnrNaTo2.d.cts → types-VzKihKQo.d.cts} +1 -1
- package/packages/cli/dist/chunk-QPRJUVLH.mjs.map +0 -1
- package/packages/core/dist/chunk-3XS5O4JI.mjs.map +0 -1
- package/packages/core/dist/chunk-G47KQB42.mjs.map +0 -1
- package/packages/core/dist/chunk-HT54OLPE.mjs.map +0 -1
|
@@ -1,16 +1,17 @@
|
|
|
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-
|
|
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-DOOT9GZ-.cjs';
|
|
2
2
|
import { R as RedactionRule } from './log-config-CFlIJHTf.cjs';
|
|
3
|
-
import { R as RedactionProfile,
|
|
4
|
-
export { A as ActiveStepContext,
|
|
3
|
+
import { R as RedactionProfile, i as TraceEvent, E as ErrorInfo, b as RunStatus, e as StepStatus, k as RunSummary, l as TraceMetadata, T as TraceMetadataStatus, f as StepType, h as TraceCorrelationMetadata } from './types-VzKihKQo.cjs';
|
|
4
|
+
export { A as ActiveStepContext, j 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, g as TokenMetadata, q as TraceEventBase, r as TraceSchemaVersion, s as isStepStatus, t as isStepType, u as isTraceEvent } from './types-VzKihKQo.cjs';
|
|
5
5
|
import { a as InspectRunTree } from './inspect-event-DRthdZlf.cjs';
|
|
6
6
|
export { A as AttributionConfidence, E as EventSource, c as InspectEvent, I as InspectKind, b as InspectNode } from './inspect-event-DRthdZlf.cjs';
|
|
7
7
|
import { P as PersistedInspectEvent } from './persisted-inspect-event-CVZWZldL.cjs';
|
|
8
8
|
import { Stats } from 'node:fs';
|
|
9
|
+
import { S as SessionWorkflowMetadata, al as SessionRunRecord, am as EnrichSessionSummaryOptions, an as SessionStatus, ao as SessionSummary, ap as SessionIndex, aq as BuildActivitySummaryOptions, ar as ActivitySummary, as as SessionWarning, at as BuildSessionIndexOptions, c as TraceCheckResult, P as TraceCheckStatus } from './index-CR4CCRqP.cjs';
|
|
10
|
+
export { au as ActivityEntry, av as CriticalPathStep, aw as HandoffEdge, ax as RetryLink, ay as SESSION_WORKFLOW_KEYS, az as SessionCheckSummary, aA as SessionConfidence, aB as SessionEdgeSource, aC as SessionGroup, aD as SessionLastError, aE as SessionWorkflowKey } from './index-CR4CCRqP.cjs';
|
|
9
11
|
import { b as ObservedOutcome } from './types-B562HgN_.cjs';
|
|
10
12
|
export { O as ObservedOutcomeStatus } from './types-B562HgN_.cjs';
|
|
11
|
-
import { b as TraceCheckResult, N as TraceCheckStatus } from './index-rVpX5PPh.cjs';
|
|
12
13
|
import './writers.cjs';
|
|
13
|
-
import './index-
|
|
14
|
+
import './index-DLLz9sce.cjs';
|
|
14
15
|
|
|
15
16
|
interface ResolvedRedactionProfile {
|
|
16
17
|
profile: RedactionProfile;
|
|
@@ -523,157 +524,6 @@ declare function parseDurationFilter(expr: string): ParsedDurationFilter;
|
|
|
523
524
|
declare function searchTraces(metas: TraceMetadata[], options: TraceSearchOptions): Promise<TraceSearchResult[]>;
|
|
524
525
|
declare function loadTraceMetadataList(_traceDir: string, fileNames: string[], getPath: (fileName: string) => string): Promise<TraceMetadata[]>;
|
|
525
526
|
|
|
526
|
-
/** Known session/workflow metadata keys (v2.4 RFC). */
|
|
527
|
-
declare const SESSION_WORKFLOW_KEYS: readonly ["sessionId", "conversationId", "groupId", "parentGroupId", "attempt", "retryOf", "retryReason", "handoffFrom", "handoffTo", "subAgentId", "subAgentName", "jobId", "queueName", "workflowName", "workflowStep", "toolCallId", "mcpToolCallId", "linkedStepId", "correlationId", "requestId", "decisionId"];
|
|
528
|
-
type SessionWorkflowKey = (typeof SESSION_WORKFLOW_KEYS)[number];
|
|
529
|
-
type SessionConfidence = "explicit" | "correlated" | "heuristic" | "unknown";
|
|
530
|
-
type SessionEdgeSource = "manual" | "adapter" | "json-log" | "log4js" | "mcp-client" | "inferred";
|
|
531
|
-
interface SessionWorkflowMetadata {
|
|
532
|
-
sessionId?: string;
|
|
533
|
-
conversationId?: string;
|
|
534
|
-
groupId?: string;
|
|
535
|
-
parentGroupId?: string;
|
|
536
|
-
attempt?: number;
|
|
537
|
-
retryOf?: string;
|
|
538
|
-
retryReason?: string;
|
|
539
|
-
handoffFrom?: string;
|
|
540
|
-
handoffTo?: string;
|
|
541
|
-
subAgentId?: string;
|
|
542
|
-
subAgentName?: string;
|
|
543
|
-
jobId?: string;
|
|
544
|
-
queueName?: string;
|
|
545
|
-
workflowName?: string;
|
|
546
|
-
workflowStep?: string;
|
|
547
|
-
toolCallId?: string;
|
|
548
|
-
mcpToolCallId?: string;
|
|
549
|
-
linkedStepId?: string;
|
|
550
|
-
correlationId?: string;
|
|
551
|
-
requestId?: string;
|
|
552
|
-
decisionId?: string;
|
|
553
|
-
}
|
|
554
|
-
interface SessionRunRecord {
|
|
555
|
-
runId: string;
|
|
556
|
-
name?: string;
|
|
557
|
-
status?: TraceMetadataStatus;
|
|
558
|
-
startedAt?: number;
|
|
559
|
-
endedAt?: number;
|
|
560
|
-
durationMs?: number;
|
|
561
|
-
filePath?: string;
|
|
562
|
-
metadata?: Record<string, unknown>;
|
|
563
|
-
}
|
|
564
|
-
interface SessionWarning {
|
|
565
|
-
code: string;
|
|
566
|
-
message: string;
|
|
567
|
-
runId?: string;
|
|
568
|
-
sessionId?: string;
|
|
569
|
-
}
|
|
570
|
-
interface HandoffEdge {
|
|
571
|
-
from: string;
|
|
572
|
-
to: string;
|
|
573
|
-
source: SessionEdgeSource;
|
|
574
|
-
confidence: SessionConfidence;
|
|
575
|
-
}
|
|
576
|
-
interface RetryLink {
|
|
577
|
-
runId: string;
|
|
578
|
-
retryOf?: string;
|
|
579
|
-
attempt?: number;
|
|
580
|
-
source: SessionEdgeSource;
|
|
581
|
-
confidence: SessionConfidence;
|
|
582
|
-
}
|
|
583
|
-
interface SessionGroup {
|
|
584
|
-
groupId: string;
|
|
585
|
-
parentGroupId?: string;
|
|
586
|
-
runIds: string[];
|
|
587
|
-
}
|
|
588
|
-
interface CriticalPathStep {
|
|
589
|
-
runId: string;
|
|
590
|
-
name?: string;
|
|
591
|
-
startedAt?: number;
|
|
592
|
-
durationMs?: number;
|
|
593
|
-
source: SessionEdgeSource;
|
|
594
|
-
confidence: SessionConfidence;
|
|
595
|
-
}
|
|
596
|
-
/** Session lifecycle status (v4.2 RFC). */
|
|
597
|
-
type SessionStatus = "running" | "waiting_input" | "idle" | "completed" | "error" | "stale" | "unknown";
|
|
598
|
-
interface SessionLastError {
|
|
599
|
-
runId: string;
|
|
600
|
-
message: string;
|
|
601
|
-
code?: string;
|
|
602
|
-
}
|
|
603
|
-
interface SessionCheckSummary {
|
|
604
|
-
pass: number;
|
|
605
|
-
fail: number;
|
|
606
|
-
warn: number;
|
|
607
|
-
}
|
|
608
|
-
interface EnrichSessionSummaryOptions {
|
|
609
|
-
/** Reference clock for staleness (default Date.now()). */
|
|
610
|
-
nowMs?: number;
|
|
611
|
-
/** Inactivity threshold before marking a session stale (default 24h). */
|
|
612
|
-
staleThresholdMs?: number;
|
|
613
|
-
}
|
|
614
|
-
interface ActivityEntry {
|
|
615
|
-
sessionId: string;
|
|
616
|
-
status: SessionStatus;
|
|
617
|
-
summary: string;
|
|
618
|
-
lastActivity: string;
|
|
619
|
-
runCount: number;
|
|
620
|
-
}
|
|
621
|
-
interface ActivitySummary {
|
|
622
|
-
since: string;
|
|
623
|
-
sessions: number;
|
|
624
|
-
failed: number;
|
|
625
|
-
stale: number;
|
|
626
|
-
guardrailWarnings: number;
|
|
627
|
-
entries: ActivityEntry[];
|
|
628
|
-
}
|
|
629
|
-
interface BuildActivitySummaryOptions {
|
|
630
|
-
/** Duration window (e.g. 7d, 24h). Default 7d. */
|
|
631
|
-
since?: string;
|
|
632
|
-
/** Reference clock (default Date.now()). */
|
|
633
|
-
nowMs?: number;
|
|
634
|
-
/** Max entries returned (default 20). */
|
|
635
|
-
limit?: number;
|
|
636
|
-
}
|
|
637
|
-
interface SessionSummary {
|
|
638
|
-
sessionId: string;
|
|
639
|
-
runIds: string[];
|
|
640
|
-
groups: SessionGroup[];
|
|
641
|
-
handoffs: HandoffEdge[];
|
|
642
|
-
retries: RetryLink[];
|
|
643
|
-
criticalPath: CriticalPathStep[];
|
|
644
|
-
/** Derived session status (v4.2+). */
|
|
645
|
-
status: SessionStatus;
|
|
646
|
-
/** Earliest run start time in the session. */
|
|
647
|
-
startedAt?: number;
|
|
648
|
-
/** Latest run end time when all runs have ended. */
|
|
649
|
-
endedAt?: number;
|
|
650
|
-
/** endedAt - startedAt when both are present. */
|
|
651
|
-
durationMs?: number;
|
|
652
|
-
correlationId?: string;
|
|
653
|
-
jobId?: string;
|
|
654
|
-
workflowId?: string;
|
|
655
|
-
lastError?: SessionLastError;
|
|
656
|
-
/** ISO-8601 timestamp of the most recent run activity. */
|
|
657
|
-
lastActivity: string;
|
|
658
|
-
retryCount: number;
|
|
659
|
-
observationSummary?: string;
|
|
660
|
-
checkSummary?: SessionCheckSummary;
|
|
661
|
-
}
|
|
662
|
-
interface SessionIndex {
|
|
663
|
-
runs: SessionRunRecord[];
|
|
664
|
-
sessions: SessionSummary[];
|
|
665
|
-
unscopedRunIds: string[];
|
|
666
|
-
warnings: SessionWarning[];
|
|
667
|
-
}
|
|
668
|
-
interface BuildSessionIndexOptions {
|
|
669
|
-
/** When true, group runs that share only `groupId` under a synthetic session key. */
|
|
670
|
-
correlateByGroupId?: boolean;
|
|
671
|
-
/** Reference clock for session staleness (v4.2+). */
|
|
672
|
-
nowMs?: number;
|
|
673
|
-
/** Inactivity threshold before marking a session stale (v4.2+, default 24h). */
|
|
674
|
-
staleThresholdMs?: number;
|
|
675
|
-
}
|
|
676
|
-
|
|
677
527
|
/** Extracts session/workflow metadata from a run metadata or attributes bag. */
|
|
678
528
|
declare function extractSessionWorkflowMetadata(record: Record<string, unknown> | undefined): SessionWorkflowMetadata | undefined;
|
|
679
529
|
declare function sessionKeyForRun(meta: SessionWorkflowMetadata | undefined, options?: {
|
|
@@ -1533,4 +1383,36 @@ declare function renderGateGithubStepSummary(result: GateResult): string;
|
|
|
1533
1383
|
declare function renderGateJUnit(result: GateResult): string;
|
|
1534
1384
|
declare function renderGateReport(result: GateResult, options?: RenderGateReportOptions): string;
|
|
1535
1385
|
|
|
1536
|
-
|
|
1386
|
+
/**
|
|
1387
|
+
* Optional omitted-payload digest commitment helpers (6.22).
|
|
1388
|
+
*
|
|
1389
|
+
* A digest proves bytes were observed/omitted; it is not redaction, authorization,
|
|
1390
|
+
* or a secret-management feature. AgentInspect does not hold HMAC keys.
|
|
1391
|
+
*
|
|
1392
|
+
* @experimental Available through `agent-inspect/advanced`.
|
|
1393
|
+
*/
|
|
1394
|
+
type OmittedPayloadAlgorithm = "sha256";
|
|
1395
|
+
/**
|
|
1396
|
+
* Bounded commitment recorded when payload bytes are intentionally omitted.
|
|
1397
|
+
*
|
|
1398
|
+
* @experimental
|
|
1399
|
+
*/
|
|
1400
|
+
interface OmittedPayloadCommitment {
|
|
1401
|
+
algorithm: OmittedPayloadAlgorithm;
|
|
1402
|
+
digest: string;
|
|
1403
|
+
byteLength: number;
|
|
1404
|
+
contentType?: string;
|
|
1405
|
+
shape?: string;
|
|
1406
|
+
capturePolicy: "omitted" | "preview-only" | "digest-only";
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* Build a SHA-256 digest commitment for omitted payload bytes.
|
|
1410
|
+
* Throws if input exceeds the 1 MiB bound.
|
|
1411
|
+
*/
|
|
1412
|
+
declare function createOmittedPayloadCommitment(payload: string | Uint8Array, options?: {
|
|
1413
|
+
contentType?: string;
|
|
1414
|
+
shape?: string;
|
|
1415
|
+
capturePolicy?: OmittedPayloadCommitment["capturePolicy"];
|
|
1416
|
+
}): OmittedPayloadCommitment;
|
|
1417
|
+
|
|
1418
|
+
export { ADAPTER_CAPTURE_DIAGNOSTIC_CODES, ActivitySummary, type AdapterCaptureDiagnostic, type AdapterCaptureDiagnosticCode, type AdapterCaptureDiagnostics, type AdapterCaptureMode, type AdapterDiagnosticListener, type AdapterPreviewCapture, type AdapterPreviewCaptureOptions, type AnalyzeCohortOptions, BuildActivitySummaryOptions, BuildSessionIndexOptions, type BundleCheckResults, type BundleCheckRunResult, type BundleMetadata, type BundlePlaceholderArtifact, type BundleRedactionProfile, type BundleRedactionReport, type BundleRedactionReportRun, type BundleResolveOptions, type BundleResolveResult, type BundleSafeStatus, type BundleSafeStatusMetadata, COHORT_METRIC_IDS, type CausalContractFindingInput, type CausalFailureKind, type CohortAggregateMetrics, type CohortAnalysisResult, type CohortMetricComparison, type CohortMetricId, type CohortRunMetrics, DEFAULT_ADAPTER_MAX_PREVIEW_CHARS, DEFAULT_SUITE_ARTIFACTS_DIR, DEFAULT_SUITE_CONFIG_NAMES, DEFAULT_TRACE_DIR_NAME, type DurationStats, EVIDENCE_ASSESSMENT_NOTE, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, EVIDENCE_VIEW_CSS, EVIDENCE_VIEW_IDS, EnrichSessionSummaryOptions, ErrorInfo, type EvidenceCheckFindingSummary, type EvidenceCiPackageFiles, type EvidenceCiPackageInput, type EvidenceContractsViewInput, type EvidenceFileEntry, type EvidenceFileRole, type EvidenceFormatVersion, type EvidenceHtmlShellInput, type EvidenceManifest, type EvidencePackagedFile, type EvidenceProvenanceViewInput, type EvidenceRedactionProfile, type EvidenceSafeStatus, type EvidenceSafetyViewInput, type EvidenceSourceHash, type EvidenceVerificationPolicy, type EvidenceVerifyIssue, type EvidenceVerifyOptions, type EvidenceVerifyResult, type EvidenceVerifyStatus, type EvidenceViewId, type ExplainFact, type ExplainInference, type ExplainMode, type ExplainOptions, type ExplainResult, FALLBACK_TRACE_DIR, type FindFirstCausalFailureOptions, type FirstCausalFailure, type GateCheckId, type GateCheckResult, type GateExitCode, type GateResult, type GroupSessionCohortsOptions, InspectRunTree, type LoadSuiteConfigOptions, MAX_NAME_LENGTH, MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, ObservedOutcome, type OmittedPayloadAlgorithm, type OmittedPayloadCommitment, type ParseTraceJsonlOptions, type ParseTraceJsonlResult, type ParsedDurationFilter, RUNS_DIR_NAME, RedactionProfile, type RenderCohortReportOptions, type RenderGateReportOptions, type RenderSuiteReportOptions, type RenderTimelineOptions, type RenderWhatOptions, type ResolvedRedactionProfile, type ResolvedSuiteCase, type RunGateOptions, RunStatus, type RunSuiteOptions, RunSummary, type RunTimeline, type RunWhatSummary, SUITE_TEMPLATE_IDS, type SessionCohort, type SessionCohortKind, SessionIndex, SessionRunRecord, type SessionScopeOptions, type SessionScopeResult, SessionStatus, SessionSummary, SessionWarning, 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, type SuiteTemplateId, 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, type ZipEntry, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, assertBundlePathContained, assertEvidenceRelativePath, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceCausalFailureViewHtml, buildEvidenceCiPackage, buildEvidenceCircuitViewHtml, buildEvidenceContractsViewHtml, buildEvidenceDiffViewHtml, buildEvidenceFileEntries, buildEvidenceHtmlShell, buildEvidenceHtmlShellFromManifest, buildEvidenceManifest, buildEvidenceOutcomesViewHtml, buildEvidenceProvenanceViewHtml, buildEvidenceSafetyViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceTreeViewHtml, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, buildZipArchive, bundleFailsOnSafety, bundleRunAssetRelativePath, collectTraceSchemaVersions, compareCohortAggregates, createAdapterPreviewCapture, createOmittedPayloadCommitment, createRunId, createStepId, defaultBundleOutputPath, defaultSuiteConfigTemplate, deriveSessionStatus, encodeEmbeddedEvidenceJson, enrichSessionRunRecord, enrichSessionSummary, ensureTraceDir, extractMetadata, extractOutcomesFromPersistedEvents, extractOutcomesFromTraceEvents, extractSessionWorkflowMetadata, filterMetasBySessionScope, filterTraces, findFirstCausalFailure, formatDuration, formatError, formatStepLabel, formatTerminalName, formatTimestamp, gateHasThresholds, getDefaultTraceDir, getIndent, getRunIdFromTraceFileName, getSuiteTemplate, getTraceFilePath, groupSessionCohorts, inferEvidenceFileRole, initializeTraceFile, isAgentInspectTrace, isSha256Hex, listSuiteTemplates, listTraceFiles, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, normalizeBundleOutputPath, normalizeSuiteConfig, parseCohortMetricList, parseDuration, parseDurationFilter, parseEvidenceManifestJson, parseGateList, parseGateNumber, parseGroupBySpec, parseTraceJsonl, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, readTraceEvents, readTraceFile, renderActivitySummaryHuman, renderCohortReport, renderCohortSummaryMarkdown, renderErrorLine, renderGateGithubStepSummary, renderGateJUnit, renderGateReport, renderGateSummaryMarkdown, renderRunSummary, renderRunWhat, renderStepLine, renderSuiteReport, renderSuiteReportMarkdown, renderTimeline, renderTraceStats, resolveAdapterMaxPreviewChars, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteCaseTrace, resolveSuiteConfigPath, resolveSuiteTemplate, resolveTraceDir, runGate, runSuite, sanitizeBundleRunId, searchTraces, serializeAdapterPreview, serializeEvent, serializeEvidenceManifest, sessionKeyForRun, sha256Equals, sha256Hex, toMetadataSafeStatus, traceMetasToSessionRunRecords, truncateName, unknownTraceFormatMessage, validateEvent, validateEvidenceManifest, validateSuiteConfig, verifyEvidenceDirectory, warn, writeTraceEvent };
|
|
@@ -1,16 +1,17 @@
|
|
|
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-
|
|
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-DOX2-RjH.js';
|
|
2
2
|
import { R as RedactionRule } from './log-config-OZRfpHED.js';
|
|
3
|
-
import { R as RedactionProfile,
|
|
4
|
-
export { A as ActiveStepContext,
|
|
3
|
+
import { R as RedactionProfile, i as TraceEvent, E as ErrorInfo, b as RunStatus, e as StepStatus, k as RunSummary, l as TraceMetadata, T as TraceMetadataStatus, f as StepType, h as TraceCorrelationMetadata } from './types-Bx3mEZ04.js';
|
|
4
|
+
export { A as ActiveStepContext, j 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, g as TokenMetadata, q as TraceEventBase, r as TraceSchemaVersion, s as isStepStatus, t as isStepType, u as isTraceEvent } from './types-Bx3mEZ04.js';
|
|
5
5
|
import { a as InspectRunTree } from './inspect-event-DRthdZlf.js';
|
|
6
6
|
export { A as AttributionConfidence, E as EventSource, c as InspectEvent, I as InspectKind, b as InspectNode } from './inspect-event-DRthdZlf.js';
|
|
7
7
|
import { P as PersistedInspectEvent } from './persisted-inspect-event-BVucFVrP.js';
|
|
8
8
|
import { Stats } from 'node:fs';
|
|
9
|
+
import { S as SessionWorkflowMetadata, al as SessionRunRecord, am as EnrichSessionSummaryOptions, an as SessionStatus, ao as SessionSummary, ap as SessionIndex, aq as BuildActivitySummaryOptions, ar as ActivitySummary, as as SessionWarning, at as BuildSessionIndexOptions, c as TraceCheckResult, P as TraceCheckStatus } from './index-CtK_p-ps.js';
|
|
10
|
+
export { au as ActivityEntry, av as CriticalPathStep, aw as HandoffEdge, ax as RetryLink, ay as SESSION_WORKFLOW_KEYS, az as SessionCheckSummary, aA as SessionConfidence, aB as SessionEdgeSource, aC as SessionGroup, aD as SessionLastError, aE as SessionWorkflowKey } from './index-CtK_p-ps.js';
|
|
9
11
|
import { b as ObservedOutcome } from './types-B562HgN_.js';
|
|
10
12
|
export { O as ObservedOutcomeStatus } from './types-B562HgN_.js';
|
|
11
|
-
import { b as TraceCheckResult, N as TraceCheckStatus } from './index-Bg9ZdsdS.js';
|
|
12
13
|
import './writers.js';
|
|
13
|
-
import './index-
|
|
14
|
+
import './index-D72DPqAF.js';
|
|
14
15
|
|
|
15
16
|
interface ResolvedRedactionProfile {
|
|
16
17
|
profile: RedactionProfile;
|
|
@@ -523,157 +524,6 @@ declare function parseDurationFilter(expr: string): ParsedDurationFilter;
|
|
|
523
524
|
declare function searchTraces(metas: TraceMetadata[], options: TraceSearchOptions): Promise<TraceSearchResult[]>;
|
|
524
525
|
declare function loadTraceMetadataList(_traceDir: string, fileNames: string[], getPath: (fileName: string) => string): Promise<TraceMetadata[]>;
|
|
525
526
|
|
|
526
|
-
/** Known session/workflow metadata keys (v2.4 RFC). */
|
|
527
|
-
declare const SESSION_WORKFLOW_KEYS: readonly ["sessionId", "conversationId", "groupId", "parentGroupId", "attempt", "retryOf", "retryReason", "handoffFrom", "handoffTo", "subAgentId", "subAgentName", "jobId", "queueName", "workflowName", "workflowStep", "toolCallId", "mcpToolCallId", "linkedStepId", "correlationId", "requestId", "decisionId"];
|
|
528
|
-
type SessionWorkflowKey = (typeof SESSION_WORKFLOW_KEYS)[number];
|
|
529
|
-
type SessionConfidence = "explicit" | "correlated" | "heuristic" | "unknown";
|
|
530
|
-
type SessionEdgeSource = "manual" | "adapter" | "json-log" | "log4js" | "mcp-client" | "inferred";
|
|
531
|
-
interface SessionWorkflowMetadata {
|
|
532
|
-
sessionId?: string;
|
|
533
|
-
conversationId?: string;
|
|
534
|
-
groupId?: string;
|
|
535
|
-
parentGroupId?: string;
|
|
536
|
-
attempt?: number;
|
|
537
|
-
retryOf?: string;
|
|
538
|
-
retryReason?: string;
|
|
539
|
-
handoffFrom?: string;
|
|
540
|
-
handoffTo?: string;
|
|
541
|
-
subAgentId?: string;
|
|
542
|
-
subAgentName?: string;
|
|
543
|
-
jobId?: string;
|
|
544
|
-
queueName?: string;
|
|
545
|
-
workflowName?: string;
|
|
546
|
-
workflowStep?: string;
|
|
547
|
-
toolCallId?: string;
|
|
548
|
-
mcpToolCallId?: string;
|
|
549
|
-
linkedStepId?: string;
|
|
550
|
-
correlationId?: string;
|
|
551
|
-
requestId?: string;
|
|
552
|
-
decisionId?: string;
|
|
553
|
-
}
|
|
554
|
-
interface SessionRunRecord {
|
|
555
|
-
runId: string;
|
|
556
|
-
name?: string;
|
|
557
|
-
status?: TraceMetadataStatus;
|
|
558
|
-
startedAt?: number;
|
|
559
|
-
endedAt?: number;
|
|
560
|
-
durationMs?: number;
|
|
561
|
-
filePath?: string;
|
|
562
|
-
metadata?: Record<string, unknown>;
|
|
563
|
-
}
|
|
564
|
-
interface SessionWarning {
|
|
565
|
-
code: string;
|
|
566
|
-
message: string;
|
|
567
|
-
runId?: string;
|
|
568
|
-
sessionId?: string;
|
|
569
|
-
}
|
|
570
|
-
interface HandoffEdge {
|
|
571
|
-
from: string;
|
|
572
|
-
to: string;
|
|
573
|
-
source: SessionEdgeSource;
|
|
574
|
-
confidence: SessionConfidence;
|
|
575
|
-
}
|
|
576
|
-
interface RetryLink {
|
|
577
|
-
runId: string;
|
|
578
|
-
retryOf?: string;
|
|
579
|
-
attempt?: number;
|
|
580
|
-
source: SessionEdgeSource;
|
|
581
|
-
confidence: SessionConfidence;
|
|
582
|
-
}
|
|
583
|
-
interface SessionGroup {
|
|
584
|
-
groupId: string;
|
|
585
|
-
parentGroupId?: string;
|
|
586
|
-
runIds: string[];
|
|
587
|
-
}
|
|
588
|
-
interface CriticalPathStep {
|
|
589
|
-
runId: string;
|
|
590
|
-
name?: string;
|
|
591
|
-
startedAt?: number;
|
|
592
|
-
durationMs?: number;
|
|
593
|
-
source: SessionEdgeSource;
|
|
594
|
-
confidence: SessionConfidence;
|
|
595
|
-
}
|
|
596
|
-
/** Session lifecycle status (v4.2 RFC). */
|
|
597
|
-
type SessionStatus = "running" | "waiting_input" | "idle" | "completed" | "error" | "stale" | "unknown";
|
|
598
|
-
interface SessionLastError {
|
|
599
|
-
runId: string;
|
|
600
|
-
message: string;
|
|
601
|
-
code?: string;
|
|
602
|
-
}
|
|
603
|
-
interface SessionCheckSummary {
|
|
604
|
-
pass: number;
|
|
605
|
-
fail: number;
|
|
606
|
-
warn: number;
|
|
607
|
-
}
|
|
608
|
-
interface EnrichSessionSummaryOptions {
|
|
609
|
-
/** Reference clock for staleness (default Date.now()). */
|
|
610
|
-
nowMs?: number;
|
|
611
|
-
/** Inactivity threshold before marking a session stale (default 24h). */
|
|
612
|
-
staleThresholdMs?: number;
|
|
613
|
-
}
|
|
614
|
-
interface ActivityEntry {
|
|
615
|
-
sessionId: string;
|
|
616
|
-
status: SessionStatus;
|
|
617
|
-
summary: string;
|
|
618
|
-
lastActivity: string;
|
|
619
|
-
runCount: number;
|
|
620
|
-
}
|
|
621
|
-
interface ActivitySummary {
|
|
622
|
-
since: string;
|
|
623
|
-
sessions: number;
|
|
624
|
-
failed: number;
|
|
625
|
-
stale: number;
|
|
626
|
-
guardrailWarnings: number;
|
|
627
|
-
entries: ActivityEntry[];
|
|
628
|
-
}
|
|
629
|
-
interface BuildActivitySummaryOptions {
|
|
630
|
-
/** Duration window (e.g. 7d, 24h). Default 7d. */
|
|
631
|
-
since?: string;
|
|
632
|
-
/** Reference clock (default Date.now()). */
|
|
633
|
-
nowMs?: number;
|
|
634
|
-
/** Max entries returned (default 20). */
|
|
635
|
-
limit?: number;
|
|
636
|
-
}
|
|
637
|
-
interface SessionSummary {
|
|
638
|
-
sessionId: string;
|
|
639
|
-
runIds: string[];
|
|
640
|
-
groups: SessionGroup[];
|
|
641
|
-
handoffs: HandoffEdge[];
|
|
642
|
-
retries: RetryLink[];
|
|
643
|
-
criticalPath: CriticalPathStep[];
|
|
644
|
-
/** Derived session status (v4.2+). */
|
|
645
|
-
status: SessionStatus;
|
|
646
|
-
/** Earliest run start time in the session. */
|
|
647
|
-
startedAt?: number;
|
|
648
|
-
/** Latest run end time when all runs have ended. */
|
|
649
|
-
endedAt?: number;
|
|
650
|
-
/** endedAt - startedAt when both are present. */
|
|
651
|
-
durationMs?: number;
|
|
652
|
-
correlationId?: string;
|
|
653
|
-
jobId?: string;
|
|
654
|
-
workflowId?: string;
|
|
655
|
-
lastError?: SessionLastError;
|
|
656
|
-
/** ISO-8601 timestamp of the most recent run activity. */
|
|
657
|
-
lastActivity: string;
|
|
658
|
-
retryCount: number;
|
|
659
|
-
observationSummary?: string;
|
|
660
|
-
checkSummary?: SessionCheckSummary;
|
|
661
|
-
}
|
|
662
|
-
interface SessionIndex {
|
|
663
|
-
runs: SessionRunRecord[];
|
|
664
|
-
sessions: SessionSummary[];
|
|
665
|
-
unscopedRunIds: string[];
|
|
666
|
-
warnings: SessionWarning[];
|
|
667
|
-
}
|
|
668
|
-
interface BuildSessionIndexOptions {
|
|
669
|
-
/** When true, group runs that share only `groupId` under a synthetic session key. */
|
|
670
|
-
correlateByGroupId?: boolean;
|
|
671
|
-
/** Reference clock for session staleness (v4.2+). */
|
|
672
|
-
nowMs?: number;
|
|
673
|
-
/** Inactivity threshold before marking a session stale (v4.2+, default 24h). */
|
|
674
|
-
staleThresholdMs?: number;
|
|
675
|
-
}
|
|
676
|
-
|
|
677
527
|
/** Extracts session/workflow metadata from a run metadata or attributes bag. */
|
|
678
528
|
declare function extractSessionWorkflowMetadata(record: Record<string, unknown> | undefined): SessionWorkflowMetadata | undefined;
|
|
679
529
|
declare function sessionKeyForRun(meta: SessionWorkflowMetadata | undefined, options?: {
|
|
@@ -1533,4 +1383,36 @@ declare function renderGateGithubStepSummary(result: GateResult): string;
|
|
|
1533
1383
|
declare function renderGateJUnit(result: GateResult): string;
|
|
1534
1384
|
declare function renderGateReport(result: GateResult, options?: RenderGateReportOptions): string;
|
|
1535
1385
|
|
|
1536
|
-
|
|
1386
|
+
/**
|
|
1387
|
+
* Optional omitted-payload digest commitment helpers (6.22).
|
|
1388
|
+
*
|
|
1389
|
+
* A digest proves bytes were observed/omitted; it is not redaction, authorization,
|
|
1390
|
+
* or a secret-management feature. AgentInspect does not hold HMAC keys.
|
|
1391
|
+
*
|
|
1392
|
+
* @experimental Available through `agent-inspect/advanced`.
|
|
1393
|
+
*/
|
|
1394
|
+
type OmittedPayloadAlgorithm = "sha256";
|
|
1395
|
+
/**
|
|
1396
|
+
* Bounded commitment recorded when payload bytes are intentionally omitted.
|
|
1397
|
+
*
|
|
1398
|
+
* @experimental
|
|
1399
|
+
*/
|
|
1400
|
+
interface OmittedPayloadCommitment {
|
|
1401
|
+
algorithm: OmittedPayloadAlgorithm;
|
|
1402
|
+
digest: string;
|
|
1403
|
+
byteLength: number;
|
|
1404
|
+
contentType?: string;
|
|
1405
|
+
shape?: string;
|
|
1406
|
+
capturePolicy: "omitted" | "preview-only" | "digest-only";
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* Build a SHA-256 digest commitment for omitted payload bytes.
|
|
1410
|
+
* Throws if input exceeds the 1 MiB bound.
|
|
1411
|
+
*/
|
|
1412
|
+
declare function createOmittedPayloadCommitment(payload: string | Uint8Array, options?: {
|
|
1413
|
+
contentType?: string;
|
|
1414
|
+
shape?: string;
|
|
1415
|
+
capturePolicy?: OmittedPayloadCommitment["capturePolicy"];
|
|
1416
|
+
}): OmittedPayloadCommitment;
|
|
1417
|
+
|
|
1418
|
+
export { ADAPTER_CAPTURE_DIAGNOSTIC_CODES, ActivitySummary, type AdapterCaptureDiagnostic, type AdapterCaptureDiagnosticCode, type AdapterCaptureDiagnostics, type AdapterCaptureMode, type AdapterDiagnosticListener, type AdapterPreviewCapture, type AdapterPreviewCaptureOptions, type AnalyzeCohortOptions, BuildActivitySummaryOptions, BuildSessionIndexOptions, type BundleCheckResults, type BundleCheckRunResult, type BundleMetadata, type BundlePlaceholderArtifact, type BundleRedactionProfile, type BundleRedactionReport, type BundleRedactionReportRun, type BundleResolveOptions, type BundleResolveResult, type BundleSafeStatus, type BundleSafeStatusMetadata, COHORT_METRIC_IDS, type CausalContractFindingInput, type CausalFailureKind, type CohortAggregateMetrics, type CohortAnalysisResult, type CohortMetricComparison, type CohortMetricId, type CohortRunMetrics, DEFAULT_ADAPTER_MAX_PREVIEW_CHARS, DEFAULT_SUITE_ARTIFACTS_DIR, DEFAULT_SUITE_CONFIG_NAMES, DEFAULT_TRACE_DIR_NAME, type DurationStats, EVIDENCE_ASSESSMENT_NOTE, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, EVIDENCE_VIEW_CSS, EVIDENCE_VIEW_IDS, EnrichSessionSummaryOptions, ErrorInfo, type EvidenceCheckFindingSummary, type EvidenceCiPackageFiles, type EvidenceCiPackageInput, type EvidenceContractsViewInput, type EvidenceFileEntry, type EvidenceFileRole, type EvidenceFormatVersion, type EvidenceHtmlShellInput, type EvidenceManifest, type EvidencePackagedFile, type EvidenceProvenanceViewInput, type EvidenceRedactionProfile, type EvidenceSafeStatus, type EvidenceSafetyViewInput, type EvidenceSourceHash, type EvidenceVerificationPolicy, type EvidenceVerifyIssue, type EvidenceVerifyOptions, type EvidenceVerifyResult, type EvidenceVerifyStatus, type EvidenceViewId, type ExplainFact, type ExplainInference, type ExplainMode, type ExplainOptions, type ExplainResult, FALLBACK_TRACE_DIR, type FindFirstCausalFailureOptions, type FirstCausalFailure, type GateCheckId, type GateCheckResult, type GateExitCode, type GateResult, type GroupSessionCohortsOptions, InspectRunTree, type LoadSuiteConfigOptions, MAX_NAME_LENGTH, MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, ObservedOutcome, type OmittedPayloadAlgorithm, type OmittedPayloadCommitment, type ParseTraceJsonlOptions, type ParseTraceJsonlResult, type ParsedDurationFilter, RUNS_DIR_NAME, RedactionProfile, type RenderCohortReportOptions, type RenderGateReportOptions, type RenderSuiteReportOptions, type RenderTimelineOptions, type RenderWhatOptions, type ResolvedRedactionProfile, type ResolvedSuiteCase, type RunGateOptions, RunStatus, type RunSuiteOptions, RunSummary, type RunTimeline, type RunWhatSummary, SUITE_TEMPLATE_IDS, type SessionCohort, type SessionCohortKind, SessionIndex, SessionRunRecord, type SessionScopeOptions, type SessionScopeResult, SessionStatus, SessionSummary, SessionWarning, 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, type SuiteTemplateId, 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, type ZipEntry, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, assertBundlePathContained, assertEvidenceRelativePath, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceCausalFailureViewHtml, buildEvidenceCiPackage, buildEvidenceCircuitViewHtml, buildEvidenceContractsViewHtml, buildEvidenceDiffViewHtml, buildEvidenceFileEntries, buildEvidenceHtmlShell, buildEvidenceHtmlShellFromManifest, buildEvidenceManifest, buildEvidenceOutcomesViewHtml, buildEvidenceProvenanceViewHtml, buildEvidenceSafetyViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceTreeViewHtml, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, buildZipArchive, bundleFailsOnSafety, bundleRunAssetRelativePath, collectTraceSchemaVersions, compareCohortAggregates, createAdapterPreviewCapture, createOmittedPayloadCommitment, createRunId, createStepId, defaultBundleOutputPath, defaultSuiteConfigTemplate, deriveSessionStatus, encodeEmbeddedEvidenceJson, enrichSessionRunRecord, enrichSessionSummary, ensureTraceDir, extractMetadata, extractOutcomesFromPersistedEvents, extractOutcomesFromTraceEvents, extractSessionWorkflowMetadata, filterMetasBySessionScope, filterTraces, findFirstCausalFailure, formatDuration, formatError, formatStepLabel, formatTerminalName, formatTimestamp, gateHasThresholds, getDefaultTraceDir, getIndent, getRunIdFromTraceFileName, getSuiteTemplate, getTraceFilePath, groupSessionCohorts, inferEvidenceFileRole, initializeTraceFile, isAgentInspectTrace, isSha256Hex, listSuiteTemplates, listTraceFiles, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, normalizeBundleOutputPath, normalizeSuiteConfig, parseCohortMetricList, parseDuration, parseDurationFilter, parseEvidenceManifestJson, parseGateList, parseGateNumber, parseGroupBySpec, parseTraceJsonl, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, readTraceEvents, readTraceFile, renderActivitySummaryHuman, renderCohortReport, renderCohortSummaryMarkdown, renderErrorLine, renderGateGithubStepSummary, renderGateJUnit, renderGateReport, renderGateSummaryMarkdown, renderRunSummary, renderRunWhat, renderStepLine, renderSuiteReport, renderSuiteReportMarkdown, renderTimeline, renderTraceStats, resolveAdapterMaxPreviewChars, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteCaseTrace, resolveSuiteConfigPath, resolveSuiteTemplate, resolveTraceDir, runGate, runSuite, sanitizeBundleRunId, searchTraces, serializeAdapterPreview, serializeEvent, serializeEvidenceManifest, sessionKeyForRun, sha256Equals, sha256Hex, toMetadataSafeStatus, traceMetasToSessionRunRecords, truncateName, unknownTraceFormatMessage, validateEvent, validateEvidenceManifest, validateSuiteConfig, verifyEvidenceDirectory, warn, writeTraceEvent };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { runTraceChecks, createRunStatusRule, createToolUsageRule, createRunDurationRule, createLlmUsageRule, createObservedOutcomeRule } from './chunk-
|
|
2
|
-
export {
|
|
1
|
+
import { extractSessionWorkflowMetadata, sessionKeyForRun, runTraceChecks, createRunStatusRule, createToolUsageRule, createRunDurationRule, createLlmUsageRule, createObservedOutcomeRule } from './chunk-OG3GAWCX.mjs';
|
|
2
|
+
export { extractSessionWorkflowMetadata, sessionKeyForRun } from './chunk-OG3GAWCX.mjs';
|
|
3
|
+
export { MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, TERMINAL_INDENT, TraceDirectory, createInspector, createInspectorRuntime, formatTerminalName, getCurrentContext, getCurrentCorrelationMetadata, getCurrentDepth, getCurrentRunId, getCurrentRunName, getCurrentStepId, getIndent, getParentStepId, getTraceDirFromContext, getTraceSafetyFromContext, hasActiveContext, isAgentInspectEnabled, isSilentContext, maybeInspectRun, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, renderErrorLine, renderRunSummary, renderStepLine, resolveTraceDir, runWithContext, runWithStepContext } from './chunk-WGDSM37E.mjs';
|
|
3
4
|
import { buildRunTimeline, filterTraces, extractMetadata, buildRunSummary } from './chunk-JBNRJLIV.mjs';
|
|
4
5
|
export { buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildTraceStats, extractMetadata, filterTraces, formatStepLabel, renderRunWhat, renderTimeline, renderTraceStats } from './chunk-JBNRJLIV.mjs';
|
|
5
|
-
import { extractOutcomesFromTraceEvents, parseObservationFilter, summarizeObservedOutcomes, extractOutcomesFromPersistedEvents, renderObservedOutcomesHtml } from './chunk-
|
|
6
|
-
export { extractOutcomesFromPersistedEvents, extractOutcomesFromTraceEvents } from './chunk-
|
|
6
|
+
import { extractOutcomesFromTraceEvents, parseObservationFilter, summarizeObservedOutcomes, extractOutcomesFromPersistedEvents, renderObservedOutcomesHtml } from './chunk-R4SSYU6D.mjs';
|
|
7
|
+
export { extractOutcomesFromPersistedEvents, extractOutcomesFromTraceEvents } from './chunk-R4SSYU6D.mjs';
|
|
7
8
|
import { diffTraceEvents, renderRunDiff } from './chunk-F7STQ5JF.mjs';
|
|
8
9
|
import './chunk-BT7CATSD.mjs';
|
|
9
10
|
import { escapeHtml, flattenTree } from './chunk-CAWPF22J.mjs';
|
|
10
11
|
import { resolveRedactionProfile, readTraceEventsFromFile } from './chunk-U25RHRSU.mjs';
|
|
11
12
|
export { DEFAULT_MAX_EVENT_BYTES, DEFAULT_MAX_METADATA_VALUE_LENGTH, DEFAULT_MAX_PREVIEW_LENGTH, getRunIdFromTraceFileName, initializeTraceFile, listTraceFiles, prepareMetadataForDisk, prepareTraceEventForDisk, readTraceEvents, readTraceFile, resolveRedactionProfile, resolveTraceSafetyOptions, serializeEvent, validateEvent, writeTraceEvent } from './chunk-U25RHRSU.mjs';
|
|
12
13
|
import { Redactor } from './chunk-VU6O5QAH.mjs';
|
|
13
|
-
import { openTrace } from './chunk-
|
|
14
|
+
import { openTrace } from './chunk-NDRMIL7Z.mjs';
|
|
14
15
|
import './chunk-FWK3Q3OJ.mjs';
|
|
15
16
|
import './chunk-NXQF73EC.mjs';
|
|
16
17
|
import './chunk-S4YWKV4G.mjs';
|
|
@@ -725,61 +726,6 @@ async function loadTraceMetadataList(_traceDir, fileNames, getPath) {
|
|
|
725
726
|
return metas;
|
|
726
727
|
}
|
|
727
728
|
|
|
728
|
-
// packages/core/src/sessions/metadata.ts
|
|
729
|
-
function isNonEmptyString(value) {
|
|
730
|
-
return typeof value === "string" && value.trim() !== "";
|
|
731
|
-
}
|
|
732
|
-
function finitePositiveInt(value) {
|
|
733
|
-
if (typeof value !== "number" || !Number.isFinite(value) || value < 1) {
|
|
734
|
-
return void 0;
|
|
735
|
-
}
|
|
736
|
-
return Math.trunc(value);
|
|
737
|
-
}
|
|
738
|
-
function extractSessionWorkflowMetadata(record) {
|
|
739
|
-
if (!record) return void 0;
|
|
740
|
-
const out = {};
|
|
741
|
-
let found = false;
|
|
742
|
-
const assignString = (key, value) => {
|
|
743
|
-
if (isNonEmptyString(value)) {
|
|
744
|
-
out[key] = value.trim();
|
|
745
|
-
found = true;
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
assignString("sessionId", record.sessionId);
|
|
749
|
-
assignString("conversationId", record.conversationId);
|
|
750
|
-
assignString("groupId", record.groupId);
|
|
751
|
-
assignString("parentGroupId", record.parentGroupId);
|
|
752
|
-
assignString("retryOf", record.retryOf);
|
|
753
|
-
assignString("retryReason", record.retryReason);
|
|
754
|
-
assignString("handoffFrom", record.handoffFrom);
|
|
755
|
-
assignString("handoffTo", record.handoffTo);
|
|
756
|
-
assignString("subAgentId", record.subAgentId);
|
|
757
|
-
assignString("subAgentName", record.subAgentName);
|
|
758
|
-
assignString("jobId", record.jobId);
|
|
759
|
-
assignString("queueName", record.queueName);
|
|
760
|
-
assignString("workflowName", record.workflowName);
|
|
761
|
-
assignString("workflowStep", record.workflowStep);
|
|
762
|
-
assignString("toolCallId", record.toolCallId);
|
|
763
|
-
assignString("mcpToolCallId", record.mcpToolCallId);
|
|
764
|
-
assignString("linkedStepId", record.linkedStepId);
|
|
765
|
-
assignString("correlationId", record.correlationId);
|
|
766
|
-
assignString("requestId", record.requestId);
|
|
767
|
-
assignString("decisionId", record.decisionId);
|
|
768
|
-
const attempt = finitePositiveInt(record.attempt);
|
|
769
|
-
if (attempt !== void 0) {
|
|
770
|
-
out.attempt = attempt;
|
|
771
|
-
found = true;
|
|
772
|
-
}
|
|
773
|
-
return found ? out : void 0;
|
|
774
|
-
}
|
|
775
|
-
function sessionKeyForRun(meta, options) {
|
|
776
|
-
if (meta?.sessionId) return meta.sessionId;
|
|
777
|
-
if (options?.correlateByGroupId && meta?.groupId) {
|
|
778
|
-
return `group:${meta.groupId}`;
|
|
779
|
-
}
|
|
780
|
-
return void 0;
|
|
781
|
-
}
|
|
782
|
-
|
|
783
729
|
// packages/core/src/sessions/status.ts
|
|
784
730
|
var DEFAULT_STALE_THRESHOLD_MS = 864e5;
|
|
785
731
|
var EXPLICIT_STATUS_PRIORITY = {
|
|
@@ -1047,6 +993,11 @@ var SESSION_WORKFLOW_KEYS = [
|
|
|
1047
993
|
"toolCallId",
|
|
1048
994
|
"mcpToolCallId",
|
|
1049
995
|
"linkedStepId",
|
|
996
|
+
"operationId",
|
|
997
|
+
"attemptId",
|
|
998
|
+
"attemptNumber",
|
|
999
|
+
"fallbackOf",
|
|
1000
|
+
"idempotencyKey",
|
|
1050
1001
|
"correlationId",
|
|
1051
1002
|
"requestId",
|
|
1052
1003
|
"decisionId"
|
|
@@ -4587,7 +4538,30 @@ function renderGateReport(result, options = {}) {
|
|
|
4587
4538
|
if (format === "github") return renderGateGithubStepSummary(result);
|
|
4588
4539
|
return renderGateSummaryMarkdown(result);
|
|
4589
4540
|
}
|
|
4541
|
+
var MAX_DIGEST_INPUT_BYTES = 1024 * 1024;
|
|
4542
|
+
function toBytes2(value) {
|
|
4543
|
+
if (typeof value === "string") {
|
|
4544
|
+
return Buffer.from(value, "utf8");
|
|
4545
|
+
}
|
|
4546
|
+
return Buffer.from(value);
|
|
4547
|
+
}
|
|
4548
|
+
function createOmittedPayloadCommitment(payload, options = {}) {
|
|
4549
|
+
const bytes = toBytes2(payload);
|
|
4550
|
+
if (bytes.byteLength > MAX_DIGEST_INPUT_BYTES) {
|
|
4551
|
+
throw new RangeError(
|
|
4552
|
+
`Omitted payload exceeds ${MAX_DIGEST_INPUT_BYTES} byte digest bound.`
|
|
4553
|
+
);
|
|
4554
|
+
}
|
|
4555
|
+
return {
|
|
4556
|
+
algorithm: "sha256",
|
|
4557
|
+
digest: createHash("sha256").update(bytes).digest("hex"),
|
|
4558
|
+
byteLength: bytes.byteLength,
|
|
4559
|
+
...options.contentType !== void 0 ? { contentType: options.contentType } : {},
|
|
4560
|
+
...options.shape !== void 0 ? { shape: options.shape } : {},
|
|
4561
|
+
capturePolicy: options.capturePolicy ?? "digest-only"
|
|
4562
|
+
};
|
|
4563
|
+
}
|
|
4590
4564
|
|
|
4591
|
-
export { ADAPTER_CAPTURE_DIAGNOSTIC_CODES, COHORT_METRIC_IDS, DEFAULT_ADAPTER_MAX_PREVIEW_CHARS, DEFAULT_SUITE_ARTIFACTS_DIR, DEFAULT_SUITE_CONFIG_NAMES, EVIDENCE_ASSESSMENT_NOTE, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, EVIDENCE_VIEW_CSS, EVIDENCE_VIEW_IDS, SESSION_WORKFLOW_KEYS, SUITE_TEMPLATE_IDS, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, assertBundlePathContained, assertEvidenceRelativePath, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceCausalFailureViewHtml, buildEvidenceCiPackage, buildEvidenceCircuitViewHtml, buildEvidenceContractsViewHtml, buildEvidenceDiffViewHtml, buildEvidenceFileEntries, buildEvidenceHtmlShell, buildEvidenceHtmlShellFromManifest, buildEvidenceManifest, buildEvidenceOutcomesViewHtml, buildEvidenceProvenanceViewHtml, buildEvidenceSafetyViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceTreeViewHtml, buildLocalExplanation, buildPlaceholderArtifact, buildSessionIndex, buildZipArchive, bundleFailsOnSafety, bundleRunAssetRelativePath, collectTraceSchemaVersions, compareCohortAggregates, createAdapterPreviewCapture, defaultBundleOutputPath, defaultSuiteConfigTemplate, deriveSessionStatus, encodeEmbeddedEvidenceJson, enrichSessionRunRecord, enrichSessionSummary,
|
|
4565
|
+
export { ADAPTER_CAPTURE_DIAGNOSTIC_CODES, COHORT_METRIC_IDS, DEFAULT_ADAPTER_MAX_PREVIEW_CHARS, DEFAULT_SUITE_ARTIFACTS_DIR, DEFAULT_SUITE_CONFIG_NAMES, EVIDENCE_ASSESSMENT_NOTE, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, EVIDENCE_VIEW_CSS, EVIDENCE_VIEW_IDS, SESSION_WORKFLOW_KEYS, SUITE_TEMPLATE_IDS, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, assertBundlePathContained, assertEvidenceRelativePath, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceCausalFailureViewHtml, buildEvidenceCiPackage, buildEvidenceCircuitViewHtml, buildEvidenceContractsViewHtml, buildEvidenceDiffViewHtml, buildEvidenceFileEntries, buildEvidenceHtmlShell, buildEvidenceHtmlShellFromManifest, buildEvidenceManifest, buildEvidenceOutcomesViewHtml, buildEvidenceProvenanceViewHtml, buildEvidenceSafetyViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceTreeViewHtml, buildLocalExplanation, buildPlaceholderArtifact, buildSessionIndex, buildZipArchive, bundleFailsOnSafety, bundleRunAssetRelativePath, collectTraceSchemaVersions, compareCohortAggregates, createAdapterPreviewCapture, createOmittedPayloadCommitment, defaultBundleOutputPath, defaultSuiteConfigTemplate, deriveSessionStatus, encodeEmbeddedEvidenceJson, enrichSessionRunRecord, enrichSessionSummary, filterMetasBySessionScope, findFirstCausalFailure, gateHasThresholds, getSuiteTemplate, groupSessionCohorts, inferEvidenceFileRole, isAgentInspectTrace, isSha256Hex, listSuiteTemplates, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, normalizeBundleOutputPath, normalizeSuiteConfig, parseCohortMetricList, parseDurationFilter, parseEvidenceManifestJson, parseGateList, parseGateNumber, parseGroupBySpec, renderActivitySummaryHuman, renderCohortReport, renderCohortSummaryMarkdown, renderGateGithubStepSummary, renderGateJUnit, renderGateReport, renderGateSummaryMarkdown, renderSuiteReport, renderSuiteReportMarkdown, resolveAdapterMaxPreviewChars, resolveBundleRunIds, resolveSuiteCaseTrace, resolveSuiteConfigPath, resolveSuiteTemplate, runGate, runSuite, sanitizeBundleRunId, searchTraces, serializeAdapterPreview, serializeEvidenceManifest, sha256Equals, sha256Hex, toMetadataSafeStatus, traceMetasToSessionRunRecords, validateEvidenceManifest, validateSuiteConfig, verifyEvidenceDirectory };
|
|
4592
4566
|
//# sourceMappingURL=advanced.mjs.map
|
|
4593
4567
|
//# sourceMappingURL=advanced.mjs.map
|