MCPcopy
hub / github.com/continuedev/continue / unrollLocalYamlBlocks

Function unrollLocalYamlBlocks

core/config/yaml/loadLocalYamlBlocks.ts:14–53  ·  view source on GitHub ↗
(
  packageIdentifiers: PackageIdentifier[],
  ide: IDE,
  registryClient: RegistryClient,
)

Source from the content-addressed store, hash-verified

12// 1. creates an assistant out of all local blocks
13// 2. unrolls it like a local assistant
14export async function unrollLocalYamlBlocks(
15 packageIdentifiers: PackageIdentifier[],
16 ide: IDE,
17 registryClient: RegistryClient,
18): Promise<ConfigResult<AssistantUnrolled>> {
19 try {
20 const unrollResult = await unrollAssistantFromContent(
21 {
22 uriType: "file",
23 fileUri: "",
24 },
25 "name: FILLER\nschema: v1\nversion: 0.0.1",
26 registryClient,
27 {
28 currentUserSlug: "",
29 platformClient: new LocalPlatformClient(ide),
30 renderSecrets: true,
31 injectBlocks: packageIdentifiers,
32 },
33 );
34 const config =
35 "config" in unrollResult ? unrollResult.config : unrollResult;
36 const errors = "errors" in unrollResult ? unrollResult.errors : [];
37 return {
38 config,
39 errors,
40 configLoadInterrupted: false,
41 };
42 } catch (error) {
43 let message = "An unknown error occurred while loading local YAML blocks";
44 if (error instanceof Error) {
45 message += ": " + error.message;
46 }
47 return {
48 config: undefined,
49 errors: [{ message, fatal: false }],
50 configLoadInterrupted: false,
51 };
52 }
53}

Callers 1

loadConfigYamlFunction · 0.90

Calls 1

Tested by

no test coverage detected