codex-overleaf-link 2.2.0 → 2.3.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.
Files changed (72) hide show
  1. package/README.md +25 -23
  2. package/extension/bootstrap/manifest.template.json +1 -1
  3. package/extension/runtime-manifest.json +5 -71
  4. package/extension/src/background.js +53 -69
  5. package/extension/src/backgroundUpdateCoordinator.js +128 -66
  6. package/extension/src/content/applyResultFormatters.js +2 -3
  7. package/extension/src/content/contentRuntime.js +650 -1449
  8. package/extension/src/content/contextTray.js +4 -6
  9. package/extension/src/content/diagnosticsController.js +1 -2
  10. package/extension/src/content/diffReviewPanel.js +14 -13
  11. package/extension/src/content/generated/content.bundle.js +41370 -0
  12. package/extension/src/content/generated/content.bundle.meta.json +102 -0
  13. package/extension/src/content/legacyGlobalRegistry.js +129 -0
  14. package/extension/src/content/markdownText.js +5 -7
  15. package/extension/src/content/modelPicker.js +1 -1
  16. package/extension/src/content/modelPickerSupport.js +10 -5
  17. package/extension/src/content/moduleRegistryKernel.js +125 -0
  18. package/extension/src/content/nativeCompatibilityController.js +313 -0
  19. package/extension/src/content/otWarmMirror.js +7 -5
  20. package/extension/src/content/pageBridgeClient.js +224 -0
  21. package/extension/src/content/panelMaintenance.js +8 -3
  22. package/extension/src/content/postNavigationSettlementPersistence.js +100 -0
  23. package/extension/src/content/projectProviderSelection.js +4 -12
  24. package/extension/src/content/projectSessionCleanup.js +3 -3
  25. package/extension/src/content/providerSettingsCoordinator.js +59 -26
  26. package/extension/src/content/providerSettingsDialog.js +30 -18
  27. package/extension/src/content/recentProjects.js +15 -23
  28. package/extension/src/content/runGuidanceController.js +1 -1
  29. package/extension/src/content/runQueueScheduler.js +129 -29
  30. package/extension/src/content/runSettlementPersistence.js +51 -0
  31. package/extension/src/content/runTimelineView.js +11 -8
  32. package/extension/src/content/scopedPersistenceCoordinator.js +100 -0
  33. package/extension/src/content/scopedPersistenceDetachedCommit.js +47 -0
  34. package/extension/src/content/scopedPersistencePanelState.js +111 -0
  35. package/extension/src/content/sessionManager.js +15 -12
  36. package/extension/src/content/sessionPersistence.js +67 -8
  37. package/extension/src/content/updateNotice.js +10 -4
  38. package/extension/src/content/writebackOrchestrator.js +91 -23
  39. package/extension/src/contentScript.js +5 -1
  40. package/extension/src/page/trackedChangesLifecycle.js +6 -1
  41. package/extension/src/pageBridge.js +47 -98
  42. package/extension/src/shared/agentTranscript.js +8 -5
  43. package/extension/src/shared/compatibility.js +1 -1
  44. package/extension/src/shared/governanceRules.js +1 -1
  45. package/extension/src/shared/managedUpdateProjection.js +337 -0
  46. package/extension/src/shared/nativeRequestIdentity.js +60 -0
  47. package/extension/src/shared/otText.js +0 -19
  48. package/extension/src/shared/pageRpcContract.js +136 -0
  49. package/extension/src/shared/runExecutionSnapshot.js +177 -0
  50. package/extension/src/shared/runExecutionSnapshotCodec.js +168 -0
  51. package/extension/src/shared/runInputQueue.js +81 -34
  52. package/extension/src/shared/scopedPersistenceBrowserAdapter.js +79 -0
  53. package/extension/src/shared/scopedPersistenceQueuePolicy.js +181 -0
  54. package/extension/src/shared/scopedPersistenceTransaction.js +238 -0
  55. package/extension/src/shared/sessionState.js +64 -48
  56. package/extension/src/shared/settlementFacts.js +351 -0
  57. package/extension/src/shared/storageDb.js +19 -5
  58. package/extension/src/shared/storageMigration.js +275 -61
  59. package/extension/src/shared/storageSessionClaims.js +60 -0
  60. package/extension/src/shared/updateConsent.js +4 -0
  61. package/extension/src/shared/updateRevocationIntent.js +109 -0
  62. package/extension/src/shared/writebackEvidenceProjection.js +150 -0
  63. package/extension/src/shared/writebackOperationEvidence.js +143 -0
  64. package/extension/src/shared/writebackSettlement.js +705 -0
  65. package/native-host/src/codexRuntimeIdentity.js +1 -1
  66. package/native-host/src/codexSessionRunner.js +7 -13
  67. package/native-host/src/index.js +3 -69
  68. package/native-host/src/managedInstall.js +50 -8
  69. package/native-host/src/mirrorWorkspace.js +15 -8
  70. package/native-host/src/nativeTransportEnvelope.js +148 -0
  71. package/native-host/src/taskRunnerRuntime.js +3 -3
  72. package/package.json +13 -5
@@ -1,10 +1,10 @@
1
1
  (function initCodexOverleafContextTray(root, factory) {
2
2
  if (typeof module === 'object' && module.exports) {
3
- module.exports = factory();
3
+ module.exports = factory(require('../shared/projectFiles'));
4
4
  } else {
5
- root.CodexOverleafContextTray = factory();
5
+ root.CodexOverleafModuleRegistry.define('ContextTray', ['ProjectFiles'], factory);
6
6
  }
7
- })(typeof window !== 'undefined' ? window : globalThis, function contextTrayFactory() {
7
+ })(typeof window !== 'undefined' ? window : globalThis, function contextTrayFactory(ProjectFiles) {
8
8
  'use strict';
9
9
 
10
10
  const DEFAULT_CONTEXT_EXACT_FILE_LIST_ZIP_TIMEOUT_MS = 30000;
@@ -38,9 +38,7 @@
38
38
  || root.document
39
39
  || (typeof globalThis !== 'undefined' ? globalThis.document : null);
40
40
  const getLocationHref = getLocationHrefDep || (() => root.location?.href || '');
41
- const projectFiles = projectFilesDep
42
- || root.CodexOverleafProjectFiles
43
- || (typeof window !== 'undefined' ? window.CodexOverleafProjectFiles : null);
41
+ const projectFiles = projectFilesDep || ProjectFiles;
44
42
  const exactFileListZipTimeoutMs = Number(exactFileListZipTimeoutMsDep) ||
45
43
  DEFAULT_CONTEXT_EXACT_FILE_LIST_ZIP_TIMEOUT_MS;
46
44
 
@@ -1,8 +1,6 @@
1
1
  (function initCodexOverleafDiagnosticsController() {
2
2
  'use strict';
3
3
 
4
- const CodexOverleafCompatibility = window.CodexOverleafCompatibility;
5
-
6
4
  // Diagnostics controller — the check runners (inspect*) and result formatters
7
5
  // carved out of contentRuntime.js (v1.4.5 structural-debt phase 1). The code
8
6
  // below moved verbatim (original indentation kept); runtime collaborators are
@@ -10,6 +8,7 @@
10
8
  // state, OT status) is read through injected getters.
11
9
  function create(deps = {}) {
12
10
  const {
11
+ Compatibility: CodexOverleafCompatibility,
13
12
  tr,
14
13
  tx,
15
14
  getExtensionCompatibilityMetadata,
@@ -1,10 +1,10 @@
1
1
  (function initCodexOverleafDiffReviewPanel(root, factory) {
2
2
  if (typeof module === 'object' && module.exports) {
3
- module.exports = factory();
3
+ module.exports = factory(require('./reviewHunks'));
4
4
  } else {
5
- root.CodexOverleafDiffReviewPanel = factory();
5
+ root.CodexOverleafModuleRegistry.define('DiffReviewPanel', ['ReviewHunks'], factory);
6
6
  }
7
- })(typeof window !== 'undefined' ? window : globalThis, function diffReviewPanelFactory() {
7
+ })(typeof window !== 'undefined' ? window : globalThis, function diffReviewPanelFactory(ReviewHunks) {
8
8
  'use strict';
9
9
 
10
10
  const MAX_INITIAL_REVIEW_HUNKS = 20;
@@ -17,15 +17,14 @@
17
17
  const callPageBridge = typeof deps.callPageBridge === 'function'
18
18
  ? deps.callPageBridge
19
19
  : () => Promise.resolve({ ok: false, reason: tr('diffHunkJumpFailed') });
20
+ const getCurrentProjectId = typeof deps.getCurrentProjectId === 'function'
21
+ ? deps.getCurrentProjectId
22
+ : () => '';
20
23
  const getRunEvents = typeof deps.getRunEvents === 'function' ? deps.getRunEvents : () => null;
21
24
  const appendRunEvent = typeof deps.appendRunEvent === 'function' ? deps.appendRunEvent : () => {};
22
25
  const scrollLogToBottom = typeof deps.scrollLogToBottom === 'function' ? deps.scrollLogToBottom : () => {};
23
26
 
24
- function getReviewHunks() {
25
- return deps.reviewHunks ||
26
- root.CodexOverleafReviewHunks ||
27
- (typeof window !== 'undefined' ? window.CodexOverleafReviewHunks : null);
28
- }
27
+ const getReviewHunks = () => deps.reviewHunks || ReviewHunks;
29
28
 
30
29
  function createDiffReviewElement(syncChanges, options = {}) {
31
30
  const readonly = Boolean(options.readonly);
@@ -37,10 +36,7 @@
37
36
  if (readonly) {
38
37
  container.dataset.readonly = 'true';
39
38
  }
40
- const reviewHunks = options.reviewHunks ||
41
- deps.reviewHunks ||
42
- root.CodexOverleafReviewHunks ||
43
- (typeof window !== 'undefined' ? window.CodexOverleafReviewHunks : null);
39
+ const reviewHunks = options.reviewHunks || getReviewHunks();
44
40
  const reviewModel = reviewHunks?.buildReviewModel?.(syncChanges) || { files: [], hunks: [] };
45
41
  const reviewFilesByIndex = new Map(reviewModel.files.map(file => [file.index, file]));
46
42
  const fileStates = new Map();
@@ -249,7 +245,12 @@
249
245
  const view = hunkViews.get(reviewHunk.decisionKey);
250
246
  setHunkJumpStatus(view, 'pending', '');
251
247
  try {
252
- const result = await callPageBridge('jumpToPosition', { path, from, to });
248
+ const result = await callPageBridge('jumpToPosition', {
249
+ path,
250
+ from,
251
+ to,
252
+ runProjectId: getCurrentProjectId()
253
+ });
253
254
  if (result?.ok === false) {
254
255
  setHunkJumpStatus(view, 'failed', result.reason || tr('diffHunkJumpFailed'));
255
256
  } else {