-
Notifications
You must be signed in to change notification settings - Fork 614
Feature/builtin knowledge #630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ions and translations
…hance BuiltinKnowledgeSettings with URL query parameter handling
… handling for missing models
…n knowledge configurations
… advanced options and tooltips
… into feat-builtin-knowledge
… on embedding dimensions
…esetting model selection in settings
…, enhance KnowledgePresenter integration
…rove embedding handling and error logging
…rs and loading logic for better user experience
…improve reset logic
… model listing with additional configuration properties
… to include dynamic configuration retrieval
… with error handling
…etection and loading state
…sk scheduling features
…ks in DuckDB and Knowledge presenters
- Updated KnowledgePresenter design document to reflect new architecture and features, including improved lifecycle management and event handling. - Enhanced file processing flow in KnowledgeStorePresenter to ensure immediate feedback and error handling during file reading. - Modified KnowledgeFile.vue to support additional file types and improve file status handling in the UI. - Improved configuration management for Knowledge Presenter, allowing for better integration and user experience.
WalkthroughThis update introduces a comprehensive built-in knowledge base feature to DeepChat, including architecture, design, and implementation. It adds new modules for knowledge base management, file ingestion, vector database operations (DuckDB), task scheduling, and dialog handling. The update also provides extensive UI components, localization, configuration management, and utility functions, enabling local RAG-based search with robust lifecycle, error handling, and extensibility. Changes
Sequence Diagram(s)Knowledge Base File Ingestion and ProcessingsequenceDiagram
participant User
participant UI (Vue)
participant KnowledgePresenter
participant KnowledgeStorePresenter
participant DuckDBPresenter
participant KnowledgeTaskPresenter
participant LLMProviderPresenter
User->>UI (Vue): Upload file
UI (Vue)->>KnowledgePresenter: addFile(id, filePath)
KnowledgePresenter->>KnowledgeStorePresenter: addFile(filePath)
KnowledgeStorePresenter->>DuckDBPresenter: insertFile(metadata)
KnowledgeStorePresenter->>KnowledgeTaskPresenter: add chunking/vector tasks
loop For each chunk
KnowledgeTaskPresenter->>LLMProviderPresenter: getEmbeddings(modelId, chunk)
LLMProviderPresenter-->>KnowledgeTaskPresenter: embedding vector
KnowledgeTaskPresenter->>DuckDBPresenter: insertVector(chunk, vector)
KnowledgeTaskPresenter->>KnowledgeStorePresenter: update progress
end
KnowledgeStorePresenter->>UI (Vue): Emit progress/status events
Knowledge Base Similarity QuerysequenceDiagram
participant User
participant UI (Vue)
participant KnowledgePresenter
participant KnowledgeStorePresenter
participant LLMProviderPresenter
participant DuckDBPresenter
User->>UI (Vue): Search knowledge base
UI (Vue)->>KnowledgePresenter: similarityQuery(id, query)
KnowledgePresenter->>KnowledgeStorePresenter: similarityQuery(query)
KnowledgeStorePresenter->>LLMProviderPresenter: getEmbeddings(modelId, query)
LLMProviderPresenter-->>KnowledgeStorePresenter: embedding vector
KnowledgeStorePresenter->>DuckDBPresenter: similarityQuery(vector)
DuckDBPresenter-->>KnowledgeStorePresenter: top-k results
KnowledgeStorePresenter-->>KnowledgePresenter: results
KnowledgePresenter-->>UI (Vue): results
UI (Vue)-->>User: Display results
Task Scheduling and LifecyclesequenceDiagram
participant KnowledgeStorePresenter
participant KnowledgeTaskPresenter
KnowledgeStorePresenter->>KnowledgeTaskPresenter: addTask(chunkTask)
KnowledgeTaskPresenter->>KnowledgeTaskPresenter: queue/process tasks serially
KnowledgeTaskPresenter->>KnowledgeStorePresenter: onTaskComplete/update status
Estimated code review effort🎯 5 (Critical) | ⏱️ ~90+ minutes Possibly related PRs
Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive built-in knowledge base feature that enables users to use local files as context sources for large language model conversations in an offline environment. The implementation includes complete RAG pipeline functionality with vector storage, embedding generation, task management, and a user interface for knowledge base management.
- Implements a local RAG (Retrieval-Augmented Generation) system with DuckDB vector storage
- Adds comprehensive UI components for knowledge base configuration and file management
- Introduces a global dialog system for user confirmations and task management
Reviewed Changes
Copilot reviewed 68 out of 69 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/shared/dialog.ts | Defines dialog icon constants for the new global dialog system |
| src/renderer/src/stores/settings.ts | Updates Ollama model configuration to use model capabilities from API response |
| src/renderer/src/stores/dialog.ts | Implements dialog state management with timeout and event handling |
| src/renderer/src/lib/utils.ts | Adds MIME type icon mapping utility function for file display |
| Various i18n files | Adds comprehensive internationalization support for knowledge base features |
| src/renderer/src/events.ts | Defines new event constants for dialog and RAG functionality |
| src/renderer/src/components/ui/MessageDialog.vue | Implements global dialog component with timeout and button handling |
| Multiple settings components | Adds built-in knowledge base configuration and file management UI |
| src/main/utils/vector.ts | Implements vector normalization and distance calculation utilities |
| src/main/utils/strings.ts | Adds text sanitization utility for document processing |
| Knowledge base presenter files | Implements complete RAG backend with task management and vector operations |
| LLM provider updates | Adds embedding capability support to OpenAI and Ollama providers |
Comments suppressed due to low confidence (1)
src/main/presenter/llmProviderPresenter/providers/ollamaProvider.ts:304
- The FIXME comment indicates a temporary workaround that calls attachModelInfo for each model individually. This could cause performance issues with many models and should be tracked for future optimization.
context_length,
… language settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 32
🔭 Outside diff range comments (2)
src/renderer/src/components/settings/RagflowKnowledgeSettings.vue (1)
160-160: Replace hardcoded Chinese text with i18n key.The placeholder contains hardcoded Chinese text "用逗号分隔" which violates the coding guideline that all user-facing strings must use i18n keys.
- placeholder="Dataset IDs (用逗号分隔)" + :placeholder="t('settings.knowledgeBase.datasetIdsPlaceholder')"Ensure the corresponding translation key is added to the i18n files:
"datasetIdsPlaceholder": "Dataset IDs (separated by commas)"src/shared/presenter.d.ts (1)
906-906: Fix typo in MCPServerConfig interfaceThere's a typo in the env property type definition.
- env: Record<string, unknow> + env: Record<string, unknown>
♻️ Duplicate comments (3)
src/main/presenter/llmProviderPresenter/index.ts (1)
1210-1221: Update JSDoc comment to match the new parameter order.The JSDoc comment on line 1210 still reflects the old parameter order
(providerId, texts, modelId)but the method signature has been changed to(providerId, modelId, texts). This inconsistency could confuse API consumers.Apply this diff to fix the JSDoc comment:
/** * 获取文本的 embedding 表示 * @param providerId 提供商ID + * @param modelId 模型ID - * @param texts 文本数组 - * @param modelId 模型ID + * @param texts 文本数组 * @returns embedding 数组 */src/renderer/src/stores/settings.ts (1)
1025-1025: Update the Chinese comment to match the actual implementation.The Chinese comment should be updated to reflect that the code now uses
model.model_info.context_lengthinstead ofexistingModel?.contextLength.- contextLength: model.model_info.context_length || 4096, // 使用模型定义值或默认值 + contextLength: model.model_info.context_length || 4096, // 从 model.model_info.context_length 获取值,若无则使用默认值 4096src/main/presenter/knowledgePresenter/knowledgeStorePresenter.ts (1)
273-279: Track chunk error counts in file completionThe TODO comment indicates missing implementation for tracking chunk error counts in the file completion handler.
🧹 Nitpick comments (21)
src/renderer/src/lib/utils.ts (1)
18-66: Consider refactoring the MIME type mapping for better maintainability.The long if-else chain could be refactored using a mapping object or switch statement for better readability and maintainability.
+const MIME_TYPE_MAPPING = { + 'text/plain': 'vscode-icons:file-type-text', + 'application/json': 'vscode-icons:file-type-text', + 'application/javascript': 'vscode-icons:file-type-text', + 'application/typescript': 'vscode-icons:file-type-text', + 'text/csv': 'vscode-icons:file-type-excel', + 'text/markdown': 'vscode-icons:file-type-markdown', + 'application/x-yaml': 'vscode-icons:file-type-yaml', + 'application/xml': 'vscode-icons:file-type-xml', + 'application/xhtml+xml': 'vscode-icons:file-type-xml', + 'application/pdf': 'vscode-icons:file-type-pdf2', + 'text/html': 'vscode-icons:file-type-html', + 'text/css': 'vscode-icons:file-type-css' +} as const; + export function getMimeTypeIcon(mimeType: string) { - if ( - mimeType.startsWith('text/plain') || - mimeType.startsWith('application/json') || - mimeType.startsWith('application/javascript') || - mimeType.startsWith('application/typescript') - ) { - return 'vscode-icons:file-type-text' - } else if (mimeType.startsWith('text/csv')) { - return 'vscode-icons:file-type-excel' - // ... rest of the conditions + // Check exact matches first + if (MIME_TYPE_MAPPING[mimeType]) { + return MIME_TYPE_MAPPING[mimeType]; + } + + // Check prefix matches for categories + if (mimeType.startsWith('image/')) { + return 'vscode-icons:file-type-image'; + } + // ... continue with other prefix checksscripts/installVss.js (2)
42-44: Improve path handling and add file existence validation.The current path extraction and file operations could be more robust.
+ // Validate source file exists + if (!fs.existsSync(sourcePath)) { + throw new Error(`Source extension file not found: ${sourcePath}`) + } + - const filename = sourcePath.substring(sourcePath.lastIndexOf(path.sep) + 1) + const filename = path.basename(sourcePath) const targetPath = path.join(targetDir, filename) + + // Avoid overwriting if target already exists and is identical + if (fs.existsSync(targetPath)) { + const sourceStats = fs.statSync(sourcePath) + const targetStats = fs.statSync(targetPath) + if (sourceStats.size === targetStats.size && sourceStats.mtime <= targetStats.mtime) { + console.log('VSS extension already up to date.') + return + } + } + fs.copyFileSync(sourcePath, targetPath)
10-14: Consider adding more descriptive logging for macOS skip.The current log message could be more informative about why the installation is skipped.
if (isMacOS()) { - console.log('Skipping DuckDB extension installation on macOS') + console.log('Skipping DuckDB VSS extension installation on macOS due to code signing requirements') return }src/renderer/src/stores/dialog.ts (1)
8-12: Consider extracting the dialog presenter to a computed property.The dialog presenter is accessed only once on line 8. Following Vue best practices, consider using a computed property for better reactivity and cleaner code structure.
-export const useDialogStore = defineStore('dialog', () => { - const dialogP = usePresenter('dialogPresenter') +export const useDialogStore = defineStore('dialog', () => { + const dialogP = computed(() => usePresenter('dialogPresenter')) const dialogRequest = ref<DialogRequest | null>(null) const showDialog = ref(false) const timeoutMilliseconds = ref(0)Then update the usage:
- await dialogP.handleDialogResponse(response) + await dialogP.value.handleDialogResponse(response)src/main/utils/vector.ts (2)
71-93: Consider making the sigmoid steepness factor configurable.The hardcoded
k = 0.04factor for sigmoid steepness might not be optimal for all use cases. Consider making it configurable or document the rationale for this specific value.-export function normalizeDistance(distance: number, metric: MetricType): number { +export function normalizeDistance(distance: number, metric: MetricType, sigmoidK: number = 0.04): number { if (metric === 'cosine') { // cosine distance ∈ [0,1],0 越相似,1 越不相似 // confidence = 1 - distance const clipped = Math.min(Math.max(distance, 0), 1) return 1 - clipped } else if (metric === 'ip') { // ip distance = -inner_product,可能为负数 // distance < 0 → 向量夹角 < 90°,相似度高 // distance = 0 → 向量正交,无相似性 // distance > 0 → 向量夹角 > 90°,方向相反 // // 使用 sigmoid 将其映射到 (0,1) // 这里使用 distance * k 来调整 sigmoid 的陡峭程度,需要根据经验和需求微调缩放因子k // k = 0.1 sigmoid 更平滑 // k = 0.5 sigmoid 更陡峭 - const k = 0.04 - const sigmoid = 1 / (1 + Math.exp(Math.sign(distance) * Math.pow(distance, 2) * k)) + const sigmoid = 1 / (1 + Math.exp(Math.sign(distance) * Math.pow(distance, 2) * sigmoidK)) return sigmoid } else { throw new Error(`Unsupported metric: ${metric}`) } }
100-102: Consider a more descriptive function name.The function name
getMetricdoesn't clearly indicate that it's selecting a similarity metric based on vector normalization status.-export function getMetric(normalized: boolean): MetricType { +export function getSimilarityMetric(normalized: boolean): MetricType { return normalized ? 'cosine' : 'ip' }src/renderer/src/components/settings/KnowledgeFile.vue (1)
209-209: Make acceptExts array readonly to prevent mutations.The file extensions array should be immutable to prevent accidental modifications.
-const acceptExts = ['txt', 'md', 'markdown', 'docx', 'pptx', 'pdf'] +const acceptExts = ['txt', 'md', 'markdown', 'docx', 'pptx', 'pdf'] as constsrc/main/lib/textsplitters/document/document.ts (2)
1-14: Consider using interface inheritance to reduce duplication.The
DocumentInterfaceduplicates properties fromDocumentInput. Consider refactoring to extend the interface:-export interface DocumentInterface<Metadata extends Record<string, any> = Record<string, any>> { - pageContent: string - metadata: Metadata - id?: string -} +export interface DocumentInterface<Metadata extends Record<string, any> = Record<string, any>> + extends DocumentInput<Metadata> { + metadata: Metadata // Override to make it required +}
41-44: Add default implementation for the invoke alias method.The
invokemethod is described as an optional alias fortransformDocuments, but without a default implementation, subclasses might forget to implement it or implement it inconsistently.Consider providing a default implementation:
- invoke?(input: Document[], options?: any): Promise<Document[]> + async invoke(input: Document[], options?: any): Promise<Document[]> { + return this.transformDocuments(input, options) + }src/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.ts (1)
128-128: Validate distance bounds for similarity calculation.The similarity calculation
(1 - result.distance)assumes distance is normalized between 0 and 1. Consider adding validation or clamping to ensure accurate similarity scores.- resultText += `相似度: ${(1 - result.distance)}\n\n` + const similarity = Math.max(0, Math.min(1, 1 - result.distance)) + resultText += `Similarity: ${similarity}\n\n`src/renderer/src/components/settings/BuiltinKnowledgeSettings.vue (1)
738-738: Remove debug console.log statement.Debug logging should be removed before merging to production.
- console.log('获取到向量信息:', result.data)docs/dialog-presenter.md (1)
1-61: Consider language consistency with coding guidelines.While this documentation is comprehensive and well-structured, covering the dialog system architecture effectively, the coding guidelines specify using English for technical documentation. Consider providing an English version or translating this documentation to maintain consistency across the codebase.
The technical content itself is excellent, properly documenting the three-layer architecture (DialogPresenter, Pinia store, MessageDialog component) and the event-driven communication flow.
docs/builtin-knowledge.md (2)
1-188: Comprehensive documentation with language consistency consideration.This documentation provides excellent comprehensive coverage of the Knowledge Presenter module, including:
- Clear module overview and core functionality
- Well-defined design goals and user interaction flow
- Detailed technical features and configuration examples
- Practical usage examples and performance optimization guidance
- Future roadmap for planned enhancements
The Mermaid diagram effectively illustrates the user interaction flow, and the TypeScript interface documentation is particularly valuable.
However, consider translating to English for consistency with coding guidelines that specify English for technical documentation.
94-115: Fix markdown list indentation.The static analysis tool has identified inconsistent indentation in the unordered lists. Consider fixing the indentation to use 2 spaces instead of 4 for better markdown consistency.
Apply this pattern throughout the affected lines:
- - [x] `.txt` + - [x] `.txt`src/main/presenter/knowledgePresenter/index.ts (1)
144-146: Consider using a constant for the WAL file extensionThe hardcoded '.wal' extension could lead to maintenance issues if DuckDB changes its WAL file naming convention.
+ const WAL_EXTENSION = '.wal' if (fs.existsSync(dbPath)) { fs.rmSync(dbPath, { recursive: true }) } - if (fs.existsSync(dbPath + '.wal')) { - fs.rmSync(dbPath + '.wal', { recursive: true }) + if (fs.existsSync(dbPath + WAL_EXTENSION)) { + fs.rmSync(dbPath + WAL_EXTENSION, { recursive: true }) }docs/builtin-knowledge-architecture.md (2)
327-327: Remove duplicate headingThe heading "关键设计" appears twice in the document (lines 289 and 327).
Consider removing the duplicate heading or renaming one of them to be more specific.
330-369: Standardize markdown list formattingThe unordered lists use asterisks (*) instead of the expected dashes (-) for consistency.
Apply this formatting fix:
- * 接口层 (`IKnowledgePresenter`): 定义公共 API。 - * 协调层 (`KnowledgePresenter`): 生命周期管理,配置同步和实例缓存。 - * 存储层 (`KnowledgeStorePresenter`): 文件管理,向量化处理和检索逻辑。 - * 调度层 (`KnowledgeTaskPresenter`): 全局任务队列,串行执行和并发控制。 - * 数据层 (`DuckDBPresenter`): 向量数据库操作,事务管理和持久化存储。 + - 接口层 (`IKnowledgePresenter`): 定义公共 API。 + - 协调层 (`KnowledgePresenter`): 生命周期管理,配置同步和实例缓存。 + - 存储层 (`KnowledgeStorePresenter`): 文件管理,向量化处理和检索逻辑。 + - 调度层 (`KnowledgeTaskPresenter`): 全局任务队列,串行执行和并发控制。 + - 数据层 (`DuckDBPresenter`): 向量数据库操作,事务管理和持久化存储。Apply the same change to all other bullet points using asterisks in this section.
docs/builtin-knowledge-design.md (4)
47-53: Serial-only queue may throttle large knowledge-base ingests
KnowledgeTaskPresenterenforces strict serial execution.
For sizeable parallel uploads (multiple knowledge-bases / files) this can easily become the primary bottleneck; DuckDB can safely handle concurrent reads while still allowing one writer.Consider a per-database (or even per-file) write mutex instead of a single global gate to unlock more throughput while retaining ACID guarantees.
152-160: Section numbering is out of order (2 → 4 → 3)Readers will stumble over the jump. Re-order or renumber headings so they appear as 2, 3, 4.
-### 4. 数据库模式设计 +### 3. 数据库模式设计…and bump the subsequent “事件系统” to 4.
164-170: Event names lack a single source of truthHard-coded string literals (
"RAG_EVENTS.FILE_UPDATED"etc.) invite typos across renderers & presenters.
Expose them from a sharedeventBus/constants.tsand import instead.
219-221: Minor zh-CN grammar nit「选择合适的分片策略」→「选择合适地分片策略」
-在 `KnowledgeStorePresenter` 中根据文件类型或配置选择合适的分片策略。 +在 `KnowledgeStorePresenter` 中根据文件类型或配置选择合适地分片策略。Same pattern at line 225 (“实现新的检索逻辑” → “实现新地检索逻辑”).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (71)
docs/builtin-knowledge-architecture.md(1 hunks)docs/builtin-knowledge-design.md(1 hunks)docs/builtin-knowledge.md(1 hunks)docs/dialog-presenter.md(1 hunks)package.json(2 hunks)scripts/installVss.js(1 hunks)src/main/events.ts(1 hunks)src/main/lib/textsplitters/document/document.ts(1 hunks)src/main/lib/textsplitters/document/index.ts(1 hunks)src/main/lib/textsplitters/index.ts(1 hunks)src/main/lib/textsplitters/text_splitter.ts(1 hunks)src/main/presenter/configPresenter/index.ts(5 hunks)src/main/presenter/configPresenter/knowledgeConfHelper.ts(1 hunks)src/main/presenter/configPresenter/mcpConfHelper.ts(1 hunks)src/main/presenter/configPresenter/modelDefaultSettings.ts(1 hunks)src/main/presenter/dialogPresenter/index.ts(1 hunks)src/main/presenter/filePresenter/BaseFileAdapter.ts(1 hunks)src/main/presenter/filePresenter/FilePresenter.ts(2 hunks)src/main/presenter/index.ts(5 hunks)src/main/presenter/knowledgePresenter/database/duckdbPresenter.ts(1 hunks)src/main/presenter/knowledgePresenter/index.ts(1 hunks)src/main/presenter/knowledgePresenter/knowledgeStorePresenter.ts(1 hunks)src/main/presenter/knowledgePresenter/knowledgeTaskPresenter.ts(1 hunks)src/main/presenter/llmProviderPresenter/baseProvider.ts(2 hunks)src/main/presenter/llmProviderPresenter/index.ts(2 hunks)src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts(1 hunks)src/main/presenter/llmProviderPresenter/providers/ollamaProvider.ts(5 hunks)src/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts(2 hunks)src/main/presenter/mcpPresenter/inMemoryServers/builder.ts(2 hunks)src/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.ts(1 hunks)src/main/presenter/trayPresenter.ts(1 hunks)src/main/utils/strings.ts(1 hunks)src/main/utils/vector.ts(1 hunks)src/renderer/src/App.vue(2 hunks)src/renderer/src/components/FileItem.vue(2 hunks)src/renderer/src/components/ModelSelect.vue(1 hunks)src/renderer/src/components/mcp-config/components/McpServers.vue(1 hunks)src/renderer/src/components/settings/BuiltinKnowledgeSettings.vue(1 hunks)src/renderer/src/components/settings/DifyKnowledgeSettings.vue(2 hunks)src/renderer/src/components/settings/FastGptKnowledgeSettings.vue(2 hunks)src/renderer/src/components/settings/KnowledgeBaseSettings.vue(8 hunks)src/renderer/src/components/settings/KnowledgeFile.vue(1 hunks)src/renderer/src/components/settings/KnowledgeFileItem.vue(1 hunks)src/renderer/src/components/settings/ModelConfigItem.vue(2 hunks)src/renderer/src/components/settings/OllamaProviderSettingsDetail.vue(5 hunks)src/renderer/src/components/settings/RagflowKnowledgeSettings.vue(2 hunks)src/renderer/src/components/ui/MessageDialog.vue(1 hunks)src/renderer/src/events.ts(1 hunks)src/renderer/src/i18n/en-US/mcp.json(1 hunks)src/renderer/src/i18n/en-US/settings.json(2 hunks)src/renderer/src/i18n/fa-IR/mcp.json(1 hunks)src/renderer/src/i18n/fa-IR/settings.json(2 hunks)src/renderer/src/i18n/fr-FR/mcp.json(1 hunks)src/renderer/src/i18n/fr-FR/settings.json(2 hunks)src/renderer/src/i18n/ja-JP/mcp.json(1 hunks)src/renderer/src/i18n/ja-JP/settings.json(2 hunks)src/renderer/src/i18n/ko-KR/mcp.json(1 hunks)src/renderer/src/i18n/ko-KR/settings.json(2 hunks)src/renderer/src/i18n/ru-RU/mcp.json(1 hunks)src/renderer/src/i18n/ru-RU/settings.json(2 hunks)src/renderer/src/i18n/zh-CN/mcp.json(1 hunks)src/renderer/src/i18n/zh-CN/settings.json(3 hunks)src/renderer/src/i18n/zh-HK/mcp.json(1 hunks)src/renderer/src/i18n/zh-HK/settings.json(2 hunks)src/renderer/src/i18n/zh-TW/mcp.json(1 hunks)src/renderer/src/i18n/zh-TW/settings.json(2 hunks)src/renderer/src/lib/utils.ts(1 hunks)src/renderer/src/stores/dialog.ts(1 hunks)src/renderer/src/stores/settings.ts(1 hunks)src/shared/dialog.ts(1 hunks)src/shared/presenter.d.ts(7 hunks)
🧰 Additional context used
📓 Path-based instructions (24)
**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Use English for logs and comments
Files:
src/main/lib/textsplitters/document/index.tssrc/renderer/src/components/ModelSelect.vuesrc/renderer/src/App.vuesrc/main/lib/textsplitters/index.tssrc/renderer/src/components/settings/ModelConfigItem.vuesrc/main/presenter/configPresenter/mcpConfHelper.tssrc/renderer/src/components/settings/FastGptKnowledgeSettings.vuesrc/main/presenter/mcpPresenter/inMemoryServers/builder.tssrc/renderer/src/components/FileItem.vuesrc/main/utils/strings.tsscripts/installVss.jssrc/renderer/src/components/settings/DifyKnowledgeSettings.vuesrc/renderer/src/lib/utils.tssrc/main/presenter/llmProviderPresenter/providers/geminiProvider.tssrc/main/presenter/trayPresenter.tssrc/renderer/src/components/settings/RagflowKnowledgeSettings.vuesrc/renderer/src/events.tssrc/renderer/src/components/mcp-config/components/McpServers.vuesrc/renderer/src/components/ui/MessageDialog.vuesrc/main/presenter/index.tssrc/renderer/src/components/settings/KnowledgeFileItem.vuesrc/main/presenter/llmProviderPresenter/baseProvider.tssrc/main/presenter/filePresenter/BaseFileAdapter.tssrc/main/presenter/configPresenter/index.tssrc/renderer/src/stores/settings.tssrc/main/presenter/llmProviderPresenter/index.tssrc/main/presenter/filePresenter/FilePresenter.tssrc/shared/dialog.tssrc/main/events.tssrc/renderer/src/stores/dialog.tssrc/main/presenter/configPresenter/knowledgeConfHelper.tssrc/main/lib/textsplitters/document/document.tssrc/renderer/src/components/settings/KnowledgeFile.vuesrc/main/presenter/configPresenter/modelDefaultSettings.tssrc/main/utils/vector.tssrc/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.tssrc/main/presenter/dialogPresenter/index.tssrc/renderer/src/components/settings/BuiltinKnowledgeSettings.vuesrc/renderer/src/components/settings/OllamaProviderSettingsDetail.vuesrc/renderer/src/components/settings/KnowledgeBaseSettings.vuesrc/main/presenter/llmProviderPresenter/providers/ollamaProvider.tssrc/main/presenter/knowledgePresenter/knowledgeTaskPresenter.tssrc/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/knowledgePresenter/index.tssrc/shared/presenter.d.tssrc/main/lib/textsplitters/text_splitter.tssrc/main/presenter/knowledgePresenter/knowledgeStorePresenter.tssrc/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Strict type checking enabled for TypeScript
**/*.{ts,tsx}: 始终使用 try-catch 处理可能的错误
提供有意义的错误信息
记录详细的错误日志
优雅降级处理
日志应包含时间戳、日志级别、错误代码、错误描述、堆栈跟踪(如适用)、相关上下文信息
日志级别应包括 ERROR、WARN、INFO、DEBUG
不要吞掉错误
提供用户友好的错误信息
实现错误重试机制
避免记录敏感信息
使用结构化日志
设置适当的日志级别
Files:
src/main/lib/textsplitters/document/index.tssrc/main/lib/textsplitters/index.tssrc/main/presenter/configPresenter/mcpConfHelper.tssrc/main/presenter/mcpPresenter/inMemoryServers/builder.tssrc/main/utils/strings.tssrc/renderer/src/lib/utils.tssrc/main/presenter/llmProviderPresenter/providers/geminiProvider.tssrc/main/presenter/trayPresenter.tssrc/renderer/src/events.tssrc/main/presenter/index.tssrc/main/presenter/llmProviderPresenter/baseProvider.tssrc/main/presenter/filePresenter/BaseFileAdapter.tssrc/main/presenter/configPresenter/index.tssrc/renderer/src/stores/settings.tssrc/main/presenter/llmProviderPresenter/index.tssrc/main/presenter/filePresenter/FilePresenter.tssrc/shared/dialog.tssrc/main/events.tssrc/renderer/src/stores/dialog.tssrc/main/presenter/configPresenter/knowledgeConfHelper.tssrc/main/lib/textsplitters/document/document.tssrc/main/presenter/configPresenter/modelDefaultSettings.tssrc/main/utils/vector.tssrc/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.tssrc/main/presenter/dialogPresenter/index.tssrc/main/presenter/llmProviderPresenter/providers/ollamaProvider.tssrc/main/presenter/knowledgePresenter/knowledgeTaskPresenter.tssrc/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/knowledgePresenter/index.tssrc/shared/presenter.d.tssrc/main/lib/textsplitters/text_splitter.tssrc/main/presenter/knowledgePresenter/knowledgeStorePresenter.tssrc/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts
src/main/**/*.ts
📄 CodeRabbit Inference Engine (CLAUDE.md)
Main to Renderer: Use EventBus to broadcast events via mainWindow.webContents.send()
Use Electron's built-in APIs for file system and native dialogs
Files:
src/main/lib/textsplitters/document/index.tssrc/main/lib/textsplitters/index.tssrc/main/presenter/configPresenter/mcpConfHelper.tssrc/main/presenter/mcpPresenter/inMemoryServers/builder.tssrc/main/utils/strings.tssrc/main/presenter/llmProviderPresenter/providers/geminiProvider.tssrc/main/presenter/trayPresenter.tssrc/main/presenter/index.tssrc/main/presenter/llmProviderPresenter/baseProvider.tssrc/main/presenter/filePresenter/BaseFileAdapter.tssrc/main/presenter/configPresenter/index.tssrc/main/presenter/llmProviderPresenter/index.tssrc/main/presenter/filePresenter/FilePresenter.tssrc/main/events.tssrc/main/presenter/configPresenter/knowledgeConfHelper.tssrc/main/lib/textsplitters/document/document.tssrc/main/presenter/configPresenter/modelDefaultSettings.tssrc/main/utils/vector.tssrc/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.tssrc/main/presenter/dialogPresenter/index.tssrc/main/presenter/llmProviderPresenter/providers/ollamaProvider.tssrc/main/presenter/knowledgePresenter/knowledgeTaskPresenter.tssrc/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/knowledgePresenter/index.tssrc/main/lib/textsplitters/text_splitter.tssrc/main/presenter/knowledgePresenter/knowledgeStorePresenter.tssrc/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/development-setup.mdc)
**/*.{js,jsx,ts,tsx}: 使用 OxLint 进行代码检查
Log和注释使用英文书写
Files:
src/main/lib/textsplitters/document/index.tssrc/main/lib/textsplitters/index.tssrc/main/presenter/configPresenter/mcpConfHelper.tssrc/main/presenter/mcpPresenter/inMemoryServers/builder.tssrc/main/utils/strings.tsscripts/installVss.jssrc/renderer/src/lib/utils.tssrc/main/presenter/llmProviderPresenter/providers/geminiProvider.tssrc/main/presenter/trayPresenter.tssrc/renderer/src/events.tssrc/main/presenter/index.tssrc/main/presenter/llmProviderPresenter/baseProvider.tssrc/main/presenter/filePresenter/BaseFileAdapter.tssrc/main/presenter/configPresenter/index.tssrc/renderer/src/stores/settings.tssrc/main/presenter/llmProviderPresenter/index.tssrc/main/presenter/filePresenter/FilePresenter.tssrc/shared/dialog.tssrc/main/events.tssrc/renderer/src/stores/dialog.tssrc/main/presenter/configPresenter/knowledgeConfHelper.tssrc/main/lib/textsplitters/document/document.tssrc/main/presenter/configPresenter/modelDefaultSettings.tssrc/main/utils/vector.tssrc/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.tssrc/main/presenter/dialogPresenter/index.tssrc/main/presenter/llmProviderPresenter/providers/ollamaProvider.tssrc/main/presenter/knowledgePresenter/knowledgeTaskPresenter.tssrc/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/knowledgePresenter/index.tssrc/shared/presenter.d.tssrc/main/lib/textsplitters/text_splitter.tssrc/main/presenter/knowledgePresenter/knowledgeStorePresenter.tssrc/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts
src/{main,renderer}/**/*.ts
📄 CodeRabbit Inference Engine (.cursor/rules/electron-best-practices.mdc)
src/{main,renderer}/**/*.ts: Use context isolation for improved security
Implement proper inter-process communication (IPC) patterns
Optimize application startup time with lazy loading
Implement proper error handling and logging for debugging
Files:
src/main/lib/textsplitters/document/index.tssrc/main/lib/textsplitters/index.tssrc/main/presenter/configPresenter/mcpConfHelper.tssrc/main/presenter/mcpPresenter/inMemoryServers/builder.tssrc/main/utils/strings.tssrc/renderer/src/lib/utils.tssrc/main/presenter/llmProviderPresenter/providers/geminiProvider.tssrc/main/presenter/trayPresenter.tssrc/renderer/src/events.tssrc/main/presenter/index.tssrc/main/presenter/llmProviderPresenter/baseProvider.tssrc/main/presenter/filePresenter/BaseFileAdapter.tssrc/main/presenter/configPresenter/index.tssrc/renderer/src/stores/settings.tssrc/main/presenter/llmProviderPresenter/index.tssrc/main/presenter/filePresenter/FilePresenter.tssrc/main/events.tssrc/renderer/src/stores/dialog.tssrc/main/presenter/configPresenter/knowledgeConfHelper.tssrc/main/lib/textsplitters/document/document.tssrc/main/presenter/configPresenter/modelDefaultSettings.tssrc/main/utils/vector.tssrc/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.tssrc/main/presenter/dialogPresenter/index.tssrc/main/presenter/llmProviderPresenter/providers/ollamaProvider.tssrc/main/presenter/knowledgePresenter/knowledgeTaskPresenter.tssrc/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/knowledgePresenter/index.tssrc/main/lib/textsplitters/text_splitter.tssrc/main/presenter/knowledgePresenter/knowledgeStorePresenter.tssrc/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts
src/main/**/*.{ts,js,tsx,jsx}
📄 CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)
主进程代码放在
src/main
Files:
src/main/lib/textsplitters/document/index.tssrc/main/lib/textsplitters/index.tssrc/main/presenter/configPresenter/mcpConfHelper.tssrc/main/presenter/mcpPresenter/inMemoryServers/builder.tssrc/main/utils/strings.tssrc/main/presenter/llmProviderPresenter/providers/geminiProvider.tssrc/main/presenter/trayPresenter.tssrc/main/presenter/index.tssrc/main/presenter/llmProviderPresenter/baseProvider.tssrc/main/presenter/filePresenter/BaseFileAdapter.tssrc/main/presenter/configPresenter/index.tssrc/main/presenter/llmProviderPresenter/index.tssrc/main/presenter/filePresenter/FilePresenter.tssrc/main/events.tssrc/main/presenter/configPresenter/knowledgeConfHelper.tssrc/main/lib/textsplitters/document/document.tssrc/main/presenter/configPresenter/modelDefaultSettings.tssrc/main/utils/vector.tssrc/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.tssrc/main/presenter/dialogPresenter/index.tssrc/main/presenter/llmProviderPresenter/providers/ollamaProvider.tssrc/main/presenter/knowledgePresenter/knowledgeTaskPresenter.tssrc/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/knowledgePresenter/index.tssrc/main/lib/textsplitters/text_splitter.tssrc/main/presenter/knowledgePresenter/knowledgeStorePresenter.tssrc/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts
src/renderer/src/**/*.vue
📄 CodeRabbit Inference Engine (CLAUDE.md)
src/renderer/src/**/*.vue: Use Composition API for all Vue 3 components
Use Tailwind CSS with scoped styles for styling
Organize components by feature in src/renderer/src/
Follow existing component patterns in src/renderer/src/ when creating new UI components
Use Composition API with proper TypeScript typing for new UI components
Implement responsive design with Tailwind CSS for new UI components
Add proper error handling and loading states for new UI componentsUse scoped styles to prevent CSS conflicts between components
Files:
src/renderer/src/components/ModelSelect.vuesrc/renderer/src/App.vuesrc/renderer/src/components/settings/ModelConfigItem.vuesrc/renderer/src/components/settings/FastGptKnowledgeSettings.vuesrc/renderer/src/components/FileItem.vuesrc/renderer/src/components/settings/DifyKnowledgeSettings.vuesrc/renderer/src/components/settings/RagflowKnowledgeSettings.vuesrc/renderer/src/components/mcp-config/components/McpServers.vuesrc/renderer/src/components/ui/MessageDialog.vuesrc/renderer/src/components/settings/KnowledgeFileItem.vuesrc/renderer/src/components/settings/KnowledgeFile.vuesrc/renderer/src/components/settings/BuiltinKnowledgeSettings.vuesrc/renderer/src/components/settings/OllamaProviderSettingsDetail.vuesrc/renderer/src/components/settings/KnowledgeBaseSettings.vue
src/renderer/src/**/*.{ts,tsx,vue}
📄 CodeRabbit Inference Engine (CLAUDE.md)
src/renderer/src/**/*.{ts,tsx,vue}: Use Pinia for frontend state management
Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Files:
src/renderer/src/components/ModelSelect.vuesrc/renderer/src/App.vuesrc/renderer/src/components/settings/ModelConfigItem.vuesrc/renderer/src/components/settings/FastGptKnowledgeSettings.vuesrc/renderer/src/components/FileItem.vuesrc/renderer/src/components/settings/DifyKnowledgeSettings.vuesrc/renderer/src/lib/utils.tssrc/renderer/src/components/settings/RagflowKnowledgeSettings.vuesrc/renderer/src/events.tssrc/renderer/src/components/mcp-config/components/McpServers.vuesrc/renderer/src/components/ui/MessageDialog.vuesrc/renderer/src/components/settings/KnowledgeFileItem.vuesrc/renderer/src/stores/settings.tssrc/renderer/src/stores/dialog.tssrc/renderer/src/components/settings/KnowledgeFile.vuesrc/renderer/src/components/settings/BuiltinKnowledgeSettings.vuesrc/renderer/src/components/settings/OllamaProviderSettingsDetail.vuesrc/renderer/src/components/settings/KnowledgeBaseSettings.vue
src/renderer/src/**/*
📄 CodeRabbit Inference Engine (.cursor/rules/i18n.mdc)
src/renderer/src/**/*: All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Use the 'vue-i18n' framework for all internationalization in the renderer
Ensure all user-visible text in the renderer uses the translation system
Files:
src/renderer/src/components/ModelSelect.vuesrc/renderer/src/i18n/fr-FR/mcp.jsonsrc/renderer/src/App.vuesrc/renderer/src/i18n/fa-IR/mcp.jsonsrc/renderer/src/components/settings/ModelConfigItem.vuesrc/renderer/src/components/settings/FastGptKnowledgeSettings.vuesrc/renderer/src/i18n/ja-JP/mcp.jsonsrc/renderer/src/i18n/zh-CN/mcp.jsonsrc/renderer/src/components/FileItem.vuesrc/renderer/src/i18n/en-US/mcp.jsonsrc/renderer/src/i18n/ko-KR/mcp.jsonsrc/renderer/src/i18n/ru-RU/mcp.jsonsrc/renderer/src/components/settings/DifyKnowledgeSettings.vuesrc/renderer/src/i18n/zh-TW/mcp.jsonsrc/renderer/src/lib/utils.tssrc/renderer/src/i18n/zh-HK/mcp.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/components/settings/RagflowKnowledgeSettings.vuesrc/renderer/src/events.tssrc/renderer/src/components/mcp-config/components/McpServers.vuesrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/renderer/src/components/ui/MessageDialog.vuesrc/renderer/src/components/settings/KnowledgeFileItem.vuesrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/stores/settings.tssrc/renderer/src/stores/dialog.tssrc/renderer/src/components/settings/KnowledgeFile.vuesrc/renderer/src/components/settings/BuiltinKnowledgeSettings.vuesrc/renderer/src/components/settings/OllamaProviderSettingsDetail.vuesrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/components/settings/KnowledgeBaseSettings.vuesrc/renderer/src/i18n/fa-IR/settings.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.jsonsrc/renderer/src/i18n/ja-JP/settings.json
src/renderer/**/*.{vue,ts,js,tsx,jsx}
📄 CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)
渲染进程代码放在
src/renderer
Files:
src/renderer/src/components/ModelSelect.vuesrc/renderer/src/App.vuesrc/renderer/src/components/settings/ModelConfigItem.vuesrc/renderer/src/components/settings/FastGptKnowledgeSettings.vuesrc/renderer/src/components/FileItem.vuesrc/renderer/src/components/settings/DifyKnowledgeSettings.vuesrc/renderer/src/lib/utils.tssrc/renderer/src/components/settings/RagflowKnowledgeSettings.vuesrc/renderer/src/events.tssrc/renderer/src/components/mcp-config/components/McpServers.vuesrc/renderer/src/components/ui/MessageDialog.vuesrc/renderer/src/components/settings/KnowledgeFileItem.vuesrc/renderer/src/stores/settings.tssrc/renderer/src/stores/dialog.tssrc/renderer/src/components/settings/KnowledgeFile.vuesrc/renderer/src/components/settings/BuiltinKnowledgeSettings.vuesrc/renderer/src/components/settings/OllamaProviderSettingsDetail.vuesrc/renderer/src/components/settings/KnowledgeBaseSettings.vue
src/renderer/src/**/*.{vue,ts,tsx,js,jsx}
📄 CodeRabbit Inference Engine (.cursor/rules/vue-best-practices.mdc)
src/renderer/src/**/*.{vue,ts,tsx,js,jsx}: Use the Composition API for better code organization and reusability
Implement proper state management with Pinia
Utilize Vue Router for navigation and route management
Leverage Vue's built-in reactivity system for efficient data handling
Files:
src/renderer/src/components/ModelSelect.vuesrc/renderer/src/App.vuesrc/renderer/src/components/settings/ModelConfigItem.vuesrc/renderer/src/components/settings/FastGptKnowledgeSettings.vuesrc/renderer/src/components/FileItem.vuesrc/renderer/src/components/settings/DifyKnowledgeSettings.vuesrc/renderer/src/lib/utils.tssrc/renderer/src/components/settings/RagflowKnowledgeSettings.vuesrc/renderer/src/events.tssrc/renderer/src/components/mcp-config/components/McpServers.vuesrc/renderer/src/components/ui/MessageDialog.vuesrc/renderer/src/components/settings/KnowledgeFileItem.vuesrc/renderer/src/stores/settings.tssrc/renderer/src/stores/dialog.tssrc/renderer/src/components/settings/KnowledgeFile.vuesrc/renderer/src/components/settings/BuiltinKnowledgeSettings.vuesrc/renderer/src/components/settings/OllamaProviderSettingsDetail.vuesrc/renderer/src/components/settings/KnowledgeBaseSettings.vue
src/renderer/**/*.{ts,tsx,vue}
📄 CodeRabbit Inference Engine (.cursor/rules/vue-shadcn.mdc)
src/renderer/**/*.{ts,tsx,vue}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
Use TypeScript for all code; prefer types over interfaces.
Avoid enums; use const objects instead.
Use arrow functions for methods and computed properties.
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
Files:
src/renderer/src/components/ModelSelect.vuesrc/renderer/src/App.vuesrc/renderer/src/components/settings/ModelConfigItem.vuesrc/renderer/src/components/settings/FastGptKnowledgeSettings.vuesrc/renderer/src/components/FileItem.vuesrc/renderer/src/components/settings/DifyKnowledgeSettings.vuesrc/renderer/src/lib/utils.tssrc/renderer/src/components/settings/RagflowKnowledgeSettings.vuesrc/renderer/src/events.tssrc/renderer/src/components/mcp-config/components/McpServers.vuesrc/renderer/src/components/ui/MessageDialog.vuesrc/renderer/src/components/settings/KnowledgeFileItem.vuesrc/renderer/src/stores/settings.tssrc/renderer/src/stores/dialog.tssrc/renderer/src/components/settings/KnowledgeFile.vuesrc/renderer/src/components/settings/BuiltinKnowledgeSettings.vuesrc/renderer/src/components/settings/OllamaProviderSettingsDetail.vuesrc/renderer/src/components/settings/KnowledgeBaseSettings.vue
src/renderer/**/*.{vue,ts}
📄 CodeRabbit Inference Engine (.cursor/rules/vue-shadcn.mdc)
Implement lazy loading for routes and components.
Files:
src/renderer/src/components/ModelSelect.vuesrc/renderer/src/App.vuesrc/renderer/src/components/settings/ModelConfigItem.vuesrc/renderer/src/components/settings/FastGptKnowledgeSettings.vuesrc/renderer/src/components/FileItem.vuesrc/renderer/src/components/settings/DifyKnowledgeSettings.vuesrc/renderer/src/lib/utils.tssrc/renderer/src/components/settings/RagflowKnowledgeSettings.vuesrc/renderer/src/events.tssrc/renderer/src/components/mcp-config/components/McpServers.vuesrc/renderer/src/components/ui/MessageDialog.vuesrc/renderer/src/components/settings/KnowledgeFileItem.vuesrc/renderer/src/stores/settings.tssrc/renderer/src/stores/dialog.tssrc/renderer/src/components/settings/KnowledgeFile.vuesrc/renderer/src/components/settings/BuiltinKnowledgeSettings.vuesrc/renderer/src/components/settings/OllamaProviderSettingsDetail.vuesrc/renderer/src/components/settings/KnowledgeBaseSettings.vue
src/renderer/**/*.{ts,vue}
📄 CodeRabbit Inference Engine (.cursor/rules/vue-shadcn.mdc)
src/renderer/**/*.{ts,vue}: Use useFetch and useAsyncData for data fetching.
Implement SEO best practices using Nuxt's useHead and useSeoMeta.
Files:
src/renderer/src/components/ModelSelect.vuesrc/renderer/src/App.vuesrc/renderer/src/components/settings/ModelConfigItem.vuesrc/renderer/src/components/settings/FastGptKnowledgeSettings.vuesrc/renderer/src/components/FileItem.vuesrc/renderer/src/components/settings/DifyKnowledgeSettings.vuesrc/renderer/src/lib/utils.tssrc/renderer/src/components/settings/RagflowKnowledgeSettings.vuesrc/renderer/src/events.tssrc/renderer/src/components/mcp-config/components/McpServers.vuesrc/renderer/src/components/ui/MessageDialog.vuesrc/renderer/src/components/settings/KnowledgeFileItem.vuesrc/renderer/src/stores/settings.tssrc/renderer/src/stores/dialog.tssrc/renderer/src/components/settings/KnowledgeFile.vuesrc/renderer/src/components/settings/BuiltinKnowledgeSettings.vuesrc/renderer/src/components/settings/OllamaProviderSettingsDetail.vuesrc/renderer/src/components/settings/KnowledgeBaseSettings.vue
src/main/presenter/**/*.ts
📄 CodeRabbit Inference Engine (CLAUDE.md)
One presenter per functional domain
Files:
src/main/presenter/configPresenter/mcpConfHelper.tssrc/main/presenter/mcpPresenter/inMemoryServers/builder.tssrc/main/presenter/llmProviderPresenter/providers/geminiProvider.tssrc/main/presenter/trayPresenter.tssrc/main/presenter/index.tssrc/main/presenter/llmProviderPresenter/baseProvider.tssrc/main/presenter/filePresenter/BaseFileAdapter.tssrc/main/presenter/configPresenter/index.tssrc/main/presenter/llmProviderPresenter/index.tssrc/main/presenter/filePresenter/FilePresenter.tssrc/main/presenter/configPresenter/knowledgeConfHelper.tssrc/main/presenter/configPresenter/modelDefaultSettings.tssrc/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.tssrc/main/presenter/dialogPresenter/index.tssrc/main/presenter/llmProviderPresenter/providers/ollamaProvider.tssrc/main/presenter/knowledgePresenter/knowledgeTaskPresenter.tssrc/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/knowledgePresenter/index.tssrc/main/presenter/knowledgePresenter/knowledgeStorePresenter.tssrc/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts
src/main/presenter/configPresenter/**/*.ts
📄 CodeRabbit Inference Engine (CLAUDE.md)
Centralize configuration in configPresenter/
Files:
src/main/presenter/configPresenter/mcpConfHelper.tssrc/main/presenter/configPresenter/index.tssrc/main/presenter/configPresenter/knowledgeConfHelper.tssrc/main/presenter/configPresenter/modelDefaultSettings.ts
src/main/presenter/mcpPresenter/inMemoryServers/*.ts
📄 CodeRabbit Inference Engine (CLAUDE.md)
Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Files:
src/main/presenter/mcpPresenter/inMemoryServers/builder.tssrc/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.ts
src/main/presenter/llmProviderPresenter/providers/*.ts
📄 CodeRabbit Inference Engine (CLAUDE.md)
src/main/presenter/llmProviderPresenter/providers/*.ts: Create provider file in src/main/presenter/llmProviderPresenter/providers/ when adding a new LLM provider
Implement coreStream method following standardized event interface in LLM provider files
src/main/presenter/llmProviderPresenter/providers/*.ts: Each file insrc/main/presenter/llmProviderPresenter/providers/*.tsshould handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Provider implementations must use acoreStreammethod that yields standardized stream events to decouple the main loop from provider-specific details.
ThecoreStreammethod in each Provider must perform a single streaming API request per conversation round and must not contain multi-round tool call loop logic.
Provider files should implement helper methods such asformatMessages,convertToProviderTools,parseFunctionCalls, andprepareFunctionCallPromptas needed for provider-specific logic.
All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
When a provider does not support native function calling, it must prepare messages using prompt wrapping (e.g.,prepareFunctionCallPrompt) before making the API call.
When a provider supports native function calling, MCP tools must be converted to the provider's format (e.g., usingconvertToProviderTools) and included in the API request.
Provider implementations should aggregate and yield usage events as part of the standardized stream.
Provider implementations should yield image data events in the standardized format when applicable.
Provider implementations should yield reasoning events in the standardized format when applicable.
Provider implementations should yield tool call events (`tool_call_star...
Files:
src/main/presenter/llmProviderPresenter/providers/geminiProvider.tssrc/main/presenter/llmProviderPresenter/providers/ollamaProvider.tssrc/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts
src/main/presenter/index.ts
📄 CodeRabbit Inference Engine (.cursor/rules/electron-best-practices.mdc)
The IPC messages from the main process to notify the view mainly rely on the EventBus index.ts to listen for events that need to be notified and then send them to the renderer through the mainWindow
Files:
src/main/presenter/index.ts
src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx}
📄 CodeRabbit Inference Engine (.cursor/rules/pinia-best-practices.mdc)
src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx}: Use modules to organize related state and actions
Implement proper state persistence for maintaining data across sessions
Use getters for computed state properties
Utilize actions for side effects and asynchronous operations
Keep the store focused on global state, not component-specific data
Files:
src/renderer/src/stores/settings.tssrc/renderer/src/stores/dialog.ts
src/main/presenter/llmProviderPresenter/index.ts
📄 CodeRabbit Inference Engine (.cursor/rules/llm-agent-loop.mdc)
src/main/presenter/llmProviderPresenter/index.ts:src/main/presenter/llmProviderPresenter/index.tsshould manage the overall Agent loop, conversation history, tool execution viaMcpPresenter, and frontend communication viaeventBus.
The main Agent loop inllmProviderPresenter/index.tsshould handle multi-round LLM calls and tool usage, maintaining conversation state and controlling the loop withneedContinueConversationandtoolCallCount.
The main Agent loop should send standardizedSTREAM_EVENTS(RESPONSE,END,ERROR) to the frontend viaeventBus.
The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Files:
src/main/presenter/llmProviderPresenter/index.ts
src/shared/**/*.ts
📄 CodeRabbit Inference Engine (CLAUDE.md)
Shared types in src/shared/
Files:
src/shared/dialog.tssrc/shared/presenter.d.ts
src/shared/**/*.{ts,tsx,d.ts}
📄 CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)
共享类型定义放在
shared目录
Files:
src/shared/dialog.tssrc/shared/presenter.d.ts
src/shared/*.d.ts
📄 CodeRabbit Inference Engine (.cursor/rules/electron-best-practices.mdc)
The shared/*.d.ts files are used to define the types of objects exposed by the main process to the renderer process
Files:
src/shared/presenter.d.ts
🧠 Learnings (69)
src/main/lib/textsplitters/document/index.ts (8)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-21T01:47:11.596Z
Learning: Applies to src/shared/**/*.{ts,tsx,d.ts} : 共享类型定义放在 shared 目录
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/shared/**/*.ts : Shared types in src/shared/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/shared/.d.ts : The shared/.d.ts files are used to define the types of objects exposed by the main process to the renderer process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Use context isolation for improved security
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Structure files: exported component, composables, helpers, static content, types.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/development-setup.mdc:0-0
Timestamp: 2025-07-21T01:45:40.026Z
Learning: Node.js >= 22
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.467Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Use modules to organize related state and actions
src/renderer/src/components/ModelSelect.vue (6)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use provide/inject for dependency injection when appropriate.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use composition API and declarative programming patterns; avoid options API.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Leverage ref, reactive, and computed for reactive state management.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{ts,tsx,vue} : Use arrow functions for methods and computed properties.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use template syntax for declarative rendering.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.467Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Keep the store focused on global state, not component-specific data
src/renderer/src/i18n/fr-FR/mcp.json (4)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
src/renderer/src/App.vue (16)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use <script setup> syntax for concise component definitions.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Add proper error handling and loading states for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Import Icon component from Iconify/Vue.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Follow existing component patterns in src/renderer/src/ when creating new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Use Composition API with proper TypeScript typing for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Use the Composition API for better code organization and reusability
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use template syntax for declarative rendering.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : Use the 'vue-i18n' framework for all internationalization in the renderer
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Iconify/Vue for icon implementation.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use the Icon component with lucide icons.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Utilize Vue Router for navigation and route management
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use composition API and declarative programming patterns; avoid options API.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.{ts,tsx} : 提供用户友好的错误信息
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.tsx : 使用错误边界捕获渲染错误
src/main/lib/textsplitters/index.ts (8)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-21T01:47:11.596Z
Learning: Applies to src/shared/**/*.{ts,tsx,d.ts} : 共享类型定义放在 shared 目录
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/shared/**/*.ts : Shared types in src/shared/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Use context isolation for improved security
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/shared/.d.ts : The shared/.d.ts files are used to define the types of objects exposed by the main process to the renderer process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.467Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Use modules to organize related state and actions
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/preload/**/*.ts : Context isolation enabled with preload scripts for security
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-21T01:47:11.596Z
Learning: Applies to src/renderer/**/*.{vue,ts,js,tsx,jsx} : 渲染进程代码放在 src/renderer
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/development-setup.mdc:0-0
Timestamp: 2025-07-21T01:45:40.026Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Log和注释使用英文书写
src/renderer/src/components/settings/ModelConfigItem.vue (14)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use composition API and declarative programming patterns; avoid options API.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Leverage Vue's built-in reactivity system for efficient data handling
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Use Composition API with proper TypeScript typing for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Use the Composition API for better code organization and reusability
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use <script setup> syntax for concise component definitions.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Vue 3 with TypeScript, leveraging defineComponent and PropType.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Leverage ref, reactive, and computed for reactive state management.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Add proper error handling and loading states for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use template syntax for declarative rendering.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Iconify/Vue for icon implementation.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use the Icon component with lucide icons.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Prefer "lucide:" icon family as the primary choice.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : For cases where lucide icons don't meet requirements, use other Iconify collections as fallback.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Import Icon component from Iconify/Vue.
src/main/presenter/configPresenter/mcpConfHelper.ts (6)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: neoragex2002
PR: #550
File: src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts:250-252
Timestamp: 2025-06-21T15:48:29.950Z
Learning: In the meeting server implementation (src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts), when multiple tabs have the same title, the user prefers to let the code silently select the first match without adding warnings or additional ambiguity handling.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
src/renderer/src/components/settings/FastGptKnowledgeSettings.vue (7)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : Ensure all user-visible text in the renderer uses the translation system
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use <script setup> syntax for concise component definitions.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : Use the 'vue-i18n' framework for all internationalization in the renderer
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.467Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Use modules to organize related state and actions
src/renderer/src/i18n/ja-JP/mcp.json (2)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
src/renderer/src/i18n/zh-CN/mcp.json (4)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
src/main/presenter/mcpPresenter/inMemoryServers/builder.ts (4)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: neoragex2002
PR: #550
File: src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts:250-252
Timestamp: 2025-06-21T15:48:29.950Z
Learning: In the meeting server implementation (src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts), when multiple tabs have the same title, the user prefers to let the code silently select the first match without adding warnings or additional ambiguity handling.
src/renderer/src/components/FileItem.vue (16)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Iconify/Vue for icon implementation.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use the Icon component with lucide icons.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Import Icon component from Iconify/Vue.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Prefer "lucide:" icon family as the primary choice.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : For cases where lucide icons don't meet requirements, use other Iconify collections as fallback.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Follow naming pattern: {collection}:{icon-name} for icons.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Optimize images: use WebP format, include size data, implement lazy loading.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{ts,tsx,vue} : Use arrow functions for methods and computed properties.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Use the Composition API for better code organization and reusability
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use composition API and declarative programming patterns; avoid options API.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Vue 3 with TypeScript, leveraging defineComponent and PropType.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Use Composition API with proper TypeScript typing for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use <script setup> syntax for concise component definitions.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/{composables,utils}/**/*.ts : Use VueUse for common composables and utility functions.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.{ts,tsx} : 提供用户友好的错误信息
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.{ts,tsx} : 提供有意义的错误信息
src/renderer/src/i18n/en-US/mcp.json (4)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
src/main/utils/strings.ts (1)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Use context isolation for improved security
src/renderer/src/i18n/ko-KR/mcp.json (1)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
src/renderer/src/i18n/ru-RU/mcp.json (5)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
scripts/installVss.js (1)
Learnt from: hllshiro
PR: #597
File: scripts/postinstall.js:10-41
Timestamp: 2025-07-15T10:15:20.447Z
Learning: DuckDB (@duckdb/node-api) automatically releases libraries and connections that are no longer referenced, so explicit connection cleanup in finally blocks is not necessary for DuckDB connections.
src/renderer/src/components/settings/DifyKnowledgeSettings.vue (4)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use <script setup> syntax for concise component definitions.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.467Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Use modules to organize related state and actions
src/renderer/src/i18n/zh-TW/mcp.json (6)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider supports native function calling, MCP tools must be converted to the provider's format (e.g., using convertToProviderTools) and included in the API request.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
src/renderer/src/lib/utils.ts (15)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Prefer "lucide:" icon family as the primary choice.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Iconify/Vue for icon implementation.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : For cases where lucide icons don't meet requirements, use other Iconify collections as fallback.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use the Icon component with lucide icons.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Follow naming pattern: {collection}:{icon-name} for icons.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Import Icon component from Iconify/Vue.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/{composables,utils}/**/*.ts : Use VueUse for common composables and utility functions.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{ts,tsx,vue} : Avoid enums; use const objects instead.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Use Composition API with proper TypeScript typing for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.{ts,tsx} : 优雅降级处理
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.{ts,tsx} : 提供用户友好的错误信息
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.{ts,tsx} : 提供有意义的错误信息
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.{ts,tsx} : 避免记录敏感信息
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-21T01:47:11.596Z
Learning: Applies to src/shared/**/*.{ts,tsx,d.ts} : 共享类型定义放在 shared 目录
src/renderer/src/i18n/zh-HK/mcp.json (3)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts (10)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield text events in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield image data events in the standardized format when applicable.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield events asynchronously using the async generator pattern.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider supports native function calling, MCP tools must be converted to the provider's format (e.g., using convertToProviderTools) and included in the API request.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield tool call events (tool_call_start, tool_call_chunk, tool_call_end) in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider does not support native function calling, it must prepare messages using prompt wrapping (e.g., prepareFunctionCallPrompt) before making the API call.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
src/main/presenter/trayPresenter.ts (10)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield stop events with appropriate stop_reason in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/renderer/src/composables/usePresenter.ts : The IPC in the renderer process is implemented in usePresenter.ts, allowing direct calls to the presenter-related interfaces exposed by the main process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop in llmProviderPresenter/index.ts should handle multi-round LLM calls and tool usage, maintaining conversation state and controlling the loop with needContinueConversation and toolCallCount.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider does not support native function calling, it must prepare messages using prompt wrapping (e.g., prepareFunctionCallPrompt) before making the API call.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
src/renderer/src/i18n/zh-HK/settings.json (8)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Regularly check for unused translation keys in i18n files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Each language must have a separate JSON file in 'src/renderer/src/i18n/'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Language files must be located in 'src/renderer/src/i18n/' directory
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : Ensure all user-visible text in the renderer uses the translation system
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
src/renderer/src/components/settings/RagflowKnowledgeSettings.vue (8)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : Ensure all user-visible text in the renderer uses the translation system
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : Use the 'vue-i18n' framework for all internationalization in the renderer
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.467Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Use modules to organize related state and actions
src/renderer/src/events.ts (7)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/shared/.d.ts : The shared/.d.ts files are used to define the types of objects exposed by the main process to the renderer process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/**/*.ts : Main to Renderer: Use EventBus to broadcast events via mainWindow.webContents.send()
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Implement proper inter-process communication (IPC) patterns
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/presenter/index.ts : The IPC messages from the main process to notify the view mainly rely on the EventBus index.ts to listen for events that need to be notified and then send them to the renderer through the mainWindow
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/streamEvents.ts : Standardized stream events should conform to the LLMCoreStreamEvent interface, ideally defined in a shared file such as src/main/presenter/llmProviderPresenter/streamEvents.ts.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should send standardized STREAM_EVENTS (RESPONSE, END, ERROR) to the frontend via eventBus.
src/renderer/src/components/mcp-config/components/McpServers.vue (2)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: neoragex2002
PR: #550
File: src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts:250-252
Timestamp: 2025-06-21T15:48:29.950Z
Learning: In the meeting server implementation (src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts), when multiple tabs have the same title, the user prefers to let the code silently select the first match without adding warnings or additional ambiguity handling.
src/renderer/src/i18n/zh-CN/settings.json (9)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Regularly check for unused translation keys in i18n files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Each language must have a separate JSON file in 'src/renderer/src/i18n/'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Language files must be located in 'src/renderer/src/i18n/' directory
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : Ensure all user-visible text in the renderer uses the translation system
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Translation key naming must use dot-separated hierarchy, lowercase letters, and meaningful descriptive names (e.g., 'common.button.submit')
src/renderer/src/i18n/zh-TW/settings.json (9)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Regularly check for unused translation keys in i18n files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Each language must have a separate JSON file in 'src/renderer/src/i18n/'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Language files must be located in 'src/renderer/src/i18n/' directory
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : Ensure all user-visible text in the renderer uses the translation system
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Translation key naming must use dot-separated hierarchy, lowercase letters, and meaningful descriptive names (e.g., 'common.button.submit')
src/renderer/src/components/ui/MessageDialog.vue (10)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Add proper error handling and loading states for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Iconify/Vue for icon implementation.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Follow existing component patterns in src/renderer/src/ when creating new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Use Composition API with proper TypeScript typing for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Import Icon component from Iconify/Vue.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use the Icon component with lucide icons.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Use the Composition API for better code organization and reusability
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Suspense for asynchronous components.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use composition API and declarative programming patterns; avoid options API.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : Use the 'vue-i18n' framework for all internationalization in the renderer
src/main/presenter/index.ts (18)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/renderer/src/composables/usePresenter.ts : The IPC in the renderer process is implemented in usePresenter.ts, allowing direct calls to the presenter-related interfaces exposed by the main process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop in llmProviderPresenter/index.ts should handle multi-round LLM calls and tool usage, maintaining conversation state and controlling the loop with needContinueConversation and toolCallCount.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Create provider file in src/main/presenter/llmProviderPresenter/providers/ when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/presenter/index.ts : The IPC messages from the main process to notify the view mainly rely on the EventBus index.ts to listen for events that need to be notified and then send them to the renderer through the mainWindow
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/**/*.ts : Main to Renderer: Use EventBus to broadcast events via mainWindow.webContents.send()
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Implement proper inter-process communication (IPC) patterns
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should send standardized STREAM_EVENTS (RESPONSE, END, ERROR) to the frontend via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
src/renderer/src/components/settings/KnowledgeFileItem.vue (10)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Iconify/Vue for icon implementation.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Add proper error handling and loading states for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use the Icon component with lucide icons.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Import Icon component from Iconify/Vue.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Follow existing component patterns in src/renderer/src/ when creating new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Follow naming pattern: {collection}:{icon-name} for icons.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Use Composition API with proper TypeScript typing for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Use the Composition API for better code organization and reusability
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Prefer "lucide:" icon family as the primary choice.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Organize components by feature in src/renderer/src/
src/main/presenter/llmProviderPresenter/baseProvider.ts (16)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield text events in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield image data events in the standardized format when applicable.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield error events in the standardized format when errors occur.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider supports native function calling, MCP tools must be converted to the provider's format (e.g., using convertToProviderTools) and included in the API request.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield events asynchronously using the async generator pattern.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield tool call events (tool_call_start, tool_call_chunk, tool_call_end) in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/streamEvents.ts : Standardized stream events should conform to the LLMCoreStreamEvent interface, ideally defined in a shared file such as src/main/presenter/llmProviderPresenter/streamEvents.ts.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Implement coreStream method following standardized event interface in LLM provider files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should send standardized STREAM_EVENTS (RESPONSE, END, ERROR) to the frontend via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations must use a coreStream method that yields standardized stream events to decouple the main loop from provider-specific details.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
src/main/presenter/filePresenter/BaseFileAdapter.ts (1)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield image data events in the standardized format when applicable.
src/main/presenter/configPresenter/index.ts (10)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/renderer/src/composables/usePresenter.ts : The IPC in the renderer process is implemented in usePresenter.ts, allowing direct calls to the presenter-related interfaces exposed by the main process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-21T01:47:11.596Z
Learning: Applies to src/shared/**/*.{ts,tsx,d.ts} : 共享类型定义放在 shared 目录
src/renderer/src/i18n/ru-RU/settings.json (9)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Regularly check for unused translation keys in i18n files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Language files must be located in 'src/renderer/src/i18n/' directory
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Each language must have a separate JSON file in 'src/renderer/src/i18n/'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : Ensure all user-visible text in the renderer uses the translation system
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Translation key naming must use dot-separated hierarchy, lowercase letters, and meaningful descriptive names (e.g., 'common.button.submit')
src/renderer/src/stores/settings.ts (3)
Learnt from: neoragex2002
PR: #550
File: src/renderer/src/stores/chat.ts:1011-1035
Timestamp: 2025-06-21T15:49:17.044Z
Learning: In src/renderer/src/stores/chat.ts, the user prefers to keep both text and content properties in the handleMeetingInstruction function's sendMessage call, even though they are redundant, rather than removing the content property.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.467Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Implement proper state persistence for maintaining data across sessions
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.467Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Keep the store focused on global state, not component-specific data
package.json (2)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/development-setup.mdc:0-0
Timestamp: 2025-07-21T01:45:40.026Z
Learning: Node.js >= 22
Learnt from: hllshiro
PR: #597
File: scripts/postinstall.js:10-41
Timestamp: 2025-07-15T10:15:20.447Z
Learning: DuckDB (@duckdb/node-api) automatically releases libraries and connections that are no longer referenced, so explicit connection cleanup in finally blocks is not necessary for DuckDB connections.
src/main/presenter/llmProviderPresenter/index.ts (15)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield text events in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield error events in the standardized format when errors occur.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield image data events in the standardized format when applicable.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield events asynchronously using the async generator pattern.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Implement coreStream method following standardized event interface in LLM provider files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield tool call events (tool_call_start, tool_call_chunk, tool_call_end) in the standardized format.
Learnt from: neoragex2002
PR: #550
File: src/renderer/src/stores/chat.ts:1011-1035
Timestamp: 2025-06-21T15:49:17.044Z
Learning: In src/renderer/src/stores/chat.ts, the user prefers to keep both text and content properties in the handleMeetingInstruction function's sendMessage call, even though they are redundant, rather than removing the content property.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop in llmProviderPresenter/index.ts should handle multi-round LLM calls and tool usage, maintaining conversation state and controlling the loop with needContinueConversation and toolCallCount.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/streamEvents.ts : Standardized stream events should conform to the LLMCoreStreamEvent interface, ideally defined in a shared file such as src/main/presenter/llmProviderPresenter/streamEvents.ts.
src/main/presenter/filePresenter/FilePresenter.ts (10)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Implement coreStream method following standardized event interface in LLM provider files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider does not support native function calling, it must prepare messages using prompt wrapping (e.g., prepareFunctionCallPrompt) before making the API call.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield image data events in the standardized format when applicable.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Create provider file in src/main/presenter/llmProviderPresenter/providers/ when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/streamEvents.ts : Standardized stream events should conform to the LLMCoreStreamEvent interface, ideally defined in a shared file such as src/main/presenter/llmProviderPresenter/streamEvents.ts.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
src/shared/dialog.ts (12)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/shared/**/*.ts : Shared types in src/shared/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-21T01:47:11.596Z
Learning: Applies to src/shared/**/*.{ts,tsx,d.ts} : 共享类型定义放在 shared 目录
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/shared/.d.ts : The shared/.d.ts files are used to define the types of objects exposed by the main process to the renderer process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use the Icon component with lucide icons.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Prefer "lucide:" icon family as the primary choice.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : For cases where lucide icons don't meet requirements, use other Iconify collections as fallback.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{ts,tsx,vue} : Avoid enums; use const objects instead.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Iconify/Vue for icon implementation.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Import Icon component from Iconify/Vue.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Follow naming pattern: {collection}:{icon-name} for icons.
src/main/events.ts (8)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/**/*.ts : Main to Renderer: Use EventBus to broadcast events via mainWindow.webContents.send()
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/shared/.d.ts : The shared/.d.ts files are used to define the types of objects exposed by the main process to the renderer process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Implement proper inter-process communication (IPC) patterns
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should send standardized STREAM_EVENTS (RESPONSE, END, ERROR) to the frontend via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/presenter/index.ts : The IPC messages from the main process to notify the view mainly rely on the EventBus index.ts to listen for events that need to be notified and then send them to the renderer through the mainWindow
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/eventbus.ts : eventbus.ts is primarily used for intercommunication between main processes and decouples modules with events
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/streamEvents.ts : Standardized stream events should conform to the LLMCoreStreamEvent interface, ideally defined in a shared file such as src/main/presenter/llmProviderPresenter/streamEvents.ts.
src/renderer/src/stores/dialog.ts (11)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/stores/**/*.ts : Use Pinia for state management.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Use Pinia for frontend state management
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Implement proper state management with Pinia
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.467Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Implement proper state persistence for maintaining data across sessions
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.467Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Keep the store focused on global state, not component-specific data
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.467Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Use modules to organize related state and actions
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/renderer/src/composables/usePresenter.ts : The IPC in the renderer process is implemented in usePresenter.ts, allowing direct calls to the presenter-related interfaces exposed by the main process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.467Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Utilize actions for side effects and asynchronous operations
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
src/main/presenter/configPresenter/knowledgeConfHelper.ts (6)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-21T01:47:11.596Z
Learning: Applies to src/shared/**/*.{ts,tsx,d.ts} : 共享类型定义放在 shared 目录
src/renderer/src/components/settings/KnowledgeFile.vue (10)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Add proper error handling and loading states for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Follow existing component patterns in src/renderer/src/ when creating new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Iconify/Vue for icon implementation.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Use Composition API with proper TypeScript typing for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Organize components by feature in src/renderer/src/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use <script setup> syntax for concise component definitions.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Use the Composition API for better code organization and reusability
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Suspense for asynchronous components.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Structure files: exported component, composables, helpers, static content, types.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Leverage ref, reactive, and computed for reactive state management.
src/main/presenter/configPresenter/modelDefaultSettings.ts (1)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
src/main/utils/vector.ts (1)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/shared/**/*.ts : Shared types in src/shared/
src/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.ts (4)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider supports native function calling, MCP tools must be converted to the provider's format (e.g., using convertToProviderTools) and included in the API request.
src/main/presenter/dialogPresenter/index.ts (12)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/renderer/src/composables/usePresenter.ts : The IPC in the renderer process is implemented in usePresenter.ts, allowing direct calls to the presenter-related interfaces exposed by the main process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/presenter/index.ts : The IPC messages from the main process to notify the view mainly rely on the EventBus index.ts to listen for events that need to be notified and then send them to the renderer through the mainWindow
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Implement proper inter-process communication (IPC) patterns
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider does not support native function calling, it must prepare messages using prompt wrapping (e.g., prepareFunctionCallPrompt) before making the API call.
Learnt from: neoragex2002
PR: #550
File: src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts:250-252
Timestamp: 2025-06-21T15:48:29.950Z
Learning: In the meeting server implementation (src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts), when multiple tabs have the same title, the user prefers to let the code silently select the first match without adding warnings or additional ambiguity handling.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should send standardized STREAM_EVENTS (RESPONSE, END, ERROR) to the frontend via eventBus.
src/renderer/src/components/settings/BuiltinKnowledgeSettings.vue (6)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use <script setup> syntax for concise component definitions.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Use Composition API with proper TypeScript typing for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Add proper error handling and loading states for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Follow existing component patterns in src/renderer/src/ when creating new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Use the Composition API for better code organization and reusability
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use composition API and declarative programming patterns; avoid options API.
src/renderer/src/components/settings/OllamaProviderSettingsDetail.vue (17)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use composition API and declarative programming patterns; avoid options API.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Use the Composition API for better code organization and reusability
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Leverage ref, reactive, and computed for reactive state management.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use template syntax for declarative rendering.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Add proper error handling and loading states for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Use Composition API with proper TypeScript typing for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{ts,tsx,vue} : Use arrow functions for methods and computed properties.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use provide/inject for dependency injection when appropriate.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use <script setup> syntax for concise component definitions.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Iconify/Vue for icon implementation.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : Use the 'vue-i18n' framework for all internationalization in the renderer
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Leverage Vue's built-in reactivity system for efficient data handling
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Import Icon component from Iconify/Vue.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/{composables,utils}/**/*.ts : Use VueUse for common composables and utility functions.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Vue 3 with TypeScript, leveraging defineComponent and PropType.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
src/renderer/src/i18n/fr-FR/settings.json (6)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Regularly check for unused translation keys in i18n files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Translation key naming must use dot-separated hierarchy, lowercase letters, and meaningful descriptive names (e.g., 'common.button.submit')
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Each language must have a separate JSON file in 'src/renderer/src/i18n/'
docs/builtin-knowledge.md (2)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
src/renderer/src/components/settings/KnowledgeBaseSettings.vue (11)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Use Composition API with proper TypeScript typing for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use <script setup> syntax for concise component definitions.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use Vue 3 with TypeScript, leveraging defineComponent and PropType.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Use the Composition API for better code organization and reusability
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Leverage ref, reactive, and computed for reactive state management.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Follow existing component patterns in src/renderer/src/ when creating new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.788Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Leverage Vue's built-in reactivity system for efficient data handling
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.vue : Add proper error handling and loading states for new UI components
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/**/*.{vue} : Use composition API and declarative programming patterns; avoid options API.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-21T01:47:11.596Z
Learning: Applies to src/shared/**/*.{ts,tsx,d.ts} : 共享类型定义放在 shared 目录
src/main/presenter/llmProviderPresenter/providers/ollamaProvider.ts (14)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield image data events in the standardized format when applicable.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider supports native function calling, MCP tools must be converted to the provider's format (e.g., using convertToProviderTools) and included in the API request.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield events asynchronously using the async generator pattern.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield text events in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield tool call events (tool_call_start, tool_call_chunk, tool_call_end) in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Implement coreStream method following standardized event interface in LLM provider files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop in llmProviderPresenter/index.ts should handle multi-round LLM calls and tool usage, maintaining conversation state and controlling the loop with needContinueConversation and toolCallCount.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
src/renderer/src/i18n/fa-IR/settings.json (4)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Regularly check for unused translation keys in i18n files
src/renderer/src/i18n/en-US/settings.json (8)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Regularly check for unused translation keys in i18n files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Language files must be located in 'src/renderer/src/i18n/' directory
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Each language must have a separate JSON file in 'src/renderer/src/i18n/'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Translation key naming must use dot-separated hierarchy, lowercase letters, and meaningful descriptive names (e.g., 'common.button.submit')
src/main/presenter/knowledgePresenter/knowledgeTaskPresenter.ts (11)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield events asynchronously using the async generator pattern.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield tool call events (tool_call_start, tool_call_chunk, tool_call_end) in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop in llmProviderPresenter/index.ts should handle multi-round LLM calls and tool usage, maintaining conversation state and controlling the loop with needContinueConversation and toolCallCount.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/renderer/src/composables/usePresenter.ts : The IPC in the renderer process is implemented in usePresenter.ts, allowing direct calls to the presenter-related interfaces exposed by the main process
src/main/presenter/knowledgePresenter/database/duckdbPresenter.ts (11)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Create provider file in src/main/presenter/llmProviderPresenter/providers/ when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/renderer/src/composables/usePresenter.ts : The IPC in the renderer process is implemented in usePresenter.ts, allowing direct calls to the presenter-related interfaces exposed by the main process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Implement coreStream method following standardized event interface in LLM provider files
Learnt from: hllshiro
PR: #597
File: scripts/postinstall.js:10-41
Timestamp: 2025-07-15T10:15:20.447Z
Learning: DuckDB (@duckdb/node-api) automatically releases libraries and connections that are no longer referenced, so explicit connection cleanup in finally blocks is not necessary for DuckDB connections.
src/main/presenter/knowledgePresenter/index.ts (11)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tool in src/main/presenter/mcpPresenter/inMemoryServers/ when adding a new MCP tool
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Create provider file in src/main/presenter/llmProviderPresenter/providers/ when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/renderer/src/composables/usePresenter.ts : The IPC in the renderer process is implemented in usePresenter.ts, allowing direct calls to the presenter-related interfaces exposed by the main process
src/renderer/src/i18n/ko-KR/settings.json (4)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Regularly check for unused translation keys in i18n files
src/renderer/src/i18n/ja-JP/settings.json (4)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Regularly check for unused translation keys in i18n files
docs/builtin-knowledge-design.md (5)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
src/shared/presenter.d.ts (23)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop in llmProviderPresenter/index.ts should handle multi-round LLM calls and tool usage, maintaining conversation state and controlling the loop with needContinueConversation and toolCallCount.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/renderer/src/composables/usePresenter.ts : The IPC in the renderer process is implemented in usePresenter.ts, allowing direct calls to the presenter-related interfaces exposed by the main process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/presenter/index.ts : The IPC messages from the main process to notify the view mainly rely on the EventBus index.ts to listen for events that need to be notified and then send them to the renderer through the mainWindow
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield image data events in the standardized format when applicable.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Create provider file in src/main/presenter/llmProviderPresenter/providers/ when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Implement coreStream method following standardized event interface in LLM provider files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield text events in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield events asynchronously using the async generator pattern.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield error events in the standardized format when errors occur.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield tool call events (tool_call_start, tool_call_chunk, tool_call_end) in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider does not support native function calling, it must prepare messages using prompt wrapping (e.g., prepareFunctionCallPrompt) before making the API call.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : The coreStream method in each Provider must perform a single streaming API request per conversation round and must not contain multi-round tool call loop logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
src/main/lib/textsplitters/text_splitter.ts (1)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Use context isolation for improved security
docs/dialog-presenter.md (12)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/renderer/src/composables/usePresenter.ts : The IPC in the renderer process is implemented in usePresenter.ts, allowing direct calls to the presenter-related interfaces exposed by the main process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/presenter/index.ts : The IPC messages from the main process to notify the view mainly rely on the EventBus index.ts to listen for events that need to be notified and then send them to the renderer through the mainWindow
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/shared/.d.ts : The shared/.d.ts files are used to define the types of objects exposed by the main process to the renderer process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Implement proper inter-process communication (IPC) patterns
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-21T01:47:11.596Z
Learning: Applies to src/renderer/**/*.{vue,ts,js,tsx,jsx} : 渲染进程代码放在 src/renderer
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.289Z
Learning: Applies to src/renderer/stores/**/*.ts : Use Pinia for state management.
src/main/presenter/knowledgePresenter/knowledgeStorePresenter.ts (11)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Create provider file in src/main/presenter/llmProviderPresenter/providers/ when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Implement coreStream method following standardized event interface in LLM provider files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Implement proper error handling and logging for debugging
docs/builtin-knowledge-architecture.md (1)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
src/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts (13)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield text events in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield image data events in the standardized format when applicable.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider supports native function calling, MCP tools must be converted to the provider's format (e.g., using convertToProviderTools) and included in the API request.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield tool call events (tool_call_start, tool_call_chunk, tool_call_end) in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield events asynchronously using the async generator pattern.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Implement coreStream method following standardized event interface in LLM provider files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider does not support native function calling, it must prepare messages using prompt wrapping (e.g., prepareFunctionCallPrompt) before making the API call.
🧬 Code Graph Analysis (20)
src/main/presenter/mcpPresenter/inMemoryServers/builder.ts (2)
src/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.ts (1)
BuiltinKnowledgeServer(15-150)src/shared/presenter.d.ts (1)
BuiltinKnowledgeConfig(1483-1494)
src/main/presenter/trayPresenter.ts (1)
src/main/presenter/index.ts (1)
presenter(184-184)
src/renderer/src/events.ts (1)
src/main/events.ts (2)
DIALOG_EVENTS(177-180)RAG_EVENTS(183-186)
src/main/presenter/llmProviderPresenter/baseProvider.ts (1)
src/shared/presenter.d.ts (1)
LLM_EMBEDDING_ATTRS(492-495)
src/main/presenter/configPresenter/index.ts (2)
src/main/presenter/configPresenter/knowledgeConfHelper.ts (1)
KnowledgeConfHelper(4-51)src/shared/presenter.d.ts (1)
BuiltinKnowledgeConfig(1483-1494)
src/main/presenter/llmProviderPresenter/index.ts (1)
src/shared/presenter.d.ts (1)
LLM_EMBEDDING_ATTRS(492-495)
src/main/presenter/filePresenter/FilePresenter.ts (1)
src/shared/chat.d.ts (1)
MessageFile(74-82)
src/shared/dialog.ts (1)
src/shared/presenter.d.ts (1)
DialogIcon(1219-1222)
src/main/events.ts (1)
src/renderer/src/events.ts (2)
DIALOG_EVENTS(128-131)RAG_EVENTS(134-136)
src/renderer/src/stores/dialog.ts (4)
src/renderer/src/composables/usePresenter.ts (1)
usePresenter(103-105)src/shared/presenter.d.ts (2)
DialogRequest(1233-1241)DialogResponse(1243-1246)src/main/presenter/dialogPresenter/index.ts (1)
showDialog(32-58)src/renderer/src/events.ts (1)
DIALOG_EVENTS(128-131)
src/main/presenter/configPresenter/knowledgeConfHelper.ts (1)
src/shared/presenter.d.ts (1)
BuiltinKnowledgeConfig(1483-1494)
src/main/utils/vector.ts (1)
src/shared/presenter.d.ts (1)
MetricType(1495-1495)
src/main/presenter/mcpPresenter/inMemoryServers/builtinKnowledgeServer.ts (2)
src/shared/presenter.d.ts (3)
BuiltinKnowledgeConfig(1483-1494)MCPTextContent(991-994)QueryResult(1523-1531)src/main/presenter/index.ts (1)
presenter(184-184)
src/main/presenter/dialogPresenter/index.ts (3)
src/shared/presenter.d.ts (4)
IDialogPresenter(1248-1266)DialogRequestParams(1224-1231)DialogRequest(1233-1241)DialogResponse(1243-1246)src/main/eventbus.ts (1)
eventBus(151-151)src/main/events.ts (1)
DIALOG_EVENTS(177-180)
src/main/presenter/llmProviderPresenter/providers/ollamaProvider.ts (2)
src/shared/presenter.d.ts (2)
OllamaModel(870-892)LLM_EMBEDDING_ATTRS(492-495)src/main/utils/vector.ts (2)
EMBEDDING_TEST_KEY(3-3)isNormalized(20-27)
src/main/presenter/knowledgePresenter/knowledgeTaskPresenter.ts (1)
src/shared/presenter.d.ts (4)
IKnowledgeTaskPresenter(1324-1392)KnowledgeChunkTask(1297-1308)TaskStatusSummary(1311-1315)TaskQueueStatus(1318-1322)
src/shared/presenter.d.ts (1)
src/shared/chat.d.ts (1)
MessageFile(74-82)
src/main/lib/textsplitters/text_splitter.ts (1)
src/main/lib/textsplitters/document/document.ts (1)
Document(16-28)
src/main/presenter/knowledgePresenter/knowledgeStorePresenter.ts (7)
src/shared/presenter.d.ts (5)
BuiltinKnowledgeConfig(1483-1494)IKnowledgeTaskPresenter(1324-1392)KnowledgeFileMessage(1277-1285)KnowledgeChunkMessage(1287-1294)QueryResult(1523-1531)src/main/presenter/index.ts (1)
presenter(184-184)src/main/eventbus.ts (1)
eventBus(151-151)src/main/events.ts (1)
RAG_EVENTS(183-186)src/main/lib/textsplitters/text_splitter.ts (1)
RecursiveCharacterTextSplitter(245-672)src/main/utils/strings.ts (1)
sanitizeText(1-9)src/main/utils/vector.ts (2)
getMetric(100-102)normalizeDistance(71-93)
src/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts (2)
src/shared/presenter.d.ts (1)
LLM_EMBEDDING_ATTRS(492-495)src/main/utils/vector.ts (2)
EMBEDDING_TEST_KEY(3-3)isNormalized(20-27)
🪛 markdownlint-cli2 (0.17.2)
docs/builtin-knowledge.md
94-94: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
95-95: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
96-96: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
98-98: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
99-99: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
100-100: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
102-102: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
103-103: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
104-104: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
105-105: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
106-106: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
107-107: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
108-108: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
109-109: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
110-110: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
111-111: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
112-112: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
113-113: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
114-114: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
115-115: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
docs/builtin-knowledge-architecture.md
327-327: Multiple headings with the same content
(MD024, no-duplicate-heading)
330-330: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
331-331: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
332-332: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
333-333: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
334-334: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
337-337: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
338-338: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
339-339: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
340-340: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
341-341: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
342-342: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
345-345: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
346-346: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
347-347: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
348-348: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
349-349: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
352-352: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
353-353: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
354-354: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
357-357: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
358-358: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
359-359: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
362-362: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
363-363: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
364-364: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
367-367: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
368-368: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
369-369: Unordered list style
Expected: dash; Actual: asterisk
(MD004, ul-style)
🪛 LanguageTool
docs/builtin-knowledge-design.md
[uncategorized] ~220-~220: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:合适"地"分片
Context: ...KnowledgeStorePresenter 中根据文件类型或配置选择合适的分片策略。 3. 更新配置接口以支持分片策略的选择和参数配置。 ### 5.4...
(wb4)
[uncategorized] ~225-~225: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:新"地"检索
Context: ...geStorePresenter.similarityQuery()` 中实现新的检索逻辑。 2. 支持多种相似度计算方法(余弦相似度、欧几里得距离等)。 3. ...
(wb4)
🔇 Additional comments (104)
src/main/lib/textsplitters/document/index.ts (1)
1-1: Good use of barrel export pattern.The re-export statement follows best practices for module organization, providing a clean entry point for document-related exports.
src/renderer/src/i18n/zh-CN/mcp.json (1)
199-202: Localization entry follows consistent structure.The new
builtinKnowledgeentry properly follows the existing pattern with bothnameanddescfields, providing appropriate Chinese translations for the built-in knowledge base search functionality.src/renderer/src/components/ModelSelect.vue (1)
71-71: Improved filtering logic for better UX.The modification to filter out providers with no models when the search keyword is empty improves the user experience by showing only relevant providers with available models. This is a logical enhancement to the existing filtering behavior.
src/renderer/src/i18n/ja-JP/mcp.json (1)
199-202: Consistent Japanese localization for built-in knowledge base.The new
builtinKnowledgeentry maintains structural consistency with other language files and provides appropriate Japanese translations for the built-in knowledge base search service.src/renderer/src/components/settings/ModelConfigItem.vue (1)
43-43: LGTM! Clean and flexible prop addition.The addition of the
changeableprop with proper TypeScript typing and default value provides good flexibility for controlling model configuration UI visibility. The implementation follows Vue 3 Composition API best practices correctly.Also applies to: 93-97
src/renderer/src/i18n/zh-TW/mcp.json (1)
219-222: LGTM! Proper localization for built-in knowledge base feature.The Traditional Chinese translation for the built-in knowledge base search service is well-structured and consistent with existing localization patterns. The translation accurately describes the functionality as part of the comprehensive knowledge base feature introduced in this PR.
src/renderer/src/i18n/ko-KR/mcp.json (1)
199-202: LGTM! Consistent Korean localization for knowledge base feature.The Korean translation for the built-in knowledge base search service maintains consistency with the established localization patterns and accurately describes the functionality. Good work on maintaining comprehensive i18n support across all language files.
src/renderer/src/i18n/fa-IR/mcp.json (1)
199-202: LGTM! Comprehensive Persian localization support.The Persian translation for the built-in knowledge base search service is properly structured and follows the established localization conventions. Excellent work on providing comprehensive international support for the new knowledge base functionality.
src/renderer/src/App.vue (1)
18-18: LGTM! Clean integration of global message dialog component.The addition of
MessageDialogfollows the established pattern for global UI components in the application. The import and template placement are consistent with other global components likeUpdateDialogandToaster, supporting the new dialog management system introduced in this PR.Also applies to: 301-302
src/renderer/src/components/settings/DifyKnowledgeSettings.vue (3)
125-127: LGTM! Good dialog standardization.The addition of
DialogDescriptionto the dialog header improves UI consistency and follows established dialog patterns across the application.
132-132: LGTM! Improved i18n key organization.The translation key update from
difyDescriptiontodescriptionDescprovides better semantic separation between the dialog description and form field label.
201-202: LGTM! Proper import organization.The
DialogDescriptionimport is correctly added and follows the existing import structure.src/renderer/src/components/FileItem.vue (2)
47-47: LGTM! Clean utility import.The import of
getMimeTypeIconfrom@/lib/utilsfollows proper conventions and centralizes MIME type handling.
67-69: LGTM! Excellent refactoring.The centralization of MIME type icon mapping logic improves maintainability while preserving the existing interface. This follows DRY principles effectively.
src/renderer/src/components/mcp-config/components/McpServers.vue (1)
184-185: LGTM! Proper server integration.The addition of
builtinKnowledgeto the special servers mapping correctly integrates the new built-in knowledge base server into the MCP configuration routing flow, following established patterns.src/renderer/src/i18n/fr-FR/mcp.json (1)
199-202: LGTM! Proper French localization.The French translations for
builtinKnowledgeare grammatically correct and follow the established structure. The description clearly conveys the purpose of the built-in knowledge base search service.src/renderer/src/i18n/ru-RU/mcp.json (1)
199-202: LGTM! Proper Russian localization.The Russian translations for
builtinKnowledgeare grammatically correct and follow the established structure. The description clearly conveys the purpose of the built-in knowledge base search service.src/renderer/src/i18n/zh-HK/mcp.json (1)
199-202: LGTM! Proper localization for built-in knowledge base feature.The new
builtinKnowledgeentry is well-structured and uses appropriate Traditional Chinese text for the zh-HK locale. The description accurately reflects the built-in knowledge base retrieval service functionality being introduced.src/main/presenter/filePresenter/BaseFileAdapter.ts (1)
71-71: LGTM! Visibility change enables knowledge base integration.Changing the
getContent()method fromprotectedtopubliccorrectly enables external access for the knowledge base processing workflow, allowing the knowledge presenter to retrieve file content for chunking and vectorization.package.json (2)
51-51: LGTM! New script supports DuckDB VSS extension installation.The new npm script follows the existing naming convention and enables DuckDB vector similarity search functionality required for the knowledge base feature.
69-69: LGTM! Standard date/time utility dependency.The
dayjsdependency is a well-established, lightweight date/time library that's appropriate for the knowledge base file management functionality.src/main/presenter/configPresenter/mcpConfHelper.ts (1)
199-210: LGTM! Well-structured MCP server configuration for built-in knowledge base.The new
builtinKnowledgeserver configuration follows the established pattern for inmemory servers. The configuration is appropriate with:
- Descriptive Chinese name and icon
- Full auto-approval for built-in service
- Empty configs array (no external configuration needed)
- Enabled by default
This properly integrates the knowledge base retrieval service into the MCP framework.
src/main/presenter/trayPresenter.ts (1)
56-63: LGTM! Excellent UX improvement for task-aware app exit.The async quit handler properly integrates with the knowledge presenter's lifecycle management. This prevents data loss by checking for running tasks before allowing the application to exit, with appropriate user confirmation when needed.
The implementation correctly:
- Uses async/await pattern
- Calls
beforeDestroy()to check for running tasks- Only quits if user confirms or no tasks are running
- Maintains proper error handling flow
src/renderer/src/components/settings/FastGptKnowledgeSettings.vue (3)
125-127: Good UI enhancement with proper i18n integration.The addition of
DialogDescriptionimproves user guidance and follows the established pattern used across other knowledge base settings components.
132-132: Appropriate separation of translation keys.Changing from
fastgptDescriptiontodescriptionDescfor the label provides better semantic distinction between the dialog description and input field label.
201-202: Correct import addition.The
DialogDescriptioncomponent is properly imported to support the new dialog header enhancement.src/main/presenter/mcpPresenter/inMemoryServers/builder.ts (2)
15-16: Correct imports for the new builtin knowledge server.The imports properly reference the BuiltinKnowledgeServer class and its configuration type from the appropriate modules.
75-80: Well-implemented factory method integration.The new case follows the established pattern used by other knowledge servers in the factory, with appropriate type casting for the environment configuration.
src/renderer/src/i18n/en-US/mcp.json (1)
195-198: Appropriate localization entry for the new builtin knowledge server.The translation keys follow the established pattern and provide clear, descriptive text for the built-in knowledge base search service.
src/renderer/src/components/settings/RagflowKnowledgeSettings.vue (3)
125-127: Good UI enhancement with proper i18n integration.The addition of
DialogDescriptionimproves user guidance and follows the established pattern used across other knowledge base settings components.
132-132: Appropriate separation of translation keys.Changing from
ragflowDescriptiontodescriptionDescfor the label provides better semantic distinction between the dialog description and input field label.
201-202: Correct import addition.The
DialogDescriptioncomponent is properly imported to support the new dialog header enhancement.src/shared/dialog.ts (1)
1-21: Well-implemented dialog icon constants.The implementation correctly follows the coding guidelines:
- Uses lucide icons as preferred
- Follows the {collection}:{icon-name} pattern
- Proper TypeScript typing with DialogIcon interface
- Appropriate file location in shared directory
Consider whether green (
text-green-500) is the most appropriate color for confirmation dialogs, as they're typically neutral. You might consider usingtext-primaryortext-blue-500instead:export const DIALOG_CONFIRM: DialogIcon = { icon: 'lucide:circle-question-mark', - class: 'text-green-500' + class: 'text-primary' }src/renderer/src/events.ts (1)
127-136: Ensure RAG_EVENTS consistency and English commentsPlease address the following before merging:
RAG_EVENTS mismatch
The main process (src/main/events.ts) defines bothFILE_UPDATEDandFILE_PROGRESS, but the renderer only exportsFILE_UPDATED. Confirm whether the renderer should also handle progress updates. If so, add:export const RAG_EVENTS = { FILE_UPDATED: 'rag:file-updated', // File status update FILE_PROGRESS: 'rag:file-progress' // File processing progress update }Comments in English
Per our guideline on using English for logs and comments, replace all Chinese comments. For example:-// Dialog相关事件 +// Dialog related events export const DIALOG_EVENTS = { - REQUEST: 'dialog:request', // 主进程 -> 渲染进程,请求显示dialog - RESPONSE: 'dialog:response', // 渲染进程 -> 主进程,dialog结果回传 + REQUEST: 'dialog:request', // Main → Renderer: request to show dialog + RESPONSE: 'dialog:response', // Renderer → Main: dialog result response } -// 知识库事件 +// Knowledge base events export const RAG_EVENTS = { - FILE_UPDATED: 'rag:file-updated' // 文件状态更新 + FILE_UPDATED: 'rag:file-updated' // File status update }Let me know whether the progress event is intentionally omitted or if it should be added.
src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts (1)
1174-1189: Parameter order change aligns with provider standardization.The parameter reordering from
(texts: string[], modelId: string)to(modelId: string, texts: string[])is consistent with the standardization effort across all embedding providers mentioned in the AI summary. The method implementation correctly handles the new parameter order and maintains proper functionality.src/renderer/src/i18n/zh-HK/settings.json (2)
278-282: Comprehensive toast notification localization added.The new toast notification messages for model running states provide appropriate Traditional Chinese (Hong Kong) localization for user feedback when managing models. The translations are clear and contextually appropriate.
311-367: Comprehensive built-in knowledge base localization added.Excellent comprehensive localization coverage for the new built-in knowledge base feature, including:
- Configuration options (embedding models, chunking parameters, dimensions)
- File management (upload, delete, processing states)
- Technical terminology (L2 normalization, vector dimensions)
- User guidance and error messages
- Confirmation dialogs for task interruption
The Traditional Chinese (Hong Kong) translations are appropriate and maintain consistency with the existing localization structure.
src/renderer/src/i18n/ru-RU/settings.json (1)
278-282: Comprehensive Russian localization for new features.The Russian localization additions provide excellent coverage for:
- Provider toast notifications for model management
- Complete built-in knowledge base functionality including technical terms, configuration options, and user interactions
- Consistent structure and terminology alignment with other language files
The translations are contextually appropriate and maintain technical accuracy for Russian speakers.
Also applies to: 311-367
src/renderer/src/i18n/zh-TW/settings.json (1)
278-282: Complete Traditional Chinese (Taiwan) localization for new features.Excellent comprehensive localization additions including:
- Provider toast notifications with appropriate Traditional Chinese (Taiwan) terminology
- Full built-in knowledge base feature coverage with technical accuracy
- Consistent structure and terminology alignment across all language variants
- Proper handling of technical concepts like embedding dimensions, chunking, and normalization
The localization maintains high quality and consistency with the established translation patterns.
Also applies to: 311-367
src/main/presenter/llmProviderPresenter/baseProvider.ts (3)
9-10: LGTM: Import additions support new embedding functionality.The new imports for
KeyStatusandLLM_EMBEDDING_ATTRSare correctly added to support the newgetDimensionsmethod and key status functionality.
618-625: LGTM: Well-designed method for embedding dimension queries.The new
getDimensionsmethod provides essential functionality for the knowledge base system to query embedding vector dimensions. The implementation follows the established pattern with appropriate error handling and JSDoc documentation.
609-616: Parameter Order Change VerifiedAll
getEmbeddingsimplementations and callers now use the new signature(modelId: string, texts: string[])(and in the presenter interface(providerId, modelId, texts)). No mismatches were found in:
src/main/presenter/llmProviderPresenter/baseProvider.tssrc/main/presenter/llmProviderPresenter/index.ts- Provider files (
ollamaProvider.ts,openAICompatibleProvider.ts,geminiProvider.ts, etc.)- Call sites (
src/main/presenter/knowledgePresenter/knowledgeStorePresenter.ts)No further changes are needed.
src/main/presenter/index.ts (4)
1-1: LGTM: Presenter imports follow established patterns.The new imports for
DialogPresenterandKnowledgePresenterare correctly placed and follow the existing import structure in the file.Also applies to: 25-25
59-59: LGTM: Property declarations are consistent with existing patterns.The new presenter properties are correctly declared and follow the established naming and typing conventions in the class.
Also applies to: 61-61
89-90: LGTM: Presenter instantiation follows dependency injection patterns.The new presenters are correctly instantiated with appropriate dependencies. The
KnowledgePresenterproperly receives theconfigPresenteranddbDirparameters for its functionality.
178-178: LGTM: Proper cleanup for database resources.The addition of
knowledgePresenter.destroy()in the cleanup method is essential for releasing database connections and other resources managed by the knowledge presenter.src/renderer/src/i18n/zh-CN/settings.json (3)
183-186: LGTM: Well-structured toast messages for model state feedback.The new toast messages for model running states are properly structured with parameter interpolation and provide appropriate user feedback.
288-358: LGTM: Comprehensive localization support for knowledge base features.The extensive set of localization keys provides complete coverage for the knowledge base functionality, including configuration, file management, search, and error handling. The key naming follows established conventions and the Chinese translations are appropriate.
360-367: LGTM: Clear exit confirmation dialog for running tasks.The beforequit dialog provides essential user feedback when exiting with active knowledge base tasks. The messaging is clear and follows established dialog patterns.
src/renderer/src/components/settings/KnowledgeFileItem.vue (4)
1-72: LGTM: Well-structured template with proper layout and styling.The template provides a clean, responsive layout for file items with appropriate status indicators, metadata display, and action buttons. The use of Tailwind CSS classes and conditional rendering is well-implemented.
74-87: LGTM: Proper imports and dayjs configuration.The imports are well-organized and the dayjs timezone plugins are correctly configured for proper date formatting across different timezones.
88-95: LGTM: Proper TypeScript typing for component interface.The component props and emits are correctly typed using TypeScript generics, providing good type safety and clear component API definition.
97-124: LGTM: Well-implemented utility functions with proper timezone handling.The utility functions provide good user experience with timezone-aware date formatting, human-readable file sizes, and proper event emission for parent component communication. The file icon integration follows established patterns.
src/main/presenter/llmProviderPresenter/index.ts (2)
10-11: LGTM! Imports correctly added for new embedding functionality.The new imports
KeyStatusandLLM_EMBEDDING_ATTRSare properly imported and align with the newgetDimensionsmethod implementation.
1223-1246: LGTM! Well-implemented getDimensions method.The new
getDimensionsmethod follows good practices:
- Proper error handling with try-catch and detailed logging
- Consistent return pattern with
{ data, errorMsg }structure- Uses shared types from
@shared/presenter- Provides meaningful default values in error cases
- Supports the knowledge base system's need for dynamic dimension detection
src/renderer/src/components/ui/MessageDialog.vue (5)
1-37: LGTM! Well-structured template with proper i18n handling.The template correctly:
- Uses shadcn/ui AlertDialog components consistently
- Implements conditional i18n translation based on the
i18nflag- Displays timeout countdown in a clean format with proper spacing
- Distinguishes between default and cancel buttons appropriately
39-66: LGTM! Proper Composition API usage with clean imports.The script setup demonstrates good Vue 3 practices:
- Correct imports from shadcn/ui components and required composables
- Proper use of computed properties for reactive state
- Clean integration with dialog store and i18n
- Well-structured timeout calculation logic
67-73: LGTM! Clean button click handler with proper null checking.The
handleClickfunction properly:
- Guards against null
dialogRequest- Passes the correct parameters to the dialog store
- Maintains clean separation of concerns
75-93: LGTM! Well-implemented time formatting utility.The
perfectTimefunction demonstrates good practices:
- Handles edge cases (negative numbers, infinity, zero)
- Uses clear time unit abbreviations (s, m, h, d, w)
- Provides sensible fallbacks and minimum values
- Clear logic flow from smallest to largest time units
95-97: LGTM! Simple and effective icon props handler.The
getIconPropsfunction serves its purpose as a clean pass-through for icon properties to the Icon component.src/main/presenter/configPresenter/knowledgeConfHelper.ts (2)
1-24: LGTM! Clean class implementation with proper store initialization.The
KnowledgeConfHelperclass demonstrates good practices:
- Proper TypeScript typing with
BuiltinKnowledgeConfig[]- Clear store naming convention 'knowledge-configs'
- Sensible default configuration with empty array
- Simple, focused getter/setter methods for configurations
26-50: LGTM! Efficient configuration diffing with clear logic.The
diffKnowledgeConfigsstatic method is well-implemented:
- Uses Maps for efficient O(1) ID lookups
- Clear logic for identifying added, deleted, and updated configurations
- JSON.stringify comparison is appropriate for configuration objects
- Returns well-structured result with descriptive property names
- Proper TypeScript typing for parameters and return value
src/main/presenter/configPresenter/modelDefaultSettings.ts (3)
1676-1677: LGTM! Reasonable token limits for embedding model.The reduction of
maxTokensandcontextLengthfrom 8192 to 2048 for the nomic-embed-text model is appropriate for embedding use cases, where shorter text chunks are typically processed.
1684-1695: LGTM! Well-configured embedding model with appropriate settings.The new
all-minilmembedding model configuration is properly set up:
- Conservative but appropriate token limits (512) for a compact embedding model
- Correct temperature (0.0) for deterministic embeddings
- Properly typed as
ModelType.Embedding- All capability flags correctly set to false for an embedding-only model
1700-1701: LGTM! Appropriate token limit adjustment for generic embedding model.The reduction of
maxTokensandcontextLengthfrom 4096 to 1024 for the generic embedding model aligns with typical embedding use cases where smaller text chunks are processed.src/renderer/src/stores/settings.ts (1)
1032-1035: LGTM! Capability extraction logic is well-implemented.The capability mapping logic correctly extracts model capabilities from the Ollama model's capabilities array:
- Maps 'vision' to vision support
- Maps 'tools' to functionCall support
- Maps 'thinking' to reasoning support
- Uses 'embedding' presence to determine model type
The use of
indexOfwith comparison to -1 is appropriate, and the fallback toModelType.Chatwhen embedding capability is absent is sensible.src/main/presenter/filePresenter/FilePresenter.ts (2)
95-151: LGTM! Well-designed extension with proper backward compatibility.The
prepareFileCompletelymethod effectively extends the file preparation functionality:✅ Good design patterns:
- Maintains backward compatibility through delegation
- Clear parameter typing with union types
- Proper switch statement handling all contentType cases
- Preserves existing error handling and file metadata logic
✅ Content type handling:
'llm-friendly': Usesadapter.getLLMContent()for processed content'origin': Usesadapter.getContent()for raw contentnull/default: Sets content to null for metadata-only use casesThis supports the knowledge base feature's need for flexible content extraction modes while maintaining the existing API contract.
153-155: LGTM! Perfect backward compatibility implementation.The refactored
prepareFilemethod maintains complete backward compatibility by delegating toprepareFileCompletelywith'llm-friendly'as the default content type. This ensures existing callers continue to work without any changes while enabling the new functionality for those who need it.src/main/presenter/configPresenter/index.ts (3)
10-11: LGTM! Necessary imports for knowledge configuration support.The added imports follow the established patterns:
BuiltinKnowledgeConfigfrom shared types for type safetyKnowledgeConfHelperfrom local helper module for encapsulated configuration logicThese imports are required for the new knowledge base configuration management functionality.
Also applies to: 26-26
84-84: LGTM! Follows established helper pattern.The
knowledgeConfHelperinitialization follows the same pattern as other configuration helpers in this class:
- Property declared at class level with proper typing
- Instantiated in constructor alongside other helpers
- Consistent with
mcpConfHelperandmodelConfigHelperpatternsAlso applies to: 131-132
1056-1072: LGTM! Clean knowledge configuration management interface.The three new methods provide a complete CRUD interface for knowledge configurations:
✅ Good implementation patterns:
getKnowledgeConfigs(): Simple delegation to helper for retrieving configssetKnowledgeConfigs(): Clean setter with proper typingdiffKnowledgeConfigs(): Uses static helper method for pure comparison logic✅ Consistent with class design:
- Follows the delegation pattern used by other config helpers in this class
- Proper typing with
BuiltinKnowledgeConfig[]- Clean method signatures without unnecessary complexity
These methods enable the knowledge base feature's configuration lifecycle management while maintaining consistency with the existing codebase architecture.
src/renderer/src/stores/dialog.ts (1)
68-96: LGTM! Well-structured error handling.The response and error handlers properly use try-catch-finally blocks to ensure state cleanup regardless of success or failure. The consistent pattern between both handlers enhances maintainability.
src/main/utils/vector.ts (1)
20-27: LGTM! Robust input validation.The function properly validates inputs including array checks, non-negative tolerance, and finite number validation before performing the normalization check.
src/renderer/src/components/settings/KnowledgeFile.vue (2)
1-386: LGTM! Well-structured knowledge base file management component.The component follows Vue 3 best practices with proper TypeScript typing, internationalization, and user-friendly error handling. The UI provides comprehensive file management capabilities with drag-and-drop support, search functionality, and real-time status updates.
374-381: Ignore unnecessary knowledge‐base ID validationThe listener already only updates files present in fileList, which is initialized via
fileList.value = await knowledgePresenter.listFiles(props.builtinKnowledgeDetail.id)Since fileList contains only files for the current knowledge base, the existing
const file = fileList.value.find(f => f.id === data.id) if (!file) returnguard prevents updates from other knowledge bases. No additional data.knowledgeId check is needed.
Likely an incorrect or invalid review comment.
src/renderer/src/components/settings/OllamaProviderSettingsDetail.vue (2)
105-150: LGTM! Well-structured model display logic.The refactoring to use
displayLocalModelscomputed property and the integration ofModelConfigItemcomponent is clean. The conditional rendering for pulling models with progress bars provides good user feedback.
454-466: Good UX improvement for model deletion.The validation preventing deletion of running models with user-friendly toast notifications is a nice touch. The i18n integration ensures proper localization.
src/main/presenter/knowledgePresenter/knowledgeTaskPresenter.ts (1)
170-178: Well-structured error handling.The error handling properly distinguishes between abort errors and other failures, with appropriate callbacks for each case.
src/main/presenter/llmProviderPresenter/providers/ollamaProvider.ts (2)
1153-1168: Good API standardization.The parameter order change to
(modelId, texts)aligns with other provider implementations, improving consistency across the codebase.
1170-1176: Well-implemented embedding dimensions retrieval.The method correctly uses the test key approach and normalization check to determine embedding attributes.
src/renderer/src/i18n/fr-FR/settings.json (2)
278-282: LGTM! Provider toast messages added correctly.The new toast messages for model running state notifications follow the proper key naming convention and maintain consistency with the existing structure.
311-367: LGTM! Built-in knowledge base translations properly integrated.The new localization entries for the built-in knowledge base feature are well-structured, follow the established naming conventions, and provide comprehensive French translations for all UI elements.
src/renderer/src/components/settings/BuiltinKnowledgeSettings.vue (1)
488-881: Well-structured component following Vue 3 best practices.The component properly implements:
- Composition API with TypeScript typing
- Comprehensive error handling with user feedback
- Proper state management with Pinia stores
- Safe JSON parsing with error handling
- Route parameter integration for UI state
Great implementation overall!
src/renderer/src/i18n/ja-JP/settings.json (2)
278-282: LGTM! Provider toast messages maintain consistency.The Japanese translations for model running state notifications are properly structured and consistent with other language files.
311-367: LGTM! Built-in knowledge base translations complete.The Japanese localization for the built-in knowledge base feature maintains perfect consistency with the French translations, using identical key structures and comprehensive coverage of all UI elements.
src/renderer/src/i18n/fa-IR/settings.json (2)
278-282: LGTM! Provider messages consistent across languages.The Persian translations for model running notifications maintain the same structure as other language files.
311-367: LGTM! Knowledge base translations properly localized.The Persian localization for the built-in knowledge base feature maintains consistency with all other language files, ensuring a uniform internationalization structure across the application.
src/renderer/src/i18n/ko-KR/settings.json (2)
278-282: LGTM! Well-structured model running notifications.The new toast notification translations for model running states are clear and appropriately localized for Korean users.
311-367: Excellent comprehensive localization for built-in knowledge base feature.The Korean translations for the built-in knowledge base feature are well-structured and comprehensive, covering all necessary UI elements including configuration dialogs, file management, search functionality, and confirmation dialogs. The translations maintain consistency with the existing localization structure.
src/renderer/src/components/settings/KnowledgeBaseSettings.vue (5)
3-3: Good conditional rendering approach.Using
v-showfor the main container while showing built-in knowledge detail provides better performance for frequent toggles while maintaining clean separation between list and detail views.
87-100: Well-integrated built-in knowledge base option.The new built-in knowledge base option is properly integrated into the existing dialog with appropriate icon, localized text, and consistent styling. The click handler correctly routes to the built-in settings component.
110-116: Clean detail view implementation.The conditional rendering of the KnowledgeFile component with proper props and event handling follows Vue best practices. The hideKnowledgeFile event handler correctly resets the detail view state.
137-153: Proper reactive state management.The component correctly uses reactive references for managing built-in knowledge detail state and implements proper event handling for showing details. The showDetail method appropriately updates both visibility and data state.
171-175: Good type safety and component integration.The selectKnowledgeBaseType method properly handles the built-in knowledge base case with type safety and correct component method invocation through the ref.
src/renderer/src/i18n/en-US/settings.json (2)
278-282: Clear and informative model running notifications.The new toast notification translations provide clear feedback to users about model running states with appropriate messaging for the delete operation scenario.
311-367: Comprehensive and well-structured built-in knowledge base localization.The English translations for the built-in knowledge base feature are comprehensive, covering all necessary UI elements including configuration dialogs, chunking parameters, embedding model selection, file management, search functionality, and confirmation dialogs. The terminology is professional and consistent throughout.
src/shared/presenter.d.ts (6)
313-314: Dialog system interfaces are well-designedThe new dialog presenter interfaces provide a clean API for managing dialogs with proper async handling, internationalization support, and error management.
Also applies to: 1214-1266
429-436: Configuration management methods follow best practicesThe knowledge base configuration methods provide a complete API with get/set operations and a useful diff mechanism for detecting configuration changes.
492-495: Embedding API enhancements support vector operationsThe new embedding attributes type and enhanced methods properly support vector dimension queries and batch embedding generation needed for the knowledge base feature.
Also applies to: 543-547
849-853: File preparation method provides flexible content handlingThe new
prepareFileCompletelymethod appropriately extends file handling capabilities with content type options for different use cases.
883-892: Model capability metadata properly structuredThe enhanced OllamaModel interface provides comprehensive model information needed for embedding and vision capabilities detection.
1268-1643: Knowledge base interfaces provide comprehensive RAG functionalityThe extensive set of interfaces for file management, vector operations, task scheduling, and configuration provides a solid foundation for the built-in knowledge base feature. The separation of concerns between presenter layers is well-executed.
docs/builtin-knowledge-design.md (2)
146-151: WAL recovery procedure glosses over corruption edge-casesRecovering by attaching an in-memory DB and issuing a checkpoint is neat, but:
- If the WAL itself is corrupt,
ATTACHwill raise an error before you can checkpoint.- The current flow never verifies that rebuilt indexes match the intended
dimensions.Add an explicit
PRAGMA quick_check;(or equivalent) after checkpointing and fall back to rebuilding the whole DB when it fails.
181-199: Config interface leaves critical defaults unspecified
chunkSize,chunkOverlap, andrerankare optional but the runtime code (per the flow description) assumes concrete numbers/models.Either:
- declare sane defaults in the interface comment, or
- mark them as required and shift “optional” behaviour to the config editor UI.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…task presenters; update text sanitization and localization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
♻️ Duplicate comments (1)
src/main/presenter/dialogPresenter/index.ts (1)
50-57: Memory leak fix has been properly implemented.The pending dialog cleanup on eventBus.sendToRenderer error has been correctly implemented as suggested in previous review comments.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
src/main/lib/textsplitters/document/document.ts(1 hunks)src/main/lib/textsplitters/text_splitter.ts(1 hunks)src/main/presenter/dialogPresenter/index.ts(1 hunks)src/main/presenter/knowledgePresenter/database/duckdbPresenter.ts(1 hunks)src/main/presenter/knowledgePresenter/knowledgeTaskPresenter.ts(1 hunks)src/main/presenter/llmProviderPresenter/providers/ollamaProvider.ts(5 hunks)src/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts(2 hunks)src/main/utils/strings.ts(1 hunks)src/renderer/src/components/settings/KnowledgeFile.vue(1 hunks)src/renderer/src/components/settings/OllamaProviderSettingsDetail.vue(5 hunks)src/renderer/src/i18n/en-US/settings.json(2 hunks)src/renderer/src/i18n/fa-IR/settings.json(2 hunks)src/renderer/src/i18n/fr-FR/settings.json(2 hunks)src/renderer/src/i18n/ja-JP/settings.json(2 hunks)src/renderer/src/i18n/ko-KR/settings.json(2 hunks)src/renderer/src/i18n/ru-RU/settings.json(2 hunks)src/renderer/src/i18n/zh-CN/settings.json(3 hunks)src/renderer/src/i18n/zh-HK/settings.json(2 hunks)src/renderer/src/i18n/zh-TW/settings.json(2 hunks)src/renderer/src/lib/utils.ts(1 hunks)src/renderer/src/stores/dialog.ts(1 hunks)src/shared/presenter.d.ts(7 hunks)
🚧 Files skipped from review as they are similar to previous changes (17)
- src/renderer/src/i18n/zh-TW/settings.json
- src/renderer/src/i18n/ru-RU/settings.json
- src/renderer/src/i18n/zh-CN/settings.json
- src/renderer/src/components/settings/KnowledgeFile.vue
- src/main/presenter/knowledgePresenter/knowledgeTaskPresenter.ts
- src/main/lib/textsplitters/document/document.ts
- src/renderer/src/stores/dialog.ts
- src/renderer/src/i18n/fa-IR/settings.json
- src/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts
- src/renderer/src/i18n/en-US/settings.json
- src/renderer/src/i18n/ko-KR/settings.json
- src/main/utils/strings.ts
- src/renderer/src/lib/utils.ts
- src/renderer/src/i18n/fr-FR/settings.json
- src/renderer/src/i18n/zh-HK/settings.json
- src/renderer/src/components/settings/OllamaProviderSettingsDetail.vue
- src/main/presenter/llmProviderPresenter/providers/ollamaProvider.ts
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Use English for logs and comments
Files:
src/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/dialogPresenter/index.tssrc/main/lib/textsplitters/text_splitter.tssrc/shared/presenter.d.ts
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Strict type checking enabled for TypeScript
**/*.{ts,tsx}: 始终使用 try-catch 处理可能的错误
提供有意义的错误信息
记录详细的错误日志
优雅降级处理
日志应包含时间戳、日志级别、错误代码、错误描述、堆栈跟踪(如适用)、相关上下文信息
日志级别应包括 ERROR、WARN、INFO、DEBUG
不要吞掉错误
提供用户友好的错误信息
实现错误重试机制
避免记录敏感信息
使用结构化日志
设置适当的日志级别
Files:
src/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/dialogPresenter/index.tssrc/main/lib/textsplitters/text_splitter.tssrc/shared/presenter.d.ts
src/main/**/*.ts
📄 CodeRabbit Inference Engine (CLAUDE.md)
Main to Renderer: Use EventBus to broadcast events via mainWindow.webContents.send()
Use Electron's built-in APIs for file system and native dialogs
Files:
src/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/dialogPresenter/index.tssrc/main/lib/textsplitters/text_splitter.ts
src/main/presenter/**/*.ts
📄 CodeRabbit Inference Engine (CLAUDE.md)
One presenter per functional domain
Files:
src/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/dialogPresenter/index.ts
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/development-setup.mdc)
**/*.{js,jsx,ts,tsx}: 使用 OxLint 进行代码检查
Log和注释使用英文书写
Files:
src/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/dialogPresenter/index.tssrc/main/lib/textsplitters/text_splitter.tssrc/shared/presenter.d.ts
src/{main,renderer}/**/*.ts
📄 CodeRabbit Inference Engine (.cursor/rules/electron-best-practices.mdc)
src/{main,renderer}/**/*.ts: Use context isolation for improved security
Implement proper inter-process communication (IPC) patterns
Optimize application startup time with lazy loading
Implement proper error handling and logging for debugging
Files:
src/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/dialogPresenter/index.tssrc/main/lib/textsplitters/text_splitter.ts
src/main/**/*.{ts,js,tsx,jsx}
📄 CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)
主进程代码放在
src/main
Files:
src/main/presenter/knowledgePresenter/database/duckdbPresenter.tssrc/main/presenter/dialogPresenter/index.tssrc/main/lib/textsplitters/text_splitter.ts
src/shared/**/*.ts
📄 CodeRabbit Inference Engine (CLAUDE.md)
Shared types in src/shared/
Files:
src/shared/presenter.d.ts
src/shared/*.d.ts
📄 CodeRabbit Inference Engine (.cursor/rules/electron-best-practices.mdc)
The shared/*.d.ts files are used to define the types of objects exposed by the main process to the renderer process
Files:
src/shared/presenter.d.ts
src/shared/**/*.{ts,tsx,d.ts}
📄 CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)
共享类型定义放在
shared目录
Files:
src/shared/presenter.d.ts
src/renderer/src/**/*
📄 CodeRabbit Inference Engine (.cursor/rules/i18n.mdc)
src/renderer/src/**/*: All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Use the 'vue-i18n' framework for all internationalization in the renderer
Ensure all user-visible text in the renderer uses the translation system
Files:
src/renderer/src/i18n/ja-JP/settings.json
🧠 Learnings (5)
src/main/presenter/knowledgePresenter/database/duckdbPresenter.ts (17)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Create provider file in src/main/presenter/llmProviderPresenter/providers/ when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Implement coreStream method following standardized event interface in LLM provider files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to **/*.{ts,tsx,js,jsx,vue} : Use English for logs and comments
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/development-setup.mdc:0-0
Timestamp: 2025-07-21T01:45:40.026Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Log和注释使用英文书写
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.{ts,tsx} : 提供有意义的错误信息
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Implement proper error handling and logging for debugging
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.{ts,tsx} : 提供用户友好的错误信息
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.{ts,tsx} : 记录详细的错误日志
Learnt from: hllshiro
PR: #597
File: scripts/postinstall.js:10-41
Timestamp: 2025-07-15T10:15:20.447Z
Learning: DuckDB (@duckdb/node-api) automatically releases libraries and connections that are no longer referenced, so explicit connection cleanup in finally blocks is not necessary for DuckDB connections.
src/main/presenter/dialogPresenter/index.ts (17)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/renderer/src/composables/usePresenter.ts : The IPC in the renderer process is implemented in usePresenter.ts, allowing direct calls to the presenter-related interfaces exposed by the main process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/presenter/index.ts : The IPC messages from the main process to notify the view mainly rely on the EventBus index.ts to listen for events that need to be notified and then send them to the renderer through the mainWindow
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Implement proper inter-process communication (IPC) patterns
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider does not support native function calling, it must prepare messages using prompt wrapping (e.g., prepareFunctionCallPrompt) before making the API call.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should send standardized STREAM_EVENTS (RESPONSE, END, ERROR) to the frontend via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Implement proper error handling and logging for debugging
Learnt from: neoragex2002
PR: #550
File: src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts:250-252
Timestamp: 2025-06-21T15:48:29.950Z
Learning: In the meeting server implementation (src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts), when multiple tabs have the same title, the user prefers to let the code silently select the first match without adding warnings or additional ambiguity handling.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield error events in the standardized format when errors occur.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop in llmProviderPresenter/index.ts should handle multi-round LLM calls and tool usage, maintaining conversation state and controlling the loop with needContinueConversation and toolCallCount.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/**/*.ts : Main to Renderer: Use EventBus to broadcast events via mainWindow.webContents.send()
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
src/main/lib/textsplitters/text_splitter.ts (4)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/{main,renderer}/**/*.ts : Use context isolation for improved security
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/shared/.d.ts : The shared/.d.ts files are used to define the types of objects exposed by the main process to the renderer process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.{ts,tsx} : 提供有意义的错误信息
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.681Z
Learning: Applies to **/*.{ts,tsx} : 提供用户友好的错误信息
src/shared/presenter.d.ts (23)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : src/main/presenter/llmProviderPresenter/index.ts should manage the overall Agent loop, conversation history, tool execution via McpPresenter, and frontend communication via eventBus.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in src/main/presenter/llmProviderPresenter/providers/*.ts should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as formatMessages, convertToProviderTools, parseFunctionCalls, and prepareFunctionCallPrompt as needed for provider-specific logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop should buffer text content, handle tool call events, format tool results for the next LLM call, and manage conversation continuation logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/**/*.ts : Centralize configuration in configPresenter/
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : All provider implementations must parse provider-specific data chunks and yield standardized events for text, reasoning, tool calls, usage, errors, stop reasons, and image data.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : The main Agent loop in llmProviderPresenter/index.ts should handle multi-round LLM calls and tool usage, maintaining conversation state and controlling the loop with needContinueConversation and toolCallCount.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/renderer/src/composables/usePresenter.ts : The IPC in the renderer process is implemented in usePresenter.ts, allowing direct calls to the presenter-related interfaces exposed by the main process
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/**/*.ts : One presenter per functional domain
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tool in mcpPresenter/index.ts
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/presenter/index.ts : The IPC messages from the main process to notify the view mainly rely on the EventBus index.ts to listen for events that need to be notified and then send them to the renderer through the mainWindow
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield image data events in the standardized format when applicable.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Create provider file in src/main/presenter/llmProviderPresenter/providers/ when adding a new LLM provider
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.768Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Implement coreStream method following standardized event interface in LLM provider files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield text events in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield events asynchronously using the async generator pattern.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield error events in the standardized format when errors occur.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield tool call events (tool_call_start, tool_call_chunk, tool_call_end) in the standardized format.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider does not support native function calling, it must prepare messages using prompt wrapping (e.g., prepareFunctionCallPrompt) before making the API call.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.865Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : The coreStream method in each Provider must perform a single streaming API request per conversation round and must not contain multi-round tool call loop logic.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:45:54.217Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs
src/renderer/src/i18n/ja-JP/settings.json (7)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Regularly check for unused translation keys in i18n files
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/**/* : All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Each language must have a separate JSON file in 'src/renderer/src/i18n/'
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.344Z
Learning: Applies to src/renderer/src/i18n/*.json : Translation key naming must use dot-separated hierarchy, lowercase letters, and meaningful descriptive names (e.g., 'common.button.submit')
🧬 Code Graph Analysis (2)
src/main/lib/textsplitters/text_splitter.ts (1)
src/main/lib/textsplitters/document/document.ts (1)
Document(16-28)
src/shared/presenter.d.ts (1)
src/shared/chat.d.ts (1)
MessageFile(74-82)
🔇 Additional comments (20)
src/main/presenter/knowledgePresenter/database/duckdbPresenter.ts (4)
578-592: LGTM: Excellent error handling in transaction management.The error handling properly attempts rollback on transaction failures and handles rollback errors separately with appropriate logging. The cleanup of pending operations ensures no memory leaks.
171-176: LGTM: Proper connection lifecycle management.The cleanup properly closes both the connection and database instance with appropriate error handling and logging.
673-697: LGTM: Sophisticated WAL repair implementation.The WAL repair logic properly handles the DuckDB + VSS extension interaction issue by using an in-memory database to load the extension before attaching to the main database. The approach is well-documented and includes proper cleanup.
844-898: LGTM: Well-implemented database migration system.The migration system properly handles version checking, executes migrations in transactions for safety, and provides comprehensive error handling. The incremental migration approach and version tracking are well-designed.
src/main/lib/textsplitters/text_splitter.ts (3)
29-31: LGTM: Essential validation prevents configuration errors.The validation ensuring chunk overlap is less than chunk size prevents a common misconfiguration that would break the splitting algorithm.
324-670: LGTM: Comprehensive and well-designed language-specific splitting patterns.The separator configurations for each programming language are thoughtfully designed to split at meaningful syntactic boundaries (classes, functions, control structures) before falling back to generic text patterns. This ensures context-aware chunking for code files.
82-131: LGTM: Sophisticated line tracking maintains accurate source locations.The line counting logic properly handles overlapping chunks and gaps between chunks while maintaining accurate line number metadata. This enables precise source location tracking for search results.
src/main/presenter/dialogPresenter/index.ts (2)
32-37: LGTM: Thorough dialog parameter validation.The validation properly checks for required fields and prevents invalid configurations like multiple default buttons. Error messages are clear and descriptive.
69-89: LGTM: Clean and consistent dialog response handling.Both response and error handlers properly clean up the pendingDialogs map and provide appropriate logging. The error messages are descriptive and the cleanup prevents memory leaks.
src/renderer/src/i18n/ja-JP/settings.json (2)
311-369: LGTM: Well-structured translation keys follow established patterns.The new knowledge base translation keys properly follow the dot-separated hierarchy naming convention and maintain consistency with existing translation structure. The keys are descriptive and meaningfully organized.
278-282: LGTM: Appropriate toast notification translations.The new provider toast translations follow consistent naming patterns and provide appropriate Japanese text for model running state notifications.
src/shared/presenter.d.ts (9)
313-314: LGTM! Clean integration with existing presenter architecture.The new presenter properties follow the established pattern of one presenter per functional domain and maintain consistent naming conventions.
429-436: Well-designed configuration management methods.The knowledge base configuration methods follow established patterns and the
diffKnowledgeConfigsmethod provides useful differential functionality for configuration management.
492-495: Clean type definition for embedding attributes.The
LLM_EMBEDDING_ATTRStype properly defines the essential properties for embedding models with clear, descriptive field names.
543-547: Well-designed embedding methods with proper error handling.The new embedding methods follow established async patterns and the
getDimensionsmethod properly includes error handling in its return type.
849-853: Good extension of file processing capabilities.The
prepareFileCompletelymethod follows established patterns and thecontentTypeparameter provides useful flexibility for different file processing scenarios, particularly for knowledge base ingestion.
1214-1266: Comprehensive dialog system type definitions.The dialog system types are well-structured with proper JSDoc documentation, consistent naming conventions, and appropriate TypeScript features. The interfaces provide clear contracts for dialog interactions.
1268-1387: Well-designed knowledge base type definitions and task management interfaces.The knowledge base types comprehensively cover file management, chunking, and task scheduling with proper TypeScript typing and excellent JSDoc documentation. The task management interfaces provide clean abstractions for queue operations.
1388-1470: Comprehensive knowledge base presenter interface.The
IKnowledgePresenterinterface provides a complete API for knowledge base operations with proper async patterns, clear method signatures, and good documentation. The lifecycle management methods (beforeDestroy,destroy) follow proper cleanup patterns.
1471-1637: Robust vector database and configuration type definitions.The vector database interface and configuration types are comprehensive and well-designed, covering all necessary operations from initialization to similarity search. The
BuiltinKnowledgeConfigtype properly encapsulates all configuration options with sensible defaults and optional fields.
Pull Request Description (中文)
你的功能请求是否与某个问题有关?请描述一下。
此 PR 引入了一个全新的内置知识库功能,允许用户将本地文件作为与大语言模型对话的上下文来源。这解决了在 DeepChat 中需要一个私有的、离线的 RAG 解决方案的问题。
请描述你希望的解决方案
该解决方案实现了一个完整的、本地化的 RAG 流程,包括:
.txt,.md,.pdf,.docx,.pptx)。桌面应用程序的 UI/UX 更改
平台兼容性注意事项
pnpm run installRuntime:duckdb:vss指令安装DuckDB VSS 扩展,以便离线使用。由于 macOS 平台编译的签名问题,该脚本目前在 macOS 上被跳过。附加背景
这是一个庞大的功能,涉及应用程序的许多部分,从主进程的 Presenter 到渲染器的 UI 组件。它为用户安全、私密地利用自己的数据引入了一项强大的新功能。
已知问题
未来计划
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores