MCPcopy Index your code
hub / github.com/codeaashu/claude-code / loadAgentsFromDirectory

Function loadAgentsFromDirectory

src/utils/plugins/loadPluginAgents.ts:37–63  ·  view source on GitHub ↗
(
  agentsPath: string,
  pluginName: string,
  sourceName: string,
  pluginPath: string,
  pluginManifest: PluginManifest,
  loadedPaths: Set<string>,
)

Source from the content-addressed store, hash-verified

35const VALID_MEMORY_SCOPES: AgentMemoryScope[] = ['user', 'project', 'local']
36
37async 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
65async function loadAgentFromFile(
66 filePath: string,

Callers 1

Calls 3

walkPluginMarkdownFunction · 0.85
loadAgentFromFileFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected