Changesets · Branches · Tags · Compare
| Changeset | 5e2a247f97eb88e4db243f825f638769d3531a42800231f55860718a7de1868f |
|---|---|
| Author | Nate Sesti <33237525+sestinj@users.noreply.github.com> · 2025-09-22 16:36 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-09-22 16:36 -07:00 |
| Parents | f447b1445b80 |
2 files changed
modified core/config/profile/doLoadConfig.ts +16 −0
| @@ -18,6 +18,7 @@ | ||
| 18 | 18 | Tool, |
| 19 | 19 | } from "../../"; |
| 20 | 20 | import { stringifyMcpPrompt } from "../../commands/slash/mcpSlashCommand"; |
| 21 | +import { convertRuleBlockToSlashCommand } from "../../commands/slash/ruleBlockSlashCommand"; | |
| 21 | 22 | import { MCPManagerSingleton } from "../../context/mcp/MCPManagerSingleton"; |
| 22 | 23 | import ContinueProxyContextProvider from "../../context/providers/ContinueProxyContextProvider"; |
| 23 | 24 | import MCPContextProvider from "../../context/providers/MCPContextProvider"; |
| @@ -155,6 +156,21 @@ | ||
| 155 | 156 | errors.push(...rulesErrors); |
| 156 | 157 | newConfig.rules.unshift(...rules); |
| 157 | 158 | |
| 159 | + // Convert invokable rules to slash commands | |
| 160 | + for (const rule of newConfig.rules) { | |
| 161 | + if (rule.invokable) { | |
| 162 | + try { | |
| 163 | + const slashCommand = convertRuleBlockToSlashCommand(rule); | |
| 164 | + (newConfig.slashCommands ??= []).push(slashCommand); | |
| 165 | + } catch (e) { | |
| 166 | + errors.push({ | |
| 167 | + message: `Error converting invokable rule ${rule.name} to slash command: ${e instanceof Error ? e.message : e}`, | |
| 168 | + fatal: false, | |
| 169 | + }); | |
| 170 | + } | |
| 171 | + } | |
| 172 | + } | |
| 173 | + | |
| 158 | 174 | const proxyContextProvider = newConfig.contextProviders?.find( |
| 159 | 175 | (cp) => cp.description.title === "continue-proxy", |
| 160 | 176 | ); |
modified core/config/yaml/loadYaml.ts +0 −14
| @@ -25,7 +25,6 @@ | ||
| 25 | 25 | |
| 26 | 26 | import { convertPromptBlockToSlashCommand } from "../../commands/slash/promptBlockSlashCommand"; |
| 27 | 27 | import { slashCommandFromPromptFile } from "../../commands/slash/promptFileSlashCommand"; |
| 28 | -import { convertRuleBlockToSlashCommand } from "../../commands/slash/ruleBlockSlashCommand"; | |
| 29 | 28 | import { getControlPlaneEnvSync } from "../../control-plane/env"; |
| 30 | 29 | import { PolicySingleton } from "../../control-plane/PolicySingleton"; |
| 31 | 30 | import { getBaseToolDefinitions } from "../../tools"; |
| @@ -209,19 +208,6 @@ | ||
| 209 | 208 | for (const rule of config.rules ?? []) { |
| 210 | 209 | const convertedRule = convertYamlRuleToContinueRule(rule); |
| 211 | 210 | continueConfig.rules.push(convertedRule); |
| 212 | - | |
| 213 | - // Convert invokable rules to slash commands | |
| 214 | - if (convertedRule.invokable) { | |
| 215 | - try { | |
| 216 | - const slashCommand = convertRuleBlockToSlashCommand(convertedRule); | |
| 217 | - continueConfig.slashCommands?.push(slashCommand); | |
| 218 | - } catch (e) { | |
| 219 | - localErrors.push({ | |
| 220 | - message: `Error converting invokable rule ${convertedRule.name} to slash command: ${e instanceof Error ? e.message : e}`, | |
| 221 | - fatal: false, | |
| 222 | - }); | |
| 223 | - } | |
| 224 | - } | |
| 225 | 211 | } |
| 226 | 212 | |
| 227 | 213 | continueConfig.data = config.data?.map((d) => ({ |