MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / dependencyContextFor

Function dependencyContextFor

src/context/symbol-graph.ts:81–94  ·  view source on GitHub ↗
(
  graph: ImportGraph,
  seedFiles: string[],
  maxPerSide = 8,
)

Source from the content-addressed store, hash-verified

79 * flood the prompt.
80 */
81export function dependencyContextFor(
82 graph: ImportGraph,
83 seedFiles: string[],
84 maxPerSide = 8,
85): DependencyContext[] {
86 const out: DependencyContext[] = [];
87 for (const f of seedFiles) {
88 const imports = [...(graph.out.get(f) ?? [])].slice(0, maxPerSide);
89 const importedBy = [...(graph.in.get(f) ?? [])].slice(0, maxPerSide);
90 if (imports.length === 0 && importedBy.length === 0) continue;
91 out.push({ file: f, imports, importedBy });
92 }
93 return out;
94}
95
96/** Render dependency context as a compact prompt block, or '' if nothing useful. */
97export function renderDependencyContext(deps: DependencyContext[]): string {

Callers 3

executeMethod · 0.85
buildInitialMessagesMethod · 0.85

Calls 2

getMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected