@floless/app 0.158.0 → 0.160.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 (43) hide show
  1. package/dist/floless-server.cjs +140655 -117708
  2. package/dist/schemas/drawing-check.profile.v1.schema.json +33 -1
  3. package/dist/schemas/steel.model.v2.schema.json +1 -0
  4. package/dist/skills/floless-app-actions/SKILL.md +23 -5
  5. package/dist/skills/floless-app-bridge/SKILL.md +5 -3
  6. package/dist/skills/floless-app-onboarding/SKILL.md +69 -5
  7. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +8 -6
  8. package/dist/skills/floless-app-queue/SKILL.md +3 -1
  9. package/dist/skills/floless-app-rfi/SKILL.md +29 -1
  10. package/dist/skills/floless-app-steel-model/SKILL.md +11 -5
  11. package/dist/skills/floless-app-steel-takeoff/SKILL.md +28 -8
  12. package/dist/skills/floless-app-workflows/SKILL.md +6 -3
  13. package/dist/web/agents.js +12 -5
  14. package/dist/web/app.css +266 -159
  15. package/dist/web/app.js +23 -51
  16. package/dist/web/aware.js +533 -546
  17. package/dist/web/chat-question-card.js +24 -1
  18. package/dist/web/chat.css +170 -48
  19. package/dist/web/chat.js +1406 -208
  20. package/dist/web/commands-shell.js +1104 -177
  21. package/dist/web/commands-steel.js +2 -0
  22. package/dist/web/drawing-check-editor.html +10 -0
  23. package/dist/web/drawing-check-editor.js +44 -0
  24. package/dist/web/guide.js +12 -2
  25. package/dist/web/index.html +62 -48
  26. package/dist/web/instructor.js +33 -12
  27. package/dist/web/pages.js +186 -31
  28. package/dist/web/panels.js +19 -1
  29. package/dist/web/project-access.js +67 -8
  30. package/dist/web/project-modules.js +474 -0
  31. package/dist/web/project-rfis.js +715 -0
  32. package/dist/web/project-workflows.js +506 -0
  33. package/dist/web/run-history.js +198 -0
  34. package/dist/web/run-page-view.js +12 -2
  35. package/dist/web/steel-3d-core.js +75 -1
  36. package/dist/web/steel-3d-view.js +8 -38
  37. package/dist/web/steel-editor.html +263 -59
  38. package/dist/web/steel-model-v2-projection.js +7 -0
  39. package/dist/web/workspace-root-recovery.js +119 -0
  40. package/dist/web/workspaces.js +493 -161
  41. package/launch-starting-page.mjs +5 -2
  42. package/launch.mjs +136 -78
  43. package/package.json +6 -1
@@ -2113,6 +2113,7 @@
2113
2113
  def('steel.profile-colours', { label: 'Profile colours', actsOn: 'Opens the key of section colours for the whole model, and lets you change any of them', group: 'In the 3D toolbar', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'It only changes how members are DRAWN — no geometry, no sections, nothing that reaches the lock.' });
2114
2114
  def('steel.structure-stats', { label: 'Structure numbers', actsOn: 'Expands the members and weight for the active plan sheet, or for the whole model while the 3D view is active', group: 'In the steel editor header', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The header states the total; opening it shows what the total is made of, and changes nothing.' });
2115
2115
  def('steel.quality-stats', { label: 'Quality numbers', actsOn: 'Expands what is unresolved on this sheet — RFI, duplicates, member ends and read confidence', group: 'In the steel editor header', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The header states how many issues there are; opening it says which kinds, and changes nothing.' });
2116
+ def('steel.quick-model-chip', { label: 'Quick model label', actsOn: 'Says that the model, as last saved, was built by the AI deciding where it would have asked you', group: 'In the steel editor header', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A Quick model is fine for a tender or an estimate but is not precise. The label describes the model as last saved; "Possibly Quick" means FloLess could not read which AI decisions it rests on.' });
2116
2117
  def('steel.confidence-report', { label: 'Open confidence report', actsOn: 'Opens the recorded drawing-confidence review', group: 'In the steel editor header', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Shows current field-level read evidence without changing the model.' });
2117
2118
 
2118
2119
  /* Ask AI */
@@ -2332,6 +2333,7 @@
2332
2333
  def('steel.rfi-scope', { label: 'Show', actsOn: 'Narrows the RFI list to {instance}', group: 'In the RFI dialog', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A filter changes what is listed, never what is recorded. “This sheet only” is offered only while a plan sheet is open, because otherwise there is no sheet for it to mean.' });
2333
2334
  def('steel.rfi-status-filter', { label: 'Status', actsOn: 'Filters the RFI list to {instance}', group: 'In the RFI dialog', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Open means anything still waiting on somebody — raised, sent or answered. Closed ones stay listed so a settled question can be looked up later.' });
2334
2335
  def('steel.rfi-copy', { label: 'Copy whole RFI', actsOn: 'Copies {instance} as text, ready to paste into an email', group: 'In the RFI dialog', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'This copies the same complete question FloLess sends through Gmail. If the clipboard cannot be reached, the text is shown instead so you can copy it by hand.' });
2336
+ def('steel.rfi-quick-refile', { label: 'Try filing again', actsOn: 'Files the questions {instance} keeps that the AI could not file yet', anyInstance: 'a Quick model version', group: 'In the RFI dialog', persistence: 'external', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A Quick model keeps the questions the AI could not settle with the version it published. When the RFI file could not take them, this files them, marked as the AI’s. Anything already filed is not filed twice, and nothing is sent to anyone.' });
2335
2337
  def('steel.rfi-group-toggle', { label: 'Show occurrences', actsOn: 'Expands or collapses the ordered occurrences in {instance}', group: 'In the RFI dialog', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A grouped question remains one RFI. Expanding it reveals each occurrence’s own status, drawing destination and scoped actions without creating duplicate rows.' });
2336
2338
  def('steel.rfi-group-elsewhere', { label: 'Show elsewhere in this RFI', actsOn: 'Reveals occurrences from {instance} that are not on the current sheet', group: 'In the RFI dialog', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The sheet filter keeps a grouped RFI indivisible. Matching occurrences stay first; this disclosure reveals the rest without pretending they belong to the current sheet.' });
2337
2339
  def('steel.rfi-technical', { label: 'Technical details', actsOn: 'Shows the stored technical identity for {instance}', group: 'In the RFI dialog', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The internal gap key is useful for diagnosis but is not a user-facing action selector, so it stays behind this disclosure.' });
@@ -187,6 +187,16 @@ button.icon:hover{color:var(--text)}
187
187
  .ask-type{display:flex;gap:8px;align-items:flex-end;margin-top:10px;max-width:460px}
188
188
  .ask-type .field{flex:1;margin:0}
189
189
  .ask-band{display:flex;gap:10px;align-items:center;flex-wrap:wrap;border-color:var(--warn)}
190
+ .pl{margin-top:18px}
191
+ .pl .ask-band{margin:0 0 8px}
192
+ .list.pl-list{list-style:none;margin:0;padding:0}
193
+ .pl-list > .pl-row{display:flex;flex-direction:column;gap:3px;padding:9px 12px;line-height:1.4}
194
+ .pl-list > .pl-row + .pl-row{border-top:1px solid var(--line)}
195
+ .pl-row .w{font-weight:600}
196
+ .pl-row .pl-cols{letter-spacing:.02em;overflow-wrap:anywhere}
197
+ .pl-row .origin,.pl-row .origin-inline{color:var(--mut);font-size:11px}
198
+ .pl-row .row-note{margin:2px 0 0;font-size:12px}
199
+ .pl-row .row-note.undecided{color:var(--warn)}
190
200
  .ask-line{color:var(--text)}
191
201
  .ask .q{margin:0;font-weight:600;line-height:1.45}
192
202
  .ask .note{margin:2px 0 8px}
@@ -546,6 +546,48 @@ export function titleBlockHtml(tb, { pages = 0, note = '', noteField = '', savin
546
546
  <div class="row-actions"><button type="button" data-act="add-field" data-command-id="drawing-check.title-add">Add a field…</button></div></section>`;
547
547
  }
548
548
 
549
+ /**
550
+ * The Part list block (#1963), read-only: for each part-list layout learned from the reference drawings, its
551
+ * columns as printed, anything unusual about its shape, how the list ends, and what its mass columns mean, in a
552
+ * detailer's words, then what the last proposal said about them (`notes`, kept with the layouts so a reload shows them
553
+ * too). No controls.
554
+ * @param {any} pl
555
+ * @param {{ proposed?: boolean }} [opts]
556
+ */
557
+ export function partListHtml(pl, { proposed = false } = {}) {
558
+ const head = '<h3 id="pl-h">Part list</h3>';
559
+ const askBands = ((pl && pl.notes) || []).map((a) => `<div class="band ask-band" role="note"><span>${esc(a)}</span></div>`).join('');
560
+ const layouts = (pl && pl.layouts) || [];
561
+ if (!layouts.length) {
562
+ return `<section class="tb pl" aria-labelledby="pl-h">${head}
563
+ <p class="note">${proposed
564
+ ? 'No part list was recognised on the references. “Part list agrees with the title” and “Part-list masses” report “couldn’t tell” until a reference drawing with a part list is added.'
565
+ : 'Propose from the references to learn how this client’s part lists are laid out.'}</p>${askBands}</section>`;
566
+ }
567
+ const many = layouts.length > 1;
568
+ const rows = layouts.map((l, i) => {
569
+ const share = `learned from ${Math.round((l.support || 0) * 100)}% of the references`;
570
+ const massWords = { 'line-mass': 'the row’s mass', 'unit-mass': 'each piece’s mass' };
571
+ const cols = l.columns.map((c) => `${esc(c.label)}${massWords[c.role] ? ` <span class="origin-inline">(${massWords[c.role]})</span>` : ''}`).join(' · ');
572
+ const shape = [l.turned ? 'Lettering turned a quarter, as on single-part sheets.' : '', l.rowsRun === 'up' ? 'A one-row strip, the values above their labels.' : ''].filter(Boolean).join(' ');
573
+ const t = l.total;
574
+ const ends = !t ? 'No total line was found.'
575
+ : `Ends with ${t.label ? `“${esc(t.label)}”` : 'a total printed on its own'}${t.valueRole ? ', read as the total mass' : ', which ends the list but is not read'}.`;
576
+ const mass = l.columns.filter((c) => massWords[c.role]).map((c) => (c.role === 'line-mass'
577
+ ? `${esc(c.label)} is the row’s mass: the rows add up to the total.`
578
+ : `${esc(c.label)} is each piece’s mass: quantity × ${esc(c.label)}, added up, gives ${l.columns.some((x) => x.role === 'line-mass') ? 'the row’s mass' : 'the total'}.`)).join(' ');
579
+ const basis = l.qtyBasis === 'per-sheet' ? 'Quantities count every assembly on the sheet.' : l.qtyBasis === 'per-assembly' ? 'Quantities count one assembly.' : 'How quantities are counted (per sheet or per assembly) is not known yet.';
580
+ const undecided = l.columns.filter((c) => c.undecided).map((c) => `<p class="row-note undecided">${esc(c.label)}: the references don’t show whether this is each piece’s mass or the row’s, so the part-list mass checks report “couldn’t tell” until a reference drawing with a quantity above 1 settles it.</p>`).join('');
581
+ return `<li class="pl-row"><span class="w">${many ? `Layout ${i + 1} · ` : ''}${esc(share.charAt(0).toUpperCase() + share.slice(1))}</span>
582
+ <span class="pl-cols">${cols}</span>
583
+ ${shape ? `<span class="origin">${shape}</span>` : ''}
584
+ <span class="origin">${ends}${mass ? ` ${mass}` : ''} ${basis}</span>${undecided}</li>`;
585
+ }).join('');
586
+ return `<section class="tb pl" aria-labelledby="pl-h">${head}
587
+ <p class="note">Learned from the reference drawings: how this client’s part lists are laid out. FloLess reads a part list only this way; a list laid out differently is marked “couldn’t tell”, never guessed.</p>
588
+ ${askBands}<ul class="list pl-list">${rows}</ul></section>`;
589
+ }
590
+
549
591
  // ── the page ────────────────────────────────────────────────────────────────────────────────────
550
592
 
551
593
  function boot() {
@@ -977,6 +1019,7 @@ function boot() {
977
1019
  ${S.checklistError ? `<p class="err-line" role="alert">${esc(S.checklistError)}</p>` : ''}
978
1020
  ${list.length ? `<div class="list">${rows}</div>` : '<p class="note">No items yet. Propose them from the reference drawings.</p>'}
979
1021
  ${titleBlockHtml(S.draft && S.draft.titleBlock, { pages, note: S.titleNote, noteField: S.titleNoteField, saving: S.tbSaving, typed: S.typed })}
1022
+ ${partListHtml(S.draft && S.draft.partList, { proposed: list.length > 0 })}
980
1023
  ${S.reviewError ? `<p class="note">${esc(S.reviewError)}</p>` : ''}
981
1024
  ${changed && anyTicked ? `<div class="sticky-foot"><span class="note">${S.tbChanges && S.tbChanges.length ? 'Title block changed · ' : ''}${list.filter((i) => i.enabled).length} of ${list.length} items ticked. Runs use the approved checklist only.</span><span class="sp"></span>
982
1025
  <button type="button" class="primary" data-act="approve" data-command-id="drawing-check.approve">Approve checklist…</button></div>` : ''}</div>`;
@@ -1129,6 +1172,7 @@ function boot() {
1129
1172
  const { body } = await call(`${base}/propose`, { method: 'POST' });
1130
1173
  S.draft.items = body.items; S.etag = body.etag; S.newSinceApproval = 0;
1131
1174
  if (body.titleBlock) S.draft.titleBlock = body.titleBlock; else delete S.draft.titleBlock;
1175
+ if (body.partList) S.draft.partList = body.partList; else delete S.draft.partList;
1132
1176
  if (body.client) S.draft.client = body.client;
1133
1177
  if (body.unreadable && body.unreadable.length) S.checklistError = `Couldn’t read ${body.unreadable.join(', ')}; the other drawings were used.`;
1134
1178
  await loadReview();
package/dist/web/guide.js CHANGED
@@ -855,9 +855,12 @@
855
855
  const paintCard = () => {
856
856
  const focusBack = card.contains(document.activeElement);
857
857
  card.replaceChildren();
858
+ // #2678: AI Chat's one line for a hidden card says it still waits while the suggestion is open (set below), not after.
859
+ delete card.dataset.waits; delete card.dataset.waitsSays;
858
860
  const aside = setAsideFor(moveKey, move);
859
861
  if (aside) {
860
862
  moveKey = aside.key;
863
+ card.setAttribute('aria-label', `Not now: ${text.title}`);
861
864
  const line = el('div', 'ai-chat-connection-collapsed');
862
865
  const undo = el('button', '', 'Undo');
863
866
  undo.type = 'button';
@@ -891,11 +894,13 @@
891
894
  const tick = el('span', '', '✓ '); tick.setAttribute('aria-hidden', 'true');
892
895
  head.lastChild.append(tick, document.createTextNode(`${move.toolName} installed`));
893
896
  card.classList.add('is-connected');
897
+ card.dataset.waits = 'done'; // #2678: installed, so AI Chat folds it to one line by itself
894
898
  card.append(head, el('p', 'ai-chat-filter-note', 'Ready to use.'), status);
895
899
  if (focusBack) { card.tabIndex = -1; card.focus({ preventScroll: true }); }
896
900
  return;
897
901
  }
898
902
  card.classList.remove('is-connected');
903
+ card.dataset.waits = 'you';
899
904
  const head = el('div', 'ai-chat-filter-card-head');
900
905
  head.append(el('span', 'guide-move-eyebrow', 'Suggested'), el('strong', '', text.title));
901
906
  card.append(head);
@@ -907,7 +912,9 @@
907
912
  go.type = 'button';
908
913
  go.dataset.commandId = `shell.guide-move-open#${move.kind}`;
909
914
  go.dataset.commandInstanceLabel = text.title;
910
- go.dataset.tip = 'Opens the place to do this. Nothing happens until you confirm there.';
915
+ // An Open card only shows a page, so it never speaks of a next step to confirm.
916
+ const opensOnly = move.kind === 'open';
917
+ go.dataset.tip = opensOnly ? `${text.action}. Nothing changes.` : 'Opens the place to do this. Nothing happens until you confirm there.';
911
918
  go.addEventListener('click', async () => {
912
919
  go.disabled = true; go.setAttribute('aria-busy', 'true'); go.textContent = 'Checking…';
913
920
  status.textContent = '';
@@ -938,7 +945,7 @@
938
945
  }
939
946
  });
940
947
  actions.append(go, later);
941
- card.append(actions, el('p', 'ai-chat-filter-note', 'Nothing happens until you confirm in the next step.'), status);
948
+ card.append(actions, el('p', 'ai-chat-filter-note', opensOnly ? 'This only opens the page. Nothing changes.' : 'Nothing happens until you confirm in the next step.'), status);
942
949
  if (focusBack) go.focus();
943
950
  };
944
951
  /**
@@ -998,6 +1005,7 @@
998
1005
  if (update?.state === 'building') {
999
1006
  // The card stays in the Guide for days, so it says what happened, not that the AI is still working.
1000
1007
  card.setAttribute('aria-label', `Draft created: ${workflowName}`);
1008
+ card.dataset.waits = 'done'; // #2678: built in its own chat, so AI Chat folds this card by itself
1001
1009
  head.append(el('span', 'guide-move-eyebrow', 'Draft created'), el('strong', '', workflowName));
1002
1010
  card.append(head, el('p', 'ai-chat-filter-why', 'It is built in the workflow’s own chat. You can leave and come back.'));
1003
1011
  const open = button('Open workflow', 'shell.guide-move-open-workflow', 'Opens this workflow’s build conversation. If the AI never got its first message, this sends it again.', 'ai-chat-filter-apply');
@@ -1005,6 +1013,7 @@
1005
1013
  actions.append(open); first = open;
1006
1014
  card.append(actions, status);
1007
1015
  } else if (update?.state === 'failed') {
1016
+ card.dataset.waits = 'you'; card.dataset.waitsSays = 'Not started. Expand it to try again or open the draft.';
1008
1017
  card.setAttribute('aria-label', `Not started: ${workflowName}`);
1009
1018
  head.append(el('span', 'guide-move-eyebrow', 'Not started'), el('strong', '', `“${workflowName}” is saved as a draft, but its chat didn’t start`));
1010
1019
  card.append(head);
@@ -1028,6 +1037,7 @@
1028
1037
  actions.append(retry, open); first = retry;
1029
1038
  card.append(actions, status);
1030
1039
  } else {
1040
+ card.dataset.waits = 'you';
1031
1041
  card.setAttribute('aria-label', `Suggestion: ${text.title}`);
1032
1042
  head.append(el('span', 'guide-move-eyebrow', 'Suggested'), el('strong', '', text.title));
1033
1043
  card.append(head);
@@ -135,16 +135,11 @@
135
135
  <span class="ws-access-label">Project access</span><span class="ws-access-count" id="ws-access-count" hidden></span>
136
136
  </button>
137
137
  <span class="ctl-sep" aria-hidden="true"></span>
138
+ <!-- #2521 row 5: what the approved head and the working copy rest on, when either is a Quick model. -->
139
+ <span id="ws-quick" class="ws-quick-chips" hidden></span>
138
140
  <button data-command-id="shell.approve" id="ws-approve" type="button" class="primary"
139
141
  data-tip="Review every pending change before signing off.">Review &amp; approve</button>
140
142
  </div>
141
- <!-- Per-workflow onboarding beacon. Pulses "✨ Start here" while this workflow is
142
- new to the user (no first Run completed, not dismissed); calms to a quiet
143
- "❔ Guide" after — always clickable for re-reference. Hidden until an app loads. -->
144
- <button data-command-id="guide.open" id="guide-beacon" class="guide-beacon" type="button" hidden aria-haspopup="dialog" data-tip="New here? See what this workflow does and how to run it.">
145
- <span class="guide-beacon-ico" aria-hidden="true">✦</span>
146
- <span class="guide-beacon-label">Start here</span>
147
- </button>
148
143
  <span class="run-state" id="run-state" role="status" aria-live="polite" aria-atomic="true"></span>
149
144
  <!-- Restore + Customize: shown for a MAINTAINED (publisher:floless, non-forked) app. Restore
150
145
  appears only when its logic drifted (re-installs the official version); Customize (fork) is
@@ -265,14 +260,6 @@
265
260
  <div class="ai-chat-skills" id="chat-skills" role="listbox" hidden></div>
266
261
  <div class="ai-chat-approval-tray" id="chat-approval-tray"></div>
267
262
  <div class="ai-chat-composer" id="chat-composer">
268
- <div class="ai-chat-scope-controls" id="chat-scope-controls" hidden>
269
- <button type="button" id="chat-scope-toggle" data-command-id="shell.chat-scope-open" aria-expanded="false" aria-controls="chat-scope-picker">Scope</button>
270
- <button type="button" id="chat-access-explanation" data-command-id="shell.chat-access-explanation#hidden" aria-expanded="false" aria-controls="chat-scope-disclosure" aria-label="Explain Read only access" data-tip="Show what this access level allows."><span>Access · </span><strong>Read only</strong><span class="ai-chat-access-chevron" aria-hidden="true">⌄</span></button>
271
- <span id="chat-scope-disclosure" aria-live="polite" hidden></span>
272
- <section class="ai-chat-picker ai-chat-scope-picker" id="chat-scope-picker" role="dialog" aria-label="Conversation scope" hidden></section>
273
- </div>
274
- <!-- #1890: a workspace conversation's units question, and then its "Units: … · Change" line. -->
275
- <div class="ai-chat-units" id="chat-units" hidden></div>
276
263
  <!-- #1890 PR4: one Revoke ends all global file-change grants; legacy owner grants appear only without a global allowance (web/chat.js). -->
277
264
  <div class="ai-chat-connectors" id="chat-change-allowance" role="group" aria-label="Changes allowed for this chat" hidden></div>
278
265
  <!-- #1900: the connection checks this chat may run without asking, each with Revoke (web/chat.js). -->
@@ -291,12 +278,23 @@
291
278
  sits in the composer's rigid grid row, so no conversation-area height can take
292
279
  it away (#1501). -->
293
280
  <p class="ai-chat-composer-disclosure" id="chat-composer-disclosure" hidden>Messages and attachments are sent to Claude or Codex through your account.</p>
281
+ <!-- Status, working and error text sits on its own line under the message box; the idle keyboard hint is read to screen readers only (web/chat.js). -->
282
+ <span class="ai-chat-compose-hint" id="chat-compose-hint">Enter to send · Shift+Enter for a new line</span>
294
283
  <div class="ai-chat-compose-actions">
295
284
  <!-- No accept= filter (#1853): data files are recognised by their contents, so the chooser lets
296
285
  every file through to be checked; one FloLess cannot read is refused before upload. -->
297
286
  <input data-command-id="shell.chat-attach-input" id="chat-file" type="file" multiple hidden>
298
287
  <button data-command-id="shell.chat-attach" type="button" class="ai-chat-icon" id="chat-attach" data-tip="Attach a picture, PDF, or data file (IFC, DXF, CSV, text)" aria-label="Attach a picture, PDF, or data file"><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"/></svg></button>
299
- <span class="ai-chat-compose-hint" id="chat-compose-hint">Enter to send · Shift+Enter for a new line</span>
288
+ <!-- One toolbar under the message box: attach, the conversation's scope, access and units, then Send. -->
289
+ <div class="ai-chat-scope-controls" id="chat-scope-controls" hidden>
290
+ <button type="button" id="chat-scope-toggle" data-command-id="shell.chat-scope-open" aria-expanded="false" aria-controls="chat-scope-picker">Scope</button>
291
+ <!-- A quick switch, like the AI terminals' own: the four levels, each with its one-line note (web/chat.js). -->
292
+ <button type="button" id="chat-access-chip" data-command-id="shell.chat-access-open" aria-haspopup="menu" aria-expanded="false" aria-controls="chat-access-menu" aria-label="Access: Read only. Change access"><span class="sr-only">Access · </span><strong>Read only</strong><span class="ai-chat-access-chevron" aria-hidden="true">⌄</span></button>
293
+ <div class="ai-chat-access-menu" id="chat-access-menu" role="menu" aria-labelledby="chat-access-menu-head" hidden></div>
294
+ <section class="ai-chat-picker ai-chat-scope-picker" id="chat-scope-picker" role="dialog" aria-label="Conversation scope" hidden></section>
295
+ </div>
296
+ <!-- #1890: once a workspace conversation's units are chosen, a units chip ("ft-in ⌄") with a two-item menu. -->
297
+ <div class="ai-chat-units" id="chat-units" hidden></div>
300
298
  <button data-command-id="shell.chat-stop" type="button" class="ai-chat-stop" id="chat-stop" aria-label="Stop response" data-tip="Stop response" hidden><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="5" y="5" width="14" height="14" rx="2.5"/></svg></button>
301
299
  <button data-command-id="shell.chat-send" type="button" class="ai-chat-send" id="chat-send" aria-label="Send message"><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"/><path d="m21.854 2.147-10.94 10.939"/></svg></button>
302
300
  </div>
@@ -447,6 +445,9 @@
447
445
  <button data-command-id="shell.workspace-step#exports" type="button" data-step="exports" role="tab" aria-selected="false">Exports</button>
448
446
  <button data-command-id="shell.workspace-step#history" type="button" data-step="history" role="tab" aria-selected="false">History</button>
449
447
  <button data-command-id="shell.workspace-step#pages" type="button" data-step="pages" role="tab" aria-selected="false">Pages</button>
448
+ <button data-command-id="shell.workspace-step#workflows" type="button" data-step="workflows" role="tab" aria-selected="false" hidden>Workflows</button>
449
+ <button data-command-id="shell.workspace-step#rfis" type="button" data-step="rfis" role="tab" aria-selected="false" hidden>RFIs</button>
450
+ <button data-command-id="shell.workspace-step#modules" type="button" data-step="modules" role="tab" aria-selected="false" hidden>Modules</button>
450
451
  </div>
451
452
  <span class="ws-step-end">
452
453
  <!-- Shown only on the Drawings/Source step. It used to have a 42px band of its own labelled
@@ -508,6 +509,15 @@
508
509
  <!-- Pages (#2262) = a SHELL-rendered pane: this project's stored, versioned HTML Pages.
509
510
  pages.js fills it on step-switch (flolessPages.renderList). -->
510
511
  <div class="ws-pages" id="ws-pages" hidden></div>
512
+ <!-- #2470 R6.2: Workflows = a SHELL-rendered pane: the workflows this project owns.
513
+ project-workflows.js fills it on step-switch (flolessProjectWorkflows.render). -->
514
+ <div class="ws-pages ws-workflows" id="ws-workflows" hidden></div>
515
+ <!-- #2470 R6.6: RFIs = a SHELL-rendered pane: a General project's questions for the engineer, client or architect.
516
+ project-rfis.js fills it on step-switch (flolessProjectRfis.render). -->
517
+ <div class="ws-pages ws-rfis" id="ws-rfis" hidden></div>
518
+ <!-- #2470 R6.7: Modules = a SHELL-rendered pane: the module projects linked to a General project.
519
+ project-modules.js fills it on step-switch (flolessProjectModules.render). -->
520
+ <div class="ws-pages ws-modules" id="ws-modules" hidden></div>
511
521
  <!-- Knowledge = a SHELL-rendered pane (not an iframe): the project's Knowledge Base.
512
522
  workspaces.js fills it on step-switch (renderKnowledge). Stage B ships the References
513
523
  column (drop / useAsKb / remove / Organize); the graph + note columns are Stage C/D.
@@ -1230,6 +1240,12 @@
1230
1240
  <button data-command-id="shell.dialog-close#My shared links" id="sl-close" type="button" class="ghost" aria-label="Close">×</button>
1231
1241
  </div>
1232
1242
  <p class="sl-note" id="sl-note" role="status" hidden></p>
1243
+ <div class="sl-usage" id="sl-usage" data-level="ok" hidden>
1244
+ <div class="sl-usage-row"><span class="sl-usage-label" id="sl-usage-label">Space for shared files</span><span class="sl-usage-value" id="sl-usage-value" aria-hidden="true"></span></div>
1245
+ <div class="sl-meter" id="sl-meter" role="meter" aria-labelledby="sl-usage-label" aria-valuemin="0" aria-valuemax="1" aria-valuenow="0"><span class="sl-meter-fill" id="sl-meter-fill"></span></div>
1246
+ <p class="sl-usage-status" id="sl-usage-status" role="status" hidden></p>
1247
+ <div class="sl-usage-foot"><span class="sl-usage-help">Revoking a link frees the space only it used, within a day.</span><button data-command-id="shell.shared-links-plans" id="sl-plans" type="button" class="ghost" hidden>See plans</button></div>
1248
+ </div>
1233
1249
  <div class="sl-list" id="sl-list" role="list" aria-label="My shared links"></div>
1234
1250
  <div class="sl-foot"><button data-command-id="shell.shared-links-more" id="sl-more" type="button" class="ghost" hidden>Show more</button></div>
1235
1251
  </div>
@@ -1243,7 +1259,7 @@
1243
1259
  </div>
1244
1260
  <div class="report-actions">
1245
1261
  <button data-command-id="shell.report-stop" id="report-stop" class="ghost report-stop" hidden data-tip="Stop this workflow run">■ Stop run</button>
1246
- <button data-command-id="shell.report-share" id="report-share" class="ghost" hidden data-tip="Share this report as a link anyone can view — hosted on floless.io">↗ Share</button>
1262
+ <button data-command-id="shell.report-share" id="report-share" class="ghost" hidden data-tip="Share this report as a link anyone can view, hosted on floless.io. When the run made a Page version, this shares the workflow’s Page, whose link keeps updating.">↗ Share</button>
1247
1263
  <button data-command-id="shell.report-download" id="report-download" class="ghost" hidden data-tip="Download the complete read-only model property report">↓ Download complete report</button>
1248
1264
  <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>
1249
1265
  <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>
@@ -1390,6 +1406,8 @@
1390
1406
  <span data-chat-provider-status="codex"></span>
1391
1407
  </div>
1392
1408
  <div class="project-setup-note">This project’s conversation stays with the AI you choose here.</div>
1409
+ <!-- #2470 R6.4: what a General project's kickoff chat does; shown for General only. -->
1410
+ <div class="project-setup-note" id="project-setup-kickoff-note" hidden>Flo will ask what this project is and suggest what to add. Nothing changes until you confirm.</div>
1393
1411
  </fieldset>
1394
1412
  </div>
1395
1413
  <div class="project-setup-storage-note">FloLess stores this project, its AI Chat history, Knowledge and project workflows in this folder. AI starts here too.</div>
@@ -1519,6 +1537,28 @@
1519
1537
 
1520
1538
  <!-- Save-on-switch confirmation — shown when switching workflows with unsaved
1521
1539
  input changes. Reuses the shared modal styling; no new backdrop look. -->
1540
+ <!-- New RFI (project-rfis.js, #2470 R6.6): the Project access sheet's chrome; its body is the form or the Cite picker. -->
1541
+ <div class="modal-backdrop pa-backdrop pm-backdrop pr-backdrop" id="project-rfi-sheet" role="dialog" aria-modal="true" aria-labelledby="pr-title" aria-describedby="pr-sub">
1542
+ <aside class="pa-sheet pr-sheet" tabindex="-1">
1543
+ <header class="pa-head">
1544
+ <div><h2 class="pa-title" id="pr-title">New RFI</h2><p class="pa-subtitle" id="pr-sub"></p></div>
1545
+ <button type="button" class="pa-close" id="pr-close" aria-label="Close" data-tip="Close" data-command-id="shell.project-rfi-sheet-close">✕</button>
1546
+ </header>
1547
+ <div class="pa-body" id="pr-body"></div>
1548
+ <footer class="pa-foot pr-foot" id="pr-foot"></footer>
1549
+ </aside>
1550
+ </div>
1551
+ <!-- Add a module / Link an existing project (project-modules.js, #2470 R6.7): the Project access sheet's chrome. -->
1552
+ <div class="modal-backdrop pa-backdrop pm-backdrop" id="project-modules-sheet" role="dialog" aria-modal="true" aria-labelledby="pm-title" aria-describedby="pm-sub">
1553
+ <aside class="pa-sheet pm-sheet" tabindex="-1">
1554
+ <header class="pa-head">
1555
+ <div><h2 class="pa-title" id="pm-title">Add a module</h2><p class="pa-subtitle" id="pm-sub"></p></div>
1556
+ <button type="button" class="pa-close" id="pm-close" aria-label="Close" data-tip="Close" data-command-id="shell.project-modules-sheet-close">✕</button>
1557
+ </header>
1558
+ <div class="pa-body" id="pm-body"></div>
1559
+ <footer class="pa-foot">A linked project keeps its own access. Linking gives this project nothing.</footer>
1560
+ </aside>
1561
+ </div>
1522
1562
  <!-- Project access sheet (project-access.js): slides in from the right over the open project. -->
1523
1563
  <div class="modal-backdrop pa-backdrop" id="project-access-sheet" role="dialog" aria-modal="true" aria-labelledby="pa-title" aria-describedby="pa-sub">
1524
1564
  <aside class="pa-sheet" tabindex="-1">
@@ -1746,37 +1786,6 @@
1746
1786
  </div>
1747
1787
  </div>
1748
1788
 
1749
- <!-- Per-workflow onboarding "Start here" guide. Surfaces the workflow's plain-English
1750
- description + a live "Set inputs → Compile → Run" checklist (ticks from real state),
1751
- and relays a "walk me through it" ask to the terminal AI. A styled modal — never a
1752
- native dialog; body (#guide-body) is rendered per-open in aware.js. -->
1753
- <div class="modal-backdrop" id="guide-modal">
1754
- <div class="modal guide" role="dialog" aria-modal="true" aria-labelledby="guide-title" tabindex="-1">
1755
- <div class="guide-eyebrow" id="guide-eyebrow">✦ Start here</div>
1756
- <div class="modal-title" id="guide-title">Workflow</div>
1757
- <div class="modal-sub">What this workflow does, and how to go through it.</div>
1758
- <div id="guide-body"></div>
1759
- <div class="modal-actions">
1760
- <button data-command-id="shell.guide-dismiss" id="guide-got-it">Got it</button>
1761
- <button data-command-id="shell.guide-walk" id="guide-walk" class="primary">Walk me through it →</button>
1762
- </div>
1763
- </div>
1764
- </div>
1765
-
1766
- <!-- One-time first-open spotlight: dims the canvas and points at the "Start here"
1767
- beacon, then collapses into it. Shown once per workflow; Esc / click-away / either
1768
- button dismiss it. The beacon gets .spotlit so it sits above the dim. The bubble is
1769
- positioned next to the beacon at open time (aware.js). -->
1770
- <div id="guide-spotlight" class="guide-spotlight" hidden>
1771
- <div class="guide-spotlight-bubble" role="dialog" aria-modal="false" aria-label="New workflow tip" tabindex="-1">
1772
- <div class="guide-spotlight-text">New to this workflow? <strong>Start here</strong> — see what it does and how to run it.</div>
1773
- <div class="guide-spotlight-actions">
1774
- <button data-command-id="shell.guide-dismiss" type="button" id="guide-spotlight-got" class="ghost">Got it</button>
1775
- <button data-command-id="shell.guide-walk" type="button" id="guide-spotlight-show" class="primary">Show me</button>
1776
- </div>
1777
- </div>
1778
- </div>
1779
-
1780
1789
  <!-- Routines — scheduled .flo runs. The list; the add/edit form is its own modal. -->
1781
1790
  <div class="modal-backdrop" id="routines-modal">
1782
1791
  <div class="modal routines">
@@ -2072,6 +2081,7 @@
2072
2081
  <script src="commands.js"></script>
2073
2082
  <script src="app.js"></script>
2074
2083
  <script src="workspace-root-management.js"></script>
2084
+ <script src="workspace-root-recovery.js"></script>
2075
2085
  <script src="project-reconciliation.js"></script>
2076
2086
  <script src="parser-setup-recovery.js"></script>
2077
2087
  <script src="renderers.js"></script>
@@ -2100,6 +2110,10 @@
2100
2110
  <script src="agents.js"></script>
2101
2111
  <script src="project-access.js"></script>
2102
2112
  <script src="pages.js"></script>
2113
+ <script src="run-history.js"></script>
2114
+ <script src="project-workflows.js"></script>
2115
+ <script src="project-modules.js"></script>
2116
+ <script src="project-rfis.js"></script>
2103
2117
  <script src="guide.js"></script>
2104
2118
  <script src="connections.js"></script>
2105
2119
  <script src="local-discovery.js"></script>
@@ -130,7 +130,14 @@
130
130
  var tone = 'idle';
131
131
  var chip = wf.statusLabel || 'Ready';
132
132
 
133
- if (wf.runState === 'drift') {
133
+ if (wf.runState === 'locked') {
134
+ // #2644: a Drawing Checker or Steel Model workflow this account's plan does not include. Its sentence (what is
135
+ // missing and how to get it) comes from the server; nothing of the workflow opens.
136
+ tone = 'blocked';
137
+ chip = 'Locked';
138
+ parts.push(wf.name);
139
+ parts.push(wf.reason || 'is part of a module this account’s plan does not include');
140
+ } else if (wf.runState === 'drift') {
134
141
  tone = 'blocked';
135
142
  chip = 'Run blocked';
136
143
  parts.push(wf.name);
@@ -326,8 +333,10 @@
326
333
  if (!el || el === document.body) return null;
327
334
  // A semantic divider is not a control. Only focusable separators (the panel
328
335
  // resize handles) belong in Instructor's interaction stream.
329
- // A registered drag handle that is not a button (the left pane's section headers) is a control too.
330
- var target = el.closest('button, summary, [role="button"], [role="treeitem"], [role="separator"][tabindex], a[href], input, select, textarea, [draggable="true"][data-command-id]');
336
+ // A registered drag handle that is not a button (the left pane's section headers) is a control too, and so is a
337
+ // registered element a keyboard can reach (`tabindex="0"`): a label such as the Quick model pill (#2521 row 5)
338
+ // has nothing to press but is exactly what `?` should explain.
339
+ var target = el.closest('button, summary, [role="button"], [role="treeitem"], [role="separator"][tabindex], a[href], input, select, textarea, [draggable="true"][data-command-id], [tabindex="0"][data-command-id]');
331
340
  /* A switch paints `.rtn-toggle-track` over an input that is `opacity:0; width:0;
332
341
  height:0`, so the pointer NEVER lands on the input — it lands on the track, or
333
342
  on the <label> around it, and neither is in the list above. Hovering "Start on
@@ -856,7 +865,7 @@
856
865
  // #2046: the ways into the Guide on the empty pages, and its first-launch question.
857
866
  'Getting started', 'In the Guide question',
858
867
  'In the Workspace directory dialog', 'In Tekla source selection', 'In the new project dialog', 'In the project workspace', 'In the Revit workspace', 'In the Tekla Parser workspace', 'In the Drawing Checker profile', 'In Company knowledge',
859
- 'In the project History', 'In the revision note', 'In the Pages list',
868
+ 'In the project History', 'In the revision note', 'In the Pages list', 'In a project’s Workflows step', 'In a project’s RFIs step', 'In a project’s Modules step',
860
869
  'On the workflow canvas', 'In workflow setup dialogs',
861
870
  // The Informed by row sits at the top of the canvas column, so it is read right after the canvas.
862
871
  // #1998: the approval notices sit above the canvas with the Informed by row.
@@ -865,7 +874,7 @@
865
874
  '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
875
  'In AI Chat', 'In AI Chat history', 'In AI Chat settings', 'In the node Inspect panel', 'In the Instructor strip',
867
876
  'In the ≡ menu', 'In the account menu', 'In the footer',
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',
877
+ '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',
869
878
  '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
879
  'In the Report an issue dialog', 'In the Build a tool dialog', 'In the Bake dialog', 'In the CAD send review',
871
880
  'In the FloLess dialogs', 'On the FloLess has stopped screen',
@@ -1526,13 +1535,16 @@
1526
1535
 
1527
1536
  function openSheet() {
1528
1537
  if (!$sheet || sheetOpen || !enabled) return false;
1529
- /* Requests and the Page viewer have runtime-built controls to browse in this sheet.
1538
+ /* Requests, the Page viewer and AI Chat's source viewers (`data-command-sheet-over`, #2582) have
1539
+ runtime-built controls to browse in this sheet.
1530
1540
  It is covered (inert + aria-hidden) while the sheet owns the screen, and app.css gives the
1531
1541
  sheet the explicit upper tier. Every other dialog still refuses stacking: its controls are
1532
1542
  already explained in place and opening above it would obscure an unfinished decision. */
1533
1543
  var shownDialogs = Array.prototype.slice.call(document.querySelectorAll('.modal-backdrop.show'))
1534
1544
  .filter(function (modal) { return modal !== $sheet; });
1535
- if (shownDialogs.some(function (modal) { return modal.id !== 'requests-modal' && modal.id !== 'page-viewer'; })) return false;
1545
+ if (shownDialogs.some(function (modal) {
1546
+ return modal.id !== 'requests-modal' && modal.id !== 'page-viewer' && !modal.hasAttribute('data-command-sheet-over');
1547
+ })) return false;
1536
1548
 
1537
1549
  returnFocusTo = document.activeElement;
1538
1550
  sheetOpen = true;
@@ -1895,8 +1907,7 @@
1895
1907
  $askMenu.addEventListener('keydown', function (e) {
1896
1908
  var items = Array.from($askMenu.querySelectorAll('button'));
1897
1909
  var at = items.indexOf(document.activeElement);
1898
- if (e.key === 'Escape') { e.preventDefault(); closeAskMenu(true); }
1899
- else if (e.key === 'Tab') closeAskMenu(false);
1910
+ if (e.key === 'Tab') closeAskMenu(false);
1900
1911
  else if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
1901
1912
  e.preventDefault();
1902
1913
  items[(at + (e.key === 'ArrowDown' ? 1 : -1) + items.length) % items.length].focus();
@@ -1953,10 +1964,20 @@
1953
1964
  }
1954
1965
  });
1955
1966
 
1956
- // Escape drops the on-demand entry and returns to the project readout. The
1957
- // sheet handles its own Escape and stops it here, so one press never both
1958
- // closes the sheet and clears the entry behind it.
1967
+ // The open Ask menu owns Escape even after focus leaves it. Capture the key
1968
+ // before it reaches a focused surface or the bubbling handler that clears the explanation.
1969
+ document.addEventListener('keydown', function (e) {
1970
+ if (e.key === 'Escape' && !$askMenu.hidden) {
1971
+ e.preventDefault();
1972
+ e.stopPropagation();
1973
+ closeAskMenu(true);
1974
+ return;
1975
+ }
1976
+ }, true);
1977
+ // The sheet handles its own Escape and stops it here, so one press never
1978
+ // both closes the sheet and clears the entry behind it.
1959
1979
  document.addEventListener('keydown', function (e) {
1980
+ if (e.defaultPrevented) return;
1960
1981
  if (e.key === 'Escape' && !sheetOpen && snapshot.focus) clearFocusEntry();
1961
1982
  });
1962
1983