import type { PortableTool } from "../portable-tool.js";
export declare const TEAM_TOOL_NAME: "team";
export type TeamAction = "create" | "delete" | "list" | "status" | "send";
export interface TeamMember {
    name: string;
    role: string;
    tools?: string[];
    /** Working directory for this member (worktree path or inherited cwd). */
    cwd?: string;
    /** Git worktree path if auto-provisioned (CC TeamMember.worktreePath parity). */
    worktreePath?: string;
    /** Git worktree branch name (for cleanup). */
    worktreeBranch?: string;
    /** Whether the member is currently active. */
    isActive?: boolean;
}
export interface TeamToolParams {
    action: TeamAction;
    /** Team name (required for create/delete) */
    teamName?: string;
    /** Team description */
    description?: string;
    /** Members to include (for create) */
    members?: TeamMember[];
    /** Target member name or '*' for broadcast (required for send) */
    to?: string;
    /** Message content (required for send) */
    message?: string;
    /** Optional short summary for logging/routing (send) */
    summary?: string;
}
export declare const TEAM_TOOL_SCHEMA: {
    readonly type: "object";
    readonly properties: {
        readonly action: {
            readonly type: "string";
            readonly enum: readonly ["create", "delete", "list", "status", "send"];
            readonly description: "Team action: create (new team), delete (disband), list (all teams), status (team details), send (message a member and collect the reply).";
        };
        readonly teamName: {
            readonly type: "string";
            readonly description: "Team name. Required for create/delete/status.";
        };
        readonly to: {
            readonly type: "string";
            readonly description: "Target member name, full member id, or '*' to broadcast to all live members. Required for send.";
        };
        readonly message: {
            readonly type: "string";
            readonly description: "Message content to deliver to the member. Required for send.";
        };
        readonly summary: {
            readonly type: "string";
            readonly description: "Optional short summary (for logging/routing). Used by send.";
        };
        readonly description: {
            readonly type: "string";
            readonly description: "Team description/objective. Used for create.";
        };
        readonly members: {
            readonly type: "array";
            readonly description: "Team members with roles and tool restrictions.";
            readonly items: {
                readonly type: "object";
                readonly properties: {
                    readonly name: {
                        readonly type: "string";
                        readonly description: "Agent name/role identifier.";
                    };
                    readonly role: {
                        readonly type: "string";
                        readonly description: "Role description (e.g. 'frontend developer').";
                    };
                    readonly tools: {
                        readonly type: "array";
                        readonly items: {
                            readonly type: "string";
                        };
                        readonly description: "Allowed tools for this member.";
                    };
                };
                readonly required: readonly ["name", "role"];
            };
        };
    };
    readonly required: readonly ["action"];
};
export interface Team {
    name: string;
    description?: string;
    leadId: string;
    members: TeamMember[];
    createdAt: string;
}
export interface TeamResult {
    success: boolean;
    team?: Team;
    teams?: Team[];
    error?: string;
    /** Members that failed to spawn (team still created with the survivors). */
    partialFailures?: Array<{
        name: string;
        error: string;
    }>;
}
export interface TeamSendResult {
    success: boolean;
    recipients?: string[];
    error?: string;
    /** Replies collected from the recipient(s) — the message loop is synchronous. */
    replies?: Array<{
        memberId: string;
        name: string;
        reply: string;
    }>;
}
export interface TeamToolDeps {
    createTeam(params: {
        teamName: string;
        description?: string;
        members?: TeamMember[];
    }): Promise<TeamResult>;
    deleteTeam(teamName: string): Promise<TeamResult>;
    listTeams(): Promise<TeamResult>;
    getTeamStatus(teamName: string): Promise<TeamResult & {
        memberProgress?: Record<string, {
            mediaProgress?: {
                taskId: string;
                mediaType: string;
                percent: number;
                status: string;
                provider?: string;
                updatedAt: number;
            };
            lastToolCall?: string;
            idleFor?: number;
            runningFor?: number;
        }>;
    }>;
    /** Deliver a message to member(s) and collect their replies (send action). */
    sendMessage(params: {
        to: string;
        message: string;
        summary?: string;
        senderId: string;
    }): Promise<TeamSendResult>;
    /** Current agent's id (send action sender). */
    getSenderId(): string;
    /** Live teammate names (send action target validation). */
    listTeammates(): string[];
}
export declare function createTeamTool(deps: TeamToolDeps): PortableTool<TeamToolParams>;
