* 🗃️ chore: add agent task system database schema
Add 6 new tables for the Agent Task System:
- tasks: core task with tree structure, heartbeat, scheduling
- task_dependencies: inter-task dependency graph (blocks/relates)
- task_documents: MVP workspace document pinning
- task_topics: topic tracking with handoff (jsonb) and review results
- task_comments: user/agent comments with author tracking (text id: cmt_)
- briefs: unresolved notification system (text id: brf_)
All sub-tables include userId FK for row-level user isolation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* 🗃️ chore: add self-referential FK on tasks.parentTaskId (ON DELETE SET NULL)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* 🐛 fix: use foreignKey() for self-referential parentTaskId to avoid TS circular inference
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* 🗃️ chore: add FK on task_topics.topic_id → topics.id (ON DELETE SET NULL)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* 🐛 fix: resolve pre-existing TS type-check errors
- Fix i18next defaultValue type (string | null → string)
- Fix i18next options type mismatches
- Fix fieldTags.webhook possibly undefined
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* 🗃️ chore: add FK on tasks.currentTopicId → topics.id (ON DELETE SET NULL)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* 🗃️ chore: add FK constraints for assignee, author, topic, and parent fields
- tasks.assigneeUserId → users.id (ON DELETE SET NULL)
- tasks.assigneeAgentId → agents.id (ON DELETE SET NULL)
- tasks.parentTaskId → tasks.id (ON DELETE SET NULL)
- tasks.currentTopicId → topics.id (ON DELETE SET NULL)
- task_comments.authorUserId → users.id (ON DELETE SET NULL)
- task_comments.authorAgentId → agents.id (ON DELETE SET NULL)
- task_topics.topicId → topics.id (ON DELETE SET NULL)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* 🗃️ chore: change task_topics.topicId FK to ON DELETE CASCADE
Topic deleted → task_topic mapping row removed (not just nulled).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* ♻️ refactor: use inline .references() for currentTopicId FK
No circular inference issue — only parentTaskId (self-ref) needs foreignKey().
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* 🗃️ chore: add FK on task_comments.briefId and topicId (ON DELETE SET NULL)
- task_comments.briefId → briefs.id (SET NULL)
- task_comments.topicId → topics.id (SET NULL)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* ♻️ refactor: merge briefs table into task.ts to fix circular dependency
brief.ts imported task.ts (briefs.taskId FK) and task.ts imported
brief.ts (taskComments.briefId FK), causing circular dependency error.
Merged briefs into task.ts since briefs are part of the task system.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* 🗃️ chore: add FK on tasks.createdByAgentId → agents.id (ON DELETE SET NULL)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🐛 fix: use jsonb ? operator instead of ->> to avoid Neon rt_fetch bug
The ->> operator in WHERE clauses triggers a Neon-specific
`rt_fetch used out-of-bounds` error. Switch to the ? operator
which is semantically equivalent for checking key existence.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* ✨ feat: add slash action tags in chat input
Made-with: Cursor
* ✨ feat: enhance editor with new slash actions and localization updates
- Added new slash actions: change tone, condense, expand, polish, rewrite, summarize, and translate.
- Updated localization files for English and Chinese to include new action tags and slash commands.
- Removed deprecated useSlashItems component and integrated its functionality directly into InputEditor.
Signed-off-by: Innei <tukon479@gmail.com>
* ✨ feat: add slash placement configuration to chat input components
- Introduced `slashPlacement` prop to `ChatInputProvider`, `StoreUpdater`, and `InputEditor` for customizable slash menu positioning.
- Updated initial state to include `slashPlacement` with default value 'top'.
- Adjusted `ChatInput` and `InputArea` components to utilize the new `slashPlacement` prop.
This enhancement allows for better control over the user interface in chat input interactions.
Signed-off-by: Innei <tukon479@gmail.com>
* ✨ feat: implement command bus for slash action tags processing
Add command bus system to parse and execute slash commands (compact context,
new topic). Refactor action tag categories from ai/prompt to command/skill.
Add useEnabledSkills hook for dynamic skill registration.
* feat: compress command
Signed-off-by: Innei <tukon479@gmail.com>
* refactor: compress
Signed-off-by: Innei <tukon479@gmail.com>
* fix: skill inject
* ✨ feat: slash action tags with context engine integration
Made-with: Cursor
* ✨ feat: add topic reference builtin tool and server runtime
Made-with: Cursor
* ✨ feat: add topic mention items and update ReferTopic integration
Made-with: Cursor
* 🐛 fix: preserve editorData through assistant-group edit flow and update RichTextMessage reactively
- EditState now forwards editorData from EditorModal to modifyMessageContent
- modifyMessageContent accepts and passes editorData to updateMessageContent
- RichTextMessage uses useEditor + effect to update document on content change instead of key-based remount
- Refactored RichTextMessage plugins to use shared createChatInputRichPlugins()
* ✨ feat(context-engine): add metadata types and update processors/providers
Made-with: Cursor
* ✨ feat(chat-input): add slash action tags and restore failed input state
* 🔧 chore: update package dependencies and enhance Vite configuration
- Changed @lobehub/ui dependency to a specific package URL.
- Added multiple SPA entry points and layout files to the Vite warmup configuration.
- Removed unused monorepo packages from sharedOptimizeDeps and added various dayjs locales for better localization support.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 chore: update @lobehub/ui dependency to version 5.4.0 in package.json
Signed-off-by: Innei <tukon479@gmail.com>
* 🐛 fix: correct SkillsApiName.runSkill to activateSkill and update trimmed content assertions
* 🐛 fix: resolve type errors in context-engine tests and InputEditor slashPlacement
* 🐛 fix: update runSkill to activateSkill in conversationLifecycle test
* 🐛 fix: avoid regex backtracking in placeholder parser
* ✨ feat(localization): add action tags and tooltips for slash commands across multiple languages
Signed-off-by: Innei <tukon479@gmail.com>
* 🐛 fix: preserve file attachments when /newTopic has no text content
* cleanup
Signed-off-by: Innei <tukon479@gmail.com>
---------
Signed-off-by: Innei <tukon479@gmail.com>
* fix command issue
* add run command UI
* fix API key
* add apikey page
* add apikey
* 🐛 fix: update apiKey model tests to use new sk-lh- prefix format
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* fix cli alias
* 🐛 fix(cli): fix gen text non-streaming mode and streaming SSE parsing
- Add `responseMode: 'json'` for non-streaming requests to get plain JSON instead of SSE
- Fix streaming SSE parser to handle LobeHub's JSON string format (e.g. `"Hello"`)
- Support both OpenAI and Anthropic response formats in non-streaming mode
- Add E2E tests for all generate commands (text, list, tts, asr, alias)
- Update skills knowledge.md docs with new kb commands
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* ✨ feat(cli): unify skill install command and add e2e tests
Merge import-github/import-url/import-market into a single `skill install <source>` command with auto-detection (GitHub URL/shorthand, ZIP URL, or marketplace identifier). Add alias `skill i`. Add comprehensive e2e and unit tests for skill commands.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* 🔨 chore: fix linter formatting in memory e2e test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* 🐛 fix: add vitest-environment node declaration to aiProvider test
Fix server-side env variable access error by declaring node environment.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix cli review
* fix test
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* ✨ feat(openapi): add API key hash support for secure storage
* ✨ feat(openapi): enhance message translation and knowledge base functionality
- Added MessageTranslationController and associated routes for managing message translations, including fetching, creating, updating, and deleting translations.
- Introduced KnowledgeBaseController with routes for CRUD operations on knowledge bases, including file management and access control.
- Updated existing message and translation routes to improve structure and naming consistency.
- Refactored related services and types to support new features and ensure type safety.
This update enhances the API's capabilities for handling message translations and knowledge base management, improving overall functionality and user experience.
* fix: allow OWNER scope to list agents in agents route
- Add OWNER scope to AGENT_READ permission check
- Aligns list behavior with AgentService.queryAgents ownership filter
- Allows owner-scoped users to list their own agents
* 🔧 refactor(rbac): improve import structure in rbac.ts
- Changed import statements to separate type imports from regular imports for better clarity and organization.
- This refactor enhances code readability and maintains consistency in the import structure.
* fix: 修复 chunk 服务与 async router 的循环依赖
- 将 createAsyncCaller 的静态导入改为动态导入 (await import)
- 打破 file.ts -> chunk/index.ts -> async/index.ts 的循环依赖链
- 使用 --skip-dynamic-imports 参数的 dpdm 验证循环依赖已解决
* 🐛 fix: resolve CI failures
* test: 补充 apiKey、KeyVaultsEncrypt、ChunkService 单测至 100% 覆盖率
- test(database): 补充 apiKey.ts query() 解密失败分支测试
- test(server): 补充 KeyVaultsEncrypt 非法密钥/密文格式 getUserKeyVaults 测试
- test(server): 新增 ChunkService 完整测试覆盖异步任务创建/触发/失败回写
所有新增测试通过 (46/46),目标文件覆盖率均达 100%
* ✨ feat: add electron page tabs functionality
Implement browser-style page tabs in the Electron titlebar:
- Add TabBar component with explicit tab creation via context menu (desktop only)
- Tab creation triggers: TopicItem/PageItem context menu "Open in New Tab" or double-click
- TabBar only visible when tab count >= 2
- Update active tab's reference when navigating within it (tab follows user navigation)
- Reuse existing plugin system (pluginRegistry, 11 page plugins, PageReference types)
- Persist tabs to localStorage with automatic recovery on restart
- Apply logic to TopicItem (agent & group) and PageItem
Changes:
- src/store/electron/actions/tabPages.ts: New store slice with tab state + actions
- src/features/Electron/titlebar/TabBar/: New UI component + storage + hooks
- src/features/Electron/navigation/: New useTabNavigation hook + extracted cachedData helper
- src/app/.../Topic/List/Item/: Double-click creates tab, context menu "Open in New Tab"
- src/app/.../page/.../Item/: Double-click creates tab, context menu "Open in New Tab"
- i18n: New keys in topic.ts and file.ts namespaces
* ✨ feat: enhance agent topic plugin and tab resolution logic
- Added a new line to ensure the cached title is included when resolving tabs in the useResolvedTabs hook.
- Minor adjustment in the agentTopicPlugin to improve code clarity.
These changes improve the handling of cached titles in the tab resolution process and enhance the overall functionality of the agent topic plugin.
Signed-off-by: Innei <tukon479@gmail.com>
* ✨ feat: enhance agent and conversation handling in PageEditor
- Refactored PageAgentProvider to eliminate direct pageAgentId prop, improving context management.
- Updated Conversation and Copilot components to utilize conversation state for agent selection, ensuring better handling of chat-group session IDs.
- Adjusted FileCopilot to synchronize active agent ID with conversation context, enhancing file interaction capabilities.
These changes streamline agent management and improve the overall user experience in the PageEditor feature.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 chore: update ESLint suppressions for chat service [skip ci]
- Removed the suppression for `object-shorthand` in `src/services/chat/index.ts` to improve code quality.
- Adjusted the ESLint suppressions in `eslint-suppressions.json` for better linting consistency.
These changes enhance the linting process by ensuring adherence to coding standards in the chat service files.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 chore: optimize NavigationBar panel width handling
* ✨ feat: add tab context menu with close actions
Add right-click context menu on tab items:
- Close current tab
- Close other tabs
- Close tabs to the left (disabled on first tab)
- Close tabs to the right (disabled on last tab)
* 🐛 fix: defer single-click navigation on desktop to prevent double-click addTab race
* ✨ feat: implement onActivate method for RecentlyViewed plugins to manage store state transitions
- Added onActivate method to RecentlyViewedPlugin interface for handling tab activations.
- Updated agentPlugin and agentTopicPlugin to switch topics based on tab activation.
- Enhanced PluginRegistry to notify plugins on tab activation.
- Modified TabBar to trigger onActivate when a tab is activated.
- Improved AgentIdSync to preserve topic state during agent switches.
Signed-off-by: Innei <tukon479@gmail.com>
* refactor: update test for BackendProxyProtocolManager to throw on upstream fetch failure
- Changed test description to reflect behavior change from returning a 502 status to throwing an error.
- Updated test implementation to use expect().rejects.toThrow for handling fetch errors.
Signed-off-by: Innei <tukon479@gmail.com>
* refactor: use optional chaining for agent configuration properties
- Updated agent configuration properties to use optional chaining for safer access.
- This change prevents potential runtime errors when properties are undefined.
Signed-off-by: Innei <tukon479@gmail.com>
* refactor: optimize navigation handling in TabBar with startTransition
- Introduced startTransition for navigation updates to improve performance and user experience.
- Updated handleActivate, handleCloseOthers, handleCloseLeft, and handleCloseRight methods to use startTransition for routing.
- Enhanced code readability by grouping navigation logic within startTransition.
Signed-off-by: Innei <tukon479@gmail.com>
---------
Signed-off-by: Innei <tukon479@gmail.com>
* chore: align agent rename usage with agent profile editor
* fix: agent content emoji picker popupProps
* chore: agent and agent group use emoji background color in session list
* chore: remove fixed popupProps
* 🌐 chore: translate non-English comments to English in src/libs
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* 🐛 fix: update test to match translated error message
---------
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: arvinxx <arvinx@foxmail.com>