import type { ShellProcessSpawningPermission } from "../shell.processSpawning/core.js";
export type ShellDetachedExecutionPermission = ShellProcessSpawningPermission;
export type ShellDetachedExecutionBoundary = "input" | "scope" | "permission" | "approval" | "contract" | "resource";
export type ShellDetachedRestartPolicy = "none" | "on-failure";
export type ShellDetachedExecutionContext = {
    runtimeId?: string;
    invocationId?: string;
    dryRun?: boolean;
    allowedWorkingDirectories?: readonly string[];
    grantedPermissions?: readonly ShellDetachedExecutionPermission[];
    approval?: {
        accepted: boolean;
        approvalId?: string;
        reason?: string;
    };
    guard?: {
        accepted?: boolean;
        allowed?: boolean;
        reason?: string;
    };
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type ShellDetachedExecutionTarget = {
    command: string;
    workingDirectory?: string;
    shell?: "sh" | "bash" | "zsh";
    launchId?: string;
    pidFilePath?: string;
    stdoutLogPath?: string;
    stderrLogPath?: string;
    restartPolicy?: ShellDetachedRestartPolicy;
};
export type ShellDetachedExecutionRequest = {
    target?: Partial<ShellDetachedExecutionTarget>;
    context?: ShellDetachedExecutionContext;
};
export type ShellDetachedExecutionErrorCode = "MISSING_COMMAND" | "INVALID_SHELL" | "INVALID_CWD" | "INVALID_LAUNCH_ID" | "INVALID_OUTPUT_PATH" | "INVALID_RESTART_POLICY" | "SCOPE_REJECTED" | "PERMISSION_DENIED" | "APPROVAL_REQUIRED" | "APPROVAL_REJECTED" | "REAL_EXECUTION_BLOCKED";
export type ShellDetachedExecutionError = {
    code: ShellDetachedExecutionErrorCode;
    message: string;
    boundary: ShellDetachedExecutionBoundary;
    publicSafe: true;
    internalDetailExposed: false;
};
export type ShellDetachedExecutionAuditEvent = {
    type: string;
    toolId: "shell.detachedExecution";
    invocationId: string;
    dryRun: boolean;
    workingDirectory?: string;
    metadata: Readonly<Record<string, unknown>>;
};
export type ShellDetachedExecutionOutput = {
    kind: "agentCore.basicTool.shell.detachedExecution";
    target: {
        command: string;
        workingDirectory?: string;
        shell: "sh" | "bash" | "zsh";
        launchId: string;
        pidFilePath?: string;
        stdoutLogPath?: string;
        stderrLogPath?: string;
        restartPolicy: ShellDetachedRestartPolicy;
    };
    commandPreview: readonly string[];
    permissionsRequired: readonly ShellDetachedExecutionPermission[];
    approvalId?: string;
    detachedContract: {
        outlivesAgentSession: true;
        requiresTapApproval: true;
        runtimeMustRecordHandle: true;
    };
    dryRun: boolean;
    executionBlocked: boolean;
    providerCalled?: boolean;
    unsafeSideEffects: false;
    resultEnvelope: Readonly<Record<string, unknown>> & {
        planned?: true;
        detachedHandle?: string;
        pid?: number;
    };
};
export type ShellDetachedExecutionResult = {
    ok: true;
    toolId: "shell.detachedExecution";
    output: ShellDetachedExecutionOutput;
    audit: readonly ShellDetachedExecutionAuditEvent[];
    events: readonly string[];
} | {
    ok: false;
    toolId: "shell.detachedExecution";
    error: ShellDetachedExecutionError;
    audit: readonly ShellDetachedExecutionAuditEvent[];
    events: readonly string[];
};
export declare const shellDetachedExecutionDescriptor: {
    readonly toolId: "shell.detachedExecution";
    readonly capability: "shell-detached-execution";
    readonly route: "agent_executionEngine.basic_toolLayer.baseTools.shellBase.processControl";
    readonly defaultDryRun: true;
    readonly tapOwnsApproval: true;
    readonly permissionsRequired: readonly ShellDetachedExecutionPermission[];
    readonly unsafeSideEffects: false;
};
export declare function planShellDetachedExecution(request?: ShellDetachedExecutionRequest): ShellDetachedExecutionResult;
