Merge pull request #2002 from code-yeongyu/fix/bug-19-20-skill-command
fix(skill/command): add user_message param to skill tool, fix command priority order
This commit is contained in:
@@ -67,13 +67,12 @@
|
||||
| `session_search` | `createSessionManagerTools` | query, session_id, case_sensitive, limit |
|
||||
| `session_info` | `createSessionManagerTools` | session_id |
|
||||
|
||||
### Skill/Command (3)
|
||||
### Skill/Command (2)
|
||||
|
||||
| Tool | Factory | Parameters |
|
||||
|------|---------|------------|
|
||||
| `skill` | `createSkillTool` | name |
|
||||
| `skill` | `createSkillTool` | name, user_message |
|
||||
| `skill_mcp` | `createSkillMcpTool` | mcp_name, tool_name/resource_name/prompt_name, arguments, grep |
|
||||
| `slashcommand` | `createSlashcommandTool` | command, user_message |
|
||||
|
||||
### System (2)
|
||||
|
||||
|
||||
@@ -224,6 +224,10 @@ export function createSkillTool(options: SkillLoadOptions = {}): ToolDefinition
|
||||
},
|
||||
args: {
|
||||
name: tool.schema.string().describe("The skill or command name (e.g., 'code-review' or 'publish'). Use without leading slash for commands."),
|
||||
user_message: tool.schema
|
||||
.string()
|
||||
.optional()
|
||||
.describe("Optional arguments or context for command invocation. Example: name='publish', user_message='patch'"),
|
||||
},
|
||||
async execute(args: SkillArgs, ctx?: { agent?: string }) {
|
||||
const skills = await getSkills()
|
||||
@@ -273,7 +277,7 @@ export function createSkillTool(options: SkillLoadOptions = {}): ToolDefinition
|
||||
const matchedCommand = commands.find(c => c.name.toLowerCase() === requestedName.toLowerCase())
|
||||
|
||||
if (matchedCommand) {
|
||||
return await formatLoadedCommand(matchedCommand)
|
||||
return await formatLoadedCommand(matchedCommand, args.user_message)
|
||||
}
|
||||
|
||||
// No match found — provide helpful error with partial matches
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { CommandInfo } from "../slashcommand/types"
|
||||
|
||||
export interface SkillArgs {
|
||||
name: string
|
||||
user_message?: string
|
||||
}
|
||||
|
||||
export interface SkillInfo {
|
||||
|
||||
@@ -76,10 +76,10 @@ export function discoverCommandsSync(directory?: string): CommandInfo[] {
|
||||
}))
|
||||
|
||||
return [
|
||||
...builtinCommands,
|
||||
...opencodeProjectCommands,
|
||||
...projectCommands,
|
||||
...opencodeGlobalCommands,
|
||||
...userCommands,
|
||||
...projectCommands,
|
||||
...opencodeProjectCommands,
|
||||
...opencodeGlobalCommands,
|
||||
...builtinCommands,
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user