Merge branch 'preview' into nate/merge-preview-to-atwood-p2

This commit is contained in:
Nate Sesti 2024-02-19 15:17:45 -08:00
commit b43a63b6a4
70 changed files with 842 additions and 552 deletions

View file

@ -81,11 +81,16 @@ export async function constructAutocompletePrompt(
// Find external snippets
const snippets: AutocompleteSnippet[] = [];
const treePath = await getTreePathAtCursor(
filepath,
fullPrefix + fullSuffix,
fullPrefix.length
);
let treePath;
try {
treePath = await getTreePathAtCursor(
filepath,
fullPrefix + fullSuffix,
fullPrefix.length
);
} catch (e) {
console.error("Failed to parse AST", e);
}
// Get function def when inside call expression
if (treePath) {

View file

@ -1,4 +1,5 @@
import { distance } from "fastest-levenshtein";
import { DiffLine } from "..";
import { LineStream } from "../diff/util";
export async function* streamWithNewLines(stream: LineStream): LineStream {
@ -37,3 +38,163 @@ export async function* stopAtSimilarLine(
yield nextLine;
}
}
function shouldRemoveLineBeforeStart(line: string): boolean {
return (
line.trimStart().startsWith("```") ||
line.trim() === "[CODE]" ||
line.trim() === ""
);
}
function shouldChangeLineAndStop(line: string): string | undefined {
if (line.trimStart() === "```") {
return line;
}
if (line.includes("[/CODE]")) {
return line.split("[/CODE]")[0].trimEnd();
}
return undefined;
}
export async function* filterCodeBlockLines(rawLines: LineStream): LineStream {
let seenValidLine = false;
let waitingToSeeIfLineIsLast = undefined;
for await (const line of rawLines) {
// Filter out starting ```
if (!seenValidLine) {
if (shouldRemoveLineBeforeStart(line)) {
continue;
} else {
seenValidLine = true;
}
}
// Filter out ending ```
if (typeof waitingToSeeIfLineIsLast !== "undefined") {
yield waitingToSeeIfLineIsLast;
waitingToSeeIfLineIsLast = undefined;
}
const changedEndLine = shouldChangeLineAndStop(line);
if (typeof changedEndLine === "string") {
yield changedEndLine;
return;
}
if (line === "```") {
waitingToSeeIfLineIsLast = line;
} else {
yield line;
}
}
}
function isEnglishFirstLine(line: string) {
line = line.trim().toLowerCase();
if (line.endsWith(":") && !line.trimStart().startsWith("def")) {
return true;
}
if (
line.startsWith("here is") ||
line.startsWith("sure, here") ||
line.startsWith("sure thing") ||
line.startsWith("sure!")
) {
return true;
}
return false;
}
export async function* filterEnglishLinesAtStart(lines: LineStream) {
let i = 0;
let wasEnglishFirstLine = false;
for await (let line of lines) {
if (i === 0) {
if (isEnglishFirstLine(line)) {
wasEnglishFirstLine = true;
i++;
continue;
}
} else if (i === 1 && wasEnglishFirstLine && line.trim() === "") {
i++;
continue;
}
i++;
yield line;
}
}
function isEnglishPostExplanation(line: string): boolean {
const lower = line.toLowerCase();
return (
lower.startsWith("explanation:") ||
lower.startsWith("here is") ||
lower.startsWith("here's how") ||
lower.startsWith("the above")
);
}
export async function* filterEnglishLinesAtEnd(lines: LineStream) {
let finishedCodeBlock = false;
for await (let line of lines) {
if (line.trim() === "```") {
finishedCodeBlock = true;
}
if (finishedCodeBlock && isEnglishPostExplanation(line)) {
break;
}
yield line;
}
}
export async function* fixCodeLlamaFirstLineIndentation(lines: LineStream) {
let isFirstLine = true;
for await (let line of lines) {
if (isFirstLine && line.startsWith(" ")) {
yield line.slice(2);
isFirstLine = false;
} else {
yield line;
}
}
}
function isUselessLine(line: string): boolean {
const trimmed = line.trim().toLowerCase();
return trimmed === "" || trimmed === "```" || trimmed.startsWith("// end");
}
export async function* filterLeadingAndTrailingNewLineInsertion(
diffLines: AsyncGenerator<DiffLine>
): AsyncGenerator<DiffLine> {
let isFirst = true;
let buffer: DiffLine[] = [];
for await (let diffLine of diffLines) {
let isBlankLineInsertion =
diffLine.type === "new" && isUselessLine(diffLine.line);
if (isFirst && isBlankLineInsertion) {
isFirst = false;
continue;
}
isFirst = false;
if (isBlankLineInsertion) {
buffer.push(diffLine);
} else {
if (diffLine.type === "old") {
buffer = [];
} else {
while (buffer.length > 0) {
yield buffer.shift()!;
}
}
yield diffLine;
}
}
}

View file

@ -17,7 +17,7 @@ const stableCodeFimTemplate: AutocompleteTemplate = {
const codeLlamaFimTemplate: AutocompleteTemplate = {
template: "<PRE> {{{prefix}}} <SUF>{{{suffix}}} <MID>",
completionOptions: { stop: ["<PRE>", "<SUF>", "<MID>"] },
completionOptions: { stop: ["<PRE>", "<SUF>", "<MID>", "<EOT>"] },
};
// https://huggingface.co/deepseek-ai/deepseek-coder-1.3b-base
@ -49,6 +49,7 @@ export function getTemplateForModel(model: string): AutocompleteTemplate {
if (
lowerCaseModel.includes("starcoder") ||
lowerCaseModel.includes("star-coder") ||
lowerCaseModel.includes("starchat") ||
lowerCaseModel.includes("stable")
) {
return stableCodeFimTemplate;

View file

@ -1,4 +1,12 @@
import { ContextItemWithId, ILLM, SlashCommand } from "../..";
import {
filterCodeBlockLines,
filterEnglishLinesAtEnd,
filterEnglishLinesAtStart,
fixCodeLlamaFirstLineIndentation,
streamWithNewLines,
} from "../../autocomplete/lineStream";
import { streamLines } from "../../diff/util";
import { stripImages } from "../../llm/countTokens";
import { dedentAndGetCommonWhitespace, renderPromptTemplate } from "../../util";
import {
@ -221,6 +229,15 @@ const EditSlashCommand: SlashCommand = {
return;
}
// Strip unecessary parts of the input (the fact that you have to do this is suboptimal, should be refactored away)
input = input.replace(
`\`\`\`${contextItemToEdit.name}\n${contextItemToEdit.content}\n\`\`\`\n`,
""
);
if (input.startsWith("/edit")) {
input = input.replace("/edit", "").trimStart();
}
const rif: RangeInFileWithContents =
contextItemToRangeInFileWithContents(contextItemToEdit);
@ -240,18 +257,17 @@ const EditSlashCommand: SlashCommand = {
let prompt = compilePrompt(filePrefix, contents, fileSuffix, input);
let fullFileContentsLines = fullFileContents.split("\n");
let fullPrefixLines = fullFileContentsLines.slice(
0,
Math.max(0, rif.range.start.line - 1)
);
let fullSuffixLines = fullFileContentsLines.slice(rif.range.end.line);
let linesToDisplay: string[] = [];
async function sendDiffUpdate(lines: string[], final: boolean = false) {
let completion = lines.join("\n");
let fullPrefixLines = fullFileContentsLines.slice(
0,
rif.range.start.line
);
let fullSuffixLines = fullFileContentsLines.slice(rif.range.end.line);
// Don't do this at the very end, just show the inserted code
if (final) {
linesToDisplay = [];
@ -449,10 +465,19 @@ const EditSlashCommand: SlashCommand = {
messages = rendered;
}
generator = llm.streamComplete(rendered as string, {
const completion = llm.streamComplete(rendered as string, {
maxTokens: Math.min(maxTokens, Math.floor(llm.contextLength / 2), 4096),
raw: true,
});
let lineStream = streamLines(completion);
lineStream = filterEnglishLinesAtStart(lineStream);
lineStream = filterEnglishLinesAtEnd(filterCodeBlockLines(lineStream));
generator = streamWithNewLines(
fixCodeLlamaFirstLineIndentation(lineStream)
);
} else {
async function* gen() {
for await (let chunk of llm.streamChat(messages, {
@ -470,7 +495,6 @@ const EditSlashCommand: SlashCommand = {
generator = gen();
}
let lastTaskTime = Date.now();
for await (let chunk of generator) {
// Stop early if it is repeating the fileSuffix or the step was deleted
if (repeatingFileSuffix) {
@ -508,7 +532,7 @@ const EditSlashCommand: SlashCommand = {
else if (
(linesOfPrefixCopied > 0 || completionLinesCovered === 0) &&
linesOfPrefixCopied < filePrefix.split("\n").length &&
chunkLines[i] === fullFileContentsLines[linesOfPrefixCopied]
chunkLines[i] === fullPrefixLines[linesOfPrefixCopied]
) {
// This is a sketchy way of stopping it from repeating the filePrefix. Is a bug if output happens to have a matching line
linesOfPrefixCopied += 1;
@ -533,17 +557,13 @@ const EditSlashCommand: SlashCommand = {
currentLineInFile += 1;
}
// Debounce the diff updates, last in only out for each period
if (lastTaskTime === null || Date.now() - lastTaskTime > 150) {
lastTaskTime = Date.now();
await sendDiffUpdate(
lines.concat([
unfinishedLine?.startsWith("<")
? commonWhitespace
: commonWhitespace + unfinishedLine,
])
);
}
await sendDiffUpdate(
lines.concat([
unfinishedLine?.startsWith("<")
? commonWhitespace
: commonWhitespace + unfinishedLine,
])
);
}
// Add the unfinished line

View file

@ -421,7 +421,7 @@ declare global {
| "gpt-4"
| "gpt-3.5-turbo-0613"
| "gpt-4-32k"
| "gpt-4-1106-preview"
| "gpt-4-turbo-preview"
// Open Source
| "mistral-7b"
| "mistral-8x7b"

View file

@ -6,7 +6,10 @@ import {
} from "../..";
import { getBasename } from "../../util";
import { getSourceSetHighlights } from "llm-code-highlighter/dist/index.continue";
import { getHighlightsThatFit, ILLMContextSizer } from "llm-code-highlighter/dist/index.continue";
import { countTokens } from "../../llm/countTokens";
const HIGHLIGHTS_TOKEN_BUDGET = 2000;
class CodeHighlightsContextProvider extends BaseContextProvider {
static description: ContextProviderDescription = {
@ -32,9 +35,13 @@ class CodeHighlightsContextProvider extends BaseContextProvider {
};
})
);
const topPercentile = 0.5;
const repoMap = await getSourceSetHighlights(
topPercentile,
const contextSizer = {
fits(content: string): boolean {
return countTokens(content, "") < HIGHLIGHTS_TOKEN_BUDGET;
}
} as ILLMContextSizer
const repoMap = await getHighlightsThatFit(
contextSizer,
[],
allFiles
.filter((file) => file.content.length > 0)

View file

@ -10,8 +10,8 @@ import { getFileOutlineHighlights } from "llm-code-highlighter/dist/index.contin
class CodeOutlineContextProvider extends BaseContextProvider {
static description: ContextProviderDescription = {
title: "outlines",
displayTitle: "Outlines",
title: "outline",
displayTitle: "Outline",
description: "Definition lines only (from open files)",
type: "normal",
};

View file

@ -12,6 +12,7 @@ class CodebaseContextProvider extends BaseContextProvider {
displayTitle: "Codebase",
description: "Automatically find relevant files",
type: "normal",
renderInlineAs: "",
};
async getContextItems(

View file

@ -19,6 +19,7 @@ class CustomContextProviderClass implements IContextProvider {
displayTitle: this.custom.displayTitle || this.custom.title,
description: this.custom.description || "",
type: this.custom.type || "normal",
renderInlineAs: this.custom.renderInlineAs,
};
}

View file

@ -66,11 +66,9 @@ export async function* streamLines(
buffer = lines.pop() ?? "";
for (const line of lines) {
yield line;
console.log(line);
}
}
if (buffer.length > 0) {
yield buffer;
console.log(buffer);
}
}

37
core/index.d.ts vendored
View file

@ -1,3 +1,22 @@
declare global {
interface Window {
ide?: "vscode";
windowId: string;
serverUrl: string;
vscMachineId: string;
vscMediaUrl: string;
fullColorTheme?: {
rules?: {
token?: string;
foreground?: string;
}[];
};
colorThemeName?: string;
workspacePaths?: string[];
postIntellijMessage?: (type: string, data: any) => void;
}
}
export interface ChunkWithoutID {
content: string;
startLine: number;
@ -76,6 +95,7 @@ export interface ContextProviderDescription {
title: string;
displayTitle: string;
description: string;
renderInlineAs?: string;
type: ContextProviderType;
}
@ -95,6 +115,7 @@ export interface CustomContextProvider {
title: string;
displayTitle?: string;
description?: string;
renderInlineAs?: string;
type?: ContextProviderType;
getContextItems(
query: string,
@ -430,7 +451,7 @@ export type ModelName =
| "gpt-4"
| "gpt-3.5-turbo-0613"
| "gpt-4-32k"
| "gpt-4-0125-preview"
| "gpt-4-turbo-preview"
| "gpt-4-vision-preview"
// Open Source
| "mistral-7b"
@ -473,6 +494,7 @@ export interface RequestOptions {
caBundlePath?: string | string[];
proxy?: string;
headers?: { [key: string]: string };
extraBodyProperties?: { [key: string]: any };
}
export interface StepWithParams {
@ -619,3 +641,16 @@ export interface ContinueConfig {
tabAutocompleteModel?: ILLM;
tabAutocompleteOptions?: Partial<TabAutocompleteOptions>;
}
interface BrowserSerializedContinueConfig {
allowAnonymousTelemetry?: boolean;
models: ModelDescription[];
systemMessage?: string;
completionOptions?: BaseCompletionOptions;
slashCommands?: SlashCommandDescription[];
contextProviders?: ContextProviderDescription[];
disableIndexing?: boolean;
disableSessionTitles?: boolean;
userToken?: string;
embeddingsProvider?: string;
}

View file

@ -1,6 +1,5 @@
// NOTE: vectordb requirement must be listed in extensions/vscode to avoid error
import { v4 as uuidv4 } from "uuid";
import * as lancedb from "vectordb";
import { Chunk, EmbeddingsProvider, IndexingProgressUpdate } from "..";
import { MAX_CHUNK_SIZE } from "../llm/constants";
import { getBasename } from "../util";
@ -134,6 +133,7 @@ export class LanceDbIndex implements CodebaseIndex {
resultType: IndexResultType
) => void
): AsyncGenerator<IndexingProgressUpdate> {
const lancedb = await import("vectordb");
const tableName = this.tableNameForTag(tag);
const db = await lancedb.connect(getLanceDbPath());
@ -141,7 +141,7 @@ export class LanceDbIndex implements CodebaseIndex {
await this.createSqliteCacheTable(sqlite);
// Compute
let table: lancedb.Table | undefined = undefined;
let table = undefined;
let needToCreateTable = true;
const existingTables = await db.tableNames();
let computedRows: LanceDbRow[] = [];
@ -243,7 +243,7 @@ export class LanceDbIndex implements CodebaseIndex {
n: number,
directory: string | undefined,
vector: number[],
db: lancedb.Connection
db: any /// lancedb.Connection
): Promise<LanceDbRow[]> {
const tableName = this.tableNameForTag(tag);
const tableNames = await db.tableNames();
@ -269,6 +269,10 @@ export class LanceDbIndex implements CodebaseIndex {
n: number,
directory: string | undefined
): Promise<Chunk[]> {
const lancedb = await import("vectordb");
if (!lancedb.connect) {
throw new Error("LanceDB failed to load a native module");
}
const [vector] = await this.embeddingsProvider.embed([text]);
const db = await lancedb.connect(getLanceDbPath());

View file

@ -7,7 +7,6 @@ const IGNORE_PATHS_ENDING_IN = [
"favicon.ico",
"robots.txt",
".rst.txt",
"index.html", // So as not to duplicate with "/"
// ReadTheDocs
"genindex",
"py-modindex",

View file

@ -1,6 +1,5 @@
import { Database, open } from "sqlite";
import sqlite3 from "sqlite3";
import * as lancedb from "vectordb";
import { Chunk } from "../..";
import { getDocsSqlitePath, getLanceDbPath } from "../../util/paths";
@ -31,6 +30,7 @@ export async function retrieveDocs(
vector: number[],
nRetrieve: number
): Promise<Chunk[]> {
const lancedb = await import("vectordb");
const lance = await lancedb.connect(getLanceDbPath());
const table = await lance.openTable(DOCS_TABLE_NAME);
const docs: LanceDbDocsRow[] = await table
@ -68,6 +68,7 @@ export async function addDocs(
vector: embeddings[i],
}));
const lancedb = await import("vectordb");
const lance = await lancedb.connect(getLanceDbPath());
const tableNames = await lance.tableNames();
if (!tableNames.includes(DOCS_TABLE_NAME)) {

View file

@ -16,9 +16,10 @@ const CONTEXT_LENGTH_FOR_MODEL: { [name: string]: number } = {
"gpt-35-turbo-0613": 4096,
"gpt-35-turbo": 4096,
"gpt-4-32k": 32_768,
"gpt-4-1106-preview": 128_000,
"gpt-4-turbo-preview": 128_000,
"gpt-4-vision": 128_000,
"gpt-4-0125-preview": 128_000,
"gpt-4-1106-preview": 128_000,
};
const TOKEN_BUFFER_FOR_SAFETY = 350;

View file

@ -197,6 +197,11 @@ ${prompt}`;
provider: this.providerName,
tokens: tokens,
});
Telemetry.capture("tokensGenerated", {
model: model,
provider: this.providerName,
tokens: tokens,
});
}
_fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> =
@ -434,6 +439,6 @@ ${prompt}`;
if (typeof window === "undefined") {
return true;
}
return (window as any)?.ide !== "vscode";
return window?.ide !== "vscode";
}
}

View file

@ -14,6 +14,7 @@ class GooglePalm extends BaseLLM {
static defaultOptions: Partial<LLMOptions> = {
model: "chat-bison-001",
apiBase: "https://generativelanguage.googleapis.com",
};
protected async *_streamComplete(
@ -60,7 +61,7 @@ class GooglePalm extends BaseLLM {
messages: ChatMessage[],
options: CompletionOptions
): AsyncGenerator<ChatMessage> {
const apiURL = `https://generativelanguage.googleapis.com/v1/models/${options.model}:streamGenerateContent?key=${this.apiKey}`;
const apiURL = `${this.apiBase}/v1/models/${options.model}:streamGenerateContent?key=${this.apiKey}`;
const body = {
contents: messages.map((msg) => {
return {
@ -135,7 +136,7 @@ class GooglePalm extends BaseLLM {
msgList.push({ content: message.content });
}
const apiURL = `https://generativelanguage.googleapis.com/v1beta2/models/${options.model}:generateMessage?key=${this.apiKey}`;
const apiURL = `${this.apiBase}/v1beta2/models/${options.model}:generateMessage?key=${this.apiKey}`;
const body = { prompt: { messages: msgList } };
const response = await this.fetch(apiURL, {
method: "POST",

View file

@ -21,6 +21,21 @@ const NON_CHAT_MODELS = [
"ada",
];
const CHAT_ONLY_MODELS = [
"gpt-3.5-turbo",
"gpt-3.5-turbo-0613",
"gpt-3.5-turbo-16k",
"gpt-4",
"gpt-35-turbo-16k",
"gpt-35-turbo-0613",
"gpt-35-turbo",
"gpt-4-32k",
"gpt-4-turbo-preview",
"gpt-4-vision",
"gpt-4-0125-preview",
"gpt-4-1106-preview",
];
class OpenAI extends BaseLLM {
public useLegacyCompletionsEndpoint = false;
@ -142,8 +157,9 @@ class OpenAI extends BaseLLM {
options: CompletionOptions
): AsyncGenerator<ChatMessage> {
if (
NON_CHAT_MODELS.includes(options.model) ||
this.useLegacyCompletionsEndpoint
!CHAT_ONLY_MODELS.includes(options.model) &&
(NON_CHAT_MODELS.includes(options.model) ||
this.useLegacyCompletionsEndpoint)
) {
for await (const content of this._legacystreamComplete(
stripImages(messages[messages.length - 1]?.content || ""),

View file

@ -1,6 +1,16 @@
import { ChatMessage } from "../..";
import { stripImages } from "../countTokens";
/**
* @description Template for LLAMA2 messages:
*
* <s>[INST] <<SYS>>
* {{ system_prompt }}
* <</SYS>>
*
* {{ user_msg_1 }} [/INST] {{ model_answer_1 }} </s><s>[INST] {{ user_msg_2 }} [/INST] {{ model_answer_2 }} </s><s>[INST] {{ user_msg_3 }} [/INST]
*/
function llama2TemplateMessages(msgs: ChatMessage[]): string {
if (msgs.length === 0) {
return "";
@ -21,14 +31,9 @@ function llama2TemplateMessages(msgs: ChatMessage[]): string {
}
if (hasSystem) {
const systemMessage = `
<<SYS>>
${msgs[0].content}
<</SYS>>
`;
const systemMessage = `<<SYS>>\n ${msgs[0].content}\n<</SYS>>\n\n`;
if (msgs.length > 1) {
prompt += `[INST] ${systemMessage}${msgs[1].content} [/INST]`;
prompt += `<s>[INST] ${systemMessage} ${msgs[1].content} [/INST]`;
} else {
prompt += `[INST] ${systemMessage} [/INST]`;
return prompt;
@ -39,7 +44,7 @@ function llama2TemplateMessages(msgs: ChatMessage[]): string {
if (msgs[i].role === "user") {
prompt += `[INST] ${msgs[i].content} [/INST]`;
} else {
prompt += msgs[i].content + " ";
prompt += msgs[i].content + "</s>\n<s>";
}
}

View file

@ -21,7 +21,7 @@
"http-proxy-agent": "^7.0.1",
"https-proxy-agent": "^7.0.3",
"js-tiktoken": "^1.0.8",
"llm-code-highlighter": "^0.0.5",
"llm-code-highlighter": "^0.0.9",
"node-fetch": "^3.3.2",
"node-html-markdown": "^1.3.0",
"ollama": "^0.4.6",
@ -4841,9 +4841,9 @@
"dev": true
},
"node_modules/llm-code-highlighter": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/llm-code-highlighter/-/llm-code-highlighter-0.0.5.tgz",
"integrity": "sha512-rzizZgdEXRJhS0p75fwjhtlRYblq8F9zss4cCavZNEliYTFVqt1sEDmCCmjCTGkJp7hK1z77PrzcrT7KXqxhGA==",
"version": "0.0.9",
"resolved": "https://registry.npmjs.org/llm-code-highlighter/-/llm-code-highlighter-0.0.9.tgz",
"integrity": "sha512-zBOOf7bv8c+H+ib9F+QSMLRxsKE64Y5+f9QQEGXwN4g4V8tdaTQHCXaHopAYMV73hJKt3hWqSOjVnfgGxk9npw==",
"dependencies": {
"graphology": "^0.25.4",
"graphology-metrics": "^2.2.0",

View file

@ -31,7 +31,7 @@
"http-proxy-agent": "^7.0.1",
"https-proxy-agent": "^7.0.3",
"js-tiktoken": "^1.0.8",
"llm-code-highlighter": "^0.0.5",
"llm-code-highlighter": "^0.0.9",
"node-fetch": "^3.3.2",
"node-html-markdown": "^1.3.0",
"ollama": "^0.4.6",

View file

@ -37,7 +37,7 @@ export function proxyFetch(url: string, init?: RequestInit): Promise<Response> {
if (!(url.startsWith("http://") || url.startsWith("https://"))) {
// Relative URL
const fullUrl = `${(window as any).vscMediaUrl}/${url}`;
const fullUrl = `${window.vscMediaUrl}/${url}`;
return (window as any)._fetch(fullUrl, init);
}

View file

@ -1,64 +1,16 @@
import { dedentAndGetCommonWhitespace, renderPromptTemplate } from ".";
import { DiffLine, ILLM } from "..";
import {
filterCodeBlockLines,
filterEnglishLinesAtEnd,
filterEnglishLinesAtStart,
filterLeadingAndTrailingNewLineInsertion,
fixCodeLlamaFirstLineIndentation,
} from "../autocomplete/lineStream";
import { streamDiff } from "../diff/streamDiff";
import { LineStream, streamLines } from "../diff/util";
import { streamLines } from "../diff/util";
import { stripImages } from "../llm/countTokens";
import { gptEditPrompt } from "../llm/templates/edit";
function shouldRemoveLineBeforeStart(line: string): boolean {
return (
line.trimStart().startsWith("```") ||
line.trim() === "[CODE]" ||
line.trim() === ""
);
}
function shouldChangeLineAndStop(line: string): string | undefined {
if (line.trimStart() === "```") {
return line;
}
if (line.includes("[/CODE]")) {
return line.split("[/CODE]")[0].trimEnd();
}
return undefined;
}
async function* filterCodeBlockLines(rawLines: LineStream): LineStream {
let seenValidLine = false;
let waitingToSeeIfLineIsLast = undefined;
for await (const line of rawLines) {
// Filter out starting ```
if (!seenValidLine) {
if (shouldRemoveLineBeforeStart(line)) {
continue;
} else {
seenValidLine = true;
}
}
// Filter out ending ```
if (typeof waitingToSeeIfLineIsLast !== "undefined") {
yield waitingToSeeIfLineIsLast;
waitingToSeeIfLineIsLast = undefined;
}
const changedEndLine = shouldChangeLineAndStop(line);
if (typeof changedEndLine === "string") {
yield changedEndLine;
return;
}
if (line === "```") {
waitingToSeeIfLineIsLast = line;
} else {
yield line;
}
}
}
import { dedentAndGetCommonWhitespace, renderPromptTemplate } from "../util";
function constructPrompt(
codeToEdit: string,
@ -89,88 +41,10 @@ async function* addIndentation(
}
}
function isEnglishFirstLine(line: string) {
line = line.trim().toLowerCase();
if (line.endsWith(":") && !line.trimStart().startsWith("def")) {
return true;
}
if (
line.startsWith("here is") ||
line.startsWith("sure, here") ||
line.startsWith("sure thing") ||
line.startsWith("sure!")
) {
return true;
}
return false;
}
async function* filterEnglishLines(lines: LineStream) {
let i = 0;
let wasEnglishFirstLine = false;
for await (let line of lines) {
if (i === 0) {
if (isEnglishFirstLine(line)) {
wasEnglishFirstLine = true;
i++;
continue;
}
} else if (i === 1 && wasEnglishFirstLine && line.trim() === "") {
i++;
continue;
}
i++;
yield line;
}
}
async function* fixCodeLlamaFirstLineIndentation(lines: LineStream) {
let isFirstLine = true;
for await (let line of lines) {
if (isFirstLine && line.startsWith(" ")) {
yield line.slice(2);
isFirstLine = false;
} else {
yield line;
}
}
}
function modelIsInept(model: string): boolean {
return !(model.includes("gpt") || model.includes("claude"));
}
async function* filterLeadingAndTrailingNewLineInsertion(
diffLines: AsyncGenerator<DiffLine>
): AsyncGenerator<DiffLine> {
let isFirst = true;
let buffer: DiffLine[] = [];
for await (let diffLine of diffLines) {
let isBlankLineInsertion =
diffLine.type === "new" &&
(diffLine.line.trim() === "" || diffLine.line.trim() === "```");
if (isFirst && isBlankLineInsertion) {
isFirst = false;
continue;
}
isFirst = false;
if (isBlankLineInsertion) {
buffer.push(diffLine);
} else {
if (diffLine.type === "old") {
buffer = [];
} else {
while (buffer.length > 0) {
yield buffer.shift()!;
}
}
yield diffLine;
}
}
}
export async function* streamDiffLines(
oldCode: string,
llm: ILLM,
@ -185,18 +59,16 @@ export async function* streamDiffLines(
const prompt = constructPrompt(oldCode, llm, input, language);
const inept = modelIsInept(llm.model);
console.log("Prompt:\n\n", prompt);
const completion = llm.streamComplete(prompt);
let lines = streamLines(completion);
if (inept) {
lines = filterEnglishLines(lines);
lines = filterEnglishLinesAtStart(lines);
}
lines = filterCodeBlockLines(lines);
if (inept) {
lines = fixCodeLlamaFirstLineIndentation(lines);
lines = filterEnglishLinesAtEnd(fixCodeLlamaFirstLineIndentation(lines));
}
let diffLines = streamDiff(oldLines, lines);

View file

@ -2745,10 +2745,10 @@ 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==
llm-code-highlighter@^0.0.5:
version "0.0.5"
resolved "https://registry.npmjs.org/llm-code-highlighter/-/llm-code-highlighter-0.0.5.tgz"
integrity sha512-rzizZgdEXRJhS0p75fwjhtlRYblq8F9zss4cCavZNEliYTFVqt1sEDmCCmjCTGkJp7hK1z77PrzcrT7KXqxhGA==
llm-code-highlighter@^0.0.9:
version "0.0.9"
resolved "https://registry.npmjs.org/llm-code-highlighter/-/llm-code-highlighter-0.0.9.tgz"
integrity sha512-zBOOf7bv8c+H+ib9F+QSMLRxsKE64Y5+f9QQEGXwN4g4V8tdaTQHCXaHopAYMV73hJKt3hWqSOjVnfgGxk9npw==
dependencies:
graphology "^0.25.4"
graphology-metrics "^2.2.0"

View file

@ -53,7 +53,7 @@ Instead of writing something like `Ollama(model="phind-codellama:34b", ...)`, wh
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-1106-preview",
"gpt-4-turbo-preview",
# Open-Source
"mistral-7b",
"llama2-7b",

View file

@ -112,6 +112,22 @@ Type '@issue' to reference the conversation in a GitHub issue. Make sure to incl
}
```
### 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'
```json
{ "name": "outline" }
```
### Code Highlights
Type '@highlights' to reference the 'highlights' from all currently open files. The highlights are computed using Paul Gauthier's so-called ['repomap'](https://aider.chat/docs/repomap.html) technique in [Aider Chat](https://github.com/paul-gauthier/aider). Supported file extensions are the same as for '@Outline' (behind the scenes, we use the corresponding tree-sitter grammars for language parsing).
```json
{ "name": "highlights" }
```
### 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.

View file

@ -98,9 +98,9 @@ This exact function and a few other default implementations are available in [`c
You also have access to customize the prompt used in the '/edit' slash command. We already have a well-engineered prompt for GPT-4 and sensible defaults for less powerful open-source models, but you might wish to play with the prompt and try to find a more reliable alternative if you are for example getting English as well as code in your output.
To customize the prompt, use the `promptTemplates` property of any model, which is a dictionary, and set the "edit" key to a template string with Mustache syntax. The 'filePrefix', 'fileSuffix', 'codeToEdit', 'language', 'contextItems', and 'userInput' variables are available in the template. Here is an example:
To customize the prompt, use the `promptTemplates` property of any model, which is a dictionary, and set the "edit" key to a template string with Mustache syntax. The 'filePrefix', 'fileSuffix', 'codeToEdit', 'language', 'contextItems', and 'userInput' variables are available in the template. Here is an example of how it can be set in `config.ts`:
```typescript
```typescript title="~/.continue/config.ts"
const codellamaEditPrompt = `\`\`\`{{{language}}}
{{{codeToEdit}}}
\`\`\`
@ -109,13 +109,9 @@ const codellamaEditPrompt = `\`\`\`{{{language}}}
Your answer should be given inside of a code block. It should use the same kind of indentation as above.
[/INST] Sure! Here's the rewritten code you requested:
\`\`\`{{{language}}}`;
```
It can then be used like this in `config.ts`:
```typescript title="~/.continue/config.ts"
function modifyConfig(config: Config): Config {
config.models[0].promptTemplates["edit"] = "<INSERT_TEMPLATE_HERE>";
config.models[0].promptTemplates["edit"] = codellamaEditPrompt;
return config;
}
```

View file

@ -96,13 +96,42 @@ We also support other methods of generating embeddings, which can be configured
### OpenAI
OpenAI's [ada-002 embeddings](https://platform.openai.com/docs/guides/embeddings) are high dimensional embeddings that give great performance on both text and code.
OpenAI's [embeddings](https://platform.openai.com/docs/guides/embeddings) are high dimensional embeddings that give great performance on both text and code.
Configuration for text-embedding-3-small Model
The text-embedding-3-small model offers an outstanding balance between performance and efficiency, suitable for a versatile range of applications.
```json title="~/.continue/config.json"
{
"embeddingsProvider": {
"provider": "openai",
"model": "text-embedding-ada-002", // optional, defaults to "text-embedding-ada-002"
"model": "text-embedding-3-small",
"apiBase": "<your custom OpenAI-compatible endpoint>" // optional, defaults to OpenAI's API
}
}
```
Configuration for text-embedding-3-large Model
For those requiring the highest level of embedding detail and precision, the text-embedding-3-large model is the better choice.
```json title="~/.continue/config.json"
{
"embeddingsProvider": {
"provider": "openai",
"model": "text-embedding-3-large",
"apiBase": "<your custom OpenAI-compatible endpoint>" // optional, defaults to OpenAI's API
}
}
```
Legacy Model Configuration
For certain scenarios, you may still find the text-embedding-ada-002 model relevant. Below is the configuration example:
```json title="~/.continue/config.json"
{
"embeddingsProvider": {
"provider": "openai",
"model": "text-embedding-ada-002",
"apiBase": "<your custom OpenAI-compatible endpoint>" // optional, defaults to OpenAI's API
}
}

View file

@ -52,7 +52,7 @@ Instead of writing something like `Ollama(model="phind-codellama:34b", ...)`, wh
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-1106-preview",
"gpt-4-turbo-preview",
# Open-Source
"mistral-7b",
"llama2-7b",

View file

@ -2,7 +2,7 @@
Continue now provides experimental support for tab autocomplete in VS Code. You can enable it by downloading the pre-release version of the extension, opening VS Code settings, and then checking the box that says "Enable Tab Autocomplete". There is also a button on the bottom/status bar for fast access. We will be greatly improving the experience over the next few releases, and it is always helpful to hear feedback. If you have any problems or suggestions, please let us know in our [Discord](https://discord.gg/vapESyrFmJ).
## Setting up with Ollama
## Setting up with Ollama (default)
We recommend setting up tab-autocomplete with a local Ollama instance. To do this, first download the latest version of Ollama from [here](https://ollama.ai). Then, run the following command to download our recommended model:
@ -12,6 +12,24 @@ ollama run deepseek-coder:1.3b-base
Once it has been downloaded, you should begin to see completions in VS Code.
## Setting up a custom model
All of the configuration options available for chat models are available to use for tab-autocomplete. For example, if you wanted to use a remote Ollama instance you would edit your `config.json` like this:
```json
{
"tabAutocompleteModel": {
"title": "Tab Autocomplete Model",
"provider": "ollama",
"model": "deepseek-coder:1.3b-base",
"apiBase": "https://<my endpoint>"
},
...
}
```
If you aren't yet familiar with the available options, you can learn more in our [overview](../model-setup/overview.md).
## Configuration Options
The following can be configured in `config.json`:

View file

@ -87,6 +87,11 @@
"additionalProperties": {
"type": "string"
}
},
"extraBodyProperties": {
"title": "Extra Body Properties",
"description": "This object will be merged with the body when making the HTTP requests",
"type": "object"
}
}
},
@ -216,7 +221,8 @@
"verifySsl": null,
"caBundlePath": null,
"proxy": null,
"headers": null
"headers": null,
"extraBodyProperties": null
},
"allOf": [
{
@ -336,6 +342,7 @@
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"AUTODETECT"
]
}
@ -421,7 +428,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@ -444,6 +451,9 @@
"stable-code-3b",
"starcoder-1b",
"starcoder-3b",
"mistral-tiny",
"mistral-small",
"mistral-medium",
"AUTODETECT"
]
},
@ -782,7 +792,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@ -986,7 +996,9 @@
"folder",
"issue",
"docs",
"tree"
"tree",
"highlights",
"outline"
],
"markdownEnumDescriptions": [
"Reference the contents of the current changes as given by `git diff`",
@ -1002,7 +1014,9 @@
"Retrieve important pages from a documentation website, as determined by similarity search",
"Index and retrieve the contents of any documentation site, using embeddings to find important snippets",
"Display a file tree of the current workspace",
"Include a repo map showing important code objects"
"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"
],
"type": "string"
},

View file

@ -185,7 +185,7 @@ class ContinuePluginStartupActivity : StartupActivity, Disposable, DumbAware {
val workspacePaths =
if (project.basePath != null) arrayOf(project.basePath) else emptyList<String>()
continuePluginService.worksapcePaths = workspacePaths as Array<String>
continuePluginService.workspacePaths = workspacePaths as Array<String>
}
EditorFactory.getInstance().eventMulticaster.addSelectionListener(

View file

@ -132,7 +132,7 @@ class ContinuePluginToolWindowFactory : ToolWindowFactory, DumbAware {
val jsonData = mutableMapOf(
"windowId" to continuePluginService.windowId,
"workspacePaths" to continuePluginService.worksapcePaths,
"workspacePaths" to continuePluginService.workspacePaths,
"vscMachineId" to getMachineUniqueID(),
"vscMediaUrl" to "http://continue",
)

View file

@ -87,6 +87,11 @@
"additionalProperties": {
"type": "string"
}
},
"extraBodyProperties": {
"title": "Extra Body Properties",
"description": "This object will be merged with the body when making the HTTP requests",
"type": "object"
}
}
},
@ -216,7 +221,8 @@
"verifySsl": null,
"caBundlePath": null,
"proxy": null,
"headers": null
"headers": null,
"extraBodyProperties": null
},
"allOf": [
{
@ -336,6 +342,7 @@
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"AUTODETECT"
]
}
@ -421,7 +428,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@ -444,6 +451,9 @@
"stable-code-3b",
"starcoder-1b",
"starcoder-3b",
"mistral-tiny",
"mistral-small",
"mistral-medium",
"AUTODETECT"
]
},
@ -782,7 +792,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@ -986,7 +996,9 @@
"folder",
"issue",
"docs",
"tree"
"tree",
"highlights",
"outline"
],
"markdownEnumDescriptions": [
"Reference the contents of the current changes as given by `git diff`",
@ -1002,7 +1014,9 @@
"Retrieve important pages from a documentation website, as determined by similarity search",
"Index and retrieve the contents of any documentation site, using embeddings to find important snippets",
"Display a file tree of the current workspace",
"Include a repo map showing important code objects"
"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"
],
"type": "string"
},

View file

@ -94,6 +94,11 @@
"additionalProperties": {
"type": "string"
}
},
"extraBodyProperties": {
"title": "Extra Body Properties",
"description": "This object will be merged with the body when making the HTTP requests",
"type": "object"
}
}
},
@ -223,7 +228,8 @@
"verifySsl": null,
"caBundlePath": null,
"proxy": null,
"headers": null
"headers": null,
"extraBodyProperties": null
},
"allOf": [
{
@ -370,6 +376,7 @@
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"AUTODETECT"
]
}
@ -469,7 +476,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@ -492,6 +499,9 @@
"stable-code-3b",
"starcoder-1b",
"starcoder-3b",
"mistral-tiny",
"mistral-small",
"mistral-medium",
"AUTODETECT"
]
},
@ -904,7 +914,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-vision-preview",
"mistral-7b",
"mistral-8x7b",
@ -1129,7 +1139,9 @@
"folder",
"issue",
"docs",
"tree"
"tree",
"highlights",
"outline"
],
"markdownEnumDescriptions": [
"Reference the contents of the current changes as given by `git diff`",
@ -1145,7 +1157,9 @@
"Retrieve important pages from a documentation website, as determined by similarity search",
"Index and retrieve the contents of any documentation site, using embeddings to find important snippets",
"Display a file tree of the current workspace",
"Include a repo map showing important code objects"
"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"
],
"type": "string"
},

View file

@ -1,12 +1,12 @@
{
"name": "continue",
"version": "0.9.60",
"version": "0.9.66",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "continue",
"version": "0.9.60",
"version": "0.9.66",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",
@ -97,7 +97,7 @@
"http-proxy-agent": "^7.0.1",
"https-proxy-agent": "^7.0.3",
"js-tiktoken": "^1.0.8",
"llm-code-highlighter": "^0.0.5",
"llm-code-highlighter": "^0.0.9",
"node-fetch": "^3.3.2",
"node-html-markdown": "^1.3.0",
"ollama": "^0.4.6",
@ -1476,6 +1476,11 @@
"node": ">=8"
}
},
"node_modules/@istanbuljs/load-nyc-config/node_modules/sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
},
"node_modules/@istanbuljs/schema": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz",
@ -1855,9 +1860,9 @@
"dev": true
},
"node_modules/@lancedb/vectordb-darwin-arm64": {
"version": "0.4.8",
"resolved": "https://registry.npmjs.org/@lancedb/vectordb-darwin-arm64/-/vectordb-darwin-arm64-0.4.8.tgz",
"integrity": "sha512-FpnJaw7KmNdD/FtOw9AcmPL5P+L04AcnfPj9ZyEjN8iCwB/qaOGYgdfBv+EbEtfHIsqA12q/1BRduu9KdB6BIA==",
"version": "0.4.9",
"resolved": "https://registry.npmjs.org/@lancedb/vectordb-darwin-arm64/-/vectordb-darwin-arm64-0.4.9.tgz",
"integrity": "sha512-u56TXU0hvdLbknGwC7Ebza3/CUFeCTkoCy/sC6h0FtOGya+NV7jraAeXEwDzoZbfW08VYYxnp3TsCcpNU9lpTA==",
"cpu": [
"arm64"
],
@ -1867,9 +1872,9 @@
]
},
"node_modules/@lancedb/vectordb-darwin-x64": {
"version": "0.4.8",
"resolved": "https://registry.npmjs.org/@lancedb/vectordb-darwin-x64/-/vectordb-darwin-x64-0.4.8.tgz",
"integrity": "sha512-RafOEYyZIgphp8wPGuVLFaTc8aAqo0NCO1LQMx0mB0xV96vrdo0Mooivs+dYN3RFfSHtTKPw9O1Jc957Vp1TLg==",
"version": "0.4.9",
"resolved": "https://registry.npmjs.org/@lancedb/vectordb-darwin-x64/-/vectordb-darwin-x64-0.4.9.tgz",
"integrity": "sha512-8BvRj4cgR2isbzoYl/srSWw7lmquVhqR9nw48AWWvkRBc/RPnBVFa5RdvUu7o+nLkNyRGPG8RzUFyIhd0WCDMw==",
"cpu": [
"x64"
],
@ -1879,9 +1884,9 @@
]
},
"node_modules/@lancedb/vectordb-linux-arm64-gnu": {
"version": "0.4.8",
"resolved": "https://registry.npmjs.org/@lancedb/vectordb-linux-arm64-gnu/-/vectordb-linux-arm64-gnu-0.4.8.tgz",
"integrity": "sha512-WlbYNfj4+v1hBHUluF+hnlG/A0ZaQFdXBTGDfHQniL11o+n3emWm4ujP5nSAoQHXjSH9DaOTGr/N4Mc9Xe+luw==",
"version": "0.4.9",
"resolved": "https://registry.npmjs.org/@lancedb/vectordb-linux-arm64-gnu/-/vectordb-linux-arm64-gnu-0.4.9.tgz",
"integrity": "sha512-RcEDTm5heB0zjcZZGDIKqDPod4WIFmWttYZa2IsRNucWyf1IKhaOAK3oXJiQsYZ+ipRDH2384tmLxe03vhvjCQ==",
"cpu": [
"arm64"
],
@ -1891,9 +1896,9 @@
]
},
"node_modules/@lancedb/vectordb-linux-x64-gnu": {
"version": "0.4.8",
"resolved": "https://registry.npmjs.org/@lancedb/vectordb-linux-x64-gnu/-/vectordb-linux-x64-gnu-0.4.8.tgz",
"integrity": "sha512-z+qFJrDqnNEv4JcwYDyt51PHmWjuM/XaOlSjpBnyyuUImeY+QcwctMuyXt8+Q4zhuqQR1AhLKrMwCU+YmMfk5g==",
"version": "0.4.9",
"resolved": "https://registry.npmjs.org/@lancedb/vectordb-linux-x64-gnu/-/vectordb-linux-x64-gnu-0.4.9.tgz",
"integrity": "sha512-HbvSym1WXgTTDb+gfEaD9R/x+NbI6PWM8PrqFaAXkhm2Zzi/eL9eHBl2vgTyYFbzUvucTYnHZzT8a8FzCuvW0A==",
"cpu": [
"x64"
],
@ -1903,9 +1908,9 @@
]
},
"node_modules/@lancedb/vectordb-win32-x64-msvc": {
"version": "0.4.8",
"resolved": "https://registry.npmjs.org/@lancedb/vectordb-win32-x64-msvc/-/vectordb-win32-x64-msvc-0.4.8.tgz",
"integrity": "sha512-VjUryVvEA04r0j4lU9pJy84cmjuQm1GhBzbPc8kwbn5voT4A6BPglrlNsU0Zc+j8Fbjyvauzw2lMEcMsF4F0rw==",
"version": "0.4.9",
"resolved": "https://registry.npmjs.org/@lancedb/vectordb-win32-x64-msvc/-/vectordb-win32-x64-msvc-0.4.9.tgz",
"integrity": "sha512-owf2aLI5kawMmfJZl+MN4I19JSIe3j4+aW1TFbV3S4nT3oFiYs44kQAuyBqbvwVz7oQ97aVJONewssaFxCsYpA==",
"cpu": [
"x64"
],
@ -2636,9 +2641,9 @@
"integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g=="
},
"node_modules/@types/node": {
"version": "16.18.79",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.79.tgz",
"integrity": "sha512-Qd7jdLR5zmnIyMhfDrfPqN5tUCvreVpP3Qrf2oSM+F7SNzlb/MwHISGUkdFHtevfkPJ3iAGyeQI/jsbh9EStgQ=="
"version": "16.18.80",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.80.tgz",
"integrity": "sha512-vFxJ1Iyl7A0+xB0uW1r1v504yItKZLdqg/VZELUZ4H02U0bXAgBisSQ8Erf0DMruNFz9ggoiEv6T8Ll9bTg8Jw=="
},
"node_modules/@types/node-fetch": {
"version": "2.6.11",
@ -2678,9 +2683,9 @@
"devOptional": true
},
"node_modules/@types/react": {
"version": "18.2.54",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.54.tgz",
"integrity": "sha512-039k+vrVJymDoe2y+HLk3O3oI3sa+C8KNjuDKofqrIJK26ramnqLNj9VJTaxAzFGMvpW/79HrrAJapHzpQ9fGQ==",
"version": "18.2.55",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.55.tgz",
"integrity": "sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==",
"dependencies": {
"@types/prop-types": "*",
"@types/scheduler": "*",
@ -2688,9 +2693,9 @@
}
},
"node_modules/@types/react-dom": {
"version": "18.2.18",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.18.tgz",
"integrity": "sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==",
"version": "18.2.19",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.19.tgz",
"integrity": "sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA==",
"devOptional": true,
"dependencies": {
"@types/react": "*"
@ -2736,9 +2741,9 @@
"integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A=="
},
"node_modules/@types/semver": {
"version": "7.5.6",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz",
"integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==",
"version": "7.5.7",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.7.tgz",
"integrity": "sha512-/wdoPq1QqkSj9/QOeKkFquEuPzQbHTWAMPH/PaUMB+JuR31lXhlWXRZ52IpfDYVlDOUBvX09uBrPwxGT1hjNBg==",
"dev": true
},
"node_modules/@types/send": {
@ -4018,9 +4023,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001584",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001584.tgz",
"integrity": "sha512-LOz7CCQ9M1G7OjJOF9/mzmqmj3jE/7VOmrfw6Mgs0E8cjOsbRXQJHsPBfmBOXDskXKrHLyyW3n7kpDW/4BsfpQ==",
"version": "1.0.30001587",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001587.tgz",
"integrity": "sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA==",
"funding": [
{
"type": "opencollective",
@ -4914,17 +4919,20 @@
}
},
"node_modules/define-data-property": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.2.tgz",
"integrity": "sha512-SRtsSqsDbgpJBbW3pABMCOt6rQyeM8s8RiyeSN8jYG8sYmt/kGJejbydttUsnDs1tadr19tvhT4ShwMyoqAm4g==",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.3.tgz",
"integrity": "sha512-h3GBouC+RPtNX2N0hHVLo2ZwPYurq8mLmXpOLTsw71gr7lHt5VaI4vVkDUNOfiWmm48JEXe3VM7PmLX45AMmmg==",
"dependencies": {
"es-errors": "^1.3.0",
"get-intrinsic": "^1.2.2",
"get-intrinsic": "^1.2.4",
"gopd": "^1.0.1",
"has-property-descriptors": "^1.0.1"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/delayed-stream": {
@ -5124,15 +5132,20 @@
"safer-buffer": "^2.1.0"
}
},
"node_modules/ecc-jsbn/node_modules/jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg=="
},
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
},
"node_modules/electron-to-chromium": {
"version": "1.4.657",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.657.tgz",
"integrity": "sha512-On2ymeleg6QbRuDk7wNgDdXtNqlJLM2w4Agx1D/RiTmItiL+a9oq5p7HUa2ZtkAtGBe/kil2dq/7rPfkbe0r5w=="
"version": "1.4.666",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.666.tgz",
"integrity": "sha512-q4lkcbQrUdlzWCUOxk6fwEza6bNCfV12oi4AJph5UibguD1aTfL4uD0nuzFv9hbPANXQMuUS0MxPSHQ1gqq5dg=="
},
"node_modules/emittery": {
"version": "0.13.1",
@ -6557,9 +6570,9 @@
"integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ=="
},
"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==",
"dependencies": {
"function-bind": "^1.1.2"
},
@ -6686,9 +6699,9 @@
}
},
"node_modules/http-proxy-agent": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz",
"integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==",
"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"
@ -6747,9 +6760,9 @@
}
},
"node_modules/https-proxy-agent": {
"version": "7.0.2",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz",
"integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==",
"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"
@ -6956,10 +6969,17 @@
"node": ">=8"
}
},
"node_modules/ip": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz",
"integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ=="
"node_modules/ip-address": {
"version": "9.0.5",
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz",
"integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==",
"dependencies": {
"jsbn": "1.1.0",
"sprintf-js": "^1.1.3"
},
"engines": {
"node": ">= 12"
}
},
"node_modules/ipaddr.js": {
"version": "1.9.1",
@ -7837,9 +7857,9 @@
}
},
"node_modules/jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg=="
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
},
"node_modules/jsesc": {
"version": "2.5.2",
@ -10046,9 +10066,9 @@
}
},
"node_modules/postcss": {
"version": "8.4.34",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.34.tgz",
"integrity": "sha512-4eLTO36woPSocqZ1zIrFD2K1v6wH7pY1uBh0JIM2KKfrVtGvPFiAku6aNOP0W1Wr9qwnaCsF0Z+CrVnryB2A8Q==",
"version": "8.4.35",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz",
"integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==",
"funding": [
{
"type": "opencollective",
@ -10184,9 +10204,9 @@
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="
},
"node_modules/posthog-node": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/posthog-node/-/posthog-node-3.6.1.tgz",
"integrity": "sha512-nvuZngDjzbQ2L2NqaBRWONuQeA3Dv+A8qXGMlOnM3/x07tGUrNYItgrLQH8wCntx75/PUlKq3ftxyQqNprGZjA==",
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/posthog-node/-/posthog-node-3.6.2.tgz",
"integrity": "sha512-tVIaShR3SxBx17AlAUS86jQTweKuJIFRedBB504fCz7YPnXJTYSrVcUHn5IINE2wu4jUQimQK6ihQr90Djrdrg==",
"dependencies": {
"axios": "^1.6.2",
"rusha": "^0.8.14"
@ -11191,13 +11211,14 @@
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="
},
"node_modules/set-function-length": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.0.tgz",
"integrity": "sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz",
"integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==",
"dependencies": {
"define-data-property": "^1.1.1",
"define-data-property": "^1.1.2",
"es-errors": "^1.3.0",
"function-bind": "^1.1.2",
"get-intrinsic": "^1.2.2",
"get-intrinsic": "^1.2.3",
"gopd": "^1.0.1",
"has-property-descriptors": "^1.0.1"
},
@ -11235,13 +11256,17 @@
}
},
"node_modules/side-channel": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz",
"integrity": "sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==",
"dependencies": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
"object-inspect": "^1.9.0"
"call-bind": "^1.0.6",
"es-errors": "^1.3.0",
"get-intrinsic": "^1.2.4",
"object-inspect": "^1.13.1"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
@ -11346,15 +11371,15 @@
}
},
"node_modules/socks": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz",
"integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==",
"version": "2.7.3",
"resolved": "https://registry.npmjs.org/socks/-/socks-2.7.3.tgz",
"integrity": "sha512-vfuYK48HXCTFD03G/1/zkIls3Ebr2YNa4qU9gHDZdblHLiqhJrJGkY3+0Nx0JpN9qBhJbVObc1CNciT1bIZJxw==",
"dependencies": {
"ip": "^2.0.0",
"ip-address": "^9.0.5",
"smart-buffer": "^4.2.0"
},
"engines": {
"node": ">= 10.13.0",
"node": ">= 10.0.0",
"npm": ">= 3.0.0"
}
},
@ -11423,9 +11448,9 @@
"dev": true
},
"node_modules/sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
"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/sshpk": {
"version": "1.18.0",
@ -11451,6 +11476,11 @@
"node": ">=0.10.0"
}
},
"node_modules/sshpk/node_modules/jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg=="
},
"node_modules/ssri": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz",
@ -12318,9 +12348,9 @@
"dev": true
},
"node_modules/undici": {
"version": "6.6.1",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.6.1.tgz",
"integrity": "sha512-J0GaEp0ztu/grIE2Uq57AbK6TRb+bWbOlxu0POCzhFKA6LKbwSAev+hDQaQcgUUA9CPs8Ky+cauzTHnQrtAQEA==",
"version": "6.6.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.6.2.tgz",
"integrity": "sha512-vSqvUE5skSxQJ5sztTZ/CdeJb1Wq0Hf44hlYMciqHghvz+K88U0l7D6u1VsndoFgskDcnU+nG3gYmMzJVzd9Qg==",
"dependencies": {
"@fastify/busboy": "^2.0.0"
},
@ -12595,9 +12625,9 @@
}
},
"node_modules/vectordb": {
"version": "0.4.8",
"resolved": "https://registry.npmjs.org/vectordb/-/vectordb-0.4.8.tgz",
"integrity": "sha512-UnxMRhmMfjDoGzIcBMd4oISBYE60UtHXyiSbzWbvYwko6CPqQ6pc3FzpXer2qsfvEVqlNXQX+hDeMZ6gf2mtdQ==",
"version": "0.4.9",
"resolved": "https://registry.npmjs.org/vectordb/-/vectordb-0.4.9.tgz",
"integrity": "sha512-BZ69hVqhxcaxYfdtqpUCjU9IeP/L1CxAYrylzoWxDBYFe9E78JTJdZc6jzQDWBdSGnlE5ZMbGwbP6kPxBHunTA==",
"cpu": [
"x64",
"arm64"
@ -12614,11 +12644,11 @@
"axios": "^1.4.0"
},
"optionalDependencies": {
"@lancedb/vectordb-darwin-arm64": "0.4.8",
"@lancedb/vectordb-darwin-x64": "0.4.8",
"@lancedb/vectordb-linux-arm64-gnu": "0.4.8",
"@lancedb/vectordb-linux-x64-gnu": "0.4.8",
"@lancedb/vectordb-win32-x64-msvc": "0.4.8"
"@lancedb/vectordb-darwin-arm64": "0.4.9",
"@lancedb/vectordb-darwin-x64": "0.4.9",
"@lancedb/vectordb-linux-arm64-gnu": "0.4.9",
"@lancedb/vectordb-linux-x64-gnu": "0.4.9",
"@lancedb/vectordb-win32-x64-msvc": "0.4.9"
}
},
"node_modules/verror": {

View file

@ -1,7 +1,7 @@
{
"name": "continue",
"icon": "media/icon.png",
"version": "0.9.60",
"version": "0.9.66",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"
@ -65,7 +65,7 @@
"continue.enableTabAutocomplete": {
"type": "boolean",
"default": false,
"markdownDescription": "Enable Continue's experimental tab autocomplete feature. Read our walkthrough to learn about configuration and how to share feedback: [continue.dev › Walkthrough: Tab Autocomplete](https://continue.dev/docs/walkthroughs/tab-autocomplete)"
"markdownDescription": "Enable Continue's experimental tab autocomplete feature (pre-release only). Read our walkthrough to learn about configuration and how to share feedback: [continue.dev › Walkthrough: Tab Autocomplete](https://continue.dev/docs/walkthroughs/tab-autocomplete)"
}
}
},
@ -198,6 +198,12 @@
"mac": "shift+cmd+backspace",
"key": "shift+ctrl+backspace"
},
{
"command": "continue.rejectDiff",
"mac": "cmd+z",
"key": "ctrl+z",
"when": "continue.streamingDiff"
},
{
"command": "continue.quickEdit",
"mac": "cmd+shift+l",

View file

@ -5,7 +5,7 @@ import path from "path";
import * as vscode from "vscode";
import { VsCodeExtension } from "../extension/vscodeExtension";
import registerQuickFixProvider from "../lang-server/codeActions";
import { getExtensionVersion, getPlatform } from "../util/util";
import { getExtensionVersion } from "../util/util";
import { getExtensionUri } from "../util/vscode";
import { setupInlineTips } from "./inlineTips";
@ -87,46 +87,6 @@ export async function activateExtension(context: vscode.ExtensionContext) {
);
});
if (getPlatform() === "mac") {
// Icon is too large and distracting on other platforms
try {
// Add icon theme for .continueignore
const iconTheme = vscode.workspace
.getConfiguration("workbench")
.get("iconTheme");
let found = false;
for (let i = vscode.extensions.all.length - 1; i >= 0; i--) {
if (found) {
break;
}
const extension = vscode.extensions.all[i];
if (extension.packageJSON?.contributes?.iconThemes?.length > 0) {
for (const theme of extension.packageJSON.contributes.iconThemes) {
if (theme.id === iconTheme) {
const themePath = path.join(extension.extensionPath, theme.path);
const themeJson = JSON.parse(
fs.readFileSync(themePath).toString()
);
themeJson.iconDefinitions["_f_continue"] = {
fontCharacter: "⚙️",
fontColor: "#fff",
};
themeJson.fileNames[".continueignore"] = "_f_continue";
themeJson.fileNames[".continuerc.json"] = "_f_continue";
themeJson.fileNames["config.json"] = "_f_continue";
fs.writeFileSync(themePath, JSON.stringify(themeJson));
found = true;
break;
}
}
}
}
} catch (e) {
console.log("Error adding .continueignore file icon: ", e);
}
}
// Load Continue configuration
if (!context.globalState.get("hasBeenInstalled")) {
context.globalState.update("hasBeenInstalled", true);

View file

@ -113,55 +113,53 @@ export class ContinueGUIWebviewViewProvider
this.webviewProtocol.webview = panel.webview;
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>const vscode = acquireVsCodeApi();</script>
<link href="${styleMainUri}" rel="stylesheet">
<title>Continue</title>
</head>
<body>
<div id="root"></div>
${
inDevelopmentMode
? `<script type="module">
import RefreshRuntime from "http://localhost:5173/@react-refresh"
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true
</script>`
: ""
}
<script type="module" nonce="${nonce}" src="${scriptUri}"></script>
<script>localStorage.setItem("ide", "vscode")</script>
<script>window.windowId = "${this.windowId}"</script>
<script>window.vscMachineId = "${getUniqueId()}"</script>
<script>window.vscMediaUrl = "${vscMediaUrl}"</script>
<script>window.ide = "vscode"</script>
<script>window.fullColorTheme = ${JSON.stringify(
currentTheme
)}</script>
<script>window.colorThemeName = "dark-plus"</script>
<script>window.workspacePaths = ${JSON.stringify(
vscode.workspace.workspaceFolders?.map(
(folder) => folder.uri.fsPath
) || []
)}</script>
<script>window.isFullScreen = ${isFullScreen}</script>
${
edits
? `<script>window.edits = ${JSON.stringify(edits)}</script>`
: ""
}
${page ? `<script>window.location.pathname = "${page}"</script>` : ""}
</body>
</html>`;
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>const vscode = acquireVsCodeApi();</script>
<link href="${styleMainUri}" rel="stylesheet">
<title>Continue</title>
</head>
<body>
<div id="root"></div>
${
inDevelopmentMode
? `<script type="module">
import RefreshRuntime from "http://localhost:5173/@react-refresh"
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true
</script>`
: ""
}
<script type="module" nonce="${nonce}" src="${scriptUri}"></script>
<script>localStorage.setItem("ide", "vscode")</script>
<script>window.windowId = "${this.windowId}"</script>
<script>window.vscMachineId = "${getUniqueId()}"</script>
<script>window.vscMediaUrl = "${vscMediaUrl}"</script>
<script>window.ide = "vscode"</script>
<script>window.fullColorTheme = ${JSON.stringify(currentTheme)}</script>
<script>window.colorThemeName = "dark-plus"</script>
<script>window.workspacePaths = ${JSON.stringify(
vscode.workspace.workspaceFolders?.map(
(folder) => folder.uri.fsPath
) || []
)}</script>
<script>window.isFullScreen = ${isFullScreen}</script>
${
edits
? `<script>window.edits = ${JSON.stringify(edits)}</script>`
: ""
}
${page ? `<script>window.location.pathname = "${page}"</script>` : ""}
</body>
</html>`;
}
}

View file

@ -102,14 +102,6 @@ export class DiffManager {
const rightUri = uriFromFilePath(newFilepath);
const leftUri = uriFromFilePath(originalFilepath);
const title = "Continue Diff";
console.log(
"Opening diff window with ",
leftUri,
rightUri,
title,
newFilepath,
originalFilepath
);
vscode.commands.executeCommand("vscode.diff", leftUri, rightUri, title);
const editor = vscode.window.activeTextEditor;

View file

@ -180,6 +180,11 @@ export class VerticalPerLineDiffHandler {
}
clear(accept: boolean) {
vscode.commands.executeCommand(
"setContext",
"continue.streamingDiff",
false
);
const rangesToDelete = accept
? this.redDecorationManager.getRanges()
: this.greenDecorationManager.getRanges();

View file

@ -49,6 +49,8 @@ const DEFAULT_IGNORE_FILETYPES = [
"*.webm",
"*.jar",
"*.onnx",
"*.parquet",
"*.pqt",
];
export const defaultIgnoreFile = ignore().add(DEFAULT_IGNORE_FILETYPES);
const DEFAULT_IGNORE_DIRS = [

View file

@ -1133,9 +1133,9 @@
form-data "^4.0.0"
"@types/node@*", "@types/node@>= 14", "@types/node@16.x":
version "16.18.79"
resolved "https://registry.npmjs.org/@types/node/-/node-16.18.79.tgz"
integrity sha512-Qd7jdLR5zmnIyMhfDrfPqN5tUCvreVpP3Qrf2oSM+F7SNzlb/MwHISGUkdFHtevfkPJ3iAGyeQI/jsbh9EStgQ==
version "16.18.80"
resolved "https://registry.npmjs.org/@types/node/-/node-16.18.80.tgz"
integrity sha512-vFxJ1Iyl7A0+xB0uW1r1v504yItKZLdqg/VZELUZ4H02U0bXAgBisSQ8Erf0DMruNFz9ggoiEv6T8Ll9bTg8Jw==
"@types/node@20.3.0":
version "20.3.0"
@ -1168,16 +1168,16 @@
integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==
"@types/react-dom@^16.8 || ^17.0 || ^18.0", "@types/react-dom@^18.2.4":
version "18.2.18"
resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.18.tgz"
integrity sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==
version "18.2.19"
resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.19.tgz"
integrity sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA==
dependencies:
"@types/react" "*"
"@types/react@*", "@types/react@^16.8 || ^17.0 || ^18.0", "@types/react@^18.0.28", "@types/react@>=16":
version "18.2.54"
resolved "https://registry.npmjs.org/@types/react/-/react-18.2.54.tgz"
integrity sha512-039k+vrVJymDoe2y+HLk3O3oI3sa+C8KNjuDKofqrIJK26ramnqLNj9VJTaxAzFGMvpW/79HrrAJapHzpQ9fGQ==
version "18.2.55"
resolved "https://registry.npmjs.org/@types/react/-/react-18.2.55.tgz"
integrity sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
@ -1206,9 +1206,9 @@
integrity sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==
"@types/semver@^7.3.12":
version "7.5.6"
resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz"
integrity sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==
version "7.5.7"
resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.7.tgz"
integrity sha512-/wdoPq1QqkSj9/QOeKkFquEuPzQbHTWAMPH/PaUMB+JuR31lXhlWXRZ52IpfDYVlDOUBvX09uBrPwxGT1hjNBg==
"@types/send@*":
version "0.17.4"
@ -1909,7 +1909,7 @@ cacheable-request@^7.0.2:
normalize-url "^6.0.1"
responselike "^2.0.0"
call-bind@^1.0.0:
call-bind@^1.0.6:
version "1.0.6"
resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.6.tgz"
integrity sha512-Mj50FLHtlsoVfRfnHaZvyrooHcrlceNZdL/QBvJJVd9Ta55qCQK0gs4ss2oZDeV9zFCs6ewzYgVE5yfVmfFpVg==
@ -1950,9 +1950,9 @@ camelcase@^6.2.0:
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
caniuse-lite@^1.0.30001580:
version "1.0.30001584"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001584.tgz"
integrity sha512-LOz7CCQ9M1G7OjJOF9/mzmqmj3jE/7VOmrfw6Mgs0E8cjOsbRXQJHsPBfmBOXDskXKrHLyyW3n7kpDW/4BsfpQ==
version "1.0.30001587"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001587.tgz"
integrity sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA==
cargo-cp-artifact@^0.1:
version "0.1.8"
@ -2328,7 +2328,7 @@ core-util-is@1.0.2:
http-proxy-agent "^7.0.1"
https-proxy-agent "^7.0.3"
js-tiktoken "^1.0.8"
llm-code-highlighter "^0.0.5"
llm-code-highlighter "^0.0.9"
node-fetch "^3.3.2"
node-html-markdown "^1.3.0"
ollama "^0.4.6"
@ -2491,13 +2491,13 @@ defer-to-connect@^2.0.0:
resolved "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz"
integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==
define-data-property@^1.1.1:
version "1.1.2"
resolved "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.2.tgz"
integrity sha512-SRtsSqsDbgpJBbW3pABMCOt6rQyeM8s8RiyeSN8jYG8sYmt/kGJejbydttUsnDs1tadr19tvhT4ShwMyoqAm4g==
define-data-property@^1.1.2:
version "1.1.3"
resolved "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.3.tgz"
integrity sha512-h3GBouC+RPtNX2N0hHVLo2ZwPYurq8mLmXpOLTsw71gr7lHt5VaI4vVkDUNOfiWmm48JEXe3VM7PmLX45AMmmg==
dependencies:
es-errors "^1.3.0"
get-intrinsic "^1.2.2"
get-intrinsic "^1.2.4"
gopd "^1.0.1"
has-property-descriptors "^1.0.1"
@ -2637,9 +2637,9 @@ ee-first@1.1.1:
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==
electron-to-chromium@^1.4.648:
version "1.4.657"
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.657.tgz"
integrity sha512-On2ymeleg6QbRuDk7wNgDdXtNqlJLM2w4Agx1D/RiTmItiL+a9oq5p7HUa2ZtkAtGBe/kil2dq/7rPfkbe0r5w==
version "1.4.666"
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.666.tgz"
integrity sha512-q4lkcbQrUdlzWCUOxk6fwEza6bNCfV12oi4AJph5UibguD1aTfL4uD0nuzFv9hbPANXQMuUS0MxPSHQ1gqq5dg==
emittery@^0.13.1:
version "0.13.1"
@ -3384,7 +3384,7 @@ get-caller-file@^2.0.5:
resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz"
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
get-intrinsic@^1.0.2, get-intrinsic@^1.1.3, get-intrinsic@^1.2.2, get-intrinsic@^1.2.3:
get-intrinsic@^1.1.3, get-intrinsic@^1.2.2, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4:
version "1.2.4"
resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz"
integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==
@ -3666,9 +3666,9 @@ has-unicode@^2.0.1:
integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==
hasown@^2.0.0:
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==
dependencies:
function-bind "^1.1.2"
@ -3761,9 +3761,9 @@ http-proxy-agent@^5.0.0:
debug "4"
http-proxy-agent@^7.0.0:
version "7.0.0"
resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz"
integrity sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==
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"
@ -3814,9 +3814,9 @@ https-proxy-agent@^5.0.0:
debug "4"
https-proxy-agent@^7.0.2:
version "7.0.2"
resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz"
integrity sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==
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"
@ -3947,10 +3947,13 @@ inquirer@8.2.6:
through "^2.3.6"
wrap-ansi "^6.0.1"
ip@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz"
integrity sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==
ip-address@^9.0.5:
version "9.0.5"
resolved "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz"
integrity sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==
dependencies:
jsbn "1.1.0"
sprintf-js "^1.1.3"
ipaddr.js@1.9.1:
version "1.9.1"
@ -4535,6 +4538,11 @@ jsbn@~0.1.0:
resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz"
integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==
jsbn@1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz"
integrity sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==
jsesc@^2.5.1:
version "2.5.2"
resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz"
@ -5522,7 +5530,7 @@ object-hash@^3.0.0:
resolved "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz"
integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==
object-inspect@^1.9.0:
object-inspect@^1.13.1:
version "1.13.1"
resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz"
integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==
@ -5826,18 +5834,18 @@ postcss-value-parser@^4.0.0:
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
postcss@^8.0.0, postcss@^8.2.14, postcss@^8.4.21, postcss@^8.4.23, postcss@^8.4.27, postcss@>=8.0.9:
version "8.4.34"
resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.34.tgz"
integrity sha512-4eLTO36woPSocqZ1zIrFD2K1v6wH7pY1uBh0JIM2KKfrVtGvPFiAku6aNOP0W1Wr9qwnaCsF0Z+CrVnryB2A8Q==
version "8.4.35"
resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz"
integrity sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==
dependencies:
nanoid "^3.3.7"
picocolors "^1.0.0"
source-map-js "^1.0.2"
posthog-node@^3.1.2:
version "3.6.1"
resolved "https://registry.npmjs.org/posthog-node/-/posthog-node-3.6.1.tgz"
integrity sha512-nvuZngDjzbQ2L2NqaBRWONuQeA3Dv+A8qXGMlOnM3/x07tGUrNYItgrLQH8wCntx75/PUlKq3ftxyQqNprGZjA==
version "3.6.2"
resolved "https://registry.npmjs.org/posthog-node/-/posthog-node-3.6.2.tgz"
integrity sha512-tVIaShR3SxBx17AlAUS86jQTweKuJIFRedBB504fCz7YPnXJTYSrVcUHn5IINE2wu4jUQimQK6ihQr90Djrdrg==
dependencies:
axios "^1.6.2"
rusha "^0.8.14"
@ -6477,13 +6485,14 @@ set-blocking@^2.0.0:
integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==
set-function-length@^1.2.0:
version "1.2.0"
resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.0.tgz"
integrity sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==
version "1.2.1"
resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz"
integrity sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==
dependencies:
define-data-property "^1.1.1"
define-data-property "^1.1.2"
es-errors "^1.3.0"
function-bind "^1.1.2"
get-intrinsic "^1.2.2"
get-intrinsic "^1.2.3"
gopd "^1.0.1"
has-property-descriptors "^1.0.1"
@ -6510,13 +6519,14 @@ shebang-regex@^3.0.0:
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
side-channel@^1.0.4:
version "1.0.4"
resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz"
integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==
version "1.0.5"
resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz"
integrity sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==
dependencies:
call-bind "^1.0.0"
get-intrinsic "^1.0.2"
object-inspect "^1.9.0"
call-bind "^1.0.6"
es-errors "^1.3.0"
get-intrinsic "^1.2.4"
object-inspect "^1.13.1"
signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7:
version "3.0.7"
@ -6585,11 +6595,11 @@ socks-proxy-agent@^7.0.0:
socks "^2.6.2"
socks@^2.6.2:
version "2.7.1"
resolved "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz"
integrity sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==
version "2.7.3"
resolved "https://registry.npmjs.org/socks/-/socks-2.7.3.tgz"
integrity sha512-vfuYK48HXCTFD03G/1/zkIls3Ebr2YNa4qU9gHDZdblHLiqhJrJGkY3+0Nx0JpN9qBhJbVObc1CNciT1bIZJxw==
dependencies:
ip "^2.0.0"
ip-address "^9.0.5"
smart-buffer "^4.2.0"
source-map-js@^1.0.2:
@ -6620,6 +6630,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==
sprintf-js@^1.1.3:
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==
sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz"
@ -7142,9 +7157,9 @@ underscore@^1.12.1:
integrity sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==
undici@^6.2.0:
version "6.6.1"
resolved "https://registry.npmjs.org/undici/-/undici-6.6.1.tgz"
integrity sha512-J0GaEp0ztu/grIE2Uq57AbK6TRb+bWbOlxu0POCzhFKA6LKbwSAev+hDQaQcgUUA9CPs8Ky+cauzTHnQrtAQEA==
version "6.6.2"
resolved "https://registry.npmjs.org/undici/-/undici-6.6.2.tgz"
integrity sha512-vSqvUE5skSxQJ5sztTZ/CdeJb1Wq0Hf44hlYMciqHghvz+K88U0l7D6u1VsndoFgskDcnU+nG3gYmMzJVzd9Qg==
dependencies:
"@fastify/busboy" "^2.0.0"
@ -7311,20 +7326,20 @@ vary@^1, vary@~1.1.2:
integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==
vectordb@^0.4.3:
version "0.4.8"
resolved "https://registry.npmjs.org/vectordb/-/vectordb-0.4.8.tgz"
integrity sha512-UnxMRhmMfjDoGzIcBMd4oISBYE60UtHXyiSbzWbvYwko6CPqQ6pc3FzpXer2qsfvEVqlNXQX+hDeMZ6gf2mtdQ==
version "0.4.9"
resolved "https://registry.npmjs.org/vectordb/-/vectordb-0.4.9.tgz"
integrity sha512-BZ69hVqhxcaxYfdtqpUCjU9IeP/L1CxAYrylzoWxDBYFe9E78JTJdZc6jzQDWBdSGnlE5ZMbGwbP6kPxBHunTA==
dependencies:
"@apache-arrow/ts" "^14.0.2"
"@neon-rs/load" "^0.0.74"
apache-arrow "^14.0.2"
axios "^1.4.0"
optionalDependencies:
"@lancedb/vectordb-darwin-arm64" "0.4.8"
"@lancedb/vectordb-darwin-x64" "0.4.8"
"@lancedb/vectordb-linux-arm64-gnu" "0.4.8"
"@lancedb/vectordb-linux-x64-gnu" "0.4.8"
"@lancedb/vectordb-win32-x64-msvc" "0.4.8"
"@lancedb/vectordb-darwin-arm64" "0.4.9"
"@lancedb/vectordb-darwin-x64" "0.4.9"
"@lancedb/vectordb-linux-arm64-gnu" "0.4.9"
"@lancedb/vectordb-linux-x64-gnu" "0.4.9"
"@lancedb/vectordb-win32-x64-msvc" "0.4.9"
verror@1.10.0:
version "1.10.0"

2
gui/package-lock.json generated
View file

@ -85,7 +85,7 @@
"http-proxy-agent": "^7.0.1",
"https-proxy-agent": "^7.0.3",
"js-tiktoken": "^1.0.8",
"llm-code-highlighter": "^0.0.5",
"llm-code-highlighter": "^0.0.9",
"node-fetch": "^3.3.2",
"node-html-markdown": "^1.3.0",
"ollama": "^0.4.6",

View file

@ -24,7 +24,7 @@ const FlashingDiv = styled.div`
`;
function Loader(props: { size?: string }) {
const vscMediaUrl = (window as any).vscMediaUrl;
const vscMediaUrl = window.vscMediaUrl;
return (
<FlashingDiv>
{vscMediaUrl ? (

View file

@ -43,8 +43,6 @@ function ContinueButton(props: {
disabled: boolean;
showStop: boolean;
}) {
const vscMediaUrl = (window as any).vscMediaUrl;
const [buttonColor, setButtonColor] = useState<string | null>(
localStorage.getItem("continueButtonColor")
);
@ -80,8 +78,8 @@ function ContinueButton(props: {
</>
) : (
<>
{vscMediaUrl ? (
<img src={`${vscMediaUrl}/play_button.png`} height="18px" />
{window.vscMediaUrl ? (
<img src={`${window.vscMediaUrl}/play_button.png`} height="18px" />
) : (
<PlayIcon width="18px" height="18px" />
)}

View file

@ -6,7 +6,7 @@ import styled, { keyframes } from "styled-components";
import { defaultBorderRadius, vscBackground } from "..";
import { useWebviewListener } from "../../hooks/useWebviewListener";
import { selectSlashCommands } from "../../redux/selectors";
import { newSession } from "../../redux/slices/stateSlice";
import { newSession, setMessageAtIndex } from "../../redux/slices/stateSlice";
import { RootStore } from "../../redux/store";
import ContextItemsPeek from "./ContextItemsPeek";
import TipTapEditor from "./TipTapEditor";
@ -71,10 +71,21 @@ function ContinueInputBox(props: ContinueInputBoxProps) {
const [editorState, setEditorState] = useState(props.editorState);
useWebviewListener("newSessionWithPrompt", async (data) => {
dispatch(newSession());
setEditorState(data.prompt as any); // any -> JSONContent
});
useWebviewListener(
"newSessionWithPrompt",
async (data) => {
if (props.isMainInput) {
dispatch(newSession());
dispatch(
setMessageAtIndex({
message: { role: "user", content: data.prompt },
index: 0,
})
);
}
},
[props.isMainInput]
);
return (
<div

View file

@ -106,6 +106,20 @@ export const Mention = Node.create<MentionOptions>({
},
},
renderInlineAs: {
default: null,
parseHTML: (element) => element.getAttribute("data-renderInlineAs"),
renderHTML: (attributes) => {
if (!attributes.renderInlineAs) {
return {};
}
return {
"data-renderInlineAs": attributes.renderInlineAs,
};
},
},
query: {
default: null,
parseHTML: (element) => element.getAttribute("data-query"),

View file

@ -297,6 +297,7 @@ const MentionList = forwardRef((props: MentionListProps, ref) => {
...querySubmenuItem,
query: queryInputRef.current.value,
label: `${querySubmenuItem.label}: ${queryInputRef.current.value}`,
itemType: querySubmenuItem.type,
});
}
} else if (e.key === "Escape") {

View file

@ -118,6 +118,7 @@ export function getMentionSuggestion(
id: provider.title,
title: provider.displayTitle,
label: provider.displayTitle,
renderInlineAs: provider.renderInlineAs,
type: "contextProvider" as ComboBoxItemType,
contextProvider: provider,
}))

View file

@ -148,11 +148,12 @@ function resolveParagraph(p: JSONContent): [string, MentionAttrs[], string] {
let slashCommand = undefined;
for (const child of p.content || []) {
if (child.type === "text") {
text += child.text;
text += text === "" ? child.text.trimStart() : child.text;
} else if (child.type === "mention") {
if (!["codebase"].includes(child.attrs.id)) {
text += child.attrs.label;
}
text +=
typeof child.attrs.renderInlineAs === "string"
? child.attrs.renderInlineAs
: child.attrs.label;
contextItems.push(child.attrs);
} else if (child.type === "slashcommand") {
if (typeof slashCommand === "undefined") {

View file

@ -153,7 +153,7 @@ function CodeSnippetPreview(props: CodeSnippetPreviewProps) {
<StyledMarkdownPreview
source={`${fence}${getMarkdownLanguageTagForFile(
props.item.description
)}\n${props.item.content}\n${fence}`}
)}\n${props.item.content.trim()}\n${fence}`}
showCodeBorder={false}
/>
</div>

View file

@ -88,8 +88,6 @@ interface ModelCardProps {
}
function ModelCard(props: ModelCardProps) {
const vscMediaUrl = (window as any).vscMediaUrl;
const [dimensionChoices, setDimensionChoices] = useState<string[]>(
props.dimensions?.map((d) => Object.keys(d.options)[0]) || []
);
@ -129,9 +127,9 @@ function ModelCard(props: ModelCardProps) {
}
>
<div style={{ display: "flex", alignItems: "center" }}>
{vscMediaUrl && props.icon && (
{window.vscMediaUrl && props.icon && (
<img
src={`${vscMediaUrl}/logos/${props.icon}`}
src={`${window.vscMediaUrl}/logos/${props.icon}`}
height="24px"
style={{ marginRight: "10px" }}
/>
@ -235,9 +233,9 @@ function ModelCard(props: ModelCardProps) {
setSelectedProvider(option);
}}
>
{vscMediaUrl && info.icon && (
{window.vscMediaUrl && info.icon && (
<img
src={`${vscMediaUrl}/logos/${info.icon}`}
src={`${window.vscMediaUrl}/logos/${info.icon}`}
height="24px"
/>
)}

View file

@ -17,7 +17,7 @@ const CustomPostHogProvider = ({ children }: PropsWithChildren) => {
api_host: "https://app.posthog.com",
disable_session_recording: true,
});
posthog.identify((window as any).vscMachineId);
posthog.identify(window.vscMachineId);
posthog.opt_in_capturing();
setClient(client);
} else {

View file

@ -99,18 +99,25 @@ function useChatHandler(dispatch: Dispatch) {
input: string,
historyIndex: number
) {
const abortController = new AbortController();
const cancelToken = abortController.signal;
const modelTitle = defaultModel.title;
for await (const update of ideStreamRequest("command/run", {
input,
history: messages,
modelTitle,
slashCommandName: slashCommand.name,
contextItems,
params: slashCommand.params,
historyIndex,
})) {
for await (const update of ideStreamRequest(
"command/run",
{
input,
history: messages,
modelTitle,
slashCommandName: slashCommand.name,
contextItems,
params: slashCommand.params,
historyIndex,
},
cancelToken
)) {
if (!activeRef.current) {
abortController.abort();
break;
}
if (typeof update === "string") {
@ -129,6 +136,7 @@ function useChatHandler(dispatch: Dispatch) {
// Resolve context providers and construct new history
const [contextItems, content] = await resolveEditorContent(editorState);
console.log(contextItems, content);
const message: ChatMessage = {
role: "user",
content,

View file

@ -70,7 +70,7 @@ function useHistory(dispatch: Dispatch) {
history: stateCopy.history,
title: title,
sessionId: stateCopy.sessionId,
workspaceDirectory: (window as any).workspacePaths?.[0] || "",
workspaceDirectory: window.workspacePaths?.[0] || "",
};
return await ideRequest("history/save", sessionInfo);
}

View file

@ -2,7 +2,7 @@ import { useState } from "react";
import { parseHexColor } from "../components";
import { useWebviewListener } from "./useWebviewListener";
const hljsToTextMate = {
const hljsToTextMate: Record<string, string[]> = {
".hljs-comment": ["comment"],
".hljs-tag": ["tag"],
@ -53,7 +53,9 @@ const hljsToTextMate = {
".hljs-params": ["variable", "operator", "number"],
};
function constructTheme(tmTheme: any): any {
function constructTheme(
tmTheme: typeof window.fullColorTheme
): Record<string, string> {
const rules = tmTheme["rules"] || [];
const tokenToForeground = {};
@ -149,11 +151,11 @@ function fallbackTheme() {
export function useVscTheme() {
const [theme, setTheme] = useState<any>(
constructTheme((window as any).fullColorTheme || {})
constructTheme(window.fullColorTheme || {})
);
useWebviewListener("setTheme", async (data) => {
(window as any).fullColorTheme = data.theme;
window.fullColorTheme = data.theme;
setTheme(constructTheme(data.theme));
});

View file

@ -10,7 +10,7 @@ import { persistor, store } from "./redux/store";
(async () => {
// "" lets it pass through to the correct path for JetBrains
const onigPath = ((window as any).vscMediaUrl ?? "") + "/onigasm.wasm";
const onigPath = (window.vscMediaUrl ?? "") + "/onigasm.wasm";
const resp = await fetch(onigPath);
const onigWasm = await resp.arrayBuffer();
await loadWASM(onigWasm);

View file

@ -64,8 +64,8 @@ function TableRow({
}) {
const dispatch = useDispatch();
const navigate = useNavigate();
const apiUrl = (window as any).serverUrl;
const workspacePaths = (window as any).workspacePaths || [""];
const apiUrl = window.serverUrl;
const workspacePaths = window.workspacePaths || [""];
const [hovered, setHovered] = useState(false);
const { saveSession, deleteSession, loadSession } = useHistory(dispatch);
@ -133,8 +133,8 @@ function History() {
const [filteredAndSortedSessions, setFilteredAndSortedSessions] = useState<
SessionInfo[]
>([]);
const apiUrl = (window as any).serverUrl;
const workspacePaths = (window as any).workspacePaths || [];
const apiUrl = window.serverUrl;
const workspacePaths = window.workspacePaths || [];
const deleteSessionInUI = async (sessionId: string) => {
setSessions((prev) =>

View file

@ -71,7 +71,6 @@ function ModelConfig() {
const dispatch = useDispatch();
const navigate = useNavigate();
const vscMediaUrl = (window as any).vscMediaUrl;
const disableModelCards = useCallback(() => {
return (
@ -109,9 +108,9 @@ function ModelConfig() {
<div className="px-2">
<div style={{ display: "flex", alignItems: "center" }}>
{vscMediaUrl && modelInfo?.icon && (
{window.vscMediaUrl && modelInfo?.icon && (
<img
src={`${vscMediaUrl}/logos/${modelInfo?.icon}`}
src={`${window.vscMediaUrl}/logos/${modelInfo?.icon}`}
height="24px"
style={{ marginRight: "10px" }}
/>

View file

@ -1,12 +1,10 @@
import { createSlice } from "@reduxjs/toolkit";
import { RootStore } from "../store";
const windowAny: any = window;
export const configSlice = createSlice({
name: "config",
initialState: {
vscMachineId: windowAny.vscMachineId || undefined,
vscMachineId: window.vscMachineId || undefined,
} as RootStore["config"],
reducers: {
setVscMachineId: (

View file

@ -8,6 +8,7 @@ import {
PersistedSessionInfo,
} from "core";
import { BrowserSerializedContinueConfig } from "core/config/load";
import { stripImages } from "core/llm/countTokens";
import { v4 } from "uuid";
import { RootStore } from "../store";
@ -274,6 +275,22 @@ export const stateSlice = createSlice({
};
}
) => {
if (payload.index >= state.history.length) {
state.history.push({
message: payload.message,
editorState: {
type: "doc",
content: stripImages(payload.message.content)
.split("\n")
.map((line) => ({
type: "paragraph",
content: line === "" ? [] : [{ type: "text", text: line }],
})),
},
contextItems: [],
});
return;
}
state.history[payload.index].message = payload.message;
state.history[payload.index].contextItems = payload.contextItems || [];
},

View file

@ -15,7 +15,7 @@ declare const vscode: any;
function _postToIde(messageType: string, data: any, messageId?: string) {
if (typeof vscode === "undefined") {
if (localStorage.getItem("ide") === "jetbrains") {
if ((window as any).postIntellijMessage === undefined) {
if (window.postIntellijMessage === undefined) {
console.log(
"Unable to send message: postIntellijMessage is undefined. ",
messageType,
@ -24,7 +24,7 @@ function _postToIde(messageType: string, data: any, messageId?: string) {
throw new Error("postIntellijMessage is undefined");
}
messageId = messageId ?? uuidv4();
(window as any).postIntellijMessage?.(messageType, data, messageId);
window.postIntellijMessage?.(messageType, data, messageId);
return;
} else {
console.log(

View file

@ -479,9 +479,9 @@ const gpt4turbo: ModelPackage = {
description:
"A faster, cheaper version of GPT-4 with a longer context length",
params: {
model: "gpt-4-0125-preview",
model: "gpt-4-turbo-preview",
contextLength: 128_000,
title: "GPT-4 Turbo",
title: "gpt-4-turbo-preview",
},
providerOptions: ["openai", "freetrial"],
icon: "openai.png",

BIN
media/above-line-edit.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 MiB

BIN
media/autocomplete.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
media/image.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

BIN
media/scratch.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

2
pkg/.gitignore vendored
View file

@ -1,4 +1,4 @@
node_modules
bin
data
out
out

View file

@ -6,7 +6,7 @@
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-4-32k",
"gpt-4-1106-preview",
"gpt-4-turbo-preview",
"mistral-7b",
"llama2-7b",
"llama2-13b",