export type DeliveryGuarantee = 'at-most-once' | 'at-least-once' | 'exactly-once';
export type SchemaChangeKind = 'additive' | 'breaking' | 'deprecation';
export type SagaCoordinationStyle = 'choreography' | 'orchestration';
export type BrokerKind = 'kafka' | 'rabbitmq' | 'sqs-sns' | 'nats' | 'eventbridge' | 'pubsub' | 'unknown';
export interface EventSchema {
    /** JSON Schema draft-07 compatible object describing the event payload */
    jsonSchema: Record<string, unknown>;
    /** Semver string: major.minor.patch */
    version: string;
    /** ISO date when this schema version was introduced */
    introducedAt: string;
    /** ISO date when this schema version is scheduled for removal, if deprecated */
    sunsetAt?: string;
}
export interface EventContract {
    /** Unique event name, e.g. "order.created" */
    name: string;
    /** Current semver version of the contract */
    currentVersion: string;
    /** All schema versions indexed by semver string */
    versions: Record<string, EventSchema>;
    /** Service or component that emits this event */
    producer: string;
    /** Known services or components that consume this event */
    consumers: string[];
    /** Delivery guarantee provided by the broker for this event */
    deliveryGuarantee: DeliveryGuarantee;
    /** Broker used to transport this event */
    broker: BrokerKind;
    /** DLQ configuration for consumers of this event, if applicable */
    dlq?: DLQConfig;
    /** ISO date of last contract update */
    updatedAt: string;
    /** SPEC-XXX IDs that reference this contract */
    referencedBySpecs: string[];
}
export interface EventVersion {
    /** Semver string of this version */
    version: string;
    /** Classification of the change relative to the previous version */
    changeKind: SchemaChangeKind;
    /** Human-readable description of what changed */
    changeDescription: string;
    /** Fields added in this version (for additive changes) */
    addedFields?: string[];
    /** Fields removed in this version (for breaking changes) */
    removedFields?: string[];
    /** Fields whose type changed in this version (for breaking changes) */
    changedFields?: {
        field: string;
        from: string;
        to: string;
    }[];
    /** Fields marked deprecated in this version */
    deprecatedFields?: {
        field: string;
        reason: string;
        sunsetVersion: string;
    }[];
    /** ISO date when dual-version emission period ends, for breaking changes */
    dualEmissionEndAt?: string;
}
export interface DLQConfig {
    /** Name of the dead letter queue */
    queueName: string;
    /** Retention period in seconds */
    retentionSeconds: number;
    /** Maximum number of delivery retries before routing to DLQ */
    maxRetries: number;
    /** Initial retry backoff in milliseconds */
    initialBackoffMs: number;
    /** Backoff multiplier for exponential strategy */
    backoffMultiplier: number;
    /** Team or service responsible for monitoring the DLQ */
    owner: string;
    /** Alert threshold: raise alert when DLQ depth exceeds this count */
    alertThreshold: number;
}
export interface SagaStep {
    /** Unique step identifier within the Saga */
    id: string;
    /** Human-readable name of the step */
    name: string;
    /** Service responsible for executing this step */
    service: string;
    /** Event emitted when this step succeeds */
    successEvent: string;
    /** Event emitted when this step fails */
    failureEvent: string;
    /** Event that compensates (undoes) the effect of this step */
    compensationEvent: string;
    /** Conditions under which this step is considered failed */
    failureConditions: string[];
    /** Steps that must complete before this one can execute */
    dependsOn: string[];
}
export interface SagaContract {
    /** Unique Saga identifier, e.g. "checkout-saga" */
    id: string;
    /** Human-readable description of what the Saga achieves */
    description: string;
    /** Coordination style: choreography (events only) or orchestration (central orchestrator) */
    coordinationStyle: SagaCoordinationStyle;
    /** Ordered list of Saga steps */
    steps: SagaStep[];
    /** Name of the orchestrator service, if style is "orchestration" */
    orchestratorService?: string;
    /** SPEC-XXX IDs that implement parts of this Saga */
    referencedBySpecs: string[];
}
export interface EventSchemaDrift {
    /** Event contract name where drift was detected */
    contractName: string;
    /** Contract version the implementation should conform to */
    expectedVersion: string;
    /** Detected differences between implemented schema and contract */
    mismatches: {
        field: string;
        expectedType: string;
        actualType: string;
        required: boolean;
    }[];
    /** Whether the drift is backward-compatible or breaking */
    severity: 'additive' | 'breaking';
}
export interface BrokerConfig {
    id: BrokerKind;
    displayName: string;
    deliveryGuarantee: DeliveryGuarantee;
    supportsExactlyOnce: boolean;
    exactlyOnceNote?: string;
    dlqSupport: string;
    schemaRegistrySupport: boolean;
    schemaRegistryNote?: string;
    detectionPatterns: string[];
}
export interface EventBrokersConfig {
    brokers: BrokerConfig[];
}
export interface PayloadValidationViolation {
    field: string;
    issue: string;
    expectedType?: string;
    actualType?: string;
}
export interface PayloadValidationResult {
    valid: boolean;
    violations: PayloadValidationViolation[];
}
export interface GenerateContractInput {
    projectId: string;
    eventName: string;
    producer: string;
    consumers: string[];
    payloadFields: {
        name: string;
        type: string;
        required: boolean;
        description?: string;
    }[];
    broker?: BrokerKind;
    specId?: string;
}
export interface ValidateContractInput {
    projectId: string;
    eventName: string;
    payload: Record<string, unknown>;
}
export interface EvolveContractInput {
    projectId: string;
    eventName: string;
    changeDescription: string;
    addedFields?: string[];
    removedFields?: string[];
    changedFields?: {
        field: string;
        from: string;
        to: string;
    }[];
    deprecatedFields?: {
        field: string;
        reason: string;
        sunsetVersion: string;
    }[];
}
export interface SagaSpecInput {
    projectId: string;
    sagaId: string;
    description: string;
    coordinationStyle: SagaCoordinationStyle;
    steps: SagaStep[];
    orchestratorService?: string;
    specId?: string;
}
export interface EventContractsInput {
    subcommand: 'generate-contract' | 'validate-contract' | 'evolve-contract' | 'saga-spec';
    projectId: string;
    generateContract?: GenerateContractInput;
    validateContract?: ValidateContractInput;
    evolveContract?: EvolveContractInput;
    sagaSpec?: SagaSpecInput;
}
//# sourceMappingURL=events.d.ts.map