Elffuss BraidHub

kikocis/continue public

b0a27770390e · 892 BRawPermalink
1import { MCPServer, Rule } from "@continuedev/config-yaml";
2import { ExperimentalMCPOptions, RuleWithSource } from "../..";
3
4export function convertYamlRuleToContinueRule(rule: Rule): RuleWithSource {
5 if (typeof rule === "string") {
6 return {
7 rule: rule,
8 source: "rules-block",
9 };
10 } else {
11 return {
12 source: "rules-block",
13 rule: rule.rule,
14 globs: rule.globs,
15 name: rule.name,
16 ruleFile: rule.sourceFile,
17 alwaysApply: rule.alwaysApply,
18 };
19 }
20}
21
22export function convertYamlMcpToContinueMcp(
23 server: MCPServer,
24): ExperimentalMCPOptions {
25 return {
26 transport: {
27 type: "stdio",
28 command: server.command,
29 args: server.args ?? [],
30 env: server.env,
31 cwd: server.cwd,
32 } as any, // TODO: Fix the mcpServers types in config-yaml (discriminated union)
33 timeout: server.connectionTimeout,
34 };
35}