@cccarv82/freya 3.7.0 → 3.7.3

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.
@@ -44,14 +44,17 @@ function setWorkspaceVersion(workspaceDir, version) {
44
44
  }
45
45
 
46
46
  function needsNpmInstall(workspaceDir) {
47
- // Check if sql.js is installed in the workspace's node_modules
48
- const sqlJsPath = path.join(workspaceDir, 'node_modules', 'sql.js');
49
- try {
50
- fs.accessSync(sqlJsPath);
51
- return false;
52
- } catch {
53
- return true;
47
+ // Check if ALL required dependencies are installed in the workspace's node_modules
48
+ const requiredDeps = ['sql.js', '@huggingface/transformers'];
49
+ for (const dep of requiredDeps) {
50
+ const depPath = path.join(workspaceDir, 'node_modules', dep);
51
+ try {
52
+ fs.accessSync(depPath);
53
+ } catch {
54
+ return true; // At least one dependency missing
55
+ }
54
56
  }
57
+ return false;
55
58
  }
56
59
 
57
60
  function runNpmInstall(workspaceDir) {
@@ -85,8 +88,12 @@ async function autoUpdate(workspaceDir) {
85
88
  const installedVersion = getInstalledVersion();
86
89
  const workspaceVersion = getWorkspaceVersion(workspaceDir);
87
90
 
88
- // Already in sync
91
+ // Already in sync — but still check if deps are missing (e.g. new dep added in same version)
89
92
  if (workspaceVersion === installedVersion) {
93
+ if (needsNpmInstall(workspaceDir)) {
94
+ console.log('[FREYA] Missing workspace dependencies detected, installing...');
95
+ runNpmInstall(workspaceDir);
96
+ }
90
97
  return { updated: false, version: installedVersion };
91
98
  }
92
99
 
package/cli/web.js CHANGED
@@ -909,14 +909,8 @@ function run(cmd, args, cwd, extraEnv, stdinData) {
909
909
  const env = extraEnv ? { ...process.env, ...extraEnv } : process.env;
910
910
 
911
911
  try {
912
- // On Windows, reliably execute CLI tools through cmd.exe.
913
- // This ensures PATH resolution works for tools like copilot, gh, npx, npm.
914
- if (process.platform === 'win32') {
915
- const comspec = process.env.ComSpec || 'cmd.exe';
916
- child = spawn(comspec, ['/d', '/s', '/c', cmd, ...args], { cwd, shell: false, env });
917
- } else {
918
- child = spawn(cmd, args, { cwd, shell: false, env });
919
- }
912
+ // Use shell: true on all platforms ensures .cmd/.bat shims (npm globals) are found on Windows
913
+ child = spawn(cmd, args, { cwd, shell: true, env, windowsHide: true });
920
914
  } catch (e) {
921
915
  return resolve({ code: 1, stdout: '', stderr: e.message || String(e) });
922
916
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cccarv82/freya",
3
- "version": "3.7.0",
3
+ "version": "3.7.3",
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",