codex-overleaf-link 2.4.0 → 2.5.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 +272 -311
- package/README.zh-CN.md +287 -326
- package/extension/bootstrap/background.js +47 -10
- package/extension/bootstrap/manifest.template.json +9 -4
- package/extension/bootstrap/popup.html +10 -16
- package/extension/bootstrap/update.js +25 -2
- package/extension/runtime-manifest.json +3 -1
- package/extension/src/background.js +28 -3
- package/extension/src/backgroundSharedSessions.js +380 -0
- package/extension/src/backgroundUpdateCoordinator.js +442 -379
- package/extension/src/content/activeTurnControl.js +8 -0
- package/extension/src/content/assetTransferBroker.js +186 -12
- package/extension/src/content/changeHistoryView.js +175 -0
- package/extension/src/content/composerAttachments.js +24 -22
- package/extension/src/content/composerPanel.js +23 -8
- package/extension/src/content/contentRuntime.js +572 -571
- package/extension/src/content/diagnosticsController.js +1 -2
- package/extension/src/content/diagnosticsExport.js +222 -0
- package/extension/src/content/diagnosticsPanel.js +48 -19
- package/extension/src/content/diffReviewPanel.js +8 -5
- package/extension/src/content/generated/content.bundle.js +8974 -1781
- package/extension/src/content/generated/content.bundle.meta.json +22 -3
- package/extension/src/content/legacyGlobalRegistry.js +19 -1
- package/extension/src/content/localSkillsPanel.js +42 -7
- package/extension/src/content/markdownDomRenderer.js +9 -4
- package/extension/src/content/modelPicker.js +1 -1
- package/extension/src/content/pageBridgeClient.js +18 -3
- package/extension/src/content/panelMaintenance.js +51 -120
- package/extension/src/content/panelRenderer.js +4 -0
- package/extension/src/content/pendingInputView.js +109 -76
- package/extension/src/content/providerSettingsCoordinator.js +17 -6
- package/extension/src/content/providerSettingsDialog.js +661 -108
- package/extension/src/content/recentProjects.js +364 -356
- package/extension/src/content/runActivitySummary.js +631 -0
- package/extension/src/content/runController.js +3 -1
- package/extension/src/content/runFailureNotice.js +14 -1
- package/extension/src/content/runGuidanceController.js +4 -3
- package/extension/src/content/runPresence.js +306 -0
- package/extension/src/content/runQueueScheduler.js +2 -1
- package/extension/src/content/runResultActions.js +123 -3
- package/extension/src/content/runTimelineView.js +194 -164
- package/extension/src/content/scopedPersistenceCoordinator.js +2 -1
- package/extension/src/content/scopedPersistencePanelState.js +45 -2
- package/extension/src/content/selectionContextView.js +300 -0
- package/extension/src/content/sessionPersistence.js +10 -2
- package/extension/src/content/settingsPanel.js +93 -54
- package/extension/src/content/settingsWorkbench.js +374 -0
- package/extension/src/content/sharedSessionViewSync.js +72 -0
- package/extension/src/content/subagentActivityView.js +195 -0
- package/extension/src/content/trackedChangeCaptureController.js +7 -3
- package/extension/src/content/updateNotice.js +121 -50
- package/extension/src/content/writebackController.js +257 -0
- package/extension/src/content/writebackOrchestrator.js +146 -141
- package/extension/src/content/writebackPlan.js +231 -0
- package/extension/src/content/writebackRecovery.js +122 -0
- package/extension/src/content/writingStyleSettings.js +576 -0
- package/extension/src/content/writtenChangesView.js +152 -0
- package/extension/src/page/binaryAssetUploader.js +97 -19
- package/extension/src/page/overleafProjectSnapshot.js +1 -0
- package/extension/src/page/referenceProjects.js +148 -0
- package/extension/src/page/saveState.js +58 -3
- package/extension/src/page/snapshotRouter.js +44 -13
- package/extension/src/page/textCoordinates.js +102 -0
- package/extension/src/page/textFileCreator.js +350 -59
- package/extension/src/page/trackedChangeCapture.js +42 -56
- package/extension/src/page/trackedChangeOwnership.js +198 -0
- package/extension/src/page/trackedChangeReplay.js +164 -0
- package/extension/src/page/trackedChangesLifecycle.js +139 -150
- package/extension/src/page/treeOperations.js +36 -29
- package/extension/src/page/writebackReceiptJournal.js +112 -0
- package/extension/src/page/writebackRouter.js +176 -136
- package/extension/src/pageBridge.js +59 -101
- package/extension/src/popup.js +203 -59
- package/extension/src/shared/agentTranscript.js +18 -4
- package/extension/src/shared/auditRecords.js +71 -0
- package/extension/src/shared/changeHistoryModel.js +94 -0
- package/extension/src/shared/compatibility.js +1 -1
- package/extension/src/shared/compileAdapter.js +42 -0
- package/extension/src/shared/failureReasons.js +20 -0
- package/extension/src/shared/globalPreferences.js +1 -1
- package/extension/src/shared/i18n.js +187 -65
- package/extension/src/shared/managedUpdateProjection.js +6 -3
- package/extension/src/shared/pageRpcContract.js +7 -1
- package/extension/src/shared/providerProfiles.js +109 -0
- package/extension/src/shared/runActivityModel.js +361 -0
- package/extension/src/shared/runExecutionSnapshot.js +8 -2
- package/extension/src/shared/runExecutionSnapshotCodec.js +16 -4
- package/extension/src/shared/scopedPersistenceBrowserAdapter.js +6 -3
- package/extension/src/shared/selectionContext.js +28 -0
- package/extension/src/shared/sessionState.js +97 -6
- package/extension/src/shared/sharedSessionBridge.js +288 -0
- package/extension/src/shared/storageDb.js +23 -55
- package/extension/src/shared/storageMigration.js +3 -0
- package/extension/src/shared/storageRunActions.js +54 -4
- package/extension/src/shared/storageValuePruning.js +40 -0
- package/extension/src/shared/subagentActivityModel.js +174 -0
- package/extension/src/shared/undoOperations.js +87 -0
- package/extension/src/shared/updateConsent.js +37 -8
- package/extension/src/shared/writebackIntent.js +62 -0
- package/extension/src/shared/writebackSettlement.js +29 -10
- package/extension/src/shared/writingStyle.js +33 -0
- package/extension/styles/panel.css +2136 -744
- package/extension/styles/popup.css +110 -0
- package/native-host/src/anthropicBridgeRequest.js +2 -1
- package/native-host/src/codexModelRecovery.js +107 -0
- package/native-host/src/codexPromptAssembly.js +2 -0
- package/native-host/src/codexProviderLaunch.js +3 -3
- package/native-host/src/codexRuntimeIdentity.js +1 -0
- package/native-host/src/codexSessionRunner.js +146 -177
- package/native-host/src/codexSessionTiming.js +71 -0
- package/native-host/src/managedInstall.js +5 -4
- package/native-host/src/nativeEnvironment.js +70 -0
- package/native-host/src/nativeQuotas.js +15 -8
- package/native-host/src/overleafWorkspaceRules.js +16 -0
- package/native-host/src/processStopBarrier.js +80 -0
- package/native-host/src/providerModelCatalog.js +4 -3
- package/native-host/src/providerProfile.js +13 -1
- package/native-host/src/providerReasoning.js +9 -5
- package/native-host/src/providerStore.js +4 -0
- package/native-host/src/readProgressGuard.js +84 -17
- package/native-host/src/releaseTransport.js +14 -5
- package/native-host/src/selectionScope.js +58 -0
- package/native-host/src/skills/parallel-subagents/SKILL.md +31 -3
- package/native-host/src/skills/writing-style-builder/SKILL.md +146 -0
- package/native-host/src/subagentBroker.js +102 -98
- package/native-host/src/subagentTelemetry.js +316 -0
- package/native-host/src/subagentWorkspace.js +103 -0
- package/native-host/src/subagentWorkspacePath.js +31 -0
- package/native-host/src/taskRunnerRuntime.js +55 -5
- package/native-host/src/turnAttachments.js +113 -0
- package/native-host/src/updateManager.js +122 -12
- package/native-host/src/updateNetworkControl.js +75 -0
- package/native-host/src/updateTrust.js +21 -2
- package/native-host/src/vendor/pdfjs/LICENSE +177 -0
- package/native-host/src/vendor/pdfjs/SOURCE.txt +3 -0
- package/native-host/src/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/native-host/src/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/native-host/src/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
- package/native-host/src/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/LICENSE +36 -0
- package/native-host/src/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/pdf.mjs +26740 -0
- package/native-host/src/vendor/pdfjs/pdf.worker.mjs +62201 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +102 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/native-host/src/writingStyleEvidence.js +102 -0
- package/native-host/src/writingStylePdfWorker.js +35 -0
- package/native-host/src/writingStyleProfile.js +165 -0
- package/native-host/src/writingStyleRuntime.js +447 -0
- package/package.json +1 -1
|
@@ -63,6 +63,8 @@
|
|
|
63
63
|
let writebackSettlement;
|
|
64
64
|
let injectedWritebackSettlement;
|
|
65
65
|
let assetTransferBroker;
|
|
66
|
+
let stageWritebackRecovery;
|
|
67
|
+
let settleWritebackRecovery;
|
|
66
68
|
|
|
67
69
|
function buildSettlement(input = {}) {
|
|
68
70
|
return writebackSettlement?.settle instanceof Function
|
|
@@ -99,6 +101,8 @@
|
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
async function applySyncChangesToOverleaf(syncChanges = [], project = {}, options = {}) {
|
|
104
|
+
const activeRun = getCurrentRunView?.();
|
|
105
|
+
const saveTarget = { runProjectId: activeRun?.runProjectId || '', recordId: activeRun?.recordId || '', sessionId: activeRun?.sessionId || '' };
|
|
102
106
|
const runMode = options.mode || getState().mode;
|
|
103
107
|
const runRequireReviewing = typeof options.requireReviewing === 'boolean'
|
|
104
108
|
? options.requireReviewing
|
|
@@ -106,6 +110,20 @@
|
|
|
106
110
|
const assistantMessage = cleanFinalAnswer(options.assistantMessage || getAssistantAnswerForCurrentRun());
|
|
107
111
|
const unsupportedChanges = Array.isArray(options.unsupportedChanges) ? options.unsupportedChanges : [];
|
|
108
112
|
appendUnsupportedLocalChanges(unsupportedChanges);
|
|
113
|
+
const withheldOnly = unsupportedChanges.filter(change => ['subagent_unfinished_output', 'subagent_unauthorized_edit'].includes(change.reason));
|
|
114
|
+
if (runMode !== 'ask' && !syncChanges.length && withheldOnly.length) {
|
|
115
|
+
const skipped = withheldOnly.map(change => ({ operation: { type: 'create', path: change.path }, result: {
|
|
116
|
+
ok: false, code: change.reason, changedDocument: false,
|
|
117
|
+
reason: writebackController.formatUnsupportedLocalChangeReason(change, getLocale())
|
|
118
|
+
} }));
|
|
119
|
+
const applied = { ok: false, applied: [], skipped };
|
|
120
|
+
appendCompletionReport({ conclusion: assistantMessage || tx('Some generated files still need review.', '部分生成文件仍需核对。'),
|
|
121
|
+
status: 'failed', operations: [], applyResults: [applied], mode: runMode,
|
|
122
|
+
nextStep: tx('The main agent must review and adopt the withheld files before syncing them.', '主代理需核对并接管未同步文件后再写回。') });
|
|
123
|
+
return { summaryLine: tx('Generated files are awaiting review.', '生成文件待核对。'), hasSkippedOperations: true,
|
|
124
|
+
applied, settlement: buildSettlement({ operations: [], applyResult: applied }),
|
|
125
|
+
audit: buildAuditSummaryFromApply({ operations: [], applyResults: [applied], resultStatus: 'completed_with_skips' }) };
|
|
126
|
+
}
|
|
109
127
|
// Guard on the immutable submitted mode, not the mutable panel state.
|
|
110
128
|
if (options.mode === 'ask' && ((syncChanges || []).length || unsupportedChanges.length)) {
|
|
111
129
|
appendRunEvent({
|
|
@@ -312,6 +330,13 @@
|
|
|
312
330
|
})
|
|
313
331
|
};
|
|
314
332
|
}
|
|
333
|
+
const writebackActivityId = 'overleaf-writeback:' + Date.now().toString(36);
|
|
334
|
+
appendRunEvent({
|
|
335
|
+
title: tx('Syncing approved changes to Overleaf.', '正在将已批准的改动同步到 Overleaf。'),
|
|
336
|
+
status: 'running',
|
|
337
|
+
activity: { v: 1, kind: 'sync', id: writebackActivityId, state: 'running', paths: operations.map(operation => operation.path).filter(Boolean) }
|
|
338
|
+
});
|
|
339
|
+
await stageWritebackRecovery?.(operations, saveTarget, runRequireReviewing);
|
|
315
340
|
const applied = operations.length
|
|
316
341
|
? mergeApplyResultSkipped(await assetTransferBroker.applyOperations({
|
|
317
342
|
operations,
|
|
@@ -321,10 +346,19 @@
|
|
|
321
346
|
// Welcome-panel + write-guard:
|
|
322
347
|
// immutable per-run project id, checked by the page-side guard
|
|
323
348
|
// against `_ide.project._id` before any mutation.
|
|
324
|
-
runProjectId: getCurrentRunView()?.runProjectId || ''
|
|
349
|
+
runProjectId: getCurrentRunView()?.runProjectId || '',
|
|
350
|
+
retryCreates: options.retryCreates === true
|
|
325
351
|
}), additionalSkippedEntries)
|
|
326
352
|
: mergeApplyResultSkipped({ ok: true, applied: [], skipped: [] }, additionalSkippedEntries);
|
|
327
353
|
const hasConfirmedApplyResult = hasApplyResultEntries(applied);
|
|
354
|
+
for (const change of unsupportedChanges.filter(item => ['subagent_unfinished_output', 'subagent_unauthorized_edit'].includes(item.reason))) {
|
|
355
|
+
const reason = writebackController.formatUnsupportedLocalChangeReason(change, getLocale());
|
|
356
|
+
applied.skipped.push({ operation: { type: 'create', path: change.path }, result: { ok: false,
|
|
357
|
+
code: change.reason, reason, changedDocument: false, failure: { code: change.reason,
|
|
358
|
+
stage: 'preflight', severity: 'blocked', retryable: false, terminalState: 'blocked', changedDocument: false,
|
|
359
|
+
userMessage: reason, nextAction: 'The main agent must review the withheld file before syncing it.' } } });
|
|
360
|
+
applied.ok = false;
|
|
361
|
+
}
|
|
328
362
|
// Record the apply result + undo checkpoint IMMEDIATELY, before any
|
|
329
363
|
// cancellable verify/mirror awaits below. A user-cancel during the
|
|
330
364
|
// post-write save-verify or mirror refresh throws codex_cancelled; if undo
|
|
@@ -342,36 +376,37 @@
|
|
|
342
376
|
renderReadOnlyDiffReview(getAppliedSyncChanges(syncChanges, applied));
|
|
343
377
|
}
|
|
344
378
|
const appliedPaths = getAppliedOperationPaths(applied);
|
|
379
|
+
appendRunEvent({
|
|
380
|
+
title: tx('Overleaf writeback returned its result.', 'Overleaf 写回已返回结果。'),
|
|
381
|
+
status: !hasConfirmedApplyResult || skippedEntries.length ? 'warning' : 'completed',
|
|
382
|
+
activity: { v: 1, kind: 'sync', id: writebackActivityId,
|
|
383
|
+
state: !hasConfirmedApplyResult || skippedEntries.length ? 'warning' : 'completed',
|
|
384
|
+
paths: operations.map(operation => operation.path).filter(Boolean),
|
|
385
|
+
written: appliedPaths.length, skipped: skippedEntries.length }
|
|
386
|
+
});
|
|
345
387
|
// Only probe save-state + refresh the mirror when real writes landed. A
|
|
346
388
|
// zero-write run (every operation skipped) has nothing to save-verify, so
|
|
347
389
|
// skip the ~5s probe and its misleading "could not verify saved" warning
|
|
348
390
|
// (v1.6.2).
|
|
349
|
-
const
|
|
350
|
-
? await verifyPostWriteSaveState()
|
|
351
|
-
: {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
reason: 'No applied writeback operations were returned.'
|
|
355
|
-
};
|
|
391
|
+
const confirmation = appliedPaths.length
|
|
392
|
+
? await verifyPostWriteSaveState(applied, project, saveTarget)
|
|
393
|
+
: { verification: { ok: false, state: 'not_checked', reason: 'No applied writeback operations were returned.' } };
|
|
394
|
+
const saveVerification = confirmation.verification;
|
|
395
|
+
await settleWritebackRecovery?.(applied, project, saveVerification, saveTarget);
|
|
356
396
|
if (appliedPaths.length) {
|
|
357
|
-
appendPostWriteSaveVerificationWarning(saveVerification);
|
|
397
|
+
appendPostWriteSaveVerificationWarning(saveVerification, saveTarget);
|
|
398
|
+
appendRunEvent({ kind: 'technical', title: 'Post-write save confirmation', status: 'info', detail: saveVerification });
|
|
358
399
|
}
|
|
359
400
|
// v1.7.5: the mirror refresh (zip snapshot + mirror.sync, often the
|
|
360
401
|
// slowest post-write step) no longer blocks the completion report. The
|
|
361
402
|
// pending promise is exposed so undoRun and the next runTask barrier on
|
|
362
403
|
// it — a mirror.sync landing AFTER an undo would otherwise push the
|
|
363
404
|
// pre-undo snapshot as the local baseline.
|
|
364
|
-
const mirrorSettlementTarget =
|
|
365
|
-
pendingMirrorRefresh = refreshProjectMirrorAfterWriteback(project, applied, saveVerification)
|
|
366
|
-
.catch(error => {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
`Overleaf was written, but the background workspace refresh failed: ${error.message}. The next run will reread the project.`,
|
|
370
|
-
`Overleaf 已写入,但后台刷新本地 workspace 失败:${error.message}。下一轮会重新读取项目。`
|
|
371
|
-
),
|
|
372
|
-
status: 'failed'
|
|
373
|
-
});
|
|
374
|
-
return 'failed';
|
|
405
|
+
const mirrorSettlementTarget = saveTarget;
|
|
406
|
+
pendingMirrorRefresh = refreshProjectMirrorAfterWriteback(project, applied, saveVerification, { target: saveTarget, snapshot: confirmation.snapshot })
|
|
407
|
+
.catch(async error => {
|
|
408
|
+
appendRunRecordEvent(saveTarget.recordId, { kind: 'technical', title: 'Mirror refresh requires a fresh read', status: 'info', detail: { reason: error.message } });
|
|
409
|
+
return invalidateWritebackMirror(saveTarget);
|
|
375
410
|
})
|
|
376
411
|
.then(state => {
|
|
377
412
|
if (typeof onMirrorRefreshSettled !== 'function') return;
|
|
@@ -388,7 +423,8 @@
|
|
|
388
423
|
const compileSummary = appliedPaths.length
|
|
389
424
|
? await autoRecompileAfterWriteback(appliedPaths, saveVerification, {
|
|
390
425
|
autoRecompile: options.autoRecompile,
|
|
391
|
-
mode: runMode
|
|
426
|
+
mode: runMode,
|
|
427
|
+
runProjectId: saveTarget.runProjectId
|
|
392
428
|
}).catch(error => {
|
|
393
429
|
appendRunEvent({
|
|
394
430
|
title: tx(`Post-write compile failed: ${error.message}`, `写后编译出错:${error.message}`),
|
|
@@ -435,6 +471,7 @@
|
|
|
435
471
|
compileErrors: compileSummary?.status === 'failed' && Array.isArray(compileSummary.errors)
|
|
436
472
|
? compileSummary.errors
|
|
437
473
|
: undefined,
|
|
474
|
+
saveVerification,
|
|
438
475
|
// Promote the primary per-operation skip failure to the run level when
|
|
439
476
|
// the writeback failed outright: target-file and write-stage codes only
|
|
440
477
|
// ever exist inside applied.skipped[], and without this promotion the
|
|
@@ -475,57 +512,60 @@
|
|
|
475
512
|
};
|
|
476
513
|
}
|
|
477
514
|
|
|
478
|
-
async function verifyPostWriteSaveState() {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
return {
|
|
493
|
-
...result,
|
|
494
|
-
ok: false,
|
|
495
|
-
state: 'verified_quiet'
|
|
496
|
-
};
|
|
497
|
-
}
|
|
498
|
-
if (result?.state === 'unknown_timeout' || result?.state === 'unavailable') {
|
|
499
|
-
return {
|
|
500
|
-
...result,
|
|
501
|
-
ok: false
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
return {
|
|
505
|
-
...result,
|
|
506
|
-
ok: false,
|
|
507
|
-
state: 'unknown_timeout'
|
|
508
|
-
};
|
|
509
|
-
} catch (error) {
|
|
510
|
-
return {
|
|
511
|
-
ok: false,
|
|
512
|
-
state: 'unavailable',
|
|
513
|
-
reason: error.message
|
|
514
|
-
};
|
|
515
|
-
}
|
|
515
|
+
async function verifyPostWriteSaveState(applied, project, target = {}) {
|
|
516
|
+
return writebackController.confirmPostWriteSave({
|
|
517
|
+
applied, project, runProjectId: target.runProjectId,
|
|
518
|
+
assertCurrent() {
|
|
519
|
+
if (!target.runProjectId || getCurrentProjectId() !== target.runProjectId) {
|
|
520
|
+
throw Object.assign(new Error('The Overleaf project changed during save confirmation.'), { code: 'aborted_project_changed', changedDocument: true });
|
|
521
|
+
}
|
|
522
|
+
if (target.recordId && getCurrentRunView()?.recordId !== target.recordId) {
|
|
523
|
+
throw Object.assign(new Error('The run stopped during save confirmation.'), { code: 'codex_cancelled', changedDocument: true });
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
readSaveState: params => callPageBridge('waitForSaveState', { ...params, runProjectId: target.runProjectId }),
|
|
527
|
+
readSnapshot: params => callPageBridge('getProjectSnapshot', { ...params, runProjectId: target.runProjectId })
|
|
528
|
+
});
|
|
516
529
|
}
|
|
517
530
|
|
|
518
|
-
function appendPostWriteSaveVerificationWarning(saveVerification = {}) {
|
|
519
|
-
if (saveVerification
|
|
520
|
-
|
|
531
|
+
function appendPostWriteSaveVerificationWarning(saveVerification = {}, target = {}) {
|
|
532
|
+
if (saveVerification.state === 'verified_saved') return;
|
|
533
|
+
// Missing confirmation is represented once in the report, with a check action.
|
|
534
|
+
if (saveVerification.signal !== 'offline') return;
|
|
535
|
+
const title = saveVerification.signal === 'offline'
|
|
536
|
+
? tx('Overleaf is offline. Keep this page open and reconnect so the changes can be saved.',
|
|
537
|
+
'Overleaf 当前离线。请保持页面开启,恢复连接后等待改动保存。')
|
|
538
|
+
: tx('Saving these changes is not yet confirmed. Keep this page open and check Overleaf’s save and connection status.',
|
|
539
|
+
'尚未确认本次改动已保存。请保持页面开启,检查 Overleaf 的保存和连接状态。');
|
|
540
|
+
if (target.recordId) appendRunRecordEvent(target.recordId, { title, status: 'warning' });
|
|
541
|
+
else appendRunEvent({ title, status: 'warning' });
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
async function invalidateWritebackMirror(target = {}) {
|
|
545
|
+
let invalidated = false;
|
|
546
|
+
try {
|
|
547
|
+
if (target.runProjectId) {
|
|
548
|
+
const response = await sendBackgroundNative({ method: 'mirror.invalidate', params: { projectId: target.runProjectId } });
|
|
549
|
+
invalidated = response?.ok === true && response.result?.invalidated === true;
|
|
550
|
+
}
|
|
551
|
+
} catch (_error) { /* An unavailable host cannot acknowledge invalidation. */ }
|
|
552
|
+
let pageInvalidated = getCurrentProjectId() !== target.runProjectId;
|
|
553
|
+
if (!pageInvalidated) {
|
|
554
|
+
resetContextProject();
|
|
555
|
+
try {
|
|
556
|
+
const response = await callPageBridge('invalidateProjectSnapshot', { invalidateFileList: true, runProjectId: target.runProjectId });
|
|
557
|
+
pageInvalidated = response?.ok === true;
|
|
558
|
+
} catch (_error) { /* Leave the failure visible if both caches cannot be fenced. */ }
|
|
521
559
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
'
|
|
526
|
-
),
|
|
560
|
+
if (invalidated && pageInvalidated) return 'not-attempted';
|
|
561
|
+
const event = {
|
|
562
|
+
title: tx('The local project cache could not be reset. Check the local connection before starting another task.',
|
|
563
|
+
'本地项目缓存未能重置。请检查本地连接后再开始下一轮任务。'),
|
|
527
564
|
status: 'warning'
|
|
528
|
-
}
|
|
565
|
+
};
|
|
566
|
+
if (target.recordId) appendRunRecordEvent(target.recordId, event);
|
|
567
|
+
else appendRunEvent(event);
|
|
568
|
+
return 'failed';
|
|
529
569
|
}
|
|
530
570
|
|
|
531
571
|
// v1.8.0: text-only writebacks confirm the mirror in place. The written
|
|
@@ -537,7 +577,7 @@
|
|
|
537
577
|
// method — falls back to the full zip resync below.
|
|
538
578
|
const MIRROR_CONFIRMABLE_OPERATION_TYPES = new Set(['edit']);
|
|
539
579
|
|
|
540
|
-
async function tryConfirmMirrorWriteback(applied) {
|
|
580
|
+
async function tryConfirmMirrorWriteback(applied, runProjectId) {
|
|
541
581
|
const entries = Array.isArray(applied?.applied) ? applied.applied : [];
|
|
542
582
|
if (!entries.length) {
|
|
543
583
|
return false;
|
|
@@ -554,7 +594,7 @@
|
|
|
554
594
|
const response = await sendBackgroundNative({
|
|
555
595
|
method: 'mirror.confirmWriteback',
|
|
556
596
|
params: {
|
|
557
|
-
projectId:
|
|
597
|
+
projectId: runProjectId,
|
|
558
598
|
paths: Array.from(new Set(paths))
|
|
559
599
|
}
|
|
560
600
|
});
|
|
@@ -564,15 +604,16 @@
|
|
|
564
604
|
}
|
|
565
605
|
}
|
|
566
606
|
|
|
567
|
-
async function refreshProjectMirrorAfterWriteback(project = {}, applied = {}, saveVerification = {}) {
|
|
607
|
+
async function refreshProjectMirrorAfterWriteback(project = {}, applied = {}, saveVerification = {}, confirmation = {}) {
|
|
608
|
+
const target = confirmation.target || {};
|
|
568
609
|
if (saveVerification?.state !== 'verified_saved') {
|
|
569
|
-
return
|
|
610
|
+
return invalidateWritebackMirror(target);
|
|
570
611
|
}
|
|
571
612
|
if (!Array.isArray(applied?.applied) || !applied.applied.length) {
|
|
572
613
|
return 'not-attempted';
|
|
573
614
|
}
|
|
574
615
|
|
|
575
|
-
if (await tryConfirmMirrorWriteback(applied)) {
|
|
616
|
+
if (!confirmation.snapshot && await tryConfirmMirrorWriteback(applied, target.runProjectId)) {
|
|
576
617
|
appendRunEvent({
|
|
577
618
|
title: tx(
|
|
578
619
|
'Local Codex workspace confirmed in place (no project re-download needed). The next run starts from the latest content.',
|
|
@@ -588,10 +629,13 @@
|
|
|
588
629
|
status: 'running'
|
|
589
630
|
});
|
|
590
631
|
|
|
591
|
-
|
|
632
|
+
if (!target.runProjectId || getCurrentProjectId() !== target.runProjectId) return invalidateWritebackMirror(target);
|
|
633
|
+
if (!confirmation.snapshot) await callPageBridge('invalidateProjectSnapshot', {
|
|
634
|
+
runProjectId: target.runProjectId,
|
|
592
635
|
invalidateFileList: true
|
|
593
636
|
});
|
|
594
|
-
const freshProject = sanitizeRunProjectSnapshot(await callPageBridge('getProjectSnapshot', {
|
|
637
|
+
const freshProject = confirmation.snapshot || sanitizeRunProjectSnapshot(await callPageBridge('getProjectSnapshot', {
|
|
638
|
+
runProjectId: target.runProjectId,
|
|
595
639
|
force: true,
|
|
596
640
|
maxAgeMs: 0,
|
|
597
641
|
preferLightweight: true,
|
|
@@ -603,23 +647,18 @@
|
|
|
603
647
|
zipTimeoutMs: RUN_SNAPSHOT_ZIP_TIMEOUT_MS,
|
|
604
648
|
focusFiles: getAppliedOperationPaths(applied)
|
|
605
649
|
}));
|
|
606
|
-
if (
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
'Overleaf 已写入,但没有读到完整项目;暂不刷新本地 Codex workspace baseline,下一轮会重新读取。'
|
|
611
|
-
),
|
|
612
|
-
status: 'failed'
|
|
613
|
-
});
|
|
614
|
-
return 'failed';
|
|
650
|
+
if (getCurrentProjectId() !== target.runProjectId || freshProject?.id !== target.runProjectId
|
|
651
|
+
|| !freshProject?.files?.length || freshProject?.capabilities?.fullProjectSnapshot === false
|
|
652
|
+
|| freshProject?.capabilities?.skipped?.length) {
|
|
653
|
+
return invalidateWritebackMirror(target);
|
|
615
654
|
}
|
|
616
655
|
|
|
617
|
-
const syncedProject = mergeVerifiedAppliedFiles(freshProject, project, applied);
|
|
656
|
+
const syncedProject = confirmation.snapshot || mergeVerifiedAppliedFiles(freshProject, project, applied);
|
|
618
657
|
resetContextProject();
|
|
619
658
|
const response = await sendBackgroundNative({
|
|
620
659
|
method: 'mirror.sync',
|
|
621
660
|
params: {
|
|
622
|
-
projectId:
|
|
661
|
+
projectId: target.runProjectId,
|
|
623
662
|
project: syncedProject
|
|
624
663
|
}
|
|
625
664
|
});
|
|
@@ -631,15 +670,7 @@
|
|
|
631
670
|
return 'complete';
|
|
632
671
|
}
|
|
633
672
|
|
|
634
|
-
|
|
635
|
-
appendRunEvent({
|
|
636
|
-
title: tx(
|
|
637
|
-
`Overleaf was written, but refreshing the local workspace failed: ${message}`,
|
|
638
|
-
`Overleaf 已写入,但刷新本地 workspace 失败:${message}`
|
|
639
|
-
),
|
|
640
|
-
status: 'failed'
|
|
641
|
-
});
|
|
642
|
-
return 'failed';
|
|
673
|
+
return invalidateWritebackMirror(target);
|
|
643
674
|
}
|
|
644
675
|
|
|
645
676
|
function mergeVerifiedAppliedFiles(freshProject = {}, originalProject = {}, applied = {}) {
|
|
@@ -660,6 +691,8 @@
|
|
|
660
691
|
return writebackController.formatUnsupportedLocalChangeSummary(changes, getLocale());
|
|
661
692
|
}
|
|
662
693
|
|
|
694
|
+
const serverProvenSave = verification => ['overleaf-zip', 'server-receipts'].includes(verification?.source);
|
|
695
|
+
|
|
663
696
|
async function autoRecompileAfterWriteback(writtenPaths = [], saveVerification = {}, options = {}) {
|
|
664
697
|
if (options.autoRecompile === false
|
|
665
698
|
|| (options.autoRecompile === undefined && getState().autoRecompile === false)) return null;
|
|
@@ -671,7 +704,10 @@
|
|
|
671
704
|
const hasCompilableFile = writtenPaths.some(filePath => CompileAdapter.isCompilableFile(filePath));
|
|
672
705
|
if (!hasCompilableFile) return null;
|
|
673
706
|
|
|
707
|
+
const compileActivityId = 'overleaf-compile:' + Date.now().toString(36);
|
|
708
|
+
const activity = (state, output = '') => ({ v: 1, kind: 'compile', id: compileActivityId, state, target: 'Overleaf', output });
|
|
674
709
|
appendRunEvent({
|
|
710
|
+
activity: activity('running'),
|
|
675
711
|
title: saveVerification?.state !== 'verified_saved'
|
|
676
712
|
? tx(
|
|
677
713
|
'Post-write compile: Overleaf save was not verified, but Auto Compile is on. Triggering Overleaf Recompile and letting Overleaf wait for the latest save.',
|
|
@@ -687,9 +723,10 @@
|
|
|
687
723
|
try {
|
|
688
724
|
const result = await callPageBridge('triggerCompile', {
|
|
689
725
|
preferUiClick: true,
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
726
|
+
// Server-side proof (ZIP or save receipts) already settles the save; don't also demand the UI indicator.
|
|
727
|
+
waitForSaveMs: serverProvenSave(saveVerification) ? 0 : 5000,
|
|
728
|
+
requireVerifiedSave: saveVerification?.state === 'verified_saved' && !serverProvenSave(saveVerification),
|
|
729
|
+
runProjectId: options.runProjectId || getCurrentRunView()?.runProjectId || getCurrentProjectId()
|
|
693
730
|
});
|
|
694
731
|
if (result?.ok) {
|
|
695
732
|
let logResult = null;
|
|
@@ -698,64 +735,34 @@
|
|
|
698
735
|
triggerIfStale: false,
|
|
699
736
|
maxAgeMs: 30000,
|
|
700
737
|
waitForSaveMs: 0,
|
|
701
|
-
runProjectId: getCurrentRunView()?.runProjectId || getCurrentProjectId()
|
|
738
|
+
runProjectId: options.runProjectId || getCurrentRunView()?.runProjectId || getCurrentProjectId()
|
|
702
739
|
});
|
|
703
740
|
} catch (_error) {
|
|
704
741
|
logResult = null;
|
|
705
742
|
}
|
|
706
743
|
const compile = result.compile;
|
|
707
744
|
if (compile?.status === 'success') {
|
|
708
|
-
appendRunEvent({ title: tx('Compile succeeded.', '编译成功。'), status: 'completed'
|
|
745
|
+
appendRunEvent({ title: tx('Compile succeeded.', '编译成功。'), status: 'completed',
|
|
746
|
+
activity: activity('completed', [...(logResult?.errors || []), ...(logResult?.warnings || [])].slice(0, 5).map(CompileAdapter.formatCompileDiagnosticForSummary).join('\n')) });
|
|
709
747
|
} else if (compile?.status === 'triggered') {
|
|
710
|
-
appendRunEvent({ title: tx('Overleaf compile was triggered. The page will continue showing progress.', '已触发 Overleaf 编译;页面会继续显示编译进度。'), status: 'completed' });
|
|
748
|
+
appendRunEvent({ title: tx('Overleaf compile was triggered. The page will continue showing progress.', '已触发 Overleaf 编译;页面会继续显示编译进度。'), status: 'completed', activity: activity('triggered') });
|
|
711
749
|
} else {
|
|
712
|
-
appendRunEvent({ title: tx(`Compile finished with status: ${compile?.status || 'unknown'}`, `编译完成,状态:${compile?.status || '未知'}`), status: 'completed' });
|
|
750
|
+
appendRunEvent({ title: tx(`Compile finished with status: ${compile?.status || 'unknown'}`, `编译完成,状态:${compile?.status || '未知'}`), status: 'completed', activity: activity(compile?.status === 'failed' ? 'failed' : 'unknown') });
|
|
713
751
|
}
|
|
714
752
|
return buildPostWriteCompileSummary({ result, logResult });
|
|
715
753
|
} else {
|
|
716
754
|
const reason = result?.reason || tx('unknown reason', '未知原因');
|
|
717
|
-
appendRunEvent({ title: tx(`Post-write compile did not succeed: ${reason}`, `写后编译未成功:${reason}`), status: 'failed' });
|
|
755
|
+
appendRunEvent({ title: tx(`Post-write compile did not succeed: ${reason}`, `写后编译未成功:${reason}`), status: 'failed', activity: activity('failed', reason) });
|
|
718
756
|
return buildPostWriteCompileSummary({ result });
|
|
719
757
|
}
|
|
720
758
|
} catch (error) {
|
|
721
|
-
appendRunEvent({ title: tx(`Post-write compile failed: ${error.message}`, `写后编译出错:${error.message}`), status: 'failed' });
|
|
759
|
+
appendRunEvent({ title: tx(`Post-write compile failed: ${error.message}`, `写后编译出错:${error.message}`), status: 'failed', activity: activity('failed', error.message) });
|
|
722
760
|
return buildPostWriteCompileSummary({ error });
|
|
723
761
|
}
|
|
724
762
|
}
|
|
725
763
|
|
|
726
|
-
function buildPostWriteCompileSummary(
|
|
727
|
-
|
|
728
|
-
const errors = logAvailable && Array.isArray(logResult.errors)
|
|
729
|
-
? logResult.errors.slice(0, 5).map(formatCompileDiagnosticForSummary)
|
|
730
|
-
: [];
|
|
731
|
-
const warnings = logAvailable && Array.isArray(logResult.warnings)
|
|
732
|
-
? logResult.warnings.slice(0, 5).map(formatCompileDiagnosticForSummary)
|
|
733
|
-
: [];
|
|
734
|
-
if (error) {
|
|
735
|
-
return {
|
|
736
|
-
status: 'failed',
|
|
737
|
-
reason: error?.message || 'Post-write compile failed.',
|
|
738
|
-
errors,
|
|
739
|
-
warnings,
|
|
740
|
-
logAvailable
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
if (!result?.ok) {
|
|
744
|
-
return {
|
|
745
|
-
status: 'failed',
|
|
746
|
-
reason: result?.reason || 'Post-write compile did not succeed.',
|
|
747
|
-
errors,
|
|
748
|
-
warnings,
|
|
749
|
-
logAvailable
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
return {
|
|
753
|
-
status: result.compile?.status || 'triggered',
|
|
754
|
-
reason: result.reason || '',
|
|
755
|
-
errors,
|
|
756
|
-
warnings,
|
|
757
|
-
logAvailable
|
|
758
|
-
};
|
|
764
|
+
function buildPostWriteCompileSummary(input = {}) {
|
|
765
|
+
return compileAdapter.buildPostWriteCompileSummary(input);
|
|
759
766
|
}
|
|
760
767
|
|
|
761
768
|
// First structured per-operation failure among the skipped writeback
|
|
@@ -813,10 +820,6 @@
|
|
|
813
820
|
return [conclusion, '', summary].filter(Boolean).join('\n');
|
|
814
821
|
}
|
|
815
822
|
|
|
816
|
-
function formatCompileDiagnosticForSummary(value) {
|
|
817
|
-
const text = String(value || '').replace(/\s+/g, ' ').trim();
|
|
818
|
-
return text.length > 180 ? `${text.slice(0, 179)}...` : text;
|
|
819
|
-
}
|
|
820
823
|
|
|
821
824
|
async function resolveCompileLogContext() {
|
|
822
825
|
try {
|
|
@@ -891,6 +894,8 @@
|
|
|
891
894
|
getCurrentRunView,
|
|
892
895
|
} = deps);
|
|
893
896
|
assetTransferBroker = deps.assetTransferBroker;
|
|
897
|
+
stageWritebackRecovery = deps.stageWritebackRecovery;
|
|
898
|
+
settleWritebackRecovery = deps.settleWritebackRecovery;
|
|
894
899
|
onMirrorRefreshSettled = deps.onMirrorRefreshSettled;
|
|
895
900
|
writebackSettlement = deps.writebackSettlement;
|
|
896
901
|
compileAdapter = deps.compileAdapter;
|