Merge branch 'main' into refactor/dpi-aware-borders
This commit is contained in:
commit
6bf2b481a8
66 changed files with 657 additions and 885 deletions
2
.github/workflows/main.yaml
vendored
2
.github/workflows/main.yaml
vendored
|
|
@ -208,7 +208,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
if: github.event.inputs.publish_build == 'true'
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.publish_build == 'true'
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
|
|
|||
2
.github/workflows/preview.yaml
vendored
2
.github/workflows/preview.yaml
vendored
|
|
@ -204,7 +204,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
if: github.event.inputs.publish_build == 'true'
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.publish_build == 'true'
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
|
|
|||
27
binary/package-lock.json
generated
27
binary/package-lock.json
generated
|
|
@ -48,11 +48,11 @@
|
|||
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
|
||||
"@aws-sdk/credential-providers": "^3.620.1",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.24",
|
||||
"@continuedev/config-yaml": "^1.0.26",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
"@modelcontextprotocol/sdk": "^1.0.0",
|
||||
"@modelcontextprotocol/sdk": "^1.4.1",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
|
|
@ -2556,9 +2556,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.6.8",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz",
|
||||
"integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
|
||||
"version": "1.7.9",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz",
|
||||
"integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.0",
|
||||
|
|
@ -3166,10 +3167,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
|
|
@ -5135,12 +5137,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/micromatch": {
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
|
||||
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
|
||||
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"braces": "^3.0.2",
|
||||
"braces": "^3.0.3",
|
||||
"picomatch": "^2.3.1"
|
||||
},
|
||||
"engines": {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import { localPathToUri } from "../util/pathToUri.js";
|
|||
|
||||
import {
|
||||
LOCAL_ONBOARDING_CHAT_MODEL,
|
||||
ONBOARDING_LOCAL_MODEL_TITLE,
|
||||
LOCAL_ONBOARDING_PROVIDER_TITLE,
|
||||
} from "./onboarding.js";
|
||||
import ControlPlaneProfileLoader from "./profile/ControlPlaneProfileLoader.js";
|
||||
import LocalProfileLoader from "./profile/LocalProfileLoader.js";
|
||||
|
|
@ -401,7 +401,7 @@ export class ConfigHandler {
|
|||
const { config } = await this.loadConfig();
|
||||
const model = config?.models.find((m) => m.title === title);
|
||||
if (!model) {
|
||||
if (title === ONBOARDING_LOCAL_MODEL_TITLE) {
|
||||
if (title === LOCAL_ONBOARDING_PROVIDER_TITLE) {
|
||||
// Special case, make calls to Ollama before we have it in the config
|
||||
const ollama = new Ollama({
|
||||
model: LOCAL_ONBOARDING_CHAT_MODEL,
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ export interface OrganizationDescription {
|
|||
id: string;
|
||||
iconUrl: string;
|
||||
name: string;
|
||||
slug: string | undefined; // TODO: This doesn't need to be undefined, just doing while transitioning the backend
|
||||
}
|
||||
|
||||
export class ProfileLifecycleManager {
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ import {
|
|||
} from "../util/paths";
|
||||
|
||||
import { ConfigResult, ConfigValidationError } from "@continuedev/config-yaml";
|
||||
import { useHub } from "../control-plane/env";
|
||||
import { localPathToUri } from "../util/pathToUri";
|
||||
import {
|
||||
defaultContextProvidersJetBrains,
|
||||
defaultContextProvidersVsCode,
|
||||
|
|
@ -70,8 +72,6 @@ import {
|
|||
defaultSlashCommandsVscode,
|
||||
} from "./default";
|
||||
import { getSystemPromptDotFile } from "./getSystemPromptDotFile";
|
||||
import { useHub } from "../control-plane/env";
|
||||
import { localPathToUri } from "../util/pathToUri";
|
||||
import { modifyContinueConfigWithSharedConfig } from "./sharedConfig";
|
||||
import { validateConfig } from "./validation.js";
|
||||
|
||||
|
|
@ -517,6 +517,8 @@ async function intermediateToFinalConfig(
|
|||
continueConfig,
|
||||
mcpId,
|
||||
abortController.signal,
|
||||
"MCP Server",
|
||||
server.faviconUrl,
|
||||
);
|
||||
if (mcpError) {
|
||||
errors.push(mcpError);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
import * as fs from "fs";
|
||||
|
||||
import * as JSONC from "comment-json";
|
||||
|
||||
import { IDE, SerializedContinueConfig } from "..";
|
||||
import { SharedConfigSchema } from "./sharedConfig";
|
||||
import { IDE } from "..";
|
||||
import { deduplicateArray } from "../util";
|
||||
import { GlobalContext } from "../util/GlobalContext";
|
||||
import { editConfigJson } from "../util/paths";
|
||||
import { resolveSerializedConfig } from "./load";
|
||||
import { deduplicateArray } from "../util";
|
||||
import { SharedConfigSchema } from "./sharedConfig";
|
||||
|
||||
/*
|
||||
This migration function eliminates deprecated values from the json file
|
||||
|
|
@ -201,10 +197,10 @@ export function migrateJsonSharedConfig(filepath: string, ide: IDE): void {
|
|||
if (effected) {
|
||||
new GlobalContext().updateSharedConfig(shareConfigUpdates);
|
||||
editConfigJson(() => config);
|
||||
void ide.showToast(
|
||||
"warning",
|
||||
"Migrated deprecated Continue JSON settings. Edit in the Settings Page",
|
||||
);
|
||||
// void ide.showToast(
|
||||
// "warning",
|
||||
// "Migrated deprecated Continue JSON settings. Edit in the Settings Page",
|
||||
// );
|
||||
}
|
||||
} catch (e) {
|
||||
throw new Error(`Migration: Failed to parse config.json: ${e}`);
|
||||
|
|
|
|||
|
|
@ -3,10 +3,12 @@ import { SerializedContinueConfig } from "../";
|
|||
import { FREE_TRIAL_MODELS } from "./default";
|
||||
|
||||
export const TRIAL_FIM_MODEL = "codestral-latest";
|
||||
export const ONBOARDING_LOCAL_MODEL_TITLE = "Ollama";
|
||||
export const LOCAL_ONBOARDING_PROVIDER_TITLE = "Ollama";
|
||||
export const LOCAL_ONBOARDING_FIM_MODEL = "qwen2.5-coder:1.5b-base";
|
||||
export const LOCAL_ONBOARDING_FIM_TITLE = "Qwen2.5-Coder 1.5B";
|
||||
export const LOCAL_ONBOARDING_CHAT_MODEL = "llama3.1:8b";
|
||||
export const LOCAL_ONBOARDING_CHAT_TITLE = "Llama 3.1 8B";
|
||||
export const LOCAL_ONBOARDING_EMBEDDINGS_MODEL = "nomic-embed-text:latest";
|
||||
|
||||
/**
|
||||
* We set the "best" chat + autocopmlete models by default
|
||||
|
|
@ -35,13 +37,13 @@ export function setupLocalConfig(
|
|||
...config.models.filter((model) => model.provider !== "free-trial"),
|
||||
],
|
||||
tabAutocompleteModel: {
|
||||
title: "Qwen2.5-Coder 1.5B",
|
||||
title: LOCAL_ONBOARDING_FIM_TITLE,
|
||||
provider: "ollama",
|
||||
model: LOCAL_ONBOARDING_FIM_MODEL,
|
||||
},
|
||||
embeddingsProvider: {
|
||||
provider: "ollama",
|
||||
model: "nomic-embed-text",
|
||||
model: LOCAL_ONBOARDING_EMBEDDINGS_MODEL,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -68,24 +70,3 @@ export function setupQuickstartConfig(
|
|||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function setupLocalConfigAfterFreeTrial(
|
||||
config: SerializedContinueConfig,
|
||||
): SerializedContinueConfig {
|
||||
return {
|
||||
...config,
|
||||
models: [
|
||||
{
|
||||
title: LOCAL_ONBOARDING_CHAT_TITLE,
|
||||
provider: "ollama",
|
||||
model: LOCAL_ONBOARDING_CHAT_MODEL,
|
||||
},
|
||||
{
|
||||
title: ONBOARDING_LOCAL_MODEL_TITLE,
|
||||
provider: "ollama",
|
||||
model: "AUTODETECT",
|
||||
},
|
||||
...config.models.filter((model) => model.provider !== "free-trial"),
|
||||
],
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import fs from "node:fs";
|
|||
import {
|
||||
AssistantUnrolled,
|
||||
ConfigResult,
|
||||
ConfigValidationError,
|
||||
parseAssistantUnrolled,
|
||||
validateConfigYaml,
|
||||
} from "@continuedev/config-yaml";
|
||||
|
|
@ -34,6 +35,7 @@ import { getSystemPromptDotFile } from "../getSystemPromptDotFile";
|
|||
import { PlatformConfigMetadata } from "../profile/PlatformProfileLoader";
|
||||
|
||||
import { slashFromCustomCommand } from "../../commands";
|
||||
import DocsContextProvider from "../../context/providers/DocsContextProvider";
|
||||
import { allTools } from "../../tools";
|
||||
import { GlobalContext } from "../../util/GlobalContext";
|
||||
import { modifyContinueConfigWithSharedConfig } from "../sharedConfig";
|
||||
|
|
@ -100,7 +102,8 @@ async function configYamlToContinueConfig(
|
|||
workOsAccessToken: string | undefined,
|
||||
platformConfigMetadata: PlatformConfigMetadata | undefined,
|
||||
allowFreeTrial: boolean = true,
|
||||
): Promise<ContinueConfig> {
|
||||
): Promise<{ config: ContinueConfig; errors: ConfigValidationError[] }> {
|
||||
const errors: ConfigValidationError[] = [];
|
||||
const continueConfig: ContinueConfig = {
|
||||
slashCommands: [
|
||||
...(await slashCommandsFromV1PromptFiles(ide)),
|
||||
|
|
@ -214,6 +217,15 @@ async function configYamlToContinueConfig(
|
|||
.filter((p) => !!p) ?? []) as IContextProvider[];
|
||||
continueConfig.contextProviders.push(...DEFAULT_CONTEXT_PROVIDERS);
|
||||
|
||||
if (
|
||||
continueConfig.docs?.length &&
|
||||
!continueConfig.contextProviders?.some(
|
||||
(cp) => cp.description.title === "docs",
|
||||
)
|
||||
) {
|
||||
continueConfig.contextProviders.push(new DocsContextProvider({}));
|
||||
}
|
||||
|
||||
// Embeddings Provider
|
||||
const embedConfig = config.models?.find((model) =>
|
||||
model.roles?.includes("embed"),
|
||||
|
|
@ -259,40 +271,51 @@ async function configYamlToContinueConfig(
|
|||
|
||||
// Apply MCP if specified
|
||||
const mcpManager = MCPManagerSingleton.getInstance();
|
||||
config.mcpServers?.forEach(async (server) => {
|
||||
const mcpId = server.name;
|
||||
const mcpConnection = mcpManager.createConnection(mcpId, {
|
||||
transport: {
|
||||
type: "stdio",
|
||||
args: [],
|
||||
...server,
|
||||
},
|
||||
});
|
||||
if (!mcpConnection) {
|
||||
return;
|
||||
}
|
||||
|
||||
const abortController = new AbortController();
|
||||
const mcpConnectionTimeout = setTimeout(
|
||||
() => abortController.abort(),
|
||||
2000,
|
||||
);
|
||||
|
||||
try {
|
||||
await mcpConnection.modifyConfig(
|
||||
continueConfig,
|
||||
mcpId,
|
||||
abortController.signal,
|
||||
);
|
||||
} catch (e: any) {
|
||||
if (e.name !== "AbortError") {
|
||||
throw e;
|
||||
await Promise.all(
|
||||
config.mcpServers?.map(async (server) => {
|
||||
const mcpId = server.name;
|
||||
const mcpConnection = mcpManager.createConnection(mcpId, {
|
||||
transport: {
|
||||
type: "stdio",
|
||||
args: [],
|
||||
...server,
|
||||
},
|
||||
});
|
||||
if (!mcpConnection) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
clearTimeout(mcpConnectionTimeout);
|
||||
});
|
||||
|
||||
return continueConfig;
|
||||
const abortController = new AbortController();
|
||||
const mcpConnectionTimeout = setTimeout(
|
||||
() => abortController.abort(),
|
||||
5000,
|
||||
);
|
||||
|
||||
try {
|
||||
const mcpError = await mcpConnection.modifyConfig(
|
||||
continueConfig,
|
||||
mcpId,
|
||||
abortController.signal,
|
||||
server.name,
|
||||
server.faviconUrl,
|
||||
);
|
||||
if (mcpError) {
|
||||
errors.push(mcpError);
|
||||
}
|
||||
} catch (e: any) {
|
||||
errors.push({
|
||||
fatal: false,
|
||||
message: `Failed to load MCP server: ${e.message}`,
|
||||
});
|
||||
if (e.name !== "AbortError") {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
clearTimeout(mcpConnectionTimeout);
|
||||
}) ?? [],
|
||||
);
|
||||
|
||||
return { config: continueConfig, errors };
|
||||
}
|
||||
|
||||
export async function loadContinueConfigFromYaml(
|
||||
|
|
@ -328,7 +351,7 @@ export async function loadContinueConfigFromYaml(
|
|||
};
|
||||
}
|
||||
|
||||
const continueConfig = await configYamlToContinueConfig(
|
||||
const { config: continueConfig, errors } = await configYamlToContinueConfig(
|
||||
configYamlResult.config,
|
||||
ide,
|
||||
ideSettings,
|
||||
|
|
@ -357,7 +380,7 @@ export async function loadContinueConfigFromYaml(
|
|||
|
||||
return {
|
||||
config: withShared,
|
||||
errors: configYamlResult.errors,
|
||||
errors: [...(configYamlResult.errors ?? []), ...errors],
|
||||
configLoadInterrupted: false,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,6 +121,8 @@ class MCPConnection {
|
|||
config: ContinueConfig,
|
||||
mcpId: string,
|
||||
signal: AbortSignal,
|
||||
name: string,
|
||||
faviconUrl: string | undefined,
|
||||
): Promise<ConfigValidationError | undefined> {
|
||||
try {
|
||||
await Promise.race([
|
||||
|
|
@ -152,6 +154,7 @@ class MCPConnection {
|
|||
title: resource.name,
|
||||
description: resource.description,
|
||||
id: resource.uri,
|
||||
icon: faviconUrl,
|
||||
}));
|
||||
|
||||
if (!config.contextProviders) {
|
||||
|
|
@ -169,19 +172,20 @@ class MCPConnection {
|
|||
if (capabilities?.tools) {
|
||||
const { tools } = await this.client.listTools({}, { signal });
|
||||
const continueTools: Tool[] = tools.map((tool: any) => ({
|
||||
displayTitle: tool.name,
|
||||
displayTitle: name + " " + tool.name,
|
||||
function: {
|
||||
description: tool.description,
|
||||
name: tool.name,
|
||||
parameters: tool.inputSchema,
|
||||
},
|
||||
faviconUrl,
|
||||
readonly: false,
|
||||
type: "function",
|
||||
wouldLikeTo: `use the ${tool.name} tool`,
|
||||
wouldLikeTo: `use the ${name} ${tool.name} tool`,
|
||||
uri: encodeMCPToolUri(mcpId, tool.name),
|
||||
}));
|
||||
|
||||
config.tools = [...config.tools, ...continueTools];
|
||||
config.tools = [...continueTools, ...config.tools];
|
||||
}
|
||||
|
||||
// Prompts <—> Slash commands
|
||||
|
|
|
|||
42
core/core.ts
42
core/core.ts
|
|
@ -11,7 +11,6 @@ import { SYSTEM_PROMPT_DOT_FILE } from "./config/getSystemPromptDotFile";
|
|||
import {
|
||||
setupBestConfig,
|
||||
setupLocalConfig,
|
||||
setupLocalConfigAfterFreeTrial,
|
||||
setupQuickstartConfig,
|
||||
} from "./config/onboarding";
|
||||
import { addContextProvider, addModel, deleteModel } from "./config/util";
|
||||
|
|
@ -53,6 +52,8 @@ import {
|
|||
type IndexingProgressUpdate,
|
||||
} from ".";
|
||||
|
||||
import CodebaseContextProvider from "./context/providers/CodebaseContextProvider";
|
||||
import CurrentFileContextProvider from "./context/providers/CurrentFileContextProvider";
|
||||
import type { FromCoreProtocol, ToCoreProtocol } from "./protocol";
|
||||
import type { IMessenger, Message } from "./protocol/messenger";
|
||||
|
||||
|
|
@ -315,7 +316,11 @@ export class Core {
|
|||
|
||||
on("controlPlane/openUrl", async (msg) => {
|
||||
const env = await getControlPlaneEnv(this.ide.getIdeSettings());
|
||||
await this.messenger.request("openUrl", `${env.APP_URL}${msg.data.path}`);
|
||||
let url = `${env.APP_URL}${msg.data.path}`;
|
||||
if (msg.data.orgSlug) {
|
||||
url += `?org=${msg.data.orgSlug}`;
|
||||
}
|
||||
await this.messenger.request("openUrl", url);
|
||||
});
|
||||
|
||||
on("controlPlane/listOrganizations", async (msg) => {
|
||||
|
|
@ -361,9 +366,17 @@ export class Core {
|
|||
}
|
||||
|
||||
const llm = await this.configHandler.llmFromTitle(selectedModelTitle);
|
||||
const provider = config.contextProviders?.find(
|
||||
(provider) => provider.description.title === name,
|
||||
);
|
||||
const provider =
|
||||
config.contextProviders?.find(
|
||||
(provider) => provider.description.title === name,
|
||||
) ??
|
||||
[
|
||||
// user doesn't need these in their config.json for the shortcuts to work
|
||||
// option+enter
|
||||
new CurrentFileContextProvider({}),
|
||||
// cmd+enter
|
||||
new CodebaseContextProvider({}),
|
||||
].find((provider) => provider.description.title === name);
|
||||
if (!provider) {
|
||||
return [];
|
||||
}
|
||||
|
|
@ -734,10 +747,6 @@ export class Core {
|
|||
editConfigJsonCallback = setupQuickstartConfig;
|
||||
break;
|
||||
|
||||
case "LocalAfterFreeTrial":
|
||||
editConfigJsonCallback = setupLocalConfigAfterFreeTrial;
|
||||
break;
|
||||
|
||||
case "Best":
|
||||
editConfigJsonCallback = setupBestConfig;
|
||||
break;
|
||||
|
|
@ -841,12 +850,18 @@ export class Core {
|
|||
|
||||
on("files/created", async ({ data }) => {
|
||||
if (data?.uris?.length) {
|
||||
this.messenger.send("refreshSubmenuItems", {
|
||||
providers: ["file"],
|
||||
});
|
||||
await this.refreshCodebaseIndexFiles(data.uris);
|
||||
}
|
||||
});
|
||||
|
||||
on("files/deleted", async ({ data }) => {
|
||||
if (data?.uris?.length) {
|
||||
this.messenger.send("refreshSubmenuItems", {
|
||||
providers: ["file"],
|
||||
});
|
||||
await this.refreshCodebaseIndexFiles(data.uris);
|
||||
}
|
||||
});
|
||||
|
|
@ -940,16 +955,23 @@ export class Core {
|
|||
const llm = await this.configHandler.llmFromTitle(selectedModelTitle);
|
||||
|
||||
const contextItems = await callTool(
|
||||
tool.uri ?? tool.function.name,
|
||||
tool,
|
||||
JSON.parse(toolCall.function.arguments || "{}"),
|
||||
{
|
||||
ide: this.ide,
|
||||
llm,
|
||||
fetch: (url, init) =>
|
||||
fetchwithRequestOptions(url, init, config.requestOptions),
|
||||
tool,
|
||||
},
|
||||
);
|
||||
|
||||
if (tool.faviconUrl) {
|
||||
contextItems.forEach((item) => {
|
||||
item.icon = tool.faviconUrl;
|
||||
});
|
||||
}
|
||||
|
||||
return { contextItems };
|
||||
});
|
||||
}
|
||||
|
|
|
|||
3
core/index.d.ts
vendored
3
core/index.d.ts
vendored
|
|
@ -859,6 +859,7 @@ export interface ToolExtras {
|
|||
ide: IDE;
|
||||
llm: ILLM;
|
||||
fetch: FetchFunction;
|
||||
tool: Tool;
|
||||
}
|
||||
|
||||
export interface Tool {
|
||||
|
|
@ -874,6 +875,7 @@ export interface Tool {
|
|||
wouldLikeTo: string;
|
||||
readonly: boolean;
|
||||
uri?: string;
|
||||
faviconUrl?: string;
|
||||
}
|
||||
|
||||
interface ToolChoice {
|
||||
|
|
@ -994,6 +996,7 @@ export type TransportOptions = StdioOptions | WebSocketOptions | SSEOptions;
|
|||
|
||||
export interface MCPOptions {
|
||||
transport: TransportOptions;
|
||||
faviconUrl?: string;
|
||||
}
|
||||
|
||||
export interface ContinueUIConfig {
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import {
|
|||
} from "./preIndexed";
|
||||
import preIndexedDocs from "./preIndexedDocs";
|
||||
import { ConfigResult } from "@continuedev/config-yaml";
|
||||
import { GlobalContext } from "../../util/GlobalContext";
|
||||
|
||||
// Purposefully lowercase because lancedb converts
|
||||
export interface LanceDbDocsRow {
|
||||
|
|
@ -210,11 +211,11 @@ export default class DocsService {
|
|||
if (isAborted) {
|
||||
return true;
|
||||
}
|
||||
// Handle indexing disabled change mid-indexing
|
||||
if (this.config.disableIndexing) {
|
||||
this.abort(startUrl);
|
||||
return true;
|
||||
}
|
||||
// // Handle indexing disabled change mid-indexing
|
||||
// if (this.config.disableIndexing) {
|
||||
// this.abort(startUrl);
|
||||
// return true;
|
||||
// }
|
||||
// Handle embeddings provider change mid-indexing
|
||||
if (this.config.embeddingsProvider.embeddingId !== startedWithEmbedder) {
|
||||
this.abort(startUrl);
|
||||
|
|
@ -276,9 +277,9 @@ export default class DocsService {
|
|||
const oldConfig = this.config;
|
||||
this.config = newConfig; // IMPORTANT - need to set up top, other methods below use this without passing it in
|
||||
|
||||
if (this.config.disableIndexing) {
|
||||
return;
|
||||
}
|
||||
// if (this.config.disableIndexing) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// No point in indexing if no docs context provider
|
||||
const hasDocsContextProvider = this.hasDocsContextProvider();
|
||||
|
|
@ -365,12 +366,12 @@ export default class DocsService {
|
|||
|
||||
async indexAndAdd(
|
||||
siteIndexingConfig: SiteIndexingConfig,
|
||||
reIndex: boolean = false,
|
||||
forceReindex: boolean = false,
|
||||
): Promise<void> {
|
||||
if (this.config.disableIndexing) {
|
||||
console.warn("Attempting to add/index docs when indexing is disabled");
|
||||
return;
|
||||
}
|
||||
// if (this.config.disableIndexing) {
|
||||
// console.warn("Attempting to add/index docs when indexing is disabled");
|
||||
// return;
|
||||
// }
|
||||
const { startUrl, useLocalCrawling, maxDepth } = siteIndexingConfig;
|
||||
|
||||
const { isPreindexed, provider } =
|
||||
|
|
@ -396,7 +397,7 @@ export default class DocsService {
|
|||
type: "docs",
|
||||
id: siteIndexingConfig.startUrl,
|
||||
embeddingsProviderId: provider.embeddingId,
|
||||
isReindexing: reIndex && indexExists,
|
||||
isReindexing: forceReindex && indexExists,
|
||||
title: siteIndexingConfig.title,
|
||||
debugInfo: `max depth: ${siteIndexingConfig.maxDepth}`,
|
||||
icon: siteIndexingConfig.faviconUrl,
|
||||
|
|
@ -405,7 +406,7 @@ export default class DocsService {
|
|||
|
||||
// Clear current indexes if reIndexing
|
||||
if (indexExists) {
|
||||
if (reIndex) {
|
||||
if (forceReindex) {
|
||||
await this.deleteIndexes(startUrl);
|
||||
} else {
|
||||
this.handleStatusUpdate({
|
||||
|
|
@ -419,6 +420,46 @@ export default class DocsService {
|
|||
}
|
||||
}
|
||||
|
||||
// If not force-reindexing and has failed with same config, don't reattempt
|
||||
if (!forceReindex) {
|
||||
const globalContext = new GlobalContext();
|
||||
const failedDocs = globalContext.get("failedDocs") ?? [];
|
||||
const hasFailed = failedDocs.find((d) =>
|
||||
this.siteIndexingConfigsAreEqual(siteIndexingConfig, d),
|
||||
);
|
||||
if (hasFailed) {
|
||||
console.log(
|
||||
`Not reattempting to index ${siteIndexingConfig.startUrl}, has already failed with same config`,
|
||||
);
|
||||
this.handleStatusUpdate({
|
||||
...fixedStatus,
|
||||
description: "Failed",
|
||||
status: "failed",
|
||||
progress: 1,
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const markFailedInGlobalContext = () => {
|
||||
const globalContext = new GlobalContext();
|
||||
const failedDocs = globalContext.get("failedDocs") ?? [];
|
||||
const newFailedDocs = failedDocs.filter(
|
||||
(d) => !this.siteIndexingConfigsAreEqual(siteIndexingConfig, d),
|
||||
);
|
||||
newFailedDocs.push(siteIndexingConfig);
|
||||
globalContext.update("failedDocs", newFailedDocs);
|
||||
};
|
||||
|
||||
const removeFromFailedGlobalContext = () => {
|
||||
const globalContext = new GlobalContext();
|
||||
const failedDocs = globalContext.get("failedDocs") ?? [];
|
||||
const newFailedDocs = failedDocs.filter(
|
||||
(d) => !this.siteIndexingConfigsAreEqual(siteIndexingConfig, d),
|
||||
);
|
||||
globalContext.update("failedDocs", newFailedDocs);
|
||||
};
|
||||
|
||||
try {
|
||||
this.docsIndexingQueue.add(startUrl);
|
||||
|
||||
|
|
@ -552,6 +593,7 @@ export default class DocsService {
|
|||
|
||||
void this.ide.showToast("info", `Failed to index ${startUrl}`);
|
||||
this.docsIndexingQueue.delete(startUrl);
|
||||
markFailedInGlobalContext();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -569,7 +611,7 @@ export default class DocsService {
|
|||
});
|
||||
|
||||
// Delete indexed docs if re-indexing
|
||||
if (reIndex && indexExists) {
|
||||
if (forceReindex && indexExists) {
|
||||
console.log("Deleting old embeddings");
|
||||
await this.deleteIndexes(startUrl);
|
||||
}
|
||||
|
|
@ -610,6 +652,8 @@ export default class DocsService {
|
|||
this.messenger?.send("refreshSubmenuItems", {
|
||||
providers: ["docs"],
|
||||
});
|
||||
|
||||
removeFromFailedGlobalContext();
|
||||
} catch (e) {
|
||||
let description = `Error getting docs from: ${siteIndexingConfig.startUrl}`;
|
||||
if (e instanceof Error) {
|
||||
|
|
@ -617,7 +661,7 @@ export default class DocsService {
|
|||
e.message.includes("github.com") &&
|
||||
e.message.includes("rate limit")
|
||||
) {
|
||||
description = "Github rate limit exceeded";
|
||||
description = "Github rate limit exceeded"; // This text is used verbatim elsewhere
|
||||
}
|
||||
}
|
||||
console.error("Error indexing docs", e);
|
||||
|
|
@ -627,6 +671,7 @@ export default class DocsService {
|
|||
status: "failed",
|
||||
progress: 1,
|
||||
});
|
||||
markFailedInGlobalContext();
|
||||
} finally {
|
||||
this.docsIndexingQueue.delete(startUrl);
|
||||
}
|
||||
|
|
@ -908,10 +953,8 @@ export default class DocsService {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
const currentStatus = this.statuses.get(doc.startUrl);
|
||||
if (currentStatus?.status !== "failed") {
|
||||
newDocs.push(doc);
|
||||
}
|
||||
newDocs.push(doc);
|
||||
void Telemetry.capture("add_docs_config", { url: doc.startUrl });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -920,10 +963,6 @@ export default class DocsService {
|
|||
...newDocs.map((doc) => this.indexAndAdd(doc)),
|
||||
]);
|
||||
|
||||
for (const doc of newDocs) {
|
||||
void Telemetry.capture("add_docs_config", { url: doc.startUrl });
|
||||
}
|
||||
|
||||
for (const doc of deletedDocs) {
|
||||
await this.deleteIndexes(doc.startUrl);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class FreeTrial extends BaseLLM {
|
|||
"llama3.1-70b",
|
||||
"gpt-4o",
|
||||
"gpt-3.5-turbo",
|
||||
"claude-3-haiku-20240307",
|
||||
"claude-3-5-haiku-latest",
|
||||
"gemini-1.5-pro-latest",
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ class OpenAI extends BaseLLM {
|
|||
body.max_completion_tokens = undefined;
|
||||
}
|
||||
|
||||
if (body.tools?.length) {
|
||||
if (body.tools?.length && !body.model?.startsWith("o3")) {
|
||||
// To ensure schema adherence: https://platform.openai.com/docs/guides/function-calling#parallel-function-calling-and-structured-outputs
|
||||
// In practice, setting this to true and asking for multiple tool calls
|
||||
// leads to "arguments" being something like '{"file": "test.ts"}{"file": "test.js"}'
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<
|
|||
},
|
||||
openai: (model) => {
|
||||
// https://platform.openai.com/docs/guides/function-calling#models-supporting-function-calling
|
||||
if (model.toLowerCase().startsWith("gpt-4")) {
|
||||
if (model.toLowerCase().startsWith("gpt-4") || model.toLowerCase().startsWith("o3")) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
15
core/package-lock.json
generated
15
core/package-lock.json
generated
|
|
@ -13,7 +13,7 @@
|
|||
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
|
||||
"@aws-sdk/credential-providers": "^3.620.1",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.24",
|
||||
"@continuedev/config-yaml": "^1.0.26",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
|
|
@ -3038,9 +3038,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-yaml": {
|
||||
"version": "1.0.24",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.24.tgz",
|
||||
"integrity": "sha512-xA4tRUh9r9p3aHIXr9zl5GQd5VygEusIc7Zw7AAFCbbl6ahMB4CDcweT8+iz0UvxJ11PLYizFSygpvxu/Yl19Q==",
|
||||
"version": "1.0.26",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.26.tgz",
|
||||
"integrity": "sha512-Fxu59+AR4S6WaoyyGysiQWVwMvQQt+pR68P1mVQGstDw4YpIghFioK0m6jXrN9vw1fJTIr6tFtcA9N41xI5mDQ==",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"yaml": "^2.6.1",
|
||||
|
|
@ -15560,9 +15560,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.21.0.tgz",
|
||||
"integrity": "sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw==",
|
||||
"version": "6.21.1",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.21.1.tgz",
|
||||
"integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.17"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
|
||||
"@aws-sdk/credential-providers": "^3.620.1",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.24",
|
||||
"@continuedev/config-yaml": "^1.0.26",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
|
|
|
|||
|
|
@ -28,12 +28,7 @@ import type {
|
|||
ToolCall,
|
||||
} from "../";
|
||||
|
||||
export type OnboardingModes =
|
||||
| "Local"
|
||||
| "Best"
|
||||
| "Custom"
|
||||
| "Quickstart"
|
||||
| "LocalAfterFreeTrial";
|
||||
export type OnboardingModes = "Local" | "Best" | "Custom" | "Quickstart";
|
||||
|
||||
export interface ListHistoryOptions {
|
||||
offset?: number;
|
||||
|
|
@ -197,6 +192,6 @@ export type ToCoreFromIdeOrWebviewProtocol = {
|
|||
{ contextItems: ContextItem[] },
|
||||
];
|
||||
"clipboardCache/add": [{ content: string }, void];
|
||||
"controlPlane/openUrl": [{ path: string }, void];
|
||||
"controlPlane/openUrl": [{ path: string; orgSlug: string | undefined }, void];
|
||||
"controlPlane/listOrganizations": [undefined, OrganizationDescription[]];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ContextItem, ToolExtras } from "..";
|
||||
import { ContextItem, Tool, ToolExtras } from "..";
|
||||
import { MCPManagerSingleton } from "../context/mcp";
|
||||
import { BuiltInToolNames } from "./builtIn";
|
||||
|
||||
|
|
@ -86,13 +86,18 @@ async function callToolFromUri(
|
|||
throw new Error(`Failed to call tool: ${toolName}`);
|
||||
}
|
||||
|
||||
return (response.content as any).map((item: any) => {
|
||||
return (response.content as any).map((item: any): ContextItem => {
|
||||
if (item.type !== "text") {
|
||||
throw new Error(
|
||||
`Continue received item of type "${item.type}" from MCP tool, but currently only supports "text".`,
|
||||
);
|
||||
}
|
||||
return { name: toolName, description: toolName, content: item.text };
|
||||
return {
|
||||
name: extras.tool.displayTitle,
|
||||
description: "Tool output",
|
||||
content: item.text,
|
||||
icon: extras.tool.faviconUrl,
|
||||
};
|
||||
});
|
||||
|
||||
default:
|
||||
|
|
@ -101,10 +106,12 @@ async function callToolFromUri(
|
|||
}
|
||||
|
||||
export async function callTool(
|
||||
uri: string,
|
||||
tool: Tool,
|
||||
args: any,
|
||||
extras: ToolExtras,
|
||||
): Promise<ContextItem[]> {
|
||||
const uri = tool.uri ?? tool.function.name;
|
||||
|
||||
switch (uri) {
|
||||
case BuiltInToolNames.ReadFile:
|
||||
return await readFileImpl(args, extras);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import {
|
|||
} from "../config/sharedConfig";
|
||||
|
||||
import { getGlobalContextFilePath } from "./paths";
|
||||
import { SiteIndexingConfig } from "..";
|
||||
|
||||
export type GlobalContextType = {
|
||||
indexingPaused: boolean;
|
||||
|
|
@ -27,6 +28,7 @@ export type GlobalContextType = {
|
|||
showConfigUpdateToast: boolean;
|
||||
isSupportedLanceDbCpuTarget: boolean;
|
||||
sharedConfig: SharedConfigSchema;
|
||||
failedDocs: SiteIndexingConfig[];
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -450,8 +450,8 @@ class CustomPanel(
|
|||
val rightButton =
|
||||
CustomButton("⏎ Enter") { onEnter() }
|
||||
.apply {
|
||||
background = JBColor(0x999998, 0x999998)
|
||||
foreground = JBColor(0xF5F5F5, 0xF5F5F5)
|
||||
background = globalScheme.defaultForeground
|
||||
foreground = globalScheme.defaultBackground
|
||||
border = JBUI.Borders.empty(2, 6)
|
||||
}
|
||||
|
||||
|
|
|
|||
56
extensions/vscode/package-lock.json
generated
56
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.9.260",
|
||||
"version": "0.9.262",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.9.260",
|
||||
"version": "0.9.262",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/fetch": "^1.0.3",
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
"socket.io-client": "^4.7.2",
|
||||
"strip-ansi": "^7.1.0",
|
||||
"svg-builder": "^2.0.0",
|
||||
"systeminformation": "^5.22.10",
|
||||
"systeminformation": "^5.23.7",
|
||||
"tailwindcss": "^3.3.2",
|
||||
"undici": "^6.2.0",
|
||||
"uuid": "^9.0.1",
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
|
||||
"@aws-sdk/credential-providers": "^3.620.1",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.23",
|
||||
"@continuedev/config-yaml": "^1.0.26",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
|
|
@ -5735,9 +5735,10 @@
|
|||
"integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw=="
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "4.21.1",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz",
|
||||
"integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==",
|
||||
"version": "4.21.2",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
|
||||
"integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "~1.3.8",
|
||||
"array-flatten": "1.1.1",
|
||||
|
|
@ -5758,7 +5759,7 @@
|
|||
"methods": "~1.1.2",
|
||||
"on-finished": "2.4.1",
|
||||
"parseurl": "~1.3.3",
|
||||
"path-to-regexp": "0.1.10",
|
||||
"path-to-regexp": "0.1.12",
|
||||
"proxy-addr": "~2.0.7",
|
||||
"qs": "6.13.0",
|
||||
"range-parser": "~1.2.1",
|
||||
|
|
@ -5773,6 +5774,10 @@
|
|||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/express/node_modules/debug": {
|
||||
|
|
@ -9098,15 +9103,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.7",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
|
||||
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||
"version": "3.3.8",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
|
||||
"integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
|
|
@ -10059,9 +10065,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "0.1.10",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
|
||||
"integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w=="
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
|
||||
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/path-type": {
|
||||
"version": "4.0.0",
|
||||
|
|
@ -12168,9 +12175,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/systeminformation": {
|
||||
"version": "5.23.5",
|
||||
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.23.5.tgz",
|
||||
"integrity": "sha512-PEpJwhRYxZgBCAlWZhWIgfMTjXLqfcaZ1pJsJn9snWNfBW/Z1YQg1mbIUSWrEV3ErAHF7l/OoVLQeaZDlPzkpA==",
|
||||
"version": "5.25.11",
|
||||
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.25.11.tgz",
|
||||
"integrity": "sha512-jI01fn/t47rrLTQB0FTlMCC+5dYx8o0RRF+R4BPiUNsvg5OdY0s9DKMFmJGrx5SwMZQ4cag0Gl6v8oycso9b/g==",
|
||||
"license": "MIT",
|
||||
"os": [
|
||||
"darwin",
|
||||
"linux",
|
||||
|
|
@ -12911,9 +12919,10 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "6.20.1",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.20.1.tgz",
|
||||
"integrity": "sha512-AjQF1QsmqfJys+LXfGTNum+qw4S88CojRInG/6t31W/1fk6G59s92bnAvGz5Cmur+kQv2SURXEvvudLmbrE8QA==",
|
||||
"version": "6.21.1",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.21.1.tgz",
|
||||
"integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.17"
|
||||
}
|
||||
|
|
@ -13309,10 +13318,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "4.5.5",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.5.tgz",
|
||||
"integrity": "sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==",
|
||||
"version": "4.5.9",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.9.tgz",
|
||||
"integrity": "sha512-qK9W4xjgD3gXbC0NmdNFFnVFLMWSNiR3swj957yutwzzN16xF/E7nmtAyp1rT9hviDroQANjE4HK3H4WqWdFtw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.18.10",
|
||||
"postcss": "^8.4.27",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "continue",
|
||||
"icon": "media/icon.png",
|
||||
"author": "Continue Dev, Inc",
|
||||
"version": "0.9.261",
|
||||
"version": "0.9.262",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/continuedev/continue"
|
||||
|
|
@ -624,7 +624,7 @@
|
|||
"e2e:build": "npm --prefix ../../gui run build && npm run package",
|
||||
"e2e:create-storage": "mkdir -p ./e2e/storage",
|
||||
"e2e:get-chromedriver": "extest get-chromedriver --storage ./e2e/storage",
|
||||
"e2e:get-vscode": "extest get-vscode --storage ./e2e/storage",
|
||||
"e2e:get-vscode": "CODE_VERSION=\"1.95.0\" extest get-vscode --storage ./e2e/storage",
|
||||
"e2e:sign-vscode": "codesign --entitlements entitlements.plist --deep --force -s - './e2e/storage/Visual Studio Code.app'",
|
||||
"e2e:copy-vsix": "chmod +x ./e2e/get-latest-vsix.sh && bash ./e2e/get-latest-vsix.sh",
|
||||
"e2e:install-vsix": "extest install-vsix -f ./e2e/vsix/continue.vsix --extensions_dir ./e2e/.test-extensions --storage ./e2e/storage",
|
||||
|
|
@ -711,7 +711,7 @@
|
|||
"socket.io-client": "^4.7.2",
|
||||
"strip-ansi": "^7.1.0",
|
||||
"svg-builder": "^2.0.0",
|
||||
"systeminformation": "^5.22.10",
|
||||
"systeminformation": "^5.23.7",
|
||||
"tailwindcss": "^3.3.2",
|
||||
"undici": "^6.2.0",
|
||||
"uuid": "^9.0.1",
|
||||
|
|
|
|||
61
gui/package-lock.json
generated
61
gui/package-lock.json
generated
|
|
@ -7,7 +7,7 @@
|
|||
"name": "gui",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-yaml": "^1.0.23",
|
||||
"@continuedev/config-yaml": "^1.0.26",
|
||||
"@headlessui/react": "^1.7.17",
|
||||
"@heroicons/react": "^2.0.18",
|
||||
"@reduxjs/toolkit": "^2.3.0",
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
"redux-persist-transform-filter": "^0.0.22",
|
||||
"redux-thunk": "^3.1.0",
|
||||
"rehype-highlight": "^7.0.0",
|
||||
"rehype-katex": "^7.0.0",
|
||||
"rehype-katex": "^7.0.1",
|
||||
"rehype-wrap-all": "^1.1.0",
|
||||
"remark-math": "^6.0.0",
|
||||
"reselect": "^5.1.1",
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
|
||||
"@aws-sdk/credential-providers": "^3.620.1",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.23",
|
||||
"@continuedev/config-yaml": "^1.0.26",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
|
|
@ -556,9 +556,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-yaml": {
|
||||
"version": "1.0.23",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.23.tgz",
|
||||
"integrity": "sha512-F2Hwc85iCwAHJuwJALOsmZIBeHdF+87mS0YT7dlC6QiE+zAhZKUHcLQ/nTt9bJuhyVyufpb9LApkp40UdGsaWw==",
|
||||
"version": "1.0.26",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.26.tgz",
|
||||
"integrity": "sha512-Fxu59+AR4S6WaoyyGysiQWVwMvQQt+pR68P1mVQGstDw4YpIghFioK0m6jXrN9vw1fJTIr6tFtcA9N41xI5mDQ==",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"yaml": "^2.6.1",
|
||||
|
|
@ -3871,10 +3871,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/bin-version/node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
|
|
@ -5756,10 +5757,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/foreground-child/node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
|
|
@ -7595,13 +7597,14 @@
|
|||
}
|
||||
},
|
||||
"node_modules/katex": {
|
||||
"version": "0.16.11",
|
||||
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.11.tgz",
|
||||
"integrity": "sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ==",
|
||||
"version": "0.16.21",
|
||||
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.21.tgz",
|
||||
"integrity": "sha512-XvqR7FgOHtWupfMiigNzmh+MgUVmDGU2kXZm899ZkPfcuoPuFxyHmXsgATDpFZDAXCI8tvinaVcDo8PIIJSo4A==",
|
||||
"funding": [
|
||||
"https://opencollective.com/katex",
|
||||
"https://github.com/sponsors/katex"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "^8.3.0"
|
||||
},
|
||||
|
|
@ -8610,9 +8613,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.7",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
|
||||
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||
"version": "3.3.8",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
|
||||
"integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -8620,6 +8623,7 @@
|
|||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
|
|
@ -12198,10 +12202,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "4.5.5",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.5.tgz",
|
||||
"integrity": "sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==",
|
||||
"version": "4.5.9",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.9.tgz",
|
||||
"integrity": "sha512-qK9W4xjgD3gXbC0NmdNFFnVFLMWSNiR3swj957yutwzzN16xF/E7nmtAyp1rT9hviDroQANjE4HK3H4WqWdFtw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.18.10",
|
||||
"postcss": "^8.4.27",
|
||||
|
|
@ -12699,10 +12704,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/vite-node/node_modules/vite": {
|
||||
"version": "5.4.9",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.9.tgz",
|
||||
"integrity": "sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==",
|
||||
"version": "5.4.14",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.14.tgz",
|
||||
"integrity": "sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.21.3",
|
||||
"postcss": "^8.4.43",
|
||||
|
|
@ -13274,10 +13280,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/vitest/node_modules/vite": {
|
||||
"version": "5.4.9",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.9.tgz",
|
||||
"integrity": "sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==",
|
||||
"version": "5.4.14",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.14.tgz",
|
||||
"integrity": "sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.21.3",
|
||||
"postcss": "^8.4.43",
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
"test:watch": "vitest"
|
||||
},
|
||||
"dependencies": {
|
||||
"@continuedev/config-yaml": "^1.0.23",
|
||||
"@continuedev/config-yaml": "^1.0.26",
|
||||
"@headlessui/react": "^1.7.17",
|
||||
"@heroicons/react": "^2.0.18",
|
||||
"@reduxjs/toolkit": "^2.3.0",
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
"redux-persist-transform-filter": "^0.0.22",
|
||||
"redux-thunk": "^3.1.0",
|
||||
"rehype-highlight": "^7.0.0",
|
||||
"rehype-katex": "^7.0.0",
|
||||
"rehype-katex": "^7.0.1",
|
||||
"rehype-wrap-all": "^1.1.0",
|
||||
"remark-math": "^6.0.0",
|
||||
"reselect": "^5.1.1",
|
||||
|
|
|
|||
|
|
@ -53,19 +53,6 @@ export default function AccountDialog() {
|
|||
);
|
||||
}
|
||||
|
||||
if (!controlServerBetaEnabled) {
|
||||
return (
|
||||
<div className="p-4 pt-0">
|
||||
<h1 className="mb-1 text-2xl">Account</h1>
|
||||
<p>
|
||||
Continue For Teams is not enabled. You can enable it in your IDE
|
||||
settings.
|
||||
</p>
|
||||
<p>Using local config.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const changeProfileId = (id: string) => {
|
||||
|
|
@ -82,60 +69,63 @@ export default function AccountDialog() {
|
|||
"Signed in"
|
||||
) : (
|
||||
<>
|
||||
Signed in as{" "}
|
||||
<span className="italic">{session.account.label}</span>
|
||||
Signed in as <span className="italic">{session.account.id}</span>
|
||||
</>
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="w-full">
|
||||
<span className="mb-1 block text-sm">Current workspace</span>
|
||||
{controlServerBetaEnabled && (
|
||||
<div className="w-full">
|
||||
<span className="mb-1 block text-sm">Current workspace</span>
|
||||
|
||||
<Listbox value={"local"} onChange={changeProfileId}>
|
||||
{({ open }) => (
|
||||
<div className="relative w-full">
|
||||
<Listbox.Button className="border-vsc-input-border bg-vsc-background hover:bg-vsc-input-background text-vsc-foreground relative m-0 flex w-full cursor-pointer items-center justify-between rounded-md border border-solid px-3 py-2 text-left">
|
||||
<span className="lines lines-1">{selectedProfile?.title}</span>
|
||||
<div className="pointer-events-none flex items-center">
|
||||
<ChevronUpDownIcon className="h-5 w-5" aria-hidden="true" />
|
||||
</div>
|
||||
</Listbox.Button>
|
||||
<Listbox value={"local"} onChange={changeProfileId}>
|
||||
{({ open }) => (
|
||||
<div className="relative w-full">
|
||||
<Listbox.Button className="border-vsc-input-border bg-vsc-background hover:bg-vsc-input-background text-vsc-foreground relative m-0 flex w-full cursor-pointer items-center justify-between rounded-md border border-solid px-3 py-2 text-left">
|
||||
<span className="lines lines-1">
|
||||
{selectedProfile?.title}
|
||||
</span>
|
||||
<div className="pointer-events-none flex items-center">
|
||||
<ChevronUpDownIcon className="h-5 w-5" aria-hidden="true" />
|
||||
</div>
|
||||
</Listbox.Button>
|
||||
|
||||
<Transition
|
||||
as={Fragment}
|
||||
show={open}
|
||||
enter="transition ease-out duration-100"
|
||||
enterFrom="transform opacity-0 scale-95"
|
||||
enterTo="transform opacity-100 scale-100"
|
||||
leave="transition ease-in duration-75"
|
||||
leaveFrom="transform opacity-100 scale-100"
|
||||
leaveTo="transform opacity-0 scale-95"
|
||||
>
|
||||
<Listbox.Options className="bg-vsc-background max-h-80vh absolute mt-0.5 w-full overflow-y-scroll rounded-sm p-0">
|
||||
{profiles.map((option, idx) => (
|
||||
<StyledListboxOption
|
||||
key={idx}
|
||||
selected={selectedProfile?.id === option.id}
|
||||
value={option.id}
|
||||
className="w-full"
|
||||
>
|
||||
<span className="lines lines-1 relative flex h-5 items-center justify-between gap-3 pr-2 text-xs">
|
||||
{option.title}
|
||||
</span>
|
||||
</StyledListboxOption>
|
||||
))}
|
||||
{profiles.length === 0 && (
|
||||
<div className="px-4 py-2">
|
||||
<i>No workspaces found</i>
|
||||
</div>
|
||||
)}
|
||||
</Listbox.Options>
|
||||
</Transition>
|
||||
</div>
|
||||
)}
|
||||
</Listbox>
|
||||
</div>
|
||||
<Transition
|
||||
as={Fragment}
|
||||
show={open}
|
||||
enter="transition ease-out duration-100"
|
||||
enterFrom="transform opacity-0 scale-95"
|
||||
enterTo="transform opacity-100 scale-100"
|
||||
leave="transition ease-in duration-75"
|
||||
leaveFrom="transform opacity-100 scale-100"
|
||||
leaveTo="transform opacity-0 scale-95"
|
||||
>
|
||||
<Listbox.Options className="bg-vsc-background max-h-80vh absolute mt-0.5 w-full overflow-y-scroll rounded-sm p-0">
|
||||
{profiles.map((option, idx) => (
|
||||
<StyledListboxOption
|
||||
key={idx}
|
||||
selected={selectedProfile?.id === option.id}
|
||||
value={option.id}
|
||||
className="w-full"
|
||||
>
|
||||
<span className="lines lines-1 relative flex h-5 items-center justify-between gap-3 pr-2 text-xs">
|
||||
{option.title}
|
||||
</span>
|
||||
</StyledListboxOption>
|
||||
))}
|
||||
{profiles.length === 0 && (
|
||||
<div className="px-4 py-2">
|
||||
<i>No workspaces found</i>
|
||||
</div>
|
||||
)}
|
||||
</Listbox.Options>
|
||||
</Transition>
|
||||
</div>
|
||||
)}
|
||||
</Listbox>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="flex w-full justify-end gap-2">
|
||||
<SecondaryButton className="w-auto" onClick={logout}>
|
||||
|
|
|
|||
|
|
@ -2,29 +2,29 @@ import { useEffect, useMemo } from "react";
|
|||
import { Outlet, useLocation, useNavigate } from "react-router-dom";
|
||||
import styled from "styled-components";
|
||||
import { CustomScrollbarDiv, defaultBorderRadius } from ".";
|
||||
import { AuthProvider } from "../context/Auth";
|
||||
import { useWebviewListener } from "../hooks/useWebviewListener";
|
||||
import { useAppDispatch, useAppSelector } from "../redux/hooks";
|
||||
import { setEditStatus, focusEdit } from "../redux/slices/editModeState";
|
||||
import { setDialogMessage, setShowDialog } from "../redux/slices/uiSlice";
|
||||
import { focusEdit, setEditStatus } from "../redux/slices/editModeState";
|
||||
import {
|
||||
addCodeToEdit,
|
||||
updateApplyState,
|
||||
setMode,
|
||||
newSession,
|
||||
selectIsInEditMode,
|
||||
setMode,
|
||||
updateApplyState,
|
||||
} from "../redux/slices/sessionSlice";
|
||||
import { setDialogMessage, setShowDialog } from "../redux/slices/uiSlice";
|
||||
import { exitEditMode } from "../redux/thunks";
|
||||
import { loadLastSession, saveCurrentSession } from "../redux/thunks/session";
|
||||
import { getFontSize, isMetaEquivalentKeyPressed } from "../util";
|
||||
import { incrementFreeTrialCount } from "../util/freeTrial";
|
||||
import { ROUTES } from "../util/navigation";
|
||||
import AccountDialog from "./AccountDialog";
|
||||
import TextDialog from "./dialogs";
|
||||
import Footer from "./Footer";
|
||||
import { isNewUserOnboarding, useOnboardingCard } from "./OnboardingCard";
|
||||
import PostHogPageView from "./PosthogPageView";
|
||||
import AccountDialog from "./AccountDialog";
|
||||
import { AuthProvider } from "../context/Auth";
|
||||
import { exitEditMode } from "../redux/thunks";
|
||||
import { loadLastSession, saveCurrentSession } from "../redux/thunks/session";
|
||||
import { incrementFreeTrialCount } from "../util/freeTrial";
|
||||
import OSRContextMenu from "./OSRContextMenu";
|
||||
import PostHogPageView from "./PosthogPageView";
|
||||
|
||||
const LayoutTopDiv = styled(CustomScrollbarDiv)`
|
||||
height: 100%;
|
||||
|
|
@ -64,6 +64,7 @@ const Layout = () => {
|
|||
await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: true,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
dispatch(exitEditMode());
|
||||
|
|
@ -87,6 +88,7 @@ const Layout = () => {
|
|||
await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: true,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
dispatch(exitEditMode());
|
||||
|
|
@ -170,6 +172,8 @@ const Layout = () => {
|
|||
await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: false,
|
||||
// Because this causes a lag before Edit mode is focused. TODO just have that happen in background
|
||||
generateTitle: false,
|
||||
}),
|
||||
);
|
||||
dispatch(newSession());
|
||||
|
|
@ -185,6 +189,7 @@ const Layout = () => {
|
|||
await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: true,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
dispatch(focusEdit());
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import { Button, Input, InputSubtext, lightGray } from "../..";
|
|||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { models } from "../../../pages/AddNewModel/configs/models";
|
||||
import { providers } from "../../../pages/AddNewModel/configs/providers";
|
||||
import AddModelButtonSubtext from "../../AddModelButtonSubtext";
|
||||
import { setDefaultModel } from "../../../redux/slices/configSlice";
|
||||
import AddModelButtonSubtext from "../../AddModelButtonSubtext";
|
||||
|
||||
const { anthropic, mistral } = providers;
|
||||
const chatProvider = anthropic!;
|
||||
|
|
@ -14,7 +14,7 @@ const autocompleteProvider = mistral!;
|
|||
|
||||
const {
|
||||
claude35Sonnet: chatModel,
|
||||
claude3Haiku: repoMapModel,
|
||||
claude35Haiku: repoMapModel,
|
||||
codestral: autocompleteModel,
|
||||
} = models;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ interface OllamaCompletedStepProps {
|
|||
function OllamaCompletedStep({ text }: OllamaCompletedStepProps) {
|
||||
return (
|
||||
<div className="flex items-center justify-between">
|
||||
<p className="mr-1 w-3/4 truncate font-mono text-sm">{text}</p>
|
||||
<p className="lines mr-1 w-3/4 font-mono text-sm leading-none">{text}</p>
|
||||
<CheckCircleIcon width={24} height={24} className="text-emerald-600" />
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@ function OllamaModelDownload({
|
|||
|
||||
return (
|
||||
<div className="flex flex-col">
|
||||
<p className="mb-2 text-lg font-bold leading-tight">{title}</p>
|
||||
<p className="mb-1 mt-4 text-base font-semibold sm:text-lg">{title}</p>
|
||||
{hasDownloaded ? (
|
||||
<OllamaCompletedStep text={command} />
|
||||
) : (
|
||||
<>
|
||||
<StyledActionButton data-tooltip-id={id} onClick={onClick}>
|
||||
<p className="truncate font-mono text-xs">{command}</p>
|
||||
<p className="lines m-0 px-0 py-2 font-mono text-xs">{command}</p>
|
||||
<CommandLineIcon width={24} height={24} />
|
||||
</StyledActionButton>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import {
|
|||
ArrowPathIcon,
|
||||
ArrowTopRightOnSquareIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { useState, useContext } from "react";
|
||||
import { useState, useContext, useEffect } from "react";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { providers } from "../../../pages/AddNewModel/configs/providers";
|
||||
import { StyledActionButton } from "../..";
|
||||
|
|
@ -19,10 +19,15 @@ export function OllamaStatus({ isOllamaConnected }: OllamaStatusProps) {
|
|||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
|
||||
const [status, setStatus] = useState<OllamaConnectionStatuses>(
|
||||
isOllamaConnected
|
||||
? OllamaConnectionStatuses.Connected
|
||||
: OllamaConnectionStatuses.WaitingToDownload,
|
||||
OllamaConnectionStatuses.WaitingToDownload,
|
||||
);
|
||||
useEffect(() => {
|
||||
if (isOllamaConnected) {
|
||||
setStatus(OllamaConnectionStatuses.Connected);
|
||||
} else if (status !== OllamaConnectionStatuses.Downloading) {
|
||||
setStatus(OllamaConnectionStatuses.WaitingToDownload);
|
||||
}
|
||||
}, [status, isOllamaConnected]);
|
||||
|
||||
function onClickDownload() {
|
||||
ideMessenger.post("openUrl", downloadUrl);
|
||||
|
|
@ -33,14 +38,14 @@ export function OllamaStatus({ isOllamaConnected }: OllamaStatusProps) {
|
|||
case OllamaConnectionStatuses.WaitingToDownload:
|
||||
return (
|
||||
<StyledActionButton onClick={onClickDownload}>
|
||||
<p className="mr-1 text-sm underline">{downloadUrl}</p>
|
||||
<p className="lines lines-1 mr-1 text-sm underline">{downloadUrl}</p>
|
||||
<ArrowTopRightOnSquareIcon width={24} height={24} />
|
||||
</StyledActionButton>
|
||||
);
|
||||
case OllamaConnectionStatuses.Downloading:
|
||||
return (
|
||||
<div className="flex items-center justify-between">
|
||||
<p className="mr-1 w-3/4 font-mono text-sm">
|
||||
<p className="lines mr-1 w-3/4 font-mono text-sm">
|
||||
Checking for connection to Ollama at http://localhost:11434
|
||||
</p>
|
||||
<ArrowPathIcon className="animate-spin-slow mr-1 h-4 w-4" />
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ export function PlatformOnboardingCard({ isDialog }: OnboardingCardProps) {
|
|||
isDialog={isDialog}
|
||||
/>
|
||||
) : (
|
||||
<div className="mt-4">
|
||||
<div className="mt-4 flex flex-col">
|
||||
<Alert type="info">
|
||||
By choosing this option, Continue will be configured by a local{" "}
|
||||
<code>config.yaml</code> file. If you're just looking to use
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { ChevronRightIcon } from "@heroicons/react/24/outline";
|
||||
import { useContext } from "react";
|
||||
import { Button, ButtonSubtext } from "../../..";
|
||||
import { useAuth } from "../../../../context/Auth";
|
||||
import { IdeMessengerContext } from "../../../../context/IdeMessenger";
|
||||
import { hasPassedFTL } from "../../../../util/freeTrial";
|
||||
import ContinueLogo from "../../../gui/ContinueLogo";
|
||||
import { useOnboardingCard } from "../../hooks";
|
||||
import { hasPassedFTL } from "../../../../util/freeTrial";
|
||||
import { useContext } from "react";
|
||||
import { IdeMessengerContext } from "../../../../context/IdeMessenger";
|
||||
|
||||
export default function MainTab({
|
||||
onRemainLocal,
|
||||
|
|
@ -29,6 +29,7 @@ export default function MainTab({
|
|||
function openPastFreeTrialOnboarding() {
|
||||
ideMessenger.post("controlPlane/openUrl", {
|
||||
path: "setup-models",
|
||||
orgSlug: auth.selectedOrganization?.slug,
|
||||
});
|
||||
onboardingCard.close(isDialog);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import {
|
||||
LOCAL_ONBOARDING_CHAT_MODEL,
|
||||
LOCAL_ONBOARDING_CHAT_TITLE,
|
||||
LOCAL_ONBOARDING_EMBEDDINGS_MODEL,
|
||||
LOCAL_ONBOARDING_FIM_MODEL,
|
||||
ONBOARDING_LOCAL_MODEL_TITLE,
|
||||
LOCAL_ONBOARDING_PROVIDER_TITLE,
|
||||
} from "core/config/onboarding";
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { Button } from "../..";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { hasPassedFTL } from "../../../util/freeTrial";
|
||||
import AddModelButtonSubtext from "../../AddModelButtonSubtext";
|
||||
import OllamaModelDownload from "../components/OllamaModelDownload";
|
||||
import { OllamaStatus } from "../components/OllamaStatus";
|
||||
|
|
@ -25,10 +25,7 @@ interface OnboardingLocalTabProps {
|
|||
function OnboardingLocalTab({ isDialog }: OnboardingLocalTabProps) {
|
||||
const dispatch = useDispatch();
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
const { submitOnboarding } = useSubmitOnboarding(
|
||||
hasPassedFTL() ? "LocalAfterFreeTrial" : "Local",
|
||||
isDialog,
|
||||
);
|
||||
const { submitOnboarding } = useSubmitOnboarding("Local", isDialog);
|
||||
const [hasLoadedChatModel, setHasLoadedChatModel] = useState(false);
|
||||
const [downloadedOllamaModels, setDownloadedOllamaModels] = useState<
|
||||
string[]
|
||||
|
|
@ -37,17 +34,28 @@ function OnboardingLocalTab({ isDialog }: OnboardingLocalTabProps) {
|
|||
const [isOllamaConnected, setIsOllamaConnected] = useState(false);
|
||||
|
||||
const hasDownloadedChatModel = Array.isArray(downloadedOllamaModels)
|
||||
? downloadedOllamaModels.some((ollamaModel) =>
|
||||
ollamaModel.startsWith(LOCAL_ONBOARDING_CHAT_MODEL),
|
||||
? downloadedOllamaModels.some(
|
||||
(ollamaModel) => ollamaModel === LOCAL_ONBOARDING_CHAT_MODEL,
|
||||
)
|
||||
: false;
|
||||
|
||||
const hasDownloadedAutocompleteModel = Array.isArray(downloadedOllamaModels)
|
||||
? downloadedOllamaModels.some((ollamaModel) =>
|
||||
ollamaModel.startsWith(LOCAL_ONBOARDING_CHAT_MODEL),
|
||||
? downloadedOllamaModels.some(
|
||||
(ollamaModel) => ollamaModel === LOCAL_ONBOARDING_FIM_MODEL,
|
||||
)
|
||||
: false;
|
||||
|
||||
const hasDownloadedEmbeddingsModel = Array.isArray(downloadedOllamaModels)
|
||||
? downloadedOllamaModels.some(
|
||||
(ollamaModel) => ollamaModel === LOCAL_ONBOARDING_EMBEDDINGS_MODEL,
|
||||
)
|
||||
: false;
|
||||
|
||||
const allDownloaded =
|
||||
hasDownloadedAutocompleteModel &&
|
||||
hasDownloadedChatModel &&
|
||||
hasDownloadedEmbeddingsModel;
|
||||
|
||||
/**
|
||||
* The first time we detect that a chat model has been loaded,
|
||||
* we send an empty request to load it
|
||||
|
|
@ -57,7 +65,7 @@ function OnboardingLocalTab({ isDialog }: OnboardingLocalTabProps) {
|
|||
ideMessenger.post("llm/complete", {
|
||||
completionOptions: {},
|
||||
prompt: "",
|
||||
title: ONBOARDING_LOCAL_MODEL_TITLE,
|
||||
title: LOCAL_ONBOARDING_PROVIDER_TITLE,
|
||||
});
|
||||
|
||||
setHasLoadedChatModel(true);
|
||||
|
|
@ -68,18 +76,11 @@ function OnboardingLocalTab({ isDialog }: OnboardingLocalTabProps) {
|
|||
const fetchDownloadedModels = async () => {
|
||||
try {
|
||||
const result = await ideMessenger.request("llm/listModels", {
|
||||
title: ONBOARDING_LOCAL_MODEL_TITLE,
|
||||
title: LOCAL_ONBOARDING_PROVIDER_TITLE,
|
||||
});
|
||||
if (result.status === "success") {
|
||||
// TODO - temporary fix, see notes
|
||||
// https://github.com/continuedev/continue/pull/3059
|
||||
if (Array.isArray(result.content)) {
|
||||
setDownloadedOllamaModels(result.content);
|
||||
setIsOllamaConnected(true);
|
||||
} else {
|
||||
setDownloadedOllamaModels([]);
|
||||
setIsOllamaConnected(false);
|
||||
}
|
||||
setDownloadedOllamaModels(result.content ?? []);
|
||||
setIsOllamaConnected(!!result.content);
|
||||
} else {
|
||||
throw new Error("Failed to fetch models");
|
||||
}
|
||||
|
|
@ -100,9 +101,9 @@ function OnboardingLocalTab({ isDialog }: OnboardingLocalTabProps) {
|
|||
}, []);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="mt-3 flex flex-col gap-1 px-2">
|
||||
<div className="flex flex-col">
|
||||
<p className="mb-2 text-lg font-bold leading-tight">Install Ollama</p>
|
||||
<p className="mb-0 text-lg font-bold leading-tight">Install Ollama</p>
|
||||
<OllamaStatus isOllamaConnected={isOllamaConnected} />
|
||||
</div>
|
||||
|
||||
|
|
@ -118,6 +119,12 @@ function OnboardingLocalTab({ isDialog }: OnboardingLocalTabProps) {
|
|||
hasDownloaded={hasDownloadedAutocompleteModel}
|
||||
/>
|
||||
|
||||
<OllamaModelDownload
|
||||
title="Download Embeddings model"
|
||||
modelName={LOCAL_ONBOARDING_EMBEDDINGS_MODEL}
|
||||
hasDownloaded={hasDownloadedEmbeddingsModel}
|
||||
/>
|
||||
|
||||
<div className="mt-4 w-full">
|
||||
<Button
|
||||
onClick={() => {
|
||||
|
|
@ -137,7 +144,7 @@ function OnboardingLocalTab({ isDialog }: OnboardingLocalTabProps) {
|
|||
);
|
||||
}}
|
||||
className="w-full"
|
||||
disabled={!hasDownloadedChatModel}
|
||||
disabled={!allDownloaded}
|
||||
>
|
||||
Connect
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export default function PageHeader({
|
|||
rightContent,
|
||||
}: PageHeaderProps) {
|
||||
return (
|
||||
<div className="bg-vsc-background sticky top-0 z-20 m-0 flex items-center justify-between border-0 border-b border-solid border-b-zinc-700 bg-inherit pb-1">
|
||||
<div className="bg-vsc-background sticky top-0 z-20 m-0 flex items-center justify-between border-b-zinc-700 bg-inherit py-0.5">
|
||||
<div className="flex items-center">
|
||||
{title && (
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -1,271 +0,0 @@
|
|||
import { Listbox, Transition } from "@headlessui/react";
|
||||
import {
|
||||
ChevronUpDownIcon,
|
||||
UserCircleIcon as UserCircleIconOutline,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { UserCircleIcon as UserCircleIconSolid } from "@heroicons/react/24/solid";
|
||||
import { ProfileDescription } from "core/config/ConfigHandler";
|
||||
import { Fragment, useContext, useEffect, useState } from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { useDispatch } from "react-redux";
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
defaultBorderRadius,
|
||||
lightGray,
|
||||
vscBackground,
|
||||
vscForeground,
|
||||
vscInputBackground,
|
||||
vscListActiveBackground,
|
||||
vscListActiveForeground,
|
||||
} from ".";
|
||||
import { useAuth } from "../context/Auth";
|
||||
import { IdeMessengerContext } from "../context/IdeMessenger";
|
||||
import { useWebviewListener } from "../hooks/useWebviewListener";
|
||||
import { useAppSelector } from "../redux/hooks";
|
||||
import { setLastControlServerBetaEnabledStatus } from "../redux/slices/miscSlice";
|
||||
import { getFontSize } from "../util";
|
||||
import HeaderButtonWithToolTip from "./gui/HeaderButtonWithToolTip";
|
||||
|
||||
const StyledListbox = styled(Listbox)`
|
||||
background-color: ${vscBackground};
|
||||
min-width: 80px;
|
||||
`;
|
||||
|
||||
const StyledListboxButton = styled(Listbox.Button)`
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
background-color: ${vscBackground};
|
||||
text-align: left;
|
||||
border: none;
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
max-width: 180px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
||||
border: 0.5px solid ${lightGray};
|
||||
border-radius: ${defaultBorderRadius};
|
||||
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto;
|
||||
align-items: center;
|
||||
|
||||
color: ${vscForeground};
|
||||
|
||||
padding: 3px 6px;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: ${vscInputBackground};
|
||||
}
|
||||
|
||||
font-size: ${getFontSize() - 2}px;
|
||||
`;
|
||||
|
||||
const StyledListboxOptions = styled(Listbox.Options)`
|
||||
background-color: ${vscInputBackground};
|
||||
padding: 0;
|
||||
|
||||
position: absolute;
|
||||
bottom: calc(100% - 16px);
|
||||
max-width: 100%;
|
||||
max-height: 80vh;
|
||||
|
||||
border-radius: ${defaultBorderRadius};
|
||||
overflow-y: scroll;
|
||||
`;
|
||||
|
||||
const StyledListboxOption = styled(Listbox.Option)<{ selected: boolean }>`
|
||||
background-color: ${({ selected }) =>
|
||||
selected ? vscListActiveBackground : vscInputBackground};
|
||||
cursor: pointer;
|
||||
padding: 6px 8px;
|
||||
|
||||
&:hover {
|
||||
background-color: ${vscListActiveBackground};
|
||||
color: ${vscListActiveForeground};
|
||||
}
|
||||
`;
|
||||
|
||||
function ListBoxOption({
|
||||
option,
|
||||
idx,
|
||||
showDelete,
|
||||
selected,
|
||||
}: {
|
||||
option: ProfileDescription;
|
||||
idx: number;
|
||||
showDelete?: boolean;
|
||||
selected: boolean;
|
||||
}) {
|
||||
const [hovered, setHovered] = useState(false);
|
||||
|
||||
return (
|
||||
<StyledListboxOption
|
||||
key={idx}
|
||||
selected={selected}
|
||||
value={option.id}
|
||||
onMouseEnter={() => {
|
||||
setHovered(true);
|
||||
}}
|
||||
onMouseLeave={() => {
|
||||
setHovered(false);
|
||||
}}
|
||||
>
|
||||
<div className="relative flex h-5 items-center justify-between gap-3">
|
||||
{option.title}
|
||||
</div>
|
||||
</StyledListboxOption>
|
||||
);
|
||||
}
|
||||
|
||||
function ProfileSwitcher() {
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
const { session, logout, login } = useAuth();
|
||||
const [profiles, setProfiles] = useState<ProfileDescription[]>([]);
|
||||
|
||||
const dispatch = useDispatch();
|
||||
const lastControlServerBetaEnabledStatus = useAppSelector(
|
||||
(state) => state.misc.lastControlServerBetaEnabledStatus,
|
||||
);
|
||||
|
||||
const selectedProfileId = useAppSelector(
|
||||
(store) => store.session.selectedProfileId,
|
||||
);
|
||||
|
||||
const [controlServerBetaEnabled, setControlServerBetaEnabled] =
|
||||
useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
ideMessenger.ide.getIdeSettings().then(({ enableControlServerBeta }) => {
|
||||
setControlServerBetaEnabled(enableControlServerBeta);
|
||||
dispatch(setLastControlServerBetaEnabledStatus(enableControlServerBeta));
|
||||
|
||||
const shouldShowPopup =
|
||||
!lastControlServerBetaEnabledStatus && enableControlServerBeta;
|
||||
});
|
||||
}, []);
|
||||
|
||||
useWebviewListener(
|
||||
"didChangeIdeSettings",
|
||||
async (msg) => {
|
||||
const { settings } = msg;
|
||||
setControlServerBetaEnabled(settings.enableControlServerBeta);
|
||||
dispatch(
|
||||
setLastControlServerBetaEnabledStatus(settings.enableControlServerBeta),
|
||||
);
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
ideMessenger
|
||||
.request("config/listProfiles", undefined)
|
||||
.then(
|
||||
(result) => result.status === "success" && setProfiles(result.content),
|
||||
);
|
||||
}, []);
|
||||
|
||||
useWebviewListener(
|
||||
"didChangeAvailableProfiles",
|
||||
async (data) => {
|
||||
setProfiles(data.profiles);
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
const topDiv = document.getElementById("profile-select-top-div");
|
||||
|
||||
function selectedProfile() {
|
||||
return profiles.find((p) => p.id === selectedProfileId);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{controlServerBetaEnabled && session?.account?.id && (
|
||||
<StyledListbox
|
||||
value={"GPT-4"}
|
||||
onChange={(id: string) => {
|
||||
ideMessenger.post("didChangeSelectedProfile", { id });
|
||||
}}
|
||||
>
|
||||
<div className="relative">
|
||||
<StyledListboxButton>
|
||||
<span className="truncate">{selectedProfile()?.title}</span>
|
||||
<div className="pointer-events-none flex items-center">
|
||||
<ChevronUpDownIcon
|
||||
className="h-4 w-4 text-gray-400"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</div>
|
||||
</StyledListboxButton>
|
||||
{topDiv &&
|
||||
ReactDOM.createPortal(
|
||||
<Transition
|
||||
as={Fragment}
|
||||
leave="transition ease-in duration-100"
|
||||
leaveFrom="opacity-100"
|
||||
leaveTo="opacity-0"
|
||||
>
|
||||
<StyledListboxOptions>
|
||||
{profiles.map((option, idx) => (
|
||||
<ListBoxOption
|
||||
selected={option.id === selectedProfileId}
|
||||
option={option}
|
||||
idx={idx}
|
||||
key={idx}
|
||||
showDelete={profiles.length > 1}
|
||||
/>
|
||||
))}
|
||||
<div
|
||||
className="px-2 py-1"
|
||||
style={{
|
||||
color: lightGray,
|
||||
fontSize: getFontSize() - 2,
|
||||
}}
|
||||
>
|
||||
{profiles.length === 0 ? (
|
||||
<i>No workspaces found</i>
|
||||
) : (
|
||||
"Select workspace"
|
||||
)}
|
||||
</div>
|
||||
</StyledListboxOptions>
|
||||
</Transition>,
|
||||
topDiv,
|
||||
)}
|
||||
</div>
|
||||
</StyledListbox>
|
||||
)}
|
||||
|
||||
{controlServerBetaEnabled &&
|
||||
(session?.account ? (
|
||||
<HeaderButtonWithToolTip
|
||||
tooltipPlacement="top-end"
|
||||
text={
|
||||
session.account.label === ""
|
||||
? "Logged in"
|
||||
: `Logged in as ${session.account.label}`
|
||||
}
|
||||
onClick={logout}
|
||||
>
|
||||
<UserCircleIconSolid className="h-4 w-4" />
|
||||
</HeaderButtonWithToolTip>
|
||||
) : (
|
||||
<HeaderButtonWithToolTip
|
||||
tooltipPlacement="top-end"
|
||||
text="Click to login to Continue"
|
||||
onClick={login}
|
||||
>
|
||||
<UserCircleIconOutline className="h-4 w-4" />
|
||||
</HeaderButtonWithToolTip>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default ProfileSwitcher;
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
import { useAppSelector } from "../../redux/hooks";
|
||||
import { RootState } from "../../redux/store";
|
||||
|
||||
export default function AboutAssistantDialog() {
|
||||
const configJson = useAppSelector((store: RootState) => store.config.config);
|
||||
|
||||
const selectedProfileId = useAppSelector(
|
||||
(store) => store.session.selectedProfileId,
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="h-[60vh] space-y-4 overflow-y-scroll px-4 pb-4">
|
||||
<h2>About {selectedProfileId} assistant</h2>
|
||||
{configJson.models?.length > 0 && (
|
||||
<details>
|
||||
<summary>Chat models</summary>
|
||||
<ul>
|
||||
{configJson.models.map((model, index) => (
|
||||
<li key={index}>{model.title}</li>
|
||||
))}
|
||||
</ul>
|
||||
</details>
|
||||
)}
|
||||
|
||||
{configJson.embeddingsProvider && (
|
||||
<details>
|
||||
<summary>Embedding model</summary>
|
||||
<p>{configJson.embeddingsProvider}</p>
|
||||
</details>
|
||||
)}
|
||||
|
||||
{configJson.reranker?.name && (
|
||||
<details>
|
||||
<summary>Rerank model</summary>
|
||||
<p>{configJson.reranker.name}</p>
|
||||
</details>
|
||||
)}
|
||||
|
||||
{configJson.systemMessage && (
|
||||
<details>
|
||||
<summary>Rules</summary>
|
||||
<p>{configJson.systemMessage}</p>
|
||||
</details>
|
||||
)}
|
||||
|
||||
{configJson.contextProviders?.length ? (
|
||||
<details>
|
||||
<summary>Context</summary>
|
||||
<ul>
|
||||
{configJson.contextProviders.map((provider, index) => (
|
||||
<li key={index}>{provider.title}</li>
|
||||
))}
|
||||
</ul>
|
||||
</details>
|
||||
) : null}
|
||||
|
||||
{configJson.tools.length > 0 && (
|
||||
<details>
|
||||
<summary>Tools</summary>
|
||||
<ul>
|
||||
{configJson.tools.map((tool, index) => (
|
||||
<li key={index}>{tool.displayTitle}</li>
|
||||
))}
|
||||
</ul>
|
||||
</details>
|
||||
)}
|
||||
|
||||
{configJson.docs?.length ? (
|
||||
<details>
|
||||
<summary>Docs</summary>
|
||||
<ul>
|
||||
{configJson.docs.map((doc, index) => (
|
||||
<li key={index}>{doc.title}</li>
|
||||
))}
|
||||
</ul>
|
||||
</details>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
import ReactDOM from "react-dom";
|
||||
import { Tooltip } from "react-tooltip";
|
||||
import { vscForeground, vscInputBackground } from "..";
|
||||
import { vscBackground, vscForeground, vscInputBorder } from "..";
|
||||
import { getFontSize } from "../../util";
|
||||
|
||||
const TooltipStyles = {
|
||||
fontSize: `${getFontSize() - 2}px`,
|
||||
backgroundColor: vscInputBackground,
|
||||
backgroundColor: vscBackground,
|
||||
outline: `0.5px solid ${vscInputBorder}`,
|
||||
color: vscForeground,
|
||||
padding: "4px 8px",
|
||||
zIndex: 1000,
|
||||
maxWidth: "80vw",
|
||||
textAlign: "center",
|
||||
overflow: "hidden",
|
||||
};
|
||||
|
||||
export function ToolTip(props: any) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@ export const VSC_DIFF_REMOVED_LINE_BACKGROUND_VAR =
|
|||
"--vscode-diffEditor-removedLineBackground";
|
||||
export const VSC_DIFF_INSERTED_LINE_BACKGROUND_VAR =
|
||||
"--vscode-diffEditor-insertedLineBackground";
|
||||
export const VSC_COMMAND_CENTER_ACTIVE_BORDER_VAR =
|
||||
"--vscode-commandCenter-activeBorder";
|
||||
export const VSC_COMMAND_CENTER_INACTIVE_BORDER_VAR =
|
||||
"--vscode-commandCenter-inactiveBorder";
|
||||
|
||||
export const VSC_THEME_COLOR_VARS = [
|
||||
VSC_INPUT_BACKGROUND_VAR,
|
||||
|
|
@ -48,6 +52,8 @@ export const VSC_THEME_COLOR_VARS = [
|
|||
VSC_BADGE_FOREGROUND_VAR,
|
||||
VSC_DIFF_REMOVED_LINE_BACKGROUND_VAR,
|
||||
VSC_DIFF_INSERTED_LINE_BACKGROUND_VAR,
|
||||
VSC_COMMAND_CENTER_ACTIVE_BORDER_VAR,
|
||||
VSC_COMMAND_CENTER_INACTIVE_BORDER_VAR,
|
||||
];
|
||||
|
||||
export const defaultBorderRadius = "5px";
|
||||
|
|
@ -67,6 +73,8 @@ export const vscListActiveForeground = `var(${VSC_LIST_ACTIVE_FOREGROUND_VAR}, $
|
|||
export const vscInputBorder = `var(${VSC_INPUT_BORDER_VAR}, ${lightGray})`;
|
||||
export const vscInputBorderFocus = `var(${VSC_INPUT_BORDER_FOCUS_VAR}, ${lightGray})`;
|
||||
export const vscBadgeBackground = `var(${VSC_BADGE_BACKGROUND_VAR}, #1bbe84)`;
|
||||
export const vscCommandCenterActiveBorder = `var(${VSC_COMMAND_CENTER_ACTIVE_BORDER_VAR}, #1bbe84)`;
|
||||
export const vscCommandCenterInactiveBorder = `var(${VSC_COMMAND_CENTER_INACTIVE_BORDER_VAR}, #1bbe84)`;
|
||||
|
||||
if (typeof document !== "undefined") {
|
||||
for (const colorVar of VSC_THEME_COLOR_VARS) {
|
||||
|
|
@ -134,7 +142,7 @@ export function parseColorForHex(colorVar: string): string {
|
|||
}
|
||||
|
||||
export const Button = styled.button`
|
||||
padding: 10px 12px;
|
||||
padding: 6px 12px;
|
||||
margin: 8px 0;
|
||||
border-radius: ${defaultBorderRadius};
|
||||
|
||||
|
|
@ -162,13 +170,13 @@ type NumberInputProps = {
|
|||
};
|
||||
|
||||
export const SecondaryButton = styled.button`
|
||||
padding: 10px 12px;
|
||||
padding: 6px 12px;
|
||||
margin: 8px 0;
|
||||
border-radius: ${defaultBorderRadius};
|
||||
|
||||
border: 1px solid ${vscForeground};
|
||||
border: 1px solid ${vscInputBorder};
|
||||
color: ${vscForeground};
|
||||
background-color: inherit;
|
||||
background-color: ${vscInputBackground};
|
||||
|
||||
&:disabled {
|
||||
color: gray;
|
||||
|
|
|
|||
|
|
@ -127,25 +127,36 @@ function DocsDetailsDialog({ startUrl }: DocsDetailsDialogProps) {
|
|||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<Tooltip
|
||||
id={urlToolTipId}
|
||||
place="top"
|
||||
className="max-w-full"
|
||||
>
|
||||
{chunk.filepath}
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
id={contentToolTipId}
|
||||
place="top"
|
||||
className="max-h-[300px] max-w-[170px] overflow-y-auto"
|
||||
>
|
||||
{chunk.content}
|
||||
</Tooltip>
|
||||
</>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
{/* Rending tooltips here because div can't be child of tbody apparently */}
|
||||
{data.chunks.map((chunk, i) => {
|
||||
const contentToolTipId = `docs-content-peek-${i}`;
|
||||
const urlToolTipId = `docs-url-peek-${i}`;
|
||||
return (
|
||||
<>
|
||||
<Tooltip
|
||||
key={urlToolTipId}
|
||||
id={urlToolTipId}
|
||||
place="top"
|
||||
className="max-w-full"
|
||||
>
|
||||
{chunk.filepath}
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
key={contentToolTipId}
|
||||
id={contentToolTipId}
|
||||
place="top"
|
||||
className="max-h-[300px] max-w-[170px] overflow-y-auto"
|
||||
>
|
||||
{chunk.content}
|
||||
</Tooltip>
|
||||
</>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ function InputToolbar(props: InputToolbarProps) {
|
|||
const hasCodeToEdit = useAppSelector(selectHasCodeToEdit);
|
||||
const isEditModeAndNoCodeToEdit = isInEditMode && !hasCodeToEdit;
|
||||
const isEnterDisabled = props.disabled || isEditModeAndNoCodeToEdit;
|
||||
const shouldRenderToolsButton =
|
||||
const toolsSupported =
|
||||
defaultModel &&
|
||||
modelSupportsTools(defaultModel.model, defaultModel.provider) &&
|
||||
!props.toolbarOptions?.hideTools;
|
||||
|
|
@ -158,14 +158,14 @@ function InputToolbar(props: InputToolbarProps) {
|
|||
</HoverItem>
|
||||
)}
|
||||
|
||||
{shouldRenderToolsButton && <ToggleToolsButton />}
|
||||
<ToggleToolsButton disabled={!toolsSupported} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 whitespace-nowrap text-gray-400">
|
||||
{!props.toolbarOptions?.hideUseCodebase && !isInEditMode && (
|
||||
<div
|
||||
className={`${shouldRenderToolsButton ? "md:flex" : "sm:flex"} hover:underline" hidden transition-colors duration-200`}
|
||||
className={`${toolsSupported ? "md:flex" : "sm:flex"} hover:underline" hidden transition-colors duration-200`}
|
||||
>
|
||||
{props.activeKey === "Alt" ? (
|
||||
<HoverItem className="underline">
|
||||
|
|
|
|||
|
|
@ -15,7 +15,11 @@ import HoverItem from "./HoverItem";
|
|||
import PopoverTransition from "./PopoverTransition";
|
||||
import ToolDropdownItem from "./ToolDropdownItem";
|
||||
|
||||
export default function ToolDropdown() {
|
||||
interface ToolDropdownProps {
|
||||
disabled: boolean;
|
||||
}
|
||||
|
||||
export default function ToolDropdown(props: ToolDropdownProps) {
|
||||
const buttonRef = useRef<HTMLButtonElement>(null);
|
||||
const dispatch = useDispatch();
|
||||
const [isDropdownOpen, setDropdownOpen] = useState(false);
|
||||
|
|
@ -45,25 +49,32 @@ export default function ToolDropdown() {
|
|||
}, [isDropdownOpen]);
|
||||
|
||||
return (
|
||||
<HoverItem onClick={() => dispatch(toggleUseTools())}>
|
||||
<HoverItem onClick={() => !props.disabled && dispatch(toggleUseTools())}>
|
||||
<div
|
||||
data-tooltip-id="tools-tooltip"
|
||||
className={`-ml-1 -mt-1 flex flex-row items-center gap-1.5 rounded-md px-1 py-0.5 text-xs ${
|
||||
useTools || isHovered ? "bg-lightgray/30" : ""
|
||||
}`}
|
||||
(useTools || isHovered) && !props.disabled ? "bg-lightgray/30" : ""
|
||||
} ${props.disabled ? "cursor-not-allowed opacity-50" : ""}`}
|
||||
>
|
||||
<ToolsIcon
|
||||
className="h-4 w-4 text-gray-400"
|
||||
onMouseEnter={() => setIsHovered(true)}
|
||||
onMouseLeave={() => setIsHovered(false)}
|
||||
className={`h-4 w-4 text-gray-400 ${
|
||||
props.disabled ? "cursor-not-allowed" : ""
|
||||
}`}
|
||||
onMouseEnter={() => !props.disabled && setIsHovered(true)}
|
||||
onMouseLeave={() => !props.disabled && setIsHovered(false)}
|
||||
/>
|
||||
{!useTools && (
|
||||
{props.disabled && (
|
||||
<ToolTip id="tools-tooltip" place="top-middle">
|
||||
This model does not support tool use
|
||||
</ToolTip>
|
||||
)}
|
||||
{!useTools && !props.disabled && (
|
||||
<ToolTip id="tools-tooltip" place="top-middle">
|
||||
Enable tool usage
|
||||
</ToolTip>
|
||||
)}
|
||||
|
||||
{useTools && (
|
||||
{useTools && !props.disabled && (
|
||||
<>
|
||||
<span className="hidden align-top sm:flex">Tools</span>
|
||||
|
||||
|
|
@ -73,6 +84,7 @@ export default function ToolDropdown() {
|
|||
onChange={() => {}}
|
||||
as="div"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
disabled={props.disabled}
|
||||
>
|
||||
{({ open }) => (
|
||||
<>
|
||||
|
|
@ -83,6 +95,7 @@ export default function ToolDropdown() {
|
|||
setDropdownOpen(!isDropdownOpen);
|
||||
}}
|
||||
className="text-lightgray flex cursor-pointer items-center border-none bg-transparent px-0 outline-none"
|
||||
aria-disabled={props.disabled}
|
||||
>
|
||||
<EllipsisHorizontalIcon className="h-3 w-3 cursor-pointer hover:brightness-125" />
|
||||
</Listbox.Button>
|
||||
|
|
@ -135,7 +148,7 @@ export default function ToolDropdown() {
|
|||
</div>
|
||||
</div>
|
||||
<div className="max-h-48 overflow-y-auto overflow-x-hidden">
|
||||
{availableTools.map((tool) => (
|
||||
{availableTools.map((tool: any) => (
|
||||
<Listbox.Option
|
||||
key={tool.function.name}
|
||||
value="addAllFiles"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Tool } from "core";
|
||||
import { useEffect } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { RootState } from "../../../redux/store";
|
||||
import { addTool, toggleToolSetting } from "../../../redux/slices/uiSlice";
|
||||
import { RootState } from "../../../redux/store";
|
||||
|
||||
interface ToolDropdownItemProps {
|
||||
tool: Tool;
|
||||
|
|
@ -34,6 +34,13 @@ function ToolDropdownItem(props: ToolDropdownItemProps) {
|
|||
}}
|
||||
>
|
||||
<span className="flex items-center gap-1">
|
||||
{props.tool.faviconUrl && (
|
||||
<img
|
||||
src={props.tool.faviconUrl}
|
||||
alt={props.tool.displayTitle}
|
||||
className="h-4 w-4"
|
||||
/>
|
||||
)}
|
||||
{props.tool.displayTitle}{" "}
|
||||
{/* <InfoHover
|
||||
id={`tool-policy-row-${props.tool.function.name}`}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,7 @@ import Paragraph from "@tiptap/extension-paragraph";
|
|||
import Placeholder from "@tiptap/extension-placeholder";
|
||||
import Text from "@tiptap/extension-text";
|
||||
import { Plugin } from "@tiptap/pm/state";
|
||||
import {
|
||||
AnyExtension,
|
||||
Editor,
|
||||
EditorContent,
|
||||
JSONContent,
|
||||
useEditor,
|
||||
} from "@tiptap/react";
|
||||
import { Editor, EditorContent, JSONContent, useEditor } from "@tiptap/react";
|
||||
import { ContextProviderDescription, InputModifiers } from "core";
|
||||
import { rifWithContentsToContextItem } from "core/commands/util";
|
||||
import { modelSupportsImages } from "core/llm/autodetect";
|
||||
|
|
@ -30,9 +24,10 @@ import {
|
|||
defaultBorderRadius,
|
||||
lightGray,
|
||||
vscBadgeBackground,
|
||||
vscCommandCenterActiveBorder,
|
||||
vscCommandCenterInactiveBorder,
|
||||
vscForeground,
|
||||
vscInputBackground,
|
||||
vscInputBorder,
|
||||
vscInputBorderFocus,
|
||||
} from "..";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
|
|
@ -66,6 +61,7 @@ import {
|
|||
import { AddCodeToEdit } from "./AddCodeToEditExtension";
|
||||
import { CodeBlockExtension } from "./CodeBlockExtension";
|
||||
import { SlashCommand } from "./CommandsExtension";
|
||||
import { MockExtension } from "./FillerExtension";
|
||||
import InputToolbar, { ToolbarOptions } from "./InputToolbar";
|
||||
import { Mention } from "./MentionExtension";
|
||||
import "./TipTapEditor.css";
|
||||
|
|
@ -78,9 +74,8 @@ import {
|
|||
handleVSCMetaKeyIssues,
|
||||
} from "./handleMetaKeyIssues";
|
||||
import { ComboBoxItem } from "./types";
|
||||
import { MockExtension } from "./FillerExtension";
|
||||
|
||||
const InputBoxDiv = styled.div<{ border?: string }>`
|
||||
const InputBoxDiv = styled.div<{}>`
|
||||
resize: none;
|
||||
padding-bottom: 4px;
|
||||
font-family: inherit;
|
||||
|
|
@ -90,8 +85,13 @@ const InputBoxDiv = styled.div<{ border?: string }>`
|
|||
width: 100%;
|
||||
background-color: ${vscInputBackground};
|
||||
color: ${vscForeground};
|
||||
border: ${(props) =>
|
||||
props.border ? props.border : `0.5px solid ${vscInputBorder}`};
|
||||
|
||||
border: 1px solid ${vscCommandCenterInactiveBorder};
|
||||
transition: border-color 0.15s ease-in-out;
|
||||
&:focus-within {
|
||||
border: 1px solid ${vscCommandCenterActiveBorder};
|
||||
}
|
||||
|
||||
outline: none;
|
||||
font-size: ${getFontSize()}px;
|
||||
|
||||
|
|
@ -173,7 +173,6 @@ interface TipTapEditorProps {
|
|||
) => void;
|
||||
editorState?: JSONContent;
|
||||
toolbarOptions?: ToolbarOptions;
|
||||
border?: string;
|
||||
placeholder?: string;
|
||||
historyKey: string;
|
||||
inputId: string;
|
||||
|
|
@ -730,6 +729,7 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: false,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
@ -763,6 +763,7 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: true,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
setTimeout(() => {
|
||||
|
|
@ -925,7 +926,6 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
|
||||
return (
|
||||
<InputBoxDiv
|
||||
border={props.border}
|
||||
onKeyDown={handleKeyDown}
|
||||
onKeyUp={handleKeyUp}
|
||||
className="cursor-text"
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@ import {
|
|||
PencilSquareIcon,
|
||||
XMarkIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import styled from "styled-components";
|
||||
import { defaultBorderRadius, lightGray, vscBackground } from "..";
|
||||
import { lightGray } from "..";
|
||||
import { getMetaKeyLabel, isJetBrains } from "../../util";
|
||||
import { useContext } from "react";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
|
|
@ -16,41 +15,27 @@ interface TutorialCardProps {
|
|||
onClose: () => void;
|
||||
}
|
||||
|
||||
const TutorialCardDiv = styled.div`
|
||||
border: 1px solid ${lightGray};
|
||||
border-radius: ${defaultBorderRadius};
|
||||
background-color: ${vscBackground};
|
||||
padding: 1rem 2.5rem 1rem 2rem;
|
||||
margin: 1rem;
|
||||
max-width: 28rem;
|
||||
position: relative;
|
||||
`;
|
||||
|
||||
const CloseButton = styled.button`
|
||||
border: none;
|
||||
background-color: ${vscBackground};
|
||||
color: ${lightGray};
|
||||
position: absolute;
|
||||
top: 0.4rem;
|
||||
right: 0.5rem;
|
||||
padding: 0.25rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
`;
|
||||
|
||||
export function TutorialCard({ onClose }: TutorialCardProps) {
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
const jetbrains = isJetBrains();
|
||||
|
||||
return (
|
||||
<TutorialCardDiv data-testid={`tutorial-card`}>
|
||||
<CloseButton onClick={onClose}>
|
||||
<XMarkIcon className="h-5 w-5" />
|
||||
</CloseButton>
|
||||
<div
|
||||
className="border-0.5 border-lightGray bg-vsc-background m-1 max-w-96 rounded-md border-solid px-3 py-3 sm:px-5"
|
||||
data-testid={`tutorial-card`}
|
||||
>
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="m-0 p-0"></h3>
|
||||
<div
|
||||
onClick={onClose}
|
||||
className="cursor-pointer items-center justify-center"
|
||||
>
|
||||
<XMarkIcon className="h-5 w-5" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul className="space-y-4 pl-0" style={{ color: lightGray }}>
|
||||
{!isJetBrains() && (
|
||||
{!jetbrains && (
|
||||
<li className="flex items-start">
|
||||
<ArrowRightStartOnRectangleIcon className="h-4 w-4 pr-3 align-middle" />
|
||||
<span>
|
||||
|
|
@ -67,27 +52,36 @@ export function TutorialCard({ onClose }: TutorialCardProps) {
|
|||
</li>
|
||||
)}
|
||||
<li className="flex items-start">
|
||||
<PencilSquareIcon className="h-4 w-4 pr-3 align-middle" />
|
||||
<div>
|
||||
<PencilSquareIcon className="h-4 w-4 pr-3 align-middle" />
|
||||
</div>
|
||||
<span>
|
||||
Highlight code and press <kbd>{getMetaKeyLabel()}</kbd> + <kbd>I</kbd> to
|
||||
quickly make natural language edits
|
||||
Highlight code and press <kbd>{getMetaKeyLabel()}</kbd> +{" "}
|
||||
<kbd>I</kbd> to quickly make natural language edits
|
||||
</span>
|
||||
</li>
|
||||
<li className="flex items-start">
|
||||
<ClipboardDocumentIcon className="h-4 w-4 pr-3 align-middle" />
|
||||
<div>
|
||||
<ClipboardDocumentIcon className="h-4 w-4 pr-3 align-middle" />
|
||||
</div>
|
||||
<span>
|
||||
Highlight code and press <kbd>{getMetaKeyLabel()}</kbd> + <kbd>L</kbd> to
|
||||
add it to the chat window
|
||||
Highlight code and press <kbd>{getMetaKeyLabel()}</kbd> +{" "}
|
||||
<kbd>{jetbrains ? "J" : "L"}</kbd> to add it to the chat window
|
||||
</span>
|
||||
</li>
|
||||
<li className="flex items-start">
|
||||
<Cog6ToothIcon className="h-4 w-4 pr-3 align-middle" />
|
||||
<div>
|
||||
<Cog6ToothIcon className="h-4 w-4 pr-3 align-middle" />
|
||||
</div>
|
||||
<span>
|
||||
Click the gear icon in the bottom right to configure Continue
|
||||
Click the gear icon at the top of the chat window to configure
|
||||
Continue
|
||||
</span>
|
||||
</li>
|
||||
<li className="flex items-start">
|
||||
<BookOpenIcon className="h-4 w-4 pr-3 align-middle" />
|
||||
<div>
|
||||
<BookOpenIcon className="h-4 w-4 pr-3 align-middle" />
|
||||
</div>
|
||||
<span>
|
||||
<a
|
||||
className="cursor-pointer text-inherit underline hover:text-inherit"
|
||||
|
|
@ -101,6 +95,6 @@ export function TutorialCard({ onClose }: TutorialCardProps) {
|
|||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</TutorialCardDiv>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,9 @@ import { lightGray } from "../..";
|
|||
import { useAuth } from "../../../context/Auth";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { useAppDispatch } from "../../../redux/hooks";
|
||||
import { setDialogMessage, setShowDialog } from "../../../redux/slices/uiSlice";
|
||||
import { setProfileId } from "../../../redux/thunks/setProfileId";
|
||||
import { getFontSize, getMetaKeyLabel, isLocalProfile } from "../../../util";
|
||||
import { ROUTES } from "../../../util/navigation";
|
||||
import AboutAssistantDialog from "../../dialogs/AboutAssistantDialog";
|
||||
import AssistantIcon from "./AssistantIcon";
|
||||
import { Divider, Option, OptionDiv } from "./shared";
|
||||
import { getProfileDisplayText } from "./utils";
|
||||
|
|
@ -27,6 +25,7 @@ export function AssistantSelectOptions(props: AssistantSelectOptionsProps) {
|
|||
function onNewAssistant() {
|
||||
ideMessenger.post("controlPlane/openUrl", {
|
||||
path: "new",
|
||||
orgSlug: selectedOrganization?.slug,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -40,13 +39,7 @@ export function AssistantSelectOptions(props: AssistantSelectOptionsProps) {
|
|||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
if (option.id === "local") {
|
||||
ideMessenger.post("config/openProfile", { profileId: option.id });
|
||||
} else {
|
||||
props.onClose();
|
||||
dispatch(setDialogMessage(<AboutAssistantDialog />));
|
||||
dispatch(setShowDialog(true));
|
||||
}
|
||||
ideMessenger.post("config/openProfile", { profileId: option.id });
|
||||
}
|
||||
|
||||
function handleClickError(profileId: string) {
|
||||
|
|
@ -61,7 +54,7 @@ export function AssistantSelectOptions(props: AssistantSelectOptionsProps) {
|
|||
key={idx}
|
||||
idx={idx}
|
||||
disabled={!!profile.errors?.length}
|
||||
showConfigure={true}
|
||||
showConfigure={profile.id === "local"}
|
||||
selected={profile.id === selectedProfile?.id}
|
||||
onLink={
|
||||
!isLocalProfile(profile)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import {
|
|||
setAvailableProfiles,
|
||||
} from "../redux/slices/sessionSlice";
|
||||
import { setDialogMessage, setShowDialog } from "../redux/slices/uiSlice";
|
||||
import { getLocalStorage, setLocalStorage } from "../util/localStorage";
|
||||
import { IdeMessengerContext } from "./IdeMessenger";
|
||||
|
||||
interface AuthContextType {
|
||||
|
|
@ -85,23 +84,6 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
|||
const session = result.content;
|
||||
setSession(session);
|
||||
|
||||
// If this is the first time the user has logged in, explain how profiles work
|
||||
if (!getLocalStorage("shownProfilesIntroduction")) {
|
||||
dispatch(setShowDialog(true));
|
||||
dispatch(
|
||||
setDialogMessage(
|
||||
<ConfirmationDialog
|
||||
title="Welcome to Continue for Teams!"
|
||||
text="You can switch between your local profile and team profile using the profile icon in the top right. Each profile defines a set of models, slash commands, context providers, and other settings to customize Continue."
|
||||
hideCancelButton={true}
|
||||
confirmText="Ok"
|
||||
onConfirm={() => {}}
|
||||
/>,
|
||||
),
|
||||
);
|
||||
setLocalStorage("shownProfilesIntroduction", true);
|
||||
}
|
||||
|
||||
resolve(true);
|
||||
});
|
||||
});
|
||||
|
|
@ -152,10 +134,10 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
|||
ideMessenger.ide
|
||||
.getIdeSettings()
|
||||
.then(({ enableControlServerBeta, continueTestEnvironment }) => {
|
||||
const enabled =
|
||||
enableControlServerBeta || continueTestEnvironment !== "none";
|
||||
setControlServerBetaEnabled(enabled);
|
||||
dispatch(setLastControlServerBetaEnabledStatus(enabled));
|
||||
setControlServerBetaEnabled(enableControlServerBeta);
|
||||
dispatch(
|
||||
setLastControlServerBetaEnabledStatus(enableControlServerBeta),
|
||||
);
|
||||
});
|
||||
}, []);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,18 +3,24 @@ import {
|
|||
ContextProviderName,
|
||||
ContextSubmenuItemWithProvider,
|
||||
} from "core";
|
||||
import { createContext } from "react";
|
||||
import { deduplicateArray } from "core/util";
|
||||
import MiniSearch, { SearchResult } from "minisearch";
|
||||
import { useCallback, useContext, useEffect, useRef, useState } from "react";
|
||||
import { IdeMessengerContext } from "./IdeMessenger";
|
||||
import { selectSubmenuContextProviders } from "../redux/selectors";
|
||||
import { useWebviewListener } from "../hooks/useWebviewListener";
|
||||
import { useAppSelector } from "../redux/hooks";
|
||||
import {
|
||||
getShortestUniqueRelativeUriPaths,
|
||||
getUriPathBasename,
|
||||
} from "core/util/uri";
|
||||
import MiniSearch, { SearchResult } from "minisearch";
|
||||
import {
|
||||
createContext,
|
||||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import { useWebviewListener } from "../hooks/useWebviewListener";
|
||||
import { useAppSelector } from "../redux/hooks";
|
||||
import { selectSubmenuContextProviders } from "../redux/selectors";
|
||||
import { IdeMessengerContext } from "./IdeMessenger";
|
||||
|
||||
const MINISEARCH_OPTIONS = {
|
||||
prefix: true,
|
||||
|
|
@ -246,9 +252,7 @@ export const SubmenuContextProvidersProvider = ({
|
|||
abortControllers.get(description.title)?.abort();
|
||||
abortControllers.set(description.title, controller);
|
||||
providersLoading.add(description.title);
|
||||
console.log(
|
||||
`Refreshing items for ${description.title} submenu provider`,
|
||||
);
|
||||
|
||||
const result = await ideMessenger.request(
|
||||
"context/loadSubmenuItems",
|
||||
{
|
||||
|
|
@ -296,7 +300,7 @@ export const SubmenuContextProvidersProvider = ({
|
|||
setFallbackResults((prev) => ({
|
||||
...prev,
|
||||
file: deduplicateArray(
|
||||
[...lastOpenFilesRef.current, ...(prev.file ?? [])],
|
||||
[...lastOpenFilesRef.current, ...itemsWithProvider],
|
||||
(a, b) => a.id === b.id,
|
||||
),
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ import ModelCard from "../../components/modelSelection/ModelCard";
|
|||
import Toggle from "../../components/modelSelection/Toggle";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { useNavigationListener } from "../../hooks/useNavigationListener";
|
||||
import { setDefaultModel } from "../../redux/slices/configSlice";
|
||||
import { ModelPackage, models } from "./configs/models";
|
||||
import { providers } from "./configs/providers";
|
||||
import { CustomModelButton } from "./ConfigureProvider";
|
||||
import { setDefaultModel } from "../../redux/slices/configSlice";
|
||||
|
||||
const IntroDiv = styled.div`
|
||||
padding: 8px 12px;
|
||||
|
|
@ -39,7 +39,7 @@ const GridDiv = styled.div`
|
|||
*/
|
||||
const modelsByProvider: Record<string, ModelPackage[]> = {
|
||||
"Open AI": [models.gpt4turbo, models.gpt4o, models.gpt35turbo],
|
||||
Anthropic: [models.claude3Opus, models.claude3Sonnet, models.claude3Haiku],
|
||||
Anthropic: [models.claude3Opus, models.claude3Sonnet, models.claude35Haiku],
|
||||
Mistral: [
|
||||
models.codestral,
|
||||
models.mistral7b,
|
||||
|
|
@ -49,7 +49,11 @@ const modelsByProvider: Record<string, ModelPackage[]> = {
|
|||
models.mistralLarge,
|
||||
],
|
||||
Cohere: [models.commandR, models.commandRPlus],
|
||||
DeepSeek: [models.deepseekCoderApi, models.deepseekChatApi, models.deepseekReasonerApi],
|
||||
DeepSeek: [
|
||||
models.deepseekCoderApi,
|
||||
models.deepseekChatApi,
|
||||
models.deepseekReasonerApi,
|
||||
],
|
||||
Gemini: [models.geminiPro, models.gemini15Pro, models.gemini15Flash],
|
||||
"Open Source": [models.llama3Chat, models.mistralOs, models.deepseek],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -52,16 +52,14 @@ export const models: { [key: string]: ModelPackage } = {
|
|||
name: "Parameter Count",
|
||||
description: "The number of parameters in the model",
|
||||
options: {
|
||||
"r1": {
|
||||
r1: {
|
||||
model: "deepseek/deepseek_v3",
|
||||
title: "deepseek_v3",
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
providerOptions: [
|
||||
"novita"
|
||||
],
|
||||
providerOptions: ["novita"],
|
||||
isOpenSource: true,
|
||||
},
|
||||
deepseekR1Chat: {
|
||||
|
|
@ -79,16 +77,14 @@ export const models: { [key: string]: ModelPackage } = {
|
|||
name: "Parameter Count",
|
||||
description: "The number of parameters in the model",
|
||||
options: {
|
||||
"r1": {
|
||||
r1: {
|
||||
model: "deepseek/deepseek-r1",
|
||||
title: "deepseek-r1",
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
providerOptions: [
|
||||
"novita"
|
||||
],
|
||||
providerOptions: ["novita"],
|
||||
isOpenSource: true,
|
||||
},
|
||||
llama318BChat: {
|
||||
|
|
@ -109,13 +105,11 @@ export const models: { [key: string]: ModelPackage } = {
|
|||
"8b": {
|
||||
model: "meta-llama/llama-3.1-8b-instruct",
|
||||
title: "Llama3.1-8b",
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
providerOptions: [
|
||||
"novita"
|
||||
],
|
||||
providerOptions: ["novita"],
|
||||
isOpenSource: true,
|
||||
},
|
||||
mistralChat: {
|
||||
|
|
@ -140,9 +134,7 @@ export const models: { [key: string]: ModelPackage } = {
|
|||
},
|
||||
],
|
||||
icon: "mistral.png",
|
||||
providerOptions: [
|
||||
"novita",
|
||||
],
|
||||
providerOptions: ["novita"],
|
||||
isOpenSource: true,
|
||||
},
|
||||
llama31Chat: {
|
||||
|
|
@ -995,14 +987,14 @@ export const models: { [key: string]: ModelPackage } = {
|
|||
icon: "anthropic.png",
|
||||
isOpenSource: false,
|
||||
},
|
||||
claude3Haiku: {
|
||||
title: "Claude 3 Haiku",
|
||||
claude35Haiku: {
|
||||
title: "Claude 3.5 Haiku",
|
||||
description:
|
||||
"The third most capable model in the Claude 3 series: fastest and most compact model for near-instant responsiveness",
|
||||
"The fastest model in the Claude 3.5 series: a compact model for near-instant responsiveness",
|
||||
params: {
|
||||
model: "claude-3-haiku-20240307",
|
||||
model: "claude-3-5-haiku-latest",
|
||||
contextLength: 200_000,
|
||||
title: "Claude 3 Haiku",
|
||||
title: "Claude 3.5 Haiku",
|
||||
apiKey: "",
|
||||
},
|
||||
providerOptions: ["anthropic", "free-trial"],
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ export const providers: Partial<Record<string, ProviderInfo>> = {
|
|||
models.claude35Sonnet,
|
||||
models.claude3Opus,
|
||||
models.claude3Sonnet,
|
||||
models.claude3Haiku,
|
||||
models.claude35Haiku,
|
||||
],
|
||||
apiKeyUrl: "https://console.anthropic.com/account/keys",
|
||||
},
|
||||
|
|
@ -370,7 +370,11 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n
|
|||
required: true,
|
||||
},
|
||||
],
|
||||
packages: [models.deepseekCoderApi, models.deepseekChatApi, models.deepseekReasonerApi],
|
||||
packages: [
|
||||
models.deepseekCoderApi,
|
||||
models.deepseekChatApi,
|
||||
models.deepseekReasonerApi,
|
||||
],
|
||||
apiKeyUrl: "https://platform.deepseek.com/api_keys",
|
||||
},
|
||||
together: {
|
||||
|
|
@ -427,8 +431,12 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n
|
|||
},
|
||||
...completionParamsInputsConfigs,
|
||||
],
|
||||
packages: [models.llama318BChat, models.mistralChat,
|
||||
models.deepseekR1Chat, models.deepseekV3Chat].map((p) => {
|
||||
packages: [
|
||||
models.llama318BChat,
|
||||
models.mistralChat,
|
||||
models.deepseekR1Chat,
|
||||
models.deepseekV3Chat,
|
||||
].map((p) => {
|
||||
p.params.contextLength = 4096;
|
||||
return p;
|
||||
}),
|
||||
|
|
@ -681,7 +689,7 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo
|
|||
{ ...models.claude35Sonnet, title: "Claude 3.5 Sonnet (trial)" },
|
||||
{ ...models.gpt4o, title: "GPT-4o (trial)" },
|
||||
{ ...models.gpt35turbo, title: "GPT-3.5-Turbo (trial)" },
|
||||
{ ...models.claude3Haiku, title: "Claude 3 Haiku (trial)" },
|
||||
{ ...models.claude35Haiku, title: "Claude 3.5 Haiku (trial)" },
|
||||
models.mixtralTrial,
|
||||
{ ...models.gemini15Pro, title: "Gemini 1.5 Pro (trial)" },
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,16 +5,16 @@ import {
|
|||
} from "@heroicons/react/24/outline";
|
||||
import { useContext } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import KeyboardShortcuts from "./KeyboardShortcuts";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { useNavigationListener } from "../../hooks/useNavigationListener";
|
||||
import { setOnboardingCard } from "../../redux/slices/uiSlice";
|
||||
import MoreHelpRow from "./MoreHelpRow";
|
||||
import IndexingProgress from "./IndexingProgress";
|
||||
import DocsIndexingStatuses from "../../components/indexing/DocsIndexingStatuses";
|
||||
import PageHeader from "../../components/PageHeader";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { useNavigationListener } from "../../hooks/useNavigationListener";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
||||
import { setOnboardingCard } from "../../redux/slices/uiSlice";
|
||||
import { saveCurrentSession } from "../../redux/thunks/session";
|
||||
import IndexingProgress from "./IndexingProgress";
|
||||
import KeyboardShortcuts from "./KeyboardShortcuts";
|
||||
import MoreHelpRow from "./MoreHelpRow";
|
||||
|
||||
function MorePage() {
|
||||
useNavigationListener();
|
||||
|
|
@ -100,6 +100,7 @@ function MorePage() {
|
|||
await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: true,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
dispatch(setOnboardingCard({ show: true, activeTab: "Best" }));
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { Listbox } from "@headlessui/react";
|
||||
import {
|
||||
BuildingOfficeIcon,
|
||||
ChevronDownIcon,
|
||||
UserCircleIcon,
|
||||
BuildingOfficeIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { useState } from "react";
|
||||
import { useAuth } from "../../context/Auth";
|
||||
import { setOrgId } from "../../redux/thunks/setOrgId";
|
||||
import { useAppDispatch } from "../../redux/hooks";
|
||||
import { setOrgId } from "../../redux/thunks/setOrgId";
|
||||
|
||||
const USER_PROFILE_VAL = "personal";
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ export function ScopeSelect() {
|
|||
return (
|
||||
<Listbox value={value} onChange={handleChange}>
|
||||
<div className="relative">
|
||||
<Listbox.Button className="border-vsc-foreground text-vsc-foreground hover:bg-vsc-background flex w-full max-w-[400px] cursor-pointer items-center gap-0.5 rounded border bg-transparent p-2 hover:opacity-90">
|
||||
<Listbox.Button className="border-vsc-input-border text-vsc-foreground hover:bg-vsc-background bg-vsc-input-background flex w-full max-w-[400px] cursor-pointer items-center gap-0.5 rounded border border-solid p-2 hover:opacity-90">
|
||||
<div className="flex w-full items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
{selectedDisplay?.iconUrl ? (
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ function ConfigPage() {
|
|||
onClick={handleOpenConfig}
|
||||
className="!my-0 max-w-[400px]"
|
||||
>
|
||||
Open configuration file
|
||||
Open config file
|
||||
</SecondaryButton>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import {
|
|||
} from "../../components";
|
||||
import CodeToEditCard from "../../components/CodeToEditCard";
|
||||
import FeedbackDialog from "../../components/dialogs/FeedbackDialog";
|
||||
import FreeTrialOverDialog from "../../components/dialogs/FreeTrialOverDialog";
|
||||
import { useFindWidget } from "../../components/find/FindWidget";
|
||||
import TimelineItem from "../../components/gui/TimelineItem";
|
||||
import ChatIndexingPeeks from "../../components/indexing/ChatIndexingPeeks";
|
||||
|
|
@ -28,6 +29,7 @@ import ContinueInputBox from "../../components/mainInput/ContinueInputBox";
|
|||
import { NewSessionButton } from "../../components/mainInput/NewSessionButton";
|
||||
import resolveEditorContent from "../../components/mainInput/resolveInput";
|
||||
import { TutorialCard } from "../../components/mainInput/TutorialCard";
|
||||
import AssistantSelect from "../../components/modelSelection/platform/AssistantSelect";
|
||||
import {
|
||||
OnboardingCard,
|
||||
useOnboardingCard,
|
||||
|
|
@ -76,8 +78,6 @@ import ConfigErrorIndicator from "./ConfigError";
|
|||
import { ToolCallDiv } from "./ToolCallDiv";
|
||||
import { ToolCallButtons } from "./ToolCallDiv/ToolCallButtonsDiv";
|
||||
import ToolOutput from "./ToolCallDiv/ToolOutput";
|
||||
import FreeTrialOverDialog from "../../components/dialogs/FreeTrialOverDialog";
|
||||
import AssistantSelect from "../../components/modelSelection/platform/AssistantSelect";
|
||||
|
||||
const StopButton = styled.div`
|
||||
background-color: ${vscBackground};
|
||||
|
|
@ -365,9 +365,11 @@ export function Chat() {
|
|||
|
||||
useAutoScroll(stepsDivRef, history);
|
||||
|
||||
const showPageHeader = isInEditMode || usePlatform;
|
||||
|
||||
return (
|
||||
<>
|
||||
{(isInEditMode || usePlatform) && (
|
||||
{showPageHeader && (
|
||||
<PageHeader
|
||||
title={isInEditMode ? "Edit Mode" : ""}
|
||||
onTitleClick={
|
||||
|
|
@ -388,7 +390,7 @@ export function Chat() {
|
|||
|
||||
<StepsDiv
|
||||
ref={stepsDivRef}
|
||||
className={`overflow-y-scroll pt-[8px] ${showScrollbar ? "thin-scrollbar" : "no-scrollbar"} ${history.length > 0 ? "flex-1" : ""}`}
|
||||
className={`overflow-y-scroll ${showPageHeader ? "" : "pt-[8px]"} ${showScrollbar ? "thin-scrollbar" : "no-scrollbar"} ${history.length > 0 ? "flex-1" : ""}`}
|
||||
>
|
||||
{highlights}
|
||||
{history.map((item, index: number) => (
|
||||
|
|
|
|||
|
|
@ -46,6 +46,10 @@ export function ThreadDiv(props: ThreadDivProps) {
|
|||
return rendered;
|
||||
}
|
||||
|
||||
const tool = availableTools.find(
|
||||
(tool) => props.toolCall.function?.name === tool.function.name,
|
||||
);
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<HeaderDiv>
|
||||
|
|
@ -60,13 +64,10 @@ export function ThreadDiv(props: ThreadDivProps) {
|
|||
>
|
||||
{props.icon}
|
||||
</div>
|
||||
Continue wants to{" "}
|
||||
{renderWouldLikeToMessage(
|
||||
availableTools.find(
|
||||
(tool) => props.toolCall.function?.name === tool.function.name,
|
||||
),
|
||||
props.toolCallState,
|
||||
{tool?.faviconUrl && (
|
||||
<img src={tool.faviconUrl} className="h-4 w-4 rounded-sm" />
|
||||
)}
|
||||
Continue wants to {renderWouldLikeToMessage(tool, props.toolCallState)}
|
||||
</HeaderDiv>
|
||||
<ChildrenDiv>{props.children}</ChildrenDiv>
|
||||
</Container>
|
||||
|
|
|
|||
|
|
@ -6,12 +6,10 @@ import {
|
|||
MessageContent,
|
||||
RangeInFile,
|
||||
} from "core";
|
||||
import resolveEditorContent from "../../components/mainInput/resolveInput";
|
||||
import { ThunkApiType } from "../store";
|
||||
import { selectDefaultModel } from "../slices/configSlice";
|
||||
import { findUriInDirs, getUriPathBasename } from "core/util/uri";
|
||||
import * as URI from "uri-js";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import resolveEditorContent from "../../components/mainInput/resolveInput";
|
||||
import { selectDefaultModel } from "../slices/configSlice";
|
||||
import { ThunkApiType } from "../store";
|
||||
|
||||
export const gatherContext = createAsyncThunk<
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import { createAsyncThunk, Dispatch, unwrapResult } from "@reduxjs/toolkit";
|
||||
import { createAsyncThunk, unwrapResult } from "@reduxjs/toolkit";
|
||||
import { ChatMessage, Session, SessionMetadata } from "core";
|
||||
import { NEW_SESSION_TITLE } from "core/util/constants";
|
||||
import { renderChatMessage } from "core/util/messageContent";
|
||||
import { ThunkApiType } from "../store";
|
||||
import { IIdeMessenger } from "../../context/IdeMessenger";
|
||||
import {
|
||||
deleteSessionMetadata,
|
||||
newSession,
|
||||
setAllSessionMetadata,
|
||||
updateSessionMetadata,
|
||||
} from "../slices/sessionSlice";
|
||||
import { IIdeMessenger } from "../../context/IdeMessenger";
|
||||
import { ThunkApiType } from "../store";
|
||||
|
||||
const MAX_TITLE_LENGTH = 100;
|
||||
|
||||
|
|
@ -97,6 +97,7 @@ export const loadSession = createAsyncThunk<
|
|||
const result = await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: false,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
unwrapResult(result);
|
||||
|
|
@ -147,11 +148,11 @@ function getChatTitleFromMessage(message: ChatMessage) {
|
|||
|
||||
export const saveCurrentSession = createAsyncThunk<
|
||||
void,
|
||||
{ openNewSession: boolean },
|
||||
{ openNewSession: boolean; generateTitle: boolean },
|
||||
ThunkApiType
|
||||
>(
|
||||
"session/saveCurrent",
|
||||
async ({ openNewSession }, { dispatch, extra, getState }) => {
|
||||
async ({ openNewSession, generateTitle }, { dispatch, extra, getState }) => {
|
||||
const state = getState();
|
||||
if (state.session.history.length === 0) {
|
||||
return;
|
||||
|
|
@ -173,7 +174,7 @@ export const saveCurrentSession = createAsyncThunk<
|
|||
?.filter((h) => h.message.role === "assistant")[0]
|
||||
?.message?.content?.toString();
|
||||
|
||||
if (assistantResponse) {
|
||||
if (assistantResponse && generateTitle) {
|
||||
try {
|
||||
const result = await extra.ideMessenger.request(
|
||||
"chatDescriber/describe",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import StreamErrorDialog from "../../pages/gui/StreamError";
|
||||
import { clearLastEmptyResponse, setInactive } from "../slices/sessionSlice";
|
||||
import { setDialogMessage, setShowDialog } from "../slices/uiSlice";
|
||||
import { ThunkApiType } from "../store";
|
||||
import { saveCurrentSession } from "./session";
|
||||
import { setDialogMessage, setShowDialog } from "../slices/uiSlice";
|
||||
import StreamErrorDialog from "../../pages/gui/StreamError";
|
||||
|
||||
export const streamThunkWrapper = createAsyncThunk<
|
||||
void,
|
||||
|
|
@ -23,6 +23,7 @@ export const streamThunkWrapper = createAsyncThunk<
|
|||
await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: false,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
7
package-lock.json
generated
7
package-lock.json
generated
|
|
@ -625,10 +625,11 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"path-key": "^3.1.0",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.0.23",
|
||||
"version": "1.0.26",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
|
|
|||
|
|
@ -36,7 +36,13 @@ export async function resolveFQSN(
|
|||
const reversedSlugs = [...fqsn.packageSlugs].reverse();
|
||||
|
||||
const locationsToLook: SecretLocation[] = [
|
||||
// Packages first
|
||||
// Organization first
|
||||
...reversedSlugs.map((slug) => ({
|
||||
secretType: SecretType.Organization as const,
|
||||
orgSlug: slug.ownerSlug,
|
||||
secretName: fqsn.secretName,
|
||||
})),
|
||||
// Then packages
|
||||
...reversedSlugs.map((slug) => ({
|
||||
secretType: SecretType.Package as const,
|
||||
packageSlug: slug,
|
||||
|
|
@ -48,12 +54,6 @@ export async function resolveFQSN(
|
|||
userSlug: currentUserSlug,
|
||||
secretName: fqsn.secretName,
|
||||
},
|
||||
// Then organization
|
||||
...reversedSlugs.map((slug) => ({
|
||||
secretType: SecretType.Organization as const,
|
||||
orgSlug: slug.ownerSlug,
|
||||
secretName: fqsn.secretName,
|
||||
})),
|
||||
];
|
||||
|
||||
// Then try to get the secret from each location
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import {
|
|||
|
||||
export async function clientRender(
|
||||
unrolledConfigContent: string,
|
||||
secretStore: SecretStore,
|
||||
clientSecretStore: SecretStore,
|
||||
platformClient?: PlatformClient,
|
||||
): Promise<AssistantUnrolled> {
|
||||
// 1. First we need to get a list of all the FQSNs that are required to render the config
|
||||
|
|
@ -23,16 +23,9 @@ export async function clientRender(
|
|||
// 2. Then, we will check which of the secrets are found in the local personal secret store. Here we’re checking for anything that matches the last part of the FQSN, not worrying about the owner/package/owner/package slugs
|
||||
const secretsTemplateData: Record<string, string> = {};
|
||||
|
||||
const unresolvedFQSNs: FQSN[] = [];
|
||||
for (const secret of secrets) {
|
||||
const fqsn = decodeFQSN(secret.replace("secrets.", ""));
|
||||
const secretValue = await secretStore.get(fqsn.secretName);
|
||||
if (secretValue) {
|
||||
secretsTemplateData[secret] = secretValue;
|
||||
} else {
|
||||
unresolvedFQSNs.push(fqsn);
|
||||
}
|
||||
}
|
||||
const unresolvedFQSNs: FQSN[] = secrets.map((secret) => {
|
||||
return decodeFQSN(secret.replace("secrets.", ""));
|
||||
});
|
||||
|
||||
// Don't use platform client in local mode
|
||||
if (platformClient) {
|
||||
|
|
@ -46,7 +39,9 @@ export async function clientRender(
|
|||
}
|
||||
|
||||
if ("value" in secretResult) {
|
||||
secretStore.set(secretResult.fqsn.secretName, secretResult.value);
|
||||
// clientSecretStore.set(secretResult.fqsn.secretName, secretResult.value);
|
||||
// const secretValue = await clientSecretStore.get(fqsn.secretName);
|
||||
secretsTemplateData[encodeFQSN(secretResult.fqsn)] = secretResult.value;
|
||||
}
|
||||
|
||||
secretsTemplateData["secrets." + encodeFQSN(secretResult.fqsn)] =
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ const toolSchema = z.object({
|
|||
const mcpServerSchema = z.object({
|
||||
name: z.string(),
|
||||
command: z.string(),
|
||||
faviconUrl: z.string().optional(),
|
||||
args: z.array(z.string()).optional(),
|
||||
env: z.record(z.string()).optional(),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -176,4 +176,6 @@ describe("E2E Scenarios", () => {
|
|||
);
|
||||
expect(geminiSecretValue2).toBe("gemini-api-key");
|
||||
});
|
||||
|
||||
it.skip("should prioritize org over user / package secrets", () => {});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue