Merge pull request #5201 from continuedev/nate/remove-cft

remove cft
This commit is contained in:
Nate Sesti 2025-04-16 21:56:52 -07:00 • committed by GitHub
commit 0f7217e26a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 17 additions and 186 deletions

View file

@ -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<OrgWithProfiles> {
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[],

View file

@ -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<IdeSettings>,
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<ConfigResult<ContinueConfig>> {
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 {}
}

View file

@ -112,7 +112,6 @@ async function loadConfigYaml(
await controlPlaneClient.getAccessToken(),
getControlPlaneEnvSync(
ideSettings.continueTestEnvironment,
ideSettings.enableControlServerBeta,
).CONTROL_PLANE_URL,
),
{

View file

@ -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<IdeSettings>,
): Promise<ControlPlaneEnv> {
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<IdeSettings>,
): Promise<boolean> {
const ideSettings = await ideSettingsPromise;
if (ideSettings.enableControlServerBeta) {
return false;
}
return ideSettings.continueTestEnvironment !== "none";
}

View file

@ -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,
};
});

1
core/index.d.ts vendored
View file

@ -699,7 +699,6 @@ export interface IdeSettings {
remoteConfigServerUrl: string | undefined;
remoteConfigSyncPeriod: number;
userToken: string;
enableControlServerBeta: boolean;
continueTestEnvironment: "none" | "production" | "staging" | "local";
pauseCodebaseIndexOnStart: boolean;
}

View file

@ -69,7 +69,6 @@ export type ToCoreFromIdeOrWebviewProtocol = {
profileId: string | null;
organizations: SerializedOrgWithProfiles[];
selectedOrgId: string;
usingContinueForTeams: boolean;
},
];
"config/deleteModel": [{ title: string }, void];

View file

@ -15,7 +15,6 @@ export type ToWebviewFromIdeOrCoreProtocol = {
profileId: string | null;
organizations: SerializedOrgWithProfiles[];
selectedOrgId: string | null;
usingContinueForTeams: boolean;
},
void,
];

View file

@ -52,7 +52,6 @@ class FileSystemIde implements IDE {
remoteConfigServerUrl: undefined,
remoteConfigSyncPeriod: 60,
userToken: "",
enableControlServerBeta: false,
continueTestEnvironment: "none",
pauseCodebaseIndexOnStart: false,
};

View file

@ -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

View file

@ -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",

View file

@ -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,

View file

@ -759,10 +759,6 @@ class VsCodeIde implements IDE {
60,
),
userToken: settings.get<string>("userToken", ""),
enableControlServerBeta: settings.get<boolean>(
"enableContinueForTeams",
false,
),
continueTestEnvironment: "production",
pauseCodebaseIndexOnStart: settings.get<boolean>(
"pauseCodebaseIndexOnStart",

View file

@ -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<boolean>("enableContinueForTeams", false);
const controlPlaneEnv = getControlPlaneEnvSync(
true ? "production" : "none",
enableControlServerBeta,
);
const controlPlaneEnv = getControlPlaneEnvSync(true ? "production" : "none");
const SESSIONS_SECRET_KEY = `${controlPlaneEnv.AUTH_TYPE}.sessions`;

2
gui/package-lock.json generated
View file

@ -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",

View file

@ -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}

View file

@ -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() {
</SecondaryButton>
</div>
) : null} */}
{!controlServerBetaEnabled || hubEnabled ? (
{hubEnabled ? (
<div className="flex flex-col gap-4 py-4">
<div>
<h2 className="mb-2 mt-0 p-0">User settings</h2>