From a3f835be0a4ff2a4fe7251db27fc5c4069986bcb Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 11 Mar 2025 20:56:39 -0700 Subject: [PATCH 1/3] registry API client --- packages/config-yaml/package.json | 2 +- packages/config-yaml/src/index.ts | 1 + packages/config-yaml/src/registryClient.ts | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 packages/config-yaml/src/registryClient.ts diff --git a/packages/config-yaml/package.json b/packages/config-yaml/package.json index 9433fbc30..8021713a2 100644 --- a/packages/config-yaml/package.json +++ b/packages/config-yaml/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.52", + "version": "1.0.57", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/config-yaml/src/index.ts b/packages/config-yaml/src/index.ts index b64db7497..0ba530776 100644 --- a/packages/config-yaml/src/index.ts +++ b/packages/config-yaml/src/index.ts @@ -7,6 +7,7 @@ export * from "./load/getBlockType.js"; export * from "./load/merge.js"; export * from "./load/proxySecretResolution.js"; export * from "./load/unroll.js"; +export * from "./registryClient.js"; export * from "./schemas/data/index.js"; export * from "./schemas/index.js"; export * from "./schemas/models.js"; diff --git a/packages/config-yaml/src/registryClient.ts b/packages/config-yaml/src/registryClient.ts new file mode 100644 index 000000000..66e7f9549 --- /dev/null +++ b/packages/config-yaml/src/registryClient.ts @@ -0,0 +1,12 @@ +import { Registry } from "./interfaces/index.js"; +import { FullSlug } from "./interfaces/slugs.js"; + +export class RegistryClient implements Registry { + async getContent(fullSlug: FullSlug): Promise { + const response = await fetch( + `https://api.continue.dev/registry/v1/${fullSlug.ownerSlug}/${fullSlug.packageSlug}/${fullSlug.versionSlug}`, + ); + const data = await response.json(); + return data.content; + } +} From 1ebc86ed4ed9ffb805f1367499d668edf79091b7 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 11 Mar 2025 21:01:33 -0700 Subject: [PATCH 2/3] unroll local yaml using registry client --- core/config/yaml/loadYaml.ts | 37 +++++++++++++++++++++++------ core/package-lock.json | 8 +++---- core/package.json | 2 +- extensions/vscode/package-lock.json | 6 ++--- gui/package-lock.json | 10 ++++---- gui/package.json | 2 +- 6 files changed, 44 insertions(+), 21 deletions(-) diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 8d0ebf60a..352f2349f 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -4,8 +4,12 @@ import { AssistantUnrolled, ConfigResult, ConfigValidationError, + FQSN, ModelRole, - parseAssistantUnrolled, + PlatformClient, + RegistryClient, + SecretResult, + unrollAssistantFromContent, validateConfigYaml, } from "@continuedev/config-yaml"; import { fetchwithRequestOptions } from "@continuedev/fetch"; @@ -41,6 +45,14 @@ import { modifyAnyConfigWithSharedConfig } from "../sharedConfig"; import { llmsFromModelConfig } from "./models"; +export class LocalPlatformClient implements PlatformClient { + async resolveFQSNs(fqsns: FQSN[]): Promise<(SecretResult | undefined)[]> { + return fqsns.map((fqsn) => { + return undefined; + }); + } +} + async function loadConfigYaml( workspaceConfigs: string[], rawYaml: string, @@ -48,14 +60,25 @@ async function loadConfigYaml( ide: IDE, controlPlaneClient: ControlPlaneClient, ): Promise> { - // const ideSettings = await ide.getIdeSettings(); let config = overrideConfigYaml ?? - // (ideSettings.continueTestEnvironment === "production" - // ? await clientRenderHelper(rawYaml, ide, controlPlaneClient) - // : - parseAssistantUnrolled(rawYaml); - // ); + // This is how we allow use of blocks locally + (await unrollAssistantFromContent( + { + ownerSlug: "", + packageSlug: "", + versionSlug: "", + }, + rawYaml, + new RegistryClient(), + { + currentUserSlug: "", + onPremProxyUrl: null, + orgScopeId: null, + platformClient: new LocalPlatformClient(), + renderSecrets: true, + }, + )); const errors = validateConfigYaml(config); if (errors?.some((error) => error.fatal)) { diff --git a/core/package-lock.json b/core/package-lock.json index ec99105e1..6d4029d2b 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -13,7 +13,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.56", + "@continuedev/config-yaml": "^1.0.57", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", @@ -3038,9 +3038,9 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.56", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.56.tgz", - "integrity": "sha512-2OBhmlSFOgZ+Z/ZQ18R/JR9zo6HIzkQ09PCuHQQ9NanN+g5AEVCdWgEtMyOq5DmQM3HLJCoLMXwqzQ9qSJEfFg==", + "version": "1.0.57", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.57.tgz", + "integrity": "sha512-wdfQ+QgOnMViI/p5C6oCk/wYOvakPsgIEh4YVKFtrjMwKWrEhlpotq4Ofbtbt/xlXP3igJngvhVuO31XSyieTQ==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", diff --git a/core/package.json b/core/package.json index 75c47caf6..51800f527 100644 --- a/core/package.json +++ b/core/package.json @@ -46,7 +46,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.56", + "@continuedev/config-yaml": "^1.0.57", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 5f7702aee..a134a4557 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.7", + "version": "1.1.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.7", + "version": "1.1.8", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", @@ -106,7 +106,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.56", + "@continuedev/config-yaml": "^1.0.57", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", diff --git a/gui/package-lock.json b/gui/package-lock.json index 20ade99a1..c048b6aa5 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -7,7 +7,7 @@ "name": "gui", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-yaml": "^1.0.52", + "@continuedev/config-yaml": "^1.0.57", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", @@ -107,7 +107,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.56", + "@continuedev/config-yaml": "^1.0.57", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", @@ -555,9 +555,9 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.52", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.52.tgz", - "integrity": "sha512-x0m4bcQpjHrrv95cq5tsen4Hb6yKCVGn+NeojyzNQYnRD0If/On+ATgX78uXtQtZxsdO4ip73HHCyQlA0O3ZyQ==", + "version": "1.0.57", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.57.tgz", + "integrity": "sha512-wdfQ+QgOnMViI/p5C6oCk/wYOvakPsgIEh4YVKFtrjMwKWrEhlpotq4Ofbtbt/xlXP3igJngvhVuO31XSyieTQ==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", diff --git a/gui/package.json b/gui/package.json index 9a9b8d737..f02698e02 100644 --- a/gui/package.json +++ b/gui/package.json @@ -15,7 +15,7 @@ "test:watch": "vitest" }, "dependencies": { - "@continuedev/config-yaml": "^1.0.52", + "@continuedev/config-yaml": "^1.0.57", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", From 98cf9b2c30a38757afff64daacd319f6841e7782 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 12 Mar 2025 11:19:10 -0700 Subject: [PATCH 3/3] bump --- core/package-lock.json | 8 ++++---- core/package.json | 2 +- gui/package-lock.json | 10 +++++----- gui/package.json | 2 +- packages/config-yaml/package.json | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core/package-lock.json b/core/package-lock.json index 6d4029d2b..8985b6e2b 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -13,7 +13,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.57", + "@continuedev/config-yaml": "^1.0.59", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", @@ -3038,9 +3038,9 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.57", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.57.tgz", - "integrity": "sha512-wdfQ+QgOnMViI/p5C6oCk/wYOvakPsgIEh4YVKFtrjMwKWrEhlpotq4Ofbtbt/xlXP3igJngvhVuO31XSyieTQ==", + "version": "1.0.59", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.59.tgz", + "integrity": "sha512-LG0v67Gywp8Qu5NvrKgGKLtOGZ761DxnzqmHVLhWZBnL3p5GO+Lyr+3UW74aw1DybcqttOZA38/JIitqScSBoA==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", diff --git a/core/package.json b/core/package.json index 51800f527..80b2dd802 100644 --- a/core/package.json +++ b/core/package.json @@ -46,7 +46,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.57", + "@continuedev/config-yaml": "^1.0.59", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", diff --git a/gui/package-lock.json b/gui/package-lock.json index c048b6aa5..73eb8fe94 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -7,7 +7,7 @@ "name": "gui", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-yaml": "^1.0.57", + "@continuedev/config-yaml": "^1.0.59", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", @@ -107,7 +107,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.57", + "@continuedev/config-yaml": "^1.0.59", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", @@ -555,9 +555,9 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.57", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.57.tgz", - "integrity": "sha512-wdfQ+QgOnMViI/p5C6oCk/wYOvakPsgIEh4YVKFtrjMwKWrEhlpotq4Ofbtbt/xlXP3igJngvhVuO31XSyieTQ==", + "version": "1.0.59", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.59.tgz", + "integrity": "sha512-LG0v67Gywp8Qu5NvrKgGKLtOGZ761DxnzqmHVLhWZBnL3p5GO+Lyr+3UW74aw1DybcqttOZA38/JIitqScSBoA==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", diff --git a/gui/package.json b/gui/package.json index f02698e02..9eb4250b1 100644 --- a/gui/package.json +++ b/gui/package.json @@ -15,7 +15,7 @@ "test:watch": "vitest" }, "dependencies": { - "@continuedev/config-yaml": "^1.0.57", + "@continuedev/config-yaml": "^1.0.59", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", diff --git a/packages/config-yaml/package.json b/packages/config-yaml/package.json index 8021713a2..20f1e8ab6 100644 --- a/packages/config-yaml/package.json +++ b/packages/config-yaml/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.57", + "version": "1.0.59", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts",