MCPcopy Index your code
hub / github.com/Noumena-Network/code / getNestedMemoryAttachments

Function getNestedMemoryAttachments

src/utils/attachments.ts:2174–2201  ·  view source on GitHub ↗

* Processes paths that need nested memory attachments and checks for nested * NCODE.md / legacy CLAUDE.md files * Uses nestedMemoryAttachmentTriggers field from ToolUseContext

(
  toolUseContext: ToolUseContext,
)

Source from the content-addressed store, hash-verified

2172 * Uses nestedMemoryAttachmentTriggers field from ToolUseContext
2173 */
2174async function getNestedMemoryAttachments(
2175 toolUseContext: ToolUseContext,
2176): Promise<Attachment[]> {
2177 // Check triggers first — getAppState() waits for a React render cycle,
2178 // and the common case is an empty trigger set.
2179 if (
2180 !toolUseContext.nestedMemoryAttachmentTriggers ||
2181 toolUseContext.nestedMemoryAttachmentTriggers.size === 0
2182 ) {
2183 return []
2184 }
2185
2186 const appState = toolUseContext.getAppState()
2187 const attachments: Attachment[] = []
2188
2189 for (const filePath of toolUseContext.nestedMemoryAttachmentTriggers) {
2190 const nestedAttachments = await getNestedMemoryAttachmentsForFile(
2191 filePath,
2192 toolUseContext,
2193 appState,
2194 )
2195 attachments.push(...nestedAttachments)
2196 }
2197
2198 toolUseContext.nestedMemoryAttachmentTriggers.clear()
2199
2200 return attachments
2201}
2202
2203async function getRelevantMemoryAttachments(
2204 input: string,

Callers 1

getAttachmentsFunction · 0.85

Calls 2

clearMethod · 0.45

Tested by

no test coverage detected