diff --git a/.changes/extensions/intellij/0.0.92.md b/.changes/extensions/intellij/0.0.92.md new file mode 100644 index 000000000..2d3774eec --- /dev/null +++ b/.changes/extensions/intellij/0.0.92.md @@ -0,0 +1,5 @@ +## 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 new file mode 100644 index 000000000..43ea4a0ed --- /dev/null +++ b/.changes/extensions/intellij/1.0.0.md @@ -0,0 +1,7 @@ +## 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/vscode/1.0.0.md b/.changes/extensions/vscode/1.0.0.md new file mode 100644 index 000000000..cea7899ff --- /dev/null +++ b/.changes/extensions/vscode/1.0.0.md @@ -0,0 +1,6 @@ +## 1.0.0 - 2025-02-26 +### Added +* Introduces hub.continue.dev +* Improved apply quality +### Fixed +* Numerous reliability improvements diff --git a/.changes/unreleased/Fixed-20241007-183820.yaml b/.changes/unreleased/Fixed-20241007-183820.yaml deleted file mode 100644 index f756e6f90..000000000 --- a/.changes/unreleased/Fixed-20241007-183820.yaml +++ /dev/null @@ -1,5 +0,0 @@ -project: extensions/intellij -kind: Fixed -body: Off-screen rendering to solve white flash on load and lack of changing cursor - type -time: 2024-10-07T18:38:20.733658-07:00 diff --git a/.changes/unreleased/Fixed-20241108-114322.yaml b/.changes/unreleased/Fixed-20241108-114322.yaml deleted file mode 100644 index e896eac4d..000000000 --- a/.changes/unreleased/Fixed-20241108-114322.yaml +++ /dev/null @@ -1,4 +0,0 @@ -project: extensions/intellij -kind: Fixed -body: OSR-related fixes for non-Mac users -time: 2024-11-08T11:43:22.623155-08:00 diff --git a/.changes/unreleased/Fixed-20241108-114707.yaml b/.changes/unreleased/Fixed-20241108-114707.yaml deleted file mode 100644 index 95c70c844..000000000 --- a/.changes/unreleased/Fixed-20241108-114707.yaml +++ /dev/null @@ -1,4 +0,0 @@ -project: extensions/intellij -kind: Fixed -body: Fixes for inline edit in JetBrains -time: 2024-11-08T11:47:07.953304-08:00 diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index c6e087b38..4a0595a38 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -27,8 +27,7 @@ body: - **Continue version**: v0.9.4 - **IDE version**: VSCode 1.85.1 - Model: Claude Sonnet 3.5 - - config.yaml: `models: ...` - - OR config.json: `{ "models": ... }` + - Assistant configuration value: | - OS: - Continue version: @@ -38,6 +37,7 @@ body: ```yaml ``` + OR link to assistant in Continue hub: render: Markdown validations: required: false diff --git a/.github/workflows/jetbrains-release.yaml b/.github/workflows/jetbrains-release.yaml index ffc4a967f..bf2fa74a6 100644 --- a/.github/workflows/jetbrains-release.yaml +++ b/.github/workflows/jetbrains-release.yaml @@ -31,7 +31,7 @@ jobs: - id: check working-directory: . run: | - if [[ "${{ github.event.release.tag_name }}" == v0.0.*-jetbrains ]]; then + if [[ "${{ github.event.release.tag_name }}" == v1.0.*-jetbrains ]]; then echo "should_run=true" >> $GITHUB_OUTPUT else echo "should_run=false" >> $GITHUB_OUTPUT diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 46209d364..29965a305 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -20,7 +20,7 @@ jobs: - id: check working-directory: . run: | - if [[ "${{ github.event.release.tag_name }}" == v0.8.*-vscode ]]; then + if [[ "${{ github.event.release.tag_name }}" == v1.0.*-vscode ]]; then echo "should_run=true" >> $GITHUB_OUTPUT else echo "should_run=false" >> $GITHUB_OUTPUT diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 7c005de7b..258ec33e2 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -4,10 +4,12 @@ on: pull_request: branches: - main + - staging push: branches: - main + - staging jobs: install-root: diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index abf58e6e8..7408cf76f 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -20,7 +20,7 @@ jobs: - id: check working-directory: . run: | - if [[ "${{ github.event.release.tag_name }}" == v0.9.*-vscode ]]; then + if [[ "${{ github.event.release.tag_name }}" == v1.1.*-vscode ]]; then echo "should_run=true" >> $GITHUB_OUTPUT else echo "should_run=false" >> $GITHUB_OUTPUT @@ -217,8 +217,8 @@ jobs: git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - - name: Pull latest changes - run: git pull origin main + - name: Pull latest changes from release + run: git fetch origin ${{ github.ref }} && git checkout ${{ github.ref }} # 1. Download the artifacts - uses: actions/download-artifact@v4 diff --git a/.vscode/launch.json b/.vscode/launch.json index 7a5161729..294429bcb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -138,6 +138,25 @@ "env": { "NODE_OPTIONS": "--experimental-vm-modules" } + }, + { + "name": "[config-yaml] Jest Test Debugger, Current Open File", + "type": "node", + "request": "launch", + "runtimeArgs": [ + "--inspect-brk", + "${workspaceRoot}/packages/config-yaml/node_modules/jest/bin/jest.js", + "--runInBand", + "--config", + "${workspaceRoot}/packages/config-yaml/jest.config.mjs", + "${relativeFile}" + ], + "cwd": "${workspaceRoot}/packages/config-yaml", + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "env": { + "NODE_OPTIONS": "--experimental-vm-modules" + } } ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index dd446726a..397937afb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,6 +13,9 @@ "args": ["-l"] } }, + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit" + }, "editor.defaultFormatter": "esbenp.prettier-vscode", "search.exclude": { "**/package-lock.json": true, diff --git a/README.md b/README.md index 9751d618d..bdfa8533c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@
-**[Continue](https://docs.continue.dev) is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) and [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension)** +**[Continue](https://docs.continue.dev) enables to 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)**
@@ -46,7 +46,7 @@ ## Actions -[Actions](https://continue.dev/docs/actions/how-to-use-it) are shortcuts for common use cases. +[Actions](https://continue.dev/docs/actions/how-to-use-it) are shortcuts for common use cases ![actions](docs/static/img/actions.gif) diff --git a/binary/build.js b/binary/build.js index 609a4b68c..adc461396 100644 --- a/binary/build.js +++ b/binary/build.js @@ -285,7 +285,7 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) { // Informs the `continue-binary` of where to look for node_sqlite3.node // https://www.npmjs.com/package/bindings#:~:text=The%20searching%20for,file%20is%20found - // fs.writeFileSync(`${targetDir}/package.json`, ""); + fs.writeFileSync(`${targetDir}/package.json`, ""); } // Cleanup - this is needed when running locally diff --git a/binary/package-lock.json b/binary/package-lock.json index 367b0eb93..8c5ea447b 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -48,13 +48,13 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.28", + "@continuedev/config-yaml": "^1.0.50", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", "@modelcontextprotocol/sdk": "^1.5.0", "@mozilla/readability": "^0.5.0", - "@octokit/rest": "^20.0.2", + "@octokit/rest": "^20.1.1", "@typescript-eslint/eslint-plugin": "^7.8.0", "@xenova/transformers": "2.14.0", "adf-to-md": "^1.1.0", @@ -107,7 +107,7 @@ "wink-nlp-utils": "^2.1.0", "workerpool": "^9.1.3", "yaml": "^2.4.2", - "zod": "^3.23.8" + "zod": "^3.24.2" }, "devDependencies": { "@babel/preset-env": "^7.24.7", @@ -128,7 +128,7 @@ "@types/uuid": "^9.0.7", "@types/win-ca": "^3.5.4", "cross-env": "^7.0.3", - "esbuild": "0.24.0", + "esbuild": "0.17.19", "eslint": "^8", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", diff --git a/binary/package.json b/binary/package.json index e698b9d2d..426127922 100644 --- a/binary/package.json +++ b/binary/package.json @@ -23,7 +23,6 @@ "scripts": { "test": "jest", "build": "node build.js", - "quick-build": "node quick-build.js --target darwin-arm64", "build:darwin-x64": "node build.js --os darwin-x64" }, "license": "Apache-2.0", diff --git a/binary/quick-build.js b/binary/quick-build.js deleted file mode 100644 index a9a2e57d0..000000000 --- a/binary/quick-build.js +++ /dev/null @@ -1,86 +0,0 @@ -const esbuild = require("esbuild"); -const fs = require("fs"); -const path = require("path"); -const { - execCmdSync, - validateFilesPresent, - autodetectPlatformAndArch, -} = require("../scripts/util"); - -// Paths -const bin = path.join(__dirname, "bin"); -const esbuildOutputFile = "out/index.js"; -let targets = [ - "darwin-x64", - "darwin-arm64", - "linux-x64", - "linux-arm64", - "win32-x64", -]; - -for (let i = 2; i < process.argv.length; i++) { - if (process.argv[i - 1] === "--target") { - targets = [process.argv[i]]; - } -} - -// Cleanup -for (const target of targets) { - const exe = target.startsWith("win") ? ".exe" : ""; - const targetDir = path.join(bin, target); - fs.rmSync(path.join(targetDir, `continue-binary${exe}`), { force: true }); -} - -// Validate files to ensure prerequisites are available -const filesToValidate = [ - "src/index.ts", - "../core/node_modules/jsdom/lib/jsdom/living/xhr/xhr-sync-worker.js", - "../core/llm/tiktokenWorkerPool.mjs", - "../core/llm/llamaTokenizerWorkerPool.mjs", -]; -validateFilesPresent(filesToValidate); - -// Quick Build -(async () => { - console.log("[info] Building with esbuild..."); - await esbuild.build({ - entryPoints: ["src/index.ts"], - bundle: true, - outfile: esbuildOutputFile, - external: [ - "esbuild", - "./xhr-sync-worker.js", - "llamaTokenizerWorkerPool.mjs", - "tiktokenWorkerPool.mjs", - "vscode", - "./index.node", - ], - format: "cjs", - platform: "node", - sourcemap: true, - minify: true, - treeShaking: true, - loader: { ".node": "file" }, - inject: ["./importMetaUrl.js"], - define: { "import.meta.url": "importMetaUrl" }, - }); - - console.log("[info] Building binaries with pkg..."); - for (const target of targets) { - const targetDir = path.join(bin, target); - fs.mkdirSync(targetDir, { recursive: true }); - console.log(`[info] Building ${target}...`); - execCmdSync( - `npx pkg --no-bytecode --public-packages "*" --public pkgJson/${target} --out-path ${targetDir}`, - ); - } - - // Validate only continue-binary files - const pathsToVerify = targets.map((target) => { - const exe = target.startsWith("win") ? ".exe" : ""; - return path.join(bin, target, `continue-binary${exe}`); - }); - validateFilesPresent(pathsToVerify); - - console.log("[info] Quick build completed!"); -})(); diff --git a/core/autocomplete/util/AutocompleteLoggingService.ts b/core/autocomplete/util/AutocompleteLoggingService.ts index 96bf4b4bc..2e4d19844 100644 --- a/core/autocomplete/util/AutocompleteLoggingService.ts +++ b/core/autocomplete/util/AutocompleteLoggingService.ts @@ -1,4 +1,4 @@ -import { logDevData } from "../../util/devdata"; +import { DataLogger } from "../../data/log"; import { COUNT_COMPLETION_REJECTED_AFTER } from "../../util/parameters"; import { Telemetry } from "../../util/posthog"; import { getUriFileExtension } from "../../util/uri"; @@ -96,7 +96,14 @@ export class AutocompleteLoggingService { } private logAutocompleteOutcome(outcome: AutocompleteOutcome) { - logDevData("autocomplete", outcome); + void DataLogger.getInstance().logDevData({ + name: "autocomplete", + data: { + ...outcome, + useFileSuffix: true, // from outdated schema + }, + }); + const { prompt, completion, prefix, suffix, ...restOfOutcome } = outcome; void Telemetry.capture( "autocomplete", diff --git a/core/commands/index.ts b/core/commands/index.ts index f4a0084da..72719d832 100644 --- a/core/commands/index.ts +++ b/core/commands/index.ts @@ -10,7 +10,7 @@ export function slashFromCustomCommand( return { name: customCommand.name, description: customCommand.description ?? "", - run: async function* ({ input, llm, history, ide }) { + run: async function* ({ input, llm, history, ide, completionOptions }) { // Remove slash command prefix from input let userInput = input; if (userInput.startsWith(`/${customCommand.name}`)) { @@ -20,11 +20,16 @@ export function slashFromCustomCommand( } // Render prompt template - const promptUserInput = await renderTemplatedString( - customCommand.prompt, - ide.readFile.bind(ide), - { input: userInput }, - ); + let promptUserInput: string; + if (customCommand.prompt.includes("{{{ input }}}")) { + promptUserInput = await renderTemplatedString( + customCommand.prompt, + ide.readFile.bind(ide), + { input: userInput }, + ); + } else { + promptUserInput = customCommand.prompt + "\n\n" + userInput; + } const messages = [...history]; // Find the last chat message with this slash command and replace it with the user input @@ -67,6 +72,7 @@ export function slashFromCustomCommand( for await (const chunk of llm.streamChat( messages, new AbortController().signal, + completionOptions, )) { yield renderChatMessage(chunk); } diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index 659584056..b9a0f0896 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -1,11 +1,6 @@ import * as fs from "node:fs"; -import { - AssistantUnrolled, - ConfigResult, - FullSlug, -} from "@continuedev/config-yaml"; -import * as YAML from "yaml"; +import { ConfigResult, FullSlug } from "@continuedev/config-yaml"; import { ControlPlaneClient, @@ -36,7 +31,6 @@ import { ProfileDescription, ProfileLifecycleManager, } from "./ProfileLifecycleManager.js"; -import { clientRenderHelper } from "./yaml/clientRender.js"; export type { ProfileDescription }; @@ -50,7 +44,7 @@ export class ConfigHandler { private profiles: ProfileLifecycleManager[] | null = null; // null until profiles are loaded private selectedProfileId: string | null = null; private localProfileManager: ProfileLifecycleManager; - private controlPlaneClient: ControlPlaneClient; + controlPlaneClient: ControlPlaneClient; initializedPromise: Promise; @@ -99,8 +93,8 @@ export class ConfigHandler { */ getAdditionalSubmenuContextProviders(): string[] { return this.additionalContextProviders - .filter(provider => provider.description.type === "submenu") - .map(provider => provider.description.title); + .filter((provider) => provider.description.type === "submenu") + .map((provider) => provider.description.title); } private async init() { @@ -108,7 +102,7 @@ export class ConfigHandler { await this.fetchControlPlaneProfiles(); } catch (e) { // If this fails, make sure at least local profile is loaded - console.error("Failed to fetch control plane profiles: ", e); + console.error("Failed to fetch control plane profiles in init: ", e); await this.updateAvailableProfiles([this.localProfileManager]); } try { @@ -172,37 +166,26 @@ export class ConfigHandler { // Logged in const assistants = await this.controlPlaneClient.listAssistants(selectedOrgId); - const hubProfiles = await Promise.all( - assistants.map(async (assistant) => { - let renderedConfig: AssistantUnrolled | undefined = undefined; - if (assistant.configResult.config) { - renderedConfig = await clientRenderHelper( - { - ownerSlug: assistant.ownerSlug, - packageSlug: assistant.packageSlug, - }, - YAML.stringify(assistant.configResult.config), - this.ide, - this.controlPlaneClient, - ); - } - const profileLoader = new PlatformProfileLoader( - { ...assistant.configResult, config: renderedConfig }, - assistant.ownerSlug, - assistant.packageSlug, - assistant.iconUrl, - assistant.configResult.config?.version ?? "latest", - this.controlPlaneClient, - this.ide, - this.ideSettingsPromise, - this.writeLog, - this.reloadConfig.bind(this), - ); + const hubProfiles = assistants.map((assistant) => { + const profileLoader = new PlatformProfileLoader( + { + ...assistant.configResult, + config: assistant.configResult.config, + }, + assistant.ownerSlug, + assistant.packageSlug, + assistant.iconUrl, + assistant.configResult.config?.version ?? "latest", + this.controlPlaneClient, + this.ide, + this.ideSettingsPromise, + this.writeLog, + this.reloadConfig.bind(this), + ); - return new ProfileLifecycleManager(profileLoader, this.ide); - }), - ); + return new ProfileLifecycleManager(profileLoader, this.ide); + }); if (selectedOrgId === null) { // Personal @@ -223,8 +206,16 @@ export class ConfigHandler { // Otherwise, choose the first profile const previouslySelectedProfileId = await this.getPersistedSelectedProfileId(); - const selectedProfileId = - previouslySelectedProfileId ?? profiles[0].profileDescription.id ?? null; + + // Check if the previously selected profile exists in the current profiles + const profileExists = profiles.some( + (profile) => + profile.profileDescription.id === previouslySelectedProfileId, + ); + + const selectedProfileId = profileExists + ? previouslySelectedProfileId + : (profiles[0]?.profileDescription.id ?? null); // Notify listeners const profileDescriptions = profiles.map( @@ -362,8 +353,10 @@ export class ConfigHandler { Promise.resolve(sessionInfo), this.ideSettingsPromise, ); - this.fetchControlPlaneProfiles().catch((e) => { + this.fetchControlPlaneProfiles().catch(async (e) => { console.error("Failed to fetch control plane profiles: ", e); + await this.updateAvailableProfiles([this.localProfileManager]); + await this.reloadConfig(); }); } diff --git a/core/config/default.ts b/core/config/default.ts index 23e709603..8c349a13b 100644 --- a/core/config/default.ts +++ b/core/config/default.ts @@ -82,10 +82,12 @@ export const defaultConfig: SerializedContinueConfig = { models: [], contextProviders: defaultContextProvidersVsCode, slashCommands: defaultSlashCommandsVscode, + data: [], }; export const defaultConfigJetBrains: SerializedContinueConfig = { models: [], contextProviders: defaultContextProvidersJetBrains, slashCommands: defaultSlashCommandsJetBrains, + data: [], }; diff --git a/core/config/load.ts b/core/config/load.ts index c8499dc8b..1d29124d6 100644 --- a/core/config/load.ts +++ b/core/config/load.ts @@ -18,6 +18,7 @@ import { EmbeddingsProviderDescription, IContextProvider, IDE, + IdeInfo, IdeSettings, IdeType, ILLM, @@ -62,7 +63,11 @@ import { getEsbuildBinaryPath, } from "../util/paths"; -import { ConfigResult, ConfigValidationError } from "@continuedev/config-yaml"; +import { + ConfigResult, + ConfigValidationError, + ModelRole, +} from "@continuedev/config-yaml"; import { useHub } from "../control-plane/env"; import { localPathToUri } from "../util/pathToUri"; import { @@ -72,7 +77,8 @@ import { defaultSlashCommandsVscode, } from "./default"; import { getSystemPromptDotFile } from "./getSystemPromptDotFile"; -import { modifyContinueConfigWithSharedConfig } from "./sharedConfig"; +import { modifyAnyConfigWithSharedConfig } from "./sharedConfig"; +import { getModelByRole } from "./util"; import { validateConfig } from "./validation.js"; export function resolveSerializedConfig( @@ -238,6 +244,7 @@ async function intermediateToFinalConfig( config: Config, ide: IDE, ideSettings: IdeSettings, + ideInfo: IdeInfo, uniqueId: string, writeLog: (log: string) => Promise, workOsAccessToken: string | undefined, @@ -326,7 +333,7 @@ async function intermediateToFinalConfig( ...model.requestOptions, ...config.requestOptions, }; - model.roles = model.roles ?? ["chat"]; // Default to chat role if not specified + model.roles = model.roles ?? ["chat", "apply", "edit", "summarize"]; // Default to chat role if not specified } if (allowFreeTrial) { @@ -436,23 +443,28 @@ async function intermediateToFinalConfig( } // Embeddings Provider - const embeddingsProviderDescription = config.embeddingsProvider as - | EmbeddingsProviderDescription - | undefined; - if (embeddingsProviderDescription?.provider) { - const { provider, ...options } = embeddingsProviderDescription; + function getEmbeddingsILLM( + embedConfig: EmbeddingsProviderDescription | ILLM | undefined, + ): ILLM | null { + if (!embedConfig) { + return null; + } + if ("providerName" in embedConfig) { + return embedConfig; + } + const { provider, ...options } = embedConfig; const embeddingsProviderClass = allEmbeddingsProviders[provider]; if (embeddingsProviderClass) { if ( embeddingsProviderClass.name === "_TransformersJsEmbeddingsProvider" ) { - config.embeddingsProvider = new embeddingsProviderClass(); + return new embeddingsProviderClass(); } else { const llmOptions: LLMOptions = { model: options.model ?? "UNSPECIFIED", ...options, }; - config.embeddingsProvider = new embeddingsProviderClass( + return new embeddingsProviderClass( llmOptions, (url: string | URL, init: any) => fetchwithRequestOptions(url, init, { @@ -461,42 +473,74 @@ async function intermediateToFinalConfig( }), ); } + } else { + errors.push({ + fatal: false, + message: `Embeddings provider ${provider} not found. Using default`, + }); } + return null; } - - if (!config.embeddingsProvider) { - config.embeddingsProvider = new TransformersJsEmbeddingsProvider(); - } + const newEmbedder = getEmbeddingsILLM(config.embeddingsProvider); // Reranker - if (config.reranker && !(config.reranker as ILLM | undefined)?.rerank) { + function getRerankingILLM( + rerankingConfig: ILLM | RerankerDescription | undefined, + ): ILLM | null { + if (!rerankingConfig) { + return null; + } + if ("providerName" in rerankingConfig) { + return rerankingConfig; + } const { name, params } = config.reranker as RerankerDescription; const rerankerClass = AllRerankers[name]; if (name === "llm") { const llm = models.find((model) => model.title === params?.modelTitle); if (!llm) { - console.warn(`Unknown model ${params?.modelTitle}`); + errors.push({ + fatal: false, + message: `Unknown reranking model ${params?.modelTitle}`, + }); + return null; } else { - config.reranker = new LLMReranker(llm); + return new LLMReranker(llm); } } else if (rerankerClass) { const llmOptions: LLMOptions = { model: "rerank-2", ...params, }; - config.reranker = new rerankerClass(llmOptions); + return new rerankerClass(llmOptions); } + return null; } + const newReranker = getRerankingILLM(config.reranker); - let continueConfig: ContinueConfig = { + const continueConfig: ContinueConfig = { ...config, contextProviders, models, - embeddingsProvider: config.embeddingsProvider as any, - tabAutocompleteModels, - reranker: config.reranker as any, tools: allTools, + modelsByRole: { + chat: models, + edit: models, + apply: models, + summarize: models, + autocomplete: [...tabAutocompleteModels], + embed: newEmbedder ? [newEmbedder] : [], + rerank: newReranker ? [newReranker] : [], + }, + selectedModelByRole: { + chat: null, // Not implemented (uses GUI defaultModel) + edit: null, + apply: null, + embed: newEmbedder ?? null, + autocomplete: null, + rerank: newReranker ?? null, + summarize: null, // Not implemented + }, }; // Apply MCP if specified @@ -538,48 +582,112 @@ async function intermediateToFinalConfig( ); } + // Handle experimental modelRole config values for apply and edit + const inlineEditModel = getModelByRole(continueConfig, "inlineEdit")?.title; + if (inlineEditModel) { + const match = continueConfig.models.find( + (m) => m.title === inlineEditModel, + ); + if (match) { + continueConfig.selectedModelByRole.edit = match; + continueConfig.modelsByRole.edit = [match]; // The only option if inlineEdit role is set + } else { + errors.push({ + fatal: false, + message: `experimental.modelRoles.inlineEdit model title ${inlineEditModel} not found in models array`, + }); + } + } + + const applyBlockModel = getModelByRole( + continueConfig, + "applyCodeBlock", + )?.title; + if (applyBlockModel) { + const match = continueConfig.models.find( + (m) => m.title === applyBlockModel, + ); + if (match) { + continueConfig.selectedModelByRole.apply = match; + continueConfig.modelsByRole.apply = [match]; // The only option if applyCodeBlock role is set + } else { + errors.push({ + fatal: false, + message: `experimental.modelRoles.applyCodeBlock model title ${inlineEditModel} not found in models array`, + }); + } + } + + // Add transformers JS to the embed models list if not already added + if ( + ideInfo.ideType === "vscode" && + !continueConfig.modelsByRole.embed.find( + (m) => m.providerName === "transformers.js", + ) + ) { + continueConfig.modelsByRole.embed.push( + new TransformersJsEmbeddingsProvider(), + ); + } + return { config: continueConfig, errors }; } +function llmToSerializedModelDescription(llm: ILLM): ModelDescription { + return { + provider: llm.providerName, + model: llm.model, + title: llm.title ?? llm.model, + apiKey: llm.apiKey, + apiBase: llm.apiBase, + contextLength: llm.contextLength, + template: llm.template, + completionOptions: llm.completionOptions, + systemMessage: llm.systemMessage, + requestOptions: llm.requestOptions, + promptTemplates: llm.promptTemplates as any, + capabilities: llm.capabilities, + roles: llm.roles, + }; +} + async function finalToBrowserConfig( final: ContinueConfig, ide: IDE, ): Promise { return { allowAnonymousTelemetry: final.allowAnonymousTelemetry, - models: final.models.map((m) => ({ - provider: m.providerName, - model: m.model, - title: m.title ?? m.model, - apiKey: m.apiKey, - apiBase: m.apiBase, - contextLength: m.contextLength, - template: m.template, - completionOptions: m.completionOptions, - systemMessage: m.systemMessage, - requestOptions: m.requestOptions, - promptTemplates: m.promptTemplates as any, - capabilities: m.capabilities, - roles: m.roles, - })), + models: final.models.map(llmToSerializedModelDescription), systemMessage: final.systemMessage, completionOptions: final.completionOptions, slashCommands: final.slashCommands?.map((s) => ({ name: s.name, description: s.description, - params: s.params, //PZTODO: is this why params aren't referenced properly by slash commands? + params: s.params, // TODO: is this why params aren't referenced properly by slash commands? })), contextProviders: final.contextProviders?.map((c) => c.description), disableIndexing: final.disableIndexing, disableSessionTitles: final.disableSessionTitles, userToken: final.userToken, - embeddingsProvider: final.embeddingsProvider?.embeddingId, ui: final.ui, experimental: final.experimental, docs: final.docs, tools: final.tools, tabAutocompleteOptions: final.tabAutocompleteOptions, usePlatform: await useHub(ide.getIdeSettings()), + modelsByRole: Object.fromEntries( + Object.entries(final.modelsByRole).map(([k, v]) => [ + k, + v.map(llmToSerializedModelDescription), + ]), + ) as Record, // TODO better types here + selectedModelByRole: Object.fromEntries( + Object.entries(final.selectedModelByRole).map(([k, v]) => [ + k, + v ? llmToSerializedModelDescription(v) : null, + ]), + ) as Record, // TODO better types here + // data not included here because client doesn't need }; } @@ -767,7 +875,7 @@ async function loadContinueConfigFromJson( ide: IDE, workspaceConfigs: ContinueRcJson[], ideSettings: IdeSettings, - ideType: IdeType, + ideInfo: IdeInfo, uniqueId: string, writeLog: (log: string) => Promise, workOsAccessToken: string | undefined, @@ -781,7 +889,7 @@ async function loadContinueConfigFromJson( } = loadSerializedConfig( workspaceConfigs, ideSettings, - ideType, + ideInfo.ideType, overrideConfigJson, ide, ); @@ -798,16 +906,16 @@ async function loadContinueConfigFromJson( // Apply shared config // TODO: override several of these values with user/org shared config const sharedConfig = new GlobalContext().getSharedConfig(); - const withShared = modifyContinueConfigWithSharedConfig( - serialized, - sharedConfig, - ); + const withShared = modifyAnyConfigWithSharedConfig(serialized, sharedConfig); // Convert serialized to intermediate config let intermediate = await serializedToIntermediateConfig(withShared, ide); // Apply config.ts to modify intermediate config - const configJsContents = await buildConfigTsandReadConfigJs(ide, ideType); + const configJsContents = await buildConfigTsandReadConfigJs( + ide, + ideInfo.ideType, + ); if (configJsContents) { try { // Try config.ts first @@ -867,6 +975,7 @@ async function loadContinueConfigFromJson( intermediate, ide, ideSettings, + ideInfo, uniqueId, writeLog, workOsAccessToken, diff --git a/core/config/profile/LocalProfileLoader.ts b/core/config/profile/LocalProfileLoader.ts index 3196faff4..9ccf5c812 100644 --- a/core/config/profile/LocalProfileLoader.ts +++ b/core/config/profile/LocalProfileLoader.ts @@ -38,6 +38,7 @@ export default class LocalProfileLoader implements IProfileLoader { undefined, undefined, undefined, + this.description.id, ); this.description.errors = result.errors; diff --git a/core/config/profile/PlatformProfileLoader.ts b/core/config/profile/PlatformProfileLoader.ts index 04f1d3acf..c0fa4c5cc 100644 --- a/core/config/profile/PlatformProfileLoader.ts +++ b/core/config/profile/PlatformProfileLoader.ts @@ -1,7 +1,8 @@ -import { ConfigResult, AssistantUnrolled } from "@continuedev/config-yaml"; +import { AssistantUnrolled, ConfigResult } from "@continuedev/config-yaml"; import { ControlPlaneClient } from "../../control-plane/client.js"; import { ContinueConfig, IDE, IdeSettings } from "../../index.js"; + import { ProfileDescription } from "../ProfileLifecycleManager.js"; import doLoadConfig from "./doLoadConfig.js"; @@ -42,7 +43,7 @@ export default class PlatformProfileLoader implements IProfileLoader { packageSlug, versionSlug, }, - title: `${ownerSlug}/${packageSlug}@${versionSlug}`, + title: configResult.config?.name ?? `${ownerSlug}/${packageSlug}`, errors: configResult.errors, iconUrl: this.iconUrl, }; @@ -68,6 +69,7 @@ export default class PlatformProfileLoader implements IProfileLoader { ownerSlug: this.ownerSlug, packageSlug: this.packageSlug, }, + this.description.id, ); return { diff --git a/core/config/profile/doLoadConfig.ts b/core/config/profile/doLoadConfig.ts index af8c59c97..0ec9b4137 100644 --- a/core/config/profile/doLoadConfig.ts +++ b/core/config/profile/doLoadConfig.ts @@ -4,6 +4,7 @@ import { AssistantUnrolled, ConfigResult, ConfigValidationError, + ModelRole, } from "@continuedev/config-yaml"; import { ContinueConfig, @@ -24,6 +25,7 @@ import { loadContinueConfigFromJson } from "../load"; import { migrateJsonSharedConfig } from "../migrateSharedConfig"; import { loadContinueConfigFromYaml } from "../yaml/loadYaml"; import { PlatformConfigMetadata } from "./PlatformProfileLoader"; +import { rectifySelectedModelsFromGlobalContext } from "../selectedModels"; export default async function doLoadConfig( ide: IDE, @@ -33,7 +35,7 @@ export default async function doLoadConfig( overrideConfigJson: SerializedContinueConfig | undefined, overrideConfigYaml: AssistantUnrolled | undefined, platformConfigMetadata: PlatformConfigMetadata | undefined, - workspaceId?: string, + profileId: string, ): Promise> { const workspaceConfigs = await getWorkspaceConfigs(ide); const ideInfo = await ide.getIdeInfo(); @@ -59,7 +61,7 @@ export default async function doLoadConfig( ide, workspaceConfigs.map((c) => JSON.stringify(c)), ideSettings, - ideInfo.ideType, + ideInfo, uniqueId, writeLog, workOsAccessToken, @@ -75,7 +77,7 @@ export default async function doLoadConfig( ide, workspaceConfigs, ideSettings, - ideInfo.ideType, + ideInfo, uniqueId, writeLog, workOsAccessToken, @@ -86,6 +88,11 @@ export default async function doLoadConfig( configLoadInterrupted = result.configLoadInterrupted; } + // Rectify model selections for each role + if (newConfig) { + newConfig = rectifySelectedModelsFromGlobalContext(newConfig, profileId); + } + if (configLoadInterrupted || !newConfig) { return { errors, config: newConfig, configLoadInterrupted: true }; } @@ -117,7 +124,7 @@ export default async function doLoadConfig( controlPlaneProxyUrl += "/"; } const controlPlaneProxyInfo = { - workspaceId, + profileId, controlPlaneProxyUrl, workOsAccessToken, }; @@ -147,21 +154,26 @@ async function injectControlPlaneProxyInfo( config: ContinueConfig, info: ControlPlaneProxyInfo, ): Promise { - [...config.models, ...(config.tabAutocompleteModels ?? [])].forEach( - async (model) => { + Object.keys(config.modelsByRole).forEach((key) => { + config.modelsByRole[key as ModelRole].forEach((model) => { if (model.providerName === "continue-proxy") { (model as ContinueProxy).controlPlaneProxyInfo = info; } - }, - ); + }); + }); - if (config.embeddingsProvider?.providerName === "continue-proxy") { - (config.embeddingsProvider as ContinueProxy).controlPlaneProxyInfo = info; - } + Object.keys(config.selectedModelByRole).forEach((key) => { + const model = config.selectedModelByRole[key as ModelRole]; + if (model?.providerName === "continue-proxy") { + (model as ContinueProxy).controlPlaneProxyInfo = info; + } + }); - if (config.reranker?.providerName === "continue-proxy") { - (config.reranker as ContinueProxy).controlPlaneProxyInfo = info; - } + config.models.forEach((model) => { + if (model.providerName === "continue-proxy") { + (model as ContinueProxy).controlPlaneProxyInfo = info; + } + }); return config; } diff --git a/core/config/selectedModels.ts b/core/config/selectedModels.ts new file mode 100644 index 000000000..dd537665d --- /dev/null +++ b/core/config/selectedModels.ts @@ -0,0 +1,67 @@ +import { ModelRole } from "@continuedev/config-yaml"; + +import { ContinueConfig, ILLM } from ".."; +import { + GlobalContext, + GlobalContextModelSelections, +} from "../util/GlobalContext"; + +export function rectifySelectedModelsFromGlobalContext( + continueConfig: ContinueConfig, + profileId: string, +): ContinueConfig { + const configCopy = { ...continueConfig }; + + const globalContext = new GlobalContext(); + const currentSelectedModels = globalContext.get("selectedModelsByProfileId"); + const currentForProfile: GlobalContextModelSelections = + currentSelectedModels?.[profileId] ?? {}; + + let fellBack = false; + + // chat and summarize not implemented yet + // default chat model is stored in GUI still + + const roles: ModelRole[] = [ + "autocomplete", + "apply", + "edit", + "embed", + "rerank", + ]; + for (const role of roles) { + let newModel: ILLM | null = null; + const currentSelection = currentForProfile[role] ?? null; + if (currentSelection) { + const match = continueConfig.modelsByRole[role].find( + (m) => m.title === currentSelection, + ); + if (match) { + newModel = match; + } + } + if (!newModel && continueConfig.modelsByRole[role].length > 0) { + newModel = continueConfig.modelsByRole[role][0]; + } + if (!(currentSelection === (newModel?.title ?? null))) { + fellBack = true; + } + configCopy.selectedModelByRole[role] = newModel; + } + + // In the case shared config wasn't respected, + // Rewrite the shared config + if (fellBack) { + globalContext.update("selectedModelsByProfileId", { + ...currentSelectedModels, + [profileId]: Object.fromEntries( + Object.entries(configCopy.selectedModelByRole).map(([key, value]) => [ + key, + value?.title ?? null, + ]), + ), + }); + } + + return configCopy; +} diff --git a/core/config/sharedConfig.ts b/core/config/sharedConfig.ts index 9f2335243..cfee4d047 100644 --- a/core/config/sharedConfig.ts +++ b/core/config/sharedConfig.ts @@ -1,13 +1,15 @@ import z from "zod"; + import { BrowserSerializedContinueConfig, - ContinueConfig, Config, + ContinueConfig, SerializedContinueConfig, } from ".."; export const sharedConfigSchema = z .object({ + // boolean fields in config.json allowAnonymousTelemetry: z.boolean(), disableIndexing: z.boolean(), disableSessionTitles: z.boolean(), @@ -65,7 +67,19 @@ export function salvageSharedConfig(sharedConfig: object): SharedConfigSchema { return salvagedConfig; } -export function modifyContinueConfigWithSharedConfig< +// Apply shared config to all forms of config +// - SerializedContinueConfig (config.json) +// - Config ("intermediate") - passed to config.ts +// - ContinueConfig +// - BrowserSerializedContinueConfig (final converted to be passed to GUI) + +// This modify function is split into two steps +// - rectifySharedModelsFromSharedConfig - includes boolean flags like allowAnonymousTelemetry which +// must be added BEFORE config.ts and remote server config apply for JSON +// for security reasons +// - setSharedModelsFromSharedConfig - exists because of selectedModelsByRole +// Which don't exist on SerializedContinueConfig/Config types, so must be added after the fact +export function modifyAnyConfigWithSharedConfig< T extends | ContinueConfig | BrowserSerializedContinueConfig @@ -92,6 +106,7 @@ export function modifyContinueConfigWithSharedConfig< configCopy.ui = { ...configCopy.ui, }; + if (sharedConfig.codeBlockToolbarPosition !== undefined) { configCopy.ui.codeBlockToolbarPosition = sharedConfig.codeBlockToolbarPosition; @@ -135,28 +150,3 @@ export function modifyContinueConfigWithSharedConfig< return configCopy; } - -// continueConfig.tabAutocompleteOptions = { -// ...continueConfig.tabAutocompleteOptions, -// useCache: sharedConfig.useAutocompleteCache, -// disableInFiles: sharedConfig.disableAutocompleteInFiles, -// multilineCompletions: sharedConfig.useAutocompleteMultilineCompletions, -// }; -// continueConfig.ui = { -// ...continueConfig.ui, -// codeBlockToolbarPosition: sharedConfig.codeBlockToolbarPosition, -// fontSize: sharedConfig.fontSize, -// codeWrap: sharedConfig.codeWrap, -// displayRawMarkdown: sharedConfig.displayRawMarkdown, -// showChatScrollbar: sharedConfig.showChatScrollbar, -// }; -// continueConfig.allowAnonymousTelemetry = sharedConfig.allowAnonymousTelemetry; -// continueConfig.disableIndexing = sharedConfig.disableIndexing; -// continueConfig.disableIndexing = sharedConfig.disableIndexing; -// continueConfig.disableSessionTitles = sharedConfig.disableSessionTitles; -// continueConfig.experimental = { -// ...continueConfig.experimental, -// useChromiumForDocsCrawling: sharedConfig.useChromiumForDocsCrawling, -// readResponseTTS: sharedConfig.readResponseTTS, -// promptPath: sharedConfig.promptPath, -// }; diff --git a/core/config/yaml/clientRender.ts b/core/config/yaml/clientRender.ts deleted file mode 100644 index 14f7e718f..000000000 --- a/core/config/yaml/clientRender.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { - clientRender, - PackageSlug, - PlatformClient, - SecretStore, -} from "@continuedev/config-yaml"; - -import { IDE } from "../.."; -import { ControlPlaneClient } from "../../control-plane/client"; - -export async function clientRenderHelper( - packageSlug: PackageSlug, - unrolledAssistant: string, - ide: IDE, - controlPlaneClient: ControlPlaneClient, -) { - const ideSecretStore: SecretStore = { - get: async function (secretName: string): Promise { - const results = await ide.readSecrets([secretName]); - return results[secretName]; - }, - set: async function ( - secretName: string, - secretValue: string, - ): Promise { - return await ide.writeSecrets({ - [secretName]: secretValue, - }); - }, - }; - - const platformClient: PlatformClient = { - resolveFQSNs: controlPlaneClient.resolveFQSNs.bind(controlPlaneClient), - }; - - const userId = await controlPlaneClient.userId; - return await clientRender( - packageSlug, - unrolledAssistant, - ideSecretStore, - userId ? platformClient : undefined, - ); -} diff --git a/core/config/yaml/convertFromJson.ts b/core/config/yaml/convertFromJson.ts index a989d2631..fdf73606f 100644 --- a/core/config/yaml/convertFromJson.ts +++ b/core/config/yaml/convertFromJson.ts @@ -15,10 +15,11 @@ export function convertConfigJsonToConfigYaml( name: model.title, // defaultCompletionOptions: model.completionOptions, provider: model.provider, - roles: ["chat"], + roles: ["chat", "edit", "apply", "summarize"], }), ), - // ... tabAutocompleteModels + // TODO + // tabAutocompleteModels // embeddingsModels // rerankModels ], diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 37abaf83e..bf0515253 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -14,8 +14,8 @@ import { ContinueConfig, IContextProvider, IDE, + IdeInfo, IdeSettings, - IdeType, SlashCommand, } from "../.."; import { slashFromCustomCommand } from "../../commands"; @@ -37,7 +37,7 @@ import { GlobalContext } from "../../util/GlobalContext"; import { getConfigYamlPath } from "../../util/paths"; import { getSystemPromptDotFile } from "../getSystemPromptDotFile"; import { PlatformConfigMetadata } from "../profile/PlatformProfileLoader"; -import { modifyContinueConfigWithSharedConfig } from "../sharedConfig"; +import { modifyAnyConfigWithSharedConfig } from "../sharedConfig"; import { llmsFromModelConfig } from "./models"; @@ -48,7 +48,7 @@ async function loadConfigYaml( ide: IDE, controlPlaneClient: ControlPlaneClient, ): Promise> { - const ideSettings = await ide.getIdeSettings(); + // const ideSettings = await ide.getIdeSettings(); let config = overrideConfigYaml ?? // (ideSettings.continueTestEnvironment === "production" @@ -98,6 +98,7 @@ async function configYamlToContinueConfig( config: AssistantUnrolled, ide: IDE, ideSettings: IdeSettings, + ideInfo: IdeInfo, uniqueId: string, writeLog: (log: string) => Promise, workOsAccessToken: string | undefined, @@ -111,10 +112,8 @@ async function configYamlToContinueConfig( ...(config.prompts?.map(slashFromCustomCommand) ?? []), ], models: [], - tabAutocompleteModels: [], tools: allTools, systemMessage: config.rules?.join("\n"), - embeddingsProvider: new TransformersJsEmbeddingsProvider(), experimental: { modelContextProtocolServers: config.mcpServers?.map((mcpServer) => ({ transport: { @@ -132,59 +131,125 @@ async function configYamlToContinueConfig( faviconUrl: doc.faviconUrl, })), contextProviders: [], + modelsByRole: { + chat: [], + edit: [], + apply: [], + embed: [], + autocomplete: [], + rerank: [], + summarize: [], + }, + selectedModelByRole: { + chat: null, // not currently used - defaultModel on GUI is used + edit: null, // not currently used + apply: null, + embed: null, + autocomplete: null, + rerank: null, + summarize: null, + }, + data: config.data, }; // Models const modelsArrayRoles: ModelRole[] = ["chat", "summarize", "apply", "edit"]; for (const model of config.models ?? []) { - model.roles = model.roles ?? ["chat"]; // Default to chat role if not specified + model.roles = model.roles ?? modelsArrayRoles; // Default to all 4 chat-esque roles if not specified + const llms = await llmsFromModelConfig( + model, + ide, + uniqueId, + ideSettings, + writeLog, + platformConfigMetadata, + continueConfig.systemMessage, + ); + + // if (modelsArrayRoles.some((role) => model.roles?.includes(role))) { - // Main model array - const llms = await llmsFromModelConfig( - model, - ide, - uniqueId, - ideSettings, - writeLog, - platformConfigMetadata, - continueConfig.systemMessage, - ); continueConfig.models.push(...llms); } + if (model.roles?.includes("chat")) { + continueConfig.modelsByRole.chat.push(...llms); + } + + if (model.roles?.includes("summarize")) { + continueConfig.modelsByRole.summarize.push(...llms); + } + + if (model.roles?.includes("apply")) { + continueConfig.modelsByRole.apply.push(...llms); + } + + if (model.roles?.includes("edit")) { + continueConfig.modelsByRole.edit.push(...llms); + } + if (model.roles?.includes("autocomplete")) { - // Autocomplete models array - const llms = await llmsFromModelConfig( - model, - ide, - uniqueId, - ideSettings, - writeLog, - platformConfigMetadata, - continueConfig.systemMessage, - ); - continueConfig.tabAutocompleteModels?.push(...llms); + continueConfig.modelsByRole.autocomplete.push(...llms); } - if ( - model.roles?.includes("apply") && - !continueConfig.experimental?.modelRoles?.applyCodeBlock - ) { - continueConfig.experimental ??= {}; - continueConfig.experimental!.modelRoles ??= {}; - continueConfig.experimental!.modelRoles!.applyCodeBlock = model.name; + if (model.roles?.includes("embed")) { + const { provider, ...options } = model; + const embeddingsProviderClass = allEmbeddingsProviders[provider]; + if (embeddingsProviderClass) { + if ( + embeddingsProviderClass.name === "_TransformersJsEmbeddingsProvider" + ) { + continueConfig.modelsByRole.embed.push(new embeddingsProviderClass()); + } else { + continueConfig.modelsByRole.embed.push( + new embeddingsProviderClass( + options, + (url: string | URL, init: any) => + fetchwithRequestOptions(url, init, { + ...options.requestOptions, + }), + ), + ); + } + } else { + errors.push({ + fatal: false, + message: `Unsupported embeddings model provider found: ${provider}`, + }); + } } - if ( - model.roles?.includes("edit") && - !continueConfig.experimental?.modelRoles?.inlineEdit - ) { - continueConfig.experimental ??= {}; - continueConfig.experimental!.modelRoles ??= {}; - continueConfig.experimental!.modelRoles!.inlineEdit = model.name; + if (model.roles?.includes("rerank")) { + const { provider, ...options } = model; + const rerankerClass = AllRerankers[provider]; + if (rerankerClass) { + continueConfig.modelsByRole.rerank.push( + new rerankerClass(options, (url: string | URL, init: any) => + fetchwithRequestOptions(url, init, { + ...options.requestOptions, + }), + ), + ); + } else { + errors.push({ + fatal: false, + message: `Unsupported reranking model provider found: ${provider}`, + }); + } } } + // Add transformers js to the embed models in vs code if not already added + if ( + ideInfo.ideType === "vscode" && + !continueConfig.modelsByRole.embed.find( + (m) => m.providerName === "transformers.js", + ) + ) { + continueConfig.modelsByRole.embed.push( + new TransformersJsEmbeddingsProvider(), + ); + } + if (allowFreeTrial) { // Obtain auth token (iff free trial being used) const freeTrialModels = continueConfig.models.filter( @@ -203,8 +268,6 @@ async function configYamlToContinueConfig( ); } - // TODO: Split into model roles. - // Context providers const codebaseContextParams: IContextProvider[] = (config.context || []).find((cp) => cp.provider === "codebase")?.params || @@ -243,51 +306,6 @@ async function configYamlToContinueConfig( continueConfig.contextProviders.push(new DocsContextProvider({})); } - // Embeddings Provider - // IMPORTANT this currently will grab the first model found with an embed role - const embedConfig = config.models?.find((model) => - model.roles?.includes("embed"), - ); - if (embedConfig) { - const { provider, ...options } = embedConfig; - const embeddingsProviderClass = allEmbeddingsProviders[provider]; - if (embeddingsProviderClass) { - if ( - embeddingsProviderClass.name === "_TransformersJsEmbeddingsProvider" - ) { - continueConfig.embeddingsProvider = new embeddingsProviderClass(); - } else { - continueConfig.embeddingsProvider = new embeddingsProviderClass( - options, - (url: string | URL, init: any) => - fetchwithRequestOptions(url, init, { - ...options.requestOptions, - }), - ); - } - } - } - - // Reranker - // IMPORTANT this currently will grab the first model found with a rerank role - const rerankConfig = config.models?.find((model) => - model.roles?.includes("rerank"), - ); - if (rerankConfig) { - const { provider, ...options } = rerankConfig; - const rerankerClass = AllRerankers[provider]; - - if (rerankerClass) { - continueConfig.reranker = new rerankerClass( - options, - (url: string | URL, init: any) => - fetchwithRequestOptions(url, init, { - ...options.requestOptions, - }), - ); - } - } - // Apply MCP if specified const mcpManager = MCPManagerSingleton.getInstance(); await Promise.all( @@ -341,7 +359,7 @@ export async function loadContinueConfigFromYaml( ide: IDE, workspaceConfigs: string[], ideSettings: IdeSettings, - ideType: IdeType, + ideInfo: IdeInfo, uniqueId: string, writeLog: (log: string) => Promise, workOsAccessToken: string | undefined, @@ -351,7 +369,7 @@ export async function loadContinueConfigFromYaml( ): Promise> { const rawYaml = overrideConfigYaml === undefined - ? fs.readFileSync(getConfigYamlPath(ideType), "utf-8") + ? fs.readFileSync(getConfigYamlPath(ideInfo.ideType), "utf-8") : ""; const configYamlResult = await loadConfigYaml( @@ -374,6 +392,7 @@ export async function loadContinueConfigFromYaml( configYamlResult.config, ide, ideSettings, + ideInfo, uniqueId, writeLog, workOsAccessToken, @@ -392,7 +411,7 @@ export async function loadContinueConfigFromYaml( // Apply shared config // TODO: override several of these values with user/org shared config const sharedConfig = new GlobalContext().getSharedConfig(); - const withShared = modifyContinueConfigWithSharedConfig( + const withShared = modifyAnyConfigWithSharedConfig( continueConfig, sharedConfig, ); diff --git a/core/config/yaml/models.ts b/core/config/yaml/models.ts index e6d0ef00a..c6916b010 100644 --- a/core/config/yaml/models.ts +++ b/core/config/yaml/models.ts @@ -51,6 +51,55 @@ async function modelConfigToBaseLLM( promptTemplates: model.promptTemplates, }; + if (model.embedOptions?.maxBatchSize) { + options.maxEmbeddingBatchSize = model.embedOptions.maxBatchSize; + } + if (model.embedOptions?.maxChunkSize) { + options.maxEmbeddingChunkSize = model.embedOptions.maxChunkSize; + } + + // These are params that are at model config level in JSON + // But we decided to move to nested `env` in YAML + // Since types vary and we don't want to blindly spread env for now, + // Each one is handled individually here + const env = model.env ?? {}; + if ( + "useLegacyCompletionsEndpoint" in env && + typeof env.useLegacyCompletionsEndpoint === "boolean" + ) { + options.useLegacyCompletionsEndpoint = env.useLegacyCompletionsEndpoint; + } + if ("apiType" in env && typeof env.apiType === "string") { + options.apiType = env.apiType; + } + if ("apiVersion" in env && typeof env.apiVersion === "string") { + options.apiVersion = env.apiVersion; + } + if ("deployment" in env && typeof env.deployment === "string") { + options.deployment = env.deployment; + } + if ("deploymentId" in env && typeof env.deploymentId === "string") { + options.deploymentId = env.deploymentId; + } + if ("projectId" in env && typeof env.projectId === "string") { + options.projectId = env.projectId; + } + if ("region" in env && typeof env.region === "string") { + options.region = env.region; + } + if ("profile" in env && typeof env.profile === "string") { + options.profile = env.profile; + } + if ("modelArn" in env && typeof env.modelArn === "string") { + options.modelArn = env.modelArn; + } + if ("aiGatewaySlug" in env && typeof env.aiGatewaySlug === "string") { + options.aiGatewaySlug = env.aiGatewaySlug; + } + if ("accountId" in env && typeof env.accountId === "string") { + options.accountId = env.accountId; + } + const llm = new cls(options); return llm; } diff --git a/core/context/providers/DocsContextProvider.ts b/core/context/providers/DocsContextProvider.ts index cb8e926d5..f4b816f33 100644 --- a/core/context/providers/DocsContextProvider.ts +++ b/core/context/providers/DocsContextProvider.ts @@ -23,7 +23,7 @@ class DocsContextProvider extends BaseContextProvider { // Todo: consider a different renderInline so that when multiple docs are referenced in one message, // Or the doc has an odd name unrelated to the content // The name of the doc itself doesn't skew the embedding results - // renderInlineAs: "", + renderInlineAs: "", }; constructor(options: any) { diff --git a/core/context/providers/_context-providers.test.ts b/core/context/providers/_context-providers.test.ts index e877c10e7..345d21e37 100644 --- a/core/context/providers/_context-providers.test.ts +++ b/core/context/providers/_context-providers.test.ts @@ -42,10 +42,10 @@ async function getContextProviderExtras( fullInput, ide, config, - embeddingsProvider: config.embeddingsProvider, + embeddingsProvider: config.selectedModelByRole.embed, fetch: fetch, llm: config.models[0], - reranker: config.reranker, + reranker: config.selectedModelByRole.rerank, selectedCode: [], }; } diff --git a/core/context/retrieval/pipelines/BaseRetrievalPipeline.ts b/core/context/retrieval/pipelines/BaseRetrievalPipeline.ts index 0ba94964c..e341c681c 100644 --- a/core/context/retrieval/pipelines/BaseRetrievalPipeline.ts +++ b/core/context/retrieval/pipelines/BaseRetrievalPipeline.ts @@ -7,6 +7,8 @@ import { FullTextSearchCodebaseIndex } from "../../../indexing/FullTextSearchCod import { LanceDbIndex } from "../../../indexing/LanceDbIndex"; import { recentlyEditedFilesCache } from "../recentlyEditedFilesCache"; +const DEFAULT_CHUNK_SIZE = 384; + export interface RetrievalPipelineOptions { llm: ILLM; config: ContinueConfig; @@ -16,13 +18,13 @@ export interface RetrievalPipelineOptions { nFinal: number; tags: BranchAndDir[]; filterDirectory?: string; - includeEmbeddings?: boolean; // Used to handle JB w/o an embeddings model } export interface RetrievalPipelineRunArguments { query: string; tags: BranchAndDir[]; filterDirectory?: string; + includeEmbeddings: boolean; } export interface IRetrievalPipeline { @@ -35,7 +37,7 @@ export default class BaseRetrievalPipeline implements IRetrievalPipeline { constructor(protected readonly options: RetrievalPipelineOptions) { this.lanceDbIndex = new LanceDbIndex( - options.config.embeddingsProvider, + options.config.selectedModelByRole.embed, (uri) => options.ide.readFile(uri), ); } @@ -109,7 +111,7 @@ export default class BaseRetrievalPipeline implements IRetrievalPipeline { filepath, contents, maxChunkSize: - this.options.config.embeddingsProvider.maxEmbeddingChunkSize, + this.options.config.selectedModelByRole.embed?.maxEmbeddingChunkSize ?? DEFAULT_CHUNK_SIZE, digest: filepath, }); diff --git a/core/context/retrieval/pipelines/NoRerankerRetrievalPipeline.ts b/core/context/retrieval/pipelines/NoRerankerRetrievalPipeline.ts index af72c0639..889005414 100644 --- a/core/context/retrieval/pipelines/NoRerankerRetrievalPipeline.ts +++ b/core/context/retrieval/pipelines/NoRerankerRetrievalPipeline.ts @@ -9,7 +9,7 @@ import BaseRetrievalPipeline, { export default class NoRerankerRetrievalPipeline extends BaseRetrievalPipeline { async run(args: RetrievalPipelineRunArguments): Promise { - const { input, nFinal, filterDirectory, includeEmbeddings } = this.options; + const { input, nFinal, filterDirectory, config } = this.options; // We give 1/4 weight to recently edited files, 1/4 to full text search, // and the remaining 1/2 to embeddings @@ -21,7 +21,7 @@ export default class NoRerankerRetrievalPipeline extends BaseRetrievalPipeline { const ftsChunks = await this.retrieveFts(args, ftsNFinal); - const embeddingsChunks = includeEmbeddings + const embeddingsChunks = !!config.selectedModelByRole.embed ? await this.retrieveEmbeddings(input, embeddingsNFinal) : []; diff --git a/core/context/retrieval/pipelines/RerankerRetrievalPipeline.ts b/core/context/retrieval/pipelines/RerankerRetrievalPipeline.ts index 7c7e69860..67f4bcd45 100644 --- a/core/context/retrieval/pipelines/RerankerRetrievalPipeline.ts +++ b/core/context/retrieval/pipelines/RerankerRetrievalPipeline.ts @@ -12,13 +12,12 @@ export default class RerankerRetrievalPipeline extends BaseRetrievalPipeline { private async _retrieveInitial( args: RetrievalPipelineRunArguments, ): Promise { - const { input, nRetrieve, filterDirectory, includeEmbeddings } = - this.options; + const { input, nRetrieve, filterDirectory, config } = this.options; let retrievalResults: Chunk[] = []; const ftsChunks = await this.retrieveFts(args, nRetrieve); - const embeddingsChunks = includeEmbeddings + const embeddingsChunks = !!config.selectedModelByRole.embed ? await this.retrieveEmbeddings(input, nRetrieve) : []; const recentlyEditedFilesChunks = @@ -53,17 +52,18 @@ export default class RerankerRetrievalPipeline extends BaseRetrievalPipeline { } private async _rerank(input: string, chunks: Chunk[]): Promise { - if (!this.options.config.reranker) { - throw new Error("No reranker provided"); + if (!this.options.config.selectedModelByRole.rerank) { + throw new Error("No reranker set up"); } // remove empty chunks -- some APIs fail on that chunks = chunks.filter((chunk) => chunk.content); - let scores: number[] = await this.options.config.reranker.rerank( - input, - chunks, - ); + let scores: number[] = + await this.options.config.selectedModelByRole.rerank.rerank( + input, + chunks, + ); // Filter out low-scoring results let results = chunks; diff --git a/core/context/retrieval/repoMapRequest.ts b/core/context/retrieval/repoMapRequest.ts index 39223321b..5637019ad 100644 --- a/core/context/retrieval/repoMapRequest.ts +++ b/core/context/retrieval/repoMapRequest.ts @@ -2,7 +2,6 @@ import { Chunk, ContinueConfig, IDE, ILLM } from "../.."; import { getModelByRole } from "../../config/util"; import generateRepoMap from "../../util/generateRepoMap"; import { renderChatMessage } from "../../util/messageContent"; -import { getUriPathBasename } from "../../util/uri"; const SUPPORTED_MODEL_TITLE_FAMILIES = [ "claude-3", @@ -16,7 +15,7 @@ function isSupportedModel( config: ContinueConfig, modelTitle?: string, ): boolean { - if (config.experimental?.modelRoles?.applyCodeBlock) { + if (config.experimental?.modelRoles?.repoMapFileSelection) { return true; } diff --git a/core/context/retrieval/retrieval.ts b/core/context/retrieval/retrieval.ts index 0f0a238eb..3b8e98427 100644 --- a/core/context/retrieval/retrieval.ts +++ b/core/context/retrieval/retrieval.ts @@ -1,5 +1,4 @@ import { BranchAndDir, ContextItem, ContextProviderExtras } from "../../"; -import TransformersJsEmbeddingsProvider from "../../llm/llms/TransformersJsEmbeddingsProvider"; import { getUriDescription } from "../../util/uri"; import { INSTRUCTIONS_BASE_ITEM } from "../providers/utils"; @@ -14,26 +13,16 @@ export async function retrieveContextItemsFromEmbeddings( options: any | undefined, filterDirectory: string | undefined, ): Promise { - if (!extras.embeddingsProvider) { - return []; - } - - // transformers.js not supported in JetBrains IDEs right now - - const isJetBrainsAndTransformersJs = - extras.embeddingsProvider.providerName === - TransformersJsEmbeddingsProvider.providerName && - (await extras.ide.getIdeInfo()).ideType === "jetbrains"; - - if (isJetBrainsAndTransformersJs) { - void extras.ide.showToast( - "warning", - "Codebase retrieval is limited when `embeddingsProvider` is empty or set to `transformers.js` in JetBrains. " + - "You can use Ollama to set up local embeddings, use our 'free-trial', " + - "or configure your own. See here to learn more: " + - "https://docs.continue.dev/customize/model-types/embeddings", - ); - } + // Currently you can use codebase without an embeddings provider and it will just skip the embeddings inputs + // if (!extras.embeddingsProvider) { + // void extras.ide.showToast( + // "warning", + // "Set up an embeddings model to use this feature. Visit the docs to learn more: " + + // "https://docs.continue.dev/customize/model-roles/embeddings", + // ); + // return []; + // } + const includeEmbeddings = !!extras.config.selectedModelByRole.embed; // Get tags to retrieve for const workspaceDirs = await extras.ide.getWorkspaceDirs(); @@ -78,7 +67,6 @@ export async function retrieveContextItemsFromEmbeddings( input: extras.fullInput, llm: extras.llm, config: extras.config, - includeEmbeddings: !isJetBrainsAndTransformersJs, }; const pipeline = new pipelineType(pipelineOptions); @@ -86,16 +74,17 @@ export async function retrieveContextItemsFromEmbeddings( tags, filterDirectory, query: extras.fullInput, + includeEmbeddings, }); if (results.length === 0) { if (extras.config.disableIndexing) { - void extras.ide.showToast("warning", "No embeddings results found."); + void extras.ide.showToast("warning", "No results found."); return []; } else { void extras.ide.showToast( "warning", - "No embeddings results found. If you think this is an error, re-index your codebase.", + "No results found. If you think this is an error, re-index your codebase.", ); // TODO - add "re-index" option to warning message which clears and reindexes codebase } diff --git a/core/control-plane/client.ts b/core/control-plane/client.ts index 7d0e03cc8..9dcf40b6d 100644 --- a/core/control-plane/client.ts +++ b/core/control-plane/client.ts @@ -40,7 +40,10 @@ export class ControlPlaneClient { private readonly ideSettingsPromise: Promise, ) {} - async resolveFQSNs(fqsns: FQSN[]): Promise<(SecretResult | undefined)[]> { + async resolveFQSNs( + fqsns: FQSN[], + orgScopeId: string | null, + ): Promise<(SecretResult | undefined)[]> { const userId = await this.userId; if (!userId) { throw new Error("No user id"); @@ -48,7 +51,7 @@ export class ControlPlaneClient { const resp = await this.request("ide/sync-secrets", { method: "POST", - body: JSON.stringify({ fqsns }), + body: JSON.stringify({ fqsns, orgScopeId }), }); return (await resp.json()) as any; } @@ -183,21 +186,4 @@ export class ControlPlaneClient { }); return ((await resp.json()) as any).settings; } - - async syncSecrets(secretNames: string[]): Promise> { - const userId = await this.userId; - if (!userId) { - throw new Error("No user id"); - } - - try { - const resp = await this.request("ide/sync-secrets", { - method: "POST", - body: JSON.stringify({ secretNames }), - }); - return (await resp.json()) as any; - } catch (e) { - return {}; - } - } } diff --git a/core/control-plane/env.ts b/core/control-plane/env.ts index ca8a85a12..519f13250 100644 --- a/core/control-plane/env.ts +++ b/core/control-plane/env.ts @@ -1,4 +1,3 @@ -import fetch from "node-fetch"; import * as fs from "node:fs"; import { IdeSettings } from ".."; import { getStagingEnvironmentDotFilePath } from "../util/paths"; @@ -62,30 +61,31 @@ const LOCAL_ENV: ControlPlaneEnv = { }; export async function enableHubContinueDev() { - try { - const resp = await fetch("https://api.continue.dev/features/hub"); - const data = (await resp.json()) as any; - if ("enabled" in data && data.enabled === true) { - return true; - } - } catch (e: any) {} - return false; + return true; } export async function getControlPlaneEnv( ideSettingsPromise: Promise, ): Promise { const ideSettings = await ideSettingsPromise; - return getControlPlaneEnvSync(ideSettings.continueTestEnvironment); + return getControlPlaneEnvSync( + ideSettings.continueTestEnvironment, + ideSettings.enableControlServerBeta, + ); } export function getControlPlaneEnvSync( ideTestEnvironment: IdeSettings["continueTestEnvironment"], + enableControlServerBeta: IdeSettings["enableControlServerBeta"], ): ControlPlaneEnv { if (fs.existsSync(getStagingEnvironmentDotFilePath())) { return STAGING_ENV; } + if (enableControlServerBeta === true) { + return PRODUCTION_ENV; + } + const env = ideTestEnvironment === "production" ? "hub" diff --git a/core/core.ts b/core/core.ts index 8a9df812e..6d78ca855 100644 --- a/core/core.ts +++ b/core/core.ts @@ -14,10 +14,14 @@ import { setupQuickstartConfig, } from "./config/onboarding"; import { addContextProvider, addModel, deleteModel } from "./config/util"; +import CodebaseContextProvider from "./context/providers/CodebaseContextProvider"; +import CurrentFileContextProvider from "./context/providers/CurrentFileContextProvider"; import { recentlyEditedFilesCache } from "./context/retrieval/recentlyEditedFilesCache"; import { ContinueServerClient } from "./continueServer/stubs/client"; import { getAuthUrlForTokenPage } from "./control-plane/auth/index"; import { getControlPlaneEnv } from "./control-plane/env"; +import { DevDataSqliteDb } from "./data/devdataSqlite"; +import { DataLogger } from "./data/log"; import { streamDiffLines } from "./edit/streamDiffLines"; import { CodebaseIndexer, PauseToken } from "./indexing/CodebaseIndexer"; import DocsService from "./indexing/docs/DocsService"; @@ -28,14 +32,12 @@ import { createNewPromptFileV2 } from "./promptFiles/v2/createNewPromptFile"; import { callTool } from "./tools/callTool"; import { ChatDescriber } from "./util/chatDescriber"; import { clipboardCache } from "./util/clipboardCache"; -import { logDevData } from "./util/devdata"; -import { DevDataSqliteDb } from "./util/devdataSqlite"; import { GlobalContext } from "./util/GlobalContext"; import historyManager from "./util/history"; import { editConfigJson, getConfigJsonPath, - setupInitialDotContinueDirectory, + migrateV1DevDataFiles, } from "./util/paths"; import { localPathToUri } from "./util/pathToUri"; import { Telemetry } from "./util/posthog"; @@ -51,8 +53,6 @@ import { type IndexingProgressUpdate, } from "."; -import CodebaseContextProvider from "./context/providers/CodebaseContextProvider"; -import CurrentFileContextProvider from "./context/providers/CurrentFileContextProvider"; import type { FromCoreProtocol, ToCoreProtocol } from "./protocol"; import type { IMessenger, Message } from "./protocol/messenger"; @@ -94,7 +94,7 @@ export class Core { private readonly onWrite: (text: string) => Promise = async () => {}, ) { // Ensure .continue directory is created - setupInitialDotContinueDirectory(); + migrateV1DevDataFiles(); this.codebaseIndexingState = { status: "loading", @@ -102,6 +102,7 @@ export class Core { progress: 0, }; + const ideInfoPromise = messenger.request("getIdeInfo", undefined); const ideSettingsPromise = messenger.request("getIdeSettings", undefined); const sessionInfoPromise = messenger.request("getControlPlaneSessionInfo", { silent: true, @@ -130,7 +131,8 @@ export class Core { }); // update additional submenu context providers registered via VSCode API - const additionalProviders = this.configHandler.getAdditionalSubmenuContextProviders(); + const additionalProviders = + this.configHandler.getAdditionalSubmenuContextProviders(); if (additionalProviders.length > 0) { this.messenger.send("refreshSubmenuItems", { providers: additionalProviders, @@ -146,6 +148,12 @@ export class Core { }), ); + // Dev Data Logger + const dataLogger = DataLogger.getInstance(); + dataLogger.core = this; + dataLogger.ideInfoPromise = ideInfoPromise; + dataLogger.ideSettingsPromise = ideSettingsPromise; + // Codebase Indexer and ContinueServerClient depend on IdeSettings let codebaseIndexerResolve: (_: any) => void | undefined; this.codebaseIndexerPromise = new Promise( @@ -192,12 +200,10 @@ export class Core { const getLlm = async () => { const { config } = await this.configHandler.loadConfig(); - const selected = this.globalContext.get("selectedTabAutocompleteModel"); - return ( - config?.tabAutocompleteModels?.find( - (model) => model.title === selected, - ) ?? config?.tabAutocompleteModels?.[0] - ); + if (!config) { + return undefined; + } + return config.selectedModelByRole.autocomplete ?? undefined; }; this.completionProvider = new CompletionProvider( this.configHandler, @@ -231,11 +237,6 @@ export class Core { } }); - on("update/selectTabAutocompleteModel", async (msg) => { - this.globalContext.update("selectedTabAutocompleteModel", msg.data); - void this.configHandler.reloadConfig(); - }); - // Special on("abort", (msg) => { this.abortedMessageIds.add(msg.messageId); @@ -266,8 +267,8 @@ export class Core { }); // Dev data - on("devdata/log", (msg) => { - logDevData(msg.data.tableName, msg.data.data); + on("devdata/log", async (msg) => { + void DataLogger.getInstance().logDevData(msg.data); }); // Edit config @@ -305,13 +306,28 @@ export class Core { return this.configHandler.listProfiles(); }); + on("config/refreshProfiles", async (msg) => { + await this.configHandler.loadAssistantsForSelectedOrg(); + }); + on("config/addContextProvider", async (msg) => { addContextProvider(msg.data, this.configHandler); }); on("config/updateSharedConfig", async (msg) => { - this.globalContext.updateSharedConfig(msg.data); + const newSharedConfig = this.globalContext.updateSharedConfig(msg.data); await this.configHandler.reloadConfig(); + return newSharedConfig; + }); + + on("config/updateSelectedModel", async (msg) => { + const newSelectedModels = this.globalContext.updateSelectedModel( + msg.data.profileId, + msg.data.role, + msg.data.title, + ); + await this.configHandler.reloadConfig(); + return newSelectedModels; }); on("controlPlane/openUrl", async (msg) => { @@ -391,11 +407,11 @@ export class Core { const items = await provider.getContextItems(query, { config, llm, - embeddingsProvider: config.embeddingsProvider, + embeddingsProvider: config.selectedModelByRole.embed, fullInput, ide, selectedCode, - reranker: config.reranker, + reranker: config.selectedModelByRole.rerank, fetch: (url, init) => fetchwithRequestOptions(url, init, config.requestOptions), }); @@ -416,26 +432,25 @@ export class Core { let knownError = false; if (e instanceof Error) { - // A specific error where we're forcing the presence of embeddings provider on the config - // But Jetbrains doesn't support transformers JS - // So if a context provider needs it it will throw this error when the file isn't found - if (e.message.includes("all-MiniLM-L6-v2")) { - knownError = true; - const toastOption = "See Docs"; - void this.ide - .showToast( - "error", - `Set up an embeddings model to use @${name}`, - toastOption, - ) - .then((userSelection) => { - if (userSelection === toastOption) { - void this.ide.openUrl( - "https://docs.continue.dev/customize/model-types/embeddings", - ); - } - }); - } + // After removing transformers JS embeddings provider from jetbrains + // Should no longer see this error + // if (e.message.toLowerCase().includes("embeddings provider")) { + // knownError = true; + // const toastOption = "See Docs"; + // void this.ide + // .showToast( + // "error", + // `Set up an embeddings model to use @${name}`, + // toastOption, + // ) + // .then((userSelection) => { + // if (userSelection === toastOption) { + // void this.ide.openUrl( + // "https://docs.continue.dev/customize/model-roles/embeddings", + // ); + // } + // }); + // } } if (!knownError) { void this.ide.showToast( @@ -641,6 +656,7 @@ export class Core { params, historyIndex, selectedCode, + completionOptions, } = msg.data; const { config } = await configHandler.loadConfig(); @@ -689,6 +705,7 @@ export class Core { config, fetch: (url, init) => fetchwithRequestOptions(url, init, config.requestOptions), + completionOptions, })) { if (abortedMessageIds.has(msg.messageId)) { abortedMessageIds.delete(msg.messageId); diff --git a/core/util/devdataSqlite.ts b/core/data/devdataSqlite.ts similarity index 95% rename from core/util/devdataSqlite.ts rename to core/data/devdataSqlite.ts index bd9e45dca..bf713ca6c 100644 --- a/core/util/devdataSqlite.ts +++ b/core/data/devdataSqlite.ts @@ -5,8 +5,9 @@ import sqlite3 from "sqlite3"; import { DatabaseConnection } from "../indexing/refreshIndex.js"; -import { getDevDataSqlitePath } from "./paths.js"; +import { getDevDataSqlitePath } from "../util/paths.js"; +/* The Dev Data SQLITE table is only used for local tokens generated */ export class DevDataSqliteDb { static db: DatabaseConnection | null = null; diff --git a/core/data/log.ts b/core/data/log.ts new file mode 100644 index 000000000..1b810d851 --- /dev/null +++ b/core/data/log.ts @@ -0,0 +1,226 @@ +import fs from "fs"; +import path from "path"; + +import { + allDevEventNames, + DataLogLevel, + DevDataLogEvent, + devDataVersionedSchemas, +} from "@continuedev/config-yaml"; +import { fetchwithRequestOptions } from "@continuedev/fetch"; +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 { getDevDataFilePath } from "../util/paths.js"; +import { joinPathsToUri } from "../util/uri.js"; + +const DEFAULT_DEV_DATA_LEVEL: DataLogLevel = "all"; +export const LOCAL_DEV_DATA_VERSION = "0.2.0"; +export class DataLogger { + private static instance: DataLogger | null = null; + core?: Core; + ideSettingsPromise?: Promise; + ideInfoPromise?: Promise; + + private constructor() {} + + public static getInstance(): DataLogger { + if (DataLogger.instance === null) { + DataLogger.instance = new DataLogger(); + } + return DataLogger.instance; + } + + async addBaseValues( + body: Record, + eventName: string, + schema: string, + zodSchema: AnyZodObject, + ): Promise> { + const newBody = { ...body }; + const ideSettings = await this.ideSettingsPromise; + const ideInfo = await this.ideInfoPromise; + + if ("eventName" in zodSchema.shape) { + newBody.eventName = eventName; + } + if ("timestamp" in zodSchema.shape) { + newBody.timestamp = new Date().toISOString(); + } + if ("schema" in zodSchema.shape) { + newBody.schema = schema; + } + if ("userAgent" in zodSchema.shape) { + newBody.userAgent = ideInfo + ? `${ideInfo.name}/${ideInfo.version} (Continue/${ideInfo.extensionVersion})` + : "Unknown/Unknown (Continue/Unknown)"; + } + if ("selectedProfileId" in zodSchema.shape) { + newBody.selectedProfileId = + this.core?.configHandler.currentProfile?.profileDescription.id ?? ""; + } + if ("userId" in zodSchema.shape) { + newBody.userId = ideSettings?.userToken ?? ""; + } + + return newBody; + } + + async logDevData(event: DevDataLogEvent) { + // Local logs (always on for all levels) + try { + const filepath: string = getDevDataFilePath( + event.name, + LOCAL_DEV_DATA_VERSION, + ); + const localSchema = + devDataVersionedSchemas[LOCAL_DEV_DATA_VERSION]["all"][event.name]; + + if (!localSchema) { + throw new Error( + `Schema ${LOCAL_DEV_DATA_VERSION} doesn't exist at level "all"`, + ); + } + + const eventDataWithBaseValues = await this.addBaseValues( + event.data, + event.name, + LOCAL_DEV_DATA_VERSION, + localSchema, + ); + + const parsed = localSchema?.safeParse(eventDataWithBaseValues); + if (parsed?.success) { + fs.writeFileSync(filepath, `${JSON.stringify(parsed.data)}\n`, { + flag: "a", + }); + } + } catch (error) { + console.error("Error logging local dev data:", error); + } + + // 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; + + 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; + } + + const versionSchemas = devDataVersionedSchemas[schema]; + if (!versionSchemas) { + throw new Error( + `Attempting to log dev data to non-existent version ${schema}`, + ); + } + + 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 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 eventDataWithBaseValues = await this.addBaseValues( + event.data, + event.name, + schema, + zodSchema, + ); + + 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}`, + ); + } + }), + ); + } + } +} diff --git a/core/edit/lazy/applyCodeBlock.ts b/core/edit/lazy/applyCodeBlock.ts index 924d1c282..424d4e831 100644 --- a/core/edit/lazy/applyCodeBlock.ts +++ b/core/edit/lazy/applyCodeBlock.ts @@ -18,7 +18,8 @@ export async function applyCodeBlock( llm: ILLM, fastLlm: ILLM, ): Promise<[boolean, AsyncGenerator]> { - if (canUseInstantApply(filename)) { + // This was buggy, removed for now, maybe forever + if (false && canUseInstantApply(filename)) { const diffLines = await deterministicApplyLazyEdit( oldFile, newFile, diff --git a/core/index.d.ts b/core/index.d.ts index 7d882cb27..2d60c4663 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -1,4 +1,4 @@ -import { ModelRole } from "@continuedev/config-yaml"; +import { DataDestination, ModelRole } from "@continuedev/config-yaml"; import Parser from "web-tree-sitter"; import { GetGhTokenArgs } from "./protocol/ide"; declare global { @@ -43,13 +43,13 @@ export interface IndexingProgressUpdate { desc: string; shouldClearIndexes?: boolean; status: - | "loading" - | "indexing" - | "done" - | "failed" - | "paused" - | "disabled" - | "cancelled"; + | "loading" + | "indexing" + | "done" + | "failed" + | "paused" + | "disabled" + | "cancelled"; debugInfo?: string; } @@ -60,7 +60,7 @@ export interface IndexingStatus { progress: number; description: string; status: "indexing" | "complete" | "paused" | "failed" | "aborted" | "pending"; - embeddingsProviderId: string; + embeddingsProviderId?: string; isReindexing?: boolean; debugInfo?: string; title: string; @@ -179,8 +179,8 @@ export type FetchFunction = (url: string | URL, init?: any) => Promise; export interface ContextProviderExtras { config: ContinueConfig; fullInput: string; - embeddingsProvider: ILLM; - reranker: ILLM | undefined; + embeddingsProvider: ILLM | null; + reranker: ILLM | null; llm: ILLM; ide: IDE; selectedCode: RangeInFile[]; @@ -478,9 +478,15 @@ export interface LLMOptions { writeLog?: (str: string) => Promise; llmRequestHook?: (model: string, prompt: string) => any; apiKey?: string; + + // continueProperties apiKeyLocation?: string; - aiGatewaySlug?: string; apiBase?: string; + orgScopeId?: string | null; + + onPremProxyUrl?: string | null; + + aiGatewaySlug?: string; cacheBehavior?: CacheBehavior; capabilities?: ModelCapability; roles?: ModelRole[]; @@ -504,14 +510,16 @@ export interface LLMOptions { profile?: string; modelArn?: string; - // AWS and GCP Options + // AWS and VertexAI Options region?: string; - // GCP and Watsonx Options + // VertexAI and Watsonx Options projectId?: string; // IBM watsonx Options deploymentId?: string; + + env?: Record; } type RequireAtLeastOne = Pick< @@ -667,10 +675,10 @@ export interface IDE { getCurrentFile(): Promise< | undefined | { - isUntitled: boolean; - path: string; - contents: string; - } + isUntitled: boolean; + path: string; + contents: string; + } >; getLastFileSaveTimestamp?(): number; @@ -730,6 +738,7 @@ export interface ContinueSDK { selectedCode: RangeInFile[]; config: ContinueConfig; fetch: FetchFunction; + completionOptions?: LLMFullCompletionOptions; } export interface SlashCommand { @@ -853,11 +862,11 @@ export interface CustomCommand { export interface Prediction { type: "content"; content: - | string - | { - type: "text"; - text: string; - }[]; + | string + | { + type: "text"; + text: string; + }[]; } export interface ToolExtras { @@ -920,8 +929,14 @@ export interface ModelDescription { provider: string; model: string; apiKey?: string; + + // continueProperties apiKeyLocation?: string; apiBase?: string; + orgScopeId?: string | null; + + onPremProxyUrl?: string | null; + contextLength?: number; maxStopWords?: number; template?: TemplateType; @@ -942,15 +957,16 @@ export interface EmbedOptions { apiType?: string; apiVersion?: string; requestOptions?: RequestOptions; - maxChunkSize?: number; - maxBatchSize?: number; + maxEmbeddingChunkSize?: number; + maxEmbeddingBatchSize?: number; + // AWS options profile?: string; - // AWS and GCP Options + // AWS and VertexAI Options region?: string; - // GCP and Watsonx Options + // VertexAI and Watsonx Options projectId?: string; } @@ -1028,9 +1044,9 @@ export interface ContextMenuConfig { } export interface ExperimentalModelRoles { + repoMapFileSelection?: string; inlineEdit?: string; applyCodeBlock?: string; - repoMapFileSelection?: string; } export type EditStatus = @@ -1147,6 +1163,7 @@ export interface SerializedContinueConfig { experimental?: ExperimentalConfig; analytics?: AnalyticsConfig; docs?: SiteIndexingConfig[]; + data?: DataDestination[]; } export type ConfigMergeType = "merge" | "overwrite"; @@ -1186,9 +1203,9 @@ export interface Config { embeddingsProvider?: EmbeddingsProviderDescription | ILLM; /** The model that Continue will use for tab autocompletions. */ tabAutocompleteModel?: - | CustomLLM - | ModelDescription - | (CustomLLM | ModelDescription)[]; + | CustomLLM + | ModelDescription + | (CustomLLM | ModelDescription)[]; /** Options for tab autocomplete */ tabAutocompleteOptions?: Partial; /** UI styles customization */ @@ -1199,6 +1216,7 @@ export interface Config { experimental?: ExperimentalConfig; /** Analytics configuration */ analytics?: AnalyticsConfig; + data?: DataDestination[]; } // in the actual Continue source code @@ -1213,15 +1231,15 @@ export interface ContinueConfig { disableSessionTitles?: boolean; disableIndexing?: boolean; userToken?: string; - embeddingsProvider: ILLM; - tabAutocompleteModels?: ILLM[]; tabAutocompleteOptions?: Partial; ui?: ContinueUIConfig; - reranker?: ILLM; experimental?: ExperimentalConfig; analytics?: AnalyticsConfig; docs?: SiteIndexingConfig[]; tools: Tool[]; + modelsByRole: Record; + selectedModelByRole: Record; + data?: DataDestination[]; } export interface BrowserSerializedContinueConfig { @@ -1235,15 +1253,15 @@ export interface BrowserSerializedContinueConfig { disableIndexing?: boolean; disableSessionTitles?: boolean; userToken?: string; - embeddingsProvider?: string; ui?: ContinueUIConfig; - reranker?: RerankerDescription; experimental?: ExperimentalConfig; analytics?: AnalyticsConfig; docs?: SiteIndexingConfig[]; tools: Tool[]; usePlatform: boolean; tabAutocompleteOptions?: Partial; + modelsByRole: Record; + selectedModelByRole: Record; } // DOCS SUGGESTIONS AND PACKAGE INFO @@ -1279,9 +1297,9 @@ export type PackageDetailsSuccess = PackageDetails & { export type PackageDocsResult = { packageInfo: ParsedPackageInfo; } & ( - | { error: string; details?: never } - | { details: PackageDetailsSuccess; error?: never } - ); + | { error: string; details?: never } + | { details: PackageDetailsSuccess; error?: never } +); export interface TerminalOptions { reuseTerminal?: boolean; diff --git a/core/indexing/CodebaseIndexer.ts b/core/indexing/CodebaseIndexer.ts index 677cc4305..6f5a5e946 100644 --- a/core/indexing/CodebaseIndexer.ts +++ b/core/indexing/CodebaseIndexer.ts @@ -5,8 +5,8 @@ import { IContinueServerClient } from "../continueServer/interface.js"; import { IDE, IndexingProgressUpdate, IndexTag } from "../index.js"; import { extractMinimalStackTraceInfo } from "../util/extractMinimalStackTraceInfo.js"; import { getIndexSqlitePath, getLanceDbPath } from "../util/paths.js"; - import { findUriInDirs, getUriPathBasename } from "../util/uri.js"; + import { ChunkCodebaseIndex } from "./chunk/ChunkCodebaseIndex.js"; import { CodeSnippetsCodebaseIndex } from "./CodeSnippetsIndex.js"; import { FullTextSearchCodebaseIndex } from "./FullTextSearchCodebaseIndex.js"; @@ -80,14 +80,19 @@ export class CodebaseIndexer { return []; } + const embeddingsModel = config.selectedModelByRole.embed; + if (!embeddingsModel) { + return []; + } + const indexes = [ new ChunkCodebaseIndex( this.ide.readFile.bind(this.ide), this.continueServerClient, - config.embeddingsProvider.maxEmbeddingChunkSize, + embeddingsModel.maxEmbeddingChunkSize, ), // Chunking must come first new LanceDbIndex( - config.embeddingsProvider, + embeddingsModel, this.ide.readFile.bind(this.ide), this.continueServerClient, ), diff --git a/core/indexing/LanceDbIndex.test.ts b/core/indexing/LanceDbIndex.test.ts index 08c8f9982..d8a7c9852 100644 --- a/core/indexing/LanceDbIndex.test.ts +++ b/core/indexing/LanceDbIndex.test.ts @@ -3,15 +3,15 @@ import lance from "vectordb"; import { testConfigHandler, testIde } from "../test/fixtures"; import { getLanceDbPath } from "../util/paths"; + +import { LanceDbIndex } from "./LanceDbIndex"; +import { DatabaseConnection, SqliteDb } from "./refreshIndex"; import { mockPathAndCacheKey, mockTag, testContinueServerClient, updateIndexAndAwaitGenerator, } from "./test/indexing"; - -import { LanceDbIndex } from "./LanceDbIndex"; -import { DatabaseConnection, SqliteDb } from "./refreshIndex"; import { IndexResultType } from "./types"; jest.useFakeTimers(); @@ -30,9 +30,12 @@ describe.skip("ChunkCodebaseIndex", () => { if (!mockConfig) { throw new Error("Failed to load config"); } + if (!mockConfig.selectedModelByRole.embed) { + throw new Error("No embeddings model selected"); + } index = new LanceDbIndex( - mockConfig.embeddingsProvider, + mockConfig.selectedModelByRole.embed, testIde.readFile.bind(testIde), testContinueServerClient, ); diff --git a/core/indexing/LanceDbIndex.ts b/core/indexing/LanceDbIndex.ts index d11feb1d1..077b2ace0 100644 --- a/core/indexing/LanceDbIndex.ts +++ b/core/indexing/LanceDbIndex.ts @@ -40,11 +40,11 @@ type ChunkMap = Map; export class LanceDbIndex implements CodebaseIndex { relativeExpectedTime: number = 13; get artifactId(): string { - return `vectordb::${this.embeddingsProvider.embeddingId}`; + return `vectordb::${this.embeddingsProvider?.embeddingId}`; } constructor( - private readonly embeddingsProvider: ILLM, + private readonly embeddingsProvider: ILLM | null, private readonly readFile: (filepath: string) => Promise, private readonly continueServerClient?: IContinueServerClient, ) {} @@ -142,6 +142,9 @@ export class LanceDbIndex implements CodebaseIndex { item: PathAndCacheKey, content: string, ): Promise { + if (!this.embeddingsProvider) { + return []; + } const chunks: Chunk[] = []; const chunkParams = { @@ -163,6 +166,9 @@ export class LanceDbIndex implements CodebaseIndex { } private async getEmbeddings(chunks: Chunk[]): Promise { + if (!this.embeddingsProvider) { + return []; + } try { return await this.embeddingsProvider.embed(chunks.map((c) => c.content)); } catch (err) { @@ -436,6 +442,9 @@ export class LanceDbIndex implements CodebaseIndex { tags: BranchAndDir[], filterDirectory: string | undefined, ): Promise { + if (!this.embeddingsProvider) { + return []; + } const [vector] = await this.embeddingsProvider.embed([query]); const db = await lance.connect(getLanceDbPath()); diff --git a/core/indexing/allEmbeddingsProviders.ts b/core/indexing/allEmbeddingsProviders.ts index 9efa37f2d..3986fa2c0 100644 --- a/core/indexing/allEmbeddingsProviders.ts +++ b/core/indexing/allEmbeddingsProviders.ts @@ -8,6 +8,7 @@ import Gemini from "../llm/llms/Gemini.js"; import HuggingFaceTEIEmbeddingsProvider from "../llm/llms/HuggingFaceTEI.js"; import LMStudio from "../llm/llms/LMStudio.js"; import Mistral from "../llm/llms/Mistral.js"; +import NCompass from "../llm/llms/NCompass.js"; import Nebius from "../llm/llms/Nebius.js"; import Nvidia from "../llm/llms/Nvidia.js"; import Ollama from "../llm/llms/Ollama.js"; @@ -39,6 +40,7 @@ export const allEmbeddingsProviders: Record< gemini: Gemini, "continue-proxy": ContinueProxy, deepinfra: DeepInfra, + ncompass: NCompass, nvidia: Nvidia, voyage: Voyage, mistral: Mistral, diff --git a/core/indexing/docs/DocsService.ts b/core/indexing/docs/DocsService.ts index 4d555f557..307e3c117 100644 --- a/core/indexing/docs/DocsService.ts +++ b/core/indexing/docs/DocsService.ts @@ -1,3 +1,4 @@ +import { ConfigResult } from "@continuedev/config-yaml"; import { open, type Database } from "sqlite"; import sqlite3 from "sqlite3"; import lancedb, { Connection } from "vectordb"; @@ -19,6 +20,7 @@ import TransformersJsEmbeddingsProvider from "../../llm/llms/TransformersJsEmbed import { FromCoreProtocol, ToCoreProtocol } from "../../protocol"; import { IMessenger } from "../../protocol/messenger"; import { fetchFavicon, getFaviconBase64 } from "../../util/fetchFavicon"; +import { GlobalContext } from "../../util/GlobalContext"; import { editConfigJson, getDocsSqlitePath, @@ -26,8 +28,6 @@ import { } from "../../util/paths"; import { Telemetry } from "../../util/posthog"; -import { ConfigResult } from "@continuedev/config-yaml"; -import { GlobalContext } from "../../util/GlobalContext"; import { ArticleWithChunks, htmlPageToArticleWithChunks, @@ -161,16 +161,22 @@ export default class DocsService { return; } - const sharedStatus = { - type: "docs" as IndexingStatus["type"], + const sharedStatus: Omit< + IndexingStatus, + "progress" | "description" | "status" + > = { + type: "docs", id: doc.startUrl, - embeddingsProviderId: this.config.embeddingsProvider.embeddingId, isReindexing: false, title: doc.title, debugInfo: `max depth: ${doc.maxDepth}`, icon: doc.faviconUrl, url: doc.startUrl, }; + if (this.config.selectedModelByRole.embed) { + sharedStatus.embeddingsProviderId = + this.config.selectedModelByRole.embed.embeddingId; + } const indexedStatus: IndexingStatus = metadata.find( (meta) => meta.startUrl === doc.startUrl, ) @@ -214,7 +220,9 @@ export default class DocsService { } // Handle embeddings provider change mid-indexing - if (this.config.embeddingsProvider.embeddingId !== startedWithEmbedder) { + if ( + this.config.selectedModelByRole.embed?.embeddingId !== startedWithEmbedder + ) { this.abort(startUrl); return true; } @@ -234,14 +242,6 @@ export default class DocsService { return true; } - async isUsingUnsupportedPreIndexedEmbeddingsProvider() { - const isPreIndexedDocsProvider = - this.config.embeddingsProvider.embeddingId === - DocsService.preIndexedDocsEmbeddingsProvider.embeddingId; - const canUsePreindexedDocs = await this.canUsePreindexedDocs(); - return isPreIndexedDocsProvider && !canUsePreindexedDocs; - } - // Determines if using preIndexed and returns proper embeddings provider async getEmbeddingsProvider(startUrl: string) { // Conditions for using a pre-indexed doc @@ -262,7 +262,7 @@ export default class DocsService { } } return { - provider: this.config.embeddingsProvider, + provider: this.config.selectedModelByRole.embed, isPreindexed: false, }; } @@ -282,9 +282,7 @@ export default class DocsService { // Skip docs indexing if not supported // No warning message here because would show on ANY config update - const unsupported = - await this.isUsingUnsupportedPreIndexedEmbeddingsProvider(); - if (unsupported) { + if (!this.config.selectedModelByRole.embed) { return; } @@ -323,18 +321,21 @@ export default class DocsService { // Returns true if startUrl has been indexed with current embeddingsProvider async hasMetadata(startUrl: string): Promise { + if (!this.config.selectedModelByRole.embed) { + return false; + } const db = await this.getOrCreateSqliteDb(); const title = await db.get( `SELECT title FROM ${DocsService.sqlitebTableName} WHERE startUrl = ? AND embeddingsProviderId = ?`, startUrl, - this.config.embeddingsProvider.embeddingId, + this.config.selectedModelByRole.embed.embeddingId, ); return !!title; } async listMetadata() { - const embeddingsProvider = this.config.embeddingsProvider; + const embeddingsProvider = this.config.selectedModelByRole.embed; if (!embeddingsProvider) { return []; } @@ -376,6 +377,11 @@ export default class DocsService { console.warn("Attempted to indexAndAdd pre-indexed doc"); return; } + if (!provider) { + console.warn("@docs indexAndAdd: no embeddings provider found"); + return; + } + const startedWithEmbedder = provider.embeddingId; // Check if doc has been successfully indexed with the given embedder @@ -716,21 +722,18 @@ export default class DocsService { startUrl: string, nRetrieve: number, ) { - if (await this.isUsingUnsupportedPreIndexedEmbeddingsProvider()) { - await this.ide.showToast( - "error", - `${DocsService.preIndexedDocsEmbeddingsProvider.embeddingId} is configured as ` + - "the embeddings provider, but it cannot be used with JetBrains. " + // TODO "with this IDE" - "Please select a different embeddings provider to use the '@docs' " + - "context provider.", - ); - - return []; - } - const { isPreindexed, provider } = await this.getEmbeddingsProvider(startUrl); + if (!provider) { + void this.ide.showToast( + "error", + "Set up an embeddings model to use the @docs context provider. See: " + + "https://docs.continue.dev/customize/model-roles/embeddings", + ); + return []; + } + if (isPreindexed) { void Telemetry.capture("docs_pre_indexed_doc_used", { doc: preIndexedDocs[startUrl]!["title"], @@ -761,8 +764,10 @@ export default class DocsService { try { const { isPreindexed, provider } = await this.getEmbeddingsProvider(startUrl); - const preIndexedDoc = preIndexedDocs[startUrl]; - const isPreIndexedDoc = !!preIndexedDoc; + + if (!provider) { + throw new Error("No embeddings model set"); + } const result = await db.get( `SELECT startUrl, title, favicon FROM ${DocsService.sqlitebTableName} WHERE startUrl = ? AND embeddingsProviderId = ?`, @@ -793,7 +798,7 @@ export default class DocsService { config: siteIndexingConfig, indexingStatus: this.statuses.get(startUrl), chunks: rows.map(this.lanceDBRowToChunk), - isPreIndexedDoc, + isPreIndexedDoc: isPreindexed, }; } catch (e) { console.warn("Error getting details", e); @@ -867,7 +872,7 @@ export default class DocsService { } async getFavicon(startUrl: string) { - if (!this.config.embeddingsProvider) { + if (!this.config.selectedModelByRole.embed) { console.warn( "Attempting to get favicon without embeddings provider specified", ); @@ -877,7 +882,7 @@ export default class DocsService { const result = await db.get( `SELECT favicon FROM ${DocsService.sqlitebTableName} WHERE startUrl = ? AND embeddingsProviderId = ?`, startUrl, - this.config.embeddingsProvider.embeddingId, + this.config.selectedModelByRole.embed.embeddingId, ); if (!result) { @@ -941,7 +946,7 @@ export default class DocsService { type: "docs", id: doc.startUrl, embeddingsProviderId: - this.config.embeddingsProvider.embeddingId, + this.config.selectedModelByRole.embed?.embeddingId, isReindexing: false, title: doc.title, debugInfo: "Config sync: not changed", @@ -1033,6 +1038,13 @@ export default class DocsService { const conn = await lancedb.connect(getLanceDbPath()); const tableNames = await conn.tableNames(); const { provider } = await this.getEmbeddingsProvider(startUrl); + + if (!provider) { + throw new Error( + "Could not retrieve @docs Lance Table: no embeddings provider specified", + ); + } + const tableNameFromEmbeddingsProvider = await this.getLanceTableName(provider); @@ -1089,13 +1101,19 @@ export default class DocsService { siteIndexingConfig: { title, startUrl }, favicon, }: AddParams) { + if (!this.config.selectedModelByRole.embed) { + console.warn( + `Attempting to add metadata for ${startUrl} without embeddings provider specified`, + ); + return; + } const db = await this.getOrCreateSqliteDb(); await db.run( `INSERT INTO ${DocsService.sqlitebTableName} (title, startUrl, favicon, embeddingsProviderId) VALUES (?, ?, ?, ?)`, title, startUrl, favicon, - this.config.embeddingsProvider.embeddingId, + this.config.selectedModelByRole.embed.embeddingId, ); } @@ -1147,7 +1165,7 @@ export default class DocsService { } private async deleteMetadataFromSqlite(startUrl: string) { - if (!this.config.embeddingsProvider) { + if (!this.config.selectedModelByRole.embed) { console.warn( `Attempting to delete metadata for ${startUrl} without embeddings provider specified`, ); @@ -1158,7 +1176,7 @@ export default class DocsService { await db.run( `DELETE FROM ${DocsService.sqlitebTableName} WHERE startUrl = ? AND embeddingsProviderId = ?`, startUrl, - this.config.embeddingsProvider.embeddingId, + this.config.selectedModelByRole.embed.embeddingId, ); } diff --git a/core/llm/constructMessages.ts b/core/llm/constructMessages.ts index fa6cdd558..0e4533ceb 100644 --- a/core/llm/constructMessages.ts +++ b/core/llm/constructMessages.ts @@ -8,66 +8,6 @@ import { normalizeToMessageParts } from "../util/messageContent"; import { modelSupportsTools } from "./autodetect"; -const CUSTOM_SYS_MSG_MODEL_FAMILIES = ["sonnet"]; - -const SYSTEM_MESSAGE = `When generating new code: - -1. Always produce a single code block. -2. Never separate the code into multiple code blocks. -3. Only include the code that is being added. -4. Replace existing code with a "lazy" comment like this: "// ... existing code ..." -5. The "lazy" comment must always be a valid comment in the current context (e.g. "" for HTML, "// ... existing code ..." for JavaScript, "{/* ... existing code */}" for TSX, etc.) -6. You must always provide 1-2 lines of context above and below a "lazy" comment -7. If the user submits a code block that contains a filename in the language specifier, always include the filename in any code block you generate based on that file. The filename should be on the same line as the language specifier in your code block. - -Example 1: -Input: -\`\`\`test.js -import addition from "addition" - -class Calculator { - constructor() { - this.result = 0; - } - - add(number) { - this.result += number; - return this; - } -} -\`\`\` -User request: Add a subtract method - -Output: -\`\`\`javascript test.js -// ... existing code ... -import subtraction from "subtraction" - -class Calculator { - // ... existing code ... - - subtract(number) { - this.result -= number; - return this; - } -} -\`\`\` - -Example 2: -Input: -\`\`\`javascript test.js (6-9) -function helloWorld() {} -\`\`\` - -Output: -\`\`\`javascript test.js -function helloWorld() { - // New code here -} -\`\`\` - -Always follow these guidelines when generating code responses.`; - const TOOL_USE_RULES = `When using tools, follow the following guidelines: - Avoid calling tools unless they are absolutely necessary. For example, if you are asked a simple programming question you do not need web search. As another example, if the user asks you to explain something about code, do not create a new file.`; @@ -75,21 +15,12 @@ function constructSystemPrompt( modelDescription: ModelDescription, useTools: boolean, ): string | null { - let systemMessage = ""; - if ( - CUSTOM_SYS_MSG_MODEL_FAMILIES.some((family) => - modelDescription.model.includes(family), - ) - ) { - systemMessage = SYSTEM_MESSAGE; - } + let systemMessage = + "Always include the language and file name in the info string when you write code blocks, for example '```python file.py'."; if (useTools && modelSupportsTools(modelDescription)) { - if (systemMessage) { - systemMessage += "\n\n"; - } - systemMessage += TOOL_USE_RULES; + systemMessage += "\n\n" + TOOL_USE_RULES; } - return systemMessage || null; + return systemMessage; } const CANCELED_TOOL_CALL_MESSAGE = diff --git a/core/llm/index.ts b/core/llm/index.ts index 7e3c37fc2..ccbad6699 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -1,3 +1,4 @@ +import { ModelRole } from "@continuedev/config-yaml"; import { fetchwithRequestOptions } from "@continuedev/fetch"; import { findLlmInfo } from "@continuedev/llm-info"; import { @@ -7,6 +8,8 @@ import { } from "@continuedev/openai-adapters"; import Handlebars from "handlebars"; +import { DevDataSqliteDb } from "../data/devdataSqlite.js"; +import { DataLogger } from "../data/log.js"; import { CacheBehavior, ChatMessage, @@ -21,8 +24,6 @@ import { RequestOptions, TemplateType, } from "../index.js"; -import { logDevData } from "../util/devdata.js"; -import { DevDataSqliteDb } from "../util/devdataSqlite.js"; import mergeJson from "../util/merge.js"; import { renderChatMessage } from "../util/messageContent.js"; import { isOllamaInstalled } from "../util/ollamaHelper.js"; @@ -56,7 +57,6 @@ import { toCompleteBody, toFimBody, } from "./openaiTypeConverters.js"; -import { ModelRole } from "@continuedev/config-yaml"; export abstract class BaseLLM implements ILLM { static providerName: string; @@ -118,8 +118,14 @@ export abstract class BaseLLM implements ILLM { writeLog?: (str: string) => Promise; llmRequestHook?: (model: string, prompt: string) => any; apiKey?: string; + + // continueProperties apiKeyLocation?: string; apiBase?: string; + orgScopeId?: string | null; + + onPremProxyUrl?: string | null; + cacheBehavior?: CacheBehavior; capabilities?: ModelCapability; roles?: ModelRole[]; @@ -198,9 +204,15 @@ export abstract class BaseLLM implements ILLM { this.writeLog = options.writeLog; this.llmRequestHook = options.llmRequestHook; this.apiKey = options.apiKey; + + // continueProperties this.apiKeyLocation = options.apiKeyLocation; - this.aiGatewaySlug = options.aiGatewaySlug; + this.orgScopeId = options.orgScopeId; this.apiBase = options.apiBase; + + this.onPremProxyUrl = options.onPremProxyUrl; + + this.aiGatewaySlug = options.aiGatewaySlug; this.cacheBehavior = options.cacheBehavior; // watsonx deploymentId @@ -288,7 +300,7 @@ export abstract class BaseLLM implements ILLM { return this.templateMessages(msgs); } - private _compileLogMessage( + private _compilePromptForLog( prompt: string, completionOptions: CompletionOptions, ): string { @@ -343,11 +355,14 @@ export abstract class BaseLLM implements ILLM { generatedTokens, ); - logDevData("tokens_generated", { - model: model, - provider: this.providerName, - promptTokens: promptTokens, - generatedTokens: generatedTokens, + void DataLogger.getInstance().logDevData({ + name: "tokensGenerated", + data: { + model: model, + provider: this.providerName, + promptTokens: promptTokens, + generatedTokens: generatedTokens, + }, }); } @@ -447,7 +462,7 @@ export abstract class BaseLLM implements ILLM { options, ); - return { completionOptions, log, raw }; + return { completionOptions, logEnabled: log, raw }; } private _formatChatMessages(messages: ChatMessage[]): string { @@ -500,12 +515,15 @@ export abstract class BaseLLM implements ILLM { signal: AbortSignal, options: LLMFullCompletionOptions = {}, ): AsyncGenerator { - const { completionOptions, log } = this._parseCompletionOptions(options); + const { completionOptions, logEnabled } = + this._parseCompletionOptions(options); const fimLog = `Prefix: ${prefix}\nSuffix: ${suffix}`; - if (log) { + if (logEnabled) { if (this.writeLog) { - await this.writeLog(this._compileLogMessage(fimLog, completionOptions)); + await this.writeLog( + this._compilePromptForLog(fimLog, completionOptions), + ); } if (this.llmRequestHook) { this.llmRequestHook(completionOptions.model, fimLog); @@ -541,7 +559,7 @@ export abstract class BaseLLM implements ILLM { this._logTokensGenerated(completionOptions.model, fimLog, completion); - if (log && this.writeLog) { + if (logEnabled && this.writeLog) { await this.writeLog(`Completion:\n${completion}\n\n`); } @@ -557,7 +575,7 @@ export abstract class BaseLLM implements ILLM { signal: AbortSignal, options: LLMFullCompletionOptions = {}, ) { - const { completionOptions, log, raw } = + const { completionOptions, logEnabled, raw } = this._parseCompletionOptions(options); let prompt = pruneRawPromptFromTop( @@ -571,9 +589,11 @@ export abstract class BaseLLM implements ILLM { prompt = this._templatePromptLikeMessages(prompt); } - if (log) { + if (logEnabled) { if (this.writeLog) { - await this.writeLog(this._compileLogMessage(prompt, completionOptions)); + await this.writeLog( + this._compilePromptForLog(prompt, completionOptions), + ); } if (this.llmRequestHook) { this.llmRequestHook(completionOptions.model, prompt); @@ -618,7 +638,7 @@ export abstract class BaseLLM implements ILLM { } finally { this._logTokensGenerated(completionOptions.model, prompt, completion); - if (log && this.writeLog) { + if (logEnabled && this.writeLog) { await this.writeLog(`Completion:\n${completion}\n\n`); } } @@ -636,7 +656,7 @@ export abstract class BaseLLM implements ILLM { signal: AbortSignal, options: LLMFullCompletionOptions = {}, ) { - const { completionOptions, log, raw } = + const { completionOptions, logEnabled, raw } = this._parseCompletionOptions(options); let prompt = pruneRawPromptFromTop( @@ -650,9 +670,11 @@ export abstract class BaseLLM implements ILLM { prompt = this._templatePromptLikeMessages(prompt); } - if (log) { + if (logEnabled) { if (this.writeLog) { - await this.writeLog(this._compileLogMessage(prompt, completionOptions)); + await this.writeLog( + this._compilePromptForLog(prompt, completionOptions), + ); } if (this.llmRequestHook) { this.llmRequestHook(completionOptions.model, prompt); @@ -675,7 +697,7 @@ export abstract class BaseLLM implements ILLM { this._logTokensGenerated(completionOptions.model, prompt, completion); - if (log && this.writeLog) { + if (logEnabled && this.writeLog) { await this.writeLog(`Completion:\n${completion}\n\n`); } @@ -719,7 +741,8 @@ export abstract class BaseLLM implements ILLM { signal: AbortSignal, options: LLMFullCompletionOptions = {}, ): AsyncGenerator { - let { completionOptions, log } = this._parseCompletionOptions(options); + let { completionOptions, logEnabled } = + this._parseCompletionOptions(options); completionOptions = this._modifyCompletionOptions(completionOptions); @@ -728,9 +751,11 @@ export abstract class BaseLLM implements ILLM { const prompt = this.templateMessages ? this.templateMessages(messages) : this._formatChatMessages(messages); - if (log) { + if (logEnabled) { if (this.writeLog) { - await this.writeLog(this._compileLogMessage(prompt, completionOptions)); + await this.writeLog( + this._compilePromptForLog(prompt, completionOptions), + ); } if (this.llmRequestHook) { this.llmRequestHook(completionOptions.model, prompt); @@ -797,7 +822,7 @@ export abstract class BaseLLM implements ILLM { this._logTokensGenerated(completionOptions.model, prompt, completion); - if (log && this.writeLog) { + if (logEnabled && this.writeLog) { await this.writeLog(`Completion:\n${completion}\n\n`); } diff --git a/core/llm/llms/Anthropic.ts b/core/llm/llms/Anthropic.ts index df527d579..dcd13d38e 100644 --- a/core/llm/llms/Anthropic.ts +++ b/core/llm/llms/Anthropic.ts @@ -145,6 +145,12 @@ class Anthropic extends BaseLLM { signal: AbortSignal, options: CompletionOptions, ): AsyncGenerator { + if (!this.apiKey || this.apiKey === "") { + throw new Error( + "Request not sent. You have an Anthropic model configured in your config.json, but the API key is not set.", + ); + } + const shouldCacheSystemMessage = !!this.systemMessage && this.cacheBehavior?.cacheSystemMessage; const systemMessage: string = stripImages( diff --git a/core/llm/llms/NCompass.ts b/core/llm/llms/NCompass.ts new file mode 100644 index 000000000..744366b41 --- /dev/null +++ b/core/llm/llms/NCompass.ts @@ -0,0 +1,60 @@ +import { ChatCompletionCreateParams } from "openai/resources/index"; +import { ChatMessage, CompletionOptions, LLMOptions } from "../../index.js"; + +import OpenAI from "./OpenAI.js"; + +class NCompass extends OpenAI { + static providerName = "ncompass"; + static defaultOptions: Partial = { + apiBase: "https://api.ncompass.tech/v1" + }; + static embeddingsApiEndpoint: "https://api.gcp.ncompass.tech/v1/embeddings" + + private static modelConversion: { [key: string]: string } = { + "qwen2.5-coder-7b": "Qwen/Qwen2.5-Coder-7B-Instruct", + "qwen2.5-coder-32b": "Qwen/Qwen2.5-Coder-32B-Instruct", + }; + protected _convertModelName(model: string): string { + return NCompass.modelConversion[model] ?? model; + } + + protected _convertArgs( + options: CompletionOptions, + messages: ChatMessage[], + ): ChatCompletionCreateParams { + const finalOptions = super._convertArgs(options, messages); + finalOptions.model = this._convertModelName(options.model); + return finalOptions; + } + + protected _getHeaders() { + const headers = super._getHeaders() as { "Content-Type": string; Authorization: string; "api-key": string; Accept?: string }; + headers["Accept"] = "text/event-stream"; + return headers; + } + + protected async _embed(chunks: string[]): Promise { + const resp = await this.fetch(NCompass.embeddingsApiEndpoint, { + method: "POST", + body: JSON.stringify({ + input: chunks, + model: this.model, + ...this.extraBodyProperties(), + }), + headers: { + Authorization: `Bearer ${this.apiKey}`, + "Content-Type": "application/json", + }, + }); + + if (!resp.ok) { + throw new Error(await resp.text()); + } + + const data = (await resp.json()) as any; + return data.data.map((result: { embedding: number[] }) => result.embedding); + } + +} + +export default NCompass; diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts index b9734acb9..ee822eb27 100644 --- a/core/llm/llms/Ollama.ts +++ b/core/llm/llms/Ollama.ts @@ -139,12 +139,17 @@ class Ollama extends BaseLLM { if (options.model === "AUTODETECT") { return; } + const headers: Record = { + "Content-Type": "application/json", + }; + + if (this.apiKey) { + headers.Authorization = `Bearer ${this.apiKey}`; + } + this.fetch(this.getEndpoint("api/show"), { method: "POST", - headers: { - Authorization: `Bearer ${this.apiKey}`, - "Content-Type": "application/json", - }, + headers: headers, body: JSON.stringify({ name: this._getModel() }), }) .then(async (response) => { @@ -323,12 +328,16 @@ class Ollama extends BaseLLM { signal: AbortSignal, options: CompletionOptions, ): AsyncGenerator { + const headers: Record = { + "Content-Type": "application/json", + }; + + if (this.apiKey) { + headers.Authorization = `Bearer ${this.apiKey}`; + } const response = await this.fetch(this.getEndpoint("api/generate"), { method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${this.apiKey}`, - }, + headers: headers, body: JSON.stringify(this._getGenerateOptions(options, prompt)), signal, }); @@ -384,13 +393,16 @@ class Ollama extends BaseLLM { })); chatOptions.stream = false; // Cannot set stream = true for tools calls } - + const headers: Record = { + "Content-Type": "application/json", + }; + + if (this.apiKey) { + headers.Authorization = `Bearer ${this.apiKey}`; + } const response = await this.fetch(this.getEndpoint("api/chat"), { method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${this.apiKey}`, - }, + headers: headers, body: JSON.stringify(chatOptions), signal, }); @@ -467,12 +479,16 @@ class Ollama extends BaseLLM { signal: AbortSignal, options: CompletionOptions, ): AsyncGenerator { + const headers: Record = { + "Content-Type": "application/json", + }; + + if (this.apiKey) { + headers.Authorization = `Bearer ${this.apiKey}`; + } const response = await this.fetch(this.getEndpoint("api/generate"), { method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${this.apiKey}`, - }, + headers: headers, body: JSON.stringify(this._getGenerateOptions(options, prefix, suffix)), signal, }); @@ -504,11 +520,19 @@ class Ollama extends BaseLLM { } async listModels(): Promise { + const headers: Record = { + "Content-Type": "application/json", + }; + + if (this.apiKey) { + headers.Authorization = `Bearer ${this.apiKey}`; + } const response = await this.fetch( // localhost was causing fetch failed in pkg binary only for this Ollama endpoint this.getEndpoint("api/tags"), { method: "GET", + headers: headers, }, ); const data = await response.json(); @@ -522,16 +546,20 @@ class Ollama extends BaseLLM { } protected async _embed(chunks: string[]): Promise { + const headers: Record = { + "Content-Type": "application/json", + }; + + if (this.apiKey) { + headers.Authorization = `Bearer ${this.apiKey}`; + } const resp = await this.fetch(new URL("api/embed", this.apiBase), { method: "POST", body: JSON.stringify({ model: this.model, input: chunks, }), - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${this.apiKey}`, - }, + headers: headers }); if (!resp.ok) { diff --git a/core/llm/llms/TransformersJsEmbeddingsProvider.ts b/core/llm/llms/TransformersJsEmbeddingsProvider.ts index 206d534d3..d17c9e0f1 100644 --- a/core/llm/llms/TransformersJsEmbeddingsProvider.ts +++ b/core/llm/llms/TransformersJsEmbeddingsProvider.ts @@ -43,6 +43,7 @@ export class TransformersJsEmbeddingsProvider extends BaseLLM { static maxGroupSize: number = 1; static model: string = "all-MiniLM-L6-v2"; static mockVector: number[] = Array.from({ length: 384 }).fill(2) as number[]; + static title: string = "Transformers.js (Built-In)"; static defaultOptions: Partial | undefined = { model: TransformersJsEmbeddingsProvider.model, diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts index 20bc8b710..32cda4aec 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -19,6 +19,7 @@ import Cohere from "./Cohere"; import DeepInfra from "./DeepInfra"; import Deepseek from "./Deepseek"; import Fireworks from "./Fireworks"; +import NCompass from "./NCompass"; import Flowise from "./Flowise"; import FreeTrial from "./FreeTrial"; import FunctionNetwork from "./FunctionNetwork"; @@ -81,6 +82,7 @@ export const LLMClasses = [ Flowise, Groq, Fireworks, + NCompass, ContinueProxy, Cloudflare, Deepseek, diff --git a/core/llm/llms/stubs/ContinueProxy.ts b/core/llm/llms/stubs/ContinueProxy.ts index 848b3fff7..00ec93dbc 100644 --- a/core/llm/llms/stubs/ContinueProxy.ts +++ b/core/llm/llms/stubs/ContinueProxy.ts @@ -1,3 +1,5 @@ +import { ContinueProperties } from "@continuedev/config-yaml"; + import { ControlPlaneProxyInfo } from "../../../control-plane/analytics/IAnalyticsProvider.js"; import { Telemetry } from "../../../util/posthog.js"; import OpenAI from "../OpenAI.js"; @@ -7,7 +9,12 @@ import type { Chunk, LLMOptions } from "../../../index.js"; class ContinueProxy extends OpenAI { set controlPlaneProxyInfo(value: ControlPlaneProxyInfo) { this.apiKey = value.workOsAccessToken; - this.apiBase = new URL("openai/v1/", value.controlPlaneProxyUrl).toString(); + if (!this.onPremProxyUrl) { + this.apiBase = new URL( + "openai/v1/", + value.controlPlaneProxyUrl, + ).toString(); + } } // The apiKey and apiBase are set to the values for the proxy, @@ -19,6 +26,11 @@ class ContinueProxy extends OpenAI { super(options); this.actualApiBase = options.apiBase; this.apiKeyLocation = options.apiKeyLocation; + this.orgScopeId = options.orgScopeId; + this.onPremProxyUrl = options.onPremProxyUrl; + if (this.onPremProxyUrl) { + this.apiBase = new URL("openai/v1/", this.onPremProxyUrl).toString(); + } } static providerName = "continue-proxy"; @@ -27,11 +39,13 @@ class ContinueProxy extends OpenAI { }; protected extraBodyProperties(): Record { + const continueProperties: ContinueProperties = { + apiKeyLocation: this.apiKeyLocation, + apiBase: this.actualApiBase, + orgScopeId: this.orgScopeId ?? null, + }; return { - continueProperties: { - apiKeyLocation: this.apiKeyLocation, - apiBase: this.actualApiBase, - }, + continueProperties, }; } diff --git a/core/package-lock.json b/core/package-lock.json index b6285e5e2..abe4271f8 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -13,13 +13,13 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.31", + "@continuedev/config-yaml": "^1.0.52", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", "@modelcontextprotocol/sdk": "^1.5.0", "@mozilla/readability": "^0.5.0", - "@octokit/rest": "^20.0.2", + "@octokit/rest": "^20.1.1", "@typescript-eslint/eslint-plugin": "^7.8.0", "@xenova/transformers": "2.14.0", "adf-to-md": "^1.1.0", @@ -72,7 +72,7 @@ "wink-nlp-utils": "^2.1.0", "workerpool": "^9.1.3", "yaml": "^2.4.2", - "zod": "^3.23.8" + "zod": "^3.24.2" }, "devDependencies": { "@babel/preset-env": "^7.24.7", @@ -3038,13 +3038,13 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.31", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.31.tgz", - "integrity": "sha512-HNj+z7UTTARgsJTI0A1buM09fS4HoWVnn6Hbl6kJ2tZmOOm1OgogbcKP68AzHb4fy5H18MWnKS7XuseZpHFzHQ==", + "version": "1.0.52", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.52.tgz", + "integrity": "sha512-x0m4bcQpjHrrv95cq5tsen4Hb6yKCVGn+NeojyzNQYnRD0If/On+ATgX78uXtQtZxsdO4ip73HHCyQlA0O3ZyQ==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", - "zod": "^3.23.8" + "zod": "^3.24.2" } }, "node_modules/@continuedev/fetch": { @@ -4232,14 +4232,6 @@ "node": ">=18" } }, - "node_modules/@modelcontextprotocol/sdk/node_modules/zod": { - "version": "3.24.1", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz", - "integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema": { "version": "3.24.1", "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.1.tgz", @@ -6829,6 +6821,14 @@ "devtools-protocol": "*" } }, + "node_modules/chromium-bidi/node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/ci-info": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", @@ -13691,6 +13691,14 @@ "node": ">=10" } }, + "node_modules/puppeteer-chromium-resolver/node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/puppeteer-core": { "version": "22.15.0", "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-22.15.0.tgz", @@ -16268,9 +16276,9 @@ } }, "node_modules/zod": { - "version": "3.23.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", - "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "version": "3.24.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", + "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==", "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/core/package.json b/core/package.json index 37a5b8a3e..a88bf0cf1 100644 --- a/core/package.json +++ b/core/package.json @@ -46,13 +46,13 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.31", + "@continuedev/config-yaml": "^1.0.52", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", "@modelcontextprotocol/sdk": "^1.5.0", "@mozilla/readability": "^0.5.0", - "@octokit/rest": "^20.0.2", + "@octokit/rest": "^20.1.1", "@typescript-eslint/eslint-plugin": "^7.8.0", "@xenova/transformers": "2.14.0", "adf-to-md": "^1.1.0", @@ -105,7 +105,7 @@ "wink-nlp-utils": "^2.1.0", "workerpool": "^9.1.3", "yaml": "^2.4.2", - "zod": "^3.23.8" + "zod": "^3.24.2" }, "engine-strict": true, "engines": { diff --git a/core/promptFiles/v1/getContextProviderHelpers.ts b/core/promptFiles/v1/getContextProviderHelpers.ts index e027ffbc5..30b51bf8b 100644 --- a/core/promptFiles/v1/getContextProviderHelpers.ts +++ b/core/promptFiles/v1/getContextProviderHelpers.ts @@ -19,12 +19,12 @@ export function getContextProviderHelpers( async (helperContext: any) => { const items = await provider.getContextItems(helperContext, { config: context.config, - embeddingsProvider: context.config.embeddingsProvider, + embeddingsProvider: context.config.selectedModelByRole.embed, fetch: context.fetch, fullInput: context.input, ide: context.ide, llm: context.llm, - reranker: context.config.reranker, + reranker: context.config.selectedModelByRole.rerank, selectedCode: context.selectedCode, }); diff --git a/core/protocol/core.ts b/core/protocol/core.ts index 96eebce84..ac991622a 100644 --- a/core/protocol/core.ts +++ b/core/protocol/core.ts @@ -1,10 +1,11 @@ -import { ConfigResult } from "@continuedev/config-yaml"; +import { ConfigResult, ModelRole } from "@continuedev/config-yaml"; import { AutocompleteInput } from "../autocomplete/util/types"; import { ProfileDescription } from "../config/ConfigHandler"; import { OrganizationDescription } from "../config/ProfileLifecycleManager"; import { SharedConfigSchema } from "../config/sharedConfig"; +import { DevDataLogEvent } from "@continuedev/config-yaml"; import type { BrowserSerializedContinueConfig, ChatMessage, @@ -27,6 +28,7 @@ import type { SiteIndexingConfig, ToolCall, } from "../"; +import { GlobalContextModelSelections } from "../util/GlobalContext"; export type OnboardingModes = "Local" | "Best" | "Custom" | "Quickstart"; @@ -36,8 +38,6 @@ export interface ListHistoryOptions { } export type ToCoreFromIdeOrWebviewProtocol = { - "update/selectTabAutocompleteModel": [string, void]; - // Special ping: [string, string]; abort: [undefined, void]; @@ -47,7 +47,7 @@ export type ToCoreFromIdeOrWebviewProtocol = { "history/delete": [{ id: string }, void]; "history/load": [{ id: string }, Session]; "history/save": [Session, void]; - "devdata/log": [{ tableName: string; data: any }, void]; + "devdata/log": [DevDataLogEvent, void]; "config/addOpenAiKey": [string, void]; "config/addModel": [ { @@ -69,8 +69,17 @@ export type ToCoreFromIdeOrWebviewProtocol = { "config/addContextProvider": [ContextProviderWithParams, void]; "config/reload": [undefined, ConfigResult]; "config/listProfiles": [undefined, ProfileDescription[] | null]; + "config/refreshProfiles": [undefined, void]; "config/openProfile": [{ profileId: string | undefined }, void]; - "config/updateSharedConfig": [SharedConfigSchema, void]; + "config/updateSharedConfig": [SharedConfigSchema, SharedConfigSchema]; + "config/updateSelectedModel": [ + { + profileId: string; + role: ModelRole; + title: string | null; + }, + GlobalContextModelSelections, + ]; "context/getContextItems": [ { name: string; @@ -99,6 +108,7 @@ export type ToCoreFromIdeOrWebviewProtocol = { params: any; historyIndex: number; selectedCode: RangeInFile[]; + completionOptions?: LLMFullCompletionOptions; }, AsyncGenerator, ]; diff --git a/core/protocol/ideWebview.ts b/core/protocol/ideWebview.ts index 3598e06ea..a7cd16e5b 100644 --- a/core/protocol/ideWebview.ts +++ b/core/protocol/ideWebview.ts @@ -49,11 +49,11 @@ export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & { acceptDiff: [{ filepath: string; streamId?: string }, void]; rejectDiff: [{ filepath: string; streamId?: string }, void]; "edit/sendPrompt": [ - { prompt: MessageContent; range: RangeInFileWithContents }, - void, - ]; - "edit/acceptReject": [ - { accept: boolean; onlyFirst: boolean; filepath: string }, + { + prompt: MessageContent; + range: RangeInFileWithContents; + selectedModelTitle: string; + }, void, ]; "edit/exit": [{ shouldFocusEditor: boolean }, void]; diff --git a/core/protocol/passThrough.ts b/core/protocol/passThrough.ts index f0c66f465..ef71c66a1 100644 --- a/core/protocol/passThrough.ts +++ b/core/protocol/passThrough.ts @@ -22,8 +22,10 @@ export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] = "config/getSerializedProfileInfo", "config/deleteModel", "config/listProfiles", + "config/refreshProfiles", "config/openProfile", "config/updateSharedConfig", + "config/updateSelectedModel", "context/getContextItems", "context/getSymbolsForFiles", "context/loadSubmenuItems", diff --git a/core/util/GlobalContext.test.ts b/core/util/GlobalContext.test.ts index 0d6b9d799..b13f3b87b 100644 --- a/core/util/GlobalContext.test.ts +++ b/core/util/GlobalContext.test.ts @@ -29,12 +29,6 @@ describe("GlobalContext", () => { expect(value).toBe(true); }); - it("should update and get a string value correctly", () => { - globalContext.update("selectedTabAutocompleteModel", "test-model"); - const value = globalContext.get("selectedTabAutocompleteModel"); - expect(value).toBe("test-model"); - }); - it("should update and get an object value correctly", () => { const workspaceIdentifier = "workspace-1"; globalContext.update("lastSelectedProfileForWorkspace", { @@ -108,13 +102,9 @@ describe("GlobalContext", () => { it("should update and retrieve multiple values correctly", () => { globalContext.update("indexingPaused", true); - globalContext.update("selectedTabAutocompleteModel", "test-model"); globalContext.update("hasDismissedConfigTsNoticeJetBrains", false); expect(globalContext.get("indexingPaused")).toBe(true); - expect(globalContext.get("selectedTabAutocompleteModel")).toBe( - "test-model", - ); expect(globalContext.get("hasDismissedConfigTsNoticeJetBrains")).toBe( false, ); diff --git a/core/util/GlobalContext.ts b/core/util/GlobalContext.ts index 34c3d8ddf..06cede64c 100644 --- a/core/util/GlobalContext.ts +++ b/core/util/GlobalContext.ts @@ -1,5 +1,8 @@ import fs from "node:fs"; +import { ModelRole } from "@continuedev/config-yaml"; + +import { SiteIndexingConfig } from ".."; import { salvageSharedConfig, sharedConfigSchema, @@ -7,17 +10,22 @@ import { } from "../config/sharedConfig"; import { getGlobalContextFilePath } from "./paths"; -import { SiteIndexingConfig } from ".."; + +export type GlobalContextModelSelections = Partial< + Record +>; export type GlobalContextType = { indexingPaused: boolean; - selectedTabAutocompleteModel: string; lastSelectedProfileForWorkspace: { [workspaceIdentifier: string]: string | null; }; lastSelectedOrgIdForWorkspace: { [workspaceIdentifier: string]: string | null; }; + selectedModelsByProfileId: { + [profileId: string]: GlobalContextModelSelections; + }; /** * This is needed to handle the case where a JetBrains user has created @@ -113,4 +121,23 @@ export class GlobalContext { this.update("sharedConfig", updatedSharedConfig); return updatedSharedConfig; } + + updateSelectedModel( + profileId: string, + role: ModelRole, + title: string | null, + ): GlobalContextModelSelections { + const currentSelections = this.get("selectedModelsByProfileId") ?? {}; + const forProfile = currentSelections[profileId] ?? {}; + const newSelections = { + ...forProfile, + [role]: title, + }; + + this.update("selectedModelsByProfileId", { + ...currentSelections, + [profileId]: newSelections, + }); + return newSelections; + } } diff --git a/core/util/devdata.ts b/core/util/devdata.ts deleted file mode 100644 index 3f786fa84..000000000 --- a/core/util/devdata.ts +++ /dev/null @@ -1,9 +0,0 @@ -import fs from "fs"; - -import { getDevDataFilePath } from "./paths.js"; - -export function logDevData(tableName: string, data: any) { - const filepath: string = getDevDataFilePath(tableName); - const jsonLine = JSON.stringify(data); - fs.writeFileSync(filepath, `${jsonLine}\n`, { flag: "a" }); -} diff --git a/core/util/paths.ts b/core/util/paths.ts index a8861befa..9a4c77bb2 100644 --- a/core/util/paths.ts +++ b/core/util/paths.ts @@ -8,6 +8,7 @@ import dotenv from "dotenv"; import { IdeType, SerializedContinueConfig } from "../"; import { defaultConfig, defaultConfigJetBrains } from "../config/default"; import Types from "../config/types"; +import { DevEventName } from "@continuedev/config-yaml"; dotenv.config(); @@ -202,7 +203,7 @@ export function getContinueRcPath(): string { return continuercPath; } -export function devDataPath(): string { +function getDevDataPath(): string { const sPath = path.join(getContinueGlobalPath(), "dev_data"); if (!fs.existsSync(sPath)) { fs.mkdirSync(sPath); @@ -211,11 +212,18 @@ export function devDataPath(): string { } export function getDevDataSqlitePath(): string { - return path.join(devDataPath(), "devdata.sqlite"); + return path.join(getDevDataPath(), "devdata.sqlite"); } -export function getDevDataFilePath(fileName: string): string { - return path.join(devDataPath(), `${fileName}.jsonl`); +export function getDevDataFilePath( + eventName: DevEventName, + schema: string, +): string { + const versionPath = path.join(getDevDataPath(), schema); + if (!fs.existsSync(versionPath)) { + fs.mkdirSync(versionPath); + } + return path.join(versionPath, `${String(eventName)}.jsonl`); } export function editConfigJson( @@ -377,23 +385,33 @@ export function getEsbuildBinaryPath(): string { return path.join(getContinueUtilsPath(), "esbuild"); } -export function getStagingEnvironmentDotFilePath(): string { - return path.join(getContinueGlobalPath(), ".staging"); +export function migrateV1DevDataFiles() { + const devDataPath = getDevDataPath(); + function moveToV1FolderIfExists( + oldFileName: string, + newFileName: DevEventName, + ) { + const oldFilePath = path.join(devDataPath, `${oldFileName}.jsonl`); + if (fs.existsSync(oldFilePath)) { + const newFilePath = getDevDataFilePath(newFileName, "0.1.0"); + if (!fs.existsSync(newFilePath)) { + fs.copyFileSync(oldFilePath, newFilePath); + fs.unlinkSync(oldFilePath); + } else { + console.warn( + `V1 Dev data migration: ${newFilePath} already exists, skipping ${oldFileName}`, + ); + } + } + } + moveToV1FolderIfExists("tokens_generated", "tokensGenerated"); + moveToV1FolderIfExists("chat", "chatFeedback"); + moveToV1FolderIfExists("quickEdit", "quickEdit"); + moveToV1FolderIfExists("autocomplete", "autocomplete"); } -export function setupInitialDotContinueDirectory() { - const devDataTypes = [ - "chat", - "autocomplete", - "quickEdit", - "tokens_generated", - ]; - devDataTypes.forEach((p) => { - const devDataPath = getDevDataFilePath(p); - if (!fs.existsSync(devDataPath)) { - fs.writeFileSync(devDataPath, ""); - } - }); +export function getStagingEnvironmentDotFilePath(): string { + return path.join(getContinueGlobalPath(), ".staging"); } export function getDiffsDirectoryPath(): string { diff --git a/docs/docs/actions/context-selection.md b/docs/docs/actions/context-selection.md index 4e154dcd3..90bc7c0d2 100644 --- a/docs/docs/actions/context-selection.md +++ b/docs/docs/actions/context-selection.md @@ -9,10 +9,6 @@ sidebar_position: 3 Slash commands can be combined with additional instructions, including [context providers](../customize/context-providers.mdx) or [highlighted code](../edit/context-selection#highlighted-code). -For example, with the “/edit” slash command you should describe the edit that you want the LLM to perform. - -Some slash commands will not acknowledge your input; for example, the “/share” slash command just creates a markdown copy of the current conversation, regardless of what else you may request it to do. - ## Quick actions Quick actions are always displayed above a class or function and will edit that class or function, but nothing outside of it. diff --git a/docs/docs/actions/how-it-works.mdx b/docs/docs/actions/how-it-works.mdx index 90bd4bb20..afacc3dbe 100644 --- a/docs/docs/actions/how-it-works.mdx +++ b/docs/docs/actions/how-it-works.mdx @@ -7,6 +7,6 @@ sidebar_position: 4 While many Actions are based on templated prompts and can be customized with .prompt files, there are a number that execute more complex code under the hood. -Actions that generate inline diffs, like “/edit”, “/comment”, or right click actions, use the same prompt and response processing logic as [Edit](../edit/how-it-works.md). +Right click actions that generate inline diffs, use the same prompt and response processing logic as [Edit](../edit/how-it-works.md). To learn how other slash commands work, see the full reference [here](../customize/slash-commands.mdx). diff --git a/docs/docs/actions/how-to-customize.md b/docs/docs/actions/how-to-customize.md index 9153a38b0..2f13e4f1a 100644 --- a/docs/docs/actions/how-to-customize.md +++ b/docs/docs/actions/how-to-customize.md @@ -5,49 +5,6 @@ keywords: [customize, actions] sidebar_position: 5 --- -## Built-in slash commands +The easiest way to add actions is by adding [`prompt` blocks](../hub/blocks/block-types.md#prompts) to your assistant, which show up as slash commands in [Chat](../chat/how-it-works.md). -Continue has a large library of built-in slash commands, but when you first install we only display the most commonly used ones, like “/edit”, “/comment”, and “/share”. To add more actions, you can open [config.json](../json-reference.md) and add them to the `slashCommands` array. - -## Custom slash commands - -There are two ways to add custom slash commands: - -1. With `.prompt` files - this is recommended in most cases. See the full reference [here](../customize/deep-dives/prompt-files.md). -2. With `config.ts` - this gives you full programmatic access to the LLM, IDE, and other important entities by writing a JavaScript/TypeScript function - -### Custom Slash Commands with `config.ts` - -If you want to go a step further than writing custom commands with natural language, you can write a custom function that returns the response. This requires using `config.ts` instead of `config.json`. - -To do this, push a new `SlashCommand` object to the `slashCommands` list. This object contains "name", the name that you will type to invoke the slash command, "description", the description seen in the dropdown menu, and "run". The `run` function is any async generator that should yield strings as you want them to be streamed to the UI. As an argument to the function, you have access to a `ContinueSDK` object with utilities such as access to certain information/actions within the IDE, the current language model, and a few other utilities. For example, here is a slash command that generates a commit message: - -```typescript title="config.ts" -export function modifyConfig(config: Config): Config { - config.slashCommands?.push({ - name: "commit", - description: "Write a commit message", - run: async function* (sdk) { - // The getDiff function takes a boolean parameter that indicates whether - // to include unstaged changes in the diff or not. - const diff = await sdk.ide.getDiff(false); // Pass false to exclude unstaged changes - for await (const message of sdk.llm.streamComplete( - `${diff}\n\nWrite a commit message for the above changes. Use no more than 20 tokens to give a brief description in the imperative mood (e.g. 'Add feature' not 'Added feature'):`, - new AbortController().signal, - { - maxTokens: 20, - }, - )) { - yield message; - } - }, - }); - return config; -} -``` - -## Other custom actions - -Currently the other action triggers are not open for configuration, but we plan to allow this via .prompt files in the future. - - +Check out the [slash commands deep dive](../customize/slash-commands.mdx) for more information on extending actions. diff --git a/docs/docs/actions/how-to-use-it.md b/docs/docs/actions/how-to-use-it.md index 018a7c941..d69ec3851 100644 --- a/docs/docs/actions/how-to-use-it.md +++ b/docs/docs/actions/how-to-use-it.md @@ -14,43 +14,23 @@ Actions are shortcuts for common use cases. For example, you might want to revie ### Slash commands -The most common way to invoke an action is with a slash command. These are shortcuts that can be activated by typing '/' in a chat session (press cmd/ctrl + L (VS Code) or cmd/ctrl + J (JetBrains)), and selecting from the dropdown. For example, the built-in '/edit' slash command lets you stream edits directly into your editor. +The most common way to invoke an action is with a slash command. These are shortcuts that can be activated by typing '/' in a chat session (press cmd/ctrl + L (VS Code) or cmd/ctrl + J (JetBrains)), and selecting from the dropdown. ![slash-commands](/img/slash-commands.png) -A few of the most useful slash commands are available by default, like “/edit”, “/comment”, and “/share”, but Continue has a large built-in library of other options. To enable these, learn more [here](../customize/slash-commands.mdx). +In YAML assistants, slash commands are generated from [`prompts` blocks](../hub/blocks/block-types.md#prompts). + +Learn more about slash commands [here](../customize/slash-commands.mdx). + +:::info +Important: For assistants, slash commands only come from `prompts` blocks. When using older `config.json` configuration, other slash commands like `/share` and `/cmd` are included by default. +::: ### Prompt files It is also possible to write your own slash command by defining a “.prompt file.” Prompt files can be as simple as a text file, but also include templating so that you can refer to files, URLs, highlighted code, and more. -The full .prompt file reference can be found [here](../customize/deep-dives/prompt-files.md). - -:::tip[Prompt library] -To assist you in getting started, [we've curated a small library of `.prompt` files](https://github.com/continuedev/prompt-file-examples). We encourage community contributions to this repository, so please consider opening up a pull request with your own prompts! -::: - -Below is a quick example of setting up a prompt file to write unit tests using Jest. - -1. Create a folder called `.prompts/` at the top level of your workspace. -2. Add a file called `test.prompt` to this folder. The name of this file will be the name of the slash command you will use to generate your prompt. -3. Write the following contents to `test.prompt` and save. - -```.prompt -{{{ 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` -``` - -Now to use this prompt, you can highlight code and use cmd/ctrl + L to select it in the Continue sidebar. - -Then, type "/" to see the list of slash commands and choose the one called "test". Press enter and the LLM will respond given the instructions from your prompt file. +Learn more about prompt files [here](../customize/deep-dives/prompt-files.md) ### Other triggers for Actions (VS Code) diff --git a/docs/docs/actions/model-setup.md b/docs/docs/actions/model-setup.md index 7dd9a0213..91912dcbf 100644 --- a/docs/docs/actions/model-setup.md +++ b/docs/docs/actions/model-setup.md @@ -5,4 +5,6 @@ keywords: [model] sidebar_position: 2 --- -By default, Actions uses the same model as [Chat](chat/model-setup.mdx) since we recommend a similar, 400B+ parameter model or one of the frontier models for the complex instructions that will be carried out. +By default, Actions uses the same model as [Chat](chat/model-setup.mdx), since we recommend a similar, 400B+ parameter model or one of the frontier models for the complex instructions that will be carried out. + +You can also set specific models to be used for Edit and Apply actions. See the [Model roles](../customize/model-roles/intro.mdx) page for more details. diff --git a/docs/docs/autocomplete/how-to-customize.md b/docs/docs/autocomplete/how-to-customize.md index abf4c5b11..db77a43f0 100644 --- a/docs/docs/autocomplete/how-to-customize.md +++ b/docs/docs/autocomplete/how-to-customize.md @@ -5,20 +5,6 @@ keywords: [customize] sidebar_position: 5 --- -Continue offers a handful of parameters in [`config.json`](../json-reference.md) that can be tuned to find the perfect balance between suggestion quality and system performance for your specific needs and hardware capabilities: - -```json title="config.json" -{ - "tabAutocompleteOptions": { - "maxPromptTokens": 400, - "prefixPercentage": 0.5, - "multilineCompletions": "always" - } -} -``` - -- `maxPromptTokens`: Sets the maximum number of tokens for the prompt, balancing context and speed. -- `prefixPercentage`: Defines the proportion of the prompt dedicated to the code before the cursor. -- `multilineCompletions`: Controls whether suggestions can span multiple lines ("always", "never", or "auto"). +Continue offers a handful of settings to customize autocomplete behavior. For the most part, these options can be found in the [User Settings Page](../customize/settings.md). For a comprehensive guide on all configuration options and their impacts, see the [Autocomplete deep dive](../customize/deep-dives/autocomplete.mdx). diff --git a/docs/docs/autocomplete/how-to-use-it.md b/docs/docs/autocomplete/how-to-use-it.md index 5fd127ce5..b9b3c19d2 100644 --- a/docs/docs/autocomplete/how-to-use-it.md +++ b/docs/docs/autocomplete/how-to-use-it.md @@ -2,7 +2,7 @@ title: Autocomplete description: Autocomplete \- how to use it sidebar_label: How to use it -keywords: [how] +keywords: [autocomplete] sidebar_position: 1 --- diff --git a/docs/docs/autocomplete/model-setup.mdx b/docs/docs/autocomplete/model-setup.mdx index 8d37d39be..aa05e3c31 100644 --- a/docs/docs/autocomplete/model-setup.mdx +++ b/docs/docs/autocomplete/model-setup.mdx @@ -5,111 +5,13 @@ keywords: [model, autocomplete] sidebar_position: 2 --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; -:::info -This page recommends models and providers for Autocomplete. Read more about how to set up your `config.yaml` [here](../reference.md). -::: +For the best autocomplete experience we recommend Codestral from Mistral. -## Best overall experience +Add Codestral to your assistant from the hub [here](https://hub.continue.dev/mistral/codestral). Visit the [Mistral Platform](https://console.mistral.ai/codestral) to get a Codestral API key. -For the best Autocomplete experience, we recommend using Codestral through the [Mistral API](https://console.mistral.ai/). This model offers high-quality completions with an excellent understanding of code context: +For a fully local autocomplete experience, we recommend [Qwen 2.5 Coder 1.5B on Ollama](https://hub.continue.dev/ollama/qwen2.5-coder-1.5b). - - - ```yaml title="config.yaml" - models: - - name: Codestral - provider: mistral - model: codestral-latest - apiKey: - roles: - - autocomplete - ``` - - - ```json title="config.json" - { - "tabAutocompleteModel": { - "title": "Codestral", - "provider": "mistral", - "model": "codestral-latest", - "apiKey": "" - } - } - ``` - - - -:::tip[Codestral API Key] -The API keys for Codestral and the general Mistral APIs are different. If you are using Codestral, you probably want a Codestral API key, but if you are sharing the key as a team or otherwise want to use `api.mistral.ai`, then make sure to set `"apiBase": "https://api.mistral.ai/v1"` in your `tabAutocompleteModel`. -::: - -## Local, offline / self-hosted experience - -For those preferring local execution or self-hosting,`Qwen2.5-Coder 1.5B` offers a good balance of performance and quality for most users (e.g. using [Ollama](../customize/model-providers/top-level/ollama.mdx) or [LM Studio](../customize/model-providers/more/lmstudio.mdx)). - - - - ```yaml title="config.yaml" - models: - - name: Qwen2.5-Coder 1.5B - model: qwen2.5-coder:1.5b-base - provider: ollama - roles: - - autocomplete - ``` - - - ```json title="config.json" - { - "tabAutocompleteModel": { - "title": "Qwen2.5-Coder 1.5B", - "model": "qwen2.5-coder:1.5b-base", - "provider": "ollama" - } - } - ``` - - - -Have more compute? Use `qwen2.5-coder:7b-base` for potentially higher-quality suggestions. - -:::note -For LM Studio users, navigate to the "My Models" section, find your desired model, and copy the path (e.g., `Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf`). Use this path as the `model` value in your configuration. -::: - -### Using a remote instance - -When using a remote instance you need to set the `"apiBase"` value in the configuration: - - - - ```yaml title="config.yaml" - models: - - name: Qwen2.5-Coder 1.5B - model: qwen2.5-coder:1.5b-base - provider: ollama - apiBase: http://:11434 - roles: - - autocomplete - ``` - - - ```json title="config.json" - { - "tabAutocompleteModel": { - "title": "Qwen2.5-Coder 1.5B", - "model": "qwen2.5-coder:1.5b-base", - "provider": "ollama", - "apiBase": "http://:11434" - } - } - ``` - - - -## Other experiences - -There are many more models and providers you can use with Autocomplete. Check them out [here](../customize/model-types/autocomplete.md). You can also see more examples of Autocomplete configuration [here](../customize/deep-dives/autocomplete.mdx) +For more details about setup and recommended models, visit the [autocomplete deep dive](../customize/deep-dives/autocomplete.mdx). diff --git a/docs/docs/chat/context-selection.md b/docs/docs/chat/context-selection.md index 65b76c72a..ee427cf0a 100644 --- a/docs/docs/chat/context-selection.md +++ b/docs/docs/chat/context-selection.md @@ -43,4 +43,4 @@ You can include all of the changes you've made to your current branch by typing ## Other context -You can see a full list of built-in context providers [here](../customize/context-providers.mdx) and how to create your own custom context provider [here](../customize/tutorials/build-your-own-context-provider.md). +You can see a full list of built-in context providers [here](../customize/context-providers.mdx) and how to create your own custom context provider [here](../customize/tutorials/build-your-own-context-provider.mdx). diff --git a/docs/docs/chat/how-to-customize.md b/docs/docs/chat/how-to-customize.md index 3fcb7376f..acb357983 100644 --- a/docs/docs/chat/how-to-customize.md +++ b/docs/docs/chat/how-to-customize.md @@ -5,11 +5,11 @@ keywords: [customize, chat] sidebar_position: 5 --- -There are a number of different ways to customize Chat +There are a number of different ways to customize Chat: -- You can add a [`.continuerules`](../customize/deep-dives/rules.md) file to the root of your project to customize the system prompt +- You can add a [`rules` block](../hub/blocks/block-types.md#rules) to your assistant to give the model persistent instructions through the system prompt. See the [rules deep dive](../customize/deep-dives/rules.md) for more information. - You can configure [`@Codebase`](../customize/deep-dives/codebase.mdx) -- You can create your own [custom code RAG](../customize/tutorials/custom-code-rag.mdx) - You can configure [`@Docs`](../customize/deep-dives/docs.mdx) -- You can [build your own context provider](../customize/tutorials/build-your-own-context-provider.md) - You can configure and create custom [tools](../customize/tools.mdx) +- You can [build your own context provider](../customize/tutorials/build-your-own-context-provider.mdx) +- You can create your own [custom code RAG](../customize/tutorials/custom-code-rag.mdx) diff --git a/docs/docs/chat/model-setup.mdx b/docs/docs/chat/model-setup.mdx index 52dac63a2..8608f5e1d 100644 --- a/docs/docs/chat/model-setup.mdx +++ b/docs/docs/chat/model-setup.mdx @@ -5,359 +5,20 @@ keywords: [model] sidebar_position: 2 --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; -:::info -This page recommends models and providers for Chat. Read more about how to set up your config [here](../reference.md). -::: +For the best chat experience we recommend Claude 3.7 Sonnet from Anthropic. -## Best overall experience +Add Claude 3.7 Sonnet to your assistant from the hub [here](https://hub.continue.dev/anthropic/claude-3-7-sonnet). You can get an API key from the [Anthropic console](https://console.anthropic.com/settings/keys). -For the best overall Chat experience, you will want to use a 400B+ parameter model or one of the frontier models. +Other recommended chat models include: -### Claude Sonnet 3.5 from Anthropic +- [GPT-4o from OpenAI](https://hub.continue.dev/openai/gpt-4o) +- [Grok-2 from xAI](https://hub.continue.dev/xai/grok-2) +- [Gemini 2.0 Flash from Google](https://hub.continue.dev/google/gemini-2.0-flash) +- [Llama 3.1 8b from Meta on Ollama](https://hub.continue.dev/ollama/llama3.1-8b) for a fully local experience + {/* HUB_TODO nonexistent blocks */} + {/* - Deepseek Coder 2 from deepseek on [Ollama](https://hub.continue.dev/explore/models) or [LM Studio](https://hub.continue.dev/explore/models) */} -Our current top recommendation is Claude Sonnet 3.5 from [Anthropic](../customize/model-providers/top-level/anthropic.mdx). - - - - ```yaml title="Package or config.yaml" - models: - - name: Claude 3.5 Sonnet - provider: anthropic - model: claude-3-5-sonnet-latest - apiKey: - ``` - - - ```json title="config.json" - { - "models": [ - { - "title": "Claude 3.5 Sonnet", - "provider": "anthropic", - "model": "claude-3-5-sonnet-latest", - "apiKey": "" - } - ] - } - ``` - - - -### Llama 3.1 405B from Meta - -If you prefer to use an open-weight model, then Llama 3.1 405B from Meta is your best option right now. You will need to decide if you use it through a SaaS model provider (e.g. [Together](../customize/model-providers/more/together.mdx) or [Groq](../customize/model-providers/more/groq.mdx)) or self-host it (e.g. using [vLLM](../customize/model-providers//more/vllm.mdx) or [Ollama](../customize/model-providers/top-level/ollama.mdx)). - - - - - - ```yaml title="Package or config.yaml" - models: - - name: "Llama 3.1 405B" - provider: "together" - model: "llama3.1-405b" - apiKey: - ``` - - - ```yaml title="Package or config.yaml" - models: - - name: "Llama 3.1 405B" - provider: "groq" - model: "llama3.1-405b" - apiKey: - ``` - - - ```yaml title="Package or config.yaml" - models: - - name: "Llama 3.1 405B" - provider: "vllm" - model: "llama3.1-405b" - ``` - - - ```yaml title="Package or config.yaml" - models: - - name: "Llama 3.1 405B" - provider: "ollama" - model: "llama3.1:405b" - ``` - - - - - - - ```json title="config.json" - { - "models": [ - { - "title": "Llama 3.1 405B", - "provider": "together", - "model": "llama3.1-405b", - "apiKey": "" - } - ] - } - ``` - - - ```json title="config.json" - { - "models": [ - { - "title": "Llama 3.1 405B", - "provider": "groq", - "model": "llama3.1-405b", - "apiKey": "" - } - ] - } - ``` - - - ```json title="config.json" - { - "models": [ - { - "title": "Llama 3.1 405B", - "provider": "vllm", - "model": "llama3.1-405b" - } - ] - } - ``` - - - ```json title="config.json" - { - "models": [ - { - "title": "Llama 3.1 405B", - "provider": "ollama", - "model": "llama3.1:405b" - } - ] - } - ``` - - - - - -### GPT-4o from OpenAI - -If you prefer to use a model from [OpenAI](../customize/model-providers/top-level/openai.mdx), then we recommend GPT-4o. - - - - ```yaml title="Package or config.yaml" - models: - - name: GPT-4o - provider: openai - model: '' - apiKey: - ``` - - - ```json title="config.json" - { - "models": [ - { - "title": "GPT-4o", - "provider": "openai", - "model": "", - "apiKey": "" - } - ] - } - ``` - - - -### Grok-2 from xAI - -If you prefer to use a model from [xAI](../customize/model-providers/top-level/xAI.mdx), then we recommend Grok-2. - - - - ```yaml title="Package or config.yaml" - models: - - name: Grok-2 - provider: xAI - model: grok-2-latest - apiKey: - ``` - - - ```json title="config.json" - { - "models": [ - { - "title": "Grok-2", - "provider": "xAI", - "model": "grok-2-latest", - "apiKey": "" - } - ] - } - ``` - - - -### Gemini 1.5 Pro from Google - -If you prefer to use a model from [Google](../customize/model-providers/top-level/gemini.mdx), then we recommend Gemini 1.5 Pro. - - - - ```yaml title="Package or config.yaml" - models: - - name: Gemini 1.5 Pro - provider: gemini - model: gemini-1.5-pro-latest - apiKey: - ``` - - - ```json title="config.json" - { - "models": [ - { - "title": "Gemini 1.5 Pro", - "provider": "gemini", - "model": "gemini-1.5-pro-latest", - "apiKey": "" - } - ] - } - ``` - - - -## Local, offline experience - -For the best local, offline Chat experience, you will want to use a model that is large but fast enough on your machine. - -### Llama 3.1 8B - -If your local machine can run an 8B parameter model, then we recommend running Llama 3.1 8B on your machine (e.g. using [Ollama](../customize/model-providers/top-level/ollama.mdx) or [LM Studio](../customize/model-providers/more/lmstudio.mdx)). - - - - - - ```yaml title="Package or config.yaml" - models: - - name: Llama 3.1 8B - provider: ollama - model: llama3.1:8b - ``` - - - ```yaml title="Package or config.yaml" - models: - - name: Llama 3.1 8B - provider: lmstudio - model: llama3.1:8b - ``` - - - - - - - ```json title="config.json" - { - "models": [ - { - "title": "Llama 3.1 8B", - "provider": "ollama", - "model": "llama3.1:8b" - } - ] - } - ``` - - - ```json title="config.json" - { - "models": [ - { - "title": "Llama 3.1 8B", - "provider": "lmstudio", - "model": "llama3.1-8b" - } - ] - } - ``` - - - - - -### DeepSeek Coder 2 16B - -If your local machine can run a 16B parameter model, then we recommend running DeepSeek Coder 2 16B (e.g. using [Ollama](../customize/model-providers/top-level/ollama.mdx) or [LM Studio](../customize/model-providers/more/lmstudio.mdx)). - - - - - - ```yaml title="Package or config.yaml" - models: - - name: DeepSeek Coder 2 16B - provider: ollama - model: deepseek-coder-v2:16b - ``` - - - ```yaml title="Package or config.yaml" - models: - - name: DeepSeek Coder 2 16B - provider: lmstudio - model: deepseek-coder-v2:16b - ``` - - - - - - - ```json title="config.json" - { - "models": [ - { - "title": "DeepSeek Coder 2 16B", - "provider": "ollama", - "model": "deepseek-coder-v2:16b", - "apiBase": "http://localhost:11434" - } - ] - } - ``` - - - ```json title="config.json" - { - "models": [ - { - "title": "DeepSeek Coder 2 16B", - "provider": "lmstudio", - "model": "deepseek-coder-v2:16b" - } - ] - } - ``` - - - - - -## Other experiences - -There are many more models and providers you can use with Chat beyond those mentioned above. Read more [here](../customize/model-types/chat.md) +For more details about setup and recommended models, see [here](../customize/model-roles/chat.mdx). diff --git a/docs/docs/customize/context-providers.mdx b/docs/docs/customize/context-providers.mdx index fe64a473f..41c6edc57 100644 --- a/docs/docs/customize/context-providers.mdx +++ b/docs/docs/customize/context-providers.mdx @@ -4,8 +4,8 @@ description: Type '@' to select content to the LLM as context keywords: [context, "@", provider, LLM] --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; Context Providers allow you to type '@' and see a dropdown of content that can all be fed to the LLM as context. Every context provider is a plugin, which means if you want to reference some source of information that you don't see here, you can request (or build!) a new context provider. @@ -13,6 +13,10 @@ As an example, say you are working on solving a new GitHub Issue. You type '@Iss ![Context Items](/img/context-provider-example.png) +## Context blocks + +You can add context providers to assistants using [`context` blocks](../hub/blocks/block-types.md#context). Explore available context blocks in [the hub](https://hub.continue.dev/explore/context). + ## Built-in Context Providers You can add any built-in context-providers in your config file as shown below: @@ -23,7 +27,7 @@ Reference any file in your current workspace. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: file ``` @@ -47,7 +51,7 @@ Reference specific functions or classes from throughout your project. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: code ``` @@ -71,7 +75,7 @@ Reference all of the changes you've made to your current branch. This is useful - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: diff ``` @@ -95,7 +99,7 @@ Reference the currently open file. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: currentFile ``` @@ -119,7 +123,7 @@ Reference the last command you ran in your IDE's terminal and its output. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: terminal ``` @@ -143,7 +147,7 @@ Reference the contents from any documentation site. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: docs ``` @@ -171,7 +175,7 @@ Reference the contents of all of your open files. Set `onlyPinned` to `true` to - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: open params: @@ -202,7 +206,7 @@ Optionally, set `n` to limit the number of results returned (default 6). - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: web params: @@ -231,7 +235,7 @@ Reference the most relevant snippets from your codebase. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: codebase ``` @@ -257,7 +261,7 @@ Uses the same retrieval mechanism as `@Codebase`, but only on a single folder. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: folder ``` @@ -281,7 +285,7 @@ Reference the results of codebase search, just like the results you would get fr - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: search ``` @@ -307,7 +311,7 @@ Reference the markdown converted contents of a given URL. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: url ``` @@ -331,7 +335,7 @@ Reference recent clipboard items - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: clipboard ``` @@ -355,7 +359,7 @@ Reference the structure of your current workspace. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: tree ``` @@ -379,7 +383,7 @@ Get Problems from the current file. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: problems ``` @@ -403,7 +407,7 @@ Reference the contents of the local variables in the debugger. Currently only av - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: debugger params: @@ -436,7 +440,7 @@ Reference the outline of your codebase. By default, signatures are included alon - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: repo-map params: @@ -471,7 +475,7 @@ Reference the architecture and platform of your current operating system. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: os ``` @@ -495,7 +499,7 @@ The [Model Context Protocol](https://modelcontextprotocol.io/introduction) is a - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" mcpServers: - name: My MCP Server command: uvx @@ -536,7 +540,7 @@ Reference the conversation in a GitHub issue. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: issue params: @@ -576,7 +580,7 @@ Reference table schemas from Sqlite, Postgres, MSSQL, and MySQL databases. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: database params: @@ -661,7 +665,7 @@ Reference the schema of a table, and some sample rows - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: postgres params: @@ -708,7 +712,7 @@ Reference the results of a Google search. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: google params: @@ -741,7 +745,7 @@ Reference an open MR for this branch on GitLab. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: gitlab-mr params: @@ -772,7 +776,7 @@ You can specify the domain to communicate with by setting the `domain` parameter - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: gitlab-mr params: @@ -807,7 +811,7 @@ Reference the conversation in a Jira issue. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: jira params: @@ -842,7 +846,7 @@ to set the API Version to 2 using the `apiVersion` property. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: jira params: @@ -881,7 +885,7 @@ Reference the messages in a Discord channel. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: discord params: @@ -929,7 +933,7 @@ The HttpContextProvider makes a POST request to the url passed in the configurat - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: http params: @@ -986,7 +990,7 @@ Reference specific git commit metadata and diff or all of the recent commits. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: commit params: @@ -1020,7 +1024,7 @@ Query a [Greptile](https://www.greptile.com/) index of the current repo/branch. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: greptile params: diff --git a/docs/docs/customize/deep-dives/autocomplete.mdx b/docs/docs/customize/deep-dives/autocomplete.mdx index 6713e4653..c350b4d2c 100644 --- a/docs/docs/customize/deep-dives/autocomplete.mdx +++ b/docs/docs/customize/deep-dives/autocomplete.mdx @@ -3,14 +3,17 @@ title: Autocomplete keywords: [autocomplete] --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; ### Setting up with Codestral (recommended) If you want to have the best autocomplete experience, we recommend using Codestral, which is available through the [Mistral API](https://console.mistral.ai/). To do this, obtain an API key and add it to your config: - + + + [Mistral Codestral model block](https://hub.continue.dev/mistral/codestral) + ```yaml title="config.yaml" models: @@ -36,28 +39,30 @@ If you want to have the best autocomplete experience, we recommend using Codestr +:::tip[Codestral API Key] +The API keys for Codestral and the general Mistral APIs are different. If you are using Codestral, you probably want a Codestral API key, but if you are sharing the key as a team or otherwise want to use `api.mistral.ai`, then make sure to set `"apiBase": "https://api.mistral.ai/v1"` in your `tabAutocompleteModel`. +::: + ### Setting up with Ollama (default) If you'd like to run your autocomplete model locally, we recommend using Ollama. To do this, first download the latest version of Ollama from [here](https://ollama.ai). Then, run the following command to download our recommended model: ```bash -ollama run qwen2.5-coder:1.5b-base +ollama run qwen2.5-coder:1.5b ``` -Once it has been downloaded, you should begin to see completions in VS Code. +Then, add the model to your configuration: -### Setting up a custom model - -All of the configuration options available for chat models are available to use for tab-autocomplete. For example, if you wanted to use a remote Ollama instance you would edit your `config.json` like this (note that it is not inside the models array): - - + + + [Ollama Qwen 2.5 Coder 1.5B model block](https://hub.continue.dev/ollama/qwen2.5-coder-1.5b) + ```yaml title="config.yaml" models: - - name: Tab Autocomplete Model + - name: Qwen 1.5b Autocomplete Model provider: ollama - model: qwen2.5-coder:1.5b-base - apiBase: https:// + model: qwen2.5-coder:1.5b roles: - autocomplete ``` @@ -66,72 +71,34 @@ All of the configuration options available for chat models are available to use ```json title="config.json" { "tabAutocompleteModel": { - "title": "Tab Autocomplete Model", + "title": "Qwen 1.5b Autocomplete Model", "provider": "ollama", - "model": "qwen2.5-coder:1.5b-base", - "apiBase": "https://" + "model": "qwen2.5-coder:1.5b", } } ``` -If you aren't yet familiar with the available options, you can find the full reference [here](./configuration.md). +Once the model has been downloaded, you should begin to see completions in VS Code. ## Configuration Options -The following can be configured in `config.json`: +### Hub Autocomplete models -### `tabAutocompleteModel` +Explore autocomplete model configurations on [the hub](https://hub.continue.dev/explore/models?roles=autocomplete) -This is just another object like the ones in the `"models"` array of `config.json`. You can choose and configure any model you would like, but we strongly suggest using a small model made for tab-autocomplete, such as `deepseek-1b`, `qwen2.5-coder:1.5b`, or `starcoder2-3b`. +### Autocomplete User Settings -### `tabAutocompleteOptions` +The following settings can be configured for autocompletion in the IDE extension [User Settings Page](../settings.md): -This object allows you to customize the behavior of tab-autocomplete. The available options are shown below, and you can find their default values [here](https://github.com/continuedev/continue/blob/fbeb2e4fe15d4b434a30a136f74b672485c852d9/core/util/parameters.ts). +- `Use autocomplete cache`: If on, caches completions +- `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" -- `disable`: Disable autocomplete (can also be done from IDE settings) (default: `false`) -- `template`: 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. (String) -- `maxPromptTokens`: The maximum number of prompt tokens to use. A smaller number will yield faster completions, but less context. (Number) (default: `1024`) -- `prefixPercentage`: The percentage of the input that should be dedicated to the prefix. (Number) (default: `0.3`) -- `maxSuffixPercentage`: The maximum percentage of the prompt that can be dedicated to the suffix. (Number) (default: `0.2`) -- `debounceDelay`: The delay in milliseconds before triggering autocomplete after a keystroke. (Number) (default: `350`) -- `multilineCompletions`: Whether to enable multiline completions ("always", "never", or "auto"). Defaults to "auto". (default: `auto`) -- `useCache`: Whether to cache and reuse completions when the prompt is the same as a previous one. May be useful to disable for testing purposes. (default: `true`) -- `disableInFiles`: A list of glob patterns for files in which you want to disable tab autocomplete. (default: `[]`) +### `config.json` Configuration -### Full example - - - - ```yaml title="config.yaml" - models: - - name: Tab Autocomplete Model - provider: ollama - model: qwen2.5-coder:1.5b-base - apiBase: https:// - roles: - - autocomplete - ``` - - - ```json title="config.json" - { - "tabAutocompleteModel": { - "title": "Tab Autocomplete Model", - "provider": "ollama", - "model": "qwen2.5-coder:1.5b-base", - "apiBase": "https://" - }, - "tabAutocompleteOptions": { - "debounceDelay": 500, - "maxPromptTokens": 1500, - "disableInFiles": ["*.md"] - } - } - ``` - - +The `config.json` configuration format (deprecated) offers further configuration options through `tabAutocompleteOptions`. See the [JSON Reference](../../reference.md#tabautocompleteoptions) for more details. ## FAQs @@ -145,7 +112,7 @@ Follow these steps to ensure that everything is set up correctly: 1. Make sure you have the "Enable Tab Autocomplete" setting checked (in VS Code, you can toggle by clicking the "Continue" button in the status bar, and in JetBrains by going to Settings -> Tools -> Continue). 2. Make sure you have downloaded Ollama. -3. Run `ollama run qwen2.5-coder:1.5b-base` to verify that the model is downloaded. +3. Run `ollama run qwen2.5-coder:1.5b` to verify that the model is downloaded. 4. Make sure that any other completion providers are disabled (e.g. Copilot), as they may interfere. 5. Check the output of the logs to find any potential errors: cmd/ctrl + shift + P -> "Toggle Developer Tools" -> "Console" tab in VS Code, ~/.continue/logs/core.log in JetBrains. 6. Check VS Code settings to make sure that `"editor.inlineSuggest.enabled"` is set to `true` (use cmd/ctrl + , then search for this and check the box) diff --git a/docs/docs/customize/deep-dives/codebase.mdx b/docs/docs/customize/deep-dives/codebase.mdx index acf19c4fc..24256672e 100644 --- a/docs/docs/customize/deep-dives/codebase.mdx +++ b/docs/docs/customize/deep-dives/codebase.mdx @@ -3,15 +3,15 @@ description: Talk to your codebase keywords: [talk, embeddings, reranker, codebase, experimental] --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # @Codebase Continue indexes your codebase so that it can later automatically pull in the most relevant context from throughout your workspace. This is done via a combination of embeddings-based retrieval and keyword search. By default, all embeddings are calculated locally using `transformers.js` and stored locally in `~/.continue/index`. :::info[`transformers.js cannot be used in JetBrains`] -Currently, `transformers.js` cannot be used in JetBrains IDEs. However, you can select a differet embeddings model from [the list here](../model-types/embeddings.mdx). +Currently, `transformers.js` cannot be used in JetBrains IDEs. However, you can select a differet embeddings model from [the list here](../model-roles/embeddings.mdx). ::: Currently, the codebase retrieval feature is available as the "codebase" and "folder" context providers. You can use them by typing `@Codebase` or `@Folder` in the input box, and then asking a question. The contents of the input box will be compared with the embeddings from the rest of the codebase (or folder) to determine relevant files. @@ -45,7 +45,7 @@ There are a few options that let you configure the behavior of the `@codebase` c - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" context: - provider: codebase params: diff --git a/docs/docs/customize/deep-dives/configuration.md b/docs/docs/customize/deep-dives/configuration.md index c87ebfb1b..11522e86f 100644 --- a/docs/docs/customize/deep-dives/configuration.md +++ b/docs/docs/customize/deep-dives/configuration.md @@ -26,7 +26,7 @@ See the full reference for `config.yaml` [here](../../reference.md). View the `config.json` migration guide [here](../../yaml-migration.md) ::: -- [`config.json`](../../json-reference.md) - The original configuration format which is stored in a file at the same location as `config.yaml` +- [`config.json`](../../reference.md) - The original configuration format which is stored in a file at the same location as `config.yaml` - [`.continuerc.json`](#continuercjson) - Workspace-level configuration - [`config.ts`](#configts) - Advanced configuration (probably unnecessary) - a TypeScript file in your home directory that can be used to programmatically modify (_merged_) the `config.json` schema: - `~/.continue/config.ts` (MacOS / Linux) diff --git a/docs/docs/customize/deep-dives/development-data.md b/docs/docs/customize/deep-dives/development-data.md new file mode 100644 index 000000000..976c02833 --- /dev/null +++ b/docs/docs/customize/deep-dives/development-data.md @@ -0,0 +1,21 @@ +--- +title: Development Data +description: Collecting data on how you build software +keywords: [development data, dev data, LLM-aided development] +--- + +# Development Data + +When you use Continue, you automatically collect data on how you build software. By default, this development data is saved to `.continue/dev_data` on your local machine. + +You can read more about how development data is generated as a byproduct of LLM-aided development and why we believe that you should start collecting it now: [It’s time to collect data on how you build software](https://blog.continue.dev/its-time-to-collect-data-on-how-you-build-software) + +## Custom Data Destinations + +You can also configure custom destinations for your data, including remote HTTP endpoints and local file directories. + +For hub assistants, data destinations are configured in `data` blocks. Visit the hub to [explore example data blocks](https://hub.continue.dev/explore/data) or [create your own](https://hub.continue.dev/new?type=block&block=data). + +See more details about adding `data` blocks to your configuration files in the [YAML specification](../../yaml-reference.md#data) + +When sending development data to your own HTTP endpoint, it will receive an event JSON blob at the given `schema` version. You can view event names, schema versions, and fields [here in the source code](https://github.com/continuedev/continue/tree/main/packages/config-yaml/src/schemas/data). diff --git a/docs/docs/customize/deep-dives/docs.mdx b/docs/docs/customize/deep-dives/docs.mdx index e48bac259..7a5be2263 100644 --- a/docs/docs/customize/deep-dives/docs.mdx +++ b/docs/docs/customize/deep-dives/docs.mdx @@ -14,8 +14,8 @@ keywords: toc_max_heading_level: 5 --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # @Docs @@ -62,6 +62,10 @@ Pre-indexed docs are only available in VS Code because the VS Code extension shi ## Indexing Your Own Documentation +### Hub `docs` Blocks + +@Docs uses [`docs` blocks](../../hub/blocks/block-types.md#docs) in Assistants from the hub. Visit the hub to [explore `docs` blocks](https://hub.continue.dev/explore/docs) or [create your own](https://hub.continue.dev/new?type=block&block=docs). + ### Through the `@Docs` Context Provider To add a single documentation site, we recommend using the **Add Documentation** Form within the GUI. This can be accessed @@ -85,7 +89,7 @@ Documentation sources may be suggested based on package files in your repo. This ![Add documentation form](/img/docs-form.png) -### Through global configuration +### In a configuration file For bulk documentation site adds or edits, we recommend editing your global configuration file directly. Documentation sites are stored in an array within `docs` in your global configuration, as follows: @@ -121,7 +125,7 @@ Indexing will re-sync upon saving the configuration file. ### Using Your Embeddings Provider -If you have set up an [embeddings provider](../model-types/embeddings.mdx), @docs will use your embeddings provider. Switching embeddings providers will trigger a re-index of all documentation sites in your configuration. +If you have set up an [embeddings provider](../model-roles/embeddings.mdx), @docs will use your embeddings provider. Switching embeddings providers will trigger a re-index of all documentation sites in your configuration. ### Reranking @@ -278,7 +282,7 @@ The following configuration example works out of the box for VS Code. This uses ### Jetbrains minimal setup -Here is the equivalent minimal example for Jetbrains, which requires setting up an [embeddings provider](../model-types/embeddings.mdx). Pre-indexed docs will _not_ be accessible. +Here is the equivalent minimal example for Jetbrains, which requires setting up an [embeddings provider](../model-roles/embeddings.mdx). Pre-indexed docs will _not_ be accessible. diff --git a/docs/docs/customize/deep-dives/prompt-files.md b/docs/docs/customize/deep-dives/prompt-files.md index bd4c05db6..1ab90e94a 100644 --- a/docs/docs/customize/deep-dives/prompt-files.md +++ b/docs/docs/customize/deep-dives/prompt-files.md @@ -4,13 +4,13 @@ title: Prompt files Prompt files provide a convenient way to standardize common patterns and share a collection of LLM prompts with your team. They make it easy to build and use these prompts. +On the [hub](../../hub/introduction.md), prompt files are stored within [prompt blocks](../../hub/blocks/block-types.md#prompts), which show up as [slash commands](../slash-commands.mdx) in Chat. Visit the hub to [explore prompts](https://hub.continue.dev/explore/prompts) or [create your own](https://hub.continue.dev/new?type=block&block=rules). + +Prompt files can also be stored within your project's root directory as `.prompt` files. See below. + ## Quick start - - -Below is a quick example of setting up a prompt file to de +Below is a quick example of setting up a prompt file: 1. Create a folder called `.continue/prompts` at the top level of your workspace (or you can use the button in the UI by typing @, selecting "Prompt Files", and selecting "New Prompt File"). 2. Add a file called `rails.prompt` to this folder. diff --git a/docs/docs/customize/deep-dives/rules.md b/docs/docs/customize/deep-dives/rules.md index ae8347f29..eac9137ce 100644 --- a/docs/docs/customize/deep-dives/rules.md +++ b/docs/docs/customize/deep-dives/rules.md @@ -3,11 +3,19 @@ description: Learn how to customize the system prompt with a `.continuerules` fi keywords: [rules, .continuerules, system, prompt, message] --- -# `.continuerules` +# Rules -You can create a project-specific system message by adding a `.continuerules` file to the root of your project. This file is raw text and its contents will be inserted into the system message for all chat requests. Rules are not used for autocomplete. +Rules are used to provide instructions to **chat** models. They are inserted into the system message for all chat requests. Rules are _only_ used during Chat, they are not used for autocomplete or other roles. -## Simple Examples +## Hub `rules` blocks + +Rules can be added to an Assistant on the Continue Hub. Explore available rules [here](https://hub.continue.dev/explore/rules), or [create your own](https://hub.continue.dev/new?type=block&block=rules) in the Hub. + +## `.continuerules` + +You can create a project-specific system message by adding a `.continuerules` file to the root of your project. This file is raw text and its full contents will be used as rules. + +### Simple Examples - If you want concise answers: diff --git a/docs/docs/customize/development-data.md b/docs/docs/customize/development-data.md deleted file mode 100644 index 5380eb7e7..000000000 --- a/docs/docs/customize/development-data.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Development data -description: Collecting data on how you build software -keywords: [development data, dev data, LLM-aided development] ---- - -When you use Continue, you automatically collect data on how you build software. By default, this development data is saved to `.continue/dev_data` on your local machine. When combined with the code that you ultimately commit, it can be used to improve the LLM that you or your team use (if you allow). - -You can read more about how development data is generated as a byproduct of LLM-aided development and why we believe that you should start collecting it now: [It’s time to collect data on how you build software](https://blog.continue.dev/its-time-to-collect-data-on-how-you-build-software) diff --git a/docs/docs/customize/model-providers/more/SambaNova.mdx b/docs/docs/customize/model-providers/more/SambaNova.mdx index 86c2e9e0b..8fb2facfb 100644 --- a/docs/docs/customize/model-providers/more/SambaNova.mdx +++ b/docs/docs/customize/model-providers/more/SambaNova.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # SambaNova Cloud @@ -7,7 +7,7 @@ The SambaNova Cloud is a cloud platform for running large AI models with the wor - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: SambaNova Llama 3.1 405B provider: sambanova diff --git a/docs/docs/customize/model-providers/more/asksage.mdx b/docs/docs/customize/model-providers/more/asksage.mdx index f6966a517..675cedc7f 100644 --- a/docs/docs/customize/model-providers/more/asksage.mdx +++ b/docs/docs/customize/model-providers/more/asksage.mdx @@ -1,7 +1,7 @@ # Ask Sage -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; :::info To get an Ask Sage API key login to the Ask Sage platform (If you don't have an account, you can create one [here](https://chat.asksage.ai/)) and follow the instructions in the Ask Sage Docs:[Ask Sage API Key](https://docs.asksage.ai/docs/api-documentation/api-documentation.html) @@ -13,7 +13,7 @@ To use the Ask Sage models, you can use the following - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: GPT-4 gov provider: askSage diff --git a/docs/docs/customize/model-providers/more/cerebras.mdx b/docs/docs/customize/model-providers/more/cerebras.mdx index a0ffabc8b..838b1d1b9 100644 --- a/docs/docs/customize/model-providers/more/cerebras.mdx +++ b/docs/docs/customize/model-providers/more/cerebras.mdx @@ -1,7 +1,7 @@ # Cerebras Inference -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; Cerebras Inference uses specialized silicon to provides fast inference. @@ -11,7 +11,7 @@ Cerebras Inference uses specialized silicon to provides fast inference. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Cerebras Llama 3.1 70B provider: cerebras diff --git a/docs/docs/customize/model-providers/more/cloudflare.mdx b/docs/docs/customize/model-providers/more/cloudflare.mdx index fa95f4930..8463d2557 100644 --- a/docs/docs/customize/model-providers/more/cloudflare.mdx +++ b/docs/docs/customize/model-providers/more/cloudflare.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # Cloudflare Workers AI @@ -11,7 +11,6 @@ Cloudflare Workers AI can be used for both chat and tab autocompletion in Contin models: - name: Llama 3 8B provider: cloudflare - accountId: YOUR CLOUDFLARE ACCOUNT ID apiKey: model: "@cf/meta/llama-3-8b-instruct" contextLength: 2400 @@ -19,9 +18,10 @@ Cloudflare Workers AI can be used for both chat and tab autocompletion in Contin maxTokens: 500 roles: - chat + env: + accountId: YOUR CLOUDFLARE ACCOUNT ID - name: DeepSeek Coder 6.7b Instruct provider: cloudflare - accountId: YOUR CLOUDFLARE ACCOUNT ID apiKey: model: "@hf/thebloke/deepseek-coder-6.7b-instruct-awq" contextLength: 2400 @@ -29,13 +29,16 @@ Cloudflare Workers AI can be used for both chat and tab autocompletion in Contin maxTokens: 500 roles: - chat + env: + accountId: YOUR CLOUDFLARE ACCOUNT ID - name: DeepSeek 7b provider: cloudflare - accountId: YOUR CLOUDFLARE ACCOUNT ID apiKey: model: "@hf/thebloke/deepseek-coder-6.7b-base-awq" roles: - autocomplete + env: + accountId: YOUR CLOUDFLARE ACCOUNT ID ``` diff --git a/docs/docs/customize/model-providers/more/cohere.mdx b/docs/docs/customize/model-providers/more/cohere.mdx index dd7de0321..352908e12 100644 --- a/docs/docs/customize/model-providers/more/cohere.mdx +++ b/docs/docs/customize/model-providers/more/cohere.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # Cohere @@ -11,7 +11,7 @@ We recommend configuring **Command-R Plus** as your chat model. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Cohere provider: cohere @@ -39,7 +39,7 @@ We recommend configuring **Command-R Plus** as your chat model. Cohere currently does not offer any autocomplete models. -[Click here](../../model-types/autocomplete.md) to see a list of autocomplete model providers. +[Click here](../../model-roles/autocomplete.md) to see a list of autocomplete model providers. ## Embeddings model diff --git a/docs/docs/customize/model-providers/more/flowise.mdx b/docs/docs/customize/model-providers/more/flowise.mdx index 546e6a716..c0257f851 100644 --- a/docs/docs/customize/model-providers/more/flowise.mdx +++ b/docs/docs/customize/model-providers/more/flowise.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # Flowise @@ -7,7 +7,7 @@ import TabItem from "@theme/TabItem"; - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Flowise provider: flowise diff --git a/docs/docs/customize/model-providers/more/free-trial.mdx b/docs/docs/customize/model-providers/more/free-trial.mdx deleted file mode 100644 index 28d831738..000000000 --- a/docs/docs/customize/model-providers/more/free-trial.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Free Trial -slug: ../free-trial ---- - -import Tabs from "@theme/Tabs"; -import TabItem from "@theme/TabItem"; - -The `"free-trial"` provider lets new users quickly try out the best experience in Continue using our API keys through a secure proxy server. To prevent abuse, we will ask you to sign in with GitHub, which you can read more about below. - -While the Continue extension is always free to use, we cannot support infinite free LLM usage for all of our users. You will eventually need to either: - -1. Select an open-source model to use for free [locally](../top-level/ollama.mdx), or -2. Add your own API key for [Anthropic](../top-level/anthropic.mdx) or [another LLM provider](/customize/model-providers) - -## FAQ about the trial - -Continue asks free trial users to sign in so that we can prevent abuse of our API endpoints. If you are not using the free trial, we will not ask you to sign in. - -### How do I stop Continue from asking me to sign in? - -Remove all models from the "models" array or "tabAutocompleteModel" with `"provider": "free-trial"`, and we will never request sign in. - -### What information is collected? - -Continue uses your GitHub username and no other information, for the sole purpose of limiting requests. - -### What happens if I don't sign in? - -If you don't sign in, you can still use every feature of Continue, you will just need to provide your own LLM either with an API key or by running a local model. - -### How is telemetry related to sign in? - -It is not. We do not link your GitHub username to telemetry data. diff --git a/docs/docs/customize/model-providers/more/function-network.mdx b/docs/docs/customize/model-providers/more/function-network.mdx index d734fde08..e2089ac1a 100644 --- a/docs/docs/customize/model-providers/more/function-network.mdx +++ b/docs/docs/customize/model-providers/more/function-network.mdx @@ -3,8 +3,8 @@ title: Function Network slug: ../function-network --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # Function Network @@ -22,7 +22,7 @@ Function Network supports a number of models for chat. We recommend using LLama - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Llama 3.1 70b provider: function-network @@ -56,7 +56,7 @@ Function Network supports a number of models for autocomplete. We recommend usin - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Deepseek Coder 6.7b provider: function-network diff --git a/docs/docs/customize/model-providers/more/groq.mdx b/docs/docs/customize/model-providers/more/groq.mdx index 45cfd0a8a..2c33e37f1 100644 --- a/docs/docs/customize/model-providers/more/groq.mdx +++ b/docs/docs/customize/model-providers/more/groq.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # Groq @@ -14,7 +14,7 @@ Groq provides the fastest available inference for open-source language models, i - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Llama 3.3 70b Versatile provider: groq diff --git a/docs/docs/customize/model-providers/more/ipex_llm.mdx b/docs/docs/customize/model-providers/more/ipex_llm.mdx index 02d20f89b..5af95a7cf 100644 --- a/docs/docs/customize/model-providers/more/ipex_llm.mdx +++ b/docs/docs/customize/model-providers/more/ipex_llm.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # IPEX-LLM @@ -11,7 +11,7 @@ IPEX-LLM supports accelerated Ollama backend to be hosted on Intel GPU. Refer to - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: IPEX-LLM provider: ollama @@ -37,7 +37,7 @@ If you would like to reach the Ollama service from another machine, make sure yo - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: IPEX-LLM provider: ollama diff --git a/docs/docs/customize/model-providers/more/kindo.mdx b/docs/docs/customize/model-providers/more/kindo.mdx index e788b7e39..2315fe7a1 100644 --- a/docs/docs/customize/model-providers/more/kindo.mdx +++ b/docs/docs/customize/model-providers/more/kindo.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # Kindo @@ -9,7 +9,7 @@ Kindo offers centralized control over your organization's AI operations, ensurin - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Claude 3.5 Sonnet provider: kindo @@ -37,7 +37,7 @@ Kindo offers centralized control over your organization's AI operations, ensurin - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: WhiteRabbitNeo provider: kindo diff --git a/docs/docs/customize/model-providers/more/llamacpp.mdx b/docs/docs/customize/model-providers/more/llamacpp.mdx index 291ed0a5a..5b210bb6b 100644 --- a/docs/docs/customize/model-providers/more/llamacpp.mdx +++ b/docs/docs/customize/model-providers/more/llamacpp.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # LlamaCpp @@ -13,7 +13,7 @@ After it's up and running, change `~/.continue/config.json` to look like this: - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Llama CPP provider: llama.cpp diff --git a/docs/docs/customize/model-providers/more/lmstudio.mdx b/docs/docs/customize/model-providers/more/lmstudio.mdx index 784c321cc..6dedb0a88 100644 --- a/docs/docs/customize/model-providers/more/lmstudio.mdx +++ b/docs/docs/customize/model-providers/more/lmstudio.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # LM Studio @@ -7,7 +7,7 @@ import TabItem from "@theme/TabItem"; - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: LM Studio provider: lmstudio @@ -35,7 +35,7 @@ LMStudio supports embeddings endpoints, and comes with the `nomic-ai/nomic-embed - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Nomic Embed Text provider: lmstudio @@ -62,7 +62,7 @@ To configure a remote instance of LM Studio, add the `"apiBase"` property to you - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Nomic Embed Text provider: lmstudio diff --git a/docs/docs/customize/model-providers/more/moonshot.mdx b/docs/docs/customize/model-providers/more/moonshot.mdx index 9fc429f6d..0d9f838eb 100644 --- a/docs/docs/customize/model-providers/more/moonshot.mdx +++ b/docs/docs/customize/model-providers/more/moonshot.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # Moonshot @@ -14,7 +14,7 @@ To use Moonshot AI models, you need to: - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Moonshot provider: moonshot @@ -60,7 +60,7 @@ Here's a complete configuration example: - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Moonshot-8K provider: moonshot diff --git a/docs/docs/customize/model-providers/more/msty.mdx b/docs/docs/customize/model-providers/more/msty.mdx index e08d2ffff..d23955fd4 100644 --- a/docs/docs/customize/model-providers/more/msty.mdx +++ b/docs/docs/customize/model-providers/more/msty.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # Msty @@ -7,7 +7,7 @@ import TabItem from "@theme/TabItem"; - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Msty provider: msty @@ -46,7 +46,7 @@ If you need to send custom headers for authentication, you may use the `requestO - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Msty provider: msty diff --git a/docs/docs/customize/model-providers/more/ncompass.mdx b/docs/docs/customize/model-providers/more/ncompass.mdx new file mode 100644 index 000000000..e6f98c296 --- /dev/null +++ b/docs/docs/customize/model-providers/more/ncompass.mdx @@ -0,0 +1,34 @@ +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# nCompass + +The nCompass Technologies API exposes an extremely fast inference engine for open-source language models. You can sign up [here](https://app.ncompass.tech/api-settings), copy your API key on the initial welcome screen, and then hit the play button on any model from the [nCompass Models list](https://console.ncompass.tech/models). Change `~/.continue/config.json` to look like this: + + + + ```yaml title="Package or config.yaml" + models: + - name: Ncompass Qwen2.5 Coder + provider: ncompass + model: Qwen/Qwen2.5-Coder-32B-Instruct + apiKey: + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "Ncompass Qwen2.5 Coder", + "provider": "ncompass", + "model": "Qwen/Qwen2.5-Coder-32B-Instruct", + "apiKey": "" + } + ] + } + ``` + + + +[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/NCompass.ts) diff --git a/docs/docs/customize/model-providers/more/nebius.mdx b/docs/docs/customize/model-providers/more/nebius.mdx index 72af4334d..12a660ead 100644 --- a/docs/docs/customize/model-providers/more/nebius.mdx +++ b/docs/docs/customize/model-providers/more/nebius.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # Nebius AI Studio @@ -13,7 +13,7 @@ Available models can be found on the [Nebius AI Studio models page](https://stud - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Llama 3.1 405b provider: nebius diff --git a/docs/docs/customize/model-providers/more/novita.mdx b/docs/docs/customize/model-providers/more/novita.mdx index bf6e99421..ca2f603b0 100644 --- a/docs/docs/customize/model-providers/more/novita.mdx +++ b/docs/docs/customize/model-providers/more/novita.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # Novita @@ -7,7 +7,7 @@ import TabItem from "@theme/TabItem"; - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Llama 3.1 8B provider: novita diff --git a/docs/docs/customize/model-providers/more/nvidia.mdx b/docs/docs/customize/model-providers/more/nvidia.mdx index bc395cf0d..27fdc9041 100644 --- a/docs/docs/customize/model-providers/more/nvidia.mdx +++ b/docs/docs/customize/model-providers/more/nvidia.mdx @@ -2,8 +2,8 @@ title: NVIDIA --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; :::info [View the docs](https://docs.nvidia.com/nim/large-language-models/latest/getting-started.html#option-1-from-api-catalog) to learn how to get an API key. @@ -43,7 +43,7 @@ We recommend configuring **Nemotron-4-340B-Instruct** as your chat model. NVIDIA currently does not offer any autocomplete models. -[Click here](../../model-types/autocomplete.md) to see a list of autocomplete model providers. +[Click here](../../model-roles/autocomplete.md) to see a list of autocomplete model providers. ## Embeddings model @@ -78,4 +78,4 @@ We recommend configuring **NVIDIA Retrieval QA Mistral 7B** as your embeddings m NVIDIA currently does not offer any reranking models. -[Click here](../../model-types/reranking.mdx) to see a list of reranking model providers. +[Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. diff --git a/docs/docs/customize/model-providers/more/openrouter.mdx b/docs/docs/customize/model-providers/more/openrouter.mdx index 637366d6e..cc7902a65 100644 --- a/docs/docs/customize/model-providers/more/openrouter.mdx +++ b/docs/docs/customize/model-providers/more/openrouter.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # OpenRouter @@ -9,7 +9,7 @@ Change `~/.continue/config.json` to look like the following. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: OpenRouter LLaMA 70 8B provider: openrouter @@ -41,7 +41,7 @@ For example, to prevent extra long prompts from being compressed, you can explic - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Example Model provider: exampleProvider diff --git a/docs/docs/customize/model-providers/more/replicatellm.mdx b/docs/docs/customize/model-providers/more/replicatellm.mdx index 958fc347a..c7a58e076 100644 --- a/docs/docs/customize/model-providers/more/replicatellm.mdx +++ b/docs/docs/customize/model-providers/more/replicatellm.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # ReplicateLLM @@ -7,7 +7,7 @@ Replicate is a great option for newly released language models or models that yo - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Replicate CodeLLama provider: replicate diff --git a/docs/docs/customize/model-providers/more/scaleway.mdx b/docs/docs/customize/model-providers/more/scaleway.mdx index 462c362b5..299c6cc19 100644 --- a/docs/docs/customize/model-providers/more/scaleway.mdx +++ b/docs/docs/customize/model-providers/more/scaleway.mdx @@ -2,8 +2,8 @@ title: Scaleway --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; :::info Scaleway Generative APIs give you instant access to leading AI models hosted in European data centers, ideal for developers requiring low latency, full data privacy, and compliance with EU AI Act. @@ -18,7 +18,7 @@ We recommend configuring **Qwen2.5-Coder-32B-Instruct** as your chat model. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Qwen2.5-Coder-32B-Instruct provider: scaleway @@ -46,7 +46,7 @@ We recommend configuring **Qwen2.5-Coder-32B-Instruct** as your chat model. Scaleway currently does not offer any autocomplete models. -[Click here](../../model-types/autocomplete.md) to see a list of autocomplete model providers. +[Click here](../../model-roles/autocomplete.md) to see a list of autocomplete model providers. ## Embeddings model diff --git a/docs/docs/customize/model-providers/more/textgenwebui.mdx b/docs/docs/customize/model-providers/more/textgenwebui.mdx index 0bfcbb442..2f41c4ab9 100644 --- a/docs/docs/customize/model-providers/more/textgenwebui.mdx +++ b/docs/docs/customize/model-providers/more/textgenwebui.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # TextGenWebUI @@ -7,7 +7,7 @@ TextGenWebUI is a comprehensive, open-source language model UI and local server. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Text Generation WebUI provider: text-gen-webui diff --git a/docs/docs/customize/model-providers/more/together.mdx b/docs/docs/customize/model-providers/more/together.mdx index 8af923471..7b2f3b829 100644 --- a/docs/docs/customize/model-providers/more/together.mdx +++ b/docs/docs/customize/model-providers/more/together.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # Together @@ -7,7 +7,7 @@ The Together API is a cloud platform for running large AI models. You can sign u - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Together Qwen2.5 Coder provider: together diff --git a/docs/docs/customize/model-providers/more/vllm.mdx b/docs/docs/customize/model-providers/more/vllm.mdx index 1c49ef620..58431ec7d 100644 --- a/docs/docs/customize/model-providers/more/vllm.mdx +++ b/docs/docs/customize/model-providers/more/vllm.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # vLLM @@ -45,7 +45,7 @@ We recommend configuring **Qwen2.5-Coder 1.5B** as your autocomplete model. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Qwen2.5-Coder 1.5B provider: vllm @@ -75,7 +75,7 @@ We recommend configuring **Nomic Embed Text** as your embeddings model. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: VLLM Nomad Embed Text provider: vllm @@ -100,6 +100,6 @@ We recommend configuring **Nomic Embed Text** as your embeddings model. ## Reranking model -[Click here](../../model-types/reranking.mdx) to see a list of reranking model providers. +[Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. The continue implementation uses [OpenAI](../top-level/openai.mdx) under the hood. [View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/Vllm.ts) diff --git a/docs/docs/customize/model-providers/more/watsonx.mdx b/docs/docs/customize/model-providers/more/watsonx.mdx index e18b3e285..0854e0cd6 100644 --- a/docs/docs/customize/model-providers/more/watsonx.mdx +++ b/docs/docs/customize/model-providers/more/watsonx.mdx @@ -1,5 +1,5 @@ -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; # IBM watsonx @@ -45,15 +45,16 @@ Add the following configuration: - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: watsonx - Model Name provider: watsonx model: model ID apiBase: https://us-south.ml.cloud.ibm.com - projectId: PROJECT_ID apiKey: API_KEY/ZENAPI_KEY/USERNAME:PASSWORD - apiVersion: 2024-03-14 + env: + projectId: PROJECT_ID + apiVersion: 2024-03-14 ``` @@ -81,15 +82,16 @@ If you are using a custom deployment endpoint, set `deploymentID` to the model's - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: watsonx - Model Name provider: watsonx model: model ID apiBase: watsonx endpoint e.g. https://us-south.ml.cloud.ibm.com apiKey: API_KEY/ZENAPI_KEY/USERNAME:PASSWORD - apiVersion: 2024-03-14 - deploymentId: DEPLOYMENT_ID + env: + apiVersion: 2024-03-14 + deploymentId: DEPLOYMENT_ID ``` @@ -124,9 +126,7 @@ You can also configure generation parameters, such as temperature, topP, topK, f provider: watsonx model: ibm/granite-20b-code-instruct apiBase: watsonx endpoint e.g. https://us-south.ml.cloud.ibm.com - projectId: PROJECT_ID apiKey: API_KEY/ZENAPI_KEY/USERNAME:PASSWORD - apiVersion: 2024-03-14 template: granite contextLength: 8000 defaultCompletionOptions: @@ -138,6 +138,10 @@ You can also configure generation parameters, such as temperature, topP, topK, f stop: - Question: - "\n\n\n" + env: + projectId: PROJECT_ID + apiVersion: 2024-03-14 + ``` @@ -175,7 +179,7 @@ Granite models are recommended for tab auto complete. The configuration is simil - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Granite Code 8b provider: watsonx diff --git a/docs/docs/customize/model-providers/top-level/anthropic.mdx b/docs/docs/customize/model-providers/top-level/anthropic.mdx index 7844cf49c..d7d1e325c 100644 --- a/docs/docs/customize/model-providers/top-level/anthropic.mdx +++ b/docs/docs/customize/model-providers/top-level/anthropic.mdx @@ -3,8 +3,8 @@ title: Anthropic slug: ../anthropic --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; :::info You can get an API key from the [Anthropic console](https://console.anthropic.com/account/keys). @@ -44,19 +44,19 @@ We recommend configuring **Claude 3.5 Sonnet** as your chat model. Anthropic currently does not offer any autocomplete models. -[Click here](../../model-types/autocomplete.md) to see a list of autocomplete model providers. +[Click here](../../model-roles/autocomplete.md) to see a list of autocomplete model providers. ## Embeddings model Anthropic currently does not offer any embeddings models. -[Click here](../../model-types/embeddings.mdx) to see a list of embeddings model providers. +[Click here](../../model-roles/embeddings.mdx) to see a list of embeddings model providers. ## Reranking model Anthropic currently does not offer any reranking models. -[Click here](../../model-types/reranking.mdx) to see a list of reranking model providers. +[Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. ## Prompt caching @@ -66,7 +66,7 @@ To enable caching of the system message and the turn-by-turn conversation, updat - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Anthropic provider: anthropic diff --git a/docs/docs/customize/model-providers/top-level/azure.mdx b/docs/docs/customize/model-providers/top-level/azure.mdx index a4f1a3f93..cbb955bca 100644 --- a/docs/docs/customize/model-providers/top-level/azure.mdx +++ b/docs/docs/customize/model-providers/top-level/azure.mdx @@ -3,8 +3,8 @@ title: Azure AI Foundry slug: ../azure --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; Azure AI Foundry is a cloud-based service that provides access to models from OpenAI, Mistral AI, and others, integrated with the security and enterprise features of the Microsoft Azure platform. To get started, create an Azure AI Foundry resource in the [Azure portal](https://portal.azure.com). @@ -19,20 +19,20 @@ For details on OpenAI model setup, see [Azure OpenAI Service configuration](#azu We recommend configuring **GPT-4o** as your chat model. - - ```yaml title="config.yaml" - models: - - name: GPT-4o - provider: azure - model: gpt-4o - apiBase: - deployment: - apiKey: # If you use subscription key, try using Azure gateway to rename it apiKey + + ```yaml title="config.yaml" + models: + - name: GPT-4o + provider: azure + model: gpt-4o + apiBase: + apiKey: # If you use subscription key, try using Azure gateway to rename it apiKey env: - apiType: azure-foundry # Or "azure-openai" if using OpenAI models - ``` - - + deployment: + apiType: azure-foundry # Or "azure-openai" if using OpenAI models + ``` + + ```json title="config.json" { "models": [{ @@ -46,7 +46,7 @@ We recommend configuring **GPT-4o** as your chat model. }] } ``` - + ## Autocomplete model @@ -55,17 +55,17 @@ We recommend configuring **Codestral** as your autocomplete model. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Codestral provider: mistral model: codestral-latest roles: - autocomplete - ``` - - - ```json title="config.json" + ``` + + + ```json title="config.json" { "tabAutocompleteModel": { "title": "Codestral", @@ -73,8 +73,8 @@ We recommend configuring **Codestral** as your autocomplete model. "model": "codestral-latest" } } - ``` - + ``` + ## Embeddings model @@ -83,15 +83,15 @@ We recommend configuring **text-embedding-3-large** as your embeddings model. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Text Embedding-3 Large provider: azure model: text-embedding-3-large apiBase: - deployment: apiKey: env: + deployment: apiType: azure ``` @@ -115,7 +115,7 @@ We recommend configuring **text-embedding-3-large** as your embeddings model. Azure OpenAI currently does not offer any reranking models. -[Click here](../../model-types/reranking.mdx) to see a list of reranking models. +[Click here](../../model-roles/reranking.mdx) to see a list of reranking models. ## Privacy @@ -135,20 +135,20 @@ For example, a Target URI of `https://just-an-example.openai.azure.com/openai/de - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: GPT-4o Azure model: gpt-4o provider: openai apiBase: https://just-an-example.openai.azure.com - deployment: gpt-4o-july - apiVersion: 2023-03-15-preview apiKey: env: - apiType: azure-openai + apiVersion: 2023-03-15-preview + deployment: gpt-4o-july + apiType: azure-openai ``` - - + + ```json title="config.json" { "title": "GPT-4o Azure", @@ -161,5 +161,5 @@ For example, a Target URI of `https://just-an-example.openai.azure.com/openai/de "apiType": "azure-openai" } ``` - + diff --git a/docs/docs/customize/model-providers/top-level/bedrock.mdx b/docs/docs/customize/model-providers/top-level/bedrock.mdx index f472d42a5..9582428a4 100644 --- a/docs/docs/customize/model-providers/top-level/bedrock.mdx +++ b/docs/docs/customize/model-providers/top-level/bedrock.mdx @@ -3,8 +3,8 @@ title: Amazon Bedrock slug: ../bedrock --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; Amazon Bedrock is a fully managed service on AWS that provides access to foundation models from various AI companies through a single API. @@ -19,8 +19,9 @@ We recommend configuring **Claude 3.5 Sonnet** as your chat model. - name: Claude 3.5 Sonnet provider: bedrock model: anthropic.claude-3-5-sonnet-20240620-v1:0 - region: us-east-1 - profile: bedrock + env: + region: us-east-1 + profile: bedrock roles: - chat ``` @@ -53,8 +54,9 @@ We recommend configuring **Claude 3.5 Sonnet** as your chat model. - name: Claude 3.5 Sonnet provider: bedrock model: us.anthropic.claude-3-5-sonnet-20241022-v2:0 - region: us-east-1 - profile: bedrock + env: + region: us-east-1 + profile: bedrock roles: - chat ``` @@ -80,7 +82,7 @@ We recommend configuring **Claude 3.5 Sonnet** as your chat model. Bedrock currently does not offer any autocomplete models. However, [Codestral from Mistral](https://mistral.ai/news/codestral-2501/) and [Point from Poolisde](https://aws.amazon.com/bedrock/poolside/) will be supported in the near future. -In the meantime, you can view a list of autocomplete model providers [here](../../model-types/autocomplete.md). +In the meantime, you can view a list of autocomplete model providers [here](../../model-roles/autocomplete.md). ## Embeddings model @@ -93,7 +95,8 @@ We recommend configuring [`amazon.titan-embed-text-v2:0`](https://docs.aws.amazo - name: Embeddings Model provider: bedrock model: amazon.titan-embed-text-v2:0 - region: us-west-2 + env: + region: us-west-2 roles: - embed ``` @@ -123,7 +126,8 @@ We recommend configuring `cohere.rerank-v3-5:0` as your reranking model, you may - name: Bedrock Reranker provider: bedrock model: cohere.rerank-v3-5:0 - region: us-west-2 + env: + region: us-west-2 roles: - rerank ``` diff --git a/docs/docs/customize/model-providers/top-level/deepseek.mdx b/docs/docs/customize/model-providers/top-level/deepseek.mdx index 0d15bb5f4..28f885192 100644 --- a/docs/docs/customize/model-providers/top-level/deepseek.mdx +++ b/docs/docs/customize/model-providers/top-level/deepseek.mdx @@ -3,8 +3,8 @@ title: DeepSeek slug: ../deepseek --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; :::info You can get an API key from the [DeepSeek console](https://www.deepseek.com/). @@ -74,10 +74,10 @@ We recommend configuring **DeepSeek Coder** as your autocomplete model. DeepSeek currently does not offer any embeddings models. -[Click here](../../model-types/embeddings.mdx) to see a list of embeddings model providers. +[Click here](../../model-roles/embeddings.mdx) to see a list of embeddings model providers. ## Reranking model DeepSeek currently does not offer any reranking models. -[Click here](../../model-types/reranking.mdx) to see a list of reranking model providers. +[Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. diff --git a/docs/docs/customize/model-providers/top-level/gemini.mdx b/docs/docs/customize/model-providers/top-level/gemini.mdx index 6911a14a0..5bde15a79 100644 --- a/docs/docs/customize/model-providers/top-level/gemini.mdx +++ b/docs/docs/customize/model-providers/top-level/gemini.mdx @@ -3,8 +3,8 @@ title: Gemini slug: ../gemini --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; :::info You can get an API key from the [Google AI Studio](https://aistudio.google.com/). @@ -12,15 +12,15 @@ You can get an API key from the [Google AI Studio](https://aistudio.google.com/) ## Chat model -We recommend configuring **Gemini 1.5 Pro** as your chat model. +We recommend configuring **Gemini 2.0 Flash** as your chat model. ```yaml title="config.yaml" models: - - name: Gemini 1.5 Pro + - name: Gemini 2.0 Flash provider: gemini - model: gemini-1.5-pro-latest + model: gemini-2.0-flash apiKey: ``` @@ -29,9 +29,9 @@ We recommend configuring **Gemini 1.5 Pro** as your chat model. { "models": [ { - "title": "Gemini 1.5 Pro", + "title": "Gemini 2.0 Flash", "provider": "gemini", - "model": "gemini-1.5-pro-latest", + "model": "gemini-2.0-flash", "apiKey": "" } ] @@ -44,7 +44,7 @@ We recommend configuring **Gemini 1.5 Pro** as your chat model. Gemini currently does not offer any autocomplete models. -[Click here](../../model-types/autocomplete.md) to see a list of autocomplete model providers. +[Click here](../../model-roles/autocomplete.md) to see a list of autocomplete model providers. ## Embeddings model @@ -79,4 +79,4 @@ We recommend configuring **text-embedding-004** as your embeddings model. Gemini currently does not offer any reranking models. -[Click here](../../model-types/reranking.mdx) to see a list of reranking model providers. +[Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. diff --git a/docs/docs/customize/model-providers/top-level/mistral.mdx b/docs/docs/customize/model-providers/top-level/mistral.mdx index dd584394d..df936fe54 100644 --- a/docs/docs/customize/model-providers/top-level/mistral.mdx +++ b/docs/docs/customize/model-providers/top-level/mistral.mdx @@ -3,8 +3,8 @@ title: Mistral slug: ../mistral --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; :::info You can get an API key from the [Mistral Dashboard](https://console.mistral.ai). Note that the API key for Codestral (codestral.mistral.ai) is different from for all other models (api.mistral.ai). If you are using a Codestral API key, you should set the `apiBase` to `https://codestral.mistral.ai/v1`. Otherwise, we will default to using `https://api.mistral.ai/v1`. @@ -107,4 +107,4 @@ We recommend configuring **Mistral Embed** as your embeddings model. Mistral currently does not offer any reranking models. -[Click here](../../model-types/reranking.mdx) to see a list of reranking model providers. +[Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. diff --git a/docs/docs/customize/model-providers/top-level/ollama.mdx b/docs/docs/customize/model-providers/top-level/ollama.mdx index f2a80386e..92759e2cb 100644 --- a/docs/docs/customize/model-providers/top-level/ollama.mdx +++ b/docs/docs/customize/model-providers/top-level/ollama.mdx @@ -3,8 +3,8 @@ title: Ollama slug: ../ollama --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; Ollama is an open-source tool that allows to run large language models (LLMs) locally on their own computers. To use Ollama, you can install it [here](https://ollama.ai/download) and download the model you want to run with the `ollama run` command. @@ -14,7 +14,7 @@ We recommend configuring **Llama3.1 8B** as your chat model. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Llama3.1 8B provider: ollama @@ -42,7 +42,7 @@ We recommend configuring **Qwen2.5-Coder 1.5B** as your autocomplete model. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Qwen2.5-Coder 1.5B provider: ollama @@ -70,7 +70,7 @@ We recommend configuring **Nomic Embed Text** as your embeddings model. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Nomic Embed Text provider: ollama @@ -95,7 +95,7 @@ We recommend configuring **Nomic Embed Text** as your embeddings model. Ollama currently does not offer any reranking models. -[Click here](../../model-types/reranking.mdx) to see a list of reranking model providers. +[Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. ## Using a remote instance @@ -103,7 +103,7 @@ To configure a remote instance of Ollama, add the `"apiBase"` property to your m - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Llama3.1 8B provider: ollama diff --git a/docs/docs/customize/model-providers/top-level/openai.mdx b/docs/docs/customize/model-providers/top-level/openai.mdx index 71a117850..8ed706213 100644 --- a/docs/docs/customize/model-providers/top-level/openai.mdx +++ b/docs/docs/customize/model-providers/top-level/openai.mdx @@ -3,8 +3,8 @@ title: OpenAI slug: ../openai --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; :::info You can get an API key from the [OpenAI console](https://platform.openai.com/account/api-keys) @@ -44,7 +44,7 @@ We recommend configuring **GPT-4o** as your chat model. OpenAI currently does not offer any autocomplete models. -[Click here](../../model-types/autocomplete.md) to see a list of autocomplete model providers. +[Click here](../../model-roles/autocomplete.md) to see a list of autocomplete model providers. ## Embeddings model @@ -79,7 +79,7 @@ We recommend configuring **text-embedding-3-large** as your embeddings model. OpenAI currently does not offer any reranking models. -[Click here](../../model-types/reranking.mdx) to see a list of reranking model providers. +[Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. ## OpenAI compatible servers / APIs diff --git a/docs/docs/customize/model-providers/top-level/vertexai.mdx b/docs/docs/customize/model-providers/top-level/vertexai.mdx index 514b67cb4..2863acc31 100644 --- a/docs/docs/customize/model-providers/top-level/vertexai.mdx +++ b/docs/docs/customize/model-providers/top-level/vertexai.mdx @@ -3,8 +3,8 @@ title: Vertex AI slug: ../vertexai --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; :::info You need to enable the [Vertex AI API](https://console.cloud.google.com/marketplace/product/google/aiplatform.googleapis.com) and set up the [Google Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc). @@ -16,13 +16,14 @@ We recommend configuring **Claude 3.5 Sonnet** as your chat model. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Claude 3.5 Sonnet provider: vertexai model: claude-3-5-sonnet-20240620 - projectId: - region: us-east5 + env: + projectId: + region: us-east5 ``` @@ -53,10 +54,12 @@ We recommend configuring **Codestral** or **code-gecko** as your autocomplete mo - name: Codestral (Vertex AI) provider: vertexai model: codestral - projectId: - region: us-central1 roles: - autocomplete + env: + projectId: + region: us-central1 + ``` @@ -85,8 +88,9 @@ We recommend configuring **text-embedding-004** as your embeddings model. - name: Text Embedding-004 provider: vertexai model: text-embedding-004 - projectId: - region: us-central1 + env: + projectId: + region: us-central1 roles: - embed ``` @@ -109,4 +113,4 @@ We recommend configuring **text-embedding-004** as your embeddings model. Vertex AI currently does not offer any reranking models. -[Click here](../../model-types/reranking.mdx) to see a list of reranking model providers. +[Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. diff --git a/docs/docs/customize/model-providers/top-level/xAI.mdx b/docs/docs/customize/model-providers/top-level/xAI.mdx index 6fb459736..3c049790d 100644 --- a/docs/docs/customize/model-providers/top-level/xAI.mdx +++ b/docs/docs/customize/model-providers/top-level/xAI.mdx @@ -3,8 +3,8 @@ title: xAI slug: ../xai --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; :::info You can get an API key from the [xAI console](https://console.x.ai/) @@ -14,7 +14,10 @@ You can get an API key from the [xAI console](https://console.x.ai/) We recommend configuring **grok-2-latest** as your chat model. For information on other available models, visit [xAI Documentation](https://docs.x.ai/docs/models). - + + + Add the [xAI Grok 2 model block](https://hub.continue.dev/xai/grok-2) on the hub. + ```yaml title="config.yaml" models: @@ -44,16 +47,16 @@ We recommend configuring **grok-2-latest** as your chat model. For information o xAI currently does not offer any autocomplete models. -[Click here](../../model-types/autocomplete.md) to see a list of autocomplete model providers. +[Click here](../../model-roles/autocomplete.md) to see a list of autocomplete model providers. ## Embeddings model xAI currently does not offer any embeddings models. -[Click here](../../model-types/embeddings.mdx) to see a list of embeddings model providers. +[Click here](../../model-roles/embeddings.mdx) to see a list of embeddings model providers. ## Reranking model xAI currently does not offer any reranking models. -[Click here](../../model-types/reranking.mdx) to see a list of reranking model providers. +[Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. diff --git a/docs/docs/customize/model-roles/apply.mdx b/docs/docs/customize/model-roles/apply.mdx new file mode 100644 index 000000000..1ecace184 --- /dev/null +++ b/docs/docs/customize/model-roles/apply.mdx @@ -0,0 +1,15 @@ +--- +title: Apply Role +description: Apply model role +keywords: [apply, model, role] +sidebar_position: 4 +--- + +import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; + +When editing code, Chat and Edit model output often doesn't clearly align with existing code. A model with the `apply` role is used to generate a more precise diff to apply changes to a file. + +Generally speaking, models proficient in chat and edit can also be used for applying code. + +Explore apply models in [the hub](https://hub.continue.dev/explore/models?roles=apply). diff --git a/docs/docs/customize/model-roles/autocomplete.md b/docs/docs/customize/model-roles/autocomplete.md new file mode 100644 index 000000000..9641d5dcb --- /dev/null +++ b/docs/docs/customize/model-roles/autocomplete.md @@ -0,0 +1,14 @@ +--- +title: Autocomplete Role +description: Autocomplete model role +keywords: [autocomplete, model, role] +sidebar_position: 2 +--- + +An "autocomplete model" is an LLM that is trained on a special format called fill-in-the-middle (FIM). This format is designed to be given the prefix and suffix of a code file and predict what goes between. This task is very specific, which on one hand means that the models can be smaller (even a 3B parameter model can perform well). On the other hand, this means that Chat models, though larger, will often perform poorly even with extensive prompting. + +In Continue, autocomplete models are used to display inline [Autocomplete](../../autocomplete/how-to-use-it.md) suggestions as you type. Autocomplete models are designated by adding the `autocomplete` to the model's `roles` in `config.yaml`. + +## Recommended Autocomplete models + +Visit the [Autocomplete Deep Dive](../deep-dives/autocomplete.mdx) for recommended models and more details. diff --git a/docs/docs/customize/model-roles/chat.mdx b/docs/docs/customize/model-roles/chat.mdx new file mode 100644 index 000000000..90b97e17c --- /dev/null +++ b/docs/docs/customize/model-roles/chat.mdx @@ -0,0 +1,416 @@ +--- +title: Chat Role +description: Chat model role +keywords: [chat, model, role] +sidebar_position: 1 +--- + +import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; + +A "chat model" is an LLM that is trained to respond in a conversational format. Because they should be able to answer general questions and generate complex code, the best chat models are typically large, often 405B+ parameters. + +In Continue, these models are used for [Chat](../../chat/how-to-use-it.md) and [Actions](../../actions/how-to-use-it.md). The selected chat model will also be used for [Edit](../../edit/how-to-use-it.md) and [Apply](./apply.mdx) if no `edit` or `apply` models are specified, respectively. + +## Recommended Chat models + +## Best overall experience + +For the best overall Chat experience, you will want to use a 400B+ parameter model or one of the frontier models. + +### Claude Sonnet 3.5 from Anthropic + +Our current top recommendation is Claude 3.7 Sonnet from [Anthropic](../model-providers/top-level/anthropic.mdx). + + + + View the [Claude 3.7 Sonnet model block](https://hub.continue.dev/anthropic/claude-3-7-sonnet) on the hub. + + + ```yaml title="config.yaml" + models: + - name: Claude 3.7 Sonnet + provider: anthropic + model: claude-3-7-sonnet-latest + apiKey: + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "Claude 3.5 Sonnet", + "provider": "anthropic", + "model": "claude-3-5-sonnet-latest", + "apiKey": "" + } + ] + } + ``` + + + +### Llama 3.1 405B from Meta + +If you prefer to use an open-weight model, then Llama 3.1 405B from Meta is your best option right now. You will need to decide if you use it through a SaaS model provider (e.g. [Together](../model-providers/more/together.mdx) or [Groq](../model-providers/more/groq.mdx)) or self-host it (e.g. using [vLLM](../model-providers//more/vllm.mdx) or [Ollama](../model-providers/top-level/ollama.mdx)). + + + {/* HUB_TODO nonexistent blocks */} + {/* + + + Add the [Together Llama 3.1 405b block](https://hub.continue.dev/explore/assistants) from the hub + + + Add the [Groq Llama 3.1 405b block](https://hub.continue.dev/explore/assistants) from the hub + + + Add the [vLLM Llama 3.1 405b block](https://hub.continue.dev/explore/assistants) from the hub + + + Add the [Ollama Llama 3.1 405b block](https://hub.continue.dev/explore/assistants) from the hub + + + */} + + + + ```yaml title="config.yaml" + models: + - name: "Llama 3.1 405B" + provider: "together" + model: "llama3.1-405b" + apiKey: + ``` + + + ```yaml title="config.yaml" + models: + - name: "Llama 3.1 405B" + provider: "groq" + model: "llama3.1-405b" + apiKey: + ``` + + + ```yaml title="config.yaml" + models: + - name: "Llama 3.1 405B" + provider: "vllm" + model: "llama3.1-405b" + ``` + + + ```yaml title="config.yaml" + models: + - name: "Llama 3.1 405B" + provider: "ollama" + model: "llama3.1:405b" + ``` + + + + + + + ```json title="config.json" + { + "models": [ + { + "title": "Llama 3.1 405B", + "provider": "together", + "model": "llama3.1-405b", + "apiKey": "" + } + ] + } + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "Llama 3.1 405B", + "provider": "groq", + "model": "llama3.1-405b", + "apiKey": "" + } + ] + } + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "Llama 3.1 405B", + "provider": "vllm", + "model": "llama3.1-405b" + } + ] + } + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "Llama 3.1 405B", + "provider": "ollama", + "model": "llama3.1:405b" + } + ] + } + ``` + + + + + +### GPT-4o from OpenAI + +If you prefer to use a model from [OpenAI](../model-providers/top-level/openai.mdx), then we recommend GPT-4o. + + + + Add the [OpenAI GPT-4o block](https://hub.continue.dev/openai/gpt-4o) from the hub + + + ```yaml title="config.yaml" + models: + - name: GPT-4o + provider: openai + model: '' + apiKey: + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "GPT-4o", + "provider": "openai", + "model": "", + "apiKey": "" + } + ] + } + ``` + + + +### Grok-2 from xAI + +If you prefer to use a model from [xAI](../model-providers/top-level/xAI.mdx), then we recommend Grok-2. + + + + Add the [xAI Grok-2 block](https://hub.continue.dev/xai/grok-2) from the hub + + + ```yaml title="config.yaml" + models: + - name: Grok-2 + provider: xAI + model: grok-2-latest + apiKey: + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "Grok-2", + "provider": "xAI", + "model": "grok-2-latest", + "apiKey": "" + } + ] + } + ``` + + + +### Gemini 2.0 Flash from Google + +If you prefer to use a model from [Google](../model-providers/top-level/gemini.mdx), then we recommend Gemini 2.0 Flash. + + + + Add the [Gemini 2.0 Flash block](https://hub.continue.dev/google/gemini-2.0-flash) from the hub + + + ```yaml title="config.yaml" + models: + - name: Gemini 2.0 Flash + provider: gemini + model: gemini-2.0-flash + apiKey: + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "Gemini 2.0 Flash", + "provider": "gemini", + "model": "gemini-2.0-flash", + "apiKey": "" + } + ] + } + ``` + + + +## Local, offline experience + +For the best local, offline Chat experience, you will want to use a model that is large but fast enough on your machine. + +### Llama 3.1 8B + +If your local machine can run an 8B parameter model, then we recommend running Llama 3.1 8B on your machine (e.g. using [Ollama](../model-providers/top-level/ollama.mdx) or [LM Studio](../model-providers/more/lmstudio.mdx)). + + + + + + Add the [Ollama Llama 3.1 8b block](https://hub.continue.dev/ollama/llama3.1-8b) from the hub + + {/* HUB_TODO nonexistent block */} + {/* + Add the [LM Studio Llama 3.1 8b block](https://hub.continue.dev/explore/models) from the hub + */} + + + + + + ```yaml title="config.yaml" + models: + - name: Llama 3.1 8B + provider: ollama + model: llama3.1:8b + ``` + + + ```yaml title="config.yaml" + models: + - name: Llama 3.1 8B + provider: lmstudio + model: llama3.1:8b + ``` + + + + + + + ```json title="config.json" + { + "models": [ + { + "title": "Llama 3.1 8B", + "provider": "ollama", + "model": "llama3.1:8b" + } + ] + } + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "Llama 3.1 8B", + "provider": "lmstudio", + "model": "llama3.1-8b" + } + ] + } + ``` + + + + + +### DeepSeek Coder 2 16B + +If your local machine can run a 16B parameter model, then we recommend running DeepSeek Coder 2 16B (e.g. using [Ollama](../model-providers/top-level/ollama.mdx) or [LM Studio](../model-providers/more/lmstudio.mdx)). + + + {/* HUB_TODO nonexistent blocks */} + {/* + + + Add the [Ollama Deepseek Coder 2 16B block](https://hub.continue.dev/explore/models) from the hub + + + Add the [LM Studio Deepseek Coder 2 16B block](https://hub.continue.dev/explore/models) from the hub + + + */} + + + + ```yaml title="config.yaml" + models: + - name: DeepSeek Coder 2 16B + provider: ollama + model: deepseek-coder-v2:16b + ``` + + + ```yaml title="config.yaml" + models: + - name: DeepSeek Coder 2 16B + provider: lmstudio + model: deepseek-coder-v2:16b + ``` + + + + + + + ```json title="config.json" + { + "models": [ + { + "title": "DeepSeek Coder 2 16B", + "provider": "ollama", + "model": "deepseek-coder-v2:16b", + "apiBase": "http://localhost:11434" + } + ] + } + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "DeepSeek Coder 2 16B", + "provider": "lmstudio", + "model": "deepseek-coder-v2:16b" + } + ] + } + ``` + + + + + +## Other experiences + +There are many more models and providers you can use with Chat beyond those mentioned above. Read more [here](../model-roles/chat.mdx) diff --git a/docs/docs/customize/model-roles/edit.mdx b/docs/docs/customize/model-roles/edit.mdx new file mode 100644 index 000000000..57bbc76aa --- /dev/null +++ b/docs/docs/customize/model-roles/edit.mdx @@ -0,0 +1,48 @@ +--- +title: Edit Role +description: Edit model role +keywords: [edit, editing, model, role] +sidebar_position: 3 +--- + +import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; + +It's often useful to select a different model to respond to Edit prompts than for chat prompts, as Edits are often more code-specific and may require less conversational readability. + +In Continue, you can add `edit` to a model's roles to specify that it can be used for Edit requests. If no edit models are specified, the selected `chat` model is used. + + + + Use model roles. + ```yaml title="config.yaml" + models: + - name: Claude 3.5 Sonnet + provider: anthropic + model: claude-3-5-sonnet-latest + apiKey: + roles: + - edit + ``` + + + Set the `experimental.modelRoles.inlineEdit` property in `config.json`. + ```json title="config.json" + { + "models": { + "name": "Claude 3.5 Sonnet", + "provider": "anthropic", + "model": "claude-3-5-sonnet-latest", + "apiKey": "" + }, + "experimental": { + "modelRoles": { + "inlineEdit": "Claude 3.5 Sonnet", + } + } + } + ``` + + + +Explore edit models in [the hub](https://hub.continue.dev/explore/models?roles=edit). Generally, we our recommendations for Edit overlap with recommendations for Chat. diff --git a/docs/docs/customize/model-types/embeddings.mdx b/docs/docs/customize/model-roles/embeddings.mdx similarity index 84% rename from docs/docs/customize/model-types/embeddings.mdx rename to docs/docs/customize/model-roles/embeddings.mdx index ee22f7301..a58cd520d 100644 --- a/docs/docs/customize/model-types/embeddings.mdx +++ b/docs/docs/customize/model-roles/embeddings.mdx @@ -1,23 +1,21 @@ --- -title: Embeddings model -description: Embeddings model -keywords: [embedding] -sidebar_position: 3 +title: Embed Role +description: Embed model role +keywords: [embedding, model, role, embeddings] +sidebar_position: 5 --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; An "embeddings model" is trained to convert a piece of text into a vector, which can later be rapidly compared to other vectors to determine similarity between the pieces of text. Embeddings models are typically much smaller than LLMs, and will be extremely fast and cheap in comparison. In Continue, embeddings are generated during indexing and then used by [@Codebase](../deep-dives/codebase.mdx) to perform similarity search over your codebase. -:::info[Default model (VS Code only)] -`transformers.js` is used as a default embeddings model in VS Code. In JetBrains, there currently is no default. -::: +You can add `embed` to a model's `roles` to specify that it can be used to embed. -:::info[Free Trial] -The free trial supports embeddings (provider: `free-trial`) +:::info[Built-in model (VS Code only)] +`transformers.js` is used as a built-in embeddings model in VS Code. In JetBrains, there currently is no built-in embedder. ::: ## Recommended embedding models @@ -30,9 +28,12 @@ If you want to generate embeddings locally, we recommend using `nomic-embed-text After obtaining an API key from [here](https://www.voyageai.com/), you can configure like this: - + + + [Voyage Code 3 Embedder Block](https://hub.continue.dev/voyageai/voyage-code-3) + - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Voyage Code 3 provider: voyage @@ -65,7 +66,7 @@ See [here](../model-providers/top-level/ollama.mdx#embeddings-model) for instruc - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: default-transformers provider: transformers.js @@ -89,8 +90,12 @@ See [here](../model-providers/top-level/ollama.mdx#embeddings-model) for instruc [Hugging Face Text Embeddings Inference](https://huggingface.co/docs/text-embeddings-inference/en/index) enables you to host your own embeddings endpoint. You can configure embeddings to use your endpoint as follows: + {/* HUB_TODO nonexistent block */} + {/* + [HuggingFace Text Embedder Block](https://hub.continue.dev/) + */} - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Huggingface TEI Embedder provider: huggingface-tei diff --git a/docs/docs/customize/model-roles/intro.mdx b/docs/docs/customize/model-roles/intro.mdx new file mode 100644 index 000000000..3c3a6476e --- /dev/null +++ b/docs/docs/customize/model-roles/intro.mdx @@ -0,0 +1,31 @@ +--- +title: Intro to Roles +description: Apply model role +keywords: [apply, model, role] +sidebar_position: 0 +sidebar_label: Introduction +--- + +import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; + +Models in Continue can be configured to be used for various roles in the extension. + +- [`chat`](./chat.mdx): Used for chat conversations in the extension sidebar +- [`autocomplete`](./autocomplete.md): Used for autocomplete code suggestions in the editor +- [`edit`](./edit.mdx): Used to generate code based on edit prompts +- [`apply`](./apply.mdx): Used to decide how to apply edits to a file +- [`embed`](./embeddings.mdx): Used to generate embeddings used for vector search (@Codebase and @Docs context providers) +- [`rerank`](./reranking.mdx): Used to rerank results from vector search + +These roles can be specified for a `config.yaml` model block using `roles`. See the [YAML Specification](../../yaml-reference.md#models) for more details. + +## Selecting model roles + +You can control which of the models in your assistant for a given role will be currently used for that role. Visit the [Settings page](../settings.md) and go to the **Active Models** section. + +![Settings Active Models Section](/img/settings-model-roles.png) + +:::info +Note that `roles` do not exist within `config.json` - they are infered by the top level keys like `embeddingsProvider` +::: diff --git a/docs/docs/customize/model-types/reranking.mdx b/docs/docs/customize/model-roles/reranking.mdx similarity index 79% rename from docs/docs/customize/model-types/reranking.mdx rename to docs/docs/customize/model-roles/reranking.mdx index 098dd94bc..c16dab7a0 100644 --- a/docs/docs/customize/model-types/reranking.mdx +++ b/docs/docs/customize/model-roles/reranking.mdx @@ -1,16 +1,16 @@ --- -title: Reranking model -description: Reranking model -keywords: [rerank] -sidebar_position: 4 +title: Rerank Role +description: Rerank model role +keywords: [rerank, reranking, model, role] +sidebar_position: 6 --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; A "reranking model" is trained to take two pieces of text (often a user question and a document) and return a relevancy score between 0 and 1, estimating how useful the document will be in answering the question. Rerankers are typically much smaller than LLMs, and will be extremely fast and cheap in comparison. -In Continue, reranking is used by [@Codebase](../deep-dives/codebase.mdx) in order to select the most relevant code snippets after vector search. +In Continue, rerankers are designated using the `rerank` role and used by [@Codebase](../deep-dives/codebase.mdx) in order to select the most relevant code snippets after vector search. ## Recommended reranking models @@ -18,9 +18,12 @@ If you have the ability to use any model, we recommend `rerank-2` by Voyage AI, ### Voyage AI -Voyage AI offers the best reranking model for code with their `rerank-2` model. After obtaining an API key from [here](https://www.voyageai.com/), you can configure like this: +Voyage AI offers the best reranking model for code with their `rerank-2` model. After obtaining an API key from [here](https://www.voyageai.com/), you can configure a reranker as follows: - + + + [Voyage Rerank 2 Block](https://hub.continue.dev/voyageai/rerank-2) + ```yaml title="config.yaml" models: @@ -52,6 +55,10 @@ Voyage AI offers the best reranking model for code with their `rerank-2` model. See Cohere's documentation for rerankers [here](https://docs.cohere.com/docs/rerank-2). + {/* HUB_TODO block doesn't exist */} + {/* + [Cohere Reranker English v3](https://hub.continue.dev/) + */} ```yaml title="config.yaml" models: @@ -83,6 +90,10 @@ See Cohere's documentation for rerankers [here](https://docs.cohere.com/docs/rer If you only have access to a single LLM, then you can use it as a reranker. This is discouraged unless truly necessary, because it will be much more expensive and still less accurate than any of the above models trained specifically for the task. Note that this will not work if you are using a local model, for example with Ollama, because too many parallel requests need to be made. + {/* HUB_TODO block doesn't exist */} + {/* + [GPT-4o LLM Reranker Block](https://hub.continue.dev/) + */} ```yaml title="config.yaml" models: @@ -114,8 +125,12 @@ The `"modelTitle"` field must match one of the models in your "models" array in [Hugging Face Text Embeddings Inference](https://huggingface.co/docs/text-embeddings-inference/en/index) enables you to host your own [reranker endpoint](https://huggingface.github.io/text-embeddings-inference/#/Text%20Embeddings%20Inference/rerank). You can configure your reranker as follows: + {/* HUB_TODO */} + {/* + [HuggingFace TEI Reranker block](https://hub.continue.dev/) + */} - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Huggingface-tei Reranker provider: huggingface-tei @@ -139,28 +154,3 @@ The `"modelTitle"` field must match one of the models in your "models" array in ``` - -### Free Trial (Voyage AI) - -Continue offers a free trial of Voyage AI's reranking model. - - - - ```yaml title="config.yaml" - models: - - name: Free Trial Reranker - provider: free-trial - roles: - - rerank - ``` - - - ```json title="config.json" - { - "reranker": { - "name": "free-trial" - } - } - ``` - - diff --git a/docs/docs/customize/model-types/autocomplete.md b/docs/docs/customize/model-types/autocomplete.md deleted file mode 100644 index 4b14775d1..000000000 --- a/docs/docs/customize/model-types/autocomplete.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Autocomplete model -description: Autocomplete model -keywords: [autocomplete] -sidebar_position: 1 ---- - -An "autocomplete model" is an LLM that is trained on a special format called fill-in-the-middle (FIM). This format is designed to be given the prefix and suffix of a code file and predict what goes between. This task is very specific, which on one hand means that the models can be smaller (even a 3B parameter model can perform well). On the other hand, this means that Chat models, though larger, will perform poorly. - -In Continue, these models are used to display inline [Autocomplete](../../autocomplete/how-to-use-it.md) suggestions as you type. - -## Recommended Autocomplete models - -If you have the ability to use any model, we recommend `Codestral` with [Mistral](../model-providers/top-level/mistral.mdx#autocomplete-model) or [Vertex AI](../model-providers/top-level/vertexai.mdx#autocomplete-model). - -If you want to run a model locally, we recommend `Qwen2.5-Coder 1.5B` with [Ollama](../model-providers/top-level/ollama.mdx#autocomplete-model). diff --git a/docs/docs/customize/model-types/chat.md b/docs/docs/customize/model-types/chat.md deleted file mode 100644 index bde3d5557..000000000 --- a/docs/docs/customize/model-types/chat.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: Chat model -description: Chat model -keywords: [chat] -sidebar_position: 2 ---- - -A "chat model" is an LLM that is trained to respond in a conversational format. Because they should be able to answer general questions and generate complex code, the best chat models are typically large, often 405B+ parameters. In Continue, these models are used for [Chat](../../chat/how-to-use-it.md), [Edit](../../edit/how-to-use-it.md), and [Actions](../../actions/how-to-use-it.md). - -## Recommended Chat models - -If you have the ability to use any model, we recommend [Claude 3.5 Sonnet](../model-providers/top-level/anthropic.mdx). - -Otherwise, some of the next best options are: - -- [GPT-4o](../model-providers/top-level/openai.mdx) -- [Grok-2](../model-providers/top-level/xAI.mdx) -- [Gemini 1.5 Pro](../model-providers/top-level/gemini.mdx) -- [Llama3.1 405B](../tutorials/llama3.1.mdx) diff --git a/docs/docs/customize/overview.md b/docs/docs/customize/overview.md index 1a52712b9..2024673f9 100644 --- a/docs/docs/customize/overview.md +++ b/docs/docs/customize/overview.md @@ -7,7 +7,7 @@ keywords: [customize, configure, config] Continue can be deeply customized. For example you might: - **Change your Model Provider**. Continue allows you to choose your favorite or even add multiple model providers. This allows you to use different models for different tasks, or to try another model if you're not happy with the results from your current model. Continue supports all of the popular model providers, including OpenAI, Anthropic, Microsoft/Azure, Mistral, and more. You can even self host your own model provider if you'd like. Learn more about [model providers](../customize/model-providers/). -- **Select different model providers for each Compose feature**. Different Continue features can use different model providers. We call these _model types_. For example, you can use a different model provider for chat than you do for autocomplete. Learn more about [model types](../customize/model-types/) . +- **Select different model providers for each Compose feature**. Different Continue features can use different model providers. We call these _model types_. For example, you can use a different model provider for chat than you do for autocomplete. Learn more about [model types](../customize/model-roles/) . - **Add a Context Provider**. Context providers allow you to add information to your prompts, giving your LLM additional context to work with. Context providers allow you to reference snippets from your codebase, or lookup relevant documentation, or use a search engine to find information and much more. Learn more about [context providers](/customize/context-providers). - **Create a Slash Command**. Slash commands allow you to easily add custom functionality to Continue. You can use a slash command that allows you to generate a shell command from natural language, or perhaps generate a commit message, or create your own custom command to do whatever you want. Learn more about [slash commands](/customize/slash-commands). - **Call external tools and functions**. Unchain your LLM with the power of _Tools_. You can call any external tool or function from your prompts. Currently only available with Anthropic. Learn more about [Tools](/customize/tools). @@ -21,7 +21,7 @@ Most custom configuration is done by editing `config.yaml` (or the older `config - MacOS and Linux: `~/.continue/config.yaml` - Windows: `%USERPROFILE%\.continue\config.yaml` -You can easily access config file from the Continue Chat sidebar. Open the sidebar by pressing cmd/ctrl + L (VS Code) or cmd/ctrl + J (JetBrains) and click the "gear" icon in header to open the Settings page. Then click the button labeled `Open config file`. +You can easily access config file from the Continue Chat sidebar. Open the sidebar by pressing cmd/ctrl + L (VS Code) or cmd/ctrl + J (JetBrains) and click the "gear" icon in header to open the Settings page. Then click the button labeled `Open configuration file`. ![configure-continue](/img/configure-continue.png) @@ -47,4 +47,4 @@ If you'd like to scope certain settings to a particular workspace, you can add a `config.yaml` or `config.json` can handle the vast majority of necessary configuration, so we recommend using it whenever possible. However, if you need to programmatically configure Continue, you can use `config.ts`, which is located at `~/.continue/config.ts` (MacOS / Linux) or `%USERPROFILE%\.continue\config.ts` (Windows). -For examples of how to use `config.ts`, see [writing custom slash commands](./tutorials/build-your-own-slash-command.md#custom-slash-commands) or [writing custom context providers](./tutorials/build-your-own-context-provider.md). +For examples of how to use `config.ts`, see [writing custom slash commands](./tutorials/build-your-own-slash-command.md#custom-slash-commands) or [writing custom context providers](./tutorials/build-your-own-context-provider.mdx). diff --git a/docs/docs/customize/slash-commands.mdx b/docs/docs/customize/slash-commands.mdx index 710d5fd69..e1890ba81 100644 --- a/docs/docs/customize/slash-commands.mdx +++ b/docs/docs/customize/slash-commands.mdx @@ -4,11 +4,11 @@ description: Shortcuts that can be activated by prefacing your input with '/' keywords: [slash command, custom commands, step] --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; :::info -Slash commands can currently only be added using [`config.json`](../json-reference.md). The [`YAML Config Format`](../reference.md) is the new and preferred format. We recommend looking into [Prompt Files](../customize/deep-dives/prompt-files.md) to achieve similar functionality. +Slash commands can currently only be added using [`config.json`](../reference.md). The [`YAML Config Format`](../reference.md) is the new and preferred format. We recommend looking into [Prompt Files](../customize/deep-dives/prompt-files.md) to achieve similar functionality. ::: Slash commands are shortcuts that can be activated by typing '/' and selecting from the dropdown. For example, the built-in '/edit' slash command lets you stream edits directly into your editor. @@ -120,7 +120,7 @@ The [Model Context Protocol](https://modelcontextprotocol.io/introduction) is a - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" mcpServers: - name: My MCP Server command: uvx diff --git a/docs/docs/customize/tools.mdx b/docs/docs/customize/tools.mdx index 2f06f5081..45280697e 100644 --- a/docs/docs/customize/tools.mdx +++ b/docs/docs/customize/tools.mdx @@ -4,13 +4,15 @@ description: Tool use and customization keywords: [tool, use, function calling, claude, automatic] --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; Tools allow Continue to take action in your IDE and beyond (when you give permission). Currently, they are only supported for the following providers: - [Anthropic](./model-providers/top-level/anthropic.mdx) - see recommended models [here](https://docs.anthropic.com/en/docs/build-with-claude/tool-use#choosing-a-model). - [Ollama](./model-providers/top-level/ollama.mdx) - see recommended models [here](https://ollama.com/search?c=tools). +- [OpenAI](./model-providers/top-level/openai.mdx) +- [Gemini](./model-providers/top-level/gemini.mdx) To use tools, click on the icon in the input toolbar like below. @@ -24,11 +26,15 @@ To let you balance speed and safety, each tool can be set to 1 of 3 modes: ### Custom tools -Currently custom tools can be configured using the [Model Context Protocol](https://modelcontextprotocol.io/introduction), a standard proposed by Anthropic to unify prompts, context, and tool use. Read their [quickstart](https://modelcontextprotocol.io/quickstart) to learn how to set up a local server and then configure your [config](../customize/deep-dives/configuration.md) like this: +Currently custom tools can be configured using the [Model Context Protocol](https://modelcontextprotocol.io/introduction), a standard proposed by Anthropic to unify prompts, context, and tool use. + +MCP Servers can be added to hub Assistants using `mcpServers` blocks. You can explore available MCP server blocks [here](https://hub.continue.dev/explore/mcp). + +To set up your own MCP server, read the [MCP quickstart](https://modelcontextprotocol.io/quickstart) and then [create an `mcpServers` block](https://hub.continue.dev/new?type=block&block=mcpServers) or add the following to your [config file](../customize/deep-dives/configuration.md): - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" mcpServers: - name: My MCP Server command: uvx diff --git a/docs/docs/customize/tutorials/build-your-own-context-provider.md b/docs/docs/customize/tutorials/build-your-own-context-provider.mdx similarity index 83% rename from docs/docs/customize/tutorials/build-your-own-context-provider.md rename to docs/docs/customize/tutorials/build-your-own-context-provider.mdx index 33ba4441a..7710a84c2 100644 --- a/docs/docs/customize/tutorials/build-your-own-context-provider.md +++ b/docs/docs/customize/tutorials/build-your-own-context-provider.mdx @@ -2,14 +2,60 @@ title: Build your own context provider --- +import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; + +# Build Your Own Context Provider + +Continue offers several way to provide your custom context to the extension. + +## HTTP Context Provider + +Continue can retrieve context from a custom HTTP server that you create and serve. Add the `@HTTP` context provider to your configuration like this: + + + + ```yaml title="config.yaml" + context: + provider: http + params: + url: https://myserver.com/context-provider + title: http + displayTitle: My Custom Context + description: Gets things from my private list + options: + maxItems: 20 + ``` + + + ```json title="config.json" + { + "name": "http", + "params": { + "url": "https://myserver.com/context-provider", + "title": "http", + "description": "Custom HTTP Context Provider", + "displayTitle": "My Custom Context", + "options": { + "maxItems": 20 + } + } + } + ``` + + + +Then, create a server that responds to requests as are made from [HttpContextProvider.ts](https://github.com/continuedev/continue/blob/main/core/context/providers/HttpContextProvider.ts). See the `hello` endpoint in [context_provider_server.py](https://github.com/continuedev/continue/blob/main/core/context/providers/context_provider_server.py) for an example that uses FastAPI. + +The `"options"` property can be used to send additional parameters to your endpoint, which will be included in the request body. + :::info -Custom context providers are added through `~/config.ts`. The [`YAML Config Format`](../../reference.md) is the new and preferred config format. We recommend looking into [Prompt Files](../deep-dives/prompt-files.md) and [MCP Servers](../context-providers.mdx#modelcontextprotocol) to achieve similar functionality. +The following methods for creating custom context providers are deprecated. We recommend using HTTP context providers, [MCP Servers](../context-providers.mdx#model-context-protocol), and [Prompt files](../deep-dives/prompt-files.md) where possible. ::: -## Introductory Example +## Using CustomContextProvider -To write your own context provider, you just have to implement the `CustomContextProvider` -interface: +Custom context providers can be implemented in a `config.ts` placed in your Continue global directory (`~/.continue` for MacOS, `%USERPROFILE%/.continue` for Windows). You can implement the `CustomContextProvider` interface in your `config.ts` ```typescript interface CustomContextProvider { @@ -75,7 +121,7 @@ export function modifyConfig(config: Config): Config { This is automatically appended to your configuration. -## Custom Context Providers with Submenu or Query +### Custom Context Providers with Submenu or Query There are 3 types of context providers: "normal", "query", and "submenu". The "normal" type is the default, and is what we've seen so far. @@ -163,13 +209,13 @@ The flow of information in the above example is as follows: 3. The `id` of the chosen `ContextSubmenuItem` is passed to `getContextItems` as the `query` argument. In this case it is the filepath of the README. 4. The `getContextItems` function can then use the `query` to retrieve the full contents of the README and format the content before returning the context item which will be included in the prompt. -## Importing outside modules +### Importing outside modules To include outside Node modules in your config.ts, run `npm install ` from the `~/.continue` directory, and then import them in config.ts. Continue will use [esbuild](https://esbuild.github.io/) to bundle your `config.ts` and any dependencies into a single Javascript file. The exact configuration used can be found [here](https://github.com/continuedev/continue/blob/5c9874400e223bbc9786a8823614a2e501fbdaf7/extensions/vscode/src/ideProtocol.ts#L45-L52). -## `CustomContextProvider` Reference +### `CustomContextProvider` Reference - `title`: An identifier for the context provider - `displayTitle` (optional): The title displayed in the dropdown @@ -183,27 +229,7 @@ Continue will use [esbuild](https://esbuild.github.io/) to bundle your `config.t - `extras.ide`: An instance of the `IDE` class, which lets you gather various sources of information from the IDE, including the contents of the terminal, the list of open files, or any warnings in the currently open file. - `query`: (not currently used) A string representing the query - `loadSubmenuItems` (optional): A function that returns a list of `ContextSubmenuItem`s to display in a submenu. It is given access to an `IDE`, the same that is passed to `getContextItems`. - -## Writing Context Providers in Other Languages - -If you'd like to write a context provider in a language other than TypeScript, you can use the "http" context provider to call a server that hosts your own code. Add the context provider to `config.json` like this: - -```json title="config.json" -{ - "name": "http", - "params": { - "url": "https://myserver.com/context-provider", - "title": "http", - "description": "Custom HTTP Context Provider", - "displayTitle": "My Custom Context", - "options": {} - } -} -``` - -Then, create a server that responds to requests as are made from [HttpContextProvider.ts](../../../../core/context/providers/HttpContextProvider.ts). See the `hello` endpoint in [context_provider_server.py](../../../../core/context/providers/context_provider_server.py) for an example that uses FastAPI. - -The `"options"` property can be used to send additional parameters to your endpoint, which will be included in the request body. + . ## Extension API for VSCode diff --git a/docs/docs/customize/tutorials/build-your-own-slash-command.md b/docs/docs/customize/tutorials/build-your-own-slash-command.md index 27b0517b3..f0cc1147f 100644 --- a/docs/docs/customize/tutorials/build-your-own-slash-command.md +++ b/docs/docs/customize/tutorials/build-your-own-slash-command.md @@ -3,7 +3,7 @@ title: Build your own slash command --- :::info -Slash commands can currently only be added using [`config.json`](../../json-reference.md) or `config.ts`. The [`YAML Config Format`](../../reference.md) is the new and preferred format. We recommend looking into [Prompt Files](../deep-dives/prompt-files.md) to achieve similar functionality. +Slash commands can currently only be added using [`config.json`](../../reference.md) or `config.ts`. The [`YAML Config Format`](../../reference.md) is the new and preferred format. We recommend looking into [Prompt Files](../deep-dives/prompt-files.md) to achieve similar functionality. ::: There are two ways to add custom slash commands: diff --git a/docs/docs/customize/tutorials/how-to-self-host-a-model.mdx b/docs/docs/customize/tutorials/how-to-self-host-a-model.mdx index abd726aba..ab3c9b1b5 100644 --- a/docs/docs/customize/tutorials/how-to-self-host-a-model.mdx +++ b/docs/docs/customize/tutorials/how-to-self-host-a-model.mdx @@ -2,8 +2,8 @@ title: How to self-host a model --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; You can deploy a model in your [AWS](https://github.com/continuedev/deploy-os-code-llm#aws), [GCP](https://github.com/continuedev/deploy-os-code-llm#gcp), [Azure](https://github.com/continuedev/deploy-os-code-llm#azure), [Lambda](https://lambdalabs.com/), or [other clouds](https://github.com/continuedev/deploy-os-code-llm#others-2) using: @@ -25,7 +25,7 @@ Basic authentication can be done with any provider using the `apiKey` field: - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Ollama provider: ollama @@ -55,7 +55,7 @@ If you need to send custom headers for authentication, you may use the `requestO - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Ollama provider: ollama diff --git a/docs/docs/customize/tutorials/llama3.1.mdx b/docs/docs/customize/tutorials/llama3.1.mdx index 294fc4e8b..413214fb4 100644 --- a/docs/docs/customize/tutorials/llama3.1.mdx +++ b/docs/docs/customize/tutorials/llama3.1.mdx @@ -4,8 +4,8 @@ description: How to use Llama 3.1 with Continue keywords: [llama, meta, togetherai, ollama, replicate] --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; Continue makes it easy to code with the latest open-source models, including the entire Llama 3.1 family of models. Llama 3.2 models are also supported but not recommended for chat, because they are specifically designed to be small or multi-modal. @@ -23,7 +23,7 @@ Ollama is the fastest way to get up and running with local language models. We r - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Llama 3.1 8b provider: ollama @@ -92,7 +92,7 @@ Together AI provides fast and reliable inference of open-source models. You'll b - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Llama 3.1 405b provider: together @@ -125,7 +125,7 @@ Replicate makes it easy to host and run open-source AI with an API. - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Llama 3.1 405b provider: replicate @@ -193,7 +193,7 @@ Cerebras Inference uses specialized silicon to provides fast inference for the L - ```yaml title="Package or config.yaml" + ```yaml title="config.yaml" models: - name: Cerebras Llama 3.1 70B provider: cerebras diff --git a/docs/docs/edit/how-to-customize.mdx b/docs/docs/edit/how-to-customize.mdx index ef8e44a54..35b918393 100644 --- a/docs/docs/edit/how-to-customize.mdx +++ b/docs/docs/edit/how-to-customize.mdx @@ -5,40 +5,7 @@ description: How to customize Edit keywords: [edit, cmd i, works] --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; -You can configure a particular model to be used for Edit: - - - - Use model roles. - ```yaml title="Package or config.yaml" - models: - - name: Claude 3.5 Sonnet - provider: anthropic - model: claude-3-5-sonnet-latest - apiKey: - roles: - - edit - ``` - - - Set the `experimental.modelRoles.inlineEdit` property in `config.json`. - ```json title="config.json" - { - "models": { - "name": "Claude 3.5 Sonnet", - "provider": "anthropic", - "model": "claude-3-5-sonnet-latest", - "apiKey": "" - }, - "experimental": { - "modelRoles": { - "inlineEdit": "Claude 3.5 Sonnet", - } - } - } - ``` - - +You can configure a particular model to be used for Edit by setting/overriding `roles` in the model's YAML config. See [Edit role](../customize/model-roles/edit.mdx) for more details. diff --git a/docs/docs/edit/model-setup.md b/docs/docs/edit/model-setup.md index ad884b334..606bd0654 100644 --- a/docs/docs/edit/model-setup.md +++ b/docs/docs/edit/model-setup.md @@ -7,4 +7,6 @@ keywords: [edit, cmd l, model] By default, Edit uses the [same model as Chat](../chat/model-setup.mdx) since we recommend a similar, 400B+ parameter model or one of the frontier model for code edits. -You can configure a different model to be used for edits by updating your [configuration](../reference.md). +Visit [the hub](https://hub.continue.dev/explore/models?roles=edit) to explore Edit models. + +You can configure a different model to be used for edits by updating your [configuration](../customize/model-roles/edit.mdx). diff --git a/docs/docs/getting-started/install.md b/docs/docs/getting-started/install.md index f144a37a1..b62dbacd8 100644 --- a/docs/docs/getting-started/install.md +++ b/docs/docs/getting-started/install.md @@ -9,6 +9,7 @@ keywords: [install, installation, getting started, vs code, jetbrains] 1. Click `Install` on the [Continue extension page in the Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Continue.continue) 2. This will open the Continue extension page in VS Code, where you will need to click `Install` again 3. The Continue logo will appear on the left sidebar. For a better experience, move Continue to the right sidebar +4. [Sign in to the hub](#signing-in) to get started with your first assistant. ![move-to-right-sidebar](/img/move-to-right-sidebar.gif) @@ -21,9 +22,16 @@ If you have any problems, see the [troubleshooting guide](../troubleshooting.mdx 1. Open your JetBrains IDE and open **Settings** using Ctrl + Alt + S 2. Select **Plugins** on the sidebar and search for "Continue" in the marketplace 3. Click `Install`, which will cause the Continue logo to show up on the right toolbar +4. [Sign in to the hub](#signing-in) to get started with your first assistant. ![jetbrains-getting-started.png](/img/jetbrains-getting-started.png) :::info[Troubleshooting] If you have any problems, see the [troubleshooting guide](../troubleshooting.mdx) or ask for help in [our Discord](https://discord.com/invite/EfJEfdFnDQ) ::: + +## Signing in + +Click "Get started" to sign in to the hub and start using assistants. + +![Hub Onboarding in the Extension](/img/hub/hub-onboarding-card.png) diff --git a/docs/docs/hub/assistants/create-an-assistant.md b/docs/docs/hub/assistants/create-an-assistant.md new file mode 100644 index 000000000..207f1c955 --- /dev/null +++ b/docs/docs/hub/assistants/create-an-assistant.md @@ -0,0 +1,38 @@ +--- +title: Create an assistant +sidebar_label: Create an assistant +description: How to create a custom AI code assistant +keywords: [assistants, creation, guide] +--- + +# Create an assistant + +## Remix an assistant + +You should remix an assistant if you want to use it after some modifications. + +By clicking the “remix” button, you’ll be taken to the “Create a remix” page. + +![Remix Assistant Button](/img/hub/assistant-remix-button.png) + +Once here, you’ll be able to + +1. add or remove blocks in YAML configuration +2. change the name, description, icon, etc. + +Clicking “Create assistant” will make this assistant available for use. + +## Create an assistant from scratch + +To create an assistant from scratch, select “New assistant” in the top bar. + +![New assistant button](/img/hub/assistant-new-button.png) + +Choose a name, slug, description, and icon for your assistant. + +The easiest way to create an assistant is to click "Create assistant" with the default configuration and then add / remove blocks using the sidebar. + +Alternatively, you can edit the assistant YAML directly before clicking "Create assistant". Refer to examples of assistants on [hub.continue.dev](https://hub.continue.dev/explore/assistants) and visit the [YAML Reference](../../yaml-reference.md#complete-yaml-config-example) docs for more details. + +![New assistant YAML](/img/hub/assistant-create-yaml.png) + diff --git a/docs/docs/hub/assistants/edit-an-assistant.md b/docs/docs/hub/assistants/edit-an-assistant.md new file mode 100644 index 000000000..9a4c8aeee --- /dev/null +++ b/docs/docs/hub/assistants/edit-an-assistant.md @@ -0,0 +1,26 @@ +--- +title: Edit an Assistant +sidebar_label: Edit an Assistant +description: How to edit a custom AI coding assistant. +keywords: [assistants, creation, guide] +--- + +# Edit an Assistant + +New versions of an assistant can be created and published using the sidebar. + +![Remix Assistant Button](/img/hub/assistant-create-sidebar.png) + +First, select an assistant from the dropdown at the top. + +While editing an assistant, you can explore the hub and click "Add Block" from a block page to add it to your assistant. + +For blocks that require secret values like API keys, you will see a small notification on the block's tile in the sidebar that will indicate if action is needed. + +To delete a block, click the trash icon. + +If a block you want to use does not exist yet, you can [create a new block](../blocks/create-a-block.md). + +When you are done editing, click "Publish" to publish a new version of the assistant. + +Click "Open VS Code" or "Open JetBrains" to open your IDE for using the assistant. \ No newline at end of file diff --git a/docs/docs/hub/assistants/intro.md b/docs/docs/hub/assistants/intro.md new file mode 100644 index 000000000..716e8f0d8 --- /dev/null +++ b/docs/docs/hub/assistants/intro.md @@ -0,0 +1,14 @@ +--- +title: Assistants Introduction +sidebar_label: Introduction +description: Overview of assistants functionality. +keywords: [assistants, overview, customization] +--- + +# Introduction to Assistants + +Custom AI code assistants are configurations of building [blocks](../blocks/intro.md) that enable a coding experience tailored to your specific use cases. + +`config.yaml` is a format for defining custom AI code assistants. An assistant has some top-level properties (e.g. `name`, `version`), but otherwise consists of composable lists of **blocks** such as `models` and `rules`, which are the atomic building blocks of an assistant. + +The `config.yaml` is parsed by the open-source Continue IDE extensions to create custom assistant experiences. When you log in to [hub.continue.dev](https://hub.continue.dev/), your assistants will automatically be synced with the IDE extensions. diff --git a/docs/docs/hub/assistants/use-an-assistant.md b/docs/docs/hub/assistants/use-an-assistant.md new file mode 100644 index 000000000..081118c23 --- /dev/null +++ b/docs/docs/hub/assistants/use-an-assistant.md @@ -0,0 +1,20 @@ +--- +title: Use an assistant +sidebar_label: Use an assistant +description: Guide to using assistants in your Continue workflow. +keywords: [assistants, usage, use, guide] +--- + +# Use an assistant + +To use an existing assistant, you can explore other assistants [here](https://hub.continue.dev/explore/assistants). + +Once you've found the assistant you want to use + +1. Click “Add Assistant” on its page +2. Add any required inputs (e.g. secrets like API keys) +3. Select “Save changes” in assistant sidebar on the right hand side + +After this, you can then go to your IDE extension and begin using the assistant by selecting it from the assistant dropdown. + +[Extension Assistant Selector](/img/hub/assistant-extension-select.png) \ No newline at end of file diff --git a/docs/docs/hub/blocks/block-types.md b/docs/docs/hub/blocks/block-types.md new file mode 100644 index 000000000..51ec97b10 --- /dev/null +++ b/docs/docs/hub/blocks/block-types.md @@ -0,0 +1,55 @@ +--- +title: Block Types +description: Overview of different block types +keywords: [blocks, types, overview] +sidebar_label: Types +--- + +# Block Types + +## Models + +Models are blocks that let you specify Large Language Models (LLMs) and other deep learning models to be used for various roles in the open-source IDE extension like Chat, Autocomplete, Edit, Embed, Rerank, etc. You can explore available models on [the hub](https://hub.continue.dev/explore/models). + +Continue supports [many model providers](../../customize/model-providers), including Anthropic, OpenAI, Gemini, Ollama, Amazon Bedrock, Azure, xAI, DeepSeek, and more. Models can have one or more of the following roles depending on its capabilities, including `chat`, `edit`, `apply`, `autocomplete`, `embed`, and `rerank`. Read more about roles [here](../../customize/model-roles). View [`models`](../../yaml-reference.md#models) in the YAML Reference for more details. + +## Context + +Context blocks define a context provider which can be referenced in Chat with `@` to pull in data from external sources such as files and folders, a URL, Jira or Confluence, and Github issues, among others. [Explore context provider blocks](https://hub.continue.dev/explore/context) on the hub. + +Learn more about context providers [here](../../yaml-reference.md#context), and check out [this guide](../../customize/tutorials/build-your-own-context-provider.mdx) to creating your own custom context provider. The `config.yaml` spec for context can be found [`here`](../../yaml-reference.md#context). + +## Docs + +Docs are blocks that point to documentation sites, which will be indexed locally and then can be referenced as context using @Docs in Chat. [Explore docs](https://hub.continue.dev/explore/docs) on the hub. + +Learn more in the [@Docs deep dive](../../customize/deep-dives/docs.mdx), and view [`docs`](../../yaml-reference.md#docs) in the YAML Reference for more details. + +## MCP Servers + +Model Context Protocol (MCP) is a standard way of building and sharing tools for language models. MCP Servers can be defined in `mcpServers` blocks. [Explore MCP Servers](https://hub.continue.dev/explore/mcp) on the hub. + +Learn more in the [Tools deep dive](../../customize/tools.mdx), and view [`mcpServers`](../../yaml-reference.md#mcpservers) in the YAML Reference for more details. + +## Rules + +Rules blocks are instructions that your custom AI code assistant will always keep in mind - the contents of rules are inserted into the system message for all Chat requests. [Explore rules](https://hub.continue.dev/explore/rules) on the hub. + +Learn more in the [rules deep dive](../../customize/deep-dives/rules.md), and view [`rules`](../../yaml-reference.md#rules) in the YAML Reference for more details. + +## Prompts + +Prompts blocks are pre-written, reusable prompts that can be referenced at any time during chat. They are especially useful as context for repetitive and/or complex tasks. [Explore prompts](https://hub.continue.dev/explore/prompts) on the hub. + +Prompt blocks have the same syntax as [prompt files](../../customize/deep-dives/prompt-files.md). There are two important differences between prompt blocks and prompt files: + +1. Prompt blocks are stored within `config.yaml` rather than `.continue/prompts` in project directory and +2. Prompt blocks only show up as slash commands in Chat, not under the `@Prompt Files` context provider + +The `config.yaml` spec for `prompts` can be found [here](../../yaml-reference.md#prompts). + +## Data + +Data blocks allow you send your development data to custom destinations of your choice. Development data can be used for a variety of purposes, including analyzing usage, gathering insights, or fine-tuning models. You can read more about development data [here](../../customize/deep-dives/development-data.md). Explore data block examples [here](https://hub.continue.dev/explore/data). + +Data destinations are configured in the[`data`](../../yaml-reference.md#data) section of `config.yaml`. \ No newline at end of file diff --git a/docs/docs/hub/blocks/bundles.md b/docs/docs/hub/blocks/bundles.md new file mode 100644 index 000000000..6d54ed519 --- /dev/null +++ b/docs/docs/hub/blocks/bundles.md @@ -0,0 +1,39 @@ +--- +title: Bundles +sidebar_label: Bundles +description: Introduction to bundles +keywords: [blocks, bundles] +--- + +# Bundles + +Bundles are collections of blocks that are commonly used together. You can use them to add multiple building blocks to your custom AI code assistants at once. They are only a concept on [hub.continue.dev](https://hub.continue.dev), so they are not represented in `config.yaml`. + +## Use a bundle + +Once you know which bundle you want to use, you’ll need to + +1. Make sure the correct assistant is in the sidebar +2. Click “Add all blocks". This adds the individual blocks to your assistant. +3. Add any required inputs (e.g. secrets) for each block. +4. Select “Save changes” in assistant sidebar on the right hand side + +After this, you can then go to your IDE extension using the "Open VS Code" or "Open Jetbrains" buttons and begin using the new blocks. + +## Create a bundle + +To create a bundle, click “New bundle” in the header. + +![New bundle button](/img/hub/bundle-new-button.png) + +Choose a name, slug, description, and visibility for your bundle. + +Then, search blocks using the "Search blocks" input and add them to your bundle. + +![Create bundle page](/img/hub/bundle-create-page.png) + +Once you have added all the blocks you want in your bundle, click "Create Bundle" to save it and make it available for use. + +## Remix a bundle + +It is not currently possible to remix a bundle. \ No newline at end of file diff --git a/docs/docs/hub/blocks/create-a-block.md b/docs/docs/hub/blocks/create-a-block.md new file mode 100644 index 000000000..870295c99 --- /dev/null +++ b/docs/docs/hub/blocks/create-a-block.md @@ -0,0 +1,32 @@ +--- +title: Create a block +sidebar_label: Create a block +description: Guide to creating blocks +keywords: [blocks, creation, create, use] +--- + +# Create a block + +## Remix a block + +You should remix a block if you want to use it after some modifications. + +By clicking the “remix” button, you’ll be taken to the “Create a remix” page. + +![Remix block button](/img/hub/block-remix-button.png) + +Once here, you’ll be able to 1) edit YAML configuration for the block and 2) change name, description, icon, etc. Clicking “Create block” will make this block available for use in an assistant. + +## Create a block from scratch + +To create a block from scratch, you will need to click “New block” in the top bar. + +![New block button](/img/hub/block-new-button.png) + +After filling out information on the block, you will want to create a block following the `config.yaml` [reference documentation](../../yaml-reference.md). Refer to examples of blocks on [hub.continue.dev](https://hub.continue.dev/explore/models) and visit the [YAML Reference](../../yaml-reference.md#complete-yaml-config-example) docs for more details. + +![New block page](/img/hub/block-new-page.png) + +### Block inputs + +Blocks can receive values, including secrets, as inputs through templating. For values that the user of the block needs to set, you can use template variables (e.g. `${{ inputs.API_KEY}}`). Then, the user can set `API_KEY: ${{ secrets.MY_API_KEY }}` in the `with` clause of their assistant. \ No newline at end of file diff --git a/docs/docs/hub/blocks/intro.md b/docs/docs/hub/blocks/intro.md new file mode 100644 index 000000000..919aa9f7d --- /dev/null +++ b/docs/docs/hub/blocks/intro.md @@ -0,0 +1,12 @@ +--- +title: Introduction +sidebar_label: Introduction +description: Introduction to blocks +keywords: [blocks, introduction, basics] +--- + +# Introduction + +Blocks are the components you use to build a custom AI code assistant. These include [models](./block-types.md#models), [rules](./block-types.md#rules), [context providers](./block-types.md#context), [prompts](./block-types.md#prompts), [docs](./block-types.md#docs), [data destinations](./block-types.md#data), and [MCP servers](./block-types.md#mcp-servers). + +Blocks follow the [`config.yaml`](../../yaml-reference.md) format. When combined with other blocks into a complete `config.yaml`, they form a custom AI code assistant. diff --git a/docs/docs/hub/blocks/use-a-block.md b/docs/docs/hub/blocks/use-a-block.md new file mode 100644 index 000000000..ca4b6e067 --- /dev/null +++ b/docs/docs/hub/blocks/use-a-block.md @@ -0,0 +1,15 @@ +--- +title: Use a block +description: Guide to using blocks +keywords: [blocks, usage, use] +--- + +# Use a block + +Blocks can be used by adding them to assistants: +- [Create an assistant](../assistants/create-an-assistant.md) +- [Edit an assistant](../assistants/edit-an-assistant.md) + +Some blocks require inputs. If you are missing an input for a block, a notification icon will show up in the sidebar next to the block. Click the notification to select which secret to use for the block input: + +![Block inputs](/img/hub/block-inputs.png) \ No newline at end of file diff --git a/docs/docs/hub/governance/org-permissions.md b/docs/docs/hub/governance/org-permissions.md new file mode 100644 index 000000000..85d4f613e --- /dev/null +++ b/docs/docs/hub/governance/org-permissions.md @@ -0,0 +1,18 @@ +--- +title: Org Permissions +description: Org Permissions +keywords: [governance, organization, org, permissions] +--- + +# Organization Permissions + +**Users can have the following roles within an organization:** + +1. Admins are users who can manage members, secrets, blocks, assistants, etc. +2. Members are users who can use assistants, blocks, secrets, etc. + +**User permissions for each role depend on the pricing plan:** + +- [Solo](./pricing.md#solo) +- [Teams](./pricing.md#teams) +- [Enterprise](./pricing.md#enterprise) \ No newline at end of file diff --git a/docs/docs/hub/governance/pricing.md b/docs/docs/hub/governance/pricing.md new file mode 100644 index 000000000..06dd03c1e --- /dev/null +++ b/docs/docs/hub/governance/pricing.md @@ -0,0 +1,35 @@ +--- +title: Pricing +description: Solo, Teams, Enterprise, and Models Add-On pricing +keywords: [solo, teams, enterprise, models add-on] +--- + +# Pricing + +## Solo + +**Solo** is best suited for individuals and small teams with "single-player" problems. + +You can read more about what **Solo** includes [here](https://hub.continue.dev/pricing). + +## Teams + +**Teams** is best suited for growing teams with "multiplayer" problems. + +You can read more about what **Teams** includes [here](https://hub.continue.dev/pricing). + +## Enterprise + +**Enterprise** is best suited for large teams with enterprise-grade requirements. + +You can read more about what **Enterprise** includes [here](https://hub.continue.dev/pricing). + +## Models Add-On + +The **Models Add-On** allows you to use a variety of frontier models for a flat monthly fee. It’s designed to cover the usage of most developers. + +You can read more about usage limits and what models are included [here](https://hub.continue.dev/pricing). + +### Free Trial + +To try out Continue, we offer a free trial of the **Models Add-On** that allows you to use 50 Chat requests and 2,000 autocomplete requests. \ No newline at end of file diff --git a/docs/docs/hub/introduction.md b/docs/docs/hub/introduction.md new file mode 100644 index 000000000..88cca05f0 --- /dev/null +++ b/docs/docs/hub/introduction.md @@ -0,0 +1,16 @@ +--- +title: Introduction +description: Introduction +keywords: [continue, hub, introduction] +sidebar_label: Introduction +--- + +# Introduction + +![Continue Hub](/img/hub/models-page.png) + +[Continue Hub](https://hub.continue.dev) makes it simple to create custom AI code [assistants](./assistants/intro.md), providing a registry for defining, managing, and sharing assistant [building blocks](./blocks/intro.md). + +Assistants can contain several types of blocks, including [models](./blocks/block-types.md#models), [rules](./blocks/block-types.md#rules), [context providers](./blocks/block-types.md#context), [prompts](./blocks/block-types.md#prompts), [docs](./blocks/block-types.md#docs), [data destinations](./blocks/block-types.md#data), and [MCP servers](./blocks/block-types.md#mcp-servers). + +Continue Hub also makes it easy for engineering leaders to centrally [configure](./secrets/secret-types.md) and [govern](./governance/org-permissions.md) blocks and assistants for their organization. diff --git a/docs/docs/hub/secrets/secret-resolution.md b/docs/docs/hub/secrets/secret-resolution.md new file mode 100644 index 000000000..7fe357c8f --- /dev/null +++ b/docs/docs/hub/secrets/secret-resolution.md @@ -0,0 +1,22 @@ +--- +title: Secret Resolution +description: Intro to Secret Resolution +keywords: [secrets, resolution] +sidebar_label: Resolution +--- + +# Secret Resolution + +[User or Org secrets](./secret-types.md) should be used depending on how users want them to be shared within their organization and assistants. + +For individual users and [Solo](../governance/pricing.md#solo) organizations, secret resolution is performed in the following order: + +1. User [models add-on](../governance/pricing.md#models-add-on) (if subscribed) +2. [User secrets](../secrets/secret-types.md#user-secrets) (if set) +3. [Free trial](../governance/pricing.md#free-trial) (if below limit) + +For [Teams](../governance/pricing.md#teams) and [Enterprise](../governance/pricing.md#enterprise) organizations, secret resolution is performed in the following order: + +1. Org [models add-on](../governance/pricing.md#models-add-on) (if subscribed) +2. [Org secrets](../secrets/secret-types.md#org-secrets) (if set) +3. [User secrets](../secrets/secret-types.md#user-secrets) (if set) \ No newline at end of file diff --git a/docs/docs/hub/secrets/secret-types.md b/docs/docs/hub/secrets/secret-types.md new file mode 100644 index 000000000..655825ca9 --- /dev/null +++ b/docs/docs/hub/secrets/secret-types.md @@ -0,0 +1,22 @@ +--- +title: Secret Types +description: Intro to Secret Types +keywords: [secrets, types] +sidebar_label: Types +--- + +# Secret Types + +The Continue Hub comes with secrets management built-in. Secrets are values such as API keys or endpoints that can be shared across assistants and within organizations. + +## User secrets + +User secrets are defined by the user for themselves. This means that user secrets are available only to the user that created them. User secrets are assumed to be safe for the user to know, so they will be sent to the IDE extensions alongside the assistant `config.yaml`. + +This allows API requests to be made directly from the IDE extensions. You can use user secrets with [Solo](../governance/pricing.md#solo), [Teams](../governance/pricing.md#teams), and [Enterprise](../governance/pricing.md#enterprise). User secrets can be managed [here](https://hub.continue.dev/settings/secrets) in the hub. + +## Org secrets + +Org secrets are defined by admins for their organization. Org secrets are available to anyone in the organization to use with assistants in that organization. Org secrets are assumed to not be shareable with the user (e.g. you are a team lead who wants to give team members access to models without passing out API keys). + +This is why LLM requests are proxied through api.continue.dev / on-premise proxy and secrets are never sent to the IDE extensions. You can only use org secrets on [Teams](../governance/pricing.md#teams) and [Enterprise](../governance/pricing.md#enterprise). If you are an admin, you can manage secrets for your organization from the org settings page. \ No newline at end of file diff --git a/docs/docs/introduction.md b/docs/docs/introduction.md index cfa1301cd..9628dd4cb 100644 --- a/docs/docs/introduction.md +++ b/docs/docs/introduction.md @@ -1,6 +1,6 @@ --- title: Introduction -description: The open-source AI code assistant for developers +description: Create, share, and use custom AI code assistants slug: / keywords: [ @@ -17,7 +17,7 @@ keywords: ![Continue Logo](../static/img/intro.png) -**Continue is the leading open-source AI code assistant inside of [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) and [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension)** +**Continue 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)** - [Chat](chat/how-to-use-it) to understand and iterate on code in the sidebar - [Autocomplete](autocomplete/how-to-use-it) to receive inline code suggestions as you type diff --git a/docs/docs/json-reference.md b/docs/docs/json-reference.md index 470d59921..ba21ccb65 100644 --- a/docs/docs/json-reference.md +++ b/docs/docs/json-reference.md @@ -111,7 +111,7 @@ Embeddings model settings - the model used for @Codebase and @docs. **Properties:** -- `provider` (**required**): Specifies the embeddings provider, with options including `transformers.js`, `ollama`, `openai`, `cohere`, `free-trial`, `gemini`, etc +- `provider` (**required**): Specifies the embeddings provider, with options including `transformers.js`, `ollama`, `openai`, `cohere`, `gemini`, etc - `model`: Model name for embeddings. - `apiKey`: API key for the provider. - `apiBase`: Base URL for API requests. @@ -205,7 +205,7 @@ Configuration for the reranker model used in response ranking. **Properties:** -- `name` (**required**): Reranker name, e.g., `cohere`, `voyage`, `llm`, `free-trial`, `huggingface-tei`, `bedrock` +- `name` (**required**): Reranker name, e.g., `cohere`, `voyage`, `llm`, `huggingface-tei`, `bedrock` - `params`: - `model`: Model name - `apiKey`: Api key diff --git a/docs/docs/reference.md b/docs/docs/reference.md index 03707c4e4..070d74fcf 100644 --- a/docs/docs/reference.md +++ b/docs/docs/reference.md @@ -113,13 +113,13 @@ Embeddings model settings - the model used for @Codebase and @docs. **Properties:** -- `provider` (**required**): Specifies the embeddings provider, with options including `transformers.js`, `ollama`, `openai`, `cohere`, `free-trial`, `gemini`, etc +- `provider` (**required**): Specifies the embeddings provider, with options including `transformers.js`, `ollama`, `openai`, `cohere`, `gemini`, etc - `model`: Model name for embeddings. - `apiKey`: API key for the provider. - `apiBase`: Base URL for API requests. - `requestOptions`: Additional HTTP request settings specific to the embeddings provider. -- `maxChunkSize`: Maximum tokens per document chunk. Minimum is 128 tokens. -- `maxBatchSize`: Maximum number of chunks per request. Minimum is 1 chunk. +- `maxEmbeddingChunkSize`: Maximum tokens per document chunk. Minimum is 128 tokens. +- `maxEmbeddingBatchSize`: Maximum number of chunks per request. Minimum is 1 chunk. (AWS ONLY) @@ -134,8 +134,8 @@ Example: "provider": "openai", "model": "text-embedding-ada-002", "apiKey": "", - "maxChunkSize": 256, - "maxBatchSize": 5 + "maxEmbeddingChunkSize": 256, + "maxEmbeddingBatchSize": 5 } } ``` @@ -207,7 +207,7 @@ Configuration for the reranker model used in response ranking. **Properties:** -- `name` (**required**): Reranker name, e.g., `cohere`, `voyage`, `llm`, `free-trial`, `huggingface-tei`, `bedrock` +- `name` (**required**): Reranker name, e.g., `cohere`, `voyage`, `llm`, `huggingface-tei`, `bedrock` - `params`: - `model`: Model name - `apiKey`: Api key diff --git a/docs/docs/telemetry.md b/docs/docs/telemetry.md index e086d409d..e21a93164 100644 --- a/docs/docs/telemetry.md +++ b/docs/docs/telemetry.md @@ -6,13 +6,13 @@ keywords: [telemetry, anonymous, usage info, opt out] ## Overview -Continue collects and reports **anonymous** usage information to help us improve our product. This data enables us to understand user interactions and optimize the user experience effectively. You can opt out of telemetry collection at any time if you prefer not to share your usage information. +The open-source Continue Extensions collect and report **anonymous** usage information to help us improve our product. This data enables us to understand user interactions and optimize the user experience effectively. You can opt out of telemetry collection at any time if you prefer not to share your usage information. We utilize [Posthog](https://posthog.com/), an open-source platform for product analytics, to gather and store this data. For transparency, you can review the implementation code [here](https://github.com/continuedev/continue/blob/main/gui/src/hooks/CustomPostHogProvider.tsx) or read our [official privacy policy](https://continue.dev/privacy). ## Tracking Policy -All data collected by Continue is anonymized and stripped of personally identifiable information (PII) before being sent to PostHog. We are committed to maintaining the privacy and security of your data. +All data collected by the open-source Continue extensions is anonymized and stripped of personally identifiable information (PII) before being sent to PostHog. We are committed to maintaining the privacy and security of your data. ## What We Track diff --git a/docs/docs/yaml-migration.md b/docs/docs/yaml-migration.md index cc603ce1c..0a7773670 100644 --- a/docs/docs/yaml-migration.md +++ b/docs/docs/yaml-migration.md @@ -82,8 +82,8 @@ Model-level `completionOptions` are replaced by `defaultCompletionOptions`, with "provider": "openai", "model": "text-embedding-ada-002", "apiKey": "", - "maxChunkSize": 256, - "maxBatchSize": 5 + "maxEmbeddingChunkSize": 256, + "maxEmbeddingBatchSize": 5 }, "reranker": { "name": "voyage", @@ -126,6 +126,9 @@ models: apiKey: roles: - embed + embedOptions: + - maxChunkSize: 256 + - maxBatchSize: 5 - name: Ollama Autodetect provider: ollama @@ -143,7 +146,7 @@ models: - apply ``` -Note that the `repoMapFileSelection` experimental model role has been deprecated. +Note that the `repoMapFileSelection` experimental model role has been deprecated and is only available in `config.json`. ### Context Providers diff --git a/docs/docs/yaml-reference.md b/docs/docs/yaml-reference.md index 427d3e865..9de133cd7 100644 --- a/docs/docs/yaml-reference.md +++ b/docs/docs/yaml-reference.md @@ -6,33 +6,101 @@ keywords: [config, yaml, configuration, customize, customization] # confg.yaml Reference - +## Introduction -Continue can be configured using a YAML file `config.yaml` which for local configuration can be placed in your global `.continue` folder (`~/.continue` on Mac, `%USERPROFILE%\.continue`) +Continue hub assistants are defined using the `config.yaml` specification. Local assistants can also be configured using a YAML file `config.yaml` placed in your global `.continue` folder (`~/.continue` on Mac, `%USERPROFILE%\.continue`) + +:::info +Config YAML replaces `config.json`. View the **[Migration Guide](/yaml-migration)**. +::: + +An assistant is made up of: + +1. **Top level properties**, which specify the `name`, `version`, and `config.yaml` `schema` for the assistant +2. **Block lists**, which are composable arrays of coding assistant building blocks available to the assistant, such as models, docs, and context providers. + +A block is a single standalone building block of a coding assistants, e.g., one model or one documentation source. In `config.yaml` syntax, a block consists of the same top-level properties as assistants (`name`, `version`, and `schema`), but only has **ONE** item under whichever block type it is. + +Examples of blocks and assistants can be found on the [Continue hub](https://hub.continue.dev/explore/assistants). + +Assistants can either explicitly define blocks - see [Properties](#properties) below - or import and configure existing hub blocks. + +### Using Blocks + +Hub blocks and assistants are identified with a slug in the format `owner-slug/block-or-assistant-slug`, where an owner can be a user or organization. + +Blocks can be imported into an assistant by adding a `uses` clause under the block type. This can be alongside other `uses` clauses or explicit blocks of that type. + +For example, the following assistant imports an Anthropic model and defines an Ollama DeepSeek one. + +```yaml title="Assistant models section" +models: + - uses: anthropic/claude-3.5-sonnet # an imported model block + - model: deepseek-reasoner # an explicit model block + provider: ollama +``` + +### Inputs + +Blocks can be passed user inputs, including hub secrets and raw text values. To create a block that has an input, use mustache templating as follows: + +```yaml title="Block config.yaml" +name: myprofile/custom-model +models: + - name: My Favorite Model + provider: anthropic + apiKey: ${{ inputs.ANTHROPIC_API_KEY }} + defaultCompletionOptions: + temperature: ${{ inputs.TEMP }} +``` + +Which can then be imported like + +```yaml title="Assistant config.yaml" +name: myprofile/custom-assistant +models: + - uses: myprofile/custom-model + with: + ANTHROPIC_API_KEY: ${{ secrets.MY_ANTHROPIC_API_KEY }} + TEMP: 0.9 +``` + +Note that hub secrets can be passed as inputs, using the a similar mustache format: `secrets.SECRET_NAME`. + +### Overrides + +Block properties can be also be directly overriden using `override`. For example: + +```yaml title="Assistant config.yaml" +name: myprofile/custom-assistant +models: + - uses: myprofile/custom-model + with: + ANTHROPIC_API_KEY: ${{ secrets.MY_ANTHROPIC_API_KEY }} + TEMP: 0.9 + override: + roles: + - chat +``` + +## Properties Below are details for each property that can be set in `config.yaml`. -:::info -Config YAML replaces `config.json`. View the **[Migration Guide](/yaml-migration)**. `config.yaml` currently only works in VS Code pre-release. -::: - **All properties at all levels are optional unless explicitly marked as required.** -## Properties - The top-level properties in the `config.yaml` configuration file are: - [`name`](#name) (**required**) - - [`version`](#version) (**required**) +- [`schema`](#schema) (**required**) - [`models`](#models) - [`context`](#context) - [`rules`](#rules) - [`prompts`](#prompts) - [`docs`](#docs) - - - [`mcpServers`](#mcpservers) +- [`data`](#data) --- @@ -44,10 +112,16 @@ The `name` property specifies the name of your project or configuration. name: MyProject ``` +--- + ### `version` The `version` property specifies the version of your project or configuration. +### `schema` + +The `schema` property specifies the schema version used for the `config.yaml`, e.g. `v1` + --- ### `models` @@ -59,7 +133,12 @@ The `models` section defines the language models used in your configuration. Mod - `name` (**required**): A unique name to identify the model within your configuration. - `provider` (**required**): The provider of the model (e.g., `openai`, `ollama`). - `model` (**required**): The specific model name (e.g., `gpt-4`, `starcoder`). -- `roles`: An array specifying the roles this model can fulfill, such as `chat`, `autocomplete`, `embed`, `rerank`, `edit`, `apply`, `summarize`. +- `roles`: An array specifying the roles this model can fulfill, such as `chat`, `autocomplete`, `embed`, `rerank`, `edit`, `apply`, `summarize`. The default value is `[chat, edit, apply, summarize]`. Note that the `summarize` role is not currently used. +- `embedOptions`: If the model includes role `embed`, these settings apply for embeddings: + + - `maxChunkSize`: Maximum tokens per document chunk. Minimum is 128 tokens. + - `maxBatchSize`: Maximum number of chunks per request. Minimum is 1 chunk. + - `defaultCompletionOptions`: Default completion options for model settings. **Properties:** @@ -148,6 +227,9 @@ Example ```yaml title="config.yaml" rules: + - uses: myprofile/my-mood-setter + with: + MOOD: happy - Always annotate Python functions with their parameter and return types - Always write Google style docstrings for functions and classes ``` @@ -195,25 +277,6 @@ docs: --- - - ### `mcpServers` @@ -239,21 +302,38 @@ mcpServers: - /Users/NAME/test.db ``` - --- @@ -264,8 +344,15 @@ Putting it all together, here's a complete example of a `config.yaml` configurat ```yaml title="config.yaml" name: MyProject version: 0.0.1 +schema: v1 models: + - uses: anthropic/claude-3.5-sonnet + with: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + override: + defaultCompletionOptions: + temperature: 0.8 - name: GPT-4 provider: openai model: gpt-4 @@ -298,6 +385,7 @@ prompts: description: Unit test a function prompt: | Please write a complete suite of unit tests for this function. You should use the Jest testing framework. The tests should cover all possible edge cases and should be as thorough as possible. You should also include a description of each test case. + - uses: myprofile/my-favorite-prompt context: - provider: diff @@ -318,6 +406,15 @@ mcpServers: - dev env: PORT: "3000" + +data: + - name: My Private Company + destination: https://mycompany.com/ingest + schema: 0.2.0 + level: noCode + events: + - autocomplete + - chatInteraction ``` ## Using YAML anchors to avoid config duplication @@ -338,26 +435,26 @@ model_defaults: &model_defaults apiBase: https://api.example.com/llm models: -- name: mistral - <<: *model_defaults - model: mistral-7b-instruct - roles: - - chat - - edit + - name: mistral + <<: *model_defaults + model: mistral-7b-instruct + roles: + - chat + - edit -- name: qwen2.5-coder-7b-instruct - <<: *model_defaults - model: qwen2.5-coder-7b-instruct - roles: - - chat - - edit + - name: qwen2.5-coder-7b-instruct + <<: *model_defaults + model: qwen2.5-coder-7b-instruct + roles: + - chat + - edit -- name: qwen2.5-coder-7b - <<: *model_defaults - model: qwen2.5-coder-7b - useLegacyCompletionsEndpoint: false - roles: - - autocomplete + - name: qwen2.5-coder-7b + <<: *model_defaults + model: qwen2.5-coder-7b + useLegacyCompletionsEndpoint: false + roles: + - autocomplete ``` ### Fully deprecated settings diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index c97113a0a..8216da215 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -107,6 +107,13 @@ const config = { label: "Reference", href: "/reference", }, + { + type: "docSidebar", + sidebarId: "hubSidebar", + position: "left", + label: "Hub", + href: "/hub/introduction", + }, { to: "https://github.com/continuedev/continue", label: "GitHub", @@ -193,6 +200,30 @@ const config = { "@docusaurus/plugin-client-redirects", { redirects: [ + { + to: "/hub/introduction", + from: "/hub", + }, + { + to: "/hub/governance/org-permissions", + from: "/hub/governance", + }, + { + to: "/hub/secrets/secret-types", + from: "/hub/secrets", + }, + { + to: "/hub/assistants/intro", + from: "/hub/assistants", + }, + { + to: "/hub/blocks/intro", + from: "/hub/blocks", + }, + { + to: "/customize/overview", + from: "/customize", + }, { to: "/customize/overview", from: "/customization", @@ -206,8 +237,24 @@ const config = { // from: "/getting-started", // }, { - to: "/customize/model-types", - from: "/setup/overview", + to: "/customize/model-roles", + from: ["/customize/model-types", "/setup/overview"], + }, + { + to: "/customize/model-roles/embeddings", + from: "/customize/model-types/embeddings", + }, + { + to: "/customize/model-roles/autocomplete", + from: "/customize/model-types/autocomplete", + }, + { + to: "/customize/model-roles/chat", + from: "/customize/model-types/chat", + }, + { + to: "/customize/model-roles/reranking", + from: "/customize/model-types/reranking", }, { to: "/getting-started/overview", @@ -255,11 +302,11 @@ const config = { }, { to: "/customize/context-providers", - from: "/customization/context-providers", + from: ["/customization/context-providers"], }, { - to: "/customize/development-data", - from: "/development-data", + to: "/customize/deep-dives/development-data", + from: ["/development-data", "/customize/development-data"], }, { to: "/customize/deep-dives/docs", @@ -282,7 +329,7 @@ const config = { from: "/reference/Model Providers/deepseek", }, { - to: "/customize/model-providers/free-trial", + to: "/customize/model-providers", from: "/reference/Model Providers/freetrial", }, { diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/actions/how-to-customize.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/actions/how-to-customize.md index aeadb68f8..2ffc4d0f2 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/actions/how-to-customize.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/actions/how-to-customize.md @@ -7,7 +7,7 @@ sidebar_position: 5 ## 内置的斜杠命令 -Continue 有一个大的内置斜杠命令库,但是当你首次安装时,我们只显示最常用的一些,比如 "/edit", "/comment" 和 "/share" 。为了添加更多的 action ,你可以打开 [config.json](../json-reference.md) 并添加它们到 `slashCommands` 列表中。 +Continue 有一个大的内置斜杠命令库,但是当你首次安装时,我们只显示最常用的一些,比如 "/edit", "/comment" 和 "/share" 。为了添加更多的 action ,你可以打开 [config.json](../reference.md) 并添加它们到 `slashCommands` 列表中。 ## 定制斜杠命令 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/autocomplete/how-to-customize.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/autocomplete/how-to-customize.md index 14a062a50..143645591 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/autocomplete/how-to-customize.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/autocomplete/how-to-customize.md @@ -5,7 +5,7 @@ keywords: [定制] sidebar_position: 5 --- -Continue 在 [`config.json`](../json-reference.md) 提供少量的参数,对于你的特定需求和硬件能力,可以调整找到建议质量和系统性能之间的最佳平衡: +Continue 在 [`config.json`](../reference.md) 提供少量的参数,对于你的特定需求和硬件能力,可以调整找到建议质量和系统性能之间的最佳平衡: ```json title="config.json" "tabAutocompleteOptions": { diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/autocomplete/model-setup.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/autocomplete/model-setup.md index a7d9c3173..ba803e149 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/autocomplete/model-setup.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/autocomplete/model-setup.md @@ -49,4 +49,4 @@ Codestral 的 API key 和通常的 Mistral API 是不同的。如果你使用 Co ## 其他体验 -有很多更多的模型或提供者可以用来补全。在 [这里](../customize/model-types/autocomplete.md) 查看它们。 +有很多更多的模型或提供者可以用来补全。在 [这里](../customize/model-roles/autocomplete.md) 查看它们。 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx index b6360c8d3..32f9ab63f 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx @@ -5,11 +5,11 @@ keywords: [模型] sidebar_position: 2 --- -import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; :::info -这个页面推荐聊天的模型和提供者。在 [这里](../json-reference.md) 了解更多关于如何设置你的 `config.json` 。 +这个页面推荐聊天的模型和提供者。在 [这里](../reference.md) 了解更多关于如何设置你的 `config.json` 。 ::: ## 最好的总体体验 @@ -111,16 +111,16 @@ import TabItem from "@theme/TabItem"; ] ``` -### 来自 Google 的 Gemini 1.5 Pro +### 来自 Google 的 Gemini 2.0 Flash -如果你倾向于使用来自 [Google](../customize/model-providers/top-level/gemini.md) 的模型,那么我们推荐 Gemini 1.5 Pro 。 +如果你倾向于使用来自 [Google](../customize/model-providers/top-level/gemini.md) 的模型,那么我们推荐 Gemini 2.0 Flash。 ```json title="config.json" "models": [ { - "title": "Gemini 1.5 Pro", + "title": "Gemini 2.0 Flash", "provider": "gemini", - "model": "gemini-1.5-pro-latest", + "model": "gemini-2.0-flash", "apiKey": "[GEMINI_API_KEY]" } ] @@ -193,4 +193,4 @@ import TabItem from "@theme/TabItem"; ## 其他体验 -除了以上提到的这些,还有更多的模型和提供者,你可以使用来聊天。在 [这里](../customize/model-types/chat.md) 了解更多。 +除了以上提到的这些,还有更多的模型和提供者,你可以使用来聊天。在 [这里](../customize/model-roles/chat.md) 了解更多。 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/deep-dives/autocomplete.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/deep-dives/autocomplete.md index e6774dfe5..985a66809 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/deep-dives/autocomplete.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/deep-dives/autocomplete.md @@ -44,7 +44,7 @@ ollama run starcoder2:3b } ``` -如果你对可用选项不熟悉,你可以在 [这里](../../json-reference.md) 查找完整的参考。 +如果你对可用选项不熟悉,你可以在 [这里](../../reference.md) 查找完整的参考。 ## 配置选项 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/development-data.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/deep-dives/development-data.md similarity index 100% rename from docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/development-data.md rename to docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/deep-dives/development-data.md diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/cohere.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/cohere.md index 274c1942d..e69029b00 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/cohere.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/cohere.md @@ -23,7 +23,7 @@ Cohere 当前没有提供任何自动补全模型。 -[点击这里](../../model-types/autocomplete.md) 查看自动补全模型提供者列表。 +[点击这里](../../model-roles/autocomplete.md) 查看自动补全模型提供者列表。 ## 嵌入模型 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/free-trial.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/free-trial.md deleted file mode 100644 index 746038bdf..000000000 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/free-trial.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: 免费试用 -slug: ../free-trial ---- - -`"免费试用"` 提供者提供新用户在 Continue 快速尝试最好的体验,通过一个安全的代理服务器使用我们的 API key 。为了避免滥用,我们要求你使用 Github 登录,你可以在下面看到更多。 - -虽然 Continue 扩展总是免费使用,我们不能为所有用户提供无限免费 LLM 使用。你最终需要: - -1. 选择一个开源模型免费使用 [本地的](../top-level/ollama.md), 或者 -2. 添加你自己的 [Anthropic](../top-level/anthropic.md) API key 或者 [其他的 LLM 提供者](/customize/model-providers) - -## 试用的常见问题 - -Continue 要求免费试用用户登录,让我们可以避免我们的 API 端点滥用。如果你不使用免费试用,我们不会要求你登录。 - -### 我如何停止 Continue 询问我登录? - -移除 "models" 列表或 "tabAutocompleteModel" 中 `"provider": "free-trial"` 的所有模型,我们将不会再请求登录。 - -### 什么信息被收集? - -Continue 使用你的 GitHub 用户名,没有其他信息,唯一的目的是限制请求。 - -### 如果我没有登录,会发生什么? - -如果你没有登录,你仍然可以使用 Continue 的每个特性,你只需要提供自己的 LLM ,不论使用 API key 或运行本地的模型。 - -### 遥测与登录有什么关系? - -它没有。我们没有关联你的 GitHub 用户名到遥测数据。 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/nvidia.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/nvidia.md index 049ff7754..6d8e1269b 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/nvidia.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/nvidia.md @@ -29,7 +29,7 @@ We recommend configuring **Nemotron-4-340B-Instruct** as your chat model. NVIDIA currently does not offer any autocomplete models. -[Click here](../../model-types/autocomplete.md) to see a list of autocomplete model providers. +[Click here](../../model-roles/autocomplete.md) to see a list of autocomplete model providers. ## Embeddings model @@ -49,4 +49,4 @@ We recommend configuring **NVIDIA Retrieval QA Mistral 7B** as your embeddings m NVIDIA currently does not offer any reranking models. -[Click here](../../model-types/reranking.md) to see a list of reranking model providers. +[Click here](../../model-roles/reranking.md) to see a list of reranking model providers. diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/anthropic.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/anthropic.md index 7380e7673..f419f0def 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/anthropic.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/anthropic.md @@ -28,19 +28,19 @@ slug: ../anthropic Anthropic 当前没有提供任何自动补全模型。 -[点击这里](../../model-types/autocomplete.md) 查看自动补全模型提供者列表。 +[点击这里](../../model-roles/autocomplete.md) 查看自动补全模型提供者列表。 ## 嵌入模型 Anthropic 当前没有提供任何嵌入模型。 -[点击这里](../../model-types/embeddings.md) 查看嵌入模型提供者列表。 +[点击这里](../../model-roles/embeddings.md) 查看嵌入模型提供者列表。 ## 重排序模型 Anthropic 当前没有提供任何重排序模型。 -[点击这里](../../model-types/reranking.md) 查看重排序模型提供者列表。 +[点击这里](../../model-roles/reranking.md) 查看重排序模型提供者列表。 ## 提示词缓存 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/azure.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/azure.md index 6fa50faaa..3a5a48614 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/azure.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/azure.md @@ -57,7 +57,7 @@ slug: ../azure Azure OpenAI 当前没有提供任何重排序模型。 -[点击这里](../../model-types/reranking.md) 查看重排序模型列表。 +[点击这里](../../model-roles/reranking.md) 查看重排序模型列表。 ## 隐私 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/bedrock.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/bedrock.md index a1a4d6234..e13bc715d 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/bedrock.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/bedrock.md @@ -25,7 +25,7 @@ slug: ../bedrock Bedrock 当前不支持任何自动补全模型。 -[点击这里](../../model-types/autocomplete.md) 查看自动补全模型提供者列表。 +[点击这里](../../model-roles/autocomplete.md) 查看自动补全模型提供者列表。 ## 嵌入模型 @@ -46,7 +46,7 @@ Bedrock 当前不支持任何自动补全模型。 Bedrock 当前没有任何重排序模型。 -[点击这里](../../model-types/reranking.md) 查看重排序模型提供者列表。 +[点击这里](../../model-roles/reranking.md) 查看重排序模型提供者列表。 ## 认证 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/deepseek.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/deepseek.md index 61e01e701..10c0baeb8 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/deepseek.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/deepseek.md @@ -42,10 +42,10 @@ slug: ../deepseek DeepSeek 当前没有提供任何嵌入模型。 -[点击这里](../../model-types/embeddings.md) 查看嵌入模型提供者列表。 +[点击这里](../../model-roles/embeddings.md) 查看嵌入模型提供者列表。 ## 重排序模型 DeepSeek 当前没有提供任何重排序模型。 -[点击这里](../../model-types/reranking.md) 查看重排序模型提供者列表。 +[点击这里](../../model-roles/reranking.md) 查看重排序模型提供者列表。 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/gemini.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/gemini.md index 13778e379..8caec3c1f 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/gemini.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/gemini.md @@ -28,7 +28,7 @@ slug: ../gemini Gemini 当前没有提供任何自动补全模型。 -[点击这里](../../model-types/autocomplete.md) 查看自动补全模型提供者列表。 +[点击这里](../../model-roles/autocomplete.md) 查看自动补全模型提供者列表。 ## 嵌入模型 @@ -48,4 +48,4 @@ Gemini 当前没有提供任何自动补全模型。 Gemini 当前没有提供任何重排序模型。 -[点击这里](../../model-types/reranking.md) 查看重排序模型提供者列表。 +[点击这里](../../model-roles/reranking.md) 查看重排序模型提供者列表。 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/mistral.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/mistral.md index 2e853affc..8b9963fbb 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/mistral.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/mistral.md @@ -57,4 +57,4 @@ slug: ../mistral Mistral 当前没有提供任何重排序模型。 -[点击这里](../../model-types/reranking.md) 查看重排序模型提供者列表。 +[点击这里](../../model-roles/reranking.md) 查看重排序模型提供者列表。 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/ollama.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/ollama.md index 9119116ef..69ea9752d 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/ollama.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/ollama.md @@ -50,4 +50,4 @@ slug: ../ollama Ollama 当前没有提供任何重排序模型。 -[点击这里](../../model-types/reranking.md) 查看重排序模型提供者列表。 +[点击这里](../../model-roles/reranking.md) 查看重排序模型提供者列表。 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/openai.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/openai.md index ba84723da..18f3312a7 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/openai.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/openai.md @@ -28,7 +28,7 @@ slug: ../openai OpenAI 当前没有提供任何自动补全模型。 -[点击这里](../../model-types/autocomplete.md) 查看自动补全模型提供者列表。 +[点击这里](../../model-roles/autocomplete.md) 查看自动补全模型提供者列表。 ## 嵌入模型 @@ -48,7 +48,7 @@ OpenAI 当前没有提供任何自动补全模型。 OpenAI 当前没有提供任何重排序模型。 -[点击这里](../../model-types/reranking.md) 查看重排序模型提供者列表。 +[点击这里](../../model-roles/reranking.md) 查看重排序模型提供者列表。 ## OpenAI 兼容服务器 / API diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/vertexai.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/vertexai.md index 974ac69b8..7f9106075 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/vertexai.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/vertexai.md @@ -62,4 +62,4 @@ We recommend configuring **text-embedding-005** as your embeddings model. +[Click here](../../model-roles/reranking.md) to see a list of reranking model providers. --> diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/xai.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/xai.md index c920114b0..866e7108d 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/xai.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/xai.md @@ -30,19 +30,19 @@ We recommend configuring **grok-beta** as your chat model. xAI currently does not offer any autocomplete models. -[Click here](../../model-types/autocomplete.md) to see a list of autocomplete model providers. +[Click here](../../model-roles/autocomplete.md) to see a list of autocomplete model providers. ## Embeddings model xAI currently does not offer any embeddings models. -[Click here](../../model-types/embeddings.md) to see a list of embeddings model providers. +[Click here](../../model-roles/embeddings.md) to see a list of embeddings model providers. ## Reranking model xAI currently does not offer any reranking models. -[Click here](../../model-types/reranking.md) to see a list of reranking model providers. +[Click here](../../model-roles/reranking.md) to see a list of reranking model providers. ## Legacy Completions diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-types/autocomplete.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-roles/autocomplete.md similarity index 100% rename from docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-types/autocomplete.md rename to docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-roles/autocomplete.md diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-types/chat.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-roles/chat.md similarity index 92% rename from docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-types/chat.md rename to docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-roles/chat.md index c49051360..a294cfaa1 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-types/chat.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-roles/chat.md @@ -14,5 +14,5 @@ sidebar_position: 2 否则,以下是一些最好的选择: - [GPT-4o](../model-providers/top-level/openai.md) -- [Gemini 1.5 Pro](../model-providers/top-level/gemini.md) +- [Gemini 2.0 Flash](../model-providers/top-level/gemini.md) - [Llama3.1 405B](../tutorials/llama3.1.md) diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-types/embeddings.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-roles/embeddings.md similarity index 100% rename from docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-types/embeddings.md rename to docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-roles/embeddings.md diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-types/reranking.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-roles/reranking.md similarity index 93% rename from docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-types/reranking.md rename to docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-roles/reranking.md index 4e530b985..b5f1c835a 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-types/reranking.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-roles/reranking.md @@ -78,15 +78,3 @@ Voyage AI 提供代码最好的重排序模型, 使用他们的 `rerank-1` 模 } } ``` - -### 免费试用 (Voyage AI) - -Continue 提供 Voyage AI 重排序模型的免费试用。 - -```json title="config.json" -{ - "reranker": { - "name": "free-trial" - } -} -``` diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/overview.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/overview.md index 0d94978c1..1c5d041e2 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/overview.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/overview.md @@ -8,13 +8,13 @@ Continue 可以深度定制。这个主要通过编辑位于 `~/.continue/config ## 开始 -要打开 `config.json` ,在 Continue 聊天侧边栏的右下角点击 "齿轮" 图标。当编辑这个文件时,你可以使用 IntelliSense ,随着你的输入来查看有效的选项,或者你可以查看 [完整参考](../json-reference.md) 。 +要打开 `config.json` ,在 Continue 聊天侧边栏的右下角点击 "齿轮" 图标。当编辑这个文件时,你可以使用 IntelliSense ,随着你的输入来查看有效的选项,或者你可以查看 [完整参考](../reference.md) 。 当你保存 `config.json` 时, Continue 会自动地刷新,应用你的变更。 ## 每个工作区的配置 -如果你想要限制指定的配置到一个特定的工作区,你可以添加一个 `.continuerc.json` 到你的项目根目录。它有和 `config.json` 相同的 [定义](../json-reference.md) ,会自动地应用到本地 `config.json` 之上。 +如果你想要限制指定的配置到一个特定的工作区,你可以添加一个 `.continuerc.json` 到你的项目根目录。它有和 `config.json` 相同的 [定义](../reference.md) ,会自动地应用到本地 `config.json` 之上。 ## 可编程的配置 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/edit/model-setup.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/edit/model-setup.md index f0db33bbc..07a0a6c65 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/edit/model-setup.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/edit/model-setup.md @@ -7,4 +7,4 @@ keywords: [编辑, cmd l, 模型] 默认情况下,编辑使用 [与聊天相同的模型](../chat/model-setup.mdx) ,所以对于代码编辑,我们推荐相同的 400B+ 参数模型或者领先的模型之一。 -你可以通过更新你的 [`config.json`](../json-reference.md) 为编辑配置一个不同的模型。 +你可以通过更新你的 [`config.json`](../reference.md) 为编辑配置一个不同的模型。 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference.md index 98addf212..77ded6a37 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference.md @@ -111,13 +111,13 @@ Embeddings model settings - the model used for @Codebase and @docs. **Properties:** -- `provider` (**required**): Specifies the embeddings provider, with options including `transformers.js`, `ollama`, `openai`, `cohere`, `free-trial`, `gemini`, etc +- `provider` (**required**): Specifies the embeddings provider, with options including `transformers.js`, `ollama`, `openai`, `cohere`, `gemini`, etc - `model`: Model name for embeddings. - `apiKey`: API key for the provider. - `apiBase`: Base URL for API requests. - `requestOptions`: Additional HTTP request settings specific to the embeddings provider. -- `maxChunkSize`: Maximum tokens per document chunk. Minimum is 128 tokens. -- `maxBatchSize`: Maximum number of chunks per request. Minimum is 1 chunk. +- `maxEmbeddingChunkSize`: Maximum tokens per document chunk. Minimum is 128 tokens. +- `maxEmbeddingBatchSize`: Maximum number of chunks per request. Minimum is 1 chunk. (AWS ONLY) @@ -132,8 +132,8 @@ Example: "provider": "openai", "model": "text-embedding-ada-002", "apiKey": "", - "maxChunkSize": 256, - "maxBatchSize": 5 + "maxEmbeddingChunkSize": 256, + "maxEmbeddingBatchSize": 5 } } ``` @@ -205,7 +205,7 @@ Configuration for the reranker model used in response ranking. **Properties:** -- `name` (**required**): Reranker name, e.g., `cohere`, `voyage`, `llm`, `free-trial`, `huggingface-tei` +- `name` (**required**): Reranker name, e.g., `cohere`, `voyage`, `llm`, `huggingface-tei` - `params`: - `model`: Model name - `apiKey`: Api key diff --git a/docs/sidebars.js b/docs/sidebars.js index bb7f80604..0e83628a4 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -96,22 +96,18 @@ const sidebars = { }, { type: "category", - label: "Model types", + label: "Model roles", link: { - slug: "/customize/model-types", + slug: "/customize/model-roles", type: "generated-index", }, items: [ { type: "autogenerated", - dirName: "customize/model-types", + dirName: "customize/model-roles", }, ], }, - "customize/context-providers", - "customize/slash-commands", - "customize/tools", - "customize/development-data", { type: "category", label: "Deep dives", @@ -140,20 +136,44 @@ const sidebars = { }, { type: "link", - label: "JSON Reference", - href: "/json-reference", + label: "YAML Reference", + href: "/yaml-reference", }, "customize/changelog", - // { - // type: "link", - // label: "YAML Reference", - // href: "/yaml-reference", - // }, - // { - // type: "link", - // label: "YAML Migration", - // href: "/yaml-migration", - // }, + ], + hubSidebar: [ + "hub/introduction", + { + type: "category", + label: "Assistants", + items: [ + "hub/assistants/intro", + "hub/assistants/use-an-assistant", + "hub/assistants/create-an-assistant", + "hub/assistants/edit-an-assistant", + ], + }, + { + type: "category", + label: "Blocks", + items: [ + "hub/blocks/intro", + "hub/blocks/block-types", + "hub/blocks/use-a-block", + "hub/blocks/create-a-block", + "hub/blocks/bundles", + ], + }, + { + type: "category", + label: "Secrets", + items: ["hub/secrets/secret-types", "hub/secrets/secret-resolution"], + }, + { + type: "category", + label: "Governance", + items: ["hub/governance/org-permissions", "hub/governance/pricing"], + }, ], }; diff --git a/docs/static/img/actions.gif b/docs/static/img/actions.gif index 3a90748f1..1ad37ad93 100644 Binary files a/docs/static/img/actions.gif and b/docs/static/img/actions.gif differ diff --git a/docs/static/img/autocomplete.gif b/docs/static/img/autocomplete.gif index 7340b3cb9..cede26acf 100644 Binary files a/docs/static/img/autocomplete.gif and b/docs/static/img/autocomplete.gif differ diff --git a/docs/static/img/chat.gif b/docs/static/img/chat.gif index 2979f6c28..f9eedc300 100644 Binary files a/docs/static/img/chat.gif and b/docs/static/img/chat.gif differ diff --git a/docs/static/img/edit.gif b/docs/static/img/edit.gif index 286cf2e5c..a1629930c 100644 Binary files a/docs/static/img/edit.gif and b/docs/static/img/edit.gif differ diff --git a/docs/static/img/hub/assistant-create-page.png b/docs/static/img/hub/assistant-create-page.png new file mode 100644 index 000000000..2d70f956e Binary files /dev/null and b/docs/static/img/hub/assistant-create-page.png differ diff --git a/docs/static/img/hub/assistant-create-sidebar.png b/docs/static/img/hub/assistant-create-sidebar.png new file mode 100644 index 000000000..159806d31 Binary files /dev/null and b/docs/static/img/hub/assistant-create-sidebar.png differ diff --git a/docs/static/img/hub/assistant-create-yaml.png b/docs/static/img/hub/assistant-create-yaml.png new file mode 100644 index 000000000..6806c808c Binary files /dev/null and b/docs/static/img/hub/assistant-create-yaml.png differ diff --git a/docs/static/img/hub/assistant-extension-select.png b/docs/static/img/hub/assistant-extension-select.png new file mode 100644 index 000000000..e1365d304 Binary files /dev/null and b/docs/static/img/hub/assistant-extension-select.png differ diff --git a/docs/static/img/hub/assistant-new-button.png b/docs/static/img/hub/assistant-new-button.png new file mode 100644 index 000000000..d6088a061 Binary files /dev/null and b/docs/static/img/hub/assistant-new-button.png differ diff --git a/docs/static/img/hub/assistant-remix-button.png b/docs/static/img/hub/assistant-remix-button.png new file mode 100644 index 000000000..02c9d34ef Binary files /dev/null and b/docs/static/img/hub/assistant-remix-button.png differ diff --git a/docs/static/img/hub/block-inputs.png b/docs/static/img/hub/block-inputs.png new file mode 100644 index 000000000..9af87002c Binary files /dev/null and b/docs/static/img/hub/block-inputs.png differ diff --git a/docs/static/img/hub/block-new-button.png b/docs/static/img/hub/block-new-button.png new file mode 100644 index 000000000..456db04a9 Binary files /dev/null and b/docs/static/img/hub/block-new-button.png differ diff --git a/docs/static/img/hub/block-new-page.png b/docs/static/img/hub/block-new-page.png new file mode 100644 index 000000000..9addc9238 Binary files /dev/null and b/docs/static/img/hub/block-new-page.png differ diff --git a/docs/static/img/hub/block-remix-button.png b/docs/static/img/hub/block-remix-button.png new file mode 100644 index 000000000..16a682e9d Binary files /dev/null and b/docs/static/img/hub/block-remix-button.png differ diff --git a/docs/static/img/hub/bundle-create-page.png b/docs/static/img/hub/bundle-create-page.png new file mode 100644 index 000000000..693070326 Binary files /dev/null and b/docs/static/img/hub/bundle-create-page.png differ diff --git a/docs/static/img/hub/bundle-new-button.png b/docs/static/img/hub/bundle-new-button.png new file mode 100644 index 000000000..60ccc23d6 Binary files /dev/null and b/docs/static/img/hub/bundle-new-button.png differ diff --git a/docs/static/img/hub/hub-onboarding-card.png b/docs/static/img/hub/hub-onboarding-card.png new file mode 100644 index 000000000..8c75631fe Binary files /dev/null and b/docs/static/img/hub/hub-onboarding-card.png differ diff --git a/docs/static/img/hub/models-page.png b/docs/static/img/hub/models-page.png new file mode 100644 index 000000000..647504941 Binary files /dev/null and b/docs/static/img/hub/models-page.png differ diff --git a/docs/static/img/settings-model-roles.png b/docs/static/img/settings-model-roles.png new file mode 100644 index 000000000..7a2d24407 Binary files /dev/null and b/docs/static/img/settings-model-roles.png differ diff --git a/extensions/intellij/CHANGELOG.md b/extensions/intellij/CHANGELOG.md index 391d722c7..c5378bd45 100644 --- a/extensions/intellij/CHANGELOG.md +++ b/extensions/intellij/CHANGELOG.md @@ -5,8 +5,16 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). -Pre-release Changes -### Fixed +## 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 diff --git a/extensions/intellij/README.md b/extensions/intellij/README.md index 79b0d6cab..dccf4a7f1 100644 --- a/extensions/intellij/README.md +++ b/extensions/intellij/README.md @@ -4,9 +4,7 @@
-[**Continue**](https://docs.continue.dev) is the leading open-source AI code assistant. - -You can connect any models and any context to build custom autocomplete and chat experiences inside [**VS Code**](https://marketplace.visualstudio.com/items?itemName=Continue.continue) and [**JetBrains**](https://plugins.jetbrains.com/plugin/22707-continue-extension) IDEs. +[**Continue**](https://docs.continue.dev) enables developers to create, share, and use custom AI code assistants with our open-source [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension) extension and [hub of models, rules, prompts, docs, and other building blocks](https://hub.continue.dev).
diff --git a/extensions/intellij/gradle.properties b/extensions/intellij/gradle.properties index b8b36867e..a41a6f7d1 100644 --- a/extensions/intellij/gradle.properties +++ b/extensions/intellij/gradle.properties @@ -3,7 +3,7 @@ pluginGroup=com.github.continuedev.continueintellijextension pluginName=continue-intellij-extension pluginRepositoryUrl=https://github.com/continuedev/continue # SemVer format -> https://semver.org -pluginVersion=0.0.91 +pluginVersion=1.0.1 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild=223 # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt index c6e5684e3..e71401b15 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt @@ -89,8 +89,10 @@ class MessageTypes { "config/getSerializedProfileInfo", "config/deleteModel", "config/listProfiles", + "config/refreshProfiles", "config/openProfile", "config/updateSharedConfig", + "config/updateSelectedModel", "context/getContextItems", "context/getSymbolsForFiles", "context/loadSubmenuItems", diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IdeProtocolClient.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IdeProtocolClient.kt index c56b9fa43..46be13797 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IdeProtocolClient.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IdeProtocolClient.kt @@ -447,7 +447,8 @@ class IdeProtocolClient( val result = responseContent["result"] as Map<*, *> val config = result["config"] as Map - val applyCodeBlockModel = getModelByRole(config, "applyCodeBlock") + val selectedModels = config["selectedModelByRole"] as Map + val applyCodeBlockModel = selectedModels["apply"] as Map if (applyCodeBlockModel != null) { continuation.resume(applyCodeBlockModel) @@ -588,19 +589,4 @@ class IdeProtocolClient( fun deleteAtIndex(index: Int) { continuePluginService.sendToWebview("deleteAtIndex", DeleteAtIndex(index), uuid()) } - - private fun getModelByRole( - config: Any, - role: Any - ): Any? { - val experimental = (config as? Map<*, *>)?.get("experimental") as? Map<*, *> - val roleTitle = (experimental?.get("modelRoles") as? Map<*, *>)?.get(role) as? String ?: return null - - val models = (config as? Map<*, *>)?.get("models") as? List<*> - val matchingModel = models?.find { model -> - (model as? Map<*, *>)?.get("title") == roleTitle - } - - return matchingModel - } } \ No newline at end of file diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt index 87b0d6970..796b3aac6 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt @@ -92,49 +92,19 @@ class IntelliJIDE( } suspend fun enableHubContinueDev(): Boolean { - try { - val client = OkHttpClient() - val url = URL("https://api.continue.dev/features/hub") - - val request = Request.Builder() - .url(url) - .get() - .header("Content-Type", "application/json") - .build() - - val response = client.newCall(request).execute() - - val responseBody = response.body?.string() - val gson = Gson() - val responseMap = gson.fromJson(responseBody, Map::class.java) - - if (responseMap["enabled"] == true) { - return true - } - } catch (e: Exception) { - return false - } - return false + return true } override suspend fun getIdeSettings(): IdeSettings { val settings = service() - var continueTestEnvironment = settings.continueState.continueTestEnvironment - if (continueTestEnvironment != "production") { - val enableHub = enableHubContinueDev() - if (enableHub) { - continueTestEnvironment = "production" - } - } - return IdeSettings( remoteConfigServerUrl = settings.continueState.remoteConfigServerUrl, remoteConfigSyncPeriod = settings.continueState.remoteConfigSyncPeriod, userToken = settings.continueState.userToken ?: "", enableControlServerBeta = settings.continueState.enableContinueTeamsBeta, - continueTestEnvironment = continueTestEnvironment, + continueTestEnvironment = "production", pauseCodebaseIndexOnStart = false, // TODO: Needs to be implemented ) } diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinueExtensionSettingsService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinueExtensionSettingsService.kt index 9e3d00d23..f20096d81 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinueExtensionSettingsService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinueExtensionSettingsService.kt @@ -34,7 +34,6 @@ class ContinueSettingsComponent : DumbAware { val enableOSR: JCheckBox = JCheckBox("Enable Off-Screen Rendering") val displayEditorTooltip: JCheckBox = JCheckBox("Display Editor Tooltip") val showIDECompletionSideBySide: JCheckBox = JCheckBox("Show IDE completions side-by-side") - val enableContinueHub: JCheckBox = JCheckBox("Enable Continue Hub") init { val constraints = GridBagConstraints() @@ -68,8 +67,6 @@ class ContinueSettingsComponent : DumbAware { constraints.gridy++ panel.add(showIDECompletionSideBySide, constraints) constraints.gridy++ - panel.add(enableContinueHub, constraints) - constraints.gridy++ // Add a "filler" component that takes up all remaining vertical space constraints.weighty = 1.0 @@ -102,7 +99,7 @@ open class ContinueExtensionSettings : PersistentStateComponent -**[Continue](https://docs.continue.dev) is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) and [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension)** +**[Continue](https://docs.continue.dev) enables to developers create, share, and use custom AI code assistants with our open-source [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) extension and [hub of models, rules, prompts, docs, and other building blocks](https://hub.continue.dev)** diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index a307df999..39ef2386c 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -193,6 +193,7 @@ "deepinfra", "groq", "fireworks", + "ncompass", "cloudflare", "deepseek", "azure", @@ -238,6 +239,7 @@ "### DeepInfra\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/deepinfra)", "### Groq\nGroq provides extremely fast inference of open-source language models. To get started, obtain an API key from [their console](https://console.groq.com/keys).", "### Fireworks\nFireworks is a fast inference engine for open-source language models. To get started, obtain an API key from [their console](https://fireworks.ai/api-keys).", + "### Ncompass\nnCompass is an extremely fast inference engine for open-source language models. To get started, obtain an API key from [their console](https://app.ncompass.tech/api-settings).", "### Cloudflare Workers AI\n\n[Reference](https://developers.cloudflare.com/workers-ai/)", "### Deepseek\n Deepseek's API provides the best pricing for their state-of-the-art Deepseek Coder models. To get started, obtain an API key from [their console](https://platform.deepseek.com/api_keys)", "### Azure OpenAI\n Azure OpenAI lets you securely run OpenAI's models on Azure. To get started, follow the steps [here](https://docs.continue.dev/reference/Model%20Providers/azure)", @@ -264,7 +266,7 @@ }, "apiKey": { "title": "Api Key", - "description": "OpenAI, Anthropic, Cohere, Together, Novita AI, or other API key", + "description": "OpenAI, Anthropic, Cohere, Together, Novita AI, nCompass, or other API key", "type": "string" }, "apiBase": { @@ -481,6 +483,7 @@ "huggingface-inference-api", "replicate", "together", + "ncompass", "novita", "cloudflare", "sambanova", @@ -835,6 +838,7 @@ "claude-2", "claude-instant-1", "claude-3-5-sonnet-latest", + "claude-3-7-sonnet-20250219", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", @@ -1369,6 +1373,23 @@ } } }, + { + "if": { + "properties": { + "provider": { + "enum": ["ncompass"] + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "model": { + "enum": ["qwen2.5-coder-32b", "qwen2.5-72b", "llama3.3-70b"] + } + } + } + }, { "if": { "properties": { @@ -1399,23 +1420,6 @@ } } }, - { - "if": { - "properties": { - "provider": { - "const": "llamafile" - } - }, - "required": ["provider"] - }, - "then": { - "properties": { - "llamafileCommand": { - "type": "string" - } - } - } - }, { "if": { "properties": { @@ -1433,23 +1437,6 @@ } } }, - { - "if": { - "properties": { - "provider": { - "enum": ["text-gen-webui"] - } - }, - "required": ["provider"] - }, - "then": { - "properties": { - "streamingUrl": { - "type": "string" - } - } - } - }, { "if": { "properties": { @@ -2755,14 +2742,14 @@ "description": "Request options to be used in any fetch requests made by the embeddings provider", "$ref": "#/$defs/RequestOptions" }, - "maxChunkSize": { + "maxEmbeddingChunkSize": { "title": "Maximum Chunk Size", "description": "The maximum number of tokens that each chunk of a document is allowed to have", "type": "integer", "minimum": 128, "exclusiveMaximum": 2147483647 }, - "maxBatchSize": { + "maxEmbeddingBatchSize": { "title": "Maximum Batch Size", "description": "The maximum number of chunks that can be sent to the embeddings provider in a single request", "type": "integer", diff --git a/extensions/vscode/e2e/selectors/GUI.selectors.ts b/extensions/vscode/e2e/selectors/GUI.selectors.ts index 319157500..43f5a2db4 100644 --- a/extensions/vscode/e2e/selectors/GUI.selectors.ts +++ b/extensions/vscode/e2e/selectors/GUI.selectors.ts @@ -4,7 +4,7 @@ import { SelectorUtils } from "./SelectorUtils"; export class GUISelectors { public static getDescription(view: WebView) { - return view.findWebElement(By.xpath("//*[contains(text(), 'Quickly')]")); + return view.findWebElement(By.xpath("//*[contains(text(), 'quickly')]")); } public static getMessageInputFields(view: WebView) { diff --git a/extensions/vscode/e2e/tests/GUI.test.ts b/extensions/vscode/e2e/tests/GUI.test.ts index 4369a917f..7abe736cd 100644 --- a/extensions/vscode/e2e/tests/GUI.test.ts +++ b/extensions/vscode/e2e/tests/GUI.test.ts @@ -47,52 +47,56 @@ describe("GUI Test", () => { }); describe("Onboarding", () => { - it("should display correct panel description", async () => { + it.skip("should display correct panel description", async () => { const description = await GUISelectors.getDescription(view); expect(await description.getText()).has.string( - "Quickly get up and running using our API keys.", + "Log in to quickly build your first custom AI code assistant", ); }).timeout(DEFAULT_TIMEOUT.XL); - it("should display tutorial card after accepting onboarding quick start", async () => { - // Get paragraph with text Best - const bestTab = await GUISelectors.getOnboardingTabButton(view, "Best"); - await bestTab.click(); + // We no longer have a quick start button + it.skip( + "should display tutorial card after accepting onboarding quick start", + async () => { + // Get paragraph with text Best + const bestTab = await GUISelectors.getOnboardingTabButton(view, "Best"); + await bestTab.click(); - const anthropicInput = await TestUtils.waitForSuccess( - async () => await GUISelectors.getBestChatApiKeyInput(view), - ); - anthropicInput.sendKeys("invalid_api_key"); + const anthropicInput = await TestUtils.waitForSuccess( + async () => await GUISelectors.getBestChatApiKeyInput(view), + ); + anthropicInput.sendKeys("invalid_api_key"); - const mistralInput = - await GUISelectors.getBestAutocompleteApiKeyInput(view); - mistralInput.sendKeys("invalid_api_key"); + const mistralInput = + await GUISelectors.getBestAutocompleteApiKeyInput(view); + mistralInput.sendKeys("invalid_api_key"); - // Get button with text "Connect" and click it - const connectButton = await view.findWebElement( - By.xpath("//button[text()='Connect']"), - ); - await connectButton.click(); + // Get button with text "Connect" and click it + const connectButton = await view.findWebElement( + By.xpath("//button[text()='Connect']"), + ); + await connectButton.click(); - await TestUtils.waitForSuccess( - async () => await GUISelectors.getTutorialCard(view), - ); + await TestUtils.waitForSuccess( + async () => await GUISelectors.getTutorialCard(view), + ); - // TODO validate that claude has been added to list + // TODO validate that claude has been added to list - // Skip testing Quick Start because github auth opens external app and breaks test - // const quickStartButton = await view.findWebElement( - // By.xpath("//*[contains(text(), 'Get started using our API keys')]") - // ); - // await quickStartButton.click(); - // await view.switchBack(); - // const allowButton = await TestUtils.waitForSuccess( - // async () => await driver.findElement(By.xpath(`//a[contains(text(), "Allow")]`)) - // ); - // await allowButton.click(); - // ({ view, driver } = await GUIActions.switchToReactIframe()); - }).timeout(DEFAULT_TIMEOUT.XL); + // Skip testing Quick Start because github auth opens external app and breaks test + // const quickStartButton = await view.findWebElement( + // By.xpath("//*[contains(text(), 'Get started using our API keys')]") + // ); + // await quickStartButton.click(); + // await view.switchBack(); + // const allowButton = await TestUtils.waitForSuccess( + // async () => await driver.findElement(By.xpath(`//a[contains(text(), "Allow")]`)) + // ); + // await allowButton.click(); + // ({ view, driver } = await GUIActions.switchToReactIframe()); + }, + ).timeout(DEFAULT_TIMEOUT.XL); }); describe("Chat", () => { diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 57f283f76..6cf41cadf 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.9.268", + "version": "1.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.9.268", + "version": "1.1.0", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", @@ -106,13 +106,13 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.31", + "@continuedev/config-yaml": "^1.0.52", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", "@modelcontextprotocol/sdk": "^1.5.0", "@mozilla/readability": "^0.5.0", - "@octokit/rest": "^20.0.2", + "@octokit/rest": "^20.1.1", "@typescript-eslint/eslint-plugin": "^7.8.0", "@xenova/transformers": "2.14.0", "adf-to-md": "^1.1.0", @@ -165,7 +165,7 @@ "wink-nlp-utils": "^2.1.0", "workerpool": "^9.1.3", "yaml": "^2.4.2", - "zod": "^3.23.8" + "zod": "^3.24.2" }, "devDependencies": { "@babel/preset-env": "^7.24.7", diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index a25aecbd5..38162cc55 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": "0.9.269", + "version": "1.1.2", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" @@ -96,11 +96,6 @@ "default": false, "markdownDescription": "Enable Continue for teams beta features. To sign in, click the gear icon to go to the settings page, and click Sign In." }, - "continue.enableContinueHub": { - "type": "boolean", - "default": false, - "description": "Enable Continue Hub (internal)" - }, "continue.showInlineTip": { "type": "boolean", "default": true, @@ -467,27 +462,27 @@ { "command": "continue.writeCommentsForCode", "group": "Continue", - "when": "editorHasSelection" + "when": "editorHasSelection && !editorReadonly" }, { "command": "continue.writeDocstringForCode", "group": "Continue", - "when": "editorHasSelection" + "when": "editorHasSelection && !editorReadonly" }, { "command": "continue.fixCode", "group": "Continue", - "when": "editorHasSelection" + "when": "editorHasSelection && !editorReadonly" }, { "command": "continue.optimizeCode", "group": "Continue", - "when": "editorHasSelection" + "when": "editorHasSelection && !editorReadonly" }, { "command": "continue.fixGrammar", "group": "Continue", - "when": "editorHasSelection && editorLangId == 'markdown'" + "when": "editorHasSelection && editorLangId == 'markdown' && !editorReadonly" } ], "explorer/context": [ diff --git a/extensions/vscode/src/VsCodeIde.ts b/extensions/vscode/src/VsCodeIde.ts index f4323a18c..cd4589b9c 100644 --- a/extensions/vscode/src/VsCodeIde.ts +++ b/extensions/vscode/src/VsCodeIde.ts @@ -2,7 +2,7 @@ import * as child_process from "node:child_process"; import { exec } from "node:child_process"; import { Range } from "core"; -import { enableHubContinueDev, EXTENSION_NAME } from "core/control-plane/env"; +import { EXTENSION_NAME } from "core/control-plane/env"; import { GetGhTokenArgs } from "core/protocol/ide"; import { editConfigJson, getConfigJsonPath } from "core/util/paths"; import * as vscode from "vscode"; @@ -645,9 +645,7 @@ class VsCodeIde implements IDE { "enableContinueForTeams", false, ), - continueTestEnvironment: settings.get("enableContinueHub") - ? "production" - : "none", + continueTestEnvironment: "production", pauseCodebaseIndexOnStart: settings.get( "pauseCodebaseIndexOnStart", false, @@ -662,15 +660,6 @@ class VsCodeIde implements IDE { async getIdeSettings(): Promise { const ideSettings = this.getIdeSettingsSync(); - - // Feature flag for when hub is enabled - if (ideSettings.continueTestEnvironment !== "production") { - const enableHub = await enableHubContinueDev(); - if (enableHub) { - ideSettings.continueTestEnvironment = "production"; - } - } - return ideSettings; } } diff --git a/extensions/vscode/src/activation/InlineTipManager.ts b/extensions/vscode/src/activation/InlineTipManager.ts index 0ea078c21..b5158758a 100644 --- a/extensions/vscode/src/activation/InlineTipManager.ts +++ b/extensions/vscode/src/activation/InlineTipManager.ts @@ -12,13 +12,13 @@ const SVG_CONFIG = { strokeWidth: 1, shortcutColor: "#999998", filter: "drop-shadow(0 2px 2px rgba(0,0,0,0.2))", - radius: 4, + radius: 3, leftMargin: 40, debounceDelay: 500, chatLabel: "Chat", - chatShortcut: `${getMetaKeyLabel()}L`, + chatShortcut: `${getMetaKeyLabel()}+L`, editLabel: "Edit", - editShortcut: `${getMetaKeyLabel()}I`, + editShortcut: `${getMetaKeyLabel()}+I`, get fontSize() { return Math.ceil( @@ -32,14 +32,11 @@ const SVG_CONFIG = { "helvetica" ); }, - get paddingY() { - return Math.ceil(this.fontSize * 0.4); - }, get paddingX() { - return Math.ceil(this.fontSize * 0.8); + return Math.ceil(this.getEstimatedTextWidth(" ")); }, get gap() { - return this.fontSize * 2.5; + return this.fontSize * 0.5; }, get tipWidth() { return ( @@ -49,22 +46,22 @@ const SVG_CONFIG = { ); }, get tipHeight() { - return this.fontSize + this.paddingY * 2; + return this.fontSize; }, get textY() { - return this.tipHeight / 2 + this.fontSize * 0.35; + return (this.tipHeight + this.fontSize)/2; }, get chatLabelX() { return this.paddingX; }, get chatShortcutX() { - return this.chatLabelX + this.getEstimatedTextWidth(this.chatLabel) + 4; + return this.chatLabelX + this.getEstimatedTextWidth(this.chatLabel + " "); }, get editLabelX() { - return this.chatShortcutX + this.gap; + return this.chatShortcutX + this.getEstimatedTextWidth(this.chatShortcut) + this.gap; }, get editShortcutX() { - return this.editLabelX + this.getEstimatedTextWidth(this.editLabel) + 4; + return this.editLabelX + this.getEstimatedTextWidth(this.editLabel + " "); }, getEstimatedTextWidth(text: string): number { return text.length * this.fontSize * 0.6; @@ -234,10 +231,17 @@ export class InlineTipManager { } private createSvgTooltipDecoration() { + var backgroundColour = 0; + if (this.theme) { + backgroundColour = this.theme.colors["editor.background"]; + } return vscode.window.createTextEditorDecorationType({ after: { contentIconPath: this.svgTooltip, - margin: `-5px 0 0 ${SVG_CONFIG.leftMargin}px`, + border: `;box-shadow: inset 0 0 0 ${SVG_CONFIG.strokeWidth}px ${SVG_CONFIG.stroke}, inset 0 0 0 ${SVG_CONFIG.tipHeight}px ${backgroundColour}; + border-radius: ${SVG_CONFIG.radius}px; + filter: ${SVG_CONFIG.filter}`, + margin: `0 0 0 ${SVG_CONFIG.leftMargin}px`, width: `${SVG_CONFIG.tipWidth}px`, }, }); @@ -258,19 +262,6 @@ export class InlineTipManager { const svgContent = svgBuilder .width(SVG_CONFIG.tipWidth) .height(SVG_CONFIG.tipHeight) - // Main rectangle - .rect({ - x: 0, - y: 0, - width: SVG_CONFIG.tipWidth, - height: SVG_CONFIG.tipHeight, - rx: SVG_CONFIG.radius, - ry: SVG_CONFIG.radius, - fill: this.theme.colors["editor.background"], - stroke: SVG_CONFIG.stroke, - "stroke-width": SVG_CONFIG.strokeWidth, - filter: SVG_CONFIG.filter, - }) // Chat .text( { diff --git a/extensions/vscode/src/autocomplete/completionProvider.ts b/extensions/vscode/src/autocomplete/completionProvider.ts index fb174b53c..497de3875 100644 --- a/extensions/vscode/src/autocomplete/completionProvider.ts +++ b/extensions/vscode/src/autocomplete/completionProvider.ts @@ -21,7 +21,6 @@ import { stopStatusBarLoading, } from "./statusBar"; -import type { TabAutocompleteModel } from "../util/loadAutocompleteModel"; import { startLocalOllama } from "core/util/ollamaHelper"; import type { IDE } from "core"; @@ -41,7 +40,8 @@ interface VsCodeCompletionInput { } export class ContinueCompletionProvider - implements vscode.InlineCompletionItemProvider { + implements vscode.InlineCompletionItemProvider +{ private onError(e: any) { let options = ["Documentation"]; if (e.message.includes("Ollama may not be installed")) { @@ -82,13 +82,19 @@ export class ContinueCompletionProvider constructor( private readonly configHandler: ConfigHandler, private readonly ide: IDE, - private readonly tabAutocompleteModel: TabAutocompleteModel, private readonly webviewProtocol: VsCodeWebviewProtocol, ) { + async function getAutocompleteModel() { + const { config } = await configHandler.loadConfig(); + if (!config) { + return; + } + return config.selectedModelByRole.autocomplete ?? undefined; + } this.completionProvider = new CompletionProvider( this.configHandler, this.ide, - this.tabAutocompleteModel.get.bind(this.tabAutocompleteModel), + getAutocompleteModel, this.onError.bind(this), getDefinitionsFromLsp, ); diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index e745e2a30..1ef13d5f7 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -4,7 +4,6 @@ import * as os from "node:os"; import { ContextMenuConfig, RangeInFileWithContents } from "core"; import { CompletionProvider } from "core/autocomplete/CompletionProvider"; import { ConfigHandler } from "core/config/ConfigHandler"; -import { getModelByRole } from "core/config/util"; import { ContinueServerClient } from "core/continueServer/stubs/client"; import { EXTENSION_NAME } from "core/control-plane/env"; import { Core } from "core/core"; @@ -30,11 +29,12 @@ import { VerticalDiffManager } from "./diff/vertical/manager"; import EditDecorationManager from "./quickEdit/EditDecorationManager"; import { QuickEdit, QuickEditShowParams } from "./quickEdit/QuickEditQuickPick"; import { Battery } from "./util/battery"; -import { VsCodeIde } from "./VsCodeIde"; import { getMetaKeyLabel } from "./util/util"; +import { VsCodeIde } from "./VsCodeIde"; -import type { VsCodeWebviewProtocol } from "./webviewProtocol"; +import { LOCAL_DEV_DATA_VERSION } from "core/data/log"; import { startLocalOllama } from "core/util/ollamaHelper"; +import type { VsCodeWebviewProtocol } from "./webviewProtocol"; let fullScreenPanel: vscode.WebviewPanel | undefined; @@ -348,7 +348,7 @@ const getCommandsMap: ( ); const modelTitle = - getModelByRole(config, "inlineEdit")?.title ?? defaultModelTitle; + config.selectedModelByRole.edit?.title ?? defaultModelTitle; void sidebar.webviewProtocol.request("incrementFtc", undefined); @@ -872,16 +872,12 @@ const getCommandsMap: ( const config = vscode.workspace.getConfiguration(EXTENSION_NAME); const quickPick = vscode.window.createQuickPick(); - const autocompleteModels = - (await configHandler.loadConfig()).config?.tabAutocompleteModels ?? []; - let selected = new GlobalContext().get("selectedTabAutocompleteModel"); - if ( - !selected || - !autocompleteModels.some((model) => model.title === selected) - ) { - selected = autocompleteModels[0]?.title; - } + const { config: continueConfig } = await configHandler.loadConfig(); + const autocompleteModels = + continueConfig?.modelsByRole.autocomplete ?? []; + const selected = + continueConfig?.selectedModelByRole?.autocomplete?.title ?? undefined; // Toggle between Disabled, Paused, and Enabled const pauseOnBattery = @@ -956,11 +952,14 @@ const getCommandsMap: ( } else if ( autocompleteModels.some((model) => model.title === selectedOption) ) { - new GlobalContext().update( - "selectedTabAutocompleteModel", - selectedOption, - ); - configHandler.reloadConfig(); + if (core.configHandler.currentProfile?.profileDescription.id) { + core.invoke("config/updateSelectedModel", { + profileId: + core.configHandler.currentProfile?.profileDescription.id, + role: "autocomplete", + title: selectedOption, + }); + } } else if (selectedOption === "$(feedback) Give feedback") { vscode.commands.executeCommand("continue.giveAutocompleteFeedback"); } else if (selectedOption === "$(comment) Open chat (Cmd+L)") { @@ -986,7 +985,10 @@ const getCommandsMap: ( }); if (feedback) { const client = await continueServerClientPromise; - const completionsPath = getDevDataFilePath("autocomplete"); + const completionsPath = getDevDataFilePath( + "autocomplete", + LOCAL_DEV_DATA_VERSION, + ); const lastLines = await readLastLines.read(completionsPath, 2); client.sendFeedback(feedback, lastLines); diff --git a/extensions/vscode/src/extension/VsCodeExtension.ts b/extensions/vscode/src/extension/VsCodeExtension.ts index f8b8ca130..8953c91a0 100644 --- a/extensions/vscode/src/extension/VsCodeExtension.ts +++ b/extensions/vscode/src/extension/VsCodeExtension.ts @@ -34,7 +34,6 @@ import { } from "../stubs/WorkOsAuthProvider"; import { Battery } from "../util/battery"; import { FileSearch } from "../util/FileSearch"; -import { TabAutocompleteModel } from "../util/loadAutocompleteModel"; import { VsCodeIde } from "../VsCodeIde"; import { VsCodeMessenger } from "./VsCodeMessenger"; @@ -47,7 +46,6 @@ export class VsCodeExtension { private configHandler: ConfigHandler; private extensionContext: vscode.ExtensionContext; private ide: VsCodeIde; - private tabAutocompleteModel: TabAutocompleteModel; private sidebar: ContinueGUIWebviewViewProvider; private windowId: string; private editDecorationManager: EditDecorationManager; @@ -143,7 +141,6 @@ export class VsCodeExtension { this.editDecorationManager, ); resolveVerticalDiffManager?.(this.verticalDiffManager); - this.tabAutocompleteModel = new TabAutocompleteModel(this.configHandler); setupRemoteConfigSync( this.configHandler.reloadConfig.bind(this.configHandler), @@ -168,8 +165,6 @@ export class VsCodeExtension { } else if (newConfig) { setupStatusBar(undefined, undefined, false); - this.tabAutocompleteModel.clearLlm(); - registerAllCodeLensProviders( context, this.verticalDiffManager.fileUriToCodeLens, @@ -193,7 +188,6 @@ export class VsCodeExtension { new ContinueCompletionProvider( this.configHandler, this.ide, - this.tabAutocompleteModel, this.sidebar.webviewProtocol, ), ), @@ -347,7 +341,8 @@ export class VsCodeExtension { // Register a content provider for the readonly virtual documents const documentContentProvider = new (class - implements vscode.TextDocumentContentProvider { + implements vscode.TextDocumentContentProvider + { // emitter and its event onDidChangeEmitter = new vscode.EventEmitter(); onDidChange = this.onDidChangeEmitter.event; @@ -367,9 +362,6 @@ export class VsCodeExtension { void this.core.invoke("didChangeActiveTextEditor", { filepath }); }); - const enableContinueHub = vscode.workspace - .getConfiguration(EXTENSION_NAME) - .get("enableContinueHub"); vscode.workspace.onDidChangeConfiguration(async (event) => { if (event.affectsConfiguration(EXTENSION_NAME)) { const settings = await this.ide.getIdeSettings(); @@ -377,14 +369,6 @@ export class VsCodeExtension { void webviewProtocol.request("didChangeIdeSettings", { settings, }); - - if ( - enableContinueHub - ? settings.continueTestEnvironment !== "production" - : settings.continueTestEnvironment === "production" - ) { - await vscode.commands.executeCommand("workbench.action.reloadWindow"); - } } }); } diff --git a/extensions/vscode/src/extension/VsCodeMessenger.ts b/extensions/vscode/src/extension/VsCodeMessenger.ts index aac537d93..23669305a 100644 --- a/extensions/vscode/src/extension/VsCodeMessenger.ts +++ b/extensions/vscode/src/extension/VsCodeMessenger.ts @@ -28,6 +28,7 @@ import { showTutorial } from "../util/tutorial"; import { getExtensionUri } from "../util/vscode"; import { VsCodeIde } from "../VsCodeIde"; import { VsCodeWebviewProtocol } from "../webviewProtocol"; +import { ILLM } from "core"; /** * A shared messenger class between Core and Webview @@ -177,7 +178,7 @@ export class VsCodeMessenger { return; } - let llm = getModelByRole(config, "applyCodeBlock"); + let llm: ILLM | null | undefined = config.selectedModelByRole.apply; if (!llm) { llm = config.models.find( @@ -286,13 +287,10 @@ export class VsCodeMessenger { const prompt = msg.data.prompt; const { start, end } = msg.data.range.range; const verticalDiffManager = await verticalDiffManagerPromise; - const modelTitle = await this.webviewProtocol.request( - "getDefaultModelTitle", - undefined, - ); + const fileAfterEdit = await verticalDiffManager.streamEdit( stripImages(prompt), - modelTitle, + msg.data.selectedModelTitle, "edit", undefined, undefined, @@ -307,30 +305,6 @@ export class VsCodeMessenger { fileAfterEdit, }); }); - this.onWebview("edit/acceptReject", async (msg) => { - const { onlyFirst, accept, filepath } = msg.data; - if (accept && onlyFirst) { - // Accept first - vscode.commands.executeCommand( - "continue.acceptVerticalDiffBlock", - filepath, - 0, - ); - } else if (accept) { - vscode.commands.executeCommand("continue.acceptDiff", filepath); - // Accept all - } else if (onlyFirst) { - // Reject first - vscode.commands.executeCommand( - "continue.rejectVerticalDiffBlock", - filepath, - 0, - ); - } else { - // Reject all - vscode.commands.executeCommand("continue.rejectDiff", filepath); - } - }); this.onWebview("edit/exit", async (msg) => { if (msg.data.shouldFocusEditor) { const activeEditor = vscode.window.activeTextEditor; diff --git a/extensions/vscode/src/quickEdit/ContextProvidersQuickPick.ts b/extensions/vscode/src/quickEdit/ContextProvidersQuickPick.ts index 1296a3466..074ec4d86 100644 --- a/extensions/vscode/src/quickEdit/ContextProvidersQuickPick.ts +++ b/extensions/vscode/src/quickEdit/ContextProvidersQuickPick.ts @@ -41,8 +41,8 @@ export async function getContextProvidersString( return provider.getContextItems("", { config, ide, - embeddingsProvider: config.embeddingsProvider, - reranker: config.reranker, + embeddingsProvider: config.selectedModelByRole.embed, + reranker: config.selectedModelByRole.rerank, llm: config.models[0], fullInput: "", selectedCode: [], diff --git a/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts b/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts index 09cf8e2cd..ec84eb81b 100644 --- a/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts +++ b/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts @@ -1,8 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ import { IDE } from "core"; import { ConfigHandler } from "core/config/ConfigHandler"; -import { getModelByRole } from "core/config/util"; -import { logDevData } from "core/util/devdata"; import { Telemetry } from "core/util/posthog"; import * as vscode from "vscode"; @@ -10,6 +8,7 @@ import { VerticalDiffManager } from "../diff/vertical/manager"; import { FileSearch } from "../util/FileSearch"; import { VsCodeWebviewProtocol } from "../webviewProtocol"; +import { DataLogger } from "core/data/log"; import { getContextProviderQuickPickVal } from "./ContextProvidersQuickPick"; import { appendToHistory, getHistoryQuickPickVal } from "./HistoryQuickPick"; import { getModelQuickPickVal } from "./ModelSelectionQuickPick"; @@ -226,13 +225,18 @@ export class QuickEdit { break; } let model = await this.getCurModelTitle(); - logDevData("quickEdit", { - prompt, - path, - label, - diffs: this.verticalDiffManager.logDiffs, - model, + + void DataLogger.getInstance().logDevData({ + name: "quickEdit", + data: { + prompt, + path, + label, + diffs: this.verticalDiffManager.logDiffs, + model, + }, }); + quickPick.dispose(); }); } @@ -273,7 +277,7 @@ export class QuickEdit { } return ( - getModelByRole(config, "inlineEdit")?.title ?? + config.selectedModelByRole.edit?.title ?? (await this.webviewProtocol.request( "getDefaultModelTitle", undefined, diff --git a/extensions/vscode/src/stubs/WorkOsAuthProvider.ts b/extensions/vscode/src/stubs/WorkOsAuthProvider.ts index de10f9c7d..8f0e00c8c 100644 --- a/extensions/vscode/src/stubs/WorkOsAuthProvider.ts +++ b/extensions/vscode/src/stubs/WorkOsAuthProvider.ts @@ -25,10 +25,12 @@ import { SecretStorage } from "./SecretStorage"; const AUTH_NAME = "Continue"; +const enableControlServerBeta = workspace + .getConfiguration(EXTENSION_NAME) + .get("enableContinueForTeams", false); const controlPlaneEnv = getControlPlaneEnvSync( - workspace.getConfiguration(EXTENSION_NAME).get("enableContinueHub") - ? "production" - : "none", + true ? "production" : "none", + enableControlServerBeta, ); const SESSIONS_SECRET_KEY = `${controlPlaneEnv.AUTH_TYPE}.sessions`; diff --git a/extensions/vscode/src/util/loadAutocompleteModel.ts b/extensions/vscode/src/util/loadAutocompleteModel.ts deleted file mode 100644 index fda69f023..000000000 --- a/extensions/vscode/src/util/loadAutocompleteModel.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { ConfigHandler } from "core/config/ConfigHandler"; -import Ollama from "core/llm/llms/Ollama"; -import { GlobalContext } from "core/util/GlobalContext"; - -import type { ILLM } from "core"; - -export class TabAutocompleteModel { - private _llm: ILLM | undefined; - private defaultTag = "qwen2.5-coder:1.5b"; - private globalContext: GlobalContext = new GlobalContext(); - - constructor(private configHandler: ConfigHandler) {} - - clearLlm() { - this._llm = undefined; - } - - async getDefaultTabAutocompleteModel() { - const llm = new Ollama({ - model: this.defaultTag, - }); - - try { - const models = await llm.listModels(); - if (!models.includes(this.defaultTag)) { - return undefined; - } - } catch (e) { - return undefined; - } - - return llm; - } - - async get() { - if (!this._llm) { - const { config } = await this.configHandler.loadConfig(); - if (!config) { - return undefined; - } - - if (config.tabAutocompleteModels?.length) { - const selected = this.globalContext.get("selectedTabAutocompleteModel"); - if (selected) { - this._llm = - config.tabAutocompleteModels?.find( - (model) => model.title === selected, - ) ?? config.tabAutocompleteModels?.[0]; - } else { - if (config.tabAutocompleteModels[0].title) { - this.globalContext.update( - "selectedTabAutocompleteModel", - config.tabAutocompleteModels[0].title, - ); - } - this._llm = config.tabAutocompleteModels[0]; - } - } else { - this._llm = await this.getDefaultTabAutocompleteModel(); - } - } - - return this._llm; - } -} diff --git a/gui/package-lock.json b/gui/package-lock.json index acdad5284..74273c5aa 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -7,7 +7,7 @@ "name": "gui", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-yaml": "^1.0.31", + "@continuedev/config-yaml": "^1.0.52", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", @@ -107,13 +107,13 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.31", + "@continuedev/config-yaml": "^1.0.52", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", "@modelcontextprotocol/sdk": "^1.5.0", "@mozilla/readability": "^0.5.0", - "@octokit/rest": "^20.0.2", + "@octokit/rest": "^20.1.1", "@typescript-eslint/eslint-plugin": "^7.8.0", "@xenova/transformers": "2.14.0", "adf-to-md": "^1.1.0", @@ -166,7 +166,7 @@ "wink-nlp-utils": "^2.1.0", "workerpool": "^9.1.3", "yaml": "^2.4.2", - "zod": "^3.23.8" + "zod": "^3.24.2" }, "devDependencies": { "@babel/preset-env": "^7.24.7", @@ -555,13 +555,13 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.31", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.31.tgz", - "integrity": "sha512-HNj+z7UTTARgsJTI0A1buM09fS4HoWVnn6Hbl6kJ2tZmOOm1OgogbcKP68AzHb4fy5H18MWnKS7XuseZpHFzHQ==", + "version": "1.0.52", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.52.tgz", + "integrity": "sha512-x0m4bcQpjHrrv95cq5tsen4Hb6yKCVGn+NeojyzNQYnRD0If/On+ATgX78uXtQtZxsdO4ip73HHCyQlA0O3ZyQ==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", - "zod": "^3.23.8" + "zod": "^3.24.2" } }, "node_modules/@emotion/is-prop-valid": { diff --git a/gui/package.json b/gui/package.json index 456c519fd..9a9b8d737 100644 --- a/gui/package.json +++ b/gui/package.json @@ -15,7 +15,7 @@ "test:watch": "vitest" }, "dependencies": { - "@continuedev/config-yaml": "^1.0.31", + "@continuedev/config-yaml": "^1.0.52", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", diff --git a/gui/public/logos/ncompass.png b/gui/public/logos/ncompass.png new file mode 100644 index 000000000..09c306695 Binary files /dev/null and b/gui/public/logos/ncompass.png differ diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx index b54db7549..a10fc7b6e 100644 --- a/gui/src/components/Layout.tsx +++ b/gui/src/components/Layout.tsx @@ -5,6 +5,7 @@ import { CustomScrollbarDiv, defaultBorderRadius } from "."; import { AuthProvider } from "../context/Auth"; import { useWebviewListener } from "../hooks/useWebviewListener"; import { useAppDispatch, useAppSelector } from "../redux/hooks"; +import { selectUseHub } from "../redux/selectors"; import { focusEdit, setEditStatus } from "../redux/slices/editModeState"; import { addCodeToEdit, @@ -244,6 +245,21 @@ const Layout = () => { } }, [location]); + const useHub = useAppSelector(selectUseHub); + + // Existing users that have already seen the onboarding card + // should be shown an intro card for hub.continue.dev + // useEffect(() => { + // if (useHub !== true) { + // return; + // } + // const seenHubIntro = getLocalStorage("seenHubIntro"); + // if (!onboardingCard.show && !seenHubIntro) { + // onboardingCard.setActiveTab("ExistingUserHubIntro"); + // } + // setLocalStorage("seenHubIntro", true); + // }, [onboardingCard.show, useHub]); + return ( @@ -278,9 +294,7 @@ const Layout = () => { onClick={() => navigate(ROUTES.CONFIG_ERROR)} > Error!{" "} - - Could not load config.json - + Could not load config
Learn More
)} diff --git a/gui/src/components/OnboardingCard/components/OnboardingCardTabs.tsx b/gui/src/components/OnboardingCard/components/OnboardingCardTabs.tsx index e14d7aa2c..b1543ea58 100644 --- a/gui/src/components/OnboardingCard/components/OnboardingCardTabs.tsx +++ b/gui/src/components/OnboardingCard/components/OnboardingCardTabs.tsx @@ -7,7 +7,7 @@ interface OnboardingCardTabsProps { onTabClick: (tabName: TabTitle) => void; } -export type TabTitle = "Quickstart" | "Best" | "Local"; +export type TabTitle = "Quickstart" | "Best" | "Local" | "ExistingUserHubIntro"; export const TabTitles: { [k in TabTitle]: { md: string; default: string } } = { Quickstart: { @@ -22,6 +22,10 @@ export const TabTitles: { [k in TabTitle]: { md: string; default: string } } = { md: "Local", default: "Local with Ollama", }, + ExistingUserHubIntro: { + md: "Try out hub.continue.dev", + default: "Try out hub.continue.dev", + }, }; const StyledSelect = styled.select` diff --git a/gui/src/components/OnboardingCard/platform/tabs/main.tsx b/gui/src/components/OnboardingCard/platform/tabs/main.tsx index 51a40e46d..8ca75b1e3 100644 --- a/gui/src/components/OnboardingCard/platform/tabs/main.tsx +++ b/gui/src/components/OnboardingCard/platform/tabs/main.tsx @@ -55,6 +55,20 @@ export default function MainTab({ Go to Continue Platform + ) : onboardingCard.activeTab === "ExistingUserHubIntro" ? ( + <> +

+ You can now browse and create custom AI code assistants at{" "} + hub.continue.dev +

+ + + ) : ( <>

@@ -70,12 +84,21 @@ export default function MainTab({ )} - -

- Or, remain local - -
- + {onboardingCard.activeTab === "ExistingUserHubIntro" ? ( + onboardingCard.close(isDialog)}> +
+ Or, use Continue as usual + +
+
+ ) : ( + +
+ Or, remain local + +
+
+ )} ); } diff --git a/gui/src/components/StepContainer/FeedbackButtons.tsx b/gui/src/components/StepContainer/FeedbackButtons.tsx index e621fda33..4ef09a833 100644 --- a/gui/src/components/StepContainer/FeedbackButtons.tsx +++ b/gui/src/components/StepContainer/FeedbackButtons.tsx @@ -22,8 +22,12 @@ export default function FeedbackButtons({ item }: FeedbackButtonsProps) { if (item.promptLogs?.length) { for (const promptLog of item.promptLogs) { ideMessenger.post("devdata/log", { - tableName: "chat", - data: { ...promptLog, feedback, sessionId }, + name: "chatFeedback", + data: { + ...promptLog, + feedback, + sessionId, + }, }); } } diff --git a/gui/src/components/TabBar/TabBar.tsx b/gui/src/components/TabBar/TabBar.tsx new file mode 100644 index 000000000..e2e879da0 --- /dev/null +++ b/gui/src/components/TabBar/TabBar.tsx @@ -0,0 +1,279 @@ +import { PlusIcon, XMarkIcon } from "@heroicons/react/24/outline"; +import { useCallback, useEffect, useState } from "react"; +import styled from "styled-components"; +import { defaultBorderRadius } from ".."; +import { useDispatch, useSelector } from "react-redux"; +import { AppDispatch, RootState } from "../../redux/store"; +import { loadSession, saveCurrentSession } from "../../redux/thunks/session"; +import { newSession } from "../../redux/slices/sessionSlice"; +import { + addTab, + removeTab, + setActiveTab, + setTabs, + handleSessionChange, +} from "../../redux/slices/tabsSlice"; + +const TabBarContainer = styled.div` + display: flex; + flex-wrap: wrap; + flex-shrink: 0; + flex-grow: 0; + background-color: var(--vscode-tab-inactiveBackground); + border-bottom: none; + position: relative; + margin-top: 7px; + + /* Hide scrollbar but keep functionality */ + scrollbar-width: none; + &::-webkit-scrollbar { + display: none; + } +`; + +const Tab = styled.div<{ isActive: boolean }>` + display: flex; + align-items: center; + box-sizing: border-box; + padding: 0 5px 0 12px; + flex-grow: 1; + width: 100px; + max-width: 150px; + height: 25px; + background-color: ${(props) => + props.isActive + ? "var(--vscode-tab-activeBackground)" + : "var(--vscode-tab-inactiveBackground)"}; + color: ${(props) => + props.isActive + ? "var(--vscode-tab-activeForeground)" + : "var(--vscode-tab-inactiveForeground)"}; + cursor: pointer; + border: 1px solid var(--vscode-tab-border); + border-bottom: ${(props) => + props.isActive ? "none" : `1px solid var(--vscode-tab-border)`}; + user-select: none; + position: relative; + transition: background-color 0.2s; + border-top: ${(props) => + props.isActive + ? `1px solid var(--vscode-tab-activeBorderTop, --vscode-tab-border)` + : `1px solid var(--vscode-tab-border)`}; + &:first-child { + border-left: none; + } + & + & { + border-left: none; + } + + &:hover { + background-color: ${(props) => + props.isActive + ? "var(--vscode-tab-activeBackground)" + : "var(--vscode-tab-hoverBackground)"}; + color: ${(props) => + props.isActive + ? "var(--vscode-tab-activeForeground)" + : "var(--vscode-tab-hoverForeground)"}; + } +`; + +const TabTitle = styled.span` + flex: 1; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 13px; +`; + +const CloseButton = styled.button` + display: flex; + align-items: center; + justify-content: center; + width: 16px; + height: 16px; + margin-left: 4px; + border: none; + background: transparent; + color: inherit; + opacity: 0.7; + cursor: pointer; + border-radius: ${defaultBorderRadius}; + padding: 2px; + visibility: hidden; + + &:hover { + opacity: 1; + background-color: var(--vscode-tab-hoverBackground); + } + + ${Tab}:hover & { + visibility: visible; + } + + &[disabled] { + display: none !important; + } +`; + +const TabBarSpace = styled.div` + flex: 1; + display: flex; + border-bottom: 1px solid var(--vscode-tab-border); + background-color: var(--vscode-tab-inactiveBackground); +`; + +const NewTabButton = styled.button` + display: flex; + align-items: center; + justify-content: center; + width: 35px; + height: 100%; + border: none; + background: transparent; + color: var(--vscode-tab-inactiveForeground); + cursor: pointer; + opacity: 0.7; + transition: opacity 0.2s; + + &:hover { + opacity: 1; + background-color: var(--vscode-tab-hoverBackground); + color: var(--vscode-tab-hoverForeground); + } +`; + +export function TabBar() { + const dispatch = useDispatch(); + const currentSession = useSelector((state: RootState) => state.session); + const currentSessionId = useSelector((state: RootState) => state.session.id); + const currentSessionTitle = useSelector( + (state: RootState) => state.session.title, + ); + const hasHistory = useSelector( + (state: RootState) => state.session.history.length > 0, + ); + const tabs = useSelector((state: RootState) => state.tabs.tabs); + + useEffect(() => { + console.log("session", currentSession); + }, [currentSession.id]); + + // Simple UUID generator for our needs + const generateId = useCallback(() => { + return Date.now().toString(36) + Math.random().toString(36).substring(2); + }, []); + + // Handle session changes + useEffect(() => { + if (!currentSessionId) return; + + dispatch( + handleSessionChange({ + currentSessionId, + currentSessionTitle, + newTabId: generateId(), // Pass the ID generator result + }), + ); + }, [currentSessionId, currentSessionTitle]); + + const handleNewTab = async () => { + // Save current session before creating new one + if (hasHistory) { + await dispatch( + saveCurrentSession({ openNewSession: false, generateTitle: true }), + ); + } + + dispatch(newSession()); + + dispatch( + addTab({ + id: generateId(), + title: `Chat ${tabs.length + 1}`, + isActive: true, + sessionId: undefined, + }), + ); + }; + + useEffect(() => { + if (!tabs.length) { + handleNewTab(); + } + }, [tabs.map((t) => t.id).join(",")]); + + const handleTabClick = async (id: string) => { + const targetTab = tabs.find((tab) => tab.id === id); + if (!targetTab) return; + + if (targetTab.sessionId) { + // Switch to existing session + await dispatch( + loadSession({ + sessionId: targetTab.sessionId, + saveCurrentSession: hasHistory, + }), + ); + } + + dispatch(setActiveTab(id)); + }; + + const handleTabClose = async (id: string) => { + //if (tabs.length <= 1) return; + + const isClosingActive = tabs.find((t) => t.id === id)?.isActive; + const filtered = tabs.filter((t) => t.id !== id); + + if (isClosingActive) { + const lastTab = filtered[filtered.length - 1]; + if (filtered.length) { + await handleTabClick(lastTab.id); + dispatch( + setTabs( + filtered.map((tab, i) => ({ + ...tab, + isActive: i === filtered.length - 1, + })), + ), + ); + } else { + dispatch(setTabs([])); + dispatch(newSession()); + } + } else { + dispatch(removeTab(id)); + } + }; + + return tabs.length === 1 ? ( + <> + ) : ( + + {tabs.map((tab) => ( + handleTabClick(tab.id)} + > + {tab.title} + { + e.stopPropagation(); + handleTabClose(tab.id); + }} + > + + + + ))} + + {/* + + */} + + + ); +} diff --git a/gui/src/components/dialogs/AddDocsDialog.tsx b/gui/src/components/dialogs/AddDocsDialog.tsx index df75e6203..eb3d3bcbb 100644 --- a/gui/src/components/dialogs/AddDocsDialog.tsx +++ b/gui/src/components/dialogs/AddDocsDialog.tsx @@ -110,7 +110,6 @@ function AddDocsDialog() { type: "docs", description: "Initializing", id: startUrl, - embeddingsProviderId: "mock-embeddings-provider-id", progress: 0, status: "indexing", title, @@ -164,7 +163,6 @@ function AddDocsDialog() { type: "docs", description: "Initializing", id: docsResult.details.docsLink, - embeddingsProviderId: "mock-embeddings-provider-id", progress: 0, status: "indexing", title: docsResult.details.title ?? docsResult.packageInfo.name, diff --git a/gui/src/components/gui/Switch.tsx b/gui/src/components/gui/Switch.tsx index 7d6105e6d..8957038ac 100644 --- a/gui/src/components/gui/Switch.tsx +++ b/gui/src/components/gui/Switch.tsx @@ -13,10 +13,10 @@ const ToggleSwitch: React.FC = ({ }) => { return (
- {text} + {text}
diff --git a/gui/src/components/mainInput/InputToolbar.tsx b/gui/src/components/mainInput/InputToolbar.tsx index 2f7c6a3b1..ace2ae991 100644 --- a/gui/src/components/mainInput/InputToolbar.tsx +++ b/gui/src/components/mainInput/InputToolbar.tsx @@ -126,7 +126,7 @@ function InputToolbar(props: InputToolbarProps) { } }} /> - + {!props.toolbarOptions?.hideUseCodebase && !isInEditMode && (
- + login(false)} + >
Promise; selectedProfile: ProfileDescription | null; profiles: ProfileDescription[] | null; + refreshProfiles: () => void; controlServerBetaEnabled: boolean; organizations: OrganizationDescription[]; selectedOrganization: OrganizationDescription | null; @@ -165,7 +166,6 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ useEffect(() => { ideMessenger.request("config/listProfiles", undefined).then((result) => { if (result.status === "success") { - console.log("PROFILES: ", result.content); dispatch( updateProfilesThunk({ profiles: result.content, @@ -176,10 +176,19 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ }); }, []); + const refreshProfiles = async () => { + try { + await ideMessenger.request("config/refreshProfiles", undefined); + ideMessenger.post("showToast", ["info", "Config refreshed"]); + } catch (e) { + console.error("Failed to refresh profiles", e); + ideMessenger.post("showToast", ["error", "Failed to refresh config"]); + } + }; + useWebviewListener( "didChangeAvailableProfiles", async (data) => { - console.log("AVAILABLE: ", data.profiles, data.selectedProfileId); dispatch( updateProfilesThunk({ profiles: data.profiles, @@ -198,6 +207,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ login, selectedProfile, profiles, + refreshProfiles, selectedOrganization, organizations: orgs, controlServerBetaEnabled, diff --git a/gui/src/hooks/useSetup.ts b/gui/src/hooks/useSetup.ts index 714f4ed75..b86757cbf 100644 --- a/gui/src/hooks/useSetup.ts +++ b/gui/src/hooks/useSetup.ts @@ -45,7 +45,6 @@ function useSetup() { } hasLoadedConfig.current = true; dispatch(setConfigResult(configResult)); - console.log("selecting 1", profileId); dispatch(selectProfileThunk(profileId)); // Perform any actions needed with the config @@ -95,7 +94,6 @@ function useSetup() { useWebviewListener( "configUpdate", async (update) => { - console.log("CONFIG UPDATE: ", update); if (!update) { return; } diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index 72303ce17..73aaa428c 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -502,6 +502,19 @@ export const models: { [key: string]: ModelPackage } = { providerOptions: ["groq", "scaleway", "nebius"], isOpenSource: false, }, + llama3370bChat: { + title: "Llama3.3 70b Chat", + description: "A model from Meta, fine-tuned for chat", + refUrl: "", + params: { + title: "Llama3.3-70b", + model: "llama3.3-70b", + contextLength: 65536, + }, + icon: "meta.png", + providerOptions: [], + isOpenSource: false, + }, llama3170bChat: { title: "Llama3.1 70b Chat", description: "A model from Meta, fine-tuned for chat", @@ -1361,7 +1374,7 @@ export const models: { [key: string]: ModelPackage } = { }, }, ], - providerOptions: ["nebius"], + providerOptions: ["nebius", "ncompass"], isOpenSource: true, }, Qwen25Coder32b: { @@ -1374,7 +1387,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 32_000, }, icon: "qwen.png", - providerOptions: ["scaleway", "nebius"], + providerOptions: ["scaleway", "nebius", "ncompass"], isOpenSource: true, }, grokBeta: { diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 31c0bb2f6..38ed33400 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -409,6 +409,38 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n }), apiKeyUrl: "https://api.together.xyz/settings/api-keys", }, + ncompass: { + title: "nCompass", + provider: "ncompass", + refPage: "ncompass", + description: + "Use the nCompass API for extremely fast streaming of open-source models", + icon: "ncompass.png", + longDescription: `nCompass is an extremely fast inference engine for open-source language models. To get started, obtain an API key from [their console](https://app.ncompass.tech/api-settings).`, + tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource], + params: { + apiKey: "", + }, + collectInputFor: [ + { + inputType: "text", + key: "apiKey", + label: "API Key", + placeholder: "Enter your nCompass API key", + required: true, + }, + ...completionParamsInputsConfigs, + ], + packages: [ + models.llama318bChat, + models.llama3370bChat, + models.Qwen25Coder32b, + ].map((p) => { + p.params.contextLength = 4096; + return p; + }), + apiKeyUrl: "https://app.ncompass.tech/api-settings", + }, novita: { title: "NovitaAI", provider: "novita", diff --git a/gui/src/pages/More/IndexingProgress/IndexingProgressErrorText.tsx b/gui/src/pages/More/IndexingProgress/IndexingProgressErrorText.tsx index 4cfea672c..e7a19f612 100644 --- a/gui/src/pages/More/IndexingProgress/IndexingProgressErrorText.tsx +++ b/gui/src/pages/More/IndexingProgress/IndexingProgressErrorText.tsx @@ -1,7 +1,6 @@ import { XCircleIcon } from "@heroicons/react/24/outline"; import { IndexingProgressUpdate } from "core"; import { useAppSelector } from "../../../redux/hooks"; -import { isJetBrains } from "../../../util"; export interface IndexingProgressErrorTextProps { update: IndexingProgressUpdate; @@ -9,20 +8,16 @@ export interface IndexingProgressErrorTextProps { function IndexingProgressErrorText({ update }: IndexingProgressErrorTextProps) { const embeddingsProvider = useAppSelector( - (state) => state.config.config.embeddingsProvider, + (state) => state.config.config.selectedModelByRole.embed, ); - const showJbError = - (isJetBrains() && embeddingsProvider === "all-MiniLM-L6-v2") || true; - - if (showJbError) { + if (!embeddingsProvider) { return (
- The transformers.js embeddingsProvider is currently - unsupported in JetBrains. To enable codebase indexing, you can use any - of the other providers described in the docs:{" "} + Add an Embeddings model to enable codebase indexing. See the docs for + examples: void; + displayName: string; + description: string; +} + +const ModelRoleSelector = ({ + models, + selectedModel, + onSelect, + displayName, + description, +}: ModelRoleSelectorProps) => { + function handleSelect(title: string | null) { + onSelect(models.find((m) => m.title === title) ?? null); + } + + return ( + <> +
+ {displayName} + + + {description} + +
+ + {({ open }) => ( +
+ + {models.length === 0 ? ( + {`No ${displayName} models${["Chat", "Apply", "Edit"].includes(displayName) ? ". Using chat model" : ""}`} + ) : ( + + {selectedModel?.title ?? `Select ${displayName} model`} + + )} + {models.length ? ( +
+
+ ) : null} +
+ + + + {models.map((option, idx) => ( + + + {option.title} + + + ))} + + +
+ )} +
+ + ); +}; + +export default ModelRoleSelector; diff --git a/gui/src/pages/config/UserSettings.tsx b/gui/src/pages/config/UserSettings.tsx deleted file mode 100644 index 6912cd031..000000000 --- a/gui/src/pages/config/UserSettings.tsx +++ /dev/null @@ -1,322 +0,0 @@ -import { useContext, useEffect, useState } from "react"; -import { IdeMessengerContext } from "../../context/IdeMessenger"; -import { useAppDispatch, useAppSelector } from "../../redux/hooks"; - -import { CheckIcon, XMarkIcon } from "@heroicons/react/24/outline"; -import { - SharedConfigSchema, - modifyContinueConfigWithSharedConfig, -} from "core/config/sharedConfig"; -import { Input } from "../../components"; -import NumberInput from "../../components/gui/NumberInput"; -import { Select } from "../../components/gui/Select"; -import ToggleSwitch from "../../components/gui/Switch"; -import { updateConfig } from "../../redux/slices/configSlice"; -import { getFontSize } from "../../util"; - -function UserSettingsUI() { - const dispatch = useAppDispatch(); - const ideMessenger = useContext(IdeMessengerContext); - - const config = useAppSelector((state) => state.config.config); - - function handleUpdate(sharedConfig: Partial) { - dispatch( - updateConfig(modifyContinueConfigWithSharedConfig(config, sharedConfig)), - ); - ideMessenger.post("config/updateSharedConfig", sharedConfig); - } - - // TODO defaults are in multiple places, should be consolidated and probably not explicit here - const codeWrap = config.ui?.codeWrap ?? false; - const showChatScrollbar = config.ui?.showChatScrollbar ?? false; - const displayRawMarkdown = config.ui?.displayRawMarkdown ?? false; - const disableSessionTitles = config.disableSessionTitles ?? false; - const readResponseTTS = config.experimental?.readResponseTTS ?? false; - - const allowAnonymousTelemetry = config.allowAnonymousTelemetry ?? true; - const disableIndexing = config.disableIndexing ?? false; - - const useAutocompleteCache = config.tabAutocompleteOptions?.useCache ?? false; - const useChromiumForDocsCrawling = - config.experimental?.useChromiumForDocsCrawling ?? false; - const codeBlockToolbarPosition = config.ui?.codeBlockToolbarPosition ?? "top"; - const useAutocompleteMultilineCompletions = - config.tabAutocompleteOptions?.multilineCompletions ?? "auto"; - const fontSize = getFontSize(); - - // Disable autocomplete - const disableAutocompleteInFiles = ( - config.tabAutocompleteOptions?.disableInFiles ?? [] - ).join(", "); - const [formDisableAutocomplete, setFormDisableAutocomplete] = useState( - disableAutocompleteInFiles, - ); - const cancelChangeDisableAutocomplete = () => { - setFormDisableAutocomplete(disableAutocompleteInFiles); - }; - const handleDisableAutocompleteSubmit = () => { - handleUpdate({ - disableAutocompleteInFiles: formDisableAutocomplete - .split(",") - .map((val) => val.trim()) - .filter((val) => !!val), - }); - }; - - useEffect(() => { - // Necessary so that reformatted/trimmed values don't cause dirty state - setFormDisableAutocomplete(disableAutocompleteInFiles); - }, [disableAutocompleteInFiles]); - - // Workspace prompts - const promptPath = config.experimental?.promptPath || ""; - const [formPromptPath, setFormPromptPath] = useState(promptPath); - const cancelChangePromptPath = () => { - setFormPromptPath(promptPath); - }; - const handleSubmitPromptPath = () => { - handleUpdate({ - promptPath: formPromptPath || "", - }); - }; - - useEffect(() => { - // Necessary so that reformatted/trimmed values don't cause dirty state - setFormPromptPath(promptPath); - }, [promptPath]); - - return ( -
-
-

User settings

-
- -
- - handleUpdate({ - codeWrap: !codeWrap, - }) - } - text="Wrap Codeblocks" - /> - - handleUpdate({ - displayRawMarkdown: !displayRawMarkdown, - }) - } - text="Display Raw Markdown" - /> - - handleUpdate({ - allowAnonymousTelemetry: !allowAnonymousTelemetry, - }) - } - text="Allow Anonymous Telemetry" - /> - - handleUpdate({ - disableIndexing: !disableIndexing, - }) - } - text="Disable Indexing" - /> - - - handleUpdate({ - disableSessionTitles: !disableSessionTitles, - }) - } - text="Disable Session Titles" - /> - - handleUpdate({ - readResponseTTS: !readResponseTTS, - }) - } - text="Response Text to Speech" - /> - - - handleUpdate({ - showChatScrollbar: !showChatScrollbar, - }) - } - text="Show Chat Scrollbar" - /> - - - handleUpdate({ - useAutocompleteCache: !useAutocompleteCache, - }) - } - text="Use Autocomplete Cache" - /> - - - handleUpdate({ - useChromiumForDocsCrawling: !useChromiumForDocsCrawling, - }) - } - text="Use Chromium for Docs Crawling" - /> - - - - - - - -
{ - e.preventDefault(); - handleSubmitPromptPath(); - }} - > -
- Workspace prompts path -
- { - setFormPromptPath(e.target.value); - }} - /> -
- {formPromptPath !== promptPath ? ( - <> -
- -
-
- -
- - ) : ( -
- -
- )} -
-
-
-
-
{ - e.preventDefault(); - handleDisableAutocompleteSubmit(); - }} - > -
- Disable autocomplete in files -
- { - setFormDisableAutocomplete(e.target.value); - }} - /> -
- {formDisableAutocomplete !== disableAutocompleteInFiles ? ( - <> -
- -
-
- -
- - ) : ( -
- -
- )} -
-
-
- - Comma-separated list of path matchers - -
-
-
- ); -} - -export default UserSettingsUI; diff --git a/gui/src/pages/config/index.tsx b/gui/src/pages/config/index.tsx index 56fe464f7..58ecd7be1 100644 --- a/gui/src/pages/config/index.tsx +++ b/gui/src/pages/config/index.tsx @@ -1,16 +1,32 @@ +import { ModelRole } from "@continuedev/config-yaml"; import { Listbox, Transition } from "@headlessui/react"; -import { ChevronUpDownIcon, PlusCircleIcon } from "@heroicons/react/24/outline"; +import { + CheckIcon, + ChevronUpDownIcon, + PlusCircleIcon, + XMarkIcon, +} from "@heroicons/react/24/outline"; +import { ModelDescription } from "core"; +import { + SharedConfigSchema, + modifyAnyConfigWithSharedConfig, +} from "core/config/sharedConfig"; import { Fragment, useContext, useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; -import { SecondaryButton } from "../../components"; +import { Input, SecondaryButton } from "../../components"; +import NumberInput from "../../components/gui/NumberInput"; +import { Select } from "../../components/gui/Select"; +import ToggleSwitch from "../../components/gui/Switch"; import PageHeader from "../../components/PageHeader"; import { useAuth } from "../../context/Auth"; import { IdeMessengerContext } from "../../context/IdeMessenger"; import { useNavigationListener } from "../../hooks/useNavigationListener"; -import { useAppDispatch } from "../../redux/hooks"; +import { useAppDispatch, useAppSelector } from "../../redux/hooks"; +import { setDefaultModel, updateConfig } from "../../redux/slices/configSlice"; import { selectProfileThunk } from "../../redux/thunks/profileAndOrg"; +import { getFontSize, isJetBrains } from "../../util"; +import ModelRoleSelector from "./ModelRoleSelector"; import { ScopeSelect } from "./ScopeSelect"; -import UserSettingsUI from "./UserSettings"; function ConfigPage() { useNavigationListener(); @@ -29,7 +45,6 @@ function ConfigPage() { } = useAuth(); const changeProfileId = (id: string) => { - console.log("selecting 2", id); dispatch(selectProfileThunk(id)); }; @@ -52,114 +67,233 @@ function ConfigPage() { // NOTE Hub takes priority over Continue for Teams // Since teams will be moving to hub, not vice versa + /////// User settings section ////// + const config = useAppSelector((state) => state.config.config); + const selectedChatModel = useAppSelector( + (store) => store.config.defaultModelTitle, + ); + + function handleUpdate(sharedConfig: SharedConfigSchema) { + // Optimistic update + const updatedConfig = modifyAnyConfigWithSharedConfig(config, sharedConfig); + dispatch(updateConfig(updatedConfig)); + // IMPORTANT no need for model role updates (separate logic for selected model roles) + // simply because this function won't be used to update model roles + + // Actual update to core which propagates back with config update event + ideMessenger.post("config/updateSharedConfig", sharedConfig); + } + + function handleRoleUpdate(role: ModelRole, model: ModelDescription | null) { + if (!selectedProfile) { + return; + } + // Optimistic update + dispatch( + updateConfig({ + ...config, + selectedModelByRole: { + ...config.selectedModelByRole, + [role]: model, + }, + }), + ); + ideMessenger.post("config/updateSelectedModel", { + profileId: selectedProfile.id, + role, + title: model?.title ?? null, + }); + } + + // TODO use handleRoleUpdate for chat + function handleChatModelSelection(model: ModelDescription | null) { + if (!model) { + return; + } + dispatch(setDefaultModel({ title: model.title })); + } + + // TODO defaults are in multiple places, should be consolidated and probably not explicit here + const codeWrap = config.ui?.codeWrap ?? false; + const showChatScrollbar = config.ui?.showChatScrollbar ?? false; + const displayRawMarkdown = config.ui?.displayRawMarkdown ?? false; + const disableSessionTitles = config.disableSessionTitles ?? false; + const readResponseTTS = config.experimental?.readResponseTTS ?? false; + + const allowAnonymousTelemetry = config.allowAnonymousTelemetry ?? true; + const disableIndexing = config.disableIndexing ?? false; + + const useAutocompleteCache = config.tabAutocompleteOptions?.useCache ?? false; + const useChromiumForDocsCrawling = + config.experimental?.useChromiumForDocsCrawling ?? false; + const codeBlockToolbarPosition = config.ui?.codeBlockToolbarPosition ?? "top"; + const useAutocompleteMultilineCompletions = + config.tabAutocompleteOptions?.multilineCompletions ?? "auto"; + const fontSize = getFontSize(); + + // Disable autocomplete + const disableAutocompleteInFiles = ( + config.tabAutocompleteOptions?.disableInFiles ?? [] + ).join(", "); + const [formDisableAutocomplete, setFormDisableAutocomplete] = useState( + disableAutocompleteInFiles, + ); + const cancelChangeDisableAutocomplete = () => { + setFormDisableAutocomplete(disableAutocompleteInFiles); + }; + const handleDisableAutocompleteSubmit = () => { + handleUpdate({ + disableAutocompleteInFiles: formDisableAutocomplete + .split(",") + .map((val) => val.trim()) + .filter((val) => !!val), + }); + }; + + useEffect(() => { + // Necessary so that reformatted/trimmed values don't cause dirty state + setFormDisableAutocomplete(disableAutocompleteInFiles); + }, [disableAutocompleteInFiles]); + + // Workspace prompts + const promptPath = config.experimental?.promptPath || ""; + const [formPromptPath, setFormPromptPath] = useState(promptPath); + const cancelChangePromptPath = () => { + setFormPromptPath(promptPath); + }; + const handleSubmitPromptPath = () => { + handleUpdate({ + promptPath: formPromptPath || "", + }); + }; + + useEffect(() => { + // Necessary so that reformatted/trimmed values don't cause dirty state + setFormPromptPath(promptPath); + }, [promptPath]); + + const jetbrains = isJetBrains(); + return (
navigate("/")} title="Chat" />
-
-
-

Account

- {!session ? ( -
- You are not signed in. - login(false)}> - Sign in - -
- ) : ( -
- {hubEnabled ? ( - // Hub: show org selector -
- {`Organization`} - -
- ) : ( - // Continue for teams: show org text -
You are using Continue for Teams
- )} -
- - {session.account.label === "" - ? "Signed in" - : `Signed in as ${session.account.label}`} - - {`Sign out`} + {(session || hubEnabled || controlServerBetaEnabled) && ( +
+
+

Account

+ {!session ? ( +
+ You are not signed in. + login(false)}> + Sign in +
-
- )} + ) : ( +
+ {hubEnabled ? ( + // Hub: show org selector +
+ {`Organization`} + +
+ ) : ( + // Continue for teams: show org text +
You are using Continue for Teams
+ )} +
+ + {session.account.label === "" + ? "Signed in" + : `Signed in as ${session.account.label}`} + + {`Sign out`} +
+
+ )} +
-
+ )}

Configuration

{profiles ? ( <> - - {({ open }) => ( -
- - - {selectedProfile?.title ?? "No Assistant Selected"} - -
-
-
+
+ {`${hubEnabled ? "Assistant" : "Profile"}`} + + {({ open }) => ( +
+ + + {selectedProfile?.title ?? "No Assistant Selected"} + +
+
+
- - - {profiles.map((option, idx) => ( - - - {option.title} - - - ))} - {hubEnabled && ( - { - ideMessenger.post("controlPlane/openUrl", { - path: "new", - orgSlug: selectedOrganization?.slug, - }); - }} - > - - - Create new Assistant - - - )} - - -
- )} -
+ + + {profiles.map((option, idx) => ( + + + {option.title} + + + ))} + {hubEnabled && ( + { + if (session) { + ideMessenger.post("controlPlane/openUrl", { + path: "new", + orgSlug: selectedOrganization?.slug, + }); + } else { + login(false); + } + }} + > + + + Create new Assistant + + + )} + + +
+ )} + +
{selectedProfile && ( {selectedProfile.id === "local" @@ -169,16 +303,311 @@ function ConfigPage() { : "Open Workspace"} )} + {/* {hubEnabled && session && ( +
+ {`If your hub secret values may have changed, refresh your assistants`} + + Refresh assistants + +
+ )} */} ) : (
Loading...
)} +
+

Model Roles

+
+ handleChatModelSelection(model)} + /> + handleRoleUpdate("autocomplete", model)} + /> + {/* Jetbrains has a model selector inline */} + {!jetbrains && ( + handleRoleUpdate("edit", model)} + /> + )} + handleRoleUpdate("apply", model)} + /> + handleRoleUpdate("embed", model)} + /> + handleRoleUpdate("rerank", model)} + /> +
+
{!controlServerBetaEnabled || hubEnabled ? (
- +
+
+

User settings

+
+ +
+ + handleUpdate({ + codeWrap: !codeWrap, + }) + } + text="Wrap Codeblocks" + /> + + handleUpdate({ + displayRawMarkdown: !displayRawMarkdown, + }) + } + text="Display Raw Markdown" + /> + + handleUpdate({ + allowAnonymousTelemetry: !allowAnonymousTelemetry, + }) + } + text="Allow Anonymous Telemetry" + /> + + handleUpdate({ + disableIndexing: !disableIndexing, + }) + } + text="Disable Indexing" + /> + + + handleUpdate({ + disableSessionTitles: !disableSessionTitles, + }) + } + text="Disable Session Titles" + /> + + handleUpdate({ + readResponseTTS: !readResponseTTS, + }) + } + text="Response Text to Speech" + /> + + + handleUpdate({ + showChatScrollbar: !showChatScrollbar, + }) + } + text="Show Chat Scrollbar" + /> + + + handleUpdate({ + useAutocompleteCache: !useAutocompleteCache, + }) + } + text="Use Autocomplete Cache" + /> + + + handleUpdate({ + useChromiumForDocsCrawling: !useChromiumForDocsCrawling, + }) + } + text="Use Chromium for Docs Crawling" + /> + + + + + + + +
{ + e.preventDefault(); + handleSubmitPromptPath(); + }} + > +
+ Workspace prompts path +
+ { + setFormPromptPath(e.target.value); + }} + /> +
+ {formPromptPath !== promptPath ? ( + <> +
+ +
+
+ +
+ + ) : ( +
+ +
+ )} +
+
+
+
+
{ + e.preventDefault(); + handleDisableAutocompleteSubmit(); + }} + > +
+ Disable autocomplete in files +
+ { + setFormDisableAutocomplete(e.target.value); + }} + /> +
+ {formDisableAutocomplete !== + disableAutocompleteInFiles ? ( + <> +
+ +
+
+ +
+ + ) : ( +
+ +
+ )} +
+
+
+ + Comma-separated list of path matchers + +
+
+
) : null} diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index 55027c041..5289e867c 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -111,7 +111,7 @@ const StepsDiv = styled.div` } .thread-message { - margin: 0px 4px 0 4px; + margin: 0px 0px 0px 1px; } `; @@ -338,6 +338,7 @@ export function Chat() { ideMessenger.post("edit/sendPrompt", { prompt, range: codeToEdit[0] as RangeInFileWithContents, + selectedModelTitle, }); dispatch(submitEdit(prompt)); diff --git a/gui/src/pages/gui/StreamError.tsx b/gui/src/pages/gui/StreamError.tsx index 2a8465c30..36d3853b1 100644 --- a/gui/src/pages/gui/StreamError.tsx +++ b/gui/src/pages/gui/StreamError.tsx @@ -1,14 +1,17 @@ -import { Cog8ToothIcon, ListBulletIcon } from "@heroicons/react/24/outline"; -import { useAppDispatch, useAppSelector } from "../../redux/hooks"; -import { useContext } from "react"; -import { GithubIcon } from "../../components/svg/GithubIcon"; -import { DiscordIcon } from "../../components/svg/DiscordIcon"; -import { IdeMessengerContext } from "../../context/IdeMessenger"; +import { Cog8ToothIcon } from "@heroicons/react/24/outline"; import { DISCORD_LINK, GITHUB_LINK } from "core/util/constants"; -import { selectDefaultModel } from "../../redux/slices/configSlice"; -import { providers } from "../AddNewModel/configs/providers"; +import { useContext } from "react"; import { Button, SecondaryButton } from "../../components"; +import { DiscordIcon } from "../../components/svg/DiscordIcon"; +import { GithubIcon } from "../../components/svg/GithubIcon"; +import { useAuth } from "../../context/Auth"; +import { IdeMessengerContext } from "../../context/IdeMessenger"; +import { useAppDispatch, useAppSelector } from "../../redux/hooks"; +import { selectUseHub } from "../../redux/selectors"; +import { selectDefaultModel } from "../../redux/slices/configSlice"; import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice"; +import { isLocalProfile } from "../../util"; +import { providers } from "../AddNewModel/configs/providers"; interface StreamErrorProps { error: unknown; @@ -17,6 +20,17 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => { const dispatch = useAppDispatch(); const ideMessenger = useContext(IdeMessengerContext); const selectedModel = useAppSelector(selectDefaultModel); + const hubEnabled = useAppSelector(selectUseHub); + const selectedProfile = useAppSelector( + (store) => store.session.selectedProfile, + ); + const { session, refreshProfiles } = useAuth(); + + const handleRefreshProfiles = () => { + refreshProfiles(); + dispatch(setShowDialog(false)); + dispatch(setDialogMessage(undefined)); + }; // Collect model information to display useful error info let modelTitle = "Chat model"; @@ -139,7 +153,18 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => { if (statusCode === 401) { errorContent = (
- {`Likely cause: your API key is invalid.`} + {hubEnabled && + session && + selectedProfile && + !isLocalProfile(selectedProfile) && ( +
+ {`If your hub secret values may have changed, refresh your assistants`} + + Refresh assistant secrets + +
+ )} + {`It's possible that your API key is invalid.`}
{checkKeysButton} {configButton} diff --git a/gui/src/pages/gui/index.tsx b/gui/src/pages/gui/index.tsx index 31784a358..48ae10211 100644 --- a/gui/src/pages/gui/index.tsx +++ b/gui/src/pages/gui/index.tsx @@ -8,6 +8,8 @@ export default function GUI() {
+ {/* Temporarily commenting out until a near-term release when we can at least add an option for users to disable the tab bar */} + {/* */}
diff --git a/gui/src/redux/slices/configSlice.ts b/gui/src/redux/slices/configSlice.ts index 604f583e4..3b5c55137 100644 --- a/gui/src/redux/slices/configSlice.ts +++ b/gui/src/redux/slices/configSlice.ts @@ -27,6 +27,24 @@ const initialState: ConfigState = { models: [], tools: [], usePlatform: true, + modelsByRole: { + chat: [], + apply: [], + edit: [], + summarize: [], + autocomplete: [], + rerank: [], + embed: [], + }, + selectedModelByRole: { + chat: null, + apply: null, + edit: null, + summarize: null, + autocomplete: null, + rerank: null, + embed: null, + }, }, }; diff --git a/gui/src/redux/slices/sessionSlice.ts b/gui/src/redux/slices/sessionSlice.ts index c70de4035..be4d3aa77 100644 --- a/gui/src/redux/slices/sessionSlice.ts +++ b/gui/src/redux/slices/sessionSlice.ts @@ -328,7 +328,7 @@ export const sessionSlice = createSlice({ !(!lastMessage.toolCalls?.length && !lastMessage.content) && // And there's a difference in tool call presence (lastMessage.toolCalls?.length ?? 0) !== - (message.toolCalls?.length ?? 0)) + (message.toolCalls?.length ?? 0)) ) { // Create a new message const historyItem: ChatHistoryItemWithMessageId = { @@ -473,9 +473,9 @@ export const sessionSlice = createSlice({ state.allSessionMetadata = state.allSessionMetadata.map((session) => session.sessionId === payload.sessionId ? { - ...session, - ...payload, - } + ...session, + ...payload, + } : session, ); if (payload.title && payload.sessionId === state.id) { @@ -510,9 +510,8 @@ export const sessionSlice = createSlice({ payload.rangeInFileWithContents.filepath, ); - const lineNums = `(${ - payload.rangeInFileWithContents.range.start.line + 1 - }-${payload.rangeInFileWithContents.range.end.line + 1})`; + const lineNums = `(${payload.rangeInFileWithContents.range.start.line + 1 + }-${payload.rangeInFileWithContents.range.end.line + 1})`; contextItems.push({ name: `${fileName} ${lineNums}`, @@ -697,9 +696,9 @@ function addPassthroughCases( ) { thunks.forEach((thunk) => { builder - .addCase(thunk.fulfilled, (state, action) => {}) - .addCase(thunk.rejected, (state, action) => {}) - .addCase(thunk.pending, (state, action) => {}); + .addCase(thunk.fulfilled, (state, action) => { }) + .addCase(thunk.rejected, (state, action) => { }) + .addCase(thunk.pending, (state, action) => { }); }); } diff --git a/gui/src/redux/slices/tabsSlice.ts b/gui/src/redux/slices/tabsSlice.ts new file mode 100644 index 000000000..5c68c0b06 --- /dev/null +++ b/gui/src/redux/slices/tabsSlice.ts @@ -0,0 +1,116 @@ +import { PayloadAction, createSlice } from "@reduxjs/toolkit"; + +export interface Tab { + id: string; + title: string; + isActive: boolean; + sessionId?: string; +} + +interface TabsState { + tabs: Tab[]; +} + +const initialState: TabsState = { + tabs: [{ + id: Date.now().toString(36) + Math.random().toString(36).substring(2), + title: "Chat 1", + isActive: true + }] +}; + +export const tabsSlice = createSlice({ + name: "tabs", + initialState, + reducers: { + setTabs: (state, action: PayloadAction) => { + state.tabs = action.payload; + }, + updateTab: (state, action: PayloadAction<{ id: string; updates: Partial }>) => { + const { id, updates } = action.payload; + state.tabs = state.tabs.map(tab => + tab.id === id ? { ...tab, ...updates } : tab + ); + }, + addTab: (state, action: PayloadAction) => { + state.tabs = state.tabs.map(tab => ({ ...tab, isActive: action.payload.isActive ? false : tab.isActive })) + .concat(action.payload); + }, + removeTab: (state, action: PayloadAction) => { + state.tabs = state.tabs.filter(tab => tab.id !== action.payload); + }, + setActiveTab: (state, action: PayloadAction) => { + state.tabs = state.tabs.map(tab => ({ + ...tab, + isActive: tab.id === action.payload + })); + }, + handleSessionChange: ( + state, + action: PayloadAction<{ + currentSessionId: string; + currentSessionTitle: string; + newTabId?: string; + }> + ) => { + const { currentSessionId, currentSessionTitle, newTabId } = action.payload; + + const activeTab = state.tabs.find(tab => tab.isActive); + if (!activeTab) return; + + // Current session matches active tab's session + if (activeTab.sessionId === currentSessionId) { + state.tabs = state.tabs.map(tab => + tab.id === activeTab.id + ? { ...tab, title: currentSessionTitle } + : tab + ); + return; + } + + // Check if there's another tab with the same session ID + const existingTabWithSession = state.tabs.find( + tab => tab.sessionId === currentSessionId + ); + if (existingTabWithSession) { + // Activate the existing tab and update its title + // Remove any unassigned tabs + state.tabs = state.tabs + .filter(tab => tab.sessionId || tab.id === existingTabWithSession.id) + .map(tab => ({ + ...tab, + isActive: tab.id === existingTabWithSession.id, + title: tab.sessionId === currentSessionId + ? currentSessionTitle + : tab.title, + })); + return; + } + + // Active tab has no session ID + if (!activeTab.sessionId) { + state.tabs = state.tabs.map(tab => + tab.id === activeTab.id + ? { + ...tab, + sessionId: currentSessionId, + title: currentSessionTitle, + } + : tab + ); + } else { + // Active tab has a session ID, create new tab + state.tabs = state.tabs.map(tab => ({ ...tab, isActive: false })).concat({ + id: newTabId || Date.now().toString(36) + Math.random().toString(36).substring(2), + title: currentSessionTitle, + isActive: true, + sessionId: currentSessionId, + }); + } + } + } +}); + +export const { setTabs, updateTab, addTab, removeTab, setActiveTab, handleSessionChange } = tabsSlice.actions; + +export default tabsSlice.reducer; \ No newline at end of file diff --git a/gui/src/redux/store.ts b/gui/src/redux/store.ts index f137cbe7b..e77ca3ef9 100644 --- a/gui/src/redux/store.ts +++ b/gui/src/redux/store.ts @@ -15,6 +15,7 @@ import indexingReducer from "./slices/indexingSlice"; import miscReducer from "./slices/miscSlice"; import sessionReducer from "./slices/sessionSlice"; import uiReducer from "./slices/uiSlice"; +import tabsReducer from "./slices/tabsSlice"; export interface ChatMessage { role: "system" | "user" | "assistant"; @@ -28,6 +29,7 @@ const rootReducer = combineReducers({ editModeState: editModeStateReducer, config: configReducer, indexing: indexingReducer, + tabs: tabsReducer, }); const saveSubsetFilters = [ @@ -57,6 +59,7 @@ const saveSubsetFilters = [ createFilter("config", ["defaultModelTitle"]), createFilter("ui", ["toolSettings", "useTools"]), createFilter("indexing", []), + createFilter("tabs", ["tabs"]), ]; const migrations: MigrationManifest = { @@ -71,6 +74,13 @@ const migrations: MigrationManifest = { history: oldState?.state?.history ?? [], id: oldState?.state?.sessionId ?? "", }, + tabs: { + tabs: [{ + id: Date.now().toString(36) + Math.random().toString(36).substring(2), + title: "Chat 1", + isActive: true + }] + }, _persist: oldState?._persist, }; }, diff --git a/gui/src/redux/thunks/profileAndOrg.ts b/gui/src/redux/thunks/profileAndOrg.ts index 6632b77ab..82a9602c0 100644 --- a/gui/src/redux/thunks/profileAndOrg.ts +++ b/gui/src/redux/thunks/profileAndOrg.ts @@ -25,12 +25,6 @@ export const selectProfileThunk = createAsyncThunk< let newId = id; - console.log( - "Running Thunk: ", - initialId, - newId, - state.session.availableProfiles, - ); // If no profiles, force clear if (state.session.availableProfiles.length === 0) { newId = null; @@ -49,12 +43,6 @@ export const selectProfileThunk = createAsyncThunk< } // Only update if there's a change - console.log( - "update selected profile?", - newId, - initialId, - state.session.availableProfiles, - ); if ((newId ?? null) !== (initialId ?? null)) { dispatch( setSelectedProfile( @@ -103,7 +91,6 @@ export const updateProfilesThunk = createAsyncThunk< dispatch(setAvailableProfiles(profiles)); // This will trigger reselection if needed - console.log("selecting 3", selectedProfileId); dispatch(selectProfileThunk(selectedProfileId)); }); diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index fe20fa550..036ef4431 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -61,6 +61,34 @@ export const streamNormalInput = createAsyncThunk< // Attach prompt log if (next.done && next.value) { dispatch(addPromptCompletionPair([next.value])); + + try { + if (state.session.mode === "chat") { + extra.ideMessenger.post("devdata/log", { + name: "chatInteraction", + data: { + prompt: next.value.prompt, + completion: next.value.completion, + modelProvider: defaultModel.provider, + modelTitle: defaultModel.title, + sessionId: state.session.id, + }, + }); + } + // else if (state.session.mode === "edit") { + // extra.ideMessenger.post("devdata/log", { + // name: "editInteraction", + // data: { + // prompt: next.value.prompt, + // completion: next.value.completion, + // modelProvider: defaultModel.provider, + // modelTitle: defaultModel.title, + // }, + // }); + // } + } catch (e) { + console.error("Failed to send dev data interaction log", e); + } } // If it's a tool call that is automatically accepted, we should call it diff --git a/gui/src/redux/thunks/streamResponse.ts b/gui/src/redux/thunks/streamResponse.ts index 16043daee..9c0cb4b9a 100644 --- a/gui/src/redux/thunks/streamResponse.ts +++ b/gui/src/redux/thunks/streamResponse.ts @@ -41,8 +41,8 @@ const getSlashCommandForInput = ( if (lastText.startsWith("/")) { slashCommandName = lastText.split(" ")[0].substring(1); - slashCommand = slashCommands.find( - (command) => command.name === slashCommandName, + slashCommand = slashCommands.find((command) => + lastText.startsWith(`/${command.name} `), ); } if (!slashCommand || !slashCommandName) { diff --git a/gui/src/redux/thunks/streamResponseAfterToolCall.ts b/gui/src/redux/thunks/streamResponseAfterToolCall.ts index 3d41c664f..3eb11b249 100644 --- a/gui/src/redux/thunks/streamResponseAfterToolCall.ts +++ b/gui/src/redux/thunks/streamResponseAfterToolCall.ts @@ -43,7 +43,6 @@ export const streamResponseAfterToolCall = createAsyncThunk< content: renderContextItems(toolOutput), toolCallId, }; - dispatch(streamUpdate([newMessage])); dispatch( addContextItemsAtIndex({ diff --git a/gui/src/redux/thunks/streamSlashCommand.ts b/gui/src/redux/thunks/streamSlashCommand.ts index 79336bb3d..c18afd52c 100644 --- a/gui/src/redux/thunks/streamSlashCommand.ts +++ b/gui/src/redux/thunks/streamSlashCommand.ts @@ -5,6 +5,7 @@ import { RangeInFile, SlashCommandDescription, } from "core"; +import { modelSupportsTools } from "core/llm/autodetect"; import { selectDefaultModel } from "../slices/configSlice"; import { abortStream, streamUpdate } from "../slices/sessionSlice"; import { ThunkApiType } from "../store"; @@ -30,11 +31,18 @@ export const streamSlashCommand = createAsyncThunk< const defaultModel = selectDefaultModel(state); const isStreaming = state.session.isStreaming; const streamAborter = state.session.streamAborter; + const toolSettings = state.ui.toolSettings; if (!defaultModel) { throw new Error("Default model not defined"); } + const useTools = state.ui.useTools; + const includeTools = + useTools && + modelSupportsTools(defaultModel) && + state.session.mode === "chat"; + const modelTitle = defaultModel.title; const checkActiveInterval = setInterval(() => { @@ -55,6 +63,14 @@ export const streamSlashCommand = createAsyncThunk< params: slashCommand.params, historyIndex, selectedCode, + completionOptions: includeTools + ? { + // Temporarily commented out until slash commands are hooked up to the tool use feedback loop + // tools: state.config.config.tools.filter( + // (tool) => toolSettings[tool.function.name] !== "disabled", + // ), + } + : {}, }, streamAborter.signal, )) { diff --git a/gui/src/util/localStorage.ts b/gui/src/util/localStorage.ts index f457e3544..e80e4ceea 100644 --- a/gui/src/util/localStorage.ts +++ b/gui/src/util/localStorage.ts @@ -13,6 +13,8 @@ type LocalStorageTypes = { showTutorialCard: boolean; shownProfilesIntroduction: boolean; disableIndexing: boolean; + /** Indicates whether the user has seen any kind of onboarding card since hub.continue.dev */ + seenHubIntro: boolean; }; export function getLocalStorage( diff --git a/gui/tailwind.config.cjs b/gui/tailwind.config.cjs index 3441bfdee..67677e103 100644 --- a/gui/tailwind.config.cjs +++ b/gui/tailwind.config.cjs @@ -13,6 +13,7 @@ module.exports = { "2xs": "170px", // Smallest width for Primary Sidebar in VS Code xs: "250px", // Avg default sidebar width in VS Code sm: "330px", + int: "380px", md: "460px", lg: "590px", xl: "720px", diff --git a/packages/config-types/package.json b/packages/config-types/package.json index 99df3ce60..5c420223f 100644 --- a/packages/config-types/package.json +++ b/packages/config-types/package.json @@ -15,6 +15,6 @@ "typescript": "^5.5.2" }, "dependencies": { - "zod": "^3.23.8" + "zod": "^3.24.2" } } diff --git a/packages/config-yaml/package-lock.json b/packages/config-yaml/package-lock.json index b62809bc3..ba0912e4e 100644 --- a/packages/config-yaml/package-lock.json +++ b/packages/config-yaml/package-lock.json @@ -1,41 +1,31 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.10", + "version": "1.0.51", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@continuedev/config-yaml", - "version": "1.0.10", + "version": "1.0.51", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", - "zod": "^3.23.8" + "zod": "^3.24.2" }, "devDependencies": { + "@types/jest": "^29.5.14", "cross-env": "^7.0.3", + "jest": "^29.7.0", "ts-jest": "^29.2.3", "ts-node": "^10.9.2" } }, - "../config-types": { - "name": "@continuedev/config-types", - "version": "1.0.14", - "license": "Apache-2.0", - "dependencies": { - "zod": "^3.23.8" - }, - "devDependencies": { - "typescript": "^5.5.2" - } - }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, - "peer": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" @@ -49,7 +39,6 @@ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, - "peer": true, "dependencies": { "@babel/highlight": "^7.24.7", "picocolors": "^1.0.0" @@ -63,7 +52,6 @@ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.0.tgz", "integrity": "sha512-P4fwKI2mjEb3ZU5cnMJzvRsRKGBUcs8jvxIoRmr6ufAY9Xk2Bz7JubRTTivkw55c7WQJfTECeqYVa+HZ0FzREg==", "dev": true, - "peer": true, "engines": { "node": ">=6.9.0" } @@ -73,7 +61,6 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.9.tgz", "integrity": "sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==", "dev": true, - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.24.7", @@ -104,7 +91,6 @@ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", "integrity": "sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==", "dev": true, - "peer": true, "dependencies": { "@babel/types": "^7.25.0", "@jridgewell/gen-mapping": "^0.3.5", @@ -120,7 +106,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.8.tgz", "integrity": "sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw==", "dev": true, - "peer": true, "dependencies": { "@babel/compat-data": "^7.24.8", "@babel/helper-validator-option": "^7.24.8", @@ -137,7 +122,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", "dev": true, - "peer": true, "dependencies": { "@babel/traverse": "^7.24.7", "@babel/types": "^7.24.7" @@ -151,7 +135,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.0.tgz", "integrity": "sha512-bIkOa2ZJYn7FHnepzr5iX9Kmz8FjIz4UKzJ9zhX3dnYuVW0xul9RuR3skBfoLu+FPTQw90EHW9rJsSZhyLQ3fQ==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-module-imports": "^7.24.7", "@babel/helper-simple-access": "^7.24.7", @@ -170,7 +153,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", "dev": true, - "peer": true, "engines": { "node": ">=6.9.0" } @@ -180,7 +162,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", "dev": true, - "peer": true, "dependencies": { "@babel/traverse": "^7.24.7", "@babel/types": "^7.24.7" @@ -194,7 +175,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", "dev": true, - "peer": true, "engines": { "node": ">=6.9.0" } @@ -204,7 +184,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "dev": true, - "peer": true, "engines": { "node": ">=6.9.0" } @@ -214,7 +193,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", "dev": true, - "peer": true, "engines": { "node": ">=6.9.0" } @@ -224,7 +202,6 @@ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.0.tgz", "integrity": "sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==", "dev": true, - "peer": true, "dependencies": { "@babel/template": "^7.25.0", "@babel/types": "^7.25.0" @@ -238,7 +215,6 @@ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-validator-identifier": "^7.24.7", "chalk": "^2.4.2", @@ -254,7 +230,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "peer": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -267,7 +242,6 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, - "peer": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -282,7 +256,6 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, - "peer": true, "dependencies": { "color-name": "1.1.3" } @@ -291,15 +264,13 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, - "peer": true, "engines": { "node": ">=0.8.0" } @@ -309,7 +280,6 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, - "peer": true, "engines": { "node": ">=4" } @@ -319,7 +289,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, - "peer": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -332,7 +301,6 @@ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.0.tgz", "integrity": "sha512-CzdIU9jdP0dg7HdyB+bHvDJGagUv+qtzZt5rYCWwW6tITNqV9odjp6Qu41gkG0ca5UfdDUWrKkiAnHHdGRnOrA==", "dev": true, - "peer": true, "bin": { "parser": "bin/babel-parser.js" }, @@ -345,7 +313,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -358,7 +325,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -371,7 +337,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.12.13" }, @@ -384,7 +349,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -397,7 +361,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -410,7 +373,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz", "integrity": "sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.24.7" }, @@ -426,7 +388,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -439,7 +400,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -452,7 +412,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -465,7 +424,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -478,7 +436,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -491,7 +448,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -504,7 +460,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -520,7 +475,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.7.tgz", "integrity": "sha512-c/+fVeJBB0FeKsFvwytYiUD+LBvhHjGSI0g446PRGdSVGZLRNArBUno2PETbAly3tpiNAQR5XaZ+JslxkotsbA==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.24.7" }, @@ -536,7 +490,6 @@ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", "dev": true, - "peer": true, "dependencies": { "@babel/code-frame": "^7.24.7", "@babel/parser": "^7.25.0", @@ -551,7 +504,6 @@ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.0.tgz", "integrity": "sha512-ubALThHQy4GCf6mbb+5ZRNmLLCI7bJ3f8Q6LHBSRlSKSWj5a7dSUzJBLv3VuIhFrFPgjF4IzPF567YG/HSCdZA==", "dev": true, - "peer": true, "dependencies": { "@babel/code-frame": "^7.24.7", "@babel/generator": "^7.25.0", @@ -570,7 +522,6 @@ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.0.tgz", "integrity": "sha512-LcnxQSsd9aXOIgmmSpvZ/1yo46ra2ESYyqLcryaBZOghxy5qqOBjvCWP5JfkI8yl9rlxRgdLTTMCQQRcN2hdCg==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-string-parser": "^7.24.8", "@babel/helper-validator-identifier": "^7.24.7", @@ -584,12 +535,15 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/@continuedev/config-types": { - "resolved": "../config-types", - "link": true + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.14.tgz", + "integrity": "sha512-PVHyHPyRXd2QsaNgnCpiKYU3uHFTlyuQSkqE8OwrBmQqO6/TXUVIr/2EGtyIZGrml4Y+rGMSH40WU4/0t4SGpQ==", + "dependencies": { + "zod": "^3.23.8" + } }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", @@ -618,7 +572,6 @@ "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, - "peer": true, "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", @@ -635,7 +588,6 @@ "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -645,7 +597,6 @@ "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -663,7 +614,6 @@ "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, - "peer": true, "dependencies": { "@jest/console": "^29.7.0", "@jest/reporters": "^29.7.0", @@ -711,7 +661,6 @@ "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, - "peer": true, "dependencies": { "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", @@ -727,7 +676,6 @@ "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, - "peer": true, "dependencies": { "expect": "^29.7.0", "jest-snapshot": "^29.7.0" @@ -741,7 +689,6 @@ "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, - "peer": true, "dependencies": { "jest-get-type": "^29.6.3" }, @@ -754,7 +701,6 @@ "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", @@ -772,7 +718,6 @@ "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, - "peer": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/expect": "^29.7.0", @@ -788,7 +733,6 @@ "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, - "peer": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", "@jest/console": "^29.7.0", @@ -844,7 +788,6 @@ "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, - "peer": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", @@ -859,7 +802,6 @@ "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, - "peer": true, "dependencies": { "@jest/console": "^29.7.0", "@jest/types": "^29.6.3", @@ -875,7 +817,6 @@ "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, - "peer": true, "dependencies": { "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", @@ -891,7 +832,6 @@ "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, - "peer": true, "dependencies": { "@babel/core": "^7.11.6", "@jest/types": "^29.6.3", @@ -935,7 +875,6 @@ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, - "peer": true, "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -959,7 +898,6 @@ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, - "peer": true, "engines": { "node": ">=6.0.0" } @@ -975,7 +913,6 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, - "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -992,7 +929,6 @@ "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, - "peer": true, "dependencies": { "type-detect": "4.0.8" } @@ -1002,7 +938,6 @@ "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, - "peer": true, "dependencies": { "@sinonjs/commons": "^3.0.0" } @@ -1036,7 +971,6 @@ "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, - "peer": true, "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", @@ -1050,7 +984,6 @@ "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, - "peer": true, "dependencies": { "@babel/types": "^7.0.0" } @@ -1060,7 +993,6 @@ "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, - "peer": true, "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" @@ -1071,7 +1003,6 @@ "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", "dev": true, - "peer": true, "dependencies": { "@babel/types": "^7.20.7" } @@ -1081,7 +1012,6 @@ "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, - "peer": true, "dependencies": { "@types/node": "*" } @@ -1110,6 +1040,16 @@ "@types/istanbul-lib-report": "*" } }, + "node_modules/@types/jest": { + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "node_modules/@types/node": { "version": "18.19.39", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.39.tgz", @@ -1123,8 +1063,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/@types/yargs": { "version": "17.0.32", @@ -1170,7 +1109,6 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, - "peer": true, "dependencies": { "type-fest": "^0.21.3" }, @@ -1186,7 +1124,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -1211,7 +1148,6 @@ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, - "peer": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -1231,7 +1167,6 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, - "peer": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -1247,7 +1182,6 @@ "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, - "peer": true, "dependencies": { "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", @@ -1269,7 +1203,6 @@ "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@istanbuljs/load-nyc-config": "^1.0.0", @@ -1286,7 +1219,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, - "peer": true, "dependencies": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", @@ -1303,7 +1235,6 @@ "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, - "peer": true, "dependencies": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", @@ -1319,7 +1250,6 @@ "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", "dev": true, - "peer": true, "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", @@ -1343,7 +1273,6 @@ "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, - "peer": true, "dependencies": { "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" @@ -1376,7 +1305,6 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, - "peer": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -1403,7 +1331,6 @@ "url": "https://github.com/sponsors/ai" } ], - "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001640", "electron-to-chromium": "^1.4.820", @@ -1434,7 +1361,6 @@ "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", "dev": true, - "peer": true, "dependencies": { "node-int64": "^0.4.0" } @@ -1443,15 +1369,13 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -1461,7 +1385,6 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -1484,8 +1407,7 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ], - "peer": true + ] }, "node_modules/chalk": { "version": "4.1.2", @@ -1508,7 +1430,6 @@ "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true, - "peer": true, "engines": { "node": ">=10" } @@ -1532,15 +1453,13 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz", "integrity": "sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==", - "dev": true, - "peer": true + "dev": true }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, - "peer": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -1555,7 +1474,6 @@ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true, - "peer": true, "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -1565,8 +1483,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", - "dev": true, - "peer": true + "dev": true }, "node_modules/color-convert": { "version": "2.0.1", @@ -1596,15 +1513,13 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/create-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", "dev": true, - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", @@ -1664,7 +1579,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", "dev": true, - "peer": true, "dependencies": { "ms": "2.1.2" }, @@ -1681,15 +1595,13 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true, - "peer": true + "dev": true }, "node_modules/dedent": { "version": "1.5.3", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz", "integrity": "sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==", "dev": true, - "peer": true, "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, @@ -1704,7 +1616,6 @@ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -1714,7 +1625,6 @@ "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -1733,7 +1643,6 @@ "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, - "peer": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -1757,15 +1666,13 @@ "version": "1.5.2", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.2.tgz", "integrity": "sha512-kc4r3U3V3WLaaZqThjYz/Y6z8tJe+7K0bbjUVo3i+LWIypVdMx5nXCkwRe6SWbY6ILqLdc1rKcKmr3HoH7wjSQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/emittery": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, - "peer": true, "engines": { "node": ">=12" }, @@ -1777,15 +1684,13 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "peer": true + "dev": true }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, - "peer": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -1795,7 +1700,6 @@ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -1805,7 +1709,6 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -1815,7 +1718,6 @@ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, - "peer": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -1829,7 +1731,6 @@ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, - "peer": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -1853,7 +1754,6 @@ "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", "dev": true, - "peer": true, "engines": { "node": ">= 0.8.0" } @@ -1863,7 +1763,6 @@ "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, - "peer": true, "dependencies": { "@jest/expect-utils": "^29.7.0", "jest-get-type": "^29.6.3", @@ -1886,7 +1785,6 @@ "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, - "peer": true, "dependencies": { "bser": "2.1.1" } @@ -1926,7 +1824,6 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, - "peer": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1939,7 +1836,6 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, - "peer": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -1952,8 +1848,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/fsevents": { "version": "2.3.3", @@ -1965,7 +1860,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } @@ -1975,7 +1869,6 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1985,7 +1878,6 @@ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, - "peer": true, "engines": { "node": ">=6.9.0" } @@ -1995,7 +1887,6 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, - "peer": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -2005,7 +1896,6 @@ "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, - "peer": true, "engines": { "node": ">=8.0.0" } @@ -2015,7 +1905,6 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, - "peer": true, "engines": { "node": ">=10" }, @@ -2029,7 +1918,6 @@ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, - "peer": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2050,7 +1938,6 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, - "peer": true, "engines": { "node": ">=4" } @@ -2075,7 +1962,6 @@ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, - "peer": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -2087,15 +1973,13 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, - "peer": true, "engines": { "node": ">=10.17.0" } @@ -2105,7 +1989,6 @@ "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", "dev": true, - "peer": true, "dependencies": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" @@ -2125,7 +2008,6 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, - "peer": true, "engines": { "node": ">=0.8.19" } @@ -2136,7 +2018,6 @@ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, - "peer": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -2146,22 +2027,19 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/is-core-module": { "version": "2.15.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", "dev": true, - "peer": true, "dependencies": { "hasown": "^2.0.2" }, @@ -2177,7 +2055,6 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -2187,7 +2064,6 @@ "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -2197,7 +2073,6 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, - "peer": true, "engines": { "node": ">=0.12.0" } @@ -2207,7 +2082,6 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "peer": true, "engines": { "node": ">=8" }, @@ -2226,7 +2100,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -2236,7 +2109,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", "dev": true, - "peer": true, "dependencies": { "@babel/core": "^7.23.9", "@babel/parser": "^7.23.9", @@ -2253,7 +2125,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "peer": true, "bin": { "semver": "bin/semver.js" }, @@ -2266,7 +2137,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, - "peer": true, "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", @@ -2281,7 +2151,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, - "peer": true, "dependencies": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", @@ -2296,7 +2165,6 @@ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, - "peer": true, "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -2328,7 +2196,6 @@ "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, - "peer": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -2355,7 +2222,6 @@ "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, - "peer": true, "dependencies": { "execa": "^5.0.0", "jest-util": "^29.7.0", @@ -2370,7 +2236,6 @@ "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, - "peer": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/expect": "^29.7.0", @@ -2402,7 +2267,6 @@ "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, - "peer": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/test-result": "^29.7.0", @@ -2436,7 +2300,6 @@ "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, - "peer": true, "dependencies": { "@babel/core": "^7.11.6", "@jest/test-sequencer": "^29.7.0", @@ -2482,7 +2345,6 @@ "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, - "peer": true, "dependencies": { "chalk": "^4.0.0", "diff-sequences": "^29.6.3", @@ -2498,7 +2360,6 @@ "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, - "peer": true, "dependencies": { "detect-newline": "^3.0.0" }, @@ -2511,7 +2372,6 @@ "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", @@ -2528,7 +2388,6 @@ "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, - "peer": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", @@ -2546,7 +2405,6 @@ "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, - "peer": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -2556,7 +2414,6 @@ "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", @@ -2582,7 +2439,6 @@ "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, - "peer": true, "dependencies": { "jest-get-type": "^29.6.3", "pretty-format": "^29.7.0" @@ -2596,7 +2452,6 @@ "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, - "peer": true, "dependencies": { "chalk": "^4.0.0", "jest-diff": "^29.7.0", @@ -2612,7 +2467,6 @@ "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, - "peer": true, "dependencies": { "@babel/code-frame": "^7.12.13", "@jest/types": "^29.6.3", @@ -2633,7 +2487,6 @@ "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -2648,7 +2501,6 @@ "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, - "peer": true, "engines": { "node": ">=6" }, @@ -2666,7 +2518,6 @@ "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, - "peer": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -2676,7 +2527,6 @@ "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, - "peer": true, "dependencies": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", @@ -2697,7 +2547,6 @@ "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, - "peer": true, "dependencies": { "jest-regex-util": "^29.6.3", "jest-snapshot": "^29.7.0" @@ -2711,7 +2560,6 @@ "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, - "peer": true, "dependencies": { "@jest/console": "^29.7.0", "@jest/environment": "^29.7.0", @@ -2744,7 +2592,6 @@ "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", "dev": true, - "peer": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", @@ -2778,7 +2625,6 @@ "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, - "peer": true, "dependencies": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", @@ -2810,7 +2656,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "peer": true, "bin": { "semver": "bin/semver.js" }, @@ -2840,7 +2685,6 @@ "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "camelcase": "^6.2.0", @@ -2858,7 +2702,6 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, - "peer": true, "engines": { "node": ">=10" }, @@ -2871,7 +2714,6 @@ "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, - "peer": true, "dependencies": { "@jest/test-result": "^29.7.0", "@jest/types": "^29.6.3", @@ -2891,7 +2733,6 @@ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, - "peer": true, "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", @@ -2907,7 +2748,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, - "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -2922,15 +2762,13 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, - "peer": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -2944,7 +2782,6 @@ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true, - "peer": true, "bin": { "jsesc": "bin/jsesc" }, @@ -2956,8 +2793,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true, - "peer": true + "dev": true }, "node_modules/json5": { "version": "2.2.3", @@ -2976,7 +2812,6 @@ "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -2986,7 +2821,6 @@ "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -2995,15 +2829,13 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, - "peer": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -3022,7 +2854,6 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, - "peer": true, "dependencies": { "yallist": "^3.0.2" } @@ -3032,7 +2863,6 @@ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, - "peer": true, "dependencies": { "semver": "^7.5.3" }, @@ -3048,7 +2878,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "peer": true, "bin": { "semver": "bin/semver.js" }, @@ -3067,7 +2896,6 @@ "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", "dev": true, - "peer": true, "dependencies": { "tmpl": "1.0.5" } @@ -3076,15 +2904,13 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true, - "peer": true + "dev": true }, "node_modules/micromatch": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dev": true, - "peer": true, "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -3098,7 +2924,6 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -3119,29 +2944,25 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/node-releases": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", - "dev": true, - "peer": true + "dev": true }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -3151,7 +2972,6 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, - "peer": true, "dependencies": { "path-key": "^3.0.0" }, @@ -3164,7 +2984,6 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, - "peer": true, "dependencies": { "wrappy": "1" } @@ -3174,7 +2993,6 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, - "peer": true, "dependencies": { "mimic-fn": "^2.1.0" }, @@ -3190,7 +3008,6 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, - "peer": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -3206,7 +3023,6 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, - "peer": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -3219,7 +3035,6 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, - "peer": true, "dependencies": { "p-try": "^2.0.0" }, @@ -3235,7 +3050,6 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -3245,7 +3059,6 @@ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, - "peer": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -3264,7 +3077,6 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -3274,7 +3086,6 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -3292,15 +3103,13 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/picocolors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", - "dev": true, - "peer": true + "dev": true }, "node_modules/picomatch": { "version": "2.3.1", @@ -3319,7 +3128,6 @@ "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true, - "peer": true, "engines": { "node": ">= 6" } @@ -3329,7 +3137,6 @@ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, - "peer": true, "dependencies": { "find-up": "^4.0.0" }, @@ -3342,7 +3149,6 @@ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, - "peer": true, "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -3357,7 +3163,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, - "peer": true, "engines": { "node": ">=10" }, @@ -3370,7 +3175,6 @@ "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dev": true, - "peer": true, "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" @@ -3393,22 +3197,19 @@ "type": "opencollective", "url": "https://opencollective.com/fast-check" } - ], - "peer": true + ] }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -3418,7 +3219,6 @@ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, - "peer": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -3436,7 +3236,6 @@ "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, - "peer": true, "dependencies": { "resolve-from": "^5.0.0" }, @@ -3449,7 +3248,6 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -3459,7 +3257,6 @@ "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true, - "peer": true, "engines": { "node": ">=10" } @@ -3469,7 +3266,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "peer": true, "bin": { "semver": "bin/semver.js" } @@ -3499,22 +3295,19 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -3524,7 +3317,6 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -3534,7 +3326,6 @@ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, - "peer": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -3544,15 +3335,13 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "peer": true + "dev": true }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", "dev": true, - "peer": true, "dependencies": { "escape-string-regexp": "^2.0.0" }, @@ -3565,7 +3354,6 @@ "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", "dev": true, - "peer": true, "dependencies": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" @@ -3579,7 +3367,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "peer": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -3594,7 +3381,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -3607,7 +3393,6 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -3617,7 +3402,6 @@ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -3627,7 +3411,6 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, - "peer": true, "engines": { "node": ">=8" }, @@ -3652,7 +3435,6 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, - "peer": true, "engines": { "node": ">= 0.4" }, @@ -3665,7 +3447,6 @@ "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, - "peer": true, "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", @@ -3679,15 +3460,13 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true, - "peer": true, "engines": { "node": ">=4" } @@ -3697,7 +3476,6 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, - "peer": true, "dependencies": { "is-number": "^7.0.0" }, @@ -3813,7 +3591,6 @@ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, - "peer": true, "engines": { "node": ">=4" } @@ -3823,7 +3600,6 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, - "peer": true, "engines": { "node": ">=10" }, @@ -3870,7 +3646,6 @@ "url": "https://github.com/sponsors/ai" } ], - "peer": true, "dependencies": { "escalade": "^3.1.2", "picocolors": "^1.0.1" @@ -3893,7 +3668,6 @@ "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, - "peer": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", @@ -3908,7 +3682,6 @@ "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "dev": true, - "peer": true, "dependencies": { "makeerror": "1.0.12" } @@ -3933,7 +3706,6 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, - "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -3950,15 +3722,13 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/write-file-atomic": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, - "peer": true, "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" @@ -3972,7 +3742,6 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, - "peer": true, "engines": { "node": ">=10" } @@ -3981,8 +3750,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "peer": true + "dev": true }, "node_modules/yaml": { "version": "2.6.1", @@ -4000,7 +3768,6 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, - "peer": true, "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -4037,7 +3804,6 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, - "peer": true, "engines": { "node": ">=10" }, @@ -4046,9 +3812,9 @@ } }, "node_modules/zod": { - "version": "3.23.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", - "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "version": "3.24.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", + "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==", "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/packages/config-yaml/package.json b/packages/config-yaml/package.json index b6de2b8a1..9433fbc30 100644 --- a/packages/config-yaml/package.json +++ b/packages/config-yaml/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.35", + "version": "1.0.52", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -12,12 +12,14 @@ "author": "Continue Dev, Inc.", "license": "Apache-2.0", "dependencies": { + "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", - "zod": "^3.23.8", - "@continuedev/config-types": "^1.0.14" + "zod": "^3.24.2" }, "devDependencies": { + "@types/jest": "^29.5.14", "cross-env": "^7.0.3", + "jest": "^29.7.0", "ts-jest": "^29.2.3", "ts-node": "^10.9.2" } diff --git a/packages/config-yaml/src/index.ts b/packages/config-yaml/src/index.ts index 51f9287c0..b64db7497 100644 --- a/packages/config-yaml/src/index.ts +++ b/packages/config-yaml/src/index.ts @@ -7,6 +7,7 @@ export * from "./load/getBlockType.js"; export * from "./load/merge.js"; export * from "./load/proxySecretResolution.js"; export * from "./load/unroll.js"; +export * from "./schemas/data/index.js"; export * from "./schemas/index.js"; -export type { ModelConfig, ModelRole } from "./schemas/models.js"; +export * from "./schemas/models.js"; export * from "./validation.js"; diff --git a/packages/config-yaml/src/interfaces/SecretResult.ts b/packages/config-yaml/src/interfaces/SecretResult.ts index 0c34eae68..5c626c3d0 100644 --- a/packages/config-yaml/src/interfaces/SecretResult.ts +++ b/packages/config-yaml/src/interfaces/SecretResult.ts @@ -29,11 +29,13 @@ export interface UserSecretLocation { export interface ModelsAddOnSecretLocation { secretType: SecretType.ModelsAddOn; + blockSlug: PackageSlug; secretName: string; } export interface FreeTrialSecretLocation { secretType: SecretType.FreeTrial; + blockSlug: PackageSlug; secretName: string; } @@ -66,9 +68,9 @@ export function encodeSecretLocation(secretLocation: SecretLocation): string { } else if (secretLocation.secretType === SecretType.NotFound) { return `${SecretType.NotFound}:${secretLocation.secretName}`; } else if (secretLocation.secretType === SecretType.ModelsAddOn) { - return `${SecretType.ModelsAddOn}:${secretLocation.secretName}`; + return `${SecretType.ModelsAddOn}:${encodePackageSlug(secretLocation.blockSlug)}/${secretLocation.secretName}`; } else if (secretLocation.secretType === SecretType.FreeTrial) { - return `${SecretType.FreeTrial}:${secretLocation.secretName}`; + return `${SecretType.FreeTrial}:${encodePackageSlug(secretLocation.blockSlug)}/${secretLocation.secretName}`; } else { throw new Error(`Invalid secret type: ${secretLocation}`); } @@ -107,11 +109,19 @@ export function decodeSecretLocation(secretLocation: string): SecretLocation { return { secretType: SecretType.ModelsAddOn, secretName, + blockSlug: { + ownerSlug: parts[0], + packageSlug: parts[1], + }, }; case SecretType.FreeTrial: return { secretType: SecretType.FreeTrial, secretName, + blockSlug: { + ownerSlug: parts[0], + packageSlug: parts[1], + }, }; default: throw new Error(`Invalid secret type: ${secretType}`); diff --git a/packages/config-yaml/src/interfaces/index.ts b/packages/config-yaml/src/interfaces/index.ts index d57dbf587..20d33db0b 100644 --- a/packages/config-yaml/src/interfaces/index.ts +++ b/packages/config-yaml/src/interfaces/index.ts @@ -34,14 +34,15 @@ export function getLocationsToLook( secretName: string, ): SecretLocation[] { const locationsToLook: SecretLocation[] = [ - // Models Add-On - { - secretType: SecretType.ModelsAddOn as const, - secretName, - }, - // Block ...(blockSlug ? [ + // Models Add-On + { + secretType: SecretType.ModelsAddOn as const, + secretName, + blockSlug, + }, + // Block { secretType: SecretType.Package as const, packageSlug: blockSlug, @@ -67,11 +68,16 @@ export function getLocationsToLook( userSlug: currentUserSlug, secretName, }, - // Free Trial - { - secretType: SecretType.FreeTrial as const, - secretName, - }, + // Free Trial (must be using a eligible block) + ...(blockSlug + ? [ + { + secretType: SecretType.FreeTrial as const, + secretName, + blockSlug, + }, + ] + : []), ]; return locationsToLook; } diff --git a/packages/config-yaml/src/load/clientRender.ts b/packages/config-yaml/src/load/clientRender.ts index e5cc38fd0..585fc24ee 100644 --- a/packages/config-yaml/src/load/clientRender.ts +++ b/packages/config-yaml/src/load/clientRender.ts @@ -1,3 +1,4 @@ +import { z } from "zod"; import { PlatformClient, SecretStore } from "../interfaces/index.js"; import { decodeSecretLocation, @@ -17,10 +18,12 @@ import { parseAssistantUnrolled, } from "./unroll.js"; -export async function clientRender( +export async function renderSecrets( packageSlug: PackageSlug, unrolledConfigContent: string, clientSecretStore: SecretStore, + orgScopeId: string | null, // The "scope" that the user is logged in with + onPremProxyUrl: string | null, platformClient?: PlatformClient, ): Promise { // 1. First we need to get a list of all the FQSNs that are required to render the config @@ -67,7 +70,12 @@ export async function clientRender( const parsedYaml = parseAssistantUnrolled(renderedYaml); // 7. We update any of the items with the proxy version if there are un-rendered secrets - const finalConfig = useProxyForUnrenderedSecrets(parsedYaml, packageSlug); + const finalConfig = useProxyForUnrenderedSecrets( + parsedYaml, + packageSlug, + orgScopeId, + onPremProxyUrl, + ); return finalConfig; } @@ -103,9 +111,11 @@ function getContinueProxyModelName( return `${packageSlug.ownerSlug}/${packageSlug.packageSlug}/${provider}/${model}`; } -function useProxyForUnrenderedSecrets( +export function useProxyForUnrenderedSecrets( config: AssistantUnrolled, packageSlug: PackageSlug, + orgScopeId: string | null, + onPremProxyUrl: string | null, ): AssistantUnrolled { if (config.models) { for (let i = 0; i < config.models.length; i++) { @@ -122,6 +132,8 @@ function useProxyForUnrenderedSecrets( config.models[i].model, ), apiKeyLocation: encodeSecretLocation(apiKeyLocation), + orgScopeId, + onPremProxyUrl, apiKey: undefined, }; } @@ -130,3 +142,12 @@ function useProxyForUnrenderedSecrets( return config; } + +/** The additional properties that are added to the otherwise OpenAI-compatible body when requesting a Continue proxy */ +export const continuePropertiesSchema = z.object({ + apiKeyLocation: z.string().optional(), + apiBase: z.string().optional(), + orgScopeId: z.string().nullable(), +}); + +export type ContinueProperties = z.infer; diff --git a/packages/config-yaml/src/load/unroll.ts b/packages/config-yaml/src/load/unroll.ts index 12a808b8b..40bdcb2c8 100644 --- a/packages/config-yaml/src/load/unroll.ts +++ b/packages/config-yaml/src/load/unroll.ts @@ -1,8 +1,12 @@ import * as YAML from "yaml"; -import { Registry } from "../interfaces/index.js"; +import { PlatformClient, Registry } from "../interfaces/index.js"; +import { encodeSecretLocation } from "../interfaces/SecretResult.js"; import { + decodeFQSN, decodeFullSlug, + encodeFQSN, encodePackageSlug, + FQSN, FullSlug, PackageSlug, } from "../interfaces/slugs.js"; @@ -14,6 +18,7 @@ import { ConfigYaml, configYamlSchema, } from "../schemas/index.js"; +import { useProxyForUnrenderedSecrets } from "./clientRender.js"; export function parseConfigYaml(configYaml: string): ConfigYaml { try { @@ -32,7 +37,9 @@ export function parseAssistantUnrolled(configYaml: string): AssistantUnrolled { const result = assistantUnrolledSchema.parse(parsed); return result; } catch (e: any) { - throw new Error(`Failed to parse unrolled assistant: ${e.message}`); + throw new Error( + `Failed to parse unrolled assistant: ${e.message}\n\n${configYaml}`, + ); } } @@ -123,54 +130,139 @@ function extractFQSNMap( return secretToFQSNMap(secrets, parentPackages); } +/** + * All template vars are already FQSNs, here we just resolve them to either locations or values + */ +async function extractRenderedSecretsMap( + rawContent: string, + platformClient: PlatformClient, +): Promise> { + // Get all template variables + const templateVars = getTemplateVariables(rawContent); + const secrets = templateVars + .filter((v) => v.startsWith("secrets.")) + .map((v) => v.replace("secrets.", "")); + + const fqsns: FQSN[] = secrets.map(decodeFQSN); + + // FQSN -> SecretResult + const secretResults = await platformClient.resolveFQSNs(fqsns); + + const map: Record = {}; + for (const secretResult of secretResults) { + if (!secretResult) { + continue; + } + + // User secrets are rendered + if ("value" in secretResult) { + map[encodeFQSN(secretResult.fqsn)] = secretResult.value; + } else { + // Other secrets are rendered as secret locations and then converted to proxy types later + map[encodeFQSN(secretResult.fqsn)] = + `\${{ secrets.${encodeSecretLocation(secretResult.secretLocation)} }}`; + } + } + + return map; +} + +export interface DoNotRenderSecretsUnrollAssistantOptions { + renderSecrets: false; +} + +export interface RenderSecretsUnrollAssistantOptions { + renderSecrets: true; + orgScopeId: string | null; + currentUserSlug: string; + platformClient: PlatformClient; + onPremProxyUrl: string | null; +} + +export type UnrollAssistantOptions = + | DoNotRenderSecretsUnrollAssistantOptions + | RenderSecretsUnrollAssistantOptions; + export async function unrollAssistant( fullSlug: string, registry: Registry, + options: UnrollAssistantOptions, ): Promise { const assistantSlug = decodeFullSlug(fullSlug); // Request the content from the registry const rawContent = await registry.getContent(assistantSlug); - return unrollAssistantFromContent(assistantSlug, rawContent, registry); + return unrollAssistantFromContent( + assistantSlug, + rawContent, + registry, + options, + ); +} + +function renderTemplateData( + rawYaml: string, + templateData: Partial, +): string { + const fullTemplateData: TemplateData = { + inputs: {}, + secrets: {}, + continue: {}, + ...templateData, + }; + const templatedYaml = fillTemplateVariables( + rawYaml, + flattenTemplateData(fullTemplateData), + ); + return templatedYaml; } export async function unrollAssistantFromContent( assistantSlug: FullSlug, rawYaml: string, registry: Registry, + options: UnrollAssistantOptions, ): Promise { - // Convert the raw YAML to unrolled config - const templateData: TemplateData = { - // no inputs to an assistant - inputs: {}, - // at this stage, secrets are mapped to a (still templated) FQSN - secrets: extractFQSNMap(rawYaml, [assistantSlug]), - // Built-in variables - continue: {}, - }; - - // Render the template - const templatedYaml = fillTemplateVariables( - rawYaml, - flattenTemplateData(templateData), - ); - // Parse string to Zod-validated YAML - let parsedYaml = parseConfigYaml(templatedYaml); + let parsedYaml = parseConfigYaml(rawYaml); - // Unroll blocks - const unrolledAssistant = await unrollBlocks( - parsedYaml, - assistantSlug, - registry, + // Unroll blocks and convert their secrets to FQSNs + const unrolledAssistant = await unrollBlocks(parsedYaml, registry); + + // Back to a string so we can fill in template variables + const rawUnrolledYaml = YAML.stringify(unrolledAssistant); + + // Convert all of the template variables to FQSNs + // Secrets from the block will have the assistant slug prepended to the FQSN + const templatedYaml = renderTemplateData(rawUnrolledYaml, { + secrets: extractFQSNMap(rawUnrolledYaml, [assistantSlug]), + }); + + if (!options.renderSecrets) { + return parseAssistantUnrolled(templatedYaml); + } + + // Render secret values/locations for client + const secrets = await extractRenderedSecretsMap( + templatedYaml, + options.platformClient, ); + const renderedYaml = renderTemplateData(templatedYaml, { + secrets, + }); - return unrolledAssistant; + // Parse again and replace models with proxy versions where secrets weren't rendered + const finalConfig = useProxyForUnrenderedSecrets( + parseAssistantUnrolled(renderedYaml), + assistantSlug, + options.orgScopeId, + options.onPremProxyUrl, + ); + return finalConfig; } export async function unrollBlocks( assistant: ConfigYaml, - assistantFullSlug: FullSlug, registry: Registry, ): Promise { const unrolledAssistant: AssistantUnrolled = { @@ -178,7 +270,10 @@ export async function unrollBlocks( version: assistant.version, }; - const sections: (keyof Omit)[] = [ + const sections: (keyof Omit< + ConfigYaml, + "name" | "version" | "rules" | "schema" + >)[] = [ "models", "context", "data", @@ -199,7 +294,6 @@ export async function unrollBlocks( const blockConfigYaml = await resolveBlock( decodeFullSlug(unrolledBlock.uses), unrolledBlock.with, - assistantFullSlug, registry, ); const block = blockConfigYaml[section]?.[0]; @@ -228,7 +322,6 @@ export async function unrollBlocks( const blockConfigYaml = await resolveBlock( decodeFullSlug(rule.uses), rule.with, - assistantFullSlug, registry, ); const block = blockConfigYaml.rules?.[0]; @@ -247,27 +340,37 @@ export async function unrollBlocks( export async function resolveBlock( fullSlug: FullSlug, inputs: Record | undefined, - parentFullSlug: FullSlug, registry: Registry, ): Promise { // Retrieve block raw yaml const rawYaml = await registry.getContent(fullSlug); + // Convert any input secrets to FQSNs (they get FQSNs as if they are in the block. This is so that we know when to use models add-on / free trial secrets) + const renderedInputs = inputsToFQSNs(inputs || {}, fullSlug); + // Render template variables - const templateData: TemplateData = { - inputs, - secrets: extractFQSNMap(rawYaml, [parentFullSlug, fullSlug]), - continue: {}, - }; - const templatedYaml = fillTemplateVariables( - rawYaml, - flattenTemplateData(templateData), - ); + const templatedYaml = renderTemplateData(rawYaml, { + inputs: renderedInputs, + secrets: extractFQSNMap(rawYaml, [fullSlug]), + }); const parsedYaml = parseBlock(templatedYaml); return parsedYaml; } +function inputsToFQSNs( + inputs: Record, + blockSlug: PackageSlug, +): Record { + const renderedInputs: Record = {}; + for (const [key, value] of Object.entries(inputs)) { + renderedInputs[key] = renderTemplateData(value, { + secrets: extractFQSNMap(value, [blockSlug]), + }); + } + return renderedInputs; +} + export function mergeOverrides>( block: T, overrides: Partial, diff --git a/packages/config-yaml/src/schemas/data/autocomplete/index.ts b/packages/config-yaml/src/schemas/data/autocomplete/index.ts new file mode 100644 index 000000000..8ae073e2e --- /dev/null +++ b/packages/config-yaml/src/schemas/data/autocomplete/index.ts @@ -0,0 +1,42 @@ +import { z } from "zod"; +import { completionOptionsSchema } from "../../models.js"; +import { baseDevDataAllSchema } from "../base.js"; + +export const autocompleteEventAllSchema = baseDevDataAllSchema.extend({ + // Tab autocomplete options - TODO - old json version? + disable: z.boolean(), + useFileSuffix: z.boolean(), + maxPromptTokens: z.number(), + debounceDelay: z.number(), + maxSuffixPercentage: z.number(), + prefixPercentage: z.number(), + transform: z.boolean().optional(), + template: z.string().optional(), + multilineCompletions: z.enum(["always", "never", "auto"]), + slidingWindowPrefixPercentage: z.number(), + slidingWindowSize: z.number(), + useCache: z.boolean(), + onlyMyCode: z.boolean(), + useRecentlyEdited: z.boolean(), + useImports: z.boolean().optional(), + + // Other + accepted: z.boolean().optional(), + time: z.number(), + prefix: z.string(), + suffix: z.string(), + prompt: z.string(), + completion: z.string(), + modelProvider: z.string(), + modelName: z.string(), + cacheHit: z.boolean(), + filepath: z.string(), + gitRepo: z.string().optional(), + completionId: z.string(), + uniqueId: z.string(), + timestamp: z.number(), + + // DEPRECATED - no more nested objects after v0.1.0, all flat values + completionOptions: completionOptionsSchema.optional(), + disableInFiles: z.array(z.string()).optional(), +}); diff --git a/packages/config-yaml/src/schemas/data/autocomplete/v0.1.0.ts b/packages/config-yaml/src/schemas/data/autocomplete/v0.1.0.ts new file mode 100644 index 000000000..e21efdea2 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/autocomplete/v0.1.0.ts @@ -0,0 +1,43 @@ +import { autocompleteEventAllSchema } from "./index.js"; + +export const autocompleteEventSchema_0_1_0 = autocompleteEventAllSchema.pick({ + disable: true, + useFileSuffix: true, + maxPromptTokens: true, + debounceDelay: true, + maxSuffixPercentage: true, + prefixPercentage: true, + transform: true, + template: true, + multilineCompletions: true, + slidingWindowPrefixPercentage: true, + slidingWindowSize: true, + useCache: true, + onlyMyCode: true, + useRecentlyEdited: true, + disableInFiles: true, + useImports: true, + accepted: true, + time: true, + prefix: true, + suffix: true, + prompt: true, + completion: true, + modelProvider: true, + modelName: true, + completionOptions: true, + cacheHit: true, + filepath: true, + gitRepo: true, + completionId: true, + uniqueId: true, + timestamp: true, +}); + +export const autocompleteEventSchema_0_1_0_noCode = + autocompleteEventSchema_0_1_0.omit({ + prefix: true, + suffix: true, + prompt: true, + completion: true, + }); diff --git a/packages/config-yaml/src/schemas/data/autocomplete/v0.2.0.ts b/packages/config-yaml/src/schemas/data/autocomplete/v0.2.0.ts new file mode 100644 index 000000000..5866b9865 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/autocomplete/v0.2.0.ts @@ -0,0 +1,50 @@ +import { autocompleteEventAllSchema } from "./index.js"; + +export const autocompleteEventSchema_0_2_0 = autocompleteEventAllSchema.pick({ + // base + timestamp: true, + userId: true, + userAgent: true, + selectedProfileId: true, + eventName: true, + schema: true, + + // autocomplete-specific + disable: true, + maxPromptTokens: true, + debounceDelay: true, + maxSuffixPercentage: true, + prefixPercentage: true, + transform: true, + template: true, + multilineCompletions: true, + slidingWindowPrefixPercentage: true, + slidingWindowSize: true, + useCache: true, + onlyMyCode: true, + useRecentlyEdited: true, + useImports: true, + accepted: true, + time: true, + prefix: true, + suffix: true, + prompt: true, + completion: true, + modelProvider: true, + modelName: true, + cacheHit: true, + filepath: true, + gitRepo: true, + completionId: true, + uniqueId: true, + + // Note objects (completionOptions and disableInfiles) removed from 0.1.0 => 0.2.0 +}); + +export const autocompleteEventSchema_0_2_0_noCode = + autocompleteEventSchema_0_2_0.omit({ + prefix: true, + suffix: true, + prompt: true, + completion: true, + }); diff --git a/packages/config-yaml/src/schemas/data/base.ts b/packages/config-yaml/src/schemas/data/base.ts new file mode 100644 index 000000000..2b2edf894 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/base.ts @@ -0,0 +1,11 @@ +import { z } from "zod"; + +export const baseDevDataAllSchema = z.object({ + eventName: z.string(), + schema: z.string(), + timestamp: z.string().datetime(), + userId: z.string(), + userAgent: z.string(), + selectedProfileId: z.string(), + // gitCommitHash: z.string(), +}); diff --git a/packages/config-yaml/src/schemas/data/chatFeedback/index.ts b/packages/config-yaml/src/schemas/data/chatFeedback/index.ts new file mode 100644 index 000000000..095b0af82 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/chatFeedback/index.ts @@ -0,0 +1,11 @@ +import { z } from "zod"; +import { baseDevDataAllSchema } from "../base.js"; + +export const chatFeedbackEventAllSchema = baseDevDataAllSchema.extend({ + modelTitle: z.string(), + completionOptions: z.object({}), + prompt: z.string(), + completion: z.string(), + feedback: z.boolean().optional(), + sessionId: z.string().uuid(), +}); diff --git a/packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts b/packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts new file mode 100644 index 000000000..c4acddd40 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts @@ -0,0 +1,16 @@ +import { chatFeedbackEventAllSchema } from "./index.js"; + +export const chatFeedbackEventSchema_0_1_0 = chatFeedbackEventAllSchema.pick({ + modelTitle: true, + completionOptions: true, + prompt: true, + completion: true, + feedback: true, + sessionId: true, +}); + +export const chatFeedbackEventSchema_0_1_0_noCode = + chatFeedbackEventSchema_0_1_0.omit({ + prompt: true, + completion: true, + }); diff --git a/packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts b/packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts new file mode 100644 index 000000000..fe0580dc5 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts @@ -0,0 +1,24 @@ +import { chatFeedbackEventAllSchema } from "./index.js"; + +export const chatFeedbackEventSchema_0_2_0 = chatFeedbackEventAllSchema.pick({ + // base + timestamp: true, + userId: true, + userAgent: true, + selectedProfileId: true, + eventName: true, + schema: true, + + // other + prompt: true, + completion: true, + modelTitle: true, + feedback: true, + sessionId: true, +}); + +export const chatFeedbackEventSchema_0_2_0_noCode = + chatFeedbackEventSchema_0_2_0.omit({ + prompt: true, + completion: true, + }); diff --git a/packages/config-yaml/src/schemas/data/chatInteraction/index.ts b/packages/config-yaml/src/schemas/data/chatInteraction/index.ts new file mode 100644 index 000000000..fd10fa72c --- /dev/null +++ b/packages/config-yaml/src/schemas/data/chatInteraction/index.ts @@ -0,0 +1,10 @@ +import { z } from "zod"; +import { baseDevDataAllSchema } from "../base.js"; + +export const chatInteractionEventAllSchema = baseDevDataAllSchema.extend({ + modelProvider: z.string(), + modelTitle: z.string(), + prompt: z.string(), + completion: z.string(), + sessionId: z.string(), +}); diff --git a/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts b/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts new file mode 100644 index 000000000..206791c22 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts @@ -0,0 +1,25 @@ +import { chatInteractionEventAllSchema } from "./index.js"; + +export const chatInteractionEventSchema_0_2_0 = + chatInteractionEventAllSchema.pick({ + // base + timestamp: true, + userId: true, + userAgent: true, + selectedProfileId: true, + eventName: true, + schema: true, + + // other + prompt: true, + completion: true, + modelTitle: true, + modelProvider: true, + sessionId: true, + }); + +export const chatInteractionEventSchema_0_2_0_noCode = + chatInteractionEventSchema_0_2_0.omit({ + prompt: true, + completion: true, + }); diff --git a/packages/config-yaml/src/schemas/data/editInteraction/index.ts b/packages/config-yaml/src/schemas/data/editInteraction/index.ts new file mode 100644 index 000000000..92edc1c06 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/editInteraction/index.ts @@ -0,0 +1,9 @@ +import { z } from "zod"; +import { baseDevDataAllSchema } from "../base.js"; + +export const editInteractionEventAllSchema = baseDevDataAllSchema.extend({ + modelProvider: z.string(), + modelTitle: z.string(), + prompt: z.string(), + completion: z.string(), +}); diff --git a/packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts b/packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts new file mode 100644 index 000000000..c95e163c9 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts @@ -0,0 +1,24 @@ +import { editInteractionEventAllSchema } from "./index.js"; + +export const editInteractionEventSchema_0_2_0 = + editInteractionEventAllSchema.pick({ + // base + timestamp: true, + userId: true, + userAgent: true, + selectedProfileId: true, + eventName: true, + schema: true, + + // other + prompt: true, + completion: true, + modelTitle: true, + modelProvider: true, + }); + +export const editInteractionEventSchema_0_2_0_noCode = + editInteractionEventSchema_0_2_0.omit({ + prompt: true, + completion: true, + }); diff --git a/packages/config-yaml/src/schemas/data/editOutcome/index.ts b/packages/config-yaml/src/schemas/data/editOutcome/index.ts new file mode 100644 index 000000000..ec902364c --- /dev/null +++ b/packages/config-yaml/src/schemas/data/editOutcome/index.ts @@ -0,0 +1,15 @@ +import { z } from "zod"; +import { baseDevDataAllSchema } from "../base.js"; + +export const editOutcomeEventAllSchema = baseDevDataAllSchema.extend({ + modelProvider: z.string(), + modelTitle: z.string(), + prompt: z.string(), + completion: z.string(), + previousCode: z.string(), + newCode: z.string(), + previousCodeLines: z.number(), + newCodeLines: z.number(), + lineChange: z.number(), + accepted: z.boolean(), +}); diff --git a/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts b/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts new file mode 100644 index 000000000..88d867fbd --- /dev/null +++ b/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts @@ -0,0 +1,24 @@ +import { editOutcomeEventAllSchema } from "./index.js"; + +export const editOutcomeEventSchema_0_2_0 = editOutcomeEventAllSchema.pick({ + // base + timestamp: true, + userId: true, + userAgent: true, + selectedProfileId: true, + eventName: true, + schema: true, + + // other + prompt: true, + completion: true, + modelTitle: true, + modelProvider: true, + accepted: true, +}); + +export const editOutcomeEventSchema_0_2_0_noCode = + editOutcomeEventSchema_0_2_0.omit({ + prompt: true, + completion: true, + }); diff --git a/packages/config-yaml/src/schemas/data/index.ts b/packages/config-yaml/src/schemas/data/index.ts new file mode 100644 index 000000000..d1155f389 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/index.ts @@ -0,0 +1,127 @@ +import { z } from "zod"; +import { requestOptionsSchema } from "../models.js"; +import { autocompleteEventAllSchema } from "./autocomplete/index.js"; +import { + autocompleteEventSchema_0_1_0, + autocompleteEventSchema_0_1_0_noCode, +} from "./autocomplete/v0.1.0.js"; +import { + autocompleteEventSchema_0_2_0, + autocompleteEventSchema_0_2_0_noCode, +} from "./autocomplete/v0.2.0.js"; +import { chatFeedbackEventAllSchema } from "./chatFeedback/index.js"; +import { + chatFeedbackEventSchema_0_1_0, + chatFeedbackEventSchema_0_1_0_noCode, +} from "./chatFeedback/v0.1.0.js"; +import { + chatFeedbackEventSchema_0_2_0, + chatFeedbackEventSchema_0_2_0_noCode, +} from "./chatFeedback/v0.2.0.js"; +import { chatInteractionEventAllSchema } from "./chatInteraction/index.js"; +import { + chatInteractionEventSchema_0_2_0, + chatInteractionEventSchema_0_2_0_noCode, +} from "./chatInteraction/v0.2.0.js"; +import { quickEditEventAllSchema } from "./quickEdit/index.js"; +import { + quickEditEventSchema_0_1_0, + quickEditEventSchema_0_1_0_noCode, +} from "./quickEdit/v0.1.0.js"; +import { tokensGeneratedEventAllSchema } from "./tokensGenerated/index.js"; +import { + tokensGeneratedEventSchema_0_1_0, + tokensGeneratedEventSchema_0_1_0_noCode, +} from "./tokensGenerated/v0.1.0.js"; +import { + tokensGeneratedEventSchema_0_2_0, + tokensGeneratedEventSchema_0_2_0_noCode, +} from "./tokensGenerated/v0.2.0.js"; + +const semverRegex = + /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/; + +const dataLevel = z.union([z.literal("all"), z.literal("noCode")]); + +export const dataSchema = z.object({ + name: z.string(), + destination: z.string(), + schema: z.string().regex(semverRegex, { + message: "Version must follow semver format, e.g. 0.2.0", + }), + level: dataLevel.optional(), + events: z.array(z.string()).optional(), // Could do literals e.g. "autocomplete", "chat" but want to allow some flexibility later + requestOptions: requestOptionsSchema.optional(), + apiKey: z.string().optional(), +}); + +export type DataDestination = z.infer; +export type DataLogLevel = z.infer; + +// Schemas for data that the log function should have +// In order to build event bodies for ALL versions of an event +const devEventAllVersionDataSchemas = z.object({ + autocomplete: autocompleteEventAllSchema, + quickEdit: quickEditEventAllSchema, + chatFeedback: chatFeedbackEventAllSchema, + tokensGenerated: tokensGeneratedEventAllSchema, + chatInteraction: chatInteractionEventAllSchema, + // editInteraction: editInteractionEventAllSchema, +}); + +// Version and level specific schemas are organized here +export const devDataVersionedSchemas = { + ["0.1.0" as string]: { + all: { + autocomplete: autocompleteEventSchema_0_1_0, + quickEdit: quickEditEventSchema_0_1_0, + chatFeedback: chatFeedbackEventSchema_0_1_0, + tokensGenerated: tokensGeneratedEventSchema_0_1_0, + }, + noCode: { + autocomplete: autocompleteEventSchema_0_1_0_noCode, + quickEdit: quickEditEventSchema_0_1_0_noCode, + chatFeedback: chatFeedbackEventSchema_0_1_0_noCode, + tokensGenerated: tokensGeneratedEventSchema_0_1_0_noCode, + }, + }, + ["0.2.0" as string]: { + all: { + autocomplete: autocompleteEventSchema_0_2_0, + chatFeedback: chatFeedbackEventSchema_0_2_0, + tokensGenerated: tokensGeneratedEventSchema_0_2_0, + chatInteraction: chatInteractionEventSchema_0_2_0, + // editInteraction: editInteractionEventSchema_0_2_0, + }, + noCode: { + autocomplete: autocompleteEventSchema_0_2_0_noCode, + chatFeedback: chatFeedbackEventSchema_0_2_0_noCode, + tokensGenerated: tokensGeneratedEventSchema_0_2_0_noCode, + chatInteraction: chatInteractionEventSchema_0_2_0_noCode, + // editInteraction: editInteractionEventSchema_0_2_0_noCode, + }, + }, +}; + +type DevEventDataSchemas = z.infer; +export type DevEventName = keyof DevEventDataSchemas; +type DevEventAllVersionsSchema = DevEventDataSchemas[T]; + +export type DevDataLogEvent = { + [K in DevEventName]: { + name: K; + data: Omit< + DevEventAllVersionsSchema, + | "eventName" + | "schema" + | "timestamp" + | "userId" + | "userAgent" + | "selectedProfileId" + >; + }; +}[DevEventName]; + +export const allDevEventNames = Object.keys( + devEventAllVersionDataSchemas.shape, +) as DevEventName[]; diff --git a/packages/config-yaml/src/schemas/data/quickEdit/index.ts b/packages/config-yaml/src/schemas/data/quickEdit/index.ts new file mode 100644 index 000000000..e6d7f4bc4 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/quickEdit/index.ts @@ -0,0 +1,16 @@ +import { z } from "zod"; + +export const quickEditEventAllSchema = z.object({ + prompt: z.string(), + path: z.string().optional(), + label: z.string(), + diffs: z + .array( + z.object({ + type: z.enum(["new", "old", "same"]), + line: z.string(), + }), + ) + .optional(), + model: z.string().optional(), +}); diff --git a/packages/config-yaml/src/schemas/data/quickEdit/v0.1.0.ts b/packages/config-yaml/src/schemas/data/quickEdit/v0.1.0.ts new file mode 100644 index 000000000..e89ace721 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/quickEdit/v0.1.0.ts @@ -0,0 +1,16 @@ +import { quickEditEventAllSchema } from "./index.js"; + +export const quickEditEventSchema_0_1_0 = quickEditEventAllSchema.pick({ + prompt: true, + path: true, + label: true, + diffs: true, + model: true, +}); + +export const quickEditEventSchema_0_1_0_noCode = + quickEditEventSchema_0_1_0.omit({ + prompt: true, + path: true, + diffs: true, + }); diff --git a/packages/config-yaml/src/schemas/data/tokensGenerated/index.ts b/packages/config-yaml/src/schemas/data/tokensGenerated/index.ts new file mode 100644 index 000000000..24b3288cb --- /dev/null +++ b/packages/config-yaml/src/schemas/data/tokensGenerated/index.ts @@ -0,0 +1,9 @@ +import { z } from "zod"; +import { baseDevDataAllSchema } from "../base.js"; + +export const tokensGeneratedEventAllSchema = baseDevDataAllSchema.extend({ + model: z.string(), + provider: z.string(), + promptTokens: z.number(), + generatedTokens: z.number(), +}); diff --git a/packages/config-yaml/src/schemas/data/tokensGenerated/v0.1.0.ts b/packages/config-yaml/src/schemas/data/tokensGenerated/v0.1.0.ts new file mode 100644 index 000000000..c908a9f77 --- /dev/null +++ b/packages/config-yaml/src/schemas/data/tokensGenerated/v0.1.0.ts @@ -0,0 +1,12 @@ +import { tokensGeneratedEventAllSchema } from "./index.js"; + +export const tokensGeneratedEventSchema_0_1_0 = + tokensGeneratedEventAllSchema.pick({ + model: true, + provider: true, + promptTokens: true, + generatedTokens: true, + }); + +export const tokensGeneratedEventSchema_0_1_0_noCode = + tokensGeneratedEventSchema_0_1_0; diff --git a/packages/config-yaml/src/schemas/data/tokensGenerated/v0.2.0.ts b/packages/config-yaml/src/schemas/data/tokensGenerated/v0.2.0.ts new file mode 100644 index 000000000..4a8f7d14a --- /dev/null +++ b/packages/config-yaml/src/schemas/data/tokensGenerated/v0.2.0.ts @@ -0,0 +1,21 @@ +import { tokensGeneratedEventAllSchema } from "./index.js"; + +export const tokensGeneratedEventSchema_0_2_0 = + tokensGeneratedEventAllSchema.pick({ + // base + timestamp: true, + userId: true, + userAgent: true, + selectedProfileId: true, + eventName: true, + schema: true, + + // tokens generated specific + model: true, + provider: true, + promptTokens: true, + generatedTokens: true, + }); + +export const tokensGeneratedEventSchema_0_2_0_noCode = + tokensGeneratedEventSchema_0_2_0; diff --git a/packages/config-yaml/src/schemas/index.ts b/packages/config-yaml/src/schemas/index.ts index c456b4ab3..d6cb2299b 100644 --- a/packages/config-yaml/src/schemas/index.ts +++ b/packages/config-yaml/src/schemas/index.ts @@ -1,11 +1,7 @@ import * as z from "zod"; +import { dataSchema } from "./data/index.js"; import { modelSchema, partialModelSchema } from "./models.js"; -export const dataSchema = z.object({ - destination: z.string(), - levels: z.string().optional(), -}); - export const contextSchema = z.object({ provider: z.string(), params: z.any().optional(), @@ -49,9 +45,13 @@ export const blockItemWrapperSchema = (schema: T) => export const blockOrSchema = (schema: T) => z.union([schema, blockItemWrapperSchema(schema)]); -export const configYamlSchema = z.object({ +export const baseConfigYamlSchema = z.object({ name: z.string(), version: z.string(), + schema: z.string().optional(), +}); + +export const configYamlSchema = baseConfigYamlSchema.extend({ models: z .array( z.union([ @@ -85,9 +85,7 @@ export const configYamlSchema = z.object({ export type ConfigYaml = z.infer; -export const assistantUnrolledSchema = z.object({ - name: z.string(), - version: z.string(), +export const assistantUnrolledSchema = baseConfigYamlSchema.extend({ models: z.array(modelSchema).optional(), context: z.array(contextSchema).optional(), data: z.array(dataSchema).optional(), @@ -100,22 +98,17 @@ export const assistantUnrolledSchema = z.object({ export type AssistantUnrolled = z.infer; -export const blockSchema = z - .object({ - name: z.string(), - version: z.string(), - }) - .and( - z.union([ - z.object({ models: z.array(modelSchema).length(1) }), - z.object({ context: z.array(contextSchema).length(1) }), - z.object({ data: z.array(dataSchema).length(1) }), - z.object({ tools: z.array(toolSchema).length(1) }), - z.object({ mcpServers: z.array(mcpServerSchema).length(1) }), - z.object({ rules: z.array(z.string()).length(1) }), - z.object({ prompts: z.array(promptSchema).length(1) }), - z.object({ docs: z.array(docSchema).length(1) }), - ]), - ); +export const blockSchema = baseConfigYamlSchema.and( + z.union([ + z.object({ models: z.array(modelSchema).length(1) }), + z.object({ context: z.array(contextSchema).length(1) }), + z.object({ data: z.array(dataSchema).length(1) }), + z.object({ tools: z.array(toolSchema).length(1) }), + z.object({ mcpServers: z.array(mcpServerSchema).length(1) }), + z.object({ rules: z.array(z.string()).length(1) }), + z.object({ prompts: z.array(promptSchema).length(1) }), + z.object({ docs: z.array(docSchema).length(1) }), + ]), +); export type Block = z.infer; diff --git a/packages/config-yaml/src/schemas/models.ts b/packages/config-yaml/src/schemas/models.ts index 05df2c1ad..1fd6247a6 100644 --- a/packages/config-yaml/src/schemas/models.ts +++ b/packages/config-yaml/src/schemas/models.ts @@ -42,6 +42,12 @@ export const completionOptionsSchema = z.object({ }); export type CompletionOptions = z.infer; +export const embedOptionsSchema = z.object({ + maxChunkSize: z.number().optional(), + maxBatchSize: z.number().optional(), +}); +export type EmbedOptions = z.infer; + /** Prompt templates use Handlebars syntax */ const promptTemplatesSchema = z.object({ apply: z.string().optional(), @@ -57,7 +63,11 @@ const baseModelFields = { roles: modelRolesSchema.array().optional(), defaultCompletionOptions: completionOptionsSchema.optional(), requestOptions: requestOptionsSchema.optional(), + embedOptions: embedOptionsSchema.optional(), promptTemplates: promptTemplatesSchema.optional(), + env: z + .record(z.string(), z.union([z.string(), z.boolean(), z.number()])) + .optional(), }; export const modelSchema = z.union([ @@ -65,6 +75,8 @@ export const modelSchema = z.union([ ...baseModelFields, provider: z.literal("continue-proxy"), apiKeyLocation: z.string(), + orgScopeId: z.string().nullable(), + onPremProxyUrl: z.string().nullable(), }), z.object({ ...baseModelFields, diff --git a/packages/config-yaml/test/index.test.ts b/packages/config-yaml/test/index.test.ts index d634d6092..16a531fac 100644 --- a/packages/config-yaml/test/index.test.ts +++ b/packages/config-yaml/test/index.test.ts @@ -1,12 +1,6 @@ import * as fs from "fs"; -import * as YAML from "yaml"; +import { decodeSecretLocation, resolveSecretLocationInProxy } from "../dist"; import { - decodeSecretLocation, - encodeSecretLocation, - resolveSecretLocationInProxy, -} from "../dist"; -import { - clientRender, FQSN, FullSlug, PlatformClient, @@ -19,7 +13,6 @@ import { SecretType, unrollAssistant, } from "../src"; -import exp = require("constants"); // Test e2e flows from raw yaml -> unroll -> client render -> resolve secrets on proxy describe("E2E Scenarios", () => { @@ -27,9 +20,8 @@ describe("E2E Scenarios", () => { OPENAI_API_KEY: "sk-123", }; - const packageSecrets: Record = { - "test-org/assistant/ANTHROPIC_API_KEY": "sk-ant", - "test-org/gemini/GEMINI_API_KEY": "gemini-api-key", + const orgSecrets: Record = { + GEMINI_API_KEY: "gemini-api-key", }; const proxyEnvSecrets: Record = { @@ -71,14 +63,27 @@ describe("E2E Scenarios", () => { getSecretFromSecretLocation: async function ( secretLocation: SecretLocation, ): Promise { - if (secretLocation.secretType === SecretType.Package) { - return packageSecrets[ - encodeSecretLocation(secretLocation).split(":")[1] - ]; - } else if (secretLocation.secretType === SecretType.User) { - return userSecrets[secretLocation.secretName]; - } else { - return undefined; + switch (secretLocation.secretType) { + case SecretType.Package: + return undefined; + case SecretType.User: + return userSecrets[secretLocation.secretName]; + case SecretType.Organization: + return orgSecrets[secretLocation.secretName]; + case SecretType.ModelsAddOn: + case SecretType.FreeTrial: + if ( + secretLocation.blockSlug.ownerSlug === "test-org" && + secretLocation.blockSlug.packageSlug === "claude35sonnet" && + secretLocation.secretName === "ANTHROPIC_API_KEY" + ) { + return "sk-ant"; + } + return undefined; + case SecretType.NotFound: + return undefined; + default: + return undefined; } }, }; @@ -97,18 +102,34 @@ describe("E2E Scenarios", () => { const unrolledConfig = await unrollAssistant( "test-org/assistant", registry, + { + renderSecrets: true, + platformClient, + orgScopeId: "test-org", + currentUserSlug: "test-user", + onPremProxyUrl: null, + }, ); // Test that packages were correctly unrolled and params replaced expect(unrolledConfig.models?.length).toBe(3); - expect(unrolledConfig.models?.[0].apiKey).toBe( - "${{ secrets.test-org/assistant/OPENAI_API_KEY }}", - ); - expect(unrolledConfig.models?.[1].apiKey).toBe( - "${{ secrets.test-org/assistant/test-org/gemini/GEMINI_API_KEY }}", - ); - expect(unrolledConfig.models?.[2].apiKey).toBe( - "${{ secrets.test-org/assistant/ANTHROPIC_API_KEY }}", + + const openAiModel = unrolledConfig.models?.[0]!; + expect(openAiModel.apiKey).toBe("sk-123"); + + const geminiModel = unrolledConfig.models?.[1]!; + expect(geminiModel.provider).toBe("continue-proxy"); + expect(geminiModel.apiKey).toBeUndefined(); + const geminiSecretLocation = "organization:test-org/GEMINI_API_KEY"; + expect((geminiModel as any).apiKeyLocation).toBe(geminiSecretLocation); + + const anthropicModel = unrolledConfig.models?.[2]!; + expect(anthropicModel.provider).toBe("continue-proxy"); + expect(anthropicModel.apiKey).toBeUndefined(); + const anthropicSecretLocation = + "models_add_on:test-org/claude35sonnet/ANTHROPIC_API_KEY"; + expect((anthropicModel as any).apiKeyLocation).toBe( + anthropicSecretLocation, ); expect(unrolledConfig.rules?.length).toBe(2); @@ -119,29 +140,6 @@ describe("E2E Scenarios", () => { "https://docs.python.org/release/3.13.1", ); - const clientRendered = await clientRender( - { ownerSlug: "test-org", packageSlug: "assistant" }, - YAML.stringify(unrolledConfig), - localUserSecretStore, - platformClient, - ); - - // Test that user secrets were injected and others were changed to use proxy - const anthropicSecretLocation = - "package:test-org/assistant/ANTHROPIC_API_KEY"; - const geminiSecretLocation = "package:test-org/gemini/GEMINI_API_KEY"; - expect(clientRendered.models?.[0].apiKey).toBe("sk-123"); - expect(clientRendered.models?.[1].provider).toBe("continue-proxy"); - expect((clientRendered.models?.[1] as any).apiKeyLocation).toBe( - geminiSecretLocation, - ); - expect(clientRendered.models?.[1].apiKey).toBeUndefined(); - expect(clientRendered.models?.[2].provider).toBe("continue-proxy"); - expect((clientRendered.models?.[2] as any).apiKeyLocation).toBe( - anthropicSecretLocation, - ); - expect(clientRendered.models?.[2].apiKey).toBeUndefined(); - // Test that proxy can correctly resolve secrets const decodedAnthropicSecretLocation = decodeSecretLocation( anthropicSecretLocation, diff --git a/packages/openai-adapters/package.json b/packages/openai-adapters/package.json index afc7a3211..b2d293852 100644 --- a/packages/openai-adapters/package.json +++ b/packages/openai-adapters/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/openai-adapters", - "version": "1.0.14", + "version": "1.0.15", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -14,12 +14,12 @@ "dependencies": { "@azure/openai": "^1.0.0-beta.12", "@continuedev/config-types": "^1.0.5", - "@continuedev/config-yaml": "^1.0.31", + "@continuedev/config-yaml": "^1.0.51", "@continuedev/fetch": "^1.0.3", "json-schema": "^0.4.0", "node-fetch": "^3.3.2", "openai": "^4.76.0", - "zod": "^3.23.8" + "zod": "^3.24.2" }, "devDependencies": { "@types/follow-redirects": "^1.14.4", diff --git a/packages/openai-adapters/src/apis/Mock.ts b/packages/openai-adapters/src/apis/Mock.ts new file mode 100644 index 000000000..01553b815 --- /dev/null +++ b/packages/openai-adapters/src/apis/Mock.ts @@ -0,0 +1,157 @@ +import { OpenAI } from "openai/index"; +import { + ChatCompletion, + ChatCompletionChunk, + ChatCompletionCreateParamsNonStreaming, + ChatCompletionCreateParamsStreaming, + Completion, + CompletionCreateParamsNonStreaming, + CompletionCreateParamsStreaming, + Model, +} from "openai/resources/index"; +import { chatChunk, chatCompletion } from "../util.js"; +import { + BaseLlmApi, + CreateRerankResponse, + FimCreateParamsStreaming, + RerankCreateParams, +} from "./base.js"; + +const MOCK_RESPONSE = + "This is a mock response from the OpenAI API. It can be returned all at once or streamed chunk by chunk."; + +export class MockApi implements BaseLlmApi { + async chatCompletionNonStream( + body: ChatCompletionCreateParamsNonStreaming, + signal: AbortSignal, + ): Promise { + await new Promise((resolve) => setTimeout(resolve, 800)); + const lastMessage = body.messages[body.messages.length - 1].content; + const content = !lastMessage + ? MOCK_RESPONSE + : typeof lastMessage === "string" + ? lastMessage + : lastMessage[0].type === "text" + ? lastMessage[0].text + : MOCK_RESPONSE; + return chatCompletion({ + content, + model: body.model, + }); + } + + async *chatCompletionStream( + body: ChatCompletionCreateParamsStreaming, + signal: AbortSignal, + ): AsyncGenerator { + const lastMessage = body.messages[body.messages.length - 1].content; + const content = !lastMessage + ? MOCK_RESPONSE + : typeof lastMessage === "string" + ? lastMessage + : lastMessage[0].type === "text" + ? lastMessage[0].text + : MOCK_RESPONSE; + const chunks = content.split(" "); + for (const chunk of chunks) { + await new Promise((resolve) => setTimeout(resolve, 100)); + yield chatChunk({ + content: chunk + " ", + model: body.model, + }); + } + } + + async completionNonStream( + body: CompletionCreateParamsNonStreaming, + signal: AbortSignal, + ): Promise { + await new Promise((resolve) => setTimeout(resolve, 800)); + return { + id: "mock-completion", + object: "text_completion", + created: Date.now(), + model: body.model, + choices: [ + { + text: body.prompt as string, + index: 0, + finish_reason: "stop", + }, + ], + } as Completion; + } + + async *completionStream( + body: CompletionCreateParamsStreaming, + signal: AbortSignal, + ): AsyncGenerator { + const chunks = (body.prompt as string).split(" "); + for (const chunk of chunks) { + await new Promise((resolve) => setTimeout(resolve, 100)); + yield { + id: "mock-chunk", + object: "text_completion", + created: Date.now(), + model: body.model, + choices: [ + { + text: chunk + " ", + index: 0, + finish_reason: "stop", + }, + ], + } as Completion; + } + } + + async *fimStream( + body: FimCreateParamsStreaming, + signal: AbortSignal, + ): AsyncGenerator { + const chunks = (body.prompt as string).split(" "); + for (const chunk of chunks) { + await new Promise((resolve) => setTimeout(resolve, 100)); + yield chatChunk({ + content: chunk + " ", + model: body.model, + }); + } + } + + async embed( + body: OpenAI.Embeddings.EmbeddingCreateParams, + ): Promise { + await new Promise((resolve) => setTimeout(resolve, 400)); + return { + data: [ + { + embedding: new Array(1536).fill(0), + index: 0, + object: "embedding", + }, + ], + model: body.model, + object: "list", + usage: { + prompt_tokens: 0, + total_tokens: 0, + }, + }; + } + + async rerank(body: RerankCreateParams): Promise { + throw new Error("Method not implemented."); + } + + async list(): Promise { + return [ + { + id: "mock-model", + created: Date.now(), + object: "model", + owned_by: "mock", + }, + ]; + } +} diff --git a/packages/openai-adapters/src/index.ts b/packages/openai-adapters/src/index.ts index 094920e63..e3ac2cadd 100644 --- a/packages/openai-adapters/src/index.ts +++ b/packages/openai-adapters/src/index.ts @@ -7,6 +7,7 @@ import { CohereApi } from "./apis/Cohere.js"; import { DeepSeekApi } from "./apis/DeepSeek.js"; import { GeminiApi } from "./apis/Gemini.js"; import { JinaApi } from "./apis/Jina.js"; +import { MockApi } from "./apis/Mock.js"; import { MoonshotApi } from "./apis/Moonshot.js"; import { OpenAIApi } from "./apis/OpenAI.js"; import { LLMConfig, OpenAIConfigSchema } from "./types.js"; @@ -73,6 +74,8 @@ export function constructLlmApi(config: LLMConfig): BaseLlmApi | undefined { return openAICompatible("https://api.fireworks.ai/inference/v1/", config); case "together": return openAICompatible("https://api.together.xyz/v1/", config); + case "ncompass": + return openAICompatible("https://api.ncompass.tech/v1", config); case "novita": return openAICompatible("https://api.novita.ai/v3/openai", config); case "nebius": @@ -84,6 +87,8 @@ export function constructLlmApi(config: LLMConfig): BaseLlmApi | undefined { return openAICompatible("http://localhost:8000/", config); case "lmstudio": return openAICompatible("http://localhost:1234/", config); + case "mock": + return new MockApi(); default: return undefined; } diff --git a/packages/openai-adapters/src/types.ts b/packages/openai-adapters/src/types.ts index c86d63abf..a174174b1 100644 --- a/packages/openai-adapters/src/types.ts +++ b/packages/openai-adapters/src/types.ts @@ -69,6 +69,11 @@ export const DeepseekConfigSchema = OpenAIConfigSchema.extend({ }); export type DeepseekConfig = z.infer; +export const MockConfigSchema = BasePlusConfig.extend({ + provider: z.literal("mock"), +}); +export type MockConfig = z.infer; + // Other APIs export const CohereConfigSchema = OpenAIConfigSchema.extend({ provider: z.literal("cohere"), @@ -107,5 +112,6 @@ export const LLMConfigSchema = z.discriminatedUnion("provider", [ GeminiConfigSchema, AnthropicConfigSchema, JinaConfigSchema, + MockConfigSchema, ]); export type LLMConfig = z.infer;