@floless/app 0.138.1 → 0.139.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 (109) hide show
  1. package/autostart.mjs +6 -2
  2. package/desktop-access-production-manifest.mjs +7 -0
  3. package/dist/floless-server.cjs +157133 -70500
  4. package/dist/schemas/model.continuation.v1.schema.json +19 -0
  5. package/dist/schemas/model.continuation.v2.schema.json +19 -0
  6. package/dist/schemas/model.query-response.v1.schema.json +95 -0
  7. package/dist/schemas/model.query-response.v2.schema.json +80 -0
  8. package/dist/schemas/model.query.v1.schema.json +87 -0
  9. package/dist/schemas/model.query.v2.schema.json +87 -0
  10. package/dist/schemas/model.snap-candidate.v1.schema.json +48 -0
  11. package/dist/schemas/model.snap-constraint.v1.schema.json +18 -0
  12. package/dist/schemas/model.snap-query.v1.schema.json +24 -0
  13. package/dist/schemas/model.snap-result.v1.schema.json +33 -0
  14. package/dist/schemas/model.snapshot.v1.schema.json +136 -0
  15. package/dist/schemas/revit.model.v1.schema.json +24 -0
  16. package/dist/schemas/steel.model.v2.schema.json +45 -6
  17. package/dist/skills/floless-app-approval/SKILL.md +19 -5
  18. package/dist/skills/floless-app-bridge/SKILL.md +19 -6
  19. package/dist/skills/floless-app-knowledge/SKILL.md +22 -1
  20. package/dist/skills/floless-app-new-workflow/SKILL.md +31 -27
  21. package/dist/skills/floless-app-new-workflow/references/build-and-verify.md +13 -12
  22. package/dist/skills/floless-app-onboarding/SKILL.md +3 -3
  23. package/dist/skills/floless-app-onboarding/references/floless-app-tour.md +16 -9
  24. package/dist/skills/floless-app-steel-model/SKILL.md +11 -2
  25. package/dist/skills/floless-app-steel-model/references/detail-from-a-screenshot.md +95 -0
  26. package/dist/skills/floless-app-steel-takeoff/SKILL.md +146 -21
  27. package/dist/skills/floless-app-steel-takeoff/references/elevation-registration.md +19 -0
  28. package/dist/skills/floless-app-tweak-contract/SKILL.md +42 -8
  29. package/dist/skills/floless-app-vectorize/SKILL.md +19 -6
  30. package/dist/skills/floless-app-workflows/SKILL.md +30 -3
  31. package/dist/skills/floless-app-workflows/references/workspace-data.md +77 -4
  32. package/dist/templates/floless-workspace-model-report.flo +77 -0
  33. package/dist/templates/revit-model.flo +111 -0
  34. package/dist/web/app.css +415 -177
  35. package/dist/web/app.js +302 -51
  36. package/dist/web/aware.js +1430 -1040
  37. package/dist/web/chat.css +692 -0
  38. package/dist/web/chat.js +2651 -0
  39. package/dist/web/commands-revit.js +42 -0
  40. package/dist/web/commands-shell.js +536 -70
  41. package/dist/web/commands-steel.js +344 -146
  42. package/dist/web/commands.js +1 -1
  43. package/dist/web/index.html +283 -77
  44. package/dist/web/instructor.js +217 -36
  45. package/dist/web/left-pane.js +636 -0
  46. package/dist/web/model-artifact-loader.js +75 -0
  47. package/dist/web/model-authoring-gestures.js +141 -0
  48. package/dist/web/model-cad-tools.js +20 -0
  49. package/dist/web/model-clip-gesture.js +148 -0
  50. package/dist/web/model-clip-list.js +156 -0
  51. package/dist/web/model-clip-session.js +274 -0
  52. package/dist/web/model-clip-three-overlay.js +295 -0
  53. package/dist/web/model-clip-three-preview.js +59 -0
  54. package/dist/web/model-editor-contract.js +519 -0
  55. package/dist/web/model-editor-revit-adapter.js +139 -0
  56. package/dist/web/model-editor-shell.js +271 -0
  57. package/dist/web/model-editor-state-recovery.js +44 -0
  58. package/dist/web/model-editor-steel-adapter.js +410 -0
  59. package/dist/web/model-editor.css +268 -0
  60. package/dist/web/model-frame.js +192 -0
  61. package/dist/web/model-inspector.js +128 -0
  62. package/dist/web/model-measure.js +390 -0
  63. package/dist/web/model-navigation-controls.js +246 -0
  64. package/dist/web/model-orientation-overlay.js +217 -0
  65. package/dist/web/model-panel-bridge.js +230 -0
  66. package/dist/web/model-pointer-dock.js +164 -0
  67. package/dist/web/model-revit-module.js +83 -0
  68. package/dist/web/model-selection-coordinator.js +151 -0
  69. package/dist/web/model-selection-tools.js +290 -0
  70. package/dist/web/model-snap-contract.js +267 -0
  71. package/dist/web/model-snapping.js +497 -0
  72. package/dist/web/model-spatial-panel.js +294 -0
  73. package/dist/web/model-spatial-tools.js +249 -0
  74. package/dist/web/model-tree.js +47 -0
  75. package/dist/web/model-viewport-lighting.js +166 -0
  76. package/dist/web/model-viewport-revit-adapter.js +1224 -0
  77. package/dist/web/model-viewport-state.js +505 -0
  78. package/dist/web/model-viewport-steel-adapter.js +150 -0
  79. package/dist/web/model-viewport-toolbar.js +516 -0
  80. package/dist/web/model-viewport.js +717 -0
  81. package/dist/web/panels.js +8 -15
  82. package/dist/web/renderers.js +3 -0
  83. package/dist/web/revit-editor.css +35 -0
  84. package/dist/web/revit-editor.html +74 -0
  85. package/dist/web/revit-editor.js +845 -0
  86. package/dist/web/steel-3d-core.js +16 -44
  87. package/dist/web/steel-3d-view.js +1384 -633
  88. package/dist/web/steel-canvas-guidance.js +3 -1
  89. package/dist/web/steel-editor.html +2121 -1253
  90. package/dist/web/steel-filter.html +5 -1
  91. package/dist/web/steel-model-v2-commands.js +72 -1
  92. package/dist/web/steel-split-view.js +5 -39
  93. package/dist/web/steel-view-generation.js +107 -17
  94. package/dist/web/vector-3d.html +12 -0
  95. package/dist/web/workspaces.js +2190 -277
  96. package/distribution-profile-active.mjs +2 -0
  97. package/distribution-profile-production.mjs +47 -0
  98. package/distribution-profile-shared.mjs +8 -0
  99. package/distribution-profile.mjs +18 -0
  100. package/distribution-resource-inventory.mjs +81 -0
  101. package/launch.mjs +18 -10
  102. package/log.mjs +2 -1
  103. package/managed-runtime-policy.mjs +104 -0
  104. package/model-reader-policy-active.mjs +7 -0
  105. package/network-policy-active.mjs +6 -0
  106. package/package.json +17 -2
  107. package/post-update-marker.mjs +3 -1
  108. package/rvt-production-uat-authority.mjs +60 -0
  109. package/teardown.mjs +4 -3
@@ -13,6 +13,13 @@
13
13
  */
14
14
 
15
15
  import { sheetScaleMm } from './grid-core.js';
16
+ import {
17
+ frameCoordinates as sharedFrameCoordinates,
18
+ frameFromThreePoints as sharedFrameFromThreePoints,
19
+ framePoint as sharedFramePoint,
20
+ } from './model-spatial-tools.js';
21
+ // Compatibility export while callers move to the neutral state module that now owns this generic math.
22
+ export { clipSegmentToPlanes } from './model-viewport-state.js';
16
23
 
17
24
  // Defined once in the leaf `steel-units` module and re-exported here, because this file is the seam a
18
25
  // dozen consumers already import them from and `grid-core` (which this file imports) needs them too.
@@ -239,36 +246,6 @@ export function sectionKindOf(profile) {
239
246
  return kind;
240
247
  }
241
248
 
242
- /**
243
- * Clip a 3D segment against convex half-spaces. Each plane is
244
- * `{ normal:[x,y,z], constant }`, with points on the non-negative side kept.
245
- * The representation intentionally mirrors THREE.Plane without importing Three,
246
- * so camera/section clipping stays deterministic and unit-testable.
247
- */
248
- export function clipSegmentToPlanes(a, b, planes = []) {
249
- let lo = 0, hi = 1;
250
- for (const plane of planes) {
251
- const n = plane && plane.normal;
252
- if (!n) continue;
253
- const c = Number(plane.constant) || 0;
254
- const da = n[0] * a[0] + n[1] * a[1] + n[2] * a[2] + c;
255
- const db = n[0] * b[0] + n[1] * b[1] + n[2] * b[2] + c;
256
- if (da < 0 && db < 0) return null;
257
- if (da < 0 || db < 0) {
258
- const t = da / (da - db);
259
- if (da < 0) lo = Math.max(lo, t);
260
- else hi = Math.min(hi, t);
261
- if (lo > hi) return null;
262
- }
263
- }
264
- const mix = (t) => [
265
- a[0] + (b[0] - a[0]) * t,
266
- a[1] + (b[1] - a[1]) * t,
267
- a[2] + (b[2] - a[2]) * t,
268
- ];
269
- return [mix(lo), mix(hi)];
270
- }
271
-
272
249
  /**
273
250
  * THE clamped projection of a point onto a segment — the single implementation, for every caller.
274
251
  *
@@ -864,16 +841,11 @@ export function vecToPlane(vec, u, v, n) {
864
841
  // a tilted frame (from a 3-point pick) can point its normal anywhere (see frameFrom3Points).
865
842
  /** world point → local: components of (p − origin) along each frame axis = Rᵀ·(p − origin). */
866
843
  export function worldToLocal(p, frame) {
867
- const o = frame.origin, X = frame.xAxis, Y = frame.yAxis, Z = frame.normal;
868
- const d = [p[0] - o[0], p[1] - o[1], p[2] - o[2]];
869
- return [nz(_dot(d, X)), nz(_dot(d, Y)), nz(_dot(d, Z))];
844
+ return sharedFrameCoordinates({ ...frame, zAxis: frame.normal }, p).map(nz);
870
845
  }
871
846
  /** local point → world: origin + lx·X + ly·Y + lz·Z. Inverse of worldToLocal. */
872
847
  export function localToWorld(l, frame) {
873
- const o = frame.origin, X = frame.xAxis, Y = frame.yAxis, Z = frame.normal;
874
- return [nz(o[0] + l[0] * X[0] + l[1] * Y[0] + l[2] * Z[0]),
875
- nz(o[1] + l[0] * X[1] + l[1] * Y[1] + l[2] * Z[1]),
876
- nz(o[2] + l[0] * X[2] + l[1] * Y[2] + l[2] * Z[2])];
848
+ return sharedFramePoint({ ...frame, zAxis: frame.normal }, l).map(nz);
877
849
  }
878
850
  /** local VECTOR → world (rotation only, NO origin translation — for relative typed entry / offsets). */
879
851
  export function localVectorToWorld(v, frame) {
@@ -889,11 +861,10 @@ export function localVectorToWorld(v, frame) {
889
861
  * on the X line). Reuses planeFrom3Points (origin/xAxis/normal) and derives yAxis = normal × xAxis.
890
862
  */
891
863
  export function frameFrom3Points(a, b, c) {
892
- const p = planeFrom3Points(a, b, c);
893
- if (!p) return null;
894
- const yAxis = _norm(_cross(p.normal, p.xAxis)); // Y = Z × X → ⊥ X, on c's side, right-handed
895
- if (!yAxis) return null;
896
- return { origin: p.origin, xAxis: p.xAxis, yAxis, normal: p.normal };
864
+ try {
865
+ const frame = sharedFrameFromThreePoints({ origin: a, xPoint: b, ySide: c });
866
+ return { origin: [...frame.origin], xAxis: [...frame.xAxis], yAxis: [...frame.yAxis], normal: [...frame.zAxis] };
867
+ } catch (_) { return null; }
897
868
  }
898
869
  /** The global identity frame (a no-op UCS). */
899
870
  export function identityFrame(origin = [0, 0, 0]) {
@@ -916,8 +887,9 @@ export function frameFromAngle(origin, angleRad) {
916
887
  * a real vertex/intersection always wins — the grid only catches a free click, never drowns geometry snap.
917
888
  */
918
889
  export function snapGridPoint(p, frame, incMm) {
919
- if (!frame || !Array.isArray(p) || !Number.isFinite(incMm) || !(incMm > 0)) return null;
920
- const l = worldToLocal(p, frame);
890
+ if (!frame || !Array.isArray(p) || p.length !== 3 || !p.every(Number.isFinite) || !Number.isFinite(incMm) || !(incMm > 0)) return null;
891
+ let l;
892
+ try { l = worldToLocal(p, frame); } catch (_) { return null; }
921
893
  const q = [Math.round(l[0] / incMm) * incMm, Math.round(l[1] / incMm) * incMm, Math.round(l[2] / incMm) * incMm];
922
894
  const w = localToWorld(q, frame);
923
895
  return (Number.isFinite(w[0]) && Number.isFinite(w[1]) && Number.isFinite(w[2])) ? w : null;