import type { HttpClient } from "../core/http.js"; import type { ApprovalRequest, CreateApprovalRequest, ApprovalListResponse, OneclawResponse } from "../types.js"; /** * Approvals resource — human-in-the-loop approval workflows. * * Agents can request human approval before accessing sensitive secrets. * Humans review, approve, or deny requests through the dashboard or API. */ export declare class ApprovalsResource { private readonly http; constructor(http: HttpClient); /** * Request human approval for a policy change or sensitive action. * Called by agents — routed to the agent's creator for review. */ request(options: CreateApprovalRequest): Promise>; /** * List approval requests, optionally filtered by status. * @param status - "pending", "approved", or "denied" */ list(status?: "pending" | "approved" | "denied"): Promise>; /** * Approve a pending request. * * Delegates to `decide`. These previously posted to * `/v1/approvals/{id}/approve` and `/deny`, which the API has never served * — the only decision route is `/decide` — so both returned 404 for every * caller. Keeping the methods and routing them correctly preserves the * published surface; deleting them would break callers a second time. * * Pass `stepUpToken` / `mfaToken` when the approval requires step-up. */ approve(requestId: string, options?: { reason?: string; stepUpToken?: string; mfaToken?: string; }): Promise>; /** Deny a pending request with an optional reason. See `approve`. */ deny(requestId: string, reason?: string, options?: { stepUpToken?: string; mfaToken?: string; }): Promise>; /** * Decide on a pending approval (approve or reject). * Used by the mobile app's step-up authentication flow. * * @param requestId - The approval ID * @param decision - "approved" or "rejected" * @param options - Optional reason and auth headers (X-Auth-Confirm, X-MFA-Token) */ decide(requestId: string, decision: "approved" | "rejected", options?: { reason?: string; stepUpToken?: string; mfaToken?: string; }): Promise>; /** * Poll lightweight approval status (agent-only). * Returns `{ status, expires_at }` for approvals the agent created. */ getStatus(requestId: string): Promise>; /** * Withdraw a pending approval (vault ≥ 0.61.28). Callable by the agent that * requested it or the human it was addressed to. First answer wins: if it was * already decided, the existing decision is returned unchanged. */ cancel(requestId: string, reason?: string): Promise>; /** * Poll for the status of a specific approval request (full details, human or agent). * Prefer {@link getStatus} for agent polling — it uses the lightweight status endpoint. */ check(requestId: string): Promise>; /** * Subscribe to approval events via polling. * Calls the callback every `intervalMs` with new/changed approvals. * Returns an unsubscribe function. */ subscribe(callback: (approvals: ApprovalRequest[]) => void, options?: { status?: "pending" | "approved" | "denied"; intervalMs?: number; }): () => void; } //# sourceMappingURL=approvals.d.ts.map