@floless/app 0.154.0 → 0.155.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 (47) hide show
  1. package/dist/floless-server.cjs +49492 -37984
  2. package/dist/schemas/steel.model.v2.schema.json +19 -5
  3. package/dist/skills/floless-app-onboarding/SKILL.md +22 -13
  4. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +12 -8
  5. package/dist/skills/floless-app-steel-model/SKILL.md +23 -2
  6. package/dist/skills/floless-app-steel-takeoff/SKILL.md +158 -65
  7. package/dist/skills/floless-app-workflows/SKILL.md +23 -5
  8. package/dist/skills/floless-app-workflows/references/blender-exec.md +183 -0
  9. package/dist/skills/floless-app-workflows/references/dev-server-and-run-trace.md +27 -12
  10. package/dist/templates/blender-construction-sequence.flo +96 -0
  11. package/dist/web/agents.js +33 -13
  12. package/dist/web/app.css +275 -33
  13. package/dist/web/aware.js +745 -82
  14. package/dist/web/chat-question-card.js +477 -0
  15. package/dist/web/chat.css +177 -12
  16. package/dist/web/chat.js +1537 -717
  17. package/dist/web/commands-shell.js +424 -7
  18. package/dist/web/commands-steel.js +105 -4
  19. package/dist/web/guide.js +4 -3
  20. package/dist/web/index.html +96 -7
  21. package/dist/web/instructor.js +10 -9
  22. package/dist/web/left-pane.js +40 -3
  23. package/dist/web/media-player.js +234 -0
  24. package/dist/web/model-editor-contract.js +2 -0
  25. package/dist/web/model-editor-revit-adapter.js +1 -0
  26. package/dist/web/model-editor-steel-adapter.js +89 -1
  27. package/dist/web/model-panel-bridge.js +16 -2
  28. package/dist/web/model-view-query.js +590 -0
  29. package/dist/web/model-viewport-revit-adapter.js +15 -1
  30. package/dist/web/model-viewport-toolbar.js +5 -2
  31. package/dist/web/pages.js +592 -0
  32. package/dist/web/panels.js +2 -1
  33. package/dist/web/revit-editor.js +181 -16
  34. package/dist/web/run-progress.js +193 -0
  35. package/dist/web/run-strip.js +173 -0
  36. package/dist/web/steel-3d-core.js +70 -0
  37. package/dist/web/steel-editor.html +2751 -219
  38. package/dist/web/steel-frames-core.js +958 -0
  39. package/dist/web/steel-last-seen.js +315 -0
  40. package/dist/web/steel-marks-core.js +530 -0
  41. package/dist/web/steel-model-slim.js +95 -0
  42. package/dist/web/steel-model-v2-client-validation.js +14 -2
  43. package/dist/web/steel-model-v2-commands.js +258 -27
  44. package/dist/web/steel-model-v2-projection.js +78 -18
  45. package/dist/web/steel-read-confidence.js +11 -2
  46. package/dist/web/workspaces.js +416 -26
  47. package/package.json +3 -2
@@ -0,0 +1,173 @@
1
+ // Live run progress (#2228): the DOM half. One renderer for both places a long run shows progress —
2
+ // the run strip above the canvas (an ordinary Run) and the report overlay under the working Flo (a
3
+ // report Run) — so their words cannot drift. The words themselves come from web/run-progress.js.
4
+ //
5
+ // The view never decides anything: aware.js feeds it the `node-progress` records the server relays and
6
+ // tells it how the run ended. It repaints once a second so the elapsed clock and the "no update for"
7
+ // line move while the producer is quiet — the honest liveness signal, instead of fake bar movement.
8
+ // A plain script (no import/export); its one global is `flolessRunProgressView`.
9
+
10
+ (function () {
11
+ const ANNOUNCE_MIN_MS = 30_000;
12
+
13
+ function el(tag, cls, text) {
14
+ const n = document.createElement(tag);
15
+ if (cls) n.className = cls;
16
+ if (text != null) n.textContent = text;
17
+ return n;
18
+ }
19
+
20
+ /**
21
+ * opts: { size, hat, fallbackHeadline, startedAt, stop: { onClick, commandId } | null, now }
22
+ * returns { root, apply(rec), finish(outcome, extra), destroy() }
23
+ */
24
+ function create(opts = {}) {
25
+ const now = opts.now || (() => Date.now());
26
+ const st = rpCreate(typeof opts.startedAt === 'number' ? opts.startedAt : now());
27
+ const root = el('div', 'rp-view');
28
+ root.dataset.state = 'running';
29
+
30
+ const flo = el('span', 'rp-flo');
31
+ flo.setAttribute('aria-hidden', 'true');
32
+ let avatar = null;
33
+ if (typeof floAvatar === 'function') avatar = floAvatar(flo, { size: opts.size || 28, mood: 'working', hat: !!opts.hat });
34
+ else flo.classList.add('spinner');
35
+
36
+ const text = el('div', 'rp-text');
37
+ const headline = el('div', 'rp-headline');
38
+ const detail = el('div', 'rp-detail');
39
+ text.append(headline, detail);
40
+
41
+ const elapsed = el('span', 'rp-elapsed');
42
+ elapsed.dataset.tip = 'Elapsed';
43
+
44
+ const actions = el('div', 'rp-actions');
45
+ let stopBtn = null;
46
+ if (opts.stop) {
47
+ stopBtn = el('button', 'rp-stop run-stop-btn', '■ Stop run');
48
+ stopBtn.type = 'button';
49
+ stopBtn.dataset.commandId = opts.stop.commandId;
50
+ stopBtn.addEventListener('click', () => {
51
+ stopBtn.disabled = true;
52
+ stopBtn.textContent = 'Stopping…';
53
+ opts.stop.onClick();
54
+ });
55
+ actions.append(stopBtn);
56
+ }
57
+
58
+ const row = el('div', 'rp-row');
59
+ row.append(flo, text, elapsed, actions);
60
+
61
+ const bar = el('div', 'rp-bar');
62
+ bar.setAttribute('role', 'progressbar');
63
+ bar.setAttribute('aria-label', 'Run progress');
64
+ bar.setAttribute('aria-valuemin', '0');
65
+ const fill = el('div', 'rp-fill');
66
+ bar.append(fill);
67
+
68
+ // Spoken updates: state changes, and 25% milestones no faster than every 30 s — never per frame.
69
+ const live = el('div', 'rp-live sr-only');
70
+ live.setAttribute('role', 'status');
71
+ live.setAttribute('aria-live', 'polite');
72
+
73
+ root.append(row, bar, live);
74
+
75
+ let lastKind = 'running';
76
+ let lastPass = 0;
77
+ let lastMilestone = -1;
78
+ let lastAnnounceAt = 0;
79
+ let lastHeadline = '';
80
+ let ended = false;
81
+ const announce = (msg, force) => {
82
+ const t = now();
83
+ if (!force && t - lastAnnounceAt < ANNOUNCE_MIN_MS) return;
84
+ lastAnnounceAt = t;
85
+ live.textContent = msg;
86
+ };
87
+
88
+ function paint() {
89
+ if (ended) return;
90
+ const v = rpView(st, now(), opts.fallbackHeadline);
91
+ headline.textContent = v.headline;
92
+ detail.textContent = v.detail;
93
+ detail.hidden = !v.detail;
94
+ elapsed.textContent = v.elapsed;
95
+ root.dataset.state = v.kind;
96
+ if (v.fraction === null) {
97
+ bar.classList.add('rp-indeterminate');
98
+ bar.removeAttribute('aria-valuenow');
99
+ bar.removeAttribute('aria-valuemax');
100
+ fill.style.width = '';
101
+ } else {
102
+ bar.classList.remove('rp-indeterminate');
103
+ bar.setAttribute('aria-valuemax', String(v.valueMax));
104
+ bar.setAttribute('aria-valuenow', String(v.valueNow));
105
+ if (v.passIndex !== lastPass) {
106
+ // A new pass restarts the bar at once, without animating backwards.
107
+ fill.classList.add('rp-no-anim');
108
+ fill.style.width = `${v.fraction * 100}%`;
109
+ void fill.offsetWidth;
110
+ fill.classList.remove('rp-no-anim');
111
+ } else {
112
+ fill.style.width = `${v.fraction * 100}%`;
113
+ }
114
+ }
115
+ bar.setAttribute('aria-valuetext', v.valueText);
116
+ if (v.kind !== lastKind) {
117
+ if (avatar) avatar.setMood(v.kind === 'running' ? 'working' : 'thinking', !!opts.hat);
118
+ if (v.kind === 'stalled') announce(`${v.headline}. Still running.`, true);
119
+ else if (v.kind === 'paused') announce('Live updates paused. The run is still going.', true);
120
+ else announce(`${v.headline}. Updates resumed.`, true);
121
+ lastKind = v.kind;
122
+ } else if (v.passIndex !== lastPass) {
123
+ announce(v.headline, true);
124
+ } else if (v.fraction !== null) {
125
+ const m = Math.floor(v.fraction * 4);
126
+ if (m > lastMilestone) { lastMilestone = m; if (m > 0) announce(`${v.headline}.`, false); }
127
+ } else if (v.headline !== lastHeadline && !lastHeadline) {
128
+ announce(v.headline, true);
129
+ }
130
+ if (v.passIndex !== lastPass) { lastPass = v.passIndex; lastMilestone = -1; }
131
+ lastHeadline = v.headline;
132
+ }
133
+
134
+ const ticker = setInterval(paint, 1000);
135
+ paint();
136
+
137
+ return {
138
+ root,
139
+ apply(rec) {
140
+ if (ended) return;
141
+ rpApply(st, rec, now());
142
+ paint();
143
+ },
144
+ /** outcome: 'ok' | 'failed' | 'stopped' | 'not-run' | 'unknown' (ended unheard). */
145
+ finish(outcome) {
146
+ if (ended) return;
147
+ ended = true;
148
+ clearInterval(ticker);
149
+ const line = rpEndText(st, outcome, now());
150
+ headline.textContent = line;
151
+ detail.textContent = '';
152
+ detail.hidden = true;
153
+ root.dataset.state = outcome === 'ok' ? 'done' : outcome === 'stopped' || outcome === 'not-run' || outcome === 'unknown' ? 'stopped' : 'failed';
154
+ if (outcome === 'ok') {
155
+ bar.classList.remove('rp-indeterminate');
156
+ fill.style.width = '100%';
157
+ }
158
+ if (stopBtn) stopBtn.remove();
159
+ if (avatar) avatar.setMood(outcome === 'ok' ? 'success' : outcome === 'failed' ? 'warning' : 'idle', false);
160
+ live.setAttribute('role', outcome === 'failed' ? 'alert' : 'status');
161
+ live.textContent = line;
162
+ },
163
+ destroy() {
164
+ ended = true;
165
+ clearInterval(ticker);
166
+ if (avatar && typeof avatar.destroy === 'function') avatar.destroy();
167
+ root.remove();
168
+ },
169
+ };
170
+ }
171
+
172
+ window.flolessRunProgressView = { create };
173
+ })();
@@ -1080,6 +1080,76 @@ export function sheetIncludesElevation(fromZ, toZ, elevMm, tol = MODEL_V2_TOL.CU
1080
1080
  return elevMm >= Math.min(a, b) - tol && elevMm <= Math.max(a, b) + tol;
1081
1081
  }
1082
1082
 
1083
+ /**
1084
+ * How far below a plan's cut level a column's TOP may sit and still be drawn on that plan as "column
1085
+ * below" (#2214). Drafting convention: a framing plan shows the column under the floor, dashed, at the end
1086
+ * of the beam that lands on it — and the real top is rarely exactly at the cut (Take 5's stair column stops
1087
+ * 6" = 152.4 mm under it).
1088
+ *
1089
+ * NEEDS OWNER, and deliberately NOT a member of the frozen `MODEL_V2_TOL`: that table is contract
1090
+ * semantics ("what displays, merges or refuses"), while this is a display convention a detailer may want
1091
+ * different. 12" is the conservative default — it covers the reported 6" case with margin, and a column that
1092
+ * ends further below than that is never guessed onto a sheet (a person adds it with "Add to this view", or
1093
+ * the read binds it). Smaller means a missed column that "Add to this view" fixes; larger means dashed
1094
+ * clutter that cannot be removed from the sheet.
1095
+ */
1096
+ export const COLUMN_BELOW_REACH_MM = FT_TO_MM; // 12" = one foot, from the one definition of the foot (steel-units.js), not a second 304.8
1097
+
1098
+ /**
1099
+ * The most a person may set the reach to: 100 ft. A column that ends further under a floor than that is not "the
1100
+ * column below" this floor in any building, so a larger number is a typing mistake (a bare 8839 in a project that
1101
+ * reads millimetres, entered as inches), and the editor says so instead of accepting it. NEEDS OWNER: a judgement
1102
+ * call, kept as one named constant so changing it is one edit.
1103
+ */
1104
+ export const COLUMN_BELOW_REACH_MAX_MM = 100 * FT_TO_MM;
1105
+
1106
+ /** True when `mm` is a reach the project may store: a finite number from 0 (no column below is drawn) to the maximum. */
1107
+ export function isValidColumnBelowReach(mm) {
1108
+ return typeof mm === 'number' && Number.isFinite(mm) && mm >= 0 && mm <= COLUMN_BELOW_REACH_MAX_MM;
1109
+ }
1110
+
1111
+ /**
1112
+ * The reach THIS project uses (the owner's 2026-10-12 decision: a project setting, saved with the model, so every
1113
+ * sheet, "See what changed" and Review & approve agree). The root `column_below_reach_mm`, or the default
1114
+ * `COLUMN_BELOW_REACH_MM` when the model states none. A stored value that is not a legal reach (a hand-edited file) also
1115
+ * reads as the default rather than breaking a sheet: the schema refuses it on write, and a drawing that quietly keeps
1116
+ * working is the safer failure for a display convention. THE one resolver: the browser's `memberPresence` and the
1117
+ * server's `membersOnSheet` both ask it, so the two cannot read the setting differently.
1118
+ */
1119
+ export function columnBelowReachOf(doc) {
1120
+ const stored = doc && typeof doc === 'object' ? doc.column_below_reach_mm : undefined;
1121
+ return isValidColumnBelowReach(stored) ? stored : COLUMN_BELOW_REACH_MM;
1122
+ }
1123
+
1124
+ /**
1125
+ * Where a column stands against a plan's cut level (#2214). THE one place the question is answered — the
1126
+ * browser projection's `memberPresence` and the server's `membersOnSheet` both ask this, so the two cannot
1127
+ * disagree about which columns a sheet draws.
1128
+ *
1129
+ * - 'crossing' — the cut passes through the column (exactly `sheetIncludesElevation`, tolerance included).
1130
+ * - 'below' — the column ends under the cut by more than that tolerance and by no more than `reach`.
1131
+ * - 'far-below' — it ends further under the cut than `reach`: never drawn by this rule.
1132
+ * - 'above' — it starts over the cut.
1133
+ * - 'unknown' — an endpoint elevation or the cut is not a known number. An unknown elevation is an RFI,
1134
+ * not a position, so it is never guessed onto a sheet (the §5.3 "nearest sheet" rule).
1135
+ *
1136
+ * Orientation-agnostic, like `sheetIncludesElevation`: the top is the higher of the two endpoints.
1137
+ */
1138
+ export function columnCutRelation(fromZ, toZ, cutMm, reach = COLUMN_BELOW_REACH_MM) {
1139
+ const a = knownZ(fromZ), b = knownZ(toZ);
1140
+ if (a === null || b === null || !Number.isFinite(cutMm)) return 'unknown';
1141
+ if (sheetIncludesElevation(fromZ, toZ, cutMm)) return 'crossing';
1142
+ const top = Math.max(a, b);
1143
+ if (cutMm > top) {
1144
+ // The gap is compared at nanometre resolution: a top and a cut that are exactly 12" apart on the drawing
1145
+ // differ by 304.8000000000002 after the inch-to-mm arithmetic that produced them, and "exactly at the
1146
+ // reach" must not flip on that noise.
1147
+ const gap = Math.round((cutMm - top) * 1e6) / 1e6;
1148
+ return gap <= reach ? 'below' : 'far-below';
1149
+ }
1150
+ return 'above';
1151
+ }
1152
+
1083
1153
  /** Apply a similarity transform (from registerSheet) to a local [x,y] → world mm. */
1084
1154
  export function applySimilarity(t, p) {
1085
1155
  if (!t || !Array.isArray(p)) return null;