codex-overleaf-link 2.5.1 → 2.6.5
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 +149 -398
- package/README.zh-CN.md +153 -404
- package/extension/bootstrap/manifest.template.json +1 -1
- package/extension/src/background.js +148 -3
- package/extension/src/backgroundSharedSessions.js +55 -2
- package/extension/src/backgroundUpdateCoordinator.js +128 -12
- package/extension/src/content/activeTurnControl.js +164 -7
- package/extension/src/content/composerAttachments.js +46 -10
- package/extension/src/content/composerPanel.js +92 -12
- package/extension/src/content/contentRuntime.js +1114 -321
- package/extension/src/content/contextTray.js +8 -2
- package/extension/src/content/contextUsageView.js +267 -0
- package/extension/src/content/diagnosticsController.js +77 -34
- package/extension/src/content/diagnosticsExport.js +1 -1
- package/extension/src/content/diagnosticsPanel.js +147 -42
- package/extension/src/content/generated/content.bundle.js +5761 -1237
- package/extension/src/content/generated/content.bundle.meta.json +6 -3
- package/extension/src/content/legacyGlobalRegistry.js +4 -0
- package/extension/src/content/localSkillsPanel.js +6 -4
- package/extension/src/content/markdownDomRenderer.js +5 -3
- package/extension/src/content/markdownText.js +53 -14
- package/extension/src/content/modelPicker.js +29 -19
- package/extension/src/content/nativeCompatibilityController.js +52 -19
- package/extension/src/content/otWarmMirror.js +1 -1
- package/extension/src/content/pageBridgeClient.js +7 -7
- package/extension/src/content/panelMaintenance.js +10 -2
- package/extension/src/content/panelRenderer.js +55 -28
- package/extension/src/content/pendingInputView.js +1 -1
- package/extension/src/content/projectSettingsCoordinator.js +30 -6
- package/extension/src/content/providerSettingsDialog.js +28 -19
- package/extension/src/content/recentProjects.js +30 -19
- package/extension/src/content/runActivitySummary.js +122 -14
- package/extension/src/content/runCompletionMeta.js +194 -6
- package/extension/src/content/runController.js +2 -1
- package/extension/src/content/runFailureNotice.js +8 -1
- package/extension/src/content/runPresence.js +18 -8
- package/extension/src/content/runQueueScheduler.js +27 -13
- package/extension/src/content/runRecoveryActions.js +2 -1
- package/extension/src/content/runResultActions.js +73 -24
- package/extension/src/content/runReviewController.js +102 -37
- package/extension/src/content/runTimelineView.js +224 -25
- package/extension/src/content/scopedPersistencePanelState.js +124 -46
- package/extension/src/content/selectionContextView.js +30 -3
- package/extension/src/content/sensitivePreflight.js +14 -1
- package/extension/src/content/sessionManager.js +49 -3
- package/extension/src/content/sessionMenuView.js +54 -18
- package/extension/src/content/sessionPersistence.js +25 -5
- package/extension/src/content/settingsPanel.js +15 -2
- package/extension/src/content/settingsWorkbench.js +127 -89
- package/extension/src/content/sharedSessionViewSync.js +13 -4
- package/extension/src/content/subagentActivityView.js +23 -7
- package/extension/src/content/updateNotice.js +60 -6
- package/extension/src/content/writebackOrchestrator.js +301 -72
- package/extension/src/content/writingStyleSettings.js +70 -17
- package/extension/src/page/compileBridge.js +193 -180
- package/extension/src/page/overleafCapabilities.js +4 -1
- package/extension/src/page/overleafEditor.js +12 -3
- package/extension/src/page/overleafProjectSnapshot.js +56 -3
- package/extension/src/page/snapshotRouter.js +75 -66
- package/extension/src/page/textCoordinates.js +17 -1
- package/extension/src/page/textFileCreator.js +9 -1
- package/extension/src/page/treeOperations.js +200 -19
- package/extension/src/page/writebackRouter.js +172 -113
- package/extension/src/pageBridge.js +124 -73
- package/extension/src/popup.js +1 -1
- package/extension/src/shared/agentTranscript.js +372 -18
- package/extension/src/shared/auditRecords.js +3 -0
- package/extension/src/shared/compatibility.js +1 -1
- package/extension/src/shared/compileAdapter.js +58 -17
- package/extension/src/shared/composerAttachmentDraft.js +27 -7
- package/extension/src/shared/contextUsage.js +125 -0
- package/extension/src/shared/failureReasons.js +57 -3
- package/extension/src/shared/i18n.js +315 -29
- package/extension/src/shared/lineReferences.js +38 -31
- package/extension/src/shared/pageRpcContract.js +1 -1
- package/extension/src/shared/panelIcons.js +39 -0
- package/extension/src/shared/projectFiles.js +2 -1
- 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/scopedPersistenceBrowserAdapter.js +34 -0
- package/extension/src/shared/sessionState.js +63 -4
- package/extension/src/shared/sessionTitle.js +14 -1
- package/extension/src/shared/sharedSessionBridge.js +81 -13
- package/extension/src/shared/staleGuard.js +130 -63
- package/extension/src/shared/storageDb.js +35 -3
- package/extension/src/shared/storageMigration.js +111 -2
- package/extension/src/shared/storageRunActions.js +62 -8
- package/extension/src/shared/undoOperations.js +126 -28
- package/extension/src/shared/updateRuntimeIdentity.js +16 -2
- package/extension/src/shared/writebackSettlement.js +21 -3
- package/extension/styles/panel.css +1293 -549
- package/native-host/src/bootstrapUpdate.js +52 -16
- package/native-host/src/chatBridgeRequest.js +60 -6
- package/native-host/src/chatBridgeResponse.js +10 -1
- package/native-host/src/chatCompletionsBridge.js +29 -2
- package/native-host/src/codexPromptAssembly.js +86 -118
- package/native-host/src/codexSessionRunner.js +127 -17
- package/native-host/src/debugLog.js +27 -3
- package/native-host/src/index.js +42 -11
- package/native-host/src/localSkills.js +1 -1
- package/native-host/src/mirrorWorkspace.js +47 -3
- package/native-host/src/nativeEnvironment.js +27 -5
- package/native-host/src/providerContextError.js +20 -0
- package/native-host/src/providerRuntime.js +1 -0
- package/native-host/src/skills/reviewer-response/SKILL.md +65 -0
- package/native-host/src/taskRunnerRuntime.js +28 -8
- package/native-host/src/textPatch.js +473 -377
- package/native-host/src/updateManager.js +144 -21
- package/native-host/src/writingStyleRuntime.js +1 -1
- package/package.json +5 -8
|
@@ -347,7 +347,20 @@
|
|
|
347
347
|
const input = node('input'); input.type = 'search'; input.value = query; input.dataset.styleFocus = 'project-search';
|
|
348
348
|
input.placeholder = tx('Search all Overleaf projects', '搜索全部 Overleaf 项目');
|
|
349
349
|
input.setAttribute('aria-label', input.placeholder);
|
|
350
|
-
|
|
350
|
+
let composing = false;
|
|
351
|
+
const updateResults = () => {
|
|
352
|
+
query = input.value;
|
|
353
|
+
const results = input.closest('.ws2-picker')?.querySelector('.ws2-projects');
|
|
354
|
+
if (results) renderProjectResults(results);
|
|
355
|
+
};
|
|
356
|
+
input.addEventListener('compositionstart', () => { composing = true; });
|
|
357
|
+
input.addEventListener('compositionend', () => {
|
|
358
|
+
composing = false;
|
|
359
|
+
updateResults();
|
|
360
|
+
});
|
|
361
|
+
input.addEventListener('input', event => {
|
|
362
|
+
if (!composing && !event.isComposing) updateResults();
|
|
363
|
+
});
|
|
351
364
|
search.append(input); panel.append(search);
|
|
352
365
|
const filters = node('div', 'ws2-filters');
|
|
353
366
|
for (const [value, label] of [['all', tx('All', '全部')], ['active', tx('Active', '常规')], ['archived', tx('Archived', '已归档')]]) {
|
|
@@ -358,6 +371,16 @@
|
|
|
358
371
|
panel.append(filters);
|
|
359
372
|
const list = node('div', 'ws2-projects');
|
|
360
373
|
list.setAttribute('role', 'group'); list.setAttribute('aria-label', tx('Overleaf projects', 'Overleaf 项目'));
|
|
374
|
+
renderProjectResults(list);
|
|
375
|
+
panel.append(list);
|
|
376
|
+
const footer = node('div', 'ws2-picker-footer');
|
|
377
|
+
footer.append(node('span', '', tx(sources.length + ' of 3 references selected', '已选 ' + sources.length + ' / 3 份资料')),
|
|
378
|
+
button(tx('Done', '完成'), () => { pickerOpen = false; render(); }, 'ws2-button ws2-button-primary', 'picker-done'));
|
|
379
|
+
panel.append(footer); return panel;
|
|
380
|
+
}
|
|
381
|
+
function renderProjectResults(list) {
|
|
382
|
+
const oldScroll = list.scrollTop;
|
|
383
|
+
list.replaceChildren();
|
|
361
384
|
if (projectLoading) {
|
|
362
385
|
const loading = node('div', 'ws2-picker-state');
|
|
363
386
|
loading.append(node('span', 'ws2-pulse'), node('span', '', tx('Loading project directory…', '正在加载项目目录…')));
|
|
@@ -395,11 +418,7 @@
|
|
|
395
418
|
if (!matches.length) list.append(node('div', 'ws2-picker-state',
|
|
396
419
|
query ? tx('No projects match this search.', '没有匹配的项目。') : tx('No projects in this group.', '此分组暂无项目。')));
|
|
397
420
|
}
|
|
398
|
-
|
|
399
|
-
const footer = node('div', 'ws2-picker-footer');
|
|
400
|
-
footer.append(node('span', '', tx(sources.length + ' of 3 references selected', '已选 ' + sources.length + ' / 3 份资料')),
|
|
401
|
-
button(tx('Done', '完成'), () => { pickerOpen = false; render(); }, 'ws2-button ws2-button-primary', 'picker-done'));
|
|
402
|
-
panel.append(footer); return panel;
|
|
421
|
+
list.scrollTop = oldScroll;
|
|
403
422
|
}
|
|
404
423
|
function renderSources() {
|
|
405
424
|
const section = node('section', 'ws2-library');
|
|
@@ -480,6 +499,38 @@
|
|
|
480
499
|
}
|
|
481
500
|
return section;
|
|
482
501
|
}
|
|
502
|
+
function replaceAround(parent, fresh, retained, replacement) {
|
|
503
|
+
for (const child of Array.from(parent.childNodes)) {
|
|
504
|
+
if (child !== retained) child.remove();
|
|
505
|
+
}
|
|
506
|
+
let before = true;
|
|
507
|
+
for (const child of Array.from(fresh.childNodes)) {
|
|
508
|
+
if (child === replacement) before = false;
|
|
509
|
+
else parent.insertBefore(child, before ? retained : null);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
function renderKeepingProjectSearch(content) {
|
|
513
|
+
const library = host.querySelector('.ws2-library');
|
|
514
|
+
const picker = library?.querySelector('.ws2-picker');
|
|
515
|
+
const search = picker?.querySelector('.ws2-search');
|
|
516
|
+
const nextLibrary = content.querySelector('.ws2-library');
|
|
517
|
+
const nextPicker = nextLibrary?.querySelector('.ws2-picker');
|
|
518
|
+
if (!search || !nextPicker) {
|
|
519
|
+
host.replaceChildren(content);
|
|
520
|
+
return false;
|
|
521
|
+
}
|
|
522
|
+
// Keep every ancestor connected: detaching and refocusing an input
|
|
523
|
+
// cannot restore its IME composition when an async catalog read settles.
|
|
524
|
+
const input = search.querySelector('input');
|
|
525
|
+
const nextSearch = nextPicker.querySelector('.ws2-search');
|
|
526
|
+
input.placeholder = nextSearch.querySelector('input').placeholder;
|
|
527
|
+
input.setAttribute('aria-label', input.placeholder);
|
|
528
|
+
picker.setAttribute('aria-label', nextPicker.getAttribute('aria-label'));
|
|
529
|
+
replaceAround(picker, nextPicker, search, nextSearch);
|
|
530
|
+
replaceAround(library, nextLibrary, picker, nextPicker);
|
|
531
|
+
replaceAround(host, content, library, nextLibrary);
|
|
532
|
+
return document.activeElement === input;
|
|
533
|
+
}
|
|
483
534
|
function render() {
|
|
484
535
|
if (!host?.isConnected) return;
|
|
485
536
|
alignScope();
|
|
@@ -487,7 +538,8 @@
|
|
|
487
538
|
const oldScroll = host.querySelector('.ws2-projects')?.scrollTop || 0;
|
|
488
539
|
const heading = host.closest('[data-set-group]')?.querySelector('[data-writing-style-heading]');
|
|
489
540
|
if (heading) heading.textContent = tx('Writing style', '写作风格');
|
|
490
|
-
host.classList.add('ws2');
|
|
541
|
+
host.classList.add('ws2');
|
|
542
|
+
const content = document.createDocumentFragment();
|
|
491
543
|
const top = node('div', 'ws2-heading');
|
|
492
544
|
const copy = node('div', 'ws2-heading-copy');
|
|
493
545
|
const title = node('label', 'ws2-title', tx('Write in My Style', '沿用写作风格'));
|
|
@@ -501,7 +553,7 @@
|
|
|
501
553
|
toggleInput.dataset.styleFocus = 'enable-style'; toggleInput.checked = desiredEnabled;
|
|
502
554
|
toggleInput.disabled = !scope || !meta || toggleBusy || (working() && !meta?.ready);
|
|
503
555
|
toggleInput.addEventListener('change', () => { void toggle(toggleInput.checked); });
|
|
504
|
-
top.append(copy, toggleInput);
|
|
556
|
+
top.append(copy, toggleInput); content.append(top);
|
|
505
557
|
if (meta?.ready) {
|
|
506
558
|
const summary = node('div', 'ws2-profile');
|
|
507
559
|
const mark = node('span', 'ws2-profile-icon'); mark.append(icon('check'));
|
|
@@ -518,16 +570,16 @@
|
|
|
518
570
|
const view = button(preview ? tx('Hide preview', '收起预览') : tx('Preview style', '预览风格'),
|
|
519
571
|
() => { void loadPreview(); }, 'ws2-button ws2-button-quiet', 'preview-style');
|
|
520
572
|
view.disabled = previewBusy;
|
|
521
|
-
summary.append(mark, info, view);
|
|
573
|
+
summary.append(mark, info, view); content.append(summary);
|
|
522
574
|
}
|
|
523
575
|
const editing = expanded || working();
|
|
524
576
|
const manage = button(editing ? tx('Hide references', '收起参考资料')
|
|
525
577
|
: meta?.ready ? tx('Manage references', '管理参考资料') : tx('Choose references', '选择参考资料'),
|
|
526
578
|
() => { expanded = !expanded; pickerOpen = false; render(); }, 'ws2-manage', 'manage-references');
|
|
527
579
|
manage.setAttribute('aria-expanded', String(editing));
|
|
528
|
-
manage.disabled = working(); manage.append(icon('arrow'));
|
|
580
|
+
manage.disabled = working(); manage.append(icon('arrow')); content.append(manage);
|
|
529
581
|
if (editing) {
|
|
530
|
-
|
|
582
|
+
content.append(renderSources());
|
|
531
583
|
if (working()) {
|
|
532
584
|
const progress = node('div', 'ws2-progress'); progress.setAttribute('role', 'status');
|
|
533
585
|
const phase = activeGeneration?.phase || 'learning';
|
|
@@ -545,7 +597,7 @@
|
|
|
545
597
|
}
|
|
546
598
|
progress.append(steps);
|
|
547
599
|
const stop = button(tx('Cancel', '取消'), () => { void cancel(); }, 'ws2-button', 'cancel-generation');
|
|
548
|
-
stop.disabled = cancelling; progress.append(stop);
|
|
600
|
+
stop.disabled = cancelling; progress.append(stop); content.append(progress);
|
|
549
601
|
} else {
|
|
550
602
|
const footer = node('div', 'ws2-actions');
|
|
551
603
|
const help = node('div', 'ws2-action-copy');
|
|
@@ -559,8 +611,8 @@
|
|
|
559
611
|
const generateButton = button(meta?.ready ? tx('Update style', '更新风格') : tx('Generate style', '生成风格'),
|
|
560
612
|
() => { void generate(); }, 'ws2-button ws2-button-primary', 'generate-style');
|
|
561
613
|
generateButton.disabled = !scope || !meta || !sources.length || deps.isRunning();
|
|
562
|
-
footer.append(generateButton);
|
|
563
|
-
if (deps.isRunning())
|
|
614
|
+
footer.append(generateButton); content.append(footer);
|
|
615
|
+
if (deps.isRunning()) content.append(node('p', 'ws2-caption', tx('Available after the current task finishes.', '当前任务结束后可生成。')));
|
|
564
616
|
}
|
|
565
617
|
}
|
|
566
618
|
if (message || !meta) {
|
|
@@ -570,12 +622,13 @@
|
|
|
570
622
|
if (!meta && message) status.append(button(tx('Retry', '重试'), () => {
|
|
571
623
|
message = ''; messageTone = ''; render(); void ensureLoaded(true).catch(() => {});
|
|
572
624
|
}, 'ws2-button', 'retry-settings'));
|
|
573
|
-
|
|
625
|
+
content.append(status);
|
|
574
626
|
}
|
|
575
|
-
if (preview)
|
|
627
|
+
if (preview) content.append(renderPreview());
|
|
628
|
+
const searchKeptFocus = renderKeepingProjectSearch(content);
|
|
576
629
|
const scroll = host.querySelector('.ws2-projects');
|
|
577
630
|
if (scroll) scroll.scrollTop = oldScroll;
|
|
578
|
-
restoreFocus(focus);
|
|
631
|
+
if (!searchKeptFocus) restoreFocus(focus);
|
|
579
632
|
}
|
|
580
633
|
function mount(panel) {
|
|
581
634
|
const next = panel?.querySelector('[data-writing-style-settings]');
|