The dialog inspects a source and shows its commit, but the agent half
cloned the branch tip at Install time: a branch that moved in between put
down a tree nobody reviewed, and the desktop half copied out of that
checkout followed it. Native Electron's probe returned no commit at all, so
its desktop clone had the same gap.
- plugins.manage install takes `inspected_sha` (custom sources without a
pin). The clone stays an ordinary branch checkout and is refused when its
tip is not that commit: "The source changed since you reviewed it ...
Re-open the install dialog". Not `ref`, which records a pin that refuses
every later `update`; not a detached checkout at the old commit, which
`git pull` cannot update. Catalog picks keep their pin.
- That install drops inspect's kept answer for the source, so re-opening
the dialog reads the moved branch instead of the stale commit.
- Electron: probePluginRepo returns the commit it read; installDesktopPlugin
takes it and installs exactly that tree (fetch + verify) or refuses.
Hardening on top of the contributor's Webapp install path (salvage #146132). A browser tab asks the
serving host to clone code onto it, so the host now decides what lands, not the tab:
- `ref` is required: the 40-hex commit the dialog showed (or the user's pin). The clone is checked
out at exactly that commit and the halves are read from that checkout, instead of re-using a
ten-minute inspection cache and installing whatever it named; a catalog install whose pin moved is
refused. `forget_inspection` goes away with the cache dependency.
- https only: `file://` would copy any folder of the host, `ssh`/`git@` spends the host's keys,
`http://` can be rewritten in transit. Native Desktop keeps those for a user at their own machine.
- The published tree may hold no symbolic link (a `desktop -> /anywhere` link in a repository
published that host folder) and is capped at 64 MB.
- A standalone plugin's in-tree `.hermes-package.json` is dropped as Electron's installer drops it:
only an installer writes the marker that pairs a folder with an agent package.
- `desktop_plugin_halves`: the helpers the installer shares become public names instead of
wrapper functions around private ones.
- Renderer sends `ref: plan.ref ?? plan.probe.sha`.
- Tests: the contributor's installer/RPC/route cases now run through an https identifier at a real
commit (only the clone's network leg points at the local repository); RPC cases folded into one
round trip; two added invariants (https only, link escape), each proven red with its guard removed.
In the browser-hosted app, installing a desktop plugin dead-ended: the install dialog could inspect a
repository through the gateway (`plugins.manage inspect`, #145770) but had nothing to install with.
A desktop-only package answered "This package has nothing to install here." and the desktop half of a
mixed one was skipped with a toast, because the only clone lived in Electron
(`installDesktopPluginFromGit`). Since #145072 the Webapp *loads* whatever sits in
`<root>/desktop-plugins/`, so the last mile was missing: no way to put it there from the UI.
This adds `plugins.manage` `install_desktop` / `remove_desktop` — the backend half of that install —
and points the dialog at them when it is not running in Electron.
- `hermes_cli/desktop_plugin_install.py`: clones a repository's desktop half into the app-level
`desktop-plugins/` root. Same resolution, folder name and package-marker rules as Electron, and the
same staged-copy-then-rename publication under the root's writer lock, so a reconcile pass cannot
copy a folder underneath it. The clone is held to the commit the inspection read, so a repository
that moves after review cannot install a tree nobody looked at; `force` re-inspects (a forced
reinstall means the repository moved). `remove_desktop_plugin` refuses a package's own half unless
forced, and refuses a linked folder it would only half-delete.
- `plugins_cmd_inspect.forget_inspection`: drops the ten-minute answer cache, used by a forced
reinstall.
- `desktop_plugin_halves`: `ROOT_WRITER` and `publish_desktop_tree`/`read_package_marker`/`mtime_ms`
go public (the installer shares the root's lock), a standalone plugin publishes with no marker, and
the Webapp's read router imports the root from the one place that defines it.
- `plugins.manage install_desktop|remove_desktop` + contract (`tools_mcp_plugins`), regenerated.
- Renderer: `desktopInstallSupported()` is also true in a browser-hosted tab, `cloneDesktopHalf` falls
back to the gateway, and a backend that predates the action keeps the old "unavailable in this
environment" wording. Uninstalling a disk plugin uses the same fallback.
- Docs: the Webapp install/remove paragraph now describes the working path.
Tests: 10 installer (real local clones: standalone vs package marker, force, sha pinning, path-shaped
names, linked folder, removal rules), 6 gateway RPC (incl. contract validation), 3 browser-modal cases
(desktop-only, both halves, old backend) beside the 6 existing ones, and one route test that installs
through the backend and then reads the plugin back over `/api/desktop-plugins/*` — the whole trip the
browser makes.
A plugin.yaml alone does not make an agent half: desktop-only catalog
plugins (agent-log, githermes, deepseek-whale) ship one beside
desktop/plugin.js as metadata, and the previous commit's rule would plan
an agent install for them that loads nothing. The old __init__.py
requirement was what kept them desktop-only.
Both inspectors now call a plugin.yaml folder an agent half when it has
an agent payload beside the manifest: __init__.py, a dashboard tab or
backend (dashboard/manifest.json), or a manifest-only language pack
(provides_locales plus locales/, the loader's own rule). plugin.json
stays an agent half on its own. The shared detection fixture gains the
cron-bulletin shape, a dashboard-only package, the desktop-only shape and
three language-pack cases; its existing cases are unchanged.
Co-authored-by: dandacompany <128420625+dandacompany@users.noreply.github.com>
`detectPluginComponents` (Electron) and `detect_components` (gateway) required
`plugin.yaml` AND `__init__.py` before calling a folder an agent half. Catalog
plugins that ship a `dashboard/plugin_api.py` backend and no `register(ctx)` —
hermes-cron-bulletin, iowap-hermes-integration and other unified packages — were
therefore reported as desktop-only:
- the install dialog planned the desktop half alone, so `installAgentHalf` never
ran: nothing landed on the backend (local or a remote gateway) and every
`ctx.rest` call answered 404 while the pane sat in the sidebar;
- a manifest-only package with no `desktop/plugin.js` was refused outright with
"No agent or desktop plugin artifacts found", although `hermes plugins
validate` admits it ("manifest-only plugin") and `hermes plugins install`
installs it.
A manifest is enough to mean "this folder is the agent-side package". Update both
inspectors and the fixture they share, and cover the Electron case.
The gateway inspection reported which halves a source ships but not the
commit it read, so for an unpinned Install from Git the reviewed tree and
the installed tree could differ if the source moved in between. Return
the inspected HEAD as `sha` (a catalog entry's is its reviewed pin) and
carry it through inspectAgentPlugin, so the install can be held to it the
way the native Desktop probe's will be. A cached answer keeps the sha it
read.
The component-detection rules now live in two inspectors (Python and
Electron). tests/fixtures/plugin_component_detection.json holds one set
of cases both run, registered as a shared fixture so editing it runs the
pytest and vitest consumers.
The browser waits 120s for plugins.manage inspect, but a clone may run up to plugins.clone_timeout_seconds per Git step (300s default, 3600s max). A slow but valid repository finished after the client gave up, and Retry started another clone under the same deadline, so the install never got past inspection.
A repeat of the same inspection (profile home, catalog name, source) now joins the clone still running for it, or reads a successful answer it produced within ten minutes. Failed reads are never kept, so Retry after a real failure inspects afresh, and each profile keeps its own answers.
Windows footgun gate: manifests read with utf-8-sig so a BOM-prefixed plugin.yaml/plugin.json is still recognised, and the inspection tests decode git output as UTF-8 instead of the locale codepage.
The install dialog inspected a repository only through Electron's
probePluginRepo. The browser-hosted app has no such bridge, so every
install stopped at "Plugin inspection is unavailable in this
environment" with a Retry that could never succeed.
Add a read-only plugins.manage inspect action. It resolves the source
with the installer's own rules, applies the kill list, clones into a
temporary directory outside every profile (catalog entries at their
reviewed pin) and reads only the manifest files; no plugin code is
imported or run. The renderer keeps Electron's inspection when present
and otherwise asks the gateway, with the same stale-result protection.
In the browser a desktop half cannot be installed: a mixed package now
installs its agent half and reports the desktop half as unavailable,
never as installed, and a desktop-only package says there is nothing to
install. Retry is hidden when it cannot help (inspection unsupported by
the backend, nothing installable here).