@floless/app 0.151.0 → 0.152.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 +14420 -8488
- package/dist/skills/floless-app-knowledge/SKILL.md +25 -2
- package/dist/skills/floless-app-onboarding/SKILL.md +18 -1
- package/dist/skills/floless-app-report-issue/SKILL.md +10 -5
- package/dist/skills/floless-app-routines/SKILL.md +1 -1
- package/dist/skills/floless-app-routines/references/routines-api.md +14 -4
- package/dist/templates/revit-model.flo +6 -2
- package/dist/templates/tekla-parser.flo +6 -2
- package/dist/web/agents.js +146 -9
- package/dist/web/app.css +210 -19
- package/dist/web/app.js +53 -8
- package/dist/web/aware.js +852 -53
- package/dist/web/chat.css +98 -4
- package/dist/web/chat.js +550 -35
- package/dist/web/commands-shell.js +289 -20
- package/dist/web/connections.js +24 -6
- package/dist/web/flo-avatar.js +191 -0
- package/dist/web/flo.js +156 -0
- package/dist/web/guide.js +695 -57
- package/dist/web/index.html +58 -7
- package/dist/web/instructor.js +6 -1
- package/dist/web/local-discovery.js +35 -6
- package/dist/web/panels.js +2 -0
- package/dist/web/parser-setup-recovery.js +250 -0
- package/dist/web/tool-updates.js +198 -4
- package/dist/web/workspace-root-management.js +197 -0
- package/dist/web/workspaces.js +235 -15
- package/package.json +1 -1
package/dist/web/index.html
CHANGED
|
@@ -195,7 +195,25 @@
|
|
|
195
195
|
<!-- #2046: a Guide conversation's Access is a statement, not a picker, and holds the Guide's own privacy controls. -->
|
|
196
196
|
<div class="ai-chat-setting ai-chat-guide-access" id="chat-guide-access" hidden>
|
|
197
197
|
<span>Access</span><strong>Read only</strong>
|
|
198
|
-
<
|
|
198
|
+
<p class="ai-chat-guide-note">The Guide only reads, so this can’t be changed. To make changes, use its buttons or start a regular conversation with the + button. Auto is offered inside a project or workflow.</p>
|
|
199
|
+
<!-- #2053: the opt-in morning briefing; web/guide.js paints it (off by default). -->
|
|
200
|
+
<div class="ai-chat-guide-briefing" id="chat-guide-briefing">
|
|
201
|
+
<!-- The briefing's time: the same themed combobox the app draws for a select, built without one
|
|
202
|
+
(AI Chat has no native select); web/guide.js fills, sets and places it. -->
|
|
203
|
+
<div class="rtn-time" id="chat-guide-briefing-time" hidden>
|
|
204
|
+
<div class="wf-combo fm-select sel-combo">
|
|
205
|
+
<button data-command-id="shell.guide-briefing-time#hour" type="button" class="wf-trigger fm-select-trigger" role="combobox" id="chat-guide-briefing-hour" aria-haspopup="listbox" aria-expanded="false" aria-controls="chat-guide-briefing-hour-list" aria-label="Briefing hour"><span class="wf-trigger-label fm-select-label">00</span><svg class="wf-caret" width="10" height="6" viewBox="0 0 10 6" aria-hidden="true"><path fill="currentColor" d="M0 0l5 6 5-6z"/></svg></button>
|
|
206
|
+
<div class="wf-popover fm-select-popover" role="listbox" id="chat-guide-briefing-hour-list" aria-label="Briefing hour" hidden><div class="wf-list fm-select-list"></div></div>
|
|
207
|
+
</div>
|
|
208
|
+
<span class="rtn-time-sep">:</span>
|
|
209
|
+
<div class="wf-combo fm-select sel-combo">
|
|
210
|
+
<button data-command-id="shell.guide-briefing-time#minute" type="button" class="wf-trigger fm-select-trigger" role="combobox" id="chat-guide-briefing-minute" aria-haspopup="listbox" aria-expanded="false" aria-controls="chat-guide-briefing-minute-list" aria-label="Briefing minute"><span class="wf-trigger-label fm-select-label">00</span><svg class="wf-caret" width="10" height="6" viewBox="0 0 10 6" aria-hidden="true"><path fill="currentColor" d="M0 0l5 6 5-6z"/></svg></button>
|
|
211
|
+
<div class="wf-popover fm-select-popover" role="listbox" id="chat-guide-briefing-minute-list" aria-label="Briefing minute" hidden><div class="wf-list fm-select-list"></div></div>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
<!-- #2054: next moves set aside with Not now (remembered for the account); web/guide.js paints it, hidden when none. -->
|
|
216
|
+
<div class="ai-chat-guide-set-aside" id="chat-guide-set-aside" hidden></div>
|
|
199
217
|
<div class="ai-chat-guide-actions">
|
|
200
218
|
<button data-command-id="shell.guide-turn-off" type="button" id="chat-guide-off" data-tip="Stops the Guide looking at this computer. This conversation stays; turn it on again from ≡ → Guide.">Turn off the Guide</button>
|
|
201
219
|
<button data-command-id="shell.guide-delete" type="button" id="chat-guide-delete" data-tip="Deletes your Guide conversations in this projects folder. Asks first.">Delete Guide history…</button>
|
|
@@ -688,7 +706,8 @@
|
|
|
688
706
|
sent. Filled by web/guide.js; the buttons never scroll away. -->
|
|
689
707
|
<div class="modal-backdrop" id="guide-agent-modal" role="dialog" aria-modal="true" aria-labelledby="guide-modal-title" aria-describedby="guide-modal-sub">
|
|
690
708
|
<div class="modal guide-dialog">
|
|
691
|
-
|
|
709
|
+
<!-- #2140: Flo, the Guide's face, beside the title — never beside the choice below. -->
|
|
710
|
+
<div class="guide-head"><span class="guide-flo" id="guide-flo" aria-hidden="true"></span><div class="modal-title" id="guide-modal-title" tabindex="-1">Let the Guide show you around?</div></div>
|
|
692
711
|
<div class="modal-sub" id="guide-modal-sub"></div>
|
|
693
712
|
<div class="guide-body" id="guide-modal-body"></div>
|
|
694
713
|
<div class="sr-only" id="guide-modal-live" role="status" aria-live="polite"></div>
|
|
@@ -711,6 +730,19 @@
|
|
|
711
730
|
</div>
|
|
712
731
|
</div>
|
|
713
732
|
|
|
733
|
+
<!-- #2059: an Instructor answer's AI uses no tools; giving it Access turns it into an ordinary chat, so FloLess asks first.
|
|
734
|
+
web/chat.js fills the body and the confirm label with the chosen Access. -->
|
|
735
|
+
<div class="modal-backdrop" id="chat-instructor-access-modal" role="dialog" aria-modal="true" aria-labelledby="chat-instructor-access-title" aria-describedby="chat-instructor-access-sub">
|
|
736
|
+
<div class="modal">
|
|
737
|
+
<div class="modal-title" id="chat-instructor-access-title">Change this chat’s Access?</div>
|
|
738
|
+
<div class="modal-sub" id="chat-instructor-access-sub">This chat is an Instructor answer, so the AI used no tools.</div>
|
|
739
|
+
<div class="modal-actions">
|
|
740
|
+
<button data-command-id="shell.dialog-cancel#changing this chat’s Access" id="chat-instructor-access-keep" type="button">Keep as Instructor answer</button>
|
|
741
|
+
<button data-command-id="shell.chat-instructor-access-confirm" id="chat-instructor-access-confirm" type="button" class="primary">Change Access</button>
|
|
742
|
+
</div>
|
|
743
|
+
</div>
|
|
744
|
+
</div>
|
|
745
|
+
|
|
714
746
|
<div class="modal-backdrop" id="tool-updates-modal" role="dialog" aria-modal="true"
|
|
715
747
|
aria-labelledby="tool-updates-title" aria-describedby="tool-updates-sub" aria-busy="false">
|
|
716
748
|
<div class="modal tool-updates-dialog" tabindex="-1">
|
|
@@ -718,6 +750,8 @@
|
|
|
718
750
|
<div class="modal-sub" id="tool-updates-sub">Your workflows keep running on the tool versions you approved until you approve a change.</div>
|
|
719
751
|
<div class="tool-updates-body" id="tool-updates-body"></div>
|
|
720
752
|
<div class="tool-updates-live" id="tool-updates-live" role="status" aria-live="polite" aria-atomic="true"></div>
|
|
753
|
+
<div class="tool-updates-progress" id="tool-updates-progress" hidden></div>
|
|
754
|
+
<div class="tool-updates-announce" id="tool-updates-announce" role="status" aria-live="polite" aria-atomic="true"></div>
|
|
721
755
|
<div class="tool-updates-foot" id="tool-updates-foot"></div>
|
|
722
756
|
<div class="modal-actions">
|
|
723
757
|
<button data-command-id="shell.tool-updates-check" id="tool-updates-check" type="button">Check for updates</button>
|
|
@@ -1223,7 +1257,7 @@
|
|
|
1223
1257
|
<button data-command-id="shell.dialog-cancel#the approval review" id="approval-review-cancel" type="button">Cancel</button>
|
|
1224
1258
|
<button data-command-id="shell.approval-retry" id="approval-review-retry" type="button" hidden>Try again</button>
|
|
1225
1259
|
<button data-command-id="shell.approval-reload" id="approval-review-reload" type="button" hidden>Reload current review</button>
|
|
1226
|
-
<button data-command-id="shell.dialog-close#approval
|
|
1260
|
+
<button data-command-id="shell.dialog-close#approval review" id="approval-review-close" type="button" hidden>Close</button>
|
|
1227
1261
|
<button data-command-id="shell.approval-confirm" id="approval-review-confirm" type="button" class="primary" disabled>Approve selected changes</button>
|
|
1228
1262
|
</div>
|
|
1229
1263
|
</div>
|
|
@@ -1367,6 +1401,7 @@
|
|
|
1367
1401
|
<p>FloLess will show projects and workflows from this folder.</p>
|
|
1368
1402
|
</div>
|
|
1369
1403
|
<div class="workspace-root-error" id="workspace-root-error" role="alert" aria-live="assertive" hidden></div>
|
|
1404
|
+
<div id="workspace-root-instructor-note" role="note" aria-label="Instructor guidance" aria-live="polite" tabindex="0" hidden></div>
|
|
1370
1405
|
<div class="modal-actions">
|
|
1371
1406
|
<button data-command-id="shell.workspace-root-cancel" id="workspace-root-cancel" type="button">Close</button>
|
|
1372
1407
|
<button data-command-id="shell.workspace-root-change" id="workspace-root-change" type="button">Choose another Workspace directory…</button>
|
|
@@ -1378,7 +1413,12 @@
|
|
|
1378
1413
|
<div class="modal-backdrop" id="requests-modal">
|
|
1379
1414
|
<div class="modal requests" role="dialog" aria-modal="true" aria-labelledby="requests-title" tabindex="-1">
|
|
1380
1415
|
<div class="modal-title" id="requests-title">Requests</div>
|
|
1381
|
-
<div class="modal-sub">Start queued work in AI Chat or run it in the background with your terminal AI.</div>
|
|
1416
|
+
<div class="modal-sub" id="requests-sub">Start queued work in AI Chat or run it in the background with your terminal AI.</div>
|
|
1417
|
+
<!-- #2060: Done lists the Requests that left the queue, so each one's conversation stays reachable. -->
|
|
1418
|
+
<div class="tabs req-view" id="requests-view" role="tablist" aria-label="Queued or done requests">
|
|
1419
|
+
<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>
|
|
1421
|
+
</div>
|
|
1382
1422
|
<div class="req-guidance" id="requests-guidance" role="status" aria-live="polite" aria-atomic="true" hidden></div>
|
|
1383
1423
|
<span class="sr-only" id="requests-action-status" role="status" aria-live="polite" aria-atomic="true"></span>
|
|
1384
1424
|
<!-- Scope + search. The scope row is hidden when nothing is open to scope TO (the
|
|
@@ -1391,6 +1431,7 @@
|
|
|
1391
1431
|
<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">
|
|
1392
1432
|
<div class="requests-list" id="requests-list"></div>
|
|
1393
1433
|
<div class="modal-actions">
|
|
1434
|
+
<span class="req-done-note" id="requests-done-note" hidden>Showing the last 30 days. Nothing here runs again.</span>
|
|
1394
1435
|
<button data-command-id="shell.request-clear" id="requests-clear">Clear all</button>
|
|
1395
1436
|
<button data-command-id="shell.request-copy" id="requests-copy">Copy available</button>
|
|
1396
1437
|
<button data-command-id="shell.dialog-close#the requests list" id="requests-close" class="primary">Close</button>
|
|
@@ -1474,6 +1515,8 @@
|
|
|
1474
1515
|
<div class="modal routines">
|
|
1475
1516
|
<div class="modal-title">Routines</div>
|
|
1476
1517
|
<div class="modal-sub">Run a workflow automatically — on a schedule, or on a live trigger (e.g. whenever your model changes) — exactly like clicking ▶ Run workflow. Or start an agent on a schedule: nobody watches that run, so anything that would ask you is declined and listed for you on the Agents page.</div>
|
|
1518
|
+
<!-- #2062: never read as always-on. The link shows only where the start-on-login setting exists (app.js). -->
|
|
1519
|
+
<p class="rtn-local-note" id="rtn-local-note">Routines run only while FloLess is running on this computer. A run that falls while it is closed is noted as missed, and isn’t made up later. <button type="button" class="rtn-link" id="rtn-startup-link" data-start-on-login-link data-command-id="shell.routines-start-on-login" data-tip="Closes Routines and shows the Start on startup switch in the menu" hidden>Start FloLess when you sign in…</button></p>
|
|
1477
1520
|
<div class="rtn-quota" id="rtn-quota"></div>
|
|
1478
1521
|
<div class="routines-list" id="routines-list"></div>
|
|
1479
1522
|
<div class="modal-actions">
|
|
@@ -1590,6 +1633,9 @@
|
|
|
1590
1633
|
<label>Inputs</label>
|
|
1591
1634
|
<div id="rtn-inputs"></div>
|
|
1592
1635
|
</div>
|
|
1636
|
+
<!-- #2062: the editor says it too (it opens straight from an agent's Schedule…); no link here, because leaving
|
|
1637
|
+
would drop the routine being written — the Routines list carries the link. -->
|
|
1638
|
+
<div class="rtn-cron-hint rtn-local-hint" id="rtn-local-hint">Runs only while FloLess is running on this computer.<span data-start-on-login-hint hidden> To have FloLess start when you sign in, turn on Start on startup in the ≡ menu.</span></div>
|
|
1593
1639
|
<div class="modal-field rtn-enabled-field">
|
|
1594
1640
|
<label class="rtn-toggle" data-command-id="shell.routine-enabled">
|
|
1595
1641
|
<input type="checkbox" id="rtn-enabled" checked>
|
|
@@ -1638,6 +1684,7 @@
|
|
|
1638
1684
|
<span>Include these import details</span>
|
|
1639
1685
|
</label>
|
|
1640
1686
|
</div>
|
|
1687
|
+
<div class="integrations-hint ri-send-error" id="ri-send-error" role="alert" hidden></div>
|
|
1641
1688
|
<div class="integrations-hint" id="ri-context"></div>
|
|
1642
1689
|
<div class="modal-actions">
|
|
1643
1690
|
<button data-command-id="shell.dialog-cancel#the issue report" id="ri-cancel">Cancel</button>
|
|
@@ -1665,9 +1712,9 @@
|
|
|
1665
1712
|
NuGet / OpenAPI / …). The wizard body (#graft-body) is built per-step in
|
|
1666
1713
|
aware.js. AWARE reads the source + builds the agent (incl. its Tekla
|
|
1667
1714
|
model-plugin recipe); floless only stages, previews, and surfaces it. -->
|
|
1668
|
-
<div class="modal-backdrop" id="graft-modal">
|
|
1669
|
-
<div class="modal graft">
|
|
1670
|
-
<div class="modal-title" id="graft-title">Graft into tool</div>
|
|
1715
|
+
<div class="modal-backdrop" id="graft-modal" role="dialog" aria-modal="true" aria-labelledby="graft-title" aria-describedby="graft-sub">
|
|
1716
|
+
<div class="modal graft" tabindex="-1">
|
|
1717
|
+
<div class="modal-title" id="graft-title" tabindex="-1">Graft into tool</div>
|
|
1671
1718
|
<div class="modal-sub" id="graft-sub">Point at a DLL, package, or API spec — AWARE reads it and builds a tool you can drop into any workflow.</div>
|
|
1672
1719
|
<div id="graft-body"></div>
|
|
1673
1720
|
<div id="graft-instructor-note" role="note" aria-label="Instructor guidance" aria-live="polite" tabindex="0" hidden></div>
|
|
@@ -1756,9 +1803,13 @@
|
|
|
1756
1803
|
<script src="analytics.js"></script>
|
|
1757
1804
|
<script src="commands.js"></script>
|
|
1758
1805
|
<script src="app.js"></script>
|
|
1806
|
+
<script src="workspace-root-management.js"></script>
|
|
1807
|
+
<script src="parser-setup-recovery.js"></script>
|
|
1759
1808
|
<script src="renderers.js"></script>
|
|
1760
1809
|
<script src="aware-update-client.js"></script>
|
|
1761
1810
|
<script src="leave-guard.js"></script>
|
|
1811
|
+
<script src="flo.js"></script>
|
|
1812
|
+
<script src="flo-avatar.js"></script>
|
|
1762
1813
|
<script src="aware.js"></script>
|
|
1763
1814
|
<script src="tool-updates.js"></script>
|
|
1764
1815
|
<script src="panels.js"></script>
|
package/dist/web/instructor.js
CHANGED
|
@@ -432,6 +432,9 @@
|
|
|
432
432
|
if (guidance && typeof window.flolessGraftInstructorExplain === 'function') {
|
|
433
433
|
window.flolessGraftInstructorExplain({ chip: guidance.chip || '', parts: guidance.parts.slice(), commandId: guidance.commandId || '' });
|
|
434
434
|
}
|
|
435
|
+
if (guidance && typeof window.flolessWorkspaceRootInstructorExplain === 'function') {
|
|
436
|
+
window.flolessWorkspaceRootInstructorExplain({ chip: guidance.chip || '', parts: guidance.parts.slice(), commandId: guidance.commandId || '' });
|
|
437
|
+
}
|
|
435
438
|
}
|
|
436
439
|
|
|
437
440
|
function setCollapsed(next) {
|
|
@@ -658,6 +661,7 @@
|
|
|
658
661
|
if (!snapshot.focus) return;
|
|
659
662
|
snapshot.focus = null;
|
|
660
663
|
if (typeof window.flolessGraftInstructorClear === 'function') window.flolessGraftInstructorClear();
|
|
664
|
+
if (typeof window.flolessWorkspaceRootInstructorClear === 'function') window.flolessWorkspaceRootInstructorClear();
|
|
661
665
|
paint();
|
|
662
666
|
}
|
|
663
667
|
|
|
@@ -854,7 +858,7 @@
|
|
|
854
858
|
'On the workflow canvas', 'In workflow setup dialogs',
|
|
855
859
|
// The Informed by row sits at the top of the canvas column, so it is read right after the canvas.
|
|
856
860
|
// #1998: the approval notices sit above the canvas with the Informed by row.
|
|
857
|
-
'In the Needs you notice', 'In the Approval carried over row',
|
|
861
|
+
'In the Needs you notice', 'In the morning briefing notice', 'In the Approval carried over row',
|
|
858
862
|
'In the Informed by row', 'In Set inputs',
|
|
859
863
|
'At the left edge of the workspace', 'At the edge of the left or Inspect panel', 'In the left panel', 'Between AI Chat and Model', 'In the Model section of the left panel', 'In the Grid object in the Model section',
|
|
860
864
|
'In AI Chat', 'In AI Chat history', 'In AI Chat settings', 'In the node Inspect panel', 'In the Instructor strip',
|
|
@@ -1724,6 +1728,7 @@
|
|
|
1724
1728
|
if (snapshot.focus && hiddenCommands.indexOf(snapshot.focus.commandId) !== -1) {
|
|
1725
1729
|
snapshot.focus = null;
|
|
1726
1730
|
if (typeof window.flolessGraftInstructorClear === 'function') window.flolessGraftInstructorClear();
|
|
1731
|
+
if (typeof window.flolessWorkspaceRootInstructorClear === 'function') window.flolessWorkspaceRootInstructorClear();
|
|
1727
1732
|
}
|
|
1728
1733
|
paint();
|
|
1729
1734
|
|
|
@@ -216,14 +216,37 @@
|
|
|
216
216
|
// The plain line stays unless EVERY tool on the card that has no check is offered an update (each offer names its tool).
|
|
217
217
|
const allOffered = connections() && hostAgents.every((agent) => agent.hasProbe || offers.includes(agent));
|
|
218
218
|
if (hostAgents.length && !hostAgents.some((agent) => agent.hasProbe) && !allOffered) {
|
|
219
|
-
|
|
219
|
+
// #2055: not a dead end. Prepare a tool (below) builds a SEPARATE tool, which can carry its own check —
|
|
220
|
+
// it does not add a check to the installed one, so the sentence must not promise that.
|
|
221
|
+
card.append(make('p', 'local-discovery-route',
|
|
222
|
+
'This tool can’t check the connection yet. You can prepare a separate tool from this program’s DLLs, with a read-only command as its own check, or ask AI Chat.'));
|
|
220
223
|
}
|
|
221
|
-
|
|
224
|
+
// #2055: every program can lead to Graft — also one an installed tool already connects — and Graft
|
|
225
|
+
// opens on its install folder's DLLs, worked out by the server on click (never during the scan).
|
|
226
|
+
// With no install folder known, or one FloLess could not look in, Graft says so and lets the person choose one.
|
|
227
|
+
if (finding.kind === 'application' && !finding.graft) {
|
|
228
|
+
const label = String(finding.label || 'this program');
|
|
222
229
|
const prepare = make('button', '', 'Prepare a tool');
|
|
223
230
|
prepare.type = 'button'; prepare.dataset.commandId = 'shell.discovery-prepare-tool';
|
|
224
|
-
prepare.
|
|
231
|
+
if (hostAgents.length) prepare.dataset.tip = 'Build an extra tool for this program from its DLLs.';
|
|
232
|
+
prepare.addEventListener('click', async () => {
|
|
233
|
+
let ref = '';
|
|
234
|
+
let unreadable = false;
|
|
235
|
+
if (finding.path) {
|
|
236
|
+
const generation = scanGeneration;
|
|
237
|
+
prepare.disabled = true;
|
|
238
|
+
try {
|
|
239
|
+
const data = await post('/api/local-discovery/prepare-source', { path: String(finding.path), label });
|
|
240
|
+
ref = typeof data.source?.ref === 'string' ? data.source.ref : '';
|
|
241
|
+
unreadable = !ref && data.source?.unreadable === true;
|
|
242
|
+
} catch { unreadable = true; } finally { prepare.disabled = false; }
|
|
243
|
+
// Discover was closed, or the results replaced by another scan, while FloLess looked: open nothing.
|
|
244
|
+
if (!prepare.isConnected || generation !== scanGeneration) return;
|
|
245
|
+
}
|
|
225
246
|
close(false);
|
|
226
|
-
document.dispatchEvent(new CustomEvent('floless:discovery-graft', { detail: {
|
|
247
|
+
document.dispatchEvent(new CustomEvent('floless:discovery-graft', { detail: {
|
|
248
|
+
kind: 'dlls', ref, origin: { label, folderKnown: Boolean(ref), ...(unreadable ? { unreadable: true } : {}) },
|
|
249
|
+
} }));
|
|
227
250
|
});
|
|
228
251
|
actions.append(prepare);
|
|
229
252
|
}
|
|
@@ -256,7 +279,7 @@
|
|
|
256
279
|
return card;
|
|
257
280
|
}
|
|
258
281
|
/** "Services you can connect" — sign-in services and key services, from Integrations' inventory. */
|
|
259
|
-
function serviceRow(service) {
|
|
282
|
+
function serviceRow(service, choicesUnreadable = false) {
|
|
260
283
|
const row = make('div', 'int-account local-discovery-service');
|
|
261
284
|
const copy = make('div', 'int-account-copy');
|
|
262
285
|
copy.append(make('span', 'int-account-name', service.name));
|
|
@@ -307,6 +330,12 @@
|
|
|
307
330
|
const account = connections()?.checkAccountOf(service);
|
|
308
331
|
if (service.statusUnknown) {
|
|
309
332
|
copy.append(make('span', 'int-account-origin', 'FloLess couldn’t read whether this key is saved. Close this window and try again.'));
|
|
333
|
+
} else if (checks.length && service.kind === 'sign-in' && choicesUnreadable && connections()) {
|
|
334
|
+
// #2057: an unreadable choices file may hold "your own Claude or Codex connection", so no FloLess account is checked.
|
|
335
|
+
copy.append(make('span', 'int-account-origin local-discovery-choices-unreadable', connections().CHOICES_UNREADABLE_CHECK_SENTENCE));
|
|
336
|
+
} else if (checks.length && service.choice?.source === 'native' && connections()) {
|
|
337
|
+
// #2057: Discover follows the Integrations choice — the person's own connection is never checked as a FloLess account.
|
|
338
|
+
copy.append(make('span', 'int-account-origin local-discovery-native-choice', connections().nativeChoiceSentence(service.name)));
|
|
310
339
|
} else if (checks.length && service.connected && connections() && account === undefined) {
|
|
311
340
|
copy.append(make('span', 'int-account-origin', 'Choose which account to check in Integrations first.'));
|
|
312
341
|
} else if (checks.length && service.connected && connections()) {
|
|
@@ -336,7 +365,7 @@
|
|
|
336
365
|
const services = await connections().loadServices();
|
|
337
366
|
servicesList.replaceChildren();
|
|
338
367
|
if (!services.length) servicesList.append(make('p', 'local-discovery-no-filter-match', 'No services to connect yet.'));
|
|
339
|
-
for (const service of services) servicesList.append(serviceRow(service));
|
|
368
|
+
for (const service of services) servicesList.append(serviceRow(service, Boolean(services.choicesUnreadable)));
|
|
340
369
|
} catch (error) {
|
|
341
370
|
servicesList.replaceChildren(make('p', 'local-discovery-no-filter-match', connections().sentenceOf(error)));
|
|
342
371
|
}
|
package/dist/web/panels.js
CHANGED
|
@@ -508,6 +508,8 @@
|
|
|
508
508
|
} catch (err) {
|
|
509
509
|
const cred = err && err.body && err.body.credentialIssue;
|
|
510
510
|
if (cred) showToast(`Session expired — reconnect ${cred.label} (≡ menu → Integrations), then run again.`, 'warn');
|
|
511
|
+
// #2123: FloLess declined before anything started (archived, edited, re-published) and said why in plain words.
|
|
512
|
+
else if (err && err.body && err.body.notRun && typeof err.body.error === 'string') showToast(err.body.error, 'info');
|
|
511
513
|
else showToast('The workflow could not run. Your inputs are still here. Check that its connection is open, then try again.', 'warn');
|
|
512
514
|
} finally {
|
|
513
515
|
btn.disabled = false;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/* A locally requested file copy and fresh parser setup, with every limitation shown before choosing. */
|
|
2
|
+
(() => {
|
|
3
|
+
let modal;
|
|
4
|
+
let previousFocus;
|
|
5
|
+
let busy = false;
|
|
6
|
+
let selected;
|
|
7
|
+
let preview;
|
|
8
|
+
let incompleteReview = false;
|
|
9
|
+
let dialogGeneration = 0;
|
|
10
|
+
let stateGeneration = 0;
|
|
11
|
+
let folderRequestGeneration = 0;
|
|
12
|
+
const changeState = () => {
|
|
13
|
+
stateGeneration++;
|
|
14
|
+
folderRequestGeneration++;
|
|
15
|
+
modal?.querySelector('[data-setup-status]')?.replaceChildren();
|
|
16
|
+
for (const facts of modal?.querySelectorAll('[data-current-folder]') || []) facts.remove();
|
|
17
|
+
};
|
|
18
|
+
const api = (path, body) => window.flolessBridge.api(path, { method: 'POST', body: JSON.stringify(body) });
|
|
19
|
+
const element = (tag, className, text) => {
|
|
20
|
+
const node = document.createElement(tag);
|
|
21
|
+
if (className) node.className = className;
|
|
22
|
+
if (text) node.textContent = text;
|
|
23
|
+
return node;
|
|
24
|
+
};
|
|
25
|
+
const close = () => {
|
|
26
|
+
if (busy) return;
|
|
27
|
+
dialogGeneration++; changeState();
|
|
28
|
+
modal?.remove(); modal = null;
|
|
29
|
+
const liveCard = selected === 'tekla-parser'
|
|
30
|
+
? document.querySelector('[data-parser-setup="tekla-parser"], [data-module-remedy="tekla-parser"], [data-seed-template="tekla-parser"]')
|
|
31
|
+
: document.querySelector('[data-parser-setup="revit-model"], [data-revit-remedy], [data-seed-template="revit-model"]');
|
|
32
|
+
(previousFocus?.isConnected ? previousFocus : liveCard)?.focus();
|
|
33
|
+
};
|
|
34
|
+
const refreshFocused = () => {
|
|
35
|
+
const focused = document.activeElement;
|
|
36
|
+
if (modal?.contains(focused) && focused.matches('[data-command-id]')) window.Instructor?.refreshCarrier?.(focused);
|
|
37
|
+
};
|
|
38
|
+
const updateBusy = (value, phase = 'checking') => {
|
|
39
|
+
busy = value;
|
|
40
|
+
// Keep keyboard focus inside the dialog before its last focused control is disabled.
|
|
41
|
+
if (value) modal?.focus();
|
|
42
|
+
modal?.setAttribute('aria-busy', String(value));
|
|
43
|
+
for (const button of modal?.querySelectorAll('button') || []) {
|
|
44
|
+
button.disabled = value;
|
|
45
|
+
if (value) button.dataset.blockedReason = phase === 'setup' ? 'Fresh parser setup is in progress. Keep FloLess open until it finishes.' : 'FloLess is checking the parser files.';
|
|
46
|
+
else delete button.dataset.blockedReason;
|
|
47
|
+
}
|
|
48
|
+
refreshFocused();
|
|
49
|
+
};
|
|
50
|
+
const error = (message) => {
|
|
51
|
+
const box = modal.querySelector('[data-setup-error]');
|
|
52
|
+
box.textContent = message; box.hidden = !message;
|
|
53
|
+
};
|
|
54
|
+
function create(id, opener) {
|
|
55
|
+
close(); previousFocus = opener || document.activeElement; selected = id; incompleteReview = false; preview = null;
|
|
56
|
+
dialogGeneration++;
|
|
57
|
+
modal = element('div', 'modal-backdrop show'); modal.id = 'parser-setup-recovery-modal';
|
|
58
|
+
modal.tabIndex = -1;
|
|
59
|
+
modal.setAttribute('role', 'dialog'); modal.setAttribute('aria-modal', 'true'); modal.setAttribute('aria-labelledby', 'parser-setup-recovery-heading');
|
|
60
|
+
const panel = element('div', 'modal revreview');
|
|
61
|
+
const heading = element('div', 'modal-title', `Set up a fresh ${id === 'tekla-parser' ? 'Tekla' : 'Revit'} Parser?`);
|
|
62
|
+
heading.id = 'parser-setup-recovery-heading'; panel.append(heading);
|
|
63
|
+
const body = element('div', 'revreview-body'); body.dataset.setupBody = '';
|
|
64
|
+
body.append(element('p', 'modal-sub', 'Checking the current workflow files…')); panel.append(body);
|
|
65
|
+
const box = element('div', 'modal-error'); box.dataset.setupError = ''; box.hidden = true; box.setAttribute('role', 'alert'); panel.append(box);
|
|
66
|
+
const status = element('p', 'modal-sub'); status.dataset.setupStatus = ''; status.setAttribute('role', 'status'); panel.append(status);
|
|
67
|
+
const actions = element('div', 'modal-actions');
|
|
68
|
+
const cancel = element('button', '', 'Cancel'); cancel.type = 'button'; cancel.dataset.commandId = 'shell.parser-setup-cancel'; cancel.addEventListener('click', close); actions.append(cancel);
|
|
69
|
+
panel.append(actions); modal.append(panel); document.body.append(modal);
|
|
70
|
+
modal.addEventListener('click', (event) => { if (event.target === modal) close(); });
|
|
71
|
+
cancel.focus();
|
|
72
|
+
}
|
|
73
|
+
document.addEventListener('keydown', (event) => {
|
|
74
|
+
if (!modal || (event.key !== 'Escape' && event.key !== 'Tab')) return;
|
|
75
|
+
event.stopImmediatePropagation();
|
|
76
|
+
if (event.key === 'Escape') { event.preventDefault(); close(); return; }
|
|
77
|
+
if (busy) { event.preventDefault(); modal.focus(); return; }
|
|
78
|
+
const buttons = [...modal.querySelectorAll('button:not([disabled])')];
|
|
79
|
+
if (!buttons.length) { event.preventDefault(); modal.focus(); return; }
|
|
80
|
+
const first = buttons[0], last = buttons.at(-1), focused = document.activeElement;
|
|
81
|
+
if (!modal.contains(focused) || focused === modal) {
|
|
82
|
+
event.preventDefault(); (event.shiftKey ? last : first)?.focus();
|
|
83
|
+
} else if (event.shiftKey && focused === first) { event.preventDefault(); last?.focus(); }
|
|
84
|
+
else if (!event.shiftKey && focused === last) { event.preventDefault(); first?.focus(); }
|
|
85
|
+
}, true);
|
|
86
|
+
function action(label, command, callback, primary = false) {
|
|
87
|
+
const button = element('button', primary ? 'primary' : '', label);
|
|
88
|
+
button.type = 'button'; button.dataset.commandId = command; button.addEventListener('click', callback);
|
|
89
|
+
modal.querySelector('.modal-actions').append(button); return button;
|
|
90
|
+
}
|
|
91
|
+
function renderPreview() {
|
|
92
|
+
changeState();
|
|
93
|
+
const body = modal.querySelector('[data-setup-body]'); body.replaceChildren();
|
|
94
|
+
modal.querySelector('#parser-setup-recovery-heading').textContent = incompleteReview ? 'The copy would be incomplete' : `Set up a fresh ${selected === 'tekla-parser' ? 'Tekla' : 'Revit'} Parser?`;
|
|
95
|
+
body.append(element('p', 'approval-impact', 'The current shared parser could not be verified. You can keep its workflow files and prepare the packaged parser instead.'));
|
|
96
|
+
body.append(element('h3', '', 'Kept'), element('p', '', 'Your project files and signed approval history stay. FloLess saves a copy of readable workflow and same-name agent files.'));
|
|
97
|
+
body.append(element('h3', '', 'Replaced'), element('p', '', 'The shared parser returns to the packaged version. This does not approve a model. FloLess cannot tell which projects used the previous parser. Open a project’s Audit and Approve steps when you need its approved model in the shared parser.'));
|
|
98
|
+
body.append(element('p', '', 'Original folder from this review'));
|
|
99
|
+
const originalPath = element('code', '', preview.originalFolder); originalPath.dataset.tip = preview.originalFolder; body.append(originalPath);
|
|
100
|
+
body.append(element('h3', '', 'Copy limits'));
|
|
101
|
+
for (const limitation of preview.limitations || []) body.append(element('p', '', limitation));
|
|
102
|
+
if (preview.omissions?.length) {
|
|
103
|
+
body.append(element('h3', '', 'Files that cannot be copied'));
|
|
104
|
+
const list = element('ul'); for (const item of preview.omissions) list.append(element('li', '', item)); body.append(list);
|
|
105
|
+
body.append(element('p', 'approval-impact', incompleteReview
|
|
106
|
+
? 'Continuing will replace the parser without a complete copy. These missing items will be recorded with the result.'
|
|
107
|
+
: 'Repair these items and try again, or review the separate choice to continue without a complete copy.'));
|
|
108
|
+
}
|
|
109
|
+
const actions = modal.querySelector('.modal-actions'); while (actions.children.length > 1) actions.lastChild.remove();
|
|
110
|
+
action('Try setup again', 'shell.parser-setup-retry', retry);
|
|
111
|
+
action('Show original folder', 'shell.parser-setup-show-original', showFolder('original'));
|
|
112
|
+
if (preview.omissions?.length && !incompleteReview) action('Review incomplete copy…', 'shell.parser-setup-review-incomplete', () => { incompleteReview = true; renderPreview(); });
|
|
113
|
+
else {
|
|
114
|
+
const choice = action(incompleteReview ? 'Set up fresh without a complete copy' : 'Keep a copy and set up fresh',
|
|
115
|
+
incompleteReview ? 'shell.parser-setup-confirm-incomplete' : 'shell.parser-setup-confirm', confirm, true);
|
|
116
|
+
if (incompleteReview) choice.className = 'danger';
|
|
117
|
+
}
|
|
118
|
+
actions.firstChild.focus(); refreshFocused();
|
|
119
|
+
}
|
|
120
|
+
const parserName = () => `${selected === 'tekla-parser' ? 'Tekla' : 'Revit'} Parser`;
|
|
121
|
+
const failureText = (code, status) => {
|
|
122
|
+
if (status === 401 || status === 403) return 'Please sign in again to review parser setup.';
|
|
123
|
+
if (code === 'parser-setup-choice-changed') return "Fresh setup didn't finish. If files are left in the original folder, move or repair them. Then choose Try setup again to review the choices.";
|
|
124
|
+
if (code === 'registry-release-missing') return `Fresh setup didn't finish because ${selected === 'revit-model' ? 'the Revit reader' : 'a parser component'} it needs isn't available to download. Try setup again later, or close this dialog and report this setup issue from the ${parserName()} card.`;
|
|
125
|
+
return `FloLess couldn't finish this setup step. Choose Try setup again to check the current files, or close this dialog and follow the ${parserName()} card.`;
|
|
126
|
+
};
|
|
127
|
+
function copyFacts(copy, body) {
|
|
128
|
+
if (!copy) return;
|
|
129
|
+
body.append(element('p', '', `Copy saved ${new Date(copy.at).toLocaleString()} · ${copy.completeCopy ? 'complete' : 'incomplete'}`));
|
|
130
|
+
const path = element('code', '', copy.backupPath); path.dataset.tip = copy.backupPath; body.append(path);
|
|
131
|
+
for (const item of copy.omissions || []) body.append(element('p', '', item));
|
|
132
|
+
}
|
|
133
|
+
function showFolder(kind) {
|
|
134
|
+
return async () => {
|
|
135
|
+
const origin = modal, parser = selected, dialog = dialogGeneration, state = stateGeneration;
|
|
136
|
+
const request = ++folderRequestGeneration;
|
|
137
|
+
const active = () => modal === origin && origin?.isConnected && selected === parser
|
|
138
|
+
&& dialogGeneration === dialog && stateGeneration === state && folderRequestGeneration === request;
|
|
139
|
+
origin.querySelector('[data-setup-status]').textContent = '';
|
|
140
|
+
origin.querySelector('[data-folder-fact="action"]')?.remove();
|
|
141
|
+
let result, failed = false, failureStatus;
|
|
142
|
+
try { result = await api(`/api/parser-setup/show-${kind}`, { appId: parser }); }
|
|
143
|
+
catch (failure) { result = failure.body; failureStatus = failure.status; failed = true; }
|
|
144
|
+
if (!active()) return;
|
|
145
|
+
const signingIn = failureStatus === 401 || failureStatus === 403;
|
|
146
|
+
const folder = result?.currentFolder;
|
|
147
|
+
const path = !signingIn && folder?.kind === kind && typeof folder.path === 'string' && folder.path ? folder.path : null;
|
|
148
|
+
const failureFacts = origin.querySelector('[data-folder-fact="failure"]');
|
|
149
|
+
if (kind === 'original' && failureFacts) {
|
|
150
|
+
if (path) currentFolderFacts(path, kind, origin, 'failure');
|
|
151
|
+
else if (failed && !signingIn && result && typeof result === 'object') failureFacts.remove();
|
|
152
|
+
}
|
|
153
|
+
if (failed && path && !(kind === 'original' && failureFacts)) currentFolderFacts(path, kind, origin);
|
|
154
|
+
if (failed) origin.querySelector('[data-setup-status]').textContent = signingIn
|
|
155
|
+
? 'Please sign in again to open this folder.'
|
|
156
|
+
: !result && kind === 'original' && failureFacts
|
|
157
|
+
? "FloLess couldn't check this folder right now. The original folder path shown above is from the last check. Choose Try setup again to check the current files, or close this dialog and choose Report an issue in the footer."
|
|
158
|
+
: path
|
|
159
|
+
? "FloLess couldn't open this folder. Copy the path shown above and open it in your file manager."
|
|
160
|
+
: kind === 'copy'
|
|
161
|
+
? "FloLess can't open or find the saved copy right now. Close this dialog and choose Report an issue in the footer."
|
|
162
|
+
: "FloLess can't open or find this folder right now. Choose Try setup again to check the current files, or close this dialog and choose Report an issue in the footer.";
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function currentFolderFacts(path, kind, origin = modal, role = 'action') {
|
|
166
|
+
origin.querySelector(`[data-folder-fact="${role}"]`)?.remove();
|
|
167
|
+
const body = origin.querySelector('[data-setup-body]');
|
|
168
|
+
if (role === 'action' && [...body.querySelectorAll('code')].some(code => code.textContent === path)) return;
|
|
169
|
+
const facts = element('div'); facts.dataset.currentFolder = ''; facts.dataset.folderFact = role;
|
|
170
|
+
facts.append(element('p', '', kind === 'copy' ? 'Saved copy folder' : 'Original folder'));
|
|
171
|
+
const code = element('code', '', path); code.dataset.tip = path; facts.append(code);
|
|
172
|
+
if (role === 'failure') body.prepend(facts);
|
|
173
|
+
else body.append(facts);
|
|
174
|
+
}
|
|
175
|
+
function renderFailure(failure) {
|
|
176
|
+
changeState();
|
|
177
|
+
incompleteReview = false;
|
|
178
|
+
const code = failure.body?.code || failure.body?.failureCode;
|
|
179
|
+
const signingIn = failure.status === 401 || failure.status === 403;
|
|
180
|
+
modal.querySelector('#parser-setup-recovery-heading').textContent = `${parserName()} setup needs attention`;
|
|
181
|
+
const body = modal.querySelector('[data-setup-body]'); body.replaceChildren();
|
|
182
|
+
const folder = failure.body?.currentFolder;
|
|
183
|
+
if (!signingIn && code !== 'registry-release-missing' && folder?.kind === 'original' && typeof folder.path === 'string' && folder.path) {
|
|
184
|
+
currentFolderFacts(folder.path, 'original', modal, 'failure');
|
|
185
|
+
}
|
|
186
|
+
copyFacts(failure.body?.copy, body);
|
|
187
|
+
const actions = modal.querySelector('.modal-actions'); actions.replaceChildren();
|
|
188
|
+
action('Cancel', 'shell.parser-setup-cancel', close);
|
|
189
|
+
if (!signingIn && code !== 'registry-release-missing') action('Show original folder', 'shell.parser-setup-show-original', showFolder('original'));
|
|
190
|
+
if (!signingIn && failure.body?.copy) action('Show saved copy', 'shell.parser-setup-show-copy', showFolder('copy'));
|
|
191
|
+
if (!signingIn) action('Try setup again', 'shell.parser-setup-retry', retry);
|
|
192
|
+
error(failureText(code, failure.status)); updateBusy(false); actions.firstChild.focus(); refreshFocused();
|
|
193
|
+
}
|
|
194
|
+
function renderReady(copy) {
|
|
195
|
+
changeState();
|
|
196
|
+
error(''); modal.querySelector('#parser-setup-recovery-heading').textContent = `${parserName()} is ready`;
|
|
197
|
+
const body = modal.querySelector('[data-setup-body]'); body.replaceChildren();
|
|
198
|
+
body.append(element('p', '', copy ? `${parserName()} is ready. This does not approve a model.` : `${parserName()} is ready. FloLess has no verified copy from this choice to show.`));
|
|
199
|
+
copyFacts(copy, body);
|
|
200
|
+
const actions = modal.querySelector('.modal-actions'); actions.replaceChildren();
|
|
201
|
+
if (copy) action('Show saved copy', 'shell.parser-setup-show-copy', showFolder('copy'));
|
|
202
|
+
const done = action('Done', 'shell.parser-setup-done', close, true); updateBusy(false); done.focus(); refreshFocused();
|
|
203
|
+
}
|
|
204
|
+
const isReady = (result) => {
|
|
205
|
+
const setup = result.setup || result;
|
|
206
|
+
if (setup.apps && Object.prototype.hasOwnProperty.call(setup.apps, selected)) return setup.apps[selected] === 'ready';
|
|
207
|
+
return (setup.parserStatus || setup.status) === 'ready';
|
|
208
|
+
};
|
|
209
|
+
async function load(notice = '') {
|
|
210
|
+
changeState();
|
|
211
|
+
updateBusy(true); error(notice);
|
|
212
|
+
try {
|
|
213
|
+
preview = await api('/api/parser-setup/preview', { appId: selected });
|
|
214
|
+
if (modal) { renderPreview(); error(notice); }
|
|
215
|
+
} catch (failure) { if (modal) renderFailure(failure); }
|
|
216
|
+
finally { updateBusy(false); modal?.querySelector('.modal-actions button')?.focus(); refreshFocused(); }
|
|
217
|
+
}
|
|
218
|
+
async function retry() {
|
|
219
|
+
changeState();
|
|
220
|
+
updateBusy(true); error('');
|
|
221
|
+
try {
|
|
222
|
+
const result = await api(selected === 'tekla-parser' ? '/api/tekla-defaults/retry' : '/api/rvt-defaults/retry', {});
|
|
223
|
+
if (isReady(result)) { renderReady(null); return; }
|
|
224
|
+
incompleteReview = false;
|
|
225
|
+
await load(`${failureText(result.code || result.failureCode)} The setup choices were refreshed. Review them before continuing.`);
|
|
226
|
+
} catch (failure) { renderFailure(failure); }
|
|
227
|
+
finally { updateBusy(false); }
|
|
228
|
+
}
|
|
229
|
+
async function confirm() {
|
|
230
|
+
changeState();
|
|
231
|
+
updateBusy(true, 'setup'); error(''); modal.querySelector('[data-setup-status]').textContent = 'Setting up a fresh parser. Keep FloLess open.';
|
|
232
|
+
try {
|
|
233
|
+
const result = await api('/api/parser-setup/confirm', { appId: selected, fingerprint: preview.fingerprint,
|
|
234
|
+
templateSha256: preview.templateSha256, allowIncompleteCopy: incompleteReview });
|
|
235
|
+
if (isReady(result)) renderReady(result.copy);
|
|
236
|
+
else renderFailure({ body: result });
|
|
237
|
+
} catch (failure) { renderFailure(failure); }
|
|
238
|
+
finally { modal?.querySelector('[data-setup-status]')?.replaceChildren(); updateBusy(false); }
|
|
239
|
+
}
|
|
240
|
+
window.flolessParserSetupRecovery = { open: async (id, opener) => {
|
|
241
|
+
if (busy) return; create(id, opener); updateBusy(true);
|
|
242
|
+
try {
|
|
243
|
+
// Use the established browser session once. Recreating it between preview and confirm
|
|
244
|
+
// would invalidate the exact local UI decision; desktop IPC sessions already carry it.
|
|
245
|
+
const response = await fetch('/api/editor/session', { method: 'POST', credentials: 'same-origin' });
|
|
246
|
+
if (!response.ok && response.status !== 403) throw new Error('The local browser session could not be opened. Close this dialog and sign in again.');
|
|
247
|
+
await load();
|
|
248
|
+
} catch (failure) { renderFailure(failure); }
|
|
249
|
+
} };
|
|
250
|
+
})();
|