import { type AcpPermissionEvent, type PermissionOption, type PermissionResolver, type RequestPermissionRequest, type RequestPermissionResponse } from "@automatalabs/workflows"; export interface WorkflowPermissionRequestProjection { /** Safe tool-call projection. The private ACP session id is deliberately omitted. */ toolCall: RequestPermissionRequest["toolCall"]; /** Complete ordered response choices. optionId values are exact; presentation is redacted/bounded. */ options: PermissionOption[]; /** Redacted/bounded request metadata when it fits the public envelope. */ _meta?: Record | null; } export interface WorkflowPermissionDecisionResponse { outcome: RequestPermissionResponse["outcome"]; } export interface WorkflowPendingPermission { version: 1; permissionId: string; runId: string; callIndex: number; backendId: string; label?: string; requestedAt: string; /** Redacted and bounded ACP projection with the complete ordered exact optionId list. */ request: WorkflowPermissionRequestProjection; requestTruncated: boolean; requestRedacted: boolean; } export interface WorkflowPermissionResponseAcknowledgement { permissionId: string; runId: string; callIndex: number; outcome: RequestPermissionResponse["outcome"]; respondedAt: string; } interface PermissionEventSource { on(name: "permission_request", listener: (event: AcpPermissionEvent) => void): () => void; } /** Process-local broker for ACP requests that belong to live workflow agent calls. The request * remains parked inside AcpAgentRunner; status exposes this bounded projection and a later * MCP permission-response resolves the original promise. Nothing here reconstructs a request * after owner death. */ export declare class WorkflowPermissionBroker { private readonly byId; private readonly idsByRun; private readonly changed; private detachEvents; readonly resolver: PermissionResolver; attach(source: PermissionEventSource): void; /** Fired once per parked request with its public projection; returns detach. */ onPending(listener: (permission: WorkflowPendingPermission) => void): () => void; dispose(): void; list(runId: string): WorkflowPendingPermission[]; has(runId: string, permissionId?: string): boolean; waitForPending(runId: string): Promise; respond(runId: string, permissionId: string, response: WorkflowPermissionDecisionResponse): WorkflowPermissionResponseAcknowledgement; private park; private observeFinalOutcome; private finish; private remove; } export {}; //# sourceMappingURL=workflow-permissions.d.ts.map