import * as fs from "fs";
import type { Message } from "../types/index.js";
import { Container } from "../utils/container.js";
import { type SubagentInstance } from "./subagentManager.js";
import type { PermissionMode } from "../types/permissions.js";
export interface ForkedAgentEntry {
    id: string;
    instance: SubagentInstance;
    logPath: string;
    logStream?: fs.WriteStream;
    status: "running" | "completed" | "failed";
}
export interface ForkedAgentManagerCallbacks {
    onForkedAgentStatusChange?: (entries: ForkedAgentEntry[]) => void;
}
export declare class ForkedAgentManager {
    private container;
    private activeForks;
    private callbacks;
    constructor(container: Container, options?: {
        callbacks?: ForkedAgentManagerCallbacks;
    });
    private get subagentManager();
    /**
     * Creates a forked subagent with conversation history and executes it asynchronously (fire-and-forget).
     * Does NOT interact with BackgroundTaskManager.
     */
    forkAndExecute(subagentType: string, messages: Message[], parameters: {
        description: string;
        allowedTools?: string[];
        model?: string;
        permissionModeOverride?: PermissionMode;
    }, prompt: string): Promise<string>;
    private executeFork;
    /**
     * Abort a running forked agent.
     */
    stop(id: string): boolean;
    /**
     * Stop all running forked agents and clear the map.
     */
    cleanup(): void;
    /**
     * Returns list of active forked agents.
     */
    getActiveForks(): ForkedAgentEntry[];
    private notifyChange;
}
//# sourceMappingURL=forkedAgentManager.d.ts.map