mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
Remove the unreachable agent and command rename plumbing
This commit is contained in:
1 parent
80e013ec81
commit
d153bc0d21
3 files changed
+7
-12
No files matched your search
@@ -13,7 +13,7 @@ import { DirectoryFilesList } from './DirectoryFilesList'
|
||||
interface AgentsEditorProps {
|
||||
agents: Record<string, OpenCodeAgentConfig>
|
||||
directoryAgents?: OpenCodeDirectoryFileInfo[]
|
||||
onSave: (name: string, agent: OpenCodeAgentPatch, previousName?: string) => void
|
||||
onSave: (name: string, agent: OpenCodeAgentPatch) => void
|
||||
onDelete: (name: string) => void
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export function AgentsEditor({ agents, directoryAgents = [], onSave, onDelete }:
|
||||
const hasAgents = Object.keys(agents).length > 0 || directoryAgents.length > 0
|
||||
|
||||
const handleAgentSubmit = (name: string, agent: OpenCodeAgentPatch) => {
|
||||
onSave(name, agent, editingAgent?.name)
|
||||
onSave(name, agent)
|
||||
setEditingAgent(null)
|
||||
setIsCreateDialogOpen(false)
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import { DirectoryFilesList } from './DirectoryFilesList'
|
||||
interface CommandsEditorProps {
|
||||
commands: Record<string, OpenCodeCommandConfig>
|
||||
directoryCommands?: OpenCodeDirectoryFileInfo[]
|
||||
onSave: (name: string, command: OpenCodeCommandPatch, previousName?: string) => void
|
||||
onSave: (name: string, command: OpenCodeCommandPatch) => void
|
||||
onDelete: (name: string) => void
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export function CommandsEditor({ commands, directoryCommands = [], onSave, onDel
|
||||
const hasCommands = Object.keys(commands).length > 0 || directoryCommands.length > 0
|
||||
|
||||
const handleCommandSubmit = (name: string, command: OpenCodeCommandPatch) => {
|
||||
onSave(name, command, editingCommand?.name)
|
||||
onSave(name, command)
|
||||
setEditingCommand(null)
|
||||
setIsCreateDialogOpen(false)
|
||||
}
|
||||
|
||||
@@ -226,13 +226,8 @@ export function OpenCodeConfigManager() {
|
||||
key: 'agents' | 'commands',
|
||||
name: string,
|
||||
value: OpenCodeAgentPatch | OpenCodeCommandPatch,
|
||||
previousName?: string,
|
||||
) => {
|
||||
const entries: ManagedConfigPatch = { [name]: value }
|
||||
if (previousName && previousName !== name) {
|
||||
entries[previousName] = null
|
||||
}
|
||||
patchManagedConfigSafely({ [key]: entries })
|
||||
patchManagedConfigSafely({ [key]: { [name]: value } })
|
||||
}
|
||||
|
||||
const deleteManagedEntity = (key: 'agents' | 'commands', name: string) => {
|
||||
@@ -434,7 +429,7 @@ export function OpenCodeConfigManager() {
|
||||
<CommandsEditor
|
||||
commands={managedCommands}
|
||||
directoryCommands={directoryCommands}
|
||||
onSave={(name, command, previousName) => saveManagedEntity('commands', name, command, previousName)}
|
||||
onSave={(name, command) => saveManagedEntity('commands', name, command)}
|
||||
onDelete={(name) => deleteManagedEntity('commands', name)}
|
||||
/>,
|
||||
)}
|
||||
@@ -467,7 +462,7 @@ export function OpenCodeConfigManager() {
|
||||
<AgentsEditor
|
||||
agents={managedAgents}
|
||||
directoryAgents={directoryAgents}
|
||||
onSave={(name, agent, previousName) => saveManagedEntity('agents', name, agent, previousName)}
|
||||
onSave={(name, agent) => saveManagedEntity('agents', name, agent)}
|
||||
onDelete={(name) => deleteManagedEntity('agents', name)}
|
||||
/>,
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user