@@ -1813,11 +1813,11 @@ async function proxyRequest(
18131813 return ;
18141814 }
18151815
1816- // --- /image command: generate an image via BlockRun image API ---
1817- if ( lastContent . startsWith ( "/image " ) ) {
1818- const imageArgs = lastContent . slice ( "/image " . length ) . trim ( ) ;
1816+ // --- /imagegen command: generate an image via BlockRun image API ---
1817+ if ( lastContent . startsWith ( "/imagegen " ) ) {
1818+ const imageArgs = lastContent . slice ( "/imagegen " . length ) . trim ( ) ;
18191819
1820- // Parse optional flags: /image --model dall-e-3 --size 1792x1024 a cute cat
1820+ // Parse optional flags: /imagegen --model dall-e-3 --size 1792x1024 a cute cat
18211821 let imageModel = "google/nano-banana" ;
18221822 let imageSize = "1024x1024" ;
18231823 let imagePrompt = imageArgs ;
@@ -1853,7 +1853,7 @@ async function proxyRequest(
18531853
18541854 if ( ! imagePrompt ) {
18551855 const errorText = [
1856- "Usage: /image <prompt>" ,
1856+ "Usage: /imagegen <prompt>" ,
18571857 "" ,
18581858 "Options:" ,
18591859 " --model <model> Model to use (default: nano-banana)" ,
@@ -1867,9 +1867,9 @@ async function proxyRequest(
18671867 " flux Black Forest Flux 1.1 Pro — $0.04/image" ,
18681868 "" ,
18691869 "Examples:" ,
1870- " /image a cat wearing sunglasses" ,
1871- " /image --model dall-e-3 a futuristic city at sunset" ,
1872- " /image --model banana-pro --size 2048x2048 mountain landscape" ,
1870+ " /imagegen a cat wearing sunglasses" ,
1871+ " /imagegen --model dall-e-3 a futuristic city at sunset" ,
1872+ " /imagegen --model banana-pro --size 2048x2048 mountain landscape" ,
18731873 ] . join ( "\n" ) ;
18741874
18751875 const completionId = `chatcmpl-image-${ Date . now ( ) } ` ;
@@ -1892,12 +1892,12 @@ async function proxyRequest(
18921892 usage : { prompt_tokens : 0 , completion_tokens : 0 , total_tokens : 0 } ,
18931893 } ) ) ;
18941894 }
1895- console . log ( `[ClawRouter] /image command → showing usage help` ) ;
1895+ console . log ( `[ClawRouter] /imagegen command → showing usage help` ) ;
18961896 return ;
18971897 }
18981898
18991899 // Call upstream image generation API
1900- console . log ( `[ClawRouter] /image command → ${ imageModel } (${ imageSize } ): ${ imagePrompt . slice ( 0 , 80 ) } ...` ) ;
1900+ console . log ( `[ClawRouter] /imagegen command → ${ imageModel } (${ imageSize } ): ${ imagePrompt . slice ( 0 , 80 ) } ...` ) ;
19011901 try {
19021902 const imageUpstreamUrl = `${ apiBase } /v1/images/generations` ;
19031903 const imageBody = JSON . stringify ( { model : imageModel , prompt : imagePrompt , size : imageSize , n : 1 } ) ;
@@ -1919,7 +1919,7 @@ async function proxyRequest(
19191919 ? imageResult . error
19201920 : ( imageResult . error as { message ?: string } ) ?. message ?? `HTTP ${ imageResponse . status } ` ;
19211921 responseText = `Image generation failed: ${ errMsg } ` ;
1922- console . log ( `[ClawRouter] /image error: ${ errMsg } ` ) ;
1922+ console . log ( `[ClawRouter] /imagegen error: ${ errMsg } ` ) ;
19231923 } else {
19241924 const images = imageResult . data ?? [ ] ;
19251925 if ( images . length === 0 ) {
@@ -1933,7 +1933,7 @@ async function proxyRequest(
19331933 lines . push ( "" , `Model: ${ imageModel } | Size: ${ imageSize } ` ) ;
19341934 responseText = lines . join ( "\n" ) ;
19351935 }
1936- console . log ( `[ClawRouter] /image success: ${ images . length } image(s) generated` ) ;
1936+ console . log ( `[ClawRouter] /imagegen success: ${ images . length } image(s) generated` ) ;
19371937 }
19381938
19391939 // Return as synthetic chat completion
@@ -1959,7 +1959,7 @@ async function proxyRequest(
19591959 }
19601960 } catch ( err ) {
19611961 const errMsg = err instanceof Error ? err . message : String ( err ) ;
1962- console . error ( `[ClawRouter] /image error: ${ errMsg } ` ) ;
1962+ console . error ( `[ClawRouter] /imagegen error: ${ errMsg } ` ) ;
19631963 if ( ! res . headersSent ) {
19641964 res . writeHead ( 500 , { "Content-Type" : "application/json" } ) ;
19651965 res . end ( JSON . stringify ( {
0 commit comments