import type { ModelAdapterRuntimeCaller, ModelAdapterRuntimeGate } from "./modelAdapterRuntime.js";
import type { ProviderCacheHintPlan, ProviderToolDeclarationBundle } from "../../agent_modelAdapter/bridgingLayer/toolSchemaCompatibilityLayer.js";
export type PromptLoweringMaterialKind = "system" | "developer" | "user" | "tool-summary" | "command" | "context" | "memory" | "runtime-event" | (string & {});
export type PromptLoweringSourceCategory = "declared-built-in" | "process-product" | "user-request";
export type PromptLoweringSegmentKind = "stableSystemCore" | "declaredRuntimeContext" | "toolDeclarations" | "projectContext" | "sessionSummary" | "memoryContext" | "retrievedContext" | "observations" | "userTurn" | "assistantScratchpadPlan";
export type PromptLoweringFallbackMode = "none" | "json-tool-plan";
export type PromptLoweringPolicyFailureKind = "safety" | "permission" | "tool-semantics" | "cache" | "formatting" | "provider-feature";
export type PromptLoweringPolicyDisposition = "fail-closed" | "best-effort";
export type PromptLoweringBoundary = "input" | "contract" | "governance" | "runtime-state" | "prompt-pack" | "target";
export type PromptLoweringErrorCode = "MISSING_RUNTIME_ID" | "MISSING_CALLER" | "MISSING_PROMPT_PACK" | "MISSING_PROMPT_PACK_ID" | "EMPTY_PROMPT_MATERIALS" | "MISSING_TARGET_CAPABILITY" | "RUNTIME_NOT_READY" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "LOWERING_POLICY_REJECTED";
export type PromptLoweringError = {
    code: PromptLoweringErrorCode;
    message: string;
    boundary: PromptLoweringBoundary;
    publicSafe: true;
};
export type PromptLoweringMaterialInput = {
    kind?: PromptLoweringMaterialKind;
    ref?: string;
    text?: string;
    sourceCategory?: PromptLoweringSourceCategory;
    promptSegmentKind?: PromptLoweringSegmentKind;
    priority?: number;
    metadata?: Readonly<Record<string, unknown>>;
};
export type PromptLoweringPackInput = {
    id?: string;
    materials?: readonly PromptLoweringMaterialInput[];
    metadata?: Readonly<Record<string, unknown>>;
};
export type PromptLoweringTarget = {
    capabilityId?: string;
    carrierId?: string;
    outputMode?: "single" | "stream" | "batch" | (string & {});
};
export type PromptLoweringPolicyIssue = {
    kind: PromptLoweringPolicyFailureKind;
    accepted: boolean;
    reason?: string;
};
export type PromptLoweringRequest = {
    runtimeId?: string;
    caller?: ModelAdapterRuntimeCaller;
    promptPack?: PromptLoweringPackInput;
    target?: PromptLoweringTarget;
    providerToolBundle?: ProviderToolDeclarationBundle;
    providerCacheHintPlan?: ProviderCacheHintPlan;
    runtimeReady?: boolean;
    contract?: ModelAdapterRuntimeGate;
    governance?: ModelAdapterRuntimeGate;
    fallbackMode?: PromptLoweringFallbackMode;
    loweringPolicyIssues?: readonly PromptLoweringPolicyIssue[];
};
export type LoweredPromptMaterial = {
    materialId: string;
    kind: PromptLoweringMaterialKind;
    ref?: string;
    text?: string;
    sourceCategory?: PromptLoweringSourceCategory;
    promptSegmentKind?: PromptLoweringSegmentKind;
    priority: number;
    sequence: number;
    metadata: Readonly<Record<string, unknown>>;
};
export type LoweredPromptTarget = {
    capabilityId: string;
    carrierId?: string;
    outputMode: "single" | "stream" | "batch" | (string & {});
};
export type LoweredPromptEnvelope = {
    loweringId: string;
    runtimeId: string;
    promptPackId: string;
    caller: ModelAdapterRuntimeCaller;
    route: "runtime.modelAdapter.promptLoweringRuntime";
    target: LoweredPromptTarget;
    materials: readonly LoweredPromptMaterial[];
    materialRefs: readonly string[];
    materialKinds: readonly PromptLoweringMaterialKind[];
    providerVisibleSegmentKinds: readonly PromptLoweringSegmentKind[];
    hiddenInternalSegmentKinds: readonly PromptLoweringSegmentKind[];
    fallbackMode: PromptLoweringFallbackMode;
    visibleFallbackCreated: boolean;
    providerToolBundle?: ProviderToolDeclarationBundle;
    providerCacheHintPlan?: ProviderCacheHintPlan;
    policy: {
        failClosedKinds: readonly ["safety", "permission", "tool-semantics"];
        bestEffortKinds: readonly ["cache", "formatting", "provider-feature"];
        degradationRecords: readonly PromptLoweringPolicyIssue[];
        degraded: boolean;
    };
    metadata: Readonly<Record<string, unknown>>;
    contractChecked: true;
    governanceChecked: true;
    dryRun: true;
    unsafeSideEffects: false;
};
export type PromptLoweringResult = {
    ok: true;
    loweredPrompt: LoweredPromptEnvelope;
    events: readonly string[];
} | {
    ok: false;
    error: PromptLoweringError;
    events: readonly string[];
};
export declare function lowerPromptForModelAdapter(request?: PromptLoweringRequest): PromptLoweringResult;
