codex-overleaf-link 2.4.1 → 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 +275 -305
- package/README.zh-CN.md +290 -320
- package/extension/bootstrap/background.js +99 -19
- package/extension/bootstrap/manifest.template.json +9 -4
- package/extension/bootstrap/popup.html +11 -16
- package/extension/bootstrap/popupFallback.js +55 -0
- package/extension/bootstrap/update.js +25 -2
- package/extension/bootstrap/updateStatus.js +1 -0
- package/extension/runtime-manifest.json +3 -1
- package/extension/src/background.js +234 -56
- package/extension/src/backgroundBootstrapMigration.js +181 -0
- package/extension/src/backgroundSharedSessions.js +440 -0
- package/extension/src/backgroundUpdateCoordinator.js +541 -381
- package/extension/src/backgroundUpdateSafety.js +173 -0
- package/extension/src/content/activeTurnControl.js +16 -2
- package/extension/src/content/applyResultFormatters.js +46 -73
- package/extension/src/content/assetTransferBroker.js +244 -12
- package/extension/src/content/changeHistoryView.js +175 -0
- package/extension/src/content/composerAttachments.js +117 -67
- package/extension/src/content/composerPanel.js +41 -8
- package/extension/src/content/contentRuntime.js +1084 -1099
- package/extension/src/content/diagnosticsController.js +122 -97
- package/extension/src/content/diagnosticsExport.js +236 -0
- package/extension/src/content/diagnosticsPanel.js +78 -19
- package/extension/src/content/diffReviewPanel.js +8 -5
- package/extension/src/content/directoryCleanupRecovery.js +54 -0
- package/extension/src/content/generated/content.bundle.js +14680 -3606
- package/extension/src/content/generated/content.bundle.meta.json +30 -3
- package/extension/src/content/globalPreferencesController.js +1 -1
- package/extension/src/content/legacyGlobalRegistry.js +25 -1
- package/extension/src/content/localSkillsPanel.js +141 -16
- package/extension/src/content/markdownDomRenderer.js +9 -4
- package/extension/src/content/markdownText.js +5 -6
- package/extension/src/content/modelPicker.js +8 -5
- 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 +33 -5
- package/extension/src/content/panelMaintenance.js +87 -132
- package/extension/src/content/panelRenderer.js +10 -0
- package/extension/src/content/pendingInputView.js +109 -76
- 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 +63 -14
- package/extension/src/content/providerSettingsDialog.js +724 -113
- package/extension/src/content/recentProjects.js +21 -6
- package/extension/src/content/runActivitySummary.js +665 -0
- package/extension/src/content/runCompletionMeta.js +344 -0
- package/extension/src/content/runController.js +40 -15
- package/extension/src/content/runFailureNotice.js +34 -12
- package/extension/src/content/runGuidanceController.js +76 -30
- package/extension/src/content/runGuidanceView.js +59 -10
- package/extension/src/content/runPresence.js +306 -0
- package/extension/src/content/runQueueScheduler.js +150 -43
- package/extension/src/content/runRecoveryActions.js +146 -0
- package/extension/src/content/runResultActions.js +11 -8
- package/extension/src/content/runReviewController.js +574 -0
- package/extension/src/content/runScrollLayout.js +21 -2
- package/extension/src/content/runTimelineView.js +315 -290
- package/extension/src/content/scopedPersistencePanelState.js +51 -6
- package/extension/src/content/selectionContextView.js +300 -0
- 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/sessionPersistence.js +6 -1
- package/extension/src/content/settingsPanel.js +84 -55
- package/extension/src/content/settingsWorkbench.js +379 -0
- package/extension/src/content/sharedSessionViewSync.js +109 -0
- package/extension/src/content/subagentActivityView.js +195 -0
- package/extension/src/content/trackedChangeCaptureController.js +7 -3
- package/extension/src/content/updateIdle.js +4 -1
- package/extension/src/content/updateNotice.js +179 -56
- package/extension/src/content/updateSafetyReceiver.js +58 -0
- package/extension/src/content/writebackController.js +308 -2
- package/extension/src/content/writebackOrchestrator.js +213 -199
- package/extension/src/content/writebackPlan.js +231 -0
- package/extension/src/content/writebackRecovery.js +122 -0
- package/extension/src/content/writingStyleSettings.js +600 -0
- package/extension/src/content/writtenChangesView.js +152 -0
- package/extension/src/page/binaryAssetUploader.js +223 -23
- package/extension/src/page/fileMover.js +256 -0
- package/extension/src/page/overleafProjectSnapshot.js +1 -0
- package/extension/src/page/ownedDirectoryCleanup.js +94 -0
- package/extension/src/page/referenceProjects.js +149 -0
- package/extension/src/page/reviewContext.js +113 -0
- package/extension/src/page/saveState.js +20 -6
- package/extension/src/page/snapshotRouter.js +124 -48
- package/extension/src/page/textCoordinates.js +102 -0
- package/extension/src/page/textFileCreator.js +442 -71
- package/extension/src/page/trackedChangeCapture.js +53 -57
- package/extension/src/page/trackedChangeOwnership.js +216 -0
- package/extension/src/page/trackedChangeReplay.js +184 -0
- package/extension/src/page/trackedChangesLifecycle.js +343 -339
- package/extension/src/page/treeOperations.js +33 -12
- package/extension/src/page/updateSafetyProbe.js +41 -0
- package/extension/src/page/writebackReceiptJournal.js +114 -0
- package/extension/src/page/writebackRouter.js +242 -201
- package/extension/src/pageBridge.js +73 -102
- package/extension/src/popup.js +261 -65
- package/extension/src/shared/agentTranscript.js +41 -4
- package/extension/src/shared/auditRecords.js +73 -0
- package/extension/src/shared/changeHistoryModel.js +94 -0
- package/extension/src/shared/compatibility.js +22 -6
- package/extension/src/shared/compileAdapter.js +101 -37
- package/extension/src/shared/composerAttachmentDraft.js +151 -0
- package/extension/src/shared/directoryCleanupProof.js +43 -0
- package/extension/src/shared/failureReasons.js +329 -3
- package/extension/src/shared/globalPreferences.js +31 -14
- package/extension/src/shared/governanceRules.js +4 -37
- package/extension/src/shared/i18n.js +389 -25
- package/extension/src/shared/managedUpdateProjection.js +8 -5
- package/extension/src/shared/nativeRequestIdentity.js +1 -0
- package/extension/src/shared/pageRpcContract.js +9 -2
- package/extension/src/shared/projectFiles.js +21 -44
- package/extension/src/shared/providerProfiles.js +114 -3
- 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/runInputQueue.js +48 -5
- package/extension/src/shared/scopedPersistenceBrowserAdapter.js +6 -3
- package/extension/src/shared/selectionContext.js +37 -0
- package/extension/src/shared/sessionState.js +166 -30
- package/extension/src/shared/settlementFacts.js +10 -2
- package/extension/src/shared/sharedSessionBridge.js +311 -0
- package/extension/src/shared/sharedSessionTransfer.js +140 -0
- package/extension/src/shared/staleGuard.js +118 -13
- package/extension/src/shared/storageDb.js +77 -78
- package/extension/src/shared/storageMigration.js +74 -111
- package/extension/src/shared/storageRunActions.js +211 -22
- package/extension/src/shared/storageValuePruning.js +40 -0
- package/extension/src/shared/subagentActivityModel.js +174 -0
- package/extension/src/shared/undoOperations.js +216 -6
- package/extension/src/shared/updateConsent.js +42 -11
- package/extension/src/shared/updateRuntimeIdentity.js +1 -1
- package/extension/src/shared/writebackIntent.js +78 -0
- package/extension/src/shared/writebackOperationEvidence.js +4 -15
- package/extension/src/shared/writebackSettlement.js +67 -48
- package/extension/src/shared/writingStyle.js +33 -0
- package/extension/styles/panel.css +1987 -385
- package/extension/styles/popup.css +110 -0
- package/native-host/src/anthropicBridgeRequest.js +6 -3
- 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/codexModelRecovery.js +107 -0
- package/native-host/src/codexPromptAssembly.js +33 -12
- package/native-host/src/codexProviderLaunch.js +3 -3
- package/native-host/src/codexProviderTest.js +24 -26
- package/native-host/src/codexRuntimeIdentity.js +1 -0
- package/native-host/src/codexSessionRunner.js +211 -318
- package/native-host/src/codexSessionTiming.js +21 -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 +115 -39
- 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/nativeEnvironment.js +70 -0
- package/native-host/src/nativeHelperLifecycle.js +21 -0
- package/native-host/src/nativeHostRegistration.js +33 -0
- package/native-host/src/nativeQuotas.js +15 -8
- package/native-host/src/nativeRunLifecycle.js +71 -0
- package/native-host/src/overleafWorkspaceRules.js +16 -0
- package/native-host/src/processStopBarrier.js +115 -0
- package/native-host/src/projectPathPlatform.js +30 -0
- package/native-host/src/providerHttp.js +80 -0
- package/native-host/src/providerModelCatalog.js +4 -3
- package/native-host/src/providerProfile.js +17 -3
- package/native-host/src/providerReasoning.js +10 -11
- package/native-host/src/providerRuntime.js +1 -0
- package/native-host/src/providerStore.js +76 -14
- package/native-host/src/releaseTransport.js +14 -5
- package/native-host/src/responsesPassthroughBridge.js +266 -52
- package/native-host/src/runtimeInstaller.js +21 -1
- package/native-host/src/selectionScope.js +86 -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/subagentAdmission.js +26 -0
- package/native-host/src/subagentBroker.js +176 -159
- package/native-host/src/subagentTelemetry.js +325 -0
- package/native-host/src/subagentWorkspace.js +103 -0
- package/native-host/src/subagentWorkspacePath.js +34 -0
- package/native-host/src/taskRunnerRuntime.js +130 -57
- package/native-host/src/tomlStatements.js +140 -0
- package/native-host/src/turnAttachments.js +113 -0
- package/native-host/src/updateManager.js +406 -38
- 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 +475 -0
- package/native-host/src/writingStyleStore.js +73 -0
- package/package.json +1 -1
- package/scripts/install-managed.mjs +1 -0
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
openCustomInstructionsSettings,
|
|
25
25
|
onHistoryRowJump,
|
|
26
26
|
resetProjectNameCache,
|
|
27
|
+
clearHistoryComposer,
|
|
27
28
|
getPanel,
|
|
28
29
|
getState,
|
|
29
30
|
setState,
|
|
@@ -33,128 +34,47 @@
|
|
|
33
34
|
StorageDb
|
|
34
35
|
} = deps;
|
|
35
36
|
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const filterInput = container.querySelector('[data-history-filter]');
|
|
47
|
-
if (filterInput && !filterInput.placeholder) {
|
|
48
|
-
filterInput.placeholder = tx('Filter by file or task\u2026', '按文件名或任务过滤…');
|
|
49
|
-
}
|
|
50
|
-
list.textContent = tx('Loading\u2026', '正在加载…');
|
|
51
|
-
let records = [];
|
|
52
|
-
try {
|
|
53
|
-
records = StorageDb?.getAllByIndex
|
|
54
|
-
? await StorageDb.getAllByIndex('auditLogs', 'projectId', getCurrentProjectId())
|
|
55
|
-
: [];
|
|
56
|
-
} catch (error) {
|
|
57
|
-
list.textContent = tx(`Could not load change history: ${error.message}`, `无法加载变更历史:${error.message}`);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
auditHistoryRecords = (records || [])
|
|
61
|
-
.sort((a, b) => String(b?.createdAt || '').localeCompare(String(a?.createdAt || '')))
|
|
62
|
-
.slice(0, 50);
|
|
63
|
-
applyAuditHistoryFilter();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function applyAuditHistoryFilter() {
|
|
67
|
-
const container = getSettingsPanelInstance()?.container;
|
|
68
|
-
const list = container?.querySelector('[data-history-list]');
|
|
69
|
-
if (!list) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const query = String(container.querySelector('[data-history-filter]')?.value || '').trim().toLowerCase();
|
|
73
|
-
const filePaths = record => []
|
|
74
|
-
.concat(record?.appliedFiles || [], record?.changedFiles || [])
|
|
75
|
-
.map(file => (file && typeof file === 'object') ? file.path : file)
|
|
76
|
-
.filter(Boolean);
|
|
77
|
-
const rows = auditHistoryRecords.filter(record => {
|
|
78
|
-
if (!query) {
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
return [record?.promptSummary || '', ...filePaths(record)].join(' ').toLowerCase().includes(query);
|
|
82
|
-
});
|
|
83
|
-
list.replaceChildren();
|
|
84
|
-
if (!rows.length) {
|
|
85
|
-
const empty = document.createElement('div');
|
|
86
|
-
empty.className = 'codex-history-empty';
|
|
87
|
-
empty.textContent = query
|
|
88
|
-
? tx('No recorded changes match this filter.', '没有匹配该过滤条件的变更记录。')
|
|
89
|
-
: tx('No recorded changes for this project yet.', '本项目还没有已记录的变更。');
|
|
90
|
-
list.append(empty);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
for (const record of rows) {
|
|
94
|
-
const row = document.createElement('div');
|
|
95
|
-
row.className = 'codex-history-row';
|
|
96
|
-
row.dataset.resultStatus = record.resultStatus || '';
|
|
97
|
-
const when = document.createElement('div');
|
|
98
|
-
when.className = 'codex-history-when';
|
|
99
|
-
when.textContent = record.createdAt ? new Date(record.createdAt).toLocaleString() : '';
|
|
100
|
-
const task = document.createElement('div');
|
|
101
|
-
task.className = 'codex-history-task';
|
|
102
|
-
task.textContent = record.promptSummary || '';
|
|
103
|
-
task.title = record.promptSummary || '';
|
|
104
|
-
const files = document.createElement('div');
|
|
105
|
-
files.className = 'codex-history-files';
|
|
106
|
-
const applied = (record.appliedFiles || [])
|
|
107
|
-
.map(file => (file && typeof file === 'object') ? file.path : file)
|
|
108
|
-
.filter(Boolean);
|
|
109
|
-
files.textContent = applied.length
|
|
110
|
-
? applied.join(' \u00b7 ')
|
|
111
|
-
: tx('No files were written.', '未写入文件。');
|
|
112
|
-
row.append(when, task, files);
|
|
113
|
-
// v1.8.0: rows jump to the run they describe (turnId === run.id).
|
|
114
|
-
if (record.sessionId && record.turnId && typeof onHistoryRowJump === 'function') {
|
|
115
|
-
row.classList.add('codex-history-row--linked');
|
|
116
|
-
row.setAttribute('role', 'button');
|
|
117
|
-
row.tabIndex = 0;
|
|
118
|
-
const jump = () => onHistoryRowJump(record);
|
|
119
|
-
row.addEventListener('click', jump);
|
|
120
|
-
row.addEventListener('keydown', keyEvent => {
|
|
121
|
-
if (keyEvent.key === 'Enter' || keyEvent.key === ' ') {
|
|
122
|
-
keyEvent.preventDefault();
|
|
123
|
-
jump();
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
list.append(row);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
37
|
+
// Read-only projection over scoped audit/session records. Prompt redaction
|
|
38
|
+
// remains owned by the audit writer; this view never persists task text.
|
|
39
|
+
const historyView = deps.ChangeHistoryView.create({
|
|
40
|
+
tx, StorageDb, getState, getCurrentProjectId, getSettingsPanelInstance,
|
|
41
|
+
getAccountScopeId: deps.getAccountScopeId,
|
|
42
|
+
sanitizeText: deps.sanitizeText,
|
|
43
|
+
onHistoryRowJump
|
|
44
|
+
});
|
|
45
|
+
function renderAuditHistoryPanel() { return historyView.load(); }
|
|
46
|
+
function applyAuditHistoryFilter() { historyView.filter(); }
|
|
130
47
|
|
|
131
48
|
// --- History & storage (v1.7.5): usage summary + clear-all in Settings ---
|
|
132
49
|
let storageUsageRequestId = 0;
|
|
133
50
|
function refreshStorageUsageSummary() {
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
51
|
+
const host = getSettingsPanelInstance()?.container;
|
|
52
|
+
const node = host?.querySelector('[data-storage-usage]');
|
|
53
|
+
if (!node) return;
|
|
54
|
+
const estimateNode = host.querySelector('[data-storage-estimate]') || node;
|
|
138
55
|
const requestId = ++storageUsageRequestId;
|
|
139
56
|
const projectId = getCurrentProjectId?.();
|
|
57
|
+
const accountScopeId = deps.getAccountScopeId?.();
|
|
140
58
|
const settingsScope = getPanel?.()?.dataset?.settingsScope;
|
|
141
|
-
const isCurrent = () => requestId === storageUsageRequestId
|
|
59
|
+
const isCurrent = () => requestId === storageUsageRequestId
|
|
60
|
+
&& projectId === getCurrentProjectId?.()
|
|
61
|
+
&& accountScopeId === deps.getAccountScopeId?.()
|
|
142
62
|
&& settingsScope === getPanel?.()?.dataset?.settingsScope
|
|
143
63
|
&& getSettingsPanelInstance()?.container?.querySelector('[data-storage-usage]') === node;
|
|
144
64
|
const current = getState();
|
|
145
|
-
const
|
|
146
|
-
const
|
|
65
|
+
const sessions = Array.isArray(current?.sessions) ? current.sessions : [];
|
|
66
|
+
const runIds = new Set(sessions.flatMap(session => session.id === current.activeSessionId
|
|
67
|
+
? current.runs || [] : session.runs || []).map(run => run?.id).filter(Boolean));
|
|
147
68
|
const counts = settingsScope === 'account'
|
|
148
|
-
? tx('
|
|
149
|
-
: tx(
|
|
150
|
-
|
|
151
|
-
`当前项目已加载 ${sessionCount} 个会话 · 当前会话 ${runCount} 轮运行`
|
|
152
|
-
);
|
|
153
|
-
// Dynamic text belongs to this renderer, not the loading-label translator.
|
|
69
|
+
? tx('Saved history across projects in this browser', '当前浏览器中跨项目保存的历史')
|
|
70
|
+
: tx(sessions.length + ' loaded conversations · ' + runIds.size + ' runs in this project',
|
|
71
|
+
'本项目已加载 ' + sessions.length + ' 个对话 · ' + runIds.size + ' 轮运行');
|
|
154
72
|
node.removeAttribute?.('data-i18n');
|
|
155
73
|
node.textContent = counts;
|
|
156
|
-
|
|
157
|
-
|
|
74
|
+
estimateNode.removeAttribute?.('data-i18n');
|
|
75
|
+
if (estimateNode !== node) estimateNode.textContent = tx('Estimating site storage…', '正在估算站点占用…');
|
|
76
|
+
const showEstimate = value => {
|
|
77
|
+
if (isCurrent()) estimateNode.textContent = estimateNode === node ? counts + ' · ' + value : value;
|
|
158
78
|
};
|
|
159
79
|
let timer;
|
|
160
80
|
const estimate = Promise.resolve().then(() => navigator.storage?.estimate?.());
|
|
@@ -162,11 +82,16 @@
|
|
|
162
82
|
return Promise.race([estimate, deadline]).then(info => {
|
|
163
83
|
if (!isCurrent()) return;
|
|
164
84
|
const usage = info?.usage;
|
|
165
|
-
if (!Number.isFinite(usage) || usage < 0) {
|
|
85
|
+
if (!Number.isFinite(usage) || usage < 0) {
|
|
86
|
+
showEstimate(tx('Site storage estimate unavailable; saved history is still accessible.', '暂无法估算站点容量,仍可查看已保存的历史。'));
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
166
89
|
const mb = usage / (1024 * 1024);
|
|
167
|
-
const size = usage === 0 ? '0 KB' : mb >= 1 ?
|
|
168
|
-
|
|
169
|
-
|
|
90
|
+
const size = usage === 0 ? '0 KB' : mb >= 1 ? mb.toFixed(1) + ' MB' : Math.max(1, Math.round(usage / 1024)) + ' KB';
|
|
91
|
+
showEstimate(tx('Site total ~' + size + ' (includes Overleaf data; not extension-only usage).',
|
|
92
|
+
'本站点总占用约 ' + size + ',包含 Overleaf 数据,并非插件单独占用。'));
|
|
93
|
+
}).catch(() => showEstimate(tx('Site storage estimate unavailable.', '暂无法估算站点容量。')))
|
|
94
|
+
.finally(() => clearTimeout(timer));
|
|
170
95
|
}
|
|
171
96
|
|
|
172
97
|
async function clearAllHistoryWithConfirm() {
|
|
@@ -175,36 +100,65 @@
|
|
|
175
100
|
return;
|
|
176
101
|
}
|
|
177
102
|
const confirmed = await showPluginConfirm({
|
|
178
|
-
title: tx('Clear
|
|
103
|
+
title: tx('Clear local history?', '清理本地历史?'),
|
|
179
104
|
message: tx(
|
|
180
|
-
'This permanently
|
|
181
|
-
'
|
|
105
|
+
'This permanently removes saved conversations, run and change records, undo information, and recent-project entries for ALL projects in this browser. Overleaf project files will not be deleted or reverted. Project settings and rules are kept. Removed history cannot be recovered.',
|
|
106
|
+
'将永久清理当前浏览器中所有项目的对话、运行与修改记录、撤销信息及最近项目条目。Overleaf 项目文件不会被删除或还原,项目设置与规则会保留。清理后的历史无法恢复。'
|
|
182
107
|
),
|
|
183
|
-
confirmLabel: tx('
|
|
108
|
+
confirmLabel: tx('Clear local history', '清理本地历史'),
|
|
184
109
|
destructive: true
|
|
185
110
|
});
|
|
186
111
|
if (!confirmed) {
|
|
187
112
|
return;
|
|
188
113
|
}
|
|
114
|
+
if (getCurrentRunView()) {
|
|
115
|
+
showPluginToast(tx('A run started while confirmation was open. Finish or cancel it before clearing history.', '确认期间有任务开始运行,请先完成或取消任务后再清理历史。'));
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
let historyClearedAt;
|
|
189
119
|
try {
|
|
190
|
-
await StorageDb
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
// no (potentially sensitive) project titles outlive the wipe.
|
|
194
|
-
await resetProjectNameCache?.();
|
|
120
|
+
await StorageDb.clearAllStores();
|
|
121
|
+
historyClearedAt = Date.now();
|
|
122
|
+
historyView.invalidate();
|
|
195
123
|
} catch (error) {
|
|
196
124
|
showPluginToast(tx(`Could not clear history: ${error.message}`, `清空历史失败:${error.message}`));
|
|
197
125
|
return;
|
|
198
126
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
127
|
+
const cleanupErrors = [];
|
|
128
|
+
try {
|
|
129
|
+
// Project names live outside the history store. Failure here must not
|
|
130
|
+
// leave deleted history in memory for a later autosave to replay.
|
|
131
|
+
await resetProjectNameCache?.();
|
|
132
|
+
} catch (error) {
|
|
133
|
+
cleanupErrors.push(error.message);
|
|
134
|
+
}
|
|
135
|
+
// Clear the compatibility mirror as well as the session list; otherwise
|
|
136
|
+
// normalization can reconstruct old summary runs and the Native thread.
|
|
137
|
+
const clearedState = normalizePanelState({
|
|
138
|
+
...getState(), session: null, sessions: [], runs: [], activeSessionId: '',
|
|
139
|
+
task: '', focusFiles: [], selectionContext: null, composerAttachments: []
|
|
140
|
+
});
|
|
141
|
+
const freshSession = clearedState.sessions[0];
|
|
142
|
+
// The shared store rejects createdAt <= its clear marker. A new session
|
|
143
|
+
// in the same millisecond needs the next tick, at most 1 ms ahead of now.
|
|
144
|
+
freshSession.createdAt = freshSession.updatedAt = new Date(Math.max(Date.now(), historyClearedAt + 1)).toISOString();
|
|
145
|
+
setState(clearedState);
|
|
146
|
+
try {
|
|
147
|
+
clearHistoryComposer?.();
|
|
148
|
+
if (await saveState({ requireDurable: true }) !== true) {
|
|
149
|
+
throw new Error(tx('The blank session save was not confirmed.', '空白会话的保存结果尚未确认。'));
|
|
150
|
+
}
|
|
151
|
+
} catch (error) {
|
|
152
|
+
cleanupErrors.push(error.message);
|
|
153
|
+
}
|
|
154
|
+
// The store has already been cleared, including when the fresh-session
|
|
155
|
+
// save fails. Always remove old cards and draft inputs from the panel.
|
|
205
156
|
applyStateToPanel();
|
|
206
157
|
refreshStorageUsageSummary();
|
|
207
|
-
|
|
158
|
+
void renderAuditHistoryPanel();
|
|
159
|
+
showPluginToast(cleanupErrors.length
|
|
160
|
+
? tx(`Saved history was removed, but cleanup or blank-session saving needs attention: ${cleanupErrors.join('; ')}`, `已删除保存的历史,但清理或空白会话保存仍有问题:${cleanupErrors.join(';')}`)
|
|
161
|
+
: tx('Local history cleared. Overleaf files are unchanged.', '本地历史已清理,Overleaf 文件保持不变。'));
|
|
208
162
|
getPanel()?.querySelector('[data-task]')?.focus();
|
|
209
163
|
}
|
|
210
164
|
|
|
@@ -234,13 +188,14 @@
|
|
|
234
188
|
showPluginToast(tx('Nothing to refill: the original task text is unavailable.', '无法回填:原任务文本不可用。'));
|
|
235
189
|
return;
|
|
236
190
|
}
|
|
237
|
-
prepareRetryReplacement?.(run || null);
|
|
191
|
+
prepareRetryReplacement?.(run || null, task);
|
|
238
192
|
input.value = task;
|
|
239
193
|
getState().task = task;
|
|
240
194
|
autosizeTaskTextarea();
|
|
241
195
|
syncComposerSendAvailability();
|
|
242
|
-
saveStateSoon();
|
|
243
|
-
input.focus();
|
|
196
|
+
saveStateSoon(0);
|
|
197
|
+
input.focus({ preventScroll: true });
|
|
198
|
+
input.scrollIntoView?.({ block: 'nearest' });
|
|
244
199
|
try {
|
|
245
200
|
input.setSelectionRange(task.length, task.length);
|
|
246
201
|
} catch (error) {
|
|
@@ -117,6 +117,12 @@
|
|
|
117
117
|
sessionSlot: instance.sessionSlot,
|
|
118
118
|
composerSlot: instance.composerSlot,
|
|
119
119
|
setView: view => { panelEl.dataset.view = view; },
|
|
120
|
+
setLocale: labels => {
|
|
121
|
+
launcherEl.title = labels.launcher;
|
|
122
|
+
launcherEl.setAttribute('aria-label', labels.launcher);
|
|
123
|
+
const close = panelEl.querySelector('[data-close-panel]');
|
|
124
|
+
if (close) { close.title = labels.close; close.setAttribute('aria-label', labels.close); }
|
|
125
|
+
},
|
|
120
126
|
destroy: () => destroy(instance),
|
|
121
127
|
_instance: instance
|
|
122
128
|
};
|
|
@@ -334,6 +340,10 @@
|
|
|
334
340
|
overlay.setAttribute('role', 'dialog');
|
|
335
341
|
overlay.setAttribute('aria-modal', 'true');
|
|
336
342
|
overlay.setAttribute('aria-label', title);
|
|
343
|
+
// The settings workbench is a centered top-layer dialog; center over it instead of the sidebar.
|
|
344
|
+
if (panel.querySelector?.('.codex-settings-workbench[open]')) {
|
|
345
|
+
overlay.dataset.context = 'workbench';
|
|
346
|
+
}
|
|
337
347
|
|
|
338
348
|
const card = doc.createElement('section');
|
|
339
349
|
card.className = 'codex-plugin-confirm-card';
|
|
@@ -7,73 +7,121 @@
|
|
|
7
7
|
})(typeof window !== 'undefined' ? window : globalThis, function pendingInputViewFactory() {
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
+
// Queued follow-ups render as one card docked on top of the composer:
|
|
11
|
+
// a header that says what will happen, the first message (two lines),
|
|
12
|
+
// "N more queued", a labelled Steer action and a hover-only remove.
|
|
13
|
+
const ICONS = {
|
|
14
|
+
clock: ['M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2Z', 'M8 5v3l2 1.4'],
|
|
15
|
+
pause: ['M6 4.5v7', 'M10 4.5v7'],
|
|
16
|
+
guide: ['M3.2 3.6v3.2a3.2 3.2 0 0 0 3.2 3.2H12', 'm9.6 7.2 2.8 2.8-2.8 2.8'],
|
|
17
|
+
remove: ['m4.5 4.5 7 7', 'm11.5 4.5-7 7']
|
|
18
|
+
};
|
|
19
|
+
|
|
10
20
|
function create(options = {}) {
|
|
11
21
|
const container = options.container;
|
|
22
|
+
const tr = (key, params) => options.tr?.(key, params) || '';
|
|
23
|
+
let expanded = false;
|
|
24
|
+
|
|
25
|
+
function headerState(items) {
|
|
26
|
+
if (items.some(item => item.status === 'steering')) return { state: 'steering', icon: 'guide', label: tr('queuedInputSteering') };
|
|
27
|
+
if (items.some(item => item.status === 'paused')) return { state: 'paused', icon: 'pause', label: tr('queuedInputPaused') };
|
|
28
|
+
if (items.some(item => item.status === 'executing')) return { state: 'executing', icon: 'clock', label: tr('queuedInputExecuting') };
|
|
29
|
+
return { state: 'queued', icon: 'clock', label: tr(items.length > 1 ? 'queuedInputUpNextMany' : 'queuedInputUpNext') };
|
|
30
|
+
}
|
|
12
31
|
|
|
13
32
|
function render(items = [], state = {}) {
|
|
14
|
-
if (!container)
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
33
|
+
if (!container) return;
|
|
17
34
|
container.replaceChildren();
|
|
18
35
|
container.hidden = !items.length;
|
|
19
|
-
if (!items.length) {
|
|
20
|
-
|
|
36
|
+
if (!items.length) { expanded = false; return; }
|
|
37
|
+
const head = headerState(items);
|
|
38
|
+
container.dataset.state = head.state;
|
|
39
|
+
const header = document.createElement('header');
|
|
40
|
+
header.className = 'codex-pending-head';
|
|
41
|
+
const label = document.createElement('span');
|
|
42
|
+
label.className = 'codex-pending-head-label';
|
|
43
|
+
label.textContent = head.label;
|
|
44
|
+
header.append(createIcon(head.icon), label);
|
|
45
|
+
if (items.length > 1) {
|
|
46
|
+
const count = document.createElement('span');
|
|
47
|
+
count.className = 'codex-pending-count';
|
|
48
|
+
count.textContent = String(items.length);
|
|
49
|
+
header.append(count);
|
|
50
|
+
}
|
|
51
|
+
if (head.state === 'paused') {
|
|
52
|
+
const resume = createButton(tr('queuedInputResume'), () => options.onResume?.());
|
|
53
|
+
resume.className = 'codex-pending-resume';
|
|
54
|
+
header.append(resume);
|
|
55
|
+
}
|
|
56
|
+
const list = document.createElement('ol');
|
|
57
|
+
list.className = 'codex-pending-list';
|
|
58
|
+
const visible = expanded ? items : items.slice(0, 1);
|
|
59
|
+
visible.forEach((item, index) => list.append(renderItem(item, index, items.length, state, head.state)));
|
|
60
|
+
container.append(header, list);
|
|
61
|
+
if (items.length > 1) {
|
|
62
|
+
const more = createButton(expanded ? tr('queuedInputShowLess') : tr('queuedInputMore', { count: String(items.length - 1) }),
|
|
63
|
+
() => { expanded = !expanded; render(items, state); });
|
|
64
|
+
more.className = 'codex-pending-more';
|
|
65
|
+
more.setAttribute('aria-expanded', String(expanded));
|
|
66
|
+
container.append(more);
|
|
67
|
+
}
|
|
68
|
+
if (state.running && !state.canGuide && head.state === 'queued') {
|
|
69
|
+
const hint = document.createElement('p');
|
|
70
|
+
hint.className = 'codex-pending-hint';
|
|
71
|
+
hint.textContent = tr('queuedInputGuideHint');
|
|
72
|
+
container.append(hint);
|
|
21
73
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
actions.className = 'codex-pending-input-actions';
|
|
50
|
-
if (item.status === 'paused') {
|
|
51
|
-
actions.append(createButton(options.tr?.('queuedInputResume'), () => options.onResume?.()));
|
|
52
|
-
} else if (state.running && item.status === 'queued') {
|
|
53
|
-
const guide = createIconButton(
|
|
54
|
-
options.tr?.('queuedInputGuide'),
|
|
55
|
-
'guide',
|
|
56
|
-
() => options.onGuide?.(item.id)
|
|
57
|
-
);
|
|
58
|
-
guide.disabled = !state.canGuide;
|
|
59
|
-
guide.title = state.canGuide
|
|
60
|
-
? options.tr?.('queuedInputGuideTitle')
|
|
61
|
-
: options.tr?.('queuedInputGuideUnavailable');
|
|
62
|
-
actions.append(guide);
|
|
63
|
-
}
|
|
64
|
-
const remove = createIconButton(
|
|
65
|
-
options.tr?.('queuedInputRemove'),
|
|
66
|
-
'remove',
|
|
67
|
-
() => options.onRemove?.(item.id)
|
|
68
|
-
);
|
|
69
|
-
remove.classList.add('codex-pending-input-remove');
|
|
70
|
-
remove.disabled = item.status === 'steering' || item.status === 'executing';
|
|
71
|
-
text.title = item.text;
|
|
72
|
-
actions.append(remove);
|
|
73
|
-
row.setAttribute('aria-label', `${status.textContent || options.tr?.('queuedInputQueued') || 'Queued'}: ${item.text}`);
|
|
74
|
-
row.append(marker, copy, actions);
|
|
75
|
-
container.append(row);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function renderItem(item, index, total, state, headState) {
|
|
77
|
+
const row = document.createElement('li');
|
|
78
|
+
row.className = 'codex-pending-input';
|
|
79
|
+
row.dataset.status = item.status || 'queued';
|
|
80
|
+
const number = document.createElement('span');
|
|
81
|
+
number.className = 'codex-pending-number';
|
|
82
|
+
number.textContent = total > 1 ? String(index + 1) : '';
|
|
83
|
+
const text = document.createElement('button');
|
|
84
|
+
text.type = 'button';
|
|
85
|
+
text.className = 'codex-pending-input-text';
|
|
86
|
+
text.textContent = item.text;
|
|
87
|
+
const editable = (item.status || 'queued') === 'queued';
|
|
88
|
+
text.title = editable ? tr('queuedInputEdit') : item.text;
|
|
89
|
+
text.disabled = !editable;
|
|
90
|
+
text.addEventListener('click', () => pullBack(item));
|
|
91
|
+
const actions = document.createElement('span');
|
|
92
|
+
actions.className = 'codex-pending-input-actions';
|
|
93
|
+
if (index === 0 && state.running && item.status === 'queued' && headState === 'queued') {
|
|
94
|
+
const guide = createButton('', () => options.onGuide?.(item.id));
|
|
95
|
+
guide.className = 'codex-pending-steer';
|
|
96
|
+
guide.dataset.action = 'guide';
|
|
97
|
+
guide.append(createIcon('guide'), Object.assign(document.createElement('span'), { textContent: tr('queuedInputGuide') }));
|
|
98
|
+
guide.disabled = !state.canGuide;
|
|
99
|
+
guide.title = state.canGuide ? tr('queuedInputGuideTitle') : tr('queuedInputGuideUnavailable');
|
|
100
|
+
actions.append(guide);
|
|
76
101
|
}
|
|
102
|
+
const remove = createButton('', () => options.onRemove?.(item.id));
|
|
103
|
+
remove.className = 'codex-pending-input-remove';
|
|
104
|
+
remove.dataset.action = 'remove';
|
|
105
|
+
remove.title = tr('queuedInputRemove');
|
|
106
|
+
remove.setAttribute('aria-label', remove.title);
|
|
107
|
+
remove.append(createIcon('remove'));
|
|
108
|
+
remove.disabled = item.status === 'steering' || item.status === 'executing';
|
|
109
|
+
actions.append(remove);
|
|
110
|
+
row.setAttribute('aria-label', `${tr('queuedInputQueued') || 'Queued'}: ${item.text}`);
|
|
111
|
+
row.append(number, text, actions);
|
|
112
|
+
return row;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Pull a queued message back into the composer. A typed draft is never overwritten.
|
|
116
|
+
function pullBack(item) {
|
|
117
|
+
const task = container?.parentElement?.querySelector('[data-task]');
|
|
118
|
+
if (!task || (item.status || 'queued') !== 'queued') return;
|
|
119
|
+
if (String(task.value || '').trim()) { options.onToast?.(tr('queuedInputEditBlocked')); return; }
|
|
120
|
+
options.onRemove?.(item.id);
|
|
121
|
+
task.value = item.text;
|
|
122
|
+
task.dispatchEvent(new Event('input', { bubbles: true }));
|
|
123
|
+
task.focus();
|
|
124
|
+
task.setSelectionRange?.(task.value.length, task.value.length);
|
|
77
125
|
}
|
|
78
126
|
|
|
79
127
|
return { render };
|
|
@@ -87,27 +135,12 @@
|
|
|
87
135
|
return button;
|
|
88
136
|
}
|
|
89
137
|
|
|
90
|
-
function createIconButton(label, icon, onClick) {
|
|
91
|
-
const button = createButton('', onClick);
|
|
92
|
-
button.className = 'codex-pending-input-icon';
|
|
93
|
-
button.dataset.action = icon;
|
|
94
|
-
button.title = label || '';
|
|
95
|
-
button.setAttribute('aria-label', label || '');
|
|
96
|
-
button.append(createIcon(icon));
|
|
97
|
-
return button;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
138
|
function createIcon(icon) {
|
|
101
139
|
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
102
|
-
svg.setAttribute('viewBox', '0 0
|
|
140
|
+
svg.setAttribute('viewBox', '0 0 16 16');
|
|
103
141
|
svg.setAttribute('aria-hidden', 'true');
|
|
104
142
|
svg.setAttribute('focusable', 'false');
|
|
105
|
-
const
|
|
106
|
-
? ['M4 4.5v4a4 4 0 0 0 4 4h7', 'm12 9 3.5 3.5L12 16']
|
|
107
|
-
: icon === 'queue'
|
|
108
|
-
? ['M4 5.5h12', 'M4 10h12', 'M4 14.5h8']
|
|
109
|
-
: ['M6 6h8', 'M8 6V4.5h4V6', 'm7.2 8 0.6 7.5h4.4l.6-7.5'];
|
|
110
|
-
for (const value of paths) {
|
|
143
|
+
for (const value of ICONS[icon] || ICONS.clock) {
|
|
111
144
|
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
112
145
|
path.setAttribute('d', value);
|
|
113
146
|
svg.append(path);
|
|
@@ -2,12 +2,20 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
function create(deps = {}) {
|
|
5
|
-
|
|
5
|
+
function assertSwitchAllowed() {
|
|
6
6
|
if ((deps.getRunningSessionIds?.() || []).length) {
|
|
7
|
-
|
|
7
|
+
throw Object.assign(new Error(deps.tx(
|
|
8
8
|
'Wait for the running task to finish before switching providers.',
|
|
9
9
|
'请等待正在运行的任务结束后再切换模型服务。'
|
|
10
|
-
), {
|
|
10
|
+
)), { code: 'provider_switch_running' });
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async function confirmSwitch({ providerName } = {}) {
|
|
15
|
+
try {
|
|
16
|
+
assertSwitchAllowed();
|
|
17
|
+
} catch (error) {
|
|
18
|
+
deps.showToast?.(error.message, { status: 'warning' });
|
|
11
19
|
return false;
|
|
12
20
|
}
|
|
13
21
|
return deps.showConfirm?.({
|
|
@@ -33,6 +41,7 @@
|
|
|
33
41
|
const providerConfigurationChanged = nextProviderId === (state.providerId || 'builtin')
|
|
34
42
|
&& nextProviderRevision !== Number(state.providerRevision || 0);
|
|
35
43
|
const resetProviderThread = providerChanged || providerConfigurationChanged;
|
|
44
|
+
if (resetProviderThread) assertSwitchAllowed();
|
|
36
45
|
const sessions = (state.sessions || []).map(session => ({
|
|
37
46
|
...session,
|
|
38
47
|
providerId: nextProviderId,
|
|
@@ -53,7 +62,7 @@
|
|
|
53
62
|
deps.applyStateToPanel?.();
|
|
54
63
|
}
|
|
55
64
|
|
|
56
|
-
return { confirmSwitch, commit };
|
|
65
|
+
return { assertSwitchAllowed, confirmSwitch, commit };
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
window.CodexOverleafProjectProviderSelection = { create };
|