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..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.56", + "@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.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.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 75c47caf6..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.56", + "@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/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index dc6465ddd..a134a4557 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -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 619c645fe..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.56", + "@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.56", + "@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.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.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 b54727753..9eb4250b1 100644 --- a/gui/package.json +++ b/gui/package.json @@ -15,7 +15,7 @@ "test:watch": "vitest" }, "dependencies": { - "@continuedev/config-yaml": "^1.0.56", + "@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 7c7619e97..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.56", + "version": "1.0.59", "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; + } +}