Merge branch 'dev' into code-gecko
This commit is contained in:
commit
ac987b836e
129 changed files with 6144 additions and 1272 deletions
36
.eslintrc.shared.json
Normal file
36
.eslintrc.shared.json
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": ["@typescript-eslint", "import"],
|
||||
"rules": {
|
||||
"@typescript-eslint/semi": "warn",
|
||||
"curly": "warn",
|
||||
"eqeqeq": "warn",
|
||||
"no-throw-literal": "warn",
|
||||
"semi": "off",
|
||||
"import/order": [
|
||||
"warn",
|
||||
{
|
||||
"groups": [
|
||||
"builtin",
|
||||
"external",
|
||||
"internal",
|
||||
"parent",
|
||||
"sibling",
|
||||
"index",
|
||||
"object",
|
||||
"type"
|
||||
],
|
||||
"alphabetize": {
|
||||
"order": "asc",
|
||||
"caseInsensitive": true
|
||||
},
|
||||
"newlines-between": "always"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
|
||||
}
|
||||
8
.github/workflows/main.yaml
vendored
8
.github/workflows/main.yaml
vendored
|
|
@ -255,11 +255,3 @@ jobs:
|
|||
# with:
|
||||
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# branch: ${{ github.ref }}
|
||||
|
||||
# 5 Send to Discord Webhook
|
||||
- name: Discord Commits
|
||||
uses: Sniddl/discord-commits@1.7
|
||||
with:
|
||||
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
template: "avatar-with-link"
|
||||
include-extras: true
|
||||
|
|
|
|||
4
.idea/modules.xml
generated
4
.idea/modules.xml
generated
|
|
@ -2,9 +2,7 @@
|
|||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.iml" filepath="$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.main.iml" filepath="$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.main.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.test.iml" filepath="$PROJECT_DIR$/.idea/modules/com.github.continuedev.continueintellijextension.continue-intellij-extension.test.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/continue-intellij-extension.iml" filepath="$PROJECT_DIR$/.idea/modules/continue-intellij-extension.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/modules/continue-intellij-extension.iml
generated
Normal file
8
.idea/modules/continue-intellij-extension.iml
generated
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$/../..">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../extensions/intellij/.gradle/8.3/dependencies-accessors/5ff144de810dd952e050983bda2040fa7aa351f8/sources" isTestSource="false" />
|
||||
</content>
|
||||
</component>
|
||||
</module>
|
||||
2
.idea/scopes/Continue.xml
generated
2
.idea/scopes/Continue.xml
generated
|
|
@ -1,3 +1,3 @@
|
|||
<component name="DependencyValidationManager">
|
||||
<scope name="Continue" pattern="!file[com.github.continuedev.continueintellijextension.continue-intellij-extension]:gui/dist//*&&!file[com.github.continuedev.continueintellijextension.continue-intellij-extension]:extensions/vscode/gui//*&&!file[com.github.continuedev.continueintellijextension.continue-intellij-extension]:core/vendor//*" />
|
||||
<scope name="Continue" pattern="file[continue-intellij-extension]:*/&&!file[continue-intellij-extension]:binary/bin//*&&!file[continue-intellij-extension]:binary/build//*&&!file[continue-intellij-extension]:binary/out//*&&!file[continue-intellij-extension]:gui/dist//*&&!file[continue-intellij-extension]:extensions/intellij/build//*&&!file[continue-intellij-extension]:extensions/vscode/bin//*&&!file[continue-intellij-extension]:extensions/vscode/build//*&&!file[continue-intellij-extension]:extensions/vscode/out//*" />
|
||||
</component>
|
||||
23
.vscode/launch.json
vendored
23
.vscode/launch.json
vendored
|
|
@ -20,7 +20,9 @@
|
|||
"outFiles": ["${workspaceFolder}/extensions/vscode/out/extension.js"],
|
||||
"preLaunchTask": "vscode-extension:build",
|
||||
"env": {
|
||||
"CONTROL_PLANE_ENV": "local"
|
||||
// "staging" for the preview deployment
|
||||
// "local" for entirely local development of control plane/proxy
|
||||
// "CONTROL_PLANE_ENV": "staging"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -135,24 +137,5 @@
|
|||
"NODE_OPTIONS": "--experimental-vm-modules"
|
||||
}
|
||||
}
|
||||
// {
|
||||
// "name": "[openai-adapters] Jest Test Debugger, Current Open File",
|
||||
// "type": "node",
|
||||
// "request": "launch",
|
||||
// "runtimeArgs": [
|
||||
// "--inspect-brk",
|
||||
// "${workspaceRoot}/packages/openai-adapters/node_modules/jest/bin/jest.js",
|
||||
// "--runInBand",
|
||||
// "--config",
|
||||
// "${workspaceRoot}/packages/openai-adapters/jest.config.mjs",
|
||||
// "${relativeFile}"
|
||||
// ],
|
||||
// "cwd": "${workspaceRoot}/packages/openai-adapters",
|
||||
// "console": "integratedTerminal",
|
||||
// "internalConsoleOptions": "neverOpen",
|
||||
// "env": {
|
||||
// "NODE_OPTIONS": "--experimental-vm-modules"
|
||||
// }
|
||||
// }
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,10 +200,9 @@ Continue has support for more than a dozen different LLM "providers", making it
|
|||
While any model that works with a supported provider can be used with Continue, we keep a list of recommended models that can be automatically configured from the UI or `config.json`. The following files should be updated when adding a model:
|
||||
|
||||
- [config_schema.json](./extensions/vscode/config_schema.json) - This is the JSON Schema definition that is used to validate `config.json`. You'll notice a number of rules defined in "definitions.ModelDescription.allOf". Here is where you write rules that can specify something like "for the provider 'anthropic', only models 'claude-2' and 'claude-instant-1' are allowed. Look through all of these rules and make sure that your model is included for providers that support it.
|
||||
- [modelData.ts](./gui/src/util/modelData.ts) - This file defines that information that is shown in the model selection UI in the side bar. To add a new model:
|
||||
1. create a `ModelPackage` object, following the lead of the many examples near the top of the file
|
||||
2. add the `ModelPackage` to the `MODEL_INFO` array if you would like it to be displayed in the "Models" tab
|
||||
3. if you would like it to be displayed as an option under any of the providers, go to the `PROVIDER_INFO` object and add it to the `packages` array for each provider that you want it to be displayed under. If it is an OS model that should be valid for most providers offering OS models, you might just be able to add it to the `osModels` array as shorthand.
|
||||
- [AddNewModel page](./gui/src/pages/AddNewModel) - This directory defines which model options are shown in the side bar model selection UI. To add a new model:
|
||||
1. Add a `ModelPackage` entry for the model into [configs/models.ts](./gui/src/pages/AddNewModel/configs/models.ts), following the lead of the many examples near the top of the file
|
||||
2. Add the model within its provider's array to [AddNewModel.tsx](./gui/src/pages/AddNewModel/AddNewModel.tsx) (add provider if needed)
|
||||
- [index.d.ts](./core/index.d.ts) - This file defines the TypeScript types used throughout Continue. You'll find a `ModelName` type. Be sure to add the name of your model to this.
|
||||
- LLM Providers: Since many providers use their own custom strings to identify models, you'll have to add the translation from Continue's model name (the one you added to `index.d.ts`) and the model string for each of these providers: [Ollama](./core/llm/llms/Ollama.ts), [Together](./core/llm/llms/Together.ts), and [Replicate](./core/llm/llms/Replicate.ts). You can find their full model lists here: [Ollama](https://ollama.ai/library), [Together](https://docs.together.ai/docs/inference-models), [Replicate](https://replicate.com/collections/streaming-language-models).
|
||||
- [Prompt Templates](./core/llm/index.ts) - In this file you'll find the `autodetectTemplateType` function. Make sure that for the model name you just added, this function returns the correct template type. This is assuming that the chat template for that model is already built in Continue. If not, you will have to add the template type and corresponding edit and chat templates.
|
||||
|
|
|
|||
4
binary/package-lock.json
generated
4
binary/package-lock.json
generated
|
|
@ -47,12 +47,11 @@
|
|||
"@aws-sdk/client-bedrock-runtime": "^3.620.1",
|
||||
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
|
||||
"@aws-sdk/credential-providers": "^3.620.1",
|
||||
"@continuedev/config-types": "^1.0.10",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
"@typescript-eslint/parser": "^7.8.0",
|
||||
"@xenova/transformers": "2.14.0",
|
||||
"adf-to-md": "^1.1.0",
|
||||
"async-mutex": "^0.5.0",
|
||||
|
|
@ -124,7 +123,6 @@
|
|||
"cross-env": "^7.0.3",
|
||||
"esbuild": "0.17.19",
|
||||
"eslint": "^8",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"myers-diff": "^2.1.0",
|
||||
|
|
|
|||
|
|
@ -1,21 +1,12 @@
|
|||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"extends": ["../.eslintrc.shared.json"],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module",
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"plugins": ["@typescript-eslint", "import"],
|
||||
"rules": {
|
||||
"quotes": ["warn", "double", {}],
|
||||
"@typescript-eslint/naming-convention": "off",
|
||||
"@typescript-eslint/semi": "warn",
|
||||
"curly": "warn",
|
||||
"eqeqeq": "warn",
|
||||
"no-throw-literal": "warn",
|
||||
"semi": "off",
|
||||
"@typescript-eslint/no-floating-promises": "warn"
|
||||
},
|
||||
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,11 +8,7 @@ export class AutocompleteLruCache {
|
|||
private static capacity = 1000;
|
||||
private mutex = new Mutex();
|
||||
|
||||
db: DatabaseConnection;
|
||||
|
||||
constructor(db: DatabaseConnection) {
|
||||
this.db = db;
|
||||
}
|
||||
constructor(private db: DatabaseConnection) {}
|
||||
|
||||
static async get(): Promise<AutocompleteLruCache> {
|
||||
const db = await open({
|
||||
|
|
|
|||
|
|
@ -128,14 +128,6 @@ function formatExternalSnippet(
|
|||
return lines.join("\n");
|
||||
}
|
||||
|
||||
let shownGptClaudeWarning = false;
|
||||
const nonAutocompleteModels = [
|
||||
// "gpt",
|
||||
// "claude",
|
||||
"mistral",
|
||||
"instruct",
|
||||
];
|
||||
|
||||
export type GetLspDefinitionsFunction = (
|
||||
filepath: string,
|
||||
contents: string,
|
||||
|
|
@ -268,7 +260,10 @@ export class CompletionProvider {
|
|||
const workspaceDirs = await this.ide.getWorkspaceDirs();
|
||||
let filepath = input.filepath;
|
||||
for (const workspaceDir of workspaceDirs) {
|
||||
if (filepath.startsWith(workspaceDir)) {
|
||||
const relativePath = path.relative(workspaceDir, filepath);
|
||||
const relativePathBase = relativePath.split(path.sep).at(0);
|
||||
const isInWorkspace = !path.isAbsolute(relativePath) && relativePathBase !== "..";
|
||||
if (isInWorkspace) {
|
||||
filepath = path.relative(workspaceDir, filepath);
|
||||
break;
|
||||
}
|
||||
|
|
@ -388,11 +383,23 @@ export class CompletionProvider {
|
|||
// Wait 10 seconds, then assume it wasn't accepted
|
||||
outcome.accepted = false;
|
||||
logDevData("autocomplete", outcome);
|
||||
const { prompt, completion, ...restOfOutcome } = outcome;
|
||||
const { prompt, completion, prefix, suffix, ...restOfOutcome } = outcome;
|
||||
void Telemetry.capture(
|
||||
"autocomplete",
|
||||
{
|
||||
...restOfOutcome,
|
||||
accepted: restOfOutcome.accepted,
|
||||
cacheHit: restOfOutcome.cacheHit,
|
||||
completionId: restOfOutcome.completionId,
|
||||
completionOptions: restOfOutcome.completionOptions,
|
||||
debounceDelay: restOfOutcome.debounceDelay,
|
||||
fileExtension: restOfOutcome.filepath.split(".")?.slice(-1)[0],
|
||||
maxPromptTokens: restOfOutcome.maxPromptTokens,
|
||||
modelName: restOfOutcome.modelName,
|
||||
modelProvider: restOfOutcome.modelProvider,
|
||||
multilineCompletions: restOfOutcome.multilineCompletions,
|
||||
time: restOfOutcome.time,
|
||||
useRecentlyEdited: restOfOutcome.useRecentlyEdited,
|
||||
useRootPathContext: restOfOutcome.useRootPathContext,
|
||||
},
|
||||
true,
|
||||
);
|
||||
|
|
@ -473,18 +480,6 @@ export class CompletionProvider {
|
|||
llm.model = TRIAL_FIM_MODEL;
|
||||
}
|
||||
|
||||
if (
|
||||
!shownGptClaudeWarning &&
|
||||
nonAutocompleteModels.some((model) => llm.model.includes(model)) &&
|
||||
!llm.model.toLowerCase().includes("deepseek") &&
|
||||
!llm.model.toLowerCase().includes("codestral")
|
||||
) {
|
||||
shownGptClaudeWarning = true;
|
||||
throw new Error(
|
||||
`Warning: ${llm.model} is not trained for tab-autocomplete, and will result in low-quality suggestions. See the docs to learn more about why: https://docs.continue.dev/features/tab-autocomplete#i-want-better-completions-should-i-use-gpt-4`,
|
||||
);
|
||||
}
|
||||
|
||||
// Prompt
|
||||
let fullPrefix =
|
||||
getRangeInString(fileContents, {
|
||||
|
|
@ -494,11 +489,10 @@ export class CompletionProvider {
|
|||
|
||||
if (input.injectDetails) {
|
||||
const lines = fullPrefix.split("\n");
|
||||
fullPrefix = `${lines.slice(0, -1).join("\n")}\n${
|
||||
lang.singleLineComment
|
||||
} ${input.injectDetails
|
||||
.split("\n")
|
||||
.join(`\n${lang.singleLineComment} `)}\n${lines[lines.length - 1]}`;
|
||||
fullPrefix = `${lines.slice(0, -1).join("\n")}\n${lang.singleLineComment
|
||||
} ${input.injectDetails
|
||||
.split("\n")
|
||||
.join(`\n${lang.singleLineComment} `)}\n${lines[lines.length - 1]}`;
|
||||
}
|
||||
|
||||
const fullSuffix = getRangeInString(fileContents, {
|
||||
|
|
@ -519,17 +513,17 @@ export class CompletionProvider {
|
|||
|
||||
let extrasSnippets = options.useOtherFiles
|
||||
? ((await Promise.race([
|
||||
this.getDefinitionsFromLsp(
|
||||
filepath,
|
||||
fullPrefix + fullSuffix,
|
||||
fullPrefix.length,
|
||||
this.ide,
|
||||
lang,
|
||||
),
|
||||
new Promise((resolve) => {
|
||||
setTimeout(() => resolve([]), 100);
|
||||
}),
|
||||
])) as AutocompleteSnippet[])
|
||||
this.getDefinitionsFromLsp(
|
||||
filepath,
|
||||
fullPrefix + fullSuffix,
|
||||
fullPrefix.length,
|
||||
this.ide,
|
||||
lang,
|
||||
),
|
||||
new Promise((resolve) => {
|
||||
setTimeout(() => resolve([]), 100);
|
||||
}),
|
||||
])) as AutocompleteSnippet[])
|
||||
: [];
|
||||
|
||||
const workspaceDirs = await this.ide.getWorkspaceDirs();
|
||||
|
|
@ -568,8 +562,8 @@ export class CompletionProvider {
|
|||
completionOptions,
|
||||
compilePrefixSuffix = undefined,
|
||||
} = options.template
|
||||
? { template: options.template, completionOptions: {} }
|
||||
: getTemplateForModel(llm.model);
|
||||
? { template: options.template, completionOptions: {} }
|
||||
: getTemplateForModel(llm.model);
|
||||
|
||||
let prompt: string;
|
||||
const filename = getBasename(filepath);
|
||||
|
|
@ -666,14 +660,14 @@ export class CompletionProvider {
|
|||
() =>
|
||||
llm.supportsFim()
|
||||
? llm.streamFim(prefix, suffix, {
|
||||
...completionOptions,
|
||||
stop,
|
||||
})
|
||||
...completionOptions,
|
||||
stop,
|
||||
})
|
||||
: llm.streamComplete(prompt, {
|
||||
...completionOptions,
|
||||
raw: true,
|
||||
stop,
|
||||
}),
|
||||
...completionOptions,
|
||||
raw: true,
|
||||
stop,
|
||||
}),
|
||||
multiline,
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -95,10 +95,10 @@ export async function getPromptParts(
|
|||
}
|
||||
|
||||
let filePrefix = fullFileContentsList
|
||||
.slice(curStartLine, maxStartLine)
|
||||
.slice(curStartLine, maxStartLine - 1)
|
||||
.join("\n");
|
||||
let fileSuffix = fullFileContentsList
|
||||
.slice(minEndLine, curEndLine - 1)
|
||||
.slice(minEndLine, curEndLine + 1)
|
||||
.join("\n");
|
||||
|
||||
if (rif.contents.length > 0) {
|
||||
|
|
|
|||
|
|
@ -1,22 +1,20 @@
|
|||
import { ContinueProxyReranker } from "../../context/rerankers/ContinueProxyReranker.js";
|
||||
import { ControlPlaneProxyInfo } from "../../control-plane/analytics/IAnalyticsProvider.js";
|
||||
import {
|
||||
ControlPlaneClient,
|
||||
DEFAULT_CONTROL_PLANE_PROXY_URL,
|
||||
} from "../../control-plane/client.js";
|
||||
import { TeamAnalytics } from "../../control-plane/TeamAnalytics.js";
|
||||
import {
|
||||
ContinueConfig,
|
||||
ContinueRcJson,
|
||||
IDE,
|
||||
IdeSettings,
|
||||
SerializedContinueConfig,
|
||||
} from "../../index.js";
|
||||
import ContinueProxyEmbeddingsProvider from "../../indexing/embeddings/ContinueProxyEmbeddingsProvider.js";
|
||||
import ContinueProxy from "../../llm/llms/stubs/ContinueProxy.js";
|
||||
import { Telemetry } from "../../util/posthog.js";
|
||||
import { TTS } from "../../util/tts.js";
|
||||
import { ConfigResult, loadFullConfigNode } from "../load.js";
|
||||
} from "../../";
|
||||
import { ContinueProxyReranker } from "../../context/rerankers/ContinueProxyReranker.js";
|
||||
import { ControlPlaneProxyInfo } from "../../control-plane/analytics/IAnalyticsProvider.js";
|
||||
import { ControlPlaneClient } from "../../control-plane/client.js";
|
||||
import { controlPlaneEnv } from "../../control-plane/env.js";
|
||||
import { TeamAnalytics } from "../../control-plane/TeamAnalytics.js";
|
||||
import ContinueProxyEmbeddingsProvider from "../../indexing/embeddings/ContinueProxyEmbeddingsProvider";
|
||||
import ContinueProxy from "../../llm/llms/stubs/ContinueProxy";
|
||||
import { Telemetry } from "../../util/posthog";
|
||||
import { TTS } from "../../util/tts";
|
||||
import { ConfigResult, loadFullConfigNode } from "../load";
|
||||
|
||||
export default async function doLoadConfig(
|
||||
ide: IDE,
|
||||
|
|
@ -26,13 +24,7 @@ export default async function doLoadConfig(
|
|||
overrideConfigJson: SerializedContinueConfig | undefined,
|
||||
workspaceId?: string,
|
||||
): Promise<ConfigResult<ContinueConfig>> {
|
||||
let workspaceConfigs: ContinueRcJson[] = [];
|
||||
try {
|
||||
workspaceConfigs = await ide.getWorkspaceConfigs();
|
||||
} catch (e) {
|
||||
console.warn("Failed to load workspace configs");
|
||||
}
|
||||
|
||||
const workspaceConfigs = await getWorkspaceConfigs(ide);
|
||||
const ideInfo = await ide.getIdeInfo();
|
||||
const uniqueId = await ide.getUniqueId();
|
||||
const ideSettings = await ideSettingsPromise;
|
||||
|
|
@ -71,10 +63,13 @@ export default async function doLoadConfig(
|
|||
await TTS.setup();
|
||||
|
||||
// Set up control plane proxy if configured
|
||||
let controlPlaneProxyUrl: string =
|
||||
(newConfig as any).controlPlane?.useContinueForTeamsProxy === false
|
||||
? (newConfig as any).controlPlane?.proxyUrl
|
||||
: DEFAULT_CONTROL_PLANE_PROXY_URL;
|
||||
const controlPlane = (newConfig as any).controlPlane;
|
||||
const useOnPremProxy =
|
||||
controlPlane?.useContinueForTeamsProxy === false && controlPlane?.proxyUrl;
|
||||
let controlPlaneProxyUrl: string = useOnPremProxy
|
||||
? controlPlane?.proxyUrl
|
||||
: controlPlaneEnv.DEFAULT_CONTROL_PLANE_PROXY_URL;
|
||||
|
||||
if (!controlPlaneProxyUrl.endsWith("/")) {
|
||||
controlPlaneProxyUrl += "/";
|
||||
}
|
||||
|
|
@ -127,3 +122,21 @@ async function injectControlPlaneProxyInfo(
|
|||
|
||||
return config;
|
||||
}
|
||||
|
||||
async function getWorkspaceConfigs(ide: IDE): Promise<ContinueRcJson[]> {
|
||||
const ideInfo = await ide.getIdeInfo();
|
||||
let workspaceConfigs: ContinueRcJson[] = [];
|
||||
|
||||
try {
|
||||
workspaceConfigs = await ide.getWorkspaceConfigs();
|
||||
|
||||
// Config is sent over the wire from JB so we need to parse it
|
||||
if (ideInfo.ideType === "jetbrains") {
|
||||
workspaceConfigs = (workspaceConfigs as any).map(JSON.parse);
|
||||
}
|
||||
} catch (e) {
|
||||
console.debug("Failed to load workspace configs: ", e);
|
||||
}
|
||||
|
||||
return workspaceConfigs;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { SerializedContinueConfig } from "../";
|
||||
import { ModelDescription, SerializedContinueConfig } from "../";
|
||||
import { Telemetry } from "../util/posthog";
|
||||
|
||||
export interface ConfigValidationError {
|
||||
|
|
@ -14,7 +14,7 @@ export interface ConfigValidationError {
|
|||
export function validateConfig(config: SerializedContinueConfig) {
|
||||
const errors: ConfigValidationError[] = [];
|
||||
|
||||
// Validate models
|
||||
// Validate chat models
|
||||
if (!Array.isArray(config.models) || config.models.length === 0) {
|
||||
errors.push({
|
||||
fatal: true,
|
||||
|
|
@ -37,6 +37,36 @@ export function validateConfig(config: SerializedContinueConfig) {
|
|||
});
|
||||
}
|
||||
|
||||
// Validate tab autocomplete model(s)
|
||||
if (config.tabAutocompleteModel) {
|
||||
function validateTabAutocompleteModel(modelDescription: ModelDescription) {
|
||||
const modelName = modelDescription.model.toLowerCase();
|
||||
const nonAutocompleteModels = [
|
||||
// "gpt",
|
||||
// "claude",
|
||||
"mistral",
|
||||
"instruct",
|
||||
];
|
||||
|
||||
if (
|
||||
nonAutocompleteModels.some((m) => modelName.includes(m)) &&
|
||||
!modelName.includes("deepseek") &&
|
||||
!modelName.includes("codestral")
|
||||
) {
|
||||
errors.push({
|
||||
fatal: false,
|
||||
message: `${modelDescription.model} is not trained for tab-autocomplete, and will result in low-quality suggestions. See the docs to learn more about why: https://docs.continue.dev/features/tab-autocomplete#i-want-better-completions-should-i-use-gpt-4`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (Array.isArray(config.tabAutocompleteModel)) {
|
||||
config.tabAutocompleteModel.forEach(validateTabAutocompleteModel);
|
||||
} else {
|
||||
validateTabAutocompleteModel(config.tabAutocompleteModel);
|
||||
}
|
||||
}
|
||||
|
||||
// Validate slashCommands
|
||||
if (config.slashCommands) {
|
||||
if (!Array.isArray(config.slashCommands)) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { CONTROL_PLANE_URL } from "../../control-plane/client.js";
|
||||
import { controlPlaneEnv } from "../../control-plane/env.js";
|
||||
import {
|
||||
ContextItem,
|
||||
ContextProviderDescription,
|
||||
|
|
@ -36,7 +36,10 @@ class ContinueProxyContextProvider extends BaseContextProvider {
|
|||
args: LoadSubmenuItemsArgs,
|
||||
): Promise<ContextSubmenuItem[]> {
|
||||
const response = await args.fetch(
|
||||
new URL(`/proxy/context/${this.options.id}/list`, CONTROL_PLANE_URL),
|
||||
new URL(
|
||||
`/proxy/context/${this.options.id}/list`,
|
||||
controlPlaneEnv.CONTROL_PLANE_URL,
|
||||
),
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
|
|
@ -54,7 +57,10 @@ class ContinueProxyContextProvider extends BaseContextProvider {
|
|||
extras: ContextProviderExtras,
|
||||
): Promise<ContextItem[]> {
|
||||
const response = await extras.fetch(
|
||||
new URL(`/proxy/context/${this.options.id}/retrieve`, CONTROL_PLANE_URL),
|
||||
new URL(
|
||||
`/proxy/context/${this.options.id}/retrieve`,
|
||||
controlPlaneEnv.CONTROL_PLANE_URL,
|
||||
),
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
|
|
|
|||
|
|
@ -8,10 +8,7 @@ import type {
|
|||
} from "../../";
|
||||
|
||||
class CustomContextProviderClass implements IContextProvider {
|
||||
custom: CustomContextProvider;
|
||||
constructor(custom: CustomContextProvider) {
|
||||
this.custom = custom;
|
||||
}
|
||||
constructor(private custom: CustomContextProvider) {}
|
||||
|
||||
get description(): ContextProviderDescription {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { BaseContextProvider } from "../";
|
||||
import {
|
||||
ContextItem,
|
||||
ContextProviderDescription,
|
||||
|
|
@ -11,7 +12,6 @@ import {
|
|||
getUniqueFilePath,
|
||||
groupByLastNPathParts,
|
||||
} from "../../util/";
|
||||
import { BaseContextProvider } from "../";
|
||||
|
||||
const MAX_SUBMENU_ITEMS = 10_000;
|
||||
|
||||
|
|
@ -21,7 +21,6 @@ class FileContextProvider extends BaseContextProvider {
|
|||
displayTitle: "Files",
|
||||
description: "Type to search",
|
||||
type: "submenu",
|
||||
dependsOnIndexing: true,
|
||||
};
|
||||
|
||||
async getContextItems(
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ class FileTreeContextProvider extends BaseContextProvider {
|
|||
description: "Attach a representation of the file tree",
|
||||
type: "normal",
|
||||
renderInlineAs: "",
|
||||
dependsOnIndexing: true,
|
||||
};
|
||||
|
||||
async getContextItems(
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import {
|
|||
LoadSubmenuItemsArgs,
|
||||
} from "../../";
|
||||
import {
|
||||
groupByLastNPathParts,
|
||||
getBasename,
|
||||
getUniqueFilePath,
|
||||
groupByLastNPathParts,
|
||||
} from "../../util";
|
||||
import generateRepoMap from "../../util/generateRepoMap";
|
||||
|
||||
|
|
@ -25,7 +25,6 @@ class RepoMapContextProvider extends BaseContextProvider {
|
|||
displayTitle: "Repository Map",
|
||||
description: "Select a folder",
|
||||
type: "submenu",
|
||||
dependsOnIndexing: true,
|
||||
};
|
||||
|
||||
async getContextItems(
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export default class BaseRetrievalPipeline implements IRetrievalPipeline {
|
|||
}
|
||||
}
|
||||
|
||||
return chunks;
|
||||
return chunks.slice(0, n);
|
||||
}
|
||||
|
||||
protected async retrieveFts(input: string, n: number): Promise<Chunk[]> {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import generateRepoMap from "../../util/generateRepoMap";
|
|||
const SUPPORTED_MODEL_TITLE_FAMILIES = [
|
||||
"claude-3",
|
||||
"llama3.1",
|
||||
"llama3.2",
|
||||
"gemini-1.5",
|
||||
"gpt-4",
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { ConfigJson } from "@continuedev/config-types";
|
||||
import fetch, { RequestInit, Response } from "node-fetch";
|
||||
import { ModelDescription } from "../index.js";
|
||||
import { controlPlaneEnv } from "./env.js";
|
||||
|
||||
export interface ControlPlaneSessionInfo {
|
||||
accessToken: string;
|
||||
|
|
@ -21,19 +22,8 @@ export interface ControlPlaneModelDescription extends ModelDescription {}
|
|||
export const TRIAL_PROXY_URL =
|
||||
"https://proxy-server-blue-l6vsfbzhba-uw.a.run.app";
|
||||
|
||||
export const DEFAULT_CONTROL_PLANE_PROXY_URL =
|
||||
process.env.CONTROL_PLANE_ENV === "local"
|
||||
? "http://localhost:3001/"
|
||||
: "https://control-plane-api-service-i3dqylpbqa-uc.a.run.app/";
|
||||
// : "https://control-plane-proxy.continue.dev/";
|
||||
|
||||
export const CONTROL_PLANE_URL =
|
||||
process.env.CONTROL_PLANE_ENV === "local"
|
||||
? "http://localhost:3001/"
|
||||
: "https://control-plane-api-service-i3dqylpbqa-uc.a.run.app/";
|
||||
|
||||
export class ControlPlaneClient {
|
||||
private static URL = CONTROL_PLANE_URL;
|
||||
private static URL = controlPlaneEnv.CONTROL_PLANE_URL;
|
||||
private static ACCESS_TOKEN_VALID_FOR_MS = 1000 * 60 * 5; // 5 minutes
|
||||
|
||||
private lastAccessTokenRefresh = 0;
|
||||
|
|
|
|||
50
core/control-plane/env.ts
Normal file
50
core/control-plane/env.ts
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
interface ControlPlaneEnv {
|
||||
DEFAULT_CONTROL_PLANE_PROXY_URL: string;
|
||||
CONTROL_PLANE_URL: string;
|
||||
AUTH_TYPE: string;
|
||||
WORKOS_CLIENT_ID: string;
|
||||
APP_URL: string;
|
||||
}
|
||||
|
||||
export const EXTENSION_NAME = "continue";
|
||||
|
||||
const WORKOS_CLIENT_ID_PRODUCTION = "client_01J0FW6XN8N2XJAECF7NE0Y65J";
|
||||
const WORKOS_CLIENT_ID_STAGING = "client_01J0FW6XCPMJMQ3CG51RB4HBZQ";
|
||||
|
||||
const WORKOS_ENV_ID_PRODUCTION = "continue";
|
||||
const WORKOS_ENV_ID_STAGING = "continue-staging";
|
||||
|
||||
const PRODUCTION_ENV: ControlPlaneEnv = {
|
||||
DEFAULT_CONTROL_PLANE_PROXY_URL:
|
||||
"https://control-plane-api-service-i3dqylpbqa-uc.a.run.app/",
|
||||
CONTROL_PLANE_URL:
|
||||
"https://control-plane-api-service-i3dqylpbqa-uc.a.run.app/",
|
||||
AUTH_TYPE: WORKOS_ENV_ID_PRODUCTION,
|
||||
WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_PRODUCTION,
|
||||
APP_URL: "https://app.continue.dev",
|
||||
};
|
||||
|
||||
const STAGING_ENV: ControlPlaneEnv = {
|
||||
DEFAULT_CONTROL_PLANE_PROXY_URL:
|
||||
"https://control-plane-api-service-537175798139.us-central1.run.app/",
|
||||
CONTROL_PLANE_URL:
|
||||
"https://control-plane-api-service-537175798139.us-central1.run.app/",
|
||||
AUTH_TYPE: WORKOS_CLIENT_ID_STAGING,
|
||||
WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_STAGING,
|
||||
APP_URL: "https://app-preview.continue.dev",
|
||||
};
|
||||
|
||||
const LOCAL_ENV: ControlPlaneEnv = {
|
||||
DEFAULT_CONTROL_PLANE_PROXY_URL: "http://localhost:3001/",
|
||||
CONTROL_PLANE_URL: "http://localhost:3001/",
|
||||
AUTH_TYPE: WORKOS_ENV_ID_STAGING,
|
||||
WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_STAGING,
|
||||
APP_URL: "http://localhost:3000",
|
||||
};
|
||||
|
||||
export const controlPlaneEnv =
|
||||
process.env.CONTROL_PLANE_ENV === "local"
|
||||
? LOCAL_ENV
|
||||
: process.env.CONTROL_PLANE_ENV === "staging"
|
||||
? STAGING_ENV
|
||||
: PRODUCTION_ENV;
|
||||
|
|
@ -60,7 +60,7 @@ export async function* streamDiffLines(
|
|||
language: string | undefined,
|
||||
onlyOneInsertion?: boolean,
|
||||
): AsyncGenerator<DiffLine> {
|
||||
Telemetry.capture(
|
||||
void Telemetry.capture(
|
||||
"inlineEdit",
|
||||
{
|
||||
model: llm.model,
|
||||
|
|
@ -94,7 +94,6 @@ export async function* streamDiffLines(
|
|||
);
|
||||
const inept = modelIsInept(llm.model);
|
||||
|
||||
const options: LLMFullCompletionOptions = {};
|
||||
const completion =
|
||||
typeof prompt === "string"
|
||||
? llm.streamComplete(prompt, { raw: true })
|
||||
|
|
|
|||
8
core/index.d.ts
vendored
8
core/index.d.ts
vendored
|
|
@ -662,6 +662,8 @@ export type ModelName =
|
|||
| "gpt-4-turbo"
|
||||
| "gpt-4-turbo-preview"
|
||||
| "gpt-4-vision-preview"
|
||||
| "o1-preview"
|
||||
| "o1-mini"
|
||||
// Mistral
|
||||
| "codestral-latest"
|
||||
| "open-mistral-7b"
|
||||
|
|
@ -689,6 +691,12 @@ export type ModelName =
|
|||
// Llama 3.1
|
||||
| "llama3.1-8b"
|
||||
| "llama3.1-70b"
|
||||
| "llama3.1-405b"
|
||||
// Llama 3.2
|
||||
| "llama3.2-1b"
|
||||
| "llama3.2-3b"
|
||||
| "llama3.2-11b"
|
||||
| "llama3.2-90b"
|
||||
// Other Open-source
|
||||
| "phi2"
|
||||
| "phind-codellama-34b"
|
||||
|
|
|
|||
|
|
@ -23,9 +23,7 @@ export class ChunkCodebaseIndex implements CodebaseIndex {
|
|||
private readonly pathSep: string,
|
||||
private readonly continueServerClient: IContinueServerClient,
|
||||
private readonly maxChunkSize: number,
|
||||
) {
|
||||
this.readFile = readFile;
|
||||
}
|
||||
) {}
|
||||
|
||||
async *update(
|
||||
tag: IndexTag,
|
||||
|
|
|
|||
|
|
@ -299,6 +299,30 @@ const preIndexedDocs: Record<
|
|||
rootUrl: "https://docs.godotengine.org/en/latest/",
|
||||
faviconUrl: "https://godotengine.org/favicon.ico",
|
||||
},
|
||||
"https://docs.amplify.aws/react/": {
|
||||
title: "AWS Amplify (Gen 2)",
|
||||
startUrl: "https://docs.amplify.aws/react/start/",
|
||||
rootUrl: "https://docs.amplify.aws/react/",
|
||||
faviconUrl: "https://docs.amplify.aws/favicon.ico"
|
||||
},
|
||||
"https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/": {
|
||||
title: "AWS SDK for JavaScript v3",
|
||||
startUrl: "https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/",
|
||||
rootUrl: "https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/",
|
||||
faviconUrl: "https://docs.aws.amazon.com/favicon.ico"
|
||||
},
|
||||
"https://docs.aws.amazon.com/cdk/api/v2/docs/aws-construct-library.html": {
|
||||
title: "AWS CDK v2",
|
||||
startUrl: "https://docs.aws.amazon.com/cdk/api/v2/docs/aws-construct-library.html",
|
||||
rootUrl: "https://docs.aws.amazon.com/cdk/api/v2/docs/",
|
||||
faviconUrl: "https://docs.aws.amazon.com/cdk/api/v2/img/favicon-32x32.png"
|
||||
},
|
||||
"https://awscli.amazonaws.com/v2/documentation/api/latest/index.html": {
|
||||
title: "AWS CLI commands",
|
||||
startUrl: "https://awscli.amazonaws.com/v2/documentation/api/latest/index.html",
|
||||
rootUrl: "https://awscli.amazonaws.com/v2/documentation/api/latest/",
|
||||
faviconUrl: "https://docs.aws.amazon.com/favicon.ico"
|
||||
}
|
||||
};
|
||||
|
||||
export default preIndexedDocs;
|
||||
|
|
|
|||
|
|
@ -6,11 +6,14 @@ import { fromIni } from "@aws-sdk/credential-providers";
|
|||
import { EmbeddingsProviderName, EmbedOptions, FetchFunction } from "../../index.js";
|
||||
import BaseEmbeddingsProvider from "./BaseEmbeddingsProvider.js";
|
||||
|
||||
interface ModelConfig {
|
||||
formatPayload: (text: string) => any;
|
||||
extractEmbeddings: (responseBody: any) => number[][];
|
||||
}
|
||||
|
||||
class BedrockEmbeddingsProvider extends BaseEmbeddingsProvider {
|
||||
|
||||
static providerName: EmbeddingsProviderName = "bedrock";
|
||||
|
||||
static defaultOptions: Partial<EmbedOptions> | undefined = {
|
||||
static defaultOptions: Partial<EmbedOptions> = {
|
||||
model: "amazon.titan-embed-text-v2:0",
|
||||
region: "us-east-1"
|
||||
};
|
||||
|
|
@ -18,6 +21,7 @@ class BedrockEmbeddingsProvider extends BaseEmbeddingsProvider {
|
|||
|
||||
constructor(options: EmbedOptions, fetch: FetchFunction) {
|
||||
super(options, fetch);
|
||||
this.options.model = this.options.model || BedrockEmbeddingsProvider.defaultOptions.model!;
|
||||
if (!options.apiBase) {
|
||||
options.apiBase = `https://bedrock-runtime.${options.region}.amazonaws.com`;
|
||||
}
|
||||
|
|
@ -29,7 +33,7 @@ class BedrockEmbeddingsProvider extends BaseEmbeddingsProvider {
|
|||
}
|
||||
}
|
||||
|
||||
async embed(chunks: string[]) {
|
||||
async embed(chunks: string[]): Promise<number[][]> {
|
||||
const credentials = await this._getCredentials();
|
||||
const client = new BedrockRuntimeClient({
|
||||
region: this.options.region,
|
||||
|
|
@ -43,41 +47,64 @@ class BedrockEmbeddingsProvider extends BaseEmbeddingsProvider {
|
|||
return (
|
||||
await Promise.all(
|
||||
chunks.map(async (chunk) => {
|
||||
const input = this._generateInvokeModelCommandInput(chunk, this.options);
|
||||
const input = this._generateInvokeModelCommandInput(chunk);
|
||||
const command = new InvokeModelCommand(input);
|
||||
const response = await client.send(command);
|
||||
|
||||
if (response.body) {
|
||||
const responseBody = JSON.parse(new TextDecoder().decode(response.body));
|
||||
return [responseBody.embedding];
|
||||
return this._extractEmbeddings(responseBody);
|
||||
}
|
||||
return [];
|
||||
}),
|
||||
)
|
||||
).flat();
|
||||
}
|
||||
|
||||
private _generateInvokeModelCommandInput(
|
||||
prompt: string,
|
||||
options: EmbedOptions,
|
||||
): any {
|
||||
const payload = {
|
||||
"inputText": prompt,
|
||||
"dimensions": 512,
|
||||
"normalize": true
|
||||
};
|
||||
private _generateInvokeModelCommandInput(text: string): any {
|
||||
const modelConfig = this._getModelConfig();
|
||||
const payload = modelConfig.formatPayload(text);
|
||||
|
||||
return {
|
||||
body: JSON.stringify(payload),
|
||||
modelId: this.options.model,
|
||||
accept: "application/json",
|
||||
contentType: "application/json"
|
||||
accept: "*/*",
|
||||
contentType: "application/json",
|
||||
};
|
||||
}
|
||||
|
||||
private _extractEmbeddings(responseBody: any): number[][] {
|
||||
const modelConfig = this._getModelConfig();
|
||||
return modelConfig.extractEmbeddings(responseBody);
|
||||
}
|
||||
|
||||
private _getModelConfig() {
|
||||
const modelConfigs: { [key: string]: ModelConfig } = {
|
||||
'cohere': {
|
||||
formatPayload: (text: string) => ({
|
||||
texts: [text],
|
||||
input_type: "search_document",
|
||||
truncate: "END",
|
||||
}),
|
||||
extractEmbeddings: (responseBody: any) => responseBody.embeddings || [],
|
||||
},
|
||||
'amazon.titan-embed': {
|
||||
formatPayload: (text: string) => ({
|
||||
inputText: text,
|
||||
}),
|
||||
extractEmbeddings: (responseBody: any) => responseBody.embedding ? [responseBody.embedding] : [],
|
||||
},
|
||||
};
|
||||
|
||||
const modelPrefix = Object.keys(modelConfigs).find(prefix => this.options.model!.startsWith(prefix));
|
||||
if (!modelPrefix) {
|
||||
throw new Error(`Unsupported model: ${this.options.model}`);
|
||||
}
|
||||
return modelConfigs[modelPrefix];
|
||||
}
|
||||
|
||||
private async _getCredentials() {
|
||||
try {
|
||||
return await
|
||||
fromIni({
|
||||
return await fromIni({
|
||||
profile: this.profile,
|
||||
ignoreCache: true
|
||||
})();
|
||||
|
|
@ -88,7 +115,6 @@ class BedrockEmbeddingsProvider extends BaseEmbeddingsProvider {
|
|||
return await fromIni()();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default BedrockEmbeddingsProvider;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
import ignore from "ignore";
|
||||
import path from "path";
|
||||
import os from "os";
|
||||
import fs from "fs";
|
||||
|
||||
export const DEFAULT_IGNORE_FILETYPES = [
|
||||
"*.DS_Store",
|
||||
|
|
@ -114,3 +117,18 @@ export function gitIgArrayFromFile(file: string) {
|
|||
.map((l) => l.trim()) // Remove whitespace
|
||||
.filter((l) => !/^#|^$/.test(l)); // Remove empty lines
|
||||
}
|
||||
|
||||
export const GLOBAL_CONTINUEIGNORE_PATH = path.join(os.homedir(), ".continue", ".continueignore");
|
||||
|
||||
export const getGlobalContinueIgArray = () => {
|
||||
try {
|
||||
const contents = fs.readFileSync(GLOBAL_CONTINUEIGNORE_PATH, "utf8");
|
||||
return gitIgArrayFromFile(contents);
|
||||
} catch (error) {
|
||||
// If the file doesn't exist, that's okay
|
||||
if (error instanceof Error && ("code" in error) && error.code === "ENOENT") {
|
||||
return [];
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
|
@ -416,11 +416,9 @@ export async function getComputeDeleteAddRemove(
|
|||
|
||||
export class GlobalCacheCodeBaseIndex implements CodebaseIndex {
|
||||
relativeExpectedTime: number = 1;
|
||||
private db: DatabaseConnection;
|
||||
|
||||
constructor(db: DatabaseConnection) {
|
||||
this.db = db;
|
||||
}
|
||||
constructor(private db: DatabaseConnection) {}
|
||||
|
||||
artifactId = "globalCache";
|
||||
|
||||
static async create(): Promise<GlobalCacheCodeBaseIndex> {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import {
|
|||
DEFAULT_IGNORE_FILETYPES,
|
||||
defaultIgnoreDir,
|
||||
defaultIgnoreFile,
|
||||
getGlobalContinueIgArray,
|
||||
gitIgArrayFromFile,
|
||||
} from "./ignore.js";
|
||||
|
||||
|
|
@ -38,15 +39,13 @@ type IgnoreContext = {
|
|||
};
|
||||
|
||||
class DFSWalker {
|
||||
private readonly path: string;
|
||||
private readonly ide: IDE;
|
||||
private readonly options: WalkerOptions;
|
||||
private readonly ignoreFileNames: Set<string>;
|
||||
|
||||
constructor(path: string, ide: IDE, options: WalkerOptions) {
|
||||
this.path = path;
|
||||
this.ide = ide;
|
||||
this.options = options;
|
||||
constructor(
|
||||
private readonly path: string,
|
||||
private readonly ide: IDE,
|
||||
private readonly options: WalkerOptions,
|
||||
) {
|
||||
this.ignoreFileNames = new Set<string>(options.ignoreFiles);
|
||||
}
|
||||
|
||||
|
|
@ -85,6 +84,7 @@ class DFSWalker {
|
|||
}
|
||||
|
||||
private newRootWalkContext(): WalkContext {
|
||||
const globalIgnoreFile = getGlobalContinueIgArray();
|
||||
return {
|
||||
walkableEntry: {
|
||||
relPath: "",
|
||||
|
|
@ -94,7 +94,7 @@ class DFSWalker {
|
|||
},
|
||||
ignoreContexts: [
|
||||
{
|
||||
ignore: ignore().add(defaultIgnoreDir).add(defaultIgnoreFile),
|
||||
ignore: ignore().add(defaultIgnoreDir).add(defaultIgnoreFile).add(globalIgnoreFile),
|
||||
dirname: "",
|
||||
},
|
||||
],
|
||||
|
|
@ -128,10 +128,7 @@ class DFSWalker {
|
|||
ignore: ignore().add(patterns),
|
||||
dirname: curDir.walkableEntry.relPath,
|
||||
};
|
||||
return [
|
||||
...curDir.ignoreContexts,
|
||||
newIgnoreContext
|
||||
];
|
||||
return [...curDir.ignoreContexts, newIgnoreContext];
|
||||
}
|
||||
|
||||
private async loadIgnoreFiles(entries: WalkableEntry[]): Promise<string[]> {
|
||||
|
|
@ -147,7 +144,10 @@ class DFSWalker {
|
|||
return this.ignoreFileNames.has(p);
|
||||
}
|
||||
|
||||
private shouldInclude(walkableEntry: WalkableEntry, ignoreContexts: IgnoreContext[]) {
|
||||
private shouldInclude(
|
||||
walkableEntry: WalkableEntry,
|
||||
ignoreContexts: IgnoreContext[],
|
||||
) {
|
||||
if (this.entryIsSymlink(walkableEntry.entry)) {
|
||||
// If called from the root, a symlink either links to a real file in this repository,
|
||||
// and therefore will be walked OR it linksto something outside of the repository and
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ const MODEL_SUPPORTS_IMAGES: string[] = [
|
|||
"opus",
|
||||
"haiku",
|
||||
"pixtral",
|
||||
"llama3.2",
|
||||
];
|
||||
|
||||
function modelSupportsImages(
|
||||
|
|
|
|||
|
|
@ -111,7 +111,15 @@ class Bedrock extends BaseLLM {
|
|||
maxTokens: options.maxTokens,
|
||||
temperature: options.temperature,
|
||||
topP: options.topP,
|
||||
stopSequences: options.stop?.filter((stop) => stop.trim() !== ""),
|
||||
// TODO: The current approach selects the first 4 items from the list to comply with Bedrock's requirement
|
||||
// of having at most 4 stop sequences, as per the AWS documentation:
|
||||
// https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_InferenceConfiguration.html
|
||||
// However, it might be better to implement a strategy that dynamically selects the most appropriate stop sequences
|
||||
// based on the context.
|
||||
// TODO: Additionally, consider implementing a global exception handler for the providers to give users clearer feedback.
|
||||
// For example, differentiate between client-side errors (4XX status codes) and server-side issues (5XX status codes),
|
||||
// providing meaningful error messages to improve the user experience.
|
||||
stopSequences: options.stop?.filter((stop) => stop.trim() !== "").slice(0, 4),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ class Groq extends OpenAI {
|
|||
"llama3.1-8b": "llama-3.1-8b-instant",
|
||||
"llama3.1-70b": "llama-3.1-70b-versatile",
|
||||
"llama3.1-405b": "llama-3.1-405b-reasoning",
|
||||
"llama3.2-1b": "llama-3.2-1b-preview",
|
||||
"llama3.2-3b": "llama-3.2-3b-preview",
|
||||
"llama3.2-11b": "llama-3.2-11b-vision-preview",
|
||||
"llama3.2-90b": "llama-3.2-90b-vision-preview",
|
||||
};
|
||||
protected _convertModelName(model: string): string {
|
||||
return Groq.modelConversion[model] ?? model;
|
||||
|
|
|
|||
|
|
@ -101,6 +101,10 @@ class Ollama extends BaseLLM {
|
|||
"llama3.1-8b": "llama3.1:8b",
|
||||
"llama3.1-70b": "llama3.1:70b",
|
||||
"llama3.1-405b": "llama3.1:405b",
|
||||
"llama3.2-1b": "llama3.2:1b",
|
||||
"llama3.2-3b": "llama3.2:3b",
|
||||
"llama3.2-11b": "llama3.2:11b",
|
||||
"llama3.2-90b": "llama3.2:90b",
|
||||
"phi-2": "phi:2.7b",
|
||||
"phind-codellama-34b": "phind-codellama:34b-v2",
|
||||
"wizardcoder-7b": "wizardcoder:7b-python",
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ const CHAT_ONLY_MODELS = [
|
|||
"gpt-4-0125-preview",
|
||||
"gpt-4-1106-preview",
|
||||
"gpt-4o-mini",
|
||||
"o1-preview",
|
||||
"o1-mini",
|
||||
];
|
||||
|
||||
class OpenAI extends BaseLLM {
|
||||
|
|
@ -111,9 +113,9 @@ class OpenAI extends BaseLLM {
|
|||
: url.host === "api.deepseek.com"
|
||||
? options.stop?.slice(0, 16)
|
||||
: url.port === "1337" ||
|
||||
url.host === "api.openai.com" ||
|
||||
url.host === "api.groq.com" ||
|
||||
this.apiType === "azure"
|
||||
url.host === "api.openai.com" ||
|
||||
url.host === "api.groq.com" ||
|
||||
this.apiType === "azure"
|
||||
? options.stop?.slice(0, 4)
|
||||
: options.stop,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ class SambaNova extends OpenAI {
|
|||
"llama3.1-8b": "Meta-Llama-3.1-8B-Instruct",
|
||||
"llama3.1-70b": "Meta-Llama-3.1-70B-Instruct",
|
||||
"llama3.1-405b": "Meta-Llama-3.1-405B-Instruct",
|
||||
"llama3.1-1b": "Meta-Llama-3.2-1B-Instruct",
|
||||
"llama3.1-3b": "Meta-Llama-3.2-3B-Instruct",
|
||||
};
|
||||
|
||||
protected _convertModelName(model: string) {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ class Together extends OpenAI {
|
|||
"llama3.1-8b": "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
|
||||
"llama3.1-70b": "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
|
||||
"llama3.1-405b": "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
|
||||
"llama3.2-3b": "meta-llama/Llama-3.2-3B-Instruct-Turbo",
|
||||
"llama3.2-11b": "meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo",
|
||||
"llama3.2-90b": "meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo",
|
||||
"llama2-7b": "togethercomputer/llama-2-7b-chat",
|
||||
"llama2-13b": "togethercomputer/llama-2-13b-chat",
|
||||
"llama2-70b": "togethercomputer/llama-2-70b-chat",
|
||||
|
|
|
|||
78
core/package-lock.json
generated
78
core/package-lock.json
generated
|
|
@ -17,7 +17,6 @@
|
|||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
"@typescript-eslint/parser": "^7.8.0",
|
||||
"@xenova/transformers": "2.14.0",
|
||||
"adf-to-md": "^1.1.0",
|
||||
"async-mutex": "^0.5.0",
|
||||
|
|
@ -89,7 +88,6 @@
|
|||
"cross-env": "^7.0.3",
|
||||
"esbuild": "0.17.19",
|
||||
"eslint": "^8",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"myers-diff": "^2.1.0",
|
||||
|
|
@ -4969,7 +4967,8 @@
|
|||
"node_modules/@types/json5": {
|
||||
"version": "0.0.29",
|
||||
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
|
||||
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ=="
|
||||
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@types/long": {
|
||||
"version": "4.0.2",
|
||||
|
|
@ -5224,6 +5223,7 @@
|
|||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.10.0.tgz",
|
||||
"integrity": "sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "7.10.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
|
|
@ -5645,6 +5645,7 @@
|
|||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz",
|
||||
"integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.5",
|
||||
"is-array-buffer": "^3.0.4"
|
||||
|
|
@ -5660,6 +5661,7 @@
|
|||
"version": "3.1.8",
|
||||
"resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz",
|
||||
"integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"define-properties": "^1.2.1",
|
||||
|
|
@ -5692,6 +5694,7 @@
|
|||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz",
|
||||
"integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"define-properties": "^1.2.1",
|
||||
|
|
@ -5711,6 +5714,7 @@
|
|||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz",
|
||||
"integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"define-properties": "^1.2.0",
|
||||
|
|
@ -5728,6 +5732,7 @@
|
|||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz",
|
||||
"integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"define-properties": "^1.2.0",
|
||||
|
|
@ -5745,6 +5750,7 @@
|
|||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz",
|
||||
"integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"array-buffer-byte-length": "^1.0.1",
|
||||
"call-bind": "^1.0.5",
|
||||
|
|
@ -5806,6 +5812,7 @@
|
|||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz",
|
||||
"integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"possible-typed-array-names": "^1.0.0"
|
||||
},
|
||||
|
|
@ -6901,6 +6908,7 @@
|
|||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz",
|
||||
"integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.6",
|
||||
"es-errors": "^1.3.0",
|
||||
|
|
@ -6917,6 +6925,7 @@
|
|||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz",
|
||||
"integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"es-errors": "^1.3.0",
|
||||
|
|
@ -6933,6 +6942,7 @@
|
|||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz",
|
||||
"integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.6",
|
||||
"es-errors": "^1.3.0",
|
||||
|
|
@ -7396,6 +7406,7 @@
|
|||
"version": "1.23.3",
|
||||
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz",
|
||||
"integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"array-buffer-byte-length": "^1.0.1",
|
||||
"arraybuffer.prototype.slice": "^1.0.3",
|
||||
|
|
@ -7485,6 +7496,7 @@
|
|||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz",
|
||||
"integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"get-intrinsic": "^1.2.4",
|
||||
"has-tostringtag": "^1.0.2",
|
||||
|
|
@ -7498,6 +7510,7 @@
|
|||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz",
|
||||
"integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"hasown": "^2.0.0"
|
||||
}
|
||||
|
|
@ -7506,6 +7519,7 @@
|
|||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
|
||||
"integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"is-callable": "^1.1.4",
|
||||
"is-date-object": "^1.0.1",
|
||||
|
|
@ -7690,6 +7704,7 @@
|
|||
"version": "0.3.9",
|
||||
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz",
|
||||
"integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"debug": "^3.2.7",
|
||||
"is-core-module": "^2.13.0",
|
||||
|
|
@ -7700,6 +7715,7 @@
|
|||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
|
|
@ -7708,6 +7724,7 @@
|
|||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz",
|
||||
"integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"debug": "^3.2.7"
|
||||
},
|
||||
|
|
@ -7724,6 +7741,7 @@
|
|||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
|
|
@ -7732,6 +7750,7 @@
|
|||
"version": "2.29.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz",
|
||||
"integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"array-includes": "^3.1.7",
|
||||
"array.prototype.findlastindex": "^1.2.3",
|
||||
|
|
@ -7762,6 +7781,7 @@
|
|||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
|
|
@ -7771,6 +7791,7 @@
|
|||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
|
|
@ -7779,6 +7800,7 @@
|
|||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
|
||||
"integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esutils": "^2.0.2"
|
||||
},
|
||||
|
|
@ -7790,6 +7812,7 @@
|
|||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
|
|
@ -7801,6 +7824,7 @@
|
|||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
}
|
||||
|
|
@ -8258,6 +8282,7 @@
|
|||
"version": "0.3.3",
|
||||
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
|
||||
"integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"is-callable": "^1.1.3"
|
||||
}
|
||||
|
|
@ -8413,6 +8438,7 @@
|
|||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz",
|
||||
"integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"define-properties": "^1.2.0",
|
||||
|
|
@ -8430,6 +8456,7 @@
|
|||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz",
|
||||
"integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==",
|
||||
"peer": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
|
|
@ -8593,6 +8620,7 @@
|
|||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz",
|
||||
"integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.5",
|
||||
"es-errors": "^1.3.0",
|
||||
|
|
@ -8708,6 +8736,7 @@
|
|||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz",
|
||||
"integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"define-properties": "^1.2.1",
|
||||
"gopd": "^1.0.1"
|
||||
|
|
@ -8904,6 +8933,7 @@
|
|||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz",
|
||||
"integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==",
|
||||
"peer": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
|
|
@ -8961,6 +8991,7 @@
|
|||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
|
||||
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"has-symbols": "^1.0.3"
|
||||
},
|
||||
|
|
@ -9209,6 +9240,7 @@
|
|||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz",
|
||||
"integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"hasown": "^2.0.0",
|
||||
|
|
@ -9234,6 +9266,7 @@
|
|||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz",
|
||||
"integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"get-intrinsic": "^1.2.1"
|
||||
|
|
@ -9254,6 +9287,7 @@
|
|||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz",
|
||||
"integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"has-bigints": "^1.0.1"
|
||||
},
|
||||
|
|
@ -9265,6 +9299,7 @@
|
|||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz",
|
||||
"integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"has-tostringtag": "^1.0.0"
|
||||
|
|
@ -9280,6 +9315,7 @@
|
|||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
|
||||
"integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
|
|
@ -9302,6 +9338,7 @@
|
|||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz",
|
||||
"integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"is-typed-array": "^1.1.13"
|
||||
},
|
||||
|
|
@ -9316,6 +9353,7 @@
|
|||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz",
|
||||
"integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"has-tostringtag": "^1.0.0"
|
||||
},
|
||||
|
|
@ -9377,6 +9415,7 @@
|
|||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz",
|
||||
"integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
|
|
@ -9396,6 +9435,7 @@
|
|||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz",
|
||||
"integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"has-tostringtag": "^1.0.0"
|
||||
},
|
||||
|
|
@ -9428,6 +9468,7 @@
|
|||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
|
||||
"integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"has-tostringtag": "^1.0.0"
|
||||
|
|
@ -9443,6 +9484,7 @@
|
|||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz",
|
||||
"integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7"
|
||||
},
|
||||
|
|
@ -9468,6 +9510,7 @@
|
|||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz",
|
||||
"integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"has-tostringtag": "^1.0.0"
|
||||
},
|
||||
|
|
@ -9482,6 +9525,7 @@
|
|||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
|
||||
"integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"has-symbols": "^1.0.2"
|
||||
},
|
||||
|
|
@ -9496,6 +9540,7 @@
|
|||
"version": "1.1.13",
|
||||
"resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz",
|
||||
"integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"which-typed-array": "^1.1.14"
|
||||
},
|
||||
|
|
@ -9515,6 +9560,7 @@
|
|||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz",
|
||||
"integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2"
|
||||
},
|
||||
|
|
@ -9525,7 +9571,8 @@
|
|||
"node_modules/isarray": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
|
||||
"integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="
|
||||
"integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/isexe": {
|
||||
"version": "2.0.0",
|
||||
|
|
@ -11569,6 +11616,7 @@
|
|||
"version": "1.13.1",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
|
||||
"integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==",
|
||||
"peer": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
|
|
@ -11615,6 +11663,7 @@
|
|||
"version": "2.0.8",
|
||||
"resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz",
|
||||
"integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"define-properties": "^1.2.1",
|
||||
|
|
@ -11632,6 +11681,7 @@
|
|||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz",
|
||||
"integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"define-properties": "^1.2.1",
|
||||
|
|
@ -11645,6 +11695,7 @@
|
|||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz",
|
||||
"integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"define-properties": "^1.2.1",
|
||||
|
|
@ -12294,6 +12345,7 @@
|
|||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz",
|
||||
"integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
|
|
@ -12869,6 +12921,7 @@
|
|||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz",
|
||||
"integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.6",
|
||||
"define-properties": "^1.2.1",
|
||||
|
|
@ -13142,6 +13195,7 @@
|
|||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz",
|
||||
"integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"get-intrinsic": "^1.2.4",
|
||||
|
|
@ -13178,6 +13232,7 @@
|
|||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz",
|
||||
"integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.6",
|
||||
"es-errors": "^1.3.0",
|
||||
|
|
@ -13248,6 +13303,7 @@
|
|||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz",
|
||||
"integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"define-data-property": "^1.1.4",
|
||||
"es-errors": "^1.3.0",
|
||||
|
|
@ -13303,6 +13359,7 @@
|
|||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz",
|
||||
"integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"es-errors": "^1.3.0",
|
||||
|
|
@ -13724,6 +13781,7 @@
|
|||
"version": "1.2.9",
|
||||
"resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz",
|
||||
"integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"define-properties": "^1.2.1",
|
||||
|
|
@ -13741,6 +13799,7 @@
|
|||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz",
|
||||
"integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"define-properties": "^1.2.1",
|
||||
|
|
@ -13754,6 +13813,7 @@
|
|||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz",
|
||||
"integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"define-properties": "^1.2.1",
|
||||
|
|
@ -14184,6 +14244,7 @@
|
|||
"version": "3.15.0",
|
||||
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz",
|
||||
"integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/json5": "^0.0.29",
|
||||
"json5": "^1.0.2",
|
||||
|
|
@ -14195,6 +14256,7 @@
|
|||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
|
||||
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.0"
|
||||
},
|
||||
|
|
@ -14206,6 +14268,7 @@
|
|||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
|
||||
"integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
|
|
@ -14266,6 +14329,7 @@
|
|||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz",
|
||||
"integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"es-errors": "^1.3.0",
|
||||
|
|
@ -14279,6 +14343,7 @@
|
|||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz",
|
||||
"integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"for-each": "^0.3.3",
|
||||
|
|
@ -14297,6 +14362,7 @@
|
|||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz",
|
||||
"integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"available-typed-arrays": "^1.0.7",
|
||||
"call-bind": "^1.0.7",
|
||||
|
|
@ -14316,6 +14382,7 @@
|
|||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz",
|
||||
"integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"for-each": "^0.3.3",
|
||||
|
|
@ -14374,6 +14441,7 @@
|
|||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz",
|
||||
"integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"has-bigints": "^1.0.2",
|
||||
|
|
@ -14720,6 +14788,7 @@
|
|||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
|
||||
"integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"is-bigint": "^1.0.1",
|
||||
"is-boolean-object": "^1.1.0",
|
||||
|
|
@ -14735,6 +14804,7 @@
|
|||
"version": "1.1.15",
|
||||
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz",
|
||||
"integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"available-typed-arrays": "^1.0.7",
|
||||
"call-bind": "^1.0.7",
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
"cross-env": "^7.0.3",
|
||||
"esbuild": "0.17.19",
|
||||
"eslint": "^8",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"myers-diff": "^2.1.0",
|
||||
|
|
@ -49,7 +48,6 @@
|
|||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
"@typescript-eslint/parser": "^7.8.0",
|
||||
"@xenova/transformers": "2.14.0",
|
||||
"adf-to-md": "^1.1.0",
|
||||
"async-mutex": "^0.5.0",
|
||||
|
|
|
|||
|
|
@ -15,7 +15,12 @@ export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & {
|
|||
},
|
||||
];
|
||||
openUrl: [string, void];
|
||||
applyToCurrentFile: [{ text: string; streamId: string }, void];
|
||||
// We pass the `curSelectedModel` because we currently cannot access the
|
||||
// default model title in the GUI from JB
|
||||
applyToCurrentFile: [
|
||||
{ text: string; streamId: string; curSelectedModelTitle: string },
|
||||
void,
|
||||
];
|
||||
showTutorial: [undefined, void];
|
||||
showFile: [{ filepath: string }, void];
|
||||
openConfigJson: [undefined, void];
|
||||
|
|
@ -66,6 +71,7 @@ export type ToWebviewFromIdeProtocol = ToWebviewFromIdeOrCoreProtocol & {
|
|||
* @deprecated Use navigateTo with a path instead.
|
||||
*/
|
||||
viewHistory: [undefined, void];
|
||||
focusContinueSessionId: [{ sessionId: string | undefined }, void];
|
||||
newSession: [undefined, void];
|
||||
setTheme: [{ theme: any }, void];
|
||||
setColors: [{ [key: string]: string }, void];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import fs from "node:fs";
|
||||
import { getGlobalContextFilePath } from "./paths";
|
||||
import { EmbeddingsProvider } from "../";
|
||||
import { getGlobalContextFilePath } from "./paths";
|
||||
|
||||
export type GlobalContextType = {
|
||||
indexingPaused: boolean;
|
||||
|
|
@ -37,7 +37,15 @@ export class GlobalContext {
|
|||
);
|
||||
} else {
|
||||
const data = fs.readFileSync(getGlobalContextFilePath(), "utf-8");
|
||||
const parsed = JSON.parse(data);
|
||||
|
||||
let parsed;
|
||||
try {
|
||||
parsed = JSON.parse(data);
|
||||
} catch (e: any) {
|
||||
console.warn(`Error updating global context: ${e}`);
|
||||
return;
|
||||
}
|
||||
|
||||
parsed[key] = value;
|
||||
fs.writeFileSync(
|
||||
getGlobalContextFilePath(),
|
||||
|
|
@ -54,7 +62,12 @@ export class GlobalContext {
|
|||
}
|
||||
|
||||
const data = fs.readFileSync(getGlobalContextFilePath(), "utf-8");
|
||||
const parsed = JSON.parse(data);
|
||||
return parsed[key];
|
||||
try {
|
||||
const parsed = JSON.parse(data);
|
||||
return parsed[key];
|
||||
} catch (e: any) {
|
||||
console.warn(`Error parsing global context: ${e}`);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,6 @@ export interface RepoMapOptions {
|
|||
}
|
||||
|
||||
class RepoMapGenerator {
|
||||
private llm: ILLM;
|
||||
private ide: IDE;
|
||||
private options: RepoMapOptions;
|
||||
private maxRepoMapTokens: number;
|
||||
|
||||
private repoMapPath: string = getRepoMapFilePath();
|
||||
|
|
@ -32,10 +29,11 @@ class RepoMapGenerator {
|
|||
"this map contains the name of the file, and the signature for any " +
|
||||
"classes, methods, or functions in the file.\n\n";
|
||||
|
||||
constructor(llm: ILLM, ide: IDE, options: RepoMapOptions) {
|
||||
this.llm = llm;
|
||||
this.ide = ide;
|
||||
this.options = options;
|
||||
constructor(
|
||||
private llm: ILLM,
|
||||
private ide: IDE,
|
||||
private options: RepoMapOptions,
|
||||
) {
|
||||
this.maxRepoMapTokens =
|
||||
llm.contextLength * this.REPO_MAX_CONTEXT_LENGTH_RATIO;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,18 @@ import { PersistedSessionInfo, SessionInfo } from "../index.js";
|
|||
import { ListHistoryOptions } from "../protocol/core.js";
|
||||
import { getSessionFilePath, getSessionsListPath } from "./paths.js";
|
||||
|
||||
function safeParseArray<T>(
|
||||
value: string,
|
||||
errorMessage: string = "Error parsing array",
|
||||
): T[] | undefined {
|
||||
try {
|
||||
return JSON.parse(value) as T[];
|
||||
} catch (e: any) {
|
||||
console.warn(`${errorMessage}: ${e}`);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
class HistoryManager {
|
||||
list(options: ListHistoryOptions): SessionInfo[] {
|
||||
const filepath = getSessionsListPath();
|
||||
|
|
@ -10,7 +22,9 @@ class HistoryManager {
|
|||
return [];
|
||||
}
|
||||
const content = fs.readFileSync(filepath, "utf8");
|
||||
let sessions = JSON.parse(content).filter((session: any) => {
|
||||
|
||||
let sessions = safeParseArray<SessionInfo>(content) ?? [];
|
||||
sessions = sessions.filter((session: any) => {
|
||||
// Filter out old format
|
||||
return typeof session.session_id !== "string";
|
||||
});
|
||||
|
|
@ -35,14 +49,11 @@ class HistoryManager {
|
|||
// Read and update the sessions list
|
||||
const sessionsListFile = getSessionsListPath();
|
||||
const sessionsListRaw = fs.readFileSync(sessionsListFile, "utf-8");
|
||||
let sessionsList: SessionInfo[];
|
||||
try {
|
||||
sessionsList = JSON.parse(sessionsListRaw);
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
`It looks like there is a JSON formatting error in your sessions.json file (${sessionsListFile}). Please fix this before creating a new session.`,
|
||||
);
|
||||
}
|
||||
let sessionsList =
|
||||
safeParseArray<SessionInfo>(
|
||||
sessionsListRaw,
|
||||
"Error parsing sessions.json",
|
||||
) ?? [];
|
||||
|
||||
sessionsList = sessionsList.filter(
|
||||
(session) => session.sessionId !== sessionId,
|
||||
|
|
|
|||
|
|
@ -13,22 +13,34 @@ export class Telemetry {
|
|||
event: string,
|
||||
properties: { [key: string]: any },
|
||||
sendToTeam: boolean = false,
|
||||
isExtensionActivationError: boolean = false,
|
||||
) {
|
||||
if (process.env.NODE_ENV === "test") {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Telemetry.client?.capture({
|
||||
const augmentedProperties = {
|
||||
...properties,
|
||||
os: Telemetry.os,
|
||||
extensionVersion: Telemetry.ideInfo?.extensionVersion,
|
||||
ideName: Telemetry.ideInfo?.name,
|
||||
ideType: Telemetry.ideInfo?.ideType,
|
||||
};
|
||||
const payload = {
|
||||
distinctId: Telemetry.uniqueId,
|
||||
event,
|
||||
properties: {
|
||||
...properties,
|
||||
os: Telemetry.os,
|
||||
extensionVersion: Telemetry.ideInfo?.extensionVersion,
|
||||
ideName: Telemetry.ideInfo?.name,
|
||||
ideType: Telemetry.ideInfo?.ideType,
|
||||
},
|
||||
});
|
||||
properties: augmentedProperties,
|
||||
};
|
||||
|
||||
// In cases where an extremely early fatal error occurs, we may not have initialized yet
|
||||
if (isExtensionActivationError && !Telemetry.client) {
|
||||
const client = await Telemetry.getTelemetryClient();
|
||||
client?.capture(payload);
|
||||
return;
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === "test") {
|
||||
return;
|
||||
}
|
||||
|
||||
Telemetry.client?.capture(payload);
|
||||
|
||||
if (sendToTeam) {
|
||||
void TeamAnalytics.capture(event, properties);
|
||||
|
|
@ -42,6 +54,17 @@ export class Telemetry {
|
|||
Telemetry.client?.shutdown();
|
||||
}
|
||||
|
||||
static async getTelemetryClient() {
|
||||
try {
|
||||
const { PostHog } = await import("posthog-node");
|
||||
return new PostHog("phc_JS6XFROuNbhJtVCEdTSYk6gl5ArRrTNMpCcguAXlSPs", {
|
||||
host: "https://app.posthog.com",
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(`Failed to setup telemetry: ${e}`);
|
||||
}
|
||||
}
|
||||
|
||||
static async setup(allow: boolean, uniqueId: string, ideInfo: IdeInfo) {
|
||||
Telemetry.uniqueId = uniqueId;
|
||||
Telemetry.os = os.platform();
|
||||
|
|
@ -49,20 +72,8 @@ export class Telemetry {
|
|||
|
||||
if (!allow || process.env.NODE_ENV === "test") {
|
||||
Telemetry.client = undefined;
|
||||
} else {
|
||||
try {
|
||||
if (!Telemetry.client) {
|
||||
const { PostHog } = await import("posthog-node");
|
||||
Telemetry.client = new PostHog(
|
||||
"phc_JS6XFROuNbhJtVCEdTSYk6gl5ArRrTNMpCcguAXlSPs",
|
||||
{
|
||||
host: "https://app.posthog.com",
|
||||
},
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(`Failed to setup telemetry: ${e}`);
|
||||
}
|
||||
} else if (!Telemetry.client) {
|
||||
Telemetry.client = await Telemetry.getTelemetryClient();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Actions are shortcuts for common use cases. For example, you might want to revie
|
|||
|
||||
### Slash commands
|
||||
|
||||
The most common way to invoke an action is with a slash command. These are shortcuts that can be activated by typing '/' and selecting from the dropdown. For example, the built-in '/edit' slash command lets you stream edits directly into your editor.
|
||||
The most common way to invoke an action is with a slash command. These are shortcuts that can be activated by typing '/' in a chat session (press cmd/ctrl + L (VS Code) or cmd/ctrl + J (JetBrains)), and selecting from the dropdown. For example, the built-in '/edit' slash command lets you stream edits directly into your editor.
|
||||
|
||||

|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ Here are use cases where it is not useful:
|
|||
|
||||
## Configuration
|
||||
|
||||
There are a few options that let you configure the behavior of the codebase context provider. These can be set in `config.json`, and are the same for the codebase and folder context providers:
|
||||
There are a few options that let you configure the behavior of the codebase context provider. These can be set in `config.json`, and are the same for the codebase, docs, and folder context providers:
|
||||
|
||||
```json title="config.json"
|
||||
{
|
||||
|
|
@ -67,10 +67,12 @@ Whether to use re-ranking, which will allow initial selection of `nRetrieve` res
|
|||
|
||||
Continue respects `.gitignore` files in order to determine which files should not be indexed. If you'd like to exclude additional files, you can add them to a `.continueignore` file, which follows the exact same rules as `.gitignore`.
|
||||
|
||||
Continue also supports a **global** `.continueignore` file that will be respected for all workspaces, which can be created at `~/.continue/.continueignore`.
|
||||
|
||||
If you want to see exactly what files Continue has indexed, the metadata is stored in `~/.continue/index/index.sqlite`. You can use a tool like [DB Browser for SQLite](https://sqlitebrowser.org/) to view the `tag_catalog` table within this file.
|
||||
|
||||
If you need to force a refresh of the index, reload the VS Code window with `cmd/ctrl + shift + p` + "Reload Window".
|
||||
|
||||
## Repository map
|
||||
|
||||
Models in the Claude 3, Llama 3.1, Gemini 1.5, and GPT-4o families will automatically use a [repository map](../context-providers.md#repository-map) during codebase retrieval, which allows the model to understand the structure of your codebase and use it to answer questions. Currently, the repository map only contains the filepaths in the codebase.
|
||||
Models in the Claude 3, Llama 3.1/3.2, Gemini 1.5, and GPT-4o families will automatically use a [repository map](../context-providers.md#repository-map) during codebase retrieval, which allows the model to understand the structure of your codebase and use it to answer questions. Currently, the repository map only contains the filepaths in the codebase.
|
||||
|
|
|
|||
|
|
@ -69,6 +69,25 @@ The [configuration schema for docs](https://github.com/continuedev/continue/blob
|
|||
- `rootUrl`: The base URL of the documentation site, used to determine which pages to index.
|
||||
- `faviconUrl`: The URL of the site's favicon, used for visual identification in the UI.
|
||||
|
||||
## Configuration
|
||||
|
||||
As with [@Codebase context provider configuration](https://docs.continue.dev/customize/deep-dives/codebase#configuration), you can adjust the behavior of the docs context provider with the `nRetrieve`, `nFinal`, and `useReranking`
|
||||
|
||||
```json title="config.json"
|
||||
{
|
||||
"contextProviders": [
|
||||
{
|
||||
"name": "codebase",
|
||||
"params": {
|
||||
"nRetrieve": 25,
|
||||
"nFinal": 5,
|
||||
"useReranking": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Crawling dynamically generated sites with `useChromiumForDocsCrawling`
|
||||
|
||||
By default, we use a lighter weight tool to crawl documentation sites that cannot render sites that are dynamically generated using JavaScript.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Cerebras Inference
|
||||
|
||||
Cerebras Inference uses specialized silicon to provides fast inference for the Llama3.1 8B and Llama3.1 70B models.
|
||||
Cerebras Inference uses specialized silicon to provides fast inference.
|
||||
|
||||
1. Create an account in the portal [here](https://cloud.cerebras.ai/).
|
||||
2. Create and copy the API key for use in Continue.
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ We recommend configuring **rerank-english-v3.0** as your reranking model.
|
|||
|
||||
```json title="config.json"
|
||||
{
|
||||
"embeddingsProvider": {
|
||||
"reranker": {
|
||||
"provider": "cohere",
|
||||
"params": {
|
||||
"model": "rerank-english-v3.0",
|
||||
|
|
|
|||
|
|
@ -3,6 +3,14 @@ title: Azure OpenAI
|
|||
slug: ../azure
|
||||
---
|
||||
|
||||
Azure OpenAI is a cloud-based service that provides access to OpenAI's models, integrated with the security and enterprise features of the Microsoft Azure platform. To get started, create an Azure OpenAI resource in the [Azure portal](https://portal.azure.com).
|
||||
|
||||
:::info
|
||||
|
||||
For details on model setup, see [General model configuration](#general-model-configuration).
|
||||
|
||||
:::
|
||||
|
||||
## Chat model
|
||||
|
||||
We recommend configuring **GPT-4o** as your chat model.
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ title: Amazon Bedrock
|
|||
slug: ../bedrock
|
||||
---
|
||||
|
||||
Amazon Bedrock is a fully managed service on AWS that provides access to foundation models from various AI companies through a single API.
|
||||
|
||||
## Chat model
|
||||
|
||||
We recommend configuring **Claude 3.5 Sonnet** as your chat model.
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ title: Ollama
|
|||
slug: ../ollama
|
||||
---
|
||||
|
||||
Ollama is an open-source tool that allows to run large language models (LLMs) locally on their own computers. To use Ollama, you can install it [here](https://ollama.ai/download) and download the model you want to run with the `ollama run` command.
|
||||
|
||||
## Chat model
|
||||
|
||||
We recommend configuring **Llama3.1 8B** as your chat model.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ description: How to use Llama 3.1 with Continue
|
|||
keywords: [llama, meta, togetherai, ollama, replicate]
|
||||
---
|
||||
|
||||
Continue makes it easy to code with the latest open-source models, including the entire Llama 3.1 family of models.
|
||||
Continue makes it easy to code with the latest open-source models, including the entire Llama 3.1 family of models. Llama 3.2 models are also supported but not recommended for chat, because they are specifically designed to be small or multi-modal.
|
||||
|
||||
If you haven't already installed Continue, you can do that [here for VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) or [here for JetBrains](https://plugins.jetbrains.com/plugin/22707-continue). For more general information on customizing Continue, read [our customization docs](../overview.md).
|
||||
|
||||
|
|
|
|||
695
docs/static/schemas/config.json
vendored
695
docs/static/schemas/config.json
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tail Dev Logs" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="tail -f ./binary/.continue/logs/core.log" />
|
||||
<configuration default="false" name="Prompt Logs" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="tail -f ./binary/.continue/logs/prompt.log" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run Continue" type="CompoundRunConfigurationType">
|
||||
<toRun name="Run Extension" type="GradleRunConfiguration" />
|
||||
<toRun name="GUI: Start Dev Server" type="js.build_tools.npm" />
|
||||
<toRun name="Tail Dev Logs" type="ShConfigurationType" />
|
||||
<toRun name="Start Dev Server (core)" type="NodeJSConfigurationType" />
|
||||
<toRun name="Start Dev Server (gui)" type="js.build_tools.npm" />
|
||||
<toRun name="Prompt Logs" type="ShConfigurationType" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<option name="env">
|
||||
<map>
|
||||
<entry key="GUI_URL" value="http://localhost:5173/jetbrains_index.html" />
|
||||
<entry key="ORG_GRADLE_PROJECT_platformVersion" value="2024.2.3" />
|
||||
<entry key="ORG_GRADLE_PROJECT_platformVersion" value="2024.1" />
|
||||
<entry key="USE_TCP" value="true" />
|
||||
</map>
|
||||
</option>
|
||||
|
|
|
|||
9
extensions/intellij/.run/Start Dev Server (core).run.xml
Normal file
9
extensions/intellij/.run/Start Dev Server (core).run.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Start Dev Server (core)" type="NodeJSConfigurationType" path-to-js-file="out/index.js" working-dir="$PROJECT_DIR$/binary">
|
||||
<envs>
|
||||
<env name="CONTINUE_DEVELOPMENT" value="true" />
|
||||
<env name="CONTINUE_GLOBAL_DIR" value="$PROJECT_DIR$/binary/.continue" />
|
||||
</envs>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
# Contributing to Continue (JetBrains extension) <!-- omit in toc -->
|
||||
|
||||
This file is for contribution guidelines specific to the JetBrains extension. See the root [`CONTRIBUTING.md`](../../CONTRIBUTING.md) for general contribution guidelines.
|
||||
This file is for contribution guidelines specific to the JetBrains extension. See the root [
|
||||
`CONTRIBUTING.md`](../../CONTRIBUTING.md) for general contribution guidelines.
|
||||
|
||||
## Table of Contents <!-- omit in toc -->
|
||||
|
||||
|
|
@ -12,7 +13,8 @@ This file is for contribution guidelines specific to the JetBrains extension. Se
|
|||
- [Install all dependencies](#install-all-dependencies)
|
||||
- [Misc](#misc)
|
||||
- [Development Workflow](#development-workflow)
|
||||
- [Running the extension](#running-the-extension)
|
||||
- [Running the extension in debug mode](#running-the-extension-in-debug-mode)
|
||||
- [Accessing files in the `.continue` directory](#accessing-files-in-the-continue-directory)
|
||||
- [Reloading changes](#reloading-changes)
|
||||
- [Setting breakpoints](#setting-breakpoints)
|
||||
- [Available Gradle tasks](#available-gradle-tasks)
|
||||
|
|
@ -57,22 +59,18 @@ This project requires Node.js version 20.11.0 (LTS) or higher. You have two opti
|
|||
|
||||
## Development Workflow
|
||||
|
||||
Because the `gui` and `core` are written in TypeScript, our development workflow is built around the assumption that you
|
||||
have VS Code installed.
|
||||
### Running the extension in debug mode
|
||||
|
||||
### Running the extension
|
||||
Select the `Run Continue` task in the top right corner of the IDE and then select the "Debug" option.
|
||||
|
||||
- Open the project in VS Code and star the `Core binary` task
|
||||
- Switch back to Intellij and select the "Run Continue" configuration in the top-right corner of the IDE
|
||||
- Click the "Debug" button
|
||||
- The first time running this will install the IDE version specified by the `platformVersion` property in [
|
||||
`./run/Run Extension.run.xml`](./.run/Run%20Extension.run.xml). This will take a moment as the installation size
|
||||
can be close to 1GB.
|
||||

|
||||
|
||||
\
|
||||
This should open a new instance on IntelliJ with the extension installed.
|
||||
|
||||
This should open a new instance on IntelliJ with the extension installed and connected via TCP to the server started
|
||||
through the `Core binary` task.
|
||||
### Accessing files in the `.continue` directory
|
||||
|
||||
When running the `Start Dev Server (core)` task, we set the location of your Continue directory to `./binary/.continue`. This is to
|
||||
allow for changes to your `config.json` and other files during development, without affecting your actual configuration.
|
||||
|
||||
### Reloading changes
|
||||
|
||||
|
|
@ -80,13 +78,13 @@ through the `Core binary` task.
|
|||
_Run | Debugging Actions | Reload Changed Classes`_
|
||||
- This will often fail on new imports, schema changes etc. In that case, you need to stop and restart the extension
|
||||
- `gui`: Changes will be reloaded automatically
|
||||
- `core`: Run `npm run build` from the `binary` directory and restart the `Core binary` task in VS Code
|
||||
- `core`: Run `npm run build` from the `binary` directory (requires restarting the `Start Dev Server (core)` task)
|
||||
|
||||
### Setting breakpoints
|
||||
|
||||
- `extensions/intellij`: Breakpoints can be set in Intellij
|
||||
- `gui`: You'll need to set explicit `debugger` statements in the source code, or through the browser dev tools
|
||||
- `core`: Breakpoints can be set in VS Code
|
||||
- `core`: Breakpoints can be set in Intellij (requires restarting the `Start Dev Server (core)` task)
|
||||
|
||||
### Available Gradle tasks
|
||||
|
||||
|
|
@ -111,7 +109,8 @@ verifyPluginConfiguration - Checks if Java and Kotlin compilers configuration me
|
|||
- Unix: `./gradlew buildPlugin`
|
||||
- Windows: `./gradlew.bat buildPlugin`
|
||||
|
||||
This will generate a .zip file in `./build/distributions` with the version defined in [`./gradle.properties`](./gradle.properties)
|
||||
This will generate a .zip file in `./build/distributions` with the version defined in [
|
||||
`./gradle.properties`](./gradle.properties)
|
||||
|
||||
#### Testing the packaged extension
|
||||
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ fun properties(key: String) = providers.gradleProperty(key)
|
|||
fun environment(key: String) = providers.environmentVariable(key)
|
||||
|
||||
plugins {
|
||||
id("java") // Java support
|
||||
alias(libs.plugins.kotlin) // Kotlin support
|
||||
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
|
||||
alias(libs.plugins.changelog) // Gradle Changelog Plugin
|
||||
alias(libs.plugins.qodana) // Gradle Qodana Plugin
|
||||
alias(libs.plugins.kover) // Gradle Kover Plugin
|
||||
kotlin("plugin.serialization") version "1.8.0"
|
||||
id("java") // Java support
|
||||
alias(libs.plugins.kotlin) // Kotlin support
|
||||
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
|
||||
alias(libs.plugins.changelog) // Gradle Changelog Plugin
|
||||
alias(libs.plugins.qodana) // Gradle Qodana Plugin
|
||||
alias(libs.plugins.kover) // Gradle Kover Plugin
|
||||
kotlin("plugin.serialization") version "1.8.0"
|
||||
}
|
||||
|
||||
group = properties("pluginGroup").get()
|
||||
|
|
@ -24,23 +24,23 @@ repositories { mavenCentral() }
|
|||
// Dependencies are managed with Gradle version catalog - read more:
|
||||
// https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
|
||||
dependencies {
|
||||
// implementation(libs.annotations)
|
||||
implementation("com.squareup.okhttp3:okhttp:4.9.1") {
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
|
||||
}
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.4.32")
|
||||
implementation("io.ktor:ktor-server-core:2.3.7") {
|
||||
exclude(group = "org.slf4j", module = "slf4j-api")
|
||||
}
|
||||
implementation("io.ktor:ktor-server-netty:2.3.7") {
|
||||
exclude(group = "org.slf4j", module = "slf4j-api")
|
||||
}
|
||||
implementation("io.ktor:ktor-server-cors:2.3.7") {
|
||||
exclude(group = "org.slf4j", module = "slf4j-api")
|
||||
}
|
||||
implementation("com.posthog.java:posthog:1.+")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
|
||||
// implementation("com.jetbrains.jsonSchema")
|
||||
// implementation(libs.annotations)
|
||||
implementation("com.squareup.okhttp3:okhttp:4.9.1") {
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
|
||||
}
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.4.32")
|
||||
implementation("io.ktor:ktor-server-core:2.3.7") {
|
||||
exclude(group = "org.slf4j", module = "slf4j-api")
|
||||
}
|
||||
implementation("io.ktor:ktor-server-netty:2.3.7") {
|
||||
exclude(group = "org.slf4j", module = "slf4j-api")
|
||||
}
|
||||
implementation("io.ktor:ktor-server-cors:2.3.7") {
|
||||
exclude(group = "org.slf4j", module = "slf4j-api")
|
||||
}
|
||||
implementation("com.posthog.java:posthog:1.+")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
|
||||
// implementation("com.jetbrains.jsonSchema")
|
||||
}
|
||||
|
||||
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for
|
||||
|
|
@ -50,98 +50,100 @@ kotlin { jvmToolchain(17) }
|
|||
// Configure Gradle IntelliJ Plugin - read more:
|
||||
// https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||
intellij {
|
||||
pluginName = properties("pluginName")
|
||||
version = properties("platformVersion")
|
||||
type = properties("platformType")
|
||||
pluginName = properties("pluginName")
|
||||
version = properties("platformVersion")
|
||||
type = properties("platformType")
|
||||
|
||||
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
|
||||
plugins =
|
||||
properties("platformPlugins").map {
|
||||
it.split(',').map(String::trim).filter(String::isNotEmpty)
|
||||
}
|
||||
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
|
||||
plugins =
|
||||
properties("platformPlugins").map {
|
||||
it.split(',').map(String::trim).filter(String::isNotEmpty)
|
||||
}
|
||||
}
|
||||
|
||||
// Configure Gradle Changelog Plugin - read more:
|
||||
// https://github.com/JetBrains/gradle-changelog-plugin
|
||||
changelog {
|
||||
groups.empty()
|
||||
repositoryUrl = properties("pluginRepositoryUrl")
|
||||
groups.empty()
|
||||
repositoryUrl = properties("pluginRepositoryUrl")
|
||||
}
|
||||
|
||||
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
|
||||
qodana {
|
||||
cachePath = provider { file(".qodana").canonicalPath }
|
||||
reportPath = provider { file("build/reports/inspections").canonicalPath }
|
||||
saveReport = true
|
||||
showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
|
||||
cachePath = provider { file(".qodana").canonicalPath }
|
||||
reportPath = provider { file("build/reports/inspections").canonicalPath }
|
||||
saveReport = true
|
||||
showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
|
||||
}
|
||||
|
||||
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
|
||||
koverReport { defaults { xml { onCheck = true } } }
|
||||
|
||||
tasks {
|
||||
prepareSandbox {
|
||||
from("../../binary/bin") { into("${intellij.pluginName.get()}/core/") }
|
||||
from("../vscode/node_modules/@vscode/ripgrep") { into("${intellij.pluginName.get()}/ripgrep/") }
|
||||
}
|
||||
prepareSandbox {
|
||||
from("../../binary/bin") { into("${intellij.pluginName.get()}/core/") }
|
||||
from("../vscode/node_modules/@vscode/ripgrep") { into("${intellij.pluginName.get()}/ripgrep/") }
|
||||
}
|
||||
|
||||
wrapper { gradleVersion = properties("gradleVersion").get() }
|
||||
wrapper { gradleVersion = properties("gradleVersion").get() }
|
||||
|
||||
patchPluginXml {
|
||||
version = properties("pluginVersion")
|
||||
sinceBuild = properties("pluginSinceBuild")
|
||||
untilBuild = properties("pluginUntilBuild")
|
||||
patchPluginXml {
|
||||
version = properties("pluginVersion")
|
||||
sinceBuild = properties("pluginSinceBuild")
|
||||
untilBuild = properties("pluginUntilBuild")
|
||||
|
||||
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's
|
||||
// manifest
|
||||
pluginDescription =
|
||||
providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
|
||||
val start = "<!-- Plugin description -->"
|
||||
val end = "<!-- Plugin description end -->"
|
||||
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's
|
||||
// manifest
|
||||
pluginDescription =
|
||||
providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
|
||||
val start = "<!-- Plugin description -->"
|
||||
val end = "<!-- Plugin description end -->"
|
||||
|
||||
with(it.lines()) {
|
||||
if (!containsAll(listOf(start, end))) {
|
||||
throw GradleException(
|
||||
"Plugin description section not found in README.md:\n$start ... $end")
|
||||
with(it.lines()) {
|
||||
if (!containsAll(listOf(start, end))) {
|
||||
throw GradleException(
|
||||
"Plugin description section not found in README.md:\n$start ... $end"
|
||||
)
|
||||
}
|
||||
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
|
||||
}
|
||||
}
|
||||
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Configure UI tests plugin
|
||||
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
|
||||
runIdeForUiTests {
|
||||
systemProperty("robot-server.port", "8082")
|
||||
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
|
||||
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
|
||||
systemProperty("jb.consents.confirmation.enabled", "false")
|
||||
}
|
||||
// Configure UI tests plugin
|
||||
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
|
||||
runIdeForUiTests {
|
||||
systemProperty("robot-server.port", "8082")
|
||||
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
|
||||
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
|
||||
systemProperty("jb.consents.confirmation.enabled", "false")
|
||||
}
|
||||
|
||||
signPlugin {
|
||||
certificateChain = environment("CERTIFICATE_CHAIN")
|
||||
privateKey = environment("PRIVATE_KEY")
|
||||
password = environment("PRIVATE_KEY_PASSWORD")
|
||||
}
|
||||
signPlugin {
|
||||
certificateChain = environment("CERTIFICATE_CHAIN")
|
||||
privateKey = environment("PRIVATE_KEY")
|
||||
password = environment("PRIVATE_KEY_PASSWORD")
|
||||
}
|
||||
|
||||
publishPlugin {
|
||||
// dependsOn("patchChangelog")
|
||||
token = environment("PUBLISH_TOKEN")
|
||||
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release
|
||||
// labels, like 2.1.7-alpha.3
|
||||
// Specify pre-release label to publish the plugin in a custom Release Channel automatically.
|
||||
// Read more:
|
||||
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
|
||||
channels.set(listOf(environment("RELEASE_CHANNEL").getOrElse("eap")))
|
||||
publishPlugin {
|
||||
// dependsOn("patchChangelog")
|
||||
token = environment("PUBLISH_TOKEN")
|
||||
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release
|
||||
// labels, like 2.1.7-alpha.3
|
||||
// Specify pre-release label to publish the plugin in a custom Release Channel automatically.
|
||||
// Read more:
|
||||
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
|
||||
channels.set(listOf(environment("RELEASE_CHANNEL").getOrElse("eap")))
|
||||
|
||||
// We always hide the stable releases until a few days of EAP have proven them stable
|
||||
// hidden = environment("RELEASE_CHANNEL").map { it == "stable" }.getOrElse(false)
|
||||
}
|
||||
// We always hide the stable releases until a few days of EAP have proven them stable
|
||||
// hidden = environment("RELEASE_CHANNEL").map { it == "stable" }.getOrElse(false)
|
||||
}
|
||||
|
||||
runIde {
|
||||
// Open the `manual-testing-sandbox` on start
|
||||
args =
|
||||
listOf("${rootProject.projectDir.parentFile.parentFile}/manual-testing-sandbox/test.kt")
|
||||
.map { file(it).absolutePath }
|
||||
}
|
||||
runIde {
|
||||
// Open the `manual-testing-sandbox` directory and the specific file on start
|
||||
args = listOf(
|
||||
"${rootProject.projectDir.parentFile.parentFile}/manual-testing-sandbox",
|
||||
"${rootProject.projectDir.parentFile.parentFile}/manual-testing-sandbox/test.kt"
|
||||
).map { file(it).absolutePath }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.github.continuedev.continueintellijextension.services.SettingsListene
|
|||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.actionSystem.KeyboardShortcut
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo
|
||||
import com.intellij.openapi.components.ServiceManager
|
||||
import com.intellij.openapi.editor.EditorFactory
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager
|
||||
|
|
@ -31,24 +32,36 @@ import com.intellij.openapi.module.ModuleManager
|
|||
import com.intellij.openapi.roots.ModuleRootManager
|
||||
|
||||
fun showTutorial(project: Project) {
|
||||
ContinuePluginStartupActivity::class.java.getClassLoader().getResourceAsStream("continue_tutorial.py").use { `is` ->
|
||||
if (`is` == null) {
|
||||
throw IOException("Resource not found: continue_tutorial.py")
|
||||
}
|
||||
var content = StreamUtil.readText(`is`, StandardCharsets.UTF_8)
|
||||
if (!System.getProperty("os.name").toLowerCase().contains("mac")) {
|
||||
content = content.replace("⌘", "⌃")
|
||||
}
|
||||
val filepath = Paths.get(getContinueGlobalPath(), "continue_tutorial.py").toString()
|
||||
File(filepath).writeText(content)
|
||||
val virtualFile = LocalFileSystem.getInstance().findFileByPath(filepath)
|
||||
val tutorialFileName = getTutorialFileName()
|
||||
|
||||
ContinuePluginStartupActivity::class.java.getClassLoader().getResourceAsStream(tutorialFileName)
|
||||
.use { `is` ->
|
||||
if (`is` == null) {
|
||||
throw IOException("Resource not found: $tutorialFileName")
|
||||
}
|
||||
var content = StreamUtil.readText(`is`, StandardCharsets.UTF_8)
|
||||
if (!System.getProperty("os.name").lowercase().contains("mac")) {
|
||||
content = content.replace("⌘", "⌃")
|
||||
}
|
||||
val filepath = Paths.get(getContinueGlobalPath(), tutorialFileName).toString()
|
||||
File(filepath).writeText(content)
|
||||
val virtualFile = LocalFileSystem.getInstance().findFileByPath(filepath)
|
||||
|
||||
ApplicationManager.getApplication().invokeLater {
|
||||
if (virtualFile != null) {
|
||||
FileEditorManager.getInstance(project).openFile(virtualFile, true)
|
||||
ApplicationManager.getApplication().invokeLater {
|
||||
if (virtualFile != null) {
|
||||
FileEditorManager.getInstance(project).openFile(virtualFile, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getTutorialFileName(): String {
|
||||
val appName = ApplicationNamesInfo.getInstance().fullProductName.lowercase()
|
||||
return when {
|
||||
appName.contains("intellij") -> "continue_tutorial.java"
|
||||
appName.contains("pycharm") -> "continue_tutorial.py"
|
||||
appName.contains("webstorm") -> "continue_tutorial.ts"
|
||||
else -> "continue_tutorial.py" // Default to Python tutorial
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -101,7 +114,7 @@ class ContinuePluginStartupActivity : StartupActivity, Disposable, DumbAware {
|
|||
ServiceManager.getService(ContinueExtensionSettings::class.java)
|
||||
if (!settings.continueState.shownWelcomeDialog) {
|
||||
settings.continueState.shownWelcomeDialog = true
|
||||
// Open continue_tutorial.py
|
||||
// Open tutorial file
|
||||
showTutorial(project)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ import com.intellij.diff.DiffContentFactory
|
|||
import com.intellij.diff.DiffManager
|
||||
import com.intellij.diff.DiffRequestPanel
|
||||
import com.intellij.diff.contents.DiffContent
|
||||
import com.intellij.diff.contents.DocumentContent
|
||||
import com.intellij.diff.requests.DiffRequest
|
||||
import com.intellij.diff.requests.SimpleDiffRequest
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.command.WriteCommandAction
|
||||
|
|
@ -18,7 +16,6 @@ import com.intellij.openapi.project.Project
|
|||
import com.intellij.openapi.ui.DialogWrapper
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.openapi.vfs.LocalFileSystem
|
||||
import com.intellij.ui.content.ContentFactory
|
||||
import java.awt.Toolkit
|
||||
import java.io.File
|
||||
import java.nio.file.Paths
|
||||
|
|
@ -51,10 +48,9 @@ interface DiffInfo {
|
|||
|
||||
class DiffManager(private val project: Project) : DumbAware {
|
||||
|
||||
private val diffContentFactory = DiffContentFactory.getInstance()
|
||||
|
||||
// Mapping from file2 to relevant info
|
||||
private val diffInfoMap: MutableMap<String, DiffInfo> = mutableMapOf()
|
||||
private var lastFile2: String? = null
|
||||
|
||||
fun showDiff(filepath: String, replacement: String, stepIndex: Int) {
|
||||
val diffDir = getDiffDirectory()
|
||||
|
|
@ -68,7 +64,7 @@ class DiffManager(private val project: Project) : DumbAware {
|
|||
openDiffWindow(filepath, file.path, stepIndex)
|
||||
}
|
||||
|
||||
fun cleanUpFile(file2: String) {
|
||||
private fun cleanUpFile(file2: String) {
|
||||
diffInfoMap[file2]?.dialog?.close(0)
|
||||
diffInfoMap.remove(file2)
|
||||
File(file2).delete()
|
||||
|
|
@ -77,7 +73,6 @@ class DiffManager(private val project: Project) : DumbAware {
|
|||
}
|
||||
}
|
||||
|
||||
private var lastFile2: String? = null
|
||||
|
||||
fun acceptDiff(file2: String?) {
|
||||
val file = (file2 ?: lastFile2) ?: return
|
||||
|
|
@ -128,7 +123,7 @@ class DiffManager(private val project: Project) : DumbAware {
|
|||
|
||||
// Create a SimpleDiffRequest and populate it with the DiffContents and titles
|
||||
val diffRequest = SimpleDiffRequest("Continue Diff", content1, content2, "Old", "New")
|
||||
|
||||
|
||||
// Get a DiffRequestPanel from the DiffManager and set the DiffRequest to it
|
||||
val diffInfo = diffInfoMap[file2]
|
||||
|
||||
|
|
@ -176,10 +171,10 @@ class DiffManager(private val project: Project) : DumbAware {
|
|||
}
|
||||
|
||||
override fun createActions(): Array<Action> {
|
||||
val okAction = getOKAction()
|
||||
val okAction = okAction
|
||||
okAction.putValue(Action.NAME, "Accept (${getAltKeyLabel()} ⇧ Y)")
|
||||
|
||||
val cancelAction = getCancelAction()
|
||||
val cancelAction = cancelAction
|
||||
cancelAction.putValue(Action.NAME, "Reject (${getAltKeyLabel()} ⇧ N)")
|
||||
|
||||
return arrayOf(okAction, cancelAction)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import com.github.continuedev.continueintellijextension.auth.ContinueAuthService
|
|||
import com.github.continuedev.continueintellijextension.constants.getConfigJsPath
|
||||
import com.github.continuedev.continueintellijextension.constants.getConfigJsonPath
|
||||
import com.github.continuedev.continueintellijextension.constants.getContinueGlobalPath
|
||||
import com.github.continuedev.continueintellijextension.editor.DiffStreamHandler
|
||||
import com.github.continuedev.continueintellijextension.editor.DiffStreamService
|
||||
import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings
|
||||
import com.github.continuedev.continueintellijextension.services.ContinuePluginService
|
||||
import com.google.gson.Gson
|
||||
|
|
@ -16,9 +18,9 @@ import com.intellij.execution.util.ExecUtil
|
|||
import com.intellij.ide.plugins.PluginManager
|
||||
import com.intellij.ide.plugins.PluginManagerCore
|
||||
import com.intellij.lang.annotation.HighlightSeverity
|
||||
import com.intellij.notification.NotificationType
|
||||
import com.intellij.notification.NotificationAction
|
||||
import com.intellij.notification.NotificationGroupManager
|
||||
import com.intellij.notification.NotificationType
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.application.ApplicationInfo
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
|
|
@ -34,6 +36,7 @@ import com.intellij.openapi.fileEditor.FileEditorManager
|
|||
import com.intellij.openapi.project.DumbAware
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.IconLoader
|
||||
import com.intellij.openapi.util.TextRange
|
||||
import com.intellij.openapi.vfs.*
|
||||
import com.intellij.openapi.vfs.newvfs.events.VFileEvent
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
|
|
@ -48,6 +51,7 @@ import java.nio.charset.Charset
|
|||
import java.nio.file.Paths
|
||||
import java.util.*
|
||||
|
||||
|
||||
fun uuid(): String {
|
||||
return UUID.randomUUID().toString()
|
||||
}
|
||||
|
|
@ -300,7 +304,7 @@ class IdeProtocolClient(
|
|||
"getWorkspaceConfigs" -> {
|
||||
val workspaceDirs = workspaceDirectories()
|
||||
|
||||
val configs: List<String> = listOf()
|
||||
val configs = mutableListOf<String>()
|
||||
for (workspaceDir in workspaceDirs) {
|
||||
val workspacePath = File(workspaceDir)
|
||||
val dir = VirtualFileManager.getInstance().findFileByUrl("file://$workspacePath")
|
||||
|
|
@ -312,7 +316,7 @@ class IdeProtocolClient(
|
|||
if (file.endsWith(".continuerc.json")) {
|
||||
val filePath = workspacePath.resolve(file)
|
||||
val fileContent = File(filePath.toString()).readText()
|
||||
configs.plus(fileContent)
|
||||
configs.add(fileContent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -550,7 +554,6 @@ class IdeProtocolClient(
|
|||
}
|
||||
|
||||
"openFile" -> {
|
||||
|
||||
setFileOpen((data as Map<String, Any>)["path"] as String)
|
||||
respond(null)
|
||||
}
|
||||
|
|
@ -572,10 +575,14 @@ class IdeProtocolClient(
|
|||
|
||||
"listFolders" -> {
|
||||
val workspacePath = workspacePath ?: return@launch
|
||||
val workspaceDir = File(workspacePath)
|
||||
val folders =
|
||||
workspaceDir.listFiles { file -> file.isDirectory }?.map { file -> file.absolutePath }
|
||||
?: emptyList()
|
||||
val folders = mutableListOf<String>()
|
||||
fun findNestedFolders(dirPath: String) {
|
||||
val dir = File(dirPath)
|
||||
val nestedFolders = dir.listFiles { file -> file.isDirectory }?.map { file -> file.absolutePath } ?: emptyList()
|
||||
folders.addAll(nestedFolders);
|
||||
nestedFolders.forEach { folder -> findNestedFolders(folder) }
|
||||
}
|
||||
findNestedFolders(workspacePath)
|
||||
respond(folders)
|
||||
}
|
||||
|
||||
|
|
@ -619,7 +626,73 @@ class IdeProtocolClient(
|
|||
}
|
||||
}
|
||||
|
||||
"applyToFile" -> {
|
||||
"applyToCurrentFile" -> {
|
||||
val msg = data as Map<String, String>;
|
||||
val text = msg["text"] as String
|
||||
val curSelectedModelTitle = msg["curSelectedModelTitle"] as String
|
||||
|
||||
val config = readConfigJson()
|
||||
var llm = getModelByRole(config, "applyCodeBlock")
|
||||
|
||||
if (llm == null) {
|
||||
val models = (config as? Map<*, *>)?.get("models") as? List<Map<*, *>>
|
||||
llm = models?.find { model -> model["title"] == curSelectedModelTitle } as Map<String, Any>
|
||||
|
||||
if (llm == null) {
|
||||
showToast("error", "Model '$curSelectedModelTitle' not found in config.")
|
||||
respond(null)
|
||||
return@launch
|
||||
}
|
||||
}
|
||||
|
||||
val llmTitle = (llm as? Map<*, *>)?.get("title") as? String ?: ""
|
||||
|
||||
val prompt =
|
||||
"The following code was suggested as an edit:\n```\n${text}\n```\nPlease apply it to the previous code."
|
||||
|
||||
val editor = FileEditorManager.getInstance(project).selectedTextEditor
|
||||
|
||||
if (editor == null) {
|
||||
showToast("error", "No active editor to apply edits to")
|
||||
respond(null)
|
||||
return@launch
|
||||
}
|
||||
|
||||
val rif = getHighlightedCode()
|
||||
|
||||
val (prefix, highlighted, suffix) = if (rif == null) {
|
||||
// If no highlight, use the whole document as highlighted
|
||||
Triple("", editor.document.text, "")
|
||||
} else {
|
||||
val prefix = editor.document.getText(TextRange(0, rif.range.start.character))
|
||||
val highlighted = rif.contents
|
||||
val suffix =
|
||||
editor.document.getText(TextRange(rif.range.end.character, editor.document.textLength))
|
||||
|
||||
// Remove the selection after processing
|
||||
ApplicationManager.getApplication().invokeLater {
|
||||
editor.selectionModel.removeSelection()
|
||||
}
|
||||
|
||||
Triple(prefix, highlighted, suffix)
|
||||
}
|
||||
|
||||
val diffStreamHandler =
|
||||
DiffStreamHandler(
|
||||
project,
|
||||
editor,
|
||||
rif?.range?.start?.line ?: 0,
|
||||
rif?.range?.end?.line ?: (editor.document.lineCount - 1),
|
||||
{}, {})
|
||||
|
||||
val diffStreamService = project.service<DiffStreamService>()
|
||||
diffStreamService.register(diffStreamHandler, editor)
|
||||
|
||||
diffStreamHandler.streamDiffLinesToEditor(
|
||||
prompt, prefix, highlighted, suffix, llmTitle
|
||||
)
|
||||
|
||||
respond(null)
|
||||
}
|
||||
|
||||
"getGitHubAuthToken" -> {
|
||||
|
|
@ -692,11 +765,11 @@ class IdeProtocolClient(
|
|||
)
|
||||
}
|
||||
|
||||
fun uniqueId(): String {
|
||||
private fun uniqueId(): String {
|
||||
return getMachineUniqueID()
|
||||
}
|
||||
|
||||
suspend fun getBranch(dir: String): String = withContext(Dispatchers.IO) {
|
||||
private suspend fun getBranch(dir: String): String = withContext(Dispatchers.IO) {
|
||||
try {
|
||||
val builder = ProcessBuilder("git", "rev-parse", "--abbrev-ref", "HEAD")
|
||||
builder.directory(File(dir))
|
||||
|
|
@ -715,7 +788,7 @@ class IdeProtocolClient(
|
|||
|
||||
data class IndexTag(val directory: String, val branch: String, val artifactId: String)
|
||||
|
||||
suspend fun getTags(artifactId: String): List<IndexTag> {
|
||||
private suspend fun getTags(artifactId: String): List<IndexTag> {
|
||||
val workspaceDirs = workspaceDirectories()
|
||||
|
||||
// Collect branches concurrently using Kotlin coroutines
|
||||
|
|
@ -731,7 +804,7 @@ class IdeProtocolClient(
|
|||
}
|
||||
}
|
||||
|
||||
fun readFile(filepath: String): String {
|
||||
private fun readFile(filepath: String): String {
|
||||
try {
|
||||
val content = ApplicationManager.getApplication().runReadAction<String?> {
|
||||
val virtualFile = LocalFileSystem.getInstance().findFileByPath(filepath)
|
||||
|
|
@ -982,4 +1055,19 @@ class IdeProtocolClient(
|
|||
command.setWorkDirectory(project.basePath)
|
||||
return ExecUtil.execAndGetOutput(command).stdout ?: ""
|
||||
}
|
||||
|
||||
private fun getModelByRole(
|
||||
config: Any,
|
||||
role: Any
|
||||
): Any? {
|
||||
val experimental = (config as? Map<*, *>)?.get("experimental") as? Map<*, *>
|
||||
val roleTitle = (experimental?.get("modelRoles") as? Map<*, *>)?.get(role) as? String ?: return null
|
||||
|
||||
val models = (config as? Map<*, *>)?.get("models") as? List<*>
|
||||
val matchingModel = models?.find { model ->
|
||||
(model as? Map<*, *>)?.get("title") == roleTitle
|
||||
}
|
||||
|
||||
return matchingModel
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,10 @@
|
|||
<idea-plugin>
|
||||
<id>com.github.continuedev.continueintellijextension</id>
|
||||
<name>Continue</name>
|
||||
<vendor>continue-dev</vendor>
|
||||
<vendor url="https://www.continue.dev/">continue-dev</vendor>
|
||||
<change-notes>
|
||||
<![CDATA[View the latest release notes on <a href="https://github.com/continuedev/continue/releases">GitHub</a>]]></change-notes>
|
||||
|
||||
<depends>com.intellij.modules.platform</depends>
|
||||
<depends>com.intellij.modules.json</depends>
|
||||
<!-- com.intellij.openapi.module.ModuleManager.Companion is only available since this build -->
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,55 @@
|
|||
/* _________ _____ _____
|
||||
__ ____/______ _______ __ /____(_)_______ ____ _______
|
||||
_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
|
||||
/ /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
|
||||
\____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
|
||||
|
||||
Chat, Edit, and Autocomplete tutorial
|
||||
*/
|
||||
|
||||
|
||||
/* ————————————————————————————————————————————————— Chat ————————————————————————————————————————————————— */
|
||||
|
||||
// Highlight the code below
|
||||
// Press [Cmd/Ctrl + J] 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++) {
|
||||
for (int j = 0; j < x.length - 1; j++) {
|
||||
if (x[j] > x[j + 1]) {
|
||||
int temp = x[j];
|
||||
x[j] = x[j + 1];
|
||||
x[j + 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
/* ————————————————————————————————————————————————— Edit ————————————————————————————————————————————————— */
|
||||
|
||||
// Highlight the code below
|
||||
// Press [Cmd/Ctrl + 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++) {
|
||||
for (int j = 0; j < x.length - 1; j++) {
|
||||
if (x[j] > x[j + 1]) {
|
||||
int temp = x[j];
|
||||
x[j] = x[j + 1];
|
||||
x[j + 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
/* ————————————————————————————————————————————— Autocomplete —————————————————————————————————————————————— */
|
||||
|
||||
// Place cursor after `sortingAlgorithm...` below and press [Enter]
|
||||
// Press [Tab] to accept the Autocomplete suggestion
|
||||
|
||||
// Basic assertion for sortingAlgorithm...
|
||||
|
||||
|
||||
/* —————————————————— Learn more at https://docs.continue.dev/getting-started/overview ——————————————————— */
|
||||
|
|
@ -7,8 +7,12 @@
|
|||
Chat, Edit, and Autocomplete tutorial
|
||||
"""
|
||||
|
||||
# ———————————————————— Chat [Cmd/Ctrl + J]: Ask "what sorting algorithm is this?" ————————————————————
|
||||
|
||||
# ————————————————————————————————————————————————— Chat ————————————————————————————————————————————————— #
|
||||
|
||||
## Highlight the code below
|
||||
## Press [Cmd/Ctrl + J] to add to Chat
|
||||
## Try asking Continue "what sorting algorithm is this?"
|
||||
def sorting_algorithm(x):
|
||||
for i in range(len(x)):
|
||||
for j in range(len(x) - 1):
|
||||
|
|
@ -16,8 +20,12 @@ def sorting_algorithm(x):
|
|||
x[j], x[j + 1] = x[j + 1], x[j]
|
||||
return x
|
||||
|
||||
# —————————————————— Edit [Cmd/Ctrl + I]: Tell Continue to "make this more readable" —————————————————
|
||||
|
||||
# ————————————————————————————————————————————————— Edit ————————————————————————————————————————————————— #
|
||||
|
||||
## Highlight the code below
|
||||
## Press [Cmd/Ctrl + I] to Edit
|
||||
## Try asking Continue to "make this more readable"
|
||||
def sorting_algorithm(x):
|
||||
for i in range(len(x)):
|
||||
for j in range(len(x) - 1):
|
||||
|
|
@ -25,9 +33,12 @@ def sorting_algorithm(x):
|
|||
x[j], x[j + 1] = x[j + 1], x[j]
|
||||
return x
|
||||
|
||||
# ——————————————— Autocomplete [Tab]: Place cursor after `:` below and press [Enter] —————————————————
|
||||
# ————————————————————————————————————————————— Autocomplete —————————————————————————————————————————————— #
|
||||
|
||||
# Basic assertion for sorting_algorithm:
|
||||
## Place cursor after `sorting_algorithm...` below and press [Enter]
|
||||
## Press [Tab] to accept the Autocomplete suggestion
|
||||
|
||||
# Basic assertion for sorting_algorithm...
|
||||
|
||||
|
||||
"—————————————————— Learn more at https://docs.continue.dev/getting-started/overview ————————————————"
|
||||
# —————————————————— Learn more at https://docs.continue.dev/getting-started/overview ——————————————————— #
|
||||
|
|
|
|||
55
extensions/intellij/src/main/resources/continue_tutorial.ts
Normal file
55
extensions/intellij/src/main/resources/continue_tutorial.ts
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/* _________ _____ _____
|
||||
__ ____/______ _______ __ /____(_)_______ ____ _______
|
||||
_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
|
||||
/ /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
|
||||
\____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
|
||||
|
||||
Chat, Edit, and Autocomplete tutorial
|
||||
*/
|
||||
|
||||
|
||||
/* ————————————————————————————————————————————————— Chat ————————————————————————————————————————————————— */
|
||||
|
||||
// Highlight the code below
|
||||
// Press [Cmd/Ctrl + J] 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++) {
|
||||
for (let j = 0; j < x.length - 1; j++) {
|
||||
if (x[j] > x[j + 1]) {
|
||||
let temp = x[j];
|
||||
x[j] = x[j + 1];
|
||||
x[j + 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
/* ————————————————————————————————————————————————— Edit ————————————————————————————————————————————————— */
|
||||
|
||||
// Highlight the code below
|
||||
// Press [Cmd/Ctrl + I] to Edit
|
||||
// Try asking Continue to "make this more readable"
|
||||
function sortingAlgorithm2(x: number[]): number[] {
|
||||
for (let i = 0; i < x.length; i++) {
|
||||
for (let j = 0; j < x.length - 1; j++) {
|
||||
if (x[j] > x[j + 1]) {
|
||||
let temp = x[j];
|
||||
x[j] = x[j + 1];
|
||||
x[j + 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
/* ————————————————————————————————————————————— Autocomplete —————————————————————————————————————————————— */
|
||||
|
||||
// Place cursor after `sortingAlgorithm...` below and press [Enter]
|
||||
// Press [Tab] to accept the Autocomplete suggestion
|
||||
|
||||
// Basic assertion for sortingAlgorithm...
|
||||
|
||||
|
||||
/* —————————————————— Learn more at https://docs.continue.dev/getting-started/overview ——————————————————— */
|
||||
|
|
@ -1,18 +1,10 @@
|
|||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module"
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"extends": ["../../.eslintrc.shared.json"],
|
||||
"rules": {
|
||||
"@typescript-eslint/naming-convention": "warn",
|
||||
"@typescript-eslint/semi": "warn",
|
||||
"curly": "warn",
|
||||
"eqeqeq": "warn",
|
||||
"no-throw-literal": "warn",
|
||||
"semi": "off"
|
||||
},
|
||||
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
|
||||
"@typescript-eslint/naming-convention": "warn"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -668,16 +668,16 @@
|
|||
"anyOf": [
|
||||
{
|
||||
"enum": [
|
||||
"llama3.1-8b",
|
||||
"llama3.1-70b",
|
||||
"llama3.1-405b",
|
||||
"llama2-7b",
|
||||
"llama2-13b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"codellama-7b",
|
||||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"llama2-7b",
|
||||
"llama2-13b"
|
||||
"llama3.1-8b",
|
||||
"llama3.1-70b",
|
||||
"llama3.1-405b"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -984,6 +984,9 @@
|
|||
"llama3.1-8b",
|
||||
"llama3.1-70b",
|
||||
"llama3.1-405b",
|
||||
"llama3.2-3b",
|
||||
"llama3.2-11b",
|
||||
"llama3.2-90b",
|
||||
"codellama-7b",
|
||||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
|
|
@ -1057,6 +1060,10 @@
|
|||
"llama3.1-8b",
|
||||
"llama3.1-70b",
|
||||
"llama3.1-405b",
|
||||
"llama3.2-1b",
|
||||
"llama3.2-3b",
|
||||
"llama3.2-11b",
|
||||
"llama3.2-90b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -1112,6 +1119,10 @@
|
|||
"llama3.1-8b",
|
||||
"llama3.1-70b",
|
||||
"llama3.1-405b",
|
||||
"llama3.2-1b",
|
||||
"llama3.2-3b",
|
||||
"llama3.2-11b",
|
||||
"llama3.2-90b",
|
||||
"phi-2",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
|
|
@ -1250,6 +1261,10 @@
|
|||
"llama3.1-8b",
|
||||
"llama3.1-70b",
|
||||
"llama3.1-405b",
|
||||
"llama3.2-1b",
|
||||
"llama3.2-3b",
|
||||
"llama3.2-11b",
|
||||
"llama3.2-90b",
|
||||
"AUTODETECT"
|
||||
]
|
||||
}
|
||||
|
|
@ -1475,6 +1490,10 @@
|
|||
"llama3.1-8b",
|
||||
"llama3.1-70b",
|
||||
"llama3.1-405b",
|
||||
"llama3.2-1b",
|
||||
"llama3.2-3b",
|
||||
"llama3.2-11b",
|
||||
"llama3.2-90b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -1586,7 +1605,9 @@
|
|||
"enum": [
|
||||
"llama3.1-8b",
|
||||
"llama3.1-70b",
|
||||
"llama3.1-405b"
|
||||
"llama3.1-405b",
|
||||
"llama3.2-1b",
|
||||
"llama3.2-3b"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,8 +7,12 @@
|
|||
Chat, Edit, and Autocomplete tutorial
|
||||
"""
|
||||
|
||||
# ———————————————————— Chat [Cmd/Ctrl + L]: Ask "what sorting algorithm is this?" ————————————————————
|
||||
|
||||
# ————————————————————————————————————————————————— Chat ————————————————————————————————————————————————— #
|
||||
|
||||
## Highlight the code below
|
||||
## Press [Cmd/Ctrl + J] to add to Chat
|
||||
## Try asking Continue "what sorting algorithm is this?"
|
||||
def sorting_algorithm(x):
|
||||
for i in range(len(x)):
|
||||
for j in range(len(x) - 1):
|
||||
|
|
@ -16,8 +20,12 @@ def sorting_algorithm(x):
|
|||
x[j], x[j + 1] = x[j + 1], x[j]
|
||||
return x
|
||||
|
||||
# —————————————————— Edit [Cmd/Ctrl + I]: Tell Continue to "make this more readable" —————————————————
|
||||
|
||||
# ————————————————————————————————————————————————— Edit ————————————————————————————————————————————————— #
|
||||
|
||||
## Highlight the code below
|
||||
## Press [Cmd/Ctrl + I] to Edit
|
||||
## Try asking Continue to "make this more readable"
|
||||
def sorting_algorithm(x):
|
||||
for i in range(len(x)):
|
||||
for j in range(len(x) - 1):
|
||||
|
|
@ -25,9 +33,12 @@ def sorting_algorithm(x):
|
|||
x[j], x[j + 1] = x[j + 1], x[j]
|
||||
return x
|
||||
|
||||
# ——————————————— Autocomplete [Tab]: Place cursor after `:` below and press [Enter] —————————————————
|
||||
# ————————————————————————————————————————————— Autocomplete —————————————————————————————————————————————— #
|
||||
|
||||
# Basic assertion for sorting_algorithm:
|
||||
## Place cursor after `sorting_algorithm...` below and press [Enter]
|
||||
## Press [Tab] to accept the Autocomplete suggestion
|
||||
|
||||
# Basic assertion for sorting_algorithm...
|
||||
|
||||
|
||||
"—————————————————— Learn more at https://docs.continue.dev/getting-started/overview ————————————————"
|
||||
# —————————————————— Learn more at https://docs.continue.dev/getting-started/overview ——————————————————— #
|
||||
|
|
|
|||
8
extensions/vscode/package-lock.json
generated
8
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.9.220",
|
||||
"version": "0.9.223",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.9.220",
|
||||
"version": "0.9.223",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
|
|
@ -71,7 +71,6 @@
|
|||
"@types/vscode": "1.70",
|
||||
"@types/ws": "^8.5.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||
"@typescript-eslint/parser": "^5.45.0",
|
||||
"@vscode/vsce": "^2.22.0",
|
||||
"cargo-cp-artifact": "^0.1",
|
||||
"esbuild": "0.17.19",
|
||||
|
|
@ -103,7 +102,6 @@
|
|||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
"@typescript-eslint/parser": "^7.8.0",
|
||||
"@xenova/transformers": "2.14.0",
|
||||
"adf-to-md": "^1.1.0",
|
||||
"async-mutex": "^0.5.0",
|
||||
|
|
@ -175,7 +173,6 @@
|
|||
"cross-env": "^7.0.3",
|
||||
"esbuild": "0.17.19",
|
||||
"eslint": "^8",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"myers-diff": "^2.1.0",
|
||||
|
|
@ -2152,6 +2149,7 @@
|
|||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz",
|
||||
"integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "5.62.0",
|
||||
"@typescript-eslint/types": "5.62.0",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "continue",
|
||||
"icon": "media/icon.png",
|
||||
"author": "Continue Dev, Inc",
|
||||
"version": "0.9.220",
|
||||
"version": "0.9.222",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/continuedev/continue"
|
||||
|
|
@ -280,6 +280,12 @@
|
|||
"category": "Continue",
|
||||
"title": "Docs Force Re-Index",
|
||||
"group": "Continue"
|
||||
},
|
||||
{
|
||||
"command": "continue.focusContinueSessionId",
|
||||
"category": "Continue",
|
||||
"title": "Focus Continue Chat",
|
||||
"group": "Continue"
|
||||
}
|
||||
],
|
||||
"keybindings": [
|
||||
|
|
@ -539,7 +545,6 @@
|
|||
"@types/vscode": "1.70",
|
||||
"@types/ws": "^8.5.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||
"@typescript-eslint/parser": "^5.45.0",
|
||||
"@vscode/vsce": "^2.22.0",
|
||||
"cargo-cp-artifact": "^0.1",
|
||||
"esbuild": "0.17.19",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { FileEdit } from "core";
|
||||
import { ConfigHandler } from "core/config/ConfigHandler";
|
||||
import { EXTENSION_NAME } from "core/control-plane/env";
|
||||
import * as vscode from "vscode";
|
||||
import { EXTENSION_NAME } from "./util/constants";
|
||||
import { getTheme } from "./util/getTheme";
|
||||
import { getExtensionVersion } from "./util/util";
|
||||
import { getExtensionUri, getNonce, getUniqueId } from "./util/vscode";
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import type {
|
|||
Thread,
|
||||
} from "core";
|
||||
import { Range } from "core";
|
||||
import { EXTENSION_NAME } from "core/control-plane/env";
|
||||
import { walkDir } from "core/indexing/walkDir";
|
||||
import { GetGhTokenArgs } from "core/protocol/ide";
|
||||
import {
|
||||
|
|
@ -26,7 +27,6 @@ import * as vscode from "vscode";
|
|||
import { executeGotoProvider } from "./autocomplete/lsp";
|
||||
import { DiffManager } from "./diff/horizontal";
|
||||
import { Repository } from "./otherExtensions/git";
|
||||
import { EXTENSION_NAME } from "./util/constants";
|
||||
import { VsCodeIdeUtils } from "./util/ideUtils";
|
||||
import {
|
||||
getExtensionUri,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
import { getContinueRcPath, getTsConfigPath, migrate } from "core/util/paths";
|
||||
import { getContinueRcPath, getTsConfigPath } from "core/util/paths";
|
||||
import { Telemetry } from "core/util/posthog";
|
||||
import path from "node:path";
|
||||
import * as vscode from "vscode";
|
||||
import { VsCodeExtension } from "../extension/VsCodeExtension";
|
||||
import registerQuickFixProvider from "../lang-server/codeActions";
|
||||
import { getExtensionVersion } from "../util/util";
|
||||
import { getExtensionUri } from "../util/vscode";
|
||||
import { VsCodeContinueApi } from "./api";
|
||||
import { setupInlineTips } from "./inlineTips";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { EXTENSION_NAME } from "core/control-plane/env";
|
||||
import * as vscode from "vscode";
|
||||
import { EXTENSION_NAME } from "../util/constants";
|
||||
import { getMetaKeyName } from "../util/util";
|
||||
|
||||
const inlineTipDecoration = vscode.window.createTextEditorDecorationType({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ILLM } from "core";
|
||||
import { EXTENSION_NAME } from "core/control-plane/env";
|
||||
import * as vscode from "vscode";
|
||||
import { Battery } from "../util/battery";
|
||||
import { EXTENSION_NAME } from "../util/constants";
|
||||
import {
|
||||
CONTINUE_WORKSPACE_KEY,
|
||||
getContinueWorkspaceConfig,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { CompletionProvider } from "core/autocomplete/completionProvider";
|
|||
import { ConfigHandler } from "core/config/ConfigHandler";
|
||||
import { getModelByRole } from "core/config/util";
|
||||
import { ContinueServerClient } from "core/continueServer/stubs/client";
|
||||
import { EXTENSION_NAME } from "core/control-plane/env";
|
||||
import { Core } from "core/core";
|
||||
import { walkDirAsync } from "core/indexing/walkDir";
|
||||
import { GlobalContext } from "core/util/GlobalContext";
|
||||
|
|
@ -28,7 +29,6 @@ import { DiffManager } from "./diff/horizontal";
|
|||
import { VerticalDiffManager } from "./diff/vertical/manager";
|
||||
import { QuickEdit, QuickEditShowParams } from "./quickEdit/QuickEditQuickPick";
|
||||
import { Battery } from "./util/battery";
|
||||
import { EXTENSION_NAME } from "./util/constants";
|
||||
import { getFullyQualifiedPath } from "./util/util";
|
||||
import { uriFromFilePath } from "./util/vscode";
|
||||
import type { VsCodeWebviewProtocol } from "./webviewProtocol";
|
||||
|
|
@ -480,6 +480,14 @@ const commandsMap: (
|
|||
"continue.viewHistory": () => {
|
||||
sidebar.webviewProtocol?.request("viewHistory", undefined);
|
||||
},
|
||||
"continue.focusContinueSessionId": async (sessionId: string | undefined) => {
|
||||
if (!sessionId) {
|
||||
sessionId = await vscode.window.showInputBox({
|
||||
prompt: "Enter the Session ID"
|
||||
});
|
||||
}
|
||||
sidebar.webviewProtocol?.request("focusContinueSessionId", { sessionId });
|
||||
},
|
||||
"continue.applyCodeFromChat": () => {
|
||||
sidebar.webviewProtocol.request("applyCodeFromChat", undefined);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -36,16 +36,10 @@ export const belowIndexDecorationType =
|
|||
});
|
||||
|
||||
export class DecorationTypeRangeManager {
|
||||
private decorationType: vscode.TextEditorDecorationType;
|
||||
private editor: vscode.TextEditor;
|
||||
|
||||
constructor(
|
||||
decorationType: vscode.TextEditorDecorationType,
|
||||
editor: vscode.TextEditor,
|
||||
) {
|
||||
this.decorationType = decorationType;
|
||||
this.editor = editor;
|
||||
}
|
||||
private decorationType: vscode.TextEditorDecorationType,
|
||||
private editor: vscode.TextEditor,
|
||||
) {}
|
||||
|
||||
private ranges: vscode.Range[] = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ export interface VerticalDiffHandlerOptions {
|
|||
}
|
||||
|
||||
export class VerticalDiffHandler implements vscode.Disposable {
|
||||
private editor: vscode.TextEditor;
|
||||
private startLine: number;
|
||||
private endLine: number;
|
||||
private currentLineIndex: number;
|
||||
private cancelled = false;
|
||||
|
||||
|
|
@ -31,12 +28,10 @@ export class VerticalDiffHandler implements vscode.Disposable {
|
|||
|
||||
private newLinesAdded = 0;
|
||||
|
||||
public options: VerticalDiffHandlerOptions;
|
||||
|
||||
constructor(
|
||||
startLine: number,
|
||||
endLine: number,
|
||||
editor: vscode.TextEditor,
|
||||
private startLine: number,
|
||||
private endLine: number,
|
||||
private editor: vscode.TextEditor,
|
||||
private readonly editorToVerticalDiffCodeLens: Map<
|
||||
string,
|
||||
VerticalDiffCodeLens[]
|
||||
|
|
@ -46,18 +41,15 @@ export class VerticalDiffHandler implements vscode.Disposable {
|
|||
accept: boolean,
|
||||
) => void,
|
||||
private readonly refreshCodeLens: () => void,
|
||||
options: VerticalDiffHandlerOptions,
|
||||
public options: VerticalDiffHandlerOptions,
|
||||
) {
|
||||
this.currentLineIndex = startLine;
|
||||
this.startLine = startLine;
|
||||
this.endLine = endLine;
|
||||
this.editor = editor;
|
||||
this.options = options;
|
||||
|
||||
this.redDecorationManager = new DecorationTypeRangeManager(
|
||||
redDecorationType,
|
||||
this.editor,
|
||||
);
|
||||
|
||||
this.greenDecorationManager = new DecorationTypeRangeManager(
|
||||
greenDecorationType,
|
||||
this.editor,
|
||||
|
|
@ -344,6 +336,7 @@ export class VerticalDiffHandler implements vscode.Disposable {
|
|||
}
|
||||
|
||||
async run(diffLineGenerator: AsyncGenerator<DiffLine>) {
|
||||
let diffLines = []
|
||||
try {
|
||||
// As an indicator of loading
|
||||
this.updateIndexLineDecorations();
|
||||
|
|
@ -352,6 +345,7 @@ export class VerticalDiffHandler implements vscode.Disposable {
|
|||
if (this.isCancelled) {
|
||||
return;
|
||||
}
|
||||
diffLines.push(diffLine)
|
||||
await this.queueDiffLine(diffLine);
|
||||
}
|
||||
|
||||
|
|
@ -374,6 +368,7 @@ export class VerticalDiffHandler implements vscode.Disposable {
|
|||
this.clearForFilepath(this.filepath, false);
|
||||
throw e;
|
||||
}
|
||||
return diffLines
|
||||
}
|
||||
|
||||
async acceptRejectBlock(
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ export class VerticalDiffManager {
|
|||
|
||||
private userChangeListener: vscode.Disposable | undefined;
|
||||
|
||||
logDiffs: DiffLine[] | undefined;
|
||||
|
||||
constructor(
|
||||
private readonly configHandler: ConfigHandler,
|
||||
private readonly webviewProtocol: VsCodeWebviewProtocol,
|
||||
|
|
@ -237,8 +239,8 @@ export class VerticalDiffManager {
|
|||
);
|
||||
|
||||
try {
|
||||
await diffHandler.run(diffStream);
|
||||
|
||||
this.logDiffs = await diffHandler.run(diffStream);
|
||||
|
||||
// enable a listener for user edits to file while diff is open
|
||||
this.enableDocumentChangeListener();
|
||||
} catch (e) {
|
||||
|
|
@ -410,7 +412,7 @@ export class VerticalDiffManager {
|
|||
);
|
||||
|
||||
try {
|
||||
await diffHandler.run(
|
||||
this.logDiffs = await diffHandler.run(
|
||||
streamDiffLines(
|
||||
prefix,
|
||||
rangeContent,
|
||||
|
|
|
|||
|
|
@ -3,18 +3,31 @@
|
|||
*/
|
||||
|
||||
import { setupCa } from "core/util/ca";
|
||||
import { extractMinimalStackTraceInfo } from "core/util/extractMinimalStackTraceInfo";
|
||||
import { Telemetry } from "core/util/posthog";
|
||||
import * as vscode from "vscode";
|
||||
import { getExtensionVersion } from "./util/util";
|
||||
|
||||
async function dynamicImportAndActivate(context: vscode.ExtensionContext) {
|
||||
await setupCa();
|
||||
const { activateExtension } = await import("./activation/activate");
|
||||
try {
|
||||
return activateExtension(context);
|
||||
} catch (e) {
|
||||
return await activateExtension(context);
|
||||
}
|
||||
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
return dynamicImportAndActivate(context).catch((e) => {
|
||||
console.log("Error activating extension: ", e);
|
||||
Telemetry.capture(
|
||||
"vscode_extension_activation_error",
|
||||
{
|
||||
stack: extractMinimalStackTraceInfo(e.stack),
|
||||
message: e.message,
|
||||
},
|
||||
false,
|
||||
true,
|
||||
);
|
||||
vscode.window
|
||||
.showInformationMessage(
|
||||
.showWarningMessage(
|
||||
"Error activating the Continue extension.",
|
||||
"View Logs",
|
||||
"Retry",
|
||||
|
|
@ -27,12 +40,7 @@ async function dynamicImportAndActivate(context: vscode.ExtensionContext) {
|
|||
vscode.commands.executeCommand("workbench.action.reloadWindow");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
setupCa();
|
||||
return dynamicImportAndActivate(context);
|
||||
});
|
||||
}
|
||||
|
||||
export function deactivate() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { IContextProvider } from "core";
|
||||
import { ConfigHandler } from "core/config/ConfigHandler";
|
||||
import { controlPlaneEnv, EXTENSION_NAME } from "core/control-plane/env";
|
||||
import { Core } from "core/core";
|
||||
import { FromCoreProtocol, ToCoreProtocol } from "core/protocol";
|
||||
import { InProcessMessenger } from "core/util/messenger";
|
||||
|
|
@ -26,7 +27,6 @@ import {
|
|||
} from "../stubs/WorkOsAuthProvider";
|
||||
import { arePathsEqual } from "../util/arePathsEqual";
|
||||
import { Battery } from "../util/battery";
|
||||
import { AUTH_TYPE, EXTENSION_NAME } from "../util/constants";
|
||||
import { TabAutocompleteModel } from "../util/loadAutocompleteModel";
|
||||
import { VsCodeIde } from "../VsCodeIde";
|
||||
import type { VsCodeWebviewProtocol } from "../webviewProtocol";
|
||||
|
|
@ -281,7 +281,7 @@ export class VsCodeExtension {
|
|||
vscode.authentication.onDidChangeSessions(async (e) => {
|
||||
if (e.provider.id === "github") {
|
||||
this.configHandler.reloadConfig();
|
||||
} else if (e.provider.id === AUTH_TYPE) {
|
||||
} else if (e.provider.id === controlPlaneEnv.AUTH_TYPE) {
|
||||
const sessionInfo = await getControlPlaneSessionInfo(true);
|
||||
this.webviewProtocolPromise.then(async (webviewProtocol) => {
|
||||
webviewProtocol.request("didChangeControlPlaneSessionInfo", {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import { VsCodeWebviewProtocol } from "../webviewProtocol";
|
|||
type TODO = any;
|
||||
type ToIdeOrWebviewFromCoreProtocol = ToIdeFromCoreProtocol &
|
||||
ToWebviewFromCoreProtocol;
|
||||
|
||||
export class VsCodeMessenger {
|
||||
onWebview<T extends keyof FromWebviewProtocol>(
|
||||
messageType: T,
|
||||
|
|
@ -149,7 +150,7 @@ export class VsCodeMessenger {
|
|||
await vscode.commands.executeCommand("continue.rejectDiff", filepath);
|
||||
});
|
||||
|
||||
this.onWebview("applyToCurrentFile", async (msg) => {
|
||||
this.onWebview("applyToCurrentFile", async ({ data }) => {
|
||||
// Get active text editor
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (!editor) {
|
||||
|
|
@ -164,16 +165,11 @@ export class VsCodeMessenger {
|
|||
let llm = getModelByRole(config, "applyCodeBlock");
|
||||
|
||||
if (!llm) {
|
||||
const defaultModelTitle = await this.webviewProtocol.request(
|
||||
"getDefaultModelTitle",
|
||||
undefined,
|
||||
);
|
||||
|
||||
llm = config.models.find((model) => model.title === defaultModelTitle);
|
||||
llm = config.models.find((model) => model.title === data.curSelectedModelTitle);
|
||||
|
||||
if (!llm) {
|
||||
vscode.window.showErrorMessage(
|
||||
`Model ${defaultModelTitle} not found in config.`,
|
||||
`Model ${data.curSelectedModelTitle} not found in config.`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
@ -184,20 +180,20 @@ export class VsCodeMessenger {
|
|||
// Generate the diff and pass through diff manager
|
||||
const [instant, diffLines] = await applyCodeBlock(
|
||||
editor.document.getText(),
|
||||
msg.data.text,
|
||||
data.text,
|
||||
getBasename(editor.document.fileName),
|
||||
llm,
|
||||
fastLlm,
|
||||
);
|
||||
const verticalDiffManager = await this.verticalDiffManagerPromise;
|
||||
if (instant) {
|
||||
verticalDiffManager.streamDiffLines(
|
||||
await verticalDiffManager.streamDiffLines(
|
||||
diffLines,
|
||||
instant,
|
||||
msg.data.streamId,
|
||||
data.streamId,
|
||||
);
|
||||
} else {
|
||||
const prompt = `The following code was suggested as an edit:\n\`\`\`\n${msg.data.text}\n\`\`\`\nPlease apply it to the previous code.`;
|
||||
const prompt = `The following code was suggested as an edit:\n\`\`\`\n${data.text}\n\`\`\`\nPlease apply it to the previous code.`;
|
||||
const fullEditorRange = new vscode.Range(
|
||||
0,
|
||||
0,
|
||||
|
|
@ -207,10 +203,11 @@ export class VsCodeMessenger {
|
|||
const rangeToApplyTo = editor.selection.isEmpty
|
||||
? fullEditorRange
|
||||
: editor.selection;
|
||||
verticalDiffManager.streamEdit(
|
||||
|
||||
await verticalDiffManager.streamEdit(
|
||||
prompt,
|
||||
llm.title,
|
||||
msg.data.streamId,
|
||||
data.streamId,
|
||||
undefined,
|
||||
undefined,
|
||||
rangeToApplyTo,
|
||||
|
|
|
|||
|
|
@ -4,11 +4,7 @@ import { DiffManager, DIFF_DIRECTORY } from "../../../diff/horizontal";
|
|||
import { getMetaKeyLabel } from "../../../util/util";
|
||||
|
||||
export class DiffViewerCodeLensProvider implements vscode.CodeLensProvider {
|
||||
diffManager: DiffManager;
|
||||
|
||||
constructor(diffManager: DiffManager) {
|
||||
this.diffManager = diffManager;
|
||||
}
|
||||
constructor(private diffManager: DiffManager) {}
|
||||
|
||||
public provideCodeLenses(
|
||||
document: vscode.TextDocument,
|
||||
|
|
|
|||
|
|
@ -62,13 +62,7 @@ export class QuickActionsCodeLensProvider implements vscode.CodeLensProvider {
|
|||
vscode.SymbolKind.Constructor,
|
||||
];
|
||||
|
||||
customQuickActionsConfig?: QuickActionConfig[];
|
||||
|
||||
constructor(customQuickActionsConfigs?: QuickActionConfig[]) {
|
||||
if (customQuickActionsConfigs) {
|
||||
this.customQuickActionsConfig = customQuickActionsConfigs;
|
||||
}
|
||||
}
|
||||
constructor(private customQuickActionsConfigs?: QuickActionConfig[]) {}
|
||||
|
||||
getCustomCommands(
|
||||
range: vscode.Range,
|
||||
|
|
@ -145,8 +139,8 @@ export class QuickActionsCodeLensProvider implements vscode.CodeLensProvider {
|
|||
const symbols = await this.getTopLevelAndChildrenSymbols(document.uri);
|
||||
|
||||
return symbols.flatMap(({ range }) => {
|
||||
const commands: vscode.Command[] = !!this.customQuickActionsConfig
|
||||
? this.getCustomCommands(range, this.customQuickActionsConfig)
|
||||
const commands: vscode.Command[] = !!this.customQuickActionsConfigs
|
||||
? this.getCustomCommands(range, this.customQuickActionsConfigs)
|
||||
: this.getDefaultCommand(range);
|
||||
|
||||
return commands.map((command) => new vscode.CodeLens(range, command));
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import { ConfigHandler } from "core/config/ConfigHandler";
|
|||
import { getModelByRole } from "core/config/util";
|
||||
// @ts-ignore
|
||||
import MiniSearch from "minisearch";
|
||||
import { logDevData } from "core/util/devdata";
|
||||
|
||||
/**
|
||||
* Used to track what action to take after a user interacts
|
||||
|
|
@ -236,7 +237,8 @@ export class QuickEdit {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
let model = await this.getCurModelTitle();
|
||||
logDevData('quickEdit', {prompt, path, label, diffs: this.verticalDiffManager.logDiffs, model});
|
||||
quickPick.dispose();
|
||||
});
|
||||
}
|
||||
|
|
@ -319,9 +321,8 @@ export class QuickEdit {
|
|||
|
||||
return isSelectionEmpty
|
||||
? `Edit ${fileName}`
|
||||
: `Edit ${fileName}:${start.line}${
|
||||
end.line > start.line ? `-${end.line}` : ""
|
||||
}`;
|
||||
: `Edit ${fileName}:${start.line}${end.line > start.line ? `-${end.line}` : ""
|
||||
}`;
|
||||
};
|
||||
|
||||
private async _streamEditWithInputAndContext(
|
||||
|
|
@ -385,7 +386,7 @@ export class QuickEdit {
|
|||
const modelTitle = await this.getCurModelTitle();
|
||||
|
||||
if (!modelTitle) {
|
||||
this.ide.showToast("info", "Please configure a model to use Quick Edit");
|
||||
this.ide.showToast("error", "Please configure a model to use Quick Edit");
|
||||
return { label: undefined, value: undefined };
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,15 +17,8 @@ import {
|
|||
import { PromiseAdapter, promiseFromEvent } from "./promiseUtils";
|
||||
|
||||
const AUTH_NAME = "Continue";
|
||||
const CLIENT_ID =
|
||||
process.env.CONTROL_PLANE_ENV === "local"
|
||||
? "client_01J0FW6XCPMJMQ3CG51RB4HBZQ"
|
||||
: "client_01J0FW6XN8N2XJAECF7NE0Y65J";
|
||||
const APP_URL =
|
||||
process.env.CONTROL_PLANE_ENV === "local"
|
||||
? "http://localhost:3000"
|
||||
: "https://app.continue.dev";
|
||||
const SESSIONS_SECRET_KEY = `${AUTH_TYPE}.sessions`;
|
||||
|
||||
const SESSIONS_SECRET_KEY = `${controlPlaneEnv.AUTH_TYPE}.sessions`;
|
||||
|
||||
class UriEventHandler extends EventEmitter<Uri> implements UriHandler {
|
||||
public handleUri(uri: Uri) {
|
||||
|
|
@ -33,12 +26,9 @@ class UriEventHandler extends EventEmitter<Uri> implements UriHandler {
|
|||
}
|
||||
}
|
||||
|
||||
import {
|
||||
CONTROL_PLANE_URL,
|
||||
ControlPlaneSessionInfo,
|
||||
} from "core/control-plane/client";
|
||||
import { ControlPlaneSessionInfo } from "core/control-plane/client";
|
||||
import { controlPlaneEnv } from "core/control-plane/env";
|
||||
import crypto from "crypto";
|
||||
import { AUTH_TYPE } from "../util/constants";
|
||||
import { SecretStorage } from "./SecretStorage";
|
||||
|
||||
// Function to generate a random string of specified length
|
||||
|
|
@ -93,7 +83,7 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
|
|||
constructor(private readonly context: ExtensionContext) {
|
||||
this._disposable = Disposable.from(
|
||||
authentication.registerAuthenticationProvider(
|
||||
AUTH_TYPE,
|
||||
controlPlaneEnv.AUTH_TYPE,
|
||||
AUTH_NAME,
|
||||
this,
|
||||
{ supportsMultipleAccounts: false },
|
||||
|
|
@ -104,31 +94,42 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
|
|||
this.secretStorage = new SecretStorage(context);
|
||||
}
|
||||
|
||||
private decodeJwt(jwt: string): any {
|
||||
const decodedToken = JSON.parse(
|
||||
Buffer.from(jwt.split(".")[1], "base64").toString(),
|
||||
);
|
||||
return decodedToken;
|
||||
private decodeJwt(jwt: string): Record<string, any> | null {
|
||||
try {
|
||||
const decodedToken = JSON.parse(
|
||||
Buffer.from(jwt.split(".")[1], "base64").toString(),
|
||||
);
|
||||
return decodedToken;
|
||||
} catch (e: any) {
|
||||
console.warn(`Error decoding JWT: ${e}`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private getExpirationTimeMs(jwt: string): number {
|
||||
const decodedToken = this.decodeJwt(jwt);
|
||||
if (!decodedToken) {
|
||||
return WorkOsAuthProvider.EXPIRATION_TIME_MS;
|
||||
}
|
||||
return decodedToken.exp && decodedToken.iat
|
||||
? (decodedToken.exp - decodedToken.iat) * 1000
|
||||
: WorkOsAuthProvider.EXPIRATION_TIME_MS;
|
||||
}
|
||||
|
||||
private jwtIsExpired(jwt: string): boolean {
|
||||
private jwtIsExpiredOrInvalid(jwt: string): boolean {
|
||||
const decodedToken = this.decodeJwt(jwt);
|
||||
if (!decodedToken) {
|
||||
return true;
|
||||
}
|
||||
return decodedToken.exp * 1000 < Date.now();
|
||||
}
|
||||
|
||||
private async debugAccessTokenValidity(jwt: string, refreshToken: string) {
|
||||
const expired = this.jwtIsExpired(jwt);
|
||||
if (expired) {
|
||||
console.debug(`Invalid JWT: ${expired}`);
|
||||
const expiredOrInvalid = this.jwtIsExpiredOrInvalid(jwt);
|
||||
if (expiredOrInvalid) {
|
||||
console.debug("Invalid JWT");
|
||||
} else {
|
||||
console.debug(`Valid JWT: ${expired}`);
|
||||
console.debug("Valid JWT");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -145,8 +146,13 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
|
|||
return [];
|
||||
}
|
||||
|
||||
const value = JSON.parse(data) as ContinueAuthenticationSession[];
|
||||
return value;
|
||||
try {
|
||||
const value = JSON.parse(data) as ContinueAuthenticationSession[];
|
||||
return value;
|
||||
} catch (e: any) {
|
||||
console.warn(`Error parsing sessions.json: ${e}`);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
get onDidChangeSessions() {
|
||||
|
|
@ -162,7 +168,7 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
|
|||
get redirectUri() {
|
||||
if (env.uriScheme === "vscode-insiders" || env.uriScheme === "vscode") {
|
||||
// We redirect to a page that says "you can close this page", and that page finishes the redirect
|
||||
const url = new URL(APP_URL);
|
||||
const url = new URL(controlPlaneEnv.APP_URL);
|
||||
url.pathname = `/auth/${env.uriScheme}-redirect`;
|
||||
return url.toString();
|
||||
}
|
||||
|
|
@ -170,7 +176,11 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
|
|||
}
|
||||
|
||||
async refreshSessions() {
|
||||
await this._refreshSessions();
|
||||
try {
|
||||
await this._refreshSessions();
|
||||
} catch (e) {
|
||||
console.error(`Error refreshing sessions: ${e}`);
|
||||
}
|
||||
}
|
||||
|
||||
private async _refreshSessions(): Promise<void> {
|
||||
|
|
@ -228,15 +238,18 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
|
|||
refreshToken: string;
|
||||
expiresInMs: number;
|
||||
}> {
|
||||
const response = await fetch(new URL("/auth/refresh", CONTROL_PLANE_URL), {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
const response = await fetch(
|
||||
new URL("/auth/refresh", controlPlaneEnv.CONTROL_PLANE_URL),
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
refreshToken,
|
||||
}),
|
||||
},
|
||||
body: JSON.stringify({
|
||||
refreshToken,
|
||||
}),
|
||||
});
|
||||
);
|
||||
if (!response.ok) {
|
||||
const text = await response.text();
|
||||
throw new Error("Error refreshing token: " + text);
|
||||
|
|
@ -356,7 +369,7 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
|
|||
const url = new URL("https://api.workos.com/user_management/authorize");
|
||||
const params = {
|
||||
response_type: "code",
|
||||
client_id: CLIENT_ID,
|
||||
client_id: controlPlaneEnv.WORKOS_CLIENT_ID,
|
||||
redirect_uri: this.redirectUri,
|
||||
state: stateId,
|
||||
code_challenge: codeChallenge,
|
||||
|
|
@ -453,7 +466,7 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
|
|||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
client_id: CLIENT_ID,
|
||||
client_id: controlPlaneEnv.WORKOS_CLIENT_ID,
|
||||
code_verifier: codeVerifier,
|
||||
grant_type: "authorization_code",
|
||||
code: token,
|
||||
|
|
@ -470,7 +483,7 @@ export async function getControlPlaneSessionInfo(
|
|||
silent: boolean,
|
||||
): Promise<ControlPlaneSessionInfo | undefined> {
|
||||
const session = await authentication.getSession(
|
||||
AUTH_TYPE,
|
||||
controlPlaneEnv.AUTH_TYPE,
|
||||
[],
|
||||
silent ? { silent: true } : { createIfNone: true },
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { EXTENSION_NAME } from "core/control-plane/env";
|
||||
import * as vscode from "vscode";
|
||||
import { EXTENSION_NAME } from "../util/constants";
|
||||
import { getUserToken } from "./auth";
|
||||
import { RemoteConfigSync } from "./remoteConfig";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { EXTENSION_NAME } from "core/control-plane/env";
|
||||
import * as vscode from "vscode";
|
||||
import { EXTENSION_NAME } from "../util/constants";
|
||||
|
||||
export async function getUserToken(): Promise<string> {
|
||||
// Prefer manual user token first
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { ContinueServerClient } from "core/continueServer/stubs/client";
|
||||
import { EXTENSION_NAME } from "core/control-plane/env";
|
||||
import {
|
||||
getConfigJsPathForRemote,
|
||||
getConfigJsonPathForRemote,
|
||||
} from "core/util/paths";
|
||||
import * as fs from "fs";
|
||||
import * as vscode from "vscode";
|
||||
import { EXTENSION_NAME } from "../util/constants";
|
||||
import { CONTINUE_WORKSPACE_KEY } from "../util/workspaceConfig";
|
||||
|
||||
export class RemoteConfigSync {
|
||||
|
|
|
|||
|
|
@ -129,7 +129,6 @@ export class CapturedTerminal {
|
|||
private readonly writeEmitter: vscode.EventEmitter<string>;
|
||||
|
||||
private splitByCommandsBuffer = "";
|
||||
private readonly onCommandOutput: ((output: string) => void) | undefined;
|
||||
|
||||
splitByCommandsListener(data: string) {
|
||||
// Split the output by commands so it can be sent to Continue Server
|
||||
|
|
@ -164,10 +163,8 @@ export class CapturedTerminal {
|
|||
|
||||
constructor(
|
||||
options: { name: string } & Partial<vscode.ExtensionTerminalOptions>,
|
||||
onCommandOutput?: (output: string) => void,
|
||||
private readonly onCommandOutput?: (output: string) => void,
|
||||
) {
|
||||
this.onCommandOutput = onCommandOutput;
|
||||
|
||||
// this.shellCmd = "bash"; // getDefaultShell();
|
||||
this.shellCmd = getDefaultShell();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
export const EXTENSION_NAME = "continue";
|
||||
export const AUTH_TYPE =
|
||||
process.env.CONTROL_PLANE_ENV === "local"
|
||||
? `${EXTENSION_NAME}-staging`
|
||||
: EXTENSION_NAME;
|
||||
|
|
@ -17,8 +17,8 @@ import {
|
|||
uriFromFilePath,
|
||||
} from "./vscode";
|
||||
|
||||
import { EXTENSION_NAME } from "core/control-plane/env";
|
||||
import _ from "lodash";
|
||||
import { EXTENSION_NAME } from "./constants";
|
||||
|
||||
const util = require("node:util");
|
||||
const asyncExec = util.promisify(require("node:child_process").exec);
|
||||
|
|
|
|||
|
|
@ -13,11 +13,7 @@ export class TabAutocompleteModel {
|
|||
private shownOllamaWarning = false;
|
||||
private shownDeepseekWarning = false;
|
||||
|
||||
private configHandler: ConfigHandler;
|
||||
|
||||
constructor(configHandler: ConfigHandler) {
|
||||
this.configHandler = configHandler;
|
||||
}
|
||||
constructor(private configHandler: ConfigHandler) {}
|
||||
|
||||
clearLlm() {
|
||||
this._llm = undefined;
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ export async function showTutorial() {
|
|||
}
|
||||
|
||||
export class VsCodeWebviewProtocol
|
||||
implements IMessenger<FromWebviewProtocol, ToWebviewProtocol>
|
||||
{
|
||||
implements IMessenger<FromWebviewProtocol, ToWebviewProtocol> {
|
||||
listeners = new Map<
|
||||
keyof FromWebviewProtocol,
|
||||
((message: Message) => any)[]
|
||||
|
|
@ -125,7 +124,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.";
|
||||
|
|
@ -179,7 +178,7 @@ export class VsCodeWebviewProtocol
|
|||
});
|
||||
}
|
||||
|
||||
constructor(private readonly reloadConfig: () => void) {}
|
||||
constructor(private readonly reloadConfig: () => void) { }
|
||||
invoke<T extends keyof FromWebviewProtocol>(
|
||||
messageType: T,
|
||||
data: FromWebviewProtocol[T][0],
|
||||
|
|
|
|||
2
gui/package-lock.json
generated
2
gui/package-lock.json
generated
|
|
@ -104,7 +104,6 @@
|
|||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
"@typescript-eslint/parser": "^7.8.0",
|
||||
"@xenova/transformers": "2.14.0",
|
||||
"adf-to-md": "^1.1.0",
|
||||
"async-mutex": "^0.5.0",
|
||||
|
|
@ -176,7 +175,6 @@
|
|||
"cross-env": "^7.0.3",
|
||||
"esbuild": "0.17.19",
|
||||
"eslint": "^8",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"myers-diff": "^2.1.0",
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue