import { a as InspectRunTree, e as InspectNode } from './inspect-event-ClM5Z8om.js'; import { R as RedactionProfile, h as TraceEvent } from './types-BX1EPji1.js'; import './log-config-DAV_sR9A.js'; /** * v0.7 local export formats. No sinks — string output only. */ type ExportFormat = "markdown" | "html" | "openinference" | "otlp-json"; interface ExportOptions { format: ExportFormat; includeMetadata?: boolean; includeAttributes?: boolean; includeErrors?: boolean; pretty?: boolean; redacted?: boolean; maxAttributeLength?: number; /** * Redaction preset for exported copies. Default `local`. * `share` and `strict` apply stronger key-based redaction before rendering. */ redactionProfile?: RedactionProfile; } interface ExportResult { format: ExportFormat; content: string; contentType: string; fileExtension: string; warnings: string[]; } interface ExportValidationResult { ok: boolean; format: ExportFormat; errors: string[]; warnings: string[]; } interface TraceExporter { name: string; format: ExportFormat; export(tree: InspectRunTree, options?: Partial): ExportResult; validate?(content: string): ExportValidationResult; } /** Library version string embedded in JSON exports (human-readable, not semver guarantee for formats). */ declare const EXPORT_PAYLOAD_VERSION = "0.1.2"; declare function safeString(value: unknown, maxLength?: number): string; /** Escape markdown table pipes and normalize line breaks for safe inline text. */ declare function escapeMarkdown(value: string): string; declare function escapeHtml(value: string): string; declare function stableJson(value: unknown, pretty?: boolean): string; declare function compactAttributes(attrs: Record | undefined, options?: { maxLength?: number; redacted?: boolean; }): Record; declare function summarizeTree(tree: InspectRunTree): Record; /** Depth-first pre-order flatten (matches typical tree display). */ declare function flattenTree(tree: InspectRunTree): InspectNode[]; /** * Build an {@link InspectRunTree} from v0.1 JSONL {@link TraceEvent} rows (manual tracing). * Does not mutate the input array or event objects. */ declare function manualTraceEventsToRunTree(events: TraceEvent[]): InspectRunTree; declare function exportMarkdown(tree: InspectRunTree, options?: Partial): ExportResult; declare function exportHtml(tree: InspectRunTree, options?: Partial): ExportResult; interface OpenInferenceSpan { trace_id: string; span_id: string; parent_span_id?: string; name: string; /** Decimal string: epoch-nanosecond values exceed Number.MAX_SAFE_INTEGER. */ start_time_unix_nano: string; end_time_unix_nano?: string; attributes: Record; status?: { code: "OK" | "ERROR" | "UNSET"; message?: string; }; } interface OpenInferenceExport { exporter: "agent-inspect"; format: "openinference"; compatibility: "openinference-compatible"; version: string; trace_id: string; spans: OpenInferenceSpan[]; warnings: string[]; } declare function exportOpenInference(tree: InspectRunTree, options?: Partial): ExportResult; declare function exportOtlpJson(tree: InspectRunTree, options?: Partial): ExportResult; declare function validateExportContent(format: ExportFormat, content: string): ExportValidationResult; /** Validate committed or exported OpenInference-compatible JSON fixtures. */ declare function validateOpenInferenceFixture(content: string): ExportValidationResult; /** Validate committed or exported OTLP JSON fixtures. */ declare function validateOtlpJsonFixture(content: string): ExportValidationResult; /** * Semantic field checks beyond shape validation for standards fixtures. */ declare function validateOpenInferenceSemanticFixture(content: string): ExportValidationResult; declare function validateOtlpJsonSemanticFixture(content: string): ExportValidationResult; /** * Documented OpenTelemetry GenAI semantic convention reference for OTLP JSON exports. * Local mapping only — no OTel SDK dependency in core. * * Declared `attributes` must match keys the exporter can emit. Do not list * prompt/completion bodies here — AgentInspect never exports them on this path. */ declare const OTEL_GEN_AI_SEMCONV_PIN: { /** Human-readable pin label recorded in export metadata and docs. */ readonly version: "1.36.0"; /** Public spec URL for maintainers validating attribute names. */ readonly specUrl: "https://opentelemetry.io/docs/specs/semconv/gen-ai/"; /** GenAI attribute keys the AgentInspect OTLP JSON exporter may emit. */ readonly attributes: readonly ["gen_ai.operation.name", "gen_ai.request.model", "gen_ai.usage.input_tokens", "gen_ai.usage.output_tokens"]; /** * Non-GenAI attribute key prefixes intentionally emitted alongside GenAI pins. * Any other `gen_ai.*` key in export output is an undocumented extension. */ readonly documentedExtensionPrefixes: readonly ["agent_inspect."]; /** Explicitly never emitted (safety + honesty). */ readonly neverEmitted: readonly ["gen_ai.prompt", "gen_ai.completion"]; }; interface RedactRunTreeForExportOptions { redactionProfile?: RedactionProfile; } /** * Returns a deep copy of `tree` with profile-based redaction applied to event attributes. * Does not mutate the input tree. */ declare function redactRunTreeForExport(tree: InspectRunTree, options?: RedactRunTreeForExportOptions): InspectRunTree; declare function mergeExportDefaults(options: ExportOptions): ExportOptions; /** * @experimental Compatibility-oriented export API. Exports are local-only and do not upload anywhere. * Subject to refinement before a future stability declaration. */ declare function exportRunTree(tree: InspectRunTree, options: ExportOptions): ExportResult; declare function validateExport(result: ExportResult): ExportValidationResult; type ReportFormat = "markdown" | "html"; type ReportSection = "all" | "observations" | "what" | "timeline" | "tree"; interface ReportOptions { format: ReportFormat; includeAttributes?: boolean; includeErrors?: boolean; redactionProfile?: RedactionProfile; /** Include correlation ids in the what section (default true). */ correlation?: boolean; /** Limit output to one section (`observations` shows observed outcomes only). */ section?: ReportSection; } interface ReportResult { format: ReportFormat; content: string; contentType: string; fileExtension: string; } /** * Build a local inspection report (markdown or HTML) from v0.1 trace events. * Composes `what`, timeline, and execution-tree sections. */ declare function buildRunReport(events: TraceEvent[], options: ReportOptions): ReportResult; export { EXPORT_PAYLOAD_VERSION, type ExportFormat, type ExportOptions, type ExportResult, type ExportValidationResult, OTEL_GEN_AI_SEMCONV_PIN, type OpenInferenceExport, type OpenInferenceSpan, type ReportFormat, type ReportOptions, type ReportResult, type TraceExporter, buildRunReport, compactAttributes, escapeHtml, escapeMarkdown, exportHtml, exportMarkdown, exportOpenInference, exportOtlpJson, exportRunTree, flattenTree, manualTraceEventsToRunTree, mergeExportDefaults, redactRunTreeForExport, safeString, stableJson, summarizeTree, validateExport, validateExportContent, validateOpenInferenceFixture, validateOpenInferenceSemanticFixture, validateOtlpJsonFixture, validateOtlpJsonSemanticFixture };