@floless/app 0.169.0 → 0.171.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 (87) hide show
  1. package/dist/floless-server.cjs +65531 -43728
  2. package/dist/schemas/drawing-check.profile.v1.schema.json +12 -2
  3. package/dist/schemas/steel.model.v2.schema.json +196 -4
  4. package/dist/skills/floless-app-bridge/SKILL.md +3 -3
  5. package/dist/skills/floless-app-knowledge/SKILL.md +46 -15
  6. package/dist/skills/floless-app-new-workflow/SKILL.md +8 -1
  7. package/dist/skills/floless-app-onboarding/SKILL.md +5 -4
  8. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +0 -3
  9. package/dist/skills/floless-app-queue/SKILL.md +2 -3
  10. package/dist/skills/floless-app-report-issue/SKILL.md +2 -2
  11. package/dist/skills/floless-app-routines/SKILL.md +2 -2
  12. package/dist/skills/floless-app-routines/references/routines-api.md +20 -8
  13. package/dist/skills/floless-app-steel-model/SKILL.md +42 -39
  14. package/dist/skills/floless-app-steel-model/references/custom-connections.md +47 -0
  15. package/dist/skills/floless-app-steel-model/references/custom-sections.md +32 -0
  16. package/dist/skills/floless-app-steel-takeoff/SKILL.md +31 -1
  17. package/dist/skills/floless-app-ui/SKILL.md +71 -126
  18. package/dist/skills/floless-app-workflows/SKILL.md +22 -3
  19. package/dist/skills/floless-app-workflows/references/agent-steps.md +40 -6
  20. package/dist/skills/floless-app-workflows/references/exec-contract.md +27 -0
  21. package/dist/skills/floless-app-workflows/references/script-runner.md +105 -0
  22. package/dist/web/add-ons.js +407 -0
  23. package/dist/web/agent-steps.js +89 -18
  24. package/dist/web/agents.js +32 -22
  25. package/dist/web/analytics.js +1 -1
  26. package/dist/web/app.css +331 -190
  27. package/dist/web/app.js +33 -13
  28. package/dist/web/aware.js +926 -218
  29. package/dist/web/chat.css +6 -1
  30. package/dist/web/chat.js +316 -112
  31. package/dist/web/checkpoint-standard.js +5 -3
  32. package/dist/web/commands-drawing-check.js +1 -0
  33. package/dist/web/commands-filter.js +23 -0
  34. package/dist/web/commands-shell.js +479 -78
  35. package/dist/web/commands-steel.js +69 -2
  36. package/dist/web/commands-tekla-parser.js +23 -0
  37. package/dist/web/connections.js +14 -3
  38. package/dist/web/drawing-check-editor.js +352 -88
  39. package/dist/web/failure-copy.js +33 -2
  40. package/dist/web/filter-ai-proposal.js +11 -8
  41. package/dist/web/flo-3d.js +1 -1
  42. package/dist/web/guide.js +36 -29
  43. package/dist/web/index.html +98 -57
  44. package/dist/web/instructor.js +101 -17
  45. package/dist/web/kb-categories.js +64 -7
  46. package/dist/web/left-pane.js +4 -1
  47. package/dist/web/local-discovery.js +8 -7
  48. package/dist/web/missed-routines.js +239 -0
  49. package/dist/web/model-change-findings.js +430 -0
  50. package/dist/web/model-change-review.js +414 -0
  51. package/dist/web/model-editor-steel-adapter.js +2 -2
  52. package/dist/web/model-measure.js +6 -0
  53. package/dist/web/model-spatial-panel.js +19 -4
  54. package/dist/web/model-spatial-tools.js +3 -3
  55. package/dist/web/model-viewport-revit-adapter.js +3 -3
  56. package/dist/web/origin-rule.js +155 -0
  57. package/dist/web/project-access.js +1 -1
  58. package/dist/web/project-history.js +7 -1
  59. package/dist/web/project-modules.js +2 -2
  60. package/dist/web/project-rfis.js +6 -1
  61. package/dist/web/project-workflows.js +2 -2
  62. package/dist/web/revit-editor.css +85 -0
  63. package/dist/web/revit-editor.js +58 -9
  64. package/dist/web/run-history.js +12 -1
  65. package/dist/web/sha256-sync.js +62 -0
  66. package/dist/web/steel-3d-core.js +46 -9
  67. package/dist/web/steel-3d-flo.js +153 -7
  68. package/dist/web/steel-3d-view.js +33 -5
  69. package/dist/web/steel-ai-marks.js +3 -1
  70. package/dist/web/steel-custom-connection.js +161 -0
  71. package/dist/web/steel-custom-sections.js +1796 -0
  72. package/dist/web/steel-editor.html +732 -161
  73. package/dist/web/steel-environments.js +297 -0
  74. package/dist/web/steel-filter-usage.js +299 -0
  75. package/dist/web/steel-filter.html +104 -6
  76. package/dist/web/steel-model-v2-client-validation.js +11 -1
  77. package/dist/web/steel-model-v2-commands.js +116 -13
  78. package/dist/web/steel-model-v2-projection.js +1 -1
  79. package/dist/web/steel-read-confidence.js +1 -56
  80. package/dist/web/step-rename.js +3 -2
  81. package/dist/web/tekla-editor.html +1 -0
  82. package/dist/web/terminal-requests.js +1 -1
  83. package/dist/web/tool-updates.js +7 -6
  84. package/dist/web/workspaces.js +1968 -138
  85. package/launch.mjs +87 -9
  86. package/package.json +4 -1
  87. package/dist/web/panels.js +0 -831
@@ -65,6 +65,10 @@
65
65
  /* The dark --mut, pinned for text ON the stage. The page's --mut turns mid-grey in light theme, and on
66
66
  the always-dark stage that put the hover chip's 11px labels at ~3.7:1 (review finding). */
67
67
  --stage-mut:hsl(215 20.2% 65.1%);
68
+ /* Used lines (2026-11-10): the dark --ok and --warn, pinned for marks ON the stage for the same reason as
69
+ --stage-mut. The light theme's --ok #15803d and --warn #b45309 are darkened for white panels and fall to about
70
+ 3:1 on the always-dark stage. Same hues as the page's own state colours, so no new colour. */
71
+ --stage-ok:hsl(142 71% 45%);--stage-warn:hsl(38 92% 50%);
68
72
  --banner-shadow:0 -4px 18px rgba(0,0,0,.45); /* the conflict bar, thrown UPWARD from the page foot */
69
73
  }
70
74
  /* Light — the same slate/blue ramp as the shell's [data-theme="light"] (web/app.css), re-expressed
@@ -448,6 +452,33 @@ footer{margin-top:auto;border-top:1px solid var(--line);padding-top:12px}
448
452
  assert the halo's `d` equals the hovered element's. No dasharray on the clone: a casing with gaps
449
453
  in it reads as two highlights. */
450
454
  #hot path,#hot text,#hot rect{stroke:var(--stage-text);stroke-opacity:.42;stroke-width:7;vector-effect:non-scaling-stroke;stroke-linecap:round;stroke-linejoin:round;fill:none;pointer-events:none}
455
+ #stage.used-on #hot path,#stage.used-on #hot rect{stroke-width:9}
456
+ /* USED LINES (2026-11-10 plan): which lines the steel model was built from, as a halo UNDER the line, in #under
457
+ beside the hover casing and for the same reasons. The line keeps its own layer colour, so the mark reads the same
458
+ on a grey drawing and on one coloured by layer, where a recolour could not say "used". One <path> per state
459
+ (steel-filter-usage.js), so the stage gains four nodes at most, whatever the sheet holds. The state never rests on
460
+ colour alone: member lines are solid, other evidence dashed, lines used only before a re-read long-dashed, and
461
+ selected lines nothing uses dotted. A line is drawn 2.2px wide, so a mark must be well wider to show beside it;
462
+ the hover casing is painted over them and stays wider still (9px while Used lines is on, see #stage.used-on). */
463
+ #used path{fill:none;vector-effect:non-scaling-stroke;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
464
+ #used{transition:opacity .2s ease}
465
+ #used.off{opacity:0}
466
+ #used .u-member{stroke:var(--stage-ok);stroke-opacity:.6;stroke-width:6.5}
467
+ #used .u-evidence{stroke:var(--stage-ok);stroke-opacity:.6;stroke-width:6.5;stroke-dasharray:7 3;stroke-linecap:butt}
468
+ #used .u-superseded{stroke:var(--stage-mut);stroke-opacity:.5;stroke-width:5.5;stroke-dasharray:12 5;stroke-linecap:butt}
469
+ #used .u-unused{stroke:var(--stage-warn);stroke-opacity:.8;stroke-width:6.5;stroke-dasharray:.5 7}
470
+ /* "Only not used": the review pass. Everything used steps back, and so does the drawing behind it. */
471
+ #stage.used-only-unused #used .u-member,#stage.used-only-unused #used .u-evidence,#stage.used-only-unused #used .u-superseded{display:none}
472
+ #stage.used-only-unused #under image.bg{opacity:.16}
473
+ #stage.used-only-unused #canvas #overlay{opacity:.4}
474
+ @media (prefers-reduced-motion:reduce){#used{transition:none}}
475
+ /* Forced colours drop the hues; the dash patterns carry the state, painted in system colours. */
476
+ @media (forced-colors:active){
477
+ #used path,#usedChip .uc-sw line{forced-color-adjust:none}
478
+ #used .u-member,#used .u-evidence,#usedChip .uc-sw .u-member{stroke:Highlight}
479
+ #used .u-unused,#usedChip .uc-sw .u-unused{stroke:CanvasText}
480
+ #used .u-superseded{stroke:GrayText}
481
+ }
451
482
  /* Raster-less baked sheets cannot retain the confidential background. Keep their full vector sheet as
452
483
  an explicit, non-interactive fallback; raster-backed sheets mount selected vectors only. */
453
484
  #canvas .el.is-context{opacity:.2;pointer-events:none}
@@ -459,6 +490,7 @@ footer{margin-top:auto;border-top:1px solid var(--line);padding-top:12px}
459
490
  so on a light theme it was a dark pill floating on a light pane, an artifact of two correct
460
491
  decisions meeting. `~` and not a descendant selector: they are siblings inside #stage. */
461
492
  #empty.show ~ #zoombar,
493
+ #empty.show ~ #usedChip,
462
494
  #empty.show ~ #hoverbar,
463
495
  #empty.show ~ #hoverNote{display:none}
464
496
  #empty>div{max-width:44ch}
@@ -473,6 +505,7 @@ body.publication-blocked #canvas,
473
505
  body.publication-blocked #under,
474
506
  body.publication-blocked #zoombar,
475
507
  body.publication-blocked #hoverbar,
508
+ body.publication-blocked #usedChip,
476
509
  body.publication-blocked #hoverNote{display:none}
477
510
  body.publication-blocked #stage{display:flex}
478
511
  body.publication-blocked #empty{position:static;flex:1}
@@ -645,8 +678,27 @@ body.publication-blocked #empty{position:static;flex:1}
645
678
  alone carries the amber: the title stays --stage-text, because the light theme's --warn is too dark
646
679
  to read as text on this panel (which is dark on both themes). `bottom` is set by syncHoverNote from
647
680
  #zoombar's real height, so the note sits directly above the Hover info toggle it qualifies. */
648
- #hoverNote{position:absolute;left:12px;bottom:58px;max-width:min(360px, calc(100% - 24px));background:var(--stage-panel);border:1px solid var(--stage-line);border-left:3px solid var(--warn);border-radius:0 8px 8px 0;padding:8px 10px;box-shadow:var(--stage-shadow);color:var(--stage-mut);font-size:12px;line-height:1.5;pointer-events:none;z-index:30}
681
+ #hoverNote{position:absolute;left:12px;bottom:calc(58px + var(--used-chip-h, 0px));max-width:min(360px, calc(100% - 24px));background:var(--stage-panel);border:1px solid var(--stage-line);border-left:3px solid var(--warn);border-radius:0 8px 8px 0;padding:8px 10px;box-shadow:var(--stage-shadow);color:var(--stage-mut);font-size:12px;line-height:1.5;pointer-events:none;z-index:30}
649
682
  #hoverNote[hidden]{display:none}
683
+ /* The Used lines count, stacked just above #zoombar (12px + the bar's 40px + 6px), so it reads as the legend of the
684
+ toggle beside Flo. #hoverNote moves up by its height (--used-chip-h, set from script) rather than sharing a box. The
685
+ two swatches ARE the legend: the same stroke and dash as the marks on the sheet. */
686
+ #usedChip{position:absolute;left:12px;bottom:58px;max-width:min(440px, calc(100% - 24px));display:flex;flex-wrap:wrap;align-items:center;gap:2px 8px;background:var(--stage-panel);border:1px solid var(--stage-line);border-radius:8px;padding:4px 8px;box-shadow:var(--stage-shadow);color:var(--stage-mut);font-size:12px;line-height:1.4;z-index:30}
687
+ #usedChip[hidden]{display:none}
688
+ #usedChip .uc-used{display:inline-flex;align-items:center;gap:6px;color:var(--stage-text)}
689
+ #usedChip .uc-sw{width:18px;height:8px;flex:none;display:block}
690
+ #usedChip .uc-sw line{fill:none;stroke-linecap:round}
691
+ #usedChip .uc-sw .u-member{stroke:var(--stage-ok);stroke-width:3}
692
+ #usedChip .uc-sw .u-unused{stroke:var(--stage-warn);stroke-width:3.5;stroke-dasharray:.5 4.5}
693
+ #usedChip .uc-extra{flex-basis:100%;color:var(--stage-mut)}
694
+ #usedChip .uc-extra[hidden],#usedChip .uc-used[hidden],#usedOnlyUnused[hidden],#usedChip .uc-sw[hidden]{display:none}
695
+ /* "N not used" is the review switch: #zoombar's pressed language (brand outline, 12% brand fill), sized to text. */
696
+ #usedOnlyUnused{display:inline-flex;align-items:center;gap:6px;min-width:0;min-height:0;padding:2px 6px;margin:-2px 0;background:transparent;border:1px solid transparent;border-radius:6px;box-shadow:none;color:var(--stage-text);font:inherit}
697
+ #usedOnlyUnused:hover{background:var(--stage-btn-hover)}
698
+ #usedOnlyUnused[aria-pressed="true"]{background:color-mix(in srgb,var(--brand) 12%,transparent);border-color:var(--brand)}
699
+ #usedOnlyUnused[aria-pressed="true"]:hover{background:color-mix(in srgb,var(--brand) 20%,transparent)}
700
+ @media (forced-colors:active){#usedOnlyUnused[aria-pressed="true"]{outline:2px solid currentColor;outline-offset:-3px}}
701
+ #usedToggle[aria-pressed="true"] svg.zb-off{display:none}
650
702
  #hoverNote b{display:block;color:var(--stage-text);font-weight:600;margin-bottom:2px}
651
703
  /* #2926: Flo, showing which part of the drawing the AI is reading (web/steel-filter-flo.js). Stage furniture
652
704
  only: the stage tokens, the brand outline #focusPlace already draws, and #hoverNote's amber rail for "waiting
@@ -873,6 +925,8 @@ body.publication-blocked #empty{position:static;flex:1}
873
925
  linework and the line keeps its own colour (see #under's CSS for why it is a separate SVG).
874
926
  It sits OUTSIDE #overlay, so buildOverlay()'s replaceChildren() never removes the group;
875
927
  buildOverlay empties it on purpose, via hoverClear(). -->
928
+ <!-- Used lines: the model's marks, one path per state, under the hover casing so the casing stays on top. -->
929
+ <g id="used" aria-hidden="true"><path class="u-superseded"/><path class="u-evidence"/><path class="u-member"/><path class="u-unused"/></g>
876
930
  <g id="hot" fill="none" aria-hidden="true"></g>
877
931
  </svg>
878
932
  <svg id="canvas" preserveAspectRatio="xMidYMid meet">
@@ -924,7 +978,14 @@ body.publication-blocked #empty{position:static;flex:1}
924
978
  bare noun read as a category, not a command. data-tip (never title=) carries the full
925
979
  sentence. -->
926
980
  <div id="placebar" role="status" aria-live="polite" hidden><span id="placebarText"></span><button id="placebarClear" type="button" data-command-id="filter.place-clear" data-tip="Remove the marked place from this drawing">Clear</button></div>
927
- <div id="zoombar"><button id="fit2" type="button" data-command-id="filter.fit" aria-label="Fit" data-tip="Fit the whole page in view"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 6V2h4M14 6V2h-4M2 10v4h4M14 10v4h-4"/></svg></button><button id="zoomsteel2" type="button" data-command-id="filter.zoom-steel" aria-label="Zoom steel" data-tip="Zoom to fit the steel elements on this sheet"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 5V2h3M14 5V2h-3M2 11v3h3M14 11v3h-3"/><path d="M5.4 5.4h5.2M5.4 10.6h5.2M8 5.4v5.2" stroke-width="1.4"/></svg></button><span class="zb-sep" aria-hidden="true"></span><button id="hoverInfo" type="button" aria-pressed="false" aria-label="Hover info" data-command-id="filter.hover-info" data-tip="Hover info. Point at any line or label, shown or switched off, to read its layer, thickness and colour — and light up its rows in the Filters panel. Click a switched-off line to see what to tick to bring it back. Background-only linework, on layers the drawing read never picked up, can’t be read by pointing; click an empty spot to ask the original drawing what is there, where the original drawing is available."><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.2 2.4 3.2 12l2.6-2.4 1.8 4 1.7-.8-1.8-3.9 3.6-.1z"/><path d="M11.6 3.4h2.6M11.6 5.6h1.6" stroke-width="1.4"/></svg></button><button id="floToggle" type="button" aria-pressed="true" aria-label="Show Flo" hidden data-command-id="filter.flo-toggle" data-tip="Hide Flo. While a drawing read runs, Flo shows which part of the drawing the AI is reading and says when it is waiting for your answer. Drag Flo to move it."><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.2 6.6a3.8 3.8 0 0 1 7.6 0M3 6.6h10"/><path d="M4.6 6.6v2a3.4 3.4 0 0 0 6.8 0v-2"/><path d="M6.5 8.7h.01M9.5 8.7h.01" stroke-width="2"/></svg><svg class="zb-off" viewBox="0 0 16 16" aria-hidden="true"><path d="M2.6 13.4 13.4 2.6" stroke-width="1.5"/></svg></button></div>
981
+ <div id="zoombar"><button id="fit2" type="button" data-command-id="filter.fit" aria-label="Fit" data-tip="Fit the whole page in view"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 6V2h4M14 6V2h-4M2 10v4h4M14 10v4h-4"/></svg></button><button id="zoomsteel2" type="button" data-command-id="filter.zoom-steel" aria-label="Zoom steel" data-tip="Zoom to fit the steel elements on this sheet"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 5V2h3M14 5V2h-3M2 11v3h3M14 11v3h-3"/><path d="M5.4 5.4h5.2M5.4 10.6h5.2M8 5.4v5.2" stroke-width="1.4"/></svg></button><span class="zb-sep" aria-hidden="true"></span><button id="hoverInfo" type="button" aria-pressed="false" aria-label="Hover info" data-command-id="filter.hover-info" data-tip="Hover info. Point at any line or label, shown or switched off, to read its layer, thickness and colour — and light up its rows in the Filters panel. Click a switched-off line to see what to tick to bring it back. Background-only linework, on layers the drawing read never picked up, can’t be read by pointing; click an empty spot to ask the original drawing what is there, where the original drawing is available."><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.2 2.4 3.2 12l2.6-2.4 1.8 4 1.7-.8-1.8-3.9 3.6-.1z"/><path d="M11.6 3.4h2.6M11.6 5.6h1.6" stroke-width="1.4"/></svg></button><button id="floToggle" type="button" aria-pressed="true" aria-label="Show Flo" hidden data-command-id="filter.flo-toggle" data-tip="Hide Flo. While a drawing read runs, Flo shows which part of the drawing the AI is reading and says when it is waiting for your answer. Drag Flo to move it."><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.2 6.6a3.8 3.8 0 0 1 7.6 0M3 6.6h10"/><path d="M4.6 6.6v2a3.4 3.4 0 0 0 6.8 0v-2"/><path d="M6.5 8.7h.01M9.5 8.7h.01" stroke-width="2"/></svg><svg class="zb-off" viewBox="0 0 16 16" aria-hidden="true"><path d="M2.6 13.4 13.4 2.6" stroke-width="1.5"/></svg></button><button id="usedToggle" type="button" aria-pressed="true" aria-label="Used lines" data-command-id="filter.used-lines" data-tip="Hide used lines"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2.5 13.5 8.5 7.5"/><path d="M9.6 4.4l1.7 1.7 3.2-3.4"/><path d="M2.5 9.5h3.2M10.3 13.5h3.2" stroke-width="1.4" stroke-dasharray=".5 2.6"/></svg><svg class="zb-off" viewBox="0 0 16 16" aria-hidden="true"><path d="M2.6 13.4 13.4 2.6" stroke-width="1.5"/></svg></button></div>
982
+ <!-- Used lines: the count and legend for the marks, shown while the Used lines toggle is on. -->
983
+ <div id="usedChip" hidden>
984
+ <span class="uc-used" id="usedUsed"><svg class="uc-sw" id="usedSwUsed" viewBox="0 0 18 8" aria-hidden="true"><line class="u-member" x1="2" y1="4" x2="16" y2="4"/></svg><span id="usedLead"></span></span>
985
+ <button type="button" id="usedOnlyUnused" aria-pressed="false" data-command-id="filter.used-only-unused" data-tip="Show only the selected lines nothing in the model uses"><svg class="uc-sw" viewBox="0 0 18 8" aria-hidden="true"><line class="u-unused" x1="2" y1="4" x2="16" y2="4"/></svg><span id="usedUnusedN"></span></button>
986
+ <span class="uc-extra" id="usedExtras" hidden></span>
987
+ </div>
988
+ <div id="usedLive" class="sr-only" role="status" aria-live="polite"></div>
928
989
  <!-- The hover readout, anchored at the line it names (see #hoverbar's CSS for why it is not docked).
929
990
  Hidden until the pointer is on a line with the mode on; hidden again when it leaves the line, or
930
991
  when a click opens the popover (which then says the same thing).
@@ -1011,6 +1072,7 @@ import { checkpointStandard } from './checkpoint-standard.js';
1011
1072
  import { filterAiBlockedLayerKeys, filterAiTouchesUnreadLayer, parseFilterAiProposal } from './filter-ai-proposal.js';
1012
1073
  import { hitIndexBuilder, hitTest, textRunRect } from './steel-filter-hit.js';
1013
1074
  import { mountFilterFlo } from './steel-filter-flo.js';
1075
+ import { mountUsedLines } from './steel-filter-usage.js';
1014
1076
  // #2926: Flo's overlay, mounted at the end of this module. Declared first because setVB() calls it on every view change.
1015
1077
  let filterFlo = null;
1016
1078
 
@@ -1126,7 +1188,8 @@ function filterAiApplyCheck(record, proposal){
1126
1188
  return { ok:false, message:'This suggestion is out of date. Ask again to get a current one.' };
1127
1189
  let parsed;
1128
1190
  try { parsed = parseFilterAiProposal(JSON.stringify(proposal), F, record.allowed); }
1129
- catch(error) { return { ok:false, message:error instanceof Error ? error.message : 'This suggestion cannot be used with this filter. Ask again.' }; }
1191
+ // #3097: only the parser's own refusal is said; anything else that threw is logged and gets the plain sentence.
1192
+ catch(error) { if(!error?.forPerson) console.warn('steel-filter: the AI suggestion could not be read', error); return { ok:false, message:error?.forPerson ? error.message : 'This suggestion cannot be used with this filter. Ask again.' }; }
1130
1193
  if(filterAiTouchesUnreadLayer(parsed,F))
1131
1194
  return { ok:false, message:'This suggestion includes a layer FloLess did not read. Nothing was applied. Ask your terminal AI to inspect that source layer if it holds steel.' };
1132
1195
  // A suggestion is a three-way merge: leave every user edit made during the AI request alone.
@@ -1477,7 +1540,7 @@ function renderStandardStat(){
1477
1540
  note.className = 'sr-only';
1478
1541
  note.textContent = ' ' + line.note;
1479
1542
  el.append(note);
1480
- // A document that STATES an environment this build cannot resolve ('EU' today) lands in the same
1543
+ // A document that STATES an environment this build cannot resolve (a word the trait registry does not know) lands in the same
1481
1544
  // arm as one that states nothing. The sentence is deliberately written to be true of both, but the
1482
1545
  // two are different facts and only one of them is a data problem -- so it leaves a trace here rather
1483
1546
  // than being indistinguishable forever.
@@ -2842,6 +2905,9 @@ function syncFacetChecks(){
2842
2905
  }
2843
2906
  }
2844
2907
 
2908
+ // Set once the Used lines overlay is mounted (end of this module). Declared beside apply() so the harnesses that
2909
+ // lift this block of the page carry it too, unset.
2910
+ let onFilterPainted = null;
2845
2911
  function apply(){
2846
2912
  // Every selection, mode, sheet and contract repaint runs through here; AI Chat re-checks with it.
2847
2913
  notifyFilterAi();
@@ -2863,6 +2929,8 @@ function apply(){
2863
2929
  html += ' · <b>' + sa + '</b> of <b>' + ta + '</b> total (' + sheets.length + ' sheets)';
2864
2930
  }
2865
2931
  countEl.innerHTML = html;
2932
+ // Used lines (steel-filter-usage.js) repaints with every selection, mode and sheet change.
2933
+ onFilterPainted?.();
2866
2934
  const dims = new Set(modeDims(mode));
2867
2935
  document.getElementById('facet-layers').classList.toggle('dim', !dims.has('layer'));
2868
2936
  document.getElementById('facet-thicknesses').classList.toggle('dim', !dims.has('thickness'));
@@ -3458,7 +3526,8 @@ function syncHoverNote(){
3458
3526
  function placeHoverNote(){
3459
3527
  const box = document.getElementById('hoverNote'), bar = document.getElementById('zoombar');
3460
3528
  if(!box || box.hidden || !bar || !bar.offsetHeight) return;
3461
- box.style.bottom = (12 + bar.offsetHeight + 6) + 'px';
3529
+ // Above the Used lines chip too, when it shows: the page keeps its height in --used-chip-h.
3530
+ box.style.bottom = 'calc(' + (12 + bar.offsetHeight + 6) + 'px + var(--used-chip-h, 0px))';
3462
3531
  }
3463
3532
  if(typeof ResizeObserver === 'function' && document.getElementById('zoombar')){
3464
3533
  new ResizeObserver(placeHoverNote).observe(document.getElementById('zoombar'));
@@ -4955,7 +5024,9 @@ boot();
4955
5024
  clearTop: () => { const pb = $('placebar'); return pb && !pb.hidden ? pb.offsetTop + pb.offsetHeight + 8 : 12; },
4956
5025
  clearBottom: () => {
4957
5026
  const note = $('hoverNote');
4958
- return 12 + (zoombar ? zoombar.offsetHeight : 0) + 6 + (note && !note.hidden && note.offsetHeight ? note.offsetHeight + 6 : 0);
5027
+ const usedChip = $('usedChip');
5028
+ return 12 + (zoombar ? zoombar.offsetHeight : 0) + 6 + (note && !note.hidden && note.offsetHeight ? note.offsetHeight + 6 : 0)
5029
+ + (usedChip && !usedChip.hidden && usedChip.offsetHeight ? usedChip.offsetHeight + 6 : 0);
4959
5030
  },
4960
5031
  ask: () => { try { if(window.parent !== window) window.parent.dispatchEvent(new CustomEvent('floless:filter-flo-answer')); } catch { /* no shell */ } },
4961
5032
  storage: (() => { try { return window.localStorage; } catch { return null; } })(),
@@ -4963,6 +5034,33 @@ boot();
4963
5034
  handle: $('floAvatar'),
4964
5035
  });
4965
5036
  window.flolessFilterFlo = (state) => filterFlo.update(state);
5037
+ // Used lines: which lines the steel model was built from (2026-11-10 plan). An optional overlay, so a fault in it
5038
+ // is logged and never stops a repaint (apply() calls it mid-way) or the rest of this block.
5039
+ try {
5040
+ const usedLines = mountUsedLines({
5041
+ g: $('used'), toggle: $('usedToggle'), chip: $('usedChip'), onlyBtn: $('usedOnlyUnused'), lead: $('usedLead'),
5042
+ swUsed: $('usedSwUsed'), unusedN: $('usedUnusedN'), extras: $('usedExtras'), live: $('usedLive'), stage, bar: $('zoombar'),
5043
+ contract: () => C, sheets: () => sheets, active: () => active, ready: () => !!(C && sel),
5044
+ isSelected: (el) => matchesActive(el, mode, sel),
5045
+ afterLayout: () => filterFlo.place(true),
5046
+ storage: (() => { try { return window.localStorage; } catch { return null; } })(),
5047
+ });
5048
+ onFilterPainted = () => {
5049
+ try { usedLines.render(); } catch(error){ console.error('[filter] the used-lines marks could not be drawn', error); }
5050
+ };
5051
+ onFilterPainted();
5052
+ // The bar wraps on a narrow stage and the chip wraps with its extras: keep the chip on the bar and the note above it.
5053
+ if(typeof ResizeObserver === 'function'){
5054
+ new ResizeObserver(() => { try { usedLines.layout(); } catch { /* drawn again on the next repaint */ } placeHoverNote(); })
5055
+ .observe($('usedChip'));
5056
+ new ResizeObserver(() => { try { usedLines.layout(); } catch { /* drawn again on the next repaint */ } })
5057
+ .observe($('zoombar'));
5058
+ }
5059
+ // For a real browser pass to read the outcome; it drives nothing.
5060
+ window.__filterTest.used = () => usedLines.state();
5061
+ } catch(error){
5062
+ console.error('[filter] the used-lines marks could not be set up', error);
5063
+ }
4966
5064
  // For a real browser pass to read the outcome; it drives nothing.
4967
5065
  window.__filterTest.flo = () => ({
4968
5066
  shown: !$('floFx').hidden, on: filterFlo.isOn(), waiting: $('floBubble').classList.contains('waiting'),
@@ -15,11 +15,19 @@ export { validateSchemaSubset };
15
15
  import { parseSpacings } from './grid-core.js';
16
16
  import { positionBasisIssue,POSITION_BASIS_CAPABILITY_VERSION } from './steel-3d-core.js';
17
17
  import { rawPlanViewId } from './steel-plan-view-id.js';
18
+ import { customSectionIssues } from './steel-custom-sections.js';
18
19
  export const POSITION_BASIS_CLIENT_VALIDATION_VERSION=POSITION_BASIS_CAPABILITY_VERSION;
19
20
 
20
21
  const rows = (v) => Array.isArray(v) ? v : [];
21
22
  const object = (v) => v && typeof v === 'object' && !Array.isArray(v);
22
23
 
24
+ /**
25
+ * How far a column's base may sit above its top and still count as level (#3208). Elevations read from a drawing carry
26
+ * float noise: on Adnoc two level beams were stored 5e-13 mm top-first, so retyping them to Column was refused as
27
+ * "top below bottom". The server's rule (`server/steel-model-v2.ts`) uses the same value; a test pins the two together.
28
+ */
29
+ export const COLUMN_LEVEL_TOLERANCE_MM = 0.001;
30
+
23
31
  /**
24
32
  * True when a refused command's validation issues are the column base→top rule and NOTHING else — the one
25
33
  * refusal the steel editor words for people instead of "would leave steel.model/v2 invalid" (#1933). When
@@ -160,7 +168,7 @@ export function validateClientSteelModelV2(doc, schema) {
160
168
  if (problem) issues.push(`${problem} at $.members[${i}].positionBasis`);
161
169
  }
162
170
  if (member?.role === 'column' && Number.isFinite(member.from?.z?.known)
163
- && Number.isFinite(member.to?.z?.known) && member.from.z.known > member.to.z.known) {
171
+ && Number.isFinite(member.to?.z?.known) && member.from.z.known - member.to.z.known > COLUMN_LEVEL_TOLERANCE_MM) {
164
172
  issues.push(`column-endpoint-order at $.members[${i}]`);
165
173
  }
166
174
  for (const end of rows(member?.ends)) if (end?.conn && !rows(doc.connections).some((c) => c?.id === end.conn)) {
@@ -180,5 +188,7 @@ export function validateClientSteelModelV2(doc, schema) {
180
188
  for (const member of members) if (!presented.has(member?.id) && member?.role !== 'column') {
181
189
  issues.push(`member-unpresented at $.members[${member?.id || '?'}]`);
182
190
  }
191
+ // The server's own custom-section checks, from the one shared module, so the two cannot disagree.
192
+ for (const issue of customSectionIssues(doc)) issues.push(`${issue.code} at ${issue.path}`);
183
193
  return issues;
184
194
  }
@@ -15,6 +15,8 @@ import { sheetPxToWorld, worldToSheetPx } from './steel-plan-transform.js';
15
15
  import { memberPresence, projectionLink } from './steel-model-v2-projection.js';
16
16
  import { gridLabelPatch, parseSpacings } from './grid-core.js';
17
17
  import { IN_TO_MM as IN_MM } from './steel-units.js';
18
+ import { defaultGradeFor } from './steel-environments.js';
19
+ import { resultDigest, resolveCustomSection } from './steel-custom-sections.js';
18
20
  import {
19
21
  basisFromAxes, endpointPlacementCompensation, effectiveDepthPosition, effectiveWidthPosition, outlineFor, partFrame,
20
22
  positionOffsetVector, reversePlacement, sectionExtents,
@@ -108,9 +110,19 @@ const withoutAnswer = (z) => (z && z.answered ? { known: z.known }
108
110
  * and a key order that differs while the value is identical must compare EQUAL. Rejecting that would
109
111
  * refuse a perfectly valid move for a reason no user could ever act on.
110
112
  */
113
+ /** The root keys a custom section lives in (add-ons S1a); the undo snapshot captures both under `customSections`. */
114
+ export const CUSTOM_SECTION_ROOT_KEYS = Object.freeze(['section_definitions', 'custom_sections']);
115
+
116
+ /** What an undo snapshot records of the custom sections: each key present with its value, or absent. */
117
+ export function captureCustomSections(doc) {
118
+ const out = {};
119
+ for (const key of CUSTOM_SECTION_ROOT_KEYS) if (doc && doc[key] !== undefined) out[key] = doc[key];
120
+ return out;
121
+ }
122
+
111
123
  const FINGERPRINT_KEYS = [
112
124
  'role', 'memberType', 'brace', 'position', 'positionH', 'positionOffset', 'positionHOffset',
113
- 'positionBasis', 'rot', 'profile', 'section',
125
+ 'positionBasis', 'rot', 'profile', 'section', 'customSectionId',
114
126
  ];
115
127
  function stableKey(v) {
116
128
  if (v === null || typeof v !== 'object') return JSON.stringify(v ?? null);
@@ -687,11 +699,25 @@ const vunit = (a) => { const n = vlen(a); return n > 0 ? a.map((v) => v / n) : n
687
699
  const vdist = (a, b) => vlen(vsub(a, b));
688
700
  const lex3 = (a, b) => a[0] - b[0] || a[1] - b[1] || a[2] - b[2];
689
701
  const canonProfile = (s) => String(s || '').trim().toUpperCase().replace(/×/g, 'X').replace(/\s*X\s*/g, 'X').replace(/^([A-Z]+)\s+/, '$1');
690
- const inferredMaterial = (profile) => profile.startsWith('HSS') ? 'A500-GR.B' : /^W\d/.test(profile) ? 'A992' : 'A36';
702
+ // The grade a member carries when it states none. A merge compares its sources by EFFECTIVE grade, so this
703
+ // has to be the SAME default the editor shows and the BOM prices: the environment's, hollow decided by the
704
+ // catalogue row (`profileDefaultMaterial` in the page). It used to be the US rule alone, which gave every
705
+ // UK member A36 here while the rest of the product said S355 (EU epic #3197, EU-0b #3199). A session built
706
+ // with no resolver keeps the US default - the compatibility fallback, byte-unchanged.
707
+ const inferredMaterial = (profile, defaultMaterial) => (defaultMaterial ? defaultMaterial(profile) : defaultGradeFor(undefined, profile, null));
691
708
  const effectiveMemberType = (m) => typeof m.memberType === 'string' && m.memberType.trim()
692
709
  ? m.memberType.trim().toLowerCase() : (m.role === 'column' ? 'column' : 'beam');
693
710
 
694
- function mergeSection(member, resolveSection) {
711
+ function mergeSection(member, resolveSection, doc) {
712
+ // Add-ons S1a: a custom section is the member's section outright, read from the document being edited, never
713
+ // from a catalogue row of the same name. One FloLess cannot vouch for has no shape to place.
714
+ const custom = resolveCustomSection(doc, member);
715
+ if (custom) {
716
+ const s = custom.usable ? custom.section : null;
717
+ if (!s || !(s.width > 0) || !(s.depth > 0) || !Array.isArray(s.outline)) return null;
718
+ const outline = { outer: s.outline.map(([x, y]) => [x, y]) };
719
+ return { w: s.width, d: s.depth, round: false, outline, extents: sectionExtents(outline), roundRadius: null, roundInnerRadius: null };
720
+ }
695
721
  const standard = resolveSection ? resolveSection(member) : null;
696
722
  const explicit = member.section && member.section.w > 0 && member.section.d > 0
697
723
  ? { w: member.section.w, d: member.section.d, round: false } : null;
@@ -725,7 +751,7 @@ function mergePlacedSection(member, from, to, section) {
725
751
  };
726
752
  }
727
753
 
728
- function physicalMergePreflight(sources, resolveSection) {
754
+ function physicalMergePreflight(sources, resolveSection, defaultMaterial, doc) {
729
755
  const rows = sources.map((m) => ({ m, a: vec3(m.from, `${m.id}.from`), b: vec3(m.to, `${m.id}.to`) }));
730
756
  const points = rows.flatMap((r, ri) => [{ p: r.a, ri, end: 0 }, { p: r.b, ri, end: 1 }]).sort((a,b)=>lex3(a.p,b.p));
731
757
  const parent=points.map((_,i)=>i),find=i=>parent[i]===i?i:(parent[i]=find(parent[i])),join=(a,b)=>{a=find(a);b=find(b);if(a!==b)parent[b]=a;};
@@ -749,15 +775,18 @@ function physicalMergePreflight(sources, resolveSection) {
749
775
  const dir=vunit(vsub(forward?row.b:row.a,forward?row.a:row.b));const angle=Math.acos(Math.max(-1,Math.min(1,vdot(dir,chainDir))));if(angle>MERGE_RAD)throw new V2CommandError('merge-not-collinear','merge member direction exceeds the 0.000001 rad bound');
750
776
  ordered.push({row,forward,seamFrom:orderedClusters[cur].rep,seamTo:orderedClusters[edge.v].rep});prev=cur;cur=edge.v;}
751
777
  const profile=canonProfile(ordered[0].row.m.profile),role=ordered[0].row.m.role==='column'?'column':'beam',memberType=effectiveMemberType(ordered[0].row.m);
752
- const material=(ordered[0].row.m.material&&ordered[0].row.m.material.trim())||inferredMaterial(profile);
778
+ const material=(ordered[0].row.m.material&&ordered[0].row.m.material.trim())||inferredMaterial(profile, defaultMaterial);
753
779
  let reference=null;
754
- for(const item of ordered){const m=item.row.m,p=canonProfile(m.profile),r=m.role==='column'?'column':'beam',t=effectiveMemberType(m),mat=(m.material&&m.material.trim())||inferredMaterial(p);
780
+ for(const item of ordered){const m=item.row.m,p=canonProfile(m.profile),r=m.role==='column'?'column':'beam',t=effectiveMemberType(m),mat=(m.material&&m.material.trim())||inferredMaterial(p, defaultMaterial);
755
781
  if(p!==profile||r!==role||t!==memberType||mat!==material)throw new V2CommandError('merge-member-conflict','merge sources must agree on effective profile, material, role, and member type');
782
+ // Add-ons S1a: two custom sections may share a designation and differ in shape, and a custom member is never
783
+ // the same section as a catalogue one, so the section identity must agree too.
784
+ if((m.customSectionId??null)!==(ordered[0].row.m.customSectionId??null))throw new V2CommandError('merge-member-conflict','merge sources must agree on their custom section');
756
785
  let physicalMember=m,physicalFrom=item.row.a,physicalTo=item.row.b;
757
786
  if(!item.forward){const basis=m.positionBasis?basisFromAxes(m.positionBasis.x,m.positionBasis.y):{x:[1,0,0],y:[0,1,0],z:[0,0,1]};const sourceFrame=basis&&partFrame(item.row.a,item.row.b,basis.z,basis.x);
758
787
  if(!sourceFrame)throw new V2CommandError('merge-section-unresolved',`cannot normalize the direction of "${m.id}"`);
759
788
  physicalMember=Object.assign(clone(m),reversePlacement(m,sourceFrame.degenerate));physicalFrom=item.row.b;physicalTo=item.row.a;}
760
- const sec=mergeSection(physicalMember,resolveSection);if(!sec)throw new V2CommandError('merge-section-unresolved',`cannot compute the section placement for "${m.id}"`);
789
+ const sec=mergeSection(physicalMember,resolveSection,doc);if(!sec)throw new V2CommandError('merge-section-unresolved',`cannot compute the section placement for "${m.id}"`);
761
790
  const placed=mergePlacedSection(physicalMember,physicalFrom,physicalTo,sec);if(!placed)throw new V2CommandError('merge-section-unresolved',`cannot compute the section frame for "${m.id}"`);
762
791
  const signature={m:physicalMember,sec,placed};
763
792
  // Every source is compared with the survivor inherited from the FIRST source. Advancing this
@@ -783,15 +812,18 @@ function physicalMergePreflight(sources, resolveSection) {
783
812
  }
784
813
  }
785
814
  let survivor=clone(ordered[0].row.m);if(!ordered[0].forward){const basis=survivor.positionBasis?basisFromAxes(survivor.positionBasis.x,survivor.positionBasis.y):{x:[1,0,0],y:[0,1,0],z:[0,0,1]};const f=basis&&partFrame(ordered[0].row.a,ordered[0].row.b,basis.z,basis.x);if(!f)throw new V2CommandError('merge-section-unresolved','cannot normalize the first member direction');Object.assign(survivor,reversePlacement(survivor,f.degenerate));}
815
+ // `profileBasis` is one source's account of its own section. The survivor keeps it only when EVERY source states the
816
+ // same words; otherwise it would present the first member's note as evidence for the whole merged member.
817
+ if(survivor.profileBasis!==undefined&&!ordered.every(o=>o.row.m.profileBasis===survivor.profileBasis))delete survivor.profileBasis;
786
818
  return {survivor,from:orderedClusters[start].rep,to:orderedClusters[finish].rep};
787
819
  }
788
820
 
789
- function mergeMemberGroup(doc, sheet, memberIds, mergedPx, mintId, resolveSection) {
821
+ function mergeMemberGroup(doc, sheet, memberIds, mergedPx, mintId, resolveSection, defaultMaterial) {
790
822
  const oldIds = new Set(memberIds);
791
823
  if (oldIds.size < 2) throw new V2CommandError('merge-needs-two', 'merge needs at least two members');
792
824
  assertNoWholeMemberRefs(doc, oldIds);
793
825
  const sources = [...oldIds].map((id) => memberById(doc, id));
794
- const physical=physicalMergePreflight(sources,resolveSection);
826
+ const physical=physicalMergePreflight(sources,resolveSection,defaultMaterial,doc);
795
827
  const merged = physical.survivor;
796
828
  merged.id = mintId();
797
829
  // MERGE is split's inverse and needs the same rule: if either source end was placed rather than
@@ -894,12 +926,13 @@ const restoreCaptured = (holder, saved, keys) => {
894
926
  }
895
927
  };
896
928
 
897
- /** @param {any} model @param {{validate?: (doc: any) => any, mintId?: () => string, afterCommit?: (effect: any) => void, resolveSection?: (member:any) => any}} options */
929
+ /** @param {any} model @param {{validate?: (doc: any) => any, mintId?: () => string, afterCommit?: (effect: any) => void, resolveSection?: (member:any) => any, defaultMaterial?: (profile:string) => string}} options */
898
930
  export function createV2CommandSession(model, options = {}) {
899
931
  const {
900
932
  validate,
901
933
  afterCommit,
902
934
  resolveSection,
935
+ defaultMaterial,
903
936
  mintId = (() => { let n = 0; return () => `m-v2-${Date.now()}-${n++}`; })(),
904
937
  } = options;
905
938
  const projections = new Set();
@@ -962,6 +995,15 @@ export function createV2CommandSession(model, options = {}) {
962
995
  if (Object.hasOwn(saved, 'details')) draft.detail_placements = clone(saved.details || []);
963
996
  draft.views = clone(saved.views || []);
964
997
  if (Object.hasOwn(saved, 'member_types')) draft.member_types = clone(saved.member_types || []);
998
+ // Add-ons S1a. Only a snapshot that CAPTURED them restores them (a partial member-end snapshot does not),
999
+ // and then by presence: a model that had none gets none back, never `[]`.
1000
+ if (Object.hasOwn(saved, 'customSections')) {
1001
+ const captured = saved.customSections || {};
1002
+ for (const key of CUSTOM_SECTION_ROOT_KEYS) {
1003
+ if (Object.hasOwn(captured, key) && captured[key] !== undefined) draft[key] = clone(captured[key]);
1004
+ else delete draft[key];
1005
+ }
1006
+ }
965
1007
  if (Object.hasOwn(saved, 'dim_style')) draft.dim_style = clone(saved.dim_style || {});
966
1008
  if (Object.hasOwn(saved, 'member_styles')) draft.member_styles = clone(saved.member_styles || {});
967
1009
  if (Object.hasOwn(saved, 'reference_models')) draft.reference_models = clone(saved.reference_models || []);
@@ -1182,7 +1224,7 @@ export function createV2CommandSession(model, options = {}) {
1182
1224
  id, profile: projected.profile || '', from, to,
1183
1225
  provenance: 'manual',
1184
1226
  };
1185
- for (const key of ['material', 'role', 'memberType', 'position', 'positionH', 'positionOffset', 'positionHOffset', 'positionBasis', 'rot', 'section', 'bf', 'rfi', 'mf', 'verified', 'source', 'brace']) {
1227
+ for (const key of ['material', 'role', 'memberType', 'position', 'positionH', 'positionOffset', 'positionHOffset', 'positionBasis', 'rot', 'section', 'customSectionId', 'bf', 'rfi', 'mf', 'verified', 'source', 'brace']) {
1186
1228
  if (projected[key] !== undefined) member[key] = clone(projected[key]);
1187
1229
  }
1188
1230
  if (Array.isArray(projected.ends)) {
@@ -1265,14 +1307,75 @@ export function createV2CommandSession(model, options = {}) {
1265
1307
  patchMember(memberId, patch) {
1266
1308
  return session.transact('patch member', (doc) => {
1267
1309
  const member = memberById(doc, memberId);
1310
+ // `profileBasis` is the reader's evidence for the profile this member HAD; a different profile
1311
+ // is not covered by it, so it goes unless the same patch restates it.
1312
+ const profileChanged = Object.prototype.hasOwnProperty.call(patch, 'profile') && patch.profile !== member.profile;
1313
+ // A patch that names a profile is a person choosing one (the Browse picker, the profile field, a size pick),
1314
+ // even when the text matches what the member already shows: a custom welded W12X65 and catalogue W12X65
1315
+ // share a designation, so the choice itself, not a change of text, is what says "the catalogue one".
1316
+ const profileChosen = Object.prototype.hasOwnProperty.call(patch, 'profile') && patch.profile !== undefined;
1268
1317
  for (const [key, value] of Object.entries(patch)) {
1269
1318
  if (value === undefined) delete member[key];
1270
1319
  else member[key] = clone(value);
1271
1320
  }
1321
+ if (profileChanged && !Object.prototype.hasOwnProperty.call(patch, 'profileBasis')) delete member.profileBasis;
1322
+ // A catalogue profile chosen for a custom member wins (add-ons S1a): the member stops pointing at its custom
1323
+ // section unless the same patch names one. An edit that names no profile (material, verified, placement)
1324
+ // keeps the pointer. The section itself stays in the model for undo and reuse.
1325
+ if (profileChosen && !Object.prototype.hasOwnProperty.call(patch, 'customSectionId')) delete member.customSectionId;
1272
1326
  return { changedIds: [memberId] };
1273
1327
  });
1274
1328
  },
1275
1329
 
1330
+ /**
1331
+ * Add-ons S1a. Put a custom section on members in ONE undo step: insert its definition when the model does not
1332
+ * hold it yet, insert the evaluated section when absent, and point every member at it with its designation as
1333
+ * the profile. All or nothing: the draft is validated as a whole.
1334
+ *
1335
+ * A definition id is immutable: an id already in the model with another digest is `definition-id-taken`. A
1336
+ * section already in the model is reused only when it says exactly what the fresh evaluation says, so a stored
1337
+ * section that no longer matches its recipe is never adopted (`section-conflict`).
1338
+ */
1339
+ placeCustomSection({ definition, section, memberIds }) {
1340
+ return session.transact('place custom section', (doc) => {
1341
+ if (!definition || typeof definition.id !== 'string' || !section || typeof section.sectionId !== 'string') {
1342
+ throw new V2CommandError('custom-section-invalid', 'That custom section is missing its definition or its shape, so it cannot be placed. Ask the AI to rebuild it.');
1343
+ }
1344
+ const ids = [...new Set(memberIds || [])];
1345
+ if (!ids.length) throw new V2CommandError('custom-section-invalid', 'Select at least one member to put the custom section on.');
1346
+ const members = ids.map((id) => memberById(doc, id));
1347
+ const defs = Array.isArray(doc.section_definitions) ? doc.section_definitions : (doc.section_definitions = []);
1348
+ const storedDef = defs.find((d) => d && d.id === definition.id);
1349
+ if (storedDef && storedDef.digest !== definition.digest) {
1350
+ throw new V2CommandError('definition-id-taken', `The name ${definition.id} already belongs to a different custom section definition in this model. Ask the AI to save it under a new name.`);
1351
+ }
1352
+ if (!storedDef) defs.push(clone(definition));
1353
+ const sections = Array.isArray(doc.custom_sections) ? doc.custom_sections : (doc.custom_sections = []);
1354
+ const storedSection = sections.find((s) => s && s.sectionId === section.sectionId);
1355
+ if (storedSection && resultDigest(storedSection) !== resultDigest(section)) {
1356
+ throw new V2CommandError('section-conflict', 'This model already holds that custom section with a different shape. Ask the AI to check which one is right.');
1357
+ }
1358
+ if (!storedSection) sections.push(clone(section));
1359
+ for (const member of members) {
1360
+ member.customSectionId = section.sectionId;
1361
+ if (member.profile !== section.designation) delete member.profileBasis;
1362
+ member.profile = section.designation;
1363
+ }
1364
+ return { changedIds: ids, structural: true, value: section.sectionId };
1365
+ });
1366
+ },
1367
+
1368
+ /** Add-ons S1a. Record (or withdraw) the person's "Proceed on assumption" for a section FloLess cannot vouch for. */
1369
+ setCustomSectionAssumption(sectionId, assumption) {
1370
+ return session.transact('custom section assumption', (doc) => {
1371
+ const section = (doc.custom_sections || []).find((s) => s && s.sectionId === sectionId);
1372
+ if (!section) throw new V2CommandError('custom-section-missing', 'That custom section is no longer in this model. Reopen the member and try again.');
1373
+ if (assumption) section.assumption = clone(assumption);
1374
+ else delete section.assumption;
1375
+ return { structural: true };
1376
+ });
1377
+ },
1378
+
1276
1379
  patchMemberBrace(memberId, patch) {
1277
1380
  return session.transact('patch member brace', (doc) => {
1278
1381
  const member = memberById(doc, memberId);
@@ -1612,14 +1715,14 @@ export function createV2CommandSession(model, options = {}) {
1612
1715
 
1613
1716
  mergeMembers(viewId, memberIds, mergedPx) {
1614
1717
  return session.transact('merge members', (doc) => {
1615
- const id = mergeMemberGroup(doc, viewId, memberIds, mergedPx, mintId, resolveSection);
1718
+ const id = mergeMemberGroup(doc, viewId, memberIds, mergedPx, mintId, resolveSection, defaultMaterial);
1616
1719
  return { changedIds: [id], structural: true, value: id };
1617
1720
  });
1618
1721
  },
1619
1722
 
1620
1723
  mergeMemberGroups(viewId, groups) {
1621
1724
  return session.transact('merge member groups', (doc) => {
1622
- const made = groups.map((group) => mergeMemberGroup(doc, viewId, group.memberIds, group.wp, mintId, resolveSection));
1725
+ const made = groups.map((group) => mergeMemberGroup(doc, viewId, group.memberIds, group.wp, mintId, resolveSection, defaultMaterial));
1623
1726
  return { changedIds: made, structural: true, value: made };
1624
1727
  });
1625
1728
  },
@@ -228,7 +228,7 @@ export function memberProperties(member) {
228
228
  role: member.role || 'beam',
229
229
  provenance: member.provenance,
230
230
  };
231
- for (const key of ['material', 'memberType', 'position', 'positionH', 'positionOffset', 'positionHOffset', 'positionBasis', 'rot', 'section', 'bf', 'rfi', 'mf', 'verified', 'source', 'brace']) {
231
+ for (const key of ['profileBasis', 'material', 'memberType', 'position', 'positionH', 'positionOffset', 'positionHOffset', 'positionBasis', 'rot', 'section', 'customSectionId', 'bf', 'rfi', 'mf', 'verified', 'source', 'brace']) {
232
232
  if (member[key] !== undefined) meta[key] = clone(member[key]);
233
233
  }
234
234
  const endMeta = Array.isArray(member.ends) ? member.ends : [{}, {}];
@@ -6,62 +6,7 @@
6
6
  */
7
7
 
8
8
  import { rawPlanViewId } from './steel-plan-view-id.js';
9
-
10
- const SHA256_K = Object.freeze([
11
- 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
12
- 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
13
- 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
14
- 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
15
- 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
16
- 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
17
- 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
18
- 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
19
- ]);
20
-
21
- const rotateRight = (value, bits) => (value >>> bits) | (value << (32 - bits));
22
-
23
- /** Synchronous SHA-256 for the two tiny lineage tokens projected during a render. */
24
- function sha256Hex(text) {
25
- const input = new TextEncoder().encode(text);
26
- const byteLength = Math.ceil((input.length + 9) / 64) * 64;
27
- const bytes = new Uint8Array(byteLength);
28
- bytes.set(input);
29
- bytes[input.length] = 0x80;
30
- const view = new DataView(bytes.buffer);
31
- const bitLength = input.length * 8;
32
- view.setUint32(byteLength - 8, Math.floor(bitLength / 0x100000000));
33
- view.setUint32(byteLength - 4, bitLength >>> 0);
34
- const hash = new Uint32Array([
35
- 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
36
- 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
37
- ]);
38
- const words = new Uint32Array(64);
39
- for (let offset = 0; offset < byteLength; offset += 64) {
40
- for (let i = 0; i < 16; i++) words[i] = view.getUint32(offset + i * 4);
41
- for (let i = 16; i < 64; i++) {
42
- const a = words[i - 15];
43
- const b = words[i - 2];
44
- const s0 = rotateRight(a, 7) ^ rotateRight(a, 18) ^ (a >>> 3);
45
- const s1 = rotateRight(b, 17) ^ rotateRight(b, 19) ^ (b >>> 10);
46
- words[i] = (words[i - 16] + s0 + words[i - 7] + s1) >>> 0;
47
- }
48
- let [a, b, c, d, e, f, g, h] = hash;
49
- for (let i = 0; i < 64; i++) {
50
- const s1 = rotateRight(e, 6) ^ rotateRight(e, 11) ^ rotateRight(e, 25);
51
- const choice = (e & f) ^ (~e & g);
52
- const t1 = (h + s1 + choice + SHA256_K[i] + words[i]) >>> 0;
53
- const s0 = rotateRight(a, 2) ^ rotateRight(a, 13) ^ rotateRight(a, 22);
54
- const majority = (a & b) ^ (a & c) ^ (b & c);
55
- const t2 = (s0 + majority) >>> 0;
56
- h = g; g = f; f = e; e = (d + t1) >>> 0; d = c; c = b; b = a; a = (t1 + t2) >>> 0;
57
- }
58
- hash[0] = (hash[0] + a) >>> 0; hash[1] = (hash[1] + b) >>> 0;
59
- hash[2] = (hash[2] + c) >>> 0; hash[3] = (hash[3] + d) >>> 0;
60
- hash[4] = (hash[4] + e) >>> 0; hash[5] = (hash[5] + f) >>> 0;
61
- hash[6] = (hash[6] + g) >>> 0; hash[7] = (hash[7] + h) >>> 0;
62
- }
63
- return [...hash].map((word) => word.toString(16).padStart(8, '0')).join('');
64
- }
9
+ import { sha256Hex } from './sha256-sync.js';
65
10
 
66
11
  const endpointLineageId = (observationId, observationEnd) =>
67
12
  `sha256:${sha256Hex(`floless:endpoint-lineage:v1\0${JSON.stringify([observationId, observationEnd])}`)}`;
@@ -155,7 +155,7 @@
155
155
  pv.removeAttribute('aria-busy');
156
156
  const data = answer ? answer.data : {};
157
157
  if (answer && /^step-name-|^step-not-found$/.test(String(data.code))) {
158
- nameError(data.error || 'That name can’t be used here. Try another.', data.suggestedId);
158
+ nameError(personText(data) || 'That name can’t be used here. Try another.', data.suggestedId);
159
159
  pv.textContent = '';
160
160
  setReady(false, 'Choose a free name first.');
161
161
  return;
@@ -163,7 +163,8 @@
163
163
  // "Check again" only where trying again can help (a failed check, a lost connection); an older AWARE or a file FloLess
164
164
  // will not edit is answered with its sentence alone.
165
165
  const retryable = !answer || !data.code || ['step-rename-failed', 'step-names-unchecked', 'step-rename-preview-stale'].includes(String(data.code));
166
- pv.innerHTML = esc(data.error || 'FloLess couldn’t check the change just now.')
166
+ // #3097: the server's sentence only when it wrote one for the person, never a reply it marked diagnostic.
167
+ pv.innerHTML = esc(personText(data) || 'FloLess couldn’t check the change just now.')
167
168
  + (retryable ? ' <button type="button" class="sr-retry" data-sr-retry data-command-id="shell.step-rename-retry">Check again</button>' : '');
168
169
  setReady(false, retryable ? 'FloLess needs to check the change first.' : 'This rename can’t go ahead here.');
169
170
  }
@@ -45,6 +45,7 @@
45
45
  <div id="revitPanelTabs" hidden>
46
46
  <div id="revitClipListHost" class="revit-clip-list-host"></div>
47
47
  <div id="teklaAuditHost" class="tekla-audit-host" hidden></div>
48
+ <div id="teklaChangesHost" class="tekla-audit-host tekla-changes-host" aria-label="Changes between saved states" hidden></div>
48
49
  </div>
49
50
  <div id="loadingState" class="viewport-state" aria-live="polite">
50
51
  <span class="state-spinner" aria-hidden="true"></span>
@@ -539,7 +539,7 @@
539
539
  shown.set(body.fresh.id, { p: body.fresh, busy: '', error: '' });
540
540
  focusId = body.fresh.id;
541
541
  freshId = body.fresh.id;
542
- announce(restarted ? 'Request shown again as it works now. Nothing has run.' : body.error || 'It changed after your terminal asked. The current request is shown first.');
542
+ announce(restarted ? 'Request shown again as it works now. Nothing has run.' : personText(body) || 'It changed after your terminal asked. The current request is shown first.');
543
543
  } else {
544
544
  if (body.proposal) entry.p = body.proposal;
545
545
  entry.error = status === 404 ? 'FloLess no longer has that request. Ask your terminal to try again.'