@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
71 lines (70 loc) • 2.67 kB
TypeScript
/**
* Loop Mode Utilities
* Utilities specific to CLI loop mode session management and restoration
*/
import type { ChatMessage, ConversationData, SessionRestoreResult } from "../types/index.js";
/**
* Verify that conversation context is accessible and properly loaded
* Uses the global session to access the NeuroLink instance
*/
export declare function verifyConversationContext(sessionId: string): Promise<void>;
/**
* Get conversation context for display (first few and last few messages)
* Uses the global session to access the NeuroLink instance
*/
export declare function getConversationPreview(sessionId: string, previewCount?: number): Promise<ChatMessage[]>;
/**
* Generate a title from content by truncating to appropriate length
*/
export declare function generateConversationTitle(content: string): string;
/**
* Truncate text content to specified length with ellipsis
*/
export declare function truncateText(content: string, maxLength: number): string;
/**
* Format timestamp as human-readable relative time
* Uses Intl.RelativeTimeFormat for natural language output
*/
export declare function formatTimeAgo(timestamp: string): string;
/**
* Get appropriate icon for content based on regex patterns
*/
export declare function getContentIcon(content: string): string;
/**
* Display session restoration status message
*/
export declare function displaySessionMessage(result: SessionRestoreResult): void;
/**
* Load command history from the global history file
*/
export declare function loadCommandHistory(): Promise<string[]>;
/**
* Save a command to the global history file
*/
export declare function saveCommandToHistory(command: string): Promise<void>;
/**
* Display conversation preview with formatted messages
*/
export declare function displayConversationPreview(preview: ChatMessage[], maxPreview?: number): void;
/**
* Parse a string value to its appropriate type (string, number, or boolean)
* Useful for parsing user input from CLI commands
*/
export declare function parseValue(value: string): string | number | boolean;
/**
* Restore session variables from conversation metadata
* Extracts and sets session variables stored in conversation metadata
*/
export declare function restoreSessionVariables(conversationData: ConversationData): Promise<void>;
export declare const HISTORY_FILE: string;
export declare const LOOP_CACHE_CONFIG: {
readonly TTL_MS: number;
};
export declare const LOOP_DISPLAY_LIMITS: {
readonly MAX_CONVERSATIONS: 20;
readonly CONTENT_LENGTH: 50;
readonly TITLE_LENGTH: 40;
readonly SESSION_ID_DISPLAY: 12;
readonly SESSION_ID_SHORT: 8;
readonly PAGE_SIZE: 15;
};