import type { MainLoopStepRecord } from "../../agent_executionEngine/coreLogic/mainLoop.js";
import type { PromptPackCachePlan } from "../../agent_executionEngine/promptPack/promptAssembler.js";
import { type ProviderToolSchemaFamily } from "../../agent_modelAdapter/bridgingLayer/toolSchemaCompatibilityLayer.js";
import type { RuntimeFaultSignal } from "../runtime.selfRepair/faultClassifier.js";
import { type BaseToolDeveloperReadiness, type BaseToolRealityStages } from "../runtime.execEngine/baseToolRealityLedger.js";
import { type SelfRepairRuntimeOutcome } from "../runtime.selfRepair/selfRepairRuntime.js";
import { type AgentManifest, type AgentManifestInspection } from "../runtimeAgentManifest.js";
import { type RuntimeReadinessSnapshot } from "./runtimeReadinessCheck.js";
export type FrameworkInspectionReportStatus = "ready" | "degraded" | "blocked";
export type FrameworkInspectionFindingSeverity = "info" | "warning" | "error";
export type FrameworkInspectionFinding = {
    findingId: string;
    severity: FrameworkInspectionFindingSeverity;
    section: "manifest" | "policy" | "tools" | "provider" | "promptPack" | "mainLoop" | "dependency" | "storage" | "selfRepair" | "sandbox";
    message: string;
    remediation?: string;
};
export type FrameworkToolReadinessInput = {
    toolId: string;
    family?: string;
    group?: string;
    ready?: boolean;
    required?: boolean;
    reason?: string;
    developerReadiness?: BaseToolDeveloperReadiness;
    stages?: BaseToolRealityStages;
    dependencyStatus?: string;
    executorSupport?: string;
    missingPorts?: readonly string[];
};
export type FrameworkProviderReadinessInput = {
    providerId: string;
    role?: string;
    ready?: boolean;
    required?: boolean;
    reason?: string;
};
export type FrameworkDependencyInput = {
    dependencyId: string;
    owner: "runtime" | "model" | "baseTool" | "officialModule" | "storage" | "inspection";
    ready?: boolean;
    required?: boolean;
    reason?: string;
};
export type FrameworkSandboxReadinessInput = {
    ready?: boolean;
    required?: boolean;
    reason?: string;
    probeStatus?: string;
    smokeStatus?: string;
    missingDependencies?: readonly string[];
    selfRepairHints?: readonly string[];
};
export type FrameworkPromptPackPreviewInput = {
    promptPackId: string;
    cachePlan?: PromptPackCachePlan;
    materials: readonly {
        materialId: string;
        kind: string;
        sourceCategory: string;
        preview: string;
        trusted?: boolean;
    }[];
};
export type FrameworkInspectionReportRequest = {
    runtimeId?: string;
    manifest?: AgentManifest;
    runtimeReady?: boolean;
    storage?: {
        cwd?: string;
        raxHome?: string;
        workspaceRoot?: string;
        homeDir?: string;
        env?: Readonly<Record<string, string | undefined>>;
    };
    tools?: readonly FrameworkToolReadinessInput[];
    providers?: readonly FrameworkProviderReadinessInput[];
    dependencies?: readonly FrameworkDependencyInput[];
    sandbox?: FrameworkSandboxReadinessInput;
    promptPackPreview?: FrameworkPromptPackPreviewInput;
    mainLoopSteps?: readonly MainLoopStepRecord[];
    selfRepairSignal?: RuntimeFaultSignal;
    checkedAt?: string;
};
export type FrameworkInspectionReportError = {
    code: "MISSING_RUNTIME_ID" | "MISSING_MANIFEST" | "READINESS_FAILED" | "SELF_REPAIR_FAILED";
    message: string;
    boundary: "input" | "manifest" | "readiness" | "selfRepair";
    publicSafe: true;
    internalDetailExposed: false;
};
export type FrameworkInspectionReport = {
    runtimeId: string;
    status: FrameworkInspectionReportStatus;
    checkedAt: string;
    manifest: AgentManifestInspection;
    policy: {
        profile: string;
        sandbox: string;
        approvalSurface: "interface/application";
    };
    sandbox: {
        sandboxId: string;
        profile: string;
        providerFamily: string;
        isolationLevel: string;
        realIsolation: boolean;
        filesystem: string;
        network: string;
        shell: string;
        dependencyRefs: readonly string[];
        mountPolicy?: AgentManifest["sandbox"]["mountPolicy"];
        networkPolicy?: AgentManifest["sandbox"]["networkPolicy"];
        processPolicy?: AgentManifest["sandbox"]["processPolicy"];
        platformSupport?: AgentManifest["sandbox"]["platformSupport"];
        readiness: {
            ready?: boolean;
            reason?: string;
            probeStatus?: string;
            smokeStatus?: string;
            missingDependencies: readonly string[];
            selfRepairHints: readonly string[];
        };
        linuxBubblewrap?: {
            providerVersion?: unknown;
            fallback?: unknown;
            home?: unknown;
            tmp?: unknown;
            artifacts?: unknown;
            networkMode: string;
            deviceExposure: "minimal-by-default" | "bapr-yolo-broad" | "provider-policy";
        };
    };
    toolReadiness: {
        total: number;
        ready: number;
        missing: readonly string[];
        byDeveloperReadiness: Readonly<Record<BaseToolDeveloperReadiness, number>>;
        tools: readonly {
            toolId: string;
            family?: string;
            group?: string;
            ready: boolean;
            developerReadiness?: BaseToolDeveloperReadiness;
            stages?: BaseToolRealityStages;
            dependencyStatus?: string;
            executorSupport?: string;
            missingPorts?: readonly string[];
            reason?: string;
        }[];
    };
    providerReadiness: {
        total: number;
        ready: number;
        missing: readonly string[];
    };
    providerToolSchema: {
        praxisToolCount: number;
        expandedToolCount: number;
        foldedToolCount: number;
        targets: readonly {
            providerFamily: ProviderToolSchemaFamily;
            providerToolCount: number;
            mappingCount: number;
            runtimeDecisionToolCount: number;
            declarationHash: string;
            sanitizedToolCount: number;
            cachePrefixHealth: "stable" | "warning";
            schemaRejectedRisk: "low" | "warning";
            warnings: readonly string[];
        }[];
    };
    promptPackPreview?: {
        promptPackId: string;
        materialCount: number;
        materials: readonly FrameworkPromptPackPreviewInput["materials"][number][];
        cachePlan?: {
            strategy: PromptPackCachePlan["strategy"];
            segmentCount: number;
            segments: readonly {
                segmentKind: string;
                stability: string;
                cachePolicy: string;
                segmentHash: string;
                estimatedTokens: number;
                materialRefs: readonly string[];
            }[];
            cacheablePrefixSegmentKinds: readonly string[];
            dynamicSegmentKinds: readonly string[];
            cacheRiskWarnings: readonly string[];
        };
        providerPayloadBuilt: false;
    };
    mainLoopTrace: {
        stepCount: number;
        actionPrimitives: readonly string[];
        failedSteps: readonly string[];
    };
    dependencyGraph: {
        total: number;
        missing: readonly string[];
        owners: Readonly<Record<string, number>>;
    };
    storage: {
        homeRoot: string;
        workspaceRoot: string;
        sessionSqlitePath: string;
        artifactRoot: string;
        cacheRoot: string;
        sandboxRoot: string;
        initialized: boolean;
        missingDirectories: readonly string[];
        initPlanDirectoryCount: number;
        writesSecrets: false;
    };
    selfRepair?: {
        status: SelfRepairRuntimeOutcome["status"];
        nextStep: SelfRepairRuntimeOutcome["nextStep"];
        unsafeSideEffects: false;
        planStepCount: number;
    };
    findings: readonly FrameworkInspectionFinding[];
    audit: {
        reportSurface: "runtime.inspection.frameworkInspectionReport";
        unsafeSideEffects: false;
        rawSecretLeakageChecked: true;
    };
};
export type FrameworkInspectionReportResult = {
    ok: true;
    report: FrameworkInspectionReport;
    readiness: RuntimeReadinessSnapshot;
    events: readonly string[];
} | {
    ok: false;
    error: FrameworkInspectionReportError;
    events: readonly string[];
};
export declare function createFrameworkInspectionReport(request?: FrameworkInspectionReportRequest): FrameworkInspectionReportResult;
