export type SquadAutonomy = 'supervised' | 'semi-autonomous' | 'autonomous';
export interface OrgNode {
    agentId: string;
    role: string;
    reportsTo?: string;
    department?: string;
    budgetCents?: number;
    canDelegateTo: string[];
}
export interface SquadAgentSlot {
    agentId: string;
    role: string;
    capabilities: string[];
}
export interface SquadRoutingRule {
    pattern: string;
    agentId: string;
    priority: number;
}
export interface SquadDefinition {
    id: string;
    name: string;
    description?: string;
    leadAgentId: string;
    roster: SquadAgentSlot[];
    routingRules: SquadRoutingRule[];
    autonomy: SquadAutonomy;
    /** Hard ceiling on handoff chain depth; default 3. */
    maxHandoffDepth: number;
    /** Per-squad concurrent sub-agent limit; default 3. */
    maxConcurrentAgents: number;
    /** Company scoping — squads belong to a company for multi-tenant isolation. */
    companyId?: string;
    /** Org chart — hierarchical agent teams with delegation and reporting lines. */
    orgChart?: OrgNode[];
    createdAt: string;
    updatedAt: string;
}
export interface CreateSquadInput {
    id?: string;
    name: string;
    description?: string;
    leadAgentId: string;
    roster?: SquadAgentSlot[];
    routingRules?: SquadRoutingRule[];
    autonomy?: SquadAutonomy;
    maxHandoffDepth?: number;
    maxConcurrentAgents?: number;
    companyId?: string;
    orgChart?: OrgNode[];
}
export interface RouteResult {
    agentId: string;
    reason: string;
    matchedRule?: SquadRoutingRule;
    isFallback: boolean;
}
export interface HandoffPlan {
    fromAgentId: string;
    toAgentId: string;
    depth: number;
    allowed: boolean;
    reason: string;
}
export declare function listSquads(projectDir: string, filter?: {
    companyId?: string;
}): Promise<SquadDefinition[]>;
export declare function getSquad(projectDir: string, id: string): Promise<SquadDefinition | undefined>;
export declare function createSquad(projectDir: string, input: CreateSquadInput, now?: Date): Promise<SquadDefinition>;
export declare function updateSquad(projectDir: string, id: string, patch: Partial<CreateSquadInput>, now?: Date): Promise<SquadDefinition>;
export declare function deleteSquad(projectDir: string, id: string): Promise<boolean>;
/**
 * Pick an agent for the message. Iterates routing rules in priority order
 * (highest first); first regex match wins. When nothing matches, the lead
 * agent is returned as a fallback.
 */
export declare function routeMessage(squad: SquadDefinition, message: string): RouteResult;
/**
 * Decide whether an agent is allowed to hand off work to another agent.
 * Hard ceiling on chain depth prevents loops. Both agents must appear in
 * the squad roster (or be the lead).
 */
export declare function planHandoff(squad: SquadDefinition, fromAgentId: string, toAgentId: string, currentDepth: number): HandoffPlan;
//# sourceMappingURL=squad.d.ts.map