agent-things 1.3.2 → 1.3.3

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.
@@ -244,6 +244,11 @@ export const createPresentation = function createPresentation(lang) {
244
244
  updateFailedLabel: '升级失败',
245
245
  upgradeBtn: '立即升级',
246
246
  upgradingShort: '正在升级…',
247
+ checkUpdateBtn: '检查更新',
248
+ checkingUpdateShort: '正在检查…',
249
+ alreadyLatestPattern: '当前已是最新版 v{version}',
250
+ versionTagPattern: 'v{version}',
251
+ checkUpdateFailedLabel: '检查更新失败',
247
252
  pleaseWait: '请稍候',
248
253
  completedShort: '已完成',
249
254
  retryBtn: '重试',
@@ -433,6 +438,11 @@ export const createPresentation = function createPresentation(lang) {
433
438
  updateFailedLabel: 'Upgrade failed',
434
439
  upgradeBtn: 'Upgrade',
435
440
  upgradingShort: 'Upgrading...',
441
+ checkUpdateBtn: 'Check updates',
442
+ checkingUpdateShort: 'Checking...',
443
+ alreadyLatestPattern: 'Up to date (v{version})',
444
+ versionTagPattern: 'v{version}',
445
+ checkUpdateFailedLabel: 'Update check failed',
436
446
  pleaseWait: 'Please wait',
437
447
  completedShort: 'Done',
438
448
  retryBtn: 'Retry',
@@ -522,6 +532,72 @@ export const createPresentation = function createPresentation(lang) {
522
532
  function analysisDisabled(busy, analyzing, upgradeStage) {
523
533
  return Boolean(busy || analyzing || ['waiting', 'installing'].includes(upgradeStage));
524
534
  }
535
+ function updateBannerState(info, dict, options = {}) {
536
+ const textDict = dict || {};
537
+ const fmtText = (template, vars = {}) => String(template || '').replace(/\{(\w+)\}/g, (_, k) => (vars[k] !== undefined ? String(vars[k]) : ''));
538
+ const update = info?.update;
539
+ const stage = update?.stage;
540
+ const stages = textDict.updateStages || {
541
+ queued: 'Preparing upgrade',
542
+ checking: 'Checking version',
543
+ downloading: 'Downloading update',
544
+ waiting: 'Waiting for analysis to finish',
545
+ installing: 'Upgrading',
546
+ };
547
+ const activeStage = Boolean(stages[stage]) || Boolean(options.starting);
548
+ const updatedAtMs = update?.updatedAt ? Date.parse(update.updatedAt) : NaN;
549
+ const now = options.now ?? Date.now();
550
+ const completed = stage === 'completed' && Number.isFinite(updatedAtMs) && now - updatedAtMs < 60000;
551
+ const failed = stage === 'failed';
552
+ const visible = Boolean(info?.available || activeStage || failed || completed);
553
+ const command = info?.command || 'npx agent-things@latest';
554
+ const label = activeStage
555
+ ? (stages[stage] || stages.queued)
556
+ : failed
557
+ ? fmtText(textDict.updateFailedLabel || 'Upgrade failed')
558
+ : completed
559
+ ? fmtText(textDict.upgradedToPattern || 'Upgraded to v{version}', { version: update?.currentVersion || '' })
560
+ : fmtText(textDict.updateAvailablePattern || 'Update available v{version}', { version: info?.latestVersion || '' });
561
+ const buttonText = activeStage
562
+ ? (textDict.pleaseWait || 'Please wait')
563
+ : completed
564
+ ? (textDict.completedShort || 'Done')
565
+ : failed
566
+ ? (textDict.retryBtn || 'Retry')
567
+ : (textDict.upgradeBtn || 'Upgrade');
568
+ const detail = options.connectionError
569
+ ? `${textDict.reconnectHint || ''}\n${textDict.terminalUpgradePrefix || ''}${command}`
570
+ : failed
571
+ ? `${update?.error || ''}\n${textDict.terminalUpgradePrefix || ''}${command}`
572
+ : (completed && update?.reconnectMcp ? (textDict.reconnectMcpHint || '') : '');
573
+ const currentVersion = info?.currentVersion || '';
574
+ const checkFailed = !visible && options.manualCheckStatus === 'failed';
575
+ let versionText = currentVersion ? fmtText(textDict.versionTagPattern || 'v{version}', { version: currentVersion }) : '';
576
+ if (checkFailed) {
577
+ const errText = options.checkError || info?.checkError || '';
578
+ versionText = errText ? `${textDict.checkUpdateFailedLabel || 'Update check failed'}: ${errText}` : (textDict.checkUpdateFailedLabel || 'Update check failed');
579
+ } else if (!visible && options.manualCheckStatus === 'latest' && currentVersion) {
580
+ versionText = fmtText(textDict.alreadyLatestPattern || 'Up to date (v{version})', { version: currentVersion });
581
+ }
582
+ const checking = Boolean(options.checking);
583
+ return {
584
+ visible,
585
+ active: activeStage,
586
+ completed,
587
+ failed,
588
+ buttonDisabled: activeStage || completed,
589
+ label,
590
+ buttonText,
591
+ detail,
592
+ currentVersion,
593
+ versionText,
594
+ showVersionBar: !visible,
595
+ checking,
596
+ checkDisabled: checking,
597
+ checkFailed,
598
+ checkButtonText: checking ? (textDict.checkingUpdateShort || 'Checking...') : (textDict.checkUpdateBtn || 'Check updates'),
599
+ };
600
+ }
525
601
 
526
602
  const active = forLang(currentLang);
527
603
  return {
@@ -544,6 +620,7 @@ export const createPresentation = function createPresentation(lang) {
544
620
  progressState,
545
621
  draftTransition,
546
622
  analysisDisabled,
623
+ updateBannerState,
547
624
  };
548
625
  };
549
626
  export function getUiForLang(lang) {
@@ -487,7 +487,7 @@ function installCodexSessionStatus(version, restored, embedded) {
487
487
  panelEvent('close', panel.entry);
488
488
  const target = panel; panel = null;
489
489
  clearTimeout(target.pollTimer); cancelAnimationFrame(target.marqueeFrame);
490
- clearTimeout(target.updateTimer);
490
+ clearTimeout(target.updateTimer); clearTimeout(target.manualCheckTimer);
491
491
  target.resizeObserver?.disconnect();
492
492
  target.root.remove(); target.entry.button.setAttribute('aria-expanded', 'false');
493
493
  if (restoreFocus && target.entry.host.isConnected) target.entry.button.focus();
@@ -522,6 +522,7 @@ function installCodexSessionStatus(version, restored, embedded) {
522
522
  .note-label{display:block;font-size:11px;color:var(--secondary);margin-bottom:8px}textarea{display:block;width:100%;resize:vertical;min-height:66px;max-height:140px;background:var(--input-bg);color:inherit;border:1px solid var(--input-border);border-radius:8px;padding:9px;line-height:1.6;font-size:12px;scrollbar-width:none;-ms-overflow-style:none}textarea::-webkit-scrollbar{display:none;width:0;height:0}textarea::placeholder{color:var(--muted)}.edit-actions{display:flex;justify-content:flex-end;gap:18px;align-items:center;padding:21px 0 16px}.git{font-size:11px;color:var(--secondary)}.analysis-message{font-size:11px;color:var(--secondary);margin:0 0 13px}.analysis-message:empty,.error:empty,.git:empty{display:none}.error{flex:none;font-size:12px;color:var(--error);padding-top:10px;white-space:pre-wrap}button:disabled,input:disabled,textarea:disabled{opacity:.55;cursor:wait}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
523
523
  .shell textarea:focus-visible{outline:none}
524
524
  .app-update{margin-top:3px;padding:10px 11px;background:var(--hover);border:1px solid var(--line);border-radius:10px}.app-update-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.app-update-label{font-size:12px;line-height:18px;color:var(--ink);min-width:0;overflow-wrap:anywhere}.app-update-button{flex:none;padding:5px 10px;min-height:28px;border-radius:7px;font-size:11px}.app-update-detail{margin-top:7px;font-size:11px;line-height:1.6;color:var(--secondary);white-space:pre-wrap;overflow-wrap:anywhere;user-select:text}.app-update[data-failed=true] .app-update-detail{color:var(--error)}
525
+ .version-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0 2px;font-size:11px;line-height:16px;color:var(--muted)}.version-bar-text{min-width:0;overflow-wrap:anywhere}.version-bar[data-failed=true] .version-bar-text{color:var(--error)}.version-check-button{flex:none;font-size:11px;color:var(--muted)}.version-check-button:hover:not(:disabled){color:inherit}
525
526
  :host([data-color-mode=light]){--ink:#22272e;--secondary:#576374;--muted:#667383;--note:#46515f;--track:#dfe4ea;--line:#dfe4ea;--input-border:#c7d0da;--input-bg:#f7f9fb;--hover:#f0f3f6;--selected:#e9edf2;--source-bg:#e9eef4;--number-line:#b6c1ce;--thumb:#ffffff;--danger:#bf2f3a;--error:#b13a2d;color:var(--ink);color-scheme:light}
526
527
  :host([data-color-mode=light]) .shell{--panel-bg:#fff;border-color:#dfe4ea;box-shadow:0 14px 45px #26344520}
527
528
  :host([data-color-mode=light]) .shell:hover{--panel-bg:#f5f6f7}
@@ -592,6 +593,9 @@ function installCodexSessionStatus(version, restored, embedded) {
592
593
  const appUpdateLabel = element('span', null, appUpdateRow, 'app-update-label'); appUpdateLabel.setAttribute('role', 'status');
593
594
  const appUpdateButton = element('button', S('upgradeBtn'), appUpdateRow, 'primary app-update-button');
594
595
  const appUpdateDetail = element('div', null, appUpdate, 'app-update-detail'); appUpdateDetail.hidden = true;
596
+ const versionBar = element('div', null, overview, 'version-bar'); versionBar.hidden = true;
597
+ const versionBarText = element('span', null, versionBar, 'version-bar-text'); versionBarText.setAttribute('role', 'status');
598
+ const checkUpdateButton = element('button', S('checkUpdateBtn'), versionBar, 'text-button version-check-button');
595
599
  const edit = element('div', null, body, 'view edit-view'); edit.hidden = true;
596
600
  const editHeading = element('div', null, edit, 'view-heading'); const editHeadingTitle = element('h3', S('editHeading'), editHeading);
597
601
  const choices = new Map(), choiceLabels = new Map(), controls = [];
@@ -677,6 +681,8 @@ function installCodexSessionStatus(version, restored, embedded) {
677
681
  if (timelineBackBtn) timelineBackBtn.textContent = S('backLabel');
678
682
  resolveConflict.textContent = S('resolveConflictBtn');
679
683
  target.tasksKey = null; target.completedKey = null; target.timelineRevision = null;
684
+ if (target.updateInfo || target.updateChecking || target.manualCheckStatus) showAppUpdate(target.updateInfo);
685
+ else checkUpdateButton.textContent = S('checkUpdateBtn');
680
686
  };
681
687
  target.capabilities = embedded?.session?.capabilities || null;
682
688
  panelEvent('open', entry);
@@ -690,24 +696,58 @@ function installCodexSessionStatus(version, restored, embedded) {
690
696
  resolveConflict.onclick = () => rebaseDraft(target);
691
697
  const showAppUpdate = info => {
692
698
  target.updateInfo = info;
693
- const update = info?.update;
694
- const stage = update?.stage;
695
- const stages = strings.updateStages || { queued: '正在准备升级', checking: '正在检查版本', downloading: '正在下载新版本', waiting: '等待当前分析结束', installing: '正在升级' };
696
- const active = Boolean(stages[stage]) || target.upgradeStarting;
697
- const completed = stage === 'completed' && Date.now() - Date.parse(update.updatedAt) < 60000;
698
- const failed = stage === 'failed';
699
- appUpdate.hidden = !info?.available && !active && !failed && !completed;
700
- appUpdate.setAttribute('data-failed', String(failed));
701
- appUpdateLabel.textContent = active ? stages[stage] || stages.queued : failed ? S('updateFailedLabel') : completed
702
- ? S('upgradedToPattern', { version: update.currentVersion }) : S('updateAvailablePattern', { version: info?.latestVersion });
703
- appUpdateButton.textContent = active ? S('pleaseWait') : completed ? S('completedShort') : failed ? S('retryBtn') : S('upgradeBtn');
704
- appUpdateButton.disabled = active || completed;
705
- const command = info?.command || 'npx agent-things@latest';
706
- appUpdateDetail.textContent = target.updateConnectionError ? `${S('reconnectHint')}\n${S('terminalUpgradePrefix')}${command}`
707
- : failed ? `${update.error}\n${S('terminalUpgradePrefix')}${command}` : completed && update.reconnectMcp ? S('reconnectMcpHint') : '';
699
+ const options = {
700
+ starting: target.upgradeStarting,
701
+ checking: target.updateChecking,
702
+ connectionError: target.updateConnectionError,
703
+ manualCheckStatus: target.manualCheckStatus,
704
+ checkError: target.manualCheckError,
705
+ };
706
+ const banner = presentation?.updateBannerState
707
+ ? presentation.updateBannerState(info, strings, options)
708
+ : (() => {
709
+ const update = info?.update;
710
+ const stage = update?.stage;
711
+ const stages = strings.updateStages || { queued: '正在准备升级', checking: '正在检查版本', downloading: '正在下载新版本', waiting: '等待当前分析结束', installing: '正在升级' };
712
+ const active = Boolean(stages[stage]) || Boolean(options.starting);
713
+ const completed = stage === 'completed' && Date.now() - Date.parse(update.updatedAt) < 60000;
714
+ const failed = stage === 'failed';
715
+ const visible = Boolean(info?.available || active || failed || completed);
716
+ const command = info?.command || 'npx agent-things@latest';
717
+ return {
718
+ visible,
719
+ active,
720
+ completed,
721
+ failed,
722
+ buttonDisabled: active || completed,
723
+ label: active ? stages[stage] || stages.queued : failed ? S('updateFailedLabel') : completed
724
+ ? S('upgradedToPattern', { version: update?.currentVersion }) : S('updateAvailablePattern', { version: info?.latestVersion }),
725
+ buttonText: active ? S('pleaseWait') : completed ? S('completedShort') : failed ? S('retryBtn') : S('upgradeBtn'),
726
+ detail: options.connectionError ? `${S('reconnectHint')}\n${S('terminalUpgradePrefix')}${command}`
727
+ : failed ? `${update?.error || ''}\n${S('terminalUpgradePrefix')}${command}` : completed && update?.reconnectMcp ? S('reconnectMcpHint') : '',
728
+ versionText: options.manualCheckStatus === 'failed'
729
+ ? `${S('checkUpdateFailedLabel')}${options.checkError ? `: ${options.checkError}` : ''}`
730
+ : (options.manualCheckStatus === 'latest' && info?.currentVersion ? S('alreadyLatestPattern', { version: info.currentVersion }) : (info?.currentVersion ? `v${info.currentVersion}` : '')),
731
+ showVersionBar: !visible,
732
+ checkDisabled: Boolean(options.checking),
733
+ checkFailed: !visible && options.manualCheckStatus === 'failed',
734
+ checkButtonText: options.checking ? S('checkingUpdateShort') : S('checkUpdateBtn'),
735
+ };
736
+ })();
737
+ appUpdate.hidden = !banner.visible;
738
+ appUpdate.setAttribute('data-failed', String(banner.failed));
739
+ appUpdateLabel.textContent = banner.label;
740
+ appUpdateButton.textContent = banner.buttonText;
741
+ appUpdateButton.disabled = banner.buttonDisabled;
742
+ appUpdateDetail.textContent = banner.detail;
708
743
  appUpdateDetail.hidden = !appUpdateDetail.textContent;
744
+ versionBar.hidden = !(banner.showVersionBar && (info || banner.checking || banner.checkFailed));
745
+ versionBar.setAttribute('data-failed', String(banner.checkFailed));
746
+ versionBarText.textContent = banner.versionText;
747
+ checkUpdateButton.textContent = banner.checkButtonText;
748
+ checkUpdateButton.disabled = banner.checkDisabled;
709
749
  refreshPanel();
710
- return active;
750
+ return banner.active;
711
751
  };
712
752
  const pollAppUpdate = async () => {
713
753
  clearTimeout(target.updateTimer);
@@ -715,6 +755,10 @@ function installCodexSessionStatus(version, restored, embedded) {
715
755
  const info = await target.request('app-update-info', 12000);
716
756
  if (panel !== target) return;
717
757
  target.updateConnectionError = null;
758
+ if (info?.available) {
759
+ target.manualCheckStatus = '';
760
+ target.manualCheckError = '';
761
+ }
718
762
  const active = showAppUpdate(info);
719
763
  target.updateTimer = setTimeout(pollAppUpdate, active ? 2000 : 60000);
720
764
  } catch (error) {
@@ -724,6 +768,41 @@ function installCodexSessionStatus(version, restored, embedded) {
724
768
  target.updateTimer = setTimeout(pollAppUpdate, 2000);
725
769
  }
726
770
  };
771
+ checkUpdateButton.onclick = async () => {
772
+ if (target.updateChecking || checkUpdateButton.disabled) return;
773
+ clearTimeout(target.updateTimer);
774
+ clearTimeout(target.manualCheckTimer);
775
+ target.updateChecking = true;
776
+ target.manualCheckStatus = '';
777
+ target.manualCheckError = '';
778
+ showAppUpdate(target.updateInfo);
779
+ try {
780
+ const info = await target.request('app-update-info', 12000, { force: true });
781
+ if (panel !== target) return;
782
+ target.updateChecking = false;
783
+ target.updateConnectionError = null;
784
+ if (info?.checkError && !info?.available) {
785
+ target.manualCheckStatus = 'failed';
786
+ target.manualCheckError = info.checkError;
787
+ } else if (!info?.available) {
788
+ target.manualCheckStatus = 'latest';
789
+ target.manualCheckTimer = setTimeout(() => {
790
+ if (panel !== target || target.manualCheckStatus !== 'latest') return;
791
+ target.manualCheckStatus = '';
792
+ showAppUpdate(target.updateInfo);
793
+ }, 5000);
794
+ }
795
+ const active = showAppUpdate(info);
796
+ target.updateTimer = setTimeout(pollAppUpdate, active ? 2000 : 60000);
797
+ } catch (error) {
798
+ if (panel !== target) return;
799
+ target.updateChecking = false;
800
+ target.manualCheckStatus = 'failed';
801
+ target.manualCheckError = error.message;
802
+ showAppUpdate(target.updateInfo);
803
+ target.updateTimer = setTimeout(pollAppUpdate, 60000);
804
+ }
805
+ };
727
806
  appUpdateButton.onclick = async () => {
728
807
  if (appUpdateButton.disabled) return;
729
808
  clearTimeout(target.updateTimer);
@@ -1049,7 +1128,7 @@ function installCodexSessionStatus(version, restored, embedded) {
1049
1128
  },
1050
1129
  destroy() {
1051
1130
  destroyed = true; localCards?.destroy(); harness?.dispose?.(); observer.disconnect(); rootObserver?.disconnect(); headObserver?.disconnect(); cancelAnimationFrame(frame);
1052
- if (panel) { rememberPanel(panel); panelEvent('dispose', panel.entry); clearTimeout(panel.pollTimer); clearTimeout(panel.updateTimer); cancelAnimationFrame(panel.marqueeFrame); panel.resizeObserver?.disconnect(); panel.root.remove(); panel.entry.button?.setAttribute('aria-expanded', 'false'); panel = null; }
1131
+ if (panel) { rememberPanel(panel); panelEvent('dispose', panel.entry); clearTimeout(panel.pollTimer); clearTimeout(panel.updateTimer); clearTimeout(panel.manualCheckTimer); cancelAnimationFrame(panel.marqueeFrame); panel.resizeObserver?.disconnect(); panel.root.remove(); panel.entry.button?.setAttribute('aria-expanded', 'false'); panel = null; }
1053
1132
  for (const entry of [...mounted.values()]) unmount(entry);
1054
1133
  document.removeEventListener('pointerdown', onOutside, true); document.removeEventListener('keydown', onKey, true);
1055
1134
  document.removeEventListener('scroll', onScroll, true); window.removeEventListener('resize', positionPanel);
@@ -246,6 +246,11 @@ function createPresentation(lang) {
246
246
  updateFailedLabel: '升级失败',
247
247
  upgradeBtn: '立即升级',
248
248
  upgradingShort: '正在升级…',
249
+ checkUpdateBtn: '检查更新',
250
+ checkingUpdateShort: '正在检查…',
251
+ alreadyLatestPattern: '当前已是最新版 v{version}',
252
+ versionTagPattern: 'v{version}',
253
+ checkUpdateFailedLabel: '检查更新失败',
249
254
  pleaseWait: '请稍候',
250
255
  completedShort: '已完成',
251
256
  retryBtn: '重试',
@@ -435,6 +440,11 @@ function createPresentation(lang) {
435
440
  updateFailedLabel: 'Upgrade failed',
436
441
  upgradeBtn: 'Upgrade',
437
442
  upgradingShort: 'Upgrading...',
443
+ checkUpdateBtn: 'Check updates',
444
+ checkingUpdateShort: 'Checking...',
445
+ alreadyLatestPattern: 'Up to date (v{version})',
446
+ versionTagPattern: 'v{version}',
447
+ checkUpdateFailedLabel: 'Update check failed',
438
448
  pleaseWait: 'Please wait',
439
449
  completedShort: 'Done',
440
450
  retryBtn: 'Retry',
@@ -524,6 +534,72 @@ function createPresentation(lang) {
524
534
  function analysisDisabled(busy, analyzing, upgradeStage) {
525
535
  return Boolean(busy || analyzing || ['waiting', 'installing'].includes(upgradeStage));
526
536
  }
537
+ function updateBannerState(info, dict, options = {}) {
538
+ const textDict = dict || {};
539
+ const fmtText = (template, vars = {}) => String(template || '').replace(/\{(\w+)\}/g, (_, k) => (vars[k] !== undefined ? String(vars[k]) : ''));
540
+ const update = info?.update;
541
+ const stage = update?.stage;
542
+ const stages = textDict.updateStages || {
543
+ queued: 'Preparing upgrade',
544
+ checking: 'Checking version',
545
+ downloading: 'Downloading update',
546
+ waiting: 'Waiting for analysis to finish',
547
+ installing: 'Upgrading',
548
+ };
549
+ const activeStage = Boolean(stages[stage]) || Boolean(options.starting);
550
+ const updatedAtMs = update?.updatedAt ? Date.parse(update.updatedAt) : NaN;
551
+ const now = options.now ?? Date.now();
552
+ const completed = stage === 'completed' && Number.isFinite(updatedAtMs) && now - updatedAtMs < 60000;
553
+ const failed = stage === 'failed';
554
+ const visible = Boolean(info?.available || activeStage || failed || completed);
555
+ const command = info?.command || 'npx agent-things@latest';
556
+ const label = activeStage
557
+ ? (stages[stage] || stages.queued)
558
+ : failed
559
+ ? fmtText(textDict.updateFailedLabel || 'Upgrade failed')
560
+ : completed
561
+ ? fmtText(textDict.upgradedToPattern || 'Upgraded to v{version}', { version: update?.currentVersion || '' })
562
+ : fmtText(textDict.updateAvailablePattern || 'Update available v{version}', { version: info?.latestVersion || '' });
563
+ const buttonText = activeStage
564
+ ? (textDict.pleaseWait || 'Please wait')
565
+ : completed
566
+ ? (textDict.completedShort || 'Done')
567
+ : failed
568
+ ? (textDict.retryBtn || 'Retry')
569
+ : (textDict.upgradeBtn || 'Upgrade');
570
+ const detail = options.connectionError
571
+ ? `${textDict.reconnectHint || ''}\n${textDict.terminalUpgradePrefix || ''}${command}`
572
+ : failed
573
+ ? `${update?.error || ''}\n${textDict.terminalUpgradePrefix || ''}${command}`
574
+ : (completed && update?.reconnectMcp ? (textDict.reconnectMcpHint || '') : '');
575
+ const currentVersion = info?.currentVersion || '';
576
+ const checkFailed = !visible && options.manualCheckStatus === 'failed';
577
+ let versionText = currentVersion ? fmtText(textDict.versionTagPattern || 'v{version}', { version: currentVersion }) : '';
578
+ if (checkFailed) {
579
+ const errText = options.checkError || info?.checkError || '';
580
+ versionText = errText ? `${textDict.checkUpdateFailedLabel || 'Update check failed'}: ${errText}` : (textDict.checkUpdateFailedLabel || 'Update check failed');
581
+ } else if (!visible && options.manualCheckStatus === 'latest' && currentVersion) {
582
+ versionText = fmtText(textDict.alreadyLatestPattern || 'Up to date (v{version})', { version: currentVersion });
583
+ }
584
+ const checking = Boolean(options.checking);
585
+ return {
586
+ visible,
587
+ active: activeStage,
588
+ completed,
589
+ failed,
590
+ buttonDisabled: activeStage || completed,
591
+ label,
592
+ buttonText,
593
+ detail,
594
+ currentVersion,
595
+ versionText,
596
+ showVersionBar: !visible,
597
+ checking,
598
+ checkDisabled: checking,
599
+ checkFailed,
600
+ checkButtonText: checking ? (textDict.checkingUpdateShort || 'Checking...') : (textDict.checkUpdateBtn || 'Check updates'),
601
+ };
602
+ }
527
603
 
528
604
  const active = forLang(currentLang);
529
605
  return {
@@ -546,6 +622,7 @@ function createPresentation(lang) {
546
622
  progressState,
547
623
  draftTransition,
548
624
  analysisDisabled,
625
+ updateBannerState,
549
626
  };
550
627
  }
551
628