import { Schema } from "effect"; import { Prompt } from "effect/unstable/ai"; /** @experimental First structurally divergent position between the durable projection and the authoritative Chat history. */ export declare const Divergence: Schema.Struct<{ readonly index: Schema.Finite; readonly durableRole: Schema.optionalKey; readonly authoritativeRole: Schema.optionalKey; readonly durablePartTypes: Schema.$Array; readonly authoritativePartTypes: Schema.$Array; readonly durableDigest: Schema.optionalKey; readonly authoritativeDigest: Schema.optionalKey; }>; /** @experimental */ export type Divergence = typeof Divergence.Type; /** @experimental Bounded structural evidence for a Session/Chat divergence. Carries counts, roles, part types, and digests only — never raw prompt, message, or tool payload text. */ export declare const Diagnostics: Schema.Struct<{ readonly sessionId: Schema.String; readonly ownerToken: Schema.optionalKey; readonly durableEntryCount: Schema.Finite; readonly durableMessageCount: Schema.Finite; readonly authoritativeMessageCount: Schema.Finite; readonly alignmentCount: Schema.Finite; readonly commonPrefixLength: Schema.Finite; readonly lastDurableEntryTag: Schema.optionalKey; readonly firstDivergence: Schema.optionalKey; readonly authoritativeRole: Schema.optionalKey; readonly durablePartTypes: Schema.$Array; readonly authoritativePartTypes: Schema.$Array; readonly durableDigest: Schema.optionalKey; readonly authoritativeDigest: Schema.optionalKey; }>>; }>; /** @experimental */ export type Diagnostics = typeof Diagnostics.Type; /** * @experimental Merge consecutive text parts that share options within each message. * * The provider-agnostic Chat export encodes a user message whose content is a * multi-text-part array by keeping only the first text part, silently dropping the * rest. Coalescing adjacent text parts into one before that encoding is lossless — * providers already concatenate adjacent text — and keeps the persisted Chat history * a faithful prefix of the durable session projection. It also canonicalizes a * message for structural comparison so a representation-only difference between the * durable projection and the authoritative Chat history never reads as divergence. */ export declare const coalesceAdjacentText: (message: Prompt.Message) => Prompt.Message; /** @experimental Compares prompt messages by canonical content across equivalent runtime representations. */ export declare const equivalentMessages: { (right: Prompt.Message): (left: Prompt.Message) => boolean; (left: Prompt.Message, right: Prompt.Message): boolean; }; /** @experimental Computes bounded divergence diagnostics for a failed Session synchronization. */ export declare const diagnose: (input: { readonly sessionId: string; readonly ownerToken?: string; readonly durableEntryTags: ReadonlyArray; readonly projection: ReadonlyArray; readonly transcript: ReadonlyArray; }) => Diagnostics;