@@ -35,6 +35,7 @@ import { formatServerError } from "@/utils/server-errors"
3535import { queryOptions , useMutation , useQueries , useQuery , useQueryClient } from "@tanstack/solid-query"
3636import { createRefreshQueue } from "./global-sync/queue"
3737import { directoryKey } from "./global-sync/utils"
38+ import { PathKey } from "@/utils/path-key"
3839
3940type GlobalStore = {
4041 ready : boolean
@@ -62,17 +63,17 @@ export const loadLspQuery = (directory: string, sdk: OpencodeClient) =>
6263 queryFn : ( ) => sdk . lsp . status ( ) . then ( ( r ) => r . data ?? [ ] ) ,
6364 } )
6465
65- function makeQueryOptionsApi ( globalSDK : ( ) => OpencodeClient , sdkFor : ( dir : string ) => OpencodeClient ) {
66+ function makeQueryOptionsApi ( globalSDK : ( ) => OpencodeClient , sdkFor : ( dir : PathKey ) => OpencodeClient ) {
6667 return {
6768 globalConfig : ( ) => loadGlobalConfigQuery ( globalSDK ( ) ) ,
6869 projects : ( ) => loadProjectsQuery ( globalSDK ( ) ) ,
69- providers : ( directory : string | null ) =>
70+ providers : ( directory : PathKey | null ) =>
7071 loadProvidersQuery ( directory , directory === null ? globalSDK ( ) : sdkFor ( directory ) ) ,
71- path : ( directory : string | null ) => loadPathQuery ( directory , directory === null ? globalSDK ( ) : sdkFor ( directory ) ) ,
72- agents : ( directory : string ) => loadAgentsQuery ( directory , sdkFor ( directory ) ) ,
73- mcp : ( directory : string ) => loadMcpQuery ( directory , sdkFor ( directory ) ) ,
74- lsp : ( directory : string ) => loadLspQuery ( directory , sdkFor ( directory ) ) ,
75- sessions : ( directory : string ) => ( { queryKey : [ directory , "loadSessions" ] as const } ) ,
72+ path : ( directory : PathKey | null ) => loadPathQuery ( directory , directory === null ? globalSDK ( ) : sdkFor ( directory ) ) ,
73+ agents : ( directory : PathKey ) => loadAgentsQuery ( directory , sdkFor ( directory ) ) ,
74+ mcp : ( directory : PathKey ) => loadMcpQuery ( directory , sdkFor ( directory ) ) ,
75+ lsp : ( directory : PathKey ) => loadLspQuery ( directory , sdkFor ( directory ) ) ,
76+ sessions : ( directory : PathKey ) => ( { queryKey : [ directory , "loadSessions" ] as const } ) ,
7677 }
7778}
7879export type QueryOptionsApi = ReturnType < typeof makeQueryOptionsApi >
0 commit comments