import type pino from "pino";
import type { GitHubService } from "../../services/github-service.js";
import type { CreatePaseoWorktreeWorkflowFn, CreatePaseoWorktreeWorkflowResult } from "../worktree-session.js";
import type { WorkspaceGitService } from "../workspace-git-service.js";
import type { CreateAgentWorktreeTarget, FirstAgentContext, SessionOutboundMessage } from "../messages.js";
import type { AgentManager } from "./agent-manager.js";
import type { AgentStorage } from "./agent-storage.js";
interface CreateAgentLifecycleDispatchDependencies {
    paseoHome: string;
    worktreesRoot?: string;
    agentManager: AgentManager;
    agentStorage: AgentStorage;
    github: GitHubService;
    workspaceGitService: WorkspaceGitService;
    createPaseoWorktreeWorkflow: CreatePaseoWorktreeWorkflowFn;
    archiveAgentForClose: (agentId: string) => Promise<unknown>;
    archiveWorkspaceRecord: (workspaceId: string) => Promise<void>;
    emit: (message: SessionOutboundMessage) => void;
    emitAgentRemove: (agentId: string) => void;
    emitWorkspaceUpdatesForWorkspaceIds: (workspaceIds: Iterable<string>) => Promise<void>;
    markWorkspaceArchiving: (workspaceIds: Iterable<string>, archivingAt: string) => void;
    clearWorkspaceArchiving: (workspaceIds: Iterable<string>) => void;
    isPathWithinRoot: (rootPath: string, candidatePath: string) => boolean;
    killTerminalsUnderPath: (rootPath: string) => Promise<void>;
    logger: pino.Logger;
}
export declare class CreateAgentLifecycleDispatch {
    private readonly dependencies;
    private readonly autoArchiveAgentIds;
    constructor(dependencies: CreateAgentLifecycleDispatchDependencies);
    createWorktreeForRequest(input: {
        cwd: string;
        target: CreateAgentWorktreeTarget | undefined;
        firstAgentContext: FirstAgentContext;
        hasLegacyGitOptions: boolean;
    }): Promise<CreatePaseoWorktreeWorkflowResult | null>;
    registerAutoArchiveIfRequested(input: {
        autoArchive: boolean | undefined;
        agentId: string;
        createdWorktree: CreatePaseoWorktreeWorkflowResult | null;
    }): void;
    cleanupCreatedWorktreeAfterFailedAgentCreate(input: {
        createdWorktree: CreatePaseoWorktreeWorkflowResult | null;
        createdAgentId: string | null;
    }): Promise<void>;
    private createWorktreeForTarget;
    private registerAutoArchiveOnTerminalState;
    private autoArchiveAgentOnce;
    private archiveAutoCreatedWorktree;
}
export {};
//# sourceMappingURL=create-agent-lifecycle-dispatch.d.ts.map