subagent-cli 0.2.7 → 0.2.8

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/dist/cli.cjs +16 -13
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env node
2
- // Morph Code launcher delegates to Bun
3
- const { execSync, spawn } = require('child_process');
2
+ const { execFileSync } = require('child_process');
4
3
  const path = require('path');
4
+ const fs = require('fs');
5
5
 
6
6
  const libDir = path.resolve(__dirname, '..');
7
7
  const entry = path.join(libDir, 'src', 'entrypoints', 'cli.tsx');
8
8
  const preload = path.join(libDir, 'stubs', 'globals.ts');
9
9
 
10
- // Ensure node_modules/src symlink exists (resolves 'src/*' imports without tsconfig)
11
- const fs = require('fs');
10
+ // Ensure src symlink for path alias resolution
12
11
  const symlinkPath = path.join(libDir, 'node_modules', 'src');
13
12
  try {
14
13
  if (!fs.existsSync(symlinkPath)) {
@@ -17,21 +16,25 @@ try {
17
16
  }
18
17
  } catch {}
19
18
 
20
- // Find Bun
19
+ // Find bun
21
20
  let bunPath;
22
21
  try {
23
- bunPath = execSync('which bun', { encoding: 'utf-8' }).trim();
22
+ bunPath = execFileSync('which', ['bun'], { encoding: 'utf-8' }).trim();
24
23
  } catch {
25
- console.error('Error: Morph Code requires Bun runtime.');
26
- console.error('Install Bun: curl -fsSL https://bun.sh/install | bash');
27
- process.exit(1);
24
+ // Try common paths
25
+ for (const p of [process.env.HOME + '/.bun/bin/bun', '/usr/local/bin/bun']) {
26
+ if (fs.existsSync(p)) { bunPath = p; break; }
27
+ }
28
+ if (!bunPath) {
29
+ console.error('Error: Morph Code requires Bun. Install: curl -fsSL https://bun.sh/install | bash');
30
+ process.exit(1);
31
+ }
28
32
  }
29
33
 
30
- // Run in the user's cwd no --cwd or --tsconfig-override needed
31
- const child = spawn(bunPath, ['run', '--preload', preload, entry, ...process.argv.slice(2)], {
34
+ // Replace this process with bun (no spawn, no child process overhead)
35
+ const args = [bunPath, 'run', '--preload', preload, entry, ...process.argv.slice(2)];
36
+ require('child_process').execFileSync(bunPath, args.slice(1), {
32
37
  stdio: 'inherit',
33
38
  cwd: process.cwd(),
34
39
  env: process.env,
35
40
  });
36
-
37
- child.on('exit', (code) => process.exit(code ?? 0));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subagent-cli",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "sa — Morph Code CLI (Claude Code fork with multi-provider LLM, WarpGrep, and subagent support)",
5
5
  "type": "module",
6
6
  "bin": {