import type { EventBus } from '../core/event-bus.js';
type WatchableWorkspace = {
    id: string;
    taskId: string;
    worktreePath: string;
    workingDir: string;
    task: {
        projectId: string;
    };
};
type ActiveWorkspaceQuery = () => Promise<WatchableWorkspace[]>;
export interface WorkspaceGitWatcherOptions {
    debounceMs?: number;
    retryMs?: number;
    loadActiveWorkspaces?: ActiveWorkspaceQuery;
}
/**
 * Watches ACTIVE worktree workspaces for filesystem and git metadata changes.
 *
 * The service intentionally listens to the filesystem rather than terminal
 * output, so changes from the built-in shell, external terminals, IDEs, and
 * scripts all flow through the same path.
 */
export declare class WorkspaceGitWatcherService {
    private readonly eventBus;
    private watchers;
    private debounceMs;
    private retryMs;
    private startupGeneration;
    private startupActive;
    private serviceGeneration;
    private workspaceGenerations;
    private readonly loadActiveWorkspaces;
    constructor(eventBus: EventBus, options?: WorkspaceGitWatcherOptions);
    start(): Promise<void>;
    stop(): void;
    refreshWorkspace(workspaceId: string): Promise<void>;
    watchWorkspace(workspace: WatchableWorkspace): Promise<void>;
    private watchWorkspaceInternal;
    unwatchWorkspace(workspaceId: string): void;
    private closeManagedWorkspace;
    getWatchedWorkspaceIds(): string[];
    private isStartupCurrent;
    private canContinueStartup;
    private beginWorkspaceRegistration;
    private invalidateWorkspaceRegistration;
    private nextWorkspaceGeneration;
    private isRegistrationCurrent;
    private findActiveWorkspaces;
    private sameWorkspace;
    private buildWatchTargets;
    private dedupeTargets;
    private resolveGitDirs;
    private resolveGitPath;
    private openWatcher;
    private isRecursiveWatchUnsupported;
    private openDirectoryTreeWatchers;
    private openNonRecursiveWatcher;
    private scheduleRetry;
    private shouldIgnorePath;
    private scheduleChange;
    private scheduleMaybeChanged;
    private emitMaybeChanged;
    private execGit;
}
export {};
//# sourceMappingURL=workspace-git-watcher.service.d.ts.map