Merge branch 'main' into nate/cleanup

Resolve conflicts: main already removed most free-trial references
that this branch was also cleaning up. Keep staging indicator from
this branch. Accept useCredits.ts deletion from main.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nate 2026-03-25 14:03:32 -07:00
commit ae42fa9afa
359 changed files with 1809 additions and 26006 deletions

View file

@ -15,7 +15,7 @@ Use double quotes (or backticks if needed) for strings
The code being tested is used in IDE extensions, and it:
- accesses code workspaces through the IDE ("workspace directories")
- persists extension-related data to the the local machine of the user ("global directory"), and
- uses configuration via a `ConfigHandler`, which is stored in either the global directory (default) or accessed via a remote "control plane" using the `ControlPlaneClient`
- uses configuration via a `ConfigHandler`, which is stored in the global directory
Jest testing setup includes
- @core/test/jest.global-setup.ts initializes a temporary global directory, which is where files that store persisted extension data live.
@ -25,7 +25,6 @@ Jest testing setup includes
@core/test/fixtures.ts provides fixtures that should be used in tests to emulate extension behavior
- import `testIde` for IDE/workspace operations
- import `testConfigHandler` for any ConfigHandler needs
- import `testControlPlaneClient` for control plane operations
- import `ideSettingsPromise` for any IdeSettings needs
- import `testLLM` for any ILLM/BaseLLM needs. Set the `completion` property to the desired completion, e.g. `testLLM.completion = "Desired completion";`

2
.idea/gradle.xml generated
View file

@ -5,7 +5,7 @@
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$/extensions/intellij" />
<option name="gradleJvm" value="#JAVA_HOME" />
<option name="gradleHome" value="/usr/local/Cellar/gradle/8.13/libexec" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$/extensions/intellij" />

6
.vscode/launch.json vendored
View file

@ -142,9 +142,6 @@
"env": {
"NODE_ENV": "development",
"USE_VERCEL_AI_SDK_ANTHROPIC": "true"
// "CONTINUE_API_BASE": "http://localhost:3001/",
// "WORKOS_CLIENT_ID": "client_01J0FW6XCPMJMQ3CG51RB4HBZQ",
// "HUB_URL": "http://localhost:3000"
},
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
@ -172,9 +169,6 @@
"env": {
"NODE_ENV": "development",
"CONTINUE_USE_BEDROCK": "1"
// "CONTINUE_API_BASE": "http://localhost:3001/",
// "WORKOS_CLIENT_ID": "client_01J0FW6XCPMJMQ3CG51RB4HBZQ",
// "HUB_URL": "http://localhost:3000"
},
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",

30
TESTING.md Normal file
View file

@ -0,0 +1,30 @@
# PR #2 Testing Checklist — Strip Hub/Mission Control Code
## Critical
- [x] **Extension cold start** — Launch VS Code with the extension. No errors in Output panel ("Continue" channel) or Dev Tools console. _(Found and fixed `message.includes` crash in `webviewProtocol.ts` + removed dead proxy-server error handling block.)_
- [x] **Fresh install onboarding** — Delete/rename `~/.continue/config.yaml`, restart. Onboarding card shows "Configure your models" (no Hub sign-in). _(Removed "Credits" tab, fixed Ollama link padding, title font sizes, and "Google Gemini API API key" duplicate.)_
- [x] **Existing config loads** — With existing `config.yaml`, models/context providers/MCP servers all load.
- [x] **API key resolution from `.env`** — Models using secrets from `~/.continue/.env` or workspace `.env` authenticate and respond.
- [x] **Config reload** — Edit `config.yaml` while running, changes picked up without restart.
## High Priority
- [x] **Profile/assistant switching** — Assistant dropdown shows only local profiles. Switching works. _(Fixed missing profiles list in GUI by adding `profiles` to configUpdate message. Also fixed initial Redux state label and adjusted dropdown styling.)_
- [x] **Compilation** — `tsc --noEmit` passes for core, GUI, and VS Code extension.
- [x] **Test suite** — Vitest tests pass: `LocalPlatformClient` (8), `LocalProfileLoader` (2), `doLoadConfig` (2) — all 12 pass.
- [x] **No telemetry network calls** — Dev Tools Network tab shows no requests to `posthog.com` or `sentry.io`.
- [x] **Agent mode tools** — Start an agent conversation, all tools load correctly.
## Medium Priority
- [x] **MCP servers connect** — Configured MCP servers connect and tools appear.
- [x] **Local blocks in YAML** — Local model block files in `.continue/models/` auto-merge into config correctly.
- [x] **Background mode view** — N/A, component removed from UI routing. No way to navigate to it.
- [x] **Keyboard shortcut `Cmd+Shift+'`** — Toggles between configs without errors.
- [x] **Config settings page** — Settings page renders cleanly, no Account dropdown or Organizations tab. _(Removed GitHub issue/community links.)_
## Low Priority
- [x] **"Main Config" naming** — Fresh installs show "Main Config" as default profile name.
- [x] **IntelliJ startup** — Profiles load correctly after rebuilding core binary. _(Core binary must be rebuilt for IntelliJ to pick up changes.)_

View file

@ -34,7 +34,7 @@
"@types/uuid": "^9.0.8",
"@vercel/ncc": "^0.38.1",
"cross-env": "^7.0.3",
"esbuild": "0.19.11",
"esbuild": "^0.19.11",
"jest": "^29.7.0",
"pkg": "^5.8.1",
"rimraf": "^5.0.7",
@ -59084,6 +59084,8 @@
},
"node_modules/esbuild": {
"version": "0.19.11",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.11.tgz",
"integrity": "sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",

View file

@ -34,7 +34,7 @@
"@types/uuid": "^9.0.8",
"@vercel/ncc": "^0.38.1",
"cross-env": "^7.0.3",
"esbuild": "0.19.11",
"esbuild": "^0.19.11",
"jest": "^29.7.0",
"pkg": "^5.8.1",
"rimraf": "^5.0.7",

View file

@ -282,8 +282,6 @@ export class CompletionProvider {
gitRepo: await this.ide.getRepoName(helper.filepath),
uniqueId: await this.ide.getUniqueId(),
timestamp: new Date().toISOString(),
profileType:
this.configHandler.currentProfile?.profileDescription.profileType,
...helper.options,
};

View file

@ -119,7 +119,6 @@ export class AutocompleteLoggingService {
time: restOfOutcome.time,
useRecentlyEdited: restOfOutcome.useRecentlyEdited,
numLines: restOfOutcome.numLines,
profileType: restOfOutcome.profileType,
};
}
}

View file

@ -43,5 +43,4 @@ export interface AutocompleteOutcome extends TabAutocompleteOptions {
uniqueId: string;
timestamp: string;
enabledStaticContextualization?: boolean;
profileType?: "local" | "platform" | "control-plane";
}

View file

@ -1,6 +1,5 @@
import { ConfigResult, ConfigValidationError } from "@continuedev/config-yaml";
import { ControlPlaneClient } from "../control-plane/client.js";
import {
BrowserSerializedContinueConfig,
ContinueConfig,
@ -12,12 +11,6 @@ import {
import { GlobalContext } from "../util/GlobalContext.js";
import EventEmitter from "node:events";
import {
AuthType,
ControlPlaneSessionInfo,
} from "../control-plane/AuthTypes.js";
import { getControlPlaneEnv } from "../control-plane/env.js";
import { PolicySingleton } from "../control-plane/PolicySingleton.js";
import { Logger } from "../util/Logger.js";
import {
@ -25,13 +18,9 @@ import {
LoadAssistantFilesOptions,
} from "./loadLocalAssistants.js";
import LocalProfileLoader from "./profile/LocalProfileLoader.js";
import PlatformProfileLoader from "./profile/PlatformProfileLoader.js";
import {
OrganizationDescription,
OrgWithProfiles,
ProfileDescription,
ProfileLifecycleManager,
SerializedOrgWithProfiles,
} from "./ProfileLifecycleManager.js";
export type { ProfileDescription };
@ -39,13 +28,15 @@ export type { ProfileDescription };
type ConfigUpdateFunction = (payload: ConfigResult<ContinueConfig>) => void;
export class ConfigHandler {
controlPlaneClient: ControlPlaneClient;
private readonly globalContext = new GlobalContext();
private globalLocalProfileManager: ProfileLifecycleManager;
private organizations: OrgWithProfiles[] = [];
private profiles: ProfileLifecycleManager[] = [];
get profileDescriptions(): ProfileDescription[] {
return this.profiles.map((p) => p.profileDescription);
}
currentProfile: ProfileLifecycleManager | null;
currentOrg: OrgWithProfiles | null;
totalConfigReloads: number = 0;
public isInitialized: Promise<void>;
@ -60,22 +51,15 @@ export class ConfigHandler {
constructor(
private readonly ide: IDE,
private llmLogger: ILLMLogger,
initialSessionInfoPromise: Promise<ControlPlaneSessionInfo | undefined>,
) {
this.controlPlaneClient = new ControlPlaneClient(
initialSessionInfoPromise,
this.ide,
);
// This profile manager will always be available
this.globalLocalProfileManager = new ProfileLifecycleManager(
new LocalProfileLoader(ide, this.controlPlaneClient, this.llmLogger),
new LocalProfileLoader(ide, this.llmLogger),
this.ide,
);
this.currentOrg = null;
this.currentProfile = null;
this.organizations = [];
this.profiles = [];
this.initter = new EventEmitter();
this.isInitialized = new Promise((resolve) => {
@ -95,66 +79,49 @@ export class ConfigHandler {
return this.workspaceDirs.join("&");
}
async getProfileKey(orgId: string) {
const workspaceId = await this.getWorkspaceId();
return `${workspaceId}:::${orgId}`;
}
private async cascadeInit(reason: string, isLogin?: boolean) {
private async cascadeInit(reason: string) {
const signal = this.cascadeAbortController.signal;
this.workspaceDirs = null; // forces workspace dirs reload
// Always update globalLocalProfileManager before recreating all the loaders
// during every cascadeInit so it holds the most recent controlPlaneClient.
this.globalLocalProfileManager = new ProfileLifecycleManager(
new LocalProfileLoader(this.ide, this.controlPlaneClient, this.llmLogger),
new LocalProfileLoader(this.ide, this.llmLogger),
this.ide,
);
try {
const { orgs, errors } = await this.getOrgs();
const { profiles, errors } = await this.loadProfiles();
// Figure out selected org
// Figure out selected profile
const workspaceId = await this.getWorkspaceId();
const selectedOrgs =
this.globalContext.get("lastSelectedOrgIdForWorkspace") ?? {};
let currentSelection = selectedOrgs[workspaceId];
const selectedProfiles =
this.globalContext.get("lastSelectedProfileForWorkspace") ?? {};
const currentSelection = selectedProfiles[workspaceId];
// reset personal org to first available non-personal org on login
if (isLogin && currentSelection === "personal") {
currentSelection = null;
}
const fallback = profiles.length > 0 ? profiles[0] : null;
const firstNonPersonal = orgs.find(
(org) => org.id !== this.PERSONAL_ORG_DESC.id,
);
const fallback: OrgWithProfiles | null =
firstNonPersonal ?? orgs[0] ?? null;
let selectedOrg: OrgWithProfiles | null;
let selectedProfile: ProfileLifecycleManager | null;
if (currentSelection) {
const match = orgs.find((org) => org.id === currentSelection);
if (match) {
selectedOrg = match;
} else {
selectedOrg = fallback;
}
const match = profiles.find(
(profile) => profile.profileDescription.id === currentSelection,
);
selectedProfile = match ?? fallback;
} else {
selectedOrg = fallback;
selectedProfile = fallback;
}
if (signal.aborted) {
return; // local only case, no`fetch to throw abort error
return;
}
this.globalContext.update("lastSelectedOrgIdForWorkspace", {
...selectedOrgs,
[workspaceId]: selectedOrg?.id,
});
if (selectedProfile) {
this.globalContext.update("lastSelectedProfileForWorkspace", {
...selectedProfiles,
[workspaceId]: selectedProfile.profileDescription.id,
});
}
this.organizations = orgs;
this.currentOrg = selectedOrg;
this.currentProfile = selectedOrg?.currentProfile;
this.profiles = profiles;
this.currentProfile = selectedProfile;
await this.reloadConfig(reason, errors);
} catch (e) {
@ -167,190 +134,33 @@ export class ConfigHandler {
}
}
private async getOrgs(): Promise<{
orgs: OrgWithProfiles[];
private async loadProfiles(): Promise<{
profiles: ProfileLifecycleManager[];
errors?: ConfigValidationError[];
}> {
const errors: ConfigValidationError[] = [];
const isSignedIn = await this.controlPlaneClient.isSignedIn();
if (isSignedIn) {
try {
// TODO use policy returned with org, not policy endpoint
const policyResponse = await this.controlPlaneClient.getPolicy();
PolicySingleton.getInstance().policy = policyResponse;
const orgDescriptions =
await this.controlPlaneClient.listOrganizations();
const orgsWithPolicy = orgDescriptions.map((d) => ({
...d,
policy: policyResponse?.policy,
}));
if (policyResponse?.policy?.allowOtherOrgs === false) {
if (orgsWithPolicy.length === 0) {
return { orgs: [] };
} else {
const firstOrg = await this.getNonPersonalHubOrg(orgsWithPolicy[0]);
return { orgs: [firstOrg] };
}
}
const orgs = await Promise.all([
this.getPersonalHubOrg(),
...orgsWithPolicy.map((org) => this.getNonPersonalHubOrg(org)),
]);
// TODO make try/catch more granular here, to catch specific org errors
return { orgs };
} catch (e) {
errors.push({
fatal: false,
message: `Error loading Continue Hub assistants${e instanceof Error ? ":\n" + e.message : ""}`,
});
}
} else {
PolicySingleton.getInstance().policy = null;
}
// Load local org if not signed in or hub orgs fail
try {
const orgs = [await this.getLocalOrg()];
return { orgs };
const profiles = await this.getLocalProfiles({
includeGlobal: true,
includeWorkspace: true,
});
return { profiles };
} catch (e) {
errors.push({
fatal: true,
message: `Error loading local assistants${e instanceof Error ? ":\n" + e.message : ""}`,
});
return {
orgs: [],
profiles: [],
errors,
};
}
}
getSerializedOrgs(): SerializedOrgWithProfiles[] {
return this.organizations.map((org) => ({
iconUrl: org.iconUrl,
id: org.id,
name: org.name,
slug: org.slug,
profiles: org.profiles.map((profile) => profile.profileDescription),
selectedProfileId: org.currentProfile?.profileDescription.id || null,
}));
}
private async getHubProfiles(orgScopeId: string | null) {
const assistants = await this.controlPlaneClient.listAssistants(orgScopeId);
return await Promise.all(
assistants.map(async (assistant) => {
const profileLoader = await PlatformProfileLoader.create({
configResult: {
...assistant.configResult,
config: assistant.configResult.config,
},
ownerSlug: assistant.ownerSlug,
packageSlug: assistant.packageSlug,
iconUrl: assistant.iconUrl,
versionSlug: assistant.configResult.config?.version ?? "latest",
controlPlaneClient: this.controlPlaneClient,
ide: this.ide,
llmLogger: this.llmLogger,
rawYaml: assistant.rawYaml,
orgScopeId: orgScopeId,
});
return new ProfileLifecycleManager(profileLoader, this.ide);
}),
);
}
private async getNonPersonalHubOrg(
org: OrganizationDescription,
): Promise<OrgWithProfiles> {
const localProfiles = await this.getLocalProfiles({
includeGlobal: false,
includeWorkspace: true,
});
const profiles = [...(await this.getHubProfiles(org.id)), ...localProfiles];
return this.rectifyProfilesForOrg(org, profiles);
}
private PERSONAL_ORG_DESC: OrganizationDescription = {
iconUrl: "",
id: "personal",
name: "Personal",
slug: undefined,
};
private async getPersonalHubOrg() {
const localProfiles = await this.getLocalProfiles({
includeGlobal: true,
includeWorkspace: true,
});
const hubProfiles = await this.getHubProfiles(null);
const profiles = [...hubProfiles, ...localProfiles];
return this.rectifyProfilesForOrg(this.PERSONAL_ORG_DESC, profiles);
}
private async getLocalOrg() {
const localProfiles = await this.getLocalProfiles({
includeGlobal: true,
includeWorkspace: true,
});
return this.rectifyProfilesForOrg(this.PERSONAL_ORG_DESC, localProfiles);
}
private async rectifyProfilesForOrg(
org: OrganizationDescription,
profiles: ProfileLifecycleManager[],
): Promise<OrgWithProfiles> {
const profileKey = await this.getProfileKey(org.id);
const selectedProfiles =
this.globalContext.get("lastSelectedProfileForWorkspace") ?? {};
const currentSelection = selectedProfiles[profileKey];
const firstNonLocal = profiles.find(
(profile) => profile.profileDescription.profileType !== "local",
);
const fallback =
firstNonLocal ?? (profiles.length > 0 ? profiles[0] : null);
let currentProfile: ProfileLifecycleManager | null;
if (currentSelection) {
const match = profiles.find(
(profile) => profile.profileDescription.id === currentSelection,
);
if (match) {
currentProfile = match;
} else {
currentProfile = fallback;
}
} else {
currentProfile = fallback;
}
if (currentProfile) {
this.globalContext.update("lastSelectedProfileForWorkspace", {
...selectedProfiles,
[profileKey]: currentProfile.profileDescription.id,
});
}
return {
...org,
profiles,
currentProfile,
};
}
async getLocalProfiles(options: LoadAssistantFilesOptions) {
/**
* Users can define as many local agents as they want in a `.continue/agents` (or previous .continue/assistants) folder
*/
// Local customization disabled for on-premise deployments
const env = await getControlPlaneEnv(this.ide.getIdeSettings());
if (env.AUTH_TYPE === AuthType.OnPrem) {
return [];
}
const localProfiles: ProfileLifecycleManager[] = [];
if (options.includeGlobal) {
@ -369,12 +179,7 @@ export class ConfigHandler {
"agents",
);
const profiles = [...assistantFiles, ...agentFiles].map((assistant) => {
return new LocalProfileLoader(
this.ide,
this.controlPlaneClient,
this.llmLogger,
assistant,
);
return new LocalProfileLoader(this.ide, this.llmLogger, assistant);
});
const localAssistantProfiles = profiles.map(
(profile) => new ProfileLifecycleManager(profile, this.ide),
@ -399,101 +204,27 @@ export class ConfigHandler {
await this.cascadeInit("IDE settings update");
}
// Session change: refresh session and cascade refresh from the top
async updateControlPlaneSessionInfo(
sessionInfo: ControlPlaneSessionInfo | undefined,
) {
const currentSession = await this.controlPlaneClient.sessionInfoPromise;
const newSession = sessionInfo;
let reload = false;
let isLogin = false;
if (newSession) {
if (currentSession) {
if (
newSession.AUTH_TYPE !== AuthType.OnPrem &&
currentSession.AUTH_TYPE !== AuthType.OnPrem
) {
if (newSession.account.id !== currentSession.account.id) {
// session id change (non-on-prem)
reload = true;
}
}
} else {
// log in
reload = true;
isLogin = true;
}
} else {
if (currentSession) {
// log out
reload = true;
}
}
if (reload) {
this.controlPlaneClient = new ControlPlaneClient(
Promise.resolve(sessionInfo),
this.ide,
);
this.abortCascade();
await this.cascadeInit("Control plane session info update", isLogin);
}
return reload;
}
// Org id: check id validity, save selection, switch and reload
async setSelectedOrgId(orgId: string, profileId?: string) {
if (orgId === this.currentOrg?.id) {
return;
}
const org = this.organizations.find((org) => org.id === orgId);
if (!org) {
throw new Error(`Org ${orgId} not found`);
}
const workspaceId = await this.getWorkspaceId();
const selectedOrgs =
this.globalContext.get("lastSelectedOrgIdForWorkspace") ?? {};
this.globalContext.update("lastSelectedOrgIdForWorkspace", {
...selectedOrgs,
[workspaceId]: org.id,
});
this.currentOrg = org;
if (profileId) {
await this.setSelectedProfileId(profileId);
} else {
this.currentProfile = org.currentProfile;
await this.reloadConfig("Selected org changed");
}
}
// Profile id: check id validity, save selection, switch and reload
async setSelectedProfileId(profileId: string) {
if (!this.currentOrg) {
throw new Error(`No org selected`);
}
if (
this.currentProfile &&
profileId === this.currentProfile.profileDescription.id
) {
return;
}
const profile = this.currentOrg.profiles.find(
const profile = this.profiles.find(
(profile) => profile.profileDescription.id === profileId,
);
if (!profile) {
throw new Error(`Profile ${profileId} not found in current org`);
throw new Error(`Profile ${profileId} not found`);
}
const profileKey = await this.getProfileKey(this.currentOrg.id);
const workspaceId = await this.getWorkspaceId();
const selectedProfiles =
this.globalContext.get("lastSelectedProfileForWorkspace") ?? {};
this.globalContext.update("lastSelectedProfileForWorkspace", {
...selectedProfiles,
[profileKey]: profileId,
[workspaceId]: profileId,
});
this.currentProfile = profile;
@ -518,14 +249,12 @@ export class ConfigHandler {
return out;
}
for (const org of this.organizations) {
for (const profile of org.profiles) {
if (
profile.profileDescription.id !==
this.currentProfile.profileDescription.id
) {
profile.clearConfig();
}
for (const profile of this.profiles) {
if (
profile.profileDescription.id !==
this.currentProfile.profileDescription.id
) {
profile.clearConfig();
}
}
@ -609,7 +338,7 @@ export class ConfigHandler {
if (!openProfileId) {
return;
}
const profile = this.currentOrg?.profiles.find(
const profile = this.profiles.find(
(p) => p.profileDescription.id === openProfileId,
);
if (!profile) {
@ -617,13 +346,8 @@ export class ConfigHandler {
return;
}
if (profile.profileDescription.profileType === "local") {
const configFile = element?.sourceFile ?? profile.profileDescription.uri;
await this.ide.openFile(configFile);
} else {
const env = await getControlPlaneEnv(this.ide.getIdeSettings());
await this.ide.openUrl(`${env.APP_URL}${openProfileId}`);
}
const configFile = element?.sourceFile ?? profile.profileDescription.uri;
await this.ide.openFile(configFile);
}
// Ancient method of adding custom providers through vs code

View file

@ -10,10 +10,6 @@ import { defaultConfig } from "./default";
describe.skip("Test the ConfigHandler and E2E config loading", () => {
test("should show only local profile", () => {
const profiles = testConfigHandler.currentOrg?.profiles;
expect(profiles?.length).toBe(1);
expect(profiles?.[0].profileDescription.id).toBe("local");
const currentProfile = testConfigHandler.currentProfile;
expect(currentProfile?.profileDescription.id).toBe("local");
});

View file

@ -2,7 +2,6 @@ import {
ConfigResult,
ConfigValidationError,
FullSlug,
Policy,
} from "@continuedev/config-yaml";
import {
@ -18,7 +17,6 @@ import { IProfileLoader } from "./profile/IProfileLoader.js";
export interface ProfileDescription {
fullSlug: FullSlug;
profileType: "control-plane" | "local" | "platform";
title: string;
id: string;
iconUrl: string;
@ -27,24 +25,6 @@ export interface ProfileDescription {
rawYaml?: string;
}
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
policy?: Policy;
}
export type OrgWithProfiles = OrganizationDescription & {
profiles: ProfileLifecycleManager[];
currentProfile: ProfileLifecycleManager | null;
};
export type SerializedOrgWithProfiles = OrganizationDescription & {
profiles: ProfileDescription[];
selectedProfileId: string | null;
};
export class ProfileLifecycleManager {
private savedConfigResult: ConfigResult<ContinueConfig> | undefined;
private savedBrowserConfigResult?: ConfigResult<BrowserSerializedContinueConfig>;

View file

@ -1,7 +1,7 @@
import { ConfigYaml } from "@continuedev/config-yaml";
export const defaultConfig: ConfigYaml = {
name: "Local Config",
name: "Main Config",
version: "1.0.0",
schema: "v1",
models: [],

View file

@ -36,7 +36,6 @@ import { getLegacyBuiltInSlashCommandFromDescription } from "../commands/slash/b
import { convertCustomCommandToSlashCommand } from "../commands/slash/customSlashCommand";
import { slashCommandFromPromptFile } from "../commands/slash/promptFileSlashCommand";
import { MCPManagerSingleton } from "../context/mcp/MCPManagerSingleton";
import { useHub } from "../control-plane/env";
import { BaseLLM } from "../llm";
import { LLMClasses, llmFromDescription } from "../llm/llms";
import CustomLLMClass from "../llm/llms/CustomLLM";
@ -60,7 +59,6 @@ import { localPathToUri } from "../util/pathToUri";
import { loadJsonMcpConfigs } from "../context/mcp/json/loadJsonMcpConfigs";
import CustomContextProviderClass from "../context/providers/CustomContextProvider";
import { PolicySingleton } from "../control-plane/PolicySingleton";
import { getBaseToolDefinitions, serializeTool } from "../tools";
import { resolveRelativePathInDir } from "../util/ideUtils";
import { getWorkspaceRcConfigs } from "./json/loadRcConfigs";
@ -240,7 +238,6 @@ async function intermediateToFinalConfig({
ideInfo,
uniqueId,
llmLogger,
workOsAccessToken,
loadPromptFiles = true,
}: {
config: Config;
@ -249,7 +246,6 @@ async function intermediateToFinalConfig({
ideInfo: IdeInfo;
uniqueId: string;
llmLogger: ILLMLogger;
workOsAccessToken: string | undefined;
loadPromptFiles?: boolean;
}): Promise<{ config: ContinueConfig; errors: ConfigValidationError[] }> {
const errors: ConfigValidationError[] = [];
@ -346,9 +342,6 @@ async function intermediateToFinalConfig({
"summarize",
]); // Default to chat role if not specified
// Free trial provider is no longer supported — hard-drop any such models
models = models.filter((model) => model.providerName !== "free-trial");
// Tab autocomplete model
const tabAutocompleteModels: BaseLLM[] = [];
if (config.tabAutocompleteModel) {
@ -369,9 +362,7 @@ async function intermediateToFinalConfig({
config.completionOptions,
);
if (llm) {
if (llm.providerName !== "free-trial") {
tabAutocompleteModels.push(llm);
}
tabAutocompleteModels.push(llm);
}
} else {
tabAutocompleteModels.push(new CustomLLMClass(desc));
@ -412,7 +403,7 @@ async function intermediateToFinalConfig({
return embedConfig;
}
const { provider, ...options } = embedConfig;
if (provider === "transformers.js" || provider === "free-trial") {
if (provider === "transformers.js") {
return new TransformersJsEmbeddingsProvider();
} else {
const cls = LLMClasses.find((c) => c.providerName === provider);
@ -449,9 +440,6 @@ async function intermediateToFinalConfig({
return rerankingConfig;
}
const { name, params } = config.reranker as RerankerDescription;
if (name === "free-trial") {
return null;
}
if (name === "llm") {
const llm = models.find((model) => model.title === params?.modelTitle);
if (!llm) {
@ -532,10 +520,7 @@ async function intermediateToFinalConfig({
// Trigger MCP server refreshes (Config is reloaded again once connected!)
const mcpManager = MCPManagerSingleton.getInstance();
const orgPolicy = PolicySingleton.getInstance().policy;
if (orgPolicy?.policy?.allowMcpServers === false) {
await mcpManager.shutdown();
} else {
{
const mcpOptions: InternalMcpOptions[] = (
config.experimental?.modelContextProtocolServers ?? []
).map((server, index) => ({
@ -659,7 +644,6 @@ async function finalToBrowserConfig(
tools: final.tools.map(serializeTool),
mcpServerStatuses: final.mcpServerStatuses,
tabAutocompleteOptions: final.tabAutocompleteOptions,
usePlatform: await useHub(ide.getIdeSettings()),
modelsByRole: Object.fromEntries(
Object.entries(final.modelsByRole).map(([k, v]) => [
k,
@ -810,7 +794,6 @@ async function loadContinueConfigFromJson(
ideInfo: IdeInfo,
uniqueId: string,
llmLogger: ILLMLogger,
workOsAccessToken: string | undefined,
overrideConfigJson: SerializedContinueConfig | undefined,
): Promise<ConfigResult<ContinueConfig>> {
const workspaceConfigs = await getWorkspaceRcConfigs(ide);
@ -906,7 +889,6 @@ async function loadContinueConfigFromJson(
ideInfo,
uniqueId,
llmLogger,
workOsAccessToken,
});
return {
config: finalConfig,

View file

@ -1,6 +1,5 @@
import { ConfigResult, parseConfigYaml } from "@continuedev/config-yaml";
import { ControlPlaneClient } from "../../control-plane/client.js";
import { ContinueConfig, IDE, ILLMLogger } from "../../index.js";
import { ProfileDescription } from "../ProfileLifecycleManager.js";
@ -15,7 +14,6 @@ export default class LocalProfileLoader implements IProfileLoader {
constructor(
private ide: IDE,
private controlPlaneClient: ControlPlaneClient,
private llmLogger: ILLMLogger,
private overrideAssistantFile?:
| { path: string; content: string }
@ -23,7 +21,6 @@ export default class LocalProfileLoader implements IProfileLoader {
) {
const description: ProfileDescription = {
id: overrideAssistantFile?.path ?? LocalProfileLoader.ID,
profileType: "local",
fullSlug: {
ownerSlug: "",
packageSlug: "",
@ -32,7 +29,7 @@ export default class LocalProfileLoader implements IProfileLoader {
iconUrl: "",
title: overrideAssistantFile?.path
? getUriPathBasename(overrideAssistantFile.path)
: "Local Config",
: "Main Config",
errors: undefined,
uri:
overrideAssistantFile?.path ??
@ -56,11 +53,9 @@ export default class LocalProfileLoader implements IProfileLoader {
async doLoadConfig(): Promise<ConfigResult<ContinueConfig>> {
const result = await doLoadConfig({
ide: this.ide,
controlPlaneClient: this.controlPlaneClient,
llmLogger: this.llmLogger,
profileId: this.description.id,
overrideConfigYamlByPath: this.overrideAssistantFile?.path,
orgScopeId: null,
packageIdentifier: {
uriType: "file",
fileUri: this.overrideAssistantFile?.path ?? getPrimaryConfigFilePath(),

View file

@ -1,6 +1,5 @@
import { describe, expect, it, vi } from "vitest";
import { ControlPlaneClient } from "../../control-plane/client.js";
import { LLMLogger } from "../../llm/logger.js";
import { testIde } from "../../test/fixtures.js";
import LocalProfileLoader from "./LocalProfileLoader.js";
@ -17,10 +16,6 @@ vi.mock("./doLoadConfig.js", () => ({
}));
describe("LocalProfileLoader", () => {
const controlPlaneClient = new ControlPlaneClient(
Promise.resolve(undefined),
testIde,
);
const llmLogger = new LLMLogger();
it("should pass pre-read content in packageIdentifier for override files", async () => {
@ -29,12 +24,7 @@ describe("LocalProfileLoader", () => {
content: "name: Test\nversion: 1.0.0\nschema: v1\n",
};
const loader = new LocalProfileLoader(
testIde,
controlPlaneClient,
llmLogger,
overrideFile,
);
const loader = new LocalProfileLoader(testIde, llmLogger, overrideFile);
await loader.doLoadConfig();
@ -50,11 +40,7 @@ describe("LocalProfileLoader", () => {
});
it("should not include content in packageIdentifier when no override file", async () => {
const loader = new LocalProfileLoader(
testIde,
controlPlaneClient,
llmLogger,
);
const loader = new LocalProfileLoader(testIde, llmLogger);
await loader.doLoadConfig();

View file

@ -1,158 +0,0 @@
import { AssistantUnrolled, ConfigResult } from "@continuedev/config-yaml";
import { ControlPlaneClient } from "../../control-plane/client.js";
import { getControlPlaneEnv } from "../../control-plane/env.js";
import { ContinueConfig, IDE, ILLMLogger } from "../../index.js";
import { ProfileDescription } from "../ProfileLifecycleManager.js";
import doLoadConfig from "./doLoadConfig.js";
import { IProfileLoader } from "./IProfileLoader.js";
/**
* Metadata about the package that is currently being loaded
* If this is `undefined`, it's not a config from the platform,
* could be local for example.
*/
export interface PlatformConfigMetadata {
ownerSlug: string;
packageSlug: string;
}
export default class PlatformProfileLoader implements IProfileLoader {
static RELOAD_INTERVAL = 1000 * 5; // 5 seconds
private configResult: ConfigResult<AssistantUnrolled>;
private readonly ownerSlug: string;
private readonly packageSlug: string;
private readonly iconUrl: string;
private readonly versionSlug: string;
private readonly controlPlaneClient: ControlPlaneClient;
private readonly ide: IDE;
private llmLogger: ILLMLogger;
readonly description: ProfileDescription;
private readonly orgScopeId: string | null;
private constructor({
configResult,
ownerSlug,
packageSlug,
iconUrl,
versionSlug,
controlPlaneClient,
ide,
llmLogger,
description,
orgScopeId,
}: {
configResult: ConfigResult<AssistantUnrolled>;
ownerSlug: string;
packageSlug: string;
iconUrl: string;
versionSlug: string;
controlPlaneClient: ControlPlaneClient;
ide: IDE;
llmLogger: ILLMLogger;
description: ProfileDescription;
orgScopeId: string | null;
}) {
this.configResult = configResult;
this.ownerSlug = ownerSlug;
this.packageSlug = packageSlug;
this.iconUrl = iconUrl;
this.versionSlug = versionSlug;
this.controlPlaneClient = controlPlaneClient;
this.ide = ide;
this.llmLogger = llmLogger;
this.description = description;
this.orgScopeId = orgScopeId;
}
static async create({
configResult,
ownerSlug,
packageSlug,
iconUrl,
versionSlug,
controlPlaneClient,
ide,
llmLogger,
rawYaml,
orgScopeId,
}: {
configResult: ConfigResult<AssistantUnrolled>;
ownerSlug: string;
packageSlug: string;
iconUrl: string;
versionSlug: string;
controlPlaneClient: ControlPlaneClient;
ide: IDE;
llmLogger: ILLMLogger;
rawYaml: string;
orgScopeId: string | null;
}): Promise<PlatformProfileLoader> {
const controlPlaneEnv = await getControlPlaneEnv(ide.getIdeSettings());
const description: ProfileDescription = {
id: `${ownerSlug}/${packageSlug}`,
profileType: "platform",
fullSlug: {
ownerSlug,
packageSlug,
versionSlug,
},
title: configResult.config?.name ?? `${ownerSlug}/${packageSlug}`,
errors: configResult.errors,
iconUrl: iconUrl,
uri: `${controlPlaneEnv.APP_URL}${ownerSlug}/${packageSlug}`,
rawYaml,
};
return new PlatformProfileLoader({
configResult,
ownerSlug,
packageSlug,
iconUrl,
versionSlug,
controlPlaneClient,
ide,
llmLogger,
description,
orgScopeId,
});
}
async doLoadConfig(): Promise<ConfigResult<ContinueConfig>> {
if (this.configResult.errors?.find((e) => e.fatal)) {
return {
config: undefined,
errors: this.configResult.errors,
configLoadInterrupted: false,
};
}
const results = await doLoadConfig({
ide: this.ide,
controlPlaneClient: this.controlPlaneClient,
llmLogger: this.llmLogger,
overrideConfigYaml: this.configResult.config,
profileId: this.description.id,
orgScopeId: this.orgScopeId,
packageIdentifier: {
uriType: "slug",
fullSlug: {
ownerSlug: this.ownerSlug,
packageSlug: this.packageSlug,
versionSlug: this.versionSlug,
},
},
});
return {
config: results.config,
errors: [...(this.configResult.errors ?? []), ...(results.errors ?? [])],
configLoadInterrupted: results.configLoadInterrupted,
};
}
setIsActive(isActive: boolean): void {}
}

View file

@ -4,7 +4,6 @@ import {
AssistantUnrolled,
ConfigResult,
ConfigValidationError,
ModelRole,
PackageIdentifier,
} from "@continuedev/config-yaml";
@ -20,13 +19,7 @@ import {
import { stringifyMcpPrompt } from "../../commands/slash/mcpSlashCommand";
import { convertRuleBlockToSlashCommand } from "../../commands/slash/ruleBlockSlashCommand";
import { MCPManagerSingleton } from "../../context/mcp/MCPManagerSingleton";
import ContinueProxyContextProvider from "../../context/providers/ContinueProxyContextProvider";
import MCPContextProvider from "../../context/providers/MCPContextProvider";
import { ControlPlaneProxyInfo } from "../../control-plane/analytics/IAnalyticsProvider.js";
import { ControlPlaneClient } from "../../control-plane/client.js";
import { getControlPlaneEnv } from "../../control-plane/env.js";
import { PolicySingleton } from "../../control-plane/PolicySingleton";
import ContinueProxy from "../../llm/llms/stubs/ContinueProxy";
import { initSlashCommand } from "../../promptFiles/initPrompt";
import { getConfigDependentToolDefinitions } from "../../tools";
import { encodeMCPToolUri } from "../../tools/callTool";
@ -70,32 +63,26 @@ async function loadRules(ide: IDE) {
export default async function doLoadConfig(options: {
ide: IDE;
controlPlaneClient: ControlPlaneClient;
llmLogger: ILLMLogger;
overrideConfigJson?: SerializedContinueConfig;
overrideConfigYaml?: AssistantUnrolled;
profileId: string;
overrideConfigYamlByPath?: string;
orgScopeId: string | null;
packageIdentifier: PackageIdentifier;
}): Promise<ConfigResult<ContinueConfig>> {
const {
ide,
controlPlaneClient,
llmLogger,
overrideConfigJson,
overrideConfigYaml,
profileId,
overrideConfigYamlByPath,
orgScopeId,
packageIdentifier,
} = options;
const ideInfo = await ide.getIdeInfo();
const uniqueId = await ide.getUniqueId();
const ideSettings = await ide.getIdeSettings();
const workOsAccessToken = await controlPlaneClient.getAccessToken();
const isSignedIn = await controlPlaneClient.isSignedIn();
// Migrations for old config files
// Removes
@ -128,10 +115,7 @@ export default async function doLoadConfig(options: {
uniqueId,
llmLogger,
overrideConfigYaml,
controlPlaneClient,
orgScopeId,
packageIdentifier,
workOsAccessToken,
});
newConfig = result.config;
errors = result.errors;
@ -143,7 +127,6 @@ export default async function doLoadConfig(options: {
ideInfo,
uniqueId,
llmLogger,
workOsAccessToken,
overrideConfigJson,
);
newConfig = result.config;
@ -181,14 +164,6 @@ export default async function doLoadConfig(options: {
newConfig.slashCommands.push(initSlashCommand);
const proxyContextProvider = newConfig.contextProviders?.find(
(cp) => cp.description.title === "continue-proxy",
);
if (proxyContextProvider) {
(proxyContextProvider as ContinueProxyContextProvider).workOsAccessToken =
workOsAccessToken;
}
// Show deprecation warnings for providers
const globalContext = new GlobalContext();
newConfig.contextProviders.forEach((provider) => {
@ -311,7 +286,6 @@ export default async function doLoadConfig(options: {
rules: newConfig.rules,
enableExperimentalTools:
newConfig.experimental?.enableExperimentalTools ?? false,
isSignedIn,
isRemote: await ide.isWorkspaceRemote(),
modelName: newConfig.selectedModelByRole.chat?.model,
ide,
@ -368,73 +342,11 @@ export default async function doLoadConfig(options: {
}
}
// Org policies
const policy = PolicySingleton.getInstance().policy?.policy;
if (policy?.allowAnonymousTelemetry === false) {
newConfig.allowAnonymousTelemetry = false;
}
if (policy?.allowCodebaseIndexing === false) {
newConfig.disableIndexing = true;
}
// Setup IdeInfoService
IdeInfoService.setup(uniqueId, ideInfo);
// TODO: pass config to pre-load non-system TTS models
await TTS.setup();
// Set up control plane proxy if configured
const controlPlane = (newConfig as any).controlPlane;
const useOnPremProxy =
controlPlane?.useContinueForTeamsProxy === false && controlPlane?.proxyUrl;
const env = await getControlPlaneEnv(Promise.resolve(ideSettings));
let controlPlaneProxyUrl: string = useOnPremProxy
? controlPlane?.proxyUrl
: env.DEFAULT_CONTROL_PLANE_PROXY_URL;
if (!controlPlaneProxyUrl.endsWith("/")) {
controlPlaneProxyUrl += "/";
}
const controlPlaneProxyInfo = {
profileId,
controlPlaneProxyUrl,
workOsAccessToken,
};
newConfig = await injectControlPlaneProxyInfo(
newConfig,
controlPlaneProxyInfo,
);
return { config: newConfig, errors, configLoadInterrupted: false };
}
// Pass ControlPlaneProxyInfo to objects that need it
async function injectControlPlaneProxyInfo(
config: ContinueConfig,
info: ControlPlaneProxyInfo,
): Promise<ContinueConfig> {
Object.keys(config.modelsByRole).forEach((key) => {
config.modelsByRole[key as ModelRole].forEach((model) => {
if (model.providerName === "continue-proxy") {
(model as ContinueProxy).controlPlaneProxyInfo = info;
}
});
});
Object.keys(config.selectedModelByRole).forEach((key) => {
const model = config.selectedModelByRole[key as ModelRole];
if (model?.providerName === "continue-proxy") {
(model as ContinueProxy).controlPlaneProxyInfo = info;
}
});
config.modelsByRole.chat.forEach((model) => {
if (model.providerName === "continue-proxy") {
(model as ContinueProxy).controlPlaneProxyInfo = info;
}
});
return config;
}

View file

@ -72,17 +72,6 @@ vi.mock("../../util/GlobalContext", () => ({
update() {}
},
}));
vi.mock("../../control-plane/env", () => ({
getControlPlaneEnv: vi.fn().mockResolvedValue({
DEFAULT_CONTROL_PLANE_PROXY_URL: "https://proxy.example.com/",
}),
getControlPlaneEnvSync: vi.fn().mockReturnValue({
CONTROL_PLANE_URL: "https://api.example.com/",
}),
}));
vi.mock("../../control-plane/PolicySingleton", () => ({
PolicySingleton: { getInstance: () => ({ policy: null }) },
}));
vi.mock("../../promptFiles/initPrompt", () => ({
initSlashCommand: { name: "init", description: "init" },
}));
@ -116,12 +105,6 @@ const mockIde = {
isWorkspaceRemote: vi.fn().mockResolvedValue(true),
} as any;
const mockControlPlaneClient = {
getAccessToken: vi.fn().mockResolvedValue("token"),
isSignedIn: vi.fn().mockResolvedValue(false),
sessionInfoPromise: Promise.resolve(undefined),
} as any;
const mockLlmLogger = {} as any;
describe("doLoadConfig pre-read content bypass", () => {
@ -138,11 +121,11 @@ describe("doLoadConfig pre-read content bypass", () => {
await doLoadConfig({
ide: mockIde,
controlPlaneClient: mockControlPlaneClient,
llmLogger: mockLlmLogger,
profileId: "test-profile",
overrideConfigYamlByPath: packageIdentifier.fileUri,
orgScopeId: null,
packageIdentifier,
});
@ -162,11 +145,11 @@ describe("doLoadConfig pre-read content bypass", () => {
await doLoadConfig({
ide: mockIde,
controlPlaneClient: mockControlPlaneClient,
llmLogger: mockLlmLogger,
profileId: "test-profile",
overrideConfigYamlByPath: packageIdentifier.fileUri,
orgScopeId: null,
packageIdentifier,
});

View file

@ -809,7 +809,6 @@ declare global {
| "currentFile"
| "greptile"
| "outline"
| "continue-proxy"
| "highlights"
| "file"
| "issue"

View file

@ -1,40 +0,0 @@
import { decodeSecretLocation, SecretType } from "@continuedev/config-yaml";
import { BrowserSerializedContinueConfig, ModelDescription } from "..";
/**
* Helper function to determine if the config uses an API key that relies on Continue credits (free trial or models add-on)
* @param config The serialized config object
* @returns true if the config is using any free trial models
*/
export function usesCreditsBasedApiKey(
config: BrowserSerializedContinueConfig | null,
): boolean {
if (!config) {
return false;
}
// Check if the currently selected chat model uses free-trial provider
const modelsByRole = config.modelsByRole;
const allModels = [...Object.values(modelsByRole)].flat();
// Check if any of the chat models use free-trial provider
try {
const hasFreeTrial = allModels?.some(modelUsesCreditsBasedApiKey);
return hasFreeTrial;
} catch (e) {
console.error("Error checking for free trial API key:", e);
}
return false;
}
const modelUsesCreditsBasedApiKey = (model: ModelDescription) => {
if (!model.apiKeyLocation) {
return false;
}
const secretType = decodeSecretLocation(model.apiKeyLocation).secretType;
return secretType === SecretType.FreeTrial;
};

View file

@ -1,360 +0,0 @@
import { beforeEach, describe, expect, test, vi } from "vitest";
import { BrowserSerializedContinueConfig } from "..";
// Create the mock before importing anything else
const mockDecodeSecretLocation = vi.fn();
// Mock the module
vi.mock("@continuedev/config-yaml", () => ({
SecretType: {
User: "user",
Organization: "organization",
FreeTrial: "free_trial",
},
decodeSecretLocation: mockDecodeSecretLocation,
}));
describe("usesFreeTrialApiKey", () => {
let usesFreeTrialApiKey: typeof import("./usesFreeTrialApiKey").usesCreditsBasedApiKey;
let SecretType: typeof import("@continuedev/config-yaml").SecretType;
beforeEach(async () => {
mockDecodeSecretLocation.mockReset();
usesFreeTrialApiKey = (await import("./usesFreeTrialApiKey"))
.usesCreditsBasedApiKey;
SecretType = (await import("@continuedev/config-yaml")).SecretType;
});
test("usesFreeTrialApiKey should return false when config is null", () => {
const result = usesFreeTrialApiKey(null);
expect(result).toBe(false);
});
test("usesFreeTrialApiKey should return false when config is undefined", () => {
const result = usesFreeTrialApiKey(undefined as any);
expect(result).toBe(false);
});
test("usesFreeTrialApiKey should return false when no models have apiKeyLocation", () => {
const config: BrowserSerializedContinueConfig = {
modelsByRole: {
chat: [
{
title: "Model 1",
provider: "test",
model: "test-model",
underlyingProviderName: "test",
},
{
title: "Model 2",
provider: "test",
model: "test-model-2",
underlyingProviderName: "test",
},
],
edit: [],
apply: [],
summarize: [],
autocomplete: [],
rerank: [],
embed: [],
subagent: [],
},
selectedModelByRole: {
chat: null,
edit: null,
apply: null,
summarize: null,
autocomplete: null,
rerank: null,
embed: null,
subagent: null,
},
contextProviders: [],
slashCommands: [],
tools: [],
mcpServerStatuses: [],
usePlatform: false,
rules: [],
};
const result = usesFreeTrialApiKey(config);
expect(result).toBe(false);
});
test("usesFreeTrialApiKey should return false when models have apiKeyLocation but none are free trial", () => {
const config: BrowserSerializedContinueConfig = {
modelsByRole: {
chat: [
{
title: "Model 1",
provider: "test",
model: "test-model",
apiKeyLocation: "user:testuser/api-key",
underlyingProviderName: "test",
},
],
edit: [
{
title: "Model 2",
provider: "test",
model: "test-model-2",
apiKeyLocation: "organization:testorg/api-key",
underlyingProviderName: "test",
},
],
apply: [],
summarize: [],
autocomplete: [],
rerank: [],
embed: [],
subagent: [],
},
selectedModelByRole: {
chat: null,
edit: null,
apply: null,
summarize: null,
autocomplete: null,
rerank: null,
embed: null,
subagent: null,
},
contextProviders: [],
slashCommands: [],
tools: [],
mcpServerStatuses: [],
usePlatform: false,
rules: [],
};
mockDecodeSecretLocation
.mockReturnValueOnce({
secretType: SecretType.User,
userSlug: "testuser",
secretName: "api-key",
})
.mockReturnValueOnce({
secretType: SecretType.Organization,
orgSlug: "testorg",
secretName: "api-key",
});
const result = usesFreeTrialApiKey(config);
expect(result).toBe(false);
expect(mockDecodeSecretLocation).toHaveBeenCalledTimes(2);
});
test("usesFreeTrialApiKey should return true when at least one model uses free trial API key", () => {
const config: BrowserSerializedContinueConfig = {
modelsByRole: {
chat: [
{
title: "Model 1",
provider: "test",
model: "test-model",
apiKeyLocation: "user:testuser/api-key",
underlyingProviderName: "test",
},
{
title: "Free Trial Model",
provider: "test",
model: "free-trial-model",
apiKeyLocation: "free_trial:owner/package/api-key",
underlyingProviderName: "test",
},
],
edit: [],
apply: [],
summarize: [],
autocomplete: [],
rerank: [],
embed: [],
subagent: [],
},
selectedModelByRole: {
chat: null,
edit: null,
apply: null,
summarize: null,
autocomplete: null,
rerank: null,
embed: null,
subagent: null,
},
contextProviders: [],
slashCommands: [],
tools: [],
mcpServerStatuses: [],
usePlatform: false,
rules: [],
};
mockDecodeSecretLocation
.mockReturnValueOnce({
secretType: SecretType.User,
userSlug: "testuser",
secretName: "api-key",
})
.mockReturnValueOnce({
secretType: SecretType.FreeTrial,
blockSlug: { ownerSlug: "owner", packageSlug: "package" },
secretName: "api-key",
});
const result = usesFreeTrialApiKey(config);
expect(result).toBe(true);
expect(mockDecodeSecretLocation).toHaveBeenCalledTimes(2);
});
test("usesFreeTrialApiKey should return true when free trial model is in a different role", () => {
const config: BrowserSerializedContinueConfig = {
modelsByRole: {
chat: [
{
title: "Model 1",
provider: "test",
model: "test-model",
apiKeyLocation: "user:testuser/api-key",
underlyingProviderName: "test",
},
],
edit: [
{
title: "Free Trial Edit Model",
provider: "test",
model: "free-trial-edit-model",
apiKeyLocation: "free_trial:owner/package/api-key",
underlyingProviderName: "test",
},
],
apply: [],
summarize: [],
autocomplete: [],
rerank: [],
embed: [],
subagent: [],
},
selectedModelByRole: {
chat: null,
edit: null,
apply: null,
summarize: null,
autocomplete: null,
rerank: null,
embed: null,
subagent: null,
},
contextProviders: [],
slashCommands: [],
tools: [],
mcpServerStatuses: [],
usePlatform: false,
rules: [],
};
mockDecodeSecretLocation
.mockReturnValueOnce({
secretType: SecretType.User,
userSlug: "testuser",
secretName: "api-key",
})
.mockReturnValueOnce({
secretType: SecretType.FreeTrial,
blockSlug: { ownerSlug: "owner", packageSlug: "package" },
secretName: "api-key",
});
const result = usesFreeTrialApiKey(config);
expect(result).toBe(true);
});
test("usesFreeTrialApiKey should return false and log error when decodeSecretLocation throws", () => {
const consoleSpy = vi.spyOn(console, "error").mockImplementation(() => {});
const config: BrowserSerializedContinueConfig = {
modelsByRole: {
chat: [
{
title: "Model 1",
provider: "test",
model: "test-model",
apiKeyLocation: "invalid-secret-location",
underlyingProviderName: "test",
},
],
edit: [],
apply: [],
summarize: [],
autocomplete: [],
rerank: [],
embed: [],
subagent: [],
},
selectedModelByRole: {
chat: null,
edit: null,
apply: null,
summarize: null,
autocomplete: null,
rerank: null,
embed: null,
subagent: null,
},
contextProviders: [],
slashCommands: [],
tools: [],
mcpServerStatuses: [],
usePlatform: false,
rules: [],
};
mockDecodeSecretLocation.mockImplementation(() => {
throw new Error("Invalid secret location format");
});
const result = usesFreeTrialApiKey(config);
expect(result).toBe(false);
expect(consoleSpy).toHaveBeenCalledWith(
"Error checking for free trial API key:",
expect.any(Error),
);
consoleSpy.mockRestore();
});
test("usesFreeTrialApiKey should handle empty modelsByRole object", () => {
const config: BrowserSerializedContinueConfig = {
modelsByRole: {
chat: [],
edit: [],
apply: [],
summarize: [],
autocomplete: [],
rerank: [],
embed: [],
subagent: [],
},
selectedModelByRole: {
chat: null,
edit: null,
apply: null,
summarize: null,
autocomplete: null,
rerank: null,
embed: null,
subagent: null,
},
contextProviders: [],
slashCommands: [],
tools: [],
mcpServerStatuses: [],
usePlatform: false,
rules: [],
};
const result = usesFreeTrialApiKey(config);
expect(result).toBe(false);
expect(mockDecodeSecretLocation).not.toHaveBeenCalled();
});
});

View file

@ -6,16 +6,11 @@ import {
} from "@continuedev/config-yaml";
import * as dotenv from "dotenv";
import { IDE } from "../..";
import { ControlPlaneClient } from "../../control-plane/client";
import { getContinueDotEnv } from "../../util/paths";
import { joinPathsToUri } from "../../util/uri";
export class LocalPlatformClient implements PlatformClient {
constructor(
private orgScopeId: string | null,
private readonly client: ControlPlaneClient,
private readonly ide: IDE,
) {}
constructor(private readonly ide: IDE) {}
/**
* searches for the first valid secret file in order of ~/.continue/.env, <workspace>/.continue/.env, <workspace>/.env
@ -97,41 +92,28 @@ export class LocalPlatformClient implements PlatformClient {
return [];
}
let results: (SecretResult | undefined)[] = [];
try {
results = await this.client.resolveFQSNs(fqsns, this.orgScopeId);
} catch (e) {
console.error("Error getting secrets from control plane", e);
}
const results: (SecretResult | undefined)[] = [];
// For any secret that isn't found, look in .env files, then process.env
for (let i = 0; i < results.length; i++) {
if (!results[i]?.found) {
let secretResult = await this.findSecretInEnvFiles(fqsns[i]);
for (let i = 0; i < fqsns.length; i++) {
let secretResult = await this.findSecretInEnvFiles(fqsns[i]);
// If not found in .env files, try process.env
if (!secretResult?.found) {
const secretValueFromProcessEnv = process.env[fqsns[i].secretName];
if (secretValueFromProcessEnv !== undefined) {
secretResult = {
found: true,
fqsn: fqsns[i],
value: secretValueFromProcessEnv,
secretLocation: {
secretName: fqsns[i].secretName,
// Cast to SecretType.ProcessEnv is necessary because the specific type
// ProcessEnvSecretLocation expects secretType to be exactly SecretType.ProcessEnv,
// not the general enum SecretType.
secretType: SecretType.ProcessEnv as SecretType.ProcessEnv,
},
};
}
}
if (secretResult?.found) {
results[i] = secretResult;
// If not found in .env files, try process.env
if (!secretResult?.found) {
const secretValueFromProcessEnv = process.env[fqsns[i].secretName];
if (secretValueFromProcessEnv !== undefined) {
secretResult = {
found: true,
fqsn: fqsns[i],
value: secretValueFromProcessEnv,
secretLocation: {
secretName: fqsns[i].secretName,
secretType: SecretType.ProcessEnv as SecretType.ProcessEnv,
},
};
}
}
results[i] = secretResult;
}
return results;

View file

@ -9,7 +9,6 @@ import {
vi,
} from "vitest";
import { IDE } from "../..";
import { ControlPlaneClient } from "../../control-plane/client";
import { LocalPlatformClient } from "./LocalPlatformClient";
vi.mock("../../util/paths", { spy: true });
@ -34,23 +33,11 @@ describe("LocalPlatformClient", () => {
secretName: "TEST_WORKSPACE_SECRET_KEY",
};
const testResolvedFQSN: SecretResult = {
found: true,
fqsn: testFQSN,
secretLocation: {
secretName: testFQSN.secretName,
secretType: SecretType.Organization,
orgSlug: "test-org-slug",
},
};
let testControlPlaneClient: ControlPlaneClient;
let testIde: IDE;
beforeEach(
/**dynamic import before each test for test isolation */
async () => {
const testFixtures = await import("../../test/fixtures");
testControlPlaneClient = testFixtures.testControlPlaneClient;
testIde = testFixtures.testIde;
},
);
@ -79,28 +66,11 @@ describe("LocalPlatformClient", () => {
});
test("should not be able to resolve FQSNs if they do not exist", async () => {
const localPlatformClient = new LocalPlatformClient(
null,
testControlPlaneClient,
testIde,
);
const localPlatformClient = new LocalPlatformClient(testIde);
const resolvedFQSNs = await localPlatformClient.resolveFQSNs([testFQSN]);
expect(resolvedFQSNs.length).toBeGreaterThan(0);
expect(resolvedFQSNs[0]?.found).toBe(false);
});
test("should be able to resolve FQSNs if they exist", async () => {
testControlPlaneClient.resolveFQSNs = vi.fn(async () => [testResolvedFQSN]);
const localPlatformClient = new LocalPlatformClient(
null,
testControlPlaneClient,
testIde,
);
const resolvedFQSNs = await localPlatformClient.resolveFQSNs([testFQSN]);
expect(testControlPlaneClient.resolveFQSNs).toHaveBeenCalled();
expect(resolvedFQSNs).toEqual([testResolvedFQSN]);
expect(resolvedFQSNs[0]?.found).toBe(true);
expect(resolvedFQSNs[0]?.found).toBeUndefined();
});
describe("searches for secrets in local .env files", () => {
@ -112,11 +82,7 @@ describe("LocalPlatformClient", () => {
});
test("should be able to get secrets from ~/.continue/.env files", async () => {
const localPlatformClient = new LocalPlatformClient(
null,
testControlPlaneClient,
testIde,
);
const localPlatformClient = new LocalPlatformClient(testIde);
const resolvedFQSNs = await localPlatformClient.resolveFQSNs([testFQSN]);
expect(getContinueDotEnv).toHaveBeenCalled();
expect(resolvedFQSNs.length).toBe(1);
@ -155,11 +121,7 @@ describe("LocalPlatformClient", () => {
return originalIdeReadFile(fileUri);
});
const localPlatformClient = new LocalPlatformClient(
null,
testControlPlaneClient,
testIde,
);
const localPlatformClient = new LocalPlatformClient(testIde);
const resolvedFQSNs = await localPlatformClient.resolveFQSNs([
testFQSN,
testFQSN2,
@ -209,11 +171,7 @@ describe("LocalPlatformClient", () => {
return originalIdeReadFile(fileUri);
});
const localPlatformClient = new LocalPlatformClient(
null,
testControlPlaneClient,
testIde,
);
const localPlatformClient = new LocalPlatformClient(testIde);
const resolvedFQSNs = await localPlatformClient.resolveFQSNs([testFQSN]);
expect(resolvedFQSNs.length).toBe(1);
@ -234,20 +192,6 @@ describe("LocalPlatformClient", () => {
const ogProcessEnv = { ...process.env };
beforeEach(async () => {
// Ensure secrets are not found in ControlPlane initially for these tests
const mockResolveFQSNsNotFound = async (
fqsns: FQSN[],
): Promise<(SecretResult | undefined)[]> =>
fqsns.map((fqsn) => ({
found: false,
fqsn,
secretLocation: {
secretName: fqsn.secretName,
secretType: SecretType.NotFound as SecretType.NotFound,
},
}));
testControlPlaneClient.resolveFQSNs = vi.fn(mockResolveFQSNsNotFound);
// Ensure secrets are not found in local .env files
const utilPaths = await import("../../util/paths");
utilPaths.getContinueDotEnv = vi.fn(() => ({}));
@ -270,11 +214,7 @@ describe("LocalPlatformClient", () => {
const processEnvSecretValue = "secret-from-process-env";
process.env[testFQSN.secretName] = processEnvSecretValue;
const localPlatformClient = new LocalPlatformClient(
null,
testControlPlaneClient,
testIde,
);
const localPlatformClient = new LocalPlatformClient(testIde);
const resolvedFQSNs = await localPlatformClient.resolveFQSNs([testFQSN]);
expect(resolvedFQSNs.length).toBe(1);
@ -297,58 +237,11 @@ describe("LocalPlatformClient", () => {
// Ensure it's not in process.env
expect(process.env[testFQSN.secretName]).toBeUndefined();
const localPlatformClient = new LocalPlatformClient(
null,
testControlPlaneClient,
testIde,
);
const localPlatformClient = new LocalPlatformClient(testIde);
const resolvedFQSNs = await localPlatformClient.resolveFQSNs([testFQSN]);
expect(resolvedFQSNs.length).toBe(1);
expect(resolvedFQSNs[0]?.found).toBe(false);
expect(resolvedFQSNs[0]?.secretLocation?.secretType).toBe(
SecretType.NotFound,
);
});
test("should prioritize ControlPlane over process.env", async () => {
const controlPlaneValue = "secret-from-control-plane";
const mockResolveFQSNsControlPlaneFound = async (): Promise<
(SecretResult | undefined)[]
> => [
{
found: true,
fqsn: testFQSN,
value: controlPlaneValue,
secretLocation: {
secretType: SecretType.Organization as SecretType.Organization,
orgSlug: (testResolvedFQSN.secretLocation as any).orgSlug,
secretName: testFQSN.secretName,
},
},
];
testControlPlaneClient.resolveFQSNs = vi.fn(
mockResolveFQSNsControlPlaneFound,
);
process.env[testFQSN.secretName] =
"secret-from-process-env-should-be-ignored";
const localPlatformClient = new LocalPlatformClient(
null,
testControlPlaneClient,
testIde,
);
const resolvedFQSNs = await localPlatformClient.resolveFQSNs([testFQSN]);
expect(resolvedFQSNs.length).toBe(1);
const result = resolvedFQSNs[0];
expect(result?.found).toBe(true);
expect((result as SecretResult & { value: unknown })?.value).toBe(
controlPlaneValue,
);
expect(result?.secretLocation?.secretType).toBe(SecretType.Organization);
expect(resolvedFQSNs[0]).toBeUndefined();
});
test("should prioritize local ~/.continue/.env file over process.env", async () => {
@ -361,11 +254,7 @@ describe("LocalPlatformClient", () => {
process.env[testFQSN.secretName] =
"secret-from-process-env-should-be-ignored";
const localPlatformClient = new LocalPlatformClient(
null,
testControlPlaneClient,
testIde,
);
const localPlatformClient = new LocalPlatformClient(testIde);
const resolvedFQSNs = await localPlatformClient.resolveFQSNs([testFQSN]);
expect(resolvedFQSNs.length).toBe(1);
@ -393,11 +282,7 @@ describe("LocalPlatformClient", () => {
process.env[testFQSN.secretName] =
"secret-from-process-env-should-be-ignored";
const localPlatformClient = new LocalPlatformClient(
null,
testControlPlaneClient,
testIde,
);
const localPlatformClient = new LocalPlatformClient(testIde);
const resolvedFQSNs = await localPlatformClient.resolveFQSNs([testFQSN]);
expect(resolvedFQSNs.length).toBe(1);

View file

@ -4,7 +4,7 @@ import { AssistantUnrolled } from "@continuedev/config-yaml";
export const defaultConfigYaml: AssistantUnrolled = {
models: [],
context: [],
name: "Local Config",
name: "Main Config",
version: "1.0.0",
schema: "v1",
};
@ -12,7 +12,7 @@ export const defaultConfigYaml: AssistantUnrolled = {
export const defaultConfigYamlJetBrains: AssistantUnrolled = {
models: [],
context: [],
name: "Local Config",
name: "Main Config",
version: "1.0.0",
schema: "v1",
};

View file

@ -6,7 +6,6 @@ import {
unrollAssistantFromContent,
} from "@continuedev/config-yaml";
import { IDE } from "../..";
import { ControlPlaneClient } from "../../control-plane/client";
import { LocalPlatformClient } from "./LocalPlatformClient";
// This is a certain approach to unrolling local YAML where it
@ -16,8 +15,6 @@ export async function unrollLocalYamlBlocks(
packageIdentifiers: PackageIdentifier[],
ide: IDE,
registryClient: RegistryClient,
orgScopeId: string | null,
controlPlaneClient: ControlPlaneClient,
): Promise<ConfigResult<AssistantUnrolled>> {
try {
const unrollResult = await unrollAssistantFromContent(
@ -29,13 +26,7 @@ export async function unrollLocalYamlBlocks(
registryClient,
{
currentUserSlug: "",
onPremProxyUrl: null,
orgScopeId,
platformClient: new LocalPlatformClient(
orgScopeId,
controlPlaneClient,
ide,
),
platformClient: new LocalPlatformClient(ide),
renderSecrets: true,
injectBlocks: packageIdentifiers,
},

View file

@ -23,7 +23,6 @@ import {
InternalMcpOptions,
} from "../..";
import { MCPManagerSingleton } from "../../context/mcp/MCPManagerSingleton";
import { ControlPlaneClient } from "../../control-plane/client";
import TransformersJsEmbeddingsProvider from "../../llm/llms/TransformersJsEmbeddingsProvider";
import { getAllPromptFiles } from "../../promptFiles/getPromptFiles";
import { GlobalContext } from "../../util/GlobalContext";
@ -32,8 +31,6 @@ import { modifyAnyConfigWithSharedConfig } from "../sharedConfig";
import { convertPromptBlockToSlashCommand } from "../../commands/slash/promptBlockSlashCommand";
import { slashCommandFromPromptFile } from "../../commands/slash/promptFileSlashCommand";
import { loadJsonMcpConfigs } from "../../context/mcp/json/loadJsonMcpConfigs";
import { getControlPlaneEnvSync } from "../../control-plane/env";
import { PolicySingleton } from "../../control-plane/PolicySingleton";
import { getBaseToolDefinitions } from "../../tools";
import { getCleanUriPath } from "../../util/uri";
import { loadConfigContextProviders } from "../loadContextProviders";
@ -48,20 +45,11 @@ import {
async function loadConfigYaml(options: {
overrideConfigYaml: AssistantUnrolled | undefined;
controlPlaneClient: ControlPlaneClient;
orgScopeId: string | null;
ideSettings: IdeSettings;
ide: IDE;
packageIdentifier: PackageIdentifier;
}): Promise<ConfigResult<AssistantUnrolled>> {
const {
overrideConfigYaml,
controlPlaneClient,
orgScopeId,
ideSettings,
ide,
packageIdentifier,
} = options;
const { overrideConfigYaml, ideSettings, ide, packageIdentifier } = options;
// Add local .continue blocks
// Use "content" field to pass pre-read content directly, avoiding
@ -82,10 +70,6 @@ async function loadConfigYaml(options: {
await Promise.all(localBlockPromises)
).flat();
// logger.info(
// `Loading config.yaml from ${JSON.stringify(packageIdentifier)} with root path ${rootPath}`,
// );
// Registry client is only used if local blocks are present, but logic same for hub/local assistants
const getRegistryClient = async () => {
const rootPath =
@ -93,9 +77,6 @@ async function loadConfigYaml(options: {
? dirname(getCleanUriPath(packageIdentifier.fileUri))
: undefined;
return new RegistryClient({
accessToken: await controlPlaneClient.getAccessToken(),
apiBase: getControlPlaneEnvSync(ideSettings.continueTestEnvironment)
.CONTROL_PLANE_URL,
rootPath,
});
};
@ -111,8 +92,6 @@ async function loadConfigYaml(options: {
localPackageIdentifiers,
ide,
await getRegistryClient(),
orgScopeId,
controlPlaneClient,
);
if (unrolledLocal.errors) {
errors.push(...unrolledLocal.errors);
@ -129,13 +108,7 @@ async function loadConfigYaml(options: {
{
renderSecrets: true,
currentUserSlug: "",
onPremProxyUrl: null,
orgScopeId,
platformClient: new LocalPlatformClient(
orgScopeId,
controlPlaneClient,
ide,
),
platformClient: new LocalPlatformClient(ide),
injectBlocks: localPackageIdentifiers,
},
);
@ -186,7 +159,6 @@ export async function configYamlToContinueConfig(options: {
ideInfo: IdeInfo;
uniqueId: string;
llmLogger: ILLMLogger;
workOsAccessToken: string | undefined;
}): Promise<{ config: ContinueConfig; errors: ConfigValidationError[] }> {
let { unrolledAssistant, ide, ideInfo, uniqueId, llmLogger } = options;
@ -309,10 +281,6 @@ export async function configYamlToContinueConfig(options: {
for (const model of config.models ?? []) {
model.roles = model.roles ?? defaultModelRoles; // Default to all 4 chat-esque roles if not specified
// Free trial provider is no longer supported — hard-drop
if (model.provider === "free-trial") {
continue;
}
try {
const llms = await llmsFromModelConfig({
model,
@ -398,23 +366,18 @@ export async function configYamlToContinueConfig(options: {
// Trigger MCP server refreshes (Config is reloaded again once connected!)
const mcpManager = MCPManagerSingleton.getInstance();
const orgPolicy = PolicySingleton.getInstance().policy;
if (orgPolicy?.policy?.allowMcpServers === false) {
await mcpManager.shutdown();
} else {
const mcpOptions: InternalMcpOptions[] = (config.mcpServers ?? []).map(
(server) =>
convertYamlMcpConfigToInternalMcpOptions(server, config.requestOptions),
);
const { errors: jsonMcpErrors, mcpServers } = await loadJsonMcpConfigs(
ide,
true,
config.requestOptions,
);
localErrors.push(...jsonMcpErrors);
mcpOptions.push(...mcpServers);
mcpManager.setConnections(mcpOptions, false, { ide });
}
const mcpOptions: InternalMcpOptions[] = (config.mcpServers ?? []).map(
(server) =>
convertYamlMcpConfigToInternalMcpOptions(server, config.requestOptions),
);
const { errors: jsonMcpErrors, mcpServers } = await loadJsonMcpConfigs(
ide,
true,
config.requestOptions,
);
localErrors.push(...jsonMcpErrors);
mcpOptions.push(...mcpServers);
mcpManager.setConnections(mcpOptions, false, { ide });
return { config: continueConfig, errors: localErrors };
}
@ -425,10 +388,7 @@ export async function loadContinueConfigFromYaml(options: {
ideInfo: IdeInfo;
uniqueId: string;
llmLogger: ILLMLogger;
workOsAccessToken: string | undefined;
overrideConfigYaml: AssistantUnrolled | undefined;
controlPlaneClient: ControlPlaneClient;
orgScopeId: string | null;
packageIdentifier: PackageIdentifier;
}): Promise<ConfigResult<ContinueConfig>> {
const {
@ -437,17 +397,12 @@ export async function loadContinueConfigFromYaml(options: {
ideInfo,
uniqueId,
llmLogger,
workOsAccessToken,
overrideConfigYaml,
controlPlaneClient,
orgScopeId,
packageIdentifier,
} = options;
const configYamlResult = await loadConfigYaml({
overrideConfigYaml,
controlPlaneClient,
orgScopeId,
ideSettings,
ide,
packageIdentifier,
@ -468,7 +423,6 @@ export async function loadContinueConfigFromYaml(options: {
ideInfo,
uniqueId,
llmLogger,
workOsAccessToken,
});
// Apply shared config

View file

@ -15,14 +15,6 @@ function getModelClass(
return LLMClasses.find((llm) => llm.providerName === model.provider);
}
// function getContinueProxyModelName(
// ownerSlug: string,
// packageSlug: string,
// model: ModelConfig,
// ): string {
// return `${ownerSlug}/${packageSlug}/${model.provider}/${model.model}`;
// }
async function modelConfigToBaseLLM({
model,
uniqueId,

View file

@ -1,82 +0,0 @@
import { getControlPlaneEnv } from "../../control-plane/env.js";
import {
ContextItem,
ContextProviderDescription,
ContextProviderExtras,
ContextSubmenuItem,
LoadSubmenuItemsArgs,
} from "../../index.js";
import { BaseContextProvider } from "../index.js";
class ContinueProxyContextProvider extends BaseContextProvider {
static description: ContextProviderDescription = {
title: "continue-proxy",
displayTitle: "Continue Proxy",
description: "Retrieve a context item from a Continue for Teams add-on",
type: "submenu",
};
workOsAccessToken: string | undefined = undefined;
override get description(): ContextProviderDescription {
return {
title:
this.options.title || ContinueProxyContextProvider.description.title,
displayTitle:
this.options.displayTitle ||
this.options.name ||
ContinueProxyContextProvider.description.displayTitle,
description:
this.options.description ||
ContinueProxyContextProvider.description.description,
type: this.options.type || ContinueProxyContextProvider.description.type,
};
}
async loadSubmenuItems(
args: LoadSubmenuItemsArgs,
): Promise<ContextSubmenuItem[]> {
const env = await getControlPlaneEnv(args.ide.getIdeSettings());
const response = await args.fetch(
new URL(`/proxy/context/${this.options.id}/list`, env.CONTROL_PLANE_URL),
{
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${this.workOsAccessToken}`,
},
},
);
const data = await response.json();
return data.items;
}
async getContextItems(
query: string,
extras: ContextProviderExtras,
): Promise<ContextItem[]> {
const env = await getControlPlaneEnv(extras.ide.getIdeSettings());
const response = await extras.fetch(
new URL(
`/proxy/context/${this.options.id}/retrieve`,
env.CONTROL_PLANE_URL,
),
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${this.workOsAccessToken}`,
},
body: JSON.stringify({
query: query || "",
fullInput: extras.fullInput,
}),
},
);
const items: any = await response.json();
return items;
}
}
export default ContinueProxyContextProvider;

View file

@ -8,8 +8,6 @@ import {
LoadSubmenuItemsArgs,
RuleWithSource,
} from "../..";
import { getControlPlaneEnv } from "../../control-plane/env";
class RulesContextProvider extends BaseContextProvider {
static description: ContextProviderDescription = {
title: "rules",
@ -33,10 +31,7 @@ class RulesContextProvider extends BaseContextProvider {
return rule.description ?? rule.name ?? "";
}
private getUriFromRule(
rule: RuleWithSource,
appUrl: string,
): ContextItemUri | undefined {
private getUriFromRule(rule: RuleWithSource): ContextItemUri | undefined {
if (rule.sourceFile) {
return {
type: "file",
@ -44,14 +39,6 @@ class RulesContextProvider extends BaseContextProvider {
};
}
if (rule.slug) {
let url = `${appUrl}${rule.slug}`;
return {
type: "url",
value: url,
};
}
return undefined;
}
@ -66,13 +53,12 @@ class RulesContextProvider extends BaseContextProvider {
return [];
}
const env = await getControlPlaneEnv(extras.ide.getIdeSettings());
return [
{
name: this.getNameFromRule(rule),
content: rule.rule,
description: this.getDescriptionFromRule(rule),
uri: this.getUriFromRule(rule, env.APP_URL),
uri: this.getUriFromRule(rule),
},
];
}

View file

@ -6,7 +6,7 @@ import {
FetchFunction,
} from "../..";
import { getHeaders } from "../../continueServer/stubs/headers";
import { TRIAL_PROXY_URL } from "../../control-plane/client";
const TRIAL_PROXY_URL = "https://proxy-server-blue-l6vsfbzhba-uw.a.run.app";
export const fetchSearchResults = async (
query: string,

View file

@ -29,11 +29,7 @@ async function getContextProviderExtras(
setUpTestDir();
const ide = new FileSystemIde(TEST_DIR);
const llmLogger = new LLMLogger();
const configHandler = new ConfigHandler(
ide,
llmLogger,
Promise.resolve(undefined),
);
const configHandler = new ConfigHandler(ide, llmLogger);
await configHandler.isInitialized;
const { config } = await configHandler.loadConfig();
if (!config) {

View file

@ -4,7 +4,7 @@ import { ContextProviderName } from "../../";
import ClipboardContextProvider from "./ClipboardContextProvider";
import CodebaseContextProvider from "./CodebaseContextProvider";
import CodeContextProvider from "./CodeContextProvider";
import ContinueProxyContextProvider from "./ContinueProxyContextProvider";
import CurrentFileContextProvider from "./CurrentFileContextProvider";
import DatabaseContextProvider from "./DatabaseContextProvider";
import DebugLocalsProvider from "./DebugLocalsProvider";
@ -63,7 +63,6 @@ export const Providers: (typeof BaseContextProvider)[] = [
CodeContextProvider,
CurrentFileContextProvider,
URLContextProvider,
ContinueProxyContextProvider,
RepoMapContextProvider,
DiscordContextProvider,
GreptileContextProvider,

View file

@ -1,51 +0,0 @@
export interface HubSessionInfo {
AUTH_TYPE: AuthType.WorkOsProd | AuthType.WorkOsStaging;
accessToken: string;
account: {
label: string;
id: string;
};
}
export interface OnPremSessionInfo {
AUTH_TYPE: AuthType.OnPrem;
}
export type ControlPlaneSessionInfo = HubSessionInfo | OnPremSessionInfo;
export function isOnPremSession(
sessionInfo: ControlPlaneSessionInfo | undefined,
): sessionInfo is OnPremSessionInfo {
return sessionInfo !== undefined && sessionInfo.AUTH_TYPE === AuthType.OnPrem;
}
export enum AuthType {
WorkOsProd = "continue",
WorkOsStaging = "continue-staging",
OnPrem = "on-prem",
}
export interface HubEnv {
DEFAULT_CONTROL_PLANE_PROXY_URL: string;
CONTROL_PLANE_URL: string;
AUTH_TYPE: AuthType.WorkOsProd | AuthType.WorkOsStaging;
WORKOS_CLIENT_ID: string;
APP_URL: string;
}
export interface OnPremEnv {
AUTH_TYPE: AuthType.OnPrem;
DEFAULT_CONTROL_PLANE_PROXY_URL: string;
CONTROL_PLANE_URL: string;
APP_URL: string;
}
export type ControlPlaneEnv = HubEnv | OnPremEnv;
export function isHubEnv(env: ControlPlaneEnv): env is HubEnv {
return (
"AUTH_TYPE" in env &&
env.AUTH_TYPE !== "on-prem" &&
"WORKOS_CLIENT_ID" in env
);
}

View file

@ -1,15 +0,0 @@
import { PolicyResponse } from "./client.js";
export class PolicySingleton {
private static instance: PolicySingleton;
public policy: PolicyResponse | null = null;
private constructor() {}
public static getInstance(): PolicySingleton {
if (!PolicySingleton.instance) {
PolicySingleton.instance = new PolicySingleton();
}
return PolicySingleton.instance;
}
}

View file

@ -1,21 +0,0 @@
import { AnalyticsConfig } from "../..";
export interface AnalyticsMetadata {
extensionVersion: string;
}
export interface ControlPlaneProxyInfo {
workspaceId?: string;
controlPlaneProxyUrl: string;
workOsAccessToken?: string;
}
export interface IAnalyticsProvider {
capture(event: string, properties: { [key: string]: any }): Promise<void>;
setup(
config: AnalyticsConfig,
uniqueId: string,
controlPlaneProxyInfo?: ControlPlaneProxyInfo,
): Promise<void>;
shutdown(): Promise<void>;
}

View file

@ -1,29 +0,0 @@
import { v4 as uuidv4 } from "uuid";
import { IdeSettings } from "../..";
import { isHubEnv } from "../AuthTypes";
import { getControlPlaneEnv } from "../env";
export async function getAuthUrlForTokenPage(
ideSettingsPromise: Promise<IdeSettings>,
useOnboarding: boolean,
): Promise<string> {
const env = await getControlPlaneEnv(ideSettingsPromise);
if (!isHubEnv(env)) {
throw new Error("Sign in disabled");
}
const url = new URL("https://api.workos.com/user_management/authorize");
const params = {
response_type: "code",
client_id: env.WORKOS_CLIENT_ID,
redirect_uri: `${env.APP_URL}tokens/${useOnboarding ? "onboarding-" : ""}callback`,
// redirect_uri: "http://localhost:3000/tokens/callback",
state: uuidv4(),
provider: "authkit",
};
Object.keys(params).forEach((key) =>
url.searchParams.append(key, params[key as keyof typeof params]),
);
return url.toString();
}

View file

@ -1,662 +0,0 @@
import { ConfigJson } from "@continuedev/config-types";
import {
AssistantUnrolled,
ConfigResult,
FQSN,
FullSlug,
Policy,
SecretResult,
SecretType,
} from "@continuedev/config-yaml";
import fetch, { RequestInit, Response } from "node-fetch";
import { OrganizationDescription } from "../config/ProfileLifecycleManager.js";
import {
BaseSessionMetadata,
IDE,
ModelDescription,
Session,
} from "../index.js";
import { Logger } from "../util/Logger.js";
import {
ControlPlaneSessionInfo,
HubSessionInfo,
isOnPremSession,
} from "./AuthTypes.js";
import { getControlPlaneEnv } from "./env.js";
export interface PolicyResponse {
orgSlug?: string;
policy?: Policy;
}
export interface ControlPlaneWorkspace {
id: string;
name: string;
settings: ConfigJson;
}
export interface ControlPlaneModelDescription extends ModelDescription {}
export interface CreditStatus {
optedInToFreeTrial: boolean;
hasCredits: boolean;
creditBalance: number;
hasPurchasedCredits: boolean;
}
export const TRIAL_PROXY_URL =
"https://proxy-server-blue-l6vsfbzhba-uw.a.run.app";
export interface RemoteSessionMetadata extends BaseSessionMetadata {
isRemote: true;
remoteId: string;
}
export interface AgentSessionMetadata {
createdBy: string;
github_repo: string;
organizationId?: string;
idempotencyKey?: string;
source?: string;
continueApiKeyId?: string;
s3Url?: string;
prompt?: string | null;
createdBySlug?: string;
}
export interface AgentSessionView {
id: string;
devboxId: string | null;
name: string | null;
icon: string | null;
status: string;
agentStatus: string | null;
unread: boolean;
state: string;
metadata: AgentSessionMetadata;
repoUrl: string;
branch: string | null;
pullRequestUrl: string | null;
pullRequestStatus: string | null;
tunnelUrl: string | null;
createdAt: string;
updatedAt: string;
create_time_ms: string;
end_time_ms: string;
}
export class ControlPlaneClient {
constructor(
readonly sessionInfoPromise: Promise<ControlPlaneSessionInfo | undefined>,
private readonly ide: IDE,
) {}
async resolveFQSNs(
fqsns: FQSN[],
orgScopeId: string | null,
): Promise<(SecretResult | undefined)[]> {
if (!(await this.isSignedIn())) {
return fqsns.map((fqsn) => ({
found: false,
fqsn,
secretLocation: {
secretName: fqsn.secretName,
secretType: SecretType.NotFound,
},
}));
}
const resp = await this.requestAndHandleError("ide/sync-secrets", {
method: "POST",
body: JSON.stringify({ fqsns, orgScopeId }),
});
return (await resp.json()) as any;
}
async isSignedIn(): Promise<boolean> {
const sessionInfo = await this.sessionInfoPromise;
return !!sessionInfo;
}
async getAccessToken(): Promise<string | undefined> {
const sessionInfo = await this.sessionInfoPromise;
return isOnPremSession(sessionInfo) ? undefined : sessionInfo?.accessToken;
}
private async request(path: string, init: RequestInit): Promise<Response> {
const sessionInfo = await this.sessionInfoPromise;
const onPremSession = isOnPremSession(sessionInfo);
const accessToken = await this.getAccessToken();
// Bearer token not necessary for on-prem auth type
if (!accessToken && !onPremSession) {
throw new Error("No access token");
}
const env = await getControlPlaneEnv(this.ide.getIdeSettings());
const url = new URL(path, env.CONTROL_PLANE_URL).toString();
const ideInfo = await this.ide.getIdeInfo();
const resp = await fetch(url, {
...init,
headers: {
...init.headers,
Authorization: `Bearer ${accessToken}`,
...{
"x-extension-version": ideInfo.extensionVersion,
"x-is-prerelease": String(ideInfo.isPrerelease),
},
},
});
return resp;
}
private async requestAndHandleError(
path: string,
init: RequestInit,
): Promise<Response> {
const resp = await this.request(path, init);
if (!resp.ok) {
throw new Error(
`Control plane request failed: ${resp.status} ${await resp.text()}`,
);
}
return resp;
}
public async listAssistants(organizationId: string | null): Promise<
{
configResult: ConfigResult<AssistantUnrolled>;
ownerSlug: string;
packageSlug: string;
iconUrl: string;
rawYaml: string;
}[]
> {
if (!(await this.isSignedIn())) {
return [];
}
try {
const url = organizationId
? `ide/list-assistants?organizationId=${organizationId}`
: "ide/list-assistants";
const resp = await this.requestAndHandleError(url, {
method: "GET",
});
return (await resp.json()) as any;
} catch (e) {
Logger.error(e, {
context: "control_plane_list_assistants",
organizationId,
});
return [];
}
}
public async listOrganizations(): Promise<Array<OrganizationDescription>> {
if (!(await this.isSignedIn())) {
return [];
}
// We try again here because when users sign up with an email domain that is
// captured by an org, we need to wait for the user account creation webhook to
// take effect. Otherwise the organization(s) won't show up.
// This error manifests as a 404 (user not found)
let retries = 0;
const maxRetries = 10;
const maxWaitTime = 20000; // 20 seconds in milliseconds
while (retries < maxRetries) {
const resp = await this.request("ide/list-organizations", {
method: "GET",
});
if (resp.status === 404) {
retries++;
if (retries >= maxRetries) {
console.warn(
`Failed to list organizations after ${maxRetries} retries: user not found`,
);
return [];
}
const waitTime = Math.min(
Math.pow(2, retries) * 100,
maxWaitTime / maxRetries,
);
await new Promise((resolve) => setTimeout(resolve, waitTime));
continue;
} else if (!resp.ok) {
console.warn(
`Failed to list organizations (${resp.status}): ${await resp.text()}`,
);
return [];
}
const { organizations } = (await resp.json()) as any;
return organizations;
}
// This should never be reached due to the while condition, but adding for safety
console.warn(
`Failed to list organizations after ${maxRetries} retries: maximum attempts exceeded`,
);
return [];
}
public async listAssistantFullSlugs(
organizationId: string | null,
): Promise<FullSlug[] | null> {
if (!(await this.isSignedIn())) {
return null;
}
const url = organizationId
? `ide/list-assistant-full-slugs?organizationId=${organizationId}`
: "ide/list-assistant-full-slugs";
try {
const resp = await this.requestAndHandleError(url, {
method: "GET",
});
const { fullSlugs } = (await resp.json()) as any;
return fullSlugs;
} catch (e) {
Logger.error(e, {
context: "control_plane_list_assistant_slugs",
organizationId,
});
return null;
}
}
public async getPolicy(): Promise<PolicyResponse | null> {
if (!(await this.isSignedIn())) {
return null;
}
try {
const resp = await this.request(`ide/policy`, {
method: "GET",
});
return (await resp.json()) as PolicyResponse;
} catch (e) {
return null;
}
}
public async getCreditStatus(): Promise<CreditStatus | null> {
if (!(await this.isSignedIn())) {
return null;
}
try {
const resp = await this.requestAndHandleError("ide/credits", {
method: "GET",
});
return (await resp.json()) as CreditStatus;
} catch (e) {
Logger.error(e, {
context: "control_plane_credit_status",
});
return null;
}
}
/**
* JetBrains does not support deep links, so we only check for `vsCodeUriScheme`
* @param vsCodeUriScheme
* @returns
*/
public async getModelsAddOnCheckoutUrl(
vsCodeUriScheme?: string,
): Promise<{ url: string } | null> {
if (!(await this.isSignedIn())) {
return null;
}
try {
const params = new URLSearchParams({
// LocalProfileLoader ID
profile_id: "local",
});
if (vsCodeUriScheme) {
params.set("vscode_uri_scheme", vsCodeUriScheme);
}
const resp = await this.requestAndHandleError(
`ide/get-models-add-on-checkout-url?${params.toString()}`,
{
method: "GET",
},
);
return (await resp.json()) as { url: string };
} catch (e) {
Logger.error(e, {
context: "control_plane_models_checkout_url",
vsCodeUriScheme,
});
return null;
}
}
/**
* Check if remote sessions should be enabled based on feature flags
*/
public async shouldEnableRemoteSessions(): Promise<boolean> {
// Check if user is signed in
if (!(await this.isSignedIn())) {
return false;
}
try {
const sessionInfo = await this.sessionInfoPromise;
if (isOnPremSession(sessionInfo) || !sessionInfo) {
return false;
}
return true;
} catch (e) {
Logger.error(e, {
context: "control_plane_check_remote_sessions_enabled",
});
return false;
}
}
/**
* Get current user's session info
*/
public async getSessionInfo(): Promise<ControlPlaneSessionInfo | undefined> {
return await this.sessionInfoPromise;
}
/**
* Fetch remote agents/sessions from the control plane
*/
public async listRemoteSessions(): Promise<RemoteSessionMetadata[]> {
if (!(await this.isSignedIn())) {
return [];
}
try {
const resp = await this.requestAndHandleError("agents/devboxes", {
method: "GET",
});
const agents = (await resp.json()) as any[];
return agents.map(
(agent: any): RemoteSessionMetadata => ({
sessionId: `remote-${agent.id}`,
title: agent.name || "Remote Agent",
dateCreated: new Date(agent.create_time_ms).toISOString(),
workspaceDirectory: "",
isRemote: true,
remoteId: agent.id,
}),
);
} catch (e) {
// Log error but don't throw - remote sessions are optional
Logger.error(e, {
context: "control_plane_list_remote_sessions",
});
return [];
}
}
public async loadRemoteSession(remoteId: string): Promise<Session> {
if (!(await this.isSignedIn())) {
throw new Error("Not signed in to load remote session");
}
try {
// First get the tunnel URL for the remote agent
const tunnelResp = await this.requestAndHandleError(
`agents/devboxes/${remoteId}/tunnel`,
{
method: "POST",
},
);
const tunnelData = (await tunnelResp.json()) as { url?: string };
const tunnelUrl = tunnelData.url;
if (!tunnelUrl) {
throw new Error(`Failed to get tunnel URL for agent ${remoteId}`);
}
// Now fetch the session state from the remote agent's /state endpoint
const stateResponse = await fetch(`${tunnelUrl}/state`);
if (!stateResponse.ok) {
throw new Error(
`Failed to fetch state from remote agent: ${stateResponse.statusText}`,
);
}
const remoteState = (await stateResponse.json()) as { session?: Session };
// The remote state contains a session property with the full session data
if (!remoteState.session) {
throw new Error(
"Remote agent returned invalid state - no session found",
);
}
return remoteState.session;
} catch (e) {
Logger.error(e, {
context: "control_plane_load_remote_session",
remoteId,
});
throw new Error(
`Failed to load remote session: ${e instanceof Error ? e.message : "Unknown error"}`,
);
}
}
/**
* Create a new background agent
*/
public async createBackgroundAgent(
prompt: string,
repoUrl: string,
name: string,
branch?: string,
organizationId?: string,
contextItems?: any[],
selectedCode?: any[],
agent?: string,
): Promise<{ id: string }> {
if (!(await this.isSignedIn())) {
throw new Error("Not signed in to Continue");
}
const requestBody: any = {
prompt,
repoUrl,
name,
branchName: branch,
};
if (organizationId) {
requestBody.organizationId = organizationId;
}
// Include context items if provided
if (contextItems && contextItems.length > 0) {
requestBody.contextItems = contextItems.map((item) => ({
content: item.content,
description: item.description,
name: item.name,
uri: item.uri,
}));
}
// Include selected code if provided
if (selectedCode && selectedCode.length > 0) {
requestBody.selectedCode = selectedCode.map((code) => ({
filepath: code.filepath,
range: code.range,
contents: code.contents,
}));
}
// Include agent configuration if provided
if (agent) {
requestBody.agent = agent;
}
const resp = await this.requestAndHandleError("agents", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(requestBody),
});
return (await resp.json()) as { id: string };
}
/**
* List all background agents for the current user or organization
* @param organizationId - Optional organization ID to filter agents by organization scope
* @param limit - Optional limit for number of agents to return (default: 5)
*/
public async listBackgroundAgents(
organizationId?: string,
limit?: number,
): Promise<{
agents: Array<{
id: string;
name: string | null;
status: string;
repoUrl: string;
createdAt: string;
metadata?: {
github_repo?: string;
};
}>;
totalCount: number;
}> {
if (!(await this.isSignedIn())) {
return { agents: [], totalCount: 0 };
}
try {
// Build URL with query parameters
const params = new URLSearchParams();
if (organizationId) {
params.set("organizationId", organizationId);
}
if (limit !== undefined) {
params.set("limit", limit.toString());
}
const url = `agents${params.toString() ? `?${params.toString()}` : ""}`;
const resp = await this.requestAndHandleError(url, {
method: "GET",
});
const result = (await resp.json()) as {
agents: AgentSessionView[];
totalCount: number;
};
return {
agents: result.agents.map((agent) => ({
id: agent.id,
name: agent.name,
status: agent.status,
repoUrl: agent.repoUrl,
createdAt: agent.createdAt,
metadata: {
github_repo: agent.metadata.github_repo,
},
})),
totalCount: result.totalCount,
};
} catch (e) {
Logger.error(e, {
context: "control_plane_list_background_agents",
});
return { agents: [], totalCount: 0 };
}
}
/**
* Get the full agent session information
* @param agentSessionId - The ID of the agent session
* @returns The agent session view including metadata and status
*/
public async getAgentSession(
agentSessionId: string,
): Promise<AgentSessionView | null> {
if (!(await this.isSignedIn())) {
return null;
}
try {
const resp = await this.requestAndHandleError(
`agents/${agentSessionId}`,
{
method: "GET",
},
);
return (await resp.json()) as AgentSessionView;
} catch (e) {
Logger.error(e, {
context: "control_plane_get_agent_session",
agentSessionId,
});
return null;
}
}
/**
* Get the state of a specific background agent
* @param agentSessionId - The ID of the agent session
* @returns The agent's session state including history, workspace, and branch
*/
public async getAgentState(agentSessionId: string): Promise<{
session: Session;
isProcessing: boolean;
messageQueueLength: number;
pendingPermission: any;
} | null> {
if (!(await this.isSignedIn())) {
return null;
}
try {
const resp = await this.requestAndHandleError(
`agents/${agentSessionId}/state`,
{
method: "GET",
},
);
const result = (await resp.json()) as {
session: Session;
isProcessing: boolean;
messageQueueLength: number;
pendingPermission: any;
};
return result;
} catch (e) {
Logger.error(e, {
context: "control_plane_get_agent_state",
agentSessionId,
});
return null;
}
}
}

View file

@ -1,105 +0,0 @@
import * as fs from "node:fs";
import { IdeSettings } from "..";
import {
getLocalEnvironmentDotFilePath,
getStagingEnvironmentDotFilePath,
} from "../util/paths";
import { AuthType, ControlPlaneEnv } from "./AuthTypes";
import { getLicenseKeyData } from "./mdm/mdm";
export const EXTENSION_NAME = "continue";
const WORKOS_CLIENT_ID_PRODUCTION = "client_01J0FW6XN8N2XJAECF7NE0Y65J";
const WORKOS_CLIENT_ID_STAGING = "client_01J0FW6XCPMJMQ3CG51RB4HBZQ";
const PRODUCTION_HUB_ENV: ControlPlaneEnv = {
DEFAULT_CONTROL_PLANE_PROXY_URL: "https://api.continue.dev/",
CONTROL_PLANE_URL: "https://api.continue.dev/",
AUTH_TYPE: AuthType.WorkOsProd,
WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_PRODUCTION,
APP_URL: "https://continue.dev/",
};
const STAGING_ENV: ControlPlaneEnv = {
DEFAULT_CONTROL_PLANE_PROXY_URL: "https://api.continue-stage.tools/",
CONTROL_PLANE_URL: "https://api.continue-stage.tools/",
AUTH_TYPE: AuthType.WorkOsStaging,
WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_STAGING,
APP_URL: "https://hub.continue-stage.tools/",
};
const TEST_ENV: ControlPlaneEnv = {
DEFAULT_CONTROL_PLANE_PROXY_URL: "https://api-test.continue.dev/",
CONTROL_PLANE_URL: "https://api-test.continue.dev/",
AUTH_TYPE: AuthType.WorkOsStaging,
WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_STAGING,
APP_URL: "https://app-test.continue.dev/",
};
const LOCAL_ENV: ControlPlaneEnv = {
DEFAULT_CONTROL_PLANE_PROXY_URL: "http://localhost:3001/",
CONTROL_PLANE_URL: "http://localhost:3001/",
AUTH_TYPE: AuthType.WorkOsStaging,
WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_STAGING,
APP_URL: "http://localhost:3000/",
};
export async function enableHubContinueDev() {
return true;
}
export async function getControlPlaneEnv(
ideSettingsPromise: Promise<IdeSettings>,
): Promise<ControlPlaneEnv> {
const ideSettings = await ideSettingsPromise;
return getControlPlaneEnvSync(ideSettings.continueTestEnvironment);
}
export function getControlPlaneEnvSync(
ideTestEnvironment: IdeSettings["continueTestEnvironment"],
): ControlPlaneEnv {
// MDM override
const licenseKeyData = getLicenseKeyData();
if (licenseKeyData?.unsignedData?.apiUrl) {
const { apiUrl } = licenseKeyData.unsignedData;
return {
AUTH_TYPE: AuthType.OnPrem,
DEFAULT_CONTROL_PLANE_PROXY_URL: apiUrl,
CONTROL_PLANE_URL: apiUrl,
APP_URL: "https://continue.dev/",
};
}
// Note .local overrides .staging
if (fs.existsSync(getLocalEnvironmentDotFilePath())) {
return LOCAL_ENV;
}
if (fs.existsSync(getStagingEnvironmentDotFilePath())) {
return STAGING_ENV;
}
const env =
ideTestEnvironment === "production"
? "hub"
: ideTestEnvironment === "staging"
? "staging"
: ideTestEnvironment === "local"
? "local"
: process.env.CONTROL_PLANE_ENV;
return env === "local"
? LOCAL_ENV
: env === "staging"
? STAGING_ENV
: env === "test"
? TEST_ENV
: PRODUCTION_HUB_ENV;
}
export async function useHub(
ideSettingsPromise: Promise<IdeSettings>,
): Promise<boolean> {
const ideSettings = await ideSettingsPromise;
return ideSettings.continueTestEnvironment !== "none";
}

View file

@ -1,370 +0,0 @@
import * as crypto from "crypto";
import * as fs from "fs";
import * as os from "os";
import * as path from "path";
import * as plist from "plist";
export interface MdmKeys {
licenseKey: string;
}
const CONTINUE_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz1pFVzsW2UScSnaPAwFp
93QU4+txtyJj8AOC3Kx7YkX1d48DGU2Fy1he7SXPHgcuhXYIqfWGn/Vy/4yJxXD7
HlU8RM7LlWHRk7ecAvF4WtxZDjPE0OSG5T69w5f7tMCtQPQseInCKqleJuCjxrvA
zyTWTwKA1S6e+KxXS/kbqsumriljFujNr6Gmh8ygDnpF055Xo0vTenkMipVw/oYn
U0EHx5ic+Fmcob3EyOj25lu/CVYtU1Rn8jPbrBOMiIq5sePh2QXOwGRsuTiZk2mP
LXSsjLbeWHifRrQ18wj/PC990E33QaFGNFp0NcBXMPbq5eKYKEzKZ0GsxtLoGxar
FQIDAQAB
-----END PUBLIC KEY-----`;
interface LicenseKeyUnsignedData {
apiUrl: string;
}
export interface LicenseKey {
signature: string;
data: string;
unsignedData: LicenseKeyUnsignedData;
}
export interface LicenseKeyData {
customerId: string;
createdAt: string;
expiresAt: string;
}
export function validateLicenseKey(licenseKey: string): {
isValid: boolean;
licenseKeyData?: LicenseKey;
} {
try {
// Decode the base64 license key
const decodedString = Buffer.from(licenseKey, "base64").toString("utf8");
const { data, signature, unsignedData } = JSON.parse(decodedString);
// Verify the signature
const verify = crypto.createVerify("SHA256");
verify.update(data);
verify.end();
const isValid = verify.verify(CONTINUE_PUBLIC_KEY, signature, "base64");
if (!isValid) return { isValid: false };
// Check license expiration
const licenseData: LicenseKeyData = JSON.parse(data);
const expirationDate = new Date(licenseData.expiresAt);
const now = new Date();
const isNotExpired = expirationDate > now;
if (!isNotExpired) return { isValid: false };
// Return both validation result and license key data
const licenseKeyData: LicenseKey = {
signature,
data,
unsignedData,
};
return { isValid: true, licenseKeyData };
} catch (error) {
console.error("License validation error:", error);
return { isValid: false };
}
}
const MACOS_MDM_PATHS = [
// Organization-specific MDM plist
"/Library/Managed Preferences/dev.continue.app.plist",
// User-specific MDM plist
path.join(os.homedir(), "Library/Managed Preferences/dev.continue.app.plist"),
];
function readMdmKeysMacOS(): MdmKeys | undefined {
try {
// MDM configuration is typically stored in /Library/Managed Preferences/ on macOS
// The filename is often the bundle identifier of the application
// Try to find a valid MDM configuration file
for (const mdmPath of MACOS_MDM_PATHS) {
if (fs.existsSync(mdmPath)) {
// Read the file content
const fileContent = fs.readFileSync(mdmPath, "utf8");
try {
// Parse the plist file using the plist package
const config = plist.parse(fileContent) as
| { licenseKey: string | undefined }
| undefined;
if (config && config?.licenseKey) {
// Extract the license key from the configuration
return { licenseKey: config?.licenseKey };
} else {
console.error("Invalid MDM configuration format");
}
} catch (parseError) {
console.error(`Error parsing MDM configuration: ${parseError}`);
}
}
}
return undefined;
} catch (error) {
console.error("Error reading macOS MDM keys:", error);
return undefined;
}
}
function readMdmKeysWindows(): MdmKeys | undefined {
try {
// For Windows, we need to read from the registry
// Using regedit or another synchronous registry access module
const { execSync } = require("child_process");
// Path to the registry where MDM configuration is stored
const regPath = "HKLM\\Software\\Continue\\MDM";
const userRegPath = "HKCU\\Software\\Continue\\MDM";
// Try to read from HKEY_LOCAL_MACHINE first
try {
// Use REG QUERY command to read registry values
const licenseKeyCmd = `reg query "${regPath}" /v licenseKey`;
const licenseKeyOutput = execSync(licenseKeyCmd, {
encoding: "utf8",
stdio: ["pipe", "pipe", "pipe"],
});
// Extract values from command output
const licenseKey = extractRegValue(licenseKeyOutput);
if (licenseKey) {
return { licenseKey };
}
} catch (error) {
// Registry key might not exist, fallback to HKEY_CURRENT_USER
}
// Try HKEY_CURRENT_USER if not found in HKEY_LOCAL_MACHINE
try {
const licenseKeyCmd = `reg query "${userRegPath}" /v licenseKey`;
const licenseKeyOutput = execSync(licenseKeyCmd, {
encoding: "utf8",
stdio: ["pipe", "pipe", "pipe"],
});
// Extract values from command output
const licenseKey = extractRegValue(licenseKeyOutput);
if (licenseKey) {
return { licenseKey };
}
} catch (error) {
// Registry key might not exist in HKCU either
}
return undefined;
} catch (error) {
console.error("Error reading Windows MDM keys:", error);
return undefined;
}
}
// Helper function to extract registry values from reg query output
function extractRegValue(output: string): string | undefined {
const match = output.match(/REG_SZ\s+(.+)$/m);
return match ? match[1].trim() : undefined;
}
// Common locations for MDM configurations in Linux systems
const LINUX_MDM_PATHS = [
// System-wide configuration
"/etc/continue/mdm.json",
"/var/lib/continue/mdm.json",
// User-specific configuration
path.join(os.homedir(), ".config/continue/mdm.json"),
];
function readMdmKeysLinux(): MdmKeys | undefined {
try {
// Try to find a valid MDM configuration file
for (const mdmPath of LINUX_MDM_PATHS) {
if (fs.existsSync(mdmPath)) {
// Read the file content
const fileContent = fs.readFileSync(mdmPath, "utf8");
try {
// Parse the JSON configuration file
const config = JSON.parse(fileContent);
// Check if required key is present
if (config.licenseKey) {
return {
licenseKey: config.licenseKey,
};
}
} catch (parseError) {
console.error(`Error parsing Linux MDM configuration: ${parseError}`);
}
}
}
return undefined;
} catch (error) {
console.error("Error reading Linux MDM keys:", error);
return undefined;
}
}
function readMdmKeys(): MdmKeys | undefined {
const platform = os.platform();
switch (platform) {
case "darwin":
return readMdmKeysMacOS();
case "win32":
return readMdmKeysWindows();
case "linux":
return readMdmKeysLinux();
default:
console.error(`MDM keys not supported on platform: ${platform}`);
return undefined;
}
}
/**
* Read and validate MDM keys from the operating system's configuration files or registry.
*/
export function getLicenseKeyData(): LicenseKey | undefined {
try {
const mdmKeys = readMdmKeys();
if (mdmKeys) {
const { isValid, licenseKeyData } = validateLicenseKey(
mdmKeys.licenseKey,
);
if (!isValid) {
console.error("Invalid license key found: ", mdmKeys.licenseKey);
return undefined;
}
return licenseKeyData;
}
return undefined;
} catch (e) {
console.warn("Error reading MDM keys: ", e);
return undefined;
}
}
function writeMdmKeysMacOS(licenseKey: string): boolean {
try {
// Write to user-specific MDM plist
const userMdmPath = path.join(
os.homedir(),
"Library/Managed Preferences/dev.continue.app.plist",
);
const config = {
licenseKey,
};
// Ensure directory exists
fs.mkdirSync(path.dirname(userMdmPath), { recursive: true });
// Write the plist file
const plistContent = plist.build(config);
fs.writeFileSync(userMdmPath, plistContent, "utf8");
return true;
} catch (error) {
console.error("Error writing macOS MDM keys:", error);
return false;
}
}
function writeMdmKeysWindows(licenseKey: string): boolean {
try {
const { execSync } = require("child_process");
// Use HKEY_CURRENT_USER to avoid needing admin privileges
const userRegPath = "HKCU\\Software\\Continue\\MDM";
// Create the registry key if it doesn't exist
try {
execSync(`reg add "${userRegPath}" /f`);
} catch (error) {
// Key might already exist
}
// Set the license key and API URL
execSync(
`reg add "${userRegPath}" /v licenseKey /t REG_SZ /d "${licenseKey}" /f`,
);
return true;
} catch (error) {
console.error("Error writing Windows MDM keys:", error);
return false;
}
}
function writeMdmKeysLinux(licenseKey: string): boolean {
try {
// Write to user-specific configuration
const userMdmPath = path.join(os.homedir(), ".config/continue/mdm.json");
const config = {
licenseKey,
};
// Ensure directory exists
fs.mkdirSync(path.dirname(userMdmPath), { recursive: true });
// Write the JSON configuration file
fs.writeFileSync(userMdmPath, JSON.stringify(config, null, 2), "utf8");
return true;
} catch (error) {
console.error("Error writing Linux MDM keys:", error);
return false;
}
}
/**
* Store the license key in the appropriate OS-specific location.
* For now, we'll use a default API URL since it's not provided in the command.
*/
export function setMdmLicenseKey(licenseKey: string): boolean {
try {
// Validate the license key first
const { isValid } = validateLicenseKey(licenseKey);
if (!isValid) {
return false;
}
const platform = os.platform();
switch (platform) {
case "darwin":
return writeMdmKeysMacOS(licenseKey);
case "win32":
return writeMdmKeysWindows(licenseKey);
case "linux":
return writeMdmKeysLinux(licenseKey);
default:
console.error(
`Setting MDM keys not supported on platform: ${platform}`,
);
return false;
}
} catch (error) {
console.error("Error setting MDM license key:", error);
return false;
}
}

View file

@ -1,211 +0,0 @@
import * as crypto from "crypto";
import { expect, test } from "vitest";
import { LicenseKeyData, validateLicenseKey } from "./mdm";
// We'll create a real key pair once for all tests
const testKeyPair = crypto.generateKeyPairSync("rsa", {
modulusLength: 2048,
publicKeyEncoding: {
type: "spki",
format: "pem",
},
privateKeyEncoding: {
type: "pkcs8",
format: "pem",
},
});
// Custom function to create test licenses with the new structure including unsignedData
function createTestLicense(
licenseData: LicenseKeyData,
apiUrl: string = "https://api.continue.dev",
useValidSignature: boolean = true,
): string {
// Convert license data to a string
const licenseDataStr = JSON.stringify(licenseData);
// Create a signature with our generated private key
const sign = crypto.createSign("SHA256");
sign.update(licenseDataStr);
sign.end();
let signature: string;
if (useValidSignature) {
signature = sign.sign(testKeyPair.privateKey, "base64");
} else {
// For invalid tests, create an intentionally wrong signature by signing different data
const wrongSign = crypto.createSign("SHA256");
wrongSign.update(licenseDataStr + "tampered");
wrongSign.end();
signature = wrongSign.sign(testKeyPair.privateKey, "base64");
}
// Combine data, signature, and unsigned data into a license key
const licenseKeyObj = {
data: licenseDataStr,
signature: signature,
unsignedData: {
apiUrl: apiUrl,
},
};
return Buffer.from(JSON.stringify(licenseKeyObj)).toString("base64");
}
// We need to test the actual implementation - which we can't mock with ESM
// Instead, we'll have tests that bypass validation or are expected to fail
// depending on what we're testing
test("validateLicenseKey returns false for malformed license key", () => {
// Test with a completely invalid license key
const invalidLicenseKey = "not-a-valid-license-key";
// Test - no mocks, real validation
const result = validateLicenseKey(invalidLicenseKey);
// Assert
expect(result.isValid).toBe(false);
expect(result.licenseKeyData).toBeUndefined();
});
test("validateLicenseKey returns false for invalid JSON in license key", () => {
// Create a malformed but base64-encoded string
const malformedLicenseKey = Buffer.from("this is not valid JSON").toString(
"base64",
);
// Test - no mocks, real validation
const result = validateLicenseKey(malformedLicenseKey);
// Assert
expect(result.isValid).toBe(false);
expect(result.licenseKeyData).toBeUndefined();
});
test("validateLicenseKey returns false for expired license", () => {
// Without mocking, we expect this to fail signature verification
// We're testing the date logic by itself
const licenseData: LicenseKeyData = {
customerId: "customer123",
createdAt: new Date(Date.now() - 2000 * 60 * 60 * 24).toISOString(), // Created 2 days ago
expiresAt: new Date(Date.now() - 1000 * 60 * 60 * 24).toISOString(), // Expired 1 day ago
};
// Create a license key with apiUrl in unsignedData - will fail verification but test logic still works
const expiredLicenseKey = createTestLicense(
licenseData,
"https://api.continue.dev",
);
// Test - expect false, either due to signature or expiration - both are valid test cases
const result = validateLicenseKey(expiredLicenseKey);
// Assert
expect(result.isValid).toBe(false);
expect(result.licenseKeyData).toBeUndefined();
});
test("validateLicenseKey returns false for invalid signature", () => {
// Create license data with valid dates
const licenseData: LicenseKeyData = {
customerId: "customer123",
createdAt: new Date().toISOString(),
expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString(), // Valid for 1 day
};
// Create a license with an invalid signature but valid unsignedData structure
const invalidSignatureKey = createTestLicense(
licenseData,
"https://api.continue.dev",
false,
);
// Test - no mocks, real validation
const result = validateLicenseKey(invalidSignatureKey);
// Assert
expect(result.isValid).toBe(false);
expect(result.licenseKeyData).toBeUndefined();
});
test("validateLicenseKey handles JSON parsing errors gracefully", () => {
// Create a base64 string that decodes to valid JSON but lacks required fields
const invalidStructureKey = Buffer.from(
JSON.stringify({
notTheRightField: "wrong structure",
}),
).toString("base64");
// Test - no mocks, real validation
const result = validateLicenseKey(invalidStructureKey);
// Assert
expect(result.isValid).toBe(false);
expect(result.licenseKeyData).toBeUndefined();
});
test("validateLicenseKey handles missing unsignedData gracefully", () => {
// Create a license key structure without unsignedData field
const licenseData: LicenseKeyData = {
customerId: "customer123",
createdAt: new Date().toISOString(),
expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString(),
};
const licenseDataStr = JSON.stringify(licenseData);
const sign = crypto.createSign("SHA256");
sign.update(licenseDataStr);
sign.end();
const signature = sign.sign(testKeyPair.privateKey, "base64");
// Create license key without unsignedData
const licenseKeyObj = {
data: licenseDataStr,
signature: signature,
// Missing unsignedData field
};
const licenseKey = Buffer.from(JSON.stringify(licenseKeyObj)).toString(
"base64",
);
// Test - no mocks, real validation
const result = validateLicenseKey(licenseKey);
// Assert - should fail due to signature verification with wrong public key
expect(result.isValid).toBe(false);
expect(result.licenseKeyData).toBeUndefined();
});
test("validateLicenseKey handles invalid unsignedData structure", () => {
// Create license data with valid dates
const licenseData: LicenseKeyData = {
customerId: "customer123",
createdAt: new Date().toISOString(),
expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString(),
};
const licenseDataStr = JSON.stringify(licenseData);
const sign = crypto.createSign("SHA256");
sign.update(licenseDataStr);
sign.end();
const signature = sign.sign(testKeyPair.privateKey, "base64");
// Create license key with invalid unsignedData structure
const licenseKeyObj = {
data: licenseDataStr,
signature: signature,
unsignedData: "not an object", // Should be an object with apiUrl
};
const licenseKey = Buffer.from(JSON.stringify(licenseKeyObj)).toString(
"base64",
);
// Test - no mocks, real validation
const result = validateLicenseKey(licenseKey);
// Assert - should fail due to signature verification with wrong public key
expect(result.isValid).toBe(false);
expect(result.licenseKeyData).toBeUndefined();
});

View file

@ -1,142 +0,0 @@
import { z } from "zod";
const modelDescriptionSchema = z.object({
title: z.string(),
provider: z.enum([
"openai",
"anthropic",
"cohere",
"ollama",
"huggingface-tgi",
"huggingface-inference-api",
"replicate",
"gemini",
"mistral",
"bedrock",
"sagemaker",
"cloudflare",
"azure",
"ovhcloud",
"nebius",
"siliconflow",
"scaleway",
"watsonx",
]),
model: z.string(),
apiKey: z.string().optional(),
apiBase: z.string().optional(),
contextLength: z.number().optional(),
maxStopWords: z.number().optional(),
template: z
.enum([
"llama2",
"alpaca",
"zephyr",
"phi2",
"phind",
"anthropic",
"chatml",
"none",
"openchat",
"deepseek",
"xwin-coder",
"neural-chat",
"codellama-70b",
"llava",
"gemma",
"llama3",
"codestral",
])
.optional(),
completionOptions: z
.object({
temperature: z.number().optional(),
topP: z.number().optional(),
topK: z.number().optional(),
minP: z.number().optional(),
presencePenalty: z.number().optional(),
frequencyPenalty: z.number().optional(),
mirostat: z.number().optional(),
stop: z.array(z.string()).optional(),
maxTokens: z.number().optional(),
numThreads: z.number().optional(),
useMmap: z.boolean().optional(),
keepAlive: z.number().optional(),
numGpu: z.number().optional(),
raw: z.boolean().optional(),
stream: z.boolean().optional(),
})
.optional(),
systemMessage: z.string().optional(),
requestOptions: z
.object({
timeout: z.number().optional(),
verifySsl: z.boolean().optional(),
caBundlePath: z.union([z.string(), z.array(z.string())]).optional(),
proxy: z.string().optional(),
headers: z.record(z.string()).optional(),
extraBodyProperties: z.record(z.any()).optional(),
noProxy: z.array(z.string()).optional(),
})
.optional(),
promptTemplates: z.record(z.string()).optional(),
});
const embeddingsProviderSchema = z.object({
provider: z.enum([
"transformers.js",
"ollama",
"openai",
"cohere",
"gemini",
"ovhcloud",
"nebius",
"siliconflow",
"scaleway",
"watsonx",
]),
apiBase: z.string().optional(),
apiKey: z.string().optional(),
model: z.string().optional(),
deployment: z.string().optional(),
apiType: z.string().optional(),
apiVersion: z.string().optional(),
requestOptions: z
.object({
timeout: z.number().optional(),
verifySsl: z.boolean().optional(),
caBundlePath: z.union([z.string(), z.array(z.string())]).optional(),
proxy: z.string().optional(),
headers: z.record(z.string()).optional(),
extraBodyProperties: z.record(z.any()).optional(),
noProxy: z.array(z.string()).optional(),
})
.optional(),
});
const rerankerSchema = z.object({
name: z.enum(["cohere", "voyage", "llm", "watsonx"]),
params: z.record(z.any()).optional(),
});
const analyticsSchema = z.object({
url: z.string().optional(),
clientKey: z.string().optional(),
});
export type ControlPlaneAnalytics = z.infer<typeof analyticsSchema>;
const devDataSchema = z.object({
url: z.string().optional(),
});
export const controlPlaneSettingsSchema = z.object({
models: z.array(modelDescriptionSchema),
tabAutocompleteModel: modelDescriptionSchema,
embeddingsModel: embeddingsProviderSchema,
reranker: rerankerSchema,
analytics: analyticsSchema,
devData: devDataSchema,
});
export type ControlPlaneSettings = z.infer<typeof controlPlaneSettingsSchema>;

View file

@ -9,8 +9,6 @@ import {
} from "./autocomplete/util/openedFilesLruCache";
import { ConfigHandler } from "./config/ConfigHandler";
import { addModel, deleteModel } from "./config/util";
import { getAuthUrlForTokenPage } from "./control-plane/auth/index";
import { getControlPlaneEnv } from "./control-plane/env";
import { DevDataSqliteDb } from "./data/devdataSqlite";
import { DataLogger } from "./data/log";
import { CodebaseIndexer } from "./indexing/CodebaseIndexer";
@ -69,7 +67,6 @@ import {
} from "./config/workspace/workspaceBlocks";
import { MCPManagerSingleton } from "./context/mcp/MCPManagerSingleton";
import { performAuth, removeMCPAuth } from "./context/mcp/MCPOauth";
import { setMdmLicenseKey } from "./control-plane/mdm/mdm";
import { myersDiff } from "./diff/myers";
import { ApplyAbortManager } from "./edit/applyAbortManager";
import { streamDiffLines } from "./edit/streamDiffLines";
@ -137,19 +134,7 @@ export class Core {
const ideInfoPromise = messenger.request("getIdeInfo", undefined);
const ideSettingsPromise = messenger.request("getIdeSettings", undefined);
const initialSessionInfoPromise = messenger.request(
"getControlPlaneSessionInfo",
{
silent: true,
useOnboarding: false,
},
);
this.configHandler = new ConfigHandler(
this.ide,
this.llmLogger,
initialSessionInfoPromise,
);
this.configHandler = new ConfigHandler(this.ide, this.llmLogger);
this.docsService = DocsService.createSingleton(
this.configHandler,
@ -188,8 +173,7 @@ export class Core {
result: serializedResult,
profileId:
this.configHandler.currentProfile?.profileDescription.id || null,
organizations: this.configHandler.getSerializedOrgs(),
selectedOrgId: this.configHandler.currentOrg?.id ?? null,
profiles: this.configHandler.profileDescriptions,
});
if (await this.codeBaseIndexer.wasAnyOneIndexAdded()) {
@ -318,26 +302,9 @@ export class Core {
// History
on("history/list", async (msg) => {
const localSessions = historyManager.list(msg.data);
// Check if remote sessions should be enabled based on feature flags
const shouldFetchRemote =
await this.configHandler.controlPlaneClient.shouldEnableRemoteSessions();
// Get remote sessions from control plane if feature is enabled
const remoteSessions = shouldFetchRemote
? await this.configHandler.controlPlaneClient.listRemoteSessions()
: [];
// Combine and sort by date (most recent first)
const allSessions = [...localSessions, ...remoteSessions].sort(
(a, b) =>
new Date(b.dateCreated).getTime() - new Date(a.dateCreated).getTime(),
);
// Apply limit if specified
const sessions = historyManager.list(msg.data);
const limit = msg.data?.limit ?? 100;
return allSessions.slice(0, limit);
return sessions.slice(0, limit);
});
on("history/delete", (msg) => {
@ -348,12 +315,6 @@ export class Core {
return historyManager.load(msg.data.id);
});
on("history/loadRemote", async (msg) => {
return this.configHandler.controlPlaneClient.loadRemoteSession(
msg.data.remoteId,
);
});
on("history/save", (msg) => {
historyManager.save(msg.data);
});
@ -463,11 +424,9 @@ export class Core {
const codebaseRulesCache = CodebaseRulesCache.getInstance();
await codebaseRulesCache.refresh(this.ide);
const { selectOrgId, selectProfileId, reason } = msg.data ?? {};
const { selectProfileId, reason } = msg.data ?? {};
await this.configHandler.refreshAll(reason);
if (selectOrgId) {
await this.configHandler.setSelectedOrgId(selectOrgId, selectProfileId);
} else if (selectProfileId) {
if (selectProfileId) {
await this.configHandler.setSelectedProfileId(selectProfileId);
}
});
@ -492,28 +451,6 @@ export class Core {
return newSelectedModels;
});
on("controlPlane/openUrl", async (msg) => {
const env = await getControlPlaneEnv(this.ide.getIdeSettings());
const urlPath = msg.data.path.startsWith("/")
? msg.data.path.slice(1)
: msg.data.path;
let url;
if (msg.data.orgSlug) {
url = `${env.APP_URL}organizations/${msg.data.orgSlug}/${urlPath}`;
} else {
url = `${env.APP_URL}${urlPath}`;
}
await this.messenger.request("openUrl", url);
});
on("controlPlane/getEnvironment", async (msg) => {
return await getControlPlaneEnv(this.ide.getIdeSettings());
});
on("controlPlane/getCreditStatus", async (msg) => {
return this.configHandler.controlPlaneClient.getCreditStatus();
});
on("mcp/reloadServer", async (msg) => {
await MCPManagerSingleton.getInstance().refreshConnection(msg.data.id);
});
@ -605,8 +542,7 @@ export class Core {
result: await this.configHandler.getSerializedConfig(),
profileId:
this.configHandler.currentProfile?.profileDescription.id ?? null,
organizations: this.configHandler.getSerializedOrgs(),
selectedOrgId: this.configHandler.currentOrg?.id ?? null,
profiles: this.configHandler.profileDescriptions,
};
});
@ -1090,30 +1026,8 @@ export class Core {
}
});
on("didChangeSelectedOrg", async (msg) => {
if (msg.data.id) {
await this.configHandler.setSelectedOrgId(
msg.data.id,
msg.data.profileId || undefined,
);
}
});
on("didChangeControlPlaneSessionInfo", async (msg) => {
this.messenger.send("sessionUpdate", {
sessionInfo: msg.data.sessionInfo,
});
await this.configHandler.updateControlPlaneSessionInfo(
msg.data.sessionInfo,
);
});
on("auth/getAuthUrl", async (msg) => {
const url = await getAuthUrlForTokenPage(
ideSettingsPromise,
msg.data.useOnboarding,
);
return { url };
on("auth/getAuthUrl", async (_msg) => {
return { url: "" };
});
on("tools/call", async ({ data: { toolCall } }) =>
@ -1204,11 +1118,6 @@ export class Core {
on("process/killTerminalProcess", async ({ data: { toolCallId } }) => {
await killTerminalProcess(toolCallId);
});
on("mdm/setLicenseKey", ({ data: { licenseKey } }) => {
const isValid = setMdmLicenseKey(licenseKey);
return isValid;
});
}
private async handleToolCall(toolCall: ToolCall) {

View file

@ -189,13 +189,8 @@ export class DataLogger {
"Content-Type": "application/json",
};
// If an API key is provided, use it, otherwise use the Continue access token
if (dataConfig.apiKey) {
headers["Authorization"] = `Bearer ${dataConfig.apiKey}`;
} else {
const accessToken =
await this.core?.configHandler.controlPlaneClient.getAccessToken();
headers["Authorization"] = `Bearer ${accessToken}`;
}
const profileId =

View file

@ -87,9 +87,6 @@ describe("DataLogger", () => {
id: "test-profile-id",
},
},
controlPlaneClient: {
getAccessToken: vi.fn().mockResolvedValue("test-access-token"),
},
},
} as unknown as Core;

8
core/index.d.ts vendored
View file

@ -667,7 +667,6 @@ export interface LLMOptions {
apiKeyLocation?: string;
envSecretLocations?: Record<string, string>;
apiBase?: string;
orgScopeId?: string | null;
onPremProxyUrl?: string | null;
@ -1028,7 +1027,6 @@ export type ContextProviderName =
| "currentFile"
| "greptile"
| "outline"
| "continue-proxy"
| "highlights"
| "file"
| "issue"
@ -1187,7 +1185,6 @@ interface ToolChoice {
export interface ConfigDependentToolParams {
rules: RuleWithSource[];
enableExperimentalTools: boolean;
isSignedIn: boolean;
isRemote: boolean;
modelName: string | undefined;
ide: IDE;
@ -1235,7 +1232,6 @@ export interface ModelDescription {
apiBase?: string;
apiKeyLocation?: string;
envSecretLocations?: Record<string, string>;
orgScopeId?: string | null;
onPremProxyUrl?: string | null;
@ -1370,9 +1366,6 @@ export interface MCPPrompt {
arguments?: MCPPromptArgs;
}
// Leaving here to ideate on
// export type ContinueConfigSource = "local-yaml" | "local-json" | "hub-assistant" | "hub"
// https://modelcontextprotocol.io/docs/concepts/resources#direct-resources
export interface MCPResource {
name: string;
@ -1861,7 +1854,6 @@ export interface BrowserSerializedContinueConfig {
tools: Omit<Tool, "preprocessArgs", "evaluateToolCallPolicy">[];
mcpServerStatuses: MCPServerStatus[];
rules: RuleWithSource[];
usePlatform: boolean;
tabAutocompleteOptions?: Partial<TabAutocompleteOptions>;
modelsByRole: Record<ModelRole, ModelDescription[]>;
selectedModelByRole: Record<ModelRole, ModelDescription | null>;

View file

@ -1,7 +1,7 @@
import { URL } from "node:url";
import { getHeaders } from "../../../continueServer/stubs/headers";
import { TRIAL_PROXY_URL } from "../../../control-plane/client";
const TRIAL_PROXY_URL = "https://proxy-server-blue-l6vsfbzhba-uw.a.run.app";
import { PageData } from "./DocsCrawler";
export class DefaultCrawler {

View file

@ -56,7 +56,6 @@ const PROVIDER_HANDLES_TEMPLATING: string[] = [
"bedrock",
"cohere",
"sagemaker",
"continue-proxy",
"mistral",
"mimo",
"sambanova",
@ -119,7 +118,6 @@ const PROVIDER_SUPPORTS_IMAGES: string[] = [
"anthropic",
"bedrock",
"sagemaker",
"continue-proxy",
"openrouter",
"venice",
"sambanova",

View file

@ -99,10 +99,6 @@ export abstract class BaseLLM implements ILLM {
return (this.constructor as typeof BaseLLM).providerName;
}
/**
* This exists because for the continue-proxy, sometimes we want to get the value of the underlying provider that is used on the server
* For example, the underlying provider should always be sent with dev data
*/
get underlyingProviderName(): string {
return this.providerName;
}
@ -168,8 +164,6 @@ export abstract class BaseLLM implements ILLM {
apiKeyLocation?: string;
envSecretLocations?: Record<string, string>;
apiBase?: string;
orgScopeId?: string | null;
onPremProxyUrl?: string | null;
cacheBehavior?: CacheBehavior;
@ -222,11 +216,7 @@ export abstract class BaseLLM implements ILLM {
this.model = options.model;
// Use @continuedev/llm-info package to autodetect certain parameters
const modelSearchString =
this.providerName === "continue-proxy"
? this.model?.split("/").pop() || this.model
: this.model;
const llmInfo = findLlmInfo(modelSearchString, this.underlyingProviderName);
const llmInfo = findLlmInfo(this.model, this.underlyingProviderName);
const templateType =
options.template ?? autodetectTemplateType(options.model);
@ -272,7 +262,6 @@ export abstract class BaseLLM implements ILLM {
// continueProperties
this.apiKeyLocation = options.apiKeyLocation;
this.envSecretLocations = options.envSecretLocations;
this.orgScopeId = options.orgScopeId;
this.apiBase = options.apiBase;
this.onPremProxyUrl = options.onPremProxyUrl;

View file

@ -56,7 +56,7 @@ import SageMaker from "./SageMaker";
import SambaNova from "./SambaNova";
import Scaleway from "./Scaleway";
import SiliconFlow from "./SiliconFlow";
import ContinueProxy from "./stubs/ContinueProxy";
import TARS from "./TARS";
import TestLLM from "./Test";
import TextGenWebUI from "./TextGenWebUI";
@ -100,7 +100,6 @@ export const LLMClasses = [
Groq,
Fireworks,
NCompass,
ContinueProxy,
Cloudflare,
Deepseek,
Docker,
@ -180,16 +179,6 @@ export async function llmFromDescription(
uniqueId,
};
if (desc.provider === "continue-proxy") {
options.apiKey = ideSettings.userToken;
if (ideSettings.remoteConfigServerUrl) {
options.apiBase = new URL(
"/proxy/v1",
ideSettings.remoteConfigServerUrl,
).toString();
}
}
return new cls(options);
}

View file

@ -1,156 +0,0 @@
import {
ContinueProperties,
decodeSecretLocation,
parseProxyModelName,
SecretType,
} from "@continuedev/config-yaml";
import { ControlPlaneProxyInfo } from "../../../control-plane/analytics/IAnalyticsProvider.js";
import { IdeInfoService } from "../../../util/IdeInfoService.js";
import OpenAI from "../OpenAI.js";
import type { Chunk, LLMOptions } from "../../../index.js";
import { LLMConfigurationStatuses } from "../../constants.js";
import { LlmApiRequestType } from "../../openaiTypeConverters.js";
class ContinueProxy extends OpenAI {
set controlPlaneProxyInfo(value: ControlPlaneProxyInfo) {
this.apiKey = value.workOsAccessToken;
if (!this.onPremProxyUrl) {
this.apiBase = new URL(
"model-proxy/v1/",
value.controlPlaneProxyUrl,
).toString();
}
}
protected useOpenAIAdapterFor: (LlmApiRequestType | "*")[] = [];
// The apiKey and apiBase are set to the values for the proxy,
// but we need to keep track of the actual values that the proxy will use
// to call whatever LLM API is chosen
private actualApiBase?: string;
// Contains extra properties that we pass along to the proxy. Originally from `env` property on LLMOptions
private configEnv?: Record<string, any>;
constructor(options: LLMOptions) {
super(options);
this.configEnv = options.env;
// This it set to `undefined` to handle the case where we are proxying requests to Azure. We pass the correct env vars
// needed to do this in `extraBodyProperties` below, but if we don't set `apiType` to `undefined`, we end up proxying to
// `/openai/deployments/` which is invalid since that URL construction happens on the proxy.
this.apiType = undefined;
this.actualApiBase = options.apiBase;
this.apiKeyLocation = options.apiKeyLocation;
this.envSecretLocations = options.envSecretLocations;
this.orgScopeId = options.orgScopeId;
this.onPremProxyUrl = options.onPremProxyUrl;
if (this.onPremProxyUrl) {
this.apiBase = new URL("model-proxy/v1/", this.onPremProxyUrl).toString();
}
}
static providerName = "continue-proxy";
static defaultOptions: Partial<LLMOptions> = {
useLegacyCompletionsEndpoint: false,
};
get underlyingProviderName(): string {
const { provider } = parseProxyModelName(this.model);
return provider;
}
protected extraBodyProperties(): Record<string, any> {
const continueProperties: ContinueProperties = {
apiKeyLocation: this.apiKeyLocation,
envSecretLocations: this.envSecretLocations,
apiBase: this.actualApiBase,
orgScopeId: this.orgScopeId ?? null,
env: this.configEnv,
};
return {
continueProperties,
};
}
getConfigurationStatus() {
if (!this.apiKeyLocation && !this.envSecretLocations) {
return LLMConfigurationStatuses.VALID;
}
if (this.apiKeyLocation) {
const secretLocation = decodeSecretLocation(this.apiKeyLocation);
if (secretLocation.secretType === SecretType.NotFound) {
return LLMConfigurationStatuses.MISSING_API_KEY;
}
}
if (this.envSecretLocations) {
for (const secretLocation of Object.values(this.envSecretLocations)) {
const decoded = decodeSecretLocation(secretLocation);
if (decoded.secretType === SecretType.NotFound) {
return LLMConfigurationStatuses.MISSING_ENV_SECRET;
}
}
}
return LLMConfigurationStatuses.VALID;
}
protected _getHeaders() {
const headers: any = super._getHeaders();
headers["x-continue-unique-id"] = IdeInfoService.uniqueId;
headers["user-agent"] = this._getUserAgent();
return headers;
}
private _getUserAgent(): string {
const ideInfo = IdeInfoService.ideInfo;
const extensionVersion = ideInfo?.extensionVersion ?? "unknown";
const ideName = ideInfo?.name ?? "unknown";
const ideType = ideInfo?.ideType ?? "unknown";
return `Continue/${extensionVersion} (${ideName}; ${ideType})`;
}
supportsCompletions(): boolean {
// This was a hotfix and contains duplicate logic from class-specific completion support methods
if (this.underlyingProviderName === "vllm") {
return true;
}
// other providers that don't support completions include groq, mistral, nvidia, deepseek, etc.
// For now disabling all except vllm
return false;
}
supportsFim(): boolean {
const { provider } = parseProxyModelName(this.model);
if (provider === "vllm") {
return false;
}
return true;
}
async rerank(query: string, chunks: Chunk[]): Promise<number[]> {
const url = new URL("rerank", this.apiBase);
const resp = await this.fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${this.apiKey}`,
"user-agent": this._getUserAgent(),
},
body: JSON.stringify({
query,
documents: chunks.map((chunk) => chunk.content),
model: this.model,
...this.extraBodyProperties(),
}),
});
const data: any = await resp.json();
const results = data.data.sort((a: any, b: any) => a.index - b.index);
return results.map((result: any) => result.relevance_score);
}
}
export default ContinueProxy;

View file

@ -1,758 +0,0 @@
import { afterEach, describe, expect, test, vi } from "vitest";
import { ILLM } from "../../../index.js";
import ContinueProxy from "./ContinueProxy.js";
vi.mock("@continuedev/config-yaml", async (importOriginal) => {
const mod = (await importOriginal()) as any;
return {
...mod,
parseProxyModelName: vi.fn(() => ({
provider: "test-provider",
model: "test-model",
ownerSlug: "test-owner",
packageSlug: "test-package",
})),
};
});
interface LlmTestCase {
llm: ILLM;
methodToTest: keyof ILLM;
params: any[];
expectedRequest: {
url: string;
method: string;
headers?: Record<string, string>;
body?: Record<string, any>;
};
mockResponse?: any;
mockStream?: any[];
}
function createMockStream(mockStream: any[]) {
const encoder = new TextEncoder();
return new ReadableStream({
start(controller) {
for (const chunk of mockStream) {
controller.enqueue(
encoder.encode(
`data: ${
typeof chunk === "string" ? chunk : JSON.stringify(chunk)
}\n\n`,
),
);
}
controller.close();
},
});
}
function setupMockFetch(mockResponse?: any, mockStream?: any[]) {
const mockFetch = vi.fn();
if (mockStream) {
const stream = createMockStream(mockStream);
mockFetch.mockResolvedValue(
new Response(stream, {
headers: {
"Content-Type": "text/event-stream",
},
}),
);
} else {
mockFetch.mockResolvedValue(
new Response(JSON.stringify(mockResponse), {
headers: { "Content-Type": "application/json" },
}),
);
}
return mockFetch;
}
function setupReadableStreamPolyfill() {
// This can be removed if https://github.com/nodejs/undici/issues/2888 is resolved
// @ts-ignore
const originalFrom = ReadableStream.from;
// @ts-ignore
ReadableStream.from = (body) => {
if (body?.source) {
return body;
}
return originalFrom(body);
};
}
async function executeLlmMethod(
llm: ILLM,
methodToTest: keyof ILLM,
params: any[],
) {
if (typeof (llm as any)[methodToTest] !== "function") {
throw new Error(
`Method ${String(methodToTest)} does not exist on the LLM instance.`,
);
}
const result = await (llm as any)[methodToTest](...params);
if (result?.next) {
for await (const _ of result) {
}
}
}
function assertFetchCall(mockFetch: any, expectedRequest: any) {
expect(mockFetch).toHaveBeenCalledTimes(1);
const [url, options] = mockFetch.mock.calls[0];
expect(url.toString()).toBe(expectedRequest.url);
expect(options.method).toBe(expectedRequest.method);
if (expectedRequest.headers) {
expect(options.headers).toEqual(
expect.objectContaining(expectedRequest.headers),
);
}
if (expectedRequest.body) {
const actualBody = JSON.parse(options.body as string);
expect(actualBody).toEqual(expectedRequest.body);
}
}
async function runLlmTest(testCase: LlmTestCase) {
const {
llm,
methodToTest,
params,
expectedRequest,
mockResponse,
mockStream,
} = testCase;
const mockFetch = setupMockFetch(mockResponse, mockStream);
setupReadableStreamPolyfill();
(llm as any).fetch = mockFetch;
await executeLlmMethod(llm, methodToTest, params);
assertFetchCall(mockFetch, expectedRequest);
}
describe("ContinueProxy", () => {
afterEach(() => {
vi.clearAllMocks();
});
test("rerank should send a valid request", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
});
await runLlmTest({
llm: proxy,
methodToTest: "rerank",
params: [
"test query",
[{ content: "document1" }, { content: "document2" }],
],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/rerank",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
},
body: {
query: "test query",
documents: ["document1", "document2"],
model: "test-model",
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
orgScopeId: null,
},
},
},
mockResponse: {
data: [
{ index: 0, relevance_score: 0.9 },
{ index: 1, relevance_score: 0.1 },
],
},
});
});
test("streamChat should send a valid request", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
});
await runLlmTest({
llm: proxy,
methodToTest: "streamChat",
params: [[{ role: "user", content: "hello" }]],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/chat/completions",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
"api-key": "test-api-key",
"x-continue-unique-id": "NOT_UNIQUE",
},
body: {
model: "test-model",
messages: [{ role: "user", content: "hello" }],
max_tokens: 4096,
stream: true,
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
orgScopeId: null,
},
},
},
mockStream: [
'{"choices": [{"delta": {"content": "response"}}]}',
"[DONE]",
],
});
});
test("chat should send a valid request", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
});
await runLlmTest({
llm: proxy,
methodToTest: "chat",
params: [[{ role: "user", content: "hello" }]],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/chat/completions",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
"api-key": "test-api-key",
"x-continue-unique-id": "NOT_UNIQUE",
},
body: {
model: "test-model",
messages: [{ role: "user", content: "hello" }],
max_tokens: 4096,
stream: true,
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
orgScopeId: null,
},
},
},
mockStream: [
'{"choices": [{"delta": {"content": "Hello! How can I help you today?"}}]}',
"[DONE]",
],
});
});
test("streamComplete should send a valid request", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
});
await runLlmTest({
llm: proxy,
methodToTest: "streamComplete",
params: ["Complete this: Hello"],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/chat/completions",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
"api-key": "test-api-key",
"x-continue-unique-id": "NOT_UNIQUE",
},
body: {
model: "test-model",
messages: [{ role: "user", content: "Complete this: Hello" }],
max_tokens: 4096,
stream: true,
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
orgScopeId: null,
},
},
},
mockStream: [
'{"choices": [{"delta": {"content": " world!"}}]}',
"[DONE]",
],
});
});
test("complete should send a valid request", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
});
await runLlmTest({
llm: proxy,
methodToTest: "complete",
params: ["Complete this: Hello"],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/chat/completions",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
"api-key": "test-api-key",
"x-continue-unique-id": "NOT_UNIQUE",
},
body: {
model: "test-model",
messages: [{ role: "user", content: "Complete this: Hello" }],
max_tokens: 4096,
stream: true,
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
orgScopeId: null,
},
},
},
mockStream: [
'{"choices": [{"delta": {"content": " world!"}}]}',
"[DONE]",
],
});
});
test("streamFim should send a valid request", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
});
await runLlmTest({
llm: proxy,
methodToTest: "streamFim",
params: ["function test() {\n ", "\n}"],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/fim/completions",
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
"x-api-key": "test-api-key",
Authorization: "Bearer test-api-key",
},
body: {
model: "test-model",
prompt: "function test() {\n ",
suffix: "\n}",
max_tokens: 4096,
stream: true,
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
orgScopeId: null,
},
},
},
mockStream: [
'{"choices": [{"delta": {"content": "console.log("Hello");"}}]}',
"[DONE]",
],
});
});
test("embed should send a valid request", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
});
await runLlmTest({
llm: proxy,
methodToTest: "embed",
params: [["text to embed", "another text"]],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/embeddings",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
"api-key": "test-api-key",
},
body: {
input: ["text to embed", "another text"],
model: "test-model",
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
orgScopeId: null,
},
},
},
mockResponse: {
data: [{ embedding: [0.1, 0.2, 0.3] }, { embedding: [0.4, 0.5, 0.6] }],
},
});
});
test("listModels should send a valid request", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
});
await runLlmTest({
llm: proxy,
methodToTest: "listModels",
params: [],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/models",
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
"api-key": "test-api-key",
},
},
mockResponse: {
data: [{ id: "gpt-4" }, { id: "gpt-3.5-turbo" }],
},
});
});
describe("Different provider configurations", () => {
test("should handle on-prem proxy URL", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
onPremProxyUrl: "https://my-proxy.company.com/",
});
await runLlmTest({
llm: proxy,
methodToTest: "rerank",
params: [
"test query",
[{ content: "document1" }, { content: "document2" }],
],
expectedRequest: {
url: "https://my-proxy.company.com/model-proxy/v1/rerank",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
},
body: {
query: "test query",
documents: ["document1", "document2"],
model: "test-model",
continueProperties: {
apiBase: undefined,
apiKeyLocation: undefined,
env: undefined,
envSecretLocations: undefined,
orgScopeId: null,
},
},
},
mockResponse: {
data: [
{ index: 0, relevance_score: 0.9 },
{ index: 1, relevance_score: 0.1 },
],
},
});
});
test("should handle environment variables", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
env: {
CUSTOM_VAR: "custom-value",
ANOTHER_VAR: "another-value",
},
});
await runLlmTest({
llm: proxy,
methodToTest: "streamChat",
params: [[{ role: "user", content: "hello" }]],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/chat/completions",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
"api-key": "test-api-key",
"x-continue-unique-id": "NOT_UNIQUE",
},
body: {
model: "test-model",
messages: [{ role: "user", content: "hello" }],
max_tokens: 4096,
stream: true,
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
env: {
CUSTOM_VAR: "custom-value",
ANOTHER_VAR: "another-value",
},
orgScopeId: null,
},
},
},
mockStream: [
'{"choices": [{"delta": {"content": "response"}}]}',
"[DONE]",
],
});
});
test("should handle API key location", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
apiKeyLocation: "env:OPENAI_API_KEY",
});
await runLlmTest({
llm: proxy,
methodToTest: "embed",
params: [["test text"]],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/embeddings",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
"api-key": "test-api-key",
},
body: {
input: ["test text"],
model: "test-model",
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
apiKeyLocation: "env:OPENAI_API_KEY",
env: undefined,
envSecretLocations: undefined,
orgScopeId: null,
},
},
},
mockResponse: {
data: [{ embedding: [0.1, 0.2, 0.3] }],
},
});
});
test("should handle env secret locations", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
envSecretLocations: {
AZURE_API_KEY: "env:AZURE_API_KEY",
AZURE_ENDPOINT: "env:AZURE_ENDPOINT",
},
});
await runLlmTest({
llm: proxy,
methodToTest: "streamFim",
params: ["const x = ", ";"],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/fim/completions",
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
"x-api-key": "test-api-key",
Authorization: "Bearer test-api-key",
},
body: {
model: "test-model",
prompt: "const x = ",
suffix: ";",
max_tokens: 4096,
stream: true,
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
envSecretLocations: {
AZURE_API_KEY: "env:AZURE_API_KEY",
AZURE_ENDPOINT: "env:AZURE_ENDPOINT",
},
orgScopeId: null,
},
},
},
mockStream: ['{"choices": [{"delta": {"content": "42"}}]}', "[DONE]"],
});
});
test("should handle organization scope ID", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
orgScopeId: "org_12345",
});
await runLlmTest({
llm: proxy,
methodToTest: "listModels",
params: [],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/models",
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
"api-key": "test-api-key",
},
},
mockResponse: {
data: [{ id: "gpt-4" }],
},
});
});
});
describe("Edge cases", () => {
test("should handle empty chunks array for rerank", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
});
await runLlmTest({
llm: proxy,
methodToTest: "rerank",
params: ["test query", []],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/rerank",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
},
body: {
query: "test query",
documents: [],
model: "test-model",
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
apiKeyLocation: undefined,
env: undefined,
envSecretLocations: undefined,
orgScopeId: null,
},
},
},
mockResponse: {
data: [],
},
});
});
test("should handle complex chat messages", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
});
const complexMessages = [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Hello!" },
{ role: "assistant", content: "Hi there! How can I help you today?" },
{ role: "user", content: "What's the weather like?" },
];
await runLlmTest({
llm: proxy,
methodToTest: "streamChat",
params: [complexMessages],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/chat/completions",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
"api-key": "test-api-key",
"x-continue-unique-id": "NOT_UNIQUE",
},
body: {
model: "test-model",
messages: complexMessages,
max_tokens: 4096,
stream: true,
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
orgScopeId: null,
},
},
},
mockStream: [
'{"choices": [{"delta": {"content": "I don\'t have access to current weather data."}}]}',
"[DONE]",
],
});
});
test("should handle single embedding chunk", async () => {
const proxy = new ContinueProxy({
apiKey: "test-api-key",
model: "test-model",
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
});
await runLlmTest({
llm: proxy,
methodToTest: "embed",
params: [["single text"]],
expectedRequest: {
url: "https://proxy.continue.dev/model-proxy/v1/embeddings",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer test-api-key",
"api-key": "test-api-key",
},
body: {
input: ["single text"],
model: "test-model",
continueProperties: {
apiBase: "https://proxy.continue.dev/model-proxy/v1/",
apiKeyLocation: undefined,
env: undefined,
envSecretLocations: undefined,
orgScopeId: null,
},
},
},
mockResponse: {
data: [{ embedding: [0.1, 0.2, 0.3] }],
},
});
});
});
});

View file

@ -4,35 +4,10 @@ import Deepseek from "../Deepseek.js";
import FunctionNetwork from "../FunctionNetwork.js";
import Mistral from "../Mistral.js";
import OpenAI from "../OpenAI.js";
import ContinueProxy from "../stubs/ContinueProxy.js";
import Vllm from "../Vllm.js";
// Mock the parseProxyModelName function
const mockParseProxyModelName = jest.fn();
jest.mock("@continuedev/config-yaml", () => ({
parseProxyModelName: mockParseProxyModelName,
decodeSecretLocation: jest.fn(),
SecretType: { NotFound: "not-found" },
}));
// Test cases: [LLM class, model, expected supportsFim result, description]
const testCases: [any, string, boolean, string][] = [
[ContinueProxy, "owner/package/vllm/some-model", false, "vllm provider"],
[ContinueProxy, "owner/package/openai/gpt-4", true, "openai provider"],
[
ContinueProxy,
"owner/package/anthropic/claude-3",
true,
"anthropic provider",
],
[ContinueProxy, "owner/package/cohere/command-r", true, "cohere provider"],
[
ContinueProxy,
"owner/package/unknown-provider/some-model",
true,
"unknown provider",
],
[ContinueProxy, "owner/package/groq/llama-model", true, "groq provider"],
[Vllm, "any-model", false, "Vllm"],
[Anthropic, "claude-3-5-sonnet-latest", false, "Anthropic"],
[FunctionNetwork, "any-model", false, "FunctionNetwork"],

View file

@ -2,70 +2,6 @@
import { PROVIDER_TOOL_SUPPORT, isRecommendedAgentModel } from "./toolSupport";
describe("PROVIDER_TOOL_SUPPORT", () => {
describe("continue-proxy", () => {
const supportsFn = PROVIDER_TOOL_SUPPORT["continue-proxy"];
it("should return true for Claude 3.5 models", () => {
expect(
supportsFn("ownerSlug/packageSlug/anthropic/claude-3-5-sonnet"),
).toBe(true);
expect(
supportsFn("ownerSlug/packageSlug/anthropic/claude-3.5-sonnet"),
).toBe(true);
});
it("should return true for Claude 3.7 models", () => {
expect(
supportsFn("ownerSlug/packageSlug/anthropic/claude-3-7-haiku"),
).toBe(true);
expect(
supportsFn("ownerSlug/packageSlug/anthropic/claude-3.7-sonnet"),
).toBe(true);
});
it("should return true for GPT-4 models", () => {
expect(supportsFn("ownerSlug/packageSlug/openai/gpt-4-turbo")).toBe(true);
expect(
supportsFn("ownerSlug/packageSlug/openai/gpt-4-1106-preview"),
).toBe(true);
});
it("should return true for Gemma models", () => {
expect(supportsFn("ownerSlug/packageSlug/openai/gemma")).toBe(true);
expect(supportsFn("ownerSlug/packageSlug/openai/gemma3")).toBe(true);
});
it("should return true for O3 models", () => {
expect(supportsFn("ownerSlug/packageSlug/openai/o3-preview")).toBe(true);
});
it("should return true for Gemini models", () => {
expect(supportsFn("ownerSlug/packageSlug/gemini/gemini-pro")).toBe(true);
expect(supportsFn("ownerSlug/packageSlug/gemini/gemini-2.5-pro")).toBe(
true,
);
});
it("should return false for unsupported models", () => {
expect(supportsFn("ownerSlug/packageSlug/openai/gpt-3.5-turbo")).toBe(
false,
);
expect(supportsFn("ownerSlug/packageSlug/anthropic/claude-2")).toBe(
false,
);
expect(supportsFn("ownerSlug/packageSlug/together/llama-3")).toBe(false);
});
it("should handle case insensitivity", () => {
expect(
supportsFn("ownerSlug/packageSlug/anthropic/CLAUDE-3-5-sonnet"),
).toBe(true);
expect(supportsFn("ownerSlug/packageSlug/openai/GPT-4-turbo")).toBe(true);
expect(supportsFn("ownerSlug/packageSlug/openai/Gemma3")).toBe(true);
expect(supportsFn("ownerSlug/packageSlug/gemini/GEMINI-pro")).toBe(true);
});
});
describe("anthropic", () => {
const supportsFn = PROVIDER_TOOL_SUPPORT["anthropic"];
@ -395,7 +331,6 @@ describe("PROVIDER_TOOL_SUPPORT", () => {
describe("edge cases", () => {
it("should handle empty model names", () => {
expect(PROVIDER_TOOL_SUPPORT["continue-proxy"]("")).toBe(false);
expect(PROVIDER_TOOL_SUPPORT["anthropic"]("")).toBe(false);
expect(PROVIDER_TOOL_SUPPORT["openai"]("")).toBe(false);
expect(PROVIDER_TOOL_SUPPORT["gemini"]("")).toBe(false);

View file

@ -1,23 +1,7 @@
import { parseProxyModelName } from "@continuedev/config-yaml";
import { ModelDescription } from "..";
export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
{
"continue-proxy": (model) => {
try {
const { provider, model: _model } = parseProxyModelName(model);
if (provider && _model && provider !== "continue-proxy") {
const fn = PROVIDER_TOOL_SUPPORT[provider];
if (fn) {
return fn(_model);
}
}
} catch (e) {}
return ["claude", "gpt-4", "o3", "gemini", "gemma"].some((part) =>
model.toLowerCase().startsWith(part),
);
},
anthropic: (model) => {
if (model.includes("claude-2") || model.includes("claude-instant")) {
return false;

View file

@ -1,12 +0,0 @@
import { CreditStatus } from "../../control-plane/client";
export function isOutOfStarterCredits(
usingModelsAddOnApiKey: boolean,
creditStatus: CreditStatus,
): boolean {
return (
usingModelsAddOnApiKey &&
!creditStatus.hasCredits &&
!creditStatus.hasPurchasedCredits
);
}

View file

@ -156,13 +156,6 @@ export class NextEditProvider {
if (llm instanceof OpenAI) {
llm.useLegacyCompletionsEndpoint = true;
}
// TODO: Resolve import error with TRIAL_FIM_MODEL
// else if (
// llm.providerName === "free-trial" &&
// llm.model !== TRIAL_FIM_MODEL
// ) {
// llm.model = TRIAL_FIM_MODEL;
// }
return llm;
}
@ -510,9 +503,6 @@ export class NextEditProvider {
let outcome: NextEditOutcome | undefined;
// Handle based on diff type.
const profileType =
this.configHandler.currentProfile?.profileDescription.profileType;
if (opts?.usingFullFileDiff === false || !opts?.usingFullFileDiff) {
outcome = await this.modelProvider.handlePartialFileDiff({
helper,
@ -523,7 +513,6 @@ export class NextEditProvider {
nextCompletion,
promptMetadata: this.promptMetadata!,
ide: this.ide,
profileType,
});
} else {
outcome = await this.modelProvider.handleFullFileDiff({
@ -535,7 +524,6 @@ export class NextEditProvider {
nextCompletion,
promptMetadata: this.promptMetadata!,
ide: this.ide,
profileType,
});
}

View file

@ -56,7 +56,6 @@ export abstract class BaseNextEditModelProvider {
nextCompletion: string;
promptMetadata: PromptMetadata;
ide: IDE;
profileType?: "local" | "platform" | "control-plane";
}): Promise<NextEditOutcome> {
const {
helper,
@ -67,7 +66,6 @@ export abstract class BaseNextEditModelProvider {
nextCompletion,
promptMetadata,
ide,
profileType,
} = params;
const oldEditRangeSlice = helper.fileContents
.split("\n")
@ -95,7 +93,6 @@ export abstract class BaseNextEditModelProvider {
originalEditableRange: oldEditRangeSlice,
diffLines: [],
ide,
profileType,
});
return outcome;
@ -110,7 +107,6 @@ export abstract class BaseNextEditModelProvider {
nextCompletion: string;
promptMetadata: PromptMetadata;
ide: IDE;
profileType?: "local" | "platform" | "control-plane";
}): Promise<NextEditOutcome | undefined> {
const {
helper,
@ -121,7 +117,6 @@ export abstract class BaseNextEditModelProvider {
nextCompletion,
promptMetadata,
ide,
profileType,
} = params;
const fileSlice = helper.fileLines
.slice(editableRegionStartLine, editableRegionEndLine + 1)
@ -145,7 +140,6 @@ export abstract class BaseNextEditModelProvider {
prefetchQueue,
promptMetadata,
ide,
profileType,
});
if (cursorLocalDiffGroup) {
@ -158,7 +152,6 @@ export abstract class BaseNextEditModelProvider {
isCurrentCursorGroup: true,
promptMetadata,
ide,
profileType,
});
}
@ -177,7 +170,6 @@ export abstract class BaseNextEditModelProvider {
prefetchQueue: PrefetchQueue;
promptMetadata: PromptMetadata;
ide: IDE;
profileType?: "local" | "platform" | "control-plane";
}): Promise<DiffGroup | undefined> {
const {
diffGroups,
@ -188,7 +180,6 @@ export abstract class BaseNextEditModelProvider {
prefetchQueue,
promptMetadata,
ide,
profileType,
} = params;
let cursorGroup: DiffGroup | undefined;
@ -204,7 +195,6 @@ export abstract class BaseNextEditModelProvider {
prefetchQueue,
promptMetadata,
ide,
profileType,
});
}
}
@ -220,7 +210,6 @@ export abstract class BaseNextEditModelProvider {
prefetchQueue: PrefetchQueue;
promptMetadata: PromptMetadata;
ide: IDE;
profileType?: "local" | "platform" | "control-plane";
}): Promise<void> {
const {
group,
@ -230,7 +219,6 @@ export abstract class BaseNextEditModelProvider {
prefetchQueue,
promptMetadata,
ide,
profileType,
} = params;
// Extract lines that are not old.
const groupContent = group.lines
@ -274,7 +262,6 @@ export abstract class BaseNextEditModelProvider {
completionId: uuidv4(), // Generate a new ID for this prefetched item.
diffLines: group.lines,
ide,
profileType,
});
prefetchQueue.enqueueProcessed({
@ -292,7 +279,6 @@ export abstract class BaseNextEditModelProvider {
isCurrentCursorGroup: boolean;
promptMetadata: PromptMetadata;
ide: IDE;
profileType?: "local" | "platform" | "control-plane";
}): Promise<NextEditOutcome> {
const {
diffGroup,
@ -303,7 +289,6 @@ export abstract class BaseNextEditModelProvider {
isCurrentCursorGroup,
promptMetadata,
ide,
profileType,
} = params;
const groupContent = diffGroup.lines
.filter((l) => l.type !== "old")
@ -342,7 +327,6 @@ export abstract class BaseNextEditModelProvider {
completionId,
diffLines: diffGroup.lines,
ide,
profileType,
});
return outcomeNext;
@ -364,7 +348,6 @@ export abstract class BaseNextEditModelProvider {
completionId?: string;
diffLines: DiffLine[];
ide: IDE;
profileType?: "local" | "platform" | "control-plane";
}): Promise<NextEditOutcome> {
return {
elapsed: Date.now() - outcomeCtx.startTime,
@ -391,7 +374,6 @@ export abstract class BaseNextEditModelProvider {
editableRegionStartLine: outcomeCtx.editableRegionStartLine,
editableRegionEndLine: outcomeCtx.editableRegionEndLine,
diffLines: outcomeCtx.diffLines,
profileType: outcomeCtx.profileType,
...outcomeCtx.helper.options,
};
}

View file

@ -68,7 +68,6 @@ export interface NextEditOutcome extends TabAutocompleteOptions {
editableRegionStartLine: number;
editableRegionEndLine: number;
diffLines: DiffLine[];
profileType?: "local" | "platform" | "control-plane";
}
export interface PromptMetadata {

View file

@ -10,6 +10,7 @@ import {
AutocompleteInput,
RecentlyEditedRange,
} from "../autocomplete/util/types";
import { ProfileDescription } from "../config/ProfileLifecycleManager";
import { SharedConfigSchema } from "../config/sharedConfig";
import { GlobalContextModelSelections } from "../util/GlobalContext";
@ -44,12 +45,6 @@ import {
import { AutocompleteCodeSnippet } from "../autocomplete/snippets/types";
import { GetLspDefinitionsFunction } from "../autocomplete/types";
import { ConfigHandler } from "../config/ConfigHandler";
import { SerializedOrgWithProfiles } from "../config/ProfileLifecycleManager";
import {
ControlPlaneEnv,
ControlPlaneSessionInfo,
} from "../control-plane/AuthTypes";
import { CreditStatus, RemoteSessionMetadata } from "../control-plane/client";
import { ProcessedItem } from "../nextEdit/NextEditPrefetchQueue";
import { NextEditOutcome } from "../nextEdit/types";
import { ContinueErrorReason } from "../util/errors";
@ -57,7 +52,6 @@ import { ContinueErrorReason } from "../util/errors";
export enum OnboardingModes {
API_KEY = "API Key",
LOCAL = "Local",
MODELS_ADD_ON = "Models Add-On",
}
export interface ListHistoryOptions {
@ -72,13 +66,9 @@ export type ToCoreFromIdeOrWebviewProtocol = {
cancelApply: [undefined, void];
// History
"history/list": [
ListHistoryOptions,
(BaseSessionMetadata | RemoteSessionMetadata)[],
];
"history/list": [ListHistoryOptions, BaseSessionMetadata[]];
"history/delete": [{ id: string }, void];
"history/load": [{ id: string }, Session];
"history/loadRemote": [{ remoteId: string }, Session];
"history/save": [Session, void];
"history/share": [{ id: string; outputDir?: string }, void];
"history/clear": [undefined, void];
@ -105,8 +95,7 @@ export type ToCoreFromIdeOrWebviewProtocol = {
{
result: ConfigResult<BrowserSerializedContinueConfig>;
profileId: string | null;
organizations: SerializedOrgWithProfiles[];
selectedOrgId: string | null;
profiles: ProfileDescription[];
},
];
"config/deleteModel": [{ title: string }, void];
@ -115,7 +104,6 @@ export type ToCoreFromIdeOrWebviewProtocol = {
| undefined
| {
reason?: string;
selectOrgId?: string;
selectProfileId?: string;
}
),
@ -338,14 +326,7 @@ export type ToCoreFromIdeOrWebviewProtocol = {
},
];
"clipboardCache/add": [{ content: string }, void];
"controlPlane/openUrl": [{ path: string; orgSlug?: string }, void];
"controlPlane/getEnvironment": [undefined, ControlPlaneEnv];
"controlPlane/getCreditStatus": [undefined, CreditStatus | null];
isItemTooBig: [{ item: ContextItemWithId }, boolean];
didChangeControlPlaneSessionInfo: [
{ sessionInfo: ControlPlaneSessionInfo | undefined },
void,
];
"process/markAsBackgrounded": [{ toolCallId: string }, void];
"process/isBackgrounded": [{ toolCallId: string }, boolean];
"process/killTerminalProcess": [{ toolCallId: string }, void];

View file

@ -3,6 +3,5 @@ import { ToWebviewFromIdeOrCoreProtocol } from "./webview.js";
export type ToCoreFromWebviewProtocol = ToCoreFromIdeOrWebviewProtocol & {
didChangeSelectedProfile: [{ id: string }, void];
didChangeSelectedOrg: [{ id: string; profileId?: string }, void];
};
export type ToWebviewFromCoreProtocol = ToWebviewFromIdeOrCoreProtocol;

View file

@ -14,8 +14,6 @@ import type {
TerminalOptions,
Thread,
} from "../";
import { ControlPlaneSessionInfo } from "../control-plane/AuthTypes";
export interface GetGhTokenArgs {
force?: boolean;
}
@ -88,11 +86,6 @@ export type ToIdeFromWebviewOrCoreProtocol = {
getReferences: [{ location: Location }, RangeInFile[]];
getDocumentSymbols: [{ textDocumentIdentifier: string }, DocumentSymbol[]];
getControlPlaneSessionInfo: [
{ silent: boolean; useOnboarding: boolean },
ControlPlaneSessionInfo | undefined,
];
logoutOfControlPlane: [undefined, void];
reportError: [any, void];
closeSidebar: [undefined, void];
};

View file

@ -6,10 +6,8 @@ import {
AddToChatPayload,
ApplyState,
ApplyToFilePayload,
ContextItemWithId,
HighlightedCodePayload,
MessageContent,
RangeInFile,
RangeInFileWithContents,
SetCodeToEditPayload,
ShowFilePayload,
@ -52,38 +50,6 @@ export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & {
"edit/addCurrentSelection": [undefined, void];
"edit/clearDecorations": [undefined, void];
"session/share": [{ sessionId: string }, void];
createBackgroundAgent: [
{
content: MessageContent;
contextItems: ContextItemWithId[];
selectedCode: RangeInFile[];
organizationId?: string;
agent?: string;
},
void,
];
listBackgroundAgents: [
{ organizationId?: string; limit?: number },
{
agents: Array<{
id: string;
name: string | null;
status: string;
repoUrl: string;
createdAt: string;
metadata?: {
github_repo?: string;
};
}>;
totalCount: number;
},
];
openAgentLocally: [
{
agentSessionId: string;
},
void,
];
};
export type ToWebviewFromIdeProtocol = ToWebviewFromIdeOrCoreProtocol & {
@ -100,7 +66,6 @@ export type ToWebviewFromIdeProtocol = ToWebviewFromIdeOrCoreProtocol & {
focusContinueSessionId: [{ sessionId: string | undefined }, void];
newSession: [undefined, void];
loadAgentSession: [{ session: any }, void];
setTheme: [{ theme: any }, void];
setColors: [{ [key: string]: string }, void];
"jetbrains/editorInsetRefresh": [undefined, void];

View file

@ -109,11 +109,6 @@ export class ReverseMessageIde {
return this.ide.showLines(data.filepath, data.startLine, data.endLine);
});
this.on("getControlPlaneSessionInfo", async (msg) => {
// Not supported in testing
return undefined;
});
this.on("writeFile", (data) => {
return this.ide.writeFile(data.path, data.contents);
});

View file

@ -13,7 +13,6 @@ export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] =
"history/list",
"history/delete",
"history/load",
"history/loadRemote",
"history/save",
"history/clear",
"devdata/log",
@ -80,13 +79,9 @@ export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] =
"onboarding/complete",
"addAutocompleteModel",
"didChangeSelectedProfile",
"didChangeSelectedOrg",
"tools/call",
"tools/evaluatePolicy",
"tools/preprocessArgs",
"controlPlane/getEnvironment",
"controlPlane/getCreditStatus",
"controlPlane/openUrl",
"isItemTooBig",
"process/markAsBackgrounded",
"process/isBackgrounded",
@ -110,5 +105,4 @@ export const CORE_TO_WEBVIEW_PASS_THROUGH: (keyof ToWebviewFromCoreProtocol)[] =
"sessionUpdate",
"didCloseFiles",
"toolCallPartialOutput",
"freeTrialExceeded",
];

View file

@ -1,6 +1,4 @@
import { ConfigResult } from "@continuedev/config-yaml";
import { SerializedOrgWithProfiles } from "../config/ProfileLifecycleManager.js";
import { ControlPlaneSessionInfo } from "../control-plane/AuthTypes.js";
import type {
BrowserSerializedContinueConfig,
ContextItemWithId,
@ -8,14 +6,14 @@ import type {
IndexingProgressUpdate,
IndexingStatus,
} from "../index.js";
import type { ProfileDescription } from "../config/ProfileLifecycleManager.js";
export type ToWebviewFromIdeOrCoreProtocol = {
configUpdate: [
{
result: ConfigResult<BrowserSerializedContinueConfig>;
profileId: string | null;
organizations: SerializedOrgWithProfiles[];
selectedOrgId: string | null;
profiles: ProfileDescription[];
},
void,
];
@ -41,7 +39,6 @@ export type ToWebviewFromIdeOrCoreProtocol = {
getWebviewHistoryLength: [undefined, number];
getCurrentSessionId: [undefined, string];
"jetbrains/setColors": [Record<string, string | null | undefined>, void];
sessionUpdate: [{ sessionInfo: ControlPlaneSessionInfo | undefined }, void];
sessionUpdate: [{ sessionInfo: any | undefined }, void];
toolCallPartialOutput: [{ toolCallId: string; contextItems: any[] }, void];
freeTrialExceeded: [undefined, void];
};

View file

@ -1,5 +1,4 @@
import { ConfigHandler } from "../config/ConfigHandler";
import { ControlPlaneClient } from "../control-plane/client";
import Mock from "../llm/llms/Mock";
import { LLMLogger } from "../llm/logger";
import FileSystemIde from "../util/filesystem";
@ -10,16 +9,7 @@ export const testIde = new FileSystemIde(TEST_DIR);
export const ideSettingsPromise = testIde.getIdeSettings();
export const testControlPlaneClient = new ControlPlaneClient(
Promise.resolve(undefined),
testIde,
);
export const testConfigHandler = new ConfigHandler(
testIde,
new LLMLogger(),
Promise.resolve(undefined),
);
export const testConfigHandler = new ConfigHandler(testIde, new LLMLogger());
export const testLLM = new Mock({
model: "mock-model",

View file

@ -7,7 +7,6 @@ describe("Tool Definitions", () => {
const mockParams: ConfigDependentToolParams = {
rules: [],
enableExperimentalTools: false,
isSignedIn: false,
isRemote: false,
modelName: "a model",
ide: {} as any,

View file

@ -18,16 +18,13 @@ export const getBaseToolDefinitions = () => [
export const getConfigDependentToolDefinitions = async (
params: ConfigDependentToolParams,
): Promise<Tool[]> => {
const { modelName, isSignedIn, enableExperimentalTools, isRemote } = params;
const { modelName, enableExperimentalTools, isRemote } = params;
const tools: Tool[] = [];
tools.push(await toolDefinitions.requestRuleTool(params));
tools.push(await toolDefinitions.readSkillTool(params));
if (isSignedIn) {
// Web search is only available for signed-in users
tools.push(toolDefinitions.searchWebTool);
}
tools.push(toolDefinitions.searchWebTool);
if (enableExperimentalTools) {
tools.push(

View file

@ -2,35 +2,18 @@ import { expect, test } from "vitest";
import { BuiltInToolNames } from "./builtIn";
import { getConfigDependentToolDefinitions } from "./index";
test("searchWeb tool is only available when user is signed in", async () => {
// Test with signed-in user
const signedInTools = await getConfigDependentToolDefinitions({
test("searchWeb tool is always available", async () => {
const tools = await getConfigDependentToolDefinitions({
rules: [],
enableExperimentalTools: false,
isSignedIn: true,
isRemote: false,
modelName: "",
ide: {} as any,
});
const searchWebToolSignedIn = signedInTools.find(
const searchWebTool = tools.find(
(tool) => tool.function.name === BuiltInToolNames.SearchWeb,
);
expect(searchWebToolSignedIn).toBeDefined();
expect(searchWebToolSignedIn?.displayTitle).toBe("Search Web");
// Test with non-signed-in user
const notSignedInTools = await getConfigDependentToolDefinitions({
rules: [],
enableExperimentalTools: false,
isSignedIn: false,
isRemote: false,
modelName: "",
ide: {} as any,
});
const searchWebToolNotSignedIn = notSignedInTools.find(
(tool) => tool.function.name === BuiltInToolNames.SearchWeb,
);
expect(searchWebToolNotSignedIn).toBeUndefined();
expect(searchWebTool).toBeDefined();
expect(searchWebTool?.displayTitle).toBe("Search Web");
});

View file

@ -1,3 +1,5 @@
export const EXTENSION_NAME = "continue";
export const NEW_SESSION_TITLE = "New Session";
export const GITHUB_LINK =

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

View file

@ -1,347 +0,0 @@
---
title: "Contributing to Continue Documentation"
sidebarTitle: "Docs Contributions"
description: "Welcome to the Continue documentation! We're excited that you want to contribute. This guide will help you get started with our documentation workflow and tools."
---
## 🚀 Quick Start
### Prerequisites
1. **Node.js** (v20 or higher)
2. **Git** for version control
3. **GitHub CLI** - Install from [cli.github.com](https://cli.github.com/)
### Setup Steps
1. **Fork and clone the repository**
```bash
# Fork the repository (this will also clone it locally)
gh repo fork continuedev/continue
cd continue/docs
```
2. **Install dependencies**
```bash
npm install
```
3. **Start the local development server**
```bash
npm run dev
```
Your docs will be available at `http://localhost:3000`
## 💬 Creating Discussions and Issues
Before creating any issues, we ask that you start with a GitHub Discussion. This helps us organize feedback and determine the best path forward.
### Starting a Discussion
<Steps>
<Step title="Go to GitHub Discussions">
Visit the [Continue GitHub Discussions](https://github.com/continuedev/continue/discussions) page.
</Step>
<Step title="Choose the right category">
Select the **Docs** category for documentation improvements, corrections, or suggestions.
</Step>
<Step title="Provide detailed information">
Include the following in your discussion:
- Clear description of the issue or suggestion
- Steps to reproduce (if applicable)
- Expected vs. actual behavior
- Screenshots or code examples when helpful
- Your environment (OS, IDE, Continue version)
</Step>
</Steps>
### Issue Escalation Process
<Info>
**Important**: All issues should start as discussions. The Continue team will determine if and when a discussion should be escalated to a GitHub issue.
</Info>
The Continue team will review discussions and may:
- Provide a solution or clarification directly in the discussion
- Ask for additional information or testing
- Convert the discussion to an issue if it requires code changes or is a confirmed bug
- Close the discussion if it's resolved or not actionable
### When Discussions Become Issues
A discussion will typically be converted to an issue when:
- A bug in the documentation is confirmed
- A new feature or significant documentation change is approved
- Community consensus supports the proposed change
- Technical implementation is required
## 🤖 AI-Powered Documentation with Continue
We strongly encourage using Continue's AI assistance to maintain consistency and quality in our documentation. Here are three ways to set this up:
### Option 1: Use the Pre-Built Documentation Agent (Recommended)
The easiest way to get started is using our pre-configured documentation agent:
<Steps>
<Step title="Install the agent from Continue Mission Control">
Visit [the Docs Assistant - Mintlify in Mission Control](https://continue.dev/continuedev/docs-mintlify) and click "Install" to add it to your Continue setup. This agent comes pre-configured with all our documentation standards.
<Info>
Learn more about Continue Configs in our [config documentation](/guides/understanding-configs).
</Info>
</Step>
<Step title="Use the agent">
<Tabs>
<Tab title="Command Line">
```bash
# Install the Continue CLI if you haven't already
npm install -g @continuedev/cli
# Use the agent from the command line
cn "Create a new guide for using the Continue CLI with Linear" --config continuedev/docs-mintlify
```
</Tab>
<Tab title="IDE">
1. Open Continue in your IDE
2. Select the "Docs Assistant - Mintlify" agent from the model dropdown
3. Ask it to help you create or edit documentation
Example prompts:
- "Create a new guide for using the Continue CLI with Linear"
- "Update the getting-started guide with the new installation process"
- "Format this documentation according to Mintlify standards"
</Tab>
</Tabs>
</Step>
</Steps>
<Tip>
You can also remix this config to customize it for your specific needs. Learn how to create your own remix in our [remix config documentation](/mission-control/configs/create-a-config#how-to-remix-a-config).
</Tip>
### Option 2: Create Your Own Custom Agent
If you want more control or customization, you can create your own documentation agent:
<Steps>
<Step title="Create a new config">
Follow our [config creation guide](/mission-control/configs/create-a-config) to set up your own config.
</Step>
<Step title="Add the Continue Docs MCP">
Install from Continue Mission Control: https://continue.dev/continuedev/continue-docs-mcp
This MCP provides context about Continue's documentation structure and standards.
</Step>
<Step title="Add Mintlify formatting rules">
Install from Continue Mission Control: https://continue.dev/mintlify/technical-writing-rule
This rule ensures proper Mintlify component formatting.
</Step>
<Step title="Use your custom agent">
<Tabs>
<Tab title="Command Line">
```bash
# Install the Continue CLI if you haven't already
npm install -g @continuedev/cli
# Use your agent from the command line
cn --config your-org/your-agent-name "Create a new guide for API authentication"
```
</Tab>
<Tab title="IDE">
1. Open Continue in your IDE
2. Select your custom agent from the model dropdown
3. Ask it to help you create or edit documentation
Example prompts:
- "Help me format this documentation according to Mintlify standards"
- "Create a troubleshooting section for this feature"
</Tab>
</Tabs>
</Step>
</Steps>
## 📝 Documentation Standards
### Mintlify Component Guidelines
When using Mintlify components, follow these formatting rules:
#### Cards and Info Boxes
```mdx
<Card title="Best Practice" icon="lightbulb">
Always include blank lines and proper indentation:
- Use 2-space indentation
- Add blank lines after opening tags
- Format lists as bullet points
</Card>
```
#### Warning and Note Components
```mdx
<Warning>
Important information should be formatted clearly:
- Each point on its own line
- Consistent indentation
- Clear, concise language
</Warning>
```
### Writing Style
1. **Be concise**: Get to the point quickly
2. **Use examples**: Show, don't just tell
3. **Include code blocks**: Provide working examples
4. **Add visuals**: Screenshots and diagrams help understanding
5. **Test your changes**: Ensure all links and code examples work
<Warning>
If you are creating a new guide, please test the steps yourself to ensure accuracy.
</Warning>
## 🔧 Common Tasks
### Adding a New Guide
1. Create a new `.mdx` file in the guides directory
2. Add frontmatter:
```mdx
---
title: "Your Guide Title"
description: "Brief description of what this guide covers"
---
```
3. Use the Continue agent to help format your content
4. Update `docs.json` to include your new page in the navigation
<Tip>
We have both guides and cookbooks. Use guides for step-by-step instructions and cookbooks for creating agents for the CLI.
</Tip>
### Updating Existing Documentation
1. Use the Continue agent with prompts like:
- "Update the installation guide with the new npm package"
- "Add a troubleshooting section for connection issues"
2. The agent will maintain consistent formatting automatically
### Adding Code Examples
Use language-specific code blocks:
````mdx
```typescript
// Your TypeScript code here
const example = "Hello, Continue!";
```
````
## 🐛 Testing Your Changes
1. **Local preview**: In the docs directory, run `npm run dev` and check your changes
2. **Link validation**: Ensure all internal and external links work
3. **Format check**: Use the Continue agent to validate Mintlify formatting
4. **Build test**: Run `npm run build` to ensure no build errors
## 📤 Submitting Your Contribution
1. **Create a feature branch**
```bash
git checkout -b docs/your-feature-name
```
2. **Commit your changes**
```bash
git add .
git commit -m "docs: describe your changes"
```
3. **Push and create a Pull Request**
```bash
# Push to your fork and create a PR
git push origin docs/your-feature-name
gh pr create --web
```
<Tip>
The `gh pr create` command will automatically:
- Push your branch to your fork
- Create a pull request to the main repository
- Allow you to add a title, description, and reference issues
- Open the PR in your browser if using `--web`
</Tip>
### Linking Your PR to Issues
<Info>
**Important**: When your PR addresses a specific issue, make sure to link it using GitHub keywords.
</Info>
To automatically link your PR to an issue and close it when the PR is merged, use one of these keywords in your PR description:
- `closes #issue_number`
- `fixes #issue_number`
- `resolves #issue_number`
**Example PR description:**
```markdown
Improved the installation guide with clearer steps for Windows users.
Closes #1234
```
This helps us track which issues are being worked on and automatically closes them when your PR is merged.
<Tip>
Learn more about linking PRs to issues in the [GitHub documentation](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests).
</Tip>
## 💡 Tips for Success
- **Use the Continue agent**: It knows our documentation standards and will save you time
- **Preview frequently**: Check your changes in the local dev server
- **Ask questions**: Open an issue or discussion if you need clarification
- **Small PRs are better**: Focus on one topic or fix per PR
- **Update examples**: Ensure code examples reflect the latest API
## 🆘 Getting Help
- **Start a Discussion**: Use [GitHub Discussions](https://github.com/continuedev/continue/discussions) for documentation issues, suggestions, or questions
- **Continue agent questions**: Check the [Continue Mission Control page](https://continue.dev/continuedev/docs-mintlify)
- **GitHub Discussions**: Join the [GitHub Discussions](https://github.com/continuedev/continue/discussions) for community help
- **Existing docs**: Review similar pages for formatting examples
---
Thank you for contributing to Continue! Your efforts help make our documentation better for everyone. To learn more about contibuting to other parts of the project, check out our [main CONTRIBUTING guide](https://github.com/continuedev/continue/blob/main/CONTRIBUTING.md) 🎉

View file

@ -1,104 +0,0 @@
---
title: "Create and Edit Cloud Agents"
description: "Build custom AI workflows for your Cloud Agents with prompts, rules, and tools through the Continue Mission Control interface"
sidebarTitle: "Create & Edit"
---
<Card title="Creating Custom Cloud Agents" icon="wrench">
You can only create and edit AI Agents in the Continue Mission Control web interface. This ensures proper validation, versioning, and team collaboration features.
</Card>
## Creating a Cloud Agent
<Steps>
<Step title="🧭 Navigate to Create Agent">
Navigate to the [New Agent page](https://continue.dev/agents/new).
</Step>
<Step title="🧩 Fill Out the Agent Form">
Configure your Cloud Agent with the following fields:
| Field | What to Enter | Example |
|-------|---------------|---------|
| **Name** | Display name shown in Mission Control | `GitHub PR Agent` |
| **Prompt** | First instruction the agent receives | `Open a GitHub PR to fix the specified issue.` |
| **Tools ([MCPs](https://continue.dev/hub?type=mcpServers))** | Select built-in or custom MCPs | `GitHub, PostHog, Supabase, etc.` |
| **[Rules](https://continue.dev/hub?type=rules)** | Add any organizational rules | `continuedev/gh-pr-commit-workflow` |
| **[Model](https://continue.dev/hub?type=models)** | Choose a default LLM | `Claude Sonnet 4.5` |
| **Trigger** | Determines when the cloud agent will be invoked | `GitHub, cron, webhook` |
<Info>
**Tip**: Start with a simple prompt and add complexity through rules and tools. The prompt should be a clear, single instruction that defines the AI Agent's primary goal.
</Info>
</Step>
<Step title="💡 Choose Repository & Automation">
In the right panel, you can select the repository where the agent will run, and decide if the agent should automatically kick off on creation.
</Step>
<Step title="✅ Create and Test">
Click **"Create Agent"** to save and publish it.
Your agent is immediately available to run in:
- Mission Control web interface
- TUI mode: `cn --agent your-org/your-agent-name`
- Headless mode: `cn --agent -p your-org/your-agent-name "prompt" --auto`
</Step>
</Steps>
## Editing a Cloud Agent
You can edit any AI Agent you own or that has Organization-level access.
From the **[Agents](https://continue.dev/agents)** page, click your agent's name. Change any of the fields in the edit form, then click **"Save Changes"**.
## Example Agent Configurations
Here are proven agent configurations you can create or use as inspiration:
<CardGroup cols={2}>
<Card title="Security Scanner Cloud Agent" icon="shield" href="https://continue.dev/continuedev/snyk-continuous-ai-agent">
**Snyk Continuous AI Agent** - Comprehensive security scanning with Snyk MCP integration.
Automates dependency analysis, vulnerability scanning, and creates remediation PRs with Cloud Agent powered fix suggestions.
</Card>
<Card title="Performance Monitoring Cloud Agent" icon="gauge" href="https://continue.dev/continuedev/netlify-continuous-ai-agent">
**Netlify Continuous AI Agent** - Performance optimization with A/B testing and monitoring.
Cloud Agent tracks Core Web Vitals, identifies regressions, and provides optimization recommendations.
</Card>
<Card title="Error Monitoring Agent" icon="bug" href="https://continue.dev/continuedev/sentry-continuous-ai-agent">
**Sentry Continuous AI Agent** - Automated error analysis and issue creation.
Monitors production errors, provides root cause analysis, and creates actionable GitHub issues.
</Card>
<Card title="GitHub Management Cloud Agent" icon="github" href="https://continue.dev/continuedev/github-manager-ai-agent">
**GitHub Manager AI Agent** - Comprehensive GitHub workflow automation.
Handles issue triage, PR reviews, and release note generation with natural language prompts.
</Card>
<Card title="Database Management Cloud Agent" icon="database" href=" https://continue.dev/continuedev/supabase-agent">
**Supabase Continuous AI Agent** - Database security and management workflows.
Audits Row Level Security, identifies vulnerabilities, and generates fixes automatically.
</Card>
</CardGroup>
## Troubleshooting
Common issues and solutions:
| Problem | Solution |
|---------|----------|
| **Cloud Agent doesn't complete tasks** | Simplify the prompt, add more specific instructions, verify tool permissions |
| **Tools aren't working** | Check MCP configuration, verify API keys and permissions in Hub settings |
| **Inconsistent behavior** | Add rules to enforce consistent patterns, test with various input scenarios |
| **Performance issues** | Consider model choice, simplify complex multi-step workflows, optimize tool usage |

View file

@ -1,242 +0,0 @@
---
title: "Starting with Cloud Agents"
description: "Quick start guide for running AI Agent workflows in Mission Control"
---
<Card title="🚀 Quick Start with Mission Control" icon="rocket">
Mission Control is your web interface for running and managing Cloud Agents. Get started in minutes with pre-built workflows for security scanning, GitHub management, analytics insights, and more.
</Card>
<Info>
Mission Control is in beta. Please share any feedback with us in [GitHub discussions](https://github.com/continuedev/continue/discussions/8051).
</Info>
Use Mission Control to kick off Cloud Agents for:
- **Bug fixes & code quality** - Address nitpicks and technical debt
- **Feature development** - Build boilerplate-heavy features
- **Security & compliance** - [Automated vulnerability scanning](../mission-control/integrations/snyk)
- **Investigation & analysis** - Research issues to kickstart your work
- **Custom workflows** - Run repeatable tasks with your own rules and prompts
## Quick Start
<Tip>
If you haven't already, create an account and connect your GitHub repositories in [Mission Control](https://continue.dev/).
</Tip>
<Steps>
<Step title="Navigate to Your Agents Page">
Go to [Mission Control Agents page](https://continue.dev/agents) and select an existing workflow with a pre-configured Cloud Agent.
</Step>
<Step title="Run Your First Cloud Agent">
Your agents page lists all available Cloud Agents. Click on the agent and then **Test Run** to start it.
</Step>
</Steps>
<Info>
**New to agents?** Check out our [pre-configured agents](/mission-control/beyond-checks) to test out a workflow immediately.
</Info>
## Try a Cloud Agent First: Your 60-Second Challenge
Before creating your own agent, let's see one in action! The fastest way to experience the power of Continue agents is with our demo repository.
### See an Agent Create a Pull Request in Under 60 Seconds
<Steps>
<Step title="🍴 Fork Our Demo Repository">
Get a safe sandbox to experiment with:
**Option 1: GitHub Web Interface**
Visit [github.com/continuedev/demo-project](https://github.com/continuedev/demo-project) and click **Fork**
**Option 2: GitHub CLI**
```bash
gh repo fork continuedev/demo-project
```
</Step>
<Step title="🎯 Access Mission Control">
Go to [Mission Control](https://continue.dev/) and:
- **Connect GitHub** and authorize Continue when prompted
- This gives agents access to create PRs in your repositories
</Step>
<Step title="🚀 Run Your First Agent">
**Target your forked demo repo** and try one of these commands as a [task](../mission-control/tasks):
<Tabs>
<Tab title="Add New Feature">
```
Create a new function that calculates fibonacci numbers.
```
</Tab>
<Tab title="Fix Existing Bug">
```
Fix the TypeError in api/users.ts
```
</Tab>
<Tab title="Add Documentation">
```
Add comprehensive README documentation with setup instructions.
```
</Tab>
</Tabs>
</Step>
<Step title="✨ Watch the Magic">
**Result:** A fully-formed Pull Request opens in your demo repo with:
- Complete implementation or fix
- Proper commit messages
- Detailed PR description
- Ready for review and merge
</Step>
</Steps>
<Info>
**Why Use the Demo Repo?**
- **Safe testing environment** - No risk to your production code
- **Pre-configured issues** - Common bugs and features to practice with
- **Immediate results** - See agents in action without setup complexity
- **Learn by example** - Study the generated code and PR descriptions
</Info>
<Tip>
Once you see how agents work with the demo repo, you'll understand exactly how to create and customize your own for real projects!
</Tip>
## Example Workflow Tasks
Here are some example tasks you can try with your Cloud Agents:
<AccordionGroup>
<Accordion title="Bug Fixes & Code Quality">
- "Fix the TypeError in api/users.ts where the user object might be undefined"
- "Add null checks to all database query results in the services/ directory"
- "Fix all ESLint warnings in the components folder and open a PR"
- "Update deprecated React lifecycle methods to hooks in legacy components"
</Accordion>
<Accordion title="Feature Development">
- "Create a new REST endpoint for user profile updates with validation and error handling"
- "Add pagination to the products list page with previous/next buttons"
- "Implement dark mode toggle using Tailwind CSS classes across all pages"
- "Add unit tests for the authentication service using Jest"
</Accordion>
<Accordion title="Security & Compliance">
- "Run a complete security scan and create GitHub issues for critical vulnerabilities"
- "Scan the codebase for hardcoded API keys and move them to environment variables"
- "Add input sanitization to all user-facing form fields"
- "Update npm packages with security vulnerabilities and test compatibility"
</Accordion>
<Accordion title="Documentation & Boilerplate">
- "Add JSDoc comments to all exported functions in the utils/ directory"
- "Create a README.md for the new payment-processing module with setup instructions"
- "Generate TypeScript interfaces for all API response schemas"
- "Add error handling boilerplate to all async functions missing try-catch blocks"
</Accordion>
<Accordion title="Investigation & Analysis">
- "Investigate why the login API is returning 500 errors intermittently and suggest fixes"
- "Analyze the performance bottleneck in the data processing pipeline"
- "Review the database schema for the orders table and suggest optimizations"
- "Find all TODO comments related to authentication and create a summary"
</Accordion>
<Accordion title="Refactoring">
- "Extract the repeated validation logic in controllers into a shared utility function"
- "Convert all class components in src/legacy to functional components with hooks"
- "Rename all instances of 'userId' to 'accountId' across the codebase"
- "Split the 500-line UserService.ts into smaller, single-responsibility services"
</Accordion>
</AccordionGroup>
## Ways to Run Cloud Agents
Choose the method that fits your workflow:
<Tabs>
<Tab title="🌐 Mission Control">
**Web interface for interactive use**
Perfect for:
- Exploring AI agent capabilities
- Reviewing outputs before action
- Monitoring ongoing workflows
- Team collaboration
- One-time tasks
Access at [continue.dev/agents](https://continue.dev/agents)
</Tab>
<Tab title="💻 CLI (TUI Mode)">
**Terminal interface for development**
```bash
cn --agent continuedev/github-project-manager-agent
```
Perfect for:
- Local development workflows
- Testing agent behavior
- Interactive debugging
- Quick iterations
</Tab>
<Tab title="🤖 Headless Mode">
**Automated execution for CI/CD**
```bash
cn --agent continuedev/snyk-continuous-ai-agent -p "Run security scan" --auto
```
Perfect for:
- Scheduled workflows
- CI/CD integration
- Webhook triggers
- Background processing
</Tab>
</Tabs>
## Best Practices for Cloud Agent Success
The practice of using Cloud Agents (Continuous AI) requires thoughtful setup of guardrails and habits:
<CardGroup cols={2}>
<Card title="Start Small" icon="seedling">
Begin with tasks you're confident Continue can handle, like fixing known bugs with simple solutions.
</Card>
<Card title="Practice Locally" icon="terminal">
Test with [Continue CLI](../guides/cli) in TUI mode before deploying automation.
</Card>
<Card title="Be Thorough" icon="clipboard-list">
Agents can run for extended periods - invest time in detailed prompts with all important context.
</Card>
<Card title="Team Alignment" icon="users">
Discuss agent usage and adjust code review habits for higher PR volumes.
</Card>
</CardGroup>
<Info>
**Learn More**: Explore advanced patterns and case studies on the [Continuous AI Blog](https://blog.continue.dev).
</Info>

View file

@ -1,104 +0,0 @@
---
title: "Agents"
---
Agents use the same markdown file format as checks. The difference: agents can be triggered by events beyond PR open — cron schedules, GitHub issues, Sentry alerts, Slack messages, webhooks. Triggers are configured in Mission Control.
## Local agents vs. cloud agents
There are two ways to define agents:
- **Local**: Place agent files in `.continue/agents/` in your repository. Version-controlled and shared with your team.
- **Cloud**: Created and managed on [continue.dev/agents](https://continue.dev/agents). Web UI for configuration, no file to commit.
Both run on Continue's cloud infrastructure.
## Triggers
Triggers determine when an agent runs. They are configured in [Mission Control](/mission-control/beyond-checks).
Supported trigger types:
| Trigger | Description |
|---|---|
| **Cron** | Run on a schedule (daily, weekly, hourly, custom) |
| **Webhook** | Run when an external system sends a request |
| **GitHub event** | Run when specific GitHub events occur (PR opened, issue created, label added, etc.) |
<Note>
Version-controlled trigger configuration (defined in the agent file itself) is on the roadmap. Today, all triggers are managed through Mission Control.
</Note>
## Running agents
<Tabs>
<Tab title="Mission Control">
Trigger agents from the web interface at [continue.dev](https://continue.dev) and review results in real-time.
</Tab>
<Tab title="CLI interactive">
```bash
cn --agent my-org/my-agent
```
Opens an interactive chat session with the agent.
</Tab>
<Tab title="CLI headless">
```bash
cn -p --agent my-org/my-agent "Run weekly security scan"
```
Runs the agent non-interactively. Useful for CI/CD pipelines and scheduled automation.
</Tab>
</Tabs>
## Checks vs. agents
| | Checks | Agents |
|---|---|---|
| File location | `.continue/checks/` | `.continue/agents/` or continue.dev |
| Trigger | Always on PR open | Configurable in [Mission Control](/mission-control/beyond-checks) |
| Purpose | Pass/fail review of PRs | Any automated task |
## Cloud agent gallery
Pre-configured agents you can use immediately:
<CardGroup cols={2}>
<Card title="Security Scanning" icon="shield-check" href="https://continue.dev/continuedev/snyk-continuous-ai-agent">
`continuedev/snyk-continuous-ai-agent`
Monitors vulnerabilities and automatically opens PRs with fixes.
</Card>
<Card title="GitHub Management" icon="github" href="https://continue.dev/continuedev/github-project-manager-agent">
`continuedev/github-project-manager-agent`
Triages issues and manages project workflows.
</Card>
<Card title="Analytics Insights" icon="chart-bar" href="https://continue.dev/continuedev/posthog-continuous-ai-agent">
`continuedev/posthog-continuous-ai-agent`
Analyzes user data and creates actionable tasks.
</Card>
<Card title="Performance Optimization" icon="gauge-high" href="https://continue.dev/continuedev/netlify-continuous-ai-agent">
`continuedev/netlify-continuous-ai-agent`
Monitors Core Web Vitals and optimizes deployments.
</Card>
<Card title="Database Auditing" icon="database" href="https://continue.dev/continuedev/supabase-agent">
`continuedev/supabase-agent`
Audits RLS security and generates migrations.
</Card>
<Card title="Data Pipelines" icon="arrows-rotate" href="https://continue.dev/continuedev/dlt-agent">
`continuedev/dlt-agent`
Inspects pipelines and debugs load errors.
</Card>
</CardGroup>

View file

@ -1,188 +0,0 @@
---
title: "Best Practices"
---
These principles apply whether you're writing a check yourself or reviewing one your coding agent generated. A well-structured check tells the agent exactly what to look for and how to fix it; a vague one produces noise.
## Scope narrowly
Write one check per concern. A single check that tries to cover security, test coverage, and documentation will produce muddled results. Split it into three checks instead.
```markdown .continue/checks/input-validation.md
---
name: Input Validation
description: Verify new API endpoints validate their inputs
---
Look for new API endpoints that accept user input without validation
(missing type checks, no schema validation, no length limits).
If found, add appropriate input validation.
```
A "review everything" check will spread itself thin and miss things. A focused check does one job well.
## Be specific about what to look for
The prompt must describe exactly what the agent should look for and what it should do about it. Vague instructions produce vague results.
**Good:**
```
Look for new API endpoints that don't validate their inputs. Add schema validation using zod where missing.
```
**Bad:**
```
Check that the code is secure.
```
Structure criteria as a concrete list:
```markdown
Look for these issues and fix them:
- New REST endpoints missing request body validation
- Database queries using string interpolation instead of parameterized queries
- Error responses that expose stack traces or internal paths
```
The more specific you are about what to look for, the more reliable the check.
## What you don't need to write
When a check runs, the system automatically prepends a meta prompt that handles diff scoping for you. Specifically, it:
- Provides the full diff and a list of changed files
- Instructs the agent to only review changed lines
- Prevents the agent from touching pre-existing issues in unchanged code
- Restricts edits to changed files only
You **don't** need to include instructions like "review the changed files" or "only look at the diff" — that's already handled. Focus your check on **what to look for and how to fix it**, not on scoping or diff mechanics.
## What checks can do
Checks are not limited to reading the diff. The agent running a check can:
- **Read files** in the repository beyond the diff, to understand surrounding context
- **Run bash commands** like `grep`, `find`, or custom scripts
- **Use a browser** to visit URLs, take screenshots, and verify rendered output
- **Access the PR diff** including file names, additions, and deletions
- **Use the GitHub CLI** (`gh`) to read PR metadata, comments, or linked issues
This means a check can do things like verify a new page renders correctly in a browser, or cross-reference the diff against your database schema.
## Checks vs. tests vs. linting
**Linting** handles formatting, style, and static patterns. Use ESLint, Prettier, Ruff, or equivalent. If a rule can be expressed as a pattern match on syntax, it belongs in a linter.
**Tests** verify correctness, behavior, and regressions. Use your test framework. If the question is "does this function return the right output for these inputs," write a test.
**Checks** handle judgment calls that require understanding context:
- "Is this database migration safe to run on a 500M-row table?"
- "Does this PR update the API docs to reflect the endpoint changes it makes?"
- "Are there security issues in this auth flow that a linter wouldn't catch?"
- "Does this error handling follow the patterns established elsewhere in the codebase?"
Checks fill the gap between mechanical linting and human review. They are most valuable for questions that require reading multiple files, understanding intent, or applying project-specific conventions that aren't codified in a linter rule.
---
## Examples
Complete check files you can drop into `.continue/checks/` directly. These are generic starting points — checks [generated by your coding agent](/checks/generating-checks) will be more specific to your project.
### Security review
````markdown security-review.md
---
name: Security Review
description: Catch hardcoded secrets, injection vectors, and missing input validation
---
Look for these security issues and fix them:
- Hardcoded API keys, tokens, passwords, or connection strings — move them to environment variables
- New API endpoints or request handlers without input validation — add appropriate validation
- SQL queries built with string concatenation or template literals — convert to parameterized queries
- Sensitive data (passwords, tokens, PII) written to logs or stdout — remove or redact the sensitive fields
- New cryptographic code using weak algorithms (MD5, SHA1 for security purposes, ECB mode) — replace with stronger alternatives
- Secrets added to files that are not in `.gitignore` — remove them and add the files to `.gitignore`
````
### Test coverage
````markdown test-coverage.md
---
name: Test Coverage
description: Ensure new code has corresponding tests
---
Look for new code that's missing tests:
- A new source file was added without a corresponding test file (e.g., `utils.ts` added but no `utils.test.ts`) — create a test file with basic coverage for the exported functions
- New exported functions or public methods with no tests exercising them — add tests covering the main code paths
- An existing test file was deleted without the corresponding source file also being deleted — flag this for review
No changes needed if:
- All new source files have corresponding test files
- New functions/methods are already covered by tests
- Only test files, docs, or config files were changed
````
### Documentation freshness
````markdown docs-freshness.md
---
name: Documentation Freshness
description: Keep docs in sync when public APIs or configuration changes
---
Look for changes to public-facing APIs or configuration where the documentation wasn't updated:
- A public function, class, or type signature was added or changed — update the corresponding docs (README, docs/, or inline JSDoc/docstrings)
- Configuration options were added or renamed (config files, environment variables, CLI flags) — update the relevant documentation to reflect the new options
- API route paths or request/response shapes changed — update the API documentation
No changes needed if the PR doesn't touch public APIs or configuration, or if docs were already updated.
````
### Dependency audit
````markdown dependency-audit.md
---
name: Dependency Audit
description: Review new or updated dependencies for risk
---
If no dependency files (`package.json`, `requirements.txt`, `pyproject.toml`, `go.mod`, `Cargo.toml`, `Gemfile`, or similar) were changed, no action is needed.
When dependencies were added or updated, look for these issues:
- A new dependency that appears unmaintained (no commits in the last 12 months) — flag for review and suggest well-maintained alternatives
- A dependency was bumped by more than one major version (e.g., v2.x to v4.x) without a note in the PR description — add a comment explaining the jump
- A known deprecated or security-flagged package was added — replace with the recommended alternative
- A dependency that duplicates functionality from an existing dependency — remove and use the existing one instead
- Dev dependencies in production dependency sections (e.g., a test framework in `dependencies` instead of `devDependencies`) — move to the correct section
````
### Migration safety
````markdown migration-safety.md
---
name: Migration Safety
description: Catch destructive database migrations
---
If no migration files were added or changed, no action is needed.
When migrations are present, look for these issues:
- `DROP TABLE` or `DROP COLUMN` without a preceding migration that backs up or migrates the data — add a data migration step or split into separate migrations
- Column type narrowing (e.g., `TEXT` to `VARCHAR(50)`, `BIGINT` to `INT`) without a backfill step — add a backfill or guard against data truncation
- `NOT NULL` constraint added to an existing column without a `DEFAULT` value — add a default or a data backfill migration
- Renaming a column or table that is referenced by application code without updating that code in the same PR — update the references
- A destructive and a constructive change in the same migration file — split into separate migrations for safe rollback
````

View file

@ -1,70 +0,0 @@
---
title: "Generating Checks"
---
The best way to create checks is to have your coding agent write them. Install the [`writing-checks`](https://github.com/continuedev/skills?tab=readme-ov-file#writing-checks) skill to teach your agent the check file format and best practices:
```bash
npx skills add continuedev/skills --skill writing-checks
```
Then describe what you want to enforce and the agent writes the check file, tailored to your actual frameworks, file structure, and conventions. Here are some prompts to try:
## Security
Catch vulnerabilities specific to your stack — auth gaps, injection vectors, leaked secrets.
```
Look at our codebase and write checks for the most likely security issues — think auth bypasses, injection vectors, secrets in source, and missing input validation. Tailor the checks to the frameworks and patterns we actually use.
```
## Code review patterns
Turn recurring PR feedback into automated checks so reviewers don't have to repeat themselves.
```
Look through our recent PR review comments and identify things reviewers say repeatedly. Write checks that automate those recurring review comments.
```
## QA and browser testing
Verify that UI changes render correctly and don't break links or layouts.
```
Write a check that uses a browser to verify any new or changed pages render without errors and match our design system
```
## Best practices
Enforce the conventions your team already follows — error handling, naming, migration safety.
```
Analyze our codebase and write checks for the patterns that matter most — error handling conventions, logging standards, naming conventions, or whatever you see us being inconsistent about
```
## Test coverage
Make sure new code ships with tests that match your project's existing patterns.
```
Write a check that verifies new code has corresponding tests, following the test file naming and structure conventions already in our project
```
## Documentation
Flag PRs where public APIs or config changed but the docs didn't.
```
Write a check that flags PRs where public API or configuration changes aren't reflected in documentation
```
## Iterate locally
Write the check (or have your agent write it), run it against a real PR branch, read the output, refine:
```bash
check scan migration-safety # audit the full codebase
check # run against your current diff
```
See [Run Checks Locally](/checks/running-locally) for the full local testing workflow.

View file

@ -1,44 +0,0 @@
---
title: "Improving Your Checks"
---
Checks improve over time as you review results and provide feedback. There are two main levers: metrics to identify which checks need work, and rejection feedback to tune behavior.
## Use metrics to find noisy checks
The [Metrics](/mission-control/metrics) page shows acceptance and rejection rates per check across your repositories. A high rejection rate tells you a check is producing unhelpful suggestions and needs refinement.
![Shared Metrics dashboard showing acceptance rates, agent activity, and check outcomes](/images/checks-metrics-dashboard.png)
Start there to identify which checks to focus on before diving into feedback or prompt edits.
## Provide feedback when rejecting
When you reject a check result on the PR review page, a dialog appears where you can explain why the suggestion was wrong. This feedback is saved and included in the check's system prompt on future runs, so the check learns from your corrections.
To leave feedback:
1. Click **Reject** on a check result.
2. Write feedback explaining why the suggestion was unhelpful.
3. Click **Refine** to have AI polish your raw feedback into concise instructions.
4. Submit the rejection.
Good feedback is specific and actionable:
| Good feedback | Bad feedback |
| --- | --- |
| "Don't flag `console.log` in test files" | "Be better" |
| "Ignore TODO comments in draft PRs" | "Too many false positives" |
| "Only flag missing error handling in public API endpoints, not internal helpers" | "Wrong" |
The more precise your feedback, the faster the check improves.
## Adjust sensitivity
The rejection dialog also lets you set a sensitivity level for the check:
- **Conservative** — only flag critical issues (high confidence required)
- **Balanced** — default behavior
- **Thorough** — flag all potential improvements, even when not fully certain
If a check is producing too many low-value suggestions, try lowering the sensitivity to **Conservative**. If it's missing real issues, raise it to **Thorough**.

View file

@ -1,50 +0,0 @@
---
title: "Write Your First Check"
---
## Generating checks (recommended)
Paste this into Claude Code or any coding agent:
```
Help me write checks for this codebase: https://continue.dev/walkthrough
```
The walkthrough reads your codebase, helps you write your first checks, connects you to Continue, and gets them running on your next PR. It takes a few minutes.
If you'd rather set things up manually, keep reading.
## Writing checks manually
A check file has two parts: **frontmatter** (YAML between `---` delimiters) with a required `name` and `description`, and a **body** prompt that tells the AI what to look for. Create a `.md` file in `.continue/checks/`:
```markdown .continue/checks/security-review.md
---
name: Security Review
description: Flag hardcoded secrets and missing input validation
---
Review this pull request for security issues.
Flag as failing if any of these are true:
- Hardcoded API keys, tokens, or passwords in source files
- New API endpoints without input validation
- SQL queries built with string concatenation
- Sensitive data logged to stdout
If none of these issues are found, pass the check.
```
Write concrete pass/fail criteria so the check produces consistent results. See the [reference](/checks/reference) for all available fields.
## Next steps
<CardGroup cols={2}>
<Card title="Run Locally" icon="terminal" href="/checks/running-locally">
Verify your checks before pushing with the `check` CLI.
</Card>
<Card title="Run Checks in CI" icon="github" href="/checks/running-in-ci">
Set up GitHub integration so checks run on every pull request.
</Card>
</CardGroup>

View file

@ -1,71 +0,0 @@
---
title: "Check File Reference"
---
A check is a markdown file with YAML frontmatter and a markdown body. The frontmatter configures metadata and tooling. The body is the prompt the agent follows when reviewing a pull request.
## File format
```markdown
---
name: Migration Safety
description: Flag destructive database migrations
---
Your prompt here. This is the system prompt the agent uses
when evaluating the pull request.
```
Check files live in `.continue/checks/` or `.agents/checks/` at the repository root.
## Frontmatter fields
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `name` | Yes | string | Display name shown in GitHub status checks and on continue.dev |
| `description` | Yes | string | Short description of what the check verifies |
| `model` | No | string | Model to use. Defaults to Claude Sonnet. Example: `anthropic/claude-sonnet-4-5-20250514` |
## Body
The markdown body after the frontmatter is the agent's system prompt. It runs in the context of the PR being reviewed. The agent reads the prompt, examines the pull request diff, and produces a pass or fail verdict with reasoning.
Write concrete pass/fail criteria. See [Best Practices](/checks/best-practices) for guidance on prompt structure.
## Complete example
A fully-specced check file using all available fields:
```markdown .continue/checks/migration-safety.md
---
name: Migration Safety
description: Flag destructive database migrations
model: anthropic/claude-sonnet-4-5-20250514
---
Review database migration files in this pull request.
Flag as failing if any migration contains:
- DROP TABLE or DROP COLUMN without a corresponding backfill migration
- Data type changes that narrow the column (e.g., VARCHAR(255) → VARCHAR(100))
- Removing NOT NULL constraints without a default value
Pass if the migration is additive only (new tables, new columns, new indexes).
```
## File discovery
Continue locates checks by scanning specific directories at the repository root:
- Reads all `.md` files in `.continue/checks/`
- Reads all `.md` files in `.agents/checks/`
- Subdirectories are not scanned
- Files without valid `name` and `description` frontmatter are skipped
Checks always run when a PR is opened. For event-triggered automation, use [agents](/mission-control/beyond-checks#agents).
## Supported directory paths
`.continue/checks/` and `.agents/checks/` are equivalent. Both are scanned and merged into a single list of checks.
`.agents/` is an emerging cross-tool standard for AI agent configuration. `.continue/` is Continue-specific. Use whichever fits your project. If both directories contain a check with the same `name`, the `.continue/checks/` version takes precedence.

View file

@ -1,47 +0,0 @@
---
title: "Run Checks in CI"
---
Continue watches your repository for pull requests, runs each check defined in `.continue/checks/`, and reports results as GitHub status checks. A green check means the code passed; a red check means the code failed, with a suggested fix.
## Prerequisites
- A [Continue](https://continue.dev) account
- A GitHub repository with at least one check file in `.continue/checks/` (see [Write Your First Check](/checks/quickstart))
## Connect GitHub
1. Go to [continue.dev](https://continue.dev/) and sign in (or create an account).
2. Navigate to the [GitHub integration page](https://continue.dev/integrations/github).
3. Click **Connect GitHub** and authorize Continue.
4. Select the repositories you want Continue to monitor.
Once connected, Continue will start running checks on new pull requests in the selected repositories.
## How checks are discovered
Continue reads the `.continue/checks/` directory from your repository's default branch. Every `.md` file in that directory becomes a check that runs on every PR. No additional configuration is needed — commit a check file and it is active.
## The PR workflow
When a pull request is opened, reopened, or updated:
1. Each check file runs independently against the PR diff.
2. Results appear as GitHub status checks on the PR.
3. If a check passes, it shows a green checkmark.
4. If a check fails, it shows a red X with a suggested diff.
5. Click the check details link in GitHub to see the full reasoning on continue.dev.
![GitHub PR showing Continue checks with pass and fail status](/images/checks-pr-status.png)
## Accept or reject suggestions
When a check fails and suggests changes:
1. Click the check's **Details** link on the PR in GitHub. This opens the result on continue.dev.
2. Review the suggested diff.
3. **Accept** to apply the changes as a commit to the PR branch.
4. **Reject** to dismiss the suggestion. The check will re-run on the next push.
![Continue check review page showing suggested diff with accept and reject options](/images/checks-accept-reject.png)

View file

@ -1,45 +0,0 @@
---
title: "Run Checks Locally"
---
Run your checks locally before pushing to CI using the `/check` command in your coding agent (Claude Code, Cursor, or any agent that supports skills).
## Install
Install the [`check`](https://github.com/continuedev/skills?tab=readme-ov-file#check) skill:
```bash
npx skills add continuedev/skills --skill check
```
If you don't have any checks yet, see [Write Your First Check](/checks/quickstart).
## Run checks
Type `/check` in your coding agent. It discovers every check file in `.continue/checks/`, runs each one as a sub-agent against your current branch, and reports the results.
```
/check
```
## Iterate on a check
The local feedback loop is: edit the check file, run `/check`, read the output, refine. Because checks run inside your coding agent, you can ask it to fix issues in the same session:
```
The migration safety check is flagging additive-only migrations as failures. Update the check to only flag destructive operations.
```
## Run checks automatically
Add `/check` to your `AGENTS.md` so your coding agent runs checks as part of its workflow:
```markdown AGENTS.md
After creating or updating a pull request, run /check and fix any failures before requesting review.
```
## Why local?
Running checks locally uses your existing coding agent and credits (Claude Max, API key, etc.). There's nothing extra to install or configure — if your agent can read your repo, it can run your checks.
To run checks automatically on every PR in CI, see [Run Checks in CI](/checks/running-in-ci).

View file

@ -4,20 +4,16 @@ title: "Configuration"
`cn` resolves its configuration (models, MCP servers, rules, etc.) from several sources, in this order:
1. **`--config` flag** — a file path or hub assistant slug passed at launch
1. **`--config` flag** — a file path passed at launch
2. **Saved config** — the last-used configuration, persisted across sessions
3. **Default** — your first assistant from [Continue](https://continue.dev), or `~/.continue/config.yaml` if you're not logged in
3. **Default** — `~/.continue/config.yaml`
## `--config` flag
Point `cn` at a local YAML file or a hub assistant:
Point `cn` at a local YAML file:
```bash
# Local file
cn --config ./my-config.yaml
# Hub assistant
cn --config my-org/my-assistant
```
This overrides any saved preference for the current session.
@ -30,47 +26,30 @@ Use `/config` inside a TUI session to switch between available configurations:
> /config
```
This shows your available assistants and local configs. The selection is saved for next time.
This shows your available local configs. The selection is saved for next time.
## `config.yaml`
If you're not logged in to Continue, `cn` looks for `~/.continue/config.yaml`. This file uses the same format as the IDE extensions — see [config.yaml reference](/customize/deep-dives/configuration) for the full schema.
`cn` looks for `~/.continue/config.yaml`. This file uses the same format as the IDE extensions — see [config.yaml reference](/customize/deep-dives/configuration) for the full schema.
## CLI-specific flags
Several flags inject configuration at launch without editing a file:
```bash
# Add models from the hub
cn --model my-org/claude-sonnet
# Add MCP servers from the hub
cn --mcp my-org/github-mcp
# Add rules (file path, hub slug, or inline string)
# Add rules (file path or inline string)
cn --rule ./rules/style.md
cn --rule my-org/code-review-rules
cn --rule "Always use TypeScript strict mode"
# Load an agent file from the hub
# Load an agent file
cn --agent my-org/pr-reviewer
```
All of these are repeatable — pass them multiple times to add multiple items.
## Organization
If you belong to multiple organizations on Continue, use `--org` to specify which one:
```bash
cn --org my-team -p "Review this PR"
```
In TUI mode, `/config` lets you switch organizations interactively.
## Secrets
Store sensitive values (API keys, tokens) in [Continue → Settings → Secrets](https://continue.dev/settings/secrets). Reference them in config with:
Store sensitive values (API keys, tokens) as environment variables. Reference them in config with:
```yaml
${{ secrets.MY_API_KEY }}

View file

@ -48,17 +48,6 @@ cn -p "Set up the project" --allow "*"
See [tool permissions](/cli/tool-permissions) for the full policy system.
## Authentication in CI
Set `CONTINUE_API_KEY` instead of running `cn login`:
```bash
export CONTINUE_API_KEY=your-key-here
cn -p "Review the PR for security issues"
```
Get an API key from [Continue → Settings → API Keys](https://continue.dev/settings/api-keys). Store it as a secret in your CI provider.
## Resume in headless mode
Resume a previous session without interactive input:

View file

@ -56,8 +56,6 @@ export CONTINUE_API_KEY=your-key-here
cn -p "your prompt"
```
Get an API key from [Continue → Settings → API Keys](https://continue.dev/settings/api-keys).
### Local API key
If you don't want to use Continue, you can use an Anthropic API key directly. On first launch, `cn` will prompt you to choose between logging in with Continue or entering an Anthropic API key.

View file

@ -30,3 +30,37 @@ h6[id] {
background-color: transparent;
}
}
/* Fix: Cmd+K search modal dark mode - popover/background CSS vars unset */
.dark [role="dialog"].bg-background {
background-color: #1a1a1a;
border-color: #333;
}
.dark .bg-popover {
background-color: #1a1a1a;
}
.dark .text-popover-foreground {
color: #e5e5e5;
}
.dark [cmdk-item] {
color: #e5e5e5;
}
.dark [cmdk-item][data-selected="true"] {
background-color: #333;
}
.dark [cmdk-input] {
color: #e5e5e5;
}
.dark [cmdk-separator] {
background-color: #333;
}
.dark [cmdk-group-heading] {
color: #999;
}

View file

@ -16,9 +16,6 @@ import { ModelRecommendations } from "/snippets/ModelRecommendations.jsx";
If you want to have the best autocomplete experience, we recommend using Codestral, which is available through the [Mistral API](https://console.mistral.ai/). To do this, obtain an API key and add it to your config:
<Tabs>
<Tab title="Hub">
[Mistral Codestral model block](https://continue.dev/mistral/codestral)
</Tab>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
@ -39,7 +36,7 @@ If you want to have the best autocomplete experience, we recommend using Codestr
{
"tabAutocompleteModel": {
"title": "Codestral",
"provider": "mistral",
"provider": "mistral",
"model": "codestral-latest",
"apiKey": "<YOUR_CODESTRAL_API_KEY>"
}
@ -67,9 +64,6 @@ ollama run qwen2.5-coder:1.5b
Then, add the model to your configuration:
<Tabs>
<Tab title="Hub">
[Ollama Qwen 2.5 Coder 1.5B model block](https://continue.dev/ollama/qwen2.5-coder-1.5b)
</Tab>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
@ -89,7 +83,7 @@ Then, add the model to your configuration:
{
"tabAutocompleteModel": {
"title": "Qwen 1.5b Autocomplete Model",
"provider": "ollama",
"provider": "ollama",
"model": "qwen2.5-coder:1.5b",
}
}
@ -134,10 +128,6 @@ Then, in the continue panel, select this model as the default model for autocomp
## Autocomplete Configuration Options in Continue
### Autocomplete Models Available on the Continue Mission Control
Explore autocomplete model configurations on [the hub](https://continue.dev/explore/models?roles=autocomplete)
### Customize Autocomplete User Settings in the Continue Extension
{/* - `Use autocomplete cache`: If on, caches completions */}
@ -189,7 +179,7 @@ Follow these steps to ensure that everything is set up correctly:
4. Make sure that any other completion providers are disabled (e.g. Copilot), as they may interfere.
5. Check the output of the logs to find any potential errors: <kbd>cmd/ctrl</kbd> + <kbd>shift</kbd> + <kbd>P</kbd> -> "Toggle Developer Tools" -> "Console" tab in VS Code, ~/.continue/logs/core.log in JetBrains.
6. Check VS Code settings to make sure that `"editor.inlineSuggest.enabled"` is set to `true` (use <kbd>cmd/ctrl</kbd> + <kbd>,</kbd> then search for this and check the box)
7. If you are still having issues, please let us know in our [GitHub Discussions](https://github.com/continuedev/continue/discussions) and we'll help as soon as possible.
7. If you are still having issues, please file an issue on [GitHub](https://github.com/continuedev/continue/issues).
### Why Are My Completions Only Single-Line?
@ -232,4 +222,4 @@ Open Settings -> Tools -> Continue and uncheck the box for "Enable Tab Autocompl
#### Feedback
If you're turning off autocomplete, we'd love to hear how we can improve! Please let us know in our [GitHub Discussions](https://github.com/continuedev/continue/discussions) or file an issue on GitHub.
If you're turning off autocomplete, we'd love to hear how we can improve! Please file an issue on [GitHub](https://github.com/continuedev/continue/issues).

View file

@ -1,18 +1,14 @@
---
title: "How to Configure Continue"
description: Learn how to access and manage Continue configurations through Hub or local YAML files
description: Learn how to access and manage Continue configurations through local YAML files
keywords: [config, settings, customize]
sidebarTitle: "Configuration"
---
You can easily access your configuration from the Continue Chat sidebar. Open the sidebar by pressing <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) or <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains) and click the Agent selector above the main chat input. Then, you can hover over an agent and click the `new window` (hub agents) or `gear` (local agents) icon.
You can easily access your configuration from the Continue Chat sidebar. Open the sidebar by pressing <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) or <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains) and click the Agent selector above the main chat input. Then, you can hover over an agent and click the `gear` icon.
![configure](/images/configure-continue.png)
## How to Manage Hub Configs
Hub Configs can be managed in [the Hub](https://continue.dev). See [Editing a config](/mission-control/configs/edit-a-config)
## How to Configure Local Configs with YAML
Local user-level configuration is stored and can be edited in your home directory in `config.yaml`:

View file

@ -19,9 +19,7 @@ that can be set up with custom tools.
Currently custom tools can be configured using the Model Context
Protocol standard to unify prompts, context, and tool use.
MCP Servers can be added to hub configs using `mcpServers`. You can
explore available MCP servers
[here](https://continue.dev/explore/mcp).
MCP Servers can be added to your config using `mcpServers`.
<Info>MCP can only be used in the **agent** mode.</Info>
@ -71,8 +69,7 @@ For example, place your JSON MCP config file at `.continue/mcpServers/mcp.json`
## How to Configure MCP Servers
To set up your own MCP server, read the [MCP
quickstart](https://modelcontextprotocol.io/quickstart) and then [create an
`mcpServers`](https://continue.dev/new?type=block&blockType=mcpServers) or add a local MCP
quickstart](https://modelcontextprotocol.io/quickstart) and then add an MCP
server block to your [config file](./configuration.md):
```yaml title="config.yaml"
@ -153,8 +150,7 @@ For detailed information about transport mechanisms and their use cases, refer t
### How to Work with Secrets in MCP Servers
With some MCP servers you will need to use API keys or other secrets. You can leverage locally stored environments secrets
as well as access hosted secrets in the Continue Mission Control. To leverage Hub secrets, you can use the `inputs` property in your MCP env block instead of `secrets`.
With some MCP servers you will need to use API keys or other secrets. You can leverage locally stored environment secrets.
```yaml
# ...

View file

@ -70,8 +70,6 @@ prompts:
...
```
If you are using Continue Mission Control, you can add it to your config by selecting "Use Rule" [here](https://continue.dev/supabase/create-functions)
To use this prompt, you can open Chat / Agent / Edit, type <kbd>/</kbd>, select the prompt, and type out any additional instructions you'd like to add.
## Using a prompt with `cn (TUI mode)`

View file

@ -20,42 +20,6 @@ You can view the current rules by clicking the pen icon above the main toolbar:
To form the system message, rules are joined with new lines, in the order they appear in the toolbar. This includes the base chat system message ([see below](#how-to-customize-chat-system-message)).
## Understanding Hub vs Local Rules Integration
<Warning>
**Important:** Rules created in different locations behave differently and have different synchronization patterns.
</Warning>
Continue supports two types of rules with different behaviors:
<Columns cols={2}>
<Card title="Local Rules" icon="folder">
- **Location**: `.continue/rules` folder in your workspace
- **Visibility**: Automatically visible when using Hub configs
- **Creation**: Add rules button in VSCode or manual file creation
- **File Management**: Creates actual `.md` files you can edit directly
</Card>
<Card title="Hub Rules" icon="cloud">
- **Location**: Stored on Continue Mission Control, referenced in config.yaml
- **Visibility**: Only appear when referenced in assistant configuration
- **Creation**: Created directly on Hub or copied from local rules
- **File Management**: No local files created, managed through Hub interface
</Card>
</Columns>
### How Rules Are Applied
When using Continue, rules are loaded in this order:
1. **Hub assistant rules** (if using a Hub-based assistant)
2. **Referenced Hub rules** (via `uses:` in config.yaml)
3. **Local workspace rules** (from `.continue/rules` folder)
4. **Global rules** (from `~/.continue/rules` folder)
<Info>
**TL;DR**: Local rules show up automatically when using Hub configs. Hub rules show up automatically when referenced in your config.
</Info>
## Quick Start: How to Create Your First Rule File
Below is a quick example of setting up a new rule file:
@ -90,43 +54,6 @@ Rules can be added locally using the "Add Rules" button.
For example, you can say "Create a rule for this", and a rule will be created for you in `.continue/rules` based on your conversation.
</Info>
### Creating Hub Rules
Rules can also be created and managed on the Continue Mission Control:
1. **Browse existing rules**: [Explore available rules](https://continue.dev/hub?type=rules)
2. **Create new rules**: [Create your own](https://continue.dev/new?type=block&blockType=rules) in the Hub
3. **Copy from local rules**: Copy/paste content from your `.continue/rules` files to create Hub rules
### Working Between Hub and Local Rules
<Tabs>
<Tab title="Hub to VSCode">
To use Hub rules in your local setup:
1. Reference them in your `config.yaml`:
```yaml
rules:
- uses: username/my-hub-rule
```
2. The rule will automatically appear in your rules toolbar
3. **Note**: No local file is created - the rule exists only on the Hub
</Tab>
<Tab title="VSCode to Hub">
To move local rules to the Hub:
1. Copy the content from your `.continue/rules/rule-name.md` file
2. Go to [Create new rule](https://continue.dev/new?type=block&blockType=rules)
3. Paste the content and configure the rule
4. Optionally, remove the local file and reference the Hub rule in your config
<Warning>
**Current Limitation**: There's no automatic sync from local to Hub. You must manually copy/paste rule content.
</Warning>
</Tab>
</Tabs>
### How to Configure Rule Properties and Syntax
<Info>
@ -222,39 +149,13 @@ globs: ["**/*.ts", "**/*.tsx"]
## Troubleshooting Rules
### Issue: Rules Created in Different Places Don't Sync
**Problem**: You created rules in the Hub but don't see them in VSCode, or vice versa.
**Solution**:
- **Hub rules** only appear when referenced in your config.yaml using the `uses:` syntax
- **Local rules** automatically appear when using Hub configs
- There's currently no automatic bidirectional sync
### Issue: "Edit" Links Point to Wrong Location
**Problem**: When you click "Edit" on a rule in VSCode, it tries to open the Hub even though the rule is local, or shows an incorrect URL.
**Root Cause**: This happens when you have a mix of local and Hub rules, and Continue can't properly determine where each rule originates.
**Workaround**:
1. **For local rules**: Navigate directly to `.continue/rules/` folder and edit the `.md` file
2. **For Hub rules**: Go directly to your assistant page on [Continue Mission Control](https://continue.dev) and edit from there
3. Keep track of which rules are local vs Hub-based to avoid confusion
<Info>
**Known Issue**: This link accuracy problem is tracked in [Linear issue CON-3084](https://linear.app/continue/issue/CON-3084) and will be fixed in a future update.
</Info>
### Issue: Rules Don't Appear in Assistant
**Problem**: Your rules exist but don't show up in the rules toolbar.
**Check These**:
1. **File location**: Ensure local rules are in `.continue/rules/` (not `.continue/rule/`)
1. **File location**: Ensure rules are in `.continue/rules/` (not `.continue/rule/`)
2. **File format**: Rules should be `.md` files with proper YAML frontmatter
3. **Config reference**: Hub rules must be referenced in `config.yaml`
4. **Assistant type**: Ensure you're using the correct assistant (local vs Hub)
### How to Customize Chat System Message

View file

@ -3,10 +3,6 @@ title: "Ask Sage"
slug: ../asksage
---
<Tip>
**Discover Ask Sage models [here](https://continue.dev/hub?q=Ask%20Sage)**
</Tip>
<Info>
You can get an API key from the [Ask Sage](https://www.asksage.ai/).
</Info>

View file

@ -3,10 +3,6 @@ title: DeepSeek
slug: ../deepseek
---
<Tip>
**Discover DeepSeek models [here](https://continue.dev/hub?q=DeepSeek)**
</Tip>
<Info>
You can get an API key from the [DeepSeek Console](https://www.deepseek.com/).
</Info>

View file

@ -4,10 +4,6 @@ slug: ../gemini
sidebarTitle: "Gemini"
---
<Tip>
**Discover Google models [here](https://continue.dev/hub?q=Gemini)**
</Tip>
<Info>
Get an API key from [Google AI Studio](https://aistudio.google.com/)
</Info>
@ -44,6 +40,3 @@ sidebarTitle: "Gemini"
</Tab>
</Tabs>
<Info>
**Check out a more advanced configuration [here](https://continue.dev/google/gemini-2.5-pro?view=config)**
</Info>

View file

@ -8,7 +8,7 @@ The **Tetrate Agent Router Service** provides a unified Gateway for accessing va
This gateway acts as an intelligent router that can distribute requests across multiple model providers, offering enterprise-grade reliability and performance optimization.
<Tip>
Want to get started quickly? Sign up for the [Tetrate Agent Router Service](https://router.tetrate.ai/) to get an API key, then use [Tetrate on Continue Mission Control](https://continue.dev/tetrate) to get started fast.
Want to get started quickly? Sign up for the [Tetrate Agent Router Service](https://router.tetrate.ai/) to get an API key, then follow the configuration examples below.
</Tip>
## Setup
@ -32,44 +32,14 @@ Go to the [API keys page](https://router.tetrate.ai/api-keys) to get your key
</Steps>
### Quickstart with Continue Mission Control
Fastest way: use preconfigured models from Tetrate on Continue Mission Control
<Steps>
<Step title="Browse models">
Open [Tetrate on Continue Mission Control](https://continue.dev/tetrate) and pick a model (e.g., [Claude Sonnet 4](https://continue.dev/tetrate/claude-sonnet-4))
</Step>
<Step title="Use or remix">
Click "Use Model", or "Remix" to change the model ID if needed
</Step>
<Step title="Add your API key">
Add your API key to Continue. See [adding secrets in Continue Mission Control](/mission-control/secrets/secret-types) and [managing local secrets in the FAQ](/faqs#managing-local-secrets-and-environment-variables)
<Tip>
Add it as a Continue Mission Control secret named `TETRATE_API_KEY` to reuse across projects.
</Tip>
</Step>
</Steps>
![Remix a model from Tetrate on Continue Mission Control](../assets/tetrate-remix.png)
<Info>
If a model is missing, remix a similar one and set the `model` field to the target ID.
</Info>
### Configuration Methods
<CardGroup cols={1}>
<Card title="In Local Agent Configuration" icon="folder" vertical>
Use a Tetrate model block from the Hub or define it directly in your local agent configuration.
</Card>
<Card title="Continue Mission Control" icon="cloud" vertical>
Use a Tetrate model block from the Hub or define your own on the Hub.
Define models directly in your local agent configuration.
</Card>
<Card title="Using Local Model Blocks" icon="file-lines" vertical>
Create a local model block for reuse across agents without publishing it to the Hub.
Create a local model block for reuse across agents.
</Card>
</CardGroup>
@ -83,7 +53,7 @@ If a model is missing, remix a similar one and set the `model` field to the targ
**When to use**: Simple local setups (like using the VS Code extension) when you don't need shared or published blocks.
Use a Tetrate model block from the Hub in your local agent configuration:
Use a Tetrate model block in your local agent configuration:
```yaml title="~/.continue/config.yaml"
name: Local Agent
@ -130,49 +100,8 @@ context:
- provider: codebase
```
</Tab>
<Tab title="Continue Mission Control">
**When to use**: Share configurations across teams or contribute to the community.
**The Model Block:**
```yaml title="tetrate/claude-sonnet-4"
name: Claude Sonnet 4
version: 1.0.14
schema: v1
models:
- name: Claude Sonnet 4 - Tetrate
provider: tars
model: claude-4-sonnet-20250514
apiKey: ${{ inputs.TETRATE_API_KEY }}
roles:
- chat
- edit
- apply
capabilities:
- tool_use
```
View the model block `tetrate/claude-sonnet-4` on the [Continue Mission Control](https://continue.dev/tetrate/claude-sonnet-4).
**Reference it in your Agent configuration:**
```yaml title="my-agent"
name: My Agent
version: 1.0.0
schema: v1
models:
- uses: tetrate/claude-sonnet-4
with:
TETRATE_API_KEY: ${{ secrets.TETRATE_API_KEY }}
context:
- uses: continuedev/diff-context
- uses: continuedev/terminal-context
- uses: continuedev/file-context
```
</Tab>
<Tab title="Using Local Model Blocks">
**When to use**: Reuse configurations across agents and keep them local or in GitHub (not on Continue Mission Control).
**When to use**: Reuse configurations across agents and keep them local or in GitHub.
**The Local Model Block:**
<Info>
@ -233,7 +162,7 @@ Learn more about [model blocks](/reference#models).
Check your network or try a less-loaded model. Contact Tetrate support if issues persist.
</Card>
<Card title="Configuration not loading" icon="file-lines" vertical>
Validate YAML syntax and review error messages in Continue. If using Hub, ensure the block is published.
Validate YAML syntax and review error messages in Continue.
</Card>
</CardGroup>

View file

@ -17,11 +17,6 @@ We recommend [Morph Fast Apply](https://morphllm.com) or [Relace's Instant Apply
However, most Chat models can also be used for applying code changes. We recommend smaller/cheaper models for the task, such as Claude 3.5 Haiku.
<Info>
Explore all apply models in [the
Hub](https://continue.dev/explore/models?roles=apply)
</Info>
## Prompt templating
You can customize the prompt template used for applying code changes by setting the `promptTemplates.apply` property in your model configuration. Continue uses [Handlebars syntax](https://handlebarsjs.com/guide/) for templating.

View file

@ -24,9 +24,6 @@ For the best overall Chat experience, you will want to use a 400B+ parameter mod
Our current top recommendations are Claude Opus 4.6 and Claude Sonnet 4 from [Anthropic](../model-providers/top-level/anthropic).
<Tabs>
<Tab title="Hub">
View the [Claude Opus 4.6 model block](https://continue.dev/anthropic/claude-opus-4-6) or [Claude Sonnet 4 model block](https://continue.dev/anthropic/claude-4-sonnet) on the hub.
</Tab>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
@ -47,16 +44,6 @@ Our current top recommendations are Claude Opus 4.6 and Claude Sonnet 4 from [An
If you prefer to use an open-weight model, then the Gemma family of Models from Google DeepMind is a good choice. You will need to decide if you use it through a SaaS model provider, e.g. [Together](../model-providers/more/together), or self-host it, e.g. [Ollama](../model-providers/top-level/ollama).
<Tabs>
<Tab title="Hub">
<Tabs>
<Tab title="Ollama">
Add the [Ollama Gemma 3 27B block](https://continue.dev/ollama/gemma3-27b) from the hub
</Tab>
<Tab title="Together">
Add the [Together Gemma 2 27B Instruct block](https://continue.dev/togetherai/gemma-2-instruct-27b) from the hub
</Tab>
</Tabs>
</Tab>
<Tab title="YAML">
<Tabs>
<Tab title="Ollama">
@ -93,9 +80,6 @@ If you prefer to use an open-weight model, then the Gemma family of Models from
If you prefer to use a model from [OpenAI](../model-providers/top-level/openai), then we recommend GPT-5.1.
<Tabs>
<Tab title="Hub">
Add the [OpenAI GPT-5.1 block](https://continue.dev/openai/gpt-5.1) from the hub
</Tab>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
@ -116,9 +100,6 @@ If you prefer to use a model from [OpenAI](../model-providers/top-level/openai),
If you prefer to use a model from [xAI](../model-providers/more/xAI), then we recommend Grok-4.
<Tabs>
<Tab title="Hub">
Add the [xAI Grok-4.1 block](https://continue.dev/xai/grok-4-1-fast-non-reasoning) from the hub
</Tab>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
@ -139,9 +120,6 @@ If you prefer to use a model from [xAI](../model-providers/more/xAI), then we re
If you prefer to use a model from [Google](../model-providers/top-level/gemini), then we recommend Gemini 3 Pro.
<Tabs>
<Tab title="Hub">
Add the [Gemini 3 Pro block](https://continue.dev/google/gemini-3-pro-preview) from the hub
</Tab>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
@ -166,17 +144,6 @@ For the best local, offline Chat experience, you will want to use a model that i
If your local machine can run an 8B parameter model, then we recommend running Llama 3.1 8B on your machine (e.g. using [Ollama](../model-providers/top-level/ollama) or [LM Studio](../model-providers/top-level/lmstudio)).
<Tabs>
<Tab title="Hub">
<Tabs>
<Tab title="Ollama">
Add the [Ollama Llama 3.1 8b block](https://continue.dev/ollama/llama3.1-8b) from the hub
</Tab>
{/* HUB_TODO nonexistent block */}
{/* <Tab title="LM Studio">
Add the [LM Studio Llama 3.1 8b block](https://continue.dev/explore/models) from the hub
</Tab> */}
</Tabs>
</Tab>
<Tab title="YAML">
<Tabs>
<Tab title="Ollama">
@ -224,17 +191,6 @@ If your local machine can run an 8B parameter model, then we recommend running L
If your local machine can run a 16B parameter model, then we recommend running DeepSeek Coder 2 16B (e.g. using [Ollama](../model-providers/top-level/ollama) or [LM Studio](../model-providers/top-level/lmstudio)).
<Tabs>
{/* HUB_TODO nonexistent blocks */}
{/* <Tab title="Hub">
<Tabs>
<Tab title="Ollama">
Add the [Ollama Deepseek Coder 2 16B block](https://continue.dev/explore/models) from the hub
</Tab>
<Tab title="LM Studio">
Add the [LM Studio Deepseek Coder 2 16B block](https://continue.dev/explore/models) from the hub
</Tab>
</Tabs>
</Tab> */}
<Tab title="YAML">
<Tabs>
<Tab title="Ollama">

View file

@ -32,9 +32,6 @@ If you want to generate embeddings locally, we recommend using `nomic-embed-text
After obtaining an API key from [here](https://www.voyageai.com/), you can configure like this:
<Tabs>
<Tab title="Hub">
[Voyage Code 3 Embedder Block](https://continue.dev/voyageai/voyage-code-3)
</Tab>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
@ -101,10 +98,6 @@ See [here](../model-providers/top-level/ollama) for instructions on how to use O
[Hugging Face Text Embeddings Inference](https://huggingface.co/docs/text-embeddings-inference/en/index) enables you to host your own embeddings endpoint. You can configure embeddings to use your endpoint as follows:
<Tabs>
{/* HUB_TODO nonexistent block */}
{/* <Tab title="Hub">
[HuggingFace Text Embedder Block](https://continue.dev/)
</Tab> */}
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config

View file

@ -22,16 +22,6 @@ If you have the ability to use any model, we recommend `rerank-2` by Voyage AI,
Voyage AI offers the best reranking model for code with their `rerank-2` model. After obtaining an API key from [here](https://www.voyageai.com/), you can configure a reranker as follows:
<Tabs>
<Tab title="Hub">
```yaml title="config.yaml"
name: My Config
version: 0.0.1
schema: v1
models:
- uses: voyageai/rerank-2
```
</Tab>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
@ -54,10 +44,6 @@ Voyage AI offers the best reranking model for code with their `rerank-2` model.
See Cohere's documentation for rerankers [here](https://docs.cohere.com/docs/rerank-2).
<Tabs>
{/* HUB_TODO block doesn't exist */}
{/* <Tab title="Hub">
[Cohere Reranker English v3](https://continue.dev/)
</Tab> */}
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
@ -80,10 +66,6 @@ See Cohere's documentation for rerankers [here](https://docs.cohere.com/docs/rer
If you only have access to a single LLM, then you can use it as a reranker. This is discouraged unless truly necessary, because it will be much more expensive and still less accurate than any of the above models trained specifically for the task. Note that this will not work if you are using a local model, for example with Ollama, because too many parallel requests need to be made.
<Tabs>
{/* HUB_TODO block doesn't exist */}
{/* <Tab title="Hub">
[GPT-4o LLM Reranker Block](https://continue.dev/)
</Tab> */}
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
@ -107,10 +89,6 @@ If you only have access to a single LLM, then you can use it as a reranker. This
[Hugging Face Text Embeddings Inference](https://huggingface.co/docs/text-embeddings-inference/en/index) enables you to host your own [reranker endpoint](https://huggingface.github.io/text-embeddings-inference/#/Text%20Embeddings%20Inference/rerank). You can configure your reranker as follows:
<Tabs>
{/* HUB_TODO */}
{/* <Tab title="Hub">
[HuggingFace TEI Reranker block](https://continue.dev/)
</Tab> */}
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config

Some files were not shown because too many files have changed in this diff Show more