ai-remote 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/{src/index.ts → dist/index.d.ts} +0 -1
  2. package/dist/index.js +0 -1
  3. package/dist/protocols/index.d.ts +31 -0
  4. package/dist/protocols/index.js +0 -1
  5. package/dist/protocols/rdp/buffer.d.ts +38 -0
  6. package/dist/protocols/rdp/buffer.js +0 -1
  7. package/dist/protocols/rdp/caps.d.ts +49 -0
  8. package/dist/protocols/rdp/caps.js +0 -1
  9. package/dist/protocols/rdp/cert.d.ts +18 -0
  10. package/dist/protocols/rdp/cert.js +0 -1
  11. package/dist/protocols/rdp/client.d.ts +56 -0
  12. package/dist/protocols/rdp/client.js +0 -1
  13. package/dist/protocols/rdp/cliprdr.d.ts +27 -0
  14. package/dist/protocols/rdp/cliprdr.js +0 -1
  15. package/dist/protocols/rdp/credssp.d.ts +34 -0
  16. package/dist/protocols/rdp/credssp.js +0 -1
  17. package/dist/protocols/rdp/crypto.d.ts +63 -0
  18. package/dist/protocols/rdp/crypto.js +0 -1
  19. package/dist/protocols/rdp/display.d.ts +38 -0
  20. package/dist/protocols/rdp/display.js +0 -1
  21. package/dist/protocols/rdp/gcc.d.ts +23 -0
  22. package/dist/protocols/rdp/gcc.js +0 -1
  23. package/dist/protocols/rdp/keymap.d.ts +9 -0
  24. package/dist/protocols/rdp/keymap.js +0 -1
  25. package/dist/protocols/rdp/mcs.d.ts +40 -0
  26. package/dist/protocols/rdp/mcs.js +0 -1
  27. package/dist/protocols/rdp/ntlm.d.ts +61 -0
  28. package/dist/protocols/rdp/ntlm.js +0 -1
  29. package/dist/protocols/rdp/pdu.d.ts +155 -0
  30. package/dist/protocols/rdp/pdu.js +0 -1
  31. package/dist/protocols/rdp/rail.d.ts +119 -0
  32. package/dist/protocols/rdp/rail.js +0 -1
  33. package/dist/protocols/rdp/rle.d.ts +13 -0
  34. package/dist/protocols/rdp/rle.js +0 -1
  35. package/dist/protocols/rdp/sec.d.ts +59 -0
  36. package/dist/protocols/rdp/sec.js +0 -1
  37. package/dist/protocols/rdp/session.d.ts +62 -0
  38. package/dist/protocols/rdp/session.js +0 -1
  39. package/dist/protocols/rdp/tls.d.ts +18 -0
  40. package/dist/protocols/rdp/tls.js +0 -1
  41. package/dist/protocols/rdp/vchannel.d.ts +28 -0
  42. package/dist/protocols/rdp/vchannel.js +0 -1
  43. package/dist/protocols/rdp/x224.d.ts +40 -0
  44. package/dist/protocols/rdp/x224.js +0 -1
  45. package/dist/protocols/ssh/kex.d.ts +97 -0
  46. package/dist/protocols/ssh/kex.js +0 -1
  47. package/dist/protocols/ssh/messages.d.ts +50 -0
  48. package/dist/protocols/ssh/messages.js +0 -1
  49. package/dist/protocols/ssh/session.d.ts +66 -0
  50. package/dist/protocols/ssh/session.js +0 -1
  51. package/dist/protocols/ssh/terminal.d.ts +46 -0
  52. package/dist/protocols/ssh/terminal.js +0 -1
  53. package/dist/protocols/ssh/transport.d.ts +62 -0
  54. package/dist/protocols/ssh/transport.js +0 -1
  55. package/dist/protocols/ssh/wire.d.ts +52 -0
  56. package/dist/protocols/ssh/wire.js +0 -1
  57. package/dist/protocols/types.d.ts +127 -0
  58. package/dist/protocols/types.js +0 -1
  59. package/dist/protocols/vnc/input.d.ts +5 -0
  60. package/dist/protocols/vnc/input.js +0 -1
  61. package/dist/protocols/vnc/session.d.ts +12 -0
  62. package/dist/protocols/vnc/session.js +0 -1
  63. package/dist/shared/connection.d.ts +81 -0
  64. package/dist/shared/connection.js +0 -1
  65. package/dist/shared/device.d.ts +26 -0
  66. package/dist/shared/device.js +0 -1
  67. package/dist/shared/hosts.d.ts +63 -0
  68. package/dist/shared/hosts.js +0 -1
  69. package/dist/shared/icons.d.ts +46 -0
  70. package/dist/shared/icons.js +0 -1
  71. package/dist/shared/protocol.d.ts +28 -0
  72. package/dist/shared/protocol.js +0 -1
  73. package/dist/shared/signals.d.ts +37 -0
  74. package/dist/shared/signals.js +0 -1
  75. package/package.json +10 -11
  76. package/dist/index.js.map +0 -7
  77. package/dist/protocols/index.js.map +0 -7
  78. package/dist/protocols/rdp/buffer.js.map +0 -7
  79. package/dist/protocols/rdp/caps.js.map +0 -7
  80. package/dist/protocols/rdp/cert.js.map +0 -7
  81. package/dist/protocols/rdp/client.js.map +0 -7
  82. package/dist/protocols/rdp/cliprdr.js.map +0 -7
  83. package/dist/protocols/rdp/credssp.js.map +0 -7
  84. package/dist/protocols/rdp/crypto.js.map +0 -7
  85. package/dist/protocols/rdp/display.js.map +0 -7
  86. package/dist/protocols/rdp/gcc.js.map +0 -7
  87. package/dist/protocols/rdp/keymap.js.map +0 -7
  88. package/dist/protocols/rdp/mcs.js.map +0 -7
  89. package/dist/protocols/rdp/ntlm.js.map +0 -7
  90. package/dist/protocols/rdp/pdu.js.map +0 -7
  91. package/dist/protocols/rdp/rail.js.map +0 -7
  92. package/dist/protocols/rdp/rle.js.map +0 -7
  93. package/dist/protocols/rdp/sec.js.map +0 -7
  94. package/dist/protocols/rdp/session.js.map +0 -7
  95. package/dist/protocols/rdp/tls.js.map +0 -7
  96. package/dist/protocols/rdp/vchannel.js.map +0 -7
  97. package/dist/protocols/rdp/x224.js.map +0 -7
  98. package/dist/protocols/ssh/kex.js.map +0 -7
  99. package/dist/protocols/ssh/messages.js.map +0 -7
  100. package/dist/protocols/ssh/session.js.map +0 -7
  101. package/dist/protocols/ssh/terminal.js.map +0 -7
  102. package/dist/protocols/ssh/transport.js.map +0 -7
  103. package/dist/protocols/ssh/wire.js.map +0 -7
  104. package/dist/protocols/types.js.map +0 -7
  105. package/dist/protocols/vnc/input.js.map +0 -7
  106. package/dist/protocols/vnc/session.js.map +0 -7
  107. package/dist/shared/connection.js.map +0 -7
  108. package/dist/shared/device.js.map +0 -7
  109. package/dist/shared/hosts.js.map +0 -7
  110. package/dist/shared/icons.js.map +0 -7
  111. package/dist/shared/protocol.js.map +0 -7
  112. package/dist/shared/signals.js.map +0 -7
  113. package/src/cli/cli.ts +0 -462
  114. package/src/cli/daemon.ts +0 -306
  115. package/src/cli/framebuffer.ts +0 -115
  116. package/src/cli/generated/viewer-bundle.ts +0 -5
  117. package/src/cli/ipc.ts +0 -78
  118. package/src/cli/native/window.swift +0 -151
  119. package/src/cli/paths.ts +0 -28
  120. package/src/cli/png.ts +0 -106
  121. package/src/cli/session.ts +0 -263
  122. package/src/cli/shell.ts +0 -184
  123. package/src/cli/transport.ts +0 -86
  124. package/src/cli/viewer-client/assets.d.ts +0 -4
  125. package/src/cli/viewer-client/main.ts +0 -323
  126. package/src/cli/viewer-page.ts +0 -138
  127. package/src/cli/viewer.ts +0 -296
  128. package/src/cli/window.ts +0 -140
  129. package/src/cli/wsserver.ts +0 -144
  130. package/src/protocols/index.ts +0 -72
  131. package/src/protocols/rdp/buffer.ts +0 -204
  132. package/src/protocols/rdp/caps.ts +0 -304
  133. package/src/protocols/rdp/cert.ts +0 -190
  134. package/src/protocols/rdp/client.ts +0 -1371
  135. package/src/protocols/rdp/cliprdr.ts +0 -344
  136. package/src/protocols/rdp/credssp.ts +0 -319
  137. package/src/protocols/rdp/crypto.ts +0 -416
  138. package/src/protocols/rdp/display.ts +0 -750
  139. package/src/protocols/rdp/gcc.ts +0 -162
  140. package/src/protocols/rdp/keymap.ts +0 -68
  141. package/src/protocols/rdp/mcs.ts +0 -283
  142. package/src/protocols/rdp/ntlm.ts +0 -380
  143. package/src/protocols/rdp/pdu.ts +0 -497
  144. package/src/protocols/rdp/rail.ts +0 -480
  145. package/src/protocols/rdp/rle.ts +0 -343
  146. package/src/protocols/rdp/sec.ts +0 -184
  147. package/src/protocols/rdp/session.ts +0 -393
  148. package/src/protocols/rdp/tls.ts +0 -452
  149. package/src/protocols/rdp/vchannel.ts +0 -89
  150. package/src/protocols/rdp/x224.ts +0 -139
  151. package/src/protocols/ssh/kex.ts +0 -227
  152. package/src/protocols/ssh/messages.ts +0 -54
  153. package/src/protocols/ssh/session.ts +0 -879
  154. package/src/protocols/ssh/terminal.ts +0 -242
  155. package/src/protocols/ssh/transport.ts +0 -745
  156. package/src/protocols/ssh/wire.ts +0 -220
  157. package/src/protocols/types.ts +0 -146
  158. package/src/protocols/vnc/input.ts +0 -13
  159. package/src/protocols/vnc/novnc.d.ts +0 -75
  160. package/src/protocols/vnc/session.ts +0 -367
  161. package/src/shared/connection.ts +0 -206
  162. package/src/shared/device.ts +0 -28
  163. package/src/shared/hosts.ts +0 -240
  164. package/src/shared/icons.ts +0 -49
  165. package/src/shared/protocol.ts +0 -55
  166. package/src/shared/signals.ts +0 -67
@@ -0,0 +1,155 @@
1
+ import { Reader } from './buffer';
2
+ export declare const PDU_TYPE: {
3
+ DEMAND_ACTIVE: number;
4
+ CONFIRM_ACTIVE: number;
5
+ DEACTIVATE_ALL: number;
6
+ DATA: number;
7
+ SERVER_REDIRECT: number;
8
+ };
9
+ export declare const PDU_TYPE2: {
10
+ UPDATE: number;
11
+ CONTROL: number;
12
+ POINTER: number;
13
+ INPUT: number;
14
+ SYNCHRONIZE: number;
15
+ REFRESH_RECT: number;
16
+ PLAY_SOUND: number;
17
+ SUPPRESS_OUTPUT: number;
18
+ SHUTDOWN_REQUEST: number;
19
+ SHUTDOWN_DENIED: number;
20
+ SAVE_SESSION_INFO: number;
21
+ FONT_LIST: number;
22
+ FONT_MAP: number;
23
+ SET_ERROR_INFO: number;
24
+ MONITOR_LAYOUT: number;
25
+ };
26
+ export declare const UPDATE_TYPE: {
27
+ ORDERS: number;
28
+ BITMAP: number;
29
+ PALETTE: number;
30
+ SYNCHRONIZE: number;
31
+ };
32
+ export declare const CONTROL_ACTION: {
33
+ REQUEST_CONTROL: number;
34
+ GRANTED_CONTROL: number;
35
+ DETACH: number;
36
+ COOPERATE: number;
37
+ };
38
+ export declare const INPUT_EVENT: {
39
+ SYNC: number;
40
+ SCANCODE: number;
41
+ UNICODE: number;
42
+ MOUSE: number;
43
+ MOUSEX: number;
44
+ };
45
+ export declare const KEYBOARD_FLAG: {
46
+ EXTENDED: number;
47
+ DOWN: number;
48
+ RELEASE: number;
49
+ };
50
+ export declare const POINTER_FLAG: {
51
+ WHEEL: number;
52
+ HWHEEL: number;
53
+ WHEEL_NEGATIVE: number;
54
+ MOVE: number;
55
+ DOWN: number;
56
+ BUTTON1: number;
57
+ BUTTON2: number;
58
+ BUTTON3: number;
59
+ };
60
+ /** Translate browser-style wheel direction to the signed RDP rotation flags. */
61
+ export declare function pointerWheelFlags(delta: number, horizontal?: boolean): number;
62
+ export declare const TOGGLE_FLAG: {
63
+ SCROLL_LOCK: number;
64
+ NUM_LOCK: number;
65
+ CAPS_LOCK: number;
66
+ KANA_LOCK: number;
67
+ };
68
+ export declare function errorInfoMessage(errorInfo: any): any;
69
+ /** TS_SHARECONTROLHEADER + payload. */
70
+ export declare function shareControlPdu(pduType: any, userId: number, payload: Uint8Array): Uint8Array<ArrayBufferLike>;
71
+ /** TS_SHAREDATAHEADER inside a share control PDU of type DATA. */
72
+ export declare function shareDataPdu(shareId: number, userId: number, pduType2: any, payload: Uint8Array): Uint8Array<ArrayBufferLike>;
73
+ /**
74
+ * Client Info PDU (MS-RDPBCGR 2.2.1.11). The credential lengths sit in front of
75
+ * the strings, so the strings are written to a scratch buffer first.
76
+ */
77
+ export declare function clientInfoPdu({ domain, username, password, performanceFlags, autoLogon, remoteApp }: {
78
+ autoLogon: any;
79
+ domain: any;
80
+ password: any;
81
+ performanceFlags: any;
82
+ remoteApp?: boolean;
83
+ username: any;
84
+ }): Uint8Array<ArrayBufferLike>;
85
+ export declare function synchronizePdu(targetUser: any): Uint8Array<ArrayBufferLike>;
86
+ export declare function controlPdu(action: any): Uint8Array<ArrayBufferLike>;
87
+ export declare function fontListPdu(): Uint8Array<ArrayBufferLike>;
88
+ export declare function confirmActivePdu(shareId: number, capabilities: any, capabilityCount: any): Uint8Array<ArrayBufferLike>;
89
+ /** TS_INPUT_PDU_DATA: a batch of input events sharing one header. */
90
+ export declare function inputEventsPdu(events: any): Uint8Array<ArrayBufferLike>;
91
+ export declare function scancodeEvent(scancode: any, pressed: boolean, extended: any): Uint8Array<ArrayBufferLike>;
92
+ export declare function unicodeEvent(codeUnit: any, pressed: boolean): Uint8Array<ArrayBufferLike>;
93
+ export declare function mouseEvent(flags: number, x: number, y: number): Uint8Array<ArrayBufferLike>;
94
+ export declare function extendedMouseEvent(flags: number, x: number, y: number): Uint8Array<ArrayBufferLike>;
95
+ export declare function syncEvent(toggleFlags: number): Uint8Array<ArrayBufferLike>;
96
+ export declare function refreshRectPdu(rects: any): Uint8Array<ArrayBufferLike>;
97
+ export declare function suppressOutputPdu(allowDisplayUpdates: any, rect: any): Uint8Array<ArrayBufferLike>;
98
+ export declare function parseShareControlHeader(bytes: Uint8Array): {
99
+ totalLength: number;
100
+ pduType: number;
101
+ pduSource: number;
102
+ payload: Uint8Array<ArrayBufferLike>;
103
+ };
104
+ export declare function parseShareDataHeader(bytes: Uint8Array): {
105
+ shareId: number;
106
+ pduType2: number;
107
+ compressedType: number;
108
+ compressedLength: number;
109
+ payload: Uint8Array<ArrayBufferLike>;
110
+ };
111
+ export declare function parseDemandActive(bytes: Uint8Array): {
112
+ shareId: number;
113
+ capabilities: Uint8Array<ArrayBufferLike>;
114
+ };
115
+ export declare function parseBitmapUpdate(reader: Reader): any[];
116
+ export declare function parsePaletteUpdate(reader: Reader): Uint8Array<ArrayBuffer>;
117
+ export declare function parsePointerUpdate(reader: Reader): {
118
+ kind: string;
119
+ cacheIndex: number;
120
+ hotSpotX: number;
121
+ hotSpotY: number;
122
+ width: number;
123
+ height: number;
124
+ xorBpp: any;
125
+ xorMask: Uint8Array<ArrayBuffer>;
126
+ andMask: Uint8Array<ArrayBuffer>;
127
+ } | {
128
+ kind: string;
129
+ x: number;
130
+ y: number;
131
+ hidden?: undefined;
132
+ cacheIndex?: undefined;
133
+ messageType?: undefined;
134
+ } | {
135
+ x?: undefined;
136
+ y?: undefined;
137
+ kind: string;
138
+ hidden: boolean;
139
+ cacheIndex?: undefined;
140
+ messageType?: undefined;
141
+ } | {
142
+ x?: undefined;
143
+ y?: undefined;
144
+ hidden?: undefined;
145
+ kind: string;
146
+ cacheIndex: number;
147
+ messageType?: undefined;
148
+ } | {
149
+ x?: undefined;
150
+ y?: undefined;
151
+ hidden?: undefined;
152
+ cacheIndex?: undefined;
153
+ kind: string;
154
+ messageType: number;
155
+ };
@@ -441,4 +441,3 @@ export {
441
441
  synchronizePdu,
442
442
  unicodeEvent
443
443
  };
444
- //# sourceMappingURL=pdu.js.map
@@ -0,0 +1,119 @@
1
+ import { Reader } from './buffer';
2
+ export declare const RAIL_ORDER: {
3
+ EXEC: number;
4
+ ACTIVATE: number;
5
+ SYSPARAM: number;
6
+ SYSCOMMAND: number;
7
+ HANDSHAKE: number;
8
+ WINDOW_MOVE: number;
9
+ CLIENT_STATUS: number;
10
+ EXEC_RESULT: number;
11
+ HANDSHAKE_EX: number;
12
+ };
13
+ export declare const RAIL_EXEC_RESULT: {
14
+ 0: string;
15
+ 1: string;
16
+ 2: string;
17
+ 3: string;
18
+ 5: string;
19
+ 6: string;
20
+ 7: string;
21
+ };
22
+ /** WM_SYSCOMMAND values a RAIL client may ask the host to apply to a window. */
23
+ export declare const SYS_COMMAND: {
24
+ MINIMIZE: number;
25
+ MAXIMIZE: number;
26
+ CLOSE: number;
27
+ RESTORE: number;
28
+ };
29
+ /** SW_* show states reported by a window order's ShowState field. */
30
+ export declare const SHOW_STATE: {
31
+ HIDDEN: number;
32
+ MINIMIZED: number;
33
+ MAXIMIZED: number;
34
+ NORMAL: number;
35
+ };
36
+ export declare const WINDOW_ORDER: {
37
+ TYPE_WINDOW: number;
38
+ STATE_NEW: number;
39
+ STATE_DELETED: number;
40
+ ICON: number;
41
+ CACHED_ICON: number;
42
+ };
43
+ export declare function railHandshake(buildNumber?: number): Uint8Array<ArrayBufferLike>;
44
+ export declare function railClientStatus(flags?: number): Uint8Array<ArrayBufferLike>;
45
+ /**
46
+ * SPI_SETWORKAREA. This is how a RAIL client tells the host how much room it
47
+ * has, and the host maximizes remote windows into it. Sending it again during
48
+ * the session is what keeps a maximized window matched to the browser window.
49
+ */
50
+ export declare function railWorkArea(width: number, height: number): Uint8Array<ArrayBufferLike>;
51
+ export declare function railSystemParameters(width: number, height: number): Uint8Array<ArrayBufferLike>[];
52
+ /** TS_RAIL_ORDER_ACTIVATE: give (or take) input focus for one remote window. */
53
+ export declare function railActivate(windowId: number, enabled?: boolean): Uint8Array<ArrayBufferLike>;
54
+ /** TS_RAIL_ORDER_SYSCOMMAND: minimize, maximize, restore or close a window. */
55
+ export declare function railSysCommand(windowId: number, command: string): Uint8Array<ArrayBufferLike>;
56
+ /**
57
+ * TS_RAIL_ORDER_WINDOWMOVE. A client that draws remote windows itself sends
58
+ * this when the user finishes moving or resizing one; the host then applies
59
+ * the rectangle to the real window. It is the only way to give a remote window
60
+ * an exact size, which is what fitting one to the browser viewport needs.
61
+ */
62
+ export declare function railWindowMove(windowId: number, { left, top, right, bottom }: {
63
+ bottom: any;
64
+ left: any;
65
+ right: any;
66
+ top: any;
67
+ }): Uint8Array<ArrayBufferLike>;
68
+ /** Build TS_RAIL_ORDER_EXEC. Strings are UTF-16LE and are not terminated. */
69
+ export declare function railExecute({ program, workingDir, arguments: args }: {
70
+ arguments?: string;
71
+ program: any;
72
+ workingDir?: string;
73
+ }): Uint8Array<ArrayBufferLike>;
74
+ /**
75
+ * True for a window the session exists to show: not a child, not a tool
76
+ * window, and not one of the never-activated popups a Chromium or Electron
77
+ * application creates for menus, tooltips and drag images.
78
+ */
79
+ export declare function isPrimaryWindow(candidate: any): boolean;
80
+ /**
81
+ * Parse the window lifecycle subset of TS_UPDATE_ORDERS_PDU_DATA.
82
+ *
83
+ * RemoteApp window orders are Alternate Secondary orders and, unlike ordinary
84
+ * drawing orders, carry their total size in every header. That lets the parser
85
+ * read the fields it understands and then seek to the next order, rather than
86
+ * having to understand every icon, notification and desktop order to stay in
87
+ * sync with the stream.
88
+ */
89
+ export declare function parseRemoteAppWindowOrders(reader: Reader): any[];
90
+ /** Parse one or more complete RAIL PDUs delivered in a channel message. */
91
+ export declare function parseRailPdus(bytes: Uint8Array): any[];
92
+ /**
93
+ * Minimal RAIL endpoint for the browser client. It deliberately suppresses
94
+ * icon orders because the browser currently presents the RemoteApp session in
95
+ * one canvas rather than creating a local OS window per remote window.
96
+ */
97
+ export declare class RailChannel {
98
+ private readonly application;
99
+ private width;
100
+ private height;
101
+ private readonly send;
102
+ private readonly onReady;
103
+ private readonly onResult;
104
+ private started;
105
+ constructor({ application, width, height, send, onReady, onResult }: {
106
+ application: any;
107
+ height: any;
108
+ onReady: any;
109
+ onResult: any;
110
+ send: any;
111
+ width: any;
112
+ });
113
+ receive(bytes: Uint8Array): void;
114
+ /** Republish the client's work area, which is what maximize resizes into. */
115
+ setWorkArea(width: number, height: number): boolean;
116
+ activate(windowId: number): boolean;
117
+ sysCommand(windowId: number, command: string): boolean;
118
+ moveWindow(windowId: number, rectangle: any): boolean;
119
+ }
@@ -380,4 +380,3 @@ export {
380
380
  railWindowMove,
381
381
  railWorkArea
382
382
  };
383
- //# sourceMappingURL=rail.js.map
@@ -0,0 +1,13 @@
1
+ export declare function rleDecompress(src: Uint8Array, width: number, height: number, bytesPerPixel: number): Uint32Array<ArrayBuffer>;
2
+ /**
3
+ * Reverse the row order of a decoded rectangle. RDP stores bitmaps bottom-up
4
+ * and a canvas expects top-down, so without this every rectangle is painted
5
+ * upside down.
6
+ */
7
+ export declare function flipRows(pixels: Uint8Array, width: number): Uint32Array<ArrayBuffer> | Uint8Array<ArrayBufferLike>;
8
+ /** Read uncompressed bitmap data, which RDP stores bottom-up. */
9
+ export declare function readUncompressed(src: Uint8Array, width: number, height: number, bytesPerPixel: number): Uint32Array<ArrayBuffer>;
10
+ /** Expand raw pixel values into RGBA for putImageData. */
11
+ export declare function pixelsToRgba(pixels: Uint8Array, bitsPerPixel: number, palette: Uint32Array): Uint8ClampedArray<ArrayBuffer>;
12
+ /** Decode one TS_BITMAP_DATA rectangle to RGBA. */
13
+ export declare function decodeBitmapRect(rect: BitmapRect, palette: Uint32Array): Uint8ClampedArray<ArrayBuffer>;
@@ -273,4 +273,3 @@ export {
273
273
  readUncompressed,
274
274
  rleDecompress
275
275
  };
276
- //# sourceMappingURL=rle.js.map
@@ -0,0 +1,59 @@
1
+ import { concatBytes } from './buffer';
2
+ export declare const SEC_FLAG: {
3
+ EXCHANGE_PKT: number;
4
+ TRANSPORT_REQ: number;
5
+ ENCRYPT: number;
6
+ RESET_SEQNO: number;
7
+ IGNORE_SEQNO: number;
8
+ INFO_PKT: number;
9
+ LICENSE_PKT: number;
10
+ LICENSE_ENCRYPT_CS: number;
11
+ REDIRECTION_PKT: number;
12
+ SECURE_CHECKSUM: number;
13
+ AUTODETECT_REQ: number;
14
+ AUTODETECT_RSP: number;
15
+ HEARTBEAT: number;
16
+ };
17
+ export declare class SecurityLayer {
18
+ #private;
19
+ private encryptionMethod;
20
+ private encryptionLevel;
21
+ private keys;
22
+ private encryptState;
23
+ private decryptState;
24
+ private encryptedPdus;
25
+ private decryptedPdus;
26
+ constructor();
27
+ /** True when data PDUs carry a basic security header at all. */
28
+ get headerPresent(): boolean;
29
+ get encryptionEnabled(): boolean;
30
+ configure(encryptionMethod: number, encryptionLevel: number, clientRandom: Uint8Array, serverRandom: Uint8Array): void;
31
+ /**
32
+ * Prefix a payload with the basic security header, signing and encrypting it
33
+ * when the negotiated level asks for that.
34
+ *
35
+ * `flags` carries the PDU-kind bits (SEC_INFO_PKT and friends). A payload with
36
+ * no flags and no encryption needs no header at all.
37
+ */
38
+ wrap(payload: Uint8Array, flags?: number): Uint8Array<ArrayBufferLike>;
39
+ /**
40
+ * Strip (and if needed decrypt) the basic security header from a host PDU.
41
+ * `headerMandatory` forces the header to be read even when the host reported
42
+ * no encryption, which licensing PDUs require.
43
+ */
44
+ unwrap(bytes: Uint8Array, headerMandatory?: boolean): {
45
+ flags: number;
46
+ payload: Uint8Array<ArrayBufferLike>;
47
+ };
48
+ /**
49
+ * Fast-path output carries the same signature and RC4 stream as a slow-path
50
+ * PDU, but without the basic security header in front of it.
51
+ */
52
+ decryptFastPath(payload: Uint8Array): Uint8Array<ArrayBufferLike>;
53
+ /**
54
+ * Security Exchange PDU (MS-RDPBCGR 2.2.1.10): the client random encrypted
55
+ * with the host public key, followed by eight bytes of padding.
56
+ */
57
+ static securityExchange(encryptedClientRandom: any): Uint8Array<ArrayBufferLike>;
58
+ }
59
+ export { concatBytes };
@@ -153,4 +153,3 @@ export {
153
153
  SecurityLayer,
154
154
  concatBytes
155
155
  };
156
- //# sourceMappingURL=sec.js.map
@@ -0,0 +1,62 @@
1
+ import type { ProtocolDriver } from '../types';
2
+ export declare class RdpSession extends EventTarget {
3
+ #private;
4
+ readonly protocol: 'rdp';
5
+ constructor(container: any, url: string, options?: {});
6
+ /**
7
+ * Ask the host to size the remote application's window to the room this
8
+ * session has on the page. Full-desktop sessions have nothing to do here:
9
+ * their size is fixed when the connection is negotiated.
10
+ */
11
+ fitToViewport(): any;
12
+ get connected(): boolean;
13
+ get canvas(): HTMLCanvasElement | null;
14
+ /** The workspace instruments this socket for byte counters and keepalives. */
15
+ get socket(): WebSocket | null;
16
+ get _sock(): {
17
+ _websocket: any;
18
+ };
19
+ get scaleViewport(): any;
20
+ set scaleViewport(enabled: any);
21
+ get viewOnly(): any;
22
+ set viewOnly(enabled: any);
23
+ /**
24
+ * The on-screen keyboard and the special-keys dialog call this with an X11
25
+ * keysym and a DOM code. RDP wants a scancode, so the code decides; the
26
+ * keysym is only a fallback for characters with no key of their own.
27
+ */
28
+ sendKey(keysym: any, code: number, pressed: boolean): void;
29
+ sendCtrlAltDel(): void;
30
+ /** Desktop pixels. Returns false when the session cannot accept input. */
31
+ movePointer(x: number, y: number): boolean;
32
+ clickPointer(x: number, y: number, button?: number): boolean;
33
+ pointerButton(x: number, y: number, button?: number, pressed?: boolean): boolean;
34
+ scrollPointer(x: number, y: number, delta: {
35
+ x: number;
36
+ y: number;
37
+ }): boolean;
38
+ /** Type a run of characters, which RDP carries as Unicode rather than keys. */
39
+ typeText(text: string): boolean;
40
+ /** What the canvas is showing, for a screen capture or a coordinate check. */
41
+ get screenGeometry(): {
42
+ width: any;
43
+ height: any;
44
+ viewport: any;
45
+ };
46
+ /**
47
+ * Hand text to the host's clipboard, falling back to typing it when the host
48
+ * declined the clipboard channel -- xrdp builds often do.
49
+ */
50
+ clipboardPasteFrom(text: string): void;
51
+ /**
52
+ * Deliver text into the session, which is what the clipboard drawer's button
53
+ * has always visibly done. `clipboardPasteFrom` only loads the clipboard, the
54
+ * way noVNC's method of that name does.
55
+ */
56
+ pasteText(text: string): any;
57
+ releaseKeyboard(): void;
58
+ /** True once the host has agreed to share its clipboard. */
59
+ get clipboardShared(): any;
60
+ disconnect(): void;
61
+ }
62
+ export declare const rdpDriver: ProtocolDriver;
@@ -304,4 +304,3 @@ export {
304
304
  RdpSession,
305
305
  rdpDriver
306
306
  };
307
- //# sourceMappingURL=session.js.map
@@ -0,0 +1,18 @@
1
+ export declare class Tls12Client {
2
+ #private;
3
+ /**
4
+ * @param {(bytes: Uint8Array) => void} send write raw bytes to the transport
5
+ * @param {(bytes: Uint8Array) => void} onData decrypted application data
6
+ * @param {(error: Error) => void} onError fatal protocol failure
7
+ */
8
+ constructor({ send, onData, onError }: {
9
+ onData: any;
10
+ onError: any;
11
+ send: any;
12
+ });
13
+ start(): Promise<any>;
14
+ /** Feed transport bytes. Calls are serialized, so order is preserved. */
15
+ receive(bytes: Uint8Array): any;
16
+ /** Send application data once the handshake has completed. */
17
+ write(plaintext: Uint8Array): any;
18
+ }
@@ -351,4 +351,3 @@ class Tls12Client {
351
351
  export {
352
352
  Tls12Client
353
353
  };
354
- //# sourceMappingURL=tls.js.map
@@ -0,0 +1,28 @@
1
+ /** Channel option bits used when the channel is declared in Client Network Data. */
2
+ export declare const CHANNEL_OPTION: {
3
+ INITIALIZED: number;
4
+ ENCRYPT_RDP: number;
5
+ COMPRESS_RDP: number;
6
+ SHOW_PROTOCOL: number;
7
+ };
8
+ export declare const CHANNEL_FLAG_SHOW_PROTOCOL = 16;
9
+ /** What RDP itself uses; a host may accept more, but never needs to. */
10
+ export declare const CHANNEL_CHUNK_LENGTH = 1600;
11
+ /**
12
+ * Split one logical channel message into wire chunks, each already carrying its
13
+ * CHANNEL_PDU_HEADER. An empty message still produces one chunk, because the
14
+ * header is what tells the host anything happened at all.
15
+ */
16
+ export declare function chunkChannelData(data: Uint8Array, chunkSize?: number, extraFlags?: number): any[];
17
+ /**
18
+ * Reassemble inbound chunks into whole messages. A chunk that arrives without a
19
+ * preceding FIRST is treated as its own message rather than dropped: some hosts
20
+ * send small PDUs with both flags set and others with neither.
21
+ */
22
+ export declare class ChannelReassembler {
23
+ private parts;
24
+ private expectedLength;
25
+ constructor();
26
+ /** Returns the completed message, or null while more chunks are pending. */
27
+ push(bytes: Uint8Array): Uint8Array<ArrayBufferLike>;
28
+ }
@@ -56,4 +56,3 @@ export {
56
56
  ChannelReassembler,
57
57
  chunkChannelData
58
58
  };
59
- //# sourceMappingURL=vchannel.js.map
@@ -0,0 +1,40 @@
1
+ export declare const TPKT_VERSION = 3;
2
+ export declare const TPKT_HEADER_LENGTH = 4;
3
+ export declare const NEG_FAILURE: {
4
+ SSL_REQUIRED: number;
5
+ SSL_NOT_ALLOWED: number;
6
+ SSL_CERT_NOT_ON_SERVER: number;
7
+ INCONSISTENT_FLAGS: number;
8
+ HYBRID_REQUIRED: number;
9
+ SSL_WITH_USER_AUTH_REQUIRED: number;
10
+ };
11
+ export declare const NEG_PROTOCOL: {
12
+ RDP: number;
13
+ SSL: number;
14
+ HYBRID: number;
15
+ RDSTLS: number;
16
+ HYBRID_EX: number;
17
+ };
18
+ /** X.224 Connection Request, carrying the protocols this client will accept. */
19
+ export declare function connectionRequest(requestedProtocols: number): Uint8Array<ArrayBufferLike>;
20
+ /**
21
+ * Read the X.224 Connection Confirm. Throws with the host's own explanation
22
+ * when it refuses the requested protocol.
23
+ */
24
+ export declare function parseConnectionConfirm(frame: Uint8Array): {
25
+ selectedProtocol: number;
26
+ negotiated: boolean;
27
+ };
28
+ /** Wrap a payload in TPKT + X.224 Data. */
29
+ export declare function dataFrame(payload: Uint8Array): Uint8Array<ArrayBufferLike>;
30
+ /** Strip TPKT + X.224 Data headers from a complete frame. */
31
+ export declare function dataPayload(frame: Uint8Array): Uint8Array<ArrayBufferLike>;
32
+ /**
33
+ * Split a byte stream into whole frames. RDP interleaves two framings on one
34
+ * connection: TPKT (first byte 0x03) and fast-path output (any other value),
35
+ * each with its own length encoding.
36
+ */
37
+ export declare function splitFrames(buffer: Uint8Array): {
38
+ frames: any[];
39
+ rest: Uint8Array<ArrayBufferLike>;
40
+ };
@@ -107,4 +107,3 @@ export {
107
107
  parseConnectionConfirm,
108
108
  splitFrames
109
109
  };
110
- //# sourceMappingURL=x224.js.map
@@ -0,0 +1,97 @@
1
+ /** Key exchange methods, best first. All of them hash with SHA-256. */
2
+ export declare const KEX_ALGORITHMS: {
3
+ 'curve25519-sha256': {
4
+ type: string;
5
+ hash: string;
6
+ };
7
+ 'curve25519-sha256@libssh.org': {
8
+ type: string;
9
+ hash: string;
10
+ };
11
+ 'ecdh-sha2-nistp256': {
12
+ type: string;
13
+ curve: string;
14
+ hash: string;
15
+ };
16
+ };
17
+ /**
18
+ * Host key signature algorithms. `keyType` is what appears inside the key blob;
19
+ * a modern RSA key is signed with SHA-256 or SHA-512 but still calls itself
20
+ * ssh-rsa, so the two names differ there.
21
+ */
22
+ export declare const HOST_KEY_ALGORITHMS: {
23
+ 'ssh-ed25519': {
24
+ keyType: string;
25
+ kind: string;
26
+ };
27
+ 'rsa-sha2-512': {
28
+ keyType: string;
29
+ kind: string;
30
+ hash: string;
31
+ };
32
+ 'rsa-sha2-256': {
33
+ keyType: string;
34
+ kind: string;
35
+ hash: string;
36
+ };
37
+ 'ecdsa-sha2-nistp256': {
38
+ keyType: string;
39
+ kind: string;
40
+ curve: string;
41
+ hash: string;
42
+ };
43
+ };
44
+ /**
45
+ * What this browser can actually do. X25519 and Ed25519 are recent additions to
46
+ * Web Crypto, so they are probed rather than assumed; the NIST curve and RSA
47
+ * have been there all along and always keep the session possible.
48
+ */
49
+ export declare function negotiableAlgorithms(): Promise<any>;
50
+ /** The client half of one key exchange. */
51
+ export declare function createKexClient(algorithmName: string): Promise<{
52
+ hash: any;
53
+ publicKey: Uint8Array<ArrayBuffer>;
54
+ sharedSecret(serverPublicKey: any): Promise<Uint8Array<ArrayBuffer>>;
55
+ }>;
56
+ /** The key type named inside a host key blob, which the algorithm must match. */
57
+ export declare function hostKeyType(keyBlob: Uint8Array): string;
58
+ /** The SHA256:… fingerprint OpenSSH prints, so a user can compare it. */
59
+ export declare function hostKeyFingerprint(keyBlob: Uint8Array): Promise<string>;
60
+ /**
61
+ * Check that the host owns the key it presented, by verifying its signature
62
+ * over the exchange hash. A failure here is fatal: it is what stands between
63
+ * the session and a machine in the middle of it.
64
+ */
65
+ export declare function verifyHostKeySignature({ algorithm, keyBlob, signatureBlob, exchangeHash }: {
66
+ algorithm: any;
67
+ exchangeHash: any;
68
+ keyBlob: any;
69
+ signatureBlob: any;
70
+ }): Promise<boolean>;
71
+ /**
72
+ * The exchange hash H (RFC 4253 section 8), which both sides compute from the
73
+ * same inputs and the host signs.
74
+ */
75
+ export declare function exchangeHash({ hash, clientVersion, serverVersion, clientKexInit, serverKexInit, hostKeyBlob, clientPublicKey, serverPublicKey, sharedSecret, }: {
76
+ clientKexInit: any;
77
+ clientPublicKey: any;
78
+ clientVersion: any;
79
+ hash: any;
80
+ hostKeyBlob: any;
81
+ serverKexInit: any;
82
+ serverPublicKey: any;
83
+ serverVersion: any;
84
+ sharedSecret: any;
85
+ }): Promise<Uint8Array<ArrayBuffer>>;
86
+ /**
87
+ * Derive one key from the exchange (RFC 4253 section 7.2), extending it with
88
+ * further hash rounds when the cipher wants more bytes than one digest.
89
+ */
90
+ export declare function deriveKey({ hash, sharedSecret, exchangeHash: h, letter, sessionId, length }: {
91
+ exchangeHash: any;
92
+ hash: any;
93
+ length: any;
94
+ letter: any;
95
+ sessionId: any;
96
+ sharedSecret: any;
97
+ }): Promise<Uint8Array<ArrayBuffer>>;
@@ -174,4 +174,3 @@ export {
174
174
  negotiableAlgorithms,
175
175
  verifyHostKeySignature
176
176
  };
177
- //# sourceMappingURL=kex.js.map