codex-overleaf-link 2.5.0 → 2.6.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 +155 -392
- package/README.zh-CN.md +154 -393
- package/extension/bootstrap/background.js +52 -9
- package/extension/bootstrap/manifest.template.json +1 -1
- package/extension/bootstrap/popup.html +1 -0
- package/extension/bootstrap/popupFallback.js +55 -0
- package/extension/bootstrap/updateStatus.js +1 -0
- package/extension/src/background.js +283 -55
- package/extension/src/backgroundBootstrapMigration.js +181 -0
- package/extension/src/backgroundSharedSessions.js +129 -16
- package/extension/src/backgroundUpdateCoordinator.js +242 -29
- package/extension/src/backgroundUpdateSafety.js +173 -0
- package/extension/src/content/activeTurnControl.js +171 -8
- package/extension/src/content/applyResultFormatters.js +46 -73
- package/extension/src/content/assetTransferBroker.js +72 -14
- package/extension/src/content/composerAttachments.js +104 -47
- package/extension/src/content/composerPanel.js +110 -12
- package/extension/src/content/contentRuntime.js +1555 -926
- package/extension/src/content/contextTray.js +8 -2
- package/extension/src/content/contextUsageView.js +267 -0
- package/extension/src/content/diagnosticsController.js +122 -96
- package/extension/src/content/diagnosticsExport.js +19 -5
- package/extension/src/content/diagnosticsPanel.js +48 -0
- package/extension/src/content/directoryCleanupRecovery.js +54 -0
- package/extension/src/content/generated/content.bundle.js +11077 -3412
- package/extension/src/content/generated/content.bundle.meta.json +14 -3
- package/extension/src/content/globalPreferencesController.js +1 -1
- package/extension/src/content/legacyGlobalRegistry.js +10 -0
- package/extension/src/content/localSkillsPanel.js +104 -14
- package/extension/src/content/markdownDomRenderer.js +5 -3
- package/extension/src/content/markdownText.js +47 -11
- package/extension/src/content/modelPicker.js +8 -4
- package/extension/src/content/nativeCompatibilityController.js +74 -30
- package/extension/src/content/otWarmMirror.js +5 -6
- package/extension/src/content/otWarmMirrorController.js +17 -20
- package/extension/src/content/pageBridgeClient.js +17 -4
- package/extension/src/content/panelMaintenance.js +46 -14
- package/extension/src/content/panelRenderer.js +57 -27
- package/extension/src/content/pendingInputView.js +1 -1
- package/extension/src/content/projectProviderSelection.js +13 -4
- package/extension/src/content/projectSessionCleanup.js +109 -62
- package/extension/src/content/projectSettingsCoordinator.js +67 -6
- package/extension/src/content/providerSettingsCoordinator.js +46 -8
- package/extension/src/content/providerSettingsDialog.js +73 -14
- package/extension/src/content/recentProjects.js +15 -8
- package/extension/src/content/runActivitySummary.js +160 -18
- package/extension/src/content/runCompletionMeta.js +532 -0
- package/extension/src/content/runController.js +39 -15
- package/extension/src/content/runFailureNotice.js +29 -13
- package/extension/src/content/runGuidanceController.js +72 -27
- package/extension/src/content/runGuidanceView.js +59 -10
- package/extension/src/content/runPresence.js +18 -8
- package/extension/src/content/runQueueScheduler.js +157 -47
- package/extension/src/content/runRecoveryActions.js +147 -0
- package/extension/src/content/runResultActions.js +28 -143
- package/extension/src/content/runReviewController.js +633 -0
- package/extension/src/content/runScrollLayout.js +21 -2
- package/extension/src/content/runTimelineView.js +367 -175
- package/extension/src/content/scopedPersistencePanelState.js +134 -20
- package/extension/src/content/selectionContextView.js +1 -1
- package/extension/src/content/sensitivePreflight.js +153 -0
- package/extension/src/content/sessionForkController.js +80 -17
- package/extension/src/content/sessionManager.js +50 -4
- package/extension/src/content/sessionMenuView.js +54 -18
- package/extension/src/content/sessionPersistence.js +25 -5
- package/extension/src/content/settingsPanel.js +22 -5
- package/extension/src/content/settingsWorkbench.js +132 -89
- package/extension/src/content/sharedSessionViewSync.js +49 -11
- package/extension/src/content/subagentActivityView.js +23 -7
- package/extension/src/content/updateIdle.js +4 -1
- package/extension/src/content/updateNotice.js +118 -12
- package/extension/src/content/updateSafetyReceiver.js +58 -0
- package/extension/src/content/writebackController.js +53 -4
- package/extension/src/content/writebackOrchestrator.js +116 -94
- package/extension/src/content/writingStyleSettings.js +35 -11
- package/extension/src/page/binaryAssetUploader.js +136 -14
- package/extension/src/page/compileBridge.js +193 -180
- package/extension/src/page/fileMover.js +256 -0
- package/extension/src/page/overleafCapabilities.js +4 -1
- package/extension/src/page/ownedDirectoryCleanup.js +94 -0
- package/extension/src/page/referenceProjects.js +1 -0
- package/extension/src/page/reviewContext.js +113 -0
- package/extension/src/page/saveState.js +6 -4
- package/extension/src/page/snapshotRouter.js +84 -39
- package/extension/src/page/textCoordinates.js +17 -1
- package/extension/src/page/textFileCreator.js +114 -26
- package/extension/src/page/trackedChangeCapture.js +12 -2
- package/extension/src/page/trackedChangeOwnership.js +19 -1
- package/extension/src/page/trackedChangeReplay.js +41 -21
- package/extension/src/page/trackedChangesLifecycle.js +217 -199
- package/extension/src/page/treeOperations.js +7 -10
- package/extension/src/page/updateSafetyProbe.js +41 -0
- package/extension/src/page/writebackReceiptJournal.js +2 -0
- package/extension/src/page/writebackRouter.js +103 -155
- package/extension/src/pageBridge.js +126 -69
- package/extension/src/popup.js +62 -10
- package/extension/src/shared/agentTranscript.js +373 -17
- package/extension/src/shared/auditRecords.js +4 -0
- package/extension/src/shared/compatibility.js +22 -6
- package/extension/src/shared/compileAdapter.js +129 -66
- package/extension/src/shared/composerAttachmentDraft.js +156 -0
- package/extension/src/shared/contextUsage.js +125 -0
- package/extension/src/shared/directoryCleanupProof.js +43 -0
- package/extension/src/shared/failureReasons.js +349 -4
- package/extension/src/shared/globalPreferences.js +30 -13
- package/extension/src/shared/governanceRules.js +4 -37
- package/extension/src/shared/i18n.js +590 -24
- package/extension/src/shared/lineReferences.js +38 -31
- package/extension/src/shared/managedUpdateProjection.js +2 -2
- package/extension/src/shared/nativeRequestIdentity.js +1 -0
- package/extension/src/shared/pageRpcContract.js +5 -4
- package/extension/src/shared/panelIcons.js +39 -0
- package/extension/src/shared/projectFiles.js +21 -44
- package/extension/src/shared/providerProfiles.js +5 -3
- package/extension/src/shared/reviewing.js +130 -1
- package/extension/src/shared/runActivityModel.js +70 -4
- package/extension/src/shared/runExecutionSnapshot.js +13 -0
- package/extension/src/shared/runInputQueue.js +48 -5
- package/extension/src/shared/selectionContext.js +12 -3
- package/extension/src/shared/sessionState.js +132 -28
- package/extension/src/shared/sessionTitle.js +14 -1
- package/extension/src/shared/settlementFacts.js +10 -2
- package/extension/src/shared/sharedSessionBridge.js +118 -27
- package/extension/src/shared/sharedSessionTransfer.js +140 -0
- package/extension/src/shared/staleGuard.js +166 -52
- package/extension/src/shared/storageDb.js +90 -26
- package/extension/src/shared/storageMigration.js +78 -112
- package/extension/src/shared/storageRunActions.js +267 -30
- package/extension/src/shared/subagentActivityModel.js +1 -1
- package/extension/src/shared/undoOperations.js +253 -32
- package/extension/src/shared/updateConsent.js +6 -4
- package/extension/src/shared/updateRuntimeIdentity.js +17 -3
- package/extension/src/shared/writebackIntent.js +16 -0
- package/extension/src/shared/writebackOperationEvidence.js +4 -15
- package/extension/src/shared/writebackSettlement.js +58 -40
- package/extension/styles/panel.css +1123 -493
- package/native-host/src/anthropicBridgeRequest.js +4 -2
- package/native-host/src/anthropicBridgeResponse.js +6 -2
- package/native-host/src/anthropicMessagesBridge.js +24 -16
- package/native-host/src/bootstrapMigration.js +296 -0
- package/native-host/src/bootstrapMigrationContract.js +101 -0
- package/native-host/src/bootstrapUpdate.js +269 -0
- package/native-host/src/bootstrapUpdateWatchdog.js +44 -0
- package/native-host/src/chatBridgeRequest.js +60 -6
- package/native-host/src/chatBridgeResponse.js +20 -1
- package/native-host/src/chatCompletionsBridge.js +48 -15
- package/native-host/src/codexConfigPaths.js +106 -0
- package/native-host/src/codexHome.js +66 -73
- package/native-host/src/codexHomeScope.js +124 -0
- package/native-host/src/codexInheritedAuth.js +90 -0
- package/native-host/src/codexLocalSkills.js +301 -0
- package/native-host/src/codexPromptAssembly.js +114 -127
- package/native-host/src/codexProviderTest.js +24 -26
- package/native-host/src/codexSessionRunner.js +234 -198
- package/native-host/src/codexSessionTiming.js +18 -8
- package/native-host/src/codexSkillIsolation.js +170 -0
- package/native-host/src/codexThreadFork.js +19 -3
- package/native-host/src/index.js +19 -7
- package/native-host/src/managedInstall.js +110 -35
- package/native-host/src/managedInstallRecovery.js +140 -0
- package/native-host/src/managedRuntimeEvidence.js +57 -0
- package/native-host/src/mirrorWorkspace.js +92 -22
- package/native-host/src/nativeDoctor.js +15 -0
- package/native-host/src/nativeHelperLifecycle.js +21 -0
- package/native-host/src/nativeHostRegistration.js +33 -0
- package/native-host/src/nativeRunLifecycle.js +71 -0
- package/native-host/src/processStopBarrier.js +42 -7
- package/native-host/src/projectPathPlatform.js +30 -0
- package/native-host/src/providerContextError.js +20 -0
- package/native-host/src/providerHttp.js +80 -0
- package/native-host/src/providerProfile.js +4 -2
- package/native-host/src/providerReasoning.js +2 -7
- package/native-host/src/providerRuntime.js +1 -0
- package/native-host/src/providerStore.js +72 -14
- package/native-host/src/responsesPassthroughBridge.js +266 -52
- package/native-host/src/runtimeInstaller.js +21 -1
- package/native-host/src/selectionScope.js +36 -8
- package/native-host/src/subagentAdmission.js +26 -0
- package/native-host/src/subagentBroker.js +79 -66
- package/native-host/src/subagentTelemetry.js +19 -10
- package/native-host/src/subagentWorkspacePath.js +5 -2
- package/native-host/src/taskRunnerRuntime.js +92 -57
- package/native-host/src/textPatch.js +473 -377
- package/native-host/src/tomlStatements.js +140 -0
- package/native-host/src/updateManager.js +409 -46
- package/native-host/src/writingStyleRuntime.js +57 -29
- package/native-host/src/writingStyleStore.js +73 -0
- package/package.json +5 -8
- package/scripts/install-managed.mjs +1 -0
|
@@ -4,28 +4,42 @@
|
|
|
4
4
|
require('./failureReasons'),
|
|
5
5
|
require('./settlementFacts'),
|
|
6
6
|
require('./writebackEvidenceProjection'),
|
|
7
|
-
require('./writebackOperationEvidence')
|
|
7
|
+
require('./writebackOperationEvidence'),
|
|
8
|
+
require('./undoOperations')
|
|
8
9
|
);
|
|
9
10
|
} else {
|
|
10
11
|
root.CodexOverleafModuleRegistry.define('WritebackSettlement', [
|
|
11
12
|
'FailureReasons',
|
|
12
13
|
'SettlementFacts',
|
|
13
14
|
'WritebackEvidenceProjection',
|
|
14
|
-
'WritebackOperationEvidence'
|
|
15
|
+
'WritebackOperationEvidence',
|
|
16
|
+
'UndoOperations'
|
|
15
17
|
], factory);
|
|
16
18
|
}
|
|
17
19
|
})(typeof window !== 'undefined' ? window : globalThis, function writebackSettlementFactory(
|
|
18
20
|
DefaultFailureReasons,
|
|
19
21
|
SettlementFacts,
|
|
20
22
|
EvidenceProjection,
|
|
21
|
-
OperationEvidence
|
|
23
|
+
OperationEvidence,
|
|
24
|
+
UndoOperations
|
|
22
25
|
) {
|
|
23
26
|
'use strict';
|
|
24
27
|
|
|
25
28
|
const SETTLEMENT_FACTS_MAX_BYTES = SettlementFacts.SETTLEMENT_FACTS_MAX_BYTES;
|
|
26
29
|
const RECOVERY_FIELDS = SettlementFacts.RECOVERY_FIELDS;
|
|
27
30
|
const compactSettlementFacts = SettlementFacts.compactSettlementFacts;
|
|
28
|
-
|
|
31
|
+
function projectRunSettlement(run = {}) {
|
|
32
|
+
const projection = SettlementFacts.projectRunSettlement(run);
|
|
33
|
+
const undoUnavailable = UndoOperations.getUndoUnavailableFiles(run);
|
|
34
|
+
if (!undoUnavailable.length) return projection;
|
|
35
|
+
const payload = UndoOperations.withAvailableUndo(run.recoveryPayload || run);
|
|
36
|
+
// Forward receipts remain audit evidence, not fallback Undo authority for
|
|
37
|
+
// a run whose inverse checkpoint could not be safely composed.
|
|
38
|
+
const available = SettlementFacts.projectRunSettlement({ ...run,
|
|
39
|
+
recoveryPayload: { ...payload, appliedOperations: [] } });
|
|
40
|
+
return { ...projection, canUndo: available.canUndo, undoUnavailable,
|
|
41
|
+
actions: { ...projection.actions, undo: available.canUndo } };
|
|
42
|
+
}
|
|
29
43
|
const deriveLegacyProjection = SettlementFacts.deriveLegacyProjection;
|
|
30
44
|
const aggregateFileSettlements = EvidenceProjection.aggregateFileSettlements;
|
|
31
45
|
const deriveAppliedEvidence = EvidenceProjection.deriveAppliedEvidence;
|
|
@@ -212,7 +226,7 @@
|
|
|
212
226
|
}
|
|
213
227
|
|
|
214
228
|
function deriveSettledEvidence(primaryFailure, fileSettlements = []) {
|
|
215
|
-
if (primaryFailure?.terminalState === 'needs_review'
|
|
229
|
+
if (primaryFailure?.terminalState === 'needs_review' || DefaultFailureReasons.isUnconfirmedWriteFailure?.(primaryFailure)
|
|
216
230
|
|| fileSettlements.some(file => file.readBack === 'mismatch')) {
|
|
217
231
|
return 'needs-review';
|
|
218
232
|
}
|
|
@@ -294,7 +308,8 @@
|
|
|
294
308
|
// Both actions cover every targeted file. Partial success must retain
|
|
295
309
|
// the original recovery material for unresolved siblings.
|
|
296
310
|
const incomplete = collectRunResultSkipped(input.result).length > 0
|
|
297
|
-
|| input.result?.ok === false
|
|
311
|
+
|| input.result?.ok === false
|
|
312
|
+
|| (kind === 'reject' && UndoOperations.getUndoUnavailableFiles(input.run).length > 0);
|
|
298
313
|
const needsReview = incomplete || !successful || failures.some(failure =>
|
|
299
314
|
failure.terminalState === 'needs_review' || reviewCodes.has(failure.code)
|
|
300
315
|
);
|
|
@@ -336,7 +351,9 @@
|
|
|
336
351
|
}
|
|
337
352
|
|
|
338
353
|
function settleLegacyUndo(input = {}) {
|
|
339
|
-
const status = input.status === 'applied'
|
|
354
|
+
const status = input.status === 'applied'
|
|
355
|
+
&& !UndoOperations.getUndoUnavailableFiles(input.run).length
|
|
356
|
+
&& isUndoResultEffectivelyApplied(input.run, input.result, input.run?.undoOperations) ? 'applied' : 'partial';
|
|
340
357
|
const recovery = preserveRecovery();
|
|
341
358
|
return {
|
|
342
359
|
statePatch: { undoStatus: status },
|
|
@@ -441,7 +458,8 @@
|
|
|
441
458
|
}
|
|
442
459
|
|
|
443
460
|
function isUndoResultEffectivelyApplied(run, result, undoOperations = []) {
|
|
444
|
-
if (
|
|
461
|
+
if (result?.saveVerification?.ok === false || result?.receiptUnconfirmed === true) return false;
|
|
462
|
+
if (!result?.skipped?.length) return result?.ok === true;
|
|
445
463
|
const expectedByPath = new Map((run?.undoExpectedFiles || [])
|
|
446
464
|
.filter(file => file?.path && typeof file.content === 'string')
|
|
447
465
|
.map(file => [normalizeSettlementPath(file.path), file.content])
|
|
@@ -467,10 +485,12 @@
|
|
|
467
485
|
if (entry?.operation?.type === 'edit' && operationPath === normalizedPath) {
|
|
468
486
|
return inner.verifiedContent === expectedContent;
|
|
469
487
|
}
|
|
470
|
-
|
|
471
488
|
const trackedPath = normalizeSettlementPath(entry?.trackedChange?.path);
|
|
472
489
|
if (trackedPath !== normalizedPath) return false;
|
|
473
490
|
const key = String(entry?.trackedChange?.key || '');
|
|
491
|
+
if (['overleaf-review-reject', 'overleaf-review-reject-sweep'].includes(inner.method))
|
|
492
|
+
return /^(?:id:|pos:|sig:)/.test(key) && inner.verified === true
|
|
493
|
+
&& inner.verifiedContent === expectedContent;
|
|
474
494
|
if (key === `editor-undo:${normalizedPath}`) {
|
|
475
495
|
return inner.method === 'overleaf-editor-undo'
|
|
476
496
|
&& inner.verified === true
|
|
@@ -492,14 +512,12 @@
|
|
|
492
512
|
}
|
|
493
513
|
return false;
|
|
494
514
|
}
|
|
495
|
-
|
|
496
515
|
function normalizeSettlementPath(value) {
|
|
497
516
|
return String(value || '')
|
|
498
517
|
.replace(/\\/g, '/')
|
|
499
518
|
.replace(/\/+/g, '/')
|
|
500
519
|
.replace(/^\/+|\/+$/g, '');
|
|
501
520
|
}
|
|
502
|
-
|
|
503
521
|
function attachAcceptNotVerifiedFailure(run, result, options = {}) {
|
|
504
522
|
if (!result || typeof result !== 'object' || result.ok === false) return result;
|
|
505
523
|
if (Array.isArray(result.skipped) && result.skipped.length > 0) return result;
|
|
@@ -580,8 +598,9 @@
|
|
|
580
598
|
const inner = entry?.result || entry;
|
|
581
599
|
if (!inner || inner.ok === true) continue;
|
|
582
600
|
const operation = entry?.operation || (entry?.trackedChange ? { path: entry.trackedChange.path } : undefined);
|
|
583
|
-
|
|
584
|
-
|
|
601
|
+
const normalize = failureReasons?.normalizeWritebackFailure || failureReasons?.normalizeFailureReason;
|
|
602
|
+
failures.push(normalize instanceof Function
|
|
603
|
+
? normalize(inner, operation)
|
|
585
604
|
: normalizeFailure(inner, operation));
|
|
586
605
|
}
|
|
587
606
|
return failures.filter(Boolean);
|
|
@@ -630,9 +649,27 @@
|
|
|
630
649
|
|
|
631
650
|
function attachVerifiedContentToOperation(operation, result) {
|
|
632
651
|
if (!operation || typeof operation !== 'object') return operation;
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
652
|
+
const createdDirectories = (Array.isArray(result?.createdDirectories) ? result.createdDirectories
|
|
653
|
+
: Array.isArray(result?.moveProof?.createdDirectories) ? result.moveProof.createdDirectories : [])
|
|
654
|
+
.filter(proof => proof?.v === 1 && typeof proof.projectId === 'string' && proof.projectId
|
|
655
|
+
&& typeof proof.path === 'string' && proof.path && !proof.path.split('/').some(part => !part || part === '.' || part === '..')
|
|
656
|
+
&& typeof proof.nativeFolderId === 'string')
|
|
657
|
+
.map(proof => ({ v: 1, projectId: proof.projectId, path: proof.path, nativeFolderId: proof.nativeFolderId,
|
|
658
|
+
ownershipConfirmed: false, observedAfterCreate: proof.observedAfterCreate === true }));
|
|
659
|
+
const rawMove = result?.moveProof;
|
|
660
|
+
const moveProof = rawMove?.v === 1 && ['text', 'binary'].includes(rawMove.kind) && /^[a-f0-9]{64}$/i.test(rawMove.sha256 || '')
|
|
661
|
+
&& typeof rawMove.sourceEntityId === 'string' && rawMove.sourceEntityId
|
|
662
|
+
&& typeof rawMove.targetEntityId === 'string' && rawMove.targetEntityId
|
|
663
|
+
? { v: 1, kind: rawMove.kind, sha256: rawMove.sha256.toLowerCase(), sourceEntityId: rawMove.sourceEntityId,
|
|
664
|
+
targetEntityId: rawMove.targetEntityId, ...(['doc', 'file'].includes(rawMove.entityType) ? { entityType: rawMove.entityType } : {}), ...(createdDirectories.length ? { createdDirectories } : {}) } : null;
|
|
665
|
+
if (!(operation.type === 'edit' && typeof result?.verifiedContent === 'string') && !createdDirectories.length && !moveProof) return operation;
|
|
666
|
+
return { ...operation, ...(operation.type === 'edit' && typeof result?.verifiedContent === 'string' ? {
|
|
667
|
+
verifiedContent: result.verifiedContent,
|
|
668
|
+
...(result.ok === true && result.verified === true && Array.isArray(result.appliedPatches)
|
|
669
|
+
? { appliedPatches: result.appliedPatches.map(patch => ({ from: patch.from, to: patch.to,
|
|
670
|
+
expected: String(patch.expected ?? ''), insert: String(patch.insert ?? '') })) } : {})
|
|
671
|
+
} : {}),
|
|
672
|
+
...(createdDirectories.length ? { createdDirectories } : {}), ...(moveProof ? { moveProof } : {}) };
|
|
636
673
|
}
|
|
637
674
|
|
|
638
675
|
function selectExpectedFilesForTrackedUndo(
|
|
@@ -641,26 +678,7 @@
|
|
|
641
678
|
trackedChanges = [],
|
|
642
679
|
previousExpectedFiles = []
|
|
643
680
|
) {
|
|
644
|
-
|
|
645
|
-
for (const change of trackedChanges || []) {
|
|
646
|
-
if (change?.path) paths.add(change.path);
|
|
647
|
-
}
|
|
648
|
-
for (const operation of operations || []) {
|
|
649
|
-
if (operation?.path) paths.add(operation.path);
|
|
650
|
-
if (operation?.to) paths.add(operation.to);
|
|
651
|
-
}
|
|
652
|
-
const expectedByPath = new Map();
|
|
653
|
-
for (const file of previousExpectedFiles || []) {
|
|
654
|
-
if (paths.has(file?.path) && typeof file?.content === 'string' && !expectedByPath.has(file.path)) {
|
|
655
|
-
expectedByPath.set(file.path, { path: file.path, content: file.content });
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
for (const file of project?.files || []) {
|
|
659
|
-
if (paths.has(file?.path) && typeof file?.content === 'string' && !expectedByPath.has(file.path)) {
|
|
660
|
-
expectedByPath.set(file.path, { path: file.path, content: file.content });
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
return Array.from(expectedByPath.values());
|
|
681
|
+
return UndoOperations.selectExpectedFilesForTrackedUndo(project, operations, trackedChanges, previousExpectedFiles);
|
|
664
682
|
}
|
|
665
683
|
|
|
666
684
|
function acceptDiagnosticStatus(step, info) {
|
|
@@ -674,10 +692,9 @@
|
|
|
674
692
|
return 'info';
|
|
675
693
|
}
|
|
676
694
|
|
|
677
|
-
function selectPrimaryFailure(failures, failureReasons) {
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
: failures[0] || null;
|
|
695
|
+
function selectPrimaryFailure(failures, failureReasons = DefaultFailureReasons) {
|
|
696
|
+
const select = failureReasons?.selectPrimaryWritebackFailure || failureReasons?.selectPrimaryFailure;
|
|
697
|
+
return select instanceof Function ? select(failures) : failures[0] || null;
|
|
681
698
|
}
|
|
682
699
|
|
|
683
700
|
function appendSyntheticFailure(result, failure, path, code, type) {
|
|
@@ -749,6 +766,7 @@
|
|
|
749
766
|
normalizeOperationEvidence,
|
|
750
767
|
normalizeSaveEvidence,
|
|
751
768
|
projectRunSettlement,
|
|
769
|
+
selectPrimaryFailure,
|
|
752
770
|
selectExpectedFilesForTrackedUndo,
|
|
753
771
|
settle,
|
|
754
772
|
settleLegacyUndo,
|