import type * as acp from '@agentclientprotocol/sdk'; import type { AdapterMeta, ConversationEventKind, ConversationPayload } from './conversation-types.js'; /** * Reduce one ACP v1 `session/update` into one conversation-domain event draft. * * This is the protocol seam: v1 create/update pairs (and a future v2 upsert * stream) both land in the same domain shapes. The function is pure and total — * it never throws, never passes raw wire objects through, caps every payload, * and quarantines namespaced `_meta` so unknown extensions cannot leak into * generic rendering paths. */ /** Cap for any single normalized text payload. */ export declare const MAX_TEXT_BYTES: number; /** Cap for each retained side of an oversized snapshot-style file diff. */ export declare const MAX_DIFF_TEXT_BYTES: number; /** Cap for attacker-controlled filesystem paths while retaining their useful basename tail. */ export declare const MAX_PATH_BYTES: number; /** Hard cap for the complete normalized update before the durable event envelope is added. */ export declare const MAX_NORMALIZED_UPDATE_BYTES: number; /** Cap for one adapter `_meta` namespace value. */ export declare const MAX_META_BYTES: number; /** Cap for serialized raw tool input/output retained as structured JSON. */ export declare const MAX_RAW_JSON_BYTES: number; /** Cap for the sanitized preview of an unsupported update. */ export declare const MAX_UNSUPPORTED_PREVIEW_CHARS = 2048; export interface NormalizeOptions { /** * Replace every text payload with this placeholder, keeping byte count and * digest. Used for scheduled-loop turns whose output must not be retained. */ redactText?: string; /** * Replace ACP tool-call IDs in both the normalized event correlation field * and payload. The caller may still use the original update for in-memory * lifecycle tracking without persisting its private identifier. */ redactToolCallId?: string; } export interface NormalizedUpdate { kind: ConversationEventKind; payload: ConversationPayload; messageId?: string; toolCallId?: string; adapterMeta?: AdapterMeta[]; } export declare function normalizeSessionUpdate(update: acp.SessionUpdate, options?: NormalizeOptions): NormalizedUpdate;