From fbb83a3603dc19b2e476689e65a8ae31859da5e7 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 16:32:02 +0000 Subject: [PATCH] feat: ship user plugins in every build Users could not install a plugin from a release: the user-plugin track was compiled in only with --features nocterm/user-plugins, which no release built. The feature is gone, and the plugin crates are ordinary dependencies. A run still loads user plugins only when [plugins] user_plugins is on, and --safe-mode loads none. - 57 cfg gates and the placeholder module for builds without plugins are removed. - The xtask compile-out rule and the release-pipeline check that kept the feature out of releases are removed. The test-only and banned feature rules remain. - CI builds the example guest in Build and test and runs the workspace tests once against the real WASM guest; the separate user-plugin job and its clippy pass are gone. - The notices now cover wasmi and wasmparser, with their original license files pinned in licensing/. ADR 0161 records the decision. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WAgRyZqRCp4XuUHFDB1w3k --- .claude/skills/gate/SKILL.md | 7 +- .claude/skills/plugin-api/SKILL.md | 2 +- .github/workflows/ci.yml | 78 ++-- Cargo.toml | 34 +- README.md | 3 +- THIRD_PARTY_NOTICES.txt | 341 +++++++++++++++++- crates/files/Cargo.toml | 8 +- crates/files/src/lib.rs | 2 - crates/monitor-ui/Cargo.toml | 8 +- crates/monitor-ui/src/lib.rs | 2 - crates/monitor-ui/src/tests.rs | 1 - crates/plugin-enablement/src/lib.rs | 8 +- crates/plugins-ui/Cargo.toml | 5 - crates/plugins-ui/src/lib.rs | 5 +- crates/plugins-ui/src/page.rs | 14 - crates/plugins-ui/src/view.rs | 37 -- crates/ui/Cargo.toml | 6 +- crates/ui/src/lib.rs | 2 +- crates/ui/src/notice.rs | 2 - crates/workspace/Cargo.toml | 6 +- crates/workspace/src/lib.rs | 2 - crates/workspace/src/workspace.rs | 1 - .../src/workspace/chrome/status_bar.rs | 1 - .../src/workspace/chrome/toolbars.rs | 1 - .../workspace/src/workspace/panel_groups.rs | 2 - .../workspace/src/workspace/registration.rs | 1 - .../src/workspace/user_plugin_tests.rs | 1 - docs/ARCHITECTURE.md | 4 +- docs/PACKAGING.md | 8 +- .../0161-user-plugins-ship-in-every-build.md | 30 ++ docs/adr/README.md | 1 + docs/architecture/adapter.md | 3 +- docs/architecture/domain.md | 4 +- docs/architecture/feature.md | 3 +- docs/architecture/guardrails.md | 13 +- docs/architecture/service.md | 2 +- docs/plugins/README.md | 5 +- docs/plugins/guide.md | 5 +- docs/reference/settings.md | 2 +- licensing/sources.json | 46 +++ ...wasm-tools-license-apache-a60eea817514.txt | 201 +++++++++++ ...nse-apache-llvm-exception-268872b9816f.txt | 220 +++++++++++ ...ce-wasm-tools-license-mit-23f18e03dc49.txt | 23 ++ ...labs-wasmi-license-apache-f031c1608e4a.txt | 201 +++++++++++ ...mi-labs-wasmi-license-mit-172bc1497507.txt | 25 ++ scripts/test-release-pipeline.cjs | 18 - src/bootstrap.rs | 2 +- src/gui_tests.rs | 1 - src/gui_tests/menu_layouts.rs | 4 - src/gui_tests/settings_pages/plugins.rs | 15 - src/main.rs | 7 - src/shell_setup.rs | 15 +- src/shell_setup/no_user_plugins.rs | 84 ----- src/shell_setup/plugins.rs | 2 - src/startup/tests.rs | 1 - xtask/architecture-policy.toml | 20 +- xtask/src/isolation.rs | 29 +- xtask/src/isolation/graph.rs | 38 +- xtask/src/isolation/guest_only.rs | 9 +- xtask/src/isolation/normal.rs | 19 +- xtask/src/isolation/policy.rs | 11 +- xtask/src/isolation/tests.rs | 33 +- 62 files changed, 1183 insertions(+), 501 deletions(-) create mode 100644 docs/adr/0161-user-plugins-ship-in-every-build.md create mode 100644 licensing/upstream/bytecodealliance-wasm-tools-license-apache-a60eea817514.txt create mode 100644 licensing/upstream/bytecodealliance-wasm-tools-license-apache-llvm-exception-268872b9816f.txt create mode 100644 licensing/upstream/bytecodealliance-wasm-tools-license-mit-23f18e03dc49.txt create mode 100644 licensing/upstream/wasmi-labs-wasmi-license-apache-f031c1608e4a.txt create mode 100644 licensing/upstream/wasmi-labs-wasmi-license-mit-172bc1497507.txt delete mode 100644 src/shell_setup/no_user_plugins.rs diff --git a/.claude/skills/gate/SKILL.md b/.claude/skills/gate/SKILL.md index d14cb08a..8cf4d3f2 100644 --- a/.claude/skills/gate/SKILL.md +++ b/.claude/skills/gate/SKILL.md @@ -88,8 +88,7 @@ Additional checks follow actual changed inputs: - SSH/SFTP changes run the required SSH fixture; hub adapter changes run the hub end-to-end test (see Commands). - User-plugin code (`nocterm-plugin-*`, `plugins-ui`, - `src/shell_setup/user_plugin*`) also runs workspace clippy and tests with - `--features nocterm/user-plugins`; the default build compiles it out. + `src/shell_setup/user_plugin*`) is part of the default build and its workspace checks. Plugin SDK/example changes also build/test the example and run the gated WASM guest test. Preserve API/ABI compatibility checks for contract changes. - Dependencies/manifests require applicable unused-dependency and notice checks; @@ -108,11 +107,9 @@ cargo fmt --all --check cargo build --workspace --all-targets cargo clippy --workspace --all-targets -- -D warnings cargo test --workspace -cargo clippy --workspace --all-targets --features nocterm/user-plugins -- -D warnings -cargo test --workspace --features nocterm/user-plugins cargo test --locked --manifest-path examples/plugins/focus-timer/Cargo.toml cargo build --locked --release --target wasm32-unknown-unknown --manifest-path examples/plugins/focus-timer/Cargo.toml -NOCTERM_GUEST_WASM=$PWD/examples/plugins/focus-timer/target/wasm32-unknown-unknown/release/focus_timer.wasm NOCTERM_REQUIRE_WASM_GUEST=1 cargo test -p nocterm --features nocterm/user-plugins user_plugin +NOCTERM_GUEST_WASM=$PWD/examples/plugins/focus-timer/target/wasm32-unknown-unknown/release/focus_timer.wasm NOCTERM_REQUIRE_WASM_GUEST=1 cargo test -p nocterm user_plugin NOCTERM_REQUIRE_SSHD=1 cargo test -p nocterm-ssh --test sshd NOCTERM_REQUIRE_HUB=1 cargo test -p nocterm-hub-io --test hub NOCTERM_REQUIRE_HUB=1 cargo test -p nocterm hub_live diff --git a/.claude/skills/plugin-api/SKILL.md b/.claude/skills/plugin-api/SKILL.md index 590ff7eb..25dbfe49 100644 --- a/.claude/skills/plugin-api/SKILL.md +++ b/.claude/skills/plugin-api/SKILL.md @@ -18,7 +18,7 @@ registration types in `crates/workspace/src/workspace/registration.rs`; catalog - Consumer is the shell, the layout editor or the Plugins page → this skill. - Consumer is another built-in feature → `port-design`. - Consumer is a user plugin → follow the user-plugin route below. It already - exists behind `user-plugins`; a native getter or `pub` field is not a guest API. + exists in every build; a native getter or `pub` field is not a guest API. - Consumer is an arbitrary user script → identify the supported entrypoint and trust boundary. Do not invent native script execution or access to app internals. Resolve a genuinely new authority decision under AGENTS.md's workflow policy. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0a8cc54..ffa59a32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,8 +36,7 @@ env: CARGO_PROFILE_TEST_DEBUG: "0" # How the jobs share work: `lint` checks (clippy, rustdoc) and `test` builds, so neither -# repeats the other's compilation; `user-plugins` tests only the packages the feature -# changes. Caches are saved by pushes to `dev` and `master`, also when a step fails, and +# repeats the other's compilation. Caches are saved by pushes to `dev` and `master`, also when a step fails, and # pull requests restore them. jobs: policy: @@ -200,12 +199,6 @@ jobs: - name: Clippy if: ${{ !cancelled() }} run: cargo clippy --locked --workspace --all-targets -- -D warnings - # The user-plugin track is compiled out of default builds until it ships - # (docs/architecture/guardrails.md); every commit must also build with it. - # Only the crates the feature changes are checked again. - - name: Clippy with user plugins - if: ${{ !cancelled() }} - run: cargo clippy --locked --workspace --all-targets --features nocterm/user-plugins -- -D warnings - name: Rustdoc if: ${{ !cancelled() }} run: cargo doc --locked --workspace --no-deps @@ -232,10 +225,15 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: toolchain: "1.98.0" + components: clippy + targets: wasm32-unknown-unknown - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true save-if: ${{ github.event_name == 'push' }} + workspaces: | + . -> target + examples/plugins/focus-timer -> target # One compilation for everything below: the tests reuse it, and the xtask binary is # run directly, because `cargo xtask` resolves features for xtask alone and rebuilds. - name: Build @@ -247,8 +245,21 @@ jobs: - name: Architecture rules if: ${{ !cancelled() && steps.build.outcome == 'success' }} run: target/debug/xtask architecture + # The example code plugin is a workspace of its own. The workspace tests load the module + # it builds, so a Rust guest runs through the real check and runtime. + - name: Build and test the example code plugin + id: guest + if: ${{ !cancelled() }} + run: | + cargo clippy --locked --all-targets --manifest-path examples/plugins/focus-timer/Cargo.toml -- -D warnings + cargo test --locked --manifest-path examples/plugins/focus-timer/Cargo.toml + cargo build --locked --release --target wasm32-unknown-unknown \ + --manifest-path examples/plugins/focus-timer/Cargo.toml - name: Run workspace tests - if: ${{ !cancelled() && steps.build.outcome == 'success' }} + if: ${{ !cancelled() && steps.build.outcome == 'success' && steps.guest.outcome == 'success' }} + env: + NOCTERM_GUEST_WASM: ${{ github.workspace }}/examples/plugins/focus-timer/target/wasm32-unknown-unknown/release/focus_timer.wasm + NOCTERM_REQUIRE_WASM_GUEST: "1" run: | set -o pipefail cargo test --locked --workspace 2>&1 | tee "$RUNNER_TEMP/nocterm-workspace-tests.log" @@ -267,53 +278,6 @@ jobs: print("::error title=Workspace test failure::" + escaped) PYTHON - # The workspace tests above already run every plugin crate. The feature changes only the - # packages that declare it, so only they are tested again with it, against a real guest. - user-plugins: - name: User plugins - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/checkout@v5 - with: - ref: ${{ inputs.ref || github.ref }} - - name: Install native dependencies - run: | - sudo apt-get update - sudo apt-get install -y build-essential pkg-config clang cmake libssl-dev \ - libfontconfig1-dev libfreetype6-dev libxkbcommon-dev libxkbcommon-x11-dev \ - libwayland-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \ - libvulkan-dev mesa-vulkan-drivers dbus - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: "1.98.0" - components: clippy - targets: wasm32-unknown-unknown - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - save-if: ${{ github.event_name == 'push' }} - workspaces: | - . -> target - examples/plugins/focus-timer -> target - # The example code plugin is a workspace of its own. The tests below load the module - # it builds, so a Rust guest runs through the real check and runtime. - - name: Build and test the example code plugin - run: | - cargo clippy --locked --all-targets --manifest-path examples/plugins/focus-timer/Cargo.toml -- -D warnings - cargo test --locked --manifest-path examples/plugins/focus-timer/Cargo.toml - cargo build --locked --release --target wasm32-unknown-unknown \ - --manifest-path examples/plugins/focus-timer/Cargo.toml - - name: Test the packages the feature changes - env: - NOCTERM_GUEST_WASM: ${{ github.workspace }}/examples/plugins/focus-timer/target/wasm32-unknown-unknown/release/focus_timer.wasm - NOCTERM_REQUIRE_WASM_GUEST: "1" - run: | - packages=$(cargo metadata --locked --no-deps --format-version 1 | jq -r \ - '.packages[] | select(.features | has("user-plugins") or has("user")) | "--package=\(.name)"') - echo "Testing with user plugins:" $packages - cargo test --locked --features nocterm/user-plugins $packages - vendored: name: Vendored crates runs-on: ubuntu-latest @@ -395,7 +359,7 @@ jobs: ci-passed: name: CI passed if: always() - needs: [policy, conventions, integration-history, lint, test, user-plugins, vendored, device-unlock-native] + needs: [policy, conventions, integration-history, lint, test, vendored, device-unlock-native] runs-on: ubuntu-latest timeout-minutes: 5 steps: diff --git a/Cargo.toml b/Cargo.toml index d7e6452a..19f353cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,13 +72,13 @@ nocterm-vault.workspace = true nocterm-vault-store.workspace = true nocterm-plugin-enablement.workspace = true nocterm-plugin-model.workspace = true -nocterm-plugin-api = { workspace = true, optional = true } -nocterm-plugin-host = { workspace = true, optional = true } -nocterm-plugin-packages = { workspace = true, optional = true } -nocterm-plugin-net = { workspace = true, optional = true } -nocterm-plugin-ports = { workspace = true, optional = true } -nocterm-plugin-view = { workspace = true, optional = true } -nocterm-plugin-wasm = { workspace = true, optional = true } +nocterm-plugin-api.workspace = true +nocterm-plugin-host.workspace = true +nocterm-plugin-packages.workspace = true +nocterm-plugin-net.workspace = true +nocterm-plugin-ports.workspace = true +nocterm-plugin-view.workspace = true +nocterm-plugin-wasm.workspace = true nocterm-plugins-ui.workspace = true nocterm-ui.workspace = true nocterm-workspace.workspace = true @@ -92,24 +92,6 @@ toml.workspace = true tracing.workspace = true tracing-subscriber.workspace = true -[features] -# The user-plugin track: compiled out of default and release builds until it ships -# (docs/architecture/guardrails.md, "Isolation of plugin crates"). -user-plugins = [ - "dep:nocterm-plugin-api", - "dep:nocterm-plugin-host", - "dep:nocterm-plugin-packages", - "dep:nocterm-plugin-net", - "dep:nocterm-plugin-ports", - "dep:nocterm-plugin-view", - "dep:nocterm-plugin-wasm", - "nocterm-plugins-ui/user", - "nocterm-workspace/user-plugins", - "nocterm-monitor-ui/user-plugins", - "nocterm-files/user-plugins", - "nocterm-ui/user-plugins", -] - [lints] workspace = true @@ -197,7 +179,7 @@ nocterm-themes = { workspace = true, features = ["test-support"] } serde_json.workspace = true tempfile.workspace = true tokio.workspace = true -# Writes the guest modules that the plugin check tests run (user-plugins builds only). +# Writes the guest modules that the plugin check tests run. wat.workspace = true gpui-kit = { workspace = true, features = ["test-support"] } diff --git a/README.md b/README.md index 3156012d..b58999ab 100644 --- a/README.md +++ b/README.md @@ -310,8 +310,7 @@ updates every second) and a short date before the time (`Oct 24`); they are the section of `settings.toml` and apply at once in every window. User plugins (preview) are installed from a file and run inside the window under the capabilities -you allow. They are in builds made with `cargo build --features user-plugins`; release builds do not -have them yet. Such a build loads none until you turn on Settings → Plugins → User plugins → +you allow. Every build has them; it loads none until you turn on Settings → Plugins → User plugins → Allow user plugins (the `user_plugins` key of the `[plugins]` section) and restart, and `nocterm --safe-mode` starts without any of them, whatever the setting says, to recover from a plugin that misbehaves. The [guide](docs/plugins/README.md) is for authors. diff --git a/THIRD_PARTY_NOTICES.txt b/THIRD_PARTY_NOTICES.txt index ded084f5..fe6a0008 100644 --- a/THIRD_PARTY_NOTICES.txt +++ b/THIRD_PARTY_NOTICES.txt @@ -2,8 +2,8 @@ Nocterm third-party licenses and notices ======================================== Generated by scripts/generate-license-notices.py using cargo-about 0.9.2. -Content SHA-256: 3cc524fae167d3e7f55f6133dc4c3b1acdcb53209ef087c91d5d69e8c04a52b7 -Input fingerprint: 14ece3bbf27e860bd598da338189d40d7acd1779e8f3719df669e45dafd05674 +Content SHA-256: 0ae784cc76fcd35b8b92606da1fa1473f168a85fb6faa2a841081804479c9c4b +Input fingerprint: 26aa78e6379ef0913ad6e111b9a8e0f0630d7d60937c762824cc783217844bbf Cargo.lock SHA-256 (release version masked): 2b2bf6b37fd5a884b37b99d97b196e2f5f4989e0e95914a9a09dd70dae34c1d8 Scope: runtime and build dependencies of Nocterm and its optional vault broker @@ -503,6 +503,11 @@ Authors: RustCrypto Developers Source: https://crates.io/api/v1/crates/cmov/0.5.4/download Repository: https://github.com/RustCrypto/utils +cobs 0.3.0: MIT OR Apache-2.0 +Authors: Allen Welkie <>; James Munns +Source: https://crates.io/api/v1/crates/cobs/0.3.0/download +Repository: https://github.com/jamesmunns/cobs.rs + cocoa 0.26.1: MIT OR Apache-2.0 Authors: The Servo Project Developers Source: https://crates.io/api/v1/crates/cocoa/0.26.1/download @@ -2387,6 +2392,11 @@ Authors: Austin Jones Source: https://crates.io/api/v1/crates/postage/0.5.0/download Repository: https://github.com/austinjones/postage-rs +postcard 1.1.3: MIT OR Apache-2.0 +Authors: James Munns +Source: https://crates.io/api/v1/crates/postcard/1.1.3/download +Repository: https://github.com/jamesmunns/postcard + potential_utf 0.1.6: Unicode-3.0 Authors: The ICU4X Project Developers Source: https://crates.io/api/v1/crates/potential_utf/0.1.6/download @@ -3705,6 +3715,31 @@ Authors: Sean McArthur Source: https://crates.io/api/v1/crates/want/0.3.1/download Repository: https://github.com/seanmonstar/want +wasmi 2.0.0: MIT OR Apache-2.0 +Authors: Robin Freyler +Source: https://crates.io/api/v1/crates/wasmi/2.0.0/download +Repository: https://github.com/wasmi-labs/wasmi + +wasmi_collections 2.0.0: MIT OR Apache-2.0 +Authors: Robin Freyler +Source: https://crates.io/api/v1/crates/wasmi_collections/2.0.0/download +Repository: https://github.com/wasmi-labs/wasmi + +wasmi_core 2.0.0: MIT OR Apache-2.0 +Authors: Robin Freyler +Source: https://crates.io/api/v1/crates/wasmi_core/2.0.0/download +Repository: https://github.com/wasmi-labs/wasmi + +wasmi_ir 2.0.0: MIT OR Apache-2.0 +Authors: Robin Freyler +Source: https://crates.io/api/v1/crates/wasmi_ir/2.0.0/download +Repository: https://github.com/wasmi-labs/wasmi + +wasmparser 0.228.0: Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +Authors: Yury Delendik +Source: https://crates.io/api/v1/crates/wasmparser/0.228.0/download +Repository: https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasmparser + wayland-backend 0.3.17: MIT Authors: Elinor Berger Source: https://crates.io/api/v1/crates/wayland-backend/0.3.17/download @@ -9751,6 +9786,8 @@ Original notice: linux-raw-sys 0.4.15 / LICENSE-Apache-2.0_WITH_LLVM-exception Original notice: rustix 0.38.44 / LICENSE-Apache-2.0_WITH_LLVM-exception Original notice: rustix 1.1.5 / LICENSE-Apache-2.0_WITH_LLVM-exception Original notice: rustix-openpty 0.2.0 / LICENSE-Apache-2.0_WITH_LLVM-exception +Original notice: wasmparser@0.228.0 / upstream/bytecodealliance-wasm-tools-license-apache-llvm-exception-268872b9816f.txt +Source: https://raw.githubusercontent.com/bytecodealliance/wasm-tools/e66235859a6ec0502bf6f9dcc358953eda4cafcc/LICENSE-Apache-2.0_WITH_LLVM-exception Apache License Version 2.0, January 2004 @@ -10871,6 +10908,7 @@ Used by: unicode-general-category 1.0.0 Original notice: annotate-snippets 0.12.16 / LICENSE-APACHE Original notice: anstyle 1.0.14 / LICENSE-APACHE Original notice: bit_field 0.10.3 / LICENSE-APACHE +Original notice: cobs 0.3.0 / LICENSE-APACHE Original notice: crc32fast 1.5.2 / LICENSE-APACHE Original notice: ctor 1.0.13 / LICENSE-APACHE Original notice: delegate@0.13.5 / upstream/kobzol-rust-delegate-license-apache-b40930bbcf80.txt @@ -12514,6 +12552,212 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +======================================================================== +Original notice: wasmi@2.0.0, wasmi_collections@2.0.0, wasmi_core@2.0.0, wasmi_ir@2.0.0 / upstream/wasmi-labs-wasmi-license-apache-f031c1608e4a.txt +Source: https://raw.githubusercontent.com/wasmi-labs/wasmi/2970aa871cc1001b57b267ccecdcd1e42306199e/LICENSE-APACHE + +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright (c) 2018-2024 Robin Freyler + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + ======================================================================== Original notice: typenum 1.20.1 / LICENSE-APACHE @@ -15530,6 +15774,7 @@ Original notice: png 0.18.1 / LICENSE-APACHE Original notice: polling 3.11.0 / LICENSE-APACHE Original notice: pollster 0.2.5 / LICENSE-APACHE Original notice: pollster 0.4.0 / LICENSE-APACHE +Original notice: postcard 1.1.3 / LICENSE-APACHE Original notice: profiling-procmacros@1.0.18, profiling@1.0.18 / upstream/aclysma-profiling-license-apache-10d30a673cd5.txt Source: https://raw.githubusercontent.com/aclysma/profiling/8271551172eb6fa4cba47369aedd93790c623df9/LICENSE-APACHE Original notice: prost 0.14.4 / LICENSE @@ -15601,6 +15846,8 @@ Original notice: value-bag 1.14.1 / LICENSE-APACHE Original notice: value-bag-serde1 1.14.1 / LICENSE-APACHE Original notice: version_check 0.9.5 / LICENSE-APACHE Original notice: waker-fn 1.2.0 / LICENSE-APACHE +Original notice: wasmparser@0.228.0 / upstream/bytecodealliance-wasm-tools-license-apache-a60eea817514.txt +Source: https://raw.githubusercontent.com/bytecodealliance/wasm-tools/e66235859a6ec0502bf6f9dcc358953eda4cafcc/LICENSE-APACHE Original notice: weezl 0.1.12 / LICENSE-APACHE Original notice: xattr 1.6.1 / LICENSE-APACHE Original notice: xml5ever 0.18.1 / LICENSE-APACHE @@ -19768,6 +20015,31 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +======================================================================== +License: MIT +Used by: cobs 0.3.0 +Original notice: cobs 0.3.0 / LICENSE-MIT + +Copyright (c) 2015 The cobs.rs Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + ======================================================================== License: MIT Used by: quick-error 2.0.1 @@ -21890,6 +22162,36 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +======================================================================== +Original notice: wasmi@2.0.0, wasmi_collections@2.0.0, wasmi_core@2.0.0, wasmi_ir@2.0.0 / upstream/wasmi-labs-wasmi-license-mit-172bc1497507.txt +Source: https://raw.githubusercontent.com/wasmi-labs/wasmi/2970aa871cc1001b57b267ccecdcd1e42306199e/LICENSE-MIT + +Copyright (c) 2018-2024 Robin Freyler + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + ======================================================================== License: MIT Used by: aes 0.9.3 @@ -22179,6 +22481,37 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +======================================================================== +License: MIT +Used by: postcard 1.1.3 +Original notice: postcard 1.1.3 / LICENSE-MIT + +Copyright (c) 2019 Anthony James Munns + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + ======================================================================== License: MIT Used by: slab 0.4.12 @@ -29985,7 +30318,7 @@ SOFTWARE. ======================================================================== SPDX reference license terms: MIT -Used by: accesskit 0.24.1, accesskit_atspi_common 0.19.1, accesskit_consumer 0.38.0, accesskit_macos 0.26.3, accesskit_unix 0.22.1, accesskit_windows 0.34.0, block 0.1.6, block2 0.6.2, chrono 0.4.45, delegate 0.13.5, dispatch2 0.3.1, gpu-descriptor 0.3.2, gpu-descriptor-types 0.2.0, granit-parser 1.3.0, harfrust 0.5.2, leak 0.1.2, leaky-cow 0.1.1, libm 0.2.16, lyon 1.0.19, lyon_algorithms 1.0.21, lyon_geom 1.0.19, lyon_path 1.0.19, lyon_tessellation 1.0.22, mac 0.1.1, mac-notification-sys 0.6.15, malloc_buf 0.0.6, md5 0.8.1, objc-sys 0.3.5, objc2 0.5.2, objc2 0.6.4, objc2-app-kit 0.2.2, objc2-app-kit 0.3.2, objc2-cloud-kit 0.3.2, objc2-core-data 0.3.2, objc2-core-foundation 0.3.2, objc2-core-graphics 0.3.2, objc2-core-image 0.3.2, objc2-core-location 0.3.2, objc2-core-media 0.3.2, objc2-core-text 0.3.2, objc2-core-video 0.3.2, objc2-encode 4.1.0, objc2-foundation 0.2.2, objc2-foundation 0.3.2, objc2-metal 0.3.2, objc2-quartz-core 0.3.2, objc2-screen-capture-kit 0.3.2, objc2-user-notifications 0.3.2, pathfinder_geometry 0.5.1, pathfinder_simd 0.5.6, profiling 1.0.18, profiling-procmacros 1.0.18, pulp-wasm-simd-flag 0.1.1, rust-i18n-macro 4.2.4, rust-i18n-support 4.2.4, seahash 4.1.0, svg_fmt 0.4.5, taffy 0.13.0, tauri-winrt-notification 0.8.1, tonic-prost-build 0.14.7, tree-sitter-bash 0.23.3, tree-sitter-cpp 0.23.4, tree-sitter-css 0.23.2, tree-sitter-diff 0.1.0, tree-sitter-go 0.23.4, tree-sitter-html 0.23.2, tree-sitter-java 0.23.5, tree-sitter-javascript 0.23.1, tree-sitter-json 0.24.8, tree-sitter-python 0.23.6, tree-sitter-toml-ng 0.7.0, tree-sitter-typescript 0.23.2, windows 0.58.0, windows 0.62.2, windows-collections 0.3.2, windows-core 0.58.0, windows-core 0.62.2, windows-future 0.3.2, windows-implement 0.58.0, windows-implement 0.60.2, windows-interface 0.58.0, windows-interface 0.59.3, windows-link 0.1.3, windows-link 0.2.1, windows-numerics 0.3.1, windows-registry 0.4.0, windows-registry 0.6.1, windows-result 0.2.0, windows-result 0.3.4, windows-result 0.4.1, windows-strings 0.1.0, windows-strings 0.3.1, windows-strings 0.5.1, windows-sys 0.48.0, windows-sys 0.52.0, windows-sys 0.59.0, windows-sys 0.61.2, windows-targets 0.48.5, windows-targets 0.52.6, windows-targets 0.53.5, windows-threading 0.2.1, windows-version 0.1.7, windows_x86_64_gnu 0.48.5, windows_x86_64_gnu 0.52.6, windows_x86_64_gnu 0.53.1, windows_x86_64_msvc 0.48.5, windows_x86_64_msvc 0.52.6, windows_x86_64_msvc 0.53.1, xim-ctext 0.3.0, xim-parser 0.2.2, zune-core 0.4.12, zune-inflate 0.2.54, zune-jpeg 0.4.21 +Used by: accesskit 0.24.1, accesskit_atspi_common 0.19.1, accesskit_consumer 0.38.0, accesskit_macos 0.26.3, accesskit_unix 0.22.1, accesskit_windows 0.34.0, block 0.1.6, block2 0.6.2, chrono 0.4.45, delegate 0.13.5, dispatch2 0.3.1, gpu-descriptor 0.3.2, gpu-descriptor-types 0.2.0, granit-parser 1.3.0, harfrust 0.5.2, leak 0.1.2, leaky-cow 0.1.1, libm 0.2.16, lyon 1.0.19, lyon_algorithms 1.0.21, lyon_geom 1.0.19, lyon_path 1.0.19, lyon_tessellation 1.0.22, mac 0.1.1, mac-notification-sys 0.6.15, malloc_buf 0.0.6, md5 0.8.1, objc-sys 0.3.5, objc2 0.5.2, objc2 0.6.4, objc2-app-kit 0.2.2, objc2-app-kit 0.3.2, objc2-cloud-kit 0.3.2, objc2-core-data 0.3.2, objc2-core-foundation 0.3.2, objc2-core-graphics 0.3.2, objc2-core-image 0.3.2, objc2-core-location 0.3.2, objc2-core-media 0.3.2, objc2-core-text 0.3.2, objc2-core-video 0.3.2, objc2-encode 4.1.0, objc2-foundation 0.2.2, objc2-foundation 0.3.2, objc2-metal 0.3.2, objc2-quartz-core 0.3.2, objc2-screen-capture-kit 0.3.2, objc2-user-notifications 0.3.2, pathfinder_geometry 0.5.1, pathfinder_simd 0.5.6, profiling 1.0.18, profiling-procmacros 1.0.18, pulp-wasm-simd-flag 0.1.1, rust-i18n-macro 4.2.4, rust-i18n-support 4.2.4, seahash 4.1.0, svg_fmt 0.4.5, taffy 0.13.0, tauri-winrt-notification 0.8.1, tonic-prost-build 0.14.7, tree-sitter-bash 0.23.3, tree-sitter-cpp 0.23.4, tree-sitter-css 0.23.2, tree-sitter-diff 0.1.0, tree-sitter-go 0.23.4, tree-sitter-html 0.23.2, tree-sitter-java 0.23.5, tree-sitter-javascript 0.23.1, tree-sitter-json 0.24.8, tree-sitter-python 0.23.6, tree-sitter-toml-ng 0.7.0, tree-sitter-typescript 0.23.2, wasmi 2.0.0, wasmi_collections 2.0.0, wasmi_core 2.0.0, wasmi_ir 2.0.0, wasmparser 0.228.0, windows 0.58.0, windows 0.62.2, windows-collections 0.3.2, windows-core 0.58.0, windows-core 0.62.2, windows-future 0.3.2, windows-implement 0.58.0, windows-implement 0.60.2, windows-interface 0.58.0, windows-interface 0.59.3, windows-link 0.1.3, windows-link 0.2.1, windows-numerics 0.3.1, windows-registry 0.4.0, windows-registry 0.6.1, windows-result 0.2.0, windows-result 0.3.4, windows-result 0.4.1, windows-strings 0.1.0, windows-strings 0.3.1, windows-strings 0.5.1, windows-sys 0.48.0, windows-sys 0.52.0, windows-sys 0.59.0, windows-sys 0.61.2, windows-targets 0.48.5, windows-targets 0.52.6, windows-targets 0.53.5, windows-threading 0.2.1, windows-version 0.1.7, windows_x86_64_gnu 0.48.5, windows_x86_64_gnu 0.52.6, windows_x86_64_gnu 0.53.1, windows_x86_64_msvc 0.48.5, windows_x86_64_msvc 0.52.6, windows_x86_64_msvc 0.53.1, xim-ctext 0.3.0, xim-parser 0.2.2, zune-core 0.4.12, zune-inflate 0.2.54, zune-jpeg 0.4.21 MIT License @@ -31658,6 +31991,8 @@ Original notice: typeid 1.0.3 / LICENSE-MIT Original notice: unicode-ident 1.0.26 / LICENSE-MIT Original notice: utf-8 0.7.6 / LICENSE-MIT Original notice: waker-fn 1.2.0 / LICENSE-MIT +Original notice: wasmparser@0.228.0 / upstream/bytecodealliance-wasm-tools-license-mit-23f18e03dc49.txt +Source: https://raw.githubusercontent.com/bytecodealliance/wasm-tools/e66235859a6ec0502bf6f9dcc358953eda4cafcc/LICENSE-MIT Original notice: zbus-lockstep 0.5.2 / LICENSE-MIT Original notice: zbus-lockstep-macros 0.5.2 / LICENSE-MIT Original notice: zed-font-kit 0.14.1-zed / LICENSE-MIT diff --git a/crates/files/Cargo.toml b/crates/files/Cargo.toml index 1440f9e7..81298384 100644 --- a/crates/files/Cargo.toml +++ b/crates/files/Cargo.toml @@ -18,17 +18,13 @@ nocterm-store.workspace = true nocterm-transfers.workspace = true nocterm-ui.workspace = true nocterm-workspace.workspace = true -nocterm-plugin-api = { workspace = true, optional = true } -nocterm-plugin-ports = { workspace = true, optional = true } +nocterm-plugin-api.workspace = true +nocterm-plugin-ports.workspace = true futures.workspace = true gpui-kit.workspace = true parking_lot.workspace = true chrono = { version = "0.4", default-features = false, features = ["std"] } -[features] -# The transfer counts, offered to user plugins that were granted `transfers.counts`. -user-plugins = ["dep:nocterm-plugin-api", "dep:nocterm-plugin-ports"] - [dev-dependencies] nocterm-explorer = { workspace = true, features = ["test-support"] } nocterm-project-model.workspace = true diff --git a/crates/files/src/lib.rs b/crates/files/src/lib.rs index de1c010d..0bf256ae 100644 --- a/crates/files/src/lib.rs +++ b/crates/files/src/lib.rs @@ -15,7 +15,6 @@ //! accepted operations retain their original capability while later navigation proceeds. mod activity; mod dialogs; -#[cfg(feature = "user-plugins")] mod host_capabilities; mod local; mod local_pane; @@ -65,7 +64,6 @@ use remote::{Browser, listing}; use selection::RowSelection; use std::{path::PathBuf, rc::Rc, sync::Arc, time::Duration}; -#[cfg(feature = "user-plugins")] pub use host_capabilities::TransferCounts; pub use registration::{ Installed, OpenExplorerSettings, ShowTransfers, ToggleExplorer, install, register, diff --git a/crates/monitor-ui/Cargo.toml b/crates/monitor-ui/Cargo.toml index c2f761f0..ec9a813d 100644 --- a/crates/monitor-ui/Cargo.toml +++ b/crates/monitor-ui/Cargo.toml @@ -19,14 +19,10 @@ nocterm-session.workspace = true nocterm-store.workspace = true nocterm-ui.workspace = true nocterm-workspace.workspace = true -nocterm-plugin-api = { workspace = true, optional = true } -nocterm-plugin-ports = { workspace = true, optional = true } +nocterm-plugin-api.workspace = true +nocterm-plugin-ports.workspace = true gpui-kit.workspace = true -[features] -# The monitor's reading, offered to user plugins that were granted `monitor.usage`. -user-plugins = ["dep:nocterm-plugin-api", "dep:nocterm-plugin-ports"] - [lints] workspace = true diff --git a/crates/monitor-ui/src/lib.rs b/crates/monitor-ui/src/lib.rs index 616da02f..3c9a16b2 100644 --- a/crates/monitor-ui/src/lib.rs +++ b/crates/monitor-ui/src/lib.rs @@ -24,7 +24,6 @@ mod details; mod installed; pub use installed::{Installed, install}; mod graph; -#[cfg(feature = "user-plugins")] mod host_capabilities; mod model; mod page; @@ -38,7 +37,6 @@ use gpui_kit::{AppContext as _, Context, Entity, Window}; use nocterm_ui::SettingsPageSpec; use nocterm_workspace::{RegistrationError, WidgetRegistration, Workspace}; -#[cfg(feature = "user-plugins")] pub use host_capabilities::{MonitorUsage, register_observed}; pub use page::MonitorPage; pub use settings::{ diff --git a/crates/monitor-ui/src/tests.rs b/crates/monitor-ui/src/tests.rs index 7de1ab05..5c8e5475 100644 --- a/crates/monitor-ui/src/tests.rs +++ b/crates/monitor-ui/src/tests.rs @@ -420,5 +420,4 @@ mod status_bar_settings; mod status_popover; -#[cfg(feature = "user-plugins")] mod host_capabilities; diff --git a/crates/plugin-enablement/src/lib.rs b/crates/plugin-enablement/src/lib.rs index 4db2192e..e34bf727 100644 --- a/crates/plugin-enablement/src/lib.rs +++ b/crates/plugin-enablement/src/lib.rs @@ -11,7 +11,7 @@ //! //! User plugins are not listed here: their enabled flag lives in the host's records, so a //! `user-` id in this section is dropped when it is read and never written. The section holds -//! only the one switch that lets a build with the `user-plugins` feature load them at all. +//! only the one switch that lets the application load them at all. //! //! Owns: the `[plugins]` section, its sanitizing, the effective disabled set and the //! `user_plugins` switch. @@ -58,10 +58,8 @@ pub struct PluginEnablement { /// in any window; its settings stay available. Required plugins cannot be disabled. #[schemars(with = "Vec")] pub disabled: Vec, - /// Whether a build with the `user-plugins` feature loads user plugins at the start. Off by - /// default and read only by such builds, once, at the start: a change applies at the next - /// start. Release builds are made without the feature, so the switch does nothing there. - /// Left out of the file while off. + /// Whether the application loads user plugins at the start. Off by default and read + /// once, at the start: a change applies at the next start. Left out of the file while off. #[serde(skip_serializing_if = "core::ops::Not::not")] #[schemars(extend("default" = false))] pub user_plugins: bool, diff --git a/crates/plugins-ui/Cargo.toml b/crates/plugins-ui/Cargo.toml index 91ca9ca1..7ee99b92 100644 --- a/crates/plugins-ui/Cargo.toml +++ b/crates/plugins-ui/Cargo.toml @@ -9,11 +9,6 @@ publish = false [package.metadata.nocterm] layer = "feature" -[features] -# The User section of the page: install, consent, update, revoke and audit of user plugins. -# Compiled out of the default build (docs/architecture/guardrails.md). -user = [] - [dependencies] nocterm-core.workspace = true nocterm-plugin-model.workspace = true diff --git a/crates/plugins-ui/src/lib.rs b/crates/plugins-ui/src/lib.rs index cf4fc690..b1b95c64 100644 --- a/crates/plugins-ui/src/lib.rs +++ b/crates/plugins-ui/src/lib.rs @@ -5,7 +5,7 @@ //! //! Owns: the page layout and selection, the enable switch with its refusal text, the plugin //! settings form per selected plugin, and revealing a plugin by id. -//! With the cargo feature `user` it also owns the User section: the switch that allows user +//! It also owns the User section: the switch that allows user //! plugins at the next start and the text that says why a run holds them, the user plugin list, //! the install and update consent (inert for 750 ms, Deny by default), enabling, placement, //! removal (one small button that asks in a dialog what goes) and the audit log, with long @@ -32,7 +32,6 @@ mod page; mod toggles; -#[cfg(feature = "user")] mod user; mod view; @@ -44,7 +43,6 @@ use nocterm_ui::{IconName, PluginSettingsDirectory, SettingsPageSpec}; pub use page::PluginsPage; pub use toggles::{EnablementError, PluginToggles}; -#[cfg(feature = "user")] pub use user::{ AuditLine, Candidate, CapabilityLine, FieldLine, FolderError, HeldBy, InstallRequest, MAX_LISTED, PluginsFolder, Replaced, RowState, UserPart, UserPartView, UserPluginError, @@ -72,7 +70,6 @@ pub fn settings_page( } /// The lazy Plugins page with a User section below the system plugins, which stay unchanged. -#[cfg(feature = "user")] pub fn settings_page_with_user_plugins( catalog: Arc, toggles: Rc, diff --git a/crates/plugins-ui/src/page.rs b/crates/plugins-ui/src/page.rs index 11f9701a..d02531d2 100644 --- a/crates/plugins-ui/src/page.rs +++ b/crates/plugins-ui/src/page.rs @@ -23,13 +23,11 @@ pub struct PluginsPage { /// Why the last switch of this plugin was refused. refusal: Option<(PluginId, SharedString)>, focus: FocusHandle, - #[cfg(feature = "user")] user: Option, _subscriptions: Vec, } /// The User section and the parts of it the page draws in place. -#[cfg(feature = "user")] pub(crate) struct UserParts { section: Entity, head: Entity, @@ -37,7 +35,6 @@ pub(crate) struct UserParts { detail: Entity, } -#[cfg(feature = "user")] impl UserParts { pub(crate) fn section(&self) -> &Entity { &self.section @@ -80,7 +77,6 @@ impl PluginsPage { form: None, refusal: None, focus: cx.focus_handle(), - #[cfg(feature = "user")] user: None, _subscriptions: vec![toggled], }; @@ -91,7 +87,6 @@ impl PluginsPage { } /// Adds the User section below the system plugins. - #[cfg(feature = "user")] pub fn with_user_plugins( mut self, session: crate::UserSession, @@ -125,7 +120,6 @@ impl PluginsPage { self } - #[cfg(feature = "user")] pub(crate) fn user(&self) -> Option<&UserParts> { self.user.as_ref() } @@ -156,7 +150,6 @@ impl PluginsPage { /// Shows `id` in the detail, first sending what was typed into the previous form, and lets go /// of a selected external plugin. pub(crate) fn select(&mut self, id: &PluginId, window: &mut Window, cx: &mut Context) { - #[cfg(feature = "user")] if let Some(user) = &self.user { user.section.update(cx, |section, cx| section.deselect(cx)); } @@ -206,7 +199,6 @@ impl PluginsPage { fn flush_form(&self, cx: &mut Context) { self.flush_system_form(cx); - #[cfg(feature = "user")] if let Some(user) = &self.user { user.section.update(cx, |user, cx| user.flush(cx)); } @@ -221,7 +213,6 @@ impl PluginsPage { impl PluginsPage { /// Selects the user plugin whose id is `anchor`, if the page has a User section. - #[cfg(feature = "user")] fn reveal_user(&mut self, anchor: &str, window: &mut Window, cx: &mut Context) -> bool { let id = PluginId::owned(anchor); let Some(user) = self @@ -235,11 +226,6 @@ impl PluginsPage { user.update(cx, |user, cx| user.select(&id, window, cx)); true } - - #[cfg(not(feature = "user"))] - fn reveal_user(&mut self, _: &str, _: &mut Window, _: &mut Context) -> bool { - false - } } impl SettingsPage for PluginsPage { diff --git a/crates/plugins-ui/src/view.rs b/crates/plugins-ui/src/view.rs index 2f49f36f..ed8e1120 100644 --- a/crates/plugins-ui/src/view.rs +++ b/crates/plugins-ui/src/view.rs @@ -38,60 +38,23 @@ pub(crate) fn page(page: &PluginsPage, cx: &mut Context) -> impl In } /// The external plugins' head: the switch, install and the plugins folder, the consent. -#[cfg(feature = "user")] fn external_head(page: &PluginsPage, _: &mut Context) -> Option { page.user() .map(|user| gpui_kit::AnyView::from(user.head().clone()).into_any_element()) } -/// A build without user plugins says so where the external plugins' head would be, so the user -/// knows why there is nothing to install. -#[cfg(not(feature = "user"))] -fn external_head(_: &PluginsPage, cx: &mut Context) -> Option { - Some( - v_flex() - .id("user-plugins-unavailable") - .test_support() - .w_full() - .gap_2() - .child(form::page_header( - "External plugins", - Some( - "This build of Nocterm was made without user plugins, so plugin files \ - cannot be installed. A build with the `user-plugins` feature can install \ - them from a file or from its plugins folder." - .into(), - ), - cx, - )) - .into_any_element(), - ) -} - -#[cfg(feature = "user")] fn external_rows(page: &PluginsPage, _: &mut Context) -> Option { page.user() .map(|user| gpui_kit::AnyView::from(user.rows().clone()).into_any_element()) } -#[cfg(not(feature = "user"))] -fn external_rows(_: &PluginsPage, _: &mut Context) -> Option { - None -} - /// The selected external plugin, when no built-in one is selected. -#[cfg(feature = "user")] fn external_detail(page: &PluginsPage, cx: &mut Context) -> Option { page.user() .filter(|user| user.section().read(cx).has_selection()) .map(|user| gpui_kit::AnyView::from(user.detail().clone()).into_any_element()) } -#[cfg(not(feature = "user"))] -fn external_detail(_: &PluginsPage, _: &mut Context) -> Option { - None -} - /// The heading of a group of the list, as the application heads its sections. fn group(title: &'static str, cx: &Context) -> AnyElement { div() diff --git a/crates/ui/Cargo.toml b/crates/ui/Cargo.toml index 893ac869..a46ff87a 100644 --- a/crates/ui/Cargo.toml +++ b/crates/ui/Cargo.toml @@ -13,8 +13,8 @@ layer = "ui" nocterm-terminal-model.workspace = true nocterm-explorer.workspace = true nocterm-plugin-model.workspace = true -nocterm-plugin-api = { workspace = true, optional = true } -nocterm-plugin-ports = { workspace = true, optional = true } +nocterm-plugin-api.workspace = true +nocterm-plugin-ports.workspace = true futures.workspace = true nocterm-core.workspace = true @@ -35,8 +35,6 @@ thiserror.workspace = true [features] test-support = [] -# Notices a user plugin posts and the ones it still has (docs/architecture/guardrails.md). -user-plugins = ["dep:nocterm-plugin-api", "dep:nocterm-plugin-ports"] [dev-dependencies] nocterm-explorer = { workspace = true, features = ["test-support"] } diff --git a/crates/ui/src/lib.rs b/crates/ui/src/lib.rs index 482a9c21..ca289249 100644 --- a/crates/ui/src/lib.rs +++ b/crates/ui/src/lib.rs @@ -15,7 +15,7 @@ //! `PluginSettingsSource` port, the system `SectionBinding` and the `PluginSettingsDirectory`). //! Does not own: ordered snapshot workers or shutdown coordination (`nocterm-store`). //! Ports used: `Persisted`, `ShutdownCoordinator`, read-only `DirectoryRead`. Ports provided: UI helpers, -//! explicit settings-based terminal styling, behind `user-plugins` the `PluginNotices` provider of +//! explicit settings-based terminal styling, the `PluginNotices` provider of //! `notifications.post` and `notifications.own` for user plugins, SettingsTextField, the installed settings handle and //! `PluginSettingsSource` (named for the form's need; `SectionBinding` implements it over an //! owner's own settings section). diff --git a/crates/ui/src/notice.rs b/crates/ui/src/notice.rs index dae81753..ba12ff8d 100644 --- a/crates/ui/src/notice.rs +++ b/crates/ui/src/notice.rs @@ -10,11 +10,9 @@ use std::{collections::HashMap, rc::Rc, time::Duration}; use gpui_kit::{App, Global, SharedString, Window, WindowId}; mod bar; -#[cfg(feature = "user-plugins")] mod plugin; pub use bar::NoticeBar; -#[cfg(feature = "user-plugins")] pub use plugin::PluginNotices; /// How long a notice without an action stays on the footer line. diff --git a/crates/workspace/Cargo.toml b/crates/workspace/Cargo.toml index 58977968..8a92d690 100644 --- a/crates/workspace/Cargo.toml +++ b/crates/workspace/Cargo.toml @@ -21,8 +21,8 @@ nocterm-project-model.workspace = true nocterm-plugin-model.workspace = true nocterm-plugin-enablement.workspace = true nocterm-window-layout.workspace = true -nocterm-plugin-api = { workspace = true, optional = true } -nocterm-plugin-ports = { workspace = true, optional = true } +nocterm-plugin-api.workspace = true +nocterm-plugin-ports.workspace = true gpui-kit.workspace = true tracing.workspace = true @@ -32,8 +32,6 @@ schemars.workspace = true [features] test-support = [] -# Providers of what a user plugin may observe (docs/architecture/guardrails.md). -user-plugins = ["dep:nocterm-plugin-api", "dep:nocterm-plugin-ports"] [lints] workspace = true diff --git a/crates/workspace/src/lib.rs b/crates/workspace/src/lib.rs index ffcc5023..9644830b 100644 --- a/crates/workspace/src/lib.rs +++ b/crates/workspace/src/lib.rs @@ -81,9 +81,7 @@ pub use context_ports::{ChatConnectionOpen, ChatConnectionOpenError}; mod dock_item; mod file_drag; pub mod host; -#[cfg(feature = "user-plugins")] mod host_capabilities; -#[cfg(feature = "user-plugins")] pub use host_capabilities::{ShellCapabilities, WithdrawRefused}; mod item; mod local_terminal; diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 32050d7a..add871af 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -51,7 +51,6 @@ pub use registration::{ mod layout_edit; mod layout_switch; mod panel_menu; -#[cfg(feature = "user-plugins")] pub(crate) mod plugin_panels; mod sessions; mod shell_layout; diff --git a/crates/workspace/src/workspace/chrome/status_bar.rs b/crates/workspace/src/workspace/chrome/status_bar.rs index 8b2ac30f..98914a21 100644 --- a/crates/workspace/src/workspace/chrome/status_bar.rs +++ b/crates/workspace/src/workspace/chrome/status_bar.rs @@ -106,7 +106,6 @@ impl StatusBar { } /// Forgets a widget, so its plugin's uninstall or replacement leaves no view behind. - #[cfg(feature = "user-plugins")] pub(in crate::workspace) fn remove(&mut self, id: &ContributionId, cx: &mut App) { if let Some(entry) = self.widgets.iter_mut().find(|entry| entry.id == *id) { entry.visibility(false, cx); diff --git a/crates/workspace/src/workspace/chrome/toolbars.rs b/crates/workspace/src/workspace/chrome/toolbars.rs index 88147a1c..d88abe5b 100644 --- a/crates/workspace/src/workspace/chrome/toolbars.rs +++ b/crates/workspace/src/workspace/chrome/toolbars.rs @@ -67,7 +67,6 @@ impl Toolbars { } /// Forgets a toolbar, so its plugin's uninstall or replacement leaves no view behind. - #[cfg(feature = "user-plugins")] pub(in crate::workspace) fn remove(&mut self, id: &ContributionId) { self.entries.retain(|entry| entry.id != *id); } diff --git a/crates/workspace/src/workspace/panel_groups.rs b/crates/workspace/src/workspace/panel_groups.rs index d83d2aad..69338fc6 100644 --- a/crates/workspace/src/workspace/panel_groups.rs +++ b/crates/workspace/src/workspace/panel_groups.rs @@ -664,7 +664,6 @@ impl PanelSlot { } /// Why a plugin may not show its panel now. -#[cfg(feature = "user-plugins")] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub(super) enum OpeningRefused { /// Another member of the panel's group shows, and showing this one would replace it. @@ -674,7 +673,6 @@ pub(super) enum OpeningRefused { } /// What a user plugin may do to the panels, under the rules that protect what the user is doing. -#[cfg(feature = "user-plugins")] impl PanelGroups { /// Shows the registered panel without taking focus. It refuses when that would replace a /// panel that shows (the group is shown with another member selected) or while any panel diff --git a/crates/workspace/src/workspace/registration.rs b/crates/workspace/src/workspace/registration.rs index 7290497d..2731f86e 100644 --- a/crates/workspace/src/workspace/registration.rs +++ b/crates/workspace/src/workspace/registration.rs @@ -340,7 +340,6 @@ impl Registrations { } /// Forgets a registration, so the contribution can register again. - #[cfg(feature = "user-plugins")] pub(super) fn forget(&mut self, id: &ContributionId) { self.registered.remove(id); self.factories.remove(id); diff --git a/crates/workspace/src/workspace/user_plugin_tests.rs b/crates/workspace/src/workspace/user_plugin_tests.rs index 534caf7b..1e464377 100644 --- a/crates/workspace/src/workspace/user_plugin_tests.rs +++ b/crates/workspace/src/workspace/user_plugin_tests.rs @@ -346,5 +346,4 @@ fn a_user_group_and_a_pending_approval_leave_the_assistant_toggle_in_the_bar( assert!(drawn, "the approval toggle stays in the bar"); } -#[cfg(feature = "user-plugins")] mod provider; diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index fe52f78a..0fd7cfac 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -69,8 +69,8 @@ lists them with their placement hints ([ADR 0082](adr/0082-system-plugins-and-co and the window draws the status bar and arranges its panel groups from a layout resolved against that catalog ([ADR 0083](adr/0083-zoned-status-bar.md)). -User plugins are the second tier: files the user installs, built only with the cargo feature -`user-plugins`. A run loads them only when `[plugins] user_plugins` is set, and never in +User plugins are the second tier: files the user installs, part of every build +([ADR 0161](adr/0161-user-plugins-ship-in-every-build.md)). A run loads them only when `[plugins] user_plugins` is set, and never in `--safe-mode`; one gate in the application covers every load path, and the API surface is checked against the latest release ([ADR 0093](adr/0093-user-plugins-start-off-and-the-api-stays-compatible.md); author documents in [plugins](plugins/README.md)). diff --git a/docs/PACKAGING.md b/docs/PACKAGING.md index 0978620a..e3e8bbe6 100644 --- a/docs/PACKAGING.md +++ b/docs/PACKAGING.md @@ -86,11 +86,9 @@ On Windows both files are installed beside `nocterm.exe` (`LICENSE.txt` and `THIRD_PARTY_NOTICES.txt`). Linux packages and AppImage place them under `usr/share/doc/nocterm/` (inside the AppImage for that format). -`THIRD_PARTY_NOTICES.txt` is generated for the default feature set, so it does not list the -third-party crates that only the cargo feature `nocterm/user-plugins` brings in (compare -`cargo tree -p nocterm -e normal,build` with and without it): `wasmi`, `wasmi_core`, `wasmi_ir`, `wasmi_collections`, `wasmparser`, `postcard` and `cobs`. No packaging or release workflow builds that feature. A release that does must -regenerate the notices with it before packaging -([ADR 0093](adr/0093-user-plugins-start-off-and-the-api-stays-compatible.md)). +`THIRD_PARTY_NOTICES.txt` is generated for the application's build, which includes the +user-plugin runtime and its crates (`wasmi`, `wasmparser`, `postcard` and the rest) +([ADR 0161](adr/0161-user-plugins-ship-in-every-build.md)). Keep these files with redistributed binaries. Changes to `Cargo.lock`, vendored forks, native dependencies or bundled assets require a notice review before a diff --git a/docs/adr/0161-user-plugins-ship-in-every-build.md b/docs/adr/0161-user-plugins-ship-in-every-build.md new file mode 100644 index 00000000..a64130e2 --- /dev/null +++ b/docs/adr/0161-user-plugins-ship-in-every-build.md @@ -0,0 +1,30 @@ +# 0161. User plugins ship in every build + +Status: accepted. +- Supersedes the compile-out part of [0093](0093-user-plugins-start-off-and-the-api-stays-compatible.md): the cargo feature `user-plugins` and the default build without plugin crates. +- Amends [0160](0160-ci-compiles-each-kind-once-and-tests-the-plugin-feature-where-it-changes-code.md): no separate user-plugin job. + +## Context + +The user-plugin track was compiled into the application only with `--features nocterm/user-plugins`. Release builds left it out, so no installed Nocterm could run a plugin. + +Keeping the flag cost: +- 57 `cfg` gates in 22 files, plus a placeholder module for the build without plugins; +- a second clippy pass and a second test configuration in CI; +- an xtask rule (compile-out) and a release-pipeline test that kept the feature out of releases. + +The owner decided that user plugins ship. + +## Decision + +- The application and its crates depend on the plugin crates unconditionally. `nocterm`, `nocterm-ui`, `nocterm-workspace`, `nocterm-files` and `nocterm-monitor-ui` have no `user-plugins` feature, and `nocterm-plugins-ui` has no `user` feature. +- The runtime gate stays as 0093 decided. A run loads user plugins only when `[plugins] user_plugins` is on (off by default), and `nocterm --safe-mode` loads none. +- The isolation rules check the application's one build. The compile-out rule is gone. The `[isolation.features]` table keeps the test-only and banned features. +- CI runs the workspace tests once, with the example guest built first, so the real WASM guest test runs in **Build and test**. +- The third-party notices cover the plugin runtime's crates. + +## Consequences + +- Releases install and run user plugins once the user allows them. +- The binary carries the WASM runtime even when no plugin is installed. +- There is one build to check. The plugin crates' isolation rules (I1–I5, guest-only crates) still keep them closed. diff --git a/docs/adr/README.md b/docs/adr/README.md index 15ec371d..41ac0e8d 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -156,3 +156,4 @@ acceptance; a later record supersedes an earlier one. | [0158](0158-a-plugin-toolbar-keeps-to-its-own-tabs-and-the-user-places-it.md) | A plugin's toolbar keeps to its own tabs unless it names `tabs = "all"`, `shown` only suggests where it starts, and the user moves or hides it under Toolbars (amends 0153 and 0157) | | [0159](0159-plugin-charts-toolbar-axis-and-toolbar-moves.md) | Plugin views draw charts of recent values (`chart`, ABI stays 1), a toolbar's calls name its axis in the zone (`cx.is_column()`), toolbars use the status bar's small text, and moving a toolbar is a layout edit | | [0160](0160-ci-compiles-each-kind-once-and-tests-the-plugin-feature-where-it-changes-code.md) | CI compiles each kind of build once (lint checks, build and tests), tests `user-plugins` only in the packages that declare it, saves caches from `dev` and `master`, and builds installers only for releases | +| [0161](0161-user-plugins-ship-in-every-build.md) | User plugins ship in every build: the `user-plugins` cargo feature and the compile-out rule are gone, the `[plugins] user_plugins` switch and `--safe-mode` still decide whether a run loads them (supersedes the compile-out part of 0093) | diff --git a/docs/architecture/adapter.md b/docs/architecture/adapter.md index c9fd994f..7856d663 100644 --- a/docs/architecture/adapter.md +++ b/docs/architecture/adapter.md @@ -117,8 +117,7 @@ builds each call from the plugin's settings: the origin the user typed and, from the credential header. The adapter parses the address again and refuses one that is not at that origin, follows no redirect, keeps no cookies, sends JSON with a plugin user agent, waits at most 15 seconds and reads at most 256 KiB of the answer. A failure is a status-0 answer, not an error. -Calls block, so the host runs them on a background thread; the crate is compiled only with -`user-plugins` ([ADR 0153](../adr/0153-toolbars-and-user-plugin-requests-timers-and-terminals.md)). +Calls block, so the host runs them on a background thread ([ADR 0153](../adr/0153-toolbars-and-user-plugin-requests-timers-and-terminals.md)). ## Bounded I/O diff --git a/docs/architecture/domain.md b/docs/architecture/domain.md index c08bc5f7..c43b12cb 100644 --- a/docs/architecture/domain.md +++ b/docs/architecture/domain.md @@ -448,8 +448,8 @@ switched off. The list is sanitized (valid ids once each, at most 64; ids this b know are kept, so a returning plugin finds its state) and `effective_disabled` returns the ids that are really off, never a required plugin and never a core contribution. `read_error` reports a table that does not read, so a writer can refuse instead of -replacing it. The section also holds the `user_plugins` switch: whether a build with the -`user-plugins` feature loads user plugins at the start (off by default, left out of the file +replacing it. The section also holds the `user_plugins` switch: whether the +application loads user plugins at the start (off by default, left out of the file while off; [ADR 0093](../adr/0093-user-plugins-start-off-and-the-api-stays-compatible.md)). It reads `nocterm-plugin-model` and `nocterm-settings`, has no GPUI types and no I/O ([ADR 0086](../adr/0086-plugin-enablement-and-the-plugins-page.md)). diff --git a/docs/architecture/feature.md b/docs/architecture/feature.md index 1dc3e05f..04789fb8 100644 --- a/docs/architecture/feature.md +++ b/docs/architecture/feature.md @@ -39,8 +39,7 @@ parent. `OpenPlugins` and `OpenPluginPage` open the page and a plugin's page ([ADR 0086](../adr/0086-plugin-enablement-and-the-plugins-page.md)). The detail of a plugin with contributions also links to the editor with its first item selected. -With the cargo feature `user` (the application's `user-plugins` turns it on) the page also holds -the User section (`UserPluginsSection`). It states whether this run loaded the user plugins +The page also holds the User section (`UserPluginsSection`). It states whether this run loaded the user plugins (`UserSession::{Loaded, Held(HeldBy)}`, with `HeldBy::{SafeMode, NotAllowed}`), shows the "Allow user plugins" switch, which stores the choice for the next start through the narrow `UserPluginsSwitch` port, and, in a loaded run, the install button, consent, list, detail, diff --git a/docs/architecture/guardrails.md b/docs/architecture/guardrails.md index fa62a2cd..52d23c94 100644 --- a/docs/architecture/guardrails.md +++ b/docs/architecture/guardrails.md @@ -140,7 +140,7 @@ The user plugin crates (`nocterm-plugin-model`, `-api`, `-abi`, `-wasm`, `-packa A row applies as soon as its package exists, every list is closed, and a new dependency or exemption is a reviewed edit of the policy with a reason. -- **I1, dependency closure.** From `cargo metadata` with `--features nocterm/user-plugins`, normal and +- **I1, dependency closure.** From `cargo metadata` of the application's build, normal and build dependencies, the transitive `nocterm-*` closure of a crate must equal its row and the external closure must lie in its named list (for gpui crates, that list plus the closure of the vendored gpui). @@ -157,18 +157,14 @@ exemption is a reviewed edit of the policy with a reason. `unsafe`, inline or global assembly, symbol attributes (`no_mangle`, `export_name`, `link_name`, `link_section`), or serde attribute taking a path string. - **I5, providers.** The dependents of the provider port are a closed list. -- **Compile-out.** With default features the resolved closure of `nocterm` holds no user-plugin - crate. - **Guest-only crates.** A crate listed under `guest_only` (the plugin SDK, whose `export!` macro writes the symbols and manifest section of a guest module) has no row, because I4 would reject - that macro. Instead it must be absent from the `nocterm` closure, with and without - `user-plugins`; development dependencies do not count. The rule also fails when the application + that macro. Instead it must be absent from the `nocterm` closure; development dependencies do not count. The rule also fails when the application or a listed crate is not a workspace package ([ADR 0092](../adr/0092-plugin-sdk-and-developer-sessions.md)). - **Test hooks.** A crate that offers a test-only constructor behind a `test-support` feature lists it under `test_features` in the policy (empty today). The feature must not be enabled by any - normal or build dependency edge of `nocterm` with `user-plugins` (the default build holds no such - crate); development dependencies may enable it. + normal or build dependency edge of `nocterm`; development dependencies may enable it. - **Banned features.** A package listed under `banned_features` (`wasmi` with `auto-dispatch`, which overflowed the stack at the optimization level the workspace builds it with) must resolve without the feature in `cargo tree` over every member, every feature and every kind of edge, so @@ -189,9 +185,6 @@ change except wording needs a higher `api_version`; entries the base marked depr removed on a higher major version. A base without the file passes with a notice ([ADR 0093](../adr/0093-user-plugins-start-off-and-the-api-stays-compatible.md)). -`scripts/test-release-pipeline.cjs` also fails when a package or release workflow step builds -with `user-plugins`. - ## History and maintained documentation CI runs [`check-architecture-history.py`](../../scripts/check-architecture-history.py) diff --git a/docs/architecture/service.md b/docs/architecture/service.md index ad0c1178..8af3fa8c 100644 --- a/docs/architecture/service.md +++ b/docs/architecture/service.md @@ -362,7 +362,7 @@ vault, saved workspaces, installed themes, layout sizes, keymap, recordings) sav place, `UserShell::install`, which a held run (`--safe-mode`, or `[plugins] user_plugins` not set) leaves without a host, runtime, records, data or package store ([ADR 0093](../adr/0093-user-plugins-start-off-and-the-api-stays-compatible.md)). A provider lives in the crate -whose state it reads, behind that crate's `user-plugins` feature, and is passive: it answers from +whose state it reads and is passive: it answers from what the user's own UI already holds (never reading an entity that may be updating) and never starts a sampler, watch or connection ([ADR 0090](../adr/0090-user-plugin-host-and-passive-providers.md)). The isolation rules for both diff --git a/docs/plugins/README.md b/docs/plugins/README.md index 243d6a7a..496a0c8d 100644 --- a/docs/plugins/README.md +++ b/docs/plugins/README.md @@ -5,9 +5,8 @@ module that carries the manifest. Both are drawn by the host inside the status b and the toolbars around the tabs, and neither can reach more than the capabilities the user agreed to. -User plugins are compiled in with the cargo feature `nocterm/user-plugins`; release builds are -made without it. A build with the feature loads no plugin until the user allows it, and -`nocterm --safe-mode` loads none whatever the setting says. +User plugins are part of every build, releases included ([ADR 0161](../adr/0161-user-plugins-ship-in-every-build.md)). A run loads no +plugin until the user allows it, and `nocterm --safe-mode` loads none whatever the setting says. | Document | What it is | | --- | --- | diff --git a/docs/plugins/guide.md b/docs/plugins/guide.md index a0131a4c..88448e4c 100644 --- a/docs/plugins/guide.md +++ b/docs/plugins/guide.md @@ -1,14 +1,13 @@ # Writing a user plugin (preview) -Preview. User plugins exist only in a build made with `cargo build --features user-plugins`; -release builds are made without it. Until the first release that contains +Preview. User plugins are part of every build, releases included. Until the first release that contains `crates/plugin-api/api-surface.json` the contract may still change; from that release on a change that breaks a published plugin needs a new API version ([compatibility](README.md#compatibility)). The [reference](reference.md) lists every name and limit this guide uses; it is generated from the code and always current. Editors can check a manifest against [`manifest.schema.json`](manifest.schema.json). -A build with the feature still starts without user plugins. The user allows them in Settings > +Nocterm still starts without user plugins. The user allows them in Settings > Plugins > User plugins ("Allow user plugins") or with `user_plugins = true` in the `[plugins]` section of `settings.toml`, and the choice applies at the next start. `nocterm --safe-mode` starts without any user plugin, whatever the switch says. diff --git a/docs/reference/settings.md b/docs/reference/settings.md index 887d412a..0a31cf2d 100644 --- a/docs/reference/settings.md +++ b/docs/reference/settings.md @@ -65,7 +65,7 @@ | `monitor.local` | "boolean" | `true` | Watch this computer while no remote session is active. | | `monitor.status_bar` | "array" | `["cpu","memory"]` | What the status bar shows, in this order. | | `plugins.disabled` | "array" | `[]` | Ids of the disabled system plugins. A disabled plugin's panels and widgets are not shown in any window; its settings stay available. Required plugins cannot be disabled. | -| `plugins.user_plugins` | "boolean" | `false` | Whether a build with the `user-plugins` feature loads user plugins at the start. Off by default and read only by such builds, once, at the start: a change applies at the next start. Release builds are made without the feature, so the switch does nothing there. Left out of the file while off. | +| `plugins.user_plugins` | "boolean" | `false` | Whether the application loads user plugins at the start. Off by default and read once, at the start: a change applies at the next start. Left out of the file while off. | | `ssh.connect_timeout_secs` | "integer"; 1–600 | `15` | Seconds to wait for a host to answer before giving up. | | `ssh.keepalive_interval_secs` | "integer"; 0–3600 | `30` | Seconds between keep-alive probes on an idle connection. 0 turns them off. | | `ssh.launch.args` | "array" | `[]` | Individual executable arguments, without shell parsing. | diff --git a/licensing/sources.json b/licensing/sources.json index eb940ca9..5d12a5fe 100644 --- a/licensing/sources.json +++ b/licensing/sources.json @@ -677,5 +677,51 @@ "sha256": "121194741d4a915b9f5890fdd6dd95121f9b1f816517c792358d72d7c838d664", "component": "devicon-language-icons", "version": "54cfe13ac10eaa1ef817a343ab0a9437eb3c2e08" + }, + { + "packages": [ + "wasmi@2.0.0", + "wasmi_collections@2.0.0", + "wasmi_core@2.0.0", + "wasmi_ir@2.0.0" + ], + "path": "upstream/wasmi-labs-wasmi-license-apache-f031c1608e4a.txt", + "url": "https://raw.githubusercontent.com/wasmi-labs/wasmi/2970aa871cc1001b57b267ccecdcd1e42306199e/LICENSE-APACHE", + "sha256": "f031c1608e4a19e8cbcc3394cdba838067e79189610227459e8ffcd669e6f52d" + }, + { + "packages": [ + "wasmi@2.0.0", + "wasmi_collections@2.0.0", + "wasmi_core@2.0.0", + "wasmi_ir@2.0.0" + ], + "path": "upstream/wasmi-labs-wasmi-license-mit-172bc1497507.txt", + "url": "https://raw.githubusercontent.com/wasmi-labs/wasmi/2970aa871cc1001b57b267ccecdcd1e42306199e/LICENSE-MIT", + "sha256": "172bc1497507c1c363496bc23b0f16de8fa8e94befa85db6c8d9fa790e0a8657" + }, + { + "packages": [ + "wasmparser@0.228.0" + ], + "path": "upstream/bytecodealliance-wasm-tools-license-apache-llvm-exception-268872b9816f.txt", + "url": "https://raw.githubusercontent.com/bytecodealliance/wasm-tools/e66235859a6ec0502bf6f9dcc358953eda4cafcc/LICENSE-Apache-2.0_WITH_LLVM-exception", + "sha256": "268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5" + }, + { + "packages": [ + "wasmparser@0.228.0" + ], + "path": "upstream/bytecodealliance-wasm-tools-license-apache-a60eea817514.txt", + "url": "https://raw.githubusercontent.com/bytecodealliance/wasm-tools/e66235859a6ec0502bf6f9dcc358953eda4cafcc/LICENSE-APACHE", + "sha256": "a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2" + }, + { + "packages": [ + "wasmparser@0.228.0" + ], + "path": "upstream/bytecodealliance-wasm-tools-license-mit-23f18e03dc49.txt", + "url": "https://raw.githubusercontent.com/bytecodealliance/wasm-tools/e66235859a6ec0502bf6f9dcc358953eda4cafcc/LICENSE-MIT", + "sha256": "23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3" } ] diff --git a/licensing/upstream/bytecodealliance-wasm-tools-license-apache-a60eea817514.txt b/licensing/upstream/bytecodealliance-wasm-tools-license-apache-a60eea817514.txt new file mode 100644 index 00000000..16fe87b0 --- /dev/null +++ b/licensing/upstream/bytecodealliance-wasm-tools-license-apache-a60eea817514.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/licensing/upstream/bytecodealliance-wasm-tools-license-apache-llvm-exception-268872b9816f.txt b/licensing/upstream/bytecodealliance-wasm-tools-license-apache-llvm-exception-268872b9816f.txt new file mode 100644 index 00000000..f9d81955 --- /dev/null +++ b/licensing/upstream/bytecodealliance-wasm-tools-license-apache-llvm-exception-268872b9816f.txt @@ -0,0 +1,220 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +--- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + diff --git a/licensing/upstream/bytecodealliance-wasm-tools-license-mit-23f18e03dc49.txt b/licensing/upstream/bytecodealliance-wasm-tools-license-mit-23f18e03dc49.txt new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/licensing/upstream/bytecodealliance-wasm-tools-license-mit-23f18e03dc49.txt @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/licensing/upstream/wasmi-labs-wasmi-license-apache-f031c1608e4a.txt b/licensing/upstream/wasmi-labs-wasmi-license-apache-f031c1608e4a.txt new file mode 100644 index 00000000..b35f96d2 --- /dev/null +++ b/licensing/upstream/wasmi-labs-wasmi-license-apache-f031c1608e4a.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright (c) 2018-2024 Robin Freyler + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/licensing/upstream/wasmi-labs-wasmi-license-mit-172bc1497507.txt b/licensing/upstream/wasmi-labs-wasmi-license-mit-172bc1497507.txt new file mode 100644 index 00000000..1399b075 --- /dev/null +++ b/licensing/upstream/wasmi-labs-wasmi-license-mit-172bc1497507.txt @@ -0,0 +1,25 @@ +Copyright (c) 2018-2024 Robin Freyler + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/scripts/test-release-pipeline.cjs b/scripts/test-release-pipeline.cjs index b45c365e..c9c7ab32 100644 --- a/scripts/test-release-pipeline.cjs +++ b/scripts/test-release-pipeline.cjs @@ -93,24 +93,6 @@ assert.equal(compat.steps[0].with['fetch-depth'], 0, 'the release tags are neede for (const name of Object.keys(ci.jobs).filter(name => name !== 'ci-passed')) { assert.ok(ci.jobs['ci-passed'].needs.includes(name), `CI passed must wait for ${name}`); } -// User plugins stay out of release builds until the external security review is done. A feature -// can be switched on by name, by `--all-features`, or by a value the step passes through `env` or -// `with`; the default features are checked by the xtask isolation rule (compile-out). -const FEATURE_ON = /user-plugins|--all-features/; -const settings = holder => Object.values(holder ?? {}).map(String).join('\n'); -for (const [name, file] of [['package', pkg], ['release', release]]) { - assert.doesNotMatch(settings(file.env), FEATURE_ON, `${name}.yml env must not enable user plugins`); - for (const [jobName, job] of Object.entries(file.jobs)) { - assert.doesNotMatch(settings(job.env), FEATURE_ON, `${name}.yml ${jobName} env must not enable user plugins`); - for (const step of job.steps ?? []) { - const text = [step.run ?? '', settings(step.env), settings(step.with)].join('\n'); - assert.doesNotMatch(text, FEATURE_ON, `${name}.yml ${jobName} must not build user plugins`); - } - } -} -for (const script of ['package-linux.sh', 'prepare-release-pr.sh']) { - assert.doesNotMatch(read(`scripts/${script}`), FEATURE_ON, `${script} must not build user plugins`); -} const prHistory = ci.jobs.conventions.steps.find(step => step.name === 'Check architectural baseline and vendor commit separation'); assert.equal(prHistory.env.HEAD, '${{ inputs.ref || github.event.pull_request.head.sha }}'); assert.deepEqual(release.jobs['release-validation'].needs, diff --git a/src/bootstrap.rs b/src/bootstrap.rs index dea63883..439a5ffe 100644 --- a/src/bootstrap.rs +++ b/src/bootstrap.rs @@ -294,7 +294,7 @@ impl Booted { pub(crate) fn keymap(&self) -> nocterm_keymap::KeymapHandle { self.keymap.clone() } - #[cfg(all(test, feature = "user-plugins"))] + #[cfg(test)] pub(crate) fn user_plugins(&self) -> &crate::shell_setup::UserShell { &self.user_plugins } diff --git a/src/gui_tests.rs b/src/gui_tests.rs index d63257f6..af65e70a 100644 --- a/src/gui_tests.rs +++ b/src/gui_tests.rs @@ -34,7 +34,6 @@ mod shortcuts; mod snippets; mod terminal_events; mod titlebar; -#[cfg(feature = "user-plugins")] mod user_plugins; mod vault; mod workspace_preferences; diff --git a/src/gui_tests/menu_layouts.rs b/src/gui_tests/menu_layouts.rs index 224b3365..4b25021b 100644 --- a/src/gui_tests/menu_layouts.rs +++ b/src/gui_tests/menu_layouts.rs @@ -216,7 +216,6 @@ pub(super) struct LocalWindow { pub(super) settings: nocterm_store::SettingsHandle, pub(super) workspace: Entity, /// The composed application, for the tests that read its user plugin shell. - #[cfg(feature = "user-plugins")] pub(super) booted: crate::bootstrap::Booted, } @@ -270,14 +269,11 @@ pub(super) fn open_local_window_in( }) .unwrap(); cx.run_until_parked(); - #[cfg(not(feature = "user-plugins"))] - drop(booted); LocalWindow { handle, exec, settings, workspace, - #[cfg(feature = "user-plugins")] booted, } } diff --git a/src/gui_tests/settings_pages/plugins.rs b/src/gui_tests/settings_pages/plugins.rs index d34db653..0b10c77b 100644 --- a/src/gui_tests/settings_pages/plugins.rs +++ b/src/gui_tests/settings_pages/plugins.rs @@ -342,21 +342,6 @@ fn the_clock_plugin_shows_its_settings_and_the_form_writes_the_clock_section( ); } -#[cfg(not(feature = "user-plugins"))] -#[gpui_kit::test] -fn the_default_build_has_no_user_section(cx: &mut TestAppContext) { - let (handle, _, _) = window_over("", cx); - dispatch(handle, OpenPlugins { plugin: None }, cx); - render(handle, cx); - cx.update_window(handle, |_, window, _| { - assert!(window.try_find("plugin-row:monitor").is_some()); - assert!(window.try_find("user-plugins").is_none()); - assert!(window.try_find("user-plugin-list").is_none()); - }) - .unwrap(); -} - -#[cfg(feature = "user-plugins")] #[gpui_kit::test] fn the_user_feature_adds_external_plugins_to_the_page_of_the_system_plugins( cx: &mut TestAppContext, diff --git a/src/main.rs b/src/main.rs index 395eca31..f6752c9a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,7 +19,6 @@ mod hub_agents_wiring; mod hub_server_access; mod hub_sources; mod keymap; -#[cfg(feature = "user-plugins")] mod plugin_command; mod project_setup; mod settings_pages; @@ -48,7 +47,6 @@ const AGENT_BRIDGE: &str = "agent-bridge"; /// Which user plugins this run opens. `nocterm plugin check` leaves the process here; /// `nocterm plugin dev ` starts a developer session and `nocterm --safe-mode` loads none. -#[cfg(feature = "user-plugins")] fn user_plugin_mode() -> shell_setup::UserPluginMode { match plugin_command::from_args(std::env::args_os().skip(1)) { plugin_command::Command::Exit(status) => std::process::exit(status), @@ -60,11 +58,6 @@ fn user_plugin_mode() -> shell_setup::UserPluginMode { } } -#[cfg(not(feature = "user-plugins"))] -fn user_plugin_mode() -> shell_setup::UserPluginMode { - shell_setup::UserPluginMode::default() -} - fn main() -> anyhow::Result<()> { let user_plugins = user_plugin_mode(); #[cfg(target_os = "linux")] diff --git a/src/shell_setup.rs b/src/shell_setup.rs index 38084c9a..a452f4ba 100644 --- a/src/shell_setup.rs +++ b/src/shell_setup.rs @@ -13,21 +13,14 @@ mod plugins; #[cfg(test)] mod reference; mod settings; -#[cfg(all(test, feature = "user-plugins"))] +#[cfg(test)] mod user_plugin_contract; -#[cfg(feature = "user-plugins")] mod user_plugin_panel; -// The default build has no user plugins and composes nothing in their place. -#[cfg(feature = "user-plugins")] -mod user_plugins; -#[cfg(not(feature = "user-plugins"))] -#[path = "shell_setup/no_user_plugins.rs"] mod user_plugins; pub(crate) use plugins::AppPluginToggles; pub(crate) use settings::{GuestInputs, install_guest_pages}; pub(crate) use user_plugins::UserShell; -#[cfg(feature = "user-plugins")] pub(crate) use user_plugins::check_directory; /// Every system plugin of the application. A plugin appears here once, beside the others, @@ -62,11 +55,9 @@ pub(crate) enum UserPluginMode { Installed, /// `--safe-mode`: no user plugin loads, whatever the setting says. The settings still save, /// so the switch can be changed for the next start. - #[cfg(feature = "user-plugins")] SafeMode, /// Load this file for consent in a session that loads no installed plugin, keeps the /// plugins' records, data and packages in memory, and does not write `settings.toml`. - #[cfg(feature = "user-plugins")] Dev(std::path::PathBuf), } @@ -77,16 +68,14 @@ impl UserPluginMode { pub(crate) fn saves_settings(&self) -> bool { match self { Self::Installed => true, - #[cfg(feature = "user-plugins")] Self::SafeMode => true, - #[cfg(feature = "user-plugins")] Self::Dev(_) => false, } } } /// The plugins of the installation: the system catalog, what the windows read the installed -/// plugins from, and the user plugins behind the `user-plugins` feature. +/// plugins from, and the user plugins. #[derive(Clone)] pub(crate) struct Plugins { catalog: Arc, diff --git a/src/shell_setup/no_user_plugins.rs b/src/shell_setup/no_user_plugins.rs deleted file mode 100644 index 2b865da6..00000000 --- a/src/shell_setup/no_user_plugins.rs +++ /dev/null @@ -1,84 +0,0 @@ -//! The default build has no user plugins: the plugin set never changes and no window attaches -//! anything. -use std::{rc::Rc, sync::Arc}; - -use gpui_kit::{App, Context, Window}; -use nocterm_core::{Paths, clock::WallClock}; -use nocterm_plugin_model::{PluginCatalog, PluginSet, UserAvailability}; -use nocterm_store::{SettingsHandle, ShutdownCoordinator}; -use nocterm_ui::{PluginSettingsDirectory, PluginSource, SettingsPageSpec, StaticPluginSource}; -use nocterm_workspace::{RegistrationError, Workspace}; - -use super::{AppPluginToggles, UserPluginMode}; - -/// Nothing to compose without user plugins. -#[derive(Clone)] -pub(crate) struct UserShell; - -impl UserShell { - pub(crate) fn install( - _catalog: &Arc, - _paths: &Paths, - _shutdown: &ShutdownCoordinator, - _clock: Arc, - _mode: UserPluginMode, - _settings: &SettingsHandle, - _cx: &mut App, - ) -> Self { - Self - } - - /// The system plugins only, so the set never changes. A layout that names a user plugin - /// (written by a build that has them) keeps its entries when an edit rewrites it. - pub(crate) fn source(&self, catalog: &Arc) -> Rc { - Rc::new(StaticPluginSource::new( - PluginSet::system(catalog.clone()).with_availability(UserAvailability::Held), - )) - } - - /// Nothing to tell about: there are no user plugins. - pub(crate) fn facts(&self) -> Option> { - None - } - - pub(crate) fn directory(&self, system: PluginSettingsDirectory) -> PluginSettingsDirectory { - system - } - - pub(crate) fn plugins_page( - &self, - catalog: &Arc, - toggles: Rc, - directory: PluginSettingsDirectory, - ) -> SettingsPageSpec { - nocterm_plugins_ui::settings_page(catalog.clone(), toggles, directory) - } - - pub(crate) fn window(&self, _files: &nocterm_files::Installed) -> WindowUser { - WindowUser - } -} - -/// What one window keeps of the user plugins: nothing. -pub(crate) struct WindowUser; - -impl WindowUser { - pub(crate) fn register_monitor( - &self, - installed: &nocterm_monitor_ui::Installed, - workspace: &mut Workspace, - window: &mut Window, - cx: &mut Context, - ) -> Result<(), RegistrationError> { - nocterm_monitor_ui::register(installed, workspace, window, cx) - } - - pub(crate) fn attach( - self, - _terminal: &nocterm_terminal::Installed, - _workspace: &mut Workspace, - _window: &mut Window, - _cx: &mut Context, - ) { - } -} diff --git a/src/shell_setup/plugins.rs b/src/shell_setup/plugins.rs index b174febb..732d8b6e 100644 --- a/src/shell_setup/plugins.rs +++ b/src/shell_setup/plugins.rs @@ -45,7 +45,6 @@ impl AppPluginToggles { } /// The stored choice to load user plugins, which applies at the next start. -#[cfg(feature = "user-plugins")] impl nocterm_plugins_ui::UserPluginsSwitch for AppPluginToggles { fn allowed(&self, cx: &App) -> bool { PluginEnablement::user_plugins_in(self.handle.document(cx)) @@ -194,7 +193,6 @@ mod tests { assert!(raw.contains("disabled = [\"monitor\", 3]"), "{raw}"); } - #[cfg(feature = "user-plugins")] mod user_switch { use super::*; use nocterm_plugins_ui::UserPluginsSwitch as _; diff --git a/src/startup/tests.rs b/src/startup/tests.rs index ea5815ba..f6379225 100644 --- a/src/startup/tests.rs +++ b/src/startup/tests.rs @@ -77,7 +77,6 @@ fn an_installation_saves_a_layout_edit_which_makes_the_control_meaningful(cx: &m ); } -#[cfg(feature = "user-plugins")] #[gpui_kit::test] fn a_developer_session_keeps_a_layout_edit_in_memory_and_leaves_the_saved_layouts_alone( cx: &mut TestAppContext, diff --git a/xtask/architecture-policy.toml b/xtask/architecture-policy.toml index 5ad162fc..af0de677 100644 --- a/xtask/architecture-policy.toml +++ b/xtask/architecture-policy.toml @@ -52,8 +52,8 @@ gpui = "gpui-pre" # Package whose default-feature closure must not contain a user-plugin-only crate. app = "nocterm" -# Crates that build the plugin (guest) side of the code ABI. The application never reaches them, -# with or without the user-plugins feature; they have no row because their `export!` macro +# Crates that build the plugin (guest) side of the code ABI. The application never reaches them; +# they have no row because their `export!` macro # writes the symbols and the manifest section of a guest module. guest_only = ["nocterm-plugin-sdk"] @@ -259,20 +259,8 @@ allowed = [ "nocterm-workspace", ] -# User-plugin-only crates, absent from the default-feature closure of the app (section 5.13). -[isolation.compile_out] -crates = [ - "nocterm-plugin-abi", - "nocterm-plugin-api", - "nocterm-plugin-host", - "nocterm-plugin-net", - "nocterm-plugin-packages", - "nocterm-plugin-ports", - "nocterm-plugin-view", - "nocterm-plugin-wasm", -] -# Packages whose resolved features must not hold the named feature in the default build. -features = { nocterm-plugins-ui = "user" } +# Features no build of the application may hold. +[isolation.features] # `auto-dispatch` with opt-level 3 overflowed the stack in the X0 spike; the crate selects # `portable-dispatch` and no member may bring the default back. banned_features = { wasmi = "auto-dispatch" } diff --git a/xtask/src/isolation.rs b/xtask/src/isolation.rs index fe203109..1c4b74e0 100644 --- a/xtask/src/isolation.rs +++ b/xtask/src/isolation.rs @@ -1,6 +1,6 @@ //! Guardrails that keep the plugin crates closed: the dependency graph, `std` reachability, the -//! gpui receivers, structural bans, provider crates and the compile-out of the user-plugin -//! track (docs/architecture/guardrails.md, ADR 0089). +//! gpui receivers, structural bans, provider crates and the features no build may hold +//! (docs/architecture/guardrails.md, ADR 0089). //! //! The rules guard against host-side regressions. They do not cover I/O reached through an //! allowlisted dependency's own API, nor a confused deputy; those are design-review items. @@ -24,38 +24,25 @@ mod tests; use graph::Graph; use policy::Policy; -/// Cargo feature that builds the user-plugin track; the real build, not `--all-features`. -const FEATURE: &str = "nocterm/user-plugins"; - pub(crate) fn check( root: &Path, modules: &[ratchet::Module], symbols: &ratchet::Symbols, ) -> anyhow::Result<()> { let policy = Policy::read(&root.join("xtask/architecture-policy.toml"))?; - let featured = Graph::read(root, &["--features", FEATURE])?; let default = Graph::read(root, &[])?; let gpui = if source::needs_gpui(&policy, modules) { - gpui::receiver_methods(&featured.package_directory(&policy.gpui)?.join("src"))? + gpui::receiver_methods(&default.package_directory(&policy.gpui)?.join("src"))? } else { BTreeSet::new() }; - let mut problems = graph::closure_problems(&policy, &featured); - problems.extend(graph::provider_problems(&policy, &featured)); - problems.extend(graph::compile_out_problems(&policy, &default)); - problems.extend(guest_only::problems( - &policy, - &featured, - "with user-plugins", - )); + let mut problems = graph::closure_problems(&policy, &default); + problems.extend(graph::provider_problems(&policy, &default)); problems.extend(guest_only::problems(&policy, &default, "default")); - if !policy.compile_out.test_features.is_empty() { - problems.extend(normal::test_feature_problems( - &policy, - &normal::tree(root, FEATURE)?, - )); + if !policy.features.test_features.is_empty() { + problems.extend(normal::test_feature_problems(&policy, &normal::tree(root)?)); } - if !policy.compile_out.banned_features.is_empty() { + if !policy.features.banned_features.is_empty() { problems.extend(normal::banned_feature_problems( &policy, &normal::workspace_tree(root)?, diff --git a/xtask/src/isolation/graph.rs b/xtask/src/isolation/graph.rs index f3ba9575..4608a1dd 100644 --- a/xtask/src/isolation/graph.rs +++ b/xtask/src/isolation/graph.rs @@ -1,5 +1,5 @@ //! Dependency-graph rules on a full `cargo metadata` resolve: the closure allowlist (I1), the -//! provider dependents (I5) and the compile-out of the user-plugin track. +//! and provider dependents (I5). use std::{ collections::{BTreeMap, BTreeSet}, path::{Path, PathBuf}, @@ -53,8 +53,6 @@ struct Node { id: String, #[serde(default)] deps: Vec, - #[serde(default)] - features: Vec, } #[derive(Deserialize)] @@ -174,17 +172,6 @@ impl Graph { .collect() } - fn features(&self, name: &str) -> BTreeSet<&str> { - self.full - .packages - .iter() - .filter(|package| package.name == name) - .filter_map(|package| self.nodes.get(&package.id)) - .flat_map(|&node| &self.full.resolve.nodes[node].features) - .map(String::as_str) - .collect() - } - fn is_proc_macro(&self, name: &str) -> bool { self.named(name).is_some_and(|package| { package @@ -274,26 +261,3 @@ pub(super) fn provider_problems(policy: &Policy, graph: &Graph) -> BTreeSet BTreeSet { - let mut problems = BTreeSet::new(); - if let Some(app) = graph.member(&policy.app) { - for reached in graph.closure(&app.id) { - if policy.compile_out.crates.iter().any(|name| name == reached) { - problems.insert(format!( - "compile-out: {} reaches {reached} without the user-plugins feature", - policy.app - )); - } - } - } - for (package, feature) in &policy.compile_out.features { - if graph.features(package).contains(feature.as_str()) { - problems.insert(format!( - "compile-out: {package} enables feature {feature} in the default build" - )); - } - } - problems -} diff --git a/xtask/src/isolation/guest_only.rs b/xtask/src/isolation/guest_only.rs index 359b1aa7..1f40fe44 100644 --- a/xtask/src/isolation/guest_only.rs +++ b/xtask/src/isolation/guest_only.rs @@ -1,5 +1,5 @@ //! Guest-only crates: they build the plugin side of the code ABI and never ship in the -//! application, with or without the user-plugins feature. +//! application. use std::collections::BTreeSet; use super::{graph::Graph, policy::Policy}; @@ -56,8 +56,7 @@ guest_only = ["nocterm-plugin-sdk"] [isolation.providers] allowed = [] -[isolation.compile_out] -crates = [] +[isolation.features] "#; fn policy() -> Policy { @@ -81,10 +80,10 @@ crates = [] package("nocterm-ui", &[("nocterm-plugin-sdk", "")]), package("nocterm-plugin-sdk", &[]), ]; - let found = problems(&policy(), &graph(packages), "with user-plugins"); + let found = problems(&policy(), &graph(packages), "default"); assert_eq!(found.len(), 1); let text = found.iter().next().unwrap(); - assert!(text.contains("nocterm-plugin-sdk") && text.contains("with user-plugins")); + assert!(text.contains("nocterm-plugin-sdk") && text.contains("default")); } #[test] diff --git a/xtask/src/isolation/normal.rs b/xtask/src/isolation/normal.rs index 5ad5596e..81c8a66a 100644 --- a/xtask/src/isolation/normal.rs +++ b/xtask/src/isolation/normal.rs @@ -7,13 +7,10 @@ use anyhow::bail; use super::policy::Policy; -/// `cargo tree` of the app with `feature`, normal and build edges only, one `package|features` -/// line per package. -pub(super) fn tree(root: &Path, feature: &str) -> anyhow::Result { - run( - root, - &["-p", "nocterm", "--features", feature, "-e", "normal,build"], - ) +/// `cargo tree` of the app, normal and build edges only, one `package|features` line per +/// package. +pub(super) fn tree(root: &Path) -> anyhow::Result { + run(root, &["-p", "nocterm", "-e", "normal,build"]) } /// `cargo tree` of every member with every feature and every kind of edge, in the same shape: @@ -43,18 +40,18 @@ fn run(root: &Path, selection: &[&str]) -> anyhow::Result { /// A package whose test-only feature a normal edge enables. pub(super) fn test_feature_problems(policy: &Policy, tree: &str) -> BTreeSet { - enabled(&policy.compile_out.test_features, tree) + enabled(&policy.features.test_features, tree) .map(|(name, feature)| { - format!("compile-out: {name} enables test-only feature {feature} in the normal build") + format!("features: {name} enables test-only feature {feature} in the normal build") }) .collect() } /// A package that holds a feature the policy bans everywhere. pub(super) fn banned_feature_problems(policy: &Policy, tree: &str) -> BTreeSet { - enabled(&policy.compile_out.banned_features, tree) + enabled(&policy.features.banned_features, tree) .map(|(name, feature)| { - format!("compile-out: {name} resolves with the banned feature {feature}") + format!("features: {name} resolves with the banned feature {feature}") }) .collect() } diff --git a/xtask/src/isolation/policy.rs b/xtask/src/isolation/policy.rs index 11434826..32ee1901 100644 --- a/xtask/src/isolation/policy.rs +++ b/xtask/src/isolation/policy.rs @@ -36,12 +36,9 @@ pub(super) struct Providers { #[derive(Debug, Default, Deserialize)] #[serde(deny_unknown_fields)] -pub(super) struct CompileOut { - pub(super) crates: Vec, - #[serde(default)] - pub(super) features: BTreeMap, +pub(super) struct FeaturePolicy { /// Packages whose named feature may be enabled by tests only: it must be absent from the - /// normal (non-dev) closure of the app with the user-plugins feature. + /// normal (non-dev) closure of the app. #[serde(default)] pub(super) test_features: BTreeMap, /// Packages whose named feature no build of the workspace may switch on, whoever asks for @@ -62,7 +59,7 @@ pub(super) struct Identifiers { pub(super) struct Policy { pub(super) gpui: String, pub(super) app: String, - /// Crates the application never reaches, with or without the user-plugins feature. + /// Crates the application never reaches. #[serde(default)] pub(super) guest_only: Vec, #[serde(default)] @@ -76,7 +73,7 @@ pub(super) struct Policy { #[serde(default)] pub(super) gpui_allowed: BTreeMap, pub(super) providers: Providers, - pub(super) compile_out: CompileOut, + pub(super) features: FeaturePolicy, #[serde(default)] pub(super) identifiers: BTreeMap, } diff --git a/xtask/src/isolation/tests.rs b/xtask/src/isolation/tests.rs index 8d8a496d..ff8373b3 100644 --- a/xtask/src/isolation/tests.rs +++ b/xtask/src/isolation/tests.rs @@ -70,9 +70,7 @@ notify = "Fixture: repaint request." [isolation.providers] allowed = ["nocterm", "nocterm-plugin-host", "nocterm-ui"] -[isolation.compile_out] -crates = ["nocterm-plugin-api", "nocterm-plugin-packages"] -features = { nocterm-plugins-ui = "user" } +[isolation.features] test_features = { nocterm-plugin-api = "test-support" } banned_features = { wasmi = "auto-dispatch" } @@ -321,37 +319,10 @@ fn only_listed_crates_may_depend_on_the_ports() { assert!(problems.iter().next().unwrap().contains("nocterm-files")); } -#[test] -fn the_default_build_cannot_reach_user_only_crates_or_features() { - let mut app = package("nocterm", &[("nocterm-ui", "")]); - app.member = true; - let mut packages = with(base(), app); - packages.push(package("nocterm-ui", &[])); - assert!(graph::compile_out_problems(&policy(), &graph(packages)).is_empty()); - - let mut app = package("nocterm", &[("nocterm-ui", "")]); - app.member = true; - let mut packages = with(base(), app); - packages.push(package("nocterm-ui", &[("nocterm-plugin-api", "")])); - let problems = graph::compile_out_problems(&policy(), &graph(packages)); - assert!( - problems - .iter() - .next() - .unwrap() - .contains("reaches nocterm-plugin-api") - ); - - let mut ui = package("nocterm-plugins-ui", &[]); - ui.features = vec!["user"]; - let problems = graph::compile_out_problems(&policy(), &graph(with(base(), ui))); - assert!(problems.iter().next().unwrap().contains("feature user")); -} - #[test] fn a_test_only_feature_in_the_normal_closure_is_refused() { let tree = "\ -nocterm v0.1.0 (/work/nocterm)|user-plugins +nocterm v0.1.0 (/work/nocterm)| nocterm-plugin-api v0.0.0 (/work/nocterm/crates/plugin-api)| nocterm-plugin-host v0.0.0 (/work/nocterm/crates/plugin-host)|test-support ";