mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
add Code Review agent with /review command support
This commit is contained in:
1 parent
2b1dc9f72b
commit
6dc8cab06e
4 files changed
+134
-1
No files matched your search
@@ -13,6 +13,15 @@ const ENHANCED_BUILTIN_AGENTS: Record<string, { tools: Record<string, boolean> }
|
||||
},
|
||||
}
|
||||
|
||||
const PLUGIN_COMMANDS: Record<string, { template: string; description: string; agent: string; subtask: boolean }> = {
|
||||
review: {
|
||||
description: 'Run a code review on current changes',
|
||||
agent: 'Code Review',
|
||||
subtask: true,
|
||||
template: 'Review the current code changes. $ARGUMENTS',
|
||||
},
|
||||
}
|
||||
|
||||
export function createConfigHandler(agents: Record<AgentRole, AgentDefinition>) {
|
||||
return async (config: Record<string, unknown>) => {
|
||||
const agentConfigs = createAgentConfigs(agents)
|
||||
@@ -45,6 +54,17 @@ export function createConfigHandler(agents: Record<AgentRole, AgentDefinition>)
|
||||
|
||||
config.agent = mergedAgents
|
||||
config.default_agent = 'Code'
|
||||
|
||||
const userCommands = config.command as Record<string, unknown> | undefined
|
||||
const mergedCommands: Record<string, unknown> = { ...PLUGIN_COMMANDS }
|
||||
|
||||
if (userCommands) {
|
||||
for (const [name, userCommand] of Object.entries(userCommands)) {
|
||||
mergedCommands[name] = userCommand
|
||||
}
|
||||
}
|
||||
|
||||
config.command = mergedCommands
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user