subagent-cli 0.2.7 → 0.2.9

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 +22 -11
  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 { spawn, 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,33 @@ 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
+ const home = process.env.HOME || '';
25
+ for (const p of [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
34
+ // Spawn bun with full TTY pass-through
31
35
  const child = spawn(bunPath, ['run', '--preload', preload, entry, ...process.argv.slice(2)], {
32
36
  stdio: 'inherit',
33
37
  cwd: process.cwd(),
34
38
  env: process.env,
35
39
  });
36
40
 
37
- child.on('exit', (code) => process.exit(code ?? 0));
41
+ // Forward signals
42
+ process.on('SIGINT', () => child.kill('SIGINT'));
43
+ process.on('SIGTERM', () => child.kill('SIGTERM'));
44
+
45
+ child.on('exit', (code, signal) => {
46
+ if (signal) process.kill(process.pid, signal);
47
+ else process.exit(code ?? 0);
48
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subagent-cli",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
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": {