@monoes/monomindcli 2.9.13 → 2.9.15

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.
@@ -46,12 +46,25 @@ function getVersion() {
46
46
  }
47
47
  } catch { /* ignore */ }
48
48
  }
49
- // 2. Fallback: npm global prefix
49
+ // 2. Fallback: npm global prefix. Layout differs by platform — npm puts
50
+ // global packages directly under <prefix>/node_modules on Windows, but
51
+ // under <prefix>/lib/node_modules on macOS/Linux. Checking only the Unix
52
+ // shape meant this fallback silently failed on every Windows install,
53
+ // always landing on the hardcoded placeholder below regardless of the
54
+ // actual installed version.
50
55
  try {
51
56
  const { execSync } = require('child_process');
52
57
  const prefix = execSync('npm config get prefix', { encoding: 'utf-8', timeout: 2000 }).trim();
53
- const pkg = JSON.parse(fs.readFileSync(path.join(prefix, 'lib', 'node_modules', 'monomind', 'package.json'), 'utf-8'));
54
- if (pkg.version) return `v${pkg.version}`;
58
+ const prefixCandidates = [
59
+ path.join(prefix, 'node_modules', 'monomind', 'package.json'), // Windows
60
+ path.join(prefix, 'lib', 'node_modules', 'monomind', 'package.json'), // macOS/Linux
61
+ ];
62
+ for (const p of prefixCandidates) {
63
+ try {
64
+ const pkg = JSON.parse(fs.readFileSync(p, 'utf-8'));
65
+ if (pkg.version) return `v${pkg.version}`;
66
+ } catch { /* try next candidate */ }
67
+ }
55
68
  } catch { /* ignore */ }
56
69
  return 'v1.0.6';
57
70
  }
@@ -1458,7 +1471,7 @@ function readMode() {
1458
1471
  // ─── Testability export (when required as a module, not run as CLI) ──────────
1459
1472
  if (require.main !== module) {
1460
1473
  module.exports = {
1461
- readJSON, safeStat, modelLabel,
1474
+ readJSON, safeStat, modelLabel, getVersion,
1462
1475
  getSecurityStatus, getSwarmStatus, getADRStatus,
1463
1476
  getHooksStatus, getActiveAgent, getLanceDBStats,
1464
1477
  getLearningStats, getTestStats, getIntegrationStatus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoes/monomindcli",
3
- "version": "2.9.13",
3
+ "version": "2.9.15",
4
4
  "type": "module",
5
5
  "description": "CLI engine for Monomind — an open-source MCP server that extends Claude Code with a codebase knowledge graph (tree-sitter + SQLite), persistent memory, multi-agent task coordination, and session hooks. Apache 2.0 licensed, fully local.",
6
6
  "main": "dist/src/index.js",
@@ -19,7 +19,12 @@ import { dirname, join } from 'node:path';
19
19
  const pkgDir = join(dirname(fileURLToPath(import.meta.url)), '..');
20
20
  const pkg = JSON.parse(readFileSync(join(pkgDir, 'package.json'), 'utf8'));
21
21
 
22
- const workspaceDeps = Object.entries({ ...pkg.dependencies, ...pkg.devDependencies, ...pkg.peerDependencies })
22
+ const workspaceDeps = Object.entries({
23
+ ...pkg.dependencies,
24
+ ...pkg.devDependencies,
25
+ ...pkg.peerDependencies,
26
+ ...pkg.optionalDependencies,
27
+ })
23
28
  .filter(([, version]) => typeof version === 'string' && version.startsWith('workspace:'))
24
29
  .map(([name]) => name);
25
30