Pular para o conteúdo principal
M

dsh-pouch

moon16u/dsh-pouch

Coleção de microplugins úteis para DSH: inserção do horário local por turno, reinício seguro, selo do ID da sessão, pesquisa Tavily e rotas configuráveis de cabeçalho LLM. O console MCP gerencia o `@deepseek-ai/dsh-mcp-client` oficial em execução: adicionar, editar, ativar, desativar e reconectar; opções por ferramenta; status via SSE; importar JSON `mcpServers` e migrar automaticamente entradas MCP do YAML do perfil.

Instalar

dsh plugin --profile web add github:moon16u/dsh-pouch

README

dsh-pouch logo

dsh-pouch

English | 中文

License: MIT DeepSeek Harness pnpm workspace

dsh-pouch is a monorepo of five independent, standalone DeepSeek Harness (DSH) plugins. The repository root is only a pnpm workspace — it is not a DSH bundle, not installable, and never published to npm. Install only the plugins you need.


📦 Plugins Included

PluginTypeDescription
@moon16u/dsh-plugin-restartHost / Web UISafe, detached DSH process restart commands (/restart, /dsh-restart) and agent tool (dsh_restart) with native Web UI candidate styling.
@moon16u/dsh-plugin-current-timeHost / AgentInjects the host's real date, time, and timezone into agent context at the start of every turn, so a long-running session never reasons from a stale date.
@moon16u/dsh-plugin-session-copyWeb UINative-styled Copy menu in the web session header for the session title, session directory path, and working directory.
@moon16u/dsh-plugin-web-search-tavilyCapability SeamReal-time web search provider backed by the Tavily REST API, seamlessly integrating with DSH's ctx.web capability seam.
@moon16u/dsh-plugin-mcp-consoleWeb UI + HostMCP server console in the settings page: runtime add/edit/enable/disable/reconnect/delete, per-tool switches, live status over SSE, and mcpServers JSON import. Zero MCP protocol code — everything rides the official @deepseek-ai/dsh-mcp-client. Profile-YAML MCP entries are auto-migrated into dynamic management on boot/refresh (and exportable back).

🚀 Installation

Each plugin is its own DSH bundle with its own npm package and version. Install exactly the ones you want:

dsh plugin --profile web add @moon16u/dsh-plugin-restart
dsh plugin --profile web add @moon16u/dsh-plugin-current-time
dsh plugin --profile web add @moon16u/dsh-plugin-session-copy
dsh plugin --profile web add @moon16u/dsh-plugin-web-search-tavily
dsh plugin --profile web add @moon16u/dsh-plugin-mcp-console

Restart dsh web once after installing (bundle layers compose at startup). No manual cordis.patch.yml edits are needed — every package carries its own patch.

web-search-tavily registers the provider but does not select it. To make Tavily the active search provider, add the one-line web override documented in its README.

From a local checkout

git clone https://github.com/moon16u/dsh-pouch.git ~/dsh-pouch
dsh plugin --profile web add file:~/dsh-pouch/packages/dsh-plugin-restart

Migrating from the old all-in-one bundle

@moon16u/dsh-pouch used to be a single bundle that loaded all five plugins. The last bundle release is 0.7.3, now deprecated and no longer updated. If your profile still depends on it, remove it before installing the individual packages:

dsh plugin --profile web remove @moon16u/dsh-pouch

Do not keep the old bundle and the standalone packages installed together — both load the same plugins, which duplicates the restart commands, the settings cards, and the MCP console.


🛠️ Plugin Highlights

1. @moon16u/dsh-plugin-restart

  • Problem: After editing plugins or configs, restarting DSH manually in an external terminal is tedious; killing the process directly inside an agent tool causes the session to freeze; stock commands in web chat lack native icons or localized names.
  • Solution: Exposes /restart (and backwards-compatible /dsh-restart) slash commands with native 🔄 Restart restart slash candidate styling, plus dsh_restart agent tool. Spawns an asynchronous detached worker process that returns immediately and restarts cleanly after 3 seconds.

2. @moon16u/dsh-plugin-current-time

  • Problem: A model has no clock. It infers "today" from whatever the harness injected once at startup, so a session left open across midnight keeps reasoning from yesterday's date — and nothing in the transcript contradicts it.
  • Solution: Hooks agent/pre-step and appends one wall-clock reading after the prompt on the first step of every turn. Once per turn rather than per step, so a tool-call loop does not bury the transcript in near-identical timestamps.

3. @moon16u/dsh-plugin-session-copy

  • Problem: Getting the current session's storage folder, title, or working directory out of the UI means digging through URLs, console logs, or the filesystem by hand.
  • Solution: Injects a native-styled Copy button into the web header utility bar. It opens a menu with three targets — Session title, Session directory (the session's real on-disk folder path, home prefix abbreviated to ~), and Working directory — each disabled with a stated reason until its value exists. The directory comes from one authenticated, read-only host route over the JSONL backend's public resolveCurrentLog; it only locates current-format logs, never reads log contents, and takes no write lease. An empty result may mean an unwritten session or an unsupported log format; older generations remain unavailable.

4. @moon16u/dsh-plugin-web-search-tavily

  • Problem: Built-in search engines may be restricted or lack high-quality synthesized web answers.
  • Solution: Formally implements the ctx.web.registerSearchProvider contract. Automatically resolves API keys from the TAVILY_API_KEY environment variable or DSH Credentials service.

5. @moon16u/dsh-plugin-mcp-console

  • Problem: The official way to attach MCP servers is a static cordis.patch.yml entry — no GUI, no runtime changes, and every restart to apply an edit. Declared servers show up as untouchable read-only instances.
  • Solution: A full MCP servers settings section managing the official @deepseek-ai/dsh-mcp-client at runtime: one fiber per server via cordis dynamic assembly (hot edit, no DSH restart), master switches, per-tool enable/disable pills, live status + tool lists over SSE, and mcpServers JSON import. External agents writing MCP entries into cordis.patch.yml are handled by an auto-ingest engine: on boot/refresh the entries are migrated into ~/.dsh/dsh-mcp.json (fiber takeover included, YAML trimmed precisely), reversible via POST /export-yaml. Secrets stay masked in every API response.

🧪 Testing

This monorepo uses pnpm workspaces and Node.js native test runner for contract and smoke tests:

cd dsh-pouch
pnpm install
pnpm test

📄 License & Credits

Plugins relacionados