import type { ModuleDependencies } from '../modules/pipeline/interfaces/pipeline-interfaces.js'; import type { ProviderRuntimeProfile } from '../providers/core/api/provider-types.js'; import type { ProviderRuntimeMetadata } from '../providers/core/runtime/provider-runtime-metadata.js'; import type { TargetMetadata } from '../modules/pipeline/orchestrator/pipeline-context.js'; export type DebugSessionMode = 'capture' | 'replay'; export interface DebugSession { id: string; mode: DebugSessionMode; label?: string; createdAt: number; tags?: string[]; metadata?: Record; } export type DebugNodeDirection = 'request' | 'response'; export interface NodeSnapshot { sessionId: string; nodeId: string; direction: DebugNodeDirection; stage?: string; payload: unknown; timestamp: number; metadata?: Record; } export interface SnapshotQuery { nodeId?: string; direction?: DebugNodeDirection; limit?: number; } export interface SnapshotStore { save(snapshot: NodeSnapshot): Promise; fetch(sessionId: string, query?: SnapshotQuery): Promise; clear(sessionId: string): Promise; listSessions(): Promise; } export interface HarnessExecuteContext { sessionId?: string; snapshotLabel?: string; } export interface ExecutionHarness { readonly id: string; readonly description?: string; executeForward(input: TInput, context?: HarnessExecuteContext): Promise; executeBackward?(output: TResult, context?: HarnessExecuteContext): Promise; } export type ProviderHarnessRuntime = ProviderRuntimeProfile & Record; export interface ProviderHarnessMetadata extends ProviderRuntimeMetadata { requestId: string; providerId: string; providerKey: string; providerType: string; providerProtocol: string; routeName: string; target: TargetMetadata; runtime?: ProviderHarnessRuntime; } export interface ProviderHarnessExecuteInput { runtime: ProviderHarnessRuntime; request: Record; metadata: ProviderHarnessMetadata; action?: 'preprocess' | 'postprocess'; dependencies?: ModuleDependencies; } export interface ProviderHarnessResult { payload: unknown; context?: Record; } export interface ProviderDryRunOptions { runtime: ProviderHarnessRuntime; request: Record; metadata: ProviderHarnessMetadata; sessionId?: string; nodeId?: string; } export interface ProviderDryRunResult { processed: unknown; metadata: ProviderHarnessMetadata; }