import type { ContentBlock } from "@modelcontextprotocol/server"; /** One explicitly selected, runtime-local attachment. @internal */ export interface ContextAttachment { /** Opaque application key, separate from description node IDs. */ readonly key: string; /** Native content preserved without flattening it into JSON text. */ readonly block: ContentBlock; } /** Outcome of an individual context mutation. @internal */ export interface ContextOperationResult { /** Whether this effect was acknowledged or replaced before acknowledgment. */ readonly status: "synced" | "superseded"; } /** Shared observable synchronization state. @internal */ export interface ContextSnapshot { /** Effective selection; retained failed entries are not proof of delivery. */ readonly attachments: readonly ContextAttachment[]; /** A write is queued or in flight, including initialization. */ readonly pending: boolean; /** Last synchronization failure; input errors do not change it. */ readonly error: Error | null; } /** Complete replacement payload. @internal */ export interface ContextPayload { /** Native blocks, including the generated background projection. */ content: ContentBlock[]; /** Model-visible structured background state. */ structuredContent?: Record; } /** Immutable publication and its local attachment identities. @internal */ export interface ContextPublication { /** Local contribution revision, never an OpenAI updateId. */ readonly revision: number; /** Detached payload captured before dispatch. */ readonly payload: ContextPayload; /** Canonical value used only for equality, not host revision ordering. */ readonly serialized: string; /** Key generations actually represented in this publication. */ readonly entries: ReadonlyMap; } /** Compare complete JSON values, preserving array order. @internal */ export declare function canonicalContext(value: unknown): string; /** Detach and recursively freeze JSON data at the ownership boundary. @internal */ export declare function copyContext(value: T): T; /** Aggregate the legacy projection and native attachment namespace. @internal */ export declare function buildContextPayload(state: Record | null, description: string, attachments: Iterable, backgroundOnly?: boolean): ContextPayload;