codex-overleaf-link 1.2.6 → 1.3.0
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.
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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-1.
|
|
6
|
+
<img src="https://img.shields.io/badge/version-1.3.0-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">
|
|
@@ -34,10 +34,10 @@ The recommended release path is npm-first for the native host, plus Chrome's req
|
|
|
34
34
|
1. Install or update the native host with the pinned npm package:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
npm exec --yes codex-overleaf-link@1.
|
|
37
|
+
npm exec --yes codex-overleaf-link@1.3.0 -- install-native
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
2. Download `codex-overleaf-link-extension-v1.
|
|
40
|
+
2. Download `codex-overleaf-link-extension-v1.3.0.zip` from the [v1.3.0 GitHub Release](https://github.com/Ghqqqq/codex-overleaf-link/releases/tag/v1.3.0), then unzip it to a stable local folder.
|
|
41
41
|
|
|
42
42
|
3. Open `chrome://extensions`, enable **Developer mode**, click **Load unpacked**, and select the unzipped extension folder.
|
|
43
43
|
|
|
@@ -48,14 +48,14 @@ If you modify the extension key or load a custom build that gets a different id,
|
|
|
48
48
|
Source installer fallback for macOS / Linux, mainly for development or source checkout installs:
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
CODEX_OVERLEAF_REF=v1.
|
|
51
|
+
CODEX_OVERLEAF_REF=v1.3.0 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.3.0/install.sh)"
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Source installer fallback for Windows from PowerShell:
|
|
55
55
|
|
|
56
56
|
```powershell
|
|
57
|
-
iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.
|
|
58
|
-
$env:CODEX_OVERLEAF_REF='v1.
|
|
57
|
+
iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.3.0/install.ps1 -OutFile install.ps1
|
|
58
|
+
$env:CODEX_OVERLEAF_REF='v1.3.0'
|
|
59
59
|
powershell -ExecutionPolicy Bypass -File install.ps1
|
|
60
60
|
```
|
|
61
61
|
|
|
@@ -66,19 +66,19 @@ npm installs, updates, uninstalls, and diagnoses the native host only. npm does
|
|
|
66
66
|
Install or update the native host for the official release extension id:
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
|
-
npm exec --yes codex-overleaf-link@1.
|
|
69
|
+
npm exec --yes codex-overleaf-link@1.3.0 -- install-native
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
Diagnose the registered native host:
|
|
73
73
|
|
|
74
74
|
```bash
|
|
75
|
-
npm exec --yes codex-overleaf-link@1.
|
|
75
|
+
npm exec --yes codex-overleaf-link@1.3.0 -- doctor
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
Uninstall the native host:
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
|
-
npm exec --yes codex-overleaf-link@1.
|
|
81
|
+
npm exec --yes codex-overleaf-link@1.3.0 -- uninstall-native
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
Use `--extension-id <chrome-extension-id>` only for a custom/dev unpacked extension id that differs from the official bundled id.
|
|
@@ -116,10 +116,10 @@ If Chrome assigns a different extension id, rerun `npm run install:native -- --e
|
|
|
116
116
|
<details>
|
|
117
117
|
<summary><strong>Update</strong></summary>
|
|
118
118
|
|
|
119
|
-
For a deterministic v1.
|
|
119
|
+
For a deterministic v1.3.0 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**.
|
|
120
120
|
|
|
121
121
|
```bash
|
|
122
|
-
npm exec --yes codex-overleaf-link@1.
|
|
122
|
+
npm exec --yes codex-overleaf-link@1.3.0 -- install-native
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
If npm is unavailable, use the GitHub Release script fallback for your platform.
|
|
@@ -127,14 +127,14 @@ If npm is unavailable, use the GitHub Release script fallback for your platform.
|
|
|
127
127
|
macOS / Linux:
|
|
128
128
|
|
|
129
129
|
```bash
|
|
130
|
-
CODEX_OVERLEAF_REF=v1.
|
|
130
|
+
CODEX_OVERLEAF_REF=v1.3.0 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.3.0/install.sh)"
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
Windows PowerShell:
|
|
134
134
|
|
|
135
135
|
```powershell
|
|
136
|
-
iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.
|
|
137
|
-
$env:CODEX_OVERLEAF_REF='v1.
|
|
136
|
+
iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.3.0/install.ps1 -OutFile install.ps1
|
|
137
|
+
$env:CODEX_OVERLEAF_REF='v1.3.0'
|
|
138
138
|
powershell -ExecutionPolicy Bypass -File install.ps1
|
|
139
139
|
```
|
|
140
140
|
|
|
@@ -144,13 +144,13 @@ Then reload the extension in `chrome://extensions` and refresh the Overleaf page
|
|
|
144
144
|
|
|
145
145
|
## GitHub Release Artifacts
|
|
146
146
|
|
|
147
|
-
The v1.
|
|
147
|
+
The v1.3.0 GitHub Release contains:
|
|
148
148
|
|
|
149
|
-
- `codex-overleaf-link-extension-v1.
|
|
150
|
-
- `codex-overleaf-native-host-v1.
|
|
151
|
-
- `codex-overleaf-link-1.
|
|
152
|
-
- `install.sh`: release-pinned macOS / Linux installer that defaults to `v1.
|
|
153
|
-
- `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v1.
|
|
149
|
+
- `codex-overleaf-link-extension-v1.3.0.zip`: loadable Chrome extension package for manual unpacked installation.
|
|
150
|
+
- `codex-overleaf-native-host-v1.3.0.tar.gz`: native host runtime files used by the installer and release verification.
|
|
151
|
+
- `codex-overleaf-link-1.3.0.tgz`: npm native host CLI package for pinned install, doctor, and uninstall flows.
|
|
152
|
+
- `install.sh`: release-pinned macOS / Linux installer that defaults to `v1.3.0` when run directly from the release artifact.
|
|
153
|
+
- `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v1.3.0` when run directly from the release artifact.
|
|
154
154
|
- `uninstall-native-host.mjs`: native host uninstaller that removes the Chrome Native Messaging manifest, bridge executable, and runtime copy.
|
|
155
155
|
- `nativeHostPlatform.js`, `manifest.js`, `runtimeInstaller.js`: helper files required by the loose uninstaller asset.
|
|
156
156
|
- `SHA256SUMS` and `release-manifest.json`: checksum and artifact metadata for release verification.
|
|
@@ -161,13 +161,13 @@ The v1.2.6 GitHub Release contains:
|
|
|
161
161
|
macOS / Linux:
|
|
162
162
|
|
|
163
163
|
```bash
|
|
164
|
-
npm exec --yes codex-overleaf-link@1.
|
|
164
|
+
npm exec --yes codex-overleaf-link@1.3.0 -- uninstall-native
|
|
165
165
|
```
|
|
166
166
|
|
|
167
167
|
Windows PowerShell:
|
|
168
168
|
|
|
169
169
|
```powershell
|
|
170
|
-
npm exec --yes codex-overleaf-link@1.
|
|
170
|
+
npm exec --yes codex-overleaf-link@1.3.0 -- uninstall-native
|
|
171
171
|
```
|
|
172
172
|
|
|
173
173
|
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.
|
|
@@ -202,13 +202,13 @@ The uninstaller removes the Native Messaging registration, bridge executable, an
|
|
|
202
202
|
Linux Chromium install or update:
|
|
203
203
|
|
|
204
204
|
```bash
|
|
205
|
-
CODEX_OVERLEAF_REF=v1.
|
|
205
|
+
CODEX_OVERLEAF_REF=v1.3.0 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.3.0/install.sh)" -- --browser chromium
|
|
206
206
|
```
|
|
207
207
|
|
|
208
208
|
Linux Chromium uninstall:
|
|
209
209
|
|
|
210
210
|
```bash
|
|
211
|
-
npm exec --yes codex-overleaf-link@1.
|
|
211
|
+
npm exec --yes codex-overleaf-link@1.3.0 -- uninstall-native --browser chromium
|
|
212
212
|
```
|
|
213
213
|
|
|
214
214
|
## Features
|
|
@@ -344,7 +344,7 @@ Composer attachments are turn-scoped Codex context. Limits are 8 attachments per
|
|
|
344
344
|
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.
|
|
345
345
|
|
|
346
346
|
```bash
|
|
347
|
-
npm exec --yes codex-overleaf-link@1.
|
|
347
|
+
npm exec --yes codex-overleaf-link@1.3.0 -- install-native
|
|
348
348
|
```
|
|
349
349
|
|
|
350
350
|
If npm is unavailable, use the GitHub Release script fallback for your platform.
|
|
@@ -352,14 +352,14 @@ If npm is unavailable, use the GitHub Release script fallback for your platform.
|
|
|
352
352
|
macOS/Linux:
|
|
353
353
|
|
|
354
354
|
```bash
|
|
355
|
-
CODEX_OVERLEAF_REF=v1.
|
|
355
|
+
CODEX_OVERLEAF_REF=v1.3.0 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.3.0/install.sh)"
|
|
356
356
|
```
|
|
357
357
|
|
|
358
358
|
Windows PowerShell:
|
|
359
359
|
|
|
360
360
|
```powershell
|
|
361
|
-
iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.
|
|
362
|
-
$env:CODEX_OVERLEAF_REF='v1.
|
|
361
|
+
iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.3.0/install.ps1 -OutFile install.ps1
|
|
362
|
+
$env:CODEX_OVERLEAF_REF='v1.3.0'
|
|
363
363
|
powershell -ExecutionPolicy Bypass -File install.ps1
|
|
364
364
|
```
|
|
365
365
|
|
|
@@ -418,8 +418,8 @@ Use this matrix for release-candidate signoff and compatibility reports. Record
|
|
|
418
418
|
| Browser/channel/version | Google Chrome channel and version. | Google Chrome channel and version. | Google Chrome channel and version. | Chromium channel/package and version. |
|
|
419
419
|
| 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`. |
|
|
420
420
|
| 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`. |
|
|
421
|
-
| Installer/update command | `npm exec --yes codex-overleaf-link@1.
|
|
422
|
-
| Uninstall command | `npm exec --yes codex-overleaf-link@1.
|
|
421
|
+
| Installer/update command | `npm exec --yes codex-overleaf-link@1.3.0 -- install-native` | `npm exec --yes codex-overleaf-link@1.3.0 -- install-native` | `npm exec --yes codex-overleaf-link@1.3.0 -- install-native` | `npm exec --yes codex-overleaf-link@1.3.0 -- install-native --browser chromium` |
|
|
422
|
+
| Uninstall command | `npm exec --yes codex-overleaf-link@1.3.0 -- uninstall-native` | `npm exec --yes codex-overleaf-link@1.3.0 -- uninstall-native` | `npm exec --yes codex-overleaf-link@1.3.0 -- uninstall-native` | `npm exec --yes codex-overleaf-link@1.3.0 -- uninstall-native --browser chromium` |
|
|
423
423
|
| 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` |
|
|
424
424
|
| 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`. |
|
|
425
425
|
| 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. |
|
|
@@ -1046,56 +1046,57 @@
|
|
|
1046
1046
|
const key = result.reasonKey || '';
|
|
1047
1047
|
const code = result.code || '';
|
|
1048
1048
|
const filePath = result.reasonParams?.filePath || operation?.path || operation?.from || operation?.to || '';
|
|
1049
|
+
const withDebug = reason => appendSkippedReasonDebug(reason, result);
|
|
1049
1050
|
if (key === 'missingBaseFile' || code === 'missing_base_file') {
|
|
1050
1051
|
const target = filePath || textFor(locale, '这个文件', 'this file');
|
|
1051
|
-
return textFor(
|
|
1052
|
+
return withDebug(textFor(
|
|
1052
1053
|
locale,
|
|
1053
1054
|
`${target} 在任务开始时没有被 Codex 读到。Codex 没有覆盖它;请刷新项目内容后重试。`,
|
|
1054
1055
|
`${target} was not read when the task started. Codex did not overwrite it; refresh the project content and retry.`
|
|
1055
|
-
);
|
|
1056
|
+
));
|
|
1056
1057
|
}
|
|
1057
1058
|
if (key === 'staleSnapshot' || code === 'stale_snapshot') {
|
|
1058
1059
|
const target = filePath || textFor(locale, '这个文件', 'this file');
|
|
1059
|
-
return textFor(
|
|
1060
|
+
return withDebug(textFor(
|
|
1060
1061
|
locale,
|
|
1061
1062
|
`${target} 在任务执行期间被你或协作者改过,Codex 没有覆盖它。请查看差异后重试。`,
|
|
1062
1063
|
`${target} changed while Codex was working, so Codex did not overwrite it. Review the diff and retry.`
|
|
1063
|
-
);
|
|
1064
|
+
));
|
|
1064
1065
|
}
|
|
1065
1066
|
if (key === 'stalePatchLocation') {
|
|
1066
|
-
return textFor(
|
|
1067
|
+
return withDebug(textFor(
|
|
1067
1068
|
locale,
|
|
1068
1069
|
'Codex 要修改的位置已经无法和当前 Overleaf 内容对齐,所以没有写入。请重新运行任务。',
|
|
1069
1070
|
'The edit location no longer matches the current Overleaf content, so nothing was written. Rerun the task.'
|
|
1070
|
-
);
|
|
1071
|
+
));
|
|
1071
1072
|
}
|
|
1072
1073
|
if (key === 'stalePatchConflict' || code === 'stale_patch_range') {
|
|
1073
|
-
return textFor(
|
|
1074
|
+
return withDebug(textFor(
|
|
1074
1075
|
locale,
|
|
1075
1076
|
'Codex 要修改的具体位置已经被你或协作者改过,所以没有覆盖它。请查看差异后重试。',
|
|
1076
1077
|
'The exact edit location was changed by you or a collaborator, so Codex did not overwrite it. Review the diff and retry.'
|
|
1077
|
-
);
|
|
1078
|
+
));
|
|
1078
1079
|
}
|
|
1079
1080
|
if (code === 'stale_patch') {
|
|
1080
|
-
return textFor(
|
|
1081
|
+
return withDebug(textFor(
|
|
1081
1082
|
locale,
|
|
1082
1083
|
'这处内容已经和 Codex 读取时不同,所以没有写入。请重新运行,让 Codex 先读取你的最新 Overleaf 内容。',
|
|
1083
1084
|
'This exact text changed since Codex read it, so nothing was written. Rerun after Codex reads the latest Overleaf content.'
|
|
1084
|
-
);
|
|
1085
|
+
));
|
|
1085
1086
|
}
|
|
1086
1087
|
if (code === 'invalid_patch') {
|
|
1087
|
-
return textFor(
|
|
1088
|
+
return withDebug(textFor(
|
|
1088
1089
|
locale,
|
|
1089
1090
|
'Codex 生成的局部写入范围无效,所以没有写入。',
|
|
1090
1091
|
'Codex produced an invalid local edit range, so nothing was written.'
|
|
1091
|
-
);
|
|
1092
|
+
));
|
|
1092
1093
|
}
|
|
1093
1094
|
if (code === 'write_verification_failed') {
|
|
1094
|
-
return textFor(
|
|
1095
|
+
return withDebug(textFor(
|
|
1095
1096
|
locale,
|
|
1096
1097
|
'写入后读回内容和 Codex 预期不一致,已停止把这次操作标记为成功。请刷新 Overleaf 后重试。',
|
|
1097
1098
|
'After writing, the editor content did not match Codex\'s expected result, so the write was not marked successful. Reload Overleaf and retry.'
|
|
1098
|
-
);
|
|
1099
|
+
));
|
|
1099
1100
|
}
|
|
1100
1101
|
if (code === 'file_tree_verification_failed') {
|
|
1101
1102
|
return textFor(
|
|
@@ -1120,7 +1121,42 @@
|
|
|
1120
1121
|
`${target} was created by you or a collaborator while Codex was working, so Codex did not overwrite it. Review the diff and retry.`
|
|
1121
1122
|
);
|
|
1122
1123
|
}
|
|
1123
|
-
return localizeVisibleReason(result.reason || result.error || result.code || textFor(locale, '未知原因', 'unknown reason'), locale);
|
|
1124
|
+
return withDebug(localizeVisibleReason(result.reason || result.error || result.code || textFor(locale, '未知原因', 'unknown reason'), locale));
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
function appendSkippedReasonDebug(reason, result = {}) {
|
|
1128
|
+
const debug = result.debug || result.diagnostics;
|
|
1129
|
+
const text = formatSkippedReasonDebug(debug);
|
|
1130
|
+
return text ? `${reason} [debug: ${text}]` : reason;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
function formatSkippedReasonDebug(debug) {
|
|
1134
|
+
if (!debug || typeof debug !== 'object') {
|
|
1135
|
+
return '';
|
|
1136
|
+
}
|
|
1137
|
+
const parts = [];
|
|
1138
|
+
const add = (key, value) => {
|
|
1139
|
+
if (value === undefined || value === null || value === '') {
|
|
1140
|
+
return;
|
|
1141
|
+
}
|
|
1142
|
+
parts.push(`${key}=${String(value)}`);
|
|
1143
|
+
};
|
|
1144
|
+
add('stage', debug.stage);
|
|
1145
|
+
add('rev', debug.revision);
|
|
1146
|
+
add('op', debug.operationPath);
|
|
1147
|
+
add('active', debug.activePath);
|
|
1148
|
+
add('initial', debug.initialActivePath);
|
|
1149
|
+
add('last', debug.lastActivePath);
|
|
1150
|
+
add('currentLen', debug.current?.length);
|
|
1151
|
+
add('currentNorm', debug.current?.normalizedLength);
|
|
1152
|
+
add('currentHash', debug.current?.hash);
|
|
1153
|
+
add('baseKnown', debug.baseKnown);
|
|
1154
|
+
add('baseLen', debug.base?.length);
|
|
1155
|
+
add('baseNorm', debug.base?.normalizedLength);
|
|
1156
|
+
add('baseHash', debug.base?.hash);
|
|
1157
|
+
add('elapsed', debug.elapsedMs);
|
|
1158
|
+
add('opened', debug.openedMethod);
|
|
1159
|
+
return parts.join(', ');
|
|
1124
1160
|
}
|
|
1125
1161
|
|
|
1126
1162
|
function localizeVisibleReason(reason, locale = 'zh') {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
const MIN_NATIVE_VERSION = '1.0.0';
|
|
13
13
|
const MIN_COMPATIBLE_NATIVE_VERSION = '1.0.0';
|
|
14
14
|
const MIN_COMPATIBLE_EXTENSION_VERSION = '1.0.0';
|
|
15
|
-
const BUILD_TARGET_VERSION = '1.
|
|
15
|
+
const BUILD_TARGET_VERSION = '1.3.0';
|
|
16
16
|
const DEFAULT_CHROME_EXTENSION_ID = 'illdpneeeopfffmiepaejglgmhpmdhdc';
|
|
17
17
|
const REQUIRED_CAPABILITIES = Object.freeze([
|
|
18
18
|
'bridgePing',
|
|
@@ -41,8 +41,20 @@
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const baseContent = baseFileLookup.get(filePath);
|
|
44
|
+
if (!baseContent || baseContent.trim().length === 0) {
|
|
45
|
+
if (typeof console !== 'undefined') {
|
|
46
|
+
console.warn('[codex-overleaf] staleGuard: base empty for', filePath, '→ skipping check');
|
|
47
|
+
}
|
|
48
|
+
return { ok: true };
|
|
49
|
+
}
|
|
44
50
|
const current = normalizeText(currentContent);
|
|
45
51
|
if (current !== baseContent) {
|
|
52
|
+
if (typeof console !== 'undefined') {
|
|
53
|
+
console.warn('[codex-overleaf] staleGuard: STALE', filePath,
|
|
54
|
+
'base.length:', baseContent.length, 'current.length:', current.length,
|
|
55
|
+
'base[0..80]:', JSON.stringify(baseContent.slice(0, 80)),
|
|
56
|
+
'current[0..80]:', JSON.stringify(current.slice(0, 80)));
|
|
57
|
+
}
|
|
46
58
|
const patchRangeFreshness = checkPatchRangeFreshness(operation, current);
|
|
47
59
|
if (patchRangeFreshness) {
|
|
48
60
|
return patchRangeFreshness;
|