/** * Bot ref resolver for `botmux create-group`. Pure function, no I/O — testable * in isolation by passing in mock bot configs + bot-info entries. * * Resolution order for each ref: * 1. Exact `larkAppId` match * 2. `botName` from bots-info.json (case-insensitive) * 3. `cliId` from bots.json (case-insensitive) — fallback when botName is * unknown (bots-info.json gets populated by daemon at startup) * * Multiple matches by name → take the first in `botConfigs` order (= bots.json * traversal order, the user's deployment intent). Same ref repeated → dedup, * keeping first occurrence. Unresolvable ref → reported in `invalid` list. */ export interface BotConfigForResolve { larkAppId: string; cliId: string; } export interface BotInfoForResolve { larkAppId: string; botName: string | null; } export interface BotInfoForKickoff { larkAppId: string; botOpenId: string | null; } export type ResolvedKickoff = { ok: true; targetLarkAppId?: string; prompt?: string; } | { ok: false; error: string; }; export interface ResolvedBots { /** Resolved larkAppIds in input order, deduped. First element is creator. */ larkAppIds: string[]; /** Refs that couldn't be matched to any bot. */ invalid: string[]; /** Warnings about ambiguous name → first match picked. */ ambiguousWarnings: string[]; } export interface CreateGroupCompletionStatus { success: boolean; chatCreated: true; chatId: string; collaborationReady: boolean; kickoffAccepted: boolean; kickoffRequested: boolean; kickoffMessageId: string | null; kickoffError: string | null; } /** Build the machine-readable terminal status for create-group. A created chat * is not a successful group initialization until collaboration is ready and an * explicitly requested kickoff was accepted. */ export declare function createGroupCompletionStatus(input: { chatId: string; collaborationReady: boolean; kickoffRequested: boolean; kickoffMessageId: string | null; kickoffError: string | null; }): CreateGroupCompletionStatus; /** Preserve the long-standing stdout contract: create-group emits only the * chatId by default, including partial/non-zero outcomes. Callers that can * consume a second structured line must opt in explicitly. */ export declare function shouldWriteCreateGroupCompletionStatus(_status: CreateGroupCompletionStatus, explicitJsonStatus: boolean): boolean; export declare function resolveBotRefs(refs: string[], botConfigs: BotConfigForResolve[], botInfo: BotInfoForResolve[]): ResolvedBots; /** * Validate the optional kickoff pair and resolve the user-facing bot open_id * back to a selected larkAppId. The service later obtains the target bot's * observer-scoped open_id from the creator app before sending the @mention; * a bot's self-reported open_id is not valid across Lark apps. */ export declare function resolveKickoff(botOpenIdRaw: string | undefined, promptRaw: string | undefined, selectedLarkAppIds: string[], botInfo: BotInfoForKickoff[]): ResolvedKickoff; //# sourceMappingURL=create-group-resolver.d.ts.map