# dsh-plugin-marketplace

> 把 GitHub `dsh-plugin` 话题拉成可搜索、可一键安装/更新/卸载的 DSH 插件市场设置面板，并给 agent 配齐四个市场工具。

## Metadata

- Author: [@AwesomeHou](https://github.com/AwesomeHou)
- Repo: <https://github.com/AwesomeHou/dsh-plugin-marketplace.git>
- GitHub: [AwesomeHou/dsh-plugin-marketplace](https://github.com/AwesomeHou/dsh-plugin-marketplace)
- Stars: 26
- Language: JavaScript
- License: [MIT](https://spdx.org/licenses/MIT.html)
- Topics: `ai-agent`, `cordis`, `deepseek`, `deepseek-harness`, `dsh`, `dsh-plugin`, `plugin`, `plugin-marketplace`
- Forks: 4
- Open Issues: 1
- Last push: 2026-08-19T07:59:29.000Z
- Added: 2026-08-20T00:00:00.000Z

## Install

```bash
dsh plugin --profile web add github:AwesomeHou/dsh-plugin-marketplace
```

## Wiki

## One-Line Positioning
The "Plugin Marketplace" entry for DeepSeek Harness: pull all repositories with the `dsh-plugin` topic on GitHub into a searchable list, allowing you to install, update, disable, and uninstall plugins with one click in the settings panel. Agents can also call tools with the same names to search and install.

## Core Capabilities
- Sync GitHub `dsh-plugin` topic (default 50 per page, max 100), supports paginated loading and keyword search; search uses GitHub's own `q`, so it searches the entire topic, not just loaded pages
- One-click card install, start async task with real-time display of stage, percentage, downloaded bytes, network speed, ETA, and recent log lines; cancellable mid-way
- Distinguish root-level plugins from monorepo workspaces: prioritize npm-published versions (skip GitHub fetch, runtime dependencies installed together), monorepo roots clone source and use corepack pnpm to build, then register with `link:`
- "Installed" tab manages third-party plugins: check for latest version, update, disable/enable, uninstall; when this plugin itself has a new version, show banner on both tabs
- Register 4 tools for the agent: `market_search` / `market_install` / `market_installed` / `market_update`, enabling the model to search and install plugins autonomously

## Technical Implementation
- **Language**: JavaScript (ESM, pure Node built-in modules, no npm dependencies)
- **Key dependencies**: `node:child_process` (calls `dsh plugin`), `node:net` (loopback proxy for real-time download byte/speed stats), `node:fs` + `node:path` (read/write profile manifest, clone source to `$DSH_HOME/marketplace-src`), `fetch` (calls GitHub Search / npm registry / translation service)
- **Architecture pattern**: Dual half-bundle plugin — Host half (`lib/index.js`) injects itself into Loader via `cordis.patch.yml`, registers `/api/market/*` same-origin HTTP endpoints and model tools; Client half (`lib/client.js`) declares itself via `dsh.client` as a browser module, uses React to register two `settings.plugins.tab` entries; ends communicate via `fetch` (permanent plugin has no sandbox RPC)
- **Entry files**: `lib/index.js` (host injects `webServer` / `timer` / `tools`), `lib/client.js` (client injects `slots` / `sessions` / `workspaces`)

## Use Cases
- After installing DSH, you want to "discover and install community plugins with one click" instead of manually running `git clone` and modifying `package.json`.
- You want agents to search and install plugins themselves (e.g., user says "install a plugin that translates web pages"), using `market_search` + `market_install`.
- After installing multiple third-party plugins, you need unified management: see which have new versions, disable unused ones, uninstall those you want to replace—without editing the profile manifest.

## Prerequisites and Compatibility

| Dependency | Minimum Version | Description |
|---|---|---|
| DSH Harness | Not declared | Requires exposure of `webServer` / `timer` / `tools` services and `settings.plugins.tab` slot, client `slots`/`sessions`/`workspaces` services; not explicitly declared in `package.json` |
| Node | Not declared | Source uses `AbortSignal.timeout()` (Node ≥17.3) and global `fetch` (Node ≥18), not explicitly declared in `package.json#engines` |
| pnpm | Any | Subprocess injection sets `CI=true` (pnpm ≥10 without TTY no longer waits indefinitely for interactive prompts), locks store path via `--config.store-dir` to prevent cross-major version drift |
| git | Any | Handles cloning/pulling GitHub repositories for monorepo workspaces |
| Platform | Cross-platform | Windows uses `taskkill /T /F` to kill process trees, POSIX uses `kill(-pid)`, dedicated branches for both environments |
| Native modules | None | Uses all Node built-in modules, zero native dependencies |

## Installation

```bash
dsh plugin --profile web add github:AwesomeHou/dsh-plugin-marketplace
```

## Configuration

| Config | Type | Description | Default |
|---|---|---|---|
| `DSH_HOME` | Environment variable | Determines web profile directory (`$DSH_HOME/profiles/web`) and marketplace source/workspace directory | `~/.dsh` (harness default) |
| `DSH_MARKET_STALL_MS` | Environment variable | Installation stall watchdog threshold: process tree killed if subprocess has no output or byte growth for this duration, then reconnects once (seconds) | 120 |

> Note: Neither of these environment variables are "required config"—defaults are used if not set. The plugin itself has no separate config file.

## FAQ

**Q: Do I need to restart harness after installation?**

A: Yes. This plugin is a permanent (bundle) plugin—installation/update/uninstall, disable/enable, and updates to this plugin itself all require restarting the DSH harness to be truly loaded by Loader. A "restart to take effect" prompt appears at the top of the page.

**Q: Why does the "Installed" tab only show plugins I installed afterward—where are the built-in ones from harness?**

A: This is intentional. Harness's built-in plugins are in the profile template's `dsh.profile.bundles` and cannot be disabled or uninstalled. Only third-party plugins you install into `dependencies` appear in "Installed", with a declaration at the top of the page explaining this.

**Q: Installing a certain plugin is stuck at "Resolving dependencies 8%" for over ten minutes—why?**

A: Usually a network issue (GitHub unreachable or too slow). The default 120 seconds without progress triggers the stall watchdog to automatically kill and reconnect once; if it stalls again, it fails fast with "Check network and retry, or use 'Let agent install'". To extend wait time, set `DSH_MARKET_STALL_MS=300` (seconds).

**Q: When does the "Let agent install" button appear? Is it safe?**

A: It appears when direct install fails. Its implementation: host first ensures a dedicated workspace directory exists (`$DSH_HOME/marketplace-install`), then client calls runtime's `workspaces.create` / `sessions.create` / `sessions.open` to create a new session in that workspace and switch to it, sending the install task to that new session—no pollution to current session, no manual workspace selection needed. If runtime's session/workspace services are unavailable, it falls back to sending the task to the current session.

**Q: How does the plugin marketplace know it has a new version? Could it misjudge?**

A: It reads the `repository` field declared in its own `package.json`, compares it against the `version` on GitHub's default branch, and shows "vX → vY · Update now" at the top of both tabs when there's a new version. It explicitly uses its own GitHub repo rather than a bare npm name—because `dsh-plugin-marketplace` is owned by someone else in the npm registry, using the bare name would pull an unrelated package.

## Difficulty Level
Beginner — One installation command, restart and use immediately; when installation fails, follow the error message directly or click "Let agent install", no manual manifest or config file editing needed.

## Known Issues and Limitations
- Only supports web profile plugin management (CLI/headless profile not covered)
- Installation uses `dsh plugin add -w`, requiring the target profile to be a valid pnpm workspace (needs `pnpm-workspace.yaml`); if not, it gives a clear error, but this plugin cannot automatically create the workspace file for you
- Plugins declaring pre-release peer dependencies like `@deepseek-ai/*@^0.1.0-rc.6` will be rejected by pnpm on direct install (`ERR_PNPM_NO_MATCHING_VERSION`), need to use "Let agent install" as fallback
- Installed plugins' "latest version" is cached for 15 minutes; list loading/installed queries may slightly lag behind npm registry or GitHub
- In extremely poor network conditions, the stall watchdog may falsely kill normal long dependency resolution (threshold can be adjusted via `DSH_MARKET_STALL_MS`)
- "Let agent install" requires client runtime's `sessions` / `workspaces` services to both be available; when services are missing, it falls back to sending to current session, which pollutes the current conversation

---

This document is auto-generated by [deepseek-plugin.org](https://deepseek-plugin.org). HTML page: [dsh-plugin-marketplace](https://deepseek-plugin.org/plugins/AwesomeHou/dsh-plugin-marketplace)
Wiki generated by AI (model: `MiniMax-M2.5`)
