文件最后提交记录最后更新时间
chore: clean up LOBE-XXX code annotations (#15135) * chore: clean up LOBE-XXX annotations from codebase comments - Remove 【LOBE-XXX】 bracket markers - Remove LOBE-XXXX references from inline comments - Clean up test descriptions containing LOBE identifiers - Preserve linear.app URLs and code-level regex patterns - Generated: 2026-05-23 02:30:09 * 🐛 fix(tests): restore () in arrow callbacks broken by annotation cleanup The LOBE-XXX annotation cleanup script over-matched `(LOBE-XXXX', () =>` and stripped the callback `()`, leaving invalid syntax like `describe(..., => {` and `it(..., async => {` across 24 test files. This caused parse failures in Test Packages, Test Desktop App, Test Database lint, and Test App shard runs. Restoring `()` / `async ()` unblocks the suites while keeping the ticket-text cleanup intact. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(hintFormat-test): restore label + ellipsis in stripMarkdownLinks fixture The annotation cleanup stripped `LOBE-8516` from a markdown-link's *label* (`[LOBE-8516](/task/T-1)` → `[](/task/T-1)`), which then survived `stripMarkdownLinks` because the pattern requires non-empty link text — the test expected the link to disappear and asserted equality on a LOBE-free output. The same line also lost a `.` from the trailing `...` indicator in both input and expected strings. Substitute a neutral Chinese label (`发布计划`) so the link continues to exercise the multi-link substitution path, and restore the full `...` ellipsis. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Arvin Xu <arvinxx@lobehub.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>20 小时前
♻️ refactor(local-file-shell): sink desktop search modules into shared package (#14972) * ♻️ refactor(local-file-shell): sink desktop contentSearch + fileSearch modules Move the entire `apps/desktop/src/main/modules/contentSearch/` and `apps/desktop/src/main/modules/fileSearch/` trees into the shared `@lobechat/local-file-shell` package so desktop, CLI, and cloud-sandbox runtimes share one platform-aware implementation instead of maintaining parallel copies that drift apart (the `.github/workflows/*.yml` hidden-segment bug fixed in #14965 had to be patched in two places). What moves - `contentSearch/{base,impl/{unix,linux,macOS,windows},index}.ts` → factory `createContentSearchImpl()` with rg → ag → grep → nodejs fallback - `fileSearch/{base,types,impl/{unix,linux,macOS,windows},index}.ts` → factory `createFileSearchModule()` with fd → find → fast-glob (Unix), mdfind override on macOS, fd → PowerShell → fast-glob on Windows - All 7 corresponding test files Abstractions introduced - `src/logger.ts`: `Logger` interface + debug-backed `createDefaultLogger` (namespace `lobe-local-file-shell:*`) and a `setLoggerFactory()` escape hatch so desktop can keep routing through electron-log if it wants - `src/toolDetector.ts`: minimal `ToolDetector` interface (`getBestTool(category): Promise<string|null>` only) — desktop's `ToolDetectorManager` already satisfies it structurally and is injected lazily via `setToolDetector()` Type-source consolidation - `GrepContentParams/Result`, `GlobFilesParams/Result` now live in `@lobechat/local-file-shell/types`; `@lobechat/electron-client-ipc` re-exports them so the IPC contract, the desktop service, and the CLI share one source of truth (with legacy aliases `cwd`, `filePattern`, `directory` kept for back-compat) Desktop services collapse to thin adapters - `contentSearchSrv.ts` / `fileSearchSrv.ts` now just delegate to the factories; the old `apps/desktop/src/main/modules/contentSearch/` and `fileSearch/` directories are deleted entirely (≈4000 LoC removed) Legacy `globLocalFiles` / `grepContent` / `searchLocalFiles` thin functions keep their existing lightweight fast-glob / spawned-rg implementations (unchanged semantics for CLI + cloud-sandbox callers), but now share the `hasHiddenSegment` helper with the factory so dot-segment fixes only need to be applied once. Tests - local-file-shell: 167/167 - desktop services: 58/58 - CLI file: 7/7 - builtin-tool-local-system: 64/64 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(local-file-shell): route sunk search logs through desktop's electron-log Reviewer caught a regression: after #14972 sank `contentSearch` and `fileSearch` into `@lobechat/local-file-shell`, the package's default debug-only logger took over — so search warnings/errors no longer landed in the electron-log file that users attach for support. The desktop `setLoggerFactory()` was defined but never called. Two-part fix: 1. `local-file-shell/logger.ts` — the `Logger` returned by `createLogger()` is now a thin proxy that re-resolves the current factory on every method call (with a per-namespace cache). This means `setLoggerFactory()` works even after module-level `const logger = createLogger('...')` declarations have already run — important because `local-file-shell`'s search modules are imported (and their loggers created) before the desktop bootstrap finishes. 2. `apps/desktop/src/main/utils/logger.ts` — calls `setLoggerFactory(createLogger)` as a module-load side effect, so anyone importing `@/utils/logger` (which App.ts does) automatically rewires the package logger into electron-log. Tests: 169/169 in local-file-shell (added `logger.test.ts` covering the late-bind and cache-per-namespace behaviour); desktop services 58/58. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ♻️ refactor(electron-client-ipc): keep package leaf — declare grep/glob types locally Reviewer feedback: `@lobechat/electron-client-ipc` is an IPC contract package and shouldn't reverse-depend on the business package `@lobechat/local-file-shell` just to share four type aliases. Declare them locally instead — the two copies must stay structurally compatible (they describe the same IPC payload either way), but the dependency arrow now points only one direction. Changes - `electron-client-ipc/src/types/localSystem.ts` — re-declare GrepContentParams, GrepContentResult, GlobFilesParams, GlobFilesResult locally - `electron-client-ipc/package.json` — drop the `@lobechat/local-file-shell` dependency - `local-file-shell/types.ts` — tighten `success` and `total_files`/ `total_matches` from optional to required so the two type definitions stay structurally interchangeable (the IPC version had them required all along) - `local-file-shell/file/glob.ts` + `grep.ts` — thin wrappers fill in the now- required `engine` / `success` / `total_files` / `total_matches` fields Tests: local-file-shell 169/169, desktop services 58/58, CLI 7/7. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 天前
✨ feat(desktop): embed CLI in app and PATH install (#13669) * ✨ feat(desktop): embed CLI in app and PATH install Made-with: Cursor * ✨ feat(desktop): add CLI command execution feature and UI integration - Implemented `runCliCommand` method in `ElectronSystemService` to execute CLI commands. - Added `CliTestSection` component for testing CLI commands within the app. - Updated `SystemCtr` to include CLI command execution functionality. - Enhanced `generateCliWrapper` to create short aliases for CLI commands. - Integrated CLI testing UI in the system tools settings page. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: enhance working directory handling for desktop - Updated working directory logic to prioritize topic-level settings over agent-level. - Introduced local storage management for agent working directories. - Modified tests to reflect changes in working directory behavior. - Added checks to ensure working directory retrieval is only performed on desktop environments. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(desktop): implement CLI command routing and cleanup - Introduced `CliCtr` for executing CLI commands, enhancing the desktop application with CLI capabilities. - Updated `ShellCommandCtr` to route specific commands to `CliCtr`, improving command handling. - Removed legacy CLI path installation methods from `SystemCtr` and related services. - Cleaned up localization files by removing obsolete entries related to CLI path installation. Signed-off-by: Innei <tukon479@gmail.com> * 🚸 settings(system-tools): show CLI embedded test only in dev mode Made-with: Cursor --------- Signed-off-by: Innei <tukon479@gmail.com>1 个月前