import type { ShellCommandGenerationOutput } from "../shell.commandGeneration/core.js";
export type ShellExecutionGuardPermission = "shell:generate" | "shell:approve";
export type ShellExecutionGuardBoundary = "input" | "permission" | "contract" | "governance" | "scope";
export type ShellExecutionGuardVerdict = "allowed" | "requires-approval" | "blocked";
export type ShellExecutionGuardContext = {
    runtimeId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: {
        allowed?: boolean;
        accepted?: boolean;
        reason?: string;
    };
    grantedPermissions?: readonly ShellExecutionGuardPermission[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type ShellExecutionGuardPolicy = {
    allowedWorkingDirectories?: readonly string[];
    deniedExecutables?: readonly string[];
    requireApprovalForShellOperators?: boolean;
    requireApprovalForSudo?: boolean;
    approvalGranted?: boolean;
};
export type ShellExecutionGuardRequest = {
    command?: string;
    argv?: readonly string[];
    generatedCommand?: ShellCommandGenerationOutput;
    workingDirectory?: string;
    policy?: ShellExecutionGuardPolicy;
    context?: ShellExecutionGuardContext;
};
export type ShellExecutionGuardErrorCode = "MISSING_COMMAND" | "INVALID_COMMAND" | "INVALID_POLICY" | "PERMISSION_DENIED" | "WORKING_DIRECTORY_DENIED" | "GOVERNANCE_REJECTED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_REJECTED" | "REAL_EXECUTION_BLOCKED";
export type ShellExecutionGuardError = {
    code: ShellExecutionGuardErrorCode;
    message: string;
    boundary: ShellExecutionGuardBoundary;
    publicSafe: true;
    internalDetailExposed: false;
};
export type ShellExecutionGuardAuditEvent = {
    type: string;
    toolId: "shell.executionGuard";
    invocationId: string;
    dryRun: boolean;
    commandPreview?: string;
    metadata: Readonly<Record<string, unknown>>;
};
export type ShellExecutionGuardOutput = {
    kind: "agentCore.basicTool.shell.executionGuard";
    command: string;
    argv: readonly string[];
    workingDirectory?: string;
    verdict: ShellExecutionGuardVerdict;
    reasons: readonly string[];
    requiredPermissions: readonly ShellExecutionGuardPermission[];
    requiresTapApproval: boolean;
    dryRun: boolean;
    providerCalled: boolean;
    executionBlocked: true;
    unsafeSideEffects: false;
};
export type ShellExecutionGuardResult = {
    ok: true;
    toolId: "shell.executionGuard";
    output: ShellExecutionGuardOutput;
    audit: readonly ShellExecutionGuardAuditEvent[];
    events: readonly string[];
} | {
    ok: false;
    toolId: "shell.executionGuard";
    error: ShellExecutionGuardError;
    audit: readonly ShellExecutionGuardAuditEvent[];
    events: readonly string[];
};
export declare const shellExecutionGuardDescriptor: {
    readonly toolId: "shell.executionGuard";
    readonly capability: "shell-execution-guard-generation";
    readonly route: "agent_executionEngine.basic_toolLayer.baseTools.shellBase.shellGeneration";
    readonly defaultDryRun: true;
    readonly tapOwnsApproval: true;
    readonly requiredPermissions: readonly ["shell:generate"];
    readonly unsafeSideEffects: false;
};
export declare function buildShellExecutionGuard(request?: ShellExecutionGuardRequest): ShellExecutionGuardResult;
