-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreload.cjs
More file actions
106 lines (105 loc) · 7.65 KB
/
Copy pathpreload.cjs
File metadata and controls
106 lines (105 loc) · 7.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('electronAPI', {
openFolder: () => ipcRenderer.invoke('dialog:openFolder'),
getRecentProjects: () => ipcRenderer.invoke('store:getRecentProjects'),
readDirectory: (path) => ipcRenderer.invoke('fs:readDirectory', path),
readFile: (path) => ipcRenderer.invoke('fs:readFile', path),
readFileBinary: (path) => ipcRenderer.invoke('fs:readFileBinary', path),
writeFile: (path, content) => ipcRenderer.invoke('fs:writeFile', path, content),
openInExplorer: (path) => ipcRenderer.invoke('fs:openInExplorer', path),
// Workspace APIs
workspaceGetAll: () => ipcRenderer.invoke('workspace:getAll'),
workspaceSave: (workspaces) => ipcRenderer.invoke('workspace:save', workspaces),
workspaceGetActive: () => ipcRenderer.invoke('workspace:getActive'),
workspaceSetActive: (workspaceId) => ipcRenderer.invoke('workspace:setActive', workspaceId),
workspaceClear: () => ipcRenderer.invoke('workspace:clear'),
workspaceGetLastSession: () => ipcRenderer.invoke('workspace:getLastSession'),
workspaceRestoreSession: () => ipcRenderer.invoke('workspace:restoreSession'),
// Terminal APIs
terminalCreate: (opts) => ipcRenderer.invoke('terminal:create', opts),
terminalWrite: (opts) => ipcRenderer.invoke('terminal:write', opts),
terminalResize: (opts) => ipcRenderer.invoke('terminal:resize', opts),
terminalKill: (opts) => ipcRenderer.invoke('terminal:kill', opts),
onTerminalData: (callback) => ipcRenderer.on('terminal:data', (event, data) => callback(data)),
onTerminalExit: (callback) => ipcRenderer.on('terminal:exit', (event, data) => callback(data)),
// LSP APIs
lspStartServer: (opts) => ipcRenderer.invoke('lsp:startServer', opts),
lspSendMessage: (opts) => ipcRenderer.invoke('lsp:sendMessage', opts),
lspStopServer: (opts) => ipcRenderer.invoke('lsp:stopServer', opts),
onLspMessage: (callback) => ipcRenderer.on('lsp:message', (event, data) => callback(data)),
// Browser APIs
browserCreate: (opts) => ipcRenderer.invoke('browser:create', opts),
browserSetBounds: (opts) => ipcRenderer.invoke('browser:setBounds', opts),
browserHide: (opts) => ipcRenderer.invoke('browser:hide', opts),
browserNavigate: (opts) => ipcRenderer.invoke('browser:navigate', opts),
browserGoBack: (opts) => ipcRenderer.invoke('browser:goBack', opts),
browserGoForward: (opts) => ipcRenderer.invoke('browser:goForward', opts),
browserReload: (opts) => ipcRenderer.invoke('browser:reload', opts),
browserStop: (opts) => ipcRenderer.invoke('browser:stop', opts),
browserDestroy: (opts) => ipcRenderer.invoke('browser:destroy', opts),
browserFocus: (opts) => ipcRenderer.invoke('browser:focus', opts),
onBrowserNavigation: (callback) => ipcRenderer.on('browser:navigation', (event, data) => callback(data)),
onBrowserTitle: (callback) => ipcRenderer.on('browser:title', (event, data) => callback(data)),
onBrowserLoading: (callback) => ipcRenderer.on('browser:loading', (event, data) => callback(data)),
onBrowserError: (callback) => ipcRenderer.on('browser:error', (event, data) => callback(data)),
onBrowserKeyboardNav: (callback) => ipcRenderer.on('browser:keyboard-nav', (event, data) => callback(data)),
onBrowserOpenInTab: (callback) => ipcRenderer.on('browser:open-in-tab', (event, data) => callback(data)),
// Overlay management
browsersHideForOverlay: () => ipcRenderer.invoke('browsers:hideForOverlay'),
browsersShowAfterOverlay: () => ipcRenderer.invoke('browsers:showAfterOverlay'),
onBrowsersRepositionAfterOverlay: (callback) => ipcRenderer.on('browsers:repositionAfterOverlay', () => callback()),
// Workspace browser management
browsersHideWorkspace: (workspaceId) => ipcRenderer.invoke('browsers:hideWorkspace', { workspaceId }),
browsersShowWorkspace: (workspaceId) => ipcRenderer.invoke('browsers:showWorkspace', { workspaceId }),
// Mind file APIs
mindList: (workspacePath) => ipcRenderer.invoke('mind:list', workspacePath),
mindRead: (opts) => ipcRenderer.invoke('mind:read', opts),
mindWrite: (opts) => ipcRenderer.invoke('mind:write', opts),
mindDelete: (opts) => ipcRenderer.invoke('mind:delete', opts),
// Git APIs
gitStatus: (opts) => ipcRenderer.invoke('git:status', opts),
gitBranches: (opts) => ipcRenderer.invoke('git:branches', opts),
gitLog: (opts) => ipcRenderer.invoke('git:log', opts),
gitAdd: (opts) => ipcRenderer.invoke('git:add', opts),
gitReset: (opts) => ipcRenderer.invoke('git:reset', opts),
gitCommit: (opts) => ipcRenderer.invoke('git:commit', opts),
gitCheckout: (opts) => ipcRenderer.invoke('git:checkout', opts),
gitDiff: (opts) => ipcRenderer.invoke('git:diff', opts),
gitPull: (opts) => ipcRenderer.invoke('git:pull', opts),
gitPush: (opts) => ipcRenderer.invoke('git:push', opts),
// SSH APIs
sshGetConnections: () => ipcRenderer.invoke('ssh:getConnections'),
sshSaveConnection: (opts) => ipcRenderer.invoke('ssh:saveConnection', opts),
sshUpdateConnection: (opts) => ipcRenderer.invoke('ssh:updateConnection', opts),
sshRemoveConnection: (id) => ipcRenderer.invoke('ssh:removeConnection', id),
sshClearAllConnections: () => ipcRenderer.invoke('ssh:clearAllConnections'),
sshSetTempCredentials: (opts) => ipcRenderer.invoke('ssh:setTempCredentials', opts),
sshTestConnection: (connection, credentials) => ipcRenderer.invoke('ssh:testConnection', { connection, credentials }),
sshSelectKeyFile: () => ipcRenderer.invoke('ssh:selectKeyFile'),
sshCreateTerminal: (opts) => ipcRenderer.invoke('ssh:createTerminal', opts),
sshWrite: (opts) => ipcRenderer.invoke('ssh:write', opts),
sshResize: (opts) => ipcRenderer.invoke('ssh:resize', opts),
sshKill: (opts) => ipcRenderer.invoke('ssh:kill', opts),
// SFTP APIs
sshSftpReadDir: (connectionId, remotePath) => ipcRenderer.invoke('ssh:sftp:readdir', { connectionId, remotePath }),
sshSftpReadFile: (connectionId, remotePath) => ipcRenderer.invoke('ssh:sftp:readFile', { connectionId, remotePath }),
sshSftpReadFileBinary: (connectionId, remotePath) => ipcRenderer.invoke('ssh:sftp:readFileBinary', { connectionId, remotePath }),
sshSftpWriteFile: (connectionId, remotePath, content) => ipcRenderer.invoke('ssh:sftp:writeFile', { connectionId, remotePath, content }),
sshSftpMkdir: (connectionId, remotePath) => ipcRenderer.invoke('ssh:sftp:mkdir', { connectionId, remotePath }),
sshSftpUnlink: (connectionId, remotePath) => ipcRenderer.invoke('ssh:sftp:unlink', { connectionId, remotePath }),
sshSftpRmdir: (connectionId, remotePath) => ipcRenderer.invoke('ssh:sftp:rmdir', { connectionId, remotePath }),
sshSftpRename: (connectionId, oldPath, newPath) => ipcRenderer.invoke('ssh:sftp:rename', { connectionId, oldPath, newPath }),
sshSftpStat: (connectionId, remotePath) => ipcRenderer.invoke('ssh:sftp:stat', { connectionId, remotePath }),
// Timeline/History APIs
timelineSaveSnapshot: (opts) => ipcRenderer.invoke('timeline:saveSnapshot', opts),
timelineGetEntries: (opts) => ipcRenderer.invoke('timeline:getEntries', opts),
timelineGetSnapshot: (opts) => ipcRenderer.invoke('timeline:getSnapshot', opts),
timelineRestoreSnapshot: (opts) => ipcRenderer.invoke('timeline:restoreSnapshot', opts),
timelineWatchFile: (opts) => ipcRenderer.invoke('timeline:watchFile', opts),
timelineUnwatchFile: (opts) => ipcRenderer.invoke('timeline:unwatchFile', opts),
onTimelineFileChanged: (callback) => ipcRenderer.on('timeline:fileChanged', (event, data) => callback(data)),
// Clipboard and file upload APIs
getClipboardImage: () => ipcRenderer.invoke('clipboard:getImage'),
uploadFile: (opts) => ipcRenderer.invoke('file:upload', opts),
sshSftpUploadFile: (connectionId, remotePath, filePath) => ipcRenderer.invoke('ssh:sftp:uploadFile', { connectionId, remotePath, filePath }),
});