@@ -143,6 +143,28 @@ export async function create(branch: string, base: string | undefined, opts: Cre
143143 fs . copyFileSync ( hostPath , dest ) ;
144144 }
145145 }
146+ // Recursively copy host directories into sandbox
147+ for ( const { hostDir, sandboxSubdir } of tool . hostPreSeedDirs ?? [ ] ) {
148+ const dest = path . join ( dir , sandboxSubdir ) ;
149+ if ( fs . existsSync ( hostDir ) && ! fs . existsSync ( dest ) ) {
150+ fs . cpSync ( hostDir , dest , { recursive : true } ) ;
151+ }
152+ }
153+ // Rewrite host paths to container paths in specified files
154+ if ( tool . pathRewriteFiles ?. length ) {
155+ const hostHome = process . env . HOME ! ;
156+ const containerHome = path . dirname ( tool . containerMount ) ;
157+ for ( const relFile of tool . pathRewriteFiles ) {
158+ const filePath = path . join ( dir , relFile ) ;
159+ if ( fs . existsSync ( filePath ) ) {
160+ let content = fs . readFileSync ( filePath , 'utf8' ) ;
161+ // Replace project path first (more specific), then home dir
162+ content = content . replaceAll ( MAIN_REPO , '/workspace' ) ;
163+ content = content . replaceAll ( hostHome , containerHome ) ;
164+ fs . writeFileSync ( filePath , content ) ;
165+ }
166+ }
167+ }
146168 }
147169
148170 // Build env args and volume mounts from tool registry
0 commit comments