(files: Record<string, string> = {})
| 9 | let cg: CodeGraph; |
| 10 | |
| 11 | async function index(files: Record<string, string> = {}) { |
| 12 | dir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-empty-explore-')); |
| 13 | for (const [name, source] of Object.entries(files)) { |
| 14 | fs.mkdirSync(path.dirname(path.join(dir, name)), { recursive: true }); |
| 15 | fs.writeFileSync(path.join(dir, name), source); |
| 16 | } |
| 17 | cg = CodeGraph.initSync(dir); |
| 18 | await cg.indexAll(); |
| 19 | } |
| 20 | |
| 21 | async function explore(query: string) { |
| 22 | const result = await new ToolHandler(cg).execute('codegraph_explore', { query }); |
no test coverage detected