packages/dsh-plugin-manager
zhu1090093659/dsh-web设置 → 插件 分区里的插件管理 Tab:从 npm/git 安装带进度、下次启动生效的启停开关、安装冲突对账可撤销、失败一键转交修复会话。
plugin-console
Thin console — a plugin management panel inside the DSH Web settings page Manage profile plugin installation state with 0 patches: bundle layer stack + insert rows + enable/disable. Read and write the profile installation state without hand-editing config and without introducing any patch.
An official bundle plugin (dsh.bundle + dsh.client declarations): the Node half registers the /api/plugin-console route, and the client half registers a "Plugin Management" panel in the settings page (tab named to avoid colliding with the official "Plugins" tab). The panel has two management areas:
Area · Responsibility · Actions · Write location Install plugin · Unified install entry: bundle and non-bundle are routed automatically · Enter an npm package name / GitHub project (https://github.com/o/r, github.com/o/r, github:o/r; URLs normalized automatically) → install · bundle → profile package.json dependency + dsh.profile.bundles layer stack (takes effect on restart); non-bundle → insert row in profile cordis.patch.yml (applies live via config HMR, zero restart) Loaded plugins · Inspect the status of all loaded plugins (bundle + built-in) · Check for updates / update (user bundles) / disable, enable (user bundles) / uninstall (user bundles) · disabled flag in profile cordis.patch.yml (persisted) + layer stack
0811 background: the official build removed the repository-plugins mechanism (vendor/loader/src/repository.ts deleted); external plugins are now installed uniformly through the web profile. 0811 kept config-level HMR (when web-app disables module-level hmr, profile-boot actively mounts a watch-only instance) — edits to profile cordis.patch.yml apply live, and insert rows mount without a restart (verified in practice).
Install commands and options (git-source one-liner / npm source / local directory) are in the README "Installation" section at the repository root. Build artifacts are committed, so the git-source one-liner installs directly (measured ~15 s); the npm source is published (@vlln/plugin-console):
dsh plugin --profile web add "github:vlln/plugin-registry#path:/packages/plugin/console" # git source (true one-liner; #path: form — no & — so it also works when dsh forwards args through cmd.exe on Windows)
# or npm source: dsh plugin --profile web add @vlln/plugin-console@0.1.0After mounting, refresh the Web page and the "Plugin Management" panel appears in the settings page (settings.section slot).
https://github.com/o/r / github.com/o/r / github:o/r; URLs are normalized to github:o/r) → automatic pnpm add, routed by whether the package declares dsh.bundle: bundle → layer stack (takes effect on restart); non-bundle → insert row (mounts live via config HMR, zero restart)Beyond the panel, the Node half registers 4 agent tools (defineTool, writing the same installation state as the panel):
Tool · Params · Behavior plugin_search · query?, source?, refresh? · Search the source set (cached enumeration); default is the hub catalog (configured index.json); passing a new index JSON file/URL via source probes it lazily and remembers it plugin_install · source · npm package name / GitHub project (https://github.com/o/r, github.com/o/r, github:o/r; URLs normalized automatically): declares dsh.bundle → pnpm add + layer stack (takes effect on restart); plain cordis package → pnpm add + insert row (mounts live); a failed install reports the error explicitly, never fakes success plugin_uninstall · id · Deletes the insert row (live) or the bundle dependency (takes effect on restart); the manifest entry is kept so it can be reinstalled plugin_status · id? · Without args, lists installed plugins; with an id, queries that one (including the TOFU-resolved ref)
Discovery-layer storage (protocol in plugin-discovery-design):
$DSH_HOME/plugin-sources/
├── sources.yml # index source set (hub catalog; user-editable + trust levels)
├── lock.yml # TOFU: canonical → resolved ref + content hash
└── cache/<source-id>/ # per-source enumeration snapshot (TTL 6h)The index source supports local files (file://…/catalog.json) — read a local clone when the anonymous raw of a private hub repo is unreachable. Agent-written results show up in the web panel after a refresh (same files, no live push).
The contract for creating an official bundle plugin / a plain cordis plugin is in the make-dsh-plugin skill. Reference implementation in this repo: this package (a complete example of a bundle with a self-rendered client).