instar 0.1.2 → 0.1.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.
package/dist/cli.js CHANGED
@@ -25,7 +25,7 @@ const program = new Command();
25
25
  program
26
26
  .name('instar')
27
27
  .description('Persistent autonomy infrastructure for AI agents')
28
- .version('0.1.2')
28
+ .version('0.1.3')
29
29
  .option('--classic', 'Use the classic inquirer-based setup wizard instead of Claude')
30
30
  .action((opts) => runSetup(opts)); // Default: run interactive setup when no subcommand given
31
31
  // ── Setup (explicit alias) ────────────────────────────────────────
@@ -32,18 +32,31 @@ export function detectTmuxPath() {
32
32
  return null;
33
33
  }
34
34
  export function detectClaudePath() {
35
+ const home = process.env.HOME || '';
35
36
  const candidates = [
36
- path.join(process.env.HOME || '', '.claude', 'local', 'claude'),
37
+ path.join(home, '.claude', 'local', 'claude'),
37
38
  '/usr/local/bin/claude',
38
39
  '/opt/homebrew/bin/claude',
39
40
  ];
41
+ // Also check npm global bin directory (where `npm install -g` puts things)
42
+ try {
43
+ const npmPrefix = execSync('npm config get prefix', { encoding: 'utf-8', stdio: 'pipe' }).trim();
44
+ if (npmPrefix) {
45
+ candidates.push(path.join(npmPrefix, 'bin', 'claude'));
46
+ }
47
+ }
48
+ catch { /* ignore */ }
49
+ // Check nvm/fnm managed paths
50
+ if (process.env.NVM_BIN) {
51
+ candidates.push(path.join(process.env.NVM_BIN, 'claude'));
52
+ }
40
53
  for (const candidate of candidates) {
41
54
  if (fs.existsSync(candidate))
42
55
  return candidate;
43
56
  }
44
57
  // Fallback: check PATH
45
58
  try {
46
- const result = execSync('which claude', { encoding: 'utf-8' }).trim();
59
+ const result = execSync('which claude', { encoding: 'utf-8', stdio: 'pipe' }).trim();
47
60
  if (result && fs.existsSync(result))
48
61
  return result;
49
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Persistent autonomy infrastructure for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/cli.ts CHANGED
@@ -29,7 +29,7 @@ const program = new Command();
29
29
  program
30
30
  .name('instar')
31
31
  .description('Persistent autonomy infrastructure for AI agents')
32
- .version('0.1.2')
32
+ .version('0.1.3')
33
33
  .option('--classic', 'Use the classic inquirer-based setup wizard instead of Claude')
34
34
  .action((opts) => runSetup(opts)); // Default: run interactive setup when no subcommand given
35
35
 
@@ -37,19 +37,33 @@ export function detectTmuxPath(): string | null {
37
37
  }
38
38
 
39
39
  export function detectClaudePath(): string | null {
40
+ const home = process.env.HOME || '';
40
41
  const candidates = [
41
- path.join(process.env.HOME || '', '.claude', 'local', 'claude'),
42
+ path.join(home, '.claude', 'local', 'claude'),
42
43
  '/usr/local/bin/claude',
43
44
  '/opt/homebrew/bin/claude',
44
45
  ];
45
46
 
47
+ // Also check npm global bin directory (where `npm install -g` puts things)
48
+ try {
49
+ const npmPrefix = execSync('npm config get prefix', { encoding: 'utf-8', stdio: 'pipe' }).trim();
50
+ if (npmPrefix) {
51
+ candidates.push(path.join(npmPrefix, 'bin', 'claude'));
52
+ }
53
+ } catch { /* ignore */ }
54
+
55
+ // Check nvm/fnm managed paths
56
+ if (process.env.NVM_BIN) {
57
+ candidates.push(path.join(process.env.NVM_BIN, 'claude'));
58
+ }
59
+
46
60
  for (const candidate of candidates) {
47
61
  if (fs.existsSync(candidate)) return candidate;
48
62
  }
49
63
 
50
64
  // Fallback: check PATH
51
65
  try {
52
- const result = execSync('which claude', { encoding: 'utf-8' }).trim();
66
+ const result = execSync('which claude', { encoding: 'utf-8', stdio: 'pipe' }).trim();
53
67
  if (result && fs.existsSync(result)) return result;
54
68
  } catch {
55
69
  // claude not found