Commit Graph

1064 Commits

Author SHA1 Message Date
nullkey 4e7922c8a1 feat(im): add QuotedContext to shared types and IM service layer 2026-04-03 11:34:22 +08:00
nullkey 3587ddb1c7 feat(wecom): implement quote extraction and populate in handleCallback 2026-04-03 11:34:22 +08:00
nullkey 9790cb4830 feat(im): add QuotedMessage type and Quote field to IncomingMessage 2026-04-03 11:34:22 +08:00
ChenRussell 2cbd98e36f fix(migrations): correct migration numbers and remove broken trigger
Migration 000029 and 000030 had off-by-one numbering in comments/notices.
Also removed update_updated_at_column() trigger from 000030 as the
function is never defined and no other table uses this pattern.
2026-04-03 11:31:21 +08:00
wizardchen 9bb776a91c feat(chat): refine parent-child chunk replacement logic in merge process
- Enhanced the logic for replacing child content with parent content to only apply to text chunks whose parent is a parent_text chunk.
- Added checks to skip non-text chunks and ensure that only appropriate parent chunks are used for replacement, improving content quality and integrity.
2026-04-02 21:42:47 +08:00
wizardchen 4ea58bc6f3 feat(assets): add ASR test audio file and embed it in the application
- Introduced a new audio file, asr_test.wav, for ASR testing purposes.
- Created embed.go to embed the ASR test audio file as a byte slice.
- Updated initialization.go to utilize the embedded ASR test audio for model transcription checks.
2026-04-02 21:27:27 +08:00
wizardchen c93f4e94ae feat(asr): add ASR model connection check and update related components
- Implemented a new function to check ASR model connectivity via the /v1/audio/transcriptions endpoint.
- Updated ModelEditorDialog.vue to integrate ASR model checks and adjust UI elements accordingly.
- Enhanced localization files to reflect changes in ASR terminology and descriptions.
- Added ASR configuration options to the knowledge base and updated related migration scripts.
- Refactored model handling to support ASR as a distinct model type in the application.
2026-04-02 21:27:27 +08:00
wizardchen d3c4992e01 docs(api): enhance agent and knowledge base documentation 2026-04-02 21:27:27 +08:00
wizardchen 624e24ba49 feat(asr): integrate Automatic Speech Recognition (ASR) support
- Added ASR configuration options to the knowledge base and model settings.
- Implemented ASR model selection and transcription capabilities in the knowledge processing pipeline.
- Enhanced file upload support to include audio formats for ASR processing.
- Updated localization files to include ASR-related labels and descriptions.
- Refactored model handling to accommodate ASR as a new model type.
2026-04-02 21:27:27 +08:00
nullkey d68c94a11a fix(stream): use io.EOF instead of errors.New("EOF") in SSEReader
errors.New("EOF") creates a distinct error instance that doesn't match
io.EOF, causing processRawHTTPStream to silently ignore normal stream
termination without sending a done response.

- SSEReader: return io.EOF instead of errors.New("EOF")
- processRawHTTPStream: handle io.EOF as normal completion, send done
  response with usage/toolCalls (aligned with processStream behavior)

Fixes #860
2026-04-02 18:35:53 +08:00
wizardchen cb36570cde feat(summary): enhance document summarization capabilities and UI
- Added max_input_chars configuration to limit input size for summary generation.
- Updated generate_summary.yaml to clarify summary generation steps and requirements.
- Introduced a new summary section in the document content view to display generated summaries or loading states.
- Refactored doc-content.vue to utilize computed properties for improved performance and readability.
- Enhanced knowledge base hooks to include description and summary status fields for better data handling.
- Updated internationalization files to include new summary-related labels in multiple languages.
2026-04-02 18:34:39 +08:00
chenrui7 8daecd346c fix(frontend): add null checks for markdown code block text parameter
Prevents TypeError when rendering empty code blocks in markdown documents.
Adds validation in doc-content.vue and document-preview.vue renderer.code.
2026-04-02 15:27:50 +08:00
wizardchen 9d021a29b7 feat(elasticsearch): enhance ID field handling with dynamic suffix detection
- Added logic to determine whether to append the ".keyword" suffix to ID fields based on index mapping.
- Introduced `detectFieldTypes` method to inspect index mappings and set the `useKeywordSuffix` flag accordingly.
- Updated methods to utilize the new `idField` function for consistent ID field querying across the repository.
- Improved logging for better visibility into mapping detection and suffix usage.
2026-04-02 15:26:34 +08:00
ochan.kwon 33e919cc80 fix(knowledge): delete extracted images from storage when knowledge is removed
Previously, only the original uploaded file was deleted via knowledge.FilePath.
Images extracted by the builtin parser (stored as individual S3/MinIO/local files
via ImageResolver) were never cleaned up, causing orphan files to accumulate.

- Add ListImageInfoByKnowledgeIDs repository method (no chunk_type filter)
- Add collectImageURLs utility with URL deduplication and JSON parse logging
- Add deleteExtractedImages helper (standalone, best-effort with error logging)
- Fix DeleteKnowledge: collect image URLs before errgroup, delete in file goroutine
- Fix DeleteKnowledgeList: bulk collect with KB-level fileSvc mapping
- Fix cleanupKnowledgeResources: collect before chunk deletion, delete after
- Fix ProcessKBDelete: collect before chunk deletion for KB-wide cleanup
2026-04-02 12:04:04 +08:00
ochan.kwon 8a375749f1 fix(i18n): use WEKNORA_LANGUAGE env for prompt language fallback instead of hardcoded zh-CN
- Add DefaultLanguage() that reads WEKNORA_LANGUAGE env with zh-CN fallback
- Replace hardcoded zh-CN in LanguageNameFromContext with DefaultLanguage()
- Unify middleware/language.go to use types.DefaultLanguage()
- Add Language field to DocumentProcessPayload (8 enqueue sites + worker restore)
- Add Language field to ImageMultimodalPayload (enqueue + worker restore)
- Propagate language from ImageMultimodalPayload to QuestionGenerationPayload
2026-04-02 12:01:25 +08:00
wizardchen 115bc826c2 docs: update README files to streamline section headings and remove redundant content across multiple languages 2026-04-02 11:55:14 +08:00
wizardchen c866cf5d44 docs: update project descriptions and features in multiple language READMEs 2026-04-02 11:32:41 +08:00
wizardchen 301d75eb52 docs: reorder Web UI table rows and remove outdated MCP server setup instructions 2026-04-02 10:35:05 +08:00
Windfarer 54da98fc24 feat: add docx max pages env config 2026-04-02 10:31:52 +08:00
wizardchen 3756c7c796 feat(session): restrict @mentions to agent's allowed knowledge base scope
- Implemented logic to filter user-provided KB and knowledge IDs based on the shared agent's allowed scope.
- Added a new method, restrictMentionsToAgentScope, to validate and restrict @mentions, preventing unauthorized access to knowledge bases.
- Enhanced logging to provide visibility into blocked mentions and the filtering process.
2026-04-02 10:31:20 +08:00
wizardchen b1fe7abbe1 feat(knowledge): enhance knowledge tag batch update with authorization checks
- Updated UpdateKnowledgeTagBatch method to include an authorizedKBID parameter for restricting updates to specific knowledge items.
- Implemented validation to ensure that all requested knowledge IDs belong to the authorized knowledge base.
- Enhanced GetKnowledgeBatch and UpdateKnowledgeTagBatch methods to incorporate agent-specific knowledge base access restrictions.
- Added utility functions to resolve allowed knowledge base IDs for agents based on their configuration.
2026-04-02 10:31:20 +08:00
wizardchen cb504e35b8 refactor(knowledge): remove unnecessary URL resolution for image paths 2026-04-01 21:59:22 +08:00
wizardchen 8e1cfaccb7 refactor(prompt_templates): improve question generation guidelines and context handling
- Updated the question generation template to clarify the role of surrounding context and main content.
- Enhanced quality rules for generated questions to better align with user search intent.
- Revised output format and added explicit instructions on what not to generate.
- Improved logging and output in the web parser for better visibility of parsed content and metadata.
2026-04-01 21:59:22 +08:00
Windfarer 1b7070c1a2 simplify oidc callback result payload 2026-04-01 20:47:18 +08:00
ochan.kwon 25379f5df5 fix(frontend): use storage_provider_config instead of legacy storage_config
The backend introduced storage_provider_config as the authoritative
field in commit dbab7b0, but the frontend was never updated to use it.
This caused the UI to always display "local" regardless of the actual
storage provider, and saving KB settings could overwrite the correct
storage_provider_config with an incorrect value.

Changes:
- KnowledgeBaseEditorModal.vue: read from storage_provider_config with
  storage_config fallback, dual-write both fields on save
- KnowledgeBaseList.vue: update feature badge logic and add type def
  for storage_provider_config, exclude "local" from badge display
- api/knowledge-base/index.ts: add storage_provider_config to API type
- ko-KR.ts, ru-RU.ts: add missing i18n keys — multimodal section
  (sidebar.multimodal, multimodal.title/description), channel labels
  (channelLabel, channelWeb, channelApi, etc.), and agent.think
2026-04-01 20:44:13 +08:00
ochan.kwon 258a786129 Revert "refactor(elasticsearch): remove ".keyword" suffix from ID fields in Elasticsearch queries"
This reverts commit 3daaabfc4a.
2026-04-01 20:41:24 +08:00
wizardchen c4f5db7e88 feat(metadata): enhance document processing to include metadata extraction and handling
- Updated DocReaderServicer to pass metadata in responses.
- Modified PipelineParser to accumulate and merge metadata from all parsers.
- Enhanced StdWebParser to extract and log the title from web page content.
- Implemented logic in knowledge service to update knowledge title based on extracted metadata.
2026-04-01 15:49:47 +08:00
wizardchen ce7df624fb feat(chunker): implement header tracking for Markdown tables during chunking
- Added headerTracker to preserve context of Markdown table headers across split chunks.
- Implemented logic to prepend headers to subsequent chunks after the first.
- Enhanced merging logic to ensure headers are not duplicated in overlapping content.
- Added comprehensive tests for header tracking and chunking behavior with Markdown tables.
2026-04-01 13:38:40 +08:00
Windfarer bc0c2d23d5 add comment 2026-04-01 13:37:37 +08:00
Windfarer 6058f1cbe0 add monkey patch for docx parse error 2026-04-01 13:37:37 +08:00
nullkey 6eafde98a3 fix(web_fetch): use ValidateURLForSSRF instead of removed IsSSRFSafeURL 2026-03-31 22:26:16 +08:00
nullkey 1151d90bb9 fix(knowledge): allow deselecting document category by clicking again
Previously clicking an already-selected category did nothing, forcing
users to refresh the page to view all documents. Now clicking the
active category toggles the selection off, returning to the unfiltered
view.
2026-03-31 21:16:31 +08:00
nullkey 0b64ef9bd1 fix(security): support IPv6 in SSRF validation via whitelist mechanism
- Keep strict mode blocking all direct IPs (IPv4 and IPv6 uniformly)
- Unify all SSRF call sites to use ValidateURLForSSRF (whitelist-aware)
- Add Teredo (2001:0000::/32) and 6to4 (2002::/16) tunnel detection
- Make redirect handler and DNS pinning respect SSRF_WHITELIST
- Unexport isSSRFSafeURL to prevent future callers bypassing whitelist
- Add scheme validation for whitelisted redirect targets
- Document IPv6 whitelist syntax in .env.example
- Add comprehensive IPv6 test coverage
2026-03-31 20:45:15 +08:00
wizardchen a5ca9a2784 feat(web-search): refactor web search provider
- Updated relevant files to include provider registration, implementation, and metadata.
- Enhanced frontend components to support provider management and configuration.
- Added localization for new provider settings and messages.
- Implemented backend repository methods for CRUD operations on web search providers.
2026-03-31 20:22:34 +08:00
wizardchen c59ae84157 feat(roadmap): update progress on document parsing and IM integration 2026-03-31 20:22:34 +08:00
Tavily PR Agent b84ca0b72a feat: add Tavily as web search provider option 2026-03-31 12:24:39 +08:00
wizardchen 4dd481560d refactor(chat): simplify temperature option handling in chat request builders
- Streamlined the handling of the temperature option in both OllamaChat and RemoteAPIChat by removing unnecessary conditional checks.
- Ensured that the temperature value is directly assigned when options are provided, improving code clarity and reducing complexity.
2026-03-31 12:19:22 +08:00
wizardchen aed88d4d9d feat(mcp): implement reconnection logic for MCP tool calls and tool listing
- Added a reconnection retry mechanism for MCP tool calls and tool listing operations to handle stale connections.
- Enhanced error logging to provide clearer feedback during reconnection attempts.
- Updated comments for clarity on the retry behavior and connection management.
2026-03-31 11:57:15 +08:00
wizardchen 1f01183057 feat(database): enhance DatabaseQueryTool with search scope filtering
- Updated DatabaseQueryTool to accept search targets during initialization.
- Implemented search scope filtering in SQL validation to restrict queries to specified knowledge bases and documents.
- Enhanced the SQL validation process to include new filtering options for improved security and query accuracy.
2026-03-31 10:52:01 +08:00
wizardchen bfd47b079f chore: update architecture diagram 2026-03-30 21:54:50 +08:00
wizardchen 6f48e356b9 feat: update readme & docs 2026-03-30 21:38:45 +08:00
wizardchen eaf17e65f8 docs: remove WeCom document integration from data source import documentation
- Deleted references to WeCom document integration in the data source import module documentation.
- Updated the quick start guide and related sections to reflect the removal of WeCom, enhancing clarity and focus on supported platforms.
2026-03-30 20:46:07 +08:00
wizardchen d2d1d6d59a feat(datasource): enhance DataSourceSettings and DataSourceSyncLogs functionality
- Implemented polling mechanism in DataSourceSettings for real-time updates on data source synchronization status.
- Improved loading state management and user feedback during data source operations.
- Added load more functionality in DataSourceSyncLogs for better log retrieval experience.
- Updated UI elements for consistency, including icon changes and styling adjustments for better visual clarity.
2026-03-30 20:46:07 +08:00
wizardchen 442c340e7f feat(datasource): enforce tenant isolation and knowledge base ownership
- Added checks to ensure that the tenant ID matches between data sources and knowledge bases during creation and updates.
- Implemented ownership verification for data sources and knowledge bases in the DataSourceHandler, enhancing security and access control.
- Refactored data source retrieval methods to centralize ownership validation, improving code maintainability and clarity.
- Updated error handling to provide more informative responses when access is denied or when knowledge bases are not found.
2026-03-30 20:46:07 +08:00
wizardchen 6a5a46cfc3 feat(datasource): add icons and improve data source feedback
- Introduced new icons for Feishu, Notion, and Yuque data sources to enhance visual representation.
- Updated localization files to include success and failure messages for data source creation and synchronization.
- Enhanced DataSourceEditorDialog and DataSourceSettings components with improved user feedback during data source operations.
- Added DataSourceTypeIcon component for consistent icon display across data source settings.
2026-03-30 20:46:07 +08:00
wizardchen 1a340a8374 refactor(datasource): remove WeCom document integration and related components
- Deleted WeCom document connector and callback handling code to streamline the datasource management.
- Removed associated localization entries and UI elements related to WeCom integration.
- Updated data source management logic to eliminate references to WeCom, enhancing maintainability and clarity.
- Adjusted error handling and logging to reflect the removal of WeCom-specific functionality.
2026-03-30 20:46:07 +08:00
wizardchen 53bd412cf6 fix(datasource): enhance error handling in ProcessSync method
- Improved logging for missing data sources, providing clearer warnings when a data source is not found.
- Updated sync log status to 'canceled' when a data source is deleted, ensuring accurate tracking of sync operations.
- Adjusted error handling to prevent unnecessary error returns, enhancing overall process stability.
2026-03-30 20:46:07 +08:00
wizardchen 36dac0120a fix(datasource): improve error handling and user feedback in DataSource components
- Updated error handling in DataSourceSettings and DataSourceEditorDialog to provide more informative messages.
- Enhanced the UI to display error details more clearly, improving user experience during connection tests and resource loading.
- Adjusted HTTP response status checks in request utility for better accuracy in handling success responses.
2026-03-30 20:46:07 +08:00
wizardchen 8021647929 feat(datasource): enhance DataSourceSettings and DataSourceSyncLogs UI
- Improved DataSourceSettings component with better loading handling and UI updates for data source cards.
- Refactored layout and styling for data source cards, including enhanced title and status display.
- Updated DataSourceSyncLogs component with improved summary statistics and log display styles.
- Enhanced responsiveness and visual consistency across components with updated padding, margins, and font sizes.
2026-03-30 20:46:07 +08:00
wizardchen d5ec5dc0ea feat(i18n): update localization files for new UI elements and actions
- Added translations for "Refresh logs" in English, Korean, Russian, and Chinese.
- Enhanced the knowledge base editor modal to include a badge for data source count.
- Improved data source settings UI with a confirmation dialog for deletion and a refresh button in sync logs.
- Updated the data source sync logs component to fetch logs on visibility change and added a refresh option in the header.
2026-03-30 20:46:07 +08:00