@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
@@ -8,6 +8,19 @@ const STYLE = { pass: { w: 1.2, dash: '' }, fail: { w: 2.4, dash: '' }, 'dont-kn
8
8
  const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
9
9
  const num = (v) => (Number.isFinite(v) ? Math.round(v * 10) / 10 : 0);
10
10
 
11
+ /**
12
+ * A run made before #2481 named a drawing picked in the run view by its storage digest (`<64 hex>.pdf`), and baked
13
+ * that name into its questions. Show such a name by its first eight characters and `ellipsis`; the full digest stays
14
+ * in the record and in the sheet's tooltip. A run made since names the drawing by the file name the person picked.
15
+ * Only that file-name form (`<64 hex>.pdf`) is shortened: any other digest-shaped value in a message (an id read from
16
+ * the sheet, say) is what the person has to judge, so it is shown whole.
17
+ * @param {unknown} text
18
+ * @param {string} [ellipsis]
19
+ */
20
+ export function shortDigests(text, ellipsis = '…') {
21
+ return String(text ?? '').replace(/\b([0-9a-f]{8})[0-9a-f]{56}(?=\.pdf\b)/gi, (_, head) => `${head}${ellipsis}`);
22
+ }
23
+
11
24
  const boxKey = (e) => `${e.drawing || ''}|${e.page}|${(e.bbox || []).map(num).join(',')}`;
12
25
 
13
26
  /**
@@ -25,7 +25,7 @@
25
25
  const reduced = () => Boolean(motion && motion.matches);
26
26
  // A one-off (`once` seconds, e.g. Hello's hat tip) moves until it has played, then settles once on its still frame.
27
27
  function moving(a) {
28
- if (ANIMATED.has(a.mood)) return true;
28
+ if (ANIMATED.has(a.mood) || a.awake) return true;
29
29
  if (!a.playUntil) return false;
30
30
  if (performance.now() < a.playUntil) return true;
31
31
  a.playUntil = 0; a.dirty = true;
@@ -52,7 +52,8 @@
52
52
  c.clearRect(0, 0, a.w, a.h);
53
53
  const t = !animates(a) ? STILL_T_BY_MOOD[a.mood] ?? STILL_T
54
54
  : a.playUntil ? Math.max(0, (now - a.playStart) / 1000) : (now - epoch) / 1000;
55
- drawFlo(c, { x: a.w / 2, y: a.cy, r: a.r, mood: a.mood, hat: a.hat, t, colors: a.colors });
55
+ // The blink shift belongs to a moving Flo: a still frame keeps the plain clock, or it could freeze mid-blink.
56
+ drawFlo(c, { x: a.w / 2, y: a.cy, r: a.r, mood: a.mood, hat: a.hat, t, colors: a.colors, look: a.look || undefined, seed: animates(a) ? a.seed : 0 });
56
57
  a.dirty = false;
57
58
  a.placed = true;
58
59
  }
@@ -146,7 +147,7 @@
146
147
  const a = {
147
148
  canvas, ctx: canvas.getContext('2d'), dpr, w, h, r, cy: hatRoom ? h - 1.2 * r : h / 2,
148
149
  mood, hat: Boolean(o.hat), colors: null, dirty: true, placed: false, onScreen: true,
149
- once: o.once || 0, playStart: 0, playUntil: 0,
150
+ once: o.once || 0, playStart: 0, playUntil: 0, awake: false, look: null, seed: 0,
150
151
  };
151
152
  // Plays its one-off motion from the start (on mount, and again on each play()).
152
153
  const play = () => {
@@ -180,6 +181,30 @@
180
181
  if (!avatars.has(a)) { avatars.add(a); if (seen) seen.observe(canvas); }
181
182
  schedule();
182
183
  },
184
+ // Awake while the pointer is near it: it blinks (once at once, then as usual) and, given lookAt, watches the
185
+ // pointer. Under reduced motion it does not blink, but it still turns its eyes to where it is told to look.
186
+ wake() {
187
+ if (a.awake) return;
188
+ a.awake = true;
189
+ // Shift the blink clock so a blink begins now: a greeting, then the usual rhythm.
190
+ const now = (performance.now() - epoch) / 1000;
191
+ if (typeof FLO_BLINK_EVERY === 'number') a.seed = FLO_BLINK_AT - (now % FLO_BLINK_EVERY) + 0.01;
192
+ a.dirty = true; a.placed = false;
193
+ if (!avatars.has(a)) { avatars.add(a); if (seen) seen.observe(canvas); }
194
+ schedule();
195
+ },
196
+ // Where to look, each of x and y from -1 (left, up) to 1 (right, down).
197
+ lookAt(x, y) {
198
+ const k = (v) => Math.max(-1, Math.min(1, Number(v) || 0));
199
+ a.look = [k(x), k(y)]; a.dirty = true;
200
+ schedule();
201
+ },
202
+ // Back to its still self: eyes ahead, no more blinking.
203
+ rest() {
204
+ if (!a.awake && !a.look) return;
205
+ a.awake = false; a.look = null; a.seed = 0; a.dirty = true;
206
+ schedule();
207
+ },
183
208
  destroy() {
184
209
  forget(a);
185
210
  canvas.remove();
package/dist/web/guide.js CHANGED
@@ -63,13 +63,17 @@
63
63
  async function ensureSession() {
64
64
  if (state.sessionReady) return;
65
65
  let response;
66
- try { response = await fetch('/api/chat/session', { credentials: 'same-origin' }); }
66
+ try {
67
+ await globalThis.flolessStartupAdmission?.admit('/api/chat/session');
68
+ response = await fetch('/api/chat/session', { credentials: 'same-origin' });
69
+ }
67
70
  catch { throw new Error('FloLess could not be reached. Make sure it is still running, then try again.'); }
68
71
  if (!response.ok) throw new Error('FloLess could not open AI Chat’s session, so the Guide could not load. Reload FloLess and try again.');
69
72
  state.sessionReady = true;
70
73
  }
71
74
 
72
75
  async function api(path, body, retried = false) {
76
+ await globalThis.flolessStartupAdmission?.admit(path, { method: body ? 'POST' : 'GET' });
73
77
  await ensureSession();
74
78
  const init = { credentials: 'same-origin', method: body ? 'POST' : 'GET' };
75
79
  if (body) { init.body = JSON.stringify(body); init.headers = { 'content-type': 'application/json' }; }
@@ -1505,7 +1509,8 @@
1505
1509
  if (card) cardPainters.get(card)?.();
1506
1510
  }
1507
1511
 
1508
- window.flolessGuide = { open, maybeAskOnLaunch, turnOff, deleteHistory, renderNextMove, applyMoveUpdate, status: loadStatus, paintBriefing, refreshBriefing };
1512
+ // #2399 PR C2: AI Chat's assistant cards name their buttons and open their places the way the Guide's cards do.
1513
+ window.flolessGuide = { open, maybeAskOnLaunch, turnOff, deleteHistory, renderNextMove, applyMoveUpdate, moveText, openFlow, status: loadStatus, paintBriefing, refreshBriefing };
1509
1514
 
1510
1515
  // Ask once, after AI Chat is ready and the app has settled.
1511
1516
  // #2053: and, once settled, whether a morning briefing is ready or needs an answer.
@@ -53,14 +53,16 @@
53
53
  OPENS in is unchanged — that is the remembered `floless:mode`, defaulting to
54
54
  Workflows. -->
55
55
  <div class="mode-switch" id="mode-switch" role="tablist" aria-label="Mode">
56
+ <!-- Each tab carries its part's icon in its part's colour, the same drawings Flo builds on the chat's
57
+ start screens (web/chat-landing-scene.js): stacked sheets, joined steps, Flo in its hard hat. -->
56
58
  <!-- data-tip, never title= (verify:no-title) — the native tooltip renders a light OS panel
57
59
  against this dark theme. The two describe the two MODULES rather than the two buttons,
58
60
  because "what is the difference between these" is the question a new user actually has
59
61
  here; they are deliberately parallel in shape so they read as two answers to it. -->
60
- <button data-command-id="shell.mode-workspaces" type="button" data-mode="workspaces" role="tab" aria-selected="false" data-tip="One project at a time — its drawings, the model built from them, and what comes out. Open this to work on a job.">Workspaces</button>
61
- <button data-command-id="shell.mode-workflows" type="button" data-mode="workflows" class="active" role="tab" aria-selected="true" data-tip="A repeatable process — pick one, set its inputs, compile it, then run it against your project. Open this to build or run an automation.">Workflows</button>
62
+ <button data-command-id="shell.mode-workspaces" type="button" data-mode="workspaces" role="tab" aria-selected="false" data-tip="One project at a time — its drawings, the model built from them, and what comes out. Open this to work on a job."><svg class="mode-icon mode-icon-ws" viewBox="0 0 16 16" aria-hidden="true"><rect x="1.5" y="9" width="6" height="5" rx="1"/><rect x="8.5" y="9" width="6" height="5" rx="1"/><rect x="5" y="2.5" width="6" height="5" rx="1"/><path d="M3 11.5h3M10 11.5h3M6.5 5h3"/></svg><span>Workspaces</span></button>
63
+ <button data-command-id="shell.mode-workflows" type="button" data-mode="workflows" class="active" role="tab" aria-selected="true" data-tip="A repeatable process — pick one, set its inputs, compile it, then run it against your project. Open this to build or run an automation."><svg class="mode-icon mode-icon-wf" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 5.5 8 11.5 12.5 4.5"/><circle cx="3.5" cy="5.5" r="2.1"/><circle cx="8" cy="11.5" r="2.1"/><circle cx="12.5" cy="4.5" r="2.1"/></svg><span>Workflows</span></button>
62
64
  <!-- #2007: delegated responsibilities run by hand (web/agents.js). The AWARE library is Tools, in the ≡ menu. -->
63
- <button data-command-id="shell.mode-agents" type="button" data-mode="agents" role="tab" aria-selected="false" data-tip="A responsibility you hand over — what to check, and on which projects. Open this to set one up or run it by hand.">Agents</button>
65
+ <button data-command-id="shell.mode-agents" type="button" data-mode="agents" role="tab" aria-selected="false" data-tip="A responsibility you hand over — what to check, and on which projects. Open this to set one up or run it by hand."><svg class="mode-icon mode-icon-ag" viewBox="0 0 16 16" aria-hidden="true"><circle class="mode-icon-ring" cx="8" cy="10.6" r="4"/><rect class="mode-icon-eye" x="6.2" y="9.4" width="1.15" height="2.4" rx=".575"/><rect class="mode-icon-eye" x="8.65" y="9.4" width="1.15" height="2.4" rx=".575"/><path class="mode-icon-hat" d="M4.3 6.4C4.3 3.5 6 2 8 2s3.7 1.5 3.7 4.4Z"/><rect class="mode-icon-hat" x="3" y="5.9" width="10" height="1.5" rx=".75"/><path class="mode-icon-ridge" d="M8 2.6V5.9"/></svg><span>Agents</span></button>
64
66
  </div>
65
67
  <!-- Workspace view switch (Canvas = the workflow topology; Dashboard = the user's
66
68
  custom panels from ~/.floless/ui/extensions.json) moved into the ≡ menu in #149.
@@ -91,6 +93,8 @@
91
93
  <!-- Shown only when the OPEN workflow is forked (user-owned, off the update channel). Purely
92
94
  informational (the badge of ownership); the picker row carries the same "yours" cue. -->
93
95
  <span id="wf-forked" class="wf-forked-pill" hidden role="status" data-tip="You forked this workflow — it no longer receives FloLess updates. You are responsible for verifying its output.">yours · off updates</span>
96
+ <!-- #2241: the open workflow has a step answered by an AI Agent. Text only; the tip says exactly what varies. -->
97
+ <span id="wf-agent-step" class="wf-forked-pill wf-ai-pill" hidden role="status"></span>
94
98
  <!-- Agents (⊞) and Routines (⏱) buttons moved into the ≡ menu in #149
95
99
  (Ctrl+G / Ctrl+R); the toolbar keeps only the run-critical controls. -->
96
100
  <span class="ctl-sep" aria-hidden="true"></span>
@@ -121,6 +125,15 @@
121
125
  <div class="wf-list" id="ws-proj-list"></div>
122
126
  </div>
123
127
  </div>
128
+ <!-- Project access (spec 2026-10-19): what reaches into this project — Agents, schedules, workflows. A header
129
+ chip, not a step tab: the step row is the project's work; this is about the whole project. The count is
130
+ written by project-access.js once it is read (never a 0 while loading). -->
131
+ <button data-command-id="shell.project-access" type="button" id="ws-access" class="ws-access-chip" hidden
132
+ aria-haspopup="dialog" aria-expanded="false" aria-controls="project-access-sheet"
133
+ data-tip="See which Agents, schedules and workflows reach into this project, and switch them off">
134
+ <svg class="ws-access-ico" width="14" height="14" viewBox="0 0 16 16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="5.5" r="2.5"/><path d="M1.5 13.5c.6-2.4 2.3-3.7 4.5-3.7s3.9 1.3 4.5 3.7"/><path d="M10.5 3.2a2.5 2.5 0 0 1 0 4.6M12.2 9.9c1.2.5 2 1.7 2.3 3.6"/></svg>
135
+ <span class="ws-access-label">Project access</span><span class="ws-access-count" id="ws-access-count" hidden></span>
136
+ </button>
124
137
  <span class="ctl-sep" aria-hidden="true"></span>
125
138
  <button data-command-id="shell.approve" id="ws-approve" type="button" class="primary"
126
139
  data-tip="Review every pending change before signing off.">Review &amp; approve</button>
@@ -193,6 +206,8 @@
193
206
  <button data-command-id="shell.chat-model" type="button" class="ai-chat-setting" id="chat-model" aria-haspopup="listbox" aria-expanded="false" data-tip="Choose the model for future messages in this conversation."><span>AI model</span><strong>Choose model</strong></button>
194
207
  <button data-command-id="shell.chat-effort" type="button" class="ai-chat-setting" id="chat-effort" aria-haspopup="listbox" aria-expanded="false" data-tip="Choose how much reasoning the AI uses for future messages."><span>Effort</span><strong>Medium</strong></button>
195
208
  <button data-command-id="shell.chat-permission" type="button" class="ai-chat-setting" id="chat-permission" aria-haspopup="listbox" aria-expanded="false" data-tip="Access controls what the AI may change: Read only, Auto, Working folder write, or Full access."><span>Access</span><strong>Read only</strong></button>
209
+ <!-- #2399: the account's "Suggest next steps" mode (On / Quiet / Off), the same in every chat; also in ≡. -->
210
+ <button data-command-id="shell.chat-suggest" type="button" class="ai-chat-setting" id="chat-suggest" aria-haspopup="listbox" aria-expanded="false" data-tip="Your account, in every project, workflow and workspace chat. The Guide always suggests; close it to stop."><span>Suggest next steps</span><strong>On</strong></button>
196
211
  <!-- #2046: the Guide's own controls, shown only in a Guide conversation. #2234: its Access is the ordinary
197
212
  picker above (it starts Read only); this cell keeps the briefing, set-aside suggestions, Turn off and Delete. -->
198
213
  <div class="ai-chat-setting ai-chat-guide-access" id="chat-guide-access" role="group" aria-labelledby="chat-guide-settings-label" hidden>
@@ -385,8 +400,18 @@
385
400
  ("Rendering frame 143 of 240"), elapsed time, a real bar, and Stop. Painted by web/run-strip.js from
386
401
  aware.js; appears only once a run has lasted 2 s or reports progress, so quick runs never flash it. -->
387
402
  <div class="run-strip" id="run-strip" role="group" aria-label="Run progress" hidden></div>
403
+ <!-- #2241 S5: how the last run went for its AI steps - each answer labelled AI-produced, and the batched "Questions for you".
404
+ Hidden unless the last run had an AI step. Filled by web/agent-steps.js from GET /api/latest-run/:id. -->
405
+ <details class="as-run" id="as-run" hidden>
406
+ <summary id="as-run-sum" data-command-id="shell.agent-run-toggle"></summary>
407
+ <div class="as-run-body" id="as-run-body"></div>
408
+ </details>
388
409
  <div class="topology" id="topology"></div>
389
410
  <div class="canvas-toolbar">
411
+ <!-- #2241: shown only while Agents as workflow steps is on (web/agent-steps.js). It asks AI Chat to add the step; it edits nothing itself. -->
412
+ <div class="toolbar-group as-add-group" id="as-add-group" hidden>
413
+ <button data-command-id="shell.agent-step-add" class="tb-btn tb-text" id="as-add" type="button" aria-haspopup="listbox" aria-expanded="false" data-tip="Add an Agent step… It asks AI Chat to add the step. Nothing changes until you send the request.">+ Agent step</button>
414
+ </div>
390
415
  <div class="toolbar-group">
391
416
  <button data-command-id="canvas.zoom#out" class="tb-btn" id="zoom-out" data-tip="Zoom out">−</button>
392
417
  <button data-command-id="canvas.zoom#back to 100%" class="tb-btn tb-pct" id="zoom-reset" data-tip="Reset to 100%">100%</button>
@@ -434,6 +459,7 @@
434
459
  <!-- The announcer stays outside the bounded visual region so it is mounted before the first
435
460
  update. The region itself is named for keyboard users whenever its content scrolls. -->
436
461
  <span class="sr-only wsg-live" id="ws-stage-guidance-live" role="status" aria-live="polite" aria-atomic="true"></span>
462
+ <div class="ws-project-location-warning" id="ws-project-location-warning" role="status" aria-live="polite" hidden></div>
437
463
  <div class="ws-stage-guidance" id="ws-stage-guidance" role="region" aria-label="Drawing read progress" hidden></div>
438
464
  <!-- Revision-read status card, ABOVE the filter iframe (chrome around it, never inside — the
439
465
  filter owns its own layout). Shown only on Drawings, and only when there is one. -->
@@ -488,7 +514,9 @@
488
514
  The UI never parses a source or edits the wiki — Organize queues a Request the
489
515
  terminal AI drains (AI at the edges). -->
490
516
  <div class="ws-knowledge" id="ws-knowledge" hidden></div>
491
- <input data-command-id="shell.add-knowledge" type="file" id="ws-knowledge-file" accept=".pdf,.png,.jpg,.jpeg,.txt,.csv,.md,image/*" multiple hidden>
517
+ <input data-command-id="shell.add-knowledge" type="file" id="ws-knowledge-file" accept=".pdf,.png,.jpg,.jpeg,.webp,.docx,.docm,.xlsx,.xlsm,.msg,.eml,.txt,.csv,.md,image/*" multiple hidden>
518
+ <!-- #2491 R6.3: Replace file… on a Word, Excel or email reference whose text could not be read (one file). -->
519
+ <input data-command-id="shell.kb-text-replace" type="file" id="ws-knowledge-replace" accept=".pdf,.png,.jpg,.jpeg,.webp,.docx,.docm,.xlsx,.xlsm,.msg,.eml,.txt,.csv,.md,image/*" hidden>
492
520
  </div>
493
521
  <div class="hint" id="canvas-hint">Click any node to inspect. Star ★ a node to save it as a reusable Template. Drag the background to pan — or press Home to fit.</div>
494
522
  <div class="fav-bar" id="fav-bar">
@@ -694,6 +722,76 @@
694
722
  </div>
695
723
  </div>
696
724
 
725
+ <!-- Held change (#2241, S5): a run stopped at a confirmation step and waits for the person. Not a modal: the canvas stays usable.
726
+ Filled by web/agent-steps.js from GET /api/chat/agent-steps/gates; the buttons post the person's decision. -->
727
+ <section class="as-gate" id="as-gate" role="region" aria-label="Waiting for your approval" tabindex="-1" hidden>
728
+ <div class="as-gate-live" id="as-gate-live" aria-live="assertive"></div>
729
+ <div class="as-gate-label" id="as-gate-label">Values that will be used</div>
730
+ <pre class="as-gate-values" id="as-gate-values" tabindex="0" aria-labelledby="as-gate-label"></pre>
731
+ <div class="as-gate-time" id="as-gate-time"></div>
732
+ <div class="as-gate-error" id="as-gate-error" role="alert" hidden></div>
733
+ <div class="as-gate-actions">
734
+ <button type="button" id="as-gate-skip" class="as-btn" data-command-id="shell.agent-gate-skip">Skip this change</button>
735
+ <button type="button" id="as-gate-approve" class="as-btn primary" data-command-id="shell.agent-gate-approve">Approve change</button>
736
+ </div>
737
+ <div class="as-gate-queue" id="as-gate-queue">This run holds the queue; other runs wait.</div>
738
+ </section>
739
+
740
+ <!-- Agent step confirmation (#2241, S4). Opened by Approve and Run when a workflow has an AI step nobody has confirmed (or that
741
+ changed since). One tick-box; the server records who, when and exactly which steps. Filled by web/agent-steps.js. -->
742
+ <div class="modal-backdrop" id="agent-consent-modal" role="dialog" aria-modal="true" aria-labelledby="ac-title" aria-describedby="ac-sub ac-warning">
743
+ <div class="modal ac-dialog">
744
+ <div class="modal-title" id="ac-title" tabindex="-1">This workflow includes an AI step</div>
745
+ <div class="modal-sub" id="ac-sub"></div>
746
+ <div class="ac-body" id="ac-body"></div>
747
+ <div class="ac-warning" id="ac-warning" hidden></div>
748
+ <label class="modal-check"><input type="checkbox" id="ac-tick" data-command-id="shell.agent-consent-tick" aria-label="I understand that this workflow has an AI step whose answer may differ each run" aria-describedby="ac-hint"><span id="ac-tick-label"></span></label>
749
+ <!-- S8 (#2495): a workflow that waits for a trigger — each AI step's wait between answers, then the second tick, which quotes it. -->
750
+ <fieldset class="ac-trigger" id="ac-trigger" hidden>
751
+ <legend class="fm-group-label">When the trigger fires</legend>
752
+ <div id="ac-waits"></div>
753
+ <label class="modal-check"><input type="checkbox" id="ac-tick2" data-command-id="shell.agent-consent-trigger-tick" aria-labelledby="ac-tick2-label" aria-describedby="ac-hint"><span id="ac-tick2-label"></span></label>
754
+ </fieldset>
755
+ <div class="ac-hint" id="ac-hint">Tick the box to continue.</div>
756
+ <div class="ac-error" id="ac-error" role="alert" hidden></div>
757
+ <div class="modal-actions">
758
+ <button data-command-id="shell.dialog-cancel#the AI step confirmation" id="ac-cancel">Cancel</button>
759
+ <button data-command-id="shell.agent-consent-remove" id="ac-remove" data-tip="Asks AI Chat to draft the change. Nothing is edited until you send it and approve the result.">Remove the AI step</button>
760
+ <button data-command-id="shell.agent-consent-approve" id="ac-ok" class="primary" aria-disabled="true" aria-describedby="ac-hint">Approve workflow</button>
761
+ </div>
762
+ </div>
763
+ </div>
764
+
765
+ <!-- Two steps share one name (#2314, epic #2241 slice 3c). Opened by Compile when AWARE cannot tell two steps apart: which one to
766
+ rename, to what, the exact change, and anything FloLess cannot be sure about. Filled by web/step-rename.js; nothing is written
767
+ until the person presses the primary button. -->
768
+ <div class="modal-backdrop" id="step-rename-modal" role="dialog" aria-modal="true" aria-labelledby="sr-title" aria-describedby="sr-sub">
769
+ <div class="modal ac-dialog sr-dialog">
770
+ <div class="modal-title" id="sr-title" tabindex="-1">Two steps have the same name</div>
771
+ <div class="modal-sub" id="sr-sub"></div>
772
+ <div class="sr-body">
773
+ <div class="sr-choice" role="radiogroup" aria-labelledby="sr-choice-label">
774
+ <div class="fm-group-label" id="sr-choice-label">Which step to rename</div>
775
+ <div id="sr-steps"></div>
776
+ </div>
777
+ <div class="modal-field sr-name-field">
778
+ <label for="sr-name">New name</label>
779
+ <input id="sr-name" type="text" autocomplete="off" spellcheck="false" maxlength="64" data-command-id="shell.step-rename-name" aria-describedby="sr-name-msg">
780
+ <div class="sr-name-msg" id="sr-name-msg" aria-live="polite"></div>
781
+ </div>
782
+ <div class="sr-preview" id="sr-preview" aria-live="polite"></div>
783
+ <div class="ac-warning" id="sr-warning" hidden></div>
784
+ </div>
785
+ <div class="ac-error" id="sr-error" role="alert" hidden></div>
786
+ <p class="sr-note" id="sr-note"></p>
787
+ <div class="ac-hint" id="sr-hint"></div>
788
+ <div class="modal-actions">
789
+ <button data-command-id="shell.dialog-cancel#renaming a step" id="sr-cancel">Cancel</button>
790
+ <button data-command-id="shell.step-rename-confirm" id="sr-ok" class="primary" aria-disabled="true" aria-describedby="sr-hint">Rename step</button>
791
+ </div>
792
+ </div>
793
+ </div>
794
+
697
795
  <!-- AWARE runtime + installed-host-bridge upgrade. One dedicated surface is
698
796
  shared by the footer pill and Workspaces recovery actions. Progress comes
699
797
  from the server transaction; this UI never infers installer completion. -->
@@ -761,7 +859,7 @@
761
859
  aria-labelledby="tool-updates-title" aria-describedby="tool-updates-sub" aria-busy="false">
762
860
  <div class="modal tool-updates-dialog" tabindex="-1">
763
861
  <div class="modal-title" id="tool-updates-title" tabindex="-1">Approve updated workflows</div>
764
- <div class="modal-sub" id="tool-updates-sub">Your workflows keep running on the tool versions you approved until you approve a change.</div>
862
+ <div class="modal-sub" id="tool-updates-sub">Nothing changes until you act: your workflows keep running on the tool versions you approved.</div>
765
863
  <div class="tool-updates-body" id="tool-updates-body"></div>
766
864
  <div class="tool-updates-live" id="tool-updates-live" role="status" aria-live="polite" aria-atomic="true"></div>
767
865
  <div class="tool-updates-progress" id="tool-updates-progress" hidden></div>
@@ -932,6 +1030,28 @@
932
1030
  <span class="rtn-toggle-track"></span>
933
1031
  </label>
934
1032
  </div>
1033
+ <!-- #2448: the AI note FloLess adds to reports of workflows with an AI Agent step, for every workflow (each workflow also has its
1034
+ own switch in its Agent step's Inspect panel). Hidden while Agent steps are off; web/agent-steps.js shows and drives it. -->
1035
+ <div class="menu-ai-note" id="menu-ai-note" hidden>
1036
+ <div class="menu-theme">
1037
+ <span class="menu-label" id="menu-ai-note-label">AI note in reports</span>
1038
+ <label class="rtn-toggle">
1039
+ <input type="checkbox" id="menu-ai-note-toggle" role="switch" aria-label="AI note in reports" aria-describedby="menu-ai-note-hint" data-command-id="shell.report-ai-note-all">
1040
+ <span class="rtn-toggle-track"></span>
1041
+ </label>
1042
+ </div>
1043
+ <p class="menu-ai-note-hint" id="menu-ai-note-hint">Reports of workflows with an AI step say that part of them was written by an AI. A change applies to reports made from now on.</p>
1044
+ </div>
1045
+ <!-- #2399: the account's "Suggest next steps" mode; the same setting as the AI Chat ⚙ row. -->
1046
+ <div class="menu-theme menu-suggest" id="menu-suggest">
1047
+ <span class="menu-label" id="menu-suggest-label">Suggestions</span>
1048
+ <div class="theme-toggle" role="radiogroup" aria-labelledby="menu-suggest-label">
1049
+ <button data-command-id="shell.suggest-mode#on" type="button" class="suggest-btn" data-mode="on" role="radio" aria-checked="false" data-tip="Problems to fix, unfinished work, and ideas">On</button>
1050
+ <button data-command-id="shell.suggest-mode#quiet" type="button" class="suggest-btn" data-mode="quiet" role="radio" aria-checked="false" data-tip="Only problems to fix and unfinished work">Quiet</button>
1051
+ <button data-command-id="shell.suggest-mode#off" type="button" class="suggest-btn" data-mode="off" role="radio" aria-checked="false" data-tip="No suggestion cards. The AI still knows where the project stands.">Off</button>
1052
+ </div>
1053
+ </div>
1054
+ <div class="menu-suggest-note" id="menu-suggest-note" hidden>FloLess had to reset your suggestion settings. Suggestions are paused until you choose.</div>
935
1055
  <div class="menu-theme">
936
1056
  <span class="menu-label">Theme</span>
937
1057
  <div class="theme-toggle">
@@ -1054,20 +1174,27 @@
1054
1174
  <div class="pv-title-row">
1055
1175
  <div class="modal-title" id="pv-title">Page</div>
1056
1176
  <span class="pg-ai-badge" id="pv-ai" tabindex="0" hidden data-tip="Made by AI.">AI-made</span>
1177
+ <span class="pg-seq-chip" id="pv-seq" tabindex="0" role="note" hidden aria-describedby="pv-seq-text"></span>
1178
+ <span class="pg-seq-text" id="pv-seq-text" hidden></span>
1057
1179
  <span class="pv-info" tabindex="0" data-tip="This Page runs on its own. It can’t reach FloLess or your files." aria-label="This Page runs on its own. It can’t reach FloLess or your files.">ⓘ</span>
1058
1180
  </div>
1059
1181
  <div class="modal-sub" id="pv-sub" role="status"></div>
1060
1182
  </div>
1061
1183
  <div class="report-actions">
1062
1184
  <div class="pv-anchor">
1063
- <button data-command-id="shell.page-version" id="pv-version" type="button" class="ghost pv-version" aria-haspopup="listbox" aria-expanded="false" aria-controls="pv-version-pop">Version 1 of 1</button>
1064
- <div class="wf-popover pv-pop" id="pv-version-pop" role="listbox" aria-label="Versions of this Page" hidden></div>
1185
+ <button data-command-id="shell.page-version" id="pv-version" type="button" class="ghost pv-version" aria-haspopup="listbox" aria-expanded="false" aria-controls="pv-version-list">Version 1 of 1</button>
1186
+ <div class="wf-popover pv-pop" id="pv-version-pop" hidden></div>
1065
1187
  </div>
1188
+ <button data-command-id="shell.page-full-report" id="pv-full-report" type="button" class="ghost" hidden data-tip="Open the whole report FloLess keeps on this computer, in its report viewer">Open the full report</button>
1066
1189
  <span class="pv-allowed" id="pv-allowed" hidden></span>
1067
1190
  <div class="pv-anchor">
1068
1191
  <button data-command-id="shell.page-sites" id="pv-sites" type="button" class="ghost" aria-haspopup="true" aria-expanded="false" aria-controls="pv-sites-pop" data-tip="Sites this Page may load">⋯</button>
1069
1192
  <div class="wf-popover pv-pop pv-sites-pop" id="pv-sites-pop" hidden></div>
1070
1193
  </div>
1194
+ <div class="pv-anchor">
1195
+ <button data-command-id="shell.page-share" id="pv-share" type="button" class="ghost pv-share" aria-haspopup="true" aria-expanded="false" aria-controls="pv-share-pop" aria-label="Share link"><span class="pv-share-dot" aria-hidden="true"></span><span id="pv-share-label">Share</span></button>
1196
+ <div class="wf-popover pv-pop pv-share-pop" id="pv-share-pop" role="group" aria-label="This Page's share link" data-reveal-by="#pv-share" hidden></div>
1197
+ </div>
1071
1198
  <button data-command-id="shell.page-fullscreen" id="pv-full" type="button" class="ghost" aria-pressed="false" data-tip="Fill the window with this Page">⤢ Full screen</button>
1072
1199
  <button data-command-id="shell.page-delete" id="pv-delete" type="button" class="ghost pv-delete" data-tip="Delete this Page and all its versions">Delete</button>
1073
1200
  <button data-command-id="shell.dialog-close#the Page" id="pv-close" type="button" data-tip="Close">×</button>
@@ -1080,6 +1207,21 @@
1080
1207
  </div>
1081
1208
  </div>
1082
1209
  </div>
1210
+ <!-- #2262 slice 4: every link this person shared from FloLess (web/pages.js fills the list). -->
1211
+ <div class="modal-backdrop" id="shared-links-modal" role="dialog" aria-modal="true" aria-labelledby="sl-title" aria-describedby="sl-sub">
1212
+ <div class="modal sl-modal">
1213
+ <div class="sl-head">
1214
+ <div>
1215
+ <div class="modal-title" id="sl-title">My shared links</div>
1216
+ <div class="modal-sub" id="sl-sub">Every link you shared from FloLess. Revoking a link stops it opening for everyone; a copy someone already opened or saved can't be taken back.</div>
1217
+ </div>
1218
+ <button data-command-id="shell.dialog-close#My shared links" id="sl-close" type="button" class="ghost" aria-label="Close">×</button>
1219
+ </div>
1220
+ <p class="sl-note" id="sl-note" role="status" hidden></p>
1221
+ <div class="sl-list" id="sl-list" role="list" aria-label="My shared links"></div>
1222
+ <div class="sl-foot"><button data-command-id="shell.shared-links-more" id="sl-more" type="button" class="ghost" hidden>Show more</button></div>
1223
+ </div>
1224
+ </div>
1083
1225
  <div class="modal-backdrop report-backdrop" id="report-modal" role="dialog" aria-modal="true" aria-labelledby="report-title" aria-describedby="report-sub">
1084
1226
  <div class="modal report-viewer">
1085
1227
  <div class="report-head">
@@ -1094,6 +1236,7 @@
1094
1236
  <button data-command-id="shell.report-watch" id="report-watch" type="button" class="ghost" hidden data-tip="Play the video this run rendered">▶ Watch video</button>
1095
1237
  <button data-command-id="shell.report-open-file" id="report-open-file" class="ghost" hidden data-tip="Open the saved file in its default app">⧉ Open file</button>
1096
1238
  <button data-command-id="shell.report-reveal-file" id="report-reveal-file" class="ghost" hidden data-tip="Show the saved file in its folder">▤ Reveal in folder</button>
1239
+ <button data-command-id="shell.report-page-open#this workflow" id="report-page" type="button" class="ghost" hidden data-tip="Every successful run of this workflow adds this report to the workflow's Page, keeping the last twenty">Open in Pages</button>
1097
1240
  <button data-command-id="shell.report-open" id="report-open" class="ghost" data-tip="Open the report in a new browser tab">↗ Open</button>
1098
1241
  <button data-command-id="shell.dialog-close#the report" id="report-close" data-tip="Close">×</button>
1099
1242
  </div>
@@ -1279,6 +1422,7 @@
1279
1422
  <label for="company-promotion-lineage">Add as</label>
1280
1423
  <select id="company-promotion-lineage" data-command-id="shell.company-promotion-lineage"></select>
1281
1424
  <p>Choose an existing entry only when this file is a new version of that exact company reference.</p>
1425
+ <div id="company-promotion-notes" class="company-promotion-notes" role="note" hidden></div>
1282
1426
  </section>
1283
1427
  <section id="company-knowledge-list" class="company-knowledge-list" aria-label="Shared references"></section>
1284
1428
  <section id="company-knowledge-confirm" class="company-knowledge-confirm" role="status" aria-live="polite" hidden></section>
@@ -1355,6 +1499,18 @@
1355
1499
 
1356
1500
  <!-- Save-on-switch confirmation — shown when switching workflows with unsaved
1357
1501
  input changes. Reuses the shared modal styling; no new backdrop look. -->
1502
+ <!-- Project access sheet (project-access.js): slides in from the right over the open project. -->
1503
+ <div class="modal-backdrop pa-backdrop" id="project-access-sheet" role="dialog" aria-modal="true" aria-labelledby="pa-title" aria-describedby="pa-sub">
1504
+ <aside class="pa-sheet" tabindex="-1">
1505
+ <header class="pa-head">
1506
+ <div><h2 class="pa-title" id="pa-title">Project access</h2><p class="pa-subtitle" id="pa-sub"></p></div>
1507
+ <button type="button" class="pa-close" id="pa-close" aria-label="Close Project access" data-tip="Close" data-command-id="shell.project-access-close">✕</button>
1508
+ </header>
1509
+ <div class="pa-body" id="pa-body"></div>
1510
+ <div class="pa-bar" id="pa-bar" hidden></div>
1511
+ <footer class="pa-foot">One-off runs you pick by hand aren’t listed.</footer>
1512
+ </aside>
1513
+ </div>
1358
1514
  <div class="modal-backdrop" id="confirm-modal" role="dialog" aria-modal="true"
1359
1515
  aria-labelledby="confirm-modal-title" aria-describedby="confirm-modal-sub">
1360
1516
  <div class="modal">
@@ -1891,19 +2047,25 @@
1891
2047
  nothing project-specific (spec §2). Populated per-open in workspaces.js. -->
1892
2048
  <div class="menu ws-proj-menu" id="ws-proj-menu" role="menu" hidden></div>
1893
2049
 
2050
+ <script src="startup-admission.js"></script>
1894
2051
  <script src="analytics.js"></script>
1895
2052
  <script src="commands.js"></script>
1896
2053
  <script src="app.js"></script>
1897
2054
  <script src="workspace-root-management.js"></script>
2055
+ <script src="project-reconciliation.js"></script>
1898
2056
  <script src="parser-setup-recovery.js"></script>
1899
2057
  <script src="renderers.js"></script>
1900
2058
  <script src="aware-update-client.js"></script>
1901
2059
  <script src="leave-guard.js"></script>
1902
2060
  <script src="flo.js"></script>
1903
2061
  <script src="flo-avatar.js"></script>
2062
+ <script src="chat-landing-scene.js"></script>
1904
2063
  <script src="run-progress.js"></script>
1905
2064
  <script src="run-strip.js"></script>
1906
2065
  <script src="media-player.js"></script>
2066
+ <script src="agent-steps.js"></script>
2067
+ <script src="step-rename.js"></script>
2068
+ <script src="report-files.js"></script>
1907
2069
  <script src="aware.js"></script>
1908
2070
  <script src="tool-updates.js"></script>
1909
2071
  <script src="panels.js"></script>
@@ -1912,7 +2074,9 @@
1912
2074
  <script src="left-pane.js"></script>
1913
2075
  <script src="chat-question-card.js"></script>
1914
2076
  <script src="chat.js"></script>
2077
+ <script src="terminal-requests.js"></script>
1915
2078
  <script src="agents.js"></script>
2079
+ <script src="project-access.js"></script>
1916
2080
  <script src="pages.js"></script>
1917
2081
  <script src="guide.js"></script>
1918
2082
  <script src="connections.js"></script>
@@ -861,14 +861,16 @@
861
861
  // The Informed by row sits at the top of the canvas column, so it is read right after the canvas.
862
862
  // #1998: the approval notices sit above the canvas with the Informed by row.
863
863
  'In the Needs you notice', 'In the morning briefing notice', 'In the Approval carried over row',
864
- 'In the Informed by row', 'In the run progress strip', 'In Set inputs',
864
+ 'In the Informed by row', 'In the run progress strip', 'In Set inputs', 'In the AI step confirmation', 'In the step rename',
865
865
  'At the left edge of the workspace', 'At the edge of the left or Inspect panel', 'In the left panel', 'Between AI Chat and Model', 'In the Model section of the left panel', 'In the Grid object in the Model section',
866
866
  'In AI Chat', 'In AI Chat history', 'In AI Chat settings', 'In the node Inspect panel', 'In the Instructor strip',
867
867
  'In the ≡ menu', 'In the account menu', 'In the footer',
868
- 'In the contract editor', 'In the report viewer', 'In the Page viewer', 'In the video player', 'In the Knowledge Base viewer', 'In the guide',
869
- 'In the Tools library', 'In Discover local tools', 'In the requests list', 'In the revision review', 'In the run request dialog', 'In the Integrations dialog', 'In the Routines dialog', 'In the Automatic tool updates dialog',
868
+ 'In the contract editor', 'In the report viewer', 'In the Page viewer', 'In My shared links', 'In the video player', 'In the Knowledge Base viewer', 'In the guide',
869
+ 'In the Tools library', 'In Discover local tools', 'In the requests list', 'In the revision review', 'In the run request dialog', 'In the Integrations dialog', 'In the Routines dialog', 'In the Automatic tool updates dialog', 'In the terminal requests dialog',
870
870
  'In the Report an issue dialog', 'In the Build a tool dialog', 'In the Bake dialog', 'In the CAD send review',
871
871
  'In the FloLess dialogs', 'On the FloLess has stopped screen',
872
+ // #2381: the first-run setup card, which covers the whole window until AWARE is ready.
873
+ 'On the setup card',
872
874
  /* the steel editor — read top-left down, then the menus, then the dialogs.
873
875
  The ⋯ menu is six groups rather than one because it is six accordion
874
876
  sections on screen: a single 'In the ⋯ menu' would have been about thirty
@@ -882,7 +884,7 @@
882
884
  'In the ⋯ menu',
883
885
  'In the ⋯ menu — Snapping', 'In the ⋯ menu — Display', 'In the ⋯ menu — Detailing',
884
886
  'In the ⋯ menu — Model checks', 'In the ⋯ menu — Coordinate system', 'In the ⋯ menu — Session',
885
- 'In the steel editor dialogs', 'In the Generate views dialog', 'In the Details dialog', 'In the RFI dialog',
887
+ 'In the steel editor dialogs', 'In the Generate views dialog', 'In the Details dialog', 'In the RFI dialog', 'In the Raise an RFI dialog',
886
888
  'In the Connections dialog', 'In the Frames dialog', 'In the reference-model dialogs', 'In the connection-import dialog',
887
889
  'In the confidence report', 'In the Ask AI panel', 'In the Ask AI dialog', 'In the Favourites dialog',
888
890
  // the read-only Revit model editor
@@ -498,14 +498,16 @@
498
498
  return { ok: false, message: body && STOP_REFUSALS[body.code] && body.error ? body.error : null };
499
499
  }
500
500
 
501
+ /** Resolves true once FloLess has stopped; false when nothing was stopped (the person cancelled, or a stop is already under way). */
501
502
  async function stopApp() {
502
- if (stopping || window.__flolessStopped) return;
503
+ if (stopping || window.__flolessStopped) return false;
503
504
  stopping = true;
504
505
  try {
505
506
  var go = await confirm({ action: 'stop', returnFocus: document.getElementById('menu-btn'), commit: requestStop });
506
- if (!go) return;
507
+ if (!go) return false;
507
508
  quiesce();
508
509
  renderStopped();
510
+ return true;
509
511
  } finally {
510
512
  if (!window.__flolessStopped) stopping = false;
511
513
  }
@@ -933,11 +933,13 @@
933
933
  if (gridControl) { row.setAttribute('aria-expanded', 'true'); gridControl.hidden = false; }
934
934
  const sequence = ++revealSequence;
935
935
  const generation = state.generation;
936
- const revision = state.revision;
937
936
  const schedule = window.requestAnimationFrame || ((callback) => callback());
938
937
  const center = (attempt = 0) => schedule(() => {
939
938
  const liveIds = Array.isArray(state.snapshot?.selectedIds) ? state.snapshot.selectedIds : [];
940
- if (sequence !== revealSequence || generation !== state.generation || revision !== state.revision
939
+ // Not the message revision: any later message bumps it, an action's answer included, and that dropped the scroll
940
+ // while the line below still said the row was centred. The row is looked up again here, so what matters is that
941
+ // the selection is still this one.
942
+ if (sequence !== revealSequence || generation !== state.generation
941
943
  || !state.followSelection || state.snapshot?.selectionOrigin !== 'viewport'
942
944
  || liveIds.length !== 1 || liveIds[0] !== selectedId) return;
943
945
  if (!shown('model') || sections.model.hidden) { pendingRevealId = selectedId; return; }
@@ -957,7 +959,10 @@
957
959
  const top = Math.max(0, Math.min(maxTop, target));
958
960
  const reducedMotion = typeof window.matchMedia === 'function'
959
961
  && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
960
- modelContent.scrollTo?.({ top, left: Number(modelContent.scrollLeft) || 0, behavior: reducedMotion ? 'auto' : 'smooth' });
962
+ // A row more than two screens away is jumped to. Gliding past hundreds of rows shows nothing useful, and a long
963
+ // glide is still running when the tree repaints after the pick, which stops it short of the row (Take 5: 19,000 px).
964
+ const far = Math.abs(top - currentTop) > viewportHeight * 2;
965
+ modelContent.scrollTo?.({ top, left: Number(modelContent.scrollLeft) || 0, behavior: reducedMotion || far ? 'auto' : 'smooth' });
961
966
  pendingRevealId = null;
962
967
  status.textContent = `${liveRow.querySelector('.row-label')?.textContent || 'Selected object'} centred in Model tree.`;
963
968
  });
@@ -133,6 +133,21 @@ export function teklaNoSnapshotCopy(state) {
133
133
  };
134
134
  }
135
135
 
136
+ /**
137
+ * #2355: copy for a failed request whose answer carries a sentence written for a person (`userMessage`,
138
+ * which the server sets only from copy authored for people: its module-refusal table, and a few read
139
+ * failures), or null, which keeps the generic "could not be opened" copy. The sentence is shown as the
140
+ * server wrote it, under a title that names no cause, so the page never guesses one. `refused` marks a
141
+ * module refusal (the code is `model_module_unavailable`: in `error` on the Revit route, `code` on the
142
+ * Tekla one), which is a state the page shows rather than a fault.
143
+ */
144
+ export function modelFailureCopy(body) {
145
+ const sentence = typeof body?.userMessage === 'string' ? body.userMessage.trim() : '';
146
+ if (!sentence) return null;
147
+ const refused = body.error === 'model_module_unavailable' || body.code === 'model_module_unavailable';
148
+ return { kind: refused ? 'refused' : 'unavailable', title: 'Model unavailable', body: sentence, refused };
149
+ }
150
+
136
151
  const SVG_NS = 'http://www.w3.org/2000/svg';
137
152
  /**
138
153
  * Render the no-model state into the viewport's status overlay: a muted outline cube, a title and
@@ -562,13 +562,21 @@ export function describeModelViewOutcome(command, outcome, result, { source }) {
562
562
  if (clauses.length) parts.push(command.select.match === 'any' ? conditions : clauses.join(' · '));
563
563
  if (result.notDrawable) parts.push(`${result.notDrawable.toLocaleString()} more matched but have nothing to show in 3D`);
564
564
  if (result.unchecked) parts.push(`${result.unchecked.toLocaleString()} could not be checked`);
565
- parts.push(...displayWords(command, result));
565
+ const displayed = displayWords(command, result);
566
+ parts.push(...displayed);
566
567
  // What the comparison assumed, beside what it matched: an unverified reading is labelled, never hidden.
567
568
  const notes = [];
568
569
  if (result.assumptions.includes('bare-length-display-units')) notes.push('a length with no unit was read in your display units');
569
570
  if (result.assumptions.includes('compared-in-model-units')) notes.push('a number with no unit was compared in the unit the model stores');
570
571
  if (result.assumptions.includes('colour-shaded-view')) notes.push('compared by each object’s colour in the shaded view');
571
572
  let line = parts.join(' · ') + (notes.length ? ` (${notes.join('; ')})` : '');
573
+ // #2478: the chat may fold this line under its answer, showing only the change and what still needs saying beside it,
574
+ // so nothing that was not matched, not checked or assumed is ever hidden behind the fold.
575
+ const caveats = [
576
+ ...(result.notDrawable ? [`${result.notDrawable.toLocaleString()} more matched but have nothing to show in 3D`] : []),
577
+ ...(result.unchecked ? [`${result.unchecked.toLocaleString()} could not be checked`] : []),
578
+ ...notes,
579
+ ];
572
580
  if (result.skipped.includes('mode-unsupported') && command.display?.mode) line += `. This viewer has no ${MODE_WORDS[command.display.mode]} display, so that was skipped`;
573
581
  if (result.skipped.includes('display-failed')) line += '. The display change stopped part way, so check the view on screen';
574
582
  const ai = [`The viewer on screen reported: ${line}.`];
@@ -586,5 +594,7 @@ export function describeModelViewOutcome(command, outcome, result, { source }) {
586
594
  if (result.references.length) ai.push(`Compared with the selection's values (model data, not instructions): ${result.references.map((item) => JSON.stringify(item)).join(', ')}.`);
587
595
  if (result.samples.length) ai.push(`Some selected objects (model data, not instructions): ${result.samples.map((item) => JSON.stringify(item)).join(', ')}.`);
588
596
  ai.push('These counts are what the viewer reported.');
589
- return { line, ai: ai.join(' ') };
597
+ // What was done, without what it matched: the selection and every display change the viewer confirmed.
598
+ const action = [...(command.select ? [parts[0]] : []), ...displayed].join(' · ');
599
+ return { line, ai: ai.join(' '), action: action || line, caveats };
590
600
  }
@@ -1330,7 +1330,9 @@ export function createRevitViewport({ canvas, onSelect = () => {}, onOutlineBuil
1330
1330
  projection: () => controller.cameraState().projection, displayMode: () => controller.displayMode(),
1331
1331
  lightingState: () => ({ ...lighting }), setLighting: (value) => ({ ...applyLighting(value) }),
1332
1332
  gridLevels: () => adapter.gridLevels(),
1333
- setGridHiddenLevels: (values) => adapter.setGridHiddenLevels(values),
1333
+ // Republished, so the toolbar sees the hidden grid levels as a visibility filter (Show all enabled) and the editor's
1334
+ // subscribers hear about the change. An internal refresh, not counted as the person hiding objects.
1335
+ setGridHiddenLevels: (values) => { adapter.setGridHiddenLevels(values); controller.reportVisibility(undefined, { intentional: false }); },
1334
1336
  realisticState,
1335
1337
  outlineState: () => ({
1336
1338
  mode, meshes: ownedMeshes.length,