@@ -78,10 +78,10 @@ class FilePickerModel: ObservableObject {
78
78
@Published var isLoading : Bool = false
79
79
@Published var error : ClientError ?
80
80
81
- let client : Client
81
+ let client : AgentClient
82
82
83
83
init ( host: String ) {
84
- client = Client ( url : URL ( string : " http:// \( host) :4 " ) ! )
84
+ client = AgentClient ( agentHost : host)
85
85
}
86
86
87
87
func loadRoot( ) {
@@ -176,7 +176,7 @@ class FilePickerItemModel: Identifiable, ObservableObject {
176
176
// This being a binding is pretty important performance-wise, as it's a struct
177
177
// that would otherwise be recreated every time the the item row is rendered.
178
178
// Removing the binding results in very noticeable lag when scrolling a file tree.
179
- @Binding var client : Client
179
+ @Binding var client : AgentClient
180
180
181
181
@Published var contents : [ FilePickerItemModel ] ?
182
182
@Published var isLoading = false
@@ -197,7 +197,7 @@ class FilePickerItemModel: Identifiable, ObservableObject {
197
197
198
198
init (
199
199
name: String ,
200
- client: Binding < Client > ,
200
+ client: Binding < AgentClient > ,
201
201
absolute_path: String ,
202
202
path: [ String ] ,
203
203
dir: Bool = false ,
@@ -237,7 +237,7 @@ class FilePickerItemModel: Identifiable, ObservableObject {
237
237
238
238
extension LSResponse {
239
239
@MainActor
240
- func toModels( client: Binding < Client > , path: [ String ] ) -> [ FilePickerItemModel ] {
240
+ func toModels( client: Binding < AgentClient > , path: [ String ] ) -> [ FilePickerItemModel ] {
241
241
contents. compactMap { file in
242
242
// Filter dotfiles from the picker
243
243
guard !file. name. hasPrefix ( " . " ) else { return nil }
0 commit comments