@@ -613,11 +613,11 @@ async function promptBuildConfig(
613613 return { model : model . id , effort, distDir, supportsEffort } ;
614614}
615615
616- function printBuildHeader ( target : string , config : BuildConfig ) : void {
616+ function printBuildHeader ( target : string , config : BuildConfig , mode : string ) : void {
617617 const effortStr = config . effort ? ` · Effort: ${ config . effort } ` : "" ;
618618 log ( `\n${ chalk . cyan ( "●" ) } ${ chalk . bold ( "TUIkit compiler" ) } ` ) ;
619619 log ( ` Target: ${ chalk . bold ( target ) } · Model: ${ chalk . bold ( config . model ) } ${ effortStr } ` ) ;
620- log ( ` Output: ${ relative ( SPECS_DIR , config . distDir ) } /\n` ) ;
620+ log ( ` Output: ${ relative ( SPECS_DIR , config . distDir ) } / · Mode: ${ mode } \n` ) ;
621621}
622622
623623function printSummary (
@@ -715,7 +715,7 @@ async function cmdBuild(
715715 writeFileSync ( promptPath , prompt ) ;
716716
717717 // 5. Print header
718- printBuildHeader ( target , config ) ;
718+ printBuildHeader ( target , config , sessionMode ) ;
719719 log ( ` ${ chalk . dim ( `${ dirty . length } dirty specs to compile` ) } \n` ) ;
720720
721721 // 6. Metrics
@@ -732,6 +732,7 @@ async function cmdBuild(
732732 } ;
733733
734734 // 7. Create session
735+ const sessionMode = autopilot ? "autopilot" : "interactive" ;
735736 const sessionConfig : Record < string , unknown > = {
736737 model : config . model ,
737738 onPermissionRequest : approveAll ,
@@ -815,7 +816,13 @@ your final message like this:
815816 process . exit ( 1 ) ;
816817 }
817818
818- // 8. SIGINT handler
819+ // 8. Set SDK agent mode
820+ await session . rpc . mode . set ( { mode : sessionMode } ) ;
821+ if ( verbose ) {
822+ log ( chalk . dim ( ` Agent mode: ${ sessionMode } ` ) ) ;
823+ }
824+
825+ // 9. SIGINT handler
819826 let aborted = false ;
820827 const sigintHandler = async ( ) => {
821828 if ( aborted ) return ;
@@ -832,7 +839,7 @@ your final message like this:
832839 } ;
833840 process . on ( "SIGINT" , sigintHandler ) ;
834841
835- // 9 . Event handlers
842+ // 10 . Event handlers
836843 let currentPhase = "Starting" ;
837844
838845 if ( verbose ) {
@@ -1198,7 +1205,7 @@ Build options:
11981205 --effort <level> Reasoning effort: low | medium | high | xhigh (default: high)
11991206 --verbose Show full agent transcript (raw streaming output)
12001207 --no-lock Suppress agent lock instructions (agent won't lock components)
1201- --autopilot Auto-run passes without confirmation (max: components + 5)
1208+ --autopilot Use SDK autopilot mode — agent runs all passes autonomously
12021209
12031210Common options:
12041211 --out <dir> Output directory for compiled code (default: dist/)
0 commit comments