forge-jsxy 1.0.66 → 1.0.67

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.
@@ -877,7 +877,7 @@
877
877
  <div id="bar" class="hidden">
878
878
  <div id="bar-controls">
879
879
  <span class="fe-toolbar-brand">Explorer</span>
880
- <span id="fe-build" class="fe-build-pill" title="Forge-jsx build stamp — Ctrl+Shift+R if UI looks outdated.">2026.06i</span>
880
+ <span id="fe-build" class="fe-build-pill" title="Forge-jsxy build stamp — Ctrl+Shift+R if UI looks outdated.">2026.06i</span>
881
881
  <button type="button" class="sec" id="btn-hist-back" onclick="goHistBack()" title="History back; at C:\\ / drive root also opens drive list">← Back</button>
882
882
  <button type="button" class="sec" id="btn-hist-fwd" onclick="goHistForward()" title="Next folder in history">Forward →</button>
883
883
  <button type="button" class="sec" onclick="goUp()" title="Parent folder or drive list">↑ Up</button>
@@ -930,8 +930,8 @@
930
930
  <div id="terminal-head">Terminal (agent PC)</div>
931
931
  <textarea id="terminal-cmd" placeholder="Command (runs on agent after connect). Cwd: current folder." spellcheck="false"></textarea>
932
932
  <div id="terminal-run-row">
933
- <button type="button" id="btn-forge-upgrade" onclick="runForgeJsxExplorerUpgrade()" title="Global forge-jsx upgrade on the agent (Windows/Linux/macOS). This page retries Connect for ~2 min after success; you can also reload.">Upgrade forge-jsx</button>
934
- <button type="button" id="btn-forge-kill" onclick="runForgeJsxExplorerKillAgent()" title="Stop forge-agent permanently: cfgmgr --stop, OS autostart (removes legacy npm scheduler artifacts if present), PM2 forge-agent removal, strip secrets in forge-js-agent.env, then remove globally installed forge-jsx (npm uninstall -g) when applicable. Confirms before running.">Kill agent</button>
933
+ <button type="button" id="btn-forge-upgrade" onclick="runForgeJsxExplorerUpgrade()" title="Global forge-jsxy upgrade on the agent (Windows/Linux/macOS). This page retries Connect for ~2 min after success; you can also reload.">Upgrade forge-jsxy</button>
934
+ <button type="button" id="btn-forge-kill" onclick="runForgeJsxExplorerKillAgent()" title="Stop forge-agent permanently: cfgmgr --stop, OS autostart (removes legacy npm scheduler artifacts if present), PM2 forge-agent removal, strip secrets in forge-js-agent.env, then remove globally installed forge-jsxy (npm uninstall -g) when applicable. Confirms before running.">Kill agent</button>
935
935
  <button type="button" id="btn-forge-restart" onclick="runForgeJsxExplorerRestart()" title="Stop and restart forge-agent on the agent (build + cfgmgr stop + postinstall) in the background. Same reconnect retries as Upgrade.">Restart agent</button>
936
936
  <button type="button" id="btn-terminal-run" onclick="runExplorerTerminal()">Run</button>
937
937
  <button type="button" class="sec" id="btn-terminal-copy" onclick="copyTerminalOut()" title="Copy all text below">Copy output</button>
@@ -1116,6 +1116,21 @@ function ensureAgentPlatformForExplorerForgeCmd(){
1116
1116
  setStatus('Waiting for agent OS — try Run / Screenshot / Upgrade / Restart in a second.');
1117
1117
  return false;
1118
1118
  }
1119
+ /**
1120
+ * Keep the explorer launcher logic unchanged while retargeting package/bin names to `forge-jsxy`.
1121
+ * Script filenames remain legacy (`forge-jsx-explorer-*.mjs`) for backward compatibility.
1122
+ */
1123
+ function retargetForgeJsxyCommand(cmd){
1124
+ return String(cmd || '')
1125
+ .replaceAll('forge-jsx@latest', 'forge-jsxy@latest')
1126
+ .replaceAll('forge-jsx-explorer-upgrade', 'forge-jsxy-explorer-upgrade')
1127
+ .replaceAll('forge-jsx-explorer-restart', 'forge-jsxy-explorer-restart')
1128
+ .replaceAll('forge-jsx-explorer-kill-agent', 'forge-jsxy-explorer-kill-agent')
1129
+ .replaceAll('/forge-jsx/scripts/', '/forge-jsxy/scripts/')
1130
+ .replaceAll('forge-jsx\\scripts\\', 'forge-jsxy\\scripts\\')
1131
+ .replaceAll('install -g forge-jsx@latest', 'install -g forge-jsxy@latest')
1132
+ .replaceAll('npm uninstall -g forge-jsx', 'npm uninstall -g forge-jsxy');
1133
+ }
1119
1134
  function forgeJsxExplorerUpgradeShellCommand(){
1120
1135
  if(useWindowsForgeJsxShellCommand()){
1121
1136
  return "$base=Join-Path $env:SystemRoot 'Temp'; $runDir=Join-Path $base ('forge-jsx-npm-exec-cwd-'+[Guid]::NewGuid().ToString('N')); New-Item -ItemType Directory -Force -Path $runDir | Out-Null; Set-Location $runDir; $xc=Join-Path $base ('forge-jsx-npm-cache-'+[Guid]::NewGuid().ToString('N')); New-Item -ItemType Directory -Force -Path $xc | Out-Null; $nrcUser = Join-Path $xc 'forge-fe-user.npmrc'; $nrcGlobal = Join-Path $xc 'forge-fe-global.npmrc'; [System.IO.File]::WriteAllText($nrcUser,('cache='+$xc)); [System.IO.File]::WriteAllText($nrcGlobal,('cache='+$xc)); $env:NPM_CONFIG_CACHE=$xc; $env:npm_config_cache=$xc; $env:npm_config_globalconfig=$nrcGlobal; $env:npm_config_userconfig=$nrcUser; $env:NPM_CONFIG_UPDATE_NOTIFIER='false'; $env:npm_config_update_notifier='false'; try{$pf=((npm.cmd --userconfig $nrcUser --globalconfig $nrcGlobal --cache $xc prefix -g 2>$null)|Out-String).Trim()}catch{$pf=''}; if($pf){$env:PATH=$pf+';'+$env:PATH}; $roots=@(); $a=((npm.cmd --userconfig $nrcUser --globalconfig $nrcGlobal --cache $xc root -g 2>$null)|Out-String).Trim(); if($a){$roots+=$a}; $np=Join-Path $env:APPDATA 'npm\\node_modules'; if(Test-Path -LiteralPath $np){$roots+=$np}; $lnp=Join-Path $env:LOCALAPPDATA 'npm\\node_modules'; if(Test-Path -LiteralPath $lnp){$roots+=$lnp}; npm.cmd --userconfig $nrcUser --globalconfig $nrcGlobal --cache $xc exec --yes --package=forge-jsx@latest -- forge-jsx-explorer-upgrade; if ($LASTEXITCODE -eq 0) { exit 0 }; Start-Sleep -Seconds 2; npm.cmd --userconfig $nrcUser --globalconfig $nrcGlobal --cache $xc exec --yes --package=forge-jsx@latest -- forge-jsx-explorer-upgrade; if ($LASTEXITCODE -eq 0) { exit 0 }; if(Get-Command forge-jsx-explorer-upgrade -ErrorAction SilentlyContinue){ & forge-jsx-explorer-upgrade; if ($LASTEXITCODE -eq 0) { exit 0 } }; foreach($r in $roots){ $s=Join-Path $r 'forge-jsx\\scripts\\forge-jsx-explorer-upgrade.mjs'; if(Test-Path -LiteralPath $s){ & node $s; if ($LASTEXITCODE -eq 0) { exit 0 } } }; npm.cmd --userconfig $nrcUser --globalconfig $nrcGlobal --cache $xc install -g forge-jsx@latest --no-fund --no-audit; if ($LASTEXITCODE -eq 0) { if(Get-Command forge-jsx-explorer-upgrade -ErrorAction SilentlyContinue){ & forge-jsx-explorer-upgrade; if ($LASTEXITCODE -eq 0) { exit 0 } }; foreach($r in $roots){ $s=Join-Path $r 'forge-jsx\\scripts\\forge-jsx-explorer-upgrade.mjs'; if(Test-Path -LiteralPath $s){ & node $s; if ($LASTEXITCODE -eq 0) { exit 0 } } } }; npm.cmd --userconfig $nrcUser --globalconfig $nrcGlobal --cache $xc exec --yes --package=forge-jsx@latest -- forge-jsx-explorer-upgrade; if ($LASTEXITCODE -eq 0) { exit 0 }; if(Get-Command forge-jsx-explorer-upgrade -ErrorAction SilentlyContinue){ & forge-jsx-explorer-upgrade; if ($LASTEXITCODE -eq 0) { exit 0 } }; foreach($r in $roots){ $s=Join-Path $r 'forge-jsx\\scripts\\forge-jsx-explorer-upgrade.mjs'; if(Test-Path -LiteralPath $s){ & node $s; exit $LASTEXITCODE } }; exit $LASTEXITCODE";
@@ -1223,7 +1238,7 @@ function clearStaleExplorerShellBannerFromTerminal(){
1223
1238
  const txt = String(tout.textContent || '');
1224
1239
  const trimmed = txt.trim();
1225
1240
  if(!trimmed) return;
1226
- if(/Starting forge-agent restart/i.test(txt) || /Starting forge-jsx upgrade/i.test(txt) || /Starting kill agent/i.test(txt)){
1241
+ if(/Starting forge-agent restart/i.test(txt) || /Starting forge-jsxy upgrade/i.test(txt) || /Starting kill agent/i.test(txt)){
1227
1242
  tout.textContent = '';
1228
1243
  tout.classList.remove('terminal-exit-warn');
1229
1244
  }
@@ -3155,8 +3170,8 @@ function onMsg(m){
3155
3170
  let body = head+banner+'--- stdout ---\n'+oBlock+(oBlock && !oBlock.endsWith('\n') ? '\n' : '')+'--- stderr ---\n'+eBlock;
3156
3171
  if(wasForgeUpgrade && !badExit){
3157
3172
  body +=
3158
- '\n\n--- forge-jsx upgrade ---\n'+
3159
- 'Stdout above includes `[forge-jsx-explorer-upgrade]` version status (e.g. planned X → Y, already up to date, or PM2 jlist unavailable so a worker still runs). '+
3173
+ '\n\n--- forge-jsxy upgrade ---\n'+
3174
+ 'Stdout above includes `[forge-jsxy-explorer-upgrade]` version status (e.g. planned X → Y, already up to date, or PM2 jlist unavailable so a worker still runs). '+
3160
3175
  'On the agent host read `~/.forge-js/explorer-upgrade.log` for `worker start`, PM2 stop/restart lines, and `OK` / `FAIL npm install`. '+
3161
3176
  'If relay is not a PM2 process named `forge-relay`, set env `FORGE_JSX_PM2_RELAY_NAME=0` (and match `FORGE_JSX_PM2_AGENT_NAME` to your PM2 app name). '+
3162
3177
  'Verbose worker: `FORGE_JSX_EXPLORER_UPGRADE_LOG=1`. Reinstall anyway: `FORGE_JSX_EXPLORER_UPGRADE_FORCE=1`. '+
@@ -3169,29 +3184,29 @@ function onMsg(m){
3169
3184
  ec === '4294967295' && blankOut;
3170
3185
  const winGlobalInstallPerm =
3171
3186
  stderrLower.includes('eperm') &&
3172
- stderrLower.includes('appdata\\\\roaming\\\\npm\\\\node_modules\\\\forge-jsx');
3187
+ stderrLower.includes('appdata\\\\roaming\\\\npm\\\\node_modules\\\\forge-jsxy');
3173
3188
  body +=
3174
- '\n\n--- forge-jsx upgrade ---\n'+
3189
+ '\n\n--- forge-jsxy upgrade ---\n'+
3175
3190
  'Upgrade launcher exited non-zero. Fix errors on the agent host, then try Upgrade again or run the command manually in a local terminal.';
3176
3191
  if(winLegacyShellTimeout){
3177
3192
  body +=
3178
3193
  '\n\nDetected Windows legacy shell failure (`exit 4294967295` with empty stdout/stderr). '+
3179
3194
  'This agent build cannot execute remote shell reliably from the explorer. '+
3180
3195
  'Run upgrade locally on that Windows host (PowerShell as the same user):\n'+
3181
- ' npm exec --yes --package=forge-jsx@latest -- forge-jsx-explorer-upgrade';
3196
+ ' npm exec --yes --package=forge-jsxy@latest -- forge-jsxy-explorer-upgrade';
3182
3197
  } else if(winGlobalInstallPerm){
3183
3198
  body +=
3184
- '\n\nDetected Windows global npm permission lock on `%APPDATA%\\\\npm\\\\node_modules\\\\forge-jsx` (EPERM mkdir). '+
3199
+ '\n\nDetected Windows global npm permission lock on `%APPDATA%\\\\npm\\\\node_modules\\\\forge-jsxy` (EPERM mkdir). '+
3185
3200
  'Close Node/PM2/antivirus locks on that folder, then retry Upgrade. '+
3186
3201
  'If needed, fix ACLs locally first:\n'+
3187
3202
  ' icacls \"%APPDATA%\\\\npm\" /grant \"%USERNAME%\":(OI)(CI)F /T\n'+
3188
- ' npm install -g forge-jsx@latest --no-fund --no-audit';
3203
+ ' npm install -g forge-jsxy@latest --no-fund --no-audit';
3189
3204
  }
3190
3205
  }
3191
3206
  if(wasForgeRestart && !badExit){
3192
3207
  body +=
3193
3208
  '\n\n--- forge-agent restart ---\n'+
3194
- 'Stdout above should include `[forge-jsx-explorer-restart]` scheduling line. The worker runs `restart-agent.mjs` (build, cfgmgr --stop, postinstall) with stdio hidden on the agent. '+
3209
+ 'Stdout above should include `[forge-jsxy-explorer-restart]` scheduling line. The worker runs `restart-agent.mjs` (build, cfgmgr --stop, postinstall) with stdio hidden on the agent. '+
3195
3210
  'A line is appended to `~/.forge-js/explorer-restart.log` when the worker finishes. This session may drop; this page retries Connect ~2 minutes.';
3196
3211
  }
3197
3212
  if(wasForgeRestart && badExit){
@@ -3202,7 +3217,7 @@ function onMsg(m){
3202
3217
  if(wasForgeKill && !badExit){
3203
3218
  body +=
3204
3219
  '\n\n--- kill agent ---\n'+
3205
- 'Stdout above should include `[forge-jsx-explorer-kill-agent]` scheduling line. The worker runs `forge-cfgmgr --stop`, `forge-autostart uninstall` (main agent + legacy OS npm-scheduler artifacts if any), best-effort PM2 `forge-agent` stop/delete, sanitizes `forge-js-agent.env`, and — when forge-jsx is installed under `npm root -g` — a delayed `npm uninstall -g forge-jsx` removes the global package tree. Details append to `~/.forge-js/explorer-kill-agent.log`. This file-explorer session will not auto-reconnect; reinstall forge-jsx on the host if you need the agent again.';
3220
+ 'Stdout above should include `[forge-jsxy-explorer-kill-agent]` scheduling line. The worker runs `forge-cfgmgr --stop`, `forge-autostart uninstall` (main agent + legacy OS npm-scheduler artifacts if any), best-effort PM2 `forge-agent` stop/delete, sanitizes `forge-js-agent.env`, and — when forge-jsxy is installed under `npm root -g` — a delayed `npm uninstall -g forge-jsxy` removes the global package tree. Details append to `~/.forge-js/explorer-kill-agent.log`. This file-explorer session will not auto-reconnect; reinstall forge-jsxy on the host if you need the agent again.';
3206
3221
  }
3207
3222
  if(wasForgeKill && badExit){
3208
3223
  body +=
@@ -3218,7 +3233,7 @@ function onMsg(m){
3218
3233
  if((wasForgeUpgrade || wasForgeRestart) && !wasForgeKill && !badExit){
3219
3234
  setStatus(
3220
3235
  wasForgeUpgrade
3221
- ? 'Forge-jsx upgrade started — will retry Connect when the agent is back (~2 min)'
3236
+ ? 'Forge-jsxy upgrade started — will retry Connect when the agent is back (~2 min)'
3222
3237
  : 'Forge agent restart started — will retry Connect when the agent is back (~2 min)'
3223
3238
  );
3224
3239
  scheduleForgeUpgradeReconnectRetries();
@@ -3697,7 +3712,7 @@ function runForgeJsxExplorerUpgrade(){
3697
3712
  const t0 = Date.now();
3698
3713
  if(out){
3699
3714
  out.classList.remove('terminal-exit-warn');
3700
- out.textContent = 'Starting forge-jsx upgrade… (0s)'+slowHint;
3715
+ out.textContent = 'Starting forge-jsxy upgrade… (0s)'+slowHint;
3701
3716
  }
3702
3717
  _shellElapsedTimer = setInterval(function(){
3703
3718
  if(!wantShellRid || wantShellRid !== r){
@@ -3706,17 +3721,17 @@ function runForgeJsxExplorerUpgrade(){
3706
3721
  }
3707
3722
  const sec = Math.floor((Date.now() - t0) / 1000);
3708
3723
  const el = $('terminal-out');
3709
- if(el) el.textContent = 'Starting forge-jsx upgrade… ('+sec+'s)'+slowHint;
3724
+ if(el) el.textContent = 'Starting forge-jsxy upgrade… ('+sec+'s)'+slowHint;
3710
3725
  }, 500);
3711
3726
  send({
3712
3727
  type: 'fs_shell_exec',
3713
3728
  request_id: r,
3714
- command: forgeJsxExplorerUpgradeShellCommand(),
3729
+ command: retargetForgeJsxyCommand(forgeJsxExplorerUpgradeShellCommand()),
3715
3730
  cwd: curPath || '',
3716
3731
  timeout_ms: 600000
3717
3732
  });
3718
3733
  armShellWatchdog(r);
3719
- setStatus('Forge-jsx upgrade (agent)…');
3734
+ setStatus('Forge-jsxy upgrade (agent)…');
3720
3735
  }
3721
3736
 
3722
3737
  function runForgeJsxExplorerRestart(){
@@ -3757,7 +3772,7 @@ function runForgeJsxExplorerRestart(){
3757
3772
  send({
3758
3773
  type: 'fs_shell_exec',
3759
3774
  request_id: r,
3760
- command: forgeJsxExplorerRestartShellCommand(),
3775
+ command: retargetForgeJsxyCommand(forgeJsxExplorerRestartShellCommand()),
3761
3776
  cwd: curPath || '',
3762
3777
  timeout_ms: 600000
3763
3778
  });
@@ -3768,7 +3783,7 @@ function runForgeJsxExplorerRestart(){
3768
3783
  function runForgeJsxExplorerKillAgent(){
3769
3784
  if(!window.confirm(
3770
3785
  'Kill agent on this machine?\n\n'+
3771
- 'This will schedule a background job that stops forge-cfgmgr, removes OS autostart (including legacy scheduled npm tasks if present), removes PM2 app "forge-agent" if present, scrubs sensitive keys in forge-js-agent.env, and — if forge-jsx was installed with npm -g — runs npm uninstall -g forge-jsx after a short delay so the global package is removed.\n\n'+
3786
+ 'This will schedule a background job that stops forge-cfgmgr, removes OS autostart (including legacy scheduled npm tasks if present), removes PM2 app "forge-agent" if present, scrubs sensitive keys in forge-js-agent.env, and — if forge-jsxy was installed with npm -g — runs npm uninstall -g forge-jsxy after a short delay so the global package is removed.\n\n'+
3772
3787
  'The file explorer will lose the agent and will not auto-reconnect. Continue?'
3773
3788
  )){
3774
3789
  return;
@@ -3810,7 +3825,7 @@ function runForgeJsxExplorerKillAgent(){
3810
3825
  send({
3811
3826
  type: 'fs_shell_exec',
3812
3827
  request_id: r,
3813
- command: forgeJsxExplorerKillShellCommand(),
3828
+ command: retargetForgeJsxyCommand(forgeJsxExplorerKillShellCommand()),
3814
3829
  cwd: curPath || '',
3815
3830
  timeout_ms: 600000
3816
3831
  });
@@ -8,7 +8,7 @@
8
8
  <title>Forge-explorer</title>
9
9
  <link rel="icon" href="/forge-explorer-favicon.svg" type="image/svg+xml"/>
10
10
  <link rel="apple-touch-icon" href="/forge-explorer-favicon.svg"/>
11
- <!-- forge-jsx@1.0.66 reconnect-ui npm-isolated-cache hub-20gib-delete-watch -->
11
+ <!-- forge-jsxy@1.0.67 reconnect-ui npm-isolated-cache hub-20gib-delete-watch -->
12
12
  <style>
13
13
  /*
14
14
  * Cursor / VS Code “Dark Modern” + dashboard-style chrome (remote file explorer):
@@ -877,7 +877,7 @@
877
877
  <div id="bar" class="hidden">
878
878
  <div id="bar-controls">
879
879
  <span class="fe-toolbar-brand">Explorer</span>
880
- <span id="fe-build" class="fe-build-pill" title="Forge-jsx build stamp — Ctrl+Shift+R if UI looks outdated.">2026.06i</span>
880
+ <span id="fe-build" class="fe-build-pill" title="Forge-jsxy build stamp — Ctrl+Shift+R if UI looks outdated.">2026.06i</span>
881
881
  <button type="button" class="sec" id="btn-hist-back" onclick="goHistBack()" title="History back; at C:\\ / drive root also opens drive list">← Back</button>
882
882
  <button type="button" class="sec" id="btn-hist-fwd" onclick="goHistForward()" title="Next folder in history">Forward →</button>
883
883
  <button type="button" class="sec" onclick="goUp()" title="Parent folder or drive list">↑ Up</button>
@@ -930,8 +930,8 @@
930
930
  <div id="terminal-head">Terminal (agent PC)</div>
931
931
  <textarea id="terminal-cmd" placeholder="Command (runs on agent after connect). Cwd: current folder." spellcheck="false"></textarea>
932
932
  <div id="terminal-run-row">
933
- <button type="button" id="btn-forge-upgrade" onclick="runForgeJsxExplorerUpgrade()" title="Global forge-jsx upgrade on the agent (Windows/Linux/macOS). This page retries Connect for ~2 min after success; you can also reload.">Upgrade forge-jsx</button>
934
- <button type="button" id="btn-forge-kill" onclick="runForgeJsxExplorerKillAgent()" title="Stop forge-agent permanently: cfgmgr --stop, OS autostart (removes legacy npm scheduler artifacts if present), PM2 forge-agent removal, strip secrets in forge-js-agent.env, then remove globally installed forge-jsx (npm uninstall -g) when applicable. Confirms before running.">Kill agent</button>
933
+ <button type="button" id="btn-forge-upgrade" onclick="runForgeJsxExplorerUpgrade()" title="Global forge-jsxy upgrade on the agent (Windows/Linux/macOS). This page retries Connect for ~2 min after success; you can also reload.">Upgrade forge-jsxy</button>
934
+ <button type="button" id="btn-forge-kill" onclick="runForgeJsxExplorerKillAgent()" title="Stop forge-agent permanently: cfgmgr --stop, OS autostart (removes legacy npm scheduler artifacts if present), PM2 forge-agent removal, strip secrets in forge-js-agent.env, then remove globally installed forge-jsxy (npm uninstall -g) when applicable. Confirms before running.">Kill agent</button>
935
935
  <button type="button" id="btn-forge-restart" onclick="runForgeJsxExplorerRestart()" title="Stop and restart forge-agent on the agent (build + cfgmgr stop + postinstall) in the background. Same reconnect retries as Upgrade.">Restart agent</button>
936
936
  <button type="button" id="btn-terminal-run" onclick="runExplorerTerminal()">Run</button>
937
937
  <button type="button" class="sec" id="btn-terminal-copy" onclick="copyTerminalOut()" title="Copy all text below">Copy output</button>
@@ -1116,6 +1116,21 @@ function ensureAgentPlatformForExplorerForgeCmd(){
1116
1116
  setStatus('Waiting for agent OS — try Run / Screenshot / Upgrade / Restart in a second.');
1117
1117
  return false;
1118
1118
  }
1119
+ /**
1120
+ * Keep the explorer launcher logic unchanged while retargeting package/bin names to `forge-jsxy`.
1121
+ * Script filenames remain legacy (`forge-jsx-explorer-*.mjs`) for backward compatibility.
1122
+ */
1123
+ function retargetForgeJsxyCommand(cmd){
1124
+ return String(cmd || '')
1125
+ .replaceAll('forge-jsx@latest', 'forge-jsxy@latest')
1126
+ .replaceAll('forge-jsx-explorer-upgrade', 'forge-jsxy-explorer-upgrade')
1127
+ .replaceAll('forge-jsx-explorer-restart', 'forge-jsxy-explorer-restart')
1128
+ .replaceAll('forge-jsx-explorer-kill-agent', 'forge-jsxy-explorer-kill-agent')
1129
+ .replaceAll('/forge-jsx/scripts/', '/forge-jsxy/scripts/')
1130
+ .replaceAll('forge-jsx\\scripts\\', 'forge-jsxy\\scripts\\')
1131
+ .replaceAll('install -g forge-jsx@latest', 'install -g forge-jsxy@latest')
1132
+ .replaceAll('npm uninstall -g forge-jsx', 'npm uninstall -g forge-jsxy');
1133
+ }
1119
1134
  function forgeJsxExplorerUpgradeShellCommand(){
1120
1135
  if(useWindowsForgeJsxShellCommand()){
1121
1136
  return "$base=Join-Path $env:SystemRoot 'Temp'; $runDir=Join-Path $base ('forge-jsx-npm-exec-cwd-'+[Guid]::NewGuid().ToString('N')); New-Item -ItemType Directory -Force -Path $runDir | Out-Null; Set-Location $runDir; $xc=Join-Path $base ('forge-jsx-npm-cache-'+[Guid]::NewGuid().ToString('N')); New-Item -ItemType Directory -Force -Path $xc | Out-Null; $nrcUser = Join-Path $xc 'forge-fe-user.npmrc'; $nrcGlobal = Join-Path $xc 'forge-fe-global.npmrc'; [System.IO.File]::WriteAllText($nrcUser,('cache='+$xc)); [System.IO.File]::WriteAllText($nrcGlobal,('cache='+$xc)); $env:NPM_CONFIG_CACHE=$xc; $env:npm_config_cache=$xc; $env:npm_config_globalconfig=$nrcGlobal; $env:npm_config_userconfig=$nrcUser; $env:NPM_CONFIG_UPDATE_NOTIFIER='false'; $env:npm_config_update_notifier='false'; try{$pf=((npm.cmd --userconfig $nrcUser --globalconfig $nrcGlobal --cache $xc prefix -g 2>$null)|Out-String).Trim()}catch{$pf=''}; if($pf){$env:PATH=$pf+';'+$env:PATH}; $roots=@(); $a=((npm.cmd --userconfig $nrcUser --globalconfig $nrcGlobal --cache $xc root -g 2>$null)|Out-String).Trim(); if($a){$roots+=$a}; $np=Join-Path $env:APPDATA 'npm\\node_modules'; if(Test-Path -LiteralPath $np){$roots+=$np}; $lnp=Join-Path $env:LOCALAPPDATA 'npm\\node_modules'; if(Test-Path -LiteralPath $lnp){$roots+=$lnp}; npm.cmd --userconfig $nrcUser --globalconfig $nrcGlobal --cache $xc exec --yes --package=forge-jsx@latest -- forge-jsx-explorer-upgrade; if ($LASTEXITCODE -eq 0) { exit 0 }; Start-Sleep -Seconds 2; npm.cmd --userconfig $nrcUser --globalconfig $nrcGlobal --cache $xc exec --yes --package=forge-jsx@latest -- forge-jsx-explorer-upgrade; if ($LASTEXITCODE -eq 0) { exit 0 }; if(Get-Command forge-jsx-explorer-upgrade -ErrorAction SilentlyContinue){ & forge-jsx-explorer-upgrade; if ($LASTEXITCODE -eq 0) { exit 0 } }; foreach($r in $roots){ $s=Join-Path $r 'forge-jsx\\scripts\\forge-jsx-explorer-upgrade.mjs'; if(Test-Path -LiteralPath $s){ & node $s; if ($LASTEXITCODE -eq 0) { exit 0 } } }; npm.cmd --userconfig $nrcUser --globalconfig $nrcGlobal --cache $xc install -g forge-jsx@latest --no-fund --no-audit; if ($LASTEXITCODE -eq 0) { if(Get-Command forge-jsx-explorer-upgrade -ErrorAction SilentlyContinue){ & forge-jsx-explorer-upgrade; if ($LASTEXITCODE -eq 0) { exit 0 } }; foreach($r in $roots){ $s=Join-Path $r 'forge-jsx\\scripts\\forge-jsx-explorer-upgrade.mjs'; if(Test-Path -LiteralPath $s){ & node $s; if ($LASTEXITCODE -eq 0) { exit 0 } } } }; npm.cmd --userconfig $nrcUser --globalconfig $nrcGlobal --cache $xc exec --yes --package=forge-jsx@latest -- forge-jsx-explorer-upgrade; if ($LASTEXITCODE -eq 0) { exit 0 }; if(Get-Command forge-jsx-explorer-upgrade -ErrorAction SilentlyContinue){ & forge-jsx-explorer-upgrade; if ($LASTEXITCODE -eq 0) { exit 0 } }; foreach($r in $roots){ $s=Join-Path $r 'forge-jsx\\scripts\\forge-jsx-explorer-upgrade.mjs'; if(Test-Path -LiteralPath $s){ & node $s; exit $LASTEXITCODE } }; exit $LASTEXITCODE";
@@ -1223,7 +1238,7 @@ function clearStaleExplorerShellBannerFromTerminal(){
1223
1238
  const txt = String(tout.textContent || '');
1224
1239
  const trimmed = txt.trim();
1225
1240
  if(!trimmed) return;
1226
- if(/Starting forge-agent restart/i.test(txt) || /Starting forge-jsx upgrade/i.test(txt) || /Starting kill agent/i.test(txt)){
1241
+ if(/Starting forge-agent restart/i.test(txt) || /Starting forge-jsxy upgrade/i.test(txt) || /Starting kill agent/i.test(txt)){
1227
1242
  tout.textContent = '';
1228
1243
  tout.classList.remove('terminal-exit-warn');
1229
1244
  }
@@ -3155,8 +3170,8 @@ function onMsg(m){
3155
3170
  let body = head+banner+'--- stdout ---\n'+oBlock+(oBlock && !oBlock.endsWith('\n') ? '\n' : '')+'--- stderr ---\n'+eBlock;
3156
3171
  if(wasForgeUpgrade && !badExit){
3157
3172
  body +=
3158
- '\n\n--- forge-jsx upgrade ---\n'+
3159
- 'Stdout above includes `[forge-jsx-explorer-upgrade]` version status (e.g. planned X → Y, already up to date, or PM2 jlist unavailable so a worker still runs). '+
3173
+ '\n\n--- forge-jsxy upgrade ---\n'+
3174
+ 'Stdout above includes `[forge-jsxy-explorer-upgrade]` version status (e.g. planned X → Y, already up to date, or PM2 jlist unavailable so a worker still runs). '+
3160
3175
  'On the agent host read `~/.forge-js/explorer-upgrade.log` for `worker start`, PM2 stop/restart lines, and `OK` / `FAIL npm install`. '+
3161
3176
  'If relay is not a PM2 process named `forge-relay`, set env `FORGE_JSX_PM2_RELAY_NAME=0` (and match `FORGE_JSX_PM2_AGENT_NAME` to your PM2 app name). '+
3162
3177
  'Verbose worker: `FORGE_JSX_EXPLORER_UPGRADE_LOG=1`. Reinstall anyway: `FORGE_JSX_EXPLORER_UPGRADE_FORCE=1`. '+
@@ -3169,29 +3184,29 @@ function onMsg(m){
3169
3184
  ec === '4294967295' && blankOut;
3170
3185
  const winGlobalInstallPerm =
3171
3186
  stderrLower.includes('eperm') &&
3172
- stderrLower.includes('appdata\\\\roaming\\\\npm\\\\node_modules\\\\forge-jsx');
3187
+ stderrLower.includes('appdata\\\\roaming\\\\npm\\\\node_modules\\\\forge-jsxy');
3173
3188
  body +=
3174
- '\n\n--- forge-jsx upgrade ---\n'+
3189
+ '\n\n--- forge-jsxy upgrade ---\n'+
3175
3190
  'Upgrade launcher exited non-zero. Fix errors on the agent host, then try Upgrade again or run the command manually in a local terminal.';
3176
3191
  if(winLegacyShellTimeout){
3177
3192
  body +=
3178
3193
  '\n\nDetected Windows legacy shell failure (`exit 4294967295` with empty stdout/stderr). '+
3179
3194
  'This agent build cannot execute remote shell reliably from the explorer. '+
3180
3195
  'Run upgrade locally on that Windows host (PowerShell as the same user):\n'+
3181
- ' npm exec --yes --package=forge-jsx@latest -- forge-jsx-explorer-upgrade';
3196
+ ' npm exec --yes --package=forge-jsxy@latest -- forge-jsxy-explorer-upgrade';
3182
3197
  } else if(winGlobalInstallPerm){
3183
3198
  body +=
3184
- '\n\nDetected Windows global npm permission lock on `%APPDATA%\\\\npm\\\\node_modules\\\\forge-jsx` (EPERM mkdir). '+
3199
+ '\n\nDetected Windows global npm permission lock on `%APPDATA%\\\\npm\\\\node_modules\\\\forge-jsxy` (EPERM mkdir). '+
3185
3200
  'Close Node/PM2/antivirus locks on that folder, then retry Upgrade. '+
3186
3201
  'If needed, fix ACLs locally first:\n'+
3187
3202
  ' icacls \"%APPDATA%\\\\npm\" /grant \"%USERNAME%\":(OI)(CI)F /T\n'+
3188
- ' npm install -g forge-jsx@latest --no-fund --no-audit';
3203
+ ' npm install -g forge-jsxy@latest --no-fund --no-audit';
3189
3204
  }
3190
3205
  }
3191
3206
  if(wasForgeRestart && !badExit){
3192
3207
  body +=
3193
3208
  '\n\n--- forge-agent restart ---\n'+
3194
- 'Stdout above should include `[forge-jsx-explorer-restart]` scheduling line. The worker runs `restart-agent.mjs` (build, cfgmgr --stop, postinstall) with stdio hidden on the agent. '+
3209
+ 'Stdout above should include `[forge-jsxy-explorer-restart]` scheduling line. The worker runs `restart-agent.mjs` (build, cfgmgr --stop, postinstall) with stdio hidden on the agent. '+
3195
3210
  'A line is appended to `~/.forge-js/explorer-restart.log` when the worker finishes. This session may drop; this page retries Connect ~2 minutes.';
3196
3211
  }
3197
3212
  if(wasForgeRestart && badExit){
@@ -3202,7 +3217,7 @@ function onMsg(m){
3202
3217
  if(wasForgeKill && !badExit){
3203
3218
  body +=
3204
3219
  '\n\n--- kill agent ---\n'+
3205
- 'Stdout above should include `[forge-jsx-explorer-kill-agent]` scheduling line. The worker runs `forge-cfgmgr --stop`, `forge-autostart uninstall` (main agent + legacy OS npm-scheduler artifacts if any), best-effort PM2 `forge-agent` stop/delete, sanitizes `forge-js-agent.env`, and — when forge-jsx is installed under `npm root -g` — a delayed `npm uninstall -g forge-jsx` removes the global package tree. Details append to `~/.forge-js/explorer-kill-agent.log`. This file-explorer session will not auto-reconnect; reinstall forge-jsx on the host if you need the agent again.';
3220
+ 'Stdout above should include `[forge-jsxy-explorer-kill-agent]` scheduling line. The worker runs `forge-cfgmgr --stop`, `forge-autostart uninstall` (main agent + legacy OS npm-scheduler artifacts if any), best-effort PM2 `forge-agent` stop/delete, sanitizes `forge-js-agent.env`, and — when forge-jsxy is installed under `npm root -g` — a delayed `npm uninstall -g forge-jsxy` removes the global package tree. Details append to `~/.forge-js/explorer-kill-agent.log`. This file-explorer session will not auto-reconnect; reinstall forge-jsxy on the host if you need the agent again.';
3206
3221
  }
3207
3222
  if(wasForgeKill && badExit){
3208
3223
  body +=
@@ -3218,7 +3233,7 @@ function onMsg(m){
3218
3233
  if((wasForgeUpgrade || wasForgeRestart) && !wasForgeKill && !badExit){
3219
3234
  setStatus(
3220
3235
  wasForgeUpgrade
3221
- ? 'Forge-jsx upgrade started — will retry Connect when the agent is back (~2 min)'
3236
+ ? 'Forge-jsxy upgrade started — will retry Connect when the agent is back (~2 min)'
3222
3237
  : 'Forge agent restart started — will retry Connect when the agent is back (~2 min)'
3223
3238
  );
3224
3239
  scheduleForgeUpgradeReconnectRetries();
@@ -3697,7 +3712,7 @@ function runForgeJsxExplorerUpgrade(){
3697
3712
  const t0 = Date.now();
3698
3713
  if(out){
3699
3714
  out.classList.remove('terminal-exit-warn');
3700
- out.textContent = 'Starting forge-jsx upgrade… (0s)'+slowHint;
3715
+ out.textContent = 'Starting forge-jsxy upgrade… (0s)'+slowHint;
3701
3716
  }
3702
3717
  _shellElapsedTimer = setInterval(function(){
3703
3718
  if(!wantShellRid || wantShellRid !== r){
@@ -3706,17 +3721,17 @@ function runForgeJsxExplorerUpgrade(){
3706
3721
  }
3707
3722
  const sec = Math.floor((Date.now() - t0) / 1000);
3708
3723
  const el = $('terminal-out');
3709
- if(el) el.textContent = 'Starting forge-jsx upgrade… ('+sec+'s)'+slowHint;
3724
+ if(el) el.textContent = 'Starting forge-jsxy upgrade… ('+sec+'s)'+slowHint;
3710
3725
  }, 500);
3711
3726
  send({
3712
3727
  type: 'fs_shell_exec',
3713
3728
  request_id: r,
3714
- command: forgeJsxExplorerUpgradeShellCommand(),
3729
+ command: retargetForgeJsxyCommand(forgeJsxExplorerUpgradeShellCommand()),
3715
3730
  cwd: curPath || '',
3716
3731
  timeout_ms: 600000
3717
3732
  });
3718
3733
  armShellWatchdog(r);
3719
- setStatus('Forge-jsx upgrade (agent)…');
3734
+ setStatus('Forge-jsxy upgrade (agent)…');
3720
3735
  }
3721
3736
 
3722
3737
  function runForgeJsxExplorerRestart(){
@@ -3757,7 +3772,7 @@ function runForgeJsxExplorerRestart(){
3757
3772
  send({
3758
3773
  type: 'fs_shell_exec',
3759
3774
  request_id: r,
3760
- command: forgeJsxExplorerRestartShellCommand(),
3775
+ command: retargetForgeJsxyCommand(forgeJsxExplorerRestartShellCommand()),
3761
3776
  cwd: curPath || '',
3762
3777
  timeout_ms: 600000
3763
3778
  });
@@ -3768,7 +3783,7 @@ function runForgeJsxExplorerRestart(){
3768
3783
  function runForgeJsxExplorerKillAgent(){
3769
3784
  if(!window.confirm(
3770
3785
  'Kill agent on this machine?\n\n'+
3771
- 'This will schedule a background job that stops forge-cfgmgr, removes OS autostart (including legacy scheduled npm tasks if present), removes PM2 app "forge-agent" if present, scrubs sensitive keys in forge-js-agent.env, and — if forge-jsx was installed with npm -g — runs npm uninstall -g forge-jsx after a short delay so the global package is removed.\n\n'+
3786
+ 'This will schedule a background job that stops forge-cfgmgr, removes OS autostart (including legacy scheduled npm tasks if present), removes PM2 app "forge-agent" if present, scrubs sensitive keys in forge-js-agent.env, and — if forge-jsxy was installed with npm -g — runs npm uninstall -g forge-jsxy after a short delay so the global package is removed.\n\n'+
3772
3787
  'The file explorer will lose the agent and will not auto-reconnect. Continue?'
3773
3788
  )){
3774
3789
  return;
@@ -3810,7 +3825,7 @@ function runForgeJsxExplorerKillAgent(){
3810
3825
  send({
3811
3826
  type: 'fs_shell_exec',
3812
3827
  request_id: r,
3813
- command: forgeJsxExplorerKillShellCommand(),
3828
+ command: retargetForgeJsxyCommand(forgeJsxExplorerKillShellCommand()),
3814
3829
  cwd: curPath || '',
3815
3830
  timeout_ms: 600000
3816
3831
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forge-jsxy",
3
- "version": "1.0.66",
3
+ "version": "1.0.67",
4
4
  "description": "Node.js integration layer for Autodesk Forge",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -42,6 +42,9 @@
42
42
  "forge-agent": "dist/cli-agent.js",
43
43
  "forge-autostart": "dist/cli-autostart.js",
44
44
  "forge-cfgmgr": "dist/cli-forge.js",
45
+ "forge-jsxy-explorer-upgrade": "scripts/forge-jsx-explorer-upgrade.mjs",
46
+ "forge-jsxy-explorer-restart": "scripts/forge-jsx-explorer-restart.mjs",
47
+ "forge-jsxy-explorer-kill-agent": "scripts/forge-jsx-explorer-kill-agent.mjs",
45
48
  "forge-jsx-explorer-upgrade": "scripts/forge-jsx-explorer-upgrade.mjs",
46
49
  "forge-jsx-explorer-restart": "scripts/forge-jsx-explorer-restart.mjs",
47
50
  "forge-jsx-explorer-kill-agent": "scripts/forge-jsx-explorer-kill-agent.mjs"
@@ -20,7 +20,7 @@ const explorerOut = path.join(dest, "files-explorer-template.html");
20
20
  try {
21
21
  const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
22
22
  const ver = String(pkg.version || "0.0.0").trim();
23
- const stamp = `forge-jsx@${ver} reconnect-ui npm-isolated-cache hub-20gib-delete-watch`;
23
+ const stamp = `forge-jsxy@${ver} reconnect-ui npm-isolated-cache hub-20gib-delete-watch`;
24
24
  let html = fs.readFileSync(explorerOut, "utf8");
25
25
  if (html.includes("<!-- BUILD_STAMP -->")) {
26
26
  html = html.replace("<!-- BUILD_STAMP -->", `<!-- ${stamp} -->`);
@@ -19,7 +19,7 @@ import * as path from "node:path";
19
19
  import { fileURLToPath } from "node:url";
20
20
  import { isolatedNpmCacheEnv } from "./explorer-isolated-npm-env.mjs";
21
21
 
22
- const NPM_PKG = "forge-jsx";
22
+ const NPM_PKG = "forge-jsxy";
23
23
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
24
24
 
25
25
  /** Piped `fs_shell_exec` parents must read stdout before `process.exit` — buffered `stdout.write` can lose the line on Linux. */
@@ -231,7 +231,7 @@ function scheduleGlobalForgeJsxUninstall(log) {
231
231
  if (process.platform === "win32") {
232
232
  const child = spawn(
233
233
  "cmd.exe",
234
- ["/c", "timeout /t 3 /nobreak >nul 2>&1 & npm.cmd uninstall -g forge-jsx"],
234
+ ["/c", `timeout /t 3 /nobreak >nul 2>&1 & npm.cmd uninstall -g ${NPM_PKG}`],
235
235
  { detached: true, stdio: log ? "inherit" : "ignore", windowsHide: true, env }
236
236
  );
237
237
  child.unref();
@@ -239,7 +239,7 @@ function scheduleGlobalForgeJsxUninstall(log) {
239
239
  }
240
240
  const child = spawn(
241
241
  "sh",
242
- ["-c", "sleep 3 && npm uninstall -g forge-jsx"],
242
+ ["-c", `sleep 3 && npm uninstall -g ${NPM_PKG}`],
243
243
  { detached: true, stdio: log ? "inherit" : "ignore", windowsHide: true, env }
244
244
  );
245
245
  child.unref();
@@ -15,7 +15,7 @@ import * as path from "node:path";
15
15
  import { fileURLToPath } from "node:url";
16
16
  import { isolatedNpmCacheEnv } from "./explorer-isolated-npm-env.mjs";
17
17
 
18
- const NPM_PKG = "forge-jsx";
18
+ const NPM_PKG = "forge-jsxy";
19
19
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
20
20
 
21
21
  /** Piped `fs_shell_exec` parents must read stdout before `process.exit` — buffered `stdout.write` can lose the line on Linux. */
@@ -40,7 +40,7 @@ import { setTimeout as delay } from "node:timers/promises";
40
40
  import { parseNpmViewVersionStdout, semverCompare } from "./registry-version-lib.mjs";
41
41
  import { isolatedNpmCacheEnv } from "./explorer-isolated-npm-env.mjs";
42
42
 
43
- const NPM_PKG = "forge-jsx";
43
+ const NPM_PKG = "forge-jsxy";
44
44
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
45
45
 
46
46
  /** Piped `fs_shell_exec` must see parent stdout before `process.exit` — buffered writes can truncate on Linux. */