# dsh-overleaf [English](README.md) | [中文](README.zh.md) An embedded **Overleaf workbench** plugin for DeepSeek Harness (DSH) Web. It adds a fourth tab next to `Chat / Trajectory / Context` on the session page: the tab loads your Overleaf site (public cloud or self-hosted such as `https://tex.nju.edu.cn`) through a same-origin reverse proxy, so the page renders and **stays fully operable** — editing, compiling, PDF preview — while the native DSH composer stays below it, with selection quoting, caret insertion, and LaTeX assist panels wired between the two. ``` +--------------------------------------------------------------+ | Session tabs: Chat | Trajectory | Context | [Overleaf] | +--------------------------------------------------------------+ | toolbar: reload / open window / login / cookie / panel | | +----------------------------------------------------------+ | | | https://.../overleaf-proxy/... (same-origin iframe) | | | | full Overleaf editor, compiler, and PDF preview | | | +----------------------------------------------------------+ | | floating quote CTA - selection bridge | | status strip / assist panel (AI write, selection AI, outline)| +--------------------------------------------------------------+ | DSH composer (native, untouched) | +--------------------------------------------------------------+ ``` - License: MIT - Target runtime: DeepSeek Harness `0.1.1-rc.2`, web profile (`http://127.0.0.1:3080`) - Protocol: ships a static Community v0.15 `dsh-plugin.json` per the [dsh-std](https://github.com/Yan-Zero/dsh-std) interoperability spec; classic dual-face bundle loading remains the primary activation path. ## Screenshots **The Overleaf editor running inside a DSH conversation tab** — full editor with project file tree, and the DSH composer stays below: ![Overleaf editor embedded in a DSH conversation tab](docs/screenshots/01-overview.png) **Split view: LaTeX source and PDF preview side by side**, with Recompile — compile, preview, and iterate without leaving the conversation: ![Split view: source and PDF preview](docs/screenshots/02-split-view.png) **Assist panel — three tools side by side**: AI write & auto-captured insert, selection AI with reviewed replace, and compile fix (log errors/warnings with one-click agent fixes): ![Assist panel tabs: ai-insert / selection-ai / compile-fix](docs/screenshots/panel-tabs.png) - **`[ ai-insert ]`** — describe the change, the DSH agent writes it, and the panel **automatically captures the agent's output into the custom-content box** — review it, then insert at the editor caret. - **`[ selection-ai ]`** — select text in the editor, ask the agent to explain or rewrite it, review the replacement, then replace the original selection. Source/selection drift checks are on by default and can be unchecked to force replacement at the saved anchor (file switches are still refused). - **`[ compile-fix ]`** — read the compile log's errors and warnings after a Recompile, then let the agent propose fixes for the currently open document. - **Local `.bib` sync** — both `ai-insert` and `selection-ai` offer “Update Overleaf .bib”: recursively auto-detect workspace bibliographies or accept an absolute/relative path inside the current DSH workspace, then update the same-named Overleaf document and wait for autosave confirmation. - **Bidirectional current `.tex` sync** — the assist panel's Status page defaults to saving the current Overleaf source into the workspace: it recursively detects local `.tex` files and creates a same-named root file when none exist. The reverse “Local → Overleaf” direction can use a selected local file or manually pasted complete LaTeX, but requires an explicit whole-document warning confirmation plus document-ID, revision, snapshot, write-verification, and save-event checks. ## Why it exists Overleaf sends `X-Frame-Options` / CSP `frame-ancestors` on every response, so a plain `