import type { ToolDependencyInstallPlan, ToolDependencyInstallTarget } from "./dependencySourceRegistry.js";
import type { ToolDependencyDeclaration, ToolDependencyManagerError, ToolDependencyReport, ToolDependencyStatus } from "./dependencyManager.js";
export type ToolDependencyIterationBoundary = "input" | "contract" | "governance" | "scope";
export type ToolDependencyRefreshReason = "missing" | "stale" | "conflict" | "blocked" | "unknown" | "manual";
export type ToolDependencyRefreshAction = "probe" | "install" | "refresh-version" | "resolve-conflict" | "request-scope" | "manual-review";
export type ToolDependencyIterationStrategy = {
    maxIterations?: number;
    refreshMissing?: boolean;
    refreshStale?: boolean;
    reviewConflicts?: boolean;
    includeOptional?: boolean;
    installTarget?: ToolDependencyInstallTarget;
    managedRoot?: string;
    env?: Readonly<Record<string, string | undefined>>;
    homeDir?: string;
};
export type ToolDependencyIterationContext = {
    runtimeId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: {
        accepted: boolean;
        reason?: string;
    };
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type ToolDependencyIterationRequest = {
    toolId?: string;
    currentIteration?: number;
    declarations?: readonly ToolDependencyDeclaration[];
    report?: ToolDependencyReport;
    strategy?: ToolDependencyIterationStrategy;
    context?: ToolDependencyIterationContext;
};
export type ToolDependencyIterationErrorCode = "MISSING_TOOL_ID" | "TOOL_ID_MISMATCH" | "MISSING_DEPENDENCY_REPORT" | "INVALID_ITERATION" | "ITERATION_LIMIT_REACHED" | "REAL_REFRESH_NOT_ALLOWED" | "GOVERNANCE_REJECTED" | "DEPENDENCY_RESOLUTION_FAILED";
export type ToolDependencyIterationError = {
    code: ToolDependencyIterationErrorCode;
    message: string;
    boundary: ToolDependencyIterationBoundary;
    safeForRuntimeInspection: true;
    internalDetailExposed: false;
    cause?: Pick<ToolDependencyManagerError, "code" | "boundary" | "message">;
};
export type ToolDependencyRefreshStep = {
    dependencyId: string;
    action: ToolDependencyRefreshAction;
    reason: ToolDependencyRefreshReason;
    required: boolean;
    fromStatus: ToolDependencyStatus;
    requestedVersion?: string;
    observedVersion?: string;
    installPlan?: ToolDependencyInstallPlan;
    approvalRequired: boolean;
    notes: readonly string[];
};
export type ToolDependencyIterationPlan = {
    toolId: string;
    runtimeId?: string;
    invocationId?: string;
    currentIteration: number;
    nextIteration: number;
    maxIterations: number;
    status: "complete" | "needs-refresh" | "blocked";
    sourceReportStatus: ToolDependencyStatus;
    refreshSteps: readonly ToolDependencyRefreshStep[];
    dryRun: true;
    unsafeSideEffects: false;
    audit: {
        event: "agentCore.basicToolLayer.toolDependency.iteration.planned";
        metadata: Readonly<Record<string, unknown>>;
    };
};
export type ToolDependencyIterationResult = {
    ok: true;
    plan: ToolDependencyIterationPlan;
    events: readonly string[];
} | {
    ok: false;
    error: ToolDependencyIterationError;
    events: readonly string[];
};
export declare const toolDependencyIterationManagerDescriptor: {
    readonly layer: "agent_executionEngine.basic_toolLayer.toolDependency";
    readonly capability: "dependency-iteration-management";
    readonly defaultDryRun: true;
    readonly defaultMaxIterations: 3;
    readonly unsafeSideEffects: false;
};
export declare function planToolDependencyIteration(request?: ToolDependencyIterationRequest): ToolDependencyIterationResult;
