Nate/prompt-file (#1308)

* ✨ .prompt files

* 🧑‍💻 back to npm  : (

* 🎨 nicer dropdown icon

* 🎨 full switch back to npm

* 🧑‍💻 uninstall script for fresh start

* 🎨 updated package-locks
This commit is contained in:
Nate Sesti 2024-05-17 15:24:34 -07:00 • committed by GitHub
parent 7fde022235
commit bc93e4a9e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 55821 additions and 40035 deletions

View file

@ -58,15 +58,14 @@ Continue is continuously improving, but a feature isn't complete until it is ref
#### Pre-requisites
- You should have Node.js version 20.11.0 (LTS) or higher installed. You can get it on [nodejs.org](https://nodejs.org/en/download) or, if you are using NVM (Node Version Manager), you can set the correct version of Node.js for this project by running the following command in the root of the project:
- Continue uses `pnpm` to manage node_modules. You can install `pnpm` globally with `npm install -g pnpm`, or another method described in [their docs](https://pnpm.io/installation#using-npm).
#### VS Code
You should have Node.js version 20.11.0 (LTS) or higher installed. You can get it on [nodejs.org](https://nodejs.org/en/download) or, if you are using NVM (Node Version Manager), you can set the correct version of Node.js for this project by running the following command in the root of the project:
```bash
nvm use
```
#### VS Code
1. Clone and open in VS Code the Continue repo `https://github.com/continuedev/continue`
2. Open the VS Code command pallet (`cmd/ctrl+shift+p`) and select `Tasks: Run Task` and then select `install-all-dependencies`
@ -80,7 +79,7 @@ nvm use
1. The new VS Code window with the extension is referred to as the _Host VS Code_
2. The window you started debugging from is referred to as the _Main VS Code_
4. To package the extension, run `pnpm package` in the `extensions/vscode` directory. This will generate `extensions/vscode/build/continue-patch.vsix`, which you can install by right-clicking and selecting "Install Extension VSIX".
4. To package the extension, run `npm package` in the `extensions/vscode` directory. This will generate `extensions/vscode/build/continue-patch.vsix`, which you can install by right-clicking and selecting "Install Extension VSIX".
> Note: Breakpoints can be used in both the `core` and `extensions/vscode` folders while debugging, but are not currently supported inside of `gui` code. Hot-reloading is enabled with Vite, so if you make any changes to the `gui`, they should be automatically reflected without rebuilding. Similarly, any changes to `core` or `extensions/vscode` will be automatically included by just reloading the _Host VS Code_ window with cmd/ctrl+shift+p "Reload Window".

3300
binary/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

5916
binary/pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -64,7 +64,7 @@ export class ConfigHandler {
const uniqueId = await this.ide.getUniqueId();
this.savedConfig = await loadFullConfigNode(
this.ide.readFile.bind(this.ide),
this.ide,
workspaceConfigs,
this.ideSettings,
ideInfo.ideType,

View file

@ -19,6 +19,7 @@ import {
CustomLLM,
EmbeddingsProviderDescription,
IContextProvider,
IDE,
IdeType,
ModelDescription,
Reranker,
@ -49,6 +50,7 @@ import {
defaultSlashCommandsJetBrains,
defaultSlashCommandsVscode,
} from "./default.js";
import { getPromptFiles, slashCommandFromPromptFile } from "./promptFile.js";
const { execSync } = require("child_process");
function resolveSerializedConfig(filepath: string): SerializedContinueConfig {
@ -130,9 +132,10 @@ function loadSerializedConfig(
return config;
}
function serializedToIntermediateConfig(
async function serializedToIntermediateConfig(
initial: SerializedContinueConfig,
): Config {
ide: IDE,
): Promise<Config> {
const slashCommands: SlashCommand[] = [];
for (const command of initial.slashCommands || []) {
const newCommand = slashCommandFromDescription(command);
@ -144,6 +147,20 @@ function serializedToIntermediateConfig(
slashCommands.push(slashFromCustomCommand(command));
}
const workspaceDirs = await ide.getWorkspaceDirs();
const promptFiles = (
await Promise.all(
workspaceDirs.map((dir) =>
getPromptFiles(ide, path.join(dir, ".prompts")),
),
)
)
.flat()
.filter(({ path }) => path.endsWith(".prompt"));
for (const file of promptFiles) {
slashCommands.push(slashCommandFromPromptFile(file.path, file.content));
}
const config: Config = {
...initial,
slashCommands,
@ -168,7 +185,7 @@ function isContextProviderWithParams(
/** Only difference between intermediate and final configs is the `models` array */
async function intermediateToFinalConfig(
config: Config,
readFile: (filepath: string) => Promise<string>,
ide: IDE,
ideSettings: IdeSettings,
uniqueId: string,
writeLog: (log: string) => Promise<void>,
@ -179,7 +196,7 @@ async function intermediateToFinalConfig(
if (isModelDescription(desc)) {
const llm = await llmFromDescription(
desc,
readFile,
ide.readFile.bind(ide),
uniqueId,
ideSettings,
writeLog,
@ -201,7 +218,7 @@ async function intermediateToFinalConfig(
model: modelName,
title: llm.title + " - " + modelName,
},
readFile,
ide.readFile.bind(ide),
uniqueId,
ideSettings,
writeLog,
@ -261,7 +278,7 @@ async function intermediateToFinalConfig(
if (isModelDescription(config.tabAutocompleteModel)) {
autocompleteLlm = await llmFromDescription(
config.tabAutocompleteModel,
readFile,
ide.readFile.bind(ide),
uniqueId,
ideSettings,
writeLog,
@ -451,7 +468,7 @@ async function buildConfigTs() {
}
async function loadFullConfigNode(
readFile: (filepath: string) => Promise<string>,
ide: IDE,
workspaceConfigs: ContinueRcJson[],
ideSettings: IdeSettings,
ideType: IdeType,
@ -459,7 +476,7 @@ async function loadFullConfigNode(
writeLog: (log: string) => Promise<void>,
): Promise<ContinueConfig> {
let serialized = loadSerializedConfig(workspaceConfigs, ideSettings, ideType);
let intermediate = serializedToIntermediateConfig(serialized);
let intermediate = await serializedToIntermediateConfig(serialized, ide);
const configJsContents = await buildConfigTs();
if (configJsContents) {
@ -496,7 +513,7 @@ async function loadFullConfigNode(
const finalConfig = await intermediateToFinalConfig(
intermediate,
readFile,
ide,
ideSettings,
uniqueId,
writeLog,

103
core/config/promptFile.ts Normal file
View file

@ -0,0 +1,103 @@
import * as YAML from "yaml";
import { IDE, SlashCommand } from "..";
import { stripImages } from "../llm/countTokens";
import { renderTemplatedString } from "../llm/llms";
import { getBasename } from "../util";
export async function getPromptFiles(
ide: IDE,
dir: string,
): Promise<{ path: string; content: string }[]> {
const paths = await ide.listWorkspaceContents(dir);
const results = paths.map(async (path) => {
const content = await ide.readFile(path);
return { path, content };
});
return Promise.all(results);
}
export function slashCommandFromPromptFile(
path: string,
content: string,
): SlashCommand {
let [preambleRaw, prompt] = content.split("\n---\n");
if (prompt === undefined) {
prompt = preambleRaw;
preambleRaw = "";
}
const preamble = YAML.parse(preambleRaw) ?? {};
const name = preamble.name ?? getBasename(path).split(".prompt")[0];
const description = preamble.description ?? name;
let systemMessage: string | undefined = undefined;
if (prompt.includes("<system>")) {
systemMessage = prompt.split("<system>")[1].split("</system>")[0].trim();
prompt = prompt.split("</system>")[1].trim();
}
return {
name,
description,
run: async function* ({ input, llm, history, ide }) {
// Remove slash command prefix from input
let userInput = input;
if (userInput.startsWith(`/${name}`)) {
userInput = userInput
.slice(name.length + 1, userInput.length)
.trimStart();
}
// Render prompt template
const diff = await ide.getDiff();
const promptUserInput = await renderTemplatedString(
prompt,
ide.readFile.bind(ide),
{ input: userInput, diff },
);
const messages = [...history];
// Find the last chat message with this slash command and replace it with the user input
for (let i = messages.length - 1; i >= 0; i--) {
const { role, content } = messages[i];
if (role !== "user") {
continue;
}
if (
Array.isArray(content) &&
content.some((part) => part.text?.startsWith(`/${name}`))
) {
messages[i] = {
...messages[i],
content: content.map((part) => {
return part.text?.startsWith(`/${name}`)
? { ...part, text: promptUserInput }
: part;
}),
};
break;
} else if (
typeof content === "string" &&
content.startsWith(`/${name}`)
) {
messages[i] = { ...messages[i], content: promptUserInput };
break;
}
}
// System message
if (systemMessage) {
if (messages[0]?.role === "system") {
messages[0].content = systemMessage;
} else {
messages.unshift({ role: "system", content: systemMessage });
}
}
for await (const chunk of llm.streamChat(messages)) {
yield stripImages(chunk.content);
}
},
};
}

10651
core/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -65,7 +65,8 @@
"tree-sitter-wasms": "^0.1.11",
"uuid": "^9.0.1",
"vectordb": "^0.4.12",
"web-tree-sitter": "^0.21.0"
"web-tree-sitter": "^0.21.0",
"yaml": "^2.4.2"
},
"puppeteer": {
"chromium_revision": "119.0.6045.105"

7734
core/pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,31 @@
temperature: 0.0
---
{{{ diff }}}
Give me feedback on the above changes. For each file, you should output a markdown section including the following:
- If you found any problems, an h3 like "❌ <filename>"
- If you didn't find any problems, an h3 like "✅ <filename>"
- If you found any problems, add below a bullet point description of what you found, including a minimal code snippet explaining how to fix it
- If you didn't find any problems, you don't need to add anything else
Here is an example. The example is surrounded in backticks, but your response should not be:
```
### ✅ <Filename1>
### ❌ <Filename2>
<Description>
```
You should look primarily for the following types of issues, and only mention other problems if they are highly pressing.
- console.logs that have been left after debugging
- repeated code
- algorithmic errors that could fail under edge cases
- something that could be refactored
For the following types of files, you should completely ignore them. Do not write the header or any feedback:
- package-lock.json
- yarn.lock
- any other json file

View file

@ -0,0 +1,16 @@
temperature: 0.5
maxTokens: 2048
---
<system>
You are an expert programmer
</system>
{{{ input }}}
Write unit tests for the above selected code, following each of these instructions:
- Use `jest`
- Properly set up and tear down
- Include important edge cases
- The tests should be complete and sophisticated
- Give the tests just as chat output, don't edit any file
- Don't explain how to set up `jest`

View file

@ -267,7 +267,10 @@
"apiType": {
"title": "Api Type",
"markdownDescription": "OpenAI API type, either `openai` or `azure`",
"enum": ["openai", "azure"]
"enum": [
"openai",
"azure"
]
},
"apiVersion": {
"title": "Api Version",
@ -280,7 +283,11 @@
"type": "string"
}
},
"required": ["title", "provider", "model"],
"required": [
"title",
"provider",
"model"
],
"allOf": [
{
"if": {
@ -290,7 +297,9 @@
}
},
"not": {
"required": ["provider"]
"required": [
"provider"
]
}
},
"then": {
@ -316,33 +325,48 @@
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"required": ["apiKey"]
"required": [
"apiKey"
]
}
},
{
"if": {
"properties": {
"provider": {
"enum": ["huggingface-tgi", "huggingface-inference-api"]
"enum": [
"huggingface-tgi",
"huggingface-inference-api"
]
}
}
},
"then": {
"required": ["apiBase"]
"required": [
"apiBase"
]
},
"required": ["provider"]
"required": [
"provider"
]
},
{
"if": {
"properties": {
"provider": {
"enum": ["openai"]
"enum": [
"openai"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -362,10 +386,14 @@
"if": {
"properties": {
"provider": {
"enum": ["openai"]
"enum": [
"openai"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -396,10 +424,14 @@
"if": {
"properties": {
"provider": {
"enum": ["replicate"]
"enum": [
"replicate"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -429,10 +461,14 @@
"if": {
"properties": {
"provider": {
"enum": ["free-trial"]
"enum": [
"free-trial"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -459,7 +495,9 @@
"if": {
"properties": {
"provider": {
"enum": ["openai"]
"enum": [
"openai"
]
},
"apiType": {
"not": {
@ -467,7 +505,9 @@
}
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -525,10 +565,14 @@
"if": {
"properties": {
"provider": {
"enum": ["anthropic"]
"enum": [
"anthropic"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -556,15 +600,22 @@
"if": {
"properties": {
"provider": {
"enum": ["cohere"]
"enum": [
"cohere"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
"model": {
"enum": ["command-r", "command-r-plus"]
"enum": [
"command-r",
"command-r-plus"
]
}
}
}
@ -573,10 +624,14 @@
"if": {
"properties": {
"provider": {
"enum": ["bedrock"]
"enum": [
"bedrock"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -601,10 +656,14 @@
"if": {
"properties": {
"provider": {
"enum": ["gemini"]
"enum": [
"gemini"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -622,10 +681,14 @@
"if": {
"properties": {
"provider": {
"enum": ["together"]
"enum": [
"together"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -659,10 +722,14 @@
"if": {
"properties": {
"provider": {
"enum": ["deepinfra"]
"enum": [
"deepinfra"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -685,7 +752,9 @@
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -731,10 +800,14 @@
"if": {
"properties": {
"provider": {
"enum": ["ollama"]
"enum": [
"ollama"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -782,10 +855,14 @@
"if": {
"properties": {
"provider": {
"enum": ["mistral"]
"enum": [
"mistral"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -806,10 +883,14 @@
"if": {
"properties": {
"provider": {
"enum": ["groq"]
"enum": [
"groq"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -833,20 +914,30 @@
"const": "azure"
}
},
"required": ["apiType"]
"required": [
"apiType"
]
},
"then": {
"required": ["engine", "apiVersion", "apiBase"]
"required": [
"engine",
"apiVersion",
"apiBase"
]
}
},
{
"if": {
"properties": {
"provider": {
"enum": ["openai"]
"enum": [
"openai"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -863,7 +954,9 @@
"const": "llamafile"
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -877,10 +970,14 @@
"if": {
"properties": {
"provider": {
"enum": ["text-gen-webui"]
"enum": [
"text-gen-webui"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -894,10 +991,14 @@
"if": {
"properties": {
"provider": {
"enum": ["flowise"]
"enum": [
"flowise"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"properties": {
@ -924,7 +1025,10 @@
"type": "string"
}
},
"required": ["key", "value"]
"required": [
"key",
"value"
]
}
},
"additionalFlowiseConfiguration": {
@ -943,7 +1047,10 @@
"description": "Configuration Property value"
}
},
"required": ["key", "value"]
"required": [
"key",
"value"
]
}
},
"model": {
@ -1032,7 +1139,9 @@
"type": "string"
}
},
"required": ["default"]
"required": [
"default"
]
},
"SlashCommand": {
"title": "SlashCommand",
@ -1091,7 +1200,9 @@
"if": {
"properties": {
"name": {
"enum": ["issue"]
"enum": [
"issue"
]
}
}
},
@ -1104,17 +1215,23 @@
"description": "Enter the URL of the GitHub repository for which you want to generate the issue."
}
},
"required": ["repositoryUrl"]
"required": [
"repositoryUrl"
]
}
},
"required": ["params"]
"required": [
"params"
]
}
},
{
"if": {
"properties": {
"name": {
"enum": ["edit"]
"enum": [
"edit"
]
}
}
},
@ -1139,7 +1256,9 @@
"if": {
"properties": {
"name": {
"enum": ["share"]
"enum": [
"share"
]
}
}
},
@ -1157,7 +1276,10 @@
}
}
],
"required": ["name", "description"]
"required": [
"name",
"description"
]
},
"CustomCommand": {
"title": "CustomCommand",
@ -1176,7 +1298,11 @@
"type": "string"
}
},
"required": ["name", "prompt", "description"]
"required": [
"name",
"prompt",
"description"
]
},
"ContextProviderWithParams": {
"title": "ContextProviderWithParams",
@ -1249,7 +1375,9 @@
"if": {
"properties": {
"name": {
"enum": ["google"]
"enum": [
"google"
]
}
}
},
@ -1262,17 +1390,23 @@
"description": "Your API key for https://serper.dev in order to get Google search results"
}
},
"required": ["serperApiKey"]
"required": [
"serperApiKey"
]
}
},
"required": ["params"]
"required": [
"params"
]
}
},
{
"if": {
"properties": {
"name": {
"enum": ["open"]
"enum": [
"open"
]
}
}
},
@ -1294,7 +1428,9 @@
"if": {
"properties": {
"name": {
"enum": ["issue"]
"enum": [
"issue"
]
}
}
},
@ -1323,24 +1459,37 @@
"type": {
"type": "string",
"description": "The type of issues to search for",
"enum": ["open", "closed", "all"]
"enum": [
"open",
"closed",
"all"
]
}
},
"required": ["owner", "repo"]
"required": [
"owner",
"repo"
]
}
}
},
"required": ["repos"]
"required": [
"repos"
]
}
},
"required": ["params"]
"required": [
"params"
]
}
},
{
"if": {
"properties": {
"name": {
"enum": ["database"]
"enum": [
"database"
]
}
}
},
@ -1358,7 +1507,11 @@
"connection_type": {
"type": "string",
"description": "The type of database (e.g., 'postgres', 'mysql')",
"enum": ["postgres", "mysql", "sqlite"]
"enum": [
"postgres",
"mysql",
"sqlite"
]
},
"connection": {
"type": "object",
@ -1391,17 +1544,25 @@
"required": []
}
},
"required": ["name", "type", "connection"]
"required": [
"name",
"type",
"connection"
]
}
},
"required": ["connections"]
"required": [
"connections"
]
}
},
{
"if": {
"properties": {
"name": {
"enum": ["gitlab-mr"]
"enum": [
"gitlab-mr"
]
}
}
},
@ -1422,17 +1583,23 @@
"description": "If you have code selected, filters out comments that aren't related to the selection."
}
},
"required": ["token"]
"required": [
"token"
]
}
},
"required": ["params"]
"required": [
"params"
]
}
},
{
"if": {
"properties": {
"name": {
"enum": ["jira"]
"enum": [
"jira"
]
}
}
},
@ -1478,17 +1645,24 @@
]
}
},
"required": ["domain", "token"]
"required": [
"domain",
"token"
]
}
},
"required": ["params"]
"required": [
"params"
]
}
},
{
"if": {
"properties": {
"name": {
"enum": ["http"]
"enum": [
"http"
]
}
}
},
@ -1501,17 +1675,24 @@
"description": "The HTTP endpoint of your context provider server."
}
},
"required": ["url"]
"required": [
"url"
]
}
},
"required": ["params"]
"required": [
"params"
]
}
},
{
"if": {
"properties": {
"name": {
"enum": ["codebase", "folder"]
"enum": [
"codebase",
"folder"
]
}
}
},
@ -1546,7 +1727,9 @@
"if": {
"properties": {
"name": {
"enum": ["postgres"]
"enum": [
"postgres"
]
}
}
},
@ -1598,11 +1781,19 @@
}
}
},
"required": ["host", "port", "user", "password", "database"]
"required": [
"host",
"port",
"user",
"password",
"database"
]
}
}
],
"required": ["name"]
"required": [
"name"
]
},
"SerializedContinueConfig": {
"title": "config.json",
@ -1753,32 +1944,46 @@
"$ref": "#/definitions/RequestOptions"
}
},
"required": ["provider"],
"required": [
"provider"
],
"allOf": [
{
"if": {
"properties": {
"provider": {
"enum": ["ollama"]
"enum": [
"ollama"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"required": ["model"]
"required": [
"model"
]
}
},
{
"if": {
"properties": {
"provider": {
"enum": ["cohere"]
"enum": [
"cohere"
]
}
},
"required": ["provider"]
"required": [
"provider"
]
},
"then": {
"required": ["apiKey"]
"required": [
"apiKey"
]
}
}
]
@ -1789,22 +1994,33 @@
"type": "object",
"properties": {
"name": {
"enum": ["cohere", "voyage", "llm", "free-trial"]
"enum": [
"cohere",
"voyage",
"llm",
"free-trial"
]
},
"params": {
"type": "object"
}
},
"required": ["name"],
"required": [
"name"
],
"allOf": [
{
"if": {
"properties": {
"name": {
"enum": ["cohere"]
"enum": [
"cohere"
]
}
},
"required": ["name"]
"required": [
"name"
]
},
"then": {
"properties": {
@ -1826,7 +2042,9 @@
"type": "string"
}
},
"required": ["apiKey"]
"required": [
"apiKey"
]
}
}
}
@ -1835,10 +2053,14 @@
"if": {
"properties": {
"name": {
"enum": ["llm"]
"enum": [
"llm"
]
}
},
"required": ["name"]
"required": [
"name"
]
},
"then": {
"properties": {
@ -1849,7 +2071,9 @@
"type": "string"
}
},
"required": ["modelTitle"]
"required": [
"modelTitle"
]
}
}
}
@ -1858,10 +2082,14 @@
"if": {
"properties": {
"name": {
"enum": ["voyage"]
"enum": [
"voyage"
]
}
},
"required": ["name"]
"required": [
"name"
]
},
"then": {
"properties": {
@ -1872,10 +2100,14 @@
"type": "string"
},
"model": {
"enum": ["rerank-lite-1"]
"enum": [
"rerank-lite-1"
]
}
},
"required": ["apiKey"]
"required": [
"apiKey"
]
}
}
}
@ -1931,7 +2163,11 @@
"description": "An optional template string to be used for autocomplete. It will be rendered with the Mustache templating language, and is passed the 'prefix' and 'suffix' variables."
},
"multilineCompletions": {
"enum": ["always", "never", "auto"],
"enum": [
"always",
"never",
"auto"
],
"description": "If set to true, Continue will only complete a single line at a time."
},
"useCache": {
@ -1960,7 +2196,10 @@
"type": "object",
"properties": {
"codeBlockToolbarPosition": {
"enum": ["top", "bottom"],
"enum": [
"top",
"bottom"
],
"default": "top",
"description": "Whether to show the copy and apply code buttons at the top or bottom of code blocks in the sidebar."
},
@ -1977,7 +2216,9 @@
"defaultContext": {
"type": "array",
"items": {
"enum": ["activeFile"]
"enum": [
"activeFile"
]
}
},
"modelRoles": {
@ -2017,7 +2258,10 @@
},
"mergeBehavior": {
"type": "string",
"enum": ["merge", "overwrite"],
"enum": [
"merge",
"overwrite"
],
"default": "merge",
"title": "Merge behavior",
"markdownDescription": "If set to 'merge', .continuerc.json will be applied on top of config.json (arrays and objects are merged). If set to 'overwrite', then every top-level property of .continuerc.json will overwrite that property from config.json."
@ -2025,4 +2269,4 @@
}
}
}
}
}

25965
extensions/vscode/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -102,16 +102,16 @@ const exe = os === "win32" ? ".exe" : "";
}
// Install node_modules //
// execCmdSync("pnpm install");
// console.log("[info] pnpm install in extensions/vscode completed");
// execCmdSync("npm install");
// console.log("[info] npm install in extensions/vscode completed");
process.chdir("../../gui");
execCmdSync("pnpm install");
console.log("[info] pnpm install in gui completed");
execCmdSync("npm install");
console.log("[info] npm install in gui completed");
if (ghAction()) {
execCmdSync("pnpm run build");
execCmdSync("npm run build");
}
// Copy over the dist folder to the Intellij extension //

View file

@ -214,7 +214,10 @@ export class VsCodeExtension {
// Listen for file changes in the workspace
const filepath = event.uri.fsPath;
if (filepath.endsWith(".continuerc.json")) {
if (
filepath.endsWith(".continuerc.json") ||
filepath.endsWith(".prompt")
) {
this.configHandler.reloadConfig();
this.tabAutocompleteModel.clearLlm();
} else if (

File diff suppressed because it is too large Load diff

15314
gui/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

1
gui/pnpm-lock.yaml generated
View file

@ -4517,6 +4517,7 @@ snapshots:
uuid: 9.0.1
vectordb: 0.4.20(@apache-arrow/ts@14.0.2)(apache-arrow@14.0.2)
web-tree-sitter: 0.21.0
yaml: 2.4.2
transitivePeerDependencies:
- '@apache-arrow/ts'
- apache-arrow

View file

@ -4,10 +4,10 @@ import {
AtSymbolIcon,
BeakerIcon,
BookOpenIcon,
ChevronDoubleRightIcon,
CodeBracketIcon,
Cog6ToothIcon,
CommandLineIcon,
CubeIcon,
ExclamationCircleIcon,
ExclamationTriangleIcon,
FolderIcon,
@ -82,8 +82,8 @@ function DropdownIcon(props: { className?: string; item: ComboBoxItem }) {
props.item.type === "contextProvider"
? props.item.id
: props.item.type === "slashCommand"
? props.item.id
: props.item.type;
? props.item.id
: props.item.type;
const Icon = ICONS_FOR_DROPDOWN[provider];
const iconClass = `${props.className} flex-shrink-0`;
@ -91,11 +91,7 @@ function DropdownIcon(props: { className?: string; item: ComboBoxItem }) {
return props.item.type === "contextProvider" ? (
<AtSymbolIcon className={iconClass} height="1.2em" width="1.2em" />
) : (
<ChevronDoubleRightIcon
className={iconClass}
height="1.2em"
width="1.2em"
/>
<CubeIcon className={iconClass} height="1.2em" width="1.2em" />
);
}
return <Icon className={iconClass} height="1.2em" width="1.2em" />;

View file

@ -50,15 +50,15 @@ if (($null -eq $cargo) -or ($null -eq $node)) {
Write-Host "`nInstalling Core extension dependencies..." -ForegroundColor White
Push-Location core
pnpm install
pnpm link --global
npm install
npm link
Pop-Location
Write-Output "`nInstalling GUI extension dependencies..." -ForegroundColor White
Push-Location gui
pnpm install
pnpm link --global @continuedev/core
pnpm run build
npm install
npm link @continuedev/core
npm run build
Pop-Location
# VSCode Extension (will also package GUI)
@ -66,10 +66,10 @@ Write-Output "`nInstalling VSCode extension dependencies..." -ForegroundColor Wh
Push-Location extensions/vscode
# This does way too many things inline but is the common denominator between many of the scripts
pnpm install
pnpm link --global @continuedev/core
npm install
npm link @continuedev/core
pnpm run package
npm run package
Pop-Location
@ -77,8 +77,8 @@ Pop-Location
Write-Output "`nInstalling binary dependencies..." -ForegroundColor White
Push-Location binary
pnpm install
pnpm run build
npm install
npm run build
Pop-Location

View file

@ -6,28 +6,28 @@
set -e
echo "Installing Core extension dependencies..."
pushd core
pnpm install
pnpm link --global
npm install
npm link
popd
echo "Installing GUI extension dependencies..."
pushd gui
pnpm install
pnpm link --global @continuedev/core
pnpm run build
npm install
npm link @continuedev/core
npm run build
popd
# VSCode Extension (will also package GUI)
echo "Installing VSCode extension dependencies..."
pushd extensions/vscode
# This does way too many things inline but is the common denominator between many of the scripts
pnpm install
pnpm link --global @continuedev/core
pnpm run package
npm install
npm link @continuedev/core
npm run package
popd
echo "Installing binary dependencies..."
pushd binary
pnpm install
pnpm run build
npm install
npm run build

View file

@ -1,15 +1,30 @@
const fs = require("fs");
const path = require("path");
const directories = ["./gui", "./core", "./extensions/vscode", "./binary"];
const directories = [
// gui
"./gui/node_modules",
"./gui/out",
"./gui/dist",
// core
"./core/node_modules",
"./core/dist",
// extensions/vscode
"./extensions/vscode/node_modules",
"./extensions/vscode/bin",
"./extensions/vscode/build",
"./extensions/vscode/out",
// binary
"./binary/node_modules",
"./binary/bin",
"./binary/dist",
"./binary/out",
];
directories.forEach((dir) => {
const nodeModulesPath = path.join(dir, "node_modules");
if (fs.existsSync(nodeModulesPath)) {
fs.rmdirSync(nodeModulesPath, { recursive: true });
console.log(`Removed ${nodeModulesPath}`);
if (fs.existsSync(dir)) {
fs.rmdirSync(dir, { recursive: true });
console.log(`Removed ${dir}`);
} else {
console.log(`No node_modules found in ${dir}`);
console.log(`${dir} not found`);
}
});