@@ -70,7 +70,7 @@ const NAV_ITEMS_CONFIG: NavConfigItem[] = [
7070type Props = {
7171 // data
7272 providers : ProviderForClient [ ]
73- code_completions_configs : ConfigurationForClient [ ]
73+ code_at_cursor_configs : ConfigurationForClient [ ]
7474 commit_messages_configs : ConfigurationForClient [ ]
7575 edit_context_configs : ConfigurationForClient [ ]
7676 edit_context_system_instructions : string
@@ -92,7 +92,7 @@ type Props = {
9292 // handlers
9393 set_providers : ( providers : ProviderForClient [ ] ) => void
9494 set_edit_context_configs : ( configs : ConfigurationForClient [ ] ) => void
95- set_code_completions_configs : ( configs : ConfigurationForClient [ ] ) => void
95+ set_code_at_cursor_configs : ( configs : ConfigurationForClient [ ] ) => void
9696 set_intelligent_update_configs : ( configs : ConfigurationForClient [ ] ) => void
9797 set_prune_context_configs : ( configs : ConfigurationForClient [ ] ) => void
9898 set_commit_messages_configs : ( configs : ConfigurationForClient [ ] ) => void
@@ -118,12 +118,18 @@ type Props = {
118118 on_open_editor_settings : ( ) => void
119119 on_open_ignore_patterns_settings : ( ) => void
120120 on_open_allow_patterns_settings : ( ) => void
121- on_add_provider : ( params ?: { insertion_index ?: number } ) => void
121+ on_add_provider : ( params ?: {
122+ insertion_index ?: number
123+ create_on_top ?: boolean
124+ } ) => void
122125 on_delete_provider : ( provider_name : string ) => void
123126 on_edit_provider : ( provider_name : string ) => void
124127 on_change_api_key : ( provider_name : string ) => void
125128 on_reorder_providers : ( reordered_providers : ProviderForClient [ ] ) => void
126- on_add_config : ( tool_name : string , insertion_index ?: number ) => void
129+ on_add_config : (
130+ tool_name : string ,
131+ params ?: { insertion_index ?: number ; create_on_top ?: boolean }
132+ ) => void
127133 on_reorder_configs : (
128134 tool_name : string ,
129135 reordered : ConfigurationForClient [ ]
@@ -185,7 +191,7 @@ export const Home: React.FC<Props> = (props) => {
185191 ( is_stuck : boolean ) => handle_stuck_change ( 'edit-context' , is_stuck ) ,
186192 [ handle_stuck_change ]
187193 )
188- const code_completions_on_stuck_change = useCallback (
194+ const code_at_cursor_on_stuck_change = useCallback (
189195 ( is_stuck : boolean ) => handle_stuck_change ( 'code-at-cursor' , is_stuck ) ,
190196 [ handle_stuck_change ]
191197 )
@@ -368,7 +374,11 @@ export const Home: React.FC<Props> = (props) => {
368374 subtitle = "Pair-programming using natural language instructions."
369375 on_stuck_change = { edit_context_on_stuck_change }
370376 actions = {
371- < Button on_click = { ( ) => props . on_add_config ( 'EDIT_CONTEXT' ) } >
377+ < Button
378+ on_click = { ( ) =>
379+ props . on_add_config ( 'EDIT_CONTEXT' , { create_on_top : true } )
380+ }
381+ >
372382 Add New...
373383 </ Button >
374384 }
@@ -379,9 +389,7 @@ export const Home: React.FC<Props> = (props) => {
379389 set_configurations = { props . set_edit_context_configs }
380390 tool_name = "EDIT_CONTEXT"
381391 can_have_default = { false }
382- on_add = { ( params ) =>
383- props . on_add_config ( 'EDIT_CONTEXT' , params ?. insertion_index )
384- }
392+ on_add = { ( params ) => props . on_add_config ( 'EDIT_CONTEXT' , params ) }
385393 on_reorder = { ( reordered ) =>
386394 props . on_reorder_configs ( 'EDIT_CONTEXT' , reordered )
387395 }
@@ -412,7 +420,13 @@ export const Home: React.FC<Props> = (props) => {
412420 subtitle = "Integrate changes from malformed markdown code blocks."
413421 on_stuck_change = { intelligent_update_on_stuck_change }
414422 actions = {
415- < Button on_click = { ( ) => props . on_add_config ( 'INTELLIGENT_UPDATE' ) } >
423+ < Button
424+ on_click = { ( ) =>
425+ props . on_add_config ( 'INTELLIGENT_UPDATE' , {
426+ create_on_top : true
427+ } )
428+ }
429+ >
416430 Add New...
417431 </ Button >
418432 }
@@ -424,10 +438,7 @@ export const Home: React.FC<Props> = (props) => {
424438 tool_name = "INTELLIGENT_UPDATE"
425439 can_have_default = { true }
426440 on_add = { ( params ) =>
427- props . on_add_config (
428- 'INTELLIGENT_UPDATE' ,
429- params ?. insertion_index
430- )
441+ props . on_add_config ( 'INTELLIGENT_UPDATE' , params )
431442 }
432443 on_reorder = { ( reordered ) =>
433444 props . on_reorder_configs ( 'INTELLIGENT_UPDATE' , reordered )
@@ -462,7 +473,11 @@ export const Home: React.FC<Props> = (props) => {
462473 subtitle = "Remove irrelevant files from the current context selection."
463474 on_stuck_change = { prune_context_on_stuck_change }
464475 actions = {
465- < Button on_click = { ( ) => props . on_add_config ( 'PRUNE_CONTEXT' ) } >
476+ < Button
477+ on_click = { ( ) =>
478+ props . on_add_config ( 'PRUNE_CONTEXT' , { create_on_top : true } )
479+ }
480+ >
466481 Add New...
467482 </ Button >
468483 }
@@ -473,9 +488,7 @@ export const Home: React.FC<Props> = (props) => {
473488 set_configurations = { props . set_prune_context_configs }
474489 tool_name = "PRUNE_CONTEXT"
475490 can_have_default = { false }
476- on_add = { ( params ) =>
477- props . on_add_config ( 'PRUNE_CONTEXT' , params ?. insertion_index )
478- }
491+ on_add = { ( params ) => props . on_add_config ( 'PRUNE_CONTEXT' , params ) }
479492 on_reorder = { ( reordered ) =>
480493 props . on_reorder_configs ( 'PRUNE_CONTEXT' , reordered )
481494 }
@@ -489,32 +502,34 @@ export const Home: React.FC<Props> = (props) => {
489502 group = "API Tool"
490503 title = "Code at Cursor"
491504 subtitle = "Get accurate inline suggestions from state-of-the-art models."
492- on_stuck_change = { code_completions_on_stuck_change }
505+ on_stuck_change = { code_at_cursor_on_stuck_change }
493506 actions = {
494- < Button on_click = { ( ) => props . on_add_config ( 'CODE_COMPLETIONS' ) } >
507+ < Button
508+ on_click = { ( ) =>
509+ props . on_add_config ( 'CODE_AT_CURSOR' , { create_on_top : true } )
510+ }
511+ >
495512 Add New...
496513 </ Button >
497514 }
498515 >
499516 < Group >
500517 < ApiToolConfigurationSection
501- configurations = { props . code_completions_configs }
502- set_configurations = { props . set_code_completions_configs }
503- tool_name = "CODE_COMPLETIONS "
518+ configurations = { props . code_at_cursor_configs }
519+ set_configurations = { props . set_code_at_cursor_configs }
520+ tool_name = "CODE_AT_CURSOR "
504521 can_have_default = { true }
505- on_add = { ( params ) =>
506- props . on_add_config ( 'CODE_COMPLETIONS' , params ?. insertion_index )
507- }
522+ on_add = { ( params ) => props . on_add_config ( 'CODE_AT_CURSOR' , params ) }
508523 on_reorder = { ( reordered ) =>
509- props . on_reorder_configs ( 'CODE_COMPLETIONS ' , reordered )
524+ props . on_reorder_configs ( 'CODE_AT_CURSOR ' , reordered )
510525 }
511- on_edit = { ( id ) => props . on_edit_config ( 'CODE_COMPLETIONS ' , id ) }
512- on_delete = { ( id ) => props . on_delete_config ( 'CODE_COMPLETIONS ' , id ) }
526+ on_edit = { ( id ) => props . on_edit_config ( 'CODE_AT_CURSOR ' , id ) }
527+ on_delete = { ( id ) => props . on_delete_config ( 'CODE_AT_CURSOR ' , id ) }
513528 on_set_default = { ( id ) =>
514- props . on_set_default_config ( 'CODE_COMPLETIONS ' , id )
529+ props . on_set_default_config ( 'CODE_AT_CURSOR ' , id )
515530 }
516531 on_unset_default = { ( ) =>
517- props . on_unset_default_config ( 'CODE_COMPLETIONS ' )
532+ props . on_unset_default_config ( 'CODE_AT_CURSOR ' )
518533 }
519534 />
520535 </ Group >
@@ -526,7 +541,11 @@ export const Home: React.FC<Props> = (props) => {
526541 subtitle = "Meaningful summaries of changes adhering to your preffered style."
527542 on_stuck_change = { commit_messages_on_stuck_change }
528543 actions = {
529- < Button on_click = { ( ) => props . on_add_config ( 'COMMIT_MESSAGES' ) } >
544+ < Button
545+ on_click = { ( ) =>
546+ props . on_add_config ( 'COMMIT_MESSAGES' , { create_on_top : true } )
547+ }
548+ >
530549 Add New...
531550 </ Button >
532551 }
@@ -538,7 +557,7 @@ export const Home: React.FC<Props> = (props) => {
538557 tool_name = "COMMIT_MESSAGES"
539558 can_have_default = { true }
540559 on_add = { ( params ) =>
541- props . on_add_config ( 'COMMIT_MESSAGES' , params ?. insertion_index )
560+ props . on_add_config ( 'COMMIT_MESSAGES' , params )
542561 }
543562 on_reorder = { ( reordered ) =>
544563 props . on_reorder_configs ( 'COMMIT_MESSAGES' , reordered )
0 commit comments