598a4389d1
Main entry point: - create-hooks.ts, create-tools.ts, create-managers.ts - plugin-interface.ts: plugin interface types - plugin/ directory: plugin lifecycle modules Config handler: - agent-config-handler.ts, command-config-handler.ts - tool-config-handler.ts, mcp-config-handler.ts - provider-config-handler.ts, category-config-resolver.ts - agent-priority-order.ts, prometheus-agent-config-builder.ts - plugin-components-loader.ts
30 lines
840 B
TypeScript
30 lines
840 B
TypeScript
import type { AvailableCategory } from "../agents/dynamic-agent-prompt-builder"
|
|
import type { OhMyOpenCodeConfig } from "../config"
|
|
|
|
import {
|
|
CATEGORY_DESCRIPTIONS,
|
|
DEFAULT_CATEGORIES,
|
|
} from "../tools/delegate-task/constants"
|
|
|
|
export function createAvailableCategories(
|
|
pluginConfig: OhMyOpenCodeConfig,
|
|
): AvailableCategory[] {
|
|
const mergedCategories = pluginConfig.categories
|
|
? { ...DEFAULT_CATEGORIES, ...pluginConfig.categories }
|
|
: DEFAULT_CATEGORIES
|
|
|
|
return Object.entries(mergedCategories).map(([name, categoryConfig]) => {
|
|
const model =
|
|
typeof categoryConfig.model === "string" ? categoryConfig.model : undefined
|
|
|
|
return {
|
|
name,
|
|
description:
|
|
pluginConfig.categories?.[name]?.description ??
|
|
CATEGORY_DESCRIPTIONS[name] ??
|
|
"General tasks",
|
|
model,
|
|
}
|
|
})
|
|
}
|