11import * as path from "path" ;
2- import { existsSync , readFileSync , rmSync } from "fs" ;
2+ import { existsSync , readFileSync , rmSync , mkdirSync } from "fs" ;
33
4- import { Database , VectorStore , InvertedIndex , ChunkData } from "../native/index.js" ;
4+ import { Database , VectorStore , InvertedIndex , ChunkData , ChunkType } from "../native/index.js" ;
55
66export interface DeltaIndexes {
77 vectorStore : VectorStore ;
@@ -25,7 +25,7 @@ export async function buildDeltaIndexes(
2525 const delta = database . getBranchDelta ( branch , baseBranch ) ;
2626
2727 const deltaPath = path . join ( indexPath , `delta-${ sanitizeBranchName ( branch ) } ` ) ;
28- await fsPromises . mkdir ( deltaPath , { recursive : true } ) ;
28+ mkdirSync ( deltaPath , { recursive : true } ) ;
2929
3030 const vectorStorePath = path . join ( deltaPath , "vectors" ) ;
3131 const vectorStore = new VectorStore ( vectorStorePath , dimensions ) ;
@@ -45,7 +45,7 @@ export async function buildDeltaIndexes(
4545 filePath : chunk . filePath ,
4646 startLine : chunk . startLine ,
4747 endLine : chunk . endLine ,
48- chunkType : chunk . nodeType || "other" ,
48+ chunkType : ( chunk . nodeType || "other" ) as ChunkType ,
4949 name : chunk . name ,
5050 language : chunk . language ,
5151 hash : chunk . contentHash ,
0 commit comments