diff --git a/.changes/extensions/intellij/0.0.34.md b/.changes/extensions/intellij/0.0.34.md deleted file mode 100644 index d4dc58b80..000000000 --- a/.changes/extensions/intellij/0.0.34.md +++ /dev/null @@ -1,8 +0,0 @@ -## 0.0.34 - 2024-03-03 -### Added -* diff context provider -### Changed -* Allow LLM servers to handle templating -### Fixed -* Fix a few context providers / slash commands -* Fixed issues preventing proper extension startup diff --git a/.changes/extensions/intellij/0.0.38.md b/.changes/extensions/intellij/0.0.38.md deleted file mode 100644 index 6c42fc737..000000000 --- a/.changes/extensions/intellij/0.0.38.md +++ /dev/null @@ -1,4 +0,0 @@ -## 0.0.38 - 2024-03-15 -### Added -* Remote config server support -* Autocomplete support in JetBrains diff --git a/.changes/extensions/intellij/0.0.42.md b/.changes/extensions/intellij/0.0.42.md deleted file mode 100644 index dbcdd3fab..000000000 --- a/.changes/extensions/intellij/0.0.42.md +++ /dev/null @@ -1,7 +0,0 @@ -## 0.0.42 - 2024-04-12 -### Added -* Inline cmd/ctrl+I in JetBrains -### Fixed -* Fixed character encoding error causing display issues -* Fixed error causing input to constantly demand focus -* Fixed automatic reloading of config.json diff --git a/.changes/extensions/intellij/0.0.53.md b/.changes/extensions/intellij/0.0.53.md deleted file mode 100644 index bbc3605ec..000000000 --- a/.changes/extensions/intellij/0.0.53.md +++ /dev/null @@ -1,8 +0,0 @@ -## 0.0.53 - 2024-07-10 -### Added -* Support for .prompt files -* New onboarding experience -### Fixed -* Indexing fixes from VS Code versions merged into IntelliJ -* Improved codebase indexing reliability and testing -* Fixes for autocomplete text positioning and timing diff --git a/.changes/extensions/intellij/0.0.54.md b/.changes/extensions/intellij/0.0.54.md deleted file mode 100644 index 1f0e05f27..000000000 --- a/.changes/extensions/intellij/0.0.54.md +++ /dev/null @@ -1,6 +0,0 @@ -## 0.0.54 - 2024-07-13 -### Added -* Partial autocomplete acceptance -* Autocomplete status bar spinner -### Fixed -* Fixed duplicate completion bug and others diff --git a/.changes/extensions/intellij/0.0.69.md b/.changes/extensions/intellij/0.0.69.md deleted file mode 100644 index a4b67ca0c..000000000 --- a/.changes/extensions/intellij/0.0.69.md +++ /dev/null @@ -1,7 +0,0 @@ -## 0.0.69 - 2024-09-22 -### Added -* Support for the "search" context provider -### Fixed -* Fixed bug where only first module would be recognized -* Improved concurrency handling to avoid freezes -* Made compatible with latest JetBrains versions diff --git a/.changes/extensions/intellij/0.0.72.md b/.changes/extensions/intellij/0.0.72.md deleted file mode 100644 index 2e8962e43..000000000 --- a/.changes/extensions/intellij/0.0.72.md +++ /dev/null @@ -1,7 +0,0 @@ -## 0.0.72 - 2024-10-04 -### Added -* Listen for changes to Intellij settings without requiring window reload -### Changed -* Updated tutorial file -### Fixed -* Fix ability to load config.ts in JetBrains IDEs diff --git a/.changes/extensions/intellij/0.0.92.md b/.changes/extensions/intellij/0.0.92.md deleted file mode 100644 index 2d3774eec..000000000 --- a/.changes/extensions/intellij/0.0.92.md +++ /dev/null @@ -1,5 +0,0 @@ -## 0.0.92 - 2025-02-26 -### Fixed -* Off-screen rendering to solve white flash on load and lack of changing cursor type -* OSR-related fixes for non-Mac users -* Fixes for inline edit in JetBrains diff --git a/.changes/extensions/intellij/1.0.0.md b/.changes/extensions/intellij/1.0.0.md deleted file mode 100644 index 43ea4a0ed..000000000 --- a/.changes/extensions/intellij/1.0.0.md +++ /dev/null @@ -1,7 +0,0 @@ -## 1.0.0 - 2025-02-26 -### Added -* Introduces hub.continue.dev -* Improved theme matching -### Fixed -* Fixes interference between SonarQube and Continue autocomplete -* Numerous reliability improvements diff --git a/.changes/extensions/intellij/v0.0.1.md b/.changes/extensions/intellij/v0.0.1.md deleted file mode 100644 index 8cf2b6b68..000000000 --- a/.changes/extensions/intellij/v0.0.1.md +++ /dev/null @@ -1,5 +0,0 @@ -## v0.0.1 - 2023-09-01 - -### Added - -- Initial scaffold created from [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template) diff --git a/.changes/extensions/intellij/v0.0.19.md b/.changes/extensions/intellij/v0.0.19.md deleted file mode 100644 index 5d76c7d7e..000000000 --- a/.changes/extensions/intellij/v0.0.19.md +++ /dev/null @@ -1,5 +0,0 @@ -## v0.0.19 - 2023-11-19 - -### Changed - -- migrated to .json config file format diff --git a/.changes/extensions/intellij/v0.0.21.md b/.changes/extensions/intellij/v0.0.21.md deleted file mode 100644 index 7933cd1b4..000000000 --- a/.changes/extensions/intellij/v0.0.21.md +++ /dev/null @@ -1,5 +0,0 @@ -## v0.0.21 - 2023-12-05 - -### Added - -- updated to match latest VS Code updates diff --git a/.changes/extensions/intellij/v0.0.25.md b/.changes/extensions/intellij/v0.0.25.md deleted file mode 100644 index 67da2d004..000000000 --- a/.changes/extensions/intellij/v0.0.25.md +++ /dev/null @@ -1,5 +0,0 @@ -## v0.0.25 - 2023-12-25 - -### Changed - -- Intellij extension no longer relies on the Continue Python server diff --git a/.changes/extensions/intellij/v0.0.26.md b/.changes/extensions/intellij/v0.0.26.md deleted file mode 100644 index 1ef77ba62..000000000 --- a/.changes/extensions/intellij/v0.0.26.md +++ /dev/null @@ -1,5 +0,0 @@ -## v0.0.26 - 2023-12-28 -### Added -* auto-reloading of config on save -### Fixed -* Fixed /edit bug for versions without Python server diff --git a/.changes/extensions/vscode/0.8.14.md b/.changes/extensions/vscode/0.8.14.md deleted file mode 100644 index d42d9640c..000000000 --- a/.changes/extensions/vscode/0.8.14.md +++ /dev/null @@ -1,10 +0,0 @@ -## 0.8.14 - 2024-03-03 -### Added -* Image support -* Full-text search index for retrieval -* Docs context provider -* CodeLlama-70b support -### Changed -* config.ts only runs in NodeJS, not browser -### Fixed -* Fixed proxy setting in config.json diff --git a/.changes/extensions/vscode/0.8.15.md b/.changes/extensions/vscode/0.8.15.md deleted file mode 100644 index 0bee662f3..000000000 --- a/.changes/extensions/vscode/0.8.15.md +++ /dev/null @@ -1,3 +0,0 @@ -## 0.8.15 - 2024-03-05 -### Added -* Tab-autocomplete in beta diff --git a/.changes/extensions/vscode/0.8.24.md b/.changes/extensions/vscode/0.8.24.md deleted file mode 100644 index 62c32d5e5..000000000 --- a/.changes/extensions/vscode/0.8.24.md +++ /dev/null @@ -1,5 +0,0 @@ -## 0.8.24 - 2024-04-12 -### Added -* Support for improved retrieval models (Voyage embeddings/reranking) -* New @code context provider -* Personal usage analytics diff --git a/.changes/extensions/vscode/0.8.42.md b/.changes/extensions/vscode/0.8.42.md deleted file mode 100644 index 52bf46f18..000000000 --- a/.changes/extensions/vscode/0.8.42.md +++ /dev/null @@ -1,16 +0,0 @@ -## 0.8.42 - 2024-07-02 - -### Added - -- Support for Gemini 1.5 Pro -- Link to code in the sidebar when using codebase retrieval -- Smoother onboarding experience -- .prompt files, a way of saving and sharing slash commands -- Support for Claude 3.5 Sonnet, Deepseek Coder v2, and other new models -- Support for comments in config.json -- Specify multiple autocomplete models and switch between them -- Improved bracket matching strategy reduces noisy completions - -### Fixed - -- Numerous reliability upgrades to codebase indexing diff --git a/.changes/extensions/vscode/0.8.43.md b/.changes/extensions/vscode/0.8.43.md deleted file mode 100644 index ca3a4c9c6..000000000 --- a/.changes/extensions/vscode/0.8.43.md +++ /dev/null @@ -1,4 +0,0 @@ -## 0.8.43 - 2024-07-08 -### Added -* Improved indexing reliability and testing -* Quick Actions: use CodeLens to quickly take common actions like adding docstrings diff --git a/.changes/extensions/vscode/0.8.45.md b/.changes/extensions/vscode/0.8.45.md deleted file mode 100644 index bdeb5b698..000000000 --- a/.changes/extensions/vscode/0.8.45.md +++ /dev/null @@ -1,12 +0,0 @@ -## 0.8.45 - 2024-08-05 -### Added -* Support for Llama 3.1 and gpt-4o-mini -* Support for WatsonX+Granite models -### Changed -* Significant improvements to indexing performance -* Improved @codebase quality by more accurately searching over file names and paths -* Improved @codebase accuracy -* Further improvements to indexing performance -### Fixed -* Improved docs indexing and management -* Fixed Gemini embeddings provider diff --git a/.changes/extensions/vscode/0.8.46.md b/.changes/extensions/vscode/0.8.46.md deleted file mode 100644 index 176439b9e..000000000 --- a/.changes/extensions/vscode/0.8.46.md +++ /dev/null @@ -1,6 +0,0 @@ -## 0.8.46 - 2024-08-11 -### Added -* new /onboard slash command -### Fixed -* Fixed problem loading config.ts -* Fixed bug causing duplicate indexing work diff --git a/.changes/extensions/vscode/0.8.47.md b/.changes/extensions/vscode/0.8.47.md deleted file mode 100644 index 363081c3c..000000000 --- a/.changes/extensions/vscode/0.8.47.md +++ /dev/null @@ -1,8 +0,0 @@ -## 0.8.47 - 2024-08-27 -### Added -* Use headless browser for crawling to get better results -* TTS support in the chat window -### Changed -* Improved support for WatsonX models -### Fixed -* Fixed several small indexing bugs diff --git a/.changes/extensions/vscode/0.8.48.md b/.changes/extensions/vscode/0.8.48.md deleted file mode 100644 index 93e144168..000000000 --- a/.changes/extensions/vscode/0.8.48.md +++ /dev/null @@ -1,8 +0,0 @@ -## 0.8.48 - 2024-09-01 -### Added -* Improved indexing progress UI -* Improved @codebase using repomap -* Repo map context provider -### Fixed -* Many small UI improvements -* Fixes db.search not a function diff --git a/.changes/extensions/vscode/0.8.49.md b/.changes/extensions/vscode/0.8.49.md deleted file mode 100644 index b0100f493..000000000 --- a/.changes/extensions/vscode/0.8.49.md +++ /dev/null @@ -1,3 +0,0 @@ -## 0.8.49 - 2024-09-01 -### Fixed -* Hotfix: submenu context providers diff --git a/.changes/extensions/vscode/0.8.50.md b/.changes/extensions/vscode/0.8.50.md deleted file mode 100644 index 41abe2817..000000000 --- a/.changes/extensions/vscode/0.8.50.md +++ /dev/null @@ -1,3 +0,0 @@ -## 0.8.50 - 2024-09-02 -### Fixed -* Hotfix for ability to use more than one inline context provider diff --git a/.changes/extensions/vscode/0.8.51.md b/.changes/extensions/vscode/0.8.51.md deleted file mode 100644 index 2fbbbeb96..000000000 --- a/.changes/extensions/vscode/0.8.51.md +++ /dev/null @@ -1,3 +0,0 @@ -## 0.8.51 - 2024-09-05 -### Fixed -* Fixed CRLF bug causing diff streams to treat every line as changed on Windows diff --git a/.changes/extensions/vscode/0.8.52.md b/.changes/extensions/vscode/0.8.52.md deleted file mode 100644 index 481f5e023..000000000 --- a/.changes/extensions/vscode/0.8.52.md +++ /dev/null @@ -1,4 +0,0 @@ -## 0.8.52 - 2024-09-16 -### Changed -* Use Chromium only as a fallback after asking user -* Redesigned onboarding flow diff --git a/.changes/extensions/vscode/0.8.53.md b/.changes/extensions/vscode/0.8.53.md deleted file mode 100644 index 575a3b91d..000000000 --- a/.changes/extensions/vscode/0.8.53.md +++ /dev/null @@ -1,12 +0,0 @@ -## 0.8.53 - 2024-10-11 -### Added -* Improved loading/accept/reject UI for apply -* Polished chat sidebar, especially context dropdown -* Further prompt caching with Anthropic -### Changed -* Updated tutorial file -* Improved styling on "More" page -### Fixed -* Continue for teams auth bug fix -* Fixed a number of apply bugs -* Fixed autoscrolling behavior diff --git a/.changes/extensions/vscode/0.8.54.md b/.changes/extensions/vscode/0.8.54.md deleted file mode 100644 index 90466954c..000000000 --- a/.changes/extensions/vscode/0.8.54.md +++ /dev/null @@ -1,3 +0,0 @@ -## 0.8.54 - 2024-10-15 -### Fixed -* Hotfix: throttle transformers.js embeddings provider diff --git a/.changes/extensions/vscode/0.8.55.md b/.changes/extensions/vscode/0.8.55.md deleted file mode 100644 index 4800ad907..000000000 --- a/.changes/extensions/vscode/0.8.55.md +++ /dev/null @@ -1,9 +0,0 @@ -## 0.8.55 - 2024-10-25 -### Added -* Web context provider -* Cerebras inference provider -* Automatic descriptions for previous chats -* Discord context provider -* Improved full screen UI -### Changed -* Easier way to accept/reject/re-prompt after cmd/ctrl+I diff --git a/.changes/extensions/vscode/0.8.56.md b/.changes/extensions/vscode/0.8.56.md deleted file mode 100644 index d1c81fd34..000000000 --- a/.changes/extensions/vscode/0.8.56.md +++ /dev/null @@ -1,4 +0,0 @@ -## 0.8.56 - 2024-11-08 -### Added -* New Edit mode in sidebar (cmd/ctrl+I) -* Significantly faster and more accurate docs crawler by default diff --git a/.changes/extensions/vscode/0.8.58.md b/.changes/extensions/vscode/0.8.58.md deleted file mode 100644 index 98c845b97..000000000 --- a/.changes/extensions/vscode/0.8.58.md +++ /dev/null @@ -1,25 +0,0 @@ -## 0.8.58 - 2024-11-22 -### Added -* OpenAI predicted outputs support -* Improve codebase retrieval with BM25 -* Support for Grok from xAI -* Chat enhancements including sticking input to bottom -* New UI for cmd+I in sidebar -* Support for Nebius LLM provider -* Support for Ask Sage LLM provider -* Improved reference for config.json -* New @web context provider -* Updates for llama3.2 -* .continuerules file to set system prompt -* .prompt files v2 -* Dedicated UI for docs indexing -* Clickable code symbols in chat -* Use clipboard content as autocomplete context -### Changed -* Improved @docs crawler -* Many improvements to make autocomplete more eager -* Near complete type definition retrieval for TypeScript autocomplete -* Remove footer from chat sidebar -### Fixed -* Brought back the Apply button for all code blocks -* Automatically update codebase index on removed files diff --git a/.changes/extensions/vscode/0.8.59.md b/.changes/extensions/vscode/0.8.59.md deleted file mode 100644 index 9f6dfbd04..000000000 --- a/.changes/extensions/vscode/0.8.59.md +++ /dev/null @@ -1,3 +0,0 @@ -## 0.8.59 - 2024-11-25 -### Fixed -* Hotfix for Ollama onboarding diff --git a/.changes/extensions/vscode/0.8.62.md b/.changes/extensions/vscode/0.8.62.md deleted file mode 100644 index c258fd285..000000000 --- a/.changes/extensions/vscode/0.8.62.md +++ /dev/null @@ -1,6 +0,0 @@ -## 0.8.62 - 2024-12-10 -### Added -* Tool use -* Support for Model Context Protocol -### Fixed -* hotfix: context providers no longer hidden when not in edit mode diff --git a/.changes/extensions/vscode/0.8.66.md b/.changes/extensions/vscode/0.8.66.md deleted file mode 100644 index 4a1930978..000000000 --- a/.changes/extensions/vscode/0.8.66.md +++ /dev/null @@ -1,9 +0,0 @@ -## 0.8.66 - 2024-12-20 -### Changed -* Improved autocomplete in untitled files -### Fixed -* Display more mid-line completions -* Restored syntax highlighting -* Fix tool use bug for models that don't support tools -* Autodetect mistral API key type -* Fixes Azure OpenAI regressions diff --git a/.changes/extensions/vscode/1.0.0.md b/.changes/extensions/vscode/1.0.0.md deleted file mode 100644 index cea7899ff..000000000 --- a/.changes/extensions/vscode/1.0.0.md +++ /dev/null @@ -1,6 +0,0 @@ -## 1.0.0 - 2025-02-26 -### Added -* Introduces hub.continue.dev -* Improved apply quality -### Fixed -* Numerous reliability improvements diff --git a/.changes/extensions/vscode/v0.5.0.md b/.changes/extensions/vscode/v0.5.0.md deleted file mode 100644 index 7df6df9ee..000000000 --- a/.changes/extensions/vscode/v0.5.0.md +++ /dev/null @@ -1,9 +0,0 @@ -## v0.5.0 - 2023-11-09 - -### Added - -- Codebase Retrieval: Use /codebase or cmd+enter and Continue will automatically gather the most important context - -### Changed - -- Switch from Websockets to Socket.io diff --git a/.changes/extensions/vscode/v0.6.0.md b/.changes/extensions/vscode/v0.6.0.md deleted file mode 100644 index ee58a295c..000000000 --- a/.changes/extensions/vscode/v0.6.0.md +++ /dev/null @@ -1,11 +0,0 @@ -## v0.6.0 - 2023-11-10 - -### Added - -- Full screen mode -- StackOverflow slash command to augment with web search -- VS Code context menus: right click to add code to context, debug the terminal, or share your Continue session - -### Fixed - -- Reliability improvements to JetBrains by bringing up-to-date with the socket.io refactor diff --git a/.changes/extensions/vscode/v0.6.16.md b/.changes/extensions/vscode/v0.6.16.md deleted file mode 100644 index e5d7e491e..000000000 --- a/.changes/extensions/vscode/v0.6.16.md +++ /dev/null @@ -1,6 +0,0 @@ -## v0.6.16 - 2023-12-25 - -### Changed - -- Context items are now kept around as a part of past messages, instead of staying at the main input -- No more Python server - Continue runs entirely in Typescript diff --git a/.changes/extensions/vscode/v0.6.19.md b/.changes/extensions/vscode/v0.6.19.md deleted file mode 100644 index d338fbf43..000000000 --- a/.changes/extensions/vscode/v0.6.19.md +++ /dev/null @@ -1,11 +0,0 @@ -## v0.6.19 - 2024-01-05 - -### Added - -- support for .continuerc.json in root of workspace to override config.json -- Inline context providers -- cmd+shift+L with new diff streaming UI for edits - -### Changed - -- Allow certain LLM servers to handle templating diff --git a/.changes/extensions/vscode/v0.6.4.md b/.changes/extensions/vscode/v0.6.4.md deleted file mode 100644 index 9194b537d..000000000 --- a/.changes/extensions/vscode/v0.6.4.md +++ /dev/null @@ -1,5 +0,0 @@ -## v0.6.4 - 2023-11-19 - -### Changed - -- migrated to .json config file format diff --git a/.changes/extensions/vscode/v0.8.1.md b/.changes/extensions/vscode/v0.8.1.md deleted file mode 100644 index 1a7a061ac..000000000 --- a/.changes/extensions/vscode/v0.8.1.md +++ /dev/null @@ -1,9 +0,0 @@ -## v0.8.1 - 2024-01-08 - -### Added - -- disableSessionTitles option in config.json - -### Changed - -- Use Ollama /chat endpoint instead of raw completions by default, and /show endpoint to gather model parameters like context length and stop tokens diff --git a/.changes/extensions/vscode/v0.8.2.md b/.changes/extensions/vscode/v0.8.2.md deleted file mode 100644 index 40ada41a6..000000000 --- a/.changes/extensions/vscode/v0.8.2.md +++ /dev/null @@ -1,8 +0,0 @@ -## v0.8.2 - 2024-01-23 -### Added -* Add codellama and gemini to free trial, using new server -* Local codebase syncing and embeddings using LanceDB -* Improved VS Code theme matching -### Changed -* Updates to packaging to download native modules for current platform (lancedb, sqlite, onnxruntime, tree-sitter wasms) -* Context providers now run from the extension side (in Node.js instead of browser javascript) diff --git a/.changes/header.tpl.md b/.changes/header.tpl.md deleted file mode 100644 index 811d6f896..000000000 --- a/.changes/header.tpl.md +++ /dev/null @@ -1,5 +0,0 @@ -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), -and is generated by [Changie](https://github.com/miniscruff/changie). diff --git a/.changes/unreleased/.gitkeep b/.changes/unreleased/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/.changie.yaml b/.changie.yaml deleted file mode 100644 index 7a11e254d..000000000 --- a/.changie.yaml +++ /dev/null @@ -1,35 +0,0 @@ -changesDir: .changes -unreleasedDir: unreleased -headerPath: header.tpl.md -changelogPath: CHANGELOG.md -versionExt: md -versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}' -kindFormat: "### {{.Kind}}" -changeFormat: "* {{.Body}}" -kinds: - - label: Added - auto: minor - - label: Changed - auto: major - - label: Deprecated - auto: minor - - label: Removed - auto: major - - label: Fixed - auto: patch - - label: Security - auto: patch -newlines: - afterChangelogHeader: 1 - beforeChangelogVersion: 1 - endOfVersion: 1 -envPrefix: CHANGIE_ - -projects: - - label: extensions/intellij - key: extensions/intellij - changelog: extensions/intellij/CHANGELOG.md - - - label: extensions/vscode - key: extensions/vscode - changelog: extensions/vscode/CHANGELOG.md diff --git a/.continue/rules/intellij-plugin-test-execution.yaml b/.continue/rules/intellij-plugin-test-execution.yaml new file mode 100644 index 000000000..386a72a2b --- /dev/null +++ b/.continue/rules/intellij-plugin-test-execution.yaml @@ -0,0 +1,15 @@ +name: IntelliJ Plugin Test Execution +version: 0.0.1 +schema: v1 +rules: + - name: IntelliJ Plugin Test Execution + rule: |- + Run IntelliJ plugin tests using Gradle with the fully qualified test class or method name: + ```bash + # Run test class + ./gradlew test --tests "com.github.continuedev.continueintellijextension.unit.ApplyToFileHandlerTest" + + # Run specific test method + ./gradlew test --tests "com.github.continuedev.continueintellijextension.unit.ApplyToFileHandlerTest.should*" + ``` + globs: extensions/intellij/**/*Test.kt diff --git a/.continue/rules/intellij-test-standards.yaml b/.continue/rules/intellij-test-standards.yaml new file mode 100644 index 000000000..f706757e2 --- /dev/null +++ b/.continue/rules/intellij-test-standards.yaml @@ -0,0 +1,10 @@ +name: IntelliJ Test Standards +version: 0.0.1 +schema: v1 +rules: + - name: IntelliJ Test Standards + rule: When writing tests for the IntelliJ plugin, use the mockk library for + mocking. Prefer mockk's idiomatic syntax for creating and verifying mocks. + Always structure tests with clear Arrange-Act-Assert patterns and use + descriptive test names that indicate the scenario being tested. + globs: "**/test/**/*.kt" diff --git a/.continue/rules/unit-testing-rules.yaml b/.continue/rules/unit-testing-rules.yaml new file mode 100644 index 000000000..ec22e9467 --- /dev/null +++ b/.continue/rules/unit-testing-rules.yaml @@ -0,0 +1,30 @@ +name: unit-testing-rules +version: 0.0.1 +schema: v1 +rules: + - name: unit-testing-rules + rule: >- + For unit testing in this project: + + + 1. The project uses Jest as the testing framework + + 2. Run tests using `npm test` from within the specific package/module + directory + + 3. Command structure: `cd [directory] && npm test -- [test file path]` + + 4. The test script uses experimental VM modules via NODE_OPTIONS flag + + 5. Test files follow the pattern `*.test.ts` + + 6. Tests must import Jest with `import { jest } from "@jest/globals";` + + 7. Run tests from within the specific package directory (e.g., `cd core` + for core module tests) + + 8. Write tests as top-level `test()` functions - DO NOT use `describe()` + blocks + + 9. Include the function name being tested in the test description for + clarity diff --git a/.github/workflows/cla.yaml b/.github/workflows/cla.yaml index e8729f9d7..f915854d1 100644 --- a/.github/workflows/cla.yaml +++ b/.github/workflows/cla.yaml @@ -1,9 +1,9 @@ name: "CLA Assistant" on: issue_comment: - types: [created] + types: [ created ] pull_request_target: - types: [opened, closed, synchronize] + types: [ opened, closed, synchronize ] permissions: actions: write @@ -18,7 +18,7 @@ jobs: if: github.repository == 'continuedev/continue' steps: - name: "CLA Assistant" - if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' + if: (contains(github.event.comment.body, 'recheck') || contains(github.event.comment.body, 'I have read the CLA Document and I hereby sign the CLA')) || github.event_name == 'pull_request_target' uses: contributor-assistant/github-action@v2.6.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -26,4 +26,4 @@ jobs: path-to-signatures: "signatures/version1/cla.json" path-to-document: "https://github.com/continuedev/continue/blob/main/docs/docs/CLA.md" branch: cla-signatures - allowlist: dependabot[bot] + allowlist: dependabot[bot] \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2ca914069..95cd177a9 100644 --- a/.gitignore +++ b/.gitignore @@ -162,5 +162,8 @@ extensions/.continue-debug/ *.vsix +# intellij module library files +*.iml + .continuerules **/.continue/assistants/ \ No newline at end of file diff --git a/.idea/jsLinters/eslint.xml b/.idea/jsLinters/eslint.xml new file mode 100644 index 000000000..541945bb0 --- /dev/null +++ b/.idea/jsLinters/eslint.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml index b0c1c68fb..0c83ac4e8 100644 --- a/.idea/prettier.xml +++ b/.idea/prettier.xml @@ -2,5 +2,6 @@ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 268bbe613..000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,6 +0,0 @@ -# Changelog - -Separate changelogs are kept for each extension: - -- [VS Code Extension](./extensions/vscode/CHANGELOG.md) -- [JetBrains Extension](./extensions/intellij/CHANGELOG.md) diff --git a/README.md b/README.md index a7a9eabb3..bc5df9c83 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,10 @@
-**[Continue](https://docs.continue.dev) enables developers to create, share, and use custom AI code assistants with our open-source [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) and [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension) extensions and [hub of models, rules, prompts, docs, and other building blocks](https://hub.continue.dev)** +**[Continue](https://docs.continue.dev) enables developers to create, share, and use custom AI code assistants with our +open-source [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) +and [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension) extensions +and [hub of models, rules, prompts, docs, and other building blocks](https://hub.continue.dev)**
@@ -20,15 +23,25 @@ + + +

+## Agent + +[Agent](https://continue.dev/docs/agent/how-to-use-it) enables you to make more substantial changes to your codebase + +![agent](docs/static/img/agent.gif) + ## Chat -[Chat](https://continue.dev/docs/chat/how-to-use-it) makes it easy to ask for help from an LLM without needing to leave the IDE +[Chat](https://continue.dev/docs/chat/how-to-use-it) makes it easy to ask for help from an LLM without needing to leave +the IDE ![chat](docs/static/img/chat.gif) @@ -40,15 +53,11 @@ ## Edit -[Edit](https://continue.dev/docs/edit/how-to-use-it) is a convenient way to modify code without leaving your current file +[Edit](https://continue.dev/docs/edit/how-to-use-it) is a convenient way to modify code without leaving your current +file ![edit](docs/static/img/edit.gif) -## Agent - -[Agent](https://continue.dev/docs/agent/how-to-use-it) enables you to make more substantial changes to your codebase - -![agent](docs/static/img/agent.gif) @@ -58,7 +67,8 @@ Learn about how to install and use Continue in the docs [here](https://continue. ## Contributing -Read the [contributing guide](https://github.com/continuedev/continue/blob/main/CONTRIBUTING.md), and join [#contribute on Discord](https://discord.gg/vapESyrFmJ). +Read the [contributing guide](https://github.com/continuedev/continue/blob/main/CONTRIBUTING.md), and +join [#contribute on Discord](https://discord.gg/vapESyrFmJ). ## License diff --git a/binary/build.js b/binary/build.js index 574a90444..b67afb94f 100644 --- a/binary/build.js +++ b/binary/build.js @@ -64,7 +64,7 @@ async function buildWithEsbuild() { format: "cjs", platform: "node", sourcemap: true, - minify: true, + minify: !esbuildOnly, treeShaking: true, loader: { // eslint-disable-next-line @typescript-eslint/naming-convention diff --git a/binary/package-lock.json b/binary/package-lock.json index b2b1c8d41..acb5b9fea 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -33,6 +33,7 @@ "@types/jest": "^29.5.12", "@types/uuid": "^9.0.8", "@vercel/ncc": "^0.38.1", + "cross-env": "^7.0.3", "esbuild": "0.19.11", "jest": "^29.7.0", "pkg": "^5.8.1", @@ -3196,6 +3197,25 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", diff --git a/binary/package.json b/binary/package.json index a9926e8f5..0e8949aa6 100644 --- a/binary/package.json +++ b/binary/package.json @@ -33,6 +33,7 @@ "@types/jest": "^29.5.12", "@types/uuid": "^9.0.8", "@vercel/ncc": "^0.38.1", + "cross-env": "^7.0.3", "esbuild": "0.19.11", "jest": "^29.7.0", "pkg": "^5.8.1", diff --git a/core/autocomplete/templating/AutocompleteTemplate.ts b/core/autocomplete/templating/AutocompleteTemplate.ts index 6385fa22b..39c653792 100644 --- a/core/autocomplete/templating/AutocompleteTemplate.ts +++ b/core/autocomplete/templating/AutocompleteTemplate.ts @@ -71,6 +71,21 @@ const qwenCoderFimTemplate: AutocompleteTemplate = { }, }; +const seedCoderFimTemplate: AutocompleteTemplate = { + template: "<[fim-prefix]>{{{prefix}}}<[fim-suffix]>{{{suffix}}}<[fim-middle]>", + completionOptions: { + stop: [ + "<[end▁of▁sentence]>", + "<[fim-prefix]>", + "<[fim-middle]>", + "<[fim-suffix]>", + "<[PAD▁TOKEN]>", + "<[SEP▁TOKEN]>", + "<[begin▁of▁sentence]>", + ], + }, +}; + const codestralFimTemplate: AutocompleteTemplate = { template: "[SUFFIX]{{{suffix}}}[PREFIX]{{{prefix}}}", completionOptions: { @@ -426,6 +441,10 @@ export function getTemplateForModel(model: string): AutocompleteTemplate { return qwenCoderFimTemplate; } + if (lowerCaseModel.includes("seed") && lowerCaseModel.includes("coder")) { + return seedCoderFimTemplate; + } + if ( lowerCaseModel.includes("starcoder") || lowerCaseModel.includes("star-coder") || diff --git a/core/config/migrateSharedConfig.ts b/core/config/migrateSharedConfig.ts index e1e66000d..67dfeeffd 100644 --- a/core/config/migrateSharedConfig.ts +++ b/core/config/migrateSharedConfig.ts @@ -173,6 +173,13 @@ export function migrateJsonSharedConfig(filepath: string, ide: IDE): void { effected = true; } + const { autoAcceptEditToolDiffs, ...withoutAutoApply } = migratedUI; + if (autoAcceptEditToolDiffs !== undefined) { + shareConfigUpdates.autoAcceptEditToolDiffs = autoAcceptEditToolDiffs; + migratedUI = withoutAutoApply; + effected = true; + } + const { showChatScrollbar, ...withoutShowChatScrollbar } = migratedUI; if (showChatScrollbar !== undefined) { shareConfigUpdates.showChatScrollbar = showChatScrollbar; diff --git a/core/config/sharedConfig.ts b/core/config/sharedConfig.ts index b8ac20584..ad8b81341 100644 --- a/core/config/sharedConfig.ts +++ b/core/config/sharedConfig.ts @@ -26,6 +26,7 @@ export const sharedConfigSchema = z codeWrap: z.boolean(), displayRawMarkdown: z.boolean(), showChatScrollbar: z.boolean(), + autoAcceptEditToolDiffs: z.boolean(), // `tabAutocompleteOptions` in `ContinueConfig` useAutocompleteCache: z.boolean(), @@ -106,8 +107,7 @@ export function modifyAnyConfigWithSharedConfig< sharedConfig.disableAutocompleteInFiles; } if (sharedConfig.modelTimeout !== undefined) { - configCopy.tabAutocompleteOptions.modelTimeout = - sharedConfig.modelTimeout; + configCopy.tabAutocompleteOptions.modelTimeout = sharedConfig.modelTimeout; } if (sharedConfig.debounceDelay !== undefined) { configCopy.tabAutocompleteOptions.debounceDelay = @@ -134,6 +134,10 @@ export function modifyAnyConfigWithSharedConfig< if (sharedConfig.showChatScrollbar !== undefined) { configCopy.ui.showChatScrollbar = sharedConfig.showChatScrollbar; } + if (sharedConfig.autoAcceptEditToolDiffs !== undefined) { + configCopy.ui.autoAcceptEditToolDiffs = + sharedConfig.autoAcceptEditToolDiffs; + } if (sharedConfig.allowAnonymousTelemetry !== undefined) { configCopy.allowAnonymousTelemetry = sharedConfig.allowAnonymousTelemetry; diff --git a/core/data/log.test.ts b/core/data/log.test.ts new file mode 100644 index 000000000..e2471b6bd --- /dev/null +++ b/core/data/log.test.ts @@ -0,0 +1,192 @@ +import { DevDataLogEvent } from "@continuedev/config-yaml"; +import fs from "fs"; +import path from "path"; +import { IdeInfo, IdeSettings } from ".."; +import { Core } from "../core"; +import { getDevDataFilePath } from "../util/paths"; +import { DataLogger } from "./log"; + +// Only mock fetch, not fs +jest.mock("@continuedev/fetch"); + +const TEST_EVENT: DevDataLogEvent = { + name: "tokensGenerated", + data: { + generatedTokens: 100, + model: "gpt-4", + promptTokens: 50, + provider: "openai", + }, +}; +const SCHEMA = "0.2.0"; + +describe("DataLogger", () => { + let dataLogger: DataLogger; + const tempDir = path.join(process.cwd(), "temp-test-data"); + const testFilePath = path.join(tempDir, "tokensGenerated-test.jsonl"); + + // Create temp directory for test files + beforeAll(() => { + if (!fs.existsSync(tempDir)) { + fs.mkdirSync(tempDir, { recursive: true }); + } + }); + + // Clean up temp directory after tests + afterAll(() => { + if (fs.existsSync(tempDir)) { + fs.rmSync(tempDir, { recursive: true, force: true }); + } + }); + + beforeEach(() => { + // Reset mocks + jest.clearAllMocks(); + + // Remove test file if it exists + if (fs.existsSync(testFilePath)) { + fs.unlinkSync(testFilePath); + } + + // Get singleton instance + dataLogger = DataLogger.getInstance(); + + // Mock core and required promises + dataLogger.core = { + configHandler: { + loadConfig: jest.fn().mockResolvedValue({ + config: { + data: [], + }, + }), + currentProfile: { + profileDescription: { + id: "test-profile-id", + }, + }, + controlPlaneClient: { + getAccessToken: jest.fn().mockResolvedValue("test-access-token"), + }, + }, + } as unknown as Core; + + dataLogger.ideSettingsPromise = Promise.resolve({ + userToken: "test-user-token", + } as IdeSettings); + + dataLogger.ideInfoPromise = Promise.resolve({ + name: "VSCode", + version: "1.0.0", + extensionVersion: "0.1.0", + } as IdeInfo); + }); + + describe("getInstance", () => { + it("should return the same instance when called multiple times", () => { + const instance1 = DataLogger.getInstance(); + const instance2 = DataLogger.getInstance(); + expect(instance1).toBe(instance2); + }); + }); + + describe("addBaseValues", () => { + it("should add base values to event data based on schema", async () => { + const mockZodSchema = { + shape: { + eventName: true, + timestamp: true, + schema: true, + userAgent: true, + selectedProfileId: true, + userId: true, + }, + }; + + const result = await dataLogger.addBaseValues( + { customField: "value" }, + "testEvent", + SCHEMA, + mockZodSchema as any, + ); + + expect(result).toEqual({ + customField: "value", + eventName: "testEvent", + timestamp: expect.any(String), + schema: SCHEMA, + userAgent: "VSCode/1.0.0 (Continue/0.1.0)", + selectedProfileId: "test-profile-id", + userId: "test-user-token", + }); + }); + + it("should not add fields not present in schema shape", async () => { + const mockZodSchema = { + shape: { + eventName: true, + // No other fields + }, + }; + + const result = await dataLogger.addBaseValues( + { customField: "value" }, + "testEvent", + SCHEMA, + mockZodSchema as any, + ); + + expect(result).toEqual({ + customField: "value", + eventName: "testEvent", + }); + }); + }); + + describe("logLocalData", () => { + it("should actually write data to the local file", async () => { + // Call the method to log data locally + await dataLogger.logLocalData(TEST_EVENT); + + // Verify the file was created + const filepath = getDevDataFilePath(TEST_EVENT.name, SCHEMA); + expect(fs.existsSync(filepath)).toBe(true); + + // Read file contents and verify + const fileContent = fs.readFileSync(filepath, "utf8"); + expect(fileContent).toContain('"generatedTokens":100'); + expect(fileContent).toContain('"model":"gpt-4"'); + expect(fileContent).toContain('"eventName":"tokensGenerated"'); + }); + }); + + describe("logDevData", () => { + it("should log data locally and to configured destinations", async () => { + // Spy on logLocalData and logToOneDestination + const logLocalDataSpy = jest + .spyOn(dataLogger, "logLocalData") + .mockResolvedValue(); + const logToOneDestinationSpy = jest + .spyOn(dataLogger, "logToOneDestination") + .mockResolvedValue(); + + // Mock config with multiple data destinations + const mockConfig = { + config: { + data: [ + { destination: "https://example.com/logs", schema: SCHEMA }, + { destination: "file:///logs", schema: SCHEMA }, + ], + }, + }; + + dataLogger.core!.configHandler.loadConfig = jest + .fn() + .mockResolvedValue(mockConfig); + + await dataLogger.logDevData(TEST_EVENT); + + expect(logLocalDataSpy).toHaveBeenCalledWith(TEST_EVENT); + expect(logToOneDestinationSpy).toHaveBeenCalledTimes(2); + }); + }); +}); diff --git a/core/data/log.ts b/core/data/log.ts index 4470eba72..c4cf27805 100644 --- a/core/data/log.ts +++ b/core/data/log.ts @@ -12,7 +12,7 @@ import * as URI from "uri-js"; import { fileURLToPath } from "url"; import { AnyZodObject } from "zod"; import { Core } from "../core.js"; -import { IdeInfo, IdeSettings } from "../index.js"; +import { ContinueConfig, IdeInfo, IdeSettings } from "../index.js"; import { getDevDataFilePath } from "../util/paths.js"; import { joinPathsToUri } from "../util/uri.js"; @@ -68,8 +68,7 @@ export class DataLogger { return newBody; } - async logDevData(event: DevDataLogEvent) { - // Local logs (always on for all levels) + async logLocalData(event: DevDataLogEvent) { try { const filepath: string = getDevDataFilePath( event.name, @@ -100,126 +99,144 @@ export class DataLogger { } catch (error) { console.error("Error logging local dev data:", error); } + } + + async logDevData(event: DevDataLogEvent) { + // Local logs (always on for all levels) + await this.logLocalData(event); // Remote logs const config = (await this.core?.configHandler.loadConfig())?.config; if (config?.data?.length) { await Promise.allSettled( - config.data.map(async (dataConfig) => { - try { - // First extract the data schema based on the version and level - const { schema } = dataConfig; + config.data.map((dataConfig) => + this.logToOneDestination(dataConfig, event), + ), + ); + } + } - const level = dataConfig.level ?? DEFAULT_DEV_DATA_LEVEL; + async parseEventData( + event: DevDataLogEvent, + schema: string, + level: "all" | "noCode", + ) { + const versionSchemas = devDataVersionedSchemas[schema]; + if (!versionSchemas) { + throw new Error( + `Attempting to log dev data to non-existent version ${schema}`, + ); + } - // Skip event if `events` is specified and does not include the event - const events = dataConfig.events ?? allDevEventNames; - if (!events.includes(event.name)) { - return; - } + const levelSchemas = versionSchemas[level]; + if (!levelSchemas) { + throw new Error( + `Attempting to log dev data at level ${level} for version ${schema} which does not exist`, + ); + } - const versionSchemas = devDataVersionedSchemas[schema]; - if (!versionSchemas) { - throw new Error( - `Attempting to log dev data to non-existent version ${schema}`, - ); - } + const zodSchema = levelSchemas[event.name]; + if (!zodSchema) { + throw new Error( + `Attempting to log dev data for event ${event.name} at level ${level} for version ${schema}: no schema found`, + ); + } - const levelSchemas = versionSchemas[level]; - if (!levelSchemas) { - throw new Error( - `Attempting to log dev data at level ${level} for version ${schema} which does not exist`, - ); - } + const eventDataWithBaseValues = await this.addBaseValues( + event.data, + event.name, + schema, + zodSchema, + ); - const zodSchema = levelSchemas[event.name]; - if (!zodSchema) { - throw new Error( - `Attempting to log dev data for event ${event.name} at level ${level} for version ${schema}: no schema found`, - ); - } + const parsed = zodSchema.safeParse(eventDataWithBaseValues); + if (!parsed.success) { + throw new Error( + `Failed to parse event data for event ${event.name} and schema ${schema}\n:${parsed.error.toString()}`, + ); + } - const eventDataWithBaseValues = await this.addBaseValues( - event.data, - event.name, + return parsed.data; + } + + async logToOneDestination( + dataConfig: NonNullable[number], + event: DevDataLogEvent, + ) { + try { + if (!dataConfig) { + return; + } + + // First extract the data schema based on the version and level + const { schema } = dataConfig; + const level = dataConfig.level ?? DEFAULT_DEV_DATA_LEVEL; + + // Skip event if `events` is specified and does not include the event + const events = dataConfig.events ?? allDevEventNames; + if (!events.includes(event.name)) { + return; + } + + // Parse the event data, throwing if it fails + const parsed = await this.parseEventData(event, schema, level); + + const uriComponents = URI.parse(dataConfig.destination); + + // Send to remote server + if (uriComponents.scheme === "https" || uriComponents.scheme === "http") { + const headers: Record = { + "Content-Type": "application/json", + }; + + // If an API key is provided, use it, otherwise use the Continue access token + if (dataConfig.apiKey) { + headers["Authorization"] = `Bearer ${dataConfig.apiKey}`; + } else { + const accessToken = + await this.core?.configHandler.controlPlaneClient.getAccessToken(); + headers["Authorization"] = `Bearer ${accessToken}`; + } + + const profileId = + this.core?.configHandler.currentProfile?.profileDescription.id ?? ""; + const response = await fetchwithRequestOptions( + dataConfig.destination, + { + method: "POST", + headers, + body: JSON.stringify({ + name: event.name, + data: parsed, schema, - zodSchema, - ); + level, + profileId, + }), + }, + dataConfig.requestOptions, + ); + if (!response.ok) { + throw new Error( + `Post request failed. ${response.status}: ${response.statusText}`, + ); + } + } else if (uriComponents.scheme === "file") { + // Write to jsonc file for local file URIs + const dirUri = joinPathsToUri(dataConfig.destination, schema); + const dirPath = fileURLToPath(dirUri); - const parsed = zodSchema.safeParse(eventDataWithBaseValues); - if (!parsed.success) { - throw new Error( - `Failed to parse event data for event ${event.name} and schema ${schema}\n:${parsed.error.toString()}`, - ); - } - - const uriComponents = URI.parse(dataConfig.destination); - - // Send to remote server - if ( - uriComponents.scheme === "https" || - uriComponents.scheme === "http" - ) { - const headers: Record = { - "Content-Type": "application/json", - }; - if (dataConfig.apiKey) { - headers["Authorization"] = `Bearer ${dataConfig.apiKey}`; - } - - // For events going to Continue, overwrite the access token - if ( - uriComponents.host?.endsWith(".continue.dev") || - uriComponents.host === "continue.dev" - ) { - // - const accessToken = - await this.core?.configHandler.controlPlaneClient.getAccessToken(); - headers["Authorization"] = `Bearer ${accessToken}`; - } - const profileId = - this.core?.configHandler.currentProfile?.profileDescription - .id ?? ""; - const response = await fetchwithRequestOptions( - dataConfig.destination, - { - method: "POST", - headers, - body: JSON.stringify({ - name: event.name, - data: parsed.data, - schema, - level, - profileId, - }), - }, - dataConfig.requestOptions, - ); - if (!response.ok) { - throw new Error( - `Post request failed. ${response.status}: ${response.statusText}`, - ); - } - } else if (uriComponents.scheme === "file") { - // Write to jsonc file for local file URIs - const dirUri = joinPathsToUri(dataConfig.destination, schema); - const dirPath = fileURLToPath(dirUri); - - if (!fs.existsSync(dirPath)) { - fs.mkdirSync(dirPath, { recursive: true }); - } - const filepath = path.join(dirPath, `${event.name}.jsonl`); - const jsonLine = JSON.stringify(event.data); - fs.writeFileSync(filepath, `${jsonLine}\n`, { flag: "a" }); - } else { - throw new Error(`Unsupported URI scheme ${uriComponents.scheme}`); - } - } catch (error) { - console.error( - `Error logging data to ${dataConfig.destination}: ${error instanceof Error ? error.message : error}`, - ); - } - }), + if (!fs.existsSync(dirPath)) { + fs.mkdirSync(dirPath, { recursive: true }); + } + const filepath = path.join(dirPath, `${event.name}.jsonl`); + const jsonLine = JSON.stringify(event.data); + fs.writeFileSync(filepath, `${jsonLine}\n`, { flag: "a" }); + } else { + throw new Error(`Unsupported URI scheme ${uriComponents.scheme}`); + } + } catch (error) { + console.error( + `Error logging data to ${dataConfig.destination}: ${error instanceof Error ? error.message : error}`, ); } } diff --git a/core/index.d.ts b/core/index.d.ts index d15c73b50..9bc413331 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -197,15 +197,14 @@ export interface CustomContextProvider { description?: string; renderInlineAs?: string; type?: ContextProviderType; + loadSubmenuItems?: ( + args: LoadSubmenuItemsArgs, + ) => Promise; getContextItems( query: string, extras: ContextProviderExtras, ): Promise; - - loadSubmenuItems?: ( - args: LoadSubmenuItemsArgs, - ) => Promise; } export interface ContextSubmenuItem { @@ -459,6 +458,7 @@ export interface ChatHistoryItem { toolCallState?: ToolCallState; isGatheringContext?: boolean; reasoning?: Reasoning; + appliedRules?: RuleWithSource[]; } export interface LLMFullCompletionOptions extends BaseCompletionOptions { @@ -842,6 +842,7 @@ export interface SlashCommand { description: string; prompt?: string; params?: { [key: string]: any }; + promptFile?: string run: (sdk: ContinueSDK) => AsyncGenerator; } @@ -1167,6 +1168,7 @@ export interface MCPResource { description?: string; mimeType?: string; } + export interface MCPTool { name: string; description?: string; @@ -1192,6 +1194,7 @@ export interface ContinueUIConfig { showChatScrollbar?: boolean; codeWrap?: boolean; showSessionTabs?: boolean; + autoAcceptEditToolDiffs?: boolean; } export interface ContextMenuConfig { @@ -1229,6 +1232,27 @@ export interface ApplyState { toolCallId?: string; } +export interface StreamDiffLinesPayload { + prefix: string; + highlighted: string; + suffix: string; + input: string; + language: string | undefined; + modelTitle: string | undefined; + includeRulesInSystemMessage: boolean; +} + +export interface HighlightedCodePayload { + rangeInFileWithContents: RangeInFileWithContents; + prompt?: string; + shouldRun?: boolean; +} + +export interface AcceptOrRejectDiffPayload { + filepath: string; + streamId?: string; +} + export interface RangeInFileWithContents { filepath: string; range: { @@ -1238,7 +1262,7 @@ export interface RangeInFileWithContents { contents: string; } -export type CodeToEdit = RangeInFileWithContents | FileWithContents; +export type SetCodeToEditPayload = RangeInFileWithContents | FileWithContents; /** * Represents the configuration for a quick action in the Code Lens. @@ -1497,17 +1521,19 @@ export interface TerminalOptions { waitForCompletion?: boolean; } +export type RuleSource = + | "default-chat" + | "default-agent" + | "model-chat-options" + | "model-agent-options" + | "rules-block" + | "json-systemMessage" + | ".continuerules"; + export interface RuleWithSource { name?: string; slug?: string; - source: - | "default-chat" - | "default-agent" - | "model-chat-options" - | "model-agent-options" - | "rules-block" - | "json-systemMessage" - | ".continuerules"; + source: RuleSource; globs?: string | string[]; rule: string; description?: string; diff --git a/core/indexing/CodeSnippetsIndex.ts b/core/indexing/CodeSnippetsIndex.ts index 9a2da5008..bf79b093e 100644 --- a/core/indexing/CodeSnippetsIndex.ts +++ b/core/indexing/CodeSnippetsIndex.ts @@ -7,7 +7,7 @@ import { getQueryForFile, } from "../util/treeSitter"; -import { DatabaseConnection, SqliteDb, tagToString } from "./refreshIndex"; +import { DatabaseConnection, SqliteDb } from "./refreshIndex"; import { IndexResultType, MarkCompleteCallback, @@ -29,6 +29,7 @@ import { getLastNUriRelativePathParts, getUriPathBasename, } from "../util/uri"; +import { tagToString } from "./utils"; type SnippetChunk = ChunkWithoutID & { title: string; signature: string }; diff --git a/core/indexing/FullTextSearchCodebaseIndex.ts b/core/indexing/FullTextSearchCodebaseIndex.ts index de183e158..1bac74e4a 100644 --- a/core/indexing/FullTextSearchCodebaseIndex.ts +++ b/core/indexing/FullTextSearchCodebaseIndex.ts @@ -3,13 +3,14 @@ import { RETRIEVAL_PARAMS } from "../util/parameters"; import { getUriPathBasename } from "../util/uri"; import { ChunkCodebaseIndex } from "./chunk/ChunkCodebaseIndex"; -import { DatabaseConnection, SqliteDb, tagToString } from "./refreshIndex"; +import { DatabaseConnection, SqliteDb } from "./refreshIndex"; import { IndexResultType, MarkCompleteCallback, RefreshIndexResults, type CodebaseIndex, } from "./types"; +import { tagToString } from "./utils"; export interface RetrieveConfig { tags: BranchAndDir[]; @@ -97,11 +98,14 @@ export class FullTextSearchCodebaseIndex implements CodebaseIndex { // Delete for (const item of results.del) { - await db.run(` + await db.run( + ` DELETE FROM fts WHERE rowid IN ( SELECT id FROM fts_metadata WHERE path = ? AND cacheKey = ? ) - `,[item.path, item.cacheKey]); + `, + [item.path, item.cacheKey], + ); await db.run("DELETE FROM fts_metadata WHERE path = ? AND cacheKey = ?", [ item.path, item.cacheKey, diff --git a/core/indexing/LanceDbIndex.ts b/core/indexing/LanceDbIndex.ts index 3bf9a645d..cf41beaca 100644 --- a/core/indexing/LanceDbIndex.ts +++ b/core/indexing/LanceDbIndex.ts @@ -14,7 +14,7 @@ import { getUriPathBasename } from "../util/uri"; import { basicChunker } from "./chunk/basic.js"; import { chunkDocument, shouldChunk } from "./chunk/chunk.js"; -import { DatabaseConnection, SqliteDb, tagToString } from "./refreshIndex.js"; +import { DatabaseConnection, SqliteDb } from "./refreshIndex.js"; import { CodebaseIndex, IndexResultType, @@ -24,6 +24,7 @@ import { } from "./types"; import type * as LanceType from "vectordb"; +import { tagToString } from "./utils"; interface LanceDbRow { uuid: string; diff --git a/core/indexing/chunk/ChunkCodebaseIndex.ts b/core/indexing/chunk/ChunkCodebaseIndex.ts index 9b39e506a..412ff7480 100644 --- a/core/indexing/chunk/ChunkCodebaseIndex.ts +++ b/core/indexing/chunk/ChunkCodebaseIndex.ts @@ -4,7 +4,7 @@ import { RunResult } from "sqlite3"; import { IContinueServerClient } from "../../continueServer/interface.js"; import { Chunk, IndexTag, IndexingProgressUpdate } from "../../index.js"; -import { DatabaseConnection, SqliteDb, tagToString } from "../refreshIndex.js"; +import { DatabaseConnection, SqliteDb } from "../refreshIndex.js"; import { IndexResultType, MarkCompleteCallback, @@ -13,8 +13,9 @@ import { type CodebaseIndex, } from "../types.js"; -import { chunkDocument, shouldChunk } from "./chunk.js"; import { getUriPathBasename } from "../../util/uri.js"; +import { tagToString } from "../utils.js"; +import { chunkDocument, shouldChunk } from "./chunk.js"; export class ChunkCodebaseIndex implements CodebaseIndex { relativeExpectedTime: number = 1; diff --git a/core/indexing/refreshIndex.ts b/core/indexing/refreshIndex.ts index f76c6a7f6..ec84f631b 100644 --- a/core/indexing/refreshIndex.ts +++ b/core/indexing/refreshIndex.ts @@ -18,10 +18,6 @@ import { export type DatabaseConnection = Database; -export function tagToString(tag: IndexTag): string { - return `${tag.directory}::${tag.branch}::${tag.artifactId}`; -} - export class SqliteDb { static db: DatabaseConnection | null = null; diff --git a/core/indexing/test/indexing.ts b/core/indexing/test/indexing.ts index 5f22d0aeb..b90f52564 100644 --- a/core/indexing/test/indexing.ts +++ b/core/indexing/test/indexing.ts @@ -3,11 +3,11 @@ import { jest } from "@jest/globals"; import { IndexTag } from "../.."; import { IContinueServerClient } from "../../continueServer/interface"; import { ChunkCodebaseIndex } from "../chunk/ChunkCodebaseIndex"; -import { tagToString } from "../refreshIndex"; import { CodebaseIndex, RefreshIndexResults } from "../types"; import { testIde } from "../../test/fixtures"; import { addToTestDir, TEST_DIR } from "../../test/testDir"; +import { tagToString } from "../utils"; export const mockFilename = "test.py"; export const mockPathAndCacheKey = { diff --git a/core/indexing/utils.test.ts b/core/indexing/utils.test.ts new file mode 100644 index 000000000..f432da023 --- /dev/null +++ b/core/indexing/utils.test.ts @@ -0,0 +1,58 @@ +import { IndexTag } from ".."; +import { tagToString } from "./utils"; + +test("tagToString returns full tag string when under length limit", () => { + const tag: IndexTag = { + directory: "/normal/path/to/repo", + branch: "main", + artifactId: "12345", + }; + + expect(tagToString(tag)).toBe("/normal/path/to/repo::main::12345"); +}); + +test("tagToString truncates beginning of directory when path is too long", () => { + // Create a very long directory path that exceeds MAX_DIR_LENGTH (200) + const longPrefix = "/very/long/path/that/will/be/truncated/"; + const importantSuffix = "/user/important-project/src/feature"; + const longPath = longPrefix + "x".repeat(200) + importantSuffix; + + const tag: IndexTag = { + directory: longPath, + branch: "feature-branch", + artifactId: "67890", + }; + + const result = tagToString(tag); + + // The result should keep the important suffix part + expect(result).toContain(importantSuffix); + // The result should NOT contain the beginning of the path + expect(result).not.toContain(longPrefix); + // The result should include the branch and artifactId + expect(result).toContain("::feature-branch::67890"); + // The result should be within the MAX_TABLE_NAME_LENGTH limit (240) + expect(result.length).toBeLessThanOrEqual(240); +}); + +test("tagToString preserves branch and artifactId exactly, even when truncating", () => { + const longPath = "/a".repeat(300); // Much longer than MAX_DIR_LENGTH + const tag: IndexTag = { + directory: longPath, + branch: "release-v2.0", + artifactId: "build-123", + }; + + const result = tagToString(tag); + + // Should contain the exact branch and artifactId + expect(result).toContain("::release-v2.0::build-123"); + // Should contain the end of the path + expect(result).toContain("/a/a/a"); + // Should not contain the full original path (it should be truncated) + expect(result.length).toBeLessThan( + longPath.length + "::release-v2.0::build-123".length, + ); + // The result should be within the MAX_TABLE_NAME_LENGTH limit + expect(result.length).toBeLessThanOrEqual(240); +}); diff --git a/core/indexing/utils.ts b/core/indexing/utils.ts new file mode 100644 index 000000000..0713507f0 --- /dev/null +++ b/core/indexing/utils.ts @@ -0,0 +1,45 @@ +import { IndexTag } from ".."; + +// Maximum length for table names to stay under OS filename limits +const MAX_TABLE_NAME_LENGTH = 240; + +// Leave room for branch and artifactId +const MAX_DIR_LENGTH = 200; + +/** + * Converts an IndexTag to a string representation, safely handling long paths. + * + * The string is used as a table name and identifier in various places, so it needs + * to stay under OS filename length limits (typically 255 chars). This is especially + * important for dev containers where the directory path can be very long due to + * containing container configuration. + * + * The format is: "{directory}::{branch}::{artifactId}" + * + * To handle long paths: + * 1. First tries the full string - most backwards compatible + * 2. If too long, truncates directory from the beginning to maintain uniqueness + * (since final parts of paths are more unique than prefixes) + * 3. Finally ensures entire string stays under MAX_TABLE_NAME_LENGTH for OS compatibility + * + * @param tag The tag containing directory, branch, and artifactId + * @returns A string representation safe for use as a table name + */ +export function tagToString(tag: IndexTag): string { + const result = `${tag.directory}::${tag.branch}::${tag.artifactId}`; + + if (result.length <= MAX_TABLE_NAME_LENGTH) { + return result; + } + + // Truncate from the beginning of directory path to preserve the more unique end parts + const dir = + tag.directory.length > MAX_DIR_LENGTH + ? tag.directory.slice(tag.directory.length - MAX_DIR_LENGTH) + : tag.directory; + + return `${dir}::${tag.branch}::${tag.artifactId}`.slice( + 0, + MAX_TABLE_NAME_LENGTH, + ); +} diff --git a/core/llm/llm.test.ts b/core/llm/llm.test.ts index d1067a8bc..7fb840d61 100644 --- a/core/llm/llm.test.ts +++ b/core/llm/llm.test.ts @@ -230,6 +230,7 @@ describe("LLM", () => { testFim: true, skip: false, testToolCall: true, + timeout: 60000, }, ); testLLM( diff --git a/core/llm/rules/getSystemMessageWithRules.ts b/core/llm/rules/getSystemMessageWithRules.ts index dacd941bb..3d7372fef 100644 --- a/core/llm/rules/getSystemMessageWithRules.ts +++ b/core/llm/rules/getSystemMessageWithRules.ts @@ -23,6 +23,29 @@ const matchesGlobs = ( return false; }; +/** + * Filters rules that apply to the given message + */ +export const getApplicableRules = ( + userMessage: UserChatMessage | ToolResultChatMessage | undefined, + rules: RuleWithSource[], +): RuleWithSource[] => { + const filePathsFromMessage = userMessage + ? extractPathsFromCodeBlocks(renderChatMessage(userMessage)) + : []; + + return rules.filter((rule) => { + // A rule is active if it has no globs (applies to all files) + // or if at least one file path matches its globs + const hasNoGlobs = !rule.globs; + const matchesAnyFilePath = filePathsFromMessage.some((path) => + matchesGlobs(path, rule.globs), + ); + + return hasNoGlobs || matchesAnyFilePath; + }); +}; + export const getSystemMessageWithRules = ({ baseSystemMessage, userMessage, @@ -32,23 +55,11 @@ export const getSystemMessageWithRules = ({ userMessage: UserChatMessage | ToolResultChatMessage | undefined; rules: RuleWithSource[]; }) => { - const filePathsFromMessage = userMessage - ? extractPathsFromCodeBlocks(renderChatMessage(userMessage)) - : []; - + const applicableRules = getApplicableRules(userMessage, rules); let systemMessage = baseSystemMessage ?? ""; - for (const rule of rules) { - // A rule is active if it has no globs (applies to all files) - // or if at least one file path matches its globs - const hasNoGlobs = !rule.globs; - const matchesAnyFilePath = filePathsFromMessage.some((path) => - matchesGlobs(path, rule.globs), - ); - - if (hasNoGlobs || matchesAnyFilePath) { - systemMessage += `\n\n${rule.rule}`; - } + for (const rule of applicableRules) { + systemMessage += `\n\n${rule.rule}`; } return systemMessage; diff --git a/core/llm/stream.test.ts b/core/llm/stream.test.ts new file mode 100644 index 000000000..c42604a3e --- /dev/null +++ b/core/llm/stream.test.ts @@ -0,0 +1,72 @@ +import { Readable } from "stream"; +import { streamSse } from "./stream"; + +function createMockResponse(sseLines: string[]): Response { + // Create a Readable stream that emits the SSE lines + const stream = new Readable({ + read() { + for (const line of sseLines) { + this.push(line + "\n\n"); + } + this.push(null); // End of stream + } + }) as any; + + // Minimal Response mock + return { + status: 200, + body: stream, + text: async () => "", + } as unknown as Response; +} + +describe("streamSse", () => { + it("yields parsed SSE data objects that ends with `data:[DONE]`", async () => { + const sseLines = [ + 'data: {"foo": "bar"}', + 'data: {"baz": 42}', + 'data:[DONE]' + ]; + const response = createMockResponse(sseLines); + + const results = []; + for await (const data of streamSse(response)) { + results.push(data); + } + + expect(results).toEqual([ + { foo: "bar" }, + { baz: 42 } + ]); + }); + + it("yields parsed SSE data objects that ends with `data: [DONE]` (with a space before [DONE]", async () => { + const sseLines = [ + 'data: {"foo": "bar"}', + 'data: {"baz": 42}', + 'data: [DONE]' + ]; + const response = createMockResponse(sseLines); + + const results = []; + for await (const data of streamSse(response)) { + results.push(data); + } + + expect(results).toEqual([ + { foo: "bar" }, + { baz: 42 } + ]); + }); + + it("throws on malformed JSON", async () => { + const sseLines = [ + 'data: {"foo": "bar"', + 'data:[DONE]' + ]; + const response = createMockResponse(sseLines); + + const iterator = streamSse(response)[Symbol.asyncIterator](); + await expect(iterator.next()).rejects.toThrow(/Malformed JSON/); + }); +}); diff --git a/core/llm/stream.ts b/core/llm/stream.ts index 0a014d931..78a4b60e3 100644 --- a/core/llm/stream.ts +++ b/core/llm/stream.ts @@ -58,7 +58,7 @@ function parseDataLine(line: string): any { } function parseSseLine(line: string): { done: boolean; data: any } { - if (line.startsWith("data: [DONE]")) { + if (line.startsWith("data:[DONE]") || line.startsWith("data: [DONE]")) { return { done: true, data: undefined }; } if (line.startsWith("data:")) { diff --git a/core/llm/templates/edit/gpt.ts b/core/llm/templates/edit/gpt.ts index 4dcc39523..61d23a732 100644 --- a/core/llm/templates/edit/gpt.ts +++ b/core/llm/templates/edit/gpt.ts @@ -64,6 +64,8 @@ export const gptEditPrompt: PromptTemplateFunction = (history, otherData) => { \`\`\` The user's request is: "${otherData.userInput}" + + DO NOT output any natural language, only output the code changes. Here is the rewritten code:`); diff --git a/core/package-lock.json b/core/package-lock.json index 71133e753..ea049ae74 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -15266,9 +15266,9 @@ } }, "node_modules/undici": { - "version": "6.21.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.1.tgz", - "integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==", + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz", + "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/core/promptFiles/v1/slashCommandFromPromptFile.ts b/core/promptFiles/v1/slashCommandFromPromptFile.ts index a934b2586..7f478e623 100644 --- a/core/promptFiles/v1/slashCommandFromPromptFile.ts +++ b/core/promptFiles/v1/slashCommandFromPromptFile.ts @@ -63,6 +63,7 @@ export function slashCommandFromPromptFileV1( name, description, prompt, + promptFile: path, run: async function* (context) { const userInput = extractUserInput(context.input, name); const [_, renderedPrompt] = await renderPromptFileV2(prompt, { diff --git a/core/protocol/core.ts b/core/protocol/core.ts index de061c730..ef4cde60b 100644 --- a/core/protocol/core.ts +++ b/core/protocol/core.ts @@ -9,7 +9,7 @@ import { AutocompleteInput } from "../autocomplete/util/types"; import { SharedConfigSchema } from "../config/sharedConfig"; import { GlobalContextModelSelections } from "../util/GlobalContext"; -import type { +import { BrowserSerializedContinueConfig, ChatMessage, ContextItem, @@ -29,6 +29,7 @@ import type { SessionMetadata, SiteIndexingConfig, SlashCommandDescription, + StreamDiffLinesPayload, ToolCall, } from "../"; import { SerializedOrgWithProfiles } from "../config/ProfileLifecycleManager"; @@ -142,18 +143,7 @@ export type ToCoreFromIdeOrWebviewProtocol = { }, AsyncGenerator, ]; - streamDiffLines: [ - { - prefix: string; - highlighted: string; - suffix: string; - input: string; - language: string | undefined; - modelTitle: string | undefined; - includeRulesInSystemMessage: boolean; - }, - AsyncGenerator, - ]; + streamDiffLines: [StreamDiffLinesPayload, AsyncGenerator]; "chatDescriber/describe": [ { text: string; diff --git a/core/protocol/ideWebview.ts b/core/protocol/ideWebview.ts index 17c09a348..3c836126a 100644 --- a/core/protocol/ideWebview.ts +++ b/core/protocol/ideWebview.ts @@ -1,11 +1,13 @@ import { ToIdeFromWebviewOrCoreProtocol } from "./ide"; import { ToWebviewFromIdeOrCoreProtocol } from "./webview"; -import type { +import { ApplyState, - CodeToEdit, + SetCodeToEditPayload, + HighlightedCodePayload, MessageContent, RangeInFileWithContents, + AcceptOrRejectDiffPayload, } from "../"; export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & { @@ -42,8 +44,8 @@ export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & { "jetbrains/getColors": [undefined, Record]; "vscode/openMoveRightMarkdown": [undefined, void]; setGitHubAuthToken: [{ token: string }, void]; - acceptDiff: [{ filepath: string; streamId?: string }, void]; - rejectDiff: [{ filepath: string; streamId?: string }, void]; + acceptDiff: [AcceptOrRejectDiffPayload, void]; + rejectDiff: [AcceptOrRejectDiffPayload, void]; "edit/sendPrompt": [ { prompt: MessageContent; @@ -63,15 +65,8 @@ export type ToWebviewFromIdeProtocol = ToWebviewFromIdeOrCoreProtocol & { focusContinueInput: [undefined, void]; focusContinueInputWithoutClear: [undefined, void]; focusContinueInputWithNewSession: [undefined, void]; - highlightedCode: [ - { - rangeInFileWithContents: RangeInFileWithContents; - prompt?: string; - shouldRun?: boolean; - }, - void, - ]; - setCodeToEdit: [CodeToEdit, void]; + highlightedCode: [HighlightedCodePayload, void]; + setCodeToEdit: [SetCodeToEditPayload, void]; navigateTo: [{ path: string; toggle?: boolean }, void]; addModel: [undefined, void]; diff --git a/core/tools/callTool.ts b/core/tools/callTool.ts index d8eaf4ffd..34501550b 100644 --- a/core/tools/callTool.ts +++ b/core/tools/callTool.ts @@ -29,11 +29,12 @@ async function callHttpTool( }), }); + const data = await response.json(); + if (!response.ok) { - throw new Error(`Failed to call tool: ${url}`); + throw new Error(`Failed to call tool at ${url}:\n${JSON.stringify(data)}`); } - const data = await response.json(); return data.output; } @@ -84,7 +85,7 @@ async function callToolFromUri( }); if (response.isError === true) { - throw new Error(`Failed to call tool: ${toolName}`); + throw new Error(JSON.stringify(response.content)); } const contextItems: ContextItem[] = []; @@ -130,6 +131,37 @@ async function callToolFromUri( } } +async function callBuiltInTool( + functionName: string, + args: any, + extras: ToolExtras, +): Promise { + switch (functionName) { + case BuiltInToolNames.ReadFile: + return await readFileImpl(args, extras); + case BuiltInToolNames.CreateNewFile: + return await createNewFileImpl(args, extras); + case BuiltInToolNames.GrepSearch: + return await grepSearchImpl(args, extras); + case BuiltInToolNames.FileGlobSearch: + return await fileGlobSearchImpl(args, extras); + case BuiltInToolNames.RunTerminalCommand: + return await runTerminalCommandImpl(args, extras); + case BuiltInToolNames.SearchWeb: + return await searchWebImpl(args, extras); + case BuiltInToolNames.ViewDiff: + return await viewDiffImpl(args, extras); + case BuiltInToolNames.LSTool: + return await lsToolImpl(args, extras); + case BuiltInToolNames.ReadCurrentlyOpenFile: + return await readCurrentlyOpenFileImpl(args, extras); + case BuiltInToolNames.CreateRuleBlock: + return await createRuleBlockImpl(args, extras); + default: + throw new Error(`Tool "${functionName}" not found`); + } +} + // Handles calls for core/non-client tools // Returns an error context item if the tool call fails // Note: Edit tool is handled on client @@ -141,44 +173,11 @@ export async function callTool( contextItems: ContextItem[]; errorMessage: string | undefined; }> { - const args = JSON.parse(callArgs || "{}"); - const uri = tool.uri ?? tool.function.name; try { - let contextItems: ContextItem[] = []; - switch (uri) { - case BuiltInToolNames.ReadFile: - contextItems = await readFileImpl(args, extras); - break; - case BuiltInToolNames.CreateNewFile: - contextItems = await createNewFileImpl(args, extras); - break; - case BuiltInToolNames.GrepSearch: - contextItems = await grepSearchImpl(args, extras); - break; - case BuiltInToolNames.FileGlobSearch: - contextItems = await fileGlobSearchImpl(args, extras); - break; - case BuiltInToolNames.RunTerminalCommand: - contextItems = await runTerminalCommandImpl(args, extras); - break; - case BuiltInToolNames.SearchWeb: - contextItems = await searchWebImpl(args, extras); - break; - case BuiltInToolNames.ViewDiff: - contextItems = await viewDiffImpl(args, extras); - break; - case BuiltInToolNames.LSTool: - contextItems = await lsToolImpl(args, extras); - break; - case BuiltInToolNames.ReadCurrentlyOpenFile: - contextItems = await readCurrentlyOpenFileImpl(args, extras); - break; - case BuiltInToolNames.CreateRuleBlock: - contextItems = await createRuleBlockImpl(args, extras); - break; - default: - contextItems = await callToolFromUri(uri, args, extras); - } + const args = JSON.parse(callArgs || "{}"); + const contextItems = tool.uri + ? await callToolFromUri(tool.uri, args, extras) + : await callBuiltInTool(tool.function.name, args, extras); if (tool.faviconUrl) { contextItems.forEach((item) => { item.icon = tool.faviconUrl; diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md deleted file mode 100644 index 148526daa..000000000 --- a/docs/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), -and is generated by [Changie](https://github.com/miniscruff/changie). - diff --git a/docs/docs/CLA.md b/docs/docs/CLA.md index 11a86a412..00cd9ef07 100644 --- a/docs/docs/CLA.md +++ b/docs/docs/CLA.md @@ -17,6 +17,13 @@ past and future “Contributions” submitted to **Continue (the “Project”)* ## 2. Copyright License +You grant **Continue Dev, Inc.** and all recipients of software distributed by the +Project a perpetual, worldwide, non‑exclusive, royalty‑free, irrevocable +license to reproduce, prepare derivative works of, publicly display, publicly +perform, sublicense, and distribute Your Contributions and derivative works. + +## 3. Patent License + You grant **Continue Dev, Inc.** and all recipients of the Project a perpetual, worldwide, non‑exclusive, royalty‑free, irrevocable (except as below) patent license to make, have made, use, sell, offer to sell, import, and otherwise @@ -38,4 +45,4 @@ entity under this CLA terminate. This Agreement is governed by the laws of the **State of California**, USA, excluding its conflict‑of‑laws rules. If any provision is held unenforceable, -the remaining provisions remain in force. \ No newline at end of file +the remaining provisions remain in force. diff --git a/docs/docs/customize/changelog.md b/docs/docs/customize/changelog.md new file mode 100644 index 000000000..ba501267a --- /dev/null +++ b/docs/docs/customize/changelog.md @@ -0,0 +1,13 @@ +--- +title: Continue Changelog +description: Redirecting to our Changelog +hide_table_of_contents: true +--- + +# Redirecting to Changelog + +If you are not redirected automatically, follow this [link to the changelog](https://changelog.continue.dev). + + + + \ No newline at end of file diff --git a/docs/docs/customize/changelog.mdx b/docs/docs/customize/changelog.mdx deleted file mode 100644 index 5a43266a3..000000000 --- a/docs/docs/customize/changelog.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Changelog -description: Changelogs for the latest releases of the VSCode and JetBrains extensions -keywords: [changelog] -hide_table_of_contents: true ---- - -import VSCodeChangelog from "../../../extensions/vscode/CHANGELOG.md"; -import JetBrainsChangelog from "../../../extensions/intellij/CHANGELOG.md"; - -Below are the changelogs for the latest releases of the VSCode and JetBrains extensions. Prior to 2024-07-02, the changelogs do not reflect all updates. - -import TOCInline from "@theme/TOCInline"; - - - node.value === "VSCode Changelog" || node.value === "JetBrains Changelog", - )} -/> - -
- -## VSCode Changelog - - - -## JetBrains Changelog - - diff --git a/docs/docs/customize/deep-dives/settings.md b/docs/docs/customize/deep-dives/settings.md index 0d3b57127..82af98c15 100644 --- a/docs/docs/customize/deep-dives/settings.md +++ b/docs/docs/customize/deep-dives/settings.md @@ -6,11 +6,11 @@ keywords: [config, settings, configuration, customize, customization, sidebar] # The User Settings Page -The **User Settings page** can be accessed by clicking the gear icon in the header of the Continue sidebar. +The **User Settings page** can be accessed by clicking the gear icon in the header of the Continue sidebar and then selecting the "Settings" tab. -![slash-commands](/img/header-buttons.png) +![settings](/img/settings-header.png) -Which takes you to this page: +Which takes you to this page (select the "Settings" tab): ![User Settings Page](/img/settings-page.png) @@ -26,7 +26,15 @@ Below that, the following settings which are not part of a configuration file ar - `Enable Indexing`: Enables indexing of the codebase for the @codebase and @code context providers. **On** by default. - `Font Size`: Specifies base font size for UI elements - `Multiline Autocompletions`: Controls multiline completions for autocomplete. Can be set to `always`, `never`, or `auto`. Defaults to `auto` -- `Disable autocomplete in files`: List of comma-separated glob pattern to disable autocomplete in matching files. E.g., "\_/.md, \*/.txt" +- `Autocomplete timeout`: Maximum time in milliseconds for autocomplete request/retreival. Defaults to 150 +- `Autocomplete debounce`: Minimum time in milliseconds to trigger an autocomplete request after a change. Defaults to 250 +- `Disable autocomplete in files`: List of comma-separated glob pattern to disable autocomplete in matching files. E.g., `**/*.{txt,md}` + +### Experimental settings + +At the bottom of the User Settings page there is an "Experimental Settings" section which contains new or otherwise experimental settings, including: + +- `Auto-Accept Agent Edits`: **CAUTION: Be very careful with this setting. When turned on, Agent mode's edit tool can make changes to files with no manual review or guaranteed stopping point. If on, diffs generated by the edit tool are automatically accepted and Agent proceeds with the next conversational turn.** Off by default. diff --git a/docs/docs/troubleshooting.mdx b/docs/docs/troubleshooting.mdx index 71eac9d9b..9692191eb 100644 --- a/docs/docs/troubleshooting.mdx +++ b/docs/docs/troubleshooting.mdx @@ -7,8 +7,6 @@ keywords: [reload, delete, manually, logs, server, console] import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs"; -The Continue VS Code extension is currently in beta, and the JetBrains extension is in Alpha. If you are having trouble, please follow the steps below. - 1. [Check the logs](#check-the-logs) 2. [Try the latest pre-release](#download-the-latest-pre-release) 3. [Download an older version](#download-an-older-version) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index c12f063da..030e9980c 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -65,6 +65,10 @@ const config = { ], ], + scripts: [ + '!function(){var e,t,n;e="7aa28ed11570734",t=function(){Reo.init({clientID:"7aa28ed11570734"})},(n=document.createElement("script")).src="https://static.reo.dev/"+e+"/reo.js",n.defer=!0,n.onload=t,document.head.appendChild(n)}();', + ], + themeConfig: /** @type {import("@docusaurus/preset-classic").ThemeConfig} */ ({ diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/changelog.mdx b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/changelog.mdx deleted file mode 100644 index ab9b5cb58..000000000 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/changelog.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: 变更日志 -description: VSCode 和 JetBrains 扩展最新版本的变更日志 -keywords: [变更日志] -hide_table_of_contents: true ---- - -import VSCodeChangelog from "../../../../../../extensions/vscode/CHANGELOG.md"; -import JetBrainsChangelog from "../../../../../../extensions/intellij/CHANGELOG.md"; - -以下是 VSCode 和 JetBrains 扩展最新版本的变更日志。在 2024-07-02 之前,变更日志没有反映所有更新。 - -import TOCInline from "@theme/TOCInline"; - - - node.value === "VSCode Changelog" || node.value === "JetBrains Changelog", - )} -/> - -
- -## VSCode 变更日志 - - - -## JetBrains 变更日志 - - diff --git a/docs/static/img/header-buttons.png b/docs/static/img/header-buttons.png deleted file mode 100644 index 6824043cf..000000000 Binary files a/docs/static/img/header-buttons.png and /dev/null differ diff --git a/docs/static/img/settings-header.png b/docs/static/img/settings-header.png new file mode 100644 index 000000000..9b241b164 Binary files /dev/null and b/docs/static/img/settings-header.png differ diff --git a/extensions/intellij/.run/Start Core Dev Server (CE).run.xml b/extensions/intellij/.run/Start Core Dev Server (CE).run.xml index d6c646ef9..53c668ab2 100644 --- a/extensions/intellij/.run/Start Core Dev Server (CE).run.xml +++ b/extensions/intellij/.run/Start Core Dev Server (CE).run.xml @@ -1,6 +1,6 @@ -