import { MediaAttachment } from './media.js'; export type SerializedSenderType = 'human' | 'ai_agent'; /** Canonical agent client identifiers shared by Canon services and clients. */ export declare const AGENT_CLIENT_TYPES: readonly ["claude-code", "openclaw", "codex", "hermes", "deepseek-harness", "generic"]; export type SerializedAgentClientType = typeof AGENT_CLIENT_TYPES[number]; export type SerializedContentType = 'text' | 'image' | 'audio' | 'video' | 'file' | 'contact_card' | 'interaction'; export interface ForwardedFrom { sourceConversationId: string; messageId: string; } export type SerializedReactions = Record; export interface SerializedContactCard { userId: string; canonContactId?: string; displayName: string; avatarUrl: string | null; userType: SerializedSenderType; clientType?: SerializedAgentClientType; about?: string; isActive?: boolean; ownerId?: string; ownerName?: string; lifecycleState?: string; } export interface SerializedMessage { id: string; senderId: string; senderName?: string; senderType: SerializedSenderType; isOwner: boolean; contentType: SerializedContentType; text: string | null; attachments: MediaAttachment[]; mentions: string[]; replyTo: string | null; replyToPosition: number | null; forwarded?: boolean; forwardedFrom?: ForwardedFrom; status: 'sent' | 'read'; createdAt: string; metadata?: Record; contactCard?: SerializedContactCard; /** Durable canon.card.v1 runtime card content, passed through opaquely. */ runtimeCard?: Record; /** * Plaintext, server-authorized interaction envelope for `contentType: * 'interaction'` messages (card / input / approval / plan / contact). The * authorization contract (`response`) and preview live here; the opaque * request payload rides in `body`. */ interaction?: SerializedInteraction; /** Opaque interaction payload (JSON string or ciphertext); never parsed here. */ body?: string; reactions?: SerializedReactions; } export type SerializedInteractionKind = 'contact' | 'approval' | 'input' | 'plan' | 'card'; export interface SerializedInteraction { kind: SerializedInteractionKind; requestId: string; interactive: boolean; responseUserId?: string; expiresAt?: string; schemaVersion?: string; preview?: { title?: string; blockKinds?: string[]; }; response?: { actionIds?: string[]; actionFields?: Record; questions?: Array<{ id: string; sensitive?: boolean; }>; }; } export interface SerializeMessageInput { id: string; data: Record; senderName?: string; isOwner: boolean; } export declare function serializeStoredMessage(input: SerializeMessageInput): SerializedMessage;