refactor: remove CommonJS launchers and use claude command directly

Remove local Claude launcher scripts and refactor to invoke the global
claude command from PATH. This simplifies the launcher logic and removes
the need to maintain separate CommonJS entry points.

Changes:
- Delete cli/scripts/claude_local_launcher.cjs, claude_remote_launcher.cjs,
  and claude_version_utils.cjs
- Update claudeLocal to spawn 'claude' command directly instead of using
  a launcher script
- Remove runtimePath dependency and launcher existence checks
- Add DISABLE_AUTOUPDATER environment variable for local mode
- Improve error messages when claude command is not found
- Add shell option for Windows compatibility in process spawning
- Remove unused imports from claudeLocal and index files
This commit is contained in:
weishu
2025-12-23 10:21:50 +08:00
parent f132a7dc79
commit 88cce9c28d
8 changed files with 28 additions and 462 deletions
-3
View File
@@ -116,9 +116,6 @@ function unpackTools(runtimeRoot: string): void {
function runtimeAssetsReady(runtimeRoot: string): boolean {
const requiredScripts = [
join(runtimeRoot, 'scripts', 'claude_local_launcher.cjs'),
join(runtimeRoot, 'scripts', 'claude_remote_launcher.cjs'),
join(runtimeRoot, 'scripts', 'claude_version_utils.cjs'),
join(runtimeRoot, 'scripts', 'ripgrep_launcher.cjs')
];
-6
View File
@@ -1,8 +1,5 @@
import { feature } from 'bun:bundle';
import claudeLocalLauncher from '../../scripts/claude_local_launcher.cjs' assert { type: 'file' };
import claudeRemoteLauncher from '../../scripts/claude_remote_launcher.cjs' assert { type: 'file' };
import claudeVersionUtils from '../../scripts/claude_version_utils.cjs' assert { type: 'file' };
import ripgrepLauncher from '../../scripts/ripgrep_launcher.cjs' assert { type: 'file' };
import difftasticArchiveLicense from '../../tools/archives/difftastic-LICENSE' assert { type: 'file' };
@@ -23,9 +20,6 @@ function asset(relativePath: string, sourcePath: string): EmbeddedAsset {
}
const COMMON_ASSETS: EmbeddedAsset[] = [
asset('scripts/claude_local_launcher.cjs', claudeLocalLauncher),
asset('scripts/claude_remote_launcher.cjs', claudeRemoteLauncher),
asset('scripts/claude_version_utils.cjs', claudeVersionUtils),
asset('scripts/ripgrep_launcher.cjs', ripgrepLauncher),
asset('tools/archives/difftastic-LICENSE', difftasticArchiveLicense),
asset('tools/archives/ripgrep-LICENSE', ripgrepArchiveLicense),