feat(desktop): wire the Plugins screen to real data (list_plugins)#124
Merged
Conversation
…mand) The Plugins screen rendered but `window.deepcode.plugins.list()` was stubbed to []. The renderer can't run core's discoverPlugins (node:fs), so add a Rust command that reads ~/.deepcode/plugins/*/plugin.json. - commands.rs: `list_plugins` + a pure `collect_plugins(home)` helper — reads each plugin.json (requires name+version, mirroring readManifest), cross-refs ~/.deepcode/plugins-trust.json + settings.disabledPlugins. Emits the shape the screen's PluginRow expects (camelCase: contributedHookEvents from contributes.hooks, sourceHash + trustedBy from the trust manifest, a `warning` for installed-but-untrusted). A plugin is `enabled` only when trusted AND not disabled — matching what the agent loads. - lib.rs: registered the command. - tauri-api.ts: `listPlugins()` + `PluginInfo` type; window-shim plugins.list() calls it (graceful [] on error). Tests: +3 Rust (cargo) — camelCase serde contract, collect_plugins reads manifests + trust (trusted→enabled, untrusted→warning), empty without dir; +1 renderer (tauri-api.test.ts) — list_plugins command name + passthrough. Desktop 27 green; Rust 12 green (cargo test). Note: the Skills screen's built-in set still needs the .app resource bundling (the same v1.1 work that leaves cli_path() returning None), so it's not wired here. `deepcode skills list` (CLI) covers skills today. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The desktop Plugins screen rendered but
window.deepcode.plugins.list()was stubbed to[]. Since the renderer can't run core'sdiscoverPlugins(it needsnode:fs), this adds a Rust command that reads~/.deepcode/plugins/*/plugin.jsonand feeds the existing screen.Changes
commands.rs:list_plugins+ a purecollect_plugins(home)helper. Reads eachplugin.json(requiresname+version, mirroring core'sreadManifest), cross-references~/.deepcode/plugins-trust.jsonandsettings.disabledPlugins. Emits exactly the shape the screen'sPluginRowexpects (camelCase viarename_all):contributedHookEvents(fromcontributes.hooks),sourceHash+trustedBy(from the trust manifest), and awarningfor installed-but-untrusted plugins. A plugin isenabledonly when trusted AND not disabled — matching what the agent actually loads.lib.rs: registered the command.tauri-api.ts:listPlugins()+PluginInfotype;window-shim.tsplugins.list()calls it (graceful[]on error).Tests
cargo test, 12 green): camelCase serde contract (§8a),collect_pluginsreads manifests + trust (trusted→enabled, untrusted→warning), empty-without-dir.tauri-api.test.ts, desktop 27 green): asserts thelist_pluginscommand name + passthrough.Scope note
The Skills screen's built-in set still needs the
.appresource bundling — the same v1.1 work that currently leavescli_path()returningNone(built-in skills aren't on a fixed runtime path like plugins are).deepcode skills list(CLI, #123) covers skills today. Plugin install from the GUI also remains a separate follow-up (the toggle already persists viasettings.disabledPlugins).🤖 Generated with Claude Code