Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .claude/skills/gate/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/plugin-api/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
78 changes: 21 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
34 changes: 8 additions & 26 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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"] }

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading
Loading