import type { ShellProcessSpawningPermission } from "../shell.processSpawning/core.js";
export type ShellBackgroundExecutionPermission = ShellProcessSpawningPermission;
export type ShellBackgroundExecutionBoundary = "input" | "scope" | "permission" | "approval" | "contract" | "resource";
export type ShellBackgroundExecutionContext = {
    runtimeId?: string;
    invocationId?: string;
    dryRun?: boolean;
    allowedWorkingDirectories?: readonly string[];
    grantedPermissions?: readonly ShellBackgroundExecutionPermission[];
    approval?: {
        accepted: boolean;
        approvalId?: string;
        reason?: string;
    };
    guard?: {
        accepted?: boolean;
        allowed?: boolean;
        reason?: string;
    };
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type ShellBackgroundExecutionTarget = {
    command: string;
    workingDirectory?: string;
    shell?: "sh" | "bash" | "zsh";
    jobId?: string;
    monitorIntervalMs?: number;
    outputBufferLimitBytes?: number;
    captureOutput?: boolean;
};
export type ShellBackgroundExecutionRequest = {
    target?: Partial<ShellBackgroundExecutionTarget>;
    riskLevel?: "low" | "medium" | "high";
    context?: ShellBackgroundExecutionContext;
};
export type ShellBackgroundExecutionErrorCode = "MISSING_COMMAND" | "INVALID_SHELL" | "INVALID_CWD" | "INVALID_JOB_ID" | "INVALID_CAPTURE_OUTPUT" | "INVALID_MONITOR_INTERVAL" | "INVALID_OUTPUT_BUFFER" | "SCOPE_REJECTED" | "PERMISSION_DENIED" | "APPROVAL_REQUIRED" | "APPROVAL_REJECTED" | "WORKSPACE_WRITE_REQUIRES_CODE_TOOL" | "REAL_EXECUTION_BLOCKED";
export type ShellBackgroundExecutionError = {
    code: ShellBackgroundExecutionErrorCode;
    message: string;
    boundary: ShellBackgroundExecutionBoundary;
    publicSafe: true;
    internalDetailExposed: false;
};
export type ShellBackgroundExecutionAuditEvent = {
    type: string;
    toolId: "shell.backgroundExecution";
    invocationId: string;
    dryRun: boolean;
    workingDirectory?: string;
    metadata: Readonly<Record<string, unknown>>;
};
export type ShellBackgroundExecutionOutput = {
    kind: "agentCore.basicTool.shell.backgroundExecution";
    target: {
        command: string;
        workingDirectory?: string;
        shell: "sh" | "bash" | "zsh";
        jobId: string;
        monitorIntervalMs: number;
        outputBufferLimitBytes: number;
        captureOutput: boolean;
    };
    commandPreview: readonly string[];
    permissionsRequired: readonly ShellBackgroundExecutionPermission[];
    approvalId?: string;
    backgroundContract: {
        returnsImmediately: true;
        monitorableByRuntime: true;
        cancellationRequired: true;
    };
    dryRun: boolean;
    executionBlocked: boolean;
    providerCalled?: boolean;
    unsafeSideEffects: false;
    resultEnvelope: Readonly<Record<string, unknown>> & {
        planned?: true;
        backgroundHandle?: string;
        pid?: number;
    };
};
export type ShellBackgroundExecutionResult = {
    ok: true;
    toolId: "shell.backgroundExecution";
    output: ShellBackgroundExecutionOutput;
    audit: readonly ShellBackgroundExecutionAuditEvent[];
    events: readonly string[];
} | {
    ok: false;
    toolId: "shell.backgroundExecution";
    error: ShellBackgroundExecutionError;
    audit: readonly ShellBackgroundExecutionAuditEvent[];
    events: readonly string[];
};
export declare const shellBackgroundExecutionDescriptor: {
    readonly toolId: "shell.backgroundExecution";
    readonly capability: "shell-background-execution";
    readonly route: "agent_executionEngine.basic_toolLayer.baseTools.shellBase.processControl";
    readonly defaultDryRun: true;
    readonly tapOwnsApproval: true;
    readonly permissionsRequired: readonly ShellBackgroundExecutionPermission[];
    readonly unsafeSideEffects: false;
};
export declare function planShellBackgroundExecution(request?: ShellBackgroundExecutionRequest): ShellBackgroundExecutionResult;
