@floless/app 0.113.2 → 0.113.4

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/dist/web/aware.js CHANGED
@@ -4894,71 +4894,44 @@
4894
4894
  }
4895
4895
 
4896
4896
  // ── AWARE runtime upgrade tag ─────────────────────────────────────────────────
4897
- // Surface aware-update.ts: poll GET /api/aware/update (on load + every 6h); when a
4898
- // newer @aware-aeco/cli exists, show a footer pill → click opens the release-notes
4899
- // popover → Update now → POST apply, which reinstalls AWARE in place (no relaunch —
4900
- // the app stays open) and re-stamps the version live. Mirrors the app self-update
4901
- // pill; differs in that success is silent (the live version re-stamp IS the
4902
- // confirmation) and there is no relaunch.
4897
+ // Poll readiness for the footer affordance. The accepted update becomes a
4898
+ // transaction owned by aware-update-client.js, so reloads resume the exact job
4899
+ // and each HTTP request remains short even when the install takes minutes.
4903
4900
  const $awareUpdate = document.getElementById('aware-update');
4904
4901
  // After a successful upgrade, briefly trust the upgraded version: a /api/health request that
4905
4902
  // was in flight before the reinstall finished could resolve with the OLD version and momentarily
4906
4903
  // revert the footer. The live re-stamp (health poll) honors this short settle window.
4907
4904
  let awareUpgradeFloor = null, awareUpgradeFloorUntil = 0;
4908
- // Extracted apply body — driven by the popover's "Update now" with the polled
4909
- // target version. Preserves the awareUpgradeFloor settle window + the live
4910
- // #aware-version re-stamp verbatim; additionally makes the version label a notes
4911
- // affordance and shows a brief "installed" confirmation before the pill hides.
4912
- async function applyAwareUpdate(version) {
4905
+ let awareUpdateCheck = null;
4906
+ let applyAwareUpdate = null;
4907
+ async function refreshAwareUpdate() {
4913
4908
  if (!$awareUpdate) return;
4914
- // One update at a time — see _updateApplying (#148). AWARE stays open on success, so the
4915
- // lock is released in every terminal path below (success, cancel, error).
4916
- if (_updateApplying) { showToast('An update is already in progress — please wait for it to complete.', 'info'); return; }
4917
- _updateApplying = 'aware';
4918
- const v = version || '';
4919
- const go = await formModal({ title: 'Upgrade AWARE runtime', sub: 'Reinstalls @aware-aeco/cli to v' + v + ' in place. The app stays open — the version updates automatically when the install finishes.', fields: [], okLabel: 'Upgrade now' });
4920
- if (!go) { _updateApplying = null; return; }
4921
- $awareUpdate.disabled = true;
4922
- $awareUpdate.textContent = '↑ Upgrading…';
4923
- try {
4924
- // Cap the wait so the pill never sticks disabled if the global npm install wedges.
4925
- const r = await fetch('/api/aware/update/apply', { method: 'POST', headers: { 'content-type': 'application/json' }, signal: AbortSignal.timeout(120000) });
4926
- const d = await r.json().catch(() => ({}));
4927
- if (!r.ok || !d.ok) throw new Error(d.error || 'aware upgrade failed');
4928
- // Success is silent: the pill disappears and the AWARE version re-stamps live.
4929
- $awareUpdate.disabled = false;
4930
- _updateApplying = null; // AWARE stays open — release the lock so the app pill can update
4931
- const wv = document.getElementById('aware-version');
4932
- if (wv && d.version) {
4933
- wv.textContent = 'AWARE ' + d.version;
4934
- awareUpgradeFloor = d.version; awareUpgradeFloorUntil = Date.now() + 10000;
4935
- // Resolve the just-installed version's changelog now rather than waiting out the
4936
- // next health tick. One owner for that state: the call clears the previous version's
4937
- // affordance and re-arms it for this one — here unconditionally (armAnyway), so the
4938
- // user can always reach what they just installed even if its notes aren't published.
4939
- refreshVersionNotesTip('aware', d.version, wv, true);
4909
+ if (window.awareUpdateController) {
4910
+ const updateState = window.awareUpdateController.getState();
4911
+ if (updateState.status === 'starting' || updateState.status === 'running' || updateState.status === 'retrying') return;
4912
+ if (updateState.status === 'partial') {
4913
+ $awareUpdate.hidden = false;
4914
+ $awareUpdate.disabled = false;
4915
+ $awareUpdate.textContent = 'Installed bridges need attention';
4916
+ return;
4940
4917
  }
4941
- // Brief confirmation (~2s) before the pill hides.
4942
- $awareUpdate.textContent = 'AWARE v' + (d.version || v) + ' installed';
4943
- setTimeout(() => { $awareUpdate.hidden = true; refreshAwareUpdate(); }, 2000);
4944
- } catch (e) {
4945
- $awareUpdate.disabled = false;
4946
- _updateApplying = null;
4947
- const msg = (e && e.name === 'TimeoutError')
4948
- ? 'AWARE upgrade is taking a while — it may still be installing; the version updates when it finishes'
4949
- : 'AWARE upgrade failed — ' + String((e && e.message) || e).slice(0, 80);
4950
- showToast(msg, 'warn');
4951
- refreshAwareUpdate(); // restore the pill text for retry
4952
4918
  }
4953
- }
4954
- async function refreshAwareUpdate() {
4955
- if (!$awareUpdate) return;
4956
4919
  try {
4957
4920
  const r = await fetch('/api/aware/update');
4958
4921
  const d = await r.json();
4959
- if (r.ok && d.updateAvailable && d.targetVersion) {
4922
+ awareUpdateCheck = r.ok ? d : null;
4923
+ if (r.ok && d.updateAvailable && d.targetVersion && d.operation === 'bridge-repair') {
4924
+ const count = Array.isArray(d.bridges) ? d.bridges.filter((row) => row.status !== 'current').length : 0;
4925
+ $awareUpdate.textContent = `Repair ${count || ''} installed bridge${count === 1 ? '' : 's'}`.replace(' ', ' ');
4926
+ $awareUpdate.dataset.target = d.targetVersion;
4927
+ $awareUpdate.dataset.operation = 'bridge-repair';
4928
+ $awareUpdate.dataset.tip = 'Repair installed bridges that do not match AWARE';
4929
+ $awareUpdate.setAttribute('aria-haspopup', 'dialog');
4930
+ $awareUpdate.hidden = false;
4931
+ } else if (r.ok && d.updateAvailable && d.targetVersion) {
4960
4932
  $awareUpdate.textContent = '↑ Upgrade AWARE to v' + d.targetVersion;
4961
4933
  $awareUpdate.dataset.target = d.targetVersion;
4934
+ $awareUpdate.dataset.operation = 'runtime-update';
4962
4935
  $awareUpdate.dataset.tip = "What's new in v" + d.targetVersion;
4963
4936
  $awareUpdate.setAttribute('aria-haspopup', 'dialog');
4964
4937
  $awareUpdate.hidden = false;
@@ -4970,9 +4943,232 @@
4970
4943
  if (!applyDevForcedUpdate('aware', $awareUpdate)) $awareUpdate.hidden = true;
4971
4944
  }
4972
4945
  }
4946
+
4947
+ // One visible transaction flow for the footer and Workspaces. Transport,
4948
+ // persistence, and short-request polling live in aware-update-client.js.
4949
+ const $awareUpgradeModal = document.getElementById('aware-update-modal');
4950
+ const $awareUpgradeTitle = document.getElementById('aware-update-title');
4951
+ const $awareUpgradeCopy = document.getElementById('aware-update-copy');
4952
+ const $awareUpgradeLive = document.getElementById('aware-update-live');
4953
+ const $awareUpgradeResults = document.getElementById('aware-update-results');
4954
+ const $awareUpgradeCancel = document.getElementById('aware-update-cancel');
4955
+ const $awareUpgradeOk = document.getElementById('aware-update-ok');
4956
+ const $awareUpgradeRetry = document.getElementById('aware-update-retry');
4957
+ const awareUpdateClient = window.awareUpdateController;
4958
+ let awareUpgradeTarget = '';
4959
+ let awareUpgradeOperation = 'runtime-update';
4960
+ let awareUpgradeInventory = [];
4961
+ let awareUpgradeReturnFocus = null;
4962
+ const awareBusy = (status) => status === 'starting' || status === 'running' || status === 'retrying';
4963
+ const awareHostLabel = (host) => ({ tekla: 'Tekla', revit: 'Revit', sketchup: 'SketchUp', rhino: 'Rhino' }[host] || host);
4964
+ const awareUpgradeCopyText = (target, operation, inventory) => {
4965
+ if (operation === 'bridge-repair') {
4966
+ const stale = (inventory || []).filter((row) => row.status === 'stale' || row.status === 'unverifiable');
4967
+ const versions = stale.map((row) => `${awareHostLabel(row.host)}${row.version ? ` v${row.version}` : ''}`).join(', ');
4968
+ return `AWARE v${target || 'the current release'} is current. ${versions || 'One or more installed bridges'} ${stale.length === 1 ? 'needs' : 'need'} to match it. Repairs only bridges already installed on this computer; no new bridges are installed.`;
4969
+ }
4970
+ if (operation === 'combined') {
4971
+ return `Updates AWARE to v${target || 'the current release'} and refreshes any Revit, SketchUp, Rhino, or Tekla bridges already installed on this computer. No new bridges are installed.`;
4972
+ }
4973
+ return `Upgrades AWARE to v${target || 'the current release'} and refreshes any Revit, SketchUp, Rhino, or Tekla bridges already installed on this computer. No new bridges are installed. FloLess stays open; this may take a few minutes.`;
4974
+ };
4975
+
4976
+ function closeAwareUpgradeModal() {
4977
+ if (!$awareUpgradeModal) return;
4978
+ hideModal($awareUpgradeModal);
4979
+ const restore = awareUpgradeReturnFocus;
4980
+ awareUpgradeReturnFocus = null;
4981
+ if (restore && document.contains(restore)) {
4982
+ try { restore.focus(); } catch { /* best effort */ }
4983
+ }
4984
+ }
4985
+
4986
+ function awareHostRows(title, rows, failed) {
4987
+ if (!rows.length) return '';
4988
+ return `<section class="aware-update-section"><div class="aware-update-section-head">${escapeHtml(title)}</div>`
4989
+ + `<div class="aware-update-hosts">${rows.map((row) => {
4990
+ const host = failed ? row.host : row;
4991
+ return `<div class="aware-update-host"><div class="aware-update-host-name">${escapeHtml(awareHostLabel(host))}</div>`
4992
+ + (failed
4993
+ ? `<div class="aware-update-host-message">${escapeHtml(row.message)}</div><div class="aware-update-host-code">${escapeHtml(row.code)}</div>`
4994
+ : '<div class="aware-update-host-message">Up to date</div>')
4995
+ + '</div>';
4996
+ }).join('')}</div></section>`;
4997
+ }
4998
+
4999
+ function paintAwareUpgrade(s) {
5000
+ if (!$awareUpgradeModal) return;
5001
+ const status = s.status || 'idle';
5002
+ const target = s.target || awareUpgradeTarget || '';
5003
+ if (target) awareUpgradeTarget = target;
5004
+ const operation = s.operation || awareUpgradeOperation;
5005
+ const busy = awareBusy(status);
5006
+ $awareUpgradeModal.dataset.state = status;
5007
+ $awareUpgradeModal.setAttribute('aria-busy', busy ? 'true' : 'false');
5008
+ if ($awareUpgradeTitle) $awareUpgradeTitle.textContent = operation === 'bridge-repair'
5009
+ ? 'Repair installed bridges'
5010
+ : operation === 'combined' ? 'Update AWARE and installed bridges' : 'Upgrade AWARE';
5011
+ $awareUpgradeCopy.textContent = awareUpgradeCopyText(target, operation, awareUpgradeInventory);
5012
+ $awareUpgradeResults.innerHTML = '';
5013
+ $awareUpgradeOk.hidden = status !== 'idle' && status !== 'runtime-failed';
5014
+ $awareUpgradeOk.textContent = status === 'runtime-failed'
5015
+ ? (operation === 'bridge-repair' ? 'Try repair again' : 'Try upgrade again')
5016
+ : (operation === 'bridge-repair' ? 'Repair bridges' : operation === 'combined' ? 'Update all' : 'Upgrade now');
5017
+ $awareUpgradeRetry.hidden = status !== 'partial' || !s.failed || !s.failed.length;
5018
+ $awareUpgradeCancel.textContent = status === 'idle' ? 'Not now' : 'Close';
5019
+
5020
+ if (status === 'idle') $awareUpgradeLive.textContent = '';
5021
+ else if (status === 'starting') $awareUpgradeLive.textContent = operation === 'bridge-repair'
5022
+ ? 'Starting the bridge repair…' : 'Starting the AWARE upgrade…';
5023
+ else if (status === 'running') {
5024
+ const count = s.total > 0 ? ` ${s.completed || 0} of ${s.total} bridges checked.` : '';
5025
+ $awareUpgradeLive.textContent = s.connectionMessage
5026
+ || `${operation === 'bridge-repair' ? 'Repair' : 'Upgrade'} in progress — ${String(s.stage || 'preparing').replaceAll('-', ' ')}.${count}`;
5027
+ } else if (status === 'retrying') {
5028
+ $awareUpgradeLive.textContent = s.connectionMessage || `Trying the ${awareHostLabel(s.host || '')} bridge again…`;
5029
+ } else if (status === 'success') {
5030
+ const version = s.observedVersion || target;
5031
+ const count = (s.updated || []).length;
5032
+ $awareUpgradeLive.textContent = `AWARE v${version || ''}${count ? ` and ${count} installed bridge${count === 1 ? '' : 's'}` : ''} are up to date.`;
5033
+ $awareUpgradeResults.innerHTML = awareHostRows('Updated bridges', s.updated || [], false);
5034
+ } else if (status === 'partial') {
5035
+ $awareUpgradeLive.textContent = 'AWARE is up to date, but some installed bridges still need attention.';
5036
+ $awareUpgradeResults.innerHTML = '<div class="aware-update-summary">FloLess will keep incompatible bridges blocked until they are refreshed. You can retry only the failed bridges below.</div>'
5037
+ + awareHostRows('Updated bridges', s.updated || [], false)
5038
+ + awareHostRows('Bridges that need attention', s.failed || [], true);
5039
+ if (s.retryError) {
5040
+ $awareUpgradeResults.insertAdjacentHTML('afterbegin', `<div class="aware-update-summary">${escapeHtml(s.retryError)}</div>`);
5041
+ }
5042
+ } else if (status === 'runtime-failed') {
5043
+ $awareUpgradeLive.textContent = 'AWARE could not be upgraded.';
5044
+ const reason = s.error && s.error.message ? s.error.message : 'Check your connection and try again.';
5045
+ $awareUpgradeResults.innerHTML = `<div class="aware-update-summary">${escapeHtml(reason)}</div>`;
5046
+ } else if (status === 'expired') {
5047
+ $awareUpgradeLive.textContent = s.message || 'The previous upgrade result expired.';
5048
+ $awareUpgradeResults.innerHTML = '<div class="aware-update-summary">The installed runtime was checked again. Use the current upgrade action if an update is still available.</div>';
5049
+ }
5050
+ }
5051
+
5052
+ async function openAwareUpgrade(version, returnFocusTo) {
5053
+ if (!$awareUpgradeModal || !awareUpdateClient) {
5054
+ showToast('Could not open the AWARE update dialog.', 'warn');
5055
+ return;
5056
+ }
5057
+ if (_updateApplying && _updateApplying !== 'aware') {
5058
+ showToast('An update is already in progress — please wait for it to complete.', 'info');
5059
+ return;
5060
+ }
5061
+ const current = awareUpdateClient.getState();
5062
+ let target = version || awareUpgradeTarget || ($awareUpdate && $awareUpdate.dataset.target) || '';
5063
+ if (!target && !awareBusy(current.status) && current.status !== 'partial') {
5064
+ try {
5065
+ const check = await awareUpdateClient.check();
5066
+ awareUpdateCheck = check;
5067
+ target = check.targetVersion || '';
5068
+ } catch {
5069
+ showToast('Could not check the current AWARE release. Try again in a moment.', 'warn');
5070
+ return;
5071
+ }
5072
+ }
5073
+ const check = awareUpdateCheck || {};
5074
+ awareUpgradeOperation = check.operation || ($awareUpdate && $awareUpdate.dataset.operation) || 'runtime-update';
5075
+ awareUpgradeInventory = Array.isArray(check.bridges) ? check.bridges : [];
5076
+ awareUpgradeTarget = target;
5077
+ awareUpgradeReturnFocus = returnFocusTo || document.activeElement;
5078
+ paintAwareUpgrade(awareBusy(current.status) || current.status === 'partial'
5079
+ ? current : { status: 'idle', transaction: null, target: awareUpgradeTarget });
5080
+ showModal($awareUpgradeModal);
5081
+ setTimeout(() => {
5082
+ const focus = !$awareUpgradeOk.hidden ? $awareUpgradeOk
5083
+ : (!$awareUpgradeRetry.hidden ? $awareUpgradeRetry : $awareUpgradeCancel);
5084
+ focus.focus();
5085
+ }, 0);
5086
+ }
5087
+
5088
+ // openNotesPopover calls this binding at click-time.
5089
+ applyAwareUpdate = (version) => openAwareUpgrade(version, $awareUpdate);
5090
+
5091
+ if (awareUpdateClient && $awareUpgradeModal) {
5092
+ awareUpdateClient.subscribe((s) => {
5093
+ const busy = awareBusy(s.status);
5094
+ if ($awareUpdate) {
5095
+ $awareUpdate.disabled = busy;
5096
+ $awareUpdate.setAttribute('aria-busy', busy ? 'true' : 'false');
5097
+ if (busy) {
5098
+ $awareUpdate.hidden = false;
5099
+ $awareUpdate.textContent = s.status === 'retrying'
5100
+ ? '↑ Retrying bridge…'
5101
+ : awareUpgradeOperation === 'bridge-repair' ? 'Repairing installed bridges…' : '↑ Upgrading AWARE…';
5102
+ } else if (s.status === 'partial') {
5103
+ $awareUpdate.hidden = false;
5104
+ $awareUpdate.textContent = 'Installed bridges need attention';
5105
+ }
5106
+ }
5107
+ _updateApplying = busy ? 'aware' : (_updateApplying === 'aware' ? null : _updateApplying);
5108
+ paintAwareUpgrade(s);
5109
+ if (s.status === 'partial' || s.status === 'runtime-failed' || s.status === 'expired') {
5110
+ if (!$awareUpgradeModal.classList.contains('show')) {
5111
+ awareUpgradeReturnFocus = document.activeElement;
5112
+ showModal($awareUpgradeModal);
5113
+ setTimeout(() => (!$awareUpgradeRetry.hidden ? $awareUpgradeRetry : $awareUpgradeCancel).focus(), 0);
5114
+ }
5115
+ refreshAwareUpdate();
5116
+ } else if (s.status === 'success') {
5117
+ const version = s.observedVersion || s.target;
5118
+ const wv = document.getElementById('aware-version');
5119
+ if (wv && version) {
5120
+ wv.textContent = 'AWARE ' + version;
5121
+ awareUpgradeFloor = version;
5122
+ awareUpgradeFloorUntil = Date.now() + 10000;
5123
+ refreshVersionNotesTip('aware', version, wv, true);
5124
+ }
5125
+ refreshAwareUpdate();
5126
+ if (!$awareUpgradeModal.classList.contains('show')) {
5127
+ showToast($awareUpgradeLive.textContent, 'ok');
5128
+ } else {
5129
+ // Success is a brief confirmation; partial results remain available
5130
+ // until dismissed because they still carry recovery actions.
5131
+ setTimeout(() => {
5132
+ if (awareUpdateClient.getState().status === 'success'
5133
+ && $awareUpgradeModal.dataset.state === 'success'
5134
+ && $awareUpgradeModal.classList.contains('show')) {
5135
+ closeAwareUpgradeModal();
5136
+ }
5137
+ }, 2200);
5138
+ }
5139
+ }
5140
+ });
5141
+ $awareUpgradeOk.onclick = () => {
5142
+ awareUpdateClient.start(awareUpgradeTarget);
5143
+ };
5144
+ $awareUpgradeRetry.onclick = () => awareUpdateClient.retryFailed();
5145
+ $awareUpgradeCancel.onclick = closeAwareUpgradeModal;
5146
+ $awareUpgradeModal.onclick = (event) => {
5147
+ if (event.target === $awareUpgradeModal) closeAwareUpgradeModal();
5148
+ };
5149
+ $awareUpgradeModal.onkeydown = (event) => {
5150
+ if (event.key === 'Escape') { event.preventDefault(); closeAwareUpgradeModal(); return; }
5151
+ if (event.key !== 'Tab') return;
5152
+ const controls = Array.from($awareUpgradeModal.querySelectorAll('button:not([disabled]):not([hidden]), [tabindex]:not([tabindex="-1"])'));
5153
+ if (!controls.length) return;
5154
+ const first = controls[0], last = controls[controls.length - 1];
5155
+ if (event.shiftKey && document.activeElement === first) { event.preventDefault(); last.focus(); }
5156
+ else if (!event.shiftKey && document.activeElement === last) { event.preventDefault(); first.focus(); }
5157
+ };
5158
+ awareUpdateClient.resume();
5159
+ }
5160
+
4973
5161
  if ($awareUpdate) {
4974
5162
  $awareUpdate.onclick = () => {
5163
+ if (awareUpdateClient && awareUpdateClient.getState().status === 'partial') {
5164
+ openAwareUpgrade('', $awareUpdate);
5165
+ return;
5166
+ }
4975
5167
  const version = $awareUpdate.dataset.target || '';
5168
+ if ($awareUpdate.dataset.operation === 'bridge-repair') {
5169
+ openAwareUpgrade(version, $awareUpdate);
5170
+ return;
5171
+ }
4976
5172
  openNotesPopover({ component: 'aware', version, anchorEl: $awareUpdate, onUpdate: applyAwareUpdate });
4977
5173
  };
4978
5174
  refreshAwareUpdate();
@@ -8065,6 +8261,11 @@
8065
8261
  markedInstruction, // marked (paste-safe) form for clipboard copies — panels.js uses it (#73)
8066
8262
  showRequestQueuedModal,
8067
8263
  formModal, // the shared styled prompt/form modal — workspaces.js reuses it (never a native prompt)
8264
+ // One owner for runtime upgrades. Workspaces may open this surface but must
8265
+ // never POST the updater route itself.
8266
+ openAwareUpdate(version, returnFocusTo) {
8267
+ openAwareUpgrade(version, returnFocusTo);
8268
+ },
8068
8269
  // ── Workspaces guide beacon (the SAME #guide-beacon/#guide-modal, document variant) ──
8069
8270
  // workspaces.js owns the open project + its lifecycle state; aware.js owns the beacon
8070
8271
  // chrome. workspaces.js calls setWorkspaceGuide() with a small snapshot whenever the
@@ -370,6 +370,24 @@
370
370
  </div>
371
371
  </div>
372
372
 
373
+ <!-- AWARE runtime + installed-host-bridge upgrade. One dedicated surface is
374
+ shared by the footer pill and Workspaces recovery actions. Progress comes
375
+ from the server transaction; this UI never infers installer completion. -->
376
+ <div class="modal-backdrop" id="aware-update-modal" role="dialog" aria-modal="true"
377
+ aria-labelledby="aware-update-title" aria-describedby="aware-update-copy" aria-busy="false">
378
+ <div class="modal aware-update-dialog" tabindex="-1">
379
+ <div class="modal-title" id="aware-update-title">Upgrade AWARE</div>
380
+ <div class="modal-sub" id="aware-update-copy"></div>
381
+ <div class="aware-update-live" id="aware-update-live" role="status" aria-live="polite" aria-atomic="true"></div>
382
+ <div class="aware-update-results" id="aware-update-results"></div>
383
+ <div class="modal-actions">
384
+ <button id="aware-update-cancel">Not now</button>
385
+ <button id="aware-update-retry" class="primary" hidden>Try failed bridges again</button>
386
+ <button id="aware-update-ok" class="primary">Upgrade now</button>
387
+ </div>
388
+ </div>
389
+ </div>
390
+
373
391
  <!-- Import failed: `aware app install` refused the .flo. It says exactly what is wrong on stderr —
374
392
  which agent isn't runnable, which node id is duplicated — and the plain "import failed …
375
393
  (exit N)" toast this replaces could carry none of it (#314). Shows what happened in plain
@@ -957,6 +975,7 @@
957
975
  <script src="analytics.js"></script>
958
976
  <script src="app.js"></script>
959
977
  <script src="renderers.js"></script>
978
+ <script src="aware-update-client.js"></script>
960
979
  <script src="aware.js"></script>
961
980
  <script src="panels.js"></script>
962
981
  <script src="workspaces.js"></script>
@@ -3211,9 +3211,9 @@
3211
3211
  return;
3212
3212
  }
3213
3213
  if (action === 'update-aware') {
3214
- // The footer pill owns updating AWARE — duplicating that flow here would give two places
3215
- // that can start the same install.
3216
- showToast('Use ↑ Upgrade AWARE in the footer, then click Check again.', 'info');
3214
+ // Workspaces opens the shared updater; it never starts a second install.
3215
+ if (bridge.openAwareUpdate) bridge.openAwareUpdate('', document.activeElement);
3216
+ else showToast('Could not open the AWARE update dialog.', 'warn');
3217
3217
  return;
3218
3218
  }
3219
3219
  // 'retry' — just re-probe.
@@ -3238,23 +3238,18 @@
3238
3238
  if (action === 'open-tekla' || action === 'open-model' || action === 'retry') {
3239
3239
  return renderExports();
3240
3240
  }
3241
+ if (action === 'update-aware') {
3242
+ if (bridge.openAwareUpdate) bridge.openAwareUpdate('', document.activeElement);
3243
+ else showToast('Could not open the AWARE update dialog.', 'warn');
3244
+ return;
3245
+ }
3241
3246
  teklaReadinessState = { ok: false, state: 'checking' };
3242
3247
  paintExports(current.approvedAt);
3243
3248
  try {
3244
- if (action === 'update-aware') {
3245
- if (!bridge.formModal) throw new Error('Could not open the AWARE update dialog.');
3246
- const go = await bridge.formModal({
3247
- title: 'Update AWARE runtime',
3248
- sub: 'Installs the current AWARE release in place. FloLess stays open.',
3249
- fields: [],
3250
- okLabel: 'Update AWARE',
3251
- });
3252
- if (!go) return renderExports();
3253
- await api('/api/aware/update/apply', { method: 'POST', signal: AbortSignal.timeout(120000) });
3254
- } else if (action === 'install-bridge') {
3249
+ if (action === 'install-bridge') {
3255
3250
  await api('/api/tekla-readiness/setup', { method: 'POST' });
3256
3251
  }
3257
- showToast(action === 'update-aware' ? 'AWARE updated.' : 'Tekla bridge installed.', 'ok');
3252
+ showToast('Tekla bridge installed.', 'ok');
3258
3253
  } catch (err) {
3259
3254
  showToast(err && err.message ? err.message : String(err), 'warn');
3260
3255
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.113.2",
3
+ "version": "0.113.4",
4
4
  "type": "module",
5
5
  "description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
6
6
  "bin": {