Skip to content

Releases: gychen-NJU/dsh-overleaf

dsh-overleaf v0.3.8

Choose a tag to compare

@gychen-NJU gychen-NJU released this 29 Aug 16:31

What's Changed (v0.3.8)

  • compile-fix tab: auto-fix compile errors/warnings from the build log (@@DSH-FIX-EDIT@@ workflow, agent-driven)
  • docs: feature screenshots (zh/en) with language switch
  • chore: commit lib bundle for zero-auth github installs (no prepare/allowBuilds needed)

Install: 'dsh plugin --profile web add github:gychen-NJU/dsh-overleaf'

dsh-overleaf v0.3.7

Choose a tag to compare

@gychen-NJU gychen-NJU released this 28 Aug 22:46

dsh-overleaf v0.3.7

Selection AI (new) + compile/PDF rendering fix

0.3.7 — Selection AI: ask the agent about (or safely modify) Overleaf selections

  1. Assist panel gains a Selection AI tab: select text in the CodeMirror editor, then either ask a question (answered in the conversation) or request a modification.
  2. Modify flow: the agent writes the clean replacement to dsh-overleaf-insert.md, the panel polls for a stable revision, shows it in an editable review box, and only after you click Replace original selection does the bridge mutate the editor.
  3. Replacement safety: the bridge captures native CM5/CM6 ranges with a stable anchor token and verifies exact source text + surrounding context + editor attachment before mutating; it refuses on any doc/file change since capture and snapshots the doc before the edit (existing rollback lane). Prompt construction delimits selection text as untrusted data.
  4. Bridge/parent message validation strengthened (event.source checked both ways); i18n ZH/EN parity asserted in smoke.

0.3.6 — Clicking Recompile now renders the PDF (user-content host split + CORS) [unreleased until now]

  1. Overleaf serves output files (PDFs, logs) from a second host (compiles.overleafusercontent.com/zone/c) announced in ol-compilesUserContentDomain / compile JSON pdfDownloadDomain; the frontend builds cross-origin absolute URLs for pdf.js, which were CORS-blocked inside the embedded view (the CDN sends no Access-Control-Allow-Origin). The same-origin proxy 404s on those paths via the main origin.
  2. Proxy now learns the user-content origin (HTML meta + compile JSON hints: pdfDownloadDomain/outputUrlPrefix/downloadURL, most-specific prefix wins) and forwards zone-prefixed paths there with the stored credential; the bridge re-roots absolute URLs on that host back under /overleaf-proxy.
  3. Live smoke gained zone-routing 206 regression with credential check; offline smoke gained hint-extraction assertions.

Upgrade

dsh plugin --profile web add github:gychen-NJU/dsh-overleaf

(already installed? remove first, re-add, restart the web service, then hard-refresh with Ctrl+F5)

dsh-overleaf v0.3.5

Choose a tag to compare

@gychen-NJU gychen-NJU released this 28 Aug 20:29

dsh-overleaf v0.3.5

Hands-off agent output + assist panel usable + compile/PDF hardening

Field round three fixes:

  1. Assist panel was COVERED by the fixed keep-alive iframe (root stacking context, z 99999): the frame now yields its right-side width while the panel is open, so all panel controls are clickable.
  2. Agent output capture hardened: the workspace handoff file is polled for a STABLE revision (two identical polls + mtime signature), cleaned of one outer latex/tex fence, and placed into the reviewable custom-content box - the user inspects before inserting at the caret. Spinner, live wait seconds, cancel, and a 10-minute timeout included.
  3. routeUrl now re-roots ABSOLUTE same-origin URLs (window.origin + file.url built by the compile result builder) including Request objects; dynamic resource attributes share the routing.
  4. Synchronous compile calls get a 10-minute upstream timeout; relative upstream redirects resolve against the full request URL.
  5. Live smoke gained compile + ranged-PDF regression (exact bytes via Range).

Upgrade

dsh plugin --profile web add github:gychen-NJU/dsh-overleaf

(already installed? remove first, re-add, restart the web service, then hard-refresh with Ctrl+F5)

dsh-overleaf v0.3.2

Choose a tag to compare

@gychen-NJU gychen-NJU released this 28 Aug 18:57

dsh-overleaf v0.3.2

Fix: the embedded page never appeared (keep-alive iframe stayed hidden)

v0.3.1 created the keep-alive iframe inside a display:none parking container and then only mutated the FRAME's inline styles — the node itself remained inside the hidden parent, so the embedded page was invisible and the reload button had no effect (the open-in-new-window tab worked because it bypassed the frame).

Fixes

  • The iframe attaches DIRECTLY to <body> at creation; after that the node is never re-parented (DOM moves would reload it, defeating keep-alive). Show/hide is purely inline styles.
  • z-index raised 5 → 99999: the frame lives in the root stacking context and mid-range shell containers painted over it; it only ever covers the stage rectangle.
  • A capture-phase scroll listener keeps the fixed geometry glued to the stage through any scrollable ancestor.
  • Diagnostics: <html data-dsh-frame="visible WxH@x,y"> for field verification in Elements.

Upgrade

dsh plugin --profile web add github:gychen-NJU/dsh-overleaf

(already installed? remove first, re-add, restart the web service, then hard-refresh with Ctrl+F5)

dsh-overleaf v0.3.1

Choose a tag to compare

@gychen-NJU gychen-NJU released this 28 Aug 18:29

dsh-overleaf v0.3.1

Tab-switch keep-alive + hands-off agent output insertion

Three field-reported issues fixed:

1. Get the generated content without switching tabs

The composed prompt now instructs the agent to write its final content into the workspace file dsh-overleaf-insert.md; the panel polls the new read-insert-file route every 4 seconds and auto-inserts new content at the caret — no tab switching, no copy-paste. (Host-side reads are restricted to that single fixed filename inside the session cwd.)

2. Tab switches no longer lose the open project

The conversation view unmounts on tab switches, which destroyed a React-owned iframe (reload → back to the project list). The persistent iframe now lives at body level for the whole page lifetime and is positioned over the stage with fixed geometry (ResizeObserver + interval re-sync); unmount merely hides it. The open project, login state, and scroll position survive every tab switch. The reload button uses location.reload() on the persistent frame.

3. Talk about the project text

The AI-write section gained an "attach full document text (truncated)" option — context radius extends to 200k characters so the agent can reason about the whole document, not just the caret neighborhood.

Upgrade

dsh plugin --profile web add github:gychen-NJU/dsh-overleaf

(already installed? remove first, re-add, restart the web service, then hard-refresh the DSH page with Ctrl+F5)

dsh-overleaf v0.3.0

Choose a tag to compare

@gychen-NJU gychen-NJU released this 28 Aug 15:25

dsh-overleaf v0.3.0

AI write loop: describe a change in the panel, the DSH agent edits, the result lands at the editor caret.

  • Assist panel AI write box: natural-language request + optional caret context (CM5/CM6)
  • Structured prompt submitted to the native composer via inputActions
  • Reply insertion: Capture selection -> Insert at caret (CM5 primary / CM6 probe / editable fallback)

Upgrade

dsh plugin --profile web add github:gychen-NJU/dsh-overleaf
(already installed? remove first, re-add, restart the web service, hard-refresh with Ctrl+F5)

dsh-overleaf v0.2.8

Choose a tag to compare

@gychen-NJU gychen-NJU released this 28 Aug 14:07

Fix: locate the CodeMirror 6 EditorView (assist panel insert/outline restored)

The assist panel silently found no editor: Overleaf edits with CodeMirror 6, whose DOM handle lives under the cmView key of the .cm-editor node - but that field is a ContentView wrapper, and the EditorView itself sits on its .view property. The probe validated the wrapper object (no state/dispatch) and gave up, so caret insert and outline extraction did nothing.

  • findCm6 unwraps up to four .view hops per candidate, probes every own property of editor DOM nodes as a last resort, and accepts an object only when it has state.doc + dispatch.
  • Also fixed a template-literal regression (backticks inside the bridge comment) found by the build.
  • Version 0.2.8.

dsh-overleaf v0.2.7

Choose a tag to compare

@gychen-NJU gychen-NJU released this 28 Aug 13:53

dsh-overleaf v0.2.7

Editor Loading root causes found in field testing (codex fix, reviewed)

With projects now opening, deeper field testing exposed three defects that kept the editor on its Loading screen and broke interactions.

1. window.WebSocket wrapper dropped native static constants

Overleaf's connection manager compares connection state against WebSocket.OPEN/CONNECTING before creating a socket. The prototype-shuffle wrapper left both sides undefined, so canReconnect() stayed false forever and the editor never left Loading.

The wrapper now inherits the native prototype and statics (Object.setPrototypeOf(PatchedWebSocket, OriginalWebSocket)), also preserving instanceof semantics after wrapping.

2. Edge affinity cookies must follow the browser (GCLB 502)

Overleaf sits behind a load balancer that rotates an affinity cookie (gclb) on the socket.io handshake. The stored-credential-authority rule silently dropped that rotated value, so the WebSocket upgrade landed on a different backend where the fresh socket id did not exist → 502 → editor on Loading forever (this explains the intermittent 502s observed in field diagnostics).

mergeProxyCookieHeaders(browser, stored): application-session cookies stay stored-authoritative; known edge-routing cookies (gclb, awsalb*, __cf_bm, acw_tc, ...) keep the live browser value. Applied to both the HTTP path and the WebSocket upgrade.

3. Settings commits silently removed the editor's dynamic WebSocket route

applyRuntimeConfig rebuilt the ReverseProxy without preserving the companion WS tunnel port/origin. Saving any setting made editor pages loaded afterwards lose their only dynamic WebSocket route.

Diagnostics

The bridge now writes live state to <html data-dsh-overleaf-*> attributes (bridge, ws-port, ws-target, ws-state, last-error, last-rejection) — visible directly in the Elements panel.

Upgrade

dsh plugin --profile web add github:gychen-NJU/dsh-overleaf

(already installed? remove first, re-add, restart the web service, then hard-refresh the DSH page with Ctrl+F5)

dsh-overleaf v0.2.4

Choose a tag to compare

@gychen-NJU gychen-NJU released this 28 Aug 11:53

dsh-overleaf v0.2.4

Fix: the injected <base> was blocked by CSP base-uri 'none'

User console evidence: the editor page's Content-Security-Policy carries base-uri 'none', which blocked v0.2.3's injected <base href="/overleaf-proxy/"> — so relative requests kept resolving against the deep document directory (the /overleaf-logo.svg loop-404 persisted, and the SSE realtime channel stayed broken).

Fix

The CSP rewriter now relaxes base-uri 'none' to base-uri 'self' — the injected base is same-origin, so the directive's guard intent is preserved while allowing exactly the one base the proxy needs. All other directives pass through unchanged.

Offline smoke gained a regression matching the editor-page CSP shape (script-src 'nonce-x' 'strict-dynamic'; base-uri 'none'; object-src 'none').

Upgrade

dsh plugin --profile web add github:gychen-NJU/dsh-overleaf

(already installed? remove first, re-add, restart the web service, then hard-refresh the DSH page with Ctrl+F5)

dsh-overleaf v0.2.3

Choose a tag to compare

@gychen-NJU gychen-NJU released this 28 Aug 11:30

dsh-overleaf v0.2.3

Fix: RELATIVE requests now resolve against the proxy root (via injected <base>)

User network-panel evidence: on the editor page, the failing requests were relative (no leading slash)sse?userToken=..., users?sessionId=..., and a bare project id. Overleaf's frontend assumes it lives at the site root, but under the proxy the browser resolves such URLs against the deep document directory (/overleaf-proxy/project/...), so the editor's SSE realtime channel and supporting calls landed on wrong paths and died — "Loading..." forever, in the iframe AND the open-in-new-window tab.

Fix

rewriteHtml injects <base href="/overleaf-proxy/"> at the head (skipped when the page declares its own <base>). Every relative URL class — SSE, XHR, fetch, assets, forms — now resolves against the proxy root, matching the upstream's root-deployment assumption exactly. (Root-relative /x references ignore <base> by spec and continue to be handled by the attribute rewriting + runtime wrappers.)

Regression coverage

Base injection ordering (before body content) and existing-base preservation.

Upgrade

dsh plugin --profile web add github:gychen-NJU/dsh-overleaf

(already installed? remove first, re-add, restart the web service, then hard-refresh the DSH page with Ctrl+F5)