/** * Telemetry instrumentation, barrel and factory. * * Provides `createInstrumentation()` which wires the DomainBridge to * a RuntimeEventBus and returns a handle for detaching and cascade recording. * * @example * ```ts * import { createInstrumentation } from './instrumentation/index.js'; * * const { detach, recordCascade } = createInstrumentation(tracer, bus); * * // When a cascade fires: * recordCascade(cascadeAppliedEvent, currentTraceId); * * // On shutdown: * detach(); * ``` */ import type { RuntimeTracer } from '../tracer.js'; import type { RuntimeEventBus } from '../../events/index.js'; import type { CascadeAppliedEvent } from '../../health/types.js'; export { DomainBridge } from './domain-bridge.js'; /** Handle returned by `createInstrumentation()`. */ export interface InstrumentationHandle { /** * Detach all event listeners from the bus. * Call during graceful shutdown to prevent listener leaks. */ detach: () => void; /** * Record a health cascade event as a point-in-time span. * * @param event - The CASCADE_APPLIED event from the CascadeEngine. * @param traceId - Trace ID to correlate with the active operational context. */ recordCascade: (event: CascadeAppliedEvent, traceId: string) => void; } /** * Create and attach domain instrumentation to a RuntimeEventBus. * * Subscribes to all domain channels (plugin, mcp, transport, task, agent, * permission, session, compaction) and creates OTel spans for each * lifecycle state machine transition. * * @param tracer - The RuntimeTracer to use for span creation. * @param bus - The RuntimeEventBus to subscribe to. * @returns An InstrumentationHandle for cleanup and cascade recording. */ export declare function createInstrumentation(tracer: RuntimeTracer, bus: RuntimeEventBus): InstrumentationHandle; //# sourceMappingURL=index.d.ts.map