Visual Studio Code, rebuilt in Rust
Rust
fix(cli): run the extension commands without opening a window
rokartura775eec642dc
diff --git a/native/crates/app/src/cli.rs b/native/crates/app/src/cli.rsindex 3f3260a7ad8..c1267c349f6 100644--- a/native/crates/app/src/cli.rs+++ b/native/crates/app/src/cli.rs@@ -1,6 +1,7 @@//! code/node/cli.ts, run when `bin/<applicationName>` starts the app binary with `ELECTRON_RUN_AS_NODE=1` (the port of//! resources/darwin/bin/code.sh): help and version, `-` reads stdin into a file, `--wait` waits for a marker file-//! the app deletes once the editors close, and every other command line goes to the app.+//! the app deletes once the editors close, the extension commands run in this process (cli_process.rs), and every+//! other command line goes to the app.use std::io::{IsTerminal, Read, Write};use std::os::unix::fs::OpenOptionsExt;@@ -13,7 +14,7 @@ use crate::argv::{self, OPTIONS};use crate::product;/// `main(argv)`: the process exit code. As cli.js the arguments start after the binary and code.sh's `$CLI`.-pub fn main(process_args: Vec<String>) -> i32 {+pub fn main(process_args: Vec<String>, user_data: &Path, working_dir: &Path) -> i32 {let args = process_args.get(2..).unwrap_or_default();let (parsed, warnings) = match argv::parse_and_validate(args) {Ok(parsed) => parsed,@@ -40,6 +41,15 @@ pub fn main(process_args: Vec<String>) -> i32 {println!("{}", argv::build_version_message(product("version"), product("commit")));return 0;}+ if crate::cli_process::handles(&parsed) {+ return match crate::cli_process::run(&parsed, user_data, working_dir) {+ Ok(()) => 0,+ Err(error) => {+ eprintln!("{error:#}");+ 1+ }+ };+ }let mut argv = args.to_vec();let reads_stdin = parsed.positional.iter().any(|arg| arg == "-");argv.retain(|arg| arg != "-");@@ -259,4 +269,22 @@ mod tests {assert_eq!(std::fs::read_to_string(&path).unwrap(), "Gün");std::fs::remove_file(path).unwrap();}++ #[test]+ fn uninstall_extension_runs_in_the_cli_without_the_app() {+ let root = std::env::temp_dir().join(format!("vsrustium-cli-uninstall-{}", std::process::id()));+ let extensions = root.join("extensions");+ std::fs::create_dir_all(extensions.join("port.sample-1.0.0")).unwrap();+ let manifest = serde_json::json!({ "name": "sample", "publisher": "port", "version": "1.0.0", "engines": { "vscode": "^1.80.0" } });+ std::fs::write(extensions.join("port.sample-1.0.0/package.json"), manifest.to_string()).unwrap();+ let entries = serde_json::json!([{ "identifier": { "id": "port.sample" }, "version": "1.0.0", "relativeLocation": "port.sample-1.0.0" }]);+ std::fs::write(extensions.join("extensions.json"), entries.to_string()).unwrap();++ let args = ["vsrustium", "cli.js", "--uninstall-extension", "port.sample"].map(String::from).to_vec();+ assert_eq!(super::main(args, &root, &root), 0);++ let profile = std::fs::read_to_string(extensions.join("extensions.json")).unwrap();+ std::fs::remove_dir_all(&root).unwrap();+ assert_eq!(profile, "[]", "the extension is uninstalled before the CLI exits");+ }}diff --git a/native/crates/app/src/cli_process.rs b/native/crates/app/src/cli_process.rsnew file mode 100644index 00000000000..93acd7d7178--- /dev/null+++ b/native/crates/app/src/cli_process.rs@@ -0,0 +1,216 @@+//! cliProcessMain.ts `doRun` with extensionManagementCLI.ts: the extension commands on the profile's user extensions,+//! in the CLI process, without a window.++use std::path::{Path, PathBuf};++use anyhow::bail;+use exthost::extension_management::{UserExtensions, gallery_extension_id};+use exthost::extension_validator::semver_version;+use exthost::gallery::{ExtensionInfo, Gallery, Operation};+use exthost::scan::ScannedExtension;++use crate::argv::{ParsedArgs, Value};+use crate::extensions_model::CATEGORIES;+use crate::user_data_profile::UserDataProfilesService;++const USE_ID: &str = "Make sure you use the full extension ID, including the publisher, e.g.: ms-dotnettools.csharp";++/// cli.ts `shouldSpawnCliProcess`, for the commands the port runs.+pub fn handles(args: &ParsedArgs) -> bool {+ ["list-extensions", "install-extension", "uninstall-extension", "update-extensions", "locate-extension"].iter().any(|id| args.flag(id))+}++pub fn run(args: &ParsedArgs, user_data: &Path, working_dir: &Path) -> anyhow::Result<()> {+ let extensions_folder = args.string("extensions-dir").map_or_else(|| user_data.join("extensions"), PathBuf::from);+ let profiles = UserDataProfilesService::load(user_data, &extensions_folder).profiles;+ let profile = match args.string("profile") {+ Some(name) => match profiles.profiles().into_iter().find(|profile| profile.name == name) {+ Some(profile) => profile,+ None => bail!("Profile '{name}' not found."),+ },+ None => profiles.default_profile().clone(),+ };+ let user = UserExtensions { extensions_file: profile.extensions_resource, profiles_home: Some(profiles.profiles_home.clone()), ..UserExtensions::new(extensions_folder, &crate::VERSION) };+ let list = |id: &str| match args.values.get(id) {+ Some(Value::List(values)) => values.clone(),+ _ => Vec::new(),+ };+ if args.flag("list-extensions") {+ return list_extensions(&user, args.flag("show-versions"), args.string("category"));+ }+ if args.flag("install-extension") {+ let downloads = user_data.join("CachedExtensionVSIXs");+ return install_extensions(&user, &list("install-extension"), working_dir, &downloads, args.flag("pre-release"), args.flag("force"));+ }+ if args.flag("uninstall-extension") {+ return uninstall_extensions(&user, &list("uninstall-extension"), working_dir);+ }+ if args.flag("update-extensions") {+ return update_extensions(&user, &user_data.join("CachedExtensionVSIXs"));+ }+ // shortcut: user extensions only, upstream also finds built-ins; scan them here if a tool needs that.+ for extension in user.scan()? {+ if list("locate-extension").contains(&extension.id.to_lowercase()) {+ println!("{}", extension.location.display());+ }+ }+ Ok(())+}++fn list_extensions(user: &UserExtensions, show_versions: bool, category: Option<&str>) -> anyhow::Result<()> {+ let mut extensions = user.scan()?;+ match category {+ Some("") => {+ println!("Possible Categories: ");+ for category in CATEGORIES {+ println!("{}", category.to_lowercase());+ }+ return Ok(());+ }+ Some(category) if !CATEGORIES.iter().any(|known| known.eq_ignore_ascii_case(category)) => {+ println!("Invalid category please enter a valid category. To list valid categories run --category without a category specified");+ return Ok(());+ }+ Some(category) => extensions.retain(|extension| extension.description["categories"].as_array().is_some_and(|categories| categories.iter().any(|known| known.as_str().is_some_and(|known| known.eq_ignore_ascii_case(category))))),+ None => {}+ }+ let mut ids: Vec<(String, &str)> = extensions.iter().map(|extension| (extension.id.to_lowercase(), version(extension))).collect();+ ids.sort();+ for (id, version) in ids {+ println!("{}", if show_versions { format!("{id}@{version}") } else { id });+ }+ Ok(())+}++/// `installExtensions`: VSIX files first, then gallery ids; a failure is logged and the rest still install.+fn install_extensions(user: &UserExtensions, inputs: &[String], working_dir: &Path, downloads: &Path, pre_release: bool, force: bool) -> anyhow::Result<()> {+ println!("Installing extensions...");+ let installed = user.scan()?;+ let mut failed = Vec::new();+ for vsix in inputs.iter().filter(|input| is_vsix(input)) {+ if let Err(error) = install_vsix(user, &working_dir.join(vsix), force, &installed) {+ eprintln!("{error:#}");+ failed.push(working_dir.join(vsix).display().to_string());+ }+ }+ let gallery = Gallery::open_vsx(&crate::VERSION);+ for input in inputs.iter().filter(|input| !is_vsix(input)) {+ if let Err(error) = install_gallery(user, &gallery, input, downloads, pre_release, force, &installed) {+ eprintln!("{error:#}");+ failed.push(crate::workbench::extension_management::id_and_version(input).0);+ }+ }+ if !failed.is_empty() {+ bail!("Failed Installing Extensions: {}", failed.join(", "));+ }+ Ok(())+}++/// `installVSIX` with `validateVSIX`: a newer installed version stays unless `--force`.+fn install_vsix(user: &UserExtensions, vsix: &Path, force: bool, installed: &[ScannedExtension]) -> anyhow::Result<()> {+ let manifest = exthost::extension_management::vsix_manifest(vsix)?;+ let id = gallery_extension_id(&manifest);+ let new_version = manifest["version"].as_str().unwrap_or_default();+ if let Some(existing) = installed.iter().find(|extension| extension.id.eq_ignore_ascii_case(&id))+ && !force+ && semver_version(version(existing)) > semver_version(new_version)+ {+ println!("A newer version of extension '{}' v{} is already installed. Use '--force' option to downgrade to older version.", existing.id.to_lowercase(), version(existing));+ return Ok(());+ }+ user.install_vsix(vsix)?;+ println!("Extension '{}' was successfully installed.", vsix.file_name().unwrap_or_default().to_string_lossy());+ Ok(())+}++/// `installGalleryExtensions` for one `id[@version]`.+fn install_gallery(user: &UserExtensions, gallery: &Gallery, input: &str, downloads: &Path, pre_release: bool, force: bool, installed: &[ScannedExtension]) -> anyhow::Result<()> {+ let (id, version_arg) = crate::workbench::extension_management::id_and_version(input);+ let pre_release = pre_release || version_arg.as_deref() == Some("prerelease");+ let version_arg = version_arg.filter(|version| version != "prerelease");+ let existing = installed.iter().find(|extension| extension.id.eq_ignore_ascii_case(&id));+ if let Some(existing) = existing {+ if !force && version_arg.is_none() {+ println!("Extension '{id}' v{} is already installed. Use '--force' option to update to latest version or provide '@<version>' to install a specific version, for example: '{id}@1.2.3'.", version(existing));+ return Ok(());+ }+ if let Some(wanted) = version_arg.as_deref().filter(|wanted| *wanted == version(existing)) {+ println!("Extension '{id}@{wanted}' is already installed.");+ return Ok(());+ }+ }+ let extension = gallery.installable_extension(&id, version_arg.as_deref(), pre_release).map_err(|error| anyhow::anyhow!("{error:#}\n{USE_ID}"))?;+ let named = version_arg.as_deref().map_or_else(|| id.clone(), |version| format!("{id}@{version}"));+ if let Some(existing) = existing {+ if extension.version == version(existing) {+ println!("Extension '{named}' is already installed.");+ return Ok(());+ }+ println!("Updating the extension '{id}' to the version {}", extension.version);+ }+ match &version_arg {+ Some(version) => println!("Installing extension '{id}' v{version}..."),+ None => println!("Installing extension '{id}'..."),+ }+ let operation = if existing.is_some() { Operation::Update } else { Operation::Install };+ let vsix = gallery.download(&extension, operation, downloads, true)?;+ let local = user.install_gallery(&vsix, &extension).map_err(|error| anyhow::anyhow!("Error while installing extension {id}: {error:#}"))?;+ println!("Extension '{id}' v{} was successfully installed.", version(&local));+ Ok(())+}++/// `updateExtensions`: the gallery extensions with a newer compatible version; a failed update is logged.+fn update_extensions(user: &UserExtensions, downloads: &Path) -> anyhow::Result<()> {+ let installed: Vec<ScannedExtension> = user.scan()?.into_iter().filter(|extension| extension.description["uuid"].is_string()).collect();+ let infos: Vec<ExtensionInfo> = installed+ .iter()+ .map(|extension| ExtensionInfo { id: extension.id.clone(), uuid: extension.description["uuid"].as_str().map(Into::into), version: None, pre_release: extension.description["preRelease"] == true })+ .collect();+ let gallery = Gallery::open_vsx(&crate::VERSION);+ let mut updates = Vec::new();+ for latest in gallery.get_extensions(&infos, true)? {+ let old = installed.iter().find(|extension| extension.id.eq_ignore_ascii_case(&latest.id));+ if old.is_some_and(|old| semver_version(&latest.version) > semver_version(version(old))) {+ updates.push(latest);+ }+ }+ if updates.is_empty() {+ println!("No extension to update");+ return Ok(());+ }+ println!("Updating extensions: {}", updates.iter().map(|update| update.id.as_str()).collect::<Vec<_>>().join(", "));+ for update in updates {+ let updated = gallery.download(&update, Operation::Update, downloads, true).and_then(|vsix| user.install_gallery(&vsix, &update));+ match updated {+ Ok(local) => println!("Extension '{}' v{} was successfully updated.", update.id, version(&local)),+ Err(error) => eprintln!("Error while updating extension {}: {error:#}", update.id),+ }+ }+ Ok(())+}++/// `uninstallExtensions`: a VSIX names the extension its manifest has; the first one not installed ends the command.+fn uninstall_extensions(user: &UserExtensions, inputs: &[String], working_dir: &Path) -> anyhow::Result<()> {+ for input in inputs {+ let id = match is_vsix(input) {+ true => gallery_extension_id(&exthost::extension_management::vsix_manifest(&working_dir.join(input))?),+ false => input.clone(),+ };+ if !user.scan()?.iter().any(|extension| extension.id.eq_ignore_ascii_case(&id)) {+ bail!("Extension '{id}' is not installed.\n{USE_ID}");+ }+ println!("Uninstalling {id}...");+ user.uninstall(&id)?;+ println!("Extension '{id}' was successfully uninstalled!");+ }+ Ok(())+}++/// cliProcessMain.ts `asExtensionIdOrVSIX`.+fn is_vsix(input: &str) -> bool {+ input.to_lowercase().ends_with(".vsix")+}++fn version(extension: &ScannedExtension) -> &str {+ extension.description["version"].as_str().unwrap_or_default()+}diff --git a/native/crates/app/src/main.rs b/native/crates/app/src/main.rsindex bd5f9f32211..62a24dd4da3 100644--- a/native/crates/app/src/main.rs+++ b/native/crates/app/src/main.rs@@ -10,6 +10,7 @@ mod accessibility_signals;mod anything_quick_access;mod argv;mod cli;+mod cli_process;mod backups;mod brackets;mod bulk_edit_preview;@@ -195,7 +196,7 @@ fn main() -> anyhow::Result<()> {encoding_guess::set_app_root(&app_root);// code.sh runs the binary with `ELECTRON_RUN_AS_NODE=1` for cli.js.if std::env::var_os("ELECTRON_RUN_AS_NODE").is_some() {- std::process::exit(cli::main(args));+ std::process::exit(cli::main(args, &user_data, &working_dir));}if args.iter().any(|arg| arg == "--version" || arg == "-v") {println!("{}", argv::build_version_message(product::get("version").as_str(), product::get("commit").as_str()));diff --git a/native/crates/app/src/workbench.rs b/native/crates/app/src/workbench.rsindex bd463cd2645..270e0c13a9d 100644--- a/native/crates/app/src/workbench.rs+++ b/native/crates/app/src/workbench.rs@@ -60,7 +60,7 @@ pub mod editor_status;mod editor_view;mod explorer_actions;pub(crate) mod extension_bisect;-mod extension_management;+pub(crate) mod extension_management;pub(crate) mod extension_host_restart;mod user_data_profile;mod profiles_editor_view;diff --git a/native/crates/app/src/workbench/extension_management.rs b/native/crates/app/src/workbench/extension_management.rsindex d0fe99beb4f..76bbb9ec92b 100644--- a/native/crates/app/src/workbench/extension_management.rs+++ b/native/crates/app/src/workbench/extension_management.rs@@ -372,7 +372,7 @@ impl Workbench {}/// `getIdAndVersion`: `[email protected]` or `publisher.name@prerelease`, the id lowercased.-fn id_and_version(arg: &str) -> (String, Option<String>) {+pub(crate) fn id_and_version(arg: &str) -> (String, Option<String>) {let split = arg.rsplit_once('@').filter(|(id, version)| {let semver = || {let core = version.split_once('-').map_or(*version, |(core, _)| core);diff --git a/native/crates/exthost/src/extension_management.rs b/native/crates/exthost/src/extension_management.rsindex 5e3bc7e3f48..e1c057bf450 100644--- a/native/crates/exthost/src/extension_management.rs+++ b/native/crates/exthost/src/extension_management.rs@@ -76,9 +76,7 @@ impl UserExtensions {}fn install(&self, vsix: &Path, gallery: Option<&GalleryExtension>) -> anyhow::Result<ScannedExtension> {- let archive = Archive::open(std::fs::read(vsix).with_context(|| format!("reading {}", vsix.display()))?)?;- let manifest_entry = archive.entry("extension/package.json").context("extension/package.json not found in zip")?;- let manifest: Value = serde_json::from_slice(&archive.read(manifest_entry)?).map_err(|_| anyhow::anyhow!("VSIX invalid: package.json is not a JSON file."))?;+ let (archive, manifest) = read_vsix(vsix)?;let id = gallery_extension_id(&manifest);let version = manifest["version"].as_str().unwrap_or_default();if let Some(gallery) = gallery@@ -416,6 +414,18 @@ pub fn add_user_extensions(extensions: &mut Vec<ScannedExtension>, user: Vec<Sca}}+/// `getManifest(vsix)`: the VSIX's `extension/package.json`.+pub fn vsix_manifest(vsix: &Path) -> anyhow::Result<Value> {+ Ok(read_vsix(vsix)?.1)+}++fn read_vsix(vsix: &Path) -> anyhow::Result<(Archive, Value)> {+ let archive = Archive::open(std::fs::read(vsix).with_context(|| format!("reading {}", vsix.display()))?)?;+ let manifest_entry = archive.entry("extension/package.json").context("extension/package.json not found in zip")?;+ let manifest = serde_json::from_slice(&archive.read(manifest_entry)?).map_err(|_| anyhow::anyhow!("VSIX invalid: package.json is not a JSON file."))?;+ Ok((archive, manifest))+}+/// `getGalleryExtensionId`: lowercase `<publisher>.<name>`.pub fn gallery_extension_id(manifest: &Value) -> String {let publisher = manifest["publisher"].as_str().unwrap_or("undefined_publisher");diff --git a/port/ledger.md b/port/ledger.mdindex dd131d3cf00..d27ed8e0926 100644--- a/port/ledger.md+++ b/port/ledger.md@@ -206,7 +206,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston| platform/encryption | src/vs/platform | M10 | removed | | the port keeps secrets as Keychain items (MainThreadSecretState row, port/notes.md), so there is no safeStorage key to encrypt with || platform/endpoint | src/vs/platform | | removed | | no remote or tunnels by decision (port/notes.md); one local extension host || platform/environment | src/vs/platform | M10 | verified | | port/tools/settings-check environment: the paths and values init data carries match the reference except appName, uriScheme, machineId format and isTelemetryEnabled (product and no-telemetry decisions); argv.ts and argvHelper.ts are ported in argv.rs (`OPTIONS`, minimist parsing, `parseArgs`, `--goto` validation, help and version text), which cli.rs and `start_open_window` parse with (cargo test -p app argv:: : parses_the_command_line_as_upstream_argv, help_matches_upstream_text, goto_mode_validates_its_arguments); stdin.ts piped input decoded from the terminal encoding (resolveTerminalEncoding: cargo test -p app cli::); userDataPath.ts and the Electron main environment are replaced by main.rs's flags (`--user-data-dir`, `--extensions-dir`, `--profile`, `--profile-temp`, `--extensionDevelopmentPath`, `--extensionTestsPath`); copilotHome removed (no AI by decision) |-| platform/extensionManagement | src/vs/platform | M18 | verified | | zip64 VSIX read as yauzl does (cargo test -p exthost zip::tests::reads_zip64_records_and_extended_information). VSIX and gallery install, update, uninstall and clean-up on disk (extensionsScannerService.ts, extensionsProfileScannerService.ts layout): cargo test -p exthost extension_management, zip; PORT_GALLERY=1 port/tools/extensions-check 5 ok (an ESM VSIX and redhat.vscode-yaml from Open VSX activate without restart); the extracted package.json is written as `JSON.stringify(manifest, null, '\t')`, strings untouched (cargo test -p exthost keeps_double_spaces_in_manifest_strings; port/tools/update-check pre-release installs the rust-analyzer pre-release, whose setting descriptions have two spaces in a row) |+| platform/extensionManagement | src/vs/platform | M18 | verified | | zip64 VSIX read as yauzl does (cargo test -p exthost zip::tests::reads_zip64_records_and_extended_information). VSIX and gallery install, update, uninstall and clean-up on disk (extensionsScannerService.ts, extensionsProfileScannerService.ts layout): cargo test -p exthost extension_management, zip; PORT_GALLERY=1 port/tools/extensions-check 5 ok (an ESM VSIX and redhat.vscode-yaml from Open VSX activate without restart); the extracted package.json is written as `JSON.stringify(manifest, null, '\t')`, strings untouched (cargo test -p exthost keeps_double_spaces_in_manifest_strings; port/tools/update-check pre-release installs the rust-analyzer pre-release, whose setting descriptions have two spaces in a row). The CLI (cliProcessMain.ts, extensionManagementCLI.ts): cli_process.rs runs `--list-extensions` (`--show-versions`, `--category`), `--install-extension` (ids, `id@version`, VSIX paths, `--force`, `--pre-release`), `--uninstall-extension`, `--update-extensions` and `--locate-extension` (user extensions only, a `shortcut:`) with `--profile`, and exits without a window (cargo test -p app cli::tests::uninstall_extension_runs_in_the_cli_without_the_app; the release binary as bin/code starts it installs, updates, lists, locates and uninstalls Open VSX extensions and a VSIX) || platform/extensionRecommendations | src/vs/platform | M18 | verified | | recommendation reasons and the workspace prompt text (extensionRecommendations.ts, extensionRecommendationNotificationService.ts): cargo test -p app recommendation; ui-pair port/fixtures/extensions/ui-recommendations.json (prompt, Recommended view) against the reference || platform/extensionResourceLoader | src/vs/platform | M18 | verified | | installed extensions' README, changelog and icon read from disk, gallery ones from their asset URIs (Open VSX has no `resourceUrlTemplate`): ui-pair port/fixtures/extensions/ui-view.json `details` shows the yaml README as the reference || platform/extensions | src/vs/platform | M18 | verified | | extensionValidator.ts with the cases of extensionValidator.test.ts: cargo test -p exthost extension_validator; installs validated in PORT_GALLERY=1 port/tools/extensions-check; built-in extensions are not validated yet |diff --git a/port/notes.md b/port/notes.mdindex 974a69d31c9..4f7bded7979 100644--- a/port/notes.md+++ b/port/notes.md@@ -855,7 +855,7 @@ Scope as in the M19 Work row of port/ledger.md.- Product quality (Artur's decision): package-app writes product.json `quality: stable` for a latest build and `insider` for a pre-release; a dev build keeps the overlay's `null`, as a Code - OSS build from sources. `product::quality()` and `product::is_stable()` answer every gate; tests set it with `product::test_quality::set`. Upstream's `quality` gates (1.147.0, `rg "quality (===|!==) '"`) and the port's answer to each:- Ported, `cargo test -p app -p config stable_build only_a_stable relaunch`: setting defaults and `included` (workbench.contribution.ts, desktop.contribution.ts `window.menuStyle`, terminalConfiguration.ts and the others): `port/tools/dump-settings` writes the 14 settings a stable build changes to `config/core-settings-stable.json` (null: not registered), applied by `config::registry::use_stable_quality` at startup. update.ts `update.showUpdateReleaseNotes` and its Manage menu item. terminalEnvironment.ts `VSCODE_STABLE`. relauncher.contribution.ts: the PPE gallery setting asks to restart only off stable. abstractExtensionManagementService.ts `preferPreReleases`, extensionUrlHandler.ts and the gallery query's `includePreRelease`: pre-release versions off stable. extensions.contribution.ts: the install button's release and pre-release order (`extensions.installPreRelease` added for the stable dropdown). keybindingsExport.contribution.ts: `--export-default-keybindings` ignored on stable. localProcessExtensionHost.ts `consoleForward.includeStack`: off for a packaged stable build. contextkeys.ts `productQualityType`. Init data `quality` and `vscode.version`'s `-<quality>` suffix.- extensionsProposedApi.ts (exthost/src/proposed_api.rs, cargo test -p exthost proposed_api): a packaged app is built (`isBuilt`), a checkout run is not and allows every proposal. port/product.json carries `extensionEnabledApiProposals` of the Microsoft VS Code 1.147.0 darwin-arm64 build (65 extensions; the OSS product.json has none). Two of its names, `agentsWindowActivation` and `timeline`, are not in 1.147.0's extensionsApiProposals.ts, so the port warns at startup as VS Code does. Each window builds its own from its environment, as each renderer does upstream, and a host restart reuses it. No `@<version>` compatibility check: 1.147.0 removed `areApiProposalsCompatible` (commit 28af4cff058, #321391); the scanner only drops the `@<version>` suffix.- - Not ported, nothing to gate: releaseNotesEditor.ts conditional blocks (`STABLE`/`INSIDERS`: the port renders the GitHub release body), extensionsWorkbenchService.ts system extension updates and the 1 hour Insiders check interval, Download VSIX actions, codeCacheCleaner.ts and languagePackCachedDataCleaner.ts (no V8 code cache), extensionManagementCLI.ts (no `--install-extension`), preferences.ts recommended extension lookup, issueTroubleshoot.ts, survey.contribution.ts, window.ts translation URL, telemetry and assignment services, notebook kernel marketplace query, every chat, sessions and agent host gate (AI left out), update.ts SwitchProductQualityContribution (web only).+ - Not ported, nothing to gate: releaseNotesEditor.ts conditional blocks (`STABLE`/`INSIDERS`: the port renders the GitHub release body), extensionsWorkbenchService.ts system extension updates and the 1 hour Insiders check interval, Download VSIX actions, codeCacheCleaner.ts and languagePackCachedDataCleaner.ts (no V8 code cache), preferences.ts recommended extension lookup, issueTroubleshoot.ts, survey.contribution.ts, window.ts translation URL, telemetry and assignment services, notebook kernel marketplace query, every chat, sessions and agent host gate (AI left out), update.ts SwitchProductQualityContribution (web only).- Update feed (`update.rs`): product.json `updateUrl` is the GitHub releases URL of rokartur/vsrustium. A release channel's feed is one static JSON file in upstream's `IUpdate` shape (the answer of update.code.visualstudio.com's `/api/update/<platform>/<quality>/<commit>`), one per platform the app is built for, VS Code's target platform names `darwin-arm64` and `darwin-x64` (`exthost::gallery::CURRENT_TARGET_PLATFORM`, from `cfg!(target_arch)`):`{"version": "<commit>", "productVersion": "1.148.0", "timestamp": <ms since epoch>, "url": "<zip URL>", "sha256hash": "<hex SHA-256 of the zip>", "prerelease": false}`.Channels (port addition: setting `update.releaseChannel`, `latest` or `pre-release`, default `latest`; upstream's channel is the build's `quality`): `latest` reads `<updateUrl>/latest/download/<platform>.json`, which GitHub serves from the newest release not marked pre-release; `pre-release` reads `<updateUrl>/download/pre-release/<platform>-prerelease.json` (the arm64 names are the ones the first published build, v1.147.0-insider, reads), from a release tagged `pre-release` whose asset each publish replaces (GitHub has no "latest including pre-releases" URL). The entry is an update when its `productVersion` is a higher semantic version than the running product.json `version`, or the same version with a later `timestamp` than product.json `date` (`version`, the commit, decides nothing: builds of one commit can differ in version); a lower version never is, so switching to `latest` on a pre-release newer than the latest stable keeps it until a newer stable comes. A build without `commit` and `date` (written by package-app) has updates disabled, as upstream's without `commit`. 204, 401, 403 and 404 are no update. `url` resolves against the feed's URL and must be https (http only on 127.0.0.1 or localhost).