@floless/app 0.149.1 → 0.151.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 (50) hide show
  1. package/dist/floless-server.cjs +104263 -88361
  2. package/dist/schemas/drawing-check.profile.v1.schema.json +45 -2
  3. package/dist/schemas/steel.model.v2.schema.json +9 -0
  4. package/dist/skills/floless-app-approval/SKILL.md +79 -4
  5. package/dist/skills/floless-app-onboarding/SKILL.md +200 -87
  6. package/dist/skills/floless-app-onboarding/references/aware-runtime.md +27 -18
  7. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +207 -0
  8. package/dist/skills/floless-app-routines/SKILL.md +4 -1
  9. package/dist/skills/floless-app-routines/references/routines-api.md +14 -2
  10. package/dist/skills/floless-app-steel-model/SKILL.md +4 -2
  11. package/dist/skills/floless-app-steel-takeoff/SKILL.md +14 -9
  12. package/dist/skills/floless-app-workflows/SKILL.md +2 -2
  13. package/dist/templates/tekla-parser.flo +13 -3
  14. package/dist/web/agents.js +983 -0
  15. package/dist/web/app.css +556 -43
  16. package/dist/web/app.js +34 -112
  17. package/dist/web/aware.js +1774 -169
  18. package/dist/web/chat.css +62 -1
  19. package/dist/web/chat.js +1666 -59
  20. package/dist/web/commands-drawing-check.js +15 -0
  21. package/dist/web/commands-revit.js +5 -0
  22. package/dist/web/commands-shell.js +955 -53
  23. package/dist/web/commands-tekla-parser.js +8 -1
  24. package/dist/web/connections.js +57 -14
  25. package/dist/web/drawing-check-editor.html +10 -2
  26. package/dist/web/drawing-check-editor.js +569 -40
  27. package/dist/web/drawing-check-overlay.js +45 -2
  28. package/dist/web/guide.js +675 -0
  29. package/dist/web/index.html +162 -31
  30. package/dist/web/instructor.js +91 -8
  31. package/dist/web/leave-guard.js +1 -0
  32. package/dist/web/left-pane.js +20 -1
  33. package/dist/web/local-discovery.js +12 -2
  34. package/dist/web/model-editor.css +32 -32
  35. package/dist/web/model-panel-bridge.js +11 -3
  36. package/dist/web/model-viewport-lighting.js +4 -2
  37. package/dist/web/model-viewport-revit-adapter.js +3 -0
  38. package/dist/web/model-viewport-toolbar.js +6 -3
  39. package/dist/web/model-viewport.js +11 -1
  40. package/dist/web/revit-editor.css +14 -14
  41. package/dist/web/revit-editor.js +64 -12
  42. package/dist/web/steel-3d-core.js +133 -0
  43. package/dist/web/steel-3d-view.js +10 -0
  44. package/dist/web/steel-editor.html +171 -39
  45. package/dist/web/steel-model-v2-client-validation.js +11 -0
  46. package/dist/web/steel-model-v2-commands.js +80 -5
  47. package/dist/web/tool-updates.js +533 -0
  48. package/dist/web/workspaces.js +896 -123
  49. package/package.json +2 -2
  50. package/dist/skills/floless-app-onboarding/references/floless-app-tour.md +0 -156
package/dist/web/app.js CHANGED
@@ -104,14 +104,9 @@ function renderCanvasPlaceholder(kind) {
104
104
  `</div>`;
105
105
  }
106
106
 
107
- // First-run onboarding card (the 'empty' placeholder). The primary action is "Start the guided tour"
108
- // — it copies a prompt the user pastes into their terminal AI to launch onboarding. No raw CLI command
109
- // is shown: the AI builds the workflows (per the headline), so the card stays AI-native, not "go run
110
- // this command yourself". No repeated brand mark (not a splash).
111
- // The natural-language launch prompt the "Start the guided tour" button copies. Phrased to match the
112
- // floless-app-onboarding skill's auto-trigger ("onboard me", "guided tour") so pasting it into Claude
113
- // Code / Codex starts the tour. Plain language (not a slash command) = portable across terminal hosts.
114
- const ONB_TOUR_PROMPT = 'Onboard me into floless.app and AWARE — give me the guided tour.';
107
+ // First-run onboarding card (the 'empty' placeholder). The primary action is "Ask the Guide" (#2046): FloLess's
108
+ // onboarding agent in AI Chat, which looks at this computer (with the person's agreement) and shows them around. It
109
+ // replaced the old "Start the guided tour" that copied a prompt for an external terminal; that prompt still works there.
115
110
  function onboardingHtml() {
116
111
  const step = (n, label, note) =>
117
112
  `<li><span class="onb-num">${n}</span><span class="onb-step"><span class="onb-step-label">${label}</span> <span class="onb-step-note">${note}</span></span></li>`;
@@ -120,9 +115,8 @@ function onboardingHtml() {
120
115
  `<div class="onb-headline">Your terminal AI builds the workflows.<br>You run and inspect them here.</div>` +
121
116
  `<div class="onb-sub">floless.app shows the canvas, triggers runs, and streams results. Compose in Claude Code or Codex; the browser is the window.</div>` +
122
117
  `<div class="onb-tour">` +
123
- `<span class="onb-tour-hint">New here? Copies a prompt — paste it into Claude Code or Codex.</span>` +
124
- `<button class="onb-tour-btn" type="button" aria-label="Start the guided tour — copies the onboarding prompt to your clipboard"><span class="onb-tour-label">Start the guided tour</span><span class="onb-tour-ico" aria-hidden="true">⎘</span></button>` +
125
- `<span class="sr-only onb-tour-live" aria-live="polite"></span>` +
118
+ `<span class="onb-tour-hint">New here? The Guide looks at your setup in AI Chat and suggests where to start.</span>` +
119
+ `<button class="onb-tour-btn" type="button" data-command-id="shell.ask-guide#the Workflows page" data-tip="Ask the Guide in AI Chat to look at your setup and suggest what to do first."><span class="onb-tour-label">Ask the Guide</span><span class="onb-tour-ico" aria-hidden="true">→</span></button>` +
126
120
  `</div>` +
127
121
  `<div class="onb-divider"></div>` +
128
122
  `<ol class="onb-steps">` +
@@ -135,107 +129,18 @@ function onboardingHtml() {
135
129
  `</div>`
136
130
  );
137
131
  }
138
- // Wire a "Start the guided tour" button: copy the natural-language onboarding prompt so the user can
139
- // paste it into their terminal AI to launch the tour (the floless-app-onboarding skill), and confirm
140
- // in place. SHARED — the Workflows first-run card below and the Workspaces zero-projects empty state
141
- // (workspaces.js, #598) are two entry points to the SAME tour, so they must not drift in prompt text,
142
- // confirmation wording, or reset timing; one function is what guarantees that.
143
- // Markup contract: a button may be bare text (it is then its own label), or split into
144
- // `.onb-tour-label` + `.onb-tour-ico` — never an icon span with no label span, which would have the
145
- // label swap wipe the icon out. Its `[aria-live]` region is found as a sibling rather than passed in,
146
- // so a call site cannot quietly wire a button with no way to announce the result.
147
- function wireTourCopy(btn) {
132
+ // Wire an "Ask the Guide" button (#2046). SHARED — the Workflows first-run card and the Workspaces zero-projects empty
133
+ // state (workspaces.js) are two ways into the same Guide, so they must behave the same; one function guarantees that.
134
+ function wireAskGuide(btn) {
148
135
  if (!btn) return;
149
- const ico = btn.querySelector('.onb-tour-ico');
150
- const label = btn.querySelector('.onb-tour-label') || btn;
151
- // Loud, because that mistake is otherwise invisible AND permanent: with no label span the swap below
152
- // writes over the whole button, destroying the icon element, and the reset restores flat text. The
153
- // button keeps "working", so nothing else would ever report it.
154
- if (ico && label === btn) console.error('[onboarding] a tour button with .onb-tour-ico must also have .onb-tour-label — the label swap will destroy the icon', btn);
155
- const live = btn.parentElement ? btn.parentElement.querySelector('[aria-live]') : null;
156
- // Equally loud. Finding the region by structure keeps the two call sites from passing mismatched
157
- // selectors, but it also means an extra wrapper around the button silently costs every screen-reader
158
- // announcement — and the four `if (live)` guards below would hide that forever. Say so instead.
159
- if (!live) console.error('[onboarding] no [aria-live] sibling for this tour button — the copy result will not be announced', btn);
160
- // Read the idle text off the DOM rather than hardcoding it — the two call sites label the action
161
- // differently ("Start the guided tour" vs "Start the guided tour →") and only the markup knows which.
162
- const idleLabel = label.textContent;
163
- const idleIco = ico ? ico.textContent : '';
164
- btn.onclick = async () => {
165
- // ONLY the copy goes inside the try. Wrapping the confirmation too meant a throw anywhere in it
166
- // (showToast dereferences #toast-container unguarded) landed in the catch with the button already
167
- // disabled and the reset never scheduled — a permanently stuck "Copied ✓" under a toast saying the
168
- // copy failed. That was the one path where this button could actively misinform.
169
- try {
170
- await navigator.clipboard.writeText(ONB_TOUR_PROMPT);
171
- } catch (err) {
172
- // Bind and log it: "navigator.clipboard is undefined" (insecure context / blocked by policy —
173
- // permanent) and "writeText rejected" (denied, or the document wasn't focused — often retryable)
174
- // reach the user as one message, and with nothing logged a bug report can't separate them either.
175
- console.error('[onboarding] could not copy the tour prompt', err);
176
- revealTourPrompt(btn, live);
177
- return;
178
- }
179
- // Disabling a focused control blurs it, and re-enabling does NOT bring focus back — so a keyboard
180
- // user would be dropped to <body> for the whole confirmation and have to tab in from the top
181
- // again. Restore it: the same discipline retryProjects() applies on this very surface.
182
- // MUST be read before disabling, which blurs it — after, this is always false.
183
- const hadFocus = document.activeElement === btn;
184
- btn.disabled = true;
185
- label.textContent = 'Copied';
186
- if (ico) ico.textContent = '✓';
187
- if (live) live.textContent = 'Copied to clipboard';
188
- // A successful copy retires any prompt a previous refusal put on screen — otherwise a stale
189
- // "copy this manually" field sits under a button reading "Copied ✓", contradicting it.
190
- const stale = btn.parentElement ? btn.parentElement.querySelector('.onb-tour-manual') : null;
191
- if (stale) stale.remove();
192
- setTimeout(() => {
193
- label.textContent = idleLabel;
194
- if (ico) ico.textContent = idleIco;
195
- btn.disabled = false;
196
- if (live) live.textContent = '';
197
- // Only take focus back if it is still nowhere. 1600 ms is long enough for the user to click or
198
- // tab onto something else — and a mouse click focuses the button too, so `hadFocus` alone would
199
- // yank focus out of whatever they moved to. isConnected because a repaint may have replaced this
200
- // node, and focusing a detached button drops them to <body>: the very thing this prevents.
201
- const parked = document.activeElement;
202
- if (hadFocus && btn.isConnected && (!parked || parked === document.body)) {
203
- btn.focus({ focusVisible: true, preventScroll: true });
204
- }
205
- }, 1600);
206
- showToast('Copied — paste it into your terminal AI', 'ok');
136
+ btn.onclick = () => {
137
+ if (window.flolessGuide?.open) { void window.flolessGuide.open({ returnFocus: btn }); return; }
138
+ showToast('The Guide isn’t ready yet. Try again in a moment, or open it from ≡ → Guide.', 'warn');
207
139
  };
208
140
  }
209
- // The clipboard is this button's ONLY route into onboarding, and the prompt is rendered nowhere — so
210
- // "copy it manually" asks for something the user cannot do: there is nothing on screen to copy. Put
211
- // the prompt on screen, selected, and the message becomes true. Both entry points inherit this.
212
- function revealTourPrompt(btn, live) {
213
- const host = btn.parentElement;
214
- let box = host ? host.querySelector('.onb-tour-manual') : null;
215
- if (host && !box) {
216
- // A textarea, not an input: the prompt is wider than the Workflows card, and a single-line input
217
- // clips it mid-sentence. Selecting still copies the whole thing, but "copy it manually" is only
218
- // honest if the user can also READ what they are copying.
219
- box = document.createElement('textarea');
220
- box.className = 'onb-tour-manual';
221
- box.rows = 2;
222
- box.readOnly = true;
223
- box.value = ONB_TOUR_PROMPT;
224
- box.setAttribute('aria-label', 'The onboarding prompt — copy this and paste it into your terminal AI');
225
- host.appendChild(box);
226
- }
227
- // focus+setSelectionRange, not select(): select() scrolls the element into view with no way to
228
- // opt out, and on the Workflows card that means scrolling inside .canvas (overflow:hidden) whose
229
- // .topology child is the pan/zoom transformed world — a scrollTop nothing can put back.
230
- if (box) { box.focus({ preventScroll: true }); box.setSelectionRange(0, box.value.length); }
231
- if (live) live.textContent = 'Could not copy. The prompt is now shown — copy it manually.';
232
- showToast(box
233
- ? 'Couldn’t reach the clipboard — the prompt is shown below; copy it manually.'
234
- : 'Could not copy — this browser is blocking the clipboard.', 'warn');
235
- }
236
141
  function wireOnboardingCopy() {
237
142
  // The primary first-run action on the empty canvas.
238
- wireTourCopy($topology.querySelector('.onb-tour-btn'));
143
+ wireAskGuide($topology.querySelector('.onb-tour-btn'));
239
144
  // Secondary first-run action: "Build your first workflow" — the empty canvas is the
240
145
  // highest-intent moment to create one, so surface the same relay the ≡ menu's "New
241
146
  // workflow…" fires (handleMenuAction is reassigned in aware.js → requestNewWorkflow).
@@ -538,7 +443,7 @@ function selectAgent(id, { reveal = false } = {}) {
538
443
  function renderInspect() {
539
444
  const a = AGENTS[state.selectedAgentId];
540
445
  if (!a) {
541
- $inspectBd.innerHTML = '<div class="empty-state">Click an agent in the canvas to inspect.</div>';
446
+ $inspectBd.innerHTML = '<div class="empty-state">Click a tool in the canvas to inspect.</div>';
542
447
  return;
543
448
  }
544
449
  // Stale find-highlights reference text nodes from a now-discarded <pre>; clear
@@ -876,7 +781,7 @@ function renderLibrary() {
876
781
  <button class="lib-fav ${faved ? 'faved' : ''}" data-lib-fav="${id}" data-tip="${faved ? 'In favorites' : 'Add to favorites'}">★</button>
877
782
  </div>
878
783
  `;
879
- }).join('') || '<div class="empty-state">No agents match.</div>';
784
+ }).join('') || '<div class="empty-state">No tools match.</div>';
880
785
  $libList.querySelectorAll('.lib-fav').forEach(btn => {
881
786
  btn.onclick = () => toggleFav(btn.dataset.libFav);
882
787
  });
@@ -1237,7 +1142,7 @@ $runBtn.onclick = async () => {
1237
1142
  state.currentTab = 'execution';
1238
1143
  document.querySelectorAll('.tabs button').forEach(b => b.classList.toggle('active', b.dataset.tab === 'execution'));
1239
1144
  renderInspect();
1240
- appendNarration(`Execution complete · ${nodeIds(p).length} steps fired · check the <strong>Execution</strong> tab on each agent for the full trace.`);
1145
+ appendNarration(`Execution complete · ${nodeIds(p).length} steps fired · check the <strong>Execution</strong> tab on each tool for the full trace.`);
1241
1146
  };
1242
1147
 
1243
1148
  document.querySelectorAll('.panel-toggle').forEach(btn => {
@@ -1386,7 +1291,10 @@ function handleMenuAction(action) {
1386
1291
  case 'workspace-folder': openWorkspaceRoot(); break;
1387
1292
  case 'agents': openLibrary(); break;
1388
1293
  case 'routines': openRoutines(); break;
1294
+ case 'tool-update-policy': if (typeof window.openToolUpdatePolicy === 'function') window.openToolUpdatePolicy(); break;
1389
1295
  case 'report-issue': openReportIssue(); break;
1296
+ // #2046: the Guide — opens its conversation, or asks first (web/guide.js).
1297
+ case 'guide': if (window.flolessGuide) void window.flolessGuide.open({ returnFocus: document.getElementById('menu-btn') }); break;
1390
1298
  case 'fullscreen': toggleFullscreen(); break;
1391
1299
  // Asks first (unsaved work, a running workflow) — see web/leave-guard.js.
1392
1300
  case 'stop-app': if (window.flolessLeaveGuard) window.flolessLeaveGuard.stopApp(); break;
@@ -1435,7 +1343,7 @@ function openFind() {
1435
1343
  const ws = window.flolessWorkspaces && window.flolessWorkspaces.findActive();
1436
1344
  // In Workspaces mode there's nothing to find off the Model step — don't pop a dead overlay.
1437
1345
  if (document.getElementById('app').classList.contains('mode-workspaces') && !ws) return;
1438
- $findInput.placeholder = ws ? 'Find in model…' : 'Find agent…';
1346
+ $findInput.placeholder = ws ? 'Find in model…' : 'Find tool…';
1439
1347
  $findOverlay.classList.add('show');
1440
1348
  $findInput.value = '';
1441
1349
  $findCount.textContent = '';
@@ -1648,7 +1556,12 @@ if (!fullscreenSupported()) {
1648
1556
 
1649
1557
  // A server, browser, or command error describes the software's internals, not what a person needs
1650
1558
  // to do. Keep it in the console for diagnosis and give the person a clear recovery path instead.
1559
+ // The one exception is a sentence the server WROTE for the person (`authoredToastCopy`): a setup remedy
1560
+ // names their own folders and projects, and a project called "Null Street Bridge" or a folder called
1561
+ // "Exception tower" is not a diagnostic — replacing that sentence with "lost contact" would be untrue.
1651
1562
  function userSafeToastMessage(msg, type) {
1563
+ const authored = msg && typeof msg === 'object' ? msg[Symbol.for('floless.authored-toast-copy')] : undefined;
1564
+ if (typeof authored === 'string') return authored.trim() || 'We couldn’t finish that. Your work is still here. Try again.';
1652
1565
  const text = String(msg ?? '').trim();
1653
1566
  if ((type === 'warn' || type === 'err')
1654
1567
  && /\b(?:http\s*\d+|error:|exception|stack trace|server log|status code|undefined|null|subscription required|unauthori[sz]ed|forbidden)\b/i.test(text)) {
@@ -1657,6 +1570,15 @@ function userSafeToastMessage(msg, type) {
1657
1570
  return text || 'We couldn’t finish that. Your work is still here. Try again.';
1658
1571
  }
1659
1572
 
1573
+ /**
1574
+ * Marks a sentence the SERVER wrote for people — a setup remedy, never an error's text — so the toast shows
1575
+ * it as written. Only for copy authored as user copy on the server; anything else goes to showToast as a
1576
+ * plain string and keeps the safety filter.
1577
+ */
1578
+ function authoredToastCopy(text) {
1579
+ return { [Symbol.for('floless.authored-toast-copy')]: String(text ?? '') };
1580
+ }
1581
+
1660
1582
  function showToast(msg, type, options) {
1661
1583
  const c = document.getElementById('toast-container');
1662
1584
  const t = document.createElement('div');
@@ -2111,7 +2033,7 @@ async function confirmWorkspaceRoot() {
2111
2033
  ? [...new Set(error.body.blockers.map((blocker) => blocker && blocker.label).filter(Boolean))]
2112
2034
  : [];
2113
2035
  setWorkspaceRootError(busy
2114
- ? `FloLess cannot change this Workspace directory while work is still running${activities.length ? ` (${activities.join(', ')})` : ''}. Stop or let that work finish, then choose the folder again.`
2036
+ ? `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.`
2115
2037
  : workspaceRootErrorMessage(error));
2116
2038
  } finally {
2117
2039
  setWorkspaceRootBusy(false);