@monoes/cli 1.0.6 → 1.0.7

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.
@@ -51,18 +51,26 @@ const CWD = process.cwd();
51
51
 
52
52
  // Read version from nearest package.json
53
53
  function getVersion() {
54
- const candidates = [
55
- path.join(CWD, 'monobrain', 'package.json'),
56
- path.join(CWD, 'package.json'),
57
- path.join(path.dirname(__filename), '../../package.json'),
54
+ const scriptDir = path.dirname(__filename);
55
+ const walkCandidates = [
56
+ path.join(scriptDir, '..', '..', 'package.json'),
57
+ path.join(scriptDir, '..', '..', '..', 'package.json'),
58
+ path.join(scriptDir, '..', '..', '..', '..', 'package.json'),
58
59
  ];
59
- for (const p of candidates) {
60
+ for (const p of walkCandidates) {
60
61
  try {
61
62
  const pkg = JSON.parse(fs.readFileSync(p, 'utf-8'));
62
- if (pkg.version) return \`v\${pkg.version}\`;
63
+ if (pkg.version && (pkg.name === 'monobrain' || pkg.name === '@monoes/cli' || (pkg.name || '').startsWith('@monobrain'))) {
64
+ return \`v\${pkg.version}\`;
65
+ }
63
66
  } catch { /* ignore */ }
64
67
  }
65
- return 'v1.0.0';
68
+ try {
69
+ const prefix = execSync('npm config get prefix', { encoding: 'utf-8', timeout: 2000 }).trim();
70
+ const pkg = JSON.parse(fs.readFileSync(path.join(prefix, 'lib', 'node_modules', 'monobrain', 'package.json'), 'utf-8'));
71
+ if (pkg.version) return \`v\${pkg.version}\`;
72
+ } catch { /* ignore */ }
73
+ return 'v1.0.6';
66
74
  }
67
75
  const VERSION = getVersion();
68
76
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoes/cli",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "description": "Monobrain CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
6
  "main": "dist/src/index.js",