ai-remote 0.4.8 → 0.4.10

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 (45) hide show
  1. package/README.md +6 -0
  2. package/dist/cli.mjs +17 -6
  3. package/dist/index.d.ts +254 -12
  4. package/dist/protocols.d.ts +349 -0
  5. package/package.json +3 -3
  6. package/dist/protocols/index.d.ts +0 -33
  7. package/dist/protocols/rdp/buffer.d.ts +0 -38
  8. package/dist/protocols/rdp/caps.d.ts +0 -49
  9. package/dist/protocols/rdp/cert.d.ts +0 -18
  10. package/dist/protocols/rdp/client.d.ts +0 -56
  11. package/dist/protocols/rdp/cliprdr.d.ts +0 -27
  12. package/dist/protocols/rdp/credssp.d.ts +0 -34
  13. package/dist/protocols/rdp/crypto.d.ts +0 -63
  14. package/dist/protocols/rdp/display.d.ts +0 -38
  15. package/dist/protocols/rdp/gcc.d.ts +0 -23
  16. package/dist/protocols/rdp/keymap.d.ts +0 -9
  17. package/dist/protocols/rdp/mcs.d.ts +0 -40
  18. package/dist/protocols/rdp/ntlm.d.ts +0 -61
  19. package/dist/protocols/rdp/pdu.d.ts +0 -155
  20. package/dist/protocols/rdp/rail.d.ts +0 -119
  21. package/dist/protocols/rdp/rle.d.ts +0 -13
  22. package/dist/protocols/rdp/sec.d.ts +0 -59
  23. package/dist/protocols/rdp/session.d.ts +0 -62
  24. package/dist/protocols/rdp/tls.d.ts +0 -18
  25. package/dist/protocols/rdp/vchannel.d.ts +0 -28
  26. package/dist/protocols/rdp/x224.d.ts +0 -40
  27. package/dist/protocols/ssh/identity.d.ts +0 -39
  28. package/dist/protocols/ssh/kex.d.ts +0 -97
  29. package/dist/protocols/ssh/messages.d.ts +0 -52
  30. package/dist/protocols/ssh/session.d.ts +0 -67
  31. package/dist/protocols/ssh/terminal.d.ts +0 -46
  32. package/dist/protocols/ssh/transport.d.ts +0 -62
  33. package/dist/protocols/ssh/wire.d.ts +0 -52
  34. package/dist/protocols/types.d.ts +0 -127
  35. package/dist/protocols/vnc/des.d.ts +0 -25
  36. package/dist/protocols/vnc/input.d.ts +0 -5
  37. package/dist/protocols/vnc/keysyms.d.ts +0 -16
  38. package/dist/protocols/vnc/rfb.d.ts +0 -64
  39. package/dist/protocols/vnc/session.d.ts +0 -12
  40. package/dist/shared/connection.d.ts +0 -81
  41. package/dist/shared/device.d.ts +0 -26
  42. package/dist/shared/hosts.d.ts +0 -63
  43. package/dist/shared/icons.d.ts +0 -46
  44. package/dist/shared/protocol.d.ts +0 -32
  45. package/dist/shared/signals.d.ts +0 -37
@@ -1,63 +0,0 @@
1
- export declare function md5(message: Uint8Array): Uint8Array<ArrayBuffer>;
2
- export declare function sha1(message: Uint8Array): Uint8Array<ArrayBuffer>;
3
- /** RC4 keystream position. RDP re-keys every 4096 PDUs, so this is mutable. */
4
- export interface Rc4State {
5
- s: Uint8Array;
6
- i: number;
7
- j: number;
8
- }
9
- /** The five values MS-RDPBCGR 5.3.5 derives from the two randoms. */
10
- export interface SessionKeys {
11
- macKey: Uint8Array;
12
- keyLength: number;
13
- is40Bit: boolean;
14
- initialDecryptKey: Uint8Array;
15
- initialEncryptKey: Uint8Array;
16
- decryptKey: Uint8Array;
17
- encryptKey: Uint8Array;
18
- }
19
- export declare function rc4Init(key: Uint8Array): Rc4State;
20
- /** RC4 is symmetric, so this both encrypts and decrypts. State advances. */
21
- export declare function rc4Crypt(state: any, data: Uint8Array): Uint8Array<ArrayBuffer>;
22
- /**
23
- * Textbook RSA over little-endian buffers, which is what RDP's Security
24
- * Exchange PDU carries: the client random is raised to the server's public
25
- * exponent with no padding scheme (MS-RDPBCGR 5.3.4.1).
26
- */
27
- export declare function rsaEncrypt(dataLe: Uint8Array, modulusLe: Uint8Array, exponentLe: Uint8Array): Uint8Array<ArrayBuffer>;
28
- /**
29
- * RSAES-PKCS1-v1_5 encryption over big-endian buffers, which is what TLS uses
30
- * for an RSA key exchange. WebCrypto only offers OAEP, so the padding is built
31
- * here and the modular exponentiation reuses the same BigInt path as RDP.
32
- */
33
- export declare function rsaEncryptPkcs1(message: Uint8Array, modulusBe: Uint8Array, exponentBe: Uint8Array): Uint8Array<ArrayBuffer>;
34
- export declare const ENCRYPTION_METHOD: {
35
- NONE: number;
36
- BIT_40: number;
37
- BIT_128: number;
38
- BIT_56: number;
39
- FIPS: number;
40
- };
41
- export declare function keyLengthForMethod(encryptionMethod: number): 8 | 16;
42
- /**
43
- * Derive the MAC key and both directional RC4 keys from the two random values
44
- * exchanged during connection.
45
- */
46
- export declare function deriveSessionKeys(clientRandom: Uint8Array, serverRandom: Uint8Array, encryptionMethod: number): {
47
- macKey: Uint8Array<ArrayBuffer>;
48
- keyLength: number;
49
- is40Bit: boolean;
50
- initialDecryptKey: Uint8Array<ArrayBuffer>;
51
- initialEncryptKey: Uint8Array<ArrayBuffer>;
52
- decryptKey: Uint8Array<ArrayBuffer>;
53
- encryptKey: Uint8Array<ArrayBuffer>;
54
- };
55
- /**
56
- * MACSignature = First64Bits(MD5(macKey + Pad2 + SHA1(macKey + Pad1 + len + data)))
57
- */
58
- export declare function macSignature(macKey: any, data: Uint8Array): Uint8Array<ArrayBuffer>;
59
- /**
60
- * Every 4096 PDUs the RC4 key is refreshed from the initial key
61
- * (MS-RDPBCGR 5.3.7.1). The refreshed key is salted with itself.
62
- */
63
- export declare function updateSessionKey(initialKey: any, currentKey: any, keyLength: any, is40Bit: any): Uint8Array<ArrayBuffer>;
@@ -1,38 +0,0 @@
1
- export declare class RdpDisplay {
2
- #private;
3
- constructor(container: any);
4
- resize(width: number, height: number): void;
5
- /**
6
- * Choose the part of the desktop that is on screen. Everything else about
7
- * the session -- painting, input coordinates, the remote pointer -- keeps
8
- * working in desktop coordinates, so only the framing changes here.
9
- */
10
- setViewport({ x, y, width, height }?: {
11
- x?: number;
12
- y?: number;
13
- }): void;
14
- applyScale(): void;
15
- /**
16
- * Zoom about a point, keeping whatever is under it in place. `focal` is in
17
- * client coordinates -- the midpoint between two fingers, usually.
18
- */
19
- setZoom(next: any, focal?: any): void;
20
- /** Move the visible window over the desktop. Returns what it actually used. */
21
- panBy(dx: any, dy: any): {
22
- x: number;
23
- y: number;
24
- };
25
- /** True when the desktop is larger than the window on either axis. */
26
- canPan(): boolean;
27
- setScaleViewport(enabled: boolean): void;
28
- /** Back to the opening view: whole desktop fitted on screen. */
29
- resetZoom(): void;
30
- drawRects(rects: any, palette: any): void;
31
- applyPointer(pointer: any): void;
32
- attachInput(client: any): void;
33
- /** A key held while focus moves away would otherwise stay down on the host. */
34
- releaseAllKeys(): void;
35
- focus(): void;
36
- blur(): void;
37
- destroy(): void;
38
- }
@@ -1,23 +0,0 @@
1
- /** RDP 5.0 and later. Anything newer would oblige us to speak newer PDUs. */
2
- export declare const RDP_VERSION_5_PLUS = 524292;
3
- export declare const ENCRYPTION_LEVEL: {
4
- NONE: number;
5
- LOW: number;
6
- CLIENT_COMPATIBLE: number;
7
- HIGH: number;
8
- FIPS: number;
9
- };
10
- export declare function clientData(options: any): Uint8Array<ArrayBufferLike>;
11
- /**
12
- * Walk the host's answer. Only the security and network blocks carry anything
13
- * the client must act on; the core block is kept for logging.
14
- */
15
- export declare function parseServerData(blocks: any): {
16
- version: any;
17
- encryptionMethod: number;
18
- encryptionLevel: number;
19
- serverRandom: any;
20
- publicKey: any;
21
- ioChannelId: number;
22
- channelIds: any[];
23
- };
@@ -1,9 +0,0 @@
1
- /** Returns { scancode, extended } or null when the key has no RDP equivalent. */
2
- export declare function lookupScancode(code: string): {
3
- scancode: any;
4
- extended: boolean;
5
- };
6
- export declare const CTRL_ALT_DEL: {
7
- code: string;
8
- pressed: boolean;
9
- }[];
@@ -1,40 +0,0 @@
1
- export declare const MCS_BASE_CHANNEL_ID = 1001;
2
- export declare const MCS_GLOBAL_CHANNEL_ID = 1003;
3
- export declare function connectInitial(clientData: Uint8Array): Uint8Array<ArrayBufferLike>;
4
- export declare function parseConnectResponse(frame: Uint8Array): Uint8Array<ArrayBufferLike>;
5
- export declare function erectDomainRequest(): Uint8Array<ArrayBufferLike>;
6
- export declare function attachUserRequest(): Uint8Array<ArrayBufferLike>;
7
- export declare function parseAttachUserConfirm(frame: Uint8Array): {
8
- userId: number;
9
- };
10
- export declare function channelJoinRequest(userId: number, channelId: number): Uint8Array<ArrayBufferLike>;
11
- export declare function parseChannelJoinConfirm(frame: Uint8Array): {
12
- channelId: number;
13
- };
14
- export declare function sendDataRequest(userId: number, channelId: number, payload: Uint8Array): Uint8Array<ArrayBufferLike>;
15
- /**
16
- * Classify an inbound X.224 data frame. Everything the server sends after the
17
- * connect sequence arrives as a send-data indication on some channel.
18
- */
19
- export declare function parseDomainPdu(frame: Uint8Array): {
20
- type: string;
21
- channelId: number;
22
- payload: Uint8Array<ArrayBufferLike>;
23
- reason?: undefined;
24
- message?: undefined;
25
- mcsPduType?: undefined;
26
- } | {
27
- channelId?: undefined;
28
- payload?: undefined;
29
- type: string;
30
- reason: number;
31
- message: any;
32
- mcsPduType?: undefined;
33
- } | {
34
- channelId?: undefined;
35
- payload?: undefined;
36
- reason?: undefined;
37
- message?: undefined;
38
- type: string;
39
- mcsPduType: number;
40
- };
@@ -1,61 +0,0 @@
1
- export declare function md4(message: string): Uint8Array<ArrayBuffer>;
2
- /** HMAC-MD5. WebCrypto has no MD5, so it is built from the MD5 here. */
3
- export declare function hmacMd5(key: Uint8Array, message: string): Uint8Array<ArrayBuffer>;
4
- export declare const NTLM_FLAG: {
5
- UNICODE: number;
6
- REQUEST_TARGET: number;
7
- SIGN: number;
8
- SEAL: number;
9
- NTLM: number;
10
- ALWAYS_SIGN: number;
11
- EXTENDED_SESSION_SECURITY: number;
12
- TARGET_INFO: number;
13
- VERSION: number;
14
- KEY_128: number;
15
- KEY_EXCH: number;
16
- KEY_56: number;
17
- };
18
- export declare function negotiateMessage(): Uint8Array<ArrayBufferLike>;
19
- export declare function parseChallengeMessage(bytes: Uint8Array): {
20
- flags: number;
21
- serverChallenge: Uint8Array<ArrayBuffer>;
22
- targetName: Uint8Array<ArrayBuffer>;
23
- targetInfo: Uint8Array<ArrayBuffer>;
24
- };
25
- /**
26
- * Build the AUTHENTICATE message plus every key CredSSP needs afterwards.
27
- *
28
- * The MIC is always sent: a current Windows host expects one, and sending it
29
- * obliges the client to flag it in the AV pair list, which in turn feeds the
30
- * NTProofStr -- so the modified list has to be the one that goes on the wire.
31
- */
32
- export declare function authenticateMessage({ username, domain, password, challenge, negotiateBytes, challengeBytes }: {
33
- challenge: any;
34
- challengeBytes: any;
35
- domain: any;
36
- negotiateBytes: any;
37
- password: any;
38
- username: any;
39
- }): {
40
- message: Uint8Array<ArrayBufferLike>;
41
- exportedSessionKey: Uint8Array<ArrayBuffer>;
42
- keys: {
43
- clientSigningKey: Uint8Array<ArrayBuffer>;
44
- serverSigningKey: Uint8Array<ArrayBuffer>;
45
- clientSealing: import("./crypto").Rc4State;
46
- serverSealing: import("./crypto").Rc4State;
47
- };
48
- };
49
- /**
50
- * NTLM message confidentiality (MS-NLMP 3.4.3). The signature covers the
51
- * plaintext, and both the payload and the checksum draw from the same RC4
52
- * stream -- payload first.
53
- */
54
- export declare class NtlmSealer {
55
- private readonly keys;
56
- private sendSequence;
57
- private receiveSequence;
58
- constructor(keys: any);
59
- seal(plaintext: Uint8Array): Uint8Array<ArrayBufferLike>;
60
- unseal(bytes: Uint8Array): Uint8Array<ArrayBuffer>;
61
- }
@@ -1,155 +0,0 @@
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
- };
@@ -1,119 +0,0 @@
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
- }
@@ -1,13 +0,0 @@
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>;
@@ -1,59 +0,0 @@
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 };
@@ -1,62 +0,0 @@
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;
@@ -1,18 +0,0 @@
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
- }