feat(keyword-detector): add enabled_expansions config for allowlist control
Add optional enabled_expansions field to keyword_detector config schema. When set, acts as an allowlist - only those expansion types fire. Empty array disables all expansions. Absent field keeps all enabled (backward-compatible). Also supports coexistence with disabled_keywords denylist for fine-grained control. - src/config/schema/keyword-detector.ts: add enabled_expansions field - src/hooks/keyword-detector/detector.ts: apply allowlist filter in detectKeywordsWithType - src/hooks/keyword-detector/hook.ts: pass enabled_expansions from config - src/hooks/keyword-detector/index.test.ts: add 4 tests for enabled_expansions behavior - assets/oh-my-opencode.schema.json: regenerate schema
This commit is contained in:
@@ -4,6 +4,7 @@ export const KeywordTypeSchema = z.enum(["ultrawork", "search", "analyze", "team
|
||||
export type KeywordType = z.infer<typeof KeywordTypeSchema>
|
||||
|
||||
export const KeywordDetectorConfigSchema = z.object({
|
||||
enabled_expansions: z.array(KeywordTypeSchema).optional(),
|
||||
disabled_keywords: z.array(KeywordTypeSchema).optional(),
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user