UNPKG

claritykit-svelte

Version:

A comprehensive Svelte component library focused on accessibility, ADHD-optimized design, developer experience, and full SSR compatibility

90 lines 2.96 kB
import type { ChatMessage, RichTextChatMessage } from './types.js'; /** * Knowledge Integration utilities for ChatThread * Provides integration with the knowledge management system for messages */ export interface KnowledgeBlock { id: string; content: string; type: 'message' | 'note' | 'concept' | 'reference'; metadata: { created: Date; modified: Date; author: string; tags: string[]; links: string[]; backlinks: string[]; }; } export interface SemanticConcept { id: string; name: string; description?: string; category?: string; confidence?: number; relatedConcepts?: string[]; } export interface BlockLink { sourceId: string; targetId: string; type: 'reference' | 'transclusion' | 'mention'; context?: string; } /** * Convert a chat message to a knowledge block */ export declare function messageToKnowledgeBlock(message: ChatMessage | RichTextChatMessage): KnowledgeBlock; /** * Extract semantic concepts from message content */ export declare function extractSemanticConcepts(content: string): Promise<SemanticConcept[]>; /** * Find related blocks based on content similarity */ export declare function findRelatedBlocks(blockId: string, content: string, limit?: number): Promise<string[]>; /** * Create block links between messages and other content */ export declare function createBlockLink(sourceBlockId: string, targetBlockId: string, type?: BlockLink['type']): BlockLink; /** * Parse block references from content * Supports [[block-id]] and {{block-id}} syntax */ export declare function parseBlockReferences(content: string): { links: string[]; transclusions: string[]; }; /** * Generate message suggestions based on context */ export declare function generateMessageSuggestions(messageHistory: ChatMessage[], currentUser: string, context?: string): Promise<string[]>; /** * Index message content for search */ export declare function indexMessageContent(message: ChatMessage | RichTextChatMessage): Promise<void>; /** * Search messages and related content */ export declare function searchKnowledgeBase(query: string, messageHistory: ChatMessage[], options?: { includeMessages?: boolean; includeNotes?: boolean; includeConcepts?: boolean; limit?: number; }): Promise<{ messages: ChatMessage[]; blocks: KnowledgeBlock[]; concepts: SemanticConcept[]; }>; /** * Get conversation context for AI agents */ export declare function getConversationContext(messages: ChatMessage[], maxMessages?: number, includeMetadata?: boolean): string; /** * Auto-tag messages with semantic concepts */ export declare function autoTagMessage(content: string): Promise<string[]>; /** * Suggest block links based on content similarity */ export declare function suggestBlockLinks(content: string, existingBlocks: KnowledgeBlock[]): Promise<string[]>; //# sourceMappingURL=knowledge-integration.d.ts.map