feat(categories): add disable field to CategoryConfigSchema
Allow individual categories to be disabled via `disable: true` in config. Introduce shared `mergeCategories()` utility to centralize category merging and disabled filtering across all 7 consumption sites.
This commit is contained in:
@@ -1,19 +1,14 @@
|
||||
import type { AvailableCategory } from "../agents/dynamic-agent-prompt-builder"
|
||||
import type { OhMyOpenCodeConfig } from "../config"
|
||||
|
||||
import {
|
||||
CATEGORY_DESCRIPTIONS,
|
||||
DEFAULT_CATEGORIES,
|
||||
} from "../tools/delegate-task/constants"
|
||||
import { CATEGORY_DESCRIPTIONS } from "../tools/delegate-task/constants"
|
||||
import { mergeCategories } from "../shared/merge-categories"
|
||||
|
||||
export function createAvailableCategories(
|
||||
pluginConfig: OhMyOpenCodeConfig,
|
||||
): AvailableCategory[] {
|
||||
const mergedCategories = pluginConfig.categories
|
||||
? { ...DEFAULT_CATEGORIES, ...pluginConfig.categories }
|
||||
: DEFAULT_CATEGORIES
|
||||
const categories = mergeCategories(pluginConfig.categories)
|
||||
|
||||
return Object.entries(mergedCategories).map(([name, categoryConfig]) => {
|
||||
return Object.entries(categories).map(([name, categoryConfig]) => {
|
||||
const model =
|
||||
typeof categoryConfig.model === "string" ? categoryConfig.model : undefined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user