Skip to content

Commit 16b9ba5

Browse files
committed
refactor(a2a): remove unused imports and clean up code
Remove unused CustomMcpServerManager import and replace wildcard imports with explicit imports for better code clarity.
1 parent 967a423 commit 16b9ba5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,29 @@ package cc.unitmesh.devti.a2a.ui
22

33
import cc.unitmesh.devti.a2a.A2AClientConsumer
44
import cc.unitmesh.devti.a2a.A2aServer
5-
import cc.unitmesh.devti.mcp.client.CustomMcpServerManager
65
import cc.unitmesh.devti.mcp.client.McpServer
76
import com.intellij.openapi.project.Project
87
import com.intellij.ui.JBColor
98
import com.intellij.ui.components.JBLabel
109
import com.intellij.util.ui.JBUI
1110
import com.intellij.util.ui.UIUtil
1211
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
1416
import java.awt.BorderLayout
1517
import java.awt.FlowLayout
1618
import java.awt.GridBagConstraints
1719
import java.awt.GridBagLayout
18-
import javax.swing.*
20+
import javax.swing.JPanel
21+
import javax.swing.SwingConstants
22+
import javax.swing.SwingUtilities
1923

2024
class A2AAgentListPanel(
2125
private val project: Project
2226
) : JPanel(BorderLayout()) {
2327
private val a2aClientConsumer = A2AClientConsumer()
24-
private val mcpServerManager = CustomMcpServerManager.instance(project)
2528
private val textGray = JBColor(0x6B7280, 0x9DA0A8)
2629

2730
// Helper methods to safely access AgentCard properties using reflection
@@ -55,7 +58,7 @@ class A2AAgentListPanel(
5558
} catch (e: Exception) {
5659
null
5760
}
58-
61+
5962
private var loadingJob: Job? = null
6063
private val serverLoadingStatus = mutableMapOf<String, Boolean>()
6164
private val serverPanels = mutableMapOf<String, JPanel>()
@@ -125,7 +128,7 @@ class A2AAgentListPanel(
125128
}
126129
}
127130
}
128-
131+
129132
jobs.forEach { it.join() }
130133
onAgentsLoaded(allA2AAgents)
131134
} catch (e: Exception) {

0 commit comments

Comments
 (0)