Files
opencode-manager/packages/memory/src/agents/index.ts
T
Chris Scott 3461f86556 Add memory plugin with semantic search and session planning (#145)
* Add memory plugin with semantic search and session planning

* Clarify Memory Plugin is optional in docs
2026-02-23 15:08:56 -05:00

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'