feat: release OpsXShell 2.1.0 native Tauri edition

This commit is contained in:
Logan.Li committed 2026-07-30 23:32:51 +08:00
1 parent e9a0d21758
commit a3dba0c6ed
311 files changed
+31748 -14897

No files matched your search

+200
View File
@@ -0,0 +1,200 @@
// Renderer contract for the Tauri native bridge.
export interface DesktopApiContract {
takePendingSshLinks: () => Promise<import('./utils/sshLink').SshLinkTarget[]>
appRuntimeInfo: () => Promise<{
appVersion: string
os: string
arch: string
nativeBackend: string
sshBackend: string
dataPath: string
credentialPath: string
}>
// SSH
sshConnect: (
config: import('../shared/types/ipc.types').SSHConnectRequest
) => Promise<import('../shared/types/ipc.types').SSHConnectResponse>
sshDisconnect: (connectionId: string) => Promise<{ success: boolean; error?: string }>
sshExec: (connectionId: string, command: string) => Promise<{ success: boolean; result?: string; error?: string }>
sshKeepalive: (connectionId: string) => Promise<{ success: boolean; error?: string }>
sshCreateShell: (
connectionId: string,
options?: import('../shared/types/ipc.types').SSHCreateShellRequest,
shellId?: string
) => Promise<{ success: boolean; shellId?: string; error?: string }>
sshShellWrite: (shellId: string, data: string | Uint8Array) => Promise<{ success: boolean; error?: string }>
sshShellResize: (shellId: string, cols: number, rows: number) => Promise<{ success: boolean; error?: string }>
// Local terminal (host shell)
localListShells: () => Promise<{
success: boolean
shells?: Array<{ path: string; name: string; kind: string; isDefault: boolean }>
error?: string
}>
localCreateShell: (
options?: { cols?: number; rows?: number; cwd?: string; shell?: string },
shellId?: string
) => Promise<{
success: boolean
shellId?: string
shellPath?: string
shellName?: string
error?: string
}>
localWrite: (shellId: string, data: string | Uint8Array) => Promise<{ success: boolean; error?: string }>
localResize: (shellId: string, cols: number, rows: number) => Promise<{ success: boolean; error?: string }>
localKill: (shellId: string) => Promise<{ success: boolean; error?: string }>
onLocalData: (callback: (event: unknown, connectionId: string, shellId: string, data: Uint8Array) => void) => void
sshForwardLocal: (
connectionId: string,
localPort: number,
remoteHost: string,
remotePort: number,
forwardId?: string
) => Promise<import('../shared/types/ipc.types').SSHForwardResponse>
sshForwardRemote: (
connectionId: string,
remotePort: number,
localHost: string,
localPort: number,
forwardId?: string
) => Promise<import('../shared/types/ipc.types').SSHForwardResponse>
sshForwardDynamic: (
connectionId: string,
localPort: number,
forwardId?: string
) => Promise<import('../shared/types/ipc.types').SSHForwardResponse>
sshForwardStop: (forwardId: string) => Promise<{ success: boolean; error?: string }>
sshForwardList: (connectionId?: string) => Promise<import('../shared/types/ipc.types').SSHForwardListResponse>
// Sessions
sessionGetAll: () => Promise<{
success: boolean
sessions?: import('../shared/types/session.types').Session[]
error?: string
}>
sessionGetById: (
id: string
) => Promise<{ success: boolean; session?: import('../shared/types/session.types').Session; error?: string }>
sessionCreate: (
session: Omit<import('../shared/types/session.types').Session, 'id'>
) => Promise<import('../shared/types/ipc.types').SessionCreateResponse>
sessionUpdate: (
id: string,
updates: Partial<import('../shared/types/session.types').Session>
) => Promise<import('../shared/types/ipc.types').SessionUpdateResponse>
sessionDelete: (id: string) => Promise<{ success: boolean; error?: string }>
// SFTP
sftpConnect: (connectionId: string) => Promise<{ success: boolean; sftpId?: string; error?: string }>
sftpListDirectory: (sftpId: string, path: string) => Promise<{ success: boolean; files?: unknown[]; error?: string }>
sftpUpload: (sftpId: string, localPath: string, remotePath: string) => Promise<{ success: boolean; error?: string }>
sftpDownload: (sftpId: string, remotePath: string, localPath: string) => Promise<{ success: boolean; error?: string }>
sftpRename: (sftpId: string, oldPath: string, newPath: string) => Promise<{ success: boolean; error?: string }>
sftpDelete: (sftpId: string, path: string, isDirectory: boolean) => Promise<{ success: boolean; error?: string }>
sftpMkdir: (sftpId: string, path: string) => Promise<{ success: boolean; error?: string }>
sftpStat: (sftpId: string, filePath: string) => Promise<{ success: boolean; stats?: unknown; error?: string }>
sftpChmod: (sftpId: string, filePath: string, mode: number) => Promise<{ success: boolean; error?: string }>
sftpReadText: (
sftpId: string,
remotePath: string
) => Promise<{ success: boolean; content?: string; size?: number; encoding?: string; error?: string }>
sftpWriteText: (sftpId: string, remotePath: string, content: string) => Promise<{ success: boolean; error?: string }>
// Settings
settingsGet: (key: string) => Promise<{ success: boolean; value?: unknown; error?: string }>
settingsSet: (key: string, value: unknown) => Promise<{ success: boolean; error?: string }>
// Terminal AI (API keys stay in the Rust encrypted secret store)
aiProviderSaveKey: (providerId: string, apiKey: string) => Promise<{ success: boolean; error?: string }>
aiProviderHasKey: (providerId: string) => Promise<boolean>
aiProviderDeleteKey: (providerId: string) => Promise<{ success: boolean; error?: string }>
aiListModels: (
provider: import('../shared/types/ai.types').AiProviderConfig
) => Promise<import('../shared/types/ai.types').AiModelListResponse>
aiComplete: (
request: import('../shared/types/ai.types').AiCompleteRequest
) => Promise<import('../shared/types/ai.types').AiCompleteResponse>
aiTestProvider: (
request: import('../shared/types/ai.types').AiProviderTestRequest
) => Promise<import('../shared/types/ai.types').AiProviderTestResponse>
aiCatalogFetch: () => Promise<import('../shared/types/ai.types').AiCatalogFetchResponse>
// Dialogs
showSaveDialog: (
options: import('../shared/types/ipc.types').DialogOptions
) => Promise<import('../shared/types/ipc.types').DialogResult>
showOpenDialog: (
options: import('../shared/types/ipc.types').DialogOptions
) => Promise<import('../shared/types/ipc.types').DialogResult>
// File operations
readFile: (filePath: string) => Promise<{ success: boolean; data?: string; error?: string }>
writeFile: (filePath: string, data: string) => Promise<{ success: boolean; error?: string }>
// Local filesystem
getHomePath: () => Promise<{ success: boolean; path?: string; error?: string }>
getDownloadsPath: () => Promise<string>
localReadDir: (dirPath: string) => Promise<unknown>
localGetStats: (filePath: string) => Promise<unknown>
localDelete: (filePath: string) => Promise<unknown>
localRename: (oldPath: string, newPath: string) => Promise<unknown>
localMkdir: (dirPath: string) => Promise<unknown>
// App
getVersion: () => Promise<string>
openExternal: (url: string) => Promise<void>
clipboardReadText: () => Promise<string>
clipboardWriteText: (text: string) => Promise<void>
// Window
toggleMaximize: () => Promise<void>
// Events
onMenuNewSession: (callback: () => void) => void
onMenuQuickConnect: (callback: () => void) => void
onMenuLocalTerminal: (callback: () => void) => void
onMenuImportSessions: (callback: () => void) => void
onMenuExportSessions: (callback: () => void) => void
onMenuOpenSettings: (callback: () => void) => void
onSshLinkAvailable: (callback: () => void) => void
onShellData: (callback: (event: unknown, connectionId: string, shellId: string, data: Uint8Array) => void) => void
onConnectionClosed: (callback: (event: unknown, connectionId: string, reason: string) => void) => void
onHostKeyPrompt: (
callback: (
event: unknown,
payload: {
requestId: string
host: string
port: number
keyType: string
fingerprint: string
isChanged: boolean
previousFingerprint?: string
}
) => void
) => void
respondHostKeyPrompt: (requestId: string, decision: 'accept-once' | 'accept-always' | 'reject') => void
knownHostsList: () => Promise<{
success: boolean
entries?: import('../shared/types/known-hosts.types').KnownHostEntry[]
error?: string
}>
knownHostsRemove: (host: string, port: number) => Promise<{ success: boolean; error?: string }>
knownHostsClear: () => Promise<{ success: boolean; error?: string }>
onSFTPProgress: (
callback: (
event: unknown,
sftpId: string,
progress: { transferred: number; total: number; percentage: number }
) => void
) => void
removeListener: (channel: string, callback: (...args: unknown[]) => void) => void
removeAllListeners: (channel: string) => void
}
declare global {
interface Window {
opsxApi: DesktopApiContract
}
}