MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / loadAll

Method loadAll

packages/node-runtime/src/ai/assistant-manager.ts:133–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

131 }
132
133 private loadAll(): void {
134 const { fs, assistantsDir } = this.deps
135 this.cache.clear()
136
137 const files = fs.listFiles(assistantsDir, '.md')
138 for (const file of files) {
139 try {
140 const filePath = fs.joinPath(assistantsDir, file)
141 const content = fs.readFile(filePath)
142 const config = parseAssistantFile(content, filePath)
143 if (config) {
144 this.cache.set(config.id, config)
145 } else {
146 this.deps.logger?.warn('AssistantManager', `Failed to parse: ${file}`)
147 }
148 } catch (error) {
149 this.deps.logger?.warn('AssistantManager', `Failed to load: ${file}`, { error: String(error) })
150 }
151 }
152 }
153
154 // ==================== Query ====================
155

Callers 1

initMethod · 0.95

Calls 7

parseAssistantFileFunction · 0.90
setMethod · 0.80
clearMethod · 0.65
listFilesMethod · 0.65
joinPathMethod · 0.65
readFileMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected