/ utils / sinks.ts
sinks.ts
 1  import { initializeAnalyticsSink } from '../services/analytics/sink.js'
 2  import { initializeErrorLogSink } from './errorLogSink.js'
 3  
 4  /**
 5   * Attach error log and analytics sinks, draining any events queued before
 6   * attachment. Both inits are idempotent. Called from setup() for the default
 7   * command; other entrypoints (subcommands, daemon, bridge) call this directly
 8   * since they bypass setup().
 9   *
10   * Leaf module — kept out of setup.ts to avoid the setup → commands → bridge
11   * → setup import cycle.
12   */
13  export function initSinks(): void {
14    initializeErrorLogSink()
15    initializeAnalyticsSink()
16  }