♻️ refactor: migrate AI Rules to Claude Code Skills system
Migrate all AI Rules from .cursor/rules/ to .agents/skills/ directory:
- Move 23 skills to .agents/skills/ (main directory)
- Update symlinks: .claude/skills, .cursor/skills, .codex/skills
- Create project-overview skill from project documentation
- Add references/ subdirectories for complex skills
- Remove LobeChat references from skill descriptions
- Delete obsolete .cursor/rules/ and .claude/commands/prompts/ directories
Skills structure enables better portability and maintainability across AI tools.
* 🐛 fix(pdf): ensure worker config before Document render
Fixes "No GlobalWorkerOptions.workerSrc specified" error in TurboPack by:
- Creating unified pdfjs module that ensures worker config at render time
- Wrapping Document component to call ensureWorker() before render
- Removing side-effect imports that may be optimized away by bundler
Closes LOBE-4108
* 📝 docs: clarify Linear issue management trigger conditions
* 🐛 fix(pdf): upgrade pdfjs-dist and react-pdf to v5.x
Resolves: LOBE-2658
- Upgrade pdfjs-dist from 4.x to 5.4.530
- Upgrade react-pdf from 9.x to 10.3.0
- Fix PDF worker loading using import.meta.url pattern
- Add @napi-rs/canvas dependency for react-pdf renderer
- Fix typo: ResouceManagerMode → ResourceManagerMode
- Clean up meaningless comments in ListItem component
- Simplify next config by removing unused isDesktop logic
* chore: update claude
Signed-off-by: Innei <tukon479@gmail.com>
* 🐛 fix(pdf): update PDF version in snapshots to 5.4.530
- Updated pdfVersion in PDF loader snapshots to reflect the new version 5.4.530.
Signed-off-by: Innei <tukon479@gmail.com>
* ✨ feat(file-loaders): implement lazy loading for file loaders
- Refactored file loader imports to use dynamic loading, improving performance by preventing heavy dependencies from being loaded until needed.
- Introduced `getFileLoader` function to manage loader retrieval based on file type.
- Updated logging and fallback mechanisms for unsupported file types.
This change enhances the efficiency of file loading operations.
Signed-off-by: Innei <tukon479@gmail.com>
* ✨ feat(config): enhance next configuration for improved package handling
- Updated `nextConfig` to include `@napi-rs/canvas` and `pdfjs-dist` in `serverExternalPackages` to address bundling issues with Turbopack.
- Removed unused `isDesktop` logic and simplified the configuration structure.
- Adjusted `transpilePackages` to exclude `pdfjs-dist`, reflecting recent upgrades.
This change optimizes the configuration for better compatibility and performance.
Signed-off-by: Innei <tukon479@gmail.com>
* 🐛 fix: use CDN pdfjs worker
---------
Signed-off-by: Innei <tukon479@gmail.com>
* ♻️ refactor(ModelSwitchPanel): migrate from Popover to DropdownMenu with virtual scrolling
- Replace Popover with DropdownMenu atom components from @lobehub/ui
- Add react-virtuoso for proper virtual scrolling implementation
- Auto-close submenu when scrolling to prevent position offset issues
- Rename misleading "Virtual*" naming to "List*" for clarity
LOBE-3844
* 🔨 chore: clean up unnecessary comments in ModelSwitchPanel
* 🔨 chore(router): remove unused loader property from route configuration
Signed-off-by: Innei <tukon479@gmail.com>
---------
Signed-off-by: Innei <tukon479@gmail.com>
* ✨ feat: Add browser compatibility detection and fallback page
- Add automatic browser compatibility check in app layout
- Create standalone not-compatible.html fallback page with modern responsive design
- Support dark mode via prefers-color-scheme
- Include browser download links (Chrome, Firefox, Edge, Safari, Arc)
- Display minimum browser requirements
- Update feature development documentation
* 📝 docs(CLAUDE): Update PR Linear Issue Association guidelines
- Clarify the requirement to include magic keywords in PR body for Linear issues.
- Add instruction to summarize work done in the Linear issue comment and update the issue status to "In Review".
Signed-off-by: Innei <tukon479@gmail.com>
* ✨ feat: Update browser compatibility page and layout
- Change favicon link to absolute path in not-compatible.html.
- Add Safari browser support with corresponding icon and link.
- Update minimum browser requirements to Chrome 99+, Safari 16.4+, and Edge 99+.
- Fix typo in layout.tsx comments from "serveral" to "several".
Signed-off-by: Innei <tukon479@gmail.com>
---------
Signed-off-by: Innei <tukon479@gmail.com>
* 🐛 fix: add separate border-radius for bottom-right corner on macOS 26 Chrome
Fix issue where the main container's bottom-right corner radius was not applied correctly on macOS 26 Chrome.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 📝 docs(CLAUDE): add PR Linear Issue Association guidelines
Include a new section in CLAUDE.md outlining the requirement to use magic keywords in PR bodies for associating with Linear issues, enhancing clarity on issue tracking.
Signed-off-by: Innei <tukon479@gmail.com>
---------
Signed-off-by: Innei <tukon479@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
* 🐛 fix: fix desktop test cases and refactor translations
- Import translations from default locale instead of hardcoding
- Fix macOS menu test expectations to match actual translations
- Update I18nManager test to match implementation (fallbackLng: 'en')
- Support {{appName}} interpolation in test mocks
* 🐛 fix: add missing buildAndSetAppMenu calls in tests
* 🐛 fix(desktop): add token refresh retry mechanism
- Add `async-retry` library for exponential backoff retry
- Implement retry logic in RemoteServerConfigCtr.refreshAccessToken()
- Retries up to 3 times with exponential backoff (1s, 2s, 4s)
- Distinguishes between retryable (network) and non-retryable (invalid_grant) errors
- Update AuthCtr to only clear tokens for non-retryable errors
- Transient errors now preserve tokens for retry on next cycle
- Add isNonRetryableError() helper method
This fixes the issue where temporary network problems would cause
users to be logged out and require re-authorization.
Closes LOBE-1368
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* update
* 🐛 fix: treat deterministic failures as non-retryable errors
Add deterministic failures to non-retryable error list:
- 'No refresh token available' - refresh token missing from storage
- 'Remote server is not active or configured' - config invalid/disabled
- 'Missing tokens in refresh response' - server returned incomplete response
These permanent failures now trigger immediate token clearing and
authorizationRequired broadcast instead of infinite retry loop.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 📝 docs: clarify issue status workflow - use "In Review" after PR creation
- Change workflow to set status to "In Review" when PR is created
- "Done" status should only be set after PR is merged
- Add note about Linear-GitHub integration for auto status update
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 🐛 fix: add grace period for consumed RefreshToken
When rotateRefreshToken is enabled, the old refresh token is consumed
when a new one is issued. If the client fails to receive/save the new
token (network issues, crashes), the login state is lost.
This adds a 3-minute grace period allowing consumed refresh tokens to
be reused, giving clients a chance to retry the refresh operation.
Changes:
- Add REFRESH_TOKEN_GRACE_PERIOD_SECONDS constant (180s)
- Modify find() to allow RefreshToken reuse within grace period
- Add unit tests for grace period behavior
Closes LOBE-1369
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 📝 style: translate adapter test descriptions to English
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* update
* ✅ test(database): add ThreadModel unit tests
Add comprehensive unit tests for ThreadModel covering:
- create: thread creation with various parameters
- query: fetch all threads for user
- queryByTopicId: fetch threads by topic
- findById: retrieve thread by id
- update: update thread properties
- delete: delete single thread
- deleteAll: delete all user threads
- User isolation tests for security
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* ✅ test(database): add EmbeddingModel unit tests
Add comprehensive unit tests for EmbeddingModel covering:
- create: create new embedding for a chunk
- bulkCreate: batch create embeddings with conflict handling
- delete: delete embedding by id
- query: fetch all user embeddings
- findById: retrieve embedding by id
- countUsage: count total embeddings for user
- User isolation tests for security
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* ✅ test(database): add OAuthHandoffModel unit tests
Add comprehensive unit tests for OAuthHandoffModel covering:
- create: create OAuth handoff with conflict handling
- fetchAndConsume: fetch and delete credentials with TTL check
- cleanupExpired: delete expired records (>5 min old)
- exists: check credential existence without consuming
- Expiration validation for 5-minute TTL
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* ✅ test(database): add UserModel unit tests
Add comprehensive unit tests for UserModel covering:
- getUserRegistrationDuration: calculate user registration duration
- getUserState: get user state with settings and decryption
- getUserSSOProviders: get linked SSO providers
- getUserSettings: retrieve user settings
- updateUser: update user properties
- deleteSetting: delete user settings
- updateSetting: create/update user settings (upsert)
- updatePreference: merge and update user preferences
- updateGuide: update user guide preferences
Static methods:
- makeSureUserExist: ensure user exists
- createUser: create new user with duplicate check
- deleteUser: delete user by id
- findById: find user by id
- findByEmail: find user by email
- getUserApiKeys: get decrypted API keys
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* ✅ test(database): add missing DocumentModel tests
Add tests for uncovered DocumentModel methods:
- create: create new document
- delete: delete document by id with user isolation
- deleteAll: delete all user documents
- query: query all documents with ordering
- findById: find document by id with user isolation
- update: update document with user isolation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* ✅ test(database): add user isolation tests for AgentModel
Add user isolation security tests to ensure users cannot access or modify
other users' knowledge base and file associations.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 🐛 fix(database): fix flaky document ordering test
Add 50ms delay before update to ensure timestamp difference for ordering test.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>