@juspay/neurolink
Version:
Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and
29 lines (28 loc) • 1.2 kB
TypeScript
import type { TextGenerationOptions, TextGenerationResult } from "../core/types.js";
import type { ContextManagerConfig } from "./types.js";
type InternalGenerator = (options: TextGenerationOptions) => Promise<TextGenerationResult>;
/**
* Manages conversation context, automatically summarizing it when it
* exceeds a specified word count limit.
*/
export declare class ContextManager {
private static readonly SUMMARIZATION_FAILED_WARNING;
private static readonly SUMMARIZATION_EMPTY_WARNING;
private history;
private wordCount;
private readonly internalGenerator;
private readonly config;
constructor(generatorFunction: InternalGenerator, config: ContextManagerConfig, initialContext?: string);
addTurn(role: "user" | "assistant", message: string): Promise<void>;
/**
* Formats the history including the latest user turn for the prompt, without modifying the permanent history.
*/
getContextForPrompt(role: "user", message: string): string;
getCurrentContext(): string;
private _summarize;
/**
* Truncates the history to a specific word count, preserving the most recent messages.
*/
private _truncateHistory;
}
export {};