@floless/app 0.153.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 (53) hide show
  1. package/dist/floless-server.cjs +51767 -38222
  2. package/dist/schemas/revit.model.v1.schema.json +5 -0
  3. package/dist/schemas/steel.model.v2.schema.json +19 -5
  4. package/dist/skills/floless-app-new-workflow/SKILL.md +8 -2
  5. package/dist/skills/floless-app-onboarding/SKILL.md +31 -19
  6. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +20 -11
  7. package/dist/skills/floless-app-queue/SKILL.md +23 -4
  8. package/dist/skills/floless-app-steel-model/SKILL.md +23 -2
  9. package/dist/skills/floless-app-steel-takeoff/SKILL.md +158 -65
  10. package/dist/skills/floless-app-workflows/SKILL.md +23 -5
  11. package/dist/skills/floless-app-workflows/references/blender-exec.md +183 -0
  12. package/dist/skills/floless-app-workflows/references/dev-server-and-run-trace.md +27 -12
  13. package/dist/templates/blender-construction-sequence.flo +96 -0
  14. package/dist/web/agents.js +33 -13
  15. package/dist/web/app.css +331 -34
  16. package/dist/web/app.js +12 -1
  17. package/dist/web/aware.js +1167 -137
  18. package/dist/web/chat-question-card.js +477 -0
  19. package/dist/web/chat.css +237 -25
  20. package/dist/web/chat.js +2156 -889
  21. package/dist/web/commands-shell.js +578 -21
  22. package/dist/web/commands-steel.js +105 -4
  23. package/dist/web/guide.js +217 -16
  24. package/dist/web/index.html +104 -10
  25. package/dist/web/instructor.js +10 -9
  26. package/dist/web/left-pane.js +43 -6
  27. package/dist/web/media-player.js +234 -0
  28. package/dist/web/model-editor-contract.js +2 -0
  29. package/dist/web/model-editor-revit-adapter.js +1 -0
  30. package/dist/web/model-editor-steel-adapter.js +89 -1
  31. package/dist/web/model-panel-bridge.js +16 -2
  32. package/dist/web/model-view-query.js +590 -0
  33. package/dist/web/model-viewport-revit-adapter.js +15 -1
  34. package/dist/web/model-viewport-toolbar.js +5 -2
  35. package/dist/web/pages.js +592 -0
  36. package/dist/web/panels.js +2 -1
  37. package/dist/web/revit-editor.js +182 -16
  38. package/dist/web/run-progress.js +193 -0
  39. package/dist/web/run-strip.js +173 -0
  40. package/dist/web/steel-3d-core.js +70 -0
  41. package/dist/web/steel-editor.html +2751 -219
  42. package/dist/web/steel-frames-core.js +958 -0
  43. package/dist/web/steel-last-seen.js +315 -0
  44. package/dist/web/steel-marks-core.js +530 -0
  45. package/dist/web/steel-model-slim.js +95 -0
  46. package/dist/web/steel-model-v2-client-validation.js +14 -2
  47. package/dist/web/steel-model-v2-commands.js +258 -27
  48. package/dist/web/steel-model-v2-projection.js +78 -18
  49. package/dist/web/steel-read-confidence.js +11 -2
  50. package/dist/web/tekla-structural-grid-adapter.js +7 -1
  51. package/dist/web/tool-updates.js +141 -33
  52. package/dist/web/workspaces.js +446 -30
  53. package/package.json +3 -2
@@ -292,11 +292,14 @@
292
292
  // ── The footer pill ────────────────────────────────────────────────────────
293
293
  function paintPill() {
294
294
  var offers = view && view.supported ? view.offers || [] : [];
295
+ // Only the rows the person can act on count: FloLess's own, archived and in-progress workflows (the quiet groups) never
296
+ // do. The server says how many; a server without groups counts every row, as before.
295
297
  var needs = view && view.supported ? view.needsYou || [] : [];
298
+ var needCount = view && view.supported && typeof view.needsCount === 'number' ? view.needsCount : needs.length;
296
299
  var cleanup = cleanupNeeds();
297
300
  var urgent = offers.filter(function (o) { return !!o.advisory; }).length;
298
301
  // Only a check this page started: a background pass is not something the person is waiting for.
299
- if (!offers.length && !needs.length && !cleanup.length && !checking) {
302
+ if (!offers.length && !needCount && !cleanup.length && !checking) {
300
303
  // A pill that disappears under the keyboard's focus must not drop focus to the page behind.
301
304
  if (document.activeElement === $pill) { var menu = document.getElementById('menu-btn'); if (menu) menu.focus(); }
302
305
  $pill.hidden = true;
@@ -317,11 +320,11 @@
317
320
  var days = Math.max.apply(null, offers.map(function (o) { return o.waitingDays || 0; }));
318
321
  text += ' · waiting ' + plural(days, 'day', 'days');
319
322
  }
320
- } else if (needs.length || cleanup.length) {
323
+ } else if (needCount || cleanup.length) {
321
324
  state = 'needs';
322
325
  var folders = cleanup.filter(function (c) { return c.kind !== 'unreadable'; }).length;
323
- if (needs.length && cleanup.length) text = (needs.length + cleanup.length) + ' things need you';
324
- else if (needs.length) text = plural(needs.length, 'workflow needs you', 'workflows need you');
326
+ if (needCount && cleanup.length) text = (needCount + cleanup.length) + ' things need you';
327
+ else if (needCount) text = plural(needCount, 'workflow needs you', 'workflows need you');
325
328
  else if (folders === cleanup.length) text = plural(folders, 'folder needs you', 'folders need you');
326
329
  else text = plural(cleanup.length, 'item needs you', 'items need you');
327
330
  } else {
@@ -371,36 +374,47 @@
371
374
  return card;
372
375
  }
373
376
 
374
- function needsRow(item) {
377
+ /** A row under a group's explanation says only which workflow (and what is specific to it); a row with no group (an older server) carries its own sentence. */
378
+ function needsRow(item, grouped) {
375
379
  var row = el('div', 'tool-updates-needs');
376
380
  row.setAttribute('data-app', item.app);
377
381
  row.setAttribute('data-kind', item.kind);
378
382
  var text = el('div', 'tool-updates-needs-text');
379
383
  text.appendChild(el('span', 'tool-updates-needs-name', item.workflowName));
380
- text.appendChild(el('span', 'tool-updates-needs-sentence', item.sentence));
384
+ if (!grouped) text.appendChild(el('span', 'tool-updates-needs-sentence', item.sentence));
385
+ else if (item.detail) text.appendChild(el('span', 'tool-updates-needs-sentence', item.detail));
381
386
  row.appendChild(text);
382
- var bridge = window.flolessBridge;
383
- // Offered only for a workflow the Workflows page lists — one installed from a terminal cannot be opened here.
384
- if (item.action === 'open-workflow' && bridge && typeof bridge.openApp === 'function'
385
- && typeof bridge.canOpenApp === 'function' && bridge.canOpenApp(item.app)) {
386
- var openButton = el('button', 'tool-updates-open', 'Open workflow');
387
- openButton.type = 'button';
388
- openButton.setAttribute('data-command-id', 'shell.tool-updates-open-workflow');
389
- openButton.setAttribute('data-tip', 'Open ' + item.workflowName + ' to do this');
390
- openButton.addEventListener('click', function () {
391
- close();
392
- Promise.resolve(bridge.openApp(item.app)).catch(function (error) {
393
- console.warn('could not open the workflow', error);
394
- // Back to the dialog, with the reason in its live line (open() clears that line, so it is set after).
395
- open($pill.hidden ? null : $pill);
396
- $live.textContent = error.message;
397
- });
398
- });
399
- row.appendChild(openButton);
387
+ if (item.action === 'open-workflow') {
388
+ // Offered only for a workflow the Workflows page lists — one installed from a terminal cannot be opened here. That list
389
+ // loads on its own schedule, so a row it does not list yet is marked and given its button the moment it does.
390
+ if (!attachOpenButton(row, item)) row.setAttribute('data-awaiting-open', '');
400
391
  }
401
392
  return row;
402
393
  }
403
394
 
395
+ /** The Open workflow button, once the Workflows page lists this workflow. False while it does not. */
396
+ function attachOpenButton(row, item) {
397
+ var bridge = window.flolessBridge;
398
+ if (!(bridge && typeof bridge.openApp === 'function' && typeof bridge.canOpenApp === 'function' && bridge.canOpenApp(item.app))) return false;
399
+ var openButton = el('button', 'tool-updates-open', 'Open workflow');
400
+ openButton.type = 'button';
401
+ openButton.setAttribute('data-command-id', 'shell.tool-updates-open-workflow');
402
+ openButton.setAttribute('data-tip', 'Open ' + item.workflowName + ' to do this');
403
+ openButton.setAttribute('aria-label', 'Open workflow ' + item.workflowName);
404
+ openButton.addEventListener('click', function () {
405
+ close();
406
+ Promise.resolve(bridge.openApp(item.app)).catch(function (error) {
407
+ console.warn('could not open the workflow', error);
408
+ // Back to the dialog, with the reason in its live line (open() clears that line, so it is set after).
409
+ open($pill.hidden ? null : $pill);
410
+ $live.textContent = error.message;
411
+ });
412
+ });
413
+ row.appendChild(openButton);
414
+ row.removeAttribute('data-awaiting-open');
415
+ return true;
416
+ }
417
+
404
418
  var forgetting = null; // the path being removed from the list, while its request is in flight
405
419
 
406
420
  function cleanupRow(item) {
@@ -479,6 +493,86 @@
479
493
  return lines;
480
494
  }
481
495
 
496
+ // ── The Needs-you rows, under the server's explanations (#2180) ──────────────────────────────────────────────
497
+ // The server says what each group of rows is (title, one explanation, whether the person can act on it); this only lays
498
+ // them out. A group the person can act on shows its explanation and its rows; the quiet ones (FloLess's own workflows,
499
+ // archived ones, runs in progress) sit collapsed under "Nothing to do" and never count toward the pill.
500
+ var QUIET_OPEN = {}; // group id → the person opened (true) or closed (false) its list; kept across repaints
501
+ var OPEN_WITHOUT_ASKING = 3; // a group this short shows its rows straight away
502
+
503
+ function groupHead(group, count) {
504
+ var head = el('div', 'tool-updates-group-head');
505
+ head.appendChild(el('span', 'tool-updates-group-title', group.title));
506
+ head.appendChild(el('span', 'tool-updates-group-count', String(count)));
507
+ return head;
508
+ }
509
+
510
+ /** Only the person's own click or key press on the summary is remembered: a list's default state is set again at every repaint. */
511
+ function rememberOpen(details, id) {
512
+ var summary = details.querySelector('summary');
513
+ if (summary) summary.addEventListener('click', function () { setTimeout(function () { QUIET_OPEN[id] = details.open; }, 0); });
514
+ }
515
+
516
+ function actionGroup(group, rows) {
517
+ var box = el('div', 'tool-updates-group');
518
+ box.setAttribute('data-group', group.id);
519
+ box.appendChild(groupHead(group, rows.length));
520
+ box.appendChild(el('p', 'tool-updates-group-explain', group.explanation));
521
+ var list = el('details', 'tool-updates-group-rows');
522
+ var open = QUIET_OPEN[group.id];
523
+ list.open = open === undefined ? rows.length <= OPEN_WITHOUT_ASKING : open;
524
+ var what = rows.length === 1 ? 'the workflow' : 'the ' + rows.length + ' workflows';
525
+ var toggle = el('summary', null, (list.open ? 'Hide ' : 'Show ') + what);
526
+ toggle.setAttribute('data-command-id', 'shell.tool-updates-show-workflows');
527
+ list.appendChild(toggle);
528
+ rememberOpen(list, group.id);
529
+ // The click runs before the browser flips `open`, so the label says what the click is about to do; `toggle` (which comes later, and also for a change made by other means) settles it.
530
+ toggle.addEventListener('click', function () { toggle.textContent = (list.open ? 'Show ' : 'Hide ') + what; });
531
+ list.addEventListener('toggle', function () { toggle.textContent = (list.open ? 'Hide ' : 'Show ') + what; });
532
+ rows.forEach(function (n) { list.appendChild(needsRow(n, true)); });
533
+ box.appendChild(list);
534
+ return box;
535
+ }
536
+
537
+ function quietGroup(group, rows) {
538
+ var box = el('details', 'tool-updates-group tool-updates-group-quiet');
539
+ box.setAttribute('data-group', group.id);
540
+ box.open = QUIET_OPEN[group.id] === true;
541
+ var summary = el('summary', null);
542
+ summary.setAttribute('data-command-id', 'shell.tool-updates-show-workflows');
543
+ summary.appendChild(el('span', 'tool-updates-group-title', group.title));
544
+ summary.appendChild(el('span', 'tool-updates-group-count', String(rows.length)));
545
+ box.appendChild(summary);
546
+ rememberOpen(box, group.id);
547
+ box.appendChild(el('p', 'tool-updates-group-explain', group.explanation));
548
+ rows.forEach(function (n) { box.appendChild(needsRow(n, true)); });
549
+ return box;
550
+ }
551
+
552
+ /** The workflows' rows, laid out by group. An older server's view has no groups: its flat rows are listed as they come. */
553
+ function paintNeeds(needs, cleanup) {
554
+ var groups = view && Array.isArray(view.needsGroups) ? view.needsGroups : null;
555
+ var rowsOf = function (id) { return needs.filter(function (n) { return n.group === id; }); };
556
+ var loose = groups ? needs.filter(function (n) { return !groups.some(function (g) { return g.id === n.group; }); }) : needs;
557
+ var acting = groups ? groups.filter(function (g) { return g.tone === 'action' && rowsOf(g.id).length; }) : [];
558
+ var quiet = groups ? groups.filter(function (g) { return g.tone !== 'action' && rowsOf(g.id).length; }) : [];
559
+ var count = (groups ? acting.reduce(function (n, g) { return n + rowsOf(g.id).length; }, 0) + loose.length : needs.length) + cleanup.length;
560
+ if (count) {
561
+ var needsSection = section('Needs you', count);
562
+ acting.forEach(function (g) { needsSection.appendChild(actionGroup(g, rowsOf(g.id))); });
563
+ loose.forEach(function (n) { needsSection.appendChild(needsRow(n, false)); });
564
+ cleanup.forEach(function (n) { needsSection.appendChild(cleanupRow(n)); });
565
+ $body.appendChild(needsSection);
566
+ }
567
+ if (quiet.length) {
568
+ var total = quiet.reduce(function (n, g) { return n + rowsOf(g.id).length; }, 0);
569
+ var quietSection = section('Nothing to do', total);
570
+ quiet.forEach(function (g) { quietSection.appendChild(quietGroup(g, rowsOf(g.id))); });
571
+ $body.appendChild(quietSection);
572
+ }
573
+ return count + (quiet.length ? 1 : 0);
574
+ }
575
+
482
576
  function section(title, count) {
483
577
  var wrap = el('div', 'tool-updates-section');
484
578
  wrap.appendChild(el('div', 'tool-updates-section-head', title + ' (' + count + ')'));
@@ -530,6 +624,7 @@
530
624
  command: active.getAttribute('data-command-id'),
531
625
  path: row && row.getAttribute('data-path'),
532
626
  app: row && row.getAttribute('data-app'),
627
+ group: !row && active.closest ? (active.closest('[data-group]') || { getAttribute: function () { return null; } }).getAttribute('data-group') : null,
533
628
  head: active.classList.contains('tool-updates-section-head'),
534
629
  };
535
630
  }
@@ -541,7 +636,8 @@
541
636
  else if (key.command) {
542
637
  target = Array.prototype.find.call($body.querySelectorAll('[data-command-id="' + key.command + '"]'), function (b) {
543
638
  var row = b.closest('.tool-updates-needs');
544
- return !row || (row.getAttribute('data-path') === key.path && row.getAttribute('data-app') === key.app);
639
+ if (!row) return (b.closest('[data-group]') ? b.closest('[data-group]').getAttribute('data-group') : null) === key.group;
640
+ return row.getAttribute('data-path') === key.path && row.getAttribute('data-app') === key.app;
545
641
  }) || null;
546
642
  }
547
643
  if (target && target.offsetParent !== null) {
@@ -552,6 +648,20 @@
552
648
  }
553
649
  }
554
650
 
651
+ // A dialog painted before the Workflows page has listed its workflows had no Open workflow buttons and never got them. The page
652
+ // says when its list arrives (floless:workflows-listed); rows marked data-awaiting-open are then given their button in place.
653
+ // Nothing is rebuilt, so a click, a tooltip or the screen reader's place is never lost.
654
+ function giveAwaitingOpenButtons() {
655
+ var rows = $body.querySelectorAll('.tool-updates-needs[data-awaiting-open]');
656
+ if (!rows.length) return;
657
+ var byApp = {};
658
+ ((view && view.needsYou) || []).forEach(function (n) { byApp[n.app] = n; });
659
+ Array.prototype.forEach.call(rows, function (row) {
660
+ var item = byApp[row.getAttribute('data-app')];
661
+ if (item) attachOpenButton(row, item);
662
+ });
663
+ }
664
+
555
665
  function paint() {
556
666
  var keepFocus = focusKey();
557
667
  try { paintNow(); } finally { restoreFocus(keepFocus); }
@@ -591,19 +701,16 @@
591
701
  }
592
702
  }
593
703
  var cleanup = cleanupNeeds();
594
- if (needs.length || cleanup.length) {
595
- var needsSection = section('Needs you', needs.length + cleanup.length);
596
- needs.forEach(function (n) { needsSection.appendChild(needsRow(n)); });
597
- cleanup.forEach(function (n) { needsSection.appendChild(cleanupRow(n)); });
598
- $body.appendChild(needsSection);
599
- }
600
- if (!results && !offers.length && !needs.length && !cleanup.length && view && view.supported && !view.sentence) {
704
+ var shownRows = paintNeeds(needs, cleanup);
705
+ if (!results && !offers.length && !shownRows && view && view.supported && !view.sentence) {
601
706
  $body.appendChild(el('div', 'tool-updates-summary', view.checking
602
707
  ? 'Checking which workflows a tool update affects…'
603
708
  : 'All your workflows are on the tool versions you approved.'));
604
709
  }
605
710
  var dl = downloadsLine();
606
- if (dl) $foot.appendChild(el('div', 'tool-updates-downloads', dl));
711
+ if (dl) $foot.appendChild(el('div', 'tool-updates-downloads' + (view.downloads && view.downloads.error ? ' tool-updates-downloads-problem' : ''), dl));
712
+ // Tools AWARE left as they are because they are the person's own copy: said apart from a failure.
713
+ if (view && view.downloads && view.downloads.note) $foot.appendChild(el('div', 'tool-updates-downloads', view.downloads.note));
607
714
  cleanupLines().forEach(function (line) { $foot.appendChild(el('div', 'tool-updates-downloads', line)); });
608
715
  var checked = lastChecked();
609
716
  if (checked) $foot.appendChild(el('div', 'tool-updates-downloads', checked));
@@ -822,6 +929,7 @@
822
929
 
823
930
  window.addEventListener('floless:tool-updates-changed', function () { void refresh(); });
824
931
  window.addEventListener('floless:apps-changed', function () { void refresh(); });
932
+ window.addEventListener('floless:workflows-listed', giveAwaitingOpenButtons);
825
933
  window.flolessToolUpdates = { refresh: refresh, open: open };
826
934
  void refresh();
827
935
  })();