/**
 * Runtime-owned approval flow helpers.
 *
 * Keeps approval request shaping and post-approval grant application in one
 * place so composition code can stay thin.
 */
import type { ToolExecutionContext } from '../../core/core-types.js';
import type { RuntimeFilesystemPermissionPolicy, RuntimeShellPermissionPolicy } from '../../core/permission-policy.js';
import { type ApprovalChoice, type ApprovalRequest, type BashApprovalData, type FileAccessApprovalData, type TaskSpawnApprovalData } from '../approvals/types.js';
import type { SettingsManager } from '../settings-manager.js';
type RiskyShellOperationRule = {
    label: string;
    reason: string;
    pattern: RegExp;
};
type RiskyShellOperation = Pick<RiskyShellOperationRule, 'label' | 'reason'>;
export declare function getRiskyShellOperations(command: string): RiskyShellOperation[];
export declare function hasRiskyShellOperation(command: string): boolean;
/** Render an explanatory message for a granted filesystem approval choice. */
export declare function describeFilesystemApprovalChoice(request: ApprovalRequest<FileAccessApprovalData>, choice: ApprovalChoice): string | undefined;
/** Build the approval request payload for a filesystem access decision. */
export declare function buildFilesystemApprovalRequest(absolutePath: string, access: 'read' | 'write', policy: RuntimeFilesystemPermissionPolicy): Promise<ApprovalRequest<FileAccessApprovalData>>;
/** Check whether a filesystem call is allowed without prompting under the current policy. */
export declare function isFilesystemInvocationSafe(absolutePath: string, access: 'read' | 'write', policy: RuntimeFilesystemPermissionPolicy, ctx: ToolExecutionContext | undefined): Promise<boolean>;
/** Persist the user's filesystem-approval choice into settings, session state, and tool ctx. */
export declare function applyFilesystemApprovalChoice(choice: ApprovalChoice, request: ApprovalRequest<FileAccessApprovalData>, access: 'read' | 'write', settingsManager: SettingsManager, ctx: ToolExecutionContext | undefined): ToolExecutionContext | undefined;
/** Build the approval request payload for a shell command. */
export declare function buildShellApprovalRequest(params: Record<string, unknown>, toolName: string): ApprovalRequest<BashApprovalData>;
/** Build the approval request payload for a task subagent spawn. */
export declare function buildTaskSpawnApprovalRequest(payload: TaskSpawnApprovalData): ApprovalRequest<TaskSpawnApprovalData>;
/** Check whether the shell policy allows invocations without prompting. */
export declare function isShellInvocationSafe(policy: RuntimeShellPermissionPolicy | undefined, command?: string): boolean;
/** Record an approved shell command on the tool execution context. */
export declare function applyShellApprovalChoice(ctx: ToolExecutionContext | undefined, params: Record<string, unknown>): ToolExecutionContext | undefined;
/** Translate a task-spawn approval choice into a one-shot subagent spawn grant. */
export declare function applyTaskSpawnApprovalChoice(ctx: ToolExecutionContext | undefined, request: ApprovalRequest<TaskSpawnApprovalData>, choice?: ApprovalChoice): ToolExecutionContext | undefined;
export {};
//# sourceMappingURL=runtime-approval-flow.d.ts.map