From f576742e35b5080e08505396c0b0ac85b6a89206 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 16 Apr 2025 21:43:41 -0700 Subject: [PATCH] remove cft --- core/config/ConfigHandler.ts | 37 ++------- .../profile/ControlPlaneProfileLoader.ts | 80 ------------------- core/config/yaml/loadYaml.ts | 1 - core/control-plane/env.ts | 27 +------ core/core.ts | 4 - core/index.d.ts | 1 - core/protocol/core.ts | 1 - core/protocol/webview.ts | 1 - core/util/filesystem.ts | 1 - extensions/intellij/gradle.properties | 2 +- extensions/vscode/package-lock.json | 6 +- extensions/vscode/package.json | 7 +- extensions/vscode/src/VsCodeIde.ts | 4 - .../vscode/src/stubs/WorkOsAuthProvider.ts | 11 +-- gui/package-lock.json | 2 +- gui/src/context/Auth.tsx | 14 ---- gui/src/pages/config/UserSettingsForm.tsx | 4 +- 17 files changed, 17 insertions(+), 186 deletions(-) delete mode 100644 core/config/profile/ControlPlaneProfileLoader.ts diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index fd628eb06..96e676ce6 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -4,7 +4,7 @@ import { ControlPlaneClient, ControlPlaneSessionInfo, } from "../control-plane/client.js"; -import { getControlPlaneEnv, useHub } from "../control-plane/env.js"; +import { getControlPlaneEnv } from "../control-plane/env.js"; import { BrowserSerializedContinueConfig, ContinueConfig, @@ -16,7 +16,6 @@ import { import { GlobalContext } from "../util/GlobalContext.js"; import { getAllAssistantFiles } from "./loadLocalAssistants.js"; -import ControlPlaneProfileLoader from "./profile/ControlPlaneProfileLoader.js"; import LocalProfileLoader from "./profile/LocalProfileLoader.js"; import PlatformProfileLoader from "./profile/PlatformProfileLoader.js"; import { @@ -135,16 +134,11 @@ export class ConfigHandler { const userId = await this.controlPlaneClient.userId; if (userId) { const orgDescs = await this.controlPlaneClient.listOrganizations(); - if (await useHub(this.ideSettingsPromise)) { - const personalHubOrg = await this.getPersonalHubOrg(); - const hubOrgs = await Promise.all( - orgDescs.map((org) => this.getNonPersonalHubOrg(org)), - ); - return [...hubOrgs, personalHubOrg]; - } else { - // Should only ever be one teams org. Will be removed soon anyways - return await Promise.all(orgDescs.map((org) => this.getTeamsOrg(org))); - } + const personalHubOrg = await this.getPersonalHubOrg(); + const hubOrgs = await Promise.all( + orgDescs.map((org) => this.getNonPersonalHubOrg(org)), + ); + return [...hubOrgs, personalHubOrg]; } else { return [await this.getLocalOrg()]; } @@ -213,25 +207,6 @@ export class ConfigHandler { return this.rectifyProfilesForOrg(this.PERSONAL_ORG_DESC, allLocalProfiles); } - async getTeamsOrg(org: OrganizationDescription): Promise { - const workspaces = await this.controlPlaneClient.listWorkspaces(); - const profiles = await this.getAllLocalProfiles(); - workspaces.forEach((workspace) => { - const profileLoader = new ControlPlaneProfileLoader( - workspace.id, - workspace.name, - this.controlPlaneClient, - this.ide, - this.ideSettingsPromise, - this.llmLogger, - this.reloadConfig.bind(this), - ); - - profiles.push(new ProfileLifecycleManager(profileLoader, this.ide)); - }); - return this.rectifyProfilesForOrg(org, profiles); - } - private async rectifyProfilesForOrg( org: OrganizationDescription, profiles: ProfileLifecycleManager[], diff --git a/core/config/profile/ControlPlaneProfileLoader.ts b/core/config/profile/ControlPlaneProfileLoader.ts deleted file mode 100644 index bf705fd95..000000000 --- a/core/config/profile/ControlPlaneProfileLoader.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { ConfigJson } from "@continuedev/config-types"; -import { ConfigResult } from "@continuedev/config-yaml"; - -import { ControlPlaneClient } from "../../control-plane/client.js"; -import { PRODUCTION_ENV } from "../../control-plane/env.js"; -import { - ContinueConfig, - IDE, - IdeSettings, - ILLMLogger, - SerializedContinueConfig, -} from "../../index.js"; -import { ProfileDescription } from "../ProfileLifecycleManager.js"; - -import doLoadConfig from "./doLoadConfig.js"; -import { IProfileLoader } from "./IProfileLoader.js"; - -export default class ControlPlaneProfileLoader implements IProfileLoader { - private static RELOAD_INTERVAL = 1000 * 60 * 15; // every 15 minutes - - description: ProfileDescription; - - workspaceSettings: ConfigJson | undefined; - - constructor( - private readonly workspaceId: string, - private workspaceTitle: string, - private readonly controlPlaneClient: ControlPlaneClient, - private readonly ide: IDE, - private ideSettingsPromise: Promise, - private llmLogger: ILLMLogger, - private readonly onReload: () => void, - ) { - this.description = { - id: workspaceId, - profileType: "control-plane", - iconUrl: "", - fullSlug: { - ownerSlug: "", - packageSlug: "", - versionSlug: "", - }, - title: workspaceTitle, - errors: undefined, - uri: `${PRODUCTION_ENV.APP_URL}workspaces/${workspaceId}`, - }; - - setInterval(async () => { - this.workspaceSettings = - await this.controlPlaneClient.getSettingsForWorkspace( - this.description.id, - ); - this.onReload(); - }, ControlPlaneProfileLoader.RELOAD_INTERVAL); - } - - async doLoadConfig(): Promise> { - const settings = - this.workspaceSettings ?? - ((await this.controlPlaneClient.getSettingsForWorkspace( - this.description.id, - )) as any); - const serializedConfig: SerializedContinueConfig = settings; - - return await doLoadConfig({ - ide: this.ide, - ideSettingsPromise: this.ideSettingsPromise, - controlPlaneClient: this.controlPlaneClient, - llmLogger: this.llmLogger, - overrideConfigJson: serializedConfig, - overrideConfigYaml: undefined, - platformConfigMetadata: undefined, - profileId: this.workspaceId, - overrideConfigYamlByPath: undefined, - orgScopeId: null, - }); - } - - setIsActive(isActive: boolean): void {} -} diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 21c254349..771f04501 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -112,7 +112,6 @@ async function loadConfigYaml( await controlPlaneClient.getAccessToken(), getControlPlaneEnvSync( ideSettings.continueTestEnvironment, - ideSettings.enableControlServerBeta, ).CONTROL_PLANE_URL, ), { diff --git a/core/control-plane/env.ts b/core/control-plane/env.ts index 7d3ae9eb0..acbc20b59 100644 --- a/core/control-plane/env.ts +++ b/core/control-plane/env.ts @@ -21,16 +21,6 @@ const WORKOS_CLIENT_ID_STAGING = "client_01J0FW6XCPMJMQ3CG51RB4HBZQ"; const WORKOS_ENV_ID_PRODUCTION = "continue"; const WORKOS_ENV_ID_STAGING = "continue-staging"; -export const PRODUCTION_ENV: ControlPlaneEnv = { - DEFAULT_CONTROL_PLANE_PROXY_URL: - "https://control-plane-api-service-i3dqylpbqa-uc.a.run.app/", - CONTROL_PLANE_URL: - "https://control-plane-api-service-i3dqylpbqa-uc.a.run.app/", - AUTH_TYPE: WORKOS_ENV_ID_PRODUCTION, - WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_PRODUCTION, - APP_URL: "https://app.continue.dev/", -}; - const PRODUCTION_HUB_ENV: ControlPlaneEnv = { DEFAULT_CONTROL_PLANE_PROXY_URL: "https://api.continue.dev/", CONTROL_PLANE_URL: "https://api.continue.dev/", @@ -71,15 +61,11 @@ export async function getControlPlaneEnv( ideSettingsPromise: Promise, ): Promise { const ideSettings = await ideSettingsPromise; - return getControlPlaneEnvSync( - ideSettings.continueTestEnvironment, - ideSettings.enableControlServerBeta, - ); + return getControlPlaneEnvSync(ideSettings.continueTestEnvironment); } export function getControlPlaneEnvSync( ideTestEnvironment: IdeSettings["continueTestEnvironment"], - enableControlServerBeta: IdeSettings["enableControlServerBeta"], ): ControlPlaneEnv { // Note .local overrides .staging if (fs.existsSync(getLocalEnvironmentDotFilePath())) { @@ -90,10 +76,6 @@ export function getControlPlaneEnvSync( return STAGING_ENV; } - if (enableControlServerBeta === true) { - return PRODUCTION_ENV; - } - const env = ideTestEnvironment === "production" ? "hub" @@ -109,17 +91,12 @@ export function getControlPlaneEnvSync( ? STAGING_ENV : env === "test" ? TEST_ENV - : env === "hub" - ? PRODUCTION_HUB_ENV - : PRODUCTION_ENV; + : PRODUCTION_HUB_ENV; } export async function useHub( ideSettingsPromise: Promise, ): Promise { const ideSettings = await ideSettingsPromise; - if (ideSettings.enableControlServerBeta) { - return false; - } return ideSettings.continueTestEnvironment !== "none"; } diff --git a/core/core.ts b/core/core.ts index 1b3794456..5f90dd36d 100644 --- a/core/core.ts +++ b/core/core.ts @@ -172,8 +172,6 @@ export class Core { this.configHandler.currentProfile?.profileDescription.id || null, organizations: this.configHandler.getSerializedOrgs(), selectedOrgId: this.configHandler.currentOrg.id, - usingContinueForTeams: (await ideSettingsPromise) - .enableControlServerBeta, }); // update additional submenu context providers registered via VSCode API @@ -429,8 +427,6 @@ export class Core { this.configHandler.currentProfile?.profileDescription.id ?? null, organizations: this.configHandler.getSerializedOrgs(), selectedOrgId: this.configHandler.currentOrg.id, - usingContinueForTeams: (await ideSettingsPromise) - .enableControlServerBeta, }; }); diff --git a/core/index.d.ts b/core/index.d.ts index 6a9adf8a2..5711f9d9e 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -699,7 +699,6 @@ export interface IdeSettings { remoteConfigServerUrl: string | undefined; remoteConfigSyncPeriod: number; userToken: string; - enableControlServerBeta: boolean; continueTestEnvironment: "none" | "production" | "staging" | "local"; pauseCodebaseIndexOnStart: boolean; } diff --git a/core/protocol/core.ts b/core/protocol/core.ts index 3cbed1ad0..e36e71d0c 100644 --- a/core/protocol/core.ts +++ b/core/protocol/core.ts @@ -69,7 +69,6 @@ export type ToCoreFromIdeOrWebviewProtocol = { profileId: string | null; organizations: SerializedOrgWithProfiles[]; selectedOrgId: string; - usingContinueForTeams: boolean; }, ]; "config/deleteModel": [{ title: string }, void]; diff --git a/core/protocol/webview.ts b/core/protocol/webview.ts index 6b59fa338..74ce31559 100644 --- a/core/protocol/webview.ts +++ b/core/protocol/webview.ts @@ -15,7 +15,6 @@ export type ToWebviewFromIdeOrCoreProtocol = { profileId: string | null; organizations: SerializedOrgWithProfiles[]; selectedOrgId: string | null; - usingContinueForTeams: boolean; }, void, ]; diff --git a/core/util/filesystem.ts b/core/util/filesystem.ts index c59eb3320..ff7906e91 100644 --- a/core/util/filesystem.ts +++ b/core/util/filesystem.ts @@ -52,7 +52,6 @@ class FileSystemIde implements IDE { remoteConfigServerUrl: undefined, remoteConfigSyncPeriod: 60, userToken: "", - enableControlServerBeta: false, continueTestEnvironment: "none", pauseCodebaseIndexOnStart: false, }; diff --git a/extensions/intellij/gradle.properties b/extensions/intellij/gradle.properties index 7c00cb65c..ec6ce435b 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=1.0.12 +pluginVersion=1.0.13 # 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 diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 43c1f81c1..4917b02cc 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.23", + "version": "1.1.24", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.23", + "version": "1.1.24", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", @@ -106,7 +106,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.777.0", "@aws-sdk/credential-providers": "^3.778.0", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "file:///Users/dallin/documents/code/continuedev/continue/packages/config-yaml", + "@continuedev/config-yaml": "file:../packages/config-yaml", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.8", "@continuedev/openai-adapters": "^1.0.18", diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 79b03de94..ade2b79fa 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": "1.1.23", + "version": "1.1.24", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" @@ -92,11 +92,6 @@ "default": true, "markdownDescription": "Continue collects anonymous usage data, cleaned of PII, to help us improve the product for our users. Read more at [continue.dev › Telemetry](https://docs.continue.dev/telemetry)." }, - "continue.enableContinueForTeams": { - "type": "boolean", - "default": false, - "markdownDescription": "Enable Continue for teams beta features. To sign in, click the gear icon to go to the settings page, and click Sign In." - }, "continue.showInlineTip": { "type": "boolean", "default": true, diff --git a/extensions/vscode/src/VsCodeIde.ts b/extensions/vscode/src/VsCodeIde.ts index 3c8b66dcd..5725c716a 100644 --- a/extensions/vscode/src/VsCodeIde.ts +++ b/extensions/vscode/src/VsCodeIde.ts @@ -759,10 +759,6 @@ class VsCodeIde implements IDE { 60, ), userToken: settings.get("userToken", ""), - enableControlServerBeta: settings.get( - "enableContinueForTeams", - false, - ), continueTestEnvironment: "production", pauseCodebaseIndexOnStart: settings.get( "pauseCodebaseIndexOnStart", diff --git a/extensions/vscode/src/stubs/WorkOsAuthProvider.ts b/extensions/vscode/src/stubs/WorkOsAuthProvider.ts index 03d9b2174..2e6acfb86 100644 --- a/extensions/vscode/src/stubs/WorkOsAuthProvider.ts +++ b/extensions/vscode/src/stubs/WorkOsAuthProvider.ts @@ -1,7 +1,7 @@ import crypto from "crypto"; import { ControlPlaneSessionInfo } from "core/control-plane/client"; -import { EXTENSION_NAME, getControlPlaneEnvSync } from "core/control-plane/env"; +import { getControlPlaneEnvSync } from "core/control-plane/env"; import fetch from "node-fetch"; import { v4 as uuidv4 } from "uuid"; import { @@ -16,7 +16,6 @@ import { ProgressLocation, Uri, window, - workspace, } from "vscode"; import { PromiseAdapter, promiseFromEvent } from "./promiseUtils"; @@ -25,13 +24,7 @@ import { UriEventHandler } from "./uriHandler"; const AUTH_NAME = "Continue"; -const enableControlServerBeta = workspace - .getConfiguration(EXTENSION_NAME) - .get("enableContinueForTeams", false); -const controlPlaneEnv = getControlPlaneEnvSync( - true ? "production" : "none", - enableControlServerBeta, -); +const controlPlaneEnv = getControlPlaneEnvSync(true ? "production" : "none"); const SESSIONS_SECRET_KEY = `${controlPlaneEnv.AUTH_TYPE}.sessions`; diff --git a/gui/package-lock.json b/gui/package-lock.json index b91832d1e..ef66ddbcc 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -109,7 +109,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.777.0", "@aws-sdk/credential-providers": "^3.778.0", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "file:///Users/dallin/documents/code/continuedev/continue/packages/config-yaml", + "@continuedev/config-yaml": "file:../packages/config-yaml", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.8", "@continuedev/openai-adapters": "^1.0.18", diff --git a/gui/src/context/Auth.tsx b/gui/src/context/Auth.tsx index 329a1ee38..de255fe51 100644 --- a/gui/src/context/Auth.tsx +++ b/gui/src/context/Auth.tsx @@ -29,7 +29,6 @@ interface AuthContextType { selectedProfile: ProfileDescription | null; profiles: ProfileDescription[] | null; refreshProfiles: () => void; - controlServerBetaEnabled: boolean; organizations: OrganizationDescription[]; } @@ -117,18 +116,6 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ [], ); - const [controlServerBetaEnabled, setControlServerBetaEnabled] = - useState(false); - - // Hacky, remove once continue for teams is deprecated - useWebviewListener( - "configUpdate", - async (msg) => { - setControlServerBetaEnabled(msg.usingContinueForTeams); - }, - [], - ); - const refreshProfiles = useCallback(async () => { try { await ideMessenger.request("config/refreshProfiles", undefined); @@ -149,7 +136,6 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ profiles: currentOrg?.profiles ?? [], refreshProfiles, organizations: orgs, - controlServerBetaEnabled, }} > {children} diff --git a/gui/src/pages/config/UserSettingsForm.tsx b/gui/src/pages/config/UserSettingsForm.tsx index 152d701ae..6c7d7c325 100644 --- a/gui/src/pages/config/UserSettingsForm.tsx +++ b/gui/src/pages/config/UserSettingsForm.tsx @@ -8,7 +8,6 @@ import { Input } from "../../components"; import NumberInput from "../../components/gui/NumberInput"; import { Select } from "../../components/gui/Select"; import ToggleSwitch from "../../components/gui/Switch"; -import { useAuth } from "../../context/Auth"; import { IdeMessengerContext } from "../../context/IdeMessenger"; import { useAppDispatch, useAppSelector } from "../../redux/hooks"; import { updateConfig } from "../../redux/slices/configSlice"; @@ -17,7 +16,6 @@ import { getFontSize } from "../../util"; export function UserSettingsForm() { /////// User settings section ////// const dispatch = useAppDispatch(); - const { controlServerBetaEnabled } = useAuth(); const ideMessenger = useContext(IdeMessengerContext); const config = useAppSelector((state) => state.config.config); @@ -118,7 +116,7 @@ export function UserSettingsForm() { ) : null} */} - {!controlServerBetaEnabled || hubEnabled ? ( + {hubEnabled ? (

User settings