mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 21:07:01 -06:00
8853217ec7
* fix: harden approval abort lifecycle * fix(gateway): recheck abort before committing detached exec authorization * fix(gateway): recheck abort after inline exec authorization commit * fix(gateway): propagate run-abort cancellation on the inline approval path * fix(ci): refresh approval protocol bindings
23 lines
761 B
TypeScript
23 lines
761 B
TypeScript
import type { ExecApprovalDecision } from "../../infra/exec-approvals.js";
|
|
import type { ExecApprovalRecord } from "../exec-approval-manager.js";
|
|
import type { OperatorApprovalTerminalReason } from "../operator-approval-store.js";
|
|
|
|
export type WaitReasonResolver<TPayload> = (
|
|
snapshot: ExecApprovalRecord<TPayload>,
|
|
) => OperatorApprovalTerminalReason | null | undefined;
|
|
|
|
export function buildWaitResponse<TPayload>(
|
|
id: string,
|
|
decision: ExecApprovalDecision | null,
|
|
snapshot: ExecApprovalRecord<TPayload>,
|
|
terminalReason?: OperatorApprovalTerminalReason | null,
|
|
) {
|
|
return {
|
|
id,
|
|
decision,
|
|
createdAtMs: snapshot.createdAtMs,
|
|
expiresAtMs: snapshot.expiresAtMs,
|
|
terminalReason: terminalReason ?? snapshot.terminalReason,
|
|
};
|
|
}
|