fix(skill/command): add user_message param to skill tool, fix command priority order
- BUG-20: Add optional user_message parameter to skill tool for command arguments - BUG-19: Reorder command discovery: user > project > opencode-project > opencode-global > builtin - Update AGENTS.md to reflect slashcommand removal and skill tool changes
This commit is contained in:
parent
7fa22aebdf
commit
945c7e658a
@ -67,13 +67,12 @@
|
|||||||
| `session_search` | `createSessionManagerTools` | query, session_id, case_sensitive, limit |
|
| `session_search` | `createSessionManagerTools` | query, session_id, case_sensitive, limit |
|
||||||
| `session_info` | `createSessionManagerTools` | session_id |
|
| `session_info` | `createSessionManagerTools` | session_id |
|
||||||
|
|
||||||
### Skill/Command (3)
|
### Skill/Command (2)
|
||||||
|
|
||||||
| Tool | Factory | Parameters |
|
| Tool | Factory | Parameters |
|
||||||
|------|---------|------------|
|
|------|---------|------------|
|
||||||
| `skill` | `createSkillTool` | name |
|
| `skill` | `createSkillTool` | name, user_message |
|
||||||
| `skill_mcp` | `createSkillMcpTool` | mcp_name, tool_name/resource_name/prompt_name, arguments, grep |
|
| `skill_mcp` | `createSkillMcpTool` | mcp_name, tool_name/resource_name/prompt_name, arguments, grep |
|
||||||
| `slashcommand` | `createSlashcommandTool` | command, user_message |
|
|
||||||
|
|
||||||
### System (2)
|
### System (2)
|
||||||
|
|
||||||
|
|||||||
@ -224,6 +224,10 @@ export function createSkillTool(options: SkillLoadOptions = {}): ToolDefinition
|
|||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
name: tool.schema.string().describe("The skill or command name (e.g., 'code-review' or 'publish'). Use without leading slash for commands."),
|
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 }) {
|
async execute(args: SkillArgs, ctx?: { agent?: string }) {
|
||||||
const skills = await getSkills()
|
const skills = await getSkills()
|
||||||
@ -273,7 +277,7 @@ export function createSkillTool(options: SkillLoadOptions = {}): ToolDefinition
|
|||||||
const matchedCommand = commands.find(c => c.name.toLowerCase() === requestedName.toLowerCase())
|
const matchedCommand = commands.find(c => c.name.toLowerCase() === requestedName.toLowerCase())
|
||||||
|
|
||||||
if (matchedCommand) {
|
if (matchedCommand) {
|
||||||
return await formatLoadedCommand(matchedCommand)
|
return await formatLoadedCommand(matchedCommand, args.user_message)
|
||||||
}
|
}
|
||||||
|
|
||||||
// No match found — provide helpful error with partial matches
|
// No match found — provide helpful error with partial matches
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import type { CommandInfo } from "../slashcommand/types"
|
|||||||
|
|
||||||
export interface SkillArgs {
|
export interface SkillArgs {
|
||||||
name: string
|
name: string
|
||||||
|
user_message?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SkillInfo {
|
export interface SkillInfo {
|
||||||
|
|||||||
@ -76,10 +76,10 @@ export function discoverCommandsSync(directory?: string): CommandInfo[] {
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
return [
|
return [
|
||||||
...builtinCommands,
|
|
||||||
...opencodeProjectCommands,
|
|
||||||
...projectCommands,
|
|
||||||
...opencodeGlobalCommands,
|
|
||||||
...userCommands,
|
...userCommands,
|
||||||
|
...projectCommands,
|
||||||
|
...opencodeProjectCommands,
|
||||||
|
...opencodeGlobalCommands,
|
||||||
|
...builtinCommands,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user