/** * Shared text utility functions for storage adapters. * * Both SQLite and Postgres adapters use identical logic for extracting, * normalizing, and truncating message preview text. This module provides * a single canonical implementation to avoid duplication. */ import type { Prompt } from '@effect/ai'; import type { ConversationMetadata, SessionSummary } from '../context'; /** Maximum character length for session preview text. */ export declare const PREVIEW_MAX_LENGTH = 120; /** Collapse all whitespace runs to a single space and trim. */ export declare const normalizeWhitespace: (value: string) => string; /** Truncate text to `maxLength`, appending an ellipsis if it exceeds the limit. */ export declare const truncateText: (value: string, maxLength: number) => string; /** Convert an arbitrary value to a safe string representation. */ export declare const toSafeString: (value: unknown) => string; /** Extract readable text from a single message content part. */ export declare const extractTextFromPart: (part: unknown) => string; /** Extract the full text content from an encoded message. */ export declare const extractMessageText: (message: Prompt.MessageEncoded) => string; /** Extract a normalized, truncated preview string from an encoded message. */ export declare const extractMessagePreviewText: (message: Prompt.MessageEncoded) => string | undefined; /** Extract agent id/name from conversation metadata, returning undefined when absent. */ export declare const extractAgentMetadata: (metadata: ConversationMetadata) => SessionSummary["agent"] | undefined; //# sourceMappingURL=text-utils.d.ts.map