@floless/app 0.155.2 → 0.157.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 (64) hide show
  1. package/cli-actions.mjs +392 -0
  2. package/dist/floless-server.cjs +182734 -141519
  3. package/dist/schemas/drawing-check.profile.v1.schema.json +15 -2
  4. package/dist/schemas/steel.model.v2.schema.json +25 -1
  5. package/dist/skills/floless-app-actions/SKILL.md +199 -0
  6. package/dist/skills/floless-app-approval/SKILL.md +8 -5
  7. package/dist/skills/floless-app-bridge/SKILL.md +12 -9
  8. package/dist/skills/floless-app-knowledge/SKILL.md +50 -14
  9. package/dist/skills/floless-app-new-workflow/SKILL.md +26 -10
  10. package/dist/skills/floless-app-onboarding/SKILL.md +31 -1
  11. package/dist/skills/floless-app-onboarding/references/aware-runtime.md +4 -4
  12. package/dist/skills/floless-app-queue/SKILL.md +10 -6
  13. package/dist/skills/floless-app-report-issue/SKILL.md +15 -12
  14. package/dist/skills/floless-app-rfi/SKILL.md +98 -73
  15. package/dist/skills/floless-app-routines/SKILL.md +27 -15
  16. package/dist/skills/floless-app-routines/references/routines-api.md +8 -2
  17. package/dist/skills/floless-app-steel-model/SKILL.md +1 -1
  18. package/dist/skills/floless-app-steel-model/references/detail-from-a-screenshot.md +4 -2
  19. package/dist/skills/floless-app-tweak-contract/SKILL.md +25 -5
  20. package/dist/skills/floless-app-workflows/SKILL.md +50 -13
  21. package/dist/skills/floless-app-workflows/references/agent-steps.md +119 -0
  22. package/dist/web/agent-steps.js +1750 -0
  23. package/dist/web/agents.js +33 -8
  24. package/dist/web/app.css +681 -4
  25. package/dist/web/app.js +111 -11
  26. package/dist/web/aware-update-client.js +1 -0
  27. package/dist/web/aware.js +1257 -202
  28. package/dist/web/chat-landing-scene.js +372 -0
  29. package/dist/web/chat.css +254 -1
  30. package/dist/web/chat.js +2657 -87
  31. package/dist/web/commands-drawing-check.js +17 -0
  32. package/dist/web/commands-shell.js +1108 -4
  33. package/dist/web/commands-steel.js +6 -0
  34. package/dist/web/connections.js +1 -0
  35. package/dist/web/drawing-check-editor.html +33 -5
  36. package/dist/web/drawing-check-editor.js +538 -22
  37. package/dist/web/drawing-check-overlay.js +13 -0
  38. package/dist/web/flo-avatar.js +28 -3
  39. package/dist/web/guide.js +7 -2
  40. package/dist/web/index.html +171 -7
  41. package/dist/web/instructor.js +6 -4
  42. package/dist/web/leave-guard.js +4 -2
  43. package/dist/web/left-pane.js +8 -3
  44. package/dist/web/model-revit-module.js +15 -0
  45. package/dist/web/model-view-query.js +12 -2
  46. package/dist/web/model-viewport-revit-adapter.js +3 -1
  47. package/dist/web/pages.js +891 -36
  48. package/dist/web/panels.js +8 -5
  49. package/dist/web/parser-setup-recovery.js +12 -4
  50. package/dist/web/project-access.js +549 -0
  51. package/dist/web/project-reconciliation.js +357 -0
  52. package/dist/web/report-files.js +50 -0
  53. package/dist/web/revit-editor.js +116 -27
  54. package/dist/web/startup-admission.js +132 -0
  55. package/dist/web/steel-3d-core.js +9 -0
  56. package/dist/web/steel-editor.html +642 -22
  57. package/dist/web/steel-model-v2-commands.js +63 -5
  58. package/dist/web/step-rename.js +287 -0
  59. package/dist/web/terminal-requests.js +590 -0
  60. package/dist/web/tool-updates.js +148 -13
  61. package/dist/web/workspace-root-management.js +39 -0
  62. package/dist/web/workspaces.js +1879 -74
  63. package/launch.mjs +82 -2
  64. package/package.json +3 -1
package/dist/web/app.js CHANGED
@@ -372,6 +372,8 @@ function cardEl(id, ports) {
372
372
  </div>
373
373
  <div class="title">${a.title}</div>
374
374
  <div class="subtitle">${a.subtitle}</div>
375
+ ${a._aiStep ? `<div class="rt-model-badge is-agent" role="note" aria-label="${escapeAttr(a._aiStep.badge.aria)}" data-tip="${escapeAttr(a._aiStep.badge.tip)}">${escapeHtml(a._aiStep.badge.text)}</div>` : ''}
376
+ ${a._aiUse ? `<div class="rt-model-badge is-ai-use is-${escapeAttr(a._aiUse.how)}" role="note" aria-label="${escapeAttr(`${a._aiUse.text}. ${a._aiUse.tip}`)}" data-tip="${escapeAttr(a._aiUse.tip)}">${escapeHtml(a._aiUse.text)}</div>` : ''}
375
377
  ${a._runtimeModel ? '<div class="rt-model-badge" data-tip="This node calls a model at run time (vision.extract). Output is content-cached and sits behind an approve gate — review the extraction before any write.">⚡ calls a model at run time</div>' : ''}
376
378
  ${a._frozen ? '<div class="frozen-badge" data-tip="Frozen — its last result is pinned and Run skips this node. Right-click to unfreeze.">❄ Frozen</div>' : ''}
377
379
  <div class="blurb">${a.blurb}</div>
@@ -1346,6 +1348,26 @@ $menuBtn.addEventListener('click', (e) => {
1346
1348
  // changed out-of-band (Windows Settings → Startup apps). refreshStartup is a
1347
1349
  // hoisted function declaration defined later in this file.
1348
1350
  if ($menu.classList.contains('show')) { try { refreshStartup(); } catch {} }
1351
+ // #2399: the suggestion mode may have changed in AI Chat or another tab.
1352
+ if ($menu.classList.contains('show')) void window.flolessAssistantMode?.refresh();
1353
+ });
1354
+
1355
+ /* ============= SUGGESTIONS (#2399) ============= */
1356
+ // The account's "Suggest next steps" mode: the same setting as the AI Chat ⚙ row (web/chat.js owns reading and saving
1357
+ // it as window.flolessAssistantMode); one floless:assistant-mode event keeps the two in step.
1358
+ function paintSuggestMenu(current) {
1359
+ const recovered = current?.recovered === true;
1360
+ document.querySelectorAll('.suggest-btn').forEach((b) => {
1361
+ const on = !recovered && current?.mode === b.dataset.mode;
1362
+ b.classList.toggle('active', on);
1363
+ b.setAttribute('aria-checked', String(on));
1364
+ });
1365
+ const note = document.getElementById('menu-suggest-note');
1366
+ if (note) note.hidden = !recovered;
1367
+ }
1368
+ window.addEventListener('floless:assistant-mode', (event) => paintSuggestMenu(event.detail));
1369
+ document.querySelectorAll('.suggest-btn').forEach((b) => {
1370
+ b.addEventListener('click', () => { void window.flolessAssistantMode?.set(b.dataset.mode); });
1349
1371
  });
1350
1372
 
1351
1373
  document.addEventListener('click', (e) => {
@@ -1504,6 +1526,7 @@ const $startupToggle = document.getElementById('startup-toggle');
1504
1526
 
1505
1527
  async function refreshStartup() {
1506
1528
  try {
1529
+ await globalThis.flolessStartupAdmission?.admit('/api/autostart');
1507
1530
  const r = await fetch('/api/autostart');
1508
1531
  if (!r.ok) { if ($startupRow) $startupRow.hidden = true; showStartOnLoginLinks(false); return; }
1509
1532
  const d = await r.json();
@@ -1982,8 +2005,15 @@ const $workspaceRootUse = document.getElementById('workspace-root-use');
1982
2005
  let workspaceRootState = null;
1983
2006
  let workspaceRootChoice = null;
1984
2007
  let workspaceRootBusy = false;
2008
+ let workspaceRootObservation = 0;
2009
+ let workspaceRootAcceptedObservation = 0;
2010
+ let workspaceRootSelecting = false;
2011
+ let workspaceRootConnection = 0;
2012
+ let workspaceRootOperation = null;
2013
+ let workspaceRootInterruption = '';
1985
2014
 
1986
2015
  async function workspaceRootApi(path, opts) {
2016
+ await globalThis.flolessStartupAdmission?.admit(path, { method: opts?.method, signal: opts?.signal });
1987
2017
  const response = await fetch(path, { headers: { 'content-type': 'application/json' }, ...opts });
1988
2018
  const body = await response.json().catch(() => ({ ok: false, error: `Unreadable response (HTTP ${response.status})` }));
1989
2019
  if (!response.ok || body.ok === false) {
@@ -2005,10 +2035,32 @@ function announceWorkspaceRootState() {
2005
2035
  }
2006
2036
 
2007
2037
  function setWorkspaceRootError(message) {
2038
+ message = message || workspaceRootInterruption;
2008
2039
  $workspaceRootError.hidden = !message;
2009
2040
  $workspaceRootError.textContent = message || '';
2010
2041
  }
2011
2042
 
2043
+ function ownsWorkspaceRootOperation(operation) {
2044
+ return workspaceRootOperation === operation && operation.connection === workspaceRootConnection;
2045
+ }
2046
+
2047
+ function invalidateWorkspaceRootConnection() {
2048
+ workspaceRootConnection++;
2049
+ workspaceRootObservation++;
2050
+ const operation = workspaceRootOperation;
2051
+ const hadChoice = !!workspaceRootChoice;
2052
+ workspaceRootOperation = null;
2053
+ workspaceRootSelecting = false;
2054
+ workspaceRootChoice = null;
2055
+ if (!operation && !hadChoice) return;
2056
+ // Revoking browser ownership does not cancel the earlier request or establish its outcome.
2057
+ if (operation?.kind === 'select') workspaceRootInterruption = 'The connection changed while FloLess was switching the Workspace directory. The earlier request may have finished. Check the current directory, then choose again if needed.';
2058
+ else if (!workspaceRootInterruption) workspaceRootInterruption = 'The connection changed. Choose a Workspace directory again before using it.';
2059
+ setWorkspaceRootBusy(false);
2060
+ setWorkspaceRootError('');
2061
+ renderWorkspaceRootModal();
2062
+ }
2063
+
2012
2064
  function workspaceRootErrorMessage(error) {
2013
2065
  const raw = String(error && error.message || error || 'Could not use that folder.');
2014
2066
  const uncheckedProjects = "FloLess can't switch to this folder yet. It contains projects, and another saved directory can't be checked right now, so FloLess can't confirm those projects aren't already saved there. For now, cancel this review and choose an empty Workspace directory. You can switch to this folder once every other saved directory is available or stopped.";
@@ -2098,21 +2150,40 @@ function renderWorkspaceRootModal() {
2098
2150
  $workspaceRootUse.hidden = !workspaceRootChoice;
2099
2151
  }
2100
2152
 
2101
- async function refreshWorkspaceRoot() {
2153
+ async function refreshWorkspaceRoot(options = {}) {
2154
+ // A background observation cannot erase the person's pending selection or its failure.
2155
+ if (workspaceRootSelecting) return null;
2156
+ const observation = ++workspaceRootObservation;
2157
+ const current = () => observation === workspaceRootObservation && !workspaceRootSelecting
2158
+ && (!options.isCurrent || options.isCurrent());
2102
2159
  try {
2103
- workspaceRootState = await workspaceRootApi('/api/workspace-root');
2160
+ const result = await workspaceRootApi('/api/workspace-root');
2161
+ if (!current()) return null;
2162
+ if (typeof result.available !== 'boolean' || !result.root
2163
+ || typeof result.root.rootId !== 'string' || !result.root.rootId.trim()
2164
+ || typeof result.root.path !== 'string' || !result.root.path.trim()
2165
+ || !Number.isSafeInteger(result.root.generation) || result.root.generation < 0) {
2166
+ throw new Error('The server did not identify its Workspace directory.');
2167
+ }
2168
+ workspaceRootState = result;
2169
+ workspaceRootAcceptedObservation = observation;
2104
2170
  setWorkspaceRootError('');
2171
+ renderWorkspaceRootModal();
2105
2172
  announceWorkspaceRootState();
2173
+ return result;
2106
2174
  } catch (error) {
2175
+ if (!current()) return null;
2107
2176
  setWorkspaceRootError(workspaceRootErrorMessage(error));
2177
+ renderWorkspaceRootModal();
2178
+ if (options.throwOnError) throw error;
2179
+ return null;
2108
2180
  }
2109
- renderWorkspaceRootModal();
2110
- return workspaceRootState;
2111
2181
  }
2112
2182
 
2113
2183
  function closeWorkspaceRoot() {
2114
2184
  if (workspaceRootBusy) return;
2115
2185
  workspaceRootChoice = null;
2186
+ workspaceRootInterruption = '';
2116
2187
  setWorkspaceRootError('');
2117
2188
  $workspaceRootModal.classList.remove('show');
2118
2189
  }
@@ -2127,10 +2198,14 @@ async function openWorkspaceRoot() {
2127
2198
  }
2128
2199
 
2129
2200
  async function chooseWorkspaceRoot() {
2201
+ const operation = { connection: workspaceRootConnection, kind: 'choose' };
2202
+ workspaceRootOperation = operation;
2203
+ workspaceRootInterruption = '';
2130
2204
  setWorkspaceRootError('');
2131
2205
  setWorkspaceRootBusy(true, 'Choosing…');
2132
2206
  try {
2133
2207
  const choice = await workspaceRootApi('/api/workspace-root/choose', { method: 'POST', body: '{}' });
2208
+ if (!ownsWorkspaceRootOperation(operation)) return;
2134
2209
  if (choice.cancelled) return;
2135
2210
  if (choice.unchanged) {
2136
2211
  setWorkspaceRootBusy(false);
@@ -2138,35 +2213,52 @@ async function chooseWorkspaceRoot() {
2138
2213
  showToast('FloLess is already using that folder.', 'ok');
2139
2214
  return;
2140
2215
  }
2141
- workspaceRootChoice = { selectionId: choice.selectionId, path: choice.path };
2216
+ workspaceRootChoice = { selectionId: choice.selectionId, path: choice.path, connection: operation.connection };
2142
2217
  } catch (error) {
2218
+ if (!ownsWorkspaceRootOperation(operation)) return;
2143
2219
  setWorkspaceRootError(workspaceRootErrorMessage(error));
2144
2220
  } finally {
2145
- setWorkspaceRootBusy(false);
2146
- renderWorkspaceRootModal();
2221
+ if (ownsWorkspaceRootOperation(operation)) {
2222
+ workspaceRootOperation = null;
2223
+ setWorkspaceRootBusy(false);
2224
+ renderWorkspaceRootModal();
2225
+ }
2147
2226
  }
2148
2227
  }
2149
2228
 
2150
2229
  async function confirmWorkspaceRoot() {
2151
- if (!workspaceRootChoice) return chooseWorkspaceRoot();
2230
+ if (!workspaceRootChoice || workspaceRootChoice.connection !== workspaceRootConnection) return chooseWorkspaceRoot();
2231
+ const operation = { connection: workspaceRootConnection, kind: 'select' };
2232
+ const selectionId = workspaceRootChoice.selectionId;
2233
+ workspaceRootOperation = operation;
2234
+ workspaceRootObservation++;
2235
+ workspaceRootSelecting = true;
2152
2236
  setWorkspaceRootError('');
2153
2237
  setWorkspaceRootBusy(true, 'Switching folder…');
2154
2238
  try {
2155
2239
  const result = await workspaceRootApi('/api/workspace-root/select', {
2156
- method: 'POST', body: JSON.stringify({ selectionId: workspaceRootChoice.selectionId }),
2240
+ method: 'POST', body: JSON.stringify({ selectionId }),
2157
2241
  });
2242
+ if (!ownsWorkspaceRootOperation(operation)) return;
2243
+ workspaceRootAcceptedObservation = ++workspaceRootObservation;
2158
2244
  workspaceRootState = result;
2159
2245
  workspaceRootChoice = null;
2246
+ // Publish only after this authoritative commit can satisfy a waiting reconnect.
2247
+ workspaceRootSelecting = false;
2160
2248
  announceWorkspaceRootState();
2249
+ if (!ownsWorkspaceRootOperation(operation)) return;
2161
2250
  // The server also broadcasts these. Dispatching locally closes the old project immediately even
2162
2251
  // when this tab's EventSource is reconnecting; every listener re-reads rather than trusting data.
2163
2252
  window.dispatchEvent(new CustomEvent('floless:projects-changed', { detail: {
2164
2253
  rootId: result.root.rootId, generation: result.root.generation,
2165
2254
  } }));
2255
+ if (!ownsWorkspaceRootOperation(operation)) return;
2166
2256
  if (window.flolessBridge && window.flolessBridge.loadRequests) window.flolessBridge.loadRequests();
2257
+ if (!ownsWorkspaceRootOperation(operation)) return;
2167
2258
  $workspaceRootModal.classList.remove('show');
2168
2259
  showToast(`Workspace directory changed to “${workspaceRootName(result.root.path)}”.`, 'ok');
2169
2260
  } catch (error) {
2261
+ if (!ownsWorkspaceRootOperation(operation)) return;
2170
2262
  const busy = error && error.body && error.body.code === 'workspace-root-busy';
2171
2263
  const activities = busy && Array.isArray(error.body.blockers)
2172
2264
  ? [...new Set(error.body.blockers.map((blocker) => blocker && blocker.label).filter(Boolean))]
@@ -2175,14 +2267,19 @@ async function confirmWorkspaceRoot() {
2175
2267
  ? `FloLess is still finishing a change${activities.length ? ` (${activities.join(', ')})` : ''}, so it can't switch Workspace directory yet. Nothing is wrong with this folder. Let that work finish, or stop it, then click Use folder again.`
2176
2268
  : workspaceRootErrorMessage(error));
2177
2269
  } finally {
2178
- setWorkspaceRootBusy(false);
2179
- renderWorkspaceRootModal();
2270
+ if (ownsWorkspaceRootOperation(operation)) {
2271
+ workspaceRootOperation = null;
2272
+ workspaceRootSelecting = false;
2273
+ setWorkspaceRootBusy(false);
2274
+ renderWorkspaceRootModal();
2275
+ }
2180
2276
  }
2181
2277
  }
2182
2278
 
2183
2279
  $workspaceRootCancel.onclick = () => {
2184
2280
  if (workspaceRootChoice) {
2185
2281
  workspaceRootChoice = null;
2282
+ workspaceRootInterruption = '';
2186
2283
  setWorkspaceRootError('');
2187
2284
  renderWorkspaceRootModal();
2188
2285
  } else closeWorkspaceRoot();
@@ -2194,6 +2291,9 @@ window.flolessWorkspaceRoot = {
2194
2291
  open: openWorkspaceRoot,
2195
2292
  refresh: refreshWorkspaceRoot,
2196
2293
  current: () => workspaceRootState,
2294
+ invalidateConnection: invalidateWorkspaceRootConnection,
2295
+ isCurrent: (observation) => !!observation && observation === workspaceRootState
2296
+ && workspaceRootAcceptedObservation === workspaceRootObservation && !workspaceRootSelecting,
2197
2297
  name: () => workspaceRootName(workspaceRootState && workspaceRootState.root && workspaceRootState.root.path),
2198
2298
  };
2199
2299
  refreshWorkspaceRoot();
@@ -60,6 +60,7 @@
60
60
  };
61
61
 
62
62
  async function request(path, init = {}) {
63
+ await globalThis.flolessStartupAdmission?.admit(path, { method: init.method, signal: init.signal });
63
64
  const controller = new AbortController();
64
65
  const timer = setTimer(() => controller.abort(), requestTimeoutMs);
65
66
  try {