Elffuss BraidHub

kikocis/continue public

merge-main
Changeset9bd927d445bd5b04c463797bbd6e8b106b808bd38bda5b2ad24f2790dad800b4
AuthorDallin Romney <dallinromney@gmail.com> · 2025-06-26 13:53 -07:00
CommitterDallin Romney <dallinromney@gmail.com> · 2025-06-26 13:53 -07:00
Parentsbbd32f956d52, 04e94bf72239

Browse the files at this changeset

16 files changed

added .continue/rules/new-protocol-message.md +35 −0
@@ -0,0 +1,35 @@
1+---
2+name: New protocol message
3+description: Create a new protocol message from core/gui/ide to core/gui/ide
4+---
5+
6+Create a new protocol message by taking the following steps:
7+
8+## 1. Define the message type
9+
10+Add your new message type definition to the appropriate file in the `protocol/` directory with correct TypeScript typing.
11+
12+## 2. Check for duplicates
13+
14+Verify that no existing message type already provides the same functionality.
15+
16+## 3. Add to passThrough (if webview ↔ core)
17+
18+If your message is between webview and core, add it to `core/protocol/passThrough.ts`.
19+
20+## 4. Add to IntelliJ constants (if webview ↔ core)
21+
22+If your message is between webview and core, add it to `extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt`.
23+
24+## 5. Implement the message handler
25+
26+Implement the message in the appropriate location:
27+
28+- **Messages to core**: `core/core.ts`
29+- **Messages to GUI**: `useWebviewListener` hook
30+- **Messages to VS Code IDE**: `VsCodeMessenger.ts`
31+- **Messages to JetBrains IDE**: `IdeProtocolClient.kt`
32+
33+## 6. Test the implementation
34+
35+Verify that your message works correctly in both VS Code and JetBrains IDEs if applicable.
added .continue/rules/overeager.md +5 −0
@@ -0,0 +1,5 @@
1+---
2+name: Don't be overeager
3+---
4+
5+Avoid over-eagerly adding new features. You should solve the problem at hand and then can propose further work.
modified .github/workflows/main.yaml +8 −0
@@ -104,6 +104,14 @@
104104 path: gui/node_modules
105105 key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }}
106106
107+ - name: Build packages (Windows)
108+ run: ./scripts/build-packages.ps1
109+ if: matrix.os == 'windows-latest'
110+
111+ - name: Build packages (Unix)
112+ run: ./scripts/build-packages.sh
113+ if: matrix.os != 'windows-latest'
114+
107115 - name: Install extension Dependencies
108116 run: |
109117 cd extensions/vscode
modified .github/workflows/preview.yaml +8 −0
@@ -99,6 +99,14 @@
9999 path: gui/node_modules
100100 key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }}
101101
102+ - name: Build packages (Windows)
103+ run: ./scripts/build-packages.ps1
104+ if: matrix.os == 'windows-latest'
105+
106+ - name: Build packages (Unix)
107+ run: ./scripts/build-packages.sh
108+ if: matrix.os != 'windows-latest'
109+
102110 - name: Install extension Dependencies
103111 run: |
104112 cd extensions/vscode
modified binary/package-lock.json +2 −4
@@ -53,9 +53,9 @@
5353 "@aws-sdk/credential-providers": "^3.778.0",
5454 "@continuedev/config-types": "^1.0.13",
5555 "@continuedev/config-yaml": "file:../packages/config-yaml",
56- "@continuedev/fetch": "^1.0.13",
56+ "@continuedev/fetch": "^1.0.14",
5757 "@continuedev/llm-info": "^1.0.8",
58- "@continuedev/openai-adapters": "^1.0.32",
58+ "@continuedev/openai-adapters": "file:../packages/openai-adapters",
5959 "@modelcontextprotocol/sdk": "^1.12.0",
6060 "@mozilla/readability": "^0.5.0",
6161 "@octokit/rest": "^20.1.1",
@@ -106,7 +106,6 @@
106106 "sqlite3": "^5.1.7",
107107 "system-ca": "^1.0.3",
108108 "tar": "^7.4.3",
109- "tree-sitter-structured-text": "^0.0.1",
110109 "tree-sitter-wasms": "^0.1.11",
111110 "uuid": "^9.0.1",
112111 "vectordb": "^0.4.20",
@@ -145,7 +144,6 @@
145144 "myers-diff": "^2.1.0",
146145 "onnxruntime-common": "1.14.0",
147146 "onnxruntime-web": "1.14.0",
148- "tree-sitter-cli": "^0.22.5",
149147 "ts-jest": "^29.1.1",
150148 "typescript": "^5.6.3",
151149 "vitest": "^3.1.4"
modified core/package-lock.json +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

added core/rules.md +10 −0
@@ -0,0 +1,10 @@
1+# `core` rules
2+
3+Whenever a new protocol message is added to the `protocol/` directory, check the following:
4+
5+- It's type is defined correctly
6+- If it is a message from webview to core or vice versa:
7+ - It has been added to `core/protocol/passThrough.ts`
8+ - It has been added to `extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt`
9+- It is implemented in either `core/core.ts` (for messages to the core), in a `useWebviewListener` (for messages to the gui), or in `VsCodeMessenger.ts` for VS Code or `IdeProtocolClient.kt` for JetBriains (for messages to the IDE).
10+- It does not duplicate functionality from another message type that already exists.
modified extensions/intellij/gradle.properties +1 −1
@@ -3,7 +3,7 @@
33 pluginName=continue-intellij-extension
44 pluginRepositoryUrl=https://github.com/continuedev/continue
55 # SemVer format -> https://semver.org
6-pluginVersion=1.0.25
6+pluginVersion=1.0.26
77 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
88 pluginSinceBuild=223
99 # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
modified extensions/vscode/package-lock.json +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

modified extensions/vscode/package.json +1 −1
@@ -2,7 +2,7 @@
22 "name": "continue",
33 "icon": "media/icon.png",
44 "author": "Continue Dev, Inc",
5- "version": "1.1.51",
5+ "version": "1.1.52",
66 "repository": {
77 "type": "git",
88 "url": "https://github.com/continuedev/continue"
modified packages/openai-adapters/package-lock.json +2 −2
@@ -1,12 +1,12 @@
11 {
22 "name": "@continuedev/openai-adapters",
3- "version": "1.0.40",
3+ "version": "1.0.42",
44 "lockfileVersion": 3,
55 "requires": true,
66 "packages": {
77 "": {
88 "name": "@continuedev/openai-adapters",
9- "version": "1.0.40",
9+ "version": "1.0.42",
1010 "license": "Apache-2.0",
1111 "dependencies": {
1212 "@continuedev/config-types": "^1.0.5",
modified packages/openai-adapters/package.json +1 −1
@@ -1,6 +1,6 @@
11 {
22 "name": "@continuedev/openai-adapters",
3- "version": "1.0.40",
3+ "version": "1.0.42",
44 "description": "",
55 "main": "dist/index.js",
66 "types": "dist/index.d.ts",
modified packages/openai-adapters/src/apis/Azure.ts +5 −1
@@ -63,7 +63,11 @@
6363 "`env.apiVersion` is a required configuration property for Azure OpenAI",
6464 );
6565 }
66- url.pathname = `${url.pathname}/openai/deployments/${config.env.deployment}`;
66+
67+ const basePathname = `openai/deployments/${config.env.deployment}`;
68+
69+ url.pathname =
70+ url.pathname === "/" ? basePathname : `${url.pathname}/${basePathname}`;
6771
6872 queryParams["api-version"] = config.env.apiVersion;
6973 }
modified packages/openai-adapters/src/test/main.test.ts +76 −0
@@ -173,4 +173,80 @@
173173 "https://api.example.com",
174174 );
175175 });
176+
177+ it("should configure Azure OpenAI client with root URL and trailing slash", () => {
178+ const azure = constructLlmApi({
179+ provider: "azure",
180+ apiKey: "sk-xxx",
181+ apiBase: "https://test-azure-openai.azure.com/",
182+ env: {
183+ deployment: "gpt-4.1",
184+ apiType: "azure-openai",
185+ apiVersion: "2023-05-15",
186+ },
187+ });
188+
189+ // The Azure client modifies the baseURL to include the deployment
190+ expect((azure as OpenAIApi).openai.baseURL).toBe(
191+ "https://test-azure-openai.azure.com/openai/deployments/gpt-4.1",
192+ );
193+ expect((azure as OpenAIApi).openai.apiKey).toBe("sk-xxx");
194+ });
195+
196+ it("should configure Azure OpenAI client with path and trailing slash", () => {
197+ const azure = constructLlmApi({
198+ provider: "azure",
199+ apiKey: "sk-xxx",
200+ apiBase: "https://test-azure-openai.azure.com/v1/",
201+ env: {
202+ deployment: "gpt-4.1",
203+ apiType: "azure-openai",
204+ apiVersion: "2023-05-15",
205+ },
206+ });
207+
208+ // The Azure client modifies the baseURL to include the deployment
209+ expect((azure as OpenAIApi).openai.baseURL).toBe(
210+ "https://test-azure-openai.azure.com/v1/openai/deployments/gpt-4.1",
211+ );
212+ expect((azure as OpenAIApi).openai.apiKey).toBe("sk-xxx");
213+ });
214+
215+ it("should configure Azure OpenAI client with root URL and no trailing slash", () => {
216+ const azure = constructLlmApi({
217+ provider: "azure",
218+ apiKey: "sk-xxx",
219+ apiBase: "https://test-azure-openai.azure.com",
220+ env: {
221+ deployment: "gpt-4.1",
222+ apiType: "azure-openai",
223+ apiVersion: "2023-05-15",
224+ },
225+ });
226+
227+ // The Azure client modifies the baseURL to include the deployment
228+ expect((azure as OpenAIApi).openai.baseURL).toBe(
229+ "https://test-azure-openai.azure.com/openai/deployments/gpt-4.1",
230+ );
231+ expect((azure as OpenAIApi).openai.apiKey).toBe("sk-xxx");
232+ });
233+
234+ it("should configure Azure OpenAI client with path and no trailing slash", () => {
235+ const azure = constructLlmApi({
236+ provider: "azure",
237+ apiKey: "sk-xxx",
238+ apiBase: "https://test-azure-openai.azure.com/v1",
239+ env: {
240+ deployment: "gpt-4.1",
241+ apiType: "azure-openai",
242+ apiVersion: "2023-05-15",
243+ },
244+ });
245+
246+ // The Azure client modifies the baseURL to include the deployment
247+ expect((azure as OpenAIApi).openai.baseURL).toBe(
248+ "https://test-azure-openai.azure.com/v1/openai/deployments/gpt-4.1",
249+ );
250+ expect((azure as OpenAIApi).openai.apiKey).toBe("sk-xxx");
251+ });
176252 });
added scripts/build-packages.ps1 +13 −0
@@ -0,0 +1,13 @@
1+Push-Location packages
2+
3+Push-Location "openai-adapters"
4+npm ci
5+npm run build
6+Pop-Location
7+
8+Push-Location "config-yaml"
9+npm ci
10+npm run build
11+Pop-Location
12+
13+Pop-Location
No newline at the end of the file
added scripts/build-packages.sh +13 −0
@@ -0,0 +1,13 @@
1+# Build @continuedev packages for monorepo style linking
2+
3+cd packages
4+cd openai-adapters
5+
6+npm ci
7+npm run build
8+
9+cd ..
10+cd config-yaml
11+
12+npm ci
13+npm run build