2026-02-08 16:25:25 +09:00
|
|
|
import type { AvailableCategory } from "../agents/dynamic-agent-prompt-builder"
|
|
|
|
|
import type { OhMyOpenCodeConfig } from "../config"
|
2026-02-11 13:52:06 +09:00
|
|
|
import { CATEGORY_DESCRIPTIONS } from "../tools/delegate-task/constants"
|
|
|
|
|
import { mergeCategories } from "../shared/merge-categories"
|
2026-02-08 16:25:25 +09:00
|
|
|
|
|
|
|
|
export function createAvailableCategories(
|
|
|
|
|
pluginConfig: OhMyOpenCodeConfig,
|
|
|
|
|
): AvailableCategory[] {
|
2026-02-11 13:52:06 +09:00
|
|
|
const categories = mergeCategories(pluginConfig.categories)
|
2026-02-08 16:25:25 +09:00
|
|
|
|
2026-02-11 13:52:06 +09:00
|
|
|
return Object.entries(categories).map(([name, categoryConfig]) => {
|
2026-02-08 16:25:25 +09:00
|
|
|
const model =
|
|
|
|
|
typeof categoryConfig.model === "string" ? categoryConfig.model : undefined
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
name,
|
|
|
|
|
description:
|
|
|
|
|
pluginConfig.categories?.[name]?.description ??
|
|
|
|
|
CATEGORY_DESCRIPTIONS[name] ??
|
|
|
|
|
"General tasks",
|
|
|
|
|
model,
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|