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:
andrepimenta
2026-04-24 21:41:53 +01:00
parent c11224310d
commit 6858f6a6c6
9 changed files with 1330 additions and 83 deletions

View File

@@ -2,7 +2,7 @@
"name": "claude-code-chat",
"displayName": "Chat for Claude Code",
"description": "Beautiful Claude Code Chat Interface for VS Code",
"version": "2.0.6",
"version": "2.0.7",
"publisher": "AndrePimenta",
"author": "Andre Pimenta",
"repository": {
@@ -215,7 +215,9 @@
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src",
"test": "vscode-test"
"test": "vscode-test",
"test:downloader": "npm run compile && mocha --ui tdd \"out/test/downloader*.test.js\" --reporter spec --timeout 360000",
"test:downloader:unit": "npm run compile && mocha --ui tdd out/test/downloader.test.js --reporter spec"
},
"devDependencies": {
"@types/mocha": "^10.0.10",