/**
 * DecisionEvent Emitter
 *
 * CONSTITUTION REFERENCE: PROMPT 0, PROMPT 2
 *
 * PURPOSE: Emit CLI UX-level DecisionEvents to ruvector-service.
 *
 * EMISSION RULES:
 * - At most ONE DecisionEvent per agent invocation
 * - Async, non-blocking emission only
 * - NEVER persists locally
 * - MAY fail silently (UX must not depend on emission)
 *
 * DATA RULES:
 * - Only emit UX telemetry and interaction data
 * - Never emit raw inputs or sensitive data
 * - Always use hashes for reproducibility
 */
import type { DecisionEvent, DecisionType, ConfidenceScore, ConstraintsApplied, ExecutionReference, EnvironmentContext, TelemetryEventType, TelemetryData } from './types.js';
export interface DecisionEventBuilderOptions {
    trace_id: string;
    command: string;
    subcommand?: string;
}
/**
 * Builder for constructing DecisionEvents.
 * Ensures all required fields are set before emission.
 */
export declare class DecisionEventBuilder {
    private readonly trace_id;
    private readonly command;
    private readonly subcommand?;
    private decision_type;
    private inputs_hash;
    private result_type;
    private artifact_ref?;
    private services_invoked;
    private confidence;
    private constraints;
    private execution_ref;
    constructor(options: DecisionEventBuilderOptions);
    /**
     * Set decision type.
     */
    withDecisionType(type: DecisionType): this;
    /**
     * Set inputs hash from raw inputs.
     * Computes hash, never stores raw data.
     */
    withInputsHash(inputs: unknown): this;
    /**
     * Set result type.
     */
    withResultType(type: 'success' | 'error' | 'guidance'): this;
    /**
     * Set artifact reference.
     */
    withArtifactRef(ref: string): this;
    /**
     * Add services that were invoked.
     */
    withServicesInvoked(services: string[]): this;
    /**
     * Set confidence score.
     */
    withConfidence(confidence: ConfidenceScore): this;
    /**
     * Set constraints applied.
     */
    withConstraints(constraints: ConstraintsApplied): this;
    /**
     * Set environment context.
     */
    withEnvironment(env: EnvironmentContext): this;
    /**
     * Set execution reference from downstream service.
     */
    withExecutionRef(ref: ExecutionReference): this;
    /**
     * Build the DecisionEvent.
     */
    build(): DecisionEvent;
    /**
     * Compute hash of inputs for reproducibility.
     */
    private computeHash;
    private sortKeys;
}
export interface DecisionEventEmitterConfig {
    /** RuVector service URL */
    ruvector_url?: string;
    /** Enable emission (default: true if ruvector_url set) */
    enabled?: boolean;
    /** Timeout for emission in ms */
    timeout?: number;
    /** Auth token for ruvector-service */
    auth_token?: string;
}
/**
 * Emits DecisionEvents to ruvector-service.
 *
 * CRITICAL: Emission is async and non-blocking.
 * Failures are logged but do not affect UX flow.
 */
export declare class DecisionEventEmitter {
    private readonly config;
    constructor(config?: DecisionEventEmitterConfig);
    /**
     * Check if emission is enabled.
     */
    isEnabled(): boolean;
    /**
     * Emit a DecisionEvent.
     *
     * RULES:
     * - Async, non-blocking
     * - Never throws - failures are silent
     * - Only one event per invocation should be emitted
     */
    emit(event: DecisionEvent): Promise<EmissionResult>;
    /**
     * Emit without waiting (fire and forget).
     * Failures are logged to stderr — no silent swallowing.
     */
    emitAsync(event: DecisionEvent): void;
}
export interface EmissionResult {
    success: boolean;
    event_id?: string;
    reason?: 'emission_disabled' | 'http_error' | 'timeout' | 'network_error';
    status_code?: number;
}
export interface TelemetryEmitterConfig {
    /** Enable telemetry emission */
    enabled?: boolean;
    /** Telemetry endpoint */
    endpoint?: string;
    /** Batch size before flush */
    batch_size?: number;
    /** Flush interval in ms */
    flush_interval?: number;
}
/**
 * Emits telemetry events compatible with LLM-Observatory.
 */
export declare class TelemetryEmitter {
    private readonly config;
    private readonly buffer;
    private flushTimer;
    constructor(config?: TelemetryEmitterConfig);
    /**
     * Record a telemetry event.
     */
    record(event_type: TelemetryEventType, agent_id: string, trace_id: string, data: TelemetryData): void;
    /**
     * Flush buffered events.
     */
    flush(): Promise<void>;
    /**
     * Stop the flush timer.
     */
    stop(): void;
    private startFlushTimer;
}
/**
 * Create a DecisionEvent builder.
 */
export declare function createDecisionEventBuilder(options: DecisionEventBuilderOptions): DecisionEventBuilder;
/**
 * Create a DecisionEvent emitter.
 */
export declare function createDecisionEventEmitter(config?: DecisionEventEmitterConfig): DecisionEventEmitter;
/**
 * Create a telemetry emitter.
 */
export declare function createTelemetryEmitter(config?: TelemetryEmitterConfig): TelemetryEmitter;
//# sourceMappingURL=decision-event.d.ts.map