@restnfeel/agentc-starter-kit
Version:
한국어 기업용 CMS 모듈 - Task Master AI와 함께 빠르게 웹사이트를 구현할 수 있는 재사용 가능한 컴포넌트 시스템
1,249 lines (1,202 loc) • 40.5 kB
TypeScript
import * as React$1 from 'react';
import React__default, { ReactNode } from 'react';
import * as __types_templates from '@/types/templates';
import { SiteTemplate, TemplateCategory, TemplateLibrary } from '@/types/templates';
import { Prisma } from '@prisma/client';
type ClassValue = string | number | boolean | undefined | null | {
[key: string]: any;
} | ClassValue[];
declare function cn(...inputs: ClassValue[]): string;
interface User {
id: string;
email: string;
name: string;
avatar_url?: string;
role: "customer" | "front_agent" | "creator";
created_at: string;
updated_at: string;
}
interface SectionConfig {
id: string;
section_name: string;
is_active: boolean;
style_config: Record<string, unknown>;
order_index: number;
}
interface UserConsent {
privacy_policy_agreed: boolean;
terms_agreed: boolean;
marketing_agreed: boolean;
agreed_at: string;
}
interface BaseComponentProps {
className?: string;
children?: React.ReactNode;
}
interface AuthConfig {
supabaseUrl?: string;
supabaseAnonKey?: string;
nextAuthConfig?: Record<string, unknown>;
}
interface HeroSectionProps extends BaseComponentProps {
title?: string;
subtitle?: string;
ctaText?: string;
backgroundImage?: string;
onCtaClick?: () => void;
ctaHref?: string;
ctaTarget?: "_self" | "_blank";
}
interface FeaturesSectionProps extends BaseComponentProps {
features?: Array<{
title: string;
description: string;
icon?: React.ReactNode;
}>;
}
interface CTASectionProps extends BaseComponentProps {
title?: string;
subtitle?: string;
buttonText?: string;
variant?: "primary" | "secondary";
onButtonClick?: () => void;
}
interface ProblemSectionProps extends BaseComponentProps {
title?: string;
subtitle?: string;
problems?: Array<{
title: string;
description: string;
icon?: React.ReactNode;
}>;
variant?: "grid" | "list";
}
interface TestimonialSectionProps extends BaseComponentProps {
title?: string;
subtitle?: string;
testimonials?: Array<{
content: string;
author: string;
role?: string;
company?: string;
avatar?: string;
rating?: number;
}>;
variant?: "cards" | "carousel" | "grid";
}
interface PricingSectionProps extends BaseComponentProps {
title?: string;
subtitle?: string;
plans?: Array<{
name: string;
price: string;
period?: string;
description: string;
features: string[];
highlighted?: boolean;
buttonText?: string;
buttonVariant?: "primary" | "secondary" | "outline";
onButtonClick?: () => void;
}>;
billingOptions?: Array<{
label: string;
value: string;
}>;
selectedBilling?: string;
onBillingChange?: (value: string) => void;
}
interface FAQSectionProps extends BaseComponentProps {
title?: string;
subtitle?: string;
faqs?: Array<{
question: string;
answer: string;
}>;
variant?: "accordion" | "grid";
}
interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
variant?: "primary" | "secondary" | "outline" | "destructive" | "ghost";
size?: "sm" | "md" | "lg";
loading?: boolean;
}
declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
interface InputProps extends React__default.InputHTMLAttributes<HTMLInputElement> {
label?: string;
helperText?: string;
error?: string;
}
declare const Input: React__default.ForwardRefExoticComponent<InputProps & React__default.RefAttributes<HTMLInputElement>>;
interface CardProps extends React__default.HTMLAttributes<HTMLDivElement> {
}
declare const Card: React__default.ForwardRefExoticComponent<CardProps & React__default.RefAttributes<HTMLDivElement>>;
interface CardHeaderProps extends React__default.HTMLAttributes<HTMLDivElement> {
}
declare const CardHeader: React__default.ForwardRefExoticComponent<CardHeaderProps & React__default.RefAttributes<HTMLDivElement>>;
interface CardContentProps extends React__default.HTMLAttributes<HTMLDivElement> {
}
declare const CardContent: React__default.ForwardRefExoticComponent<CardContentProps & React__default.RefAttributes<HTMLDivElement>>;
interface CardFooterProps extends React__default.HTMLAttributes<HTMLDivElement> {
}
declare const CardFooter: React__default.ForwardRefExoticComponent<CardFooterProps & React__default.RefAttributes<HTMLDivElement>>;
interface CardTitleProps extends React__default.HTMLAttributes<HTMLHeadingElement> {
}
declare const CardTitle: React__default.ForwardRefExoticComponent<CardTitleProps & React__default.RefAttributes<HTMLHeadingElement>>;
interface ModalProps extends BaseComponentProps {
open?: boolean;
onClose?: () => void;
onOpenChange?: (open: boolean) => void;
size?: "sm" | "md" | "lg" | "xl" | "full";
showCloseButton?: boolean;
closeOnOverlayClick?: boolean;
closeOnEscape?: boolean;
role?: "dialog" | "alertdialog";
ariaLabelledBy?: string;
ariaDescribedBy?: string;
animation?: boolean;
}
declare const Modal: React__default.ForwardRefExoticComponent<ModalProps & React__default.RefAttributes<HTMLDivElement>>;
declare const ModalHeader: React__default.ForwardRefExoticComponent<BaseComponentProps & React__default.RefAttributes<HTMLDivElement>>;
interface ModalTitleProps extends BaseComponentProps {
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
}
declare const ModalTitle: React__default.ForwardRefExoticComponent<ModalTitleProps & React__default.RefAttributes<HTMLHeadingElement>>;
declare const ModalDescription: React__default.ForwardRefExoticComponent<BaseComponentProps & React__default.RefAttributes<HTMLParagraphElement>>;
declare const ModalContent: React__default.ForwardRefExoticComponent<BaseComponentProps & React__default.RefAttributes<HTMLDivElement>>;
interface ModalFooterProps extends BaseComponentProps {
justify?: "start" | "end" | "center" | "between";
}
declare const ModalFooter: React__default.ForwardRefExoticComponent<ModalFooterProps & React__default.RefAttributes<HTMLDivElement>>;
interface LoadingProps extends BaseComponentProps {
size?: "xs" | "sm" | "md" | "lg" | "xl";
variant?: "spinner" | "dots" | "pulse" | "bars" | "ring";
text?: string;
center?: boolean;
color?: "primary" | "secondary" | "muted";
overlay?: boolean;
}
declare const Loading: React__default.ForwardRefExoticComponent<LoadingProps & React__default.RefAttributes<HTMLDivElement>>;
interface ConfirmationDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
title: string;
description: string;
confirmText?: string;
cancelText?: string;
variant?: "default" | "destructive" | "warning";
onConfirm: () => void;
onCancel?: () => void;
loading?: boolean;
}
declare function ConfirmationDialog({ open, onOpenChange, title, description, confirmText, cancelText, variant, onConfirm, onCancel, loading, }: ConfirmationDialogProps): React__default.JSX.Element;
declare function useConfirmationDialog(): {
showConfirmation: (options: {
title: string;
description: string;
confirmText?: string;
cancelText?: string;
variant?: "default" | "destructive" | "warning";
onConfirm: () => void;
onCancel?: () => void;
}) => void;
hideConfirmation: () => void;
setLoading: (loading: boolean) => void;
ConfirmationDialog: () => React__default.JSX.Element;
};
declare const UI_COMPONENTS_VERSION = "0.1.0";
interface Message$1 {
id: string;
content: string;
sender: "user" | "ai";
timestamp: Date;
type?: "text" | "error" | "system";
isStreaming?: boolean;
}
declare class ChatbotAPIError extends Error {
status?: number;
code?: string;
constructor(message: string, status?: number, code?: string);
}
interface ChatbotTheme {
primary: string;
secondary: string;
background: string;
surface: string;
text: {
primary: string;
secondary: string;
inverse: string;
};
border: string;
shadow: string;
success: string;
warning: string;
error: string;
radius: {
sm: string;
md: string;
lg: string;
full: string;
};
spacing: {
xs: string;
sm: string;
md: string;
lg: string;
xl: string;
};
typography: {
fontFamily: string;
fontSize: {
xs: string;
sm: string;
md: string;
lg: string;
xl: string;
};
fontWeight: {
normal: string;
medium: string;
semibold: string;
bold: string;
};
};
}
declare const themes: {
readonly default: ChatbotTheme;
readonly dark: ChatbotTheme;
readonly compact: ChatbotTheme;
};
type ThemeName = keyof typeof themes;
interface ChatbotWidgetProps {
apiBaseUrl?: string;
apiKey?: string;
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
buttonSize?: "sm" | "md" | "lg";
buttonColor?: string;
title?: string;
placeholder?: string;
enableSuggestedQuestions?: boolean;
enableTypingIndicator?: boolean;
enableRetry?: boolean;
maxRetries?: number;
className?: string;
disabled?: boolean;
onError?: (error: ChatbotAPIError) => void;
onMessageSent?: (message: string) => void;
onMessageReceived?: (message: Message$1) => void;
theme?: ThemeName;
language?: string;
enableLanguageSelector?: boolean;
enableThemeToggle?: boolean;
}
declare function ChatbotWidget({ theme, language, ...props }: ChatbotWidgetProps): React__default.JSX.Element;
interface DesktopChatModalProps {
onSendMessage: (message: string) => void;
isTyping?: boolean;
title?: string;
placeholder?: string;
className?: string;
disabled?: boolean;
showSuggestedQuestions?: boolean;
suggestedQuestionsContext?: string;
allowMinimize?: boolean;
width?: string;
height?: string;
/** Whether to announce messages to screen readers */
announceMessages?: boolean;
/** Custom breakpoints for responsive design */
breakpoints?: {
mobile: string;
tablet: string;
desktop: string;
};
}
declare function DesktopChatModal({ onSendMessage, isTyping, title, placeholder, className, disabled, showSuggestedQuestions, suggestedQuestionsContext, allowMinimize, width, height, announceMessages, breakpoints, }: DesktopChatModalProps): React__default.JSX.Element;
interface Message {
id: string;
content: string;
sender: "user" | "ai";
timestamp: Date;
type?: "text" | "error" | "system";
isStreaming?: boolean;
}
interface ModalState {
isOpen: boolean;
isMinimized: boolean;
position: {
x: number;
y: number;
};
size: {
width: string;
height: string;
};
zIndex: number;
}
interface ChatSession {
id: string;
messages: Message[];
createdAt: Date;
lastActivity: Date;
title?: string;
}
interface ModalStateContextType {
modalState: ModalState;
openModal: () => void;
closeModal: () => void;
minimizeModal: () => void;
maximizeModal: () => void;
setModalPosition: (x: number, y: number) => void;
setModalSize: (width: string, height: string) => void;
bringToFront: () => void;
currentSession: ChatSession | null;
sessions: ChatSession[];
createSession: (title?: string) => string;
switchSession: (sessionId: string) => void;
deleteSession: (sessionId: string) => void;
addMessage: (message: Omit<Message, "id" | "timestamp">) => void;
clearCurrentSession: () => void;
saveToStorage: () => void;
loadFromStorage: () => void;
clearStorage: () => void;
}
declare function useModalState(): ModalStateContextType;
interface ModalStateProviderProps {
children: ReactNode;
persistToStorage?: boolean;
maxSessions?: number;
sessionTimeout?: number;
}
declare function ModalStateProvider({ children, persistToStorage, maxSessions, sessionTimeout, }: ModalStateProviderProps): React__default.JSX.Element;
declare const templates: SiteTemplate[];
declare const templateCategories: {
id: TemplateCategory;
name: string;
description: string;
icon: string;
}[];
declare const templateLibrary: TemplateLibrary;
declare class TemplateManager {
private templates;
constructor(templates: SiteTemplate[]);
getById(id: string): SiteTemplate | undefined;
getBySlug(slug: string): SiteTemplate | undefined;
getByCategory(category: TemplateCategory): SiteTemplate[];
getFreeTemplates(): SiteTemplate[];
getPremiumTemplates(): SiteTemplate[];
getActiveTemplates(): SiteTemplate[];
getPublicTemplates(): SiteTemplate[];
search(query: string): SiteTemplate[];
filter(options: {
category?: TemplateCategory;
pricing?: "FREE" | "PREMIUM" | "ENTERPRISE";
features?: string[];
tags?: string[];
search?: string;
}): SiteTemplate[];
sort(templates: SiteTemplate[], sortBy: "name" | "popularity" | "rating" | "date", order?: "asc" | "desc"): SiteTemplate[];
getRecommendations(currentTemplate?: SiteTemplate, limit?: number): SiteTemplate[];
getStats(): {
total: number;
active: number;
free: number;
premium: number;
categories: Record<TemplateCategory, number>;
};
}
declare const templateManager: TemplateManager;
declare const getTemplateById: (id: string) => SiteTemplate;
declare const getTemplateBySlug: (slug: string) => SiteTemplate;
declare const getTemplatesByCategory: (category: TemplateCategory) => SiteTemplate[];
declare const searchTemplates: (query: string) => SiteTemplate[];
declare const filterTemplates: (options: Parameters<typeof templateManager.filter>[0]) => SiteTemplate[];
declare const getTemplateStats: () => {
total: number;
active: number;
free: number;
premium: number;
categories: Record<TemplateCategory, number>;
};
declare const createSiteFromTemplate: (templateId: string, siteData: {
name: string;
slug: string;
domain?: string;
}) => {
name: string;
slug: string;
domain: string;
templateId: string;
templateData: Prisma.InputJsonValue;
settings: Prisma.InputJsonValue;
sections: {
type: __types_templates.SectionType;
name: string;
content: Prisma.InputJsonValue;
styles: Prisma.InputJsonValue;
order: number;
isVisible: boolean;
isPublished: boolean;
}[];
};
declare const cloneTemplate: (templateId: string, newData: Partial<SiteTemplate>) => SiteTemplate;
interface Document {
id: string;
content: string;
metadata: DocumentMetadata$1;
source: string;
chunks?: DocumentChunk[];
}
interface DocumentMetadata$1 {
title?: string;
author?: string;
createdAt: Date;
updatedAt: Date;
fileType: string;
fileSize: number;
language?: string;
tags?: string[];
categories?: string[];
description?: string;
}
interface DocumentChunk {
id: string;
content: string;
metadata: ChunkMetadata;
embedding?: number[];
}
interface ChunkMetadata {
documentId: string;
chunkIndex: number;
startOffset: number;
endOffset: number;
tokens: number;
source: string;
}
interface SearchResult {
chunk: DocumentChunk;
score: number;
document: Document;
}
interface EmbeddingModel {
embed(text: string): Promise<number[]>;
embedBatch(texts: string[]): Promise<number[][]>;
}
interface VectorStore {
addDocuments(documents: Document[]): Promise<void>;
search(query: string, k?: number): Promise<SearchResult[]>;
delete(documentId: string): Promise<void>;
update(document: Document): Promise<void>;
}
interface RAGConfig {
embeddingModel: string;
chunkSize: number;
chunkOverlap: number;
vectorStorePath: string;
supabaseConfig: {
url: string;
anonKey: string;
bucket: string;
};
llmConfig: {
modelName: string;
temperature: number;
maxTokens: number;
apiKey: string;
};
}
interface ChatMessage {
id: string;
role: "user" | "assistant" | "system";
content: string;
timestamp: Date;
updatedAt?: Date;
metadata?: {
sources?: SearchResult[];
model?: string;
tokenCount?: number;
error?: string;
[key: string]: any;
};
}
interface ConversationContext {
id: string;
messages: ChatMessage[];
sessionId?: string;
userId?: string;
createdAt: Date;
updatedAt: Date;
metadata?: Record<string, any>;
}
interface SupabaseStorageConfig {
url: string;
anonKey: string;
bucket: string;
}
interface DocumentUploadResult {
id: string;
path: string;
url: string;
size: number;
mimeType: string;
uploadedAt: Date;
}
interface DocumentVersion {
id: string;
documentId: string;
version: number;
path: string;
size: number;
uploadedAt: Date;
metadata?: Record<string, any>;
}
declare class SupabaseStorageManager {
private client;
private bucket;
constructor(config: SupabaseStorageConfig);
initializeBucket(): Promise<void>;
uploadDocument(file: Buffer | File, fileName: string, metadata?: Record<string, any>): Promise<DocumentUploadResult>;
downloadDocument(path: string): Promise<Buffer>;
deleteDocument(path: string): Promise<void>;
listDocuments(prefix?: string): Promise<Array<{
name: string;
id: string;
updated_at: string;
size: number;
metadata: Record<string, any>;
}>>;
createDocumentVersion(originalPath: string, newFile: Buffer | File, version: number, metadata?: Record<string, any>): Promise<DocumentVersion>;
getDocumentVersions(documentId: string): Promise<DocumentVersion[]>;
private sanitizeFileName;
private generateDocumentId;
private getMimeType;
getStorageStats(): Promise<{
totalFiles: number;
totalSize: number;
bucketName: string;
}>;
}
interface QueryProcessingConfig {
enableSpellCheck?: boolean;
enableSynonymExpansion?: boolean;
enableStopWordRemoval?: boolean;
minQueryLength?: number;
maxQueryLength?: number;
}
interface ProcessedQuery {
original: string;
processed: string;
keywords: string[];
entities?: string[];
intent?: string;
language?: string;
}
declare class QueryProcessor {
private config;
private stopWords;
private synonyms;
constructor(config?: QueryProcessingConfig);
processQuery(query: string): Promise<ProcessedQuery>;
private isValidQuery;
private normalizeText;
private removeStopWords;
private extractKeywords;
private expandWithSynonyms;
private detectLanguage;
private extractEntities;
private determineIntent;
private initializeStopWords;
private initializeSynonyms;
addSynonyms(word: string, synonyms: string[]): void;
addStopWords(words: string[]): void;
}
interface HybridSearchConfig {
vectorWeight: number;
keywordWeight: number;
maxResults: number;
minScore: number;
enableReranking?: boolean;
}
interface KeywordSearchResult {
chunkId: string;
score: number;
matches: string[];
}
declare class HybridRetriever {
private vectorStore;
private embeddingModel;
private queryProcessor;
private config;
private documentIndex;
constructor(vectorStore: VectorStore, embeddingModel: EmbeddingModel, config?: Partial<HybridSearchConfig>);
search(query: string, k?: number): Promise<SearchResult[]>;
private performVectorSearch;
private performKeywordSearch;
private combineResults;
private rerankResults;
updateDocumentIndex(chunkId: string, content: string): void;
removeFromIndex(chunkId: string): void;
updateConfig(config: Partial<HybridSearchConfig>): void;
getSearchStats(): {
indexSize: number;
config: HybridSearchConfig;
};
clearIndex(): void;
}
declare class RAGEngine {
private vectorStore;
private embeddingModel;
private processingPipeline;
private storageManager?;
private hybridRetriever?;
private rssManager;
private config;
constructor(config: RAGConfig);
private initializeComponents;
initialize(): Promise<void>;
addDocument(filePath: string, content: Buffer): Promise<string>;
addDocuments(files: Array<{
path: string;
content: Buffer;
}>): Promise<string[]>;
search(query: string, k?: number): Promise<SearchResult[]>;
vectorSearch(query: string, k?: number): Promise<SearchResult[]>;
hybridSearch(query: string, k?: number): Promise<SearchResult[]>;
deleteDocument(documentId: string): Promise<void>;
updateDocument(documentId: string, filePath: string, content: Buffer): Promise<void>;
getSupportedExtensions(): string[];
getStats(): Promise<{
documentCount: number;
chunkCount: number;
embeddingModel: string;
vectorStoreType: string;
}>;
clear(): Promise<void>;
uploadDocumentToStorage(file: Buffer | File, fileName: string, metadata?: Record<string, any>): Promise<DocumentUploadResult>;
addDocumentFromStorage(filePath: string): Promise<string>;
uploadAndAddDocument(file: Buffer | File, fileName: string, metadata?: Record<string, any>): Promise<{
documentId: string;
uploadResult: DocumentUploadResult;
}>;
deleteDocumentFromStorage(documentPath: string): Promise<void>;
listStorageDocuments(): Promise<Array<{
name: string;
id: string;
updated_at: string;
size: number;
metadata: Record<string, any>;
}>>;
getStorageStats(): Promise<{
totalFiles: number;
totalSize: number;
bucketName: string;
}>;
private getDocumentIdFromPath;
isStorageConfigured(): boolean;
updateHybridSearchConfig(config: Partial<HybridSearchConfig>): void;
getSearchStats(): {
hybridRetriever?: {
indexSize: number;
config: HybridSearchConfig;
};
vectorStore: {
chunkCount: number;
embeddingModel: string;
};
};
clearSearchIndex(): void;
addSearchSynonyms(word: string, synonyms: string[]): void;
searchWithOptions(query: string, options?: {
method?: "hybrid" | "vector" | "keyword";
k?: number;
minScore?: number;
vectorWeight?: number;
keywordWeight?: number;
}): Promise<SearchResult[]>;
addNaverBlogRSS(blogId: string, feedName?: string, config?: {
maxItems?: number;
includeContent?: boolean;
}): Promise<{
documentIds: string[];
feedName: string;
itemCount: number;
}>;
addRSSFeed(url: string, feedName?: string, config?: {
maxItems?: number;
includeContent?: boolean;
}): Promise<{
documentIds: string[];
feedName: string;
itemCount: number;
}>;
refreshRSSFeed(feedName: string): Promise<{
documentIds: string[];
itemCount: number;
}>;
refreshAllRSSFeeds(): Promise<Map<string, {
documentIds: string[];
itemCount: number;
}>>;
removeRSSFeed(feedName: string): boolean;
getRSSFeedNames(): string[];
getRSSFeedInfo(feedName: string): {
exists: boolean;
type: "naver" | "generic" | null;
blogId?: string;
rssUrl?: string;
};
static extractNaverBlogId(url: string): string | null;
}
interface TextSplitterConfig {
chunkSize: number;
chunkOverlap: number;
separators?: string[];
keepSeparator?: boolean;
}
declare class RecursiveTextSplitter {
private config;
constructor(config: TextSplitterConfig);
splitDocument(document: Document): Promise<DocumentChunk[]>;
private splitText;
private estimateTokenCount;
}
interface ProcessingPipelineConfig {
textSplitter: TextSplitterConfig;
enableMetadataExtraction?: boolean;
enableTextCleaning?: boolean;
}
declare class DocumentProcessingPipeline {
private loaderFactory;
private textSplitter;
private config;
constructor(config: ProcessingPipelineConfig);
processDocument(filePath: string, content: Buffer): Promise<Document>;
processBatch(files: Array<{
path: string;
content: Buffer;
}>): Promise<Document[]>;
getSupportedExtensions(): string[];
private extractMetadata;
private cleanDocumentText;
private detectLanguage;
private extractDescription;
private extractCategories;
}
declare class DocumentLoaderFactory {
private supportedExtensions;
loadDocument(filePath: string, content: Buffer): Promise<Document>;
private loadPDFWithLangChain;
private loadTextFile;
private convertToOurFormat;
private createTempFile;
private cleanupTempFile;
private getFileExtension;
private extractTitleFromPath;
private generateDocumentId;
private detectLanguage;
private extractDescription;
getSupportedExtensions(): string[];
isSupported(filePath: string): boolean;
}
declare abstract class BaseDocumentLoader {
abstract supportedExtensions: string[];
abstract load(filePath: string, content: Buffer): Promise<Document>;
canLoad(fileExtension: string): boolean;
protected generateDocumentId(filePath: string): string;
protected createBaseMetadata(filePath: string, fileSize: number): DocumentMetadata$1;
protected cleanText(text: string): string;
}
declare class TextDocumentLoader extends BaseDocumentLoader {
supportedExtensions: string[];
load(filePath: string, content: Buffer): Promise<Document>;
}
declare class PDFDocumentLoader extends BaseDocumentLoader {
supportedExtensions: string[];
load(filePath: string, content: Buffer): Promise<Document>;
private extractWithPDFJS;
private extractWithPDFParse;
private extractBasicText;
private extractTitleFromFilename;
private extractDescription;
}
declare class DocxDocumentLoader extends BaseDocumentLoader {
supportedExtensions: string[];
load(filePath: string, content: Buffer): Promise<Document>;
}
interface RSSLoaderConfig {
maxItems?: number;
includeContent?: boolean;
requestOptions?: {
timeout?: number;
headers?: Record<string, string>;
};
}
interface RSSItem {
title?: string;
link?: string;
content?: string;
contentSnippet?: string;
author?: string;
pubDate?: string;
categories?: string[];
guid?: string;
}
interface RSSFeed {
title?: string;
description?: string;
link?: string;
language?: string;
lastBuildDate?: string;
items: RSSItem[];
}
declare class RSSLoader extends BaseDocumentLoader {
supportedExtensions: string[];
private parser;
private config;
constructor(config?: RSSLoaderConfig);
load(filePath: string, content: Buffer): Promise<Document>;
loadFromURL(url: string): Promise<Document[]>;
loadFromString(rssContent: string, sourceUrl: string): Promise<Document[]>;
private processFeed;
private createDocumentFromItem;
private cleanHtmlContent;
private detectLanguage;
protected generateDocumentId(identifier: string): string;
}
declare class NaverBlogRSSLoader extends RSSLoader {
private blogId;
constructor(blogId: string, config?: RSSLoaderConfig);
loadBlog(): Promise<Document[]>;
getBlogId(): string;
getRSSUrl(): string;
static createFromUrl(url: string, config?: RSSLoaderConfig): NaverBlogRSSLoader;
static extractBlogId(url: string): string | null;
}
declare class RSSFeedManager {
private feedSources;
addFeed(name: string, loader: RSSLoader): void;
removeFeed(name: string): boolean;
loadAllFeeds(): Promise<Map<string, Document[]>>;
getFeedNames(): string[];
getFeed(name: string): RSSLoader | undefined;
}
declare class OpenAIEmbeddingModel implements EmbeddingModel {
private embeddings;
constructor(apiKey: string, modelName?: string);
embed(text: string): Promise<number[]>;
embedBatch(texts: string[]): Promise<number[][]>;
getDimensions(): number;
}
type EmbeddingModelType = "openai" | "huggingface" | "local";
interface EmbeddingConfig {
type: EmbeddingModelType;
apiKey?: string;
modelName?: string;
baseUrl?: string;
}
declare class EmbeddingFactory {
static create(config: EmbeddingConfig): EmbeddingModel;
}
declare class MemoryVectorStore implements VectorStore {
private vectors;
private embeddingModel;
private storePath;
constructor(embeddingModel: EmbeddingModel, storePath?: string);
initialize(): Promise<void>;
addDocuments(documents: Document[]): Promise<void>;
search(query: string, k?: number): Promise<SearchResult[]>;
delete(documentId: string): Promise<void>;
update(document: Document): Promise<void>;
clear(): Promise<void>;
getCount(): number;
private cosineSimilarity;
private saveVectors;
private loadVectors;
}
type VectorStoreType = "memory" | "supabase" | "pinecone";
declare class VectorStoreFactory {
static create(type: VectorStoreType, embeddingModel: EmbeddingModel, config: any): VectorStore;
}
interface ConversationConfig {
maxMessages: number;
maxTokens?: number;
retainSystemMessages: boolean;
contextTimeoutMs?: number;
}
interface MessageSummary {
totalMessages: number;
userMessages: number;
assistantMessages: number;
systemMessages: number;
totalTokens: number;
}
declare class ConversationContextManager {
private conversations;
private config;
constructor(config?: Partial<ConversationConfig>);
createConversation(id: string, systemPrompt?: string): ConversationContext;
getConversation(id: string): ConversationContext | null;
addMessage(conversationId: string, message: Omit<ChatMessage, "id" | "timestamp">): ChatMessage;
updateMessage(conversationId: string, messageId: string, updates: Partial<ChatMessage>): boolean;
getConversationHistory(conversationId: string, lastN?: number): ChatMessage[];
getConversationSummary(conversationId: string): MessageSummary | null;
clearConversation(conversationId: string): boolean;
getAllConversations(): ConversationContext[];
cleanupExpiredConversations(): number;
private trimConversation;
private generateMessageId;
updateConversationMetadata(conversationId: string, metadata: Record<string, any>): boolean;
getManagerStats(): {
totalConversations: number;
totalMessages: number;
config: ConversationConfig;
};
}
interface PromptTemplate {
id: string;
name: string;
template: string;
variables: string[];
description?: string;
language?: string;
}
interface PromptContext {
query: string;
retrievedDocuments: SearchResult[];
conversationHistory: ChatMessage[];
userContext?: Record<string, any>;
language?: string;
}
declare class PromptManager {
private templates;
constructor();
private initializeDefaultTemplates;
addTemplate(template: PromptTemplate): void;
getTemplate(id: string): PromptTemplate | null;
listTemplates(): PromptTemplate[];
buildPrompt(templateId: string, context: PromptContext): string;
private formatContext;
private formatConversationHistory;
getTemplateByLanguage(baseId: string, language: string): PromptTemplate | null;
validateTemplate(template: PromptTemplate): {
isValid: boolean;
missingVariables: string[];
};
createCustomTemplate(id: string, name: string, template: string, options?: {
description?: string;
language?: string;
variables?: string[];
}): PromptTemplate;
removeTemplate(id: string): boolean;
getTemplateStats(): {
totalTemplates: number;
languageBreakdown: Record<string, number>;
averageVariables: number;
};
}
interface ChatbotConfig$1 {
ragEngine: RAGEngine;
llmConfig: {
apiKey: string;
modelName: string;
temperature?: number;
maxTokens?: number;
baseURL?: string;
};
conversationConfig?: Partial<ConversationConfig>;
defaultPromptTemplate?: string;
retrievalConfig?: {
topK: number;
minScore: number;
searchMethod: "hybrid" | "vector" | "keyword";
};
languageDetection?: boolean;
}
interface ChatResponse {
message: ChatMessage;
sources: SearchResult[];
conversationId: string;
metadata: {
retrievalTime: number;
generationTime: number;
totalTokens?: number;
model: string;
template: string;
};
}
interface ChatRequest {
message: string;
conversationId?: string;
systemPrompt?: string;
promptTemplate?: string;
retrievalOptions?: {
topK?: number;
minScore?: number;
searchMethod?: "hybrid" | "vector" | "keyword";
};
userContext?: Record<string, any>;
}
declare class RAGChatbot {
private ragEngine;
private contextManager;
private promptManager;
private config;
constructor(config: ChatbotConfig$1);
chat(request: ChatRequest): Promise<ChatResponse>;
private retrieveDocuments;
private generateResponse;
private callLLM;
private detectLanguage;
getConversation(conversationId: string): ConversationContext | null;
clearConversation(conversationId: string): boolean;
getConversationHistory(conversationId: string, lastN?: number): ChatMessage[];
streamChat(request: ChatRequest): AsyncGenerator<{
type: "retrieval" | "generation" | "complete";
data: any;
}>;
private generateConversationId;
private generateMessageId;
updateConfig(updates: Partial<ChatbotConfig$1>): void;
addPromptTemplate(template: {
id: string;
name: string;
template: string;
variables: string[];
description?: string;
language?: string;
}): void;
getStats(): {
conversations: number;
totalMessages: number;
ragEngineStats: any;
promptTemplates: number;
};
summarizeConversation(conversationId: string): Promise<string>;
suggestFollowUpQuestions(conversationId: string): Promise<string[]>;
}
declare function createRAGChatbot(config: {
ragEngine: any;
llmConfig: {
apiKey: string;
modelName: string;
temperature?: number;
maxTokens?: number;
};
options?: {
defaultPromptTemplate?: string;
languageDetection?: boolean;
retrievalConfig?: {
topK?: number;
minScore?: number;
searchMethod?: "hybrid" | "vector" | "keyword";
};
};
}): RAGChatbot;
declare function createDefaultRAGConfig(llmApiKey: string, vectorStorePath?: string, chunkSize?: number, chunkOverlap?: number): {
embeddingModel: string;
chunkSize: number;
chunkOverlap: number;
vectorStorePath: string;
supabaseConfig: {
url: string;
anonKey: string;
bucket: string;
};
llmConfig: {
modelName: string;
temperature: number;
maxTokens: number;
apiKey: string;
};
};
interface DocumentMetadata {
title?: string;
category?: string;
tags?: string[];
description?: string;
version?: string;
}
interface UploadedDocument {
id: string;
name: string;
size: number;
uploadedAt: string;
metadata: DocumentMetadata;
path: string;
url?: string;
}
interface DocumentUploaderProps {
ragEngine: RAGEngine;
onDocumentUploaded?: (document: UploadedDocument) => void;
onDocumentDeleted?: (documentId: string) => void;
}
declare function DocumentUploader({ ragEngine, onDocumentUploaded, onDocumentDeleted, }: DocumentUploaderProps): React$1.JSX.Element;
interface KnowledgeEntry {
id: string;
title: string;
content: string;
category: string;
tags: string[];
createdAt: string;
updatedAt: string;
status: "active" | "draft" | "archived";
description?: string;
priority?: "high" | "medium" | "low";
}
interface KnowledgeEditorProps {
ragEngine: RAGEngine;
onEntryCreated?: (entry: KnowledgeEntry) => void;
onEntryUpdated?: (entry: KnowledgeEntry) => void;
onEntryDeleted?: (entryId: string) => void;
}
declare function KnowledgeEditor({ ragEngine, onEntryCreated, onEntryUpdated, onEntryDeleted, }: KnowledgeEditorProps): React$1.JSX.Element;
interface KnowledgeManagementProps {
ragConfig?: RAGConfig;
}
declare function KnowledgeManagement({ ragConfig }: KnowledgeManagementProps): React__default.JSX.Element;
interface RAGManagerProps {
ragEngine: RAGEngine;
onRetrainTriggered?: () => void;
}
declare function RAGManager({ ragEngine, onRetrainTriggered }: RAGManagerProps): React$1.JSX.Element;
interface RSSFeedInfo {
name: string;
type: "naver" | "generic";
url?: string;
blogId?: string;
itemCount?: number;
lastUpdated?: Date;
}
interface RSSManagerProps {
ragEngine: RAGEngine;
onFeedAdded?: (feedInfo: RSSFeedInfo) => void;
onFeedRemoved?: (feedName: string) => void;
onFeedRefreshed?: (feedName: string, itemCount: number) => void;
}
declare function RSSManager({ ragEngine, onFeedAdded, onFeedRemoved, onFeedRefreshed, }: RSSManagerProps): React$1.JSX.Element;
interface ChatbotConfig {
systemPrompt: string;
welcomeMessage: string;
suggestedQuestions: string[];
maxConversationHistory: number;
enableRAG: boolean;
ragSettings: {
similarityThreshold: number;
maxRetrievedDocs: number;
chunkSize: number;
chunkOverlap: number;
};
uiSettings: {
theme: string;
language: string;
showTimestamps: boolean;
enableTypingIndicator: boolean;
};
}
interface ChatbotProviderProps {
children: ReactNode;
initialConfig?: Partial<ChatbotConfig>;
autoInitialize?: boolean;
}
declare function ChatbotProvider({ children, initialConfig, autoInitialize, }: ChatbotProviderProps): React__default.JSX.Element;
export { BaseDocumentLoader, Button, Card, CardContent, CardFooter, CardHeader, CardTitle, ChatbotProvider, ChatbotWidget, ConfirmationDialog, ConversationContextManager, DesktopChatModal, DocumentLoaderFactory, DocumentProcessingPipeline, DocumentUploader, DocxDocumentLoader, EmbeddingFactory, HybridRetriever, Input, KnowledgeEditor, KnowledgeManagement, Loading, MemoryVectorStore, Modal, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalStateProvider, ModalTitle, NaverBlogRSSLoader, OpenAIEmbeddingModel, PDFDocumentLoader, PromptManager, QueryProcessor, RAGChatbot, RAGEngine, RAGManager, RSSFeedManager, RSSLoader, RSSManager, RecursiveTextSplitter, SupabaseStorageManager, TemplateManager, TextDocumentLoader, UI_COMPONENTS_VERSION, VectorStoreFactory, cloneTemplate, cn, createDefaultRAGConfig, createRAGChatbot, createSiteFromTemplate, filterTemplates, getTemplateById, getTemplateBySlug, getTemplateStats, getTemplatesByCategory, searchTemplates, templateCategories, templateLibrary, templateManager, templates, useConfirmationDialog, useModalState };
export type { AuthConfig, BaseComponentProps, ButtonProps, CTASectionProps, CardProps, CardTitleProps, ChatMessage, ChatRequest, ChatResponse, ChatbotConfig$1 as ChatbotConfig, ChunkMetadata, ConversationConfig, ConversationContext, Document, DocumentChunk, DocumentMetadata$1 as DocumentMetadata, DocumentUploadResult, DocumentVersion, EmbeddingConfig, EmbeddingModel, EmbeddingModelType, FAQSectionProps, FeaturesSectionProps, HeroSectionProps, HybridSearchConfig, InputProps, KeywordSearchResult, LoadingProps, MessageSummary, ModalProps, PricingSectionProps, ProblemSectionProps, ProcessedQuery, ProcessingPipelineConfig, PromptContext, PromptTemplate, QueryProcessingConfig, RAGConfig, RSSFeed, RSSItem, RSSLoaderConfig, SearchResult, SectionConfig, SupabaseStorageConfig, TestimonialSectionProps, TextSplitterConfig, User, UserConsent, VectorStore, VectorStoreType };