import type { BaseToolDebugLogEntry } from "../../../../../agentCore/agent_executionEngine/basic_toolLayer/baseTools/baseToolExecutorPort.js";
import type { CodeToolResult } from "../../_shared/baseToolAdapter.js";
export type CodeDebugRunBoundary = "input" | "contract" | "governance" | "scope" | "provider";
export type CodeDebugRunTargetKind = "program" | "test" | "attach" | "workspace";
export type CodeDebugRunTarget = {
    kind?: CodeDebugRunTargetKind;
    label?: string;
    entrypoint?: string;
    command?: readonly string[];
    cwd?: string;
};
export type CodeDebugBreakpoint = {
    file?: string;
    line?: number;
    condition?: string;
};
export type CodeDebugGate = {
    accepted?: boolean;
    allowed?: boolean;
    reason?: string;
};
export type CodeDebugContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: CodeDebugGate;
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type CodeDebugRunRequest = {
    context?: CodeDebugContext;
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    target?: CodeDebugRunTarget;
    breakpoints?: readonly CodeDebugBreakpoint[];
    environment?: Record<string, string>;
    timeoutMs?: number;
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    dryRun?: boolean;
    guard?: CodeDebugGate;
    contract?: CodeDebugGate;
    governance?: CodeDebugGate;
    provider?: CodeDebugRunProvider;
};
export type CodeDebugRunErrorCode = "MISSING_RUNTIME_ID" | "MISSING_SESSION_ID" | "MISSING_DEBUG_TARGET" | "MISSING_TARGET_LABEL" | "INVALID_COMMAND" | "INVALID_BREAKPOINT" | "INVALID_ENVIRONMENT" | "INVALID_TIMEOUT" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "SCOPE_DENIED" | "REAL_DEBUG_RUN_NOT_ALLOWED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_FAILURE";
export type CodeDebugRunError = {
    code: CodeDebugRunErrorCode;
    message: string;
    boundary: CodeDebugRunBoundary;
    safeForRuntimeInspection: true;
    internalDetailExposed: false;
};
export type CodeDebugRunPlan = {
    toolName: "code.debugRun";
    runtimeId: string;
    sessionId: string;
    invocationId: string;
    target: {
        kind: CodeDebugRunTargetKind;
        label: string;
        entrypoint?: string;
        command: readonly string[];
        cwd?: string;
    };
    breakpoints: readonly Required<Pick<CodeDebugBreakpoint, "file" | "line">>[];
    environmentKeys: readonly string[];
    permissions: readonly ["debug:read", "debug:run"];
    execution: {
        dryRun: true;
        launched: false;
        attached: false;
        unsafeSideEffects: false;
    };
    plannedSteps: readonly string[];
    audit: {
        governanceRequired: true;
        tapHandoffReady: true;
    };
    storage: {
        logic: {
            persisted: false;
        };
        records: readonly {
            toolName: "code.debugRun";
        }[];
    };
};
export type CodeDebugRunOutput = {
    kind: "agentCore.basicTool.code.debugRun.output";
    runtimeId: string;
    sessionId: string;
    invocationId: string;
    target: CodeDebugRunPlan["target"];
    breakpoints: CodeDebugRunPlan["breakpoints"];
    environmentKeys: readonly string[];
    timeoutMs: number;
    runtimeEntry: {
        owner: "runtime";
        port: "BaseToolExecutorPort.debug.launch";
        method: "launch";
    };
    dryRun: boolean;
    providerCalled: boolean;
    debugSessionId?: string;
    state: "planned" | "launched" | "attached" | "running" | "paused" | "failed";
    breakpointsAccepted?: number;
    eventsPreview: readonly BaseToolDebugLogEntry[];
    unsafeSideEffects: false;
};
export type CodeDebugRunResult = {
    ok: true;
    plan: CodeDebugRunPlan;
    events: readonly string[];
} | {
    ok: false;
    error: CodeDebugRunError;
    events: readonly string[];
};
export type CodeDebugRunProvider = (request: {
    target: CodeDebugRunPlan["target"];
    breakpoints: CodeDebugRunPlan["breakpoints"];
    environment?: Readonly<Record<string, string>>;
    timeoutMs: number;
}, context: CodeDebugContext) => Promise<{
    debugSessionId: string;
    state: "launched" | "attached" | "running" | "paused" | "failed";
    breakpointsAccepted?: number;
    events?: readonly BaseToolDebugLogEntry[];
}> | {
    debugSessionId: string;
    state: "launched" | "attached" | "running" | "paused" | "failed";
    breakpointsAccepted?: number;
    events?: readonly BaseToolDebugLogEntry[];
};
export declare const codeDebugRunDescriptor: {
    readonly toolName: "code.debugRun";
    readonly toolId: "code.debugRun";
    readonly toolFamily: "codeBase.debugCode";
    readonly purpose: "launch or attach a debug run through runtime-owned debug support";
    readonly dryRunOnly: false;
    readonly unsafeSideEffects: false;
};
export declare function planCodeDebugRun(request?: CodeDebugRunRequest): CodeDebugRunResult;
export declare function executeCodeDebugRun(request?: CodeDebugRunRequest): Promise<CodeToolResult<CodeDebugRunOutput, CodeDebugRunErrorCode>>;
