export type OutputExposureBoundary = "input" | "contract" | "governance" | "scope";
export type OutputExposureErrorCode = "MISSING_OUTPUT_ID" | "MISSING_SESSION_ID" | "MISSING_PAYLOAD" | "INVALID_PAYLOAD" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "SCOPE_DENIED";
export type OutputExposureGate = {
    accepted: boolean;
    reason?: string;
};
export type OutputExposureError = {
    code: OutputExposureErrorCode;
    message: string;
    boundary: OutputExposureBoundary;
    publicSafe: true;
};
export type OutputExposureMode = "single" | "stream" | "multimodal";
export type OutputExposureStage = "partial" | "final" | "diagnostic";
export type OutputExposureVisibility = "application" | "runtime-event" | "subscriber";
export type OutputExposureContext = {
    runtimeId?: string;
    sessionId: string;
    turnId?: string;
    source?: "model" | "tool" | "execution-engine" | "event";
};
export type OutputExposureRequestBase = {
    outputId?: string;
    sessionId?: string;
    runtimeId?: string;
    turnId?: string;
    source?: OutputExposureContext["source"];
    mode?: OutputExposureMode;
    stage?: OutputExposureStage;
    visibility?: OutputExposureVisibility;
    streamId?: string;
    sequence?: number;
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    events?: readonly string[];
    metadata?: Readonly<Record<string, unknown>>;
    contract?: OutputExposureGate;
    governance?: OutputExposureGate;
};
export type OutputExposureEnvelope<TModality extends string, TPayload> = {
    outputId: string;
    modality: TModality;
    context: OutputExposureContext;
    payload: TPayload;
    mode: OutputExposureMode;
    stage: OutputExposureStage;
    visibility: OutputExposureVisibility;
    streamId?: string;
    sequence?: number;
    scopes: readonly string[];
    events: readonly string[];
    metadata: Readonly<Record<string, unknown>>;
    dispatch: "dry-run";
    providerRawShapeExposed: false;
};
export type OutputExposureResult<TModality extends string, TPayload> = {
    ok: true;
    exposed: OutputExposureEnvelope<TModality, TPayload>;
    events: readonly string[];
} | {
    ok: false;
    error: OutputExposureError;
    events: readonly string[];
};
export type TextOutputKind = "plain" | "structured" | "status" | "error";
export type TextOutputPayload = {
    kind: TextOutputKind;
    text?: string;
    structured?: unknown;
    error?: {
        code: string;
        message: string;
    };
};
export type TextOutputExposureRequest = OutputExposureRequestBase & {
    text?: string;
    structured?: unknown;
    error?: {
        code?: string;
        message?: string;
    };
    kind?: TextOutputKind;
};
export type TextOutputExposureResult = OutputExposureResult<"text", TextOutputPayload>;
export declare function hasOutputText(value: string | undefined): value is string;
export declare function uniqueOutputStrings(values: readonly string[] | undefined): readonly string[];
export declare function hasOutputScopeAccess(requestedScopes: readonly string[] | undefined, allowedScopes: readonly string[] | undefined): boolean;
export declare function createOutputExposureError(code: OutputExposureErrorCode, message: string, boundary: OutputExposureBoundary): OutputExposureError;
export declare function rejectOutputExposure<TModality extends string, TPayload>(code: OutputExposureErrorCode, message: string, boundary: OutputExposureBoundary, modality: TModality): OutputExposureResult<TModality, TPayload>;
export declare function validateOutputExposureBase<TModality extends string, TPayload>(request: OutputExposureRequestBase | undefined, modality: TModality): OutputExposureResult<TModality, TPayload> | undefined;
export declare function createOutputExposureEnvelope<TModality extends string, TPayload>(request: OutputExposureRequestBase, modality: TModality, payload: TPayload): OutputExposureEnvelope<TModality, TPayload>;
export declare function exposeTextOutput(request?: TextOutputExposureRequest): TextOutputExposureResult;
