diff --git a/dist/cli/config-writer.d.ts b/dist/cli/config-writer.d.ts index eed01c1..552dfbb 100644 --- a/dist/cli/config-writer.d.ts +++ b/dist/cli/config-writer.d.ts @@ -14,6 +14,17 @@ export declare function resolveConfigPath(startDir?: string): string; export declare function isGlobalConfigPath(configPath: string): boolean; export declare function writeDisabledRules(configPath: string, disabledRules: string[]): void; +/** + * Writes the top-level toggles (enabled, mode, external rules source) the + * settings panel owns. An empty externalRulesJsonPath means "use the + * built-in default list", so the key is removed rather than written as "". + */ +export declare function writeSettings(configPath: string, settings: { + enabled: boolean; + mode: string; + externalRulesMode: string; + externalRulesJsonPath: string; +}): void; /** * Merges the given keys into the config file, preserving every other key and * the sort order the UI sends. Allowlist entries are written in the order the diff --git a/dist/cli/config-writer.js b/dist/cli/config-writer.js index 3268f11..f10c76c 100644 --- a/dist/cli/config-writer.js +++ b/dist/cli/config-writer.js @@ -24,6 +24,19 @@ export function isGlobalConfigPath(configPath) { export function writeDisabledRules(configPath, disabledRules) { writeConfigKeys(configPath, { disabledRules: [...disabledRules].sort() }); } +/** + * Writes the top-level toggles (enabled, mode, external rules source) the + * settings panel owns. An empty externalRulesJsonPath means "use the + * built-in default list", so the key is removed rather than written as "". + */ +export function writeSettings(configPath, settings) { + writeConfigKeys(configPath, { + enabled: settings.enabled, + mode: settings.mode, + externalRulesMode: settings.externalRulesMode, + externalRulesJsonPath: settings.externalRulesJsonPath || undefined, + }); +} /** * Merges the given keys into the config file, preserving every other key and * the sort order the UI sends. Allowlist entries are written in the order the diff --git a/dist/cli/page.d.ts b/dist/cli/page.d.ts index 0fbc1ef..afc861a 100644 --- a/dist/cli/page.d.ts +++ b/dist/cli/page.d.ts @@ -16,4 +16,10 @@ export interface Allowlists { allowedValues: string[]; allowedPatterns: string[]; } -export declare function renderPage(rules: RuleRow[], allowlists: Allowlists, token: string, configPath: string, isGlobal: boolean): string; +export interface Settings { + enabled: boolean; + mode: string; + externalRulesMode: string; + externalRulesJsonPath: string; +} +export declare function renderPage(rules: RuleRow[], allowlists: Allowlists, settings: Settings, token: string, configPath: string, isGlobal: boolean): string; diff --git a/dist/cli/page.js b/dist/cli/page.js index 73d7905..0140243 100644 --- a/dist/cli/page.js +++ b/dist/cli/page.js @@ -3,9 +3,10 @@ * logo, which the server serves from the local-only /logo.png route - no * external CDNs or network calls. */ -export function renderPage(rules, allowlists, token, configPath, isGlobal) { +export function renderPage(rules, allowlists, settings, token, configPath, isGlobal) { const rulesJson = JSON.stringify(rules).replace(/
@@ -68,12 +79,46 @@ export function renderPage(rules, allowlists, token, configPath, isGlobal) {${escapeHtml(configPath)} - every change saves automaticallyTurns scanning off entirely for this config's scope. Rule and allowlist changes below still save, they just stop applying.
+ +What happens when a finding is detected in a prompt.
+ +The bundled regex list (data/regex_list_1.json) ships far more patterns than coding secrets. "Coding-only" keeps just the ones relevant to source code and shell input; "All" also enables the broader PII/compliance-oriented patterns.
+ +Absolute path to a custom regex list, in place of the bundled default. Leave blank to use the built-in list. Changing this only affects the rule list shown here after restarting the editor.
+ +