import type { LiveBot } from '../services/team-roster.js';
/** Thrown by fetchWithTimeout when a hub/spoke call doesn't answer in time. */
export declare class HubTimeout extends Error {
    constructor();
}
export type Fetcher = typeof fetch;
/** Wrap an outbound call with an abort timeout; surface a distinguishable timeout. */
export declare function fetchWithTimeout(fetcher: Fetcher, url: string, init?: RequestInit, ms?: number): Promise<Response>;
/** Map an outbound call failure to a stable {status, error}. */
export declare function hubError(e: unknown): {
    status: number;
    error: string;
};
export interface OrchestrateGroupDeps {
    /** Picks a LOCAL online creator + proxies to its daemon (federated bots added by app_id). */
    createTeamGroup: (args: {
        name: string;
        larkAppIds: string[];
        ownerUnionIds?: string[];
    }) => Promise<{
        ok: boolean;
        chatId?: string;
        shareLink?: string;
        invalidBotIds?: string[];
        invalidOwnerUnionIds?: string[];
        error?: string;
    }>;
    fetcher: Fetcher;
    /** Live daemon-registry bots (authoritative local roster source). */
    live?: LiveBot[];
}
export interface OrchestrateGroupArgs {
    name: string;
    larkAppIds: string[];
    /** Hub-derived/local operator union_id (the person who initiated). Undefined ⇒
     *  operator identity not bound (missingOperatorIdentity surfaced). NEVER trust
     *  a client-supplied value — callers derive this from auth. */
    operatorUnionId?: string;
    /** Idempotency key for delegate calls (one per 拉群). */
    requestId: string;
    /** Team whose aggregated roster gates the selection (hub may host non-default teams). */
    teamId?: string;
}
/**
 * Validate selection against the team's aggregated roster, collect invitees
 * (operator + selected bots' owners), then create locally if a local online bot
 * exists, else delegate to a federated deployment that owns a selected bot.
 * Returns a transport-agnostic {status, body}.
 */
export declare function orchestrateFederatedGroup(dataDir: string, args: OrchestrateGroupArgs, deps: OrchestrateGroupDeps): Promise<{
    status: number;
    body: any;
}>;
//# sourceMappingURL=federated-group-core.d.ts.map