MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / loadMemoryFiles

Function loadMemoryFiles

tools/claw-launcher-ui/memory.mjs:134–152  ·  view source on GitHub ↗
(workspaceDir, filenames)

Source from the content-addressed store, hash-verified

132 * Load specified memory files' full content.
133 */
134export async function loadMemoryFiles(workspaceDir, filenames) {
135 if (!workspaceDir || !filenames?.length) return []
136 const topicsPath = join(memoryDir(workspaceDir), TOPICS_DIR)
137 const results = []
138
139 for (const filename of filenames) {
140 const safe = basename(filename)
141 try {
142 const content = await readFile(join(topicsPath, safe), 'utf8')
143 const fm = parseFrontmatter(content)
144 results.push({
145 filename: safe,
146 content,
147 frontmatter: { name: fm.name || '', description: fm.description || '', type: fm.type || '' },
148 })
149 } catch { /* skip */ }
150 }
151 return results
152}
153
154/**
155 * Load daily logs for recent days.

Callers 2

server.mjsFile · 0.90
buildMemoryContextFunction · 0.85

Calls 4

memoryDirFunction · 0.85
readFileFunction · 0.85
parseFrontmatterFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected