codex-overleaf-link 2.3.4 → 2.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +325 -211
  2. package/extension/bootstrap/manifest.template.json +1 -1
  3. package/extension/src/background.js +9 -0
  4. package/extension/src/backgroundUpdateCoordinator.js +88 -4
  5. package/extension/src/content/composerPanel.js +1 -1
  6. package/extension/src/content/contentRuntime.js +51 -35
  7. package/extension/src/content/diagnosticsController.js +13 -3
  8. package/extension/src/content/diagnosticsPanel.js +1 -1
  9. package/extension/src/content/generated/content.bundle.js +1233 -298
  10. package/extension/src/content/generated/content.bundle.meta.json +8 -3
  11. package/extension/src/content/globalPreferencesController.js +125 -0
  12. package/extension/src/content/legacyGlobalRegistry.js +4 -0
  13. package/extension/src/content/otWarmMirror.js +95 -65
  14. package/extension/src/content/otWarmMirrorController.js +102 -1
  15. package/extension/src/content/panelMaintenance.js +26 -15
  16. package/extension/src/content/panelRenderer.js +6 -1
  17. package/extension/src/content/projectSettingsCoordinator.js +1 -0
  18. package/extension/src/content/providerSettingsCoordinator.js +16 -0
  19. package/extension/src/content/providerSettingsDialog.js +24 -15
  20. package/extension/src/content/runFailureNotice.js +104 -0
  21. package/extension/src/content/runScrollLayout.js +124 -0
  22. package/extension/src/content/runTimelineView.js +36 -10
  23. package/extension/src/content/settingsPanel.js +32 -13
  24. package/extension/src/content/themeController.js +3 -0
  25. package/extension/src/content/updateNotice.js +24 -4
  26. package/extension/src/page/overleafRealtimeObserver.js +116 -24
  27. package/extension/src/shared/compatibility.js +1 -1
  28. package/extension/src/shared/globalPreferences.js +131 -0
  29. package/extension/src/shared/i18n.js +79 -39
  30. package/extension/src/shared/managedUpdateProjection.js +1 -1
  31. package/extension/src/shared/otText.js +0 -1
  32. package/extension/src/shared/sessionState.js +17 -21
  33. package/extension/src/shared/sessionTitle.js +120 -0
  34. package/extension/src/shared/updateRuntimeIdentity.js +32 -0
  35. package/extension/styles/panel.css +90 -16
  36. package/native-host/src/mirrorWorkspace.js +20 -1
  37. package/native-host/src/releaseProxy.js +177 -0
  38. package/native-host/src/releaseTransport.js +154 -0
  39. package/native-host/src/updateManager.js +40 -39
  40. package/package.json +1 -1
  41. package/scripts/install-managed.mjs +1 -1
package/README.md CHANGED
@@ -3,12 +3,12 @@
3
3
  <h1>Codex Overleaf Link</h1>
4
4
  <p><strong>Empower Overleaf with Codex.</strong></p>
5
5
  <p>
6
- <img src="https://img.shields.io/badge/version-2.3.4-blue" alt="version">
6
+ <img src="https://img.shields.io/badge/version-2.3.6-blue" alt="version">
7
7
  <img src="https://img.shields.io/badge/platform-macOS%20%2F%20Windows%20%2F%20Linux-lightgrey" alt="platform">
8
8
  <img src="https://img.shields.io/badge/chrome-MV3-green" alt="chrome manifest v3">
9
9
  <img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="node version">
10
10
  <a href="https://github.com/Ghqqqq/codex-overleaf-link/actions/workflows/test.yml"><img src="https://github.com/Ghqqqq/codex-overleaf-link/actions/workflows/test.yml/badge.svg" alt="tests"></a>
11
- <img src="https://img.shields.io/badge/dependencies-0-orange" alt="zero dependencies">
11
+ <img src="https://img.shields.io/badge/runtime%20dependencies-0-orange" alt="zero npm runtime dependencies">
12
12
  <img src="https://img.shields.io/badge/license-MIT-blue" alt="license">
13
13
  </p>
14
14
  </div>
@@ -19,11 +19,45 @@
19
19
 
20
20
  Overleaf is great for collaborative LaTeX writing. Codex is great for AI-assisted editing. But switching between them breaks flow — you lose Overleaf's real-time collaboration, or you lose Codex's local intelligence.
21
21
 
22
- Codex Overleaf Link bridges the two: it adds a Codex panel directly inside Overleaf, mirrors the project locally for Codex to work on, and writes accepted changes back through the browser — with stale-write guards, diff review, and undo checkpoints to reduce the risk of accidental overwrites.
22
+ Codex Overleaf Link adds a Codex panel directly inside Overleaf and mirrors the project locally. Use **Ask** to read and analyze, or **Auto** to edit the local workspace and write eligible changes back through the browser. Project rules, conflict checks, Track Changes integration, and per-run recovery help you control those writes.
23
23
 
24
- <p align="center">
25
- <img src="assets/codex-preview.png" alt="Codex Overleaf Link running inside Overleaf">
26
- </p>
24
+ ![Codex Overleaf Link beside the source editor and PDF preview](assets/codex-preview.jpg)
25
+
26
+ *The example project with the v2.3.4 panel: Ask / Auto, Track / Compile, and model controls stay beside your document.*
27
+
28
+ [Install](#install) · [Task modes](#task-modes-and-review) · [Models & APIs](#models-and-api-providers) · [Workflows](#common-workflows) · [Troubleshooting](#faq-and-troubleshooting) · [Development](#development)
29
+
30
+ ## Features
31
+
32
+ - **Ask and Auto** — analyze without Overleaf writes, or edit with conflict checks, project rules, and optional Track Changes. Inspect written text diffs and use the run's available Accept / Undo actions.
33
+ - **Live progress and follow-ups** — watch Codex events, cancel a task, queue the next input, or use **Guide** to send a queued message into the active turn when it is ready. A paused queue can be resumed from the panel.
34
+ - **Session history** — create, rename, resume, and delete sessions; copy a result or fork a conversation from an eligible turn. Recent-project history helps you return to earlier work.
35
+ - **Project context** — select files through `@` autocomplete or the **+** tray, include `@compile-log`, and paste/drop files as attachments for the next turn.
36
+ - **Binary assets** — confirm Codex-created images, PDFs, and other supported assets before creating or replacing them in Overleaf; transfer is chunked to support files larger than a single Native Messaging response.
37
+ - **Compile feedback** — the **Compile** toggle requests Overleaf recompilation after eligible files are written and records the result. Ask mode does not trigger post-write compilation.
38
+ - **Project rules and preflight** — read-only / writable path rules gate browser writes; sensitive-content detection checks task context before sending it to Codex. File focus prioritizes context; use project rules to enforce writable paths.
39
+ - **Models and skills** — discover local Codex models, choose supported reasoning and speed settings, and install or select Codex Overleaf skills from the slash menu. Skill loading and individual skill enablement are configurable.
40
+ - **Local records and diagnostics** — preserve run outcomes and recovery evidence, inspect diagnostics, and export redacted issue-report bundles. Plugin Codex sessions use an isolated home.
41
+
42
+ ### Experimental features
43
+
44
+ - **Third-party model providers** — configure Responses API, OpenAI-compatible Chat Completions, or Anthropic Messages endpoints in Settings. The local Codex CLI remains the agent runtime, with local protocol bridges adapting the selected endpoint. Compatibility varies by model and gateway; the built-in Codex provider remains the default.
45
+ - **Parallel subagents** — enable the `parallel-subagents` skill for decomposable tasks. The native host runs workers with assigned files; the skill can split a single file into section jobs. Worker progress appears in the timeline, and detected ownership violations are withheld from Overleaf writeback.
46
+ - **OT warm mirror** — optional, read-only observation of active Overleaf text edits keeps focused mirror files warm. It is off by default and falls back to the normal snapshot path when unavailable, stale, or inconsistent. Overleaf writeback still uses the page bridge.
47
+
48
+ OT freshness expires after 30 seconds, and focused warm starts still verify current file content through the page bridge. OT observation never establishes whole-project freshness or replaces the Overleaf writeback path.
49
+
50
+ ## Requirements
51
+
52
+ | Requirement | Notes |
53
+ |-------------|-------|
54
+ | macOS / Windows / Linux | Native Messaging host targets the current user's browser registration location |
55
+ | Chrome / Chromium | macOS Chrome, Windows Chrome, and Linux Chrome are supported. Linux Chromium is supported only when installed with `--browser chromium`. macOS Chromium and Windows Chromium are not claimed as supported yet. |
56
+ | Node.js >= 20 | Powers the native host bridge |
57
+ | Git | Required by the one-command source installers and manual checkout flow |
58
+ | Codex CLI | Installed (`codex --version` to verify); sign in for the built-in Codex provider. Custom providers also use the local Codex CLI. |
59
+ | Overleaf account | Access to the target project on `overleaf.com` |
60
+ | TeX distribution *(optional)* | For `latexmk` / local compile checks |
27
61
 
28
62
  ## Install
29
63
 
@@ -33,39 +67,43 @@ Either way, the final **Load unpacked** click is manual — Chrome does not let
33
67
 
34
68
  ### Option A — installer script (recommended)
35
69
 
36
- One command installs the managed native host **and** managed extension runtime. On macOS/Linux it also creates the visible `~/Codex Overleaf Link Extension` shortcut pointing to the managed extension, copies that path to your clipboard, and opens `chrome://extensions` for you. Future signed stable updates target this same managed directory.
70
+ One command installs the managed native host **and** managed extension runtime. On macOS/Linux it also creates the visible `~/Codex Overleaf Link Extension` shortcut when that path is available. The script attempts to copy the extension path on macOS and Windows; on macOS it also attempts to open Chrome's extensions page. Every platform prints the folder to load. Future signed stable updates target this same managed directory.
37
71
 
38
72
  macOS / Linux:
39
73
 
40
74
  ```bash
41
- CODEX_OVERLEAF_REF=v2.3.4 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v2.3.4/install.sh)"
75
+ CODEX_OVERLEAF_REF=v2.3.6 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v2.3.6/install.sh)"
42
76
  ```
43
77
 
44
78
  Windows PowerShell:
45
79
 
46
80
  ```powershell
47
- iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v2.3.4/install.ps1 -OutFile install.ps1
48
- $env:CODEX_OVERLEAF_REF='v2.3.4'
81
+ iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v2.3.6/install.ps1 -OutFile install.ps1
82
+ $env:CODEX_OVERLEAF_REF='v2.3.6'
49
83
  powershell -ExecutionPolicy Bypass -File install.ps1
50
84
  ```
51
85
 
52
- Then, in the `chrome://extensions` tab the script opened: enable **Developer mode**, click **Load unpacked**, and choose the prepared extension folder (its path is already on your clipboard). That is the only manual step.
86
+ Then open `chrome://extensions`, enable **Developer mode**, click **Load unpacked**, and choose the extension folder printed by the installer. If the installer reports that it copied the path, you can paste it into the folder picker.
53
87
 
54
88
  ### Option B — npm managed install
55
89
 
56
90
  `npm exec` installs the same managed native host and extension runtime without keeping a source checkout. Use it if you prefer a pinned npm package.
57
91
 
58
92
  ```bash
59
- npm exec --yes codex-overleaf-link@2.3.4 -- install-managed
93
+ npm exec --yes codex-overleaf-link@2.3.6 -- install-managed
60
94
  ```
61
95
 
62
96
  Then, in `chrome://extensions`, enable **Developer mode**, click **Load unpacked**, and select the managed extension path printed by the command. The Release extension zip remains available for explicitly unmanaged/manual installations.
63
97
 
64
98
  ### Open Overleaf
65
99
 
66
- Open any Overleaf project — the Codex panel appears on the right; confirm the native host is connected from the panel diagnostics. Start in Ask mode; switch to Suggest mode for reviewed edits, or Auto mode once project governance and checkpoint settings are ready for direct writeback.
100
+ Open a project on `overleaf.com` — the Codex panel appears on the right. Use its diagnostics to confirm the native host is connected, then start in **Ask** mode. When you want edits, select **Auto** and choose whether **Track** should be enabled. Auto writes eligible changes directly; Track records supported text edits in Overleaf Reviewing for inspection and acceptance afterward. See [Task Modes And Review](#task-modes-and-review).
67
101
 
68
- The bundled extension key gives the official build a stable id, so normal installs do not need `--extension-id`. If Chrome assigns a custom build a different id, rerun the native install with `--extension-id <chrome-extension-id>` so the native manifest `allowed_origins` entry matches.
102
+ Close the panel from its header and reopen it with the Codex edge control on the Overleaf page. The extension popup controls whether that edge entry is shown. The panel supports dark, light, and system appearance, with English and Chinese interface text.
103
+
104
+ Appearance, language, and global skill preferences synchronize across Overleaf tabs in the same Chrome profile and are restored when you reopen the dashboard or a project. The Preload project context setting is also preserved across refreshes.
105
+
106
+ The bundled extension key gives the official build a stable id, so normal installs do not need `--extension-id`. If Chrome assigns a custom build a different id, rerun the installer for that installation type with `--extension-id <chrome-extension-id>` so the native manifest `allowed_origins` entry matches. See [Extension ID](#extension-id).
69
107
 
70
108
  <details>
71
109
  <summary><strong>Manual checkout install</strong> (custom location)</summary>
@@ -78,153 +116,274 @@ npm run build:content
78
116
  npm run install:native
79
117
  ```
80
118
 
81
- Then load `extension/` as an unpacked extension in Chrome. If Chrome assigns a different extension id, rerun `npm run install:native -- --extension-id <chrome-extension-id>`.
119
+ Then load `extension/` as an unpacked extension in Chrome. This checkout installation is unmanaged: rebuild and reload the extension after changes, and reinstall the native host after changes to its runtime. If Chrome assigns a different extension id, rerun `npm run install:native -- --extension-id <chrome-extension-id>`.
82
120
 
83
121
  </details>
84
122
 
123
+ ## Task Modes And Review
124
+
125
+ There are two task modes, Ask and Auto. Track is a separate setting for Auto writes.
126
+
127
+ | Mode / Track setting | What happens | How to inspect the result |
128
+ |------|--------------|--------------------------|
129
+ | **Ask** | Codex reads and analyzes the project. Local changes, if any, are not sent back to Overleaf. | Read the answer; switch to Auto when you want edits. |
130
+ | **Auto + Track on** | Eligible changes are written immediately; supported text edits are recorded in Overleaf Reviewing / Track Changes. The run is blocked if the required mode cannot be confirmed. | Inspect the written diff and Overleaf tracked edits, then use the run's available **Accept** or **Undo** action. |
131
+ | **Auto + Track off** | Eligible changes are written after confirming Overleaf Editing mode. | Inspect the written diff and use **Undo** where recovery evidence is available. |
132
+
133
+ Auto text writes do not wait for a per-hunk approval step. Deletes and binary create/overwrite operations require separate confirmation. Track applies to supported text edits; it does not make every file-tree or binary operation reversible.
134
+
135
+ **Accept** finalizes this run's tracked text edits and leaves Overleaf in Editing mode. If the operation unexpectedly creates new tracked changes, the extension attempts to roll it back and reports what could be verified.
136
+
137
+ **Undo** uses the run's saved recovery information. Concurrent changes or incomplete verification can prevent a full restoration. Cancel stops further work but does not automatically undo writes that already reached Overleaf; inspect the run card for the written parts and available recovery actions.
138
+
139
+ Suggest mode was removed in v2.3.1. For a reviewable editing workflow, use **Auto + Track** and inspect the changes after they are written.
140
+
141
+ ## Models And API Providers
142
+
143
+ The default **Built-in Codex** option uses the authentication, model catalog, and provider configuration of your local Codex CLI. You can also connect an experimental third-party API while keeping the same Overleaf panel, local workspace, and Codex agent workflow.
144
+
145
+ ### Add or switch a provider
146
+
147
+ 1. Open **Project Settings → Model providers → Configure**, then choose **+ Add provider**.
148
+ 2. Enter a **Provider name**, **Base URL**, **API key**, and **Default model** ID. Add other model IDs one per line in **Additional models**. Use the exact IDs accepted by your endpoint; custom providers use this configured list. HTTPS is required except for localhost.
149
+ 3. Under **Advanced compatibility**, leave **API protocol** on Auto or select the protocol your endpoint supports. If the URL already ends with the complete protocol endpoint, enable **Base URL is the full protocol endpoint**.
150
+ 4. Review the endpoint disclosure. **Test connection** is optional and sends a live probe to the selected test model. Choose **Save** to keep the profile, or **Save and use for this project** to select it for future runs in this project.
151
+
152
+ To switch between saved providers, select one in the dialog and choose **Use for this project**, then confirm **Switch provider** when prompted. To return to the default, select **Built-in Codex → Use for this project**. Back in the composer, open the model control to choose a configured model and its supported reasoning settings. The **Current project** label identifies the selected provider.
153
+
154
+ Provider profiles are shared locally across projects, while the active choice applies to **all sessions in the current project**. Switching keeps existing run history and starts fresh provider threads for future turns; model, reasoning, and speed choices may change. Editing a shared profile can affect other projects using it. Submitted and queued runs retain their captured provider configuration; resubmit if a profile change makes that captured revision unavailable.
155
+
156
+ The project dashboard lets you manage shared provider profiles. Open a project before choosing which provider it should use.
157
+
158
+ ### Supported API formats
159
+
160
+ | API protocol | Use it for |
161
+ |----------|------------|
162
+ | **Auto (detect during test)** | Negotiate a compatible route during a connection test or first use. |
163
+ | **Responses API** | Endpoints that accept the Responses API format. |
164
+ | **Chat Completions** | OpenAI-compatible chat completion endpoints. |
165
+ | **Anthropic Messages** | Endpoints that accept the Anthropic Messages format. |
166
+
167
+ Advanced settings also expose authentication headers, streaming/buffered response behavior, reasoning compatibility, and gateway-specific headers or request overrides. Configure these to match your provider's documentation. A successful probe checks one model and route; tool calling, reasoning, and long-running task behavior can still vary by endpoint. API keys are stored locally by the native host, and task context is sent to the selected endpoint.
168
+
169
+ ## Context And Attachments
170
+
171
+ Type `@` and choose a file, or select it in the **+** tray. Choosing a file adds it to persistent focus context; up to five files can be selected, and the tray lets you remove or clear them. With a complete project snapshot, Codex may also read and edit related files. Focus is a hard writeback boundary only for restricted partial-snapshot and OT warm-start runs; use project governance rules for a persistent write restriction.
172
+
173
+ Include `@compile-log` to request the current project's compile log, errors, and warnings. For a paragraph or section, select its file and name the section or quote the target text in your request.
174
+
175
+ Paste or drop PDFs, images, or other files into the composer as turn-scoped context. The composer accepts **8 attachments**, up to **12 MiB each** and **32 MiB total raw size** per turn. These files are staged locally for Codex and excluded from Overleaf writeback. Unsent attachment restoration after a page reload is limited to a small subset, so check the attachment strip before submitting.
176
+
177
+ Generated binary writeback is a separate operation: supported assets up to **10 MiB per file** are offered for confirmation and sent in chunks. LaTeX build outputs are filtered; in particular, a changed root-level PDF with a matching root TeX source is treated as a build artifact.
178
+
179
+ ## Common Workflows
180
+
181
+ - **Understand a project** — use Ask to explain the document structure, equations, or a selected file without writing to Overleaf.
182
+ - **Fix a compile error** — include `@compile-log` in Ask for diagnosis. To apply a fix, switch to Auto, choose Track as needed, leave Compile enabled, and inspect the written changes and compile result.
183
+ - **Rewrite or translate a section** — choose its file from `@` autocomplete, name the section and desired changes, and use Auto + Track. Inspect the edits in Overleaf, then Accept or Undo the run as appropriate.
184
+ - **Create a figure** — provide references as composer attachments, ask Codex to create a supported asset and update the LaTeX in Auto, and review the separate asset confirmation. Check the run report for any skipped files.
185
+ - **Continue or try an alternative** — queue a follow-up while Codex is running, use Guide for an immediate correction, or fork an eligible completed turn to explore another approach. A conversation fork shares the same Overleaf project; it does not create a project copy.
186
+ - **Polish several sections in parallel** — enable the experimental `parallel-subagents` skill, specify the sections or files, and use Auto + Track to inspect the combined changes after writeback.
187
+
188
+ ## Update
189
+
190
+ Update downloads retry transient network failures within a bounded time budget, including stalled response bodies. The updater respects HTTP/HTTPS environment proxies and supported macOS/Windows system proxy settings. TLS certificate and release-signature failures remain blocking errors. SOCKS/PAC-only configurations require an HTTP proxy endpoint.
191
+
192
+ After a manual reinstall, installed files and running components are shown separately. Use the reload action once Overleaf is saved and idle; pending Overleaf tabs can then refresh. A disk replacement alone is not reported as a successfully health-confirmed update.
193
+
194
+
195
+ Managed installations **check** for signed stable updates automatically. When an update is available, choose **Update now** in the update notice or **Settings → Software updates** to authorize that version. The updater then downloads and verifies the coordinated extension/native bundle, waits until connected Overleaf tabs are saved and idle and the native host has no active work, and applies both components together. A failed health check restores the previous version. The update notice also offers postponement and progress details.
196
+
197
+ Stable updates use signed release metadata and artifact hashes; draft and prerelease versions are not selected. Releases that require a different Bootstrap protocol need a managed reinstall. The updater does not silently add Chrome permissions.
198
+
199
+ Re-run `install-managed` for recovery or migration, including when the panel reports **Native host update required**. After recovery, reload the extension in `chrome://extensions` and refresh Overleaf. Unmanaged checkout or Release-zip installations require a manual extension/native update.
200
+
201
+ ### Managed-update baseline
202
+
203
+ v2.2.0 introduced Bootstrap protocol 2. Existing v2.1.x managed installations need to run the pinned `install-managed` command once, then reload the extension and Overleaf. Later protocol-2 releases use the in-product updater for compatible runtime, style, vendor, and Native Host changes. Bootstrap protocol is separate from the Native Messaging compatibility handshake described below.
204
+
85
205
  ## npm Managed CLI
86
206
 
87
207
  npm installs, updates, and uninstalls the coordinated managed extension/native pair. Diagnostics still target the native host. The legacy `install-native` command remains available only for explicitly unmanaged extension directories.
88
208
 
89
209
  | Action | Command |
90
210
  |--------|---------|
91
- | Install / update | `npm exec --yes codex-overleaf-link@2.3.4 -- install-managed` |
92
- | Diagnose | `npm exec --yes codex-overleaf-link@2.3.4 -- doctor` |
93
- | Uninstall | `npm exec --yes codex-overleaf-link@2.3.4 -- uninstall-managed` |
211
+ | Install / recover / migrate | `npm exec --yes codex-overleaf-link@2.3.6 -- install-managed` |
212
+ | Diagnose | `npm exec --yes codex-overleaf-link@2.3.6 -- doctor` |
213
+ | Uninstall | `npm exec --yes codex-overleaf-link@2.3.6 -- uninstall-managed` |
94
214
 
95
215
  Use `--extension-id <chrome-extension-id>` only for a custom/dev unpacked extension id that differs from the official bundled id.
96
216
 
97
- ## Update
217
+ <a id="uninstall"></a>
218
+ <details>
219
+ <summary><strong>Uninstall</strong></summary>
98
220
 
99
- Managed installations discover signed stable updates automatically and apply them only while all Overleaf tabs and the native host are idle. Re-run `install-managed` only for recovery or migration, including when the panel reports **Native host update required**. Explicitly unmanaged installations still require a manual extension/native update. After recovery, reload the extension in `chrome://extensions` and refresh Overleaf.
221
+ Remove the managed extension/native installation (append `--browser chromium` on Linux Chromium):
100
222
 
101
- ## GitHub Release Artifacts
223
+ ```bash
224
+ npm exec --yes codex-overleaf-link@2.3.6 -- uninstall-managed
225
+ ```
102
226
 
103
- ### v2.2 managed-update baseline
227
+ The same command works in Windows PowerShell. It also applies to current `install.sh` / `install.ps1` installations, which install the managed pair.
104
228
 
105
- v2.2.0 introduces Bootstrap protocol 2. Existing v2.1.x managed installations must run the pinned `install-managed` command once, then reload the extension and Overleaf. Later protocol-2 releases use the in-product signed updater for ordinary runtime, style, vendor, and Native Host feature changes.
229
+ For an unmanaged checkout or native-only installation, use `npm run uninstall:native` from the checkout, or:
106
230
 
107
- The v2.3.4 GitHub Release contains:
231
+ ```bash
232
+ npm exec --yes codex-overleaf-link@2.3.6 -- uninstall-native
233
+ ```
108
234
 
109
- - `codex-overleaf-link-extension-v2.3.4.zip`: loadable Chrome extension package for manual unpacked installation.
110
- - `codex-overleaf-native-host-v2.3.4.tar.gz`: native host runtime files used by the installer and release verification.
111
- - `codex-overleaf-link-2.3.4.tgz`: npm native host CLI package for pinned install, doctor, and uninstall flows.
112
- - `install.sh`: release-pinned macOS / Linux installer that defaults to `v2.3.4` when run directly from the release artifact.
113
- - `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v2.3.4` when run directly from the release artifact.
114
- - `uninstall-native-host.mjs`: native host uninstaller that removes the Chrome Native Messaging manifest, bridge executable, and runtime copy.
115
- - `nativeHostPlatform.js`, `manifest.js`, `runtimeInstaller.js`: helper files required by the loose uninstaller asset.
116
- - `SHA256SUMS` and `release-manifest.json`: checksum and artifact metadata for release verification.
235
+ If you are removing an older native-only source installation and still have its source checkout, its bundled uninstaller can also be invoked directly:
117
236
 
118
- <details>
119
- <summary><strong>Uninstall</strong></summary>
237
+ ```bash
238
+ node ~/.codex-overleaf/source/scripts/uninstall-native-host.mjs
239
+ ```
120
240
 
121
- Remove the native host (use `--browser chromium` on Linux Chromium):
241
+ ```powershell
242
+ node $env:LOCALAPPDATA\CodexOverleaf\source\scripts\uninstall-native-host.mjs
243
+ ```
244
+
245
+ `uninstall-managed` removes the registered Native Messaging host, bridge executable, managed extension, and versioned native runtime. `uninstall-native` removes the native-only registration and runtime copy. Neither command clears browser session history/settings, project mirrors, plugin Codex history, provider credentials, or stored skills.
246
+
247
+ Remove the extension entry from `chrome://extensions` as well. To erase saved Codex Overleaf history, use the panel's history controls before removing the extension. Windows keeps the native installation under `%LOCALAPPDATA%\CodexOverleaf` and mirrors, plugin Codex history, providers, and skills under `%USERPROFILE%\.codex-overleaf`; full filesystem cleanup requires both roots. See [Local Data And Cleanup](#local-data-and-cleanup) for the separate browser and filesystem cleanup steps.
248
+
249
+ </details>
250
+
251
+ ## FAQ And Troubleshooting
252
+
253
+ **Native host missing or update required**
254
+
255
+ For a managed installation, rerun the [managed installer](#install), reload the extension in `chrome://extensions`, then refresh the Overleaf tab. This recovers the coordinated extension/native pair after an incomplete installation or incompatible runtime update.
122
256
 
123
257
  ```bash
124
- npm exec --yes codex-overleaf-link@2.3.4 -- uninstall-managed
258
+ npm exec --yes codex-overleaf-link@2.3.6 -- install-managed
125
259
  ```
126
260
 
127
- The same command works on Windows PowerShell. If you installed from a manual checkout or source installer, you can also run `npm run uninstall:native` inside the repo, use `node ~/.codex-overleaf/source/scripts/uninstall-native-host.mjs` on macOS / Linux, or use `node $env:LOCALAPPDATA\CodexOverleaf\source\scripts\uninstall-native-host.mjs` on Windows PowerShell.
261
+ For an unmanaged checkout, rebuild the extension and reinstall its native host from the same checkout. Use PowerShell installation commands on Windows.
128
262
 
129
- The uninstaller removes the Native Messaging registration, bridge executable, and native runtime copy. It does not remove browser IndexedDB, `chrome.storage.local`, project mirrors, plugin Codex history, or project/plugin skills.
263
+ **Codex CLI not found**
130
264
 
131
- Then remove the extension from `chrome://extensions`. To delete local data: on macOS / Linux, delete `~/.codex-overleaf`. On Windows, `%LOCALAPPDATA%\CodexOverleaf` holds the native source, runtime, bridge, and native log, while `%USERPROFILE%\.codex-overleaf` holds project mirrors, plugin Codex home/history, and Codex Overleaf skills — full Windows cleanup requires deleting both roots. See [Local Data And Cleanup](#local-data-and-cleanup) for full deletion steps.
265
+ Confirm `codex --version` works in a new terminal and, for the built-in provider, that you are logged in. On macOS/Linux, reinstalling the native host regenerates the launcher after PATH changes. On Windows, confirm `Get-Command codex` succeeds in PowerShell before reinstalling.
132
266
 
133
- </details>
267
+ **Extension id mismatch**
134
268
 
135
- ## Requirements
269
+ Copy the id shown in `chrome://extensions` and reinstall the native host with that id (see [Extension ID](#extension-id)).
136
270
 
137
- | Requirement | Notes |
138
- |-------------|-------|
139
- | macOS / Windows / Linux | Native Messaging host targets the current user's browser registration location |
140
- | Chrome / Chromium | macOS Chrome, Windows Chrome, and Linux Chrome are supported. Linux Chromium is supported only when installed with `--browser chromium`. macOS Chromium and Windows Chromium are not claimed as supported yet. |
141
- | Node.js >= 20 | Powers the native host bridge |
142
- | Git | Required by the one-command source installers and manual checkout flow |
143
- | Codex CLI | Installed and logged in (`codex --version` to verify) |
144
- | Overleaf account | Access to the target project |
145
- | TeX distribution *(optional)* | For `latexmk` / local compile checks |
271
+ **Linux Chromium does not connect**
146
272
 
147
- ## Browser Support
273
+ Reinstall the native host with `--browser chromium`, reload the unpacked extension, and refresh Overleaf. The Chromium manifest path is different from Chrome's path.
148
274
 
149
- | Platform | Supported browser path | Notes |
150
- |----------|------------------------|-------|
151
- | macOS | Google Chrome | Use the default installer. macOS Chromium native registration is not documented as supported. |
152
- | Windows | Google Chrome | Use the PowerShell installer. Windows Chromium native registration is not documented as supported. |
153
- | Linux | Google Chrome | Use the default installer. |
154
- | Linux | Chromium | Pass `--browser chromium` to install or uninstall the native host. |
275
+ **Diagnostics and logs**
155
276
 
156
- Linux Chromium install or update:
277
+ Use the diagnostics export for issue reports. Diagnostics are intended to exclude project text, prompt bodies, compile logs, raw diffs, binary content, and raw secrets by default. If you manually attach logs, review and redact file names, project ids, tokens, prompts, and document text.
157
278
 
158
- ```bash
159
- CODEX_OVERLEAF_REF=v2.3.4 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v2.3.4/install.sh)" -- --browser chromium
279
+ **Stale collaborator conflict**
280
+
281
+ The stale-write guard checks the original content and expected patch ranges. It can preserve unrelated edits when the target ranges still match; conflicting or unaligned changes are skipped. Inspect the skipped-file report and collaborator edits, then rerun from fresh context. A project switch can also stop a write because it no longer targets the project where the run started.
282
+
283
+ **Track / Accept / Undo is unavailable**
284
+
285
+ Track requires an Overleaf Reviewing state that the extension can verify. Accept and Undo depend on the run's actual writes and saved recovery evidence; some operations or later collaborator edits prevent full recovery. Follow the run card's specific next action. Turning Track off selects ordinary Editing for future Auto runs.
286
+
287
+ **Governance blocked write**
288
+
289
+ Project governance rules can mark paths read-only or restrict writable paths. Switch to ask-only mode, adjust the project governance settings, or narrow the requested edit to an allowed path.
290
+
291
+ **Sensitive preflight warning**
292
+
293
+ Sensitive preflight checks task context for likely tokens or secrets before a Codex run. Review the reported files and redact or remove sensitive content. A selected focus file does not exclude the rest of a complete project snapshot. Explicit confirmation is available only when allowed by the project's sensitive-content settings.
294
+
295
+ **Attachments and binary limits**
296
+
297
+ Composer attachments are context, while generated binary create/overwrite operations have a separate confirmation. Writeback uses chunked transfer up to the 10 MiB per-file limit. Unsupported types, oversized files, and filtered build artifacts are reported as skipped local changes. See [Context And Attachments](#context-and-attachments).
298
+
299
+ **A queued follow-up or fork cannot run**
300
+
301
+ A queued turn retains the settings captured when it was submitted. Changed or deleted provider configuration can require a new submission. Guide becomes available when the active Codex turn can receive it; otherwise the message stays queued. Fork requires a recorded Codex turn position and is disabled when that position is unavailable.
302
+
303
+ ## How It Works
304
+
305
+ ```mermaid
306
+ flowchart TD
307
+ O[Overleaf project and editor] <--> P[Page bridge]
308
+ P <--> C[Codex panel and content runtime]
309
+ C <--> B[Extension service worker]
310
+ B <-->|Native Messaging over stdio| N[Local Node host]
311
+ N <--> M[Project mirror and baseline]
312
+ N <-->|JSON RPC over stdio| A[Codex app-server]
313
+ A -->|Reads and edits| M
160
314
  ```
161
315
 
162
- Linux Chromium uninstall:
316
+ **Task lifecycle:**
317
+
318
+ 1. The extension captures the submitted mode, provider/model settings, Track/Compile choices, and focus files, then prepares a project snapshot or a verified reusable mirror.
319
+ 2. The native host synchronizes the snapshot and records a baseline. A partial snapshot is handled differently from a complete project snapshot.
320
+ 3. Codex runs against the local workspace through `codex app-server`, with an isolated Codex home, session history, and streaming events.
321
+ 4. The native host collects actual file changes, computes text diffs/patches, and prepares supported binary transfers. Ask returns its answer without writeback.
322
+ 5. Auto applies eligible operations through the browser after checking project identity, path rules, edit mode, and the expected text at each patch. Conflicting operations are skipped and reported.
323
+ 6. The extension records recovery evidence immediately after writes, then verifies save state, updates the mirror baseline, and optionally recompiles. The report distinguishes writes from save and compile verification.
324
+
325
+ Tracked-text acceptance uses Overleaf's native undo path to restore the pre-run text, then replays the run's edits with tracking off. The page bridge checks that Editing mode remains stable and attempts rollback if replay unexpectedly creates new tracked changes.
326
+
327
+ ## Development
328
+
329
+ Install locked development dependencies and build the content script before loading the checkout extension:
163
330
 
164
331
  ```bash
165
- npm exec --yes codex-overleaf-link@2.3.4 -- uninstall-managed --browser chromium
332
+ npm ci
333
+ npm run build:content
334
+ npm test
335
+ npm run verify:source
336
+ npm run verify:npm-package
337
+ npm run verify:update-boundary
338
+ npm run check:architecture
339
+ npm run benchmark:large
166
340
  ```
167
341
 
168
- ## Features
342
+ The project has no npm runtime dependencies. Development uses pinned **esbuild**; Markdown and math rendering libraries are vendored in the extension. Tests use Node's built-in runner and include VM/mock browser integration tests. The [CI workflow](.github/workflows/test.yml) currently uses Node 24.18.0 on macOS, Ubuntu, and Windows, with the managed-update hop rehearsal on Ubuntu.
169
343
 
170
- - **Three task modes** — ask-only, suggest-edit (review before write), auto-write (with delete confirmation).
171
- - **Live progress** — Codex events stream into the panel in real time.
172
- - **Stale-write guard** — blocks writes if the file changed since Codex started.
173
- - **Diff review** — per-file diff view before accepting changes.
174
- - **Undo checkpoint** — one-click revert of browser writes.
175
- - **Track Changes integration** — optionally enables Overleaf Reviewing before writing.
176
- - **Accept / Undo per run** — when a run wrote in Reviewing mode, accept or revert all of its tracked changes from the run card in one click. Accept replays the run's edits as untracked text via Overleaf's native undo path, with stable-Editing waits and an automatic rollback if Overleaf reintroduces tracked changes during the replay.
177
- - **Auto-recompile** — triggers Overleaf recompile after writeback; logs compile errors as context.
178
- - **@ context** — attach specific files, `@compile-log`, or `@current-section` to the prompt.
179
- - **Composer attachments and binary writeback** — paste or drop PDFs, images, and files into the composer as turn-scoped Codex context, and review Codex-created assets before creating or replacing them in Overleaf.
180
- - **Codex Overleaf skills** — install reusable plugin-scoped skills through the slash menu, then let Codex auto-trigger them or select one explicitly for the next turn. Each skill has its own enable toggle, honored at run time.
181
- - **Parallel subagents (experimental)** — enable the `parallel-subagents` skill and Codex can fan a decomposable task (e.g. polish several sections) out to real parallel Codex workers that the native host runs for you. Workers own disjoint files; a single file is parallelized by slicing its sections (scatter–gather) or by serialized scoped jobs, so concurrent edits never clobber each other. Each subagent's progress streams into the timeline, and edits a worker was not assigned are withheld from writeback.
182
- - **Governance rules** — configure project read-only and writable path rules that block unsafe writeback before browser mutation.
183
- - **Sensitive preflight** — scan selected project context for likely secrets before sending it to Codex.
184
- - **Audit and diagnostics** — keep local run records and export redacted diagnostic bundles for issue reports.
185
- - **Model picker** — discover available Codex models locally, then switch model, reasoning effort, and speed from one compact control.
186
- - **Third-party model providers (experimental)** — configure OpenAI-compatible Chat Completions, Responses API, and Anthropic Messages endpoints from Settings. Provider and gateway behavior varies, so the built-in Codex path remains the stable default.
187
- - **Session history** — multi-session management with rename, resume, and delete.
188
- - **Isolated Codex home** — plugin sessions run under `~/.codex-overleaf/codex-home` (not global `~/.codex/sessions`) and do not inherit your global Codex personalization.
189
- - **Experimental OT warm mirror** — optional read-only observation of active Overleaf text edits to keep focused local mirror files warm. Falls back to full snapshots when unavailable or inconsistent. Off by default; it never writes back to Overleaf through realtime collaboration channels.
344
+ The isolated-world bundle is generated from [content-entry.mjs](extension/entries/content-entry.mjs). Edit the source modules, then run `npm run build:content` and reload the extension; page-world bridge modules remain separate. For an unmanaged checkout, rerun `npm run install:native` after changing native runtime or shared files copied into it. `npm run bridge` starts the stdio Native Host directly for protocol work.
190
345
 
191
- ## Common Workflows
346
+ To update an existing managed installation from a prepared checkout, run `npm run install:managed` after building, then reload the extension and Overleaf.
192
347
 
193
- - **Fix a compile error** — choose Suggest mode, attach `@compile-log`, ask Codex to diagnose and patch the failing file, review the diff, apply it, then recompile from the panel.
194
- - **Rewrite a paragraph** — select the target file or `@current-section`, ask for a tone or clarity rewrite in Suggest mode, review the text diff, and accept only the hunks you want.
195
- - **Translate a section** — attach the source section with `@file` or `@current-section`, specify the target language and terminology constraints, then review the proposed replacement before writeback.
196
- - **Polish several sections at once** — enable the `parallel-subagents` skill, then ask Codex to polish multiple chapters or sections in parallel; it splits the work across subagents, runs them concurrently, and merges the results back for a single review.
348
+ | Area | Entry points |
349
+ |------|--------------|
350
+ | Panel and task orchestration | `extension/src/content/contentRuntime.js`, `extension/src/content/runController.js` |
351
+ | Page snapshot and writeback | `extension/src/pageBridge.js`, `extension/src/page/snapshotRouter.js`, `extension/src/page/writebackRouter.js` |
352
+ | Browser/native transport | `extension/src/background.js`, `native-host/src/index.js` |
353
+ | Codex and local mirror | `native-host/src/taskRunnerRuntime.js`, `native-host/src/codexSessionRunner.js`, `native-host/src/mirrorWorkspace.js` |
354
+ | Shared contracts and persistence | `extension/src/shared/`, `extension/src/content/scopedPersistenceCoordinator.js` |
355
+ | Managed updates and packaging | `extension/bootstrap/`, `extension/src/backgroundUpdateCoordinator.js`, `native-host/src/updateManager.js`, `scripts/` |
197
356
 
198
- ## How It Works
357
+ For a real browser smoke check, provide an Overleaf project URL accessible in the Chrome profile used for the test:
199
358
 
359
+ ```bash
360
+ npm run smoke:extension -- --url 'https://www.overleaf.com/project/<project-id>' --probe panel,native,project,diagnostics --json .local/smoke.json
200
361
  ```
201
- ┌─────────────────────────────────────────────────────────────┐
202
- │ Overleaf page │
203
- │ ↕ page bridge (injected script) │
204
- ├─────────────────────────────────────────────────────────────┤
205
- │ Chrome content script │
206
- │ ↕ chrome.runtime messaging │
207
- ├─────────────────────────────────────────────────────────────┤
208
- │ Extension service worker │
209
- │ ↕ Native Messaging (stdio) │
210
- ├─────────────────────────────────────────────────────────────┤
211
- │ Native host (Node.js) │
212
- │ → mirror sync: per-user Codex Overleaf local workspace │
213
- │ → Codex CLI session │
214
- │ ← collect diffs + patches │
215
- ├─────────────────────────────────────────────────────────────┤
216
- │ Browser writeback (with stale-write guard + undo) │
217
- └─────────────────────────────────────────────────────────────┘
362
+
363
+ The smoke script launches Chrome with a temporary profile by default. Use `--profile-dir <test-profile-dir> --keep-profile` when you need a dedicated profile with an Overleaf login, and ensure its native host is registered. For release work, see `npm run build:release`, `npm run verify:release-artifacts`, and `npm run rehearse:update-hop`.
364
+
365
+ ## Browser Support
366
+
367
+ | Platform | Supported browser path | Notes |
368
+ |----------|------------------------|-------|
369
+ | macOS | Google Chrome | Use the default installer. macOS Chromium native registration is not documented as supported. |
370
+ | Windows | Google Chrome | Use the PowerShell installer. Windows Chromium native registration is not documented as supported. |
371
+ | Linux | Google Chrome | Use the default installer. |
372
+ | Linux | Chromium | Pass `--browser chromium` to install or uninstall the native host. |
373
+
374
+ The shipped extension targets `https://overleaf.com/project` and `https://www.overleaf.com/project` and their project pages. Other Overleaf deployments are not included in its host permissions.
375
+
376
+ Linux Chromium install or update:
377
+
378
+ ```bash
379
+ CODEX_OVERLEAF_REF=v2.3.6 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v2.3.6/install.sh)" -- --browser chromium
218
380
  ```
219
381
 
220
- **Task lifecycle:**
382
+ Linux Chromium uninstall:
221
383
 
222
- 1. Extension captures a project snapshot from Overleaf.
223
- 2. Native host syncs the snapshot to a local mirror workspace.
224
- 3. Codex runs against the workspace.
225
- 4. Native host collects text changes and computes diffs/patches.
226
- 5. Extension applies changes back to Overleaf with freshness verification.
227
- 6. Mirror baseline is updated after successful writeback.
384
+ ```bash
385
+ npm exec --yes codex-overleaf-link@2.3.6 -- uninstall-managed --browser chromium
386
+ ```
228
387
 
229
388
  ## Extension ID
230
389
 
@@ -234,38 +393,58 @@ This repo ships a stable Chrome extension `key`, producing the deterministic id:
234
393
  illdpneeeopfffmiepaejglgmhpmdhdc
235
394
  ```
236
395
 
237
- The installer uses this id by default. If Chrome assigns a different id, reinstall the native host with the actual id:
396
+ The installer uses this id by default. For a managed installation with a custom id, rerun the managed installer with the id shown in `chrome://extensions`:
238
397
 
239
398
  ```bash
240
- cd ~/.codex-overleaf/source && npm run install:native -- --extension-id <your-chrome-extension-id>
399
+ npm exec --yes codex-overleaf-link@2.3.6 -- install-managed --extension-id <your-chrome-extension-id>
241
400
  ```
242
401
 
243
- ```powershell
244
- cd $env:LOCALAPPDATA\CodexOverleaf\source
245
- npm run install:native -- --extension-id <your-chrome-extension-id>
402
+ For an unmanaged extension, use the native-only installer:
403
+
404
+ ```bash
405
+ npm exec --yes codex-overleaf-link@2.3.6 -- install-native --extension-id <your-chrome-extension-id>
246
406
  ```
247
407
 
248
- For custom builds, pass the actual id with `CODEX_OVERLEAF_EXTENSION_ID=<chrome-extension-id>` when running `install.sh`, or with `--extension-id <chrome-extension-id>` when running `scripts/install-native-host.mjs`, so the native manifest `allowed_origins` entry matches the installed extension.
408
+ Both npm commands work in PowerShell. Source installers also accept the `CODEX_OVERLEAF_EXTENSION_ID` environment variable. The Native Messaging manifest's `allowed_origins` must match the loaded extension id.
409
+
410
+ ## GitHub Release Artifacts
411
+
412
+ The v2.3.6 GitHub Release contains:
413
+
414
+ - `codex-overleaf-link-extension-v2.3.6.zip`: loadable Chrome extension package for manual unpacked installation.
415
+ - `codex-overleaf-native-host-v2.3.6.tar.gz`: native host runtime files used by the installer and release verification.
416
+ - `codex-overleaf-update-v2.3.6.tar.gz`: coordinated extension/native bundle used by the managed updater.
417
+ - `codex-overleaf-link-2.3.6.tgz`: npm native host CLI package for pinned install, doctor, and uninstall flows.
418
+ - `install.sh`: release-pinned macOS / Linux installer that defaults to `v2.3.6` when run directly from the release artifact.
419
+ - `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v2.3.6` when run directly from the release artifact.
420
+ - `uninstall-native-host.mjs`: native host uninstaller that removes the Chrome Native Messaging manifest, bridge executable, and runtime copy.
421
+ - `nativeHostPlatform.js`, `manifest.js`, `runtimeInstaller.js`: helper files required by the loose uninstaller asset.
422
+ - `SHA256SUMS`, `release-manifest.json`, and `release-manifest.sig`: checksums, release metadata, and its Ed25519 signature.
423
+ - `release-notes.md`: release notes shipped with the artifacts.
249
424
 
250
425
  ## Local Data And Cleanup
251
426
 
252
- Codex Overleaf Link does not use a hosted backend or default telemetry. Data is local to the Chrome profile and local native host. The privacy posture is documented in this README and the GitHub Release notes; no internal docs are shipped in release artifacts.
427
+ Codex Overleaf Link has no hosted application backend or default telemetry. It stores project mirrors and session data locally, but task context is sent to Codex or the selected third-party model endpoint during a run. Project rules control browser writes; they do not remove files from the model's reading context.
428
+
429
+ Codex Overleaf history and browser extension settings use different stores. The content script opens the `codex-overleaf` IndexedDB database in the Overleaf page's origin; extension preferences use `chrome.storage.local`. Removing the extension should not be treated as erasing that page-origin database. See Chrome's [content-script storage behavior](https://developer.chrome.com/docs/extensions/develop/concepts/storage-and-cookies#storage).
253
430
 
254
431
  | Area | Location | Contents |
255
432
  |------|----------|----------|
256
- | Browser IndexedDB | Extension database `codex-overleaf` | Sessions, turns, events, artifacts, and audit logs. |
257
- | Browser extension storage | `chrome.storage.local` | Preferences, project settings, governance rules, selected skill ids, and panel state. |
258
- | macOS/Linux source checkout | `~/.codex-overleaf/source` | Installer-managed source tree used by pinned updates and uninstall commands. |
259
- | macOS/Linux native runtime | `~/.codex-overleaf/native-host-runtime` | Runtime copy loaded by Chrome Native Messaging. |
260
- | macOS/Linux bridge | `~/.codex-overleaf/codex-overleaf-bridge` | Native Messaging launcher executable. |
261
- | Windows source/runtime/bridge | `%LOCALAPPDATA%\CodexOverleaf` | `source`, `native-host-runtime`, `codex-overleaf-bridge.cmd`, and native debug log. |
433
+ | Browser IndexedDB | Database `codex-overleaf` under the Overleaf page origin | Sessions, turns, events, artifacts, and audit logs. |
434
+ | Browser extension storage | `chrome.storage.local` | Global UI preferences in `codexOverleafGlobalPrefsV1`, plus project settings, governance rules, selected skill ids, and panel state. |
435
+ | Managed extension | `~/.codex-overleaf/managed/extension` on macOS/Linux; `%LOCALAPPDATA%\CodexOverleaf\managed\extension` on Windows | Stable directory loaded into Chrome, including bootstrap and replaceable runtime files. |
436
+ | Managed native host | `~/.codex-overleaf/managed/native` on macOS/Linux; `%LOCALAPPDATA%\CodexOverleaf\managed\native` on Windows | Versioned runtimes, active/previous version pointers, bootstrap launcher, and update staging. |
437
+ | Source installer checkout | `~/.codex-overleaf/source` on macOS/Linux; `%LOCALAPPDATA%\CodexOverleaf\source` on Windows | Source retained by `install.sh` / `install.ps1`; npm managed installs do not require this checkout. |
438
+ | Native-only runtime | `~/.codex-overleaf/native-host-runtime` on macOS/Linux; `%LOCALAPPDATA%\CodexOverleaf\native-host-runtime` on Windows | Runtime copy for unmanaged/native-only installations. The Windows Native Messaging manifest also lives in this directory for managed installs. |
439
+ | Native bridge | `~/.codex-overleaf/codex-overleaf-bridge` on macOS/Linux; `%LOCALAPPDATA%\CodexOverleaf\codex-overleaf-bridge.cmd` on Windows | Native Messaging launcher executable. |
262
440
  | Project mirrors | `~/.codex-overleaf/projects` on macOS/Linux, `%USERPROFILE%\.codex-overleaf\projects` on Windows | Local mirror workspaces and mirror metadata for each Overleaf project. |
263
441
  | Plugin Codex home | `~/.codex-overleaf/codex-home` on macOS/Linux, `%USERPROFILE%\.codex-overleaf\codex-home` on Windows | Isolated Codex home for plugin runs. It copies auth/config metadata but does not reuse global Codex sessions or inherit global Codex personalization. |
264
442
  | Codex Overleaf skills | `~/.codex-overleaf/skills` on macOS/Linux, `%USERPROFILE%\.codex-overleaf\skills` on Windows | Project/plugin skills managed by the extension. |
443
+ | Provider configuration | `~/.codex-overleaf/providers.json` and `provider-secrets.json`; under `%USERPROFILE%\.codex-overleaf` on Windows | Model provider profiles and separately stored API keys. |
265
444
  | Native logs | `~/.codex-overleaf/native-host.log` on macOS/Linux, `%LOCALAPPDATA%\CodexOverleaf\native-host.log` on Windows | Native debug events with content length summaries where possible. |
266
445
  | Launcher logs | `~/.codex-overleaf/native-host-launcher.log` on macOS/Linux | POSIX launcher startup path and Node diagnostics. The Windows `.cmd` launcher does not currently emit a separate launcher log. |
267
446
 
268
- Skill loading toggles default to enabled. In Project Settings:
447
+ These are default locations; custom installation paths and environment overrides may differ. Skill loading toggles default to enabled. In Settings:
269
448
 
270
449
  - `Load local Codex skills` loads the user's local Codex skill environment from the global Codex home into the isolated `~/.codex-overleaf/codex-home`: `~/.codex/skills`, local Codex `plugins`, `superpowers`, and related skill/plugin configuration. Turning it off hides user/system Codex skills and local Codex plugins from Codex Overleaf runs. This affects only the plugin CODEX_HOME prepared for the run; it does not write to or reuse global `~/.codex/sessions`.
271
450
  - `Load Codex Overleaf skills` loads project/plugin skills managed by the extension from `~/.codex-overleaf/skills` on macOS/Linux or `%USERPROFILE%\.codex-overleaf\skills` on Windows into the same isolated Codex home. Turning it off hides those extension-managed skills while preserving the stored skill files. If both toggles are off, the run starts without local Codex skills or Codex Overleaf skills.
@@ -283,59 +462,24 @@ Native registration paths:
283
462
 
284
463
  Full uninstall and data deletion:
285
464
 
286
- 1. Remove the extension from `chrome://extensions` in every Chrome/Chromium profile where it was loaded. This removes the extension's `codex-overleaf` IndexedDB and `chrome.storage.local` data for that profile.
287
- 2. Run the native uninstaller for the browser you registered. Use `--browser chromium` on Linux Chromium.
288
- 3. Delete local native and mirror data if you want a clean machine:
289
- - macOS/Linux: `rm -rf ~/.codex-overleaf ~/Codex\ Overleaf\ Link\ Extension`
290
- - Windows PowerShell: `Remove-Item -Recurse -Force "$env:LOCALAPPDATA\CodexOverleaf", "$env:USERPROFILE\.codex-overleaf" -ErrorAction SilentlyContinue`
291
-
292
- Composer attachments are turn-scoped Codex context. Limits are 8 attachments per run, 12 MiB per attachment, and 32 MiB total raw attachment size per run. Attachments are staged under `.codex-overleaf-attachments` inside the mirror workspace and are ignored during writeback.
465
+ 1. Before removing the extension, use **Settings → History & storage → Clear all history** if you want to erase saved run history. Repeat for each browser profile and Overleaf origin you used. If the extension is already removed, the `codex-overleaf` database can be deleted from the Overleaf page's **DevTools → Application → IndexedDB**. Target that database rather than clearing all Overleaf site data.
466
+ 2. Run `uninstall-managed` for a managed installation, or `uninstall-native` for an unmanaged/native-only installation, as described under [Uninstall](#uninstall). Use `--browser chromium` for Linux Chromium.
467
+ 3. Remove the extension entry from `chrome://extensions` in each browser profile. Chrome removes that extension's `chrome.storage.local` settings when it is uninstalled. See the [Chrome storage API documentation](https://developer.chrome.com/docs/extensions/reference/api/storage#storage_areas).
468
+ 4. To erase all remaining default filesystem data, including project mirrors, plugin Codex history, provider credentials, skills, and source checkouts, use the appropriate command below. Also remove any custom installation roots you configured.
293
469
 
294
- ## FAQ And Troubleshooting
295
-
296
- **Native host missing or update required**
297
-
298
- Re-run any [native host installer](#install), reload the extension in `chrome://extensions`, then refresh the Overleaf tab. This also fixes extension/native version mismatch and native protocol mismatch.
470
+ macOS/Linux:
299
471
 
300
472
  ```bash
301
- npm exec --yes codex-overleaf-link@2.3.4 -- install-managed
473
+ rm -rf ~/.codex-overleaf ~/Codex\ Overleaf\ Link\ Extension
302
474
  ```
303
475
 
304
- **The Windows popup or panel shows a Bash recovery command**
305
-
306
- Use the PowerShell recovery command on Windows. The Bash command is for macOS/Linux installers.
307
-
308
- **Codex CLI not found**
309
-
310
- Confirm `codex --version` works in a new terminal and that you are logged in. On macOS/Linux, reinstalling the native host regenerates the launcher after PATH changes. On Windows, confirm `Get-Command codex` succeeds in PowerShell before reinstalling.
311
-
312
- **Extension id mismatch**
313
-
314
- Copy the id shown in `chrome://extensions` and reinstall the native host with that id (see [Extension ID](#extension-id)).
315
-
316
- **Linux Chromium does not connect**
317
-
318
- Reinstall the native host with `--browser chromium`, reload the unpacked extension, and refresh Overleaf. The Chromium manifest path is different from Chrome's path.
319
-
320
- **Diagnostics and logs**
321
-
322
- Use the diagnostics export for issue reports. Diagnostics are intended to exclude project text, prompt bodies, compile logs, raw diffs, binary content, and raw secrets by default. If you manually attach logs, review and redact file names, project ids, tokens, prompts, and document text.
323
-
324
- **Stale collaborator conflict**
325
-
326
- The stale-write guard blocks writes when the Overleaf file changed since Codex started. Review collaborator edits, refresh the page or rerun the task from a fresh snapshot, then apply the diff again.
327
-
328
- **Governance blocked write**
329
-
330
- Project governance rules can mark paths read-only or restrict writable paths. Switch to ask-only mode, adjust the project governance settings, or narrow the requested edit to an allowed path.
331
-
332
- **Sensitive preflight warning**
333
-
334
- Sensitive preflight scans selected context for likely tokens or secrets before a Codex run. Remove the sensitive text from selected context, redact it, or explicitly decide not to send that context.
476
+ Windows PowerShell:
335
477
 
336
- **Attachments and binary limits**
478
+ ```powershell
479
+ Remove-Item -Recurse -Force "$env:LOCALAPPDATA\CodexOverleaf", "$env:USERPROFILE\.codex-overleaf" -ErrorAction SilentlyContinue
480
+ ```
337
481
 
338
- Attachments are for turn-scoped context and are not written back to Overleaf. Binary create/overwrite is reviewed separately. Large binary writeback may be reported as unsupported instead of being inlined when it would exceed native messaging payload limits.
482
+ Composer attachments are staged under `.codex-overleaf-attachments` inside the mirror workspace and are ignored during writeback. Submission clears the composer strip; it is not a promise of immediate deletion from local mirrors or Codex history.
339
483
 
340
484
  ## Compatibility Matrix
341
485
 
@@ -345,26 +489,20 @@ Use this matrix for release-candidate signoff and compatibility reports. Record
345
489
  |-------|--------------|----------------|--------------|----------------|
346
490
  | OS/version/arch | Record exact macOS version and `arm64`/`x64`. | Record exact Windows version and `arm64`/`x64`. | Record distro, version, and `arm64`/`x64`. | Record distro, version, and `arm64`/`x64`. |
347
491
  | Browser/channel/version | Google Chrome channel and version. | Google Chrome channel and version. | Google Chrome channel and version. | Chromium channel/package and version. |
348
- | Install mode | Manual unpacked extension from GitHub Release zip or checkout. | Manual unpacked extension from GitHub Release zip or checkout. | Manual unpacked extension from GitHub Release zip or checkout. | Manual unpacked extension from GitHub Release zip or checkout; native host installed with `--browser chromium`. |
492
+ | Install mode | Managed pair recommended; unmanaged Release zip or checkout also available. | Same as macOS Chrome. | Same as macOS Chrome. | Managed or unmanaged; register with `--browser chromium`. |
349
493
  | Extension id | Bundled id `illdpneeeopfffmiepaejglgmhpmdhdc`, or actual custom id passed with `--extension-id`. | Bundled id `illdpneeeopfffmiepaejglgmhpmdhdc`, or actual custom id passed with `--extension-id`. | Bundled id `illdpneeeopfffmiepaejglgmhpmdhdc`, or actual custom id passed with `--extension-id`. | Bundled id `illdpneeeopfffmiepaejglgmhpmdhdc`, or actual custom id passed with `--extension-id`. |
350
- | Installer/update command | `npm exec --yes codex-overleaf-link@2.3.4 -- install-managed` | `npm exec --yes codex-overleaf-link@2.3.4 -- install-managed` | `npm exec --yes codex-overleaf-link@2.3.4 -- install-managed` | `npm exec --yes codex-overleaf-link@2.3.4 -- install-managed --browser chromium` |
351
- | Uninstall command | `npm exec --yes codex-overleaf-link@2.3.4 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@2.3.4 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@2.3.4 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@2.3.4 -- uninstall-managed --browser chromium` |
494
+ | Installer/update command | `npm exec --yes codex-overleaf-link@2.3.6 -- install-managed` | `npm exec --yes codex-overleaf-link@2.3.6 -- install-managed` | `npm exec --yes codex-overleaf-link@2.3.6 -- install-managed` | `npm exec --yes codex-overleaf-link@2.3.6 -- install-managed --browser chromium` |
495
+ | Uninstall command | `npm exec --yes codex-overleaf-link@2.3.6 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@2.3.6 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@2.3.6 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@2.3.6 -- uninstall-managed --browser chromium` |
352
496
  | Manifest/registry path | `~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.codex.overleaf.json` | `HKCU\Software\Google\Chrome\NativeMessagingHosts\com.codex.overleaf` -> `%LOCALAPPDATA%\CodexOverleaf\native-host-runtime\com.codex.overleaf.json` | `~/.config/google-chrome/NativeMessagingHosts/com.codex.overleaf.json` | `~/.config/chromium/NativeMessagingHosts/com.codex.overleaf.json` |
353
- | Bridge/runtime/source path | Bridge `~/.codex-overleaf/codex-overleaf-bridge`; runtime `~/.codex-overleaf/native-host-runtime`; source `~/.codex-overleaf/source`. | Bridge `%LOCALAPPDATA%\CodexOverleaf\codex-overleaf-bridge.cmd`; runtime `%LOCALAPPDATA%\CodexOverleaf\native-host-runtime`; source `%LOCALAPPDATA%\CodexOverleaf\source`. | Bridge `~/.codex-overleaf/codex-overleaf-bridge`; runtime `~/.codex-overleaf/native-host-runtime`; source `~/.codex-overleaf/source`. | Bridge `~/.codex-overleaf/codex-overleaf-bridge`; runtime `~/.codex-overleaf/native-host-runtime`; source `~/.codex-overleaf/source`. |
354
- | Node/Git/Codex/TeX | Node.js >= 20; Git; Codex CLI installed and logged in; TeX optional. | Node.js >= 20; Git; Codex CLI installed and logged in; TeX optional. | Node.js >= 20; Git; Codex CLI installed and logged in; TeX optional. | Node.js >= 20; Git; Codex CLI installed and logged in; TeX optional. |
355
- | Native protocol/capabilities | Protocol 1; native protocol range 1-1; requires `bridgePing`, `mirrorSync`, `mirrorPatchFiles`, `mirrorStatus`, `codexRun`, `codexCancel`, `codexModels`, `historyClearPlugin`, `localSkills`, `mirrorSensitiveScan`. | Same as macOS Chrome. | Same as macOS Chrome. | Same as macOS Chrome. |
497
+ | Managed runtime paths | `~/.codex-overleaf/managed/extension` and `~/.codex-overleaf/managed/native`. | `%LOCALAPPDATA%\CodexOverleaf\managed\extension` and `%LOCALAPPDATA%\CodexOverleaf\managed\native`. | Same as macOS Chrome. | Same as macOS Chrome. |
498
+ | Node/Git/Codex/TeX | Record exact versions; see [Requirements](#requirements) for installation and provider prerequisites. | Same as macOS Chrome. | Same as macOS Chrome. | Same as macOS Chrome. |
499
+ | Native compatibility | Current protocol 2; extension supports native protocol range 1–2. Required capabilities and runtime versions are checked separately; see below. | Same as macOS Chrome. | Same as macOS Chrome. | Same as macOS Chrome. |
356
500
  | Overleaf behavior checks | Current file detection, full snapshot source, file tree write operations, undo checkpoint, Reviewing control, compile capture, save-state verification, OT warm mirror fallback. | Same checks. | Same checks. | Same checks. |
357
501
  | Last smoke date/result | Record date, tester, and pass/fail. | Record date, tester, and pass/fail. | Record date, tester, and pass/fail. | Record date, tester, and pass/fail. |
358
502
 
359
- ## Development
503
+ The current handshake requires `bridgePing`, `mirrorSync`, `mirrorPatchFiles`, `mirrorStatus`, `codexRun`, `codexCancel`, `codexSteer`, `codexModels`, `historyClearPlugin`, `localSkills`, `mirrorSensitiveScan`, `providerProfiles`, `assetTransfer`, and `threadFork`. [compatibility.js](extension/src/shared/compatibility.js) owns this list and the protocol/version rules. An overlapping protocol range alone does not establish full compatibility.
360
504
 
361
- ```bash
362
- npm test # Node.js built-in test runner, zero dependencies
363
- npm run check:architecture # enforce v1.0 final architecture budgets
364
- npm run benchmark:large # run the synthetic large-project regression gate
365
- npm run bridge # run the native host directly for protocol work
366
- npm run install:native # reinstall native host after changing native-host/src or extension/src/shared
367
- ```
505
+ The table is a reporting template, not evidence that every listed browser/version has been exercised. CI covers local tests on macOS, Ubuntu, and Windows; real Overleaf compatibility requires a browser smoke run.
368
506
 
369
507
  ## Contributing
370
508
 
@@ -378,27 +516,3 @@ Contributions are welcome. Please open an issue before submitting large changes
378
516
  ## License
379
517
 
380
518
  [MIT](LICENSE)
381
-
382
- ## Managed Stable Updates (v1.9)
383
-
384
- The recommended v1.9 installation owns one stable unpacked-extension directory and a versioned native-host directory:
385
-
386
- ```bash
387
- npm exec --yes codex-overleaf-link@2.3.4 -- install-managed
388
- ```
389
-
390
- Load the printed extension path once from `chrome://extensions`. Starting with the next signed stable release, Codex Overleaf Link checks GitHub Releases automatically, downloads and verifies the coordinated extension/native-host bundle, waits until every connected Overleaf tab is saved and idle, and then updates both components together. A failed health check restores the previous version automatically.
391
-
392
- The stable updater ignores drafts and prereleases, performs no telemetry, and cannot add Chrome permissions silently. Releases that require a newer Bootstrap protocol display manual migration guidance.
393
-
394
- The legacy native-only installer remains available for source or unmanaged extension directories:
395
-
396
- ```bash
397
- npm exec --yes codex-overleaf-link@2.3.4 -- install-native
398
- ```
399
-
400
- Legacy native-only installations can be removed with:
401
-
402
- ```bash
403
- npm exec --yes codex-overleaf-link@2.3.4 -- uninstall-native
404
- ```