| 25 | }; |
| 26 | |
| 27 | function getContentsForNewBlock(blockType: BlockType): ConfigYaml { |
| 28 | const configYaml: ConfigYaml = { |
| 29 | name: `New ${BLOCK_TYPE_CONFIG[blockType]?.singular}`, |
| 30 | version: "0.0.1", |
| 31 | schema: "v1", |
| 32 | }; |
| 33 | switch (blockType) { |
| 34 | case "context": |
| 35 | configYaml.context = [ |
| 36 | { |
| 37 | provider: "file", |
| 38 | }, |
| 39 | ]; |
| 40 | break; |
| 41 | case "models": |
| 42 | configYaml.models = [ |
| 43 | { |
| 44 | provider: "anthropic", |
| 45 | model: "claude-sonnet-4-6", |
| 46 | apiKey: "${{ secrets.ANTHROPIC_API_KEY }}", |
| 47 | name: "Claude Sonnet 4.6", |
| 48 | roles: ["chat", "edit"], |
| 49 | }, |
| 50 | ]; |
| 51 | break; |
| 52 | case "rules": |
| 53 | configYaml.rules = ["Always give concise responses"]; |
| 54 | break; |
| 55 | case "docs": |
| 56 | configYaml.docs = [ |
| 57 | { |
| 58 | name: "New docs", |
| 59 | startUrl: "https://docs.continue.dev", |
| 60 | }, |
| 61 | ]; |
| 62 | break; |
| 63 | case "prompts": |
| 64 | configYaml.prompts = [ |
| 65 | { |
| 66 | name: "New prompt", |
| 67 | description: "New prompt", |
| 68 | prompt: |
| 69 | "Please write a thorough suite of unit tests for this code, making sure to cover all relevant edge cases", |
| 70 | }, |
| 71 | ]; |
| 72 | break; |
| 73 | case "mcpServers": |
| 74 | configYaml.mcpServers = [ |
| 75 | { |
| 76 | name: "New MCP server", |
| 77 | command: "npx", |
| 78 | args: ["-y", "<your-mcp-server>"], |
| 79 | env: {}, |
| 80 | }, |
| 81 | ]; |
| 82 | break; |
| 83 | } |
| 84 | |