/** * @license * Copyright 2026 Alibaba Group Holding Limited * SPDX-License-Identifier: Apache-2.0 */ import type { MemoryLogger } from './config.js'; import { type LtmField } from './schema.js'; export interface RenderTurn { turnIdx: number; userText: string; userTs: string; userEpoch: number; asstText: string; asstTs: string; asstEpoch: number; interrupted?: boolean; } export interface DialogueSegmentRow { id: number; session_id: string | null; turn_from: number; turn_to: number; n_turns: number; start_ts: string; end_ts: string; start_epoch: number; end_epoch: number; body: string; cut_reason: string; n_chars?: number; score?: number; similarity?: number; from_tail?: boolean; } export interface EnvObservationRow { id: number; content: string; created_at: string; created_ts: number; src_session: string | null; active: number; observed_at?: string; score?: number; from_tail?: boolean; } export interface RecentItem { content: string; status: string; recorded_at?: string; created_at?: string; } export declare const INTERRUPTED_MARKER = "\uFF08\u88AB\u7528\u6237\u6253\u65AD\uFF09"; export declare const MEMORY_SECTIONS: readonly ["user_profile", "recent", "retrieved", "personalized_user_memories"]; export declare const SOURCE_PREFIXES: { readonly dialogue: "[dialogue] "; readonly env: "[visual] "; }; export declare function charLength(text: string): number; export declare function renderTurnLines(turn: RenderTurn): string[]; export declare function renderSegmentBody(turns: readonly RenderTurn[]): string; export declare function renderSegmentIndexText(turns: readonly RenderTurn[]): string; export declare function renderDialogueResults(segments: readonly DialogueSegmentRow[]): string; export declare function formatLocalDate(moment: Date): string; export declare function formatLocalTimestamp(moment: Date): string; export declare function renderEnvResults(observations: readonly EnvObservationRow[]): string; export declare function renderUserProfile(values: Partial>, maxChars?: number, log?: MemoryLogger): { text: string; trimmed: LtmField[]; }; export declare function renderRecent(items: readonly RecentItem[]): string; export declare function renderRetrievedSection(body: string, source?: 'dialogue' | 'env'): string; export declare function renderRetrievedBlock(segments: readonly DialogueSegmentRow[], maxChars?: number): string; export declare function renderMemoryBlock(values?: { userProfile?: string; recent?: string; retrieved?: string; personalizedUserMemories?: string; }): string;