@floless/app 0.159.0 → 0.161.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 (43) hide show
  1. package/dist/floless-server.cjs +76823 -65608
  2. package/dist/schemas/steel.model.v2.schema.json +24 -0
  3. package/dist/skills/floless-app-onboarding/SKILL.md +4 -3
  4. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +1 -2
  5. package/dist/skills/floless-app-rfi/SKILL.md +44 -3
  6. package/dist/skills/floless-app-steel-model/SKILL.md +2 -2
  7. package/dist/skills/floless-app-steel-takeoff/SKILL.md +417 -261
  8. package/dist/templates/steel-model.flo +6 -2
  9. package/dist/templates/viewer-3d-demo.flo +8 -2
  10. package/dist/web/app.css +342 -160
  11. package/dist/web/app.js +17 -51
  12. package/dist/web/aware.js +656 -574
  13. package/dist/web/chat-question-card.js +27 -1
  14. package/dist/web/chat.css +185 -30
  15. package/dist/web/chat.js +2099 -255
  16. package/dist/web/commands-drawing-check.js +1 -0
  17. package/dist/web/commands-filter.js +11 -0
  18. package/dist/web/commands-shell.js +1118 -134
  19. package/dist/web/commands-steel.js +41 -38
  20. package/dist/web/drawing-check-editor.js +76 -3
  21. package/dist/web/guide.js +8 -0
  22. package/dist/web/index.html +68 -42
  23. package/dist/web/instructor.js +17 -6
  24. package/dist/web/pages.js +158 -30
  25. package/dist/web/panels.js +19 -1
  26. package/dist/web/project-history.js +349 -0
  27. package/dist/web/project-reconciliation.js +1 -0
  28. package/dist/web/project-rfis.js +954 -0
  29. package/dist/web/project-workflows.js +236 -4
  30. package/dist/web/run-history.js +198 -0
  31. package/dist/web/run-page-view.js +12 -2
  32. package/dist/web/startup-admission.js +53 -7
  33. package/dist/web/steel-3d-core.js +144 -7
  34. package/dist/web/steel-3d-view.js +61 -5
  35. package/dist/web/steel-editor.html +510 -128
  36. package/dist/web/steel-filter.html +139 -0
  37. package/dist/web/steel-model-v2-commands.js +3 -3
  38. package/dist/web/steel-model-v2-projection.js +139 -4
  39. package/dist/web/steel-plan-transform.js +78 -0
  40. package/dist/web/tool-updates.js +5 -0
  41. package/dist/web/workspaces.js +1438 -159
  42. package/launch.mjs +36 -5
  43. package/package.json +7 -4
package/launch.mjs CHANGED
@@ -629,9 +629,9 @@ export async function cmdRestart() {
629
629
  }
630
630
 
631
631
  // Read a JSON API endpoint on the local server.
632
- function apiJson(path, method = 'GET') {
632
+ function apiJson(path, method = 'GET', timeoutMs = 5000) {
633
633
  return new Promise((resolve, reject) => {
634
- const req = http.request(`http://127.0.0.1:${PORT}${path}`, { method, timeout: 5000 }, (res) => {
634
+ const req = http.request(`http://127.0.0.1:${PORT}${path}`, { method, timeout: timeoutMs }, (res) => {
635
635
  let body = '';
636
636
  res.on('data', (c) => (body += c));
637
637
  res.on('end', () => { try { resolve(JSON.parse(body || '{}')); } catch { resolve({}); } });
@@ -649,16 +649,47 @@ export async function cmdLogin() {
649
649
  if (!(await ping())) {
650
650
  if (!(await ensureServerUp())) { process.exitCode = 1; return; }
651
651
  }
652
- const started = await apiJson('/api/license/start', 'POST').catch(() => ({}));
653
- log(`opening sign-in in your browser${started.signInUrl ? `: ${started.signInUrl}` : ''}`);
652
+ // #2786: the server registers the sign-in with floless.io before it opens the page (up to 15 s), so wait longer.
653
+ const started = await apiJson('/api/license/start', 'POST', 30000).catch(() => ({}));
654
+ if (!started.signInUrl) {
655
+ log(started.code === 'sign-in-could-not-start'
656
+ ? started.error // already says to try again in a moment
657
+ : 'FloLess could not confirm that the sign-in started. If no sign-in page opened, run "floless login" again.');
658
+ process.exitCode = 1;
659
+ return;
660
+ }
661
+ log(`opening sign-in in your browser: ${started.signInUrl}`);
654
662
  log('waiting for sign-in to complete…');
655
- const deadline = Date.now() + 185000;
663
+ // The server watches the sign-in for its whole window and says how it ended (signIn), so wait as long as it does.
664
+ const deadline = Date.now() + 17 * 60_000;
665
+ let lockedAfterSignIn = 0;
656
666
  while (Date.now() < deadline) {
657
667
  const s = await apiJson('/api/license/status').catch(() => ({}));
658
668
  if (s.state === 'valid' || s.state === 'offline-grace') { log('signed in — subscription active'); return; }
659
669
  if (s.state === 'expired') { log(`signed in, but the subscription is expired — subscribe at ${s.signInUrl ?? 'floless.io'}`); return; }
670
+ // signIn names the latest sign-in: this one, or a newer one started elsewhere, which is followed the same way.
671
+ const ended = !s.state ? null : !s.signIn ? 'stopped' : s.signIn.state === 'refused' || s.signIn.state === 'expired' ? s.signIn.state : null;
672
+ if (ended) {
673
+ log({
674
+ refused: 'FloLess did not receive this sign-in from floless.io, so you are still signed out. Run "floless login" to start a new sign-in.',
675
+ expired: 'This sign-in expired before it was finished, so you are still signed out. Run "floless login" to start a new sign-in.',
676
+ stopped: 'FloLess is no longer waiting for this sign-in, so you are still signed out. Run "floless login" to start a new sign-in.',
677
+ }[ended]);
678
+ process.exitCode = 1;
679
+ return;
680
+ }
681
+ // Signed in, but FloLess is still locked: the first licence check after a sign-in can take a moment, so give it a
682
+ // few polls, then say what is known. Only the server's reason may name a cause.
683
+ if (s.signIn?.state === 'done' && (s.reason === 'no-subscription' || ++lockedAfterSignIn >= 3)) {
684
+ log(s.reason === 'no-subscription'
685
+ ? `signed in, but this account has no active subscription — subscribe at ${s.signInUrl ?? 'floless.io'}`
686
+ : 'signed in, but FloLess could not confirm a subscription for this account yet — open FloLess to see what it needs');
687
+ process.exitCode = 1;
688
+ return;
689
+ }
660
690
  await new Promise((r) => setTimeout(r, 2000));
661
691
  }
692
+ process.exitCode = 1;
662
693
  log('sign-in timed out — run "floless login" again to retry');
663
694
  }
664
695
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.159.0",
3
+ "version": "0.161.0",
4
4
  "type": "module",
5
5
  "description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
6
6
  "bin": {
@@ -22,9 +22,9 @@
22
22
  "app:stop": "node launch.mjs stop",
23
23
  "app:restart": "node launch.mjs restart",
24
24
  "test": "node build/run-tests.mjs",
25
- "test:steel-inspector": "tsx --test steel-filter-inspector.required.ts",
26
- "test:drawing-identify": "tsx --test drawing-identify.required.ts",
27
- "test:drawing-check": "tsx --test drawing-check.required.ts",
25
+ "test:steel-inspector": "node build/run-required-tests.mjs steel-filter-inspector.required.ts",
26
+ "test:drawing-identify": "node build/run-required-tests.mjs drawing-identify.required.ts",
27
+ "test:drawing-check": "node build/run-required-tests.mjs drawing-check.required.ts",
28
28
  "test:project-import-pdf": "node build/run-required-tests.mjs projects-store.test.ts rfi-import.test.ts",
29
29
  "test:platform": "node build/run-tests.mjs --platform-only",
30
30
  "test:clock-skew": "node build/run-clock-skew-tests.mjs",
@@ -40,14 +40,17 @@
40
40
  "verify:skill-parity": "node build/verify-skill-parity.mjs",
41
41
  "verify:flo": "node build/verify-flo-descriptions.mjs",
42
42
  "verify:aisc": "node build/verify-aisc-table.mjs",
43
+ "verify:uk-catalog": "node build/verify-uk-catalog-weights.mjs",
43
44
  "verify:flo-naming": "node build/verify-flo-naming.mjs",
44
45
  "verify:forward-merge": "node build/verify-forward-merge.mjs",
45
46
  "verify:no-title": "node build/verify-no-title.mjs",
47
+ "verify:web-syntax": "node build/verify-web-syntax.mjs",
46
48
  "verify:no-wallclock-asserts": "node build/verify-no-wallclock-asserts.mjs",
47
49
  "verify:windows-hide": "node build/verify-windows-hide.mjs",
48
50
  "verify:css-vars": "node build/verify-css-vars.mjs",
49
51
  "verify:runtime-pins": "node build/verify-runtime-pins.mjs",
50
52
  "verify:rvt-registry-pins": "node build/verify-rvt-registry-pins.mjs",
53
+ "verify:builtin-agent-pins": "node build/verify-builtin-agent-pins.mjs",
51
54
  "verify:native-steel": "node build/verify-native-steel.mjs",
52
55
  "verify:no-native-select": "node build/verify-no-native-select.mjs",
53
56
  "verify:scrollbars": "node build/verify-scrollbars.mjs",