Introduction¶
The core philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” Developers can extend capabilities in Web Profile through plugins. For users who need to write and debug LaTeX documents, invoking the Overleaf editor directly within DSH’s chat window can significantly improve efficiency. However, Overleaf’s default response headers include X-Frame-Options and CSP frame-ancestors restrictions, so direct embedding via <iframe> is blocked by browsers. The dsh-overleaf plugin solves the same-origin issue by running an HTTP/1.1 reverse proxy in DSH’s main process and embeds the Overleaf workbench as the fourth tab in the session page.
Plugin Positioning¶
dsh-overleaf is a DSH client plugin maintained by gychen-NJU. It adds an embedded Overleaf workbench tab to DSH Web, allowing users to edit, compile, and preview LaTeX documents directly in the browser while maintaining a same-origin context. At the same time, through selection referencing, cursor insertion, and the LaTeX assistant panel, it opens up the data flow between the editor and the AI composer.
Core Features¶
The plugin includes the following main capabilities:
-
Embedded Workbench Tab
It adds a fourth tab[Overleaf]to the tab bar of the session page. The tab loads the configured Overleaf instance (supportsoverleaf.comandtex.nju.edu.cn), preserves the file tree, editor, and PDF preview features, and does not interfere with the original DSH composer below. -
Same-Origin Reverse Proxy
To bypass the browser’s same-origin policy restrictions, the plugin provides a static reverse proxy inside the DSH process. Browser requests are forwarded through the/overleaf-proxy/path, with the target specified by user configuration. This ensures that the iframe and the main interface share the same origin, enabling browser-level cross-origin interaction. -
LaTeX Assistant Panel
Three function panels are integrated at the bottom of the Overleaf tab:- AI Insertion: Describe the desired change. After the Agent generates the content, it is automatically captured in the panel. After confirmation, it is inserted at the editor cursor position.
- Selection Rewrite: Select text in the editor and ask the Agent to explain or rewrite it. After confirmation, the original selection is replaced.
- Compile Fix: After recompiling, read errors and warnings from the compilation log and have the Agent provide a fix.
-
Bidirectional Synchronization
- .tex file synchronization: Supports saving the current Overleaf source to the local workspace or uploading a local
.texfile to Overleaf. - .bib file synchronization: Provides the “Update Overleaf .bib” feature in the assistant panel, supporting recursive detection of
.bibfiles from the local workspace and updating the Overleaf document.
- .tex file synchronization: Supports saving the current Overleaf source to the local workspace or uploading a local
Usage¶
The plugin requires DeepSeek Harness 0.1.7-rc.2 or the Web Profile environment. After installation, the [Overleaf] tab appears in the tab bar of the session page.
Typical usage is as follows:
-
Code Generation and Insertion
Describe the code change requirement in the chat, have the DSH Agent generate the content, use the[ ai-insert ]function in the assistant panel to capture the content, and automatically insert it at the current editor cursor position. -
Text Interaction
Select a piece of text in the Overleaf editor, ask the Agent to explain or rewrite it, and replace the original selection after confirmation. -
Compilation Troubleshooting
Recompile in Overleaf. If errors appear, use the[ compile-fix ]panel to read the log and have the Agent provide a fix. -
Reference Synchronization
In the assistant panel, select “Update Overleaf .bib” to recursively detect.bibfiles from the local workspace and update the Overleaf document.
Notes¶
- Version compatibility: The plugin depends on DeepSeek Harness 0.1.7-rc.2 or later, or on Web Profile.
- Restart after upgrade: After upgrading the plugin, you must restart DSH and reload the embedded project.
- Immediate configuration effect: In v1.0.0, after modifying configurations such as the proxy target, saving the changes takes effect immediately without restarting DSH.
- License: The plugin uses the MIT license.
Conclusion¶
dsh-overleaf achieves seamless Overleaf integration in DSH through reverse proxy technology, bringing AI-assisted capabilities directly to the editor level. It is suitable for heavy LaTeX users.