fix(dispatch): resolve plugin namespace parsing, template substitution, and discovery duplication
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import {
|
||||
discoverInstalledPlugins,
|
||||
loadPluginCommands,
|
||||
loadPluginSkillsAsCommands,
|
||||
} from "../features/claude-code-plugin-loader"
|
||||
import type { CommandDefinition } from "../features/claude-code-command-loader/types"
|
||||
|
||||
export interface PluginCommandDiscoveryOptions {
|
||||
pluginsEnabled?: boolean
|
||||
enabledPluginsOverride?: Record<string, boolean>
|
||||
}
|
||||
|
||||
export function discoverPluginCommandDefinitions(
|
||||
options?: PluginCommandDiscoveryOptions,
|
||||
): Record<string, CommandDefinition> {
|
||||
if (options?.pluginsEnabled === false) {
|
||||
return {}
|
||||
}
|
||||
|
||||
const { plugins } = discoverInstalledPlugins({
|
||||
enabledPluginsOverride: options?.enabledPluginsOverride,
|
||||
})
|
||||
|
||||
return {
|
||||
...loadPluginCommands(plugins),
|
||||
...loadPluginSkillsAsCommands(plugins),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user