@@ -2,26 +2,29 @@ package cc.unitmesh.devti.a2a.ui
2
2
3
3
import cc.unitmesh.devti.a2a.A2AClientConsumer
4
4
import cc.unitmesh.devti.a2a.A2aServer
5
- import cc.unitmesh.devti.mcp.client.CustomMcpServerManager
6
5
import cc.unitmesh.devti.mcp.client.McpServer
7
6
import com.intellij.openapi.project.Project
8
7
import com.intellij.ui.JBColor
9
8
import com.intellij.ui.components.JBLabel
10
9
import com.intellij.util.ui.JBUI
11
10
import com.intellij.util.ui.UIUtil
12
11
import io.a2a.spec.AgentCard
13
- import kotlinx.coroutines.*
12
+ import kotlinx.coroutines.CoroutineScope
13
+ import kotlinx.coroutines.Dispatchers
14
+ import kotlinx.coroutines.Job
15
+ import kotlinx.coroutines.launch
14
16
import java.awt.BorderLayout
15
17
import java.awt.FlowLayout
16
18
import java.awt.GridBagConstraints
17
19
import java.awt.GridBagLayout
18
- import javax.swing.*
20
+ import javax.swing.JPanel
21
+ import javax.swing.SwingConstants
22
+ import javax.swing.SwingUtilities
19
23
20
24
class A2AAgentListPanel (
21
25
private val project : Project
22
26
) : JPanel(BorderLayout ()) {
23
27
private val a2aClientConsumer = A2AClientConsumer ()
24
- private val mcpServerManager = CustomMcpServerManager .instance(project)
25
28
private val textGray = JBColor (0x6B7280 , 0x9DA0A8 )
26
29
27
30
// Helper methods to safely access AgentCard properties using reflection
@@ -55,7 +58,7 @@ class A2AAgentListPanel(
55
58
} catch (e: Exception ) {
56
59
null
57
60
}
58
-
61
+
59
62
private var loadingJob: Job ? = null
60
63
private val serverLoadingStatus = mutableMapOf<String , Boolean >()
61
64
private val serverPanels = mutableMapOf<String , JPanel >()
@@ -125,7 +128,7 @@ class A2AAgentListPanel(
125
128
}
126
129
}
127
130
}
128
-
131
+
129
132
jobs.forEach { it.join() }
130
133
onAgentsLoaded(allA2AAgents)
131
134
} catch (e: Exception ) {
0 commit comments