* refactor: client ipc
* refactor: server ipc
refactor: update IPC method names for consistency
Signed-off-by: Innei <tukon479@gmail.com>
fix: cast IPC return type to DesktopIpcServices for type safety
Signed-off-by: Innei <tukon479@gmail.com>
chore: add new workspace for desktop application in package.json
Signed-off-by: Innei <tukon479@gmail.com>
fix: export FileMetadata interface for improved accessibility
Signed-off-by: Innei <tukon479@gmail.com>
refactor: unify IPC mocking across test files for consistency
Signed-off-by: Innei <tukon479@gmail.com>
feat: enhance type-safe IPC flow with context propagation and service registry
- Introduced `getIpcContext()` and `runWithIpcContext()` for improved context management in IPC handlers.
- Updated `BrowserWindowsCtr` methods to utilize the new context handling.
- Added `McpInstallCtr` to the IPC constructors registry.
- Enhanced README with details on the new type-safe IPC features.
Signed-off-by: Innei <tukon479@gmail.com>
refactor: enhance IPC method registration for improved type safety
- Updated `registerMethod` in `IpcHandler` and `IpcService` to accept variable argument types, enhancing flexibility in method signatures.
- Simplified the `ExtractMethodSignature` type to support multiple arguments.
Signed-off-by: Innei <tukon479@gmail.com>
chore: add global type definitions and refactor import statements
- Introduced a new global type definition file to support Vite client imports.
- Refactored import statements in `App.ts` and `App.test.ts` to remove unnecessary type casting for `import.meta.glob`, improving code clarity.
Signed-off-by: Innei <tukon479@gmail.com>
* refactor: make groupName in BrowserWindowsCtr readonly for better encapsulation
Signed-off-by: Innei <tukon479@gmail.com>
* refactor: update IPC method registration and usage for improved type safety and consistency
- Replaced `@ipcClientEvent` with `@IpcMethod()` in various controllers to standardize IPC method definitions.
- Enhanced the usage of `ensureElectronIpc()` for type-safe IPC calls in service layers.
- Updated `BrowserWindowsCtr` and `NotificationCtr` to utilize the new IPC method structure, improving encapsulation and clarity.
- Refactored service methods to eliminate manual string concatenation for IPC event names, ensuring better maintainability.
Signed-off-by: Innei <tukon479@gmail.com>
---------
Signed-off-by: Innei <tukon479@gmail.com>
* 🐛 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>
* ✅ test(desktop): improve test coverage for multiple modules
Add comprehensive unit tests for desktop app modules to improve overall test coverage from 29% toward 60%+:
- Preload Scripts: routeInterceptor, invoke, streamer, electronApi (49 tests)
- Menu System: macOS, windows, linux, BaseMenuPlatform (108 tests)
- Core UI (Tray): Tray, TrayManager, MenuManager (78 tests)
- Services: fileSearchSrv (21 tests)
- Utilities: file-system, logger (25 tests)
Total: 281 new test cases covering critical desktop functionality.
Closes LOBE-1215, LOBE-1216, LOBE-1217, LOBE-1218, LOBE-1219
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 🐛 fix(desktop): update test assertion to support co-located test files
The integration test for file search was failing because it expected all
test files to be in __tests__ directories, but some test files are now
co-located with their source files (e.g., src/preload/*.test.ts).
Updated the assertion to accept both patterns.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 📦 chore(desktop): add happy-dom to devDependencies
The routeInterceptor.test.ts uses @vitest-environment happy-dom for
browser API testing. Added happy-dom to desktop package devDependencies
to ensure CI can find the package.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
🌐 chore: translate non-English comments to English in networkProxy module
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
* 🌐 chore: translate non-English comments to English in desktop controllers
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 🧪 fix: update Desktop test expectations to match English error messages
- Updated TrayMenuCtr.test.ts to expect English error messages instead of Chinese
- Fixes failing tests after comment translation changes
- Changed '托盘通知仅在 Windows 平台支持' to 'Tray notifications are only supported on Windows platform'
- Changed '托盘功能仅在 Windows 平台支持' to 'Tray functionality is only supported on Windows platform'
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Arvin Xu <arvinxx@users.noreply.github.com>
---------
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Arvin Xu <arvinxx@users.noreply.github.com>
* upgrade next 16
* try to fix
* try to fix
* upgrade
* fix sitemap build
* try to fix build
* try to fix build with next 16
* fix docker permission
* 🔒 fix(ci): fix code injection vulnerability and permissions in docker workflow
- Add pull-requests: write permission to allow PR comments
- Fix code injection vulnerability by using env variables instead of direct interpolation
- Prevent potential security risks from malicious branch names in pull_request_target events
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 🔧 chore(ci): change desktop pr build to use pull_request_target
- Change from pull_request to pull_request_target to access secrets and write permissions
- Update permissions from read-all to specific write permissions for contents and pull-requests
- This allows PR builds to create releases and comment on PRs from forks
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* add comment
* fix on
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: change files page to spa
* feat: add height 100%
* fix: delete useless code
* feat: update files preview from severs to client
* feat: change download action to detail right place
* feat: change the dir name and the path
* feat: change the useNavigate to the router outer
* style: use flex 1 to get all width
* feat: update files?filesId to get files loading
* feat: change all files and repo url to knowledge url
* feat: close the knowledge/base settings page & update createNew onSuccess into Modal
* feat: update the knowledge base open judge
* feat: change discord page to spa
* fix: change locals
* feat: update router change
* fix: revert some files
* feat: add model provider detail page use link
* fix: add trpc back
* feat: update e2e timeout time
* feat: change discord page to spa
* fix: change locals
* feat: update router change
* fix: revert some files
* feat: add model provider detail page use link
* fix: add trpc back
* feat: update e2e timeout time
* fix: use reactrouter-dom link replace next link
✨ feat(desktop): add comprehensive Linux package format support
- Add rpm and tar.gz targets to electron-builder configuration
- Update GitHub Actions workflows to upload all Linux package formats
- Support for Ubuntu/Debian (.deb), Snap (.snap), RPM-based distributions (.rpm)
- Include universal tar.gz archives for maximum Linux distribution compatibility
- Ensure proper artifact collection and release publishing for all formats
This enables desktop app distribution across major Linux ecosystems including
Ubuntu, CentOS, openSUSE, Arch Linux, and Chinese domestic OS like UOS and Kylin.