( agentsPath: string, pluginName: string, sourceName: string, pluginPath: string, pluginManifest: PluginManifest, loadedPaths: Set<string>, )
| 35 | const VALID_MEMORY_SCOPES: AgentMemoryScope[] = ['user', 'project', 'local'] |
| 36 | |
| 37 | async function loadAgentsFromDirectory( |
| 38 | agentsPath: string, |
| 39 | pluginName: string, |
| 40 | sourceName: string, |
| 41 | pluginPath: string, |
| 42 | pluginManifest: PluginManifest, |
| 43 | loadedPaths: Set<string>, |
| 44 | ): Promise<AgentDefinition[]> { |
| 45 | const agents: AgentDefinition[] = [] |
| 46 | await walkPluginMarkdown( |
| 47 | agentsPath, |
| 48 | async (fullPath, namespace) => { |
| 49 | const agent = await loadAgentFromFile( |
| 50 | fullPath, |
| 51 | pluginName, |
| 52 | namespace, |
| 53 | sourceName, |
| 54 | pluginPath, |
| 55 | pluginManifest, |
| 56 | loadedPaths, |
| 57 | ) |
| 58 | if (agent) agents.push(agent) |
| 59 | }, |
| 60 | { logLabel: 'agents' }, |
| 61 | ) |
| 62 | return agents |
| 63 | } |
| 64 | |
| 65 | async function loadAgentFromFile( |
| 66 | filePath: string, |
no test coverage detected