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:
pizzav-xyz
2026-05-16 02:01:29 +02:00
parent 1723a8b74c
commit f152569ed4
5 changed files with 127 additions and 3 deletions
+14
View File
@@ -6026,6 +6026,20 @@
"keyword_detector": {
"type": "object",
"properties": {
"enabled_expansions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"ultrawork",
"search",
"analyze",
"team",
"hyperplan",
"hyperplan-ultrawork"
]
}
},
"disabled_keywords": {
"type": "array",
"items": {