codex-overleaf-link 1.3.6 → 1.3.7
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.3.
|
|
6
|
+
<img src="https://img.shields.io/badge/version-1.3.7-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 native host **and** sets up the extension: the script r
|
|
|
38
38
|
macOS / Linux:
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
CODEX_OVERLEAF_REF=v1.3.
|
|
41
|
+
CODEX_OVERLEAF_REF=v1.3.7 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.3.7/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/v1.3.
|
|
48
|
-
$env:CODEX_OVERLEAF_REF='v1.3.
|
|
47
|
+
iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.3.7/install.ps1 -OutFile install.ps1
|
|
48
|
+
$env:CODEX_OVERLEAF_REF='v1.3.7'
|
|
49
49
|
powershell -ExecutionPolicy Bypass -File install.ps1
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -56,10 +56,10 @@ Then, in the `chrome://extensions` tab the script opened: enable **Developer mod
|
|
|
56
56
|
`npm exec` installs and updates the **native host only** — it does not include the Chrome extension. Use it if you prefer a pinned npm package to a source checkout.
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
npm exec --yes codex-overleaf-link@1.3.
|
|
59
|
+
npm exec --yes codex-overleaf-link@1.3.7 -- install-native
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Then add the extension yourself: download `codex-overleaf-link-extension-v1.3.
|
|
62
|
+
Then add the extension yourself: download `codex-overleaf-link-extension-v1.3.7.zip` from the [v1.3.7 GitHub Release](https://github.com/Ghqqqq/codex-overleaf-link/releases/tag/v1.3.7), unzip it to a stable folder, and in `chrome://extensions` enable **Developer mode**, click **Load unpacked**, and select that folder.
|
|
63
63
|
|
|
64
64
|
### Open Overleaf
|
|
65
65
|
|
|
@@ -86,9 +86,9 @@ npm installs, updates, uninstalls, and diagnoses the native host only. npm does
|
|
|
86
86
|
|
|
87
87
|
| Action | Command |
|
|
88
88
|
|--------|---------|
|
|
89
|
-
| Install / update | `npm exec --yes codex-overleaf-link@1.3.
|
|
90
|
-
| Diagnose | `npm exec --yes codex-overleaf-link@1.3.
|
|
91
|
-
| Uninstall | `npm exec --yes codex-overleaf-link@1.3.
|
|
89
|
+
| Install / update | `npm exec --yes codex-overleaf-link@1.3.7 -- install-native` |
|
|
90
|
+
| Diagnose | `npm exec --yes codex-overleaf-link@1.3.7 -- doctor` |
|
|
91
|
+
| Uninstall | `npm exec --yes codex-overleaf-link@1.3.7 -- uninstall-native` |
|
|
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 @@ To update, re-run any of the [native host installers](#install) — they install
|
|
|
98
98
|
|
|
99
99
|
## GitHub Release Artifacts
|
|
100
100
|
|
|
101
|
-
The v1.3.
|
|
101
|
+
The v1.3.7 GitHub Release contains:
|
|
102
102
|
|
|
103
|
-
- `codex-overleaf-link-extension-v1.3.
|
|
104
|
-
- `codex-overleaf-native-host-v1.3.
|
|
105
|
-
- `codex-overleaf-link-1.3.
|
|
106
|
-
- `install.sh`: release-pinned macOS / Linux installer that defaults to `v1.3.
|
|
107
|
-
- `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v1.3.
|
|
103
|
+
- `codex-overleaf-link-extension-v1.3.7.zip`: loadable Chrome extension package for manual unpacked installation.
|
|
104
|
+
- `codex-overleaf-native-host-v1.3.7.tar.gz`: native host runtime files used by the installer and release verification.
|
|
105
|
+
- `codex-overleaf-link-1.3.7.tgz`: npm native host CLI package for pinned install, doctor, and uninstall flows.
|
|
106
|
+
- `install.sh`: release-pinned macOS / Linux installer that defaults to `v1.3.7` when run directly from the release artifact.
|
|
107
|
+
- `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v1.3.7` 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 v1.3.6 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@1.3.
|
|
118
|
+
npm exec --yes codex-overleaf-link@1.3.7 -- uninstall-native
|
|
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=v1.3.
|
|
153
|
+
CODEX_OVERLEAF_REF=v1.3.7 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.3.7/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@1.3.
|
|
159
|
+
npm exec --yes codex-overleaf-link@1.3.7 -- uninstall-native --browser chromium
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
## Features
|
|
@@ -167,6 +167,7 @@ npm exec --yes codex-overleaf-link@1.3.6 -- uninstall-native --browser chromium
|
|
|
167
167
|
- **Diff review** — per-file diff view before accepting changes.
|
|
168
168
|
- **Undo checkpoint** — one-click revert of browser writes.
|
|
169
169
|
- **Track Changes integration** — optionally enables Overleaf Reviewing before writing.
|
|
170
|
+
- **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.
|
|
170
171
|
- **Auto-recompile** — triggers Overleaf recompile after writeback; logs compile errors as context.
|
|
171
172
|
- **@ context** — attach specific files, `@compile-log`, or `@current-section` to the prompt.
|
|
172
173
|
- **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.
|
|
@@ -288,7 +289,7 @@ Composer attachments are turn-scoped Codex context. Limits are 8 attachments per
|
|
|
288
289
|
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.
|
|
289
290
|
|
|
290
291
|
```bash
|
|
291
|
-
npm exec --yes codex-overleaf-link@1.3.
|
|
292
|
+
npm exec --yes codex-overleaf-link@1.3.7 -- install-native
|
|
292
293
|
```
|
|
293
294
|
|
|
294
295
|
**The Windows popup or panel shows a Bash recovery command**
|
|
@@ -337,8 +338,8 @@ Use this matrix for release-candidate signoff and compatibility reports. Record
|
|
|
337
338
|
| Browser/channel/version | Google Chrome channel and version. | Google Chrome channel and version. | Google Chrome channel and version. | Chromium channel/package and version. |
|
|
338
339
|
| 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`. |
|
|
339
340
|
| 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`. |
|
|
340
|
-
| Installer/update command | `npm exec --yes codex-overleaf-link@1.3.
|
|
341
|
-
| Uninstall command | `npm exec --yes codex-overleaf-link@1.3.
|
|
341
|
+
| Installer/update command | `npm exec --yes codex-overleaf-link@1.3.7 -- install-native` | `npm exec --yes codex-overleaf-link@1.3.7 -- install-native` | `npm exec --yes codex-overleaf-link@1.3.7 -- install-native` | `npm exec --yes codex-overleaf-link@1.3.7 -- install-native --browser chromium` |
|
|
342
|
+
| Uninstall command | `npm exec --yes codex-overleaf-link@1.3.7 -- uninstall-native` | `npm exec --yes codex-overleaf-link@1.3.7 -- uninstall-native` | `npm exec --yes codex-overleaf-link@1.3.7 -- uninstall-native` | `npm exec --yes codex-overleaf-link@1.3.7 -- uninstall-native --browser chromium` |
|
|
342
343
|
| 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` |
|
|
343
344
|
| 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`. |
|
|
344
345
|
| 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. |
|
|
@@ -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.3.
|
|
15
|
+
const BUILD_TARGET_VERSION = '1.3.7';
|
|
16
16
|
const DEFAULT_CHROME_EXTENSION_ID = 'illdpneeeopfffmiepaejglgmhpmdhdc';
|
|
17
17
|
const REQUIRED_CAPABILITIES = Object.freeze([
|
|
18
18
|
'bridgePing',
|
|
@@ -123,6 +123,24 @@
|
|
|
123
123
|
undoCheckpointMissingReason: 'This run wrote while Reviewing/Track Changes was enabled, but the extension could not reliably identify the tracked changes generated by Overleaf. To avoid creating new redlines with text patches, automatic undo is disabled.',
|
|
124
124
|
undoCheckpointMissingNext: 'Reject this run manually in Overleaf review tools, or rerun and try again.',
|
|
125
125
|
undoCheckpointPlain: 'Undo point created: this run has {count} reversible write(s)',
|
|
126
|
+
runAcceptTracked: 'Accept changes',
|
|
127
|
+
runAcceptTrackedTitle: 'Accept this run\'s Overleaf tracked changes',
|
|
128
|
+
runAcceptTrackedConfirm: 'Confirm accept',
|
|
129
|
+
runAcceptTrackedCancel: 'Cancel',
|
|
130
|
+
runAcceptTrackedConfirming: 'Accepting…',
|
|
131
|
+
runAcceptTrackedDone: 'Accepted',
|
|
132
|
+
runAcceptTrackedDoneTitle: 'This run\'s tracked changes have been accepted',
|
|
133
|
+
runAcceptTrackedStarted: 'Starting to accept this run\'s Overleaf tracked changes',
|
|
134
|
+
runAcceptTrackedResult: 'Accept result: accepted {applied} tracked change(s), skipped {skipped}',
|
|
135
|
+
runAcceptTrackedFailed: 'Accept changes could not be completed',
|
|
136
|
+
runAcceptTrackedFailedReason: 'Overleaf editor content has drifted from this run\'s writeback, so Codex did not change the document. The run stays pending — retry Accept changes.',
|
|
137
|
+
runAcceptTrackedStepEditorUndo: 'Accept step 1/6 — Overleaf editor-undo of this run\'s tracked writeback',
|
|
138
|
+
runAcceptTrackedStepModeBefore: 'Accept step 2/6 — Reviewing/Track Changes state read BEFORE the Editing toggle',
|
|
139
|
+
runAcceptTrackedStepForceEditing: 'Accept step 3/6 — forcing Editing mode (Track Changes OFF) for the untracked replay',
|
|
140
|
+
runAcceptTrackedStepReplayStart: 'Accept step 4/6 — per-operation re-check of Editing mode before writing {path}',
|
|
141
|
+
runAcceptTrackedStepReplayDone: 'Accept step 5/6 — untracked replay write completed for {path}',
|
|
142
|
+
runAcceptTrackedStepRestoreReviewing: 'Accept step 6/6 — restoring the prior Reviewing/Track Changes mode',
|
|
143
|
+
detailAccepted: 'Accepted',
|
|
126
144
|
deleteFilePromptTitle: 'Allow Codex to delete files?',
|
|
127
145
|
deleteFilePromptMessage: '{files}\n\nOther changes can still sync if deletion is not confirmed.',
|
|
128
146
|
deleteFileConfirm: 'Allow delete',
|
|
@@ -394,6 +412,24 @@
|
|
|
394
412
|
undoCheckpointMissingReason: '本轮是在 Reviewing/Track Changes 下写入的,但插件没有可靠识别 Overleaf 生成的留痕记录。为了避免用文本补丁制造新的红线,自动撤销已禁用。',
|
|
395
413
|
undoCheckpointMissingNext: '请在 Overleaf 审阅面板手动拒绝这轮建议,或重新运行后再尝试。',
|
|
396
414
|
undoCheckpointPlain: '已创建撤销点:可撤销本轮 {count} 项写入',
|
|
415
|
+
runAcceptTracked: '接受改动',
|
|
416
|
+
runAcceptTrackedTitle: '接受本轮 Overleaf 留痕改动',
|
|
417
|
+
runAcceptTrackedConfirm: '确认接受',
|
|
418
|
+
runAcceptTrackedCancel: '取消',
|
|
419
|
+
runAcceptTrackedConfirming: '接受中…',
|
|
420
|
+
runAcceptTrackedDone: '已接受',
|
|
421
|
+
runAcceptTrackedDoneTitle: '本轮留痕改动已被接受',
|
|
422
|
+
runAcceptTrackedStarted: '开始接受本轮 Overleaf 留痕改动',
|
|
423
|
+
runAcceptTrackedResult: '接受结果:已接受 {applied} 条留痕,跳过 {skipped} 条',
|
|
424
|
+
runAcceptTrackedFailed: '没有完成接受改动',
|
|
425
|
+
runAcceptTrackedFailedReason: 'Overleaf 编辑器内容已经和本轮写入不一致,Codex 没有改动文档。本轮仍为待处理状态——请重新点击接受改动。',
|
|
426
|
+
runAcceptTrackedStepEditorUndo: '接受步骤 1/6 — 通过 Overleaf 编辑器撤销,回退本轮留痕写入',
|
|
427
|
+
runAcceptTrackedStepModeBefore: '接受步骤 2/6 — 强制切换 Editing 之前读取的 Reviewing/Track Changes 状态',
|
|
428
|
+
runAcceptTrackedStepForceEditing: '接受步骤 3/6 — 强制切换到 Editing 模式(Track Changes OFF)以便重放为永久文本',
|
|
429
|
+
runAcceptTrackedStepReplayStart: '接受步骤 4/6 — 写入 {path} 前再次校验 Editing 模式',
|
|
430
|
+
runAcceptTrackedStepReplayDone: '接受步骤 5/6 — 已完成 {path} 的无留痕重放写入',
|
|
431
|
+
runAcceptTrackedStepRestoreReviewing: '接受步骤 6/6 — 恢复之前的 Reviewing/Track Changes 模式',
|
|
432
|
+
detailAccepted: '已接受',
|
|
397
433
|
deleteFilePromptTitle: '允许 Codex 删除文件?',
|
|
398
434
|
deleteFilePromptMessage: '{files}\n\n未确认删除时,其它改动仍可继续同步。',
|
|
399
435
|
deleteFileConfirm: '允许删除',
|
|
@@ -38,6 +38,12 @@
|
|
|
38
38
|
const VALID_LOCALES = new Set(['en', 'zh']);
|
|
39
39
|
const VALID_EVENT_STATUSES = new Set(['info', 'running', 'completed', 'failed', 'warning', 'blocked', 'skipped', 'pending']);
|
|
40
40
|
const VALID_TITLE_SOURCES = new Set(['auto', 'manual']);
|
|
41
|
+
const VALID_TRACKED_CHANGE_STATUS = new Set([
|
|
42
|
+
'pending',
|
|
43
|
+
'accepted',
|
|
44
|
+
'rejected'
|
|
45
|
+
]);
|
|
46
|
+
const TERMINAL_TRACKED_CHANGE_STATUS = new Set(['accepted', 'rejected']);
|
|
41
47
|
const LEGACY_DEFAULT_SESSION_TITLE = 'New task';
|
|
42
48
|
const SESSION_AUTO_TITLE_CHARS = 24;
|
|
43
49
|
const MAX_RUN_EVENTS = 300;
|
|
@@ -515,7 +521,7 @@
|
|
|
515
521
|
});
|
|
516
522
|
}
|
|
517
523
|
|
|
518
|
-
|
|
524
|
+
const normalized = {
|
|
519
525
|
id: run.id,
|
|
520
526
|
task: sanitizeAssistantVisibleText(run.task) || 'untitled task',
|
|
521
527
|
mode: typeof run.mode === 'string' ? run.mode : '',
|
|
@@ -535,6 +541,57 @@
|
|
|
535
541
|
undoExpectedFiles: normalizeRunFiles(run.undoExpectedFiles),
|
|
536
542
|
undoStatus: sanitizeAssistantVisibleText(run.undoStatus)
|
|
537
543
|
};
|
|
544
|
+
|
|
545
|
+
applyTrackedChangeStatus(normalized, run.trackedChangeStatus);
|
|
546
|
+
|
|
547
|
+
return normalized;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
// Resolves `trackedChangeStatus` on an already-normalized run via three ordered
|
|
551
|
+
// steps: (1) value recovery, (2) migration of pre-feature runs, (3) terminal
|
|
552
|
+
// payload cleanup. Mutates `run` in place. Idempotent: re-running it on its own
|
|
553
|
+
// output yields the same result.
|
|
554
|
+
function applyTrackedChangeStatus(run, rawStatus) {
|
|
555
|
+
const hasRefs = run.undoTrackedChanges.length > 0;
|
|
556
|
+
const hasRawStatus = rawStatus !== undefined && rawStatus !== null && rawStatus !== '';
|
|
557
|
+
|
|
558
|
+
// Step 1 — value recovery. Keep a stable value; recover any other present
|
|
559
|
+
// value (corruption, an old persisted `partial_accept` / `partial_reject` /
|
|
560
|
+
// `resolved_elsewhere`, a stray in-flight value) to `pending` (with refs)
|
|
561
|
+
// or drop it. An absent value falls through.
|
|
562
|
+
let status;
|
|
563
|
+
if (VALID_TRACKED_CHANGE_STATUS.has(rawStatus)) {
|
|
564
|
+
status = rawStatus;
|
|
565
|
+
} else if (hasRawStatus) {
|
|
566
|
+
status = hasRefs ? 'pending' : undefined;
|
|
567
|
+
} else {
|
|
568
|
+
status = undefined;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// Step 1 — reload reconciliation. A non-terminal status (`pending`) with no
|
|
572
|
+
// refs is the post-reload state of an un-acted tracked-change run: the heavy refs are
|
|
573
|
+
// never persisted, so without them there is nothing to act on. Drop it so
|
|
574
|
+
// the run returns to the legacy-undo world. A terminal status with no refs
|
|
575
|
+
// is kept — step 3 already empties terminal payloads and the label stays
|
|
576
|
+
// meaningful.
|
|
577
|
+
if (!hasRefs && status !== undefined && !TERMINAL_TRACKED_CHANGE_STATUS.has(status)) {
|
|
578
|
+
status = undefined;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// Step 2 — migration of pre-feature runs (no status after step 1).
|
|
582
|
+
if (status === undefined && hasRefs) {
|
|
583
|
+
status = run.undoStatus === 'applied' ? 'rejected' : 'pending';
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// Step 3 — terminal payload cleanup; keeps `trackedChangeStatus`.
|
|
587
|
+
if (TERMINAL_TRACKED_CHANGE_STATUS.has(status)) {
|
|
588
|
+
run.undoTrackedChanges = [];
|
|
589
|
+
run.undoExpectedFiles = [];
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
if (status !== undefined) {
|
|
593
|
+
run.trackedChangeStatus = status;
|
|
594
|
+
}
|
|
538
595
|
}
|
|
539
596
|
|
|
540
597
|
function normalizeRunStatus(status) {
|
|
@@ -861,7 +918,7 @@
|
|
|
861
918
|
|
|
862
919
|
function compactRunForStorage(run, limits, keepUndoPayload) {
|
|
863
920
|
const undoPayload = compactUndoPayload(run, limits, keepUndoPayload);
|
|
864
|
-
|
|
921
|
+
const compact = {
|
|
865
922
|
id: run.id,
|
|
866
923
|
task: summarizeTextForStorage(run.task || 'untitled task', 'run task'),
|
|
867
924
|
mode: typeof run.mode === 'string' ? run.mode : '',
|
|
@@ -881,6 +938,10 @@
|
|
|
881
938
|
undoExpectedFiles: undoPayload.undoExpectedFiles,
|
|
882
939
|
undoStatus: summarizeTextForStorage(run.undoStatus, 'undo status')
|
|
883
940
|
};
|
|
941
|
+
if (VALID_TRACKED_CHANGE_STATUS.has(run.trackedChangeStatus)) {
|
|
942
|
+
compact.trackedChangeStatus = run.trackedChangeStatus;
|
|
943
|
+
}
|
|
944
|
+
return compact;
|
|
884
945
|
}
|
|
885
946
|
|
|
886
947
|
function compactRunEvents(events, limits) {
|
|
@@ -38,6 +38,11 @@
|
|
|
38
38
|
skipped: true,
|
|
39
39
|
pending: true
|
|
40
40
|
};
|
|
41
|
+
var VALID_TRACKED_CHANGE_STATUSES = {
|
|
42
|
+
pending: true,
|
|
43
|
+
accepted: true,
|
|
44
|
+
rejected: true
|
|
45
|
+
};
|
|
41
46
|
var SECRET_REDACTION_PATTERNS = [
|
|
42
47
|
/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z0-9 ]*PRIVATE KEY-----/g,
|
|
43
48
|
/\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi,
|
|
@@ -542,7 +547,7 @@
|
|
|
542
547
|
}
|
|
543
548
|
|
|
544
549
|
function compactRunForStorage(run) {
|
|
545
|
-
|
|
550
|
+
var compact = {
|
|
546
551
|
id: run.id,
|
|
547
552
|
task: normalizeDisplayTextForStorage(run.task || 'untitled task', SESSION_STORAGE_LIMITS.taskChars),
|
|
548
553
|
mode: typeof run.mode === 'string' ? redactSecretLikeText(run.mode) : '',
|
|
@@ -562,6 +567,10 @@
|
|
|
562
567
|
undoExpectedFiles: [],
|
|
563
568
|
undoStatus: normalizeDisplayTextForStorage(run.undoStatus, SESSION_STORAGE_LIMITS.statusTextChars)
|
|
564
569
|
};
|
|
570
|
+
if (VALID_TRACKED_CHANGE_STATUSES[run.trackedChangeStatus] === true) {
|
|
571
|
+
compact.trackedChangeStatus = run.trackedChangeStatus;
|
|
572
|
+
}
|
|
573
|
+
return compact;
|
|
565
574
|
}
|
|
566
575
|
|
|
567
576
|
function compactRunEventsForStorage(events) {
|