Build a graph scoped to the node's neighborhood when no shared graph was passed.
(deps: SlicerDeps, node: TaskNode)
| 183 | |
| 184 | /** Build a graph scoped to the node's neighborhood when no shared graph was passed. */ |
| 185 | async function buildImportGraphForFiles(deps: SlicerDeps, node: TaskNode): Promise<ImportGraph> { |
| 186 | const files = [...new Set([...node.targetFiles, ...node.contextFiles])]; |
| 187 | const withContent: Array<{ rel: string; content?: string }> = []; |
| 188 | for (const f of files) { |
| 189 | const c = await readFile(deps, f); |
| 190 | withContent.push({ rel: f, content: c ?? undefined }); |
| 191 | } |
| 192 | return buildImportGraph(deps.cwd, withContent, async (rel) => readFile(deps, rel)); |
| 193 | } |
| 194 | |
| 195 | /** |
| 196 | * Render a TaskContext into the actual prompt string handed to the worker. |
no test coverage detected