From 855de8f09ef41909dc65a51adf4b954272a51dd2 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 9 Aug 2023 18:06:11 -0700 Subject: ci: :green_heart: testing testing in ci --- extension/src/continueIdeClient.ts | 13 +++++++------ extension/src/test-suite/environmentSetup.test.ts | 12 ++++++++---- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'extension') diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index d89093ca..5b9e285d 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -12,7 +12,7 @@ import { rejectSuggestionCommand, } from "./suggestions"; import { FileEditWithFullContents } from "../schema/FileEditWithFullContents"; -import * as fs from 'fs'; +import * as fs from "fs"; import { WebsocketMessenger } from "./util/messenger"; import { diffManager } from "./diffs"; const os = require("os"); @@ -30,13 +30,12 @@ class IdeProtocolClient { private _lastReloadTime: number = 16; private _reconnectionTimeouts: NodeJS.Timeout[] = []; - private _sessionId: string | null = null; + sessionId: string | null = null; private _serverUrl: string; private _newWebsocketMessenger() { const requestUrl = - this._serverUrl + - (this._sessionId ? `?session_id=${this._sessionId}` : ""); + this._serverUrl + (this.sessionId ? `?session_id=${this.sessionId}` : ""); const messenger = new WebsocketMessenger(requestUrl); this.messenger = messenger; @@ -383,7 +382,9 @@ class IdeProtocolClient { async getUserSecret(key: string) { // Check if secret already exists in VS Code settings (global) let secret = vscode.workspace.getConfiguration("continue").get(key); - if (typeof secret !== "undefined" && secret !== null) {return secret;} + if (typeof secret !== "undefined" && secret !== null) { + return secret; + } // If not, ask user for secret secret = await vscode.window.showInputBox({ @@ -420,7 +421,7 @@ class IdeProtocolClient { console.log("Getting session ID"); const resp = await this.messenger?.sendAndReceive("getSessionId", {}); console.log("New Continue session with ID: ", resp.sessionId); - this._sessionId = resp.sessionId; + this.sessionId = resp.sessionId; return resp.sessionId; } diff --git a/extension/src/test-suite/environmentSetup.test.ts b/extension/src/test-suite/environmentSetup.test.ts index 9a478522..a6aa3433 100644 --- a/extension/src/test-suite/environmentSetup.test.ts +++ b/extension/src/test-suite/environmentSetup.test.ts @@ -2,18 +2,22 @@ import { test, describe } from "mocha"; import * as assert from "assert"; import { getContinueServerUrl } from "../bridge"; -import { startContinuePythonServer } from "../activation/environmentSetup"; +import { ideProtocolClient } from "../activation/activate"; import fetch from "node-fetch"; +import fkill from "fkill"; describe("Can start python server", () => { test("Can start python server in under 10 seconds", async function () { - this.timeout(17_000); - await startContinuePythonServer(); + fkill(65432, { force: true, silent: true }); + const allowedTime = 10_000; + this.timeout(allowedTime + 1000); - await new Promise((resolve) => setTimeout(resolve, 15_000)); + // If successful, the server is started by the extension while we wait + await new Promise((resolve) => setTimeout(resolve, allowedTime)); // Check if server is running const serverUrl = getContinueServerUrl(); + console.log("Server URL: ", serverUrl); const response = await fetch(`${serverUrl}/health`); assert.equal(response.status, 200); }); -- cgit v1.2.3-70-g09d2 From a1fada4e7f0be2d5aa661aee483a59ba93bacb40 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 9 Aug 2023 18:49:13 -0700 Subject: ci: :green_heart: install Xvfb to run headless electron on Linux --- .github/workflows/main.yaml | 20 ++++++++++++++++++++ extension/src/test-runner/runTestOnVSCodeHost.ts | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'extension') diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4f1e538c..8249b576 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -14,6 +14,8 @@ jobs: runs-on: ${{ matrix.os }} steps: + # Install Python requirements and build+upload binaries for each platform + - name: Check-out repository uses: actions/checkout@v3 @@ -55,6 +57,8 @@ jobs: - name: Checkout uses: actions/checkout@v2 + # Download corresponding binary artifact for the platform + - name: Create exe directory run: | mkdir extension/server/exe @@ -80,6 +84,8 @@ jobs: path: extension/server/exe/windows if: matrix.os == 'windows-latest' + # Setup Node.js and install dependencies + - name: Use Node.js 19.0.0 uses: actions/setup-node@v3 with: @@ -107,16 +113,26 @@ jobs: cd extension/react-app npm ci --legacy-peer-deps + # Run tests + - name: Package the extension run: | cd extension npm run package + - name: Install Xvfb for Linux + run: | + sudo apt-get install -y xvfb # Install Xvfb + Xvfb :99 & # Start Xvfb + export DISPLAY=:99 # Export the display number to the environment + if: matrix.os == 'ubuntu-20.04' + - name: Run extension tests run: | cd extension npm run test + # Package again and build+upload the .vsix - name: Remove exe directory and re-package run: | cd extension @@ -137,6 +153,8 @@ jobs: contents: write steps: + # Checkout and download .vsix artifact + - name: Checkout uses: actions/checkout@v2 @@ -146,6 +164,8 @@ jobs: name: vsix-artifact path: extension/build + # Publish the extension and commit/push the version change + - name: Publish run: | cd extension diff --git a/extension/src/test-runner/runTestOnVSCodeHost.ts b/extension/src/test-runner/runTestOnVSCodeHost.ts index 2a542ffc..21267c2d 100644 --- a/extension/src/test-runner/runTestOnVSCodeHost.ts +++ b/extension/src/test-runner/runTestOnVSCodeHost.ts @@ -11,7 +11,10 @@ async function main() { // The path to test runner // Passed to --extensionTestsPath - const extensionTestsPath = path.resolve(extensionDevelopmentPath, "out/test-runner/mochaRunner"); + const extensionTestsPath = path.resolve( + extensionDevelopmentPath, + "out/test-runner/mochaRunner" + ); // Download VS Code, unzip it and run the integration test await runTests({ extensionDevelopmentPath, extensionTestsPath }); -- cgit v1.2.3-70-g09d2 From dc0622848b648ba27e7110b9b900673bb668ab4c Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 9 Aug 2023 19:21:57 -0700 Subject: fix: :bug: make typegen.js windows compatible --- extension/scripts/typegen.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'extension') diff --git a/extension/scripts/typegen.js b/extension/scripts/typegen.js index 0bbff19e..ada39d47 100644 --- a/extension/scripts/typegen.js +++ b/extension/scripts/typegen.js @@ -46,8 +46,15 @@ function deleteAllInDir(dir) { }); } -OUTPUT_DIR = "schema"; -INPUT_DIR = "../schema/json"; +const OUTPUT_DIR = path.join("schema"); +const INPUT_DIR = path.join("..", "schema", "json"); +if (!fs.existsSync(INPUT_DIR)) { + throw new Error(`Input directory does not exist: ${INPUT_DIR}`); +} + +if (!fs.existsSync(OUTPUT_DIR)) { + throw new Error(`Output directory does not exist: ${OUTPUT_DIR}`); +} deleteAllInDir(OUTPUT_DIR); generateAllSchemas(INPUT_DIR, OUTPUT_DIR); -- cgit v1.2.3-70-g09d2 From f38c8fb8b33a705ed4eb4d2e0974060ebb88afd3 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 9 Aug 2023 19:35:26 -0700 Subject: fix: :bug: another windows fix in typegen.js --- extension/scripts/typegen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extension') diff --git a/extension/scripts/typegen.js b/extension/scripts/typegen.js index ada39d47..8fec3888 100644 --- a/extension/scripts/typegen.js +++ b/extension/scripts/typegen.js @@ -4,7 +4,7 @@ const { compile } = require("json-schema-to-typescript"); function generateTypesForFile(inputPath, outputPath) { let schema = JSON.parse(fs.readFileSync(inputPath, "utf8")); - let name = (inputPath.split("/").pop() || inputPath).split(".")[0]; + let name = path.parse(path.basename(inputPath)).name; // This is to solve the issue of json-schema-to-typescript not supporting $ref at the top-level, which is what Pydantic generates for recursive types if ("$ref" in schema) { let temp = schema["$ref"]; -- cgit v1.2.3-70-g09d2 From c1a8097f0a7f3cddb0aebac26e6197ffef186972 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 9 Aug 2023 19:58:09 -0700 Subject: fix: :bug: attempting to fix mkdir --- extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extension') diff --git a/extension/package.json b/extension/package.json index e887dc7a..ea4d8c16 100644 --- a/extension/package.json +++ b/extension/package.json @@ -195,7 +195,7 @@ "lint": "eslint src --ext ts", "build-test": "tsc && node esbuild.test.mjs", "test": "npm run build-test && node ./out/test-runner/runTestOnVSCodeHost.js", - "package": "npm install && npm run typegen && npm run clientgen && cd react-app && npm install && npm run build && cd .. && mkdir -p ./build && vsce package --out ./build" + "package": "npm install && npm run typegen && npm run clientgen && cd react-app && npm install && npm run build && cd .. && mkdir build && vsce package --out ./build" }, "devDependencies": { "@nestjs/common": "^8.4.7", -- cgit v1.2.3-70-g09d2 From 4636c9590154d6b5995948003da212eb25003750 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 9 Aug 2023 20:56:11 -0700 Subject: fix: :bug: write out npm run package as package.js --- extension/package.json | 2 +- extension/scripts/package.js | 40 +++++++++++++++++++++++ extension/src/test-suite/environmentSetup.test.ts | 2 +- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 extension/scripts/package.js (limited to 'extension') diff --git a/extension/package.json b/extension/package.json index ea4d8c16..7cf2bc7d 100644 --- a/extension/package.json +++ b/extension/package.json @@ -195,7 +195,7 @@ "lint": "eslint src --ext ts", "build-test": "tsc && node esbuild.test.mjs", "test": "npm run build-test && node ./out/test-runner/runTestOnVSCodeHost.js", - "package": "npm install && npm run typegen && npm run clientgen && cd react-app && npm install && npm run build && cd .. && mkdir build && vsce package --out ./build" + "package": "node scripts/package.js" }, "devDependencies": { "@nestjs/common": "^8.4.7", diff --git a/extension/scripts/package.js b/extension/scripts/package.js new file mode 100644 index 00000000..4703ebc2 --- /dev/null +++ b/extension/scripts/package.js @@ -0,0 +1,40 @@ +const { exec } = require("child_process"); +const fs = require("fs"); + +exec("npm install", (error) => { + if (error) throw error; + console.log("npm install completed"); + + exec("npm run typegen", (error) => { + if (error) throw error; + console.log("npm run typegen completed"); + + exec("npm run clientgen", (error) => { + if (error) throw error; + console.log("npm run clientgen completed"); + + process.chdir("react-app"); + + exec("npm install", (error) => { + if (error) throw error; + console.log("npm install in react-app completed"); + + exec("npm run build", (error) => { + if (error) throw error; + console.log("npm run build in react-app completed"); + + process.chdir(".."); + + if (!fs.existsSync("build")) { + fs.mkdirSync("build"); + } + + exec("vsce package --out ./build", (error) => { + if (error) throw error; + console.log("vsce package completed"); + }); + }); + }); + }); + }); +}); diff --git a/extension/src/test-suite/environmentSetup.test.ts b/extension/src/test-suite/environmentSetup.test.ts index a6aa3433..a0d6cbaa 100644 --- a/extension/src/test-suite/environmentSetup.test.ts +++ b/extension/src/test-suite/environmentSetup.test.ts @@ -9,7 +9,7 @@ import fkill from "fkill"; describe("Can start python server", () => { test("Can start python server in under 10 seconds", async function () { fkill(65432, { force: true, silent: true }); - const allowedTime = 10_000; + const allowedTime = 15_000; this.timeout(allowedTime + 1000); // If successful, the server is started by the extension while we wait -- cgit v1.2.3-70-g09d2 From 08b1cfdd2f6f456df7344c16f5d229a0ccfb841b Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 9 Aug 2023 21:14:13 -0700 Subject: fix: :green_heart: increase testing timeout to allow for fkill --- extension/src/test-suite/environmentSetup.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'extension') diff --git a/extension/src/test-suite/environmentSetup.test.ts b/extension/src/test-suite/environmentSetup.test.ts index a0d6cbaa..8099e9ac 100644 --- a/extension/src/test-suite/environmentSetup.test.ts +++ b/extension/src/test-suite/environmentSetup.test.ts @@ -8,9 +8,9 @@ import fkill from "fkill"; describe("Can start python server", () => { test("Can start python server in under 10 seconds", async function () { - fkill(65432, { force: true, silent: true }); const allowedTime = 15_000; - this.timeout(allowedTime + 1000); + this.timeout(allowedTime + 10_000); + fkill(65432, { force: true, silent: true }); // If successful, the server is started by the extension while we wait await new Promise((resolve) => setTimeout(resolve, allowedTime)); -- cgit v1.2.3-70-g09d2 From e8ebff1e6b07dfaafff81ee7013bb019cbfe2075 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 9 Aug 2023 22:00:01 -0700 Subject: fix: :bug: add server/exe to .vscodeignore insteading of manually removing --- .github/workflows/main.yaml | 17 +---------------- extension/.vscodeignore | 4 +++- 2 files changed, 4 insertions(+), 17 deletions(-) (limited to 'extension') diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ef00302e..6111856d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -135,22 +135,7 @@ jobs: npm run test if: matrix.os != 'ubuntu-20.04' - # Package again and build+upload the .vsix - - - name: Remove exe directory (Windows) - run: | - FOR /F "tokens=5" %a IN ('netstat -ano ^| findstr "65432"') DO taskkill /PID %a /F - Remove-Item -Path "extension/server/exe" -Recurse -Force - if: matrix.os == 'windows-latest' - - - name: Remove exe directory (Mac/Linux) - run: rm -rf extension/server/exe - if: matrix.os != 'windows-latest' - - - name: Re-package the extension - run: | - cd extension - npm run package + # Upload .vsix artifact - name: Upload .vsix as an artifact uses: actions/upload-artifact@v2 diff --git a/extension/.vscodeignore b/extension/.vscodeignore index d3326fdc..51d66585 100644 --- a/extension/.vscodeignore +++ b/extension/.vscodeignore @@ -24,4 +24,6 @@ react-app/src scripts/data scripts/env -scripts/.continue_env_installed \ No newline at end of file +scripts/.continue_env_installed + +server/exe/** \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 8456b24318b13ea5d5dabec2328dd854f8a492b4 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 9 Aug 2023 22:04:22 -0700 Subject: feat: :sparkles: support for Together.ai models --- continuedev/src/continuedev/libs/llm/ggml.py | 5 +- continuedev/src/continuedev/libs/llm/replicate.py | 2 +- continuedev/src/continuedev/libs/llm/together.py | 118 +++++++++++++++++++++ .../src/redux/slices/serverStateReducer.ts | 6 +- 4 files changed, 126 insertions(+), 5 deletions(-) create mode 100644 continuedev/src/continuedev/libs/llm/together.py (limited to 'extension') diff --git a/continuedev/src/continuedev/libs/llm/ggml.py b/continuedev/src/continuedev/libs/llm/ggml.py index 2f131354..25a61e63 100644 --- a/continuedev/src/continuedev/libs/llm/ggml.py +++ b/continuedev/src/continuedev/libs/llm/ggml.py @@ -82,7 +82,10 @@ class GGML(LLM): chunks = json_chunk.split("\n") for chunk in chunks: if chunk.strip() != "": - yield json.loads(chunk[6:])["choices"][0]["delta"] + yield { + "role": "assistant", + "content": json.loads(chunk[6:])["choices"][0]["delta"] + } except: raise Exception(str(line[0])) diff --git a/continuedev/src/continuedev/libs/llm/replicate.py b/continuedev/src/continuedev/libs/llm/replicate.py index 235fd906..0dd359e7 100644 --- a/continuedev/src/continuedev/libs/llm/replicate.py +++ b/continuedev/src/continuedev/libs/llm/replicate.py @@ -25,7 +25,7 @@ class ReplicateLLM(LLM): @property def default_args(self): - return {**DEFAULT_ARGS, "model": self.name, "max_tokens": 1024} + return {**DEFAULT_ARGS, "model": self.model, "max_tokens": 1024} def count_tokens(self, text: str): return count_tokens(self.name, text) diff --git a/continuedev/src/continuedev/libs/llm/together.py b/continuedev/src/continuedev/libs/llm/together.py new file mode 100644 index 00000000..1cc0a711 --- /dev/null +++ b/continuedev/src/continuedev/libs/llm/together.py @@ -0,0 +1,118 @@ +import json +from typing import Any, Coroutine, Dict, Generator, List, Union + +import aiohttp +from ...core.main import ChatMessage +from ..llm import LLM +from ..util.count_tokens import compile_chat_messages, DEFAULT_ARGS, count_tokens + + +class TogetherLLM(LLM): + # this is model-specific + api_key: str + model: str = "togethercomputer/RedPajama-INCITE-7B-Instruct" + max_context_length: int = 2048 + base_url: str = "https://api.together.xyz" + verify_ssl: bool = True + + _client_session: aiohttp.ClientSession = None + + async def start(self, **kwargs): + self._client_session = aiohttp.ClientSession( + connector=aiohttp.TCPConnector(verify_ssl=self.verify_ssl)) + + async def stop(self): + await self._client_session.close() + + @property + def name(self): + return self.model + + @property + def context_length(self): + return self.max_context_length + + @property + def default_args(self): + return {**DEFAULT_ARGS, "model": self.model, "max_tokens": 1024} + + def count_tokens(self, text: str): + return count_tokens(self.name, text) + + def convert_to_prompt(self, chat_messages: List[ChatMessage]) -> str: + system_message = None + if chat_messages[0]["role"] == "system": + system_message = chat_messages.pop(0)["content"] + + prompt = "\n" + if system_message: + prompt += f": Hi!\n: {system_message}\n" + for message in chat_messages: + prompt += f'<{"human" if message["role"] == "user" else "bot"}>: {message["content"]}\n' + return prompt + + async def stream_complete(self, prompt, with_history: List[ChatMessage] = None, **kwargs) -> Generator[Union[Any, List, Dict], None, None]: + args = self.default_args.copy() + args.update(kwargs) + args["stream_tokens"] = True + + args = {**self.default_args, **kwargs} + messages = compile_chat_messages( + self.name, with_history, self.context_length, args["max_tokens"], prompt, functions=args.get("functions", None), system_message=self.system_message) + + async with self._client_session.post(f"{self.base_url}/inference", json={ + "prompt": self.convert_to_prompt(messages), + **args + }, headers={ + "Authorization": f"Bearer {self.api_key}" + }) as resp: + async for line in resp.content.iter_any(): + if line: + try: + yield line.decode("utf-8") + except: + raise Exception(str(line)) + + async def stream_chat(self, messages: List[ChatMessage] = None, **kwargs) -> Generator[Union[Any, List, Dict], None, None]: + args = {**self.default_args, **kwargs} + messages = compile_chat_messages( + self.name, messages, self.context_length, args["max_tokens"], None, functions=args.get("functions", None), system_message=self.system_message) + args["stream_tokens"] = True + + async with self._client_session.post(f"{self.base_url}/inference", json={ + "prompt": self.convert_to_prompt(messages), + **args + }, headers={ + "Authorization": f"Bearer {self.api_key}" + }) as resp: + async for line in resp.content.iter_chunks(): + if line[1]: + try: + json_chunk = line[0].decode("utf-8") + if json_chunk.startswith(": ping - ") or json_chunk.startswith("data: [DONE]"): + continue + chunks = json_chunk.split("\n") + for chunk in chunks: + if chunk.strip() != "": + yield { + "role": "assistant", + "content": json.loads(chunk[6:])["choices"][0]["text"] + } + except: + raise Exception(str(line[0])) + + async def complete(self, prompt: str, with_history: List[ChatMessage] = None, **kwargs) -> Coroutine[Any, Any, str]: + args = {**self.default_args, **kwargs} + + messages = compile_chat_messages(args["model"], with_history, self.context_length, + args["max_tokens"], prompt, functions=None, system_message=self.system_message) + async with self._client_session.post(f"{self.base_url}/inference", json={ + "prompt": self.convert_to_prompt(messages), + **args + }, headers={ + "Authorization": f"Bearer {self.api_key}" + }) as resp: + try: + return await resp.text() + except: + raise Exception(await resp.text()) diff --git a/extension/react-app/src/redux/slices/serverStateReducer.ts b/extension/react-app/src/redux/slices/serverStateReducer.ts index bd60f1c7..a20476b2 100644 --- a/extension/react-app/src/redux/slices/serverStateReducer.ts +++ b/extension/react-app/src/redux/slices/serverStateReducer.ts @@ -9,9 +9,9 @@ const initialState: FullState = { name: "Welcome to Continue", hide: false, description: `- Highlight code section and ask a question or give instructions - - Use \`cmd+m\` (Mac) / \`ctrl+m\` (Windows) to open Continue - - Use \`/help\` to ask questions about how to use Continue - - [Customize Continue](https://continue.dev/docs/customization) (e.g. use your own API key) by typing '/config'.`, +- Use \`cmd+m\` (Mac) / \`ctrl+m\` (Windows) to open Continue +- Use \`/help\` to ask questions about how to use Continue +- [Customize Continue](https://continue.dev/docs/customization) (e.g. use your own API key) by typing '/config'.`, system_message: null, chat_context: [], manage_own_chat_context: false, -- cgit v1.2.3-70-g09d2 From a131c17326591e67a68faf6f96371ad8fc332b71 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 9 Aug 2023 22:58:07 -0700 Subject: fix: :green_heart: publishing to depend on ALL tests --- .github/workflows/main.yaml | 66 ++++++++++++++++++++++++++++++--------------- extension/package.json | 2 +- 2 files changed, 46 insertions(+), 22 deletions(-) (limited to 'extension') diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9bc05281..99b30201 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -45,7 +45,7 @@ jobs: name: ${{ runner.os }} Build path: dist/* - test-and-publish-extension: + test-and-package: needs: pyinstaller strategy: matrix: @@ -135,42 +135,66 @@ jobs: npm run test if: matrix.os != 'ubuntu-20.04' - # Publish the extension and commit/push the version change (ONLY on ubuntu-20.04) + # Upload .vsix artifact + + - name: Upload .vsix as an artifact + uses: actions/upload-artifact@v2 + with: + name: vsix-artifact + path: extension/build/* + if: matrix.os == 'ubuntu-20.04' + + publish: + needs: test-and-package + runs-on: ubuntu-20.04 + permissions: + contents: write + + steps: + # Checkout and download .vsix artifact + + - name: Checkout + uses: actions/checkout@v2 + + - name: Download .vsix artifact + uses: actions/download-artifact@v2 + with: + name: vsix-artifact + path: extension/build + + # Publish the extension and commit/push the version change + + - name: Use Node.js 19.0.0 + uses: actions/setup-node@v3 + with: + node-version: 19.0.0 + + - name: Cache extension node_modules + uses: actions/cache@v2 + with: + path: extension/node_modules + key: ${{ runner.os }}-node-${{ hashFiles('extension/package-lock.json') }} + + - name: Install extension Dependencies + run: | + cd extension + npm ci - name: Publish run: | cd extension npx vsce publish patch -p ${{ secrets.VSCE_TOKEN }} - if: matrix.os == 'ubuntu-20.04' - - name: Commit changes run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git commit -am "ci: 💚 Update package.json version [skip ci]" - if: matrix.os == 'ubuntu-20.04' - - name: Push changes uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: ${{ github.ref }} - if: matrix.os == 'ubuntu-20.04' - - name: Upload .vsix as an artifact - uses: actions/upload-artifact@v2 - with: - name: vsix-artifact - path: extension/build/* - if: matrix.os == 'ubuntu-20.04' - - publish-binaries: - needs: test-and-publish-extension - runs-on: ubuntu-20.04 - permissions: - contents: write - - steps: # Download binaries and upload to S3 - name: Download Linux build diff --git a/extension/package.json b/extension/package.json index 7cf2bc7d..5db72fd5 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.289", + "version": "0.0.290", "publisher": "Continue", "engines": { "vscode": "^1.67.0" -- cgit v1.2.3-70-g09d2 From ee4701dc45cd540728302ca8a09e9b7ce842597f Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 10 Aug 2023 01:59:02 -0700 Subject: fix: :bug: don't log stdout to console --- extension/src/activation/environmentSetup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extension') diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index f0e41ca9..748a5984 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -240,7 +240,7 @@ export async function startContinuePythonServer() { windowsHide: true, }); child.stdout.on("data", (data: any) => { - console.log(`stdout: ${data}`); + // console.log(`stdout: ${data}`); }); child.stderr.on("data", (data: any) => { console.log(`stderr: ${data}`); -- cgit v1.2.3-70-g09d2 From 0a98c5b312c69079b7bba07b93f2dcb1d609e5a4 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 10 Aug 2023 09:15:12 +0000 Subject: ci: 💚 Update package.json version [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extension/package-lock.json | 4 ++-- extension/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'extension') diff --git a/extension/package-lock.json b/extension/package-lock.json index 610d4b45..cda38826 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.292", + "version": "0.0.293", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.292", + "version": "0.0.293", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 9eb18355..cd536858 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.292", + "version": "0.0.293", "publisher": "Continue", "engines": { "vscode": "^1.67.0" -- cgit v1.2.3-70-g09d2 From 19acf3bb36c1e44274297c806b89b589ca02f5ba Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 10 Aug 2023 10:47:09 -0700 Subject: fix: :green_heart: testing for failure to package dist in vsix --- .github/workflows/main.yaml | 108 ++++++++++++---------- continuedev/src/continuedev/plugins/steps/help.py | 3 +- extension/react-app/src/components/ComboBox.tsx | 3 +- extension/scripts/package.js | 6 ++ 4 files changed, 68 insertions(+), 52 deletions(-) (limited to 'extension') diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 99b30201..03855b64 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -180,55 +180,63 @@ jobs: cd extension npm ci - - name: Publish - run: | - cd extension - npx vsce publish patch -p ${{ secrets.VSCE_TOKEN }} - - name: Commit changes - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -am "ci: 💚 Update package.json version [skip ci]" - - name: Push changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.ref }} - - # Download binaries and upload to S3 - - - name: Download Linux build - uses: actions/download-artifact@v2 - with: - name: Linux Build - path: exe/linux - - - name: Download macOS build - uses: actions/download-artifact@v2 - with: - name: macOS Build - path: exe/mac - - - name: Download Windows build - uses: actions/download-artifact@v2 - with: - name: Windows Build - path: exe/windows - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + - name: Upload .vsix a second time + uses: actions/upload-artifact@v2 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-1 + name: vsix-artifact + path: extension/build - - name: Upload binaries to S3 - uses: jakejarvis/s3-sync-action@master - with: - args: --acl public-read --follow-symlinks --delete - env: - AWS_S3_BUCKET: continue-server-binaries - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: "us-west-1" - SOURCE_DIR: "exe" + # - name: Publish + # run: | + # cd extension + # npx vsce publish patch -p ${{ secrets.VSCE_TOKEN }} + + # - name: Commit changes + # run: | + # git config --local user.email "action@github.com" + # git config --local user.name "GitHub Action" + # git commit -am "ci: 💚 Update package.json version [skip ci]" + + # - name: Push changes + # uses: ad-m/github-push-action@master + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} + # branch: ${{ github.ref }} + + # # Download binaries and upload to S3 + + # - name: Download Linux build + # uses: actions/download-artifact@v2 + # with: + # name: Linux Build + # path: exe/linux + + # - name: Download macOS build + # uses: actions/download-artifact@v2 + # with: + # name: macOS Build + # path: exe/mac + + # - name: Download Windows build + # uses: actions/download-artifact@v2 + # with: + # name: Windows Build + # path: exe/windows + + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v1 + # with: + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # aws-region: us-west-1 + + # - name: Upload binaries to S3 + # uses: jakejarvis/s3-sync-action@master + # with: + # args: --acl public-read --follow-symlinks --delete + # env: + # AWS_S3_BUCKET: continue-server-binaries + # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # AWS_REGION: "us-west-1" + # SOURCE_DIR: "exe" diff --git a/continuedev/src/continuedev/plugins/steps/help.py b/continuedev/src/continuedev/plugins/steps/help.py index ec670999..82f885d6 100644 --- a/continuedev/src/continuedev/plugins/steps/help.py +++ b/continuedev/src/continuedev/plugins/steps/help.py @@ -39,6 +39,7 @@ class HelpStep(Step): if question.strip() == "": self.description = help else: + self.description = "The following output is generated by a language model, which may hallucinate. Type just '/help'to see a fixed answer. You can also learn more by reading [the docs](https://continue.dev/docs).\n\n" prompt = dedent(f""" Information: @@ -48,7 +49,7 @@ class HelpStep(Step): Please us the information below to provide a succinct answer to the following question: {question} - Do not cite any slash commands other than those you've been told about, which are: /edit and /feedback.""") + Do not cite any slash commands other than those you've been told about, which are: /edit and /feedback. Never refer or link to any URL.""") self.chat_context.append(ChatMessage( role="user", diff --git a/extension/react-app/src/components/ComboBox.tsx b/extension/react-app/src/components/ComboBox.tsx index 472e1b14..bf32fc5a 100644 --- a/extension/react-app/src/components/ComboBox.tsx +++ b/extension/react-app/src/components/ComboBox.tsx @@ -479,7 +479,8 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => { selected={downshiftProps.selectedItem === item} > - {item.name}:{" "} + {item.name} + {" "} {item.description} diff --git a/extension/scripts/package.js b/extension/scripts/package.js index ae9a4d94..e36df029 100644 --- a/extension/scripts/package.js +++ b/extension/scripts/package.js @@ -17,6 +17,12 @@ exec("npm install", (error) => { exec("npm run build", (error) => { if (error) throw error; + if (!fs.existsSync(path.join("dist", "assets", "index.js"))) { + throw new Error("react-app build did not produce index.js"); + } + if (!fs.existsSync(path.join("dist", "assets", "index.css"))) { + throw new Error("react-app build did not produce index.css"); + } console.log("npm run build in react-app completed"); process.chdir(".."); -- cgit v1.2.3-70-g09d2 From 5bfe68ea7f7e90e3cb1c3101360cf959b336a857 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 10 Aug 2023 10:52:16 -0700 Subject: fix: :bug: fix missing path import --- extension/scripts/package.js | 1 + 1 file changed, 1 insertion(+) (limited to 'extension') diff --git a/extension/scripts/package.js b/extension/scripts/package.js index e36df029..8b2816c5 100644 --- a/extension/scripts/package.js +++ b/extension/scripts/package.js @@ -1,5 +1,6 @@ const { exec } = require("child_process"); const fs = require("fs"); +const path = require("path"); exec("npm install", (error) => { if (error) throw error; -- cgit v1.2.3-70-g09d2 From 40ec1a31a7cd37da8b75bbabf1f0d160bb7bec5d Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 10 Aug 2023 11:24:46 -0700 Subject: fix: :white_check_mark: allow longer wait in test --- extension/src/test-suite/environmentSetup.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'extension') diff --git a/extension/src/test-suite/environmentSetup.test.ts b/extension/src/test-suite/environmentSetup.test.ts index 8099e9ac..d0406340 100644 --- a/extension/src/test-suite/environmentSetup.test.ts +++ b/extension/src/test-suite/environmentSetup.test.ts @@ -8,9 +8,14 @@ import fkill from "fkill"; describe("Can start python server", () => { test("Can start python server in under 10 seconds", async function () { - const allowedTime = 15_000; + const allowedTime = 25_000; this.timeout(allowedTime + 10_000); - fkill(65432, { force: true, silent: true }); + try { + fkill(65432, { force: true, silent: true }); + console.log("Killed existing server"); + } catch (e) { + console.log("No existing server: ", e); + } // If successful, the server is started by the extension while we wait await new Promise((resolve) => setTimeout(resolve, allowedTime)); -- cgit v1.2.3-70-g09d2 From 5438ce94406baa0f7d131ecacadefc72912dca0d Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 10 Aug 2023 14:16:52 -0700 Subject: fix: :green_heart: remove version from apckage.json --- extension/package.json | 1 - 1 file changed, 1 deletion(-) (limited to 'extension') diff --git a/extension/package.json b/extension/package.json index 0466dd99..2e128e99 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,6 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.296", "publisher": "Continue", "engines": { "vscode": "^1.67.0" -- cgit v1.2.3-70-g09d2 From 27c0a403de28345cd03c39ad46c02f68ff57b3a1 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 10 Aug 2023 23:01:34 -0700 Subject: fix: :fire: remove version from package.json --- .vscode/launch.json | 2 +- extension/package-lock.json | 1 - extension/react-app/package.json | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) (limited to 'extension') diff --git a/.vscode/launch.json b/.vscode/launch.json index 42f3adcc..12cfaef8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -41,7 +41,7 @@ "outFiles": ["${workspaceFolder}/extension/out/**/*.js"], "preLaunchTask": "vscode-extension:build", "env": { - "CONTINUE_SERVER_URL": "http://localhost:65432" + "CONTINUE_SERVER_URL": "http://localhost:8001" } }, // Has to be run after starting the server (separately or using the compound configuration) diff --git a/extension/package-lock.json b/extension/package-lock.json index 6f7d32b2..b64513ec 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,6 +1,5 @@ { "name": "continue", - "version": "0.0.296", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/extension/react-app/package.json b/extension/react-app/package.json index b4762990..67fb2244 100644 --- a/extension/react-app/package.json +++ b/extension/react-app/package.json @@ -1,7 +1,6 @@ { "name": "react-app", "private": true, - "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", -- cgit v1.2.3-70-g09d2 From d8327ec6f82058479bd294bfcdccaf3c2b54de0a Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 10 Aug 2023 23:25:12 -0700 Subject: fix: :green_heart: remove "patch" from vsce publish command --- .github/workflows/main.yaml | 2 +- extension/package-lock.json | 1 + extension/package.json | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'extension') diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ddfe9288..a114c7c9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -183,7 +183,7 @@ jobs: - name: Publish run: | cd extension - npx vsce publish patch -p ${{ secrets.VSCE_TOKEN }} --packagePath ./build/*.vsix + npx vsce publish -p ${{ secrets.VSCE_TOKEN }} --packagePath ./build/*.vsix - name: Commit changes run: | diff --git a/extension/package-lock.json b/extension/package-lock.json index b64513ec..97451b1a 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,5 +1,6 @@ { "name": "continue", + "version": "0.0.297", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/extension/package.json b/extension/package.json index 2e128e99..07af8a59 100644 --- a/extension/package.json +++ b/extension/package.json @@ -1,6 +1,7 @@ { "name": "continue", "icon": "media/terminal-continue.png", + "version": "0.0.297", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" -- cgit v1.2.3-70-g09d2 From 34f32ed5f71055ea11d4332f18e77ceba5849631 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 10 Aug 2023 23:39:19 -0700 Subject: fix: :green_heart: package patch --- extension/scripts/package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extension') diff --git a/extension/scripts/package.js b/extension/scripts/package.js index 8b2816c5..59da9181 100644 --- a/extension/scripts/package.js +++ b/extension/scripts/package.js @@ -32,7 +32,7 @@ exec("npm install", (error) => { fs.mkdirSync("build"); } - exec("vsce package --out ./build", (error) => { + exec("vsce package --out ./build patch", (error) => { if (error) throw error; console.log("vsce package completed"); }); -- cgit v1.2.3-70-g09d2 From 1936f725d226bea2e13d5d88c1dd7a9a02ddd259 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 11 Aug 2023 13:34:14 -0700 Subject: fix: :bug: version patch in the publish step --- .github/workflows/main.yaml | 5 +++++ extension/package-lock.json | 4 ++-- extension/package.json | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'extension') diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a114c7c9..a3927f3f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -185,6 +185,11 @@ jobs: cd extension npx vsce publish -p ${{ secrets.VSCE_TOKEN }} --packagePath ./build/*.vsix + - name: Update version in package.json + run: | + cd extension + npm version patch + - name: Commit changes run: | git config --local user.email "action@github.com" diff --git a/extension/package-lock.json b/extension/package-lock.json index 97451b1a..be8873b3 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.297", + "version": "0.0.298", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.296", + "version": "0.0.298", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 07af8a59..dfc281c3 100644 --- a/extension/package.json +++ b/extension/package.json @@ -1,7 +1,7 @@ { "name": "continue", "icon": "media/terminal-continue.png", - "version": "0.0.297", + "version": "0.0.298", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" -- cgit v1.2.3-70-g09d2 From 9e6419b36019987e9aea2b0aa02fe9792ca537dd Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 11 Aug 2023 20:42:18 +0000 Subject: ci: 💚 Update package.json version [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extension/package-lock.json | 4 ++-- extension/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'extension') diff --git a/extension/package-lock.json b/extension/package-lock.json index be8873b3..19d91123 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.298", + "version": "0.0.299", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.298", + "version": "0.0.299", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index dfc281c3..c5fc5b67 100644 --- a/extension/package.json +++ b/extension/package.json @@ -1,7 +1,7 @@ { "name": "continue", "icon": "media/terminal-continue.png", - "version": "0.0.298", + "version": "0.0.299", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" -- cgit v1.2.3-70-g09d2