codex-overleaf-link 2.5.0 → 2.5.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.
- package/README.md +38 -26
- package/README.zh-CN.md +39 -27
- package/extension/bootstrap/background.js +52 -9
- package/extension/bootstrap/manifest.template.json +1 -1
- package/extension/bootstrap/popup.html +1 -0
- package/extension/bootstrap/popupFallback.js +55 -0
- package/extension/bootstrap/updateStatus.js +1 -0
- package/extension/src/background.js +206 -53
- package/extension/src/backgroundBootstrapMigration.js +181 -0
- package/extension/src/backgroundSharedSessions.js +74 -14
- package/extension/src/backgroundUpdateCoordinator.js +118 -21
- package/extension/src/backgroundUpdateSafety.js +173 -0
- package/extension/src/content/activeTurnControl.js +8 -2
- package/extension/src/content/applyResultFormatters.js +46 -73
- package/extension/src/content/assetTransferBroker.js +72 -14
- package/extension/src/content/composerAttachments.js +93 -45
- package/extension/src/content/composerPanel.js +18 -0
- package/extension/src/content/contentRuntime.js +661 -676
- package/extension/src/content/diagnosticsController.js +122 -96
- package/extension/src/content/diagnosticsExport.js +19 -5
- package/extension/src/content/diagnosticsPanel.js +30 -0
- package/extension/src/content/directoryCleanupRecovery.js +54 -0
- package/extension/src/content/generated/content.bundle.js +6879 -2786
- package/extension/src/content/generated/content.bundle.meta.json +11 -3
- package/extension/src/content/globalPreferencesController.js +1 -1
- package/extension/src/content/legacyGlobalRegistry.js +6 -0
- package/extension/src/content/localSkillsPanel.js +102 -12
- package/extension/src/content/markdownText.js +5 -6
- package/extension/src/content/modelPicker.js +7 -4
- package/extension/src/content/nativeCompatibilityController.js +45 -20
- package/extension/src/content/otWarmMirror.js +4 -5
- package/extension/src/content/otWarmMirrorController.js +17 -20
- package/extension/src/content/pageBridgeClient.js +15 -2
- package/extension/src/content/panelMaintenance.js +40 -12
- package/extension/src/content/panelRenderer.js +6 -0
- package/extension/src/content/projectProviderSelection.js +13 -4
- package/extension/src/content/projectSessionCleanup.js +109 -62
- package/extension/src/content/projectSettingsCoordinator.js +39 -2
- package/extension/src/content/providerSettingsCoordinator.js +46 -8
- package/extension/src/content/providerSettingsDialog.js +71 -13
- package/extension/src/content/recentProjects.js +11 -5
- package/extension/src/content/runActivitySummary.js +40 -6
- package/extension/src/content/runCompletionMeta.js +344 -0
- package/extension/src/content/runController.js +37 -14
- package/extension/src/content/runFailureNotice.js +21 -12
- package/extension/src/content/runGuidanceController.js +72 -27
- package/extension/src/content/runGuidanceView.js +59 -10
- package/extension/src/content/runQueueScheduler.js +148 -42
- package/extension/src/content/runRecoveryActions.js +146 -0
- package/extension/src/content/runResultActions.js +8 -125
- package/extension/src/content/runReviewController.js +574 -0
- package/extension/src/content/runScrollLayout.js +21 -2
- package/extension/src/content/runTimelineView.js +146 -153
- package/extension/src/content/scopedPersistencePanelState.js +51 -6
- package/extension/src/content/selectionContextView.js +1 -1
- package/extension/src/content/sensitivePreflight.js +140 -0
- package/extension/src/content/sessionForkController.js +80 -17
- package/extension/src/content/sessionManager.js +1 -1
- package/extension/src/content/settingsPanel.js +7 -3
- package/extension/src/content/settingsWorkbench.js +5 -0
- package/extension/src/content/sharedSessionViewSync.js +45 -8
- package/extension/src/content/updateIdle.js +4 -1
- package/extension/src/content/updateNotice.js +60 -8
- package/extension/src/content/updateSafetyReceiver.js +58 -0
- package/extension/src/content/writebackController.js +53 -4
- package/extension/src/content/writebackOrchestrator.js +82 -73
- package/extension/src/content/writingStyleSettings.js +35 -11
- package/extension/src/page/binaryAssetUploader.js +136 -14
- package/extension/src/page/fileMover.js +256 -0
- package/extension/src/page/ownedDirectoryCleanup.js +94 -0
- package/extension/src/page/referenceProjects.js +1 -0
- package/extension/src/page/reviewContext.js +113 -0
- package/extension/src/page/saveState.js +6 -4
- package/extension/src/page/snapshotRouter.js +84 -39
- package/extension/src/page/textFileCreator.js +105 -25
- package/extension/src/page/trackedChangeCapture.js +12 -2
- package/extension/src/page/trackedChangeOwnership.js +19 -1
- package/extension/src/page/trackedChangeReplay.js +41 -21
- package/extension/src/page/trackedChangesLifecycle.js +217 -199
- package/extension/src/page/treeOperations.js +7 -10
- package/extension/src/page/updateSafetyProbe.js +41 -0
- package/extension/src/page/writebackReceiptJournal.js +2 -0
- package/extension/src/page/writebackRouter.js +80 -79
- package/extension/src/pageBridge.js +19 -3
- package/extension/src/popup.js +62 -10
- package/extension/src/shared/agentTranscript.js +23 -0
- package/extension/src/shared/auditRecords.js +2 -0
- package/extension/src/shared/compatibility.js +22 -6
- package/extension/src/shared/compileAdapter.js +79 -57
- package/extension/src/shared/composerAttachmentDraft.js +151 -0
- package/extension/src/shared/directoryCleanupProof.js +43 -0
- package/extension/src/shared/failureReasons.js +309 -3
- package/extension/src/shared/globalPreferences.js +30 -13
- package/extension/src/shared/governanceRules.js +4 -37
- package/extension/src/shared/i18n.js +298 -2
- package/extension/src/shared/managedUpdateProjection.js +2 -2
- package/extension/src/shared/nativeRequestIdentity.js +1 -0
- package/extension/src/shared/pageRpcContract.js +5 -4
- package/extension/src/shared/projectFiles.js +21 -44
- package/extension/src/shared/providerProfiles.js +5 -3
- package/extension/src/shared/runInputQueue.js +48 -5
- package/extension/src/shared/selectionContext.js +12 -3
- package/extension/src/shared/sessionState.js +72 -27
- package/extension/src/shared/settlementFacts.js +10 -2
- package/extension/src/shared/sharedSessionBridge.js +37 -14
- package/extension/src/shared/sharedSessionTransfer.js +140 -0
- package/extension/src/shared/staleGuard.js +118 -13
- package/extension/src/shared/storageDb.js +58 -26
- package/extension/src/shared/storageMigration.js +71 -111
- package/extension/src/shared/storageRunActions.js +209 -26
- package/extension/src/shared/subagentActivityModel.js +1 -1
- package/extension/src/shared/undoOperations.js +136 -13
- package/extension/src/shared/updateConsent.js +6 -4
- package/extension/src/shared/updateRuntimeIdentity.js +1 -1
- package/extension/src/shared/writebackIntent.js +16 -0
- package/extension/src/shared/writebackOperationEvidence.js +4 -15
- package/extension/src/shared/writebackSettlement.js +38 -38
- package/extension/styles/panel.css +19 -5
- package/native-host/src/anthropicBridgeRequest.js +4 -2
- package/native-host/src/anthropicBridgeResponse.js +6 -2
- package/native-host/src/anthropicMessagesBridge.js +24 -16
- package/native-host/src/bootstrapMigration.js +296 -0
- package/native-host/src/bootstrapMigrationContract.js +101 -0
- package/native-host/src/bootstrapUpdate.js +233 -0
- package/native-host/src/bootstrapUpdateWatchdog.js +44 -0
- package/native-host/src/chatBridgeResponse.js +10 -0
- package/native-host/src/chatCompletionsBridge.js +21 -15
- package/native-host/src/codexConfigPaths.js +106 -0
- package/native-host/src/codexHome.js +66 -73
- package/native-host/src/codexHomeScope.js +124 -0
- package/native-host/src/codexInheritedAuth.js +90 -0
- package/native-host/src/codexLocalSkills.js +301 -0
- package/native-host/src/codexPromptAssembly.js +31 -12
- package/native-host/src/codexProviderTest.js +24 -26
- package/native-host/src/codexSessionRunner.js +110 -183
- package/native-host/src/codexSessionTiming.js +18 -8
- package/native-host/src/codexSkillIsolation.js +170 -0
- package/native-host/src/codexThreadFork.js +19 -3
- package/native-host/src/index.js +19 -7
- package/native-host/src/managedInstall.js +110 -35
- package/native-host/src/managedInstallRecovery.js +140 -0
- package/native-host/src/managedRuntimeEvidence.js +57 -0
- package/native-host/src/mirrorWorkspace.js +92 -22
- package/native-host/src/nativeDoctor.js +15 -0
- package/native-host/src/nativeHelperLifecycle.js +21 -0
- package/native-host/src/nativeHostRegistration.js +33 -0
- package/native-host/src/nativeRunLifecycle.js +71 -0
- package/native-host/src/processStopBarrier.js +42 -7
- package/native-host/src/projectPathPlatform.js +30 -0
- package/native-host/src/providerHttp.js +80 -0
- package/native-host/src/providerProfile.js +4 -2
- package/native-host/src/providerReasoning.js +2 -7
- package/native-host/src/providerRuntime.js +1 -0
- package/native-host/src/providerStore.js +72 -14
- package/native-host/src/responsesPassthroughBridge.js +266 -52
- package/native-host/src/runtimeInstaller.js +21 -1
- package/native-host/src/selectionScope.js +36 -8
- package/native-host/src/subagentAdmission.js +26 -0
- package/native-host/src/subagentBroker.js +79 -66
- package/native-host/src/subagentTelemetry.js +19 -10
- package/native-host/src/subagentWorkspacePath.js +5 -2
- package/native-host/src/taskRunnerRuntime.js +77 -54
- package/native-host/src/tomlStatements.js +140 -0
- package/native-host/src/updateManager.js +297 -39
- package/native-host/src/writingStyleRuntime.js +57 -29
- package/native-host/src/writingStyleStore.js +73 -0
- package/package.json +1 -1
- package/scripts/install-managed.mjs +1 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
(function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
})(typeof window !== 'undefined' ? window : globalThis, function runResultActionsFactory() {
|
|
1
|
+
(function (root, factory) {
|
|
2
|
+
if (typeof module === 'object' && module.exports) module.exports = factory(require('./runCompletionMeta'));
|
|
3
|
+
else root.CodexOverleafModuleRegistry.define('RunResultActions', ['RunCompletionMeta'], factory);
|
|
4
|
+
})(typeof window !== 'undefined' ? window : globalThis, function (RunCompletionMeta) {
|
|
6
5
|
'use strict';
|
|
7
6
|
|
|
7
|
+
const { splitFlatCompletionReport, projectCompletionBody, projectCompletionMeta, summarizeCompletionMeta } = RunCompletionMeta;
|
|
8
|
+
|
|
9
|
+
|
|
8
10
|
function create(deps = {}) {
|
|
9
11
|
const {
|
|
10
12
|
tr,
|
|
@@ -107,128 +109,9 @@
|
|
|
107
109
|
if (!copied) throw new Error('clipboard_copy_failed');
|
|
108
110
|
}
|
|
109
111
|
|
|
110
|
-
return Object.freeze({ configureResultActions, projectUndoAvailability, splitFlatCompletionReport, projectCompletionMeta, summarizeCompletionMeta });
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const FLAT_REPORT_STATUS_SECTIONS = [
|
|
115
|
-
{ key: 'saveState', prefixes: ['Save:', '保存:'], en: 'Save', zh: '保存' },
|
|
116
|
-
{ key: 'unchangedReason', prefixes: ['Why nothing changed:', '未修改原因:'], en: 'Why nothing changed', zh: '未修改原因' },
|
|
117
|
-
{ key: 'writeResult', prefixes: ['Write result:', '写入结果:'], en: 'Write result', zh: '写入结果' },
|
|
118
|
-
{ key: 'undo', prefixes: ['Undo:', '可撤销:'], en: 'Undo', zh: '可撤销' },
|
|
119
|
-
{ key: 'nextStep', prefixes: ['Next:', '下一步:'], en: 'Next', zh: '下一步' }
|
|
120
|
-
];
|
|
121
|
-
|
|
122
|
-
function splitFlatCompletionReport(text, tx = value => value) {
|
|
123
|
-
const raw = typeof text === 'string' ? text : '';
|
|
124
|
-
if (!raw.trim()) return { body: raw, meta: [] };
|
|
125
|
-
const bodySections = [], meta = [];
|
|
126
|
-
for (const section of raw.split(/\n{2,}/)) {
|
|
127
|
-
const trimmed = section.trim();
|
|
128
|
-
if (!trimmed) continue;
|
|
129
|
-
const entry = trimmed.includes('\n') ? null
|
|
130
|
-
: FLAT_REPORT_STATUS_SECTIONS.find(item => item.prefixes.some(prefix => trimmed.startsWith(prefix)));
|
|
131
|
-
if (entry) {
|
|
132
|
-
const prefix = entry.prefixes.find(value => trimmed.startsWith(value));
|
|
133
|
-
const value = trimmed.slice(prefix.length).trim();
|
|
134
|
-
if (value) {
|
|
135
|
-
meta.push({ key: entry.key, label: tx(entry.en, entry.zh), value });
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
bodySections.push(trimmed);
|
|
140
|
-
}
|
|
141
|
-
return { body: bodySections.join('\n\n'), meta };
|
|
112
|
+
return Object.freeze({ configureResultActions, projectUndoAvailability, splitFlatCompletionReport, projectCompletionBody, projectCompletionMeta, summarizeCompletionMeta });
|
|
142
113
|
}
|
|
143
114
|
|
|
144
|
-
function projectCompletionMeta(meta, run, options) {
|
|
145
|
-
const { tx, trackedChangeInFlight, isTrackedChangeLifecycleRun, projectRunSettlement } = options;
|
|
146
|
-
if (!Array.isArray(meta) || !run) return meta;
|
|
147
|
-
const undone = run.undoStatus === 'applied' || run.trackedChangeStatus === 'rejected';
|
|
148
|
-
const rows = undone ? meta.filter(row => row?.key !== 'saveState') : meta;
|
|
149
|
-
const inFlight = trackedChangeInFlight?.get(run.id);
|
|
150
|
-
const tracked = isTrackedChangeLifecycleRun(run);
|
|
151
|
-
const pendingCreatedUndo = tracked && run.trackedChangeStatus === 'needs_review' && run.undoOperations?.some(operation => operation?.undoCreatedFile?.v === 1);
|
|
152
|
-
let undo;
|
|
153
|
-
if (run.undoStatus === 'running' || inFlight === 'reject') {
|
|
154
|
-
undo = tx('Undoing changes...', '正在撤销修改…');
|
|
155
|
-
} else if (run.undoStatus === 'applied' || (tracked && run.trackedChangeStatus === 'rejected')) {
|
|
156
|
-
undo = tx('This run\'s changes have been undone.', '本轮修改已撤销。');
|
|
157
|
-
} else if (tracked && run.trackedChangeStatus === 'accepted') {
|
|
158
|
-
undo = tx('Changes accepted; undo is no longer available.', '修改已接受,无法再撤销。');
|
|
159
|
-
} else if (run.undoStatus === 'partial' || pendingCreatedUndo) {
|
|
160
|
-
undo = hasUndoProgress(run)
|
|
161
|
-
? projectRunSettlement(run).canUndo
|
|
162
|
-
? tx(pendingCreatedUndo ? 'Some changes were undone; retry the remaining files.' : 'Some changes were undone; remaining changes can still be undone.', pendingCreatedUndo ? '已撤销部分修改,可重试剩余文件。' : '已撤销部分修改,剩余修改仍可撤销。')
|
|
163
|
-
: tx('Some changes were undone.', '已撤销部分修改。')
|
|
164
|
-
: projectRunSettlement(run).canUndo
|
|
165
|
-
? tx(pendingCreatedUndo ? 'Undo is incomplete; retry the remaining files.' : 'Undo is incomplete; remaining changes can still be undone.', pendingCreatedUndo ? '撤销未完成,可重试剩余文件。' : '撤销未完成,剩余修改仍可撤销。')
|
|
166
|
-
: tx('Undo is incomplete.', '撤销未完成。');
|
|
167
|
-
}
|
|
168
|
-
if (!undo && !run.saveCheck && !run.saveConfirmedAt) return rows;
|
|
169
|
-
return rows.map(row => row?.key === 'undo' && undo
|
|
170
|
-
? { ...row, label: tx('Undo', '撤销'), value: undo }
|
|
171
|
-
: row?.key === 'saveState' && (run.saveCheck || run.saveConfirmedAt)
|
|
172
|
-
? { ...row, label: tx('Save', '保存'), value: run.saveCheck
|
|
173
|
-
? tx('Pending confirmation', '待确认') : tx('Saved', '已确认保存') }
|
|
174
|
-
: row);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function hasUndoProgress(run) {
|
|
178
|
-
const failures = run?.settlement?.failures || run?.settlementFacts?.failures || [];
|
|
179
|
-
return (Array.isArray(run?.events) ? run.events : []).some(event => {
|
|
180
|
-
if (!['completed', 'failed'].includes(event?.status) || event.streamRole || ['report', 'guidance', 'stream'].includes(event.kind)) return false;
|
|
181
|
-
const count = String(event.title || '').match(/^(?:Undo result: (?:undone|rejected) (\d+) (?:item\(s\)|file\(s\)|tracked change\(s\)), skipped \d+(?: item\(s\))?|撤销结果:已(?:撤销|拒绝) (\d+) (?:项|条留痕|个文件),跳过 \d+ (?:项|条))$/);
|
|
182
|
-
if (!(Number(count?.[1] || count?.[2]) > 0)) return false;
|
|
183
|
-
const detail = event.detail || {}, applied = detail.Undone || detail.Rejected || detail['已撤销'] || detail['已拒绝'];
|
|
184
|
-
const skipped = detail.Skipped || detail['跳过'], path = item => item?.File || item?.['文件'];
|
|
185
|
-
return Array.isArray(applied) && Array.isArray(skipped) && applied.some(item =>
|
|
186
|
-
typeof path(item) === 'string' && path(item).trim() && !skipped.some(other => path(other) === path(item))
|
|
187
|
-
&& !(Array.isArray(failures) && failures.some(failure => failure?.code === 'undo_not_verified'
|
|
188
|
-
&& (!failure.file || failure.file === path(item)))));
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Generic reasons say nothing beyond "no files were written", so they stay in
|
|
193
|
-
// the details. Both locales match because a report keeps its original locale.
|
|
194
|
-
const GENERIC_UNCHANGED_REASONS = new Set([
|
|
195
|
-
'No file changes need to sync back to Overleaf.', '没有产生需要同步回 Overleaf 的文件改动。',
|
|
196
|
-
'No approved file changes remain to sync back to Overleaf.', '没有剩余已确认的文件改动需要同步回 Overleaf。',
|
|
197
|
-
'This run was Ask mode.', '这轮是只问不改。'
|
|
198
|
-
]);
|
|
199
|
-
|
|
200
|
-
// One summary line for the meta rows: what was written, whether it can be
|
|
201
|
-
// undone, and a pending save. The rows themselves stay behind the disclosure,
|
|
202
|
-
// which opens by itself only when something needs the user's attention.
|
|
203
|
-
function summarizeCompletionMeta(rows, run, { tx, failed = false, unconfirmed = false } = {}) {
|
|
204
|
-
const find = key => String(rows.find(row => row?.key === key)?.value || '').trim();
|
|
205
|
-
const counts = find('writeResult').match(/wrote (\d+) items?, skipped (\d+)|已写入 (\d+) 项,跳过 (\d+) 项/);
|
|
206
|
-
const wrote = Number(counts?.[1] ?? counts?.[3] ?? 0), skipped = Number(counts?.[2] ?? counts?.[4] ?? 0);
|
|
207
|
-
const reason = find('unchangedReason');
|
|
208
|
-
const undone = run?.undoStatus === 'applied' || run?.trackedChangeStatus === 'rejected';
|
|
209
|
-
const savePending = !undone && (Boolean(run?.saveCheck) || (!run?.saveConfirmedAt && /^(?:Pending|待确认)/.test(find('saveState'))));
|
|
210
|
-
const pendingCreatedUndo = run?.trackedChangeStatus === 'needs_review'
|
|
211
|
-
&& run.undoOperations?.some(operation => operation?.undoCreatedFile?.v === 1);
|
|
212
|
-
const facts = [];
|
|
213
|
-
if (failed) facts.push({ key: 'write', tone: 'fail', text: unconfirmed ? tx('Write not confirmed', '写入结果未确认') : tx('Write incomplete', '写入未完成') });
|
|
214
|
-
else if (wrote) facts.push({ key: 'write', text: tx(`Wrote ${wrote} item${wrote === 1 ? '' : 's'}`, `已写入 ${wrote} 项`) });
|
|
215
|
-
else if (reason && !GENERIC_UNCHANGED_REASONS.has(reason)) facts.push({ key: 'write', text: tx('Not written: ', '未写入:') + reason.replace(/[.。]$/, '') });
|
|
216
|
-
else facts.push({ key: 'write', text: tx('No files written', '未写入文件') });
|
|
217
|
-
if (skipped) facts.push({ key: 'skip', tone: 'warn', text: tx(`${skipped} skipped`, `跳过 ${skipped} 项`) });
|
|
218
|
-
const undoable = Number(find('undo').match(/(\d+)/)?.[1] || 0);
|
|
219
|
-
const undo = run?.undoStatus === 'running' || /^(?:Undoing changes\.\.\.|正在撤销修改…)$/.test(find('undo')) ? tx('Undoing…', '正在撤销…')
|
|
220
|
-
: run?.undoStatus === 'applied' || run?.trackedChangeStatus === 'rejected' ? tx('Changes undone', '已撤销本轮修改')
|
|
221
|
-
: run?.trackedChangeStatus === 'accepted' ? tx('Changes accepted', '修改已接受')
|
|
222
|
-
: pendingCreatedUndo || run?.undoStatus === 'partial'
|
|
223
|
-
? (hasUndoProgress(run) ? tx('Partly undone', '已撤销部分修改') : tx('Undo incomplete', '撤销未完成'))
|
|
224
|
-
: undoable ? tx(`${undoable} undoable`, `可撤销 ${undoable} 项`)
|
|
225
|
-
: failed ? '' : tx('Nothing to undo', '无可撤销写入');
|
|
226
|
-
if (undo) facts.push({ key: 'undo', text: undo });
|
|
227
|
-
if (savePending) facts.push({ key: 'save', tone: 'warn', text: tx('Save pending', '保存待确认') });
|
|
228
|
-
const attention = failed || skipped > 0;
|
|
229
|
-
const warnKeys = new Set([...(attention ? ['writeResult', 'nextStep'] : []), ...(savePending ? ['saveState'] : [])]);
|
|
230
|
-
return { facts, open: attention, warnKeys };
|
|
231
|
-
}
|
|
232
115
|
|
|
233
116
|
function projectUndoAvailability(run, projectRunSettlement) {
|
|
234
117
|
const payload = run.recoveryPayload && typeof run.recoveryPayload === 'object'
|