export interface CreateGroupOpts { creatorLarkAppId: string; /** Bots expected to join the new chat. Creator is filtered out internally * (Lark rejects self-invite). May be empty (creator-only chat). */ larkAppIds: string[]; name?: string; userOpenIds?: string[]; /** Users to add by union_id (tenant-stable) — used to pull bot OWNERS into a * federated group regardless of which bot they paired through (open_id is * app-scoped, union_id is not). Added after the chat is created. */ ownerUnionIds?: string[]; /** Tenant-stable owner target for federated/team groups. Resolved to an * app-scoped open_id after the owner has been added to the chat. */ transferOwnerUnionId?: string; transferOwnerTo?: string; notifyOwnerOpenId?: string; /** Optional working directory to bind the newly created chat to oncall for * every invited bot. The path is validated by callers; this service only * persists the binding after chat.create succeeds. */ bindWorkingDir?: string; /** Optional reusable role suite to bootstrap. The creator bot applies its * local entry directly; peer bots are prompted by a multi-mention * `/role profile apply` command in the newly created chat. */ roleProfileId?: string; /** Optional kickoff: after the chat is created, the creator @-mentions this * bot and posts `kickoffPrompt` as a top-level message. Used to * auto-trigger a bot (e.g. a reviewer) in the new group without a human * having to @ it. The kickoff bot must be present in `larkAppIds`. */ kickoffBotLarkAppId?: string; kickoffPrompt?: string; /** Authorization-grade preflight run after peer invitations settle and * before any role/kickoff bot message. CLI cold-group creation uses this to * establish the exact talk-only grant matrix; rejection aborts initialization * while preserving the already-announced chatId for controlled recovery. */ ensureBotCollaboration?: (chatId: string, joinedBotAppIds: string[], rejectedBotAppIds: string[]) => Promise; /** Synchronous progress hook fired immediately after chat.create returns a * chatId, before bot invites, share-link lookup, owner transfer, oncall * binding, or role bootstrap. CLI callers use this as the durable * side-effect boundary: once notified, retrying create would duplicate the * group even if a later best-effort step hangs or fails. */ onChatCreated?: (chatId: string) => void; } export interface CreateGroupResult { ok: true; chatId: string; creator: string; invalidBotIds: string[]; invalidUserIds: string[]; /** Owner union_ids Lark could not add to the chat (best-effort). */ invalidOwnerUnionIds: string[]; ownerTransferredTo: string | null; transferError: string | null; notifyMessageId: string | null; notifyError: string | null; /** Shareable join link (others can click to *join*). null when the Lark * link API failed — caller falls back to the member-only applink URL. */ shareLink: string | null; shareLinkError: string | null; oncallBindings: { larkAppId: string; ok: boolean; created?: boolean; error?: string; }[]; roleProfileBootstrapMessageId: string | null; roleProfileBootstrapError: string | null; kickoffMessageId: string | null; kickoffError: string | null; } export interface TransferGroupOwnerOpts { creatorLarkAppId: string; chatId: string; ownerId: string; ownerIdType?: 'open_id' | 'union_id'; } export interface TransferGroupOwnerResult { ownerTransferredTo: string | null; transferError: string | null; } /** * Best-effort ownership transfer for an already-created group. Federation uses * this after an out-of-scope operator has been added by their own deployment; * accepting union_id avoids leaking an app-scoped open_id back to the creator. */ export declare function transferGroupOwner(opts: TransferGroupOwnerOpts): Promise; export declare function createGroupWithBots(opts: CreateGroupOpts): Promise; //# sourceMappingURL=group-creator.d.ts.map