MCPcopy Create free account
hub / github.com/Noumena-Network/code / copyOverlayToMain

Function copyOverlayToMain

src/services/PromptSuggestion/speculation.ts:100–118  ·  view source on GitHub ↗
(
  overlayPath: string,
  writtenPaths: Set<string>,
  cwd: string,
)

Source from the content-addressed store, hash-verified

98}
99
100async function copyOverlayToMain(
101 overlayPath: string,
102 writtenPaths: Set<string>,
103 cwd: string,
104): Promise<boolean> {
105 let allCopied = true
106 for (const rel of writtenPaths) {
107 const src = join(overlayPath, rel)
108 const dest = join(cwd, rel)
109 try {
110 await mkdir(dirname(dest), { recursive: true })
111 await copyFile(src, dest)
112 } catch {
113 allCopied = false
114 logForDebugging(`[Speculation] Failed to copy ${rel} to main`)
115 }
116 }
117 return allCopied
118}
119
120export type ActiveSpeculationState = Extract<
121 SpeculationState,

Callers 1

acceptSpeculationFunction · 0.85

Calls 2

mkdirFunction · 0.85
logForDebuggingFunction · 0.50

Tested by

no test coverage detected