MCPcopy Index your code
hub / github.com/continuedev/continue / parseConfigYaml

Function parseConfigYaml

packages/config-yaml/src/load/unroll.ts:32–58  ·  view source on GitHub ↗
(configYaml: string)

Source from the content-addressed store, hash-verified

30import { BlockType, getBlockType } from "./getBlockType.js";
31
32export function parseConfigYaml(configYaml: string): ConfigYaml {
33 try {
34 const parsed = YAML.parse(configYaml);
35 const result = configYamlSchema.safeParse(parsed);
36 if (result.success) {
37 return result.data;
38 }
39
40 throw new Error(formatZodError(result.error), {
41 cause: "result.success was false",
42 });
43 } catch (e) {
44 if (
45 e instanceof Error &&
46 "cause" in e &&
47 e.cause === "result.success was false"
48 ) {
49 throw new Error(`Failed to parse config: ${e.message}`);
50 } else if (e instanceof ZodError) {
51 throw new Error(`Failed to parse config: ${formatZodError(e)}`);
52 } else {
53 throw new Error(
54 `Failed to parse config: ${e instanceof Error ? e.message : e}`,
55 );
56 }
57 }
58}
59
60export function parseAssistantUnrolled(configYaml: string): AssistantUnrolled {
61 try {

Callers 5

PromptsSubSectionFunction · 0.90
RulesSubSectionFunction · 0.90
ToolsSectionFunction · 0.90
DocsIndexingStatusesFunction · 0.90
mainFunction · 0.85

Calls 1

formatZodErrorFunction · 0.85

Tested by

no test coverage detected