Skip to content

Move power verbs into a bundled system plugin#54

Merged
Mechazawa merged 4 commits into
masterfrom
feat/system-plugin
Jun 12, 2026
Merged

Move power verbs into a bundled system plugin#54
Mechazawa merged 4 commits into
masterfrom
feat/system-plugin

Conversation

@Mechazawa

Copy link
Copy Markdown
Owner

The power verbs (shutdown, sleep, restart/reboot, lock, log out, screensaver, display sleep, empty trash, eject) were Core built-ins in src/plugins/builtin/core.rs. They only emit exec, which is already plugin-legal, so they don't need host privilege.

They now live in a bundled JS plugin, plugins/system/. Each verb is a bool option (all default on), so it gets its own toggle in Settings → Plugins → System; the standard per-plugin toggle disables every verb at once. OS detection uses node:os, and the per-OS command matrix is carried over unchanged from core.rs.

Core keeps the verbs that emit host-only actions the JS boundary rejects (quit, openSettings, reloadPlugin, install, update) plus the version readout.

eject ships a macOS command only; its row is omitted on Linux, since gio mount --eject needs a target device.

Verification

  • cargo test, cargo clippy --all-targets, cargo fmt --check: clean.
  • plugins/system vitest: 12 tests covering OS gating, per-verb option gating, exec action shape, and prefix-match scoring.

🤖 Generated with Claude Code

Mechazawa and others added 4 commits June 12, 2026 14:01
shutdown, sleep, restart/reboot, lock, log out, screensaver, display
sleep, empty trash, and eject were Core built-ins. They only emit
`exec`, which is plugin-legal, so they don't need host privilege. Each
is now a `bool` option in the bundled `system` plugin, giving every
verb its own on/off toggle in Settings (all default on); the standard
per-plugin toggle disables the lot.

Core keeps the verbs that emit host-only actions (quit, settings,
install, reload, update) and the version readout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the "exec is plugin-legal" jargon; what a reader needs is the rule
that keeps an exec-only verb out of the host built-ins.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A new workspace member (`system`) isn't in plugins/package-lock.json,
which fails `npm ci` (exact-sync only). `npm install` reconciles the
lockfile in CI without a committed bump. Also add `system` to the
vitest matrix so its tests run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The packager resources list is an explicit allowlist; without these two
entries the system plugin ships in neither the app bundle nor the Linux
packages, so the daemon never seeds it. Mirrors every other bundled
plugin (manifest.json + plugin.js).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Mechazawa Mechazawa merged commit 4c663ff into master Jun 12, 2026
15 checks passed
@Mechazawa Mechazawa deleted the feat/system-plugin branch June 12, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant