import type { CodeToolResult } from "../../_shared/baseToolAdapter.js";
export type CodeTestBoundary = "input" | "contract" | "governance" | "scope" | "resource" | "provider";
export type CodeTestGate = {
    accepted?: boolean;
    allowed?: boolean;
    reason?: string;
};
export type CodeTestContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: CodeTestGate;
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type CodeTestRequest = {
    context?: CodeTestContext;
    runtimeId?: string;
    invocationId?: string;
    workspaceRoot?: string;
    testTarget?: string;
    command?: readonly string[];
    testFramework?: string;
    updateSnapshots?: boolean;
    timeoutMs?: number;
    stdin?: string;
    env?: Readonly<Record<string, string>>;
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    dryRun?: boolean;
    guard?: CodeTestGate;
    contract?: CodeTestGate;
    governance?: CodeTestGate;
    provider?: CodeTestProvider;
    metadata?: Readonly<Record<string, unknown>>;
};
export type CodeTestErrorCode = "MISSING_RUNTIME_ID" | "MISSING_WORKSPACE_ROOT" | "MISSING_TEST_TARGET" | "MISSING_COMMAND" | "INVALID_COMMAND" | "INVALID_TIMEOUT" | "INVALID_ENVIRONMENT" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "SCOPE_DENIED" | "REAL_SIDE_EFFECT_NOT_ALLOWED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_FAILURE";
export type CodeTestError = {
    code: CodeTestErrorCode;
    message: string;
    boundary: CodeTestBoundary;
    safeForRuntimeInspection: true;
    internalDetailExposed: false;
};
export type CodeTestRuntimeEntry = {
    owner: "runtime";
    port: "BaseToolExecutorPort.process.run";
    method: "run";
    intent: "test";
};
export type CodeTestRisk = {
    category: "test-execution";
    riskLevel: "risky";
    spawnsProcess: true;
    mutatesWorkspace: boolean;
    requiresTapApproval: true;
    runtimeOwnsExecution: true;
};
export type CodeTestPlan = {
    toolKind: "code.testCode";
    runtimeId: string;
    invocationId: string;
    workspaceRoot: string;
    testTarget: string;
    command: readonly string[];
    testFramework?: string;
    updateSnapshots: boolean;
    timeoutMs: number;
    permissions: readonly string[];
    acceptedScopes: readonly string[];
    execution: {
        dryRun: true;
        testsExecuted: false;
        unsafeSideEffects: false;
    };
    audit: {
        capability: "test-code";
        governanceRequired: true;
        tapCanWrap: true;
    };
};
export type CodeTestOutput = {
    kind: "agentCore.basicTool.code.testCode.output";
    runtimeId: string;
    invocationId: string;
    workspaceRoot: string;
    testTarget: string;
    command: readonly string[];
    commandPreview: readonly string[];
    testFramework?: string;
    updateSnapshots: boolean;
    timeoutMs: number;
    runtimeEntry: CodeTestRuntimeEntry;
    risk: CodeTestRisk;
    dryRun: boolean;
    providerCalled: boolean;
    exitCode?: number;
    status: "planned" | "passed" | "failed";
    durationMs?: number;
    stdoutPreview: string;
    stderrPreview: string;
    truncated: boolean;
    unsafeSideEffects: boolean;
};
export type CodeTestResult = {
    ok: true;
    plan: CodeTestPlan;
    events: readonly string[];
} | {
    ok: false;
    error: CodeTestError;
    events: readonly string[];
};
export type CodeTestProviderRequest = {
    command: string;
    args: readonly string[];
    cwd: string;
    timeoutMs: number;
    stdin?: string;
    env?: Readonly<Record<string, string>>;
    testTarget: string;
    testFramework?: string;
    updateSnapshots: boolean;
};
export type CodeTestProviderResult = {
    exitCode: number;
    stdout: string;
    stderr: string;
    durationMs?: number;
};
export type CodeTestProvider = (request: CodeTestProviderRequest, context: CodeTestContext) => CodeTestProviderResult | Promise<CodeTestProviderResult>;
export declare const codeTestDescriptor: {
    readonly toolKind: "code.testCode";
    readonly toolId: "code.testCode";
    readonly purpose: "run a fixed code test target through runtime-owned process execution";
    readonly defaultTimeoutMs: 60000;
    readonly maxTimeoutMs: 600000;
    readonly unsafeSideEffects: false;
    readonly runtimeEntryPort: "BaseToolExecutorPort.process.run";
};
export declare function planCodeTest(request?: CodeTestRequest): CodeTestResult;
export declare function executeCodeTest(request?: CodeTestRequest): Promise<CodeToolResult<CodeTestOutput, CodeTestErrorCode>>;
