import type { SimulatorDefinition } from '../types.js'; import type { FaultSchedule, FaultScheduler, FaultSpec } from './faults.js'; import type { RedactedHistoryEntry, RedactionOptions } from './history.js'; export interface ScenarioBuildContext { sessionId: string; scenarioId: string; seed: number; secrets: Record; faults: FaultScheduler; } export interface PushSendOptions { /** Override delivery id. */ deliveryId?: string; /** Force signature to be invalid. */ malformedSignature?: boolean; /** Event payload as exact bytes, or object (serialized once and frozen). */ body?: Uint8Array | string | Record; /** Reuse previously frozen body bytes (retry-same-body-hash). */ reuseBodyBytes?: boolean; /** Sequence number when ordering is declared. */ sequence?: number; } export interface PushAckRecord { deliveryId: string; attempt: number; status: number; body: unknown; recordedAt: string; } export interface ScenarioPushController { send(options?: PushSendOptions): Promise; getAckHistory(): readonly PushAckRecord[]; /** Challenge handshake for webhook verification. */ challenge?(mode: 'success' | 'failure'): Promise<{ status: number; body: unknown; }>; } export interface BuiltScenario { definition: SimulatorDefinition; reset?: () => void; getState?: () => Record; push?: ScenarioPushController; /** Optional receiver URL for push scenarios. */ receiverUrl?: string; } export interface ScenarioDefinition { id: string; /** Default seed for this scenario (overridable per session). */ seed: number | string; evidenceChecklist: string[]; /** Optional default fault schedule. */ faultSchedule?: FaultSchedule; build(ctx: ScenarioBuildContext): BuiltScenario; } export interface ConformanceSessionOptions { scenarioId: string; sessionId?: string; seed?: number | string; secrets?: Record; faultSchedule?: FaultSchedule; redaction?: RedactionOptions; /** Scenario registry; defaults to built-in catalog when using createConformanceSession from scenarios. */ scenario?: ScenarioDefinition; /** Receiver base URL for push send (caller-provided test server). */ receiverUrl?: string; } export interface ConformanceSession { readonly scenarioId: string; readonly sessionId: string; readonly seed: number; readonly evidenceChecklist: readonly string[]; /** Underlying simulator dispatch. */ dispatch: import('../types.js').ApiSimulator['dispatch']; tryDispatch: import('../types.js').ApiSimulator['tryDispatch']; listEndpoints: import('../types.js').ApiSimulator['listEndpoints']; /** Reset session state and history between tests. */ reset(): void; /** Tear down; clears history and marks stopped. */ stop(): void; getHistory(): readonly RedactedHistoryEntry[]; clearHistory(): void; injectFault(spec: FaultSpec): void; getState(): Record; /** Trigger a signed push delivery when the scenario supports it. */ triggerPushSend(options?: PushSendOptions): Promise; getPushAckHistory(): readonly PushAckRecord[]; /** Node-friendly fetch-like helper against in-process dispatch. */ fetch(input: string | { method?: string; path: string; headers?: Record; body?: unknown; }): Promise<{ status: number; headers: Record; body: unknown; }>; } //# sourceMappingURL=types.d.ts.map