diff --git a/core/package-lock.json b/core/package-lock.json index 9562aea17..7edab380e 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.20", + "@continuedev/config-yaml": "^1.0.23", "@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.20", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.20.tgz", - "integrity": "sha512-MMCqE5khk5MnQc4udPOGCuXf8q+Zo01D4n4qbZu4oPV1foXHfQIZwQkWaQLJOJzzODZEBpgeJeJCknweYckgWg==", + "version": "1.0.23", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.23.tgz", + "integrity": "sha512-F2Hwc85iCwAHJuwJALOsmZIBeHdF+87mS0YT7dlC6QiE+zAhZKUHcLQ/nTt9bJuhyVyufpb9LApkp40UdGsaWw==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", diff --git a/core/package.json b/core/package.json index 05beaca5c..111fbe902 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.20", + "@continuedev/config-yaml": "^1.0.23", "@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 38d0db7c8..cbc67ea38 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.9.254", + "version": "0.9.255", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.9.254", + "version": "0.9.255", "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.16", + "@continuedev/config-yaml": "^1.0.20", "@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 50061f21e..cca979250 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.20", + "@continuedev/config-yaml": "^1.0.23", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", @@ -108,7 +108,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.20", + "@continuedev/config-yaml": "^1.0.23", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", @@ -556,9 +556,9 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.20", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.20.tgz", - "integrity": "sha512-MMCqE5khk5MnQc4udPOGCuXf8q+Zo01D4n4qbZu4oPV1foXHfQIZwQkWaQLJOJzzODZEBpgeJeJCknweYckgWg==", + "version": "1.0.23", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.23.tgz", + "integrity": "sha512-F2Hwc85iCwAHJuwJALOsmZIBeHdF+87mS0YT7dlC6QiE+zAhZKUHcLQ/nTt9bJuhyVyufpb9LApkp40UdGsaWw==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", diff --git a/gui/package.json b/gui/package.json index cf5cbd0fa..4500287fa 100644 --- a/gui/package.json +++ b/gui/package.json @@ -15,7 +15,7 @@ "test:watch": "vitest" }, "dependencies": { - "@continuedev/config-yaml": "^1.0.20", + "@continuedev/config-yaml": "^1.0.23", "@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 e9d11ad03..c3c5419a9 100644 --- a/packages/config-yaml/package.json +++ b/packages/config-yaml/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.22", + "version": "1.0.23", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/config-yaml/src/interfaces/SecretResult.ts b/packages/config-yaml/src/interfaces/SecretResult.ts index 987b33676..b15940d6e 100644 --- a/packages/config-yaml/src/interfaces/SecretResult.ts +++ b/packages/config-yaml/src/interfaces/SecretResult.ts @@ -4,6 +4,7 @@ export enum SecretType { User = "user", Package = "package", Organization = "organization", + NotFound = "not_found", } export interface OrgSecretLocation { @@ -24,18 +25,34 @@ export interface UserSecretLocation { secretName: string; } +/** + * If not found in user/package/org secrets, then there's a chance it's in + * - the on-prem proxy + * - models add-on + * - free trial + */ +export interface NotFoundSecretLocation { + secretType: SecretType.NotFound; + secretName: string; +} + export type SecretLocation = | OrgSecretLocation | PackageSecretLocation - | UserSecretLocation; + | UserSecretLocation + | NotFoundSecretLocation; export function encodeSecretLocation(secretLocation: SecretLocation): string { if (secretLocation.secretType === SecretType.Organization) { return `${SecretType.Organization}:${secretLocation.orgSlug}/${secretLocation.secretName}`; } else if (secretLocation.secretType === SecretType.User) { return `${SecretType.User}:${secretLocation.userSlug}/${secretLocation.secretName}`; - } else { + } else if (secretLocation.secretType === SecretType.Package) { return `${SecretType.Package}:${encodePackageSlug(secretLocation.packageSlug)}/${secretLocation.secretName}`; + } else if (secretLocation.secretType === SecretType.NotFound) { + return `${SecretType.NotFound}:${secretLocation.secretName}`; + } else { + throw new Error(`Invalid secret type: ${secretLocation}`); } } @@ -63,6 +80,11 @@ export function decodeSecretLocation(secretLocation: string): SecretLocation { packageSlug: { ownerSlug: parts[0], packageSlug: parts[1] }, secretName, }; + case SecretType.NotFound: + return { + secretType: SecretType.NotFound, + secretName, + }; default: throw new Error(`Invalid secret type: ${secretType}`); } @@ -70,6 +92,7 @@ export function decodeSecretLocation(secretLocation: string): SecretLocation { export interface NotFoundSecretResult { found: false; + secretLocation: NotFoundSecretLocation; fqsn: FQSN; } diff --git a/packages/config-yaml/src/interfaces/index.ts b/packages/config-yaml/src/interfaces/index.ts index 8ad1d9c38..3bbd17d92 100644 --- a/packages/config-yaml/src/interfaces/index.ts +++ b/packages/config-yaml/src/interfaces/index.ts @@ -69,7 +69,7 @@ export async function resolveFQSN( secretLocation, value: secret, }; - } else { + } else if (secretLocation.secretType !== SecretType.NotFound) { return { found: true, fqsn, @@ -81,6 +81,10 @@ export async function resolveFQSN( return { found: false, + secretLocation: { + secretName: fqsn.secretName, + secretType: SecretType.NotFound, + }, fqsn, }; } diff --git a/packages/config-yaml/src/load/clientRender.ts b/packages/config-yaml/src/load/clientRender.ts index 75e2f89bb..63bca7e0e 100644 --- a/packages/config-yaml/src/load/clientRender.ts +++ b/packages/config-yaml/src/load/clientRender.ts @@ -45,14 +45,6 @@ export async function clientRender( continue; } - if (!secretResult.found) { - // When a secret isn't found anywhere, we keep it templated as just the secret name - // in case it can be found in the on-prem proxy's env - secretsTemplateData["secrets." + encodeFQSN(secretResult.fqsn)] = - `\${{ secrets.${secretResult.fqsn.secretName} }}`; - continue; - } - if ("value" in secretResult) { secretStore.set(secretResult.fqsn.secretName, secretResult.value); }