@floless/app 0.155.1 → 0.156.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.
- package/cli-actions.mjs +376 -0
- package/dist/floless-server.cjs +101615 -87681
- package/dist/skills/floless-app-actions/SKILL.md +137 -0
- package/dist/skills/floless-app-approval/SKILL.md +8 -5
- package/dist/skills/floless-app-bridge/SKILL.md +12 -9
- package/dist/skills/floless-app-knowledge/SKILL.md +30 -13
- package/dist/skills/floless-app-new-workflow/SKILL.md +4 -4
- package/dist/skills/floless-app-onboarding/SKILL.md +1 -1
- package/dist/skills/floless-app-onboarding/references/aware-runtime.md +4 -4
- package/dist/skills/floless-app-queue/SKILL.md +10 -6
- package/dist/skills/floless-app-report-issue/SKILL.md +13 -10
- package/dist/skills/floless-app-rfi/SKILL.md +59 -68
- package/dist/skills/floless-app-routines/SKILL.md +19 -14
- package/dist/skills/floless-app-routines/references/routines-api.md +8 -2
- package/dist/skills/floless-app-workflows/SKILL.md +5 -4
- package/dist/web/agent-steps.js +933 -0
- package/dist/web/agents.js +5 -0
- package/dist/web/app.css +210 -5
- package/dist/web/app.js +1 -0
- package/dist/web/aware.js +584 -44
- package/dist/web/chat.css +9 -0
- package/dist/web/chat.js +195 -13
- package/dist/web/commands-shell.js +299 -1
- package/dist/web/commands-tekla-parser.js +7 -0
- package/dist/web/index.html +52 -1
- package/dist/web/instructor.js +5 -3
- package/dist/web/leave-guard.js +4 -2
- package/dist/web/left-pane.js +145 -42
- package/dist/web/model-editor.css +10 -0
- package/dist/web/model-group-navigator.js +331 -0
- package/dist/web/model-panel-bridge.js +63 -5
- package/dist/web/model-pointer-dock.js +55 -5
- package/dist/web/model-revit-module.js +15 -0
- package/dist/web/model-selection-tools.js +53 -17
- package/dist/web/model-tekla-selection.js +75 -2
- package/dist/web/model-viewport-revit-adapter.js +17 -10
- package/dist/web/pages.js +27 -3
- package/dist/web/panels.js +3 -3
- package/dist/web/project-reconciliation.js +357 -0
- package/dist/web/revit-editor.js +464 -76
- package/dist/web/steel-3d-view.js +1 -0
- package/dist/web/terminal-requests.js +541 -0
- package/dist/web/tool-updates.js +147 -13
- package/dist/web/workspaces.js +213 -12
- package/launch.mjs +80 -2
- package/package.json +1 -1
package/dist/web/tool-updates.js
CHANGED
|
@@ -39,9 +39,12 @@
|
|
|
39
39
|
var $check = document.getElementById('tool-updates-check');
|
|
40
40
|
var $cancel = document.getElementById('tool-updates-cancel');
|
|
41
41
|
var $approve = document.getElementById('tool-updates-approve');
|
|
42
|
+
var CANCEL_COMMAND = $cancel.getAttribute('data-command-id');
|
|
42
43
|
|
|
43
44
|
var view = null;
|
|
44
45
|
var results = null;
|
|
46
|
+
var compileSelection = null; // immutable review shown before the person's separate confirmation
|
|
47
|
+
var compileExcluded = [];
|
|
45
48
|
|
|
46
49
|
// ── The view never goes back in time (#2013; also closes #1997's stale-answer race) ──────────────────────
|
|
47
50
|
// Every change to the view comes from a request this page sends — the server's `tool-updates-changed` broadcast only
|
|
@@ -298,8 +301,9 @@
|
|
|
298
301
|
var needCount = view && view.supported && typeof view.needsCount === 'number' ? view.needsCount : needs.length;
|
|
299
302
|
var cleanup = cleanupNeeds();
|
|
300
303
|
var urgent = offers.filter(function (o) { return !!o.advisory; }).length;
|
|
304
|
+
var firstCheck = !!(view && view.supported && view.checking && !view.checkedAt);
|
|
301
305
|
// Only a check this page started: a background pass is not something the person is waiting for.
|
|
302
|
-
if (!offers.length && !needCount && !cleanup.length && !checking) {
|
|
306
|
+
if (!offers.length && !needCount && !cleanup.length && !checking && !firstCheck) {
|
|
303
307
|
// A pill that disappears under the keyboard's focus must not drop focus to the page behind.
|
|
304
308
|
if (document.activeElement === $pill) { var menu = document.getElementById('menu-btn'); if (menu) menu.focus(); }
|
|
305
309
|
$pill.hidden = true;
|
|
@@ -320,10 +324,12 @@
|
|
|
320
324
|
var days = Math.max.apply(null, offers.map(function (o) { return o.waitingDays || 0; }));
|
|
321
325
|
text += ' · waiting ' + plural(days, 'day', 'days');
|
|
322
326
|
}
|
|
327
|
+
if (needCount || cleanup.length) text += ' · ' + (needCount + cleanup.length) + ' also need you';
|
|
323
328
|
} else if (needCount || cleanup.length) {
|
|
324
329
|
state = 'needs';
|
|
325
330
|
var folders = cleanup.filter(function (c) { return c.kind !== 'unreadable'; }).length;
|
|
326
|
-
if (needCount && cleanup.length) text = (needCount
|
|
331
|
+
if (needCount && cleanup.length) text = plural(needCount, 'workflow', 'workflows') + ' · '
|
|
332
|
+
+ plural(cleanup.length, folders === cleanup.length ? 'folder' : 'item', folders === cleanup.length ? 'folders' : 'items') + ' need you';
|
|
327
333
|
else if (needCount) text = plural(needCount, 'workflow needs you', 'workflows need you');
|
|
328
334
|
else if (folders === cleanup.length) text = plural(folders, 'folder needs you', 'folders need you');
|
|
329
335
|
else text = plural(cleanup.length, 'item needs you', 'items need you');
|
|
@@ -332,10 +338,11 @@
|
|
|
332
338
|
text = 'Checking for tool updates…';
|
|
333
339
|
}
|
|
334
340
|
// Something to act on keeps its wording and colour; a running check is added to it, not put in its place.
|
|
335
|
-
if (
|
|
341
|
+
if (firstCheck) text = 'Checking workflow approvals…' + (cleanup.length ? ' · ' + plural(cleanup.length, 'cleanup item needs you', 'cleanup items need you') : '');
|
|
342
|
+
else if (checking && state !== 'checking') text += ' · checking…';
|
|
336
343
|
$pill.textContent = text;
|
|
337
344
|
$pill.setAttribute('data-state', state);
|
|
338
|
-
$pill.setAttribute('data-tip', !checking ? PILL_TIP : state === 'checking'
|
|
345
|
+
$pill.setAttribute('data-tip', firstCheck ? 'The first workflow check is still running. The total is not known yet.' : !checking ? PILL_TIP : state === 'checking'
|
|
339
346
|
? 'Still checking for tool updates. Open to watch it.' : PILL_TIP + '. A check is also running.');
|
|
340
347
|
$pill.hidden = false;
|
|
341
348
|
if (isOpen() && !approving && !results) paint();
|
|
@@ -381,13 +388,19 @@
|
|
|
381
388
|
row.setAttribute('data-kind', item.kind);
|
|
382
389
|
var text = el('div', 'tool-updates-needs-text');
|
|
383
390
|
text.appendChild(el('span', 'tool-updates-needs-name', item.workflowName));
|
|
391
|
+
if (item.sourcePath) text.appendChild(el('span', 'tool-updates-needs-sentence', item.sourcePath));
|
|
384
392
|
if (!grouped) text.appendChild(el('span', 'tool-updates-needs-sentence', item.sentence));
|
|
385
393
|
else if (item.detail) text.appendChild(el('span', 'tool-updates-needs-sentence', item.detail));
|
|
386
394
|
row.appendChild(text);
|
|
387
395
|
if (item.action === 'open-workflow') {
|
|
388
396
|
// Offered only for a workflow the Workflows page lists — one installed from a terminal cannot be opened here. That list
|
|
389
397
|
// 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))
|
|
398
|
+
if (!attachOpenButton(row, item)) {
|
|
399
|
+
row.setAttribute('data-awaiting-open', '');
|
|
400
|
+
text.appendChild(el('span', 'tool-updates-needs-sentence tool-updates-open-help', item.compileReview
|
|
401
|
+
? 'This workflow is outside the picker. Use Review bulk compile above to record its current tool versions.'
|
|
402
|
+
: item.compileNextStep || 'This workflow is outside the picker. Ask AI Chat to locate its source file and help you compile it.'));
|
|
403
|
+
}
|
|
391
404
|
}
|
|
392
405
|
return row;
|
|
393
406
|
}
|
|
@@ -411,6 +424,8 @@
|
|
|
411
424
|
});
|
|
412
425
|
});
|
|
413
426
|
row.appendChild(openButton);
|
|
427
|
+
var help = row.querySelector('.tool-updates-open-help');
|
|
428
|
+
if (help) help.remove();
|
|
414
429
|
row.removeAttribute('data-awaiting-open');
|
|
415
430
|
return true;
|
|
416
431
|
}
|
|
@@ -518,6 +533,24 @@
|
|
|
518
533
|
box.setAttribute('data-group', group.id);
|
|
519
534
|
box.appendChild(groupHead(group, rows.length));
|
|
520
535
|
box.appendChild(el('p', 'tool-updates-group-explain', group.explanation));
|
|
536
|
+
var eligible = rows.filter(function (n) { return !!n.compileReview; });
|
|
537
|
+
if (eligible.length) {
|
|
538
|
+
var review = el('button', 'tool-updates-open', 'Review bulk compile (' + eligible.length + ')');
|
|
539
|
+
review.type = 'button';
|
|
540
|
+
review.setAttribute('data-command-id', 'shell.tool-updates-review-compile');
|
|
541
|
+
review.setAttribute('data-tip', 'Review the workflows and consequences before compiling them together');
|
|
542
|
+
lock(review, approving ? 'Compiling now.' : '');
|
|
543
|
+
review.addEventListener('click', function () {
|
|
544
|
+
if (approving) return;
|
|
545
|
+
compileSelection = eligible.map(function (n) { return Object.assign({}, n, { compileReview: Object.assign({}, n.compileReview) }); });
|
|
546
|
+
compileExcluded = rows.filter(function (n) { return !n.compileReview; }).map(function (n) { return Object.assign({}, n); });
|
|
547
|
+
results = null;
|
|
548
|
+
$live.textContent = '';
|
|
549
|
+
paint();
|
|
550
|
+
$title.focus();
|
|
551
|
+
});
|
|
552
|
+
box.appendChild(review);
|
|
553
|
+
}
|
|
521
554
|
var list = el('details', 'tool-updates-group-rows');
|
|
522
555
|
var open = QUIET_OPEN[group.id];
|
|
523
556
|
list.open = open === undefined ? rows.length <= OPEN_WITHOUT_ASKING : open;
|
|
@@ -570,7 +603,7 @@
|
|
|
570
603
|
quiet.forEach(function (g) { quietSection.appendChild(quietGroup(g, rowsOf(g.id))); });
|
|
571
604
|
$body.appendChild(quietSection);
|
|
572
605
|
}
|
|
573
|
-
return count
|
|
606
|
+
return count;
|
|
574
607
|
}
|
|
575
608
|
|
|
576
609
|
function section(title, count) {
|
|
@@ -583,7 +616,7 @@
|
|
|
583
616
|
var row = el('div', 'tool-updates-result');
|
|
584
617
|
row.setAttribute('data-outcome', result.outcome);
|
|
585
618
|
row.setAttribute('data-app', result.app);
|
|
586
|
-
row.appendChild(el('span', 'tool-updates-result-mark', result.outcome === 'moved' ? '✓' : '!')).setAttribute('aria-hidden', 'true');
|
|
619
|
+
row.appendChild(el('span', 'tool-updates-result-mark', result.outcome === 'moved' || result.outcome === 'compiled' ? '✓' : '!')).setAttribute('aria-hidden', 'true');
|
|
587
620
|
var text = el('div', 'tool-updates-result-text');
|
|
588
621
|
text.appendChild(el('span', 'tool-updates-result-name', result.workflowName));
|
|
589
622
|
text.appendChild(el('span', 'tool-updates-result-sentence', result.sentence));
|
|
@@ -671,6 +704,43 @@
|
|
|
671
704
|
function paintNow() {
|
|
672
705
|
$body.textContent = '';
|
|
673
706
|
$foot.textContent = '';
|
|
707
|
+
$cancel.setAttribute('data-command-id', compileSelection ? 'shell.tool-updates-back' : CANCEL_COMMAND);
|
|
708
|
+
$title.textContent = compileSelection ? 'Compile and approve workflows' : 'Approve updated workflows';
|
|
709
|
+
if (compileSelection) {
|
|
710
|
+
var warning = el('div', 'tool-updates-summary');
|
|
711
|
+
warning.appendChild(el('p', null, 'This compiles and records a fresh approval for ' + plural(compileSelection.length, 'workflow', 'workflows') + ' using their current files and the tools installed when each one compiles. Future runs may produce different results.'));
|
|
712
|
+
warning.appendChild(el('p', null, 'It does not request a manual run. Automation enabled while this batch is compiling may run using the new approvals. Edited workflows and workflows with automation already enabled are left for individual review.'));
|
|
713
|
+
$body.appendChild(warning);
|
|
714
|
+
var selected = section('Workflows to compile', compileSelection.length);
|
|
715
|
+
compileSelection.forEach(function (n) {
|
|
716
|
+
var row = el('div', 'tool-updates-needs');
|
|
717
|
+
var text = el('div', 'tool-updates-needs-text');
|
|
718
|
+
text.appendChild(el('span', 'tool-updates-needs-name', n.workflowName));
|
|
719
|
+
text.appendChild(el('span', 'tool-updates-needs-sentence', n.sourcePath || n.app));
|
|
720
|
+
row.appendChild(text); selected.appendChild(row);
|
|
721
|
+
});
|
|
722
|
+
$body.appendChild(selected);
|
|
723
|
+
if (compileExcluded.length) {
|
|
724
|
+
var excluded = section('Review individually', compileExcluded.length);
|
|
725
|
+
compileExcluded.forEach(function (n) {
|
|
726
|
+
var row = el('div', 'tool-updates-needs');
|
|
727
|
+
var text = el('div', 'tool-updates-needs-text');
|
|
728
|
+
text.appendChild(el('span', 'tool-updates-needs-name', n.workflowName));
|
|
729
|
+
text.appendChild(el('span', 'tool-updates-needs-sentence', n.compileNextStep || n.sentence));
|
|
730
|
+
row.appendChild(text); excluded.appendChild(row);
|
|
731
|
+
});
|
|
732
|
+
$body.appendChild(excluded);
|
|
733
|
+
}
|
|
734
|
+
var confirm = el('button', 'primary', 'Compile and approve ' + plural(compileSelection.length, 'workflow', 'workflows'));
|
|
735
|
+
confirm.type = 'button';
|
|
736
|
+
confirm.setAttribute('data-command-id', 'shell.tool-updates-confirm-compile');
|
|
737
|
+
lock(confirm, approving ? 'Compiling now.' : '');
|
|
738
|
+
confirm.addEventListener('click', function () { void compileReviewed(); });
|
|
739
|
+
$body.appendChild(confirm);
|
|
740
|
+
$approve.hidden = true; $check.hidden = true;
|
|
741
|
+
$cancel.textContent = approving ? 'Compiling…' : 'Back';
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
674
744
|
var offers = (view && view.offers) || [];
|
|
675
745
|
var needs = (view && view.needsYou) || [];
|
|
676
746
|
if (view && !view.supported) {
|
|
@@ -701,12 +771,16 @@
|
|
|
701
771
|
}
|
|
702
772
|
}
|
|
703
773
|
var cleanup = cleanupNeeds();
|
|
704
|
-
var
|
|
705
|
-
|
|
706
|
-
|
|
774
|
+
var needsYou = paintNeeds(needs, cleanup);
|
|
775
|
+
// Nothing to approve and nothing the person can act on: say so first, above any quiet "Nothing to do" rows, and do
|
|
776
|
+
// not title the dialog as if something were waiting for approval.
|
|
777
|
+
var allClear = !results && !offers.length && !needsYou && view && view.supported && !view.sentence;
|
|
778
|
+
if (allClear) {
|
|
779
|
+
$body.insertBefore(el('div', 'tool-updates-summary', view.checking
|
|
707
780
|
? 'Checking which workflows a tool update affects…'
|
|
708
|
-
: 'All your workflows are on the tool versions you approved.'));
|
|
781
|
+
: 'Nothing to do. All your workflows are on the tool versions you approved.'), $body.firstChild);
|
|
709
782
|
}
|
|
783
|
+
if (!offers.length && !results) $title.textContent = 'Tool updates';
|
|
710
784
|
var dl = downloadsLine();
|
|
711
785
|
if (dl) $foot.appendChild(el('div', 'tool-updates-downloads' + (view.downloads && view.downloads.error ? ' tool-updates-downloads-problem' : ''), dl));
|
|
712
786
|
// Tools AWARE left as they are because they are the person's own copy: said apart from a failure.
|
|
@@ -739,7 +813,9 @@
|
|
|
739
813
|
|
|
740
814
|
function syncControls() {
|
|
741
815
|
// Only an approval is busy for the screen reader: a busy dialog can make it hold back the step announcements inside.
|
|
742
|
-
$modal.setAttribute('aria-busy', approving ? 'true' : 'false');
|
|
816
|
+
$modal.setAttribute('aria-busy', approving && !compileSelection ? 'true' : 'false');
|
|
817
|
+
// Bulk item progress lives beside the body: do not mute that live region while the list is busy.
|
|
818
|
+
$body.setAttribute('aria-busy', approving && compileSelection ? 'true' : 'false');
|
|
743
819
|
lock($check, heldReason('A check is already running.'));
|
|
744
820
|
lock($approve, heldReason('Wait for the check to finish, then approve.'));
|
|
745
821
|
lock($cancel, approving ? 'Approving now.' : '');
|
|
@@ -762,9 +838,64 @@
|
|
|
762
838
|
syncProgress();
|
|
763
839
|
}
|
|
764
840
|
|
|
841
|
+
async function compileReviewed() {
|
|
842
|
+
if (!compileSelection || approving) return;
|
|
843
|
+
var selected = compileSelection;
|
|
844
|
+
var out = [];
|
|
845
|
+
approving = true;
|
|
846
|
+
paint(); syncControls(); $title.focus();
|
|
847
|
+
try {
|
|
848
|
+
for (var i = 0; i < selected.length; i++) {
|
|
849
|
+
var item = selected[i];
|
|
850
|
+
$live.textContent = 'Compiling ' + item.workflowName + ' (' + (i + 1) + ' of ' + selected.length + ')…';
|
|
851
|
+
var result = { app: item.app, workflowName: item.workflowName, outcome: 'not-moved', sentence: '' };
|
|
852
|
+
try {
|
|
853
|
+
var answer = await call('/api/compile', 'POST', JSON.stringify({ id: item.app, bulkReview: item.compileReview }));
|
|
854
|
+
if (!answer || answer.ok !== true) throw new Error('Compile did not answer.');
|
|
855
|
+
result.outcome = 'compiled';
|
|
856
|
+
result.sentence = 'Fresh approval recorded with the installed tools. Review its compile notices before running.';
|
|
857
|
+
} catch (error) {
|
|
858
|
+
if (error.body && error.body.code === 'bulk-compile-review-again') {
|
|
859
|
+
result.sentence = error.body.error;
|
|
860
|
+
} else {
|
|
861
|
+
// A lost reply can follow a successful compile. Check the actual lock; never replay approval.
|
|
862
|
+
try {
|
|
863
|
+
var reread = await call('/api/app/' + encodeURIComponent(item.app));
|
|
864
|
+
var current = reread && reread.ok === true && reread.app;
|
|
865
|
+
if (current && current.source && current.lock && current.source.hash === item.compileReview.sourceHash
|
|
866
|
+
&& current.runnable && current.lock.sha256 !== item.compileReview.lockDigest) {
|
|
867
|
+
result.outcome = 'approval-present';
|
|
868
|
+
result.sentence = 'A fresh approval is present, but FloLess could not confirm whether this batch recorded it. Open the workflow and review its notices before running.';
|
|
869
|
+
} else {
|
|
870
|
+
result.sentence = 'FloLess could not confirm a fresh approval. Open the workflow, check its source and tools, then compile it individually.';
|
|
871
|
+
}
|
|
872
|
+
} catch (readError) {
|
|
873
|
+
result.sentence = 'FloLess could not check whether compilation finished. Open the workflow and check its approval before deciding to compile again.';
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
out.push(result);
|
|
878
|
+
await refresh();
|
|
879
|
+
}
|
|
880
|
+
} finally {
|
|
881
|
+
approving = false; compileSelection = null; results = out;
|
|
882
|
+
var compiled = out.filter(function (r) { return r.outcome === 'compiled'; }).length;
|
|
883
|
+
var unconfirmed = out.filter(function (r) { return r.outcome === 'approval-present'; }).length;
|
|
884
|
+
$live.textContent = compiled + ' compiled; ' + (unconfirmed ? plural(unconfirmed, 'approval needs confirmation', 'approvals need confirmation') + '; ' : '') + (out.length - compiled - unconfirmed) + ' need individual review.';
|
|
885
|
+
paint(); syncControls(); paintPill();
|
|
886
|
+
var head = document.getElementById('tool-updates-results-head');
|
|
887
|
+
if (head) head.focus(); else $title.focus();
|
|
888
|
+
if (window.flolessBridge && typeof window.flolessBridge.reloadCompiledWorkflows === 'function') {
|
|
889
|
+
try { await window.flolessBridge.reloadCompiledWorkflows(out.filter(function (r) { return r.outcome === 'compiled' || r.outcome === 'approval-present'; }).map(function (r) { return r.app; })); }
|
|
890
|
+
catch (reloadError) { $live.textContent += ' Reopen the workflow to refresh its compile notices.'; }
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
765
895
|
function open(fromEl) {
|
|
766
896
|
returnFocus = fromEl || (document.activeElement instanceof HTMLElement ? document.activeElement : null);
|
|
767
897
|
results = null;
|
|
898
|
+
compileSelection = null;
|
|
768
899
|
$live.textContent = '';
|
|
769
900
|
paint();
|
|
770
901
|
$modal.classList.add('show');
|
|
@@ -786,7 +917,10 @@
|
|
|
786
917
|
}
|
|
787
918
|
|
|
788
919
|
$pill.addEventListener('click', function () { open($pill); });
|
|
789
|
-
$cancel.addEventListener('click',
|
|
920
|
+
$cancel.addEventListener('click', function () {
|
|
921
|
+
if (compileSelection && !approving) { compileSelection = null; paint(); $title.focus(); }
|
|
922
|
+
else close();
|
|
923
|
+
});
|
|
790
924
|
$modal.addEventListener('mousedown', function (e) { if (e.target === $modal) close(); });
|
|
791
925
|
$modal.addEventListener('keydown', function (e) {
|
|
792
926
|
if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); close(); return; }
|