UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio

53 lines (52 loc) 2.12 kB
/** * Effective History Filter * * Filters message arrays to return only "visible" messages, * excluding those tagged by condensation or truncation. * Supports non-destructive context management where messages * are tagged instead of deleted. */ import type { ChatMessage } from "../types/index.js"; /** * Get the effective (visible) history from a message array. * * Filters out: * - Messages with a condenseParent (replaced by a summary) * - Messages with a truncationParent (hidden by truncation) * * Keeps: * - Summary messages (isSummary = true) * - Truncation markers (isTruncationMarker = true) * - All other untagged messages */ export declare function getEffectiveHistory(messages: ChatMessage[]): ChatMessage[]; /** * Tag messages for condensation (non-destructive summary). * * @param messages - Full message array * @param fromIndex - Start index of messages to condense * @param toIndex - End index (exclusive) of messages to condense * @param condenseId - UUID for this condensation group * @returns Updated message array with tags applied */ export declare function tagForCondensation(messages: ChatMessage[], fromIndex: number, toIndex: number, condenseId: string): ChatMessage[]; /** * Tag messages for truncation (non-destructive hiding). * * @param messages - Full message array * @param fromIndex - Start index of messages to truncate * @param toIndex - End index (exclusive) of messages to truncate * @param truncationId - UUID for this truncation group * @returns Updated message array with tags applied */ export declare function tagForTruncation(messages: ChatMessage[], fromIndex: number, toIndex: number, truncationId: string): ChatMessage[]; /** * Remove condensation tags (rewind). * Makes previously condensed messages visible again. */ export declare function removeCondensationTags(messages: ChatMessage[], condenseId: string): ChatMessage[]; /** * Remove truncation tags (rewind). * Makes previously truncated messages visible again. */ export declare function removeTruncationTags(messages: ChatMessage[], truncationId: string): ChatMessage[];