@floless/app 0.168.0 → 0.169.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 (49) hide show
  1. package/cli-actions.mjs +8 -1
  2. package/dist/floless-server.cjs +83100 -68895
  3. package/dist/skills/floless-app-rfi/SKILL.md +4 -2
  4. package/dist/templates/college-phase-exporter.flo +7 -2
  5. package/dist/templates/trimble-list-projects.flo +10 -2
  6. package/dist/web/agent-steps.js +2 -2
  7. package/dist/web/agents.js +49 -13
  8. package/dist/web/app.css +44 -3
  9. package/dist/web/app.js +47 -4
  10. package/dist/web/aware-update-client.js +4 -4
  11. package/dist/web/aware.js +401 -31
  12. package/dist/web/chat.css +10 -0
  13. package/dist/web/chat.js +223 -22
  14. package/dist/web/commands-drawing-check.js +3 -0
  15. package/dist/web/commands-shell.js +111 -4
  16. package/dist/web/commands-steel.js +9 -2
  17. package/dist/web/commands-vector.js +69 -0
  18. package/dist/web/drawing-check-editor.html +10 -0
  19. package/dist/web/drawing-check-editor.js +502 -182
  20. package/dist/web/failure-copy.js +20 -2
  21. package/dist/web/flo-3d.js +310 -0
  22. package/dist/web/flo-card.js +72 -0
  23. package/dist/web/guide.js +3 -1
  24. package/dist/web/index.html +26 -4
  25. package/dist/web/instructor.js +3 -0
  26. package/dist/web/model-editor-steel-adapter.js +41 -1
  27. package/dist/web/model-viewport-toolbar.js +11 -0
  28. package/dist/web/pages.js +17 -14
  29. package/dist/web/panels.js +1 -1
  30. package/dist/web/project-history.js +2 -2
  31. package/dist/web/project-modules.js +3 -3
  32. package/dist/web/project-reconciliation.js +1 -1
  33. package/dist/web/project-rfis.js +2 -2
  34. package/dist/web/project-workflows.js +6 -4
  35. package/dist/web/renderers.js +6 -0
  36. package/dist/web/report-csp.js +68 -0
  37. package/dist/web/revit-editor.js +1 -1
  38. package/dist/web/run-history.js +2 -3
  39. package/dist/web/steel-3d-flo.js +309 -0
  40. package/dist/web/steel-3d-view.js +159 -0
  41. package/dist/web/steel-editor.html +130 -9
  42. package/dist/web/terminal-requests.js +78 -0
  43. package/dist/web/tool-updates.js +3 -2
  44. package/dist/web/vector-3d.html +1 -1
  45. package/dist/web/vector-editor.html +50 -8
  46. package/dist/web/workspace-root-management.js +1 -1
  47. package/dist/web/workspaces.js +626 -140
  48. package/launch.mjs +5 -0
  49. package/package.json +8 -8
@@ -108,7 +108,9 @@ function failureCopy(error, ctx) {
108
108
  const refused = failureSentence(c.nothingDone) || lead;
109
109
  const said = (s) => s.filter(Boolean).join(' ');
110
110
  const userMessage = typeof body.userMessage === 'string' ? body.userMessage.trim() : '';
111
- const reason = typeof body.reason === 'string' ? body.reason.trim() : '';
111
+ // #3097: a `diagnostic` reply's `reason` is what a tool printed (AWARE's stderr), kept for Technical details and the
112
+ // AI, never for the person's sentence.
113
+ const reason = typeof body.reason === 'string' && !body.diagnostic ? body.reason.trim() : '';
112
114
  if (kind === 'busy') {
113
115
  if (body.code === 'maintenance-busy' && typeof body.message === 'string' && body.message.trim()) {
114
116
  return { kind, type: 'warn', text: said([refused, failureSentence(body.message)]) };
@@ -134,6 +136,10 @@ function failureCopy(error, ctx) {
134
136
  // A refusal the server wrote for the person. Not for an unexpected failure: a 5xx is not a considered answer, and
135
137
  // the person is told the reason is unknown rather than a sentence that may describe something else (#2764).
136
138
  if (userMessage && kind !== 'unexpected') return { kind, type: 'warn', text: said([refused, failureSentence(userMessage)]) };
139
+ // #3097: a 4xx FloLess does not class (409 with no stale code, 412, 428, 429) is still a considered refusal, so its
140
+ // sentence is shown. The status alone proves no outcome, so it leads with what could not be done, not `nothingDone`.
141
+ const status = Number(error && error.status) || 0;
142
+ if (userMessage && status >= 400 && status < 500) return { kind, type: 'warn', text: said([lead, failureSentence(userMessage)]) };
137
143
  if (kind === 'outdated') {
138
144
  return { kind, type: 'err', text: said([refused, 'The AWARE runtime on this computer is too old for it.', 'Update AWARE, then try again.']) };
139
145
  }
@@ -176,6 +182,18 @@ function failureParts(error, ctx) {
176
182
  return { kind: copy.kind, type: copy.type, headline: copy.text.slice(0, cut + 1), detail: copy.text.slice(cut + 1).trim() };
177
183
  }
178
184
 
185
+ /**
186
+ * #3097 slice 2: the server's own sentence for the person, when it wrote one. `userMessage` is always for a person;
187
+ * `error` is too, unless the server marked it `diagnostic` (raw exception text on a 5xx, written for a developer).
188
+ * '' means the server said nothing a person should read, and the caller falls back to failureCopy.
189
+ */
190
+ function personText(body) {
191
+ if (!body || typeof body !== 'object') return '';
192
+ if (typeof body.userMessage === 'string' && body.userMessage.trim()) return body.userMessage.trim();
193
+ if (!body.diagnostic && typeof body.error === 'string' && body.error.trim()) return body.error.trim();
194
+ return '';
195
+ }
196
+
179
197
  if (typeof module !== 'undefined' && module.exports) {
180
- module.exports = { failureKind, failureCopy, failureParts, FAILURE_BUSY_CODES, FAILURE_BUSY_WORK };
198
+ module.exports = { failureKind, failureCopy, failureParts, personText, FAILURE_BUSY_CODES, FAILURE_BUSY_WORK };
181
199
  }
@@ -0,0 +1,310 @@
1
+ // Flo in 3D: the same Flo web/flo.js draws (the icon's node with pill eyes and the white hard hat), built as a
2
+ // small lacquered object that stands on a model and moves by hopping, with squash and stretch, as the design
3
+ // says it must (no body, no legs: docs/superpowers/specs/2026-10-07-flo-avatar-and-explainer-design.md).
4
+ // Everything Flo's face does (blink, glance, mood, hat tip) comes from floPose(), so the 2D and 3D Flo cannot
5
+ // drift. This module builds and moves Flo and nothing else: where Flo goes and which mood it shows is the
6
+ // caller's (web/steel-3d-flo.js), and it decides nothing about the model.
7
+ //
8
+ // Proportions are in units of r, the ring's centre-line radius, exactly as flo.js has them. Flo's own frame is
9
+ // Y up and faces +Z; the root group turns that into the scene's up axis, so a Z-up model works unchanged.
10
+
11
+ const HOP_MIN_S = 0.42, HOP_MAX_S = 0.95; // airtime, from a step to a leap across the model
12
+ const CROUCH_S = 0.12, LAND_S = 0.2; // anticipation before take-off, the settle after landing
13
+ const HELLO_S = 0.9; // one hat tip, as flo-avatar.js's Hello plays it
14
+ const STROKE = 0.29; // ring width / r (flo.js default)
15
+ const EYE_Z = 0.07; // how far the eyes stand proud of the face
16
+
17
+ // Flo in 3D wears the brand navy of the logo and the end cards (ring, eyes and hat ridge on a light face), not
18
+ // the 2D dark theme's lighter blue: the light face and white hat carry its outline on the dark 3D stage.
19
+ export const FLO_3D_COLORS = Object.freeze({ line: '#1e3a5f', fill: '#f1f5f9', hat: '#f1f5f9', pulse: '#c7d9ef' });
20
+
21
+ const clamp = (v, a = 0, b = 1) => Math.max(a, Math.min(b, v));
22
+ const easeOut = (u) => 1 - (1 - u) * (1 - u);
23
+ const bump = (u) => Math.sin(Math.PI * clamp(u));
24
+
25
+ // The hop as data, so it can be tested without a renderer: where Flo is (0..1 along the way, height in r) and
26
+ // how it squashes at time `s` into a hop that lasts `air` seconds. Before take-off it crouches, in the air it
27
+ // stretches along the way it is going, and on landing it squashes and springs back once.
28
+ export function floHopPose(s, air, rise) {
29
+ if (s < 0) {
30
+ const u = clamp(1 + s / CROUCH_S); // -CROUCH_S..0
31
+ const k = 0.22 * bump(u * 0.5 + 0.25) * u; // dips, holds, releases into the jump
32
+ return { along: 0, lift: 0, sx: 1 + k * 0.6, sy: 1 - k };
33
+ }
34
+ if (s < air) {
35
+ const u = s / air;
36
+ const stretch = 0.16 * bump(u) * (1 - Math.abs(2 * u - 1) * 0.6);
37
+ return { along: u, lift: 4 * rise * u * (1 - u), sx: 1 - stretch * 0.55, sy: 1 + stretch };
38
+ }
39
+ const u = clamp((s - air) / LAND_S);
40
+ const k = 0.26 * Math.exp(-5 * u) * Math.cos(u * Math.PI * 1.6);
41
+ return { along: 1, lift: 0, sx: 1 + k * 0.7, sy: 1 - k };
42
+ }
43
+
44
+ // How long a hop takes and how high it goes, from the distance in r. Short steps are quick and low; a leap
45
+ // across the model takes longer but never so long that the person waits for it.
46
+ // A step shorter than SHORT_R stays low and quick, so moving to the next member along reads as a shuffle
47
+ // rather than a leap; nothing rises more than 5 r, so a long hop stays in the frame it started in.
48
+ const SHORT_R = 4;
49
+ export function floHopShape(distR) {
50
+ const d = Math.max(0, distR);
51
+ if (d < SHORT_R) return { air: HOP_MIN_S * 0.75, rise: 0.4 + d * 0.15 };
52
+ const air = clamp(0.3 + 0.07 * Math.sqrt(d), HOP_MIN_S, HOP_MAX_S);
53
+ const rise = clamp(1.4 + d * 0.18, 1.4, 5);
54
+ return { air, rise };
55
+ }
56
+
57
+ export function createFlo3D(THREE, opts = {}) {
58
+ const pose = opts.floPose;
59
+ if (typeof pose !== 'function') throw new Error('createFlo3D needs flo.js floPose');
60
+ const up = (opts.up ?? new THREE.Vector3(0, 1, 0)).clone().normalize();
61
+ let r = opts.r ?? 300;
62
+ let mood = 'idle', hat = true, reduced = !!opts.reducedMotion;
63
+ const seed = opts.seed ?? 0;
64
+
65
+ // root: placed in the world, turned so its +Y is the scene's up. body: yaw toward the camera.
66
+ // squash: scales about Flo's feet (the bottom of the ring). Everything inside is built at r = 1 and scaled.
67
+ const root = new THREE.Group(); root.name = 'flo-3d'; root.userData.flo = true;
68
+ root.quaternion.setFromUnitVectors(new THREE.Vector3(0, 1, 0), up);
69
+ const body = new THREE.Group(); root.add(body);
70
+ const squash = new THREE.Group(); body.add(squash);
71
+ const unit = new THREE.Group(); unit.position.y = 1 + STROKE / 2; squash.add(unit); // the ring's outer edge rests on the feet
72
+
73
+ const mats = {
74
+ line: new THREE.MeshPhysicalMaterial({ roughness: 0.32, metalness: 0.05, clearcoat: 1, clearcoatRoughness: 0.18 }),
75
+ eye: new THREE.MeshPhysicalMaterial({ roughness: 0.22, metalness: 0, clearcoat: 1, clearcoatRoughness: 0.08 }),
76
+ face: new THREE.MeshStandardMaterial({ roughness: 0.75, metalness: 0 }),
77
+ hat: new THREE.MeshPhysicalMaterial({ roughness: 0.38, metalness: 0, clearcoat: 0.9, clearcoatRoughness: 0.25, transparent: true }),
78
+ ridge: new THREE.MeshPhysicalMaterial({ roughness: 0.32, metalness: 0.05, clearcoat: 1, transparent: true }),
79
+ pulse: new THREE.MeshBasicMaterial({ toneMapped: false }),
80
+ shadow: new THREE.MeshBasicMaterial({ transparent: true, depthWrite: false, opacity: 0.45, color: 0x000000 }),
81
+ ripple: new THREE.MeshBasicMaterial({ transparent: true, depthWrite: false, opacity: 0, side: THREE.DoubleSide, toneMapped: false }),
82
+ };
83
+ const geos = [];
84
+ const mesh = (g, m) => { geos.push(g); const o = new THREE.Mesh(g, m); o.userData.flo = true; return o; };
85
+
86
+ // The ring: a torus as thick as flo.js's stroke, with the face set just inside it in the background colour.
87
+ const tube = STROKE / 2, inner = 1 - tube;
88
+ unit.add(mesh(new THREE.TorusGeometry(1, tube, 28, 96), mats.line));
89
+ const face = mesh(new THREE.CylinderGeometry(inner + 0.01, inner + 0.01, 0.16, 64), mats.face);
90
+ face.rotation.x = Math.PI / 2; unit.add(face);
91
+
92
+ // Eyes: pills on both faces, so Flo never shows a blank back while it turns. Their size, gap and blink are
93
+ // floPose's numbers. The happy arc (success) is a half torus that replaces the pill.
94
+ const eyes = [];
95
+ for (const side of [1, -1]) for (const sx of [-1, 1]) {
96
+ const pill = mesh(new THREE.CapsuleGeometry(0.5, 1, 6, 18), mats.eye);
97
+ const arc = mesh(new THREE.TorusGeometry(1, 0.38, 10, 24, Math.PI), mats.eye);
98
+ const g = new THREE.Group(); g.add(pill, arc);
99
+ g.position.z = side * (0.08 + EYE_Z * 0.5);
100
+ if (side < 0) g.rotation.y = Math.PI;
101
+ unit.add(g); eyes.push({ g, pill, arc, sx: side * sx });
102
+ }
103
+
104
+ // The hard hat: dome, brim and the ridge over the top, sized to the ring as floDrawHat sizes it. It pivots
105
+ // near the brim's left end, so a tip reads as a tip.
106
+ const hatPivot = new THREE.Group(); hatPivot.position.set(-0.9, 0.8, 0); unit.add(hatPivot);
107
+ const hatG = new THREE.Group(); hatG.position.set(0.9, -0.8, 0); hatPivot.add(hatG);
108
+ const dome = mesh(new THREE.SphereGeometry(1, 48, 24, 0, Math.PI * 2, 0, Math.PI / 2), mats.hat);
109
+ dome.scale.set(0.958, 0.95, 0.9); dome.position.y = 0.96; hatG.add(dome);
110
+ const brim = mesh(new THREE.CylinderGeometry(1, 1, 1, 64), mats.hat);
111
+ brim.scale.set(1.25, 0.13, 1.08); brim.position.set(0, 0.95, 0.06); hatG.add(brim);
112
+ const ridge = mesh(new THREE.TorusGeometry(0.93, 0.085, 10, 40, Math.PI * 0.62), mats.ridge);
113
+ ridge.rotation.set(0, Math.PI / 2, Math.PI * 0.19); ridge.position.y = 0.96; ridge.scale.set(1, 1.02, 0.96);
114
+ hatG.add(ridge);
115
+
116
+ // Working / Thinking: a short arc of light that runs round the ring, as the 2D one does.
117
+ const orbitGeos = {};
118
+ const orbit = mesh(new THREE.BufferGeometry(), mats.pulse);
119
+ orbit.position.z = 0; unit.add(orbit);
120
+ function orbitArc(len) {
121
+ const key = len.toFixed(3);
122
+ if (!orbitGeos[key]) { orbitGeos[key] = new THREE.TorusGeometry(1, tube * 0.62, 10, 48, len); geos.push(orbitGeos[key]); }
123
+ return orbitGeos[key];
124
+ }
125
+
126
+ // Contact shadow and the landing ripple sit on the surface Flo stands on, outside the squash.
127
+ const shadowTex = radialTexture(THREE, [[0, 'rgba(0,0,0,0.55)'], [0.55, 'rgba(0,0,0,0.22)'], [1, 'rgba(0,0,0,0)']]);
128
+ mats.shadow.map = shadowTex; mats.shadow.color.set(0xffffff);
129
+ const shadow = mesh(new THREE.PlaneGeometry(2.6, 2.6), mats.shadow);
130
+ shadow.rotation.x = -Math.PI / 2; shadow.position.y = 0.01; shadow.renderOrder = 1; root.add(shadow);
131
+ const ripple = mesh(new THREE.RingGeometry(0.92, 1, 64), mats.ripple);
132
+ ripple.rotation.x = -Math.PI / 2; ripple.position.y = 0.012; ripple.renderOrder = 1; root.add(ripple);
133
+
134
+ for (const m of [shadow, ripple]) m.raycast = () => {};
135
+
136
+ const here = new THREE.Vector3(); // where Flo stands (world)
137
+ let hop = null; // { from, to, t0, air, rise, onLand, heading }
138
+ let hello = null; // t0 of a hat tip
139
+ let landAt = -Infinity; // when the last hop landed (ripple)
140
+ let lookYaw = 0, faceYaw = 0, lastTick = null;
141
+ const tmp = new THREE.Vector3(), tmp2 = new THREE.Vector3(), inv = new THREE.Quaternion();
142
+
143
+ function setColors(c) {
144
+ mats.line.color.set(c.line); mats.eye.color.set(c.line); mats.ridge.color.set(c.line);
145
+ mats.face.color.set(c.fill); mats.hat.color.set(c.hat); mats.pulse.color.set(c.pulse);
146
+ mats.ripple.color.set(c.pulse);
147
+ // A little of each colour as its own light, so under the model's lights the hat still reads as the brand's
148
+ // white and the ring as its blue, not as grey and navy (the shading stays: it is what makes Flo solid).
149
+ mats.line.emissive.set(c.line).multiplyScalar(0.3); mats.eye.emissive.set(c.line).multiplyScalar(0.35);
150
+ mats.ridge.emissive.set(c.line).multiplyScalar(0.3); mats.hat.emissive.set(c.hat).multiplyScalar(0.42);
151
+ mats.face.emissive.set(c.fill).multiplyScalar(0.3);
152
+ }
153
+ setColors(opts.colors ?? FLO_3D_COLORS);
154
+
155
+ function setSize(next) { r = next; root.scale.setScalar(r); }
156
+ setSize(r);
157
+
158
+ // Turn a world direction into Flo's upright frame and return its heading about up (0 = facing +Z).
159
+ function headingOf(worldDir) {
160
+ inv.copy(root.quaternion).invert();
161
+ tmp2.copy(worldDir).applyQuaternion(inv);
162
+ return Math.atan2(tmp2.x, tmp2.z);
163
+ }
164
+
165
+ function placeAt(p) { hop = null; here.copy(p); root.position.copy(p); }
166
+
167
+ // Hop to a world point. A hop already under way finishes where Flo is now, so a second click mid-air turns
168
+ // it in the air rather than snapping it back.
169
+ // o.drop: fall straight onto the point under gravity (Flo arriving from above) instead of an arc.
170
+ function hopTo(p, onLand, now, o = {}) {
171
+ const from = hop ? root.position.clone() : here.clone();
172
+ const distR = from.distanceTo(p) / r;
173
+ if (distR < 0.05) { if (onLand) onLand(); return; }
174
+ if (reduced) { placeAt(p); landAt = now; if (onLand) onLand(); return; }
175
+ const { air, rise } = floHopShape(distR);
176
+ // a hop that starts mid-air skips the crouch
177
+ hop = o.drop
178
+ ? { from, to: p.clone(), t0: now, air: clamp(Math.sqrt(distR) * 0.16, 0.25, 0.7), rise: 0, drop: true, onLand, heading: lookYaw }
179
+ : { from, to: p.clone(), t0: now + (hop ? 0 : CROUCH_S), air, rise, onLand, heading: headingOf(tmp.copy(p).sub(from)) };
180
+ }
181
+
182
+ function sayHello(now) { if (!reduced) hello = now; }
183
+
184
+ // Advance to `now` (seconds) for this camera. Returns how soon Flo next changes: 0 while it is moving, the
185
+ // seconds to its next blink or glance while it is idle, Infinity when nothing will change on its own.
186
+ function tick(now, camera) {
187
+ let sx = 1, sy = 1, moving = false;
188
+ if (hop) {
189
+ const s = now - hop.t0;
190
+ const hp = hop.drop && s < hop.air ? { along: s < 0 ? 0 : (s / hop.air) ** 2, lift: 0, sx: 0.9, sy: 1.12 } : floHopPose(s, hop.air, hop.rise);
191
+ tmp.lerpVectors(hop.from, hop.to, hp.along);
192
+ root.position.copy(tmp).addScaledVector(up, hp.lift * r);
193
+ sx = hp.sx; sy = hp.sy;
194
+ // the shadow stays on the line between the two ends; falling, it waits on the landing point
195
+ const above = hop.drop ? (1 - hp.along) * hop.from.distanceTo(hop.to) / r : hp.lift;
196
+ shadow.position.y = 0.01 - above;
197
+ const fade = 1 / (1 + above * 0.6);
198
+ shadow.scale.setScalar(0.6 + 0.4 * fade); mats.shadow.opacity = 0.45 * fade;
199
+ if (s >= hop.air && !hop.landed) {
200
+ hop.landed = true; here.copy(hop.to); landAt = now;
201
+ const cb = hop.onLand; if (cb) cb();
202
+ }
203
+ if (s >= hop.air + LAND_S) { hop = null; root.position.copy(here); shadow.position.y = 0.01; }
204
+ moving = true;
205
+ } else { shadow.position.y = 0.01; shadow.scale.setScalar(1); mats.shadow.opacity = 0.45; }
206
+ squash.scale.set(sx, sy, sx);
207
+
208
+ // Face the camera, turning about up only: Flo stands upright on the model. In the air it faces where it is going.
209
+ if (camera) {
210
+ camera.getWorldPosition(tmp); tmp.sub(root.position);
211
+ faceYaw = headingOf(tmp);
212
+ }
213
+ const want = hop && now >= hop.t0 && now < hop.t0 + hop.air ? hop.heading : faceYaw;
214
+ let d = want - lookYaw; d = Math.atan2(Math.sin(d), Math.cos(d));
215
+ // turn by time, not by frame, so a 144 Hz screen turns Flo no faster than a 60 Hz one (~90% in 0.15 s)
216
+ const dt = lastTick == null ? 1 : clamp(now - lastTick, 0, 0.25); lastTick = now;
217
+ lookYaw = reduced ? want : lookYaw + d * (1 - Math.exp(-dt * 16));
218
+ body.rotation.y = lookYaw;
219
+ if (Math.abs(d) > 0.01 && !reduced) moving = true;
220
+
221
+ const saying = hello != null && now - hello < HELLO_S;
222
+ if (hello != null && !saying) hello = null;
223
+ const m = saying ? 'hello' : mood;
224
+ const t = reduced ? 0.6 : saying ? now - hello : now;
225
+ const p = pose({ r: 1, stroke: STROKE, mood: m, t, hat, seed });
226
+ applyFace(p);
227
+
228
+ const ru = clamp((now - landAt) / 0.5);
229
+ mats.ripple.opacity = ru < 1 && !reduced ? 0.3 * (1 - ru) : 0;
230
+ ripple.scale.setScalar(0.9 + ru * 1.4);
231
+ if (ru < 1 && !reduced) moving = true;
232
+
233
+ if (moving || saying || (!reduced && (m === 'thinking' || m === 'working' || m === 'yourcall'))) return 0;
234
+ if (reduced) return Infinity;
235
+ return nextChange(now);
236
+ }
237
+
238
+ function applyFace(p) {
239
+ const e = p.eyes;
240
+ for (const eye of eyes) {
241
+ eye.g.position.x = eye.sx * e.sep + e.dx * Math.sign(eye.g.position.z);
242
+ eye.g.position.y = -e.dy; // canvas y grows down
243
+ const arc = e.kind === 'arc';
244
+ eye.pill.visible = !arc; eye.arc.visible = arc;
245
+ if (arc) { eye.arc.scale.setScalar(e.w * 0.9); eye.arc.position.y = -e.h * 0.1; }
246
+ else {
247
+ const h = Math.max(e.h, e.w * 0.3);
248
+ // a capsule of radius 0.5 and length 1 is 2 tall and 1 wide
249
+ eye.pill.scale.set(e.w, h / 2, e.w * 0.55);
250
+ }
251
+ }
252
+ const h = p.hat;
253
+ hatPivot.visible = !!h;
254
+ if (h) {
255
+ hatPivot.rotation.z = -h.rot;
256
+ hatPivot.position.y = 0.8 - h.dy + h.lift * 2.2;
257
+ const a = 1 - clamp((h.lift - 0.5) / 0.5);
258
+ mats.hat.opacity = a; mats.ridge.opacity = a;
259
+ }
260
+ orbit.visible = !!p.orbit;
261
+ if (p.orbit) { orbit.geometry = orbitArc(p.orbit.len); orbit.rotation.z = -p.orbit.a - p.orbit.len; }
262
+ }
263
+
264
+ // The idle face changes only at a blink or a glance (flo.js: blink every 3.4 s at 1.6 s, glance every 1.5 s
265
+ // of a 5 s cycle), so between those the caller need not draw at all.
266
+ function nextChange(now) {
267
+ const cands = [];
268
+ const b = ((now + seed - 1.6) % 3.4 + 3.4) % 3.4; // seconds since the blink began
269
+ cands.push(b < 0.14 ? 0 : 3.4 - b);
270
+ const g = ((now % 5) + 5) % 5;
271
+ cands.push(g < 1.5 ? 1.5 - g : g < 3 ? 3 - g : g < 4.5 ? 4.5 - g : 5 - g);
272
+ return Math.max(0, Math.min(...cands));
273
+ }
274
+
275
+ function setMood(m) { mood = m; }
276
+ function setHat(on) { hat = !!on; }
277
+ function setReducedMotion(on) {
278
+ reduced = !!on;
279
+ if (on && hop) { const cb = hop.landed ? null : hop.onLand; placeAt(hop.to); if (cb) cb(); } // land now, and say so once
280
+ }
281
+ function isBusy() { return !!hop || hello != null; }
282
+
283
+ // Did the pointer hit Flo? The caller owns picking; this lets it give a click on Flo to Flo.
284
+ function hit(raycaster) {
285
+ const hits = raycaster.intersectObject(squash, true);
286
+ return hits.length > 0;
287
+ }
288
+
289
+ function dispose() {
290
+ root.removeFromParent();
291
+ for (const g of geos) g.dispose();
292
+ for (const m of Object.values(mats)) m.dispose();
293
+ shadowTex.dispose();
294
+ }
295
+
296
+ return {
297
+ object: root, get r() { return r; }, get position() { return here; },
298
+ setColors, setSize, setMood, setHat, setReducedMotion, placeAt, hopTo, sayHello, tick, hit, isBusy, dispose,
299
+ get mood() { return mood; },
300
+ };
301
+ }
302
+
303
+ function radialTexture(THREE, stops) {
304
+ const n = 128, cv = document.createElement('canvas'); cv.width = cv.height = n;
305
+ const c = cv.getContext('2d'), g = c.createRadialGradient(n / 2, n / 2, 0, n / 2, n / 2, n / 2);
306
+ for (const [at, col] of stops) g.addColorStop(at, col);
307
+ c.fillStyle = g; c.fillRect(0, 0, n, n);
308
+ const tex = new THREE.CanvasTexture(cv); tex.colorSpace = THREE.SRGBColorSpace;
309
+ return tex;
310
+ }
@@ -0,0 +1,72 @@
1
+ // Flo's card on the steel model (3D): when Flo lands on a member, a small card beside Flo's head says what that
2
+ // member is. The person chooses which details it shows (3D toolbar → Labels → Flo); this decides what the card says
3
+ // from those choices and the member's already-formatted values, and nothing else. The 3D view draws it
4
+ // (web/steel-3d-view.js) and the editor supplies the values from its property registry (PROP_DEFS), so a value on
5
+ // the card is always the one Properties and the property labels show.
6
+ //
7
+ // The card's shape: a caption (type · mark), a headline (the profile), then one row per other detail. A detail the
8
+ // member has no value for is left out rather than printed as a dash, which would read as missing data.
9
+ //
10
+ // With several members selected the card speaks for the whole selection, as the Properties pane does: a detail
11
+ // they all share shows its value, one that differs shows Varies, and one none of them has is left out. The caption
12
+ // then leads with how many are selected, so the card is never read as being about the one member Flo stands on.
13
+ (function (root) {
14
+ // The details on offer, in the order the card shows them. Keys are PROP_DEFS keys.
15
+ const FLO_CARD_FIELDS = ['type', 'mark', 'profile', 'length', 'weight', 'col_tos', 'col_bos', 'tos_start', 'tos_end', 'verified', 'id'];
16
+ const FLO_CARD_DEFAULT = ['type', 'mark', 'profile', 'length', 'weight'];
17
+ const CAPTION = ['type', 'mark'];
18
+ const STORE_KEY = 'steel:floCard:v2';
19
+ const VARIES = 'Varies';
20
+
21
+ // A stored choice, kept to the details this build offers and in the card's own order. Anything that is not a
22
+ // list (nothing stored yet, or a damaged value) is the default; an empty list is a real choice (an empty card
23
+ // is simply not shown).
24
+ function sanitizeFloCardFields(v) {
25
+ if (!Array.isArray(v)) return FLO_CARD_DEFAULT.slice();
26
+ return FLO_CARD_FIELDS.filter((k) => v.includes(k));
27
+ }
28
+
29
+ function readFloCardFields(storage) {
30
+ try { const raw = storage && storage.getItem(STORE_KEY); return sanitizeFloCardFields(raw ? JSON.parse(raw) : null); }
31
+ catch { return FLO_CARD_DEFAULT.slice(); }
32
+ }
33
+
34
+ function writeFloCardFields(storage, fields) {
35
+ try { storage && storage.setItem(STORE_KEY, JSON.stringify(sanitizeFloCardFields(fields))); } catch { /* private mode: this page only */ }
36
+ }
37
+
38
+ // One detail across the selection, by the Properties pane's own rule (steel-editor.html propAggRow): each entry is
39
+ // the member's formatted text, or undefined where the detail does not apply to it. Returns the shared text,
40
+ // VARIES, or undefined when no member has a value (the card then leaves the detail out). A member with an empty
41
+ // value beside one with a value is a difference, as it is in the pane.
42
+ function aggregateFloCardValue(texts) {
43
+ const applicable = texts.filter((t) => t !== undefined);
44
+ const nonEmpty = [...new Set(applicable.filter((t) => t !== ''))];
45
+ if (!nonEmpty.length) return undefined;
46
+ return nonEmpty.length === 1 && applicable.every((t) => t === nonEmpty[0]) ? nonEmpty[0] : VARIES;
47
+ }
48
+
49
+ // values: { key: { label, text, varies? } } for the details the member (or the selection) HAS, text non-empty;
50
+ // count: how many members the card speaks for. Returns { caption, headline, headlineVaries, rows: [{ label,
51
+ // value, varies }] }, or null when nothing chosen has a value.
52
+ function floCardModel(values, fields, { count = 1 } = {}) {
53
+ const want = sanitizeFloCardFields(fields);
54
+ const has = (k) => want.includes(k) && values && values[k] && typeof values[k].text === 'string' && values[k].text !== '';
55
+ if (!want.some(has)) return null; // "3 selected" alone says nothing about the members
56
+ // In the caption a differing type or mark is simply not named: "3 selected" already says they are several.
57
+ const named = CAPTION.filter((k) => has(k) && !values[k].varies).map((k) => values[k].text);
58
+ const caption = [...(count > 1 ? [count + ' selected'] : []), ...named].join(' · ');
59
+ const rows = want.filter((k) => !CAPTION.includes(k) && k !== 'profile' && has(k))
60
+ .map((k) => ({ label: values[k].label, value: values[k].text, varies: !!values[k].varies }));
61
+ // No profile, no headline: a lone "25.0 ft" in large type would not say what it measures, so the rows keep
62
+ // their labels instead.
63
+ const headline = has('profile') ? values.profile.text : '';
64
+ const headlineVaries = has('profile') && !!values.profile.varies;
65
+ if (!caption && !headline && !rows.length) return null;
66
+ return { caption, headline, headlineVaries, rows };
67
+ }
68
+
69
+ const api = { FLO_CARD_FIELDS, FLO_CARD_DEFAULT, VARIES, sanitizeFloCardFields, readFloCardFields, writeFloCardFields, aggregateFloCardValue, floCardModel };
70
+ if (typeof module === 'object' && module.exports) module.exports = api;
71
+ else root.FloCard = api;
72
+ })(globalThis);
package/dist/web/guide.js CHANGED
@@ -98,7 +98,9 @@
98
98
  return api(path, body, true);
99
99
  }
100
100
  if (!response.ok) {
101
- const failure = new Error(data?.error || 'FloLess couldn’t do that just now. Try again; if it keeps happening, restart FloLess.');
101
+ const failure = new Error(personText(data) || (body
102
+ ? failureCopy({ status: response.status, body: data }, { action: 'do that' }).text
103
+ : 'FloLess couldn’t do that just now. Try again; if it keeps happening, restart FloLess.'));
102
104
  failure.code = data?.code || null; failure.body = data;
103
105
  throw failure;
104
106
  }
@@ -732,7 +732,7 @@
732
732
  <!-- Workflow update (one click, owner ruling 2026-11-02): what is new in the open workflow (#wf-update-changelog),
733
733
  the same row the status-bar dialog shows (#wf-update-row: where it stands, the warning when the person changed
734
734
  it), and one button that does the next thing: Update, then Undo (or Approve model for a Steel Model). -->
735
- <div class="modal-backdrop" id="wf-update-modal">
735
+ <div class="modal-backdrop" id="wf-update-modal" role="dialog" aria-modal="true" aria-labelledby="wf-update-title" aria-describedby="wf-update-sub">
736
736
  <div class="modal">
737
737
  <div class="modal-title" id="wf-update-title">Workflow update</div>
738
738
  <div class="modal-sub" id="wf-update-sub"></div>
@@ -833,6 +833,23 @@
833
833
  </div>
834
834
  </div>
835
835
 
836
+ <!-- #2732: an export past the archive bounds (files, folders, depth, time). Nothing is exported until the person chooses:
837
+ leave the offered folder out (the archive notes it) or export everything anyway. Painted by askExportOversize
838
+ (web/workspaces.js) from the server's facts. -->
839
+ <div class="modal-backdrop" id="export-oversize-modal" role="dialog" aria-modal="true" aria-labelledby="xo-title" aria-describedby="xo-sub">
840
+ <div class="modal ac-dialog xo-dialog">
841
+ <div class="modal-title" id="xo-title" tabindex="-1">Too many files for one archive</div>
842
+ <div class="modal-sub" id="xo-sub"></div>
843
+ <ul class="xo-choices" id="xo-choices"></ul>
844
+ <div class="xo-left-out" id="xo-left-out" hidden></div>
845
+ <div class="modal-actions">
846
+ <button data-command-id="shell.dialog-cancel#exporting the project" id="xo-cancel">Cancel</button>
847
+ <button data-command-id="shell.project-export-everything" id="xo-everything">Export everything</button>
848
+ <button data-command-id="shell.project-export-leave-out" id="xo-leave-out" class="primary">Leave this folder out</button>
849
+ </div>
850
+ </div>
851
+ </div>
852
+
836
853
  <!-- AWARE runtime + installed-host-bridge upgrade. One dedicated surface is
837
854
  shared by the footer pill and Workspaces recovery actions. Progress comes
838
855
  from the server transaction; this UI never infers installer completion. -->
@@ -1583,6 +1600,7 @@
1583
1600
  <section id="company-knowledge-confirm" class="company-knowledge-confirm" role="status" aria-live="polite" hidden></section>
1584
1601
  </div>
1585
1602
  <div class="company-knowledge-error" id="company-knowledge-error" role="alert" aria-live="assertive" hidden></div>
1603
+ <div class="company-knowledge-status" id="company-knowledge-status" role="status" aria-live="polite" hidden></div>
1586
1604
  <div class="modal-actions">
1587
1605
  <button type="button" id="company-knowledge-cancel" data-command-id="shell.dialog-cancel#company knowledge">Close</button>
1588
1606
  <button type="button" id="company-knowledge-action" class="primary" data-command-id="shell.company-publish" hidden></button>
@@ -1744,7 +1762,8 @@
1744
1762
  </div>
1745
1763
  </div>
1746
1764
 
1747
- <div class="modal-backdrop" id="add-fav-modal">
1765
+ <div class="modal-backdrop" id="add-fav-modal" role="dialog" aria-modal="true"
1766
+ aria-labelledby="add-fav-title" aria-describedby="add-fav-sub">
1748
1767
  <div class="modal">
1749
1768
  <div class="modal-title" id="add-fav-title">Save as Template</div>
1750
1769
  <div class="modal-sub" id="add-fav-sub">Save this node as a reusable Template — usable in any workflow.</div>
@@ -2191,10 +2210,10 @@
2191
2210
  </div>
2192
2211
  <!-- Bake into agent — preview + confirm. Packages the workflow as a reusable
2193
2212
  agent (exposes-as-agent) and reinstalls so AWARE synthesizes it. -->
2194
- <div class="modal-backdrop" id="bake-modal">
2213
+ <div class="modal-backdrop" id="bake-modal" role="dialog" aria-modal="true" aria-labelledby="bake-title" aria-describedby="bake-sub">
2195
2214
  <div class="modal">
2196
2215
  <div class="modal-title" id="bake-title">Bake into tool</div>
2197
- <div class="modal-sub">Packages this workflow as a reusable tool. AWARE reinstalls it with an exposed interface, then it appears in the Tools library as a single callable node.</div>
2216
+ <div class="modal-sub" id="bake-sub">Packages this workflow as a reusable tool. AWARE reinstalls it with an exposed interface, then it appears in the Tools library as a single callable node.</div>
2198
2217
  <div id="bake-body">
2199
2218
  <div class="modal-field">
2200
2219
  <label>Tool name</label>
@@ -2214,6 +2233,8 @@
2214
2233
  <!-- Project picker + lifecycle. The FULL lifecycle set lives HERE and only here — ≡ carries
2215
2234
  nothing project-specific (spec §2). Populated per-open in workspaces.js. -->
2216
2235
  <div class="menu ws-proj-menu" id="ws-proj-menu" role="menu" hidden></div>
2236
+ <!-- Workflow card ⋯ menu on the Workflows page (Rename… / Duplicate / Archive). Populated per-open in aware.js. -->
2237
+ <div class="menu wf-card-menu" id="wf-card-menu" role="menu" hidden></div>
2217
2238
 
2218
2239
  <script src="startup-admission.js"></script>
2219
2240
  <script src="shared-prefs.js"></script>
@@ -2239,6 +2260,7 @@
2239
2260
  <script src="agent-steps.js"></script>
2240
2261
  <script src="step-rename.js"></script>
2241
2262
  <script src="run-page-view.js"></script>
2263
+ <script src="report-csp.js"></script>
2242
2264
  <script src="aware.js"></script>
2243
2265
  <script src="tool-updates.js"></script>
2244
2266
  <script src="panels.js"></script>
@@ -861,6 +861,8 @@
861
861
  var GROUP_ORDER = [
862
862
  // the shell
863
863
  'In the header', 'In the workflow picker', 'In the project picker', 'In the project list',
864
+ // #2732: the warning that Export in the project list opens for a project too big for one archive.
865
+ 'In the project export warning',
864
866
  // #2866: Sort by sits in the header of the Workspaces, Workflows and Agents pages.
865
867
  'On the landing pages', 'On the Workflows page', 'In Archived on the Workflows page', 'In the workflow picker and on a draft workflow',
866
868
  'On the Agents page', 'On an agent',
@@ -909,6 +911,7 @@
909
911
  'In the Drawing Filter exclusion approval',
910
912
  // the vector editor, and its 3D viewer
911
913
  'In the Trace header', 'In the Trace panel', 'On the Trace canvas',
914
+ 'On the Trace save-conflict bar', 'In the Trace dialogs',
912
915
  'In the Trace — 3D header', 'On the Trace — 3D view',
913
916
  ];
914
917
  function groupRank(g) {
@@ -204,6 +204,14 @@ export function createSteelAdapter({ viewport, editorBridge = {} }) {
204
204
  drawnMemberIds: () => invoke('drawnMemberIds', [], null),
205
205
  // #2521 row 6: the member ends and connections that rest on an AI decision; null clears them.
206
206
  setAiMarks: (spec) => invoke('setAiMarks', [spec]),
207
+ // Flo on the model (web/steel-3d-flo.js): the Labels menu switch and size, AI Chat's mood for this project, and the note
208
+ // the editor leaves before it reloads for a change made elsewhere, so Flo can visit what changed; and a re-read of
209
+ // Flo's card when the person changes what it shows.
210
+ setFlo: (on) => invoke('setFlo', [on]),
211
+ setFloMood: (mood) => invoke('setFloMood', [mood]),
212
+ refreshFloCard: () => invoke('refreshFloCard'),
213
+ setFloSize: (k) => invoke('setFloSize', [k]),
214
+ floRemember: () => invoke('floRemember'),
207
215
  isIsolated: () => !!invoke('isIsolated', [], false),
208
216
  selectionHiddenIds: () => invoke('selectionHiddenIds', [], []),
209
217
  connHiddenIds: () => invoke('connHiddenIds', [], []),
@@ -367,7 +375,7 @@ const CONTRIBUTIONS = Object.freeze({
367
375
  kind: 'menu', el: 'm3dView', menu: 'm3dViewMenu', aria: true, label: 'Labels', semantic: 'steel.labels',
368
376
  icon: STEEL_LABELS_ICON_V1,
369
377
  cmd: STEEL_TOOLBAR_CONTRIBUTIONS_V1[0],
370
- tip: 'Show or hide reference lines and property labels on the 3D model',
378
+ tip: 'Show or hide reference lines, property labels and Flo on the 3D model',
371
379
  items: [
372
380
  {
373
381
  kind: 'toggle', cmd: 'steel.show-labels#reference lines', el: 'm3dRef', checked: false,
@@ -392,6 +400,38 @@ const CONTRIBUTIONS = Object.freeze({
392
400
  },
393
401
  ],
394
402
  },
403
+ {
404
+ // Flo (owner, 2026-11-04): an extra, off until switched on here, beside the other things drawn over the model.
405
+ // The disclosure chooses what Flo's card says; the card lists them in this order, not the order they were
406
+ // switched on. The page wires it by these ids (steel-editor.html wireFloSection), after every render.
407
+ kind: 'section', el: 'floSection', class: 'pl-section', items: [
408
+ {
409
+ kind: 'row', class: 'pl-header', items: [
410
+ { kind: 'toggle', cmd: 'steel.show-flo', el: 'floToggleB', checked: false, ariaLabel: 'Show Flo', label: '', tip: 'Flo stands on the 3D model, hops onto the member you select and says what it is. It also shows what AI Chat is doing on this project. It is decoration only and changes nothing in the model.' },
411
+ { kind: 'disclosure', cmd: 'steel.flo-card-settings', el: 'floCardDisc', class: 'pl-disclosure', controls: 'floCardScope', label: 'Flo', tip: 'Choose what Flo’s card says about the member Flo hops onto' },
412
+ ],
413
+ },
414
+ // How big Flo and its card are drawn, like Grid label size for the grid bubbles: one setting for both.
415
+ { kind: 'range', cmd: 'steel.flo-size', el: 'floSize', valueEl: 'floSizeV', label: 'Flo size', min: 60, max: 200, step: 10, value: 100, ariaLabel: 'Flo size in percent', tip: 'How big Flo and Flo’s card are drawn in 3D. They keep this size on screen however far you zoom.' },
416
+ {
417
+ kind: 'scope', el: 'floCardScope', class: 'pl-scope', revealBy: 'floCardDisc', hidden: true, items: [
418
+ { kind: 'note', el: 'floCardNote', class: 'pl-note' },
419
+ { kind: 'toggle', cmd: 'steel.flo-card-field#Type', el: 'floCardF_type', checked: false, label: 'Type', tip: 'Flo’s card shows whether it is a beam, column or brace', data: { 'data-key': 'type' } },
420
+ { kind: 'toggle', cmd: 'steel.flo-card-field#Mark', el: 'floCardF_mark', checked: false, label: 'Mark', tip: 'Flo’s card shows its mark from the drawings', data: { 'data-key': 'mark' } },
421
+ { kind: 'toggle', cmd: 'steel.flo-card-field#Profile', el: 'floCardF_profile', checked: false, label: 'Profile', tip: 'Flo’s card shows its profile, large', data: { 'data-key': 'profile' } },
422
+ { kind: 'toggle', cmd: 'steel.flo-card-field#Length', el: 'floCardF_length', checked: false, label: 'Length', tip: 'Flo’s card shows its length', data: { 'data-key': 'length' } },
423
+ { kind: 'toggle', cmd: 'steel.flo-card-field#Weight', el: 'floCardF_weight', checked: false, label: 'Weight', tip: 'Flo’s card shows its weight, from the profile and length', data: { 'data-key': 'weight' } },
424
+ { kind: 'toggle', cmd: 'steel.flo-card-field#Top (TOS)', el: 'floCardF_col_tos', checked: false, label: 'Top (TOS)', tip: 'Flo’s card shows the top of a column', data: { 'data-key': 'col_tos' } },
425
+ { kind: 'toggle', cmd: 'steel.flo-card-field#Bottom (BOS)', el: 'floCardF_col_bos', checked: false, label: 'Bottom (BOS)', tip: 'Flo’s card shows the bottom of a column', data: { 'data-key': 'col_bos' } },
426
+ { kind: 'toggle', cmd: 'steel.flo-card-field#TOS (start)', el: 'floCardF_tos_start', checked: false, label: 'TOS (start)', tip: 'Flo’s card shows the top of steel at a beam’s start', data: { 'data-key': 'tos_start' } },
427
+ { kind: 'toggle', cmd: 'steel.flo-card-field#TOS (end)', el: 'floCardF_tos_end', checked: false, label: 'TOS (end)', tip: 'Flo’s card shows the top of steel at a beam’s end', data: { 'data-key': 'tos_end' } },
428
+ { kind: 'toggle', cmd: 'steel.flo-card-field#Verified', el: 'floCardF_verified', checked: false, label: 'Verified', tip: 'Flo’s card shows whether it is verified', data: { 'data-key': 'verified' } },
429
+ { kind: 'toggle', cmd: 'steel.flo-card-field#ID', el: 'floCardF_id', checked: false, label: 'ID', tip: 'Flo’s card shows its member ID', data: { 'data-key': 'id' } },
430
+ { kind: 'item', cmd: 'steel.flo-card-reset', el: 'floCardReset', class: 'fc-reset', label: 'Reset to default', tip: 'Type, mark, profile, length and weight' },
431
+ ],
432
+ },
433
+ ],
434
+ },
395
435
  ],
396
436
  }],
397
437
  });
@@ -144,6 +144,14 @@ const ITEM = {
144
144
  */
145
145
  row: (d) => `<div${attr('id', d.el)}${attr('class', d.class)}>${d.items.map(renderItem).join('')}</div>`,
146
146
 
147
+ /*
148
+ * A labelled slider inside a menu: the words above, the slider and its read-out (filled in by the page) beside.
149
+ * The command id sits on the slider itself, which is what a person moves.
150
+ */
151
+ range: (d) => `<div class="mrow"><span class="mlbl">${escapeHtml(d.label)}</span>`
152
+ + `<input type="range"${common(d)}${attr('min', d.min)}${attr('max', d.max)}${attr('step', d.step)}${attr('value', d.value)}${attr('aria-label', d.ariaLabel)}>`
153
+ + `<span${attr('id', d.valueEl)} class="mval"></span></div>`,
154
+
147
155
  /** A free-text field inside a menu. */
148
156
  input: (d) => `<input${attr('data-command-id', d.cmd)}${attr('aria-label', d.ariaLabel)}${attr('id', d.el)}`
149
157
  + attr('inputmode', d.inputmode) + attr('placeholder', d.placeholder) + ' autocomplete="off"'
@@ -331,6 +339,9 @@ export function mountToolbarChrome({ toolbar, getItems = defaultItems, port = nu
331
339
  listenOrdinary(menu, 'keydown', (event) => {
332
340
  if (event.key === 'Escape') { event.preventDefault(); event.stopPropagation(); closeMenu(menu, true); return; }
333
341
  const items = enabledMenuItems(menu); const at = items.indexOf(event.target); if (at < 0) return;
342
+ // On a slider the arrows and Home / End are its own keys (step, lowest, highest), not row navigation; Tab and
343
+ // Escape still leave it.
344
+ if (event.target.type === 'range' && ['ArrowUp', 'ArrowDown', 'Home', 'End'].includes(event.key)) return;
334
345
  let next = null;
335
346
  if (event.key === 'ArrowDown') next = (at + 1) % items.length;
336
347
  else if (event.key === 'ArrowUp') next = (at - 1 + items.length) % items.length;