Merge branch 'main' into autocomplete_context_fix
This commit is contained in:
commit
92d441b83e
157 changed files with 2205 additions and 1703 deletions
16
.github/workflows/jetbrains-release.yaml
vendored
16
.github/workflows/jetbrains-release.yaml
vendored
|
|
@ -6,11 +6,11 @@ name: JetBrains Release
|
|||
|
||||
on:
|
||||
release:
|
||||
types: [ prereleased ]
|
||||
types: [prereleased]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
publish_build:
|
||||
description: 'Whether or not to publish the built extension to the JetBrains marketplace'
|
||||
description: "Whether or not to publish the built extension to the JetBrains marketplace"
|
||||
required: true
|
||||
default: false
|
||||
|
||||
|
|
@ -241,6 +241,12 @@ jobs:
|
|||
name: continue-binary-win32-x64
|
||||
path: ./binary/bin/win32-x64/
|
||||
|
||||
- name: Upload artifact (win32-arm64)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: continue-binary-win32-arm64
|
||||
path: ./binary/bin/win32-arm64/
|
||||
|
||||
- name: Upload artifact (linux-arm64)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
|
@ -345,7 +351,7 @@ jobs:
|
|||
# Run tests and upload a code coverage report
|
||||
test:
|
||||
name: Test
|
||||
needs: [ build ]
|
||||
needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Check out current repository
|
||||
|
|
@ -387,7 +393,7 @@ jobs:
|
|||
inspectCode:
|
||||
if: false
|
||||
name: Inspect code
|
||||
needs: [ build ]
|
||||
needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
|
@ -422,7 +428,7 @@ jobs:
|
|||
verify:
|
||||
if: false
|
||||
name: Verify plugin
|
||||
needs: [ build ]
|
||||
needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Free GitHub Actions Environment Disk Space
|
||||
|
|
|
|||
2
.github/workflows/main.yaml
vendored
2
.github/workflows/main.yaml
vendored
|
|
@ -208,7 +208,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
if: github.event.inputs.publish_build == 'true'
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.publish_build == 'true'
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
|
|
|||
2
.github/workflows/pr_checks.yaml
vendored
2
.github/workflows/pr_checks.yaml
vendored
|
|
@ -291,6 +291,8 @@ jobs:
|
|||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
||||
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
||||
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
||||
AZURE_FOUNDRY_API_KEY: ${{ secrets.AZURE_FOUNDRY_API_KEY }}
|
||||
|
||||
vscode-get-test-file-matrix:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
10
.github/workflows/preview.yaml
vendored
10
.github/workflows/preview.yaml
vendored
|
|
@ -4,6 +4,13 @@ on:
|
|||
release:
|
||||
types: [prereleased]
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
publish_build:
|
||||
description: "Whether or not to publish the built extension to the VS Code marketplace"
|
||||
required: true
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
check_release_name:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -21,7 +28,7 @@ jobs:
|
|||
|
||||
build:
|
||||
needs: check_release_name
|
||||
if: needs.check_release_name.outputs.should_run == 'true'
|
||||
if: needs.check_release_name.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch'
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
|
|
@ -197,6 +204,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.publish_build == 'true'
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ const targetToLanceDb = {
|
|||
"linux-arm64": "@lancedb/vectordb-linux-arm64-gnu",
|
||||
"linux-x64": "@lancedb/vectordb-linux-x64-gnu",
|
||||
"win32-x64": "@lancedb/vectordb-win32-x64-msvc",
|
||||
"win32-arm64": "@lancedb/vectordb-win32-x64-msvc", // they don't have a win32-arm64 build
|
||||
"win32-arm64": "@lancedb/vectordb-win32-arm64-msvc",
|
||||
};
|
||||
|
||||
async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) {
|
||||
|
|
@ -248,9 +248,15 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) {
|
|||
|
||||
// Download and unzip prebuilt sqlite3 binary for the target
|
||||
console.log("[info] Downloading node-sqlite3");
|
||||
const downloadUrl = `https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v6-${
|
||||
target === "win32-arm64" ? "win32-ia32" : target
|
||||
}.tar.gz`;
|
||||
|
||||
const downloadUrl =
|
||||
// node-sqlite3 doesn't have a pre-built binary for win32-arm64
|
||||
target === "win32-arm64"
|
||||
? "https://continue-server-binaries.s3.us-west-1.amazonaws.com/win32-arm64/node_sqlite3.tar.gz"
|
||||
: `https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v6-${
|
||||
target
|
||||
}.tar.gz`;
|
||||
|
||||
execCmdSync(`curl -L -o ${targetDir}/build.tar.gz ${downloadUrl}`);
|
||||
execCmdSync(`cd ${targetDir} && tar -xvzf build.tar.gz`);
|
||||
|
||||
|
|
|
|||
29
binary/package-lock.json
generated
29
binary/package-lock.json
generated
|
|
@ -48,11 +48,11 @@
|
|||
"@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.23",
|
||||
"@continuedev/config-yaml": "^1.0.28",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
"@modelcontextprotocol/sdk": "^1.0.0",
|
||||
"@modelcontextprotocol/sdk": "^1.5.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
|
|
@ -128,7 +128,7 @@
|
|||
"@types/uuid": "^9.0.7",
|
||||
"@types/win-ca": "^3.5.4",
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild": "0.17.19",
|
||||
"esbuild": "0.24.0",
|
||||
"eslint": "^8",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
|
|
@ -2556,9 +2556,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.6.8",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz",
|
||||
"integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
|
||||
"version": "1.7.9",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz",
|
||||
"integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.0",
|
||||
|
|
@ -3166,10 +3167,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
|
|
@ -5135,12 +5137,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/micromatch": {
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
|
||||
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
|
||||
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"braces": "^3.0.2",
|
||||
"braces": "^3.0.3",
|
||||
"picomatch": "^2.3.1"
|
||||
},
|
||||
"engines": {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class IPCMessengerBase<
|
|||
|
||||
console.warn(`Error running handler for "${msg.messageType}": `, e);
|
||||
this._onErrorHandlers.forEach((handler) => {
|
||||
handler(e);
|
||||
handler(msg, e);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -112,9 +112,9 @@ class IPCMessengerBase<
|
|||
lines.forEach((line) => this._handleLine(line));
|
||||
}
|
||||
|
||||
private _onErrorHandlers: ((error: Error) => void)[] = [];
|
||||
private _onErrorHandlers: ((message: Message, error: Error) => void)[] = [];
|
||||
|
||||
onError(handler: (error: Error) => void) {
|
||||
onError(handler: (message: Message, error: Error) => void) {
|
||||
this._onErrorHandlers.push(handler);
|
||||
}
|
||||
|
||||
|
|
@ -217,7 +217,7 @@ export class CoreBinaryMessenger<
|
|||
extends IPCMessengerBase<ToProtocol, FromProtocol>
|
||||
implements IMessenger<ToProtocol, FromProtocol>
|
||||
{
|
||||
private errorHandler: (error: Error) => void = () => {};
|
||||
private errorHandler: (message: Message, error: Error) => void = () => {};
|
||||
private messageHandlers: Map<
|
||||
keyof ToProtocol,
|
||||
(message: Message<any>) => Promise<any> | any
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ export class TcpMessenger<
|
|||
});
|
||||
}
|
||||
|
||||
private _onErrorHandlers: ((error: Error) => void)[] = [];
|
||||
private _onErrorHandlers: ((message: Message, error: Error) => void)[] = [];
|
||||
|
||||
onError(handler: (error: Error) => void) {
|
||||
onError(handler: (message: Message, error: Error) => void) {
|
||||
this._onErrorHandlers.push(handler);
|
||||
}
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ export class TcpMessenger<
|
|||
|
||||
console.warn(`Error running handler for "${msg.messageType}": `, e);
|
||||
this._onErrorHandlers.forEach((handler) => {
|
||||
handler(e);
|
||||
handler(msg, e);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -90,7 +90,12 @@ const getClipboardSnippets = async (
|
|||
const getDiffSnippets = async (
|
||||
ide: IDE,
|
||||
): Promise<AutocompleteDiffSnippet[]> => {
|
||||
const diff = await ide.getDiff(true);
|
||||
let diff: string[] = [];
|
||||
try {
|
||||
diff = await ide.getDiff(true);
|
||||
} catch (e) {
|
||||
console.error("Error getting diff for autocomplete", e);
|
||||
}
|
||||
|
||||
return diff.map((item) => {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ export class AutocompleteLoggingService {
|
|||
multilineCompletions: restOfOutcome.multilineCompletions,
|
||||
time: restOfOutcome.time,
|
||||
useRecentlyEdited: restOfOutcome.useRecentlyEdited,
|
||||
numLines: restOfOutcome.numLines,
|
||||
},
|
||||
true,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import { localPathToUri } from "../util/pathToUri.js";
|
|||
|
||||
import {
|
||||
LOCAL_ONBOARDING_CHAT_MODEL,
|
||||
ONBOARDING_LOCAL_MODEL_TITLE,
|
||||
LOCAL_ONBOARDING_PROVIDER_TITLE,
|
||||
} from "./onboarding.js";
|
||||
import ControlPlaneProfileLoader from "./profile/ControlPlaneProfileLoader.js";
|
||||
import LocalProfileLoader from "./profile/LocalProfileLoader.js";
|
||||
|
|
@ -365,11 +365,11 @@ export class ConfigHandler {
|
|||
this.updateListeners.push(listener);
|
||||
}
|
||||
|
||||
async reloadConfig(additionalContextProviders: IContextProvider[] = []) {
|
||||
async reloadConfig() {
|
||||
// TODO: this isn't right, there are two different senses in which you want to "reload"
|
||||
|
||||
const { config, errors, configLoadInterrupted } =
|
||||
await this.currentProfile.reloadConfig(additionalContextProviders);
|
||||
await this.currentProfile.reloadConfig(this.additionalContextProviders);
|
||||
|
||||
if (config) {
|
||||
this.inactiveProfiles.forEach((profile) => profile.clearConfig());
|
||||
|
|
@ -401,7 +401,7 @@ export class ConfigHandler {
|
|||
const { config } = await this.loadConfig();
|
||||
const model = config?.models.find((m) => m.title === title);
|
||||
if (!model) {
|
||||
if (title === ONBOARDING_LOCAL_MODEL_TITLE) {
|
||||
if (title === LOCAL_ONBOARDING_PROVIDER_TITLE) {
|
||||
// Special case, make calls to Ollama before we have it in the config
|
||||
const ollama = new Ollama({
|
||||
model: LOCAL_ONBOARDING_CHAT_MODEL,
|
||||
|
|
@ -419,6 +419,6 @@ export class ConfigHandler {
|
|||
|
||||
registerCustomContextProvider(contextProvider: IContextProvider) {
|
||||
this.additionalContextProviders.push(contextProvider);
|
||||
void this.reloadConfig(this.additionalContextProviders);
|
||||
void this.reloadConfig();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ export interface OrganizationDescription {
|
|||
id: string;
|
||||
iconUrl: string;
|
||||
name: string;
|
||||
slug: string | undefined; // TODO: This doesn't need to be undefined, just doing while transitioning the backend
|
||||
}
|
||||
|
||||
export class ProfileLifecycleManager {
|
||||
|
|
@ -50,7 +51,9 @@ export class ProfileLifecycleManager {
|
|||
}
|
||||
|
||||
// Clear saved config and reload
|
||||
async reloadConfig(additionalContextProviders: IContextProvider[] = []): Promise<ConfigResult<ContinueConfig>> {
|
||||
async reloadConfig(
|
||||
additionalContextProviders: IContextProvider[] = [],
|
||||
): Promise<ConfigResult<ContinueConfig>> {
|
||||
this.savedConfigResult = undefined;
|
||||
this.savedBrowserConfigResult = undefined;
|
||||
this.pendingConfigPromise = undefined;
|
||||
|
|
@ -73,7 +76,21 @@ export class ProfileLifecycleManager {
|
|||
|
||||
// Set pending config promise
|
||||
this.pendingConfigPromise = new Promise(async (resolve, reject) => {
|
||||
const result = await this.profileLoader.doLoadConfig();
|
||||
let result: ConfigResult<ContinueConfig>;
|
||||
try {
|
||||
result = await this.profileLoader.doLoadConfig();
|
||||
} catch (e: any) {
|
||||
result = {
|
||||
errors: [
|
||||
{
|
||||
fatal: true,
|
||||
message: e.message,
|
||||
},
|
||||
],
|
||||
config: undefined,
|
||||
configLoadInterrupted: true,
|
||||
};
|
||||
}
|
||||
|
||||
if (result.config) {
|
||||
// Add registered context providers
|
||||
|
|
|
|||
|
|
@ -5,20 +5,6 @@ import {
|
|||
SlashCommandDescription,
|
||||
} from "../";
|
||||
|
||||
export const DEFAULT_CHAT_MODEL_CONFIG: ModelDescription = {
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
provider: "anthropic",
|
||||
apiKey: "",
|
||||
title: "Claude 3.5 Sonnet",
|
||||
};
|
||||
|
||||
export const DEFAULT_AUTOCOMPLETE_MODEL_CONFIG: ModelDescription = {
|
||||
title: "Codestral",
|
||||
provider: "mistral",
|
||||
model: "codestral-latest",
|
||||
apiKey: "",
|
||||
};
|
||||
|
||||
export const FREE_TRIAL_MODELS: ModelDescription[] = [
|
||||
{
|
||||
title: "Claude 3.5 Sonnet (Free Trial)",
|
||||
|
|
@ -93,15 +79,13 @@ export const defaultSlashCommandsJetBrains = [
|
|||
];
|
||||
|
||||
export const defaultConfig: SerializedContinueConfig = {
|
||||
models: [DEFAULT_CHAT_MODEL_CONFIG],
|
||||
tabAutocompleteModel: DEFAULT_AUTOCOMPLETE_MODEL_CONFIG,
|
||||
models: [],
|
||||
contextProviders: defaultContextProvidersVsCode,
|
||||
slashCommands: defaultSlashCommandsVscode,
|
||||
};
|
||||
|
||||
export const defaultConfigJetBrains: SerializedContinueConfig = {
|
||||
models: [DEFAULT_CHAT_MODEL_CONFIG],
|
||||
tabAutocompleteModel: DEFAULT_AUTOCOMPLETE_MODEL_CONFIG,
|
||||
models: [],
|
||||
contextProviders: defaultContextProvidersJetBrains,
|
||||
slashCommands: defaultSlashCommandsJetBrains,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ import {
|
|||
} from "../util/paths";
|
||||
|
||||
import { ConfigResult, ConfigValidationError } from "@continuedev/config-yaml";
|
||||
import { useHub } from "../control-plane/env";
|
||||
import { localPathToUri } from "../util/pathToUri";
|
||||
import {
|
||||
defaultContextProvidersJetBrains,
|
||||
defaultContextProvidersVsCode,
|
||||
|
|
@ -70,8 +72,6 @@ import {
|
|||
defaultSlashCommandsVscode,
|
||||
} from "./default";
|
||||
import { getSystemPromptDotFile } from "./getSystemPromptDotFile";
|
||||
import { useHub } from "../control-plane/env";
|
||||
import { localPathToUri } from "../util/pathToUri";
|
||||
import { modifyContinueConfigWithSharedConfig } from "./sharedConfig";
|
||||
import { validateConfig } from "./validation.js";
|
||||
|
||||
|
|
@ -326,6 +326,7 @@ async function intermediateToFinalConfig(
|
|||
...model.requestOptions,
|
||||
...config.requestOptions,
|
||||
};
|
||||
model.roles = model.roles ?? ["chat"]; // Default to chat role if not specified
|
||||
}
|
||||
|
||||
if (allowFreeTrial) {
|
||||
|
|
@ -517,6 +518,8 @@ async function intermediateToFinalConfig(
|
|||
continueConfig,
|
||||
mcpId,
|
||||
abortController.signal,
|
||||
"MCP Server",
|
||||
server.faviconUrl,
|
||||
);
|
||||
if (mcpError) {
|
||||
errors.push(mcpError);
|
||||
|
|
@ -557,6 +560,7 @@ async function finalToBrowserConfig(
|
|||
requestOptions: m.requestOptions,
|
||||
promptTemplates: m.promptTemplates as any,
|
||||
capabilities: m.capabilities,
|
||||
roles: m.roles,
|
||||
})),
|
||||
systemMessage: final.systemMessage,
|
||||
completionOptions: final.completionOptions,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
import * as fs from "fs";
|
||||
|
||||
import * as JSONC from "comment-json";
|
||||
|
||||
import { IDE, SerializedContinueConfig } from "..";
|
||||
import { SharedConfigSchema } from "./sharedConfig";
|
||||
import { IDE } from "..";
|
||||
import { deduplicateArray } from "../util";
|
||||
import { GlobalContext } from "../util/GlobalContext";
|
||||
import { editConfigJson } from "../util/paths";
|
||||
import { resolveSerializedConfig } from "./load";
|
||||
import { deduplicateArray } from "../util";
|
||||
import { SharedConfigSchema } from "./sharedConfig";
|
||||
|
||||
/*
|
||||
This migration function eliminates deprecated values from the json file
|
||||
|
|
@ -201,10 +197,10 @@ export function migrateJsonSharedConfig(filepath: string, ide: IDE): void {
|
|||
if (effected) {
|
||||
new GlobalContext().updateSharedConfig(shareConfigUpdates);
|
||||
editConfigJson(() => config);
|
||||
void ide.showToast(
|
||||
"warning",
|
||||
"Migrated deprecated Continue JSON settings. Edit in the Settings Page",
|
||||
);
|
||||
// void ide.showToast(
|
||||
// "warning",
|
||||
// "Migrated deprecated Continue JSON settings. Edit in the Settings Page",
|
||||
// );
|
||||
}
|
||||
} catch (e) {
|
||||
throw new Error(`Migration: Failed to parse config.json: ${e}`);
|
||||
|
|
|
|||
|
|
@ -3,10 +3,12 @@ import { SerializedContinueConfig } from "../";
|
|||
import { FREE_TRIAL_MODELS } from "./default";
|
||||
|
||||
export const TRIAL_FIM_MODEL = "codestral-latest";
|
||||
export const ONBOARDING_LOCAL_MODEL_TITLE = "Ollama";
|
||||
export const LOCAL_ONBOARDING_PROVIDER_TITLE = "Ollama";
|
||||
export const LOCAL_ONBOARDING_FIM_MODEL = "qwen2.5-coder:1.5b-base";
|
||||
export const LOCAL_ONBOARDING_FIM_TITLE = "Qwen2.5-Coder 1.5B";
|
||||
export const LOCAL_ONBOARDING_CHAT_MODEL = "llama3.1:8b";
|
||||
export const LOCAL_ONBOARDING_CHAT_TITLE = "Llama 3.1 8B";
|
||||
export const LOCAL_ONBOARDING_EMBEDDINGS_MODEL = "nomic-embed-text:latest";
|
||||
|
||||
/**
|
||||
* We set the "best" chat + autocopmlete models by default
|
||||
|
|
@ -35,13 +37,13 @@ export function setupLocalConfig(
|
|||
...config.models.filter((model) => model.provider !== "free-trial"),
|
||||
],
|
||||
tabAutocompleteModel: {
|
||||
title: "Qwen2.5-Coder 1.5B",
|
||||
title: LOCAL_ONBOARDING_FIM_TITLE,
|
||||
provider: "ollama",
|
||||
model: LOCAL_ONBOARDING_FIM_MODEL,
|
||||
},
|
||||
embeddingsProvider: {
|
||||
provider: "ollama",
|
||||
model: "nomic-embed-text",
|
||||
model: LOCAL_ONBOARDING_EMBEDDINGS_MODEL,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -68,24 +70,3 @@ export function setupQuickstartConfig(
|
|||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function setupLocalConfigAfterFreeTrial(
|
||||
config: SerializedContinueConfig,
|
||||
): SerializedContinueConfig {
|
||||
return {
|
||||
...config,
|
||||
models: [
|
||||
{
|
||||
title: LOCAL_ONBOARDING_CHAT_TITLE,
|
||||
provider: "ollama",
|
||||
model: LOCAL_ONBOARDING_CHAT_MODEL,
|
||||
},
|
||||
{
|
||||
title: ONBOARDING_LOCAL_MODEL_TITLE,
|
||||
provider: "ollama",
|
||||
model: "AUTODETECT",
|
||||
},
|
||||
...config.models.filter((model) => model.provider !== "free-trial"),
|
||||
],
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { ConfigResult } from "@continuedev/config-yaml";
|
||||
import { AssistantUnrolled } from "@continuedev/config-yaml/dist/schemas/index.js";
|
||||
import { ConfigResult, AssistantUnrolled } from "@continuedev/config-yaml";
|
||||
|
||||
import { ControlPlaneClient } from "../../control-plane/client.js";
|
||||
import { ContinueConfig, IDE, IdeSettings } from "../../index.js";
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ import { getConfigJsonPath, getConfigYamlPath } from "../../util/paths";
|
|||
import { Telemetry } from "../../util/posthog";
|
||||
import { TTS } from "../../util/tts";
|
||||
import { loadContinueConfigFromJson } from "../load";
|
||||
import { migrateJsonSharedConfig } from "../migrateSharedConfig";
|
||||
import { loadContinueConfigFromYaml } from "../yaml/loadYaml";
|
||||
import { PlatformConfigMetadata } from "./PlatformProfileLoader";
|
||||
import { migrateJsonSharedConfig } from "../migrateSharedConfig";
|
||||
|
||||
export default async function doLoadConfig(
|
||||
ide: IDE,
|
||||
|
|
|
|||
|
|
@ -956,7 +956,7 @@ declare global {
|
|||
fixGrammar?: string;
|
||||
}
|
||||
|
||||
interface ModelRoles {
|
||||
interface ExperimentalModelRoles {
|
||||
inlineEdit?: string;
|
||||
applyCodeBlock?: string;
|
||||
repoMapFileSelection?: string;
|
||||
|
|
@ -1024,7 +1024,7 @@ declare global {
|
|||
|
||||
interface ExperimentalConfig {
|
||||
contextMenuPrompts?: ContextMenuConfig;
|
||||
modelRoles?: ModelRoles;
|
||||
modelRoles?: ExperimentalModelRoles;
|
||||
defaultContext?: DefaultContextProvider[];
|
||||
promptPath?: string;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
IDE,
|
||||
ILLM,
|
||||
ModelDescription,
|
||||
ModelRoles,
|
||||
ExperimentalModelRoles,
|
||||
} from "../";
|
||||
import { GlobalContext } from "../util/GlobalContext";
|
||||
import { editConfigJson } from "../util/paths";
|
||||
|
|
@ -34,7 +34,10 @@ export function addContextProvider(provider: ContextProviderWithParams) {
|
|||
});
|
||||
}
|
||||
|
||||
export function addModel(model: ModelDescription, role?: keyof ModelRoles) {
|
||||
export function addModel(
|
||||
model: ModelDescription,
|
||||
role?: keyof ExperimentalModelRoles,
|
||||
) {
|
||||
editConfigJson((config) => {
|
||||
if (config.models?.some((m: any) => stringify(m) === stringify(model))) {
|
||||
return config;
|
||||
|
|
@ -85,7 +88,7 @@ export function deleteModel(title: string) {
|
|||
});
|
||||
}
|
||||
|
||||
export function getModelByRole<T extends keyof ModelRoles>(
|
||||
export function getModelByRole<T extends keyof ExperimentalModelRoles>(
|
||||
config: ContinueConfig,
|
||||
role: T,
|
||||
): ILLM | undefined {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { ModelConfig } from "@continuedev/config-yaml";
|
||||
import { AssistantUnrolled } from "@continuedev/config-yaml/dist/schemas";
|
||||
import { ModelConfig, AssistantUnrolled } from "@continuedev/config-yaml";
|
||||
|
||||
import { SerializedContinueConfig } from "../..";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { AssistantUnrolled } from "@continuedev/config-yaml/dist/schemas";
|
||||
import { AssistantUnrolled } from "@continuedev/config-yaml";
|
||||
|
||||
// TODO
|
||||
export const defaultConfigYaml: AssistantUnrolled = {
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@ import fs from "node:fs";
|
|||
import {
|
||||
AssistantUnrolled,
|
||||
ConfigResult,
|
||||
ConfigValidationError,
|
||||
parseAssistantUnrolled,
|
||||
validateConfigYaml,
|
||||
} from "@continuedev/config-yaml";
|
||||
import { ModelRole } from "@continuedev/config-yaml";
|
||||
import { fetchwithRequestOptions } from "@continuedev/fetch";
|
||||
|
||||
import {
|
||||
BrowserSerializedContinueConfig,
|
||||
ContinueConfig,
|
||||
IContextProvider,
|
||||
IDE,
|
||||
|
|
@ -17,9 +18,11 @@ import {
|
|||
IdeType,
|
||||
SlashCommand,
|
||||
} from "../..";
|
||||
import { slashFromCustomCommand } from "../../commands";
|
||||
import { AllRerankers } from "../../context/allRerankers";
|
||||
import { MCPManagerSingleton } from "../../context/mcp";
|
||||
import CodebaseContextProvider from "../../context/providers/CodebaseContextProvider";
|
||||
import DocsContextProvider from "../../context/providers/DocsContextProvider";
|
||||
import FileContextProvider from "../../context/providers/FileContextProvider";
|
||||
import { contextProviderClassFromName } from "../../context/providers/index";
|
||||
import PromptFilesContextProvider from "../../context/providers/PromptFilesContextProvider";
|
||||
|
|
@ -29,14 +32,13 @@ import FreeTrial from "../../llm/llms/FreeTrial";
|
|||
import TransformersJsEmbeddingsProvider from "../../llm/llms/TransformersJsEmbeddingsProvider";
|
||||
import { slashCommandFromPromptFileV1 } from "../../promptFiles/v1/slashCommandFromPromptFile";
|
||||
import { getAllPromptFiles } from "../../promptFiles/v2/getPromptFiles";
|
||||
import { allTools } from "../../tools";
|
||||
import { GlobalContext } from "../../util/GlobalContext";
|
||||
import { getConfigYamlPath } from "../../util/paths";
|
||||
import { getSystemPromptDotFile } from "../getSystemPromptDotFile";
|
||||
import { PlatformConfigMetadata } from "../profile/PlatformProfileLoader";
|
||||
|
||||
import { slashFromCustomCommand } from "../../commands";
|
||||
import { allTools } from "../../tools";
|
||||
import { GlobalContext } from "../../util/GlobalContext";
|
||||
import { modifyContinueConfigWithSharedConfig } from "../sharedConfig";
|
||||
|
||||
import { clientRenderHelper } from "./clientRender";
|
||||
import { llmsFromModelConfig } from "./models";
|
||||
|
||||
|
|
@ -100,7 +102,8 @@ async function configYamlToContinueConfig(
|
|||
workOsAccessToken: string | undefined,
|
||||
platformConfigMetadata: PlatformConfigMetadata | undefined,
|
||||
allowFreeTrial: boolean = true,
|
||||
): Promise<ContinueConfig> {
|
||||
): Promise<{ config: ContinueConfig; errors: ConfigValidationError[] }> {
|
||||
const errors: ConfigValidationError[] = [];
|
||||
const continueConfig: ContinueConfig = {
|
||||
slashCommands: [
|
||||
...(await slashCommandsFromV1PromptFiles(ide)),
|
||||
|
|
@ -131,12 +134,10 @@ async function configYamlToContinueConfig(
|
|||
};
|
||||
|
||||
// Models
|
||||
const modelsArrayRoles: ModelRole[] = ["chat", "summarize", "apply", "edit"];
|
||||
for (const model of config.models ?? []) {
|
||||
if (
|
||||
["chat", "summarize", "apply", "edit"].some((role: any) =>
|
||||
model.roles?.includes(role),
|
||||
)
|
||||
) {
|
||||
model.roles = model.roles ?? ["chat"]; // Default to chat role if not specified
|
||||
if (modelsArrayRoles.some((role) => model.roles?.includes(role))) {
|
||||
// Main model array
|
||||
const llms = await llmsFromModelConfig(
|
||||
model,
|
||||
|
|
@ -163,6 +164,24 @@ async function configYamlToContinueConfig(
|
|||
);
|
||||
continueConfig.tabAutocompleteModels?.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("edit") &&
|
||||
!continueConfig.experimental?.modelRoles?.inlineEdit
|
||||
) {
|
||||
continueConfig.experimental ??= {};
|
||||
continueConfig.experimental!.modelRoles ??= {};
|
||||
continueConfig.experimental!.modelRoles!.inlineEdit = model.name;
|
||||
}
|
||||
}
|
||||
|
||||
if (allowFreeTrial) {
|
||||
|
|
@ -214,7 +233,17 @@ async function configYamlToContinueConfig(
|
|||
.filter((p) => !!p) ?? []) as IContextProvider[];
|
||||
continueConfig.contextProviders.push(...DEFAULT_CONTEXT_PROVIDERS);
|
||||
|
||||
if (
|
||||
continueConfig.docs?.length &&
|
||||
!continueConfig.contextProviders?.some(
|
||||
(cp) => cp.description.title === "docs",
|
||||
)
|
||||
) {
|
||||
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"),
|
||||
);
|
||||
|
|
@ -239,6 +268,7 @@ async function configYamlToContinueConfig(
|
|||
}
|
||||
|
||||
// Reranker
|
||||
// IMPORTANT this currently will grab the first model found with a rerank role
|
||||
const rerankConfig = config.models?.find((model) =>
|
||||
model.roles?.includes("rerank"),
|
||||
);
|
||||
|
|
@ -259,40 +289,51 @@ async function configYamlToContinueConfig(
|
|||
|
||||
// Apply MCP if specified
|
||||
const mcpManager = MCPManagerSingleton.getInstance();
|
||||
config.mcpServers?.forEach(async (server) => {
|
||||
const mcpId = server.name;
|
||||
const mcpConnection = mcpManager.createConnection(mcpId, {
|
||||
transport: {
|
||||
type: "stdio",
|
||||
args: [],
|
||||
...server,
|
||||
},
|
||||
});
|
||||
if (!mcpConnection) {
|
||||
return;
|
||||
}
|
||||
|
||||
const abortController = new AbortController();
|
||||
const mcpConnectionTimeout = setTimeout(
|
||||
() => abortController.abort(),
|
||||
2000,
|
||||
);
|
||||
|
||||
try {
|
||||
await mcpConnection.modifyConfig(
|
||||
continueConfig,
|
||||
mcpId,
|
||||
abortController.signal,
|
||||
);
|
||||
} catch (e: any) {
|
||||
if (e.name !== "AbortError") {
|
||||
throw e;
|
||||
await Promise.all(
|
||||
config.mcpServers?.map(async (server) => {
|
||||
const mcpId = server.name;
|
||||
const mcpConnection = mcpManager.createConnection(mcpId, {
|
||||
transport: {
|
||||
type: "stdio",
|
||||
args: [],
|
||||
...server,
|
||||
},
|
||||
});
|
||||
if (!mcpConnection) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
clearTimeout(mcpConnectionTimeout);
|
||||
});
|
||||
|
||||
return continueConfig;
|
||||
const abortController = new AbortController();
|
||||
const mcpConnectionTimeout = setTimeout(
|
||||
() => abortController.abort(),
|
||||
5000,
|
||||
);
|
||||
|
||||
try {
|
||||
const mcpError = await mcpConnection.modifyConfig(
|
||||
continueConfig,
|
||||
mcpId,
|
||||
abortController.signal,
|
||||
server.name,
|
||||
server.faviconUrl,
|
||||
);
|
||||
if (mcpError) {
|
||||
errors.push(mcpError);
|
||||
}
|
||||
} catch (e: any) {
|
||||
errors.push({
|
||||
fatal: false,
|
||||
message: `Failed to load MCP server: ${e.message}`,
|
||||
});
|
||||
if (e.name !== "AbortError") {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
clearTimeout(mcpConnectionTimeout);
|
||||
}) ?? [],
|
||||
);
|
||||
|
||||
return { config: continueConfig, errors };
|
||||
}
|
||||
|
||||
export async function loadContinueConfigFromYaml(
|
||||
|
|
@ -328,7 +369,7 @@ export async function loadContinueConfigFromYaml(
|
|||
};
|
||||
}
|
||||
|
||||
const continueConfig = await configYamlToContinueConfig(
|
||||
const { config: continueConfig, errors } = await configYamlToContinueConfig(
|
||||
configYamlResult.config,
|
||||
ide,
|
||||
ideSettings,
|
||||
|
|
@ -357,9 +398,7 @@ export async function loadContinueConfigFromYaml(
|
|||
|
||||
return {
|
||||
config: withShared,
|
||||
errors: configYamlResult.errors,
|
||||
errors: [...(configYamlResult.errors ?? []), ...errors],
|
||||
configLoadInterrupted: false,
|
||||
};
|
||||
}
|
||||
|
||||
export { type BrowserSerializedContinueConfig };
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ async function modelConfigToBaseLLM(
|
|||
return undefined;
|
||||
}
|
||||
|
||||
const usingContinueProxy = model.provider === "continue-proxy";
|
||||
const usingContinueProxy =
|
||||
platformConfigMetadata && model.provider === "continue-proxy";
|
||||
const modelName = usingContinueProxy
|
||||
? getContinueProxyModelName(
|
||||
platformConfigMetadata!.ownerSlug,
|
||||
|
|
@ -58,6 +59,7 @@ async function modelConfigToBaseLLM(
|
|||
title: model.name,
|
||||
model: modelName,
|
||||
systemMessage,
|
||||
promptTemplates: model.promptTemplates,
|
||||
};
|
||||
|
||||
const llm = new cls(options);
|
||||
|
|
|
|||
|
|
@ -69,10 +69,14 @@ class MCPConnection {
|
|||
private constructTransport(options: MCPOptions): Transport {
|
||||
switch (options.transport.type) {
|
||||
case "stdio":
|
||||
const env: Record<string, string> = options.transport.env || {};
|
||||
if (process.env.PATH !== undefined) {
|
||||
env.PATH = process.env.PATH;
|
||||
}
|
||||
return new StdioClientTransport({
|
||||
command: options.transport.command,
|
||||
args: options.transport.args,
|
||||
env: options.transport.env,
|
||||
env,
|
||||
});
|
||||
case "websocket":
|
||||
return new WebSocketClientTransport(new URL(options.transport.url));
|
||||
|
|
@ -117,6 +121,8 @@ class MCPConnection {
|
|||
config: ContinueConfig,
|
||||
mcpId: string,
|
||||
signal: AbortSignal,
|
||||
name: string,
|
||||
faviconUrl: string | undefined,
|
||||
): Promise<ConfigValidationError | undefined> {
|
||||
try {
|
||||
await Promise.race([
|
||||
|
|
@ -148,6 +154,7 @@ class MCPConnection {
|
|||
title: resource.name,
|
||||
description: resource.description,
|
||||
id: resource.uri,
|
||||
icon: faviconUrl,
|
||||
}));
|
||||
|
||||
if (!config.contextProviders) {
|
||||
|
|
@ -165,19 +172,20 @@ class MCPConnection {
|
|||
if (capabilities?.tools) {
|
||||
const { tools } = await this.client.listTools({}, { signal });
|
||||
const continueTools: Tool[] = tools.map((tool: any) => ({
|
||||
displayTitle: tool.name,
|
||||
displayTitle: name + " " + tool.name,
|
||||
function: {
|
||||
description: tool.description,
|
||||
name: tool.name,
|
||||
parameters: tool.inputSchema,
|
||||
},
|
||||
faviconUrl,
|
||||
readonly: false,
|
||||
type: "function",
|
||||
wouldLikeTo: `use the ${tool.name} tool`,
|
||||
wouldLikeTo: `use the ${name} ${tool.name} tool`,
|
||||
uri: encodeMCPToolUri(mcpId, tool.name),
|
||||
}));
|
||||
|
||||
config.tools = [...config.tools, ...continueTools];
|
||||
config.tools = [...continueTools, ...config.tools];
|
||||
}
|
||||
|
||||
// Prompts <—> Slash commands
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ export async function retrieveContextItemsFromEmbeddings(
|
|||
}
|
||||
|
||||
return {
|
||||
name: `${baseName} (${r.startLine}-${r.endLine})`,
|
||||
name: `${baseName} (${r.startLine + 1}-${r.endLine + 1})`,
|
||||
description: last2Parts,
|
||||
content: `\`\`\`${relativePathOrBasename}\n${r.content}\n\`\`\``,
|
||||
uri: {
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@ import { getControlPlaneEnv } from "../env";
|
|||
|
||||
export async function getAuthUrlForTokenPage(
|
||||
ideSettingsPromise: Promise<IdeSettings>,
|
||||
useOnboarding: boolean,
|
||||
): Promise<string> {
|
||||
const env = await getControlPlaneEnv(ideSettingsPromise);
|
||||
const url = new URL("https://api.workos.com/user_management/authorize");
|
||||
const params = {
|
||||
response_type: "code",
|
||||
client_id: env.WORKOS_CLIENT_ID,
|
||||
redirect_uri: `${env.APP_URL}tokens/callback`,
|
||||
redirect_uri: `${env.APP_URL}tokens/${useOnboarding ? "onboarding-" : ""}callback`,
|
||||
// redirect_uri: "http://localhost:3000/tokens/callback",
|
||||
state: uuidv4(),
|
||||
provider: "authkit",
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import fetch from "node-fetch";
|
||||
import { IdeSettings } from "..";
|
||||
|
||||
export interface ControlPlaneEnv {
|
||||
|
|
@ -60,6 +61,17 @@ const LOCAL_ENV: ControlPlaneEnv = {
|
|||
APP_URL: "http://localhost:3000/",
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
export async function getControlPlaneEnv(
|
||||
ideSettingsPromise: Promise<IdeSettings>,
|
||||
): Promise<ControlPlaneEnv> {
|
||||
|
|
|
|||
105
core/core.ts
105
core/core.ts
|
|
@ -11,7 +11,6 @@ import { SYSTEM_PROMPT_DOT_FILE } from "./config/getSystemPromptDotFile";
|
|||
import {
|
||||
setupBestConfig,
|
||||
setupLocalConfig,
|
||||
setupLocalConfigAfterFreeTrial,
|
||||
setupQuickstartConfig,
|
||||
} from "./config/onboarding";
|
||||
import { addContextProvider, addModel, deleteModel } from "./config/util";
|
||||
|
|
@ -53,11 +52,12 @@ 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";
|
||||
|
||||
export class Core {
|
||||
// implements IMessenger<ToCoreProtocol, FromCoreProtocol>
|
||||
configHandler: ConfigHandler;
|
||||
codebaseIndexerPromise: Promise<CodebaseIndexer>;
|
||||
completionProvider: CompletionProvider;
|
||||
|
|
@ -209,13 +209,24 @@ export class Core {
|
|||
|
||||
// Note, VsCode's in-process messenger doesn't do anything with this
|
||||
// It will only show for jetbrains
|
||||
this.messenger.onError((err) => {
|
||||
console.error(err);
|
||||
this.messenger.onError((message, err) => {
|
||||
void Telemetry.capture("core_messenger_error", {
|
||||
message: err.message,
|
||||
stack: err.stack,
|
||||
});
|
||||
void this.ide.showToast("error", err.message);
|
||||
|
||||
// Again, specifically for jetbrains to prevent duplicate error messages
|
||||
// The same logic can currently be found in the webview protocol
|
||||
// bc streaming errors are handled in the GUI
|
||||
if (
|
||||
["llm/streamChat", "chatDescriber/describe"].includes(
|
||||
message.messageType,
|
||||
)
|
||||
) {
|
||||
return;
|
||||
} else {
|
||||
void this.ide.showToast("error", err.message);
|
||||
}
|
||||
});
|
||||
|
||||
on("update/selectTabAutocompleteModel", async (msg) => {
|
||||
|
|
@ -305,7 +316,11 @@ export class Core {
|
|||
|
||||
on("controlPlane/openUrl", async (msg) => {
|
||||
const env = await getControlPlaneEnv(this.ide.getIdeSettings());
|
||||
await this.messenger.request("openUrl", `${env.APP_URL}${msg.data.path}`);
|
||||
let url = `${env.APP_URL}${msg.data.path}`;
|
||||
if (msg.data.orgSlug) {
|
||||
url += `?org=${msg.data.orgSlug}`;
|
||||
}
|
||||
await this.messenger.request("openUrl", url);
|
||||
});
|
||||
|
||||
on("controlPlane/listOrganizations", async (msg) => {
|
||||
|
|
@ -351,9 +366,17 @@ export class Core {
|
|||
}
|
||||
|
||||
const llm = await this.configHandler.llmFromTitle(selectedModelTitle);
|
||||
const provider = config.contextProviders?.find(
|
||||
(provider) => provider.description.title === name,
|
||||
);
|
||||
const provider =
|
||||
config.contextProviders?.find(
|
||||
(provider) => provider.description.title === name,
|
||||
) ??
|
||||
[
|
||||
// user doesn't need these in their config.json for the shortcuts to work
|
||||
// option+enter
|
||||
new CurrentFileContextProvider({}),
|
||||
// cmd+enter
|
||||
new CodebaseContextProvider({}),
|
||||
].find((provider) => provider.description.title === name);
|
||||
if (!provider) {
|
||||
return [];
|
||||
}
|
||||
|
|
@ -389,10 +412,36 @@ export class Core {
|
|||
id,
|
||||
}));
|
||||
} catch (e) {
|
||||
void this.ide.showToast(
|
||||
"error",
|
||||
`Error getting context items from ${name}: ${e}`,
|
||||
);
|
||||
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",
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (!knownError) {
|
||||
void this.ide.showToast(
|
||||
"error",
|
||||
`Error getting context items from ${name}: ${e}`,
|
||||
);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
});
|
||||
|
|
@ -693,6 +742,8 @@ export class Core {
|
|||
llm,
|
||||
data.input,
|
||||
data.language,
|
||||
false,
|
||||
undefined,
|
||||
)) {
|
||||
if (abortedMessageIds.has(msg.messageId)) {
|
||||
abortedMessageIds.delete(msg.messageId);
|
||||
|
|
@ -724,10 +775,6 @@ export class Core {
|
|||
editConfigJsonCallback = setupQuickstartConfig;
|
||||
break;
|
||||
|
||||
case "LocalAfterFreeTrial":
|
||||
editConfigJsonCallback = setupLocalConfigAfterFreeTrial;
|
||||
break;
|
||||
|
||||
case "Best":
|
||||
editConfigJsonCallback = setupBestConfig;
|
||||
break;
|
||||
|
|
@ -831,12 +878,18 @@ export class Core {
|
|||
|
||||
on("files/created", async ({ data }) => {
|
||||
if (data?.uris?.length) {
|
||||
this.messenger.send("refreshSubmenuItems", {
|
||||
providers: ["file"],
|
||||
});
|
||||
await this.refreshCodebaseIndexFiles(data.uris);
|
||||
}
|
||||
});
|
||||
|
||||
on("files/deleted", async ({ data }) => {
|
||||
if (data?.uris?.length) {
|
||||
this.messenger.send("refreshSubmenuItems", {
|
||||
providers: ["file"],
|
||||
});
|
||||
await this.refreshCodebaseIndexFiles(data.uris);
|
||||
}
|
||||
});
|
||||
|
|
@ -889,10 +942,15 @@ export class Core {
|
|||
});
|
||||
|
||||
on("didChangeControlPlaneSessionInfo", async (msg) => {
|
||||
this.configHandler.updateControlPlaneSessionInfo(msg.data.sessionInfo);
|
||||
await this.configHandler.updateControlPlaneSessionInfo(
|
||||
msg.data.sessionInfo,
|
||||
);
|
||||
});
|
||||
on("auth/getAuthUrl", async (msg) => {
|
||||
const url = await getAuthUrlForTokenPage(ideSettingsPromise);
|
||||
const url = await getAuthUrlForTokenPage(
|
||||
ideSettingsPromise,
|
||||
msg.data.useOnboarding,
|
||||
);
|
||||
return { url };
|
||||
});
|
||||
|
||||
|
|
@ -930,16 +988,23 @@ export class Core {
|
|||
const llm = await this.configHandler.llmFromTitle(selectedModelTitle);
|
||||
|
||||
const contextItems = await callTool(
|
||||
tool.uri ?? tool.function.name,
|
||||
tool,
|
||||
JSON.parse(toolCall.function.arguments || "{}"),
|
||||
{
|
||||
ide: this.ide,
|
||||
llm,
|
||||
fetch: (url, init) =>
|
||||
fetchwithRequestOptions(url, init, config.requestOptions),
|
||||
tool,
|
||||
},
|
||||
);
|
||||
|
||||
if (tool.faviconUrl) {
|
||||
contextItems.forEach((item) => {
|
||||
item.icon = tool.faviconUrl;
|
||||
});
|
||||
}
|
||||
|
||||
return { contextItems };
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@ export async function* streamDiffLines(
|
|||
llm: ILLM,
|
||||
input: string,
|
||||
language: string | undefined,
|
||||
onlyOneInsertion?: boolean,
|
||||
onlyOneInsertion: boolean,
|
||||
overridePrompt: ChatMessage[] | undefined,
|
||||
): AsyncGenerator<DiffLine> {
|
||||
void Telemetry.capture(
|
||||
"inlineEdit",
|
||||
|
|
@ -80,14 +81,9 @@ export async function* streamDiffLines(
|
|||
// Trim end of oldLines, otherwise we have trailing \r on every line for CRLF files
|
||||
oldLines = oldLines.map((line) => line.trimEnd());
|
||||
|
||||
const prompt = constructPrompt(
|
||||
prefix,
|
||||
highlighted,
|
||||
suffix,
|
||||
llm,
|
||||
input,
|
||||
language,
|
||||
);
|
||||
const prompt =
|
||||
overridePrompt ??
|
||||
constructPrompt(prefix, highlighted, suffix, llm, input, language);
|
||||
const inept = modelIsInept(llm.model);
|
||||
|
||||
const prediction: Prediction = {
|
||||
|
|
|
|||
19
core/index.d.ts
vendored
19
core/index.d.ts
vendored
|
|
@ -1,6 +1,6 @@
|
|||
import Parser from "web-tree-sitter";
|
||||
import { GetGhTokenArgs } from "./protocol/ide";
|
||||
|
||||
import { ModelRole } from "@continuedev/config-yaml";
|
||||
declare global {
|
||||
interface Window {
|
||||
ide?: "vscode";
|
||||
|
|
@ -94,6 +94,8 @@ export interface ILLM extends LLMOptions {
|
|||
apiKey?: string;
|
||||
apiBase?: string;
|
||||
cacheBehavior?: CacheBehavior;
|
||||
capabilities?: ModelCapability;
|
||||
roles?: ModelRole[];
|
||||
|
||||
deployment?: string;
|
||||
apiVersion?: string;
|
||||
|
|
@ -480,6 +482,8 @@ export interface LLMOptions {
|
|||
aiGatewaySlug?: string;
|
||||
apiBase?: string;
|
||||
cacheBehavior?: CacheBehavior;
|
||||
capabilities?: ModelCapability;
|
||||
roles?: ModelRole[];
|
||||
|
||||
useLegacyCompletionsEndpoint?: boolean;
|
||||
|
||||
|
|
@ -503,9 +507,6 @@ export interface LLMOptions {
|
|||
// AWS and GCP Options
|
||||
region?: string;
|
||||
|
||||
// GCP Options
|
||||
capabilities?: ModelCapability;
|
||||
|
||||
// GCP and Watsonx Options
|
||||
projectId?: string;
|
||||
|
||||
|
|
@ -859,6 +860,7 @@ export interface ToolExtras {
|
|||
ide: IDE;
|
||||
llm: ILLM;
|
||||
fetch: FetchFunction;
|
||||
tool: Tool;
|
||||
}
|
||||
|
||||
export interface Tool {
|
||||
|
|
@ -874,6 +876,7 @@ export interface Tool {
|
|||
wouldLikeTo: string;
|
||||
readonly: boolean;
|
||||
uri?: string;
|
||||
faviconUrl?: string;
|
||||
}
|
||||
|
||||
interface ToolChoice {
|
||||
|
|
@ -921,8 +924,9 @@ export interface ModelDescription {
|
|||
systemMessage?: string;
|
||||
requestOptions?: RequestOptions;
|
||||
promptTemplates?: { [key: string]: string };
|
||||
capabilities?: ModelCapability;
|
||||
cacheBehavior?: CacheBehavior;
|
||||
capabilities?: ModelCapability;
|
||||
roles?: ModelRole[];
|
||||
}
|
||||
|
||||
export interface EmbedOptions {
|
||||
|
|
@ -999,6 +1003,7 @@ export type TransportOptions = StdioOptions | WebSocketOptions | SSEOptions;
|
|||
|
||||
export interface MCPOptions {
|
||||
transport: TransportOptions;
|
||||
faviconUrl?: string;
|
||||
}
|
||||
|
||||
export interface ContinueUIConfig {
|
||||
|
|
@ -1017,7 +1022,7 @@ export interface ContextMenuConfig {
|
|||
fixGrammar?: string;
|
||||
}
|
||||
|
||||
export interface ModelRoles {
|
||||
export interface ExperimentalModelRoles {
|
||||
inlineEdit?: string;
|
||||
applyCodeBlock?: string;
|
||||
repoMapFileSelection?: string;
|
||||
|
|
@ -1085,7 +1090,7 @@ export type DefaultContextProvider = ContextProviderWithParams & {
|
|||
|
||||
export interface ExperimentalConfig {
|
||||
contextMenuPrompts?: ContextMenuConfig;
|
||||
modelRoles?: ModelRoles;
|
||||
modelRoles?: ExperimentalModelRoles;
|
||||
defaultContext?: DefaultContextProvider[];
|
||||
promptPath?: string;
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import {
|
|||
} from "./preIndexed";
|
||||
import preIndexedDocs from "./preIndexedDocs";
|
||||
import { ConfigResult } from "@continuedev/config-yaml";
|
||||
import { GlobalContext } from "../../util/GlobalContext";
|
||||
|
||||
// Purposefully lowercase because lancedb converts
|
||||
export interface LanceDbDocsRow {
|
||||
|
|
@ -210,11 +211,11 @@ export default class DocsService {
|
|||
if (isAborted) {
|
||||
return true;
|
||||
}
|
||||
// Handle indexing disabled change mid-indexing
|
||||
if (this.config.disableIndexing) {
|
||||
this.abort(startUrl);
|
||||
return true;
|
||||
}
|
||||
// // Handle indexing disabled change mid-indexing
|
||||
// if (this.config.disableIndexing) {
|
||||
// this.abort(startUrl);
|
||||
// return true;
|
||||
// }
|
||||
// Handle embeddings provider change mid-indexing
|
||||
if (this.config.embeddingsProvider.embeddingId !== startedWithEmbedder) {
|
||||
this.abort(startUrl);
|
||||
|
|
@ -276,9 +277,9 @@ export default class DocsService {
|
|||
const oldConfig = this.config;
|
||||
this.config = newConfig; // IMPORTANT - need to set up top, other methods below use this without passing it in
|
||||
|
||||
if (this.config.disableIndexing) {
|
||||
return;
|
||||
}
|
||||
// if (this.config.disableIndexing) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// No point in indexing if no docs context provider
|
||||
const hasDocsContextProvider = this.hasDocsContextProvider();
|
||||
|
|
@ -365,12 +366,12 @@ export default class DocsService {
|
|||
|
||||
async indexAndAdd(
|
||||
siteIndexingConfig: SiteIndexingConfig,
|
||||
reIndex: boolean = false,
|
||||
forceReindex: boolean = false,
|
||||
): Promise<void> {
|
||||
if (this.config.disableIndexing) {
|
||||
console.warn("Attempting to add/index docs when indexing is disabled");
|
||||
return;
|
||||
}
|
||||
// if (this.config.disableIndexing) {
|
||||
// console.warn("Attempting to add/index docs when indexing is disabled");
|
||||
// return;
|
||||
// }
|
||||
const { startUrl, useLocalCrawling, maxDepth } = siteIndexingConfig;
|
||||
|
||||
const { isPreindexed, provider } =
|
||||
|
|
@ -396,7 +397,7 @@ export default class DocsService {
|
|||
type: "docs",
|
||||
id: siteIndexingConfig.startUrl,
|
||||
embeddingsProviderId: provider.embeddingId,
|
||||
isReindexing: reIndex && indexExists,
|
||||
isReindexing: forceReindex && indexExists,
|
||||
title: siteIndexingConfig.title,
|
||||
debugInfo: `max depth: ${siteIndexingConfig.maxDepth}`,
|
||||
icon: siteIndexingConfig.faviconUrl,
|
||||
|
|
@ -405,7 +406,7 @@ export default class DocsService {
|
|||
|
||||
// Clear current indexes if reIndexing
|
||||
if (indexExists) {
|
||||
if (reIndex) {
|
||||
if (forceReindex) {
|
||||
await this.deleteIndexes(startUrl);
|
||||
} else {
|
||||
this.handleStatusUpdate({
|
||||
|
|
@ -419,6 +420,46 @@ export default class DocsService {
|
|||
}
|
||||
}
|
||||
|
||||
// If not force-reindexing and has failed with same config, don't reattempt
|
||||
if (!forceReindex) {
|
||||
const globalContext = new GlobalContext();
|
||||
const failedDocs = globalContext.get("failedDocs") ?? [];
|
||||
const hasFailed = failedDocs.find((d) =>
|
||||
this.siteIndexingConfigsAreEqual(siteIndexingConfig, d),
|
||||
);
|
||||
if (hasFailed) {
|
||||
console.log(
|
||||
`Not reattempting to index ${siteIndexingConfig.startUrl}, has already failed with same config`,
|
||||
);
|
||||
this.handleStatusUpdate({
|
||||
...fixedStatus,
|
||||
description: "Failed",
|
||||
status: "failed",
|
||||
progress: 1,
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const markFailedInGlobalContext = () => {
|
||||
const globalContext = new GlobalContext();
|
||||
const failedDocs = globalContext.get("failedDocs") ?? [];
|
||||
const newFailedDocs = failedDocs.filter(
|
||||
(d) => !this.siteIndexingConfigsAreEqual(siteIndexingConfig, d),
|
||||
);
|
||||
newFailedDocs.push(siteIndexingConfig);
|
||||
globalContext.update("failedDocs", newFailedDocs);
|
||||
};
|
||||
|
||||
const removeFromFailedGlobalContext = () => {
|
||||
const globalContext = new GlobalContext();
|
||||
const failedDocs = globalContext.get("failedDocs") ?? [];
|
||||
const newFailedDocs = failedDocs.filter(
|
||||
(d) => !this.siteIndexingConfigsAreEqual(siteIndexingConfig, d),
|
||||
);
|
||||
globalContext.update("failedDocs", newFailedDocs);
|
||||
};
|
||||
|
||||
try {
|
||||
this.docsIndexingQueue.add(startUrl);
|
||||
|
||||
|
|
@ -552,6 +593,7 @@ export default class DocsService {
|
|||
|
||||
void this.ide.showToast("info", `Failed to index ${startUrl}`);
|
||||
this.docsIndexingQueue.delete(startUrl);
|
||||
markFailedInGlobalContext();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -569,7 +611,7 @@ export default class DocsService {
|
|||
});
|
||||
|
||||
// Delete indexed docs if re-indexing
|
||||
if (reIndex && indexExists) {
|
||||
if (forceReindex && indexExists) {
|
||||
console.log("Deleting old embeddings");
|
||||
await this.deleteIndexes(startUrl);
|
||||
}
|
||||
|
|
@ -610,6 +652,8 @@ export default class DocsService {
|
|||
this.messenger?.send("refreshSubmenuItems", {
|
||||
providers: ["docs"],
|
||||
});
|
||||
|
||||
removeFromFailedGlobalContext();
|
||||
} catch (e) {
|
||||
let description = `Error getting docs from: ${siteIndexingConfig.startUrl}`;
|
||||
if (e instanceof Error) {
|
||||
|
|
@ -617,7 +661,7 @@ export default class DocsService {
|
|||
e.message.includes("github.com") &&
|
||||
e.message.includes("rate limit")
|
||||
) {
|
||||
description = "Github rate limit exceeded";
|
||||
description = "Github rate limit exceeded"; // This text is used verbatim elsewhere
|
||||
}
|
||||
}
|
||||
console.error("Error indexing docs", e);
|
||||
|
|
@ -627,6 +671,7 @@ export default class DocsService {
|
|||
status: "failed",
|
||||
progress: 1,
|
||||
});
|
||||
markFailedInGlobalContext();
|
||||
} finally {
|
||||
this.docsIndexingQueue.delete(startUrl);
|
||||
}
|
||||
|
|
@ -908,10 +953,8 @@ export default class DocsService {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
const currentStatus = this.statuses.get(doc.startUrl);
|
||||
if (currentStatus?.status !== "failed") {
|
||||
newDocs.push(doc);
|
||||
}
|
||||
newDocs.push(doc);
|
||||
void Telemetry.capture("add_docs_config", { url: doc.startUrl });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -920,10 +963,6 @@ export default class DocsService {
|
|||
...newDocs.map((doc) => this.indexAndAdd(doc)),
|
||||
]);
|
||||
|
||||
for (const doc of newDocs) {
|
||||
void Telemetry.capture("add_docs_config", { url: doc.startUrl });
|
||||
}
|
||||
|
||||
for (const doc of deletedDocs) {
|
||||
await this.deleteIndexes(doc.startUrl);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -353,6 +353,11 @@ const preIndexedDocs: Record<
|
|||
startUrl: "https://docs.asksage.ai/",
|
||||
rootUrl: "https://docs.asksage.ai/",
|
||||
},
|
||||
"https://angular.dev/": {
|
||||
title: "Angular",
|
||||
startUrl: "https://angular.dev/",
|
||||
rootUrl: "https://angular.dev/",
|
||||
},
|
||||
};
|
||||
|
||||
export default preIndexedDocs;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ModelCapability, TemplateType } from "../index.js";
|
||||
import { ChatMessage, ModelCapability, TemplateType } from "../index.js";
|
||||
|
||||
import {
|
||||
anthropicTemplateMessages,
|
||||
|
|
@ -257,7 +257,10 @@ function autodetectTemplateFunction(
|
|||
const templateType = explicitTemplate ?? autodetectTemplateType(model);
|
||||
|
||||
if (templateType) {
|
||||
const mapping: Record<TemplateType, any> = {
|
||||
const mapping: Record<
|
||||
TemplateType,
|
||||
null | ((msg: ChatMessage[]) => string)
|
||||
> = {
|
||||
llama2: llama2TemplateMessages,
|
||||
alpaca: templateAlpacaMessages,
|
||||
phi2: phi2TemplateMessages,
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ import {
|
|||
toCompleteBody,
|
||||
toFimBody,
|
||||
} from "./openaiTypeConverters.js";
|
||||
import { ModelRole } from "@continuedev/config-yaml";
|
||||
|
||||
export abstract class BaseLLM implements ILLM {
|
||||
static providerName: string;
|
||||
|
|
@ -121,6 +122,7 @@ export abstract class BaseLLM implements ILLM {
|
|||
apiBase?: string;
|
||||
cacheBehavior?: CacheBehavior;
|
||||
capabilities?: ModelCapability;
|
||||
roles?: ModelRole[];
|
||||
|
||||
deployment?: string;
|
||||
apiVersion?: string;
|
||||
|
|
@ -191,7 +193,8 @@ export abstract class BaseLLM implements ILLM {
|
|||
options.model,
|
||||
this.providerName,
|
||||
options.template,
|
||||
);
|
||||
) ??
|
||||
undefined;
|
||||
this.writeLog = options.writeLog;
|
||||
this.llmRequestHook = options.llmRequestHook;
|
||||
this.apiKey = options.apiKey;
|
||||
|
|
@ -208,6 +211,7 @@ export abstract class BaseLLM implements ILLM {
|
|||
}
|
||||
this.accountId = options.accountId;
|
||||
this.capabilities = options.capabilities;
|
||||
this.roles = options.roles;
|
||||
|
||||
this.deployment = options.deployment;
|
||||
this.apiVersion = options.apiVersion;
|
||||
|
|
@ -957,7 +961,9 @@ export abstract class BaseLLM implements ILLM {
|
|||
this.providerName,
|
||||
autodetectTemplateType(this.model),
|
||||
);
|
||||
return templateMessages(rendered);
|
||||
if (templateMessages) {
|
||||
return templateMessages(rendered);
|
||||
}
|
||||
}
|
||||
return rendered;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,14 @@ import * as dotenv from "dotenv";
|
|||
|
||||
import { AssistantChatMessage, CompletionOptions } from "..";
|
||||
|
||||
import { BaseLLM } from ".";
|
||||
import Anthropic from "./llms/Anthropic";
|
||||
import Azure from "./llms/Azure";
|
||||
import Gemini from "./llms/Gemini";
|
||||
import Mistral from "./llms/Mistral";
|
||||
import OpenAI from "./llms/OpenAI";
|
||||
|
||||
import { BaseLLM } from ".";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const COMPLETION_OPTIONS: Partial<CompletionOptions> = {
|
||||
|
|
@ -222,4 +224,25 @@ describe("LLM", () => {
|
|||
}),
|
||||
{ testFim: true, skip: false },
|
||||
);
|
||||
testLLM(
|
||||
new Azure({
|
||||
apiKey: process.env.AZURE_OPENAI_API_KEY,
|
||||
model: "gpt-4o",
|
||||
apiVersion: "2024-05-01-preview",
|
||||
apiBase: "https://continue-azure-openai-instance.openai.azure.com",
|
||||
deployment: "azure-openai-deployment",
|
||||
apiType: "azure-openai",
|
||||
}),
|
||||
{ testFim: false, skip: false, timeout: 20000 },
|
||||
);
|
||||
testLLM(
|
||||
new Azure({
|
||||
apiKey: process.env.AZURE_FOUNDRY_API_KEY,
|
||||
model: "codestral-latest",
|
||||
apiBase:
|
||||
"https://codestral-2501-continue-testing.eastus.models.ai.azure.com",
|
||||
apiType: "azure-foundry",
|
||||
}),
|
||||
{ testFim: false, skip: false, timeout: 20000 },
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class Azure extends OpenAI {
|
|||
|
||||
static defaultOptions: Partial<LLMOptions> = {
|
||||
apiVersion: "2024-02-15-preview",
|
||||
apiType: "azure",
|
||||
apiType: "azure-openai",
|
||||
};
|
||||
|
||||
constructor(options: LLMOptions) {
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class FreeTrial extends BaseLLM {
|
|||
"llama3.1-70b",
|
||||
"gpt-4o",
|
||||
"gpt-3.5-turbo",
|
||||
"claude-3-haiku-20240307",
|
||||
"claude-3-5-haiku-latest",
|
||||
"gemini-1.5-pro-latest",
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ class Novita extends OpenAI {
|
|||
};
|
||||
|
||||
private static MODEL_IDS: { [name: string]: string } = {
|
||||
"deepseek-r1": "deepseek/deepseek-r1",
|
||||
"deepseek_v3": "deepseek/deepseek_v3",
|
||||
"llama3-8b": "meta-llama/llama-3-8b-instruct",
|
||||
"llama3-70b": "meta-llama/llama-3-70b-instruct",
|
||||
"llama3.1-8b": "meta-llama/llama-3.1-8b-instruct",
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ const CHAT_ONLY_MODELS = [
|
|||
"gpt-4o-mini",
|
||||
"o1-preview",
|
||||
"o1-mini",
|
||||
"o3-mini"
|
||||
"o3-mini",
|
||||
];
|
||||
|
||||
const formatMessageForO1 = (messages: ChatCompletionMessageParam[]) => {
|
||||
|
|
@ -206,18 +206,25 @@ class OpenAI extends BaseLLM {
|
|||
protected _getEndpoint(
|
||||
endpoint: "chat/completions" | "completions" | "models",
|
||||
) {
|
||||
if (this.apiType === "azure") {
|
||||
return new URL(
|
||||
`openai/deployments/${this.deployment}/${endpoint}?api-version=${this.apiVersion}`,
|
||||
this.apiBase,
|
||||
);
|
||||
}
|
||||
if (!this.apiBase) {
|
||||
throw new Error(
|
||||
"No API base URL provided. Please set the 'apiBase' option in config.json",
|
||||
);
|
||||
}
|
||||
|
||||
if (this.apiType?.includes("azure")) {
|
||||
// Default is `azure-openai`, but previously was `azure`
|
||||
const isAzureOpenAI =
|
||||
this.apiType === "azure-openai" || this.apiType === "azure";
|
||||
|
||||
const path = isAzureOpenAI
|
||||
? `openai/deployments/${this.deployment}/${endpoint}`
|
||||
: endpoint;
|
||||
|
||||
const version = this.apiVersion ? `?api-version=${this.apiVersion}` : "";
|
||||
return new URL(`${path}${version}`, this.apiBase);
|
||||
}
|
||||
|
||||
return new URL(endpoint, this.apiBase);
|
||||
}
|
||||
|
||||
|
|
@ -267,7 +274,7 @@ class OpenAI extends BaseLLM {
|
|||
body.max_completion_tokens = undefined;
|
||||
}
|
||||
|
||||
if (body.tools?.length) {
|
||||
if (body.tools?.length && !body.model?.startsWith("o3")) {
|
||||
// To ensure schema adherence: https://platform.openai.com/docs/guides/function-calling#parallel-function-calling-and-structured-outputs
|
||||
// In practice, setting this to true and asking for multiple tool calls
|
||||
// leads to "arguments" being something like '{"file": "test.ts"}{"file": "test.js"}'
|
||||
|
|
|
|||
|
|
@ -57,30 +57,34 @@ export function toChatMessage(
|
|||
}
|
||||
return msg;
|
||||
} else {
|
||||
if (typeof message.content === "string") {
|
||||
return {
|
||||
role: "user",
|
||||
content: message.content ?? " ", // LM Studio (and other providers) don't accept empty content
|
||||
};
|
||||
}
|
||||
|
||||
// If no multi-media is in the message, just send as text
|
||||
// for compatibility with OpenAI-"compatible" servers
|
||||
// that don't support multi-media format
|
||||
return {
|
||||
role: "user",
|
||||
content:
|
||||
typeof message.content === "string"
|
||||
? message.content || " " // LM Studio (and other providers) don't accept empty content
|
||||
: // If no multi-media is in the message, just send as text
|
||||
// for compatibility with OpenAI-"compatible" servers
|
||||
// that don't support multi-media format
|
||||
message.content.some((item) => item.type !== "text")
|
||||
? message.content
|
||||
.map((item) => (item as TextMessagePart).text)
|
||||
.join("") || " "
|
||||
: message.content.map((part) => {
|
||||
if (part.type === "imageUrl") {
|
||||
return {
|
||||
type: "image_url" as const,
|
||||
image_url: {
|
||||
url: part.imageUrl.url,
|
||||
detail: "auto" as const,
|
||||
},
|
||||
};
|
||||
}
|
||||
return part;
|
||||
}),
|
||||
content: !message.content.some((item) => item.type !== "text")
|
||||
? message.content
|
||||
.map((item) => (item as TextMessagePart).text)
|
||||
.join("") || " "
|
||||
: message.content.map((part) => {
|
||||
if (part.type === "imageUrl") {
|
||||
return {
|
||||
type: "image_url" as const,
|
||||
image_url: {
|
||||
url: part.imageUrl.url,
|
||||
detail: "auto" as const,
|
||||
},
|
||||
};
|
||||
}
|
||||
return part;
|
||||
}),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<
|
|||
},
|
||||
openai: (model) => {
|
||||
// https://platform.openai.com/docs/guides/function-calling#models-supporting-function-calling
|
||||
if (model.toLowerCase().startsWith("gpt-4")) {
|
||||
if (model.toLowerCase().startsWith("gpt-4") || model.toLowerCase().startsWith("o3")) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
329
core/package-lock.json
generated
329
core/package-lock.json
generated
|
|
@ -13,11 +13,11 @@
|
|||
"@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.23",
|
||||
"@continuedev/config-yaml": "^1.0.29",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
"@modelcontextprotocol/sdk": "^1.0.0",
|
||||
"@modelcontextprotocol/sdk": "^1.5.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
|
|
@ -93,7 +93,7 @@
|
|||
"@types/uuid": "^9.0.7",
|
||||
"@types/win-ca": "^3.5.4",
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild": "0.17.19",
|
||||
"esbuild": "0.24.0",
|
||||
"eslint": "^8",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
|
|
@ -3038,9 +3038,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-yaml": {
|
||||
"version": "1.0.23",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.23.tgz",
|
||||
"integrity": "sha512-F2Hwc85iCwAHJuwJALOsmZIBeHdF+87mS0YT7dlC6QiE+zAhZKUHcLQ/nTt9bJuhyVyufpb9LApkp40UdGsaWw==",
|
||||
"version": "1.0.29",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.29.tgz",
|
||||
"integrity": "sha512-5zKebdoNp52eSFCrs/EODF36I0basrDdE9gQ6Vxoxd9axzVTyWlbpm6gLXXeaHpJMSCaTcQMh/uzAiq8trwrYA==",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"yaml": "^2.6.1",
|
||||
|
|
@ -3077,10 +3077,26 @@
|
|||
"zod": "^3.23.8"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz",
|
||||
"integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"aix"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz",
|
||||
"integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz",
|
||||
"integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
|
|
@ -3090,13 +3106,13 @@
|
|||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz",
|
||||
"integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -3106,13 +3122,13 @@
|
|||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -3122,13 +3138,13 @@
|
|||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz",
|
||||
"integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -3138,13 +3154,13 @@
|
|||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -3154,13 +3170,13 @@
|
|||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz",
|
||||
"integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -3170,13 +3186,13 @@
|
|||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -3186,13 +3202,13 @@
|
|||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz",
|
||||
"integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz",
|
||||
"integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
|
|
@ -3202,13 +3218,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz",
|
||||
"integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -3218,13 +3234,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz",
|
||||
"integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz",
|
||||
"integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
|
|
@ -3234,13 +3250,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz",
|
||||
"integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz",
|
||||
"integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
|
|
@ -3250,13 +3266,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz",
|
||||
"integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz",
|
||||
"integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
|
|
@ -3266,13 +3282,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz",
|
||||
"integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz",
|
||||
"integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
|
|
@ -3282,13 +3298,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz",
|
||||
"integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz",
|
||||
"integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
|
|
@ -3298,13 +3314,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz",
|
||||
"integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz",
|
||||
"integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
|
|
@ -3314,13 +3330,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -3330,13 +3346,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -3346,13 +3362,29 @@
|
|||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-arm64": {
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz",
|
||||
"integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -3362,13 +3394,13 @@
|
|||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -3378,13 +3410,13 @@
|
|||
"sunos"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz",
|
||||
"integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -3394,13 +3426,13 @@
|
|||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz",
|
||||
"integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz",
|
||||
"integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
|
|
@ -3410,13 +3442,13 @@
|
|||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -3426,7 +3458,7 @@
|
|||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint-community/eslint-utils": {
|
||||
|
|
@ -4218,13 +4250,34 @@
|
|||
]
|
||||
},
|
||||
"node_modules/@modelcontextprotocol/sdk": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.0.3.tgz",
|
||||
"integrity": "sha512-2as3cX/VJ0YBHGmdv3GFyTpoM8q2gqE98zh3Vf1NwnsSY0h3mvoO07MUzfygCKkWsFjcZm4otIiqD6Xh7kiSBQ==",
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.5.0.tgz",
|
||||
"integrity": "sha512-IJ+5iVVs8FCumIHxWqpwgkwOzyhtHVKy45s6Ug7Dv0MfRpaYisH8QQ87rIWeWdOzlk8sfhitZ7HCyQZk7d6b8w==",
|
||||
"dependencies": {
|
||||
"content-type": "^1.0.5",
|
||||
"eventsource": "^3.0.2",
|
||||
"raw-body": "^3.0.0",
|
||||
"zod": "^3.23.8"
|
||||
"zod": "^3.23.8",
|
||||
"zod-to-json-schema": "^3.24.1"
|
||||
},
|
||||
"engines": {
|
||||
"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",
|
||||
"integrity": "sha512-3h08nf3Vw3Wl3PK+q3ow/lIil81IT2Oa7YpQyUUDsEWbXveMesdfK1xBd2RhCkynwZndAxixji/7SYJJowr62w==",
|
||||
"peerDependencies": {
|
||||
"zod": "^3.24.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@mozilla/readability": {
|
||||
|
|
@ -7878,40 +7931,42 @@
|
|||
}
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz",
|
||||
"integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz",
|
||||
"integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"bin": {
|
||||
"esbuild": "bin/esbuild"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/android-arm": "0.17.19",
|
||||
"@esbuild/android-arm64": "0.17.19",
|
||||
"@esbuild/android-x64": "0.17.19",
|
||||
"@esbuild/darwin-arm64": "0.17.19",
|
||||
"@esbuild/darwin-x64": "0.17.19",
|
||||
"@esbuild/freebsd-arm64": "0.17.19",
|
||||
"@esbuild/freebsd-x64": "0.17.19",
|
||||
"@esbuild/linux-arm": "0.17.19",
|
||||
"@esbuild/linux-arm64": "0.17.19",
|
||||
"@esbuild/linux-ia32": "0.17.19",
|
||||
"@esbuild/linux-loong64": "0.17.19",
|
||||
"@esbuild/linux-mips64el": "0.17.19",
|
||||
"@esbuild/linux-ppc64": "0.17.19",
|
||||
"@esbuild/linux-riscv64": "0.17.19",
|
||||
"@esbuild/linux-s390x": "0.17.19",
|
||||
"@esbuild/linux-x64": "0.17.19",
|
||||
"@esbuild/netbsd-x64": "0.17.19",
|
||||
"@esbuild/openbsd-x64": "0.17.19",
|
||||
"@esbuild/sunos-x64": "0.17.19",
|
||||
"@esbuild/win32-arm64": "0.17.19",
|
||||
"@esbuild/win32-ia32": "0.17.19",
|
||||
"@esbuild/win32-x64": "0.17.19"
|
||||
"@esbuild/aix-ppc64": "0.24.0",
|
||||
"@esbuild/android-arm": "0.24.0",
|
||||
"@esbuild/android-arm64": "0.24.0",
|
||||
"@esbuild/android-x64": "0.24.0",
|
||||
"@esbuild/darwin-arm64": "0.24.0",
|
||||
"@esbuild/darwin-x64": "0.24.0",
|
||||
"@esbuild/freebsd-arm64": "0.24.0",
|
||||
"@esbuild/freebsd-x64": "0.24.0",
|
||||
"@esbuild/linux-arm": "0.24.0",
|
||||
"@esbuild/linux-arm64": "0.24.0",
|
||||
"@esbuild/linux-ia32": "0.24.0",
|
||||
"@esbuild/linux-loong64": "0.24.0",
|
||||
"@esbuild/linux-mips64el": "0.24.0",
|
||||
"@esbuild/linux-ppc64": "0.24.0",
|
||||
"@esbuild/linux-riscv64": "0.24.0",
|
||||
"@esbuild/linux-s390x": "0.24.0",
|
||||
"@esbuild/linux-x64": "0.24.0",
|
||||
"@esbuild/netbsd-x64": "0.24.0",
|
||||
"@esbuild/openbsd-arm64": "0.24.0",
|
||||
"@esbuild/openbsd-x64": "0.24.0",
|
||||
"@esbuild/sunos-x64": "0.24.0",
|
||||
"@esbuild/win32-arm64": "0.24.0",
|
||||
"@esbuild/win32-ia32": "0.24.0",
|
||||
"@esbuild/win32-x64": "0.24.0"
|
||||
}
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
|
|
@ -8313,6 +8368,25 @@
|
|||
"node": ">=0.8.x"
|
||||
}
|
||||
},
|
||||
"node_modules/eventsource": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.5.tgz",
|
||||
"integrity": "sha512-LT/5J605bx5SNyE+ITBDiM3FxffBiq9un7Vx0EwMDM3vg8sWKx/tO2zC+LMqZ+smAM0F2hblaDZUVZF0te2pSw==",
|
||||
"dependencies": {
|
||||
"eventsource-parser": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eventsource-parser": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.0.tgz",
|
||||
"integrity": "sha512-T1C0XCUimhxVQzW4zFipdx0SficT651NnkR0ZSH3yQwh+mFMdLfgjABVi4YtMTtaL4s168593DaoaRLMqryavA==",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/execa": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
|
||||
|
|
@ -15520,9 +15594,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.21.0.tgz",
|
||||
"integrity": "sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw==",
|
||||
"version": "6.21.1",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.21.1.tgz",
|
||||
"integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.17"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
"@types/uuid": "^9.0.7",
|
||||
"@types/win-ca": "^3.5.4",
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild": "0.17.19",
|
||||
"esbuild": "0.24.0",
|
||||
"eslint": "^8",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
|
|
@ -46,11 +46,11 @@
|
|||
"@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.23",
|
||||
"@continuedev/config-yaml": "^1.0.29",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
"@modelcontextprotocol/sdk": "^1.0.0",
|
||||
"@modelcontextprotocol/sdk": "^1.5.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
|
|
|
|||
|
|
@ -25,15 +25,20 @@ async function renderPromptV1(
|
|||
) {
|
||||
const helpers = getContextProviderHelpers(context);
|
||||
|
||||
// A few context providers that don't need to be in config.json to work in .prompt files
|
||||
const diff = await context.ide.getDiff(true);
|
||||
const currentFile = await context.ide.getCurrentFile();
|
||||
const inputData: Record<string, string> = {
|
||||
diff: diff.join("\n"),
|
||||
input: userInput,
|
||||
};
|
||||
if (currentFile) {
|
||||
inputData.currentFile = currentFile.path;
|
||||
|
||||
// A few context providers that don't need to be in config.json to work in .prompt files
|
||||
if (helpers?.find((helper) => helper[0] === "diff")) {
|
||||
const diff = await context.ide.getDiff(true);
|
||||
inputData.diff = diff.join("\n");
|
||||
}
|
||||
if (helpers?.find((helper) => helper[0] === "currentFile")) {
|
||||
const currentFile = await context.ide.getCurrentFile();
|
||||
if (currentFile) {
|
||||
inputData.currentFile = currentFile.path;
|
||||
}
|
||||
}
|
||||
|
||||
return renderTemplatedString(
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import type {
|
|||
IdeSettings,
|
||||
LLMFullCompletionOptions,
|
||||
ModelDescription,
|
||||
ModelRoles,
|
||||
ExperimentalModelRoles,
|
||||
PromptLog,
|
||||
RangeInFile,
|
||||
SerializedContinueConfig,
|
||||
|
|
@ -28,12 +28,7 @@ import type {
|
|||
ToolCall,
|
||||
} from "../";
|
||||
|
||||
export type OnboardingModes =
|
||||
| "Local"
|
||||
| "Best"
|
||||
| "Custom"
|
||||
| "Quickstart"
|
||||
| "LocalAfterFreeTrial";
|
||||
export type OnboardingModes = "Local" | "Best" | "Custom" | "Quickstart";
|
||||
|
||||
export interface ListHistoryOptions {
|
||||
offset?: number;
|
||||
|
|
@ -57,7 +52,7 @@ export type ToCoreFromIdeOrWebviewProtocol = {
|
|||
"config/addModel": [
|
||||
{
|
||||
model: SerializedContinueConfig["models"][number];
|
||||
role?: keyof ModelRoles;
|
||||
role?: keyof ExperimentalModelRoles;
|
||||
},
|
||||
void,
|
||||
];
|
||||
|
|
@ -191,12 +186,12 @@ export type ToCoreFromIdeOrWebviewProtocol = {
|
|||
|
||||
"profiles/switch": [{ id: string }, undefined];
|
||||
|
||||
"auth/getAuthUrl": [undefined, { url: string }];
|
||||
"auth/getAuthUrl": [{ useOnboarding: boolean }, { url: string }];
|
||||
"tools/call": [
|
||||
{ toolCall: ToolCall; selectedModelTitle: string },
|
||||
{ contextItems: ContextItem[] },
|
||||
];
|
||||
"clipboardCache/add": [{ content: string }, void];
|
||||
"controlPlane/openUrl": [{ path: string }, void];
|
||||
"controlPlane/openUrl": [{ path: string; orgSlug: string | undefined }, void];
|
||||
"controlPlane/listOrganizations": [undefined, OrganizationDescription[]];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -79,10 +79,6 @@ export type ToWebviewFromIdeProtocol = ToWebviewFromIdeOrCoreProtocol & {
|
|||
navigateTo: [{ path: string; toggle?: boolean }, void];
|
||||
addModel: [undefined, void];
|
||||
|
||||
/**
|
||||
* @deprecated Use navigateTo with a path instead.
|
||||
*/
|
||||
viewHistory: [undefined, void];
|
||||
focusContinueSessionId: [{ sessionId: string | undefined }, void];
|
||||
newSession: [undefined, void];
|
||||
setTheme: [{ theme: any }, void];
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export interface IMessenger<
|
|||
ToProtocol extends IProtocol,
|
||||
FromProtocol extends IProtocol,
|
||||
> {
|
||||
onError(handler: (error: Error) => void): void;
|
||||
onError(handler: (message: Message, error: Error) => void): void;
|
||||
send<T extends keyof FromProtocol>(
|
||||
messageType: T,
|
||||
data: FromProtocol[T][0],
|
||||
|
|
@ -64,9 +64,9 @@ export class InProcessMessenger<
|
|||
(message: Message) => any
|
||||
>();
|
||||
|
||||
protected _onErrorHandlers: ((error: Error) => void)[] = [];
|
||||
protected _onErrorHandlers: ((message: Message, error: Error) => void)[] = [];
|
||||
|
||||
onError(handler: (error: Error) => void) {
|
||||
onError(handler: (message: Message, error: Error) => void) {
|
||||
this._onErrorHandlers.push(handler);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,4 +40,5 @@ export type ToWebviewFromIdeOrCoreProtocol = {
|
|||
signInToControlPlane: [undefined, void];
|
||||
openDialogMessage: ["account", void];
|
||||
"docs/suggestions": [PackageDocsResult[], void];
|
||||
"jetbrains/setColors": [Record<string, string>, void];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ContextItem, ToolExtras } from "..";
|
||||
import { ContextItem, Tool, ToolExtras } from "..";
|
||||
import { MCPManagerSingleton } from "../context/mcp";
|
||||
import { BuiltInToolNames } from "./builtIn";
|
||||
|
||||
|
|
@ -86,13 +86,18 @@ async function callToolFromUri(
|
|||
throw new Error(`Failed to call tool: ${toolName}`);
|
||||
}
|
||||
|
||||
return (response.content as any).map((item: any) => {
|
||||
return (response.content as any).map((item: any): ContextItem => {
|
||||
if (item.type !== "text") {
|
||||
throw new Error(
|
||||
`Continue received item of type "${item.type}" from MCP tool, but currently only supports "text".`,
|
||||
);
|
||||
}
|
||||
return { name: toolName, description: toolName, content: item.text };
|
||||
return {
|
||||
name: extras.tool.displayTitle,
|
||||
description: "Tool output",
|
||||
content: item.text,
|
||||
icon: extras.tool.faviconUrl,
|
||||
};
|
||||
});
|
||||
|
||||
default:
|
||||
|
|
@ -101,10 +106,12 @@ async function callToolFromUri(
|
|||
}
|
||||
|
||||
export async function callTool(
|
||||
uri: string,
|
||||
tool: Tool,
|
||||
args: any,
|
||||
extras: ToolExtras,
|
||||
): Promise<ContextItem[]> {
|
||||
const uri = tool.uri ?? tool.function.name;
|
||||
|
||||
switch (uri) {
|
||||
case BuiltInToolNames.ReadFile:
|
||||
return await readFileImpl(args, extras);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import {
|
|||
} from "../config/sharedConfig";
|
||||
|
||||
import { getGlobalContextFilePath } from "./paths";
|
||||
import { SiteIndexingConfig } from "..";
|
||||
|
||||
export type GlobalContextType = {
|
||||
indexingPaused: boolean;
|
||||
|
|
@ -27,6 +28,7 @@ export type GlobalContextType = {
|
|||
showConfigUpdateToast: boolean;
|
||||
isSupportedLanceDbCpuTarget: boolean;
|
||||
sharedConfig: SharedConfigSchema;
|
||||
failedDocs: SiteIndexingConfig[];
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,11 @@ export async function resolveRelativePathInDir(
|
|||
If no meaninful path match just concatenates to first dir's uri
|
||||
*/
|
||||
export async function inferResolvedUriFromRelativePath(
|
||||
relativePath: string,
|
||||
_relativePath: string,
|
||||
ide: IDE,
|
||||
dirCandidates?: string[],
|
||||
): Promise<string> {
|
||||
const relativePath = _relativePath.trim().replaceAll("\\", "/");
|
||||
const dirs = dirCandidates ?? (await ide.getWorkspaceDirs());
|
||||
|
||||
if (dirs.length === 0) {
|
||||
|
|
@ -51,7 +52,7 @@ export async function inferResolvedUriFromRelativePath(
|
|||
suffixes.push(segments.slice(i).join("/"));
|
||||
}
|
||||
|
||||
// For each suffix, try to find a unique matching directory
|
||||
// For each suffix, try to find a unique matching dir/file
|
||||
for (const suffix of suffixes) {
|
||||
const uris = dirs.map((dir) => ({
|
||||
dir,
|
||||
|
|
@ -78,6 +79,13 @@ export async function inferResolvedUriFromRelativePath(
|
|||
}
|
||||
}
|
||||
|
||||
// Sometimes the model will decide to only output the base name or small number of path parts
|
||||
// in which case we shouldn't create a new file if it matches the current file
|
||||
const activeFile = await ide.getCurrentFile();
|
||||
if (activeFile && activeFile.path.endsWith(relativePath)) {
|
||||
return activeFile.path;
|
||||
}
|
||||
|
||||
// If no unique match found, use the first directory
|
||||
return joinPathsToUri(dirs[0], relativePath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ World
|
|||
|
||||
it("should handle strings with only whitespace", () => {
|
||||
const result = dedent`
|
||||
|
||||
|
||||
`;
|
||||
expect(result).toBe("");
|
||||
});
|
||||
|
|
@ -249,9 +249,9 @@ World
|
|||
|
||||
it("should handle a string with only one non-empty line", () => {
|
||||
const result = dedent`
|
||||
|
||||
|
||||
Hello World!
|
||||
|
||||
|
||||
`;
|
||||
expect(result).toBe("Hello World!");
|
||||
});
|
||||
|
|
@ -373,11 +373,16 @@ describe("getMarkdownLanguageTagForFile", () => {
|
|||
expect(getMarkdownLanguageTagForFile("test.py")).toBe("python");
|
||||
expect(getMarkdownLanguageTagForFile("test.tsx")).toBe("tsx");
|
||||
expect(getMarkdownLanguageTagForFile("test.java")).toBe("java");
|
||||
expect(getMarkdownLanguageTagForFile("test.class")).toBe("java");
|
||||
expect(getMarkdownLanguageTagForFile("test.md")).toBe("markdown");
|
||||
expect(getMarkdownLanguageTagForFile("test.sh")).toBe("shell");
|
||||
expect(getMarkdownLanguageTagForFile("test.sql")).toBe("sql");
|
||||
});
|
||||
|
||||
it("should sanitize ranges from the extension", () => {
|
||||
expect(getMarkdownLanguageTagForFile("test.java (1-5)")).toBe("java");
|
||||
});
|
||||
|
||||
it("should return the extension if not in the known list", () => {
|
||||
expect(getMarkdownLanguageTagForFile("file.unknownext")).toBe("unknownext");
|
||||
});
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ export function getMarkdownLanguageTagForFile(filepath: string): string {
|
|||
tsx: "tsx",
|
||||
ts: "typescript",
|
||||
java: "java",
|
||||
class:"java", //.class files decompile to Java
|
||||
go: "go",
|
||||
rb: "ruby",
|
||||
rs: "rust",
|
||||
|
|
@ -96,17 +97,28 @@ export function getMarkdownLanguageTagForFile(filepath: string): string {
|
|||
ps1: "powershell",
|
||||
};
|
||||
|
||||
const ext = filepath.split(".").pop();
|
||||
const ext = sanitizeExtension(filepath.split(".").pop());
|
||||
return ext ? (extToLangMap[ext] ?? ext) : "";
|
||||
}
|
||||
|
||||
|
||||
function sanitizeExtension(ext?: string): string|undefined {
|
||||
if (ext) {
|
||||
//ignore ranges in extension eg. "java (11-23)"
|
||||
const match = ext.match(/^(\S+)\s*(\(.*\))?$/);
|
||||
if (match) {
|
||||
ext = match[1];
|
||||
}
|
||||
}
|
||||
return ext;
|
||||
}
|
||||
|
||||
export function copyOf(obj: any): any {
|
||||
if (obj === null || obj === undefined) {
|
||||
return obj;
|
||||
}
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
``;
|
||||
|
||||
export function deduplicateArray<T>(
|
||||
array: T[],
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export async function isOllamaInstalled(): Promise<boolean> {
|
|||
});
|
||||
}
|
||||
|
||||
export async function startLocalOllama(ide: IDE): Promise<void> {
|
||||
export async function startLocalOllama(ide: IDE): Promise<any> {
|
||||
let startCommand: string | undefined;
|
||||
|
||||
switch (process.platform) {
|
||||
|
|
@ -20,16 +20,16 @@ export async function startLocalOllama(ide: IDE): Promise<void> {
|
|||
break;
|
||||
|
||||
case "win32"://Windows
|
||||
startCommand = `& "ollama app.exe"\n`;
|
||||
startCommand = "& \"ollama app.exe\"\n";
|
||||
break;
|
||||
|
||||
default: //Linux...
|
||||
const start_script_path = path.resolve(__dirname, './start_ollama.sh');
|
||||
const start_script_path = path.resolve(__dirname, "./start_ollama.sh");
|
||||
if (await ide.fileExists(`file:/${start_script_path}`)) {
|
||||
startCommand = `set -e && chmod +x ${start_script_path} && ${start_script_path}\n`;
|
||||
console.log(`Ollama Linux startup script at : ${start_script_path}`);
|
||||
} else {
|
||||
ide.showToast("error", `Cannot start Ollama: could not find ${start_script_path}!`)
|
||||
return ide.showToast("error", `Cannot start Ollama: could not find ${start_script_path}!`)
|
||||
}
|
||||
}
|
||||
if (startCommand) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ You can create a project-specific system message by adding a `.continuerules` fi
|
|||
- If you want concise answers:
|
||||
|
||||
```title=.continuerules
|
||||
Please provide concise answers. Do explain obvious concepts. You can assume that I am knowledgable about most programming topics.
|
||||
Please provide concise answers. Don't explain obvious concepts. You can assume that I am knowledgable about most programming topics.
|
||||
```
|
||||
|
||||
- If you want to ensure certain practices are followed, for example in React:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Azure AI Foundry is a cloud-based service that provides access to models from Op
|
|||
|
||||
:::info
|
||||
|
||||
For details on OpenAI model setup, see [Azure OpenAI Service configuration](#general-model-configuration).
|
||||
For details on OpenAI model setup, see [Azure OpenAI Service configuration](#azure-openai-service-configuration).
|
||||
|
||||
:::
|
||||
|
||||
|
|
@ -22,7 +22,8 @@ We recommend configuring **GPT-4o** as your chat model.
|
|||
"model": "gpt-4o",
|
||||
"apiBase": "<YOUR_DEPLOYMENT_BASE>",
|
||||
"deployment": "<YOUR_DEPLOYMENT_NAME>",
|
||||
"apiKey": "<MY_API_KEY>" // If you use subscription key, try using Azure gateway to rename it apiKey
|
||||
"apiKey": "<MY_API_KEY>", // If you use subscription key, try using Azure gateway to rename it apiKey
|
||||
"apiType": "azure-foundry" // Or "azure-openai" if using OpenAI models
|
||||
}]
|
||||
```
|
||||
|
||||
|
|
@ -46,12 +47,12 @@ We recommend configuring **text-embedding-3-large** as your embeddings model.
|
|||
|
||||
```json title="config.json"
|
||||
"embeddingsProvider": {
|
||||
"provider": "openai",
|
||||
"provider": "azure",
|
||||
"model": "text-embedding-3-large",
|
||||
"apiBase": "<YOUR_DEPLOYMENT_BASE>",
|
||||
"deployment": "<YOUR_DEPLOYMENT_NAME>",
|
||||
"apiType": "azure",
|
||||
"apiKey": "<MY_API_KEY>"
|
||||
"apiKey": "<MY_API_KEY>",
|
||||
"apiType": "azure-foundry" // Or "azure-openai" if using OpenAI models
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -66,9 +67,7 @@ Azure OpenAI currently does not offer any reranking models.
|
|||
If you'd like to use OpenAI models but are concerned about privacy, you can use the Azure OpenAI service, which is GDPR and HIPAA compliant.
|
||||
|
||||
:::info[Getting access]
|
||||
You need to apply for access to the Azure OpenAI service. Response times are typically within a few days.
|
||||
|
||||
**[Click here to apply for access to the Azure OpenAI service](https://azure.microsoft.com/en-us/products/ai-services/openai-service)**
|
||||
[Click here](https://azure.microsoft.com/en-us/products/ai-services/openai-service) to apply for access to the Azure OpenAI service. Response times are typically within a few days.
|
||||
:::
|
||||
|
||||
## Azure OpenAI Service configuration
|
||||
|
|
@ -83,10 +82,11 @@ For example, a Target URI of `https://just-an-example.openai.azure.com/openai/de
|
|||
{
|
||||
"title": "GPT-4o Azure",
|
||||
"model": "gpt-4o",
|
||||
"provider": "openai",
|
||||
"provider": "azure",
|
||||
"apiBase": "https://just-an-example.openai.azure.com",
|
||||
"deployment": "gpt-4o-july",
|
||||
"apiVersion": "2023-03-15-preview",
|
||||
"apiKey": "<MY_API_KEY>"
|
||||
"apiKey": "<MY_API_KEY>",
|
||||
"apiType": "azure-openai"
|
||||
}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -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.87
|
||||
pluginVersion=0.0.89
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -113,7 +113,8 @@ class NewContinueSessionAction : AnAction() {
|
|||
class ViewHistoryAction : AnAction() {
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
val continuePluginService = getContinuePluginService(e.project) ?: return
|
||||
continuePluginService.sendToWebview("viewHistory", null)
|
||||
val params = mapOf("path" to "/history", "toggle" to true)
|
||||
continuePluginService.sendToWebview("navigateTo", params)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import com.intellij.openapi.vfs.newvfs.BulkFileListener
|
|||
import com.intellij.openapi.vfs.newvfs.events.VFileEvent
|
||||
import com.intellij.openapi.vfs.newvfs.events.VFileDeleteEvent
|
||||
import com.intellij.openapi.vfs.newvfs.events.VFileContentChangeEvent
|
||||
import com.intellij.ide.ui.LafManagerListener
|
||||
|
||||
fun showTutorial(project: Project) {
|
||||
val tutorialFileName = getTutorialFileName()
|
||||
|
|
@ -47,7 +48,15 @@ fun showTutorial(project: Project) {
|
|||
throw IOException("Resource not found: $tutorialFileName")
|
||||
}
|
||||
var content = StreamUtil.readText(`is`, StandardCharsets.UTF_8)
|
||||
|
||||
// All jetbrains will use J instead of L
|
||||
content = content.replace("[Cmd + L]", "[Cmd + J]")
|
||||
content = content.replace("[Cmd + Shift + L]", "[Cmd + Shift + J]")
|
||||
|
||||
if (!System.getProperty("os.name").lowercase().contains("mac")) {
|
||||
content = content.replace("[Cmd + J]", "[Ctrl + J]")
|
||||
content = content.replace("[Cmd + Shift + J]", "[Ctrl + Shift + J]")
|
||||
content = content.replace("[Cmd + I]", "[Ctrl + I]")
|
||||
content = content.replace("⌘", "⌃")
|
||||
}
|
||||
val filepath = Paths.get(getContinueGlobalPath(), tutorialFileName).toString()
|
||||
|
|
@ -174,7 +183,7 @@ class ContinuePluginStartupActivity : StartupActivity, DumbAware {
|
|||
val changedURIs = events.filterIsInstance<VFileContentChangeEvent>()
|
||||
.mapNotNull { event -> event.file.toUriOrNull() }
|
||||
|
||||
// Send "files/changed" message if there are any content changes
|
||||
// Notify core of content changes
|
||||
if (changedURIs.isNotEmpty()) {
|
||||
val data = mapOf("files" to changedURIs)
|
||||
continuePluginService.coreMessenger?.request("files/changed", data, null) { _ -> }
|
||||
|
|
@ -182,6 +191,15 @@ class ContinuePluginStartupActivity : StartupActivity, DumbAware {
|
|||
}
|
||||
})
|
||||
|
||||
// Listen for theme changes
|
||||
connection.subscribe(LafManagerListener.TOPIC, LafManagerListener {
|
||||
val colors = GetTheme().getTheme();
|
||||
continuePluginService.sendToWebview(
|
||||
"jetbrains/setColors",
|
||||
colors
|
||||
)
|
||||
})
|
||||
|
||||
// Listen for clicking settings button to start the auth flow
|
||||
val authService = service<ContinueAuthService>()
|
||||
val initialSessionInfo = authService.loadControlPlaneSessionInfo()
|
||||
|
|
@ -196,7 +214,7 @@ class ContinuePluginStartupActivity : StartupActivity, DumbAware {
|
|||
|
||||
connection.subscribe(AuthListener.TOPIC, object : AuthListener {
|
||||
override fun startAuthFlow() {
|
||||
authService.startAuthFlow(project)
|
||||
authService.startAuthFlow(project, false)
|
||||
}
|
||||
|
||||
override fun handleUpdatedSessionInfo(sessionInfo: ControlPlaneSessionInfo?) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ import javax.swing.JComponent
|
|||
import javax.swing.JPanel
|
||||
import java.awt.BorderLayout
|
||||
|
||||
class ContinueAuthDialog(private val onTokenEntered: (String) -> Unit) : DialogWrapper(true) {
|
||||
class ContinueAuthDialog(private val useOnboarding: Boolean, private val onTokenEntered: (String) -> Unit) :
|
||||
DialogWrapper(true) {
|
||||
private val tokenField = JBTextField()
|
||||
|
||||
init {
|
||||
|
|
@ -17,7 +18,9 @@ class ContinueAuthDialog(private val onTokenEntered: (String) -> Unit) : DialogW
|
|||
|
||||
override fun createCenterPanel(): JComponent {
|
||||
val panel = JPanel(BorderLayout())
|
||||
panel.add(JBLabel("Please enter your Continue authentication token:"), BorderLayout.NORTH)
|
||||
val message =
|
||||
if (useOnboarding) "After onboarding you will be shown an authentication token. Please enter it here:" else "Please enter your Continue authentication token:"
|
||||
panel.add(JBLabel(message), BorderLayout.NORTH)
|
||||
panel.add(tokenField, BorderLayout.CENTER)
|
||||
return panel
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,8 +33,18 @@ class ContinueAuthService {
|
|||
private const val REFRESH_TOKEN_KEY = "ContinueRefreshToken"
|
||||
private const val ACCOUNT_ID_KEY = "ContinueAccountId"
|
||||
private const val ACCOUNT_LABEL_KEY = "ContinueAccountLabel"
|
||||
private const val CONTROL_PLANE_URL = "https://control-plane-api-service-i3dqylpbqa-uc.a.run.app"
|
||||
// private const val CONTROL_PLANE_URL = "http://localhost:3001"
|
||||
}
|
||||
|
||||
private fun getControlPlaneUrl(): String {
|
||||
val env = service<ContinueExtensionSettings>().continueState.continueTestEnvironment;
|
||||
when (env) {
|
||||
"none" -> return "https://control-plane-api-service-i3dqylpbqa-uc.a.run.app"
|
||||
"local" -> return "http://localhost:3001"
|
||||
"production" -> return "https://api.continue.dev"
|
||||
"test" -> return "https://api-test.continue.dev"
|
||||
}
|
||||
|
||||
return "https://control-plane-api-service-i3dqylpbqa-uc.a.run.app"
|
||||
}
|
||||
|
||||
init {
|
||||
|
|
@ -44,13 +54,13 @@ class ContinueAuthService {
|
|||
}
|
||||
}
|
||||
|
||||
fun startAuthFlow(project: Project) {
|
||||
fun startAuthFlow(project: Project, useOnboarding: Boolean) {
|
||||
// Open login page
|
||||
openSignInPage(project)
|
||||
openSignInPage(project, useOnboarding)
|
||||
|
||||
// Open a dialog where the user should paste their sign-in token
|
||||
ApplicationManager.getApplication().invokeLater {
|
||||
val dialog = ContinueAuthDialog() { token ->
|
||||
val dialog = ContinueAuthDialog(useOnboarding) { token ->
|
||||
// Store the token
|
||||
updateRefreshToken(token)
|
||||
}
|
||||
|
|
@ -78,10 +88,12 @@ class ContinueAuthService {
|
|||
val lastName = user?.get("lastName") as? String
|
||||
val label = "$firstName $lastName"
|
||||
val id = user?.get("id") as? String
|
||||
val email = user?.get("email") as? String
|
||||
|
||||
// Persist the session info
|
||||
setRefreshToken(refreshToken!!)
|
||||
val sessionInfo = ControlPlaneSessionInfo(accessToken!!, ControlPlaneSessionInfo.Account(id!!, label))
|
||||
val sessionInfo =
|
||||
ControlPlaneSessionInfo(accessToken!!, ControlPlaneSessionInfo.Account(email!!, label))
|
||||
setControlPlaneSessionInfo(sessionInfo)
|
||||
|
||||
// Notify listeners
|
||||
|
|
@ -111,7 +123,7 @@ class ContinueAuthService {
|
|||
|
||||
private suspend fun refreshToken(refreshToken: String) = withContext(Dispatchers.IO) {
|
||||
val client = OkHttpClient()
|
||||
val url = URL(CONTROL_PLANE_URL).toURI().resolve("/auth/refresh").toURL()
|
||||
val url = URL(getControlPlaneUrl()).toURI().resolve("/auth/refresh").toURL()
|
||||
val jsonBody = mapOf("refreshToken" to refreshToken)
|
||||
val jsonString = Gson().toJson(jsonBody)
|
||||
val requestBody = jsonString.toRequestBody("application/json".toMediaType())
|
||||
|
|
@ -132,9 +144,13 @@ class ContinueAuthService {
|
|||
}
|
||||
|
||||
|
||||
private fun openSignInPage(project: Project) {
|
||||
private fun openSignInPage(project: Project, useOnboarding: Boolean) {
|
||||
val coreMessenger = project.service<ContinuePluginService>().coreMessenger
|
||||
coreMessenger?.request("auth/getAuthUrl", null, null) { response ->
|
||||
coreMessenger?.request(
|
||||
"auth/getAuthUrl", mapOf(
|
||||
"useOnboarding" to useOnboarding
|
||||
), null
|
||||
) { response ->
|
||||
val authUrl = ((response as? Map<*, *>)?.get("content") as? Map<*, *>)?.get("url") as? String
|
||||
if (authUrl != null) {
|
||||
// Open the auth URL in the browser
|
||||
|
|
@ -208,7 +224,7 @@ class ContinueAuthService {
|
|||
val accountId = getAccountId()
|
||||
val accountLabel = getAccountLabel()
|
||||
|
||||
return if (accessToken != null && accountId != null && accountLabel != null) {
|
||||
return if ((accessToken != null && accessToken != "") && accountId != null && accountLabel != null) {
|
||||
ControlPlaneSessionInfo(
|
||||
accessToken = accessToken,
|
||||
account = ControlPlaneSessionInfo.Account(
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.github.continuedev.continueintellijextension.autocomplete
|
|||
import com.intellij.openapi.application.invokeLater
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.EditorKind
|
||||
import com.intellij.openapi.editor.event.*
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager
|
||||
import com.intellij.openapi.fileEditor.FileEditorManagerEvent
|
||||
|
|
@ -11,6 +12,10 @@ import com.intellij.openapi.util.TextRange
|
|||
|
||||
class AutocompleteCaretListener : CaretListener {
|
||||
override fun caretPositionChanged(event: CaretEvent) {
|
||||
if(event.editor.editorKind != EditorKind.MAIN_EDITOR) {
|
||||
return
|
||||
}
|
||||
|
||||
val caret = event.caret ?: return
|
||||
val offset = caret.offset
|
||||
val editor = caret.editor
|
||||
|
|
|
|||
|
|
@ -41,6 +41,18 @@ class MessageTypes {
|
|||
"logoutOfControlPlane",
|
||||
"getTerminalContents",
|
||||
"showToast",
|
||||
"openUrl",
|
||||
|
||||
// These only come from the GUI for now but should be here to prevent confusion
|
||||
"toggleDevTools",
|
||||
"showTutorial",
|
||||
|
||||
// These are jetbrains only and only come from the GUI for now
|
||||
// But again including for consistency
|
||||
"copyText",
|
||||
"jetbrains/isOSREnabled",
|
||||
"jetbrains/getColors",
|
||||
"jetbrains/onLoad"
|
||||
)
|
||||
|
||||
// Note: If updating these values, make a corresponding update in
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
package com.github.continuedev.continueintellijextension.`continue`
|
||||
|
||||
import com.intellij.codeInsight.template.impl.TemplateColors
|
||||
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors
|
||||
import com.intellij.openapi.editor.colors.EditorColors
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager
|
||||
import com.intellij.openapi.editor.colors.EditorColorsScheme
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey
|
||||
import java.awt.Color
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
import com.intellij.ui.JBColor
|
||||
import com.intellij.ui.ColorUtil
|
||||
|
||||
class GetTheme {
|
||||
fun getSecondaryDark(): Color {
|
||||
|
|
@ -42,53 +39,60 @@ class GetTheme {
|
|||
}
|
||||
|
||||
fun getTheme(): Map<String, String> {
|
||||
fun toHex(color: Color): String {
|
||||
return String.format("#%02x%02x%02x", color.red, color.green, color.blue)
|
||||
}
|
||||
try {
|
||||
val globalScheme = EditorColorsManager.getInstance().globalScheme
|
||||
val defaultBackground = globalScheme.defaultBackground
|
||||
val defaultForeground = globalScheme.defaultForeground
|
||||
val highlight = globalScheme.getColor(EditorColors.MODIFIED_TAB_ICON_COLOR) ?: defaultForeground
|
||||
val defaultBackgroundHex =
|
||||
String.format("#%02x%02x%02x", defaultBackground.red, defaultBackground.green, defaultBackground.blue)
|
||||
val defaultForegroundHex =
|
||||
String.format("#%02x%02x%02x", defaultForeground.red, defaultForeground.green, defaultForeground.blue)
|
||||
val highlightHex = String.format("#%02x%02x%02x", highlight.red, highlight.green, highlight.blue)
|
||||
val background = JBColor.background()
|
||||
val foreground = JBColor.foreground()
|
||||
|
||||
val grayscale =
|
||||
(defaultBackground.red * 0.3 + defaultBackground.green * 0.59 + defaultBackground.blue * 0.11).toInt()
|
||||
val buttonBackground = JBColor.namedColor("Button.background", Color(230, 230, 230))
|
||||
val buttonForeground = JBColor.namedColor("Button.foreground", Color(0, 0, 0))
|
||||
|
||||
val adjustedRed: Int
|
||||
val adjustedGreen: Int
|
||||
val adjustedBlue: Int
|
||||
val badgeBackground = JBColor.namedColor("Badge.background", Color(150, 150, 150))
|
||||
val badgeForeground = JBColor.namedColor("Badge.foreground", Color(0, 0, 0))
|
||||
|
||||
val tint: Int = 20
|
||||
if (grayscale > 128) { // if closer to white
|
||||
adjustedRed = max(0, defaultBackground.red - tint)
|
||||
adjustedGreen = max(0, defaultBackground.green - tint)
|
||||
adjustedBlue = max(0, defaultBackground.blue - tint)
|
||||
} else { // if closer to black
|
||||
adjustedRed = min(255, defaultBackground.red + tint)
|
||||
adjustedGreen = min(255, defaultBackground.green + tint)
|
||||
adjustedBlue = min(255, defaultBackground.blue + tint)
|
||||
}
|
||||
val inputBackground = JBColor.namedColor("TextField.background", Color(255, 255, 255))
|
||||
|
||||
val secondaryDarkHex = String.format("#%02x%02x%02x", adjustedRed, adjustedGreen, adjustedBlue)
|
||||
val border = JBColor.border()
|
||||
val focusBorder = JBColor.namedColor("Focus.borderColor", Color(100, 100, 255))
|
||||
val editorScheme = EditorColorsManager.getInstance().globalScheme
|
||||
|
||||
return mapOf(
|
||||
"--vscode-editor-foreground" to defaultForegroundHex,
|
||||
"--vscode-sideBar-background" to defaultBackgroundHex,
|
||||
"--vscode-input-background" to secondaryDarkHex,
|
||||
"--vscode-editor-background" to defaultBackgroundHex,
|
||||
"--vscode-button-background" to defaultBackgroundHex,
|
||||
"--vscode-list-activeSelectionBackground" to defaultBackgroundHex,
|
||||
"--vscode-focusBorder" to highlightHex,
|
||||
"--vscode-quickInputList-focusForeground" to defaultForegroundHex,
|
||||
"--vscode-quickInput-background" to secondaryDarkHex,
|
||||
"--vscode-input-border" to "#80808080",
|
||||
"--vscode-badge-background" to highlightHex,
|
||||
"--vscode-badge-foreground" to defaultForegroundHex,
|
||||
"--vscode-sideBar-border" to "#80808080"
|
||||
val editorBackground = editorScheme.defaultBackground
|
||||
val editorForeground = editorScheme.defaultForeground
|
||||
|
||||
val actionHoverBackground = JBColor.namedColor("ActionButton.hoverBackground", Color(220, 220, 220))
|
||||
|
||||
val findMatchBackground = editorScheme.getAttributes(EditorColors.SEARCH_RESULT_ATTRIBUTES)?.backgroundColor ?: Color(255, 221, 0)
|
||||
|
||||
val theme = mapOf(
|
||||
"--vscode-editor-foreground" to toHex(editorForeground),
|
||||
"--vscode-editor-background" to toHex(editorBackground),
|
||||
|
||||
"--vscode-button-background" to toHex(buttonBackground),
|
||||
"--vscode-button-foreground" to toHex(buttonForeground),
|
||||
|
||||
"--vscode-list-activeSelectionBackground" to toHex(actionHoverBackground) + "50",
|
||||
|
||||
"--vscode-quickInputList-focusForeground" to toHex(foreground),
|
||||
"--vscode-quickInput-background" to toHex(inputBackground),
|
||||
|
||||
"--vscode-badge-background" to toHex(badgeBackground),
|
||||
"--vscode-badge-foreground" to toHex(badgeForeground),
|
||||
|
||||
"--vscode-input-background" to toHex(inputBackground),
|
||||
"--vscode-input-border" to toHex(border),
|
||||
"--vscode-sideBar-background" to toHex(background),
|
||||
"--vscode-sideBar-border" to toHex(border),
|
||||
"--vscode-focusBorder" to toHex(focusBorder),
|
||||
|
||||
"--vscode-commandCenter-activeBorder" to toHex(focusBorder),
|
||||
"--vscode-commandCenter-inactiveBorder" to toHex(border),
|
||||
|
||||
"--vscode-editor-findMatchHighlightBackground" to toHex(findMatchBackground) + "40"
|
||||
)
|
||||
|
||||
return theme
|
||||
} catch (error: Error) {
|
||||
return mapOf()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,27 +43,12 @@ class IdeProtocolClient(
|
|||
)
|
||||
}
|
||||
|
||||
private fun send(messageType: String, data: Any?, messageId: String? = null) {
|
||||
val id = messageId ?: uuid()
|
||||
continuePluginService.sendToWebview(messageType, data, id)
|
||||
}
|
||||
|
||||
fun handleMessage(msg: String, respond: (Any?) -> Unit) {
|
||||
coroutineScope.launch(Dispatchers.IO) {
|
||||
val message = Gson().fromJson(msg, Message::class.java)
|
||||
val messageType = message.messageType
|
||||
val dataElement = message.data
|
||||
|
||||
// A couple oddball messages respond directly to GUI, expect a different message format
|
||||
// e.g. jetbrains/isOSREnabled
|
||||
fun respondToWebview(content: Any) {
|
||||
respond(mutableMapOf(
|
||||
"done" to true,
|
||||
"status" to "success",
|
||||
"content" to content
|
||||
))
|
||||
}
|
||||
|
||||
try {
|
||||
when (messageType) {
|
||||
"toggleDevTools" -> {
|
||||
|
|
@ -77,12 +62,12 @@ class IdeProtocolClient(
|
|||
"jetbrains/isOSREnabled" -> {
|
||||
val isOSREnabled =
|
||||
ServiceManager.getService(ContinueExtensionSettings::class.java).continueState.enableOSR
|
||||
respondToWebview(isOSREnabled)
|
||||
respond(isOSREnabled)
|
||||
}
|
||||
|
||||
"jetbrains/getColors" -> {
|
||||
val colors = GetTheme().getTheme();
|
||||
respondToWebview(colors)
|
||||
respond(colors)
|
||||
}
|
||||
|
||||
"jetbrains/onLoad" -> {
|
||||
|
|
@ -92,7 +77,7 @@ class IdeProtocolClient(
|
|||
"vscMachineId" to getMachineUniqueID(),
|
||||
"vscMediaUrl" to "http://continue",
|
||||
)
|
||||
respondToWebview(jsonData)
|
||||
respond(jsonData)
|
||||
}
|
||||
|
||||
"getIdeSettings" -> {
|
||||
|
|
@ -111,7 +96,7 @@ class IdeProtocolClient(
|
|||
val sessionInfo = authService.loadControlPlaneSessionInfo()
|
||||
respond(sessionInfo)
|
||||
} else {
|
||||
authService.startAuthFlow(project)
|
||||
authService.startAuthFlow(project, params.useOnboarding)
|
||||
respond(null)
|
||||
}
|
||||
}
|
||||
|
|
@ -121,6 +106,10 @@ class IdeProtocolClient(
|
|||
authService.signOut()
|
||||
ApplicationManager.getApplication().messageBus.syncPublisher(AuthListener.TOPIC)
|
||||
.handleUpdatedSessionInfo(null)
|
||||
|
||||
// Tell the webview that session info changed
|
||||
continuePluginService.sendToWebview("didChangeControlPlaneSessionInfo", null, uuid())
|
||||
|
||||
respond(null)
|
||||
}
|
||||
|
||||
|
|
@ -593,11 +582,11 @@ class IdeProtocolClient(
|
|||
|
||||
|
||||
fun sendAcceptRejectDiff(accepted: Boolean, stepIndex: Int) {
|
||||
send("acceptRejectDiff", AcceptRejectDiff(accepted, stepIndex), uuid())
|
||||
continuePluginService.sendToWebview("acceptRejectDiff", AcceptRejectDiff(accepted, stepIndex), uuid())
|
||||
}
|
||||
|
||||
fun deleteAtIndex(index: Int) {
|
||||
send("deleteAtIndex", DeleteAtIndex(index), uuid())
|
||||
continuePluginService.sendToWebview("deleteAtIndex", DeleteAtIndex(index), uuid())
|
||||
}
|
||||
|
||||
private fun getModelByRole(
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.github.continuedev.continueintellijextension.utils.OS
|
|||
import com.github.continuedev.continueintellijextension.utils.getMachineUniqueID
|
||||
import com.github.continuedev.continueintellijextension.utils.getOS
|
||||
import com.github.continuedev.continueintellijextension.utils.toUriOrNull
|
||||
import com.google.gson.Gson
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightInfo
|
||||
import com.intellij.execution.configurations.GeneralCommandLine
|
||||
import com.intellij.execution.util.ExecUtil
|
||||
|
|
@ -31,6 +32,10 @@ import com.intellij.psi.PsiDocumentManager
|
|||
import com.intellij.testFramework.LightVirtualFile
|
||||
import com.intellij.util.containers.toArray
|
||||
import kotlinx.coroutines.*
|
||||
import okhttp3.MediaType.Companion.toMediaType
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import okhttp3.RequestBody.Companion.toRequestBody
|
||||
import java.awt.Desktop
|
||||
import java.awt.Toolkit
|
||||
import java.awt.datatransfer.DataFlavor
|
||||
|
|
@ -39,6 +44,7 @@ import java.io.File
|
|||
import java.io.FileInputStream
|
||||
import java.io.InputStreamReader
|
||||
import java.net.URI
|
||||
import java.net.URL
|
||||
import java.nio.charset.Charset
|
||||
import java.nio.file.Paths
|
||||
|
||||
|
|
@ -85,14 +91,50 @@ 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
|
||||
}
|
||||
|
||||
override suspend fun getIdeSettings(): IdeSettings {
|
||||
val settings = service<ContinueExtensionSettings>()
|
||||
|
||||
|
||||
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,
|
||||
pauseCodebaseIndexOnStart = false, // TODO: Needs to be implemented
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ import java.awt.geom.AffineTransform
|
|||
import java.awt.geom.Path2D
|
||||
import java.awt.geom.RoundRectangle2D
|
||||
import javax.swing.*
|
||||
import javax.swing.border.EmptyBorder
|
||||
import javax.swing.event.DocumentEvent
|
||||
import javax.swing.event.DocumentListener
|
||||
import javax.swing.event.ListDataListener
|
||||
|
|
@ -73,8 +72,8 @@ fun makePanel(
|
|||
onReject: () -> Unit
|
||||
): JPanel {
|
||||
val topPanel =
|
||||
ShadowPanel(MigLayout("wrap 1, insets 2 ${leftInset} 2 2, gap 0!")).apply {
|
||||
background = JBColor(0x20888888.toInt(), 0x20888888.toInt())
|
||||
ShadowPanel(MigLayout("wrap 1, insets 2 $leftInset 2 2, gap 0!")).apply {
|
||||
background = JBColor(0x20888888, 0x20888888)
|
||||
isOpaque = false
|
||||
}
|
||||
|
||||
|
|
@ -374,7 +373,7 @@ class CustomPanel(
|
|||
val closeIcon = IconLoader.getIcon("/icons/close.svg", javaClass)
|
||||
return JLabel(closeIcon).apply {
|
||||
background = Color(0, 0, 0, 0)
|
||||
border = EmptyBorder(2, 6, 2, 0)
|
||||
border = JBUI.Borders.empty(2, 6, 2, 0)
|
||||
toolTipText = "`esc` to cancel"
|
||||
isOpaque = false
|
||||
addMouseListener(
|
||||
|
|
@ -406,7 +405,7 @@ class CustomPanel(
|
|||
background = defaultBackground
|
||||
foreground = Color(128, 128, 128, 200)
|
||||
font = UIUtil.getFontWithFallback("Arial", Font.PLAIN, 12)
|
||||
border = EmptyBorder(8, 8, 8, 8)
|
||||
border = JBUI.Borders.empty(8)
|
||||
isOpaque = false
|
||||
isEditable = false
|
||||
cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)
|
||||
|
|
@ -423,7 +422,7 @@ class CustomPanel(
|
|||
val component =
|
||||
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus)
|
||||
if (component is JLabel) {
|
||||
component.border = EmptyBorder(4, 6, 4, 6)
|
||||
component.border = JBUI.Borders.empty(4, 6)
|
||||
}
|
||||
return component
|
||||
}
|
||||
|
|
@ -451,9 +450,9 @@ class CustomPanel(
|
|||
val rightButton =
|
||||
CustomButton("⏎ Enter") { onEnter() }
|
||||
.apply {
|
||||
background = JBColor(0x999998.toInt(), 0x999998.toInt())
|
||||
foreground = JBColor(0xF5F5F5.toInt(), 0xF5F5F5.toInt())
|
||||
border = EmptyBorder(2, 6, 2, 6)
|
||||
background = globalScheme.defaultForeground
|
||||
foreground = globalScheme.defaultBackground
|
||||
border = JBUI.Borders.empty(2, 6)
|
||||
}
|
||||
|
||||
val rightPanel = JPanel(MigLayout("insets 0, fillx")).apply {
|
||||
|
|
@ -461,7 +460,7 @@ class CustomPanel(
|
|||
add(rightButton, "align right")
|
||||
}
|
||||
|
||||
border = EmptyBorder(0, 0, 16, 12)
|
||||
border = JBUI.Borders.empty(0, 0, 16, 12)
|
||||
isOpaque = false
|
||||
|
||||
add(dropdown, "align left")
|
||||
|
|
@ -477,7 +476,7 @@ class CustomPanel(
|
|||
val progressBar = JProgressBar().apply { isIndeterminate = true }
|
||||
|
||||
add(progressBar, BorderLayout.CENTER)
|
||||
border = BorderFactory.createEmptyBorder(0, 0, 16, 12)
|
||||
border = JBUI.Borders.empty(0, 0, 16, 12)
|
||||
}
|
||||
|
||||
private val subPanelC: JPanel =
|
||||
|
|
@ -486,21 +485,19 @@ class CustomPanel(
|
|||
JLabel("Type to re-prompt").apply {
|
||||
foreground = Color(156, 163, 175) // text-gray-400
|
||||
font = UIUtil.getFontWithFallback("Arial", Font.PLAIN, 11)
|
||||
border = EmptyBorder(0, 4, 0, 0)
|
||||
border = JBUI.Borders.emptyLeft(4)
|
||||
}
|
||||
|
||||
val leftButton =
|
||||
CustomButton("Reject All (${getMetaKeyLabel()}${getShiftKeyLabel()}⌫)") { onReject() }
|
||||
.apply {
|
||||
background = JBColor(0x30FF0000.toInt(), 0x30FF0000.toInt())
|
||||
foreground = JBColor(0xF5F5F5.toInt(), 0xF5F5F5.toInt())
|
||||
background = JBColor(0x30FF0000, 0x30FF0000)
|
||||
}
|
||||
|
||||
val rightButton =
|
||||
CustomButton("Accept All (${getMetaKeyLabel()}${getShiftKeyLabel()}⏎)") { onAccept() }
|
||||
.apply {
|
||||
background = JBColor(0x3000FF00.toInt(), 0x3000FF00.toInt())
|
||||
foreground = JBColor(0xF5F5F5.toInt(), 0xF5F5F5.toInt())
|
||||
background = JBColor(0x3000FF00, 0x3000FF00)
|
||||
}
|
||||
|
||||
val rightPanel =
|
||||
|
|
@ -508,12 +505,12 @@ class CustomPanel(
|
|||
isOpaque = false
|
||||
add(leftButton, "align right")
|
||||
add(rightButton, "align right")
|
||||
border = EmptyBorder(0, 0, 0, 0)
|
||||
border = JBUI.Borders.empty()
|
||||
}
|
||||
|
||||
add(leftLabel, "align left")
|
||||
add(rightPanel, "align right")
|
||||
border = BorderFactory.createEmptyBorder(0, 0, 16, 12)
|
||||
border = JBUI.Borders.empty(0, 0, 16, 12)
|
||||
isOpaque = false
|
||||
}
|
||||
|
||||
|
|
@ -625,7 +622,7 @@ class CustomButton(text: String, onClick: () -> Unit) : JLabel(text, CENTER) {
|
|||
})
|
||||
|
||||
font = UIUtil.getFontWithFallback("Arial", Font.PLAIN, 11)
|
||||
border = EmptyBorder(2, 6, 2, 6)
|
||||
border = JBUI.Borders.empty(2, 6)
|
||||
}
|
||||
|
||||
override fun paintComponent(g: Graphics) {
|
||||
|
|
@ -694,7 +691,7 @@ class TransparentArrowButtonUI : BasicComboBoxUI() {
|
|||
}
|
||||
|
||||
override fun getInsets(): Insets {
|
||||
return JBUI.insets(0, 6, 0, 0)
|
||||
return JBUI.insetsLeft(6)
|
||||
}
|
||||
|
||||
override fun installUI(c: JComponent?) {
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ import com.intellij.openapi.project.Project
|
|||
import com.intellij.openapi.util.TextRange
|
||||
import com.intellij.ui.JBColor
|
||||
import com.intellij.util.application
|
||||
import com.intellij.util.ui.JBUI
|
||||
import java.awt.*
|
||||
import javax.swing.BorderFactory
|
||||
import javax.swing.JButton
|
||||
import javax.swing.JTextArea
|
||||
import kotlin.math.min
|
||||
|
|
@ -25,8 +25,8 @@ class VerticalDiffBlock(
|
|||
var startLine: Int,
|
||||
private val onAcceptReject: (VerticalDiffBlock, Boolean) -> Unit
|
||||
) {
|
||||
val deletedLines: MutableList<String> = mutableListOf();
|
||||
val addedLines: MutableList<String> = mutableListOf();
|
||||
val deletedLines: MutableList<String> = mutableListOf()
|
||||
val addedLines: MutableList<String> = mutableListOf()
|
||||
private val acceptButton: JButton
|
||||
private val rejectButton: JButton
|
||||
private var deletionInlay: Disposable? = null
|
||||
|
|
@ -155,10 +155,10 @@ class VerticalDiffBlock(
|
|||
val rejectBtn =
|
||||
createButton(
|
||||
"${getAltKeyLabel()}${getShiftKeyLabel()}N",
|
||||
JBColor(0x99FF0000.toInt(), 0x99FF0000.toInt())
|
||||
JBColor(0x77FF0000, 0x77FF0000)
|
||||
).apply {
|
||||
addActionListener {
|
||||
handleReject();
|
||||
handleReject()
|
||||
onAcceptReject(this@VerticalDiffBlock, false)
|
||||
}
|
||||
|
||||
|
|
@ -168,10 +168,10 @@ class VerticalDiffBlock(
|
|||
createButton(
|
||||
"${getAltKeyLabel()}${
|
||||
getShiftKeyLabel()
|
||||
}Y", JBColor(0x7700BB00.toInt(), 0x7700BB00.toInt())
|
||||
}Y", JBColor(0x7700BB00, 0x7700BB00)
|
||||
).apply {
|
||||
addActionListener {
|
||||
handleAccept();
|
||||
handleAccept()
|
||||
onAcceptReject(this@VerticalDiffBlock, true)
|
||||
}
|
||||
}
|
||||
|
|
@ -215,9 +215,9 @@ class VerticalDiffBlock(
|
|||
|
||||
private fun createDeletionTextArea(text: String) = JTextArea(text).apply {
|
||||
isEditable = false
|
||||
background = JBColor(0x30FF0000.toInt(), 0x30FF0000.toInt())
|
||||
background = JBColor(0x30FF0000, 0x30FF0000)
|
||||
foreground = JBColor.GRAY
|
||||
border = BorderFactory.createEmptyBorder()
|
||||
border = JBUI.Borders.empty()
|
||||
lineWrap = false
|
||||
wrapStyleWord = false
|
||||
font = editor.colorsScheme.getFont(EditorFontType.PLAIN)
|
||||
|
|
@ -250,7 +250,7 @@ class VerticalDiffBlock(
|
|||
font = Font("Arial", Font.BOLD, 9)
|
||||
isContentAreaFilled = false
|
||||
isOpaque = false
|
||||
border = BorderFactory.createEmptyBorder(4, 2, 4, 2)
|
||||
border = JBUI.Borders.empty(4, 2)
|
||||
preferredSize = Dimension(preferredSize.width - 30, 14)
|
||||
cursor = Cursor(Cursor.HAND_CURSOR)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.github.continuedev.continueintellijextension.protocol
|
|||
|
||||
import com.github.continuedev.continueintellijextension.*
|
||||
|
||||
data class GetControlPlaneSessionInfoParams(val silent: Boolean)
|
||||
data class GetControlPlaneSessionInfoParams(val silent: Boolean, val useOnboarding: Boolean)
|
||||
|
||||
data class WriteFileParams(
|
||||
val path: String,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.github.continuedev.continueintellijextension.services
|
|||
|
||||
import com.github.continuedev.continueintellijextension.constants.getConfigJsPath
|
||||
import com.github.continuedev.continueintellijextension.constants.getConfigJsonPath
|
||||
import com.intellij.execution.target.value.constant
|
||||
import com.intellij.openapi.application.ApplicationInfo
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.components.*
|
||||
|
|
@ -33,6 +34,7 @@ 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()
|
||||
|
|
@ -66,6 +68,8 @@ 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
|
||||
|
|
@ -98,6 +102,7 @@ open class ContinueExtensionSettings : PersistentStateComponent<ContinueExtensio
|
|||
var enableOSR: Boolean = shouldRenderOffScreen()
|
||||
var displayEditorTooltip: Boolean = true
|
||||
var showIDECompletionSideBySide: Boolean = false
|
||||
var continueTestEnvironment: String = "none"
|
||||
}
|
||||
|
||||
var continueState: ContinueState = ContinueState()
|
||||
|
|
@ -211,7 +216,8 @@ class ContinueExtensionConfigurable : Configurable {
|
|||
mySettingsComponent?.enableContinueTeamsBeta?.isSelected != settings.continueState.enableContinueTeamsBeta ||
|
||||
mySettingsComponent?.enableOSR?.isSelected != settings.continueState.enableOSR ||
|
||||
mySettingsComponent?.displayEditorTooltip?.isSelected != settings.continueState.displayEditorTooltip ||
|
||||
mySettingsComponent?.showIDECompletionSideBySide?.isSelected != settings.continueState.showIDECompletionSideBySide
|
||||
mySettingsComponent?.showIDECompletionSideBySide?.isSelected != settings.continueState.showIDECompletionSideBySide ||
|
||||
(if (mySettingsComponent?.enableContinueHub?.isSelected == true) settings.continueState.continueTestEnvironment != "production" else settings.continueState.continueTestEnvironment == "production")
|
||||
return modified
|
||||
}
|
||||
|
||||
|
|
@ -227,6 +233,8 @@ class ContinueExtensionConfigurable : Configurable {
|
|||
settings.continueState.displayEditorTooltip = mySettingsComponent?.displayEditorTooltip?.isSelected ?: true
|
||||
settings.continueState.showIDECompletionSideBySide =
|
||||
mySettingsComponent?.showIDECompletionSideBySide?.isSelected ?: false
|
||||
settings.continueState.continueTestEnvironment =
|
||||
if (mySettingsComponent?.enableContinueHub?.isSelected == true) "production" else "none"
|
||||
|
||||
ApplicationManager.getApplication().messageBus.syncPublisher(SettingsListener.TOPIC)
|
||||
.settingsUpdated(settings.continueState)
|
||||
|
|
@ -244,6 +252,8 @@ class ContinueExtensionConfigurable : Configurable {
|
|||
mySettingsComponent?.displayEditorTooltip?.isSelected = settings.continueState.displayEditorTooltip
|
||||
mySettingsComponent?.showIDECompletionSideBySide?.isSelected =
|
||||
settings.continueState.showIDECompletionSideBySide
|
||||
mySettingsComponent?.enableContinueHub?.isSelected =
|
||||
settings.continueState.continueTestEnvironment == "production"
|
||||
|
||||
ContinueExtensionSettings.instance.addRemoteSyncJob()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ class ContinueBrowser(val project: Project, url: String) {
|
|||
ContinuePluginService::class.java
|
||||
)
|
||||
|
||||
|
||||
val respond = fun(data: Any?) {
|
||||
sendToWebview(messageType, data, messageId ?: uuid())
|
||||
}
|
||||
|
|
@ -63,8 +62,18 @@ class ContinueBrowser(val project: Project, url: String) {
|
|||
return@addHandler null
|
||||
}
|
||||
|
||||
// If not pass through, then put it in the status/content/done format for webview
|
||||
// Core already sends this format
|
||||
val respondToWebview = fun(data: Any?) {
|
||||
sendToWebview(messageType, mapOf(
|
||||
"status" to "success",
|
||||
"content" to data,
|
||||
"done" to true
|
||||
), messageId ?: uuid())
|
||||
}
|
||||
|
||||
if (msg != null) {
|
||||
continuePluginService.ideProtocolClient?.handleMessage(msg, respond)
|
||||
continuePluginService.ideProtocolClient?.handleMessage(msg, respondToWebview)
|
||||
}
|
||||
|
||||
null
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ data class IdeSettings(
|
|||
val userToken: String,
|
||||
val enableControlServerBeta: Boolean,
|
||||
val pauseCodebaseIndexOnStart: Boolean,
|
||||
val continueTestEnvironment: String
|
||||
)
|
||||
|
||||
data class ContinueRcJson(
|
||||
|
|
|
|||
|
|
@ -1,17 +1,24 @@
|
|||
/* _________ _____ _____
|
||||
__ ____/______ _______ __ /____(_)_______ ____ _______
|
||||
_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
|
||||
/ /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
|
||||
\____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
|
||||
// _________ _____ _____
|
||||
// __ ____/______ _______ __ /____(_)_______ ____ _______
|
||||
// _ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
|
||||
// / /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
|
||||
// \____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
|
||||
//
|
||||
// Chat, Edit, and Autocomplete tutorial
|
||||
//
|
||||
|
||||
Chat, Edit, and Autocomplete tutorial
|
||||
*/
|
||||
// ———————————————————————————————————————————————— Setup ————————————————————————————————————————————————-
|
||||
|
||||
// First, open the Continue sidebar by pressing [Cmd + L] or clicking the Continue icon.
|
||||
|
||||
/* ————————————————————————————————————————————————— Chat ————————————————————————————————————————————————— */
|
||||
// See an example at https://docs.continue.dev/getting-started/install
|
||||
|
||||
// Follow the instructions in the sidebar to set up a Chat/Edit modela and an Autocomplete model.
|
||||
|
||||
// ————————————————————————————————————————————————— Chat —————————————————————————————————————————————————
|
||||
|
||||
// Highlight the code below
|
||||
// Press [Cmd/Ctrl + J] to add to Chat
|
||||
// Press [Cmd + L] to add to Chat
|
||||
// Try asking Continue "what sorting algorithm is this?"
|
||||
public static int[] sortingAlgorithm(int[] x) {
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
|
|
@ -26,10 +33,13 @@ public static int[] sortingAlgorithm(int[] x) {
|
|||
return x;
|
||||
}
|
||||
|
||||
/* ————————————————————————————————————————————————— Edit ————————————————————————————————————————————————— */
|
||||
// [Cmd + L] always starts a new chat. Now, try the same thing using [Cmd + Shift + L].
|
||||
// This will add the code into the current chat
|
||||
|
||||
// ————————————————————————————————————————————————— Edit —————————————————————————————————————————————————
|
||||
|
||||
// Highlight the code below
|
||||
// Press [Cmd/Ctrl + I] to Edit
|
||||
// Press [Cmd + I] to Edit
|
||||
// Try asking Continue to "make this more readable"
|
||||
public static int[] sortingAlgorithm2(int[] x) {
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
|
|
@ -44,12 +54,15 @@ public static int[] sortingAlgorithm2(int[] x) {
|
|||
return x;
|
||||
}
|
||||
|
||||
/* ————————————————————————————————————————————— Autocomplete —————————————————————————————————————————————— */
|
||||
// ————————————————————————————————————————————— Autocomplete ——————————————————————————————————————————————
|
||||
|
||||
// Place cursor after `sortingAlgorithm...` below and press [Enter]
|
||||
// Place cursor after `sortingAlgorithm:` below and press [Enter]
|
||||
// Press [Tab] to accept the Autocomplete suggestion
|
||||
|
||||
// Basic assertion for sortingAlgorithm...
|
||||
// Basic assertion for sortingAlgorithm:
|
||||
|
||||
|
||||
/* —————————————————— Learn more at https://docs.continue.dev/getting-started/overview ——————————————————— */
|
||||
|
||||
// —————————————————————————————————————————————- Learn More -——————————————————————————————————————————————
|
||||
|
||||
// Visit the Continue Docs at https://docs.continue.dev/getting-started/overview
|
||||
|
|
|
|||
|
|
@ -7,11 +7,18 @@
|
|||
Chat, Edit, and Autocomplete tutorial
|
||||
"""
|
||||
|
||||
# ———————————————————————————————————————————————— Setup ————————————————————————————————————————————————-
|
||||
|
||||
# ————————————————————————————————————————————————— Chat ————————————————————————————————————————————————— #
|
||||
# First, open the Continue sidebar by pressing [Cmd + L] or clicking the Continue icon.
|
||||
|
||||
# See an example at https://docs.continue.dev/getting-started/install
|
||||
|
||||
# Follow the instructions in the sidebar to set up a Chat/Edit modela and an Autocomplete model.
|
||||
|
||||
# ————————————————————————————————————————————————— Chat —————————————————————————————————————————————————
|
||||
|
||||
## Highlight the code below
|
||||
## Press [Cmd/Ctrl + J] to add to Chat
|
||||
## Press [Cmd + L] to add to Chat
|
||||
## Try asking Continue "what sorting algorithm is this?"
|
||||
def sorting_algorithm(x):
|
||||
for i in range(len(x)):
|
||||
|
|
@ -20,11 +27,13 @@ def sorting_algorithm(x):
|
|||
x[j], x[j + 1] = x[j + 1], x[j]
|
||||
return x
|
||||
|
||||
# [Cmd + L] always starts a new chat. Now, try the same thing using [Cmd + Shift + L].
|
||||
# This will add the code into the current chat
|
||||
|
||||
# ————————————————————————————————————————————————— Edit ————————————————————————————————————————————————— #
|
||||
# ————————————————————————————————————————————————— Edit —————————————————————————————————————————————————
|
||||
|
||||
## Highlight the code below
|
||||
## Press [Cmd/Ctrl + I] to Edit
|
||||
## Press [Cmd + I] to Edit
|
||||
## Try asking Continue to "make this more readable"
|
||||
def sorting_algorithm(x):
|
||||
for i in range(len(x)):
|
||||
|
|
@ -33,12 +42,16 @@ def sorting_algorithm(x):
|
|||
x[j], x[j + 1] = x[j + 1], x[j]
|
||||
return x
|
||||
|
||||
# ————————————————————————————————————————————— Autocomplete —————————————————————————————————————————————— #
|
||||
# ————————————————————————————————————————————— Autocomplete ——————————————————————————————————————————————
|
||||
|
||||
## Place cursor after `sorting_algorithm...` below and press [Enter]
|
||||
## Place cursor after `sorting_algorithm:` below and press [Enter]
|
||||
## Press [Tab] to accept the Autocomplete suggestion
|
||||
|
||||
# Basic assertion for sorting_algorithm...
|
||||
# Basic assertion for sorting_algorithm:
|
||||
|
||||
|
||||
# —————————————————— Learn more at https://docs.continue.dev/getting-started/overview ——————————————————— #
|
||||
|
||||
|
||||
# —————————————————————————————————————————————- Learn More -——————————————————————————————————————————————
|
||||
|
||||
# Visit the Continue Docs at https://docs.continue.dev/getting-started/overview
|
||||
|
|
|
|||
|
|
@ -1,17 +1,24 @@
|
|||
/* _________ _____ _____
|
||||
__ ____/______ _______ __ /____(_)_______ ____ _______
|
||||
_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
|
||||
/ /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
|
||||
\____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
|
||||
// _________ _____ _____
|
||||
// __ ____/______ _______ __ /____(_)_______ ____ _______
|
||||
// _ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
|
||||
// / /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
|
||||
// \____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
|
||||
//
|
||||
// Chat, Edit, and Autocomplete tutorial
|
||||
//
|
||||
|
||||
Chat, Edit, and Autocomplete tutorial
|
||||
*/
|
||||
// ———————————————————————————————————————————————— Setup ————————————————————————————————————————————————-
|
||||
|
||||
// First, open the Continue sidebar by pressing [Cmd + L] or clicking the Continue icon.
|
||||
|
||||
/* ————————————————————————————————————————————————— Chat ————————————————————————————————————————————————— */
|
||||
// See an example at https://docs.continue.dev/getting-started/install
|
||||
|
||||
// Follow the instructions in the sidebar to set up a Chat/Edit modela and an Autocomplete model.
|
||||
|
||||
// ————————————————————————————————————————————————— Chat —————————————————————————————————————————————————
|
||||
|
||||
// Highlight the code below
|
||||
// Press [Cmd/Ctrl + J] to add to Chat
|
||||
// Press [Cmd + L] to add to Chat
|
||||
// Try asking Continue "what sorting algorithm is this?"
|
||||
function sortingAlgorithm(x: number[]): number[] {
|
||||
for (let i = 0; i < x.length; i++) {
|
||||
|
|
@ -26,10 +33,13 @@ function sortingAlgorithm(x: number[]): number[] {
|
|||
return x;
|
||||
}
|
||||
|
||||
/* ————————————————————————————————————————————————— Edit ————————————————————————————————————————————————— */
|
||||
// [Cmd + L] always starts a new chat. Now, try the same thing using [Cmd + Shift + L].
|
||||
// This will add the code into the current chat
|
||||
|
||||
// ————————————————————————————————————————————————— Edit —————————————————————————————————————————————————
|
||||
|
||||
// Highlight the code below
|
||||
// Press [Cmd/Ctrl + I] to Edit
|
||||
// Press [Cmd + I] to Edit
|
||||
// Try asking Continue to "make this more readable"
|
||||
function sortingAlgorithm2(x: number[]): number[] {
|
||||
for (let i = 0; i < x.length; i++) {
|
||||
|
|
@ -44,12 +54,13 @@ function sortingAlgorithm2(x: number[]): number[] {
|
|||
return x;
|
||||
}
|
||||
|
||||
/* ————————————————————————————————————————————— Autocomplete —————————————————————————————————————————————— */
|
||||
// ————————————————————————————————————————————— Autocomplete ——————————————————————————————————————————————
|
||||
|
||||
// Place cursor after `sortingAlgorithm...` below and press [Enter]
|
||||
// Place cursor after `sortingAlgorithm:` below and press [Enter]
|
||||
// Press [Tab] to accept the Autocomplete suggestion
|
||||
|
||||
// Basic assertion for sortingAlgorithm...
|
||||
// Basic assertion for sortingAlgorithm:
|
||||
|
||||
// —————————————————————————————————————————————- Learn More -——————————————————————————————————————————————
|
||||
|
||||
/* —————————————————— Learn more at https://docs.continue.dev/getting-started/overview ——————————————————— */
|
||||
// Visit the Continue Docs at https://docs.continue.dev/getting-started/overview
|
||||
|
|
|
|||
|
|
@ -936,7 +936,8 @@
|
|||
"gemini-1.5-flash-latest",
|
||||
"gemini-1.5-flash",
|
||||
"gemini-1.5-flash-8b",
|
||||
"gemini-2.0-flash-exp"
|
||||
"gemini-2.0-flash-exp",
|
||||
"gemini-2.0-flash"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -998,6 +999,8 @@
|
|||
"anyOf": [
|
||||
{
|
||||
"enum": [
|
||||
"deepseek-r1",
|
||||
"deepseek_v3",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"llama3.1-8b",
|
||||
|
|
@ -1680,33 +1683,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"ModelRoles": {
|
||||
"title": "ModelRoles",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"default": {
|
||||
"title": "Default",
|
||||
"description": "The default model. If other model roles are not set, they will fall back to default.",
|
||||
"type": "string"
|
||||
},
|
||||
"chat": {
|
||||
"title": "Chat",
|
||||
"description": "The model to use for chat. If not set, will fall back to default.",
|
||||
"type": "string"
|
||||
},
|
||||
"edit": {
|
||||
"title": "Edit",
|
||||
"description": "The model to use for editing. If not set, will fall back to default.",
|
||||
"type": "string"
|
||||
},
|
||||
"summarize": {
|
||||
"title": "Summarize",
|
||||
"description": "The model to use for summarization. If not set, will fall back to default.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["default"]
|
||||
},
|
||||
"SlashCommand": {
|
||||
"title": "SlashCommand",
|
||||
"type": "object",
|
||||
|
|
|
|||
326
extensions/vscode/package-lock.json
generated
326
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.9.260",
|
||||
"version": "0.9.265",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.9.260",
|
||||
"version": "0.9.265",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/fetch": "^1.0.3",
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
"dbinfoz": "^0.14.0",
|
||||
"diff": "^7.0.0",
|
||||
"downshift": "^7.6.0",
|
||||
"esbuild": "^0.17.19",
|
||||
"esbuild": "0.24.0",
|
||||
"express": "^4.18.2",
|
||||
"fkill": "^8.1.0",
|
||||
"follow-redirects": "^1.15.4",
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
"socket.io-client": "^4.7.2",
|
||||
"strip-ansi": "^7.1.0",
|
||||
"svg-builder": "^2.0.0",
|
||||
"systeminformation": "^5.22.10",
|
||||
"systeminformation": "^5.23.7",
|
||||
"tailwindcss": "^3.3.2",
|
||||
"undici": "^6.2.0",
|
||||
"uuid": "^9.0.1",
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
"@vscode/vsce": "^2.22.0",
|
||||
"cargo-cp-artifact": "^0.1",
|
||||
"chai": "^4.5.0",
|
||||
"esbuild": "0.17.19",
|
||||
"esbuild": "0.24.0",
|
||||
"esbuild-visualizer": "^0.6.0",
|
||||
"eslint": "^8.28.0",
|
||||
"glob": "^8.0.3",
|
||||
|
|
@ -106,11 +106,11 @@
|
|||
"@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.23",
|
||||
"@continuedev/config-yaml": "^1.0.29",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
"@modelcontextprotocol/sdk": "^1.0.0",
|
||||
"@modelcontextprotocol/sdk": "^1.5.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
|
|
@ -186,7 +186,7 @@
|
|||
"@types/uuid": "^9.0.7",
|
||||
"@types/win-ca": "^3.5.4",
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild": "0.17.19",
|
||||
"esbuild": "0.24.0",
|
||||
"eslint": "^8",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
|
|
@ -758,10 +758,26 @@
|
|||
"node": ">=12.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz",
|
||||
"integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"aix"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz",
|
||||
"integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz",
|
||||
"integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
|
|
@ -771,13 +787,13 @@
|
|||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz",
|
||||
"integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -787,13 +803,13 @@
|
|||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -803,13 +819,13 @@
|
|||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz",
|
||||
"integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -819,13 +835,13 @@
|
|||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -835,13 +851,13 @@
|
|||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz",
|
||||
"integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -851,13 +867,13 @@
|
|||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -867,13 +883,13 @@
|
|||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz",
|
||||
"integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz",
|
||||
"integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
|
|
@ -883,13 +899,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz",
|
||||
"integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -899,13 +915,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz",
|
||||
"integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz",
|
||||
"integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
|
|
@ -915,13 +931,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz",
|
||||
"integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz",
|
||||
"integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
|
|
@ -931,13 +947,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz",
|
||||
"integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz",
|
||||
"integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
|
|
@ -947,13 +963,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz",
|
||||
"integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz",
|
||||
"integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
|
|
@ -963,13 +979,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz",
|
||||
"integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz",
|
||||
"integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
|
|
@ -979,13 +995,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz",
|
||||
"integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz",
|
||||
"integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
|
|
@ -995,13 +1011,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1011,13 +1027,13 @@
|
|||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1027,13 +1043,29 @@
|
|||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-arm64": {
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz",
|
||||
"integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1043,13 +1075,13 @@
|
|||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1059,13 +1091,13 @@
|
|||
"sunos"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz",
|
||||
"integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1075,13 +1107,13 @@
|
|||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz",
|
||||
"integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz",
|
||||
"integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
|
|
@ -1091,13 +1123,13 @@
|
|||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz",
|
||||
"integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1107,7 +1139,7 @@
|
|||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint-community/eslint-utils": {
|
||||
|
|
@ -5320,40 +5352,42 @@
|
|||
}
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz",
|
||||
"integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==",
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz",
|
||||
"integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"bin": {
|
||||
"esbuild": "bin/esbuild"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/android-arm": "0.17.19",
|
||||
"@esbuild/android-arm64": "0.17.19",
|
||||
"@esbuild/android-x64": "0.17.19",
|
||||
"@esbuild/darwin-arm64": "0.17.19",
|
||||
"@esbuild/darwin-x64": "0.17.19",
|
||||
"@esbuild/freebsd-arm64": "0.17.19",
|
||||
"@esbuild/freebsd-x64": "0.17.19",
|
||||
"@esbuild/linux-arm": "0.17.19",
|
||||
"@esbuild/linux-arm64": "0.17.19",
|
||||
"@esbuild/linux-ia32": "0.17.19",
|
||||
"@esbuild/linux-loong64": "0.17.19",
|
||||
"@esbuild/linux-mips64el": "0.17.19",
|
||||
"@esbuild/linux-ppc64": "0.17.19",
|
||||
"@esbuild/linux-riscv64": "0.17.19",
|
||||
"@esbuild/linux-s390x": "0.17.19",
|
||||
"@esbuild/linux-x64": "0.17.19",
|
||||
"@esbuild/netbsd-x64": "0.17.19",
|
||||
"@esbuild/openbsd-x64": "0.17.19",
|
||||
"@esbuild/sunos-x64": "0.17.19",
|
||||
"@esbuild/win32-arm64": "0.17.19",
|
||||
"@esbuild/win32-ia32": "0.17.19",
|
||||
"@esbuild/win32-x64": "0.17.19"
|
||||
"@esbuild/aix-ppc64": "0.24.0",
|
||||
"@esbuild/android-arm": "0.24.0",
|
||||
"@esbuild/android-arm64": "0.24.0",
|
||||
"@esbuild/android-x64": "0.24.0",
|
||||
"@esbuild/darwin-arm64": "0.24.0",
|
||||
"@esbuild/darwin-x64": "0.24.0",
|
||||
"@esbuild/freebsd-arm64": "0.24.0",
|
||||
"@esbuild/freebsd-x64": "0.24.0",
|
||||
"@esbuild/linux-arm": "0.24.0",
|
||||
"@esbuild/linux-arm64": "0.24.0",
|
||||
"@esbuild/linux-ia32": "0.24.0",
|
||||
"@esbuild/linux-loong64": "0.24.0",
|
||||
"@esbuild/linux-mips64el": "0.24.0",
|
||||
"@esbuild/linux-ppc64": "0.24.0",
|
||||
"@esbuild/linux-riscv64": "0.24.0",
|
||||
"@esbuild/linux-s390x": "0.24.0",
|
||||
"@esbuild/linux-x64": "0.24.0",
|
||||
"@esbuild/netbsd-x64": "0.24.0",
|
||||
"@esbuild/openbsd-arm64": "0.24.0",
|
||||
"@esbuild/openbsd-x64": "0.24.0",
|
||||
"@esbuild/sunos-x64": "0.24.0",
|
||||
"@esbuild/win32-arm64": "0.24.0",
|
||||
"@esbuild/win32-ia32": "0.24.0",
|
||||
"@esbuild/win32-x64": "0.24.0"
|
||||
}
|
||||
},
|
||||
"node_modules/esbuild-visualizer": {
|
||||
|
|
@ -5735,9 +5769,10 @@
|
|||
"integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw=="
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "4.21.1",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz",
|
||||
"integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==",
|
||||
"version": "4.21.2",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
|
||||
"integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "~1.3.8",
|
||||
"array-flatten": "1.1.1",
|
||||
|
|
@ -5758,7 +5793,7 @@
|
|||
"methods": "~1.1.2",
|
||||
"on-finished": "2.4.1",
|
||||
"parseurl": "~1.3.3",
|
||||
"path-to-regexp": "0.1.10",
|
||||
"path-to-regexp": "0.1.12",
|
||||
"proxy-addr": "~2.0.7",
|
||||
"qs": "6.13.0",
|
||||
"range-parser": "~1.2.1",
|
||||
|
|
@ -5773,6 +5808,10 @@
|
|||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/express/node_modules/debug": {
|
||||
|
|
@ -9098,15 +9137,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.7",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
|
||||
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||
"version": "3.3.8",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
|
||||
"integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
|
|
@ -10059,9 +10099,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "0.1.10",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
|
||||
"integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w=="
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
|
||||
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/path-type": {
|
||||
"version": "4.0.0",
|
||||
|
|
@ -12168,9 +12209,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/systeminformation": {
|
||||
"version": "5.23.5",
|
||||
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.23.5.tgz",
|
||||
"integrity": "sha512-PEpJwhRYxZgBCAlWZhWIgfMTjXLqfcaZ1pJsJn9snWNfBW/Z1YQg1mbIUSWrEV3ErAHF7l/OoVLQeaZDlPzkpA==",
|
||||
"version": "5.25.11",
|
||||
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.25.11.tgz",
|
||||
"integrity": "sha512-jI01fn/t47rrLTQB0FTlMCC+5dYx8o0RRF+R4BPiUNsvg5OdY0s9DKMFmJGrx5SwMZQ4cag0Gl6v8oycso9b/g==",
|
||||
"license": "MIT",
|
||||
"os": [
|
||||
"darwin",
|
||||
"linux",
|
||||
|
|
@ -12911,9 +12953,10 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "6.20.1",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.20.1.tgz",
|
||||
"integrity": "sha512-AjQF1QsmqfJys+LXfGTNum+qw4S88CojRInG/6t31W/1fk6G59s92bnAvGz5Cmur+kQv2SURXEvvudLmbrE8QA==",
|
||||
"version": "6.21.1",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.21.1.tgz",
|
||||
"integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.17"
|
||||
}
|
||||
|
|
@ -13309,10 +13352,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "4.5.5",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.5.tgz",
|
||||
"integrity": "sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==",
|
||||
"version": "4.5.9",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.9.tgz",
|
||||
"integrity": "sha512-qK9W4xjgD3gXbC0NmdNFFnVFLMWSNiR3swj957yutwzzN16xF/E7nmtAyp1rT9hviDroQANjE4HK3H4WqWdFtw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.18.10",
|
||||
"postcss": "^8.4.27",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "continue",
|
||||
"icon": "media/icon.png",
|
||||
"author": "Continue Dev, Inc",
|
||||
"version": "0.9.260",
|
||||
"version": "0.9.265",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/continuedev/continue"
|
||||
|
|
@ -213,7 +213,7 @@
|
|||
{
|
||||
"command": "continue.toggleFullScreen",
|
||||
"category": "Continue",
|
||||
"title": "Toggle Full Screen",
|
||||
"title": "Open in new window",
|
||||
"icon": "$(link-external)",
|
||||
"group": "Continue"
|
||||
},
|
||||
|
|
@ -580,7 +580,8 @@
|
|||
{
|
||||
"type": "webview",
|
||||
"id": "continue.continueGUIView",
|
||||
"name": "",
|
||||
"name": "Continue",
|
||||
"icon": "media/sidebar-icon.png",
|
||||
"visibility": "visible"
|
||||
}
|
||||
]
|
||||
|
|
@ -623,7 +624,7 @@
|
|||
"e2e:build": "npm --prefix ../../gui run build && npm run package",
|
||||
"e2e:create-storage": "mkdir -p ./e2e/storage",
|
||||
"e2e:get-chromedriver": "extest get-chromedriver --storage ./e2e/storage",
|
||||
"e2e:get-vscode": "extest get-vscode --storage ./e2e/storage",
|
||||
"e2e:get-vscode": "CODE_VERSION=\"1.95.0\" extest get-vscode --storage ./e2e/storage",
|
||||
"e2e:sign-vscode": "codesign --entitlements entitlements.plist --deep --force -s - './e2e/storage/Visual Studio Code.app'",
|
||||
"e2e:copy-vsix": "chmod +x ./e2e/get-latest-vsix.sh && bash ./e2e/get-latest-vsix.sh",
|
||||
"e2e:install-vsix": "extest install-vsix -f ./e2e/vsix/continue.vsix --extensions_dir ./e2e/.test-extensions --storage ./e2e/storage",
|
||||
|
|
@ -655,7 +656,7 @@
|
|||
"@vscode/vsce": "^2.22.0",
|
||||
"cargo-cp-artifact": "^0.1",
|
||||
"chai": "^4.5.0",
|
||||
"esbuild": "0.17.19",
|
||||
"esbuild": "0.24.0",
|
||||
"esbuild-visualizer": "^0.6.0",
|
||||
"eslint": "^8.28.0",
|
||||
"glob": "^8.0.3",
|
||||
|
|
@ -682,7 +683,7 @@
|
|||
"dbinfoz": "^0.14.0",
|
||||
"diff": "^7.0.0",
|
||||
"downshift": "^7.6.0",
|
||||
"esbuild": "^0.17.19",
|
||||
"esbuild": "0.24.0",
|
||||
"express": "^4.18.2",
|
||||
"fkill": "^8.1.0",
|
||||
"follow-redirects": "^1.15.4",
|
||||
|
|
@ -710,7 +711,7 @@
|
|||
"socket.io-client": "^4.7.2",
|
||||
"strip-ansi": "^7.1.0",
|
||||
"svg-builder": "^2.0.0",
|
||||
"systeminformation": "^5.22.10",
|
||||
"systeminformation": "^5.23.7",
|
||||
"tailwindcss": "^3.3.2",
|
||||
"undici": "^6.2.0",
|
||||
"uuid": "^9.0.1",
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
const fs = require("fs");
|
||||
const ncp = require("ncp").ncp;
|
||||
const path = require("path");
|
||||
|
||||
const ncp = require("ncp").ncp;
|
||||
const { rimrafSync } = require("rimraf");
|
||||
|
||||
const {
|
||||
validateFilesPresent,
|
||||
execCmdSync,
|
||||
autodetectPlatformAndArch,
|
||||
} = require("../../../scripts/util/index");
|
||||
|
||||
const { copyConfigSchema } = require("./utils");
|
||||
|
||||
// Clear folders that will be packaged to ensure clean slate
|
||||
|
|
@ -46,6 +49,17 @@ console.log("[info] Using target: ", target);
|
|||
|
||||
const exe = os === "win32" ? ".exe" : "";
|
||||
|
||||
const isInGitHubAction = !!process.env.GITHUB_ACTIONS;
|
||||
|
||||
const isArmTarget =
|
||||
target === "darwin-arm64" ||
|
||||
target === "linux-arm64" ||
|
||||
target === "win32-arm64";
|
||||
|
||||
const isWinTarget = target?.startsWith("win");
|
||||
const isLinuxTarget = target?.startsWith("linux");
|
||||
const isMacTarget = target?.startsWith("darwin");
|
||||
|
||||
(async () => {
|
||||
console.log("[info] Packaging extension for target ", target);
|
||||
|
||||
|
|
@ -66,7 +80,7 @@ const exe = os === "win32" ? ".exe" : "";
|
|||
execCmdSync("npm install");
|
||||
console.log("[info] npm install in gui completed");
|
||||
|
||||
if (ghAction()) {
|
||||
if (isInGitHubAction) {
|
||||
execCmdSync("npm run build");
|
||||
}
|
||||
|
||||
|
|
@ -222,7 +236,7 @@ const exe = os === "win32" ? ".exe" : "";
|
|||
"../../../core/llm/llamaTokenizerWorkerPool.mjs",
|
||||
"../../../core/llm/llamaTokenizer.mjs",
|
||||
"../../../core/llm/tiktokenWorkerPool.mjs",
|
||||
"../../../core/util/start_ollama.sh"
|
||||
"../../../core/util/start_ollama.sh",
|
||||
];
|
||||
|
||||
for (const f of filesToCopy) {
|
||||
|
|
@ -262,22 +276,6 @@ const exe = os === "win32" ? ".exe" : "";
|
|||
);
|
||||
});
|
||||
|
||||
function ghAction() {
|
||||
return !!process.env.GITHUB_ACTIONS;
|
||||
}
|
||||
|
||||
function isArm() {
|
||||
return (
|
||||
target === "darwin-arm64" ||
|
||||
target === "linux-arm64" ||
|
||||
target === "win32-arm64"
|
||||
);
|
||||
}
|
||||
|
||||
function isWin() {
|
||||
return target?.startsWith("win");
|
||||
}
|
||||
|
||||
async function installNodeModuleInTempDirAndCopyToCurrent(
|
||||
packageName,
|
||||
toCopy,
|
||||
|
|
@ -341,42 +339,40 @@ const exe = os === "win32" ? ".exe" : "";
|
|||
}
|
||||
|
||||
// GitHub Actions doesn't support ARM, so we need to download pre-saved binaries
|
||||
if (ghAction() && isArm()) {
|
||||
// sqlite3
|
||||
if (!isWin()) {
|
||||
// Neither lancedb nor sqlite3 have pre-built windows arm64 binaries
|
||||
// 02/07/25 - the above comment is out of date, there is now support for ARM runners on GitHub Actions
|
||||
if (isInGitHubAction && isArmTarget) {
|
||||
// lancedb binary
|
||||
const packageToInstall = {
|
||||
"darwin-arm64": "@lancedb/vectordb-darwin-arm64",
|
||||
"linux-arm64": "@lancedb/vectordb-linux-arm64-gnu",
|
||||
"win32-arm64": "@lancedb/vectordb-win32-arm64-msvc",
|
||||
}[target];
|
||||
console.log(
|
||||
"[info] Downloading pre-built lancedb binary: " + packageToInstall,
|
||||
);
|
||||
|
||||
// lancedb binary
|
||||
const packageToInstall = {
|
||||
"darwin-arm64": "@lancedb/vectordb-darwin-arm64",
|
||||
"linux-arm64": "@lancedb/vectordb-linux-arm64-gnu",
|
||||
}[target];
|
||||
console.log(
|
||||
"[info] Downloading pre-built lancedb binary: " + packageToInstall,
|
||||
);
|
||||
await installNodeModuleInTempDirAndCopyToCurrent(
|
||||
packageToInstall,
|
||||
"@lancedb",
|
||||
);
|
||||
|
||||
await installNodeModuleInTempDirAndCopyToCurrent(
|
||||
packageToInstall,
|
||||
"@lancedb",
|
||||
);
|
||||
|
||||
// Replace the installed with pre-built
|
||||
console.log("[info] Downloading pre-built sqlite3 binary");
|
||||
rimrafSync("../../core/node_modules/sqlite3/build");
|
||||
const downloadUrl = {
|
||||
"darwin-arm64":
|
||||
"https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v6-darwin-arm64.tar.gz",
|
||||
"linux-arm64":
|
||||
"https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v3-linux-arm64.tar.gz",
|
||||
}[target];
|
||||
execCmdSync(
|
||||
`curl -L -o ../../core/node_modules/sqlite3/build.tar.gz ${downloadUrl}`,
|
||||
);
|
||||
execCmdSync(
|
||||
"cd ../../core/node_modules/sqlite3 && tar -xvzf build.tar.gz",
|
||||
);
|
||||
fs.unlinkSync("../../core/node_modules/sqlite3/build.tar.gz");
|
||||
}
|
||||
// Replace the installed with pre-built
|
||||
console.log("[info] Downloading pre-built sqlite3 binary");
|
||||
rimrafSync("../../core/node_modules/sqlite3/build");
|
||||
const downloadUrl = {
|
||||
"darwin-arm64":
|
||||
"https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v6-darwin-arm64.tar.gz",
|
||||
"linux-arm64":
|
||||
"https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v3-linux-arm64.tar.gz",
|
||||
// node-sqlite3 doesn't have a pre-built binary for win32-arm64
|
||||
"win32-arm64":
|
||||
"https://continue-server-binaries.s3.us-west-1.amazonaws.com/win32-arm64/node_sqlite3.tar.gz",
|
||||
}[target];
|
||||
execCmdSync(
|
||||
`curl -L -o ../../core/node_modules/sqlite3/build.tar.gz ${downloadUrl}`,
|
||||
);
|
||||
execCmdSync("cd ../../core/node_modules/sqlite3 && tar -xvzf build.tar.gz");
|
||||
fs.unlinkSync("../../core/node_modules/sqlite3/build.tar.gz");
|
||||
|
||||
// Download and unzip esbuild
|
||||
console.log("[info] Downloading pre-built esbuild binary");
|
||||
|
|
@ -391,7 +387,7 @@ const exe = os === "win32" ? ".exe" : "";
|
|||
// Download esbuild from npm in tmp and copy over
|
||||
console.log("npm installing esbuild binary");
|
||||
await installNodeModuleInTempDirAndCopyToCurrent(
|
||||
"esbuild@0.17.19",
|
||||
"esbuild@0.24.0",
|
||||
"@esbuild",
|
||||
);
|
||||
}
|
||||
|
|
@ -483,9 +479,9 @@ const exe = os === "win32" ? ".exe" : "";
|
|||
// onnx runtime bindngs
|
||||
`bin/napi-v3/${os}/${arch}/onnxruntime_binding.node`,
|
||||
`bin/napi-v3/${os}/${arch}/${
|
||||
os === "darwin"
|
||||
isMacTarget
|
||||
? "libonnxruntime.1.14.0.dylib"
|
||||
: os === "linux"
|
||||
: isLinuxTarget
|
||||
? "libonnxruntime.so.1.14.0"
|
||||
: "onnxruntime.dll"
|
||||
}`,
|
||||
|
|
@ -528,11 +524,7 @@ const exe = os === "win32" ? ".exe" : "";
|
|||
? "win32-x64/esbuild.exe"
|
||||
: `${target}/bin/esbuild`
|
||||
}`,
|
||||
`out/node_modules/@lancedb/vectordb-${
|
||||
os === "win32"
|
||||
? "win32-x64-msvc"
|
||||
: `${target}${os === "linux" ? "-gnu" : ""}`
|
||||
}/index.node`,
|
||||
`out/node_modules/@lancedb/vectordb-${target}${isWinTarget ? "-msvc" : ""}${isLinuxTarget ? "-gnu" : ""}/index.node`,
|
||||
`out/node_modules/esbuild/lib/main.js`,
|
||||
`out/node_modules/esbuild/bin/esbuild`,
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import * as child_process from "node:child_process";
|
|||
import { exec } from "node:child_process";
|
||||
|
||||
import { Range } from "core";
|
||||
import { EXTENSION_NAME } from "core/control-plane/env";
|
||||
import { enableHubContinueDev, 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";
|
||||
|
|
@ -619,7 +619,7 @@ class VsCodeIde implements IDE {
|
|||
return vscode.workspace.fs.readDirectory(vscode.Uri.parse(dir)) as any;
|
||||
}
|
||||
|
||||
getIdeSettingsSync(): IdeSettings {
|
||||
private getIdeSettingsSync(): IdeSettings {
|
||||
const settings = vscode.workspace.getConfiguration(EXTENSION_NAME);
|
||||
const remoteConfigServerUrl = settings.get<string | undefined>(
|
||||
"remoteConfigServerUrl",
|
||||
|
|
@ -652,7 +652,17 @@ class VsCodeIde implements IDE {
|
|||
}
|
||||
|
||||
async getIdeSettings(): Promise<IdeSettings> {
|
||||
return this.getIdeSettingsSync();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,11 +43,11 @@ interface VsCodeCompletionInput {
|
|||
export class ContinueCompletionProvider
|
||||
implements vscode.InlineCompletionItemProvider {
|
||||
private onError(e: any) {
|
||||
const options = ["Documentation"];
|
||||
let options = ["Documentation"];
|
||||
if (e.message.includes("Ollama may not be installed")) {
|
||||
options.push("Download Ollama");
|
||||
} else if (e.message.includes("Ollama may not be running")) {
|
||||
options.unshift("Start Ollama"); // We want "Start" to be the default choice
|
||||
options = ["Start Ollama"]; // We want "Start" to be the only choice
|
||||
}
|
||||
|
||||
if (e.message.includes("Please sign in with GitHub")) {
|
||||
|
|
@ -69,7 +69,7 @@ export class ContinueCompletionProvider
|
|||
);
|
||||
} else if (val === "Download Ollama") {
|
||||
vscode.env.openExternal(vscode.Uri.parse("https://ollama.ai/download"));
|
||||
} else if (val == "Start Ollama") {
|
||||
} else if (val === "Start Ollama") {
|
||||
startLocalOllama(this.ide);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -46,6 +46,11 @@ export class RecentlyEditedTracker {
|
|||
private async insertRange(
|
||||
editedRange: Omit<VsCodeRecentlyEditedRange, "lines" | "symbols">,
|
||||
): Promise<void> {
|
||||
|
||||
if (editedRange.uri.scheme === "output") {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for overlap with any existing ranges
|
||||
for (let i = 0; i < this.recentlyEditedRanges.length; i++) {
|
||||
let range = this.recentlyEditedRanges[i];
|
||||
|
|
@ -78,6 +83,7 @@ export class RecentlyEditedTracker {
|
|||
RecentlyEditedTracker.maxRecentlyEditedRanges,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private insertDocument(uri: vscode.Uri): void {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import { VsCodeIde } from "./VsCodeIde";
|
|||
import { getMetaKeyLabel } from "./util/util";
|
||||
|
||||
import type { VsCodeWebviewProtocol } from "./webviewProtocol";
|
||||
import { startLocalOllama } from "core/util/ollamaHelper";
|
||||
|
||||
let fullScreenPanel: vscode.WebviewPanel | undefined;
|
||||
|
||||
|
|
@ -709,7 +710,7 @@ const getCommandsMap: (
|
|||
sidebar.webviewProtocol?.request("newSession", undefined);
|
||||
},
|
||||
"continue.viewHistory": () => {
|
||||
sidebar.webviewProtocol?.request("viewHistory", undefined);
|
||||
vscode.commands.executeCommand("continue.navigateTo", "/history", true);
|
||||
},
|
||||
"continue.focusContinueSessionId": async (
|
||||
sessionId: string | undefined,
|
||||
|
|
@ -777,6 +778,7 @@ const getCommandsMap: (
|
|||
sessionId,
|
||||
);
|
||||
}
|
||||
panel.reveal();
|
||||
sessionLoader.dispose();
|
||||
});
|
||||
|
||||
|
|
@ -1002,6 +1004,9 @@ const getCommandsMap: (
|
|||
"continue.openAccountDialog": () => {
|
||||
sidebar.webviewProtocol?.request("openDialogMessage", "account");
|
||||
},
|
||||
"continue.startLocalOllama": () => {
|
||||
startLocalOllama(ide);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { DiffLine } from "core";
|
||||
import { ChatMessage, DiffLine } from "core";
|
||||
import { ConfigHandler } from "core/config/ConfigHandler";
|
||||
import { streamDiffLines } from "core/edit/streamDiffLines";
|
||||
import { pruneLinesFromBottom, pruneLinesFromTop } from "core/llm/countTokens";
|
||||
|
|
@ -272,6 +272,7 @@ export class VerticalDiffManager {
|
|||
onlyOneInsertion?: boolean,
|
||||
quickEdit?: string,
|
||||
range?: vscode.Range,
|
||||
newCode?: string,
|
||||
): Promise<string | undefined> {
|
||||
vscode.commands.executeCommand("setContext", "continue.diffVisible", true);
|
||||
|
||||
|
|
@ -386,6 +387,18 @@ export class VerticalDiffManager {
|
|||
llm.model,
|
||||
);
|
||||
|
||||
let overridePrompt: ChatMessage[] | undefined;
|
||||
if (llm.promptTemplates?.apply) {
|
||||
const rendered = llm.renderPromptTemplate(llm.promptTemplates.apply, [], {
|
||||
original_code: rangeContent,
|
||||
new_code: newCode ?? "",
|
||||
});
|
||||
overridePrompt =
|
||||
typeof rendered === "string"
|
||||
? [{ role: "user", content: rendered }]
|
||||
: rendered;
|
||||
}
|
||||
|
||||
if (editor.selection) {
|
||||
// Unselect the range
|
||||
editor.selection = new vscode.Selection(
|
||||
|
|
@ -413,7 +426,8 @@ export class VerticalDiffManager {
|
|||
llm,
|
||||
input,
|
||||
getMarkdownLanguageTagForFile(fileUri),
|
||||
onlyOneInsertion,
|
||||
!!onlyOneInsertion,
|
||||
overridePrompt,
|
||||
);
|
||||
|
||||
for await (const line of stream) {
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ export class VsCodeExtension {
|
|||
.get<boolean>("enableContinueHub");
|
||||
vscode.workspace.onDidChangeConfiguration(async (event) => {
|
||||
if (event.affectsConfiguration(EXTENSION_NAME)) {
|
||||
const settings = this.ide.getIdeSettingsSync();
|
||||
const settings = await this.ide.getIdeSettings();
|
||||
const webviewProtocol = await this.webviewProtocolPromise;
|
||||
void webviewProtocol.request("didChangeIdeSettings", {
|
||||
settings,
|
||||
|
|
|
|||
|
|
@ -230,6 +230,7 @@ export class VsCodeMessenger {
|
|||
undefined,
|
||||
undefined,
|
||||
rangeToApplyTo,
|
||||
data.text,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,7 +16,12 @@ export async function showTutorial(ide: IDE) {
|
|||
// Ensure keyboard shortcuts match OS
|
||||
if (process.platform !== "darwin") {
|
||||
let tutorialContent = await ide.readFile(tutorialUri.toString());
|
||||
tutorialContent = tutorialContent.replace("⌘", "^").replace("Cmd", "Ctrl");
|
||||
tutorialContent = tutorialContent
|
||||
.replaceAll("[Cmd + L]", "[Ctrl + L]")
|
||||
.replaceAll("[Cmd + Shift + L]", "[Ctrl + Shift + L]")
|
||||
.replaceAll("[Cmd + I]", "[Ctrl + I]")
|
||||
.replaceAll("⌘", "^");
|
||||
|
||||
await ide.writeFile(tutorialUri.toString(), tutorialContent);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ import { IMessenger } from "../../../core/protocol/messenger";
|
|||
import { showFreeTrialLoginMessage } from "./util/messages";
|
||||
|
||||
export class VsCodeWebviewProtocol
|
||||
implements IMessenger<FromWebviewProtocol, ToWebviewProtocol> {
|
||||
implements IMessenger<FromWebviewProtocol, ToWebviewProtocol>
|
||||
{
|
||||
listeners = new Map<
|
||||
keyof FromWebviewProtocol,
|
||||
((message: Message) => any)[]
|
||||
|
|
@ -85,6 +86,30 @@ export class VsCodeWebviewProtocol
|
|||
respond({ done: true, content: response, status: "success" });
|
||||
}
|
||||
} catch (e: any) {
|
||||
let message = e.message;
|
||||
//Intercept Ollama errors for special handling
|
||||
if (message.includes("Ollama may not")) {
|
||||
const options = [];
|
||||
if (message.includes("be installed")) {
|
||||
options.push("Download Ollama");
|
||||
} else if (message.includes("be running")) {
|
||||
options.push("Start Ollama");
|
||||
}
|
||||
if (options.length > 0) {
|
||||
// Respond without an error, so the UI doesn't show the error component
|
||||
respond({ done: true, status: "error" });
|
||||
// Show native vscode error message instead, with options to download/start Ollama
|
||||
vscode.window.showErrorMessage(e.message, ...options).then(async (val) => {
|
||||
if (val === "Download Ollama") {
|
||||
vscode.env.openExternal(vscode.Uri.parse("https://ollama.ai/download"));
|
||||
} else if (val === "Start Ollama") {
|
||||
vscode.commands.executeCommand("continue.startLocalOllama");
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
respond({ done: true, error: e.message, status: "error" });
|
||||
|
||||
const stringified = JSON.stringify({ msg }, null, 2);
|
||||
|
|
@ -99,7 +124,6 @@ export class VsCodeWebviewProtocol
|
|||
return;
|
||||
}
|
||||
|
||||
let message = e.message;
|
||||
if (e.cause) {
|
||||
if (e.cause.name === "ConnectTimeoutError") {
|
||||
message = `Connection timed out. If you expect it to take a long time to connect, you can increase the timeout in config.json by setting "requestOptions": { "timeout": 10000 }. You can find the full config reference here: https://docs.continue.dev/reference/config`;
|
||||
|
|
@ -114,8 +138,7 @@ export class VsCodeWebviewProtocol
|
|||
message = message.split("\n").filter((l: string) => l !== "")[1];
|
||||
try {
|
||||
message = JSON.parse(message).message;
|
||||
} catch {
|
||||
}
|
||||
} catch {}
|
||||
if (message.includes("exceeded")) {
|
||||
message +=
|
||||
" To keep using Continue, you can set up a local model or use your own API key.";
|
||||
|
|
@ -152,8 +175,7 @@ export class VsCodeWebviewProtocol
|
|||
this._webviewListener = this._webview.onDidReceiveMessage(handleMessage);
|
||||
}
|
||||
|
||||
constructor(private readonly reloadConfig: () => void) {
|
||||
}
|
||||
constructor(private readonly reloadConfig: () => void) {}
|
||||
|
||||
invoke<T extends keyof FromWebviewProtocol>(
|
||||
messageType: T,
|
||||
|
|
@ -163,7 +185,7 @@ export class VsCodeWebviewProtocol
|
|||
throw new Error("Method not implemented.");
|
||||
}
|
||||
|
||||
onError(handler: (error: Error) => void): void {
|
||||
onError(handler: (message: Message, error: Error) => void): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
|
||||
|
|
|
|||
71
gui/package-lock.json
generated
71
gui/package-lock.json
generated
|
|
@ -7,7 +7,7 @@
|
|||
"name": "gui",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-yaml": "^1.0.23",
|
||||
"@continuedev/config-yaml": "^1.0.29",
|
||||
"@headlessui/react": "^1.7.17",
|
||||
"@heroicons/react": "^2.0.18",
|
||||
"@reduxjs/toolkit": "^2.3.0",
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
"redux-persist-transform-filter": "^0.0.22",
|
||||
"redux-thunk": "^3.1.0",
|
||||
"rehype-highlight": "^7.0.0",
|
||||
"rehype-katex": "^7.0.0",
|
||||
"rehype-katex": "^7.0.1",
|
||||
"rehype-wrap-all": "^1.1.0",
|
||||
"remark-math": "^6.0.0",
|
||||
"reselect": "^5.1.1",
|
||||
|
|
@ -108,11 +108,11 @@
|
|||
"@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.23",
|
||||
"@continuedev/config-yaml": "^1.0.29",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
"@modelcontextprotocol/sdk": "^1.0.0",
|
||||
"@modelcontextprotocol/sdk": "^1.5.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
|
|
@ -188,7 +188,7 @@
|
|||
"@types/uuid": "^9.0.7",
|
||||
"@types/win-ca": "^3.5.4",
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild": "0.17.19",
|
||||
"esbuild": "0.24.0",
|
||||
"eslint": "^8",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
|
|
@ -556,9 +556,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-yaml": {
|
||||
"version": "1.0.23",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.23.tgz",
|
||||
"integrity": "sha512-F2Hwc85iCwAHJuwJALOsmZIBeHdF+87mS0YT7dlC6QiE+zAhZKUHcLQ/nTt9bJuhyVyufpb9LApkp40UdGsaWw==",
|
||||
"version": "1.0.29",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.29.tgz",
|
||||
"integrity": "sha512-5zKebdoNp52eSFCrs/EODF36I0basrDdE9gQ6Vxoxd9axzVTyWlbpm6gLXXeaHpJMSCaTcQMh/uzAiq8trwrYA==",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"yaml": "^2.6.1",
|
||||
|
|
@ -3871,10 +3871,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/bin-version/node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
|
|
@ -5756,10 +5757,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/foreground-child/node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
|
|
@ -7595,13 +7597,14 @@
|
|||
}
|
||||
},
|
||||
"node_modules/katex": {
|
||||
"version": "0.16.11",
|
||||
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.11.tgz",
|
||||
"integrity": "sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ==",
|
||||
"version": "0.16.21",
|
||||
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.21.tgz",
|
||||
"integrity": "sha512-XvqR7FgOHtWupfMiigNzmh+MgUVmDGU2kXZm899ZkPfcuoPuFxyHmXsgATDpFZDAXCI8tvinaVcDo8PIIJSo4A==",
|
||||
"funding": [
|
||||
"https://opencollective.com/katex",
|
||||
"https://github.com/sponsors/katex"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "^8.3.0"
|
||||
},
|
||||
|
|
@ -8610,9 +8613,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.7",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
|
||||
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||
"version": "3.3.8",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
|
||||
"integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -8620,6 +8623,7 @@
|
|||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
|
|
@ -12198,10 +12202,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "4.5.5",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.5.tgz",
|
||||
"integrity": "sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==",
|
||||
"version": "4.5.9",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.9.tgz",
|
||||
"integrity": "sha512-qK9W4xjgD3gXbC0NmdNFFnVFLMWSNiR3swj957yutwzzN16xF/E7nmtAyp1rT9hviDroQANjE4HK3H4WqWdFtw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.18.10",
|
||||
"postcss": "^8.4.27",
|
||||
|
|
@ -12699,10 +12704,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/vite-node/node_modules/vite": {
|
||||
"version": "5.4.9",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.9.tgz",
|
||||
"integrity": "sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==",
|
||||
"version": "5.4.14",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.14.tgz",
|
||||
"integrity": "sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.21.3",
|
||||
"postcss": "^8.4.43",
|
||||
|
|
@ -13274,10 +13280,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/vitest/node_modules/vite": {
|
||||
"version": "5.4.9",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.9.tgz",
|
||||
"integrity": "sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==",
|
||||
"version": "5.4.14",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.14.tgz",
|
||||
"integrity": "sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.21.3",
|
||||
"postcss": "^8.4.43",
|
||||
|
|
@ -13748,9 +13755,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/zod": {
|
||||
"version": "3.24.1",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz",
|
||||
"integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==",
|
||||
"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"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
"test:watch": "vitest"
|
||||
},
|
||||
"dependencies": {
|
||||
"@continuedev/config-yaml": "^1.0.23",
|
||||
"@continuedev/config-yaml": "^1.0.29",
|
||||
"@headlessui/react": "^1.7.17",
|
||||
"@heroicons/react": "^2.0.18",
|
||||
"@reduxjs/toolkit": "^2.3.0",
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
"redux-persist-transform-filter": "^0.0.22",
|
||||
"redux-thunk": "^3.1.0",
|
||||
"rehype-highlight": "^7.0.0",
|
||||
"rehype-katex": "^7.0.0",
|
||||
"rehype-katex": "^7.0.1",
|
||||
"rehype-wrap-all": "^1.1.0",
|
||||
"remark-math": "^6.0.0",
|
||||
"reselect": "^5.1.1",
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 2.6 KiB |
BIN
gui/public/logos/siliconflow.png
Normal file
BIN
gui/public/logos/siliconflow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
|
|
@ -14,12 +14,14 @@ import { useAuth } from "../context/Auth";
|
|||
import { IdeMessengerContext } from "../context/IdeMessenger";
|
||||
import { setSelectedProfileId } from "../redux/slices/sessionSlice";
|
||||
import { setDialogMessage, setShowDialog } from "../redux/slices/uiSlice";
|
||||
import { getFontSize } from "../util";
|
||||
|
||||
const StyledListboxOption = styled(Listbox.Option)<{ selected: boolean }>`
|
||||
background-color: ${({ selected }) =>
|
||||
selected ? vscListActiveBackground : vscInputBackground};
|
||||
cursor: pointer;
|
||||
padding: 6px 8px;
|
||||
padding: 4px 6px;
|
||||
font-size: ${getFontSize() - 1}px;
|
||||
|
||||
&:hover {
|
||||
background-color: ${vscListActiveBackground};
|
||||
|
|
@ -53,19 +55,6 @@ export default function AccountDialog() {
|
|||
);
|
||||
}
|
||||
|
||||
if (!controlServerBetaEnabled) {
|
||||
return (
|
||||
<div className="p-4 pt-0">
|
||||
<h1 className="mb-1 text-2xl">Account</h1>
|
||||
<p>
|
||||
Continue For Teams is not enabled. You can enable it in your IDE
|
||||
settings.
|
||||
</p>
|
||||
<p>Using local config.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const changeProfileId = (id: string) => {
|
||||
|
|
@ -82,60 +71,63 @@ export default function AccountDialog() {
|
|||
"Signed in"
|
||||
) : (
|
||||
<>
|
||||
Signed in as{" "}
|
||||
<span className="italic">{session.account.label}</span>
|
||||
Signed in as <span className="italic">{session.account.id}</span>
|
||||
</>
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="w-full">
|
||||
<span className="mb-1 block text-sm">Current workspace</span>
|
||||
{controlServerBetaEnabled && (
|
||||
<div className="mb-10 mt-4 w-full">
|
||||
<span className="mb-1 block text-sm">Current workspace</span>
|
||||
|
||||
<Listbox value={"local"} onChange={changeProfileId}>
|
||||
{({ open }) => (
|
||||
<div className="relative w-full">
|
||||
<Listbox.Button className="border-vsc-input-border bg-vsc-background hover:bg-vsc-input-background text-vsc-foreground relative m-0 flex w-full cursor-pointer items-center justify-between rounded-md border border-solid px-3 py-2 text-left">
|
||||
<span className="lines lines-1">{selectedProfile?.title}</span>
|
||||
<div className="pointer-events-none flex items-center">
|
||||
<ChevronUpDownIcon className="h-5 w-5" aria-hidden="true" />
|
||||
</div>
|
||||
</Listbox.Button>
|
||||
<Listbox value={"local"} onChange={changeProfileId}>
|
||||
{({ open }) => (
|
||||
<div className="relative w-full">
|
||||
<Listbox.Button className="border-vsc-input-border bg-vsc-background hover:bg-vsc-input-background text-vsc-foreground relative m-0 flex w-full cursor-pointer items-center justify-between rounded-md border border-solid px-3 py-2 text-left">
|
||||
<span className="lines lines-1">
|
||||
{selectedProfile?.title}
|
||||
</span>
|
||||
<div className="pointer-events-none flex items-center">
|
||||
<ChevronUpDownIcon className="h-5 w-5" aria-hidden="true" />
|
||||
</div>
|
||||
</Listbox.Button>
|
||||
|
||||
<Transition
|
||||
as={Fragment}
|
||||
show={open}
|
||||
enter="transition ease-out duration-100"
|
||||
enterFrom="transform opacity-0 scale-95"
|
||||
enterTo="transform opacity-100 scale-100"
|
||||
leave="transition ease-in duration-75"
|
||||
leaveFrom="transform opacity-100 scale-100"
|
||||
leaveTo="transform opacity-0 scale-95"
|
||||
>
|
||||
<Listbox.Options className="bg-vsc-background max-h-80vh absolute mt-0.5 w-full overflow-y-scroll rounded-sm p-0">
|
||||
{profiles.map((option, idx) => (
|
||||
<StyledListboxOption
|
||||
key={idx}
|
||||
selected={selectedProfile?.id === option.id}
|
||||
value={option.id}
|
||||
className="w-full"
|
||||
>
|
||||
<span className="lines lines-1 relative flex h-5 items-center justify-between gap-3 pr-2 text-xs">
|
||||
{option.title}
|
||||
</span>
|
||||
</StyledListboxOption>
|
||||
))}
|
||||
{profiles.length === 0 && (
|
||||
<div className="px-4 py-2">
|
||||
<i>No workspaces found</i>
|
||||
</div>
|
||||
)}
|
||||
</Listbox.Options>
|
||||
</Transition>
|
||||
</div>
|
||||
)}
|
||||
</Listbox>
|
||||
</div>
|
||||
<Transition
|
||||
as={Fragment}
|
||||
show={open}
|
||||
enter="transition ease-out duration-100"
|
||||
enterFrom="transform opacity-0 scale-95"
|
||||
enterTo="transform opacity-100 scale-100"
|
||||
leave="transition ease-in duration-75"
|
||||
leaveFrom="transform opacity-100 scale-100"
|
||||
leaveTo="transform opacity-0 scale-95"
|
||||
>
|
||||
<Listbox.Options className="bg-vsc-background max-h-80vh absolute mt-0.5 w-full overflow-y-scroll rounded-sm p-0">
|
||||
{profiles.map((option, idx) => (
|
||||
<StyledListboxOption
|
||||
key={idx}
|
||||
selected={selectedProfile?.id === option.id}
|
||||
value={option.id}
|
||||
className="w-full"
|
||||
>
|
||||
<span className="lines lines-1 relative flex h-5 items-center justify-between gap-3 pr-2 text-xs">
|
||||
{option.title}
|
||||
</span>
|
||||
</StyledListboxOption>
|
||||
))}
|
||||
{profiles.length === 0 && (
|
||||
<div className="px-4 py-2">
|
||||
<i>No workspaces found</i>
|
||||
</div>
|
||||
)}
|
||||
</Listbox.Options>
|
||||
</Transition>
|
||||
</div>
|
||||
)}
|
||||
</Listbox>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="flex w-full justify-end gap-2">
|
||||
<SecondaryButton className="w-auto" onClick={logout}>
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ export default function AddFileCombobox({
|
|||
className={({ active }) =>
|
||||
`relative flex w-full cursor-pointer px-2 py-1 text-left text-xs ${
|
||||
active
|
||||
? "bg-vsc-list-active-background text-vsc-list-active-foreground"
|
||||
? "bg-list-active text-list-active-foreground"
|
||||
: ""
|
||||
}`
|
||||
}
|
||||
|
|
@ -112,7 +112,7 @@ export default function AddFileCombobox({
|
|||
</Combobox.Option>
|
||||
))
|
||||
) : (
|
||||
<div className="text-vsc-list-active-foreground0 px-2 py-1 text-xs">
|
||||
<div className="text-list-active-foreground px-2 py-1 text-xs">
|
||||
No results
|
||||
</div>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -2,27 +2,29 @@ import { useEffect, useMemo } from "react";
|
|||
import { Outlet, useLocation, useNavigate } from "react-router-dom";
|
||||
import styled from "styled-components";
|
||||
import { CustomScrollbarDiv, defaultBorderRadius } from ".";
|
||||
import { AuthProvider } from "../context/Auth";
|
||||
import { useWebviewListener } from "../hooks/useWebviewListener";
|
||||
import { useAppDispatch, useAppSelector } from "../redux/hooks";
|
||||
import { setEditStatus, focusEdit } from "../redux/slices/editModeState";
|
||||
import { setDialogMessage, setShowDialog } from "../redux/slices/uiSlice";
|
||||
import { focusEdit, setEditStatus } from "../redux/slices/editModeState";
|
||||
import {
|
||||
addCodeToEdit,
|
||||
updateApplyState,
|
||||
setMode,
|
||||
newSession,
|
||||
selectIsInEditMode,
|
||||
setMode,
|
||||
updateApplyState,
|
||||
} from "../redux/slices/sessionSlice";
|
||||
import { setDialogMessage, setShowDialog } from "../redux/slices/uiSlice";
|
||||
import { exitEditMode } from "../redux/thunks";
|
||||
import { loadLastSession, saveCurrentSession } from "../redux/thunks/session";
|
||||
import { getFontSize, isMetaEquivalentKeyPressed } from "../util";
|
||||
import { incrementFreeTrialCount } from "../util/freeTrial";
|
||||
import { ROUTES } from "../util/navigation";
|
||||
import AccountDialog from "./AccountDialog";
|
||||
import TextDialog from "./dialogs";
|
||||
import Footer from "./Footer";
|
||||
import { isNewUserOnboarding, useOnboardingCard } from "./OnboardingCard";
|
||||
import OSRContextMenu from "./OSRContextMenu";
|
||||
import PostHogPageView from "./PosthogPageView";
|
||||
import AccountDialog from "./AccountDialog";
|
||||
import { AuthProvider } from "../context/Auth";
|
||||
import { exitEditMode } from "../redux/thunks";
|
||||
import { loadLastSession, saveCurrentSession } from "../redux/thunks/session";
|
||||
import { incrementFreeTrialCount } from "../util/freeTrial";
|
||||
|
||||
const LayoutTopDiv = styled(CustomScrollbarDiv)`
|
||||
height: 100%;
|
||||
|
|
@ -62,6 +64,7 @@ const Layout = () => {
|
|||
await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: true,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
dispatch(exitEditMode());
|
||||
|
|
@ -85,6 +88,7 @@ const Layout = () => {
|
|||
await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: true,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
dispatch(exitEditMode());
|
||||
|
|
@ -112,19 +116,6 @@ const Layout = () => {
|
|||
[navigate],
|
||||
);
|
||||
|
||||
useWebviewListener(
|
||||
"viewHistory",
|
||||
async () => {
|
||||
// Toggle the history page / main page
|
||||
if (location.pathname === "/history") {
|
||||
navigate("/");
|
||||
} else {
|
||||
navigate("/history");
|
||||
}
|
||||
},
|
||||
[location, navigate],
|
||||
);
|
||||
|
||||
useWebviewListener(
|
||||
"navigateTo",
|
||||
async (data) => {
|
||||
|
|
@ -181,6 +172,8 @@ const Layout = () => {
|
|||
await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: false,
|
||||
// Because this causes a lag before Edit mode is focused. TODO just have that happen in background
|
||||
generateTitle: false,
|
||||
}),
|
||||
);
|
||||
dispatch(newSession());
|
||||
|
|
@ -196,6 +189,7 @@ const Layout = () => {
|
|||
await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: true,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
dispatch(focusEdit());
|
||||
|
|
@ -220,7 +214,11 @@ const Layout = () => {
|
|||
[],
|
||||
);
|
||||
|
||||
const isInEditMode = useAppSelector(selectIsInEditMode);
|
||||
useWebviewListener("exitEditMode", async () => {
|
||||
if (!isInEditMode) {
|
||||
return;
|
||||
}
|
||||
dispatch(
|
||||
loadLastSession({
|
||||
saveCurrentSession: false,
|
||||
|
|
@ -261,6 +259,7 @@ const Layout = () => {
|
|||
return (
|
||||
<AuthProvider>
|
||||
<LayoutTopDiv>
|
||||
<OSRContextMenu />
|
||||
<div
|
||||
style={{
|
||||
scrollbarGutter: "stable both-edges",
|
||||
|
|
|
|||
222
gui/src/components/OSRContextMenu.tsx
Normal file
222
gui/src/components/OSRContextMenu.tsx
Normal file
|
|
@ -0,0 +1,222 @@
|
|||
import React, { useContext, useEffect, useRef, useState } from "react";
|
||||
import useIsOSREnabled from "../hooks/useIsOSREnabled";
|
||||
import { IdeMessengerContext } from "../context/IdeMessenger";
|
||||
import { getPlatform } from "../util";
|
||||
|
||||
interface Position {
|
||||
top?: number;
|
||||
left?: number;
|
||||
bottom?: number;
|
||||
right?: number;
|
||||
}
|
||||
|
||||
const OSRContextMenu = () => {
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
const isOSREnabled = useIsOSREnabled();
|
||||
const platform = useRef(getPlatform());
|
||||
|
||||
const [position, setPosition] = useState<Position | null>(null);
|
||||
const [canCopy, setCanCopy] = useState(false);
|
||||
const [canCut, setCanCut] = useState(false);
|
||||
const [canPaste, setCanPaste] = useState(false);
|
||||
|
||||
const menuRef = React.useRef<HTMLDivElement>(null);
|
||||
const selectedTextRef = useRef<string | null>(null);
|
||||
const selectedRangeRef = useRef<Range | null>(null);
|
||||
|
||||
function onMenuItemClick(
|
||||
event: React.MouseEvent<HTMLDivElement, MouseEvent>,
|
||||
) {
|
||||
event.preventDefault();
|
||||
|
||||
// restore selection
|
||||
if (selectedRangeRef.current) {
|
||||
const selection = window.getSelection();
|
||||
selection?.removeAllRanges();
|
||||
selection?.addRange(selectedRangeRef.current);
|
||||
}
|
||||
|
||||
// Hide menu
|
||||
setPosition(null);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
function leaveWindowHandler() {
|
||||
setPosition(null);
|
||||
}
|
||||
function contextMenuHandler(event: MouseEvent) {
|
||||
event.preventDefault();
|
||||
}
|
||||
function clickHandler(event: MouseEvent) {
|
||||
// If clicked outside of menu, close menu
|
||||
if (!menuRef.current?.contains(event.target as Node)) {
|
||||
setPosition(null);
|
||||
}
|
||||
|
||||
if (event.button === 2) {
|
||||
// Prevent default context menu
|
||||
event.preventDefault();
|
||||
|
||||
selectedRangeRef.current = null;
|
||||
selectedTextRef.current = null;
|
||||
|
||||
const selection = window.getSelection();
|
||||
let isClickWithinSelection = false;
|
||||
if (selection && selection.rangeCount > 0) {
|
||||
const range = selection.getRangeAt(0);
|
||||
const selectedText = range.toString();
|
||||
selectedRangeRef.current = range.cloneRange();
|
||||
|
||||
if (selectedText.length > 0) {
|
||||
if (selectedText) {
|
||||
selectedTextRef.current = selectedText;
|
||||
const rects = range.getClientRects();
|
||||
for (let i = 0; i < rects.length; i++) {
|
||||
const rect = rects[i];
|
||||
if (
|
||||
event.clientX >= rect.left &&
|
||||
event.clientX <= rect.right &&
|
||||
event.clientY >= rect.top &&
|
||||
event.clientY <= rect.bottom
|
||||
) {
|
||||
isClickWithinSelection = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if right clicked on editable content (allows paste/cut)
|
||||
let isEditable = false;
|
||||
if (
|
||||
event.target &&
|
||||
"isContentEditable" in event.target &&
|
||||
typeof event.target.isContentEditable === "boolean"
|
||||
) {
|
||||
isEditable = event.target.isContentEditable;
|
||||
}
|
||||
|
||||
setCanCopy(!!selectedTextRef.current && isClickWithinSelection);
|
||||
setCanCut(
|
||||
!!(isEditable && selectedTextRef.current && isClickWithinSelection),
|
||||
);
|
||||
|
||||
// TODO only can paste if there is text in clipboard?
|
||||
setCanPaste(isEditable);
|
||||
// navigator.clipboard.readText().then((text) => {
|
||||
// setCanPaste(text || null);
|
||||
// });
|
||||
|
||||
// Open towards inside of window from click
|
||||
const toRight = event.clientX > window.innerWidth / 2;
|
||||
const toBottom = event.clientY > window.innerHeight / 2;
|
||||
if (toRight) {
|
||||
if (toBottom) {
|
||||
setPosition({
|
||||
bottom: window.innerHeight - event.clientY,
|
||||
right: window.innerWidth - event.clientX,
|
||||
});
|
||||
} else {
|
||||
setPosition({
|
||||
top: event.clientY,
|
||||
right: window.innerWidth - event.clientX,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (toBottom) {
|
||||
setPosition({
|
||||
bottom: window.innerHeight - event.clientY,
|
||||
left: event.clientX,
|
||||
});
|
||||
} else {
|
||||
setPosition({
|
||||
top: event.clientY,
|
||||
left: event.clientX,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setPosition(null);
|
||||
if (isOSREnabled && platform.current !== "mac") {
|
||||
document.addEventListener("mousedown", clickHandler);
|
||||
document.addEventListener("mouseleave", leaveWindowHandler);
|
||||
document.addEventListener("contextmenu", contextMenuHandler);
|
||||
}
|
||||
|
||||
return () => {
|
||||
document.removeEventListener("mousedown", clickHandler);
|
||||
document.removeEventListener("mouseleave", leaveWindowHandler);
|
||||
document.removeEventListener("contextmenu", contextMenuHandler);
|
||||
};
|
||||
}, [isOSREnabled]);
|
||||
|
||||
if (platform.current === "mac" || !isOSREnabled || !position) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<div
|
||||
className="bg-vsc-editor-background absolute flex flex-col gap-1.5 overflow-hidden rounded-md border border-solid border-gray-500 px-3 py-1.5"
|
||||
style={{
|
||||
...position,
|
||||
zIndex: 9999,
|
||||
}}
|
||||
ref={menuRef}
|
||||
>
|
||||
{canCopy && (
|
||||
<div
|
||||
className="cursor-pointer hover:opacity-90"
|
||||
onClick={(e) => {
|
||||
onMenuItemClick(e);
|
||||
document.execCommand("copy");
|
||||
}}
|
||||
>
|
||||
Copy
|
||||
</div>
|
||||
)}
|
||||
{canCut && (
|
||||
<div
|
||||
className="cursor-pointer hover:opacity-90"
|
||||
onClick={(e) => {
|
||||
onMenuItemClick(e);
|
||||
document.execCommand("cut");
|
||||
}}
|
||||
>
|
||||
Cut
|
||||
</div>
|
||||
)}
|
||||
{/* PASTING is currently broken, can't get the clipboard text */}
|
||||
{/* {canPaste && (
|
||||
<div
|
||||
className="cursor-pointer hover:opacity-90"
|
||||
onClick={async (e) => {
|
||||
onMenuItemClick(e);
|
||||
const clipboardText = await navigator.clipboard.readText();
|
||||
// const out = await navigator.clipboard.read();
|
||||
if (clipboardText) {
|
||||
selectedRangeRef.current?.deleteContents();
|
||||
selectedRangeRef.current?.insertNode(
|
||||
document.createTextNode(clipboardText),
|
||||
);
|
||||
}
|
||||
}}
|
||||
>
|
||||
Paste
|
||||
</div>
|
||||
)} */}
|
||||
<div
|
||||
className="cursor-pointer hover:opacity-90"
|
||||
onClick={(e) => {
|
||||
onMenuItemClick(e);
|
||||
ideMessenger.post("toggleDevTools", undefined);
|
||||
}}
|
||||
>
|
||||
Open Dev Tools
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default OSRContextMenu;
|
||||
|
|
@ -5,6 +5,7 @@ import styled from "styled-components";
|
|||
import { CloseButton, defaultBorderRadius, vscInputBackground } from "../";
|
||||
import { getLocalStorage, setLocalStorage } from "../../util/localStorage";
|
||||
import { useOnboardingCard } from "./hooks/useOnboardingCard";
|
||||
import { useAppSelector } from "../../redux/hooks";
|
||||
|
||||
const StyledCard = styled.div`
|
||||
margin: auto;
|
||||
|
|
@ -26,6 +27,7 @@ interface OnboardingCardProps {
|
|||
|
||||
export function OnboardingCard({ isDialog }: OnboardingCardProps) {
|
||||
const onboardingCard = useOnboardingCard();
|
||||
const config = useAppSelector((store) => store.config.config);
|
||||
|
||||
function renderTabContent() {
|
||||
switch (onboardingCard.activeTab) {
|
||||
|
|
@ -53,7 +55,7 @@ export function OnboardingCard({ isDialog }: OnboardingCardProps) {
|
|||
activeTab={onboardingCard.activeTab || "Best"}
|
||||
onTabClick={onboardingCard.setActiveTab}
|
||||
/>
|
||||
{!isDialog && (
|
||||
{!isDialog && !!config.models.length && (
|
||||
<CloseButton onClick={() => onboardingCard.close()}>
|
||||
<XMarkIcon className="mt-1.5 hidden h-5 w-5 hover:brightness-125 sm:flex" />
|
||||
</CloseButton>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
import { CubeIcon } from "@heroicons/react/24/outline";
|
||||
import { DEFAULT_CHAT_MODEL_CONFIG } from "core/config/default";
|
||||
import { FormEventHandler, useContext, useState } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { Button, Input, InputSubtext, lightGray } from "../..";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { models } from "../../../pages/AddNewModel/configs/models";
|
||||
import { providers } from "../../../pages/AddNewModel/configs/providers";
|
||||
import AddModelButtonSubtext from "../../AddModelButtonSubtext";
|
||||
import { setDefaultModel } from "../../../redux/slices/configSlice";
|
||||
import AddModelButtonSubtext from "../../AddModelButtonSubtext";
|
||||
|
||||
const { anthropic, mistral } = providers;
|
||||
const chatProvider = anthropic!;
|
||||
|
|
@ -15,7 +14,7 @@ const autocompleteProvider = mistral!;
|
|||
|
||||
const {
|
||||
claude35Sonnet: chatModel,
|
||||
claude3Haiku: repoMapModel,
|
||||
claude35Haiku: repoMapModel,
|
||||
codestral: autocompleteModel,
|
||||
} = models;
|
||||
|
||||
|
|
@ -57,9 +56,6 @@ function BestExperienceConfigForm({
|
|||
apiKey: autocompleteApiKey,
|
||||
};
|
||||
|
||||
ideMessenger.post("config/deleteModel", {
|
||||
title: DEFAULT_CHAT_MODEL_CONFIG.title,
|
||||
});
|
||||
ideMessenger.post("config/addModel", { model: chatModelConfig });
|
||||
ideMessenger.post("config/addModel", {
|
||||
model: repoMapConfig,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ interface OllamaCompletedStepProps {
|
|||
function OllamaCompletedStep({ text }: OllamaCompletedStepProps) {
|
||||
return (
|
||||
<div className="flex items-center justify-between">
|
||||
<p className="mr-1 w-3/4 truncate font-mono text-sm">{text}</p>
|
||||
<p className="lines mr-1 w-3/4 font-mono text-sm leading-none">{text}</p>
|
||||
<CheckCircleIcon width={24} height={24} className="text-emerald-600" />
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue