export declare function withBotTurnAdmission(larkAppId: string, action: () => Promise | T): Promise; export declare function withBotTurnMutation(larkAppId: string, action: () => Promise | T): Promise; export type BoundedBotTurnMutationResult = { acquired: true; value: T; } | { acquired: false; reason: 'timeout' | 'upgrade_conflict'; }; export declare function tryWithBotTurnMutation(larkAppId: string, acquireTimeoutMs: number, action: () => Promise | T): Promise>; /** * Start an independent admission branch from fire-and-forget code. Normal * same-bot nesting is intentionally reentrant and MUST be awaited by its * caller; JavaScript cannot infer whether a returned Promise was floated. * Detached callers clear both contexts and acquire a fresh counted root lease. */ export declare function runDetachedBotTurnAdmission(larkAppId: string, action: () => Promise | T): Promise; /** Fire-and-forget counterpart for exclusive lifecycle mutations. A detached * mutation inside an admission waits for that admission to drain; one inside a * mutation waits for the parent mutation to reopen the gate. Do not await this * helper from the parent scope whose lease it must wait on. */ export declare function runDetachedBotTurnMutation(larkAppId: string, action: () => Promise | T): Promise; export declare function __testOnly_resetBotTurnMutationGates(): void; //# sourceMappingURL=bot-turn-mutation-gate.d.ts.map