commit
3acf9563a2
9 changed files with 56 additions and 20 deletions
|
|
@ -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<ConfigResult<AssistantUnrolled>> {
|
||||
// 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)) {
|
||||
|
|
|
|||
8
core/package-lock.json
generated
8
core/package-lock.json
generated
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
2
extensions/vscode/package-lock.json
generated
2
extensions/vscode/package-lock.json
generated
|
|
@ -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",
|
||||
|
|
|
|||
10
gui/package-lock.json
generated
10
gui/package-lock.json
generated
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
12
packages/config-yaml/src/registryClient.ts
Normal file
12
packages/config-yaml/src/registryClient.ts
Normal file
|
|
@ -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<string> {
|
||||
const response = await fetch(
|
||||
`https://api.continue.dev/registry/v1/${fullSlug.ownerSlug}/${fullSlug.packageSlug}/${fullSlug.versionSlug}`,
|
||||
);
|
||||
const data = await response.json();
|
||||
return data.content;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue