feat(extension): add npm registry support for extension installation

- Add new npm extension installation channel via scoped packages (@scope/name)
- Implement npm.ts module with registry resolution, authentication, and download logic
- Support version pinning, dist-tags (latest, beta), and custom registries
- Handle private registry auth via NPM_TOKEN env var and .npmrc _authToken entries
- Update CLI install command with --registry flag for npm extensions
- Add comprehensive tests for npm package parsing and registry operations
- Update documentation for releasing and installing from npm registries
- Integrate npm updates into extension manager and update checking flow

This enables teams using npm for package distribution to publish Qwen Code extensions through their existing infrastructure, with full support for private registries and access control.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
tanzhenxin 2026-03-27 20:38:35 +08:00
parent 4bacdea01e
commit 3a157d1fec
11 changed files with 907 additions and 12 deletions

View file

@ -227,9 +227,10 @@ export type ExtensionOriginSource = 'QwenCode' | 'Claude' | 'Gemini';
export interface ExtensionInstallMetadata {
source: string;
type: 'git' | 'local' | 'link' | 'github-release';
type: 'git' | 'local' | 'link' | 'github-release' | 'npm';
originSource?: ExtensionOriginSource;
releaseTag?: string; // Only present for github-release installs.
releaseTag?: string; // Only present for github-release and npm installs.
registryUrl?: string; // Only present for npm installs.
ref?: string;
autoUpdate?: boolean;
allowPreRelease?: boolean;