/** * ApprovalQueue — holds actions that received a `require-approval` verdict * from the Governor, and lets external code approve or reject them. */ import type { AgentPlan, PolicyAction, ToolExecutionContext } from "@loomic/types"; import type { ActionVerdict } from "./governor.js"; import { UIComposer } from "./ui-composer.js"; import { ToolRegistry } from "./tool-registry.js"; import { RuntimeEventEmitter } from "./event-emitter.js"; export type PendingApproval = { id: string; cycleId: string; action: PolicyAction; verdict: ActionVerdict; /** Index into the original plan's action list */ actionIndex: number; /** Category: "ui" | "tool" | "memory" */ category: "ui" | "tool" | "memory"; createdAt: string; }; export type ApprovalResult = { approved: boolean; executionResult?: unknown; error?: string; }; export declare class ApprovalQueue { private readonly uiComposer; private readonly toolRegistry; private readonly emitter; private readonly pending; private plan; constructor(uiComposer: UIComposer, toolRegistry: ToolRegistry, emitter: RuntimeEventEmitter); /** * Enqueue actions that require approval from a plan+verdict evaluation. * Called by the executor after it processes allowed actions. */ enqueueFromVerdict(plan: AgentPlan, verdicts: ActionVerdict[], cycleId: string): PendingApproval[]; /** List all pending approval requests. */ listPending(): PendingApproval[]; /** Approve a pending action and execute it. */ approve(approvalId: string, context: ToolExecutionContext): Promise; /** Reject a pending action. */ reject(approvalId: string, reason?: string): boolean; /** Reset counter (for testing). */ _reset(): void; } //# sourceMappingURL=approval-queue.d.ts.map