import { type OpencodeEventSubscription, type OpencodeRuntime } from "./opencode-client.js"; export type WorktreeEventHandler = (event: unknown) => void | Promise; /** * Fan-out hub for OpenCode `event.subscribe` streams keyed by worktree directory. * One SDK subscription per worktree; loop and swarm engines share it via ref-counted consumers. */ export declare class WorktreeEventBridge { private readonly worktree; private readonly runtime; private readonly registryKey; private readonly consumers; private subscription; private starting; constructor(worktree: string, runtime: OpencodeRuntime, registryKey: string); subscribe(handler: WorktreeEventHandler): Promise; get consumerCount(): number; private ensureStarted; private stopSubscription; dispose(): void; } /** Returns a shared event bridge for the given worktree (one per normalized path). */ export declare function getWorktreeEventBridge(worktree: string, runtime: OpencodeRuntime): WorktreeEventBridge; /** Subscribe to OpenCode events through the shared worktree bridge. */ export declare function subscribeWorktreeEvents(worktree: string, runtime: OpencodeRuntime, handler: WorktreeEventHandler): Promise; /** Test helper — tear down all bridges. */ export declare function disposeAllWorktreeEventBridges(): void; //# sourceMappingURL=worktree-event-bridge.d.ts.map