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/.github/workflows/cla.yaml b/.github/workflows/cla.yaml
index f915854d1..1c170855c 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
@@ -26,4 +26,5 @@ 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]
\ No newline at end of file
+ allowlist: dependabot[bot]
+ signed-commit-message: "CLA signed in $pullRequestNo"
diff --git a/.gitignore b/.gitignore
index 95cd177a9..3f3671e74 100644
--- a/.gitignore
+++ b/.gitignore
@@ -166,4 +166,5 @@ extensions/.continue-debug/
*.iml
.continuerules
-**/.continue/assistants/
\ No newline at end of file
+**/.continue/assistants/
+keys
\ 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
+
+
+
## 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

@@ -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

-## Agent
-
-[Agent](https://continue.dev/docs/agent/how-to-use-it) enables you to make more substantial changes to your codebase
-
-
@@ -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/core/autocomplete/generation/CompletionStreamer.ts b/core/autocomplete/generation/CompletionStreamer.ts
index d44957d15..fdaa09eb5 100644
--- a/core/autocomplete/generation/CompletionStreamer.ts
+++ b/core/autocomplete/generation/CompletionStreamer.ts
@@ -3,6 +3,7 @@ import { StreamTransformPipeline } from "../filtering/streamTransforms/StreamTra
import { HelperVars } from "../util/HelperVars";
import { GeneratorReuseManager } from "./GeneratorReuseManager";
+import { stopAfterMaxProcessingTime } from "./utils";
export class CompletionStreamer {
private streamTransformPipeline = new StreamTransformPipeline();
@@ -22,23 +23,37 @@ export class CompletionStreamer {
completionOptions: Partial | undefined,
helper: HelperVars,
) {
+ // Full stop means to stop the LLM's generation, instead of just truncating the displayed completion
+ const fullStop = () =>
+ this.generatorReuseManager.currentGenerator?.cancel();
+
// Try to reuse pending requests if what the user typed matches start of completion
const generator = this.generatorReuseManager.getGenerator(
prefix,
- (abortSignal: AbortSignal) =>
- llm.supportsFim()
+ (abortSignal: AbortSignal) => {
+ const generator = llm.supportsFim()
? llm.streamFim(prefix, suffix, abortSignal, completionOptions)
: llm.streamComplete(prompt, abortSignal, {
...completionOptions,
raw: true,
- }),
+ });
+
+ /**
+ * This transformer applies even on reused generator. We are deliberately
+ * not using streamTransformPipeline because we want to capture and stop
+ * the request even if the generator is being reused.
+ */
+ return helper.options.transform
+ ? stopAfterMaxProcessingTime(
+ generator,
+ helper.options.modelTimeout * 2.5,
+ fullStop,
+ )
+ : generator;
+ },
multiline,
);
- // Full stop means to stop the LLM's generation, instead of just truncating the displayed completion
- const fullStop = () =>
- this.generatorReuseManager.currentGenerator?.cancel();
-
// LLM
const generatorWithCancellation = async function* () {
for await (const update of generator) {
diff --git a/core/autocomplete/generation/utils.test.ts b/core/autocomplete/generation/utils.test.ts
new file mode 100644
index 000000000..40326177a
--- /dev/null
+++ b/core/autocomplete/generation/utils.test.ts
@@ -0,0 +1,138 @@
+import { jest } from "@jest/globals";
+import { stopAfterMaxProcessingTime } from "./utils";
+
+describe("stopAfterMaxProcessingTime", () => {
+ beforeEach(() => {
+ jest.useFakeTimers();
+ });
+
+ afterEach(() => {
+ jest.useRealTimers();
+ });
+
+ async function* createMockStream(chunks: string[]): AsyncGenerator {
+ for (const chunk of chunks) {
+ yield chunk;
+ }
+ }
+
+ async function streamToString(
+ stream: AsyncGenerator,
+ ): Promise {
+ let result = "";
+ for await (const chunk of stream) {
+ result += chunk;
+ }
+ return result;
+ }
+
+ it("should yield all chunks when maxTimeMs is not reached", async () => {
+ const mockStream = createMockStream(["Hello", " world", "!"]);
+ const fullStop = jest.fn();
+ const result = stopAfterMaxProcessingTime(mockStream, 1000, fullStop);
+
+ const output = await streamToString(result);
+
+ expect(output).toBe("Hello world!");
+ expect(fullStop).not.toHaveBeenCalled();
+ });
+
+ it.only("should stop processing after max time is reached", async () => {
+ // Mock implementation of Date.now
+ let currentTime = 0;
+ const originalDateNow = Date.now;
+ Date.now = jest.fn(() => currentTime);
+
+ // Create a generator that we can control
+ async function* controlledGenerator(): AsyncGenerator {
+ for (let i = 0; i < 100; i++) {
+ // After yielding 10 chunks, simulate time passing beyond our limit
+ if (i === 10) {
+ currentTime = 1000; // This exceeds our 500ms limit
+ }
+ yield `chunk-${i}`;
+ }
+ }
+
+ const fullStop = jest.fn();
+ const maxTimeMs = 500;
+
+ const transformedGenerator = stopAfterMaxProcessingTime(
+ controlledGenerator(),
+ maxTimeMs,
+ fullStop,
+ );
+
+ // Consume the generator and collect outputs
+ const outputs: string[] = [];
+ for await (const chunk of transformedGenerator) {
+ outputs.push(chunk);
+ }
+
+ // We expect:
+ // 1. Not all chunks were processed (less than 100)
+ // 2. fullStop was called
+ // 3. We processed at least the chunks before time was exceeded
+ expect(outputs.length).toBeLessThan(100);
+ expect(outputs.length).toBeGreaterThanOrEqual(10); // We should get at least the first 10 chunks
+ expect(fullStop).toHaveBeenCalled();
+
+ // Restore Date.now
+ Date.now = originalDateNow;
+ });
+
+ it("should check time only periodically based on checkInterval", async () => {
+ const chunks = Array(100).fill("x");
+ const mockStream = createMockStream(chunks);
+ const fullStop = jest.fn();
+
+ // Spy on Date.now to count how many times it's called
+ const dateSpy = jest.spyOn(Date, "now");
+
+ // Stream should complete normally (not hitting the timeout)
+ await streamToString(
+ stopAfterMaxProcessingTime(mockStream, 10000, fullStop),
+ );
+
+ // The first call is to set startTime, then once every checkInterval (10) chunks
+ // So for 100 chunks, we expect startTime + ~10 checks = ~11 calls
+ // We use a range because implementation details might vary slightly
+ expect(dateSpy.mock.calls.length).toBeGreaterThanOrEqual(1);
+ expect(dateSpy.mock.calls.length).toBeLessThanOrEqual(15);
+
+ dateSpy.mockRestore();
+ });
+
+ it("should handle empty stream gracefully", async () => {
+ const mockStream = createMockStream([]);
+ const fullStop = jest.fn();
+ const result = stopAfterMaxProcessingTime(mockStream, 1000, fullStop);
+
+ const output = await streamToString(result);
+
+ expect(output).toBe("");
+ expect(fullStop).not.toHaveBeenCalled();
+ });
+
+ it("should pass through all chunks if there's no timeout", async () => {
+ const chunks = Array(100).fill("test chunk");
+ const mockStream = createMockStream(chunks);
+ const fullStop = jest.fn();
+
+ // Use undefined as timeout to simulate no timeout
+ const result = stopAfterMaxProcessingTime(
+ mockStream,
+ undefined as any,
+ fullStop,
+ );
+
+ // Process the stream
+ const processedChunks = [];
+ for await (const chunk of result) {
+ processedChunks.push(chunk);
+ }
+
+ expect(processedChunks.length).toBe(chunks.length);
+ expect(fullStop).not.toHaveBeenCalled();
+ });
+});
diff --git a/core/autocomplete/generation/utils.ts b/core/autocomplete/generation/utils.ts
new file mode 100644
index 000000000..b5c94d9a9
--- /dev/null
+++ b/core/autocomplete/generation/utils.ts
@@ -0,0 +1,27 @@
+export async function* stopAfterMaxProcessingTime(
+ stream: AsyncGenerator,
+ maxTimeMs: number,
+ fullStop: () => void,
+): AsyncGenerator {
+ const startTime = Date.now();
+ /**
+ * Check every 10 chunks to avoid performance overhead.
+ */
+ const checkInterval = 10;
+ let chunkCount = 0;
+ let totalCharCount = 0;
+
+ for await (const chunk of stream) {
+ yield chunk;
+
+ chunkCount++;
+ totalCharCount += chunk.length;
+
+ if (chunkCount % checkInterval === 0) {
+ if (Date.now() - startTime > maxTimeMs) {
+ fullStop();
+ return;
+ }
+ }
+ }
+}
diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts
index 76ccceb81..deae7da38 100644
--- a/core/config/ConfigHandler.ts
+++ b/core/config/ConfigHandler.ts
@@ -1,10 +1,6 @@
import { ConfigResult } from "@continuedev/config-yaml";
-import {
- ControlPlaneClient,
- ControlPlaneSessionInfo,
-} from "../control-plane/client.js";
-import { getControlPlaneEnv } from "../control-plane/env.js";
+import { ControlPlaneClient } from "../control-plane/client.js";
import {
BrowserSerializedContinueConfig,
ContinueConfig,
@@ -15,6 +11,11 @@ import {
} from "../index.js";
import { GlobalContext } from "../util/GlobalContext.js";
+import {
+ AuthType,
+ ControlPlaneSessionInfo,
+} from "../control-plane/AuthTypes.js";
+import { getControlPlaneEnv } from "../control-plane/env.js";
import { logger } from "../util/logger.js";
import {
ASSISTANTS,
@@ -136,8 +137,7 @@ export class ConfigHandler {
}
private async getOrgs(): Promise {
- const userId = await this.controlPlaneClient.userId;
- if (userId) {
+ if (await this.controlPlaneClient.isSignedIn()) {
const orgDescs = await this.controlPlaneClient.listOrganizations();
const personalHubOrg = await this.getPersonalHubOrg();
const hubOrgs = await Promise.all(
@@ -270,6 +270,13 @@ export class ConfigHandler {
/**
* Users can define as many local assistants as they want in a `.continue/assistants` folder
*/
+
+ // Local customization disabled for on-premise deployments
+ const env = await getControlPlaneEnv(this.ide.getIdeSettings());
+ if (env.AUTH_TYPE === AuthType.OnPrem) {
+ return [];
+ }
+
const localProfiles: ProfileLifecycleManager[] = [];
if (options.includeGlobal) {
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/context/mcp/MCPConnection.ts b/core/context/mcp/MCPConnection.ts
index 56e90e8e7..875f20f78 100644
--- a/core/context/mcp/MCPConnection.ts
+++ b/core/context/mcp/MCPConnection.ts
@@ -13,6 +13,7 @@ import {
MCPServerStatus,
MCPTool,
} from "../..";
+import { getEnvPathFromUserShell } from "../../util/shellPath";
const DEFAULT_MCP_TIMEOUT = 20_000; // 20 seconds
@@ -29,17 +30,14 @@ const WINDOWS_BATCH_COMMANDS = [
class MCPConnection {
public client: Client;
- private transport: Transport;
-
- private connectionPromise: Promise | null = null;
public abortController: AbortController;
-
public status: MCPConnectionStatus = "not-connected";
public errors: string[] = [];
-
public prompts: MCPPrompt[] = [];
public tools: MCPTool[] = [];
public resources: MCPResource[] = [];
+ private transport: Transport;
+ private connectionPromise: Promise | null = null;
constructor(public options: MCPOptions) {
this.transport = this.constructTransport(options);
@@ -63,80 +61,6 @@ class MCPConnection {
await this.transport.close();
}
- /**
- * Resolves the command and arguments for the current platform
- * On Windows, batch script commands need to be executed via cmd.exe
- * @param originalCommand The original command
- * @param originalArgs The original command arguments
- * @returns An object with the resolved command and arguments
- */
- private resolveCommandForPlatform(
- originalCommand: string,
- originalArgs: string[],
- ): { command: string; args: string[] } {
- // If not on Windows or not a batch command, return as-is
- if (
- process.platform !== "win32" ||
- !WINDOWS_BATCH_COMMANDS.includes(originalCommand)
- ) {
- return { command: originalCommand, args: originalArgs };
- }
-
- // On Windows, we need to execute batch commands via cmd.exe
- // Format: cmd.exe /c command [args]
- return {
- command: "cmd.exe",
- args: ["/c", originalCommand, ...originalArgs],
- };
- }
-
- private constructTransport(options: MCPOptions): Transport {
- switch (options.transport.type) {
- case "stdio":
- const env: Record = options.transport.env
- ? { ...options.transport.env }
- : {};
-
- if (process.env.PATH !== undefined) {
- env.PATH = process.env.PATH;
- }
-
- // Resolve the command and args for the current platform
- const { command, args } = this.resolveCommandForPlatform(
- options.transport.command,
- options.transport.args || [],
- );
-
- return new StdioClientTransport({
- command,
- args,
- env,
- });
- case "websocket":
- return new WebSocketClientTransport(new URL(options.transport.url));
- case "sse":
- return new SSEClientTransport(new URL(options.transport.url), {
- eventSourceInit: {
- fetch: (input, init) =>
- fetch(input, {
- ...init,
- headers: {
- ...init?.headers,
- ...(options.transport.requestOptions?.headers as
- | Record
- | undefined),
- },
- }),
- },
- requestInit: { headers: options.transport.requestOptions?.headers },
- });
- default:
- throw new Error(
- `Unsupported transport type: ${(options.transport as any).type}`,
- );
- }
- }
-
getStatus(): MCPServerStatus {
return {
...this.options,
@@ -302,6 +226,93 @@ class MCPConnection {
await this.connectionPromise;
}
+
+ /**
+ * Resolves the command and arguments for the current platform
+ * On Windows, batch script commands need to be executed via cmd.exe
+ * @param originalCommand The original command
+ * @param originalArgs The original command arguments
+ * @returns An object with the resolved command and arguments
+ */
+ private resolveCommandForPlatform(
+ originalCommand: string,
+ originalArgs: string[],
+ ): { command: string; args: string[] } {
+ // If not on Windows or not a batch command, return as-is
+ if (
+ process.platform !== "win32" ||
+ !WINDOWS_BATCH_COMMANDS.includes(originalCommand)
+ ) {
+ return { command: originalCommand, args: originalArgs };
+ }
+
+ // On Windows, we need to execute batch commands via cmd.exe
+ // Format: cmd.exe /c command [args]
+ return {
+ command: "cmd.exe",
+ args: ["/c", originalCommand, ...originalArgs],
+ };
+ }
+
+ private constructTransport(options: MCPOptions): Transport {
+ switch (options.transport.type) {
+ case "stdio":
+ const env: Record = options.transport.env
+ ? { ...options.transport.env }
+ : {};
+
+ if (process.env.PATH !== undefined) {
+ // Set the initial PATH from process.env
+ env.PATH = process.env.PATH;
+
+ // For non-Windows platforms, try to get the PATH from user shell
+ if (process.platform !== "win32") {
+ try {
+ const shellEnvPath = getEnvPathFromUserShell();
+ if (shellEnvPath && shellEnvPath !== process.env.PATH) {
+ env.PATH = shellEnvPath;
+ }
+ } catch (err) {
+ console.error("Error getting PATH:", err);
+ }
+ }
+ }
+
+ // Resolve the command and args for the current platform
+ const { command, args } = this.resolveCommandForPlatform(
+ options.transport.command,
+ options.transport.args || [],
+ );
+
+ return new StdioClientTransport({
+ command,
+ args,
+ env,
+ });
+ case "websocket":
+ return new WebSocketClientTransport(new URL(options.transport.url));
+ case "sse":
+ return new SSEClientTransport(new URL(options.transport.url), {
+ eventSourceInit: {
+ fetch: (input, init) =>
+ fetch(input, {
+ ...init,
+ headers: {
+ ...init?.headers,
+ ...(options.transport.requestOptions?.headers as
+ | Record
+ | undefined),
+ },
+ }),
+ },
+ requestInit: { headers: options.transport.requestOptions?.headers },
+ });
+ default:
+ throw new Error(
+ `Unsupported transport type: ${(options.transport as any).type}`,
+ );
+ }
+ }
}
export default MCPConnection;
diff --git a/core/control-plane/AuthTypes.ts b/core/control-plane/AuthTypes.ts
new file mode 100644
index 000000000..c926efac1
--- /dev/null
+++ b/core/control-plane/AuthTypes.ts
@@ -0,0 +1,55 @@
+export interface HubSessionInfo {
+ AUTH_TYPE: AuthType.WorkOsProd | AuthType.WorkOsStaging;
+ accessToken: string;
+ account: {
+ label: string;
+ id: string;
+ };
+}
+
+export interface OnPremSessionInfo {
+ AUTH_TYPE: AuthType.OnPrem;
+}
+
+export type ControlPlaneSessionInfo = HubSessionInfo | OnPremSessionInfo;
+
+export function isHubSession(
+ sessionInfo: ControlPlaneSessionInfo | undefined,
+): sessionInfo is HubSessionInfo {
+ return (
+ sessionInfo !== undefined &&
+ (sessionInfo.AUTH_TYPE === AuthType.WorkOsProd ||
+ sessionInfo.AUTH_TYPE === AuthType.WorkOsStaging)
+ );
+}
+
+export enum AuthType {
+ WorkOsProd = "continue",
+ WorkOsStaging = "continue-staging",
+ OnPrem = "on-prem",
+}
+
+export interface HubEnv {
+ DEFAULT_CONTROL_PLANE_PROXY_URL: string;
+ CONTROL_PLANE_URL: string;
+ AUTH_TYPE: AuthType.WorkOsProd | AuthType.WorkOsStaging;
+ WORKOS_CLIENT_ID: string;
+ APP_URL: string;
+}
+
+export interface OnPremEnv {
+ AUTH_TYPE: AuthType.OnPrem;
+ DEFAULT_CONTROL_PLANE_PROXY_URL: string;
+ CONTROL_PLANE_URL: string;
+ APP_URL: string;
+}
+
+export type ControlPlaneEnv = HubEnv | OnPremEnv;
+
+export function isHubEnv(env: ControlPlaneEnv): env is HubEnv {
+ return (
+ "AUTH_TYPE" in env &&
+ env.AUTH_TYPE !== "on-prem" &&
+ "WORKOS_CLIENT_ID" in env
+ );
+}
diff --git a/core/control-plane/auth/index.ts b/core/control-plane/auth/index.ts
index a3441ab65..5e8748ab9 100644
--- a/core/control-plane/auth/index.ts
+++ b/core/control-plane/auth/index.ts
@@ -1,5 +1,6 @@
import { v4 as uuidv4 } from "uuid";
import { IdeSettings } from "../..";
+import { isHubEnv } from "../AuthTypes";
import { getControlPlaneEnv } from "../env";
export async function getAuthUrlForTokenPage(
@@ -7,6 +8,11 @@ export async function getAuthUrlForTokenPage(
useOnboarding: boolean,
): Promise {
const env = await getControlPlaneEnv(ideSettingsPromise);
+
+ if (!isHubEnv(env)) {
+ throw new Error("Sign in disabled");
+ }
+
const url = new URL("https://api.workos.com/user_management/authorize");
const params = {
response_type: "code",
diff --git a/core/control-plane/client.ts b/core/control-plane/client.ts
index 77a3dc108..914ada0ba 100644
--- a/core/control-plane/client.ts
+++ b/core/control-plane/client.ts
@@ -12,16 +12,9 @@ import fetch, { RequestInit, Response } from "node-fetch";
import { OrganizationDescription } from "../config/ProfileLifecycleManager.js";
import { IdeSettings, ModelDescription } from "../index.js";
+import { ControlPlaneSessionInfo, isHubSession } from "./AuthTypes.js";
import { getControlPlaneEnv } from "./env.js";
-export interface ControlPlaneSessionInfo {
- accessToken: string;
- account: {
- label: string;
- id: string;
- };
-}
-
export interface ControlPlaneWorkspace {
id: string;
name: string;
@@ -45,8 +38,7 @@ export class ControlPlaneClient {
fqsns: FQSN[],
orgScopeId: string | null,
): Promise<(SecretResult | undefined)[]> {
- const userId = await this.userId;
- if (!userId) {
+ if (!this.isSignedIn()) {
return fqsns.map((fqsn) => ({
found: false,
fqsn,
@@ -64,19 +56,24 @@ export class ControlPlaneClient {
return (await resp.json()) as any;
}
- get userId(): Promise {
- return this.sessionInfoPromise.then(
- (sessionInfo) => sessionInfo?.account.id,
- );
+ async isSignedIn(): Promise {
+ const sessionInfo = await this.sessionInfoPromise;
+ return !!sessionInfo;
}
async getAccessToken(): Promise {
- return (await this.sessionInfoPromise)?.accessToken;
+ const sessionInfo = await this.sessionInfoPromise;
+ return isHubSession(sessionInfo) ? sessionInfo.accessToken : undefined;
}
private async request(path: string, init: RequestInit): Promise {
- const accessToken = await this.getAccessToken();
- if (!accessToken) {
+ const sessionInfo = await this.sessionInfoPromise;
+ const hubSession = isHubSession(sessionInfo);
+
+ const accessToken = hubSession ? sessionInfo.accessToken : undefined;
+
+ // Bearer token not necessary for on-prem auth type
+ if (!accessToken && hubSession) {
throw new Error("No access token");
}
@@ -99,22 +96,6 @@ export class ControlPlaneClient {
return resp;
}
- public async listWorkspaces(): Promise {
- const userId = await this.userId;
- if (!userId) {
- return [];
- }
-
- try {
- const resp = await this.request("workspaces", {
- method: "GET",
- });
- return (await resp.json()) as any;
- } catch (e) {
- return [];
- }
- }
-
public async listAssistants(organizationId: string | null): Promise<
{
configResult: ConfigResult;
@@ -124,8 +105,7 @@ export class ControlPlaneClient {
rawYaml: string;
}[]
> {
- const userId = await this.userId;
- if (!userId) {
+ if (!this.isSignedIn()) {
return [];
}
@@ -144,9 +124,7 @@ export class ControlPlaneClient {
}
public async listOrganizations(): Promise> {
- const userId = await this.userId;
-
- if (!userId) {
+ if (!this.isSignedIn()) {
return [];
}
@@ -164,8 +142,7 @@ export class ControlPlaneClient {
public async listAssistantFullSlugs(
organizationId: string | null,
): Promise {
- const userId = await this.userId;
- if (!userId) {
+ if (!this.isSignedIn()) {
return null;
}
@@ -183,16 +160,4 @@ export class ControlPlaneClient {
return null;
}
}
-
- async getSettingsForWorkspace(workspaceId: string): Promise {
- const userId = await this.userId;
- if (!userId) {
- throw new Error("No user id");
- }
-
- const resp = await this.request(`workspaces/${workspaceId}`, {
- method: "GET",
- });
- return ((await resp.json()) as any).settings;
- }
}
diff --git a/core/control-plane/env.ts b/core/control-plane/env.ts
index acbc20b59..2d76017d2 100644
--- a/core/control-plane/env.ts
+++ b/core/control-plane/env.ts
@@ -4,27 +4,18 @@ import {
getLocalEnvironmentDotFilePath,
getStagingEnvironmentDotFilePath,
} from "../util/paths";
-
-export interface ControlPlaneEnv {
- DEFAULT_CONTROL_PLANE_PROXY_URL: string;
- CONTROL_PLANE_URL: string;
- AUTH_TYPE: string;
- WORKOS_CLIENT_ID: string;
- APP_URL: string;
-}
+import { AuthType, ControlPlaneEnv } from "./AuthTypes";
+import { getMdmKeys } from "./mdm";
export const EXTENSION_NAME = "continue";
const WORKOS_CLIENT_ID_PRODUCTION = "client_01J0FW6XN8N2XJAECF7NE0Y65J";
const WORKOS_CLIENT_ID_STAGING = "client_01J0FW6XCPMJMQ3CG51RB4HBZQ";
-const WORKOS_ENV_ID_PRODUCTION = "continue";
-const WORKOS_ENV_ID_STAGING = "continue-staging";
-
const PRODUCTION_HUB_ENV: ControlPlaneEnv = {
DEFAULT_CONTROL_PLANE_PROXY_URL: "https://api.continue.dev/",
CONTROL_PLANE_URL: "https://api.continue.dev/",
- AUTH_TYPE: WORKOS_ENV_ID_PRODUCTION,
+ AUTH_TYPE: AuthType.WorkOsProd,
WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_PRODUCTION,
APP_URL: "https://hub.continue.dev/",
};
@@ -32,7 +23,7 @@ const PRODUCTION_HUB_ENV: ControlPlaneEnv = {
const STAGING_ENV: ControlPlaneEnv = {
DEFAULT_CONTROL_PLANE_PROXY_URL: "https://api.continue-stage.tools/",
CONTROL_PLANE_URL: "https://api.continue-stage.tools/",
- AUTH_TYPE: WORKOS_ENV_ID_STAGING,
+ AUTH_TYPE: AuthType.WorkOsStaging,
WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_STAGING,
APP_URL: "https://hub.continue-stage.tools/",
};
@@ -40,7 +31,7 @@ const STAGING_ENV: ControlPlaneEnv = {
const TEST_ENV: ControlPlaneEnv = {
DEFAULT_CONTROL_PLANE_PROXY_URL: "https://api-test.continue.dev/",
CONTROL_PLANE_URL: "https://api-test.continue.dev/",
- AUTH_TYPE: WORKOS_ENV_ID_STAGING,
+ AUTH_TYPE: AuthType.WorkOsStaging,
WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_STAGING,
APP_URL: "https://app-test.continue.dev/",
};
@@ -48,7 +39,7 @@ const TEST_ENV: ControlPlaneEnv = {
const LOCAL_ENV: ControlPlaneEnv = {
DEFAULT_CONTROL_PLANE_PROXY_URL: "http://localhost:3001/",
CONTROL_PLANE_URL: "http://localhost:3001/",
- AUTH_TYPE: WORKOS_ENV_ID_STAGING,
+ AUTH_TYPE: AuthType.WorkOsStaging,
WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_STAGING,
APP_URL: "http://localhost:3000/",
};
@@ -67,6 +58,18 @@ export async function getControlPlaneEnv(
export function getControlPlaneEnvSync(
ideTestEnvironment: IdeSettings["continueTestEnvironment"],
): ControlPlaneEnv {
+ // MDM override
+ const mdmKeys = getMdmKeys();
+ if (mdmKeys) {
+ const { apiUrl } = mdmKeys;
+ return {
+ AUTH_TYPE: AuthType.OnPrem,
+ DEFAULT_CONTROL_PLANE_PROXY_URL: apiUrl,
+ CONTROL_PLANE_URL: apiUrl,
+ APP_URL: "https://hub.continue.dev/",
+ };
+ }
+
// Note .local overrides .staging
if (fs.existsSync(getLocalEnvironmentDotFilePath())) {
return LOCAL_ENV;
diff --git a/core/control-plane/mdm.test.ts b/core/control-plane/mdm.test.ts
new file mode 100644
index 000000000..18fbe846a
--- /dev/null
+++ b/core/control-plane/mdm.test.ts
@@ -0,0 +1,127 @@
+import * as crypto from "crypto";
+import { LicenseData, validateLicenseKey } from "./mdm";
+
+// We'll create a real key pair once for all tests
+const testKeyPair = crypto.generateKeyPairSync("rsa", {
+ modulusLength: 2048,
+ publicKeyEncoding: {
+ type: "spki",
+ format: "pem",
+ },
+ privateKeyEncoding: {
+ type: "pkcs8",
+ format: "pem",
+ },
+});
+
+// Custom function to create test licenses (replaces the original mock-dependent one)
+function createTestLicense(
+ licenseData: LicenseData,
+ useValidSignature: boolean = true,
+): string {
+ // Convert license data to a string
+ const licenseDataStr = JSON.stringify(licenseData);
+
+ // Create a signature with our generated private key
+ const sign = crypto.createSign("SHA256");
+ sign.update(licenseDataStr);
+ sign.end();
+
+ let signature: string;
+ if (useValidSignature) {
+ signature = sign.sign(testKeyPair.privateKey, "base64");
+ } else {
+ // For invalid tests, create an intentionally wrong signature by signing different data
+ const wrongSign = crypto.createSign("SHA256");
+ wrongSign.update(licenseDataStr + "tampered");
+ wrongSign.end();
+ signature = wrongSign.sign(testKeyPair.privateKey, "base64");
+ }
+ // Combine data and signature into a license key
+ const licenseKeyObj = {
+ data: licenseDataStr,
+ signature: signature,
+ };
+
+ return Buffer.from(JSON.stringify(licenseKeyObj)).toString("base64");
+}
+
+// We need to test the actual implementation - which we can't mock with ESM
+// Instead, we'll have tests that bypass validation or are expected to fail
+// depending on what we're testing
+
+test("validateLicenseKey returns false for malformed license key", () => {
+ // Test with a completely invalid license key
+ const invalidLicenseKey = "not-a-valid-license-key";
+
+ // Test - no mocks, real validation
+ const result = validateLicenseKey(invalidLicenseKey);
+
+ // Assert
+ expect(result).toBe(false);
+});
+
+test("validateLicenseKey returns false for invalid JSON in license key", () => {
+ // Create a malformed but base64-encoded string
+ const malformedLicenseKey = Buffer.from("this is not valid JSON").toString(
+ "base64",
+ );
+
+ // Test - no mocks, real validation
+ const result = validateLicenseKey(malformedLicenseKey);
+
+ // Assert
+ expect(result).toBe(false);
+});
+
+test("validateLicenseKey returns false for expired license", () => {
+ // Without mocking, we expect this to fail signature verification
+ // We're testing the date logic by itself
+ const licenseData: LicenseData = {
+ customerId: "customer123",
+ createdAt: new Date(Date.now() - 2000 * 60 * 60 * 24).toISOString(), // Created 2 days ago
+ expiresAt: new Date(Date.now() - 1000 * 60 * 60 * 24).toISOString(), // Expired 1 day ago
+ };
+
+ // Create a license key - will fail verification but test logic still works
+ const expiredLicenseKey = createTestLicense(licenseData);
+
+ // Test - expect false, either due to signature or expiration - both are valid test cases
+ const result = validateLicenseKey(expiredLicenseKey);
+
+ // Assert
+ expect(result).toBe(false);
+});
+
+test("validateLicenseKey returns false for invalid signature", () => {
+ // Create license data with valid dates
+ const licenseData: LicenseData = {
+ customerId: "customer123",
+ createdAt: new Date().toISOString(),
+ expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString(), // Valid for 1 day
+ };
+
+ // Create a license with an invalid signature
+ const invalidSignatureKey = createTestLicense(licenseData, false);
+
+ // Test - no mocks, real validation
+ const result = validateLicenseKey(invalidSignatureKey);
+
+ // Assert
+ expect(result).toBe(false);
+});
+
+test("validateLicenseKey handles JSON parsing errors gracefully", () => {
+ // Create a base64 string that decodes to valid JSON but lacks required fields
+ const invalidStructureKey = Buffer.from(
+ JSON.stringify({
+ notTheRightField: "wrong structure",
+ }),
+ ).toString("base64");
+
+ // Test - no mocks, real validation
+ const result = validateLicenseKey(invalidStructureKey);
+
+ // Assert
+ expect(result).toBe(false);
+});
diff --git a/core/control-plane/mdm.ts b/core/control-plane/mdm.ts
new file mode 100644
index 000000000..81599fea0
--- /dev/null
+++ b/core/control-plane/mdm.ts
@@ -0,0 +1,262 @@
+import * as crypto from "crypto";
+import * as fs from "fs";
+import * as os from "os";
+import * as path from "path";
+import * as plist from "plist";
+
+export interface MdmKeys {
+ licenseKey: string;
+ apiUrl: string;
+}
+
+const CONTINUE_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz1pFVzsW2UScSnaPAwFp
+93QU4+txtyJj8AOC3Kx7YkX1d48DGU2Fy1he7SXPHgcuhXYIqfWGn/Vy/4yJxXD7
+HlU8RM7LlWHRk7ecAvF4WtxZDjPE0OSG5T69w5f7tMCtQPQseInCKqleJuCjxrvA
+zyTWTwKA1S6e+KxXS/kbqsumriljFujNr6Gmh8ygDnpF055Xo0vTenkMipVw/oYn
+U0EHx5ic+Fmcob3EyOj25lu/CVYtU1Rn8jPbrBOMiIq5sePh2QXOwGRsuTiZk2mP
+LXSsjLbeWHifRrQ18wj/PC990E33QaFGNFp0NcBXMPbq5eKYKEzKZ0GsxtLoGxar
+FQIDAQAB
+-----END PUBLIC KEY-----`;
+
+export interface LicenseData {
+ customerId: string;
+ createdAt: string;
+ expiresAt: string;
+}
+
+export function validateLicenseKey(licenseKey: string): boolean {
+ try {
+ // Decode the base64 license key
+ const decodedString = Buffer.from(licenseKey, "base64").toString("utf8");
+ const { data, signature } = JSON.parse(decodedString);
+
+ // Verify the signature
+ const verify = crypto.createVerify("SHA256");
+ verify.update(data);
+ verify.end();
+
+ const isValid = verify.verify(CONTINUE_PUBLIC_KEY, signature, "base64");
+
+ if (!isValid) return false;
+
+ // Check license expiration
+ const licenseData: LicenseData = JSON.parse(data);
+ const expirationDate = new Date(licenseData.expiresAt);
+ const now = new Date();
+
+ return expirationDate > now;
+ } catch (error) {
+ console.error("License validation error:", error);
+ return false;
+ }
+}
+
+function extractConfigFromArray(config: any[]): Record {
+ const configObj: Record = {};
+
+ for (let i = 0; i < config.length; i += 2) {
+ if (i + 1 < config.length) {
+ const key = config[i];
+ const value = config[i + 1];
+ if (typeof key === "string") {
+ configObj[key] = value as string;
+ }
+ }
+ }
+
+ return configObj;
+}
+
+const MACOS_MDM_PATHS = [
+ // Organization-specific MDM plist
+ "/Library/Managed Preferences/dev.continue.app.plist",
+ // User-specific MDM plist
+ path.join(os.homedir(), "Library/Managed Preferences/dev.continue.app.plist"),
+];
+
+function readMdmKeysMacOS(): MdmKeys | undefined {
+ try {
+ // MDM configuration is typically stored in /Library/Managed Preferences/ on macOS
+ // The filename is often the bundle identifier of the application
+
+ // Try to find a valid MDM configuration file
+ for (const mdmPath of MACOS_MDM_PATHS) {
+ if (fs.existsSync(mdmPath)) {
+ // Read the file content
+ const fileContent = fs.readFileSync(mdmPath, "utf8");
+
+ try {
+ // Parse the plist file using the plist package
+ const config = plist.parse(fileContent);
+
+ // Extract the relevant fields from the config
+ // Config is an array of alternating keys and values
+ if (Array.isArray(config)) {
+ const configObj = extractConfigFromArray(config);
+
+ // Check if required keys are present
+ if (configObj.licenseKey && configObj.apiUrl) {
+ return {
+ licenseKey: configObj.licenseKey,
+ apiUrl: configObj.apiUrl,
+ };
+ }
+ }
+ } catch (parseError) {
+ console.error(`Error parsing MDM configuration: ${parseError}`);
+ }
+ }
+ }
+
+ return undefined;
+ } catch (error) {
+ console.error("Error reading macOS MDM keys:", error);
+ return undefined;
+ }
+}
+
+function readMdmKeysWindows(): MdmKeys | undefined {
+ try {
+ // For Windows, we need to read from the registry
+ // Using regedit or another synchronous registry access module
+ const { execSync } = require("child_process");
+
+ // Path to the registry where MDM configuration is stored
+ const regPath = "HKLM\\Software\\Continue\\MDM";
+ const userRegPath = "HKCU\\Software\\Continue\\MDM";
+
+ // Try to read from HKEY_LOCAL_MACHINE first
+ try {
+ // Use REG QUERY command to read registry values
+ const licenseKeyCmd = `reg query "${regPath}" /v licenseKey`;
+ const apiUrlCmd = `reg query "${regPath}" /v apiUrl`;
+
+ const licenseKeyOutput = execSync(licenseKeyCmd, { encoding: "utf8" });
+ const apiUrlOutput = execSync(apiUrlCmd, { encoding: "utf8" });
+
+ // Extract values from command output
+ const licenseKey = extractRegValue(licenseKeyOutput);
+ const apiUrl = extractRegValue(apiUrlOutput);
+
+ if (licenseKey && apiUrl) {
+ return { licenseKey, apiUrl };
+ }
+ } catch (error) {
+ // Registry key might not exist, fallback to HKEY_CURRENT_USER
+ }
+
+ // Try HKEY_CURRENT_USER if not found in HKEY_LOCAL_MACHINE
+ try {
+ const licenseKeyCmd = `reg query "${userRegPath}" /v licenseKey`;
+ const apiUrlCmd = `reg query "${userRegPath}" /v apiUrl`;
+
+ const licenseKeyOutput = execSync(licenseKeyCmd, { encoding: "utf8" });
+ const apiUrlOutput = execSync(apiUrlCmd, { encoding: "utf8" });
+
+ // Extract values from command output
+ const licenseKey = extractRegValue(licenseKeyOutput);
+ const apiUrl = extractRegValue(apiUrlOutput);
+
+ if (licenseKey && apiUrl) {
+ return { licenseKey, apiUrl };
+ }
+ } catch (error) {
+ // Registry key might not exist in HKCU either
+ }
+
+ return undefined;
+ } catch (error) {
+ console.error("Error reading Windows MDM keys:", error);
+ return undefined;
+ }
+}
+
+// Helper function to extract registry values from reg query output
+function extractRegValue(output: string): string | undefined {
+ const match = output.match(/REG_SZ\s+(.+)$/m);
+ return match ? match[1].trim() : undefined;
+}
+
+// Common locations for MDM configurations in Linux systems
+const LINUX_MDM_PATHS = [
+ // System-wide configuration
+ "/etc/continue/mdm.json",
+ "/var/lib/continue/mdm.json",
+ // User-specific configuration
+ path.join(os.homedir(), ".config/continue/mdm.json"),
+];
+
+function readMdmKeysLinux(): MdmKeys | undefined {
+ try {
+ // Try to find a valid MDM configuration file
+ for (const mdmPath of LINUX_MDM_PATHS) {
+ if (fs.existsSync(mdmPath)) {
+ // Read the file content
+ const fileContent = fs.readFileSync(mdmPath, "utf8");
+
+ try {
+ // Parse the JSON configuration file
+ const config = JSON.parse(fileContent);
+
+ // Check if required keys are present
+ if (config.licenseKey && config.apiUrl) {
+ return {
+ licenseKey: config.licenseKey,
+ apiUrl: config.apiUrl,
+ };
+ }
+ } catch (parseError) {
+ console.error(`Error parsing Linux MDM configuration: ${parseError}`);
+ }
+ }
+ }
+
+ return undefined;
+ } catch (error) {
+ console.error("Error reading Linux MDM keys:", error);
+ return undefined;
+ }
+}
+
+function readMdmKeys(): MdmKeys | undefined {
+ const platform = os.platform();
+
+ switch (platform) {
+ case "darwin":
+ return readMdmKeysMacOS();
+
+ case "win32":
+ return readMdmKeysWindows();
+
+ case "linux":
+ return readMdmKeysLinux();
+
+ default:
+ console.error(`MDM keys not supported on platform: ${platform}`);
+ return undefined;
+ }
+}
+
+/**
+ * Read and validate MDM keys from the operating system's configuration files or registry.
+ */
+export function getMdmKeys(): MdmKeys | undefined {
+ try {
+ const mdmKeys = readMdmKeys();
+
+ if (mdmKeys) {
+ if (!validateLicenseKey(mdmKeys.licenseKey)) {
+ console.error("Invalid license key found: ", mdmKeys.licenseKey);
+ return undefined;
+ }
+
+ return mdmKeys;
+ }
+
+ return undefined;
+ } catch (e) {
+ console.warn("Error reading MDM keys: ", e);
+ return undefined;
+ }
+}
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 47caac060..9bc413331 100644
--- a/core/index.d.ts
+++ b/core/index.d.ts
@@ -842,6 +842,7 @@ export interface SlashCommand {
description: string;
prompt?: string;
params?: { [key: string]: any };
+ promptFile?: string
run: (sdk: ContinueSDK) => AsyncGenerator;
}
@@ -1193,6 +1194,7 @@ export interface ContinueUIConfig {
showChatScrollbar?: boolean;
codeWrap?: boolean;
showSessionTabs?: boolean;
+ autoAcceptEditToolDiffs?: boolean;
}
export interface ContextMenuConfig {
diff --git a/core/llm/llm.test.ts b/core/llm/llm.test.ts
index 7fb840d61..ae21e68ee 100644
--- a/core/llm/llm.test.ts
+++ b/core/llm/llm.test.ts
@@ -22,6 +22,20 @@ const COMPLETION_OPTIONS: Partial = {
// maxTokens: 5,
};
+/**
+ * Retries a test function if it fails on the first attempt
+ * @param testFn The test function to run
+ * @returns A function that will retry once if the test fails
+ */
+const retryOnce = (testFn: () => Promise) => async () => {
+ try {
+ return await testFn();
+ } catch (error) {
+ console.log("Test failed on first attempt, retrying once...");
+ return await testFn();
+ }
+};
+
function testLLM(
llm: BaseLLM,
{
@@ -47,7 +61,7 @@ function testLLM(
describe(llm.providerName + "/" + llm.model, () => {
test(
"Stream Chat works",
- async () => {
+ retryOnce(async () => {
let total = "";
for await (const chunk of llm.streamChat(
[{ role: "user", content: "Hi" }],
@@ -58,13 +72,13 @@ function testLLM(
expect(total.length).toBeGreaterThan(0);
return;
- },
+ }),
timeout,
);
test(
"Stream Complete works",
- async () => {
+ retryOnce(async () => {
let total = "";
for await (const chunk of llm.streamComplete(
"Hi",
@@ -75,13 +89,13 @@ function testLLM(
expect(total.length).toBeGreaterThan(0);
return;
- },
+ }),
timeout,
);
test(
"Complete works",
- async () => {
+ retryOnce(async () => {
const completion = await llm.complete(
"Hi",
new AbortController().signal,
@@ -89,14 +103,14 @@ function testLLM(
expect(completion.length).toBeGreaterThan(0);
return;
- },
+ }),
timeout,
);
if (testFim) {
test(
"FIM works",
- async () => {
+ retryOnce(async () => {
let total = "";
for await (const chunk of llm.streamFim(
"Hi",
@@ -108,7 +122,7 @@ function testLLM(
expect(total.length).toBeGreaterThan(0);
return;
- },
+ }),
timeout,
);
}
@@ -116,7 +130,7 @@ function testLLM(
if (testToolCall) {
test(
"Tool Call works",
- async () => {
+ retryOnce(async () => {
let args = "";
let isFirstChunk = true;
for await (const chunk of llm.streamChat(
@@ -175,7 +189,7 @@ function testLLM(
const parsedArgs = JSON.parse(args);
expect(parsedArgs.name).toBe("Nate");
- },
+ }),
timeout,
);
}
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/package-lock.json b/core/package-lock.json
index ea049ae74..8592b627c 100644
--- a/core/package-lock.json
+++ b/core/package-lock.json
@@ -55,6 +55,7 @@
"p-limit": "^6.1.0",
"partial-json": "^0.1.7",
"pg": "^8.11.3",
+ "plist": "^3.1.0",
"posthog-node": "^3.6.3",
"puppeteer": "^22.4.0",
"puppeteer-chromium-resolver": "^23.0.0",
@@ -91,6 +92,7 @@
"@types/mustache": "^4.2.5",
"@types/node-fetch": "^2.6.11",
"@types/pg": "^8.11.6",
+ "@types/plist": "^3.0.5",
"@types/request": "^2.48.12",
"@types/tar": "^6.1.13",
"@types/uuid": "^9.0.7",
@@ -4938,6 +4940,16 @@
"pg-types": "^4.0.1"
}
},
+ "node_modules/@types/plist": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/@types/plist/-/plist-3.0.5.tgz",
+ "integrity": "sha512-E6OCaRmAe4WDmWNsL/9RMqdkkzDCY1etutkflWk4c+AcjDU07Pcz1fQwTX0TQz+Pxqn9i4L1TU3UFpjnrcDgxA==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*",
+ "xmlbuilder": ">=11.0.1"
+ }
+ },
"node_modules/@types/readable-stream": {
"version": "4.0.18",
"resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.18.tgz",
@@ -5258,6 +5270,14 @@
"onnxruntime-node": "1.14.0"
}
},
+ "node_modules/@xmldom/xmldom": {
+ "version": "0.8.10",
+ "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz",
+ "integrity": "sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==",
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
"node_modules/@yomguithereal/helpers": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@yomguithereal/helpers/-/helpers-1.1.1.tgz",
@@ -12924,6 +12944,19 @@
"resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
},
+ "node_modules/plist": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz",
+ "integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==",
+ "dependencies": {
+ "@xmldom/xmldom": "^0.8.8",
+ "base64-js": "^1.5.1",
+ "xmlbuilder": "^15.1.1"
+ },
+ "engines": {
+ "node": ">=10.4.0"
+ }
+ },
"node_modules/possible-typed-array-names": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz",
@@ -15922,6 +15955,14 @@
"node": ">=18"
}
},
+ "node_modules/xmlbuilder": {
+ "version": "15.1.1",
+ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz",
+ "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==",
+ "engines": {
+ "node": ">=8.0"
+ }
+ },
"node_modules/xmlchars": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
diff --git a/core/package.json b/core/package.json
index 9332baa21..10f0ec35e 100644
--- a/core/package.json
+++ b/core/package.json
@@ -27,6 +27,7 @@
"@types/mustache": "^4.2.5",
"@types/node-fetch": "^2.6.11",
"@types/pg": "^8.11.6",
+ "@types/plist": "^3.0.5",
"@types/request": "^2.48.12",
"@types/tar": "^6.1.13",
"@types/uuid": "^9.0.7",
@@ -89,6 +90,7 @@
"p-limit": "^6.1.0",
"partial-json": "^0.1.7",
"pg": "^8.11.3",
+ "plist": "^3.1.0",
"posthog-node": "^3.6.3",
"puppeteer": "^22.4.0",
"puppeteer-chromium-resolver": "^23.0.0",
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 ef4cde60b..8936cb3eb 100644
--- a/core/protocol/core.ts
+++ b/core/protocol/core.ts
@@ -33,7 +33,7 @@ import {
ToolCall,
} from "../";
import { SerializedOrgWithProfiles } from "../config/ProfileLifecycleManager";
-import { ControlPlaneSessionInfo } from "../control-plane/client";
+import { ControlPlaneSessionInfo } from "../control-plane/AuthTypes";
export type OnboardingModes = "Local" | "Best" | "Custom" | "Quickstart";
diff --git a/core/protocol/ide.ts b/core/protocol/ide.ts
index 88e7f779c..324772ace 100644
--- a/core/protocol/ide.ts
+++ b/core/protocol/ide.ts
@@ -1,5 +1,3 @@
-import { ControlPlaneSessionInfo } from "../control-plane/client";
-
import type {
ContinueRcJson,
DiffLine,
@@ -16,6 +14,7 @@ import type {
TerminalOptions,
Thread,
} from "../";
+import { ControlPlaneSessionInfo } from "../control-plane/AuthTypes";
export interface GetGhTokenArgs {
force?: boolean;
@@ -99,7 +98,7 @@ export type ToIdeFromWebviewOrCoreProtocol = {
ControlPlaneSessionInfo | undefined,
];
logoutOfControlPlane: [undefined, void];
- reportError:[any, void];
+ reportError: [any, void];
closeSidebar: [undefined, void];
};
diff --git a/core/protocol/webview.ts b/core/protocol/webview.ts
index 2e6ec3cff..534517d6f 100644
--- a/core/protocol/webview.ts
+++ b/core/protocol/webview.ts
@@ -1,6 +1,6 @@
import { ConfigResult } from "@continuedev/config-yaml";
import { SerializedOrgWithProfiles } from "../config/ProfileLifecycleManager.js";
-import { ControlPlaneSessionInfo } from "../control-plane/client.js";
+import { ControlPlaneSessionInfo } from "../control-plane/AuthTypes.js";
import type {
BrowserSerializedContinueConfig,
ContextItemWithId,
diff --git a/core/tools/definitions/createRuleBlock.ts b/core/tools/definitions/createRuleBlock.ts
index c3a0846f4..730e1ab32 100644
--- a/core/tools/definitions/createRuleBlock.ts
+++ b/core/tools/definitions/createRuleBlock.ts
@@ -13,7 +13,7 @@ export const createRuleBlock: Tool = {
function: {
name: BuiltInToolNames.CreateRuleBlock,
description:
- "Creates a persistent rule for all future conversations. For establishing code standards or preferences that should be applied consistently.",
+ "Creates a persistent rule for all future conversations. For establishing code standards or preferences that should be applied consistently. To modify existing rules, use the edit tool instead.",
parameters: {
type: "object",
required: ["name", "rule"],
diff --git a/core/util/shellPath.ts b/core/util/shellPath.ts
new file mode 100644
index 000000000..a1772ba81
--- /dev/null
+++ b/core/util/shellPath.ts
@@ -0,0 +1,29 @@
+import { execSync } from "child_process";
+
+/**
+ * Gets the PATH env var from the user's login shell on non-Windows platforms.
+ * Windows is not implemented primarily because it is not needed at the moment.
+ * @returns The enhanced PATH from the user's shell, or the current PATH if it cannot be determined
+ */
+export function getEnvPathFromUserShell(): string | undefined {
+ if (process.platform === "win32") {
+ console.warn(`${getEnvPathFromUserShell.name} not implemented for Windows`);
+ return undefined;
+ }
+
+ if (!process.env.SHELL) {
+ return undefined;
+ }
+
+ try {
+ const command = `${process.env.SHELL} -l -c 'echo $PATH'`;
+
+ const stdout = execSync(command, {
+ encoding: "utf8",
+ });
+
+ return stdout.trim();
+ } catch (error) {
+ return process.env.PATH; // Fallback to current PATH
+ }
+}
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/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.
-
+
-Which takes you to this page:
+Which takes you to this page (select the "Settings" tab):

@@ -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/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/CHANGELOG.md b/extensions/intellij/CHANGELOG.md
deleted file mode 100644
index c5378bd45..000000000
--- a/extensions/intellij/CHANGELOG.md
+++ /dev/null
@@ -1,104 +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).
-
-
-## 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
-
-## 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
-
-## 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
-
-## 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
-
-## 0.0.54 - 2024-07-13
-### Added
-* Partial autocomplete acceptance
-* Autocomplete status bar spinner
-### Fixed
-* Fixed duplicate completion bug and others
-
-## 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
-
-## 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
-
-## 0.0.38 - 2024-03-15
-### Added
-* Remote config server support
-* Autocomplete support in JetBrains
-
-## 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
-
-## v0.0.26 - 2023-12-28
-### Added
-* auto-reloading of config on save
-### Fixed
-* Fixed /edit bug for versions without Python server
-
-## v0.0.25 - 2023-12-25
-
-### Changed
-
-- Intellij extension no longer relies on the Continue Python server
-
-## v0.0.21 - 2023-12-05
-
-### Added
-
-- updated to match latest VS Code updates
-
-## v0.0.19 - 2023-11-19
-
-### Changed
-
-- migrated to .json config file format
-
-## 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/extensions/vscode/CHANGELOG.md b/extensions/vscode/CHANGELOG.md
deleted file mode 100644
index f575f6735..000000000
--- a/extensions/vscode/CHANGELOG.md
+++ /dev/null
@@ -1,256 +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).
-
-
-## 1.0.0 - 2025-02-26
-### Added
-* Introduces hub.continue.dev
-* Improved apply quality
-### Fixed
-* Numerous reliability improvements
-
-## 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
-
-## 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
-
-## 0.8.59 - 2024-11-25
-### Fixed
-* Hotfix for Ollama onboarding
-
-## 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
-
-## 0.8.56 - 2024-11-08
-### Added
-* New Edit mode in sidebar (cmd/ctrl+I)
-* Significantly faster and more accurate docs crawler by default
-
-## 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
-
-## 0.8.54 - 2024-10-15
-### Fixed
-* Hotfix: throttle transformers.js embeddings provider
-
-## 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
-
-## 0.8.52 - 2024-09-16
-### Changed
-* Use Chromium only as a fallback after asking user
-* Redesigned onboarding flow
-
-## 0.8.51 - 2024-09-05
-### Fixed
-* Fixed CRLF bug causing diff streams to treat every line as changed on Windows
-
-## 0.8.50 - 2024-09-02
-### Fixed
-* Hotfix for ability to use more than one inline context provider
-
-## 0.8.49 - 2024-09-01
-### Fixed
-* Hotfix: submenu context providers
-
-## 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
-
-## 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
-
-## 0.8.46 - 2024-08-11
-### Added
-* new /onboard slash command
-### Fixed
-* Fixed problem loading config.ts
-* Fixed bug causing duplicate indexing work
-
-## 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
-
-## 0.8.43 - 2024-07-08
-### Added
-* Improved indexing reliability and testing
-* Quick Actions: use CodeLens to quickly take common actions like adding docstrings
-
-## 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
-
-## 0.8.24 - 2024-04-12
-### Added
-* Support for improved retrieval models (Voyage embeddings/reranking)
-* New @code context provider
-* Personal usage analytics
-
-## 0.8.15 - 2024-03-05
-### Added
-* Tab-autocomplete in beta
-
-## 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
-
-## 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)
-
-## 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
-
-## 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
-
-## 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
-
-## v0.6.4 - 2023-11-19
-
-### Changed
-
-- migrated to .json config file format
-
-## 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
-
-## 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/extensions/vscode/package.json b/extensions/vscode/package.json
index 3ac9d33c5..671502b88 100644
--- a/extensions/vscode/package.json
+++ b/extensions/vscode/package.json
@@ -2,7 +2,7 @@
"name": "continue",
"icon": "media/icon.png",
"author": "Continue Dev, Inc",
- "version": "1.1.35",
+ "version": "1.1.36",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"
diff --git a/extensions/vscode/src/stubs/WorkOsAuthProvider.ts b/extensions/vscode/src/stubs/WorkOsAuthProvider.ts
index 2e6acfb86..73f36afdb 100644
--- a/extensions/vscode/src/stubs/WorkOsAuthProvider.ts
+++ b/extensions/vscode/src/stubs/WorkOsAuthProvider.ts
@@ -1,6 +1,5 @@
import crypto from "crypto";
-import { ControlPlaneSessionInfo } from "core/control-plane/client";
import { getControlPlaneEnvSync } from "core/control-plane/env";
import fetch from "node-fetch";
import { v4 as uuidv4 } from "uuid";
@@ -18,6 +17,12 @@ import {
window,
} from "vscode";
+import {
+ AuthType,
+ ControlPlaneSessionInfo,
+ HubEnv,
+ isHubEnv,
+} from "core/control-plane/AuthTypes";
import { PromiseAdapter, promiseFromEvent } from "./promiseUtils";
import { SecretStorage } from "./SecretStorage";
import { UriEventHandler } from "./uriHandler";
@@ -280,12 +285,21 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
try {
const codeVerifier = generateRandomString(64);
const codeChallenge = await generateCodeChallenge(codeVerifier);
- const token = await this.login(codeChallenge, scopes);
+
+ if (!isHubEnv(controlPlaneEnv)) {
+ throw new Error("Login is disabled");
+ }
+
+ const token = await this.login(codeChallenge, controlPlaneEnv, scopes);
if (!token) {
throw new Error(`Continue login failure`);
}
- const userInfo = (await this.getUserInfo(token, codeVerifier)) as any;
+ const userInfo = (await this.getUserInfo(
+ token,
+ codeVerifier,
+ controlPlaneEnv,
+ )) as any;
const { user, access_token, refresh_token } = userInfo;
const session: ContinueAuthenticationSession = {
@@ -352,7 +366,11 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
/**
* Log in to Continue
*/
- private async login(codeChallenge: string, scopes: string[] = []) {
+ private async login(
+ codeChallenge: string,
+ hubEnv: HubEnv,
+ scopes: string[] = [],
+ ) {
return await window.withProgress(
{
location: ProgressLocation.Notification,
@@ -369,7 +387,7 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
const url = new URL("https://api.workos.com/user_management/authorize");
const params = {
response_type: "code",
- client_id: controlPlaneEnv.WORKOS_CLIENT_ID,
+ client_id: hubEnv.WORKOS_CLIENT_ID,
redirect_uri: this.redirectUri,
state: stateId,
code_challenge: codeChallenge,
@@ -458,7 +476,11 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
* @param token
* @returns
*/
- private async getUserInfo(token: string, codeVerifier: string) {
+ private async getUserInfo(
+ token: string,
+ codeVerifier: string,
+ hubEnv: HubEnv,
+ ) {
const resp = await fetch(
"https://api.workos.com/user_management/authenticate",
{
@@ -467,7 +489,7 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
"Content-Type": "application/json",
},
body: JSON.stringify({
- client_id: controlPlaneEnv.WORKOS_CLIENT_ID,
+ client_id: hubEnv.WORKOS_CLIENT_ID,
code_verifier: codeVerifier,
grant_type: "authorization_code",
code: token,
@@ -484,6 +506,12 @@ export async function getControlPlaneSessionInfo(
silent: boolean,
useOnboarding: boolean,
): Promise {
+ if (!isHubEnv(controlPlaneEnv)) {
+ return {
+ AUTH_TYPE: AuthType.OnPrem,
+ };
+ }
+
try {
if (useOnboarding) {
WorkOsAuthProvider.useOnboardingUri = true;
@@ -498,6 +526,7 @@ export async function getControlPlaneSessionInfo(
return undefined;
}
return {
+ AUTH_TYPE: controlPlaneEnv.AUTH_TYPE,
accessToken: session.accessToken,
account: {
id: session.account.id,
diff --git a/gui/src/components/StyledMarkdownPreview/rehypeHighlightPlugin.ts b/gui/src/components/StyledMarkdownPreview/rehypeHighlightPlugin.ts
index 227b77d1f..5a3c9e318 100644
--- a/gui/src/components/StyledMarkdownPreview/rehypeHighlightPlugin.ts
+++ b/gui/src/components/StyledMarkdownPreview/rehypeHighlightPlugin.ts
@@ -1,6 +1,7 @@
// Feel free to add more!
// See gui/node_modules/highlight.js/lib/languages for the full available list
import clojure from "highlight.js/lib/languages/clojure";
+import delphi from "highlight.js/lib/languages/delphi";
import elixir from "highlight.js/lib/languages/elixir";
import julia from "highlight.js/lib/languages/julia";
import lisp from "highlight.js/lib/languages/lisp";
@@ -19,6 +20,7 @@ export function rehypeHighlightPlugin() {
languages: {
...common,
clojure,
+ delphi,
elixir,
julia,
protobuf,
diff --git a/gui/src/components/console/Details.tsx b/gui/src/components/console/Details.tsx
index a9edfa8a6..2541fd8ba 100644
--- a/gui/src/components/console/Details.tsx
+++ b/gui/src/components/console/Details.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useRef } from "react";
+import { useEffect, useRef, useState } from "react";
import { LLMInteraction } from "../../hooks/useLLMLog";
import useLLMSummary from "../../hooks/useLLMSummary";
import End from "./End";
@@ -50,6 +50,18 @@ export default function Details({ interaction }: DetailsProps) {
const scrollTop = useRef(null);
const lastResult = useRef(null);
const summary = useLLMSummary(interaction);
+ const [isAtBottom, setIsAtBottom] = useState(true);
+
+ // Handler to check if user is at the bottom
+ function handleScroll() {
+ const elt = scrollTop.current;
+ if (!elt) {
+ return;
+ }
+ // Allow a small threshold for floating point errors
+ const threshold = 5;
+ setIsAtBottom((elt.scrollHeight - elt.scrollTop - elt.clientHeight) < threshold);
+ }
useEffect(() => {
if (interaction.end) {
@@ -59,15 +71,17 @@ export default function Details({ interaction }: DetailsProps) {
const last = interaction.results[interaction.results.length - 1];
if (last != lastResult.current) {
lastResult.current = last;
- const lastChild = scrollTop.current?.lastChild;
- if (lastChild) {
- (lastChild as HTMLElement).scrollIntoView({
- behavior: "auto",
- block: "end",
- });
+ if (isAtBottom) {
+ const lastChild = scrollTop.current?.lastChild;
+ if (lastChild) {
+ (lastChild as HTMLElement).scrollIntoView({
+ behavior: "auto",
+ block: "end",
+ });
+ }
}
}
- });
+ }, [interaction, isAtBottom]);
return (