@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
16 lines (15 loc) • 750 B
TypeScript
/**
* Stage 4: Sliding Window Truncation
*
* Non-destructive fallback: tags oldest messages as truncated
* instead of deleting them. Always preserves first message pair.
* Removes messages in pairs to maintain role alternation.
*
* Features:
* - Adaptive truncation (PERF-001): calculates fraction from actual overage
* instead of fixed 50%, with iterative refinement up to 6 passes.
* - Small conversation handling (BUG-005): for <= 4 messages, truncates
* message content proportionally instead of returning no-op.
*/
import type { ChatMessage, TruncationConfig, TruncationResult } from "../../types/index.js";
export declare function truncateWithSlidingWindow(messages: ChatMessage[], config?: TruncationConfig): TruncationResult;