/** * v3 loop 追加一轮卡点击处理 —— card-handler 的 v3 分支(与 * `v3-blocked-card-handler` 同骨架)。把一次「➕ 追加 1 轮」点击翻译成: * 权限校验 → `requestV3LoopGrant`(幂等:pendingGrant → already-granted) * → 冻结卡 / toast + 触发 `driveV3Run` 跑新一轮。 * * 纯逻辑 + 注入 seam(requestGrant / driveRun / canResolve),单测友好。 */ import { type V3LoopGrantActionValue } from './v3-loop-grant-card.js'; import { requestV3LoopGrant } from '../../workflows/v3/daemon-run.js'; import { type RunChatBinding } from '../../workflows/v3/grill-state.js'; export declare function isV3LoopGrantAction(action: unknown): boolean; export interface V3LoopGrantCardHandlerDeps { baseDir?: string; /** Re-enter the run after a grant append. Fire-and-forget (daemon logs errors). */ driveRun: (runId: string) => void; /** Permission: may this operator grant iterations of this run? Same * semantics as the gate/blocked handlers' canResolve. */ canResolve?: (binding: RunChatBinding | undefined, operatorOpenId: string | undefined) => boolean; /** Injectable for tests. Default = real requestV3LoopGrant. */ requestGrant?: typeof requestV3LoopGrant; } /** * Handle a v3 loop-grant card click. Returns the Lark card-action response: * a frozen「已追加」card, or a `{ toast }`. Triggers `driveRun` on success. */ export declare function handleV3LoopGrantAction(value: V3LoopGrantActionValue, operatorOpenId: string | undefined, deps: V3LoopGrantCardHandlerDeps): Promise; //# sourceMappingURL=v3-loop-grant-card-handler.d.ts.map