mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
* Add memory plugin with semantic search and session planning * Clarify Memory Plugin is optional in docs
37 lines
956 B
TypeScript
37 lines
956 B
TypeScript
import type { AgentRole, AgentDefinition, AgentRegistry } from './types'
|
|
import { codeAgent } from './code'
|
|
import { reviewAgent } from './review'
|
|
import { memoryAgent } from './memory'
|
|
|
|
export const agents: Record<AgentRole, AgentDefinition> = {
|
|
code: codeAgent,
|
|
review: reviewAgent,
|
|
memory: memoryAgent,
|
|
}
|
|
|
|
export function getAgent(role: AgentRole): AgentDefinition | undefined {
|
|
return agents[role]
|
|
}
|
|
|
|
export function getAgentById(id: string): AgentDefinition | undefined {
|
|
return Object.values(agents).find((agent) => agent.id === id)
|
|
}
|
|
|
|
export function getAllAgents(): AgentDefinition[] {
|
|
return Object.values(agents)
|
|
}
|
|
|
|
export function hasAgent(role: AgentRole): boolean {
|
|
return role in agents
|
|
}
|
|
|
|
export function createAgentRegistry(): AgentRegistry {
|
|
return {
|
|
get: getAgent,
|
|
getAll: getAllAgents,
|
|
has: hasAgent,
|
|
}
|
|
}
|
|
|
|
export { type AgentRole, type AgentDefinition, type AgentRegistry, type AgentConfig } from './types'
|