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; /** Map an outbound call failure to a stable {status, error}. */ export declare function hubError(e: unknown): { status: number; error: string; }; export interface TeamGroupCreateResult { ok: boolean; chatId?: string; shareLink?: string; creator?: string; invalidBotIds?: string[]; invalidUserIds?: string[]; invalidOwnerUnionIds?: string[]; ownerTransferredTo?: string | null; transferError?: string | null; notifyMessageId?: string | null; notifyError?: string | null; error?: string; } export interface TeamGroupOwnerTransferResult { ownerTransferredTo: string | null; transferError: string | null; notifyMessageId?: string | null; notifyError?: string | null; } 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[]; transferOwnerUnionId?: string; }) => Promise; /** Re-enter the ORIGINAL local creator daemon after a remote deployment has * added the operator. Uses union_id so no app-scoped open_id crosses layers. */ transferTeamGroupOwner?: (args: { creatorLarkAppId: string; chatId: string; transferOwnerUnionId: string; }) => Promise; 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