agent-inspect 1.1.0 → 1.2.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 +24 -4
- package/README.md +24 -7
- package/SECURITY.md +1 -1
- package/docs/API.md +35 -9
- package/docs/ARCHITECTURE.md +1 -0
- package/docs/CLI.md +47 -0
- package/docs/DIFF.md +127 -0
- package/docs/GETTING-STARTED.md +7 -2
- package/docs/KNOWN-ISSUES.md +53 -0
- package/docs/LIMITATIONS.md +6 -0
- package/docs/SCHEMA.md +40 -2
- package/package.json +2 -1
- package/packages/cli/dist/index.cjs +619 -95
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +613 -90
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/core/dist/index.cjs +1312 -122
- package/packages/core/dist/index.cjs.map +1 -1
- package/packages/core/dist/index.d.cts +140 -1
- package/packages/core/dist/index.d.ts +140 -1
- package/packages/core/dist/index.mjs +1299 -119
- package/packages/core/dist/index.mjs.map +1 -1
|
@@ -278,6 +278,145 @@ declare function isStepStatus(value: unknown): value is StepStatus;
|
|
|
278
278
|
*/
|
|
279
279
|
declare function isTraceEvent(value: unknown): value is TraceEvent;
|
|
280
280
|
|
|
281
|
+
type PersistedSchemaVersion = "0.2";
|
|
282
|
+
type PersistedEventSourceType = "manual" | "json-log" | "log4js" | "adapter" | "ai-sdk" | "otel";
|
|
283
|
+
interface PersistedEventSource {
|
|
284
|
+
type: PersistedEventSourceType;
|
|
285
|
+
name?: string;
|
|
286
|
+
version?: string;
|
|
287
|
+
}
|
|
288
|
+
type PersistedEventStatus = "running" | "ok" | "error" | "unknown";
|
|
289
|
+
interface PersistedInspectError {
|
|
290
|
+
name?: string;
|
|
291
|
+
message: string;
|
|
292
|
+
code?: string;
|
|
293
|
+
}
|
|
294
|
+
interface PersistedTokenUsage {
|
|
295
|
+
input?: number;
|
|
296
|
+
output?: number;
|
|
297
|
+
total?: number;
|
|
298
|
+
}
|
|
299
|
+
interface PersistedTraceContext {
|
|
300
|
+
traceId?: string;
|
|
301
|
+
spanId?: string;
|
|
302
|
+
parentSpanId?: string;
|
|
303
|
+
}
|
|
304
|
+
interface PersistedInspectEvent {
|
|
305
|
+
schemaVersion: PersistedSchemaVersion;
|
|
306
|
+
eventId: string;
|
|
307
|
+
runId: string;
|
|
308
|
+
parentId?: string;
|
|
309
|
+
kind: InspectKind;
|
|
310
|
+
name: string;
|
|
311
|
+
status?: PersistedEventStatus;
|
|
312
|
+
timestamp: string;
|
|
313
|
+
startedAt?: string;
|
|
314
|
+
endedAt?: string;
|
|
315
|
+
durationMs?: number;
|
|
316
|
+
confidence: AttributionConfidence;
|
|
317
|
+
source: PersistedEventSource;
|
|
318
|
+
attributes?: Record<string, unknown>;
|
|
319
|
+
inputSummary?: unknown;
|
|
320
|
+
outputSummary?: unknown;
|
|
321
|
+
error?: PersistedInspectError;
|
|
322
|
+
tokenUsage?: PersistedTokenUsage;
|
|
323
|
+
trace?: PersistedTraceContext;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Runtime guard for a v0.2 {@link PersistedInspectEvent} JSON object.
|
|
327
|
+
*
|
|
328
|
+
* Timestamp fields (`timestamp`, `startedAt`, `endedAt`) are validated as
|
|
329
|
+
* non-empty strings only — stricter ISO-8601 parsing may be added later.
|
|
330
|
+
*/
|
|
331
|
+
declare function isPersistedInspectEvent(value: unknown): value is PersistedInspectEvent;
|
|
332
|
+
|
|
333
|
+
interface TraceEventToPersistedOptions {
|
|
334
|
+
/**
|
|
335
|
+
* Stable index within the source event list.
|
|
336
|
+
* Used only to make synthetic eventId deterministic when v0.1 has no eventId.
|
|
337
|
+
*/
|
|
338
|
+
eventIndex?: number;
|
|
339
|
+
/**
|
|
340
|
+
* Optional source name override.
|
|
341
|
+
* Default: "trace-event"
|
|
342
|
+
*/
|
|
343
|
+
sourceName?: string;
|
|
344
|
+
/**
|
|
345
|
+
* Optional source version override.
|
|
346
|
+
* Default: "0.1"
|
|
347
|
+
*/
|
|
348
|
+
sourceVersion?: string;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Maps one v0.1 {@link TraceEvent} to a v0.2 {@link PersistedInspectEvent}.
|
|
352
|
+
* Does not mutate `event`.
|
|
353
|
+
*/
|
|
354
|
+
declare function traceEventToPersistedInspectEvent(event: TraceEvent, options?: TraceEventToPersistedOptions): PersistedInspectEvent;
|
|
355
|
+
/**
|
|
356
|
+
* Maps a v0.1 trace event list to persisted v0.2 events (one output per input).
|
|
357
|
+
*/
|
|
358
|
+
declare function traceEventsToPersistedInspectEvents(events: readonly TraceEvent[], options?: Omit<TraceEventToPersistedOptions, "eventIndex">): PersistedInspectEvent[];
|
|
359
|
+
|
|
360
|
+
interface InspectEventToPersistedOptions {
|
|
361
|
+
/**
|
|
362
|
+
* Optional source name override.
|
|
363
|
+
* If omitted, derived from event.source.type.
|
|
364
|
+
*/
|
|
365
|
+
sourceName?: string;
|
|
366
|
+
/**
|
|
367
|
+
* Optional source version override.
|
|
368
|
+
*/
|
|
369
|
+
sourceVersion?: string;
|
|
370
|
+
/**
|
|
371
|
+
* Stable index for deterministic fallback IDs if needed.
|
|
372
|
+
*/
|
|
373
|
+
eventIndex?: number;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Maps one in-memory {@link InspectEvent} to a v0.2 {@link PersistedInspectEvent}.
|
|
377
|
+
* Does not mutate `event`.
|
|
378
|
+
*/
|
|
379
|
+
declare function inspectEventToPersistedInspectEvent(event: InspectEvent, options?: InspectEventToPersistedOptions): PersistedInspectEvent;
|
|
380
|
+
/**
|
|
381
|
+
* Maps in-memory {@link InspectEvent} rows to persisted v0.2 events.
|
|
382
|
+
*/
|
|
383
|
+
declare function inspectEventsToPersistedInspectEvents(events: readonly InspectEvent[], options?: Omit<InspectEventToPersistedOptions, "eventIndex">): PersistedInspectEvent[];
|
|
384
|
+
|
|
385
|
+
interface PersistedToInspectEventOptions {
|
|
386
|
+
/**
|
|
387
|
+
* If true, invalid persisted events are skipped by batch conversion.
|
|
388
|
+
* If false or omitted, invalid events throw.
|
|
389
|
+
*/
|
|
390
|
+
skipInvalid?: boolean;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Maps one v0.2 {@link PersistedInspectEvent} to in-memory {@link InspectEvent}.
|
|
394
|
+
* Throws if `event` fails {@link isPersistedInspectEvent}.
|
|
395
|
+
*/
|
|
396
|
+
declare function persistedInspectEventToInspectEvent(event: PersistedInspectEvent): InspectEvent;
|
|
397
|
+
/**
|
|
398
|
+
* Maps persisted v0.2 events to in-memory {@link InspectEvent} rows.
|
|
399
|
+
*/
|
|
400
|
+
declare function persistedInspectEventsToInspectEvents(events: readonly PersistedInspectEvent[], options?: PersistedToInspectEventOptions): InspectEvent[];
|
|
401
|
+
|
|
402
|
+
interface PersistedTreeBridgeOptions {
|
|
403
|
+
/**
|
|
404
|
+
* If true, invalid persisted events are skipped.
|
|
405
|
+
* If false or omitted, invalid persisted events throw.
|
|
406
|
+
*/
|
|
407
|
+
skipInvalid?: boolean;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Builds {@link InspectRunTree} rows from v0.2 {@link PersistedInspectEvent} input.
|
|
411
|
+
* Uses {@link TreeBuilder} as the canonical tree builder. Does not mutate `events`.
|
|
412
|
+
*/
|
|
413
|
+
declare function persistedInspectEventsToRunTrees(events: readonly PersistedInspectEvent[], options?: PersistedTreeBridgeOptions): InspectRunTree[];
|
|
414
|
+
/**
|
|
415
|
+
* Builds {@link InspectRunTree} rows from legacy v0.1 {@link TraceEvent} input
|
|
416
|
+
* via the persisted-event model. Does not mutate `events`.
|
|
417
|
+
*/
|
|
418
|
+
declare function traceEventsToPersistedRunTrees(events: readonly TraceEvent[]): InspectRunTree[];
|
|
419
|
+
|
|
281
420
|
type ParserWarningCode = "MALFORMED_JSON" | "MISSING_RUN_ID" | "MISSING_EVENT" | "MISSING_TIMESTAMP" | "UNSUPPORTED_LOG4JS_PAYLOAD" | "CONFIG_ERROR" | "UNKNOWN";
|
|
282
421
|
interface ParserWarning {
|
|
283
422
|
code: ParserWarningCode;
|
|
@@ -830,4 +969,4 @@ declare function mergeExportDefaults(options: ExportOptions): ExportOptions;
|
|
|
830
969
|
declare function exportRunTree(tree: InspectRunTree, options: ExportOptions): ExportResult;
|
|
831
970
|
declare function validateExport(result: ExportResult): ExportValidationResult;
|
|
832
971
|
|
|
833
|
-
export { type ActiveStepContext, type AttributionConfidence, DEFAULT_LOG_INGEST_CONFIG, DEFAULT_MAX_EVENT_BYTES, DEFAULT_MAX_METADATA_VALUE_LENGTH, DEFAULT_MAX_PREVIEW_LENGTH, 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 TraceSafetyOptions, 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, getTraceSafetyFromContext, hasActiveContext, initializeTraceFile, inspectRun, isAgentInspectEnabled, isAgentInspectTrace, isSilentContext, isStepStatus, isStepType, isTraceEvent, listTraceFiles, loadLogIngestConfig, manualTraceEventsToComparableRun, manualTraceEventsToRunTree, matchMapping, maybeInspectRun, mergeExportDefaults, mergeLogIngestConfig, observe, parseDuration, parseLogLine, parseLogsToTrees, prepareMetadataForDisk, prepareTraceEventForDisk, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, readTraceEvents, readTraceFile, renderErrorLine, renderRunDiff, renderRunSummary, renderRunTree, renderRunTrees, renderStepLine, resolveTraceDir, resolveTraceSafetyOptions, runWithContext, runWithStepContext, safeString, serializeEvent, stableJson, step, summarizeTree, truncateName, validateEvent, validateExport, validateExportContent, warn, wildcardMatch, writeTraceEvent };
|
|
972
|
+
export { type ActiveStepContext, type AttributionConfidence, DEFAULT_LOG_INGEST_CONFIG, DEFAULT_MAX_EVENT_BYTES, DEFAULT_MAX_METADATA_VALUE_LENGTH, DEFAULT_MAX_PREVIEW_LENGTH, 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 InspectEventToPersistedOptions, 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, type PersistedEventSource, type PersistedEventSourceType, type PersistedEventStatus, type PersistedInspectError, type PersistedInspectEvent, type PersistedSchemaVersion, type PersistedToInspectEventOptions, type PersistedTokenUsage, type PersistedTraceContext, type PersistedTreeBridgeOptions, 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 TraceEventToPersistedOptions, type TraceExporter, type TraceFilterOptions, type TraceMetadata, type TraceMetadataStatus, type TraceSafetyOptions, 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, getTraceSafetyFromContext, hasActiveContext, initializeTraceFile, inspectEventToPersistedInspectEvent, inspectEventsToPersistedInspectEvents, inspectRun, isAgentInspectEnabled, isAgentInspectTrace, isPersistedInspectEvent, isSilentContext, isStepStatus, isStepType, isTraceEvent, listTraceFiles, loadLogIngestConfig, manualTraceEventsToComparableRun, manualTraceEventsToRunTree, matchMapping, maybeInspectRun, mergeExportDefaults, mergeLogIngestConfig, observe, parseDuration, parseLogLine, parseLogsToTrees, persistedInspectEventToInspectEvent, persistedInspectEventsToInspectEvents, persistedInspectEventsToRunTrees, prepareMetadataForDisk, prepareTraceEventForDisk, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, readTraceEvents, readTraceFile, renderErrorLine, renderRunDiff, renderRunSummary, renderRunTree, renderRunTrees, renderStepLine, resolveTraceDir, resolveTraceSafetyOptions, runWithContext, runWithStepContext, safeString, serializeEvent, stableJson, step, summarizeTree, traceEventToPersistedInspectEvent, traceEventsToPersistedInspectEvents, traceEventsToPersistedRunTrees, truncateName, validateEvent, validateExport, validateExportContent, warn, wildcardMatch, writeTraceEvent };
|
|
@@ -278,6 +278,145 @@ declare function isStepStatus(value: unknown): value is StepStatus;
|
|
|
278
278
|
*/
|
|
279
279
|
declare function isTraceEvent(value: unknown): value is TraceEvent;
|
|
280
280
|
|
|
281
|
+
type PersistedSchemaVersion = "0.2";
|
|
282
|
+
type PersistedEventSourceType = "manual" | "json-log" | "log4js" | "adapter" | "ai-sdk" | "otel";
|
|
283
|
+
interface PersistedEventSource {
|
|
284
|
+
type: PersistedEventSourceType;
|
|
285
|
+
name?: string;
|
|
286
|
+
version?: string;
|
|
287
|
+
}
|
|
288
|
+
type PersistedEventStatus = "running" | "ok" | "error" | "unknown";
|
|
289
|
+
interface PersistedInspectError {
|
|
290
|
+
name?: string;
|
|
291
|
+
message: string;
|
|
292
|
+
code?: string;
|
|
293
|
+
}
|
|
294
|
+
interface PersistedTokenUsage {
|
|
295
|
+
input?: number;
|
|
296
|
+
output?: number;
|
|
297
|
+
total?: number;
|
|
298
|
+
}
|
|
299
|
+
interface PersistedTraceContext {
|
|
300
|
+
traceId?: string;
|
|
301
|
+
spanId?: string;
|
|
302
|
+
parentSpanId?: string;
|
|
303
|
+
}
|
|
304
|
+
interface PersistedInspectEvent {
|
|
305
|
+
schemaVersion: PersistedSchemaVersion;
|
|
306
|
+
eventId: string;
|
|
307
|
+
runId: string;
|
|
308
|
+
parentId?: string;
|
|
309
|
+
kind: InspectKind;
|
|
310
|
+
name: string;
|
|
311
|
+
status?: PersistedEventStatus;
|
|
312
|
+
timestamp: string;
|
|
313
|
+
startedAt?: string;
|
|
314
|
+
endedAt?: string;
|
|
315
|
+
durationMs?: number;
|
|
316
|
+
confidence: AttributionConfidence;
|
|
317
|
+
source: PersistedEventSource;
|
|
318
|
+
attributes?: Record<string, unknown>;
|
|
319
|
+
inputSummary?: unknown;
|
|
320
|
+
outputSummary?: unknown;
|
|
321
|
+
error?: PersistedInspectError;
|
|
322
|
+
tokenUsage?: PersistedTokenUsage;
|
|
323
|
+
trace?: PersistedTraceContext;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Runtime guard for a v0.2 {@link PersistedInspectEvent} JSON object.
|
|
327
|
+
*
|
|
328
|
+
* Timestamp fields (`timestamp`, `startedAt`, `endedAt`) are validated as
|
|
329
|
+
* non-empty strings only — stricter ISO-8601 parsing may be added later.
|
|
330
|
+
*/
|
|
331
|
+
declare function isPersistedInspectEvent(value: unknown): value is PersistedInspectEvent;
|
|
332
|
+
|
|
333
|
+
interface TraceEventToPersistedOptions {
|
|
334
|
+
/**
|
|
335
|
+
* Stable index within the source event list.
|
|
336
|
+
* Used only to make synthetic eventId deterministic when v0.1 has no eventId.
|
|
337
|
+
*/
|
|
338
|
+
eventIndex?: number;
|
|
339
|
+
/**
|
|
340
|
+
* Optional source name override.
|
|
341
|
+
* Default: "trace-event"
|
|
342
|
+
*/
|
|
343
|
+
sourceName?: string;
|
|
344
|
+
/**
|
|
345
|
+
* Optional source version override.
|
|
346
|
+
* Default: "0.1"
|
|
347
|
+
*/
|
|
348
|
+
sourceVersion?: string;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Maps one v0.1 {@link TraceEvent} to a v0.2 {@link PersistedInspectEvent}.
|
|
352
|
+
* Does not mutate `event`.
|
|
353
|
+
*/
|
|
354
|
+
declare function traceEventToPersistedInspectEvent(event: TraceEvent, options?: TraceEventToPersistedOptions): PersistedInspectEvent;
|
|
355
|
+
/**
|
|
356
|
+
* Maps a v0.1 trace event list to persisted v0.2 events (one output per input).
|
|
357
|
+
*/
|
|
358
|
+
declare function traceEventsToPersistedInspectEvents(events: readonly TraceEvent[], options?: Omit<TraceEventToPersistedOptions, "eventIndex">): PersistedInspectEvent[];
|
|
359
|
+
|
|
360
|
+
interface InspectEventToPersistedOptions {
|
|
361
|
+
/**
|
|
362
|
+
* Optional source name override.
|
|
363
|
+
* If omitted, derived from event.source.type.
|
|
364
|
+
*/
|
|
365
|
+
sourceName?: string;
|
|
366
|
+
/**
|
|
367
|
+
* Optional source version override.
|
|
368
|
+
*/
|
|
369
|
+
sourceVersion?: string;
|
|
370
|
+
/**
|
|
371
|
+
* Stable index for deterministic fallback IDs if needed.
|
|
372
|
+
*/
|
|
373
|
+
eventIndex?: number;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Maps one in-memory {@link InspectEvent} to a v0.2 {@link PersistedInspectEvent}.
|
|
377
|
+
* Does not mutate `event`.
|
|
378
|
+
*/
|
|
379
|
+
declare function inspectEventToPersistedInspectEvent(event: InspectEvent, options?: InspectEventToPersistedOptions): PersistedInspectEvent;
|
|
380
|
+
/**
|
|
381
|
+
* Maps in-memory {@link InspectEvent} rows to persisted v0.2 events.
|
|
382
|
+
*/
|
|
383
|
+
declare function inspectEventsToPersistedInspectEvents(events: readonly InspectEvent[], options?: Omit<InspectEventToPersistedOptions, "eventIndex">): PersistedInspectEvent[];
|
|
384
|
+
|
|
385
|
+
interface PersistedToInspectEventOptions {
|
|
386
|
+
/**
|
|
387
|
+
* If true, invalid persisted events are skipped by batch conversion.
|
|
388
|
+
* If false or omitted, invalid events throw.
|
|
389
|
+
*/
|
|
390
|
+
skipInvalid?: boolean;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Maps one v0.2 {@link PersistedInspectEvent} to in-memory {@link InspectEvent}.
|
|
394
|
+
* Throws if `event` fails {@link isPersistedInspectEvent}.
|
|
395
|
+
*/
|
|
396
|
+
declare function persistedInspectEventToInspectEvent(event: PersistedInspectEvent): InspectEvent;
|
|
397
|
+
/**
|
|
398
|
+
* Maps persisted v0.2 events to in-memory {@link InspectEvent} rows.
|
|
399
|
+
*/
|
|
400
|
+
declare function persistedInspectEventsToInspectEvents(events: readonly PersistedInspectEvent[], options?: PersistedToInspectEventOptions): InspectEvent[];
|
|
401
|
+
|
|
402
|
+
interface PersistedTreeBridgeOptions {
|
|
403
|
+
/**
|
|
404
|
+
* If true, invalid persisted events are skipped.
|
|
405
|
+
* If false or omitted, invalid persisted events throw.
|
|
406
|
+
*/
|
|
407
|
+
skipInvalid?: boolean;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Builds {@link InspectRunTree} rows from v0.2 {@link PersistedInspectEvent} input.
|
|
411
|
+
* Uses {@link TreeBuilder} as the canonical tree builder. Does not mutate `events`.
|
|
412
|
+
*/
|
|
413
|
+
declare function persistedInspectEventsToRunTrees(events: readonly PersistedInspectEvent[], options?: PersistedTreeBridgeOptions): InspectRunTree[];
|
|
414
|
+
/**
|
|
415
|
+
* Builds {@link InspectRunTree} rows from legacy v0.1 {@link TraceEvent} input
|
|
416
|
+
* via the persisted-event model. Does not mutate `events`.
|
|
417
|
+
*/
|
|
418
|
+
declare function traceEventsToPersistedRunTrees(events: readonly TraceEvent[]): InspectRunTree[];
|
|
419
|
+
|
|
281
420
|
type ParserWarningCode = "MALFORMED_JSON" | "MISSING_RUN_ID" | "MISSING_EVENT" | "MISSING_TIMESTAMP" | "UNSUPPORTED_LOG4JS_PAYLOAD" | "CONFIG_ERROR" | "UNKNOWN";
|
|
282
421
|
interface ParserWarning {
|
|
283
422
|
code: ParserWarningCode;
|
|
@@ -830,4 +969,4 @@ declare function mergeExportDefaults(options: ExportOptions): ExportOptions;
|
|
|
830
969
|
declare function exportRunTree(tree: InspectRunTree, options: ExportOptions): ExportResult;
|
|
831
970
|
declare function validateExport(result: ExportResult): ExportValidationResult;
|
|
832
971
|
|
|
833
|
-
export { type ActiveStepContext, type AttributionConfidence, DEFAULT_LOG_INGEST_CONFIG, DEFAULT_MAX_EVENT_BYTES, DEFAULT_MAX_METADATA_VALUE_LENGTH, DEFAULT_MAX_PREVIEW_LENGTH, 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 TraceSafetyOptions, 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, getTraceSafetyFromContext, hasActiveContext, initializeTraceFile, inspectRun, isAgentInspectEnabled, isAgentInspectTrace, isSilentContext, isStepStatus, isStepType, isTraceEvent, listTraceFiles, loadLogIngestConfig, manualTraceEventsToComparableRun, manualTraceEventsToRunTree, matchMapping, maybeInspectRun, mergeExportDefaults, mergeLogIngestConfig, observe, parseDuration, parseLogLine, parseLogsToTrees, prepareMetadataForDisk, prepareTraceEventForDisk, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, readTraceEvents, readTraceFile, renderErrorLine, renderRunDiff, renderRunSummary, renderRunTree, renderRunTrees, renderStepLine, resolveTraceDir, resolveTraceSafetyOptions, runWithContext, runWithStepContext, safeString, serializeEvent, stableJson, step, summarizeTree, truncateName, validateEvent, validateExport, validateExportContent, warn, wildcardMatch, writeTraceEvent };
|
|
972
|
+
export { type ActiveStepContext, type AttributionConfidence, DEFAULT_LOG_INGEST_CONFIG, DEFAULT_MAX_EVENT_BYTES, DEFAULT_MAX_METADATA_VALUE_LENGTH, DEFAULT_MAX_PREVIEW_LENGTH, 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 InspectEventToPersistedOptions, 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, type PersistedEventSource, type PersistedEventSourceType, type PersistedEventStatus, type PersistedInspectError, type PersistedInspectEvent, type PersistedSchemaVersion, type PersistedToInspectEventOptions, type PersistedTokenUsage, type PersistedTraceContext, type PersistedTreeBridgeOptions, 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 TraceEventToPersistedOptions, type TraceExporter, type TraceFilterOptions, type TraceMetadata, type TraceMetadataStatus, type TraceSafetyOptions, 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, getTraceSafetyFromContext, hasActiveContext, initializeTraceFile, inspectEventToPersistedInspectEvent, inspectEventsToPersistedInspectEvents, inspectRun, isAgentInspectEnabled, isAgentInspectTrace, isPersistedInspectEvent, isSilentContext, isStepStatus, isStepType, isTraceEvent, listTraceFiles, loadLogIngestConfig, manualTraceEventsToComparableRun, manualTraceEventsToRunTree, matchMapping, maybeInspectRun, mergeExportDefaults, mergeLogIngestConfig, observe, parseDuration, parseLogLine, parseLogsToTrees, persistedInspectEventToInspectEvent, persistedInspectEventsToInspectEvents, persistedInspectEventsToRunTrees, prepareMetadataForDisk, prepareTraceEventForDisk, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, readTraceEvents, readTraceFile, renderErrorLine, renderRunDiff, renderRunSummary, renderRunTree, renderRunTrees, renderStepLine, resolveTraceDir, resolveTraceSafetyOptions, runWithContext, runWithStepContext, safeString, serializeEvent, stableJson, step, summarizeTree, traceEventToPersistedInspectEvent, traceEventsToPersistedInspectEvents, traceEventsToPersistedRunTrees, truncateName, validateEvent, validateExport, validateExportContent, warn, wildcardMatch, writeTraceEvent };
|