fraim-hub 2.0.295 → 2.0.296

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.
@@ -35,11 +35,19 @@ const hub_runtime_file_1 = require("./hub-runtime-file");
35
35
  const project_fraim_paths_1 = require("../core/utils/project-fraim-paths");
36
36
  const version_utils_1 = require("../cli/utils/version-utils");
37
37
  const process_liveness_1 = require("./process-liveness");
38
+ // Issue #1415 (follow-up): confirmed live - a kill attempt can fail for a reason other than "the
39
+ // process is already gone." An orphan Hub started from an elevated (Administrator) context could
40
+ // not be terminated by this call running as a standard user - Windows refuses cross-privilege
41
+ // termination, taskkill exits non-zero with "Access is denied," and that failure used to vanish
42
+ // into this catch block with zero trace. There is nothing this function can do about that
43
+ // permission gap (escalating would mean a UAC prompt, defeating the "seamless" goal this whole
44
+ // fix exists for) - but the failure must be visible instead of silently indistinguishable from a
45
+ // successful kill, or a real remaining orphan reads as "the sweep just didn't run."
38
46
  function killPid(pid) {
39
47
  try {
40
48
  if (process.platform === 'win32') {
41
49
  // /T kills the entire process tree; /F forces termination without prompting.
42
- (0, child_process_1.execFileSync)('taskkill', ['/PID', String(pid), '/T', '/F'], { stdio: 'ignore' });
50
+ (0, child_process_1.execFileSync)('taskkill', ['/PID', String(pid), '/T', '/F'], { stdio: 'pipe' });
43
51
  }
44
52
  else {
45
53
  // tree-kill sends SIGTERM to the process group so child Electron helper processes
@@ -47,8 +55,11 @@ function killPid(pid) {
47
55
  (0, tree_kill_1.default)(pid, 'SIGTERM');
48
56
  }
49
57
  }
50
- catch {
51
- /* already gone */
58
+ catch (error) {
59
+ const detail = error instanceof Error && 'stderr' in error
60
+ ? String(error.stderr ?? error.message)
61
+ : String(error);
62
+ console.warn(`[fraim] could not kill pid ${pid} (may already be gone, or may lack permission - e.g. a process started elevated): ${detail.trim()}`);
52
63
  }
53
64
  }
54
65
  function isPortFree(port, timeoutMs = 500) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim-hub",
3
- "version": "2.0.295",
3
+ "version": "2.0.296",
4
4
  "description": "FRAIM Hub local companion package.",
5
5
  "author": "Sid Mathur <sid.mathur@gmail.com>",
6
6
  "homepage": "https://github.com/mathursrus/FRAIM#readme",
@@ -211,7 +211,7 @@
211
211
  "electron-updater": "^6.8.9",
212
212
  "express": "^5.2.1",
213
213
  "extract-zip": "^2.0.1",
214
- "fraim": "2.0.295",
214
+ "fraim": "2.0.296",
215
215
  "mongodb": "^7.0.0",
216
216
  "node-cron": "4.2.1",
217
217
  "node-edge-tts": "^1.2.10",