import type { ContentBlock } from "@modelcontextprotocol/server"; import type { App } from "@modelcontextprotocol/ext-apps"; import type { ModelContextBlock } from "../types/model-context.js"; import { type ContextPayload } from "./model-context.js"; /** OpenAI extension key shared by capability, result metadata and readback. @internal */ export declare const MODEL_CONTEXT_EXTENSION = "openai/modelContext"; /** Decode friendly presentation without changing the canonical wire block. @internal */ export declare function presentContextBlock(block: ContentBlock): ModelContextBlock & ContentBlock; /** Validated whole-context observation, with opaque revision identity. @internal */ export interface ContextObservation { /** Identifies a whole host revision; never sortable or per-item identity. */ updateId: string; /** Whether this observation supplied content, rather than only a revision. */ contentProvided: boolean; /** Whether this observation supplied structured background. */ structuredProvided: boolean; /** Complete host context, including background state. */ payload: ContextPayload; } /** Normalize author input separately from strict native host readback. @internal */ export declare function normalizeContextInput(input: ModelContextBlock): { /** Validated native presentation; source image bytes are filled after fetching. */ block: ContentBlock; /** Resolved image URL, when conversion is required. */ source?: string; }; /** Normalize convenience fields, preserving raw metadata and annotations. @internal */ export declare function normalizeContextBlock(input: ModelContextBlock): ContentBlock; /** Validate the entire replacement against negotiated modalities. @internal */ export declare function assertContextSupport(app: App, payload: ContextPayload): void; /** Distinguish absent, cleared, and malformed host state. @internal */ export declare function readContextObservation(value: unknown): ContextObservation | null; /** Read optional response correlation; successful RPCs need not return an ID. @internal */ export declare function contextUpdateId(result: unknown): string | undefined;