@@ -9,7 +9,7 @@ import { Responses as UiResponses } from '@ui/components/editor/prompt/Responses
99import { StatusBar as UiStatusBar } from '@ui/components/editor/prompt/StatusBar'
1010import { ResponseHistoryItem } from '@shared/types/response-history-item'
1111import { EditFormat } from '@shared/types/edit-format'
12- import { TARGET , Target } from '@shared/types/target'
12+ import { Target } from '@shared/types/target'
1313import {
1414 ApiPromptType ,
1515 WebPromptType ,
@@ -165,9 +165,9 @@ export const MainView: React.FC<Props> = (props) => {
165165 const [ is_content_scrollable , set_is_content_scrollable ] = useState ( false )
166166
167167 const show_edit_format_selector =
168- ( props . target == TARGET . WEB && props . web_prompt_type == 'edit-files' ) ||
169- ( props . target == TARGET . API && props . api_prompt_type == 'edit-files' ) ||
170- ( props . target == TARGET . CLI && props . cli_prompt_type == 'edit-files' )
168+ ( props . target == ' WEB' && props . web_prompt_type == 'edit-files' ) ||
169+ ( props . target == ' API' && props . api_prompt_type == 'edit-files' ) ||
170+ ( props . target == ' CLI' && props . cli_prompt_type == 'edit-files' )
171171
172172 const is_context_empty =
173173 show_edit_format_selector && props . selected_files . length == 0
@@ -177,23 +177,23 @@ export const MainView: React.FC<Props> = (props) => {
177177 }
178178
179179 const handle_submit = async ( ) => {
180- if ( props . target == TARGET . WEB ) {
180+ if ( props . target == ' WEB' ) {
181181 props . initialize_chats ( { } )
182- } else if ( props . target == TARGET . API ) {
182+ } else if ( props . target == ' API' ) {
183183 props . on_make_api_call ( false )
184- } else if ( props . target == TARGET . CLI ) {
184+ } else if ( props . target == ' CLI' ) {
185185 props . on_invoke_headless_cli ( )
186186 }
187187 }
188188
189189 const handle_submit_with_control = async ( ) => {
190- if ( props . target == TARGET . WEB ) {
190+ if ( props . target == ' WEB' ) {
191191 props . initialize_chats ( {
192192 show_quick_pick : true
193193 } )
194- } else if ( props . target == TARGET . API ) {
194+ } else if ( props . target == ' API' ) {
195195 props . on_make_api_call ( true )
196- } else if ( props . target == TARGET . CLI ) {
196+ } else if ( props . target == ' CLI' ) {
197197 props . on_invoke_headless_cli ( )
198198 }
199199 }
@@ -276,7 +276,7 @@ export const MainView: React.FC<Props> = (props) => {
276276 } )
277277
278278 const is_api_warning_visible =
279- props . target == TARGET . API &&
279+ props . target == ' API' &&
280280 ! ! props . setup_progress &&
281281 ( ! props . setup_progress . has_provider || props . api_configurations . length == 0 )
282282
@@ -304,11 +304,11 @@ export const MainView: React.FC<Props> = (props) => {
304304 token_count = { props . selected_files_token_count }
305305 files_count = { props . selected_files . length }
306306 theme = {
307- props . target == TARGET . WEB
307+ props . target == ' WEB'
308308 ? props . web_prompt_type == 'edit-files'
309309 ? 'blue'
310310 : 'purple'
311- : props . target == TARGET . API
311+ : props . target == ' API'
312312 ? props . api_prompt_type == 'edit-files'
313313 ? 'blue'
314314 : 'purple'
@@ -331,7 +331,7 @@ export const MainView: React.FC<Props> = (props) => {
331331 < UiSpacer height = { is_landscape ? 6 : 2 } />
332332
333333 < BrowserConnectionStatus
334- is_visible = { props . target == TARGET . WEB }
334+ is_visible = { props . target == ' WEB' }
335335 is_connected = { props . is_connected }
336336 is_closed = { browser_connection . is_closed }
337337 on_close = { browser_connection . handle_close }
@@ -367,9 +367,9 @@ export const MainView: React.FC<Props> = (props) => {
367367 ) }
368368
369369 { props . response_history . length > 0 &&
370- ( props . target == TARGET . WEB
370+ ( props . target == ' WEB'
371371 ? props . web_prompt_type
372- : props . target == TARGET . API
372+ : props . target == ' API'
373373 ? props . api_prompt_type
374374 : props . cli_prompt_type ) == 'edit-files' && (
375375 < UiResponses
@@ -396,7 +396,7 @@ export const MainView: React.FC<Props> = (props) => {
396396 < div className = { styles . prompt } >
397397 < UiPromptField
398398 is_copy_only = {
399- props . target == TARGET . WEB &&
399+ props . target == ' WEB' &&
400400 ( ! props . is_connected || ! props . web_configurations . length )
401401 }
402402 is_action_disabled = { is_context_empty }
@@ -409,17 +409,17 @@ export const MainView: React.FC<Props> = (props) => {
409409 on_at_sign_click = { props . on_at_sign_click }
410410 on_hash_sign_click = { props . on_hash_sign_click }
411411 on_slash_click = { props . on_slash_click }
412- is_web_target = { props . target == TARGET . WEB }
412+ is_web_target = { props . target == ' WEB' }
413413 is_connected = { props . is_connected }
414414 current_selection = { props . current_selection }
415415 send_with_shift_enter = { props . send_with_shift_enter }
416416 currently_open_file_text = { props . currently_open_file_text }
417417 on_caret_position_change = { props . on_caret_position_change }
418418 caret_position_to_set = { props . caret_position_to_set }
419419 prompt_token_count = {
420- ( props . target == TARGET . WEB
420+ ( props . target == ' WEB'
421421 ? props . web_prompt_type
422- : props . target == TARGET . API
422+ : props . target == ' API'
423423 ? props . api_prompt_type
424424 : props . cli_prompt_type ) == 'edit-files'
425425 ? props . edit_instructions_token_count
@@ -442,11 +442,11 @@ export const MainView: React.FC<Props> = (props) => {
442442 active_border_color = {
443443 is_context_empty
444444 ? 'yellow'
445- : props . target == TARGET . WEB
445+ : props . target == ' WEB'
446446 ? props . web_prompt_type == 'edit-files'
447447 ? 'blue'
448448 : 'purple'
449- : props . target == TARGET . API
449+ : props . target == ' API'
450450 ? props . api_prompt_type == 'edit-files'
451451 ? 'blue'
452452 : 'purple'
@@ -531,7 +531,7 @@ export const MainView: React.FC<Props> = (props) => {
531531
532532 const configurations_placeholder_above = (
533533 < >
534- { props . target == TARGET . WEB && (
534+ { props . target == ' WEB' && (
535535 < >
536536 { ! browser_connection . is_closed && (
537537 < >
@@ -566,7 +566,7 @@ export const MainView: React.FC<Props> = (props) => {
566566 ) }
567567 </ >
568568 ) }
569- { props . target == TARGET . API && (
569+ { props . target == ' API' && (
570570 < >
571571 { is_api_warning_visible && (
572572 < >
@@ -601,7 +601,7 @@ export const MainView: React.FC<Props> = (props) => {
601601 ) }
602602 </ >
603603 ) }
604- { props . target == TARGET . CLI && (
604+ { props . target == ' CLI' && (
605605 < >
606606 { props . response_history . length > 0 &&
607607 props . cli_prompt_type === 'edit-files' && (
@@ -623,7 +623,7 @@ export const MainView: React.FC<Props> = (props) => {
623623
624624 const configurations_placeholder_below = (
625625 < >
626- { props . target == TARGET . WEB && ! browser_connection . is_closed && (
626+ { props . target == ' WEB' && ! browser_connection . is_closed && (
627627 < div style = { { visibility : 'hidden' , pointerEvents : 'none' } } >
628628 { prompt_attachments }
629629 </ div >
@@ -633,7 +633,7 @@ export const MainView: React.FC<Props> = (props) => {
633633
634634 const configurations_section = (
635635 < >
636- { props . target == TARGET . WEB && (
636+ { props . target == ' WEB' && (
637637 < UiConfigurations
638638 configurations = { web_configurations }
639639 empty_landscape_placeholder_above = { configurations_placeholder_above }
@@ -674,7 +674,7 @@ export const MainView: React.FC<Props> = (props) => {
674674 />
675675 ) }
676676
677- { props . target == TARGET . API && (
677+ { props . target == ' API' && (
678678 < UiConfigurations
679679 configurations = { api_configurations_ui }
680680 on_configuration_click = { props . on_api_configuration_click }
@@ -700,7 +700,7 @@ export const MainView: React.FC<Props> = (props) => {
700700 />
701701 ) }
702702
703- { props . target == TARGET . CLI && < > </ > }
703+ { props . target == ' CLI' && < > </ > }
704704 </ >
705705 )
706706
0 commit comments