create-ai-chat-context-experimental
Version:
Phase 2: TypeScript rewrite - AI Chat Context & Memory System with conversation extraction and AICF format support (powered by aicf-core v2.1.0).
61 lines • 1.93 kB
TypeScript
/**
* This file is part of create-ai-chat-context-experimental.
* Licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).
* See LICENSE file for details.
*/
/**
* Generic Parser
* Fallback parser for unknown/generic conversation formats
* October 2025
*/
import type { Message } from '../types/index.js';
import type { Result } from '../types/index.js';
/**
* Parse generic/unknown conversation formats
* Attempts to extract messages from various text formats
*/
export declare class GenericParser {
/**
* Parse generic data into messages
*
* @param rawData - Raw data in unknown format
* @param conversationId - Conversation ID
* @returns Result with Message[] or error
*/
parse(rawData: string, conversationId: string): Result<Message[]>;
/**
* Extract messages from generic data
* @param rawData - Raw data string
* @param conversationId - Conversation ID
* @returns Message[]
*/
private extractMessages;
/**
* Try to parse JSON format
* @param rawData - Raw data
* @param conversationId - Conversation ID
* @returns Message[] or empty array
*/
private tryParseJSON;
/**
* Try to parse line-based format (role: content)
* @param rawData - Raw data
* @param conversationId - Conversation ID
* @returns Message[] or empty array
*/
private tryParseLineFormat;
/**
* Try to parse markdown-style format (## User / ## Assistant)
* @param rawData - Raw data
* @param conversationId - Conversation ID
* @returns Message[] or empty array
*/
private tryParseMarkdownFormat;
/**
* Detect if data is in generic format
* @param rawData - Raw data
* @returns true if data appears to be in a parseable format
*/
isGenericData(rawData: string): boolean;
}
//# sourceMappingURL=GenericParser.d.ts.map