From dbab35643689138c1764ffbda124a8dbaaee10e2 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 28 Jan 2025 14:28:15 -0800 Subject: [PATCH 01/34] remove view history message --- core/protocol/ideWebview.ts | 4 ---- .../actions/ContinuePluginActions.kt | 3 ++- extensions/vscode/src/commands.ts | 2 +- gui/src/components/Layout.tsx | 13 ------------- 4 files changed, 3 insertions(+), 19 deletions(-) diff --git a/core/protocol/ideWebview.ts b/core/protocol/ideWebview.ts index 9cc19504d..3598e06ea 100644 --- a/core/protocol/ideWebview.ts +++ b/core/protocol/ideWebview.ts @@ -79,10 +79,6 @@ export type ToWebviewFromIdeProtocol = ToWebviewFromIdeOrCoreProtocol & { navigateTo: [{ path: string; toggle?: boolean }, void]; addModel: [undefined, void]; - /** - * @deprecated Use navigateTo with a path instead. - */ - viewHistory: [undefined, void]; focusContinueSessionId: [{ sessionId: string | undefined }, void]; newSession: [undefined, void]; setTheme: [{ theme: any }, void]; diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinuePluginActions.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinuePluginActions.kt index 852fb4f02..6a3150145 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinuePluginActions.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinuePluginActions.kt @@ -113,7 +113,8 @@ class NewContinueSessionAction : AnAction() { class ViewHistoryAction : AnAction() { override fun actionPerformed(e: AnActionEvent) { val continuePluginService = getContinuePluginService(e.project) ?: return - continuePluginService.sendToWebview("viewHistory", null) + val params = mapOf("path" to "/history", "toggle" to true) + continuePluginService.sendToWebview("navigateTo", params) } } diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index d8019cfe1..66072e9b9 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -708,7 +708,7 @@ const getCommandsMap: ( sidebar.webviewProtocol?.request("newSession", undefined); }, "continue.viewHistory": () => { - sidebar.webviewProtocol?.request("viewHistory", undefined); + vscode.commands.executeCommand("continue.navigateTo", "/history", true); }, "continue.focusContinueSessionId": async ( sessionId: string | undefined, diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx index cadaa5830..e18becbf7 100644 --- a/gui/src/components/Layout.tsx +++ b/gui/src/components/Layout.tsx @@ -122,19 +122,6 @@ const Layout = () => { [navigate], ); - useWebviewListener( - "viewHistory", - async () => { - // Toggle the history page / main page - if (location.pathname === "/history") { - navigate("/"); - } else { - navigate("/history"); - } - }, - [location, navigate], - ); - useWebviewListener( "navigateTo", async (data) => { From ee8634453ed6c11b36385aecfcf9b3df4b765eee Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 5 Feb 2025 13:50:06 -0800 Subject: [PATCH 02/34] comment out toast --- core/config/migrateSharedConfig.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/core/config/migrateSharedConfig.ts b/core/config/migrateSharedConfig.ts index b68e3adec..189bb21ed 100644 --- a/core/config/migrateSharedConfig.ts +++ b/core/config/migrateSharedConfig.ts @@ -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}`); From 4106405b78641703763a95714bb7e1d969630200 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 5 Feb 2025 15:10:16 -0800 Subject: [PATCH 03/34] remove unused workspace switcher --- extensions/vscode/package-lock.json | 6 +- gui/package-lock.json | 2 +- gui/src/components/AccountDialog.tsx | 110 +++++----- gui/src/components/ProfileSwitcher.tsx | 271 ------------------------- gui/src/context/Auth.tsx | 8 +- 5 files changed, 58 insertions(+), 339 deletions(-) delete mode 100644 gui/src/components/ProfileSwitcher.tsx diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 78a61be2b..2d0215b19 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -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.24", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", diff --git a/gui/package-lock.json b/gui/package-lock.json index 0984ae74d..e77dcafc9 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -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.24", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", diff --git a/gui/src/components/AccountDialog.tsx b/gui/src/components/AccountDialog.tsx index 2b8e17ae4..8c5dbfd7f 100644 --- a/gui/src/components/AccountDialog.tsx +++ b/gui/src/components/AccountDialog.tsx @@ -53,19 +53,6 @@ export default function AccountDialog() { ); } - if (!controlServerBetaEnabled) { - return ( -
-

Account

-

- Continue For Teams is not enabled. You can enable it in your IDE - settings. -

-

Using local config.

-
- ); - } - const dispatch = useDispatch(); const changeProfileId = (id: string) => { @@ -82,60 +69,63 @@ export default function AccountDialog() { "Signed in" ) : ( <> - Signed in as{" "} - {session.account.label} + Signed in as {session.account.id} )} -
- Current workspace + {controlServerBetaEnabled && ( +
+ Current workspace - - {({ open }) => ( -
- - {selectedProfile?.title} -
-
-
+ + {({ open }) => ( +
+ + + {selectedProfile?.title} + +
+
+
- - - {profiles.map((option, idx) => ( - - - {option.title} - - - ))} - {profiles.length === 0 && ( -
- No workspaces found -
- )} -
-
-
- )} -
-
+ + + {profiles.map((option, idx) => ( + + + {option.title} + + + ))} + {profiles.length === 0 && ( +
+ No workspaces found +
+ )} +
+
+
+ )} + +
+ )}
diff --git a/gui/src/components/ProfileSwitcher.tsx b/gui/src/components/ProfileSwitcher.tsx deleted file mode 100644 index 0cecdf815..000000000 --- a/gui/src/components/ProfileSwitcher.tsx +++ /dev/null @@ -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 ( - { - setHovered(true); - }} - onMouseLeave={() => { - setHovered(false); - }} - > -
- {option.title} -
-
- ); -} - -function ProfileSwitcher() { - const ideMessenger = useContext(IdeMessengerContext); - const { session, logout, login } = useAuth(); - const [profiles, setProfiles] = useState([]); - - 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 && ( - { - ideMessenger.post("didChangeSelectedProfile", { id }); - }} - > -
- - {selectedProfile()?.title} -
-
-
- {topDiv && - ReactDOM.createPortal( - - - {profiles.map((option, idx) => ( - 1} - /> - ))} -
- {profiles.length === 0 ? ( - No workspaces found - ) : ( - "Select workspace" - )} -
-
-
, - topDiv, - )} -
-
- )} - - {controlServerBetaEnabled && - (session?.account ? ( - - - - ) : ( - - - - ))} - - ); -} - -export default ProfileSwitcher; diff --git a/gui/src/context/Auth.tsx b/gui/src/context/Auth.tsx index 5154c67ae..0e5641abd 100644 --- a/gui/src/context/Auth.tsx +++ b/gui/src/context/Auth.tsx @@ -152,10 +152,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), + ); }); }, []); From fc23e41e1d036aa1b38ebbff09c5a48a8a6d9271 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 5 Feb 2025 15:11:47 -0800 Subject: [PATCH 04/34] border-solid on scope select --- gui/src/pages/config/ScopeSelect.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/src/pages/config/ScopeSelect.tsx b/gui/src/pages/config/ScopeSelect.tsx index 9ee287e8b..91602f13d 100644 --- a/gui/src/pages/config/ScopeSelect.tsx +++ b/gui/src/pages/config/ScopeSelect.tsx @@ -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 (
- +
{selectedDisplay?.iconUrl ? ( From 284ad970d7b6d3cb78a8dc581b71358ad8bd8098 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 5 Feb 2025 15:16:30 -0800 Subject: [PATCH 05/34] remove AboutAssistantDialog --- .../dialogs/AboutAssistantDialog.tsx | 80 ------------------- .../platform/AssistantSelectOptions.tsx | 12 +-- 2 files changed, 2 insertions(+), 90 deletions(-) delete mode 100644 gui/src/components/dialogs/AboutAssistantDialog.tsx diff --git a/gui/src/components/dialogs/AboutAssistantDialog.tsx b/gui/src/components/dialogs/AboutAssistantDialog.tsx deleted file mode 100644 index 6f1734a92..000000000 --- a/gui/src/components/dialogs/AboutAssistantDialog.tsx +++ /dev/null @@ -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 ( -
-

About {selectedProfileId} assistant

- {configJson.models?.length > 0 && ( -
- Chat models -
    - {configJson.models.map((model, index) => ( -
  • {model.title}
  • - ))} -
-
- )} - - {configJson.embeddingsProvider && ( -
- Embedding model -

{configJson.embeddingsProvider}

-
- )} - - {configJson.reranker?.name && ( -
- Rerank model -

{configJson.reranker.name}

-
- )} - - {configJson.systemMessage && ( -
- Rules -

{configJson.systemMessage}

-
- )} - - {configJson.contextProviders?.length ? ( -
- Context -
    - {configJson.contextProviders.map((provider, index) => ( -
  • {provider.title}
  • - ))} -
-
- ) : null} - - {configJson.tools.length > 0 && ( -
- Tools -
    - {configJson.tools.map((tool, index) => ( -
  • {tool.displayTitle}
  • - ))} -
-
- )} - - {configJson.docs?.length ? ( -
- Docs -
    - {configJson.docs.map((doc, index) => ( -
  • {doc.title}
  • - ))} -
-
- ) : null} -
- ); -} diff --git a/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx b/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx index 436005f23..d9964dc54 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx @@ -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"; @@ -40,13 +38,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()); - dispatch(setShowDialog(true)); - } + ideMessenger.post("config/openProfile", { profileId: option.id }); } function handleClickError(profileId: string) { @@ -61,7 +53,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) From c401e1832fd2a9ccd543493c76750751aaaabe7d Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 5 Feb 2025 17:14:39 -0800 Subject: [PATCH 06/34] open control plane links with orgSlug --- core/config/ProfileLifecycleManager.ts | 1 + core/core.ts | 6 +++++- core/protocol/core.ts | 2 +- gui/src/components/OnboardingCard/platform/tabs/main.tsx | 7 ++++--- .../modelSelection/platform/AssistantSelectOptions.tsx | 1 + 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/core/config/ProfileLifecycleManager.ts b/core/config/ProfileLifecycleManager.ts index 9fc3dc960..deaf5f40e 100644 --- a/core/config/ProfileLifecycleManager.ts +++ b/core/config/ProfileLifecycleManager.ts @@ -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 { diff --git a/core/core.ts b/core/core.ts index edfbc6c95..06f7e923d 100644 --- a/core/core.ts +++ b/core/core.ts @@ -315,7 +315,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) => { diff --git a/core/protocol/core.ts b/core/protocol/core.ts index 64bc5f5d4..c234b668d 100644 --- a/core/protocol/core.ts +++ b/core/protocol/core.ts @@ -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[]]; }; diff --git a/gui/src/components/OnboardingCard/platform/tabs/main.tsx b/gui/src/components/OnboardingCard/platform/tabs/main.tsx index 94e3c0de0..51a40e46d 100644 --- a/gui/src/components/OnboardingCard/platform/tabs/main.tsx +++ b/gui/src/components/OnboardingCard/platform/tabs/main.tsx @@ -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); } diff --git a/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx b/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx index d9964dc54..ab2b6716e 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx @@ -25,6 +25,7 @@ export function AssistantSelectOptions(props: AssistantSelectOptionsProps) { function onNewAssistant() { ideMessenger.post("controlPlane/openUrl", { path: "new", + orgSlug: selectedOrganization?.slug, }); } From 19f0d6bab368dd9c49db448d41212fe8dedf8cc4 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 5 Feb 2025 18:57:46 -0800 Subject: [PATCH 07/34] padding to top of assistant selector --- gui/src/components/PageHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/src/components/PageHeader.tsx b/gui/src/components/PageHeader.tsx index 04317c947..02b117ac1 100644 --- a/gui/src/components/PageHeader.tsx +++ b/gui/src/components/PageHeader.tsx @@ -12,7 +12,7 @@ export default function PageHeader({ rightContent, }: PageHeaderProps) { return ( -
+
{title && (
Date: Wed, 5 Feb 2025 19:28:32 -0800 Subject: [PATCH 08/34] remove "welcome to continue for teams" --- gui/src/context/Auth.tsx | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/gui/src/context/Auth.tsx b/gui/src/context/Auth.tsx index 0e5641abd..0c61cfeed 100644 --- a/gui/src/context/Auth.tsx +++ b/gui/src/context/Auth.tsx @@ -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( - {}} - />, - ), - ); - setLocalStorage("shownProfilesIntroduction", true); - } - resolve(true); }); }); From daa1c0ac8068f87e8028bc389cbf68821e1c8bdb Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 5 Feb 2025 19:39:25 -0800 Subject: [PATCH 09/34] adjust padding of assistant select --- gui/src/components/PageHeader.tsx | 2 +- gui/src/pages/gui/Chat.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gui/src/components/PageHeader.tsx b/gui/src/components/PageHeader.tsx index 02b117ac1..22755926e 100644 --- a/gui/src/components/PageHeader.tsx +++ b/gui/src/components/PageHeader.tsx @@ -12,7 +12,7 @@ export default function PageHeader({ rightContent, }: PageHeaderProps) { return ( -
+
{title && (
0 ? "flex-1" : ""}`} + className={`overflow-y-scroll ${showScrollbar ? "thin-scrollbar" : "no-scrollbar"} ${history.length > 0 ? "flex-1" : ""}`} > {highlights} {history.map((item, index: number) => ( From cd5f4a7266ebb23f3b79337950596b15bbae0357 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 5 Feb 2025 19:49:48 -0800 Subject: [PATCH 10/34] color / style updates --- gui/src/components/index.ts | 8 ++++---- gui/src/pages/config/ScopeSelect.tsx | 2 +- gui/src/pages/config/index.tsx | 2 +- gui/src/pages/gui/Chat.tsx | 6 ++++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gui/src/components/index.ts b/gui/src/components/index.ts index 8f1455c67..d1892bff8 100644 --- a/gui/src/components/index.ts +++ b/gui/src/components/index.ts @@ -134,7 +134,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 +162,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; diff --git a/gui/src/pages/config/ScopeSelect.tsx b/gui/src/pages/config/ScopeSelect.tsx index 91602f13d..a9761a5ea 100644 --- a/gui/src/pages/config/ScopeSelect.tsx +++ b/gui/src/pages/config/ScopeSelect.tsx @@ -32,7 +32,7 @@ export function ScopeSelect() { return (
- +
{selectedDisplay?.iconUrl ? ( diff --git a/gui/src/pages/config/index.tsx b/gui/src/pages/config/index.tsx index 3f9cc611b..c66ad80d0 100644 --- a/gui/src/pages/config/index.tsx +++ b/gui/src/pages/config/index.tsx @@ -154,7 +154,7 @@ function ConfigPage() { onClick={handleOpenConfig} className="!my-0 max-w-[400px]" > - Open configuration file + Open config file
diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index 5f676303a..227eb1154 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -365,9 +365,11 @@ export function Chat() { useAutoScroll(stepsDivRef, history); + const showPageHeader = isInEditMode || usePlatform; + return ( <> - {(isInEditMode || usePlatform) && ( + {showPageHeader && ( 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) => ( From 90a150d2afe4c686293c2635ea4885b9514a0894 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 5 Feb 2025 21:33:49 -0800 Subject: [PATCH 11/34] fix timing bug in MCP loading --- core/config/yaml/loadYaml.ts | 81 ++++++++++++--------- gui/src/context/SubmenuContextProviders.tsx | 23 +++--- 2 files changed, 59 insertions(+), 45 deletions(-) diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 666317447..57a863fb9 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -3,6 +3,7 @@ import fs from "node:fs"; import { AssistantUnrolled, ConfigResult, + ConfigValidationError, parseAssistantUnrolled, validateConfigYaml, } from "@continuedev/config-yaml"; @@ -100,7 +101,8 @@ async function configYamlToContinueConfig( workOsAccessToken: string | undefined, platformConfigMetadata: PlatformConfigMetadata | undefined, allowFreeTrial: boolean = true, -): Promise { +): Promise<{ config: ContinueConfig; errors: ConfigValidationError[] }> { + const errors: ConfigValidationError[] = []; const continueConfig: ContinueConfig = { slashCommands: [ ...(await slashCommandsFromV1PromptFiles(ide)), @@ -259,40 +261,49 @@ 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, + ); + 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 +339,7 @@ export async function loadContinueConfigFromYaml( }; } - const continueConfig = await configYamlToContinueConfig( + const { config: continueConfig, errors } = await configYamlToContinueConfig( configYamlResult.config, ide, ideSettings, @@ -357,7 +368,7 @@ export async function loadContinueConfigFromYaml( return { config: withShared, - errors: configYamlResult.errors, + errors: [...(configYamlResult.errors ?? []), ...errors], configLoadInterrupted: false, }; } diff --git a/gui/src/context/SubmenuContextProviders.tsx b/gui/src/context/SubmenuContextProviders.tsx index 5b6e58fa4..123168e51 100644 --- a/gui/src/context/SubmenuContextProviders.tsx +++ b/gui/src/context/SubmenuContextProviders.tsx @@ -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", { From 26eb176d9b7ddd3958a742a3e31d82967fe77fac Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 5 Feb 2025 21:50:44 -0800 Subject: [PATCH 12/34] always show tools button, but have disabled --- gui/src/components/mainInput/InputToolbar.tsx | 6 ++--- .../InputToolbar/ToggleToolsButton.tsx | 26 ++++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/gui/src/components/mainInput/InputToolbar.tsx b/gui/src/components/mainInput/InputToolbar.tsx index 93b437fdc..f4ea214d0 100644 --- a/gui/src/components/mainInput/InputToolbar.tsx +++ b/gui/src/components/mainInput/InputToolbar.tsx @@ -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) { )} - {shouldRenderToolsButton && } +
{!props.toolbarOptions?.hideUseCodebase && !isInEditMode && (
- {availableTools.map((tool) => ( + {availableTools.map((tool: any) => ( Date: Wed, 5 Feb 2025 22:18:03 -0800 Subject: [PATCH 14/34] favicon for mcp --- core/config/yaml/loadYaml.ts | 2 ++ core/context/mcp/index.ts | 10 +++++++--- core/core.ts | 6 ++++++ core/index.d.ts | 2 ++ core/package-lock.json | 8 ++++---- core/package.json | 2 +- .../mainInput/InputToolbar/ToolDropdownItem.tsx | 9 ++++++++- gui/src/pages/gui/ToolCallDiv/ThreadDiv.tsx | 13 +++++++------ packages/config-yaml/package.json | 2 +- packages/config-yaml/src/schemas/index.ts | 1 + 10 files changed, 39 insertions(+), 16 deletions(-) diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 57a863fb9..e20c02caa 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -286,6 +286,8 @@ async function configYamlToContinueConfig( continueConfig, mcpId, abortController.signal, + server.name, + server.faviconUrl, ); if (mcpError) { errors.push(mcpError); diff --git a/core/context/mcp/index.ts b/core/context/mcp/index.ts index b1a960910..ca5dddfe2 100644 --- a/core/context/mcp/index.ts +++ b/core/context/mcp/index.ts @@ -121,6 +121,8 @@ class MCPConnection { config: ContinueConfig, mcpId: string, signal: AbortSignal, + name: string, + faviconUrl: string | undefined, ): Promise { 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 diff --git a/core/core.ts b/core/core.ts index 06f7e923d..73ff29f8f 100644 --- a/core/core.ts +++ b/core/core.ts @@ -954,6 +954,12 @@ export class Core { }, ); + if (tool.faviconUrl) { + contextItems.forEach((item) => { + item.icon = tool.faviconUrl; + }); + } + return { contextItems }; }); } diff --git a/core/index.d.ts b/core/index.d.ts index 1184b412b..ca9536911 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -874,6 +874,7 @@ export interface Tool { wouldLikeTo: string; readonly: boolean; uri?: string; + faviconUrl?: string; } interface ToolChoice { @@ -994,6 +995,7 @@ export type TransportOptions = StdioOptions | WebSocketOptions | SSEOptions; export interface MCPOptions { transport: TransportOptions; + faviconUrl?: string; } export interface ContinueUIConfig { diff --git a/core/package-lock.json b/core/package-lock.json index 9c6ab8b38..4b2290060 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -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.25", "@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.25", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.25.tgz", + "integrity": "sha512-pEiWNJIfKD8WBUXkRe8Ww8rmAl9zRU931kGuq8tJEJO6o9kwOxqd45dRJT6oFA4I/wRj93PkKjDE2QINNqoBwg==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", diff --git a/core/package.json b/core/package.json index c0f7f736d..7afc752a6 100644 --- a/core/package.json +++ b/core/package.json @@ -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.25", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", diff --git a/gui/src/components/mainInput/InputToolbar/ToolDropdownItem.tsx b/gui/src/components/mainInput/InputToolbar/ToolDropdownItem.tsx index 4309b7a95..5df66f147 100644 --- a/gui/src/components/mainInput/InputToolbar/ToolDropdownItem.tsx +++ b/gui/src/components/mainInput/InputToolbar/ToolDropdownItem.tsx @@ -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) { }} > + {props.tool.faviconUrl && ( + {props.tool.displayTitle} + )} {props.tool.displayTitle}{" "} {/* props.toolCall.function?.name === tool.function.name, + ); + return ( @@ -60,13 +64,10 @@ export function ThreadDiv(props: ThreadDivProps) { > {props.icon}
- Continue wants to{" "} - {renderWouldLikeToMessage( - availableTools.find( - (tool) => props.toolCall.function?.name === tool.function.name, - ), - props.toolCallState, + {tool?.faviconUrl && ( + )} + Continue wants to {renderWouldLikeToMessage(tool, props.toolCallState)} {props.children} diff --git a/packages/config-yaml/package.json b/packages/config-yaml/package.json index c3c5419a9..85bbe3ef3 100644 --- a/packages/config-yaml/package.json +++ b/packages/config-yaml/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.23", + "version": "1.0.25", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/config-yaml/src/schemas/index.ts b/packages/config-yaml/src/schemas/index.ts index 557e40b28..c456b4ab3 100644 --- a/packages/config-yaml/src/schemas/index.ts +++ b/packages/config-yaml/src/schemas/index.ts @@ -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(), }); From 35584f2e2603f3d33b9ca649052d09b7d04875a4 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 5 Feb 2025 22:25:22 -0800 Subject: [PATCH 15/34] improvements to tool call display --- core/config/load.ts | 6 ++++-- core/core.ts | 3 ++- core/index.d.ts | 1 + core/tools/callTool.ts | 15 +++++++++++---- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/core/config/load.ts b/core/config/load.ts index da95ec5a8..5400bc81b 100644 --- a/core/config/load.ts +++ b/core/config/load.ts @@ -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); diff --git a/core/core.ts b/core/core.ts index 73ff29f8f..32be84cda 100644 --- a/core/core.ts +++ b/core/core.ts @@ -944,13 +944,14 @@ 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, }, ); diff --git a/core/index.d.ts b/core/index.d.ts index ca9536911..b1d15847a 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -859,6 +859,7 @@ export interface ToolExtras { ide: IDE; llm: ILLM; fetch: FetchFunction; + tool: Tool; } export interface Tool { diff --git a/core/tools/callTool.ts b/core/tools/callTool.ts index 706fa57d9..f3b565285 100644 --- a/core/tools/callTool.ts +++ b/core/tools/callTool.ts @@ -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 { + const uri = tool.uri ?? tool.function.name; + switch (uri) { case BuiltInToolNames.ReadFile: return await readFileImpl(args, extras); From a600c0191b34dbf98bb8a570bfc3a4b35f9ac2e6 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Thu, 6 Feb 2025 10:39:49 -0800 Subject: [PATCH 16/34] Update package.json --- extensions/vscode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 5ef76d3dc..406064ffb 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -213,7 +213,7 @@ { "command": "continue.toggleFullScreen", "category": "Continue", - "title": "Toggle Full Screen", + "title": "Open in new window", "icon": "$(link-external)", "group": "Continue" }, From dcf6c10ffb6100a7e144d241a250ff077c5928a1 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 6 Feb 2025 11:43:16 -0800 Subject: [PATCH 17/34] prioritize org over user secrets --- packages/config-yaml/src/interfaces/index.ts | 14 +++++++------- packages/config-yaml/src/load/clientRender.ts | 19 +++++++------------ packages/config-yaml/test/index.test.ts | 2 ++ 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/packages/config-yaml/src/interfaces/index.ts b/packages/config-yaml/src/interfaces/index.ts index 3bbd17d92..f8db8b1d4 100644 --- a/packages/config-yaml/src/interfaces/index.ts +++ b/packages/config-yaml/src/interfaces/index.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 diff --git a/packages/config-yaml/src/load/clientRender.ts b/packages/config-yaml/src/load/clientRender.ts index 63bca7e0e..d55d694af 100644 --- a/packages/config-yaml/src/load/clientRender.ts +++ b/packages/config-yaml/src/load/clientRender.ts @@ -14,7 +14,7 @@ import { export async function clientRender( unrolledConfigContent: string, - secretStore: SecretStore, + clientSecretStore: SecretStore, platformClient?: PlatformClient, ): Promise { // 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 = {}; - 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)] = diff --git a/packages/config-yaml/test/index.test.ts b/packages/config-yaml/test/index.test.ts index 8bba163ce..9573b8ae3 100644 --- a/packages/config-yaml/test/index.test.ts +++ b/packages/config-yaml/test/index.test.ts @@ -176,4 +176,6 @@ describe("E2E Scenarios", () => { ); expect(geminiSecretValue2).toBe("gemini-api-key"); }); + + it.skip("should prioritize org over user / package secrets", () => {}); }); From 16d7e0a9266461f8abc4e1d60e1c70bdb1a7f3e7 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 6 Feb 2025 17:53:57 -0800 Subject: [PATCH 18/34] fix opt+enter when currentFile ctx provider not configured --- core/core.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/core.ts b/core/core.ts index 32be84cda..4b5e07b81 100644 --- a/core/core.ts +++ b/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"; @@ -365,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 []; } From ecec00b84aec0de2df9ba6dd790eb3a01b2ab868 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 6 Feb 2025 17:55:03 -0800 Subject: [PATCH 19/34] update config-yaml version --- core/package-lock.json | 8 ++++---- core/package.json | 2 +- extensions/vscode/package-lock.json | 2 +- gui/package-lock.json | 10 +++++----- gui/package.json | 2 +- gui/src/redux/thunks/gatherContext.ts | 8 +++----- packages/config-yaml/package.json | 2 +- 7 files changed, 16 insertions(+), 18 deletions(-) diff --git a/core/package-lock.json b/core/package-lock.json index 4b2290060..814c77601 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -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.25", + "@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.25", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.25.tgz", - "integrity": "sha512-pEiWNJIfKD8WBUXkRe8Ww8rmAl9zRU931kGuq8tJEJO6o9kwOxqd45dRJT6oFA4I/wRj93PkKjDE2QINNqoBwg==", + "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", diff --git a/core/package.json b/core/package.json index 7afc752a6..d57fa66c2 100644 --- a/core/package.json +++ b/core/package.json @@ -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.25", + "@continuedev/config-yaml": "^1.0.26", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 2d0215b19..dabe51aff 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -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.24", + "@continuedev/config-yaml": "^1.0.26", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", diff --git a/gui/package-lock.json b/gui/package-lock.json index e77dcafc9..2519bc970 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -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.24", + "@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", diff --git a/gui/package.json b/gui/package.json index 4500287fa..8476573b2 100644 --- a/gui/package.json +++ b/gui/package.json @@ -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", diff --git a/gui/src/redux/thunks/gatherContext.ts b/gui/src/redux/thunks/gatherContext.ts index 8bae5227e..6b1f11db4 100644 --- a/gui/src/redux/thunks/gatherContext.ts +++ b/gui/src/redux/thunks/gatherContext.ts @@ -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< { diff --git a/packages/config-yaml/package.json b/packages/config-yaml/package.json index 85bbe3ef3..6c620677e 100644 --- a/packages/config-yaml/package.json +++ b/packages/config-yaml/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.25", + "version": "1.0.26", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", From d0d9e74da6e98a8ce394c33a6b6461e8ad0e2de3 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 6 Feb 2025 19:52:49 -0800 Subject: [PATCH 20/34] adjust colors --- gui/src/components/gui/Tooltip.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/src/components/gui/Tooltip.tsx b/gui/src/components/gui/Tooltip.tsx index 6822dc06b..b1477ba73 100644 --- a/gui/src/components/gui/Tooltip.tsx +++ b/gui/src/components/gui/Tooltip.tsx @@ -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) { From d8dac1168f56dcf5396e2b8fc372f2b37200cdf1 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 6 Feb 2025 20:13:44 -0800 Subject: [PATCH 21/34] focus border --- gui/src/components/index.ts | 8 ++++++ gui/src/components/mainInput/TipTapEditor.tsx | 25 ++++++++----------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/gui/src/components/index.ts b/gui/src/components/index.ts index d1892bff8..8c2c7aad7 100644 --- a/gui/src/components/index.ts +++ b/gui/src/components/index.ts @@ -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) { diff --git a/gui/src/components/mainInput/TipTapEditor.tsx b/gui/src/components/mainInput/TipTapEditor.tsx index f78b58720..20bfb8c87 100644 --- a/gui/src/components/mainInput/TipTapEditor.tsx +++ b/gui/src/components/mainInput/TipTapEditor.tsx @@ -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,12 @@ 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}; + &:focus-within { + border: 1px solid ${vscCommandCenterActiveBorder}; + } + outline: none; font-size: ${getFontSize()}px; @@ -173,7 +172,6 @@ interface TipTapEditorProps { ) => void; editorState?: JSONContent; toolbarOptions?: ToolbarOptions; - border?: string; placeholder?: string; historyKey: string; inputId: string; @@ -925,7 +923,6 @@ function TipTapEditor(props: TipTapEditorProps) { return ( Date: Thu, 6 Feb 2025 20:21:43 -0800 Subject: [PATCH 22/34] get rid of lag from generating session title --- gui/src/components/Layout.tsx | 23 +++++++++++-------- gui/src/components/mainInput/TipTapEditor.tsx | 2 ++ gui/src/pages/More/More.tsx | 13 ++++++----- gui/src/redux/thunks/session.ts | 13 ++++++----- gui/src/redux/thunks/streamThunkWrapper.tsx | 5 ++-- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx index 747c2ddab..12c9a5ed8 100644 --- a/gui/src/components/Layout.tsx +++ b/gui/src/components/Layout.tsx @@ -2,27 +2,27 @@ 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, + 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"; const LayoutTopDiv = styled(CustomScrollbarDiv)` height: 100%; @@ -62,6 +62,7 @@ const Layout = () => { await dispatch( saveCurrentSession({ openNewSession: true, + generateTitle: true, }), ); dispatch(exitEditMode()); @@ -85,6 +86,7 @@ const Layout = () => { await dispatch( saveCurrentSession({ openNewSession: true, + generateTitle: true, }), ); dispatch(exitEditMode()); @@ -181,6 +183,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()); @@ -196,6 +200,7 @@ const Layout = () => { await dispatch( saveCurrentSession({ openNewSession: true, + generateTitle: true, }), ); dispatch(focusEdit()); diff --git a/gui/src/components/mainInput/TipTapEditor.tsx b/gui/src/components/mainInput/TipTapEditor.tsx index 20bfb8c87..532fc6d70 100644 --- a/gui/src/components/mainInput/TipTapEditor.tsx +++ b/gui/src/components/mainInput/TipTapEditor.tsx @@ -728,6 +728,7 @@ function TipTapEditor(props: TipTapEditorProps) { await dispatch( saveCurrentSession({ openNewSession: false, + generateTitle: true, }), ); } @@ -761,6 +762,7 @@ function TipTapEditor(props: TipTapEditorProps) { await dispatch( saveCurrentSession({ openNewSession: true, + generateTitle: true, }), ); setTimeout(() => { diff --git a/gui/src/pages/More/More.tsx b/gui/src/pages/More/More.tsx index 360a5951f..b9bc3f4d3 100644 --- a/gui/src/pages/More/More.tsx +++ b/gui/src/pages/More/More.tsx @@ -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" })); diff --git a/gui/src/redux/thunks/session.ts b/gui/src/redux/thunks/session.ts index c311df194..be43f725e 100644 --- a/gui/src/redux/thunks/session.ts +++ b/gui/src/redux/thunks/session.ts @@ -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", diff --git a/gui/src/redux/thunks/streamThunkWrapper.tsx b/gui/src/redux/thunks/streamThunkWrapper.tsx index cd9f10f6d..7bd5a82f9 100644 --- a/gui/src/redux/thunks/streamThunkWrapper.tsx +++ b/gui/src/redux/thunks/streamThunkWrapper.tsx @@ -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, }), ); } From cacddc5d969bc6fabbd945ed369d289413e66182 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 6 Feb 2025 20:25:04 -0800 Subject: [PATCH 23/34] transition border color --- gui/src/components/mainInput/TipTapEditor.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/gui/src/components/mainInput/TipTapEditor.tsx b/gui/src/components/mainInput/TipTapEditor.tsx index 532fc6d70..51fb3e91f 100644 --- a/gui/src/components/mainInput/TipTapEditor.tsx +++ b/gui/src/components/mainInput/TipTapEditor.tsx @@ -87,6 +87,7 @@ const InputBoxDiv = styled.div<{}>` color: ${vscForeground}; border: 1px solid ${vscCommandCenterInactiveBorder}; + transition: border-color 0.15s ease-in-out; &:focus-within { border: 1px solid ${vscCommandCenterActiveBorder}; } From 62be9e68b09d23becac7777f60cbb4fb4d107c8b Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 7 Feb 2025 10:13:06 -0800 Subject: [PATCH 24/34] claude 35 haiku, not 3 --- core/llm/llms/FreeTrial.ts | 2 +- .../components/BestExperienceConfigForm.tsx | 4 +-- gui/src/pages/AddNewModel/AddNewModel.tsx | 10 ++++-- gui/src/pages/AddNewModel/configs/models.ts | 36 ++++++++----------- .../pages/AddNewModel/configs/providers.ts | 18 +++++++--- 5 files changed, 37 insertions(+), 33 deletions(-) diff --git a/core/llm/llms/FreeTrial.ts b/core/llm/llms/FreeTrial.ts index c092a1ecb..ab69aff70 100644 --- a/core/llm/llms/FreeTrial.ts +++ b/core/llm/llms/FreeTrial.ts @@ -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", ]; } diff --git a/gui/src/components/OnboardingCard/components/BestExperienceConfigForm.tsx b/gui/src/components/OnboardingCard/components/BestExperienceConfigForm.tsx index 98f71cce2..389ed72dd 100644 --- a/gui/src/components/OnboardingCard/components/BestExperienceConfigForm.tsx +++ b/gui/src/components/OnboardingCard/components/BestExperienceConfigForm.tsx @@ -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; diff --git a/gui/src/pages/AddNewModel/AddNewModel.tsx b/gui/src/pages/AddNewModel/AddNewModel.tsx index d74cbf25c..f5caa2419 100644 --- a/gui/src/pages/AddNewModel/AddNewModel.tsx +++ b/gui/src/pages/AddNewModel/AddNewModel.tsx @@ -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 = { "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 = { 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], }; diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index 607e466d9..3b3486e79 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -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"], diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 7e0560942..d6f9f76dc 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -111,7 +111,7 @@ export const providers: Partial> = { 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)" }, { From a92368c566f8d97863ab87feae2df3828075dafb Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 7 Feb 2025 10:58:04 -0800 Subject: [PATCH 25/34] if any docs used, add the docs context provider --- core/config/yaml/loadYaml.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index e20c02caa..e4cec3859 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -35,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"; @@ -216,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"), From 1c1849b04564e9c21b35c67ea325cf9f0f83e4eb Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Fri, 7 Feb 2025 12:46:44 -0800 Subject: [PATCH 26/34] fix messaging logic --- .../continue/IdeProtocolClient.kt | 25 ++++--------------- .../toolWindow/ContinueBrowser.kt | 8 ++++-- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IdeProtocolClient.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IdeProtocolClient.kt index efffc54ee..0e009001a 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IdeProtocolClient.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IdeProtocolClient.kt @@ -43,27 +43,12 @@ class IdeProtocolClient( ) } - private fun send(messageType: String, data: Any?, messageId: String? = null) { - val id = messageId ?: uuid() - continuePluginService.sendToWebview(messageType, data, id) - } - fun handleMessage(msg: String, respond: (Any?) -> Unit) { coroutineScope.launch(Dispatchers.IO) { val message = Gson().fromJson(msg, Message::class.java) val messageType = message.messageType val dataElement = message.data - // A couple oddball messages respond directly to GUI, expect a different message format - // e.g. jetbrains/isOSREnabled - fun respondToWebview(content: Any) { - respond(mutableMapOf( - "done" to true, - "status" to "success", - "content" to content - )) - } - try { when (messageType) { "toggleDevTools" -> { @@ -77,12 +62,12 @@ class IdeProtocolClient( "jetbrains/isOSREnabled" -> { val isOSREnabled = ServiceManager.getService(ContinueExtensionSettings::class.java).continueState.enableOSR - respondToWebview(isOSREnabled) + respond(isOSREnabled) } "jetbrains/getColors" -> { val colors = GetTheme().getTheme(); - respondToWebview(colors) + respond(colors) } "jetbrains/onLoad" -> { @@ -92,7 +77,7 @@ class IdeProtocolClient( "vscMachineId" to getMachineUniqueID(), "vscMediaUrl" to "http://continue", ) - respondToWebview(jsonData) + respond(jsonData) } "getIdeSettings" -> { @@ -593,11 +578,11 @@ class IdeProtocolClient( fun sendAcceptRejectDiff(accepted: Boolean, stepIndex: Int) { - send("acceptRejectDiff", AcceptRejectDiff(accepted, stepIndex), uuid()) + continuePluginService.sendToWebview("acceptRejectDiff", AcceptRejectDiff(accepted, stepIndex), uuid()) } fun deleteAtIndex(index: Int) { - send("deleteAtIndex", DeleteAtIndex(index), uuid()) + continuePluginService.sendToWebview("deleteAtIndex", DeleteAtIndex(index), uuid()) } private fun getModelByRole( diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt index 2eb9ae924..cf1b58bcb 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt @@ -53,9 +53,13 @@ class ContinueBrowser(val project: Project, url: String) { ContinuePluginService::class.java ) - + // Webview always expects to receive this format when it initiates val respond = fun(data: Any?) { - sendToWebview(messageType, data, messageId ?: uuid()) + sendToWebview(messageType, mapOf( + "status" to "success", + "content" to data, + "done" to true + ), messageId ?: uuid()) } if (PASS_THROUGH_TO_CORE.contains(messageType)) { From 1f2f3af84ed7d4f7bf1b59597bdde9a60cfa61f0 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Fri, 7 Feb 2025 13:15:27 -0800 Subject: [PATCH 27/34] webview responder --- .../toolWindow/ContinueBrowser.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt index cf1b58bcb..c665efcf3 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt @@ -55,11 +55,7 @@ class ContinueBrowser(val project: Project, url: String) { // Webview always expects to receive this format when it initiates val respond = fun(data: Any?) { - sendToWebview(messageType, mapOf( - "status" to "success", - "content" to data, - "done" to true - ), messageId ?: uuid()) + sendToWebview(messageType, data, messageId ?: uuid()) } if (PASS_THROUGH_TO_CORE.contains(messageType)) { @@ -67,8 +63,16 @@ class ContinueBrowser(val project: Project, url: String) { return@addHandler null } + val respondToWebview = fun(data: Any?) { + sendToWebview(messageType, mapOf( + "status" to "success", + "content" to data, + "done" to true + ), messageId ?: uuid()) + } + if (msg != null) { - continuePluginService.ideProtocolClient?.handleMessage(msg, respond) + continuePluginService.ideProtocolClient?.handleMessage(msg, respondToWebview) } null From 3179d5fd83013d2fe11fdf12de61ba8f50d03c57 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Fri, 7 Feb 2025 13:24:19 -0800 Subject: [PATCH 28/34] comment --- .../continueintellijextension/toolWindow/ContinueBrowser.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt index c665efcf3..4c2ad3b59 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt @@ -53,7 +53,6 @@ class ContinueBrowser(val project: Project, url: String) { ContinuePluginService::class.java ) - // Webview always expects to receive this format when it initiates val respond = fun(data: Any?) { sendToWebview(messageType, data, messageId ?: uuid()) } @@ -63,6 +62,8 @@ class ContinueBrowser(val project: Project, url: String) { return@addHandler null } + // If not pass through, then put it in the status/content/done format for webview + // Core already sends this format val respondToWebview = fun(data: Any?) { sendToWebview(messageType, mapOf( "status" to "success", From 2f5c213abfdc7e371a232cb1b986244839dc3490 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Fri, 7 Feb 2025 16:38:08 -0800 Subject: [PATCH 29/34] fix sonarqube --- .../autocomplete/AutocompleteEditorListener.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt index f4ef8128b..19b0dfa3a 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteEditorListener.kt @@ -3,6 +3,7 @@ package com.github.continuedev.continueintellijextension.autocomplete import com.intellij.openapi.application.invokeLater import com.intellij.openapi.components.service import com.intellij.openapi.editor.Editor +import com.intellij.openapi.editor.EditorKind import com.intellij.openapi.editor.event.* import com.intellij.openapi.fileEditor.FileEditorManager import com.intellij.openapi.fileEditor.FileEditorManagerEvent @@ -11,6 +12,10 @@ import com.intellij.openapi.util.TextRange class AutocompleteCaretListener : CaretListener { override fun caretPositionChanged(event: CaretEvent) { + if(event.editor.editorKind != EditorKind.MAIN_EDITOR) { + return + } + val caret = event.caret ?: return val offset = caret.offset val editor = caret.editor From 05a4e79d15dbe8321220bfd14f16fddc34da0139 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 7 Feb 2025 17:58:40 -0800 Subject: [PATCH 30/34] Update gradle.properties --- extensions/intellij/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/intellij/gradle.properties b/extensions/intellij/gradle.properties index 7028aa723..870baaad5 100644 --- a/extensions/intellij/gradle.properties +++ b/extensions/intellij/gradle.properties @@ -3,7 +3,7 @@ pluginGroup=com.github.continuedev.continueintellijextension pluginName=continue-intellij-extension pluginRepositoryUrl=https://github.com/continuedev/continue # SemVer format -> https://semver.org -pluginVersion=0.0.87 +pluginVersion=0.0.88 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild=223 # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension From 82e41370885ffa2fc361b0970f2f1b4d82bc3784 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Fri, 7 Feb 2025 18:11:17 -0800 Subject: [PATCH 31/34] fix apply button --- core/util/ideUtils.ts | 12 ++++++++++-- gui/src/components/Layout.tsx | 5 +++++ .../StepContainerPreToolbar.tsx | 10 ---------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/core/util/ideUtils.ts b/core/util/ideUtils.ts index 9ed4a47fc..352aad6ca 100644 --- a/core/util/ideUtils.ts +++ b/core/util/ideUtils.ts @@ -34,10 +34,11 @@ export async function resolveRelativePathInDir( If no meaninful path match just concatenates to first dir's uri */ export async function inferResolvedUriFromRelativePath( - relativePath: string, + _relativePath: string, ide: IDE, dirCandidates?: string[], ): Promise { + const relativePath = _relativePath.trim().replaceAll("\\", "/"); const dirs = dirCandidates ?? (await ide.getWorkspaceDirs()); if (dirs.length === 0) { @@ -51,7 +52,7 @@ export async function inferResolvedUriFromRelativePath( suffixes.push(segments.slice(i).join("/")); } - // For each suffix, try to find a unique matching directory + // For each suffix, try to find a unique matching dir/file for (const suffix of suffixes) { const uris = dirs.map((dir) => ({ dir, @@ -78,6 +79,13 @@ export async function inferResolvedUriFromRelativePath( } } + // Sometimes the model will decide to only output the base name or small number of path parts + // in which case we shouldn't create a new file if it matches the current file + const activeFile = await ide.getCurrentFile(); + if (activeFile && activeFile.path.endsWith(relativePath)) { + return activeFile.path; + } + // If no unique match found, use the first directory return joinPathsToUri(dirs[0], relativePath); } diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx index 94a9fb616..887271a9c 100644 --- a/gui/src/components/Layout.tsx +++ b/gui/src/components/Layout.tsx @@ -11,6 +11,7 @@ import { updateApplyState, setMode, newSession, + selectIsInEditMode, } from "../redux/slices/sessionSlice"; import { getFontSize, isMetaEquivalentKeyPressed } from "../util"; import { ROUTES } from "../util/navigation"; @@ -221,7 +222,11 @@ const Layout = () => { [], ); + const isInEditMode = useAppSelector(selectIsInEditMode); useWebviewListener("exitEditMode", async () => { + if (!isInEditMode) { + return; + } dispatch( loadLastSession({ saveCurrentSession: false, diff --git a/gui/src/components/markdown/StepContainerPreToolbar/StepContainerPreToolbar.tsx b/gui/src/components/markdown/StepContainerPreToolbar/StepContainerPreToolbar.tsx index 45faf550a..99e449cc7 100644 --- a/gui/src/components/markdown/StepContainerPreToolbar/StepContainerPreToolbar.tsx +++ b/gui/src/components/markdown/StepContainerPreToolbar/StepContainerPreToolbar.tsx @@ -99,16 +99,6 @@ export default function StepContainerPreToolbar( ideMessenger.ide, ); - // Sometimes the model will decide to only output the base name - // in which case we shouldn't create a new file if it matches the current file - const exists = await ideMessenger.ide.fileExists(fileUri); - if (!exists) { - const activeFile = await ideMessenger.ide.getCurrentFile(); - if (activeFile && activeFile.path.endsWith(props.relativeFilepath)) { - fileUri = activeFile.path; - } - } - ideMessenger.post("applyToFile", { streamId: streamIdRef.current, filepath: fileUri, From d9ab4d82777b5476dc21b0c58dd99587b1f76447 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 7 Feb 2025 20:42:46 -0800 Subject: [PATCH 32/34] bump version --- extensions/vscode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index f610d5887..7017d57da 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -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" From cc975128b2be8daf7069026240aeaa318b174abe Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 9 Feb 2025 14:57:48 -0800 Subject: [PATCH 33/34] pin vscode version for e2e tests --- extensions/vscode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 7017d57da..331f3c8cd 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -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", From 9537b2339eaa81e203a4ef3a5768c3296b5c37a4 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 9 Feb 2025 15:50:15 -0800 Subject: [PATCH 34/34] fix release ci --- .github/workflows/main.yaml | 2 +- .github/workflows/preview.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d10d58ef1..46209d364 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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: diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 945f8d84b..abf58e6e8 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -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: