/**
 * DomainBridge — bridges RuntimeEventBus events to OTel span creation.
 *
 * Subscribes to all domain channels on the RuntimeEventBus and routes
 * lifecycle events to the appropriate span helper functions. Maintains
 * an active span map keyed by entity ID so that start events open spans
 * and terminal events close them with outcome context.
 *
 * Design principles:
 * - Span creation is purely observational — bridge failures must not
 *   affect the domain logic that emits events.
 * - All map lookups are safe — missing spans on terminal events are no-ops.
 * - The bridge is opt-in: calling `attach()` wires it; `detach()` unwires.
 */
import type { RuntimeEventBus } from '../../events/index.js';
import type { RuntimeTracer } from '@pellux/goodvibes-sdk/platform/runtime/telemetry/tracer';
import type { CascadeAppliedEvent } from '@pellux/goodvibes-sdk/platform/runtime/health/types';
/**
 * DomainBridge wires the RuntimeEventBus to the OTel span system.
 *
 * Usage:
 * ```ts
 * const bridge = new DomainBridge(tracer);
 * const detach = bridge.attach(bus);
 * // later:
 * detach();
 * ```
 */
export declare class DomainBridge {
    private readonly _tracer;
    /** Active spans per domain, keyed by entity ID. */
    private readonly _pluginSpans;
    private readonly _mcpSpans;
    private readonly _transportSpans;
    private readonly _taskSpans;
    private readonly _agentSpans;
    private readonly _permissionSpans;
    private readonly _sessionSpans;
    private readonly _compactionSpans;
    constructor(tracer: RuntimeTracer);
    /**
     * Attach the bridge to the given event bus.
     *
     * Subscribes to all domain channels. Returns a cleanup function that
     * unsubscribes all listeners when called.
     *
     * @param bus - The RuntimeEventBus to subscribe to.
     * @returns A `detach` function that unsubscribes all domain listeners.
     */
    attach(bus: RuntimeEventBus): () => void;
    /**
     * Record a health cascade event as a point-in-time span.
     *
     * Called by the caller when CASCADE_APPLIED events are produced by the
     * CascadeEngine. The caller is responsible for providing the trace ID
     * from their current operational context.
     *
     * @param event - The CASCADE_APPLIED event.
     * @param traceId - Trace ID to use for correlation.
     */
    recordCascade(event: CascadeAppliedEvent, traceId: string): void;
    private _safe;
    private _withSpan;
    private _closeSpan;
    private _helpers;
}
//# sourceMappingURL=domain-bridge.d.ts.map