Files
Logan.LiandCursor 08696896f9 feat: harden local shell, SFTP, and desktop session reliability
Finder-launched terminals now inherit a login PATH so tools like ollama resolve, destructive SFTP/editor actions require confirmation, and terminal search plus window dragging work again. SSH forwards and RDP sessions keep listeners and survive reconnect without FastPath crashes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-16 16:08:11 +08:00

52 lines
1.1 KiB
TypeScript

/**
* SFTP Types - 统一的 SFTP 类型定义
* 在主进程和渲染进程间共享
*/
// 文件项
export interface FileItem {
name: string
path: string
type: 'file' | 'directory' | 'symlink'
size: number
modified: number // Unix timestamp
permissions: string
}
// 传输任务
export interface TransferTask {
id: string
type: 'upload' | 'download'
fileName: string
filePath: string
/** Destination directory (remote for upload, local for download). */
destinationDir?: string
status: 'pending' | 'transferring' | 'completed' | 'failed' | 'canceled'
progress: number
error?: string
total: number
transferred: number
speed?: number // bytes per second
startTime?: number
/** Directory recursive transfer (upload_dir / download_dir). */
isDirectory?: boolean
}
// 传输进度
export interface TransferProgress {
taskId: string
transferred: number
total: number
speed: number
}
// 文件列表排序
export type SortField = 'name' | 'size' | 'modified' | 'type'
export type SortOrder = 'asc' | 'desc'
// SFTP 操作结果
export interface SFTPOperationResult {
success: boolean
error?: string
}