import type { SftpFilenameEncoding } from "../../types"; declare global { interface NetcattyBridge { // File opener helpers (for "Open With" feature) selectApplication?(): Promise<{ path: string; name: string } | null>; openWithApplication?(filePath: string, appPath: string): Promise; openWithSystemDefault?(filePath: string): Promise<{ success: boolean; error?: string }>; downloadSftpToTempWithProgress?( sftpId: string, remotePath: string, fileName: string, encoding: SftpFilenameEncoding | undefined, transferId: string ): Promise<{ localPath: string; cancelled: boolean }>; // Save dialog for file downloads showSaveDialog?(defaultPath: string, filters?: Array<{ name: string; extensions: string[] }>): Promise; selectDirectory?(title?: string, defaultPath?: string): Promise; selectFile?(title?: string, defaultPath?: string, filters?: Array<{ name: string; extensions: string[] }>): Promise; // File watcher for auto-sync feature startFileWatch?(localPath: string, remotePath: string, sftpId: string, encoding?: SftpFilenameEncoding): Promise<{ watchId: string }>; stopFileWatch?(watchId: string, cleanupTempFile?: boolean): Promise<{ success: boolean }>; listFileWatches?(): Promise>; registerTempFile?(sftpId: string, localPath: string): Promise<{ success: boolean }>; unregisterTempFile?(sftpId: string, localPath: string): Promise<{ success: boolean; retained?: boolean }>; onFileWatchSynced?(cb: (payload: { watchId: string; localPath: string; remotePath: string; bytesWritten: number }) => void): () => void; onFileWatchError?(cb: (payload: { watchId: string; localPath: string; remotePath: string; error: string }) => void): () => void; onFileWatchStopped?(cb: (payload: { watchId: string; localPath: string; remotePath: string; sftpId: string }) => void): () => void; // Temp file cleanup deleteTempFile?(filePath: string): Promise<{ success: boolean }>; stageUploadFile?(file: File, transferId: string): Promise; cancelStagedUploadFile?(transferId: string): Promise<{ success: boolean }>; // Crash Logs getCrashLogs?(): Promise>; readCrashLog?(fileName: string): Promise; extra?: Record; pid?: number; platform?: string; arch?: string; version?: string; electronVersion?: string; osVersion?: string; memoryMB?: { rss: number; heapUsed: number; heapTotal: number }; activeSessionCount?: number; uptimeSeconds?: number; }>>; clearCrashLogs?(): Promise<{ deletedCount: number }>; openCrashLogsDir?(): Promise<{ success: boolean }>; // Temp directory management getTempDirInfo?(): Promise<{ path: string; fileCount: number; totalSize: number }>; clearTempDir?(): Promise<{ deletedCount: number; failedCount: number; error?: string }>; getTempDirPath?(): Promise; openTempDir?(): Promise<{ success: boolean }>; getToolOutputPersistenceStatus?(): Promise<{ durable: boolean; reason?: string }>; writeToolOutputTemp?(record: import('../../infrastructure/ai/harness/toolOutputStore').PersistedToolOutputRecord, content: string): Promise<{ ok: boolean; path?: string; manifestPath?: string; error?: string }>; restoreToolOutputTemp?(handleId: string, chatSessionId: string): Promise<{ path: string; record: import('../../infrastructure/ai/harness/toolOutputStore').PersistedToolOutputRecord; } | null>; readToolOutputTemp?(filePath: string, request?: { mode?: 'head' | 'tail' | 'full' | 'range' | 'search'; maxChars?: number; offset?: number; query?: string; }): Promise; deleteToolOutputTemp?(filePath: string): Promise<{ ok: boolean }>; deleteChatToolOutputsTemp?(chatSessionId: string): Promise<{ deletedCount: number }>; deleteTerminalToolOutputsTemp?(chatSessionId: string, terminalSessionId: string): Promise<{ deletedCount: number }>; deleteTerminalToolOutputsEverywhereTemp?(terminalSessionId: string): Promise<{ deletedCount: number }>; // Session Logs exportSessionLog?(payload: { terminalData: string; hostLabel: string; hostname: string; startTime: number; format: 'txt' | 'raw' | 'html'; }): Promise<{ success: boolean; canceled?: boolean; filePath?: string }>; selectSessionLogsDir?(): Promise<{ success: boolean; canceled?: boolean; directory?: string }>; autoSaveSessionLog?(payload: { terminalData: string; hostLabel: string; hostname: string; hostId: string; startTime: number; format: 'txt' | 'raw' | 'html'; directory: string; }): Promise<{ success: boolean; error?: string; filePath?: string }>; openSessionLogsDir?(directory: string): Promise<{ success: boolean; error?: string }>; clearSessionLogsDir?(directory: string): Promise<{ success: boolean; deletedCount: number; failedCount: number; error?: string }>; chooseManualSessionLogPath?(payload: { sessionId: string; sessionName?: string; preferredDirectory?: string; format?: 'txt' | 'raw' | 'html'; }): Promise<{ success: boolean; canceled?: boolean; error?: string; selectionToken?: string; filePath?: string; format?: 'txt' | 'raw' | 'html'; }>; startManualSessionLog?(payload: { sessionId: string; sessionName?: string; preferredDirectory?: string; /** Opaque token from chooseManualSessionLogPath (path is main-process only). */ selectionToken?: string; format?: 'txt' | 'raw' | 'html'; timestampsEnabled?: boolean; initialLine?: string; alternateScreenActive?: boolean; }): Promise<{ success: boolean; started: boolean; canceled?: boolean; error?: string; filePath?: string }>; stopManualSessionLog?(payload: { sessionId: string; }): Promise<{ success: boolean; stopped: boolean; error?: string; filePath?: string }>; getManualSessionLogStatus?(payload: { sessionId: string; }): Promise<{ success: boolean; isLogging: boolean; error?: string }>; // Get file path from File object (for drag-and-drop, uses Electron's webUtils) getPathForFile?(file: File): string | undefined; showSystemNotification?(payload: { title: string; body: string; sessionId?: string; }): Promise<{ shown: boolean; reason?: string }>; readClipboardText?(): Promise; writeClipboardText?(text: string): Promise; readClipboardFiles?(): Promise>; readClipboardImage?(): Promise<{ path: string; name: string; mediaType: string; size?: number } | null>; hasClipboardImage?(): Promise; // Credential encryption (field-level safeStorage for sensitive data at rest) credentialsAvailable?(): Promise; credentialsEncrypt?(plaintext: string): Promise; credentialsDecrypt?(value: string): Promise; } } export {};