import type { MappedPromptPack, PromptProviderPayload } from "./promptMapper.js";
import type { PromptPackMaterialKind } from "./promptDefiner.js";
export type PromptProviderMaterialKind = PromptPackMaterialKind;
export type PromptProviderMaterialSourceKind = "runtime" | "application" | "official-module" | "cmp" | "memory" | "file" | "retrieval" | "event" | "tool";
export type PromptProviderBoundary = "input" | "contract" | "governance" | "scope" | "budget" | "injection";
export type PromptProviderErrorCode = "MISSING_RUNTIME_ID" | "MISSING_SESSION_ID" | "EMPTY_MATERIALS" | "EMPTY_MATERIAL_CONTENT" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "SCOPE_DENIED" | "SOURCE_DENIED" | "UNTRUSTED_COMMAND_INJECTION" | "PROMPT_BUDGET_EXCEEDED";
export type PromptProviderGate = {
    accepted: boolean;
    reason?: string;
};
export type PromptProviderMaterialSource = {
    kind: PromptProviderMaterialSourceKind;
    ref?: string;
    trusted?: boolean;
};
export type PromptProviderMaterialInput = {
    id?: string;
    kind: PromptProviderMaterialKind;
    content?: string;
    source: PromptProviderMaterialSource;
    priority?: number;
    tokenEstimate?: number;
    metadata?: Readonly<Record<string, string | number | boolean>>;
};
export type PromptProviderBudget = {
    maxEstimatedTokens?: number;
    reservedForLowering?: number;
    maxMaterials?: number;
};
export type PromptProviderRequest = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    mappedPack?: MappedPromptPack;
    materials?: readonly PromptProviderMaterialInput[];
    budget?: PromptProviderBudget;
    allowedSourceKinds?: readonly PromptProviderMaterialSourceKind[];
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    contract?: PromptProviderGate;
    governance?: PromptProviderGate;
};
export type PromptProviderError = {
    code: PromptProviderErrorCode;
    message: string;
    boundary: PromptProviderBoundary;
    safeForRuntimeInspection: true;
};
export type PromptProviderSourceRecord = {
    materialId: string;
    kind: PromptProviderMaterialKind;
    source: PromptProviderMaterialSource;
    trusted: boolean;
};
export type PromptProviderTrimRecord = {
    materialId: string;
    reason: "budget" | "max-materials";
    estimatedTokens: number;
};
export type PromptProviderInjectionRecord = {
    materialId: string;
    accepted: boolean;
    reason: "trusted-command-injection";
};
export type PromptPackProvidedMaterial = {
    id: string;
    kind: PromptProviderMaterialKind;
    content: string;
    source: PromptProviderMaterialSource;
    priority: number;
    estimatedTokens: number;
    metadata: Readonly<Record<string, string | number | boolean>>;
};
export type PromptProviderPack = {
    kind: "prompt-pack-input";
    runtimeId: string;
    sessionId: string;
    invocationId?: string;
    materials: readonly PromptPackProvidedMaterial[];
    sourceRecords: readonly PromptProviderSourceRecord[];
    trimRecords: readonly PromptProviderTrimRecord[];
    injectionRecords: readonly PromptProviderInjectionRecord[];
    budget: {
        maxEstimatedTokens?: number;
        reservedForLowering: number;
        usedEstimatedTokens: number;
    };
    providerPayloadCreated: false;
    promptLoweringRequired: boolean;
    unsafeSideEffects: false;
};
export type PromptProviderUpstreamRequest = {
    kind: "prompt-provider-upstream-request";
    runtimeId: string;
    sessionId: string;
    invocationId?: string;
    payload: PromptProviderPayload;
    providerPayloadCreated: true;
    unsafeSideEffects: false;
};
export type PromptProviderResult = {
    ok: true;
    pack: PromptProviderPack;
    mappedPack?: MappedPromptPack;
    upstreamRequest?: PromptProviderUpstreamRequest;
    events: readonly string[];
} | {
    ok: false;
    error: PromptProviderError;
    events: readonly string[];
};
export declare const promptProviderDescriptor: {
    readonly route: "agent_executionEngine.promptPack.promptProvider";
    readonly purpose: "expose mapped PromptPack provider payloads as the final upstream request boundary";
    readonly providerPayloadCreated: true;
    readonly promptLoweringRequired: false;
    readonly unsafeSideEffects: false;
};
export declare function providePromptPackInput(request?: PromptProviderRequest): PromptProviderResult;
