@floless/app 0.137.4 → 0.138.1
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.
- package/dist/floless-server.cjs +48371 -27278
- package/dist/internal-workflows/floless-rfi-gmail-send/.floless-owner.json +1 -0
- package/dist/internal-workflows/floless-rfi-gmail-send/floless-rfi-gmail-send.flo +32 -0
- package/dist/schemas/steel.model.v2.schema.json +218 -27
- package/dist/skills/floless-app-knowledge/SKILL.md +5 -2
- package/dist/skills/floless-app-rfi/SKILL.md +410 -0
- package/dist/skills/floless-app-routines/SKILL.md +7 -2
- package/dist/skills/floless-app-routines/references/routines-api.md +14 -5
- package/dist/skills/floless-app-steel-model/SKILL.md +34 -32
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +498 -34
- package/dist/skills/floless-app-steel-takeoff/references/elevation-registration.md +6 -6
- package/dist/skills/floless-app-tweak-contract/SKILL.md +6 -2
- package/dist/templates/floless-workspace-knowledge.flo +20 -4
- package/dist/templates/steel-model.flo +27 -15
- package/dist/web/app.css +559 -131
- package/dist/web/app.js +216 -54
- package/dist/web/aware.js +982 -128
- package/dist/web/checkpoint-standard.js +218 -0
- package/dist/web/commands-filter.js +23 -0
- package/dist/web/commands-shell.js +237 -5
- package/dist/web/commands-steel.js +172 -47
- package/dist/web/connection-review-client.js +2 -2
- package/dist/web/display-units.js +243 -0
- package/dist/web/grid-core.js +470 -56
- package/dist/web/grid-display.js +344 -0
- package/dist/web/index.html +106 -66
- package/dist/web/instructor-reporter.js +5 -0
- package/dist/web/instructor.js +175 -33
- package/dist/web/json-schema-subset.js +145 -25
- package/dist/web/steel-3d-core.js +124 -140
- package/dist/web/steel-3d-view.js +352 -100
- package/dist/web/steel-catalog-picker.js +98 -15
- package/dist/web/steel-detail-refs.js +1 -1
- package/dist/web/steel-editor.html +6458 -915
- package/dist/web/steel-filter.html +404 -57
- package/dist/web/steel-model-adapter.js +1 -1
- package/dist/web/steel-model-commands.js +71 -64
- package/dist/web/steel-model-v2-client-validation.js +10 -3
- package/dist/web/steel-model-v2-commands.js +268 -76
- package/dist/web/steel-model-v2-projection.js +18 -17
- package/dist/web/steel-plan-transform.js +13 -13
- package/dist/web/steel-plan-view-id.js +1 -7
- package/dist/web/steel-read-confidence.js +454 -5
- package/dist/web/steel-units.js +17 -3
- package/dist/web/steel-view-generation.js +21 -7
- package/dist/web/workspaces.js +2178 -497
- package/package.json +4 -1
|
@@ -11,16 +11,19 @@ import { planViewId, planViewLabels } from './steel-plan-view-id.js';
|
|
|
11
11
|
* ask what a row's identity and display name are — rather than reading `.sheet` and hoping (#938). */
|
|
12
12
|
export { planViewId, planViewLabels };
|
|
13
13
|
import { sheetIncludesElevation,POSITION_BASIS_CAPABILITY_VERSION } from './steel-3d-core.js';
|
|
14
|
-
import { IN_TO_MM as IN_MM } from './steel-units.js';
|
|
15
14
|
export const POSITION_BASIS_PROJECTION_VERSION=POSITION_BASIS_CAPABILITY_VERSION;
|
|
16
15
|
import { worldToSheetPx, planTransform, PlanTransformError } from './steel-plan-transform.js';
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
const V2_PROJECTION_LINK = Symbol.for('floless.steelModelV2ProjectionLink');
|
|
19
18
|
|
|
20
19
|
const clone = (v) => v == null ? v : (typeof structuredClone === 'function'
|
|
21
20
|
? structuredClone(v)
|
|
22
21
|
: JSON.parse(JSON.stringify(v)));
|
|
23
|
-
|
|
22
|
+
/* WORLD MILLIMETRES, straight through — the editor is metric now and this used to divide by 25.4.
|
|
23
|
+
Renamed from `knownIn` deliberately: the value's unit inverted, and a reader still asking for
|
|
24
|
+
`knownIn` should fail to find it rather than quietly receive a number 25.4x larger than it expects.
|
|
25
|
+
That is not hypothetical — `steel-3d-core`'s `memberGeometry` was multiplying these back up. */
|
|
26
|
+
const knownMm = (z) => z && Number.isFinite(z.known) ? z.known : null;
|
|
24
27
|
|
|
25
28
|
function link(value, data) {
|
|
26
29
|
if (value && typeof value === 'object') {
|
|
@@ -42,7 +45,7 @@ function observationIds(plan) {
|
|
|
42
45
|
export function memberPresence(model, plan, member) {
|
|
43
46
|
const observed = observationIds(plan).has(member.id);
|
|
44
47
|
const explicit = (plan.memberRefs || []).includes(member.id);
|
|
45
|
-
const cutMm = Number.isFinite(plan.
|
|
48
|
+
const cutMm = Number.isFinite(plan.elevation_mm) ? plan.elevation_mm : null;
|
|
46
49
|
const crossing = cutMm !== null && member.role === 'column'
|
|
47
50
|
&& sheetIncludesElevation(member.from?.z, member.to?.z, cutMm);
|
|
48
51
|
return { observed, explicit, crossing, visible: observed || explicit || crossing };
|
|
@@ -116,7 +119,7 @@ export function registrationRefusal(plan, subject) {
|
|
|
116
119
|
* The CODE alone cannot answer it, and reading it as if it could was wrong in a way that mattered: two
|
|
117
120
|
* of these codes cover both states at once. `grid-unavailable` is raised both when there is no model
|
|
118
121
|
* grid (unfinished) and when a grid exists but its `origin` cannot be read (malformed); `scale-invalid`
|
|
119
|
-
* both when `
|
|
122
|
+
* both when `mm_per_px` was never written (unfinished) and when it is present but zero or negative
|
|
120
123
|
* (malformed). Treating the whole code as unfinished told an author that "nothing is wrong, the sheet
|
|
121
124
|
* just needs its two registration points" about a sheet whose controls were already complete and whose
|
|
122
125
|
* grid was broken — a reassuring sentence that was not true, which is the exact defect class #935 is
|
|
@@ -128,17 +131,10 @@ function isUnstarted(plan, code) {
|
|
|
128
131
|
if (code === 'registration-incomplete') return true;
|
|
129
132
|
const grid = plan.modelGrid || plan.grid || null;
|
|
130
133
|
if (code === 'grid-unavailable') return !grid || typeof grid !== 'object';
|
|
131
|
-
if (code === 'scale-invalid') return plan.
|
|
134
|
+
if (code === 'scale-invalid') return plan.mm_per_px == null;
|
|
132
135
|
return false;
|
|
133
136
|
}
|
|
134
137
|
|
|
135
|
-
/**
|
|
136
|
-
* The refusal codes that CAN mean "not registered yet" — the candidates `isUnstarted` then decides
|
|
137
|
-
* between, since two of them also cover a malformed state. Imported by steel-editor.html, which
|
|
138
|
-
* classifies the same throw for the column-footprint fallback, so the two cannot drift apart.
|
|
139
|
-
*/
|
|
140
|
-
export const UNREGISTERED_CODES = ['registration-incomplete', 'view-kind-unsupported', 'scale-invalid', 'grid-unavailable'];
|
|
141
|
-
|
|
142
138
|
function projectGrid(modelGrid, plan) {
|
|
143
139
|
if (!modelGrid) return null;
|
|
144
140
|
const out = clone(modelGrid);
|
|
@@ -185,15 +181,15 @@ export function memberProperties(member) {
|
|
|
185
181
|
const endMeta = Array.isArray(member.ends) ? member.ends : [{}, {}];
|
|
186
182
|
const ends = [0, 1].map((i) => ({
|
|
187
183
|
...clone(endMeta[i] || {}),
|
|
188
|
-
|
|
184
|
+
tosMm: knownMm(i === 0 ? member.from.z : member.to.z),
|
|
189
185
|
tosDef: false,
|
|
190
186
|
}));
|
|
191
187
|
return {
|
|
192
188
|
...meta,
|
|
193
189
|
ends,
|
|
194
190
|
col: {
|
|
195
|
-
|
|
196
|
-
|
|
191
|
+
bosMm: knownMm(member.from.z),
|
|
192
|
+
tosMm: knownMm(member.to.z),
|
|
197
193
|
tosDef: false,
|
|
198
194
|
note: endMeta[1]?.note || '',
|
|
199
195
|
detail: endMeta[1]?.detail || '',
|
|
@@ -238,7 +234,12 @@ export function createV2Projection(model, viewId, options = {}) {
|
|
|
238
234
|
for (const key of ['segments', 'labels', 'details', 'callouts', 'tos_callouts', 'dims']) {
|
|
239
235
|
if (!Array.isArray(projection[key])) projection[key] = [];
|
|
240
236
|
}
|
|
241
|
-
|
|
237
|
+
// The cut plane, in WORLD MILLIMETRES — the same number the contract holds, with no conversion at
|
|
238
|
+
// all. This used to be `default_tos` in inches, because the editor ran an inches-canonical sub-world
|
|
239
|
+
// and this was one of the two places that translated into it. Both translations are gone; the name
|
|
240
|
+
// carries `_mm` so a stale reader asking for `default_tos` gets `undefined` and says so, rather than
|
|
241
|
+
// reading millimetres as inches and datuming every default-following end 25.4x too high.
|
|
242
|
+
projection.default_tos_mm = Number.isFinite(plan.elevation_mm) ? plan.elevation_mm : 0;
|
|
242
243
|
/*
|
|
243
244
|
* The registration is classified ONCE, here, before anything maps a point through it — and a refusal
|
|
244
245
|
* degrades this projection rather than throwing out of it.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* control to a world point. Nothing here infers a view kind or substitutes missing registration data.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { parseSpacings,
|
|
9
|
+
import { parseSpacings, sheetScaleMm } from './grid-core.js';
|
|
10
10
|
|
|
11
11
|
const ROUND = 1e9;
|
|
12
12
|
const clean = (n) => {
|
|
@@ -19,7 +19,7 @@ const round2 = (n) => Math.round(n * 100) / 100;
|
|
|
19
19
|
/**
|
|
20
20
|
* How far the drawn control span may differ from the span its grid intersections imply, in POINTS of
|
|
21
21
|
* drawn distance. The takeoff skill has always told the reader to check exactly this by hand ("verify
|
|
22
|
-
* that their display span differs by at most 2 pt from `worldSpanMm
|
|
22
|
+
* that their display span differs by at most 2 pt from `worldSpanMm / mm_per_px`"); #935 is
|
|
23
23
|
* what happens when only the prose enforces it.
|
|
24
24
|
*/
|
|
25
25
|
export const REGISTRATION_SPAN_TOLERANCE_PT = 2;
|
|
@@ -169,9 +169,9 @@ export function planTransform(plan, subject) {
|
|
|
169
169
|
plan,
|
|
170
170
|
);
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
if (!(
|
|
174
|
-
return refuse('scale-invalid', `${subjectOf(plan, subject)} has no positive $.
|
|
172
|
+
const mmPerPx = Number(plan.mm_per_px);
|
|
173
|
+
if (!(mmPerPx > 0) || !Number.isFinite(mmPerPx)) {
|
|
174
|
+
return refuse('scale-invalid', `${subjectOf(plan, subject)} has no positive $.mm_per_px, so it has no drawing scale`, plan);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
// Editor projections expose a display-space `grid` because grid-core draws in pixels. The canonical
|
|
@@ -180,9 +180,9 @@ export function planTransform(plan, subject) {
|
|
|
180
180
|
const world0 = plan.datum_ref ? gridIntersection(registrationGrid, plan.datum_ref, plan, '$.datum_ref', subject) : [0, 0];
|
|
181
181
|
const world1 = gridIntersection(registrationGrid, plan.control2_ref, plan, '$.control2_ref', subject);
|
|
182
182
|
// The shared plan scale. Its zero/negative fallback is unreachable here — the guard above already
|
|
183
|
-
// refused any sheet whose `
|
|
184
|
-
//
|
|
185
|
-
const scale = mmPerPx
|
|
183
|
+
// refused any sheet whose `mm_per_px` is not a positive finite number — so this is the stored value
|
|
184
|
+
// itself, taken through the one gate rather than read raw.
|
|
185
|
+
const scale = sheetScaleMm(mmPerPx);
|
|
186
186
|
const local1 = [
|
|
187
187
|
(plan.control2_at[0] - plan.datum_at[0]) * scale,
|
|
188
188
|
(plan.datum_at[1] - plan.control2_at[1]) * scale,
|
|
@@ -217,7 +217,7 @@ export function planTransform(plan, subject) {
|
|
|
217
217
|
if (Math.abs(actualSpanPt - expectedSpanPt) > REGISTRATION_SPAN_TOLERANCE_PT) {
|
|
218
218
|
return refuse(
|
|
219
219
|
'registration-span-mismatch',
|
|
220
|
-
`${subjectOf(plan, subject)} registration controls span ${round2(actualSpanPt)} pt on the sheet, but ${plan.datum_ref ? '$.datum_ref' : 'the model origin'} and $.control2_ref are ${round2(worldLen)} mm apart, which at ${plan.
|
|
220
|
+
`${subjectOf(plan, subject)} registration controls span ${round2(actualSpanPt)} pt on the sheet, but ${plan.datum_ref ? '$.datum_ref' : 'the model origin'} and $.control2_ref are ${round2(worldLen)} mm apart, which at ${plan.mm_per_px} mm/px is ${round2(expectedSpanPt)} pt — a difference of ${round2(Math.abs(actualSpanPt - expectedSpanPt))} pt, past the ${REGISTRATION_SPAN_TOLERANCE_PT} pt allowed. Either a control names the wrong grid axis or $.mm_per_px is wrong`,
|
|
221
221
|
plan,
|
|
222
222
|
);
|
|
223
223
|
}
|
|
@@ -276,7 +276,7 @@ export function sheetPxToWorld(point, plan, keepZ, subject) {
|
|
|
276
276
|
* `displayOrigin[1] - point[1]` is not a sign slip: sheet Y runs DOWN and the registered `worldV` runs
|
|
277
277
|
* up the drawing, so the v component is measured against the sheet, not with it.
|
|
278
278
|
*
|
|
279
|
-
* The caller must have already established that `
|
|
279
|
+
* The caller must have already established that `mmPerPx` is a positive finite number — both do, and
|
|
280
280
|
* both refuse the document otherwise, with their own message naming their own field. Returns the point
|
|
281
281
|
* unrounded and unchecked: `x`, `y` and `z.known` are whatever the registration produces, so a caller
|
|
282
282
|
* that cares about finiteness still asks. (Deliberately NOT put through `clean()` like the plan path —
|
|
@@ -288,11 +288,11 @@ export function sheetPxToWorld(point, plan, keepZ, subject) {
|
|
|
288
288
|
*
|
|
289
289
|
* @param {number[]} point sheet display point [x, y]
|
|
290
290
|
* @param {{ displayOrigin: number[], worldOrigin: { x: number, y: number, z: { known: number } }, worldU: number[], worldV: number[] }} registration
|
|
291
|
-
* @param {number}
|
|
291
|
+
* @param {number} mmPerPx the enclosing view's drawing scale in mm per display px; the caller has already refused a non-positive one
|
|
292
292
|
* @returns {{ x: number, y: number, z: { known: number } }}
|
|
293
293
|
*/
|
|
294
|
-
export function sourceRegistrationPointToWorld(point, registration,
|
|
295
|
-
const mmPerPoint = mmPerPx
|
|
294
|
+
export function sourceRegistrationPointToWorld(point, registration, mmPerPx) {
|
|
295
|
+
const mmPerPoint = sheetScaleMm(mmPerPx);
|
|
296
296
|
const du = (point[0] - registration.displayOrigin[0]) * mmPerPoint;
|
|
297
297
|
const dv = (registration.displayOrigin[1] - point[1]) * mmPerPoint;
|
|
298
298
|
const o = registration.worldOrigin, u = registration.worldU, v = registration.worldV;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Those were the same string until #938, and the conflation had a consequence: five braced-frame
|
|
5
5
|
* elevations on one sheet — ordinary practice — had no legal representation at all. `sheet` was unique
|
|
6
|
-
* across rows, one row carries one `sourceRegistration`, one `viewKind` and one `
|
|
6
|
+
* across rows, one row carries one `sourceRegistration`, one `viewKind` and one `mm_per_px`, and an
|
|
7
7
|
* observation must live on the plan whose sheet its evidence cites. Nothing in that combination can say
|
|
8
8
|
* "five views, five frames, one page".
|
|
9
9
|
*
|
|
@@ -48,12 +48,6 @@ export function planViewId(plan) {
|
|
|
48
48
|
return typeof sheet === 'string' ? sheet : '';
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
/** Did this row state its view id explicitly? Used where absence is the thing being judged. */
|
|
52
|
-
export function hasExplicitViewId(plan) {
|
|
53
|
-
const id = plan && typeof plan === 'object' ? plan.id : undefined;
|
|
54
|
-
return typeof id === 'string' && id.trim() !== '';
|
|
55
|
-
}
|
|
56
|
-
|
|
57
51
|
/**
|
|
58
52
|
* The RAW resolver, for the two places that read a document before anything has vouched for it:
|
|
59
53
|
* `checkModelReferences(doc: unknown)` and revision staging, both of which accept unvalidated input
|