@@ -167,6 +167,12 @@ function RunCodeApp({ initialModel, workDir, walletAddress, walletBalance, chain
167167 setShowHelp ( true ) ;
168168 setShowWallet ( false ) ;
169169 return ;
170+ case '/sessions' :
171+ setStreamText ( '' ) ;
172+ setWaiting ( true ) ;
173+ setReady ( false ) ;
174+ onSubmit ( '/sessions' ) ;
175+ return ;
170176 case '/clear' :
171177 setStreamText ( '' ) ;
172178 setTools ( new Map ( ) ) ;
@@ -199,6 +205,14 @@ function RunCodeApp({ initialModel, workDir, walletAddress, walletBalance, chain
199205 onSubmit ( '/compact' ) ;
200206 return ;
201207 default :
208+ // Commands with arguments that pass through to the loop
209+ if ( trimmed . startsWith ( '/resume ' ) ) {
210+ setStreamText ( '' ) ;
211+ setWaiting ( true ) ;
212+ setReady ( false ) ;
213+ onSubmit ( trimmed ) ;
214+ return ;
215+ }
202216 setStatusMsg ( `Unknown command: ${ cmd } . Try /help` ) ;
203217 setTimeout ( ( ) => setStatusMsg ( '' ) , 3000 ) ;
204218 return ;
@@ -296,7 +310,7 @@ function RunCodeApp({ initialModel, workDir, walletAddress, walletBalance, chain
296310 } ) , _jsx ( Text , { children : " " } ) ] } ) ) ;
297311 }
298312 // ── Normal Mode ──
299- return ( _jsxs ( Box , { flexDirection : "column" , children : [ statusMsg && ( _jsx ( Box , { marginLeft : 2 , children : _jsx ( Text , { color : "green" , children : statusMsg } ) } ) ) , showHelp && ( _jsxs ( Box , { flexDirection : "column" , marginLeft : 2 , marginTop : 1 , marginBottom : 1 , children : [ _jsx ( Text , { bold : true , children : "Commands" } ) , _jsx ( Text , { children : " " } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/model" } ) , " [name] Switch model (picker if no name)" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/wallet" } ) , " Show wallet address & balance" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/cost" } ) , " Session cost & savings" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/retry" } ) , " Retry the last prompt" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/compact" } ) , " Compress conversation history" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/clear" } ) , " Clear conversation display" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/help" } ) , " This help" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/exit" } ) , " Quit" ] } ) , _jsx ( Text , { children : " " } ) , _jsx ( Text , { dimColor : true , children : " Shortcuts: sonnet, opus, gpt, gemini, deepseek, flash, free, r1, o4, nano, mini, haiku" } ) ] } ) ) , showWallet && ( _jsxs ( Box , { flexDirection : "column" , marginLeft : 2 , marginTop : 1 , marginBottom : 1 , children : [ _jsx ( Text , { bold : true , children : "Wallet" } ) , _jsx ( Text , { children : " " } ) , _jsxs ( Text , { children : [ " Chain: " , _jsx ( Text , { color : "magenta" , children : chain } ) ] } ) , _jsxs ( Text , { children : [ " Address: " , _jsx ( Text , { color : "cyan" , children : walletAddress } ) ] } ) , _jsxs ( Text , { children : [ " Balance: " , _jsx ( Text , { color : "green" , children : balance } ) ] } ) ] } ) ) , Array . from ( tools . values ( ) ) . map ( ( tool , i ) => ( _jsx ( Box , { marginLeft : 1 , children : tool . done ? ( tool . error
313+ return ( _jsxs ( Box , { flexDirection : "column" , children : [ statusMsg && ( _jsx ( Box , { marginLeft : 2 , children : _jsx ( Text , { color : "green" , children : statusMsg } ) } ) ) , showHelp && ( _jsxs ( Box , { flexDirection : "column" , marginLeft : 2 , marginTop : 1 , marginBottom : 1 , children : [ _jsx ( Text , { bold : true , children : "Commands" } ) , _jsx ( Text , { children : " " } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/model" } ) , " [name] Switch model (picker if no name)" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/wallet" } ) , " Show wallet address & balance" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/cost" } ) , " Session cost & savings" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/retry" } ) , " Retry the last prompt" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/compact" } ) , " Compress conversation history" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/sessions" } ) , " List saved sessions" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/resume" } ) , " id Resume a saved session" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/clear" } ) , " Clear conversation display" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/help" } ) , " This help" ] } ) , _jsxs ( Text , { children : [ " " , _jsx ( Text , { color : "cyan" , children : "/exit" } ) , " Quit" ] } ) , _jsx ( Text , { children : " " } ) , _jsx ( Text , { dimColor : true , children : " Shortcuts: sonnet, opus, gpt, gemini, deepseek, flash, free, r1, o4, nano, mini, haiku" } ) ] } ) ) , showWallet && ( _jsxs ( Box , { flexDirection : "column" , marginLeft : 2 , marginTop : 1 , marginBottom : 1 , children : [ _jsx ( Text , { bold : true , children : "Wallet" } ) , _jsx ( Text , { children : " " } ) , _jsxs ( Text , { children : [ " Chain: " , _jsx ( Text , { color : "magenta" , children : chain } ) ] } ) , _jsxs ( Text , { children : [ " Address: " , _jsx ( Text , { color : "cyan" , children : walletAddress } ) ] } ) , _jsxs ( Text , { children : [ " Balance: " , _jsx ( Text , { color : "green" , children : balance } ) ] } ) ] } ) ) , Array . from ( tools . values ( ) ) . map ( ( tool , i ) => ( _jsx ( Box , { marginLeft : 1 , children : tool . done ? ( tool . error
300314 ? _jsxs ( Text , { color : "red" , children : [ " \u2717 " , tool . name , " " , _jsxs ( Text , { dimColor : true , children : [ tool . elapsed , "ms" ] } ) ] } )
301315 : _jsxs ( Text , { color : "green" , children : [ " \u2713 " , tool . name , " " , _jsxs ( Text , { dimColor : true , children : [ tool . elapsed , "ms \u2014 " , tool . preview . slice ( 0 , 200 ) , tool . preview . length > 200 ? '...' : '' ] } ) ] } ) ) : ( _jsxs ( Text , { color : "cyan" , children : [ " " , _jsx ( Spinner , { type : "dots" } ) , " " , tool . name , "... " , _jsxs ( Text , { dimColor : true , children : [ Math . round ( ( Date . now ( ) - tool . startTime ) / 1000 ) , "s" ] } ) ] } ) ) } , i ) ) ) , thinking && ( _jsxs ( Box , { flexDirection : "column" , marginLeft : 1 , children : [ _jsxs ( Text , { color : "magenta" , children : [ " " , _jsx ( Spinner , { type : "dots" } ) , " thinking..." ] } ) , thinkingText && ( _jsxs ( Text , { dimColor : true , wrap : "truncate-end" , children : [ " " , thinkingText . split ( '\n' ) . pop ( ) ?. slice ( 0 , 80 ) ] } ) ) ] } ) ) , waiting && ! thinking && tools . size === 0 && ( _jsx ( Box , { marginLeft : 1 , children : _jsxs ( Text , { color : "yellow" , children : [ " " , _jsx ( Spinner , { type : "dots" } ) , " " , _jsx ( Text , { dimColor : true , children : currentModel } ) ] } ) } ) ) , streamText && ( _jsx ( Box , { marginTop : 0 , marginBottom : 0 , children : _jsx ( Text , { children : streamText } ) } ) ) , ready && ( turnTokens . input > 0 || turnTokens . output > 0 ) && streamText && ( _jsx ( Box , { marginLeft : 1 , marginTop : 0 , children : _jsxs ( Text , { dimColor : true , children : [ turnTokens . input . toLocaleString ( ) , " in / " , turnTokens . output . toLocaleString ( ) , " out" , totalCost > 0 ? ` · $${ totalCost . toFixed ( 4 ) } session` : '' ] } ) } ) ) , ready && ( _jsx ( InputBox , { input : input , setInput : setInput , onSubmit : handleSubmit , model : currentModel , balance : balance , focused : mode === 'input' } ) ) ] } ) ) ;
302316}
0 commit comments