Commit graph

106 commits

Author SHA1 Message Date
aheizi
c7ac0c5db5
Support project level mcp (#1841)
* support project-level mcp config

* switch the toasts to English

fix test

(cherry picked from commit 26941dcaae)

* add i18n for project mcp

(cherry picked from commit 792a8225c1)

* optimize McpHub.ts

* fix merge main into head

* fix project mcp

* partial update mcp config

* fix toggleToolAlwaysAllow

* Modify mcp to support project and global of the same name

* fix ut

* remove unused mcp log

* i18n for mcp

* Revert README changes

---------

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-03-27 00:23:39 -04:00
Rian Santos
809e8cd6bc
#906 - Add watchPaths option to McpHub for file change detection (#1755)
* #906 Add watchPaths option to McpHub for file change detection

* #906 Refactor file watcher management in McpHub

add support multiple watchers per server.

modified the setupFileWatcher method to properly handle asynchronous operations and prevent unhandled promise rejections.

error handling now includes specific error messages that identify exactly where the error occurred.

---------

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-03-24 15:33:30 -04:00
KJ7LNW
953a9c777a
refactor: align tree-sitter output with other tools (#1859)
Use compact line number format matching read_file/search_files to:
- Reduce token usage in AI responses
- Simplify output parsing

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-24 13:59:18 -04:00
Steven T. Cramer
8ad4fff0d2
Removed hardcoded filenames to GlobalFileNames constants. (#1904)
* Replace hardcoded custom modes filename with GlobalFileNames constant

* Remove 'cline' prefix from mcpSettings filename

* Use GlobalFileNames.customModes in modes.ts

* replace two more `cline_mcp_settings` with `mcp_settings` in tests.

* feat: add settings file migration for new file naming convention

- Implement migrateSettings function to rename legacy settings files to new format
- Migrate cline_custom_modes.json to new custom modes filename
- Migrate cline_mcp_settings.json to new MCP settings filename
- Add TODO to remove migration code in September 2025 (6 months after implementation)
- Make activate function async to support migration on startup

* Add associated changeset

* removed unused import

* refactor: move migrateSettings to dedicated utility file

- Extract migrateSettings function from extension.ts to src/utils/migrateSettings.ts
- Update extension.ts to import and use the extracted function
- Update tests to use the real implementation
- Improve dependency injection by passing outputChannel as parameter
- Enhance maintainability by isolating temporary migration code (to be removed Sept 2025)

* Update src/extension.ts

---------

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-03-24 13:32:44 -04:00
KJ7LNW
187979af2b
feat: add test declarations support in typescript tree-sitter queries (#1899)
Add parsing support for:
- Jest describe/test/it blocks
- npm test exports

This enables proper identification of test definitions in TypeScript files:

```
// File: multi-search-replace.test.ts (192 definitions)
│| 2 - 1565 ||describe("MultiSearchReplaceDiffStrategy", () => {
│| 3 - 632 ||	describe("exact matching", () => {
│| 10 - 28 ||		it("should replace matching content", async () => {
||    ||----
│| 30 - 48 ||		it("should match content with different surrounding whitespace", async () => {
||    ||----
│| 50 - 68 ||		it("should match content with different indentation in search block", async () => {
||    ||----
│| 70 - 88 ||		it("should handle tab-based indentation", async () => {
||    ||----
```

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-24 13:32:18 -04:00
Matt Rubens
4f6dd74c29
Sort file search results shortest to longest (#1849) 2025-03-20 14:21:27 -04:00
Matt Rubens
dca4563b9a
Fixes to file search (#1846) 2025-03-20 12:14:32 -04:00
aheizi
6bc81c2a0e
fix mcp stderr log (#1830) 2025-03-20 09:12:36 -04:00
KJ7LNW
9fadd3dbe2
fix: ripgrep search result handling and formatting (#1831)
Problem:
- Previous implementation incorrectly grouped context lines with matches
- Context lines were split into beforeContext/afterContext arrays, making it difficult to maintain proper line order
- Output format was inconsistent with read_file output
- Non-contiguous search results were sometimes broken or incorrectly grouped
- Example of incorrect output:
  # bench/bundle-test/rollup.config.mjs
   16 |       file: 'dist/index-wasm.min.mjs',
   17 |       format: 'es',
   24 |     output: {
  ----
   25 |       file: 'dist/index-lite.min.mjs',
   26 |       format: 'es',
  ----

  # packages/rehype/package.json
  ----
   10 | it('run', async () => {
   27 |   "files": [
   28 |     "dist"
  ----

Solution:
- Replace separate context arrays with a single 'lines' array containing both matches and context
- Add isMatch flag to distinguish between match and context lines
- Improve contiguity detection by checking if line numbers are sequential
- Standardize output format to match read_file output
- Properly handle non-contiguous search results by creating new result groups
- Example of correct output:
  # bench/bundle-test/rollup.config.mjs
   16 |       file: 'dist/index-wasm.min.mjs',
   17 |       format: 'es',
  ----
   24 |     output: {
   25 |       file: 'dist/index-lite.min.mjs',
   26 |       format: 'es',
  ----

This change ensures search results are properly grouped and displayed with the correct context.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-20 09:10:22 -04:00
Sam Hoang Van
70a476e722
feat read file range (#1440)
* feat read file range

feat: add file truncation with code structure preview

Add configurable line limit for large file handling with source code structure preview. This improves performance and memory usage while maintaining code readability.

Key changes:

Add maxReadFileLine setting (default: 4500) with UI controls
Create efficient line counter utility using streams
Add parseSourceCodeDefinitionsForFile for single file parsing
Show truncation notice with code structure for large files
Add comprehensive tests for new functionality
Move file extensions to shared constant

add line number

pr comment

Return definition ranges from tree-sitter

make treesitter always add line

add line number to rg search

enhance tree siter output & fix test

update snapshot

fix test

* Add translations, tweak range

---------

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-03-20 00:55:47 -04:00
Matt Rubens
f181da1454
Move context-mention file/folder search to the server (#1824) 2025-03-20 00:45:27 -04:00
Matt Rubens
2267cad93d
Revert "Merge pull request #1618 from aheizi/support_project_mcp" (#1784)
This reverts commit df80e9620d, reversing
changes made to dc302f72c2.
2025-03-18 16:10:12 -04:00
Matt Rubens
38655825d4
Extension-side internationalization (#1757)
* Extension-side internationalization

* Update script

* Cleaner esbuild

* Turn off debugging

* PR feedback

* Update src/i18n/locales/en/common.json

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* Update src/i18n/locales/ca/common.json

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-03-18 10:39:21 -04:00
aheizi
8f4145efd2 optimize McpHub.ts 2025-03-17 23:57:59 +08:00
aheizi
c948e811db Merge branch 'main' into support_project_mcp
# Conflicts:
#	src/services/mcp/McpHub.ts
2025-03-17 23:37:20 +08:00
aheizi
1f200882d0 fix test 2025-03-17 17:30:38 +08:00
aheizi
47747d67c2 validate server config 2025-03-17 17:30:37 +08:00
aheizi
e2182eb64f fix initializeMcpServers 2025-03-17 17:30:37 +08:00
aheizi
362359cc3c fix ut
(cherry picked from commit b4f808d7dc)
2025-03-17 14:41:18 +08:00
aheizi
3975c8d8a9 replace eventsource with reconnecting-eventsource to optimize the code.
(cherry picked from commit 505f86d75c)
2025-03-17 14:39:48 +08:00
aheizi
78b3130c93 remove rejectUnauthorized
(cherry picked from commit 5e788fc5f1)
2025-03-17 14:39:06 +08:00
aheizi
a7eac55a2b simpler way of setting up
(cherry picked from commit f13d28ad45)
2025-03-17 14:37:59 +08:00
aheizi
5a491672c4 add sseOptions
(cherry picked from commit f9a1cd0b52)
2025-03-17 14:37:14 +08:00
aheizi
a77be3feb7 feat: add sse mcp support
(cherry picked from commit 549b06f46d)
2025-03-17 14:36:28 +08:00
aheizi
c201baa4d1 fix mcp connection 2025-03-17 12:05:23 +08:00
aheizi
26941dcaae switch the toasts to English
fix test
2025-03-15 18:39:39 +08:00
aheizi
f77606996f Merge branch 'main' into support_project_mcp 2025-03-14 20:59:21 +08:00
aheizi
5d8a456374 Merge branch 'main' into support_project_mcp 2025-03-14 20:48:47 +08:00
Matt Rubens
b29f94ae65
Revert "feat: add sse mcp support" 2025-03-13 13:00:32 -04:00
aheizi
4106ca4a19 support project-level mcp config 2025-03-13 21:07:24 +08:00
aheizi
505f86d75c replace eventsource with reconnecting-eventsource to optimize the code. 2025-03-12 19:25:50 +08:00
aheizi
5e788fc5f1 remove rejectUnauthorized 2025-03-12 01:11:22 +08:00
aheizi
29aa464ce3 Merge remote-tracking branch 'origin/main' into feature/add_sse_mcp 2025-03-11 23:06:12 +08:00
Matt Rubens
6cfc1cd4c9
Merge pull request #1528 from afshawnlotfi/chrome-remote-webtools
Chrome remote webtools
2025-03-10 21:37:20 -04:00
Afshawn Lotfi
ce3e22ecfe Refactor Docker gateway IP retrieval to use a dedicated shell command execution function 2025-03-10 21:40:08 +00:00
aheizi
f13d28ad45 simpler way of setting up 2025-03-11 00:50:27 +08:00
Matt Rubens
89b8b10bba Merge remote-tracking branch 'origin/main' into feature/add_sse_mcp 2025-03-10 10:47:26 -04:00
aheizi
f9a1cd0b52 add sseOptions 2025-03-10 12:36:46 +08:00
Afshawn Lotfi
66e3b9610c Add remote browser connection support and related state management 2025-03-10 03:41:38 +00:00
Matt Rubens
9c08d044b3 Add telemetry for checkpoint save/restore/diff 2025-03-09 22:55:23 -04:00
Matt Rubens
85775ce0a5
Merge pull request #573 from Szpadel/fix-listing-exclude
Do not exclude whole project dir when listing in case where project i…
2025-03-09 21:59:54 -04:00
Matt Rubens
f4734dedb9
Merge pull request #721 from kohii/kotlin
feat: Add Kotlin support in list_code_definition_names
2025-03-09 21:49:54 -04:00
Afshawn Lotfi
22f51304a2 Add support for remote browser connection and settings 2025-03-09 20:11:52 +00:00
aheizi
b4f808d7dc fix ut 2025-03-09 01:26:10 +08:00
aheizi
549b06f46d feat: add sse mcp support 2025-03-09 00:15:23 +08:00
Matt Rubens
50f76584bc Add telemetry and privacy policy 2025-03-07 03:03:44 -05:00
cte
f685932d63 Fix tests 2025-03-06 11:31:08 -08:00
cte
1901a0dbfc Choose the correct checkpoint storage strategy when resuming tasks 2025-03-06 11:23:00 -08:00
cte
2325d8be46 Improve file excludes for checkpoints service 2025-03-06 00:52:28 -08:00
Matt Rubens
7e0e3d0f1f Add support for a .rooignore file 2025-03-05 10:17:43 -05:00