feat(mcp): import Codex MCP from ~/.codex/config.toml

- Support both TOML schemas: [mcp.servers.<id>] and [mcp_servers.<id>]
- Non-destructive merge of imported servers (enabled=true only)
- Preserve existing TOML schema when syncing (prefer mcp_servers)
- Remove both mcp and mcp_servers when no enabled items

feat(ui): auto-import Codex MCP on panel init (app=codex)

chore(tauri): add import_mcp_from_codex command and register

chore(types): expose window.api.importMcpFromCodex and typings

fix(ui): remove unused variable for typecheck
This commit is contained in:
Jason
2025-10-10 14:59:02 +08:00
parent 428369cae0
commit 6cf7dacd0e
9 changed files with 214 additions and 27 deletions

View File

@@ -23,7 +23,7 @@ function App() {
const [currentProviderId, setCurrentProviderId] = useState<string>("");
const [isAddModalOpen, setIsAddModalOpen] = useState(false);
const [editingProviderId, setEditingProviderId] = useState<string | null>(
null
null,
);
const [notification, setNotification] = useState<{
message: string;
@@ -44,7 +44,7 @@ function App() {
const showNotification = (
message: string,
type: "success" | "error",
duration = 3000
duration = 3000,
) => {
// 清除之前的定时器
if (timeoutRef.current) {
@@ -196,7 +196,7 @@ function App() {
? t("notifications.removedFromClaudePlugin")
: t("notifications.appliedToClaudePlugin"),
"success",
2000
2000,
);
}
} catch (error: any) {
@@ -219,7 +219,7 @@ function App() {
showNotification(
t("notifications.switchSuccess", { appName }),
"success",
2000
2000,
);
// 更新托盘菜单
await window.api.updateTrayMenu();