@@ -25,35 +25,39 @@ export function createPromptInputController(input: {
2525} ) {
2626 const layout = useLayout ( )
2727 const local = useLocal ( )
28- const providers = useProviders ( )
29- const sync = useSync ( )
3028 const sdk = useSDK ( )
29+ const sync = useSync ( )
30+ const providers = useProviders ( ( ) => sdk ( ) . directory )
3131 const view = layout . view ( input . sessionKey )
3232 const agentsQuery = createQuery ( ( ) => input . queryOptions . agents ( pathKey ( sdk ( ) . directory ) ) )
3333 const globalProvidersQuery = createQuery ( ( ) => input . queryOptions . providers ( null ) )
3434 const providersQuery = createQuery ( ( ) => input . queryOptions . providers ( pathKey ( sdk ( ) . directory ) ) )
3535
36- return createMemo < PromptInputControls > ( ( ) => ( {
37- agents : {
38- available : sync ( ) . data . agent ,
39- options : local . agent . list ( ) . map ( ( agent ) => agent . name ) ,
40- current : local . agent . current ( ) ?. name ?? "" ,
41- loading : agentsQuery . isLoading ,
42- visible : local . agent . visible ( ) ,
43- select : local . agent . set ,
44- } ,
45- model : {
46- selection : input . model ?? local . model ,
47- paid : providers . paid ( ) . length > 0 ,
48- loading :
49- ( local . agent . visible ( ) && agentsQuery . isLoading ) || providersQuery . isLoading || globalProvidersQuery . isLoading ,
50- } ,
51- session : {
52- id : input . sessionID ( ) ,
53- tabs : layout . tabs ( input . sessionKey ) ,
54- reviewPanel : view . reviewPanel ,
55- } ,
56- } ) )
36+ return createMemo < PromptInputControls > ( ( ) => {
37+ return {
38+ agents : {
39+ available : sync ( ) . data . agent ,
40+ options : local . agent . list ( ) . map ( ( agent ) => agent . name ) ,
41+ current : local . agent . current ( ) ?. name ?? "" ,
42+ loading : agentsQuery . isLoading ,
43+ visible : local . agent . visible ( ) ,
44+ select : local . agent . set ,
45+ } ,
46+ model : {
47+ selection : input . model ?? local . model ,
48+ paid : providers . paid ( ) . length > 0 ,
49+ loading :
50+ ( local . agent . visible ( ) && agentsQuery . isLoading ) ||
51+ providersQuery . isLoading ||
52+ globalProvidersQuery . isLoading ,
53+ } ,
54+ session : {
55+ id : input . sessionID ( ) ,
56+ tabs : layout . tabs ( input . sessionKey ) ,
57+ reviewPanel : view . reviewPanel ,
58+ } ,
59+ }
60+ } )
5761}
5862
5963export function createPromptProjectControls ( ) {
0 commit comments