DeepSeek Chat Panel / dsh-deepseek-chat-panel

Introduction

DeepSeek Harness (DSH) follows a “everything is a plugin” philosophy, embedding functionality into the Web UI as plugins. When debugging locally or using Harness, directly accessing chat.deepseek.com is blocked by the browser’s Content-Security-Policy, making direct embedding impossible. Additionally, the site uses HttpOnly cookies, which page scripts cannot read directly. The existing workarounds typically involve manually switching tabs or using an external proxy, neither of which allows deep integration with Harness’s UI.

The kokota/dsh-deepseek-chat-panel plugin opens chat.deepseek.com within Harness and maintains login state through a host-side loopback proxy, eliminating the need to re-login after page refreshes or Harness restarts.

What It Is

This is a client-side plugin for DeepSeek Harness, authored by the maintainer KokoTa. It uses a host-side reverse proxy and a page-side panel to embed chat.deepseek.com into the Harness Web UI, with automatic saving and restoration of login credentials.

Core Features

Proxy and Session Persistence

The plugin runs a reverse proxy on local 127.0.0.1:

  • Strips response headers such as frame-ancestors 'none' from upstream responses that would block iframe loading.
  • Collects upstream Set-Cookie headers and persists them to <DSH_HOME>/deepseek-chat/cookies.json (default: ~/.dsh/deepseek-chat/cookies.json).
  • Rewrites the upstream entry bundle (main.*.js) to redirect CDN asset paths to the local proxy, allowing the TTS WebSocket to choose ws or wss based on the page protocol.
  • Rewrites font and image URLs in stylesheets to proxy addresses, preventing upstream CDN CORS rules from blocking loopback-origin loads.

The page side provides a sidebar button and a full-screen overlay iframe (shell.overlay). The proxy’s actual address is queried via the same-origin GET /plugins/deepseek-chat/status endpoint in Harness. When the preferred port 3097 is occupied, the proxy automatically falls back to an available port, so the page side does not need a hardcoded port.

Session Sync (WeChat Only)

The WxLogin component used by WeChat login requires the redirect_uri to belong to its authorized domain. Since the panel runs on a loopback address, it cannot pass validation, making WeChat QR code login impossible to complete directly within the panel.

For accounts bound only to WeChat, you can import the login state via the “Sync Session” feature:

  1. Log in to chat.deepseek.com in a regular browser.
  2. Open the Console in that tab and run the copy command provided in the panel’s “Sync Session” section.
  3. Go back to Harness, open the panel, click “Sync Session”, paste the command, then click “Sync and Refresh”.

The submitted credentials pass through the local Harness Host and the loopback proxy. The page typically calls the same-origin POST /plugins/deepseek-chat/sync endpoint first; if that route is unavailable, it falls back to the proxy-side POST /__ds/sync. The Host saves the credentials as a pending-sync state and injects a script on the next document load, writing the userToken and __appKit_userInfo keys into the proxy page’s localStorage. The sync import does not modify the cookie jar directly; subsequent web requests to DeepSeek will use the credentials as in a normal login.

Installation and Enablement

Search for dsh-deepseek-chat-panel in the Harness plugin marketplace, install and enable it, then restart dsh web.

You can also install it via the command line:

# Install from npm
dsh plugin --profile web add dsh-deepseek-chat-panel

To install from the source in this workspace, first complete dependency installation and build in the project directory, then run:

# The local folder is named dsh-deepseek-chat, but the npm package name remains dsh-deepseek-chat-panel.
dsh plugin --profile web add "D:\MyCodes\test\deepseek\dsh-deepseek-chat"

After dsh plugin add wraps the plugin into the profile, you still need to enable it in the Harness plugin list. Enabling applies cordis.patch.yml to let the Host load the plugin, followed by a Harness restart.

Typical Usage

  1. Refresh the Harness page.
  2. Click the chat bubble next to the settings button in the bottom-left corner to open the panel.
  3. Log in once in the panel; the Host will save the cookies thereafter. Accounts bound only to WeChat should use “Sync Session”.
  4. The title bar provides “Open in Browser”, “Reload”, “Sync Session”, and “Close”. Esc also closes the panel; the iframe is retained in the background after closing, so you can resume your chat when reopening.

“Open in Browser” accesses the same local proxy address and is useful for login flows that must occur in a top-level window (e.g., Google, Apple, etc.).

Configuration

The host side reads configuration from environment variables; changes take effect after restarting Harness. The bind address is fixed to 127.0.0.1.

Variable Default Description
DSH_DEEPSEEK_CHAT_PORT 3097 Preferred port; must be an integer in 1..65535; invalid values fall back to the default, and occupied ports trigger automatic selection of an available one
DSH_DEEPSEEK_CHAT_STATE <DSH_HOME>/deepseek-chat Directory for cookies.json and pending-sync.json; empty value uses the default directory
DSH_DEEPSEEK_CHAT_DEBUG Off Only 1 enables request debug logging; authentication is logged as present / none only — the Authorization content is never printed
DSH_HOME ~/.dsh Harness data root directory; used to derive the default state directory when not separately specified

The development proxy places state in the project’s .cache/state by default and can auto-assign a port with npm run dev -- 0; the command-line port takes precedence over environment variables. None of these entry points auto-load .env. See docs/configuration.md for field explanations, PowerShell examples, and JSON manifest details.

Use Cases and Caveats

This plugin is suitable for scenarios where you need to use DeepSeek chat directly within Harness and want persistent login state. The plugin runs with the current DSH process’s privileges; review the source code and license before installation.

Known limitations include:

  • The proxy binds exclusively to 127.0.0.1 and checks the request Origin; however, other processes on the same machine may still access the port.
  • DeepSeek’s own light/dark theme is independent of the Harness theme and cannot automatically inherit Harness theme tokens.
  • Login flows such as Google and Apple may require a top-level window or an official site domain. Try “Open in Browser” from the title bar first; for logins that must complete on deepseek.com, use “Sync Session” to import.
  • Cookies, pending-sync credentials, and browser storage should be treated as login credentials. Re-login may be required after upstream expiry, logout, permission revocation, or browser storage cleanup.
  • The upstream frontend may change at any time. If the entry script string matching fails, the Host log will print entry bundle patterns missing: … — check and update src/transform.js.

Conclusion

This plugin uses a host-side loopback proxy and a page-side panel to open chat.deepseek.com within Harness and maintain login state. It is ideal for developers who want to centrally manage DeepSeek conversations and reduce tab switching. The plugin directory page and GitHub repository are listed below:

  • Directory page: https://www.skillhub.cn/plugins/KokoTa/dsh-deepseek-chat-panel
  • GitHub: https://github.com/KokoTa/dsh-deepseek-chat-panel
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye