refactor: merge slashcommand tool into skill tool
Per reviewer feedback (code-yeongyu), keep the 'skill' tool as the main tool and merge slashcommand functionality INTO it, rather than the reverse. Changes: - skill/tools.ts: Add command discovery (discoverCommandsSync) support; handle both SKILL.md skills and .omo/commands/ slash commands in a single tool; show combined listing in tool description - skill/types.ts: Add 'commands' option to SkillLoadOptions - skill/constants.ts: Update description to mention both skills and commands - plugin/tool-registry.ts: Replace createSlashcommandTool with createSkillTool; register tool as 'skill' instead of 'slashcommand' - tools/index.ts: Export createSkillTool instead of createSlashcommandTool - plugin/tool-execute-before.ts: Update tool name checks from 'slashcommand' to 'skill'; update arg name from 'command' to 'name' - agents/dynamic-agent-prompt-builder.ts: Categorize 'skill' tool as 'command' - tools/skill-mcp/tools.ts: Update hint message to reference 'skill' tool - hooks/auto-slash-command/executor.ts: Update error message The slashcommand/ module files are kept (they provide shared utilities used by the skill tool), but the slashcommand tool itself is no longer registered.
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
createCallOmoAgent,
|
||||
createLookAt,
|
||||
createSkillMcpTool,
|
||||
createSlashcommandTool,
|
||||
createSkillTool,
|
||||
createGrepTools,
|
||||
createGlobTools,
|
||||
createAstGrepTools,
|
||||
@@ -95,7 +95,7 @@ export function createToolRegistry(args: {
|
||||
})
|
||||
|
||||
const commands = discoverCommandsSync(ctx.directory)
|
||||
const slashcommandTool = createSlashcommandTool({
|
||||
const skillTool = createSkillTool({
|
||||
commands,
|
||||
skills: skillContext.mergedSkills,
|
||||
mcpManager: managers.skillMcpManager,
|
||||
@@ -129,7 +129,7 @@ export function createToolRegistry(args: {
|
||||
...(lookAt ? { look_at: lookAt } : {}),
|
||||
task: delegateTask,
|
||||
skill_mcp: skillMcpTool,
|
||||
slashcommand: slashcommandTool,
|
||||
skill: skillTool,
|
||||
interactive_bash,
|
||||
...taskToolsRecord,
|
||||
...hashlineToolsRecord,
|
||||
|
||||
Reference in New Issue
Block a user