codex-overleaf-link 1.1.1

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 (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +457 -0
  3. package/bin/codex-overleaf-link.mjs +223 -0
  4. package/extension/src/shared/agentTranscript.js +1175 -0
  5. package/extension/src/shared/auditRecords.js +568 -0
  6. package/extension/src/shared/compatibility.js +372 -0
  7. package/extension/src/shared/compileAdapter.js +176 -0
  8. package/extension/src/shared/governanceRules.js +252 -0
  9. package/extension/src/shared/i18n.js +565 -0
  10. package/extension/src/shared/models.js +106 -0
  11. package/extension/src/shared/otText.js +505 -0
  12. package/extension/src/shared/projectFiles.js +180 -0
  13. package/extension/src/shared/reviewing.js +99 -0
  14. package/extension/src/shared/sensitiveScan.js +116 -0
  15. package/extension/src/shared/sessionState.js +1084 -0
  16. package/extension/src/shared/staleGuard.js +150 -0
  17. package/extension/src/shared/storageDb.js +986 -0
  18. package/extension/src/shared/storageKeys.js +29 -0
  19. package/extension/src/shared/storageMigration.js +168 -0
  20. package/extension/src/shared/summary.js +248 -0
  21. package/extension/src/shared/undoOperations.js +369 -0
  22. package/native-host/src/codexArgs.js +43 -0
  23. package/native-host/src/codexHome.js +538 -0
  24. package/native-host/src/codexModels.js +247 -0
  25. package/native-host/src/codexPrompt.js +192 -0
  26. package/native-host/src/codexPromptAssembly.js +411 -0
  27. package/native-host/src/codexSessionRunner.js +1247 -0
  28. package/native-host/src/commandApproval.js +914 -0
  29. package/native-host/src/debugLog.js +78 -0
  30. package/native-host/src/diffEngine.js +247 -0
  31. package/native-host/src/index.js +132 -0
  32. package/native-host/src/launcher.js +81 -0
  33. package/native-host/src/localSkills.js +476 -0
  34. package/native-host/src/manifest.js +226 -0
  35. package/native-host/src/mirrorSensitiveScan.js +119 -0
  36. package/native-host/src/mirrorWorkspace.js +1019 -0
  37. package/native-host/src/nativeDoctor.js +826 -0
  38. package/native-host/src/nativeEnvironment.js +315 -0
  39. package/native-host/src/nativeHostPlatform.js +112 -0
  40. package/native-host/src/nativeMessaging.js +60 -0
  41. package/native-host/src/nativeQuotas.js +294 -0
  42. package/native-host/src/nativeResponseBudget.js +194 -0
  43. package/native-host/src/runtimeInstaller.js +357 -0
  44. package/native-host/src/taskRunner.js +3 -0
  45. package/native-host/src/taskRunnerRuntime.js +1083 -0
  46. package/native-host/src/textPatch.js +287 -0
  47. package/package.json +40 -0
  48. package/scripts/codex-json-agent.mjs +269 -0
  49. package/scripts/install-native-host.mjs +255 -0
  50. package/scripts/npm-package-files-v1.1.1.txt +52 -0
  51. package/scripts/uninstall-native-host.mjs +298 -0
  52. package/scripts/verify-npm-package.mjs +296 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hengquan Guo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,457 @@
1
+ <div align="center">
2
+ <img src="extension/assets/icons/codex-overleaf-icon.png" width="96" alt="Codex Overleaf Link">
3
+ <h1>Codex Overleaf Link</h1>
4
+ <p><strong>Empower Overleaf with Codex.</strong></p>
5
+ <p>
6
+ <img src="https://img.shields.io/badge/version-1.1.1-blue" alt="version">
7
+ <img src="https://img.shields.io/badge/platform-macOS%20%2F%20Windows%20%2F%20Linux-lightgrey" alt="platform">
8
+ <img src="https://img.shields.io/badge/chrome-MV3-green" alt="chrome manifest v3">
9
+ <img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="node version">
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">
12
+ <img src="https://img.shields.io/badge/license-MIT-blue" alt="license">
13
+ </p>
14
+ </div>
15
+
16
+ ---
17
+
18
+ ## Why
19
+
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
+
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.
23
+
24
+ ## Preview
25
+
26
+ <p align="center">
27
+ <img src="assets/codex-preview.png" alt="Codex Overleaf Link running inside Overleaf">
28
+ </p>
29
+
30
+ ## Install
31
+
32
+ The official release path is still a one-command native-host install plus Chrome's required manual approval for an unpacked extension. The bundled extension key gives the official unpacked build a stable id, so you do not need to pass an extension id for normal release installs.
33
+
34
+ macOS / Linux latest source install:
35
+
36
+ ```bash
37
+ curl -fsSL "https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/main/install.sh?$(date +%s)" | bash
38
+ ```
39
+
40
+ Recommended version-pinned native-host install or update for v1.1.1:
41
+
42
+ ```bash
43
+ npm exec --yes codex-overleaf-link@1.1.1 -- install-native
44
+ ```
45
+
46
+ GitHub Release script fallback for macOS / Linux:
47
+
48
+ ```bash
49
+ CODEX_OVERLEAF_REF=v1.1.1 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.1.1/install.sh)"
50
+ ```
51
+
52
+ GitHub Release script fallback for Windows from PowerShell:
53
+
54
+ ```powershell
55
+ iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.1.1/install.ps1 -OutFile install.ps1
56
+ $env:CODEX_OVERLEAF_REF='v1.1.1'
57
+ powershell -ExecutionPolicy Bypass -File install.ps1
58
+ ```
59
+
60
+ The macOS / Linux installer creates a visible `~/Codex Overleaf Link Extension` shortcut to the extension folder. On macOS it also opens Chrome's extension page, opens Finder to the shortcut, and copies the shortcut path. The Windows installer prints the extension folder path after registering the native host.
61
+
62
+ Chrome still requires one manual approval step for unpacked extensions:
63
+
64
+ 1. Enable **Developer mode** in `chrome://extensions`.
65
+ 2. Click **Load unpacked** and select `~/Codex Overleaf Link Extension` on macOS/Linux, or the printed extension folder on Windows.
66
+
67
+ If you modify the extension key or load a custom build that gets a different id, rerun the native install with `--extension-id <chrome-extension-id>`.
68
+
69
+ ## npm Native Host CLI
70
+
71
+ npm installs, updates, uninstalls, and diagnoses the native host only. npm does not install the Chrome extension; install the Chrome extension separately from the release source checkout or extension zip.
72
+
73
+ Install or update the native host for the official release extension id:
74
+
75
+ ```bash
76
+ npm exec --yes codex-overleaf-link@1.1.1 -- install-native
77
+ ```
78
+
79
+ Diagnose the registered native host:
80
+
81
+ ```bash
82
+ npm exec --yes codex-overleaf-link@1.1.1 -- doctor
83
+ ```
84
+
85
+ Uninstall the native host:
86
+
87
+ ```bash
88
+ npm exec --yes codex-overleaf-link@1.1.1 -- uninstall-native
89
+ ```
90
+
91
+ Use `--extension-id <chrome-extension-id>` only for a custom/dev unpacked extension id that differs from the official bundled id.
92
+
93
+ Open any Overleaf project - the Codex panel appears on the right.
94
+
95
+ ## Quick Start
96
+
97
+ 1. Install or update the native host with the version-pinned npm command, or use the GitHub Release script fallback for your platform.
98
+ 2. In `chrome://extensions`, enable Developer mode, load or reload the unpacked extension folder, and confirm the native host is connected from the panel diagnostics.
99
+ 3. Open an Overleaf project and start in Ask mode; switch to Suggest mode when you want Codex to propose reviewed edits, or Auto mode when the project governance and checkpoint settings are ready for direct writeback.
100
+
101
+ <p align="center">
102
+ <img src="assets/codex-preview.png" alt="Codex Overleaf Link panel inside Overleaf">
103
+ </p>
104
+
105
+ <details>
106
+ <summary><strong>Manual install</strong> (if you prefer a custom location)</summary>
107
+
108
+ ```bash
109
+ git clone https://github.com/Ghqqqq/codex-overleaf-link.git
110
+ cd codex-overleaf-link
111
+ ```
112
+
113
+ Then load `extension/` as an unpacked extension in Chrome and register the native host:
114
+
115
+ ```bash
116
+ npm run install:native
117
+ ```
118
+
119
+ If Chrome assigns a different extension id, rerun `npm run install:native -- --extension-id <chrome-extension-id>`.
120
+
121
+ </details>
122
+
123
+ <details>
124
+ <summary><strong>Update</strong></summary>
125
+
126
+ For a deterministic v1.1.1 update, run the pinned npm command. This is also the native mismatch recovery command shown by the popup and panel when they report **Native host update required**.
127
+
128
+ ```bash
129
+ npm exec --yes codex-overleaf-link@1.1.1 -- install-native
130
+ ```
131
+
132
+ If npm is unavailable, use the GitHub Release script fallback for your platform.
133
+
134
+ macOS / Linux:
135
+
136
+ ```bash
137
+ CODEX_OVERLEAF_REF=v1.1.1 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.1.1/install.sh)"
138
+ ```
139
+
140
+ Windows PowerShell:
141
+
142
+ ```powershell
143
+ iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.1.1/install.ps1 -OutFile install.ps1
144
+ $env:CODEX_OVERLEAF_REF='v1.1.1'
145
+ powershell -ExecutionPolicy Bypass -File install.ps1
146
+ ```
147
+
148
+ Then reload the extension in `chrome://extensions` and refresh the Overleaf page.
149
+
150
+ </details>
151
+
152
+ ## GitHub Release Artifacts
153
+
154
+ The v1.1.1 GitHub Release contains:
155
+
156
+ - `codex-overleaf-link-extension-v1.1.1.zip`: loadable Chrome extension package for manual unpacked installation.
157
+ - `codex-overleaf-native-host-v1.1.1.tar.gz`: native host runtime files used by the installer and release verification.
158
+ - `codex-overleaf-link-1.1.1.tgz`: npm native host CLI package for pinned install, doctor, and uninstall flows.
159
+ - `install.sh`: release-pinned macOS / Linux installer that defaults to `v1.1.1` when run directly from the release artifact.
160
+ - `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v1.1.1` when run directly from the release artifact.
161
+ - `uninstall-native-host.mjs`: native host uninstaller that removes the Chrome Native Messaging manifest, bridge executable, and runtime copy.
162
+ - `SHA256SUMS` and `release-manifest.json`: checksum and artifact metadata for release verification.
163
+
164
+ <details>
165
+ <summary><strong>Uninstall</strong></summary>
166
+
167
+ macOS / Linux:
168
+
169
+ ```bash
170
+ node ~/.codex-overleaf/source/scripts/uninstall-native-host.mjs
171
+ ```
172
+
173
+ Windows PowerShell:
174
+
175
+ ```powershell
176
+ node $env:LOCALAPPDATA\CodexOverleaf\source\scripts\uninstall-native-host.mjs
177
+ ```
178
+
179
+ If you installed from a manual checkout, you can also run `npm run uninstall:native` inside the repo.
180
+
181
+ Remove the extension from `chrome://extensions`. Optionally delete `~/.codex-overleaf` on macOS / Linux to remove local mirrors, native runtime files, and plugin history. On Windows, `%LOCALAPPDATA%\CodexOverleaf` contains the native source, runtime, bridge, and native log, while `%USERPROFILE%\.codex-overleaf` contains project mirrors, plugin Codex home/history, and Codex Overleaf skills. Full Windows cleanup requires deleting both roots, or following [Local Data And Cleanup](#local-data-and-cleanup).
182
+
183
+ 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. See [Local Data And Cleanup](#local-data-and-cleanup) for full deletion steps.
184
+
185
+ </details>
186
+
187
+ ## Requirements
188
+
189
+ | Requirement | Notes |
190
+ |-------------|-------|
191
+ | macOS / Windows / Linux | Native Messaging host targets the current user's browser registration location |
192
+ | 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. |
193
+ | Node.js >= 20 | Powers the native host bridge |
194
+ | Git | Required by the one-command source installers and manual checkout flow |
195
+ | Codex CLI | Installed and logged in (`codex --version` to verify) |
196
+ | Overleaf account | Access to the target project |
197
+ | TeX distribution *(optional)* | For `latexmk` / local compile checks |
198
+
199
+ ## Browser Support
200
+
201
+ | Platform | Supported browser path | Notes |
202
+ |----------|------------------------|-------|
203
+ | macOS | Google Chrome | Use the default installer. macOS Chromium native registration is not documented as supported. |
204
+ | Windows | Google Chrome | Use the PowerShell installer. Windows Chromium native registration is not documented as supported. |
205
+ | Linux | Google Chrome | Use the default installer. |
206
+ | Linux | Chromium | Pass `--browser chromium` to install or uninstall the native host. |
207
+
208
+ Linux Chromium install or update:
209
+
210
+ ```bash
211
+ CODEX_OVERLEAF_REF=v1.1.1 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.1.1/install.sh)" -- --browser chromium
212
+ ```
213
+
214
+ Linux Chromium uninstall:
215
+
216
+ ```bash
217
+ node ~/.codex-overleaf/source/scripts/uninstall-native-host.mjs --browser chromium
218
+ ```
219
+
220
+ ## Features
221
+
222
+ - **Three task modes** — ask-only, suggest-edit (review before write), auto-write (with delete confirmation).
223
+ - **Live progress** — Codex events stream into the panel in real time.
224
+ - **Stale-write guard** — blocks writes if the file changed since Codex started.
225
+ - **Diff review** — per-file diff view before accepting changes.
226
+ - **Undo checkpoint** — one-click revert of browser writes.
227
+ - **Track Changes integration** — optionally enables Overleaf Reviewing before writing.
228
+ - **Auto-recompile** — triggers Overleaf recompile after writeback; logs compile errors as context.
229
+ - **@ context** — attach specific files, `@compile-log`, or `@current-section` to the prompt.
230
+ - **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.
231
+ - **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.
232
+ - **Governance rules** — configure project read-only and writable path rules that block unsafe writeback before browser mutation.
233
+ - **Sensitive preflight** — scan selected project context for likely secrets before sending it to Codex.
234
+ - **Audit and diagnostics** — keep local run records and export redacted diagnostic bundles for issue reports.
235
+ - **Model picker** — discover available Codex models locally, then switch model, reasoning effort, and speed from one compact control.
236
+ - **Session history** — multi-session management with rename, resume, and delete.
237
+ - **Isolated Codex home** — plugin sessions stay under `~/.codex-overleaf/codex-home`, not global `~/.codex/sessions`.
238
+ - **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.
239
+
240
+ > Note: The OT warm mirror is experimental, off by default, and never writes back to Overleaf through realtime collaboration channels.
241
+
242
+ ## Common Workflows
243
+
244
+ - **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.
245
+ - **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.
246
+ - **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.
247
+
248
+ ## How It Works
249
+
250
+ ```
251
+ ┌─────────────────────────────────────────────────────────────┐
252
+ │ Overleaf page │
253
+ │ ↕ page bridge (injected script) │
254
+ ├─────────────────────────────────────────────────────────────┤
255
+ │ Chrome content script │
256
+ │ ↕ chrome.runtime messaging │
257
+ ├─────────────────────────────────────────────────────────────┤
258
+ │ Extension service worker │
259
+ │ ↕ Native Messaging (stdio) │
260
+ ├─────────────────────────────────────────────────────────────┤
261
+ │ Native host (Node.js) │
262
+ │ → mirror sync: per-user Codex Overleaf local workspace │
263
+ │ → Codex CLI session │
264
+ │ ← collect diffs + patches │
265
+ ├─────────────────────────────────────────────────────────────┤
266
+ │ Browser writeback (with stale-write guard + undo) │
267
+ └─────────────────────────────────────────────────────────────┘
268
+ ```
269
+
270
+ **Task lifecycle:**
271
+
272
+ 1. Extension captures a project snapshot from Overleaf.
273
+ 2. Native host syncs the snapshot to a local mirror workspace.
274
+ 3. Codex runs against the workspace.
275
+ 4. Native host collects text changes and computes diffs/patches.
276
+ 5. Extension applies changes back to Overleaf with freshness verification.
277
+ 6. Mirror baseline is updated after successful writeback.
278
+
279
+ ## Extension ID
280
+
281
+ This repo ships a stable Chrome extension `key`, producing the deterministic id:
282
+
283
+ ```
284
+ illdpneeeopfffmiepaejglgmhpmdhdc
285
+ ```
286
+
287
+ The installer uses this id by default. If Chrome assigns a different id, reinstall the native host with the actual id.
288
+
289
+ macOS / Linux:
290
+
291
+ ```bash
292
+ cd ~/.codex-overleaf/source && npm run install:native -- --extension-id <your-chrome-extension-id>
293
+ ```
294
+
295
+ Windows PowerShell:
296
+
297
+ ```powershell
298
+ cd $env:LOCALAPPDATA\CodexOverleaf\source
299
+ npm run install:native -- --extension-id <your-chrome-extension-id>
300
+ ```
301
+
302
+ 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.
303
+
304
+ ## Local Data And Cleanup
305
+
306
+ Codex Overleaf Link does not use a hosted backend or default telemetry. Data is local to the Chrome profile and local native host. The static privacy policy is published from `docs/privacy-policy.html`.
307
+
308
+ | Area | Location | Contents |
309
+ |------|----------|----------|
310
+ | Browser IndexedDB | Extension database `codex-overleaf` | Sessions, turns, events, artifacts, and audit logs. |
311
+ | Browser extension storage | `chrome.storage.local` | Preferences, project settings, governance rules, selected skill ids, and panel state. |
312
+ | macOS/Linux source checkout | `~/.codex-overleaf/source` | Installer-managed source tree used by pinned updates and uninstall commands. |
313
+ | macOS/Linux native runtime | `~/.codex-overleaf/native-host-runtime` | Runtime copy loaded by Chrome Native Messaging. |
314
+ | macOS/Linux bridge | `~/.codex-overleaf/codex-overleaf-bridge` | Native Messaging launcher executable. |
315
+ | Windows source/runtime/bridge | `%LOCALAPPDATA%\CodexOverleaf` | `source`, `native-host-runtime`, `codex-overleaf-bridge.cmd`, and native debug log. |
316
+ | Project mirrors | `~/.codex-overleaf/projects` on macOS/Linux, `%USERPROFILE%\.codex-overleaf\projects` on Windows | Local mirror workspaces and mirror metadata for each Overleaf project. |
317
+ | 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. |
318
+ | Codex Overleaf skills | `~/.codex-overleaf/skills` on macOS/Linux, `%USERPROFILE%\.codex-overleaf\skills` on Windows | Project/plugin skills managed by the extension. |
319
+ | 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. |
320
+ | 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. |
321
+
322
+ Skill loading toggles default to enabled. In Project Settings:
323
+
324
+ - `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`.
325
+ - `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.
326
+
327
+ Native registration paths:
328
+
329
+ | Platform/browser | Registration path |
330
+ |------------------|-------------------|
331
+ | macOS Chrome | `~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.codex.overleaf.json` |
332
+ | Linux Chrome | `~/.config/google-chrome/NativeMessagingHosts/com.codex.overleaf.json` |
333
+ | Linux Chromium | `~/.config/chromium/NativeMessagingHosts/com.codex.overleaf.json` |
334
+ | Windows Chrome | `HKCU\Software\Google\Chrome\NativeMessagingHosts\com.codex.overleaf`, pointing to `%LOCALAPPDATA%\CodexOverleaf\native-host-runtime\com.codex.overleaf.json` |
335
+
336
+ Full uninstall and data deletion:
337
+
338
+ 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.
339
+ 2. Run the native uninstaller for the browser you registered. Use `--browser chromium` on Linux Chromium.
340
+ 3. Delete local native and mirror data if you want a clean machine:
341
+ - macOS/Linux: `rm -rf ~/.codex-overleaf ~/Codex\ Overleaf\ Link\ Extension`
342
+ - Windows PowerShell: `Remove-Item -Recurse -Force "$env:LOCALAPPDATA\CodexOverleaf", "$env:USERPROFILE\.codex-overleaf" -ErrorAction SilentlyContinue`
343
+
344
+ Composer attachments are turn-scoped Codex context. Limits are 8 attachments per run and 12 MiB per attachment. Attachments are staged under `.codex-overleaf-attachments` inside the mirror workspace and are ignored during writeback.
345
+
346
+ ## FAQ And Troubleshooting
347
+
348
+ **Native host missing or update required**
349
+
350
+ Run the pinned npm native-host installer, reload the extension in `chrome://extensions`, then refresh the Overleaf tab. This also fixes extension/native version mismatch and native protocol mismatch.
351
+
352
+ ```bash
353
+ npm exec --yes codex-overleaf-link@1.1.1 -- install-native
354
+ ```
355
+
356
+ If npm is unavailable, use the GitHub Release script fallback for your platform.
357
+
358
+ macOS/Linux:
359
+
360
+ ```bash
361
+ CODEX_OVERLEAF_REF=v1.1.1 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.1.1/install.sh)"
362
+ ```
363
+
364
+ Windows PowerShell:
365
+
366
+ ```powershell
367
+ iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.1.1/install.ps1 -OutFile install.ps1
368
+ $env:CODEX_OVERLEAF_REF='v1.1.1'
369
+ powershell -ExecutionPolicy Bypass -File install.ps1
370
+ ```
371
+
372
+ **The Windows popup or panel shows a Bash recovery command**
373
+
374
+ Use the PowerShell recovery command above on Windows. The Bash command is for macOS/Linux installers.
375
+
376
+ **Codex CLI not found**
377
+
378
+ 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.
379
+
380
+ **Extension id mismatch**
381
+
382
+ Copy the id shown in `chrome://extensions` and reinstall the native host with that id:
383
+
384
+ ```bash
385
+ cd ~/.codex-overleaf/source && npm run install:native -- --extension-id <your-chrome-extension-id>
386
+ ```
387
+
388
+ ```powershell
389
+ cd $env:LOCALAPPDATA\CodexOverleaf\source
390
+ npm run install:native -- --extension-id <your-chrome-extension-id>
391
+ ```
392
+
393
+ **Linux Chromium does not connect**
394
+
395
+ Reinstall the native host with `--browser chromium`, reload the unpacked extension, and refresh Overleaf. The Chromium manifest path is different from Chrome's path.
396
+
397
+ **Diagnostics and logs**
398
+
399
+ 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.
400
+
401
+ **Stale collaborator conflict**
402
+
403
+ 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.
404
+
405
+ **Governance blocked write**
406
+
407
+ 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.
408
+
409
+ **Sensitive preflight warning**
410
+
411
+ 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.
412
+
413
+ **Attachments and binary limits**
414
+
415
+ 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.
416
+
417
+ ## Compatibility Matrix
418
+
419
+ Use this matrix for release-candidate signoff and compatibility reports. Record exact versions from the machine under test before publishing release guidance.
420
+
421
+ | Field | macOS Chrome | Windows Chrome | Linux Chrome | Linux Chromium |
422
+ |-------|--------------|----------------|--------------|----------------|
423
+ | 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`. |
424
+ | Browser/channel/version | Google Chrome channel and version. | Google Chrome channel and version. | Google Chrome channel and version. | Chromium channel/package and version. |
425
+ | 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`. |
426
+ | 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`. |
427
+ | Installer/update command | `npm exec --yes codex-overleaf-link@1.1.1 -- install-native` | `npm exec --yes codex-overleaf-link@1.1.1 -- install-native` | `npm exec --yes codex-overleaf-link@1.1.1 -- install-native` | `npm exec --yes codex-overleaf-link@1.1.1 -- install-native --browser chromium` |
428
+ | Uninstall command | `npm exec --yes codex-overleaf-link@1.1.1 -- uninstall-native` | `npm exec --yes codex-overleaf-link@1.1.1 -- uninstall-native` | `npm exec --yes codex-overleaf-link@1.1.1 -- uninstall-native` | `npm exec --yes codex-overleaf-link@1.1.1 -- uninstall-native --browser chromium` |
429
+ | 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` |
430
+ | 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`. |
431
+ | 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. |
432
+ | 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. |
433
+ | 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. |
434
+ | 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. |
435
+
436
+ ## Development
437
+
438
+ ```bash
439
+ npm test # Node.js built-in test runner, zero dependencies
440
+ npm run check:architecture # enforce v1.0 final architecture budgets
441
+ npm run benchmark:large # run the synthetic large-project regression gate
442
+ npm run bridge # run the native host directly for protocol work
443
+ npm run install:native # reinstall native host after changing native-host/src or extension/src/shared
444
+ ```
445
+
446
+ ## Contributing
447
+
448
+ Contributions are welcome. Please open an issue before submitting large changes so we can discuss the approach.
449
+
450
+ 1. Fork the repository.
451
+ 2. Create a feature branch.
452
+ 3. Run `npm test` and ensure all tests pass.
453
+ 4. Submit a pull request with a clear description.
454
+
455
+ ## License
456
+
457
+ [MIT](LICENSE)