codex-overleaf-link 2.1.3 → 2.1.4
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 +23 -23
- package/extension/bootstrap/manifest.template.json +1 -1
- package/extension/src/content/contentRuntime.js +2 -2
- package/extension/src/content/modelPicker.js +5 -1
- package/extension/src/content/providerSettingsCoordinator.js +5 -1
- package/extension/src/content/runController.js +2 -1
- package/extension/src/content/writebackController.js +3 -3
- package/extension/src/shared/agentTranscript.js +23 -23
- package/extension/src/shared/compatibility.js +1 -1
- package/extension/src/shared/sessionState.js +3 -0
- package/native-host/src/taskRunnerRuntime.js +24 -17
- package/package.json +1 -1
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-2.1.
|
|
6
|
+
<img src="https://img.shields.io/badge/version-2.1.4-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">
|
|
@@ -38,14 +38,14 @@ One command installs the managed native host **and** managed extension runtime.
|
|
|
38
38
|
macOS / Linux:
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
CODEX_OVERLEAF_REF=v2.1.
|
|
41
|
+
CODEX_OVERLEAF_REF=v2.1.4 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v2.1.4/install.sh)"
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
Windows PowerShell:
|
|
45
45
|
|
|
46
46
|
```powershell
|
|
47
|
-
iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v2.1.
|
|
48
|
-
$env:CODEX_OVERLEAF_REF='v2.1.
|
|
47
|
+
iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v2.1.4/install.ps1 -OutFile install.ps1
|
|
48
|
+
$env:CODEX_OVERLEAF_REF='v2.1.4'
|
|
49
49
|
powershell -ExecutionPolicy Bypass -File install.ps1
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -56,7 +56,7 @@ Then, in the `chrome://extensions` tab the script opened: enable **Developer mod
|
|
|
56
56
|
`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
57
|
|
|
58
58
|
```bash
|
|
59
|
-
npm exec --yes codex-overleaf-link@2.1.
|
|
59
|
+
npm exec --yes codex-overleaf-link@2.1.4 -- install-managed
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
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.
|
|
@@ -86,9 +86,9 @@ npm installs, updates, and uninstalls the coordinated managed extension/native p
|
|
|
86
86
|
|
|
87
87
|
| Action | Command |
|
|
88
88
|
|--------|---------|
|
|
89
|
-
| Install / update | `npm exec --yes codex-overleaf-link@2.1.
|
|
90
|
-
| Diagnose | `npm exec --yes codex-overleaf-link@2.1.
|
|
91
|
-
| Uninstall | `npm exec --yes codex-overleaf-link@2.1.
|
|
89
|
+
| Install / update | `npm exec --yes codex-overleaf-link@2.1.4 -- install-managed` |
|
|
90
|
+
| Diagnose | `npm exec --yes codex-overleaf-link@2.1.4 -- doctor` |
|
|
91
|
+
| Uninstall | `npm exec --yes codex-overleaf-link@2.1.4 -- uninstall-managed` |
|
|
92
92
|
|
|
93
93
|
Use `--extension-id <chrome-extension-id>` only for a custom/dev unpacked extension id that differs from the official bundled id.
|
|
94
94
|
|
|
@@ -98,13 +98,13 @@ Managed installations discover signed stable updates automatically and apply the
|
|
|
98
98
|
|
|
99
99
|
## GitHub Release Artifacts
|
|
100
100
|
|
|
101
|
-
The v2.1.
|
|
101
|
+
The v2.1.4 GitHub Release contains:
|
|
102
102
|
|
|
103
|
-
- `codex-overleaf-link-extension-v2.1.
|
|
104
|
-
- `codex-overleaf-native-host-v2.1.
|
|
105
|
-
- `codex-overleaf-link-2.1.
|
|
106
|
-
- `install.sh`: release-pinned macOS / Linux installer that defaults to `v2.1.
|
|
107
|
-
- `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v2.1.
|
|
103
|
+
- `codex-overleaf-link-extension-v2.1.4.zip`: loadable Chrome extension package for manual unpacked installation.
|
|
104
|
+
- `codex-overleaf-native-host-v2.1.4.tar.gz`: native host runtime files used by the installer and release verification.
|
|
105
|
+
- `codex-overleaf-link-2.1.4.tgz`: npm native host CLI package for pinned install, doctor, and uninstall flows.
|
|
106
|
+
- `install.sh`: release-pinned macOS / Linux installer that defaults to `v2.1.4` when run directly from the release artifact.
|
|
107
|
+
- `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v2.1.4` when run directly from the release artifact.
|
|
108
108
|
- `uninstall-native-host.mjs`: native host uninstaller that removes the Chrome Native Messaging manifest, bridge executable, and runtime copy.
|
|
109
109
|
- `nativeHostPlatform.js`, `manifest.js`, `runtimeInstaller.js`: helper files required by the loose uninstaller asset.
|
|
110
110
|
- `SHA256SUMS` and `release-manifest.json`: checksum and artifact metadata for release verification.
|
|
@@ -115,7 +115,7 @@ The v2.1.3 GitHub Release contains:
|
|
|
115
115
|
Remove the native host (use `--browser chromium` on Linux Chromium):
|
|
116
116
|
|
|
117
117
|
```bash
|
|
118
|
-
npm exec --yes codex-overleaf-link@2.1.
|
|
118
|
+
npm exec --yes codex-overleaf-link@2.1.4 -- uninstall-managed
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
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.
|
|
@@ -150,13 +150,13 @@ Then remove the extension from `chrome://extensions`. To delete local data: on m
|
|
|
150
150
|
Linux Chromium install or update:
|
|
151
151
|
|
|
152
152
|
```bash
|
|
153
|
-
CODEX_OVERLEAF_REF=v2.1.
|
|
153
|
+
CODEX_OVERLEAF_REF=v2.1.4 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v2.1.4/install.sh)" -- --browser chromium
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
Linux Chromium uninstall:
|
|
157
157
|
|
|
158
158
|
```bash
|
|
159
|
-
npm exec --yes codex-overleaf-link@2.1.
|
|
159
|
+
npm exec --yes codex-overleaf-link@2.1.4 -- uninstall-managed --browser chromium
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
## Features
|
|
@@ -292,7 +292,7 @@ Composer attachments are turn-scoped Codex context. Limits are 8 attachments per
|
|
|
292
292
|
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.
|
|
293
293
|
|
|
294
294
|
```bash
|
|
295
|
-
npm exec --yes codex-overleaf-link@2.1.
|
|
295
|
+
npm exec --yes codex-overleaf-link@2.1.4 -- install-managed
|
|
296
296
|
```
|
|
297
297
|
|
|
298
298
|
**The Windows popup or panel shows a Bash recovery command**
|
|
@@ -341,8 +341,8 @@ Use this matrix for release-candidate signoff and compatibility reports. Record
|
|
|
341
341
|
| Browser/channel/version | Google Chrome channel and version. | Google Chrome channel and version. | Google Chrome channel and version. | Chromium channel/package and version. |
|
|
342
342
|
| 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`. |
|
|
343
343
|
| 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`. |
|
|
344
|
-
| Installer/update command | `npm exec --yes codex-overleaf-link@2.1.
|
|
345
|
-
| Uninstall command | `npm exec --yes codex-overleaf-link@2.1.
|
|
344
|
+
| Installer/update command | `npm exec --yes codex-overleaf-link@2.1.4 -- install-managed` | `npm exec --yes codex-overleaf-link@2.1.4 -- install-managed` | `npm exec --yes codex-overleaf-link@2.1.4 -- install-managed` | `npm exec --yes codex-overleaf-link@2.1.4 -- install-managed --browser chromium` |
|
|
345
|
+
| Uninstall command | `npm exec --yes codex-overleaf-link@2.1.4 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@2.1.4 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@2.1.4 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@2.1.4 -- uninstall-managed --browser chromium` |
|
|
346
346
|
| 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` |
|
|
347
347
|
| 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`. |
|
|
348
348
|
| 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. |
|
|
@@ -378,7 +378,7 @@ Contributions are welcome. Please open an issue before submitting large changes
|
|
|
378
378
|
The recommended v1.9 installation owns one stable unpacked-extension directory and a versioned native-host directory:
|
|
379
379
|
|
|
380
380
|
```bash
|
|
381
|
-
npm exec --yes codex-overleaf-link@2.1.
|
|
381
|
+
npm exec --yes codex-overleaf-link@2.1.4 -- install-managed
|
|
382
382
|
```
|
|
383
383
|
|
|
384
384
|
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.
|
|
@@ -388,11 +388,11 @@ The stable updater ignores drafts and prereleases, performs no telemetry, and ca
|
|
|
388
388
|
The legacy native-only installer remains available for source or unmanaged extension directories:
|
|
389
389
|
|
|
390
390
|
```bash
|
|
391
|
-
npm exec --yes codex-overleaf-link@2.1.
|
|
391
|
+
npm exec --yes codex-overleaf-link@2.1.4 -- install-native
|
|
392
392
|
```
|
|
393
393
|
|
|
394
394
|
Legacy native-only installations can be removed with:
|
|
395
395
|
|
|
396
396
|
```bash
|
|
397
|
-
npm exec --yes codex-overleaf-link@2.1.
|
|
397
|
+
npm exec --yes codex-overleaf-link@2.1.4 -- uninstall-native
|
|
398
398
|
```
|
|
@@ -604,7 +604,7 @@
|
|
|
604
604
|
window,
|
|
605
605
|
getSettingsPanelInstance: () => settingsPanelInstance,
|
|
606
606
|
getSelectedModel: () => state?.model || '', getSelectedProviderId: () => state?.providerId || 'builtin',
|
|
607
|
-
setSelectedProviderId: providerId => { state = updateActiveSession(state, { providerId: providerId || 'builtin' }); },
|
|
607
|
+
setSelectedProviderId: (providerId, model) => { state = updateActiveSession(state, { providerId: providerId || 'builtin', ...(model !== undefined ? { model } : {}) }); const modelSelect = panel?.querySelector('[data-model]'); if (model !== undefined && modelSelect) modelSelect.value = ''; },
|
|
608
608
|
refreshModelOptions: loadModelOptions, persistInputs: persistPanelInputs
|
|
609
609
|
});
|
|
610
610
|
// v1.8.1 D3: the dashboard was a one-shot render — another tab finishing a
|
|
@@ -6313,7 +6313,7 @@
|
|
|
6313
6313
|
saveStateSoon();
|
|
6314
6314
|
return;
|
|
6315
6315
|
}
|
|
6316
|
-
renderReasoningOptions(getRenderedModelEntries());
|
|
6316
|
+
if (event?.target?.matches?.('[data-speed]')) state = updateActiveSession(state, { speedTier: readSelectedSpeedInput() }); renderReasoningOptions(getRenderedModelEntries());
|
|
6317
6317
|
renderSpeedOptions(getRenderedModelEntries());
|
|
6318
6318
|
readPanelInputs();
|
|
6319
6319
|
renderModelConfigChoices();
|
|
@@ -83,20 +83,24 @@
|
|
|
83
83
|
const modelSelect = getPanel()?.querySelector('[data-model]');
|
|
84
84
|
const reasoningSelect = getPanel()?.querySelector('[data-reasoning]');
|
|
85
85
|
const speedSelect = getPanel()?.querySelector('[data-speed]');
|
|
86
|
+
let changedInput = null;
|
|
86
87
|
|
|
87
88
|
if (choice.dataset.reasoningChoice && reasoningSelect) {
|
|
88
89
|
reasoningSelect.value = choice.dataset.reasoningChoice;
|
|
90
|
+
changedInput = reasoningSelect;
|
|
89
91
|
} else if (choice.dataset.modelChoice && modelSelect) {
|
|
90
92
|
modelSelect.value = choice.dataset.modelChoice;
|
|
93
|
+
changedInput = modelSelect;
|
|
91
94
|
renderReasoningOptions(getRenderedModelEntries());
|
|
92
95
|
renderSpeedOptions(getRenderedModelEntries());
|
|
93
96
|
} else if (choice.dataset.speedChoice && speedSelect) {
|
|
94
97
|
speedSelect.value = choice.dataset.speedChoice;
|
|
98
|
+
changedInput = speedSelect;
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
renderModelConfigChoices();
|
|
98
102
|
updateModelDisplay();
|
|
99
|
-
await persistPanelInputs();
|
|
103
|
+
await persistPanelInputs(changedInput ? { type: 'change', target: changedInput } : undefined);
|
|
100
104
|
}
|
|
101
105
|
async function loadModelOptions(providerSelection) {
|
|
102
106
|
const generation = ++modelLoadGeneration;
|
|
@@ -111,7 +111,11 @@
|
|
|
111
111
|
: previousProviderId;
|
|
112
112
|
const sessionProviderChanged = requestedProviderId !== previousProviderId;
|
|
113
113
|
if (sessionProviderChanged) {
|
|
114
|
-
|
|
114
|
+
const requestedProvider = window.CodexOverleafProviderProfiles.getProviderById(catalog, requestedProviderId);
|
|
115
|
+
const preferredModelId = requestedProvider?.kind === 'custom'
|
|
116
|
+
? requestedProvider.defaultModelId || requestedProvider.models?.[0]?.id || ''
|
|
117
|
+
: '';
|
|
118
|
+
instance.setSelectedProviderId(requestedProviderId, preferredModelId);
|
|
115
119
|
}
|
|
116
120
|
const changedProviderIds = Array.isArray(change.changedProviderIds) ? change.changedProviderIds : [];
|
|
117
121
|
if (!change.forceSessionRefresh && !sessionProviderChanged && !changedProviderIds.includes(requestedProviderId)) {
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
model: state.model,
|
|
50
50
|
reasoningEffort: state.reasoningEffort,
|
|
51
51
|
speedTier: state.speedTier,
|
|
52
|
+
locale: state.locale === 'zh' ? 'zh' : 'en',
|
|
52
53
|
session: state.session,
|
|
53
54
|
threadId: codexThreadId || undefined,
|
|
54
55
|
customInstructions: normalizedCustomInstructions || undefined,
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
return params;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
function buildSessionHistoryResult({ assistantMessage = '', syncOutcome = {}, syncChanges = [], locale = '
|
|
74
|
+
function buildSessionHistoryResult({ assistantMessage = '', syncOutcome = {}, syncChanges = [], locale = 'en' } = {}) {
|
|
74
75
|
const parts = [];
|
|
75
76
|
const finalAnswer = truncateSessionHistoryText(assistantMessage, 1600);
|
|
76
77
|
if (finalAnswer) {
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
function formatUnsupportedLocalChangeSummary(changes = [], locale = '
|
|
196
|
+
function formatUnsupportedLocalChangeSummary(changes = [], locale = 'en') {
|
|
197
197
|
if (!changes.length) {
|
|
198
198
|
return '';
|
|
199
199
|
}
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
return lines.join('\n');
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
function formatUnsupportedLocalChangeReason(changeOrReason, locale = '
|
|
221
|
+
function formatUnsupportedLocalChangeReason(changeOrReason, locale = 'en') {
|
|
222
222
|
const isEnglish = locale === 'en';
|
|
223
223
|
const change = typeof changeOrReason === 'object' && changeOrReason
|
|
224
224
|
? changeOrReason
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
: '当前类型暂不支持自动写回。';
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
function formatBinaryPayloadLimitReason(change = {}, locale = '
|
|
250
|
+
function formatBinaryPayloadLimitReason(change = {}, locale = 'en') {
|
|
251
251
|
const isEnglish = locale === 'en';
|
|
252
252
|
const size = formatBytes(change.size);
|
|
253
253
|
const limit = formatBytes(change.limit || change.aggregateLimit || change.nativeOutputLimit);
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
function normalizeLocale(options = {}) {
|
|
52
|
-
return options?.locale === '
|
|
52
|
+
return options?.locale === 'zh' ? 'zh' : 'en';
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
function textFor(locale, zh, en) {
|
|
@@ -430,7 +430,7 @@
|
|
|
430
430
|
&& /(context|thread|turn|conversation|codex)/i.test(label);
|
|
431
431
|
}
|
|
432
432
|
|
|
433
|
-
function formatContextCompactionCheckpoint(event = {}, locale = '
|
|
433
|
+
function formatContextCompactionCheckpoint(event = {}, locale = 'en') {
|
|
434
434
|
const method = String(event.detail?.method || event.title || '');
|
|
435
435
|
const running = event.status === 'running' || /(started|starting|begin|prepar)/i.test(method);
|
|
436
436
|
return {
|
|
@@ -559,7 +559,7 @@
|
|
|
559
559
|
return `${prefix}:${itemId || 'current'}`;
|
|
560
560
|
}
|
|
561
561
|
|
|
562
|
-
function formatPlanUpdateTitle(params = {}, locale = '
|
|
562
|
+
function formatPlanUpdateTitle(params = {}, locale = 'en') {
|
|
563
563
|
const steps = Array.isArray(params.plan) ? params.plan : [];
|
|
564
564
|
const active = steps.find(step => step.status === 'in_progress') || steps.find(step => step.status === 'pending');
|
|
565
565
|
const text = cleanVisibleText(active?.step || params.explanation || '');
|
|
@@ -568,7 +568,7 @@
|
|
|
568
568
|
: textFor(locale, 'Codex 更新了执行计划。', 'Codex updated its plan.');
|
|
569
569
|
}
|
|
570
570
|
|
|
571
|
-
function formatPlanUpdateDetail(params = {}, locale = '
|
|
571
|
+
function formatPlanUpdateDetail(params = {}, locale = 'en') {
|
|
572
572
|
const steps = Array.isArray(params.plan) ? params.plan : [];
|
|
573
573
|
if (!steps.length) {
|
|
574
574
|
return undefined;
|
|
@@ -892,7 +892,7 @@
|
|
|
892
892
|
* part of Codex's answer. `formatHumanReport` retains the legacy flat-text
|
|
893
893
|
* shape for transcripts, storage fallback, and existing assertions.
|
|
894
894
|
*/
|
|
895
|
-
function buildStructuredHumanReport(report = {}, locale = '
|
|
895
|
+
function buildStructuredHumanReport(report = {}, locale = 'en') {
|
|
896
896
|
const conclusion = cleanVisibleMarkdownText(report.conclusion || '');
|
|
897
897
|
|
|
898
898
|
const bodySections = [];
|
|
@@ -939,7 +939,7 @@
|
|
|
939
939
|
return { conclusion, body: bodySections.join('\n\n'), meta };
|
|
940
940
|
}
|
|
941
941
|
|
|
942
|
-
function formatHumanReport(report = {}, locale = '
|
|
942
|
+
function formatHumanReport(report = {}, locale = 'en') {
|
|
943
943
|
const sections = [];
|
|
944
944
|
const conclusion = cleanVisibleMarkdownText(report.conclusion || '');
|
|
945
945
|
if (conclusion) {
|
|
@@ -969,7 +969,7 @@
|
|
|
969
969
|
return sections.join('\n\n');
|
|
970
970
|
}
|
|
971
971
|
|
|
972
|
-
function buildFallbackReport(input, counts, locale = '
|
|
972
|
+
function buildFallbackReport(input, counts, locale = 'en') {
|
|
973
973
|
const operations = Array.isArray(input.operations) ? input.operations : [];
|
|
974
974
|
const appliedOperations = collectAppliedOperations(input.applyResults);
|
|
975
975
|
const affectedFiles = collectAffectedFiles(operations, input.summary, input.applyResults);
|
|
@@ -1023,7 +1023,7 @@
|
|
|
1023
1023
|
return localized.nextAction || primary.nextAction || '';
|
|
1024
1024
|
}
|
|
1025
1025
|
|
|
1026
|
-
function formatWriteResult(appliedCount, skippedCount, locale = '
|
|
1026
|
+
function formatWriteResult(appliedCount, skippedCount, locale = 'en') {
|
|
1027
1027
|
return textFor(
|
|
1028
1028
|
locale,
|
|
1029
1029
|
`已写入 ${appliedCount} 项,跳过 ${skippedCount} 项`,
|
|
@@ -1031,7 +1031,7 @@
|
|
|
1031
1031
|
);
|
|
1032
1032
|
}
|
|
1033
1033
|
|
|
1034
|
-
function inferUnchangedReason(input, locale = '
|
|
1034
|
+
function inferUnchangedReason(input, locale = 'en') {
|
|
1035
1035
|
if (input.mode === 'ask' || input.status === '只问不改') {
|
|
1036
1036
|
return textFor(locale, '这轮是只问不改。', 'This run was Ask mode.');
|
|
1037
1037
|
}
|
|
@@ -1041,7 +1041,7 @@
|
|
|
1041
1041
|
return '';
|
|
1042
1042
|
}
|
|
1043
1043
|
|
|
1044
|
-
function formatFallbackNextStep(input, skippedCount, affectedFiles, locale = '
|
|
1044
|
+
function formatFallbackNextStep(input, skippedCount, affectedFiles, locale = 'en') {
|
|
1045
1045
|
if (skippedCount) {
|
|
1046
1046
|
return textFor(locale, '请查看本轮报告中的跳过项,处理后可以重试。', 'Review the skipped items in this report, then retry after resolving them.');
|
|
1047
1047
|
}
|
|
@@ -1070,7 +1070,7 @@
|
|
|
1070
1070
|
};
|
|
1071
1071
|
}
|
|
1072
1072
|
|
|
1073
|
-
function technicalOnly(event, locale = '
|
|
1073
|
+
function technicalOnly(event, locale = 'en') {
|
|
1074
1074
|
return {
|
|
1075
1075
|
kind: 'technical',
|
|
1076
1076
|
visible: false,
|
|
@@ -1094,7 +1094,7 @@
|
|
|
1094
1094
|
return TECHNICAL_EVENT_PATTERNS.some(pattern => pattern.test(type));
|
|
1095
1095
|
}
|
|
1096
1096
|
|
|
1097
|
-
function summarizeCommandActivity(event, locale = '
|
|
1097
|
+
function summarizeCommandActivity(event, locale = 'en') {
|
|
1098
1098
|
const type = String(event.type || '');
|
|
1099
1099
|
const command = String(event.detail?.command || '');
|
|
1100
1100
|
const output = String(event.detail?.output || '');
|
|
@@ -1140,7 +1140,7 @@
|
|
|
1140
1140
|
return 'check';
|
|
1141
1141
|
}
|
|
1142
1142
|
|
|
1143
|
-
function formatCommandStartedTitle(kind, command, locale = '
|
|
1143
|
+
function formatCommandStartedTitle(kind, command, locale = 'en') {
|
|
1144
1144
|
if (kind === 'search') {
|
|
1145
1145
|
const query = extractSearchQuery(command);
|
|
1146
1146
|
return query ? textFor(locale, `正在搜索项目内容:${query}`, `Searching project content: ${query}`) : textFor(locale, '正在搜索项目内容。', 'Searching project content.');
|
|
@@ -1157,7 +1157,7 @@
|
|
|
1157
1157
|
return textFor(locale, '正在执行一次本地检查。', 'Running a local check.');
|
|
1158
1158
|
}
|
|
1159
1159
|
|
|
1160
|
-
function formatCommandCompletedTitle(kind, output, failed, locale = '
|
|
1160
|
+
function formatCommandCompletedTitle(kind, output, failed, locale = 'en') {
|
|
1161
1161
|
if (failed) {
|
|
1162
1162
|
if (kind === 'search') {
|
|
1163
1163
|
return textFor(locale, '搜索没有正常完成。', 'Search did not finish normally.');
|
|
@@ -1184,7 +1184,7 @@
|
|
|
1184
1184
|
return textFor(locale, '本地检查已完成。', 'Local check completed.');
|
|
1185
1185
|
}
|
|
1186
1186
|
|
|
1187
|
-
function formatCommandPublicDetail(kind, command, locale = '
|
|
1187
|
+
function formatCommandPublicDetail(kind, command, locale = 'en') {
|
|
1188
1188
|
if (kind !== 'search') {
|
|
1189
1189
|
return undefined;
|
|
1190
1190
|
}
|
|
@@ -1235,7 +1235,7 @@
|
|
|
1235
1235
|
return files;
|
|
1236
1236
|
}
|
|
1237
1237
|
|
|
1238
|
-
function formatFilesInline(files = [], locale = '
|
|
1238
|
+
function formatFilesInline(files = [], locale = 'en') {
|
|
1239
1239
|
const values = normalizeStringList(files);
|
|
1240
1240
|
if (!values.length) {
|
|
1241
1241
|
return textFor(locale, '没有文件', 'no files');
|
|
@@ -1300,7 +1300,7 @@
|
|
|
1300
1300
|
.trim();
|
|
1301
1301
|
}
|
|
1302
1302
|
|
|
1303
|
-
function addListSection(sections, label, values, locale = '
|
|
1303
|
+
function addListSection(sections, label, values, locale = 'en') {
|
|
1304
1304
|
const items = normalizeStringList(values);
|
|
1305
1305
|
if (!items.length) {
|
|
1306
1306
|
return;
|
|
@@ -1314,7 +1314,7 @@
|
|
|
1314
1314
|
* rendered report. Per-item first line gets the `- ` bullet; subsequent
|
|
1315
1315
|
* lines pass through verbatim (the formatter already indents them).
|
|
1316
1316
|
*/
|
|
1317
|
-
function addStructuredListSection(sections, label, values, locale = '
|
|
1317
|
+
function addStructuredListSection(sections, label, values, locale = 'en') {
|
|
1318
1318
|
const items = normalizeMultilineStringList(values);
|
|
1319
1319
|
if (!items.length) {
|
|
1320
1320
|
return;
|
|
@@ -1408,7 +1408,7 @@
|
|
|
1408
1408
|
return files;
|
|
1409
1409
|
}
|
|
1410
1410
|
|
|
1411
|
-
function formatOperationLine(operation, locale = '
|
|
1411
|
+
function formatOperationLine(operation, locale = 'en') {
|
|
1412
1412
|
const labels = OPERATION_LABELS[locale] || OPERATION_LABELS.zh;
|
|
1413
1413
|
const label = labels[operation?.type] || operation?.type || textFor(locale, '处理', 'process');
|
|
1414
1414
|
const filePath = operation?.path || operation?.from || operation?.to || textFor(locale, '未知文件', 'unknown file');
|
|
@@ -1418,7 +1418,7 @@
|
|
|
1418
1418
|
: (reason ? `${filePath}:${label}(${reason})` : `${filePath}:${label}`);
|
|
1419
1419
|
}
|
|
1420
1420
|
|
|
1421
|
-
function formatOperationReason(operation, locale = '
|
|
1421
|
+
function formatOperationReason(operation, locale = 'en') {
|
|
1422
1422
|
const key = operation?.reasonKey || '';
|
|
1423
1423
|
const count = Number(operation?.reasonParams?.count || 0);
|
|
1424
1424
|
if (key === 'localWorkspaceDelete') {
|
|
@@ -1440,7 +1440,7 @@
|
|
|
1440
1440
|
return localizeVisibleReason(operation?.reason || '', locale);
|
|
1441
1441
|
}
|
|
1442
1442
|
|
|
1443
|
-
function formatSkippedOperationLine(item, locale = '
|
|
1443
|
+
function formatSkippedOperationLine(item, locale = 'en') {
|
|
1444
1444
|
const operation = item?.operation || {};
|
|
1445
1445
|
const labels = OPERATION_LABELS[locale] || OPERATION_LABELS.zh;
|
|
1446
1446
|
const label = labels[operation.type] || operation.type || textFor(locale, '处理', 'process');
|
|
@@ -1547,7 +1547,7 @@
|
|
|
1547
1547
|
};
|
|
1548
1548
|
}
|
|
1549
1549
|
|
|
1550
|
-
function formatSkippedReason(result = {}, operation = {}, locale = '
|
|
1550
|
+
function formatSkippedReason(result = {}, operation = {}, locale = 'en') {
|
|
1551
1551
|
const key = result.reasonKey || '';
|
|
1552
1552
|
const code = result.code || '';
|
|
1553
1553
|
const filePath = result.reasonParams?.filePath || operation?.path || operation?.from || operation?.to || '';
|
|
@@ -1664,7 +1664,7 @@
|
|
|
1664
1664
|
return parts.join(', ');
|
|
1665
1665
|
}
|
|
1666
1666
|
|
|
1667
|
-
function localizeVisibleReason(reason, locale = '
|
|
1667
|
+
function localizeVisibleReason(reason, locale = 'en') {
|
|
1668
1668
|
const text = cleanVisibleText(reason || '');
|
|
1669
1669
|
if (!text || locale !== 'en') {
|
|
1670
1670
|
return text;
|
|
@@ -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 = '2.1.
|
|
15
|
+
const BUILD_TARGET_VERSION = '2.1.4';
|
|
16
16
|
const DEFAULT_CHROME_EXTENSION_ID = 'illdpneeeopfffmiepaejglgmhpmdhdc';
|
|
17
17
|
const REQUIRED_CAPABILITIES = Object.freeze([
|
|
18
18
|
'bridgePing',
|
|
@@ -1051,6 +1051,9 @@
|
|
|
1051
1051
|
runs,
|
|
1052
1052
|
task: summarizeTextForStorage(session.task, 'task'),
|
|
1053
1053
|
mode: normalizeMode(session.mode || fallbackState.mode),
|
|
1054
|
+
providerId: typeof session.providerId === 'string' && session.providerId
|
|
1055
|
+
? session.providerId
|
|
1056
|
+
: 'builtin',
|
|
1054
1057
|
model: normalizeTextField(session.model || fallbackState.model || DEFAULT_PANEL_STATE.model, 80),
|
|
1055
1058
|
reasoningEffort: normalizeReasoning(session.reasoningEffort || fallbackState.reasoningEffort),
|
|
1056
1059
|
speedTier: normalizeSpeedTier(session.speedTier || fallbackState.speedTier),
|
|
@@ -889,6 +889,7 @@ function validateTaskResultOperationQuotas(result = {}) {
|
|
|
889
889
|
}
|
|
890
890
|
|
|
891
891
|
function buildDefaultUserReport(mode, operations = [], params = {}) {
|
|
892
|
+
const locale = normalizeReportLocale(params.locale);
|
|
892
893
|
const checked = (params.project?.files || [])
|
|
893
894
|
.map(file => file?.path)
|
|
894
895
|
.filter(path => typeof path === 'string' && path.length > 0)
|
|
@@ -897,19 +898,29 @@ function buildDefaultUserReport(mode, operations = [], params = {}) {
|
|
|
897
898
|
|
|
898
899
|
return {
|
|
899
900
|
conclusion: hasOperations
|
|
900
|
-
? 'Codex 已准备好建议修改,等待确认或写入。'
|
|
901
|
-
: '这轮任务已完成,没有写入 Overleaf 文件。',
|
|
901
|
+
? reportText(locale, 'Codex prepared proposed changes and is waiting for confirmation or writeback.', 'Codex 已准备好建议修改,等待确认或写入。')
|
|
902
|
+
: reportText(locale, 'This task completed without writing Overleaf files.', '这轮任务已完成,没有写入 Overleaf 文件。'),
|
|
902
903
|
checked,
|
|
903
904
|
findings: [],
|
|
904
|
-
plannedChanges: hasOperations ? operations.map(formatOperationForUserReport) : [],
|
|
905
|
+
plannedChanges: hasOperations ? operations.map(operation => formatOperationForUserReport(operation, locale)) : [],
|
|
905
906
|
appliedChanges: [],
|
|
906
|
-
unchangedReason: hasOperations
|
|
907
|
+
unchangedReason: hasOperations
|
|
908
|
+
? ''
|
|
909
|
+
: (mode === 'ask' ? reportText(locale, 'This run was Ask mode.', '这轮是只问不改。') : ''),
|
|
907
910
|
nextStep: hasOperations
|
|
908
|
-
? '请确认修改方案后写入 Overleaf。'
|
|
909
|
-
: '可以继续追问,或加入更多 @context 后再检查。'
|
|
911
|
+
? reportText(locale, 'Review and confirm the proposed changes before writing them to Overleaf.', '请确认修改方案后写入 Overleaf。')
|
|
912
|
+
: reportText(locale, 'Continue the conversation, or add more @context and run another check.', '可以继续追问,或加入更多 @context 后再检查。')
|
|
910
913
|
};
|
|
911
914
|
}
|
|
912
915
|
|
|
916
|
+
function normalizeReportLocale(locale) {
|
|
917
|
+
return locale === 'zh' ? 'zh' : 'en';
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
function reportText(locale, english, chinese) {
|
|
921
|
+
return locale === 'zh' ? chinese : english;
|
|
922
|
+
}
|
|
923
|
+
|
|
913
924
|
function normalizeUserReport(value, fallback) {
|
|
914
925
|
if (!value || typeof value !== 'object') {
|
|
915
926
|
return fallback;
|
|
@@ -932,17 +943,13 @@ function normalizeStringArray(value, fallback = []) {
|
|
|
932
943
|
return value.filter(item => typeof item === 'string');
|
|
933
944
|
}
|
|
934
945
|
|
|
935
|
-
function formatOperationForUserReport(operation) {
|
|
936
|
-
const labels =
|
|
937
|
-
edit: '编辑',
|
|
938
|
-
create: '
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
};
|
|
943
|
-
const label = labels[operation?.type] || operation?.type || '处理';
|
|
944
|
-
const filePath = operation?.path || operation?.to || '未知文件';
|
|
945
|
-
return `${filePath}:${label}`;
|
|
946
|
+
function formatOperationForUserReport(operation, locale = 'en') {
|
|
947
|
+
const labels = locale === 'zh'
|
|
948
|
+
? { edit: '编辑', create: '新建', rename: '重命名', move: '移动', delete: '删除' }
|
|
949
|
+
: { edit: 'edit', create: 'create', rename: 'rename', move: 'move', delete: 'delete' };
|
|
950
|
+
const label = labels[operation?.type] || operation?.type || reportText(locale, 'change', '处理');
|
|
951
|
+
const filePath = operation?.path || operation?.to || reportText(locale, 'unknown file', '未知文件');
|
|
952
|
+
return locale === 'zh' ? `${filePath}:${label}` : `${filePath}: ${label}`;
|
|
946
953
|
}
|
|
947
954
|
|
|
948
955
|
function collectResultOperations(result) {
|