@cccarv82/freya 3.7.4 → 3.7.5

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.
Files changed (2) hide show
  1. package/cli/web.js +15 -2
  2. package/package.json +1 -1
package/cli/web.js CHANGED
@@ -970,8 +970,21 @@ function run(cmd, args, cwd, extraEnv, stdinData) {
970
970
  const env = extraEnv ? { ...process.env, ...extraEnv } : process.env;
971
971
 
972
972
  try {
973
- // Use shell: true on all platforms — ensures .cmd/.bat shims (npm globals) are found on Windows
974
- child = spawn(cmd, args, { cwd, shell: true, env, windowsHide: true });
973
+ if (process.platform === 'win32') {
974
+ // Use PowerShell fnm/nvm set PATH only in PowerShell profile,
975
+ // so cmd.exe (shell:true) can't find npm global .cmd shims like copilot.
976
+ // Do NOT use -NoProfile: the profile is what loads fnm/nvm PATH entries.
977
+ const escapedArgs = args.map(a => {
978
+ const escaped = String(a).replace(/'/g, "''");
979
+ return `'${escaped}'`;
980
+ });
981
+ const psCommand = `& '${cmd}' ${escapedArgs.join(' ')}`;
982
+ child = spawn('powershell.exe', [
983
+ '-NoLogo', '-Command', psCommand
984
+ ], { cwd, env, windowsHide: true });
985
+ } else {
986
+ child = spawn(cmd, args, { cwd, shell: true, env });
987
+ }
975
988
  } catch (e) {
976
989
  return resolve({ code: 1, stdout: '', stderr: e.message || String(e) });
977
990
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cccarv82/freya",
3
- "version": "3.7.4",
3
+ "version": "3.7.5",
4
4
  "description": "Personal AI Assistant with local-first persistence",
5
5
  "scripts": {
6
6
  "health": "node scripts/validate-data.js && node scripts/validate-structure.js",