fraim-hub 2.0.332 → 2.0.333

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.
@@ -80,7 +80,7 @@ function probeCommandResolvesNonInteractively(runner, commandName) {
80
80
  result = null;
81
81
  }
82
82
  else {
83
- const r = (0, child_process_1.spawnSync)('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command', `Get-Command -Name ${JSON.stringify(commandName)} -ErrorAction Stop`], { encoding: 'utf8', timeout: NON_INTERACTIVE_PROBE_TIMEOUT_MS });
83
+ const r = (0, child_process_1.spawnSync)('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command', `Get-Command -Name ${JSON.stringify(commandName)} -ErrorAction Stop`], { encoding: 'utf8', timeout: NON_INTERACTIVE_PROBE_TIMEOUT_MS, windowsHide: true });
84
84
  result = r.error || r.status !== 0
85
85
  ? `Command '${commandName}' not found in non-interactive PowerShell (powershell -NoProfile). ` +
86
86
  `This command may be a PowerShell profile function or alias that is unavailable without a profile. ` +
@@ -92,6 +92,7 @@ function probeCommandResolvesNonInteractively(runner, commandName) {
92
92
  const r = (0, child_process_1.spawnSync)('bash', ['--noprofile', '--norc', '-c', `command -v ${commandName}`], {
93
93
  encoding: 'utf8',
94
94
  timeout: NON_INTERACTIVE_PROBE_TIMEOUT_MS,
95
+ windowsHide: true,
95
96
  });
96
97
  result = r.error || r.status !== 0
97
98
  ? `Command '${commandName}' not found in non-interactive bash (bash --noprofile --norc). ` +
@@ -34,6 +34,7 @@ exports.detectCodexCompactTaskFailure = detectCodexCompactTaskFailure;
34
34
  exports.describeSpawnError = describeSpawnError;
35
35
  exports.hostDefaultUnsetEnv = hostDefaultUnsetEnv;
36
36
  exports.buildHostSpawnEnv = buildHostSpawnEnv;
37
+ exports.spawnHostProcess = spawnHostProcess;
37
38
  exports.findGeminiSessionIdForPrompt = findGeminiSessionIdForPrompt;
38
39
  exports.checkFraimMcpAttachReadiness = checkFraimMcpAttachReadiness;
39
40
  const crypto_1 = require("crypto");
@@ -134,7 +134,7 @@ function writeWindowsShortcutScript(lnkPath, target, workingDir = os_1.default.h
134
134
  '$sc.Save()',
135
135
  ].join('; ');
136
136
  try {
137
- (0, child_process_1.execFileSync)('powershell', ['-NoProfile', '-NonInteractive', '-Command', ps], { stdio: 'pipe' });
137
+ (0, child_process_1.execFileSync)('powershell', ['-NoProfile', '-NonInteractive', '-Command', ps], { stdio: 'pipe', windowsHide: true });
138
138
  }
139
139
  catch {
140
140
  // PowerShell unavailable (e.g. minimal CI image) — write a plain .cmd launcher as fallback.
@@ -3176,14 +3176,17 @@ class AiHubServer {
3176
3176
  resolveRunProjectPath(bodyProjectPath, scope) {
3177
3177
  return (0, run_working_directory_1.resolveRunWorkingDirectory)(scope, bodyProjectPath, this.defaultProjectPath());
3178
3178
  }
3179
- // Resolve latest outside the Hub process; sync also updates the MCP launcher record (#1354).
3180
- refreshLocalCatalogInBackground(global, projectRoot) {
3179
+ // Refresh at startup/restart, independently of jobs. Sync also updates the MCP launcher record (#1354).
3180
+ refreshLocalCatalogInBackground() {
3181
3181
  if (process.env.NODE_ENV === 'test' || this.catalogSyncChild)
3182
3182
  return;
3183
- const args = ['--yes', 'fraim@latest', 'sync', ...(global ? ['--global'] : [])];
3183
+ const args = ['--yes', 'fraim@latest', 'sync', '--global'];
3184
3184
  try {
3185
- // Windows npx is a .cmd shim. Only fixed arguments enter cmd; projectRoot stays in cwd.
3186
- const child = catalogSyncSpawn(process.platform === 'win32' ? (process.env.ComSpec || 'cmd.exe') : 'npx', process.platform === 'win32' ? ['/d', '/s', '/c', 'npx', ...args] : args, { cwd: projectRoot, detached: true, stdio: 'ignore', windowsHide: true });
3185
+ // Windows npx is a .cmd shim. Only fixed arguments enter cmd.
3186
+ const child = catalogSyncSpawn(process.platform === 'win32' ? (process.env.ComSpec || 'cmd.exe') : 'npx', process.platform === 'win32' ? ['/d', '/s', '/c', 'npx', ...args] : args,
3187
+ // On Windows, detachment lets descendants allocate visible consoles despite
3188
+ // windowsHide. Ignored stdio and unref still keep this refresh non-blocking.
3189
+ { detached: process.platform !== 'win32', stdio: 'ignore', windowsHide: true });
3187
3190
  this.catalogSyncChild = child;
3188
3191
  const release = () => {
3189
3192
  if (this.catalogSyncChild === child)
@@ -3243,7 +3246,7 @@ class AiHubServer {
3243
3246
  });
3244
3247
  }
3245
3248
  // Refresh the machine-level job list without delaying Hub startup.
3246
- this.refreshLocalCatalogInBackground(true);
3249
+ this.refreshLocalCatalogInBackground();
3247
3250
  // Update-badge freshness: refresh the npm-latest cache on our own clock, not just when
3248
3251
  // a page load or relaunch decision happens to ask for it. Without this, a Hub that's
3249
3252
  // resident in the tray for days with no window reload and no tray re-click never learns
@@ -7051,9 +7054,6 @@ class AiHubServer {
7051
7054
  ? { ...fraimRunEnriched, compareRun: this.enrichRunForResponse(directRun) }
7052
7055
  : fraimRunEnriched;
7053
7056
  res.status(201).json(responsePayload);
7054
- // Background sync: refresh the local FRAIM catalog so the next job
7055
- // picker load sees any jobs that were added or updated since last run.
7056
- this.refreshLocalCatalogInBackground(false, projectPath);
7057
7057
  }
7058
7058
  catch (error) {
7059
7059
  for (const spawningRun of pendingSpawnRuns) {
@@ -44,7 +44,7 @@ function probeVersion(commandPath) {
44
44
  const args = process.platform === 'win32'
45
45
  ? ['/d', '/s', '/c', `${escapeWindowsArg(commandPath)} --version`]
46
46
  : ['--version'];
47
- const result = (0, child_process_1.spawnSync)(executable, args, { encoding: 'utf8', timeout: 5000 });
47
+ const result = (0, child_process_1.spawnSync)(executable, args, { encoding: 'utf8', timeout: 5000, windowsHide: true });
48
48
  if (result.status !== 0 || result.error)
49
49
  return null;
50
50
  // Issue #1256 (AC-D1/D2): only stdout counts as a version — see versionFromProbeOutput.
@@ -93,7 +93,7 @@ function runCommand(command, args, options) {
93
93
  return spawnSync(command, args, options);
94
94
  }
95
95
 
96
- return spawnSync(process.env.ComSpec || 'cmd.exe', ['/d', '/s', '/c', [command, ...args.map(quoteCmdArg)].join(' ')], options);
96
+ return spawnSync(process.env.ComSpec || 'cmd.exe', ['/d', '/s', '/c', [command, ...args.map(quoteCmdArg)].join(' ')], { ...options, windowsHide: true });
97
97
  }
98
98
 
99
99
  function ensureDir(dir) {
@@ -59,7 +59,7 @@ function persistShellPath() {
59
59
  // getUserFraimDirPath() in project-fraim-paths.ts) rather than a
60
60
  // dedicated flag for this call site.
61
61
  if (process.env.FRAIM_TEST_SANDBOX !== '1') {
62
- const result = (0, child_process_1.spawnSync)('powershell', ['-NoProfile', '-NonInteractive', '-Command', psCmd], { encoding: 'utf8', timeout: 10000 });
62
+ const result = (0, child_process_1.spawnSync)('powershell', ['-NoProfile', '-NonInteractive', '-Command', psCmd], { encoding: 'utf8', timeout: 10000, windowsHide: true });
63
63
  if (result.error || result.status !== 0) {
64
64
  throw new Error(`Could not register managed binaries on the User PATH: ${result.error?.message || result.stderr}`);
65
65
  }
@@ -19,6 +19,7 @@ function spawnViaCmdExe(command, args, options) {
19
19
  const cmdString = needsOuterQuote ? `"${innerCmd}"` : innerCmd;
20
20
  return (0, child_process_1.spawnSync)(comSpec, ['/d', '/s', '/c', cmdString], {
21
21
  ...options,
22
+ windowsHide: true,
22
23
  windowsVerbatimArguments: true,
23
24
  });
24
25
  }
@@ -38,6 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.FIRST_RUN_ROW_IDS = exports.FirstRunSessionService = void 0;
40
40
  exports.commandVersion = commandVersion;
41
+ exports.runProcess = runProcess;
41
42
  exports.buildFirstRunHubLaunchArgs = buildFirstRunHubLaunchArgs;
42
43
  const fs_1 = __importDefault(require("fs"));
43
44
  const os_1 = __importDefault(require("os"));
@@ -77,6 +78,7 @@ function commandVersion(command, extraBinDirs, basePath) {
77
78
  const recoveredPath = (0, managed_agent_paths_1.buildRecoveredAgentPath)(pathValue ?? process.env.PATH ?? process.env.Path);
78
79
  const env = { ...process.env, PATH: recoveredPath, Path: recoveredPath };
79
80
  const result = (0, child_process_1.spawnSync)(executable, args, {
81
+ windowsHide: true,
80
82
  encoding: 'utf8',
81
83
  timeout: 5000,
82
84
  env,
@@ -133,6 +135,7 @@ function runProcess(command, args, env) {
133
135
  }
134
136
  const child = (0, child_process_1.spawn)(realCmd, realArgs, {
135
137
  env: childEnv,
138
+ windowsHide: true,
136
139
  shell: false,
137
140
  });
138
141
  let stdout = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim-hub",
3
- "version": "2.0.332",
3
+ "version": "2.0.333",
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",
@@ -221,7 +221,7 @@
221
221
  "electron-updater": "^6.8.9",
222
222
  "express": "^5.2.1",
223
223
  "extract-zip": "^2.0.1",
224
- "fraim": "2.0.332",
224
+ "fraim": "2.0.333",
225
225
  "mongodb": "^7.0.0",
226
226
  "node-cron": "4.2.1",
227
227
  "node-edge-tts": "^1.2.10",