>does your Gulp wrapper load files from the disk, or are the files given to it as in-memory streams
The latter. The TS compiler (TypeScriptCompiler) internally works with string sources and outputs strings. The official sources use a wrapper around it (BatchCompiler) that converts input file names to input file contents and output JS+sourcemaps to files. My wrapper uses file contents from gulp.src for the same.
>Well, it seems that it requires quite a lot of code
Yes. The first part of my code is basically a reimplementation of BatchCompiler. But my code also does other things - for example I fiddle with the AST to generate automatic JSDocs, etc.