设置界面支持版本控制和github账号管理
This commit is contained in:
@@ -41,6 +41,10 @@ import type {
|
||||
GitLogEntry,
|
||||
SystemLanguageSettings,
|
||||
SystemProxySettings,
|
||||
GitDetectResult,
|
||||
GitSettings,
|
||||
GitHubAccountsSettings,
|
||||
GitHubTokenValidation,
|
||||
McpAppType,
|
||||
LocalMcpServer,
|
||||
McpMarketplaceProvider,
|
||||
@@ -302,6 +306,43 @@ export async function updateSystemLanguageSettings(
|
||||
return invoke("update_system_language_settings", { settings })
|
||||
}
|
||||
|
||||
// --- Version Control ---
|
||||
|
||||
export async function detectGit(): Promise<GitDetectResult> {
|
||||
return invoke("detect_git")
|
||||
}
|
||||
|
||||
export async function testGitPath(path: string): Promise<GitDetectResult> {
|
||||
return invoke("test_git_path", { path })
|
||||
}
|
||||
|
||||
export async function getGitSettings(): Promise<GitSettings> {
|
||||
return invoke("get_git_settings")
|
||||
}
|
||||
|
||||
export async function updateGitSettings(
|
||||
settings: GitSettings
|
||||
): Promise<GitSettings> {
|
||||
return invoke("update_git_settings", { settings })
|
||||
}
|
||||
|
||||
export async function getGitHubAccounts(): Promise<GitHubAccountsSettings> {
|
||||
return invoke("get_github_accounts")
|
||||
}
|
||||
|
||||
export async function validateGitHubToken(
|
||||
serverUrl: string,
|
||||
token: string
|
||||
): Promise<GitHubTokenValidation> {
|
||||
return invoke("validate_github_token", { serverUrl, token })
|
||||
}
|
||||
|
||||
export async function updateGitHubAccounts(
|
||||
settings: GitHubAccountsSettings
|
||||
): Promise<GitHubAccountsSettings> {
|
||||
return invoke("update_github_accounts", { settings })
|
||||
}
|
||||
|
||||
export async function mcpScanLocal(): Promise<LocalMcpServer[]> {
|
||||
return invoke("mcp_scan_local")
|
||||
}
|
||||
|
||||
@@ -523,6 +523,41 @@ export interface SystemLanguageSettings {
|
||||
language: AppLocale
|
||||
}
|
||||
|
||||
// --- Version Control ---
|
||||
|
||||
export interface GitDetectResult {
|
||||
installed: boolean
|
||||
version: string | null
|
||||
path: string | null
|
||||
}
|
||||
|
||||
export interface GitSettings {
|
||||
custom_path: string | null
|
||||
}
|
||||
|
||||
export interface GitHubAccount {
|
||||
id: string
|
||||
server_url: string
|
||||
username: string
|
||||
token: string
|
||||
scopes: string[]
|
||||
avatar_url: string | null
|
||||
is_default: boolean
|
||||
created_at: string
|
||||
}
|
||||
|
||||
export interface GitHubAccountsSettings {
|
||||
accounts: GitHubAccount[]
|
||||
}
|
||||
|
||||
export interface GitHubTokenValidation {
|
||||
success: boolean
|
||||
username: string | null
|
||||
scopes: string[]
|
||||
avatar_url: string | null
|
||||
message: string | null
|
||||
}
|
||||
|
||||
export type McpAppType = "claude_code" | "codex" | "open_code"
|
||||
|
||||
export interface LocalMcpServer {
|
||||
|
||||
Reference in New Issue
Block a user