subagent-cli 0.2.5 → 0.2.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.
Files changed (2) hide show
  1. package/dist/cli.cjs +14 -5
  2. package/package.json +3 -2
package/dist/cli.cjs CHANGED
@@ -7,6 +7,16 @@ 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');
12
+ const symlinkPath = path.join(libDir, 'node_modules', 'src');
13
+ try {
14
+ if (!fs.existsSync(symlinkPath)) {
15
+ fs.mkdirSync(path.join(libDir, 'node_modules'), { recursive: true });
16
+ fs.symlinkSync(path.join(libDir, 'src'), symlinkPath);
17
+ }
18
+ } catch {}
19
+
10
20
  // Find Bun
11
21
  let bunPath;
12
22
  try {
@@ -17,12 +27,11 @@ try {
17
27
  process.exit(1);
18
28
  }
19
29
 
20
- // Launch Bun with --cwd pointing to the package root so tsconfig.json
21
- // path aliases (src/*) resolve correctly, but pass the real cwd via env
22
- // so file operations use the user's directory.
23
- const child = spawn(bunPath, ['run', '--cwd', libDir, '--preload', preload, entry, ...process.argv.slice(2)], {
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)], {
24
32
  stdio: 'inherit',
25
- env: { ...process.env, SA_USER_CWD: process.cwd() },
33
+ cwd: process.cwd(),
34
+ env: process.env,
26
35
  });
27
36
 
28
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.5",
3
+ "version": "0.2.7",
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": {
@@ -20,7 +20,8 @@
20
20
  "typecheck": "tsc --noEmit",
21
21
  "test": "vitest --run",
22
22
  "clean": "rm -rf dist",
23
- "start": "bun run --preload ./stubs/globals.ts ./src/entrypoints/cli.tsx"
23
+ "start": "bun run --preload ./stubs/globals.ts ./src/entrypoints/cli.tsx",
24
+ "postinstall": "node -e \"const f=require(\"fs\"),p=require(\"path\");try{const s=p.join(__dirname,\"node_modules\",\"src\");if(!f.existsSync(s)){f.mkdirSync(p.join(__dirname,\"node_modules\"),{recursive:true});f.symlinkSync(p.join(__dirname,\"src\"),s)}}catch{}\""
24
25
  },
25
26
  "dependencies": {
26
27
  "@anthropic-ai/sdk": "^0.80.0",