Commit Graph

61 Commits

Author SHA1 Message Date
12ae077ac7 refactor(frontend): adopt GitHub-style file tree design
统一采用GitHub风格的UI设计:文件树标题改为'Code',调整缩进和悬停样式,移除视图切换按钮,使用GitHub配色变量。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-07 12:46:00 +08:00
e5fcde6940 chore(backend): add test dependencies to requirements
添加 pytest、pytest-cov 和 pytest-asyncio 作为测试依赖项。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-07 12:45:06 +08:00
b2b1c87822 refactor(backend): add pragma marks for coverage exclusion
为无需测试覆盖的函数添加 # pragma: no cover 注释,包括启动事件、TTS/ASR加载器和API密钥验证等。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-07 12:43:22 +08:00
“ydy0615”
caf1ac1c01 refactor: replace Kokoro-82M with suno/bark for TTS, update HF cache path, and add model warmup on startup. 2026-04-06 13:40:41 +08:00
7985fe9641 feat(tts): add api endpoints and optimization for apple silicon
Introduce a comprehensive TTS/ASR module that:
- Adds /v1/tts-asr/config, /status, /warmup, /tts, /asr endpoints with detailed JSON responses
- Implements Apple‑Silicon detection, device selection (MPS/CUDA/CPU), and memory limiting logic
- Supports selectable model size, quantization, and offline mode via environment variables
- Adds robust audio validation and multi‑path resampling fallback
- Provides new README sections for API usage, device detection, and performance benchmarking
- Includes a full testing suite: unit tests, integration tests, macOS simulation and performance reports
- Updates backend dependencies and CI scripts
- Adds new front‑end views and components for Univer editor integration

All changes are backward compatible; new features are exposed through environment variables and new API routes.
2026-04-06 11:14:09 +08:00
c70cb2a9f0 refactor(ui): add context menu and file content viewer to Docs view
Introduce ContextMenu.vue and FileContent.vue components for interactive file operations
and file preview.

Update FileTree to support root drop, integrate the new components into DocsView,
and refresh i18n strings for file actions.

Refactor MilkdownEditor to embed TTS menu and player.
2026-04-05 23:30:01 +08:00
01b132266a feat(ui): add file explorer, TTS UI, views and routing
Add a file tree UI and corresponding composable for local file management.
Introduce TTS menu and player components for voice synthesis integration.
Add new EditorView and DocsView routes and update SettingsPanel view switching.
Enhance Mermaid plugin with improved styling and action buttons.
2026-04-05 23:22:00 +08:00
818baa349a modified: backend/llm.py
modified:   src/components/MilkdownEditor.vue
	modified:   src/utils/config.js
	modified:   src/utils/i18n.js
2026-04-05 15:10:23 +08:00
9293d48c1b modified: src/components/SettingsPanel.vue 2026-04-05 14:14:21 +08:00
68ed783d6c feat: LLM 应用网页开发及内联建议功能实现 2026-04-05 13:42:29 +08:00
9904b9bd78 feat: 批量上传支持及prompt优化
- 支持多文件批量上传,一次最多10个
- 新增json/toml/yaml格式支持
- 优化inline补全prompt结构,增加边界决策指南
- size计算包含doc_block内容长度
- 超限时显示警告tooltip
2026-04-05 11:40:56 +08:00
7ed199aaf1 style: 简化文档卡片样式,优化布局间距 2026-04-05 10:16:16 +08:00
9ff51ac2f3 feat(plugin): add document export, doc‑block, and TTS/ASR support
Adds a DocBlock component that renders embedded documents, new export buttons for DOCX
and PDF, and updates the file‑upload picker to accept *.txt, *.docx, *.pptx, and *.pdf.
Introduces a DOCX→PDF conversion bridge in the backend and new /tts and /asr
endpoints that expose TTS and speech‑recognition functionality.  The README is
rewritten to describe the new features and clean up legacy documentation.  All
changes are backward‑compatible and do not introduce breaking API changes.
2026-04-04 23:56:18 +08:00
be4000b774 chore: 更新项目配置和依赖,优化前后端代码 2026-04-04 20:05:40 +08:00
ef162de168 modified: backend/requirements.txt 2026-03-14 20:48:44 +08:00
1155de4867 feat(MilkdownEditor): add file upload support for documents and text files
Added new upload functionality to the editor supporting doc/docx/ppt/pptx/pdf/zip/txt/json files. Includes:
- New upload button with file input
- File type detection utilities (isTextFile, isConvertibleFile)
- Initial markdown sync with trailing whitespace normalization
- Warning messages for unsupported file types
2026-03-14 19:24:15 +08:00
d452d1747e feat: add language synonym mapping and canonicalization
Add LANGUAGE_SYNONYMS dictionary to map language aliases to canonical IDs,
_canonical_language_id() to normalize language identifiers, and
_language_guidance() to provide language-specific instructions for LLM
code generation. This improves language detection and ensures consistent
prompt context across different language format variations.
2026-03-14 18:20:39 +08:00
c0d4bf8b2b chore: remove unnecessary comments and suppress error logging 2026-03-10 23:26:18 +08:00
8d89c2a0f6 Merge remote changes with local modifications
- Add docx and html2pdf.js export functionality (from remote)
- Update backend with new API endpoints
- Sync local configuration changes
2026-03-10 23:10:11 +08:00
2ad57887cd feat: add docx and html2pdf.js for document export functionality 2026-03-10 22:21:11 +08:00
637456ee34 feat(api): add completion request cancellation and mermaid rendering
Add support for cancelling in-progress LLM completion requests via new /v1/completions/cancel endpoint with task tracking. Implement mermaid diagram rendering in the Milkdown editor with a new mermaidPlugin. Update copilotPlugin to properly abort requests with descriptive reasons. Refactor settings panel to handle system theme changes reactively. Add camera capture support for image uploads.
2026-02-25 19:00:17 +08:00
e28125079c feat(api): add system prompt support for LLM completion
Separate prompt generation into system and user prompts for better LLM instruction following. Backend now builds a detailed system prompt with constraints for math formatting, code block handling, boundary newlines, and OCR safety, while user prompt contains context and completion state flags. Added corresponding tests for both modules.
2026-02-23 15:17:36 +08:00
ce0731c2f2 feat(api): allow X-API-Key and X-Client-IP headers in CORS configuration 2026-02-19 20:26:56 +08:00
e77f69c5c4 chore(config): update default API base URL to production endpoint 2026-02-19 20:15:28 +08:00
5434f3eb47 fix(backend): rename thinking parameter to think for Ollama API compatibility
The Ollama API expects "think" parameter instead of "thinking". Also updates the API base URL in the frontend configuration to point to the correct endpoint.
2026-02-19 18:55:49 +08:00
4a979ba7c3 feat(api): add API key authentication to backend endpoints
Add API key security using fastapi.security.APIKeyHeader to protect /v1/completions and /v1/ocr endpoints. Updated frontend to include X-API-Key header in API requests. Also changed default API base URL from http://149.104.29.239:8001 to https://api.learnteach.tech:8002.
2026-02-19 18:18:47 +08:00
4fe4becdd5 fix(backend): filter out <br> tags from prompt context
Filter out potential web-scraping or legacy artifacts like <br>, <br/>, <br\> from prefix/suffix before using in model completion context
2026-02-19 11:14:43 +08:00
065b4ac319 feat(llm): add thinking parameter support for Ollama API calls
Add optional thinking parameter to the call_ollama function and pass it from the request. Also enhance timezone handling in prompt generation to support configurable timezone preferences.
2026-02-19 10:34:31 +08:00
aa6133e3ed feat: add privacy mode, thinking levels, PWA support, and i18n
- Add privacy mode to hide IP and user preferences from AI requests
- Add model thinking levels (low/medium/high) for context analysis depth
- Add PWA support with service worker, manifest, and app icons
- Add SettingsPanel for user preferences (theme, background, language)
- Add i18n translations for en/zh/ja/ko/de/fr
- Add Pinia store for centralized settings management
- Update backend to support user preferences and thinking levels
- Update config to use absolute API URLs
2026-02-19 10:22:27 +08:00
d2b64ad5d6 feat: add IP geolocation tracking and include location in prompts
- Add GeoLite2-City.mmdb database for IP lookup
- Create geoip.py module for IP location services
- Extract client IP from requests and log location info
- Pass location context to LLM prompts for enhanced responses
2026-02-18 08:59:28 +08:00
2b79f20e19 chore(config): update default Ollama model to gpt-oss:120b
Remove obsolete planning documents that are no longer needed:
- copilot-prompt-system-analysis.md
- ghost-text-markdown-rendering.md
- image-button-plan.md
- image-processing-plan.md
- refactor-backend.md
2026-02-17 09:27:21 +08:00
d9418fac98 refactor(copilot): simplify ghost mark addition by removing conditional check
Remove the mark type allowance validation and apply ghost marks directly
to text nodes within the specified range.
2026-02-16 22:58:11 +08:00
0d25f4d1ef Remove unused test files and tokenization modules
- Deleted `windowDelineation.test.ts` as it is no longer needed.
- Removed `index.ts` and `tokenizer.ts` from the tokenization module due to refactoring.
- Eliminated unused types related to authentication, code citation, context provider API, and core functionalities.
- Cleaned up the `status.ts` file by removing the `StatusKind` type definition.
2026-02-16 22:49:32 +08:00
“ydy0615”
71a71530a3 feat(ui): update editor welcome message to Chinese 2026-02-16 09:05:43 +08:00
“ydy0615”
9b37ca42d6 chore: remove env files and update gitignore for python
Remove sensitive environment files from repository tracking and add comprehensive Python ignore patterns including virtual environments, cache files, and environment variables. Also clean up staged __pycache__ binary files.
2026-02-16 09:01:08 +08:00
075eded2ba modified: .env
modified:   .env.example
2026-02-15 23:32:04 +08:00
eb6e8bbfff refactor(config): use Vite proxy for API requests and change backend port
- Configure Vite dev server to proxy /v1 requests to backend
- Change backend port from 8000 to 8001
- Simplify API URLs to relative paths instead of absolute localhost URLs
- Increase debounce delay from 500ms to 1000ms for better stability
- Update README documentation to reflect all changes
2026-02-15 23:23:00 +08:00
1e58c18bbc feat: add image hash-based OCR caching with 100MB size limit
- Implement SHA-256 image hashing to cache OCR results and avoid re-processing identical images
- Add 100MB file size limit for image uploads with user-friendly error messages
- Clear ghost suggestions when uploading new images to prevent interference
- Optimize size limit calculation in copilot plugin to include OCR context
- Remove debug logging from production code
- Add image processing optimization plan document

BREAKING CHANGE: Image upload size limit is now enforced at 100MB (previously unlimited)
2026-02-15 22:17:37 +08:00
190bb2b756 feat(ui): enhance theme toggle styling and add Chinese localization
- Redesign theme toggle with improved visual effects including gradient overlays, enhanced shadows, and smoother cubic-bezier transitions
- Update toggle dimensions and icon positioning for better visual balance
- Add SVG filter effects for sun/moon icons in dark mode
- Replace English UI text with Chinese localization in MilkdownEditor
- Refactor copilotPlugin by removing unused decoration functions and improving ghost mark text node handling
2026-02-15 18:24:34 +08:00
838eec30a8 feat: add theme management with light and dark modes
- Implemented a new composable `useTheme` for managing theme state.
- Added functions to read and write theme preference to local storage.
- Applied theme styles to the DOM based on user preference.
- Introduced a toggle function to switch between light and dark themes.

refactor: enhance copilot plugin functionality

- Improved request handling with sequence and document versioning.
- Refactored ghost text handling to improve clarity and efficiency.
- Updated markdown insertion logic to handle parsed content more robustly.
- Enhanced error handling and logging for better debugging.

style: update global styles for light and dark themes

- Defined CSS variables for light and dark themes to streamline styling.
- Improved overall styling consistency and responsiveness.
- Added transitions for smoother theme changes and interactions.
2026-02-15 15:44:09 +08:00
03bb21d5c6 feat(copilot): enhance OCR handling with inline tags and document serializer
- Replace HTML comment OCR metadata with inline `<OCR:...>` tags
- Implement serializer-based markdown conversion for prefix/suffix content
- Add extractTextFromOCR utility function for text extraction
- Enable Table, Diagram, and ListCheck features in MilkdownEditor
- Add periodic debug logging for document state analysis
2026-02-14 23:53:26 +08:00
“ydy0615”
794fbf8493 feat(config): add OCR URL configuration and improve image node handling
- Add VITE_OCR_URL environment variable with fallback URL construction
- Define IMAGE_NODE_TYPES constant to support 'image', 'image-block', and 'imageBlock' node types
- Add helper functions for safer image attribute access (getImageSrc, isImageNodeWithSrc, getImageLabel)
- Improve OCR error handling with HTTP status checking and error details
- Wrap OCR context in HTML comments to prevent prompt injection issues
- Update MilkdownEditor to use centralized OCR_URL configuration
2026-02-14 21:21:06 +08:00
“ydy0615”
64cfa58376 feat(editor): add image insertion with OCR support and size limit handling
Add image button with dropdown menu for uploading local images or inserting from URL.
Integrate VLM-based OCR to extract text context from images and include in AI suggestions.
Implement document size limits to disable AI when exceeding threshold.
Refactor copilot plugin with per-view runtime state and OCR context injection.
Add OCR cache utility for managing image metadata.
Add code splitting configuration for optimized bundle size.
2026-02-14 18:28:37 +08:00
“ydy0615”
c64ff7be45 feat(copilot): enhance prompt system and add Markdown rendering for ghost text
- Rewrite prompt builder with comprehensive rules for seamless text completion
- Implement Markdown parsing for ghost text with proper mark handling
- Update LLM parameters (temperature 0.7, repeat_penalty, think mode)
- Add CSS styles for formatted ghost text elements
- Add planning documentation for Copilot prompt system analysis
2026-02-13 22:00:26 +08:00
“ydy0615”
7cddfaba30 feat(editor): add Markdown rendering for ghost text and optimize prompt system
- Implement Markdown parsing for ghost text using Milkdown parser
- Add support for both block and inline content in ghost text
- Refactor prompt system with comprehensive rules and examples
- Adjust LLM parameters: increase temperature to 0.7, add repeat_penalty
- Add CSS styles for formatted ghost text (bold, italic, code, links)
- Add documentation for Copilot prompt system and ghost text rendering
2026-02-13 21:17:45 +08:00
“ydy0615”
65d4a57d33 refactor(editor): migrate to ProseMirror Mark-based ghost text system
- Replace overlay-based GhostTextOverlay.vue with ProseMirror Mark system
- Add AI toggle button with enable/disable functionality
- Implement new copilotPlugin.ts using copilotGhostMark for inline suggestions
- Fix cursor position offset in prompt.py by moving first suffix char to prefix
- Improve API error handling with abort signal support and debug logging
- Update model configuration from gpt-oss:120b to gpt-oss:20b
- Add button tooltips and improve editor styling
- Remove deprecated inlineSuggestionPlugin.ts
- Update README with new architecture diagram and feature documentation
2026-02-13 09:24:50 +08:00
“ydy0615”
16e76e1e90 refactor(editor): migrate to Milkdown with LaTeX support and clean up legacy code
- Removed old contenteditable-based MarkdownEditor component
- Integrated Milkdown Crepe with LaTeX (KaTeX) rendering support
- Simplified inline suggestion plugin using ProseMirror decorations
- Removed debug logging and unused components (HelloWorld, plan files)
- Increased debounce from 150ms to 500ms for better performance
- Fixed SSE JSON serialization in backend main.py
2026-02-12 18:52:16 +08:00
“ydy0615”
2432e78fe1 feat(editor): add file upload and fix critical bugs
- Add markdown file upload functionality with upload button
- Fix error handling to throw errors instead of silently returning empty strings
- Fix memory leak by cleaning up debounceTimer in onUnmounted
- Update debounce timing from 150ms to 500ms for stability
- Enhance UI with floating action buttons and extensive style refinements
- Hide toolbar, menu, and line number elements for cleaner interface
2026-02-12 08:55:37 +08:00
c2c87d24bf style(editor): remove max-width limit on editor content
Allows the markdown editor to expand to full width instead of being constrained
to 900px, providing better use of available screen real estate.
2026-02-07 13:00:24 +08:00
370510cc50 feat(editor): add inline autocomplete suggestions
Add GhostTextOverlay component for displaying AI-powered completion
suggestions while typing. Includes accept and dismiss actions triggered
by API calls to /v1/completions endpoint with prefix/suffix context.
2026-02-07 11:46:03 +08:00