Connection tree with interleaved folders and hosts, tabbed terminals grouped by host, a pinned local shell, TOFU host key verification, and credentials held by the OS keyring. Terminal bytes travel on a per-session MessagePort with credit-based flow control, so one session running `cat` on a large file cannot stall the others. Transports reconnect on their own with jittered backoff, keeping the scrollback and the tab while replacing only the connection beneath. 156 tests, including integration tests against a real sshd and a migration exercised against a database built in the old shape.
42 lines
1.6 KiB
TypeScript
42 lines
1.6 KiB
TypeScript
/**
|
|
* Channel names for the control plane (request/response over ipcMain.handle).
|
|
*
|
|
* This module is deliberately dependency-free: the preload script imports it,
|
|
* and a sandboxed preload should stay as small as possible. Zod schemas live in
|
|
* `ipc-schemas.ts` and are imported only by the main process.
|
|
*/
|
|
export const CH = {
|
|
APP_INFO: 'app:info',
|
|
|
|
// Every tree mutation returns the full refreshed tree rather than the single
|
|
// changed row. A move rewrites sort orders, and returning the tree makes it
|
|
// impossible for the renderer's copy to drift out of sync with the database
|
|
// — a class of bug that is tedious to reproduce and trivial to avoid at this
|
|
// scale (a connection inventory is hundreds of rows, not millions).
|
|
TREE_LIST: 'tree:list',
|
|
|
|
FOLDER_CREATE: 'folder:create',
|
|
FOLDER_RENAME: 'folder:rename',
|
|
HOST_CREATE: 'host:create',
|
|
HOST_UPDATE: 'host:update',
|
|
|
|
// Folders and hosts share one id space and one ordering, so moving and
|
|
// deleting are single operations rather than one channel per kind.
|
|
NODE_MOVE: 'node:move',
|
|
NODE_DELETE: 'node:delete',
|
|
|
|
// Sessions. Terminal bytes do NOT travel on these — they go over a
|
|
// per-session MessagePort. See `session-protocol.ts`.
|
|
SESSION_OPEN: 'session:open',
|
|
SESSION_OPEN_LOCAL: 'session:openLocal',
|
|
SESSION_CLOSE: 'session:close',
|
|
|
|
// Credentials are write-only from the renderer's side. There is deliberately
|
|
// no channel that returns a stored secret; see `shared/api.ts`.
|
|
CREDENTIAL_SET: 'credential:set',
|
|
CREDENTIAL_DELETE: 'credential:delete',
|
|
CREDENTIAL_HAS: 'credential:has',
|
|
} as const
|
|
|
|
export type Channel = (typeof CH)[keyof typeof CH]
|