Merge pull request #3984 from continuedev/nate/polish-client
comment out toast
This commit is contained in:
commit
81b4e4f1e1
48 changed files with 379 additions and 665 deletions
|
|
@ -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,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
|
||||
|
|
|
|||
31
core/core.ts
31
core/core.ts
|
|
@ -53,6 +53,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 +317,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 +367,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 [];
|
||||
}
|
||||
|
|
@ -940,16 +954,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 {
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
];
|
||||
}
|
||||
|
|
|
|||
8
core/package-lock.json
generated
8
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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -197,6 +197,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);
|
||||
|
|
|
|||
6
extensions/vscode/package-lock.json
generated
6
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.9.260",
|
||||
"version": "0.9.261",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.9.260",
|
||||
"version": "0.9.261",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/fetch": "^1.0.3",
|
||||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
10
gui/package-lock.json
generated
10
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",
|
||||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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,6 @@ 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",
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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