agent-inspect 0.1.2 → 1.0.1

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.
@@ -1,3 +1,5 @@
1
+ import { Stats } from 'node:fs';
2
+
1
3
  /**
2
4
  * Discriminator for what kind of work a {@link Step} represents.
3
5
  * `"decision"` captures agent branching/choices; other values cover runs, LLM calls, tools, and user-defined steps.
@@ -61,6 +63,44 @@ interface Step {
61
63
  }
62
64
  /** Version of the JSONL trace line schema consumed by AgentInspect tooling. */
63
65
  type TraceSchemaVersion = "0.1";
66
+ /**
67
+ * Status for lightweight trace metadata extraction.
68
+ * `"unknown"` means the file contained valid events but a run status could not be determined safely.
69
+ */
70
+ type TraceMetadataStatus = "success" | "error" | "running" | "unknown";
71
+ interface TraceMetadata {
72
+ runId: string;
73
+ name?: string;
74
+ status: TraceMetadataStatus;
75
+ startedAt?: number;
76
+ endedAt?: number;
77
+ durationMs?: number;
78
+ eventCount: number;
79
+ filePath: string;
80
+ fileSize: number;
81
+ createdAt: Date;
82
+ }
83
+ interface RunSummary {
84
+ runId: string;
85
+ name?: string;
86
+ status: TraceMetadataStatus;
87
+ durationMs?: number;
88
+ totalSteps: number;
89
+ llmSteps: number;
90
+ toolSteps: number;
91
+ logicSteps: number;
92
+ errorSteps: number;
93
+ maxDepth: number;
94
+ longestStep?: {
95
+ name: string;
96
+ durationMs: number;
97
+ type: string;
98
+ };
99
+ totalTokens?: {
100
+ input: number;
101
+ output: number;
102
+ };
103
+ }
64
104
  /** Fields shared by every persisted trace event line. */
65
105
  interface TraceEventBase {
66
106
  schemaVersion: TraceSchemaVersion;
@@ -150,6 +190,207 @@ declare function isStepStatus(value: unknown): value is StepStatus;
150
190
  */
151
191
  declare function isTraceEvent(value: unknown): value is TraceEvent;
152
192
 
193
+ type AttributionConfidence = "explicit" | "correlated" | "heuristic" | "unknown";
194
+ type InspectKind = "RUN" | "AGENT" | "LLM" | "TOOL" | "CHAIN" | "RETRIEVER" | "DECISION" | "RESULT" | "ERROR" | "LOGIC" | "LOG";
195
+ interface EventSource {
196
+ type: "manual" | "json-log" | "log4js" | "pino" | "winston" | "adapter";
197
+ file?: string;
198
+ line?: number;
199
+ }
200
+ interface InspectEvent {
201
+ eventId: string;
202
+ runId: string;
203
+ parentId?: string;
204
+ name: string;
205
+ kind: InspectKind;
206
+ timestamp: number;
207
+ status?: "running" | "ok" | "error";
208
+ durationMs?: number;
209
+ attributes?: Record<string, unknown>;
210
+ confidence: AttributionConfidence;
211
+ source: EventSource;
212
+ }
213
+ interface InspectNode {
214
+ event: InspectEvent;
215
+ children: InspectNode[];
216
+ depth: number;
217
+ }
218
+ interface InspectRunTree {
219
+ runId: string;
220
+ name?: string;
221
+ status?: "running" | "ok" | "error";
222
+ startedAt?: number;
223
+ endedAt?: number;
224
+ durationMs?: number;
225
+ children: InspectNode[];
226
+ metadata: {
227
+ totalEvents: number;
228
+ confidenceBreakdown: Record<AttributionConfidence, number>;
229
+ kinds: Record<InspectKind, number>;
230
+ };
231
+ }
232
+
233
+ interface LogEventMapping {
234
+ kind?: InspectKind;
235
+ name?: string;
236
+ parent?: string;
237
+ status?: "running" | "ok" | "error";
238
+ startsRun?: boolean;
239
+ endsRun?: boolean;
240
+ startsStep?: boolean;
241
+ endsStep?: boolean;
242
+ }
243
+ type RedactionStrategy = "full" | "prefix" | "hash";
244
+ type RedactionRule = string | {
245
+ key: string;
246
+ strategy: RedactionStrategy;
247
+ keep?: number;
248
+ };
249
+ interface LogIngestConfig {
250
+ runIdKeys: string[];
251
+ eventKey: string;
252
+ timestampKey?: string;
253
+ messageKey?: string;
254
+ levelKey?: string;
255
+ parentIdKey?: string;
256
+ durationKey?: string;
257
+ statusKey?: string;
258
+ mappings?: Record<string, LogEventMapping>;
259
+ redact?: RedactionRule[];
260
+ heuristicWindowMs?: number;
261
+ }
262
+
263
+ type ParserWarningCode = "MALFORMED_JSON" | "MISSING_RUN_ID" | "MISSING_EVENT" | "MISSING_TIMESTAMP" | "UNSUPPORTED_LOG4JS_PAYLOAD" | "CONFIG_ERROR" | "UNKNOWN";
264
+ interface ParserWarning {
265
+ code: ParserWarningCode;
266
+ message: string;
267
+ file?: string;
268
+ line?: number;
269
+ raw?: string;
270
+ }
271
+ interface ParseResult<T> {
272
+ records: T[];
273
+ warnings: ParserWarning[];
274
+ }
275
+
276
+ declare const DEFAULT_LOG_INGEST_CONFIG: LogIngestConfig;
277
+ declare function mergeLogIngestConfig(base: LogIngestConfig, override: Partial<LogIngestConfig>): LogIngestConfig;
278
+ declare function loadLogIngestConfig(configPath?: string): Promise<LogIngestConfig>;
279
+
280
+ interface RawLogRecord {
281
+ raw: Record<string, unknown>;
282
+ file?: string;
283
+ line: number;
284
+ sourceType: "json-log" | "log4js";
285
+ }
286
+
287
+ declare class JsonLogParser {
288
+ parseLines(lines: string[], filePath?: string): ParseResult<RawLogRecord>;
289
+ parseFile(filePath: string): Promise<ParseResult<RawLogRecord>>;
290
+ }
291
+
292
+ declare class Log4jsParser {
293
+ parseLines(lines: string[], filePath?: string): ParseResult<RawLogRecord>;
294
+ parseFile(filePath: string): Promise<ParseResult<RawLogRecord>>;
295
+ }
296
+
297
+ declare function wildcardMatch(pattern: string, value: string): boolean;
298
+ declare function matchMapping(eventName: string, mappings?: Record<string, LogEventMapping>): LogEventMapping | undefined;
299
+
300
+ declare const DEFAULT_REDACT_KEYS: readonly ["authorization", "cookie", "token", "apiKey", "password", "secret", "email"];
301
+ interface RedactorOptions {
302
+ rules?: RedactionRule[];
303
+ }
304
+ declare class Redactor {
305
+ #private;
306
+ constructor(options?: RedactorOptions);
307
+ redactValue(key: string, value: unknown): unknown;
308
+ redactRecord(record: Record<string, unknown>): Record<string, unknown>;
309
+ }
310
+
311
+ interface NormalizeOptions {
312
+ config: LogIngestConfig;
313
+ sourceFile?: string;
314
+ }
315
+ declare class EventNormalizer {
316
+ #private;
317
+ constructor(options: NormalizeOptions);
318
+ normalize(record: RawLogRecord): InspectEvent | ParserWarning;
319
+ normalizeAll(records: RawLogRecord[]): ParseResult<InspectEvent>;
320
+ }
321
+
322
+ interface TreeBuilderOptions {
323
+ config?: LogIngestConfig;
324
+ }
325
+ declare class TreeBuilder {
326
+ constructor(options?: TreeBuilderOptions);
327
+ build(events: InspectEvent[]): InspectRunTree[];
328
+ }
329
+
330
+ interface RenderTreeOptions {
331
+ verbose?: boolean;
332
+ showConfidence?: "always" | "non-explicit" | "never";
333
+ showMetadata?: boolean;
334
+ color?: boolean;
335
+ maxAttributeLength?: number;
336
+ summary?: boolean;
337
+ }
338
+ declare function renderRunTree(tree: InspectRunTree, options?: RenderTreeOptions): string;
339
+ declare function renderRunTrees(trees: InspectRunTree[], options?: RenderTreeOptions): string;
340
+
341
+ type LogSourceFormat = "json" | "log4js" | "auto";
342
+ interface ParseLogLineOptions {
343
+ format?: LogSourceFormat;
344
+ file?: string;
345
+ line?: number;
346
+ }
347
+ declare function parseLogLine(line: string, options?: ParseLogLineOptions): ParseResult<RawLogRecord>;
348
+
349
+ interface LiveLogUpdate {
350
+ events: InspectEvent[];
351
+ trees: InspectRunTree[];
352
+ warnings: ParserWarning[];
353
+ }
354
+ interface LiveLogAccumulatorOptions {
355
+ config: LogIngestConfig;
356
+ format?: LogSourceFormat;
357
+ file?: string;
358
+ }
359
+ declare class LiveLogAccumulator {
360
+ #private;
361
+ constructor(options: LiveLogAccumulatorOptions);
362
+ pushLine(line: string, lineNumber?: number): LiveLogUpdate;
363
+ getEvents(): InspectEvent[];
364
+ getTrees(): InspectRunTree[];
365
+ getWarnings(): ParserWarning[];
366
+ reset(): void;
367
+ }
368
+
369
+ interface ParseLogsOptions {
370
+ format?: "json" | "log4js" | "auto";
371
+ config?: LogIngestConfig;
372
+ configPath?: string;
373
+ runIdKeys?: string[];
374
+ eventKey?: string;
375
+ timestampKey?: string;
376
+ messageKey?: string;
377
+ levelKey?: string;
378
+ parentIdKey?: string;
379
+ durationKey?: string;
380
+ statusKey?: string;
381
+ warnings?: "none" | "summary" | "all";
382
+ }
383
+ interface LogToTreeResult {
384
+ events: InspectEvent[];
385
+ trees: InspectRunTree[];
386
+ warnings: ParserWarning[];
387
+ }
388
+ /**
389
+ * @experimental Compatibility-oriented API for parsing structured logs into normalized run trees.
390
+ * Subject to refinement before a future stability declaration.
391
+ */
392
+ declare function parseLogsToTrees(filePath: string, options?: ParseLogsOptions): Promise<LogToTreeResult>;
393
+
153
394
  /** Default folder under the user home for AgentInspect data. */
154
395
  declare const DEFAULT_TRACE_DIR_NAME = ".agent-inspect";
155
396
  /** Subfolder where JSONL run traces are stored. */
@@ -162,10 +403,7 @@ declare const MAX_NAME_LENGTH = 100;
162
403
  declare function createRunId(): string;
163
404
  /** Returns `step_` + a 10-character nanoid segment. */
164
405
  declare function createStepId(): string;
165
- /**
166
- * Formats a duration for CLI display.
167
- * Under 1000 ms uses whole milliseconds; from 1000 ms uses seconds with one decimal.
168
- */
406
+ /** Formats a duration for CLI display (v0.2 rules). */
169
407
  declare function formatDuration(ms: number): string;
170
408
  /**
171
409
  * Formats a Unix timestamp (ms) as local `YYYY-MM-DD HH:mm:ss`.
@@ -264,6 +502,120 @@ declare function listTraceFiles(traceDir: string): Promise<string[]>;
264
502
  /** Maps a `.jsonl` file name to its run id (basename only; no traversal). */
265
503
  declare function getRunIdFromTraceFileName(fileName: string): string | undefined;
266
504
 
505
+ interface TraceDirectoryOptions {
506
+ dir?: string;
507
+ }
508
+ declare function resolveTraceDir(options?: TraceDirectoryOptions): string;
509
+ declare class TraceDirectory {
510
+ #private;
511
+ constructor(options?: TraceDirectoryOptions);
512
+ getPath(filename?: string): string;
513
+ list(): Promise<string[]>;
514
+ getFileStats(filename: string): Promise<Stats>;
515
+ }
516
+
517
+ declare function extractMetadata(filePath: string, _quickScan?: boolean): Promise<TraceMetadata>;
518
+ declare function buildRunSummary(events: TraceEvent[]): RunSummary;
519
+
520
+ interface TraceFilterOptions {
521
+ status?: TraceMetadataStatus;
522
+ name?: string;
523
+ since?: string;
524
+ limit?: number;
525
+ }
526
+ declare function filterTraces(traces: TraceMetadata[], options: TraceFilterOptions): TraceMetadata[];
527
+
528
+ /**
529
+ * Safety check for cleanup workflows: returns true only when the file appears to be an AgentInspect trace.
530
+ * This should be conservative: false positives are more dangerous than false negatives.
531
+ */
532
+ declare function isAgentInspectTrace(filePath: string): Promise<boolean>;
533
+
534
+ /**
535
+ * v0.2 shared duration utilities.
536
+ *
537
+ * `parseDuration` is used for filters such as "since" / "older-than".
538
+ * `formatDuration` is used for compact display in CLI and summaries.
539
+ */
540
+ declare function parseDuration(duration: string): number;
541
+
542
+ type DiffSeverity = "info" | "warning" | "error";
543
+ type DiffKind = "run-status" | "structure" | "step-added" | "step-removed" | "step-status" | "step-type" | "duration" | "error" | "metadata" | "output" | "first-divergence";
544
+ interface DiffPathSegment {
545
+ index: number;
546
+ name: string;
547
+ stepId?: string;
548
+ }
549
+ interface DiffPath {
550
+ path: DiffPathSegment[];
551
+ }
552
+ interface RunDiffItem {
553
+ kind: DiffKind;
554
+ severity: DiffSeverity;
555
+ message: string;
556
+ path?: DiffPath;
557
+ left?: unknown;
558
+ right?: unknown;
559
+ }
560
+ interface StepComparable {
561
+ id: string;
562
+ name: string;
563
+ type?: string;
564
+ status?: string;
565
+ durationMs?: number;
566
+ error?: string;
567
+ metadata?: Record<string, unknown>;
568
+ outputPreview?: unknown;
569
+ children: StepComparable[];
570
+ }
571
+ interface RunComparable {
572
+ runId: string;
573
+ name?: string;
574
+ status?: string;
575
+ durationMs?: number;
576
+ steps: StepComparable[];
577
+ }
578
+ interface RunDiffSummary {
579
+ leftRunId: string;
580
+ rightRunId: string;
581
+ totalDifferences: number;
582
+ errors: number;
583
+ warnings: number;
584
+ info: number;
585
+ firstDivergence?: RunDiffItem;
586
+ }
587
+ interface RunDiffResult {
588
+ summary: RunDiffSummary;
589
+ differences: RunDiffItem[];
590
+ }
591
+ interface DiffOptions {
592
+ ignoreDuration?: boolean;
593
+ durationThresholdMs?: number;
594
+ focus?: "all" | "errors" | "structure" | "outputs";
595
+ check?: "all" | "structure" | "outputs" | "errors" | "timing";
596
+ }
597
+ interface RenderDiffOptions {
598
+ json?: boolean;
599
+ verbose?: boolean;
600
+ color?: boolean;
601
+ }
602
+
603
+ /**
604
+ * Normalize v0.1 manual JSONL events into a comparable run tree.
605
+ * Does not mutate input events.
606
+ */
607
+ declare function manualTraceEventsToComparableRun(events: TraceEvent[]): RunComparable;
608
+
609
+ declare function diffRuns(left: RunComparable, right: RunComparable, options?: DiffOptions): RunDiffResult;
610
+
611
+ declare function renderRunDiff(result: RunDiffResult, options?: RenderDiffOptions): string;
612
+
613
+ /**
614
+ * @experimental Compare two v0.1 manual traces as normalized trees (read-only).
615
+ * Subject to refinement before a future stability declaration.
616
+ */
617
+ declare function diffTraceEvents(leftEvents: TraceEvent[], rightEvents: TraceEvent[], options?: DiffOptions): RunDiffResult;
618
+
267
619
  /** Two spaces per nesting level in terminal output. */
268
620
  declare const TERMINAL_INDENT = " ";
269
621
  /** Max display length for names in terminal output. */
@@ -294,12 +646,18 @@ declare function printRunComplete(_name: string, _runId: string, durationMs: num
294
646
  declare function printFailedAt(stepName: string): void;
295
647
 
296
648
  /**
649
+ * Stable v1.0 API for local manual run tracing.
650
+ *
297
651
  * Runs `fn` inside an AgentInspect trace: JSONL `run_started` / `run_completed`, optional terminal output,
298
652
  * and {@link ExecutionContext} for nested APIs. Instrumentation failures are swallowed; user errors are re-thrown.
299
653
  */
300
654
  declare function inspectRun<T>(name: string, fn: () => Promise<T> | T, options?: InspectRunOptions): Promise<T>;
301
655
 
302
- /** Callable step tracer plus {@link step.llm} and {@link step.tool} shortcuts. */
656
+ /**
657
+ * Stable v1.0 API for instrumenting a named step inside an AgentInspect run.
658
+ *
659
+ * Callable step tracer plus {@link step.llm} and {@link step.tool} shortcuts.
660
+ */
303
661
  type StepFunction = {
304
662
  <T>(name: string, fn: () => Promise<T> | T, options?: StepOptions): Promise<T>;
305
663
  llm: <T>(model: string, fn: () => Promise<T> | T) => Promise<T>;
@@ -315,10 +673,107 @@ type StepFunction = {
315
673
  declare const step: StepFunction;
316
674
 
317
675
  /**
676
+ * Stable v1.0 API for observing agent-like objects locally.
677
+ *
318
678
  * Returns a Proxy that traces top-level `run`, `execute`, and `invoke` via {@link inspectRun}.
319
679
  * Other properties pass through; function members are bound to the real target so class private fields work.
320
680
  * Invalid agents are returned unchanged (with a warn); this function never throws.
321
681
  */
322
682
  declare function observe<T>(agent: T, options?: ObserveOptions): T;
323
683
 
324
- export { type ActiveStepContext, DEFAULT_TRACE_DIR_NAME, type ErrorInfo, type ExecutionContext, FALLBACK_TRACE_DIR, type InspectRunOptions, MAX_NAME_LENGTH, MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, type ObserveOptions, RUNS_DIR_NAME, type Run, type RunCompletedEvent, type RunStartedEvent, type RunStatus, type Step, type StepCompletedEvent, type StepMetadata, type StepOptions, type StepStartedEvent, type StepStatus, type StepType, TERMINAL_INDENT, type TokenMetadata, type TraceEvent, type TraceEventBase, type TraceSchemaVersion, createRunId, createStepId, ensureTraceDir, formatDuration, formatError, formatTerminalName, formatTimestamp, getCurrentContext, getCurrentDepth, getCurrentRunId, getCurrentRunName, getCurrentStepId, getDefaultTraceDir, getIndent, getParentStepId, getRunIdFromTraceFileName, getTraceDirFromContext, getTraceFilePath, hasActiveContext, initializeTraceFile, inspectRun, isSilentContext, isStepStatus, isStepType, isTraceEvent, listTraceFiles, observe, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, readTraceEvents, readTraceFile, renderErrorLine, renderRunSummary, renderStepLine, runWithContext, runWithStepContext, serializeEvent, step, truncateName, validateEvent, warn, writeTraceEvent };
684
+ /**
685
+ * v0.7 local export formats. No sinks — string output only.
686
+ */
687
+
688
+ type ExportFormat = "markdown" | "html" | "openinference" | "otlp-json";
689
+ interface ExportOptions {
690
+ format: ExportFormat;
691
+ includeMetadata?: boolean;
692
+ includeAttributes?: boolean;
693
+ includeErrors?: boolean;
694
+ pretty?: boolean;
695
+ redacted?: boolean;
696
+ maxAttributeLength?: number;
697
+ }
698
+ interface ExportResult {
699
+ format: ExportFormat;
700
+ content: string;
701
+ contentType: string;
702
+ fileExtension: string;
703
+ warnings: string[];
704
+ }
705
+ interface ExportValidationResult {
706
+ ok: boolean;
707
+ format: ExportFormat;
708
+ errors: string[];
709
+ warnings: string[];
710
+ }
711
+ interface TraceExporter {
712
+ name: string;
713
+ format: ExportFormat;
714
+ export(tree: InspectRunTree, options?: Partial<ExportOptions>): ExportResult;
715
+ validate?(content: string): ExportValidationResult;
716
+ }
717
+ /** Library version string embedded in JSON exports (human-readable, not semver guarantee for formats). */
718
+ declare const EXPORT_PAYLOAD_VERSION = "0.1.2";
719
+
720
+ declare function safeString(value: unknown, maxLength?: number): string;
721
+ /** Escape markdown table pipes and normalize line breaks for safe inline text. */
722
+ declare function escapeMarkdown(value: string): string;
723
+ declare function escapeHtml(value: string): string;
724
+ declare function stableJson(value: unknown, pretty?: boolean): string;
725
+ declare function compactAttributes(attrs: Record<string, unknown> | undefined, options?: {
726
+ maxLength?: number;
727
+ redacted?: boolean;
728
+ }): Record<string, unknown>;
729
+ declare function summarizeTree(tree: InspectRunTree): Record<string, unknown>;
730
+ /** Depth-first pre-order flatten (matches typical tree display). */
731
+ declare function flattenTree(tree: InspectRunTree): InspectNode[];
732
+
733
+ /**
734
+ * Build an {@link InspectRunTree} from v0.1 JSONL {@link TraceEvent} rows (manual tracing).
735
+ * Does not mutate the input array or event objects.
736
+ */
737
+ declare function manualTraceEventsToRunTree(events: TraceEvent[]): InspectRunTree;
738
+
739
+ declare function exportMarkdown(tree: InspectRunTree, options?: Partial<ExportOptions>): ExportResult;
740
+
741
+ declare function exportHtml(tree: InspectRunTree, options?: Partial<ExportOptions>): ExportResult;
742
+
743
+ interface OpenInferenceSpan {
744
+ trace_id: string;
745
+ span_id: string;
746
+ parent_span_id?: string;
747
+ name: string;
748
+ start_time_unix_nano: number;
749
+ end_time_unix_nano?: number;
750
+ attributes: Record<string, unknown>;
751
+ status?: {
752
+ code: "OK" | "ERROR" | "UNSET";
753
+ message?: string;
754
+ };
755
+ }
756
+ interface OpenInferenceExport {
757
+ exporter: "agent-inspect";
758
+ format: "openinference";
759
+ compatibility: "openinference-compatible";
760
+ version: string;
761
+ trace_id: string;
762
+ spans: OpenInferenceSpan[];
763
+ warnings: string[];
764
+ }
765
+ declare function exportOpenInference(tree: InspectRunTree, options?: Partial<ExportOptions>): ExportResult;
766
+
767
+ declare function exportOtlpJson(tree: InspectRunTree, options?: Partial<ExportOptions>): ExportResult;
768
+
769
+ declare function validateExportContent(format: ExportFormat, content: string): ExportValidationResult;
770
+
771
+ declare function mergeExportDefaults(options: ExportOptions): ExportOptions;
772
+ /**
773
+ * @experimental Compatibility-oriented export API. Exports are local-only and do not upload anywhere.
774
+ * Subject to refinement before a future stability declaration.
775
+ */
776
+ declare function exportRunTree(tree: InspectRunTree, options: ExportOptions): ExportResult;
777
+ declare function validateExport(result: ExportResult): ExportValidationResult;
778
+
779
+ export { type ActiveStepContext, type AttributionConfidence, DEFAULT_LOG_INGEST_CONFIG, DEFAULT_REDACT_KEYS, DEFAULT_TRACE_DIR_NAME, type DiffKind, type DiffOptions, type DiffPath, type DiffPathSegment, type DiffSeverity, EXPORT_PAYLOAD_VERSION, type ErrorInfo, EventNormalizer, type EventSource, type ExecutionContext, type ExportFormat, type ExportOptions, type ExportResult, type ExportValidationResult, FALLBACK_TRACE_DIR, type InspectEvent, type InspectKind, type InspectNode, type InspectRunOptions, type InspectRunTree, JsonLogParser, LiveLogAccumulator, type LiveLogAccumulatorOptions, type LiveLogUpdate, Log4jsParser, type LogEventMapping, type LogIngestConfig, type LogSourceFormat, type LogToTreeResult, MAX_NAME_LENGTH, MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, type NormalizeOptions, type ObserveOptions, type OpenInferenceExport, type OpenInferenceSpan, type ParseLogLineOptions, type ParseLogsOptions, type ParseResult, type ParserWarning, type ParserWarningCode, RUNS_DIR_NAME, type RawLogRecord, type RedactionRule, type RedactionStrategy, Redactor, type RedactorOptions, type RenderDiffOptions, type RenderTreeOptions, type Run, type RunComparable, type RunCompletedEvent, type RunDiffItem, type RunDiffResult, type RunDiffSummary, type RunStartedEvent, type RunStatus, type RunSummary, type Step, type StepComparable, type StepCompletedEvent, type StepMetadata, type StepOptions, type StepStartedEvent, type StepStatus, type StepType, TERMINAL_INDENT, type TokenMetadata, TraceDirectory, type TraceDirectoryOptions, type TraceEvent, type TraceEventBase, type TraceExporter, type TraceFilterOptions, type TraceMetadata, type TraceMetadataStatus, type TraceSchemaVersion, TreeBuilder, type TreeBuilderOptions, buildRunSummary, compactAttributes, createRunId, createStepId, diffRuns, diffTraceEvents, ensureTraceDir, escapeHtml, escapeMarkdown, exportHtml, exportMarkdown, exportOpenInference, exportOtlpJson, exportRunTree, extractMetadata, filterTraces, flattenTree, formatDuration, formatError, formatTerminalName, formatTimestamp, getCurrentContext, getCurrentDepth, getCurrentRunId, getCurrentRunName, getCurrentStepId, getDefaultTraceDir, getIndent, getParentStepId, getRunIdFromTraceFileName, getTraceDirFromContext, getTraceFilePath, hasActiveContext, initializeTraceFile, inspectRun, isAgentInspectTrace, isSilentContext, isStepStatus, isStepType, isTraceEvent, listTraceFiles, loadLogIngestConfig, manualTraceEventsToComparableRun, manualTraceEventsToRunTree, matchMapping, mergeExportDefaults, mergeLogIngestConfig, observe, parseDuration, parseLogLine, parseLogsToTrees, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, readTraceEvents, readTraceFile, renderErrorLine, renderRunDiff, renderRunSummary, renderRunTree, renderRunTrees, renderStepLine, resolveTraceDir, runWithContext, runWithStepContext, safeString, serializeEvent, stableJson, step, summarizeTree, truncateName, validateEvent, validateExport, validateExportContent, warn, wildcardMatch, writeTraceEvent };