# Web Chat Bridge [简体中文](README.md) | English [![npm](https://img.shields.io/npm/v/dsh-webchat-bridge?logo=npm)](https://www.npmjs.com/package/dsh-webchat-bridge) [![CI](https://github.com/nai-loong/dsh-webchat-bridge/actions/workflows/ci.yml/badge.svg)](https://github.com/nai-loong/dsh-webchat-bridge/actions/workflows/ci.yml) [![Release](https://img.shields.io/github/v/release/nai-loong/dsh-webchat-bridge?sort=semver)](https://github.com/nai-loong/dsh-webchat-bridge/releases/latest) [![License](https://img.shields.io/github/license/nai-loong/dsh-webchat-bridge)](LICENSE) ![DSH](https://img.shields.io/badge/DSH-0.2.0--rc.2%20%E2%80%93%200.2.1--rc.2-blue) [![Maintained with RED](https://img.shields.io/badge/maintained_with-RED-C1121F)](https://github.com/exoticknight/red) Chat with chat.deepseek.com from inside DSH, then move the conversation into a workspace session and keep building. ## Features - **Web chat without API tokens**: a real browser opens chat.deepseek.com and reuses your signed-in web session; replies are read from the page's own stream. - **Sign in once, then run headless**: click **Open login window** the first time and finish the QR or password login; the browser profile is kept and later chats run headless. - **Streaming replies and two switches**: replies appear as they stream; **Deep Think** and **Web Search** toggle the matching modes on the web page. - **One-click transfer to a workspace**: review the source, pick a target workspace, and write the Q&A plus its provenance as a new workspace session — or **append to an existing session**. The target composer stays empty so you can continue working immediately. - **Optional task brief**: when checked, the model DSH is already configured with distills the conversation into a 120–180 character brief covering outcome, audience, supplied_inputs, constraints, output_shape, acceptance_check, and stop_boundary. Facts the conversation never supplied are marked `unknown`; long conversations are processed with map-reduce. **The full original conversation stays in the same session**, so distilling never drops the source. - **Manual import**: UTF-8 `.txt`, `.md`, and `.json` transcripts can be imported and transferred the same way; the panel can **delete the current chat** or **clear all** local records at any time. ## Install Requirements: DeepSeek Harness `>=0.2.0-rc.2 <=0.2.1-rc.2` with the `web` profile. Development target is `0.2.1-rc.2`; see the compatibility record for what was actually verified. ### From npm (recommended) ```sh dsh plugin --profile web add dsh-webchat-bridge ``` ### From GitHub Pin a release tag: ```sh dsh plugin --profile web add github:nai-loong/dsh-webchat-bridge#v0.1.0 ``` Restart DSH after installing (restart the desktop app), then refresh the page. The command installs into the DSH you normally use; run it in the same environment if you set your own `DSH_HOME`. For a source checkout used in development, see [docs/development.md](docs/development.md). ## Usage 1. Open the DSH page and click **Web chat** in the left sidebar. 2. On first use click **Open login window** and sign in to chat.deepseek.com in the browser that opens. The window closes itself once the chat is detected. 3. Type in the composer at the bottom and press Enter; the reply streams in. Turn on **Deep Think** or **Web Search** when needed. 4. Click **Import** to add a local `.txt`, `.md`, or `.json` transcript to the list. 5. Click **Transfer to workspace**: review the source, pick a target workspace; choose **Append to existing session** and pick a session to continue one. Check **Also distill a task brief** to add a brief on top of the original transcript. You can append to the same session repeatedly: each append closes the unfinished turn left by the previous one. Click **Start transfer**. 6. The transferred session appears in the left workspace immediately, without a restart. Open it to continue; its composer is empty — nothing is prefilled for you. 7. To clean up local records, click **Delete current chat** or **Clear all**; sessions already transferred to a workspace are unaffected. ## Configuration Settings live in the DSH plugin settings (`cordis.patch.yml` supplies the defaults). | Key | Default | Meaning | | ------------------------- | --------------------------- | -------------------------------------------------------------- | | `enabled` | `true` | Enable the plugin. | | `headless` | `true` | Run the browser headless after login; the first login is visible. | | `channel` | `auto` | Browser channel: `auto`, `chrome`, `msedge`, or `chromium`. | | `executablePath` | empty | Explicit Chrome/Edge executable; empty auto-detects. | | `baseUrl` | `https://chat.deepseek.com` | DeepSeek web origin. | | `dataDir` | empty | Data directory; empty uses `~/.dsh/webchat-bridge`. | | `replyTimeoutMs` | `180000` | Maximum wait for one reply, in milliseconds. | | `distillProvider` | empty | Provider for brief distillation; empty auto-detects. | | `distillModel` | empty | Model for brief distillation; empty auto-detects. | | `distillMaxTokens` | `16384` | Output-token cap for the final brief (reasoning also counts). | | `distillChunkTokens` | `4096` | Output-token cap for one map summary. | | `transferDistillDefault` | `false` | Pre-check "distill a task brief" in the transfer dialog. | ## Update, roll back, remove Release notes are on the [changelog](https://github.com/nai-loong/dsh-webchat-bridge/releases). Pin a version when updating or rolling back, then restart DSH (for 24 hours after a release, an unversioned install may still resolve to the previous version): ```sh dsh plugin --profile web add dsh-webchat-bridge@X.Y.Z ``` ```sh dsh plugin --profile web add github:nai-loong/dsh-webchat-bridge#vX.Y.Z ``` Remove: ```sh dsh plugin --profile web remove dsh-webchat-bridge ``` `~/.dsh/webchat-bridge/` stays behind: the browser profile used for the web login, `transcripts.json` with local conversations, and `token.json` with the observed login token. Delete the directory when you no longer need it; leaving it does not affect DSH. ## Privacy and data - **Network**: the plugin uses local Chrome/Edge to reach `https://chat.deepseek.com` (configurable). It contacts no other host and sends no telemetry. - **Local files**: under `~/.dsh/webchat-bridge/` — `browser-profile/` (web login), `transcripts.json` (local conversations), and `token.json` (the login token observed on web requests, written with mode 0600 and readable only by this user). - **Credentials**: the DeepSeek web token is written only to that local file and read by the host half; the client half can only see whether one is stored, and no endpoint ever returns the token. - **Transfer**: transfers are written to standard DSH session storage (`~/.dsh/sessions//`) and contain the conversation and provenance you chose. ## Compatibility See [docs/compatibility.md](docs/compatibility.md). Known limit: chat.deepseek.com's DOM and streaming protocol are not a public contract, so a site change can break sending or reading; the plugin reports `PAGE_CHANGED` instead of silently dropping content. ## Development See [docs/development.md](docs/development.md) and [CONTRIBUTING.md](CONTRIBUTING.md). AI agents developing, releasing, or maintaining this plugin should start at [AGENTS.md](AGENTS.md). ## License [Apache License 2.0](LICENSE)