allow loading private packages from local yaml

This commit is contained in:
Nate 2025-03-23 14:18:17 -07:00
parent c946c51b7e
commit 6c5405f778
8 changed files with 39 additions and 15 deletions

View file

@ -41,6 +41,7 @@ import { getSystemPromptDotFile } from "../getSystemPromptDotFile";
import { PlatformConfigMetadata } from "../profile/PlatformProfileLoader";
import { modifyAnyConfigWithSharedConfig } from "../sharedConfig";
import { getControlPlaneEnvSync } from "../../control-plane/env";
import { llmsFromModelConfig } from "./models";
export class LocalPlatformClient implements PlatformClient {
@ -60,6 +61,7 @@ async function loadConfigYaml(
overrideConfigYaml: AssistantUnrolled | undefined,
controlPlaneClient: ControlPlaneClient,
orgScopeId: string | null,
ideSettings: IdeSettings,
): Promise<ConfigResult<AssistantUnrolled>> {
let config =
overrideConfigYaml ??
@ -71,7 +73,13 @@ async function loadConfigYaml(
versionSlug: "",
},
rawYaml,
new RegistryClient(),
new RegistryClient(
await controlPlaneClient.getAccessToken(),
getControlPlaneEnvSync(
ideSettings.continueTestEnvironment,
ideSettings.enableControlServerBeta,
).CONTROL_PLANE_URL,
),
{
currentUserSlug: "",
onPremProxyUrl: null,
@ -414,6 +422,7 @@ export async function loadContinueConfigFromYaml(
overrideConfigYaml,
controlPlaneClient,
orgScopeId,
ideSettings,
);
if (!configYamlResult.config || configYamlResult.configLoadInterrupted) {

View file

@ -13,7 +13,7 @@
"@aws-sdk/client-sagemaker-runtime": "^3.758.0",
"@aws-sdk/credential-providers": "^3.758.0",
"@continuedev/config-types": "^1.0.13",
"@continuedev/config-yaml": "^1.0.63",
"@continuedev/config-yaml": "^1.0.67",
"@continuedev/fetch": "^1.0.4",
"@continuedev/llm-info": "^1.0.2",
"@continuedev/openai-adapters": "^1.0.18",
@ -2973,9 +2973,9 @@
}
},
"node_modules/@continuedev/config-yaml": {
"version": "1.0.63",
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.63.tgz",
"integrity": "sha512-KBfyOUU/mWOXeNf6v+4IfMkbvfEEe/YP6n/g/reJBhrpApchG2A/P11JviH87N2To1SrhZxnW//0g5FIGupDFw==",
"version": "1.0.67",
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.67.tgz",
"integrity": "sha512-RbJXSH2Z9XmaN1h9Dm0Qfru7UeAdCAEWMiEgJ9A2FGHysR9oxbQDqptk1Y61oDSpYeX+lWsxkz/SFIc2PjNnKg==",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"yaml": "^2.6.1",

View file

@ -46,7 +46,7 @@
"@aws-sdk/client-sagemaker-runtime": "^3.758.0",
"@aws-sdk/credential-providers": "^3.758.0",
"@continuedev/config-types": "^1.0.13",
"@continuedev/config-yaml": "^1.0.63",
"@continuedev/config-yaml": "^1.0.67",
"@continuedev/fetch": "^1.0.4",
"@continuedev/llm-info": "^1.0.2",
"@continuedev/openai-adapters": "^1.0.18",

View file

@ -106,7 +106,7 @@
"@aws-sdk/client-sagemaker-runtime": "^3.758.0",
"@aws-sdk/credential-providers": "^3.758.0",
"@continuedev/config-types": "^1.0.13",
"@continuedev/config-yaml": "^1.0.63",
"@continuedev/config-yaml": "^1.0.66",
"@continuedev/fetch": "^1.0.4",
"@continuedev/llm-info": "^1.0.2",
"@continuedev/openai-adapters": "^1.0.18",

10
gui/package-lock.json generated
View file

@ -7,7 +7,7 @@
"name": "gui",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-yaml": "^1.0.63",
"@continuedev/config-yaml": "^1.0.67",
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18",
"@reduxjs/toolkit": "^2.3.0",
@ -109,7 +109,7 @@
"@aws-sdk/client-sagemaker-runtime": "^3.758.0",
"@aws-sdk/credential-providers": "^3.758.0",
"@continuedev/config-types": "^1.0.13",
"@continuedev/config-yaml": "^1.0.63",
"@continuedev/config-yaml": "^1.0.67",
"@continuedev/fetch": "^1.0.4",
"@continuedev/llm-info": "^1.0.2",
"@continuedev/openai-adapters": "^1.0.18",
@ -551,9 +551,9 @@
}
},
"node_modules/@continuedev/config-yaml": {
"version": "1.0.63",
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.63.tgz",
"integrity": "sha512-KBfyOUU/mWOXeNf6v+4IfMkbvfEEe/YP6n/g/reJBhrpApchG2A/P11JviH87N2To1SrhZxnW//0g5FIGupDFw==",
"version": "1.0.67",
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.67.tgz",
"integrity": "sha512-RbJXSH2Z9XmaN1h9Dm0Qfru7UeAdCAEWMiEgJ9A2FGHysR9oxbQDqptk1Y61oDSpYeX+lWsxkz/SFIc2PjNnKg==",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"yaml": "^2.6.1",

View file

@ -15,7 +15,7 @@
"test:watch": "vitest"
},
"dependencies": {
"@continuedev/config-yaml": "^1.0.63",
"@continuedev/config-yaml": "^1.0.67",
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18",
"@reduxjs/toolkit": "^2.3.0",

View file

@ -1,6 +1,6 @@
{
"name": "@continuedev/config-yaml",
"version": "1.0.63",
"version": "1.0.67",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View file

@ -2,9 +2,24 @@ import { Registry } from "./interfaces/index.js";
import { FullSlug } from "./interfaces/slugs.js";
export class RegistryClient implements Registry {
constructor(
private readonly accessToken?: string,
private readonly apiBase: string = "https://api.continue.dev/",
) {
if (!this.apiBase.endsWith("/")) {
this.apiBase += "/";
}
}
async getContent(fullSlug: FullSlug): Promise<string> {
const response = await fetch(
`https://api.continue.dev/registry/v1/${fullSlug.ownerSlug}/${fullSlug.packageSlug}/${fullSlug.versionSlug}`,
`${this.apiBase}registry/v1/${fullSlug.ownerSlug}/${fullSlug.packageSlug}/${fullSlug.versionSlug}`,
{
headers: {
...(this.accessToken
? { Authorization: `Bearer ${this.accessToken}` }
: {}),
},
},
);
const data = await response.json();
return data.content;