@floless/app 0.152.1 → 0.154.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/dist/floless-server.cjs +5913 -3408
- package/dist/internal-workflows/floless-rfi-gmail-send/.floless-owner.json +1 -1
- package/dist/internal-workflows/floless-rfi-gmail-send/floless-rfi-gmail-send.flo +4 -2
- package/dist/schemas/revit.model.v1.schema.json +5 -0
- package/dist/schemas/steel.model.v2.schema.json +1 -1
- package/dist/skills/floless-app-new-workflow/SKILL.md +8 -2
- package/dist/skills/floless-app-onboarding/SKILL.md +8 -5
- package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +8 -3
- package/dist/skills/floless-app-queue/SKILL.md +23 -4
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +18 -2
- package/dist/web/agents.js +8 -1
- package/dist/web/app.css +107 -5
- package/dist/web/app.js +106 -12
- package/dist/web/aware.js +424 -57
- package/dist/web/chat.css +60 -13
- package/dist/web/chat.js +814 -148
- package/dist/web/commands-shell.js +200 -21
- package/dist/web/commands-steel.js +78 -3
- package/dist/web/guide.js +213 -13
- package/dist/web/index.html +16 -9
- package/dist/web/instructor.js +2 -1
- package/dist/web/leave-guard.js +51 -7
- package/dist/web/left-pane.js +251 -46
- package/dist/web/model-editor-steel-adapter.js +3 -0
- package/dist/web/model-viewport.js +14 -6
- package/dist/web/revit-editor.js +1 -0
- package/dist/web/steel-3d-view.js +15 -7
- package/dist/web/steel-editor.html +367 -54
- package/dist/web/tekla-structural-grid-adapter.js +7 -1
- package/dist/web/tool-updates.js +141 -33
- package/dist/web/workspaces.js +125 -21
- package/package.json +1 -1
package/dist/web/guide.js
CHANGED
|
@@ -665,7 +665,7 @@
|
|
|
665
665
|
function moveText(move) {
|
|
666
666
|
switch (move?.kind) {
|
|
667
667
|
case 'install-tool': return { title: `Install ${move.toolName}`, action: 'Review and install…' };
|
|
668
|
-
case 'create-workflow': return { title: `
|
|
668
|
+
case 'create-workflow': return { title: `Build a workflow: ${move.name}`, action: 'Build it', detail: move.purpose };
|
|
669
669
|
case 'create-agent': return { title: `Set up an agent: ${move.name}`, action: 'Review this agent…' };
|
|
670
670
|
case 'create-routine': return { title: `Run ${move.target?.name || 'it'} on a schedule`, action: 'Set up the schedule…' };
|
|
671
671
|
case 'open': return { title: `Open ${PAGE_LABEL[move.page] || 'this page'}`, action: `Open ${PAGE_LABEL[move.page] || 'it'}` };
|
|
@@ -680,9 +680,6 @@
|
|
|
680
680
|
case 'install-tool':
|
|
681
681
|
if (typeof openLibrary !== 'function') return false;
|
|
682
682
|
openLibrary(move.toolId, { tab: 'available' }); return true; // not installed yet: where its Install button is
|
|
683
|
-
case 'create-workflow':
|
|
684
|
-
if (typeof bridge?.newWorkflow !== 'function') return false;
|
|
685
|
-
await bridge.newWorkflow({ name: move.name }); return true;
|
|
686
683
|
case 'create-agent':
|
|
687
684
|
return Boolean(await window.flolessAgents?.newDraft?.({ name: move.name, instructions: move.instructions }));
|
|
688
685
|
case 'create-routine':
|
|
@@ -704,10 +701,45 @@
|
|
|
704
701
|
// #2054: Not now is remembered by the server for the signed-in account, by what the move is about (its key), so the
|
|
705
702
|
// Guide never suggests it again — in a later answer, after a reload, or in another browser — until the person brings
|
|
706
703
|
// it back (Undo on the card, or Bring back in the Guide's settings in AI Chat).
|
|
707
|
-
// A list change repaints every card on the page
|
|
708
|
-
//
|
|
704
|
+
// A list change repaints every card on the page and every card AI Chat keeps (cardsByEvent, below): one not on the
|
|
705
|
+
// page yet (AI Chat builds a card before it inserts it), or off it while another conversation is open.
|
|
709
706
|
const cardPainters = new WeakMap();
|
|
710
|
-
|
|
707
|
+
// #2185: what came of a workflow card's button, by suggestion id, from its next-move-update events (with the event's
|
|
708
|
+
// sequence, so a replay of it is recognised).
|
|
709
|
+
const moveUpdates = new Map();
|
|
710
|
+
// #2185: one card element per suggestion, by its event id (which is its suggestion id, so an update finds it here).
|
|
711
|
+
// AI Chat draws its conversation again every few seconds; it gets the same card back, so what the card is doing (a
|
|
712
|
+
// press waiting, what it said, the keyboard focus) is never lost.
|
|
713
|
+
// ponytail: both maps keep every suggestion this page has drawn (a reload clears them). Any cap thrashes once one
|
|
714
|
+
// conversation outgrows it (each redraw evicts the card it is about to ask for), and a Guide conversation the morning
|
|
715
|
+
// briefing adds to daily outgrows any small one; cap by conversation if a page ever holds thousands.
|
|
716
|
+
const cardsByEvent = new Map();
|
|
717
|
+
// #2185: which tools are installed, so an install card can tick itself off ("✓ Trimble Connect installed") instead of
|
|
718
|
+
// offering the install again. Read when a card is first drawn and again when the server says something was installed
|
|
719
|
+
// (`floless:connections-changed`); a repaint happens only for a card whose answer changed, never per replay.
|
|
720
|
+
const installedTools = { ids: null, loading: false, again: false, failedAt: 0 };
|
|
721
|
+
const installWatchers = new Set();
|
|
722
|
+
function toolIsInstalled(toolId) { return installedTools.ids ? installedTools.ids.has(toolId) : null; }
|
|
723
|
+
async function refreshInstalledTools(force) {
|
|
724
|
+
if (installedTools.loading) { if (force) installedTools.again = true; return; }
|
|
725
|
+
// After a failed read, wait half a minute: AI Chat redraws its cards every few seconds and each would ask again.
|
|
726
|
+
if (!force && (installedTools.ids || Date.now() - installedTools.failedAt < 30_000)) return;
|
|
727
|
+
installedTools.loading = true;
|
|
728
|
+
try {
|
|
729
|
+
const body = await api('/api/agents');
|
|
730
|
+
installedTools.ids = new Set((Array.isArray(body?.agents) ? body.agents : []).map((agent) => agent?.id).filter((id) => typeof id === 'string'));
|
|
731
|
+
installedTools.failedAt = 0;
|
|
732
|
+
for (const check of installWatchers) check();
|
|
733
|
+
} catch (error) {
|
|
734
|
+
// Cards stay as drawn: the button's own re-check still says "already installed".
|
|
735
|
+
installedTools.failedAt = Date.now();
|
|
736
|
+
console.warn('[guide] could not read which tools are installed:', error);
|
|
737
|
+
} finally {
|
|
738
|
+
installedTools.loading = false;
|
|
739
|
+
if (installedTools.again) { installedTools.again = false; void refreshInstalledTools(true); }
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
window.addEventListener('floless:connections-changed', () => { if (installWatchers.size) void refreshInstalledTools(true); });
|
|
711
743
|
let statusLoad = null;
|
|
712
744
|
let statusFailedAt = 0;
|
|
713
745
|
|
|
@@ -726,8 +758,7 @@
|
|
|
726
758
|
|
|
727
759
|
function setSetAside(rows) {
|
|
728
760
|
state.setAside = Array.isArray(rows) ? rows : [];
|
|
729
|
-
for (const card of document.querySelectorAll('.guide-move-card')
|
|
730
|
-
for (const card of unplacedCards) cardPainters.get(card)?.();
|
|
761
|
+
for (const card of new Set([...document.querySelectorAll('.guide-move-card'), ...cardsByEvent.values()])) cardPainters.get(card)?.();
|
|
731
762
|
paintSetAside();
|
|
732
763
|
}
|
|
733
764
|
|
|
@@ -802,6 +833,8 @@
|
|
|
802
833
|
// A card from before #2054 has no key: it is matched to the list by its move, and the server returns its key on Not now.
|
|
803
834
|
let moveKey = typeof payload.moveKey === 'string' ? payload.moveKey : '';
|
|
804
835
|
if (!text) return null;
|
|
836
|
+
const drawn = cardsByEvent.get(event.eventId);
|
|
837
|
+
if (drawn) return drawn;
|
|
805
838
|
ensureSetAsideLoaded();
|
|
806
839
|
const card = el('section', 'ai-chat-filter-card ai-chat-connection-card guide-move-card');
|
|
807
840
|
card.dataset.eventId = event.eventId;
|
|
@@ -810,6 +843,10 @@
|
|
|
810
843
|
card.setAttribute('aria-label', `Suggestion: ${text.title}`);
|
|
811
844
|
const status = el('p', 'ai-chat-filter-note guide-move-status');
|
|
812
845
|
status.setAttribute('role', 'status');
|
|
846
|
+
// A button press in progress — { commandId, label } — on this card: every drawing keeps every button waiting for it.
|
|
847
|
+
let pending = null;
|
|
848
|
+
// #2185: an install card's last painted answer (installed or not), so only a real change repaints it.
|
|
849
|
+
let paintedInstalled = null;
|
|
813
850
|
const paintCard = () => {
|
|
814
851
|
const focusBack = card.contains(document.activeElement);
|
|
815
852
|
card.replaceChildren();
|
|
@@ -822,16 +859,38 @@
|
|
|
822
859
|
undo.dataset.commandId = 'shell.guide-move-undo';
|
|
823
860
|
undo.dataset.commandInstanceLabel = text.title;
|
|
824
861
|
undo.dataset.tip = 'Shows this suggestion again. The Guide may also bring it up later.';
|
|
862
|
+
// A press in progress on this card (its workflow building, set aside meanwhile in another tab) holds Undo too.
|
|
863
|
+
undo.disabled = Boolean(pending);
|
|
825
864
|
undo.addEventListener('click', async () => {
|
|
865
|
+
pending = { commandId: 'shell.guide-move-undo', label: 'Undo' };
|
|
826
866
|
undo.disabled = true; status.textContent = '';
|
|
827
867
|
try { await moveAside(move, false, moveKey); }
|
|
828
|
-
catch (error) {
|
|
868
|
+
catch (error) { status.textContent = error.message; }
|
|
869
|
+
finally { pending = null; paintCard(); }
|
|
829
870
|
});
|
|
830
871
|
line.append(el('span', '', `Not now: ${text.title}`), undo);
|
|
831
872
|
card.append(line, status);
|
|
832
873
|
if (focusBack) undo.focus();
|
|
833
874
|
return;
|
|
834
875
|
}
|
|
876
|
+
if (move.kind === 'create-workflow') {
|
|
877
|
+
paintWorkflowCard(focusBack);
|
|
878
|
+
return;
|
|
879
|
+
}
|
|
880
|
+
paintedInstalled = move.kind === 'install-tool' ? toolIsInstalled(move.toolId) === true : null;
|
|
881
|
+
card.setAttribute('aria-label', paintedInstalled ? `Installed: ${move.toolName}` : `Suggestion: ${text.title}`);
|
|
882
|
+
if (paintedInstalled) {
|
|
883
|
+
// Done: say what was installed and stop asking. The buttons that were here are gone, so the keyboard stays on the card.
|
|
884
|
+
const head = el('div', 'ai-chat-filter-card-head');
|
|
885
|
+
head.append(el('span', 'guide-move-eyebrow', 'Done'), el('strong', ''));
|
|
886
|
+
const tick = el('span', '', '✓ '); tick.setAttribute('aria-hidden', 'true');
|
|
887
|
+
head.lastChild.append(tick, document.createTextNode(`${move.toolName} installed`));
|
|
888
|
+
card.classList.add('is-connected');
|
|
889
|
+
card.append(head, el('p', 'ai-chat-filter-note', 'Ready to use.'), status);
|
|
890
|
+
if (focusBack) { card.tabIndex = -1; card.focus({ preventScroll: true }); }
|
|
891
|
+
return;
|
|
892
|
+
}
|
|
893
|
+
card.classList.remove('is-connected');
|
|
835
894
|
const head = el('div', 'ai-chat-filter-card-head');
|
|
836
895
|
head.append(el('span', 'guide-move-eyebrow', 'Suggested'), el('strong', '', text.title));
|
|
837
896
|
card.append(head);
|
|
@@ -877,9 +936,137 @@
|
|
|
877
936
|
card.append(actions, el('p', 'ai-chat-filter-note', 'Nothing happens until you confirm in the next step.'), status);
|
|
878
937
|
if (focusBack) go.focus();
|
|
879
938
|
};
|
|
939
|
+
/**
|
|
940
|
+
* #2185: a workflow suggestion builds in the workflow's own conversation, once per card. Offer: Build it, Edit details…,
|
|
941
|
+
* Not now. Afterwards the card says what happened — a statement, never the question again — and its buttons open
|
|
942
|
+
* that same workflow, because the server answers every repeat of this card with the build it already made.
|
|
943
|
+
*/
|
|
944
|
+
function paintWorkflowCard(focusBack) {
|
|
945
|
+
const moveId = typeof payload.moveId === 'string' ? payload.moveId : event.eventId;
|
|
946
|
+
const update = moveUpdates.get(moveId);
|
|
947
|
+
const guide = { chatId: event.chatId, moveId };
|
|
948
|
+
const workflowName = update?.workflowName || move.name;
|
|
949
|
+
const head = el('div', 'ai-chat-filter-card-head');
|
|
950
|
+
const actions = el('div', 'ai-chat-filter-actions');
|
|
951
|
+
// Every button waits for the one pressed (`pending`, applied again at the end of every drawing), so Not now cannot
|
|
952
|
+
// set aside a workflow being built, nor Build it slip in while it is being set aside.
|
|
953
|
+
const applyPending = () => {
|
|
954
|
+
for (const node of actions.querySelectorAll('button')) {
|
|
955
|
+
node.disabled = Boolean(pending);
|
|
956
|
+
if (pending && node.dataset.commandId === pending.commandId) { node.setAttribute('aria-busy', 'true'); node.textContent = pending.label; }
|
|
957
|
+
}
|
|
958
|
+
};
|
|
959
|
+
const busy = (node, label) => { pending = { commandId: node.dataset.commandId, label }; status.textContent = ''; applyPending(); };
|
|
960
|
+
const done = () => {
|
|
961
|
+
pending = null;
|
|
962
|
+
paintCard();
|
|
963
|
+
// A disabled button drops focus to the page; put it back on this card (on Try again after a repaint).
|
|
964
|
+
if (!document.activeElement || document.activeElement === document.body) card.querySelector('button:not([disabled])')?.focus();
|
|
965
|
+
};
|
|
966
|
+
const built = (result) => {
|
|
967
|
+
if (!result?.workflow) return;
|
|
968
|
+
// Keeps the sequence of the update already shown, so a replay of it (or of an older one) is still recognised.
|
|
969
|
+
moveUpdates.set(moveId, { moveId, state: 'building', workflowId: result.workflow.workflowId, workflowName: result.workflow.displayName,
|
|
970
|
+
sequence: moveUpdates.get(moveId)?.sequence });
|
|
971
|
+
paintCard();
|
|
972
|
+
};
|
|
973
|
+
// The failed card already shows why; the line under the buttons says only what that card does not.
|
|
974
|
+
const say = (error) => { if (moveUpdates.get(moveId)?.reason !== error?.message) status.textContent = error?.message || ''; };
|
|
975
|
+
const missing = () => new Error('FloLess is still starting. Try again in a moment.');
|
|
976
|
+
const build = async (node, label, busyLabel = 'Starting…', reopen = false) => {
|
|
977
|
+
busy(node, busyLabel);
|
|
978
|
+
try {
|
|
979
|
+
if (typeof window.flolessBridge?.buildWorkflow !== 'function') throw missing();
|
|
980
|
+
built(await window.flolessBridge.buildWorkflow({ buildId: moveId, payload: { source: 'guide', guideChatId: guide.chatId, moveId }, reopen }));
|
|
981
|
+
} catch (error) { say(error); }
|
|
982
|
+
finally { done(); }
|
|
983
|
+
};
|
|
984
|
+
const button = (label, commandId, tip, className = '') => {
|
|
985
|
+
const node = el('button', className, label);
|
|
986
|
+
node.type = 'button';
|
|
987
|
+
node.dataset.commandId = commandId;
|
|
988
|
+
node.dataset.commandInstanceLabel = workflowName;
|
|
989
|
+
node.dataset.tip = tip;
|
|
990
|
+
return node;
|
|
991
|
+
};
|
|
992
|
+
let first = null;
|
|
993
|
+
if (update?.state === 'building') {
|
|
994
|
+
// The card stays in the Guide for days, so it says what happened, not that the AI is still working.
|
|
995
|
+
card.setAttribute('aria-label', `Draft created: ${workflowName}`);
|
|
996
|
+
head.append(el('span', 'guide-move-eyebrow', 'Draft created'), el('strong', '', workflowName));
|
|
997
|
+
card.append(head, el('p', 'ai-chat-filter-why', 'It is built in the workflow’s own chat. You can leave and come back.'));
|
|
998
|
+
const open = button('Open workflow', 'shell.guide-move-open-workflow', 'Opens this workflow’s build conversation. If the AI never got its first message, this sends it again.', 'ai-chat-filter-apply');
|
|
999
|
+
open.addEventListener('click', () => build(open, 'Open workflow', 'Opening…', true));
|
|
1000
|
+
actions.append(open); first = open;
|
|
1001
|
+
card.append(actions, status);
|
|
1002
|
+
} else if (update?.state === 'failed') {
|
|
1003
|
+
card.setAttribute('aria-label', `Not started: ${workflowName}`);
|
|
1004
|
+
head.append(el('span', 'guide-move-eyebrow', 'Not started'), el('strong', '', `“${workflowName}” is saved as a draft, but its chat didn’t start`));
|
|
1005
|
+
card.append(head);
|
|
1006
|
+
const retry = button('Try again', 'shell.guide-move-retry', 'Starts the AI chat for this workflow again, on the draft already saved.', 'ai-chat-filter-apply');
|
|
1007
|
+
if (update.reason) {
|
|
1008
|
+
const reason = el('p', 'ai-chat-filter-why', update.reason);
|
|
1009
|
+
reason.id = `guide-move-reason-${moveId}`;
|
|
1010
|
+
retry.setAttribute('aria-describedby', reason.id);
|
|
1011
|
+
card.append(reason);
|
|
1012
|
+
}
|
|
1013
|
+
retry.addEventListener('click', () => build(retry, 'Try again'));
|
|
1014
|
+
const open = button('Open workflow', 'shell.guide-move-open-draft', 'Opens the saved draft on the Workflows page.');
|
|
1015
|
+
open.addEventListener('click', async () => {
|
|
1016
|
+
busy(open, 'Opening…');
|
|
1017
|
+
try {
|
|
1018
|
+
if (typeof window.flolessBridge?.openOwnedWorkflow !== 'function') throw missing();
|
|
1019
|
+
await window.flolessBridge.openOwnedWorkflow(update.workflowId);
|
|
1020
|
+
} catch (error) { say(error); }
|
|
1021
|
+
finally { done(); }
|
|
1022
|
+
});
|
|
1023
|
+
actions.append(retry, open); first = retry;
|
|
1024
|
+
card.append(actions, status);
|
|
1025
|
+
} else {
|
|
1026
|
+
card.setAttribute('aria-label', `Suggestion: ${text.title}`);
|
|
1027
|
+
head.append(el('span', 'guide-move-eyebrow', 'Suggested'), el('strong', '', text.title));
|
|
1028
|
+
card.append(head);
|
|
1029
|
+
if (text.detail) card.append(el('p', 'ai-chat-filter-why', text.detail));
|
|
1030
|
+
const why = typeof payload.why === 'string' ? payload.why.trim() : '';
|
|
1031
|
+
if (why) card.append(el('p', 'ai-chat-filter-why', why));
|
|
1032
|
+
const go = button('Build it', 'shell.guide-move-build', 'Creates this workflow and starts building it with the AI in its own chat. Pressing it again opens the same workflow.', 'ai-chat-filter-apply');
|
|
1033
|
+
go.addEventListener('click', () => build(go, 'Build it'));
|
|
1034
|
+
const edit = button('Edit details…', 'shell.guide-move-edit', 'Rename it and choose where it belongs before it is built.');
|
|
1035
|
+
edit.addEventListener('click', async () => {
|
|
1036
|
+
busy(edit, 'Edit details…');
|
|
1037
|
+
try {
|
|
1038
|
+
if (typeof window.flolessBridge?.newWorkflow !== 'function') throw missing();
|
|
1039
|
+
built(await window.flolessBridge.newWorkflow({ name: move.name, guide }));
|
|
1040
|
+
} catch (error) { say(error); }
|
|
1041
|
+
finally { done(); }
|
|
1042
|
+
});
|
|
1043
|
+
const later = button('Not now', 'shell.guide-move-not-now', 'Sets this suggestion aside, and the Guide won’t suggest it again. You can bring it back.');
|
|
1044
|
+
later.dataset.commandInstanceLabel = text.title;
|
|
1045
|
+
later.addEventListener('click', async () => {
|
|
1046
|
+
// Build it waits too: a workflow built while it is being set aside would be folded away with the card.
|
|
1047
|
+
busy(later, 'Not now');
|
|
1048
|
+
try {
|
|
1049
|
+
const answer = await moveAside(move, true);
|
|
1050
|
+
if (answer?.key) moveKey = answer.key;
|
|
1051
|
+
} catch (error) { status.textContent = error.message; }
|
|
1052
|
+
finally { done(); }
|
|
1053
|
+
});
|
|
1054
|
+
// Build it has no confirm step, so this note is the whole warning: Build it points a screen reader at it.
|
|
1055
|
+
const note = el('p', 'ai-chat-filter-note', 'Creates a draft workflow and opens a chat where the AI starts building it. It asks you before any run that sends data off this computer.');
|
|
1056
|
+
note.id = `guide-move-note-${moveId}`;
|
|
1057
|
+
go.setAttribute('aria-describedby', note.id);
|
|
1058
|
+
actions.append(go, edit, later); first = go;
|
|
1059
|
+
card.append(actions, note, status);
|
|
1060
|
+
}
|
|
1061
|
+
applyPending();
|
|
1062
|
+
if (focusBack && first && !pending) first.focus();
|
|
1063
|
+
}
|
|
880
1064
|
cardPainters.set(card, paintCard);
|
|
881
|
-
|
|
882
|
-
if (
|
|
1065
|
+
cardsByEvent.set(event.eventId, card);
|
|
1066
|
+
if (move.kind === 'install-tool') {
|
|
1067
|
+
installWatchers.add(() => { if (toolIsInstalled(move.toolId) === true && paintedInstalled !== true) paintCard(); });
|
|
1068
|
+
void refreshInstalledTools(false);
|
|
1069
|
+
}
|
|
883
1070
|
paintCard();
|
|
884
1071
|
return card;
|
|
885
1072
|
}
|
|
@@ -1304,7 +1491,20 @@
|
|
|
1304
1491
|
void refreshBriefing();
|
|
1305
1492
|
});
|
|
1306
1493
|
|
|
1307
|
-
|
|
1494
|
+
/** #2185: a next-move-update event: remember what came of that card's button and repaint the card if it is drawn. */
|
|
1495
|
+
function applyMoveUpdate(event) {
|
|
1496
|
+
const update = event?.payload;
|
|
1497
|
+
if (!update || typeof update.moveId !== 'string') return;
|
|
1498
|
+
// AI Chat replays the whole conversation each time it draws it: only an update newer than the one shown repaints the
|
|
1499
|
+
// card, because a repaint replaces its buttons and the keyboard focus on one.
|
|
1500
|
+
const sequence = Number(event.sequence);
|
|
1501
|
+
if (sequence <= moveUpdates.get(update.moveId)?.sequence) return;
|
|
1502
|
+
moveUpdates.set(update.moveId, { ...update, sequence });
|
|
1503
|
+
const card = cardsByEvent.get(update.moveId);
|
|
1504
|
+
if (card) cardPainters.get(card)?.();
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
window.flolessGuide = { open, maybeAskOnLaunch, turnOff, deleteHistory, renderNextMove, applyMoveUpdate, status: loadStatus, paintBriefing, refreshBriefing };
|
|
1308
1508
|
|
|
1309
1509
|
// Ask once, after AI Chat is ready and the app has settled.
|
|
1310
1510
|
// #2053: and, once settled, whether a morning briefing is ready or needs an answer.
|
package/dist/web/index.html
CHANGED
|
@@ -158,11 +158,12 @@
|
|
|
158
158
|
<button type="button" data-left-section-switch="narrative" data-command-id="shell.left-section#AI Chat" data-command-instance-label="AI Chat" aria-pressed="true" data-tip="Show or hide AI Chat">AI Chat <span aria-hidden="true">◉</span></button>
|
|
159
159
|
<button type="button" data-left-section-switch="model" data-command-id="shell.left-section#Model" data-command-instance-label="Model" aria-pressed="false" data-tip="Show or hide Model" hidden>Model <span aria-hidden="true">◉</span></button>
|
|
160
160
|
<span class="left-pane-switch-spacer"></span>
|
|
161
|
+
<button type="button" id="left-layout-toggle" class="left-layout-toggle" data-command-id="shell.left-layout" aria-label="Side by side" aria-pressed="false" data-tip="Place AI Chat and Model side by side" hidden><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="2" y="3" width="5" height="10" rx="1"/><rect x="9" y="3" width="5" height="10" rx="1"/></svg></button>
|
|
161
162
|
</div>
|
|
162
163
|
<div class="left-pane-stack" id="left-pane-stack">
|
|
163
164
|
<section id="left-narrative-section" class="left-pane-section narrative-section" data-left-section="narrative" aria-labelledby="left-narrative-heading">
|
|
164
|
-
<header class="left-section-heading">
|
|
165
|
-
<button type="button" class="left-section-grip"
|
|
165
|
+
<header class="left-section-heading" draggable="true" data-left-drag="narrative" tabindex="-1" data-command-id="shell.left-section-drag#AI Chat" data-command-instance-label="AI Chat" aria-label="AI Chat panel header, drag to move the panel">
|
|
166
|
+
<button type="button" class="left-section-grip" data-left-reorder="narrative" data-command-id="shell.left-section-reorder#AI Chat" data-command-instance-label="AI Chat" aria-label="Move AI Chat panel" data-tip="Drag the header onto the other panel to stack, or beside the panel to place side by side · Alt+Arrow keys also move it">⠿</button>
|
|
166
167
|
<strong id="left-narrative-heading">AI Chat</strong><span id="left-chat-context">Project conversation</span>
|
|
167
168
|
<button type="button" class="left-section-close" data-left-section-close="narrative" data-command-id="shell.left-section#AI Chat" data-command-instance-label="AI Chat" aria-label="Hide AI Chat" data-tip="Hide AI Chat">×</button>
|
|
168
169
|
</header>
|
|
@@ -246,7 +247,6 @@
|
|
|
246
247
|
<button data-command-id="shell.chat-move-keep" type="button" id="chat-move-secondary" aria-describedby="chat-move-copy" hidden></button>
|
|
247
248
|
<button data-command-id="shell.chat-move-dismiss" type="button" id="chat-move-dismiss" class="ai-chat-move-dismiss" aria-label="Dismiss" data-tip="Dismiss" hidden>×</button>
|
|
248
249
|
</div>
|
|
249
|
-
<div class="ai-chat-attachments" id="chat-attachments" hidden></div>
|
|
250
250
|
<div class="ai-chat-skills" id="chat-skills" role="listbox" hidden></div>
|
|
251
251
|
<div class="ai-chat-approval-tray" id="chat-approval-tray"></div>
|
|
252
252
|
<div class="ai-chat-composer" id="chat-composer">
|
|
@@ -261,9 +261,13 @@
|
|
|
261
261
|
<div class="ai-chat-connectors" id="chat-change-allowance" role="group" aria-label="Changes allowed for this chat" hidden></div>
|
|
262
262
|
<!-- #1900: the connection checks this chat may run without asking, each with Revoke (web/chat.js). -->
|
|
263
263
|
<div class="ai-chat-connectors" id="chat-check-allowance" role="group" aria-label="Connection checks allowed for this chat" hidden></div>
|
|
264
|
+
<!-- Epic #2185 Slice A: what was allowed for the kinds of request without a box of their own (scope additions, workflow creation, unidentified connector calls, exact checks) - for this reply and for this conversation - each with Revoke (web/chat.js). -->
|
|
265
|
+
<div class="ai-chat-connectors" id="chat-grants" role="group" aria-label="Allowed for this request and this chat" hidden></div>
|
|
264
266
|
<div class="ai-chat-tekla-context" id="chat-tekla-context" hidden></div>
|
|
265
267
|
<!-- #1907: shown only while this chat uses the person's own connectors: "on · Turn off", then each allowed one with Revoke (web/chat.js). -->
|
|
266
268
|
<div class="ai-chat-connectors" id="chat-connectors" role="group" aria-label="Your connectors in this chat" hidden></div>
|
|
269
|
+
<!-- #2185: what is about to be sent sits right above the message box, below every scope and access line. -->
|
|
270
|
+
<div class="ai-chat-attachments" id="chat-attachments" hidden></div>
|
|
267
271
|
<textarea data-command-id="shell.chat-input" id="chat-input" rows="1" maxlength="131072" placeholder="Message AI…" aria-label="Message AI"></textarea>
|
|
268
272
|
<!-- The data-handling disclosure gets its OWN node in the composer, not a line in
|
|
269
273
|
#chat-compose-hint: that hint is one mutable string chosen by a priority chain,
|
|
@@ -292,8 +296,8 @@
|
|
|
292
296
|
</section>
|
|
293
297
|
<div id="left-pane-split" class="left-pane-split" data-command-id="shell.left-panel-split" role="separator" tabindex="0" aria-label="Resize AI Chat and Model panels" aria-orientation="horizontal" aria-controls="left-narrative-section left-model-section" data-tip="Drag or use arrow keys to resize · Enter or double-click to reset" hidden></div>
|
|
294
298
|
<section id="left-model-section" class="left-pane-section model-section" data-left-section="model" aria-labelledby="left-model-heading" hidden>
|
|
295
|
-
<header class="left-section-heading">
|
|
296
|
-
<button type="button" class="left-section-grip"
|
|
299
|
+
<header class="left-section-heading" draggable="true" data-left-drag="model" tabindex="-1" data-command-id="shell.left-section-drag#Model" data-command-instance-label="Model" aria-label="Model panel header, drag to move the panel">
|
|
300
|
+
<button type="button" class="left-section-grip" data-left-reorder="model" data-command-id="shell.left-section-reorder#Model" data-command-instance-label="Model" aria-label="Move Model panel" data-tip="Drag the header onto the other panel to stack, or beside the panel to place side by side · Alt+Arrow keys also move it">⠿</button>
|
|
297
301
|
<strong id="left-model-heading">Model</strong><span id="left-model-context">Project model</span>
|
|
298
302
|
<button type="button" class="left-section-close" data-left-section-close="model" data-command-id="shell.left-section#Model" data-command-instance-label="Model" aria-label="Hide Model" data-tip="Hide Model">×</button>
|
|
299
303
|
</header>
|
|
@@ -438,8 +442,9 @@
|
|
|
438
442
|
<div class="ws-source-placeholder" id="ws-source-placeholder" tabindex="-1" hidden>
|
|
439
443
|
<div class="ws-source-inner">
|
|
440
444
|
<span class="ws-source-ico" aria-hidden="true">▨</span>
|
|
441
|
-
<!-- Shown INSTEAD of the glyph while data-importing is true (a Revit
|
|
442
|
-
the wait reads as work in progress rather than a dead pane.
|
|
445
|
+
<!-- Shown INSTEAD of the glyph while data-importing is true (a Revit or Tekla read in flight), so
|
|
446
|
+
the wait reads as work in progress rather than a dead pane: workspaces.js puts Flo, working
|
|
447
|
+
with its hat on, in here (a plain ring spinner without flo-avatar.js). CSS-only swap on the
|
|
443
448
|
attribute; it is not aria-busy because this pane is the import's own live region. -->
|
|
444
449
|
<span class="ws-source-spin" aria-hidden="true"></span>
|
|
445
450
|
<div class="ws-source-title" tabindex="-1">This project's source drawing</div>
|
|
@@ -1417,9 +1422,11 @@
|
|
|
1417
1422
|
<!-- #2060: Done lists the Requests that left the queue, so each one's conversation stays reachable. -->
|
|
1418
1423
|
<div class="tabs req-view" id="requests-view" role="tablist" aria-label="Queued or done requests">
|
|
1419
1424
|
<button data-command-id="shell.requests-view#queued" type="button" data-reqview="queued" class="active" role="tab" aria-selected="true" aria-controls="requests-list" id="requests-view-queued">Queued</button>
|
|
1420
|
-
<button data-command-id="shell.requests-view#done" type="button" data-reqview="done" role="tab" aria-selected="false" aria-controls="requests-list" id="requests-view-done" data-tip="Requests that left the queue in the last 30 days">Done</button>
|
|
1425
|
+
<button data-command-id="shell.requests-view#done" type="button" data-reqview="done" role="tab" aria-selected="false" aria-controls="requests-list" id="requests-view-done" data-tip="Requests that left the queue in the last 30 days, and the ones you set aside">Done</button>
|
|
1421
1426
|
</div>
|
|
1422
1427
|
<div class="req-guidance" id="requests-guidance" role="status" aria-live="polite" aria-atomic="true" hidden></div>
|
|
1428
|
+
<!-- #2185: the one-time tidy of old requests: how many, and Undo. Written by aware.js. -->
|
|
1429
|
+
<div class="req-backlog" id="requests-backlog" role="status" hidden></div>
|
|
1423
1430
|
<span class="sr-only" id="requests-action-status" role="status" aria-live="polite" aria-atomic="true"></span>
|
|
1424
1431
|
<!-- Scope + search. The scope row is hidden when nothing is open to scope TO (the
|
|
1425
1432
|
Workspaces landing, or Workflows with no workflow selected) — a filter with one
|
|
@@ -1431,7 +1438,7 @@
|
|
|
1431
1438
|
<input data-command-id="shell.request-search" id="requests-search" class="lib-search req-search" type="text" placeholder="Search by project, workflow, or what you asked for" aria-label="Search requests">
|
|
1432
1439
|
<div class="requests-list" id="requests-list"></div>
|
|
1433
1440
|
<div class="modal-actions">
|
|
1434
|
-
<span class="req-done-note" id="requests-done-note" hidden>
|
|
1441
|
+
<span class="req-done-note" id="requests-done-note" hidden>Finished in the last 30 days, plus everything you set aside. Nothing here runs again.</span>
|
|
1435
1442
|
<button data-command-id="shell.request-clear" id="requests-clear">Clear all</button>
|
|
1436
1443
|
<button data-command-id="shell.request-copy" id="requests-copy">Copy available</button>
|
|
1437
1444
|
<button data-command-id="shell.dialog-close#the requests list" id="requests-close" class="primary">Close</button>
|
package/dist/web/instructor.js
CHANGED
|
@@ -326,7 +326,8 @@
|
|
|
326
326
|
if (!el || el === document.body) return null;
|
|
327
327
|
// A semantic divider is not a control. Only focusable separators (the panel
|
|
328
328
|
// resize handles) belong in Instructor's interaction stream.
|
|
329
|
-
|
|
329
|
+
// A registered drag handle that is not a button (the left pane's section headers) is a control too.
|
|
330
|
+
var target = el.closest('button, summary, [role="button"], [role="treeitem"], [role="separator"][tabindex], a[href], input, select, textarea, [draggable="true"][data-command-id]');
|
|
330
331
|
/* A switch paints `.rtn-toggle-track` over an input that is `opacity:0; width:0;
|
|
331
332
|
height:0`, so the pointer NEVER lands on the input — it lands on the track, or
|
|
332
333
|
on the <label> around it, and neither is in the list above. Hovering "Start on
|
package/dist/web/leave-guard.js
CHANGED
|
@@ -108,8 +108,10 @@
|
|
|
108
108
|
function register(provider) { if (typeof provider === 'function') providers.push(provider); }
|
|
109
109
|
function registerFrame(frame, key) { register(function () { return probeFrame(frame, key); }); }
|
|
110
110
|
|
|
111
|
-
/** Everything unresolved right now: { items, running } — never throws.
|
|
112
|
-
|
|
111
|
+
/** Everything unresolved right now: { items, running } — never throws. `only` (optional) narrows it to
|
|
112
|
+
* the items it accepts and drops the running-workflow notice: leaving a project cares about that
|
|
113
|
+
* project's editors, not about a workflow input or a run that stays where it is. */
|
|
114
|
+
async function collect(only) {
|
|
113
115
|
var items = [];
|
|
114
116
|
var running = null;
|
|
115
117
|
for (var i = 0; i < providers.length; i++) {
|
|
@@ -122,9 +124,21 @@
|
|
|
122
124
|
else items.push(item);
|
|
123
125
|
});
|
|
124
126
|
}
|
|
127
|
+
if (typeof only === 'function') return { items: items.filter(only), running: null };
|
|
125
128
|
return { items: items, running: running };
|
|
126
129
|
}
|
|
127
130
|
|
|
131
|
+
/** The unsaved work that belongs to the OPEN PROJECT: the Workspaces editor frames (workspaces.js
|
|
132
|
+
* registers them as 'workspace-model' / 'workspace-drawings'). Workflow inputs and the full-window
|
|
133
|
+
* editor overlay are other surfaces and must not hold the "Leave this project?" question open. */
|
|
134
|
+
function isProjectItem(item) { return !!item && typeof item.id === 'string' && item.id.indexOf('frame:workspace-') === 0; }
|
|
135
|
+
|
|
136
|
+
/** The item filter for a question: the caller's own, or the project filter for action 'project'. */
|
|
137
|
+
function onlyFor(opts) {
|
|
138
|
+
if (opts && typeof opts.only === 'function') return opts.only;
|
|
139
|
+
return opts && opts.action === 'project' ? isProjectItem : null;
|
|
140
|
+
}
|
|
141
|
+
|
|
128
142
|
/* ── the dialog ────────────────────────────────────────────────────────── */
|
|
129
143
|
|
|
130
144
|
var COPY = {
|
|
@@ -146,6 +160,17 @@
|
|
|
146
160
|
working: 'Signing out…',
|
|
147
161
|
failed: 'FloLess could not sign you out just now, so you are still signed in. Try again in a moment.',
|
|
148
162
|
},
|
|
163
|
+
// Switching to another project, or back to the project list, replaces the open project's editors.
|
|
164
|
+
// An AI Chat read keeps going and is there when you come back, so it is not part of this question.
|
|
165
|
+
project: {
|
|
166
|
+
title: 'Leave this project?',
|
|
167
|
+
clean: 'Nothing here is waiting to be saved.',
|
|
168
|
+
unsaved: 'Some of your work in this project is not saved yet. Save it before you leave?',
|
|
169
|
+
running: '',
|
|
170
|
+
confirm: 'Leave', save: 'Save and leave', discard: 'Leave without saving',
|
|
171
|
+
working: 'Leaving…',
|
|
172
|
+
failed: 'FloLess could not leave this project just now. Try again in a moment.',
|
|
173
|
+
},
|
|
149
174
|
};
|
|
150
175
|
|
|
151
176
|
var $modal = null;
|
|
@@ -240,7 +265,8 @@
|
|
|
240
265
|
* dialog, which stays open (nothing was discarded, nothing was left).
|
|
241
266
|
*/
|
|
242
267
|
function confirm(opts) {
|
|
243
|
-
var action = opts && opts.action === 'signout' ? 'signout' : 'stop';
|
|
268
|
+
var action = opts && opts.action === 'signout' ? 'signout' : opts && opts.action === 'project' ? 'project' : 'stop';
|
|
269
|
+
var only = onlyFor(opts);
|
|
244
270
|
if (openPromise) return openPromise;
|
|
245
271
|
$modal = $modal || el('leave-guard-modal');
|
|
246
272
|
var other = el('confirm-modal');
|
|
@@ -285,7 +311,7 @@
|
|
|
285
311
|
|
|
286
312
|
/* The last word before acting: probe again, and go back to the dialog if the picture grew. */
|
|
287
313
|
async function proceed(decided, discardAll) {
|
|
288
|
-
var fresh = await collect();
|
|
314
|
+
var fresh = await collect(only);
|
|
289
315
|
if (settled) return;
|
|
290
316
|
if (grewSince(decided, fresh)) {
|
|
291
317
|
snapshot = fresh;
|
|
@@ -308,7 +334,8 @@
|
|
|
308
334
|
}
|
|
309
335
|
}
|
|
310
336
|
if (discardAll) fresh.items.forEach(function (i) { if (typeof i.discard === 'function') i.discard(); });
|
|
311
|
-
|
|
337
|
+
// Leaving a project stays in the page, so its later reloads keep the browser's own prompt.
|
|
338
|
+
if (action !== 'project') window.__flolessLeaving = true; // no browser "Leave site?" prompt on the way out
|
|
312
339
|
done(true);
|
|
313
340
|
}
|
|
314
341
|
|
|
@@ -322,7 +349,7 @@
|
|
|
322
349
|
catch (_) { failed.add(item.id); }
|
|
323
350
|
}
|
|
324
351
|
if (settled) return;
|
|
325
|
-
var fresh = await collect();
|
|
352
|
+
var fresh = await collect(only);
|
|
326
353
|
if (settled) return;
|
|
327
354
|
// A save that said it failed keeps us here even if its item no longer shows up (an editor
|
|
328
355
|
// closed mid-save): its change is not known to be saved, so it stays on the list.
|
|
@@ -380,7 +407,7 @@
|
|
|
380
407
|
setBusy(true);
|
|
381
408
|
$modal.classList.add('show');
|
|
382
409
|
focusDefault();
|
|
383
|
-
collect().then(function (s) {
|
|
410
|
+
collect(only).then(function (s) {
|
|
384
411
|
if (settled) return;
|
|
385
412
|
snapshot = s;
|
|
386
413
|
render(action, snapshot);
|
|
@@ -390,6 +417,21 @@
|
|
|
390
417
|
return openPromise;
|
|
391
418
|
}
|
|
392
419
|
|
|
420
|
+
/**
|
|
421
|
+
* Ask only when something would be lost: resolves true at once when nothing in `opts.only` is
|
|
422
|
+
* unsaved, otherwise shows the question and resolves like confirm(). Used when the open project is
|
|
423
|
+
* about to be replaced (another project, or the project list).
|
|
424
|
+
*/
|
|
425
|
+
async function confirmIfUnsaved(opts) {
|
|
426
|
+
var only = onlyFor(opts);
|
|
427
|
+
var snapshot = await collect(only);
|
|
428
|
+
// Clean on the first look: look once more before saying "go ahead", because an editor can turn
|
|
429
|
+
// dirty while the first probe was awaiting its providers.
|
|
430
|
+
if (!snapshot.items.length) snapshot = await collect(only);
|
|
431
|
+
if (!snapshot.items.length) return true;
|
|
432
|
+
return confirm(opts);
|
|
433
|
+
}
|
|
434
|
+
|
|
393
435
|
/* ── Stop FloLess ──────────────────────────────────────────────────────── */
|
|
394
436
|
|
|
395
437
|
var stopping = false;
|
|
@@ -476,6 +518,8 @@
|
|
|
476
518
|
probeFrame: probeFrame,
|
|
477
519
|
collect: collect,
|
|
478
520
|
confirm: confirm,
|
|
521
|
+
confirmIfUnsaved: confirmIfUnsaved,
|
|
522
|
+
isProjectItem: isProjectItem,
|
|
479
523
|
stopApp: stopApp,
|
|
480
524
|
};
|
|
481
525
|
})();
|