mirror of
https://github.com/andrepimenta/claude-code-chat.git
synced 2026-06-01 01:25:28 +08:00
Replace shell-based install with in-process binary downloader
Fetches the platform-specific native binary directly — npm registry first (sha512-verified tarball, streamed through a minimal in-tree tar parser) with the Anthropic CDN as a fallback (sha256-verified raw binary). Writes to context.globalStorageUri/bin/claude[.exe] and auto-sets executable.path so there's no PATH, sudo, PowerShell execution-policy, npm EACCES, or Node-version failure modes left. Adds typed DownloaderError codes (UNSUPPORTED_PLATFORM / NETWORK / INTEGRITY / WRITE / CANCELLED / AGGREGATE) and threads source / version / npmCode / cdnCode into analytics so install failures are finally bucketable instead of collapsed under "the shell command failed". Error messages are scrubbed of user paths to keep analytics PII-free. Fixes a Windows path-with-spaces edge case by skipping cmd.exe shell wrapping when spawning claude with an absolute executable.path. Ships 28 tests: 24 unit (tar parser, platform detection, error helpers) and 4 integration that hit real npm + real CDN end-to-end. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,3 +16,4 @@ node_modules
|
||||
mcp-permissions.js
|
||||
backup-files
|
||||
build
|
||||
**/test/**
|
||||
Reference in New Issue
Block a user