Merge branch 'preview' into nate/flight-tab-auto
This commit is contained in:
commit
4a6ae9d02d
163 changed files with 12277 additions and 3738 deletions
12
.vscode/launch.json
vendored
12
.vscode/launch.json
vendored
|
|
@ -5,6 +5,18 @@
|
|||
"version": "0.2.0",
|
||||
"compounds": [],
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Core Binary",
|
||||
"skipFiles": ["<node_internals>/**"],
|
||||
"program": "${workspaceFolder}/pkg/out/index.js",
|
||||
"preLaunchTask": "pkg:esbuild",
|
||||
"outFiles": ["${workspaceFolder}/pkg/out/**/*.js"],
|
||||
"sourceMaps": true,
|
||||
"smartStep": true,
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
|
|
|
|||
12
.vscode/tasks.json
vendored
12
.vscode/tasks.json
vendored
|
|
@ -136,6 +136,18 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
//
|
||||
// esbuild for the core binary
|
||||
{
|
||||
"label": "pkg:esbuild",
|
||||
"type": "shell",
|
||||
"command": "npm",
|
||||
"args": ["run", "esbuild"],
|
||||
"problemMatcher": [],
|
||||
"options": {
|
||||
"cwd": "pkg"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { getBasename } from "../util";
|
|||
|
||||
import { getAst, getScopeAroundRange, getTreePathAtCursor } from "./ast";
|
||||
import { AutocompleteLanguageInfo, LANGUAGES, Typescript } from "./languages";
|
||||
import { rankSnippets } from "./ranking";
|
||||
import { AutocompleteSnippet, rankSnippets } from "./ranking";
|
||||
import { slidingWindowMatcher } from "./slidingWindow";
|
||||
|
||||
export function languageForFilepath(
|
||||
|
|
@ -65,9 +65,25 @@ function shouldCompleteMultilineAst(
|
|||
async function shouldCompleteMultiline(
|
||||
filepath: string,
|
||||
fullPrefix: string,
|
||||
fullSuffix: string
|
||||
): Promise<boolean> {
|
||||
// Use AST to determine whether to complete multiline
|
||||
fullSuffix: string,
|
||||
clipboardText: string,
|
||||
language: AutocompleteLanguageInfo,
|
||||
getDefinition: (
|
||||
filepath: string,
|
||||
line: number,
|
||||
character: number
|
||||
) => Promise<AutocompleteSnippet | undefined>,
|
||||
options: TabAutocompleteOptions,
|
||||
modelName: string
|
||||
): Promise<{
|
||||
prefix: string;
|
||||
suffix: string;
|
||||
useFim: boolean;
|
||||
completeMultiline: boolean;
|
||||
}> {
|
||||
// Find external snippets
|
||||
const snippets: AutocompleteSnippet[] = [];
|
||||
|
||||
let treePath: Parser.SyntaxNode[] | undefined;
|
||||
try {
|
||||
const ast = await getAst(filepath, fullPrefix + fullSuffix);
|
||||
|
|
@ -154,17 +170,17 @@ export async function constructAutocompletePrompt(
|
|||
.join("\n");
|
||||
const maxPrefixTokens =
|
||||
options.maxPromptTokens * options.prefixPercentage -
|
||||
countTokens(formattedSnippets, "gpt-4");
|
||||
let prefix = pruneLinesFromTop(fullPrefix, maxPrefixTokens);
|
||||
countTokens(formattedSnippets, modelName);
|
||||
let prefix = pruneLinesFromTop(fullPrefix, maxPrefixTokens, modelName);
|
||||
if (formattedSnippets.length > 0) {
|
||||
prefix = formattedSnippets + "\n" + prefix;
|
||||
}
|
||||
|
||||
const maxSuffixTokens = Math.min(
|
||||
options.maxPromptTokens - countTokens(prefix, "gpt-4"),
|
||||
options.maxPromptTokens - countTokens(prefix, modelName),
|
||||
options.maxSuffixPercentage * options.maxPromptTokens
|
||||
);
|
||||
let suffix = pruneLinesFromBottom(fullSuffix, maxSuffixTokens);
|
||||
let suffix = pruneLinesFromBottom(fullSuffix, maxSuffixTokens, modelName);
|
||||
|
||||
return {
|
||||
prefix,
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export const Scala = {
|
|||
export const Go = {
|
||||
stopWords: ["func", "package", "import", "type"],
|
||||
comment: "//",
|
||||
endOfLine: [""],
|
||||
endOfLine: [],
|
||||
};
|
||||
|
||||
// Rust
|
||||
|
|
@ -69,9 +69,18 @@ export const Rust = {
|
|||
|
||||
// Haskell
|
||||
export const Haskell = {
|
||||
stopWords: ["data", "type", "newtype", "class", "instance", "let", "in", "where"],
|
||||
stopWords: [
|
||||
"data",
|
||||
"type",
|
||||
"newtype",
|
||||
"class",
|
||||
"instance",
|
||||
"let",
|
||||
"in",
|
||||
"where",
|
||||
],
|
||||
comment: "--",
|
||||
endOfLine: [""],
|
||||
endOfLine: [],
|
||||
};
|
||||
|
||||
// PHP
|
||||
|
|
@ -85,7 +94,7 @@ export const PHP = {
|
|||
export const RubyOnRails = {
|
||||
stopWords: ["def", "class", "module"],
|
||||
comment: "#",
|
||||
endOfLine: [""],
|
||||
endOfLine: [],
|
||||
};
|
||||
|
||||
// Swift
|
||||
|
|
@ -106,35 +115,66 @@ export const Kotlin = {
|
|||
export const Ruby = {
|
||||
stopWords: ["class", "module", "def"],
|
||||
comment: "#",
|
||||
endOfLine: [""],
|
||||
endOfLine: [],
|
||||
};
|
||||
|
||||
// Clojure
|
||||
export const Clojure = {
|
||||
stopWords: ["def", "fn", "let", "do", "if", "defn", "ns", "defmacro"],
|
||||
comment: ";",
|
||||
endOfLine: [""],
|
||||
endOfLine: [],
|
||||
};
|
||||
|
||||
// Julia
|
||||
export const Julia = {
|
||||
stopWords: ["function", "macro", "if", "else", "elseif", "while", "for", "begin", "end", "module"],
|
||||
stopWords: [
|
||||
"function",
|
||||
"macro",
|
||||
"if",
|
||||
"else",
|
||||
"elseif",
|
||||
"while",
|
||||
"for",
|
||||
"begin",
|
||||
"end",
|
||||
"module",
|
||||
],
|
||||
comment: "#",
|
||||
endOfLine: [";"],
|
||||
};
|
||||
|
||||
// F#
|
||||
export const FSharp = {
|
||||
stopWords: ["let", "type", "module", "namespace", "open", "if", "then", "else", "match", "with"],
|
||||
stopWords: [
|
||||
"let",
|
||||
"type",
|
||||
"module",
|
||||
"namespace",
|
||||
"open",
|
||||
"if",
|
||||
"then",
|
||||
"else",
|
||||
"match",
|
||||
"with",
|
||||
],
|
||||
comment: "//",
|
||||
endOfLine: [""],
|
||||
endOfLine: [],
|
||||
};
|
||||
|
||||
// R
|
||||
export const R = {
|
||||
stopWords: ["function", "if", "else", "for", "while", "repeat", "library", "require"],
|
||||
stopWords: [
|
||||
"function",
|
||||
"if",
|
||||
"else",
|
||||
"for",
|
||||
"while",
|
||||
"repeat",
|
||||
"library",
|
||||
"require",
|
||||
],
|
||||
comment: "#",
|
||||
endOfLine: [""],
|
||||
endOfLine: [],
|
||||
};
|
||||
|
||||
// Dart
|
||||
|
|
@ -154,7 +194,7 @@ export const LANGUAGES: { [extension: string]: AutocompleteLanguageInfo } = {
|
|||
java: Java,
|
||||
cpp: Cpp,
|
||||
cxx: Cpp,
|
||||
h: Cpp,
|
||||
h: Cpp,
|
||||
hpp: Cpp,
|
||||
cs: CSharp,
|
||||
c: C,
|
||||
|
|
@ -172,11 +212,11 @@ export const LANGUAGES: { [extension: string]: AutocompleteLanguageInfo } = {
|
|||
cljs: Clojure,
|
||||
cljc: Clojure,
|
||||
jl: Julia,
|
||||
fs: FSharp,
|
||||
fsi: FSharp,
|
||||
fsx: FSharp,
|
||||
fs: FSharp,
|
||||
fsi: FSharp,
|
||||
fsx: FSharp,
|
||||
fsscript: FSharp,
|
||||
r: R,
|
||||
R: R,
|
||||
dart: Dart,
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -230,13 +230,18 @@ const EditSlashCommand: SlashCommand = {
|
|||
}
|
||||
|
||||
// Strip unecessary parts of the input (the fact that you have to do this is suboptimal, should be refactored away)
|
||||
input = input.replace(
|
||||
let content = history[history.length - 1].content;
|
||||
if (typeof content !== "string") {
|
||||
content.forEach((part) => {
|
||||
if (part.text && part.text.startsWith("/edit")) {
|
||||
part.text = part.text.replace("/edit", "").trimStart();
|
||||
}
|
||||
})
|
||||
}
|
||||
let userInput = stripImages(content).replace(
|
||||
`\`\`\`${contextItemToEdit.name}\n${contextItemToEdit.content}\n\`\`\`\n`,
|
||||
""
|
||||
);
|
||||
if (input.startsWith("/edit")) {
|
||||
input = input.replace("/edit", "").trimStart();
|
||||
}
|
||||
|
||||
const rif: RangeInFileWithContents =
|
||||
contextItemToRangeInFileWithContents(contextItemToEdit);
|
||||
|
|
@ -248,14 +253,14 @@ const EditSlashCommand: SlashCommand = {
|
|||
rif,
|
||||
fullFileContents,
|
||||
llm,
|
||||
input,
|
||||
userInput,
|
||||
params?.tokenLimit
|
||||
);
|
||||
const [dedentedContents, commonWhitespace] =
|
||||
dedentAndGetCommonWhitespace(contents);
|
||||
contents = dedentedContents;
|
||||
|
||||
let prompt = compilePrompt(filePrefix, contents, fileSuffix, input);
|
||||
let prompt = compilePrompt(filePrefix, contents, fileSuffix, userInput);
|
||||
let fullFileContentsLines = fullFileContents.split("\n");
|
||||
let fullPrefixLines = fullFileContentsLines.slice(
|
||||
0,
|
||||
|
|
@ -428,7 +433,7 @@ const EditSlashCommand: SlashCommand = {
|
|||
}
|
||||
|
||||
let messages = history;
|
||||
messages.push({ role: "user", content: prompt });
|
||||
messages[messages.length - 1] = { role: "user", content: prompt };
|
||||
|
||||
let linesOfPrefixCopied = 0;
|
||||
let lines = [];
|
||||
|
|
@ -447,7 +452,7 @@ const EditSlashCommand: SlashCommand = {
|
|||
messages.slice(0, messages.length - 1),
|
||||
{
|
||||
codeToEdit: rif.contents,
|
||||
userInput: input,
|
||||
userInput,
|
||||
filePrefix: filePrefix,
|
||||
fileSuffix: fileSuffix,
|
||||
systemMessage: llm.systemMessage || "",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import EditSlashCommand from "./edit";
|
|||
import HttpSlashCommand from "./http";
|
||||
import ShareSlashCommand from "./share";
|
||||
import StackOverflowSlashCommand from "./stackOverflow";
|
||||
import VerticalEditSlashCommand from "./verticalEdit";
|
||||
|
||||
export default [
|
||||
DraftIssueCommand,
|
||||
|
|
@ -17,5 +16,4 @@ export default [
|
|||
CommentSlashCommand,
|
||||
HttpSlashCommand,
|
||||
CommitMessageCommand,
|
||||
VerticalEditSlashCommand,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,12 +1,17 @@
|
|||
import { SerializedContinueConfig } from "..";
|
||||
|
||||
const defaultConfig: SerializedContinueConfig = {
|
||||
export const defaultConfig: SerializedContinueConfig = {
|
||||
models: [
|
||||
{
|
||||
title: "GPT-4 Vision (Free Trial)",
|
||||
provider: "free-trial",
|
||||
model: "gpt-4-vision-preview",
|
||||
},
|
||||
{
|
||||
title: "GPT-3.5-Turbo (Free Trial)",
|
||||
provider: "free-trial",
|
||||
model: "gpt-3.5-turbo",
|
||||
},
|
||||
{
|
||||
title: "Gemini Pro (Free Trial)",
|
||||
provider: "free-trial",
|
||||
|
|
@ -29,7 +34,7 @@ const defaultConfig: SerializedContinueConfig = {
|
|||
},
|
||||
{
|
||||
name: "share",
|
||||
description: "Download and share this session",
|
||||
description: "Export this session as markdown",
|
||||
},
|
||||
{
|
||||
name: "cmd",
|
||||
|
|
@ -56,4 +61,55 @@ const defaultConfig: SerializedContinueConfig = {
|
|||
],
|
||||
};
|
||||
|
||||
export default defaultConfig;
|
||||
export const defaultConfigJetBrains: SerializedContinueConfig = {
|
||||
models: [
|
||||
{
|
||||
title: "GPT-4 Vision (Free Trial)",
|
||||
provider: "free-trial",
|
||||
model: "gpt-4-vision-preview",
|
||||
},
|
||||
{
|
||||
title: "GPT-3.5-Turbo (Free Trial)",
|
||||
provider: "free-trial",
|
||||
model: "gpt-3.5-turbo",
|
||||
},
|
||||
{
|
||||
title: "Gemini Pro (Free Trial)",
|
||||
provider: "free-trial",
|
||||
model: "gemini-pro",
|
||||
},
|
||||
{
|
||||
title: "Codellama 70b (Free Trial)",
|
||||
provider: "free-trial",
|
||||
model: "codellama-70b",
|
||||
},
|
||||
],
|
||||
slashCommands: [
|
||||
{
|
||||
name: "edit",
|
||||
description: "Edit selected code",
|
||||
},
|
||||
{
|
||||
name: "comment",
|
||||
description: "Write comments for the selected code",
|
||||
},
|
||||
{
|
||||
name: "share",
|
||||
description: "Export this session as markdown",
|
||||
},
|
||||
],
|
||||
customCommands: [
|
||||
{
|
||||
name: "test",
|
||||
prompt:
|
||||
"Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
|
||||
description: "Write unit tests for highlighted code",
|
||||
},
|
||||
],
|
||||
contextProviders: [
|
||||
{
|
||||
name: "open",
|
||||
params: {},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
|||
200
core/config/handler.ts
Normal file
200
core/config/handler.ts
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
import { http, https } from "follow-redirects";
|
||||
import * as fs from "fs";
|
||||
import { HttpProxyAgent } from "http-proxy-agent";
|
||||
import { HttpsProxyAgent } from "https-proxy-agent";
|
||||
import fetch from "node-fetch";
|
||||
import { ContinueConfig, ContinueRcJson, IDE, ILLM } from "..";
|
||||
import { Telemetry } from "../util/posthog";
|
||||
import {
|
||||
BrowserSerializedContinueConfig,
|
||||
finalToBrowserConfig,
|
||||
loadFullConfigNode,
|
||||
} from "./load";
|
||||
const tls = require("tls");
|
||||
export class ConfigHandler {
|
||||
private savedConfig: ContinueConfig | undefined;
|
||||
private savedBrowserConfig?: BrowserSerializedContinueConfig;
|
||||
|
||||
private readonly ide: IDE;
|
||||
private readonly remoteConfigServerUrl: URL | undefined;
|
||||
private readonly writeLog: (text: string) => void;
|
||||
private readonly onConfigUpdate: () => void;
|
||||
constructor(
|
||||
ide: IDE,
|
||||
remoteConfigServerUrl: URL | undefined,
|
||||
writeLog: (text: string) => void,
|
||||
onConfigUpdate: () => void
|
||||
) {
|
||||
this.ide = ide;
|
||||
this.remoteConfigServerUrl = remoteConfigServerUrl;
|
||||
this.writeLog = writeLog;
|
||||
this.onConfigUpdate = onConfigUpdate;
|
||||
try {
|
||||
this.loadConfig();
|
||||
} catch (e) {
|
||||
console.error("Failed to load config: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
reloadConfig() {
|
||||
this.savedConfig = undefined;
|
||||
this.savedBrowserConfig = undefined;
|
||||
this.loadConfig();
|
||||
this.onConfigUpdate()
|
||||
}
|
||||
|
||||
async getSerializedConfig(): Promise<BrowserSerializedContinueConfig> {
|
||||
if (!this.savedBrowserConfig) {
|
||||
this.savedConfig = await this.loadConfig();
|
||||
this.savedBrowserConfig = finalToBrowserConfig(this.savedConfig);
|
||||
}
|
||||
return this.savedBrowserConfig;
|
||||
}
|
||||
|
||||
async loadConfig(): Promise<ContinueConfig> {
|
||||
try {
|
||||
if (this.savedConfig) {
|
||||
return this.savedConfig;
|
||||
}
|
||||
|
||||
let workspaceConfigs: ContinueRcJson[] = [];
|
||||
try {
|
||||
workspaceConfigs = await this.ide.getWorkspaceConfigs();
|
||||
} catch (e) {
|
||||
console.warn("Failed to load workspace configs");
|
||||
}
|
||||
|
||||
const ideInfo = await this.ide.getIdeInfo();
|
||||
this.savedConfig = await loadFullConfigNode(
|
||||
this.ide.readFile,
|
||||
workspaceConfigs,
|
||||
this.remoteConfigServerUrl,
|
||||
ideInfo.ideType
|
||||
);
|
||||
this.savedConfig.allowAnonymousTelemetry =
|
||||
this.savedConfig.allowAnonymousTelemetry &&
|
||||
(await this.ide.isTelemetryEnabled());
|
||||
|
||||
// Setup telemetry only after (and if) we know it is enabled
|
||||
await Telemetry.setup(
|
||||
this.savedConfig.allowAnonymousTelemetry ?? true,
|
||||
await this.ide.getUniqueId()
|
||||
);
|
||||
|
||||
return this.savedConfig;
|
||||
} catch (e: any) {
|
||||
console.error("Failed to loadConfig: ", e.message);
|
||||
throw new Error("Failed to loadConfig: " + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
setupLlm(llm: ILLM): ILLM {
|
||||
const TIMEOUT = 7200; // 7200 seconds = 2 hours
|
||||
// Since we know this is happening in Node.js, we can add requestOptions through a custom agent
|
||||
const ca = [...tls.rootCertificates];
|
||||
const customCerts =
|
||||
typeof llm.requestOptions?.caBundlePath === "string"
|
||||
? [llm.requestOptions?.caBundlePath]
|
||||
: llm.requestOptions?.caBundlePath;
|
||||
if (customCerts) {
|
||||
ca.push(
|
||||
...customCerts.map((customCert) => fs.readFileSync(customCert, "utf8"))
|
||||
);
|
||||
}
|
||||
|
||||
let timeout = (llm.requestOptions?.timeout || TIMEOUT) * 1000; // measured in ms
|
||||
|
||||
const agentOptions = {
|
||||
ca,
|
||||
rejectUnauthorized: llm.requestOptions?.verifySsl,
|
||||
timeout,
|
||||
sessionTimeout: timeout,
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: timeout,
|
||||
};
|
||||
|
||||
const proxy = llm.requestOptions?.proxy;
|
||||
|
||||
llm._fetch = async (input, init) => {
|
||||
// Create agent
|
||||
const protocol = new URL(input).protocol === "https:" ? https : http;
|
||||
const agent = proxy
|
||||
? new URL(input).protocol === "https:"
|
||||
? new HttpsProxyAgent(proxy, agentOptions)
|
||||
: new HttpProxyAgent(proxy, agentOptions)
|
||||
: new protocol.Agent(agentOptions);
|
||||
|
||||
const headers: { [key: string]: string } =
|
||||
llm!.requestOptions?.headers || {};
|
||||
for (const [key, value] of Object.entries(init?.headers || {})) {
|
||||
headers[key] = value as string;
|
||||
}
|
||||
|
||||
// Replace localhost with 127.0.0.1
|
||||
input = new URL(input);
|
||||
if (input.hostname === "localhost") {
|
||||
input.hostname = "127.0.0.1";
|
||||
}
|
||||
|
||||
let updatedBody: string | undefined = undefined;
|
||||
try {
|
||||
if (
|
||||
llm.requestOptions?.extraBodyProperties &&
|
||||
typeof init.body === "string"
|
||||
) {
|
||||
const parsedBody = JSON.parse(init.body);
|
||||
updatedBody = JSON.stringify({
|
||||
...parsedBody,
|
||||
...llm.requestOptions.extraBodyProperties,
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Unable to parse HTTP request body: ", e);
|
||||
}
|
||||
|
||||
const resp = await fetch(input, {
|
||||
...init,
|
||||
body: updatedBody ?? init.body,
|
||||
headers,
|
||||
agent,
|
||||
});
|
||||
|
||||
if (!resp.ok) {
|
||||
let text = await resp.text();
|
||||
if (resp.status === 404 && !resp.url.includes("/v1")) {
|
||||
if (text.includes("try pulling it first")) {
|
||||
const model = JSON.parse(text).error.split(" ")[1].slice(1, -1);
|
||||
text = `The model "${model}" was not found. To download it, run \`ollama run ${model}\`.`;
|
||||
} else if (text.includes("/api/chat")) {
|
||||
text =
|
||||
"The /api/chat endpoint was not found. This may mean that you are using an older version of Ollama that does not support /api/chat. Upgrading to the latest version will solve the issue.";
|
||||
} else {
|
||||
text =
|
||||
"This may mean that you forgot to add '/v1' to the end of your 'apiBase' in config.json.";
|
||||
}
|
||||
}
|
||||
throw new Error(
|
||||
`HTTP ${resp.status} ${resp.statusText} from ${resp.url}\n\n${text}`
|
||||
);
|
||||
}
|
||||
|
||||
return resp;
|
||||
};
|
||||
|
||||
llm.writeLog = async (log: string) => {
|
||||
this.writeLog(log);
|
||||
};
|
||||
return llm;
|
||||
}
|
||||
|
||||
async llmFromTitle(title?: string): Promise<ILLM> {
|
||||
const config = await this.loadConfig();
|
||||
const model =
|
||||
config.models.find((m) => m.title === title) || config.models[0];
|
||||
if (!model) {
|
||||
throw new Error("No model found");
|
||||
}
|
||||
|
||||
return this.setupLlm(model);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
import * as fs from "fs";
|
||||
import path from "path";
|
||||
import {
|
||||
BrowserSerializedContinueConfig,
|
||||
Config,
|
||||
|
|
@ -9,11 +10,11 @@ import {
|
|||
CustomLLM,
|
||||
EmbeddingsProviderDescription,
|
||||
IContextProvider,
|
||||
IdeType,
|
||||
ModelDescription,
|
||||
SerializedContinueConfig,
|
||||
SlashCommand,
|
||||
} from "..";
|
||||
|
||||
import {
|
||||
slashCommandFromDescription,
|
||||
slashFromCustomCommand,
|
||||
|
|
@ -33,31 +34,49 @@ import {
|
|||
getConfigJsonPath,
|
||||
getConfigJsonPathForRemote,
|
||||
getConfigTsPath,
|
||||
getContinueDotEnv,
|
||||
migrate,
|
||||
} from "../util/paths";
|
||||
const { execSync } = require("child_process");
|
||||
|
||||
function resolveSerializedConfig(filepath: string): SerializedContinueConfig {
|
||||
let content = fs.readFileSync(filepath, "utf8");
|
||||
let config = JSON.parse(content) as SerializedContinueConfig;
|
||||
if (config.env && Array.isArray(config.env)) {
|
||||
const env = {
|
||||
...process.env,
|
||||
...getContinueDotEnv(),
|
||||
};
|
||||
|
||||
config.env.forEach((envVar) => {
|
||||
content = content.replaceAll(
|
||||
new RegExp(`"${envVar}"`, "g"),
|
||||
`"${env[envVar]}"`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
return JSON.parse(content);
|
||||
}
|
||||
|
||||
const configMergeKeys = {
|
||||
"models": (a: any, b: any) => a.title === b.title,
|
||||
"contextProviders": (a: any, b: any) => a.name === b.name,
|
||||
"slashCommands": (a: any, b: any) => a.name === b.name,
|
||||
"customCommands": (a: any, b: any) => a.name === b.name,
|
||||
}
|
||||
|
||||
function loadSerializedConfig(
|
||||
workspaceConfigs: ContinueRcJson[],
|
||||
remoteConfigServerUrl: URL | undefined
|
||||
remoteConfigServerUrl: URL | undefined,
|
||||
ideType: IdeType
|
||||
): SerializedContinueConfig {
|
||||
const configPath = getConfigJsonPath();
|
||||
let contents = fs.readFileSync(configPath, "utf8");
|
||||
let config = JSON.parse(contents) as SerializedContinueConfig;
|
||||
const configPath = getConfigJsonPath(ideType);
|
||||
let config = resolveSerializedConfig(configPath);
|
||||
if (config.allowAnonymousTelemetry === undefined) {
|
||||
config.allowAnonymousTelemetry = true;
|
||||
}
|
||||
|
||||
// Migrate to camelCase - replace all instances of "snake_case" with "camelCase"
|
||||
migrate("camelCaseConfig", () => {
|
||||
contents = contents
|
||||
.replace(/(_\w)/g, function (m) {
|
||||
return m[1].toUpperCase();
|
||||
})
|
||||
.replace("openai-aiohttp", "openai");
|
||||
|
||||
fs.writeFileSync(configPath, contents, "utf8");
|
||||
});
|
||||
|
||||
migrate("codebaseContextProvider", () => {
|
||||
if (
|
||||
!config.contextProviders?.filter((cp) => cp.name === "codebase")?.length
|
||||
|
|
@ -112,21 +131,15 @@ function loadSerializedConfig(
|
|||
fs.writeFileSync(configPath, JSON.stringify(config, undefined, 2), "utf8");
|
||||
});
|
||||
|
||||
migrate("renameFreeTrialProvider", () => {
|
||||
contents = contents.replace(/openai-free-trial/g, "free-trial");
|
||||
fs.writeFileSync(configPath, contents, "utf8");
|
||||
});
|
||||
|
||||
if (remoteConfigServerUrl) {
|
||||
const remoteConfigJson = fs.readFileSync(
|
||||
getConfigJsonPathForRemote(remoteConfigServerUrl),
|
||||
"utf-8"
|
||||
const remoteConfigJson = resolveSerializedConfig(
|
||||
getConfigJsonPathForRemote(remoteConfigServerUrl)
|
||||
);
|
||||
config = mergeJson(config, JSON.parse(remoteConfigJson), "merge");
|
||||
config = mergeJson(config, remoteConfigJson, "merge", configMergeKeys);
|
||||
}
|
||||
|
||||
for (const workspaceConfig of workspaceConfigs) {
|
||||
config = mergeJson(config, workspaceConfig, workspaceConfig.mergeBehavior);
|
||||
config = mergeJson(config, workspaceConfig, workspaceConfig.mergeBehavior, configMergeKeys);
|
||||
}
|
||||
|
||||
return config;
|
||||
|
|
@ -317,53 +330,101 @@ function finalToBrowserConfig(
|
|||
};
|
||||
}
|
||||
|
||||
async function buildConfigTs(browser: boolean) {
|
||||
function getTarget() {
|
||||
const os =
|
||||
{
|
||||
aix: "linux",
|
||||
darwin: "darwin",
|
||||
freebsd: "linux",
|
||||
linux: "linux",
|
||||
openbsd: "linux",
|
||||
sunos: "linux",
|
||||
win32: "win32",
|
||||
}[process.platform as string] ?? "linux";
|
||||
const arch = {
|
||||
arm: "arm64",
|
||||
arm64: "arm64",
|
||||
ia32: "x64",
|
||||
loong64: "arm64",
|
||||
mips: "arm64",
|
||||
mipsel: "arm64",
|
||||
ppc: "x64",
|
||||
ppc64: "x64",
|
||||
riscv64: "arm64",
|
||||
s390: "x64",
|
||||
s390x: "x64",
|
||||
x64: "x64",
|
||||
}[process.arch];
|
||||
|
||||
return `${os}-${arch}`;
|
||||
}
|
||||
|
||||
function escapeSpacesInPath(p: string): string {
|
||||
return p.replace(/ /g, "\\ ");
|
||||
}
|
||||
|
||||
async function buildConfigTs() {
|
||||
if (!fs.existsSync(getConfigTsPath())) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
try {
|
||||
// Dynamic import esbuild so potentially disastrous errors can be caught
|
||||
const esbuild = require("esbuild");
|
||||
if (process.env.IS_BINARY === "true") {
|
||||
execSync(
|
||||
escapeSpacesInPath(path.dirname(process.execPath)) +
|
||||
`/esbuild${
|
||||
getTarget().startsWith("win32") ? ".exe" : ""
|
||||
} ${escapeSpacesInPath(
|
||||
getConfigTsPath()
|
||||
)} --bundle --outfile=${escapeSpacesInPath(
|
||||
getConfigJsPath()
|
||||
)} --platform=node --format=cjs --sourcemap --external:fetch --external:fs --external:path --external:os --external:child_process`
|
||||
);
|
||||
} else {
|
||||
// Dynamic import esbuild so potentially disastrous errors can be caught
|
||||
const esbuild = require("esbuild");
|
||||
|
||||
await esbuild.build({
|
||||
entryPoints: [getConfigTsPath()],
|
||||
bundle: true,
|
||||
platform: browser ? "browser" : "node",
|
||||
format: browser ? "esm" : "cjs",
|
||||
outfile: getConfigJsPath(!browser),
|
||||
external: ["fetch", "fs", "path", "os", "child_process"],
|
||||
sourcemap: true,
|
||||
});
|
||||
await esbuild.build({
|
||||
entryPoints: [getConfigTsPath()],
|
||||
bundle: true,
|
||||
platform: "node",
|
||||
format: "cjs",
|
||||
outfile: getConfigJsPath(),
|
||||
external: ["fetch", "fs", "path", "os", "child_process"],
|
||||
sourcemap: true,
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
throw new Error(
|
||||
console.log(
|
||||
"Build error. Please check your ~/.continue/config.ts file: " + e
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (!fs.existsSync(getConfigJsPath(!browser))) {
|
||||
if (!fs.existsSync(getConfigJsPath())) {
|
||||
return undefined;
|
||||
}
|
||||
return fs.readFileSync(getConfigJsPath(!browser), "utf8");
|
||||
return fs.readFileSync(getConfigJsPath(), "utf8");
|
||||
}
|
||||
|
||||
async function loadFullConfigNode(
|
||||
readFile: (filepath: string) => Promise<string>,
|
||||
workspaceConfigs: ContinueRcJson[],
|
||||
remoteConfigServerUrl: URL | undefined
|
||||
remoteConfigServerUrl: URL | undefined,
|
||||
ideType: IdeType
|
||||
): Promise<ContinueConfig> {
|
||||
let serialized = loadSerializedConfig(
|
||||
workspaceConfigs,
|
||||
remoteConfigServerUrl
|
||||
remoteConfigServerUrl,
|
||||
ideType
|
||||
);
|
||||
let intermediate = serializedToIntermediateConfig(serialized);
|
||||
|
||||
const configJsContents = await buildConfigTs(false);
|
||||
const configJsContents = await buildConfigTs();
|
||||
if (configJsContents) {
|
||||
try {
|
||||
// Try config.ts first
|
||||
const configJsPath = getConfigJsPath(true);
|
||||
const configJsPath = getConfigJsPath();
|
||||
const module = await require(configJsPath);
|
||||
delete require.cache[require.resolve(configJsPath)];
|
||||
if (!module.modifyConfig) {
|
||||
|
|
@ -401,5 +462,5 @@ export {
|
|||
intermediateToFinalConfig,
|
||||
loadFullConfigNode,
|
||||
serializedToIntermediateConfig,
|
||||
type BrowserSerializedContinueConfig,
|
||||
type BrowserSerializedContinueConfig
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,7 +15,11 @@ declare global {
|
|||
};
|
||||
colorThemeName?: string;
|
||||
workspacePaths?: string[];
|
||||
postIntellijMessage?: (type: string, data: any) => void;
|
||||
postIntellijMessage?: (
|
||||
messageType: string,
|
||||
data: any,
|
||||
messageIde: string
|
||||
) => void;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -313,13 +317,24 @@ declare global {
|
|||
message: string;
|
||||
}
|
||||
|
||||
export type IdeType = "vscode" | "jetbrains";
|
||||
export interface IdeInfo {
|
||||
ideType: IdeType;
|
||||
name: string;
|
||||
version: string;
|
||||
remoteName: string;
|
||||
}
|
||||
|
||||
export interface IDE {
|
||||
getSerializedConfig(): Promise<BrowserSerializedContinueConfig>;
|
||||
getIdeInfo(): Promise<IdeInfo>;
|
||||
getDiff(): Promise<string>;
|
||||
isTelemetryEnabled(): Promise<boolean>;
|
||||
getUniqueId(): Promise<string>;
|
||||
getTerminalContents(): Promise<string>;
|
||||
listWorkspaceContents(directory?: string): Promise<string[]>;
|
||||
listFolders(): Promise<string[]>;
|
||||
getWorkspaceDirs(): Promise<string[]>;
|
||||
getWorkspaceConfigs(): Promise<ContinueRcJson[]>;
|
||||
writeFile(path: string, contents: string): Promise<void>;
|
||||
showVirtualFile(title: string, contents: string): Promise<void>;
|
||||
getContinueDir(): Promise<string>;
|
||||
|
|
@ -327,6 +342,7 @@ declare global {
|
|||
runCommand(command: string): Promise<void>;
|
||||
saveFile(filepath: string): Promise<void>;
|
||||
readFile(filepath: string): Promise<string>;
|
||||
readRangeInFile(filepath: string, range: Range): Promise<string>;
|
||||
showLines(
|
||||
filepath: string,
|
||||
startLine: number,
|
||||
|
|
@ -337,34 +353,13 @@ declare global {
|
|||
newContents: string,
|
||||
stepIndex: number
|
||||
): Promise<void>;
|
||||
verticalDiffUpdate(
|
||||
filepath: string,
|
||||
startLine: number,
|
||||
endLine: number,
|
||||
diffLine: DiffLine
|
||||
): Promise<void>;
|
||||
getOpenFiles(): Promise<string[]>;
|
||||
getPinnedFiles(): Promise<string[]>;
|
||||
getSearchResults(query: string): Promise<string>;
|
||||
subprocess(command: string): Promise<[string, string]>;
|
||||
getProblems(filepath?: string | undefined): Promise<Problem[]>;
|
||||
getBranch(dir: string): Promise<string>;
|
||||
|
||||
// Embeddings
|
||||
/**
|
||||
* Returns list of [tag, filepath, hash of contents] that need to be embedded
|
||||
*/
|
||||
getFilesToEmbed(providerId: string): Promise<[string, string, string][]>;
|
||||
sendEmbeddingForChunk(
|
||||
chunk: Chunk,
|
||||
embedding: number[],
|
||||
tags: string[]
|
||||
): void;
|
||||
retrieveChunks(
|
||||
text: string,
|
||||
n: number,
|
||||
directory: string | undefined
|
||||
): Promise<Chunk[]>;
|
||||
getStats(directory: string): Promise<{ [path: string]: number }>;
|
||||
}
|
||||
|
||||
// Slash Commands
|
||||
|
|
@ -377,6 +372,8 @@ declare global {
|
|||
input: string;
|
||||
params?: { [key: string]: any } | undefined;
|
||||
contextItems: ContextItemWithId[];
|
||||
selectedCode: RangeInFile[];
|
||||
config: ContinueConfig;
|
||||
}
|
||||
|
||||
export interface SlashCommand {
|
||||
|
|
|
|||
38
core/config/util.ts
Normal file
38
core/config/util.ts
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { readFileSync, writeFileSync } from "fs";
|
||||
import { ModelDescription } from "..";
|
||||
import { editConfigJson, getConfigJsonPath } from "../util/paths";
|
||||
|
||||
export function addModel(model: ModelDescription) {
|
||||
const config = readFileSync(getConfigJsonPath(), "utf8");
|
||||
const configJson = JSON.parse(config);
|
||||
configJson.models.push(model);
|
||||
const newConfigString = JSON.stringify(
|
||||
configJson,
|
||||
(key, value) => {
|
||||
return value === null ? undefined : value;
|
||||
},
|
||||
2
|
||||
);
|
||||
writeFileSync(getConfigJsonPath(), newConfigString);
|
||||
return newConfigString;
|
||||
}
|
||||
|
||||
export function addOpenAIKey(key: string) {
|
||||
editConfigJson((config) => {
|
||||
config.models = config.models.map((m: ModelDescription) => {
|
||||
if (m.provider === "free-trial") {
|
||||
m.apiKey = key;
|
||||
m.provider = "openai";
|
||||
}
|
||||
return m;
|
||||
});
|
||||
return config;
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteModel(title: string) {
|
||||
editConfigJson((config) => {
|
||||
config.models = config.models.filter((m: any) => m.title !== title);
|
||||
return config;
|
||||
});
|
||||
}
|
||||
112
core/context/providers/DatabaseContextProvider.ts
Normal file
112
core/context/providers/DatabaseContextProvider.ts
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
import { BaseContextProvider } from "..";
|
||||
import {
|
||||
ContextItem,
|
||||
ContextProviderDescription,
|
||||
ContextProviderExtras,
|
||||
LoadSubmenuItemsArgs,
|
||||
ContextSubmenuItem,
|
||||
} from "../..";
|
||||
|
||||
class DatabaseContextProvider extends BaseContextProvider {
|
||||
static description: ContextProviderDescription = {
|
||||
title: "database",
|
||||
displayTitle: "Database",
|
||||
description: "Table schemas",
|
||||
type: "submenu",
|
||||
};
|
||||
|
||||
async getContextItems(
|
||||
query: string,
|
||||
extras: ContextProviderExtras
|
||||
): Promise<ContextItem[]> {
|
||||
const contextItems: ContextItem[] = [];
|
||||
|
||||
const connections = this.options?.connections;
|
||||
|
||||
if (connections === null) { return contextItems; }
|
||||
|
||||
let [connectionName, table] = query.split('.');
|
||||
|
||||
const getDatabaseAdapter = await require("dbinfoz");
|
||||
|
||||
for (const connection of connections) {
|
||||
if(connection.name == connectionName) {
|
||||
const adapter = getDatabaseAdapter(connection.connection_type, connection.connection);
|
||||
const tablesAndSchemas = await adapter.getAllTablesAndSchemas(connection.connection.database);
|
||||
|
||||
if(table === 'all') {
|
||||
let prompt = `Schema for all tables on ${connection.connection_type} is `;
|
||||
prompt += JSON.stringify(tablesAndSchemas);
|
||||
|
||||
let contextItem = {
|
||||
name: `${connectionName}-all-tables-schemas`,
|
||||
description: `Schema for all tables.`,
|
||||
content: prompt
|
||||
}
|
||||
|
||||
contextItems.push(contextItem);
|
||||
} else {
|
||||
const tables = Object.keys(tablesAndSchemas);
|
||||
|
||||
tables.forEach(tableName => {
|
||||
if(table === tableName) {
|
||||
let prompt = `Schema for ${tableName} on ${connection.connection_type} is `;
|
||||
prompt += JSON.stringify(tablesAndSchemas[tableName]);
|
||||
|
||||
let contextItem = {
|
||||
name: `${connectionName}-${tableName}-schema`,
|
||||
description: `${tableName} Schema`,
|
||||
content: prompt
|
||||
}
|
||||
|
||||
contextItems.push(contextItem);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return contextItems;
|
||||
}
|
||||
|
||||
async loadSubmenuItems(
|
||||
args: LoadSubmenuItemsArgs
|
||||
): Promise<ContextSubmenuItem[]> {
|
||||
const contextItems: ContextSubmenuItem[] = [];
|
||||
const connections = this.options?.connections;
|
||||
|
||||
if (connections === null) { return contextItems; }
|
||||
|
||||
const getDatabaseAdapter = await require("dbinfoz");
|
||||
|
||||
for (const connection of connections) {
|
||||
let adapter = getDatabaseAdapter(connection.connection_type, connection.connection);
|
||||
const tablesAndSchemas = await adapter.getAllTablesAndSchemas(connection.connection.database);
|
||||
const tables = Object.keys(tablesAndSchemas);
|
||||
|
||||
let contextItem = {
|
||||
id: `${connection.name}.all`,
|
||||
title: `${connection.name} all table schemas`,
|
||||
description: ``
|
||||
}
|
||||
|
||||
contextItems.push(contextItem);
|
||||
|
||||
tables.forEach(tableName => {
|
||||
let contextItem = {
|
||||
id: `${connection.name}.${tableName}`,
|
||||
title: `${connection.name}.${tableName} schema`,
|
||||
description: ``
|
||||
}
|
||||
|
||||
contextItems.push(contextItem);
|
||||
});
|
||||
}
|
||||
|
||||
return contextItems;
|
||||
}
|
||||
}
|
||||
|
||||
export default DatabaseContextProvider;
|
||||
|
||||
146
core/context/providers/PostgresContextProvider.ts
Normal file
146
core/context/providers/PostgresContextProvider.ts
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
import { BaseContextProvider } from "..";
|
||||
import {
|
||||
ContextItem,
|
||||
ContextProviderDescription,
|
||||
ContextProviderExtras,
|
||||
LoadSubmenuItemsArgs,
|
||||
ContextSubmenuItem,
|
||||
} from "../..";
|
||||
|
||||
class PostgresContextProvider extends BaseContextProvider {
|
||||
static description: ContextProviderDescription = {
|
||||
title: "postgres",
|
||||
displayTitle: "PostgreSQL",
|
||||
description: "Retrieve PostgreSQL table schema and sample rows",
|
||||
type: "submenu",
|
||||
};
|
||||
|
||||
static ALL_TABLES = "__all_tables";
|
||||
static DEFAULT_SAMPLE_ROWS = 3;
|
||||
|
||||
constructor(options: {
|
||||
host: string;
|
||||
port: number;
|
||||
user: string;
|
||||
password: string;
|
||||
database: string;
|
||||
schema?: string;
|
||||
sampleRows?: number;
|
||||
}) {
|
||||
super(options);
|
||||
}
|
||||
|
||||
private async getPool() {
|
||||
const pg = await require("pg");
|
||||
return new pg.Pool({
|
||||
host: this.options.host,
|
||||
port: this.options.port,
|
||||
user: this.options.user,
|
||||
password: this.options.password,
|
||||
database: this.options.database,
|
||||
});
|
||||
}
|
||||
|
||||
private async getTableNames(pool: any): Promise<string[]> {
|
||||
const schema = this.options.schema ?? "public";
|
||||
var tablesInfoQuery = `
|
||||
SELECT table_schema, table_name
|
||||
FROM information_schema.tables`;
|
||||
if (schema != null) {
|
||||
tablesInfoQuery += ` WHERE table_schema = '${schema}'`;
|
||||
}
|
||||
const { rows: tablesInfo } = await pool.query(tablesInfoQuery);
|
||||
return tablesInfo.map(
|
||||
(tableInfo: any) => `${tableInfo.table_schema}.${tableInfo.table_name}`
|
||||
);
|
||||
}
|
||||
|
||||
async getContextItems(
|
||||
query: string = "",
|
||||
_: ContextProviderExtras = {} as ContextProviderExtras
|
||||
): Promise<ContextItem[]> {
|
||||
const pool = await this.getPool();
|
||||
|
||||
try {
|
||||
const contextItems: ContextItem[] = [];
|
||||
|
||||
const tableNames = [];
|
||||
if (query === PostgresContextProvider.ALL_TABLES) {
|
||||
tableNames.push(...(await this.getTableNames(pool)));
|
||||
} else {
|
||||
tableNames.push(query);
|
||||
}
|
||||
|
||||
for (const tableName of tableNames) {
|
||||
// Get the table schema
|
||||
if (!tableName.includes(".")) {
|
||||
throw new Error(
|
||||
`Table name must be in format schema.table_name, got ${tableName}`
|
||||
);
|
||||
}
|
||||
var schemaQuery = `
|
||||
SELECT column_name, data_type, character_maximum_length
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_schema = '${tableName.split(".")[0]}'
|
||||
AND table_name = '${tableName.split(".")[1]}'`;
|
||||
console.log("schemaQuery", schemaQuery);
|
||||
const { rows: tableSchema } = await pool.query(schemaQuery);
|
||||
|
||||
// Get the sample rows
|
||||
const sampleRows =
|
||||
this.options.sampleRows ??
|
||||
PostgresContextProvider.DEFAULT_SAMPLE_ROWS;
|
||||
const { rows: sampleRowResults } = await pool.query(`
|
||||
SELECT *
|
||||
FROM ${tableName}
|
||||
LIMIT ${sampleRows}`);
|
||||
|
||||
// Create prompt from the table schema and sample rows
|
||||
var prompt = `Postgres schema for database ${this.options.database} table ${tableName}:\n`;
|
||||
prompt += `${JSON.stringify(tableSchema, null, 2)}\n\n`;
|
||||
prompt += `Sample rows: ${JSON.stringify(sampleRowResults, null, 2)}`;
|
||||
|
||||
contextItems.push({
|
||||
name: `${this.options.database}-${tableName}-schema-and-sample-rows`,
|
||||
description: `Schema and sample rows for table ${tableName}`,
|
||||
content: prompt,
|
||||
});
|
||||
}
|
||||
|
||||
return contextItems;
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to query PostgreSQL database: ${error}`);
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
async loadSubmenuItems(
|
||||
_: LoadSubmenuItemsArgs
|
||||
): Promise<ContextSubmenuItem[]> {
|
||||
const pool = await this.getPool();
|
||||
|
||||
try {
|
||||
const contextItems: ContextSubmenuItem[] = [];
|
||||
const tableNames = await this.getTableNames(pool);
|
||||
|
||||
for (const tableName of tableNames) {
|
||||
contextItems.push({
|
||||
id: tableName,
|
||||
title: tableName,
|
||||
description: `Schema from ${tableName} and ${this.options.sampleRows} sample rows.`,
|
||||
});
|
||||
}
|
||||
contextItems.push({
|
||||
id: PostgresContextProvider.ALL_TABLES,
|
||||
title: "All tables",
|
||||
description: `Schema from all tables and ${this.options.sampleRows} sample rows each.`,
|
||||
});
|
||||
|
||||
return contextItems;
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to query PostgreSQL database: ${error}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default PostgresContextProvider;
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
import { BaseContextProvider } from "..";
|
||||
import { ContextProviderName } from "../..";
|
||||
import CodebaseContextProvider from "./CodebaseContextProvider";
|
||||
import CodeHighlightsContextProvider from "./CodeHighlightsContextProvider";
|
||||
import CodeOutlineContextProvider from "./CodeOutlineContextProvider";
|
||||
import CodebaseContextProvider from "./CodebaseContextProvider";
|
||||
import DatabaseContextProvider from "./DatabaseContextProvider";
|
||||
import DiffContextProvider from "./DiffContextProvider";
|
||||
import DocsContextProvider from "./DocsContextProvider";
|
||||
import FileTreeContextProvider from "./FileTreeContextProvider";
|
||||
|
|
@ -10,12 +11,13 @@ import FolderContextProvider from "./FolderContextProvider";
|
|||
import GitHubIssuesContextProvider from "./GitHubIssuesContextProvider";
|
||||
import GoogleContextProvider from "./GoogleContextProvider";
|
||||
import HttpContextProvider from "./HttpContextProvider";
|
||||
import JiraIssuesContextProvider from "./JiraIssuesContextProvider";
|
||||
import OpenFilesContextProvider from "./OpenFilesContextProvider";
|
||||
import PostgresContextProvider from "./PostgresContextProvider";
|
||||
import ProblemsContextProvider from "./ProblemsContextProvider";
|
||||
import SearchContextProvider from "./SearchContextProvider";
|
||||
import TerminalContextProvider from "./TerminalContextProvider";
|
||||
import URLContextProvider from "./URLContextProvider";
|
||||
import JiraIssuesContextProvider from "./JiraIssuesContextProvider";
|
||||
|
||||
const Providers: (typeof BaseContextProvider)[] = [
|
||||
DiffContextProvider,
|
||||
|
|
@ -34,6 +36,8 @@ const Providers: (typeof BaseContextProvider)[] = [
|
|||
CodeHighlightsContextProvider,
|
||||
CodeOutlineContextProvider,
|
||||
JiraIssuesContextProvider,
|
||||
PostgresContextProvider,
|
||||
DatabaseContextProvider,
|
||||
];
|
||||
|
||||
export function contextProviderClassFromName(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { Chunk, ContextItem, ContextProviderExtras, ILLM } from "..";
|
||||
import { FullTextSearchCodebaseIndex } from "../indexing/FullTextSearch";
|
||||
import { LanceDbIndex } from "../indexing/LanceDbIndex";
|
||||
import { ChunkCodebaseIndex } from "../indexing/chunk/ChunkCodebaseIndex";
|
||||
import { IndexTag } from "../indexing/types";
|
||||
import { llmCanGenerateInParallel } from "../llm/autodetect";
|
||||
|
|
@ -147,7 +148,11 @@ export async function retrieveContextItemsFromEmbeddings(
|
|||
console.warn("Error retrieving from FTS:", e);
|
||||
}
|
||||
|
||||
let vecResults = await extras.ide.retrieveChunks(
|
||||
const lanceDbIndex = new LanceDbIndex(extras.embeddingsProvider, (path) =>
|
||||
extras.ide.readFile(path)
|
||||
);
|
||||
let vecResults = await lanceDbIndex.retrieve(
|
||||
tags,
|
||||
extras.fullInput,
|
||||
nRetrieve,
|
||||
filterDirectory
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export async function* streamDiff(
|
|||
oldLines: string[],
|
||||
newLines: LineStream
|
||||
): AsyncGenerator<DiffLine> {
|
||||
oldLines = [...oldLines]; // be careful
|
||||
const mutatedOldLines = [...oldLines]; // be careful
|
||||
let seenIndentationMistake = false;
|
||||
|
||||
let newLineResult = await newLines.next();
|
||||
|
|
|
|||
|
|
@ -1,131 +0,0 @@
|
|||
import { Chunk, DiffLine, Problem } from "..";
|
||||
import { BrowserSerializedContinueConfig } from "../config/load";
|
||||
import { IDE } from "../index";
|
||||
|
||||
import { ideRequest } from "./messaging";
|
||||
async function r(messageType: string, options: any = {}) {
|
||||
return await ideRequest(messageType, options);
|
||||
}
|
||||
export class ExtensionIde implements IDE {
|
||||
async getSerializedConfig(): Promise<BrowserSerializedContinueConfig> {
|
||||
return await r("getSerializedConfig");
|
||||
}
|
||||
|
||||
async getDiff() {
|
||||
return await r("getDiff");
|
||||
}
|
||||
|
||||
async getTerminalContents() {
|
||||
return await r("getTerminalContents");
|
||||
}
|
||||
|
||||
async listWorkspaceContents(directory?: string): Promise<string[]> {
|
||||
return await r("listWorkspaceContents");
|
||||
}
|
||||
|
||||
async getWorkspaceDirs(): Promise<string[]> {
|
||||
return await r("getWorkspaceDirs");
|
||||
}
|
||||
|
||||
async showLines(
|
||||
filepath: string,
|
||||
startLine: number,
|
||||
endLine: number
|
||||
): Promise<void> {
|
||||
return await r("showLines", { filepath, startLine, endLine });
|
||||
}
|
||||
|
||||
async listFolders(): Promise<string[]> {
|
||||
return await r("listFolders");
|
||||
}
|
||||
|
||||
_continueDir: string | null = null;
|
||||
|
||||
async getContinueDir(): Promise<string> {
|
||||
if (this._continueDir) {
|
||||
return this._continueDir;
|
||||
}
|
||||
const dir = await r("getContinueDir");
|
||||
this._continueDir = dir;
|
||||
return dir;
|
||||
}
|
||||
|
||||
async writeFile(path: string, contents: string): Promise<void> {
|
||||
await r("writeFile", { path, contents });
|
||||
}
|
||||
|
||||
async showVirtualFile(title: string, contents: string): Promise<void> {
|
||||
await r("showVirtualFile", { name: title, content: contents });
|
||||
}
|
||||
|
||||
async openFile(path: string): Promise<void> {
|
||||
await r("openFile", { path });
|
||||
}
|
||||
|
||||
async runCommand(command: string): Promise<void> {
|
||||
await r("runCommand", { command });
|
||||
}
|
||||
|
||||
async saveFile(filepath: string): Promise<void> {
|
||||
await r("saveFile", { filepath });
|
||||
}
|
||||
async readFile(filepath: string): Promise<string> {
|
||||
return await r("readFile", { filepath });
|
||||
}
|
||||
async showDiff(
|
||||
filepath: string,
|
||||
newContents: string,
|
||||
stepIndex: number
|
||||
): Promise<void> {
|
||||
await r("showDiff", { filepath, newContents, stepIndex });
|
||||
}
|
||||
|
||||
async verticalDiffUpdate(
|
||||
filepath: string,
|
||||
startLine: number,
|
||||
endLine: number,
|
||||
diffLine: DiffLine
|
||||
) {
|
||||
await r("diffLine", { filepath, startLine, endLine, diffLine });
|
||||
}
|
||||
|
||||
getOpenFiles(): Promise<string[]> {
|
||||
return r("getOpenFiles");
|
||||
}
|
||||
|
||||
getPinnedFiles(): Promise<string[]> {
|
||||
return r("getPinnedFiles");
|
||||
}
|
||||
|
||||
getSearchResults(query: string): Promise<string> {
|
||||
return r("getSearchResults", { query });
|
||||
}
|
||||
|
||||
getProblems(filepath?: string | undefined): Promise<Problem[]> {
|
||||
return r("getProblems", { filepath });
|
||||
}
|
||||
|
||||
subprocess(command: string): Promise<[string, string]> {
|
||||
return r("subprocess", { command });
|
||||
}
|
||||
|
||||
getFilesToEmbed(providerId: string): Promise<[string, string, string][]> {
|
||||
return r("getFilesToEmbed", { providerId });
|
||||
}
|
||||
|
||||
sendEmbeddingForChunk(chunk: Chunk, embedding: number[], tags: string[]) {
|
||||
return r("sendChunkForFile", { chunk, embedding, tags });
|
||||
}
|
||||
|
||||
async getBranch(dir: string): Promise<string> {
|
||||
return r("getBranch", { dir });
|
||||
}
|
||||
|
||||
retrieveChunks(
|
||||
text: string,
|
||||
n: number,
|
||||
directory: string | undefined
|
||||
): Promise<Chunk[]> {
|
||||
return r("retrieveChunks", { text, n, directory });
|
||||
}
|
||||
}
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
// import "vscode-webview";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { ChatMessage, LLMFullCompletionOptions, LLMReturnValue } from "..";
|
||||
interface vscode {
|
||||
postMessage(message: any): vscode;
|
||||
}
|
||||
|
||||
declare const vscode: any;
|
||||
|
||||
function _postToIde(type: string, data: any) {
|
||||
if (typeof vscode === "undefined") {
|
||||
if (localStorage.getItem("ide") === "jetbrains") {
|
||||
if (window.postIntellijMessage === undefined) {
|
||||
console.log(
|
||||
"Unable to send message: postIntellijMessage is undefined. ",
|
||||
type,
|
||||
data
|
||||
);
|
||||
throw new Error("postIntellijMessage is undefined");
|
||||
}
|
||||
window.postIntellijMessage?.(type, data);
|
||||
return;
|
||||
} else {
|
||||
console.log("Unable to send message: vscode is undefined. ", type, data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
vscode.postMessage({
|
||||
type,
|
||||
...data,
|
||||
});
|
||||
}
|
||||
|
||||
export function postToIde(type: string, data: any, attempt: number = 0) {
|
||||
try {
|
||||
_postToIde(type, data);
|
||||
} catch (error) {
|
||||
if (attempt < 5) {
|
||||
console.log(`Attempt ${attempt} failed. Retrying...`);
|
||||
setTimeout(
|
||||
() => postToIde(type, data, attempt + 1),
|
||||
Math.pow(2, attempt) * 1000
|
||||
);
|
||||
} else {
|
||||
console.error("Max attempts reached. Message could not be sent.", error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function ideRequest(type: string, message: any): Promise<any> {
|
||||
// message, messageId, and type are passed back and forth
|
||||
const messageId = uuidv4();
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const handler = (event: any) => {
|
||||
if (event.data.messageId === messageId) {
|
||||
window.removeEventListener("message", handler);
|
||||
resolve(event.data.message);
|
||||
}
|
||||
};
|
||||
window.addEventListener("message", handler);
|
||||
|
||||
postToIde(type, { message, messageId });
|
||||
});
|
||||
}
|
||||
|
||||
export async function* ideStreamRequest(
|
||||
type: string,
|
||||
message: any,
|
||||
cancelToken?: AbortSignal
|
||||
): AsyncGenerator<any, any> {
|
||||
const messageId = uuidv4();
|
||||
|
||||
postToIde(type, { message, messageId });
|
||||
|
||||
let buffer = "";
|
||||
let index = 0;
|
||||
let done = false;
|
||||
let returnVal = undefined;
|
||||
|
||||
const handler = (event: any) => {
|
||||
if (event.data.messageId === messageId) {
|
||||
if (event.data.message.done) {
|
||||
window.removeEventListener("message", handler);
|
||||
done = true;
|
||||
returnVal = event.data.message.data;
|
||||
} else {
|
||||
buffer += event.data.message.content || "";
|
||||
}
|
||||
}
|
||||
};
|
||||
window.addEventListener("message", handler);
|
||||
|
||||
cancelToken?.addEventListener("abort", () => {
|
||||
postToIde("abort", { messageId });
|
||||
});
|
||||
|
||||
while (!done) {
|
||||
if (buffer.length > index) {
|
||||
const chunk = buffer.slice(index);
|
||||
index = buffer.length;
|
||||
yield chunk;
|
||||
} else {
|
||||
yield undefined;
|
||||
}
|
||||
await new Promise((resolve) => setTimeout(resolve, 50));
|
||||
}
|
||||
|
||||
if (buffer.length > index) {
|
||||
const chunk = buffer.slice(index);
|
||||
index = buffer.length;
|
||||
yield chunk;
|
||||
}
|
||||
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
export async function* llmStreamChat(
|
||||
modelTitle: string,
|
||||
cancelToken: AbortSignal | undefined,
|
||||
messages: ChatMessage[],
|
||||
options: LLMFullCompletionOptions = {}
|
||||
): AsyncGenerator<ChatMessage, LLMReturnValue> {
|
||||
const gen = ideStreamRequest(
|
||||
"llmStreamChat",
|
||||
{
|
||||
messages,
|
||||
title: modelTitle,
|
||||
completionOptions: options,
|
||||
},
|
||||
cancelToken
|
||||
);
|
||||
|
||||
let next = await gen.next();
|
||||
while (!next.done) {
|
||||
if (next.value) {
|
||||
yield { role: "user", content: next.value };
|
||||
}
|
||||
next = await gen.next();
|
||||
}
|
||||
return { prompt: next.value?.prompt, completion: next.value?.completion };
|
||||
}
|
||||
50
core/index.d.ts
vendored
50
core/index.d.ts
vendored
|
|
@ -13,7 +13,11 @@ declare global {
|
|||
};
|
||||
colorThemeName?: string;
|
||||
workspacePaths?: string[];
|
||||
postIntellijMessage?: (type: string, data: any) => void;
|
||||
postIntellijMessage?: (
|
||||
messageType: string,
|
||||
data: any,
|
||||
messageIde: string
|
||||
) => void;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -316,13 +320,24 @@ export class Problem {
|
|||
message: string;
|
||||
}
|
||||
|
||||
export type IdeType = "vscode" | "jetbrains";
|
||||
export interface IdeInfo {
|
||||
ideType: IdeType;
|
||||
name: string;
|
||||
version: string;
|
||||
remoteName: string;
|
||||
}
|
||||
|
||||
export interface IDE {
|
||||
getSerializedConfig(): Promise<BrowserSerializedContinueConfig>;
|
||||
getIdeInfo(): Promise<IdeInfo>;
|
||||
getDiff(): Promise<string>;
|
||||
isTelemetryEnabled(): Promise<boolean>;
|
||||
getUniqueId(): Promise<string>;
|
||||
getTerminalContents(): Promise<string>;
|
||||
listWorkspaceContents(directory?: string): Promise<string[]>;
|
||||
listFolders(): Promise<string[]>;
|
||||
getWorkspaceDirs(): Promise<string[]>;
|
||||
getWorkspaceConfigs(): Promise<ContinueRcJson[]>;
|
||||
writeFile(path: string, contents: string): Promise<void>;
|
||||
showVirtualFile(title: string, contents: string): Promise<void>;
|
||||
getContinueDir(): Promise<string>;
|
||||
|
|
@ -330,6 +345,7 @@ export interface IDE {
|
|||
runCommand(command: string): Promise<void>;
|
||||
saveFile(filepath: string): Promise<void>;
|
||||
readFile(filepath: string): Promise<string>;
|
||||
readRangeInFile(filepath: string, range: Range): Promise<string>;
|
||||
showLines(
|
||||
filepath: string,
|
||||
startLine: number,
|
||||
|
|
@ -340,34 +356,13 @@ export interface IDE {
|
|||
newContents: string,
|
||||
stepIndex: number
|
||||
): Promise<void>;
|
||||
verticalDiffUpdate(
|
||||
filepath: string,
|
||||
startLine: number,
|
||||
endLine: number,
|
||||
diffLine: DiffLine
|
||||
): Promise<void>;
|
||||
getOpenFiles(): Promise<string[]>;
|
||||
getPinnedFiles(): Promise<string[]>;
|
||||
getSearchResults(query: string): Promise<string>;
|
||||
subprocess(command: string): Promise<[string, string]>;
|
||||
getProblems(filepath?: string | undefined): Promise<Problem[]>;
|
||||
getBranch(dir: string): Promise<string>;
|
||||
|
||||
// Embeddings
|
||||
/**
|
||||
* Returns list of [tag, filepath, hash of contents] that need to be embedded
|
||||
*/
|
||||
getFilesToEmbed(providerId: string): Promise<[string, string, string][]>;
|
||||
sendEmbeddingForChunk(
|
||||
chunk: Chunk,
|
||||
embedding: number[],
|
||||
tags: string[]
|
||||
): void;
|
||||
retrieveChunks(
|
||||
text: string,
|
||||
n: number,
|
||||
directory: string | undefined
|
||||
): Promise<Chunk[]>;
|
||||
getStats(directory: string): Promise<{ [path: string]: number }>;
|
||||
}
|
||||
|
||||
// Slash Commands
|
||||
|
|
@ -380,6 +375,8 @@ export interface ContinueSDK {
|
|||
input: string;
|
||||
params?: { [key: string]: any } | undefined;
|
||||
contextItems: ContextItemWithId[];
|
||||
selectedCode: RangeInFile[];
|
||||
config: ContinueConfig;
|
||||
}
|
||||
|
||||
export interface SlashCommand {
|
||||
|
|
@ -420,7 +417,9 @@ type ContextProviderName =
|
|||
| "codebase"
|
||||
| "problems"
|
||||
| "folder"
|
||||
| "jira";
|
||||
| "jira"
|
||||
| "postgres"
|
||||
| "database";
|
||||
|
||||
type TemplateType =
|
||||
| "llama2"
|
||||
|
|
@ -592,6 +591,7 @@ export interface TabAutocompleteOptions {
|
|||
}
|
||||
|
||||
export interface SerializedContinueConfig {
|
||||
env?: string[];
|
||||
allowAnonymousTelemetry?: boolean;
|
||||
models: ModelDescription[];
|
||||
systemMessage?: string;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export function* basicChunker(
|
|||
let currLine = 0;
|
||||
|
||||
for (const line of contents.split("\n")) {
|
||||
const lineTokens = countTokens(line, "gpt-4");
|
||||
const lineTokens = countTokens(line);
|
||||
if (chunkTokens + lineTokens > maxChunkSize - 5) {
|
||||
yield { content: chunkContent, startLine, endLine: currLine - 1 };
|
||||
chunkContent = "";
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ async function* chunkDocumentWithoutId(
|
|||
}
|
||||
return;
|
||||
} catch (e) {
|
||||
console.error(`Failed to parse ${filepath}: `, e);
|
||||
// console.error(`Failed to parse ${filepath}: `, e);
|
||||
// falls back to basicChunker
|
||||
}
|
||||
}
|
||||
|
|
@ -43,11 +43,11 @@ export async function* chunkDocument(
|
|||
contents,
|
||||
maxChunkSize
|
||||
)) {
|
||||
if (countTokens(chunkWithoutId.content, "gpt-4") > MAX_CHUNK_SIZE) {
|
||||
if (countTokens(chunkWithoutId.content) > MAX_CHUNK_SIZE) {
|
||||
console.warn(
|
||||
`Chunk with more than ${maxChunkSize} tokens constructed: `,
|
||||
filepath,
|
||||
countTokens(chunkWithoutId.content, "gpt-4")
|
||||
countTokens(chunkWithoutId.content)
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,10 +59,7 @@ function collapseChildren(
|
|||
}
|
||||
code = code.slice(node.startIndex);
|
||||
let removedChild = false;
|
||||
while (
|
||||
countTokens(code, "gpt-4") > maxChunkSize &&
|
||||
collapsedChildren.length > 0
|
||||
) {
|
||||
while (countTokens(code) > maxChunkSize && collapsedChildren.length > 0) {
|
||||
removedChild = true;
|
||||
// Remove children starting at the end - TODO: Add multiple chunks so no children are missing
|
||||
const childCode = collapsedChildren.pop()!;
|
||||
|
|
@ -169,7 +166,7 @@ function* getSmartCollapsedChunks(
|
|||
// Keep entire text if not over size
|
||||
if (
|
||||
(root || node.type in collapsedNodeConstructors) &&
|
||||
countTokens(node.text, "gpt-4") < maxChunkSize
|
||||
countTokens(node.text) < maxChunkSize
|
||||
) {
|
||||
yield {
|
||||
content: node.text,
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export async function* markdownChunker(
|
|||
maxChunkSize: number,
|
||||
hLevel: number
|
||||
): AsyncGenerator<ChunkWithoutID> {
|
||||
if (countTokens(content, "gpt-4") <= maxChunkSize) {
|
||||
if (countTokens(content) <= maxChunkSize) {
|
||||
const header = findHeader(content.split("\n"));
|
||||
yield {
|
||||
content,
|
||||
|
|
@ -122,8 +122,7 @@ export async function* markdownChunker(
|
|||
for (const section of sections) {
|
||||
for await (const chunk of markdownChunker(
|
||||
section.content,
|
||||
maxChunkSize -
|
||||
(section.header ? countTokens(section.header, "gpt-4") : 0),
|
||||
maxChunkSize - (section.header ? countTokens(section.header) : 0),
|
||||
hLevel + 1
|
||||
)) {
|
||||
yield {
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@ import {
|
|||
pipeline,
|
||||
} from "../../vendor/node_modules/@xenova/transformers";
|
||||
|
||||
import path from "path";
|
||||
import BaseEmbeddingsProvider from "./BaseEmbeddingsProvider";
|
||||
|
||||
env.allowLocalModels = true;
|
||||
env.allowRemoteModels = false;
|
||||
if (typeof window === "undefined") {
|
||||
// The embeddings provider should just never be called in the browser
|
||||
env.localModelPath = `${__dirname}/../models`;
|
||||
env.localModelPath = path.join(__dirname, "..", "models");
|
||||
}
|
||||
|
||||
class EmbeddingsPipeline {
|
||||
|
|
|
|||
59
core/indexing/embeddings/TransformersJsWorkerThread.js
Normal file
59
core/indexing/embeddings/TransformersJsWorkerThread.js
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
import path from "path";
|
||||
import {
|
||||
env,
|
||||
pipeline,
|
||||
} from "../../vendor/node_modules/@xenova/transformers/types/transformers";
|
||||
import TransformersJsEmbeddingsProvider from "./TransformersJsEmbeddingsProvider";
|
||||
const { parentPort } = require("worker_threads");
|
||||
|
||||
env.allowLocalModels = true;
|
||||
env.allowRemoteModels = false;
|
||||
if (typeof window === "undefined") {
|
||||
// The embeddings provider should just never be called in the browser
|
||||
env.localModelPath = path.join(__dirname, "..", "models");
|
||||
}
|
||||
|
||||
class EmbeddingsPipeline {
|
||||
static task = "feature-extraction";
|
||||
static model = TransformersJsEmbeddingsProvider.ModelName;
|
||||
static instance = null;
|
||||
|
||||
static async getInstance() {
|
||||
if (this.instance === null) {
|
||||
this.instance = await pipeline(this.task, this.model);
|
||||
}
|
||||
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
|
||||
parentPort.on("message", async (chunks) => {
|
||||
try {
|
||||
const extractor = await EmbeddingsPipeline.getInstance();
|
||||
|
||||
if (!extractor) {
|
||||
throw new Error("TransformerJS embeddings pipeline is not initialized");
|
||||
}
|
||||
|
||||
let outputs = [];
|
||||
for (
|
||||
let i = 0;
|
||||
i < chunks.length;
|
||||
i += TransformersJsEmbeddingsProvider.MaxGroupSize
|
||||
) {
|
||||
let chunkGroup = chunks.slice(
|
||||
i,
|
||||
i + TransformersJsEmbeddingsProvider.MaxGroupSize
|
||||
);
|
||||
let output = await extractor(chunkGroup, {
|
||||
pooling: "mean",
|
||||
normalize: true,
|
||||
});
|
||||
outputs.push(...output.tolist());
|
||||
}
|
||||
|
||||
parentPort.postMessage(outputs);
|
||||
} catch (error) {
|
||||
parentPort.postMessage({ error: error.message });
|
||||
}
|
||||
});
|
||||
120
core/indexing/indexCodebase.ts
Normal file
120
core/indexing/indexCodebase.ts
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
import { IDE, IndexingProgressUpdate } from "..";
|
||||
import { ConfigHandler } from "../config/handler";
|
||||
import { FullTextSearchCodebaseIndex } from "./FullTextSearch";
|
||||
import { LanceDbIndex } from "./LanceDbIndex";
|
||||
import { ChunkCodebaseIndex } from "./chunk/ChunkCodebaseIndex";
|
||||
import { getComputeDeleteAddRemove } from "./refreshIndex";
|
||||
import { CodebaseIndex, IndexTag } from "./types";
|
||||
|
||||
export class PauseToken {
|
||||
constructor(private _paused: boolean) {}
|
||||
|
||||
set paused(value: boolean) {
|
||||
this._paused = value;
|
||||
}
|
||||
|
||||
get paused(): boolean {
|
||||
return this._paused;
|
||||
}
|
||||
}
|
||||
|
||||
export class CodebaseIndexer {
|
||||
configHandler: ConfigHandler;
|
||||
ide: IDE;
|
||||
pauseToken: PauseToken;
|
||||
|
||||
constructor(configHandler: ConfigHandler, ide: IDE, pauseToken: PauseToken) {
|
||||
this.configHandler = configHandler;
|
||||
this.ide = ide;
|
||||
this.pauseToken = pauseToken;
|
||||
}
|
||||
|
||||
private async getIndexesToBuild(): Promise<CodebaseIndex[]> {
|
||||
const config = await this.configHandler.loadConfig();
|
||||
|
||||
const indexes = [
|
||||
new ChunkCodebaseIndex(this.ide.readFile.bind(this.ide)), // Chunking must come first
|
||||
new LanceDbIndex(
|
||||
config.embeddingsProvider,
|
||||
this.ide.readFile.bind(this.ide)
|
||||
),
|
||||
new FullTextSearchCodebaseIndex(),
|
||||
];
|
||||
|
||||
return indexes;
|
||||
}
|
||||
|
||||
async *refresh(
|
||||
workspaceDirs: string[]
|
||||
): AsyncGenerator<IndexingProgressUpdate> {
|
||||
const config = await this.configHandler.loadConfig();
|
||||
if (config.disableIndexing) {
|
||||
return;
|
||||
}
|
||||
|
||||
const indexesToBuild = await this.getIndexesToBuild();
|
||||
|
||||
let completedDirs = 0;
|
||||
|
||||
yield {
|
||||
progress:
|
||||
0,
|
||||
desc: "Starting indexing...",
|
||||
};
|
||||
|
||||
for (let directory of workspaceDirs) {
|
||||
const stats = await this.ide.getStats(directory);
|
||||
const branch = await this.ide.getBranch(directory);
|
||||
let completedIndexes = 0;
|
||||
|
||||
try {
|
||||
for (let codebaseIndex of indexesToBuild) {
|
||||
const tag: IndexTag = {
|
||||
directory,
|
||||
branch,
|
||||
artifactId: codebaseIndex.artifactId,
|
||||
};
|
||||
const [results, markComplete] = await getComputeDeleteAddRemove(
|
||||
tag,
|
||||
{ ...stats },
|
||||
(filepath) => this.ide.readFile(filepath)
|
||||
);
|
||||
|
||||
for await (let { progress, desc } of codebaseIndex.update(
|
||||
tag,
|
||||
results,
|
||||
markComplete
|
||||
)) {
|
||||
// Handle pausing in this loop because it's the only one really taking time
|
||||
while (this.pauseToken.paused) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
}
|
||||
|
||||
yield {
|
||||
progress:
|
||||
(completedDirs +
|
||||
(completedIndexes + progress) / indexesToBuild.length) /
|
||||
workspaceDirs.length,
|
||||
desc,
|
||||
};
|
||||
}
|
||||
completedIndexes++;
|
||||
yield {
|
||||
progress:
|
||||
(completedDirs + completedIndexes / indexesToBuild.length) /
|
||||
workspaceDirs.length,
|
||||
desc: "Completed indexing " + codebaseIndex.artifactId,
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("Error refreshing index: ", e);
|
||||
}
|
||||
|
||||
completedDirs++;
|
||||
yield {
|
||||
progress: completedDirs / workspaceDirs.length,
|
||||
desc: "Indexing Complete",
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +1,29 @@
|
|||
import { encodingForModel as _encodingForModel, Tiktoken } from "js-tiktoken";
|
||||
import { Tiktoken, encodingForModel as _encodingForModel } from "js-tiktoken";
|
||||
// @ts-ignore
|
||||
import llamaTokenizer from "llama-tokenizer-js";
|
||||
import { ChatMessage, MessageContent, MessagePart } from "..";
|
||||
import { autodetectTemplateType } from "./autodetect";
|
||||
import { TOKEN_BUFFER_FOR_SAFETY } from "./constants";
|
||||
|
||||
let encoding: Tiktoken | null = null;
|
||||
interface Encoding {
|
||||
encode: Tiktoken["encode"];
|
||||
decode: Tiktoken["decode"];
|
||||
}
|
||||
|
||||
function encodingForModel(modelName: string): Tiktoken {
|
||||
if (encoding) {
|
||||
return encoding;
|
||||
let gptEncoding: Encoding | null = null;
|
||||
|
||||
function encodingForModel(modelName: string): Encoding {
|
||||
const modelType = autodetectTemplateType(modelName);
|
||||
|
||||
if (!modelType || modelType === "none") {
|
||||
if (!gptEncoding) {
|
||||
gptEncoding = _encodingForModel("gpt-4");
|
||||
}
|
||||
|
||||
return gptEncoding;
|
||||
}
|
||||
|
||||
encoding = _encodingForModel("gpt-4");
|
||||
return encoding;
|
||||
return llamaTokenizer;
|
||||
}
|
||||
|
||||
function countImageTokens(content: MessagePart): number {
|
||||
|
|
@ -21,7 +34,11 @@ function countImageTokens(content: MessagePart): number {
|
|||
}
|
||||
}
|
||||
|
||||
function countTokens(content: MessageContent, modelName: string): number {
|
||||
function countTokens(
|
||||
content: MessageContent,
|
||||
// defaults to llama2 because the tokenizer tends to produce more tokens
|
||||
modelName: string = "llama2"
|
||||
): number {
|
||||
const encoding = encodingForModel(modelName);
|
||||
if (Array.isArray(content)) {
|
||||
return content.reduce((acc, part) => {
|
||||
|
|
@ -72,21 +89,29 @@ function countChatMessageTokens(
|
|||
return countTokens(chatMessage.content, modelName) + TOKENS_PER_MESSAGE;
|
||||
}
|
||||
|
||||
function pruneLinesFromTop(prompt: string, maxTokens: number): string {
|
||||
let totalTokens = countTokens(prompt, "gpt-4");
|
||||
function pruneLinesFromTop(
|
||||
prompt: string,
|
||||
maxTokens: number,
|
||||
modelName: string
|
||||
): string {
|
||||
let totalTokens = countTokens(prompt, modelName);
|
||||
const lines = prompt.split("\n");
|
||||
while (totalTokens > maxTokens && lines.length > 0) {
|
||||
totalTokens -= countTokens(lines.shift()!, "gpt-4");
|
||||
totalTokens -= countTokens(lines.shift()!, modelName);
|
||||
}
|
||||
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
function pruneLinesFromBottom(prompt: string, maxTokens: number): string {
|
||||
let totalTokens = countTokens(prompt, "gpt-4");
|
||||
function pruneLinesFromBottom(
|
||||
prompt: string,
|
||||
maxTokens: number,
|
||||
modelName: string
|
||||
): string {
|
||||
let totalTokens = countTokens(prompt, modelName);
|
||||
const lines = prompt.split("\n");
|
||||
while (totalTokens > maxTokens && lines.length > 0) {
|
||||
totalTokens -= countTokens(lines.pop()!, "gpt-4");
|
||||
totalTokens -= countTokens(lines.pop()!, modelName);
|
||||
}
|
||||
|
||||
return lines.join("\n");
|
||||
|
|
|
|||
|
|
@ -25,40 +25,44 @@ class Ollama extends BaseLLM {
|
|||
method: "POST",
|
||||
headers: {},
|
||||
body: JSON.stringify({ name: this._getModel() }),
|
||||
}).then(async (response) => {
|
||||
if (response.status !== 200) {
|
||||
console.warn(
|
||||
"Error calling Ollama /api/show endpoint: ",
|
||||
await response.text()
|
||||
);
|
||||
return;
|
||||
}
|
||||
const body = await response.json();
|
||||
if (body.parameters) {
|
||||
const params = [];
|
||||
for (let line of body.parameters.split("\n")) {
|
||||
let parts = line.split(" ");
|
||||
if (parts.length < 2) {
|
||||
continue;
|
||||
}
|
||||
let key = parts[0];
|
||||
let value = parts[parts.length - 1];
|
||||
switch (key) {
|
||||
case "num_ctx":
|
||||
this.contextLength = parseInt(value);
|
||||
break;
|
||||
case "stop":
|
||||
if (!this.completionOptions.stop) {
|
||||
this.completionOptions.stop = [];
|
||||
}
|
||||
this.completionOptions.stop.push(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
})
|
||||
.then(async (response) => {
|
||||
if (response.status !== 200) {
|
||||
console.warn(
|
||||
"Error calling Ollama /api/show endpoint: ",
|
||||
await response.text()
|
||||
);
|
||||
return;
|
||||
}
|
||||
const body = await response.json();
|
||||
if (body.parameters) {
|
||||
const params = [];
|
||||
for (let line of body.parameters.split("\n")) {
|
||||
let parts = line.split(" ");
|
||||
if (parts.length < 2) {
|
||||
continue;
|
||||
}
|
||||
let key = parts[0];
|
||||
let value = parts[parts.length - 1];
|
||||
switch (key) {
|
||||
case "num_ctx":
|
||||
this.contextLength = parseInt(value);
|
||||
break;
|
||||
case "stop":
|
||||
if (!this.completionOptions.stop) {
|
||||
this.completionOptions.stop = [];
|
||||
}
|
||||
this.completionOptions.stop.push(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
console.warn(`Error calling Ollama /api/show endpoint: ${e}`);
|
||||
});
|
||||
}
|
||||
|
||||
private _getModel() {
|
||||
|
|
|
|||
491
core/package-lock.json
generated
491
core/package-lock.json
generated
|
|
@ -15,15 +15,22 @@
|
|||
"adf-to-md": "^1.1.0",
|
||||
"axios": "^1.6.7",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
"commander": "^12.0.0",
|
||||
"dbinfoz": "^0.1.4",
|
||||
"dotenv": "^16.3.1",
|
||||
"fastest-levenshtein": "^1.0.16",
|
||||
"follow-redirects": "^1.15.5",
|
||||
"handlebars": "^4.7.8",
|
||||
"http-proxy-agent": "^7.0.1",
|
||||
"https-proxy-agent": "^7.0.3",
|
||||
"js-tiktoken": "^1.0.8",
|
||||
"llama-tokenizer-js": "^1.1.3",
|
||||
"llm-code-highlighter": "^0.0.13",
|
||||
"node-fetch": "^3.3.2",
|
||||
"node-html-markdown": "^1.3.0",
|
||||
"ollama": "^0.4.6",
|
||||
"openai": "^4.20.1",
|
||||
"pg": "^8.11.3",
|
||||
"posthog-node": "^3.6.2",
|
||||
"replicate": "^0.26.0",
|
||||
"socket.io-client": "^4.7.3",
|
||||
|
|
@ -35,6 +42,7 @@
|
|||
"web-tree-sitter": "^0.20.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"@types/handlebars": "^4.1.0",
|
||||
"@types/jest": "^29.5.11",
|
||||
"@types/jquery": "^3.5.29",
|
||||
|
|
@ -2046,6 +2054,15 @@
|
|||
"resolved": "https://registry.npmjs.org/@types/command-line-usage/-/command-line-usage-5.0.2.tgz",
|
||||
"integrity": "sha512-n7RlEEJ+4x4TS7ZQddTmNSxP+zziEG0TNsMfiRIxcIVXt71ENJ9ojeXmGO3wPoTdn7pJcU2xc3CJYMktNT6DPg=="
|
||||
},
|
||||
"node_modules/@types/follow-redirects": {
|
||||
"version": "1.14.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/follow-redirects/-/follow-redirects-1.14.4.tgz",
|
||||
"integrity": "sha512-GWXfsD0Jc1RWiFmMuMFCpXMzi9L7oPDVwxUnZdg89kDNnqsRfUKXEtUYtA98A6lig1WXH/CYY/fvPW9HuN5fTA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/graceful-fs": {
|
||||
"version": "4.1.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz",
|
||||
|
|
@ -2251,15 +2268,14 @@
|
|||
}
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
||||
"optional": true,
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz",
|
||||
"integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==",
|
||||
"dependencies": {
|
||||
"debug": "4"
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0"
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/agentkeepalive": {
|
||||
|
|
@ -2401,6 +2417,20 @@
|
|||
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/are-we-there-yet/node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/argparse": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||
|
|
@ -2740,6 +2770,42 @@
|
|||
"readable-stream": "^3.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bl/node_modules/buffer": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
|
||||
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"base64-js": "^1.3.1",
|
||||
"ieee754": "^1.1.13"
|
||||
}
|
||||
},
|
||||
"node_modules/bl/node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/boolbase": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
|
||||
|
|
@ -2820,9 +2886,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/buffer": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
|
||||
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
|
||||
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
|
|
@ -2837,9 +2903,10 @@
|
|||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"base64-js": "^1.3.1",
|
||||
"ieee754": "^1.1.13"
|
||||
"ieee754": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/buffer-from": {
|
||||
|
|
@ -2848,6 +2915,14 @@
|
|||
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/buffer-writer": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz",
|
||||
"integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/cacache": {
|
||||
"version": "15.3.0",
|
||||
"resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz",
|
||||
|
|
@ -3201,6 +3276,14 @@
|
|||
"node": ">=12.17"
|
||||
}
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "12.0.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz",
|
||||
"integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
|
|
@ -3299,6 +3382,16 @@
|
|||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/dbinfoz": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/dbinfoz/-/dbinfoz-0.1.4.tgz",
|
||||
"integrity": "sha512-MB56+xS571ip7qoXqxdnOUtXebbWaqoZN+S++W51SQYJRSjQFGEIPucNmxgeQlBGJ1vM4mQNV47wzV6fcrezZg==",
|
||||
"dependencies": {
|
||||
"mysql2": "^3.9.1",
|
||||
"pg": "^8.11.3",
|
||||
"sqlite3": "^5.1.7"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||
|
|
@ -3412,6 +3505,14 @@
|
|||
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/denque": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz",
|
||||
"integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==",
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/deprecation": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
|
||||
|
|
@ -4564,6 +4665,14 @@
|
|||
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/generate-function": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz",
|
||||
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
|
||||
"dependencies": {
|
||||
"is-property": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/gensync": {
|
||||
"version": "1.0.0-beta.2",
|
||||
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
|
||||
|
|
@ -4928,30 +5037,27 @@
|
|||
"optional": true
|
||||
},
|
||||
"node_modules/http-proxy-agent": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz",
|
||||
"integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==",
|
||||
"optional": true,
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.1.tgz",
|
||||
"integrity": "sha512-My1KCEPs6A0hb4qCVzYp8iEvA8j8YqcvXLZZH8C9OFuTYpYjHE7N2dtG3mRl1HMD4+VGXpF3XcDVcxGBT7yDZQ==",
|
||||
"dependencies": {
|
||||
"@tootallnate/once": "1",
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
"agent-base": "^7.1.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/https-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
|
||||
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
|
||||
"optional": true,
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.3.tgz",
|
||||
"integrity": "sha512-kCnwztfX0KZJSLOBrcL0emLeFako55NWMovvyPP2AjsghNk9RB1yjSI+jVumPHYZsNXegNoqupSW9IY3afSH8w==",
|
||||
"dependencies": {
|
||||
"agent-base": "6",
|
||||
"agent-base": "^7.0.2",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/human-signals": {
|
||||
|
|
@ -4975,7 +5081,6 @@
|
|||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
|
|
@ -5292,6 +5397,11 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/is-property": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
|
||||
"integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g=="
|
||||
},
|
||||
"node_modules/is-regex": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
|
||||
|
|
@ -6212,6 +6322,11 @@
|
|||
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/llama-tokenizer-js": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/llama-tokenizer-js/-/llama-tokenizer-js-1.1.3.tgz",
|
||||
"integrity": "sha512-+BUgsLCXVQJkjiD/t7PdESLn+yXJIRX/BJfwzVVYfKZ9aN3gsP9xoadBZxKnCxGz2Slby+S7x41gUr2TKNaS4Q=="
|
||||
},
|
||||
"node_modules/llm-code-highlighter": {
|
||||
"version": "0.0.13",
|
||||
"resolved": "https://registry.npmjs.org/llm-code-highlighter/-/llm-code-highlighter-0.0.13.tgz",
|
||||
|
|
@ -6358,6 +6473,45 @@
|
|||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/make-fetch-happen/node_modules/agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/make-fetch-happen/node_modules/http-proxy-agent": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz",
|
||||
"integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@tootallnate/once": "1",
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/make-fetch-happen/node_modules/https-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
|
||||
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/make-fetch-happen/node_modules/lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
|
|
@ -6599,6 +6753,56 @@
|
|||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"node_modules/mysql2": {
|
||||
"version": "3.9.2",
|
||||
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.9.2.tgz",
|
||||
"integrity": "sha512-3Cwg/UuRkAv/wm6RhtPE5L7JlPB877vwSF6gfLAS68H+zhH+u5oa3AieqEd0D0/kC3W7qIhYbH419f7O9i/5nw==",
|
||||
"dependencies": {
|
||||
"denque": "^2.1.0",
|
||||
"generate-function": "^2.3.1",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"long": "^5.2.1",
|
||||
"lru-cache": "^8.0.0",
|
||||
"named-placeholders": "^1.1.3",
|
||||
"seq-queue": "^0.0.5",
|
||||
"sqlstring": "^2.3.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mysql2/node_modules/long": {
|
||||
"version": "5.2.3",
|
||||
"resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz",
|
||||
"integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q=="
|
||||
},
|
||||
"node_modules/mysql2/node_modules/lru-cache": {
|
||||
"version": "8.0.5",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz",
|
||||
"integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==",
|
||||
"engines": {
|
||||
"node": ">=16.14"
|
||||
}
|
||||
},
|
||||
"node_modules/named-placeholders": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz",
|
||||
"integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^7.14.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/named-placeholders/node_modules/lru-cache": {
|
||||
"version": "7.18.3",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
|
||||
"integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/napi-build-utils": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
|
||||
|
|
@ -7152,6 +7356,11 @@
|
|||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/packet-reader": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz",
|
||||
"integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ=="
|
||||
},
|
||||
"node_modules/pad-left": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/pad-left/-/pad-left-2.1.0.tgz",
|
||||
|
|
@ -7245,6 +7454,89 @@
|
|||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
|
||||
},
|
||||
"node_modules/pg": {
|
||||
"version": "8.11.3",
|
||||
"resolved": "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz",
|
||||
"integrity": "sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==",
|
||||
"dependencies": {
|
||||
"buffer-writer": "2.0.0",
|
||||
"packet-reader": "1.0.0",
|
||||
"pg-connection-string": "^2.6.2",
|
||||
"pg-pool": "^3.6.1",
|
||||
"pg-protocol": "^1.6.0",
|
||||
"pg-types": "^2.1.0",
|
||||
"pgpass": "1.x"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"pg-cloudflare": "^1.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"pg-native": ">=3.0.1"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"pg-native": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/pg-cloudflare": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz",
|
||||
"integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/pg-connection-string": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz",
|
||||
"integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA=="
|
||||
},
|
||||
"node_modules/pg-int8": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
|
||||
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pg-pool": {
|
||||
"version": "3.6.1",
|
||||
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz",
|
||||
"integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==",
|
||||
"peerDependencies": {
|
||||
"pg": ">=8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pg-protocol": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz",
|
||||
"integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q=="
|
||||
},
|
||||
"node_modules/pg-types": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
|
||||
"integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
|
||||
"dependencies": {
|
||||
"pg-int8": "1.0.1",
|
||||
"postgres-array": "~2.0.0",
|
||||
"postgres-bytea": "~1.0.0",
|
||||
"postgres-date": "~1.0.4",
|
||||
"postgres-interval": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/pgpass": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",
|
||||
"integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",
|
||||
"dependencies": {
|
||||
"split2": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
|
||||
|
|
@ -7297,6 +7589,41 @@
|
|||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/postgres-array": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
|
||||
"integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/postgres-bytea": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
|
||||
"integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/postgres-date": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
|
||||
"integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/postgres-interval": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
|
||||
"integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
|
||||
"dependencies": {
|
||||
"xtend": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/posthog-node": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/posthog-node/-/posthog-node-3.6.2.tgz",
|
||||
|
|
@ -7339,6 +7666,19 @@
|
|||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
|
||||
},
|
||||
"node_modules/prebuild-install/node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/prebuild-install/node_modules/tar-fs": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
|
||||
|
|
@ -7559,16 +7899,19 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"version": "4.5.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz",
|
||||
"integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
"abort-controller": "^3.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"events": "^3.3.0",
|
||||
"process": "^0.11.10",
|
||||
"string_decoder": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/regexp.prototype.flags": {
|
||||
|
|
@ -7610,46 +7953,6 @@
|
|||
"readable-stream": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/replicate/node_modules/buffer": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
|
||||
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"base64-js": "^1.3.1",
|
||||
"ieee754": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/replicate/node_modules/readable-stream": {
|
||||
"version": "4.5.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz",
|
||||
"integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"abort-controller": "^3.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"events": "^3.3.0",
|
||||
"process": "^0.11.10",
|
||||
"string_decoder": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
|
|
@ -7821,8 +8124,7 @@
|
|||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"optional": true
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "6.3.1",
|
||||
|
|
@ -7832,6 +8134,11 @@
|
|||
"semver": "bin/semver.js"
|
||||
}
|
||||
},
|
||||
"node_modules/seq-queue": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz",
|
||||
"integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q=="
|
||||
},
|
||||
"node_modules/set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
|
|
@ -8097,6 +8404,18 @@
|
|||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/socks-proxy-agent/node_modules/agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
|
|
@ -8115,6 +8434,14 @@
|
|||
"source-map": "^0.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/split2": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
|
||||
"integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
|
||||
"engines": {
|
||||
"node": ">= 10.x"
|
||||
}
|
||||
},
|
||||
"node_modules/sprintf-js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
|
|
@ -8157,6 +8484,14 @@
|
|||
"node": "^16 || ^18 || >= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlstring": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz",
|
||||
"integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/ssri": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
|
||||
|
|
@ -9052,6 +9387,14 @@
|
|||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/xtend": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
||||
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
|
||||
"engines": {
|
||||
"node": ">=0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/y18n": {
|
||||
"version": "5.0.8",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
"author": "Nate Sesti and Ty Dunn",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"@types/handlebars": "^4.1.0",
|
||||
"@types/jest": "^29.5.11",
|
||||
"@types/jquery": "^3.5.29",
|
||||
|
|
@ -24,15 +25,22 @@
|
|||
"adf-to-md": "^1.1.0",
|
||||
"axios": "^1.6.7",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
"commander": "^12.0.0",
|
||||
"dbinfoz": "^0.1.4",
|
||||
"dotenv": "^16.3.1",
|
||||
"fastest-levenshtein": "^1.0.16",
|
||||
"follow-redirects": "^1.15.5",
|
||||
"handlebars": "^4.7.8",
|
||||
"http-proxy-agent": "^7.0.1",
|
||||
"https-proxy-agent": "^7.0.3",
|
||||
"js-tiktoken": "^1.0.8",
|
||||
"llama-tokenizer-js": "^1.1.3",
|
||||
"llm-code-highlighter": "^0.0.13",
|
||||
"node-fetch": "^3.3.2",
|
||||
"node-html-markdown": "^1.3.0",
|
||||
"ollama": "^0.4.6",
|
||||
"openai": "^4.20.1",
|
||||
"pg": "^8.11.3",
|
||||
"posthog-node": "^3.6.2",
|
||||
"replicate": "^0.26.0",
|
||||
"socket.io-client": "^4.7.3",
|
||||
|
|
|
|||
98
core/protocol.ts
Normal file
98
core/protocol.ts
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
import {
|
||||
BrowserSerializedContinueConfig,
|
||||
ChatMessage,
|
||||
ContextItemWithId,
|
||||
ContextSubmenuItem,
|
||||
LLMFullCompletionOptions,
|
||||
MessageContent,
|
||||
PersistedSessionInfo,
|
||||
RangeInFile,
|
||||
SerializedContinueConfig,
|
||||
SessionInfo,
|
||||
} from ".";
|
||||
|
||||
export type ProtocolGeneratorType<T> = AsyncGenerator<{
|
||||
done?: boolean;
|
||||
content: T;
|
||||
}>;
|
||||
|
||||
export type Protocol = {
|
||||
// New
|
||||
"update/modelChange": [string, void];
|
||||
// Special
|
||||
ping: [string, string];
|
||||
abort: [undefined, void];
|
||||
|
||||
// History
|
||||
"history/list": [undefined, SessionInfo[]];
|
||||
"history/delete": [{ id: string }, void];
|
||||
"history/load": [{ id: string }, PersistedSessionInfo];
|
||||
"history/save": [PersistedSessionInfo, void];
|
||||
"devdata/log": [{ tableName: string; data: any }, void];
|
||||
"config/addOpenAiKey": [string, void];
|
||||
"config/addModel": [
|
||||
{ model: SerializedContinueConfig["models"][number] },
|
||||
void,
|
||||
];
|
||||
"config/getBrowserSerialized": [
|
||||
undefined,
|
||||
Promise<BrowserSerializedContinueConfig>,
|
||||
];
|
||||
"config/deleteModel": [{ title: string }, void];
|
||||
"config/reload": [undefined, Promise<BrowserSerializedContinueConfig>];
|
||||
"context/getContextItems": [
|
||||
{
|
||||
name: string;
|
||||
query: string;
|
||||
fullInput: string;
|
||||
selectedCode: RangeInFile[];
|
||||
},
|
||||
Promise<ContextItemWithId[]>,
|
||||
];
|
||||
"context/loadSubmenuItems": [
|
||||
{ title: string },
|
||||
Promise<ContextSubmenuItem[]>,
|
||||
];
|
||||
"context/addDocs": [{ title: string; url: string }, void];
|
||||
"autocomplete/complete": [
|
||||
{ filepath: string; line: number; column: number },
|
||||
string[],
|
||||
];
|
||||
"command/run": [
|
||||
{
|
||||
input: string;
|
||||
history: ChatMessage[];
|
||||
modelTitle: string;
|
||||
slashCommandName: string;
|
||||
contextItems: ContextItemWithId[];
|
||||
params: any;
|
||||
historyIndex: number;
|
||||
selectedCode: RangeInFile[];
|
||||
},
|
||||
ProtocolGeneratorType<string>,
|
||||
];
|
||||
"llm/complete": [
|
||||
{
|
||||
prompt: string;
|
||||
completionOptions: LLMFullCompletionOptions;
|
||||
title: string;
|
||||
},
|
||||
string,
|
||||
];
|
||||
"llm/streamComplete": [
|
||||
{
|
||||
prompt: string;
|
||||
completionOptions: LLMFullCompletionOptions;
|
||||
title: string;
|
||||
},
|
||||
ProtocolGeneratorType<string>,
|
||||
];
|
||||
"llm/streamChat": [
|
||||
{
|
||||
messages: ChatMessage[];
|
||||
completionOptions: LLMFullCompletionOptions;
|
||||
title: string;
|
||||
},
|
||||
ProtocolGeneratorType<MessageContent>,
|
||||
];
|
||||
};
|
||||
|
|
@ -1,6 +1,18 @@
|
|||
import { streamDiff } from "../diff/streamDiff";
|
||||
|
||||
const oldCode = [
|
||||
`A
|
||||
B`,
|
||||
`A
|
||||
B
|
||||
C`,
|
||||
`A
|
||||
B
|
||||
C
|
||||
A
|
||||
B
|
||||
B
|
||||
A`,
|
||||
`function mergeSortAlgorithm() {
|
||||
// TODO: implement
|
||||
}`,
|
||||
|
|
@ -10,6 +22,19 @@ const oldCode = [
|
|||
];
|
||||
|
||||
const newCode = [
|
||||
`C
|
||||
D`,
|
||||
`D
|
||||
E
|
||||
C
|
||||
F
|
||||
C`,
|
||||
`C
|
||||
B
|
||||
A
|
||||
B
|
||||
A
|
||||
C`,
|
||||
`function mergeSortAlgorithm(arr: number[]): number[] {
|
||||
if (arr.length <= 1) {
|
||||
return arr;
|
||||
|
|
@ -113,7 +138,11 @@ describe("streamDiff", () => {
|
|||
// Check that there are no red lines immediately following green (they should always be above)
|
||||
for (let i = 1; i < diff.length; i++) {
|
||||
if (diff[i].type === "old" && diff[i - 1].type === "new") {
|
||||
throw new Error("Found red immediately after green line");
|
||||
throw new Error(
|
||||
`Found red '${diff[i].line}' immediately after green line '${
|
||||
diff[i - 1].line
|
||||
}`
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ import * as dotenv from "dotenv";
|
|||
import { ContinueSDK } from "..";
|
||||
import EditSlashCommand, { getPromptParts } from "../commands/slash/edit";
|
||||
import { contextItemToRangeInFileWithContents } from "../commands/util";
|
||||
import FileSystemIde from "../ide/filesystem";
|
||||
import FreeTrial from "../llm/llms/FreeTrial";
|
||||
import Ollama from "../llm/llms/Ollama";
|
||||
import { dedentAndGetCommonWhitespace } from "../util";
|
||||
import FileSystemIde from "../util/filesystem";
|
||||
|
||||
jest.setTimeout(100_000);
|
||||
|
||||
|
|
@ -62,6 +62,8 @@ describe("/edit slash command", () => {
|
|||
history: [],
|
||||
input: "implement this function",
|
||||
contextItems: [TEST_CONTEXT_ITEM],
|
||||
selectedCode: [],
|
||||
config: {} as any,
|
||||
};
|
||||
|
||||
let total = "";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
||||
"lib": ["DOM", "DOM.Iterable", "ESNext", "ES2021"],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": false,
|
||||
|
|
@ -18,5 +18,5 @@
|
|||
"noEmitOnError": false,
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": ["./**/*.ts"]
|
||||
"include": ["./**/*.ts", "indexing/embeddings/TransformersJsWorkerThread.js"]
|
||||
}
|
||||
|
|
|
|||
8
core/util/devdata.ts
Normal file
8
core/util/devdata.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { writeFileSync } from "fs";
|
||||
import { getDevDataFilePath } from "./paths";
|
||||
|
||||
export function logDevData(tableName: string, data: any) {
|
||||
const filepath: string = getDevDataFilePath(tableName);
|
||||
const jsonLine = JSON.stringify(data);
|
||||
writeFileSync(filepath, `${jsonLine}\n`, { flag: "a" });
|
||||
}
|
||||
|
|
@ -1,12 +1,30 @@
|
|||
import * as fs from "fs";
|
||||
import { DiffLine, IDE, Problem } from "..";
|
||||
import { BrowserSerializedContinueConfig } from "../config/load";
|
||||
import { Chunk } from "../index";
|
||||
import { getContinueGlobalPath } from "../util/paths";
|
||||
import { ContinueRcJson, IDE, IdeInfo, Problem, Range } from "..";
|
||||
import { getContinueGlobalPath } from "./paths";
|
||||
|
||||
class FileSystemIde implements IDE {
|
||||
async getSerializedConfig(): Promise<BrowserSerializedContinueConfig> {
|
||||
throw new Error("Not implemented");
|
||||
getIdeInfo(): Promise<IdeInfo> {
|
||||
return Promise.resolve({
|
||||
ideType: "vscode",
|
||||
name: "na",
|
||||
version: "0.1",
|
||||
remoteName: "na",
|
||||
});
|
||||
}
|
||||
readRangeInFile(filepath: string, range: Range): Promise<string> {
|
||||
return Promise.resolve("");
|
||||
}
|
||||
getStats(directory: string): Promise<{ [path: string]: number }> {
|
||||
return Promise.resolve({});
|
||||
}
|
||||
isTelemetryEnabled(): Promise<boolean> {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
getUniqueId(): Promise<string> {
|
||||
return Promise.resolve("NOT_UNIQUE");
|
||||
}
|
||||
getWorkspaceConfigs(): Promise<ContinueRcJson[]> {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
|
||||
getDiff(): Promise<string> {
|
||||
|
|
@ -92,15 +110,6 @@ class FileSystemIde implements IDE {
|
|||
return Promise.resolve("");
|
||||
}
|
||||
|
||||
async verticalDiffUpdate(
|
||||
filepath: string,
|
||||
startLine: number,
|
||||
endLine: number,
|
||||
diffLine: DiffLine
|
||||
) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
getOpenFiles(): Promise<string[]> {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
|
|
@ -120,20 +129,6 @@ class FileSystemIde implements IDE {
|
|||
async subprocess(command: string): Promise<[string, string]> {
|
||||
return ["", ""];
|
||||
}
|
||||
|
||||
getFilesToEmbed(providerId: string): Promise<[string, string, string][]> {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
|
||||
sendEmbeddingForChunk(chunk: Chunk, embedding: number[], tags: string[]) {}
|
||||
|
||||
retrieveChunks(
|
||||
text: string,
|
||||
n: number,
|
||||
directory: string | undefined
|
||||
): Promise<Chunk[]> {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
}
|
||||
|
||||
export default FileSystemIde;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import { PersistedSessionInfo, SessionInfo } from "core";
|
||||
import { getSessionFilePath, getSessionsListPath } from "core/util/paths";
|
||||
import * as fs from "fs";
|
||||
import { PersistedSessionInfo, SessionInfo } from "..";
|
||||
import { getSessionFilePath, getSessionsListPath } from "./paths";
|
||||
|
||||
class HistoryManager {
|
||||
list(): PersistedSessionInfo[] {
|
||||
list(): SessionInfo[] {
|
||||
const filepath = getSessionsListPath();
|
||||
if (!fs.existsSync(filepath)) {
|
||||
return [];
|
||||
|
|
@ -5,7 +5,8 @@ type JsonObject = { [key: string]: any };
|
|||
export function mergeJson(
|
||||
first: JsonObject,
|
||||
second: JsonObject,
|
||||
mergeBehavior?: ConfigMergeType
|
||||
mergeBehavior?: ConfigMergeType,
|
||||
mergeKeys?: {[key: string]: (a: any, b: any) => boolean}
|
||||
): any {
|
||||
first = { ...first };
|
||||
|
||||
|
|
@ -20,10 +21,21 @@ export function mergeJson(
|
|||
}
|
||||
|
||||
const firstValue = first[key];
|
||||
if (Array.isArray(secondValue)) {
|
||||
if (Array.isArray(secondValue) && Array.isArray(firstValue)) {
|
||||
// Array
|
||||
first[key] = [...firstValue, ...secondValue];
|
||||
} else if (typeof secondValue === "object") {
|
||||
if (mergeKeys?.[key]) {
|
||||
// Merge keys are used to determine whether an item form the second object should override one from the first
|
||||
let keptFromFirst: any[] = [];
|
||||
firstValue.forEach((item: any) => {
|
||||
if (!secondValue.some((item2: any) => mergeKeys[key](item, item2))) {
|
||||
keptFromFirst.push(item);
|
||||
}
|
||||
})
|
||||
first[key] = [...keptFromFirst, ...secondValue];
|
||||
} else {
|
||||
first[key] = [...firstValue, ...secondValue];
|
||||
}
|
||||
} else if (typeof secondValue === "object" && typeof firstValue === "object") {
|
||||
// Object
|
||||
first[key] = mergeJson(firstValue, secondValue, mergeBehavior);
|
||||
} else {
|
||||
|
|
|
|||
121
core/util/messageIde.ts
Normal file
121
core/util/messageIde.ts
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
import { ContinueRcJson, IDE, IdeInfo, Problem, Range } from "..";
|
||||
|
||||
export class MessageIde implements IDE {
|
||||
constructor(
|
||||
private readonly request: (messageType: string, data: any) => Promise<any>
|
||||
) {}
|
||||
getIdeInfo(): Promise<IdeInfo> {
|
||||
return this.request("getIdeInfo", undefined);
|
||||
}
|
||||
|
||||
readRangeInFile(filepath: string, range: Range): Promise<string> {
|
||||
return this.request("readRangeInFile", { filepath, range });
|
||||
}
|
||||
getStats(directory: string): Promise<{ [path: string]: number }> {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
isTelemetryEnabled(): Promise<boolean> {
|
||||
return this.request("isTelemetryEnabled", undefined);
|
||||
}
|
||||
|
||||
getUniqueId(): Promise<string> {
|
||||
return this.request("getUniqueId", undefined);
|
||||
}
|
||||
|
||||
getWorkspaceConfigs(): Promise<ContinueRcJson[]> {
|
||||
return this.request("getWorkspaceConfigs", undefined);
|
||||
}
|
||||
|
||||
async getDiff() {
|
||||
return await this.request("getDiff", undefined);
|
||||
}
|
||||
|
||||
async getTerminalContents() {
|
||||
return await this.request("getTerminalContents", undefined);
|
||||
}
|
||||
|
||||
async listWorkspaceContents(directory?: string): Promise<string[]> {
|
||||
return await this.request("listWorkspaceContents", undefined);
|
||||
}
|
||||
|
||||
async getWorkspaceDirs(): Promise<string[]> {
|
||||
return await this.request("getWorkspaceDirs", undefined);
|
||||
}
|
||||
|
||||
async showLines(
|
||||
filepath: string,
|
||||
startLine: number,
|
||||
endLine: number
|
||||
): Promise<void> {
|
||||
return await this.request("showLines", { filepath, startLine, endLine });
|
||||
}
|
||||
|
||||
async listFolders(): Promise<string[]> {
|
||||
return await this.request("listFolders", undefined);
|
||||
}
|
||||
|
||||
_continueDir: string | null = null;
|
||||
|
||||
async getContinueDir(): Promise<string> {
|
||||
if (this._continueDir) {
|
||||
return this._continueDir;
|
||||
}
|
||||
const dir = await this.request("getContinueDir", undefined);
|
||||
this._continueDir = dir;
|
||||
return dir;
|
||||
}
|
||||
|
||||
async writeFile(path: string, contents: string): Promise<void> {
|
||||
await this.request("writeFile", { path, contents });
|
||||
}
|
||||
|
||||
async showVirtualFile(title: string, contents: string): Promise<void> {
|
||||
await this.request("showVirtualFile", { name: title, content: contents });
|
||||
}
|
||||
|
||||
async openFile(path: string): Promise<void> {
|
||||
await this.request("openFile", { path });
|
||||
}
|
||||
|
||||
async runCommand(command: string): Promise<void> {
|
||||
await this.request("runCommand", { command });
|
||||
}
|
||||
|
||||
async saveFile(filepath: string): Promise<void> {
|
||||
await this.request("saveFile", { filepath });
|
||||
}
|
||||
async readFile(filepath: string): Promise<string> {
|
||||
return await this.request("readFile", { filepath });
|
||||
}
|
||||
async showDiff(
|
||||
filepath: string,
|
||||
newContents: string,
|
||||
stepIndex: number
|
||||
): Promise<void> {
|
||||
await this.request("showDiff", { filepath, newContents, stepIndex });
|
||||
}
|
||||
|
||||
getOpenFiles(): Promise<string[]> {
|
||||
return this.request("getOpenFiles", undefined);
|
||||
}
|
||||
|
||||
getPinnedFiles(): Promise<string[]> {
|
||||
return this.request("getPinnedFiles", undefined);
|
||||
}
|
||||
|
||||
getSearchResults(query: string): Promise<string> {
|
||||
return this.request("getSearchResults", { query });
|
||||
}
|
||||
|
||||
getProblems(filepath?: string | undefined): Promise<Problem[]> {
|
||||
return this.request("getProblems", { filepath });
|
||||
}
|
||||
|
||||
subprocess(command: string): Promise<[string, string]> {
|
||||
return this.request("subprocess", { command });
|
||||
}
|
||||
|
||||
async getBranch(dir: string): Promise<string> {
|
||||
return this.request("getBranch", { dir });
|
||||
}
|
||||
}
|
||||
5
core/util/messenger.ts
Normal file
5
core/util/messenger.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export interface Message<T = any> {
|
||||
messageType: string;
|
||||
messageId: string;
|
||||
data: T;
|
||||
}
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
import dotenv from "dotenv";
|
||||
import * as fs from "fs";
|
||||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
import { SerializedContinueConfig } from "..";
|
||||
import defaultConfig from "../config/default";
|
||||
import { IdeType, SerializedContinueConfig } from "..";
|
||||
import { defaultConfig, defaultConfigJetBrains } from "../config/default";
|
||||
import Types from "../config/types";
|
||||
|
||||
export function getContinueGlobalPath(): string {
|
||||
|
|
@ -42,10 +43,14 @@ export function getSessionsListPath(): string {
|
|||
return filepath;
|
||||
}
|
||||
|
||||
export function getConfigJsonPath(): string {
|
||||
export function getConfigJsonPath(ideType: IdeType = "vscode"): string {
|
||||
const p = path.join(getContinueGlobalPath(), "config.json");
|
||||
if (!fs.existsSync(p)) {
|
||||
fs.writeFileSync(p, JSON.stringify(defaultConfig, null, 2));
|
||||
if (ideType === "jetbrains") {
|
||||
fs.writeFileSync(p, JSON.stringify(defaultConfigJetBrains, null, 2));
|
||||
} else {
|
||||
fs.writeFileSync(p, JSON.stringify(defaultConfig, null, 2));
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
|
@ -86,13 +91,9 @@ export function getConfigTsPath(): string {
|
|||
return p;
|
||||
}
|
||||
|
||||
export function getConfigJsPath(node: boolean): string {
|
||||
export function getConfigJsPath(): string {
|
||||
// Do not create automatically
|
||||
return path.join(
|
||||
getContinueGlobalPath(),
|
||||
"out",
|
||||
`config${node ? ".node" : ""}.js`
|
||||
);
|
||||
return path.join(getContinueGlobalPath(), "out", "config.js");
|
||||
}
|
||||
|
||||
export function getTsConfigPath(): string {
|
||||
|
|
@ -210,3 +211,16 @@ export function getConfigJsonPathForRemote(remoteConfigServerUrl: URL): string {
|
|||
export function getConfigJsPathForRemote(remoteConfigServerUrl: URL): string {
|
||||
return path.join(getPathToRemoteConfig(remoteConfigServerUrl), "config.js");
|
||||
}
|
||||
|
||||
export function getContinueDotEnv(): { [key: string]: string } {
|
||||
const filepath = path.join(getContinueGlobalPath(), ".env");
|
||||
if (fs.existsSync(filepath)) {
|
||||
return dotenv.parse(fs.readFileSync(filepath));
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
export function getCoreLogsPath(): string {
|
||||
return path.join(getContinueGlobalPath(), "core.log");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,14 +19,18 @@ export class Telemetry {
|
|||
if (!allow) {
|
||||
Telemetry.client = undefined;
|
||||
} else {
|
||||
if (!Telemetry.client) {
|
||||
const { PostHog } = await import("posthog-node");
|
||||
Telemetry.client = new PostHog(
|
||||
"phc_JS6XFROuNbhJtVCEdTSYk6gl5ArRrTNMpCcguAXlSPs",
|
||||
{
|
||||
host: "https://app.posthog.com",
|
||||
}
|
||||
);
|
||||
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}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import * as path from "path";
|
||||
import Parser from "web-tree-sitter";
|
||||
import Parser, { init, Language } from "web-tree-sitter";
|
||||
|
||||
export const supportedLanguages: { [key: string]: string } = {
|
||||
cpp: "cpp",
|
||||
|
|
@ -68,7 +68,7 @@ export const supportedLanguages: { [key: string]: string } = {
|
|||
};
|
||||
|
||||
export async function getParserForFile(filepath: string) {
|
||||
await Parser.init();
|
||||
await init();
|
||||
const parser = new Parser();
|
||||
const extension = path.extname(filepath).slice(1);
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ export async function getParserForFile(filepath: string) {
|
|||
"tree-sitter-wasms",
|
||||
`tree-sitter-${supportedLanguages[extension]}.wasm`
|
||||
);
|
||||
const Language = await Parser.Language.load(wasmPath);
|
||||
parser.setLanguage(Language);
|
||||
const language = await Language.load(wasmPath);
|
||||
parser.setLanguage(language);
|
||||
return parser;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,16 @@
|
|||
import { ContextItemWithId, DiffLine, ILLM, SlashCommand } from "../..";
|
||||
import { DiffLine, ILLM } from "..";
|
||||
import {
|
||||
filterCodeBlockLines,
|
||||
filterEnglishLinesAtEnd,
|
||||
filterEnglishLinesAtStart,
|
||||
filterLeadingAndTrailingNewLineInsertion,
|
||||
fixCodeLlamaFirstLineIndentation,
|
||||
} from "../../autocomplete/lineStream";
|
||||
import { streamDiff } from "../../diff/streamDiff";
|
||||
import { streamLines } from "../../diff/util";
|
||||
import { stripImages } from "../../llm/countTokens";
|
||||
import { gptEditPrompt } from "../../llm/templates/edit";
|
||||
import {
|
||||
dedentAndGetCommonWhitespace,
|
||||
getMarkdownLanguageTagForFile,
|
||||
renderPromptTemplate,
|
||||
} from "../../util";
|
||||
import {
|
||||
RangeInFileWithContents,
|
||||
contextItemToRangeInFileWithContents,
|
||||
} from "../util";
|
||||
} from "../autocomplete/lineStream";
|
||||
import { streamDiff } from "../diff/streamDiff";
|
||||
import { streamLines } from "../diff/util";
|
||||
import { stripImages } from "../llm/countTokens";
|
||||
import { gptEditPrompt } from "../llm/templates/edit";
|
||||
import { dedentAndGetCommonWhitespace, renderPromptTemplate } from "../util";
|
||||
|
||||
function constructPrompt(
|
||||
codeToEdit: string,
|
||||
|
|
@ -87,38 +79,3 @@ export async function* streamDiffLines(
|
|||
yield diffLine;
|
||||
}
|
||||
}
|
||||
|
||||
const VerticalEditSlashCommand: SlashCommand = {
|
||||
name: "verticalEdit",
|
||||
description: "Edit selected code with vertical diff",
|
||||
run: async function* ({ ide, llm, input, contextItems }) {
|
||||
const contextItemToEdit = contextItems.find(
|
||||
(item: ContextItemWithId) =>
|
||||
item.editing && item.id.providerTitle === "code"
|
||||
);
|
||||
|
||||
if (!contextItemToEdit) {
|
||||
yield "Highlight the code that you want to edit first";
|
||||
return;
|
||||
}
|
||||
|
||||
const rif: RangeInFileWithContents =
|
||||
contextItemToRangeInFileWithContents(contextItemToEdit);
|
||||
const startLine = rif.range.start.line;
|
||||
const endLine = rif.range.end.line;
|
||||
const filepath = rif.filepath;
|
||||
|
||||
const diffLineGenerator = streamDiffLines(
|
||||
rif.contents,
|
||||
llm,
|
||||
input,
|
||||
getMarkdownLanguageTagForFile(rif.filepath)
|
||||
);
|
||||
|
||||
for await (const diffLine of diffLineGenerator) {
|
||||
await ide.verticalDiffUpdate(filepath, startLine, endLine, diffLine);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default VerticalEditSlashCommand;
|
||||
2
core/vendor/package-lock.json
generated
vendored
2
core/vendor/package-lock.json
generated
vendored
|
|
@ -7,7 +7,7 @@
|
|||
"": {
|
||||
"name": "vendor",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@xenova/transformers": "^2.14.0"
|
||||
}
|
||||
|
|
|
|||
2
core/vendor/package.json
vendored
2
core/vendor/package.json
vendored
|
|
@ -7,7 +7,7 @@
|
|||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@xenova/transformers": "^2.14.0"
|
||||
}
|
||||
|
|
|
|||
103
core/web/webviewProtocol.ts
Normal file
103
core/web/webviewProtocol.ts
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
import {
|
||||
ContextItemWithId,
|
||||
ContinueRcJson,
|
||||
DiffLine,
|
||||
Problem,
|
||||
Range,
|
||||
} from "..";
|
||||
import { RangeInFileWithContents } from "../commands/util";
|
||||
import { Protocol } from "../protocol";
|
||||
|
||||
export type IdeProtocol = {
|
||||
listWorkspaceContents: [undefined, string[]];
|
||||
getWorkspaceDirs: [undefined, string[]];
|
||||
listFolders: [undefined, string[]];
|
||||
writeFile: [{ path: string; contents: string }, void];
|
||||
showVirtualFile: [{ name: string; content: string }, void];
|
||||
getContinueDir: [undefined, string];
|
||||
openFile: [{ path: string }, void];
|
||||
runCommand: [{ command: string }, void];
|
||||
getSearchResults: [{ query: string }, string];
|
||||
subprocess: [{ command: string }, [string, string]];
|
||||
saveFile: [{ filepath: string }, void];
|
||||
readFile: [{ filepath: string }, string];
|
||||
showDiff: [
|
||||
{ filepath: string; newContents: string; stepIndex: number },
|
||||
void,
|
||||
];
|
||||
diffLine: [
|
||||
{
|
||||
diffLine: DiffLine;
|
||||
filepath: string;
|
||||
startLine: number;
|
||||
endLine: number;
|
||||
},
|
||||
void,
|
||||
];
|
||||
getProblems: [{ filepath: string }, Problem[]];
|
||||
getBranch: [{ dir: string }, string];
|
||||
getOpenFiles: [undefined, string[]];
|
||||
getPinnedFiles: [undefined, string[]];
|
||||
showLines: [{ filepath: string; startLine: number; endLine: number }, void];
|
||||
readRangeInFile: [{ filepath: string; range: Range }, string];
|
||||
getDiff: [undefined, string];
|
||||
getWorkspaceConfigs: [undefined, ContinueRcJson[]];
|
||||
getTerminalContents: [undefined, string];
|
||||
isTelemetryEnabled: [undefined, boolean];
|
||||
getUniqueId: [undefined, string];
|
||||
};
|
||||
|
||||
export type WebviewProtocol = Protocol &
|
||||
IdeProtocol & {
|
||||
onLoad: [
|
||||
undefined,
|
||||
{
|
||||
windowId: string;
|
||||
serverUrl: string;
|
||||
workspacePaths: string[];
|
||||
vscMachineId: string;
|
||||
vscMediaUrl: string;
|
||||
},
|
||||
];
|
||||
|
||||
errorPopup: [{ message: string }, void];
|
||||
"index/setPaused": [boolean, void];
|
||||
openUrl: [string, void];
|
||||
applyToCurrentFile: [{ text: string }, void];
|
||||
showTutorial: [undefined, void];
|
||||
showFile: [{ filepath: string }, void];
|
||||
openConfigJson: [undefined, void];
|
||||
|
||||
toggleDevTools: [undefined, void];
|
||||
reloadWindow: [undefined, void];
|
||||
focusEditor: [undefined, void];
|
||||
toggleFullScreen: [undefined, void];
|
||||
};
|
||||
|
||||
export type ReverseWebviewProtocol = {
|
||||
setInactive: [undefined, void];
|
||||
configUpdate: [undefined, void];
|
||||
submitMessage: [{ message: any }, void]; // any -> JSONContent from TipTap
|
||||
addContextItem: [
|
||||
{
|
||||
historyIndex: number;
|
||||
item: ContextItemWithId;
|
||||
},
|
||||
void,
|
||||
];
|
||||
getDefaultModelTitle: [undefined, string];
|
||||
newSessionWithPrompt: [{ prompt: string }, void];
|
||||
userInput: [{ input: string }, void];
|
||||
focusContinueInput: [undefined, void];
|
||||
focusContinueInputWithoutClear: [undefined, void];
|
||||
focusContinueInputWithNewSession: [undefined, void];
|
||||
highlightedCode: [{ rangeInFileWithContents: RangeInFileWithContents }, void];
|
||||
addModel: [undefined, void];
|
||||
openSettings: [undefined, void];
|
||||
viewHistory: [undefined, void];
|
||||
indexProgress: [{ progress: number; desc: string }, void];
|
||||
newSession: [undefined, void];
|
||||
refreshSubmenuItems: [undefined, void];
|
||||
setTheme: [{ theme: any }, void];
|
||||
setColors: [{ [key: string]: string }, void];
|
||||
};
|
||||
247
core/yarn.lock
247
core/yarn.lock
|
|
@ -899,6 +899,13 @@
|
|||
resolved "https://registry.npmjs.org/@types/command-line-usage/-/command-line-usage-5.0.2.tgz"
|
||||
integrity sha512-n7RlEEJ+4x4TS7ZQddTmNSxP+zziEG0TNsMfiRIxcIVXt71ENJ9ojeXmGO3wPoTdn7pJcU2xc3CJYMktNT6DPg==
|
||||
|
||||
"@types/follow-redirects@^1.14.4":
|
||||
version "1.14.4"
|
||||
resolved "https://registry.npmjs.org/@types/follow-redirects/-/follow-redirects-1.14.4.tgz"
|
||||
integrity sha512-GWXfsD0Jc1RWiFmMuMFCpXMzi9L7oPDVwxUnZdg89kDNnqsRfUKXEtUYtA98A6lig1WXH/CYY/fvPW9HuN5fTA==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/graceful-fs@^4.1.3":
|
||||
version "4.1.9"
|
||||
resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz"
|
||||
|
|
@ -1071,7 +1078,21 @@ adf-to-md@^1.1.0:
|
|||
dependencies:
|
||||
eslint-config-nodebb "0.1.1"
|
||||
|
||||
agent-base@^6.0.2, agent-base@6:
|
||||
agent-base@^6.0.2:
|
||||
version "6.0.2"
|
||||
resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz"
|
||||
integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==
|
||||
dependencies:
|
||||
debug "4"
|
||||
|
||||
agent-base@^7.0.2, agent-base@^7.1.0:
|
||||
version "7.1.0"
|
||||
resolved "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz"
|
||||
integrity sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==
|
||||
dependencies:
|
||||
debug "^4.3.4"
|
||||
|
||||
agent-base@6:
|
||||
version "6.0.2"
|
||||
resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz"
|
||||
integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==
|
||||
|
|
@ -1439,6 +1460,11 @@ buffer-from@^1.0.0:
|
|||
resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz"
|
||||
integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
|
||||
|
||||
buffer-writer@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz"
|
||||
integrity sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==
|
||||
|
||||
buffer@^5.5.0:
|
||||
version "5.7.1"
|
||||
resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz"
|
||||
|
|
@ -1685,6 +1711,11 @@ command-line-usage@^7.0.0, command-line-usage@7.0.1:
|
|||
table-layout "^3.0.0"
|
||||
typical "^7.1.1"
|
||||
|
||||
commander@^12.0.0:
|
||||
version "12.0.0"
|
||||
resolved "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz"
|
||||
integrity sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
|
||||
|
|
@ -1753,6 +1784,15 @@ data-uri-to-buffer@^4.0.0:
|
|||
resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz"
|
||||
integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==
|
||||
|
||||
dbinfoz@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.npmjs.org/dbinfoz/-/dbinfoz-0.1.4.tgz"
|
||||
integrity sha512-MB56+xS571ip7qoXqxdnOUtXebbWaqoZN+S++W51SQYJRSjQFGEIPucNmxgeQlBGJ1vM4mQNV47wzV6fcrezZg==
|
||||
dependencies:
|
||||
mysql2 "^3.9.1"
|
||||
pg "^8.11.3"
|
||||
sqlite3 "^5.1.7"
|
||||
|
||||
debug@^3.2.7:
|
||||
version "3.2.7"
|
||||
resolved "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz"
|
||||
|
|
@ -1760,7 +1800,7 @@ debug@^3.2.7:
|
|||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@~4.3.1, debug@~4.3.2, debug@4:
|
||||
debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2, debug@4:
|
||||
version "4.3.4"
|
||||
resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz"
|
||||
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
|
||||
|
|
@ -1822,6 +1862,11 @@ delegates@^1.0.0:
|
|||
resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz"
|
||||
integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==
|
||||
|
||||
denque@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz"
|
||||
integrity sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==
|
||||
|
||||
deprecation@^2.0.0:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz"
|
||||
|
|
@ -2414,7 +2459,7 @@ flatted@^3.2.9:
|
|||
resolved "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz"
|
||||
integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==
|
||||
|
||||
follow-redirects@^1.15.4:
|
||||
follow-redirects@^1.15.4, follow-redirects@^1.15.5:
|
||||
version "1.15.5"
|
||||
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz"
|
||||
integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==
|
||||
|
|
@ -2511,6 +2556,13 @@ gauge@^4.0.3:
|
|||
strip-ansi "^6.0.1"
|
||||
wide-align "^1.1.5"
|
||||
|
||||
generate-function@^2.3.1:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz"
|
||||
integrity sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==
|
||||
dependencies:
|
||||
is-property "^1.0.2"
|
||||
|
||||
gensync@^1.0.0-beta.2:
|
||||
version "1.0.0-beta.2"
|
||||
resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz"
|
||||
|
|
@ -2758,6 +2810,14 @@ http-proxy-agent@^4.0.1:
|
|||
agent-base "6"
|
||||
debug "4"
|
||||
|
||||
http-proxy-agent@^7.0.1:
|
||||
version "7.0.1"
|
||||
resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.1.tgz"
|
||||
integrity sha512-My1KCEPs6A0hb4qCVzYp8iEvA8j8YqcvXLZZH8C9OFuTYpYjHE7N2dtG3mRl1HMD4+VGXpF3XcDVcxGBT7yDZQ==
|
||||
dependencies:
|
||||
agent-base "^7.1.0"
|
||||
debug "^4.3.4"
|
||||
|
||||
https-proxy-agent@^5.0.0:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz"
|
||||
|
|
@ -2766,6 +2826,14 @@ https-proxy-agent@^5.0.0:
|
|||
agent-base "6"
|
||||
debug "4"
|
||||
|
||||
https-proxy-agent@^7.0.3:
|
||||
version "7.0.3"
|
||||
resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.3.tgz"
|
||||
integrity sha512-kCnwztfX0KZJSLOBrcL0emLeFako55NWMovvyPP2AjsghNk9RB1yjSI+jVumPHYZsNXegNoqupSW9IY3afSH8w==
|
||||
dependencies:
|
||||
agent-base "^7.0.2"
|
||||
debug "4"
|
||||
|
||||
human-signals@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz"
|
||||
|
|
@ -2778,7 +2846,7 @@ humanize-ms@^1.2.1:
|
|||
dependencies:
|
||||
ms "^2.0.0"
|
||||
|
||||
iconv-lite@^0.6.2:
|
||||
iconv-lite@^0.6.2, iconv-lite@^0.6.3:
|
||||
version "0.6.3"
|
||||
resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz"
|
||||
integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
|
||||
|
|
@ -2964,6 +3032,11 @@ is-path-inside@^3.0.3:
|
|||
resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz"
|
||||
integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==
|
||||
|
||||
is-property@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz"
|
||||
integrity sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==
|
||||
|
||||
is-regex@^1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz"
|
||||
|
|
@ -3532,6 +3605,11 @@ lines-and-columns@^1.1.6:
|
|||
resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz"
|
||||
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
|
||||
|
||||
llama-tokenizer-js@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.npmjs.org/llama-tokenizer-js/-/llama-tokenizer-js-1.1.3.tgz"
|
||||
integrity sha512-+BUgsLCXVQJkjiD/t7PdESLn+yXJIRX/BJfwzVVYfKZ9aN3gsP9xoadBZxKnCxGz2Slby+S7x41gUr2TKNaS4Q==
|
||||
|
||||
llm-code-highlighter@^0.0.13:
|
||||
version "0.0.13"
|
||||
resolved "https://registry.npmjs.org/llm-code-highlighter/-/llm-code-highlighter-0.0.13.tgz"
|
||||
|
|
@ -3587,6 +3665,11 @@ long@^4.0.0:
|
|||
resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz"
|
||||
integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==
|
||||
|
||||
long@^5.2.1:
|
||||
version "5.2.3"
|
||||
resolved "https://registry.npmjs.org/long/-/long-5.2.3.tgz"
|
||||
integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==
|
||||
|
||||
lru-cache@^5.1.1:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz"
|
||||
|
|
@ -3601,6 +3684,16 @@ lru-cache@^6.0.0:
|
|||
dependencies:
|
||||
yallist "^4.0.0"
|
||||
|
||||
lru-cache@^7.14.1:
|
||||
version "7.18.3"
|
||||
resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz"
|
||||
integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==
|
||||
|
||||
lru-cache@^8.0.0:
|
||||
version "8.0.5"
|
||||
resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz"
|
||||
integrity sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==
|
||||
|
||||
make-dir@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz"
|
||||
|
|
@ -3779,6 +3872,27 @@ ms@^2.0.0, ms@^2.1.1, ms@2.1.2:
|
|||
resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz"
|
||||
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
|
||||
|
||||
mysql2@^3.9.1:
|
||||
version "3.9.2"
|
||||
resolved "https://registry.npmjs.org/mysql2/-/mysql2-3.9.2.tgz"
|
||||
integrity sha512-3Cwg/UuRkAv/wm6RhtPE5L7JlPB877vwSF6gfLAS68H+zhH+u5oa3AieqEd0D0/kC3W7qIhYbH419f7O9i/5nw==
|
||||
dependencies:
|
||||
denque "^2.1.0"
|
||||
generate-function "^2.3.1"
|
||||
iconv-lite "^0.6.3"
|
||||
long "^5.2.1"
|
||||
lru-cache "^8.0.0"
|
||||
named-placeholders "^1.1.3"
|
||||
seq-queue "^0.0.5"
|
||||
sqlstring "^2.3.2"
|
||||
|
||||
named-placeholders@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz"
|
||||
integrity sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==
|
||||
dependencies:
|
||||
lru-cache "^7.14.1"
|
||||
|
||||
napi-build-utils@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz"
|
||||
|
|
@ -4096,6 +4210,11 @@ p-try@^2.0.0:
|
|||
resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz"
|
||||
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
|
||||
|
||||
packet-reader@1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz"
|
||||
integrity sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==
|
||||
|
||||
pad-left@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.npmjs.org/pad-left/-/pad-left-2.1.0.tgz"
|
||||
|
|
@ -4155,6 +4274,64 @@ path-parse@^1.0.7:
|
|||
resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz"
|
||||
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
|
||||
|
||||
pg-cloudflare@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz"
|
||||
integrity sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==
|
||||
|
||||
pg-connection-string@^2.6.2:
|
||||
version "2.6.2"
|
||||
resolved "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz"
|
||||
integrity sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==
|
||||
|
||||
pg-int8@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz"
|
||||
integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==
|
||||
|
||||
pg-pool@^3.6.1:
|
||||
version "3.6.1"
|
||||
resolved "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz"
|
||||
integrity sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==
|
||||
|
||||
pg-protocol@^1.6.0:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz"
|
||||
integrity sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==
|
||||
|
||||
pg-types@^2.1.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz"
|
||||
integrity sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==
|
||||
dependencies:
|
||||
pg-int8 "1.0.1"
|
||||
postgres-array "~2.0.0"
|
||||
postgres-bytea "~1.0.0"
|
||||
postgres-date "~1.0.4"
|
||||
postgres-interval "^1.1.0"
|
||||
|
||||
pg@^8.11.3, pg@>=8.0:
|
||||
version "8.11.3"
|
||||
resolved "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz"
|
||||
integrity sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==
|
||||
dependencies:
|
||||
buffer-writer "2.0.0"
|
||||
packet-reader "1.0.0"
|
||||
pg-connection-string "^2.6.2"
|
||||
pg-pool "^3.6.1"
|
||||
pg-protocol "^1.6.0"
|
||||
pg-types "^2.1.0"
|
||||
pgpass "1.x"
|
||||
optionalDependencies:
|
||||
pg-cloudflare "^1.1.1"
|
||||
|
||||
pgpass@1.x:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz"
|
||||
integrity sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==
|
||||
dependencies:
|
||||
split2 "^4.1.0"
|
||||
|
||||
picocolors@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz"
|
||||
|
|
@ -4187,6 +4364,28 @@ possible-typed-array-names@^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==
|
||||
|
||||
postgres-array@~2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz"
|
||||
integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==
|
||||
|
||||
postgres-bytea@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz"
|
||||
integrity sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==
|
||||
|
||||
postgres-date@~1.0.4:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz"
|
||||
integrity sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==
|
||||
|
||||
postgres-interval@^1.1.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz"
|
||||
integrity sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==
|
||||
dependencies:
|
||||
xtend "^4.0.0"
|
||||
|
||||
posthog-node@^3.6.2:
|
||||
version "3.6.2"
|
||||
resolved "https://registry.npmjs.org/posthog-node/-/posthog-node-3.6.2.tgz"
|
||||
|
|
@ -4320,7 +4519,25 @@ react-is@^18.0.0:
|
|||
resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz"
|
||||
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==
|
||||
|
||||
readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0:
|
||||
readable-stream@^3.1.1:
|
||||
version "3.6.2"
|
||||
resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz"
|
||||
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
|
||||
dependencies:
|
||||
inherits "^2.0.3"
|
||||
string_decoder "^1.1.1"
|
||||
util-deprecate "^1.0.1"
|
||||
|
||||
readable-stream@^3.4.0:
|
||||
version "3.6.2"
|
||||
resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz"
|
||||
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
|
||||
dependencies:
|
||||
inherits "^2.0.3"
|
||||
string_decoder "^1.1.1"
|
||||
util-deprecate "^1.0.1"
|
||||
|
||||
readable-stream@^3.6.0:
|
||||
version "3.6.2"
|
||||
resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz"
|
||||
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
|
||||
|
|
@ -4482,6 +4699,11 @@ semver@^7.5.4:
|
|||
dependencies:
|
||||
lru-cache "^6.0.0"
|
||||
|
||||
seq-queue@^0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz"
|
||||
integrity sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==
|
||||
|
||||
set-blocking@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz"
|
||||
|
|
@ -4634,6 +4856,11 @@ source-map@^0.6.0, source-map@^0.6.1:
|
|||
resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz"
|
||||
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
|
||||
|
||||
split2@^4.1.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz"
|
||||
integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==
|
||||
|
||||
sprintf-js@~1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz"
|
||||
|
|
@ -4656,6 +4883,11 @@ sqlite3@^5.1.7:
|
|||
optionalDependencies:
|
||||
node-gyp "8.x"
|
||||
|
||||
sqlstring@^2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz"
|
||||
integrity sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==
|
||||
|
||||
ssri@^8.0.0, ssri@^8.0.1:
|
||||
version "8.0.1"
|
||||
resolved "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz"
|
||||
|
|
@ -5221,6 +5453,11 @@ xmlhttprequest-ssl@~2.0.0:
|
|||
resolved "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz"
|
||||
integrity sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==
|
||||
|
||||
xtend@^4.0.0:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz"
|
||||
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
|
||||
|
||||
y18n@^5.0.5:
|
||||
version "5.0.8"
|
||||
resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz"
|
||||
|
|
|
|||
|
|
@ -137,7 +137,6 @@ assignee = currentUser() AND resolution = Unresolved order by updated DESC
|
|||
|
||||
You can override this query by setting the `issueQuery` parameter.
|
||||
|
||||
|
||||
### Code Outline
|
||||
|
||||
Type '@outline' to reference the outline of all currently open files. The outline of a files consists of only the function and class definitions in the file. Supported file extensions are '.js', '.mjs', '.go', '.c', '.cc', '.cs', '.cpp', '.el', '.ex', '.elm', '.java', '.ml', '.php', '.ql', '.rb', '.rs', '.ts'
|
||||
|
|
@ -154,6 +153,63 @@ Type '@highlights' to reference the 'highlights' from all currently open files.
|
|||
{ "name": "highlights" }
|
||||
```
|
||||
|
||||
### PostgreSQL
|
||||
|
||||
Type `@postgres` to reference the schema of a table, and some sample rows. A dropdown will appear, allowing you to select a specific table, or all tables.
|
||||
|
||||
The only required settings are those for creating the database connection: `host`, `port`, `user`, `password`, and `database`.
|
||||
|
||||
By default, the `schema` filter is set to `public`, and the `sampleRows` is set to 3. You may unset the schema if you want to include tables from all schemas.
|
||||
|
||||
[Here is a short demo.](https://github.com/continuedev/continue/pull/859)
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "postgres",
|
||||
"params": {
|
||||
"host": "localhost",
|
||||
"port": 5436,
|
||||
"user": "myuser",
|
||||
"password": "catsarecool",
|
||||
"database": "animals",
|
||||
"schema": "public",
|
||||
"sampleRows": 3
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Database Tables
|
||||
|
||||
Type `@database` to reference table schemas you can use the drop-down or start typeing table names based off of your configuration. Configuration supports multiple databases, allowing you to specify various connection details for PostgreSQL, MySQL, SQLite. Each connection should include a unique name, the connection_type (e.g., postgres, sqlite), and the necessary connection parameters specific to each database type.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "database",
|
||||
"params": {
|
||||
"connections": [
|
||||
{
|
||||
"name": "examplePostgres",
|
||||
"connection_type": "postgres",
|
||||
"connection": {
|
||||
"user": "username",
|
||||
"host": "localhost",
|
||||
"database": "exampleDB",
|
||||
"password": "yourPassword",
|
||||
"port": 5432
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "exampleSqlite",
|
||||
"connection_type": "sqlite",
|
||||
"connection": {
|
||||
"filename": "/path/to/your/sqlite/database.db"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Requesting Context Providers
|
||||
|
||||
Not seeing what you want? Create an issue [here](https://github.com/continuedev/continue/issues/new?assignees=TyDunn&labels=enhancement&projects=&template=feature-request-%F0%9F%92%AA.md&title=) to request a new ContextProvider.
|
||||
|
|
|
|||
126
docs/static/schemas/config.json
vendored
126
docs/static/schemas/config.json
vendored
|
|
@ -1028,7 +1028,8 @@
|
|||
"docs",
|
||||
"tree",
|
||||
"highlights",
|
||||
"outline"
|
||||
"outline",
|
||||
"postgres"
|
||||
],
|
||||
"markdownEnumDescriptions": [
|
||||
"Reference the contents of the current changes as given by `git diff`",
|
||||
|
|
@ -1046,7 +1047,8 @@
|
|||
"Display a file tree of the current workspace",
|
||||
"Include a repo map showing important code objects",
|
||||
"Displays important snippets of code from the currently open files",
|
||||
"Displays definition lines from the currently open files"
|
||||
"Displays definition lines from the currently open files",
|
||||
"References Postgres table schema and sample rows"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
|
@ -1153,6 +1155,67 @@
|
|||
"required": ["params"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["database"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"connections": {
|
||||
"type": "array",
|
||||
"description": "A list of database connections",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "A unique name for this database connection"
|
||||
},
|
||||
"connection_type": {
|
||||
"type": "string",
|
||||
"description": "The type of database (e.g., 'postgres', 'mysql')",
|
||||
"enum": ["postgres", "mysql", "sqlite"]
|
||||
},
|
||||
"connection": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "string",
|
||||
"description": "The database user name"
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "The host address of the database server"
|
||||
},
|
||||
"database": {
|
||||
"type": "string",
|
||||
"description": "The name of the database to connect to"
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
"description": "The password for the database user"
|
||||
},
|
||||
"port": {
|
||||
"type": "integer",
|
||||
"description": "The port number to connect to at the host"
|
||||
},
|
||||
"filename": {
|
||||
"type": "string",
|
||||
"description": "File location for simple file DB's"
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
},
|
||||
"required": ["name", "type", "connection"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["connections"]
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
|
|
@ -1245,6 +1308,65 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["postgres"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"params": {
|
||||
"properties": {
|
||||
"host": {
|
||||
"title": "Host",
|
||||
"description": "Database host",
|
||||
"default": "localhost",
|
||||
"type": "string"
|
||||
},
|
||||
"port": {
|
||||
"title": "Port",
|
||||
"description": "Database port",
|
||||
"default": 5432,
|
||||
"type": "integer"
|
||||
},
|
||||
"user": {
|
||||
"title": "User",
|
||||
"description": "Database user",
|
||||
"default": "postgres",
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"title": "Password",
|
||||
"description": "Database password",
|
||||
"type": "string"
|
||||
},
|
||||
"database": {
|
||||
"title": "Database",
|
||||
"description": "Database name",
|
||||
"default": "postgres",
|
||||
"type": "string"
|
||||
},
|
||||
"schema": {
|
||||
"title": "Schema",
|
||||
"description": "Database schema",
|
||||
"default": "public",
|
||||
"type": "string"
|
||||
},
|
||||
"sampleRows": {
|
||||
"title": "Sample Rows",
|
||||
"description": "Number of rows to sample from the database",
|
||||
"default": 3,
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["host", "port", "user", "password", "database"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"required": ["name"]
|
||||
|
|
|
|||
3
extensions/intellij/.gitignore
vendored
3
extensions/intellij/.gitignore
vendored
|
|
@ -1 +1,2 @@
|
|||
src/main/resources/webview
|
||||
src/main/resources/webview
|
||||
src/main/resources/bin
|
||||
|
|
@ -79,6 +79,12 @@ koverReport {
|
|||
}
|
||||
|
||||
tasks {
|
||||
prepareSandbox {
|
||||
from("../../pkg/bin") {
|
||||
into("${intellij.pluginName.get()}/core/")
|
||||
}
|
||||
}
|
||||
|
||||
wrapper {
|
||||
gradleVersion = properties("gradleVersion").get()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ pluginGroup = com.github.continuedev.continueintellijextension
|
|||
pluginName = continue-intellij-extension
|
||||
pluginRepositoryUrl = https://github.com/continuedev/continue
|
||||
# SemVer format -> https://semver.org
|
||||
pluginVersion = 0.0.27
|
||||
pluginVersion = 0.0.33
|
||||
|
||||
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
|
||||
pluginSinceBuild = 223
|
||||
|
|
|
|||
|
|
@ -4,13 +4,11 @@ import com.github.continuedev.continueintellijextension.services.ContinuePluginS
|
|||
import com.google.gson.Gson
|
||||
import com.intellij.openapi.actionSystem.AnAction
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.actionSystem.impl.SimpleDataContext
|
||||
import com.intellij.openapi.components.ServiceManager
|
||||
import com.intellij.openapi.ui.DialogWrapper
|
||||
import com.intellij.openapi.ui.Messages
|
||||
import com.intellij.openapi.wm.ToolWindowManager
|
||||
import java.awt.Dimension
|
||||
import java.awt.GridLayout
|
||||
import javax.swing.*
|
||||
import javax.swing.event.DocumentEvent
|
||||
import javax.swing.event.DocumentListener
|
||||
|
|
@ -130,7 +128,7 @@ class QuickTextEntryAction : AnAction() {
|
|||
}
|
||||
|
||||
continuePluginService.continuePluginWindow?.content?.components?.get(0)?.requestFocus()
|
||||
continuePluginService.dispatchCustomEvent(Gson().toJson(mutableMapOf("type" to "focusContinueInput")))
|
||||
continuePluginService.sendToWebview("focusContinueInput", null)
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -179,7 +177,7 @@ class FocusContinueInputWithoutClearAction : AnAction() {
|
|||
|
||||
val continuePluginService = pluginServiceFromActionEvent(e) ?: return
|
||||
continuePluginService.continuePluginWindow?.content?.components?.get(0)?.requestFocus()
|
||||
continuePluginService.dispatchCustomEvent(Gson().toJson(mutableMapOf("type" to "focusContinueInputWithoutClear")))
|
||||
continuePluginService.sendToWebview("focusContinueInputWithoutClear", null)
|
||||
|
||||
continuePluginService.ideProtocolClient?.sendHighlightedCode()
|
||||
}
|
||||
|
|
@ -202,7 +200,7 @@ class FocusContinueInputAction : AnAction() {
|
|||
val continuePluginService = pluginServiceFromActionEvent(e) ?: return
|
||||
|
||||
continuePluginService.continuePluginWindow?.content?.components?.get(0)?.requestFocus()
|
||||
continuePluginService.dispatchCustomEvent(Gson().toJson(mutableMapOf("type" to "focusContinueInput")))
|
||||
continuePluginService.sendToWebview("focusContinueInput", null)
|
||||
|
||||
continuePluginService.ideProtocolClient?.sendHighlightedCode()
|
||||
}
|
||||
|
|
@ -225,7 +223,7 @@ class NewContinueSessionAction : AnAction() {
|
|||
val continuePluginService = pluginServiceFromActionEvent(e) ?: return
|
||||
|
||||
continuePluginService.continuePluginWindow?.content?.components?.get(0)?.requestFocus()
|
||||
continuePluginService.dispatchCustomEvent(Gson().toJson(mutableMapOf("type" to "focusContinueInputWithNewSession")))
|
||||
continuePluginService.sendToWebview("focusContinueInputWithNewSession", null)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -239,6 +237,6 @@ class ViewHistoryAction : AnAction() {
|
|||
|
||||
val continuePluginService = pluginServiceFromActionEvent(e) ?: return
|
||||
|
||||
continuePluginService.dispatchCustomEvent(Gson().toJson(mutableMapOf("type" to "viewHistory")))
|
||||
continuePluginService.sendToWebview("viewHistory", null)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
package com.github.continuedev.continueintellijextension.activities
|
||||
|
||||
import com.github.continuedev.continueintellijextension.constants.getContinueGlobalPath
|
||||
import com.github.continuedev.continueintellijextension.`continue`.startProxyServer
|
||||
import com.github.continuedev.continueintellijextension.`continue`.DefaultTextSelectionStrategy
|
||||
import com.github.continuedev.continueintellijextension.`continue`.IdeProtocolClient
|
||||
import com.github.continuedev.continueintellijextension.`continue`.*
|
||||
import com.github.continuedev.continueintellijextension.listeners.ContinuePluginSelectionListener
|
||||
import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings
|
||||
import com.github.continuedev.continueintellijextension.services.ContinuePluginService
|
||||
|
|
@ -30,7 +28,9 @@ import java.nio.charset.StandardCharsets
|
|||
import java.nio.file.Files
|
||||
import java.nio.file.Paths
|
||||
import javax.swing.*
|
||||
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.ide.plugins.PluginManager
|
||||
import com.intellij.openapi.extensions.PluginId
|
||||
|
||||
class WelcomeDialogWrapper(val project: Project) : DialogWrapper(true) {
|
||||
private var panel: JPanel? = null
|
||||
|
|
@ -78,6 +78,28 @@ class WelcomeDialogWrapper(val project: Project) : DialogWrapper(true) {
|
|||
}
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
|
||||
ApplicationManager.getApplication().invokeLater {
|
||||
if (virtualFile != null) {
|
||||
FileEditorManager.getInstance(project).openFile(virtualFile, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ContinuePluginStartupActivity : StartupActivity, Disposable, DumbAware {
|
||||
private val coroutineScope = CoroutineScope(Dispatchers.IO)
|
||||
|
||||
|
|
@ -121,6 +143,8 @@ class ContinuePluginStartupActivity : StartupActivity, Disposable, DumbAware {
|
|||
ContinuePluginService::class.java
|
||||
)
|
||||
|
||||
val theme = GetTheme().getTheme()
|
||||
|
||||
val defaultStrategy = DefaultTextSelectionStrategy()
|
||||
|
||||
coroutineScope.launch {
|
||||
|
|
@ -129,24 +153,7 @@ class ContinuePluginStartupActivity : StartupActivity, Disposable, DumbAware {
|
|||
if (!settings.continueState.shownWelcomeDialog) {
|
||||
settings.continueState.shownWelcomeDialog = true
|
||||
// Open continue_tutorial.py
|
||||
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)
|
||||
|
||||
if (virtualFile != null) {
|
||||
ApplicationManager.getApplication().invokeLater {
|
||||
FileEditorManager.getInstance(project).openFile(virtualFile, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
showTutorial(project)
|
||||
|
||||
// Show the welcome dialog
|
||||
// withContext(Dispatchers.Main) {
|
||||
|
|
@ -156,17 +163,17 @@ class ContinuePluginStartupActivity : StartupActivity, Disposable, DumbAware {
|
|||
// settings.continueState.shownWelcomeDialog = true
|
||||
}
|
||||
|
||||
GlobalScope.async(Dispatchers.IO) {
|
||||
val ideProtocolClient = IdeProtocolClient(
|
||||
val ideProtocolClient = IdeProtocolClient(
|
||||
continuePluginService,
|
||||
defaultStrategy,
|
||||
coroutineScope,
|
||||
project.basePath,
|
||||
project
|
||||
)
|
||||
)
|
||||
|
||||
continuePluginService.ideProtocolClient = ideProtocolClient
|
||||
continuePluginService.ideProtocolClient = ideProtocolClient
|
||||
|
||||
GlobalScope.async(Dispatchers.IO) {
|
||||
val listener =
|
||||
ContinuePluginSelectionListener(
|
||||
ideProtocolClient,
|
||||
|
|
@ -193,6 +200,34 @@ class ContinuePluginStartupActivity : StartupActivity, Disposable, DumbAware {
|
|||
}
|
||||
}
|
||||
|
||||
GlobalScope.async(Dispatchers.IO) {
|
||||
val myPluginId = "com.github.continuedev.continueintellijextension"
|
||||
val pluginDescriptor = PluginManager.getPlugin(PluginId.getId(myPluginId))
|
||||
|
||||
if (pluginDescriptor == null) {
|
||||
throw Exception("Plugin not found")
|
||||
}
|
||||
val pluginPath = pluginDescriptor.pluginPath
|
||||
val osName = System.getProperty("os.name").toLowerCase()
|
||||
val os = when {
|
||||
osName.contains("mac") || osName.contains("darwin") -> "darwin"
|
||||
osName.contains("win") -> "win32"
|
||||
osName.contains("nix") || osName.contains("nux") || osName.contains("aix") -> "linux"
|
||||
else -> "linux"
|
||||
}
|
||||
val osArch = System.getProperty("os.arch").toLowerCase()
|
||||
val arch = when {
|
||||
osArch.contains("aarch64") || (osArch.contains("arm") && osArch.contains("64")) -> "arm64"
|
||||
osArch.contains("amd64") || osArch.contains("x86_64") -> "x64"
|
||||
else -> "x64"
|
||||
}
|
||||
val target = "$os-$arch"
|
||||
|
||||
val continueCorePath = Paths.get(pluginPath.toString(), "core", target, "pkg").toString()
|
||||
|
||||
val coreMessenger = CoreMessenger(continueCorePath, ideProtocolClient);
|
||||
continuePluginService.coreMessenger = coreMessenger
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
package com.github.continuedev.continueintellijextension.`continue`
|
||||
|
||||
import com.github.continuedev.continueintellijextension.activities.ContinuePluginStartupActivity
|
||||
import com.github.continuedev.continueintellijextension.constants.getContinueGlobalPath
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.io.StreamUtil
|
||||
import com.intellij.openapi.vfs.LocalFileSystem
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.jetbrains.jsonSchema.extension.JsonSchemaFileProvider
|
||||
import com.jetbrains.jsonSchema.extension.JsonSchemaProviderFactory
|
||||
import com.jetbrains.jsonSchema.extension.SchemaType
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.nio.charset.StandardCharsets
|
||||
import java.nio.file.Paths
|
||||
|
||||
class ConfigJsonSchemaProviderFactory : JsonSchemaProviderFactory {
|
||||
override fun getProviders(project: Project): MutableList<JsonSchemaFileProvider> {
|
||||
return mutableListOf(ConfigJsonSchemaFileProvider())
|
||||
}
|
||||
}
|
||||
|
||||
class ConfigJsonSchemaFileProvider : JsonSchemaFileProvider {
|
||||
override fun isAvailable(file: VirtualFile): Boolean {
|
||||
return file.name == "config.json"
|
||||
}
|
||||
|
||||
override fun getName(): String {
|
||||
return "config.json"
|
||||
}
|
||||
|
||||
override fun getSchemaFile(): VirtualFile? {
|
||||
ContinuePluginStartupActivity::class.java.getClassLoader().getResourceAsStream("config_schema.json").use { `is` ->
|
||||
if (`is` == null) {
|
||||
throw IOException("Resource not found: config_schema.json")
|
||||
}
|
||||
val content = StreamUtil.readText(`is`, StandardCharsets.UTF_8)
|
||||
val filepath = Paths.get(getContinueGlobalPath(), "config_schema.json").toString()
|
||||
File(filepath).writeText(content)
|
||||
return LocalFileSystem.getInstance().findFileByPath(filepath)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getSchemaType(): SchemaType {
|
||||
return SchemaType.embeddedSchema
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
package com.github.continuedev.continueintellijextension.`continue`
|
||||
import java.io.BufferedReader
|
||||
import java.io.InputStreamReader
|
||||
import java.io.OutputStreamWriter
|
||||
|
||||
import java.io.*
|
||||
|
||||
import com.google.gson.Gson
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Paths
|
||||
import java.nio.file.attribute.PosixFilePermission
|
||||
|
||||
class CoreMessenger(continueCorePath: String, ideProtocolClient: IdeProtocolClient) {
|
||||
private val writer: OutputStreamWriter
|
||||
private val reader: BufferedReader
|
||||
private val process: Process
|
||||
private val gson = Gson()
|
||||
private val responseListeners = mutableMapOf<String, (String) -> Unit>()
|
||||
private val ideProtocolClient = ideProtocolClient
|
||||
|
||||
private fun write(message: String) {
|
||||
writer.write(message + "\r\n")
|
||||
writer.flush()
|
||||
}
|
||||
|
||||
private fun close() {
|
||||
writer.close()
|
||||
reader.close()
|
||||
val exitCode = process.waitFor()
|
||||
println("Subprocess exited with code: $exitCode")
|
||||
}
|
||||
|
||||
fun request(messageType: String, data: Any?, messageId: String?, onResponse: (String) -> Unit) {
|
||||
val id = messageId ?: uuid()
|
||||
val message = gson.toJson(mapOf(
|
||||
"messageId" to id,
|
||||
"messageType" to messageType,
|
||||
"data" to data
|
||||
))
|
||||
responseListeners[id] = onResponse
|
||||
write(message)
|
||||
}
|
||||
|
||||
private fun handleMessage(json: String) {
|
||||
val responseMap = gson.fromJson(json, Map::class.java)
|
||||
val messageId = responseMap["messageId"].toString()
|
||||
val messageType = responseMap["messageType"].toString()
|
||||
val data = gson.toJson(responseMap["data"])
|
||||
|
||||
// IDE listeners
|
||||
if (ideMessageTypes.contains(messageType)) {
|
||||
ideProtocolClient.handleMessage(json) { data ->
|
||||
val message = gson.toJson(mapOf(
|
||||
"messageId" to messageId,
|
||||
"messageType" to messageType,
|
||||
"data" to data
|
||||
))
|
||||
write(message)
|
||||
};
|
||||
}
|
||||
|
||||
// Responses for messageId
|
||||
responseListeners[messageId]?.let { listener ->
|
||||
listener(data)
|
||||
if (generatorTypes.contains(messageType)) {
|
||||
val parsedData = gson.fromJson(data, Map::class.java)
|
||||
val done = parsedData["done"] as Boolean?
|
||||
if (done == true) {
|
||||
responseListeners.remove(messageId)
|
||||
} else {}
|
||||
} else {
|
||||
responseListeners.remove(messageId)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private val generatorTypes = listOf(
|
||||
"llm/streamComplete",
|
||||
"llm/streamChat",
|
||||
"command/run"
|
||||
)
|
||||
|
||||
private val ideMessageTypes = listOf(
|
||||
"readRangeInFile",
|
||||
"isTelemetryEnabled",
|
||||
"getUniqueId",
|
||||
"getWorkspaceConfigs",
|
||||
"getDiff",
|
||||
"getTerminalContents",
|
||||
"listWorkspaceContents",
|
||||
"getWorkspaceDirs",
|
||||
"showLines",
|
||||
"listFolders",
|
||||
"getContinueDir",
|
||||
"writeFile",
|
||||
"showVirtualFile",
|
||||
"openFile",
|
||||
"runCommand",
|
||||
"saveFile",
|
||||
"readFile",
|
||||
"showDiff",
|
||||
"getOpenFiles",
|
||||
"getPinnedFiles",
|
||||
"getSearchResults",
|
||||
"getProblems",
|
||||
"subprocess",
|
||||
"getBranch",
|
||||
"getIdeInfo"
|
||||
)
|
||||
|
||||
private fun setPermissions(destination: String) {
|
||||
val osName = System.getProperty("os.name").toLowerCase()
|
||||
if (osName.contains("mac") || osName.contains("darwin")) {
|
||||
ProcessBuilder(
|
||||
"xattr",
|
||||
"-dr",
|
||||
"com.apple.quarantine",
|
||||
destination
|
||||
).start()
|
||||
setFilePermissions(destination, "rwxr-xr-x")
|
||||
} else if (osName.contains("nix") || osName.contains("nux") || osName.contains("mac")) {
|
||||
setFilePermissions(destination, "rwxr-xr-x")
|
||||
}
|
||||
}
|
||||
|
||||
private fun setFilePermissions(path: String, posixPermissions: String) {
|
||||
val perms = HashSet<PosixFilePermission>()
|
||||
if (posixPermissions.contains("r")) perms.add(PosixFilePermission.OWNER_READ)
|
||||
if (posixPermissions.contains("w")) perms.add(PosixFilePermission.OWNER_WRITE)
|
||||
if (posixPermissions.contains("x")) perms.add(PosixFilePermission.OWNER_EXECUTE)
|
||||
Files.setPosixFilePermissions(Paths.get(path), perms)
|
||||
}
|
||||
|
||||
init {
|
||||
// Set proper permissions
|
||||
setPermissions(continueCorePath)
|
||||
|
||||
// Start the subprocess
|
||||
val processBuilder = ProcessBuilder(continueCorePath)
|
||||
process = processBuilder.start()
|
||||
|
||||
val outputStream = process.outputStream
|
||||
val inputStream = process.inputStream
|
||||
|
||||
writer = OutputStreamWriter(outputStream)
|
||||
reader = BufferedReader(InputStreamReader(inputStream))
|
||||
|
||||
process.onExit().thenRun {
|
||||
val err = process.errorStream.bufferedReader().readText()
|
||||
ideProtocolClient.showMessage("Core process exited with output: $err")
|
||||
}
|
||||
|
||||
Thread {
|
||||
try {
|
||||
while (true) {
|
||||
val line = reader.readLine()
|
||||
if (line != null && line.isNotEmpty()) {
|
||||
handleMessage(line)
|
||||
} else {
|
||||
Thread.sleep(100)
|
||||
}
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
} finally {
|
||||
try {
|
||||
reader.close()
|
||||
writer.close()
|
||||
outputStream.close()
|
||||
inputStream.close()
|
||||
process.destroy()
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.github.continuedev.continueintellijextension.`continue`
|
||||
import com.intellij.codeInsight.template.impl.TemplateColors
|
||||
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors
|
||||
import com.intellij.openapi.editor.colors.EditorColors
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager
|
||||
import com.intellij.openapi.editor.colors.EditorColorsScheme
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
|
||||
class GetTheme {
|
||||
fun getTheme(): Map<String, String> {
|
||||
val globalScheme = EditorColorsManager.getInstance().globalScheme
|
||||
val defaultBackground = globalScheme.defaultBackground
|
||||
val defaultForeground = globalScheme.defaultForeground
|
||||
val highlight = globalScheme.getColor(EditorColors.MODIFIED_TAB_ICON_COLOR) ?: defaultForeground
|
||||
val defaultBackgroundHex = String.format("#%02x%02x%02x", defaultBackground.red, defaultBackground.green, defaultBackground.blue)
|
||||
val defaultForegroundHex = String.format("#%02x%02x%02x", defaultForeground.red, defaultForeground.green, defaultForeground.blue)
|
||||
val highlightHex = String.format("#%02x%02x%02x", highlight.red, highlight.green, highlight.blue)
|
||||
|
||||
val grayscale = (defaultBackground.red * 0.3 + defaultBackground.green * 0.59 + defaultBackground.blue * 0.11).toInt()
|
||||
|
||||
val adjustedRed: Int
|
||||
val adjustedGreen: Int
|
||||
val adjustedBlue: Int
|
||||
|
||||
val tint: Int = 20
|
||||
if (grayscale > 128) { // if closer to white
|
||||
adjustedRed = max(0, defaultBackground.red - tint)
|
||||
adjustedGreen = max(0, defaultBackground.green - tint)
|
||||
adjustedBlue = max(0, defaultBackground.blue - tint)
|
||||
} else { // if closer to black
|
||||
adjustedRed = min(255, defaultBackground.red + tint)
|
||||
adjustedGreen = min(255, defaultBackground.green + tint)
|
||||
adjustedBlue = min(255, defaultBackground.blue + tint)
|
||||
}
|
||||
|
||||
val secondaryDarkHex = String.format("#%02x%02x%02x", adjustedRed, adjustedGreen, adjustedBlue)
|
||||
|
||||
return mapOf(
|
||||
"--vscode-editor-foreground" to defaultForegroundHex,
|
||||
"--vscode-sideBar-background" to defaultBackgroundHex,
|
||||
"--vscode-input-background" to secondaryDarkHex,
|
||||
"--vscode-editor-background" to defaultBackgroundHex,
|
||||
"--vscode-button-background" to defaultBackgroundHex,
|
||||
"--vscode-list-activeSelectionBackground" to defaultBackgroundHex,
|
||||
"--vscode-focusBorder" to highlightHex,
|
||||
"--vscode-quickInputList-focusForeground" to defaultForegroundHex,
|
||||
"--vscode-quickInput-background" to secondaryDarkHex,
|
||||
"--vscode-input-border" to "#80808080",
|
||||
"--vscode-badge-background" to highlightHex,
|
||||
"--vscode-badge-foreground" to defaultForegroundHex,
|
||||
"--vscode-sideBar-border" to "#80808080"
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,28 +1,19 @@
|
|||
package com.github.continuedev.continueintellijextension.`continue`
|
||||
|
||||
import com.github.continuedev.continueintellijextension.*
|
||||
import com.github.continuedev.continueintellijextension.constants.*
|
||||
import com.github.continuedev.continueintellijextension.services.ContinuePluginService
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.GsonBuilder
|
||||
import com.google.gson.JsonObject
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.intellij.execution.ExecutionManager
|
||||
import com.intellij.execution.process.ProcessAdapter
|
||||
import com.intellij.execution.process.ProcessEvent
|
||||
import com.intellij.execution.ui.RunContentDescriptor
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.application.ApplicationInfo
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.components.ServiceManager
|
||||
import com.intellij.openapi.editor.SelectionModel
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager
|
||||
import com.intellij.openapi.fileEditor.TextEditor
|
||||
import com.intellij.openapi.project.DumbAware
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.project.ProjectManagerListener
|
||||
import com.intellij.openapi.ui.MessageType
|
||||
import com.intellij.openapi.ui.popup.Balloon
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory
|
||||
|
|
@ -32,15 +23,10 @@ import com.intellij.openapi.wm.WindowManager
|
|||
import com.intellij.testFramework.LightVirtualFile
|
||||
import com.intellij.ui.awt.RelativePoint
|
||||
import kotlinx.coroutines.*
|
||||
import net.minidev.json.JSONObject
|
||||
import org.jetbrains.annotations.NotNull
|
||||
import java.io.*
|
||||
import java.net.NetworkInterface
|
||||
import java.nio.charset.Charset
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Paths
|
||||
import java.util.*
|
||||
import kotlin.coroutines.ContinuationInterceptor
|
||||
|
||||
|
||||
fun uuid(): String {
|
||||
|
|
@ -103,7 +89,7 @@ class AsyncFileSaveListener : AsyncFileListener {
|
|||
}
|
||||
override fun prepareChange(events: MutableList<out VFileEvent>): AsyncFileListener.ChangeApplier? {
|
||||
for (event in events) {
|
||||
if (event.path.endsWith(".continue/config.json") || event.path.endsWith(".continue/config.ts") || event.path.endsWith(".continue\\config.json") || event.path.endsWith(".continue\\config.ts")) {
|
||||
if (event.path.endsWith(".continue/config.json") || event.path.endsWith(".continue/config.ts") || event.path.endsWith(".continue\\config.json") || event.path.endsWith(".continue\\config.ts") || event.path.endsWith(".continuerc.json")) {
|
||||
return object : AsyncFileListener.ChangeApplier {
|
||||
override fun afterVfsChange() {
|
||||
val config = readConfigJson()
|
||||
|
|
@ -137,35 +123,21 @@ class IdeProtocolClient (
|
|||
|
||||
private fun send(messageType: String, data: Any?, messageId: String? = null) {
|
||||
val id = messageId ?: uuid()
|
||||
val message = IdeMessage(
|
||||
messageType,
|
||||
id,
|
||||
data
|
||||
)
|
||||
val json = Gson().toJson(message)
|
||||
continuePluginService.dispatchCustomEvent(json)
|
||||
continuePluginService.sendToWebview(messageType, data, id)
|
||||
}
|
||||
|
||||
fun handleWebsocketMessage(text: String) {
|
||||
fun handleMessage(text: String, respond: (Any?) -> Unit) {
|
||||
coroutineScope.launch(Dispatchers.IO) {
|
||||
val parsedMessage: Map<String, Any> = Gson().fromJson(
|
||||
text,
|
||||
object : TypeToken<Map<String, Any>>() {}.type
|
||||
)
|
||||
val messageType = parsedMessage["type"] as? String
|
||||
val messageType = parsedMessage["messageType"] as? String
|
||||
if (messageType == null) {
|
||||
println("Recieved message without type: $text")
|
||||
return@launch
|
||||
}
|
||||
val data = parsedMessage["data"] as Map<*, *>
|
||||
|
||||
fun respond(responseData: Any?) {
|
||||
if (data["messageId"] == null) {
|
||||
println("Recieved message without messageId: $text")
|
||||
return
|
||||
}
|
||||
send(messageType, responseData ?: emptyMap<String, String>(), data["messageId"] as String);
|
||||
}
|
||||
val data = parsedMessage["data"]
|
||||
|
||||
val historyManager = HistoryManager()
|
||||
|
||||
|
|
@ -175,7 +147,7 @@ class IdeProtocolClient (
|
|||
mapOf("uniqueId" to uniqueId())
|
||||
)
|
||||
|
||||
"ide" -> {
|
||||
"getIdeInfo" -> {
|
||||
val applicationInfo = ApplicationInfo.getInstance()
|
||||
val ideName: String = applicationInfo.fullApplicationName
|
||||
val ideVersion = applicationInfo.fullVersion
|
||||
|
|
@ -187,14 +159,19 @@ class IdeProtocolClient (
|
|||
remoteName = "ssh"
|
||||
}
|
||||
respond(mapOf(
|
||||
"ideType" to "jetbrains",
|
||||
"name" to ideName,
|
||||
"version" to ideVersion,
|
||||
"remoteName" to remoteName
|
||||
))
|
||||
}
|
||||
|
||||
"getUniqueId" -> {
|
||||
respond(uniqueId())
|
||||
}
|
||||
|
||||
"showDiff" -> {
|
||||
val data = data["message"] as Map<String, Any>
|
||||
val data = data as Map<String, Any>
|
||||
diffManager.showDiff(
|
||||
data["filepath"] as String,
|
||||
data["newContents"] as String,
|
||||
|
|
@ -204,10 +181,31 @@ class IdeProtocolClient (
|
|||
}
|
||||
|
||||
"readFile" -> {
|
||||
val msg = readFile((data["message"] as Map<String, String>)["filepath"] as String)
|
||||
val msg = readFile((data as Map<String, String>)["filepath"] as String)
|
||||
respond(msg)
|
||||
}
|
||||
|
||||
"isTelemetryEnabled" -> {
|
||||
respond(true)
|
||||
}
|
||||
|
||||
"readRangeInFile" -> {
|
||||
val fullContents = readFile((data as Map<String, String>)["filepath"] as String)
|
||||
val range = data["range"] as Map<String, Any>
|
||||
val start = range["start"] as Map<String, Any>
|
||||
val end = range["end"] as Map<String, Any>
|
||||
val startLine = start["line"] as Int
|
||||
val startCharacter = start["character"] as Int
|
||||
val endLine = end["line"] as Int
|
||||
val endCharacter = end["character"] as Int
|
||||
|
||||
val firstLine = fullContents.split("\n")[startLine].slice(startCharacter until fullContents.split("\n")[startLine].length)
|
||||
val lastLine = fullContents.split("\n")[endLine].slice(0 until endCharacter)
|
||||
val between = fullContents.split("\n").slice(startLine + 1 until endLine).joinToString("\n")
|
||||
|
||||
respond(firstLine + "\n" + between + "\n" + lastLine)
|
||||
}
|
||||
|
||||
"listWorkspaceContents" -> {
|
||||
respond(listDirectoryContents(null))
|
||||
}
|
||||
|
|
@ -216,6 +214,10 @@ class IdeProtocolClient (
|
|||
respond(workspaceDirectories())
|
||||
}
|
||||
|
||||
"getWorkspaceConfigs" -> {
|
||||
respond(emptyList<String>())
|
||||
}
|
||||
|
||||
"getTerminalContents" -> {
|
||||
respond(
|
||||
mapOf("contents" to "Terminal cannot be accessed in JetBrains IDE")
|
||||
|
|
@ -229,10 +231,11 @@ class IdeProtocolClient (
|
|||
}
|
||||
|
||||
"saveFile" -> {
|
||||
saveFile((data["message"] as Map<String, String>)["filepath"] ?: throw Exception("No filepath provided"))
|
||||
saveFile((data as Map<String, String>)["filepath"] ?: throw Exception("No filepath provided"))
|
||||
respond(null)
|
||||
}
|
||||
"showVirtualFile" -> {
|
||||
val data = data as Map<String, Any>
|
||||
showVirtualFile(
|
||||
data["name"] as String,
|
||||
data["contents"] as String
|
||||
|
|
@ -242,10 +245,11 @@ class IdeProtocolClient (
|
|||
|
||||
"connected" -> {}
|
||||
"showMessage" -> {
|
||||
showMessage(data["message"] as String)
|
||||
showMessage(data as String)
|
||||
respond(null)
|
||||
}
|
||||
"setFileOpen" -> {
|
||||
val data = data as Map<String, Any>
|
||||
setFileOpen(
|
||||
data["filepath"] as String,
|
||||
data["open"] as Boolean
|
||||
|
|
@ -253,8 +257,27 @@ class IdeProtocolClient (
|
|||
respond(null)
|
||||
}
|
||||
|
||||
"showLines" -> {
|
||||
val data = data as Map<String, Any>
|
||||
val filepath = data["filepath"] as String
|
||||
val startLine = data["startLine"] as Int
|
||||
val endLine = data["endLine"] as Int
|
||||
highlightCode(
|
||||
RangeInFile(
|
||||
filepath,
|
||||
Range(
|
||||
Position(startLine, 0),
|
||||
Position(endLine, 0)
|
||||
)
|
||||
),
|
||||
data["color"] as String
|
||||
)
|
||||
respond(null)
|
||||
}
|
||||
|
||||
"highlightCode" -> {
|
||||
val gson = Gson()
|
||||
val data = data as Map<String, Any>
|
||||
val json = gson.toJson(data["rangeInFile"])
|
||||
val type = object : TypeToken<RangeInFile>() {}.type
|
||||
val rangeInFile =
|
||||
|
|
@ -265,16 +288,6 @@ class IdeProtocolClient (
|
|||
|
||||
"setSuggestionsLocked" -> {}
|
||||
"getSessionId" -> {}
|
||||
"highlightedCode" -> {
|
||||
val rifWithContents = getHighlightedCode()
|
||||
val rifs: MutableList<RangeInFile> = mutableListOf()
|
||||
if (rifWithContents != null) {
|
||||
val rif = RangeInFile(rifWithContents.filepath, rifWithContents.range)
|
||||
rifs += rif
|
||||
}
|
||||
respond(mapOf("highlightedCode" to rifs))
|
||||
}
|
||||
|
||||
|
||||
// NEW //
|
||||
"getDiff" -> {
|
||||
|
|
@ -295,29 +308,6 @@ class IdeProtocolClient (
|
|||
|
||||
respond(output.toString());
|
||||
}
|
||||
"getSerializedConfig" -> {
|
||||
val configPath = getConfigJsonPath()
|
||||
var config = File(configPath).readText()
|
||||
|
||||
migrate("camelCaseConfig") {
|
||||
if (config.contains("_")) {
|
||||
config = config
|
||||
.replace(Regex("(_\\w)")) { it.value[1].uppercase() }
|
||||
.replace("openai-aiohttp", "openai")
|
||||
// Rewrite to config.json
|
||||
File(configPath).writeText(config)
|
||||
}
|
||||
}
|
||||
|
||||
migrate("renameFreeTrialProvider") {
|
||||
config = config.replace("openai-free-trial", "free-trial");
|
||||
File(configPath).writeText(config)
|
||||
}
|
||||
|
||||
val mapType = object : TypeToken<Map<String, Any>>() {}.type
|
||||
val parsed: Map<String, Any> = Gson().fromJson(config, mapType)
|
||||
respond(parsed)
|
||||
}
|
||||
"getConfigJsUrl" -> {
|
||||
// Calculate a data URL for the config.js file
|
||||
val configJsPath = getConfigJsPath()
|
||||
|
|
@ -326,7 +316,7 @@ class IdeProtocolClient (
|
|||
respond(configJsDataUrl)
|
||||
}
|
||||
"writeFile" -> {
|
||||
val msg = data["message"] as Map<String, String>;
|
||||
val msg = data as Map<String, String>;
|
||||
val file = File(msg["path"])
|
||||
file.writeText(msg["contents"] as String)
|
||||
respond(null);
|
||||
|
|
@ -335,7 +325,7 @@ class IdeProtocolClient (
|
|||
respond(getContinueGlobalPath())
|
||||
}
|
||||
"openFile" -> {
|
||||
setFileOpen((data["message"] as Map<String, Any>)["path"] as String)
|
||||
setFileOpen((data as Map<String, Any>)["path"] as String)
|
||||
respond(null)
|
||||
}
|
||||
"runCommand" -> {
|
||||
|
|
@ -343,7 +333,14 @@ class IdeProtocolClient (
|
|||
// Running commands not yet supported in JetBrains
|
||||
}
|
||||
"errorPopup" -> {
|
||||
showMessage(data["message"] as String)
|
||||
val data = data as Map<String, Any>
|
||||
val message = data["message"] as String
|
||||
showMessage(message)
|
||||
respond(null)
|
||||
}
|
||||
|
||||
"listFolders" -> {
|
||||
respond(null)
|
||||
}
|
||||
|
||||
// History
|
||||
|
|
@ -351,15 +348,15 @@ class IdeProtocolClient (
|
|||
respond(historyManager.list());
|
||||
}
|
||||
"saveSession" -> {
|
||||
historyManager.save(data["message"] as PersistedSessionInfo);
|
||||
historyManager.save(data as PersistedSessionInfo);
|
||||
respond(null);
|
||||
}
|
||||
"deleteSession" -> {
|
||||
historyManager.delete(data["message"] as String);
|
||||
historyManager.delete(data as String);
|
||||
respond(null);
|
||||
}
|
||||
"loadSession" -> {
|
||||
val session = historyManager.load(data["message"] as String)
|
||||
val session = historyManager.load(data as String)
|
||||
respond(session)
|
||||
}
|
||||
"getSearchResults" -> {
|
||||
|
|
@ -371,7 +368,12 @@ class IdeProtocolClient (
|
|||
val openFiles = visibleFiles()
|
||||
respond(openFiles)
|
||||
}
|
||||
"getPinnedFiles" -> {
|
||||
val openFiles = visibleFiles()
|
||||
respond(openFiles)
|
||||
}
|
||||
"logDevData" -> {
|
||||
val data = data as Map<String, Any>
|
||||
val filename = data["tableName"] as String
|
||||
val jsonLine = data["data"]
|
||||
val filepath = getDevDataFilepath(filename)
|
||||
|
|
@ -379,6 +381,7 @@ class IdeProtocolClient (
|
|||
File(filepath).appendText(contents)
|
||||
}
|
||||
"addModel" -> {
|
||||
val data = data as Map<String, Any>
|
||||
val model = data["model"] as Map<String, Any>
|
||||
val updatedConfig = editConfigJson {
|
||||
val models = it["models"] as MutableList<Map<String, Any>>
|
||||
|
|
@ -392,7 +395,7 @@ class IdeProtocolClient (
|
|||
"deleteModel" -> {
|
||||
val configJson = editConfigJson { config ->
|
||||
var models: MutableList<Map<String, Any>> = config["models"] as MutableList<Map<String, Any>>
|
||||
|
||||
val data = data as Map<String, Any>
|
||||
val model = data["title"] as String
|
||||
models = models.filter { it["title"] != model }.toMutableList()
|
||||
config["models"] = models
|
||||
|
|
@ -402,6 +405,7 @@ class IdeProtocolClient (
|
|||
}
|
||||
"addOpenAIKey" -> {
|
||||
val updatedConfig = editConfigJson { config ->
|
||||
val data = data as Map<String, Any>
|
||||
val key = data["key"] as String
|
||||
var models = config["models"] as MutableList<MutableMap<String, Any>>
|
||||
models = models.map {
|
||||
|
|
@ -432,12 +436,8 @@ class IdeProtocolClient (
|
|||
}
|
||||
|
||||
fun configUpdate(config: Map<String, Any>) {
|
||||
val data = mapOf(
|
||||
"type" to "configUpdate",
|
||||
"config" to config
|
||||
)
|
||||
val json = Gson().toJson(data)
|
||||
continuePluginService.dispatchCustomEvent(json)
|
||||
continuePluginService.coreMessenger?.request("config/reload", null, null) { _ -> }
|
||||
continuePluginService.sendToWebview("configUpdate", config)
|
||||
}
|
||||
|
||||
private fun editConfigJson(callback: (config: MutableMap<String, Any>) -> Map<String, Any>): Map<String, Any> {
|
||||
|
|
@ -581,20 +581,17 @@ class IdeProtocolClient (
|
|||
// edit
|
||||
// ))
|
||||
|
||||
continuePluginService.dispatchCustomEvent(
|
||||
Gson().toJson(mapOf(
|
||||
"type" to "highlightedCode",
|
||||
continuePluginService.sendToWebview(
|
||||
"highlightedCode",
|
||||
mapOf(
|
||||
"rangeInFileWithContents" to rif,
|
||||
"edit" to edit
|
||||
)))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
fun sendMainUserInput(input: String) {
|
||||
val data = mapOf(
|
||||
"type" to "userInput",
|
||||
"input" to input,
|
||||
)
|
||||
continuePluginService.dispatchCustomEvent(Gson().toJson(data))
|
||||
continuePluginService.sendToWebview("userInput", mapOf("input" to input))
|
||||
}
|
||||
|
||||
fun sendAcceptRejectDiff(accepted: Boolean, stepIndex: Int) {
|
||||
|
|
@ -712,7 +709,7 @@ class IdeProtocolClient (
|
|||
return fileEditorManager.openFiles.toList().map { it.path }
|
||||
}
|
||||
|
||||
private fun showMessage(msg: String) {
|
||||
fun showMessage(msg: String) {
|
||||
val statusBar = WindowManager.getInstance().getStatusBar(project)
|
||||
|
||||
JBPopupFactory.getInstance()
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class CustomResourceHandler : CefResourceHandler, DumbAware {
|
|||
): Boolean {
|
||||
val url = cefRequest.url
|
||||
return if (url != null) {
|
||||
val pathToResource = url.replace("http://continue", "webview/")
|
||||
val pathToResource = url.replace("http://continue", "webview/").replace("http://localhost:5173", "webview/")
|
||||
val newUrl = javaClass.classLoader.getResource(pathToResource)
|
||||
state = OpenedConnection(newUrl?.openConnection())
|
||||
currentUrl = url
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.github.continuedev.continueintellijextension.services
|
||||
|
||||
import com.github.continuedev.continueintellijextension.`continue`.CoreMessenger
|
||||
import com.github.continuedev.continueintellijextension.`continue`.IdeProtocolClient
|
||||
import com.github.continuedev.continueintellijextension.`continue`.uuid
|
||||
import com.github.continuedev.continueintellijextension.toolWindow.ContinuePluginToolWindowFactory
|
||||
import com.google.gson.Gson
|
||||
import com.intellij.openapi.Disposable
|
||||
|
|
@ -20,6 +22,7 @@ class ContinuePluginService(project: Project) : Disposable, DumbAware {
|
|||
var continuePluginWindow: ContinuePluginToolWindowFactory.ContinuePluginWindow? = null
|
||||
|
||||
var ideProtocolClient: IdeProtocolClient? = null
|
||||
var coreMessenger: CoreMessenger? = null
|
||||
var workspacePaths: Array<String>? = null
|
||||
var windowId: String = UUID.randomUUID().toString()
|
||||
|
||||
|
|
@ -33,10 +36,19 @@ class ContinuePluginService(project: Project) : Disposable, DumbAware {
|
|||
}
|
||||
}
|
||||
|
||||
fun dispatchCustomEvent(
|
||||
data: String
|
||||
fun sendToWebview(
|
||||
messageType: String,
|
||||
data: Any?,
|
||||
messageId: String = uuid()
|
||||
) {
|
||||
val jsCode = buildJavaScript(data)
|
||||
val jsonData = Gson().toJson(
|
||||
mapOf(
|
||||
"messageId" to messageId,
|
||||
"messageType" to messageType,
|
||||
"data" to data
|
||||
)
|
||||
)
|
||||
val jsCode = buildJavaScript(jsonData)
|
||||
|
||||
try {
|
||||
continuePluginWindow?.webView?.executeJavaScriptAsync(jsCode)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
package com.github.continuedev.continueintellijextension.toolWindow
|
||||
|
||||
import com.github.continuedev.continueintellijextension.activities.showTutorial
|
||||
import com.github.continuedev.continueintellijextension.constants.getConfigJsonPath
|
||||
import com.github.continuedev.continueintellijextension.`continue`.Position
|
||||
import com.github.continuedev.continueintellijextension.`continue`.Range
|
||||
import com.github.continuedev.continueintellijextension.`continue`.RangeInFile
|
||||
import com.github.continuedev.continueintellijextension.`continue`.getMachineUniqueID
|
||||
import com.github.continuedev.continueintellijextension.`continue`.*
|
||||
import com.github.continuedev.continueintellijextension.factories.CustomSchemeHandlerFactory
|
||||
import com.github.continuedev.continueintellijextension.services.ContinuePluginService
|
||||
import com.google.gson.Gson
|
||||
|
|
@ -55,12 +53,34 @@ class ContinuePluginToolWindowFactory : ToolWindowFactory, DumbAware {
|
|||
|
||||
class ContinuePluginWindow(toolWindow: ToolWindow, project: Project) {
|
||||
|
||||
val PASS_THROUGH_TO_CORE = listOf(
|
||||
"abort",
|
||||
"getContinueDir",
|
||||
"history/list",
|
||||
"history/save",
|
||||
"history/delete",
|
||||
"history/load",
|
||||
"devdata/log",
|
||||
"config/addModel",
|
||||
"config/deleteModel",
|
||||
"config/addOpenAIKey",
|
||||
"llm/streamComplete",
|
||||
"llm/streamChat",
|
||||
"llm/complete",
|
||||
"command/run",
|
||||
"context/loadSubmenuItems",
|
||||
"context/getContextItems",
|
||||
"context/addDocs",
|
||||
"config/getBrowserSerialized",
|
||||
)
|
||||
|
||||
init {
|
||||
System.setProperty("ide.browser.jcef.jsQueryPoolSize", JS_QUERY_POOL_SIZE)
|
||||
System.setProperty("ide.browser.jcef.osr.enabled", "false")
|
||||
}
|
||||
|
||||
val webView: JBCefBrowser by lazy {
|
||||
val browser = JBCefBrowser()
|
||||
val browser = JBCefBrowser.createBuilder().setOffScreenRendering(false).build()
|
||||
browser.jbCefClient.setProperty(
|
||||
JBCefClient.Properties.JS_QUERY_POOL_SIZE,
|
||||
JS_QUERY_POOL_SIZE
|
||||
|
|
@ -68,6 +88,8 @@ class ContinuePluginToolWindowFactory : ToolWindowFactory, DumbAware {
|
|||
registerAppSchemeHandler()
|
||||
|
||||
browser.loadURL("http://continue/index.html")
|
||||
// browser.loadHTML("<html><body><input type='text'/></body></html>")
|
||||
// browser.loadURL("http://localhost:5173/index.html")
|
||||
Disposer.register(project, browser)
|
||||
|
||||
val continuePluginService = ServiceManager.getService(
|
||||
|
|
@ -81,58 +103,46 @@ class ContinuePluginToolWindowFactory : ToolWindowFactory, DumbAware {
|
|||
myJSQueryOpenInBrowser.addHandler { msg: String? ->
|
||||
val parser = JsonParser()
|
||||
val json: JsonObject = parser.parse(msg).asJsonObject
|
||||
val type = json.get("type").asString
|
||||
val data = json.get("data").asJsonObject
|
||||
val messageType = json.get("messageType").asString
|
||||
val data = json.get("data")
|
||||
val messageId = json.get("messageId")?.asString
|
||||
|
||||
val ide = continuePluginService.ideProtocolClient;
|
||||
|
||||
when (type) {
|
||||
val respond = fun(data: Any?) {
|
||||
val jsonData = mutableMapOf(
|
||||
"messageId" to messageId,
|
||||
"data" to data,
|
||||
"messageType" to messageType
|
||||
)
|
||||
val jsonString = Gson().toJson(jsonData)
|
||||
continuePluginService.sendToWebview(messageType, data, messageId ?: uuid())
|
||||
}
|
||||
|
||||
if (PASS_THROUGH_TO_CORE.contains(messageType)) {
|
||||
continuePluginService.coreMessenger?.request(messageType, data, messageId, respond)
|
||||
return@addHandler null
|
||||
}
|
||||
|
||||
when (messageType) {
|
||||
"onLoad" -> {
|
||||
GlobalScope.launch {
|
||||
// Set the colors to match Intellij theme
|
||||
val globalScheme = EditorColorsManager.getInstance().globalScheme
|
||||
val defaultBackground = globalScheme.defaultBackground
|
||||
val defaultForeground = globalScheme.defaultForeground
|
||||
val defaultBackgroundHex = String.format("#%02x%02x%02x", defaultBackground.red, defaultBackground.green, defaultBackground.blue)
|
||||
val defaultForegroundHex = String.format("#%02x%02x%02x", defaultForeground.red, defaultForeground.green, defaultForeground.blue)
|
||||
|
||||
val grayscale = (defaultBackground.red * 0.3 + defaultBackground.green * 0.59 + defaultBackground.blue * 0.11).toInt()
|
||||
|
||||
val adjustedRed: Int
|
||||
val adjustedGreen: Int
|
||||
val adjustedBlue: Int
|
||||
|
||||
val tint: Int = 20
|
||||
if (grayscale > 128) { // if closer to white
|
||||
adjustedRed = max(0, defaultBackground.red - tint)
|
||||
adjustedGreen = max(0, defaultBackground.green - tint)
|
||||
adjustedBlue = max(0, defaultBackground.blue - tint)
|
||||
} else { // if closer to black
|
||||
adjustedRed = min(255, defaultBackground.red + tint)
|
||||
adjustedGreen = min(255, defaultBackground.green + tint)
|
||||
adjustedBlue = min(255, defaultBackground.blue + tint)
|
||||
}
|
||||
|
||||
val secondaryDarkHex = String.format("#%02x%02x%02x", adjustedRed, adjustedGreen, adjustedBlue)
|
||||
|
||||
browser.executeJavaScriptAsync("document.body.style.setProperty(\"--vscode-editor-foreground\", \"$defaultForegroundHex\");")
|
||||
browser.executeJavaScriptAsync("document.body.style.setProperty(\"--vscode-sideBar-background\", \"$defaultBackgroundHex\");")
|
||||
browser.executeJavaScriptAsync("document.body.style.setProperty(\"--vscode-input-background\", \"$secondaryDarkHex\");")
|
||||
browser.executeJavaScriptAsync("document.body.style.setProperty(\"--vscode-editor-background\", \"$defaultBackgroundHex\");")
|
||||
val colors = GetTheme().getTheme();
|
||||
continuePluginService.sendToWebview("setColors", colors)
|
||||
|
||||
val jsonData = mutableMapOf(
|
||||
"type" to "onLoad",
|
||||
"windowId" to continuePluginService.windowId,
|
||||
"workspacePaths" to continuePluginService.workspacePaths,
|
||||
"vscMachineId" to getMachineUniqueID(),
|
||||
"vscMediaUrl" to "http://continue",
|
||||
)
|
||||
val jsonString = Gson().toJson(jsonData)
|
||||
browser.executeJavaScriptAsync("""window.postMessage($jsonString, "*");""")
|
||||
respond(jsonData)
|
||||
}
|
||||
|
||||
}
|
||||
"showLines" -> {
|
||||
val data = data.asJsonObject
|
||||
ide?.highlightCode(RangeInFile(
|
||||
data.get("filepath").asString,
|
||||
Range(Position(
|
||||
|
|
@ -145,10 +155,15 @@ class ContinuePluginToolWindowFactory : ToolWindowFactory, DumbAware {
|
|||
|
||||
),"#00ff0022")
|
||||
}
|
||||
"showTutorial" -> {
|
||||
showTutorial(project)
|
||||
}
|
||||
"showVirtualFile" -> {
|
||||
val data = data.asJsonObject
|
||||
ide?.showVirtualFile(data.get("name").asString, data.get("content").asString)
|
||||
}
|
||||
"showFile" -> {
|
||||
val data = data.asJsonObject
|
||||
ide?.setFileOpen(data.get("filepath").asString)
|
||||
}
|
||||
"reloadWindow" -> {}
|
||||
|
|
@ -156,6 +171,7 @@ class ContinuePluginToolWindowFactory : ToolWindowFactory, DumbAware {
|
|||
ide?.setFileOpen(getConfigJsonPath())
|
||||
}
|
||||
"readRangeInFile" -> {
|
||||
val data = data.asJsonObject
|
||||
ide?.readRangeInFile(RangeInFile(
|
||||
data.get("filepath").asString,
|
||||
Range(Position(
|
||||
|
|
@ -172,7 +188,7 @@ class ContinuePluginToolWindowFactory : ToolWindowFactory, DumbAware {
|
|||
// IDE //
|
||||
else -> {
|
||||
if (msg != null) {
|
||||
ide?.handleWebsocketMessage(msg)
|
||||
ide?.handleMessage(msg, respond)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -201,8 +217,8 @@ class ContinuePluginToolWindowFactory : ToolWindowFactory, DumbAware {
|
|||
|
||||
fun executeJavaScript(browser: CefBrowser?, myJSQueryOpenInBrowser: JBCefJSQuery) {
|
||||
// Execute JavaScript - you might want to handle potential exceptions here
|
||||
val script = """window.postIntellijMessage = function(type, data) {
|
||||
const msg = JSON.stringify({type, data});
|
||||
val script = """window.postIntellijMessage = function(messageType, data, messageId) {
|
||||
const msg = JSON.stringify({messageType, data, messageId});
|
||||
${myJSQueryOpenInBrowser.inject("msg")}
|
||||
}""".trimIndent()
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@
|
|||
<depends>com.intellij.modules.platform</depends>
|
||||
<idea-version since-build="223.0"/>
|
||||
|
||||
<extensions defaultExtensionNs="JavaScript.JsonSchema">
|
||||
<ProviderFactory implementation="com.github.continuedev.continueintellijextension.continue.ConfigJsonSchemaProviderFactory"/>
|
||||
</extensions>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<toolWindow id="Continue" anchor="right" icon="/tool-window-icon.png"
|
||||
factoryClass="com.github.continuedev.continueintellijextension.toolWindow.ContinuePluginToolWindowFactory"/>
|
||||
|
|
|
|||
1571
extensions/intellij/src/main/resources/config_schema.json
Normal file
1571
extensions/intellij/src/main/resources/config_schema.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1028,7 +1028,8 @@
|
|||
"docs",
|
||||
"tree",
|
||||
"highlights",
|
||||
"outline"
|
||||
"outline",
|
||||
"postgres"
|
||||
],
|
||||
"markdownEnumDescriptions": [
|
||||
"Reference the contents of the current changes as given by `git diff`",
|
||||
|
|
@ -1046,7 +1047,8 @@
|
|||
"Display a file tree of the current workspace",
|
||||
"Include a repo map showing important code objects",
|
||||
"Displays important snippets of code from the currently open files",
|
||||
"Displays definition lines from the currently open files"
|
||||
"Displays definition lines from the currently open files",
|
||||
"References Postgres table schema and sample rows"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
|
@ -1153,6 +1155,67 @@
|
|||
"required": ["params"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["database"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"connections": {
|
||||
"type": "array",
|
||||
"description": "A list of database connections",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "A unique name for this database connection"
|
||||
},
|
||||
"connection_type": {
|
||||
"type": "string",
|
||||
"description": "The type of database (e.g., 'postgres', 'mysql')",
|
||||
"enum": ["postgres", "mysql", "sqlite"]
|
||||
},
|
||||
"connection": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "string",
|
||||
"description": "The database user name"
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "The host address of the database server"
|
||||
},
|
||||
"database": {
|
||||
"type": "string",
|
||||
"description": "The name of the database to connect to"
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
"description": "The password for the database user"
|
||||
},
|
||||
"port": {
|
||||
"type": "integer",
|
||||
"description": "The port number to connect to at the host"
|
||||
},
|
||||
"filename": {
|
||||
"type": "string",
|
||||
"description": "File location for simple file DB's"
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
},
|
||||
"required": ["name", "type", "connection"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["connections"]
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
|
|
@ -1245,6 +1308,65 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["postgres"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"params": {
|
||||
"properties": {
|
||||
"host": {
|
||||
"title": "Host",
|
||||
"description": "Database host",
|
||||
"default": "localhost",
|
||||
"type": "string"
|
||||
},
|
||||
"port": {
|
||||
"title": "Port",
|
||||
"description": "Database port",
|
||||
"default": 5432,
|
||||
"type": "integer"
|
||||
},
|
||||
"user": {
|
||||
"title": "User",
|
||||
"description": "Database user",
|
||||
"default": "postgres",
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"title": "Password",
|
||||
"description": "Database password",
|
||||
"type": "string"
|
||||
},
|
||||
"database": {
|
||||
"title": "Database",
|
||||
"description": "Database name",
|
||||
"default": "postgres",
|
||||
"type": "string"
|
||||
},
|
||||
"schema": {
|
||||
"title": "Schema",
|
||||
"description": "Database schema",
|
||||
"default": "public",
|
||||
"type": "string"
|
||||
},
|
||||
"sampleRows": {
|
||||
"title": "Sample Rows",
|
||||
"description": "Number of rows to sample from the database",
|
||||
"default": 3,
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["host", "port", "user", "password", "database"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"required": ["name"]
|
||||
|
|
|
|||
|
|
@ -1147,7 +1147,8 @@
|
|||
"docs",
|
||||
"tree",
|
||||
"highlights",
|
||||
"outline"
|
||||
"outline",
|
||||
"postgres"
|
||||
],
|
||||
"markdownEnumDescriptions": [
|
||||
"Reference the contents of the current changes as given by `git diff`",
|
||||
|
|
@ -1165,7 +1166,8 @@
|
|||
"Display a file tree of the current workspace",
|
||||
"Include a repo map showing important code objects",
|
||||
"Displays important snippets of code from the currently open files",
|
||||
"Displays definition lines from the currently open files"
|
||||
"Displays definition lines from the currently open files",
|
||||
"References Postgres table schema and sample rows"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
|
@ -1293,6 +1295,79 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": [
|
||||
"database"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"connections": {
|
||||
"type": "array",
|
||||
"description": "A list of database connections",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "A unique name for this database connection"
|
||||
},
|
||||
"connection_type": {
|
||||
"type": "string",
|
||||
"description": "The type of database (e.g., 'postgres', 'mysql')",
|
||||
"enum": [
|
||||
"postgres",
|
||||
"mysql",
|
||||
"sqlite"
|
||||
]
|
||||
},
|
||||
"connection": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "string",
|
||||
"description": "The database user name"
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "The host address of the database server"
|
||||
},
|
||||
"database": {
|
||||
"type": "string",
|
||||
"description": "The name of the database to connect to"
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
"description": "The password for the database user"
|
||||
},
|
||||
"port": {
|
||||
"type": "integer",
|
||||
"description": "The port number to connect to at the host"
|
||||
},
|
||||
"filename": {
|
||||
"type": "string",
|
||||
"description": "File location for simple file DB's"
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"connection"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"connections"
|
||||
]
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
|
|
@ -1402,6 +1477,73 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": [
|
||||
"postgres"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"params": {
|
||||
"properties": {
|
||||
"host": {
|
||||
"title": "Host",
|
||||
"description": "Database host",
|
||||
"default": "localhost",
|
||||
"type": "string"
|
||||
},
|
||||
"port": {
|
||||
"title": "Port",
|
||||
"description": "Database port",
|
||||
"default": 5432,
|
||||
"type": "integer"
|
||||
},
|
||||
"user": {
|
||||
"title": "User",
|
||||
"description": "Database user",
|
||||
"default": "postgres",
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"title": "Password",
|
||||
"description": "Database password",
|
||||
"type": "string"
|
||||
},
|
||||
"database": {
|
||||
"title": "Database",
|
||||
"description": "Database name",
|
||||
"default": "postgres",
|
||||
"type": "string"
|
||||
},
|
||||
"schema": {
|
||||
"title": "Schema",
|
||||
"description": "Database schema",
|
||||
"default": "public",
|
||||
"type": "string"
|
||||
},
|
||||
"sampleRows": {
|
||||
"title": "Sample Rows",
|
||||
"description": "Number of rows to sample from the database",
|
||||
"default": 3,
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"host",
|
||||
"port",
|
||||
"user",
|
||||
"password",
|
||||
"database"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -1,25 +1,18 @@
|
|||
"""
|
||||
Welcome to Continue!
|
||||
|
||||
_________ _____ _____
|
||||
__ ____/______ _______ __ /____(_)_______ ____ _______
|
||||
_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
|
||||
/ /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
|
||||
\____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
|
||||
|
||||
This is a 2 minute tutorial.
|
||||
|
||||
It will walk you through the basic features:
|
||||
1. Ask a question
|
||||
2. Edit code
|
||||
3. Debug
|
||||
Welcome to Continue! This is a 2 minute tutorial.
|
||||
|
||||
You can either
|
||||
- follow the instructions on your own, or
|
||||
- follow along by clicking the gray CodeLens buttons above the lines, in order, starting with "Begin Section"
|
||||
"""
|
||||
|
||||
# region —————————————————————————— Part 1: Ask a question about code [⌘ M] ——————————————————————————
|
||||
# region —————————————————————————— Part 1: Ask a question about code [⌘ L] ——————————————————————————
|
||||
|
||||
|
||||
"""Step 1: Highlight the function below"""
|
||||
|
|
@ -34,14 +27,14 @@ def mysterious_function(x):
|
|||
return x
|
||||
|
||||
|
||||
"""Step 2: Use the keyboard shortcut [⌘ M] to
|
||||
"""Step 2: Use the keyboard shortcut [⌘ L] to
|
||||
select the code and toggle the Continue input box"""
|
||||
|
||||
"""Step 3: Ask a question and press Enter"""
|
||||
|
||||
# endregion
|
||||
|
||||
# region ————————————————————————————————— Part 2: Edit code [⌘ ⇧ L] —————————————————————————————————
|
||||
# region ————————————————————————————————— Part 2: Edit code [⌘ I] —————————————————————————————————
|
||||
|
||||
|
||||
"""Step 1: Highlight this code"""
|
||||
|
|
@ -60,7 +53,7 @@ def mysterious_function(x):
|
|||
return x
|
||||
|
||||
|
||||
"""Step 2: Use the keyboard shortcut [⌘ ⇧ L] to edit"""
|
||||
"""Step 2: Use the keyboard shortcut [⌘ I] to edit"""
|
||||
|
||||
"""Step 3: Type "<your edit request>" and press Enter"""
|
||||
|
||||
|
|
@ -72,7 +65,7 @@ accept [⌘ ⇧ ⏎] or reject [⌘ ⇧ ⌫] the edit"""
|
|||
# region ———————————————————————————— Part 3: Debug automatically [⌘ ⇧ R] ————————————————————————————
|
||||
|
||||
|
||||
"""Step 1: Run this Python file"""
|
||||
"""Step 1: Run this Python file (it should error!)"""
|
||||
|
||||
|
||||
def print_sum(list_to_print):
|
||||
|
|
|
|||
|
|
@ -1,21 +1,23 @@
|
|||
# 👋 Welcome to Continue
|
||||
|
||||
## 🔑 Most important shortcuts
|
||||
|
||||
> If you've been using Continue, these have changed
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>L</kbd> = Select code
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>L</kbd> = Select code for follow-up
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>I</kbd> = Quick edit
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>R</kbd> = Automatically debug terminal
|
||||
|
||||
## ❗️ Before you get started
|
||||
|
||||
Continue is currently in the left sidebar, but we recommend moving it to the right. This way it won't cover your file explorer. You can move it back at any time.
|
||||
|
||||

|
||||
|
||||
## 🔑 Most important shortcuts
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>M</kbd> = Select code
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>M</kbd> = Select code for follow-up
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>L</kbd> = Quick edit
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>R</kbd> = Automatically debug terminal
|
||||
|
||||
## ⚡️ Setting up tab autocomplete
|
||||
|
||||
1. Download [Ollama](https://ollama.ai)
|
||||
|
|
|
|||
591
extensions/vscode/package-lock.json
generated
591
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.9.71",
|
||||
"version": "0.9.72",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.9.71",
|
||||
"version": "0.9.72",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
|
|
@ -18,6 +18,7 @@
|
|||
"axios": "^1.2.5",
|
||||
"core": "file:../../core",
|
||||
"cors": "^2.8.5",
|
||||
"dbinfoz": "^0.1.4",
|
||||
"downshift": "^7.6.0",
|
||||
"express": "^4.18.2",
|
||||
"fkill": "^8.1.0",
|
||||
|
|
@ -91,15 +92,22 @@
|
|||
"adf-to-md": "^1.1.0",
|
||||
"axios": "^1.6.7",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
"commander": "^12.0.0",
|
||||
"dbinfoz": "^0.1.4",
|
||||
"dotenv": "^16.3.1",
|
||||
"fastest-levenshtein": "^1.0.16",
|
||||
"follow-redirects": "^1.15.5",
|
||||
"handlebars": "^4.7.8",
|
||||
"http-proxy-agent": "^7.0.1",
|
||||
"https-proxy-agent": "^7.0.3",
|
||||
"js-tiktoken": "^1.0.8",
|
||||
"llama-tokenizer-js": "^1.1.3",
|
||||
"llm-code-highlighter": "^0.0.13",
|
||||
"node-fetch": "^3.3.2",
|
||||
"node-html-markdown": "^1.3.0",
|
||||
"ollama": "^0.4.6",
|
||||
"openai": "^4.20.1",
|
||||
"pg": "^8.11.3",
|
||||
"posthog-node": "^3.6.2",
|
||||
"replicate": "^0.26.0",
|
||||
"socket.io-client": "^4.7.3",
|
||||
|
|
@ -111,6 +119,7 @@
|
|||
"web-tree-sitter": "^0.20.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"@types/handlebars": "^4.1.0",
|
||||
"@types/jest": "^29.5.11",
|
||||
"@types/jquery": "^3.5.29",
|
||||
|
|
@ -3697,6 +3706,14 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/bindings": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
||||
"dependencies": {
|
||||
"file-uri-to-path": "1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bl": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
|
||||
|
|
@ -3862,6 +3879,14 @@
|
|||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
|
||||
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
|
||||
},
|
||||
"node_modules/buffer-writer": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz",
|
||||
"integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/bytes": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
||||
|
|
@ -4803,6 +4828,16 @@
|
|||
"url": "https://opencollective.com/date-fns"
|
||||
}
|
||||
},
|
||||
"node_modules/dbinfoz": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/dbinfoz/-/dbinfoz-0.1.4.tgz",
|
||||
"integrity": "sha512-MB56+xS571ip7qoXqxdnOUtXebbWaqoZN+S++W51SQYJRSjQFGEIPucNmxgeQlBGJ1vM4mQNV47wzV6fcrezZg==",
|
||||
"dependencies": {
|
||||
"mysql2": "^3.9.1",
|
||||
"pg": "^8.11.3",
|
||||
"sqlite3": "^5.1.7"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||
|
|
@ -4884,7 +4919,6 @@
|
|||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
|
||||
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
|
|
@ -4951,6 +4985,14 @@
|
|||
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
||||
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ=="
|
||||
},
|
||||
"node_modules/denque": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz",
|
||||
"integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==",
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/depd": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
|
||||
|
|
@ -5676,7 +5718,6 @@
|
|||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
|
||||
"integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
|
|
@ -5939,6 +5980,11 @@
|
|||
"node": "^10.12.0 || >=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
|
|
@ -6198,8 +6244,7 @@
|
|||
"node_modules/fs-constants": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
|
||||
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
|
||||
"dev": true
|
||||
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
|
||||
},
|
||||
"node_modules/fs-extra": {
|
||||
"version": "10.1.0",
|
||||
|
|
@ -6288,6 +6333,14 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/generate-function": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz",
|
||||
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
|
||||
"dependencies": {
|
||||
"is-property": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/gensync": {
|
||||
"version": "1.0.0-beta.2",
|
||||
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
|
||||
|
|
@ -6364,8 +6417,7 @@
|
|||
"node_modules/github-from-package": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
|
||||
"integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "8.1.0",
|
||||
|
|
@ -6928,8 +6980,7 @@
|
|||
"node_modules/ini": {
|
||||
"version": "1.3.8",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
|
||||
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
|
||||
"dev": true
|
||||
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
|
||||
},
|
||||
"node_modules/inline-style-parser": {
|
||||
"version": "0.1.1",
|
||||
|
|
@ -7152,6 +7203,11 @@
|
|||
"integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/is-property": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
|
||||
"integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g=="
|
||||
},
|
||||
"node_modules/is-stream": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
|
||||
|
|
@ -8184,6 +8240,11 @@
|
|||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/long": {
|
||||
"version": "5.2.3",
|
||||
"resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz",
|
||||
"integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q=="
|
||||
},
|
||||
"node_modules/loose-envify": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
|
||||
|
|
@ -9067,8 +9128,7 @@
|
|||
"node_modules/mkdirp-classic": {
|
||||
"version": "0.5.3",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
||||
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
|
||||
"dev": true
|
||||
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
|
||||
},
|
||||
"node_modules/mocha": {
|
||||
"version": "10.3.0",
|
||||
|
|
@ -9273,6 +9333,43 @@
|
|||
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/mysql2": {
|
||||
"version": "3.9.1",
|
||||
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.9.1.tgz",
|
||||
"integrity": "sha512-3njoWAAhGBYy0tWBabqUQcLtczZUxrmmtc2vszQUekg3kTJyZ5/IeLC3Fo04u6y6Iy5Sba7pIIa2P/gs8D3ZeQ==",
|
||||
"dependencies": {
|
||||
"denque": "^2.1.0",
|
||||
"generate-function": "^2.3.1",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"long": "^5.2.1",
|
||||
"lru-cache": "^8.0.0",
|
||||
"named-placeholders": "^1.1.3",
|
||||
"seq-queue": "^0.0.5",
|
||||
"sqlstring": "^2.3.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mysql2/node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mysql2/node_modules/lru-cache": {
|
||||
"version": "8.0.5",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz",
|
||||
"integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==",
|
||||
"engines": {
|
||||
"node": ">=16.14"
|
||||
}
|
||||
},
|
||||
"node_modules/mz": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
|
||||
|
|
@ -9283,6 +9380,25 @@
|
|||
"thenify-all": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/named-placeholders": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz",
|
||||
"integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^7.14.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/named-placeholders/node_modules/lru-cache": {
|
||||
"version": "7.18.3",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
|
||||
"integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.7",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
|
||||
|
|
@ -9303,8 +9419,7 @@
|
|||
"node_modules/napi-build-utils": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
|
||||
"integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg=="
|
||||
},
|
||||
"node_modules/natural-compare": {
|
||||
"version": "1.4.0",
|
||||
|
|
@ -9794,6 +9909,11 @@
|
|||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/packet-reader": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz",
|
||||
"integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ=="
|
||||
},
|
||||
"node_modules/pad-left": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/pad-left/-/pad-left-2.1.0.tgz",
|
||||
|
|
@ -9974,6 +10094,89 @@
|
|||
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
|
||||
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow=="
|
||||
},
|
||||
"node_modules/pg": {
|
||||
"version": "8.11.3",
|
||||
"resolved": "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz",
|
||||
"integrity": "sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==",
|
||||
"dependencies": {
|
||||
"buffer-writer": "2.0.0",
|
||||
"packet-reader": "1.0.0",
|
||||
"pg-connection-string": "^2.6.2",
|
||||
"pg-pool": "^3.6.1",
|
||||
"pg-protocol": "^1.6.0",
|
||||
"pg-types": "^2.1.0",
|
||||
"pgpass": "1.x"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"pg-cloudflare": "^1.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"pg-native": ">=3.0.1"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"pg-native": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/pg-cloudflare": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz",
|
||||
"integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/pg-connection-string": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz",
|
||||
"integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA=="
|
||||
},
|
||||
"node_modules/pg-int8": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
|
||||
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pg-pool": {
|
||||
"version": "3.6.1",
|
||||
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz",
|
||||
"integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==",
|
||||
"peerDependencies": {
|
||||
"pg": ">=8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pg-protocol": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz",
|
||||
"integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q=="
|
||||
},
|
||||
"node_modules/pg-types": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
|
||||
"integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
|
||||
"dependencies": {
|
||||
"pg-int8": "1.0.1",
|
||||
"postgres-array": "~2.0.0",
|
||||
"postgres-bytea": "~1.0.0",
|
||||
"postgres-date": "~1.0.4",
|
||||
"postgres-interval": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/pgpass": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",
|
||||
"integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",
|
||||
"dependencies": {
|
||||
"split2": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
|
||||
|
|
@ -10220,6 +10423,41 @@
|
|||
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
|
||||
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="
|
||||
},
|
||||
"node_modules/postgres-array": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
|
||||
"integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/postgres-bytea": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
|
||||
"integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/postgres-date": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
|
||||
"integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/postgres-interval": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
|
||||
"integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
|
||||
"dependencies": {
|
||||
"xtend": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/posthog-node": {
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/posthog-node/-/posthog-node-3.6.3.tgz",
|
||||
|
|
@ -10236,7 +10474,6 @@
|
|||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz",
|
||||
"integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"detect-libc": "^2.0.0",
|
||||
"expand-template": "^2.0.3",
|
||||
|
|
@ -10534,7 +10771,6 @@
|
|||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
|
||||
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"deep-extend": "^0.6.0",
|
||||
"ini": "~1.3.0",
|
||||
|
|
@ -10549,7 +10785,6 @@
|
|||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
|
||||
"integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
|
|
@ -11200,6 +11435,11 @@
|
|||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||
},
|
||||
"node_modules/seq-queue": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz",
|
||||
"integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q=="
|
||||
},
|
||||
"node_modules/serialize-javascript": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz",
|
||||
|
|
@ -11298,7 +11538,6 @@
|
|||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
|
||||
"integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
|
|
@ -11318,7 +11557,6 @@
|
|||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
|
||||
"integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
|
|
@ -11464,11 +11702,312 @@
|
|||
"integrity": "sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/split2": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
|
||||
"integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
|
||||
"engines": {
|
||||
"node": ">= 10.x"
|
||||
}
|
||||
},
|
||||
"node_modules/sprintf-js": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz",
|
||||
"integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA=="
|
||||
},
|
||||
"node_modules/sqlite3": {
|
||||
"version": "5.1.7",
|
||||
"resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz",
|
||||
"integrity": "sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"bindings": "^1.5.0",
|
||||
"node-addon-api": "^7.0.0",
|
||||
"prebuild-install": "^7.1.1",
|
||||
"tar": "^6.1.11"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"node-gyp": "8.x"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"node-gyp": "8.x"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"node-gyp": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/@npmcli/fs": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz",
|
||||
"integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@gar/promisify": "^1.0.1",
|
||||
"semver": "^7.3.5"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/@npmcli/move-file": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz",
|
||||
"integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==",
|
||||
"deprecated": "This functionality has been moved to @npmcli/fs",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"mkdirp": "^1.0.4",
|
||||
"rimraf": "^3.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/cacache": {
|
||||
"version": "15.3.0",
|
||||
"resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz",
|
||||
"integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@npmcli/fs": "^1.0.0",
|
||||
"@npmcli/move-file": "^1.0.1",
|
||||
"chownr": "^2.0.0",
|
||||
"fs-minipass": "^2.0.0",
|
||||
"glob": "^7.1.4",
|
||||
"infer-owner": "^1.0.4",
|
||||
"lru-cache": "^6.0.0",
|
||||
"minipass": "^3.1.1",
|
||||
"minipass-collect": "^1.0.2",
|
||||
"minipass-flush": "^1.0.5",
|
||||
"minipass-pipeline": "^1.2.2",
|
||||
"mkdirp": "^1.0.3",
|
||||
"p-map": "^4.0.0",
|
||||
"promise-inflight": "^1.0.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ssri": "^8.0.1",
|
||||
"tar": "^6.0.2",
|
||||
"unique-filename": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/glob": {
|
||||
"version": "7.2.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.1.1",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/http-proxy-agent": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz",
|
||||
"integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@tootallnate/once": "1",
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/https-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
|
||||
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/make-fetch-happen": {
|
||||
"version": "9.1.0",
|
||||
"resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz",
|
||||
"integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"agentkeepalive": "^4.1.3",
|
||||
"cacache": "^15.2.0",
|
||||
"http-cache-semantics": "^4.1.0",
|
||||
"http-proxy-agent": "^4.0.1",
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
"is-lambda": "^1.0.1",
|
||||
"lru-cache": "^6.0.0",
|
||||
"minipass": "^3.1.3",
|
||||
"minipass-collect": "^1.0.2",
|
||||
"minipass-fetch": "^1.3.2",
|
||||
"minipass-flush": "^1.0.5",
|
||||
"minipass-pipeline": "^1.2.4",
|
||||
"negotiator": "^0.6.2",
|
||||
"promise-retry": "^2.0.1",
|
||||
"socks-proxy-agent": "^6.0.0",
|
||||
"ssri": "^8.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/minipass-fetch": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz",
|
||||
"integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"minipass": "^3.1.0",
|
||||
"minipass-sized": "^1.0.3",
|
||||
"minizlib": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"encoding": "^0.1.12"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/node-addon-api": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz",
|
||||
"integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==",
|
||||
"engines": {
|
||||
"node": "^16 || ^18 || >= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/node-gyp": {
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz",
|
||||
"integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"env-paths": "^2.2.0",
|
||||
"glob": "^7.1.4",
|
||||
"graceful-fs": "^4.2.6",
|
||||
"make-fetch-happen": "^9.1.0",
|
||||
"nopt": "^5.0.0",
|
||||
"npmlog": "^6.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.3.5",
|
||||
"tar": "^6.1.2",
|
||||
"which": "^2.0.2"
|
||||
},
|
||||
"bin": {
|
||||
"node-gyp": "bin/node-gyp.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/nopt": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
|
||||
"integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"abbrev": "1"
|
||||
},
|
||||
"bin": {
|
||||
"nopt": "bin/nopt.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/rimraf": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"rimraf": "bin.js"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/socks-proxy-agent": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz",
|
||||
"integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"agent-base": "^6.0.2",
|
||||
"debug": "^4.3.3",
|
||||
"socks": "^2.6.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/ssri": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
|
||||
"integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"minipass": "^3.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/unique-filename": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz",
|
||||
"integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"unique-slug": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlite3/node_modules/unique-slug": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz",
|
||||
"integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"imurmurhash": "^0.1.4"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlstring": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz",
|
||||
"integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/sshpk": {
|
||||
"version": "1.18.0",
|
||||
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz",
|
||||
|
|
@ -11926,7 +12465,6 @@
|
|||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
|
||||
"integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"chownr": "^1.1.1",
|
||||
"mkdirp-classic": "^0.5.2",
|
||||
|
|
@ -11937,14 +12475,12 @@
|
|||
"node_modules/tar-fs/node_modules/chownr": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
|
||||
},
|
||||
"node_modules/tar-stream": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
|
||||
"integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"bl": "^4.0.3",
|
||||
"end-of-stream": "^1.4.1",
|
||||
|
|
@ -11960,7 +12496,6 @@
|
|||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
|
|
@ -13587,6 +14122,14 @@
|
|||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/xtend": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
||||
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
|
||||
"engines": {
|
||||
"node": ">=0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/y18n": {
|
||||
"version": "5.0.8",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"icon": "media/icon.png",
|
||||
"version": "0.9.71",
|
||||
"version": "0.9.73",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/continuedev/continue"
|
||||
|
|
@ -195,13 +195,13 @@
|
|||
"keybindings": [
|
||||
{
|
||||
"command": "continue.focusContinueInput",
|
||||
"mac": "cmd+m",
|
||||
"key": "ctrl+m"
|
||||
"mac": "cmd+l",
|
||||
"key": "ctrl+l"
|
||||
},
|
||||
{
|
||||
"command": "continue.focusContinueInputWithoutClear",
|
||||
"mac": "cmd+shift+m",
|
||||
"key": "ctrl+shift+m"
|
||||
"mac": "cmd+shift+l",
|
||||
"key": "ctrl+shift+l"
|
||||
},
|
||||
{
|
||||
"command": "continue.acceptDiff",
|
||||
|
|
@ -221,13 +221,13 @@
|
|||
},
|
||||
{
|
||||
"command": "continue.quickEdit",
|
||||
"mac": "cmd+shift+l",
|
||||
"key": "ctrl+shift+l"
|
||||
"mac": "cmd+i",
|
||||
"key": "ctrl+i"
|
||||
},
|
||||
{
|
||||
"command": "continue.toggleAuxiliaryBar",
|
||||
"mac": "alt+cmd+m",
|
||||
"key": "alt+ctrl+m"
|
||||
"mac": "alt+cmd+l",
|
||||
"key": "alt+ctrl+l"
|
||||
},
|
||||
{
|
||||
"command": "continue.debugTerminal",
|
||||
|
|
@ -476,6 +476,7 @@
|
|||
"axios": "^1.2.5",
|
||||
"core": "file:../../core",
|
||||
"cors": "^2.8.5",
|
||||
"dbinfoz": "^0.1.4",
|
||||
"downshift": "^7.6.0",
|
||||
"express": "^4.18.2",
|
||||
"fkill": "^8.1.0",
|
||||
|
|
|
|||
|
|
@ -13,11 +13,22 @@ if (args[2] === "--target") {
|
|||
(async () => {
|
||||
console.log("[info] Packaging extension for target ", target);
|
||||
|
||||
// Copy config_schema.json to config.json in docs
|
||||
// Copy config_schema.json to config.json in docs and intellij
|
||||
fs.copyFileSync(
|
||||
"config_schema.json",
|
||||
path.join("..", "..", "docs", "static", "schemas", "config.json")
|
||||
);
|
||||
fs.copyFileSync(
|
||||
"config_schema.json",
|
||||
path.join(
|
||||
"..",
|
||||
"intellij",
|
||||
"src",
|
||||
"main",
|
||||
"resources",
|
||||
"config_schema.json"
|
||||
)
|
||||
);
|
||||
// Modify and copy for .continuerc.json
|
||||
const schema = JSON.parse(fs.readFileSync("config_schema.json", "utf8"));
|
||||
schema.definitions.SerializedContinueConfig.properties.mergeBehavior = {
|
||||
|
|
@ -77,11 +88,19 @@ if (args[2] === "--target") {
|
|||
});
|
||||
});
|
||||
|
||||
// Put back index.html
|
||||
if (fs.existsSync(indexHtmlPath)) {
|
||||
fs.rmSync(indexHtmlPath, {});
|
||||
}
|
||||
fs.copyFileSync("tmp_index.html", indexHtmlPath);
|
||||
fs.unlinkSync("tmp_index.html");
|
||||
|
||||
// Copy over other misc. files
|
||||
fs.copyFileSync(
|
||||
"../extensions/vscode/gui/onigasm.wasm",
|
||||
path.join(intellijExtensionWebviewPath, "onigasm.wasm")
|
||||
);
|
||||
|
||||
console.log("[info] Copied gui build to Intellij extension");
|
||||
|
||||
// Then copy over the dist folder to the VSCode extension //
|
||||
|
|
|
|||
|
|
@ -2,25 +2,13 @@ import { getTsConfigPath, migrate } from "core/util/paths";
|
|||
import { Telemetry } from "core/util/posthog";
|
||||
import * as fs from "fs";
|
||||
import path from "path";
|
||||
import { v4 } from "uuid";
|
||||
import * as vscode from "vscode";
|
||||
import { ContinueCompletionProvider } from "../autocomplete/completionProvider";
|
||||
import { setupStatusBar } from "../autocomplete/statusBar";
|
||||
import { registerAllCommands } from "../commands";
|
||||
import IdeProtocolClient from "../continueIdeClient";
|
||||
import { ContinueGUIWebviewViewProvider } from "../debugPanel";
|
||||
import { VsCodeExtension } from "../extension/vscodeExtension";
|
||||
import registerQuickFixProvider from "../lang-server/codeActions";
|
||||
import { registerAllCodeLensProviders } from "../lang-server/codeLens";
|
||||
import { vsCodeIndexCodebase } from "../util/indexCodebase";
|
||||
import { setupRemoteConfigSync } from "../util/remoteConfig";
|
||||
import { getExtensionVersion } from "../util/util";
|
||||
import { getExtensionUri } from "../util/vscode";
|
||||
import { setupInlineTips } from "./inlineTips";
|
||||
|
||||
export let extensionContext: vscode.ExtensionContext | undefined = undefined;
|
||||
export let ideProtocolClient: IdeProtocolClient;
|
||||
export let windowId: string = v4();
|
||||
|
||||
export async function showTutorial() {
|
||||
const tutorialPath = path.join(
|
||||
getExtensionUri().fsPath,
|
||||
|
|
@ -46,7 +34,9 @@ async function openTutorialFirstTime(context: vscode.ExtensionContext) {
|
|||
}
|
||||
}
|
||||
|
||||
function showRefactorMigrationMessage() {
|
||||
function showRefactorMigrationMessage(
|
||||
extensionContext: vscode.ExtensionContext
|
||||
) {
|
||||
// Only if the vscode setting continue.manuallyRunningSserver is true
|
||||
const manuallyRunningServer =
|
||||
vscode.workspace
|
||||
|
|
@ -80,47 +70,15 @@ export async function activateExtension(context: vscode.ExtensionContext) {
|
|||
// Add necessary files
|
||||
getTsConfigPath();
|
||||
|
||||
extensionContext = context;
|
||||
|
||||
// Register commands and providers
|
||||
registerAllCodeLensProviders(context);
|
||||
registerAllCommands(context);
|
||||
registerQuickFixProvider();
|
||||
await openTutorialFirstTime(context);
|
||||
setupInlineTips(context);
|
||||
showRefactorMigrationMessage();
|
||||
const config = vscode.workspace.getConfiguration("continue");
|
||||
const enabled = config.get<boolean>("enableTabAutocomplete");
|
||||
showRefactorMigrationMessage(context);
|
||||
|
||||
// Register inline completion provider (odd versions are pre-release)
|
||||
if (parseInt(context.extension.packageJSON.version.split(".")[1]) % 2 !== 0) {
|
||||
setupStatusBar(enabled);
|
||||
context.subscriptions.push(
|
||||
vscode.languages.registerInlineCompletionItemProvider(
|
||||
[{ pattern: "**" }],
|
||||
new ContinueCompletionProvider()
|
||||
)
|
||||
);
|
||||
}
|
||||
const vscodeExtension = new VsCodeExtension(context);
|
||||
|
||||
ideProtocolClient = new IdeProtocolClient(context);
|
||||
|
||||
// Register Continue GUI as sidebar webview, and beginning a new session
|
||||
const provider = new ContinueGUIWebviewViewProvider();
|
||||
|
||||
context.subscriptions.push(
|
||||
vscode.window.registerWebviewViewProvider(
|
||||
"continue.continueGUIView",
|
||||
provider,
|
||||
{
|
||||
webviewOptions: { retainContextWhenHidden: true },
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
vsCodeIndexCodebase(ideProtocolClient.getWorkspaceDirectories());
|
||||
|
||||
migrate("showWelcome", () => {
|
||||
migrate("showWelcome_1", () => {
|
||||
vscode.commands.executeCommand(
|
||||
"markdown.showPreview",
|
||||
vscode.Uri.file(
|
||||
|
|
@ -129,25 +87,6 @@ export async function activateExtension(context: vscode.ExtensionContext) {
|
|||
);
|
||||
});
|
||||
|
||||
// (async () => {
|
||||
// const defaultDocsPages = [
|
||||
// ["Socket.IO", "https://python-socketio.readthedocs.io/en/stable"],
|
||||
// // ["Flask", "https://flask.palletsprojects.com/en/2.0.x/"],
|
||||
// ];
|
||||
|
||||
// const config = await configHandler.loadConfig(new VsCodeIde());
|
||||
|
||||
// defaultDocsPages.forEach(async ([title, url]) => {
|
||||
// for await (const update of indexDocs(
|
||||
// title,
|
||||
// new URL(url),
|
||||
// config.embeddingsProvider
|
||||
// )) {
|
||||
// console.log(update.progress, update.desc);
|
||||
// }
|
||||
// });
|
||||
// })();
|
||||
|
||||
// Load Continue configuration
|
||||
if (!context.globalState.get("hasBeenInstalled")) {
|
||||
context.globalState.update("hasBeenInstalled", true);
|
||||
|
|
@ -155,10 +94,4 @@ export async function activateExtension(context: vscode.ExtensionContext) {
|
|||
extensionVersion: getExtensionVersion(),
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
setupRemoteConfigSync();
|
||||
} catch (e) {
|
||||
console.warn(`Failed to sync remote config: ${e}`);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { getMetaKeyLabel } from "../util/util";
|
|||
|
||||
const inlineTipDecoration = vscode.window.createTextEditorDecorationType({
|
||||
after: {
|
||||
contentText: `${getMetaKeyLabel()} M to select code, ${getMetaKeyLabel()} ⇧ L to edit`,
|
||||
contentText: `${getMetaKeyLabel()} L to select code, ${getMetaKeyLabel()} I to edit`,
|
||||
color: "#888",
|
||||
margin: "0 0 0 6em",
|
||||
fontWeight: "bold",
|
||||
|
|
@ -31,7 +31,7 @@ function handleSelectionChange(e: vscode.TextEditorSelectionChangeEvent) {
|
|||
const line = Math.max(0, selection.start.line - 1);
|
||||
|
||||
const hoverMarkdown = new vscode.MarkdownString(
|
||||
`Use ${getMetaKeyLabel()} M to select code, or ${getMetaKeyLabel()} ⇧ L to edit highlighted code. Click [here](command:continue.hideInlineTip) if you don't want to see these inline suggestions.`
|
||||
`Use ${getMetaKeyLabel()} L to select code, or ${getMetaKeyLabel()} I to edit highlighted code. Click [here](command:continue.hideInlineTip) if you don't want to see these inline suggestions.`
|
||||
);
|
||||
hoverMarkdown.isTrusted = true;
|
||||
hoverMarkdown.supportHtml = true;
|
||||
|
|
@ -49,7 +49,7 @@ function handleSelectionChange(e: vscode.TextEditorSelectionChangeEvent) {
|
|||
const emptyFileTooltipDecoration = vscode.window.createTextEditorDecorationType(
|
||||
{
|
||||
after: {
|
||||
contentText: `Use ${getMetaKeyLabel()} ⇧ L to generate code`,
|
||||
contentText: `Use ${getMetaKeyLabel()} I to generate code`,
|
||||
color: "#888",
|
||||
margin: "2em 0 0 0",
|
||||
fontStyle: "italic",
|
||||
|
|
|
|||
|
|
@ -3,19 +3,26 @@ import * as os from "os";
|
|||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
|
||||
import { extensionContext, ideProtocolClient } from "./activation/activate";
|
||||
import { IDE } from "core";
|
||||
import { ConfigHandler } from "core/config/handler";
|
||||
import { logDevData } from "core/util/devdata";
|
||||
import { AutocompleteOutcome } from "./autocomplete/getTabCompletion";
|
||||
import { debugPanelWebview, getSidebarContent } from "./debugPanel";
|
||||
import { acceptDiffCommand, rejectDiffCommand } from "./diff/horizontal";
|
||||
import {
|
||||
editorToVerticalDiffCodeLens,
|
||||
streamEdit,
|
||||
verticalPerLineDiffManager,
|
||||
} from "./diff/verticalPerLine/manager";
|
||||
import { VsCodeIde } from "./ideProtocol";
|
||||
import { configHandler, llmFromTitle } from "./loadConfig";
|
||||
import { ContinueGUIWebviewViewProvider } from "./debugPanel";
|
||||
import { DiffManager } from "./diff/horizontal";
|
||||
import { VerticalPerLineDiffManager } from "./diff/verticalPerLine/manager";
|
||||
import { VsCodeWebviewProtocol } from "./webviewProtocol";
|
||||
|
||||
function addHighlightedCodeToContext(edit: boolean) {
|
||||
function getFullScreenTab() {
|
||||
const tabs = vscode.window.tabGroups.all.flatMap((tabGroup) => tabGroup.tabs);
|
||||
return tabs.find(
|
||||
(tab) => (tab.input as any).viewType?.endsWith("continue.continueGUIView")
|
||||
);
|
||||
}
|
||||
|
||||
function addHighlightedCodeToContext(
|
||||
edit: boolean,
|
||||
webviewProtocol: VsCodeWebviewProtocol | undefined
|
||||
) {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (editor) {
|
||||
const selection = editor.selection;
|
||||
|
|
@ -37,22 +44,28 @@ function addHighlightedCodeToContext(edit: boolean) {
|
|||
},
|
||||
};
|
||||
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "highlightedCode",
|
||||
webviewProtocol?.request("highlightedCode", {
|
||||
rangeInFileWithContents,
|
||||
edit,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function addEntireFileToContext(filepath: vscode.Uri, edit: boolean) {
|
||||
async function addEntireFileToContext(
|
||||
filepath: vscode.Uri,
|
||||
edit: boolean,
|
||||
webviewProtocol: VsCodeWebviewProtocol | undefined
|
||||
) {
|
||||
// If a directory, add all files in the directory
|
||||
const stat = await vscode.workspace.fs.stat(filepath);
|
||||
if (stat.type === vscode.FileType.Directory) {
|
||||
const files = await vscode.workspace.fs.readDirectory(filepath);
|
||||
for (const [filename, type] of files) {
|
||||
if (type === vscode.FileType.File) {
|
||||
addEntireFileToContext(vscode.Uri.joinPath(filepath, filename), edit);
|
||||
addEntireFileToContext(
|
||||
vscode.Uri.joinPath(filepath, filename),
|
||||
edit,
|
||||
webviewProtocol
|
||||
);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
@ -75,79 +88,74 @@ async function addEntireFileToContext(filepath: vscode.Uri, edit: boolean) {
|
|||
},
|
||||
};
|
||||
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "highlightedCode",
|
||||
webviewProtocol?.request("highlightedCode", {
|
||||
rangeInFileWithContents,
|
||||
edit,
|
||||
});
|
||||
}
|
||||
|
||||
function acceptRejectVerticalDiffBlock(
|
||||
accept: boolean,
|
||||
filepath?: string,
|
||||
index?: number
|
||||
) {
|
||||
if (!filepath) {
|
||||
const activeEditor = vscode.window.activeTextEditor;
|
||||
if (!activeEditor) {
|
||||
return;
|
||||
}
|
||||
filepath = activeEditor.document.uri.fsPath;
|
||||
}
|
||||
|
||||
if (typeof index === "undefined") {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
let blocks = editorToVerticalDiffCodeLens.get(filepath);
|
||||
const block = blocks?.[index];
|
||||
if (!blocks || !block) {
|
||||
return;
|
||||
}
|
||||
|
||||
const handler = verticalPerLineDiffManager.getHandlerForFile(filepath);
|
||||
if (!handler) {
|
||||
return;
|
||||
}
|
||||
|
||||
// CodeLens object removed from editorToVerticalDiffCodeLens here
|
||||
handler.acceptRejectBlock(accept, block.start, block.numGreen, block.numRed);
|
||||
}
|
||||
|
||||
// Copy everything over from extension.ts
|
||||
const commandsMap: { [command: string]: (...args: any) => any } = {
|
||||
"continue.acceptDiff": acceptDiffCommand,
|
||||
"continue.rejectDiff": rejectDiffCommand,
|
||||
const commandsMap: (
|
||||
ide: IDE,
|
||||
extensionContext: vscode.ExtensionContext,
|
||||
sidebar: ContinueGUIWebviewViewProvider,
|
||||
configHandler: ConfigHandler,
|
||||
diffManager: DiffManager,
|
||||
verticalDiffManager: VerticalPerLineDiffManager
|
||||
) => { [command: string]: (...args: any) => any } = (
|
||||
ide,
|
||||
extensionContext,
|
||||
sidebar,
|
||||
configHandler,
|
||||
diffManager,
|
||||
verticalDiffManager
|
||||
) => ({
|
||||
"continue.acceptDiff": async (newFilepath?: string | vscode.Uri) => {
|
||||
if (newFilepath instanceof vscode.Uri) {
|
||||
newFilepath = newFilepath.fsPath;
|
||||
}
|
||||
verticalDiffManager.clearForFilepath(newFilepath, true);
|
||||
await diffManager.acceptDiff(newFilepath);
|
||||
},
|
||||
"continue.rejectDiff": async (newFilepath?: string | vscode.Uri) => {
|
||||
if (newFilepath instanceof vscode.Uri) {
|
||||
newFilepath = newFilepath.fsPath;
|
||||
}
|
||||
verticalDiffManager.clearForFilepath(newFilepath, false);
|
||||
await diffManager.rejectDiff(newFilepath);
|
||||
},
|
||||
"continue.acceptVerticalDiffBlock": (filepath?: string, index?: number) => {
|
||||
acceptRejectVerticalDiffBlock(true, filepath, index);
|
||||
verticalDiffManager.acceptRejectVerticalDiffBlock(true, filepath, index);
|
||||
},
|
||||
"continue.rejectVerticalDiffBlock": (filepath?: string, index?: number) => {
|
||||
acceptRejectVerticalDiffBlock(false, filepath, index);
|
||||
verticalDiffManager.acceptRejectVerticalDiffBlock(false, filepath, index);
|
||||
},
|
||||
"continue.quickFix": async (message: string, code: string, edit: boolean) => {
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "newSessionWithPrompt",
|
||||
sidebar.webviewProtocol?.request("newSessionWithPrompt", {
|
||||
prompt: `${
|
||||
edit ? "/edit " : ""
|
||||
}${code}\n\nHow do I fix this problem in the above code?: ${message}`,
|
||||
});
|
||||
|
||||
if (!edit) {
|
||||
vscode.commands.executeCommand("continue.continueGUIView.focus");
|
||||
}
|
||||
},
|
||||
"continue.focusContinueInput": async () => {
|
||||
vscode.commands.executeCommand("continue.continueGUIView.focus");
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "focusContinueInput",
|
||||
});
|
||||
addHighlightedCodeToContext(false);
|
||||
if (!getFullScreenTab()) {
|
||||
vscode.commands.executeCommand("continue.continueGUIView.focus");
|
||||
}
|
||||
sidebar.webviewProtocol?.request("focusContinueInput", undefined);
|
||||
addHighlightedCodeToContext(false, sidebar.webviewProtocol);
|
||||
},
|
||||
"continue.focusContinueInputWithoutClear": async () => {
|
||||
vscode.commands.executeCommand("continue.continueGUIView.focus");
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "focusContinueInputWithoutClear",
|
||||
});
|
||||
addHighlightedCodeToContext(true);
|
||||
if (!getFullScreenTab()) {
|
||||
vscode.commands.executeCommand("continue.continueGUIView.focus");
|
||||
}
|
||||
sidebar.webviewProtocol?.request(
|
||||
"focusContinueInputWithoutClear",
|
||||
undefined
|
||||
);
|
||||
addHighlightedCodeToContext(true, sidebar.webviewProtocol);
|
||||
},
|
||||
"continue.toggleAuxiliaryBar": () => {
|
||||
vscode.commands.executeCommand("workbench.action.toggleAuxiliaryBar");
|
||||
|
|
@ -167,7 +175,7 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
}
|
||||
|
||||
if (text.length > 0) {
|
||||
await streamEdit(text);
|
||||
await verticalDiffManager.streamEdit(text);
|
||||
} else {
|
||||
// Pick context first
|
||||
const quickPickItems: Promise<vscode.QuickPickItem[]> = configHandler
|
||||
|
|
@ -201,7 +209,7 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
title: "Continue Quick Edit",
|
||||
});
|
||||
if (text) {
|
||||
const llm = await llmFromTitle();
|
||||
const llm = await configHandler.llmFromTitle();
|
||||
const config = await configHandler.loadConfig();
|
||||
const context = (
|
||||
await Promise.all(
|
||||
|
|
@ -216,7 +224,7 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
|
||||
return provider.getContextItems("", {
|
||||
embeddingsProvider: config.embeddingsProvider,
|
||||
ide: new VsCodeIde(),
|
||||
ide,
|
||||
llm,
|
||||
fullInput: text || "",
|
||||
selectedCode: [],
|
||||
|
|
@ -230,25 +238,29 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
"\n\n---\n\n" +
|
||||
text;
|
||||
|
||||
await streamEdit(text);
|
||||
await verticalDiffManager.streamEdit(text);
|
||||
}
|
||||
}
|
||||
},
|
||||
"continue.writeCommentsForCode": async () => {
|
||||
await streamEdit("Write comments for this code");
|
||||
await verticalDiffManager.streamEdit(
|
||||
"Write comments for this code. Do not change anything about the code itself."
|
||||
);
|
||||
},
|
||||
"continue.writeDocstringForCode": async () => {
|
||||
await streamEdit("Write a docstring for this code");
|
||||
await verticalDiffManager.streamEdit(
|
||||
"Write a docstring for this code. Do not change anything about the code itself."
|
||||
);
|
||||
},
|
||||
"continue.fixCode": async () => {
|
||||
await streamEdit("Fix this code");
|
||||
await verticalDiffManager.streamEdit("Fix this code");
|
||||
},
|
||||
"continue.optimizeCode": async () => {
|
||||
await streamEdit("Optimize this code");
|
||||
await verticalDiffManager.streamEdit("Optimize this code");
|
||||
},
|
||||
"continue.fixGrammar": async () => {
|
||||
await streamEdit(
|
||||
"If there are any grammar or spelling mistakes in this writing, fix them"
|
||||
await verticalDiffManager.streamEdit(
|
||||
"If there are any grammar or spelling mistakes in this writing, fix them. Do not make other large changes to the writing."
|
||||
);
|
||||
},
|
||||
"continue.viewLogs": async () => {
|
||||
|
|
@ -264,11 +276,10 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
await vscode.window.showTextDocument(uri);
|
||||
},
|
||||
"continue.debugTerminal": async () => {
|
||||
const terminalContents = await ideProtocolClient.getTerminalContents(1);
|
||||
const terminalContents = await ide.getTerminalContents();
|
||||
vscode.commands.executeCommand("continue.continueGUIView.focus");
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "userInput",
|
||||
input: `I got the following error, can you please help explain how to fix it?\n\n${terminalContents}`,
|
||||
sidebar.webviewProtocol?.request("userInput", {
|
||||
input: `I got the following error, can you please help explain how to fix it?\n\n${terminalContents.trim()}`,
|
||||
});
|
||||
},
|
||||
"continue.hideInlineTip": () => {
|
||||
|
|
@ -280,21 +291,17 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
// Commands without keyboard shortcuts
|
||||
"continue.addModel": () => {
|
||||
vscode.commands.executeCommand("continue.continueGUIView.focus");
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "addModel",
|
||||
});
|
||||
sidebar.webviewProtocol?.request("addModel", undefined);
|
||||
},
|
||||
"continue.openSettingsUI": () => {
|
||||
vscode.commands.executeCommand("continue.continueGUIView.focus");
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "openSettings",
|
||||
});
|
||||
sidebar.webviewProtocol?.request("openSettings", undefined);
|
||||
},
|
||||
"continue.sendMainUserInput": (text: string) => {
|
||||
ideProtocolClient.sendMainUserInput(text);
|
||||
sidebar.sendMainUserInput(text);
|
||||
},
|
||||
"continue.shareSession": () => {
|
||||
ideProtocolClient.sendMainUserInput("/share");
|
||||
sidebar.sendMainUserInput("/share");
|
||||
},
|
||||
"continue.selectRange": (startLine: number, endLine: number) => {
|
||||
if (!vscode.window.activeTextEditor) {
|
||||
|
|
@ -319,27 +326,17 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
});
|
||||
},
|
||||
"continue.sendToTerminal": (text: string) => {
|
||||
ideProtocolClient.runCommand(text);
|
||||
ide.runCommand(text);
|
||||
},
|
||||
"continue.newSession": () => {
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "newSession",
|
||||
});
|
||||
sidebar.webviewProtocol?.request("newSession", undefined);
|
||||
},
|
||||
"continue.viewHistory": () => {
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "viewHistory",
|
||||
});
|
||||
sidebar.webviewProtocol?.request("viewHistory", undefined);
|
||||
},
|
||||
"continue.toggleFullScreen": () => {
|
||||
// Check if full screen is already open by checking open tabs
|
||||
const tabs = vscode.window.tabGroups.all.flatMap(
|
||||
(tabGroup) => tabGroup.tabs
|
||||
);
|
||||
|
||||
const fullScreenTab = tabs.find(
|
||||
(tab) => (tab.input as any).viewType?.endsWith("continue.continueGUIView")
|
||||
);
|
||||
const fullScreenTab = getFullScreenTab();
|
||||
|
||||
// Check if the active editor is the Continue GUI View
|
||||
if (fullScreenTab && fullScreenTab.isActive) {
|
||||
|
|
@ -364,7 +361,7 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
return;
|
||||
}
|
||||
|
||||
// Close the sidebars
|
||||
// Close the sidebar.webviews
|
||||
// vscode.commands.executeCommand("workbench.action.closeSidebar");
|
||||
vscode.commands.executeCommand("workbench.action.closeAuxiliaryBar");
|
||||
// vscode.commands.executeCommand("workbench.action.toggleZenMode");
|
||||
|
|
@ -373,9 +370,12 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
"Continue",
|
||||
vscode.ViewColumn.One
|
||||
);
|
||||
panel.webview.html = getSidebarContent(
|
||||
panel.webview.html = sidebar.getSidebarContent(
|
||||
extensionContext,
|
||||
panel,
|
||||
ide,
|
||||
configHandler,
|
||||
verticalDiffManager,
|
||||
undefined,
|
||||
undefined,
|
||||
true
|
||||
|
|
@ -388,7 +388,7 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
vscode.commands.executeCommand("continue.continueGUIView.focus");
|
||||
|
||||
for (const uri of uris) {
|
||||
addEntireFileToContext(uri, false);
|
||||
addEntireFileToContext(uri, false, sidebar.webviewProtocol);
|
||||
}
|
||||
},
|
||||
"continue.updateAllReferences": (filepath: vscode.Uri) => {
|
||||
|
|
@ -398,7 +398,7 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
return;
|
||||
}
|
||||
const position = editor.selection.active;
|
||||
ideProtocolClient.sendMainUserInput(
|
||||
sidebar.sendMainUserInput(
|
||||
`/references ${filepath.fsPath} ${position.line} ${position.character}`
|
||||
);
|
||||
},
|
||||
|
|
@ -408,7 +408,7 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
) => {
|
||||
clearTimeout(logRejectionTimeout);
|
||||
outcome.accepted = true;
|
||||
ideProtocolClient.logDevData("autocomplete", outcome);
|
||||
logDevData("autocomplete", outcome);
|
||||
},
|
||||
"continue.toggleTabAutocompleteEnabled": () => {
|
||||
const config = vscode.workspace.getConfiguration("continue");
|
||||
|
|
@ -419,10 +419,27 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
vscode.ConfigurationTarget.Global
|
||||
);
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
export function registerAllCommands(context: vscode.ExtensionContext) {
|
||||
for (const [command, callback] of Object.entries(commandsMap)) {
|
||||
export function registerAllCommands(
|
||||
context: vscode.ExtensionContext,
|
||||
ide: IDE,
|
||||
extensionContext: vscode.ExtensionContext,
|
||||
sidebar: ContinueGUIWebviewViewProvider,
|
||||
configHandler: ConfigHandler,
|
||||
diffManager: DiffManager,
|
||||
verticalDiffManager: VerticalPerLineDiffManager
|
||||
) {
|
||||
for (const [command, callback] of Object.entries(
|
||||
commandsMap(
|
||||
ide,
|
||||
extensionContext,
|
||||
sidebar,
|
||||
configHandler,
|
||||
diffManager,
|
||||
verticalDiffManager
|
||||
)
|
||||
)) {
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand(command, callback)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,707 +1,118 @@
|
|||
import { ContextItemId, DiffLine, FileEdit, ModelDescription } from "core";
|
||||
import { indexDocs } from "core/indexing/docs";
|
||||
import TransformersJsEmbeddingsProvider from "core/indexing/embeddings/TransformersJsEmbeddingsProvider";
|
||||
import { editConfigJson, getConfigJsonPath } from "core/util/paths";
|
||||
import { readFileSync, writeFileSync } from "fs";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { FileEdit, IDE } from "core";
|
||||
import { ConfigHandler } from "core/config/handler";
|
||||
import * as vscode from "vscode";
|
||||
import {
|
||||
extensionContext,
|
||||
ideProtocolClient,
|
||||
showTutorial,
|
||||
windowId,
|
||||
} from "./activation/activate";
|
||||
import { streamEdit } from "./diff/verticalPerLine/manager";
|
||||
import historyManager from "./history";
|
||||
import { VsCodeIde } from "./ideProtocol";
|
||||
import { configHandler, llmFromTitle } from "./loadConfig";
|
||||
import { VerticalPerLineDiffManager } from "./diff/verticalPerLine/manager";
|
||||
import { getTheme } from "./util/getTheme";
|
||||
import { getExtensionUri, getNonce, getUniqueId } from "./util/vscode";
|
||||
import { VsCodeWebviewProtocol } from "./webviewProtocol";
|
||||
|
||||
export let debugPanelWebview: vscode.Webview | undefined;
|
||||
export class ContinueGUIWebviewViewProvider
|
||||
implements vscode.WebviewViewProvider
|
||||
{
|
||||
public static readonly viewType = "continue.continueGUIView";
|
||||
public webviewProtocol: VsCodeWebviewProtocol;
|
||||
|
||||
export async function webviewRequest(
|
||||
messageType: string,
|
||||
data: any = {}
|
||||
): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!debugPanelWebview) {
|
||||
resolve(undefined);
|
||||
resolveWebviewView(
|
||||
webviewView: vscode.WebviewView,
|
||||
_context: vscode.WebviewViewResolveContext,
|
||||
_token: vscode.CancellationToken
|
||||
): void | Thenable<void> {
|
||||
this._webview = webviewView.webview;
|
||||
webviewView.webview.html = this.getSidebarContent(
|
||||
this.extensionContext,
|
||||
webviewView,
|
||||
this.ide,
|
||||
this.configHandler,
|
||||
this.verticalDiffManager
|
||||
);
|
||||
}
|
||||
|
||||
private _webview?: vscode.Webview;
|
||||
|
||||
get webview() {
|
||||
return this._webview;
|
||||
}
|
||||
|
||||
sendMainUserInput(input: string) {
|
||||
this.webview?.postMessage({
|
||||
type: "userInput",
|
||||
input,
|
||||
});
|
||||
}
|
||||
|
||||
constructor(
|
||||
private readonly configHandler: ConfigHandler,
|
||||
private readonly ide: IDE,
|
||||
private readonly windowId: string,
|
||||
private readonly extensionContext: vscode.ExtensionContext,
|
||||
private readonly verticalDiffManager: VerticalPerLineDiffManager
|
||||
) {
|
||||
this.webviewProtocol = new VsCodeWebviewProtocol(
|
||||
ide,
|
||||
configHandler,
|
||||
verticalDiffManager
|
||||
);
|
||||
}
|
||||
|
||||
getSidebarContent(
|
||||
context: vscode.ExtensionContext | undefined,
|
||||
panel: vscode.WebviewPanel | vscode.WebviewView,
|
||||
ide: IDE,
|
||||
configHandler: ConfigHandler,
|
||||
verticalDiffManager: VerticalPerLineDiffManager,
|
||||
page: string | undefined = undefined,
|
||||
edits: FileEdit[] | undefined = undefined,
|
||||
isFullScreen: boolean = false
|
||||
): string {
|
||||
let extensionUri = getExtensionUri();
|
||||
let scriptUri: string;
|
||||
let styleMainUri: string;
|
||||
let vscMediaUrl: string = panel.webview
|
||||
.asWebviewUri(vscode.Uri.joinPath(extensionUri, "gui"))
|
||||
.toString();
|
||||
|
||||
const inDevelopmentMode =
|
||||
context?.extensionMode === vscode.ExtensionMode.Development;
|
||||
if (!inDevelopmentMode) {
|
||||
scriptUri = panel.webview
|
||||
.asWebviewUri(vscode.Uri.joinPath(extensionUri, "gui/assets/index.js"))
|
||||
.toString();
|
||||
styleMainUri = panel.webview
|
||||
.asWebviewUri(vscode.Uri.joinPath(extensionUri, "gui/assets/index.css"))
|
||||
.toString();
|
||||
} else {
|
||||
scriptUri = "http://localhost:5173/src/main.tsx";
|
||||
styleMainUri = "http://localhost:5173/src/index.css";
|
||||
}
|
||||
|
||||
const listener = debugPanelWebview?.onDidReceiveMessage((data) => {
|
||||
if (data.type === messageType) {
|
||||
resolve(data);
|
||||
listener?.dispose();
|
||||
}
|
||||
});
|
||||
|
||||
debugPanelWebview?.postMessage({ type: messageType, data });
|
||||
|
||||
setTimeout(() => {
|
||||
reject("Error communciating with Continue side panel: timed out");
|
||||
listener?.dispose();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
const abortedMessageIds: Set<string> = new Set();
|
||||
|
||||
export function getSidebarContent(
|
||||
context: vscode.ExtensionContext | undefined,
|
||||
panel: vscode.WebviewPanel | vscode.WebviewView,
|
||||
page: string | undefined = undefined,
|
||||
edits: FileEdit[] | undefined = undefined,
|
||||
isFullScreen: boolean = false
|
||||
): string {
|
||||
if (!isFullScreen) {
|
||||
debugPanelWebview = panel.webview;
|
||||
panel.onDidDispose(() => {
|
||||
debugPanelWebview = undefined;
|
||||
});
|
||||
}
|
||||
|
||||
let extensionUri = getExtensionUri();
|
||||
let scriptUri: string;
|
||||
let styleMainUri: string;
|
||||
let vscMediaUrl: string = panel.webview
|
||||
.asWebviewUri(vscode.Uri.joinPath(extensionUri, "gui"))
|
||||
.toString();
|
||||
|
||||
const inDevelopmentMode =
|
||||
context?.extensionMode === vscode.ExtensionMode.Development;
|
||||
if (!inDevelopmentMode) {
|
||||
scriptUri = panel.webview
|
||||
.asWebviewUri(vscode.Uri.joinPath(extensionUri, "gui/assets/index.js"))
|
||||
.toString();
|
||||
styleMainUri = panel.webview
|
||||
.asWebviewUri(vscode.Uri.joinPath(extensionUri, "gui/assets/index.css"))
|
||||
.toString();
|
||||
} else {
|
||||
scriptUri = "http://localhost:5173/src/main.tsx";
|
||||
styleMainUri = "http://localhost:5173/src/index.css";
|
||||
}
|
||||
|
||||
panel.webview.options = {
|
||||
enableScripts: true,
|
||||
localResourceRoots: [
|
||||
vscode.Uri.joinPath(extensionUri, "gui"),
|
||||
vscode.Uri.joinPath(extensionUri, "assets"),
|
||||
],
|
||||
enableCommandUris: true,
|
||||
portMapping: [
|
||||
{
|
||||
webviewPort: 65433,
|
||||
extensionHostPort: 65433,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const nonce = getNonce();
|
||||
|
||||
panel.webview.onDidReceiveMessage(async (data) => {
|
||||
const ide = new VsCodeIde();
|
||||
const respond = (message: any) => {
|
||||
panel.webview.postMessage({
|
||||
type: data.type,
|
||||
messageId: data.messageId,
|
||||
message: message,
|
||||
});
|
||||
panel.webview.options = {
|
||||
enableScripts: true,
|
||||
localResourceRoots: [
|
||||
vscode.Uri.joinPath(extensionUri, "gui"),
|
||||
vscode.Uri.joinPath(extensionUri, "assets"),
|
||||
],
|
||||
enableCommandUris: true,
|
||||
portMapping: [
|
||||
{
|
||||
webviewPort: 65433,
|
||||
extensionHostPort: 65433,
|
||||
},
|
||||
],
|
||||
};
|
||||
try {
|
||||
switch (data.type) {
|
||||
case "abort": {
|
||||
abortedMessageIds.add(data.messageId);
|
||||
break;
|
||||
}
|
||||
case "showFile": {
|
||||
ideProtocolClient.openFile(data.filepath);
|
||||
break;
|
||||
}
|
||||
case "openConfigJson": {
|
||||
ideProtocolClient.openFile(getConfigJsonPath());
|
||||
break;
|
||||
}
|
||||
case "readRangeInFile": {
|
||||
vscode.workspace.openTextDocument(data.filepath).then((document) => {
|
||||
let start = new vscode.Position(0, 0);
|
||||
let end = new vscode.Position(5, 0);
|
||||
let range = new vscode.Range(start, end);
|
||||
|
||||
let contents = document.getText(range);
|
||||
panel.webview.postMessage({
|
||||
type: "readRangeInFile",
|
||||
messageId: data.messageId,
|
||||
contents,
|
||||
});
|
||||
});
|
||||
break;
|
||||
}
|
||||
case "toggleDevTools": {
|
||||
vscode.commands.executeCommand("workbench.action.toggleDevTools");
|
||||
vscode.commands.executeCommand("continue.viewLogs");
|
||||
break;
|
||||
}
|
||||
case "reloadWindow": {
|
||||
vscode.commands.executeCommand("workbench.action.reloadWindow");
|
||||
break;
|
||||
}
|
||||
case "focusEditor": {
|
||||
vscode.commands.executeCommand(
|
||||
"workbench.action.focusActiveEditorGroup"
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "toggleFullScreen": {
|
||||
vscode.commands.executeCommand("continue.toggleFullScreen");
|
||||
break;
|
||||
}
|
||||
case "withProgress": {
|
||||
// This message allows withProgress to be used in the webview
|
||||
if (data.done) {
|
||||
// Will be caught in the listener created below
|
||||
break;
|
||||
}
|
||||
let title = data.title;
|
||||
vscode.window.withProgress(
|
||||
{
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
title,
|
||||
cancellable: false,
|
||||
},
|
||||
async () => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let listener = panel.webview.onDidReceiveMessage(
|
||||
async (data) => {
|
||||
if (
|
||||
data.type === "withProgress" &&
|
||||
data.done &&
|
||||
data.title === title
|
||||
) {
|
||||
listener.dispose();
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
const nonce = getNonce();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// IDE
|
||||
case "getDiff": {
|
||||
respond(await ide.getDiff());
|
||||
break;
|
||||
}
|
||||
case "getSerializedConfig": {
|
||||
respond(await ide.getSerializedConfig());
|
||||
break;
|
||||
}
|
||||
case "getTerminalContents": {
|
||||
respond(await ide.getTerminalContents());
|
||||
break;
|
||||
}
|
||||
case "listWorkspaceContents": {
|
||||
respond(await ide.listWorkspaceContents());
|
||||
break;
|
||||
}
|
||||
case "getWorkspaceDirs": {
|
||||
respond(await ide.getWorkspaceDirs());
|
||||
break;
|
||||
}
|
||||
case "listFolders": {
|
||||
respond(await ide.listFolders());
|
||||
break;
|
||||
}
|
||||
case "writeFile": {
|
||||
respond(
|
||||
await ide.writeFile(data.message.path, data.message.contents)
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "showVirtualFile": {
|
||||
respond(
|
||||
await ide.showVirtualFile(data.message.name, data.message.content)
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "getContinueDir": {
|
||||
respond(await ide.getContinueDir());
|
||||
break;
|
||||
}
|
||||
case "openFile": {
|
||||
respond(await ide.openFile(data.message.path));
|
||||
break;
|
||||
}
|
||||
case "runCommand": {
|
||||
respond(await ide.runCommand(data.message.command));
|
||||
break;
|
||||
}
|
||||
case "getSearchResults": {
|
||||
respond(await ide.getSearchResults(data.message.query));
|
||||
break;
|
||||
}
|
||||
case "subprocess": {
|
||||
respond(await ide.subprocess(data.message.command));
|
||||
break;
|
||||
}
|
||||
case "getFilesToEmbed": {
|
||||
let filesToEmbed = await ide.getFilesToEmbed(data.message.providerId);
|
||||
respond(filesToEmbed);
|
||||
break;
|
||||
}
|
||||
case "sendChunkForFile": {
|
||||
respond(
|
||||
await ide.sendEmbeddingForChunk(
|
||||
data.message.chunk,
|
||||
data.message.embedding,
|
||||
data.message.tags
|
||||
)
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "retrieveChunks": {
|
||||
respond(
|
||||
await ide.retrieveChunks(
|
||||
data.message.text,
|
||||
data.message.n,
|
||||
data.message.directory
|
||||
)
|
||||
);
|
||||
break;
|
||||
}
|
||||
// History
|
||||
case "history": {
|
||||
respond(historyManager.list());
|
||||
break;
|
||||
}
|
||||
case "saveSession": {
|
||||
historyManager.save(data.message);
|
||||
respond({});
|
||||
break;
|
||||
}
|
||||
case "deleteSession": {
|
||||
historyManager.delete(data.message);
|
||||
respond({});
|
||||
break;
|
||||
}
|
||||
case "loadSession": {
|
||||
respond(historyManager.load(data.message));
|
||||
break;
|
||||
}
|
||||
case "saveFile": {
|
||||
respond(await ide.saveFile(data.message.filepath));
|
||||
break;
|
||||
}
|
||||
case "readFile": {
|
||||
respond(await ide.readFile(data.message.filepath));
|
||||
break;
|
||||
}
|
||||
case "showDiff": {
|
||||
respond(
|
||||
await ide.showDiff(
|
||||
data.message.filepath,
|
||||
data.message.newContents,
|
||||
data.message.stepIndex
|
||||
)
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "diffLine": {
|
||||
const {
|
||||
diffLine,
|
||||
filepath,
|
||||
startLine,
|
||||
endLine,
|
||||
}: {
|
||||
diffLine: DiffLine;
|
||||
filepath: string;
|
||||
startLine: number;
|
||||
endLine: number;
|
||||
} = data.message;
|
||||
|
||||
respond(
|
||||
await ide.verticalDiffUpdate(filepath, startLine, endLine, diffLine)
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "getProblems": {
|
||||
respond(await ide.getProblems(data.message.filepath));
|
||||
break;
|
||||
}
|
||||
case "getBranch": {
|
||||
const { dir } = data.message;
|
||||
respond(await ide.getBranch(dir));
|
||||
break;
|
||||
}
|
||||
case "getOpenFiles": {
|
||||
respond(await ide.getOpenFiles());
|
||||
break;
|
||||
}
|
||||
case "getPinnedFiles": {
|
||||
respond(await ide.getPinnedFiles());
|
||||
break;
|
||||
}
|
||||
case "showLines": {
|
||||
const { filepath, startLine, endLine } = data.message;
|
||||
respond(await ide.showLines(filepath, startLine, endLine));
|
||||
break;
|
||||
}
|
||||
// Other
|
||||
case "errorPopup": {
|
||||
vscode.window
|
||||
.showErrorMessage(data.message, "Show Logs")
|
||||
.then((selection) => {
|
||||
if (selection === "Show Logs") {
|
||||
vscode.commands.executeCommand(
|
||||
"workbench.action.toggleDevTools"
|
||||
);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
case "logDevData": {
|
||||
ideProtocolClient.logDevData(data.tableName, data.data);
|
||||
break;
|
||||
}
|
||||
case "addModel": {
|
||||
const model = data.model;
|
||||
const config = readFileSync(getConfigJsonPath(), "utf8");
|
||||
const configJson = JSON.parse(config);
|
||||
configJson.models.push(model);
|
||||
const newConfigString = JSON.stringify(
|
||||
configJson,
|
||||
(key, value) => {
|
||||
return value === null ? undefined : value;
|
||||
},
|
||||
2
|
||||
);
|
||||
writeFileSync(getConfigJsonPath(), newConfigString);
|
||||
configHandler.reloadConfig();
|
||||
ideProtocolClient.openFile(getConfigJsonPath());
|
||||
|
||||
// Find the range where it was added and highlight
|
||||
let lines = newConfigString.split("\n");
|
||||
let startLine;
|
||||
let endLine;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
let line = lines[i];
|
||||
|
||||
if (!startLine) {
|
||||
if (line.trim() === `"title": "${data.model.title}",`) {
|
||||
startLine = i - 1;
|
||||
}
|
||||
} else {
|
||||
if (line.startsWith(" }")) {
|
||||
endLine = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (startLine && endLine) {
|
||||
ideProtocolClient.highlightCode(
|
||||
{
|
||||
filepath: getConfigJsonPath(),
|
||||
range: {
|
||||
start: { character: 0, line: startLine },
|
||||
end: { character: 0, line: endLine },
|
||||
},
|
||||
},
|
||||
"#fff1"
|
||||
);
|
||||
}
|
||||
vscode.window.showInformationMessage(
|
||||
"🎉 Your model has been successfully added to config.json. You can use this file to further edit its configuration."
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "deleteModel": {
|
||||
const configJson = editConfigJson((config) => {
|
||||
config.models = config.models.filter(
|
||||
(m: any) => m.title !== data.title
|
||||
);
|
||||
return config;
|
||||
});
|
||||
configHandler.reloadConfig();
|
||||
break;
|
||||
}
|
||||
case "addOpenAIKey": {
|
||||
const configJson = editConfigJson((config) => {
|
||||
config.models = config.models.map((m: ModelDescription) => {
|
||||
if (m.provider === "free-trial") {
|
||||
m.apiKey = data.key;
|
||||
m.provider = "openai";
|
||||
}
|
||||
return m;
|
||||
});
|
||||
return config;
|
||||
});
|
||||
configHandler.reloadConfig();
|
||||
break;
|
||||
}
|
||||
case "llmStreamComplete": {
|
||||
const model = await llmFromTitle(data.message.title);
|
||||
const gen = model.streamComplete(
|
||||
data.message.prompt,
|
||||
data.message.completionOptions
|
||||
);
|
||||
let next = await gen.next();
|
||||
while (!next.done) {
|
||||
if (abortedMessageIds.has(data.messageId)) {
|
||||
abortedMessageIds.delete(data.messageId);
|
||||
next = await gen.return({ completion: "", prompt: "" });
|
||||
break;
|
||||
}
|
||||
respond({ content: next.value });
|
||||
next = await gen.next();
|
||||
}
|
||||
|
||||
respond({ done: true, data: next.value });
|
||||
break;
|
||||
}
|
||||
case "llmStreamChat": {
|
||||
const model = await llmFromTitle(data.message.title);
|
||||
const gen = model.streamChat(
|
||||
data.message.messages,
|
||||
data.message.completionOptions
|
||||
);
|
||||
let next = await gen.next();
|
||||
while (!next.done) {
|
||||
if (abortedMessageIds.has(data.messageId)) {
|
||||
abortedMessageIds.delete(data.messageId);
|
||||
next = await gen.return({ completion: "", prompt: "" });
|
||||
break;
|
||||
}
|
||||
respond({ content: next.value.content });
|
||||
next = await gen.next();
|
||||
}
|
||||
|
||||
respond({ done: true, data: next.value });
|
||||
break;
|
||||
}
|
||||
case "llmComplete": {
|
||||
const model = await llmFromTitle(data.message.title);
|
||||
const completion = await model.complete(
|
||||
data.message.prompt,
|
||||
data.message.completionOptions
|
||||
);
|
||||
respond({ content: completion });
|
||||
break;
|
||||
}
|
||||
case "runNodeJsSlashCommand": {
|
||||
const {
|
||||
input,
|
||||
history,
|
||||
modelTitle,
|
||||
slashCommandName,
|
||||
contextItems,
|
||||
params,
|
||||
historyIndex,
|
||||
} = data.message;
|
||||
|
||||
const config = await configHandler.loadConfig();
|
||||
const llm = await llmFromTitle(modelTitle);
|
||||
const slashCommand = config.slashCommands?.find(
|
||||
(sc) => sc.name === slashCommandName
|
||||
);
|
||||
if (!slashCommand) {
|
||||
throw new Error(`Unknown slash command ${slashCommandName}`);
|
||||
}
|
||||
|
||||
for await (const update of slashCommand.run({
|
||||
input,
|
||||
history,
|
||||
llm,
|
||||
contextItems,
|
||||
params,
|
||||
ide,
|
||||
addContextItem: (item) => {
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "addContextItem",
|
||||
message: { item, historyIndex },
|
||||
});
|
||||
},
|
||||
})) {
|
||||
if (abortedMessageIds.has(data.messageId)) {
|
||||
abortedMessageIds.delete(data.messageId);
|
||||
break;
|
||||
}
|
||||
respond({ content: update });
|
||||
}
|
||||
respond({ done: true });
|
||||
break;
|
||||
}
|
||||
case "loadSubmenuItems": {
|
||||
const { title } = data.message;
|
||||
const config = await configHandler.loadConfig();
|
||||
const provider = config.contextProviders?.find(
|
||||
(p) => p.description.title === title
|
||||
);
|
||||
if (!provider) {
|
||||
vscode.window.showErrorMessage(
|
||||
`Unknown provider ${title}. Existing providers: ${config.contextProviders
|
||||
?.map((p) => p.description.title)
|
||||
.join(", ")}`
|
||||
);
|
||||
respond({ items: [] });
|
||||
break;
|
||||
}
|
||||
|
||||
try {
|
||||
const items = await provider.loadSubmenuItems({ ide });
|
||||
respond({ items });
|
||||
} catch (e) {
|
||||
vscode.window.showErrorMessage(
|
||||
`Error loading submenu items from ${title}: ${e}`
|
||||
);
|
||||
respond({ items: [] });
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "getContextItems": {
|
||||
const { name, query, fullInput, selectedCode } = data.message;
|
||||
const config = await configHandler.loadConfig();
|
||||
const llm = await llmFromTitle();
|
||||
const provider = config.contextProviders?.find(
|
||||
(p) => p.description.title === name
|
||||
);
|
||||
if (!provider) {
|
||||
vscode.window.showErrorMessage(
|
||||
`Unknown provider ${name}. Existing providers: ${config.contextProviders
|
||||
?.map((p) => p.description.title)
|
||||
.join(", ")}`
|
||||
);
|
||||
respond({ items: [] });
|
||||
break;
|
||||
}
|
||||
|
||||
try {
|
||||
const id: ContextItemId = {
|
||||
providerTitle: provider.description.title,
|
||||
itemId: uuidv4(),
|
||||
};
|
||||
const items = await provider.getContextItems(query, {
|
||||
llm,
|
||||
embeddingsProvider: config.embeddingsProvider,
|
||||
fullInput,
|
||||
ide,
|
||||
selectedCode,
|
||||
});
|
||||
respond({ items: items.map((item) => ({ ...item, id })) });
|
||||
} catch (e) {
|
||||
vscode.window.showErrorMessage(
|
||||
`Error getting context items from ${name}: ${e}`
|
||||
);
|
||||
respond({ items: [] });
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "addDocs": {
|
||||
const { url, title } = data;
|
||||
const embeddingsProvider = new TransformersJsEmbeddingsProvider();
|
||||
vscode.window.withProgress(
|
||||
{
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
title: `Indexing ${title}`,
|
||||
cancellable: false,
|
||||
},
|
||||
async (progress) => {
|
||||
for await (const update of indexDocs(
|
||||
title,
|
||||
new URL(url),
|
||||
embeddingsProvider
|
||||
)) {
|
||||
progress.report({
|
||||
increment: update.progress,
|
||||
message: update.desc,
|
||||
});
|
||||
}
|
||||
|
||||
vscode.window.showInformationMessage(
|
||||
`🎉 Successfully indexed ${title}`
|
||||
);
|
||||
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "refreshSubmenuItems",
|
||||
});
|
||||
}
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "applyToCurrentFile": {
|
||||
// Select the entire current file
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (!editor) {
|
||||
vscode.window.showErrorMessage(
|
||||
"No active editor to apply edits to"
|
||||
);
|
||||
break;
|
||||
}
|
||||
const document = editor.document;
|
||||
|
||||
if (document.getText().trim() === "") {
|
||||
editor.edit((editBuilder) => {
|
||||
editBuilder.insert(document.positionAt(0), data.text);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const start = new vscode.Position(0, 0);
|
||||
const end = new vscode.Position(
|
||||
document.lineCount - 1,
|
||||
document.lineAt(document.lineCount - 1).text.length
|
||||
);
|
||||
editor.selection = new vscode.Selection(start, end);
|
||||
|
||||
streamEdit(
|
||||
`The following code was suggested as an edit:\n\`\`\`\n${data.text}\n\`\`\`\nPlease apply it to the previous code.`
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "showTutorial": {
|
||||
showTutorial();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (e: any) {
|
||||
let message = `Continue error: ${e.message}`;
|
||||
if (e.cause) {
|
||||
if (e.cause.name === "ConnectTimeoutError") {
|
||||
message = `Connection timed out. If you expect it to take a long time to connect, you can increase the timeout in config.json by setting "requestOptions": { "timeout": 10000 }. You can find the full config reference here: https://continue.dev/docs/reference/config`;
|
||||
} else if (e.cause.code === "ECONNREFUSED") {
|
||||
message = `Connection was refused. This likely means that there is no server running at the specified URL. If you are running your own server you may need to set the "apiBase" parameter in config.json. For example, you can set up an OpenAI-compatible server like here: https://continue.dev/docs/reference/Model%20Providers/openai#openai-compatible-servers--apis`;
|
||||
} else {
|
||||
message = `The request failed with "${e.cause.name}": ${e.cause.message}. If you're having trouble setting up Continue, please see the troubleshooting guide for help.`;
|
||||
}
|
||||
const currentTheme = getTheme();
|
||||
vscode.workspace.onDidChangeConfiguration((e) => {
|
||||
if (e.affectsConfiguration("workbench.colorTheme")) {
|
||||
// Send new theme to GUI to update embedded Monaco themes
|
||||
this.webviewProtocol?.request("setTheme", { theme: getTheme() });
|
||||
}
|
||||
});
|
||||
|
||||
vscode.window
|
||||
.showErrorMessage(message, "Show Logs", "Troubleshooting")
|
||||
.then((selection) => {
|
||||
if (selection === "Show Logs") {
|
||||
vscode.commands.executeCommand("workbench.action.toggleDevTools");
|
||||
} else if (selection === "Troubleshooting") {
|
||||
vscode.env.openExternal(
|
||||
vscode.Uri.parse("https://continue.dev/docs/troubleshooting")
|
||||
);
|
||||
}
|
||||
});
|
||||
respond({ done: true, data: {} });
|
||||
}
|
||||
});
|
||||
this.webviewProtocol.webview = panel.webview;
|
||||
|
||||
const currentTheme = getTheme();
|
||||
vscode.workspace.onDidChangeConfiguration((e) => {
|
||||
if (e.affectsConfiguration("workbench.colorTheme")) {
|
||||
// Send new theme to GUI to update embedded Monaco themes
|
||||
debugPanelWebview?.postMessage({ type: "setTheme", theme: getTheme() });
|
||||
}
|
||||
});
|
||||
|
||||
return `<!DOCTYPE html>
|
||||
return `<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
|
@ -729,7 +140,7 @@ export function getSidebarContent(
|
|||
<script type="module" nonce="${nonce}" src="${scriptUri}"></script>
|
||||
|
||||
<script>localStorage.setItem("ide", "vscode")</script>
|
||||
<script>window.windowId = "${windowId}"</script>
|
||||
<script>window.windowId = "${this.windowId}"</script>
|
||||
<script>window.vscMachineId = "${getUniqueId()}"</script>
|
||||
<script>window.vscMediaUrl = "${vscMediaUrl}"</script>
|
||||
<script>window.ide = "vscode"</script>
|
||||
|
|
@ -750,18 +161,5 @@ export function getSidebarContent(
|
|||
${page ? `<script>window.location.pathname = "${page}"</script>` : ""}
|
||||
</body>
|
||||
</html>`;
|
||||
}
|
||||
|
||||
export class ContinueGUIWebviewViewProvider
|
||||
implements vscode.WebviewViewProvider
|
||||
{
|
||||
public static readonly viewType = "continue.continueGUIView";
|
||||
|
||||
resolveWebviewView(
|
||||
webviewView: vscode.WebviewView,
|
||||
_context: vscode.WebviewViewResolveContext,
|
||||
_token: vscode.CancellationToken
|
||||
): void | Thenable<void> {
|
||||
webviewView.webview.html = getSidebarContent(extensionContext, webviewView);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@ import * as fs from "fs";
|
|||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { extensionContext } from "../activation/activate";
|
||||
import { debugPanelWebview } from "../debugPanel";
|
||||
import { getMetaKeyLabel, getPlatform } from "../util/util";
|
||||
import { uriFromFilePath } from "../util/vscode";
|
||||
import { verticalPerLineDiffManager } from "./verticalPerLine/manager";
|
||||
import { VsCodeWebviewProtocol } from "../webviewProtocol";
|
||||
|
||||
interface DiffInfo {
|
||||
originalFilepath: string;
|
||||
|
|
@ -32,7 +30,7 @@ export const DIFF_DIRECTORY = path
|
|||
.join(os.homedir(), ".continue", "diffs")
|
||||
.replace(/^C:/, "c:");
|
||||
|
||||
class DiffManager {
|
||||
export class DiffManager {
|
||||
// Create a temporary file in the global .continue directory which displays the updated version
|
||||
// Doing this because virtual files are read-only
|
||||
private diffs: Map<string, DiffInfo> = new Map();
|
||||
|
|
@ -50,7 +48,9 @@ class DiffManager {
|
|||
}
|
||||
}
|
||||
|
||||
constructor() {
|
||||
webviewProtocol: VsCodeWebviewProtocol | undefined;
|
||||
|
||||
constructor(private readonly extensionContext: vscode.ExtensionContext) {
|
||||
this.setupDirectory();
|
||||
|
||||
// Listen for file closes, and if it's a diff file, clean up
|
||||
|
|
@ -115,7 +115,7 @@ class DiffManager {
|
|||
.update("codeLens", true, vscode.ConfigurationTarget.Global);
|
||||
|
||||
if (
|
||||
extensionContext?.globalState.get<boolean>(
|
||||
this.extensionContext.globalState.get<boolean>(
|
||||
"continue.showDiffInfoMessage"
|
||||
) !== false
|
||||
) {
|
||||
|
|
@ -128,7 +128,7 @@ class DiffManager {
|
|||
.then((selection) => {
|
||||
if (selection === "Don't show again") {
|
||||
// Get the global state
|
||||
extensionContext?.globalState.update(
|
||||
this.extensionContext.globalState.update(
|
||||
"continue.showDiffInfoMessage",
|
||||
false
|
||||
);
|
||||
|
|
@ -289,7 +289,7 @@ class DiffManager {
|
|||
}
|
||||
|
||||
// Stop the step at step_index in case it is still streaming
|
||||
debugPanelWebview?.postMessage({ type: "setInactive" });
|
||||
this.webviewProtocol?.request("setInactive", undefined);
|
||||
|
||||
vscode.workspace.textDocuments
|
||||
.find((doc) => doc.uri.fsPath === newFilepath)
|
||||
|
|
@ -302,8 +302,6 @@ class DiffManager {
|
|||
}
|
||||
}
|
||||
|
||||
export const diffManager = new DiffManager();
|
||||
|
||||
async function recordAcceptReject(accepted: boolean, diffInfo: DiffInfo) {
|
||||
const devDataDir = devDataPath();
|
||||
const suggestionsPath = path.join(devDataDir, "suggestions.json");
|
||||
|
|
@ -333,19 +331,3 @@ async function recordAcceptReject(accepted: boolean, diffInfo: DiffInfo) {
|
|||
JSON.stringify(suggestions, null, 4)
|
||||
);
|
||||
}
|
||||
|
||||
export async function acceptDiffCommand(newFilepath?: string | vscode.Uri) {
|
||||
if (newFilepath instanceof vscode.Uri) {
|
||||
newFilepath = newFilepath.fsPath;
|
||||
}
|
||||
verticalPerLineDiffManager.clearForFilepath(newFilepath, true);
|
||||
await diffManager.acceptDiff(newFilepath);
|
||||
}
|
||||
|
||||
export async function rejectDiffCommand(newFilepath?: string | vscode.Uri) {
|
||||
if (newFilepath instanceof vscode.Uri) {
|
||||
newFilepath = newFilepath.fsPath;
|
||||
}
|
||||
verticalPerLineDiffManager.clearForFilepath(newFilepath, false);
|
||||
await diffManager.rejectDiff(newFilepath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,7 @@ import {
|
|||
indexDecorationType,
|
||||
redDecorationType,
|
||||
} from "./decorations";
|
||||
import {
|
||||
editorToVerticalDiffCodeLens,
|
||||
verticalPerLineDiffManager,
|
||||
} from "./manager";
|
||||
import { VerticalDiffCodeLens } from "./manager";
|
||||
|
||||
export class VerticalPerLineDiffHandler {
|
||||
private editor: vscode.TextEditor;
|
||||
|
|
@ -33,6 +30,14 @@ export class VerticalPerLineDiffHandler {
|
|||
startLine: number,
|
||||
endLine: number,
|
||||
editor: vscode.TextEditor,
|
||||
private readonly editorToVerticalDiffCodeLens: Map<
|
||||
string,
|
||||
VerticalDiffCodeLens[]
|
||||
>,
|
||||
private readonly clearForFilepath: (
|
||||
filepath: string | undefined,
|
||||
accept: boolean
|
||||
) => void,
|
||||
input?: string
|
||||
) {
|
||||
this.currentLineIndex = startLine;
|
||||
|
|
@ -71,13 +76,13 @@ export class VerticalPerLineDiffHandler {
|
|||
}
|
||||
|
||||
if (this.deletionBuffer.length || this.insertedInCurrentBlock > 0) {
|
||||
const blocks = editorToVerticalDiffCodeLens.get(this.filepath) || [];
|
||||
const blocks = this.editorToVerticalDiffCodeLens.get(this.filepath) || [];
|
||||
blocks.push({
|
||||
start: this.currentLineIndex - this.insertedInCurrentBlock,
|
||||
numRed: this.deletionBuffer.length,
|
||||
numGreen: this.insertedInCurrentBlock,
|
||||
});
|
||||
editorToVerticalDiffCodeLens.set(this.filepath, blocks);
|
||||
this.editorToVerticalDiffCodeLens.set(this.filepath, blocks);
|
||||
}
|
||||
|
||||
if (this.deletionBuffer.length === 0) {
|
||||
|
|
@ -188,7 +193,7 @@ export class VerticalPerLineDiffHandler {
|
|||
this.greenDecorationManager.clear();
|
||||
this.clearIndexLineDecorations();
|
||||
|
||||
editorToVerticalDiffCodeLens.delete(this.filepath);
|
||||
this.editorToVerticalDiffCodeLens.delete(this.filepath);
|
||||
|
||||
this.editor.edit((editBuilder) => {
|
||||
for (const range of rangesToDelete) {
|
||||
|
|
@ -251,7 +256,7 @@ export class VerticalPerLineDiffHandler {
|
|||
// }
|
||||
// });
|
||||
} catch (e) {
|
||||
verticalPerLineDiffManager.clearForFilepath(this.filepath, false);
|
||||
this.clearForFilepath(this.filepath, false);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
|
@ -288,7 +293,7 @@ export class VerticalPerLineDiffHandler {
|
|||
|
||||
// Shift the codelens objects
|
||||
const blocks =
|
||||
editorToVerticalDiffCodeLens
|
||||
this.editorToVerticalDiffCodeLens
|
||||
.get(this.filepath)
|
||||
?.filter((x) => x.start !== startLine)
|
||||
.map((x) => {
|
||||
|
|
@ -297,6 +302,6 @@ export class VerticalPerLineDiffHandler {
|
|||
}
|
||||
return x;
|
||||
}) || [];
|
||||
editorToVerticalDiffCodeLens.set(this.filepath, blocks);
|
||||
this.editorToVerticalDiffCodeLens.set(this.filepath, blocks);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,23 @@
|
|||
import { streamDiffLines } from "core/commands/slash/verticalEdit";
|
||||
import { ConfigHandler } from "core/config/handler";
|
||||
import { getMarkdownLanguageTagForFile } from "core/util";
|
||||
import { streamDiffLines } from "core/util/verticalEdit";
|
||||
import * as vscode from "vscode";
|
||||
import { llmFromTitle } from "../../loadConfig";
|
||||
import { VerticalPerLineDiffHandler } from "./handler";
|
||||
|
||||
class VerticalPerLineDiffManager {
|
||||
export interface VerticalDiffCodeLens {
|
||||
start: number;
|
||||
numRed: number;
|
||||
numGreen: number;
|
||||
}
|
||||
|
||||
export class VerticalPerLineDiffManager {
|
||||
private filepathToEditorMap: Map<string, VerticalPerLineDiffHandler> =
|
||||
new Map();
|
||||
|
||||
editorToVerticalDiffCodeLens: Map<string, VerticalDiffCodeLens[]> = new Map();
|
||||
|
||||
constructor(private readonly configHandler: ConfigHandler) {}
|
||||
|
||||
createVerticalPerLineDiffHandler(
|
||||
filepath: string,
|
||||
startLine: number,
|
||||
|
|
@ -24,6 +34,8 @@ class VerticalPerLineDiffManager {
|
|||
startLine,
|
||||
endLine,
|
||||
editor,
|
||||
this.editorToVerticalDiffCodeLens,
|
||||
this.clearForFilepath,
|
||||
input
|
||||
);
|
||||
this.filepathToEditorMap.set(filepath, handler);
|
||||
|
|
@ -46,7 +58,9 @@ class VerticalPerLineDiffManager {
|
|||
const handler = new VerticalPerLineDiffHandler(
|
||||
startLine,
|
||||
endLine,
|
||||
editor
|
||||
editor,
|
||||
this.editorToVerticalDiffCodeLens,
|
||||
this.clearForFilepath
|
||||
);
|
||||
this.filepathToEditorMap.set(filepath, handler);
|
||||
return handler;
|
||||
|
|
@ -75,78 +89,113 @@ class VerticalPerLineDiffManager {
|
|||
this.filepathToEditorMap.delete(filepath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const verticalPerLineDiffManager = new VerticalPerLineDiffManager();
|
||||
acceptRejectVerticalDiffBlock(
|
||||
accept: boolean,
|
||||
filepath?: string,
|
||||
index?: number
|
||||
) {
|
||||
if (!filepath) {
|
||||
const activeEditor = vscode.window.activeTextEditor;
|
||||
if (!activeEditor) {
|
||||
return;
|
||||
}
|
||||
filepath = activeEditor.document.uri.fsPath;
|
||||
}
|
||||
|
||||
export async function streamEdit(input: string) {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return;
|
||||
if (typeof index === "undefined") {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
let blocks = this.editorToVerticalDiffCodeLens.get(filepath);
|
||||
const block = blocks?.[index];
|
||||
if (!blocks || !block) {
|
||||
return;
|
||||
}
|
||||
|
||||
const handler = this.getHandlerForFile(filepath);
|
||||
if (!handler) {
|
||||
return;
|
||||
}
|
||||
|
||||
// CodeLens object removed from editorToVerticalDiffCodeLens here
|
||||
handler.acceptRejectBlock(
|
||||
accept,
|
||||
block.start,
|
||||
block.numGreen,
|
||||
block.numRed
|
||||
);
|
||||
}
|
||||
|
||||
const filepath = editor.document.uri.fsPath;
|
||||
const startLine = editor.selection.start.line;
|
||||
const endLine = editor.selection.end.line;
|
||||
async streamEdit(input: string) {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
const existingHandler =
|
||||
verticalPerLineDiffManager.getHandlerForFile(filepath);
|
||||
existingHandler?.clear(false);
|
||||
await new Promise((resolve) => {
|
||||
setTimeout(resolve, 200);
|
||||
});
|
||||
const diffHandler =
|
||||
verticalPerLineDiffManager.createVerticalPerLineDiffHandler(
|
||||
const filepath = editor.document.uri.fsPath;
|
||||
const startLine = editor.selection.start.line;
|
||||
const endLine = editor.selection.end.line;
|
||||
|
||||
const existingHandler = this.getHandlerForFile(filepath);
|
||||
existingHandler?.clear(false);
|
||||
await new Promise((resolve) => {
|
||||
setTimeout(resolve, 200);
|
||||
});
|
||||
const diffHandler = this.createVerticalPerLineDiffHandler(
|
||||
filepath,
|
||||
existingHandler?.range.start.line ?? startLine,
|
||||
existingHandler?.range.end.line ?? endLine,
|
||||
input
|
||||
);
|
||||
if (!diffHandler) {
|
||||
return;
|
||||
}
|
||||
if (!diffHandler) {
|
||||
return;
|
||||
}
|
||||
|
||||
const selectedRange =
|
||||
existingHandler?.range ??
|
||||
new vscode.Range(
|
||||
editor.selection.start.with(undefined, 0),
|
||||
editor.selection.end.with(undefined, Number.MAX_SAFE_INTEGER)
|
||||
const selectedRange =
|
||||
existingHandler?.range ??
|
||||
new vscode.Range(
|
||||
editor.selection.start.with(undefined, 0),
|
||||
editor.selection.end.with(undefined, Number.MAX_SAFE_INTEGER)
|
||||
);
|
||||
const rangeContent = editor.document.getText(selectedRange);
|
||||
const llm = await this.configHandler.llmFromTitle();
|
||||
|
||||
// Unselect the range
|
||||
editor.selection = new vscode.Selection(
|
||||
editor.selection.active,
|
||||
editor.selection.active
|
||||
);
|
||||
const rangeContent = editor.document.getText(selectedRange);
|
||||
const llm = await llmFromTitle();
|
||||
|
||||
// Unselect the range
|
||||
editor.selection = new vscode.Selection(
|
||||
editor.selection.active,
|
||||
editor.selection.active
|
||||
);
|
||||
vscode.commands.executeCommand(
|
||||
"setContext",
|
||||
"continue.streamingDiff",
|
||||
true
|
||||
);
|
||||
|
||||
vscode.commands.executeCommand("setContext", "continue.streamingDiff", true);
|
||||
|
||||
if (existingHandler?.input) {
|
||||
if (existingHandler.input.startsWith("Original request: ")) {
|
||||
existingHandler.input = existingHandler.input.substring(
|
||||
"Original request: ".length
|
||||
if (existingHandler?.input) {
|
||||
if (existingHandler.input.startsWith("Original request: ")) {
|
||||
existingHandler.input = existingHandler.input.substring(
|
||||
"Original request: ".length
|
||||
);
|
||||
}
|
||||
input = `Original request: ${existingHandler.input}\nUpdated request: ${input}`;
|
||||
}
|
||||
try {
|
||||
await diffHandler.run(
|
||||
streamDiffLines(
|
||||
rangeContent,
|
||||
llm,
|
||||
input,
|
||||
getMarkdownLanguageTagForFile(filepath)
|
||||
)
|
||||
);
|
||||
} finally {
|
||||
vscode.commands.executeCommand(
|
||||
"setContext",
|
||||
"continue.streamingDiff",
|
||||
false
|
||||
);
|
||||
}
|
||||
input = `Original request: ${existingHandler.input}\nUpdated request: ${input}`;
|
||||
}
|
||||
|
||||
await diffHandler.run(
|
||||
streamDiffLines(
|
||||
rangeContent,
|
||||
llm,
|
||||
input,
|
||||
getMarkdownLanguageTagForFile(filepath)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export interface VerticalDiffCodeLens {
|
||||
start: number;
|
||||
numRed: number;
|
||||
numGreen: number;
|
||||
}
|
||||
|
||||
export const editorToVerticalDiffCodeLens: Map<string, VerticalDiffCodeLens[]> =
|
||||
new Map();
|
||||
|
|
|
|||
0
extensions/vscode/src/extension/autocomplete.ts
Normal file
0
extensions/vscode/src/extension/autocomplete.ts
Normal file
0
extensions/vscode/src/extension/indexing.ts
Normal file
0
extensions/vscode/src/extension/indexing.ts
Normal file
228
extensions/vscode/src/extension/vscodeExtension.ts
Normal file
228
extensions/vscode/src/extension/vscodeExtension.ts
Normal file
|
|
@ -0,0 +1,228 @@
|
|||
import { ConfigHandler } from "core/config/handler";
|
||||
import { CodebaseIndexer, PauseToken } from "core/indexing/indexCodebase";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import * as vscode from "vscode";
|
||||
import { registerAllCommands } from "../commands";
|
||||
import { ContinueGUIWebviewViewProvider } from "../debugPanel";
|
||||
import { DiffManager } from "../diff/horizontal";
|
||||
import { VerticalPerLineDiffManager } from "../diff/verticalPerLine/manager";
|
||||
import { VsCodeIde } from "../ideProtocol";
|
||||
import { registerAllCodeLensProviders } from "../lang-server/codeLens";
|
||||
import {
|
||||
ContinueCompletionProvider,
|
||||
setupStatusBar,
|
||||
} from "../lang-server/completionProvider";
|
||||
import { TabAutocompleteModel } from "../util/loadAutocompleteModel";
|
||||
import { RemoteConfigSync } from "../util/remoteConfig";
|
||||
import { VsCodeWebviewProtocol } from "../webviewProtocol";
|
||||
|
||||
export class VsCodeExtension {
|
||||
private configHandler: ConfigHandler;
|
||||
private extensionContext: vscode.ExtensionContext;
|
||||
private ide: VsCodeIde;
|
||||
private tabAutocompleteModel: TabAutocompleteModel;
|
||||
private sidebar: ContinueGUIWebviewViewProvider;
|
||||
private windowId: string;
|
||||
private indexer: CodebaseIndexer;
|
||||
private diffManager: DiffManager;
|
||||
private verticalDiffManager: VerticalPerLineDiffManager;
|
||||
private webviewProtocol: VsCodeWebviewProtocol;
|
||||
|
||||
constructor(context: vscode.ExtensionContext) {
|
||||
this.diffManager = new DiffManager(context);
|
||||
this.ide = new VsCodeIde(this.diffManager);
|
||||
const remoteUrl = vscode.workspace
|
||||
.getConfiguration("continue")
|
||||
.get<string | undefined>("remoteConfigServerUrl", undefined);
|
||||
|
||||
// Config Handler with output channel
|
||||
const outputChannel = vscode.window.createOutputChannel(
|
||||
"Continue - LLM Prompt/Completion"
|
||||
);
|
||||
this.configHandler = new ConfigHandler(
|
||||
this.ide,
|
||||
remoteUrl === undefined || remoteUrl === ""
|
||||
? undefined
|
||||
: new URL(remoteUrl),
|
||||
async (log: string) => {
|
||||
outputChannel.appendLine(
|
||||
"=========================================================================="
|
||||
);
|
||||
outputChannel.appendLine(
|
||||
"=========================================================================="
|
||||
);
|
||||
outputChannel.append(log);
|
||||
},
|
||||
() => this.webviewProtocol?.request("configUpdate", undefined)
|
||||
);
|
||||
|
||||
this.configHandler.reloadConfig();
|
||||
this.verticalDiffManager = new VerticalPerLineDiffManager(
|
||||
this.configHandler
|
||||
);
|
||||
this.extensionContext = context;
|
||||
this.tabAutocompleteModel = new TabAutocompleteModel(this.configHandler);
|
||||
this.windowId = uuidv4();
|
||||
this.sidebar = new ContinueGUIWebviewViewProvider(
|
||||
this.configHandler,
|
||||
this.ide,
|
||||
this.windowId,
|
||||
this.extensionContext,
|
||||
this.verticalDiffManager
|
||||
);
|
||||
try {
|
||||
const configSync = new RemoteConfigSync(
|
||||
this.configHandler.reloadConfig.bind(this.configHandler)
|
||||
);
|
||||
configSync.setup();
|
||||
} catch (e) {
|
||||
console.warn(`Failed to sync remote config: ${e}`);
|
||||
}
|
||||
|
||||
// Sidebar
|
||||
context.subscriptions.push(
|
||||
vscode.window.registerWebviewViewProvider(
|
||||
"continue.continueGUIView",
|
||||
this.sidebar,
|
||||
{
|
||||
webviewOptions: { retainContextWhenHidden: true },
|
||||
}
|
||||
)
|
||||
);
|
||||
this.webviewProtocol = this.sidebar.webviewProtocol;
|
||||
|
||||
// Indexing + pause token
|
||||
const indexingPauseToken = new PauseToken(
|
||||
context.globalState.get<boolean>("continue.indexingPaused") === true
|
||||
);
|
||||
this.webviewProtocol.on("index/setPaused", (msg) => {
|
||||
context.globalState.update("continue.indexingPaused", msg.data);
|
||||
indexingPauseToken.paused = msg.data;
|
||||
});
|
||||
|
||||
this.diffManager.webviewProtocol = this.webviewProtocol;
|
||||
this.indexer = new CodebaseIndexer(
|
||||
this.configHandler,
|
||||
this.ide,
|
||||
indexingPauseToken
|
||||
);
|
||||
|
||||
// CodeLens
|
||||
registerAllCodeLensProviders(
|
||||
context,
|
||||
this.diffManager,
|
||||
this.verticalDiffManager.editorToVerticalDiffCodeLens
|
||||
);
|
||||
|
||||
// Tab autocomplete
|
||||
const config = vscode.workspace.getConfiguration("continue");
|
||||
const enabled = config.get<boolean>("enableTabAutocomplete");
|
||||
|
||||
// Register inline completion provider (odd versions are pre-release)
|
||||
if (
|
||||
parseInt(context.extension.packageJSON.version.split(".")[1]) % 2 !==
|
||||
0
|
||||
) {
|
||||
setupStatusBar(enabled);
|
||||
context.subscriptions.push(
|
||||
vscode.languages.registerInlineCompletionItemProvider(
|
||||
[{ pattern: "**" }],
|
||||
new ContinueCompletionProvider(
|
||||
this.configHandler,
|
||||
this.ide,
|
||||
this.tabAutocompleteModel
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Commands
|
||||
registerAllCommands(
|
||||
context,
|
||||
this.ide,
|
||||
context,
|
||||
this.sidebar,
|
||||
this.configHandler,
|
||||
this.diffManager,
|
||||
this.verticalDiffManager
|
||||
);
|
||||
|
||||
// Indexing
|
||||
this.ide.getWorkspaceDirs().then((dirs) => this.refreshCodebaseIndex(dirs));
|
||||
|
||||
// Listen for file saving
|
||||
vscode.workspace.onDidSaveTextDocument((event) => {
|
||||
const filepath = event.uri.fsPath;
|
||||
|
||||
if (
|
||||
filepath.endsWith(".continue/config.json") ||
|
||||
filepath.endsWith(".continue\\config.json") ||
|
||||
filepath.endsWith(".continue/config.ts") ||
|
||||
filepath.endsWith(".continue\\config.ts") ||
|
||||
filepath.endsWith(".continuerc.json")
|
||||
) {
|
||||
this.configHandler.reloadConfig();
|
||||
this.tabAutocompleteModel.clearLlm();
|
||||
} else if (
|
||||
filepath.endsWith(".continueignore") ||
|
||||
filepath.endsWith(".gitignore")
|
||||
) {
|
||||
// Update embeddings! (TODO)
|
||||
}
|
||||
});
|
||||
|
||||
// Refresh index when branch is changed
|
||||
this.ide.getWorkspaceDirs().then((dirs) =>
|
||||
dirs.forEach(async (dir) => {
|
||||
const repo = await this.ide.getRepo(vscode.Uri.file(dir));
|
||||
if (repo) {
|
||||
repo.state.onDidChange(() => {
|
||||
// args passed to this callback are always undefined, so keep track of previous branch
|
||||
const currentBranch = repo?.state?.HEAD?.name;
|
||||
if (currentBranch) {
|
||||
if (this.PREVIOUS_BRANCH_FOR_WORKSPACE_DIR[dir]) {
|
||||
if (
|
||||
currentBranch !== this.PREVIOUS_BRANCH_FOR_WORKSPACE_DIR[dir]
|
||||
) {
|
||||
// Trigger refresh of index only in this directory
|
||||
this.refreshCodebaseIndex([dir]);
|
||||
}
|
||||
}
|
||||
|
||||
this.PREVIOUS_BRANCH_FOR_WORKSPACE_DIR[dir] = currentBranch;
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
// Register a content provider for the readonly virtual documents
|
||||
const documentContentProvider = new (class
|
||||
implements vscode.TextDocumentContentProvider
|
||||
{
|
||||
// emitter and its event
|
||||
onDidChangeEmitter = new vscode.EventEmitter<vscode.Uri>();
|
||||
onDidChange = this.onDidChangeEmitter.event;
|
||||
|
||||
provideTextDocumentContent(uri: vscode.Uri): string {
|
||||
return uri.query;
|
||||
}
|
||||
})();
|
||||
context.subscriptions.push(
|
||||
vscode.workspace.registerTextDocumentContentProvider(
|
||||
VsCodeExtension.continueVirtualDocumentScheme,
|
||||
documentContentProvider
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
static continueVirtualDocumentScheme = "continue";
|
||||
|
||||
private PREVIOUS_BRANCH_FOR_WORKSPACE_DIR: { [dir: string]: string } = {};
|
||||
|
||||
private async refreshCodebaseIndex(dirs: string[]) {
|
||||
for await (const update of this.indexer.refresh(dirs)) {
|
||||
this.webviewProtocol.request("indexProgress", update);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,48 +2,105 @@ import { exec } from "child_process";
|
|||
import { getContinueGlobalPath } from "core/util/paths";
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { ideProtocolClient } from "./activation/activate";
|
||||
|
||||
import * as child_process from "child_process";
|
||||
import { Chunk, DiffLine, IDE, Problem } from "core";
|
||||
import {
|
||||
BrowserSerializedContinueConfig,
|
||||
finalToBrowserConfig,
|
||||
} from "core/config/load";
|
||||
import { LanceDbIndex } from "core/indexing/LanceDbIndex";
|
||||
import { IndexTag } from "core/indexing/types";
|
||||
import { verticalPerLineDiffManager } from "./diff/verticalPerLine/manager";
|
||||
import { configHandler } from "./loadConfig";
|
||||
import { ContinueRcJson, IDE, IdeInfo, Problem, Range } from "core";
|
||||
import { DiffManager } from "./diff/horizontal";
|
||||
import { VsCodeIdeUtils } from "./util/ideUtils";
|
||||
import { traverseDirectory } from "./util/traverseDirectory";
|
||||
import { getExtensionUri, openEditorAndRevealRange } from "./util/vscode";
|
||||
|
||||
class VsCodeIde implements IDE {
|
||||
async getSerializedConfig(): Promise<BrowserSerializedContinueConfig> {
|
||||
const config = await configHandler.loadConfig();
|
||||
return finalToBrowserConfig(config);
|
||||
ideUtils: VsCodeIdeUtils;
|
||||
|
||||
constructor(private readonly diffManager: DiffManager) {
|
||||
this.ideUtils = new VsCodeIdeUtils();
|
||||
}
|
||||
getIdeInfo(): Promise<IdeInfo> {
|
||||
return Promise.resolve({
|
||||
ideType: "vscode",
|
||||
name: vscode.env.appName,
|
||||
version: vscode.version,
|
||||
remoteName: vscode.env.remoteName || "local",
|
||||
});
|
||||
}
|
||||
readRangeInFile(filepath: string, range: Range): Promise<string> {
|
||||
return this.ideUtils.readRangeInFile(
|
||||
filepath,
|
||||
new vscode.Range(
|
||||
new vscode.Position(range.start.line, range.start.character),
|
||||
new vscode.Position(range.end.line, range.end.character)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
async getStats(directory: string): Promise<{ [path: string]: number }> {
|
||||
const files = await this.listWorkspaceContents(directory);
|
||||
const pathToLastModified: { [path: string]: number } = {};
|
||||
await Promise.all(
|
||||
files.map(async (file) => {
|
||||
let stat = await vscode.workspace.fs.stat(vscode.Uri.file(file));
|
||||
pathToLastModified[file] = stat.mtime;
|
||||
})
|
||||
);
|
||||
|
||||
return pathToLastModified;
|
||||
}
|
||||
|
||||
async getRepo(dir: vscode.Uri): Promise<any> {
|
||||
return this.ideUtils.getRepo(dir);
|
||||
}
|
||||
|
||||
async isTelemetryEnabled(): Promise<boolean> {
|
||||
return (
|
||||
(await vscode.workspace
|
||||
.getConfiguration("continue")
|
||||
.get("telemetryEnabled")) ?? true
|
||||
);
|
||||
}
|
||||
getUniqueId(): Promise<string> {
|
||||
return Promise.resolve(vscode.env.machineId);
|
||||
}
|
||||
|
||||
async getDiff(): Promise<string> {
|
||||
return await ideProtocolClient.getDiff();
|
||||
return await this.ideUtils.getDiff();
|
||||
}
|
||||
|
||||
async getTerminalContents(): Promise<string> {
|
||||
return await ideProtocolClient.getTerminalContents(1);
|
||||
return await this.ideUtils.getTerminalContents(1);
|
||||
}
|
||||
|
||||
async listWorkspaceContents(directory?: string): Promise<string[]> {
|
||||
if (directory) {
|
||||
return await ideProtocolClient.getDirectoryContents(directory, true);
|
||||
return await this.ideUtils.getDirectoryContents(directory, true);
|
||||
} else {
|
||||
const contents = await Promise.all(
|
||||
ideProtocolClient
|
||||
this.ideUtils
|
||||
.getWorkspaceDirectories()
|
||||
.map((dir) => ideProtocolClient.getDirectoryContents(dir, true))
|
||||
.map((dir) => this.ideUtils.getDirectoryContents(dir, true))
|
||||
);
|
||||
return contents.flat();
|
||||
}
|
||||
}
|
||||
|
||||
async getWorkspaceConfigs() {
|
||||
const workspaceDirs =
|
||||
vscode.workspace.workspaceFolders?.map((folder) => folder.uri) || [];
|
||||
const configs: ContinueRcJson[] = [];
|
||||
for (const workspaceDir of workspaceDirs) {
|
||||
const files = await vscode.workspace.fs.readDirectory(workspaceDir);
|
||||
for (const [filename, type] of files) {
|
||||
if (type === vscode.FileType.File && filename === ".continuerc.json") {
|
||||
const contents = await this.ideUtils.readFile(
|
||||
vscode.Uri.joinPath(workspaceDir, filename).fsPath
|
||||
);
|
||||
configs.push(JSON.parse(contents));
|
||||
}
|
||||
}
|
||||
}
|
||||
return configs;
|
||||
}
|
||||
|
||||
async listFolders(): Promise<string[]> {
|
||||
const allDirs: string[] = [];
|
||||
|
||||
|
|
@ -63,7 +120,7 @@ class VsCodeIde implements IDE {
|
|||
}
|
||||
|
||||
async getWorkspaceDirs(): Promise<string[]> {
|
||||
return ideProtocolClient.getWorkspaceDirectories();
|
||||
return this.ideUtils.getWorkspaceDirectories();
|
||||
}
|
||||
|
||||
async getContinueDir(): Promise<string> {
|
||||
|
|
@ -78,11 +135,11 @@ class VsCodeIde implements IDE {
|
|||
}
|
||||
|
||||
async showVirtualFile(title: string, contents: string): Promise<void> {
|
||||
ideProtocolClient.showVirtualFile(title, contents);
|
||||
this.ideUtils.showVirtualFile(title, contents);
|
||||
}
|
||||
|
||||
async openFile(path: string): Promise<void> {
|
||||
ideProtocolClient.openFile(path);
|
||||
this.ideUtils.openFile(path);
|
||||
}
|
||||
|
||||
async showLines(
|
||||
|
|
@ -95,53 +152,44 @@ class VsCodeIde implements IDE {
|
|||
new vscode.Position(endLine, 0)
|
||||
);
|
||||
openEditorAndRevealRange(filepath, range).then(() => {
|
||||
ideProtocolClient.highlightCode(
|
||||
{
|
||||
filepath,
|
||||
range,
|
||||
},
|
||||
"#fff1"
|
||||
);
|
||||
// TODO: Highlight lines
|
||||
// this.ideUtils.highlightCode(
|
||||
// {
|
||||
// filepath,
|
||||
// range,
|
||||
// },
|
||||
// "#fff1"
|
||||
// );
|
||||
});
|
||||
}
|
||||
|
||||
async runCommand(command: string): Promise<void> {
|
||||
await ideProtocolClient.runCommand(command);
|
||||
if (vscode.window.terminals.length) {
|
||||
vscode.window.terminals[0].show();
|
||||
vscode.window.terminals[0].sendText(command, false);
|
||||
} else {
|
||||
const terminal = vscode.window.createTerminal();
|
||||
terminal.show();
|
||||
terminal.sendText(command, false);
|
||||
}
|
||||
}
|
||||
|
||||
async saveFile(filepath: string): Promise<void> {
|
||||
await ideProtocolClient.saveFile(filepath);
|
||||
await this.ideUtils.saveFile(filepath);
|
||||
}
|
||||
async readFile(filepath: string): Promise<string> {
|
||||
return await ideProtocolClient.readFile(filepath);
|
||||
return await this.ideUtils.readFile(filepath);
|
||||
}
|
||||
async showDiff(
|
||||
filepath: string,
|
||||
newContents: string,
|
||||
stepIndex: number
|
||||
): Promise<void> {
|
||||
await ideProtocolClient.showDiff(filepath, newContents, stepIndex);
|
||||
}
|
||||
|
||||
async verticalDiffUpdate(
|
||||
filepath: string,
|
||||
startLine: number,
|
||||
endLine: number,
|
||||
diffLine: DiffLine
|
||||
) {
|
||||
const diffHandler =
|
||||
verticalPerLineDiffManager.getOrCreateVerticalPerLineDiffHandler(
|
||||
filepath,
|
||||
startLine,
|
||||
endLine
|
||||
);
|
||||
if (diffHandler) {
|
||||
await diffHandler.handleDiffLine(diffLine);
|
||||
}
|
||||
await this.diffManager.writeDiff(filepath, newContents, stepIndex);
|
||||
}
|
||||
|
||||
async getOpenFiles(): Promise<string[]> {
|
||||
return await ideProtocolClient.getOpenFiles();
|
||||
return await this.ideUtils.getOpenFiles();
|
||||
}
|
||||
|
||||
async getPinnedFiles(): Promise<string[]> {
|
||||
|
|
@ -227,48 +275,7 @@ class VsCodeIde implements IDE {
|
|||
}
|
||||
|
||||
async getBranch(dir: string): Promise<string> {
|
||||
return ideProtocolClient.getBranch(vscode.Uri.file(dir));
|
||||
}
|
||||
|
||||
async getFilesToEmbed(
|
||||
providerId: string
|
||||
): Promise<[string, string, string][]> {
|
||||
return [];
|
||||
}
|
||||
|
||||
async sendEmbeddingForChunk(
|
||||
chunk: Chunk,
|
||||
embedding: number[],
|
||||
tags: string[]
|
||||
) {}
|
||||
|
||||
async retrieveChunks(
|
||||
text: string,
|
||||
n: number,
|
||||
directory: string | undefined
|
||||
): Promise<Chunk[]> {
|
||||
const embeddingsProvider = (await configHandler.loadConfig())
|
||||
.embeddingsProvider;
|
||||
if (!embeddingsProvider) {
|
||||
return [];
|
||||
}
|
||||
const lanceDbIndex = new LanceDbIndex(embeddingsProvider, (path) =>
|
||||
ideProtocolClient.readFile(path)
|
||||
);
|
||||
|
||||
const tags = await Promise.all(
|
||||
(await this.getWorkspaceDirs()).map(async (dir) => {
|
||||
let branch = await ideProtocolClient.getBranch(vscode.Uri.file(dir));
|
||||
let tag: IndexTag = {
|
||||
directory: dir,
|
||||
branch,
|
||||
artifactId: lanceDbIndex.artifactId,
|
||||
};
|
||||
return tag;
|
||||
})
|
||||
);
|
||||
let chunks = await lanceDbIndex.retrieve(tags, text, n, directory);
|
||||
return chunks as any[];
|
||||
return this.ideUtils.getBranch(vscode.Uri.file(dir));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
import { IDE } from "core";
|
||||
import { AutocompleteSnippet } from "core/autocomplete/constructPrompt";
|
||||
import * as vscode from "vscode";
|
||||
|
||||
export class AutocompletePromptBuilder {
|
||||
constructor(private readonly ide: IDE) {}
|
||||
|
||||
async getDefinition(
|
||||
uri: string,
|
||||
line: number,
|
||||
character: number
|
||||
): Promise<AutocompleteSnippet | undefined> {
|
||||
const definitions = (await vscode.commands.executeCommand(
|
||||
"vscode.executeDefinitionProvider",
|
||||
vscode.Uri.parse(uri),
|
||||
new vscode.Position(line, character)
|
||||
)) as any;
|
||||
|
||||
if (definitions[0]?.targetRange) {
|
||||
return {
|
||||
filepath: uri,
|
||||
content: await this.ide.readRangeInFile(
|
||||
definitions[0].targetUri.fsPath,
|
||||
definitions[0].targetRange
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +1,26 @@
|
|||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { DIFF_DIRECTORY, diffManager } from "../diff/horizontal";
|
||||
import { editorToVerticalDiffCodeLens } from "../diff/verticalPerLine/manager";
|
||||
import { DIFF_DIRECTORY, DiffManager } from "../diff/horizontal";
|
||||
import { VerticalDiffCodeLens } from "../diff/verticalPerLine/manager";
|
||||
import { editorSuggestionsLocked, editorToSuggestions } from "../suggestions";
|
||||
import { getMetaKeyLabel } from "../util/util";
|
||||
import { getExtensionUri } from "../util/vscode";
|
||||
|
||||
class VerticalPerLineCodeLensProvider implements vscode.CodeLensProvider {
|
||||
constructor(
|
||||
private readonly editorToVerticalDiffCodeLens: Map<
|
||||
string,
|
||||
VerticalDiffCodeLens[]
|
||||
>
|
||||
) {}
|
||||
|
||||
public provideCodeLenses(
|
||||
document: vscode.TextDocument,
|
||||
_: vscode.CancellationToken
|
||||
): vscode.CodeLens[] | Thenable<vscode.CodeLens[]> {
|
||||
const filepath = document.uri.fsPath;
|
||||
const blocks = editorToVerticalDiffCodeLens.get(filepath);
|
||||
const blocks = this.editorToVerticalDiffCodeLens.get(filepath);
|
||||
if (!blocks) {
|
||||
return [];
|
||||
}
|
||||
|
|
@ -28,12 +35,12 @@ class VerticalPerLineCodeLensProvider implements vscode.CodeLensProvider {
|
|||
);
|
||||
codeLenses.push(
|
||||
new vscode.CodeLens(range, {
|
||||
title: "Accept ✅",
|
||||
title: "Accept",
|
||||
command: "continue.acceptVerticalDiffBlock",
|
||||
arguments: [filepath, i],
|
||||
}),
|
||||
new vscode.CodeLens(range, {
|
||||
title: "Reject ❌",
|
||||
title: "Reject",
|
||||
command: "continue.rejectVerticalDiffBlock",
|
||||
arguments: [filepath, i],
|
||||
})
|
||||
|
|
@ -41,7 +48,7 @@ class VerticalPerLineCodeLensProvider implements vscode.CodeLensProvider {
|
|||
if (codeLenses.length === 2) {
|
||||
codeLenses.push(
|
||||
new vscode.CodeLens(range, {
|
||||
title: `(${getMetaKeyLabel()}⇧↩/${getMetaKeyLabel()}⇧⌫ to accept/reject all, ${getMetaKeyLabel()}⇧L to retry)`,
|
||||
title: `(${getMetaKeyLabel()}⇧↩/${getMetaKeyLabel()}⇧⌫ to accept/reject all, ${getMetaKeyLabel()}I to retry)`,
|
||||
command: "",
|
||||
})
|
||||
);
|
||||
|
|
@ -71,12 +78,12 @@ class SuggestionsCodeLensProvider implements vscode.CodeLensProvider {
|
|||
);
|
||||
codeLenses.push(
|
||||
new vscode.CodeLens(range, {
|
||||
title: "Accept ✅",
|
||||
title: "Accept",
|
||||
command: "continue.acceptSuggestion",
|
||||
arguments: [suggestion],
|
||||
}),
|
||||
new vscode.CodeLens(range, {
|
||||
title: "Reject ❌",
|
||||
title: "Reject",
|
||||
command: "continue.rejectSuggestion",
|
||||
arguments: [suggestion],
|
||||
})
|
||||
|
|
@ -96,6 +103,12 @@ class SuggestionsCodeLensProvider implements vscode.CodeLensProvider {
|
|||
}
|
||||
|
||||
class DiffViewerCodeLensProvider implements vscode.CodeLensProvider {
|
||||
diffManager: DiffManager;
|
||||
|
||||
constructor(diffManager: DiffManager) {
|
||||
this.diffManager = diffManager;
|
||||
}
|
||||
|
||||
public provideCodeLenses(
|
||||
document: vscode.TextDocument,
|
||||
_: vscode.CancellationToken
|
||||
|
|
@ -103,7 +116,7 @@ class DiffViewerCodeLensProvider implements vscode.CodeLensProvider {
|
|||
if (path.dirname(document.uri.fsPath) === DIFF_DIRECTORY) {
|
||||
const codeLenses: vscode.CodeLens[] = [];
|
||||
let range = new vscode.Range(0, 0, 1, 0);
|
||||
const diffInfo = diffManager.diffAtNewFilepath(document.uri.fsPath);
|
||||
const diffInfo = this.diffManager.diffAtNewFilepath(document.uri.fsPath);
|
||||
if (diffInfo) {
|
||||
range = diffInfo.range;
|
||||
}
|
||||
|
|
@ -284,7 +297,7 @@ class TutorialCodeLensProvider implements vscode.CodeLensProvider {
|
|||
new vscode.CodeLens(range, {
|
||||
title: "Highlight the function",
|
||||
command: "continue.selectRange",
|
||||
arguments: [lineOf11 + 1, lineOf11 + 8],
|
||||
arguments: [lineOf11 + 3, lineOf11 + 11],
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
@ -334,7 +347,11 @@ let suggestionsCodeLensDisposable: vscode.Disposable | undefined = undefined;
|
|||
let configPyCodeLensDisposable: vscode.Disposable | undefined = undefined;
|
||||
let tutorialCodeLensDisposable: vscode.Disposable | undefined = undefined;
|
||||
|
||||
export function registerAllCodeLensProviders(context: vscode.ExtensionContext) {
|
||||
export function registerAllCodeLensProviders(
|
||||
context: vscode.ExtensionContext,
|
||||
diffManager: DiffManager,
|
||||
editorToVerticalDiffCodeLens: Map<string, VerticalDiffCodeLens[]>
|
||||
) {
|
||||
if (verticalPerLineCodeLensProvider) {
|
||||
verticalPerLineCodeLensProvider.dispose();
|
||||
}
|
||||
|
|
@ -353,7 +370,7 @@ export function registerAllCodeLensProviders(context: vscode.ExtensionContext) {
|
|||
|
||||
verticalPerLineCodeLensProvider = vscode.languages.registerCodeLensProvider(
|
||||
"*",
|
||||
new VerticalPerLineCodeLensProvider()
|
||||
new VerticalPerLineCodeLensProvider(editorToVerticalDiffCodeLens)
|
||||
);
|
||||
suggestionsCodeLensDisposable = vscode.languages.registerCodeLensProvider(
|
||||
"*",
|
||||
|
|
@ -361,7 +378,7 @@ export function registerAllCodeLensProviders(context: vscode.ExtensionContext) {
|
|||
);
|
||||
diffsCodeLensDisposable = vscode.languages.registerCodeLensProvider(
|
||||
"*",
|
||||
new DiffViewerCodeLensProvider()
|
||||
new DiffViewerCodeLensProvider(diffManager)
|
||||
);
|
||||
configPyCodeLensDisposable = vscode.languages.registerCodeLensProvider(
|
||||
"*",
|
||||
|
|
|
|||
|
|
@ -1,323 +0,0 @@
|
|||
import { ContinueConfig, ContinueRcJson, ILLM } from "core";
|
||||
import defaultConfig from "core/config/default";
|
||||
import {
|
||||
finalToBrowserConfig,
|
||||
intermediateToFinalConfig,
|
||||
loadFullConfigNode,
|
||||
serializedToIntermediateConfig,
|
||||
} from "core/config/load";
|
||||
import Ollama from "core/llm/llms/Ollama";
|
||||
import { getConfigJsonPath } from "core/util/paths";
|
||||
import { Telemetry } from "core/util/posthog";
|
||||
import { http, https } from "follow-redirects";
|
||||
import * as fs from "fs";
|
||||
import { HttpProxyAgent } from "http-proxy-agent";
|
||||
import { HttpsProxyAgent } from "https-proxy-agent";
|
||||
import fetch from "node-fetch";
|
||||
import * as vscode from "vscode";
|
||||
import { ideProtocolClient } from "./activation/activate";
|
||||
import { debugPanelWebview, webviewRequest } from "./debugPanel";
|
||||
import { getUniqueId } from "./util/vscode";
|
||||
const tls = require("tls");
|
||||
|
||||
const outputChannel = vscode.window.createOutputChannel(
|
||||
"Continue - LLM Prompt/Completion"
|
||||
);
|
||||
|
||||
class VsCodeConfigHandler {
|
||||
savedConfig: ContinueConfig | undefined;
|
||||
|
||||
reloadConfig() {
|
||||
this.savedConfig = undefined;
|
||||
this.loadConfig();
|
||||
}
|
||||
|
||||
private async _getWorkspaceConfigs() {
|
||||
const workspaceDirs =
|
||||
vscode.workspace.workspaceFolders?.map((folder) => folder.uri) || [];
|
||||
const configs: ContinueRcJson[] = [];
|
||||
for (const workspaceDir of workspaceDirs) {
|
||||
const files = await vscode.workspace.fs.readDirectory(workspaceDir);
|
||||
for (const [filename, type] of files) {
|
||||
if (type === vscode.FileType.File && filename === ".continuerc.json") {
|
||||
const contents = await ideProtocolClient.readFile(
|
||||
vscode.Uri.joinPath(workspaceDir, filename).fsPath
|
||||
);
|
||||
configs.push(JSON.parse(contents));
|
||||
}
|
||||
}
|
||||
}
|
||||
return configs;
|
||||
}
|
||||
|
||||
async loadConfig(): Promise<ContinueConfig> {
|
||||
try {
|
||||
if (this.savedConfig) {
|
||||
return this.savedConfig;
|
||||
}
|
||||
let workspaceConfigs: ContinueRcJson[] = [];
|
||||
try {
|
||||
workspaceConfigs = await this._getWorkspaceConfigs();
|
||||
} catch (e) {
|
||||
console.warn("Failed to load workspace configs");
|
||||
}
|
||||
|
||||
const remoteConfigServerUrl = vscode.workspace
|
||||
.getConfiguration("continue")
|
||||
.get<string | undefined>("remoteConfigServerUrl", undefined);
|
||||
|
||||
this.savedConfig = await loadFullConfigNode(
|
||||
ideProtocolClient.readFile,
|
||||
workspaceConfigs,
|
||||
remoteConfigServerUrl ? new URL(remoteConfigServerUrl) : undefined
|
||||
);
|
||||
this.savedConfig.allowAnonymousTelemetry =
|
||||
this.savedConfig.allowAnonymousTelemetry &&
|
||||
vscode.workspace.getConfiguration("continue").get("telemetryEnabled");
|
||||
|
||||
// Update the sidebar panel
|
||||
const browserConfig = finalToBrowserConfig(this.savedConfig);
|
||||
debugPanelWebview?.postMessage({ type: "configUpdate", browserConfig });
|
||||
|
||||
// Setup telemetry only after (and if) we know it is enabled
|
||||
await Telemetry.setup(
|
||||
this.savedConfig.allowAnonymousTelemetry ?? true,
|
||||
getUniqueId()
|
||||
);
|
||||
|
||||
return this.savedConfig;
|
||||
} catch (e) {
|
||||
vscode.window
|
||||
.showErrorMessage(
|
||||
"Error loading config.json. Please check your config.json file: " + e,
|
||||
"Open config.json"
|
||||
)
|
||||
.then((selection) => {
|
||||
if (selection === "Open config.json") {
|
||||
vscode.workspace
|
||||
.openTextDocument(getConfigJsonPath())
|
||||
.then((doc) => {
|
||||
vscode.window.showTextDocument(doc);
|
||||
});
|
||||
}
|
||||
});
|
||||
return intermediateToFinalConfig(
|
||||
serializedToIntermediateConfig(defaultConfig),
|
||||
ideProtocolClient.readFile
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const configHandler = new VsCodeConfigHandler();
|
||||
|
||||
const TIMEOUT = 7200; // 7200 seconds = 2 hours
|
||||
|
||||
function setupLlm(llm: ILLM): ILLM {
|
||||
// Since we know this is happening in Node.js, we can add requestOptions through a custom agent
|
||||
const ca = [...tls.rootCertificates];
|
||||
const customCerts =
|
||||
typeof llm.requestOptions?.caBundlePath === "string"
|
||||
? [llm.requestOptions?.caBundlePath]
|
||||
: llm.requestOptions?.caBundlePath;
|
||||
if (customCerts) {
|
||||
ca.push(
|
||||
...customCerts.map((customCert) => fs.readFileSync(customCert, "utf8"))
|
||||
);
|
||||
}
|
||||
|
||||
let timeout = (llm.requestOptions?.timeout || TIMEOUT) * 1000; // measured in ms
|
||||
|
||||
const agentOptions = {
|
||||
ca,
|
||||
rejectUnauthorized: llm.requestOptions?.verifySsl,
|
||||
timeout,
|
||||
sessionTimeout: timeout,
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: timeout,
|
||||
};
|
||||
|
||||
const proxy = llm.requestOptions?.proxy;
|
||||
|
||||
llm._fetch = async (input, init) => {
|
||||
// Create agent
|
||||
const protocol = new URL(input).protocol === "https:" ? https : http;
|
||||
const agent = proxy
|
||||
? new URL(input).protocol === "https:"
|
||||
? new HttpsProxyAgent(proxy, agentOptions)
|
||||
: new HttpProxyAgent(proxy, agentOptions)
|
||||
: new protocol.Agent(agentOptions);
|
||||
|
||||
const headers: { [key: string]: string } =
|
||||
llm!.requestOptions?.headers || {};
|
||||
for (const [key, value] of Object.entries(init?.headers || {})) {
|
||||
headers[key] = value as string;
|
||||
}
|
||||
|
||||
let updatedBody: string | undefined = undefined;
|
||||
try {
|
||||
if (
|
||||
llm.requestOptions?.extraBodyProperties &&
|
||||
typeof init.body === "string"
|
||||
) {
|
||||
const parsedBody = JSON.parse(init.body);
|
||||
updatedBody = JSON.stringify({
|
||||
...parsedBody,
|
||||
...llm.requestOptions.extraBodyProperties,
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Unable to parse HTTP request body: ", e);
|
||||
}
|
||||
|
||||
const resp = await fetch(input, {
|
||||
...init,
|
||||
body: updatedBody ?? init.body,
|
||||
headers,
|
||||
agent,
|
||||
});
|
||||
|
||||
if (!resp.ok) {
|
||||
let text = await resp.text();
|
||||
if (resp.status === 404 && !resp.url.includes("/v1")) {
|
||||
if (text.includes("try pulling it first")) {
|
||||
const model = JSON.parse(text).error.split(" ")[1].slice(1, -1);
|
||||
text = `The model "${model}" was not found. To download it, run \`ollama run ${model}\`.`;
|
||||
} else if (text.includes("/api/chat")) {
|
||||
text =
|
||||
"The /api/chat endpoint was not found. This may mean that you are using an older version of Ollama that does not support /api/chat. Upgrading to the latest version will solve the issue.";
|
||||
} else {
|
||||
text =
|
||||
"This may mean that you forgot to add '/v1' to the end of your 'apiBase' in config.json.";
|
||||
}
|
||||
}
|
||||
throw new Error(
|
||||
`HTTP ${resp.status} ${resp.statusText} from ${resp.url}\n\n${text}`
|
||||
);
|
||||
}
|
||||
|
||||
return resp;
|
||||
};
|
||||
|
||||
llm.writeLog = async (log: string) => {
|
||||
outputChannel.appendLine(
|
||||
"=========================================================================="
|
||||
);
|
||||
outputChannel.appendLine(
|
||||
"=========================================================================="
|
||||
);
|
||||
|
||||
outputChannel.append(log);
|
||||
};
|
||||
return llm;
|
||||
}
|
||||
|
||||
export async function llmFromTitle(title?: string): Promise<ILLM> {
|
||||
let config = await configHandler.loadConfig();
|
||||
|
||||
if (title === undefined) {
|
||||
const resp = await webviewRequest("getDefaultModelTitle");
|
||||
if (resp?.defaultModelTitle) {
|
||||
title = resp.defaultModelTitle;
|
||||
}
|
||||
}
|
||||
|
||||
let llm = title
|
||||
? config.models.find((llm) => llm.title === title)
|
||||
: config.models[0];
|
||||
if (!llm) {
|
||||
// Try to reload config
|
||||
configHandler.reloadConfig();
|
||||
config = await configHandler.loadConfig();
|
||||
llm = config.models.find((llm) => llm.title === title);
|
||||
if (!llm) {
|
||||
throw new Error(`Unknown model ${title}`);
|
||||
}
|
||||
}
|
||||
|
||||
return setupLlm(llm);
|
||||
}
|
||||
|
||||
export class TabAutocompleteModel {
|
||||
private static _llm: ILLM | undefined;
|
||||
private static defaultTag: string = "deepseek-coder:1.3b-base";
|
||||
|
||||
private static shownOllamaWarning: boolean = false;
|
||||
private static shownDeepseekWarning: boolean = false;
|
||||
|
||||
static clearLlm() {
|
||||
TabAutocompleteModel._llm = undefined;
|
||||
}
|
||||
|
||||
static async getDefaultTabAutocompleteModel() {
|
||||
const llm = new Ollama({
|
||||
model: TabAutocompleteModel.defaultTag,
|
||||
});
|
||||
|
||||
// Check that deepseek is already downloaded
|
||||
try {
|
||||
const models = await llm.listModels();
|
||||
if (!models.includes(TabAutocompleteModel.defaultTag)) {
|
||||
// Raise warning and explain how to download
|
||||
if (!TabAutocompleteModel.shownDeepseekWarning) {
|
||||
vscode.window
|
||||
.showWarningMessage(
|
||||
`Your local Ollama instance doesn't yet have DeepSeek Coder. To download this model, run \`ollama run deepseek-coder:1.3b-base\` (recommended). If you'd like to use a custom model for tab autocomplete, learn more in the docs`,
|
||||
"Documentation",
|
||||
"Copy Command"
|
||||
)
|
||||
.then((value) => {
|
||||
if (value === "Documentation") {
|
||||
vscode.env.openExternal(
|
||||
vscode.Uri.parse(
|
||||
"https://continue.dev/docs/walkthroughs/tab-autocomplete"
|
||||
)
|
||||
);
|
||||
} else if (value === "Copy Command") {
|
||||
vscode.env.clipboard.writeText(
|
||||
"ollama run deepseek-coder:1.3b-base"
|
||||
);
|
||||
}
|
||||
});
|
||||
TabAutocompleteModel.shownDeepseekWarning = true;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
} catch (e) {
|
||||
if (!TabAutocompleteModel.shownOllamaWarning) {
|
||||
vscode.window
|
||||
.showWarningMessage(
|
||||
"Continue failed to connect to Ollama, which is used by default for tab-autocomplete. If you haven't downloaded it yet, you can do so at https://ollama.ai (recommended). If you'd like to use a custom model for tab autocomplete, learn more in the docs",
|
||||
"Documentation"
|
||||
)
|
||||
.then((value) => {
|
||||
if (value === "Documentation") {
|
||||
vscode.env.openExternal(
|
||||
vscode.Uri.parse(
|
||||
"https://continue.dev/docs/walkthroughs/tab-autocomplete"
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
TabAutocompleteModel.shownOllamaWarning = true;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return llm;
|
||||
}
|
||||
|
||||
static async get() {
|
||||
if (!TabAutocompleteModel._llm) {
|
||||
const config = await configHandler.loadConfig();
|
||||
if (config.tabAutocompleteModel) {
|
||||
TabAutocompleteModel._llm = setupLlm(config.tabAutocompleteModel);
|
||||
} else {
|
||||
TabAutocompleteModel._llm =
|
||||
await TabAutocompleteModel.getDefaultTabAutocompleteModel();
|
||||
}
|
||||
}
|
||||
|
||||
return TabAutocompleteModel._llm;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
import * as vscode from "vscode";
|
||||
import { openEditorAndRevealRange } from "./util/vscode";
|
||||
import { translate } from "./util/vscode";
|
||||
import { registerAllCodeLensProviders } from "./lang-server/codeLens";
|
||||
import { extensionContext, ideProtocolClient } from "./activation/activate";
|
||||
import { openEditorAndRevealRange, translate } from "./util/vscode";
|
||||
|
||||
export interface SuggestionRanges {
|
||||
oldRange: vscode.Range;
|
||||
|
|
@ -125,9 +122,9 @@ export function rerenderDecorations(editorUri: string) {
|
|||
vscode.TextEditorRevealType.Default
|
||||
);
|
||||
|
||||
if (extensionContext) {
|
||||
registerAllCodeLensProviders(extensionContext);
|
||||
}
|
||||
// if (extensionContext) {
|
||||
// registerAllCodeLensProviders(extensionContext);
|
||||
// }
|
||||
}
|
||||
|
||||
export function suggestionDownCommand() {
|
||||
|
|
|
|||
|
|
@ -1,104 +1,24 @@
|
|||
import { FileEdit, RangeInFile } from "core";
|
||||
import { getDevDataFilePath } from "core/util/paths";
|
||||
import { writeFileSync } from "fs";
|
||||
import * as path from "path";
|
||||
import path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { extensionContext } from "./activation/activate";
|
||||
import { debugPanelWebview, getSidebarContent } from "./debugPanel";
|
||||
import { diffManager } from "./diff/horizontal";
|
||||
import { TabAutocompleteModel, configHandler } from "./loadConfig";
|
||||
import { VsCodeExtension } from "../extension/vscodeExtension";
|
||||
import {
|
||||
SuggestionRanges,
|
||||
acceptSuggestionCommand,
|
||||
editorSuggestionsLocked,
|
||||
rejectSuggestionCommand,
|
||||
showSuggestion as showSuggestionInEditor,
|
||||
} from "./suggestions";
|
||||
import { vsCodeIndexCodebase } from "./util/indexCodebase";
|
||||
import { defaultIgnoreFile, traverseDirectory } from "./util/traverseDirectory";
|
||||
} from "../suggestions";
|
||||
import { defaultIgnoreFile, traverseDirectory } from "./traverseDirectory";
|
||||
import {
|
||||
getUniqueId,
|
||||
openEditorAndRevealRange,
|
||||
uriFromFilePath,
|
||||
} from "./util/vscode";
|
||||
} from "./vscode";
|
||||
const util = require("util");
|
||||
const exec = util.promisify(require("child_process").exec);
|
||||
|
||||
const continueVirtualDocumentScheme = "continue";
|
||||
|
||||
class IdeProtocolClient {
|
||||
private static PREVIOUS_BRANCH_FOR_WORKSPACE_DIR: { [dir: string]: string } =
|
||||
{};
|
||||
|
||||
constructor(context: vscode.ExtensionContext) {
|
||||
// Listen for file saving
|
||||
vscode.workspace.onDidSaveTextDocument((event) => {
|
||||
const filepath = event.uri.fsPath;
|
||||
|
||||
if (
|
||||
filepath.endsWith(".continue/config.json") ||
|
||||
filepath.endsWith(".continue\\config.json") ||
|
||||
filepath.endsWith(".continue/config.ts") ||
|
||||
filepath.endsWith(".continue\\config.ts") ||
|
||||
filepath.endsWith(".continuerc.json")
|
||||
) {
|
||||
configHandler.reloadConfig();
|
||||
TabAutocompleteModel.clearLlm();
|
||||
} else if (
|
||||
filepath.endsWith(".continueignore") ||
|
||||
filepath.endsWith(".gitignore")
|
||||
) {
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "updateEmbeddings",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Refresh index when branch is changed
|
||||
this.getWorkspaceDirectories().forEach(async (dir) => {
|
||||
const repo = await this.getRepo(vscode.Uri.file(dir));
|
||||
if (repo) {
|
||||
repo.state.onDidChange(() => {
|
||||
// args passed to this callback are always undefined, so keep track of previous branch
|
||||
const currentBranch = repo?.state?.HEAD?.name;
|
||||
if (currentBranch) {
|
||||
if (IdeProtocolClient.PREVIOUS_BRANCH_FOR_WORKSPACE_DIR[dir]) {
|
||||
if (
|
||||
currentBranch !==
|
||||
IdeProtocolClient.PREVIOUS_BRANCH_FOR_WORKSPACE_DIR[dir]
|
||||
) {
|
||||
// Trigger refresh of index only in this directory
|
||||
vsCodeIndexCodebase([dir]);
|
||||
}
|
||||
}
|
||||
|
||||
IdeProtocolClient.PREVIOUS_BRANCH_FOR_WORKSPACE_DIR[dir] =
|
||||
currentBranch;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Register a content provider for the readonly virtual documents
|
||||
const documentContentProvider = new (class
|
||||
implements vscode.TextDocumentContentProvider
|
||||
{
|
||||
// emitter and its event
|
||||
onDidChangeEmitter = new vscode.EventEmitter<vscode.Uri>();
|
||||
onDidChange = this.onDidChangeEmitter.event;
|
||||
|
||||
provideTextDocumentContent(uri: vscode.Uri): string {
|
||||
return uri.query;
|
||||
}
|
||||
})();
|
||||
context.subscriptions.push(
|
||||
vscode.workspace.registerTextDocumentContentProvider(
|
||||
continueVirtualDocumentScheme,
|
||||
documentContentProvider
|
||||
)
|
||||
);
|
||||
}
|
||||
const asyncExec = util.promisify(require("child_process").exec);
|
||||
|
||||
export class VsCodeIdeUtils {
|
||||
visibleMessages: Set<string> = new Set();
|
||||
|
||||
async gotoDefinition(
|
||||
|
|
@ -207,10 +127,6 @@ class IdeProtocolClient {
|
|||
);
|
||||
}
|
||||
|
||||
async showDiff(filepath: string, replacement: string, step_index: number) {
|
||||
await diffManager.writeDiff(filepath, replacement, step_index);
|
||||
}
|
||||
|
||||
showMultiFileEdit(edits: FileEdit[]) {
|
||||
vscode.commands.executeCommand("workbench.action.closeAuxiliaryBar");
|
||||
const panel = vscode.window.createWebviewPanel(
|
||||
|
|
@ -218,12 +134,13 @@ class IdeProtocolClient {
|
|||
"Continue",
|
||||
vscode.ViewColumn.One
|
||||
);
|
||||
panel.webview.html = getSidebarContent(
|
||||
extensionContext,
|
||||
panel,
|
||||
"/monaco",
|
||||
edits
|
||||
);
|
||||
// panel.webview.html = this.sidebar.getSidebarContent(
|
||||
// extensionContext,
|
||||
// panel,
|
||||
// this.ide,
|
||||
// "/monaco",
|
||||
// edits
|
||||
// );
|
||||
}
|
||||
|
||||
openFile(filepath: string, range?: vscode.Range) {
|
||||
|
|
@ -244,9 +161,9 @@ class IdeProtocolClient {
|
|||
vscode.workspace
|
||||
.openTextDocument(
|
||||
vscode.Uri.parse(
|
||||
`${continueVirtualDocumentScheme}:${encodeURIComponent(
|
||||
name
|
||||
)}?${encodeURIComponent(contents)}`
|
||||
`${
|
||||
VsCodeExtension.continueVirtualDocumentScheme
|
||||
}:${encodeURIComponent(name)}?${encodeURIComponent(contents)}`
|
||||
)
|
||||
)
|
||||
.then((doc) => {
|
||||
|
|
@ -480,7 +397,7 @@ class IdeProtocolClient {
|
|||
let repo = await this.getRepo(forDirectory);
|
||||
if (repo?.state?.HEAD?.name === undefined) {
|
||||
try {
|
||||
const { stdout } = await exec("git rev-parse --abbrev-ref HEAD", {
|
||||
const { stdout } = await asyncExec("git rev-parse --abbrev-ref HEAD", {
|
||||
cwd: forDirectory.fsPath,
|
||||
});
|
||||
return stdout?.trim() || "NONE";
|
||||
|
|
@ -533,30 +450,4 @@ class IdeProtocolClient {
|
|||
});
|
||||
return rangeInFiles;
|
||||
}
|
||||
|
||||
async runCommand(command: string) {
|
||||
if (vscode.window.terminals.length) {
|
||||
vscode.window.terminals[0].show();
|
||||
vscode.window.terminals[0].sendText(command, false);
|
||||
} else {
|
||||
const terminal = vscode.window.createTerminal();
|
||||
terminal.show();
|
||||
terminal.sendText(command, false);
|
||||
}
|
||||
}
|
||||
|
||||
sendMainUserInput(input: string) {
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "userInput",
|
||||
input,
|
||||
});
|
||||
}
|
||||
|
||||
logDevData(tableName: string, data: any) {
|
||||
const filepath: string = getDevDataFilePath(tableName);
|
||||
const jsonLine = JSON.stringify(data);
|
||||
writeFileSync(filepath, `${jsonLine}\n`, { flag: "a" });
|
||||
}
|
||||
}
|
||||
|
||||
export default IdeProtocolClient;
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
import { FullTextSearchCodebaseIndex } from "core/indexing/FullTextSearch";
|
||||
import { LanceDbIndex } from "core/indexing/LanceDbIndex";
|
||||
import { ChunkCodebaseIndex } from "core/indexing/chunk/ChunkCodebaseIndex";
|
||||
import { getComputeDeleteAddRemove } from "core/indexing/refreshIndex";
|
||||
import { CodebaseIndex, IndexTag, LastModifiedMap } from "core/indexing/types";
|
||||
import * as vscode from "vscode";
|
||||
import { ideProtocolClient } from "../activation/activate";
|
||||
import { debugPanelWebview } from "../debugPanel";
|
||||
import { VsCodeIde } from "../ideProtocol";
|
||||
import { configHandler } from "../loadConfig";
|
||||
|
||||
const vscodeGetStats = async (
|
||||
directory: string | undefined
|
||||
): Promise<LastModifiedMap> => {
|
||||
const files = await new VsCodeIde().listWorkspaceContents(directory);
|
||||
const pathToLastModified: { [path: string]: number } = {};
|
||||
await Promise.all(
|
||||
files.map(async (file) => {
|
||||
let stat = await vscode.workspace.fs.stat(vscode.Uri.file(file));
|
||||
pathToLastModified[file] = stat.mtime;
|
||||
})
|
||||
);
|
||||
|
||||
return pathToLastModified;
|
||||
};
|
||||
|
||||
async function getIndexesToBuild(): Promise<CodebaseIndex[]> {
|
||||
const ide = new VsCodeIde();
|
||||
const config = await configHandler.loadConfig();
|
||||
|
||||
const indexes = [
|
||||
new ChunkCodebaseIndex(ide.readFile), // Chunking must come first
|
||||
new LanceDbIndex(config.embeddingsProvider, ide.readFile),
|
||||
new FullTextSearchCodebaseIndex(),
|
||||
];
|
||||
|
||||
return indexes;
|
||||
}
|
||||
|
||||
export async function vsCodeIndexCodebase(workspaceDirs: string[]) {
|
||||
const update = (progress: number, desc: string) => {
|
||||
debugPanelWebview?.postMessage({ type: "indexProgress", progress, desc });
|
||||
};
|
||||
|
||||
const config = await configHandler.loadConfig();
|
||||
if (config.disableIndexing) {
|
||||
return;
|
||||
}
|
||||
|
||||
const indexesToBuild = await getIndexesToBuild();
|
||||
|
||||
let completedDirs = 0;
|
||||
|
||||
for (let directory of workspaceDirs) {
|
||||
const stats = await vscodeGetStats(directory);
|
||||
const branch = await ideProtocolClient.getBranch(
|
||||
vscode.Uri.file(directory)
|
||||
);
|
||||
let completedIndexes = 0;
|
||||
|
||||
try {
|
||||
for (let codebaseIndex of indexesToBuild) {
|
||||
const tag: IndexTag = {
|
||||
directory,
|
||||
branch,
|
||||
artifactId: codebaseIndex.artifactId,
|
||||
};
|
||||
const [results, markComplete] = await getComputeDeleteAddRemove(
|
||||
tag,
|
||||
{ ...stats },
|
||||
(filepath) => ideProtocolClient.readFile(filepath)
|
||||
);
|
||||
|
||||
for await (let { progress, desc } of codebaseIndex.update(
|
||||
tag,
|
||||
results,
|
||||
markComplete
|
||||
)) {
|
||||
update(
|
||||
(completedDirs +
|
||||
(completedIndexes + progress) / indexesToBuild.length) /
|
||||
workspaceDirs.length,
|
||||
desc
|
||||
);
|
||||
}
|
||||
completedIndexes++;
|
||||
update(
|
||||
(completedDirs + completedIndexes / indexesToBuild.length) /
|
||||
workspaceDirs.length,
|
||||
"Completed indexing " + codebaseIndex.artifactId
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("Error refreshing index: ", e);
|
||||
}
|
||||
|
||||
completedDirs++;
|
||||
update(completedDirs / workspaceDirs.length, "Indexing Complete");
|
||||
}
|
||||
}
|
||||
90
extensions/vscode/src/util/loadAutocompleteModel.ts
Normal file
90
extensions/vscode/src/util/loadAutocompleteModel.ts
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
import { ILLM } from "core";
|
||||
import { ConfigHandler } from "core/config/handler";
|
||||
import Ollama from "core/llm/llms/Ollama";
|
||||
import * as vscode from "vscode";
|
||||
|
||||
export class TabAutocompleteModel {
|
||||
private _llm: ILLM | undefined;
|
||||
private defaultTag: string = "starcoder:3b";
|
||||
private defaultTagName: string = "Starcoder 3b";
|
||||
|
||||
private shownOllamaWarning: boolean = false;
|
||||
private shownDeepseekWarning: boolean = false;
|
||||
|
||||
private configHandler: ConfigHandler;
|
||||
|
||||
constructor(configHandler: ConfigHandler) {
|
||||
this.configHandler = configHandler;
|
||||
}
|
||||
|
||||
clearLlm() {
|
||||
this._llm = undefined;
|
||||
}
|
||||
|
||||
async getDefaultTabAutocompleteModel() {
|
||||
const llm = new Ollama({
|
||||
model: this.defaultTag,
|
||||
});
|
||||
|
||||
try {
|
||||
const models = await llm.listModels();
|
||||
if (!models.includes(this.defaultTag)) {
|
||||
if (!this.shownDeepseekWarning) {
|
||||
vscode.window
|
||||
.showWarningMessage(
|
||||
`Your local Ollama instance doesn't yet have ${this.defaultTagName}. To download this model, run \`ollama run ${this.defaultTag}\` (recommended). If you'd like to use a custom model for tab autocomplete, learn more in the docs`,
|
||||
"Documentation",
|
||||
"Copy Command"
|
||||
)
|
||||
.then((value) => {
|
||||
if (value === "Documentation") {
|
||||
vscode.env.openExternal(
|
||||
vscode.Uri.parse(
|
||||
"https://continue.dev/docs/walkthroughs/tab-autocomplete"
|
||||
)
|
||||
);
|
||||
} else if (value === "Copy Command") {
|
||||
vscode.env.clipboard.writeText(`ollama run ${this.defaultTag}`);
|
||||
}
|
||||
});
|
||||
this.shownDeepseekWarning = true;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
} catch (e) {
|
||||
if (!this.shownOllamaWarning) {
|
||||
vscode.window
|
||||
.showWarningMessage(
|
||||
"Continue failed to connect to Ollama, which is used by default for tab-autocomplete. If you haven't downloaded it yet, you can do so at https://ollama.ai (recommended). If you'd like to use a custom model for tab autocomplete, learn more in the docs",
|
||||
"Documentation"
|
||||
)
|
||||
.then((value) => {
|
||||
if (value === "Documentation") {
|
||||
vscode.env.openExternal(
|
||||
vscode.Uri.parse(
|
||||
"https://continue.dev/docs/walkthroughs/tab-autocomplete"
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
this.shownOllamaWarning = true;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return llm;
|
||||
}
|
||||
|
||||
async get() {
|
||||
if (!this._llm) {
|
||||
const config = await this.configHandler.loadConfig();
|
||||
if (config.tabAutocompleteModel) {
|
||||
this._llm = this.configHandler.setupLlm(config.tabAutocompleteModel);
|
||||
} else {
|
||||
this._llm = await this.getDefaultTabAutocompleteModel();
|
||||
}
|
||||
}
|
||||
|
||||
return this._llm;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,68 +1,128 @@
|
|||
import {
|
||||
getConfigJsPathForRemote,
|
||||
getConfigJsonPathForRemote,
|
||||
getPathToRemoteConfig,
|
||||
} from "core/util/paths";
|
||||
import * as fs from "fs";
|
||||
import * as vscode from "vscode";
|
||||
import { configHandler } from "../loadConfig";
|
||||
|
||||
let remoteConfigSyncInterval: NodeJS.Timer | undefined = undefined;
|
||||
export class RemoteConfigSync {
|
||||
private userToken: string | null;
|
||||
private remoteConfigServerUrl: string | null;
|
||||
private remoteConfigSyncPeriod: number;
|
||||
|
||||
export async function setupRemoteConfigSync() {
|
||||
const settings = vscode.workspace.getConfiguration("continue");
|
||||
const userToken = settings.get<string | null>("userToken", null);
|
||||
const remoteConfigServerUrl = settings.get<string | null>(
|
||||
"remoteConfigServerUrl",
|
||||
null
|
||||
);
|
||||
const remoteConfigSyncPeriod = settings.get<number>(
|
||||
"remoteConfigSyncPeriod",
|
||||
60
|
||||
);
|
||||
private syncInterval: NodeJS.Timer | undefined = undefined;
|
||||
|
||||
if (
|
||||
userToken === null ||
|
||||
remoteConfigServerUrl === null ||
|
||||
remoteConfigServerUrl.trim() === ""
|
||||
) {
|
||||
return;
|
||||
constructor(private triggerReloadConfig: () => void) {
|
||||
const { userToken, remoteConfigServerUrl, remoteConfigSyncPeriod } =
|
||||
this.loadVsCodeSettings();
|
||||
this.userToken = userToken;
|
||||
this.remoteConfigServerUrl = remoteConfigServerUrl;
|
||||
this.remoteConfigSyncPeriod = remoteConfigSyncPeriod;
|
||||
|
||||
// Listen for changes to VS Code settings, then trigger a refresh
|
||||
vscode.workspace.onDidChangeConfiguration((event) => {
|
||||
if (event.affectsConfiguration("continue")) {
|
||||
const { userToken, remoteConfigServerUrl, remoteConfigSyncPeriod } =
|
||||
this.loadVsCodeSettings();
|
||||
if (
|
||||
userToken !== this.userToken ||
|
||||
remoteConfigServerUrl !== this.remoteConfigServerUrl ||
|
||||
remoteConfigSyncPeriod !== this.remoteConfigSyncPeriod
|
||||
) {
|
||||
this.userToken = userToken;
|
||||
this.remoteConfigServerUrl = remoteConfigServerUrl;
|
||||
this.remoteConfigSyncPeriod = remoteConfigSyncPeriod;
|
||||
|
||||
this.setInterval();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!URL.canParse(remoteConfigServerUrl)) {
|
||||
vscode.window.showErrorMessage(
|
||||
"The value set for 'remoteConfigServerUrl' is not valid: ",
|
||||
remoteConfigServerUrl
|
||||
|
||||
private loadVsCodeSettings() {
|
||||
const settings = vscode.workspace.getConfiguration("continue");
|
||||
const userToken = settings.get<string | null>("userToken", null);
|
||||
const remoteConfigServerUrl = settings.get<string | null>(
|
||||
"remoteConfigServerUrl",
|
||||
null
|
||||
);
|
||||
return;
|
||||
const remoteConfigSyncPeriod = settings.get<number>(
|
||||
"remoteConfigSyncPeriod",
|
||||
60
|
||||
);
|
||||
|
||||
return {
|
||||
userToken,
|
||||
remoteConfigServerUrl,
|
||||
remoteConfigSyncPeriod,
|
||||
};
|
||||
}
|
||||
|
||||
// Sync once
|
||||
await syncRemoteConfig(userToken, new URL(remoteConfigServerUrl));
|
||||
async setup() {
|
||||
if (
|
||||
this.userToken === null ||
|
||||
this.remoteConfigServerUrl === null ||
|
||||
this.remoteConfigServerUrl.trim() === ""
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (!URL.canParse(this.remoteConfigServerUrl)) {
|
||||
vscode.window.showErrorMessage(
|
||||
"The value set for 'remoteConfigServerUrl' is not valid: ",
|
||||
this.remoteConfigServerUrl
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Set timer to sync at user-defined interval
|
||||
if (remoteConfigSyncInterval !== undefined) {
|
||||
clearInterval(remoteConfigSyncInterval);
|
||||
// Sync once
|
||||
await this.sync(this.userToken, new URL(this.remoteConfigServerUrl));
|
||||
|
||||
// Set timer to sync at user-defined interval
|
||||
this.setInterval();
|
||||
}
|
||||
|
||||
private setInterval() {
|
||||
if (this.syncInterval !== undefined) {
|
||||
clearInterval(this.syncInterval);
|
||||
}
|
||||
this.syncInterval = setInterval(() => {
|
||||
if (!this.userToken || !this.remoteConfigServerUrl) return;
|
||||
this.sync(this.userToken, new URL(this.remoteConfigServerUrl));
|
||||
}, this.remoteConfigSyncPeriod * 1000);
|
||||
}
|
||||
|
||||
async sync(userToken: string, remoteConfigServerUrl: URL) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
new URL("sync", remoteConfigServerUrl).href,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
Authorization: `Bearer ${userToken}`,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
vscode.window.showErrorMessage(
|
||||
`Failed to sync remote config (HTTP ${response.status}): ${response.statusText}`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const { configJson, configJs } = await response.json();
|
||||
|
||||
fs.writeFileSync(
|
||||
getConfigJsonPathForRemote(remoteConfigServerUrl),
|
||||
configJson
|
||||
);
|
||||
fs.writeFileSync(
|
||||
getConfigJsPathForRemote(remoteConfigServerUrl),
|
||||
configJs
|
||||
);
|
||||
this.triggerReloadConfig();
|
||||
} catch (e) {
|
||||
vscode.window.showErrorMessage(`Failed to sync remote config: ${e}`);
|
||||
}
|
||||
}
|
||||
remoteConfigSyncInterval = setInterval(() => {
|
||||
syncRemoteConfig(userToken, new URL(remoteConfigServerUrl));
|
||||
}, remoteConfigSyncPeriod * 1000);
|
||||
}
|
||||
|
||||
async function syncRemoteConfig(userToken: string, remoteConfigServerUrl: URL) {
|
||||
const response = await fetch(new URL("sync", remoteConfigServerUrl).href, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
Authorization: `Bearer ${userToken}`,
|
||||
},
|
||||
});
|
||||
|
||||
const remoteConfigDirectory = getPathToRemoteConfig(remoteConfigServerUrl);
|
||||
|
||||
const { configJson, configJs } = await response.json();
|
||||
fs.writeFileSync(
|
||||
getConfigJsonPathForRemote(remoteConfigServerUrl),
|
||||
configJson
|
||||
);
|
||||
fs.writeFileSync(getConfigJsPathForRemote(remoteConfigServerUrl), configJs);
|
||||
configHandler.reloadConfig();
|
||||
}
|
||||
|
|
|
|||
538
extensions/vscode/src/webviewProtocol.ts
Normal file
538
extensions/vscode/src/webviewProtocol.ts
Normal file
|
|
@ -0,0 +1,538 @@
|
|||
import { ContextItemId, IDE } from "core";
|
||||
import { ConfigHandler } from "core/config/handler";
|
||||
import { addModel, addOpenAIKey, deleteModel } from "core/config/util";
|
||||
import { indexDocs } from "core/indexing/docs";
|
||||
import TransformersJsEmbeddingsProvider from "core/indexing/embeddings/TransformersJsEmbeddingsProvider";
|
||||
import { logDevData } from "core/util/devdata";
|
||||
import historyManager from "core/util/history";
|
||||
import { Message } from "core/util/messenger";
|
||||
import { getConfigJsonPath } from "core/util/paths";
|
||||
import {
|
||||
ReverseWebviewProtocol,
|
||||
WebviewProtocol,
|
||||
} from "core/web/webviewProtocol";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import * as vscode from "vscode";
|
||||
import { showTutorial } from "./activation/activate";
|
||||
import { VerticalPerLineDiffManager } from "./diff/verticalPerLine/manager";
|
||||
|
||||
export class VsCodeWebviewProtocol {
|
||||
listeners = new Map<keyof WebviewProtocol, ((message: Message) => any)[]>();
|
||||
abortedMessageIds: Set<string> = new Set();
|
||||
|
||||
private send(messageType: string, data: any, messageId?: string): string {
|
||||
const id = messageId || uuidv4();
|
||||
this.webview?.postMessage({
|
||||
messageType,
|
||||
data,
|
||||
messageId: id,
|
||||
});
|
||||
return id;
|
||||
}
|
||||
|
||||
on<T extends keyof WebviewProtocol>(
|
||||
messageType: T,
|
||||
handler: (
|
||||
message: Message<WebviewProtocol[T][0]>
|
||||
) => Promise<WebviewProtocol[T][1]> | WebviewProtocol[T][1]
|
||||
): void {
|
||||
if (!this.listeners.has(messageType)) {
|
||||
this.listeners.set(messageType, []);
|
||||
}
|
||||
this.listeners.get(messageType)?.push(handler);
|
||||
}
|
||||
|
||||
_webview?: vscode.Webview;
|
||||
_webviewListener?: vscode.Disposable;
|
||||
|
||||
get webview(): vscode.Webview | undefined {
|
||||
return this._webview;
|
||||
}
|
||||
|
||||
set webview(webView: vscode.Webview) {
|
||||
this._webview = webView;
|
||||
this._webviewListener?.dispose();
|
||||
|
||||
this._webviewListener = this._webview.onDidReceiveMessage(async (msg) => {
|
||||
if (!msg.messageType || !msg.messageId) {
|
||||
throw new Error("Invalid webview protocol msg: " + JSON.stringify(msg));
|
||||
}
|
||||
|
||||
const respond = (message: any) =>
|
||||
this.send(msg.messageType, message, msg.messageId);
|
||||
|
||||
const handlers = this.listeners.get(msg.messageType) || [];
|
||||
for (const handler of handlers) {
|
||||
try {
|
||||
const response = await handler(msg);
|
||||
if (
|
||||
response &&
|
||||
typeof response[Symbol.asyncIterator] === "function"
|
||||
) {
|
||||
for await (const update of response) {
|
||||
respond(update);
|
||||
}
|
||||
respond({ done: true });
|
||||
} else {
|
||||
respond(response || {});
|
||||
}
|
||||
} catch (e: any) {
|
||||
console.error(
|
||||
"Error handling webview message: " +
|
||||
JSON.stringify({ msg }, null, 2)
|
||||
);
|
||||
|
||||
let message = `Continue error: ${e.message}`;
|
||||
if (e.cause) {
|
||||
if (e.cause.name === "ConnectTimeoutError") {
|
||||
message = `Connection timed out. If you expect it to take a long time to connect, you can increase the timeout in config.json by setting "requestOptions": { "timeout": 10000 }. You can find the full config reference here: https://continue.dev/docs/reference/config`;
|
||||
} else if (e.cause.code === "ECONNREFUSED") {
|
||||
message = `Connection was refused. This likely means that there is no server running at the specified URL. If you are running your own server you may need to set the "apiBase" parameter in config.json. For example, you can set up an OpenAI-compatible server like here: https://continue.dev/docs/reference/Model%20Providers/openai#openai-compatible-servers--apis`;
|
||||
} else {
|
||||
message = `The request failed with "${e.cause.name}": ${e.cause.message}. If you're having trouble setting up Continue, please see the troubleshooting guide for help.`;
|
||||
}
|
||||
}
|
||||
|
||||
vscode.window
|
||||
.showErrorMessage(message, "Show Logs", "Troubleshooting")
|
||||
.then((selection) => {
|
||||
if (selection === "Show Logs") {
|
||||
vscode.commands.executeCommand(
|
||||
"workbench.action.toggleDevTools"
|
||||
);
|
||||
} else if (selection === "Troubleshooting") {
|
||||
vscode.env.openExternal(
|
||||
vscode.Uri.parse("https://continue.dev/docs/troubleshooting")
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
constructor(
|
||||
private readonly ide: IDE,
|
||||
private readonly configHandler: ConfigHandler,
|
||||
private readonly verticalDiffManager: VerticalPerLineDiffManager
|
||||
) {
|
||||
this.on("abort", (msg) => {
|
||||
this.abortedMessageIds.add(msg.messageId);
|
||||
});
|
||||
this.on("showFile", (msg) => {
|
||||
this.ide.openFile(msg.data.filepath);
|
||||
});
|
||||
this.on("openConfigJson", (msg) => {
|
||||
this.ide.openFile(getConfigJsonPath());
|
||||
});
|
||||
this.on("readRangeInFile", async (msg) => {
|
||||
return await vscode.workspace
|
||||
.openTextDocument(msg.data.filepath)
|
||||
.then((document) => {
|
||||
let start = new vscode.Position(0, 0);
|
||||
let end = new vscode.Position(5, 0);
|
||||
let range = new vscode.Range(start, end);
|
||||
|
||||
let contents = document.getText(range);
|
||||
return contents;
|
||||
});
|
||||
});
|
||||
this.on("toggleDevTools", (msg) => {
|
||||
vscode.commands.executeCommand("workbench.action.toggleDevTools");
|
||||
vscode.commands.executeCommand("continue.viewLogs");
|
||||
});
|
||||
this.on("reloadWindow", (msg) => {
|
||||
vscode.commands.executeCommand("workbench.action.reloadWindow");
|
||||
});
|
||||
this.on("focusEditor", (msg) => {
|
||||
vscode.commands.executeCommand("workbench.action.focusActiveEditorGroup");
|
||||
});
|
||||
this.on("toggleFullScreen", (msg) => {
|
||||
vscode.commands.executeCommand("continue.toggleFullScreen");
|
||||
});
|
||||
|
||||
// IDE
|
||||
this.on("getDiff", async (msg) => {
|
||||
return await ide.getDiff();
|
||||
});
|
||||
this.on("config/getBrowserSerialized", async (msg) => {
|
||||
return await configHandler.getSerializedConfig();
|
||||
});
|
||||
this.on("getTerminalContents", async (msg) => {
|
||||
return await ide.getTerminalContents();
|
||||
});
|
||||
this.on("listWorkspaceContents", async (msg) => {
|
||||
return await ide.listWorkspaceContents();
|
||||
});
|
||||
this.on("getWorkspaceDirs", async (msg) => {
|
||||
return await ide.getWorkspaceDirs();
|
||||
});
|
||||
this.on("listFolders", async (msg) => {
|
||||
return await ide.listFolders();
|
||||
});
|
||||
this.on("writeFile", async (msg) => {
|
||||
return await ide.writeFile(msg.data.path, msg.data.contents);
|
||||
});
|
||||
this.on("showVirtualFile", async (msg) => {
|
||||
return await ide.showVirtualFile(msg.data.name, msg.data.content);
|
||||
});
|
||||
this.on("getContinueDir", async (msg) => {
|
||||
return await ide.getContinueDir();
|
||||
});
|
||||
this.on("openFile", async (msg) => {
|
||||
return await ide.openFile(msg.data.path);
|
||||
});
|
||||
this.on("runCommand", async (msg) => {
|
||||
await ide.runCommand(msg.data.command);
|
||||
});
|
||||
this.on("getSearchResults", async (msg) => {
|
||||
return await ide.getSearchResults(msg.data.query);
|
||||
});
|
||||
this.on("subprocess", async (msg) => {
|
||||
return await ide.subprocess(msg.data.command);
|
||||
});
|
||||
// History
|
||||
this.on("history/list", (msg) => {
|
||||
return historyManager.list();
|
||||
});
|
||||
this.on("history/save", (msg) => {
|
||||
historyManager.save(msg.data);
|
||||
});
|
||||
this.on("history/delete", (msg) => {
|
||||
historyManager.delete(msg.data.id);
|
||||
});
|
||||
this.on("history/load", (msg) => {
|
||||
return historyManager.load(msg.data.id);
|
||||
});
|
||||
this.on("saveFile", async (msg) => {
|
||||
return await ide.saveFile(msg.data.filepath);
|
||||
});
|
||||
this.on("readFile", async (msg) => {
|
||||
return await ide.readFile(msg.data.filepath);
|
||||
});
|
||||
this.on("showDiff", async (msg) => {
|
||||
return await ide.showDiff(
|
||||
msg.data.filepath,
|
||||
msg.data.newContents,
|
||||
msg.data.stepIndex
|
||||
);
|
||||
});
|
||||
|
||||
this.on("getProblems", async (msg) => {
|
||||
return await ide.getProblems(msg.data.filepath);
|
||||
});
|
||||
this.on("getBranch", async (msg) => {
|
||||
const { dir } = msg.data;
|
||||
return await ide.getBranch(dir);
|
||||
});
|
||||
this.on("getOpenFiles", async (msg) => {
|
||||
return await ide.getOpenFiles();
|
||||
});
|
||||
this.on("getPinnedFiles", async (msg) => {
|
||||
return await ide.getPinnedFiles();
|
||||
});
|
||||
this.on("showLines", async (msg) => {
|
||||
const { filepath, startLine, endLine } = msg.data;
|
||||
return await ide.showLines(filepath, startLine, endLine);
|
||||
});
|
||||
// Other
|
||||
this.on("errorPopup", (msg) => {
|
||||
vscode.window
|
||||
.showErrorMessage(msg.data.message, "Show Logs")
|
||||
.then((selection) => {
|
||||
if (selection === "Show Logs") {
|
||||
vscode.commands.executeCommand("workbench.action.toggleDevTools");
|
||||
}
|
||||
});
|
||||
});
|
||||
this.on("devdata/log", (msg) => {
|
||||
logDevData(msg.data.tableName, msg.data.data);
|
||||
});
|
||||
this.on("config/addModel", (msg) => {
|
||||
const model = msg.data.model;
|
||||
const newConfigString = addModel(model);
|
||||
this.configHandler.reloadConfig();
|
||||
this.ide.openFile(getConfigJsonPath());
|
||||
|
||||
// Find the range where it was added and highlight
|
||||
let lines = newConfigString.split("\n");
|
||||
let startLine;
|
||||
let endLine;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
let line = lines[i];
|
||||
|
||||
if (!startLine) {
|
||||
if (line.trim() === `"title": "${model.title}",`) {
|
||||
startLine = i - 1;
|
||||
}
|
||||
} else {
|
||||
if (line.startsWith(" }")) {
|
||||
endLine = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (startLine && endLine) {
|
||||
this.ide.showLines(
|
||||
getConfigJsonPath(),
|
||||
startLine,
|
||||
endLine
|
||||
// "#fff1"
|
||||
);
|
||||
}
|
||||
vscode.window.showInformationMessage(
|
||||
"🎉 Your model has been successfully added to config.json. You can use this file to further edit its configuration."
|
||||
);
|
||||
});
|
||||
this.on("config/deleteModel", (msg) => {
|
||||
deleteModel(msg.data.title);
|
||||
this.configHandler.reloadConfig();
|
||||
});
|
||||
this.on("config/addOpenAiKey", async (msg) => {
|
||||
addOpenAIKey(msg.data);
|
||||
this.configHandler.reloadConfig();
|
||||
});
|
||||
|
||||
async function* llmStreamComplete(
|
||||
protocol: VsCodeWebviewProtocol,
|
||||
msg: Message<WebviewProtocol["llm/streamComplete"][0]>
|
||||
) {
|
||||
const model = await protocol.configHandler.llmFromTitle(msg.data.title);
|
||||
const gen = model.streamComplete(
|
||||
msg.data.prompt,
|
||||
msg.data.completionOptions
|
||||
);
|
||||
let next = await gen.next();
|
||||
while (!next.done) {
|
||||
if (protocol.abortedMessageIds.has(msg.messageId)) {
|
||||
protocol.abortedMessageIds.delete(msg.messageId);
|
||||
next = await gen.return({ completion: "", prompt: "" });
|
||||
break;
|
||||
}
|
||||
yield { content: next.value };
|
||||
next = await gen.next();
|
||||
}
|
||||
|
||||
return { done: true, content: next.value };
|
||||
}
|
||||
this.on("llm/streamComplete", (msg) => llmStreamComplete(this, msg));
|
||||
|
||||
async function* llmStreamChat(
|
||||
protocol: VsCodeWebviewProtocol,
|
||||
msg: Message<WebviewProtocol["llm/streamChat"][0]>
|
||||
) {
|
||||
const model = await protocol.configHandler.llmFromTitle(msg.data.title);
|
||||
const gen = model.streamChat(
|
||||
msg.data.messages,
|
||||
msg.data.completionOptions
|
||||
);
|
||||
let next = await gen.next();
|
||||
while (!next.done) {
|
||||
if (protocol.abortedMessageIds.has(msg.messageId)) {
|
||||
protocol.abortedMessageIds.delete(msg.messageId);
|
||||
next = await gen.return({ completion: "", prompt: "" });
|
||||
break;
|
||||
}
|
||||
yield { content: next.value.content };
|
||||
next = await gen.next();
|
||||
}
|
||||
|
||||
return { done: true, content: next.value };
|
||||
}
|
||||
this.on("llm/streamChat", (msg) => llmStreamChat(this, msg));
|
||||
this.on("llm/complete", async (msg) => {
|
||||
const model = await this.configHandler.llmFromTitle(msg.data.title);
|
||||
const completion = await model.complete(
|
||||
msg.data.prompt,
|
||||
msg.data.completionOptions
|
||||
);
|
||||
return completion;
|
||||
});
|
||||
|
||||
async function* runNodeJsSlashCommand(
|
||||
protocol: VsCodeWebviewProtocol,
|
||||
msg: Message<WebviewProtocol["command/run"][0]>
|
||||
) {
|
||||
const {
|
||||
input,
|
||||
history,
|
||||
modelTitle,
|
||||
slashCommandName,
|
||||
contextItems,
|
||||
params,
|
||||
historyIndex,
|
||||
selectedCode,
|
||||
} = msg.data;
|
||||
|
||||
const config = await protocol.configHandler.loadConfig();
|
||||
const llm = await protocol.configHandler.llmFromTitle(modelTitle);
|
||||
const slashCommand = config.slashCommands?.find(
|
||||
(sc) => sc.name === slashCommandName
|
||||
);
|
||||
if (!slashCommand) {
|
||||
throw new Error(`Unknown slash command ${slashCommandName}`);
|
||||
}
|
||||
|
||||
for await (const content of slashCommand.run({
|
||||
input,
|
||||
history,
|
||||
llm,
|
||||
contextItems,
|
||||
params,
|
||||
ide,
|
||||
addContextItem: (item) => {
|
||||
protocol.request("addContextItem", {
|
||||
item,
|
||||
historyIndex,
|
||||
});
|
||||
},
|
||||
selectedCode,
|
||||
config,
|
||||
})) {
|
||||
if (content) {
|
||||
yield { content };
|
||||
}
|
||||
}
|
||||
yield { done: true, content: "" };
|
||||
}
|
||||
this.on("command/run", (msg) => runNodeJsSlashCommand(this, msg));
|
||||
|
||||
this.on("context/loadSubmenuItems", async (msg) => {
|
||||
const { title } = msg.data;
|
||||
const config = await this.configHandler.loadConfig();
|
||||
const provider = config.contextProviders?.find(
|
||||
(p) => p.description.title === title
|
||||
);
|
||||
if (!provider) {
|
||||
vscode.window.showErrorMessage(
|
||||
`Unknown provider ${title}. Existing providers: ${config.contextProviders
|
||||
?.map((p) => p.description.title)
|
||||
.join(", ")}`
|
||||
);
|
||||
return [];
|
||||
}
|
||||
|
||||
try {
|
||||
const items = await provider.loadSubmenuItems({ ide });
|
||||
return items;
|
||||
} catch (e) {
|
||||
vscode.window.showErrorMessage(
|
||||
`Error loading submenu items from ${title}: ${e}`
|
||||
);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
|
||||
this.on("context/getContextItems", async (msg) => {
|
||||
const { name, query, fullInput, selectedCode } = msg.data;
|
||||
const config = await this.configHandler.loadConfig();
|
||||
const llm = await this.configHandler.llmFromTitle();
|
||||
const provider = config.contextProviders?.find(
|
||||
(p) => p.description.title === name
|
||||
);
|
||||
if (!provider) {
|
||||
vscode.window.showErrorMessage(
|
||||
`Unknown provider ${name}. Existing providers: ${config.contextProviders
|
||||
?.map((p) => p.description.title)
|
||||
.join(", ")}`
|
||||
);
|
||||
return [];
|
||||
}
|
||||
|
||||
try {
|
||||
const id: ContextItemId = {
|
||||
providerTitle: provider.description.title,
|
||||
itemId: uuidv4(),
|
||||
};
|
||||
const items = await provider.getContextItems(query, {
|
||||
llm,
|
||||
embeddingsProvider: config.embeddingsProvider,
|
||||
fullInput,
|
||||
ide,
|
||||
selectedCode,
|
||||
});
|
||||
return items.map((item) => ({ ...item, id }));
|
||||
} catch (e) {
|
||||
vscode.window.showErrorMessage(
|
||||
`Error getting context items from ${name}: ${e}`
|
||||
);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
this.on("context/addDocs", (msg) => {
|
||||
const { url, title } = msg.data;
|
||||
const embeddingsProvider = new TransformersJsEmbeddingsProvider();
|
||||
vscode.window.withProgress(
|
||||
{
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
title: `Indexing ${title}`,
|
||||
cancellable: false,
|
||||
},
|
||||
async (progress) => {
|
||||
for await (const update of indexDocs(
|
||||
title,
|
||||
new URL(url),
|
||||
embeddingsProvider
|
||||
)) {
|
||||
progress.report({
|
||||
increment: update.progress,
|
||||
message: update.desc,
|
||||
});
|
||||
}
|
||||
|
||||
vscode.window.showInformationMessage(
|
||||
`🎉 Successfully indexed ${title}`
|
||||
);
|
||||
|
||||
this.request("refreshSubmenuItems", undefined);
|
||||
}
|
||||
);
|
||||
});
|
||||
this.on("applyToCurrentFile", (msg) => {
|
||||
// Select the entire current file
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (!editor) {
|
||||
vscode.window.showErrorMessage("No active editor to apply edits to");
|
||||
return;
|
||||
}
|
||||
const document = editor.document;
|
||||
const start = new vscode.Position(0, 0);
|
||||
const end = new vscode.Position(
|
||||
document.lineCount - 1,
|
||||
document.lineAt(document.lineCount - 1).text.length
|
||||
);
|
||||
editor.selection = new vscode.Selection(start, end);
|
||||
|
||||
this.verticalDiffManager.streamEdit(
|
||||
`The following code was suggested as an edit:\n\`\`\`\n${msg.data.text}\n\`\`\`\nPlease apply it to the previous code.`
|
||||
);
|
||||
});
|
||||
this.on("showTutorial", (msg) => {
|
||||
showTutorial();
|
||||
});
|
||||
|
||||
this.on("openUrl", (msg) => {
|
||||
vscode.env.openExternal(vscode.Uri.parse(msg.data));
|
||||
});
|
||||
}
|
||||
|
||||
public request<T extends keyof ReverseWebviewProtocol>(
|
||||
messageType: T,
|
||||
data: ReverseWebviewProtocol[T][0]
|
||||
): Promise<ReverseWebviewProtocol[T][1]> {
|
||||
const messageId = uuidv4();
|
||||
return new Promise((resolve) => {
|
||||
if (!this.webview) {
|
||||
resolve(undefined);
|
||||
return;
|
||||
}
|
||||
|
||||
this.send(messageType, data, messageId);
|
||||
const disposable = this.webview.onDidReceiveMessage((msg) => {
|
||||
resolve(msg);
|
||||
disposable?.dispose();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
"module": "commonjs",
|
||||
"target": "ES2020",
|
||||
"outDir": "out/tsc/src",
|
||||
"lib": ["ES2020", "dom", "es6", "es5", "dom.iterable", "scripthost"],
|
||||
"lib": ["ES2021", "dom", "es6", "es5", "dom.iterable", "scripthost"],
|
||||
"sourceMap": true,
|
||||
"rootDir": "../../",
|
||||
"strict": true /* enable all strict type-checking options */,
|
||||
|
|
|
|||
|
|
@ -415,7 +415,7 @@
|
|||
resolved "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz"
|
||||
integrity sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==
|
||||
|
||||
"@gar/promisify@^1.1.3":
|
||||
"@gar/promisify@^1.0.1", "@gar/promisify@^1.1.3":
|
||||
version "1.1.3"
|
||||
resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz"
|
||||
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==
|
||||
|
|
@ -780,6 +780,14 @@
|
|||
"@nodelib/fs.scandir" "2.1.5"
|
||||
fastq "^1.6.0"
|
||||
|
||||
"@npmcli/fs@^1.0.0":
|
||||
version "1.1.1"
|
||||
resolved "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz"
|
||||
integrity sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==
|
||||
dependencies:
|
||||
"@gar/promisify" "^1.0.1"
|
||||
semver "^7.3.5"
|
||||
|
||||
"@npmcli/fs@^2.1.0":
|
||||
version "2.1.2"
|
||||
resolved "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.2.tgz"
|
||||
|
|
@ -788,6 +796,14 @@
|
|||
"@gar/promisify" "^1.1.3"
|
||||
semver "^7.3.5"
|
||||
|
||||
"@npmcli/move-file@^1.0.1":
|
||||
version "1.1.2"
|
||||
resolved "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz"
|
||||
integrity sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==
|
||||
dependencies:
|
||||
mkdirp "^1.0.4"
|
||||
rimraf "^3.0.2"
|
||||
|
||||
"@npmcli/move-file@^2.0.0":
|
||||
version "2.0.1"
|
||||
resolved "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.1.tgz"
|
||||
|
|
@ -1413,7 +1429,7 @@
|
|||
optionalDependencies:
|
||||
keytar "^7.7.0"
|
||||
|
||||
abbrev@^1.0.0:
|
||||
abbrev@^1.0.0, abbrev@1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz"
|
||||
integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
|
||||
|
|
@ -1436,7 +1452,7 @@ acorn-jsx@^5.3.2:
|
|||
resolved "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz"
|
||||
integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==
|
||||
|
||||
agent-base@^6.0.2:
|
||||
agent-base@^6.0.2, agent-base@6:
|
||||
version "6.0.2"
|
||||
resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz"
|
||||
integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==
|
||||
|
|
@ -1450,14 +1466,7 @@ agent-base@^7.0.2, agent-base@^7.1.0:
|
|||
dependencies:
|
||||
debug "^4.3.4"
|
||||
|
||||
agent-base@6:
|
||||
version "6.0.2"
|
||||
resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz"
|
||||
integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==
|
||||
dependencies:
|
||||
debug "4"
|
||||
|
||||
agentkeepalive@^4.2.1:
|
||||
agentkeepalive@^4.1.3, agentkeepalive@^4.2.1:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz"
|
||||
integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==
|
||||
|
|
@ -1768,6 +1777,13 @@ binary-extensions@^2.0.0:
|
|||
resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz"
|
||||
integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
|
||||
|
||||
bindings@^1.5.0:
|
||||
version "1.5.0"
|
||||
resolved "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz"
|
||||
integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
|
||||
dependencies:
|
||||
file-uri-to-path "1.0.0"
|
||||
|
||||
bl@^4.0.3, bl@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz"
|
||||
|
|
@ -1854,6 +1870,11 @@ buffer-from@^1.0.0:
|
|||
resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz"
|
||||
integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
|
||||
|
||||
buffer-writer@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz"
|
||||
integrity sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==
|
||||
|
||||
buffer@^5.5.0:
|
||||
version "5.7.1"
|
||||
resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz"
|
||||
|
|
@ -1867,6 +1888,30 @@ bytes@3.1.2:
|
|||
resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz"
|
||||
integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==
|
||||
|
||||
cacache@^15.2.0:
|
||||
version "15.3.0"
|
||||
resolved "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz"
|
||||
integrity sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==
|
||||
dependencies:
|
||||
"@npmcli/fs" "^1.0.0"
|
||||
"@npmcli/move-file" "^1.0.1"
|
||||
chownr "^2.0.0"
|
||||
fs-minipass "^2.0.0"
|
||||
glob "^7.1.4"
|
||||
infer-owner "^1.0.4"
|
||||
lru-cache "^6.0.0"
|
||||
minipass "^3.1.1"
|
||||
minipass-collect "^1.0.2"
|
||||
minipass-flush "^1.0.5"
|
||||
minipass-pipeline "^1.2.2"
|
||||
mkdirp "^1.0.3"
|
||||
p-map "^4.0.0"
|
||||
promise-inflight "^1.0.1"
|
||||
rimraf "^3.0.2"
|
||||
ssri "^8.0.1"
|
||||
tar "^6.0.2"
|
||||
unique-filename "^1.1.1"
|
||||
|
||||
cacache@^16.1.0:
|
||||
version "16.1.3"
|
||||
resolved "https://registry.npmjs.org/cacache/-/cacache-16.1.3.tgz"
|
||||
|
|
@ -2323,15 +2368,22 @@ core-util-is@1.0.2:
|
|||
adf-to-md "^1.1.0"
|
||||
axios "^1.6.7"
|
||||
cheerio "^1.0.0-rc.12"
|
||||
commander "^12.0.0"
|
||||
dbinfoz "^0.1.4"
|
||||
dotenv "^16.3.1"
|
||||
fastest-levenshtein "^1.0.16"
|
||||
follow-redirects "^1.15.5"
|
||||
handlebars "^4.7.8"
|
||||
http-proxy-agent "^7.0.1"
|
||||
https-proxy-agent "^7.0.3"
|
||||
js-tiktoken "^1.0.8"
|
||||
llama-tokenizer-js "^1.1.3"
|
||||
llm-code-highlighter "^0.0.13"
|
||||
node-fetch "^3.3.2"
|
||||
node-html-markdown "^1.3.0"
|
||||
ollama "^0.4.6"
|
||||
openai "^4.20.1"
|
||||
pg "^8.11.3"
|
||||
posthog-node "^3.6.2"
|
||||
replicate "^0.26.0"
|
||||
socket.io-client "^4.7.3"
|
||||
|
|
@ -2425,6 +2477,15 @@ date-fns@^2.16.1:
|
|||
dependencies:
|
||||
"@babel/runtime" "^7.21.0"
|
||||
|
||||
dbinfoz@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.npmjs.org/dbinfoz/-/dbinfoz-0.1.4.tgz"
|
||||
integrity sha512-MB56+xS571ip7qoXqxdnOUtXebbWaqoZN+S++W51SQYJRSjQFGEIPucNmxgeQlBGJ1vM4mQNV47wzV6fcrezZg==
|
||||
dependencies:
|
||||
mysql2 "^3.9.1"
|
||||
pg "^8.11.3"
|
||||
sqlite3 "^5.1.7"
|
||||
|
||||
debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2, debug@4, debug@4.3.4:
|
||||
version "4.3.4"
|
||||
resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz"
|
||||
|
|
@ -2509,6 +2570,11 @@ delegates@^1.0.0:
|
|||
resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz"
|
||||
integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==
|
||||
|
||||
denque@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz"
|
||||
integrity sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==
|
||||
|
||||
depd@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz"
|
||||
|
|
@ -2664,7 +2730,7 @@ encodeurl@~1.0.2:
|
|||
resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz"
|
||||
integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==
|
||||
|
||||
encoding@^0.1.0, encoding@^0.1.13:
|
||||
encoding@^0.1.0, encoding@^0.1.12, encoding@^0.1.13:
|
||||
version "0.1.13"
|
||||
resolved "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz"
|
||||
integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==
|
||||
|
|
@ -3164,6 +3230,11 @@ file-entry-cache@^6.0.1:
|
|||
dependencies:
|
||||
flat-cache "^3.0.4"
|
||||
|
||||
file-uri-to-path@1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz"
|
||||
integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==
|
||||
|
||||
fill-range@^7.0.1:
|
||||
version "7.0.1"
|
||||
resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz"
|
||||
|
|
@ -3379,6 +3450,13 @@ gauge@^4.0.3:
|
|||
strip-ansi "^6.0.1"
|
||||
wide-align "^1.1.5"
|
||||
|
||||
generate-function@^2.3.1:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz"
|
||||
integrity sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==
|
||||
dependencies:
|
||||
is-property "^1.0.2"
|
||||
|
||||
gensync@^1.0.0-beta.2:
|
||||
version "1.0.0-beta.2"
|
||||
resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz"
|
||||
|
|
@ -3852,6 +3930,13 @@ iconv-lite@^0.6.2:
|
|||
dependencies:
|
||||
safer-buffer ">= 2.1.2 < 3.0.0"
|
||||
|
||||
iconv-lite@^0.6.3:
|
||||
version "0.6.3"
|
||||
resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz"
|
||||
integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
|
||||
dependencies:
|
||||
safer-buffer ">= 2.1.2 < 3.0.0"
|
||||
|
||||
ieee754@^1.1.13:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz"
|
||||
|
|
@ -4058,6 +4143,11 @@ is-promise@^2.2.2:
|
|||
resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz"
|
||||
integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==
|
||||
|
||||
is-property@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz"
|
||||
integrity sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==
|
||||
|
||||
is-stream@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz"
|
||||
|
|
@ -4763,6 +4853,11 @@ log-symbols@^4.1.0, log-symbols@4.1.0:
|
|||
chalk "^4.1.0"
|
||||
is-unicode-supported "^0.1.0"
|
||||
|
||||
long@^5.2.1:
|
||||
version "5.2.3"
|
||||
resolved "https://registry.npmjs.org/long/-/long-5.2.3.tgz"
|
||||
integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==
|
||||
|
||||
loose-envify@^1.1.0, loose-envify@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz"
|
||||
|
|
@ -4789,11 +4884,21 @@ lru-cache@^6.0.0:
|
|||
dependencies:
|
||||
yallist "^4.0.0"
|
||||
|
||||
lru-cache@^7.14.1:
|
||||
version "7.18.3"
|
||||
resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz"
|
||||
integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==
|
||||
|
||||
lru-cache@^7.7.1:
|
||||
version "7.18.3"
|
||||
resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz"
|
||||
integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==
|
||||
|
||||
lru-cache@^8.0.0:
|
||||
version "8.0.5"
|
||||
resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz"
|
||||
integrity sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==
|
||||
|
||||
"lru-cache@^9.1.1 || ^10.0.0":
|
||||
version "10.2.0"
|
||||
resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz"
|
||||
|
|
@ -4835,6 +4940,28 @@ make-fetch-happen@^10.0.3:
|
|||
socks-proxy-agent "^7.0.0"
|
||||
ssri "^9.0.0"
|
||||
|
||||
make-fetch-happen@^9.1.0:
|
||||
version "9.1.0"
|
||||
resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz"
|
||||
integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==
|
||||
dependencies:
|
||||
agentkeepalive "^4.1.3"
|
||||
cacache "^15.2.0"
|
||||
http-cache-semantics "^4.1.0"
|
||||
http-proxy-agent "^4.0.1"
|
||||
https-proxy-agent "^5.0.0"
|
||||
is-lambda "^1.0.1"
|
||||
lru-cache "^6.0.0"
|
||||
minipass "^3.1.3"
|
||||
minipass-collect "^1.0.2"
|
||||
minipass-fetch "^1.3.2"
|
||||
minipass-flush "^1.0.5"
|
||||
minipass-pipeline "^1.2.4"
|
||||
negotiator "^0.6.2"
|
||||
promise-retry "^2.0.1"
|
||||
socks-proxy-agent "^6.0.0"
|
||||
ssri "^8.0.0"
|
||||
|
||||
makeerror@1.0.12:
|
||||
version "1.0.12"
|
||||
resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz"
|
||||
|
|
@ -5226,6 +5353,17 @@ minipass-collect@^1.0.2:
|
|||
dependencies:
|
||||
minipass "^3.0.0"
|
||||
|
||||
minipass-fetch@^1.3.2:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz"
|
||||
integrity sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==
|
||||
dependencies:
|
||||
minipass "^3.1.0"
|
||||
minipass-sized "^1.0.3"
|
||||
minizlib "^2.0.0"
|
||||
optionalDependencies:
|
||||
encoding "^0.1.12"
|
||||
|
||||
minipass-fetch@^2.0.3:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.2.tgz"
|
||||
|
|
@ -5244,7 +5382,7 @@ minipass-flush@^1.0.5:
|
|||
dependencies:
|
||||
minipass "^3.0.0"
|
||||
|
||||
minipass-pipeline@^1.2.4:
|
||||
minipass-pipeline@^1.2.2, minipass-pipeline@^1.2.4:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz"
|
||||
integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==
|
||||
|
|
@ -5258,7 +5396,7 @@ minipass-sized@^1.0.3:
|
|||
dependencies:
|
||||
minipass "^3.0.0"
|
||||
|
||||
minipass@^3.0.0, minipass@^3.1.1, minipass@^3.1.6:
|
||||
minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3, minipass@^3.1.6:
|
||||
version "3.3.6"
|
||||
resolved "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz"
|
||||
integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==
|
||||
|
|
@ -5275,7 +5413,7 @@ minipass@^5.0.0:
|
|||
resolved "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz"
|
||||
integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==
|
||||
|
||||
minizlib@^2.1.1, minizlib@^2.1.2:
|
||||
minizlib@^2.0.0, minizlib@^2.1.1, minizlib@^2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz"
|
||||
integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==
|
||||
|
|
@ -5358,6 +5496,20 @@ mute-stream@~0.0.4, mute-stream@0.0.8:
|
|||
resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz"
|
||||
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
|
||||
|
||||
mysql2@^3.9.1:
|
||||
version "3.9.1"
|
||||
resolved "https://registry.npmjs.org/mysql2/-/mysql2-3.9.1.tgz"
|
||||
integrity sha512-3njoWAAhGBYy0tWBabqUQcLtczZUxrmmtc2vszQUekg3kTJyZ5/IeLC3Fo04u6y6Iy5Sba7pIIa2P/gs8D3ZeQ==
|
||||
dependencies:
|
||||
denque "^2.1.0"
|
||||
generate-function "^2.3.1"
|
||||
iconv-lite "^0.6.3"
|
||||
long "^5.2.1"
|
||||
lru-cache "^8.0.0"
|
||||
named-placeholders "^1.1.3"
|
||||
seq-queue "^0.0.5"
|
||||
sqlstring "^2.3.2"
|
||||
|
||||
mz@^2.7.0:
|
||||
version "2.7.0"
|
||||
resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz"
|
||||
|
|
@ -5367,6 +5519,13 @@ mz@^2.7.0:
|
|||
object-assign "^4.0.1"
|
||||
thenify-all "^1.0.0"
|
||||
|
||||
named-placeholders@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz"
|
||||
integrity sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==
|
||||
dependencies:
|
||||
lru-cache "^7.14.1"
|
||||
|
||||
nanoid@^3.3.7:
|
||||
version "3.3.7"
|
||||
resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz"
|
||||
|
|
@ -5392,7 +5551,7 @@ ncp@^2.0.0:
|
|||
resolved "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz"
|
||||
integrity sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==
|
||||
|
||||
negotiator@^0.6.3, negotiator@0.6.3:
|
||||
negotiator@^0.6.2, negotiator@^0.6.3, negotiator@0.6.3:
|
||||
version "0.6.3"
|
||||
resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz"
|
||||
integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==
|
||||
|
|
@ -5419,6 +5578,11 @@ node-addon-api@^4.3.0:
|
|||
resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz"
|
||||
integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==
|
||||
|
||||
node-addon-api@^7.0.0:
|
||||
version "7.1.0"
|
||||
resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz"
|
||||
integrity sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==
|
||||
|
||||
node-api-version@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.npmjs.org/node-api-version/-/node-api-version-0.2.0.tgz"
|
||||
|
|
@ -5464,6 +5628,22 @@ node-gyp@^9.0.0:
|
|||
tar "^6.1.2"
|
||||
which "^2.0.2"
|
||||
|
||||
node-gyp@8.x:
|
||||
version "8.4.1"
|
||||
resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz"
|
||||
integrity sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==
|
||||
dependencies:
|
||||
env-paths "^2.2.0"
|
||||
glob "^7.1.4"
|
||||
graceful-fs "^4.2.6"
|
||||
make-fetch-happen "^9.1.0"
|
||||
nopt "^5.0.0"
|
||||
npmlog "^6.0.0"
|
||||
rimraf "^3.0.2"
|
||||
semver "^7.3.5"
|
||||
tar "^6.1.2"
|
||||
which "^2.0.2"
|
||||
|
||||
node-int64@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz"
|
||||
|
|
@ -5479,6 +5659,13 @@ node-releases@^2.0.14:
|
|||
resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz"
|
||||
integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==
|
||||
|
||||
nopt@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz"
|
||||
integrity sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==
|
||||
dependencies:
|
||||
abbrev "1"
|
||||
|
||||
nopt@^6.0.0:
|
||||
version "6.0.0"
|
||||
resolved "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz"
|
||||
|
|
@ -5651,6 +5838,11 @@ p-try@^2.0.0:
|
|||
resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz"
|
||||
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
|
||||
|
||||
packet-reader@1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz"
|
||||
integrity sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==
|
||||
|
||||
pad-left@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.npmjs.org/pad-left/-/pad-left-2.1.0.tgz"
|
||||
|
|
@ -5760,6 +5952,64 @@ performance-now@^2.1.0:
|
|||
resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz"
|
||||
integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==
|
||||
|
||||
pg-cloudflare@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz"
|
||||
integrity sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==
|
||||
|
||||
pg-connection-string@^2.6.2:
|
||||
version "2.6.2"
|
||||
resolved "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz"
|
||||
integrity sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==
|
||||
|
||||
pg-int8@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz"
|
||||
integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==
|
||||
|
||||
pg-pool@^3.6.1:
|
||||
version "3.6.1"
|
||||
resolved "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz"
|
||||
integrity sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==
|
||||
|
||||
pg-protocol@^1.6.0:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz"
|
||||
integrity sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==
|
||||
|
||||
pg-types@^2.1.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz"
|
||||
integrity sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==
|
||||
dependencies:
|
||||
pg-int8 "1.0.1"
|
||||
postgres-array "~2.0.0"
|
||||
postgres-bytea "~1.0.0"
|
||||
postgres-date "~1.0.4"
|
||||
postgres-interval "^1.1.0"
|
||||
|
||||
pg@^8.11.3, pg@>=8.0:
|
||||
version "8.11.3"
|
||||
resolved "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz"
|
||||
integrity sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==
|
||||
dependencies:
|
||||
buffer-writer "2.0.0"
|
||||
packet-reader "1.0.0"
|
||||
pg-connection-string "^2.6.2"
|
||||
pg-pool "^3.6.1"
|
||||
pg-protocol "^1.6.0"
|
||||
pg-types "^2.1.0"
|
||||
pgpass "1.x"
|
||||
optionalDependencies:
|
||||
pg-cloudflare "^1.1.1"
|
||||
|
||||
pgpass@1.x:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz"
|
||||
integrity sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==
|
||||
dependencies:
|
||||
split2 "^4.1.0"
|
||||
|
||||
picocolors@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz"
|
||||
|
|
@ -5847,6 +6097,28 @@ postcss@^8.0.0, postcss@^8.2.14, postcss@^8.4.21, postcss@^8.4.23, postcss@^8.4.
|
|||
picocolors "^1.0.0"
|
||||
source-map-js "^1.0.2"
|
||||
|
||||
postgres-array@~2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz"
|
||||
integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==
|
||||
|
||||
postgres-bytea@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz"
|
||||
integrity sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==
|
||||
|
||||
postgres-date@~1.0.4:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz"
|
||||
integrity sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==
|
||||
|
||||
postgres-interval@^1.1.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz"
|
||||
integrity sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==
|
||||
dependencies:
|
||||
xtend "^4.0.0"
|
||||
|
||||
posthog-node@^3.1.2:
|
||||
version "3.6.3"
|
||||
resolved "https://registry.npmjs.org/posthog-node/-/posthog-node-3.6.3.tgz"
|
||||
|
|
@ -5855,7 +6127,7 @@ posthog-node@^3.1.2:
|
|||
axios "^1.6.2"
|
||||
rusha "^0.8.14"
|
||||
|
||||
prebuild-install@^7.0.1:
|
||||
prebuild-install@^7.0.1, prebuild-install@^7.1.1:
|
||||
version "7.1.1"
|
||||
resolved "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz"
|
||||
integrity sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==
|
||||
|
|
@ -6467,6 +6739,11 @@ send@0.18.0:
|
|||
range-parser "~1.2.1"
|
||||
statuses "2.0.1"
|
||||
|
||||
seq-queue@^0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz"
|
||||
integrity sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==
|
||||
|
||||
serialize-javascript@6.0.0:
|
||||
version "6.0.0"
|
||||
resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz"
|
||||
|
|
@ -6590,6 +6867,15 @@ socket.io-parser@~4.2.4:
|
|||
"@socket.io/component-emitter" "~3.1.0"
|
||||
debug "~4.3.1"
|
||||
|
||||
socks-proxy-agent@^6.0.0:
|
||||
version "6.2.1"
|
||||
resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz"
|
||||
integrity sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==
|
||||
dependencies:
|
||||
agent-base "^6.0.2"
|
||||
debug "^4.3.3"
|
||||
socks "^2.6.2"
|
||||
|
||||
socks-proxy-agent@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz"
|
||||
|
|
@ -6635,6 +6921,11 @@ spawn-command@^0.0.2-1:
|
|||
resolved "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz"
|
||||
integrity sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg==
|
||||
|
||||
split2@^4.1.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz"
|
||||
integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==
|
||||
|
||||
sprintf-js@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz"
|
||||
|
|
@ -6645,6 +6936,23 @@ sprintf-js@~1.0.2:
|
|||
resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz"
|
||||
integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==
|
||||
|
||||
sqlite3@^5.1.7:
|
||||
version "5.1.7"
|
||||
resolved "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz"
|
||||
integrity sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==
|
||||
dependencies:
|
||||
bindings "^1.5.0"
|
||||
node-addon-api "^7.0.0"
|
||||
prebuild-install "^7.1.1"
|
||||
tar "^6.1.11"
|
||||
optionalDependencies:
|
||||
node-gyp "8.x"
|
||||
|
||||
sqlstring@^2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz"
|
||||
integrity sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==
|
||||
|
||||
sshpk@^1.7.0:
|
||||
version "1.18.0"
|
||||
resolved "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz"
|
||||
|
|
@ -6660,6 +6968,13 @@ sshpk@^1.7.0:
|
|||
safer-buffer "^2.0.2"
|
||||
tweetnacl "~0.14.0"
|
||||
|
||||
ssri@^8.0.0, ssri@^8.0.1:
|
||||
version "8.0.1"
|
||||
resolved "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz"
|
||||
integrity sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==
|
||||
dependencies:
|
||||
minipass "^3.1.1"
|
||||
|
||||
ssri@^9.0.0:
|
||||
version "9.0.1"
|
||||
resolved "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz"
|
||||
|
|
@ -6896,7 +7211,7 @@ tar-stream@^2.1.4:
|
|||
inherits "^2.0.3"
|
||||
readable-stream "^3.1.1"
|
||||
|
||||
tar@^6.0.5, tar@^6.1.11, tar@^6.1.2:
|
||||
tar@^6.0.2, tar@^6.0.5, tar@^6.1.11, tar@^6.1.2:
|
||||
version "6.2.0"
|
||||
resolved "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz"
|
||||
integrity sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==
|
||||
|
|
@ -7181,6 +7496,13 @@ unified@^10.0.0:
|
|||
trough "^2.0.0"
|
||||
vfile "^5.0.0"
|
||||
|
||||
unique-filename@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz"
|
||||
integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==
|
||||
dependencies:
|
||||
unique-slug "^2.0.0"
|
||||
|
||||
unique-filename@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.1.tgz"
|
||||
|
|
@ -7188,6 +7510,13 @@ unique-filename@^2.0.0:
|
|||
dependencies:
|
||||
unique-slug "^3.0.0"
|
||||
|
||||
unique-slug@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz"
|
||||
integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==
|
||||
dependencies:
|
||||
imurmurhash "^0.1.4"
|
||||
|
||||
unique-slug@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-3.0.0.tgz"
|
||||
|
|
@ -7583,6 +7912,11 @@ xmlhttprequest-ssl@~2.0.0:
|
|||
resolved "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz"
|
||||
integrity sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==
|
||||
|
||||
xtend@^4.0.0:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz"
|
||||
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
|
||||
|
||||
y18n@^5.0.5:
|
||||
version "5.0.8"
|
||||
resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz"
|
||||
|
|
|
|||
480
gui/package-lock.json
generated
480
gui/package-lock.json
generated
|
|
@ -79,15 +79,22 @@
|
|||
"adf-to-md": "^1.1.0",
|
||||
"axios": "^1.6.7",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
"commander": "^12.0.0",
|
||||
"dbinfoz": "^0.1.4",
|
||||
"dotenv": "^16.3.1",
|
||||
"fastest-levenshtein": "^1.0.16",
|
||||
"follow-redirects": "^1.15.5",
|
||||
"handlebars": "^4.7.8",
|
||||
"http-proxy-agent": "^7.0.1",
|
||||
"https-proxy-agent": "^7.0.3",
|
||||
"js-tiktoken": "^1.0.8",
|
||||
"llama-tokenizer-js": "^1.1.3",
|
||||
"llm-code-highlighter": "^0.0.13",
|
||||
"node-fetch": "^3.3.2",
|
||||
"node-html-markdown": "^1.3.0",
|
||||
"ollama": "^0.4.6",
|
||||
"openai": "^4.20.1",
|
||||
"pg": "^8.11.3",
|
||||
"posthog-node": "^3.6.2",
|
||||
"replicate": "^0.26.0",
|
||||
"socket.io-client": "^4.7.3",
|
||||
|
|
@ -99,6 +106,7 @@
|
|||
"web-tree-sitter": "^0.20.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"@types/handlebars": "^4.1.0",
|
||||
"@types/jest": "^29.5.11",
|
||||
"@types/jquery": "^3.5.29",
|
||||
|
|
@ -836,12 +844,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@floating-ui/dom": {
|
||||
"version": "1.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.1.tgz",
|
||||
"integrity": "sha512-iA8qE43/H5iGozC3W0YSnVSW42Vh522yyM1gj+BqRwVsTNOyr231PsXDaV04yT39PsO0QL2QpbI/M0ZaLUQgRQ==",
|
||||
"version": "1.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.3.tgz",
|
||||
"integrity": "sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==",
|
||||
"dependencies": {
|
||||
"@floating-ui/core": "^1.6.0",
|
||||
"@floating-ui/utils": "^0.2.1"
|
||||
"@floating-ui/core": "^1.0.0",
|
||||
"@floating-ui/utils": "^0.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@floating-ui/utils": {
|
||||
|
|
@ -904,9 +912,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@jridgewell/resolve-uri": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
|
||||
"integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
|
||||
"integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
|
|
@ -1113,13 +1121,13 @@
|
|||
"integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg=="
|
||||
},
|
||||
"node_modules/@swc/core": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core/-/core-1.4.0.tgz",
|
||||
"integrity": "sha512-wc5DMI5BJftnK0Fyx9SNJKkA0+BZSJQx8430yutWmsILkHMBD3Yd9GhlMaxasab9RhgKqZp7Ht30hUYO5ZDvQg==",
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core/-/core-1.4.1.tgz",
|
||||
"integrity": "sha512-3y+Y8js+e7BbM16iND+6Rcs3jdiL28q3iVtYsCviYSSpP2uUVKkp5sJnCY4pg8AaVvyN7CGQHO7gLEZQ5ByozQ==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@swc/counter": "^0.1.1",
|
||||
"@swc/counter": "^0.1.2",
|
||||
"@swc/types": "^0.1.5"
|
||||
},
|
||||
"engines": {
|
||||
|
|
@ -1130,16 +1138,16 @@
|
|||
"url": "https://opencollective.com/swc"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@swc/core-darwin-arm64": "1.4.0",
|
||||
"@swc/core-darwin-x64": "1.4.0",
|
||||
"@swc/core-linux-arm-gnueabihf": "1.4.0",
|
||||
"@swc/core-linux-arm64-gnu": "1.4.0",
|
||||
"@swc/core-linux-arm64-musl": "1.4.0",
|
||||
"@swc/core-linux-x64-gnu": "1.4.0",
|
||||
"@swc/core-linux-x64-musl": "1.4.0",
|
||||
"@swc/core-win32-arm64-msvc": "1.4.0",
|
||||
"@swc/core-win32-ia32-msvc": "1.4.0",
|
||||
"@swc/core-win32-x64-msvc": "1.4.0"
|
||||
"@swc/core-darwin-arm64": "1.4.1",
|
||||
"@swc/core-darwin-x64": "1.4.1",
|
||||
"@swc/core-linux-arm-gnueabihf": "1.4.1",
|
||||
"@swc/core-linux-arm64-gnu": "1.4.1",
|
||||
"@swc/core-linux-arm64-musl": "1.4.1",
|
||||
"@swc/core-linux-x64-gnu": "1.4.1",
|
||||
"@swc/core-linux-x64-musl": "1.4.1",
|
||||
"@swc/core-win32-arm64-msvc": "1.4.1",
|
||||
"@swc/core-win32-ia32-msvc": "1.4.1",
|
||||
"@swc/core-win32-x64-msvc": "1.4.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@swc/helpers": "^0.5.0"
|
||||
|
|
@ -1151,9 +1159,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@swc/core-darwin-arm64": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.4.0.tgz",
|
||||
"integrity": "sha512-UTJ/Vz+s7Pagef6HmufWt6Rs0aUu+EJF4Pzuwvr7JQQ5b1DZeAAUeUtkUTFx/PvCbM8Xfw4XdKBUZfrIKCfW8A==",
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.4.1.tgz",
|
||||
"integrity": "sha512-ePyfx0348UbR4DOAW24TedeJbafnzha8liXFGuQ4bdXtEVXhLfPngprrxKrAddCuv42F9aTxydlF6+adD3FBhA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1167,9 +1175,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@swc/core-darwin-x64": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.4.0.tgz",
|
||||
"integrity": "sha512-f8v58u2GsGak8EtZFN9guXqE0Ep10Suny6xriaW2d8FGqESPyNrnBzli3aqkSeQk5gGqu2zJ7WiiKp3XoUOidA==",
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.4.1.tgz",
|
||||
"integrity": "sha512-eLf4JSe6VkCMdDowjM8XNC5rO+BrgfbluEzAVtKR8L2HacNYukieumN7EzpYCi0uF1BYwu1ku6tLyG2r0VcGxA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1183,9 +1191,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@swc/core-linux-arm-gnueabihf": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.4.0.tgz",
|
||||
"integrity": "sha512-q2KAkBzmPcTnRij/Y1fgHCKAGevUX/H4uUESrw1J5gmUg9Qip6onKV80lTumA1/aooGJ18LOsB31qdbwmZk9OA==",
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.4.1.tgz",
|
||||
"integrity": "sha512-K8VtTLWMw+rkN/jDC9o/Q9SMmzdiHwYo2CfgkwVT29NsGccwmNhCQx6XoYiPKyKGIFKt4tdQnJHKUFzxUqQVtQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
|
|
@ -1199,9 +1207,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@swc/core-linux-arm64-gnu": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.4.0.tgz",
|
||||
"integrity": "sha512-SknGu96W0mzHtLHWm+62fk5+Omp9fMPFO7AWyGFmz2tr8EgRRXtTSrBUnWhAbgcalnhen48GsvtMdxf1KNputg==",
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.4.1.tgz",
|
||||
"integrity": "sha512-0e8p4g0Bfkt8lkiWgcdiENH3RzkcqKtpRXIVNGOmVc0OBkvc2tpm2WTx/eoCnes2HpTT4CTtR3Zljj4knQ4Fvw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1215,9 +1223,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@swc/core-linux-arm64-musl": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.4.0.tgz",
|
||||
"integrity": "sha512-/k3TDvpBRMDNskHooNN1KqwUhcwkfBlIYxRTnJvsfT2C7My4pffR+4KXmt0IKynlTTbCdlU/4jgX4801FSuliw==",
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.4.1.tgz",
|
||||
"integrity": "sha512-b/vWGQo2n7lZVUnSQ7NBq3Qrj85GrAPPiRbpqaIGwOytiFSk8VULFihbEUwDe0rXgY4LDm8z8wkgADZcLnmdUA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1231,9 +1239,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@swc/core-linux-x64-gnu": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.4.0.tgz",
|
||||
"integrity": "sha512-GYsTMvNt5+WTVlwwQzOOWsPMw6P/F41u5PGHWmfev8Nd4QJ1h3rWPySKk4mV42IJwH9MgQCVSl3ygwNqwl6kFg==",
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.4.1.tgz",
|
||||
"integrity": "sha512-AFMQlvkKEdNi1Vk2GFTxxJzbICttBsOQaXa98kFTeWTnFFIyiIj2w7Sk8XRTEJ/AjF8ia8JPKb1zddBWr9+bEQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1247,9 +1255,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@swc/core-linux-x64-musl": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.4.0.tgz",
|
||||
"integrity": "sha512-jGVPdM/VwF7kK/uYRW5N6FwzKf/FnDjGIR3RPvQokjYJy7Auk+3Oj21C0Jev7sIT9RYnO/TrFEoEozKeD/z2Qw==",
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.4.1.tgz",
|
||||
"integrity": "sha512-QX2MxIECX1gfvUVZY+jk528/oFkS9MAl76e3ZRvG2KC/aKlCQL0KSzcTSm13mOxkDKS30EaGRDRQWNukGpMeRg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1263,9 +1271,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@swc/core-win32-arm64-msvc": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.4.0.tgz",
|
||||
"integrity": "sha512-biHYm1AronEKlt47O/H8sSOBM2BKXMmWT+ApvlxUw50m1RGNnVnE0bgY7tylFuuSiWyXsQPJbmUV708JqORXVg==",
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.4.1.tgz",
|
||||
"integrity": "sha512-OklkJYXXI/tntD2zaY8i3iZldpyDw5q+NAP3k9OlQ7wXXf37djRsHLV0NW4+ZNHBjE9xp2RsXJ0jlOJhfgGoFA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1279,9 +1287,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@swc/core-win32-ia32-msvc": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.4.0.tgz",
|
||||
"integrity": "sha512-TL5L2tFQb19kJwv6+elToGBj74QXCn9j+hZfwQatvZEJRA5rDK16eH6oAE751dGUArhnWlW3Vj65hViPvTuycw==",
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.4.1.tgz",
|
||||
"integrity": "sha512-MBuc3/QfKX9FnLOU7iGN+6yHRTQaPQ9WskiC8s8JFiKQ+7I2p25tay2RplR9dIEEGgVAu6L7auv96LbNTh+FaA==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
|
|
@ -1295,9 +1303,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@swc/core-win32-x64-msvc": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.4.0.tgz",
|
||||
"integrity": "sha512-e2xVezU7XZ2Stzn4i7TOQe2Kn84oYdG0M3A7XI7oTdcpsKCcKwgiMoroiAhqCv+iN20KNqhnWwJiUiTj/qN5AA==",
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.4.1.tgz",
|
||||
"integrity": "sha512-lu4h4wFBb/bOK6N2MuZwg7TrEpwYXgpQf5R7ObNSXL65BwZ9BG8XRzD+dLJmALu8l5N08rP/TrpoKRoGT4WSxw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1805,9 +1813,9 @@
|
|||
"integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g=="
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "20.11.16",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.16.tgz",
|
||||
"integrity": "sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==",
|
||||
"version": "20.11.17",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.17.tgz",
|
||||
"integrity": "sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
|
|
@ -2066,6 +2074,15 @@
|
|||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/bcp-47-match": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-1.0.3.tgz",
|
||||
"integrity": "sha512-LggQ4YTdjWQSKELZF5JwchnBa1u0pIQSZf5lSdOHEdbVP55h0qICA/FUp3+W99q0xqxYa1ZQizTUH87gecII5w==",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/binary-extensions": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
|
||||
|
|
@ -2102,9 +2119,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/browserslist": {
|
||||
"version": "4.22.3",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz",
|
||||
"integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==",
|
||||
"version": "4.23.0",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz",
|
||||
"integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
|
|
@ -2120,8 +2137,8 @@
|
|||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"caniuse-lite": "^1.0.30001580",
|
||||
"electron-to-chromium": "^1.4.648",
|
||||
"caniuse-lite": "^1.0.30001587",
|
||||
"electron-to-chromium": "^1.4.668",
|
||||
"node-releases": "^2.0.14",
|
||||
"update-browserslist-db": "^1.0.13"
|
||||
},
|
||||
|
|
@ -2150,9 +2167,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001585",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001585.tgz",
|
||||
"integrity": "sha512-yr2BWR1yLXQ8fMpdS/4ZZXpseBgE7o4g41x3a6AJOqZuOi+iE/WdJYAuZ6Y95i4Ohd2Y+9MzIWRR+uGABH4s3Q==",
|
||||
"version": "1.0.30001587",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001587.tgz",
|
||||
"integrity": "sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
|
|
@ -2375,6 +2392,11 @@
|
|||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/css-selector-parser": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-1.4.1.tgz",
|
||||
"integrity": "sha512-HYPSb7y/Z7BNDCOrakL4raGO2zltZkbeXyAd6Tg9obzix6QhzxCotdBl6VT0Dv4vZfJGVz3WL/xaEI9Ly3ul0g=="
|
||||
},
|
||||
"node_modules/css-to-react-native": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz",
|
||||
|
|
@ -2478,6 +2500,18 @@
|
|||
"integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/direction": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/direction/-/direction-1.0.4.tgz",
|
||||
"integrity": "sha512-GYqKi1aH7PJXxdhTeZBFrg8vUBeKXi+cNprXsC1kpJcbcVnV9wBsrOu1cQEdG0WeQwlfHiy3XvnKfIrJ2R0NzQ==",
|
||||
"bin": {
|
||||
"direction": "cli.js"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/dlv": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz",
|
||||
|
|
@ -2516,9 +2550,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.4.661",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.661.tgz",
|
||||
"integrity": "sha512-AFg4wDHSOk5F+zA8aR+SVIOabu7m0e7BiJnigCvPXzIGy731XENw/lmNxTySpVFtkFEy+eyt4oHhh5FF3NjQNw=="
|
||||
"version": "1.4.669",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.669.tgz",
|
||||
"integrity": "sha512-E2SmpffFPrZhBSgf8ibqanRS2mpuk3FIRDzLDwt7WFpfgJMKDHJs0hmacyP0PS1cWsq0dVkwIIzlscNaterkPg=="
|
||||
},
|
||||
"node_modules/emoji-regex": {
|
||||
"version": "9.2.2",
|
||||
|
|
@ -2850,9 +2884,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz",
|
||||
"integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz",
|
||||
"integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
|
|
@ -3066,6 +3100,15 @@
|
|||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-has-property": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-has-property/-/hast-util-has-property-1.0.4.tgz",
|
||||
"integrity": "sha512-ghHup2voGfgFoHMGnaLHOjbYFACKrRh9KFttdCzMCbFoBMJXiNi2+XTrPP8+q6cDJM/RSqlCfVWrjp1H201rZg==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-is-element": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz",
|
||||
|
|
@ -3087,6 +3130,129 @@
|
|||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-select": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-select/-/hast-util-select-4.0.2.tgz",
|
||||
"integrity": "sha512-8EEG2//bN5rrzboPWD2HdS3ugLijNioS1pqOTIolXNf67xxShYw4SQEmVXd3imiBG+U2bC2nVTySr/iRAA7Cjg==",
|
||||
"dependencies": {
|
||||
"bcp-47-match": "^1.0.0",
|
||||
"comma-separated-tokens": "^1.0.0",
|
||||
"css-selector-parser": "^1.0.0",
|
||||
"direction": "^1.0.0",
|
||||
"hast-util-has-property": "^1.0.0",
|
||||
"hast-util-is-element": "^1.0.0",
|
||||
"hast-util-to-string": "^1.0.0",
|
||||
"hast-util-whitespace": "^1.0.0",
|
||||
"not": "^0.1.0",
|
||||
"nth-check": "^2.0.0",
|
||||
"property-information": "^5.0.0",
|
||||
"space-separated-tokens": "^1.0.0",
|
||||
"unist-util-visit": "^2.0.0",
|
||||
"zwitch": "^1.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-select/node_modules/@types/unist": {
|
||||
"version": "2.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz",
|
||||
"integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA=="
|
||||
},
|
||||
"node_modules/hast-util-select/node_modules/comma-separated-tokens": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz",
|
||||
"integrity": "sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-select/node_modules/hast-util-is-element": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-1.1.0.tgz",
|
||||
"integrity": "sha512-oUmNua0bFbdrD/ELDSSEadRVtWZOf3iF6Lbv81naqsIV99RnSCieTbWuWCY8BAeEfKJTKl0gRdokv+dELutHGQ==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-select/node_modules/hast-util-whitespace": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-1.0.4.tgz",
|
||||
"integrity": "sha512-I5GTdSfhYfAPNztx2xJRQpG8cuDSNt599/7YUn7Gx/WxNMsG+a835k97TDkFgk123cwjfwINaZknkKkphx/f2A==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-select/node_modules/property-information": {
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz",
|
||||
"integrity": "sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==",
|
||||
"dependencies": {
|
||||
"xtend": "^4.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-select/node_modules/space-separated-tokens": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz",
|
||||
"integrity": "sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-select/node_modules/unist-util-is": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz",
|
||||
"integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-select/node_modules/unist-util-visit": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz",
|
||||
"integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==",
|
||||
"dependencies": {
|
||||
"@types/unist": "^2.0.0",
|
||||
"unist-util-is": "^4.0.0",
|
||||
"unist-util-visit-parents": "^3.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-select/node_modules/unist-util-visit-parents": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz",
|
||||
"integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==",
|
||||
"dependencies": {
|
||||
"@types/unist": "^2.0.0",
|
||||
"unist-util-is": "^4.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-select/node_modules/zwitch": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz",
|
||||
"integrity": "sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-to-jsx-runtime": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.0.tgz",
|
||||
|
|
@ -3113,6 +3279,15 @@
|
|||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-to-string": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-1.0.4.tgz",
|
||||
"integrity": "sha512-eK0MxRX47AV2eZ+Lyr18DCpQgodvaS3fAQO2+b9Two9F5HEoRPhiUMNzoXArMJfZi2yieFzUBMRl3HNJ3Jus3w==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-to-text": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-4.0.0.tgz",
|
||||
|
|
@ -3698,9 +3873,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/mdast-util-mdx-jsx": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.0.0.tgz",
|
||||
"integrity": "sha512-XZuPPzQNBPAlaqsTTgRrcJnyFbSOBovSadFgbFu8SnuNgm+6Bdx1K+IWoitsmj6Lq6MNtI+ytOqwN70n//NaBA==",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.1.0.tgz",
|
||||
"integrity": "sha512-A8AJHlR7/wPQ3+Jre1+1rq040fX9A4Q1jG8JxmSNp/PLPHg80A6475wxTp3KzHpApFH6yWxFotHrJQA3dXP6/w==",
|
||||
"dependencies": {
|
||||
"@types/estree-jsx": "^1.0.0",
|
||||
"@types/hast": "^3.0.0",
|
||||
|
|
@ -4319,9 +4494,9 @@
|
|||
"integrity": "sha512-ihFnidEeU8iXzcVHy74dhkxh/dn8Dc08ERl0xwoMMGqp4+LvRSCgicb+zGqWthVokQKvCSxITlh3P08OzdTYCQ=="
|
||||
},
|
||||
"node_modules/monaco-editor": {
|
||||
"version": "0.45.0",
|
||||
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.45.0.tgz",
|
||||
"integrity": "sha512-mjv1G1ZzfEE3k9HZN0dQ2olMdwIfaeAAjFiwNprLfYNRSz7ctv9XuCT7gPtBGrMUeV1/iZzYKj17Khu1hxoHOA==",
|
||||
"version": "0.46.0",
|
||||
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.46.0.tgz",
|
||||
"integrity": "sha512-ADwtLIIww+9FKybWscd7OCfm9odsFYHImBRI1v9AviGce55QY8raT+9ihH8jX/E/e6QVSGM+pKj4jSUSRmALNQ==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/ms": {
|
||||
|
|
@ -4658,12 +4833,15 @@
|
|||
}
|
||||
},
|
||||
"node_modules/postcss-load-config/node_modules/lilconfig": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz",
|
||||
"integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.0.tgz",
|
||||
"integrity": "sha512-p3cz0JV5vw/XeouBU3Ldnp+ZkBjE+n8ydJ4mcwBrOiXXPqNlrzGBqWs9X4MWF7f+iKUBu794Y8Hh8yawiJbCjw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/antonk52"
|
||||
}
|
||||
},
|
||||
"node_modules/postcss-nested": {
|
||||
|
|
@ -4704,18 +4882,18 @@
|
|||
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="
|
||||
},
|
||||
"node_modules/posthog-js": {
|
||||
"version": "1.105.4",
|
||||
"resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.105.4.tgz",
|
||||
"integrity": "sha512-hazxQYi4nxSqktu0Hh1xCV+sJCpN8mp5E5Ei/cfEa2nsb13xQbzn81Lf3VIDA0xMU1mXxNRStntlY267eQVC/w==",
|
||||
"version": "1.105.9",
|
||||
"resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.105.9.tgz",
|
||||
"integrity": "sha512-i9DnfyXDktugF5E9x0ejihQ8Xdh1kdVnVh7GdL7+PvFtULGMoN/b4pDmWBCwmH+ciubmqTCImVuNrZYy8+eTbw==",
|
||||
"dependencies": {
|
||||
"fflate": "^0.4.8",
|
||||
"preact": "^10.19.3"
|
||||
}
|
||||
},
|
||||
"node_modules/preact": {
|
||||
"version": "10.19.3",
|
||||
"resolved": "https://registry.npmjs.org/preact/-/preact-10.19.3.tgz",
|
||||
"integrity": "sha512-nHHTeFVBTHRGxJXKkKu5hT8C/YWBkPso4/Gad6xuj5dbptt9iF9NZr9pHbPhBrnT2klheu7mHTxTZ/LjwJiEiQ==",
|
||||
"version": "10.19.4",
|
||||
"resolved": "https://registry.npmjs.org/preact/-/preact-10.19.4.tgz",
|
||||
"integrity": "sha512-dwaX5jAh0Ga8uENBX1hSOujmKWgx9RtL80KaKUFLc6jb4vCEAc3EeZ0rnQO/FO4VgjfPMfoLFWnNG8bHuZ9VLw==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/preact"
|
||||
|
|
@ -5471,11 +5649,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/react-tooltip": {
|
||||
"version": "5.26.0",
|
||||
"resolved": "https://registry.npmjs.org/react-tooltip/-/react-tooltip-5.26.0.tgz",
|
||||
"integrity": "sha512-UBbwy3fo1KYDwRCOWwM6AEfQsk9shgVfNkXFqgwS33QHplzg7xao/7mX/6wd+lE6KSZzhUNTkB5TNk9SMaBV/A==",
|
||||
"version": "5.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-tooltip/-/react-tooltip-5.26.2.tgz",
|
||||
"integrity": "sha512-C1qHiqWYn6l5c98kL/NKFyJSw5G11vUVJkgOPcKgn306c5iL5317LxMNn5Qg1GSSM7Qvtsd6KA5MvwfgxFF7Dg==",
|
||||
"dependencies": {
|
||||
"@floating-ui/dom": "^1.0.0",
|
||||
"@floating-ui/dom": "^1.6.1",
|
||||
"classnames": "^2.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
@ -5738,123 +5916,6 @@
|
|||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz",
|
||||
"integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA=="
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/bcp-47-match": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-1.0.3.tgz",
|
||||
"integrity": "sha512-LggQ4YTdjWQSKELZF5JwchnBa1u0pIQSZf5lSdOHEdbVP55h0qICA/FUp3+W99q0xqxYa1ZQizTUH87gecII5w==",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/comma-separated-tokens": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz",
|
||||
"integrity": "sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/css-selector-parser": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-1.4.1.tgz",
|
||||
"integrity": "sha512-HYPSb7y/Z7BNDCOrakL4raGO2zltZkbeXyAd6Tg9obzix6QhzxCotdBl6VT0Dv4vZfJGVz3WL/xaEI9Ly3ul0g=="
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/direction": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/direction/-/direction-1.0.4.tgz",
|
||||
"integrity": "sha512-GYqKi1aH7PJXxdhTeZBFrg8vUBeKXi+cNprXsC1kpJcbcVnV9wBsrOu1cQEdG0WeQwlfHiy3XvnKfIrJ2R0NzQ==",
|
||||
"bin": {
|
||||
"direction": "cli.js"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/hast-util-has-property": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-has-property/-/hast-util-has-property-1.0.4.tgz",
|
||||
"integrity": "sha512-ghHup2voGfgFoHMGnaLHOjbYFACKrRh9KFttdCzMCbFoBMJXiNi2+XTrPP8+q6cDJM/RSqlCfVWrjp1H201rZg==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/hast-util-is-element": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-1.1.0.tgz",
|
||||
"integrity": "sha512-oUmNua0bFbdrD/ELDSSEadRVtWZOf3iF6Lbv81naqsIV99RnSCieTbWuWCY8BAeEfKJTKl0gRdokv+dELutHGQ==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/hast-util-select": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-select/-/hast-util-select-4.0.2.tgz",
|
||||
"integrity": "sha512-8EEG2//bN5rrzboPWD2HdS3ugLijNioS1pqOTIolXNf67xxShYw4SQEmVXd3imiBG+U2bC2nVTySr/iRAA7Cjg==",
|
||||
"dependencies": {
|
||||
"bcp-47-match": "^1.0.0",
|
||||
"comma-separated-tokens": "^1.0.0",
|
||||
"css-selector-parser": "^1.0.0",
|
||||
"direction": "^1.0.0",
|
||||
"hast-util-has-property": "^1.0.0",
|
||||
"hast-util-is-element": "^1.0.0",
|
||||
"hast-util-to-string": "^1.0.0",
|
||||
"hast-util-whitespace": "^1.0.0",
|
||||
"not": "^0.1.0",
|
||||
"nth-check": "^2.0.0",
|
||||
"property-information": "^5.0.0",
|
||||
"space-separated-tokens": "^1.0.0",
|
||||
"unist-util-visit": "^2.0.0",
|
||||
"zwitch": "^1.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/hast-util-to-string": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-1.0.4.tgz",
|
||||
"integrity": "sha512-eK0MxRX47AV2eZ+Lyr18DCpQgodvaS3fAQO2+b9Two9F5HEoRPhiUMNzoXArMJfZi2yieFzUBMRl3HNJ3Jus3w==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/hast-util-whitespace": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-1.0.4.tgz",
|
||||
"integrity": "sha512-I5GTdSfhYfAPNztx2xJRQpG8cuDSNt599/7YUn7Gx/WxNMsG+a835k97TDkFgk123cwjfwINaZknkKkphx/f2A==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/property-information": {
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz",
|
||||
"integrity": "sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==",
|
||||
"dependencies": {
|
||||
"xtend": "^4.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/space-separated-tokens": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz",
|
||||
"integrity": "sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/unist-util-is": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz",
|
||||
|
|
@ -5891,15 +5952,6 @@
|
|||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-wrap-all/node_modules/zwitch": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz",
|
||||
"integrity": "sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/remark-math": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/remark-math/-/remark-math-6.0.0.tgz",
|
||||
|
|
|
|||
BIN
gui/public/logos/deepseek.png
Normal file
BIN
gui/public/logos/deepseek.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
|
|
@ -1,6 +1,6 @@
|
|||
import { InformationCircleIcon } from "@heroicons/react/24/outline";
|
||||
import { StyledTooltip } from ".";
|
||||
import ReactDOM from "react-dom";
|
||||
import { StyledTooltip } from ".";
|
||||
|
||||
const InfoHover = ({ msg }: { msg: string }) => {
|
||||
const id = `info-hover-${encodeURIComponent(msg)}`;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import {
|
|||
Cog6ToothIcon,
|
||||
QuestionMarkCircleIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { postToIde } from "core/ide/messaging";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { Outlet, useLocation, useNavigate } from "react-router-dom";
|
||||
|
|
@ -13,14 +12,16 @@ import {
|
|||
vscForeground,
|
||||
vscInputBackground,
|
||||
} from ".";
|
||||
import { useWebviewListener } from "../hooks/useWebviewListener";
|
||||
import { defaultModelSelector } from "../redux/selectors/modelSelectors";
|
||||
import {
|
||||
setBottomMessage,
|
||||
setBottomMessageCloseTimeout,
|
||||
setShowDialog,
|
||||
} from "../redux/slices/uiStateSlice";
|
||||
import { RootStore } from "../redux/store";
|
||||
import { RootState } from "../redux/store";
|
||||
import { getFontSize, isMetaEquivalentKeyPressed } from "../util";
|
||||
import { postToIde } from "../util/ide";
|
||||
import HeaderButtonWithText from "./HeaderButtonWithText";
|
||||
import TextDialog from "./dialogs";
|
||||
import IndexingProgressBar from "./loaders/IndexingProgressBar";
|
||||
|
|
@ -106,23 +107,23 @@ const Layout = () => {
|
|||
const location = useLocation();
|
||||
const dispatch = useDispatch();
|
||||
const dialogMessage = useSelector(
|
||||
(state: RootStore) => state.uiState.dialogMessage
|
||||
(state: RootState) => state.uiState.dialogMessage
|
||||
);
|
||||
const showDialog = useSelector(
|
||||
(state: RootStore) => state.uiState.showDialog
|
||||
(state: RootState) => state.uiState.showDialog
|
||||
);
|
||||
|
||||
const defaultModel = useSelector(defaultModelSelector);
|
||||
// #region Selectors
|
||||
|
||||
const bottomMessage = useSelector(
|
||||
(state: RootStore) => state.uiState.bottomMessage
|
||||
(state: RootState) => state.uiState.bottomMessage
|
||||
);
|
||||
const displayBottomMessageOnBottom = useSelector(
|
||||
(state: RootStore) => state.uiState.displayBottomMessageOnBottom
|
||||
(state: RootState) => state.uiState.displayBottomMessageOnBottom
|
||||
);
|
||||
|
||||
const timeline = useSelector((state: RootStore) => state.state.history);
|
||||
const timeline = useSelector((state: RootState) => state.state.history);
|
||||
|
||||
// #endregion
|
||||
|
||||
|
|
@ -146,30 +147,35 @@ const Layout = () => {
|
|||
};
|
||||
}, [timeline]);
|
||||
|
||||
useEffect(() => {
|
||||
const handler = (event: any) => {
|
||||
if (event.data.type === "addModel") {
|
||||
navigate("/models");
|
||||
} else if (event.data.type === "openSettings") {
|
||||
// navigate("/settings");
|
||||
postToIde("openConfigJson", {});
|
||||
} else if (event.data.type === "viewHistory") {
|
||||
// Toggle the history page / main page
|
||||
if (location.pathname === "/history") {
|
||||
navigate("/");
|
||||
} else {
|
||||
navigate("/history");
|
||||
}
|
||||
} else if (event.data.type === "indexProgress") {
|
||||
setIndexingProgress(event.data.progress);
|
||||
setIndexingTask(event.data.desc);
|
||||
useWebviewListener(
|
||||
"addModel",
|
||||
async () => {
|
||||
navigate("/models");
|
||||
},
|
||||
[navigate]
|
||||
);
|
||||
|
||||
useWebviewListener("openSettings", async () => {
|
||||
postToIde("openConfigJson", undefined);
|
||||
});
|
||||
|
||||
useWebviewListener(
|
||||
"viewHistory",
|
||||
async () => {
|
||||
// Toggle the history page / main page
|
||||
if (location.pathname === "/history") {
|
||||
navigate("/");
|
||||
} else {
|
||||
navigate("/history");
|
||||
}
|
||||
};
|
||||
window.addEventListener("message", handler);
|
||||
return () => {
|
||||
window.removeEventListener("message", handler);
|
||||
};
|
||||
}, [location, navigate]);
|
||||
},
|
||||
[location, navigate]
|
||||
);
|
||||
|
||||
useWebviewListener("indexProgress", async (data) => {
|
||||
setIndexingProgress(data.progress);
|
||||
setIndexingTask(data.desc);
|
||||
});
|
||||
|
||||
const [indexingProgress, setIndexingProgress] = useState(1);
|
||||
const [indexingTask, setIndexingTask] = useState("Indexing Codebase");
|
||||
|
|
@ -259,7 +265,7 @@ const Layout = () => {
|
|||
<HeaderButtonWithText
|
||||
onClick={() => {
|
||||
// navigate("/settings");
|
||||
postToIde("openConfigJson", {});
|
||||
postToIde("openConfigJson", undefined);
|
||||
}}
|
||||
text="Config"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import { postToIde } from "core/ide/messaging";
|
||||
import { usePostHog } from "posthog-js/react";
|
||||
import React, { useContext, useLayoutEffect } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
|
|
@ -6,6 +5,7 @@ import styled from "styled-components";
|
|||
import { Button, Input } from "..";
|
||||
import { SubmenuContextProvidersContext } from "../../App";
|
||||
import { setShowDialog } from "../../redux/slices/uiStateSlice";
|
||||
import { postToIde } from "../../util/ide";
|
||||
|
||||
const GridDiv = styled.div`
|
||||
display: grid;
|
||||
|
|
@ -58,7 +58,7 @@ function AddDocsDialog() {
|
|||
disabled={!docsUrl || !urlValid}
|
||||
className="ml-auto"
|
||||
onClick={() => {
|
||||
postToIde("addDocs", { url: docsUrl, title: docsTitle });
|
||||
postToIde("context/addDocs", { url: docsUrl, title: docsTitle });
|
||||
setDocsTitle("");
|
||||
setDocsUrl("");
|
||||
dispatch(setShowDialog(false));
|
||||
|
|
|
|||
54
gui/src/components/dialogs/ConfirmationDialog.tsx
Normal file
54
gui/src/components/dialogs/ConfirmationDialog.tsx
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import { useDispatch } from "react-redux";
|
||||
import styled from "styled-components";
|
||||
import { Button } from "..";
|
||||
import {
|
||||
setDialogMessage,
|
||||
setShowDialog,
|
||||
} from "../../redux/slices/uiStateSlice";
|
||||
|
||||
const GridDiv = styled.div`
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-gap: 8px;
|
||||
align-items: center;
|
||||
`;
|
||||
|
||||
interface ConfirmationDialogProps {
|
||||
onConfirm: () => void;
|
||||
onCancel?: () => void;
|
||||
text: string;
|
||||
}
|
||||
|
||||
function ConfirmationDialog(props: ConfirmationDialogProps) {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
return (
|
||||
<div className="p-4">
|
||||
<h3>Confirmation</h3>
|
||||
<p>{props.text}</p>
|
||||
|
||||
<GridDiv>
|
||||
<Button
|
||||
onClick={() => {
|
||||
props.onCancel?.();
|
||||
dispatch(setShowDialog(false));
|
||||
dispatch(setDialogMessage(undefined));
|
||||
}}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
props.onConfirm();
|
||||
dispatch(setShowDialog(false));
|
||||
dispatch(setDialogMessage(undefined));
|
||||
}}
|
||||
>
|
||||
Confirm
|
||||
</Button>
|
||||
</GridDiv>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ConfirmationDialog;
|
||||
|
|
@ -5,7 +5,7 @@ import styled from "styled-components";
|
|||
import { Button, Input } from "..";
|
||||
import { setDefaultModel } from "../../redux/slices/stateSlice";
|
||||
import { setShowDialog } from "../../redux/slices/uiStateSlice";
|
||||
import { addOpenAIKey } from "../../util/ide";
|
||||
import { postToIde } from "../../util/ide";
|
||||
|
||||
const GridDiv = styled.div`
|
||||
display: grid;
|
||||
|
|
@ -55,7 +55,7 @@ function FTCDialog() {
|
|||
<Button
|
||||
disabled={!apiKey}
|
||||
onClick={() => {
|
||||
addOpenAIKey(apiKey);
|
||||
postToIde("config/addOpenAiKey", apiKey);
|
||||
dispatch(setShowDialog(false));
|
||||
dispatch(setDefaultModel("GPT-4"));
|
||||
}}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue